27#include "../CommonCommandFlags.h"
30#include "../ProjectWindows.h"
33#include "../effects/EffectManager.h"
34#include "../widgets/Overlay.h"
36#include "../TrackPanel.h"
41#include "../LabelTrack.h"
50#include "../prefs/PrefsDialog.h"
53#include "../tracks/ui/ChannelView.h"
82 {
XO(
"Preferences") },
116 {
return VisitSettings<false>(
S); }
119 {
return VisitSettings<true>(
S); }
125 S.StartMultiColumn(2, wxALIGN_CENTER);
127 S.TieChoice(
XXO(
"Type:"),
129 S.TieChoice(
XXO(
"Format:"),
144 std::make_unique<LispifiedCommandOutputTargets>( *context.
pOutput.get() )
153 std::make_unique<BriefCommandOutputTargets>( *context.
pOutput.get() )
174 context.
Status(
"Command options not recognised" );
183 wxLogDebug(
"No menus");
187 size_t cnt = pBar->GetMenuCount();
193 Label = pBar->GetMenuLabelText( i );
197 context.
AddItem( Label,
"label" );
198 context.
AddItem(
"",
"accel" );
200 ExploreMenu( context, pBar->GetMenu( i ), pBar->GetId(), 1 );
219 wxCheckBox * TieCheckBox(
222 wxCheckBox * TieCheckBoxOnRight(
232 const std::vector<int> * pInternalChoices,
int iNoMatchSelector)
override;
234 wxTextCtrl * TieTextBox(
237 const int nChars)
override;
238 wxTextCtrl * TieIntegerTextBox(
241 const int nChars)
override;
242 wxTextCtrl * TieNumericTextBox(
245 const int nChars,
bool acceptEnter)
override;
246 wxSlider * TieSlider(
250 const int min = 0)
override;
251 wxSpinCtrl * TieSpinCtrl(
255 const int min)
override;
258ShuttleGuiGetDefinition::ShuttleGuiGetDefinition(
317 const std::vector<int> * pInternalChoices,
int iNoMatchSelector)
329 Prompt,
Setting, Choices, pInternalChoices, iNoMatchSelector );
363 const int nChars,
bool acceptEnter)
413 ShuttleGuiGetDefinition
S(pWin, *((context.
pOutput)->mStatusTarget) );
431 if (!command.empty()){
446 wxRect R = pWin->GetScreenRect();
453 context.
AddItem(
"Audacity Window",
"name" );
456 context.
AddItem( R.GetLeft() );
458 context.
AddItem( R.GetRight() );
459 context.
AddItem( R.GetBottom() );
464 ExploreAdornments( context, pWin->GetPosition()+wxSize( 6,-1), pWin, pWin->GetId(), 1 );
465 ExploreWindows( context, pWin->GetPosition()+wxSize( 6,-1), pWin, pWin->GetId(), 1 );
480 context.
AddItem( trk->GetName(),
"name" );
481 context.
AddBool( (trk == fTrack),
"focused");
482 context.
AddBool( trk->GetSelected(),
"selected" );
485 trk->TypeSwitch( [&] (
const WaveTrack &t) {
488 context.
AddItem(
"wave",
"kind" );
496 context.
AddItem( vzmin,
"VZoomMin");
497 context.
AddItem( vzmax,
"VZoomMax");
501 context.
AddItem(
"note",
"kind" );
505 context.
AddItem(
"label",
"kind" );
508 context.
AddItem(
"time",
"kind" );
523 t->TypeSwitch([&](
WaveTrack &waveTrack) {
527 context.
AddItem((
double)i,
"track");
528 context.
AddItem(pClip->GetPlayStartTime(),
"start");
529 context.
AddItem(pClip->GetPlayEndTime(),
"end");
530 context.
AddItem(pClip->GetColourIndex(),
"color");
531 context.
AddItem(pClip->GetName(),
"name");
550 t->TypeSwitch([&](
WaveTrack &waveTrack) {
555 context.
AddItem((
double)i,
"track");
556 context.
AddItem((
double)j,
"clip");
557 context.
AddItem(pClip->GetPlayStartTime(),
"start");
558 Envelope * pEnv = pClip->GetEnvelope();
565 context.
AddItem((*pEnv)[k].GetT() + offset,
"t");
566 context.
AddItem((*pEnv)[k].GetVal(),
"y");
571 context.
AddItem(pClip->GetPlayEndTime(),
"end");
592#ifdef VERBOSE_LABELS_FORMATTING
593 for (
int nn = 0; nn< (int)labelTrack->
mLabels.size(); nn++) {
596 context.
AddItem( (
double)i,
"track" );
631 static_cast<void>(Id);
637 wxMenuItemList list = pMenu->GetMenuItems();
638 size_t lcnt = list.size();
644 for (
size_t lndx = 0; lndx < lcnt; lndx++) {
645 item = list.Item(lndx)->GetData();
646 Label = item->GetItemLabelText();
647 Name = commandManager.GetNameFromNumericID( item->GetId() );
648 Accel = item->GetItemLabel();
649 if( Accel.Contains(
"\t") )
650 Accel = Accel.AfterLast(
'\t');
653 if( item->IsSeparator() )
656 if (item->IsSubMenu())
658 if (item->IsCheck() && item->IsChecked())
662 context.
AddItem( depth,
"depth" );
663 context.
AddItem( flags,
"flags" );
664 context.
AddItem( Label,
"label" );
665 context.
AddItem( Accel,
"accel" );
669 context.
AddItem( Name.GET(),
"id" );
672 if (item->IsSubMenu()) {
673 pMenu = item->GetSubMenu();
674 ExploreMenu( context, pMenu, item->GetId(), depth+1 );
680 wxPoint WXUNUSED(
P), wxWindow * pWin,
int WXUNUSED(Id),
int depth )
688 wxRect R1 = pWin->GetScreenRect();
689 wxSize s = pWin->GetWindowBorderSize();
690 wxRect R( 2,32, R1.GetWidth() - s.GetWidth() * 2 -16, 22 );
693 context.
AddItem( depth,
"depth" );
694 context.
AddItem(
"MenuBar",
"label" );
697 context.
AddItem( R.GetLeft() );
699 context.
AddItem( R.GetRight() );
700 context.
AddItem( R.GetBottom() );
707 wxPoint
P,
int depth )
711 wxRect panelRect{ {}, tp.GetSize() };
713 for (
auto t : leader->Channels()) {
714 auto rulers = tp.FindRulerRects(*t);
715 for (
auto &R : rulers) {
716 if (!R.Intersects(panelRect))
718 R.SetPosition( R.GetPosition() +
P );
720 context.
AddItem( depth,
"depth" );
721 context.
AddItem(
"VRuler",
"label" );
724 context.
AddItem( R.GetLeft() );
726 context.
AddItem( R.GetRight() );
727 context.
AddItem( R.GetBottom() );
738 wxPoint
P, wxWindow * pWin,
int Id,
int depth )
740 static_cast<void>(Id);
742 if( pWin->GetName() ==
"Track Panel" )
744 wxRect R = pWin->GetScreenRect();
745 ExploreTrackPanel( context, R.GetPosition()-
P, depth );
748 wxWindowList list = pWin->GetChildren();
749 size_t lcnt = list.size();
751 for (
size_t lndx = 0; lndx < lcnt; lndx++) {
752 wxWindow * item = list[lndx];
753 if( !item->IsShown() )
755 wxRect R = item->GetScreenRect();
756 R.SetPosition( R.GetPosition() -
P );
757 wxString Name = item->GetName();
759 if( Name.StartsWith(
"static" ) )
762 if( Name ==
"panel" )
765 Name = wxString(
"*") + item->GetToolTipText();
768 context.
AddItem( depth,
"depth" );
769 context.
AddItem( Name,
"label" );
770 context.
AddItem( item->GetId(),
"id" );
773 context.
AddItem( R.GetLeft() );
775 context.
AddItem( R.GetRight() );
776 context.
AddItem( R.GetBottom() );
781 ExploreWindows( context,
P, item, item->GetId(), depth+1 );
797 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.
std::vector< TranslatableString > TranslatableStrings
std::vector< WaveClip * > WaveClipPointers
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.
EffectManager is the class that handles effects and effect categories.
CommandID GetCommandIdentifier(const PluginID &ID)
void GetCommandDefinition(const PluginID &ID, const CommandContext &context, int flags)
static EffectManager & Get()
const wxArrayStringEx & GetInternals() const
Piecewise linear or piecewise exponential function from double to double.
size_t GetNumberOfPoints() const
Return number of points.
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)
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)
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
This allows multiple clips to be a part of one WaveTrack.
A Track that contains audio waveform data.
bool GetMute() const override
May vary asynchronously.
double GetStartTime() const override
Implement WideSampleSequence.
WaveClipPointers SortedClipArray()
double GetEndTime() const override
Implement WideSampleSequence.
bool GetSolo() const override
May vary asynchronously.
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