From 567062ecd36338358e698dda9de8b79fb692c432 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Tue, 23 Apr 2013 21:36:16 +0200 Subject: Fix midifile-no-stored bug. --- src/audioinputenginemidi.cc | 7 +++++++ src/audioinputenginemidi.h | 3 +++ src/drumgizmo.cc | 12 +++++++++--- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/audioinputenginemidi.cc b/src/audioinputenginemidi.cc index 6aa9d45..00aa518 100644 --- a/src/audioinputenginemidi.cc +++ b/src/audioinputenginemidi.cc @@ -44,6 +44,13 @@ void AudioInputEngineMidi::loadMidiMap(std::string f, Instruments &instruments) for(size_t i = 0; i < instruments.size(); i++) { mmap.instrmap[instruments[i]->name()] = i; } + + file = f; +} + +std::string AudioInputEngineMidi::midimapFile() +{ + return file; } #ifdef TEST_AUDIOINPUTENGINEMIDI diff --git a/src/audioinputenginemidi.h b/src/audioinputenginemidi.h index 4cae78b..0f63f8a 100644 --- a/src/audioinputenginemidi.h +++ b/src/audioinputenginemidi.h @@ -53,8 +53,11 @@ public: void loadMidiMap(std::string file, Instruments &i); + std::string midimapFile(); + protected: MidiMapper mmap; + std::string file; }; #endif/*__DRUMGIZMO_AUDIOINPUTENGINEMIDI_H__*/ diff --git a/src/drumgizmo.cc b/src/drumgizmo.cc index b07e675..83bd747 100644 --- a/src/drumgizmo.cc +++ b/src/drumgizmo.cc @@ -469,10 +469,16 @@ float str2float(std::string a) std::string DrumGizmo::configString() { + std::string mmapfile; + if(ie->isMidiEngine()) { + AudioInputEngineMidi *aim = (AudioInputEngineMidi*)ie; + mmapfile = aim->midimapFile(); + } + return "\n" " " + kitfile + "\n" - " " + midimapfile + "\n" + " " + mmapfile + "\n" " " + bool2str(Conf::enable_velocity_modifier) + "\n" " " + @@ -581,9 +587,9 @@ bool DrumGizmo::setConfigString(std::string cfg) std::string newmidimap = p.value("midimapfile"); if(midimapfile != newmidimap && newmidimap != "") { - midimapfile = newmidimap; + //midimapfile = newmidimap; LoadMidimapMessage *msg = new LoadMidimapMessage(); - msg->midimapfile = midimapfile; + msg->midimapfile = newmidimap; sendEngineMessage(msg); } -- cgit v1.2.3