diff options
author | Jonas Suhr Christensen <jsc@umbraculum.org> | 2014-11-05 14:40:53 +0100 |
---|---|---|
committer | Jonas Suhr Christensen <jsc@umbraculum.org> | 2014-11-05 14:40:53 +0100 |
commit | 9907626a2ee3a5a0ed08ad79dec7a7071939df23 (patch) | |
tree | b815e848e07f03afac27dd47424fe4d7ba12d2a2 | |
parent | 2deeb15d4de7d3747f1d65637f429cedf794cd35 (diff) | |
parent | 5ef4aaaf94abc885fa3e7941246cd04ee57623c6 (diff) |
Merge branch 'metadata_v1' of http://git.drumgizmo.org/drumgizmo into metadata_v1
-rw-r--r-- | src/drumkitparser.cc | 45 |
1 files changed, 5 insertions, 40 deletions
diff --git a/src/drumkitparser.cc b/src/drumkitparser.cc index f04f710..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<std::string, std::string> 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"); @@ -291,15 +256,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", |