forked from Sneeds-Feed-and-Seed/sneedacity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPluginRegistrationDialog.h
85 lines (65 loc) · 1.99 KB
/
PluginRegistrationDialog.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/**********************************************************************
Sneedacity: A Digital Audio Editor
PluginRegistrationDialog.h
Paul Licameli split from PluginManager.cpp
**********************************************************************/
#ifndef __SNEEDACITY_PLUGIN_REGISTRATION_DIALOG__
#define __SNEEDACITY_PLUGIN_REGISTRATION_DIALOG__
#include "widgets/wxPanelWrapper.h" // to inherit
#include <vector>
#include <unordered_map> // member
class CheckListAx;
enum EffectType : int;
class PluginDescriptor;
class ShuttleGui;
class wxListEvent;
class wxListCtrl;
class PluginRegistrationDialog final : public wxDialogWrapper
{
public:
// constructors and destructors
PluginRegistrationDialog(wxWindow *parent, EffectType type);
private:
struct ItemData
{
std::vector<PluginDescriptor*> plugs;
wxString name;
PluginPath path;
int state;
bool valid;
int nameWidth;
int pathWidth;
int stateWidth;
};
using ItemDataMap = std::unordered_map<PluginPath, ItemData>;
void Populate();
void PopulateOrExchange(ShuttleGui & S);
void RegenerateEffectsList(int iShowWhat);
void SetState(int i, bool toggle, bool state = true);
static int wxCALLBACK SortCompare(wxIntPtr item1, wxIntPtr item2, wxIntPtr sortData);
int SortCompare(ItemData *item1, ItemData *item2);
void OnChangedVisibility(wxCommandEvent & evt);
void OnSort(wxListEvent & evt);
void DoSort( int col );
void OnListChar(wxKeyEvent & evt);
void OnOK(wxCommandEvent & evt);
void OnCancel(wxCommandEvent & evt);
void OnSelectAll(wxCommandEvent & evt);
void OnClearAll(wxCommandEvent & evt);
void OnEnable(wxCommandEvent & evt);
void OnDisable(wxCommandEvent & evt);
private:
EffectType mType;
int mFilter;
wxArrayString mStates;
ItemDataMap mItems;
int mSortColumn;
int mSortDirection;
PluginPath mLongestPath;
wxListCtrl *mEffects;
#if wxUSE_ACCESSIBILITY
CheckListAx *mAx;
#endif
DECLARE_EVENT_TABLE()
};
#endif