28#include "../ProjectWindows.h"
31#include "../effects/EffectManager.h"
32#include "../widgets/Overlay.h"
33#include "../TrackPanelAx.h"
34#include "../TrackPanel.h"
35#include "../WaveClip.h"
37#include "../WaveTrack.h"
38#include "../LabelTrack.h"
39#include "../NoteTrack.h"
40#include "../TimeTrack.h"
44#include "../ShuttleGui.h"
47#include "../prefs/PrefsDialog.h"
48#include "../Shuttle.h"
50#include "../tracks/ui/TrackView.h"
51#include "../ShuttleGui.h"
79 {
XO(
"Preferences") },
113 {
return VisitSettings<false>(
S); }
116 {
return VisitSettings<true>(
S); }
122 S.StartMultiColumn(2, wxALIGN_CENTER);
124 S.TieChoice(
XXO(
"Type:"),
126 S.TieChoice(
XXO(
"Format:"),
141 std::make_unique<LispifiedCommandOutputTargets>( *context.
pOutput.get() )
150 std::make_unique<BriefCommandOutputTargets>( *context.
pOutput.get() )
171 context.
Status(
"Command options not recognised" );
180 wxLogDebug(
"No menus");
184 size_t cnt = pBar->GetMenuCount();
190 Label = pBar->GetMenuLabelText( i );
194 context.
AddItem( Label,
"label" );
195 context.
AddItem(
"",
"accel" );
197 ExploreMenu( context, pBar->GetMenu( i ), pBar->GetId(), 1 );
216 wxCheckBox * TieCheckBox(
219 wxCheckBox * TieCheckBoxOnRight(
229 const std::vector<int> * pInternalChoices,
int iNoMatchSelector)
override;
231 wxTextCtrl * TieTextBox(
234 const int nChars)
override;
235 wxTextCtrl * TieIntegerTextBox(
238 const int nChars)
override;
239 wxTextCtrl * TieNumericTextBox(
242 const int nChars)
override;
243 wxSlider * TieSlider(
247 const int min = 0)
override;
248 wxSpinCtrl * TieSpinCtrl(
252 const int min)
override;
255ShuttleGuiGetDefinition::ShuttleGuiGetDefinition(
314 const std::vector<int> * pInternalChoices,
int iNoMatchSelector)
326 Prompt,
Setting, Choices, pInternalChoices, iNoMatchSelector );
410 ShuttleGuiGetDefinition
S(pWin, *((context.
pOutput)->mStatusTarget) );
428 if (!command.empty()){
443 wxRect R = pWin->GetScreenRect();
450 context.
AddItem(
"Audacity Window",
"name" );
453 context.
AddItem( R.GetLeft() );
455 context.
AddItem( R.GetRight() );
456 context.
AddItem( R.GetBottom() );
461 ExploreAdornments( context, pWin->GetPosition()+wxSize( 6,-1), pWin, pWin->GetId(), 1 );
462 ExploreWindows( context, pWin->GetPosition()+wxSize( 6,-1), pWin, pWin->GetId(), 1 );
471 for (
auto trk : tracks.Leaders())
477 context.
AddItem( trk->GetName(),
"name" );
478 context.
AddBool( (trk == fTrack),
"focused");
479 context.
AddBool( trk->GetSelected(),
"selected" );
482 trk->TypeSwitch( [&] (
const WaveTrack* t ) {
485 context.
AddItem(
"wave",
"kind" );
493 context.
AddItem( vzmin,
"VZoomMin");
494 context.
AddItem( vzmax,
"VZoomMax");
498 context.
AddItem(
"note",
"kind" );
502 context.
AddItem(
"label",
"kind" );
505 context.
AddItem(
"time",
"kind" );
519 for (
auto t : tracks.Leaders()) {
520 t->TypeSwitch([&](
WaveTrack *waveTrack) {
524 context.
AddItem((
double)i,
"track");
525 context.
AddItem(pClip->GetPlayStartTime(),
"start");
526 context.
AddItem(pClip->GetPlayEndTime(),
"end");
527 context.
AddItem(pClip->GetColourIndex(),
"color");
545 for (
auto t : tracks.Leaders()) {
546 t->TypeSwitch([&](
WaveTrack *waveTrack) {
551 context.
AddItem((
double)i,
"track");
552 context.
AddItem((
double)j,
"clip");
553 context.
AddItem(pClip->GetPlayStartTime(),
"start");
554 Envelope * pEnv = pClip->GetEnvelope();
561 context.
AddItem((*pEnv)[k].GetT() + offset,
"t");
562 context.
AddItem((*pEnv)[k].GetVal(),
"y");
567 context.
AddItem(pClip->GetPlayEndTime(),
"end");
586 for (
auto t : tracks.Leaders()) {
588#ifdef VERBOSE_LABELS_FORMATTING
589 for (
int nn = 0; nn< (int)labelTrack->
mLabels.size(); nn++) {
592 context.
AddItem( (
double)i,
"track" );
627 static_cast<void>(Id);
633 wxMenuItemList list = pMenu->GetMenuItems();
634 size_t lcnt = list.size();
640 for (
size_t lndx = 0; lndx < lcnt; lndx++) {
641 item = list.Item(lndx)->GetData();
642 Label = item->GetItemLabelText();
643 Name = commandManager.GetNameFromNumericID( item->GetId() );
644 Accel = item->GetItemLabel();
645 if( Accel.Contains(
"\t") )
646 Accel = Accel.AfterLast(
'\t');
649 if( item->IsSeparator() )
652 if (item->IsSubMenu())
654 if (item->IsCheck() && item->IsChecked())
658 context.
AddItem( depth,
"depth" );
659 context.
AddItem( flags,
"flags" );
660 context.
AddItem( Label,
"label" );
661 context.
AddItem( Accel,
"accel" );
665 context.
AddItem( Name.GET(),
"id" );
668 if (item->IsSubMenu()) {
669 pMenu = item->GetSubMenu();
670 ExploreMenu( context, pMenu, item->GetId(), depth+1 );
676 wxPoint WXUNUSED(
P), wxWindow * pWin,
int WXUNUSED(Id),
int depth )
684 wxRect R1 = pWin->GetScreenRect();
685 wxSize s = pWin->GetWindowBorderSize();
686 wxRect R( 2,32, R1.GetWidth() - s.GetWidth() * 2 -16, 22 );
689 context.
AddItem( depth,
"depth" );
690 context.
AddItem(
"MenuBar",
"label" );
693 context.
AddItem( R.GetLeft() );
695 context.
AddItem( R.GetRight() );
696 context.
AddItem( R.GetBottom() );
703 wxPoint
P,
int depth )
707 wxRect panelRect{ {}, tp.GetSize() };
709 auto rulers = tp.FindRulerRects(t);
710 for (
auto &R : rulers) {
711 if (!R.Intersects(panelRect))
713 R.SetPosition( R.GetPosition() +
P );
715 context.
AddItem( depth,
"depth" );
716 context.
AddItem(
"VRuler",
"label" );
719 context.
AddItem( R.GetLeft() );
721 context.
AddItem( R.GetRight() );
722 context.
AddItem( R.GetBottom() );
732 wxPoint
P, wxWindow * pWin,
int Id,
int depth )
734 static_cast<void>(Id);
736 if( pWin->GetName() ==
"Track Panel" )
738 wxRect R = pWin->GetScreenRect();
739 ExploreTrackPanel( context, R.GetPosition()-
P, depth );
742 wxWindowList list = pWin->GetChildren();
743 size_t lcnt = list.size();
745 for (
size_t lndx = 0; lndx < lcnt; lndx++) {
746 wxWindow * item = list[lndx];
747 if( !item->IsShown() )
749 wxRect R = item->GetScreenRect();
750 R.SetPosition( R.GetPosition() -
P );
751 wxString Name = item->GetName();
753 if( Name.StartsWith(
"static" ) )
756 if( Name ==
"panel" )
759 Name = wxString(
"*") + item->GetToolTipText();
762 context.
AddItem( depth,
"depth" );
763 context.
AddItem( Name,
"label" );
764 context.
AddItem( item->GetId(),
"id" );
767 context.
AddItem( R.GetLeft() );
769 context.
AddItem( R.GetRight() );
770 context.
AddItem( R.GetBottom() );
775 ExploreWindows( context,
P, item, item->GetId(), depth+1 );
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)
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)
wxTextCtrl * TieNumericTextBox(const TranslatableString &Prompt, int &Value, const int nChars=0)
wxCheckBox * TieCheckBoxOnRight(const TranslatableString &Prompt, bool &Var)
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.
auto Any() -> TrackIterRange< TrackType >
static TrackList & Get(AudacityProject &project)
static auto Channels(TrackType *pTrack) -> TrackIterRange< TrackType >
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.
double GetStartTime() const override
Get the time at which the first clip in the track starts.
WaveClipPointers SortedClipArray()
double GetEndTime() const override
Get the time at which the last clip in the track ends, plus recorded stuff.
void GetDisplayBounds(float *min, float *max) const
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
wxSlider * TieSlider(const TranslatableString &Prompt, const IntSetting &Setting, const int max, const int min=0) override
wxTextCtrl * TieNumericTextBox(const TranslatableString &Prompt, const DoubleSetting &Setting, const int nChars) override
BuiltinCommandsModule::Registration< GetInfoCommand > reg