Mercurial > hg > svgui
changeset 830:8bb9320f78a4
Debug output stuff
author | Chris Cannam |
---|---|
date | Fri, 25 Jul 2014 17:02:29 +0100 |
parents | 5acfb11e8aef |
children | 831188672987 |
files | view/Overview.cpp view/View.cpp view/ViewManager.cpp |
diffstat | 3 files changed, 40 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- 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)
--- 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 <unistd.h> +//#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; }
--- 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