Audacity  3.0.3
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | List of all members
GetInfoCommand Class Reference

Command which outputs a list of available menu commands on the status channel. More...

#include <GetInfoCommand.h>

Inheritance diagram for GetInfoCommand:
[legend]
Collaboration diagram for GetInfoCommand:
[legend]

Public Member Functions

ComponentInterfaceSymbol GetSymbol () override
 
TranslatableString GetDescription () override
 
bool DefineParams (ShuttleParams &S) override
 
void PopulateOrExchange (ShuttleGui &S) override
 
ManualPageID ManualPage () override
 
bool Apply (const CommandContext &context) override
 
bool ApplyInner (const CommandContext &context)
 
- Public Member Functions inherited from AudacityCommand
 AudacityCommand ()
 
virtual ~AudacityCommand ()
 
PluginPath GetPath () override
 
VendorSymbol GetVendor () override
 
wxString GetVersion () override
 
virtual bool IsBatchProcessing ()
 
virtual void SetBatchProcessing (bool start)
 
virtual bool Apply (const CommandContext &WXUNUSED(context))
 
bool ShowInterface (wxWindow *parent, bool forceModal=false)
 
virtual void SetHostUI (EffectUIHostInterface *WXUNUSED(host))
 
wxDialog * CreateUI (wxWindow *parent, AudacityCommand *client)
 
virtual bool GetAutomationParameters (wxString &parms)
 
virtual bool SetAutomationParameters (const wxString &parms)
 
bool DoAudacityCommand (wxWindow *parent, const CommandContext &context, bool shouldPrompt=true)
 
int MessageBox (const TranslatableString &message, long style=DefaultMessageBoxStyle, const TranslatableString &titleStr={})
 
virtual bool Init ()
 
virtual bool PromptUser (wxWindow *parent)
 
virtual bool CheckWhetherSkipAudacityCommand ()
 
virtual void End ()
 
virtual void PopulateOrExchange (ShuttleGui &WXUNUSED(S))
 
virtual bool TransferDataToWindow ()
 
virtual bool TransferDataFromWindow ()
 
- Public Member Functions inherited from ComponentInterface
virtual ~ComponentInterface ()
 
TranslatableString GetName ()
 
virtual bool DefineParams (ShuttleParams &WXUNUSED(S))
 

Public Attributes

int mInfoType
 
int mFormat
 

Static Public Attributes

static const ComponentInterfaceSymbol Symbol { XO("Get Info") }
 

Private Member Functions

bool SendCommands (const CommandContext &context, int flags)
 
bool SendMenus (const CommandContext &context)
 
bool SendPreferences (const CommandContext &context)
 
bool SendTracks (const CommandContext &context)
 
bool SendLabels (const CommandContext &context)
 
bool SendClips (const CommandContext &context)
 
bool SendEnvelopes (const CommandContext &context)
 
bool SendBoxes (const CommandContext &context)
 
void ExploreMenu (const CommandContext &context, wxMenu *pMenu, int Id, int depth)
 
void ExploreTrackPanel (const CommandContext &context, wxPoint P, int depth)
 
void ExploreAdornments (const CommandContext &context, wxPoint P, wxWindow *pWin, int Id, int depth)
 
void ExploreWindows (const CommandContext &context, wxPoint P, wxWindow *pWin, int Id, int depth)
 

Additional Inherited Members

- Public Types inherited from AudacityCommand
enum  : long { DefaultMessageBoxStyle = wxOK | wxCENTRE }
 
using VetoDialogHook = bool(*)(wxDialog *)
 
- Static Public Member Functions inherited from AudacityCommand
static VetoDialogHook SetVetoDialogHook (VetoDialogHook hook)
 
- Protected Attributes inherited from AudacityCommand
ProgressDialogmProgress
 
wxDialog * mUIDialog
 
wxWindow * mUIParent
 
int mUIResultID
 

Detailed Description

Command which outputs a list of available menu commands on the status channel.

Definition at line 29 of file GetInfoCommand.h.

Member Function Documentation

◆ Apply()

bool GetInfoCommand::Apply ( const CommandContext context)
override

Definition at line 125 of file GetInfoCommand.cpp.

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 }

References ApplyInner(), kBrief, kJson, kLisp, mFormat, CommandContext::pOutput, and CommandContext::project.

Here is the call graph for this function:

◆ ApplyInner()

bool GetInfoCommand::ApplyInner ( const CommandContext context)

