330 |
} |
} |
331 |
|
|
332 |
// Channel setup dialog. |
// Channel setup dialog. |
333 |
void qsamplerChannelStrip::channelSetup (void) |
void qsamplerChannelStrip::channelSetup ( bool bNew ) |
334 |
{ |
{ |
335 |
qsamplerChannelForm *pChannelForm = new qsamplerChannelForm(this); |
qsamplerChannelForm *pChannelForm = new qsamplerChannelForm(this); |
336 |
if (pChannelForm) { |
if (pChannelForm) { |
337 |
pChannelForm->setup(this); |
pChannelForm->setup(this, bNew); |
338 |
if (pChannelForm->exec()) { |
if (pChannelForm->exec()) { |
339 |
updateChannelInfo(); |
updateChannelInfo(); |
340 |
emit channelChanged(this); |
emit channelChanged(this); |
448 |
return; |
return; |
449 |
|
|
450 |
// Conditionally update whole channel status info. |
// Conditionally update whole channel status info. |
451 |
if (m_iInstrumentStatus >= 0 && m_iInstrumentStatus < 100) |
if (m_iInstrumentStatus >= 0 && m_iInstrumentStatus < 100) { |
452 |
updateChannelInfo(); |
updateChannelInfo(); |
453 |
|
// Once we get a complete instrument load, try a implied reset channel.... |
454 |
|
if (m_iInstrumentStatus == 100) { |
455 |
|
if (::lscp_reset_channel(client(), m_iChannelID) != LSCP_OK) |
456 |
|
appendMessagesClient("lscp_reset_channel"); |
457 |
|
} |
458 |
|
} |
459 |
// Leave, if we still have an erroneus or incomplete instrument load. |
// Leave, if we still have an erroneus or incomplete instrument load. |
460 |
if (m_iInstrumentStatus < 100) |
if (m_iInstrumentStatus < 100) |
461 |
return; |
return; |
467 |
// Get current channel buffer fill usage. |
// Get current channel buffer fill usage. |
468 |
// As benno has suggested this is the percentage usage |
// As benno has suggested this is the percentage usage |
469 |
// of the least filled buffer stream... |
// of the least filled buffer stream... |
470 |
int iStreamUsage = 0; |
int iStreamUsage = ::lscp_get_channel_stream_usage(client(), m_iChannelID);; |
471 |
if (iStreamCount > 0) { |
|
|
lscp_buffer_fill_t *pBufferFill = ::lscp_get_channel_buffer_fill(client(), LSCP_USAGE_PERCENTAGE, m_iChannelID); |
|
|
if (pBufferFill) { |
|
|
for (int iStream = 0; iStream < iStreamCount; iStream++) { |
|
|
if (iStreamUsage > (int) pBufferFill[iStream].stream_usage || iStream == 0) |
|
|
iStreamUsage = pBufferFill[iStream].stream_usage; |
|
|
} |
|
|
} |
|
|
} |
|
472 |
// Update the GUI elements... |
// Update the GUI elements... |
473 |
StreamUsageProgressBar->setProgress(iStreamUsage); |
StreamUsageProgressBar->setProgress(iStreamUsage); |
474 |
StreamVoiceCountTextLabel->setText(QString("%1 / %2").arg(iStreamCount).arg(iVoiceCount)); |
StreamVoiceCountTextLabel->setText(QString("%1 / %2").arg(iStreamCount).arg(iVoiceCount)); |