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_BATCH_PROCESS_DIALOG__
13 #define __AUDACITY_BATCH_PROCESS_DIALOG__
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 ShuttleGui;
40 
41 class BatchProcessDialog final : public wxDialogWrapper {
42  public:
43  // constructors and destructors
44  BatchProcessDialog(wxWindow * parent);
45  virtual ~BatchProcessDialog();
46  public:
47  void Populate();
48  void PopulateOrExchange( ShuttleGui & S );
49 
50  void OnApplyToProject(wxCommandEvent & event);
51  void OnApplyToFiles(wxCommandEvent & event);
52  void OnCancel(wxCommandEvent & event);
53 
54  wxButton *mOK;
55  wxButton *mCancel;
56  wxListCtrl *mChains;
57  wxListCtrl *mList;
59 
60  bool mAbort;
61 
62  DECLARE_EVENT_TABLE()
63 };
64 
65 class EditChainsDialog final : public wxDialogWrapper
66 {
67 public:
68  EditChainsDialog(wxWindow * parent);
70 
71 private:
72  void Populate();
74  void PopulateChains();
75  void PopulateList();
76  void AddItem(const wxString &command, wxString const &params);
77  bool ChangeOK();
78 
79  void OnChainSelected(wxListEvent &event);
80  void OnListSelected(wxListEvent &event);
81  void OnChainsBeginEdit(wxListEvent &event);
82  void OnChainsEndEdit(wxListEvent &event);
83  void OnAdd(wxCommandEvent &event);
84  void OnRemove(wxCommandEvent &event);
85  void OnRename(wxCommandEvent &event);
86  void OnSize(wxSizeEvent &event);
87 
88  void OnCommandActivated(wxListEvent &event);
89  void OnInsert(wxCommandEvent &event);
90  void OnDelete(wxCommandEvent &event);
91  void OnUp(wxCommandEvent &event);
92  void OnDown(wxCommandEvent &event);
93  void OnDefaults(wxCommandEvent &event);
94 
95  void OnOK(wxCommandEvent &event);
96  void OnCancel(wxCommandEvent &event);
97 
98  void OnKeyDown(wxKeyEvent &event);
99  void FitColumns();
100 
101  wxListCtrl *mChains;
102  wxListCtrl *mList;
103  wxButton *mRemove;
104  wxButton *mRename;
105  wxButton *mDefaults;
106 
108  wxString mActiveChain;
109 
111  bool mChanged;
112 
113  using CommandName = std::pair<wxString, wxString>;
114  using CommandNameVector = std::vector<CommandName>;
116 
117  DECLARE_EVENT_TABLE()
118 };
119 
120 #endif
void OnChainsEndEdit(wxListEvent &event)
void PopulateList()
This clears and updates the contents of mList.
EditChainsDialog(wxWindow *parent)
Constructor.
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI...
Definition: ShuttleGui.h:366
void OnCancel(wxCommandEvent &event)
void AddItem(const wxString &command, wxString const &params)
Add one item into mList.
std::pair< wxString, wxString > CommandName
void OnDefaults(wxCommandEvent &event)
Select the empty Command chain.
void OnUp(wxCommandEvent &event)
CommandNameVector mCommandNames
void OnListSelected(wxListEvent &event)
An item in the chains list has been selected.
void PopulateOrExchange(ShuttleGui &S)
Defines the dialog and does data exchange with it.
void OnDown(wxCommandEvent &event)
void Populate()
Creates the dialog and its contents.
void OnInsert(wxCommandEvent &event)
Shows progress in executing commands in BatchCommands.
void OnAdd(wxCommandEvent &event)
void OnSize(wxSizeEvent &event)
The window has been resized.
void OnApplyToFiles(wxCommandEvent &event)
wxButton * mRemove
List of commands in current command chain.
void OnChainsBeginEdit(wxListEvent &event)
void OnRename(wxCommandEvent &event)
BatchCommands mBatchCommands
wxListCtrl * mList
List of chains.
void OnKeyDown(wxKeyEvent &event)
Maintains the chain of commands used in batch processing. See also BatchCommandDialog and BatchProces...
Definition: BatchCommands.h:22
void OnRemove(wxCommandEvent &event)
BatchCommands mBatchCommands
void OnDelete(wxCommandEvent &event)
void PopulateOrExchange(ShuttleGui &S)
Defines the dialog and does data exchange with it.
BatchProcessDialog(wxWindow *parent)
void OnApplyToProject(wxCommandEvent &event)
void OnOK(wxCommandEvent &event)
Send changed values back to Prefs, and update Audacity.
wxString mActiveChain
Provides list of available commands.
void PopulateChains()
This clears and updates the contents of mChains.
EffectDistortion::Params params
Definition: Distortion.cpp:95
std::vector< CommandName > CommandNameVector
void OnCommandActivated(wxListEvent &event)
void OnCancel(wxCommandEvent &event)
void OnChainSelected(wxListEvent &event)
An item in the chains list has been selected.