Audacity  3.0.3
Public Member Functions | Public Attributes | List of all members
ShuttleSetAutomation Class Referencefinal

Shuttle that sets parameters to a value (from a string) More...

#include <Shuttle.h>

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

Public Member Functions

 ShuttleSetAutomation ()
 
ShuttleParamsOptional (bool &var) override
 
bool CouldGet (const wxString &key)
 
void SetForValidating (CommandParameters *pEap)
 
void SetForWriting (CommandParameters *pEap)
 
void Define (bool &var, const wxChar *key, const bool vdefault, const bool vmin, const bool vmax, const bool vscl) override
 
void Define (int &var, const wxChar *key, const int vdefault, const int vmin, const int vmax, const int vscl) override
 
void Define (size_t &var, const wxChar *key, const int vdefault, const int vmin, const int vmax, const int vscl) override
 
void Define (float &var, const wxChar *key, const float vdefault, const float vmin, const float vmax, const float vscl) override
 
void Define (double &var, const wxChar *key, const float vdefault, const float vmin, const float vmax, const float vscl) override
 
void Define (double &var, const wxChar *key, const double vdefault, const double vmin, const double vmax, const double vscl) override
 
void Define (wxString &var, const wxChar *key, const wxString vdefault, const wxString vmin, const wxString vmax, const wxString vscl) override
 
void DefineEnum (int &var, const wxChar *key, const int vdefault, const EnumValueSymbol strings[], size_t nStrings) override
 
- Public Member Functions inherited from ShuttleParams
 ShuttleParams ()
 
virtual ~ShuttleParams ()
 
bool ShouldSet ()
 
virtual ShuttleParamsOptional (bool &WXUNUSED(var))
 
virtual ShuttleParamsOptionalY (bool &var)
 
virtual ShuttleParamsOptionalN (bool &var)
 

Public Attributes

bool bOK
 
bool bWrite
 
- Public Attributes inherited from ShuttleParams
wxString mParams
 
bool * pOptionalFlag
 
CommandParametersmpEap
 

Detailed Description

Shuttle that sets parameters to a value (from a string)

Definition at line 105 of file Shuttle.h.

Constructor & Destructor Documentation

◆ ShuttleSetAutomation()

ShuttleSetAutomation::ShuttleSetAutomation ( )
inline

Definition at line 108 of file Shuttle.h.

108 { bWrite = false; bOK = false;};

Member Function Documentation

◆ CouldGet()

bool ShuttleSetAutomation::CouldGet ( const wxString &  key)

Definition at line 417 of file Shuttle.cpp.

417  {
418  // Not optional? Can get as we will get the default, at worst.
419  if( !pOptionalFlag )
420  return true;
421  bool result = mpEap->HasEntry( key );
422  *pOptionalFlag = result;
423  pOptionalFlag = NULL;
424  return result;
425 }

References CommandParameters::HasEntry(), key, ShuttleParams::mpEap, and ShuttleParams::pOptionalFlag.

Referenced by Define(), and DefineEnum().

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

◆ Define() [1/7]

void ShuttleSetAutomation::Define ( bool &  var,
const wxChar *  key,
const bool  vdefault,
const bool  vmin,
const bool  vmax,
const bool  vscl 
)
overridevirtual

Reimplemented from ShuttleParams.

Definition at line 427 of file Shuttle.cpp.

428 {
429  CouldGet( key );
430  if( !bOK )
431  return;
432  // Use of temp in this and related functions is to handle the case of
433  // only committing values if all values pass verification.
434  bool temp =var;
435  bOK = mpEap->ReadAndVerify(key, &temp, vdefault);
436  if( bWrite && bOK)
437  var = temp;
438 }

References bOK, bWrite, CouldGet(), key, ShuttleParams::mpEap, and CommandParameters::ReadAndVerify().

Here is the call graph for this function:

◆ Define() [2/7]

void ShuttleSetAutomation::Define ( double &  var,
const wxChar *  key,
const double  vdefault,
const double  vmin,
const double  vmax,
const double  vscl 
)
overridevirtual

Reimplemented from ShuttleParams.

Definition at line 485 of file Shuttle.cpp.

486 {
487  CouldGet( key );
488  if( !bOK )
489  return;
490  double temp = var;
491  bOK = mpEap->ReadAndVerify(key, &temp, vdefault, vmin, vmax);
492  if( bWrite && bOK)
493  var = temp;
494 }

References bOK, bWrite, CouldGet(), key, ShuttleParams::mpEap, and CommandParameters::ReadAndVerify().

Here is the call graph for this function:

◆ Define() [3/7]

void ShuttleSetAutomation::Define ( double &  var,
const wxChar *  key,
const float  vdefault,
const float  vmin,
const float  vmax,
const float  vscl 
)
overridevirtual

Reimplemented from ShuttleParams.

Definition at line 474 of file Shuttle.cpp.

475 {
476  CouldGet( key );
477  if( !bOK )
478  return;
479  double temp = var;
480  bOK = mpEap->ReadAndVerify(key, &temp, vdefault, vmin, vmax);
481  if( bWrite && bOK)
482  var = temp;
483 }

References bOK, bWrite, CouldGet(), key, ShuttleParams::mpEap, and CommandParameters::ReadAndVerify().

Here is the call graph for this function:

◆ Define() [4/7]

void ShuttleSetAutomation::Define ( float &  var,
const wxChar *  key,
const float  vdefault,
const float  vmin,
const float  vmax,
const float  vscl 
)
overridevirtual

Reimplemented from ShuttleParams.

Definition at line 462 of file Shuttle.cpp.

