--- qsampler/trunk/src/qsamplerChannel.cpp 2005/01/18 13:53:04 344 +++ qsampler/trunk/src/qsamplerChannel.cpp 2005/02/14 15:42:38 382 @@ -170,12 +170,6 @@ } -// Instrument name accessor. -QString& qsamplerChannel::instrumentName (void) -{ - return m_sInstrumentName; -} - // Instrument filename accessor. QString& qsamplerChannel::instrumentFile (void) { @@ -188,6 +182,12 @@ return m_iInstrumentNr; } +// Instrument name accessor. +QString& qsamplerChannel::instrumentName (void) +{ + return m_sInstrumentName; +} + // Instrument status accessor. int qsamplerChannel::instrumentStatus (void) { @@ -205,9 +205,13 @@ return false; } - m_sInstrumentName = getInstrumentName(sInstrumentFile, iInstrumentNr, true); m_sInstrumentFile = sInstrumentFile; m_iInstrumentNr = iInstrumentNr; +#ifdef CONFIG_INSTRUMENT_NAME + m_sInstrumentName = QString::null; // We'll get it later on channel_info... +#else + m_sInstrumentName = getInstrumentName(sInstrumentFile, iInstrumentNr, true); +#endif m_iInstrumentStatus = 0; return true; @@ -361,6 +365,16 @@ } +// Istrument name remapper. +void qsamplerChannel::updateInstrumentName (void) +{ +#ifndef CONFIG_INSTRUMENT_NAME + m_sInstrumentName = getInstrumentName(m_sInstrumentFile, + m_iInstrumentNr, (options() && options()->bInstrumentNames)); +#endif +} + + // Update whole channel info state. bool qsamplerChannel::updateChannelInfo (void) { @@ -375,16 +389,22 @@ return false; } - // First, check if intrument name has changed, - // taking care that instrument name lookup might be expensive, - // so we better make it only once and when really needed... - if ((m_sInstrumentFile != pChannelInfo->instrument_file) || - (m_iInstrumentNr != pChannelInfo->instrument_nr)) { - m_sInstrumentFile = pChannelInfo->instrument_file; - m_iInstrumentNr = pChannelInfo->instrument_nr; - m_sInstrumentName = getInstrumentName(m_sInstrumentFile, - m_iInstrumentNr, (options() && options()->bInstrumentNames)); +#ifdef CONFIG_INSTRUMENT_NAME + // We got all actual instrument datum... + m_sInstrumentFile = pChannelInfo->instrument_file; + m_iInstrumentNr = pChannelInfo->instrument_nr; + m_sInstrumentName = pChannelInfo->instrument_name; +#else + // First, check if intrument name has changed, + // taking care that instrument name lookup might be expensive, + // so we better make it only once and when really needed... + if ((m_sInstrumentFile != pChannelInfo->instrument_file) || + (m_iInstrumentNr != pChannelInfo->instrument_nr)) { + m_sInstrumentFile = pChannelInfo->instrument_file; + m_iInstrumentNr = pChannelInfo->instrument_nr; + updateInstrumentName(); } +#endif // Cache in other channel information. m_sEngineName = pChannelInfo->engine_name; m_iInstrumentStatus = pChannelInfo->instrument_status;