changeset 82:82482231b6b1

* Add file open/save operations to main toolbar * Allow opening any sort of file from toolbar file open function * First cut at on-disc cacheing for decoded mp3/ogg files * Permit un-snapped selection by holding Shift
author Chris Cannam
date Thu, 27 Apr 2006 17:29:19 +0000
parents b9f71b8ae21e
children 01f27a282c90
files layer/SpectrogramLayer.cpp widgets/AudioDial.cpp widgets/Fader.cpp widgets/Pane.cpp
diffstat 4 files changed, 15 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/layer/SpectrogramLayer.cpp	Thu Apr 27 11:49:34 2006 +0000
+++ b/layer/SpectrogramLayer.cpp	Thu Apr 27 17:29:19 2006 +0000
@@ -142,7 +142,7 @@
     list.push_back(tr("Window Type"));
     list.push_back(tr("Window Size"));
     list.push_back(tr("Window Overlap"));
-    list.push_back(tr("Normalize"));
+    list.push_back(tr("Normalize Columns"));
     list.push_back(tr("Bin Display"));
     list.push_back(tr("Threshold"));
     list.push_back(tr("Gain"));
@@ -158,7 +158,7 @@
 {
     if (name == tr("Gain")) return RangeProperty;
     if (name == tr("Colour Rotation")) return RangeProperty;
-    if (name == tr("Normalize")) return ToggleProperty;
+    if (name == tr("Normalize Columns")) return ToggleProperty;
     if (name == tr("Threshold")) return RangeProperty;
     return ValueProperty;
 }
@@ -173,7 +173,7 @@
 	name == tr("Gain") ||
 	name == tr("Threshold") ||
 	name == tr("Colour Rotation")) return tr("Colour");
-    if (name == tr("Normalize") ||
+    if (name == tr("Normalize Columns") ||
 	name == tr("Bin Display") ||
 	name == tr("Colour Scale")) return tr("Scale");
     if (name == tr("Max Frequency") ||
@@ -304,7 +304,7 @@
 	*max = 2;
 	deft = (int)m_binDisplay;
 
-    } else if (name == tr("Normalize")) {
+    } else if (name == tr("Normalize Columns")) {
 	
 	deft = (m_normalizeColumns ? 1 : 0);
 
@@ -490,7 +490,7 @@
 	case 1: setBinDisplay(PeakBins); break;
 	case 2: setBinDisplay(PeakFrequencies); break;
 	}
-    } else if (name == "Normalize") {
+    } else if (name == "Normalize Columns") {
 	setNormalizeColumns(value ? true : false);
     }
 }
--- a/widgets/AudioDial.cpp	Thu Apr 27 11:49:34 2006 +0000
+++ b/widgets/AudioDial.cpp	Thu Apr 27 17:29:19 2006 +0000
@@ -96,7 +96,7 @@
 	
     QColor knobColor(m_knobColor);
     if (knobColor == Qt::black)
-	knobColor = palette().mid().color();
+	knobColor = palette().background().color();
 
     QColor meterColor(m_meterColor);
     if (!isEnabled())
--- a/widgets/Fader.cpp	Thu Apr 27 11:49:34 2006 +0000
+++ b/widgets/Fader.cpp	Thu Apr 27 17:29:19 2006 +0000
@@ -131,6 +131,13 @@
 void
 Fader::mousePressEvent(QMouseEvent *ev)
 {
+    if (ev->button() == Qt::MidButton) {
+        setValue(1.0);
+        emit valueChanged(1.0);
+        update();
+        return;
+    }
+
     int x = ev->x() - 6;
     const int max_x = 116 - 12;
 
--- a/widgets/Pane.cpp	Thu Apr 27 11:49:34 2006 +0000
+++ b/widgets/Pane.cpp	Thu Apr 27 17:29:19 2006 +0000
@@ -525,7 +525,7 @@
 	    int snapFrame = mouseFrame;
 	
 	    Layer *layer = getSelectedLayer();
-	    if (layer) {
+	    if (layer && !m_shiftPressed) {
 		layer->snapToFeatureFrame(this, snapFrame,
 					  resolution, Layer::SnapLeft);
 	    }
@@ -740,7 +740,7 @@
 	int snapFrameRight = mouseFrame;
 	
 	Layer *layer = getSelectedLayer();
-	if (layer) {
+	if (layer && !m_shiftPressed) {
 	    layer->snapToFeatureFrame(this, snapFrameLeft,
 				      resolution, Layer::SnapLeft);
 	    layer->snapToFeatureFrame(this, snapFrameRight,