diff view/View.cpp @ 222:cd81066ac7ad

* More useful status bar text -- show the current play time and the extents of the visible area * Add update-i18n.sh to update the i18n/ts and qm files -- I can't get qmake to do the right thing now that the project file has been split up into several project files * Fix missing Q_OBJECTs, etc, reported by lupdate * Update Russian translation from AlexandrE
author Chris Cannam
date Wed, 07 Mar 2007 17:07:02 +0000
parents bd2d0346da0e
children 9465b5375235
line wrap: on
line diff
--- a/view/View.cpp	Mon Mar 05 15:32:55 2007 +0000
+++ b/view/View.cpp	Wed Mar 07 17:07:02 2007 +0000
@@ -426,7 +426,7 @@
 {
     if (m_zoomLevel != int(z)) {
 	m_zoomLevel = z;
-	emit zoomLevelChanged(this, z, m_followZoom);
+	emit zoomLevelChanged(z, m_followZoom);
 	update();
     }
 }
@@ -537,13 +537,13 @@
 	m_manager->disconnect(this, SLOT(globalCentreFrameChanged(unsigned long)));
 	m_manager->disconnect(this, SLOT(viewCentreFrameChanged(View *, unsigned long)));
 	m_manager->disconnect(this, SLOT(viewManagerPlaybackFrameChanged(unsigned long)));
-	m_manager->disconnect(this, SLOT(viewManagerZoomLevelChanged(void *, unsigned long, bool)));
+	m_manager->disconnect(this, SLOT(viewZoomLevelChanged(View *, unsigned long, bool)));
         m_manager->disconnect(this, SLOT(toolModeChanged()));
         m_manager->disconnect(this, SLOT(selectionChanged()));
         m_manager->disconnect(this, SLOT(overlayModeChanged()));
         m_manager->disconnect(this, SLOT(zoomWheelsEnabledChanged()));
-        disconnect(m_manager, SIGNAL(viewCentreFrameChanged(unsigned long, bool, PlaybackFollowMode)));
-	disconnect(m_manager, SIGNAL(zoomLevelChanged(void *, unsigned long, bool)));
+        disconnect(m_manager, SLOT(viewCentreFrameChanged(unsigned long, bool, PlaybackFollowMode)));
+	disconnect(m_manager, SLOT(zoomLevelChanged(unsigned long, bool)));
     }
 
     m_manager = manager;
@@ -557,8 +557,8 @@
     connect(m_manager, SIGNAL(playbackFrameChanged(unsigned long)),
 	    this, SLOT(viewManagerPlaybackFrameChanged(unsigned long)));
 
-    connect(m_manager, SIGNAL(zoomLevelChanged(void *, unsigned long, bool)),
-	    this, SLOT(viewManagerZoomLevelChanged(void *, unsigned long, bool)));
+    connect(m_manager, SIGNAL(viewZoomLevelChanged(View *, unsigned long, bool)),
+	    this, SLOT(viewZoomLevelChanged(View *, unsigned long, bool)));
 
     connect(m_manager, SIGNAL(toolModeChanged()),
 	    this, SLOT(toolModeChanged()));
@@ -576,8 +576,8 @@
             m_manager, SLOT(viewCentreFrameChanged(unsigned long, bool,
                                                    PlaybackFollowMode)));
 
-    connect(this, SIGNAL(zoomLevelChanged(void *, unsigned long, bool)),
-	    m_manager, SIGNAL(zoomLevelChanged(void *, unsigned long, bool)));
+    connect(this, SIGNAL(zoomLevelChanged(unsigned long, bool)),
+	    m_manager, SLOT(viewZoomLevelChanged(unsigned long, bool)));
 
     toolModeChanged();
 }
@@ -870,13 +870,10 @@
 }
 
 void
-View::viewManagerZoomLevelChanged(void *p, unsigned long z, bool locked)
+View::viewZoomLevelChanged(View *p, unsigned long z, bool locked)
 {
     if (m_followZoom && p != this && locked) {
-	if (m_manager && (sender() == m_manager)) {
-	    setZoomLevel(z);
-	    if (p == this) repaint();
-	}
+        setZoomLevel(z);
     }
 }
 
@@ -892,6 +889,24 @@
 }
 
 size_t
+View::getFirstVisibleFrame() const
+{
+    long f0 = getStartFrame();
+    size_t f = getModelsStartFrame();
+    if (f0 < 0 || f0 < long(f)) return f;
+    return f0;
+}
+
+size_t 
+View::getLastVisibleFrame() const
+{
+    size_t f0 = getEndFrame();
+    size_t f = getModelsEndFrame();
+    if (f0 > f) return f;
+    return f0;
+}
+
+size_t
 View::getModelsStartFrame() const
 {
     bool first = true;