audacia/src/BatchProcessDialog.h

150 lines
3.9 KiB
C
Raw Normal View History

/**********************************************************************
Audacity: A Digital Audio Editor
BatchProcessDialog.h
Dominic Mazzoni
James Crook
**********************************************************************/
#ifndef __AUDACITY_MACROS_WINDOW__
#define __AUDACITY_MACROS_WINDOW__
#include <wx/defs.h>
#include "BatchCommands.h"
#include "Prefs.h"
class wxWindow;
class wxTextCtrl;
class wxListCtrl;
class wxListEvent;
class wxButton;
Automation: AudacityCommand This is a squash of 50 commits. This merges the capabilities of BatchCommands and Effects using a new AudacityCommand class. AudacityCommand provides one function to specify the parameters, and then we leverage that one function in automation, whether by chains, mod-script-pipe or (future) Nyquist. - Now have AudacityCommand which is using the same mechanism as Effect - Has configurable parameters - Has data-entry GUI (built using shuttle GUI) - Registers with PluginManager. - Menu commands now provided in chains, and to python batch. - Tested with Zoom Toggle. - ShuttleParams now can set, get, set defaults, validate and specify the parameters. - Bugfix: Don't overwrite values with defaults first time out. - Add DefineParams function for all built-in effects. - Extend CommandContext to carry output channels for results. We abuse EffectsManager. It handles both Effects and AudacityCommands now. In time an Effect should become a special case of AudacityCommand and we'll split and rename the EffectManager class. - Don't use 'default' as a parameter name. - Massive renaming for CommandDefinitionInterface - EffectIdentInterface becomes EffectDefinitionInterface - EffectAutomationParameters becomes CommandAutomationParameters - PluginType is now a bit field. This way we can search for related types at the same time. - Most old batch commands made into AudacityCommands. The ones that weren't are for a reason. They are used by mod-script-pipe to carry commands and responses across from a non-GUI thread to the GUI thread. - Major tidy up of ScreenshotCommand - Reworking of SelectCommand - GetPreferenceCommand and SetPreferenceCommand - GetTrackInfo and SetTrackInfo - GetInfoCommand - Help, Open, Save, Import and Export commands. - Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo which are now better handled by other commands. - JSONify "GetInfo: Commands" output, i.e. commas in the right places. - General work on better Doxygen. - Lyrics -> LyricsPanel - Meter -> MeterPanel - Updated Linux makefile. - Scripting commands added into Extra menu. - Distinct names for previously duplicated find-clipping parameters. - Fixed longstanding error with erroneous status field number which previously caused an ASSERT in debug. - Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-01-14 18:51:41 +00:00
class wxTextCtrl;
class AudacityProject;
class ShuttleGui;
class ApplyMacroDialog : public wxDialogWrapper {
public:
// constructors and destructors
ApplyMacroDialog(
wxWindow * parent, AudacityProject &project, bool bInherited=false);
virtual ~ApplyMacroDialog();
public:
// Populate methods NOT virtual.
void Populate();
void PopulateOrExchange( ShuttleGui & S );
virtual void OnApplyToProject(wxCommandEvent & event);
virtual void OnApplyToFiles(wxCommandEvent & event);
virtual void OnCancel(wxCommandEvent & event);
virtual void OnHelp(wxCommandEvent & event);
virtual ManualPageID GetHelpPageName() {return "Apply_Macro";}
void PopulateMacros();
static CommandID MacroIdOfName( const wxString & MacroName );
void ApplyMacroToProject( int iMacro, bool bHasGui=true );
void ApplyMacroToProject( const CommandID & MacroID, bool bHasGui=true );
2018-03-02 21:56:24 +00:00
// These will be reused in the derived class...
wxListCtrl *mList;
wxListCtrl *mMacros;
MacroCommands mMacroCommands; /// Provides list of available commands.
wxButton *mResize;
wxButton *mOK;
wxButton *mCancel;
Automation: AudacityCommand This is a squash of 50 commits. This merges the capabilities of BatchCommands and Effects using a new AudacityCommand class. AudacityCommand provides one function to specify the parameters, and then we leverage that one function in automation, whether by chains, mod-script-pipe or (future) Nyquist. - Now have AudacityCommand which is using the same mechanism as Effect - Has configurable parameters - Has data-entry GUI (built using shuttle GUI) - Registers with PluginManager. - Menu commands now provided in chains, and to python batch. - Tested with Zoom Toggle. - ShuttleParams now can set, get, set defaults, validate and specify the parameters. - Bugfix: Don't overwrite values with defaults first time out. - Add DefineParams function for all built-in effects. - Extend CommandContext to carry output channels for results. We abuse EffectsManager. It handles both Effects and AudacityCommands now. In time an Effect should become a special case of AudacityCommand and we'll split and rename the EffectManager class. - Don't use 'default' as a parameter name. - Massive renaming for CommandDefinitionInterface - EffectIdentInterface becomes EffectDefinitionInterface - EffectAutomationParameters becomes CommandAutomationParameters - PluginType is now a bit field. This way we can search for related types at the same time. - Most old batch commands made into AudacityCommands. The ones that weren't are for a reason. They are used by mod-script-pipe to carry commands and responses across from a non-GUI thread to the GUI thread. - Major tidy up of ScreenshotCommand - Reworking of SelectCommand - GetPreferenceCommand and SetPreferenceCommand - GetTrackInfo and SetTrackInfo - GetInfoCommand - Help, Open, Save, Import and Export commands. - Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo which are now better handled by other commands. - JSONify "GetInfo: Commands" output, i.e. commas in the right places. - General work on better Doxygen. - Lyrics -> LyricsPanel - Meter -> MeterPanel - Updated Linux makefile. - Scripting commands added into Extra menu. - Distinct names for previously duplicated find-clipping parameters. - Fixed longstanding error with erroneous status field number which previously caused an ASSERT in debug. - Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-01-14 18:51:41 +00:00
wxTextCtrl *mResults;
bool mAbort;
bool mbExpanded;
wxString mActiveMacro;
wxString mMacroBeingRenamed;
protected:
AudacityProject &mProject;
const MacroCommandsCatalog mCatalog;
DECLARE_EVENT_TABLE()
};
class MacrosWindow final : public ApplyMacroDialog,
public PrefsListener
{
public:
MacrosWindow(
wxWindow * parent, AudacityProject &project, bool bExpanded=true);
~MacrosWindow();
void UpdateDisplay( bool bExpanded );
private:
TranslatableString WindowTitle() const;
void Populate();
void PopulateOrExchange(ShuttleGui &S);
void OnApplyToProject(wxCommandEvent & event) override;
void OnApplyToFiles(wxCommandEvent & event) override;
void OnCancel(wxCommandEvent &event) override;
virtual ManualPageID GetHelpPageName() override {return
2018-03-15 19:43:38 +00:00
mbExpanded ? "Manage_Macros"
: "Apply_Macro";}
void PopulateList();
void AddItem(const CommandID &command, wxString const &params);
bool ChangeOK();
void UpdateMenus();
void ShowActiveMacro();
void OnMacroSelected(wxListEvent &event);
2013-03-10 09:05:41 +00:00
void OnListSelected(wxListEvent &event);
void OnMacrosBeginEdit(wxListEvent &event);
void OnMacrosEndEdit(wxListEvent &event);
void OnAdd(wxCommandEvent &event);
void OnRemove(wxCommandEvent &event);
void OnRename(wxCommandEvent &event);
void OnRestore(wxCommandEvent &event);
void OnImport(wxCommandEvent &event);
void OnExport(wxCommandEvent &event);
void OnSave(wxCommandEvent &event);
void OnExpand(wxCommandEvent &event);
void OnShrink(wxCommandEvent &event);
2013-03-10 09:05:41 +00:00
void OnSize(wxSizeEvent &event);
void OnCommandActivated(wxListEvent &event);
void OnInsert(wxCommandEvent &event);
void OnEditCommandParams(wxCommandEvent &event);
void OnDelete(wxCommandEvent &event);
void OnUp(wxCommandEvent &event);
void OnDown(wxCommandEvent &event);
void OnOK(wxCommandEvent &event);
void OnKeyDown(wxKeyEvent &event);
2013-03-10 09:05:41 +00:00
void FitColumns();
void InsertCommandAt(int item);
bool SaveChanges();
// PrefsListener implementation
void UpdatePrefs() override;
AudacityProject &mProject;
wxButton *mRemove;
wxButton *mRename;
wxButton *mRestore;
wxButton *mImport;
wxButton *mExport;
wxButton *mSave;
int mSelectedCommand;
bool mChanged;
2016-09-18 14:26:29 +00:00
DECLARE_EVENT_TABLE()
};
#endif