Audacity 3.2.0
GetInfoCommand.cpp
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity - A Digital Audio Editor
4 Copyright 1999-2018 Audacity Team
5 License: wxWidgets
6
7 James Crook
8
9******************************************************************//*******************************************************************/
22
23
24#include "GetInfoCommand.h"
25
26#include "CommandDispatch.h"
27#include "../CommonCommandFlags.h"
28#include "LoadCommands.h"
29#include "Project.h"
30#include "../ProjectWindows.h"
31#include "CommandManager.h"
32#include "CommandTargets.h"
33#include "../effects/EffectManager.h"
34#include "../widgets/Overlay.h"
35#include "TrackFocus.h"
36#include "../TrackPanel.h"
37#include "WaveClip.h"
38#include "ViewInfo.h"
39#include "WaveTrack.h"
41#include "../LabelTrack.h"
42#include "NoteTrack.h"
43#include "TimeTrack.h"
44#include "Envelope.h"
45
46#include "SelectCommand.h"
47#include "ShuttleGui.h"
48#include "CommandContext.h"
49
50#include "../prefs/PrefsDialog.h"
51#include "SettingsVisitor.h"
52#include "PluginManager.h"
53#include "../tracks/ui/ChannelView.h"
54#include "ShuttleGui.h"
55
56#include <wx/frame.h>
57#include <wx/log.h>
58#include <wx/menu.h>
59
61{ XO("Get Info") };
62
64enum {
66 //kCommandsPlus,
74 nTypes
75};
76
78{
79 { XO("Commands") },
80 //{ wxT("CommandsPlus"), XO("Commands Plus") },
81 { XO("Menus") },
82 { XO("Preferences") },
83 { XO("Tracks") },
84 { XO("Clips") },
85 { XO("Envelopes") },
86 { XO("Labels") },
87 { XO("Boxes") },
88};
89
90enum {
95};
96
98{
99 // These are acceptable dual purpose internal/visible names
100
101 /* i18n-hint JavaScript Object Notation */
102 { XO("JSON") },
103 /* i18n-hint name of a computer programming language */
104 { XO("LISP") },
105 { XO("Brief") }
106};
107
108template<bool Const>
110 S.DefineEnum( mInfoType, wxT("Type"), 0, kTypes, nTypes );
111 S.DefineEnum( mFormat, wxT("Format"), 0, kFormats, nFormats );
112 return true;
113}
114
116 { return VisitSettings<false>(S); }
117
119 { return VisitSettings<true>(S); }
120
122{
123 S.AddSpace(0, 5);
124
125 S.StartMultiColumn(2, wxALIGN_CENTER);
126 {
127 S.TieChoice( XXO("Type:"),
129 S.TieChoice( XXO("Format:"),
131 }
132 S.EndMultiColumn();
133}
134
136{
137 if( mFormat == kJson )
138 return ApplyInner( context );
139
140 if( mFormat == kLisp )
141 {
142 CommandContext LispyContext(
143 context.project,
144 std::make_unique<LispifiedCommandOutputTargets>( *context.pOutput.get() )
145 );
146 return ApplyInner( LispyContext );
147 }
148
149 if( mFormat == kBrief )
150 {
151 CommandContext BriefContext(
152 context.project,
153 std::make_unique<BriefCommandOutputTargets>( *context.pOutput.get() )
154 );
155 return ApplyInner( BriefContext );
156 }
157
158 return false;
159}
160
162{
163 switch( mInfoType ){
164 // flag of 1 to include parameterless commands.
165 case kCommands : return SendCommands( context, 1 );
166 case kMenus : return SendMenus( context );
167 case kPreferences : return SendPreferences( context );
168 case kTracks : return SendTracks( context );
169 case kClips : return SendClips( context );
170 case kEnvelopes : return SendEnvelopes( context );
171 case kLabels : return SendLabels( context );
172 case kBoxes : return SendBoxes( context );
173 default:
174 context.Status( "Command options not recognised" );
175 }
176 return false;
177}
178
180{
181 wxMenuBar * pBar = GetProjectFrame( context.project ).GetMenuBar();
182 if(!pBar ){
183 wxLogDebug("No menus");
184 return false;
185 }
186
187 size_t cnt = pBar->GetMenuCount();
188 size_t i;
189 wxString Label;
190 context.StartArray();
191 for(i=0;i<cnt;i++)
192 {
193 Label = pBar->GetMenuLabelText( i );
194 context.StartStruct();
195 context.AddItem( 0, "depth" );
196 context.AddItem( 0, "flags" );
197 context.AddItem( Label, "label" );
198 context.AddItem( "", "accel" );
199 context.EndStruct();
200 ExploreMenu( context, pBar->GetMenu( i ), pBar->GetId(), 1 );
201 }
202 context.EndArray();
203 return true;
204}
205
206#include "Prefs.h"
207
208namespace {
209
210/**************************************************************************/
214{
215public:
216 ShuttleGuiGetDefinition(wxWindow * pParent,CommandMessageTarget & target );
217 virtual ~ShuttleGuiGetDefinition();
218
219 wxCheckBox * TieCheckBox(
220 const TranslatableString &Prompt,
221 const BoolSetting &Setting) override;
222 wxCheckBox * TieCheckBoxOnRight(
223 const TranslatableString &Prompt,
224 const BoolSetting &Setting) override;
225
226 wxChoice *TieChoice(const TranslatableString &Prompt,
227 ChoiceSetting &choiceSetting) override;
228
229 wxChoice * TieNumberAsChoice(const TranslatableString &Prompt,
231 const TranslatableStrings & Choices,
232 const std::vector<int> * pInternalChoices, int iNoMatchSelector) override;
233
234 wxTextCtrl * TieTextBox(
235 const TranslatableString &Prompt,
236 const StringSetting &Setting,
237 const int nChars) override;
238 wxTextCtrl * TieIntegerTextBox(
239 const TranslatableString & Prompt,
240 const IntSetting &Setting,
241 const int nChars) override;
242 wxTextCtrl * TieNumericTextBox(
243 const TranslatableString & Prompt,
244 const DoubleSetting &Setting,
245 const int nChars, bool acceptEnter) override;
246 wxSlider * TieSlider(
247 const TranslatableString & Prompt,
248 const IntSetting &Setting,
249 const int max,
250 const int min = 0) override;
251 wxSpinCtrl * TieSpinCtrl(
252 const TranslatableString &Prompt,
253 const IntSetting &Setting,
254 const int max,
255 const int min) override;
256};
257
258ShuttleGuiGetDefinition::ShuttleGuiGetDefinition(
259 wxWindow * pParent,CommandMessageTarget & target )
260: ShuttleGui( pParent, eIsGettingMetadata ),
262{
263
264}
266{
267}
268
270 const TranslatableString &Prompt,
271 const BoolSetting &Setting)
272{
273 StartStruct();
274 AddItem( Setting.GetPath(), "id" );
275 AddItem( Prompt.Translation(), "prompt" );
276 AddItem( "bool", "type" );
277 AddBool( Setting.GetDefault(), "default" );
278 EndStruct();
279 return ShuttleGui::TieCheckBox( Prompt, Setting );
280}
281
283 const TranslatableString &Prompt,
284 const BoolSetting &Setting)
285{
286 StartStruct();
287 AddItem( Setting.GetPath(), "id" );
288 AddItem( Prompt.Translation(), "prompt" );
289 AddItem( "bool", "type" );
290 AddBool( Setting.GetDefault(), "default" );
291 EndStruct();
292 return ShuttleGui::TieCheckBoxOnRight( Prompt, Setting );
293}
294
296 ChoiceSetting &choiceSetting)
297{
298 StartStruct();
299 AddItem( choiceSetting.Key(), "id" );
300 AddItem( Prompt.Translation(), "prompt" );
301 AddItem( "enum", "type" );
302 AddItem( choiceSetting.Default().Internal(), "default" );
303 StartField( "enum" );
304 StartArray();
305 for ( const auto &choice : choiceSetting.GetSymbols().GetInternals() )
306 AddItem( choice );
307 EndArray();
308 EndField();
309 EndStruct();
310 return ShuttleGui::TieChoice( Prompt, choiceSetting );
311}
312
314 const TranslatableString &Prompt,
316 const TranslatableStrings & Choices,
317 const std::vector<int> * pInternalChoices, int iNoMatchSelector)
318{
319 // Come here for controls that present non-exhaustive choices among some
320 // numbers, with an associated control that allows arbitrary entry of an
321 // "Other..."
322 StartStruct();
323 AddItem( Setting.GetPath(), "id" );
324 AddItem( Prompt.Translation(), "prompt" );
325 AddItem( "number", "type" ); // not "enum" !
326 AddItem( Setting.GetDefault(), "default" );
327 EndStruct();
329 Prompt, Setting, Choices, pInternalChoices, iNoMatchSelector );
330}
331
333 const TranslatableString &Prompt,
334 const StringSetting &Setting,
335 const int nChars)
336{
337 StartStruct();
338 AddItem( Setting.GetPath(), "id" );
339 AddItem( Prompt.Translation(), "prompt" );
340 AddItem( "string", "type" );
341 AddItem( Setting.GetDefault(), "default" );
342 EndStruct();
343 return ShuttleGui::TieTextBox( Prompt, Setting, nChars );
344}
345
347 const TranslatableString & Prompt,
348 const IntSetting &Setting,
349 const int nChars)
350{
351 StartStruct();
352 AddItem( Setting.GetPath(), "id" );
353 AddItem( Prompt.Translation(), "prompt" );
354 AddItem( "number", "type" );
355 AddItem( Setting.GetDefault(), "default" );
356 EndStruct();
357 return ShuttleGui::TieIntegerTextBox( Prompt, Setting, nChars );
358}
359
361 const TranslatableString & Prompt,
362 const DoubleSetting &Setting,
363 const int nChars, bool acceptEnter)
364{
365 StartStruct();
366 AddItem( Setting.GetPath(), "id" );
367 AddItem( Prompt.Translation(), "prompt" );
368 AddItem( "number", "type" );
369 AddItem( Setting.GetDefault(), "default" );
370 EndStruct();
371 return ShuttleGui::TieNumericTextBox( Prompt, Setting, nChars, acceptEnter );
372}
373
375 const TranslatableString & Prompt,
376 const IntSetting &Setting,
377 const int max,
378 const int min)
379{
380 StartStruct();
381 AddItem( Setting.GetPath(), "id" );
382 AddItem( Prompt.Translation(), "prompt" );
383 AddItem( "number", "type" );
384 AddItem( Setting.GetDefault(), "default" );
385 EndStruct();
386 return ShuttleGui::TieSlider( Prompt, Setting, max, min );
387}
388
390 const TranslatableString &Prompt,
391 const IntSetting &Setting,
392 const int max,
393 const int min)
394{
395 StartStruct();
396 AddItem( Setting.GetPath(), "id" );
397 AddItem( Prompt.Translation(), "prompt" );
398 AddItem( "number", "type" );
399 AddItem( Setting.GetDefault(), "default" );
400 EndStruct();
401 return ShuttleGui::TieSpinCtrl( Prompt, Setting, max, min );
402}
403
404}
405
407{
408 context.StartArray();
409 auto pWin = &GetProjectFrame( context.project );
410 GlobalPrefsDialog dialog( pWin, &context.project );
411 // wxCommandEvent Evt;
412 //dialog.Show();
413 ShuttleGuiGetDefinition S(pWin, *((context.pOutput)->mStatusTarget) );
414 dialog.ShuttleAll( S );
415 context.EndArray();
416 return true;
417}
418
422bool GetInfoCommand::SendCommands(const CommandContext &context, int flags )
423{
424 context.StartArray();
427 {
428 for (auto &plug
430 auto command = em.GetCommandIdentifier(plug.GetID());
431 if (!command.empty()){
432 em.GetCommandDefinition( plug.GetID(), context, flags );
433 }
434 }
435 }
436 context.EndArray();
437 return true;
438}
439
441{
442 //context.Status("Boxes");
443 auto pWin = &GetProjectFrame( context.project );
444
445 context.StartArray();
446 wxRect R = pWin->GetScreenRect();
447
448 //R.SetPosition( wxPoint(0,0) );
449
450 //wxString Name = pWin->GetName();
451 context.StartStruct();
452 context.AddItem( 0, "depth" );
453 context.AddItem( "Audacity Window", "name" );
454 context.StartField( "box" );
455 context.StartArray( );
456 context.AddItem( R.GetLeft() );
457 context.AddItem( R.GetTop() );
458 context.AddItem( R.GetRight() );
459 context.AddItem( R.GetBottom() );
460 context.EndArray( );
461 context.EndField();
462 context.EndStruct( );
463
464 ExploreAdornments( context, pWin->GetPosition()+wxSize( 6,-1), pWin, pWin->GetId(), 1 );
465 ExploreWindows( context, pWin->GetPosition()+wxSize( 6,-1), pWin, pWin->GetId(), 1 );
466 context.EndArray( );
467 return true;
468}
469
471{
472 auto &tracks = TrackList::Get( context.project );
473 context.StartArray();
474 for (auto trk : tracks)
475 {
476 auto &trackFocus = TrackFocus::Get( context.project );
477 Track * fTrack = trackFocus.Get();
478
479 context.StartStruct();
480 context.AddItem( trk->GetName(), "name" );
481 context.AddBool( (trk == fTrack), "focused");
482 context.AddBool( trk->GetSelected(), "selected" );
483 //JKC: Possibly add later...
484 //context.AddItem(ChannelView::GetChannelGroupHeight(*trk), "height");
485 trk->TypeSwitch( [&] (const WaveTrack &t) {
486 float vzmin, vzmax;
487 WaveformScale::Get(t).GetDisplayBounds(vzmin, vzmax);
488 context.AddItem( "wave", "kind" );
489 context.AddItem( t.GetStartTime(), "start" );
490 context.AddItem( t.GetEndTime(), "end" );
491 context.AddItem( t.GetPan() , "pan");
492 context.AddItem( t.GetGain() , "gain");
493 context.AddItem( TrackList::NChannels(t), "channels");
494 context.AddBool( t.GetSolo(), "solo" );
495 context.AddBool( t.GetMute(), "mute");
496 context.AddItem( vzmin, "VZoomMin");
497 context.AddItem( vzmax, "VZoomMax");
498 },
499#if defined(USE_MIDI)
500 [&](const NoteTrack &) {
501 context.AddItem( "note", "kind" );
502 },
503#endif
504 [&](const LabelTrack &) {
505 context.AddItem( "label", "kind" );
506 },
507 [&](const TimeTrack &) {
508 context.AddItem( "time", "kind" );
509 }
510 );
511 context.EndStruct();
512 }
513 context.EndArray();
514 return true;
515}
516
518{
519 auto &tracks = TrackList::Get( context.project );
520 int i=0;
521 context.StartArray();
522 for (auto t : tracks) {
523 t->TypeSwitch([&](WaveTrack &waveTrack) {
524 WaveClipPointers ptrs(waveTrack.SortedClipArray());
525 for (WaveClip * pClip : ptrs) {
526 context.StartStruct();
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");
532 context.EndStruct();
533 }
534 });
535 // Per track numbering counts all tracks
536 i++;
537 }
538 context.EndArray();
539
540 return true;
541}
542
544{
545 auto &tracks = TrackList::Get( context.project );
546 int i=0;
547 int j=0;
548 context.StartArray();
549 for (auto t : tracks) {
550 t->TypeSwitch([&](WaveTrack &waveTrack) {
551 WaveClipPointers ptrs(waveTrack.SortedClipArray());
552 j = 0;
553 for (WaveClip * pClip : ptrs) {
554 context.StartStruct();
555 context.AddItem((double)i, "track");
556 context.AddItem((double)j, "clip");
557 context.AddItem(pClip->GetPlayStartTime(), "start");
558 Envelope * pEnv = pClip->GetEnvelope();
559 context.StartField("points");
560 context.StartArray();
561 double offset = pEnv->GetOffset();
562 for (size_t k = 0; k < pEnv->GetNumberOfPoints(); k++)
563 {
564 context.StartStruct();
565 context.AddItem((*pEnv)[k].GetT() + offset, "t");
566 context.AddItem((*pEnv)[k].GetVal(), "y");
567 context.EndStruct();
568 }
569 context.EndArray();
570 context.EndField();
571 context.AddItem(pClip->GetPlayEndTime(), "end");
572 context.EndStruct();
573 j++;
574 }
575 });
576 // Per track numbering counts all tracks
577 i++;
578 }
579 context.EndArray();
580
581 return true;
582}
583
584
586{
587 auto &tracks = TrackList::Get( context.project );
588 int i=0;
589 context.StartArray();
590 for (auto t : tracks) {
591 t->TypeSwitch( [&](LabelTrack &labelTrack) {
592#ifdef VERBOSE_LABELS_FORMATTING
593 for (int nn = 0; nn< (int)labelTrack->mLabels.size(); nn++) {
594 const auto &label = labelTrack->mLabels[nn];
595 context.StartStruct();
596 context.AddItem( (double)i, "track" );
597 context.AddItem( label.getT0(), "start" );
598 context.AddItem( label.getT1(), "end" );
599 context.AddItem( label.title, "text" );
600 context.EndStruct();
601 }
602#else
603 context.StartArray();
604 context.AddItem( (double)i ); // Track number.
605 context.StartArray();
606 for ( const auto &label : labelTrack.GetLabels() ) {
607 context.StartArray();
608 context.AddItem( label.getT0() ); // start
609 context.AddItem( label.getT1() ); // end
610 context.AddItem( label.title ); //text.
611 context.EndArray();
612 }
613 context.EndArray();
614 context.EndArray();
615#endif
616 } );
617 // Per track numbering counts all tracks
618 i++;
619 }
620 context.EndArray();
621
622 return true;
623}
624
625/*******************************************************************
626The various Explore functions are called from the Send functions,
627and may be recursive. 'Send' is the top level.
628*******************************************************************/
629
630void GetInfoCommand::ExploreMenu( const CommandContext &context, wxMenu * pMenu, int Id, int depth ){
631 static_cast<void>(Id);//compiler food.
632 if( !pMenu )
633 return;
634
635 auto &commandManager = CommandManager::Get( context.project );
636
637 wxMenuItemList list = pMenu->GetMenuItems();
638 size_t lcnt = list.size();
639 wxMenuItem * item;
640 wxString Label;
641 wxString Accel;
642 CommandID Name;
643
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');
651 else
652 Accel = "";
653 if( item->IsSeparator() )
654 Label = "----";
655 int flags = 0;
656 if (item->IsSubMenu())
657 flags +=1;
658 if (item->IsCheck() && item->IsChecked())
659 flags +=2;
660
661 context.StartStruct();
662 context.AddItem( depth, "depth" );
663 context.AddItem( flags, "flags" );
664 context.AddItem( Label, "label" );
665 context.AddItem( Accel, "accel" );
666 if( !Name.empty() )
667 // using GET to expose CommandID in results of GetInfoCommand...
668 // PRL asks, is that all right?
669 context.AddItem( Name.GET(), "id" );// It is called Scripting ID outside Audacity.
670 context.EndStruct();
671
672 if (item->IsSubMenu()) {
673 pMenu = item->GetSubMenu();
674 ExploreMenu( context, pMenu, item->GetId(), depth+1 );
675 }
676 }
677}
678
680 wxPoint WXUNUSED(P), wxWindow * pWin, int WXUNUSED(Id), int depth )
681{
682 // Dang! wxMenuBar returns bogus screen rect.
683 // We're going to have to fake it instead.
684 //wxMenuBar * pBar = context.GetProject()->GetMenuBar();
685 //wxRect R = pBar->GetScreenRect();
686 //R.SetPosition( R.GetPosition() - P );
687
688 wxRect R1 = pWin->GetScreenRect();
689 wxSize s = pWin->GetWindowBorderSize();
690 wxRect R( 2,32, R1.GetWidth() - s.GetWidth() * 2 -16, 22 );
691
692 context.StartStruct();
693 context.AddItem( depth, "depth" );
694 context.AddItem( "MenuBar", "label" );
695 context.StartField( "box" );
696 context.StartArray();
697 context.AddItem( R.GetLeft() );
698 context.AddItem( R.GetTop() );
699 context.AddItem( R.GetRight() );
700 context.AddItem( R.GetBottom() );
701 context.EndArray();
702 context.EndField();
703 context.EndStruct();
704}
705
707 wxPoint P, int depth )
708{
709 AudacityProject * pProj = &context.project;
710 auto &tp = TrackPanel::Get( *pProj );
711 wxRect panelRect{ {}, tp.GetSize() };
712 for (auto leader : TrackList::Get(*pProj)) {
713 for (auto t : leader->Channels()) {
714 auto rulers = tp.FindRulerRects(*t);
715 for (auto &R : rulers) {
716 if (!R.Intersects(panelRect))
717 continue;
718 R.SetPosition( R.GetPosition() + P );
719 context.StartStruct();
720 context.AddItem( depth, "depth" );
721 context.AddItem( "VRuler", "label" );
722 context.StartField("box");
723 context.StartArray();
724 context.AddItem( R.GetLeft() );
725 context.AddItem( R.GetTop() );
726 context.AddItem( R.GetRight() );
727 context.AddItem( R.GetBottom() );
728 context.EndArray();
729 context.EndField();
730 context.EndStruct();
731 }
732 }
733 }
734}
735
736
738 wxPoint P, wxWindow * pWin, int Id, int depth )
739{
740 static_cast<void>(Id);//Compiler food.
741
742 if( pWin->GetName() == "Track Panel" )
743 {
744 wxRect R = pWin->GetScreenRect();
745 ExploreTrackPanel( context, R.GetPosition()-P, depth );
746 return;
747 }
748 wxWindowList list = pWin->GetChildren();
749 size_t lcnt = list.size();
750
751 for (size_t lndx = 0; lndx < lcnt; lndx++) {
752 wxWindow * item = list[lndx];
753 if( !item->IsShown() )
754 continue;
755 wxRect R = item->GetScreenRect();
756 R.SetPosition( R.GetPosition() - P );
757 wxString Name = item->GetName();
758 // Ignore staticLine and StaticBitmap.
759 if( Name.StartsWith( "static" ) )
760 continue;
761 // Ignore anonymous panels.
762 if( Name == "panel" )
763 continue;
764 if( Name.empty() )
765 Name = wxString("*") + item->GetToolTipText();
766
767 context.StartStruct();
768 context.AddItem( depth, "depth" );
769 context.AddItem( Name, "label" );
770 context.AddItem( item->GetId(), "id" );
771 context.StartField( "box" );
772 context.StartArray();
773 context.AddItem( R.GetLeft() );
774 context.AddItem( R.GetTop() );
775 context.AddItem( R.GetRight() );
776 context.AddItem( R.GetBottom() );
777 context.EndArray();
778 context.EndField();
779 context.EndStruct();
780
781 ExploreWindows( context, P, item, item->GetId(), depth+1 );
782 }
783}
784
785namespace {
786using namespace MenuRegistry;
787
788// Register menu items
789
791 // Note that the PLUGIN_SYMBOL must have a space between words,
792 // whereas the short-form used here must not.
793 // (So if you did write "Compare Audio" for the PLUGIN_SYMBOL name, then
794 // you would have to use "CompareAudio" here.)
795 Command( wxT("GetInfo"), XXO("Get Info..."),
797 wxT("Optional/Extra/Part2/Scriptables2")
798};
799
800}
wxT("CloseDown"))
const ReservedCommandFlag & AudioIONotBusyFlag()
int min(int a, int b)
XO("Cut/Copy/Paste")
XXO("&Cut/Copy/Paste Toolbar")
static const EnumValueSymbol kTypes[nTypes]
@ kBrief
@ nFormats
@ kJson
@ kLisp
static const EnumValueSymbol kFormats[nFormats]
@ kClips
@ kTracks
@ kCommands
@ kEnvelopes
@ nTypes
@ kMenus
@ kPreferences
@ kBoxes
@ kLabels
Contains declaration of GetInfoCommand class.
@ PluginTypeAudacityCommand
@ PluginTypeEffect
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.
@ eIsGettingMetadata
Definition: ShuttleGui.h:40
TranslatableString label
Definition: TagsEditor.cpp:165
const auto tracks
#define P(T)
Definition: ToChars.cpp:56
#define S(N)
Definition: ToChars.cpp:64
std::vector< TranslatableString > TranslatableStrings
std::vector< WaveClip * > WaveClipPointers
Definition: WaveTrack.h:49
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
This specialization of Setting for bool adds a Toggle method to negate the saved value.
Definition: Prefs.h:346
const wxString & Key() const
Definition: Prefs.h:439
const EnumValueSymbols & GetSymbols() const
Definition: Prefs.h:441
const EnumValueSymbol & Default() const
Definition: Prefs.cpp:380
Subclass & Get(const RegisteredFactory &key)
Get reference to an attachment, creating on demand if not present, down-cast it to Subclass.
Definition: ClientData.h:317
CommandContext provides additional information to an 'Apply()' command. It provides the project,...
void EndField() const
void StartArray() const
void EndArray() const
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
void StartStruct() const
std::unique_ptr< CommandOutputTargets > pOutput
void EndStruct() const
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 StartField(const wxString &name={}) override
void AddItem(const wxString &value, const wxString &name={}) 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.
Definition: Prefs.h:363
EffectManager is the class that handles effects and effect categories.
Definition: EffectManager.h:48
CommandID GetCommandIdentifier(const PluginID &ID)
void GetCommandDefinition(const PluginID &ID, const CommandContext &context, int flags)
static EffectManager & Get()
const wxArrayStringEx & GetInternals() const
Definition: Prefs.cpp:371
Piecewise linear or piecewise exponential function from double to double.
Definition: Envelope.h:72
double GetOffset() const
Definition: Envelope.h:92
size_t GetNumberOfPoints() const
Return number of points.
Definition: Envelope.cpp:695
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.
Definition: Prefs.h:356
A LabelTrack is a Track that holds labels (LabelStruct).
Definition: LabelTrack.h:87
const LabelArray & GetLabels() const
Definition: LabelTrack.h:146
LabelArray mLabels
Definition: LabelTrack.h:203
A Track that is used for Midi notes. (Somewhat old code).
Definition: NoteTrack.h:86
PluginManager maintains a list of all plug ins. That covers modules, effects, generators,...
Definition: PluginManager.h:51
Range PluginsOfType(int type)
static PluginManager & Get()
void ShuttleAll(ShuttleGui &S)
Generates classes whose instances register items at construction.
Definition: Registry.h:388
const SettingPath & GetPath() const
Definition: Prefs.h:88
Definition: Prefs.h:178
const T & GetDefault() const
Definition: Prefs.h:199
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.
Definition: ShuttleGui.h:640
Specialization of Setting for strings.
Definition: Prefs.h:370
A kind of Track used to 'warp time'.
Definition: TimeTrack.h:24
Track * Get()
Definition: TrackFocus.cpp:156
Abstract base class for an object holding data associated with points on a time axis.
Definition: Track.h:122
size_t NChannels() const
Definition: Track.cpp:960
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:347
static TrackPanel & Get(AudacityProject &project)
Definition: TrackPanel.cpp:233
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.
Definition: WaveClip.h:138
A Track that contains audio waveform data.
Definition: WaveTrack.h:227
bool GetMute() const override
May vary asynchronously.
Definition: WaveTrack.cpp:2843
double GetStartTime() const override
Implement WideSampleSequence.
Definition: WaveTrack.cpp:3100
WaveClipPointers SortedClipArray()
Definition: WaveTrack.cpp:4425
float GetPan() const
Definition: WaveTrack.cpp:1186
double GetEndTime() const override
Implement WideSampleSequence.
Definition: WaveTrack.cpp:3105
float GetGain() const
Definition: WaveTrack.cpp:1168
bool GetSolo() const override
May vary asynchronously.
Definition: WaveTrack.cpp:2848
void GetDisplayBounds(float &min, float &max) const
static WaveformScale & Get(const WaveTrack &track)
Mutative access to attachment even if the track argument is const.
Shuttle that retrieves a JSON format definition of a command's parameters.
wxChoice * TieChoice(const TranslatableString &Prompt, ChoiceSetting &choiceSetting) override
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)
constexpr auto Command
Definition: MenuRegistry.h:456
BuiltinCommandsModule::Registration< GetInfoCommand > reg