comparison data/model/ModelDataTableModel.cpp @ 417:12b7bf0c3915

* Compile fixes
author Chris Cannam
date Tue, 10 Jun 2008 09:11:42 +0000
parents a00902d5f0ab
children 64e7bbb255d3
comparison
equal deleted inserted replaced
416:a00902d5f0ab 417:12b7bf0c3915
17 17
18 #include "SparseTimeValueModel.h" 18 #include "SparseTimeValueModel.h"
19 #include "SparseOneDimensionalModel.h" 19 #include "SparseOneDimensionalModel.h"
20 #include "SparseModel.h" 20 #include "SparseModel.h"
21 21
22 #include <algorithm>
23
22 ModelDataTableModel::ModelDataTableModel(Model *m) : 24 ModelDataTableModel::ModelDataTableModel(Model *m) :
23 m_model(m) 25 m_model(m)
24 { 26 {
25 connect(m, SIGNAL(modelChanged()), this, SLOT(modelChanged())); 27 connect(m, SIGNAL(modelChanged()), this, SLOT(modelChanged()));
26 connect(m, SIGNAL(modelChanged(size_t, size_t)), 28 connect(m, SIGNAL(modelChanged(size_t, size_t)),
97 return QVariant(rt.toText().c_str()); 99 return QVariant(rt.toText().c_str());
98 } 100 }
99 101
100 case 1: 102 case 1:
101 std::cerr << "Returning frame " << frame << std::endl; 103 std::cerr << "Returning frame " << frame << std::endl;
102 return QVariant(frame); //!!! RealTime 104 return QVariant(int(frame));
103 105
104 case 2: 106 case 2:
105 if (dynamic_cast<const SparseOneDimensionalModel *>(m_model)) { 107 if (dynamic_cast<const SparseOneDimensionalModel *>(m_model)) {
106 const SparseOneDimensionalModel::Point *cp = 108 const SparseOneDimensionalModel::Point *cp =
107 reinterpret_cast<const SparseOneDimensionalModel::Point *>(point); 109 reinterpret_cast<const SparseOneDimensionalModel::Point *>(point);
166 typedef SparseModel<PointType> ModelType; 168 typedef SparseModel<PointType> ModelType;
167 typedef std::multiset<PointType, typename PointType::OrderComparator> 169 typedef std::multiset<PointType, typename PointType::OrderComparator>
168 PointListType; 170 PointListType;
169 typedef typename ModelType::EditCommand EditCommandType; 171 typedef typename ModelType::EditCommand EditCommandType;
170 172
171 ModelType *sm = dynamic_cast<const ModelType *>(m_model); 173 ModelType *sm = dynamic_cast<ModelType *>(m_model);
172 const PointListType &points = sm->getPoints(frame); 174 const PointListType &points = sm->getPoints(frame);
173 175
174 // it is possible to have more than one point at the same frame 176 // it is possible to have more than one point at the same frame
175 177
176 int indexAtFrame = 0; 178 int indexAtFrame = 0;