From 2699cb7d324ffb1d2adc62e1f62434397aa39e2d Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Fri, 22 May 2015 08:35:53 +0200 Subject: Use new load return value from ConfigFile. --- src/audioinputenginemidi.cc | 10 +++++++--- src/drumkitparser.cc | 10 ++++++---- 2 files changed, 13 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/audioinputenginemidi.cc b/src/audioinputenginemidi.cc index 5494462..7c1e13d 100644 --- a/src/audioinputenginemidi.cc +++ b/src/audioinputenginemidi.cc @@ -35,15 +35,19 @@ AudioInputEngineMidi::AudioInputEngineMidi() : refs(REFSFILE) { - refs.load(); is_valid = false; } bool AudioInputEngineMidi::loadMidiMap(std::string _f, Instruments &instruments) { std::string f = _f; - if(_f.size() > 1 && _f[0] == '@') { - f = refs.getValue(_f.substr(1)); + + if(refs.load()) { + if(_f.size() > 1 && _f[0] == '@') { + f = refs.getValue(_f.substr(1)); + } + } else { + ERR(drumkitparser, "Error reading refs.conf"); } file = ""; diff --git a/src/drumkitparser.cc b/src/drumkitparser.cc index 00232b2..f7bfe40 100644 --- a/src/drumkitparser.cc +++ b/src/drumkitparser.cc @@ -38,12 +38,14 @@ DrumKitParser::DrumKitParser(const std::string &file, DrumKit &k) : kit(k) , refs(REFSFILE) { - refs.load(); - std::string kitfile = file; - if(file.size() > 1 && file[0] == '@') { - kitfile = refs.getValue(file.substr(1)); + if(refs.load()) { + if(file.size() > 1 && file[0] == '@') { + kitfile = refs.getValue(file.substr(1)); + } + } else { + ERR(drumkitparser, "Error reading refs.conf"); } // instr = NULL; -- cgit v1.2.3