Audacity 3.2.0
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 () const override
 
TranslatableString GetDescription () const override
 
template<bool Const>
bool VisitSettings (SettingsVisitorBase< Const > &S)
 
bool VisitSettings (SettingsVisitor &S) override
 
bool VisitSettings (ConstSettingsVisitor &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 () const override
 
VendorSymbol GetVendor () const override
 
wxString GetVersion () const override
 
ComponentInterfaceSymbol GetSymbol () const override=0
 
virtual TranslatableString GetDescription () const override
 
virtual ManualPageID ManualPage ()
 
virtual bool IsBatchProcessing () const
 
virtual void SetBatchProcessing (bool start)
 
virtual bool Apply (const CommandContext &WXUNUSED(context))
 
bool ShowInterface (wxWindow *parent, bool forceModal=false)
 
wxDialog * CreateUI (wxWindow *parent, AudacityCommand *client)
 
bool SaveSettingsAsString (wxString &parms)
 
bool LoadSettingsFromString (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 ()
 
virtual bool VisitSettings (SettingsVisitor &)
 
virtual bool VisitSettings (ConstSettingsVisitor &)
 
- Public Member Functions inherited from ComponentInterface
virtual ~ComponentInterface ()
 
virtual PluginPath GetPath () const =0
 
virtual ComponentInterfaceSymbol GetSymbol () const =0
 
virtual VendorSymbol GetVendor () const =0
 
virtual wxString GetVersion () const =0
 
virtual TranslatableString GetDescription () const =0
 
TranslatableString GetName () const
 

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 }
 
- Protected Attributes inherited from AudacityCommand
ProgressDialogmProgress
 
wxDialog * mUIDialog
 
wxWindow * mUIParent
 

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 135 of file GetInfoCommand.cpp.

136{
137 if( mFormat == kJson )
138 return ApplyInner( context );
139
140 if( mFormat == kLisp )
141 {
142 CommandContext LispyContext(
143 context.project,
144 std::make_unique<LispifiedCommandOutputTargets>( *context.pOutput.get() )
145 );
146 return ApplyInner( LispyContext );
147 }
148
149 if( mFormat == kBrief )
150 {
151 CommandContext BriefContext(
152 context.project,
153 std::make_unique<BriefCommandOutputTargets>( *context.pOutput.get() )
154 );
155 return ApplyInner( BriefContext );
156 }
157
158 return false;
159}
@ kBrief
@ kJson
@ kLisp
CommandContext provides additional information to an 'Apply()' command. It provides the project,...
AudacityProject & project
std::unique_ptr< CommandOutputTargets > pOutput
bool ApplyInner(const CommandContext &context)

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 161 of file GetInfoCommand.cpp.

162{
163 switch( mInfoType ){
164 // flag of 1 to include parameterless commands.
165 case kCommands : return SendCommands( context, 1 );
166 case kMenus : return SendMenus( context );
167 case kPreferences : return SendPreferences( context );
168 case kTracks : return SendTracks( context );
169 case kClips : return SendClips( context );
170 case kEnvelopes : return SendEnvelopes( context );
171 case kLabels : return SendLabels( context );
172 case kBoxes : return SendBoxes( context );
173 default:
174 context.Status( "Command options not recognised" );
175 }
176 return false;
177}
@ kClips
@ kTracks
@ kCommands
@ kEnvelopes
@ kMenus
@ kPreferences
@ kBoxes
@ kLabels
virtual void Status(const wxString &message, bool bFlush=false) const
bool SendClips(const CommandContext &context)
bool SendCommands(const CommandContext &context, int flags)
bool SendEnvelopes(const CommandContext &context)
bool SendLabels(const CommandContext &context)
bool SendTracks(const CommandContext &context)
bool SendBoxes(const CommandContext &context)
bool SendMenus(const CommandContext &context)
bool SendPreferences(const CommandContext &context)

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:

◆ ExploreAdornments()

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

Definition at line 678 of file GetInfoCommand.cpp.

680{
681 // Dang! wxMenuBar returns bogus screen rect.
682 // We're going to have to fake it instead.
683 //wxMenuBar * pBar = context.GetProject()->GetMenuBar();
684 //wxRect R = pBar->GetScreenRect();
685 //R.SetPosition( R.GetPosition() - P );
686
687 wxRect R1 = pWin->GetScreenRect();
688 wxSize s = pWin->GetWindowBorderSize();
689 wxRect R( 2,32, R1.GetWidth() - s.GetWidth() * 2 -16, 22 );
690
691 context.StartStruct();
692 context.AddItem( depth, "depth" );
693 context.AddItem( "MenuBar", "label" );
694 context.StartField( "box" );
695 context.StartArray();
696 context.AddItem( R.GetLeft() );
697 context.AddItem( R.GetTop() );
698 context.AddItem( R.GetRight() );
699 context.AddItem( R.GetBottom() );
700 context.EndArray();
701 context.EndField();
702 context.EndStruct();
703}
void EndField() const
void StartArray() const
void EndArray() const
void StartField(const wxString &name) const
void AddItem(const wxString &value, const wxString &name={}) const
void StartStruct() const
void EndStruct() const

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 629 of file GetInfoCommand.cpp.

629 {
630 static_cast<void>(Id);//compiler food.
631 if( !pMenu )
632 return;
633
634 auto &commandManager = CommandManager::Get( context.project );
635
636 wxMenuItemList list = pMenu->GetMenuItems();
637 size_t lcnt = list.size();
638 wxMenuItem * item;
639 wxString Label;
640 wxString Accel;
642
643 for (size_t lndx = 0; lndx < lcnt; lndx++) {
644 item = list.Item(lndx)->GetData();
645 Label = item->GetItemLabelText();
646 Name = commandManager.GetNameFromNumericID( item->GetId() );
647 Accel = item->GetItemLabel();
648 if( Accel.Contains("\t") )
649 Accel = Accel.AfterLast('\t');
650 else
651 Accel = "";
652 if( item->IsSeparator() )
653 Label = "----";
654 int flags = 0;
655 if (item->IsSubMenu())
656 flags +=1;
657 if (item->IsCheck() && item->IsChecked())
658 flags +=2;
659
660 context.StartStruct();
661 context.AddItem( depth, "depth" );
662 context.AddItem( flags, "flags" );
663 context.AddItem( Label, "label" );
664 context.AddItem( Accel, "accel" );
665 if( !Name.empty() )
666 // using GET to expose CommandID in results of GetInfoCommand...
667 // PRL asks, is that all right?
668 context.AddItem( Name.GET(), "id" );// It is called Scripting ID outside Audacity.
669 context.EndStruct();
670
671 if (item->IsSubMenu()) {
672 pMenu = item->GetSubMenu();
673 ExploreMenu( context, pMenu, item->GetId(), depth+1 );
674 }
675 }
676}
static CommandManager & Get(AudacityProject &project)
void ExploreMenu(const CommandContext &context, wxMenu *pMenu, int Id, int depth)

References CommandContext::AddItem(), CommandContext::EndStruct(), CommandManager::Get(), 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 705 of file GetInfoCommand.cpp.

707{
708 AudacityProject * pProj = &context.project;
709 auto &tp = TrackPanel::Get( *pProj );
710 wxRect panelRect{ {}, tp.GetSize() };
711 for ( auto t : TrackList::Get( *pProj ).Any() ) {
712 auto rulers = tp.FindRulerRects(t);
713 for (auto &R : rulers) {
714 if (!R.Intersects(panelRect))
715 continue;
716 R.SetPosition( R.GetPosition() + P );
717 context.StartStruct();
718 context.AddItem( depth, "depth" );
719 context.AddItem( "VRuler", "label" );
720 context.StartField("box");
721 context.StartArray();
722 context.AddItem( R.GetLeft() );
723 context.AddItem( R.GetTop() );
724 context.AddItem( R.GetRight() );
725 context.AddItem( R.GetBottom() );
726 context.EndArray();
727 context.EndField();
728 context.EndStruct();
729 }
730 }
731}
#define P(T)
Definition: ToChars.cpp:56
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
auto Any() -> TrackIterRange< TrackType >
Definition: Track.h:1437
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:486
static TrackPanel & Get(AudacityProject &project)
Definition: TrackPanel.cpp:230

References CommandContext::AddItem(), TrackList::Any(), CommandContext::EndArray(), CommandContext::EndField(), CommandContext::EndStruct(), TrackList::Get(), TrackPanel::Get(), P, 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 734 of file GetInfoCommand.cpp.

736{
737 static_cast<void>(Id);//Compiler food.
738
739 if( pWin->GetName() == "Track Panel" )
740 {
741 wxRect R = pWin->GetScreenRect();
742 ExploreTrackPanel( context, R.GetPosition()-P, depth );
743 return;
744 }
745 wxWindowList list = pWin->GetChildren();
746 size_t lcnt = list.size();
747
748 for (size_t lndx = 0; lndx < lcnt; lndx++) {
749 wxWindow * item = list[lndx];
750 if( !item->IsShown() )
751 continue;
752 wxRect R = item->GetScreenRect();
753 R.SetPosition( R.GetPosition() - P );
754 wxString Name = item->GetName();
755 // Ignore staticLine and StaticBitmap.
756 if( Name.StartsWith( "static" ) )
757 continue;
758 // Ignore anonymous panels.
759 if( Name == "panel" )
760 continue;
761 if( Name.empty() )
762 Name = wxString("*") + item->GetToolTipText();
763
764 context.StartStruct();
765 context.AddItem( depth, "depth" );
766 context.AddItem( Name, "label" );
767 context.AddItem( item->GetId(), "id" );
768 context.StartField( "box" );
769 context.StartArray();
770 context.AddItem( R.GetLeft() );
771 context.AddItem( R.GetTop() );
772 context.AddItem( R.GetRight() );
773 context.AddItem( R.GetBottom() );
774 context.EndArray();
775 context.EndField();
776 context.EndStruct();
777
778 ExploreWindows( context, P, item, item->GetId(), depth+1 );
779 }
780}
void ExploreWindows(const CommandContext &context, wxPoint P, wxWindow *pWin, int Id, int depth)
void ExploreTrackPanel(const CommandContext &context, wxPoint P, int depth)

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

Here is the call graph for this function:

◆ GetDescription()

TranslatableString GetInfoCommand::GetDescription ( ) const
inlineoverridevirtual

Reimplemented from AudacityCommand.

Definition at line 36 of file GetInfoCommand.h.

36{return XO("Gets information in JSON format.");};
XO("Cut/Copy/Paste")

References XO().

Here is the call graph for this function:

◆ GetSymbol()

ComponentInterfaceSymbol GetInfoCommand::GetSymbol ( ) const
inlineoverridevirtual

Implements AudacityCommand.

Definition at line 35 of file GetInfoCommand.h.

35{return Symbol;};
static const ComponentInterfaceSymbol Symbol

References Symbol.

◆ ManualPage()

ManualPageID GetInfoCommand::ManualPage ( )
inlineoverridevirtual

Reimplemented from AudacityCommand.

Definition at line 43 of file GetInfoCommand.h.

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

◆ PopulateOrExchange()

void GetInfoCommand::PopulateOrExchange ( ShuttleGui S)
override

Definition at line 121 of file GetInfoCommand.cpp.

122{
123 S.AddSpace(0, 5);
124
125 S.StartMultiColumn(2, wxALIGN_CENTER);
126 {
127 S.TieChoice( XXO("Type:"),
129 S.TieChoice( XXO("Format:"),
131 }
132 S.EndMultiColumn();
133}
XXO("&Cut/Copy/Paste Toolbar")
static const EnumValueSymbol kTypes[nTypes]
@ nFormats
static const EnumValueSymbol kFormats[nFormats]
@ nTypes
TranslatableStrings Msgids(const EnumValueSymbol strings[], size_t nStrings)
Convenience function often useful when adding choice controls.
#define S(N)
Definition: ToChars.cpp:64

References kFormats, kTypes, mFormat, mInfoType, Msgids(), nFormats, nTypes, S, and XXO().

Here is the call graph for this function:

◆ SendBoxes()

bool GetInfoCommand::SendBoxes ( const CommandContext context)
private

Definition at line 440 of file GetInfoCommand.cpp.

441{
442 //context.Status("Boxes");
443 auto pWin = &GetProjectFrame( context.project );
444
445 context.StartArray();
446 wxRect R = pWin->GetScreenRect();
447
448 //R.SetPosition( wxPoint(0,0) );
449
450 //wxString Name = pWin->GetName();
451 context.StartStruct();
452 context.AddItem( 0, "depth" );
453 context.AddItem( "Audacity Window", "name" );
454 context.StartField( "box" );
455 context.StartArray( );
456 context.AddItem( R.GetLeft() );
457 context.AddItem( R.GetTop() );
458 context.AddItem( R.GetRight() );
459 context.AddItem( R.GetBottom() );
460 context.EndArray( );
461 context.EndField();
462 context.EndStruct( );
463
464 ExploreAdornments( context, pWin->GetPosition()+wxSize( 6,-1), pWin, pWin->GetId(), 1 );
465 ExploreWindows( context, pWin->GetPosition()+wxSize( 6,-1), pWin, pWin->GetId(), 1 );
466 context.EndArray( );
467 return true;
468}
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 ...
void ExploreAdornments(const CommandContext &context, wxPoint P, wxWindow *pWin, int Id, int depth)

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 517 of file GetInfoCommand.cpp.

518{
519 auto &tracks = TrackList::Get( context.project );
520 int i=0;
521 context.StartArray();
522 for (auto t : tracks.Leaders()) {
523 t->TypeSwitch([&](WaveTrack *waveTrack) {
524 WaveClipPointers ptrs(waveTrack->SortedClipArray());
525 for (WaveClip * pClip : ptrs) {
526 context.StartStruct();
527 context.AddItem((double)i, "track");
528 context.AddItem(pClip->GetPlayStartTime(), "start");
529 context.AddItem(pClip->GetPlayEndTime(), "end");
530 context.AddItem(pClip->GetColourIndex(), "color");
531 context.EndStruct();
532 }
533 });
534 // Per track numbering counts all tracks
535 i++;
536 }
537 context.EndArray();
538
539 return true;
540}
std::vector< WaveClip * > WaveClipPointers
Definition: WaveTrack.h:46
This allows multiple clips to be a part of one WaveTrack.
Definition: WaveClip.h:101
A Track that contains audio waveform data.
Definition: WaveTrack.h:57
WaveClipPointers SortedClipArray()
Definition: WaveTrack.cpp:2720

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 422 of file GetInfoCommand.cpp.

423{
424 context.StartArray();
427 {
428 for (auto &plug
430 auto command = em.GetCommandIdentifier(plug.GetID());
431 if (!command.empty()){
432 em.GetCommandDefinition( plug.GetID(), context, flags );
433 }
434 }
435 }
436 context.EndArray();
437 return true;
438}
@ PluginTypeAudacityCommand
@ PluginTypeEffect
EffectManager is the class that handles effects and effect categories.
Definition: EffectManager.h:48
CommandID GetCommandIdentifier(const PluginID &ID)
void GetCommandDefinition(const PluginID &ID, const CommandContext &context, int flags)
static EffectManager & Get()
PluginManager maintains a list of all plug ins. That covers modules, effects, generators,...
Definition: PluginManager.h:42
Range PluginsOfType(int type)
static PluginManager & Get()

References CommandContext::EndArray(), PluginManager::Get(), EffectManager::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 542 of file GetInfoCommand.cpp.

543{
544 auto &tracks = TrackList::Get( context.project );
545 int i=0;
546 int j=0;
547 context.StartArray();
548 for (auto t : tracks.Leaders()) {
549 t->TypeSwitch([&](WaveTrack *waveTrack) {
550 WaveClipPointers ptrs(waveTrack->SortedClipArray());
551 j = 0;
552 for (WaveClip * pClip : ptrs) {
553 context.StartStruct();
554 context.AddItem((double)i, "track");
555 context.AddItem((double)j, "clip");
556 context.AddItem(pClip->GetPlayStartTime(), "start");
557 Envelope * pEnv = pClip->GetEnvelope();
558 context.StartField("points");
559 context.StartArray();
560 double offset = pEnv->GetOffset();
561 for (size_t k = 0; k < pEnv->GetNumberOfPoints(); k++)
562 {
563 context.StartStruct();
564 context.AddItem((*pEnv)[k].GetT() + offset, "t");
565 context.AddItem((*pEnv)[k].GetVal(), "y");
566 context.EndStruct();
567 }
568 context.EndArray();
569 context.EndField();
570 context.AddItem(pClip->GetPlayEndTime(), "end");
571 context.EndStruct();
572 j++;
573 }
574 });
575 // Per track numbering counts all tracks
576 i++;
577 }
578 context.EndArray();
579
580 return true;
581}
Piecewise linear or piecewise exponential function from double to double.
Definition: Envelope.h:72
double GetOffset() const
Definition: Envelope.h:92
size_t GetNumberOfPoints() const
Return number of points.
Definition: Envelope.cpp:694

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 584 of file GetInfoCommand.cpp.

585{
586 auto &tracks = TrackList::Get( context.project );
587 int i=0;
588 context.StartArray();
589 for (auto t : tracks.Leaders()) {
590 t->TypeSwitch( [&](LabelTrack *labelTrack) {
591#ifdef VERBOSE_LABELS_FORMATTING
592 for (int nn = 0; nn< (int)labelTrack->mLabels.size(); nn++) {
593 const auto &label = labelTrack->mLabels[nn];
594 context.StartStruct();
595 context.AddItem( (double)i, "track" );
596 context.AddItem( label.getT0(), "start" );
597 context.AddItem( label.getT1(), "end" );
598 context.AddItem( label.title, "text" );
599 context.EndStruct();
600 }
601#else
602 context.StartArray();
603 context.AddItem( (double)i ); // Track number.
604 context.StartArray();
605 for ( const auto &label : labelTrack->GetLabels() ) {
606 context.StartArray();
607 context.AddItem( label.getT0() ); // start
608 context.AddItem( label.getT1() ); // end
609 context.AddItem( label.title ); //text.
610 context.EndArray();
611 }
612 context.EndArray();
613 context.EndArray();
614#endif
615 } );
616 // Per track numbering counts all tracks
617 i++;
618 }
619 context.EndArray();
620
621 return true;
622}
TranslatableString label
Definition: TagsEditor.cpp:164
A LabelTrack is a Track that holds labels (LabelStruct).
Definition: LabelTrack.h:87
const LabelArray & GetLabels() const
Definition: LabelTrack.h:146
LabelArray mLabels
Definition: LabelTrack.h:192

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 179 of file GetInfoCommand.cpp.

180{
181 wxMenuBar * pBar = GetProjectFrame( context.project ).GetMenuBar();
182 if(!pBar ){
183 wxLogDebug("No menus");
184 return false;
185 }
186
187 size_t cnt = pBar->GetMenuCount();
188 size_t i;
189 wxString Label;
190 context.StartArray();
191 for(i=0;i<cnt;i++)
192 {
193 Label = pBar->GetMenuLabelText( i );
194 context.StartStruct();
195 context.AddItem( 0, "depth" );
196 context.AddItem( 0, "flags" );
197 context.AddItem( Label, "label" );
198 context.AddItem( "", "accel" );
199 context.EndStruct();
200 ExploreMenu( context, pBar->GetMenu( i ), pBar->GetId(), 1 );
201 }
202 context.EndArray();
203 return true;
204}

References CommandContext::AddItem(), CommandContext::EndArray(), CommandContext::EndStruct(), ExploreMenu(), GetProjectFrame(), 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 406 of file GetInfoCommand.cpp.

407{
408 context.StartArray();
409 auto pWin = &GetProjectFrame( context.project );
410 GlobalPrefsDialog dialog( pWin, &context.project );
411 // wxCommandEvent Evt;
412 //dialog.Show();
413 ShuttleGuiGetDefinition S(pWin, *((context.pOutput)->mStatusTarget) );
414 dialog.ShuttleAll( S );
415 context.EndArray();
416 return true;
417}

References CommandContext::EndArray(), GetProjectFrame(), CommandContext::pOutput, CommandContext::project, S, 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 470 of file GetInfoCommand.cpp.

471{
472 auto &tracks = TrackList::Get( context.project );
473 context.StartArray();
474 for (auto trk : tracks.Leaders())
475 {
476 auto &trackFocus = TrackFocus::Get( context.project );
477 Track * fTrack = trackFocus.Get();
478
479 context.StartStruct();
480 context.AddItem( trk->GetName(), "name" );
481 context.AddBool( (trk == fTrack), "focused");
482 context.AddBool( trk->GetSelected(), "selected" );
483 //JKC: Possibly add later...
484 //context.AddItem( TrackView::Get( *trk ).GetHeight(), "height" );
485 trk->TypeSwitch( [&] (const WaveTrack* t ) {
486 float vzmin, vzmax;
487 t->GetDisplayBounds(&vzmin, &vzmax);
488 context.AddItem( "wave", "kind" );
489 context.AddItem( t->GetStartTime(), "start" );
490 context.AddItem( t->GetEndTime(), "end" );
491 context.AddItem( t->GetPan() , "pan");
492 context.AddItem( t->GetGain() , "gain");
493 context.AddItem( TrackList::Channels(t).size(), "channels");
494 context.AddBool( t->GetSolo(), "solo" );
495 context.AddBool( t->GetMute(), "mute");
496 context.AddItem( vzmin, "VZoomMin");
497 context.AddItem( vzmax, "VZoomMax");
498 },
499#if defined(USE_MIDI)
500 [&](const NoteTrack *) {
501 context.AddItem( "note", "kind" );
502 },
503#endif
504 [&](const LabelTrack *) {
505 context.AddItem( "label", "kind" );
506 },
507 [&](const TimeTrack *) {
508 context.AddItem( "time", "kind" );
509 }
510 );
511 context.EndStruct();
512 }
513 context.EndArray();
514 return true;
515}
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
void AddBool(const bool value, const wxString &name={}) const
A Track that is used for Midi notes. (Somewhat old code).
Definition: NoteTrack.h:63
bool GetSolo() const
Definition: Track.h:924
bool GetMute() const
Definition: Track.h:923
A kind of Track used to 'warp time'.
Definition: TimeTrack.h:24
Track * Get()
Abstract base class for an object holding data associated with points on a time axis.
Definition: Track.h:225
static auto Channels(TrackType *pTrack) -> TrackIterRange< TrackType >
Definition: Track.h:1541
double GetStartTime() const override
Get the time at which the first clip in the track starts.
Definition: WaveTrack.cpp:1991
float GetPan() const
Definition: WaveTrack.cpp:510
double GetEndTime() const override
Get the time at which the last clip in the track ends, plus recorded stuff.
Definition: WaveTrack.cpp:2011
float GetGain() const
Definition: WaveTrack.cpp:492
void GetDisplayBounds(float *min, float *max) const
Definition: WaveTrack.cpp:336

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:

◆ VisitSettings() [1/3]

bool GetInfoCommand::VisitSettings ( ConstSettingsVisitor )
overridevirtual

Visit settings, if defined. false means no defined settings. Default implementation returns false

Reimplemented from AudacityCommand.

Definition at line 118 of file GetInfoCommand.cpp.

119 { return VisitSettings<true>(S); }

References S.

◆ VisitSettings() [2/3]

bool GetInfoCommand::VisitSettings ( SettingsVisitor )
overridevirtual

Visit settings, if defined. false means no defined settings. Default implementation returns false

Reimplemented from AudacityCommand.

Definition at line 115 of file GetInfoCommand.cpp.

116 { return VisitSettings<false>(S); }

References S.

◆ VisitSettings() [3/3]

template<bool Const>
bool GetInfoCommand::VisitSettings ( SettingsVisitorBase< Const > &  S)

Definition at line 109 of file GetInfoCommand.cpp.

109 {
110 S.DefineEnum( mInfoType, wxT("Type"), 0, kTypes, nTypes );
111 S.DefineEnum( mFormat, wxT("Format"), 0, kFormats, nFormats );
112 return true;
113}
wxT("CloseDown"))

References kFormats, kTypes, mFormat, mInfoType, nFormats, nTypes, S, and wxT().

Here is the call graph for this function:

Member Data Documentation

◆ mFormat

int GetInfoCommand::mFormat

Definition at line 49 of file GetInfoCommand.h.

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

◆ mInfoType

int GetInfoCommand::mInfoType

Definition at line 48 of file GetInfoCommand.h.

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

◆ 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: