Audacity 3.2.0
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
SetProjectCommand Class Reference

Command that sets project information. More...

#include <SetProjectCommand.h>

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

Public Member Functions

 SetProjectCommand ()
 
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
 
- 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

wxString mName
 
int mPosX
 
int mPosY
 
int mWidth
 
int mHeight
 
double mRate
 
bool bHasName
 
bool bHasSizing
 
bool bHasRate
 

Static Public Attributes

static const ComponentInterfaceSymbol Symbol { XO("Set Project") }
 

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 that sets project information.

Definition at line 23 of file SetProjectCommand.h.

Constructor & Destructor Documentation

◆ SetProjectCommand()

SetProjectCommand::SetProjectCommand ( )

Definition at line 42 of file SetProjectCommand.cpp.

43{
44}

Member Function Documentation

◆ Apply()

bool SetProjectCommand::Apply ( const CommandContext context)
override

Definition at line 84 of file SetProjectCommand.cpp.

85{
86 auto &project = context.project;
87 auto &window = GetProjectFrame( project );
88 if( bHasName )
89 window.SetLabel(mName);
90
91 if (bHasRate && mRate >= 1 && mRate <= 1000000)
93
94 if( bHasSizing )
95 {
96 window.SetPosition( wxPoint( mPosX, mPosY));
97 window.SetSize( wxSize( mWidth, mHeight ));
98 }
99 return true;
100}
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 ...
const auto project
AudacityProject & project
static ProjectRate & Get(AudacityProject &project)
Definition: ProjectRate.cpp:28
void SetRate(double rate)
Definition: ProjectRate.cpp:58

References bHasName, bHasRate, bHasSizing, ProjectRate::Get(), GetProjectFrame(), mHeight, mName, mPosX, mPosY, mRate, mWidth, CommandContext::project, project, and ProjectRate::SetRate().

Here is the call graph for this function:

◆ GetDescription()

TranslatableString SetProjectCommand::GetDescription ( ) const
inlineoverridevirtual

Reimplemented from AudacityCommand.

Definition at line 31 of file SetProjectCommand.h.

31{return XO("Sets various values for a project.");};
XO("Cut/Copy/Paste")

References XO().

Here is the call graph for this function:

◆ GetSymbol()

ComponentInterfaceSymbol SetProjectCommand::GetSymbol ( ) const
inlineoverridevirtual

Implements AudacityCommand.

Definition at line 30 of file SetProjectCommand.h.

30{return Symbol;};
static const ComponentInterfaceSymbol Symbol

References Symbol.

◆ ManualPage()

ManualPageID SetProjectCommand::ManualPage ( )
inlineoverridevirtual

Reimplemented from AudacityCommand.

Definition at line 38 of file SetProjectCommand.h.

38{return L"Extra_Menu:_Scriptables_I#set_project";}

◆ PopulateOrExchange()

void SetProjectCommand::PopulateOrExchange ( ShuttleGui S)
override

Definition at line 63 of file SetProjectCommand.cpp.

64{
65 S.AddSpace(0, 5);
66 S.StartMultiColumn(3, wxALIGN_CENTER);
67 {
68 S.Optional( bHasName ).TieTextBox( XXO("Name:"), mName );
69 S.Optional( bHasRate ).TieTextBox( XXO("Rate:"), mRate );
70 S.TieCheckBox( XXO("Resize:"), bHasSizing );
71 S.AddSpace(0,0);
72 }
73 S.EndMultiColumn();
74 S.StartMultiColumn(2, wxALIGN_CENTER);
75 {
76 S.TieNumericTextBox( XXO("X:"), mPosX );
77 S.TieNumericTextBox( XXO("Y:"), mPosY );
78 S.TieNumericTextBox( XXO("Width:"), mWidth );
79 S.TieNumericTextBox( XXO("Height:"), mHeight );
80 }
81 S.EndMultiColumn();
82}
XXO("&Cut/Copy/Paste Toolbar")
#define S(N)
Definition: ToChars.cpp:64

References bHasName, bHasRate, bHasSizing, mHeight, mName, mPosX, mPosY, mRate, mWidth, S, and XXO().

Here is the call graph for this function:

◆ VisitSettings() [1/3]

bool SetProjectCommand::VisitSettings ( ConstSettingsVisitor )
overridevirtual

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

Reimplemented from AudacityCommand.

Definition at line 60 of file SetProjectCommand.cpp.

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

References S.

◆ VisitSettings() [2/3]

bool SetProjectCommand::VisitSettings ( SettingsVisitor )
overridevirtual

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

Reimplemented from AudacityCommand.

Definition at line 57 of file SetProjectCommand.cpp.

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

References S.

◆ VisitSettings() [3/3]

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

Definition at line 47 of file SetProjectCommand.cpp.

47 {
48 S.OptionalN( bHasName ).Define( mName, wxT("Name"), _("Project") );
49 S.OptionalN( bHasRate ).Define( mRate, wxT("Rate"), 44100.0, 1.0, 1000000.0);
50 S.OptionalY( bHasSizing ).Define( mPosX, wxT("X"), 10, 0, 2000);
51 S.OptionalY( bHasSizing ).Define( mPosY, wxT("Y"), 10, 0, 2000);
52 S.OptionalY( bHasSizing ).Define( mWidth, wxT("Width"), 1000, 200, 4000);
53 S.OptionalY( bHasSizing ).Define( mHeight, wxT("Height"), 900, 200, 4000);
54 return true;
55};
wxT("CloseDown"))
#define _(s)
Definition: Internat.h:73

References _, bHasName, bHasRate, bHasSizing, mHeight, mName, mPosX, mPosY, mRate, mWidth, S, and wxT().

Here is the call graph for this function:

Member Data Documentation

◆ bHasName

bool SetProjectCommand::bHasName

Definition at line 52 of file SetProjectCommand.h.

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

◆ bHasRate

bool SetProjectCommand::bHasRate

Definition at line 54 of file SetProjectCommand.h.

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

◆ bHasSizing

bool SetProjectCommand::bHasSizing

Definition at line 53 of file SetProjectCommand.h.

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

◆ mHeight

int SetProjectCommand::mHeight

Definition at line 48 of file SetProjectCommand.h.

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

◆ mName

wxString SetProjectCommand::mName

Definition at line 44 of file SetProjectCommand.h.

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

◆ mPosX

int SetProjectCommand::mPosX

Definition at line 45 of file SetProjectCommand.h.

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

◆ mPosY

int SetProjectCommand::mPosY

Definition at line 46 of file SetProjectCommand.h.

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

◆ mRate

double SetProjectCommand::mRate

Definition at line 49 of file SetProjectCommand.h.

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

◆ mWidth

int SetProjectCommand::mWidth

Definition at line 47 of file SetProjectCommand.h.

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

◆ Symbol

const ComponentInterfaceSymbol SetProjectCommand::Symbol { XO("Set Project") }
static

Definition at line 26 of file SetProjectCommand.h.

Referenced by GetSymbol().


The documentation for this class was generated from the following files: