summaryrefslogtreecommitdiff
path: root/src/drumkitloader.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2018-06-20 19:21:48 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2018-08-12 11:11:45 +0200
commit6adb14a7027c8d54827093c83fc80694d71fb6a7 (patch)
treecc02ac1bdb548b0b317999d727a12fa5a9973594 /src/drumkitloader.cc
parent1560674582102cd83197dccc79cb029fc843a48e (diff)
Fix missing finalization of instruments on load. Fix relative instrument filenames according to the drumkit file. Make drumkit creator create version 2.0 drumkits. Reduce missing refs file to a warning.
Diffstat (limited to 'src/drumkitloader.cc')
-rw-r--r--src/drumkitloader.cc29
1 files changed, 24 insertions, 5 deletions
diff --git a/src/drumkitloader.cc b/src/drumkitloader.cc
index 0cef31b..2ad6b0e 100644
--- a/src/drumkitloader.cc
+++ b/src/drumkitloader.cc
@@ -127,23 +127,42 @@ bool DrumKitLoader::loadkit(const std::string& file)
}
else
{
- ERR(drumkitparser, "Error reading refs.conf");
+ WARN(drumkitparser, "Error reading refs.conf");
}
DrumkitDOM drumkitdom;
std::vector<InstrumentDOM> instrumentdoms;
std::string path = getPath(edited_filename);
- bool parseerror = parseDrumkitFile(edited_filename, drumkitdom);
+ bool parseerror = false;
+ bool ret = parseDrumkitFile(edited_filename, drumkitdom);
+ if(!ret)
+ {
+ WARN(drumkitloader, "Drumkit file parser error: '%s'",
+ edited_filename.data());
+ }
+
+ parseerror |= !ret;
for(const auto& ref : drumkitdom.instruments)
{
instrumentdoms.emplace_back();
- parseerror &= parseInstrumentFile(path + "/" + ref.file, instrumentdoms.back());
+ bool ret = parseInstrumentFile(path + "/" + ref.file, instrumentdoms.back());
+ if(!ret)
+ {
+ WARN(drumkitloader, "Instrument file parser error: '%s'",
+ edited_filename.data());
+ }
+
+ parseerror |= !ret;
}
DOMLoader domloader(settings, rand);
- parseerror &= domloader.loadDom(drumkitdom, instrumentdoms, kit);
-
+ ret = domloader.loadDom(path, drumkitdom, instrumentdoms, kit);
+ if(!ret)
+ {
+ WARN(drumkitloader, "DOMLoader error");
+ }
+ parseerror |= !ret;
if(parseerror)
{
ERR(drumgizmo, "Drumkit parser failed: %s\n", file.c_str());