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

137{
138 if( mFormat == kJson )
139 return ApplyInner( context );
140
141 if( mFormat == kLisp )
142 {
143 CommandContext LispyContext(
144 context.project,
145 std::make_unique<LispifiedCommandOutputTargets>( *context.pOutput.get() )
146 );
147 return ApplyInner( LispyContext );
148 }
149
150 if( mFormat == kBrief )
151 {
152 CommandContext BriefContext(
153 context.project,
154 std::make_unique<BriefCommandOutputTargets>( *context.pOutput.get() )
155 );
156 return ApplyInner( BriefContext );
157 }
158
159 return false;
160}
@ 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 162 of file GetInfoCommand.cpp.

163{
164 switch( mInfoType ){
165 // flag of 1 to include parameterless commands.
166 case kCommands : return SendCommands( context, 1 );
167 case kMenus : return SendMenus( context );
168 case kPreferences : return SendPreferences( context );
169 case kTracks : return SendTracks( context );
170 case kClips : return SendClips( context );
171 case kEnvelopes : return SendEnvelopes( context );
172 case kLabels : return SendLabels( context );
173 case kBoxes : return SendBoxes( context );
174 default:
175 context.Status( "Command options not recognised" );
176 }
177 return false;
178}
@ 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 682 of file GetInfoCommand.cpp.

684{
685 // Dang! wxMenuBar returns bogus screen rect.
686 // We're going to have to fake it instead.
687 //wxMenuBar * pBar = context.GetProject()->GetMenuBar();
688 //wxRect R = pBar->GetScreenRect();
689 //R.SetPosition( R.GetPosition() - P );
690
691 wxRect R1 = pWin->GetScreenRect();
692 wxSize s = pWin->GetWindowBorderSize();
693 wxRect R( 2,32, R1.GetWidth() - s.GetWidth() * 2 -16, 22 );
694
695 context.StartStruct();
696 context.AddItem( depth, "depth" );
697 context.AddItem( "MenuBar", "label" );
698 context.StartField( "box" );
699 context.StartArray();
700 context.AddItem( R.GetLeft() );
701 context.AddItem( R.GetTop() );
702 context.AddItem( R.GetRight() );
703 context.AddItem( R.GetBottom() );
704 context.EndArray();
705 context.EndField();
706 context.EndStruct();
707}
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 633 of file GetInfoCommand.cpp.

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

711{
712 AudacityProject * pProj = &context.project;
713 auto &tp = TrackPanel::Get( *pProj );
714 wxRect panelRect{ {}, tp.GetSize() };
715 for (auto pTrack : TrackList::Get(*pProj)) {
716 for (auto pChannel : pTrack->Channels()) {
717 auto rulers = tp.FindRulerRects(*pChannel);
718 for (auto &R : rulers) {
719 if (!R.Intersects(panelRect))
720 continue;
721 R.SetPosition( R.GetPosition() + P );
722 context.StartStruct();
723 context.AddItem( depth, "depth" );
724 context.AddItem( "VRuler", "label" );
725 context.StartField("box");
726 context.StartArray();
727 context.AddItem( R.GetLeft() );
728 context.AddItem( R.GetTop() );
729 context.AddItem( R.GetRight() );
730 context.AddItem( R.GetBottom() );
731 context.EndArray();
732 context.EndField();
733 context.EndStruct();
734 }
735 }
736 }
737}
#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
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:314
static TrackPanel & Get(AudacityProject &project)
Definition: TrackPanel.cpp:234

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

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

