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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 467 - (hide annotations) (download) (as text)
Tue Mar 15 23:54:14 2005 UTC (19 years ago) by capela
File MIME type: text/x-c++hdr
File size: 4742 byte(s)
Device port/channel configuration refreshing fix.

1 capela 264 // qsamplerChannel.h
2     //
3     /****************************************************************************
4 capela 341 Copyright (C) 2003-2005, rncbc aka Rui Nuno Capela. All rights reserved.
5 capela 264
6     This program is free software; you can redistribute it and/or
7     modify it under the terms of the GNU General Public License
8     as published by the Free Software Foundation; either version 2
9     of the License, or (at your option) any later version.
10    
11     This program is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14     GNU General Public License for more details.
15    
16     You should have received a copy of the GNU General Public License
17     along with this program; if not, write to the Free Software
18     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19    
20     *****************************************************************************/
21    
22     #ifndef __qsamplerChannel_h
23     #define __qsamplerChannel_h
24    
25     #include <qobject.h>
26    
27     #include <lscp/client.h>
28     #include <lscp/device.h>
29    
30     #include "qsamplerOptions.h"
31    
32     class qsamplerMainForm;
33    
34    
35     //-------------------------------------------------------------------------
36     // qsamplerChannel - Sampler channel structure.
37     //
38    
39     class qsamplerChannel
40     {
41     public:
42    
43 capela 467 // Constructor.
44     qsamplerChannel(qsamplerMainForm *pMainForm, int iChannelID = -1);
45     // Default destructor.
46     ~qsamplerChannel();
47 capela 264
48 capela 467 // Main application options accessor.
49     qsamplerOptions *options();
50 capela 264
51 capela 467 // LSCP client descriptor accessor.
52     lscp_client_t * client();
53 capela 295
54 capela 467 // Add/remove sampler channel methods.
55     bool addChannel();
56     bool removeChannel();
57 capela 295
58 capela 467 // Sampler channel ID accessors.
59     int channelID();
60     void setChannelID(int iChannelID);
61 capela 295
62 capela 467 // Readable channel name.
63     QString channelName();
64    
65     // Engine name property.
66     QString& engineName();
67     bool loadEngine(const QString& sEngineName);
68    
69     // Instrument file and index.
70     QString& instrumentFile();
71     int instrumentNr();
72     QString& instrumentName();
73     int instrumentStatus();
74     bool loadInstrument(const QString& sInstrumentFile, int iInstrumentNr);
75 capela 388 // Special instrument file/name/number settler.
76 capela 467 bool setInstrument(const QString& sInstrumentFile, int iInstrumentNr);
77 capela 344
78 capela 467 // MIDI input driver (DEPRECATED).
79     QString& midiDriver();
80     bool setMidiDriver(const QString& sMidiDriver);
81 capela 264
82 capela 467 // MIDI input device.
83     int midiDevice();
84     bool setMidiDevice(int iMidiDevice);
85 capela 264
86 capela 467 // MIDI input port.
87     int midiPort();
88     bool setMidiPort(int iMidiPort);
89 capela 371
90 capela 467 // MIDI input channel.
91     int midiChannel();
92     bool setMidiChannel(int iMidiChannel);
93 capela 264
94 capela 467 // Audio output driver (DEPRECATED).
95     QString& audioDriver();
96     bool setAudioDriver(const QString& sAudioDriver);
97 capela 303
98 capela 467 // Audio output device.
99     int audioDevice();
100     bool setAudioDevice(int iAudioDevice);
101 capela 400
102 capela 467 // Sampler channel volume.
103     float volume();
104     bool setVolume(float fVolume);
105 capela 264
106 capela 467 // Istrument name remapper.
107     void updateInstrumentName();
108 capela 303
109 capela 467 // Channel info structure map executive.
110     bool updateChannelInfo();
111    
112     // Channel setup dialog form.
113     bool channelSetup(QWidget *pParent);
114    
115     // Reset channel method.
116     bool channelReset();
117    
118     // Message logging methods (brainlessly mapped to main form's).
119     void appendMessages (const QString & s);
120     void appendMessagesColor (const QString & s, const QString & c);
121     void appendMessagesText (const QString & s);
122     void appendMessagesError (const QString & s);
123     void appendMessagesClient (const QString & s);
124    
125     // Context menu event handler.
126     void contextMenuEvent(QContextMenuEvent *pEvent);
127    
128 capela 388 // Common (invalid) name-helpers.
129 capela 467 static QString noEngineName();
130     static QString noInstrumentName();
131 capela 388
132     // Check whether a given file is an instrument file.
133     static bool isInstrumentFile (const QString& sInstrumentFile);
134    
135 capela 467 // Retrieve the available instrument name(s) of an instrument file (.gig).
136     static QString getInstrumentName (const QString& sInstrumentFile,
137 capela 344 int iInstrumentNr, bool bInstrumentNames);
138 capela 467 static QStringList getInstrumentList (const QString& sInstrumentFile,
139 capela 344 bool bInstrumentNames);
140 capela 299
141 capela 264 private:
142    
143 capela 467 // Main application form reference.
144     qsamplerMainForm *m_pMainForm;
145 capela 264
146 capela 467 // Unique channel identifier.
147     int m_iChannelID;
148 capela 264
149 capela 467 // Sampler channel info map.
150     QString m_sEngineName;
151     QString m_sInstrumentName;
152     QString m_sInstrumentFile;
153     int m_iInstrumentNr;
154     int m_iInstrumentStatus;
155     QString m_sMidiDriver; // DEPRECATED.
156     int m_iMidiDevice;
157     int m_iMidiPort;
158     int m_iMidiChannel;
159     QString m_sAudioDriver; // DEPRECATED.
160     int m_iAudioDevice;
161     float m_fVolume;
162 capela 264 };
163    
164     #endif // __qsamplerChannel_h
165    
166    
167     // end of qsamplerChannel.h

  ViewVC Help
Powered by ViewVC