# HG changeset patch # User Chris Cannam # Date 1368652549 -3600 # Node ID 2c35737cd3f84d3b9a5363d12fa1480ff7b5009a # Parent 28973ecd4a555d9f4ac2d5014ea5bbcb0a2445ab Debug -- overview centre frame relocation is not currently working with qt5 diff -r 28973ecd4a55 -r 2c35737cd3f8 view/Overview.cpp --- a/view/Overview.cpp Tue May 14 16:02:52 2013 +0100 +++ b/view/Overview.cpp Wed May 15 22:15:49 2013 +0100 @@ -22,6 +22,8 @@ #include #include +#define DEBUG_OVERVIEW 1 + using std::cerr; using std::endl; @@ -90,14 +92,20 @@ } void -Overview::globalCentreFrameChanged(unsigned long) +Overview::globalCentreFrameChanged(unsigned long f) { +#ifdef DEBUG_OVERVIEW + std::cerr << "Overview::globalCentreFrameChanged: " << f << std::endl; +#endif update(); } void -Overview::viewCentreFrameChanged(View *v, unsigned long) +Overview::viewCentreFrameChanged(View *v, unsigned long f) { +#ifdef DEBUG_OVERVIEW + std::cerr << "Overview[" << this << "]::viewCentreFrameChanged(" << v << "): " << f << std::endl; +#endif if (m_views.find(v) != m_views.end()) { update(); } @@ -115,6 +123,10 @@ void Overview::viewManagerPlaybackFrameChanged(unsigned long f) { +#ifdef DEBUG_OVERVIEW + std::cerr << "Overview[" << this << "]::viewManagerPlaybackFrameChanged(" << f << "): " << f << std::endl; +#endif + bool changed = false; f = getAlignedPlaybackFrame(); @@ -130,7 +142,9 @@ { // Recalculate zoom in case the size of the widget has changed. -// SVDEBUG << "Overview::paintEvent: width is " << width() << ", centre frame " << m_centreFrame << endl; +#ifdef DEBUG_OVERVIEW + std::cerr << "Overview::paintEvent: width is " << width() << ", centre frame " << m_centreFrame << std::endl; +#endif size_t startFrame = getModelsStartFrame(); size_t frameCount = getModelsEndFrame() - getModelsStartFrame(); @@ -148,10 +162,14 @@ centreFrame = (startFrame + getModelsEndFrame())/2; } if (centreFrame != m_centreFrame) { -// SVDEBUG << "Overview::paintEvent: Centre frame changed from " -// << m_centreFrame << " to " << centreFrame << " and thus start frame from " << getStartFrame(); +#ifdef DEBUG_OVERVIEW + std::cerr << "Overview::paintEvent: Centre frame changed from " + << m_centreFrame << " to " << centreFrame << " and thus start frame from " << getStartFrame(); +#endif m_centreFrame = centreFrame; -// SVDEBUG << " to " << getStartFrame() << endl; +#ifdef DEBUG_OVERVIEW + std::cerr << " to " << getStartFrame() << std::endl; +#endif emit centreFrameChanged(m_centreFrame, false, PlaybackIgnore); } diff -r 28973ecd4a55 -r 2c35737cd3f8 view/ViewManager.cpp --- a/view/ViewManager.cpp Tue May 14 16:02:52 2013 +0100 +++ b/view/ViewManager.cpp Wed May 15 22:15:49 2013 +0100 @@ -26,7 +26,7 @@ #include -//#define DEBUG_VIEW_MANAGER 1 +#define DEBUG_VIEW_MANAGER 1 ViewManager::ViewManager() : m_playSource(0), @@ -129,7 +129,7 @@ ViewManager::getGlobalCentreFrame() const { #ifdef DEBUG_VIEW_MANAGER - std::cout << "ViewManager::getGlobalCentreFrame: returning " << m_globalCentreFrame << std::endl; + std::cerr << "ViewManager::getGlobalCentreFrame: returning " << m_globalCentreFrame << std::endl; #endif return m_globalCentreFrame; } @@ -138,7 +138,7 @@ ViewManager::setGlobalCentreFrame(unsigned long f) { #ifdef DEBUG_VIEW_MANAGER - std::cout << "ViewManager::setGlobalCentreFrame to " << f << std::endl; + std::cerr << "ViewManager::setGlobalCentreFrame to " << f << std::endl; #endif m_globalCentreFrame = f; emit globalCentreFrameChanged(f); @@ -148,7 +148,7 @@ ViewManager::getGlobalZoom() const { #ifdef DEBUG_VIEW_MANAGER - std::cout << "ViewManager::getGlobalZoom: returning " << m_globalZoom << std::endl; + std::cerr << "ViewManager::getGlobalZoom: returning " << m_globalZoom << std::endl; #endif return m_globalZoom; } @@ -473,7 +473,7 @@ m_playbackFrame = m_playSource->getCurrentPlayingFrame(); #ifdef DEBUG_VIEW_MANAGER - std::cout << "ViewManager::checkPlayStatus: Playing, frame " << m_playbackFrame << ", levels " << m_lastLeft << "," << m_lastRight << std::endl; + std::cerr << "ViewManager::checkPlayStatus: Playing, frame " << m_playbackFrame << ", levels " << m_lastLeft << "," << m_lastRight << std::endl; #endif emit playbackFrameChanged(m_playbackFrame); @@ -491,7 +491,7 @@ } #ifdef DEBUG_VIEW_MANAGER -// std::cout << "ViewManager::checkPlayStatus: Not playing" << std::endl; +// std::cerr << "ViewManager::checkPlayStatus: Not playing" << std::endl; #endif } } @@ -509,7 +509,7 @@ View *v = dynamic_cast(sender()); #ifdef DEBUG_VIEW_MANAGER - SVDEBUG << "ViewManager::viewCentreFrameChanged(" << f << ", " << locked << ", " << mode << "), view is " << v << endl; + std::cerr << "ViewManager::viewCentreFrameChanged(" << f << ", " << locked << ", " << mode << "), view is " << v << std::endl; #endif if (locked) { @@ -538,7 +538,7 @@ ViewManager::seek(unsigned long f) { #ifdef DEBUG_VIEW_MANAGER - std::cout << "ViewManager::seek(" << f << ")" << std::endl; + std::cerr << "ViewManager::seek(" << f << ")" << std::endl; #endif if (m_playSource && m_playSource->isPlaying()) { @@ -548,7 +548,7 @@ m_playbackFrame = f; m_playSource->play(f); #ifdef DEBUG_VIEW_MANAGER - std::cout << "ViewManager::considerSeek: reseeking from " << playFrame << " to " << f << std::endl; + std::cerr << "ViewManager::considerSeek: reseeking from " << playFrame << " to " << f << std::endl; #endif emit playbackFrameChanged(f); } @@ -577,7 +577,7 @@ } #ifdef DEBUG_VIEW_MANAGER - std::cout << "ViewManager::viewZoomLevelChanged(" << v << ", " << z << ", " << locked << ")" << std::endl; + std::cerr << "ViewManager::viewZoomLevelChanged(" << v << ", " << z << ", " << locked << ")" << std::endl; #endif emit viewZoomLevelChanged(v, z, locked);