Audacity  2.2.2
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 #include <wx/string.h>
17 
18 
19 #ifdef __WXMSW__
20  #include <wx/ownerdrw.h>
21 #endif
22 
23 //#include "wx/log.h"
24 #include <wx/sizer.h>
25 #include <wx/menuitem.h>
26 #include <wx/checklst.h>
27 
28 #include "BatchCommands.h"
29 
30 class wxWindow;
31 class wxCheckBox;
32 class wxChoice;
33 class wxTextCtrl;
34 class wxStaticText;
35 class wxRadioButton;
36 class wxListCtrl;
37 class wxListEvent;
38 class wxButton;
39 class wxTextCtrl;
40 class ShuttleGui;
41 
43  public:
44  // constructors and destructors
45  ApplyMacroDialog(wxWindow * parent, bool bInherited=false);
46  virtual ~ApplyMacroDialog();
47  public:
48  // Populate methods NOT virtual.
49  void Populate();
50  void PopulateOrExchange( ShuttleGui & S );
51  virtual void OnApplyToProject(wxCommandEvent & event);
52  virtual void OnApplyToFiles(wxCommandEvent & event);
53  virtual void OnCancel(wxCommandEvent & event);
54  virtual void OnHelp(wxCommandEvent & event);
55 
56  virtual wxString GetHelpPageName() {return "Apply_Macro";};
57 
58  void PopulateMacros();
59  static wxString MacroIdOfName( const wxString & MacroName );
60  void ApplyMacroToProject( int iMacro, bool bHasGui=true );
61  void ApplyMacroToProject( const wxString & MacroID, bool bHasGui=true );
62 
63 
64  // These will be reused in the derived class...
65  wxListCtrl *mList;
66  wxListCtrl *mMacros;
68 
69  wxButton *mResize;
70  wxButton *mOK;
71  wxButton *mCancel;
72  wxTextCtrl *mResults;
73  bool mAbort;
74  bool mbExpanded;
75  wxString mActiveMacro;
76 
77 protected:
79 
80  DECLARE_EVENT_TABLE()
81 };
82 
83 class MacrosWindow final : public ApplyMacroDialog
84 {
85 public:
86  MacrosWindow(wxWindow * parent, bool bExpanded=true);
87  ~MacrosWindow();
88  void UpdateDisplay( bool bExpanded );
89 
90 private:
91  void Populate();
93  void OnApplyToProject(wxCommandEvent & event) override;
94  void OnApplyToFiles(wxCommandEvent & event) override;
95  void OnCancel(wxCommandEvent &event) override;
96 
97  virtual wxString GetHelpPageName() override {return
98  mbExpanded ? "Manage_Macros"
99  : "Apply_Macro";};
100 
101  void PopulateList();
102  void AddItem(const wxString &command, wxString const &params);
103  bool ChangeOK();
104  void UpdateMenus();
105 
106  void OnMacroSelected(wxListEvent &event);
107  void OnListSelected(wxListEvent &event);
108  void OnMacrosBeginEdit(wxListEvent &event);
109  void OnMacrosEndEdit(wxListEvent &event);
110  void OnAdd(wxCommandEvent &event);
111  void OnRemove(wxCommandEvent &event);
112  void OnRename(wxCommandEvent &event);
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  void OnDefaults(wxCommandEvent &event);
125 
126  void OnOK(wxCommandEvent &event);
127 
128  void OnKeyDown(wxKeyEvent &event);
129  void FitColumns();
130  void InsertCommandAt(int item);
131  bool SaveChanges();
132 
133  wxButton *mRemove;
134  wxButton *mRename;
135  wxButton *mDefaults;
136 
138  bool mChanged;
139 
140  DECLARE_EVENT_TABLE()
141 };
142 
143 #endif
void OnApplyToProject(wxCommandEvent &event) override
wxListCtrl * mMacros
virtual void OnHelp(wxCommandEvent &event)
virtual void OnApplyToProject(wxCommandEvent &event)
MacroCommands mMacroCommands
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI...
Definition: ShuttleGui.h:409
void OnDelete(wxCommandEvent &event)
virtual void OnCancel(wxCommandEvent &event)
void OnInsert(wxCommandEvent &event)
void OnApplyToFiles(wxCommandEvent &event) override
void OnKeyDown(wxKeyEvent &event)
void OnUp(wxCommandEvent &event)
Maintains the list of commands for batch/macro processing. See also MacrosWindow and ApplyMacroDialog...
Definition: BatchCommands.h:52
virtual void OnApplyToFiles(wxCommandEvent &event)
void OnAdd(wxCommandEvent &event)
void OnRemove(wxCommandEvent &event)
void OnMacroSelected(wxListEvent &event)
An item in the macros list has been selected.
wxButton * mDefaults
void OnListSelected(wxListEvent &event)
An item in the macros list has been selected.
void InsertCommandAt(int item)
MacrosWindow(wxWindow *parent, bool bExpanded=true)
Constructor.
void PopulateList()
This clears and updates the contents of mList, the commands for the current macro.
void ApplyMacroToProject(int iMacro, bool bHasGui=true)
void AddItem(const wxString &command, wxString const &params)
Add one item into mList.
void OnEditCommandParams(wxCommandEvent &event)
wxButton * mRemove
const MacroCommandsCatalog mCatalog
void PopulateOrExchange(ShuttleGui &S)
Defines the dialog and does data exchange with it.
void OnDefaults(wxCommandEvent &event)
Select the empty Command macro.
void OnSize(wxSizeEvent &event)
The window has been resized.
wxTextCtrl * mResults
virtual wxString GetHelpPageName()
void OnCommandActivated(wxListEvent &event)
void PopulateOrExchange(ShuttleGui &S)
Defines the dialog and does data exchange with it.
ApplyMacroDialog(wxWindow *parent, bool bInherited=false)
void OnMacrosBeginEdit(wxListEvent &event)
void UpdateDisplay(bool bExpanded)
void OnMacrosEndEdit(wxListEvent &event)
wxButton * mResize
Provides list of available commands.
void OnDown(wxCommandEvent &event)
void OnExpand(wxCommandEvent &event)
void OnShrink(wxCommandEvent &event)
void Populate()
Creates the dialog and its contents.
virtual wxString GetHelpPageName() override
void OnRename(wxCommandEvent &event)
EffectDistortion::Params params
Definition: Distortion.cpp:95
Shows progress in executing commands in MacroCommands.
static wxString MacroIdOfName(const wxString &MacroName)
void OnCancel(wxCommandEvent &event) override
void OnOK(wxCommandEvent &event)
Send changed values back to Prefs, and update Audacity.
wxButton * mRename