Audacity  2.2.0
BatchCommands.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  BatchCommands.h
6 
7  Dominic Mazzoni
8  James Crook
9 
10 **********************************************************************/
11 
12 #ifndef __AUDACITY_BATCH_COMMANDS_DIALOG__
13 #define __AUDACITY_BATCH_COMMANDS_DIALOG__
14 
15 #include <wx/defs.h>
16 #include <wx/string.h>
17 
18 #include "export/Export.h"
19 
20 class Effect;
21 
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();
34 
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();
40 
41  // These commands do not depend on the command list.
42  static wxArrayString GetNames();
43  static wxArrayString GetAllCommands();
44 
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);
48 
49  // These commands do depend on the command list.
50  void ResetChain();
51 
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);
57 
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();
64 
65  void SetWavToMp3Chain();
66 
67  bool IsFixed(const wxString & name);
68 
69  void RestoreChain(const wxString & name);
70 
71  void Split(const wxString & str, wxString & command, wxString & param);
72  wxString Join(const wxString & command, const wxString & param);
73 
74  wxArrayString mCommandChain;
75  wxArrayString mParamsChain;
76  bool mAbort;
77 
79  wxString mFileName;
80 };
81 
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
BatchCommands()
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:720
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:828
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:774
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:806
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:745
bool ReportAndSkip(const wxString &command, const wxString &params)
Definition: BatchCommands.cpp:753
const wxChar * name
Definition: Distortion.cpp:94
void DeleteFromChain(int index)
Definition: BatchCommands.cpp:735
bool IsFixed(const wxString &name)
Definition: BatchCommands.cpp:790
void RestoreChain(const wxString &name)
Definition: BatchCommands.cpp:797
void AbortBatch()
Definition: BatchCommands.cpp:715
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