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