diff layer/WaveformLayer.cpp @ 69:6dad2724f3aa

* Ensure plugin parameters for a transform are saved in the .sv file and restored in case the plugin has to be run again * Make plugin dialog offer options for mixdown/single-channel use if the file has more than one channels but the plugin only accepts one * Fix incorrect samplerate playback for second file loaded if its samplerate differed from first * Add Zoom to Fit and Select Visible Range menu options, split out Import Audio into main model and secondary model options * Add stubs for cut, copy and paste operations (not implemented yet)
author Chris Cannam
date Thu, 30 Mar 2006 13:18:11 +0000
parents 193b569a975f
children 72fa239a4880
line wrap: on
line diff
--- a/layer/WaveformLayer.cpp	Wed Mar 29 16:24:25 2006 +0000
+++ b/layer/WaveformLayer.cpp	Thu Mar 30 13:18:11 2006 +0000
@@ -56,6 +56,20 @@
 void
 WaveformLayer::setModel(const RangeSummarisableTimeValueModel *model)
 {
+    bool channelsChanged = false;
+    if (m_channel == -1) {
+        if (!m_model) {
+            if (model) {
+                channelsChanged = true;
+            }
+        } else {
+            if (model &&
+                m_model->getChannelCount() != model->getChannelCount()) {
+                channelsChanged = true;
+            }
+        }
+    }
+
     m_model = model;
     m_cacheValid = false;
     if (!m_model || !m_model->isOK()) return;
@@ -68,6 +82,8 @@
 	    this, SIGNAL(modelCompletionChanged()));
 
     emit modelReplaced();
+
+    if (channelsChanged) emit layerParametersChanged();
 }
 
 Layer::PropertyList