changeset 642:2c35737cd3f8

Debug -- overview centre frame relocation is not currently working with qt5
author Chris Cannam
date Wed, 15 May 2013 22:15:49 +0100
parents 28973ecd4a55
children 77fa3fdbfc7e
files view/Overview.cpp view/ViewManager.cpp
diffstat 2 files changed, 34 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- 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 <QPainter>
 #include <iostream>
 
+#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);
     }
 
--- 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 <iostream>
 
-//#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<View *>(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);