comparison src/Analyser.cpp @ 273:29005aa146e2

fixed candidates exceeding the frequency-constrained selection horizontally (vertically still to come)
author matthiasm
date Thu, 10 Apr 2014 17:55:43 +0100
parents 8eb167e817e7
children 2a2fd6eb8fa8
comparison
equal deleted inserted replaced
271:846df0ea9c82 273:29005aa146e2
379 t.setParameter("minfreq", range.min); 379 t.setParameter("minfreq", range.min);
380 t.setParameter("maxfreq", range.max); 380 t.setParameter("maxfreq", range.max);
381 t.setBlockSize(4096); 381 t.setBlockSize(4096);
382 } 382 }
383 383
384 RealTime start = RealTime::frame2RealTime 384 // get time stamps that align with the 256-sample grid of the original extraction
385 (round(sel.getStartFrame()*1.0/256) * 256 - 4*256, m_fileModel->getSampleRate()); // 4*256 is for 4 frames offset due to timestamp shift 385 int startSample = ceil(sel.getStartFrame()*1.0/256) * 256;
386 386 int endSample = ceil(sel.getEndFrame()*1.0/256) * 256;
387 RealTime end = RealTime::frame2RealTime 387 if (!range.isConstrained()) {
388 (round(sel.getEndFrame()*1.0/256) * 256 - 4*256, m_fileModel->getSampleRate()); 388 startSample -= 4*256; // 4*256 is for 4 frames offset due to timestamp shift
389 endSample -= 4*256;
390 } else {
391 endSample -= 9*256; // MM says: not sure what the CHP plugin does there
392 }
393 RealTime start = RealTime::frame2RealTime(startSample, m_fileModel->getSampleRate());
394 RealTime end = RealTime::frame2RealTime(endSample, m_fileModel->getSampleRate());
389 395
390 RealTime duration; 396 RealTime duration;
391 397
392 if (sel.getEndFrame() > sel.getStartFrame()) { 398 if (sel.getEndFrame() > sel.getStartFrame()) {
393 duration = end - start; 399 duration = end - start;