Audacity  3.2.0
PluginRegistrationDialog.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  PluginRegistrationDialog.h
6 
7  Paul Licameli split from PluginManager.cpp
8 
9 **********************************************************************/
10 #ifndef __AUDACITY_PLUGIN_REGISTRATION_DIALOG__
11 #define __AUDACITY_PLUGIN_REGISTRATION_DIALOG__
12 
13 #include "widgets/wxPanelWrapper.h" // to inherit
14 #include <vector>
15 #include <unordered_map> // member
16 
17 class CheckListAx;
18 enum EffectType : int;
19 class PluginDescriptor;
20 class ShuttleGui;
21 class wxListEvent;
22 class wxListCtrl;
23 
25 {
26 public:
27  // constructors and destructors
28  PluginRegistrationDialog(wxWindow *parent, EffectType type);
29 
30 private:
31  struct ItemData
32  {
33  std::vector<PluginDescriptor*> plugs;
34  wxString name;
36  int state;
37  bool valid;
38  int nameWidth;
39  int pathWidth;
41  };
42 
43  using ItemDataMap = std::unordered_map<PluginPath, ItemData>;
44 
45  void Populate();
47  void RegenerateEffectsList(int iShowWhat);
48  void SetState(int i, bool toggle, bool state = true);
49 
50  static int wxCALLBACK SortCompare(wxIntPtr item1, wxIntPtr item2, wxIntPtr sortData);
51  int SortCompare(ItemData *item1, ItemData *item2);
52 
53  void OnChangedVisibility(wxCommandEvent & evt);
54  void OnSort(wxListEvent & evt);
55  void DoSort( int col );
56  void OnListChar(wxKeyEvent & evt);
57  void OnOK(wxCommandEvent & evt);
58  void OnCancel(wxCommandEvent & evt);
59  void OnSelectAll(wxCommandEvent & evt);
60  void OnClearAll(wxCommandEvent & evt);
61  void OnEnable(wxCommandEvent & evt);
62  void OnDisable(wxCommandEvent & evt);
63 
64 private:
66  int mFilter;
67 
68  wxArrayString mStates;
70 
73 
75 
76  wxListCtrl *mEffects;
77 #if wxUSE_ACCESSIBILITY
78  CheckListAx *mAx;
79 #endif
80 
81  DECLARE_EVENT_TABLE()
82 };
83 
84 
85 #endif
PluginRegistrationDialog::mType
EffectType mType
Definition: PluginRegistrationDialog.h:65
PluginRegistrationDialog::Populate
void Populate()
Definition: PluginRegistrationDialog.cpp:407
PluginRegistrationDialog::ItemData::valid
bool valid
Definition: PluginRegistrationDialog.h:37
PluginRegistrationDialog::SortCompare
static int wxCALLBACK SortCompare(wxIntPtr item1, wxIntPtr item2, wxIntPtr sortData)
Definition: PluginRegistrationDialog.cpp:725
S
#define S(N)
Definition: ToChars.cpp:64
PluginRegistrationDialog::ItemData::name
wxString name
Definition: PluginRegistrationDialog.h:34
PluginRegistrationDialog::mItems
ItemDataMap mItems
Definition: PluginRegistrationDialog.h:69
PluginRegistrationDialog::ItemData::state
int state
Definition: PluginRegistrationDialog.h:36
PluginRegistrationDialog::OnChangedVisibility
void OnChangedVisibility(wxCommandEvent &evt)
Definition: PluginRegistrationDialog.cpp:762
PluginPath
wxString PluginPath
type alias for identifying a Plugin supplied by a module, each module defining its own interpretation...
Definition: Identifier.h:214
wxPanelWrapper.h
PluginRegistrationDialog::OnSort
void OnSort(wxListEvent &evt)
Definition: PluginRegistrationDialog.cpp:768
PluginRegistrationDialog::ItemData
Definition: PluginRegistrationDialog.h:32
PluginRegistrationDialog
Definition: PluginRegistrationDialog.h:25
PluginRegistrationDialog::ItemData::stateWidth
int stateWidth
Definition: PluginRegistrationDialog.h:40
PluginRegistrationDialog::OnDisable
void OnDisable(wxCommandEvent &evt)
Definition: PluginRegistrationDialog.cpp:853
PluginRegistrationDialog::mSortDirection
int mSortDirection
Definition: PluginRegistrationDialog.h:72
PluginRegistrationDialog::PluginRegistrationDialog
PluginRegistrationDialog(wxWindow *parent, EffectType type)
Definition: PluginRegistrationDialog.cpp:383
PluginRegistrationDialog::ItemData::plugs
std::vector< PluginDescriptor * > plugs
Definition: PluginRegistrationDialog.h:33
PluginRegistrationDialog::OnEnable
void OnEnable(wxCommandEvent &evt)
Definition: PluginRegistrationDialog.cpp:834
PluginRegistrationDialog::OnListChar
void OnListChar(wxKeyEvent &evt)
Definition: PluginRegistrationDialog.cpp:792
PluginRegistrationDialog::OnCancel
void OnCancel(wxCommandEvent &evt)
Definition: PluginRegistrationDialog.cpp:967
PluginRegistrationDialog::ItemData::nameWidth
int nameWidth
Definition: PluginRegistrationDialog.h:38
PluginRegistrationDialog::ItemDataMap
std::unordered_map< PluginPath, ItemData > ItemDataMap
Definition: PluginRegistrationDialog.h:43
PluginRegistrationDialog::mEffects
wxListCtrl * mEffects
Definition: PluginRegistrationDialog.h:76
PluginRegistrationDialog::mFilter
int mFilter
Definition: PluginRegistrationDialog.h:66
PluginDescriptor
Definition: PluginManager.h:45
PluginRegistrationDialog::DoSort
void DoSort(int col)
Definition: PluginRegistrationDialog.cpp:774
PluginRegistrationDialog::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S)
Defines the dialog and does data exchange with it.
Definition: PluginRegistrationDialog.cpp:416
wxDialogWrapper
Definition: wxPanelWrapper.h:81
PluginRegistrationDialog::mSortColumn
int mSortColumn
Definition: PluginRegistrationDialog.h:71
PluginRegistrationDialog::ItemData::path
PluginPath path
Definition: PluginRegistrationDialog.h:35
PluginRegistrationDialog::OnSelectAll
void OnSelectAll(wxCommandEvent &evt)
Definition: PluginRegistrationDialog.cpp:818
PluginRegistrationDialog::mStates
wxArrayString mStates
Definition: PluginRegistrationDialog.h:68
PluginRegistrationDialog::mLongestPath
PluginPath mLongestPath
Definition: PluginRegistrationDialog.h:74
PluginRegistrationDialog::RegenerateEffectsList
void RegenerateEffectsList(int iShowWhat)
Definition: PluginRegistrationDialog.cpp:616
EffectType
EffectType
Definition: EffectInterface.h:52
PluginRegistrationDialog::OnClearAll
void OnClearAll(wxCommandEvent &evt)
Definition: PluginRegistrationDialog.cpp:826
PluginRegistrationDialog::ItemData::pathWidth
int pathWidth
Definition: PluginRegistrationDialog.h:39
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:631
PluginRegistrationDialog::SetState
void SetState(int i, bool toggle, bool state=true)
Definition: PluginRegistrationDialog.cpp:677
PluginRegistrationDialog::OnOK
void OnOK(wxCommandEvent &evt)
Definition: PluginRegistrationDialog.cpp:872