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
20class wxWindow;
21class wxTextCtrl;
22class wxListCtrl;
23class wxListEvent;
24class wxButton;
25class wxTextCtrl;
26class AudacityProject;
27class ShuttleGui;
28
30 public:
31 // constructors and destructors
33 wxWindow * parent, AudacityProject &project, bool bInherited=false);
34 virtual ~ApplyMacroDialog();
35 public:
36 // Populate methods NOT virtual.
37 void Populate();
39 virtual void OnApplyToProject(wxCommandEvent & event);
40 virtual void OnApplyToFiles(wxCommandEvent & event);
41 virtual void OnCancel(wxCommandEvent & event);
42 virtual void OnHelp(wxCommandEvent & event);
43
44 virtual ManualPageID GetHelpPageName() {return "Apply_Macro";}
45
46 void PopulateMacros();
47 static CommandID MacroIdOfName( const wxString & MacroName );
48 void ApplyMacroToProject( int iMacro, bool bHasGui=true );
49 void ApplyMacroToProject( const CommandID & MacroID, bool bHasGui=true );
50
51 // These will be reused in the derived class...
52 wxListCtrl *mList;
53 wxListCtrl *mMacros;
55
56 wxButton *mResize;
57 wxButton *mOK;
58 wxButton *mCancel;
59 wxTextCtrl *mResults;
60 bool mAbort;
62 wxString mActiveMacro;
64
65protected:
68
69 DECLARE_EVENT_TABLE()
70};
71
72class MacrosWindow final : public ApplyMacroDialog,
73 public PrefsListener
74{
75public:
77 wxWindow * parent, AudacityProject &project, bool bExpanded=true);
79 void UpdateDisplay( bool bExpanded );
80
81private:
83
84 void Populate();
86 void OnApplyToProject(wxCommandEvent & event) override;
87 void OnApplyToFiles(wxCommandEvent & event) override;
88 void OnCancel(wxCommandEvent &event) override;
89
90 virtual ManualPageID GetHelpPageName() override {return
91 mbExpanded ? "Manage_Macros"
92 : "Apply_Macro";}
93
94 void PopulateList();
95 void AddItem(const CommandID &command, wxString const &params);
96 bool ChangeOK();
97 void UpdateMenus();
98 void ShowActiveMacro();
99
100 void OnMacroSelected(wxListEvent &event);
101 void OnListSelected(wxListEvent &event);
102 void OnMacrosBeginEdit(wxListEvent &event);
103 void OnMacrosEndEdit(wxListEvent &event);
104 void OnAdd(wxCommandEvent &event);
105 void OnRemove(wxCommandEvent &event);
106 void OnRename(wxCommandEvent &event);
107 void OnRestore(wxCommandEvent &event);
108 void OnImport(wxCommandEvent &event);
109 void OnExport(wxCommandEvent &event);
110 void OnSave(wxCommandEvent &event);
111
112 void OnExpand(wxCommandEvent &event);
113 void OnShrink(wxCommandEvent &event);
114 void OnSize(wxSizeEvent &event);
115
116 void OnCommandActivated(wxListEvent &event);
117 void OnInsert(wxCommandEvent &event);
118 void OnEditCommandParams(wxCommandEvent &event);
119
120 void OnDelete(wxCommandEvent &event);
121 void OnUp(wxCommandEvent &event);
122 void OnDown(wxCommandEvent &event);
123
124 void OnOK(wxCommandEvent &event);
125
126 void OnKeyDown(wxKeyEvent &event);
127 void FitColumns();
128 void InsertCommandAt(int item);
129 bool SaveChanges();
130
131 // PrefsListener implementation
132 void UpdatePrefs() override;
133
135
136 wxButton *mRemove;
137 wxButton *mRename;
138 wxButton *mRestore;
139 wxButton *mImport;
140 wxButton *mExport;
141 wxButton *mSave;
142
145
146 DECLARE_EVENT_TABLE()
147};
148
149#endif
EffectDistortionSettings params
Definition: Distortion.cpp:75
wxString MacroID
Definition: Menus.h:32
#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:56
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:556
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:628
Holds a msgid for the translation catalog; may also bind format arguments.