Mercurial > hg > svapp
comparison framework/MainWindowBase.cpp @ 85:40d0c964ad24
* Fix ffwd/rewind in aligned layer
author | Chris Cannam |
---|---|
date | Tue, 05 Feb 2008 13:46:45 +0000 |
parents | b1a68403714b |
children | dd74c5332b49 |
comparison
equal
deleted
inserted
replaced
84:19142c58cc4c | 85:40d0c964ad24 |
---|---|
1591 if (!getMainModel()) return; | 1591 if (!getMainModel()) return; |
1592 | 1592 |
1593 int frame = m_viewManager->getPlaybackFrame(); | 1593 int frame = m_viewManager->getPlaybackFrame(); |
1594 ++frame; | 1594 ++frame; |
1595 | 1595 |
1596 Pane *pane = m_paneStack->getCurrentPane(); | |
1596 Layer *layer = getSnapLayer(); | 1597 Layer *layer = getSnapLayer(); |
1597 size_t sr = getMainModel()->getSampleRate(); | 1598 size_t sr = getMainModel()->getSampleRate(); |
1598 | 1599 |
1599 if (!layer) { | 1600 if (!layer) { |
1600 | 1601 |
1605 } | 1606 } |
1606 | 1607 |
1607 } else { | 1608 } else { |
1608 | 1609 |
1609 size_t resolution = 0; | 1610 size_t resolution = 0; |
1610 if (!layer->snapToFeatureFrame(m_paneStack->getCurrentPane(), | 1611 if (layer->snapToFeatureFrame(m_paneStack->getCurrentPane(), |
1611 frame, resolution, Layer::SnapRight)) { | 1612 frame, resolution, Layer::SnapRight)) { |
1613 if (pane) frame = pane->alignToReference(frame); | |
1614 } else { | |
1612 frame = getMainModel()->getEndFrame(); | 1615 frame = getMainModel()->getEndFrame(); |
1613 } | 1616 } |
1614 } | 1617 } |
1615 | 1618 |
1616 if (frame < 0) frame = 0; | 1619 if (frame < 0) frame = 0; |
1642 if (!getMainModel()) return; | 1645 if (!getMainModel()) return; |
1643 | 1646 |
1644 int frame = m_viewManager->getPlaybackFrame(); | 1647 int frame = m_viewManager->getPlaybackFrame(); |
1645 if (frame > 0) --frame; | 1648 if (frame > 0) --frame; |
1646 | 1649 |
1650 Pane *pane = m_paneStack->getCurrentPane(); | |
1647 Layer *layer = getSnapLayer(); | 1651 Layer *layer = getSnapLayer(); |
1648 size_t sr = getMainModel()->getSampleRate(); | 1652 size_t sr = getMainModel()->getSampleRate(); |
1649 | 1653 |
1650 // when rewinding during playback, we want to allow a period | 1654 // when rewinding during playback, we want to allow a period |
1651 // following a rewind target point at which the rewind will go to | 1655 // following a rewind target point at which the rewind will go to |
1668 } | 1672 } |
1669 | 1673 |
1670 } else { | 1674 } else { |
1671 | 1675 |
1672 size_t resolution = 0; | 1676 size_t resolution = 0; |
1673 if (!layer->snapToFeatureFrame(m_paneStack->getCurrentPane(), | 1677 if (layer->snapToFeatureFrame(m_paneStack->getCurrentPane(), |
1674 frame, resolution, Layer::SnapLeft)) { | 1678 frame, resolution, Layer::SnapLeft)) { |
1679 | |
1680 if (pane) frame = pane->alignToReference(frame); | |
1681 } else { | |
1675 frame = getMainModel()->getStartFrame(); | 1682 frame = getMainModel()->getStartFrame(); |
1676 } | 1683 } |
1677 } | 1684 } |
1678 | 1685 |
1679 if (frame < 0) frame = 0; | 1686 if (frame < 0) frame = 0; |