summaryrefslogtreecommitdiff
path: root/src/domloader.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/domloader.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/domloader.cc')
-rw-r--r--src/domloader.cc7
1 files changed, 5 insertions, 2 deletions
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<InstrumentDOM>& 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));