/[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 490 by capela, Fri Apr 1 00:34:58 2005 UTC revision 961 by capela, Sun Dec 3 18:26:13 2006 UTC
# Line 1  Line 1 
1  // qsamplerChannel.h  // qsamplerChannel.h
2  //  //
3  /****************************************************************************  /****************************************************************************
4     Copyright (C) 2003-2005, rncbc aka Rui Nuno Capela. All rights reserved.     Copyright (C) 2004-2006, rncbc aka Rui Nuno Capela. All rights reserved.
5    
6     This program is free software; you can redistribute it and/or     This program is free software; you can redistribute it and/or
7     modify it under the terms of the GNU General Public License     modify it under the terms of the GNU General Public License
# Line 13  Line 13 
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.     GNU General Public License for more details.
15    
16     You should have received a copy of the GNU General Public License     You should have received a copy of the GNU General Public License along
17     along with this program; if not, write to the Free Software     with this program; if not, write to the Free Software Foundation, Inc.,
18     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19    
20  *****************************************************************************/  *****************************************************************************/
21    
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 qsamplerMainForm;  class qsamplerDevice;
33    
34    
35    // Typedef'd QMap.
36    typedef QMap<int, int> qsamplerChannelRoutingMap;
37    
38    
39  //-------------------------------------------------------------------------  //-------------------------------------------------------------------------
# Line 41  class qsamplerChannel Line 45  class qsamplerChannel
45  public:  public:
46    
47          // Constructor.          // Constructor.
48          qsamplerChannel(qsamplerMainForm *pMainForm, int iChannelID = -1);          qsamplerChannel(int iChannelID = -1);
49          // Default destructor.          // Default destructor.
50          ~qsamplerChannel();          ~qsamplerChannel();
51    
         // Main application form accessor.  
         qsamplerMainForm *mainForm() const;  
   
         // Main application options accessor.  
         qsamplerOptions *options() const;  
   
         // LSCP client descriptor accessor.  
         lscp_client_t * client() const;  
   
52          // Add/remove sampler channel methods.          // Add/remove sampler channel methods.
53          bool     addChannel();          bool     addChannel();
54          bool     removeChannel();          bool     removeChannel();
# Line 108  public: Line 103  public:
103          float    volume() const;          float    volume() const;
104          bool     setVolume(float fVolume);          bool     setVolume(float fVolume);
105    
106            // Sampler channel mute state.
107            bool     channelMute() const;
108            bool     setChannelMute(bool bMute);
109    
110            // Sampler channel solo state.
111            bool     channelSolo() const;
112            bool     setChannelSolo(bool bSolo);
113    
114            // Audio routing accessors.
115            int      audioChannel(int iAudioOut) const;
116            bool     setAudioChannel(int iAudioOut, int iAudioIn);
117            // The audio routing map itself.
118            const qsamplerChannelRoutingMap& audioRouting() const;
119    
120          // Istrument name remapper.          // Istrument name remapper.
121          void     updateInstrumentName();          void     updateInstrumentName();
122    
# Line 133  public: Line 142  public:
142          // Common (invalid) name-helpers.          // Common (invalid) name-helpers.
143          static QString noEngineName();          static QString noEngineName();
144          static QString noInstrumentName();          static QString noInstrumentName();
145            static QString loadingInstrument();
146    
147          // Check whether a given file is an instrument file.          // Check whether a given file is an instrument file.
148          static bool isInstrumentFile (const QString& sInstrumentFile);          static bool isInstrumentFile (const QString& sInstrumentFile);
# Line 145  public: Line 155  public:
155    
156  private:  private:
157    
         // Main application form reference.  
         qsamplerMainForm *m_pMainForm;  
   
158          // Unique channel identifier.          // Unique channel identifier.
159          int     m_iChannelID;          int     m_iChannelID;
160    
# Line 164  private: Line 171  private:
171          QString m_sAudioDriver;          QString m_sAudioDriver;
172          int     m_iAudioDevice;          int     m_iAudioDevice;
173          float   m_fVolume;          float   m_fVolume;
174            bool    m_bMute;
175            bool    m_bSolo;
176    
177            // The audio routing mapping.
178            qsamplerChannelRoutingMap m_audioRouting;
179  };  };
180    
181    
182    //-------------------------------------------------------------------------
183    // qsamplerChannelRoutingTable - Channel routing table widget.
184    //
185    
186    class qsamplerChannelRoutingTable : public QTable
187    {
188            Q_OBJECT
189    
190    public:
191    
192            // Constructor.
193            qsamplerChannelRoutingTable(QWidget *pParent = 0, const char *pszName = 0);
194            // Default destructor.
195            ~qsamplerChannelRoutingTable();
196    
197            // Common parameter table renderer.
198            void refresh(qsamplerDevice *pDevice,
199                    const qsamplerChannelRoutingMap& routing);
200    
201            // Commit any pending editing.
202            void flush();
203    };
204    
205    
206    //-------------------------------------------------------------------------
207    // qsamplerChannelRoutingComboBox - Custom combo box for routing table.
208    //
209    
210    class qsamplerChannelRoutingComboBox : public QTableItem
211    {
212    public:
213    
214            // Constructor.
215            qsamplerChannelRoutingComboBox(QTable *pTable,
216                    const QStringList& list, const QPixmap& pixmap);
217    
218            // Public accessors.
219            void setCurrentItem(int iCurrentItem);
220            int currentItem() const;
221    
222    protected:
223    
224            // Virtual implemetations.
225            QWidget *createEditor() const;
226            void setContentFromEditor(QWidget *pWidget);
227    
228    private:
229    
230            // Initial value holders
231            QStringList m_list;
232            int m_iCurrentItem;
233    };
234    
235    
236  #endif  // __qsamplerChannel_h  #endif  // __qsamplerChannel_h
237    
238    

Legend:
Removed from v.490  
changed lines
  Added in v.961

  ViewVC Help
Powered by ViewVC