diff options
author | Florian Jung <flo@windfisch.org> | 2012-02-29 15:25:27 +0000 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2012-02-29 15:25:27 +0000 |
commit | a5ced1d15d584b2c4f7489f181224582c38da0f4 (patch) | |
tree | 98a7e3b8b664cf579a834bf2b2e2e1f25fc2cf90 /muse2/muse/instruments/minstrument.h | |
parent | 3a26b16556a49196800298ed4219decc134c7061 (diff) |
changed custom column for "program" to display and edit real patches
instead of the raw values
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; } |