diff view/Pane.cpp @ 224:9465b5375235

* Fix #1672407 confused by plugin-named files in cwd (or home?) * Fix #1491848 crash when loading new file while transform plugin runs * Fix #1502287 Background remains black after spectrogram layer deleted * Fix #1604477 Replacing the main audio file silences secondary audio file * Fix failure to initialise property box layout to last preference on startup * Fix resample/wrong-rate display in Pane, ensure that right rate is chosen if all current models have an acceptable rate even if previous main model had a different one * Fix "global zoom" broken in previous commit * Some fixes to spectrogram cache area updating (makes spectrogram appear more quickly, previously it had a tendency to refresh with empty space) * Fixes to colour 3d plot normalization
author Chris Cannam
date Thu, 08 Mar 2007 16:53:08 +0000
parents 403bfb88d8d6
children 6dab3ac2fe73
line wrap: on
line diff
--- a/view/Pane.cpp	Wed Mar 07 18:00:49 2007 +0000
+++ b/view/Pane.cpp	Thu Mar 08 16:53:08 2007 +0000
@@ -233,8 +233,6 @@
         width() > 120 && height() > 100) {
         if (!m_headsUpDisplay->isVisible()) {
             m_headsUpDisplay->show();
-            connect(m_manager, SIGNAL(viewZoomLevelChanged(View *, unsigned long, bool)),
-                    this, SLOT(viewZoomLevelChanged(View *, unsigned long, bool)));
         }
         if (haveVThumb) {
             m_headsUpDisplay->setFixedHeight(m_vthumb->height() + m_hthumb->height());
@@ -245,10 +243,6 @@
         }
     } else {
         m_headsUpDisplay->hide();
-        if (m_manager) {
-            disconnect(m_manager, SIGNAL(viewZoomLevelChanged(View *, unsigned long, bool)),
-                       this, SLOT(viewZoomLevelChanged(View *, unsigned long, bool)));
-        }
     }
 }
 
@@ -571,22 +565,24 @@
 	r.y() + r.height() >= height() - fontHeight - 6) {
 
         size_t modelRate = waveformModel->getSampleRate();
-	size_t mainModelRate = m_manager->getMainModelSampleRate();
 	size_t playbackRate = m_manager->getPlaybackSampleRate();
-	    
+        size_t outputRate = m_manager->getOutputSampleRate();
+        
 	QString srNote = "";
 
 	// Show (R) for waveform models that will be resampled on
 	// playback, and (X) for waveform models that will be played
-	// at the wrong rate because their rate differs from that of
-	// the main model.
+	// at the wrong rate because their rate differs from the
+	// current playback rate (which is not necessarily that of the
+	// main model).
 
-	if (modelRate == mainModelRate) {
-	    if (modelRate != playbackRate) srNote = " " + tr("(R)");
-	} else {
-//	    std::cerr << "Sample rate = " << modelRate << ", main model rate = " << mainModelRate << std::endl;
-	    srNote = " " + tr("(X)");
-	}
+        if (playbackRate != 0) {
+            if (modelRate == playbackRate) {
+                if (modelRate != outputRate) srNote = " " + tr("(R)");
+            } else {
+                srNote = " " + tr("(X)");
+            }
+        }
 
 	QString desc = tr("%1 / %2Hz%3")
 	    .arg(RealTime::frame2RealTime(waveformModel->getEndFrame(),
@@ -1628,11 +1624,15 @@
 }
 
 void
-Pane::viewZoomLevelChanged(View *v, unsigned long, bool locked)
+Pane::viewZoomLevelChanged(View *v, unsigned long z, bool locked)
 {
 //    std::cerr << "Pane[" << this << "]::zoomLevelChanged (global now "
 //              << (m_manager ? m_manager->getGlobalZoom() : 0) << ")" << std::endl;
 
+    View::viewZoomLevelChanged(v, z, locked);
+
+    if (!m_vthumb->isVisible()) return;
+
     if (v != this) {
         if (!locked || !m_followZoom) return;
     }