20 |
|
|
21 |
*****************************************************************************/ |
*****************************************************************************/ |
22 |
|
|
|
#include "qsamplerUtilities.h" |
|
23 |
#include "qsamplerAbout.h" |
#include "qsamplerAbout.h" |
24 |
#include "qsamplerChannel.h" |
#include "qsamplerChannel.h" |
25 |
|
#include "qsamplerUtilities.h" |
26 |
|
|
27 |
#include "qsamplerMainForm.h" |
#include "qsamplerMainForm.h" |
28 |
#include "qsamplerChannelForm.h" |
#include "qsamplerChannelForm.h" |
29 |
|
|
30 |
#include <qfileinfo.h> |
#include <QFileInfo> |
31 |
#include <qcombobox.h> |
#include <QComboBox> |
32 |
|
|
33 |
#ifdef CONFIG_LIBGIG |
#ifdef CONFIG_LIBGIG |
34 |
#include "gig.h" |
#include "gig.h" |
38 |
|
|
39 |
#define UNICODE_RIGHT_ARROW QChar(char(0x92), char(0x21)) |
#define UNICODE_RIGHT_ARROW QChar(char(0x92), char(0x21)) |
40 |
|
|
41 |
|
|
42 |
using namespace QSampler; |
using namespace QSampler; |
43 |
|
|
44 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
159 |
if (m_iInstrumentStatus == 100 && m_sEngineName == sEngineName) |
if (m_iInstrumentStatus == 100 && m_sEngineName == sEngineName) |
160 |
return true; |
return true; |
161 |
|
|
162 |
if (::lscp_load_engine(pMainForm->client(), sEngineName.latin1(), m_iChannelID) != LSCP_OK) { |
if (::lscp_load_engine(pMainForm->client(), |
163 |
|
sEngineName.toUtf8().constData(), m_iChannelID) != LSCP_OK) { |
164 |
appendMessagesClient("lscp_load_engine"); |
appendMessagesClient("lscp_load_engine"); |
165 |
return false; |
return false; |
166 |
} |
} |
212 |
if ( |
if ( |
213 |
::lscp_load_instrument_non_modal( |
::lscp_load_instrument_non_modal( |
214 |
pMainForm->client(), |
pMainForm->client(), |
215 |
qsamplerUtilities::lscpEscapePath(sInstrumentFile).latin1(), |
qsamplerUtilities::lscpEscapePath( |
216 |
|
sInstrumentFile).toUtf8().constData(), |
217 |
iInstrumentNr, m_iChannelID |
iInstrumentNr, m_iChannelID |
218 |
) != LSCP_OK |
) != LSCP_OK |
219 |
) { |
) { |
260 |
if (m_iInstrumentStatus == 100 && m_sMidiDriver == sMidiDriver) |
if (m_iInstrumentStatus == 100 && m_sMidiDriver == sMidiDriver) |
261 |
return true; |
return true; |
262 |
|
|
263 |
if (::lscp_set_channel_midi_type(pMainForm->client(), m_iChannelID, sMidiDriver.latin1()) != LSCP_OK) { |
if (::lscp_set_channel_midi_type(pMainForm->client(), |
264 |
|
m_iChannelID, sMidiDriver.toUtf8().constData()) != LSCP_OK) { |
265 |
appendMessagesClient("lscp_set_channel_midi_type"); |
appendMessagesClient("lscp_set_channel_midi_type"); |
266 |
return false; |
return false; |
267 |
} |
} |
429 |
if (m_iInstrumentStatus == 100 && m_sAudioDriver == sAudioDriver) |
if (m_iInstrumentStatus == 100 && m_sAudioDriver == sAudioDriver) |
430 |
return true; |
return true; |
431 |
|
|
432 |
if (::lscp_set_channel_audio_type(pMainForm->client(), m_iChannelID, sAudioDriver.latin1()) != LSCP_OK) { |
if (::lscp_set_channel_audio_type(pMainForm->client(), |
433 |
|
m_iChannelID, sAudioDriver.toUtf8().constData()) != LSCP_OK) { |
434 |
appendMessagesClient("lscp_set_channel_audio_type"); |
appendMessagesClient("lscp_set_channel_audio_type"); |
435 |
return false; |
return false; |
436 |
} |
} |
809 |
bool bResult = false; |
bool bResult = false; |
810 |
|
|
811 |
QFile file(sInstrumentFile); |
QFile file(sInstrumentFile); |
812 |
if (file.open(IO_ReadOnly)) { |
if (file.open(QIODevice::ReadOnly)) { |
813 |
char achHeader[16]; |
char achHeader[16]; |
814 |
if (file.readBlock(achHeader, 16)) { |
if (file.read(achHeader, 16) > 0) { |
815 |
bResult = (::memcmp(&achHeader[0], "RIFF", 4) == 0 |
bResult = (::memcmp(&achHeader[0], "RIFF", 4) == 0 |
816 |
&& ::memcmp(&achHeader[8], "DLS LIST", 8) == 0); |
&& ::memcmp(&achHeader[8], "DLS LIST", 8) == 0); |
817 |
} |
} |
832 |
if (isInstrumentFile(sInstrumentFile)) { |
if (isInstrumentFile(sInstrumentFile)) { |
833 |
#ifdef CONFIG_LIBGIG |
#ifdef CONFIG_LIBGIG |
834 |
if (bInstrumentNames) { |
if (bInstrumentNames) { |
835 |
RIFF::File *pRiff = new RIFF::File(sInstrumentFile.latin1()); |
RIFF::File *pRiff |
836 |
|
= new RIFF::File(sInstrumentFile.toUtf8().constData()); |
837 |
gig::File *pGig = new gig::File(pRiff); |
gig::File *pGig = new gig::File(pRiff); |
838 |
gig::Instrument *pInstrument = pGig->GetFirstInstrument(); |
gig::Instrument *pInstrument = pGig->GetFirstInstrument(); |
839 |
while (pInstrument) { |
while (pInstrument) { |
864 |
sInstrumentName = QFileInfo(sInstrumentFile).fileName(); |
sInstrumentName = QFileInfo(sInstrumentFile).fileName(); |
865 |
#ifdef CONFIG_LIBGIG |
#ifdef CONFIG_LIBGIG |
866 |
if (bInstrumentNames) { |
if (bInstrumentNames) { |
867 |
RIFF::File *pRiff = new RIFF::File(sInstrumentFile.latin1()); |
RIFF::File *pRiff |
868 |
gig::File *pGig = new gig::File(pRiff); |
= new RIFF::File(sInstrumentFile.toUtf8().constData()); |
869 |
|
gig::File *pGig = new gig::File(pRiff); |
870 |
int iIndex = 0; |
int iIndex = 0; |
871 |
gig::Instrument *pInstrument = pGig->GetFirstInstrument(); |
gig::Instrument *pInstrument = pGig->GetFirstInstrument(); |
872 |
while (pInstrument) { |
while (pInstrument) { |
948 |
|
|
949 |
// The common device port item list. |
// The common device port item list. |
950 |
qsamplerDevicePortList& ports = pDevice->ports(); |
qsamplerDevicePortList& ports = pDevice->ports(); |
951 |
qsamplerDevicePort* pPort; |
QListIterator<qsamplerDevicePort *> iter(ports); |
952 |
for (pPort = ports.first(); pPort; pPort = ports.next()) { |
while (iter.hasNext()) { |
953 |
|
qsamplerDevicePort *pPort = iter.next(); |
954 |
item.options.append( |
item.options.append( |
955 |
pDevice->deviceTypeName() |
pDevice->deviceTypeName() |
956 |
+ ' ' + pDevice->driverName() |
+ ' ' + pDevice->driverName() |