2010-01-23 19:44:49 +00:00
|
|
|
/**********************************************************************
|
|
|
|
|
|
|
|
Audacity: A Digital Audio Editor
|
|
|
|
|
|
|
|
BatchCommands.h
|
|
|
|
|
|
|
|
Dominic Mazzoni
|
|
|
|
James Crook
|
|
|
|
|
|
|
|
**********************************************************************/
|
|
|
|
|
|
|
|
#ifndef __AUDACITY_BATCH_COMMANDS_DIALOG__
|
|
|
|
#define __AUDACITY_BATCH_COMMANDS_DIALOG__
|
|
|
|
|
|
|
|
#include <wx/defs.h>
|
|
|
|
#include <wx/string.h>
|
|
|
|
|
|
|
|
#include "export/Export.h"
|
|
|
|
|
|
|
|
class Effect;
|
|
|
|
|
2016-02-24 06:06:39 +00:00
|
|
|
class BatchCommands final {
|
2010-01-23 19:44:49 +00:00
|
|
|
public:
|
|
|
|
// constructors and destructors
|
|
|
|
BatchCommands();
|
|
|
|
public:
|
|
|
|
bool ApplyChain(const wxString & filename = wxT(""));
|
2015-04-23 14:07:25 +00:00
|
|
|
bool ApplyCommand( const wxString & command, const wxString & params );
|
2010-01-23 19:44:49 +00:00
|
|
|
bool ApplyCommandInBatchMode(const wxString & command, const wxString ¶ms);
|
2015-04-23 14:07:25 +00:00
|
|
|
bool ApplySpecialCommand(int iCommand, const wxString & command,const wxString & params);
|
|
|
|
bool ApplyEffectCommand(const PluginID & ID, const wxString & command, const wxString & params);
|
|
|
|
bool ReportAndSkip( const wxString & command, const wxString & params );
|
2010-01-23 19:44:49 +00:00
|
|
|
void AbortBatch();
|
|
|
|
|
|
|
|
// Utility functions for the special commands.
|
2016-02-23 02:18:11 +00:00
|
|
|
wxString BuildCleanFileName(const wxString &fileName, const wxString &extension);
|
2015-04-23 14:07:25 +00:00
|
|
|
bool WriteMp3File( const wxString & Name, int bitrate );
|
2010-01-23 19:44:49 +00:00
|
|
|
double GetEndTime();
|
|
|
|
bool IsMono();
|
|
|
|
|
|
|
|
// These commands do not depend on the command list.
|
2015-04-27 14:22:47 +00:00
|
|
|
static wxArrayString GetNames();
|
2010-01-23 19:44:49 +00:00
|
|
|
static wxArrayString GetAllCommands();
|
|
|
|
|
2015-04-27 14:22:47 +00:00
|
|
|
static wxString GetCurrentParamsFor(const wxString & command);
|
|
|
|
static wxString PromptForParamsFor(const wxString & command, const wxString & params, wxWindow *parent);
|
|
|
|
static wxString PromptForPresetFor(const wxString & command, const wxString & params, wxWindow *parent);
|
|
|
|
|
2014-06-03 20:30:19 +00:00
|
|
|
// These commands do depend on the command list.
|
2010-01-23 19:44:49 +00:00
|
|
|
void ResetChain();
|
|
|
|
|
|
|
|
bool ReadChain(const wxString & chain);
|
|
|
|
bool WriteChain(const wxString & chain);
|
|
|
|
bool AddChain(const wxString & chain);
|
|
|
|
bool DeleteChain(const wxString & name);
|
|
|
|
bool RenameChain(const wxString & oldchain, const wxString & newchain);
|
|
|
|
|
|
|
|
void AddToChain(const wxString & command, int before = -1);
|
|
|
|
void AddToChain(const wxString & command, const wxString & params, int before = -1);
|
|
|
|
void DeleteFromChain(int index);
|
|
|
|
wxString GetCommand(int index);
|
|
|
|
wxString GetParams(int index);
|
|
|
|
int GetCount();
|
|
|
|
|
|
|
|
void SetWavToMp3Chain();
|
|
|
|
|
|
|
|
bool IsFixed(const wxString & name);
|
|
|
|
|
|
|
|
void RestoreChain(const wxString & name);
|
|
|
|
|
|
|
|
void Split(const wxString & str, wxString & command, wxString & param);
|
|
|
|
wxString Join(const wxString & command, const wxString & param);
|
|
|
|
|
|
|
|
wxArrayString mCommandChain;
|
|
|
|
wxArrayString mParamsChain;
|
|
|
|
bool mAbort;
|
|
|
|
|
|
|
|
Exporter mExporter;
|
|
|
|
wxString mFileName;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|