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

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

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

revision 467 by capela, Tue Mar 15 23:54:14 2005 UTC revision 767 by capela, Tue Aug 30 09:52:46 2005 UTC
# Line 22  Line 22 
22  #ifndef __qsamplerChannel_h  #ifndef __qsamplerChannel_h
23  #define __qsamplerChannel_h  #define __qsamplerChannel_h
24    
25  #include <qobject.h>  #include <qtable.h>
26    
27  #include <lscp/client.h>  #include <lscp/client.h>
28  #include <lscp/device.h>  #include <lscp/device.h>
29    
30  #include "qsamplerOptions.h"  #include "qsamplerOptions.h"
31    
32    class qsamplerDevice;
33  class qsamplerMainForm;  class qsamplerMainForm;
34    
35    
36    // Typedef'd QMap.
37    typedef QMap<int, int> qsamplerChannelRoutingMap;
38    
39    
40  //-------------------------------------------------------------------------  //-------------------------------------------------------------------------
41  // qsamplerChannel - Sampler channel structure.  // qsamplerChannel - Sampler channel structure.
42  //  //
# Line 45  public: Line 50  public:
50          // Default destructor.          // Default destructor.
51          ~qsamplerChannel();          ~qsamplerChannel();
52    
53            // Main application form accessor.
54            qsamplerMainForm *mainForm() const;
55    
56          // Main application options accessor.          // Main application options accessor.
57          qsamplerOptions *options();          qsamplerOptions *options() const;
58    
59          // LSCP client descriptor accessor.          // LSCP client descriptor accessor.
60          lscp_client_t * client();          lscp_client_t * client() const;
61    
62          // Add/remove sampler channel methods.          // Add/remove sampler channel methods.
63          bool     addChannel();          bool     addChannel();
64          bool     removeChannel();          bool     removeChannel();
65    
66          // Sampler channel ID accessors.          // Sampler channel ID accessors.
67          int      channelID();          int      channelID() const;
68          void     setChannelID(int iChannelID);          void     setChannelID(int iChannelID);
69    
70          // Readable channel name.          // Readable channel name.
71          QString  channelName();          QString  channelName() const;
72    
73          // Engine name property.          // Engine name property.
74          QString& engineName();          const QString& engineName() const;
75          bool     loadEngine(const QString& sEngineName);          bool     loadEngine(const QString& sEngineName);
76    
77          // Instrument file and index.          // Instrument file and index.
78          QString& instrumentFile();          const QString& instrumentFile() const;
79          int      instrumentNr();          int      instrumentNr() const;
80          QString& instrumentName();          const QString& instrumentName() const;
81          int      instrumentStatus();          int      instrumentStatus() const;
82    
83            // Instrument file loader.
84          bool     loadInstrument(const QString& sInstrumentFile, int iInstrumentNr);          bool     loadInstrument(const QString& sInstrumentFile, int iInstrumentNr);
85          // Special instrument file/name/number settler.          // Special instrument file/name/number settler.
86          bool     setInstrument(const QString& sInstrumentFile, int iInstrumentNr);          bool     setInstrument(const QString& sInstrumentFile, int iInstrumentNr);
87    
88          // MIDI input driver (DEPRECATED).          // MIDI input driver (DEPRECATED).
89          QString& midiDriver();          const QString& midiDriver() const;
90          bool     setMidiDriver(const QString& sMidiDriver);          bool     setMidiDriver(const QString& sMidiDriver);
91    
92          // MIDI input device.          // MIDI input device.
93          int      midiDevice();          int      midiDevice() const;
94          bool     setMidiDevice(int iMidiDevice);          bool     setMidiDevice(int iMidiDevice);
95    
96          // MIDI input port.          // MIDI input port.
97          int      midiPort();          int      midiPort() const;
98          bool     setMidiPort(int iMidiPort);          bool     setMidiPort(int iMidiPort);
99    
100          // MIDI input channel.          // MIDI input channel.
101          int      midiChannel();          int      midiChannel() const;
102          bool     setMidiChannel(int iMidiChannel);          bool     setMidiChannel(int iMidiChannel);
103    
104          // Audio output driver (DEPRECATED).          // Audio output driver (DEPRECATED).
105          QString& audioDriver();          const QString& audioDriver() const;
106          bool     setAudioDriver(const QString& sAudioDriver);          bool     setAudioDriver(const QString& sAudioDriver);
107    
108          // Audio output device.          // Audio output device.
109          int      audioDevice();          int      audioDevice() const;
110          bool     setAudioDevice(int iAudioDevice);          bool     setAudioDevice(int iAudioDevice);
111    
112          // Sampler channel volume.          // Sampler channel volume.
113          float    volume();          float    volume() const;
114          bool     setVolume(float fVolume);          bool     setVolume(float fVolume);
115    
116            // Sampler channel mute state.
117            bool     channelMute() const;
118            bool     setChannelMute(bool bMute);
119    
120            // Sampler channel solo state.
121            bool     channelSolo() const;
122            bool     setChannelSolo(bool bSolo);
123    
124            // Audio routing accessors.
125            int      audioChannel(int iAudioOut) const;
126            bool     setAudioChannel(int iAudioOut, int iAudioIn);
127            // The audio routing map itself.
128            const qsamplerChannelRoutingMap& audioRouting() const;
129    
130          // Istrument name remapper.          // Istrument name remapper.
131          void     updateInstrumentName();          void     updateInstrumentName();
132    
# Line 116  public: Line 140  public:
140          bool     channelReset();          bool     channelReset();
141    
142          // Message logging methods (brainlessly mapped to main form's).          // Message logging methods (brainlessly mapped to main form's).
143          void     appendMessages       (const QString & s);          void     appendMessages       (const QString & s) const;
144          void     appendMessagesColor  (const QString & s, const QString & c);          void     appendMessagesColor  (const QString & s, const QString & c) const;
145          void     appendMessagesText   (const QString & s);          void     appendMessagesText   (const QString & s) const;
146          void     appendMessagesError  (const QString & s);          void     appendMessagesError  (const QString & s) const;
147          void     appendMessagesClient (const QString & s);          void     appendMessagesClient (const QString & s) const;
148    
149          // Context menu event handler.          // Context menu event handler.
150          void contextMenuEvent(QContextMenuEvent *pEvent);          void contextMenuEvent(QContextMenuEvent *pEvent);
# Line 128  public: Line 152  public:
152          // Common (invalid) name-helpers.          // Common (invalid) name-helpers.
153          static QString noEngineName();          static QString noEngineName();
154          static QString noInstrumentName();          static QString noInstrumentName();
155            static QString loadingInstrument();
156    
157          // Check whether a given file is an instrument file.          // Check whether a given file is an instrument file.
158          static bool isInstrumentFile (const QString& sInstrumentFile);          static bool isInstrumentFile (const QString& sInstrumentFile);
# Line 152  private: Line 177  private:
177          QString m_sInstrumentFile;          QString m_sInstrumentFile;
178          int     m_iInstrumentNr;          int     m_iInstrumentNr;
179          int     m_iInstrumentStatus;          int     m_iInstrumentStatus;
180          QString m_sMidiDriver;          // DEPRECATED.          QString m_sMidiDriver;
181          int     m_iMidiDevice;          int     m_iMidiDevice;
182          int     m_iMidiPort;          int     m_iMidiPort;
183          int     m_iMidiChannel;          int     m_iMidiChannel;
184          QString m_sAudioDriver;         // DEPRECATED.          QString m_sAudioDriver;
185          int     m_iAudioDevice;          int     m_iAudioDevice;
186          float   m_fVolume;          float   m_fVolume;
187            bool    m_bMute;
188            bool    m_bSolo;
189    
190            // The audio routing mapping.
191            qsamplerChannelRoutingMap m_audioRouting;
192  };  };
193    
194    
195    //-------------------------------------------------------------------------
196    // qsamplerChannelRoutingTable - Channel routing table widget.
197    //
198    
199    class qsamplerChannelRoutingTable : public QTable
200    {
201            Q_OBJECT
202    
203    public:
204    
205            // Constructor.
206            qsamplerChannelRoutingTable(QWidget *pParent = 0, const char *pszName = 0);
207            // Default destructor.
208            ~qsamplerChannelRoutingTable();
209    
210            // Common parameter table renderer.
211            void refresh(qsamplerDevice *pDevice,
212                    const qsamplerChannelRoutingMap& routing);
213    
214            // Commit any pending editing.
215            void flush();
216    };
217    
218    
219    //-------------------------------------------------------------------------
220    // qsamplerChannelRoutingComboBox - Custom combo box for routing table.
221    //
222    
223    class qsamplerChannelRoutingComboBox : public QTableItem
224    {
225    public:
226    
227            // Constructor.
228            qsamplerChannelRoutingComboBox(QTable *pTable,
229                    const QStringList& list, const QPixmap& pixmap);
230    
231            // Public accessors.
232            void setCurrentItem(int iCurrentItem);
233            int currentItem() const;
234    
235    protected:
236    
237            // Virtual implemetations.
238            QWidget *createEditor() const;
239            void setContentFromEditor(QWidget *pWidget);
240    
241    private:
242    
243            // Initial value holders
244            QStringList m_list;
245            int m_iCurrentItem;
246    };
247    
248    
249  #endif  // __qsamplerChannel_h  #endif  // __qsamplerChannel_h
250    
251    

Legend:
Removed from v.467  
changed lines
  Added in v.767

  ViewVC Help
Powered by ViewVC