Definition at line 151 of file GetInfoCommand.cpp.

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 }

References kBoxes, kClips, kCommands, kEnvelopes, kLabels, kMenus, kPreferences, kTracks, mInfoType, SendBoxes(), SendClips(), SendCommands(), SendEnvelopes(), SendLabels(), SendMenus(), SendPreferences(), SendTracks(), and CommandContext::Status().

Referenced by Apply().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DefineParams()

bool GetInfoCommand::DefineParams ( ShuttleParams S)
override

Definition at line 105 of file GetInfoCommand.cpp.

105  {
106  S.DefineEnum( mInfoType, wxT("Type"), 0, kTypes, nTypes );
107  S.DefineEnum( mFormat, wxT("Format"), 0, kFormats, nFormats );
108  return true;
109 }

References ShuttleParams::DefineEnum(), kFormats, mFormat, mInfoType, nFormats, and nTypes.

Here is the call graph for this function:

◆ ExploreAdornments()

void GetInfoCommand::ExploreAdornments ( const CommandContext context,
wxPoint  P,
wxWindow *  pWin,
int  Id,
int  depth 
)
private

Definition at line 671 of file GetInfoCommand.cpp.

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 }

References CommandContext::AddItem(), CommandContext::EndArray(), CommandContext::EndField(), CommandContext::EndStruct(), CommandContext::StartArray(), CommandContext::StartField(), and CommandContext::StartStruct().

Here is the call graph for this function:

◆ ExploreMenu()

void GetInfoCommand::ExploreMenu ( const CommandContext context,
wxMenu *  pMenu,
int  Id,
int  depth 
)
private

Definition at line 622 of file GetInfoCommand.cpp.

622  {
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 }

References CommandContext::AddItem(), Identifier::empty(), CommandContext::EndStruct(), Identifier::GET(), CommandManager::Get(), Label, CommandContext::project, and CommandContext::StartStruct().

Referenced by SendMenus().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ExploreTrackPanel()

void GetInfoCommand::ExploreTrackPanel ( const CommandContext context,
wxPoint  P,
int  depth 
)
private

Definition at line 698 of file GetInfoCommand.cpp.

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 }

References CommandContext::AddItem(), TrackList::Any(), CommandContext::EndArray(), CommandContext::EndField(), CommandContext::EndStruct(), TrackList::Get(), TrackPanel::Get(), CommandContext::project, CommandContext::StartArray(), CommandContext::StartField(), and CommandContext::StartStruct().

Here is the call graph for this function:

◆ ExploreWindows()

void GetInfoCommand::ExploreWindows ( const CommandContext context,
wxPoint  P,
wxWindow *  pWin,
int  Id,
int  depth 
)
private

Definition at line 727 of file GetInfoCommand.cpp.

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 }

References CommandContext::AddItem(), CommandContext::EndArray(), CommandContext::EndField(), CommandContext::EndStruct(), CommandContext::StartArray(), CommandContext::StartField(), and CommandContext::StartStruct().

Here is the call graph for this function:

◆ GetDescription()

TranslatableString GetInfoCommand::GetDescription ( )
inlineoverridevirtual

Reimplemented from AudacityCommand.

Definition at line 36 of file GetInfoCommand.h.

36 {return XO("Gets information in JSON format.");};

References XO.

◆ GetSymbol()

ComponentInterfaceSymbol GetInfoCommand::GetSymbol ( )
inlineoverridevirtual

Implements AudacityCommand.

Definition at line 35 of file GetInfoCommand.h.

35 {return Symbol;};

References Symbol.

◆ ManualPage()

ManualPageID GetInfoCommand::ManualPage ( )
inlineoverridevirtual

Reimplemented from AudacityCommand.

Definition at line 41 of file GetInfoCommand.h.

41 {return L"Extra_Menu:_Scriptables_II#get_info";}

◆ PopulateOrExchange()

void GetInfoCommand::PopulateOrExchange ( ShuttleGui S)
override

Definition at line 111 of file GetInfoCommand.cpp.

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 }

References ShuttleGui::AddSpace(), ShuttleGuiBase::EndMultiColumn(), kFormats, mFormat, mInfoType, Msgids(), nFormats, nTypes, ShuttleGuiBase::StartMultiColumn(), ShuttleGuiBase::TieChoice(), and XXO.

Here is the call graph for this function:

◆ SendBoxes()

