From 6adb14a7027c8d54827093c83fc80694d71fb6a7 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Wed, 20 Jun 2018 19:21:48 +0200 Subject: 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. --- src/domloader.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/domloader.cc') diff --git a/src/domloader.cc b/src/domloader.cc index 1498917..e095acb 100644 --- a/src/domloader.cc +++ b/src/domloader.cc @@ -49,7 +49,8 @@ DOMLoader::DOMLoader(Settings& settings, Random& random) { } -bool DOMLoader::loadDom(const DrumkitDOM& dom, +bool DOMLoader::loadDom(const std::string& basepath, + const DrumkitDOM& dom, const std::vector& instrumentdoms, DrumKit& drumkit) { @@ -91,7 +92,7 @@ bool DOMLoader::loadDom(const DrumkitDOM& dom, instrument->version = instrumentdom.version; instrument->_description = instrumentdom.description; - auto path = getPath(instrumentref.file); + auto path = getPath(basepath + "/" + instrumentref.file); for(const auto& sampledom : instrumentdom.samples) { auto sample = new Sample(sampledom.name, sampledom.power); @@ -164,6 +165,8 @@ bool DOMLoader::loadDom(const DrumkitDOM& dom, } } + instrument->finalise(); + // Transfer ownership to the DrumKit object. drumkit.instruments.emplace_back(std::move(instrument)); -- cgit v1.2.3