/[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 2065 by capela, Sat Mar 13 12:44:15 2010 UTC revision 2068 by capela, Sun Mar 14 16:35:48 2010 UTC
# Line 41  namespace QSampler { Line 41  namespace QSampler {
41  InstrumentListModel::InstrumentListModel ( QObject *pParent )  InstrumentListModel::InstrumentListModel ( QObject *pParent )
42          : QAbstractItemModel(pParent), m_iMidiMap(LSCP_MIDI_MAP_ALL)          : QAbstractItemModel(pParent), m_iMidiMap(LSCP_MIDI_MAP_ALL)
43  {  {
44          QAbstractItemModel::reset();  //      QAbstractItemModel::reset();
45  }  }
46    
47  InstrumentListModel::~InstrumentListModel (void)  InstrumentListModel::~InstrumentListModel (void)
# Line 79  QVariant InstrumentListModel::data ( Line 79  QVariant InstrumentListModel::data (
79  {  {
80          if (!index.isValid())          if (!index.isValid())
81                  return QVariant();                  return QVariant();
   
82          const Instrument *pInstr          const Instrument *pInstr
83                  = static_cast<Instrument *> (index.internalPointer());                  = static_cast<Instrument *> (index.internalPointer());
84    
# Line 130  QModelIndex InstrumentListModel::index ( Line 129  QModelIndex InstrumentListModel::index (
129                  InstrumentMap::const_iterator itMap     = m_instruments.find(m_iMidiMap);                  InstrumentMap::const_iterator itMap     = m_instruments.find(m_iMidiMap);
130                  if (itMap != m_instruments.constEnd()) {                  if (itMap != m_instruments.constEnd()) {
131                          const InstrumentList& list = *itMap;                          const InstrumentList& list = *itMap;
                         // resolve instrument in that map  
132                          if (row < list.size())                          if (row < list.size())
133                                  pInstr = list.at(row);                                  pInstr = list.at(row);
134                  }                  }
# Line 399  void InstrumentListView::updateInstrumen Line 397  void InstrumentListView::updateInstrumen
397  {  {
398          m_pListModel->beginReset();          m_pListModel->beginReset();
399          m_pListModel->updateInstrument(pInstrument);          m_pListModel->updateInstrument(pInstrument);
400          m_pListModel->endReset();}          m_pListModel->endReset();
401    }
402    
403    
404  // Refreshener.  // Refreshener.

Legend:
Removed from v.2065  
changed lines
  Added in v.2068

  ViewVC Help
Powered by ViewVC