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