# HG changeset patch # User Chris Cannam # Date 1192560171 0 # Node ID 7b96a3261e1c96a5a0af33a947080c59f348af08 # Parent 1517c76cd678ebef92c62c8ce871961aab5102c1 * "Align mode" diff -r 1517c76cd678 -r 7b96a3261e1c view/View.cpp --- a/view/View.cpp Tue Oct 16 15:13:41 2007 +0000 +++ b/view/View.cpp Tue Oct 16 18:42:51 2007 +0000 @@ -1055,7 +1055,10 @@ View::getAlignedPlaybackFrame() const { if (!m_manager) return 0; - if (!m_manager->getPlaybackModel()) return m_manager->getPlaybackFrame(); + if (!m_manager->getAlignMode() || + !m_manager->getPlaybackModel()) { + return m_manager->getPlaybackFrame(); + } RangeSummarisableTimeValueModel *waveformModel = 0; for (LayerList::const_iterator i = m_layers.begin(); i != m_layers.end(); ++i) { diff -r 1517c76cd678 -r 7b96a3261e1c view/ViewManager.cpp --- a/view/ViewManager.cpp Tue Oct 16 15:13:41 2007 +0000 +++ b/view/ViewManager.cpp Tue Oct 16 18:42:51 2007 +0000 @@ -40,6 +40,7 @@ m_playLoopMode(false), m_playSelectionMode(false), m_playSoloMode(false), + m_alignMode(false), m_overlayMode(StandardOverlays), m_zoomWheelsEnabled(true), m_lightPalette(QApplication::palette()), @@ -358,6 +359,18 @@ } } +void +ViewManager::setAlignMode(bool mode) +{ + if (m_alignMode != mode) { + + m_alignMode = mode; + + emit alignModeChanged(); + emit alignModeChanged(mode); + } +} + size_t ViewManager::getPlaybackSampleRate() const { diff -r 1517c76cd678 -r 7b96a3261e1c view/ViewManager.h --- a/view/ViewManager.h Tue Oct 16 15:13:41 2007 +0000 +++ b/view/ViewManager.h Tue Oct 16 18:42:51 2007 +0000 @@ -112,6 +112,9 @@ bool getPlaySoloMode() const { return m_playSoloMode; } void setPlaySoloMode(bool on); + bool getAlignMode() const { return m_alignMode; } + void setAlignMode(bool on); + /** * The sample rate that is used for playback. This is usually the * rate of the main model, but not always. Models whose rates @@ -210,6 +213,10 @@ void playSoloModeChanged(); void playSoloModeChanged(bool); + /** Emitted when the alignment mode has been changed. */ + void alignModeChanged(); + void alignModeChanged(bool); + /** Emitted when the overlay mode has been changed. */ void overlayModeChanged(); @@ -248,6 +255,7 @@ bool m_playLoopMode; bool m_playSelectionMode; bool m_playSoloMode; + bool m_alignMode; void setSelections(const MultiSelection &ms); void signalSelectionChange();