summaryrefslogtreecommitdiff
path: root/src/domloader.cc
diff options
context:
space:
mode:
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));