From c9200c25e02b2ab5c1fc4461a4621d109e798350 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sat, 20 Apr 2013 20:13:52 +0200 Subject: New 'instrument group' feature added. --- src/drumkitparser.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/drumkitparser.cc') diff --git a/src/drumkitparser.cc b/src/drumkitparser.cc index 5d7ae92..99dc06e 100644 --- a/src/drumkitparser.cc +++ b/src/drumkitparser.cc @@ -51,7 +51,7 @@ DrumKitParser::~DrumKitParser() } void DrumKitParser::startTag(std::string name, - std::map< std::string, std::string> attr) + std::map attr) { if(name == "drumkit") { if(attr.find("name") != attr.end()) @@ -88,6 +88,8 @@ void DrumKitParser::startTag(std::string name, instr_name = attr["name"]; instr_file = attr["file"]; + if(attr.find("group") != attr.end()) instr_group = attr["group"]; + else instr_group = ""; } if(name == "channelmap") { @@ -109,6 +111,7 @@ void DrumKitParser::endTag(std::string name) { if(name == "instrument") { Instrument *i = new Instrument(); + i->setGroup(instr_group); // Instrument &i = kit.instruments[kit.instruments.size() - 1]; InstrumentParser parser(path + "/" + instr_file, *i); parser.parse(); -- cgit v1.2.3