/[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 1386 by schoenebeck, Fri Oct 5 17:41:49 2007 UTC revision 1461 by schoenebeck, Sun Oct 28 23:30:36 2007 UTC
# Line 25  Line 25 
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.
# Line 158  bool qsamplerInstrument::mapInstrument ( Line 159  bool qsamplerInstrument::mapInstrument (
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)
# Line 192  bool qsamplerInstrument::mapInstrument ( Line 193  bool qsamplerInstrument::mapInstrument (
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,
# Line 218  bool qsamplerInstrument::unmapInstrument Line 219  bool qsamplerInstrument::unmapInstrument
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)
# Line 252  bool qsamplerInstrument::getInstrument ( Line 253  bool qsamplerInstrument::getInstrument (
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)
# Line 271  bool qsamplerInstrument::getInstrument ( Line 272  bool qsamplerInstrument::getInstrument (
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    
# Line 313  QStringList qsamplerInstrument::getMapNa Line 314  QStringList qsamplerInstrument::getMapNa
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)
# Line 341  QString qsamplerInstrument::getMapName ( Line 342  QString qsamplerInstrument::getMapName (
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)
# Line 355  QString qsamplerInstrument::getMapName ( Line 356  QString qsamplerInstrument::getMapName (
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;

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

  ViewVC Help
Powered by ViewVC