/[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 1526 by capela, Mon Nov 26 10:58:23 2007 UTC revision 1558 by capela, Thu Dec 6 09:35:33 2007 UTC
# Line 53  using namespace QSampler; Line 53  using namespace QSampler;
53    
54    
55  //-------------------------------------------------------------------------  //-------------------------------------------------------------------------
56  // MidiInstrumentsModel - data model for MIDI prog mappings (used for QTableView)  // QSampler::MidiInstrumentsModel - data model for MIDI prog mappings
57  //  //                                  (used for QTableView)
58    
59  MidiInstrumentsModel::MidiInstrumentsModel ( QObject* pParent)  MidiInstrumentsModel::MidiInstrumentsModel ( QObject* pParent)
60          : QAbstractTableModel(pParent)          : QAbstractTableModel(pParent)
# Line 89  QVariant MidiInstrumentsModel::data ( co Line 89  QVariant MidiInstrumentsModel::data ( co
89          if (!index.isValid())          if (!index.isValid())
90                  return QVariant();                  return QVariant();
91    
92          const qsamplerInstrument* pInstr = NULL;          const Instrument* pInstr = NULL;
93    
94          if (m_iMidiMap == LSCP_MIDI_MAP_ALL) {          if (m_iMidiMap == LSCP_MIDI_MAP_ALL) {
95                  int n = 0;                  int n = 0;
# Line 162  QVariant MidiInstrumentsModel::headerDat Line 162  QVariant MidiInstrumentsModel::headerDat
162  }  }
163    
164    
165  qsamplerInstrument* MidiInstrumentsModel::addInstrument (  Instrument* MidiInstrumentsModel::addInstrument (
166          int iMap, int iBank, int iProg )          int iMap, int iBank, int iProg )
167  {  {
168          // Check it there's already one instrument item          // Check it there's already one instrument item
# Line 186  qsamplerInstrument* MidiInstrumentsModel Line 186  qsamplerInstrument* MidiInstrumentsModel
186                  }                  }
187          }          }
188    
189          m_instruments[iMap].insert(i, qsamplerInstrument(iMap, iBank, iProg));          m_instruments[iMap].insert(i, Instrument(iMap, iBank, iProg));
190          qsamplerInstrument& instr = m_instruments[iMap][i];          Instrument& instr = m_instruments[iMap][i];
191          if (!instr.getInstrument())          if (!instr.getInstrument())
192                  m_instruments[iMap].removeAt(i);                  m_instruments[iMap].removeAt(i);
193    
# Line 196  qsamplerInstrument* MidiInstrumentsModel Line 196  qsamplerInstrument* MidiInstrumentsModel
196    
197    
198  void MidiInstrumentsModel::removeInstrument (  void MidiInstrumentsModel::removeInstrument (
199          const qsamplerInstrument& instrument )          const Instrument& instrument )
200  {  {
201          const int iMap  = instrument.map();          const int iMap  = instrument.map();
202          const int iBank = instrument.bank();          const int iBank = instrument.bank();
# Line 212  void MidiInstrumentsModel::removeInstrum Line 212  void MidiInstrumentsModel::removeInstrum
212    
213    
214  // Reposition the instrument in the model (called when map/bank/prg changed)  // Reposition the instrument in the model (called when map/bank/prg changed)
215  void MidiInstrumentsModel::resort ( const qsamplerInstrument& instrument )  void MidiInstrumentsModel::resort ( const Instrument& instrument )
216  {  {
217          const int iMap  = instrument.map();          const int iMap  = instrument.map();
218          const int iBank = instrument.bank();          const int iBank = instrument.bank();
# Line 276  void MidiInstrumentsModel::refresh (void Line 276  void MidiInstrumentsModel::refresh (void
276    
277    
278  //-------------------------------------------------------------------------  //-------------------------------------------------------------------------
279  // MidiInstrumentsDelegate - table cell renderer for MIDI prog mappings  // QSampler::MidiInstrumentsDelegate - table cell renderer for MIDI prog
280  // (doesn't actually do anything ATM, but is already there for a future  // mappings (doesn't actually do anything ATM, but is already there for a
281  // cell editor widget implementation)  // future cell editor widget implementation)
282    
283  MidiInstrumentsDelegate::MidiInstrumentsDelegate ( QObject* pParent )  MidiInstrumentsDelegate::MidiInstrumentsDelegate ( QObject* pParent )
284          : QItemDelegate(pParent)          : QItemDelegate(pParent)

Legend:
Removed from v.1526  
changed lines
  Added in v.1558

  ViewVC Help
Powered by ViewVC