diff view/ViewManager.cpp @ 1327:646e713a4632 zoom

Further ZoomLevel fixes
author Chris Cannam
date Thu, 20 Sep 2018 11:45:26 +0100
parents 61418c112281
children c8a6fd3f9dff
line wrap: on
line diff
--- a/view/ViewManager.cpp	Thu Sep 20 10:45:24 2018 +0100
+++ b/view/ViewManager.cpp	Thu Sep 20 11:45:26 2018 +0100
@@ -33,7 +33,7 @@
     m_playSource(0),
     m_recordTarget(0),
     m_globalCentreFrame(0),
-    m_globalZoom(1024),
+    m_globalZoom(ZoomLevel::FramesPerPixel, 1024),
     m_playbackFrame(0),
     m_playbackModel(0),
     m_mainModelSampleRate(0),
@@ -147,7 +147,7 @@
     emit globalCentreFrameChanged(f);
 }
 
-int
+ZoomLevel
 ViewManager::getGlobalZoom() const
 {
 #ifdef DEBUG_VIEW_MANAGER
@@ -687,7 +687,7 @@
 }
 
 void
-ViewManager::viewZoomLevelChanged(int z, bool locked)
+ViewManager::viewZoomLevelChanged(ZoomLevel z, bool locked)
 {
     View *v = dynamic_cast<View *>(sender());
 
@@ -709,7 +709,11 @@
     emit viewZoomLevelChanged(v, z, locked);
 
     if (!dynamic_cast<Overview *>(v)) {
-        emit activity(tr("Zoom to %n sample(s) per pixel", "", z));
+        if (z.zone == ZoomLevel::FramesPerPixel) {
+            emit activity(tr("Zoom to %n sample(s) per pixel", "", z.level));
+        } else {
+            emit activity(tr("Zoom to %n pixels per sample", "", z.level));
+        }
     }
 }