Audacity  3.0.3
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 () override
 
TranslatableString GetDescription () override
 
bool DefineParams (ShuttleParams &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 () override
 
VendorSymbol GetVendor () override
 
wxString GetVersion () override
 
virtual bool IsBatchProcessing ()
 
virtual void SetBatchProcessing (bool start)
 
virtual bool Apply (const CommandContext &WXUNUSED(context))
 
bool ShowInterface (wxWindow *parent, bool forceModal=false)
 
virtual void SetHostUI (EffectUIHostInterface *WXUNUSED(host))
 
wxDialog * CreateUI (wxWindow *parent, AudacityCommand *client)
 
virtual bool GetAutomationParameters (wxString &parms)
 
virtual bool SetAutomationParameters (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 ()
 
- Public Member Functions inherited from ComponentInterface
virtual ~ComponentInterface ()
 
TranslatableString GetName ()
 
virtual bool DefineParams (ShuttleParams &WXUNUSED(S))
 

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 }
 
using VetoDialogHook = bool(*)(wxDialog *)
 
- Static Public Member Functions inherited from AudacityCommand
static VetoDialogHook SetVetoDialogHook (VetoDialogHook hook)
 
- Protected Attributes inherited from AudacityCommand
ProgressDialogmProgress
 
wxDialog * mUIDialog
 
wxWindow * mUIParent
 
int mUIResultID
 

Detailed Description

Command that sets project information.

Definition at line 23 of file SetProjectCommand.h.

Constructor & Destructor Documentation

◆ SetProjectCommand()

SetProjectCommand::SetProjectCommand ( )

Definition at line 39 of file SetProjectCommand.cpp.

40 {
41 }

Member Function Documentation

◆ Apply()

bool SetProjectCommand::Apply ( const CommandContext context)
override

Definition at line 75 of file SetProjectCommand.cpp.

76 {
77  auto &project = context.project;
78  auto &window = GetProjectFrame( project );
79  if( bHasName )
80  window.SetLabel(mName);
81 
82  if( bHasRate && mRate >= 1 && mRate <= 1000000 )
83  {
84  auto &bar = SelectionBar::Get( project );
85  bar.SetRate( mRate );
86  }
87 
88  if( bHasSizing )
89  {
90  window.SetPosition( wxPoint( mPosX, mPosY));
91  window.SetSize( wxSize( mWidth, mHeight ));
92  }
93  return true;
94 }

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

Here is the call graph for this function:

◆ DefineParams()

bool SetProjectCommand::DefineParams ( ShuttleParams S)
override

Definition at line 44 of file SetProjectCommand.cpp.

44  {
45  S.OptionalN( bHasName ).Define( mName, wxT("Name"), _("Project") );
46  S.OptionalN( bHasRate ).Define( mRate, wxT("Rate"), 44100.0, 1.0, 1000000.0);
47  S.OptionalY( bHasSizing ).Define( mPosX, wxT("X"), 10.0, 0.0, 2000.0);
48  S.OptionalY( bHasSizing ).Define( mPosY, wxT("Y"), 10.0, 0.0, 2000.0);
49  S.OptionalY( bHasSizing ).Define( mWidth, wxT("Width"), 1000.0, 200.0, 4000.0);
50  S.OptionalY( bHasSizing ).Define( mHeight, wxT("Height"), 900.0, 200.0, 4000.0);
51  return true;
52 };

References _, bHasName, bHasRate, bHasSizing, ShuttleParams::Define(), mHeight, mName, mPosX, mPosY, mRate, mWidth, ShuttleParams::OptionalN(), and ShuttleParams::OptionalY().

Here is the call graph for this function:

◆ GetDescription()

TranslatableString SetProjectCommand::GetDescription ( )
inlineoverridevirtual

Reimplemented from AudacityCommand.

Definition at line 31 of file SetProjectCommand.h.

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

References XO.

◆ GetSymbol()

ComponentInterfaceSymbol SetProjectCommand::GetSymbol ( )
inlineoverridevirtual

Implements AudacityCommand.

Definition at line 30 of file SetProjectCommand.h.

30 {return Symbol;};

References Symbol.

◆ ManualPage()

ManualPageID SetProjectCommand::ManualPage ( )
inlineoverridevirtual

Reimplemented from AudacityCommand.

Definition at line 36 of file SetProjectCommand.h.

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

◆ PopulateOrExchange()

void SetProjectCommand::PopulateOrExchange ( ShuttleGui S)
override

Definition at line 54 of file SetProjectCommand.cpp.

55 {
56  S.AddSpace(0, 5);
57  S.StartMultiColumn(3, wxALIGN_CENTER);
58  {
59  S.Optional( bHasName ).TieTextBox( XXO("Name:"), mName );
60  S.Optional( bHasRate ).TieTextBox( XXO("Rate:"), mRate );
61  S.TieCheckBox( XXO("Resize:"), bHasSizing );
62  S.AddSpace(0,0);
63  }
64  S.EndMultiColumn();
65  S.StartMultiColumn(2, wxALIGN_CENTER);
66  {
67  S.TieNumericTextBox( XXO("X:"), mPosX );
68  S.TieNumericTextBox( XXO("Y:"), mPosY );
69  S.TieNumericTextBox( XXO("Width:"), mWidth );
70  S.TieNumericTextBox( XXO("Height:"), mHeight );
71  }
72  S.EndMultiColumn();
73 }

References ShuttleGui::AddSpace(), bHasName, bHasRate, bHasSizing, ShuttleGuiBase::EndMultiColumn(), mHeight, mName, mPosX, mPosY, mRate, mWidth, ShuttleGui::Optional(), ShuttleGuiBase::StartMultiColumn(), ShuttleGuiBase::TieCheckBox(), ShuttleGuiBase::TieNumericTextBox(), ShuttleGuiBase::TieTextBox(), and XXO.

Here is the call graph for this function:

Member Data Documentation

◆ bHasName

bool SetProjectCommand::bHasName

Definition at line 50 of file SetProjectCommand.h.

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

◆ bHasRate

bool SetProjectCommand::bHasRate

Definition at line 52 of file SetProjectCommand.h.

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

◆ bHasSizing

bool SetProjectCommand::bHasSizing

Definition at line 51 of file SetProjectCommand.h.

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

◆ mHeight

int SetProjectCommand::mHeight

Definition at line 46 of file SetProjectCommand.h.

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

◆ mName

wxString SetProjectCommand::mName

Definition at line 42 of file SetProjectCommand.h.

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

◆ mPosX

int SetProjectCommand::mPosX

Definition at line 43 of file SetProjectCommand.h.

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

◆ mPosY

int SetProjectCommand::mPosY

Definition at line 44 of file SetProjectCommand.h.

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

◆ mRate

double SetProjectCommand::mRate

Definition at line 47 of file SetProjectCommand.h.

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

◆ mWidth

int SetProjectCommand::mWidth

Definition at line 45 of file SetProjectCommand.h.

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

◆ 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:
SelectionBar::Get
static SelectionBar & Get(AudacityProject &project)
Definition: SelectionBar.cpp:137
ShuttleGuiBase::TieCheckBox
wxCheckBox * TieCheckBox(const TranslatableString &Prompt, bool &Var)
Definition: ShuttleGui.cpp:1629
ShuttleGui::AddSpace
wxSizerItem * AddSpace(int width, int height, int prop=0)
Definition: ShuttleGui.cpp:2459
XO
#define XO(s)
Definition: Internat.h:31
SetProjectCommand::bHasRate
bool bHasRate
Definition: SetProjectCommand.h:52
ShuttleGuiBase::EndMultiColumn
void EndMultiColumn()
Definition: ShuttleGui.cpp:1238
SetProjectCommand::mPosY
int mPosY
Definition: SetProjectCommand.h:44
ShuttleParams::OptionalN
virtual ShuttleParams & OptionalN(bool &var)
Definition: Shuttle.h:72
ShuttleGuiBase::TieTextBox
wxTextCtrl * TieTextBox(const TranslatableString &Caption, wxString &Value, const int nChars=0)
Definition: ShuttleGui.cpp:1652
XXO
#define XXO(s)
Definition: Internat.h:44
ShuttleGuiBase::StartMultiColumn
void StartMultiColumn(int nCols, int PositionFlags=wxALIGN_LEFT)
Definition: ShuttleGui.cpp:1229
SetProjectCommand::bHasName
bool bHasName
Definition: SetProjectCommand.h:50
SetProjectCommand::mPosX
int mPosX
Definition: SetProjectCommand.h:43
SetProjectCommand::Symbol
static const ComponentInterfaceSymbol Symbol
Definition: SetProjectCommand.h:26
SetProjectCommand::mRate
double mRate
Definition: SetProjectCommand.h:47
SetProjectCommand::bHasSizing
bool bHasSizing
Definition: SetProjectCommand.h:51
ShuttleParams::OptionalY
virtual ShuttleParams & OptionalY(bool &var)
Definition: Shuttle.h:71
ShuttleGuiBase::TieNumericTextBox
wxTextCtrl * TieNumericTextBox(const TranslatableString &Prompt, int &Value, const int nChars=0)
Definition: ShuttleGui.cpp:1673
_
#define _(s)
Definition: Internat.h:75
GetProjectFrame
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 ...
Definition: ProjectWindows.cpp:72
SetProjectCommand::mWidth
int mWidth
Definition: SetProjectCommand.h:45
SetProjectCommand::mHeight
int mHeight
Definition: SetProjectCommand.h:46
ShuttleParams::Define
virtual void Define(bool &var, const wxChar *key, const bool vdefault, const bool vmin=false, const bool vmax=false, const bool vscl=false)
Definition: Shuttle.cpp:332
ShuttleGui::Optional
ShuttleGui & Optional(bool &bVar)
Definition: ShuttleGui.cpp:2280
CommandContext::project
AudacityProject & project
Definition: CommandContext.h:64
SetProjectCommand::mName
wxString mName
Definition: SetProjectCommand.h:42