34 |
// Special QListViewItem::rtti() unique return value. |
// Special QListViewItem::rtti() unique return value. |
35 |
#define QSAMPLER_DEVICE_ITEM 1001 |
#define QSAMPLER_DEVICE_ITEM 1001 |
36 |
|
|
37 |
|
// Early forward declaration. |
38 |
|
class qsamplerDevicePort; |
39 |
|
|
40 |
|
|
41 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
42 |
// qsamplerDeviceParam - MIDI/Audio Device parameter structure. |
// qsamplerDeviceParam - MIDI/Audio Device parameter structure. |
70 |
QString value; |
QString value; |
71 |
}; |
}; |
72 |
|
|
73 |
// A typedef'd parameter QMap. |
// Typedef'd parameter QMap. |
74 |
typedef QMap<QString, qsamplerDeviceParam> qsamplerDeviceParamMap; |
typedef QMap<QString, qsamplerDeviceParam> qsamplerDeviceParamMap; |
75 |
|
|
76 |
|
// Typedef'd device port/channels QptrList. |
77 |
|
typedef QPtrList<qsamplerDevicePort> qsamplerDevicePortList; |
78 |
|
|
79 |
|
|
80 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
81 |
// qsamplerDevice - MIDI/Audio Device structure. |
// qsamplerDevice - MIDI/Audio Device structure. |
109 |
const QString& driverName() const; |
const QString& driverName() const; |
110 |
const QString& deviceName() const; |
const QString& deviceName() const; |
111 |
|
|
112 |
|
// Set the proper device parameter value. |
113 |
|
void setParam (const QString& sParam, const QString& sValue); |
114 |
|
|
115 |
// Device parameters accessor. |
// Device parameters accessor. |
116 |
qsamplerDeviceParamMap& params(); |
const qsamplerDeviceParamMap& params() const; |
117 |
|
|
118 |
|
// Device port/channel list accessor. |
119 |
|
qsamplerDevicePortList& ports(); |
120 |
|
|
121 |
// Update/refresh device/driver data. |
// Device parameter dependency list refreshner. |
122 |
void refresh(); |
int refreshParams(lscp_client_t *pClient); |
123 |
|
// Device port/channel list refreshner. |
124 |
|
int refreshPorts(lscp_client_t *pClient); |
125 |
|
// Refresh/set dependencies given that some parameter has changed. |
126 |
|
int refreshDepends(lscp_client_t *pClient, const QString& sParam); |
127 |
|
|
128 |
// Device ids enumerator. |
// Device ids enumerator. |
129 |
static int *getDevices(lscp_client_t *pClient, |
static int *getDevices(lscp_client_t *pClient, |
135 |
|
|
136 |
private: |
private: |
137 |
|
|
138 |
|
// Refresh/set given parameter based on driver supplied dependencies. |
139 |
|
int refreshParam(lscp_client_t *pClient, const QString& sParam); |
140 |
|
|
141 |
// Instance variables. |
// Instance variables. |
142 |
int m_iDeviceID; |
int m_iDeviceID; |
143 |
qsamplerDeviceType m_deviceType; |
qsamplerDeviceType m_deviceType; |
147 |
|
|
148 |
// Device parameter list. |
// Device parameter list. |
149 |
qsamplerDeviceParamMap m_params; |
qsamplerDeviceParamMap m_params; |
150 |
|
|
151 |
|
// Device port/channel list. |
152 |
|
qsamplerDevicePortList m_ports; |
153 |
|
}; |
154 |
|
|
155 |
|
|
156 |
|
//------------------------------------------------------------------------- |
157 |
|
// qsamplerDevicePort - MIDI/Audio Device port/channel structure. |
158 |
|
// |
159 |
|
|
160 |
|
class qsamplerDevicePort |
161 |
|
{ |
162 |
|
public: |
163 |
|
|
164 |
|
// Constructor. |
165 |
|
qsamplerDevicePort(lscp_client_t *pClient, |
166 |
|
const qsamplerDevice& device, int iPortID); |
167 |
|
// Default destructor. |
168 |
|
~qsamplerDevicePort(); |
169 |
|
|
170 |
|
// Initializer. |
171 |
|
void setDevicePort(lscp_client_t *pClient, |
172 |
|
const qsamplerDevice& device, int iPortID); |
173 |
|
|
174 |
|
// Device port property accessors. |
175 |
|
int portID() const; |
176 |
|
const QString& portName() const; |
177 |
|
|
178 |
|
// Device port parameters accessor. |
179 |
|
const qsamplerDeviceParamMap& params() const; |
180 |
|
|
181 |
|
// Set the proper device port/channel parameter value. |
182 |
|
void setParam (const QString& sParam, const QString& sValue); |
183 |
|
|
184 |
|
private: |
185 |
|
|
186 |
|
// Instance variables. |
187 |
|
int m_iPortID; |
188 |
|
QString m_sPortName; |
189 |
|
|
190 |
|
// Device port parameter list. |
191 |
|
qsamplerDeviceParamMap m_params; |
192 |
}; |
}; |
193 |
|
|
194 |
|
|
236 |
// Default destructor. |
// Default destructor. |
237 |
~qsamplerDeviceParamTable(); |
~qsamplerDeviceParamTable(); |
238 |
|
|
239 |
// Client/device descriptor selector. |
// Common parameter table renderer. |
240 |
void refresh(qsamplerDevice& device); |
void refresh(const qsamplerDeviceParamMap& params, bool bEditable); |
241 |
}; |
}; |
242 |
|
|
243 |
|
|
250 |
public: |
public: |
251 |
|
|
252 |
// Constructor. |
// Constructor. |
253 |
qsamplerDeviceParamTableSpinBox (QTable *pTable, EditType editType); |
qsamplerDeviceParamTableSpinBox (QTable *pTable, EditType editType, |
254 |
|
const QString& sText); |
255 |
|
|
256 |
// Public accessors. |
// Public accessors. |
257 |
void setMinValue(int iMinValue); |
void setMinValue(int iMinValue); |
267 |
private: |
private: |
268 |
|
|
269 |
// Initial value holders. |
// Initial value holders. |
270 |
|
int m_iValue; |
271 |
int m_iMinValue; |
int m_iMinValue; |
272 |
int m_iMaxValue; |
int m_iMaxValue; |
|
int m_iValue; |
|
273 |
}; |
}; |
274 |
|
|
275 |
|
|