1 |
// qsamplerChannel.cpp |
// qsamplerChannel.cpp |
2 |
// |
// |
3 |
/**************************************************************************** |
/**************************************************************************** |
4 |
Copyright (C) 2004-2006, rncbc aka Rui Nuno Capela. All rights reserved. |
Copyright (C) 2004-2007, rncbc aka Rui Nuno Capela. All rights reserved. |
5 |
|
|
6 |
This program is free software; you can redistribute it and/or |
This program is free software; you can redistribute it and/or |
7 |
modify it under the terms of the GNU General Public License |
modify it under the terms of the GNU General Public License |
639 |
|
|
640 |
// Set the audio routing map. |
// Set the audio routing map. |
641 |
m_audioRouting.clear(); |
m_audioRouting.clear(); |
642 |
char **ppszRouting = pChannelInfo->audio_routing; |
#ifdef CONFIG_AUDIO_ROUTING |
643 |
for (int i = 0; ppszRouting && ppszRouting[i]; i++) { |
int *piAudioRouting = pChannelInfo->audio_routing; |
644 |
m_audioRouting[i] = ::atoi(ppszRouting[i]); |
for (int i = 0; piAudioRouting && piAudioRouting[i] >= 0; i++) |
645 |
} |
m_audioRouting[i] = piAudioRouting[i]; |
646 |
|
#else |
647 |
|
char **ppszAudioRouting = pChannelInfo->audio_routing; |
648 |
|
for (int i = 0; ppszAudioRouting && ppszAudioRouting[i]; i++) |
649 |
|
m_audioRouting[i] = ::atoi(ppszAudioRouting[i]); |
650 |
|
#endif |
651 |
|
|
652 |
return true; |
return true; |
653 |
} |
} |
673 |
} |
} |
674 |
|
|
675 |
|
|
676 |
|
// Spawn instrument editor method. |
677 |
|
bool qsamplerChannel::editChannel (void) |
678 |
|
{ |
679 |
|
#ifdef CONFIG_EDIT_INSTRUMENT |
680 |
|
qsamplerMainForm *pMainForm = qsamplerMainForm::getInstance(); |
681 |
|
if (pMainForm == NULL) |
682 |
|
return false; |
683 |
|
if (pMainForm->client() == NULL || m_iChannelID < 0) |
684 |
|
return false; |
685 |
|
|
686 |
|
if (::lscp_edit_instrument(pMainForm->client(), m_iChannelID) != LSCP_OK) { |
687 |
|
appendMessagesClient("lscp_edit_instrument"); |
688 |
|
appendMessagesError( |
689 |
|
"Could not launch an appropriate instrument editor for the\n" |
690 |
|
"given instrument! Make sure you have an appropriate\n" |
691 |
|
"instrument editor like 'gigedit' installed and that it placed\n" |
692 |
|
"its mandatory DLL file into the sampler's plugin directory." |
693 |
|
); |
694 |
|
return false; |
695 |
|
} |
696 |
|
|
697 |
|
appendMessages(QObject::tr("edit instrument.")); |
698 |
|
|
699 |
|
return true; |
700 |
|
#else |
701 |
|
appendMessagesError( |
702 |
|
"Sorry, QSampler was compiled for a version of liblscp which lacks\n" |
703 |
|
"this feature. You may want to update liblscp and recompile\n" |
704 |
|
"QSampler afterwards." |
705 |
|
); |
706 |
|
return false; |
707 |
|
#endif |
708 |
|
} |
709 |
|
|
710 |
|
|
711 |
// Channel setup dialog form. |
// Channel setup dialog form. |
712 |
bool qsamplerChannel::channelSetup ( QWidget *pParent ) |
bool qsamplerChannel::channelSetup ( QWidget *pParent ) |
713 |
{ |
{ |