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 |
|
|
// Constructor. |
44 |
|
|
qsamplerChannel(qsamplerMainForm *pMainForm, int iChannelID = -1); |
45 |
|
|
// Default destructor. |
46 |
|
|
~qsamplerChannel(); |
47 |
|
|
|
48 |
|
|
// Main application options accessor. |
49 |
|
|
qsamplerOptions *options(); |
50 |
|
|
|
51 |
|
|
// LSCP client descriptor accessor. |
52 |
|
|
lscp_client_t * client(); |
53 |
capela |
295 |
|
54 |
|
|
// Add/remove sampler channel methods. |
55 |
|
|
bool addChannel(); |
56 |
|
|
bool removeChannel(); |
57 |
|
|
|
58 |
capela |
264 |
// Sampler channel ID accessors. |
59 |
|
|
int channelID(); |
60 |
|
|
void setChannelID(int iChannelID); |
61 |
|
|
|
62 |
capela |
295 |
// Readable channel name. |
63 |
|
|
QString channelName(); |
64 |
|
|
|
65 |
capela |
264 |
// 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 |
|
|
int instrumentStatus(); |
73 |
|
|
bool loadInstrument(const QString& sInstrumentFile, int iInstrumentNr); |
74 |
|
|
|
75 |
|
|
// MIDI input driver (DEPRECATED). |
76 |
|
|
QString& midiDriver(); |
77 |
|
|
bool setMidiDriver(const QString& sMidiDriver); |
78 |
|
|
|
79 |
|
|
// MIDI input device. |
80 |
|
|
int midiDevice(); |
81 |
|
|
bool setMidiDevice(int iMidiDevice); |
82 |
|
|
|
83 |
|
|
// MIDI input port. |
84 |
|
|
int midiPort(); |
85 |
|
|
bool setMidiPort(int iMidiPort); |
86 |
|
|
|
87 |
|
|
// MIDI input channel. |
88 |
|
|
int midiChannel(); |
89 |
|
|
bool setMidiChannel(int iMidiChannel); |
90 |
|
|
|
91 |
|
|
// Audio output driver (DEPRECATED). |
92 |
|
|
QString& audioDriver(); |
93 |
|
|
bool setAudioDriver(const QString& sAudioDriver); |
94 |
|
|
|
95 |
|
|
// Audio output device. |
96 |
|
|
int audioDevice(); |
97 |
|
|
bool setAudioDevice(int iAudioDevice); |
98 |
|
|
|
99 |
|
|
// Sampler channel volume. |
100 |
|
|
float volume(); |
101 |
|
|
bool setVolume(float fVolume); |
102 |
|
|
|
103 |
|
|
// Channel info structure map executive. |
104 |
capela |
303 |
bool updateChannelInfo(); |
105 |
capela |
264 |
|
106 |
|
|
// Reset channel method. |
107 |
capela |
303 |
bool resetChannel(); |
108 |
capela |
264 |
|
109 |
capela |
303 |
// Channel setup dialog form. |
110 |
|
|
bool channelSetup(QWidget *pParent); |
111 |
|
|
|
112 |
capela |
264 |
// Message logging methods (brainlessly mapped to main form's). |
113 |
capela |
303 |
void appendMessages (const QString & s); |
114 |
|
|
void appendMessagesColor (const QString & s, const QString & c); |
115 |
|
|
void appendMessagesText (const QString & s); |
116 |
|
|
void appendMessagesError (const QString & s); |
117 |
|
|
void appendMessagesClient (const QString & s); |
118 |
capela |
264 |
|
119 |
capela |
303 |
// Context menu event handler. |
120 |
|
|
void contextMenuEvent(QContextMenuEvent *pEvent); |
121 |
|
|
|
122 |
capela |
299 |
// Retrieve the available instrument name(s) of an instrument file (.gig). |
123 |
|
|
static QString getInstrumentName (const QString& sInstrumentFile, int iInstrumentNr); |
124 |
|
|
static QStringList getInstrumentList (const QString& sInstrumentFile); |
125 |
|
|
|
126 |
capela |
341 |
// Instrument name(s) retrieval mode. |
127 |
|
|
static bool instrumentNames(); |
128 |
|
|
static void setInstrumentNames (bool bInstrumentNames); |
129 |
|
|
|
130 |
capela |
264 |
private: |
131 |
|
|
|
132 |
|
|
// Main application form reference. |
133 |
|
|
qsamplerMainForm *m_pMainForm; |
134 |
|
|
|
135 |
|
|
// Unique channel identifier. |
136 |
|
|
int m_iChannelID; |
137 |
|
|
|
138 |
|
|
// Sampler channel info map. |
139 |
|
|
QString m_sEngineName; |
140 |
|
|
QString m_sInstrumentFile; |
141 |
|
|
int m_iInstrumentNr; |
142 |
|
|
int m_iInstrumentStatus; |
143 |
|
|
QString m_sMidiDriver; // DEPRECATED. |
144 |
|
|
int m_iMidiDevice; |
145 |
|
|
int m_iMidiPort; |
146 |
|
|
int m_iMidiChannel; |
147 |
|
|
QString m_sAudioDriver; // DEPRECATED. |
148 |
|
|
int m_iAudioDevice; |
149 |
|
|
float m_fVolume; |
150 |
capela |
341 |
|
151 |
|
|
// Retrieve mode for available instrument name(s) |
152 |
|
|
// from an instrument file (.gig). |
153 |
|
|
static bool g_bInstrumentNames; |
154 |
capela |
264 |
}; |
155 |
|
|
|
156 |
|
|
#endif // __qsamplerChannel_h |
157 |
|
|
|
158 |
|
|
|
159 |
|
|
// end of qsamplerChannel.h |