2010-01-23 19:44:49 +00:00
|
|
|
/**********************************************************************
|
|
|
|
|
|
|
|
Audacity: A Digital Audio Editor
|
|
|
|
|
|
|
|
BatchProcessDialog.h
|
|
|
|
|
|
|
|
Dominic Mazzoni
|
|
|
|
James Crook
|
|
|
|
|
|
|
|
**********************************************************************/
|
|
|
|
|
2018-03-03 19:08:23 +00:00
|
|
|
#ifndef __AUDACITY_MACROS_WINDOW__
|
|
|
|
#define __AUDACITY_MACROS_WINDOW__
|
2010-01-23 19:44:49 +00:00
|
|
|
|
|
|
|
#include <wx/defs.h>
|
|
|
|
|
|
|
|
#include "BatchCommands.h"
|
2021-02-14 07:25:52 +00:00
|
|
|
#include "Prefs.h"
|
2010-01-23 19:44:49 +00:00
|
|
|
|
|
|
|
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;
|
2019-05-22 00:16:20 +00:00
|
|
|
class AudacityProject;
|
2015-06-18 14:24:36 +00:00
|
|
|
class ShuttleGui;
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2018-03-03 19:08:23 +00:00
|
|
|
class ApplyMacroDialog : public wxDialogWrapper {
|
2010-01-23 19:44:49 +00:00
|
|
|
public:
|
|
|
|
// constructors and destructors
|
2019-05-22 00:16:20 +00:00
|
|
|
ApplyMacroDialog(
|
|
|
|
wxWindow * parent, AudacityProject &project, bool bInherited=false);
|
2018-03-03 19:08:23 +00:00
|
|
|
virtual ~ApplyMacroDialog();
|
2010-01-23 19:44:49 +00:00
|
|
|
public:
|
2018-03-03 18:01:40 +00:00
|
|
|
// Populate methods NOT virtual.
|
|
|
|
void Populate();
|
|
|
|
void PopulateOrExchange( ShuttleGui & S );
|
2018-03-01 17:54:08 +00:00
|
|
|
virtual void OnApplyToProject(wxCommandEvent & event);
|
|
|
|
virtual void OnApplyToFiles(wxCommandEvent & event);
|
|
|
|
virtual void OnCancel(wxCommandEvent & event);
|
2018-03-03 10:15:09 +00:00
|
|
|
virtual void OnHelp(wxCommandEvent & event);
|
|
|
|
|
2021-06-06 16:18:35 +00:00
|
|
|
virtual ManualPageID GetHelpPageName() {return "Apply_Macro";}
|
2018-03-03 10:15:09 +00:00
|
|
|
|
2018-03-03 19:08:23 +00:00
|
|
|
void PopulateMacros();
|
2019-03-11 02:05:37 +00:00
|
|
|
static CommandID MacroIdOfName( const wxString & MacroName );
|
2018-03-03 19:08:23 +00:00
|
|
|
void ApplyMacroToProject( int iMacro, bool bHasGui=true );
|
2019-03-11 02:05:37 +00:00
|
|
|
void ApplyMacroToProject( const CommandID & MacroID, bool bHasGui=true );
|
2018-03-02 21:56:24 +00:00
|
|
|
|
2018-03-01 17:54:08 +00:00
|
|
|
// These will be reused in the derived class...
|
|
|
|
wxListCtrl *mList;
|
2018-03-03 19:08:23 +00:00
|
|
|
wxListCtrl *mMacros;
|
|
|
|
MacroCommands mMacroCommands; /// Provides list of available commands.
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2018-03-05 15:13:42 +00:00
|
|
|
wxButton *mResize;
|
2010-01-23 19:44:49 +00:00
|
|
|
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;
|
2010-01-23 19:44:49 +00:00
|
|
|
bool mAbort;
|
2018-03-03 22:20:25 +00:00
|
|
|
bool mbExpanded;
|
2018-03-03 19:08:23 +00:00
|
|
|
wxString mActiveMacro;
|
2019-07-16 09:17:55 +00:00
|
|
|
wxString mMacroBeingRenamed;
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2018-03-08 04:42:57 +00:00
|
|
|
protected:
|
2019-05-22 11:07:57 +00:00
|
|
|
AudacityProject &mProject;
|
2018-03-08 04:42:57 +00:00
|
|
|
const MacroCommandsCatalog mCatalog;
|
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
};
|
|
|
|
|
2021-02-14 07:25:52 +00:00
|
|
|
class MacrosWindow final : public ApplyMacroDialog,
|
|
|
|
public PrefsListener
|
2010-01-23 19:44:49 +00:00
|
|
|
{
|
|
|
|
public:
|
2019-05-22 00:16:20 +00:00
|
|
|
MacrosWindow(
|
|
|
|
wxWindow * parent, AudacityProject &project, bool bExpanded=true);
|
2018-03-03 19:08:23 +00:00
|
|
|
~MacrosWindow();
|
2018-03-03 18:01:40 +00:00
|
|
|
void UpdateDisplay( bool bExpanded );
|
2010-01-23 19:44:49 +00:00
|
|
|
|
|
|
|
private:
|
2019-12-07 19:30:07 +00:00
|
|
|
TranslatableString WindowTitle() const;
|
|
|
|
|
2018-03-03 18:01:40 +00:00
|
|
|
void Populate();
|
|
|
|
void PopulateOrExchange(ShuttleGui &S);
|
2018-03-01 17:54:08 +00:00
|
|
|
void OnApplyToProject(wxCommandEvent & event) override;
|
|
|
|
void OnApplyToFiles(wxCommandEvent & event) override;
|
|
|
|
void OnCancel(wxCommandEvent &event) override;
|
|
|
|
|
2021-06-06 16:18:35 +00:00
|
|
|
virtual ManualPageID GetHelpPageName() override {return
|
2018-03-15 19:43:38 +00:00
|
|
|
mbExpanded ? "Manage_Macros"
|
2021-06-06 16:18:35 +00:00
|
|
|
: "Apply_Macro";}
|
2018-03-01 17:54:08 +00:00
|
|
|
|
2013-02-20 23:42:58 +00:00
|
|
|
void PopulateList();
|
2019-03-11 02:05:37 +00:00
|
|
|
void AddItem(const CommandID &command, wxString const ¶ms);
|
2010-01-23 19:44:49 +00:00
|
|
|
bool ChangeOK();
|
2018-03-02 22:13:41 +00:00
|
|
|
void UpdateMenus();
|
2020-08-22 12:41:18 +00:00
|
|
|
void ShowActiveMacro();
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2018-03-03 19:08:23 +00:00
|
|
|
void OnMacroSelected(wxListEvent &event);
|
2013-03-10 09:05:41 +00:00
|
|
|
void OnListSelected(wxListEvent &event);
|
2018-03-03 19:08:23 +00:00
|
|
|
void OnMacrosBeginEdit(wxListEvent &event);
|
|
|
|
void OnMacrosEndEdit(wxListEvent &event);
|
2010-01-23 19:44:49 +00:00
|
|
|
void OnAdd(wxCommandEvent &event);
|
|
|
|
void OnRemove(wxCommandEvent &event);
|
|
|
|
void OnRename(wxCommandEvent &event);
|
2019-07-16 06:37:07 +00:00
|
|
|
void OnRestore(wxCommandEvent &event);
|
2020-08-09 02:17:14 +00:00
|
|
|
void OnImport(wxCommandEvent &event);
|
|
|
|
void OnExport(wxCommandEvent &event);
|
2021-03-22 17:45:54 +00:00
|
|
|
void OnSave(wxCommandEvent &event);
|
|
|
|
|
2018-03-03 22:20:25 +00:00
|
|
|
void OnExpand(wxCommandEvent &event);
|
|
|
|
void OnShrink(wxCommandEvent &event);
|
2013-03-10 09:05:41 +00:00
|
|
|
void OnSize(wxSizeEvent &event);
|
2010-01-23 19:44:49 +00:00
|
|
|
|
|
|
|
void OnCommandActivated(wxListEvent &event);
|
|
|
|
void OnInsert(wxCommandEvent &event);
|
2018-03-01 17:54:08 +00:00
|
|
|
void OnEditCommandParams(wxCommandEvent &event);
|
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
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();
|
2018-03-01 17:54:08 +00:00
|
|
|
void InsertCommandAt(int item);
|
|
|
|
bool SaveChanges();
|
|
|
|
|
2021-02-14 07:25:52 +00:00
|
|
|
// PrefsListener implementation
|
|
|
|
void UpdatePrefs() override;
|
|
|
|
|
2019-05-22 01:04:18 +00:00
|
|
|
AudacityProject &mProject;
|
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
wxButton *mRemove;
|
|
|
|
wxButton *mRename;
|
2019-07-16 06:37:07 +00:00
|
|
|
wxButton *mRestore;
|
2020-08-09 02:17:14 +00:00
|
|
|
wxButton *mImport;
|
|
|
|
wxButton *mExport;
|
2021-03-22 17:45:54 +00:00
|
|
|
wxButton *mSave;
|
2010-01-23 19:44:49 +00:00
|
|
|
|
|
|
|
int mSelectedCommand;
|
|
|
|
bool mChanged;
|
|
|
|
|
2016-09-18 14:26:29 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
2010-01-23 19:44:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|