42 |
{ |
{ |
43 |
public: |
public: |
44 |
|
|
45 |
// Constructor. |
// Constructor. |
46 |
qsamplerDeviceParam(lscp_param_info_t *pParamInfo = NULL, |
qsamplerDeviceParam(lscp_param_info_t *pParamInfo = NULL, |
47 |
const char *pszValue = NULL); |
const char *pszValue = NULL); |
48 |
// Default destructor. |
// Default destructor. |
49 |
~qsamplerDeviceParam(); |
~qsamplerDeviceParam(); |
50 |
|
|
51 |
// Initializer. |
// Initializer. |
52 |
void setParam(lscp_param_info_t *pParamInfo, |
void setParam(lscp_param_info_t *pParamInfo, |
53 |
const char *pszValue = NULL); |
const char *pszValue = NULL); |
54 |
|
|
55 |
// Info structure field members. |
// Info structure field members. |
56 |
lscp_type_t type; |
lscp_type_t type; |
57 |
QString description; |
QString description; |
58 |
bool mandatory; |
bool mandatory; |
59 |
bool fix; |
bool fix; |
60 |
bool multiplicity; |
bool multiplicity; |
61 |
QStringList depends; |
QStringList depends; |
62 |
QString defaultv; |
QString defaultv; |
63 |
QString range_min; |
QString range_min; |
64 |
QString range_max; |
QString range_max; |
65 |
QStringList possibilities; |
QStringList possibilities; |
66 |
// The current parameter value. |
// The current parameter value. |
67 |
QString value; |
QString value; |
68 |
}; |
}; |
69 |
|
|
70 |
// A typedef'd parameter QMap. |
// A typedef'd parameter QMap. |
79 |
{ |
{ |
80 |
public: |
public: |
81 |
|
|
82 |
// We use the same class for MIDI and audio device management |
// We use the same class for MIDI and audio device management |
83 |
enum qsamplerDeviceType { Midi, Audio }; |
enum qsamplerDeviceType { Midi, Audio }; |
84 |
|
|
85 |
// Constructor. |
// Constructor. |
86 |
qsamplerDevice(lscp_client_t *pClient, |
qsamplerDevice(lscp_client_t *pClient, |
87 |
qsamplerDeviceType deviceType, int iDeviceID = -1); |
qsamplerDeviceType deviceType, int iDeviceID = -1); |
88 |
// Default destructor. |
// Default destructor. |
89 |
~qsamplerDevice(); |
~qsamplerDevice(); |
90 |
|
|
91 |
// Initializer. |
// Initializer. |
92 |
void setDevice(lscp_client_t *pClient, |
void setDevice(lscp_client_t *pClient, |
93 |
qsamplerDeviceType deviceType, int iDeviceID = -1); |
qsamplerDeviceType deviceType, int iDeviceID = -1); |
94 |
|
|
95 |
|
// Driver name initializer. |
96 |
|
void setDriver(lscp_client_t *pClient, |
97 |
|
const QString& sDriverName); |
98 |
|
|
99 |
// Device property accessors. |
// Device property accessors. |
100 |
int deviceID() const; |
int deviceID() const; |
101 |
qsamplerDeviceType deviceType() const; |
qsamplerDeviceType deviceType() const; |
102 |
const QString& driverName() const; |
const QString& driverName() const; |
103 |
const QString& deviceName() const; |
const QString& deviceName() const; |
104 |
|
|
105 |
// Device parameters accessor. |
// Device parameters accessor. |
106 |
qsamplerDeviceParamMap& params(); |
qsamplerDeviceParamMap& params(); |
109 |
void refresh(); |
void refresh(); |
110 |
|
|
111 |
// Device ids enumerator. |
// Device ids enumerator. |
112 |
static int *getDevices(lscp_client_t *pClient, |
static int *getDevices(lscp_client_t *pClient, |
113 |
qsamplerDeviceType deviceType); |
qsamplerDeviceType deviceType); |
114 |
|
|
115 |
// Driver names enumerator. |
// Driver names enumerator. |
116 |
static QStringList getDrivers(lscp_client_t *pClient, |
static QStringList getDrivers(lscp_client_t *pClient, |
117 |
qsamplerDeviceType deviceType); |
qsamplerDeviceType deviceType); |
118 |
|
|
119 |
private: |
private: |
120 |
|
|
121 |
// Instance variables. |
// Instance variables. |
122 |
int m_iDeviceID; |
int m_iDeviceID; |
123 |
qsamplerDeviceType m_deviceType; |
qsamplerDeviceType m_deviceType; |
124 |
QString m_sDriverName; |
QString m_sDriverName; |
125 |
QString m_sDeviceName; |
QString m_sDeviceName; |
126 |
|
|
127 |
// Device parameter list. |
// Device parameter list. |
128 |
qsamplerDeviceParamMap m_params; |
qsamplerDeviceParamMap m_params; |
137 |
{ |
{ |
138 |
public: |
public: |
139 |
|
|
140 |
// Constructors. |
// Constructors. |
141 |
qsamplerDeviceItem(QListView *pListView, lscp_client_t *pClient, |
qsamplerDeviceItem(QListView *pListView, lscp_client_t *pClient, |
142 |
qsamplerDevice::qsamplerDeviceType deviceType); |
qsamplerDevice::qsamplerDeviceType deviceType); |
143 |
qsamplerDeviceItem(QListViewItem *pItem, lscp_client_t *pClient, |
qsamplerDeviceItem(QListViewItem *pItem, lscp_client_t *pClient, |
144 |
qsamplerDevice::qsamplerDeviceType deviceType, int iDeviceID); |
qsamplerDevice::qsamplerDeviceType deviceType, int iDeviceID); |
145 |
// Default destructor. |
// Default destructor. |
146 |
~qsamplerDeviceItem(); |
~qsamplerDeviceItem(); |
147 |
|
|
148 |
// Instance accessors. |
// Instance accessors. |
149 |
const qsamplerDevice& device(); |
qsamplerDevice& device(); |
150 |
|
|
151 |
// To virtually distinguish between list view items. |
// To virtually distinguish between list view items. |
152 |
virtual int rtti() const; |
virtual int rtti() const; |
153 |
|
|
154 |
private: |
private: |
155 |
|
|
156 |
// Instance variables. |
// Instance variables. |
157 |
qsamplerDevice m_device; |
qsamplerDevice m_device; |
158 |
}; |
}; |
159 |
|
|
160 |
|
|
164 |
|
|
165 |
class qsamplerDeviceParamTable : public QTable |
class qsamplerDeviceParamTable : public QTable |
166 |
{ |
{ |
167 |
Q_OBJECT |
Q_OBJECT |
168 |
|
|
169 |
public: |
public: |
170 |
|
|
171 |
// Constructor. |
// Constructor. |
172 |
qsamplerDeviceParamTable(QWidget *pParent = 0, const char *pszName = 0); |
qsamplerDeviceParamTable(QWidget *pParent = 0, const char *pszName = 0); |
173 |
// Default destructor. |
// Default destructor. |
174 |
~qsamplerDeviceParamTable(); |
~qsamplerDeviceParamTable(); |
|
|
|
|
// Client/device descriptor selector. |
|
|
void setDevice(lscp_client_t *pClient, |
|
|
qsamplerDevice::qsamplerDeviceType deviceType, int iDeviceID = -1); |
|
|
|
|
|
// Client/device descriptor accessors. |
|
|
lscp_client_t *client(); |
|
|
int deviceID(); |
|
|
|
|
|
// The main table refresher. |
|
|
void refresh(); |
|
|
|
|
|
private: |
|
175 |
|
|
176 |
// LSCP client/device references. |
// Client/device descriptor selector. |
177 |
lscp_client_t *m_pClient; |
void refresh(qsamplerDevice& device); |
|
qsamplerDevice::qsamplerDeviceType m_deviceType; |
|
|
int m_iDeviceID; |
|
178 |
}; |
}; |
179 |
|
|
180 |
|
|