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

Diff of /qsampler/trunk/src/qsamplerChannel.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  // qsamplerChannel.cpp  // qsamplerChannel.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 "qsamplerChannel.h"  #include "qsamplerChannel.h"
25    
# Line 202  bool qsamplerChannel::loadInstrument ( c Line 203  bool qsamplerChannel::loadInstrument ( c
203          if (m_iInstrumentStatus == 100 && m_sInstrumentFile == sInstrumentFile && m_iInstrumentNr == iInstrumentNr)          if (m_iInstrumentStatus == 100 && m_sInstrumentFile == sInstrumentFile && m_iInstrumentNr == iInstrumentNr)
204                  return true;                  return true;
205    
206          if (::lscp_load_instrument_non_modal(pMainForm->client(), sInstrumentFile.latin1(), iInstrumentNr, m_iChannelID) != LSCP_OK) {          if (
207                    ::lscp_load_instrument_non_modal(
208                            pMainForm->client(),
209                            lscpEscapePath(sInstrumentFile).latin1(),
210                            iInstrumentNr, m_iChannelID
211                    ) != LSCP_OK
212            ) {
213                  appendMessagesClient("lscp_load_instrument");                  appendMessagesClient("lscp_load_instrument");
214                  return false;                  return false;
215          }          }
# Line 639  bool qsamplerChannel::updateChannelInfo Line 646  bool qsamplerChannel::updateChannelInfo
646    
647          // Set the audio routing map.          // Set the audio routing map.
648          m_audioRouting.clear();          m_audioRouting.clear();
649          char **ppszRouting = pChannelInfo->audio_routing;  #ifdef CONFIG_AUDIO_ROUTING
650          for (int i = 0; ppszRouting && ppszRouting[i]; i++) {          int *piAudioRouting = pChannelInfo->audio_routing;
651                  m_audioRouting[i] = ::atoi(ppszRouting[i]);          for (int i = 0; piAudioRouting && piAudioRouting[i] >= 0; i++)
652          }                  m_audioRouting[i] = piAudioRouting[i];
653    #else
654            char **ppszAudioRouting = pChannelInfo->audio_routing;
655            for (int i = 0; ppszAudioRouting && ppszAudioRouting[i]; i++)
656                    m_audioRouting[i] = ::atoi(ppszAudioRouting[i]);
657    #endif
658    
659          return true;          return true;
660  }  }
# Line 668  bool qsamplerChannel::channelReset (void Line 680  bool qsamplerChannel::channelReset (void
680  }  }
681    
682    
683    // Spawn instrument editor method.
684    bool qsamplerChannel::editChannel (void)
685    {
686    #ifdef CONFIG_EDIT_INSTRUMENT
687    
688            qsamplerMainForm *pMainForm = qsamplerMainForm::getInstance();
689            if (pMainForm == NULL)
690                    return false;
691            if (pMainForm->client() == NULL || m_iChannelID < 0)
692                    return false;
693    
694            if (::lscp_edit_instrument(pMainForm->client(), m_iChannelID) != LSCP_OK) {
695                    appendMessagesClient("lscp_edit_instrument");
696                    appendMessagesError(QObject::tr(
697                            "Could not launch an appropriate instrument editor "
698                            "for the given instrument!\n"
699                            "Make sure you have an appropriate "
700                            "instrument editor like 'gigedit' installed\n"
701                            "and that it placed its mandatory DLL file "
702                            "into the sampler's plugin directory.")
703                    );
704                    return false;
705            }
706    
707            appendMessages(QObject::tr("edit instrument."));
708    
709            return true;
710    
711    #else
712    
713            appendMessagesError(QObject::tr(
714                    "Sorry, QSampler was compiled for a version of liblscp "
715                    "which lacks this feature.\n"
716                    "You may want to update liblscp and recompile QSampler afterwards.")
717            );
718    
719            return false;
720    
721    #endif
722    }
723    
724    
725  // Channel setup dialog form.  // Channel setup dialog form.
726  bool qsamplerChannel::channelSetup ( QWidget *pParent )  bool qsamplerChannel::channelSetup ( QWidget *pParent )
727  {  {

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

  ViewVC Help
Powered by ViewVC