diff view/ViewManager.cpp @ 1353:86429ff00f05

Merge from branch zoom
author Chris Cannam
date Wed, 10 Oct 2018 08:44:27 +0100
parents 646e713a4632
children c8a6fd3f9dff
line wrap: on
line diff
--- a/view/ViewManager.cpp	Wed Oct 03 12:59:55 2018 +0100
+++ b/view/ViewManager.cpp	Wed Oct 10 08:44:27 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));
+        }
     }
 }