/[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 344 by capela, Tue Jan 18 13:53:04 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 361  bool qsamplerChannel::setVolume ( float Line 365  bool qsamplerChannel::setVolume ( float
365  }  }
366    
367    
368    // Istrument name remapper.
369    void qsamplerChannel::updateInstrumentName (void)
370    {
371    #ifndef CONFIG_INSTRUMENT_NAME
372            m_sInstrumentName = getInstrumentName(m_sInstrumentFile,
373                    m_iInstrumentNr, (options() && options()->bInstrumentNames));
374    #endif
375    }
376    
377    
378  // Update whole channel info state.  // Update whole channel info state.
379  bool qsamplerChannel::updateChannelInfo (void)  bool qsamplerChannel::updateChannelInfo (void)
380  {  {
# Line 375  bool qsamplerChannel::updateChannelInfo Line 389  bool qsamplerChannel::updateChannelInfo
389          return false;          return false;
390      }      }
391    
392      // First, check if intrument name has changed,  #ifdef CONFIG_INSTRUMENT_NAME
393      // taking care that instrument name lookup might be expensive,          // We got all actual instrument datum...
394      // so we better make it only once and when really needed...          m_sInstrumentFile = pChannelInfo->instrument_file;
395      if ((m_sInstrumentFile != pChannelInfo->instrument_file) ||          m_iInstrumentNr   = pChannelInfo->instrument_nr;
396          (m_iInstrumentNr   != pChannelInfo->instrument_nr)) {          m_sInstrumentName = pChannelInfo->instrument_name;
397          m_sInstrumentFile = pChannelInfo->instrument_file;  #else
398          m_iInstrumentNr   = pChannelInfo->instrument_nr;          // First, check if intrument name has changed,
399                  m_sInstrumentName = getInstrumentName(m_sInstrumentFile,          // taking care that instrument name lookup might be expensive,
400                          m_iInstrumentNr, (options() && options()->bInstrumentNames));          // so we better make it only once and when really needed...
401            if ((m_sInstrumentFile != pChannelInfo->instrument_file) ||
402                    (m_iInstrumentNr   != pChannelInfo->instrument_nr)) {
403                    m_sInstrumentFile = pChannelInfo->instrument_file;
404                    m_iInstrumentNr   = pChannelInfo->instrument_nr;
405                    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.344  
changed lines
  Added in v.382

  ViewVC Help
Powered by ViewVC