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) |
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 |
|
|
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 |
} |
} |
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. |