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******************************************************************//*******************************************************************/
23
24
25#include "GetInfoCommand.h"
26
27#include "CommandDispatch.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 "TrackFocus.h"
37#include "../TrackPanel.h"
38#include "WaveClip.h"
39#include "../tracks/playabletrack/wavetrack/ui/WaveformAppearance.h"
40#include "ViewInfo.h"
41#include "WaveTrack.h"
43#include "../LabelTrack.h"
44#include "NoteTrack.h"
45#include "TimeTrack.h"
46#include "Envelope.h"
47#include "ProjectAudioIO.h"
48#include "AudioIO.h"
49
50#include "SelectCommand.h"
51#include "ShuttleGui.h"
52#include "CommandContext.h"
53
54#include "../prefs/PrefsDialog.h"
55#include "SettingsVisitor.h"
56#include "PluginManager.h"
57#include "../tracks/ui/ChannelView.h"
58#include "ShuttleGui.h"
59
60#include <wx/frame.h>
61#include <wx/log.h>
62#include <wx/menu.h>
63
65{ XO("Get Info") };
66
68enum {
70 //kCommandsPlus,
79 nTypes
80};
81
83{
84 { XO("Commands") },
85 //{ wxT("CommandsPlus"), XO("Commands Plus") },
86 { XO("Menus") },
87 { XO("Preferences") },
88 { XO("Tracks") },
89 { XO("Clips") },
90 { XO("Envelopes") },
91 { XO("Labels") },
92 { XO("Boxes") },
93 { XO("Selection") },
94};
95
96enum {
102
104{
105 // These are acceptable dual purpose internal/visible names
106
107 /* i18n-hint JavaScript Object Notation */
108 { XO("JSON") },
109 /* i18n-hint name of a computer programming language */
110 { XO("LISP") },
111 { XO("Brief") }
112};
113
114template<bool Const>
116 S.DefineEnum( mInfoType, wxT("Type"), 0, kTypes, nTypes );
117 S.DefineEnum( mFormat, wxT("Format"), 0, kFormats, nFormats );
118 return true;
119}
120
122 { return VisitSettings<false>(S); }
123
125 { return VisitSettings<true>(S); }
126
128{
129 S.AddSpace(0, 5);
130
131 S.StartMultiColumn(2, wxALIGN_CENTER);
132 {
133 S.TieChoice( XXO("Type:"),
135 S.TieChoice( XXO("Format:"),
137 }
138 S.EndMultiColumn();
139}
140
142{
143 if( mFormat == kJson )
144 return ApplyInner( context );
145
146 if( mFormat == kLisp )
147 {
148 CommandContext LispyContext(
149 context.project,
150 std::make_unique<LispifiedCommandOutputTargets>( *context.pOutput.get() )
151 );
152 return ApplyInner( LispyContext );
153 }
154
155 if( mFormat == kBrief )
156 {
157 CommandContext BriefContext(
158 context.project,
159 std::make_unique<BriefCommandOutputTargets>( *context.pOutput.get() )
160 );
161 return ApplyInner( BriefContext );
162 }
163
164 return false;
165}
166
168{
169 switch( mInfoType ){
170 // flag of 1 to include parameterless commands.
171 case kCommands : return SendCommands( context, 1 );
172 case kMenus : return SendMenus( context );
173 case kPreferences : return SendPreferences( context );
174 case kTracks : return SendTracks( context );
175 case kClips : return SendClips( context );
176 case kEnvelopes : return SendEnvelopes( context );
177 case kLabels : return SendLabels( context );
178 case kBoxes : return SendBoxes( context );
179 case kSelection : return SendSelection( context );
180 default:
181 context.Status( "Command options not recognised" );
182 }
183 return false;
184}
185
187{
188 wxMenuBar * pBar = GetProjectFrame( context.project ).GetMenuBar();
189 if(!pBar ){
190 wxLogDebug("No menus");
191 return false;
192 }
193
194 size_t cnt = pBar->GetMenuCount();
195 size_t i;
196 wxString Label;
197 context.StartArray();
198 for(i=0;i<cnt;i++)
199 {
200 Label = pBar->GetMenuLabelText( i );
201 context.StartStruct();
202 context.AddItem( 0, "depth" );
203 context.AddItem( 0, "flags" );
204 context.AddItem( Label, "label" );
205 context.AddItem( "", "accel" );
206 context.EndStruct();
207 ExploreMenu( context, pBar->GetMenu( i ), pBar->GetId(), 1 );
208 }
209 context.EndArray();
210 return true;
211}
212
213#include "Prefs.h"
214
215namespace {
216
217/**************************************************************************/
221{
222public:
223 ShuttleGuiGetDefinition(wxWindow * pParent,CommandMessageTarget & target );
224 virtual ~ShuttleGuiGetDefinition();
225
226 wxCheckBox * TieCheckBox(
227 const TranslatableString &Prompt,
228 const BoolSetting &Setting) override;
229 wxCheckBox * TieCheckBoxOnRight(
230 const TranslatableString &Prompt,
231 const BoolSetting &Setting) override;
232
233 wxChoice *TieChoice(const TranslatableString &Prompt,
234 ChoiceSetting &choiceSetting) override;
235
236 wxChoice * TieNumberAsChoice(const TranslatableString &Prompt,
238 const TranslatableStrings & Choices,
239 const std::vector<int> * pInternalChoices, int iNoMatchSelector) override;
240
241 wxTextCtrl * TieTextBox(
242 const TranslatableString &Prompt,
243 const StringSetting &Setting,
244 const int nChars) override;
245 wxTextCtrl * TieIntegerTextBox(
246 const TranslatableString & Prompt,
247 const IntSetting &Setting,
248 const int nChars) override;
249 wxTextCtrl * TieNumericTextBox(
250 const TranslatableString & Prompt,
251 const DoubleSetting &Setting,
252 const int nChars, bool acceptEnter) override;
253 wxSlider * TieSlider(
254 const TranslatableString & Prompt,
255 const IntSetting &Setting,
256 const int max,
257 const int min = 0) override;
258 wxSpinCtrl * TieSpinCtrl(
259 const TranslatableString &Prompt,
260 const IntSetting &Setting,
261 const int max,
262 const int min) override;
263};
264
265ShuttleGuiGetDefinition::ShuttleGuiGetDefinition(
266 wxWindow * pParent,CommandMessageTarget & target )
267: ShuttleGui( pParent, eIsGettingMetadata ),
269{
270
271}
273{
274}
275
277 const TranslatableString &Prompt,
278 const BoolSetting &Setting)
279{
280 StartStruct();
281 AddItem( Setting.GetPath(), "id" );
282 AddItem( Prompt.Translation(), "prompt" );
283 AddItem( "bool", "type" );
284 AddBool( Setting.GetDefault(), "default" );
285 EndStruct();
286 return ShuttleGui::TieCheckBox( Prompt, Setting );
287}
288
290 const TranslatableString &Prompt,
291 const BoolSetting &Setting)
292{
293 StartStruct();
294 AddItem( Setting.GetPath(), "id" );
295 AddItem( Prompt.Translation(), "prompt" );
296 AddItem( "bool", "type" );
297 AddBool( Setting.GetDefault(), "default" );
298 EndStruct();
299 return ShuttleGui::TieCheckBoxOnRight( Prompt, Setting );
300}
301
303 ChoiceSetting &choiceSetting)
304{
305 StartStruct();
306 AddItem( choiceSetting.Key(), "id" );
307 AddItem( Prompt.Translation(), "prompt" );
308 AddItem( "enum", "type" );
309 AddItem( choiceSetting.Default().Internal(), "default" );
310 StartField( "enum" );
311 StartArray();
312 for ( const auto &choice : choiceSetting.GetSymbols().GetInternals() )
313 AddItem( choice );
314 EndArray();
315 EndField();
316 EndStruct();
317 return ShuttleGui::TieChoice( Prompt, choiceSetting );
318}
319
321 const TranslatableString &Prompt,
323 const TranslatableStrings & Choices,
324 const std::vector<int> * pInternalChoices, int iNoMatchSelector)
325{
326 // Come here for controls that present non-exhaustive choices among some
327 // numbers, with an associated control that allows arbitrary entry of an
328 // "Other..."
329 StartStruct();
330 AddItem( Setting.GetPath(), "id" );
331 AddItem( Prompt.Translation(), "prompt" );
332 AddItem( "number", "type" ); // not "enum" !
333 AddItem( Setting.GetDefault(), "default" );
334 EndStruct();
336 Prompt, Setting, Choices, pInternalChoices, iNoMatchSelector );
337}
338
340 const TranslatableString &Prompt,
341 const StringSetting &Setting,
342 const int nChars)
343{
344 StartStruct();
345 AddItem( Setting.GetPath(), "id" );
346 AddItem( Prompt.Translation(), "prompt" );
347 AddItem( "string", "type" );
348 AddItem( Setting.GetDefault(), "default" );
349 EndStruct();
350 return ShuttleGui::TieTextBox( Prompt, Setting, nChars );
351}
352
354 const TranslatableString & Prompt,
355 const IntSetting &Setting,
356 const int nChars)
357{
358 StartStruct();
359 AddItem( Setting.GetPath(), "id" );
360 AddItem( Prompt.Translation(), "prompt" );
361 AddItem( "number", "type" );
362 AddItem( Setting.GetDefault(), "default" );
363 EndStruct();
364 return ShuttleGui::TieIntegerTextBox( Prompt, Setting, nChars );
365}
366
368 const TranslatableString & Prompt,
369 const DoubleSetting &Setting,
370 const int nChars, bool acceptEnter)
371{
372 StartStruct();
373 AddItem( Setting.GetPath(), "id" );
374 AddItem( Prompt.Translation(), "prompt" );
375 AddItem( "number", "type" );
376 AddItem( Setting.GetDefault(), "default" );
377 EndStruct();
378 return ShuttleGui::TieNumericTextBox( Prompt, Setting, nChars, acceptEnter );
379}
380
382 const TranslatableString & Prompt,
383 const IntSetting &Setting,
384 const int max,
385 const int min)
386{
387 StartStruct();
388 AddItem( Setting.GetPath(), "id" );
389 AddItem( Prompt.Translation(), "prompt" );
390 AddItem( "number", "type" );
391 AddItem( Setting.GetDefault(), "default" );
392 EndStruct();
393 return ShuttleGui::TieSlider( Prompt, Setting, max, min );
394}
395
397 const TranslatableString &Prompt,
398 const IntSetting &Setting,
399 const int max,
400 const int min)
401{
402 StartStruct();
403 AddItem( Setting.GetPath(), "id" );
404 AddItem( Prompt.Translation(), "prompt" );
405 AddItem( "number", "type" );
406 AddItem( Setting.GetDefault(), "default" );
407 EndStruct();
408 return ShuttleGui::TieSpinCtrl( Prompt, Setting, max, min );
409}
410
411}
412
414{
415 context.StartArray();
416 auto pWin = &GetProjectFrame( context.project );
417 GlobalPrefsDialog dialog( pWin, &context.project );
418 // wxCommandEvent Evt;
419 //dialog.Show();
420 ShuttleGuiGetDefinition S(pWin, *((context.pOutput)->mStatusTarget) );
421 dialog.ShuttleAll( S );
422 context.EndArray();
423 return true;
424}
425
429bool GetInfoCommand::SendCommands(const CommandContext &context, int flags )
430{
431 context.StartArray();
434 {
435 for (auto &plug
437 auto command = em.GetCommandIdentifier(plug.GetID());
438 if (!command.empty()){
439 em.GetCommandDefinition( plug.GetID(), context, flags );
440 }
441 }
442 }
443 context.EndArray();
444 return true;
445}
446
448{
449 //context.Status("Boxes");
450 auto pWin = &GetProjectFrame( context.project );
451
452 context.StartArray();
453 wxRect R = pWin->GetScreenRect();
454
455 //R.SetPosition( wxPoint(0,0) );
456
457 //wxString Name = pWin->GetName();
458 context.StartStruct();
459 context.AddItem( 0, "depth" );
460 context.AddItem( "Audacity Window", "name" );
461 context.StartField( "box" );
462 context.StartArray( );
463 context.AddItem( R.GetLeft() );
464 context.AddItem( R.GetTop() );
465 context.AddItem( R.GetRight() );
466 context.AddItem( R.GetBottom() );
467 context.EndArray( );
468 context.EndField();
469 context.EndStruct( );
470
471 ExploreAdornments( context, pWin->GetPosition()+wxSize( 6,-1), pWin, pWin->GetId(), 1 );
472 ExploreWindows( context, pWin->GetPosition()+wxSize( 6,-1), pWin, pWin->GetId(), 1 );
473 context.EndArray( );
474 return true;
475}
476
478{
479 auto &tracks = TrackList::Get( context.project );
480 context.StartArray();
481 for (auto trk : tracks)
482 {
483 auto &trackFocus = TrackFocus::Get( context.project );
484 Track * fTrack = trackFocus.Get();
485
486 context.StartStruct();
487 context.AddItem( trk->GetName(), "name" );
488 context.AddBool( (trk == fTrack), "focused");
489 context.AddBool( trk->GetSelected(), "selected" );
490 //JKC: Possibly add later...
491 //context.AddItem(ChannelView::GetChannelGroupHeight(*trk), "height");
492 trk->TypeSwitch( [&] (const WaveTrack &t) {
493 float vzmin, vzmax;
494 WaveformScale::Get(t).GetDisplayBounds(vzmin, vzmax);
495 context.AddItem( "wave", "kind" );
496 context.AddItem( t.GetStartTime(), "start" );
497 context.AddItem( t.GetEndTime(), "end" );
498 context.AddItem( t.GetPan() , "pan");
499 context.AddItem( t.GetGain() , "gain");
500 context.AddItem( t.NChannels(), "channels");
501 context.AddBool( t.GetSolo(), "solo" );
502 context.AddBool( t.GetMute(), "mute");
503 context.AddItem( vzmin, "VZoomMin");
504 context.AddItem( vzmax, "VZoomMax");
505 },
506#if defined(USE_MIDI)
507 [&](const NoteTrack &) {
508 context.AddItem( "note", "kind" );
509 },
510#endif
511 [&](const LabelTrack &) {
512 context.AddItem( "label", "kind" );
513 },
514 [&](const TimeTrack &) {
515 context.AddItem( "time", "kind" );
516 }
517 );
518 context.EndStruct();
519 }
520 context.EndArray();
521 return true;
522}
523
525{
526 auto &tracks = TrackList::Get( context.project );
527 int i=0;
528 context.StartArray();
529 for (auto t : tracks) {
530 t->TypeSwitch([&](WaveTrack &waveTrack) {
531 for (const auto pInterval : waveTrack.Intervals()) {
532 context.StartStruct();
533 context.AddItem((double)i, "track");
534 context.AddItem(pInterval->GetPlayStartTime(), "start");
535 context.AddItem(pInterval->GetPlayEndTime(), "end");
536 // Assuming same colors, look at only left channel
537 const auto &colors =
538 WaveColorAttachment::Get(**pInterval->Channels().begin());
539 context.AddItem(colors.GetColorIndex(), "color");
540 context.AddItem(pInterval->GetName(), "name");
541 context.EndStruct();
542 }
543 });
544 // Per track numbering counts all tracks
545 i++;
546 }
547 context.EndArray();
548
549 return true;
550}
551
553{
554 auto &tracks = TrackList::Get( context.project );
555 int i=0;
556 int j=0;
557 context.StartArray();
558 for (auto t : tracks) {
559 t->TypeSwitch([&](WaveTrack &waveTrack) {
560 auto ptrs = waveTrack.SortedIntervalArray();
561 j = 0;
562 for (auto &pClip : ptrs) {
563 context.StartStruct();
564 context.AddItem((double)i, "track");
565 context.AddItem((double)j, "clip");
566 context.AddItem(pClip->GetPlayStartTime(), "start");
567 const auto pEnv = &pClip->GetEnvelope();
568 context.StartField("points");
569 context.StartArray();
570 double offset = pEnv->GetOffset();
571 for (size_t k = 0; k < pEnv->GetNumberOfPoints(); k++)
572 {
573 context.StartStruct();
574 context.AddItem((*pEnv)[k].GetT() + offset, "t");
575 context.AddItem((*pEnv)[k].GetVal(), "y");
576 context.EndStruct();
577 }
578 context.EndArray();
579 context.EndField();
580 context.AddItem(pClip->GetPlayEndTime(), "end");
581 context.EndStruct();
582 j++;
583 }
584 });
585 // Per track numbering counts all tracks
586 i++;
587 }
588 context.EndArray();
589
590 return true;
591}
592
593
595{
596 auto &tracks = TrackList::Get( context.project );
597 int i=0;
598 context.StartArray();
599 for (auto t : tracks) {
600 t->TypeSwitch( [&](LabelTrack &labelTrack) {
601#ifdef VERBOSE_LABELS_FORMATTING
602 for (int nn = 0; nn< (int)labelTrack->mLabels.size(); nn++) {
603 const auto &label = labelTrack->mLabels[nn];
604 context.StartStruct();
605 context.AddItem( (double)i, "track" );
606 context.AddItem( label.getT0(), "start" );
607 context.AddItem( label.getT1(), "end" );
608 context.AddItem( label.title, "text" );
609 context.EndStruct();
610 }
611#else
612 context.StartArray();
613 context.AddItem( (double)i ); // Track number.
614 context.StartArray();
615 for ( const auto &label : labelTrack.GetLabels() ) {
616 context.StartArray();
617 context.AddItem( label.getT0() ); // start
618 context.AddItem( label.getT1() ); // end
619 context.AddItem( label.title ); //text.
620 context.EndArray();
621 }
622 context.EndArray();
623 context.EndArray();
624#endif
625 } );
626 // Per track numbering counts all tracks
627 i++;
628 }
629 context.EndArray();
630
631 return true;
632}
633
635{
636 context.StartStruct();
637
638 const auto& selectedRegion = ViewInfo::Get( context.project ).selectedRegion;
639
640 context.AddItem(selectedRegion.t0(), "Start"); // Send selection start position
641 context.AddItem(selectedRegion.t1(), "End"); // Send cselection end position
642
643 context.EndStruct();
644
645 return true;
646}
647
648/*******************************************************************
649The various Explore functions are called from the Send functions,
650and may be recursive. 'Send' is the top level.
651*******************************************************************/
652
653void GetInfoCommand::ExploreMenu( const CommandContext &context, wxMenu * pMenu, int Id, int depth ){
654 static_cast<void>(Id);//compiler food.
655 if( !pMenu )
656 return;
657
658 auto &commandManager = CommandManager::Get( context.project );
659
660 wxMenuItemList list = pMenu->GetMenuItems();
661 size_t lcnt = list.size();
662 wxMenuItem * item;
663 wxString Label;
664 wxString Accel;
665 CommandID Name;
666
667 for (size_t lndx = 0; lndx < lcnt; lndx++) {
668 item = list.Item(lndx)->GetData();
669 Label = item->GetItemLabelText();
670 Name = commandManager.GetNameFromNumericID( item->GetId() );
671 Accel = item->GetItemLabel();
672 if( Accel.Contains("\t") )
673 Accel = Accel.AfterLast('\t');
674 else
675 Accel = "";
676 if( item->IsSeparator() )
677 Label = "----";
678 int flags = 0;
679 if (item->IsSubMenu())
680 flags +=1;
681 if (item->IsCheck() && item->IsChecked())
682 flags +=2;
683
684 context.StartStruct();
685 context.AddItem( depth, "depth" );
686 context.AddItem( flags, "flags" );
687 context.AddItem( Label, "label" );
688 context.AddItem( Accel, "accel" );
689 if( !Name.empty() )
690 // using GET to expose CommandID in results of GetInfoCommand...
691 // PRL asks, is that all right?
692 context.AddItem( Name.GET(), "id" );// It is called Scripting ID outside Audacity.
693 context.EndStruct();
694
695 if (item->IsSubMenu()) {
696 pMenu = item->GetSubMenu();
697 ExploreMenu( context, pMenu, item->GetId(), depth+1 );
698 }
699 }
700}
701
703 wxPoint WXUNUSED(P), wxWindow * pWin, int WXUNUSED(Id), int depth )
704{
705 // Dang! wxMenuBar returns bogus screen rect.
706 // We're going to have to fake it instead.
707 //wxMenuBar * pBar = context.GetProject()->GetMenuBar();
708 //wxRect R = pBar->GetScreenRect();
709 //R.SetPosition( R.GetPosition() - P );
710
711 wxRect R1 = pWin->GetScreenRect();
712 wxSize s = pWin->GetWindowBorderSize();
713 wxRect R( 2,32, R1.GetWidth() - s.GetWidth() * 2 -16, 22 );
714
715 context.StartStruct();
716 context.AddItem( depth, "depth" );
717 context.AddItem( "MenuBar", "label" );
718 context.StartField( "box" );
719 context.StartArray();
720 context.AddItem( R.GetLeft() );
721 context.AddItem( R.GetTop() );
722 context.AddItem( R.GetRight() );
723 context.AddItem( R.GetBottom() );
724 context.EndArray();
725 context.EndField();
726 context.EndStruct();
727}
728
730 wxPoint P, int depth )
731{
732 AudacityProject * pProj = &context.project;
733 auto &tp = TrackPanel::Get( *pProj );
734 wxRect panelRect{ {}, tp.GetSize() };
735 for (auto pTrack : TrackList::Get(*pProj)) {
736 for (auto pChannel : pTrack->Channels()) {
737 auto rulers = tp.FindRulerRects(*pChannel);
738 for (auto &R : rulers) {
739 if (!R.Intersects(panelRect))
740 continue;
741 R.SetPosition( R.GetPosition() + P );
742 context.StartStruct();
743 context.AddItem( depth, "depth" );
744 context.AddItem( "VRuler", "label" );
745 context.StartField("box");
746 context.StartArray();
747 context.AddItem( R.GetLeft() );
748 context.AddItem( R.GetTop() );
749 context.AddItem( R.GetRight() );
750 context.AddItem( R.GetBottom() );
751 context.EndArray();
752 context.EndField();
753 context.EndStruct();
754 }
755 }
756 }
757}
758
759
761 wxPoint P, wxWindow * pWin, int Id, int depth )
762{
763 static_cast<void>(Id);//Compiler food.
764
765 if( pWin->GetName() == "Track Panel" )
766 {
767 wxRect R = pWin->GetScreenRect();
768 ExploreTrackPanel( context, R.GetPosition()-P, depth );
769 return;
770 }
771 wxWindowList list = pWin->GetChildren();
772 size_t lcnt = list.size();
773
774 for (size_t lndx = 0; lndx < lcnt; lndx++) {
775 wxWindow * item = list[lndx];
776 if( !item->IsShown() )
777 continue;
778 wxRect R = item->GetScreenRect();
779 R.SetPosition( R.GetPosition() - P );
780 wxString Name = item->GetName();
781 // Ignore staticLine and StaticBitmap.
782 if( Name.StartsWith( "static" ) )
783 continue;
784 // Ignore anonymous panels.
785 if( Name == "panel" )
786 continue;
787 if( Name.empty() )
788 Name = wxString("*") + item->GetToolTipText();
789
790 context.StartStruct();
791 context.AddItem( depth, "depth" );
792 context.AddItem( Name, "label" );
793 context.AddItem( item->GetId(), "id" );
794 context.StartField( "box" );
795 context.StartArray();
796 context.AddItem( R.GetLeft() );
797 context.AddItem( R.GetTop() );
798 context.AddItem( R.GetRight() );
799 context.AddItem( R.GetBottom() );
800 context.EndArray();
801 context.EndField();
802 context.EndStruct();
803
804 ExploreWindows( context, P, item, item->GetId(), depth+1 );
805 }
806}
807
808namespace {
809using namespace MenuRegistry;
810
811// Register menu items
812
814 // Note that the PLUGIN_SYMBOL must have a space between words,
815 // whereas the short-form used here must not.
816 // (So if you did write "Compare Audio" for the PLUGIN_SYMBOL name, then
817 // you would have to use "CompareAudio" here.)
818 Command( wxT("GetInfo"), XXO("Get Info..."),
820 wxT("Optional/Extra/Part2/Scriptables2")
821};
822
823}
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]
static const EnumValueSymbol kFormats[nFormats]
@ kBrief
@ nFormats
@ kJson
@ kLisp
@ kSelection
@ 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
for(int ii=0, nn=names.size();ii< nn;++ii)
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
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:318
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
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.
Definition: Prefs.h:356
A LabelTrack is a Track that holds labels (LabelStruct).
Definition: LabelTrack.h:95
const LabelArray & GetLabels() const
Definition: LabelTrack.h:156
LabelArray mLabels
Definition: LabelTrack.h:218
A Track that is used for Midi notes. (Somewhat old code).
Definition: NoteTrack.h:78
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:110
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:314
static TrackPanel & Get(AudacityProject &project)
Definition: TrackPanel.cpp:234
Holds a msgid for the translation catalog; may also bind format arguments.
wxString Translation() const
NotifyingSelectedRegion selectedRegion
Definition: ViewInfo.h:216
static ViewInfo & Get(AudacityProject &project)
Definition: ViewInfo.cpp:235
A Track that contains audio waveform data.
Definition: WaveTrack.h:203
bool GetMute() const override
May vary asynchronously.
Definition: WaveTrack.cpp:2323
double GetStartTime() const override
Implement WideSampleSequence.
Definition: WaveTrack.cpp:2585
float GetPan() const
Definition: WaveTrack.cpp:842
IntervalHolders SortedIntervalArray()
Return all WaveClips sorted by clip play start time.
Definition: WaveTrack.cpp:3279
double GetEndTime() const override
Implement WideSampleSequence.
Definition: WaveTrack.cpp:2595
float GetGain() const
Definition: WaveTrack.cpp:824
auto Intervals()
Definition: WaveTrack.h:670
bool GetSolo() const override
May vary asynchronously.
Definition: WaveTrack.cpp:2328
size_t NChannels() const override
A constant property.
Definition: WaveTrack.cpp:530
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