463 {
464  CouldGet( key );
465  if( !bOK )
466  return;
467  float temp = var;
468  bOK = mpEap->ReadAndVerify(key, &temp, vdefault, vmin, vmax);
469  if( bWrite && bOK )
470  var = temp;
471 }

References bOK, bWrite, CouldGet(), key, ShuttleParams::mpEap, and CommandParameters::ReadAndVerify().

Here is the call graph for this function:

◆ Define() [5/7]

void ShuttleSetAutomation::Define ( int &  var,
const wxChar *  key,
const int  vdefault,
const int  vmin,
const int  vmax,
const int  vscl 
)
overridevirtual

Reimplemented from ShuttleParams.

Definition at line 440 of file Shuttle.cpp.

441 {
442  CouldGet( key );
443  if( !bOK )
444  return;
445  int temp =var;
446  bOK = mpEap->ReadAndVerify(key, &temp, vdefault, vmin, vmax);
447  if( bWrite && bOK)
448  var = temp;
449 }

References bOK, bWrite, CouldGet(), key, ShuttleParams::mpEap, and CommandParameters::ReadAndVerify().

Here is the call graph for this function:

◆ Define() [6/7]

void ShuttleSetAutomation::Define ( size_t &  var,
const wxChar *  key,
const int  vdefault,
const int  vmin,
const int  vmax,
const int  vscl 
)
overridevirtual

Reimplemented from ShuttleParams.

Definition at line 451 of file Shuttle.cpp.

452 {
453  CouldGet( key );
454  if( !bOK )
455  return;
456  int temp = var;
457  bOK = mpEap->ReadAndVerify(key, &temp, vdefault, vmin, vmax);
458  if( bWrite && bOK )
459  var = temp;
460 }

References bOK, bWrite, CouldGet(), key, ShuttleParams::mpEap, and CommandParameters::ReadAndVerify().

Here is the call graph for this function:

◆ Define() [7/7]

void ShuttleSetAutomation::Define ( wxString &  var,
const wxChar *  key,
const wxString  vdefault,
const wxString  vmin,
const wxString  vmax,
const wxString  vscl 
)
overridevirtual

Reimplemented from ShuttleParams.

Definition at line 497 of file Shuttle.cpp.

498 {
499  CouldGet( key );
500  if( !bOK )
501  return;
502  wxString temp = var;
503  bOK = mpEap->ReadAndVerify(key, &temp, vdefault);
504  if( bWrite && bOK )
505  var = temp;
506 }

References bOK, bWrite, CouldGet(), key, ShuttleParams::mpEap, and CommandParameters::ReadAndVerify().

Here is the call graph for this function:

◆ DefineEnum()

void ShuttleSetAutomation::DefineEnum ( int &  var,
const wxChar *  key,
const int  vdefault,
const EnumValueSymbol  strings[],
size_t  nStrings 
)
overridevirtual

Reimplemented from ShuttleParams.

Definition at line 509 of file Shuttle.cpp.

510 {
511  CouldGet( key );
512  if( !bOK )
513  return;
514  int temp = var;
515  bOK = mpEap->ReadAndVerify(key, &temp, vdefault, strings, nStrings);
516  if( bWrite && bOK)
517  var = temp;
518 }

References bOK, bWrite, CouldGet(), key, ShuttleParams::mpEap, and CommandParameters::ReadAndVerify().

Here is the call graph for this function:

◆ Optional()

ShuttleParams & ShuttleSetAutomation::Optional ( bool &  var)
override

Definition at line 407 of file Shuttle.cpp.

407  {
408  pOptionalFlag = &var;
409  return *this;
410 };

References ShuttleParams::pOptionalFlag.

◆ SetForValidating()

void ShuttleSetAutomation::SetForValidating ( CommandParameters pEap)
inline

Definition at line 113 of file Shuttle.h.

113 { mpEap=pEap; bOK=true;bWrite=false;};

Referenced by Effect::SetAutomationParameters().

Here is the caller graph for this function:

◆ SetForWriting()

void ShuttleSetAutomation::SetForWriting ( CommandParameters pEap)
inline

Definition at line 114 of file Shuttle.h.

114 { mpEap=pEap;bOK=true;bWrite=true;};

Referenced by EffectEqualization::LoadFactoryPreset(), AudacityCommand::SetAutomationParameters(), and Effect::SetAutomationParameters().

Here is the caller graph for this function:

Member Data Documentation

◆ bOK

bool ShuttleSetAutomation::bOK

◆ bWrite

bool ShuttleSetAutomation::bWrite

Definition at line 110 of file Shuttle.h.

Referenced by Define(), and DefineEnum().


The documentation for this class was generated from the following files:
CommandParameters::ReadAndVerify
bool ReadAndVerify(const wxString &key, float *val, float defVal, float min, float max) const
Definition: EffectAutomationParameters.h:213
ShuttleSetAutomation::CouldGet
bool CouldGet(const wxString &key)
Definition: Shuttle.cpp:417
ShuttleParams::mpEap
CommandParameters * mpEap
Definition: Shuttle.h:66
key
static const AudacityProject::AttachedObjects::RegisteredFactory key
Definition: CommandManager.cpp:201
CommandParameters::HasEntry
virtual bool HasEntry(const wxString &strName) const override
Definition: EffectAutomationParameters.h:87
ShuttleSetAutomation::bWrite
bool bWrite
Definition: Shuttle.h:110
ShuttleSetAutomation::bOK
bool bOK
Definition: Shuttle.h:108
ShuttleParams::pOptionalFlag
bool * pOptionalFlag
Definition: Shuttle.h:65