bool GetInfoCommand::SendBoxes ( const CommandContext context)
private

Definition at line 433 of file GetInfoCommand.cpp.

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 }

References CommandContext::AddItem(), CommandContext::EndArray(), CommandContext::EndField(), CommandContext::EndStruct(), GetProjectFrame(), CommandContext::project, CommandContext::StartArray(), CommandContext::StartField(), and CommandContext::StartStruct().

Referenced by ApplyInner().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SendClips()

bool GetInfoCommand::SendClips ( const CommandContext context)
private

Definition at line 510 of file GetInfoCommand.cpp.

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->GetStartTime(), "start");
522  context.AddItem(pClip->GetEndTime(), "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 }

References CommandContext::AddItem(), CommandContext::EndArray(), CommandContext::EndStruct(), TrackList::Get(), CommandContext::project, WaveTrack::SortedClipArray(), CommandContext::StartArray(), and CommandContext::StartStruct().

Referenced by ApplyInner().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SendCommands()

bool GetInfoCommand::SendCommands ( const CommandContext context,
int  flags 
)
private

Send the list of commands.

Definition at line 415 of file GetInfoCommand.cpp.

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 }

References CommandContext::EndArray(), EffectManager::Get(), PluginManager::Get(), EffectManager::GetCommandDefinition(), EffectManager::GetCommandIdentifier(), PluginManager::PluginsOfType(), PluginTypeAudacityCommand, PluginTypeEffect, and CommandContext::StartArray().

Referenced by ApplyInner().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SendEnvelopes()

bool GetInfoCommand::SendEnvelopes ( const CommandContext context)
private

Definition at line 535 of file GetInfoCommand.cpp.

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->GetStartTime(), "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->GetEndTime(), "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 }

References CommandContext::AddItem(), CommandContext::EndArray(), CommandContext::EndField(), CommandContext::EndStruct(), TrackList::Get(), Envelope::GetNumberOfPoints(), Envelope::GetOffset(), CommandContext::project, WaveTrack::SortedClipArray(), CommandContext::StartArray(), CommandContext::StartField(), and CommandContext::StartStruct().

Referenced by ApplyInner().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SendLabels()

bool GetInfoCommand::SendLabels ( const CommandContext context)
private

Definition at line 577 of file GetInfoCommand.cpp.

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 }

References CommandContext::AddItem(), CommandContext::EndArray(), CommandContext::EndStruct(), TrackList::Get(), LabelTrack::GetLabels(), label, LabelTrack::mLabels, CommandContext::project, CommandContext::StartArray(), and CommandContext::StartStruct().

Referenced by ApplyInner().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SendMenus()

bool GetInfoCommand::SendMenus ( const CommandContext context)
private

Definition at line 169 of file GetInfoCommand.cpp.

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 }

References CommandContext::AddItem(), CommandContext::EndArray(), CommandContext::EndStruct(), ExploreMenu(), GetProjectFrame(), Label, CommandContext::project, CommandContext::StartArray(), and CommandContext::StartStruct().

Referenced by ApplyInner().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SendPreferences()

bool GetInfoCommand::SendPreferences ( const CommandContext context)
private

Definition at line 399 of file GetInfoCommand.cpp.

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 }

References CommandContext::EndArray(), GetProjectFrame(), CommandContext::pOutput, CommandContext::project, PrefsDialog::ShuttleAll(), and CommandContext::StartArray().

Referenced by ApplyInner().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SendTracks()

bool GetInfoCommand::SendTracks ( const CommandContext context)
private

Definition at line 463 of file GetInfoCommand.cpp.

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 }

References CommandContext::AddBool(), CommandContext::AddItem(), TrackList::Channels(), CommandContext::EndArray(), CommandContext::EndStruct(), TrackFocus::Get(), TrackList::Get(), ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::Get(), WaveTrack::GetDisplayBounds(), WaveTrack::GetEndTime(), WaveTrack::GetGain(), PlayableTrack::GetMute(), WaveTrack::GetPan(), PlayableTrack::GetSolo(), WaveTrack::GetStartTime(), CommandContext::project, CommandContext::StartArray(), and CommandContext::StartStruct().

Referenced by ApplyInner().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ mFormat

int GetInfoCommand::mFormat

Definition at line 47 of file GetInfoCommand.h.

Referenced by Apply(), DefineParams(), and PopulateOrExchange().

◆ mInfoType

int GetInfoCommand::mInfoType

