comparison src/MainWindow.cpp @ 357:d511868c1ffe

smaller step size for ffwd and rewind
author matthiasm
date Wed, 18 Jun 2014 10:44:05 +0100
parents 0b08d860081b
children 0f72797ecdef
comparison
equal deleted inserted replaced
356:0b08d860081b 357:d511868c1ffe
3294 ++frame; 3294 ++frame;
3295 3295
3296 size_t sr = getMainModel()->getSampleRate(); 3296 size_t sr = getMainModel()->getSampleRate();
3297 3297
3298 // The step is supposed to scale and be as wide as a step of 3298 // The step is supposed to scale and be as wide as a step of
3299 // m_defaultFfwdRwdStep seconds at zoom level 512 and sr = 44100 3299 // m_defaultFfwdRwdStep seconds at zoom level 720 and sr = 44100
3300 size_t framesPerPixel = m_viewManager->getGlobalZoom(); 3300 size_t framesPerPixel = m_viewManager->getGlobalZoom();
3301 size_t defaultZoom = (512 * 44100) / sr; 3301 size_t defaultZoom = (720 * 44100) / sr;
3302 3302
3303 float scaler = (framesPerPixel * 1.0f) / defaultZoom; 3303 float scaler = (framesPerPixel * 1.0f) / defaultZoom;
3304 3304
3305 3305
3306 frame = RealTime::realTime2Frame 3306 frame = RealTime::realTime2Frame
3334 if (frame > 0) --frame; 3334 if (frame > 0) --frame;
3335 3335
3336 size_t sr = getMainModel()->getSampleRate(); 3336 size_t sr = getMainModel()->getSampleRate();
3337 3337
3338 // The step is supposed to scale and be as wide as a step of 3338 // The step is supposed to scale and be as wide as a step of
3339 // m_defaultFfwdRwdStep seconds at zoom level 512 and sr = 44100 3339 // m_defaultFfwdRwdStep seconds at zoom level 720 and sr = 44100
3340 size_t framesPerPixel = m_viewManager->getGlobalZoom(); 3340 size_t framesPerPixel = m_viewManager->getGlobalZoom();
3341 size_t defaultZoom = (512 * 44100) / sr; 3341 size_t defaultZoom = (720 * 44100) / sr;
3342 3342
3343 float scaler = (framesPerPixel * 1.0f) / defaultZoom; 3343 float scaler = (framesPerPixel * 1.0f) / defaultZoom;
3344 frame = RealTime::realTime2Frame 3344 frame = RealTime::realTime2Frame
3345 (RealTime::frame2RealTime(frame, sr) - m_defaultFfwdRwdStep * scaler, sr); 3345 (RealTime::frame2RealTime(frame, sr) - m_defaultFfwdRwdStep * scaler, sr);
3346 if (frame < int(getMainModel()->getStartFrame())) { 3346 if (frame < int(getMainModel()->getStartFrame())) {