30 |
|
|
31 |
#include "qsamplerInstrument.h" |
#include "qsamplerInstrument.h" |
32 |
|
|
33 |
|
namespace QSampler { |
34 |
|
|
35 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
36 |
// MidiInstrumentsModel - data model for MIDI prog mappings (used for QTableView) |
// QSampler::MidiInstrumentsModel - data model for MIDI prog mappings |
37 |
// |
// (used for QTableView) |
38 |
|
|
39 |
class MidiInstrumentsModel : public QAbstractTableModel |
class MidiInstrumentsModel : public QAbstractTableModel |
40 |
{ |
{ |
56 |
QAbstractTableModel::reset; |
QAbstractTableModel::reset; |
57 |
|
|
58 |
// Own methods |
// Own methods |
59 |
qsamplerInstrument* addInstrument(int iMap = 0, |
Instrument* addInstrument(int iMap = 0, |
60 |
int iBank = -1, int iProg = -1); |
int iBank = -1, int iProg = -1); |
61 |
void removeInstrument(const qsamplerInstrument& instrument); |
void removeInstrument(const Instrument& instrument); |
62 |
|
|
63 |
void resort(const qsamplerInstrument& instrument); |
void resort(const Instrument& instrument); |
64 |
|
|
65 |
// Map selector. |
// Map selector. |
66 |
void setMidiMap(int iMidiMap); |
void setMidiMap(int iMidiMap); |
78 |
|
|
79 |
private: |
private: |
80 |
|
|
81 |
typedef QMap<int, QList<qsamplerInstrument> > InstrumentsMap; |
typedef QMap<int, QList<Instrument> > InstrumentsMap; |
82 |
|
|
83 |
InstrumentsMap m_instruments; |
InstrumentsMap m_instruments; |
84 |
|
|
88 |
|
|
89 |
|
|
90 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
91 |
// MidiInstrumentsDelegate - table cell renderer for MIDI prog mappings |
// QSampler::MidiInstrumentsDelegate - table cell renderer for MIDI prog |
92 |
// (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 |
93 |
// cell editor widget implementation) |
// a future cell editor widget implementation) |
94 |
|
|
95 |
class MidiInstrumentsDelegate : public QItemDelegate |
class MidiInstrumentsDelegate : public QItemDelegate |
96 |
{ |
{ |
111 |
const QStyleOptionViewItem& option, const QModelIndex& index) const; |
const QStyleOptionViewItem& option, const QModelIndex& index) const; |
112 |
}; |
}; |
113 |
|
|
114 |
|
} // namespace QSampler |
115 |
|
|
116 |
#endif // __qsamplerInstrumentList_h |
#endif // __qsamplerInstrumentList_h |
117 |
|
|