Definition at line 46 of file GetInfoCommand.h.

Referenced by ApplyInner(), DefineParams(), and PopulateOrExchange().

◆ Symbol

const ComponentInterfaceSymbol GetInfoCommand::Symbol { XO("Get Info") }
static

Definition at line 32 of file GetInfoCommand.h.

Referenced by GetSymbol().


The documentation for this class was generated from the following files:
GetInfoCommand::SendClips
bool SendClips(const CommandContext &context)
Definition: GetInfoCommand.cpp:510
kLisp
@ kLisp
Definition: GetInfoCommand.cpp:87
kMenus
@ kMenus
Definition: GetInfoCommand.cpp:62
PluginTypeEffect
@ PluginTypeEffect
Definition: PluginManager.h:35
WaveTrack
A Track that contains audio waveform data.
Definition: WaveTrack.h:69
PlayableTrack::GetSolo
bool GetSolo() const
Definition: Track.h:861
PlayableTrack::GetMute
bool GetMute() const
Definition: Track.h:860
GetInfoCommand::Symbol
static const ComponentInterfaceSymbol Symbol
Definition: GetInfoCommand.h:32
WaveTrack::GetEndTime
double GetEndTime() const override
Get the time at which the last clip in the track ends, plus recorded stuff.
Definition: WaveTrack.cpp:1895
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
kJson
@ kJson
Definition: GetInfoCommand.cpp:86
TrackList::Channels
static auto Channels(TrackType *pTrack) -> TrackIterRange< TrackType >
Definition: Track.h:1484
CommandContext::EndArray
void EndArray() const
Definition: CommandContext.cpp:94
Envelope
Piecewise linear or piecewise exponential function from double to double.
Definition: Envelope.h:71
CommandContext::EndField
void EndField() const
Definition: CommandContext.cpp:114
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
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
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
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
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
GetInfoCommand::ExploreMenu
void ExploreMenu(const CommandContext &context, wxMenu *pMenu, int Id, int depth)
Definition: GetInfoCommand.cpp:622
kBoxes
@ kBoxes
Definition: GetInfoCommand.cpp:68
WaveTrack::SortedClipArray
WaveClipPointers SortedClipArray()
Definition: WaveTrack.cpp:2606
Envelope::GetOffset
double GetOffset() const
Definition: Envelope.h:98
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:173
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
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
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
TrackFocus::Get
Track * Get()
Definition: TrackPanelAx.cpp:755
PluginTypeAudacityCommand
@ PluginTypeAudacityCommand
Definition: PluginManager.h:36
WaveTrack::GetGain
float GetGain() const
Definition: WaveTrack.cpp:469
WaveTrack::GetStartTime
double GetStartTime() const override
Get the time at which the first clip in the track starts.
Definition: WaveTrack.cpp:1875
Msgids
TranslatableStrings Msgids(const EnumValueSymbol strings[], size_t nStrings)
Convenience function often useful when adding choice controls.
Definition: ShuttleGui.cpp:2522
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
PluginManager::Get
static PluginManager & Get()
Definition: PluginManager.cpp:695
CommandContext::StartField
void StartField(const wxString &name) const
Definition: CommandContext.cpp:109
GetInfoCommand::mFormat
int mFormat
Definition: GetInfoCommand.h:47
TrackList::Get
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:506
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
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
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
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
GetInfoCommand::SendLabels
bool SendLabels(const CommandContext &context)
Definition: GetInfoCommand.cpp:577
CommandContext::StartStruct
void StartStruct() const
Definition: CommandContext.cpp:99
TrackList::Any
auto Any() -> TrackIterRange< TrackType >
Definition: Track.h:1371
WaveTrack::GetPan
float GetPan() const
Definition: WaveTrack.cpp:482
kFormats
static const EnumValueSymbol kFormats[nFormats]
Definition: GetInfoCommand.cpp:92
WaveTrack::GetDisplayBounds
void GetDisplayBounds(float *min, float *max) const
Definition: WaveTrack.cpp:315
CommandManager::Get
static CommandManager & Get(AudacityProject &project)
Definition: CommandManager.cpp:207
kTypes
kTypes
Definition: Noise.cpp:34
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
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:66
GetInfoCommand::SendMenus
bool SendMenus(const CommandContext &context)
Definition: GetInfoCommand.cpp:169
CommandContext::pOutput
std::unique_ptr< CommandOutputTargets > pOutput
Definition: CommandContext.h:65