1 |
// qsamplerInstrument.cpp |
// qsamplerInstrument.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 |
19 |
|
|
20 |
*****************************************************************************/ |
*****************************************************************************/ |
21 |
|
|
22 |
|
#include "qsamplerUtilities.h" |
23 |
#include "qsamplerAbout.h" |
#include "qsamplerAbout.h" |
24 |
#include "qsamplerInstrument.h" |
#include "qsamplerInstrument.h" |
25 |
|
|
191 |
} |
} |
192 |
|
|
193 |
if (::lscp_map_midi_instrument(pMainForm->client(), &instr, |
if (::lscp_map_midi_instrument(pMainForm->client(), &instr, |
194 |
m_sEngineName.latin1(), |
m_sEngineName.latin1(), |
195 |
m_sInstrumentFile.latin1(), |
lscpEscapePath(m_sInstrumentFile).latin1(), |
196 |
m_iInstrumentNr, |
m_iInstrumentNr, |
197 |
m_fVolume, |
m_fVolume, |
198 |
load_mode, |
load_mode, |
199 |
m_sName.latin1()) != LSCP_OK) { |
m_sName.latin1()) != LSCP_OK) { |
200 |
pMainForm->appendMessagesClient("lscp_map_midi_instrument"); |
pMainForm->appendMessagesClient("lscp_map_midi_instrument"); |
201 |
return false; |
return false; |
202 |
} |
} |
321 |
|
|
322 |
#ifdef CONFIG_MIDI_INSTRUMENT |
#ifdef CONFIG_MIDI_INSTRUMENT |
323 |
int *piMaps = ::lscp_list_midi_instrument_maps(pMainForm->client()); |
int *piMaps = ::lscp_list_midi_instrument_maps(pMainForm->client()); |
324 |
for (int iMap = 0; piMaps && piMaps[iMap] >= 0; iMap++) { |
if (piMaps == NULL) { |
325 |
const QString& sMapName = getMapName(piMaps[iMap]); |
if (::lscp_client_get_errno(pMainForm->client())) |
326 |
if (!sMapName.isEmpty()) |
pMainForm->appendMessagesClient("lscp_list_midi_instruments"); |
327 |
maps.append(sMapName); |
} else { |
328 |
|
for (int iMap = 0; piMaps[iMap] >= 0; iMap++) { |
329 |
|
const QString& sMapName = getMapName(piMaps[iMap]); |
330 |
|
if (!sMapName.isEmpty()) |
331 |
|
maps.append(sMapName); |
332 |
|
} |
333 |
} |
} |
334 |
#endif |
#endif |
335 |
|
|
350 |
#ifdef CONFIG_MIDI_INSTRUMENT |
#ifdef CONFIG_MIDI_INSTRUMENT |
351 |
const char *pszMapName |
const char *pszMapName |
352 |
= ::lscp_get_midi_instrument_map_name(pMainForm->client(), iMidiMap); |
= ::lscp_get_midi_instrument_map_name(pMainForm->client(), iMidiMap); |
353 |
if (pszMapName == NULL) |
if (pszMapName == NULL) { |
354 |
pszMapName = " -"; |
pszMapName = " -"; |
355 |
|
if (::lscp_client_get_errno(pMainForm->client())) |
356 |
|
pMainForm->appendMessagesClient("lscp_get_midi_instrument_name"); |
357 |
|
} |
358 |
sMapName = QString("%1 - %2").arg(iMidiMap).arg(pszMapName); |
sMapName = QString("%1 - %2").arg(iMidiMap).arg(pszMapName); |
359 |
#endif |
#endif |
360 |
|
|