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 (const CommandContext &context, bool shouldPrompt=true)
 
int MessageBox (const TranslatableString &message, long style=DefaultMessageBoxStyle, const TranslatableString &titleStr={})
 
virtual bool Init ()
 
virtual bool PromptUser (AudacityProject &)
 
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 142 of file GetInfoCommand.cpp.

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

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

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

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

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

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

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

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

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

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

431{
432 context.StartArray();
434 {
435 for (auto &plug
437 auto command = pm.GetCommandIdentifier(plug.GetID());
438 if (!command.empty()){
440 plug.GetID(), context, flags);
441 }
442 }
443 }
444 context.EndArray();
445 return true;
446}
@ PluginTypeAudacityCommand
@ PluginTypeEffect
void GetCommandDefinition(const PluginID &ID, const CommandContext &context, int flags)
static EffectAndCommandPluginManager & Get()
PluginManager maintains a list of all plug ins. That covers modules, effects, generators,...
Definition: PluginManager.h:51
Range PluginsOfType(int type)
CommandID GetCommandIdentifier(const PluginID &ID) const
static PluginManager & Get()

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

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

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

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

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

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

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

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

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

636{
637 context.StartStruct();
638
639 const auto& selectedRegion = ViewInfo::Get( context.project ).selectedRegion;
640
641 context.AddItem(selectedRegion.t0(), "Start"); // Send selection start position
642 context.AddItem(selectedRegion.t1(), "End"); // Send cselection end position
643
644 context.EndStruct();
645
646 return true;
647}
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 478 of file GetInfoCommand.cpp.

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

126 { 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 122 of file GetInfoCommand.cpp.

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

References S.

◆ VisitSettings() [3/3]

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

Definition at line 116 of file GetInfoCommand.cpp.

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