summaryrefslogtreecommitdiff
path: root/src/audioinputenginemidi.cc
diff options
context:
space:
mode:
authorjsc@umbraculum.org <jsc@umbraculum.org>2013-04-26 15:23:24 +0200
committerjsc@umbraculum.org <jsc@umbraculum.org>2013-04-26 15:23:24 +0200
commit3eeba619215dadb15a5fd992cba03bf760c23d3a (patch)
tree423450a0419b37fc9f3e8cf65c0a425e2e418ae7 /src/audioinputenginemidi.cc
parent2eedb967d2a3f8026163bd182e973106e6846a13 (diff)
parent813d802443679a6f937a13680bc0ec3fb11a96b6 (diff)
Merge branch 'master' of http://git.drumgizmo.org/drumgizmo
Diffstat (limited to 'src/audioinputenginemidi.cc')
-rw-r--r--src/audioinputenginemidi.cc26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/audioinputenginemidi.cc b/src/audioinputenginemidi.cc
index 00aa518..44e8606 100644
--- a/src/audioinputenginemidi.cc
+++ b/src/audioinputenginemidi.cc
@@ -30,13 +30,25 @@
#include <hugin.hpp>
-void AudioInputEngineMidi::loadMidiMap(std::string f, Instruments &instruments)
+AudioInputEngineMidi::AudioInputEngineMidi()
{
+ is_valid = false;
+}
+
+bool AudioInputEngineMidi::loadMidiMap(std::string f, Instruments &instruments)
+{
+ file = "";
+ is_valid = false;
+
DEBUG(mmap, "loadMidiMap(%s, i.size() == %d)\n", f.c_str(),
instruments.size());
- if(f == "") return;
+
+ if(f == "") return false;
+
MidiMapParser p(f);
- if(p.parse()) {/*return false;*/}
+ if(p.parse()) {
+ return false;
+ }
mmap.clear();
mmap.midimap = p.midimap;
@@ -46,6 +58,9 @@ void AudioInputEngineMidi::loadMidiMap(std::string f, Instruments &instruments)
}
file = f;
+ is_valid = true;
+
+ return true;
}
std::string AudioInputEngineMidi::midimapFile()
@@ -53,6 +68,11 @@ std::string AudioInputEngineMidi::midimapFile()
return file;
}
+bool AudioInputEngineMidi::isValid()
+{
+ return is_valid;
+}
+
#ifdef TEST_AUDIOINPUTENGINEMIDI
//Additional dependency files
//deps: