diff framework/SVFileReader.cpp @ 61:215b8b1b0308

* Add Erase tool and mode * Add icons for Normalize buttons in property boxes, and for Show Peaks * Add support for velocity in notes -- not yet reflected in display or editable in the note edit dialog, but they are imported from MIDI, played, and exported * Begin work on making pastes align pasted times (subtler than I thought)
author Chris Cannam
date Fri, 23 Nov 2007 16:48:23 +0000
parents de2b3c6479c8
children 4aa40182321f 22bf057ea151
line wrap: on
line diff
--- a/framework/SVFileReader.cpp	Thu Nov 22 14:17:19 2007 +0000
+++ b/framework/SVFileReader.cpp	Fri Nov 23 16:48:23 2007 +0000
@@ -851,7 +851,12 @@
 	size_t duration = 0;
 	duration = attributes.value("duration").trimmed().toUInt(&ok);
 	QString label = attributes.value("label");
-	nm->addPoint(NoteModel::Point(frame, value, duration, label));
+        float level = attributes.value("level").trimmed().toFloat(&ok);
+        if (!ok) { // level is optional
+            level = 1.f;
+            ok = true;
+        }
+	nm->addPoint(NoteModel::Point(frame, value, duration, level, label));
 	return ok;
     }