2 |
// |
// |
3 |
// ui.h extension file, included from the uic-generated form implementation. |
// ui.h extension file, included from the uic-generated form implementation. |
4 |
/**************************************************************************** |
/**************************************************************************** |
5 |
Copyright (C) 2004-2005, rncbc aka Rui Nuno Capela. All rights reserved. |
Copyright (C) 2004-2007, rncbc aka Rui Nuno Capela. All rights reserved. |
6 |
|
|
7 |
This program is free software; you can redistribute it and/or |
This program is free software; you can redistribute it and/or |
8 |
modify it under the terms of the GNU General Public License |
modify it under the terms of the GNU General Public License |
14 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 |
GNU General Public License for more details. |
GNU General Public License for more details. |
16 |
|
|
17 |
You should have received a copy of the GNU General Public License |
You should have received a copy of the GNU General Public License along |
18 |
along with this program; if not, write to the Free Software |
with this program; if not, write to the Free Software Foundation, Inc., |
19 |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
20 |
|
|
21 |
*****************************************************************************/ |
*****************************************************************************/ |
22 |
|
|
117 |
|
|
118 |
// Set the new one... |
// Set the new one... |
119 |
m_pChannel = pChannel; |
m_pChannel = pChannel; |
120 |
|
|
121 |
// Stabilize this around. |
// Stabilize this around. |
122 |
updateChannelInfo(); |
updateChannelInfo(); |
123 |
|
|
171 |
pLabel->setPaletteBackgroundPixmap(pm); |
pLabel->setPaletteBackgroundPixmap(pm); |
172 |
delete pList; |
delete pList; |
173 |
} |
} |
174 |
|
|
175 |
// And this standalone too. |
// And this standalone too. |
176 |
StreamVoiceCountTextLabel->setPaletteBackgroundPixmap(pm); |
StreamVoiceCountTextLabel->setPaletteBackgroundPixmap(pm); |
177 |
} |
} |
195 |
|
|
196 |
// Invoke the channel setup dialog. |
// Invoke the channel setup dialog. |
197 |
bool bResult = m_pChannel->channelSetup(this); |
bool bResult = m_pChannel->channelSetup(this); |
198 |
// Notify that thie channel has changed. |
// Notify that this channel has changed. |
199 |
|
if (bResult) |
200 |
|
emit channelChanged(this); |
201 |
|
|
202 |
|
return bResult; |
203 |
|
} |
204 |
|
|
205 |
|
|
206 |
|
// Channel mute slot. |
207 |
|
bool qsamplerChannelStrip::channelMute ( bool bMute ) |
208 |
|
{ |
209 |
|
if (m_pChannel == NULL) |
210 |
|
return false; |
211 |
|
|
212 |
|
// Invoke the channel mute method. |
213 |
|
bool bResult = m_pChannel->setChannelMute(bMute); |
214 |
|
// Notify that this channel has changed. |
215 |
|
if (bResult) |
216 |
|
emit channelChanged(this); |
217 |
|
|
218 |
|
return bResult; |
219 |
|
} |
220 |
|
|
221 |
|
|
222 |
|
// Channel solo slot. |
223 |
|
bool qsamplerChannelStrip::channelSolo ( bool bSolo ) |
224 |
|
{ |
225 |
|
if (m_pChannel == NULL) |
226 |
|
return false; |
227 |
|
|
228 |
|
// Invoke the channel solo method. |
229 |
|
bool bResult = m_pChannel->setChannelSolo(bSolo); |
230 |
|
// Notify that this channel has changed. |
231 |
if (bResult) |
if (bResult) |
232 |
emit channelChanged(this); |
emit channelChanged(this); |
233 |
|
|
243 |
|
|
244 |
// Invoke the channel reset method. |
// Invoke the channel reset method. |
245 |
bool bResult = m_pChannel->channelReset(); |
bool bResult = m_pChannel->channelReset(); |
246 |
// Notify that thie channel has changed. |
// Notify that this channel has changed. |
247 |
if (bResult) |
if (bResult) |
248 |
emit channelChanged(this); |
emit channelChanged(this); |
249 |
|
|
257 |
if (m_pChannel == NULL) |
if (m_pChannel == NULL) |
258 |
return false; |
return false; |
259 |
|
|
260 |
// Do we refersh the actual name? |
// Do we refresh the actual name? |
261 |
if (bForce) |
if (bForce) |
262 |
m_pChannel->updateInstrumentName(); |
m_pChannel->updateInstrumentName(); |
263 |
|
|
313 |
{ |
{ |
314 |
if (m_pChannel == NULL) |
if (m_pChannel == NULL) |
315 |
return false; |
return false; |
316 |
|
|
317 |
// Check for error limit/recycle... |
// Check for error limit/recycle... |
318 |
if (m_iErrorCount > QSAMPLER_ERROR_LIMIT) |
if (m_iErrorCount > QSAMPLER_ERROR_LIMIT) |
319 |
return true; |
return true; |
324 |
ChannelSetupPushButton->setText(sText); |
ChannelSetupPushButton->setText(sText); |
325 |
|
|
326 |
// Check if we're up and connected. |
// Check if we're up and connected. |
327 |
if (m_pChannel->client() == NULL) |
qsamplerMainForm *pMainForm = qsamplerMainForm::getInstance(); |
328 |
return false; |
if (pMainForm->client() == NULL) |
329 |
|
return false; |
330 |
|
|
331 |
// Read actual channel information. |
// Read actual channel information. |
332 |
m_pChannel->updateChannelInfo(); |
m_pChannel->updateChannelInfo(); |
341 |
updateInstrumentName(false); |
updateInstrumentName(false); |
342 |
|
|
343 |
// MIDI Port/Channel... |
// MIDI Port/Channel... |
344 |
if (m_pChannel->midiChannel() == LSCP_MIDI_CHANNEL_ALL) |
QString sMidiPortChannel = QString::number(m_pChannel->midiPort()) + " / "; |
345 |
MidiPortChannelTextLabel->setText(QString("%1 / *").arg(m_pChannel->midiPort())); |
if (m_pChannel->midiChannel() == LSCP_MIDI_CHANNEL_ALL) |
346 |
else |
sMidiPortChannel += tr("All"); |
347 |
MidiPortChannelTextLabel->setText(QString("%1 / %2").arg(m_pChannel->midiPort()).arg(m_pChannel->midiChannel() + 1)); |
else |
348 |
|
sMidiPortChannel += QString::number(m_pChannel->midiChannel() + 1); |
349 |
|
MidiPortChannelTextLabel->setText(sMidiPortChannel); |
350 |
|
|
351 |
// Instrument status... |
// Instrument status... |
352 |
int iInstrumentStatus = m_pChannel->instrumentStatus(); |
int iInstrumentStatus = m_pChannel->instrumentStatus(); |
361 |
InstrumentStatusTextLabel->setText(QString::number(iInstrumentStatus) + '%'); |
InstrumentStatusTextLabel->setText(QString::number(iInstrumentStatus) + '%'); |
362 |
m_iErrorCount = 0; |
m_iErrorCount = 0; |
363 |
|
|
364 |
|
#ifdef CONFIG_MUTE_SOLO |
365 |
|
// Mute/Solo button state coloring... |
366 |
|
const QColor& rgbNormal = ChannelSetupPushButton->paletteBackgroundColor(); |
367 |
|
bool bMute = m_pChannel->channelMute(); |
368 |
|
ChannelMutePushButton->setPaletteBackgroundColor(bMute ? Qt::red : rgbNormal); |
369 |
|
ChannelMutePushButton->setDown(bMute); |
370 |
|
bool bSolo = m_pChannel->channelSolo(); |
371 |
|
ChannelSoloPushButton->setPaletteBackgroundColor(bSolo ? Qt::yellow : rgbNormal); |
372 |
|
ChannelSoloPushButton->setDown(bSolo); |
373 |
|
#else |
374 |
|
ChannelMutePushButton->setEnabled(false); |
375 |
|
ChannelSoloPushButton->setEnabled(false); |
376 |
|
#endif |
377 |
|
|
378 |
// And update the both GUI volume elements; |
// And update the both GUI volume elements; |
379 |
// return success if, and only if, intrument is fully loaded... |
// return success if, and only if, intrument is fully loaded... |
380 |
return updateChannelVolume() && (iInstrumentStatus == 100); |
return updateChannelVolume() && (iInstrumentStatus == 100); |
386 |
{ |
{ |
387 |
if (m_pChannel == NULL) |
if (m_pChannel == NULL) |
388 |
return false; |
return false; |
389 |
if (m_pChannel->client() == NULL) |
|
390 |
return false; |
qsamplerMainForm *pMainForm = qsamplerMainForm::getInstance(); |
391 |
|
if (pMainForm->client() == NULL) |
392 |
|
return false; |
393 |
|
|
394 |
// This only makes sense on fully loaded channels... |
// This only makes sense on fully loaded channels... |
395 |
if (m_pChannel->instrumentStatus() < 100) |
if (m_pChannel->instrumentStatus() < 100) |
396 |
return false; |
return false; |
397 |
|
|
398 |
// Get current channel voice count. |
// Get current channel voice count. |
399 |
int iVoiceCount = ::lscp_get_channel_voice_count(m_pChannel->client(), m_pChannel->channelID()); |
int iVoiceCount = ::lscp_get_channel_voice_count(pMainForm->client(), m_pChannel->channelID()); |
400 |
// Get current stream count. |
// Get current stream count. |
401 |
int iStreamCount = ::lscp_get_channel_stream_count(m_pChannel->client(), m_pChannel->channelID()); |
int iStreamCount = ::lscp_get_channel_stream_count(pMainForm->client(), m_pChannel->channelID()); |
402 |
// Get current channel buffer fill usage. |
// Get current channel buffer fill usage. |
403 |
// As benno has suggested this is the percentage usage |
// As benno has suggested this is the percentage usage |
404 |
// of the least filled buffer stream... |
// of the least filled buffer stream... |
405 |
int iStreamUsage = ::lscp_get_channel_stream_usage(m_pChannel->client(), m_pChannel->channelID());; |
int iStreamUsage = ::lscp_get_channel_stream_usage(pMainForm->client(), m_pChannel->channelID());; |
406 |
|
|
407 |
// Update the GUI elements... |
// Update the GUI elements... |
408 |
StreamUsageProgressBar->setProgress(iStreamUsage); |
StreamUsageProgressBar->setProgress(iStreamUsage); |
409 |
StreamVoiceCountTextLabel->setText(QString("%1 / %2").arg(iStreamCount).arg(iVoiceCount)); |
StreamVoiceCountTextLabel->setText(QString("%1 / %2").arg(iStreamCount).arg(iVoiceCount)); |
410 |
|
|
411 |
// We're clean. |
// We're clean. |
412 |
return true; |
return true; |
413 |
} |
} |
441 |
{ |
{ |
442 |
if (m_pChannel == NULL) |
if (m_pChannel == NULL) |
443 |
return; |
return; |
444 |
|
|
445 |
// We'll just show up the main form's edit menu (thru qsamplerChannel). |
// We'll just show up the main form's edit menu (thru qsamplerChannel). |
446 |
m_pChannel->contextMenuEvent(pEvent); |
m_pChannel->contextMenuEvent(pEvent); |
447 |
} |
} |
448 |
|
|
449 |
|
|
450 |
|
// Error count hackish accessors. |
451 |
|
void qsamplerChannelStrip::resetErrorCount (void) |
452 |
|
{ |
453 |
|
m_iErrorCount = 0; |
454 |
|
} |
455 |
|
|
456 |
|
|
457 |
// end of qsamplerChannelStrip.ui.h |
// end of qsamplerChannelStrip.ui.h |