123{
124 S.AddSpace(0, 5);
125
126 S.StartMultiColumn(2, wxALIGN_CENTER);
127 {
128 S.TieChoice( XXO("Type:"),
130 S.TieChoice( XXO("Format:"),
132 }
133 S.EndMultiColumn();
134}
XXO("&Cut/Copy/Paste Toolbar")
static const EnumValueSymbol kTypes[nTypes]
static const EnumValueSymbol kFormats[nFormats]
@ 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 441 of file GetInfoCommand.cpp.

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

519{
520 auto &tracks = TrackList::Get( context.project );
521 int i=0;
522 context.StartArray();
523 for (auto t : tracks) {
524 t->TypeSwitch([&](WaveTrack &waveTrack) {
525 for (const auto pInterval : waveTrack.Intervals()) {
526 context.StartStruct();
527 context.AddItem((double)i, "track");
528 context.AddItem(pInterval->GetPlayStartTime(), "start");
529 context.AddItem(pInterval->GetPlayEndTime(), "end");
530 // Assuming same colors, look at only left channel
531 const auto &colors =
532 WaveColorAttachment::Get(**pInterval->Channels().begin());
533 context.AddItem(colors.GetColorIndex(), "color");
534 context.AddItem(pInterval->GetName(), "name");
535 context.EndStruct();
536 }
537 });
538 // Per track numbering counts all tracks
539 i++;
540 }
541 context.EndArray();
542
543 return true;
544}
const auto tracks
A Track that contains audio waveform data.
Definition: WaveTrack.h:203
auto Intervals()
Definition: WaveTrack.h:670

References CommandContext::EndArray(), TrackList::Get(), WaveTrack::Intervals(), CommandContext::project, CommandContext::StartArray(), and tracks.

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

424{
425 context.StartArray();
428 {
429 for (auto &plug
431 auto command = em.GetCommandIdentifier(plug.GetID());
432 if (!command.empty()){
433 em.GetCommandDefinition( plug.GetID(), context, flags );
434 }
435 }
436 }
437 context.EndArray();
438 return true;
439}
@ 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:51
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 546 of file GetInfoCommand.cpp.

547{
548 auto &tracks = TrackList::Get( context.project );
549 int i=0;
550 int j=0;
551 context.StartArray();
552 for (auto t : tracks) {
553 t->TypeSwitch([&](WaveTrack &waveTrack) {
554 auto ptrs = waveTrack.SortedIntervalArray();
555 j = 0;
556 for (auto &pClip : ptrs) {
557 context.StartStruct();
558 context.AddItem((double)i, "track");
559 context.AddItem((double)j, "clip");
560 context.AddItem(pClip->GetPlayStartTime(), "start");
561 const auto pEnv = &pClip->GetEnvelope();
562 context.StartField("points");
563 context.StartArray();
564 double offset = pEnv->GetOffset();
565 for (size_t k = 0; k < pEnv->GetNumberOfPoints(); k++)
566 {
567 context.StartStruct();
568 context.AddItem((*pEnv)[k].GetT() + offset, "t");
569 context.AddItem((*pEnv)[k].GetVal(), "y");
570 context.EndStruct();
571 }
572 context.EndArray();
573 context.EndField();
574 context.AddItem(pClip->GetPlayEndTime(), "end");
575 context.EndStruct();
576 j++;
577 }
578 });
579 // Per track numbering counts all tracks
580 i++;
581 }
582 context.EndArray();
583
584 return true;
585}
for(int ii=0, nn=names.size();ii< nn;++ii)
IntervalHolders SortedIntervalArray()
Return all WaveClips sorted by clip play start time.
Definition: WaveTrack.cpp:3270

References CommandContext::AddItem(), CommandContext::EndArray(), CommandContext::EndField(), CommandContext::EndStruct(), for(), TrackList::Get(), CommandContext::project, WaveTrack::SortedIntervalArray(), CommandContext::StartArray(), CommandContext::StartField(), CommandContext::StartStruct(), and tracks.

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

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

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

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

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

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

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

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

472{
473 auto &tracks = TrackList::Get( context.project );
474 context.StartArray();
475 for (auto trk : tracks)
476 {
477 auto &trackFocus = TrackFocus::Get( context.project );
478 Track * fTrack = trackFocus.Get();
479
480 context.StartStruct();
481 context.AddItem( trk->GetName(), "name" );
482 context.AddBool( (trk == fTrack), "focused");
483 context.AddBool( trk->GetSelected(), "selected" );
484 //JKC: Possibly add later...
485 //context.AddItem(ChannelView::GetChannelGroupHeight(*trk), "height");
486 trk->TypeSwitch( [&] (const WaveTrack &t) {
487 float vzmin, vzmax;
488 WaveformScale::Get(t).GetDisplayBounds(vzmin, vzmax);
489 context.AddItem( "wave", "kind" );
490 context.AddItem( t.GetStartTime(), "start" );
491 context.AddItem( t.GetEndTime(), "end" );
492 context.AddItem( t.GetPan() , "pan");
493 context.AddItem( t.GetGain() , "gain");
494 context.AddItem( t.NChannels(), "channels");
495 context.AddBool( t.GetSolo(), "solo" );
496 context.AddBool( t.GetMute(), "mute");
497 context.AddItem( vzmin, "VZoomMin");
498 context.AddItem( vzmax, "VZoomMax");
499 },
500#if defined(USE_MIDI)
501 [&](const NoteTrack &) {
502 context.AddItem( "note", "kind" );
503 },
504#endif
505 [&](const LabelTrack &) {
506 context.AddItem( "label", "kind" );
507 },
508 [&](const TimeTrack &) {
509 context.AddItem( "time", "kind" );
510 }
511 );
512 context.EndStruct();
513 }
514 context.EndArray();
515 return true;
516}
Subclass & Get(const RegisteredFactory &key)
Get reference to an attachment, creating on demand if not present, down-cast it to Subclass.
Definition: ClientData.h:318
void AddBool(const bool value, const wxString &name={}) const
A Track that is used for Midi notes. (Somewhat old code).
Definition: NoteTrack.h:78
A kind of Track used to 'warp time'.
Definition: TimeTrack.h:24
Track * Get()
Definition: TrackFocus.cpp:156
Abstract base class for an object holding data associated with points on a time axis.
Definition: Track.h:110
bool GetMute() const override
May vary asynchronously.
Definition: WaveTrack.cpp:2318
double GetStartTime() const override
Implement WideSampleSequence.
Definition: WaveTrack.cpp:2576
float GetPan() const
Definition: WaveTrack.cpp:837
double GetEndTime() const override
Implement WideSampleSequence.
Definition: WaveTrack.cpp:2586
float GetGain() const
Definition: WaveTrack.cpp:819
bool GetSolo() const override
May vary asynchronously.
Definition: WaveTrack.cpp:2323
size_t NChannels() const override
A constant property.
Definition: WaveTrack.cpp:532
void GetDisplayBounds(float &min, float &max) const
static WaveformScale & Get(const WaveTrack &track)
Mutative access to attachment even if the track argument is const.

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

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

120 { 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 116 of file GetInfoCommand.cpp.

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

References S.

◆ VisitSettings() [3/3]

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

Definition at line 110 of file GetInfoCommand.cpp.

110 {
111 S.DefineEnum( mInfoType, wxT("Type"), 0, kTypes, nTypes );
112 S.DefineEnum( mFormat, wxT("Format"), 0, kFormats, nFormats );
113 return true;
114}
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: