/[svn]/qsampler/trunk/src/qsamplerInstrument.cpp
ViewVC logotype

Diff of /qsampler/trunk/src/qsamplerInstrument.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 980 by capela, Sun Dec 17 22:29:29 2006 UTC revision 1386 by schoenebeck, Fri Oct 5 17:41:49 2007 UTC
# Line 1  Line 1 
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
# Line 19  Line 19 
19    
20  *****************************************************************************/  *****************************************************************************/
21    
22    #include "qsamplerUtilities.h"
23  #include "qsamplerAbout.h"  #include "qsamplerAbout.h"
24  #include "qsamplerInstrument.h"  #include "qsamplerInstrument.h"
25    
# Line 190  bool qsamplerInstrument::mapInstrument ( Line 191  bool qsamplerInstrument::mapInstrument (
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          }          }
# Line 320  QStringList qsamplerInstrument::getMapNa Line 321  QStringList qsamplerInstrument::getMapNa
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    
# Line 344  QString qsamplerInstrument::getMapName ( Line 350  QString qsamplerInstrument::getMapName (
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    

Legend:
Removed from v.980  
changed lines
  Added in v.1386

  ViewVC Help
Powered by ViewVC