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)
 
bool SendSelection (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 141 of file GetInfoCommand.cpp.

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

168{
169 switch( mInfoType ){
170 // flag of 1 to include parameterless commands.
171 case kCommands : return SendCommands( context, 1 );
172 case kMenus : return SendMenus( context );
173 case kPreferences : return SendPreferences( context );
174 case kTracks : return SendTracks( context );
175 case kClips : return SendClips( context );
176 case kEnvelopes : return SendEnvelopes( context );
177 case kLabels : return SendLabels( context );
178 case kBoxes : return SendBoxes( context );
179 case kSelection : return SendSelection( context );
180 default:
181 context.Status( "Command options not recognised" );
182 }
183 return false;
184}
@ kSelection
@ 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)
bool SendSelection(const CommandContext &context)

References kBoxes, kClips, kCommands, kEnvelopes, kLabels, kMenus, kPreferences, kSelection, kTracks, mInfoType, SendBoxes(), SendClips(), SendCommands(), SendEnvelopes(), SendLabels(), SendMenus(), SendPreferences(), SendSelection(), 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 702 of file GetInfoCommand.cpp.

704{
705 // Dang! wxMenuBar returns bogus screen rect.
706 // We're going to have to fake it instead.
707 //wxMenuBar * pBar = context.GetProject()->GetMenuBar();
708 //wxRect R = pBar->GetScreenRect();
709 //R.SetPosition( R.GetPosition() - P );
710
711 wxRect R1 = pWin->GetScreenRect();
712 wxSize s = pWin->GetWindowBorderSize();
713 wxRect R( 2,32, R1.GetWidth() - s.GetWidth() * 2 -16, 22 );
714
715 context.StartStruct();
716 context.AddItem( depth, "depth" );
717 context.AddItem( "MenuBar", "label" );
718 context.StartField( "box" );
719 context.StartArray();
720 context.AddItem( R.GetLeft() );
721 context.AddItem( R.GetTop() );
722 context.AddItem( R.GetRight() );
723 context.AddItem( R.GetBottom() );
724 context.EndArray();
725 context.EndField();
726 context.EndStruct();
727}
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 653 of file GetInfoCommand.cpp.

653 {
654 static_cast<void>(Id);//compiler food.
655 if( !pMenu )
656 return;
657
658 auto &commandManager = CommandManager::Get( context.project );
659
660 wxMenuItemList list = pMenu->GetMenuItems();
661 size_t lcnt = list.size();
662 wxMenuItem * item;
663 wxString Label;
664 wxString Accel;
666
667 for (size_t lndx = 0; lndx < lcnt; lndx++) {
668 item = list.Item(lndx)->GetData();
669 Label = item->GetItemLabelText();
670 Name = commandManager.GetNameFromNumericID( item->GetId() );
671 Accel = item->GetItemLabel();
672 if( Accel.Contains("\t") )
673 Accel = Accel.AfterLast('\t');
674 else
675 Accel = "";
676 if( item->IsSeparator() )
677 Label = "----";
678 int flags = 0;
679 if (item->IsSubMenu())
680 flags +=1;
681 if (item->IsCheck() && item->IsChecked())
682 flags +=2;
683
684 context.StartStruct();
685 context.AddItem( depth, "depth" );
686 context.AddItem( flags, "flags" );
687 context.AddItem( Label, "label" );
688 context.AddItem( Accel, "accel" );
689 if( !Name.empty() )
690 // using GET to expose CommandID in results of GetInfoCommand...
691 // PRL asks, is that all right?
692 context.AddItem( Name.GET(), "id" );// It is called Scripting ID outside Audacity.
693 context.EndStruct();
694
695 if (item->IsSubMenu()) {
696 pMenu = item->GetSubMenu();
697 ExploreMenu( context, pMenu, item->GetId(), depth+1 );
698 }
699 }
700}
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 729 of file GetInfoCommand.cpp.

731{
732 AudacityProject * pProj = &context.project;
733 auto &tp = TrackPanel::Get( *pProj );
734 wxRect panelRect{ {}, tp.GetSize() };
735 for (auto pTrack : TrackList::Get(*pProj)) {
736 for (auto pChannel : pTrack->Channels()) {
737 auto rulers = tp.FindRulerRects(*pChannel);
738 for (auto &R : rulers) {
739 if (!R.Intersects(panelRect))
740 continue;
741 R.SetPosition( R.GetPosition() + P );
742 context.StartStruct();
743 context.AddItem( depth, "depth" );
744 context.AddItem( "VRuler", "label" );
745 context.StartField("box");
746 context.StartArray();
747 context.AddItem( R.GetLeft() );
748 context.AddItem( R.GetTop() );
749 context.AddItem( R.GetRight() );
750 context.AddItem( R.GetBottom() );
751 context.EndArray();
752 context.EndField();
753 context.EndStruct();
754 }
755 }
756 }
757}
#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 760 of file GetInfoCommand.cpp.

