Mercurial > hg > svgui
comparison view/ViewManager.cpp @ 133:9e6b3e239b9d
* Add zoom thumbwheels to Pane. Implement horizontal thumbwheel, and
vertical depending on layer type (supported for waveform and spectrogram,
though wrong for log-scale spectrogram at the moment).
* Add bare bones of a spectrum layer.
* Add window icon
* Add shortcut for "insert time instant" on laptops without keypad enter (";")
* Delete FFT processing thread when it exits (at least, next time we're asked
for something interesting)
* Get audio file extensions from the file readers, and thus from libsndfile for
the wave file reader -- leads to rather a wide combo box in file dialog though
* Better refresh order for spectrogram (redraw centre section first)
author | Chris Cannam |
---|---|
date | Fri, 04 Aug 2006 17:01:37 +0000 |
parents | 33929e0c3c6b |
children | dbd34ff746c7 |
comparison
equal
deleted
inserted
replaced
132:5d3a483856ff | 133:9e6b3e239b9d |
---|---|
16 #include "ViewManager.h" | 16 #include "ViewManager.h" |
17 #include "base/AudioPlaySource.h" | 17 #include "base/AudioPlaySource.h" |
18 #include "data/model/Model.h" | 18 #include "data/model/Model.h" |
19 #include "base/CommandHistory.h" | 19 #include "base/CommandHistory.h" |
20 | 20 |
21 #include <QSettings> | |
22 | |
21 #include <iostream> | 23 #include <iostream> |
22 | 24 |
23 // #define DEBUG_VIEW_MANAGER 1 | 25 // #define DEBUG_VIEW_MANAGER 1 |
24 | 26 |
25 ViewManager::ViewManager() : | 27 ViewManager::ViewManager() : |
32 m_lastRight(0), | 34 m_lastRight(0), |
33 m_inProgressExclusive(true), | 35 m_inProgressExclusive(true), |
34 m_toolMode(NavigateMode), | 36 m_toolMode(NavigateMode), |
35 m_playLoopMode(false), | 37 m_playLoopMode(false), |
36 m_playSelectionMode(false), | 38 m_playSelectionMode(false), |
37 m_overlayMode(BasicOverlays) | 39 m_overlayMode(BasicOverlays), |
38 { | 40 m_zoomWheelsEnabled(true) |
41 { | |
42 QSettings settings; | |
43 settings.beginGroup("MainWindow"); | |
44 m_overlayMode = OverlayMode | |
45 (settings.value("overlay-mode", int(m_overlayMode)).toInt()); | |
46 m_zoomWheelsEnabled = | |
47 settings.value("zoom-wheels-enabled", m_zoomWheelsEnabled).toBool(); | |
48 settings.endGroup(); | |
49 | |
39 connect(this, | 50 connect(this, |
40 SIGNAL(centreFrameChanged(void *, unsigned long, bool)), | 51 SIGNAL(centreFrameChanged(void *, unsigned long, bool)), |
41 SLOT(considerSeek(void *, unsigned long, bool))); | 52 SLOT(considerSeek(void *, unsigned long, bool))); |
42 | 53 |
43 connect(this, | 54 connect(this, |
335 } | 346 } |
336 | 347 |
337 void | 348 void |
338 ViewManager::considerZoomChange(void *p, unsigned long z, bool locked) | 349 ViewManager::considerZoomChange(void *p, unsigned long z, bool locked) |
339 { | 350 { |
351 emit zoomLevelChanged(); | |
352 | |
340 if (locked) { | 353 if (locked) { |
341 m_globalZoom = z; | 354 m_globalZoom = z; |
342 } | 355 } |
343 | 356 |
344 #ifdef DEBUG_VIEW_MANAGER | 357 #ifdef DEBUG_VIEW_MANAGER |
351 { | 364 { |
352 if (m_overlayMode != mode) { | 365 if (m_overlayMode != mode) { |
353 m_overlayMode = mode; | 366 m_overlayMode = mode; |
354 emit overlayModeChanged(); | 367 emit overlayModeChanged(); |
355 } | 368 } |
356 } | 369 |
357 | 370 QSettings settings; |
358 #ifdef INCLUDE_MOCFILES | 371 settings.beginGroup("MainWindow"); |
359 #include "ViewManager.moc.cpp" | 372 settings.setValue("overlay-mode", int(m_overlayMode)); |
360 #endif | 373 settings.endGroup(); |
361 | 374 } |
375 | |
376 void | |
377 ViewManager::setZoomWheelsEnabled(bool enabled) | |
378 { | |
379 if (m_zoomWheelsEnabled != enabled) { | |
380 m_zoomWheelsEnabled = enabled; | |
381 emit zoomWheelsEnabledChanged(); | |
382 } | |
383 | |
384 QSettings settings; | |
385 settings.beginGroup("MainWindow"); | |
386 settings.setValue("zoom-wheels-enabled", m_zoomWheelsEnabled); | |
387 settings.endGroup(); | |
388 } | |
389 |