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