Audacity 3.2.0
BatchProcessDialog.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 BatchProcessDialog.h
6
7 Dominic Mazzoni
8 James Crook
9
10**********************************************************************/
11
12#ifndef __AUDACITY_MACROS_WINDOW__
13#define __AUDACITY_MACROS_WINDOW__
14
15#include <wx/defs.h>
16
17#include "BatchCommands.h"
18#include "Prefs.h"
19#include "wxPanelWrapper.h"
20
21class wxWindow;
22class wxTextCtrl;
23class wxListCtrl;
24class wxListEvent;
25class wxButton;
26class wxTextCtrl;
27class AudacityProject;
28class ShuttleGui;
29
31 public:
32 // constructors and destructors
34 wxWindow * parent, AudacityProject &project, bool bInherited=false);
35 virtual ~ApplyMacroDialog();
36 public:
37 // Populate methods NOT virtual.
38 void Populate();
40 virtual void OnApplyToProject(wxCommandEvent & event);
41 virtual void OnApplyToFiles(wxCommandEvent & event);
42 virtual void OnCancel(wxCommandEvent & event);
43 virtual void OnHelp(wxCommandEvent & event);
44
45 virtual ManualPageID GetHelpPageName() {return "Apply_Macro";}
46
47 void PopulateMacros();
48 static CommandID MacroIdOfName( const wxString & MacroName );
49 void ApplyMacroToProject( int iMacro, bool bHasGui=true );
50 void ApplyMacroToProject( const CommandID & MacroID, bool bHasGui=true );
51
52 // These will be reused in the derived class...
53 wxListCtrl *mList;
54 wxListCtrl *mMacros;
56
57 wxButton *mResize;
58 wxButton *mOK;
59 wxButton *mCancel;
60 wxTextCtrl *mResults;
61 bool mAbort;
63 wxString mActiveMacro;
65
66protected:
69
70 DECLARE_EVENT_TABLE()
71};
72
73class MacrosWindow final : public ApplyMacroDialog,
74 public PrefsListener
75{
76public:
78 wxWindow * parent, AudacityProject &project, bool bExpanded=true);
80 void UpdateDisplay( bool bExpanded );
81
82private:
84
85 void Populate();
87 void OnApplyToProject(wxCommandEvent & event) override;
88 void OnApplyToFiles(wxCommandEvent & event) override;
89 void OnCancel(wxCommandEvent &event) override;
90
91 virtual ManualPageID GetHelpPageName() override {return
92 mbExpanded ? "Manage_Macros"
93 : "Apply_Macro";}
94
95 void PopulateList();
96 void AddItem(const CommandID &command, wxString const &params);
97 bool ChangeOK();
98 void UpdateMenus();
99 void ShowActiveMacro();
100
101 void OnMacroSelected(wxListEvent &event);
102 void OnListSelected(wxListEvent &event);
103 void OnMacrosBeginEdit(wxListEvent &event);
104 void OnMacrosEndEdit(wxListEvent &event);
105 void OnAdd(wxCommandEvent &event);
106 void OnRemove(wxCommandEvent &event);
107 void OnRename(wxCommandEvent &event);
108 void OnRestore(wxCommandEvent &event);
109 void OnImport(wxCommandEvent &event);
110 void OnExport(wxCommandEvent &event);
111 void OnSave(wxCommandEvent &event);
112
113 void OnExpand(wxCommandEvent &event);
114 void OnShrink(wxCommandEvent &event);
115 void OnSize(wxSizeEvent &event);
116
117 void OnCommandActivated(wxListEvent &event);
118 void OnInsert(wxCommandEvent &event);
119 void OnEditCommandParams(wxCommandEvent &event);
120
121 void OnDelete(wxCommandEvent &event);
122 void OnUp(wxCommandEvent &event);
123 void OnDown(wxCommandEvent &event);
124
125 void OnOK(wxCommandEvent &event);
126
127 void OnKeyDown(wxKeyEvent &event);
128 void FitColumns();
129 void InsertCommandAt(int item);
130 bool SaveChanges();
131
132 // PrefsListener implementation
133 void UpdatePrefs() override;
134
136
137 wxButton *mRemove;
138 wxButton *mRename;
139 wxButton *mRestore;
140 wxButton *mImport;
141 wxButton *mExport;
142 wxButton *mEdit;
143 wxButton *mSave;
144
147
148 DECLARE_EVENT_TABLE()
149};
150
151#endif
EffectDistortionSettings params
const auto project
#define S(N)
Definition: ToChars.cpp:64
Shows progress in executing commands in MacroCommands.
ApplyMacroDialog(wxWindow *parent, AudacityProject &project, bool bInherited=false)
wxButton * mResize
Provides list of available commands.
virtual void OnApplyToFiles(wxCommandEvent &event)
MacroCommands mMacroCommands
AudacityProject & mProject
wxTextCtrl * mResults
wxListCtrl * mMacros
void ApplyMacroToProject(int iMacro, bool bHasGui=true)
virtual void OnCancel(wxCommandEvent &event)
virtual void OnApplyToProject(wxCommandEvent &event)
const MacroCommandsCatalog mCatalog
virtual void OnHelp(wxCommandEvent &event)
void PopulateOrExchange(ShuttleGui &S)
Defines the dialog and does data exchange with it.
virtual ManualPageID GetHelpPageName()
static CommandID MacroIdOfName(const wxString &MacroName)
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
Maintains the list of commands for batch/macro processing. See also MacrosWindow and ApplyMacroDialog...
Definition: BatchCommands.h:60
void PopulateList()
This clears and updates the contents of mList, the commands for the current macro.
TranslatableString WindowTitle() const
void OnDelete(wxCommandEvent &event)
void OnListSelected(wxListEvent &event)
An item in the macros list has been selected.
void OnShrink(wxCommandEvent &event)
void OnExport(wxCommandEvent &event)
wxButton * mRemove
void PopulateOrExchange(ShuttleGui &S)
Defines the dialog and does data exchange with it.
void OnRestore(wxCommandEvent &event)
Reset a built in macro.
void OnCommandActivated(wxListEvent &event)
AudacityProject & mProject
void OnAdd(wxCommandEvent &event)
void OnUp(wxCommandEvent &event)
void OnCancel(wxCommandEvent &event) override
void OnApplyToProject(wxCommandEvent &event) override
void OnMacroSelected(wxListEvent &event)
An item in the macros list has been selected.
void OnExpand(wxCommandEvent &event)
wxButton * mRestore
wxButton * mImport
void OnSave(wxCommandEvent &event)
void OnApplyToFiles(wxCommandEvent &event) override
void UpdateDisplay(bool bExpanded)
void UpdatePrefs() override
void OnMacrosBeginEdit(wxListEvent &event)
void OnSize(wxSizeEvent &event)
The window has been resized.
wxButton * mRename
wxButton * mExport
void OnMacrosEndEdit(wxListEvent &event)
void OnImport(wxCommandEvent &event)
MacrosWindow(wxWindow *parent, AudacityProject &project, bool bExpanded=true)
Constructor.
virtual ManualPageID GetHelpPageName() override
void OnDown(wxCommandEvent &event)
void OnEditCommandParams(wxCommandEvent &event)
void OnInsert(wxCommandEvent &event)
void OnRemove(wxCommandEvent &event)
void InsertCommandAt(int item)
void Populate()
Creates the dialog and its contents.
void AddItem(const CommandID &command, wxString const &params)
Add one item into mList.
void OnKeyDown(wxKeyEvent &event)
void OnOK(wxCommandEvent &event)
Send changed values back to Prefs, and update Audacity.
void OnRename(wxCommandEvent &event)
A listener notified of changes in preferences.
Definition: Prefs.h:652
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:640
Holds a msgid for the translation catalog; may also bind format arguments.