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