From 624aafbc9cde2b9e83c7c278e44f19ab9e3bc9fc Mon Sep 17 00:00:00 2001 From: Sander Vocke Date: Thu, 25 Jul 2024 09:09:35 +0200 Subject: Support curve maps in midi map file --- src/midimapper.h | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src/midimapper.h') diff --git a/src/midimapper.h b/src/midimapper.h index 94781d4..ee1e8d0 100644 --- a/src/midimapper.h +++ b/src/midimapper.h @@ -30,11 +30,24 @@ #include #include #include +#include + +#include "curvemap.h" struct MidimapEntry { int note_id; std::string instrument_name; + + //! An optional curve map which will map the given velocity + //! or CC value to a new value. + std::unique_ptr maybe_curve_map; + + MidimapEntry &operator=(const MidimapEntry& other); + MidimapEntry(const MidimapEntry& other); + MidimapEntry(int note_id, + std::string instrument_name, + CurveMap *maybe_curve_map = nullptr); }; using midimap_t = std::vector; @@ -43,8 +56,11 @@ using instrmap_t = std::map; class MidiMapper { public: - //! Lookup note in map and returns the corresponding instrument index list. - std::vector lookup(int note_id); + //! Lookup midi map entries matching the given note. + std::vector lookup(int note_id); + + //! Lookup instrument by name. + int lookup_instrument(std::string name); //! Set new map sets. void swap(instrmap_t& instrmap, midimap_t& midimap); -- cgit v1.2.3