Mercurial > hg > svapp
changeset 85:40d0c964ad24
* Fix ffwd/rewind in aligned layer
author | Chris Cannam |
---|---|
date | Tue, 05 Feb 2008 13:46:45 +0000 |
parents | 19142c58cc4c |
children | dd74c5332b49 |
files | framework/MainWindowBase.cpp |
diffstat | 1 files changed, 11 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/framework/MainWindowBase.cpp Tue Jan 29 19:54:54 2008 +0000 +++ b/framework/MainWindowBase.cpp Tue Feb 05 13:46:45 2008 +0000 @@ -1593,6 +1593,7 @@ int frame = m_viewManager->getPlaybackFrame(); ++frame; + Pane *pane = m_paneStack->getCurrentPane(); Layer *layer = getSnapLayer(); size_t sr = getMainModel()->getSampleRate(); @@ -1607,8 +1608,10 @@ } else { size_t resolution = 0; - if (!layer->snapToFeatureFrame(m_paneStack->getCurrentPane(), - frame, resolution, Layer::SnapRight)) { + if (layer->snapToFeatureFrame(m_paneStack->getCurrentPane(), + frame, resolution, Layer::SnapRight)) { + if (pane) frame = pane->alignToReference(frame); + } else { frame = getMainModel()->getEndFrame(); } } @@ -1644,6 +1647,7 @@ int frame = m_viewManager->getPlaybackFrame(); if (frame > 0) --frame; + Pane *pane = m_paneStack->getCurrentPane(); Layer *layer = getSnapLayer(); size_t sr = getMainModel()->getSampleRate(); @@ -1670,8 +1674,11 @@ } else { size_t resolution = 0; - if (!layer->snapToFeatureFrame(m_paneStack->getCurrentPane(), - frame, resolution, Layer::SnapLeft)) { + if (layer->snapToFeatureFrame(m_paneStack->getCurrentPane(), + frame, resolution, Layer::SnapLeft)) { + + if (pane) frame = pane->alignToReference(frame); + } else { frame = getMainModel()->getStartFrame(); } }