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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 751 - (show annotations) (download) (as text)
Fri Aug 19 17:10:16 2005 UTC (18 years, 7 months ago) by capela
File MIME type: text/x-c++hdr
File size: 5231 byte(s)
* Added MUTE/SOLO buttons to individual channel strips.

1 // qsamplerChannel.h
2 //
3 /****************************************************************************
4 Copyright (C) 2003-2005, rncbc aka Rui Nuno Capela. All rights reserved.
5
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 // Constructor.
44 qsamplerChannel(qsamplerMainForm *pMainForm, int iChannelID = -1);
45 // Default destructor.
46 ~qsamplerChannel();
47
48 // Main application form accessor.
49 qsamplerMainForm *mainForm() const;
50
51 // Main application options accessor.
52 qsamplerOptions *options() const;
53
54 // LSCP client descriptor accessor.
55 lscp_client_t * client() const;
56
57 // Add/remove sampler channel methods.
58 bool addChannel();
59 bool removeChannel();
60
61 // Sampler channel ID accessors.
62 int channelID() const;
63 void setChannelID(int iChannelID);
64
65 // Readable channel name.
66 QString channelName() const;
67
68 // Engine name property.
69 const QString& engineName() const;
70 bool loadEngine(const QString& sEngineName);
71
72 // Instrument file and index.
73 const QString& instrumentFile() const;
74 int instrumentNr() const;
75 const QString& instrumentName() const;
76 int instrumentStatus() const;
77
78 // Instrument file loader.
79 bool loadInstrument(const QString& sInstrumentFile, int iInstrumentNr);
80 // Special instrument file/name/number settler.
81 bool setInstrument(const QString& sInstrumentFile, int iInstrumentNr);
82
83 // MIDI input driver (DEPRECATED).
84 const QString& midiDriver() const;
85 bool setMidiDriver(const QString& sMidiDriver);
86
87 // MIDI input device.
88 int midiDevice() const;
89 bool setMidiDevice(int iMidiDevice);
90
91 // MIDI input port.
92 int midiPort() const;
93 bool setMidiPort(int iMidiPort);
94
95 // MIDI input channel.
96 int midiChannel() const;
97 bool setMidiChannel(int iMidiChannel);
98
99 // Audio output driver (DEPRECATED).
100 const QString& audioDriver() const;
101 bool setAudioDriver(const QString& sAudioDriver);
102
103 // Audio output device.
104 int audioDevice() const;
105 bool setAudioDevice(int iAudioDevice);
106
107 // Sampler channel volume.
108 float volume() const;
109 bool setVolume(float fVolume);
110
111 // Sampler channel mute state.
112 bool channelMute() const;
113 bool setChannelMute(bool bMute);
114
115 // Sampler channel solo state.
116 bool channelSolo() const;
117 bool setChannelSolo(bool bSolo);
118
119 // Istrument name remapper.
120 void updateInstrumentName();
121
122 // Channel info structure map executive.
123 bool updateChannelInfo();
124
125 // Channel setup dialog form.
126 bool channelSetup(QWidget *pParent);
127
128 // Reset channel method.
129 bool channelReset();
130
131 // Message logging methods (brainlessly mapped to main form's).
132 void appendMessages (const QString & s) const;
133 void appendMessagesColor (const QString & s, const QString & c) const;
134 void appendMessagesText (const QString & s) const;
135 void appendMessagesError (const QString & s) const;
136 void appendMessagesClient (const QString & s) const;
137
138 // Context menu event handler.
139 void contextMenuEvent(QContextMenuEvent *pEvent);
140
141 // Common (invalid) name-helpers.
142 static QString noEngineName();
143 static QString noInstrumentName();
144 static QString loadingInstrument();
145
146 // Check whether a given file is an instrument file.
147 static bool isInstrumentFile (const QString& sInstrumentFile);
148
149 // Retrieve the available instrument name(s) of an instrument file (.gig).
150 static QString getInstrumentName (const QString& sInstrumentFile,
151 int iInstrumentNr, bool bInstrumentNames);
152 static QStringList getInstrumentList (const QString& sInstrumentFile,
153 bool bInstrumentNames);
154
155 private:
156
157 // Main application form reference.
158 qsamplerMainForm *m_pMainForm;
159
160 // Unique channel identifier.
161 int m_iChannelID;
162
163 // Sampler channel info map.
164 QString m_sEngineName;
165 QString m_sInstrumentName;
166 QString m_sInstrumentFile;
167 int m_iInstrumentNr;
168 int m_iInstrumentStatus;
169 QString m_sMidiDriver;
170 int m_iMidiDevice;
171 int m_iMidiPort;
172 int m_iMidiChannel;
173 QString m_sAudioDriver;
174 int m_iAudioDevice;
175 float m_fVolume;
176 bool m_bMute;
177 bool m_bSolo;
178 };
179
180 #endif // __qsamplerChannel_h
181
182
183 // end of qsamplerChannel.h

  ViewVC Help
Powered by ViewVC