Mercurial > hg > svcore
comparison data/model/AlignmentModel.cpp @ 929:59e7fe1b1003 warnfix_no_size_t
Unsigned removals and warning fixes in data/
author | Chris Cannam |
---|---|
date | Tue, 17 Jun 2014 14:33:42 +0100 |
parents | e802e550a1f2 |
children | cd42620e3f40 |
comparison
equal
deleted
inserted
replaced
928:6a94bb528e9d | 929:59e7fe1b1003 |
---|---|
35 if (m_rawPath) { | 35 if (m_rawPath) { |
36 | 36 |
37 connect(m_rawPath, SIGNAL(modelChanged()), | 37 connect(m_rawPath, SIGNAL(modelChanged()), |
38 this, SLOT(pathChanged())); | 38 this, SLOT(pathChanged())); |
39 | 39 |
40 connect(m_rawPath, SIGNAL(modelChanged(size_t, size_t)), | 40 connect(m_rawPath, SIGNAL(modelChanged(int, int)), |
41 this, SLOT(pathChanged(size_t, size_t))); | 41 this, SLOT(pathChanged(int, int))); |
42 | 42 |
43 connect(m_rawPath, SIGNAL(completionChanged()), | 43 connect(m_rawPath, SIGNAL(completionChanged()), |
44 this, SLOT(pathCompletionChanged())); | 44 this, SLOT(pathCompletionChanged())); |
45 | 45 |
46 constructPath(); | 46 constructPath(); |
72 { | 72 { |
73 if (m_rawPath) return m_rawPath->isOK(); | 73 if (m_rawPath) return m_rawPath->isOK(); |
74 else return true; | 74 else return true; |
75 } | 75 } |
76 | 76 |
77 size_t | 77 int |
78 AlignmentModel::getStartFrame() const | 78 AlignmentModel::getStartFrame() const |
79 { | 79 { |
80 size_t a = m_reference->getStartFrame(); | 80 int a = m_reference->getStartFrame(); |
81 size_t b = m_aligned->getStartFrame(); | 81 int b = m_aligned->getStartFrame(); |
82 return std::min(a, b); | 82 return std::min(a, b); |
83 } | 83 } |
84 | 84 |
85 size_t | 85 int |
86 AlignmentModel::getEndFrame() const | 86 AlignmentModel::getEndFrame() const |
87 { | 87 { |
88 size_t a = m_reference->getEndFrame(); | 88 int a = m_reference->getEndFrame(); |
89 size_t b = m_aligned->getEndFrame(); | 89 int b = m_aligned->getEndFrame(); |
90 return std::max(a, b); | 90 return std::max(a, b); |
91 } | 91 } |
92 | 92 |
93 size_t | 93 int |
94 AlignmentModel::getSampleRate() const | 94 AlignmentModel::getSampleRate() const |
95 { | 95 { |
96 return m_reference->getSampleRate(); | 96 return m_reference->getSampleRate(); |
97 } | 97 } |
98 | 98 |
135 AlignmentModel::getAlignedModel() const | 135 AlignmentModel::getAlignedModel() const |
136 { | 136 { |
137 return m_aligned; | 137 return m_aligned; |
138 } | 138 } |
139 | 139 |
140 size_t | 140 int |
141 AlignmentModel::toReference(size_t frame) const | 141 AlignmentModel::toReference(int frame) const |
142 { | 142 { |
143 #ifdef DEBUG_ALIGNMENT_MODEL | 143 #ifdef DEBUG_ALIGNMENT_MODEL |
144 SVDEBUG << "AlignmentModel::toReference(" << frame << ")" << endl; | 144 SVDEBUG << "AlignmentModel::toReference(" << frame << ")" << endl; |
145 #endif | 145 #endif |
146 if (!m_path) { | 146 if (!m_path) { |
148 constructPath(); | 148 constructPath(); |
149 } | 149 } |
150 return align(m_path, frame); | 150 return align(m_path, frame); |
151 } | 151 } |
152 | 152 |
153 size_t | 153 int |
154 AlignmentModel::fromReference(size_t frame) const | 154 AlignmentModel::fromReference(int frame) const |
155 { | 155 { |
156 #ifdef DEBUG_ALIGNMENT_MODEL | 156 #ifdef DEBUG_ALIGNMENT_MODEL |
157 SVDEBUG << "AlignmentModel::fromReference(" << frame << ")" << endl; | 157 SVDEBUG << "AlignmentModel::fromReference(" << frame << ")" << endl; |
158 #endif | 158 #endif |
159 if (!m_reversePath) { | 159 if (!m_reversePath) { |
173 m_rawPath = 0; | 173 m_rawPath = 0; |
174 } | 174 } |
175 } | 175 } |
176 | 176 |
177 void | 177 void |
178 AlignmentModel::pathChanged(size_t, size_t) | 178 AlignmentModel::pathChanged(int, int) |
179 { | 179 { |
180 if (!m_pathComplete) return; | 180 if (!m_pathComplete) return; |
181 constructPath(); | 181 constructPath(); |
182 constructReversePath(); | 182 constructReversePath(); |
183 } | 183 } |
275 #ifdef DEBUG_ALIGNMENT_MODEL | 275 #ifdef DEBUG_ALIGNMENT_MODEL |
276 SVDEBUG << "AlignmentModel::constructReversePath: " << m_reversePath->getPointCount() << " points, at least " << (2 * m_reversePath->getPointCount() * (3 * sizeof(void *) + sizeof(int) + sizeof(PathPoint))) << " bytes" << endl; | 276 SVDEBUG << "AlignmentModel::constructReversePath: " << m_reversePath->getPointCount() << " points, at least " << (2 * m_reversePath->getPointCount() * (3 * sizeof(void *) + sizeof(int) + sizeof(PathPoint))) << " bytes" << endl; |
277 #endif | 277 #endif |
278 } | 278 } |
279 | 279 |
280 size_t | 280 int |
281 AlignmentModel::align(PathModel *path, size_t frame) const | 281 AlignmentModel::align(PathModel *path, int frame) const |
282 { | 282 { |
283 if (!path) return frame; | 283 if (!path) return frame; |
284 | 284 |
285 // The path consists of a series of points, each with frame equal | 285 // The path consists of a series of points, each with frame equal |
286 // to the frame on the source model and mapframe equal to the | 286 // to the frame on the source model and mapframe equal to the |
328 #endif | 328 #endif |
329 } | 329 } |
330 | 330 |
331 if (foundMapFrame < 0) return 0; | 331 if (foundMapFrame < 0) return 0; |
332 | 332 |
333 size_t resultFrame = foundMapFrame; | 333 int resultFrame = foundMapFrame; |
334 | 334 |
335 if (followingFrame != foundFrame && long(frame) > foundFrame) { | 335 if (followingFrame != foundFrame && long(frame) > foundFrame) { |
336 float interp = | 336 float interp = |
337 float(frame - foundFrame) / | 337 float(frame - foundFrame) / |
338 float(followingFrame - foundFrame); | 338 float(followingFrame - foundFrame); |