comparison data/model/IntervalModel.h @ 1599:ce185d4dd408 bqaudiostream

Merge from default branch
author Chris Cannam
date Wed, 23 Jan 2019 14:43:43 +0000
parents ad5f892c0c4d
children 0e0947896fd3
comparison
equal deleted inserted replaced
1598:d2555df635ec 1599:ce185d4dd408
11 published by the Free Software Foundation; either version 2 of the 11 published by the Free Software Foundation; either version 2 of the
12 License, or (at your option) any later version. See the file 12 License, or (at your option) any later version. See the file
13 COPYING included with this distribution for more information. 13 COPYING included with this distribution for more information.
14 */ 14 */
15 15
16 #ifndef _INTERVAL_MODEL_H_ 16 #ifndef SV_INTERVAL_MODEL_H
17 #define _INTERVAL_MODEL_H_ 17 #define SV_INTERVAL_MODEL_H
18 18
19 #include "SparseValueModel.h" 19 #include "SparseValueModel.h"
20 #include "base/RealTime.h" 20 #include "base/RealTime.h"
21 21
22 /** 22 /**
55 * given frame. Consequently this can be very slow (optimised 55 * given frame. Consequently this can be very slow (optimised
56 * data structures still to be done!). 56 * data structures still to be done!).
57 */ 57 */
58 virtual typename SparseValueModel<PointType>::PointList getPoints(sv_frame_t frame) const; 58 virtual typename SparseValueModel<PointType>::PointList getPoints(sv_frame_t frame) const;
59 59
60 virtual const typename SparseModel<PointType>::PointList &getPoints() const { 60 const typename SparseModel<PointType>::PointList &getPoints() const override {
61 return SparseModel<PointType>::getPoints(); 61 return SparseModel<PointType>::getPoints();
62 } 62 }
63 63
64 /** 64 /**
65 * TabularModel methods. 65 * TabularModel methods.
66 */ 66 */
67 67
68 virtual QVariant getData(int row, int column, int role) const 68 QVariant getData(int row, int column, int role) const override
69 { 69 {
70 if (column < 2) { 70 if (column < 2) {
71 return SparseValueModel<PointType>::getData 71 return SparseValueModel<PointType>::getData
72 (row, column, role); 72 (row, column, role);
73 } 73 }
84 case 3: return int(i->duration); //!!! could be better presented 84 case 3: return int(i->duration); //!!! could be better presented
85 default: return QVariant(); 85 default: return QVariant();
86 } 86 }
87 } 87 }
88 88
89 virtual Command *getSetDataCommand(int row, int column, const QVariant &value, int role) 89 Command *getSetDataCommand(int row, int column, const QVariant &value, int role) override
90 { 90 {
91 typedef IntervalModel<PointType> I; 91 typedef IntervalModel<PointType> I;
92 92
93 if (column < 2) { 93 if (column < 2) {
94 return SparseValueModel<PointType>::getSetDataCommand 94 return SparseValueModel<PointType>::getSetDataCommand
113 113
114 command->addPoint(point); 114 command->addPoint(point);
115 return command->finish(); 115 return command->finish();
116 } 116 }
117 117
118 virtual bool isColumnTimeValue(int column) const 118 bool isColumnTimeValue(int column) const override
119 { 119 {
120 // NB duration is not a "time value" -- that's for columns 120 // NB duration is not a "time value" -- that's for columns
121 // whose sort ordering is exactly that of the frame time 121 // whose sort ordering is exactly that of the frame time
122 return (column < 2); 122 return (column < 2);
123 } 123 }