Mercurial > hg > svcore
diff data/model/NoteModel.h @ 1429:48e9f538e6e9
Untabify
author | Chris Cannam |
---|---|
date | Thu, 01 Mar 2018 18:02:22 +0000 |
parents | 57633d605547 |
children | 6965c83c8fa7 |
line wrap: on
line diff
--- a/data/model/NoteModel.h Thu Mar 01 14:43:40 2018 +0000 +++ b/data/model/NoteModel.h Thu Mar 01 18:02:22 2018 +0000 @@ -40,7 +40,7 @@ public: Note(sv_frame_t _frame) : frame(_frame), value(0.0f), duration(0), level(1.f) { } Note(sv_frame_t _frame, float _value, sv_frame_t _duration, float _level, QString _label) : - frame(_frame), value(_value), duration(_duration), level(_level), label(_label) { } + frame(_frame), value(_value), duration(_duration), level(_level), label(_label) { } int getDimensions() const { return 3; } @@ -56,9 +56,9 @@ QString indent = "", QString extraAttributes = "") const { - stream << + stream << QString("%1<point frame=\"%2\" value=\"%3\" duration=\"%4\" level=\"%5\" label=\"%6\" %7/>\n") - .arg(indent).arg(frame).arg(value).arg(duration).arg(level) + .arg(indent).arg(frame).arg(value).arg(duration).arg(level) .arg(XmlExportable::encodeEntities(label)).arg(extraAttributes); } @@ -75,21 +75,21 @@ } struct Comparator { - bool operator()(const Note &p1, - const Note &p2) const { - if (p1.frame != p2.frame) return p1.frame < p2.frame; - if (p1.value != p2.value) return p1.value < p2.value; - if (p1.duration != p2.duration) return p1.duration < p2.duration; + bool operator()(const Note &p1, + const Note &p2) const { + if (p1.frame != p2.frame) return p1.frame < p2.frame; + if (p1.value != p2.value) return p1.value < p2.value; + if (p1.duration != p2.duration) return p1.duration < p2.duration; if (p1.level != p2.level) return p1.level < p2.level; - return p1.label < p2.label; - } + return p1.label < p2.label; + } }; struct OrderComparator { - bool operator()(const Note &p1, - const Note &p2) const { - return p1.frame < p2.frame; - } + bool operator()(const Note &p1, + const Note &p2) const { + return p1.frame < p2.frame; + } }; }; @@ -100,22 +100,22 @@ public: NoteModel(sv_samplerate_t sampleRate, int resolution, - bool notifyOnAdd = true) : - IntervalModel<Note>(sampleRate, resolution, notifyOnAdd), - m_valueQuantization(0) + bool notifyOnAdd = true) : + IntervalModel<Note>(sampleRate, resolution, notifyOnAdd), + m_valueQuantization(0) { - PlayParameterRepository::getInstance()->addPlayable(this); + PlayParameterRepository::getInstance()->addPlayable(this); } NoteModel(sv_samplerate_t sampleRate, int resolution, - float valueMinimum, float valueMaximum, - bool notifyOnAdd = true) : - IntervalModel<Note>(sampleRate, resolution, + float valueMinimum, float valueMaximum, + bool notifyOnAdd = true) : + IntervalModel<Note>(sampleRate, resolution, valueMinimum, valueMaximum, notifyOnAdd), - m_valueQuantization(0) + m_valueQuantization(0) { - PlayParameterRepository::getInstance()->addPlayable(this); + PlayParameterRepository::getInstance()->addPlayable(this); } virtual ~NoteModel() @@ -143,10 +143,10 @@ << extraAttributes.toStdString() << std::endl; IntervalModel<Note>::toXml - (out, + (out, indent, - QString("%1 subtype=\"note\" valueQuantization=\"%2\"") - .arg(extraAttributes).arg(m_valueQuantization)); + QString("%1 subtype=\"note\" valueQuantization=\"%2\"") + .arg(extraAttributes).arg(m_valueQuantization)); } /** @@ -227,13 +227,13 @@ NoteList getNotesWithin(sv_frame_t startFrame, sv_frame_t endFrame) const { - PointList points = getPoints(startFrame, endFrame); + PointList points = getPoints(startFrame, endFrame); NoteList notes; for (PointList::iterator pli = - points.begin(); pli != points.end(); ++pli) { + points.begin(); pli != points.end(); ++pli) { - sv_frame_t duration = pli->duration; + sv_frame_t duration = pli->duration; if (duration == 0 || duration == 1) { duration = sv_frame_t(getSampleRate() / 20); }