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

Diff of /qsampler/trunk/src/qsamplerInstrumentList.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1522 by capela, Thu Nov 22 11:10:44 2007 UTC revision 1523 by capela, Sun Nov 25 11:40:47 2007 UTC
# Line 175  qsamplerInstrument* MidiInstrumentsModel Line 175  qsamplerInstrument* MidiInstrumentsModel
175                  }                  }
176          }          }
177    
178          // resolve the appropriate place, we keep the list sorted that way ...          // Resolve the appropriate place, we keep the list sorted that way ...
179          int i = 0;          int i = 0;
180          for (; i < m_instruments[iMap].size(); i++)          for (; i < m_instruments[iMap].size(); ++i) {
181                  if (iBank > m_instruments[iMap][i].bank()                  if (iBank < m_instruments[iMap][i].bank()
182                          || (iBank == m_instruments[iMap][i].bank() &&                          || (iBank == m_instruments[iMap][i].bank() &&
183                                  iProg > m_instruments[iMap][i].prog()))                                  iProg < m_instruments[iMap][i].prog())) {
184                          break;                          break;
185                    }
186            }
187    
188          m_instruments[iMap].insert(i, qsamplerInstrument(iMap, iBank, iProg));          m_instruments[iMap].insert(i, qsamplerInstrument(iMap, iBank, iProg));
189          qsamplerInstrument& instr = m_instruments[iMap][i];          qsamplerInstrument& instr = m_instruments[iMap][i];
# Line 209  void MidiInstrumentsModel::removeInstrum Line 211  void MidiInstrumentsModel::removeInstrum
211    
212    
213  // Reposition the instrument in the model (called when map/bank/prg changed)  // Reposition the instrument in the model (called when map/bank/prg changed)
214  void MidiInstrumentsModel::resort ( const qsamplerInstrument instrument )  void MidiInstrumentsModel::resort ( const qsamplerInstrument& instrument )
215  {  {
216          const int iMap  = instrument.map();          const int iMap  = instrument.map();
217          const int iBank = instrument.bank();          const int iBank = instrument.bank();
218          const int iProg = instrument.prog();          const int iProg = instrument.prog();
219          // remove given instrument from its current list          // Remove given instrument from its current list
220          removeInstrument(instrument);          removeInstrument(instrument);
221          // re-add the instrument          // Re-add the instrument
222          addInstrument(iMap, iBank, iProg);          addInstrument(iMap, iBank, iProg);
223  }  }
224    

Legend:
Removed from v.1522  
changed lines
  Added in v.1523

  ViewVC Help
Powered by ViewVC