79 |
SLOT(channelEdit())); |
SLOT(channelEdit())); |
80 |
} |
} |
81 |
|
|
82 |
ChannelStrip::~ChannelStrip() { |
|
83 |
|
ChannelStrip::~ChannelStrip (void) |
84 |
|
{ |
85 |
// Destroy existing channel descriptor. |
// Destroy existing channel descriptor. |
86 |
if (m_pChannel) |
if (m_pChannel) |
87 |
delete m_pChannel; |
delete m_pChannel; |
163 |
setAcceptDrops(true); |
setAcceptDrops(true); |
164 |
} |
} |
165 |
|
|
166 |
|
|
167 |
// Channel secriptor accessor. |
// Channel secriptor accessor. |
168 |
qsamplerChannel *ChannelStrip::channel (void) const |
qsamplerChannel *ChannelStrip::channel (void) const |
169 |
{ |
{ |
301 |
|
|
302 |
// Instrument name... |
// Instrument name... |
303 |
if (m_pChannel->instrumentName().isEmpty()) { |
if (m_pChannel->instrumentName().isEmpty()) { |
304 |
if (m_pChannel->instrumentStatus() >= 0) |
if (m_pChannel->instrumentStatus() >= 0) { |
305 |
m_ui.InstrumentNameTextLabel->setText(' ' + qsamplerChannel::loadingInstrument()); |
m_ui.InstrumentNameTextLabel->setText( |
306 |
else |
' ' + qsamplerChannel::loadingInstrument()); |
307 |
m_ui.InstrumentNameTextLabel->setText(' ' + qsamplerChannel::noInstrumentName()); |
} else { |
308 |
} else |
m_ui.InstrumentNameTextLabel->setText( |
309 |
m_ui.InstrumentNameTextLabel->setText(' ' + m_pChannel->instrumentName()); |
' ' + qsamplerChannel::noInstrumentName()); |
310 |
|
} |
311 |
|
} else { |
312 |
|
m_ui.InstrumentNameTextLabel->setText( |
313 |
|
' ' + m_pChannel->instrumentName()); |
314 |
|
} |
315 |
|
|
316 |
return true; |
return true; |
317 |
} |
} |
352 |
// Update strip caption. |
// Update strip caption. |
353 |
QString sText = m_pChannel->channelName(); |
QString sText = m_pChannel->channelName(); |
354 |
setWindowTitle(sText); |
setWindowTitle(sText); |
355 |
m_ui.ChannelSetupPushButton->setText(sText); |
m_ui.ChannelSetupPushButton->setText('&' + sText); |
356 |
|
|
357 |
// Check if we're up and connected. |
// Check if we're up and connected. |
358 |
MainForm* pMainForm = MainForm::getInstance(); |
MainForm* pMainForm = MainForm::getInstance(); |
363 |
m_pChannel->updateChannelInfo(); |
m_pChannel->updateChannelInfo(); |
364 |
|
|
365 |
// Engine name... |
// Engine name... |
366 |
if (m_pChannel->engineName().isEmpty()) |
if (m_pChannel->engineName().isEmpty()) { |
367 |
m_ui.EngineNameTextLabel->setText(' ' + qsamplerChannel::noEngineName()); |
m_ui.EngineNameTextLabel->setText( |
368 |
else |
' ' + qsamplerChannel::noEngineName()); |
369 |
m_ui.EngineNameTextLabel->setText(' ' + m_pChannel->engineName()); |
} else { |
370 |
|
m_ui.EngineNameTextLabel->setText( |
371 |
|
' ' + m_pChannel->engineName()); |
372 |
|
} |
373 |
|
|
374 |
// Instrument name... |
// Instrument name... |
375 |
updateInstrumentName(false); |
updateInstrumentName(false); |
391 |
if (iInstrumentStatus < 0) { |
if (iInstrumentStatus < 0) { |
392 |
pal.setColor(QPalette::Foreground, Qt::red); |
pal.setColor(QPalette::Foreground, Qt::red); |
393 |
m_ui.InstrumentStatusTextLabel->setPalette(pal); |
m_ui.InstrumentStatusTextLabel->setPalette(pal); |
394 |
m_ui.InstrumentStatusTextLabel->setText(tr("ERR%1").arg(iInstrumentStatus)); |
m_ui.InstrumentStatusTextLabel->setText( |
395 |
|
tr("ERR%1").arg(iInstrumentStatus)); |
396 |
m_iErrorCount++; |
m_iErrorCount++; |
397 |
return false; |
return false; |
398 |
} |
} |
400 |
pal.setColor(QPalette::Foreground, |
pal.setColor(QPalette::Foreground, |
401 |
iInstrumentStatus < 100 ? Qt::yellow : Qt::green); |
iInstrumentStatus < 100 ? Qt::yellow : Qt::green); |
402 |
m_ui.InstrumentStatusTextLabel->setPalette(pal); |
m_ui.InstrumentStatusTextLabel->setPalette(pal); |
403 |
m_ui.InstrumentStatusTextLabel->setText(QString::number(iInstrumentStatus) + '%'); |
m_ui.InstrumentStatusTextLabel->setText( |
404 |
|
QString::number(iInstrumentStatus) + '%'); |
405 |
m_iErrorCount = 0; |
m_iErrorCount = 0; |
406 |
|
|
407 |
#ifdef CONFIG_MUTE_SOLO |
#ifdef CONFIG_MUTE_SOLO |
442 |
return false; |
return false; |
443 |
|
|
444 |
// Get current channel voice count. |
// Get current channel voice count. |
445 |
int iVoiceCount = ::lscp_get_channel_voice_count(pMainForm->client(), m_pChannel->channelID()); |
int iVoiceCount = ::lscp_get_channel_voice_count( |
446 |
|
pMainForm->client(), m_pChannel->channelID()); |
447 |
// Get current stream count. |
// Get current stream count. |
448 |
int iStreamCount = ::lscp_get_channel_stream_count(pMainForm->client(), m_pChannel->channelID()); |
int iStreamCount = ::lscp_get_channel_stream_count( |
449 |
|
pMainForm->client(), m_pChannel->channelID()); |
450 |
// Get current channel buffer fill usage. |
// Get current channel buffer fill usage. |
451 |
// As benno has suggested this is the percentage usage |
// As benno has suggested this is the percentage usage |
452 |
// of the least filled buffer stream... |
// of the least filled buffer stream... |
453 |
int iStreamUsage = ::lscp_get_channel_stream_usage(pMainForm->client(), m_pChannel->channelID());; |
int iStreamUsage = ::lscp_get_channel_stream_usage( |
454 |
|
pMainForm->client(), m_pChannel->channelID());; |
455 |
|
|
456 |
// Update the GUI elements... |
// Update the GUI elements... |
457 |
m_ui.StreamUsageProgressBar->setValue(iStreamUsage); |
m_ui.StreamUsageProgressBar->setValue(iStreamUsage); |
458 |
m_ui.StreamVoiceCountTextLabel->setText(QString("%1 / %2").arg(iStreamCount).arg(iVoiceCount)); |
m_ui.StreamVoiceCountTextLabel->setText( |
459 |
|
QString("%1 / %2").arg(iStreamCount).arg(iVoiceCount)); |
460 |
|
|
461 |
// We're clean. |
// We're clean. |
462 |
return true; |
return true; |