Audacity  2.2.0
Go to the documentation of this file.
1 /**********************************************************************
3  Audacity: A Digital Audio Editor
5  BatchCommands.h
7  Dominic Mazzoni
8  James Crook
10 **********************************************************************/
15 #include <wx/defs.h>
16 #include <wx/string.h>
18 #include "export/Export.h"
20 class Effect;
22 class BatchCommands final {
23  public:
24  // constructors and destructors
25  BatchCommands();
26  public:
27  bool ApplyChain(const wxString & filename = wxT(""));
28  bool ApplyCommand( const wxString & command, const wxString & params );
29  bool ApplyCommandInBatchMode(const wxString & command, const wxString &params);
30  bool ApplySpecialCommand(int iCommand, const wxString & command,const wxString & params);
31  bool ApplyEffectCommand(const PluginID & ID, const wxString & command, const wxString & params);
32  bool ReportAndSkip( const wxString & command, const wxString & params );
33  void AbortBatch();
35  // Utility functions for the special commands.
36  wxString BuildCleanFileName(const wxString &fileName, const wxString &extension);
37  bool WriteMp3File( const wxString & Name, int bitrate );
38  double GetEndTime();
39  bool IsMono();
41  // These commands do not depend on the command list.
42  static wxArrayString GetNames();
43  static wxArrayString GetAllCommands();
45  static wxString GetCurrentParamsFor(const wxString & command);
46  static wxString PromptForParamsFor(const wxString & command, const wxString & params, wxWindow *parent);
47  static wxString PromptForPresetFor(const wxString & command, const wxString & params, wxWindow *parent);
49  // These commands do depend on the command list.
50  void ResetChain();
52  bool ReadChain(const wxString & chain);
53  bool WriteChain(const wxString & chain);
54  bool AddChain(const wxString & chain);
55  bool DeleteChain(const wxString & name);
56  bool RenameChain(const wxString & oldchain, const wxString & newchain);
58  void AddToChain(const wxString & command, int before = -1);
59  void AddToChain(const wxString & command, const wxString & params, int before = -1);
60  void DeleteFromChain(int index);
61  wxString GetCommand(int index);
62  wxString GetParams(int index);
63  int GetCount();
65  void SetWavToMp3Chain();
67  bool IsFixed(const wxString & name);
69  void RestoreChain(const wxString & name);
71  void Split(const wxString & str, wxString & command, wxString & param);
72  wxString Join(const wxString & command, const wxString & param);
74  wxArrayString mCommandChain;
75  wxArrayString mParamsChain;
76  bool mAbort;
79  wxString mFileName;
80 };
82 #endif
wxArrayString mParamsChain
Definition: BatchCommands.h:75
bool ReadChain(const wxString &chain)
Definition: BatchCommands.cpp:107
static wxString PromptForParamsFor(const wxString &command, const wxString &params, wxWindow *parent)
Definition: BatchCommands.cpp:321
wxString GetCommand(int index)
Definition: BatchCommands.cpp:84
bool mAbort
Definition: BatchCommands.h:76
bool ApplyCommand(const wxString &command, const wxString &params)
Definition: BatchCommands.cpp:622
Definition: BatchCommands.cpp:71
void SetWavToMp3Chain()
Definition: BatchCommands.cpp:252
Definition: Export.h:140
wxString PluginID
Definition: CommandFunctors.h:16
Exporter mExporter
Definition: BatchCommands.h:78
void AddToChain(const wxString &command, int before=-1)
Definition: BatchCommands.cpp:722
static wxArrayString GetAllCommands()
Definition: BatchCommands.cpp:261
double GetEndTime()
Definition: BatchCommands.cpp:364
Base class for many of the effects in Audacity.
Definition: Effect.h:62
bool WriteChain(const wxString &chain)
Definition: BatchCommands.cpp:170
wxString mFileName
Definition: BatchCommands.h:79
static wxString PromptForPresetFor(const wxString &command, const wxString &params, wxWindow *parent)
Definition: BatchCommands.cpp:344
bool RenameChain(const wxString &oldchain, const wxString &newchain)
Definition: BatchCommands.cpp:242
bool ApplyCommandInBatchMode(const wxString &command, const wxString &params)
Definition: BatchCommands.cpp:649
bool IsMono()
Definition: BatchCommands.cpp:383
int GetCount()
Definition: BatchCommands.cpp:102
wxString Join(const wxString &command, const wxString &param)
Definition: BatchCommands.cpp:830
wxString GetParams(int index)
Definition: BatchCommands.cpp:93
bool ApplyEffectCommand(const PluginID &ID, const wxString &command, const wxString &params)
Definition: BatchCommands.cpp:593
bool ApplySpecialCommand(int iCommand, const wxString &command, const wxString &params)
Definition: BatchCommands.cpp:509
wxString BuildCleanFileName(const wxString &fileName, const wxString &extension)
Definition: BatchCommands.cpp:413
static wxArrayString GetNames()
Definition: BatchCommands.cpp:776
Maintains the chain of commands used in batch processing. See also BatchCommandDialog and BatchProces...
Definition: BatchCommands.h:22
void Split(const wxString &str, wxString &command, wxString &param)
Definition: BatchCommands.cpp:808
bool DeleteChain(const wxString &name)
Definition: BatchCommands.cpp:233
bool ApplyChain(const wxString &filename=wxT(""))
Definition: BatchCommands.cpp:665
wxArrayString mCommandChain
Definition: BatchCommands.h:74
void ResetChain()
Definition: BatchCommands.cpp:747
bool ReportAndSkip(const wxString &command, const wxString &params)
Definition: BatchCommands.cpp:755
const wxChar * name
Definition: Distortion.cpp:94
void DeleteFromChain(int index)
Definition: BatchCommands.cpp:737
bool IsFixed(const wxString &name)
Definition: BatchCommands.cpp:792
void RestoreChain(const wxString &name)
Definition: BatchCommands.cpp:799
void AbortBatch()
Definition: BatchCommands.cpp:717
bool WriteMp3File(const wxString &Name, int bitrate)
Definition: BatchCommands.cpp:461
EffectDistortion::Params params
Definition: Distortion.cpp:95
static wxString GetCurrentParamsFor(const wxString &command)
Definition: BatchCommands.cpp:310
bool AddChain(const wxString &chain)
Definition: BatchCommands.cpp:221