comparison 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
comparison
equal deleted inserted replaced
1326:97c68bffbda6 1327:646e713a4632
31 31
32 ViewManager::ViewManager() : 32 ViewManager::ViewManager() :
33 m_playSource(0), 33 m_playSource(0),
34 m_recordTarget(0), 34 m_recordTarget(0),
35 m_globalCentreFrame(0), 35 m_globalCentreFrame(0),
36 m_globalZoom(1024), 36 m_globalZoom(ZoomLevel::FramesPerPixel, 1024),
37 m_playbackFrame(0), 37 m_playbackFrame(0),
38 m_playbackModel(0), 38 m_playbackModel(0),
39 m_mainModelSampleRate(0), 39 m_mainModelSampleRate(0),
40 m_lastLeft(0), 40 m_lastLeft(0),
41 m_lastRight(0), 41 m_lastRight(0),
145 #endif 145 #endif
146 m_globalCentreFrame = f; 146 m_globalCentreFrame = f;
147 emit globalCentreFrameChanged(f); 147 emit globalCentreFrameChanged(f);
148 } 148 }
149 149
150 int 150 ZoomLevel
151 ViewManager::getGlobalZoom() const 151 ViewManager::getGlobalZoom() const
152 { 152 {
153 #ifdef DEBUG_VIEW_MANAGER 153 #ifdef DEBUG_VIEW_MANAGER
154 cerr << "ViewManager::getGlobalZoom: returning " << m_globalZoom << endl; 154 cerr << "ViewManager::getGlobalZoom: returning " << m_globalZoom << endl;
155 #endif 155 #endif
685 } 685 }
686 } 686 }
687 } 687 }
688 688
689 void 689 void
690 ViewManager::viewZoomLevelChanged(int z, bool locked) 690 ViewManager::viewZoomLevelChanged(ZoomLevel z, bool locked)
691 { 691 {
692 View *v = dynamic_cast<View *>(sender()); 692 View *v = dynamic_cast<View *>(sender());
693 693
694 if (!v) { 694 if (!v) {
695 SVDEBUG << "ViewManager::viewZoomLevelChanged: WARNING: sender is not a view" << endl; 695 SVDEBUG << "ViewManager::viewZoomLevelChanged: WARNING: sender is not a view" << endl;
707 #endif 707 #endif
708 708
709 emit viewZoomLevelChanged(v, z, locked); 709 emit viewZoomLevelChanged(v, z, locked);
710 710
711 if (!dynamic_cast<Overview *>(v)) { 711 if (!dynamic_cast<Overview *>(v)) {
712 emit activity(tr("Zoom to %n sample(s) per pixel", "", z)); 712 if (z.zone == ZoomLevel::FramesPerPixel) {
713 emit activity(tr("Zoom to %n sample(s) per pixel", "", z.level));
714 } else {
715 emit activity(tr("Zoom to %n pixels per sample", "", z.level));
716 }
713 } 717 }
714 } 718 }
715 719
716 void 720 void
717 ViewManager::setOverlayMode(OverlayMode mode) 721 ViewManager::setOverlayMode(OverlayMode mode)