28#include "../CommonCommandFlags.h"
31#include "../ProjectWindows.h"
35#include "../widgets/Overlay.h"
37#include "../TrackPanel.h"
39#include "../tracks/playabletrack/wavetrack/ui/WaveformAppearance.h"
55#include "../prefs/PrefsDialog.h"
58#include "../tracks/ui/ChannelView.h"
88 {
XO(
"Preferences") },
123 {
return VisitSettings<false>(
S); }
126 {
return VisitSettings<true>(
S); }
132 S.StartMultiColumn(2, wxALIGN_CENTER);
134 S.TieChoice(
XXO(
"Type:"),
136 S.TieChoice(
XXO(
"Format:"),
151 std::make_unique<LispifiedCommandOutputTargets>( *context.
pOutput.get() )
160 std::make_unique<BriefCommandOutputTargets>( *context.
pOutput.get() )
182 context.
Status(
"Command options not recognised" );
191 wxLogDebug(
"No menus");
195 size_t cnt = pBar->GetMenuCount();
201 Label = pBar->GetMenuLabelText( i );
205 context.
AddItem( Label,
"label" );
206 context.
AddItem(
"",
"accel" );
208 ExploreMenu( context, pBar->GetMenu( i ), pBar->GetId(), 1 );
227 wxCheckBox * TieCheckBox(
230 wxCheckBox * TieCheckBoxOnRight(
240 const std::vector<int> * pInternalChoices,
int iNoMatchSelector)
override;
242 wxTextCtrl * TieTextBox(
245 const int nChars)
override;
246 wxTextCtrl * TieIntegerTextBox(
249 const int nChars)
override;
250 wxTextCtrl * TieNumericTextBox(
253 const int nChars,
bool acceptEnter)
override;
254 wxSlider * TieSlider(
258 const int min = 0)
override;
259 wxSpinCtrl * TieSpinCtrl(
263 const int min)
override;
266ShuttleGuiGetDefinition::ShuttleGuiGetDefinition(
325 const std::vector<int> * pInternalChoices,
int iNoMatchSelector)
337 Prompt,
Setting, Choices, pInternalChoices, iNoMatchSelector );
371 const int nChars,
bool acceptEnter)
421 ShuttleGuiGetDefinition
S(pWin, *((context.
pOutput)->mStatusTarget) );
438 if (!command.empty()){
440 plug.GetID(), context, flags);
454 wxRect R = pWin->GetScreenRect();
461 context.
AddItem(
"Audacity Window",
"name" );
464 context.
AddItem( R.GetLeft() );
466 context.
AddItem( R.GetRight() );
467 context.
AddItem( R.GetBottom() );
472 ExploreAdornments( context, pWin->GetPosition()+wxSize( 6,-1), pWin, pWin->GetId(), 1 );
473 ExploreWindows( context, pWin->GetPosition()+wxSize( 6,-1), pWin, pWin->GetId(), 1 );
488 context.
AddItem( trk->GetName(),
"name" );
489 context.
AddBool( (trk == fTrack),
"focused");
490 context.
AddBool( trk->GetSelected(),
"selected" );
493 trk->TypeSwitch( [&] (
const WaveTrack &t) {
496 context.
AddItem(
"wave",
"kind" );
504 context.
AddItem( vzmin,
"VZoomMin");
505 context.
AddItem( vzmax,
"VZoomMax");
509 context.
AddItem(
"note",
"kind" );
513 context.
AddItem(
"label",
"kind" );
516 context.
AddItem(
"time",
"kind" );
531 t->TypeSwitch([&](
WaveTrack &waveTrack) {
532 for (
const auto pInterval : waveTrack.
Intervals()) {
533 context.StartStruct();
534 context.AddItem((double)i,
"track");
535 context.AddItem(pInterval->GetPlayStartTime(),
"start");
536 context.AddItem(pInterval->GetPlayEndTime(),
"end");
539 WaveColorAttachment::Get(**pInterval->Channels().begin());
540 context.AddItem(colors.GetColorIndex(),
"color");
541 context.AddItem(pInterval->GetName(),
"name");
560 t->TypeSwitch([&](
WaveTrack &waveTrack) {
563 for (
auto &pClip : ptrs) {
565 context.
AddItem((
double)i,
"track");
566 context.
AddItem((
double)j,
"clip");
567 context.
AddItem(pClip->GetPlayStartTime(),
"start");
568 const auto pEnv = &pClip->GetEnvelope();
571 double offset = pEnv->GetOffset();
572 for (
size_t k = 0; k < pEnv->GetNumberOfPoints(); k++)
575 context.
AddItem((*pEnv)[k].GetT() + offset,
"t");
576 context.
AddItem((*pEnv)[k].GetVal(),
"y");
581 context.
AddItem(pClip->GetPlayEndTime(),
"end");
602#ifdef VERBOSE_LABELS_FORMATTING
603 for (
int nn = 0; nn< (int)labelTrack->
mLabels.size(); nn++) {
606 context.
AddItem( (
double)i,
"track" );
641 context.
AddItem(selectedRegion.t0(),
"Start");
642 context.
AddItem(selectedRegion.t1(),
"End");
655 static_cast<void>(Id);
661 wxMenuItemList list = pMenu->GetMenuItems();
662 size_t lcnt = list.size();
668 for (
size_t lndx = 0; lndx < lcnt; lndx++) {
669 item = list.Item(lndx)->GetData();
670 Label = item->GetItemLabelText();
671 Name = commandManager.GetNameFromNumericID( item->GetId() );
672 Accel = item->GetItemLabel();
673 if( Accel.Contains(
"\t") )
674 Accel = Accel.AfterLast(
'\t');
677 if( item->IsSeparator() )
680 if (item->IsSubMenu())
682 if (item->IsCheck() && item->IsChecked())
686 context.
AddItem( depth,
"depth" );
687 context.
AddItem( flags,
"flags" );
688 context.
AddItem( Label,
"label" );
689 context.
AddItem( Accel,
"accel" );
693 context.
AddItem( Name.GET(),
"id" );
696 if (item->IsSubMenu()) {
697 pMenu = item->GetSubMenu();
698 ExploreMenu( context, pMenu, item->GetId(), depth+1 );
704 wxPoint WXUNUSED(
P), wxWindow * pWin,
int WXUNUSED(Id),
int depth )
712 wxRect R1 = pWin->GetScreenRect();
713 wxSize s = pWin->GetWindowBorderSize();
714 wxRect R( 2,32, R1.GetWidth() - s.GetWidth() * 2 -16, 22 );
717 context.
AddItem( depth,
"depth" );
718 context.
AddItem(
"MenuBar",
"label" );
721 context.
AddItem( R.GetLeft() );
723 context.
AddItem( R.GetRight() );
724 context.
AddItem( R.GetBottom() );
731 wxPoint
P,
int depth )
735 wxRect panelRect{ {}, tp.GetSize() };
737 for (
auto pChannel : pTrack->Channels()) {
738 auto rulers = tp.FindRulerRects(*pChannel);
739 for (
auto &R : rulers) {
740 if (!R.Intersects(panelRect))
742 R.SetPosition( R.GetPosition() +
P );
744 context.
AddItem( depth,
"depth" );
745 context.
AddItem(
"VRuler",
"label" );
748 context.
AddItem( R.GetLeft() );
750 context.
AddItem( R.GetRight() );
751 context.
AddItem( R.GetBottom() );
762 wxPoint
P, wxWindow * pWin,
int Id,
int depth )
764 static_cast<void>(Id);
766 if( pWin->GetName() ==
"Track Panel" )
768 wxRect R = pWin->GetScreenRect();
769 ExploreTrackPanel( context, R.GetPosition()-
P, depth );
772 wxWindowList list = pWin->GetChildren();
773 size_t lcnt = list.size();
775 for (
size_t lndx = 0; lndx < lcnt; lndx++) {
776 wxWindow * item = list[lndx];
777 if( !item->IsShown() )
779 wxRect R = item->GetScreenRect();
780 R.SetPosition( R.GetPosition() -
P );
781 wxString Name = item->GetName();
783 if( Name.StartsWith(
"static" ) )
786 if( Name ==
"panel" )
789 Name = wxString(
"*") + item->GetToolTipText();
792 context.
AddItem( depth,
"depth" );
793 context.
AddItem( Name,
"label" );
794 context.
AddItem( item->GetId(),
"id" );
797 context.
AddItem( R.GetLeft() );
799 context.
AddItem( R.GetRight() );
800 context.
AddItem( R.GetBottom() );
805 ExploreWindows( context,
P, item, item->GetId(), depth+1 );
821 wxT(
"Optional/Extra/Part2/Scriptables2")
const ReservedCommandFlag & AudioIONotBusyFlag()
XXO("&Cut/Copy/Paste Toolbar")
static const EnumValueSymbol kTypes[nTypes]
static const EnumValueSymbol kFormats[nFormats]
Contains declaration of GetInfoCommand class.
@ PluginTypeAudacityCommand
AUDACITY_DLL_API wxFrame & GetProjectFrame(AudacityProject &project)
Get the top-level window associated with the project (as a wxFrame only, when you do not need to use ...
Declarations for SelectCommand and SelectCommandType classes.
TranslatableStrings Msgids(const EnumValueSymbol strings[], size_t nStrings)
Convenience function often useful when adding choice controls.
for(int ii=0, nn=names.size();ii< nn;++ii)
std::vector< TranslatableString > TranslatableStrings
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
This specialization of Setting for bool adds a Toggle method to negate the saved value.
const wxString & Key() const
const EnumValueSymbols & GetSymbols() const
const EnumValueSymbol & Default() const
Subclass & Get(const RegisteredFactory &key)
Get reference to an attachment, creating on demand if not present, down-cast it to Subclass.
CommandContext provides additional information to an 'Apply()' command. It provides the project,...
virtual void Status(const wxString &message, bool bFlush=false) const
void AddBool(const bool value, const wxString &name={}) const
void StartField(const wxString &name) const
void AddItem(const wxString &value, const wxString &name={}) const
AudacityProject & project
std::unique_ptr< CommandOutputTargets > pOutput
static CommandManager & Get(AudacityProject &project)
CommandMessageTargetDecorator is a CommandOutputTarget that forwards its work on to another one....
void AddBool(const bool value, const wxString &name={}) override
void StartStruct() override
void StartField(const wxString &name={}) override
void AddItem(const wxString &value, const wxString &name={}) override
void EndStruct() override
void StartArray() override
Interface for objects that can receive (string) messages from a command.
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
const wxString & Internal() const
Specialization of Setting for double.
void GetCommandDefinition(const PluginID &ID, const CommandContext &context, int flags)
static EffectAndCommandPluginManager & Get()
const wxArrayStringEx & GetInternals() const
void ExploreWindows(const CommandContext &context, wxPoint P, wxWindow *pWin, int Id, int depth)
bool Apply(const CommandContext &context) override
bool SendClips(const CommandContext &context)
bool SendCommands(const CommandContext &context, int flags)
bool SendEnvelopes(const CommandContext &context)
bool SendLabels(const CommandContext &context)
void ExploreMenu(const CommandContext &context, wxMenu *pMenu, int Id, int depth)
bool VisitSettings(SettingsVisitorBase< Const > &S)
void PopulateOrExchange(ShuttleGui &S) override
static const ComponentInterfaceSymbol Symbol
void ExploreTrackPanel(const CommandContext &context, wxPoint P, int depth)
bool ApplyInner(const CommandContext &context)
bool SendTracks(const CommandContext &context)
bool SendBoxes(const CommandContext &context)
bool SendMenus(const CommandContext &context)
bool SendPreferences(const CommandContext &context)
void ExploreAdornments(const CommandContext &context, wxPoint P, wxWindow *pWin, int Id, int depth)
bool SendSelection(const CommandContext &context)
Specialization of Setting for int.
A LabelTrack is a Track that holds labels (LabelStruct).
const LabelArray & GetLabels() const
A Track that is used for Midi notes. (Somewhat old code).
PluginManager maintains a list of all plug ins. That covers modules, effects, generators,...
Range PluginsOfType(int type)
CommandID GetCommandIdentifier(const PluginID &ID) const
static PluginManager & Get()
void ShuttleAll(ShuttleGui &S)
Generates classes whose instances register items at construction.
const SettingPath & GetPath() const
const T & GetDefault() const
Visitor of effect or command parameters. This is a base class with lots of virtual functions that do ...
virtual wxTextCtrl * TieIntegerTextBox(const TranslatableString &Prompt, const IntSetting &Setting, const int nChars)
wxChoice * TieChoice(const TranslatableString &Prompt, TranslatableString &Selected, const TranslatableStrings &choices)
wxCheckBox * TieCheckBox(const TranslatableString &Prompt, bool &Var)
virtual wxChoice * TieNumberAsChoice(const TranslatableString &Prompt, IntSetting &Setting, const TranslatableStrings &Choices, const std::vector< int > *pInternalChoices=nullptr, int iNoMatchSelector=0)
wxCheckBox * TieCheckBoxOnRight(const TranslatableString &Prompt, bool &Var)
wxTextCtrl * TieNumericTextBox(const TranslatableString &Prompt, int &Value, const int nChars=0, bool acceptEnter=false)
wxSpinCtrl * TieSpinCtrl(const TranslatableString &Prompt, int &Value, const int max, const int min=0)
wxTextCtrl * TieTextBox(const TranslatableString &Caption, wxString &Value, const int nChars=0)
wxSlider * TieSlider(const TranslatableString &Prompt, int &pos, const int max, const int min=0)
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Specialization of Setting for strings.
A kind of Track used to 'warp time'.
Abstract base class for an object holding data associated with points on a time axis.
static TrackList & Get(AudacityProject &project)
static TrackPanel & Get(AudacityProject &project)
Holds a msgid for the translation catalog; may also bind format arguments.
wxString Translation() const
NotifyingSelectedRegion selectedRegion
static ViewInfo & Get(AudacityProject &project)
A Track that contains audio waveform data.
bool GetMute() const override
May vary asynchronously.
double GetStartTime() const override
Implement WideSampleSequence.
IntervalHolders SortedIntervalArray()
Return all WaveClips sorted by clip play start time.
double GetEndTime() const override
Implement WideSampleSequence.
bool GetSolo() const override
May vary asynchronously.
size_t NChannels() const override
A constant property.
Shuttle that retrieves a JSON format definition of a command's parameters.
wxChoice * TieChoice(const TranslatableString &Prompt, ChoiceSetting &choiceSetting) override
virtual ~ShuttleGuiGetDefinition()
wxSpinCtrl * TieSpinCtrl(const TranslatableString &Prompt, const IntSetting &Setting, const int max, const int min) override
wxCheckBox * TieCheckBoxOnRight(const TranslatableString &Prompt, const BoolSetting &Setting) override
wxTextCtrl * TieIntegerTextBox(const TranslatableString &Prompt, const IntSetting &Setting, const int nChars) override
wxCheckBox * TieCheckBox(const TranslatableString &Prompt, const BoolSetting &Setting) override
wxTextCtrl * TieTextBox(const TranslatableString &Prompt, const StringSetting &Setting, const int nChars) override
wxChoice * TieNumberAsChoice(const TranslatableString &Prompt, IntSetting &Setting, const TranslatableStrings &Choices, const std::vector< int > *pInternalChoices, int iNoMatchSelector) override
wxTextCtrl * TieNumericTextBox(const TranslatableString &Prompt, const DoubleSetting &Setting, const int nChars, bool acceptEnter) override
wxSlider * TieSlider(const TranslatableString &Prompt, const IntSetting &Setting, const int max, const int min=0) override
AUDACITY_DLL_API void OnAudacityCommand(const CommandContext &ctx)
BuiltinCommandsModule::Registration< GetInfoCommand > reg