762{
763 static_cast<void>(Id);//Compiler food.
764
765 if( pWin->GetName() == "Track Panel" )
766 {
767 wxRect R = pWin->GetScreenRect();
768 ExploreTrackPanel( context, R.GetPosition()-P, depth );
769 return;
770 }
771 wxWindowList list = pWin->GetChildren();
772 size_t lcnt = list.size();
773
774 for (size_t lndx = 0; lndx < lcnt; lndx++) {
775 wxWindow * item = list[lndx];
776 if( !item->IsShown() )
777 continue;
778 wxRect R = item->GetScreenRect();
779 R.SetPosition( R.GetPosition() - P );
780 wxString Name = item->GetName();
781 // Ignore staticLine and StaticBitmap.
782 if( Name.StartsWith( "static" ) )
783 continue;
784 // Ignore anonymous panels.
785 if( Name == "panel" )
786 continue;
787 if( Name.empty() )
788 Name = wxString("*") + item->GetToolTipText();
789
790 context.StartStruct();
791 context.AddItem( depth, "depth" );
792 context.AddItem( Name, "label" );
793 context.AddItem( item->GetId(), "id" );
794 context.StartField( "box" );
795 context.StartArray();
796 context.AddItem( R.GetLeft() );
797 context.AddItem( R.GetTop() );
798 context.AddItem( R.GetRight() );
799 context.AddItem( R.GetBottom() );
800 context.EndArray();
801 context.EndField();
802 context.EndStruct();
803
804 ExploreWindows( context, P, item, item->GetId(), depth+1 );
805 }
806}
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 127 of file GetInfoCommand.cpp.

