2 |
// |
// |
3 |
/**************************************************************************** |
/**************************************************************************** |
4 |
Copyright (C) 2004-2007, rncbc aka Rui Nuno Capela. All rights reserved. |
Copyright (C) 2004-2007, rncbc aka Rui Nuno Capela. All rights reserved. |
5 |
|
Copyright (C) 2007, Christian Schoenebeck |
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 |
20 |
|
|
21 |
*****************************************************************************/ |
*****************************************************************************/ |
22 |
|
|
|
#include "qsamplerUtilities.h" |
|
23 |
#include "qsamplerAbout.h" |
#include "qsamplerAbout.h" |
24 |
#include "qsamplerInstrument.h" |
#include "qsamplerInstrument.h" |
25 |
|
#include "qsamplerUtilities.h" |
26 |
|
|
27 |
|
#include "qsamplerOptions.h" |
28 |
#include "qsamplerMainForm.h" |
#include "qsamplerMainForm.h" |
29 |
|
|
30 |
|
|
31 |
using namespace QSampler; |
using namespace QSampler; |
32 |
|
|
33 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
195 |
} |
} |
196 |
|
|
197 |
if (::lscp_map_midi_instrument(pMainForm->client(), &instr, |
if (::lscp_map_midi_instrument(pMainForm->client(), &instr, |
198 |
m_sEngineName.latin1(), |
m_sEngineName.toUtf8().constData(), |
199 |
qsamplerUtilities::lscpEscapePath(m_sInstrumentFile).latin1(), |
qsamplerUtilities::lscpEscapePath( |
200 |
m_iInstrumentNr, |
m_sInstrumentFile).toUtf8().constData(), |
201 |
m_fVolume, |
m_iInstrumentNr, m_fVolume, load_mode, |
202 |
load_mode, |
m_sName.toUtf8().constData()) != LSCP_OK) { |
|
m_sName.latin1()) != LSCP_OK) { |
|
203 |
pMainForm->appendMessagesClient("lscp_map_midi_instrument"); |
pMainForm->appendMessagesClient("lscp_map_midi_instrument"); |
204 |
return false; |
return false; |
205 |
} |
} |
274 |
return false; |
return false; |
275 |
} |
} |
276 |
|
|
277 |
m_sName = qsamplerUtilities::lscpEscapedTextToRaw(pInstrInfo->name); |
m_sName = qsamplerUtilities::lscpEscapedTextToRaw(pInstrInfo->name); |
278 |
m_sEngineName = pInstrInfo->engine_name; |
m_sEngineName = pInstrInfo->engine_name; |
279 |
m_sInstrumentName = qsamplerUtilities::lscpEscapedTextToRaw(pInstrInfo->instrument_name); |
m_sInstrumentName = qsamplerUtilities::lscpEscapedTextToRaw( |
280 |
m_sInstrumentFile = qsamplerUtilities::lscpEscapedPathToPosix(pInstrInfo->instrument_file); |
pInstrInfo->instrument_name); |
281 |
m_iInstrumentNr = pInstrInfo->instrument_nr; |
m_sInstrumentFile = qsamplerUtilities::lscpEscapedPathToPosix( |
282 |
m_fVolume = pInstrInfo->volume; |
pInstrInfo->instrument_file); |
283 |
|
m_iInstrumentNr = pInstrInfo->instrument_nr; |
284 |
|
m_fVolume = pInstrInfo->volume; |
285 |
|
|
286 |
switch (pInstrInfo->load_mode) { |
switch (pInstrInfo->load_mode) { |
287 |
case LSCP_LOAD_PERSISTENT: |
case LSCP_LOAD_PERSISTENT: |
360 |
if (::lscp_client_get_errno(pMainForm->client())) |
if (::lscp_client_get_errno(pMainForm->client())) |
361 |
pMainForm->appendMessagesClient("lscp_get_midi_instrument_name"); |
pMainForm->appendMessagesClient("lscp_get_midi_instrument_name"); |
362 |
} |
} |
363 |
sMapName = QString("%1 - %2").arg(iMidiMap).arg(qsamplerUtilities::lscpEscapedTextToRaw(pszMapName)); |
sMapName = QString("%1 - %2").arg(iMidiMap) |
364 |
|
.arg(qsamplerUtilities::lscpEscapedTextToRaw(pszMapName)); |
365 |
#endif |
#endif |
366 |
|
|
367 |
return sMapName; |
return sMapName; |