summaryrefslogtreecommitdiff
path: root/src/midimapper.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2016-05-01 21:36:04 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2016-05-08 12:16:21 +0200
commit42953944da1261584d56405128c6eb3c0e9e7da0 (patch)
tree1f150ce606457a0bea5647374e0719ecd9646f01 /src/midimapper.h
parentf8feb953c6d86bee12747679e5e4dac7795a65d0 (diff)
The last loader thread stuff.
Diffstat (limited to 'src/midimapper.h')
-rw-r--r--src/midimapper.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/midimapper.h b/src/midimapper.h
index 1887013..ea836e3 100644
--- a/src/midimapper.h
+++ b/src/midimapper.h
@@ -28,6 +28,8 @@
#include <map>
#include <string>
+#include <mutex>
+#include "mutex.h"
typedef std::map<int, std::string> midimap_t;
typedef std::map<std::string, int> instrmap_t;
@@ -35,10 +37,16 @@ typedef std::map<std::string, int> instrmap_t;
class MidiMapper
{
public:
- void clear();
-
+ //! Lookup note in map and return its index.
+ //! \returns -1 if not found or the note index.
int lookup(int note);
+ //! Set new map sets.
+ void swap(instrmap_t& instrmap, midimap_t& midimap);
+
+private:
instrmap_t instrmap;
midimap_t midimap;
+
+ std::mutex mutex;
};