summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/audioinputenginemidi.cc7
-rw-r--r--src/audioinputenginemidi.h3
-rw-r--r--src/drumgizmo.cc12
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
"<config>\n"
" <value name=\"drumkitfile\">" + kitfile + "</value>\n"
- " <value name=\"midimapfile\">" + midimapfile + "</value>\n"
+ " <value name=\"midimapfile\">" + mmapfile + "</value>\n"
" <value name=\"enable_velocity_modifier\">" +
bool2str(Conf::enable_velocity_modifier) + "</value>\n"
" <value name=\"velocity_modifier_falloff\">" +
@@ -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);
}