From a5ced1d15d584b2c4f7489f181224582c38da0f4 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Wed, 29 Feb 2012 15:25:27 +0000 Subject: changed custom column for "program" to display and edit real patches instead of the raw values --- muse2/muse/instruments/minstrument.h | 41 ++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'muse2/muse/instruments/minstrument.h') 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 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; } -- cgit v1.2.3