comparison data/model/AlignmentModel.cpp @ 313:29485aa03da4

* Make drop behave more sensibly (replace current pane)
author Chris Cannam
date Wed, 17 Oct 2007 12:58:45 +0000
parents df707a61b23f
children a71dec01c4d3
comparison
equal deleted inserted replaced
312:df707a61b23f 313:29485aa03da4
213 213
214 float resultTime = foundTime; 214 float resultTime = foundTime;
215 215
216 if (followingFrame != foundFrame && frame > foundFrame) { 216 if (followingFrame != foundFrame && frame > foundFrame) {
217 217
218 std::cerr << "AlignmentModel::align: foundFrame = " << foundFrame << ", frame = " << frame << ", followingFrame = " << followingFrame << std::endl; 218 // std::cerr << "AlignmentModel::align: foundFrame = " << foundFrame << ", frame = " << frame << ", followingFrame = " << followingFrame << std::endl;
219 219
220 float interp = float(frame - foundFrame) / float(followingFrame - foundFrame); 220 float interp = float(frame - foundFrame) / float(followingFrame - foundFrame);
221 std::cerr << "AlignmentModel::align: interp = " << interp << ", result " << resultTime << " -> "; 221 // std::cerr << "AlignmentModel::align: interp = " << interp << ", result " << resultTime << " -> ";
222 222
223 resultTime += (followingTime - foundTime) * interp; 223 resultTime += (followingTime - foundTime) * interp;
224 224
225 std::cerr << resultTime << std::endl; 225 // std::cerr << resultTime << std::endl;
226 } 226 }
227 227
228 size_t resultFrame = lrintf(resultTime * getSampleRate()); 228 size_t resultFrame = lrintf(resultTime * getSampleRate());
229 229
230 std::cerr << "AlignmentModel::align: resultFrame = " << resultFrame << std::endl; 230 // std::cerr << "AlignmentModel::align: resultFrame = " << resultFrame << std::endl;
231 231
232 return resultFrame; 232 return resultFrame;
233 } 233 }
234 234