Mercurial > hg > svcore
diff data/model/IntervalModel.h @ 1069:32ab6c48efaa
Merge from branch tonioni
author | Chris Cannam |
---|---|
date | Mon, 20 Apr 2015 09:11:34 +0100 |
parents | 0559f25b99f2 |
children | 48e9f538e6e9 |
line wrap: on
line diff
--- a/data/model/IntervalModel.h Mon Mar 02 17:21:34 2015 +0000 +++ b/data/model/IntervalModel.h Mon Apr 20 09:11:34 2015 +0100 @@ -29,12 +29,12 @@ class IntervalModel : public SparseValueModel<PointType> { public: - IntervalModel(int sampleRate, int resolution, + IntervalModel(sv_samplerate_t sampleRate, int resolution, bool notifyOnAdd = true) : SparseValueModel<PointType>(sampleRate, resolution, notifyOnAdd) { } - IntervalModel(int sampleRate, int resolution, + IntervalModel(sv_samplerate_t sampleRate, int resolution, float valueMinimum, float valueMaximum, bool notifyOnAdd = true) : SparseValueModel<PointType>(sampleRate, resolution, @@ -48,14 +48,14 @@ * and after). Consequently this can be very slow (optimised data * structures still to be done!). */ - virtual typename SparseValueModel<PointType>::PointList getPoints(long start, long end) const; + virtual typename SparseValueModel<PointType>::PointList getPoints(sv_frame_t start, sv_frame_t end) const; /** * PointTypes have a duration, so this returns all points that span the * given frame. Consequently this can be very slow (optimised * data structures still to be done!). */ - virtual typename SparseValueModel<PointType>::PointList getPoints(long frame) const; + virtual typename SparseValueModel<PointType>::PointList getPoints(sv_frame_t frame) const; virtual const typename SparseModel<PointType>::PointList &getPoints() const { return SparseModel<PointType>::getPoints(); @@ -107,7 +107,7 @@ switch (column) { // column cannot be 0 or 1, those cases were handled above - case 2: point.value = value.toDouble(); break; + case 2: point.value = float(value.toDouble()); break; case 3: point.duration = value.toInt(); break; } @@ -125,7 +125,7 @@ template <typename PointType> typename SparseValueModel<PointType>::PointList -IntervalModel<PointType>::getPoints(long start, long end) const +IntervalModel<PointType>::getPoints(sv_frame_t start, sv_frame_t end) const { typedef IntervalModel<PointType> I; @@ -146,7 +146,7 @@ for (typename I::PointListConstIterator i = endItr; i != I::m_points.begin(); ) { --i; if (i->frame < start) { - if (i->frame + long(i->duration) >= start) { + if (i->frame + i->duration >= start) { rv.insert(*i); } } else if (i->frame <= end) { @@ -159,7 +159,7 @@ template <typename PointType> typename SparseValueModel<PointType>::PointList -IntervalModel<PointType>::getPoints(long frame) const +IntervalModel<PointType>::getPoints(sv_frame_t frame) const { typedef IntervalModel<PointType> I; @@ -168,8 +168,8 @@ if (I::m_resolution == 0) return typename I::PointList(); - long start = (frame / I::m_resolution) * I::m_resolution; - long end = start + I::m_resolution; + sv_frame_t start = (frame / I::m_resolution) * I::m_resolution; + sv_frame_t end = start + I::m_resolution; PointType endPoint(end); @@ -180,7 +180,7 @@ for (typename I::PointListConstIterator i = endItr; i != I::m_points.begin(); ) { --i; if (i->frame < start) { - if (i->frame + long(i->duration) >= start) { + if (i->frame + i->duration >= start) { rv.insert(*i); } } else if (i->frame <= end) {