# HG changeset patch # User Chris Cannam # Date 1406304149 -3600 # Node ID 8bb9320f78a420033e26bc62cd0caa2588af5056 # Parent 5acfb11e8aef710a2b62286588a09003cf3e340b Debug output stuff diff -r 5acfb11e8aef -r 8bb9320f78a4 view/Overview.cpp --- a/view/Overview.cpp Fri Jul 25 17:02:16 2014 +0100 +++ b/view/Overview.cpp Fri Jul 25 17:02:29 2014 +0100 @@ -25,8 +25,6 @@ //#define DEBUG_OVERVIEW 1 - - Overview::Overview(QWidget *w) : View(w, false), m_clickedInRange(false) diff -r 5acfb11e8aef -r 8bb9320f78a4 view/View.cpp --- a/view/View.cpp Fri Jul 25 17:02:16 2014 +0100 +++ b/view/View.cpp Fri Jul 25 17:02:29 2014 +0100 @@ -44,11 +44,10 @@ #include +//#define DEBUG_VIEW 1 //#define DEBUG_VIEW_WIDGET_PAINT 1 - - View::View(QWidget *w, bool showProgress) : QFrame(w), m_centreFrame(0), @@ -342,7 +341,7 @@ if (e) { int rf = alignToReference(f); -#ifdef DEBUG_VIEW_WIDGET_PAINT +#ifdef DEBUG_VIEW cerr << "View[" << this << "]::setCentreFrame(" << f << "): emitting centreFrameChanged(" << rf << ")" << endl; @@ -970,7 +969,7 @@ { if (m_followPan) { int f = alignFromReference(rf); -#ifdef DEBUG_VIEW_WIDGET_PAINT +#ifdef DEBUG_VIEW cerr << "View[" << this << "]::globalCentreFrameChanged(" << rf << "): setting centre frame to " << f << endl; #endif @@ -991,14 +990,26 @@ if (sender() != m_manager) return; } +#ifdef DEBUG_VIEW + cerr << "View::viewManagerPlaybackFrameChanged(" << f << ")" << endl; +#endif + f = getAlignedPlaybackFrame(); +#ifdef DEBUG_VIEW + cerr << " -> aligned frame = " << af << endl; +#endif + movePlayPointer(f); } void View::movePlayPointer(int newFrame) { +#ifdef DEBUG_VIEW + cerr << "View(" << this << ")::movePlayPointer(" << newFrame << ")" << endl; +#endif + if (m_playPointerFrame == newFrame) return; bool visibleChange = (getXForFrame(m_playPointerFrame) != getXForFrame(newFrame)); @@ -1294,19 +1305,9 @@ Model *aligningModel = getAligningModel(); if (!aligningModel) return pf; -/* - Model *pm = m_manager->getPlaybackModel(); - -// cerr << "View[" << this << "]::getAlignedPlaybackFrame: pf = " << pf; - - if (pm) { - pf = pm->alignToReference(pf); -// cerr << " -> " << pf; - } -*/ + int af = aligningModel->alignFromReference(pf); -// cerr << ", aligned = " << af << endl; return af; } diff -r 5acfb11e8aef -r 8bb9320f78a4 view/ViewManager.cpp --- a/view/ViewManager.cpp Fri Jul 25 17:02:16 2014 +0100 +++ b/view/ViewManager.cpp Fri Jul 25 17:02:29 2014 +0100 @@ -190,15 +190,35 @@ int ViewManager::alignPlaybackFrameToReference(int frame) const { - if (!m_playbackModel) return frame; - else return m_playbackModel->alignToReference(frame); +#ifdef DEBUG_VIEW_MANAGER + cerr << "ViewManager::alignPlaybackFrameToReference(" << frame << "): playback model is " << m_playbackModel << endl; +#endif + if (!m_playbackModel) { + return frame; + } else { + int f = m_playbackModel->alignToReference(frame); +#ifdef DEBUG_VIEW_MANAGER + cerr << "aligned frame = " << f << endl; +#endif + return f; + } } int ViewManager::alignReferenceToPlaybackFrame(int frame) const { - if (!m_playbackModel) return frame; - else return m_playbackModel->alignFromReference(frame); +#ifdef DEBUG_VIEW_MANAGER + cerr << "ViewManager::alignReferenceToPlaybackFrame(" << frame << "): playback model is " << m_playbackModel << endl; +#endif + if (!m_playbackModel) { + return frame; + } else { + int f = m_playbackModel->alignFromReference(frame); +#ifdef DEBUG_VIEW_MANAGER + cerr << "aligned frame = " << f << endl; +#endif + return f; + } } bool