comparison view/ViewManager.h @ 1327:646e713a4632 zoom

Further ZoomLevel fixes
author Chris Cannam
date Thu, 20 Sep 2018 11:45:26 +0100
parents fc9d9f1103fa
children a18e78b9c78b
comparison
equal deleted inserted replaced
1326:97c68bffbda6 1327:646e713a4632
25 #include "base/ViewManagerBase.h" 25 #include "base/ViewManagerBase.h"
26 #include "base/Selection.h" 26 #include "base/Selection.h"
27 #include "base/Command.h" 27 #include "base/Command.h"
28 #include "base/Clipboard.h" 28 #include "base/Clipboard.h"
29 #include "base/BaseTypes.h" 29 #include "base/BaseTypes.h"
30 #include "base/ZoomLevel.h"
30 31
31 class AudioPlaySource; 32 class AudioPlaySource;
32 class AudioRecordTarget; 33 class AudioRecordTarget;
33 class Model; 34 class Model;
34 35
85 86
86 bool isPlaying() const; 87 bool isPlaying() const;
87 bool isRecording() const; 88 bool isRecording() const;
88 89
89 sv_frame_t getGlobalCentreFrame() const; // the set method is a slot 90 sv_frame_t getGlobalCentreFrame() const; // the set method is a slot
90 int getGlobalZoom() const; 91 ZoomLevel getGlobalZoom() const;
91 92
92 sv_frame_t getPlaybackFrame() const; // the set method is a slot 93 sv_frame_t getPlaybackFrame() const; // the set method is a slot
93 94
94 // Only meaningful in solo mode, and used for optional alignment feature 95 // Only meaningful in solo mode, and used for optional alignment feature
95 Model *getPlaybackModel() const; 96 Model *getPlaybackModel() const;
253 254
254 /** Emitted when user scrolls a view, but doesn't affect global centre. */ 255 /** Emitted when user scrolls a view, but doesn't affect global centre. */
255 void viewCentreFrameChanged(View *v, sv_frame_t frame); 256 void viewCentreFrameChanged(View *v, sv_frame_t frame);
256 257
257 /** Emitted when a view zooms. */ 258 /** Emitted when a view zooms. */
258 void viewZoomLevelChanged(View *v, int zoom, bool locked); 259 void viewZoomLevelChanged(View *v, ZoomLevel zoom, bool locked);
259 260
260 /** Emitted when the playback frame changes. */ 261 /** Emitted when the playback frame changes. */
261 void playbackFrameChanged(sv_frame_t frame); 262 void playbackFrameChanged(sv_frame_t frame);
262 263
263 /** Emitted when the output or record levels change. Values in range 0.0 -> 1.0. */ 264 /** Emitted when the output or record levels change. Values in range 0.0 -> 1.0. */
305 /** Emitted when any loggable activity has occurred. */ 306 /** Emitted when any loggable activity has occurred. */
306 void activity(QString); 307 void activity(QString);
307 308
308 public slots: 309 public slots:
309 void viewCentreFrameChanged(sv_frame_t, bool, PlaybackFollowMode); 310 void viewCentreFrameChanged(sv_frame_t, bool, PlaybackFollowMode);
310 void viewZoomLevelChanged(int, bool); 311 void viewZoomLevelChanged(ZoomLevel, bool);
311 void setGlobalCentreFrame(sv_frame_t); 312 void setGlobalCentreFrame(sv_frame_t);
312 void setPlaybackFrame(sv_frame_t); 313 void setPlaybackFrame(sv_frame_t);
313 void playStatusChanged(bool playing); 314 void playStatusChanged(bool playing);
314 void recordStatusChanged(bool recording); 315 void recordStatusChanged(bool recording);
315 316
321 protected: 322 protected:
322 AudioPlaySource *m_playSource; 323 AudioPlaySource *m_playSource;
323 AudioRecordTarget *m_recordTarget; 324 AudioRecordTarget *m_recordTarget;
324 325
325 sv_frame_t m_globalCentreFrame; 326 sv_frame_t m_globalCentreFrame;
326 int m_globalZoom; 327 ZoomLevel m_globalZoom;
327 mutable sv_frame_t m_playbackFrame; 328 mutable sv_frame_t m_playbackFrame;
328 Model *m_playbackModel; //!!! 329 Model *m_playbackModel; //!!!
329 sv_samplerate_t m_mainModelSampleRate; 330 sv_samplerate_t m_mainModelSampleRate;
330 331
331 float m_lastLeft; 332 float m_lastLeft;