summaryrefslogtreecommitdiff
path: root/src/instrumentparser.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2013-05-16 19:26:37 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2013-05-16 19:26:37 +0200
commitbc7d41279222dbd07f8e6f02f067347d10c69f33 (patch)
treef9eb86bf41430a749fbbf779207f49786922f690 /src/instrumentparser.cc
parent20c37dd67deaa52f32ab7cde142c0dc91db57650 (diff)
Change printf's to DEBUG.
Diffstat (limited to 'src/instrumentparser.cc')
-rw-r--r--src/instrumentparser.cc22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/instrumentparser.cc b/src/instrumentparser.cc
index 1445cbe..15195e1 100644
--- a/src/instrumentparser.cc
+++ b/src/instrumentparser.cc
@@ -29,13 +29,15 @@
#include <string.h>
#include <stdio.h>
+#include <hugin.hpp>
+
#include "path.h"
InstrumentParser::InstrumentParser(const std::string &file, Instrument &i)
: instrument(i)
{
s = NULL;
- // printf("Parsing instrument in %s\n", file.c_str());
+ // DEBUG(instrparser,"Parsing instrument in %s\n", file.c_str());
path = getPath(file);
fd = fopen(file.c_str(), "r");
if(!fd) return;
@@ -62,7 +64,7 @@ void InstrumentParser::startTag(std::string name,
if(name == "sample") {
if(attr.find("name") == attr.end()) {
- printf("Missing required attribute 'name'.\n");
+ DEBUG(instrparser,"Missing required attribute 'name'.\n");
return;
}
s = new Sample(attr["name"]);
@@ -70,17 +72,17 @@ void InstrumentParser::startTag(std::string name,
if(name == "audiofile") {
if(s == NULL) {
- printf("Missing Sample!\n");
+ DEBUG(instrparser,"Missing Sample!\n");
return;
}
if(attr.find("file") == attr.end()) {
- printf("Missing required attribute 'file'.\n");
+ DEBUG(instrparser,"Missing required attribute 'file'.\n");
return;
}
if(attr.find("channel") == attr.end()) {
- printf("Missing required attribute 'channel'.\n");
+ DEBUG(instrparser,"Missing required attribute 'channel'.\n");
return;
}
@@ -96,12 +98,12 @@ void InstrumentParser::startTag(std::string name,
if(name == "velocity") {
if(attr.find("lower") == attr.end()) {
- printf("Missing required attribute 'lower'.\n");
+ DEBUG(instrparser,"Missing required attribute 'lower'.\n");
return;
}
if(attr.find("upper") == attr.end()) {
- printf("Missing required attribute 'upper'.\n");
+ DEBUG(instrparser,"Missing required attribute 'upper'.\n");
return;
}
@@ -111,7 +113,7 @@ void InstrumentParser::startTag(std::string name,
if(name == "sampleref") {
if(attr.find("name") == attr.end()) {
- printf("Missing required attribute 'name'.\n");
+ DEBUG(instrparser,"Missing required attribute 'name'.\n");
return;
}
@@ -126,7 +128,7 @@ void InstrumentParser::startTag(std::string name,
}
if(sample == NULL) {
- printf("Samplref pointed at non-existing sample.\n");
+ DEBUG(instrparser,"Samplref pointed at non-existing sample.\n");
return;
}
@@ -138,7 +140,7 @@ void InstrumentParser::endTag(std::string name)
{
if(name == "sample") {
if(s == NULL) {
- printf("Missing Sample.\n");
+ DEBUG(instrparser,"Missing Sample.\n");
return;
}