comparison data/model/SparseTimeValueModel.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 5b7b01da430a
children 353a2d15f213
comparison
equal deleted inserted replaced
1658:5b7b01da430a 1659:8bf3a52a1604
79 virtual ~SparseTimeValueModel() { 79 virtual ~SparseTimeValueModel() {
80 PlayParameterRepository::getInstance()->removePlayable(this); 80 PlayParameterRepository::getInstance()->removePlayable(this);
81 } 81 }
82 82
83 QString getTypeName() const override { return tr("Sparse Time-Value"); } 83 QString getTypeName() const override { return tr("Sparse Time-Value"); }
84 84 bool isSparse() const { return true; }
85 bool isOK() const override { return true; } 85 bool isOK() const override { return true; }
86 sv_frame_t getStartFrame() const override { return m_events.getStartFrame(); } 86
87 sv_frame_t getEndFrame() const override { return m_events.getEndFrame(); } 87 sv_frame_t getStartFrame() const override {
88 return m_events.getStartFrame();
89 }
90 sv_frame_t getEndFrame() const override {
91 if (m_events.isEmpty()) return 0;
92 sv_frame_t e = m_events.getEndFrame() + 1;
93 if (e % m_resolution == 0) return e;
94 else return (e / m_resolution + 1) * m_resolution;
95 }
96
88 sv_samplerate_t getSampleRate() const override { return m_sampleRate; } 97 sv_samplerate_t getSampleRate() const override { return m_sampleRate; }
89 int getResolution() const { return m_resolution; } 98 int getResolution() const { return m_resolution; }
90 99
91 bool canPlay() const override { return true; } 100 bool canPlay() const override { return true; }
92 bool getDefaultPlayAudible() const override { return false; } // user must unmute 101 bool getDefaultPlayAudible() const override { return false; } // user must unmute