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 "LoadCommands.h"
27#include "Project.h"
28#include "../ProjectWindows.h"
29#include "CommandManager.h"
30#include "CommandTargets.h"
31#include "../effects/EffectManager.h"
32#include "../widgets/Overlay.h"
33#include "../TrackPanelAx.h"
34#include "../TrackPanel.h"
35#include "../WaveClip.h"
36#include "ViewInfo.h"
37#include "../WaveTrack.h"
38#include "../LabelTrack.h"
39#include "../NoteTrack.h"
40#include "../TimeTrack.h"
41#include "Envelope.h"
42
43#include "SelectCommand.h"
44#include "../ShuttleGui.h"
45#include "CommandContext.h"
46
47#include "../prefs/PrefsDialog.h"
48#include "../Shuttle.h"
49#include "PluginManager.h"
50#include "../tracks/ui/TrackView.h"
51#include "../ShuttleGui.h"
52
53#include <wx/frame.h>
54#include <wx/log.h>
55#include <wx/menu.h>
56
58{ XO("Get Info") };
59
61enum {
63 //kCommandsPlus,
71 nTypes
72};
73
75{
76 { XO("Commands") },
77 //{ wxT("CommandsPlus"), XO("Commands Plus") },
78 { XO("Menus") },
79 { XO("Preferences") },
80 { XO("Tracks") },
81 { XO("Clips") },
82 { XO("Envelopes") },
83 { XO("Labels") },
84 { XO("Boxes") },
85};
86
87enum {
92};
93
95{
96 // These are acceptable dual purpose internal/visible names
97
98 /* i18n-hint JavaScript Object Notation */
99 { XO("JSON") },
100 /* i18n-hint name of a computer programming language */
101 { XO("LISP") },
102 { XO("Brief") }
103};
104
105template<bool Const>
107 S.DefineEnum( mInfoType, wxT("Type"), 0, kTypes, nTypes );
108 S.DefineEnum( mFormat, wxT("Format"), 0, kFormats, nFormats );
109 return true;
110}
111
113 { return VisitSettings<false>(S); }
114
116 { return VisitSettings<true>(S); }
117
119{
120 S.AddSpace(0, 5);
121
122 S.StartMultiColumn(2, wxALIGN_CENTER);
123 {
124 S.TieChoice( XXO("Type:"),
126 S.TieChoice( XXO("Format:"),
128 }
129 S.EndMultiColumn();
130}
131
133{
134 if( mFormat == kJson )
135 return ApplyInner( context );
136
137 if( mFormat == kLisp )
138 {
139 CommandContext LispyContext(
140 context.project,
141 std::make_unique<LispifiedCommandOutputTargets>( *context.pOutput.get() )
142 );
143 return ApplyInner( LispyContext );
144 }
145
146 if( mFormat == kBrief )
147 {
148 CommandContext BriefContext(
149 context.project,
150 std::make_unique<BriefCommandOutputTargets>( *context.pOutput.get() )
151 );
152 return ApplyInner( BriefContext );
153 }
154
155 return false;
156}
157
159{
160 switch( mInfoType ){
161 // flag of 1 to include parameterless commands.
162 case kCommands : return SendCommands( context, 1 );
163 case kMenus : return SendMenus( context );
164 case kPreferences : return SendPreferences( context );
165 case kTracks : return SendTracks( context );
166 case kClips : return SendClips( context );
167 case kEnvelopes : return SendEnvelopes( context );
168 case kLabels : return SendLabels( context );
169 case kBoxes : return SendBoxes( context );
170 default:
171 context.Status( "Command options not recognised" );
172 }
173 return false;
174}
175
177{
178 wxMenuBar * pBar = GetProjectFrame( context.project ).GetMenuBar();
179 if(!pBar ){
180 wxLogDebug("No menus");
181 return false;
182 }
183
184 size_t cnt = pBar->GetMenuCount();
185 size_t i;
186 wxString Label;
187 context.StartArray();
188 for(i=0;i<cnt;i++)
189 {
190 Label = pBar->GetMenuLabelText( i );
191 context.StartStruct();
192 context.AddItem( 0, "depth" );
193 context.AddItem( 0, "flags" );
194 context.AddItem( Label, "label" );
195 context.AddItem( "", "accel" );
196 context.EndStruct();
197 ExploreMenu( context, pBar->GetMenu( i ), pBar->GetId(), 1 );
198 }
199 context.EndArray();
200 return true;
201}
202
203#include "Prefs.h"
204
205namespace {
206
207/**************************************************************************/
211{
212public:
213 ShuttleGuiGetDefinition(wxWindow * pParent,CommandMessageTarget & target );
214 virtual ~ShuttleGuiGetDefinition();
215
216 wxCheckBox * TieCheckBox(
217 const TranslatableString &Prompt,
218 const BoolSetting &Setting) override;
219 wxCheckBox * TieCheckBoxOnRight(
220 const TranslatableString &Prompt,
221 const BoolSetting &Setting) override;
222
223 wxChoice *TieChoice(const TranslatableString &Prompt,
224 ChoiceSetting &choiceSetting) override;
225
226 wxChoice * TieNumberAsChoice(const TranslatableString &Prompt,
228 const TranslatableStrings & Choices,
229 const std::vector<int> * pInternalChoices, int iNoMatchSelector) override;
230
231 wxTextCtrl * TieTextBox(
232 const TranslatableString &Prompt,
233 const StringSetting &Setting,
234 const int nChars) override;
235 wxTextCtrl * TieIntegerTextBox(
236 const TranslatableString & Prompt,
237 const IntSetting &Setting,
238 const int nChars) override;
239 wxTextCtrl * TieNumericTextBox(
240 const TranslatableString & Prompt,
241 const DoubleSetting &Setting,
242 const int nChars) override;
243 wxSlider * TieSlider(
244 const TranslatableString & Prompt,
245 const IntSetting &Setting,
246 const int max,
247 const int min = 0) override;
248 wxSpinCtrl * TieSpinCtrl(
249 const TranslatableString &Prompt,
250 const IntSetting &Setting,
251 const int max,
252 const int min) override;
253};
254
255ShuttleGuiGetDefinition::ShuttleGuiGetDefinition(
256 wxWindow * pParent,CommandMessageTarget & target )
257: ShuttleGui( pParent, eIsGettingMetadata ),
259{
260
261}
263{
264}
265
267 const TranslatableString &Prompt,
268 const BoolSetting &Setting)
269{
270 StartStruct();
271 AddItem( Setting.GetPath(), "id" );
272 AddItem( Prompt.Translation(), "prompt" );
273 AddItem( "bool", "type" );
274 AddBool( Setting.GetDefault(), "default" );
275 EndStruct();
276 return ShuttleGui::TieCheckBox( Prompt, Setting );
277}
278
280 const TranslatableString &Prompt,
281 const BoolSetting &Setting)
282{
283 StartStruct();
284 AddItem( Setting.GetPath(), "id" );
285 AddItem( Prompt.Translation(), "prompt" );
286 AddItem( "bool", "type" );
287 AddBool( Setting.GetDefault(), "default" );
288 EndStruct();
289 return ShuttleGui::TieCheckBoxOnRight( Prompt, Setting );
290}
291
293 ChoiceSetting &choiceSetting)
294{
295 StartStruct();
296 AddItem( choiceSetting.Key(), "id" );
297 AddItem( Prompt.Translation(), "prompt" );
298 AddItem( "enum", "type" );
299 AddItem( choiceSetting.Default().Internal(), "default" );
300 StartField( "enum" );
301 StartArray();
302 for ( const auto &choice : choiceSetting.GetSymbols().GetInternals() )
303 AddItem( choice );
304 EndArray();
305 EndField();
306 EndStruct();
307 return ShuttleGui::TieChoice( Prompt, choiceSetting );
308}
309
311 const TranslatableString &Prompt,
313 const TranslatableStrings & Choices,
314 const std::vector<int> * pInternalChoices, int iNoMatchSelector)
315{
316 // Come here for controls that present non-exhaustive choices among some
317 // numbers, with an associated control that allows arbitrary entry of an
318 // "Other..."
319 StartStruct();
320 AddItem( Setting.GetPath(), "id" );
321 AddItem( Prompt.Translation(), "prompt" );
322 AddItem( "number", "type" ); // not "enum" !
323 AddItem( Setting.GetDefault(), "default" );
324 EndStruct();
326 Prompt, Setting, Choices, pInternalChoices, iNoMatchSelector );
327}
328
330 const TranslatableString &Prompt,
331 const StringSetting &Setting,
332 const int nChars)
333{
334 StartStruct();
335 AddItem( Setting.GetPath(), "id" );
336 AddItem( Prompt.Translation(), "prompt" );
337 AddItem( "string", "type" );
338 AddItem( Setting.GetDefault(), "default" );
339 EndStruct();
340 return ShuttleGui::TieTextBox( Prompt, Setting, nChars );
341}
342
344 const TranslatableString & Prompt,
345 const IntSetting &Setting,
346 const int nChars)
347{
348 StartStruct();
349 AddItem( Setting.GetPath(), "id" );
350 AddItem( Prompt.Translation(), "prompt" );
351 AddItem( "number", "type" );
352 AddItem( Setting.GetDefault(), "default" );
353 EndStruct();
354 return ShuttleGui::TieIntegerTextBox( Prompt, Setting, nChars );
355}
356
358 const TranslatableString & Prompt,
359 const DoubleSetting &Setting,
360 const int nChars)
361{
362 StartStruct();
363 AddItem( Setting.GetPath(), "id" );
364 AddItem( Prompt.Translation(), "prompt" );
365 AddItem( "number", "type" );
366 AddItem( Setting.GetDefault(), "default" );
367 EndStruct();
368 return ShuttleGui::TieNumericTextBox( Prompt, Setting, nChars );
369}
370
372 const TranslatableString & Prompt,
373 const IntSetting &Setting,
374 const int max,
375 const int min)
376{
377 StartStruct();
378 AddItem( Setting.GetPath(), "id" );
379 AddItem( Prompt.Translation(), "prompt" );
380 AddItem( "number", "type" );
381 AddItem( Setting.GetDefault(), "default" );
382 EndStruct();
383 return ShuttleGui::TieSlider( Prompt, Setting, max, min );
384}
385
387 const TranslatableString &Prompt,
388 const IntSetting &Setting,
389 const int max,
390 const int min)
391{
392 StartStruct();
393 AddItem( Setting.GetPath(), "id" );
394 AddItem( Prompt.Translation(), "prompt" );
395 AddItem( "number", "type" );
396 AddItem( Setting.GetDefault(), "default" );
397 EndStruct();
398 return ShuttleGui::TieSpinCtrl( Prompt, Setting, max, min );
399}
400
401}
402
404{
405 context.StartArray();
406 auto pWin = &GetProjectFrame( context.project );
407 GlobalPrefsDialog dialog( pWin, &context.project );
408 // wxCommandEvent Evt;
409 //dialog.Show();
410 ShuttleGuiGetDefinition S(pWin, *((context.pOutput)->mStatusTarget) );
411 dialog.ShuttleAll( S );
412 context.EndArray();
413 return true;
414}
415
419bool GetInfoCommand::SendCommands(const CommandContext &context, int flags )
420{
421 context.StartArray();
424 {
425 for (auto &plug
427 auto command = em.GetCommandIdentifier(plug.GetID());
428 if (!command.empty()){
429 em.GetCommandDefinition( plug.GetID(), context, flags );
430 }
431 }
432 }
433 context.EndArray();
434 return true;
435}
436
438{
439 //context.Status("Boxes");
440 auto pWin = &GetProjectFrame( context.project );
441
442 context.StartArray();
443 wxRect R = pWin->GetScreenRect();
444
445 //R.SetPosition( wxPoint(0,0) );
446
447 //wxString Name = pWin->GetName();
448 context.StartStruct();
449 context.AddItem( 0, "depth" );
450 context.AddItem( "Audacity Window", "name" );
451 context.StartField( "box" );
452 context.StartArray( );
453 context.AddItem( R.GetLeft() );
454 context.AddItem( R.GetTop() );
455 context.AddItem( R.GetRight() );
456 context.AddItem( R.GetBottom() );
457 context.EndArray( );
458 context.EndField();
459 context.EndStruct( );
460
461 ExploreAdornments( context, pWin->GetPosition()+wxSize( 6,-1), pWin, pWin->GetId(), 1 );
462 ExploreWindows( context, pWin->GetPosition()+wxSize( 6,-1), pWin, pWin->GetId(), 1 );
463 context.EndArray( );
464 return true;
465}
466
468{
469 auto &tracks = TrackList::Get( context.project );
470 context.StartArray();
471 for (auto trk : tracks.Leaders())
472 {
473 auto &trackFocus = TrackFocus::Get( context.project );
474 Track * fTrack = trackFocus.Get();
475
476 context.StartStruct();
477 context.AddItem( trk->GetName(), "name" );
478 context.AddBool( (trk == fTrack), "focused");
479 context.AddBool( trk->GetSelected(), "selected" );
480 //JKC: Possibly add later...
481 //context.AddItem( TrackView::Get( *trk ).GetHeight(), "height" );
482 trk->TypeSwitch( [&] (const WaveTrack* t ) {
483 float vzmin, vzmax;
484 t->GetDisplayBounds(&vzmin, &vzmax);
485 context.AddItem( "wave", "kind" );
486 context.AddItem( t->GetStartTime(), "start" );
487 context.AddItem( t->GetEndTime(), "end" );
488 context.AddItem( t->GetPan() , "pan");
489 context.AddItem( t->GetGain() , "gain");
490 context.AddItem( TrackList::Channels(t).size(), "channels");
491 context.AddBool( t->GetSolo(), "solo" );
492 context.AddBool( t->GetMute(), "mute");
493 context.AddItem( vzmin, "VZoomMin");
494 context.AddItem( vzmax, "VZoomMax");
495 },
496#if defined(USE_MIDI)
497 [&](const NoteTrack *) {
498 context.AddItem( "note", "kind" );
499 },
500#endif
501 [&](const LabelTrack *) {
502 context.AddItem( "label", "kind" );
503 },
504 [&](const TimeTrack *) {
505 context.AddItem( "time", "kind" );
506 }
507 );
508 context.EndStruct();
509 }
510 context.EndArray();
511 return true;
512}
513
515{
516 auto &tracks = TrackList::Get( context.project );
517 int i=0;
518 context.StartArray();
519 for (auto t : tracks.Leaders()) {
520 t->TypeSwitch([&](WaveTrack *waveTrack) {
521 WaveClipPointers ptrs(waveTrack->SortedClipArray());
522 for (WaveClip * pClip : ptrs) {
523 context.StartStruct();
524 context.AddItem((double)i, "track");
525 context.AddItem(pClip->GetPlayStartTime(), "start");
526 context.AddItem(pClip->GetPlayEndTime(), "end");
527 context.AddItem(pClip->GetColourIndex(), "color");
528 context.EndStruct();
529 }
530 });
531 // Per track numbering counts all tracks
532 i++;
533 }
534 context.EndArray();
535
536 return true;
537}
538
540{
541 auto &tracks = TrackList::Get( context.project );
542 int i=0;
543 int j=0;
544 context.StartArray();
545 for (auto t : tracks.Leaders()) {
546 t->TypeSwitch([&](WaveTrack *waveTrack) {
547 WaveClipPointers ptrs(waveTrack->SortedClipArray());
548 j = 0;
549 for (WaveClip * pClip : ptrs) {
550 context.StartStruct();
551 context.AddItem((double)i, "track");
552 context.AddItem((double)j, "clip");
553 context.AddItem(pClip->GetPlayStartTime(), "start");
554 Envelope * pEnv = pClip->GetEnvelope();
555 context.StartField("points");
556 context.StartArray();
557 double offset = pEnv->GetOffset();
558 for (size_t k = 0; k < pEnv->GetNumberOfPoints(); k++)
559 {
560 context.StartStruct();
561 context.AddItem((*pEnv)[k].GetT() + offset, "t");
562 context.AddItem((*pEnv)[k].GetVal(), "y");
563 context.EndStruct();
564 }
565 context.EndArray();
566 context.EndField();
567 context.AddItem(pClip->GetPlayEndTime(), "end");
568 context.EndStruct();
569 j++;
570 }
571 });
572 // Per track numbering counts all tracks
573 i++;
574 }
575 context.EndArray();
576
577 return true;
578}
579
580
582{
583 auto &tracks = TrackList::Get( context.project );
584 int i=0;
585 context.StartArray();
586 for (auto t : tracks.Leaders()) {
587 t->TypeSwitch( [&](LabelTrack *labelTrack) {
588#ifdef VERBOSE_LABELS_FORMATTING
589 for (int nn = 0; nn< (int)labelTrack->mLabels.size(); nn++) {
590 const auto &label = labelTrack->mLabels[nn];
591 context.StartStruct();
592 context.AddItem( (double)i, "track" );
593 context.AddItem( label.getT0(), "start" );
594 context.AddItem( label.getT1(), "end" );
595 context.AddItem( label.title, "text" );
596 context.EndStruct();
597 }
598#else
599 context.StartArray();
600 context.AddItem( (double)i ); // Track number.
601 context.StartArray();
602 for ( const auto &label : labelTrack->GetLabels() ) {
603 context.StartArray();
604 context.AddItem( label.getT0() ); // start
605 context.AddItem( label.getT1() ); // end
606 context.AddItem( label.title ); //text.
607 context.EndArray();
608 }
609 context.EndArray();
610 context.EndArray();
611#endif
612 } );
613 // Per track numbering counts all tracks
614 i++;
615 }
616 context.EndArray();
617
618 return true;
619}
620
621/*******************************************************************
622The various Explore functions are called from the Send functions,
623and may be recursive. 'Send' is the top level.
624*******************************************************************/
625
626void GetInfoCommand::ExploreMenu( const CommandContext &context, wxMenu * pMenu, int Id, int depth ){
627 static_cast<void>(Id);//compiler food.
628 if( !pMenu )
629 return;
630
631 auto &commandManager = CommandManager::Get( context.project );
632
633 wxMenuItemList list = pMenu->GetMenuItems();
634 size_t lcnt = list.size();
635 wxMenuItem * item;
636 wxString Label;
637 wxString Accel;
638 CommandID Name;
639
640 for (size_t lndx = 0; lndx < lcnt; lndx++) {
641 item = list.Item(lndx)->GetData();
642 Label = item->GetItemLabelText();
643 Name = commandManager.GetNameFromNumericID( item->GetId() );
644 Accel = item->GetItemLabel();
645 if( Accel.Contains("\t") )
646 Accel = Accel.AfterLast('\t');
647 else
648 Accel = "";
649 if( item->IsSeparator() )
650 Label = "----";
651 int flags = 0;
652 if (item->IsSubMenu())
653 flags +=1;
654 if (item->IsCheck() && item->IsChecked())
655 flags +=2;
656
657 context.StartStruct();
658 context.AddItem( depth, "depth" );
659 context.AddItem( flags, "flags" );
660 context.AddItem( Label, "label" );
661 context.AddItem( Accel, "accel" );
662 if( !Name.empty() )
663 // using GET to expose CommandID in results of GetInfoCommand...
664 // PRL asks, is that all right?
665 context.AddItem( Name.GET(), "id" );// It is called Scripting ID outside Audacity.
666 context.EndStruct();
667
668 if (item->IsSubMenu()) {
669 pMenu = item->GetSubMenu();
670 ExploreMenu( context, pMenu, item->GetId(), depth+1 );
671 }
672 }
673}
674
676 wxPoint WXUNUSED(P), wxWindow * pWin, int WXUNUSED(Id), int depth )
677{
678 // Dang! wxMenuBar returns bogus screen rect.
679 // We're going to have to fake it instead.
680 //wxMenuBar * pBar = context.GetProject()->GetMenuBar();
681 //wxRect R = pBar->GetScreenRect();
682 //R.SetPosition( R.GetPosition() - P );
683
684 wxRect R1 = pWin->GetScreenRect();
685 wxSize s = pWin->GetWindowBorderSize();
686 wxRect R( 2,32, R1.GetWidth() - s.GetWidth() * 2 -16, 22 );
687
688 context.StartStruct();
689 context.AddItem( depth, "depth" );
690 context.AddItem( "MenuBar", "label" );
691 context.StartField( "box" );
692 context.StartArray();
693 context.AddItem( R.GetLeft() );
694 context.AddItem( R.GetTop() );
695 context.AddItem( R.GetRight() );
696 context.AddItem( R.GetBottom() );
697 context.EndArray();
698 context.EndField();
699 context.EndStruct();
700}
701
703 wxPoint P, int depth )
704{
705 AudacityProject * pProj = &context.project;
706 auto &tp = TrackPanel::Get( *pProj );
707 wxRect panelRect{ {}, tp.GetSize() };
708 for ( auto t : TrackList::Get( *pProj ).Any() ) {
709 auto rulers = tp.FindRulerRects(t);
710 for (auto &R : rulers) {
711 if (!R.Intersects(panelRect))
712 continue;
713 R.SetPosition( R.GetPosition() + P );
714 context.StartStruct();
715 context.AddItem( depth, "depth" );
716 context.AddItem( "VRuler", "label" );
717 context.StartField("box");
718 context.StartArray();
719 context.AddItem( R.GetLeft() );
720 context.AddItem( R.GetTop() );
721 context.AddItem( R.GetRight() );
722 context.AddItem( R.GetBottom() );
723 context.EndArray();
724 context.EndField();
725 context.EndStruct();
726 }
727 }
728}
729
730
732 wxPoint P, wxWindow * pWin, int Id, int depth )
733{
734 static_cast<void>(Id);//Compiler food.
735
736 if( pWin->GetName() == "Track Panel" )
737 {
738 wxRect R = pWin->GetScreenRect();
739 ExploreTrackPanel( context, R.GetPosition()-P, depth );
740 return;
741 }
742 wxWindowList list = pWin->GetChildren();
743 size_t lcnt = list.size();
744
745 for (size_t lndx = 0; lndx < lcnt; lndx++) {
746 wxWindow * item = list[lndx];
747 if( !item->IsShown() )
748 continue;
749 wxRect R = item->GetScreenRect();
750 R.SetPosition( R.GetPosition() - P );
751 wxString Name = item->GetName();
752 // Ignore staticLine and StaticBitmap.
753 if( Name.StartsWith( "static" ) )
754 continue;
755 // Ignore anonymous panels.
756 if( Name == "panel" )
757 continue;
758 if( Name.empty() )
759 Name = wxString("*") + item->GetToolTipText();
760
761 context.StartStruct();
762 context.AddItem( depth, "depth" );
763 context.AddItem( Name, "label" );
764 context.AddItem( item->GetId(), "id" );
765 context.StartField( "box" );
766 context.StartArray();
767 context.AddItem( R.GetLeft() );
768 context.AddItem( R.GetTop() );
769 context.AddItem( R.GetRight() );
770 context.AddItem( R.GetBottom() );
771 context.EndArray();
772 context.EndField();
773 context.EndStruct();
774
775 ExploreWindows( context, P, item, item->GetId(), depth+1 );
776 }
777}
778
wxT("CloseDown"))
int min(int a, int b)
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.
#define XXO(s)
Definition: Internat.h:44
#define XO(s)
Definition: Internat.h:31
@ 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:42
TranslatableString label
Definition: TagsEditor.cpp:163
#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:46
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:89
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:90
size_t GetNumberOfPoints() const
Return number of points.
Definition: Envelope.cpp:689
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:89
const LabelArray & GetLabels() const
Definition: LabelTrack.h:148
LabelArray mLabels
Definition: LabelTrack.h:194
A Track that is used for Midi notes. (Somewhat old code).
Definition: NoteTrack.h:63
bool GetSolo() const
Definition: Track.h:924
bool GetMute() const
Definition: Track.h:923
PluginManager maintains a list of all plug ins. That covers modules, effects, generators,...
Definition: PluginManager.h:42
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 ...
Definition: Shuttle.h:115
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:628
Specialization of Setting for strings.
Definition: Prefs.h:363
A kind of Track used to 'warp time'.
Definition: TimeTrack.h:24
Track * Get()
Abstract base class for an object holding data associated with points on a time axis.
Definition: Track.h:225
auto Any() -> TrackIterRange< TrackType >
Definition: Track.h:1437
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:486
static auto Channels(TrackType *pTrack) -> TrackIterRange< TrackType >
Definition: Track.h:1541
static TrackPanel & Get(AudacityProject &project)
Definition: TrackPanel.cpp:230
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:57
double GetStartTime() const override
Get the time at which the first clip in the track starts.
Definition: WaveTrack.cpp:2005
WaveClipPointers SortedClipArray()
Definition: WaveTrack.cpp:2733
float GetPan() const
Definition: WaveTrack.cpp:514
double GetEndTime() const override
Get the time at which the last clip in the track ends, plus recorded stuff.
Definition: WaveTrack.cpp:2025
float GetGain() const
Definition: WaveTrack.cpp:496
void GetDisplayBounds(float *min, float *max) const
Definition: WaveTrack.cpp:340
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
BuiltinCommandsModule::Registration< GetInfoCommand > reg