diff view/ViewManager.cpp @ 607:5b72899d692b

Give a dedicated key to toggling the centre line, and move it out of the overlay level setting -- reducing number of overlay levels to 3. Introduce two distinct vertical scale types (so that we can hide the spectrogram colour scale part easily)
author Chris Cannam
date Mon, 30 Jan 2012 16:01:59 +0000
parents 4806715f7a19
children 2c35737cd3f8 c8f45afb83d5
line wrap: on
line diff
--- a/view/ViewManager.cpp	Mon Jan 30 13:24:55 2012 +0000
+++ b/view/ViewManager.cpp	Mon Jan 30 16:01:59 2012 +0000
@@ -43,8 +43,9 @@
     m_playSelectionMode(false),
     m_playSoloMode(false),
     m_alignMode(false),
-    m_overlayMode(StandardOverlays),
+    m_overlayMode(MinimalOverlays),
     m_zoomWheelsEnabled(true),
+    m_showCentreLine(true),
     m_illuminateLocalFeatures(true),
     m_showWorkTitle(false),
     m_lightPalette(QApplication::palette()),
@@ -54,8 +55,17 @@
     settings.beginGroup("MainWindow");
     m_overlayMode = OverlayMode
         (settings.value("overlay-mode", int(m_overlayMode)).toInt());
+
+    if (m_overlayMode != NoOverlays &&
+        m_overlayMode != MinimalOverlays &&
+        m_overlayMode != AllOverlays) {
+        m_overlayMode = MinimalOverlays;
+    }
+
     m_zoomWheelsEnabled =
         settings.value("zoom-wheels-enabled", m_zoomWheelsEnabled).toBool();
+    m_showCentreLine =
+        settings.value("show-centre-line", m_showCentreLine).toBool();
     settings.endGroup();
 
     if (getGlobalDarkBackground()) {
@@ -609,6 +619,22 @@
 }
 
 void
+ViewManager::setShowCentreLine(bool show)
+{
+    if (m_showCentreLine != show) {
+        m_showCentreLine = show;
+        emit showCentreLineChanged();
+        if (show) emit activity("Show centre line");
+        else emit activity("Hide centre line");
+    }
+
+    QSettings settings;
+    settings.beginGroup("MainWindow");
+    settings.setValue("show-centre-line", int(m_showCentreLine));
+    settings.endGroup();
+}
+
+void
 ViewManager::setGlobalDarkBackground(bool dark)
 {
     // also save the current palette, in case the user has changed it