/[svn]/qsampler/trunk/src/qsamplerDevice.h
ViewVC logotype

Diff of /qsampler/trunk/src/qsamplerDevice.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 431 by capela, Tue Mar 8 20:12:08 2005 UTC revision 463 by capela, Tue Mar 15 15:32:29 2005 UTC
# Line 34  Line 34 
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.
# Line 67  public: Line 70  public:
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.
# Line 80  class qsamplerDevice Line 86  class qsamplerDevice
86  public:  public:
87    
88          // We use the same class for MIDI and audio device management          // We use the same class for MIDI and audio device management
89          enum qsamplerDeviceType { Midi, Audio };          enum qsamplerDeviceType { None, Midi, Audio };
90    
91          // Constructor.          // Constructor.
92          qsamplerDevice(lscp_client_t *pClient,          qsamplerDevice(lscp_client_t *pClient,
# Line 99  public: Line 105  public:
105          // Device property accessors.          // Device property accessors.
106          int                 deviceID()   const;          int                 deviceID()   const;
107          qsamplerDeviceType  deviceType() const;          qsamplerDeviceType  deviceType() const;
108            const QString&      deviceTypeName() const;
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          // Update/refresh device/driver data.          // Device port/channel list accessor.
119          void refresh();          qsamplerDevicePortList& ports();
120    
121            // Device port/channel list refreshner.
122            void refresh(lscp_client_t *pClient);
123            
124          // Device ids enumerator.          // Device ids enumerator.
125          static int *getDevices(lscp_client_t *pClient,          static int *getDevices(lscp_client_t *pClient,
126                  qsamplerDeviceType deviceType);                  qsamplerDeviceType deviceType);
# Line 121  private: Line 134  private:
134          // Instance variables.          // Instance variables.
135          int                m_iDeviceID;          int                m_iDeviceID;
136          qsamplerDeviceType m_deviceType;          qsamplerDeviceType m_deviceType;
137            QString            m_sDeviceType;
138          QString            m_sDriverName;          QString            m_sDriverName;
139          QString            m_sDeviceName;          QString            m_sDeviceName;
140    
141          // Device parameter list.          // Device parameter list.
142          qsamplerDeviceParamMap m_params;          qsamplerDeviceParamMap m_params;
143            
144            // Device port/channel list.
145            qsamplerDevicePortList m_ports;
146    };
147    
148    
149    //-------------------------------------------------------------------------
150    // qsamplerDevicePort - MIDI/Audio Device port/channel structure.
151    //
152    
153    class qsamplerDevicePort
154    {
155    public:
156    
157            // Constructor.
158            qsamplerDevicePort(lscp_client_t *pClient,
159                    const qsamplerDevice& device, int iPortID);
160            // Default destructor.
161            ~qsamplerDevicePort();
162    
163            // Initializer.
164            void setDevicePort(lscp_client_t *pClient,
165                    const qsamplerDevice& device, int iPortID);
166    
167            // Device port property accessors.
168            int            portID()   const;
169            const QString& portName() const;
170    
171            // Device port parameters accessor.
172            const qsamplerDeviceParamMap& params() const;
173    
174            // Set the proper device port/channel parameter value.
175            void setParam (const QString& sParam, const QString& sValue);
176    
177    private:
178    
179            // Instance variables.
180            int     m_iPortID;
181            QString m_sPortName;
182    
183            // Device port parameter list.
184            qsamplerDeviceParamMap m_params;
185  };  };
186    
187    
# Line 173  public: Line 229  public:
229          // Default destructor.          // Default destructor.
230          ~qsamplerDeviceParamTable();          ~qsamplerDeviceParamTable();
231    
232          // Client/device descriptor selector.          // Common parameter table renderer.
233          void refresh(qsamplerDevice& device);          void refresh(const qsamplerDeviceParamMap& params, bool bEditable);
234    };
235    
236    
237    //-------------------------------------------------------------------------
238    // qsamplerDeviceParamTableSpinBox - Custom spin box for parameter table.
239    //
240    
241    class qsamplerDeviceParamTableSpinBox : public QTableItem
242    {
243    public:
244    
245            // Constructor.
246            qsamplerDeviceParamTableSpinBox (QTable *pTable, EditType editType,
247                    const QString& sText);
248    
249            // Public accessors.
250            void setMinValue(int iMinValue);
251            void setMaxValue(int iMaxValue);
252            void setValue(int iValue);
253    
254    protected:
255    
256            // Virtual implemetations.
257            QWidget *createEditor() const;
258            void setContentFromEditor(QWidget *pWidget);
259    
260    private:
261    
262            // Initial value holders.
263            int m_iValue;
264            int m_iMinValue;
265            int m_iMaxValue;
266    };
267    
268    
269    //-------------------------------------------------------------------------
270    // qsamplerDeviceParamTableEditBox - Custom edit box for parameter table.
271    //
272    
273    class qsamplerDeviceParamTableEditBox : public QTableItem
274    {
275    public:
276    
277            // Constructor.
278            qsamplerDeviceParamTableEditBox (QTable *pTable, EditType editType,
279                    const QString& sText);
280    
281    protected:
282    
283            // Virtual implemetations.
284            QWidget *createEditor() const;
285            void setContentFromEditor(QWidget *pWidget);
286  };  };
287    
288    

Legend:
Removed from v.431  
changed lines
  Added in v.463

  ViewVC Help
Powered by ViewVC