75 |
m_pChannel->setChannelID(iChannelID); |
m_pChannel->setChannelID(iChannelID); |
76 |
m_iDirtyChange = 0; |
m_iDirtyChange = 0; |
77 |
} |
} |
78 |
|
|
79 |
// Stabilize this around. |
// Stabilize this around. |
80 |
updateChannelInfo(); |
updateChannelInfo(); |
81 |
} |
} |
151 |
|
|
152 |
|
|
153 |
// Update whole channel info state. |
// Update whole channel info state. |
154 |
void qsamplerChannelStrip::updateChannelInfo (void) |
bool qsamplerChannelStrip::updateChannelInfo (void) |
155 |
{ |
{ |
156 |
if (m_pChannel == NULL) |
if (m_pChannel == NULL) |
157 |
return; |
return false; |
158 |
|
|
159 |
// Update strip caption. |
// Update strip caption. |
160 |
QString sText = m_pChannel->channelName(); |
QString sText = m_pChannel->channelName(); |
163 |
|
|
164 |
// Check if we're up and connected. |
// Check if we're up and connected. |
165 |
if (m_pChannel->client() == NULL) |
if (m_pChannel->client() == NULL) |
166 |
return; |
return false; |
167 |
|
|
168 |
// Read actual channel information. |
// Read actual channel information. |
169 |
m_pChannel->updateChannelInfo(); |
m_pChannel->updateChannelInfo(); |
181 |
if (m_pChannel->instrumentFile().isEmpty()) |
if (m_pChannel->instrumentFile().isEmpty()) |
182 |
InstrumentNameTextLabel->setText(sIndent + tr("(No instrument)")); |
InstrumentNameTextLabel->setText(sIndent + tr("(No instrument)")); |
183 |
else |
else |
184 |
InstrumentNameTextLabel->setText(sIndent + QString("%1 [%2]") |
InstrumentNameTextLabel->setText(sIndent + qsamplerChannel::getInstrumentName(m_pChannel->instrumentFile(), m_pChannel->instrumentNr())); |
|
.arg(QFileInfo(m_pChannel->instrumentFile()).fileName()).arg(m_pChannel->instrumentNr())); |
|
185 |
|
|
186 |
// Instrument status... |
// Instrument status... |
187 |
int iInstrumentStatus = m_pChannel->instrumentStatus(); |
int iInstrumentStatus = m_pChannel->instrumentStatus(); |
200 |
MidiPortChannelTextLabel->setText(QString("%1 / %2").arg(m_pChannel->midiPort()).arg(m_pChannel->midiChannel() + 1)); |
MidiPortChannelTextLabel->setText(QString("%1 / %2").arg(m_pChannel->midiPort()).arg(m_pChannel->midiChannel() + 1)); |
201 |
|
|
202 |
// And update the both GUI volume elements. |
// And update the both GUI volume elements. |
203 |
updateChannelVolume(); |
return updateChannelVolume(); |
204 |
} |
} |
205 |
|
|
206 |
|
|
207 |
// Do the dirty volume change. |
// Do the dirty volume change. |
208 |
void qsamplerChannelStrip::updateChannelVolume (void) |
bool qsamplerChannelStrip::updateChannelVolume (void) |
209 |
{ |
{ |
210 |
if (m_pChannel == NULL) |
if (m_pChannel == NULL) |
211 |
return; |
return false; |
212 |
|
|
213 |
// Convert... |
// Convert... |
214 |
#ifdef CONFIG_ROUND |
#ifdef CONFIG_ROUND |
233 |
VolumeSlider->setValue(iVolume); |
VolumeSlider->setValue(iVolume); |
234 |
VolumeSpinBox->setValue(iVolume); |
VolumeSpinBox->setValue(iVolume); |
235 |
m_iDirtyChange--; |
m_iDirtyChange--; |
236 |
|
|
237 |
|
return true; |
238 |
} |
} |
239 |
|
|
240 |
|
|
241 |
// Update whole channel usage state. |
// Update whole channel usage state. |
242 |
void qsamplerChannelStrip::updateChannelUsage (void) |
bool qsamplerChannelStrip::updateChannelUsage (void) |
243 |
{ |
{ |
244 |
if (m_pChannel == NULL) |
if (m_pChannel == NULL) |
245 |
return; |
return false; |
246 |
if (m_pChannel->client() == NULL) |
if (m_pChannel->client() == NULL) |
247 |
return; |
return false; |
248 |
|
|
249 |
// Conditionally update whole channel status info. |
// Update whole channel status info, |
250 |
if (m_pChannel->instrumentStatus() >= 0 && m_pChannel->instrumentStatus() < 100) { |
// if instrument load is still pending... |
251 |
|
if (m_pChannel->instrumentStatus() < 100) { |
252 |
updateChannelInfo(); |
updateChannelInfo(); |
253 |
// Once we get a complete instrument load, try a implied reset channel.... |
// Check (updated) status again... |
254 |
if (m_pChannel->instrumentStatus() == 100) |
if (m_pChannel->instrumentStatus() < 100) |
255 |
m_pChannel->resetChannel(); |
return false; |
256 |
|
// Once we get a complete instrument load, |
257 |
|
// we'll try an implied channel reset... |
258 |
|
m_pChannel->resetChannel(); |
259 |
} |
} |
260 |
// Leave, if we still have an erroneus or incomplete instrument load. |
|
261 |
|
// Check again that we're clean. |
262 |
if (m_pChannel->instrumentStatus() < 100) |
if (m_pChannel->instrumentStatus() < 100) |
263 |
return; |
return false; |
264 |
|
|
265 |
// Get current channel voice count. |
// Get current channel voice count. |
266 |
int iVoiceCount = ::lscp_get_channel_voice_count(m_pChannel->client(), m_pChannel->channelID()); |
int iVoiceCount = ::lscp_get_channel_voice_count(m_pChannel->client(), m_pChannel->channelID()); |
274 |
// Update the GUI elements... |
// Update the GUI elements... |
275 |
StreamUsageProgressBar->setProgress(iStreamUsage); |
StreamUsageProgressBar->setProgress(iStreamUsage); |
276 |
StreamVoiceCountTextLabel->setText(QString("%1 / %2").arg(iStreamCount).arg(iVoiceCount)); |
StreamVoiceCountTextLabel->setText(QString("%1 / %2").arg(iStreamCount).arg(iVoiceCount)); |
277 |
|
|
278 |
|
// We're clean. |
279 |
|
return true; |
280 |
} |
} |
281 |
|
|
282 |
|
|