128{
129 S.AddSpace(0, 5);
130
131 S.StartMultiColumn(2, wxALIGN_CENTER);
132 {
133 S.TieChoice( XXO("Type:"),
135 S.TieChoice( XXO("Format:"),
137 }
138 S.EndMultiColumn();
139}
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 447 of file GetInfoCommand.cpp.

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

525{
526 auto &tracks = TrackList::Get( context.project );
527 int i=0;
528 context.StartArray();
529 for (auto t : tracks) {
530 t->TypeSwitch([&](WaveTrack &waveTrack) {
531 for (const auto pInterval : waveTrack.Intervals()) {
532 context.StartStruct();
533 context.AddItem((double)i, "track");
534 context.AddItem(pInterval->GetPlayStartTime(), "start");
535 context.AddItem(pInterval->GetPlayEndTime(), "end");
536 // Assuming same colors, look at only left channel
537 const auto &colors =
538 WaveColorAttachment::Get(**pInterval->Channels().begin());
539 context.AddItem(colors.GetColorIndex(), "color");
540 context.AddItem(pInterval->GetName(), "name");
541 context.EndStruct();
542 }
543 });
544 // Per track numbering counts all tracks
545 i++;
546 }
547 context.EndArray();
548
549 return true;
550}
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 429 of file GetInfoCommand.cpp.

430{
431 context.StartArray();
434 {
435 for (auto &plug
437 auto command = em.GetCommandIdentifier(plug.GetID());
438 if (!command.empty()){
439 em.GetCommandDefinition( plug.GetID(), context, flags );
440 }
441 }
442 }
443 context.EndArray();
444 return true;
445}
@ 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 552 of file GetInfoCommand.cpp.

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

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

595{
596 auto &tracks = TrackList::Get( context.project );
597 int i=0;
598 context.StartArray();
599 for (auto t : tracks) {
600 t->TypeSwitch( [&](LabelTrack &labelTrack) {
601#ifdef VERBOSE_LABELS_FORMATTING
602 for (int nn = 0; nn< (int)labelTrack->mLabels.size(); nn++) {
603 const auto &label = labelTrack->mLabels[nn];
604 context.StartStruct();
605 context.AddItem( (double)i, "track" );
606 context.AddItem( label.getT0(), "start" );
607 context.AddItem( label.getT1(), "end" );
608 context.AddItem( label.title, "text" );
609 context.EndStruct();
610 }
611#else
612 context.StartArray();
613 context.AddItem( (double)i ); // Track number.
614 context.StartArray();
615 for ( const auto &label : labelTrack.GetLabels() ) {
616 context.StartArray();
617 context.AddItem( label.getT0() ); // start
618 context.AddItem( label.getT1() ); // end
619 context.AddItem( label.title ); //text.
620 context.EndArray();
621 }
622 context.EndArray();
623 context.EndArray();
624#endif
625 } );
626 // Per track numbering counts all tracks
627 i++;
628 }
629 context.EndArray();
630
631 return true;
632}
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 186 of file GetInfoCommand.cpp.

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

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

414{
415 context.StartArray();
416 auto pWin = &GetProjectFrame( context.project );
417 GlobalPrefsDialog dialog( pWin, &context.project );
418 // wxCommandEvent Evt;
419 //dialog.Show();
420 ShuttleGuiGetDefinition S(pWin, *((context.pOutput)->mStatusTarget) );
421 dialog.ShuttleAll( S );
422 context.EndArray();
423 return true;
424}

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:

◆ SendSelection()

bool GetInfoCommand::SendSelection ( const CommandContext context)
private

Definition at line 634 of file GetInfoCommand.cpp.

635{
636 context.StartStruct();
637
638 const auto& selectedRegion = ViewInfo::Get( context.project ).selectedRegion;
639
640 context.AddItem(selectedRegion.t0(), "Start"); // Send selection start position
641 context.AddItem(selectedRegion.t1(), "End"); // Send cselection end position
642
643 context.EndStruct();
644
645 return true;
646}
NotifyingSelectedRegion selectedRegion
Definition: ViewInfo.h:216
static ViewInfo & Get(AudacityProject &project)
Definition: ViewInfo.cpp:235

References CommandContext::AddItem(), CommandContext::EndStruct(), ViewInfo::Get(), CommandContext::project, ViewInfo::selectedRegion, and CommandContext::StartStruct().

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

478{
479 auto &tracks = TrackList::Get( context.project );
480 context.StartArray();
481 for (auto trk : tracks)
482 {
483 auto &trackFocus = TrackFocus::Get( context.project );
484 Track * fTrack = trackFocus.Get();
485
486 context.StartStruct();
487 context.AddItem( trk->GetName(), "name" );
488 context.AddBool( (trk == fTrack), "focused");
489 context.AddBool( trk->GetSelected(), "selected" );
490 //JKC: Possibly add later...
491 //context.AddItem(ChannelView::GetChannelGroupHeight(*trk), "height");
492 trk->TypeSwitch( [&] (const WaveTrack &t) {
493 float vzmin, vzmax;
494 WaveformScale::Get(t).GetDisplayBounds(vzmin, vzmax);
495 context.AddItem( "wave", "kind" );
496 context.AddItem( t.GetStartTime(), "start" );
497 context.AddItem( t.GetEndTime(), "end" );
498 context.AddItem( t.GetPan() , "pan");
499 context.AddItem( t.GetGain() , "gain");
500 context.AddItem( t.NChannels(), "channels");
501 context.AddBool( t.GetSolo(), "solo" );
502 context.AddBool( t.GetMute(), "mute");
503 context.AddItem( vzmin, "VZoomMin");
504 context.AddItem( vzmax, "VZoomMax");
505 },
506#if defined(USE_MIDI)
507 [&](const NoteTrack &) {
508 context.AddItem( "note", "kind" );
509 },
510#endif
511 [&](const LabelTrack &) {
512 context.AddItem( "label", "kind" );
513 },
514 [&](const TimeTrack &) {
515 context.AddItem( "time", "kind" );
516 }
517 );
518 context.EndStruct();
519 }
520 context.EndArray();
521 return true;
522}
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:2323
double GetStartTime() const override
Implement WideSampleSequence.
Definition: WaveTrack.cpp:2585
float GetPan() const
Definition: WaveTrack.cpp:842
double GetEndTime() const override
Implement WideSampleSequence.
Definition: WaveTrack.cpp:2595
float GetGain() const
Definition: WaveTrack.cpp:824
bool GetSolo() const override
May vary asynchronously.
Definition: WaveTrack.cpp:2328
size_t NChannels() const override
A constant property.
Definition: WaveTrack.cpp:530
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 124 of file GetInfoCommand.cpp.

125 { 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 121 of file GetInfoCommand.cpp.

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

References S.

◆ VisitSettings() [3/3]

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

Definition at line 115 of file GetInfoCommand.cpp.

115 {
116 S.DefineEnum( mInfoType, wxT("Type"), 0, kTypes, nTypes );
117 S.DefineEnum( mFormat, wxT("Format"), 0, kFormats, nFormats );
118 return true;
119}
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: