/[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 2069 by capela, Mon Mar 15 10:45:35 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 339  InstrumentListView::InstrumentListView ( Line 337  InstrumentListView::InstrumentListView (
337          QTreeView::setAlternatingRowColors(true);          QTreeView::setAlternatingRowColors(true);
338          QTreeView::setSelectionBehavior(QAbstractItemView::SelectRows);          QTreeView::setSelectionBehavior(QAbstractItemView::SelectRows);
339          QTreeView::setSelectionMode(QAbstractItemView::SingleSelection);          QTreeView::setSelectionMode(QAbstractItemView::SingleSelection);
340                    QTreeView::setItemsExpandable(false);
341    
342          QHeaderView *pHeader = QTreeView::header();          QHeaderView *pHeader = QTreeView::header();
343          pHeader->setDefaultAlignment(Qt::AlignLeft);          pHeader->setDefaultAlignment(Qt::AlignLeft);
344          pHeader->setMovable(false);          pHeader->setMovable(false);
# Line 399  void InstrumentListView::updateInstrumen Line 398  void InstrumentListView::updateInstrumen
398  {  {
399          m_pListModel->beginReset();          m_pListModel->beginReset();
400          m_pListModel->updateInstrument(pInstrument);          m_pListModel->updateInstrument(pInstrument);
401          m_pListModel->endReset();}          m_pListModel->endReset();
402    }
403    
404    
405  // Refreshener.  // Refreshener.

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

  ViewVC Help
Powered by ViewVC