summaryrefslogtreecommitdiff
path: root/src/domloader.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2019-07-25 17:49:16 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2019-09-28 20:37:47 +0200
commit9d1ea1e7cfa256c7f5cac027382d92f658734ccb (patch)
tree39ec7cdaa8ed571137430ccbbc0a391bb27427a3 /src/domloader.cc
parentcd9af98abdce1fe3759e786d6b010a7fe3395e2c (diff)
Add generic logger interface for propagating messages while loading drumkits to the commandline
and/or plugin UI.
Diffstat (limited to 'src/domloader.cc')
-rw-r--r--src/domloader.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/domloader.cc b/src/domloader.cc
index 0e06239..a718ade 100644
--- a/src/domloader.cc
+++ b/src/domloader.cc
@@ -52,7 +52,7 @@ DOMLoader::DOMLoader(Settings& settings, Random& random)
bool DOMLoader::loadDom(const std::string& basepath,
const DrumkitDOM& dom,
const std::vector<InstrumentDOM>& instrumentdoms,
- DrumKit& drumkit)
+ DrumKit& drumkit, LogFunction logger)
{
settings.has_bleed_control.store(false);
@@ -165,6 +165,9 @@ bool DOMLoader::loadDom(const std::string& basepath,
{
ERR(kitparser, "Missing channel '%s' in instrument '%s'\n",
instrument_channel.name.c_str(), instrument->getName().c_str());
+ logger(LogLevel::Warning, "Missing channel '" +
+ instrument_channel.name + "' in the '" +
+ instrument->getName() + "' instrument.");
}
}
@@ -191,6 +194,9 @@ bool DOMLoader::loadDom(const std::string& basepath,
ERR(kitparser,
"Missing sample '%s' from sampleref in instrument '%s'\n",
sampleref.name.data(), instrument->getName().data());
+ logger(LogLevel::Warning, "Missing sample '" +
+ sampleref.name + "' in the '" +
+ instrument->getName() + "' instrument.");
return false;
}
}
@@ -209,6 +215,8 @@ bool DOMLoader::loadDom(const std::string& basepath,
if(!found)
{
ERR(domloader, "No instrument with name '%s'", instrumentref.name.data());
+ logger(LogLevel::Warning, "No instrument with name '" +
+ instrumentref.name + "'.");
return false;
}
}