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 "CommandManager.h"
28#include "../CommonCommandFlags.h"
29#include "LoadCommands.h"
30#include "Project.h"
31#include "../ProjectWindows.h"
32#include "CommandManager.h"
33#include "CommandTargets.h"
34#include "../effects/EffectManager.h"
35#include "../widgets/Overlay.h"
36#include "../TrackPanelAx.h"
37#include "../TrackPanel.h"
38#include "WaveClip.h"
39#include "ViewInfo.h"
40#include "WaveTrack.h"
42#include "../LabelTrack.h"
43#include "../NoteTrack.h"
44#include "TimeTrack.h"
45#include "Envelope.h"
46
47#include "SelectCommand.h"
48#include "ShuttleGui.h"
49#include "CommandContext.h"
50
51#include "../prefs/PrefsDialog.h"
52#include "SettingsVisitor.h"
53#include "PluginManager.h"
54#include "../tracks/ui/TrackView.h"
55#include "ShuttleGui.h"
56
57#include <wx/frame.h>
58#include <wx/log.h>
59#include <wx/menu.h>
60
62{ XO("Get Info") };
63
65enum {
67 //kCommandsPlus,
75 nTypes
76};
77
79{
80 { XO("Commands") },
81 //{ wxT("CommandsPlus"), XO("Commands Plus") },
82 { XO("Menus") },
83 { XO("Preferences") },
84 { XO("Tracks") },
85 { XO("Clips") },
86 { XO("Envelopes") },
87 { XO("Labels") },
88 { XO("Boxes") },
89};
90
91enum {
96};
97
99{
100 // These are acceptable dual purpose internal/visible names
101
102 /* i18n-hint JavaScript Object Notation */
103 { XO("JSON") },
104 /* i18n-hint name of a computer programming language */
105 { XO("LISP") },
106 { XO("Brief") }
107};
108
109template<bool Const>
111 S.DefineEnum( mInfoType, wxT("Type"), 0, kTypes, nTypes );
112 S.DefineEnum( mFormat, wxT("Format"), 0, kFormats, nFormats );
113 return true;
114}
115
117 { return VisitSettings<false>(S); }
118
120 { return VisitSettings<true>(S); }
121
123{
124 S.AddSpace(0, 5);
125
126 S.StartMultiColumn(2, wxALIGN_CENTER);
127 {
128 S.TieChoice( XXO("Type:"),
130 S.TieChoice( XXO("Format:"),
132 }
133 S.EndMultiColumn();
134}
135
137{
138 if( mFormat == kJson )
139 return ApplyInner( context );
140
141 if( mFormat == kLisp )
142 {
143 CommandContext LispyContext(
144 context.project,
145 std::make_unique<LispifiedCommandOutputTargets>( *context.pOutput.get() )
146 );
147 return ApplyInner( LispyContext );
148 }
149
150 if( mFormat == kBrief )
151 {
152 CommandContext BriefContext(
153 context.project,
154 std::make_unique<BriefCommandOutputTargets>( *context.pOutput.get() )
155 );
156 return ApplyInner( BriefContext );
157 }
158
159 return false;
160}
161
163{
164 switch( mInfoType ){
165 // flag of 1 to include parameterless commands.
166 case kCommands : return SendCommands( context, 1 );
167 case kMenus : return SendMenus( context );
168 case kPreferences : return SendPreferences( context );
169 case kTracks : return SendTracks( context );
170 case kClips : return SendClips( context );
171 case kEnvelopes : return SendEnvelopes( context );
172 case kLabels : return SendLabels( context );
173 case kBoxes : return SendBoxes( context );
174 default:
175 context.Status( "Command options not recognised" );
176 }
177 return false;
178}
179
181{
182 wxMenuBar * pBar = GetProjectFrame( context.project ).GetMenuBar();
183 if(!pBar ){
184 wxLogDebug("No menus");
185 return false;
186 }
187
188 size_t cnt = pBar->GetMenuCount();
189 size_t i;
190 wxString Label;
191 context.StartArray();
192 for(i=0;i<cnt;i++)
193 {
194 Label = pBar->GetMenuLabelText( i );
195 context.StartStruct();
196 context.AddItem( 0, "depth" );
197 context.AddItem( 0, "flags" );
198 context.AddItem( Label, "label" );
199 context.AddItem( "", "accel" );
200 context.EndStruct();
201 ExploreMenu( context, pBar->GetMenu( i ), pBar->GetId(), 1 );
202 }
203 context.EndArray();
204 return true;
205}
206
207#include "Prefs.h"
208
209namespace {
210
211/**************************************************************************/
215{
216public:
217 ShuttleGuiGetDefinition(wxWindow * pParent,CommandMessageTarget & target );
218 virtual ~ShuttleGuiGetDefinition();
219
220 wxCheckBox * TieCheckBox(
221 const TranslatableString &Prompt,
222 const BoolSetting &Setting) override;
223 wxCheckBox * TieCheckBoxOnRight(
224 const TranslatableString &Prompt,
225 const BoolSetting &Setting) override;
226
227 wxChoice *TieChoice(const TranslatableString &Prompt,
228 ChoiceSetting &choiceSetting) override;
229
230 wxChoice * TieNumberAsChoice(const TranslatableString &Prompt,
232 const TranslatableStrings & Choices,
233 const std::vector<int> * pInternalChoices, int iNoMatchSelector) override;
234
235 wxTextCtrl * TieTextBox(
236 const TranslatableString &Prompt,
237 const StringSetting &Setting,
238 const int nChars) override;
239 wxTextCtrl * TieIntegerTextBox(
240 const TranslatableString & Prompt,
241 const IntSetting &Setting,
242 const int nChars) override;
243 wxTextCtrl * TieNumericTextBox(
244 const TranslatableString & Prompt,
245 const DoubleSetting &Setting,
246 const int nChars) override;
247 wxSlider * TieSlider(
248 const TranslatableString & Prompt,
249 const IntSetting &Setting,
250 const int max,
251 const int min = 0) override;
252 wxSpinCtrl * TieSpinCtrl(
253 const TranslatableString &Prompt,
254 const IntSetting &Setting,
255 const int max,
256 const int min) override;
257};
258
259ShuttleGuiGetDefinition::ShuttleGuiGetDefinition(
260 wxWindow * pParent,CommandMessageTarget & target )
261: ShuttleGui( pParent, eIsGettingMetadata ),
263{
264
265}
267{
268}
269
271 const TranslatableString &Prompt,
272 const BoolSetting &Setting)
273{
274 StartStruct();
275 AddItem( Setting.GetPath(), "id" );
276 AddItem( Prompt.Translation(), "prompt" );
277 AddItem( "bool", "type" );
278 AddBool( Setting.GetDefault(), "default" );
279 EndStruct();
280 return ShuttleGui::TieCheckBox( Prompt, Setting );
281}
282
284 const TranslatableString &Prompt,
285 const BoolSetting &Setting)
286{
287 StartStruct();
288 AddItem( Setting.GetPath(), "id" );
289 AddItem( Prompt.Translation(), "prompt" );
290 AddItem( "bool", "type" );
291 AddBool( Setting.GetDefault(), "default" );
292 EndStruct();
293 return ShuttleGui::TieCheckBoxOnRight( Prompt, Setting );
294}
295
297 ChoiceSetting &choiceSetting)
298{
299 StartStruct();
300 AddItem( choiceSetting.Key(), "id" );
301 AddItem( Prompt.Translation(), "prompt" );
302 AddItem( "enum", "type" );
303 AddItem( choiceSetting.Default().Internal(), "default" );
304 StartField( "enum" );
305 StartArray();
306 for ( const auto &choice : choiceSetting.GetSymbols().GetInternals() )
307 AddItem( choice );
308 EndArray();
309 EndField();
310 EndStruct();
311 return ShuttleGui::TieChoice( Prompt, choiceSetting );
312}
313
315 const TranslatableString &Prompt,
317 const TranslatableStrings & Choices,
318 const std::vector<int> * pInternalChoices, int iNoMatchSelector)
319{
320 // Come here for controls that present non-exhaustive choices among some
321 // numbers, with an associated control that allows arbitrary entry of an
322 // "Other..."
323 StartStruct();
324 AddItem( Setting.GetPath(), "id" );
325 AddItem( Prompt.Translation(), "prompt" );
326 AddItem( "number", "type" ); // not "enum" !
327 AddItem( Setting.GetDefault(), "default" );
328 EndStruct();
330 Prompt, Setting, Choices, pInternalChoices, iNoMatchSelector );
331}
332
334 const TranslatableString &Prompt,
335 const StringSetting &Setting,
336 const int nChars)
337{
338 StartStruct();
339 AddItem( Setting.GetPath(), "id" );
340 AddItem( Prompt.Translation(), "prompt" );
341 AddItem( "string", "type" );
342 AddItem( Setting.GetDefault(), "default" );
343 EndStruct();
344 return ShuttleGui::TieTextBox( Prompt, Setting, nChars );
345}
346
348 const TranslatableString & Prompt,
349 const IntSetting &Setting,
350 const int nChars)
351{
352 StartStruct();
353 AddItem( Setting.GetPath(), "id" );
354 AddItem( Prompt.Translation(), "prompt" );
355 AddItem( "number", "type" );
356 AddItem( Setting.GetDefault(), "default" );
357 EndStruct();
358 return ShuttleGui::TieIntegerTextBox( Prompt, Setting, nChars );
359}
360
362 const TranslatableString & Prompt,
363 const DoubleSetting &Setting,
364 const int nChars)
365{
366 StartStruct();
367 AddItem( Setting.GetPath(), "id" );
368 AddItem( Prompt.Translation(), "prompt" );
369 AddItem( "number", "type" );
370 AddItem( Setting.GetDefault(), "default" );
371 EndStruct();
372 return ShuttleGui::TieNumericTextBox( Prompt, Setting, nChars );
373}
374
376 const TranslatableString & Prompt,
377 const IntSetting &Setting,
378 const int max,
379 const int min)
380{
381 StartStruct();
382 AddItem( Setting.GetPath(), "id" );
383 AddItem( Prompt.Translation(), "prompt" );
384 AddItem( "number", "type" );
385 AddItem( Setting.GetDefault(), "default" );
386 EndStruct();
387 return ShuttleGui::TieSlider( Prompt, Setting, max, min );
388}
389
391 const TranslatableString &Prompt,
392 const IntSetting &Setting,
393 const int max,
394 const int min)
395{
396 StartStruct();
397 AddItem( Setting.GetPath(), "id" );
398 AddItem( Prompt.Translation(), "prompt" );
399 AddItem( "number", "type" );
400 AddItem( Setting.GetDefault(), "default" );
401 EndStruct();
402 return ShuttleGui::TieSpinCtrl( Prompt, Setting, max, min );
403}
404
405}
406
408{
409 context.StartArray();
410 auto pWin = &GetProjectFrame( context.project );
411 GlobalPrefsDialog dialog( pWin, &context.project );
412 // wxCommandEvent Evt;
413 //dialog.Show();
414 ShuttleGuiGetDefinition S(pWin, *((context.pOutput)->mStatusTarget) );
415 dialog.ShuttleAll( S );
416 context.EndArray();
417 return true;
418}
419
423bool GetInfoCommand::SendCommands(const CommandContext &context, int flags )
424{
425 context.StartArray();
428 {
429 for (auto &plug
431 auto command = em.GetCommandIdentifier(plug.GetID());
432 if (!command.empty()){
433 em.GetCommandDefinition( plug.GetID(), context, flags );
434 }
435 }
436 }
437 context.EndArray();
438 return true;
439}
440
442{
443 //context.Status("Boxes");
444 auto pWin = &GetProjectFrame( context.project );
445
446 context.StartArray();
447 wxRect R = pWin->GetScreenRect();
448
449 //R.SetPosition( wxPoint(0,0) );
450
451 //wxString Name = pWin->GetName();
452 context.StartStruct();
453 context.AddItem( 0, "depth" );
454 context.AddItem( "Audacity Window", "name" );
455 context.StartField( "box" );
456 context.StartArray( );
457 context.AddItem( R.GetLeft() );
458 context.AddItem( R.GetTop() );
459 context.AddItem( R.GetRight() );
460 context.AddItem( R.GetBottom() );
461 context.EndArray( );
462 context.EndField();
463 context.EndStruct( );
464
465 ExploreAdornments( context, pWin->GetPosition()+wxSize( 6,-1), pWin, pWin->GetId(), 1 );
466 ExploreWindows( context, pWin->GetPosition()+wxSize( 6,-1), pWin, pWin->GetId(), 1 );
467 context.EndArray( );
468 return true;
469}
470
472{
473 auto &tracks = TrackList::Get( context.project );
474 context.StartArray();
475 for (auto trk : tracks.Leaders())
476 {
477 auto &trackFocus = TrackFocus::Get( context.project );
478 Track * fTrack = trackFocus.Get();
479
480 context.StartStruct();
481 context.AddItem( trk->GetName(), "name" );
482 context.AddBool( (trk == fTrack), "focused");
483 context.AddBool( trk->GetSelected(), "selected" );
484 //JKC: Possibly add later...
485 //context.AddItem( TrackView::Get( *trk ).GetHeight(), "height" );
486 trk->TypeSwitch( [&] (const WaveTrack* t ) {
487 float vzmin, vzmax;
488 WaveformScale::Get(*t).GetDisplayBounds(vzmin, vzmax);
489 context.AddItem( "wave", "kind" );
490 context.AddItem( t->GetStartTime(), "start" );
491 context.AddItem( t->GetEndTime(), "end" );
492 context.AddItem( t->GetPan() , "pan");
493 context.AddItem( t->GetGain() , "gain");
494 context.AddItem( TrackList::Channels(t).size(), "channels");
495 context.AddBool( t->GetSolo(), "solo" );
496 context.AddBool( t->GetMute(), "mute");
497 context.AddItem( vzmin, "VZoomMin");
498 context.AddItem( vzmax, "VZoomMax");
499 },
500#if defined(USE_MIDI)
501 [&](const NoteTrack *) {
502 context.AddItem( "note", "kind" );
503 },
504#endif
505 [&](const LabelTrack *) {
506 context.AddItem( "label", "kind" );
507 },
508 [&](const TimeTrack *) {
509 context.AddItem( "time", "kind" );
510 }
511 );
512 context.EndStruct();
513 }
514 context.EndArray();
515 return true;
516}
517
519{
520 auto &tracks = TrackList::Get( context.project );
521 int i=0;
522 context.StartArray();
523 for (auto t : tracks.Leaders()) {
524 t->TypeSwitch([&](WaveTrack *waveTrack) {
525 WaveClipPointers ptrs(waveTrack->SortedClipArray());
526 for (WaveClip * pClip : ptrs) {
527 context.StartStruct();
528 context.AddItem((double)i, "track");
529 context.AddItem(pClip->GetPlayStartTime(), "start");
530 context.AddItem(pClip->GetPlayEndTime(), "end");
531 context.AddItem(pClip->GetColourIndex(), "color");
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.Leaders()) {
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.Leaders()) {
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 t : TrackList::Get( *pProj ).Any() ) {
713 auto rulers = tp.FindRulerRects(t);
714 for (auto &R : rulers) {
715 if (!R.Intersects(panelRect))
716 continue;
717 R.SetPosition( R.GetPosition() + P );
718 context.StartStruct();
719 context.AddItem( depth, "depth" );
720 context.AddItem( "VRuler", "label" );
721 context.StartField("box");
722 context.StartArray();
723 context.AddItem( R.GetLeft() );
724 context.AddItem( R.GetTop() );
725 context.AddItem( R.GetRight() );
726 context.AddItem( R.GetBottom() );
727 context.EndArray();
728 context.EndField();
729 context.EndStruct();
730 }
731 }
732}
733
734
736 wxPoint P, wxWindow * pWin, int Id, int depth )
737{
738 static_cast<void>(Id);//Compiler food.
739
740 if( pWin->GetName() == "Track Panel" )
741 {
742 wxRect R = pWin->GetScreenRect();
743 ExploreTrackPanel( context, R.GetPosition()-P, depth );
744 return;
745 }
746 wxWindowList list = pWin->GetChildren();
747 size_t lcnt = list.size();
748
749 for (size_t lndx = 0; lndx < lcnt; lndx++) {
750 wxWindow * item = list[lndx];
751 if( !item->IsShown() )
752 continue;
753 wxRect R = item->GetScreenRect();
754 R.SetPosition( R.GetPosition() - P );
755 wxString Name = item->GetName();
756 // Ignore staticLine and StaticBitmap.
757 if( Name.StartsWith( "static" ) )
758 continue;
759 // Ignore anonymous panels.
760 if( Name == "panel" )
761 continue;
762 if( Name.empty() )
763 Name = wxString("*") + item->GetToolTipText();
764
765 context.StartStruct();
766 context.AddItem( depth, "depth" );
767 context.AddItem( Name, "label" );
768 context.AddItem( item->GetId(), "id" );
769 context.StartField( "box" );
770 context.StartArray();
771 context.AddItem( R.GetLeft() );
772 context.AddItem( R.GetTop() );
773 context.AddItem( R.GetRight() );
774 context.AddItem( R.GetBottom() );
775 context.EndArray();
776 context.EndField();
777 context.EndStruct();
778
779 ExploreWindows( context, P, item, item->GetId(), depth+1 );
780 }
781}
782
783namespace {
784using namespace MenuTable;
785
786// Register menu items
787
789 wxT("Optional/Extra/Part2/Scriptables2"),
790 // Note that the PLUGIN_SYMBOL must have a space between words,
791 // whereas the short-form used here must not.
792 // (So if you did write "Compare Audio" for the PLUGIN_SYMBOL name, then
793 // you would have to use "CompareAudio" here.)
794 Command( wxT("GetInfo"), XXO("Get Info..."),
796};
797
798}
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:164
#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:40
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:339
const wxString & Key() const
Definition: Prefs.h:432
const EnumValueSymbols & GetSymbols() const
Definition: Prefs.h:434
const EnumValueSymbol & Default() const
Definition: Prefs.cpp:346
Subclass & Get(const RegisteredFactory &key)
Get reference to an attachment, creating on demand if not present, down-cast it to Subclass.
Definition: ClientData.h:309
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:356
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:337
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:694
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:349
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:192
A Track that is used for Midi notes. (Somewhat old code).
Definition: NoteTrack.h:63
bool GetSolo() const
Definition: Track.h:925
bool GetMute() const
Definition: Track.h:924
PluginManager maintains a list of all plug ins. That covers modules, effects, generators,...
Definition: PluginManager.h:47
Range PluginsOfType(int type)
static PluginManager & Get()
void ShuttleAll(ShuttleGui &S)
const SettingPath & GetPath() const
Definition: Prefs.h:83
Definition: Prefs.h:173
const T & GetDefault() const
Definition: Prefs.h:192
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.
Definition: ShuttleGui.h:625
Specialization of Setting for strings.
Definition: Prefs.h:363
A kind of Track used to 'warp time'.
Definition: TimeTrack.h:22
Track * Get()
Abstract base class for an object holding data associated with points on a time axis.
Definition: Track.h:226
auto Any() -> TrackIterRange< TrackType >
Definition: Track.h:1440
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:487
static auto Channels(TrackType *pTrack) -> TrackIterRange< TrackType >
Definition: Track.h:1544
static TrackPanel & Get(AudacityProject &project)
Definition: TrackPanel.cpp:231
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:101
A Track that contains audio waveform data.
Definition: WaveTrack.h:51
double GetStartTime() const override
Get the time at which the first clip in the track starts.
Definition: WaveTrack.cpp:1802
WaveClipPointers SortedClipArray()
Definition: WaveTrack.cpp:2459
float GetPan() const
Definition: WaveTrack.cpp:395
double GetEndTime() const override
Get the time at which the last clip in the track ends, plus recorded stuff.
Definition: WaveTrack.cpp:1822
float GetGain() const
Definition: WaveTrack.cpp:377
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
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
AUDACITY_DLL_API void OnAudacityCommand(const CommandContext &ctx)
std::unique_ptr< CommandItem > Command(const CommandID &name, const TranslatableString &label_in, void(Handler::*pmf)(const CommandContext &), CommandFlag flags, const CommandManager::Options &options={}, CommandHandlerFinder finder=FinderScope::DefaultFinder())
BuiltinCommandsModule::Registration< GetInfoCommand > reg