Audacity  3.0.3
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
SetTrackAudioCommand Class Reference

A SetTrackBase that sets pan, gain, mute and solo. More...

#include <SetTrackInfoCommand.h>

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

Public Member Functions

ComponentInterfaceSymbol GetSymbol () override
 
TranslatableString GetDescription () override
 
bool DefineParams (ShuttleParams &S) override
 
void PopulateOrExchange (ShuttleGui &S) override
 
ManualPageID ManualPage () override
 
bool ApplyInner (const CommandContext &context, Track *t) override
 
- Public Member Functions inherited from SetTrackBase
 SetTrackBase ()
 
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

double mPan
 
double mGain
 
bool bSolo
 
bool bMute
 
bool bHasPan
 
bool bHasGain
 
bool bHasSolo
 
bool bHasMute
 
- Public Attributes inherited from SetTrackBase
int mTrackIndex
 
int mChannelIndex
 
bool bHasTrackIndex
 
bool bHasChannelIndex
 
bool bIsSecondChannel
 
bool mbPromptForTracks
 

Static Public Attributes

static const ComponentInterfaceSymbol Symbol { XO("Set Track Audio") }
 

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

A SetTrackBase that sets pan, gain, mute and solo.

Definition at line 71 of file SetTrackInfoCommand.h.

Member Function Documentation

◆ ApplyInner()

bool SetTrackAudioCommand::ApplyInner ( const CommandContext context,
Track t 
)
overridevirtual

Reimplemented from SetTrackBase.

Definition at line 221 of file SetTrackInfoCommand.cpp.

222 {
223  static_cast<void>(context);
224  auto wt = dynamic_cast<WaveTrack *>(t);
225  auto pt = dynamic_cast<PlayableTrack *>(t);
226 
227  if( wt && bHasGain )
228  wt->SetGain(DB_TO_LINEAR(mGain));
229  if( wt && bHasPan )
230  wt->SetPan(mPan/100.0);
231 
232  // These ones don't make sense on the second channel of a stereo track.
233  if( !bIsSecondChannel ){
234  if( pt && bHasSolo )
235  pt->SetSolo(bSolo);
236  if( pt && bHasMute )
237  pt->SetMute(bMute);
238  }
239  return true;
240 }

References bHasGain, bHasMute, bHasPan, bHasSolo, SetTrackBase::bIsSecondChannel, bMute, bSolo, DB_TO_LINEAR(), mGain, mPan, and Track::SetPan().

Referenced by SetTrackCommand::ApplyInner().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DefineParams()

bool SetTrackAudioCommand::DefineParams ( ShuttleParams S)
overridevirtual

Reimplemented from SetTrackBase.

Definition at line 192 of file SetTrackInfoCommand.cpp.

192  {
194  S.OptionalN( bHasMute ).Define( bMute, wxT("Mute"), false );
195  S.OptionalN( bHasSolo ).Define( bSolo, wxT("Solo"), false );
196 
197  S.OptionalN( bHasGain ).Define( mGain, wxT("Gain"), 0.0, -36.0, 36.0);
198  S.OptionalN( bHasPan ).Define( mPan, wxT("Pan"), 0.0, -100.0, 100.0);
199  return true;
200 };

References bHasGain, bHasMute, bHasPan, bHasSolo, bMute, bSolo, ShuttleParams::Define(), SetTrackBase::DefineParams(), mGain, mPan, and ShuttleParams::OptionalN().

Referenced by SetTrackCommand::DefineParams().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetDescription()

TranslatableString SetTrackAudioCommand::GetDescription ( )
inlineoverridevirtual

Reimplemented from AudacityCommand.

Definition at line 79 of file SetTrackInfoCommand.h.

79 {return XO("Sets various values for a track.");};

References XO.

◆ GetSymbol()

ComponentInterfaceSymbol SetTrackAudioCommand::GetSymbol ( )
inlineoverridevirtual

Implements AudacityCommand.

Definition at line 78 of file SetTrackInfoCommand.h.

78 {return Symbol;};

References Symbol.

◆ ManualPage()

ManualPageID SetTrackAudioCommand::ManualPage ( )
inlineoverridevirtual

Reimplemented from AudacityCommand.

Definition at line 84 of file SetTrackInfoCommand.h.

84 {return L"Extra_Menu:_Scriptables_I#set_track_audio";}

◆ PopulateOrExchange()

void SetTrackAudioCommand::PopulateOrExchange ( ShuttleGui S)
overridevirtual

Reimplemented from SetTrackBase.

Definition at line 202 of file SetTrackInfoCommand.cpp.

203 {
205  S.StartMultiColumn(2, wxEXPAND);
206  {
207  S.SetStretchyCol( 1 );
208  S.Optional( bHasMute ).TieCheckBox( XXO("Mute"), bMute);
209  S.Optional( bHasSolo ).TieCheckBox( XXO("Solo"), bSolo);
210  }
211  S.EndMultiColumn();
212  S.StartMultiColumn(3, wxEXPAND);
213  {
214  S.SetStretchyCol( 2 );
215  S.Optional( bHasGain ).TieSlider( XXO("Gain:"), mGain, 36.0,-36.0);
216  S.Optional( bHasPan ).TieSlider( XXO("Pan:"), mPan, 100.0, -100.0);
217  }
218  S.EndMultiColumn();
219 }

