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