50 |
// m_sInstrumentFile = m_sInstrumentName; |
// m_sInstrumentFile = m_sInstrumentName; |
51 |
m_iInstrumentNr = -1; |
m_iInstrumentNr = -1; |
52 |
m_iInstrumentStatus = -1; |
m_iInstrumentStatus = -1; |
53 |
m_sMidiDriver = "Alsa"; // DEPRECATED. |
m_sMidiDriver = "ALSA"; |
54 |
m_iMidiDevice = -1; |
m_iMidiDevice = -1; |
55 |
m_iMidiPort = -1; |
m_iMidiPort = -1; |
56 |
m_iMidiChannel = -1; |
m_iMidiChannel = -1; |
57 |
m_sAudioDriver = "Alsa"; // DEPRECATED. |
m_sAudioDriver = "ALSA"; |
58 |
m_iAudioDevice = -1; |
m_iAudioDevice = -1; |
59 |
m_fVolume = 0.0; |
m_fVolume = 0.0; |
60 |
|
m_bMute = false; |
61 |
|
m_bSolo = false; |
62 |
} |
} |
63 |
|
|
64 |
// Default destructor. |
// Default destructor. |
132 |
m_iChannelID = -1; |
m_iChannelID = -1; |
133 |
} |
} |
134 |
} |
} |
135 |
|
|
136 |
// Return whether we've removed the channel... |
// Return whether we've removed the channel... |
137 |
return (m_iChannelID < 0); |
return (m_iChannelID < 0); |
138 |
} |
} |
169 |
return false; |
return false; |
170 |
if (m_iInstrumentStatus == 100 && m_sEngineName == sEngineName) |
if (m_iInstrumentStatus == 100 && m_sEngineName == sEngineName) |
171 |
return true; |
return true; |
172 |
|
|
173 |
if (::lscp_load_engine(client(), sEngineName.latin1(), m_iChannelID) != LSCP_OK) { |
if (::lscp_load_engine(client(), sEngineName.latin1(), m_iChannelID) != LSCP_OK) { |
174 |
appendMessagesClient("lscp_load_engine"); |
appendMessagesClient("lscp_load_engine"); |
175 |
return false; |
return false; |
222 |
|
|
223 |
appendMessages(QObject::tr("Instrument: \"%1\" (%2).") |
appendMessages(QObject::tr("Instrument: \"%1\" (%2).") |
224 |
.arg(sInstrumentFile).arg(iInstrumentNr)); |
.arg(sInstrumentFile).arg(iInstrumentNr)); |
225 |
|
|
226 |
return setInstrument(sInstrumentFile, iInstrumentNr); |
return setInstrument(sInstrumentFile, iInstrumentNr); |
227 |
} |
} |
228 |
|
|
418 |
} |
} |
419 |
|
|
420 |
|
|
421 |
|
// Sampler channel mute state. |
422 |
|
bool qsamplerChannel::channelMute (void) const |
423 |
|
{ |
424 |
|
return m_bMute; |
425 |
|
} |
426 |
|
|
427 |
|
bool qsamplerChannel::setChannelMute ( bool bMute ) |
428 |
|
{ |
429 |
|
if (client() == NULL || m_iChannelID < 0) |
430 |
|
return false; |
431 |
|
if (m_iInstrumentStatus == 100 && ((m_bMute && bMute) || (!m_bMute && !bMute))) |
432 |
|
return true; |
433 |
|
|
434 |
|
#ifdef CONFIG_MUTE_SOLO |
435 |
|
if (::lscp_set_channel_mute(client(), m_iChannelID, bMute) != LSCP_OK) { |
436 |
|
appendMessagesClient("lscp_set_channel_mute"); |
437 |
|
return false; |
438 |
|
} |
439 |
|
appendMessages(QObject::tr("Mute: %1.").arg((int) bMute)); |
440 |
|
m_bMute = bMute; |
441 |
|
return true; |
442 |
|
#else |
443 |
|
return false; |
444 |
|
#endif |
445 |
|
} |
446 |
|
|
447 |
|
|
448 |
|
// Sampler channel solo state. |
449 |
|
bool qsamplerChannel::channelSolo (void) const |
450 |
|
{ |
451 |
|
return m_bSolo; |
452 |
|
} |
453 |
|
|
454 |
|
bool qsamplerChannel::setChannelSolo ( bool bSolo ) |
455 |
|
{ |
456 |
|
if (client() == NULL || m_iChannelID < 0) |
457 |
|
return false; |
458 |
|
if (m_iInstrumentStatus == 100 && ((m_bSolo && bSolo) || (!m_bSolo && !bSolo))) |
459 |
|
return true; |
460 |
|
|
461 |
|
#ifdef CONFIG_MUTE_SOLO |
462 |
|
if (::lscp_set_channel_solo(client(), m_iChannelID, bSolo) != LSCP_OK) { |
463 |
|
appendMessagesClient("lscp_set_channel_solo"); |
464 |
|
return false; |
465 |
|
} |
466 |
|
appendMessages(QObject::tr("Solo: %1.").arg((int) bSolo)); |
467 |
|
m_bSolo = bSolo; |
468 |
|
return true; |
469 |
|
#else |
470 |
|
return false; |
471 |
|
#endif |
472 |
|
} |
473 |
|
|
474 |
|
|
475 |
// Istrument name remapper. |
// Istrument name remapper. |
476 |
void qsamplerChannel::updateInstrumentName (void) |
void qsamplerChannel::updateInstrumentName (void) |
477 |
{ |
{ |
520 |
m_iMidiChannel = pChannelInfo->midi_channel; |
m_iMidiChannel = pChannelInfo->midi_channel; |
521 |
m_iAudioDevice = pChannelInfo->audio_device; |
m_iAudioDevice = pChannelInfo->audio_device; |
522 |
m_fVolume = pChannelInfo->volume; |
m_fVolume = pChannelInfo->volume; |
523 |
|
#ifdef CONFIG_MUTE_SOLO |
524 |
|
m_bMute = pChannelInfo->mute; |
525 |
|
m_bSolo = pChannelInfo->solo; |
526 |
|
#endif |
527 |
// Some sanity checks. |
// Some sanity checks. |
528 |
if (m_sEngineName == "NONE" || m_sEngineName.isEmpty()) |
if (m_sEngineName == "NONE" || m_sEngineName.isEmpty()) |
529 |
m_sEngineName = QString::null; |
m_sEngineName = QString::null; |
531 |
m_sInstrumentFile = QString::null; |
m_sInstrumentFile = QString::null; |
532 |
m_sInstrumentName = QString::null; |
m_sInstrumentName = QString::null; |
533 |
} |
} |
534 |
|
|
535 |
// FIXME: DEPRECATED... |
// Time for device info grabbing... |
536 |
lscp_device_info_t *pDeviceInfo; |
lscp_device_info_t *pDeviceInfo; |
537 |
const QString sNone = QObject::tr("(none)"); |
const QString sNone = QObject::tr("(none)"); |
538 |
// Audio device driver type. |
// Audio device driver type. |
579 |
bool bResult = false; |
bool bResult = false; |
580 |
|
|
581 |
appendMessages(QObject::tr("setup...")); |
appendMessages(QObject::tr("setup...")); |
582 |
|
|
583 |
qsamplerChannelForm *pChannelForm = new qsamplerChannelForm(pParent); |
qsamplerChannelForm *pChannelForm = new qsamplerChannelForm(pParent); |
584 |
if (pChannelForm) { |
if (pChannelForm) { |
585 |
pChannelForm->setup(this); |
pChannelForm->setup(this); |
661 |
if (isInstrumentFile(sInstrumentFile)) { |
if (isInstrumentFile(sInstrumentFile)) { |
662 |
#ifdef CONFIG_LIBGIG |
#ifdef CONFIG_LIBGIG |
663 |
if (bInstrumentNames) { |
if (bInstrumentNames) { |
664 |
RIFF::File *pRiff = new RIFF::File(sInstrumentFile); |
RIFF::File *pRiff = new RIFF::File(sInstrumentFile.latin1()); |
665 |
gig::File *pGig = new gig::File(pRiff); |
gig::File *pGig = new gig::File(pRiff); |
666 |
gig::Instrument *pInstrument = pGig->GetFirstInstrument(); |
gig::Instrument *pInstrument = pGig->GetFirstInstrument(); |
667 |
while (pInstrument) { |
while (pInstrument) { |
692 |
sInstrumentName = QFileInfo(sInstrumentFile).fileName(); |
sInstrumentName = QFileInfo(sInstrumentFile).fileName(); |
693 |
#ifdef CONFIG_LIBGIG |
#ifdef CONFIG_LIBGIG |
694 |
if (bInstrumentNames) { |
if (bInstrumentNames) { |
695 |
RIFF::File *pRiff = new RIFF::File(sInstrumentFile); |
RIFF::File *pRiff = new RIFF::File(sInstrumentFile.latin1()); |
696 |
gig::File *pGig = new gig::File(pRiff); |
gig::File *pGig = new gig::File(pRiff); |
697 |
int iIndex = 0; |
int iIndex = 0; |
698 |
gig::Instrument *pInstrument = pGig->GetFirstInstrument(); |
gig::Instrument *pInstrument = pGig->GetFirstInstrument(); |
728 |
return QObject::tr("(No instrument)"); |
return QObject::tr("(No instrument)"); |
729 |
} |
} |
730 |
|
|
731 |
|
QString qsamplerChannel::loadingInstrument (void) { |
732 |
|
return QObject::tr("(Loading instrument...)"); |
733 |
|
} |
734 |
|
|
735 |
|
|
736 |
// end of qsamplerChannel.cpp |
// end of qsamplerChannel.cpp |