From be826130ca0919242ce55030152e290d8076855d Mon Sep 17 00:00:00 2001 From: Lars Bisballe Jensen Date: Wed, 22 Oct 2014 15:59:21 +0200 Subject: Changed name to id for channels --- src/drumkitparser.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/drumkitparser.cc b/src/drumkitparser.cc index f04f710..b2acf1b 100644 --- a/src/drumkitparser.cc +++ b/src/drumkitparser.cc @@ -291,15 +291,15 @@ void DrumKitParser::endTag(std::string name) while(ic != parser.channellist.end()) { InstrumentChannel *c = *ic; - std::string cname = c->name; + std::string cname = c->id; if(channelmap.find(cname) != channelmap.end()) cname = channelmap[cname]; for(size_t cnt = 0; cnt < kit.channels.size(); cnt++) { - if(kit.channels[cnt].name == cname) c->num = kit.channels[cnt].num; + if(kit.channels[cnt].id == cname) c->num = kit.channels[cnt].num; } if(c->num == NO_CHANNEL) { DEBUG(kitparser, "Missing channel '%s' in instrument '%s'\n", - c->name.c_str(), i->id().c_str()); + c->id.c_str(), i->id().c_str()); } else { /* DEBUG(kitparser, "Assigned channel '%s' to number %d in instrument '%s'\n", -- cgit v1.2.3 From 906c2715f49590fbbfe9546904f5216724b70deb Mon Sep 17 00:00:00 2001 From: Lars Bisballe Jensen Date: Thu, 23 Oct 2014 11:18:47 +0200 Subject: A much nicer way to reset element data string --- src/drumkitparser.cc | 39 ++------------------------------------- 1 file changed, 2 insertions(+), 37 deletions(-) diff --git a/src/drumkitparser.cc b/src/drumkitparser.cc index b2acf1b..e426852 100644 --- a/src/drumkitparser.cc +++ b/src/drumkitparser.cc @@ -65,6 +65,8 @@ void DrumKitParser::characterData(std::string &data) void DrumKitParser::startTag(std::string name, std::map attr) { + data = ""; + if(name == "drumkit") { if(attr.find("version") != attr.end()) { try { @@ -81,27 +83,6 @@ 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; } @@ -117,15 +98,6 @@ 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") { @@ -147,13 +119,6 @@ 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"); -- cgit v1.2.3