summaryrefslogtreecommitdiff
path: root/src/drumkitparser.cc
diff options
context:
space:
mode:
authorLars Bisballe Jensen <larsbisballe@gmail.com>2014-10-22 15:38:31 +0200
committerLars Bisballe Jensen <larsbisballe@gmail.com>2014-10-22 15:38:31 +0200
commit8bdba7d92b44a0c6cb6745296adfda8d6168940e (patch)
tree95725fb515dcc3468c7fa3c0a70cab02e45fc657 /src/drumkitparser.cc
parent3605c085a7bcdeea4425f8793743bfac091f96cd (diff)
Now resets data when needed
Diffstat (limited to 'src/drumkitparser.cc')
-rw-r--r--src/drumkitparser.cc38
1 files changed, 37 insertions, 1 deletions
diff --git a/src/drumkitparser.cc b/src/drumkitparser.cc
index 36f76fc..1fabbb8 100644
--- a/src/drumkitparser.cc
+++ b/src/drumkitparser.cc
@@ -81,6 +81,27 @@ void DrumKitParser::startTag(std::string name,
}
}
+ if(in_metadata) {
+ if(name == "name") {
+ data = "";
+ }
+ if(name == "description") {
+ data = "";
+ }
+ if(name == "notes") {
+ data = "";
+ }
+ if(name == "author") {
+ data = "";
+ }
+ if(name == "email") {
+ data = "";
+ }
+ if(name == "website") {
+ data = "";
+ }
+ }
+
if(name == "metadata") {
in_metadata = true;
}
@@ -96,6 +117,15 @@ void DrumKitParser::startTag(std::string name,
in_channel = true;
}
+ if(in_channel) {
+ if(name == "name") {
+ data = "";
+ }
+ if(name == "microphone") {
+ data = "";
+ }
+ }
+
if(name == "instruments") {}
if(name == "instrument") {
@@ -117,6 +147,13 @@ void DrumKitParser::startTag(std::string name,
}
if(in_instrument) {
+ if(name == "name") {
+ data = "";
+ }
+
+ if(name == "description") {
+ data = "";
+ }
if(name == "channelmap") {
if(attr.find("in") == attr.end()) {
DEBUG(kitparser, "Missing 'in' in channelmap tag.\n");
@@ -138,7 +175,6 @@ void DrumKitParser::endTag(std::string name)
{
if(in_metadata) {
if(name == "name") {
- //FIXME: data is never "", find a new way to check for empty data
if(data != "") {
kit._name = data;
} else {