References bHasGain, bHasMute, bHasPan, bHasSolo, bMute, bSolo, ShuttleGuiBase::EndMultiColumn(), mGain, mPan, ShuttleGui::Optional(), SetTrackBase::PopulateOrExchange(), ShuttleGuiBase::SetStretchyCol(), ShuttleGuiBase::StartMultiColumn(), ShuttleGuiBase::TieCheckBox(), ShuttleGuiBase::TieSlider(), and XXO.

Referenced by SetTrackCommand::PopulateOrExchange().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ bHasGain

bool SetTrackAudioCommand::bHasGain

Definition at line 95 of file SetTrackInfoCommand.h.

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

◆ bHasMute

bool SetTrackAudioCommand::bHasMute

Definition at line 97 of file SetTrackInfoCommand.h.

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

◆ bHasPan

bool SetTrackAudioCommand::bHasPan

Definition at line 94 of file SetTrackInfoCommand.h.

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

◆ bHasSolo

bool SetTrackAudioCommand::bHasSolo

Definition at line 96 of file SetTrackInfoCommand.h.

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

◆ bMute

bool SetTrackAudioCommand::bMute

Definition at line 91 of file SetTrackInfoCommand.h.

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

◆ bSolo

bool SetTrackAudioCommand::bSolo

Definition at line 90 of file SetTrackInfoCommand.h.

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

◆ mGain

double SetTrackAudioCommand::mGain

Definition at line 89 of file SetTrackInfoCommand.h.

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

◆ mPan

double SetTrackAudioCommand::mPan

Definition at line 88 of file SetTrackInfoCommand.h.

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

◆ Symbol

const ComponentInterfaceSymbol SetTrackAudioCommand::Symbol { XO("Set Track Audio") }
static

Definition at line 74 of file SetTrackInfoCommand.h.

Referenced by GetSymbol().


The documentation for this class was generated from the following files:
WaveTrack
A Track that contains audio waveform data.
Definition: WaveTrack.h:69
DB_TO_LINEAR
const double MIN_Threshold_Linear DB_TO_LINEAR(MIN_Threshold_dB)
SetTrackAudioCommand::bHasGain
bool bHasGain
Definition: SetTrackInfoCommand.h:95
SetTrackAudioCommand::bMute
bool bMute
Definition: SetTrackInfoCommand.h:91
ShuttleGuiBase::TieCheckBox
wxCheckBox * TieCheckBox(const TranslatableString &Prompt, bool &Var)
Definition: ShuttleGui.cpp:1629
ShuttleGuiBase::TieSlider
wxSlider * TieSlider(const TranslatableString &Prompt, int &pos, const int max, const int min=0)
Definition: ShuttleGui.cpp:1687
XO
#define XO(s)
Definition: Internat.h:31
ShuttleGuiBase::EndMultiColumn
void EndMultiColumn()
Definition: ShuttleGui.cpp:1238
SetTrackBase::DefineParams
virtual bool DefineParams(ShuttleParams &S) override
Definition: SetTrackInfoCommand.cpp:70
SetTrackAudioCommand::bHasPan
bool bHasPan
Definition: SetTrackInfoCommand.h:94
ShuttleParams::OptionalN
virtual ShuttleParams & OptionalN(bool &var)
Definition: Shuttle.h:72
SetTrackBase::bIsSecondChannel
bool bIsSecondChannel
Definition: SetTrackInfoCommand.h:39
XXO
#define XXO(s)
Definition: Internat.h:44
SetTrackAudioCommand::mPan
double mPan
Definition: SetTrackInfoCommand.h:88
ShuttleGuiBase::StartMultiColumn
void StartMultiColumn(int nCols, int PositionFlags=wxALIGN_LEFT)
Definition: ShuttleGui.cpp:1229
SetTrackAudioCommand::mGain
double mGain
Definition: SetTrackInfoCommand.h:89
Track::SetPan
virtual void SetPan(float)
Definition: Track.h:447
PlayableTrack
AudioTrack subclass that can also be audibly replayed by the program.
Definition: Track.h:854
SetTrackAudioCommand::bSolo
bool bSolo
Definition: SetTrackInfoCommand.h:90
SetTrackAudioCommand::bHasSolo
bool bHasSolo
Definition: SetTrackInfoCommand.h:96
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
SetTrackBase::PopulateOrExchange
virtual void PopulateOrExchange(ShuttleGui &S) override
Definition: SetTrackInfoCommand.cpp:80
ShuttleGui::Optional
ShuttleGui & Optional(bool &bVar)
Definition: ShuttleGui.cpp:2280
ShuttleGuiBase::SetStretchyCol
void SetStretchyCol(int i)
Used to modify an already placed FlexGridSizer to make a column stretchy.
Definition: ShuttleGui.cpp:202
SetTrackAudioCommand::bHasMute
bool bHasMute
Definition: SetTrackInfoCommand.h:97
SetTrackAudioCommand::Symbol
static const ComponentInterfaceSymbol Symbol
Definition: SetTrackInfoCommand.h:74