/[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 371 by capela, Fri Feb 11 15:36:06 2005 UTC revision 382 by capela, Mon Feb 14 15:42:38 2005 UTC
# Line 170  bool qsamplerChannel::loadEngine ( const Line 170  bool qsamplerChannel::loadEngine ( const
170  }  }
171    
172    
 // Instrument name accessor.  
 QString& qsamplerChannel::instrumentName (void)  
 {  
     return m_sInstrumentName;  
 }  
   
173  // Instrument filename accessor.  // Instrument filename accessor.
174  QString& qsamplerChannel::instrumentFile (void)  QString& qsamplerChannel::instrumentFile (void)
175  {  {
# Line 188  int qsamplerChannel::instrumentNr (void) Line 182  int qsamplerChannel::instrumentNr (void)
182      return m_iInstrumentNr;      return m_iInstrumentNr;
183  }  }
184    
185    // Instrument name accessor.
186    QString& qsamplerChannel::instrumentName (void)
187    {
188        return m_sInstrumentName;
189    }
190    
191  // Instrument status accessor.  // Instrument status accessor.
192  int qsamplerChannel::instrumentStatus (void)  int qsamplerChannel::instrumentStatus (void)
193  {  {
# Line 205  bool qsamplerChannel::loadInstrument ( c Line 205  bool qsamplerChannel::loadInstrument ( c
205          return false;          return false;
206      }      }
207    
     m_sInstrumentName = getInstrumentName(sInstrumentFile, iInstrumentNr, true);  
208      m_sInstrumentFile = sInstrumentFile;      m_sInstrumentFile = sInstrumentFile;
209      m_iInstrumentNr = iInstrumentNr;      m_iInstrumentNr = iInstrumentNr;
210    #ifdef CONFIG_INSTRUMENT_NAME
211        m_sInstrumentName = QString::null;  // We'll get it later on channel_info...
212    #else
213        m_sInstrumentName = getInstrumentName(sInstrumentFile, iInstrumentNr, true);
214    #endif
215      m_iInstrumentStatus = 0;      m_iInstrumentStatus = 0;
216    
217      return true;      return true;
# Line 364  bool qsamplerChannel::setVolume ( float Line 368  bool qsamplerChannel::setVolume ( float
368  // Istrument name remapper.  // Istrument name remapper.
369  void qsamplerChannel::updateInstrumentName (void)  void qsamplerChannel::updateInstrumentName (void)
370  {  {
371    #ifndef CONFIG_INSTRUMENT_NAME
372          m_sInstrumentName = getInstrumentName(m_sInstrumentFile,          m_sInstrumentName = getInstrumentName(m_sInstrumentFile,
373                  m_iInstrumentNr, (options() && options()->bInstrumentNames));                  m_iInstrumentNr, (options() && options()->bInstrumentNames));
374    #endif
375  }  }
376    
377    
# Line 383  bool qsamplerChannel::updateChannelInfo Line 389  bool qsamplerChannel::updateChannelInfo
389          return false;          return false;
390      }      }
391    
392    #ifdef CONFIG_INSTRUMENT_NAME
393            // We got all actual instrument datum...
394            m_sInstrumentFile = pChannelInfo->instrument_file;
395            m_iInstrumentNr   = pChannelInfo->instrument_nr;
396            m_sInstrumentName = pChannelInfo->instrument_name;
397    #else
398          // First, check if intrument name has changed,          // First, check if intrument name has changed,
399          // taking care that instrument name lookup might be expensive,          // taking care that instrument name lookup might be expensive,
400          // so we better make it only once and when really needed...          // so we better make it only once and when really needed...
# Line 392  bool qsamplerChannel::updateChannelInfo Line 404  bool qsamplerChannel::updateChannelInfo
404                  m_iInstrumentNr   = pChannelInfo->instrument_nr;                  m_iInstrumentNr   = pChannelInfo->instrument_nr;
405                  updateInstrumentName();                  updateInstrumentName();
406          }          }
407    #endif
408      // Cache in other channel information.      // Cache in other channel information.
409      m_sEngineName       = pChannelInfo->engine_name;      m_sEngineName       = pChannelInfo->engine_name;
410      m_iInstrumentStatus = pChannelInfo->instrument_status;      m_iInstrumentStatus = pChannelInfo->instrument_status;

Legend:
Removed from v.371  
changed lines
  Added in v.382

  ViewVC Help
Powered by ViewVC