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(); |
201 |
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)); |
202 |
|
|
203 |
// And update the both GUI volume elements. |
// And update the both GUI volume elements. |
204 |
updateChannelVolume(); |
return updateChannelVolume(); |
205 |
} |
} |
206 |
|
|
207 |
|
|
208 |
// Do the dirty volume change. |
// Do the dirty volume change. |
209 |
void qsamplerChannelStrip::updateChannelVolume (void) |
bool qsamplerChannelStrip::updateChannelVolume (void) |
210 |
{ |
{ |
211 |
if (m_pChannel == NULL) |
if (m_pChannel == NULL) |
212 |
return; |
return false; |
213 |
|
|
214 |
// Convert... |
// Convert... |
215 |
#ifdef CONFIG_ROUND |
#ifdef CONFIG_ROUND |
234 |
VolumeSlider->setValue(iVolume); |
VolumeSlider->setValue(iVolume); |
235 |
VolumeSpinBox->setValue(iVolume); |
VolumeSpinBox->setValue(iVolume); |
236 |
m_iDirtyChange--; |
m_iDirtyChange--; |
237 |
|
|
238 |
|
return true; |
239 |
} |
} |
240 |
|
|
241 |
|
|
242 |
// Update whole channel usage state. |
// Update whole channel usage state. |
243 |
void qsamplerChannelStrip::updateChannelUsage (void) |
bool qsamplerChannelStrip::updateChannelUsage (void) |
244 |
{ |
{ |
245 |
if (m_pChannel == NULL) |
if (m_pChannel == NULL) |
246 |
return; |
return false; |
247 |
if (m_pChannel->client() == NULL) |
if (m_pChannel->client() == NULL) |
248 |
return; |
return false; |
249 |
|
|
250 |
// Conditionally update whole channel status info. |
// Conditionally update whole channel status info. |
251 |
if (m_pChannel->instrumentStatus() >= 0 && m_pChannel->instrumentStatus() < 100) { |
if (m_pChannel->instrumentStatus() >= 0 && m_pChannel->instrumentStatus() < 100) { |
256 |
} |
} |
257 |
// Leave, if we still have an erroneus or incomplete instrument load. |
// Leave, if we still have an erroneus or incomplete instrument load. |
258 |
if (m_pChannel->instrumentStatus() < 100) |
if (m_pChannel->instrumentStatus() < 100) |
259 |
return; |
return false; |
260 |
|
|
261 |
// Get current channel voice count. |
// Get current channel voice count. |
262 |
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()); |
270 |
// Update the GUI elements... |
// Update the GUI elements... |
271 |
StreamUsageProgressBar->setProgress(iStreamUsage); |
StreamUsageProgressBar->setProgress(iStreamUsage); |
272 |
StreamVoiceCountTextLabel->setText(QString("%1 / %2").arg(iStreamCount).arg(iVoiceCount)); |
StreamVoiceCountTextLabel->setText(QString("%1 / %2").arg(iStreamCount).arg(iVoiceCount)); |
273 |
|
|
274 |
|
// We're clean. |
275 |
|
return true; |
276 |
} |
} |
277 |
|
|
278 |
|
|