diff options
Diffstat (limited to 'muse2/muse/instruments/minstrument.h')
-rw-r--r-- | muse2/muse/instruments/minstrument.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/muse2/muse/instruments/minstrument.h b/muse2/muse/instruments/minstrument.h index f793a7b6..823b9895 100644 --- a/muse2/muse/instruments/minstrument.h +++ b/muse2/muse/instruments/minstrument.h @@ -122,6 +122,44 @@ struct patch_drummap_mapping_t patch_drummap_mapping_t& operator=(const patch_drummap_mapping_t& that); }; +struct dumb_patchlist_entry_t +{ + int prog; + int lbank; + int hbank; // "-1" means "unused" + + dumb_patchlist_entry_t(int p, int l, int h) + { + prog=p; + lbank=l; + hbank=h; + } + + bool operator<(const dumb_patchlist_entry_t& other) const + { + if (hbank < other.hbank) return true; + if (hbank > other.hbank) return false; + if (lbank < other.lbank) return true; + if (lbank > other.lbank) return false; + return (prog < other.prog); + } + + bool operator>(const dumb_patchlist_entry_t& other) const + { + return other < *this; + } + + bool operator==(const dumb_patchlist_entry_t& other) const + { + return (prog==other.prog && lbank==other.lbank && hbank==other.hbank); + } + + bool operator!=(const dumb_patchlist_entry_t& other) const + { + return (!(*this==other)); + } +}; + //--------------------------------------------------------- // MidiInstrument //--------------------------------------------------------- @@ -172,6 +210,9 @@ class MidiInstrument { void addSysex(SysEx* sysex) { _sysex.append(sysex); } const DrumMap* drummap_for_patch(int patch) const; + QList<dumb_patchlist_entry_t> getPatches(int channel, MType songType, bool drum); + unsigned getNextPatch(int channel, unsigned patch, MType songType, bool drum); + unsigned getPrevPatch(int channel, unsigned patch, MType songType, bool drum); EventList* midiInit() const { return _midiInit; } EventList* midiReset() const { return _midiReset; } |