comparison data/model/RegionModel.h @ 1659:8bf3a52a1604 single-point

Work on start/end frame stuff to match API description
author Chris Cannam
date Thu, 21 Mar 2019 11:35:30 +0000
parents 31b46a5647db
children 82d03c9661f9
comparison
equal deleted inserted replaced
1658:5b7b01da430a 1659:8bf3a52a1604
75 75
76 virtual ~RegionModel() { 76 virtual ~RegionModel() {
77 } 77 }
78 78
79 QString getTypeName() const override { return tr("Region"); } 79 QString getTypeName() const override { return tr("Region"); }
80 80 bool isSparse() const { return true; }
81 bool isOK() const override { return true; } 81 bool isOK() const override { return true; }
82 sv_frame_t getStartFrame() const override { return m_events.getStartFrame(); } 82
83 sv_frame_t getEndFrame() const override { return m_events.getEndFrame(); } 83 sv_frame_t getStartFrame() const override {
84 return m_events.getStartFrame();
85 }
86 sv_frame_t getEndFrame() const override {
87 if (m_events.isEmpty()) return 0;
88 sv_frame_t e = m_events.getEndFrame();
89 if (e % m_resolution == 0) return e;
90 else return (e / m_resolution + 1) * m_resolution;
91 }
92
84 sv_samplerate_t getSampleRate() const override { return m_sampleRate; } 93 sv_samplerate_t getSampleRate() const override { return m_sampleRate; }
85 int getResolution() const { return m_resolution; } 94 int getResolution() const { return m_resolution; }
86 95
87 QString getScaleUnits() const { return m_units; } 96 QString getScaleUnits() const { return m_units; }
88 void setScaleUnits(QString units) { 97 void setScaleUnits(QString units) {