summaryrefslogtreecommitdiff
path: root/src/drumkitparser.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2013-04-20 20:13:52 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2013-04-20 20:13:52 +0200
commitc9200c25e02b2ab5c1fc4461a4621d109e798350 (patch)
tree6fca342d86d9e0839ae02bc66b3476f59a29eec7 /src/drumkitparser.cc
parent180d70312335d7274eff605e3ec4c1af5879daa4 (diff)
New 'instrument group' feature added.
Diffstat (limited to 'src/drumkitparser.cc')
-rw-r--r--src/drumkitparser.cc5
1 files changed, 4 insertions, 1 deletions
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<std::string, std::string> 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();