summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2012-01-12 16:30:41 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2012-01-12 16:30:41 +0100
commitec9148f95b0c47c8eecf26f6f2f16c1db558a3b9 (patch)
tree9e0fb1736740d12ebdd372f603677f74a5262927
parente436e02f164977bb41f2740b5ad59fc89a1a1490 (diff)
Changed instrument list to containing pointers.
-rw-r--r--src/drumkitparser.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/drumkitparser.cc b/src/drumkitparser.cc
index 53b0a6d..5d7ae92 100644
--- a/src/drumkitparser.cc
+++ b/src/drumkitparser.cc
@@ -40,7 +40,7 @@ DrumKitParser::DrumKitParser(const std::string &kitfile, DrumKit &k)
fd = fopen(kitfile.c_str(), "r");
- printf("Parsing drumkit in %s\n", kitfile.c_str());
+ // printf("Parsing drumkit in %s\n", kitfile.c_str());
if(!fd) return;
}
@@ -108,10 +108,11 @@ void DrumKitParser::startTag(std::string name,
void DrumKitParser::endTag(std::string name)
{
if(name == "instrument") {
- Instrument i;
- InstrumentParser parser(path + "/" + instr_file, i);
+ Instrument *i = new Instrument();
+ // Instrument &i = kit.instruments[kit.instruments.size() - 1];
+ InstrumentParser parser(path + "/" + instr_file, *i);
parser.parse();
- kit.instruments.push_back(i);//[attr["name"]] = i;
+ kit.instruments.push_back(i);
// Assign kit channel numbers to instruments channels.
std::vector<InstrumentChannel*>::iterator ic = parser.channellist.begin();
@@ -126,7 +127,7 @@ void DrumKitParser::endTag(std::string name)
}
if(c->num == NO_CHANNEL) {
printf("Missing channel '%s' in instrument '%s'\n",
- c->name.c_str(), i.name().c_str());
+ c->name.c_str(), i->name().c_str());
} else {
/*
printf("Assigned channel '%s' to number %d in instrument '%s'\n",