25 |
|
|
26 |
#include "qsamplerMainForm.h" |
#include "qsamplerMainForm.h" |
27 |
|
|
28 |
|
using namespace QSampler; |
29 |
|
|
30 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
31 |
// qsamplerInstrument - MIDI instrument map structure. |
// qsamplerInstrument - MIDI instrument map structure. |
159 |
{ |
{ |
160 |
#ifdef CONFIG_MIDI_INSTRUMENT |
#ifdef CONFIG_MIDI_INSTRUMENT |
161 |
|
|
162 |
qsamplerMainForm *pMainForm = qsamplerMainForm::getInstance(); |
MainForm *pMainForm = MainForm::getInstance(); |
163 |
if (pMainForm == NULL) |
if (pMainForm == NULL) |
164 |
return false; |
return false; |
165 |
if (pMainForm->client() == NULL) |
if (pMainForm->client() == NULL) |
193 |
|
|
194 |
if (::lscp_map_midi_instrument(pMainForm->client(), &instr, |
if (::lscp_map_midi_instrument(pMainForm->client(), &instr, |
195 |
m_sEngineName.latin1(), |
m_sEngineName.latin1(), |
196 |
lscpEscapePath(m_sInstrumentFile).latin1(), |
qsamplerUtilities::lscpEscapePath(m_sInstrumentFile).latin1(), |
197 |
m_iInstrumentNr, |
m_iInstrumentNr, |
198 |
m_fVolume, |
m_fVolume, |
199 |
load_mode, |
load_mode, |
219 |
if (m_iMap < 0 || m_iBank < 0 || m_iProg < 0) |
if (m_iMap < 0 || m_iBank < 0 || m_iProg < 0) |
220 |
return false; |
return false; |
221 |
|
|
222 |
qsamplerMainForm *pMainForm = qsamplerMainForm::getInstance(); |
MainForm *pMainForm = MainForm::getInstance(); |
223 |
if (pMainForm == NULL) |
if (pMainForm == NULL) |
224 |
return false; |
return false; |
225 |
if (pMainForm->client() == NULL) |
if (pMainForm->client() == NULL) |
253 |
if (m_iMap < 0 || m_iBank < 0 || m_iProg < 0) |
if (m_iMap < 0 || m_iBank < 0 || m_iProg < 0) |
254 |
return false; |
return false; |
255 |
|
|
256 |
qsamplerMainForm *pMainForm = qsamplerMainForm::getInstance(); |
MainForm *pMainForm = MainForm::getInstance(); |
257 |
if (pMainForm == NULL) |
if (pMainForm == NULL) |
258 |
return false; |
return false; |
259 |
if (pMainForm->client() == NULL) |
if (pMainForm->client() == NULL) |
272 |
return false; |
return false; |
273 |
} |
} |
274 |
|
|
275 |
m_sName = pInstrInfo->name; |
m_sName = qsamplerUtilities::lscpEscapedTextToRaw(pInstrInfo->name); |
276 |
m_sEngineName = pInstrInfo->engine_name; |
m_sEngineName = pInstrInfo->engine_name; |
277 |
m_sInstrumentName = pInstrInfo->instrument_name; |
m_sInstrumentName = qsamplerUtilities::lscpEscapedTextToRaw(pInstrInfo->instrument_name); |
278 |
m_sInstrumentFile = pInstrInfo->instrument_file; |
m_sInstrumentFile = qsamplerUtilities::lscpEscapedPathToPosix(pInstrInfo->instrument_file); |
279 |
m_iInstrumentNr = pInstrInfo->instrument_nr; |
m_iInstrumentNr = pInstrInfo->instrument_nr; |
280 |
m_fVolume = pInstrInfo->volume; |
m_fVolume = pInstrInfo->volume; |
281 |
|
|
314 |
{ |
{ |
315 |
QStringList maps; |
QStringList maps; |
316 |
|
|
317 |
qsamplerMainForm *pMainForm = qsamplerMainForm::getInstance(); |
MainForm *pMainForm = MainForm::getInstance(); |
318 |
if (pMainForm == NULL) |
if (pMainForm == NULL) |
319 |
return maps; |
return maps; |
320 |
if (pMainForm->client() == NULL) |
if (pMainForm->client() == NULL) |
342 |
{ |
{ |
343 |
QString sMapName; |
QString sMapName; |
344 |
|
|
345 |
qsamplerMainForm *pMainForm = qsamplerMainForm::getInstance(); |
MainForm *pMainForm = MainForm::getInstance(); |
346 |
if (pMainForm == NULL) |
if (pMainForm == NULL) |
347 |
return sMapName; |
return sMapName; |
348 |
if (pMainForm->client() == NULL) |
if (pMainForm->client() == NULL) |
356 |
if (::lscp_client_get_errno(pMainForm->client())) |
if (::lscp_client_get_errno(pMainForm->client())) |
357 |
pMainForm->appendMessagesClient("lscp_get_midi_instrument_name"); |
pMainForm->appendMessagesClient("lscp_get_midi_instrument_name"); |
358 |
} |
} |
359 |
sMapName = QString("%1 - %2").arg(iMidiMap).arg(pszMapName); |
sMapName = QString("%1 - %2").arg(iMidiMap).arg(qsamplerUtilities::lscpEscapedTextToRaw(pszMapName)); |
360 |
#endif |
#endif |
361 |
|
|
362 |
return sMapName; |
return sMapName; |