changeset 50:75cfbc6e709b

* more MainWindow/Document stuff
author Chris Cannam
date Wed, 08 Mar 2006 17:47:58 +0000
parents 2818ec5d1985
children d2eac322d71b
files widgets/Pane.cpp
diffstat 1 files changed, 15 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/widgets/Pane.cpp	Wed Mar 08 12:38:28 2006 +0000
+++ b/widgets/Pane.cpp	Wed Mar 08 17:47:58 2006 +0000
@@ -300,21 +300,28 @@
 
 	if (waveformModel) {
 
+	    size_t mainModelRate = m_manager->getMainModelSampleRate();
+	    size_t playbackRate = m_manager->getPlaybackSampleRate();
+	    
+	    QString srNote = "";
+
 	    // Show (R) for waveform models that will be resampled on
-	    // playback.
+	    // playback, and (X) for waveform models that will be
+	    // played at the wrong rate because their rate differs
+	    // from that of the main model.
 
-	    //!!! Inadequate for auxiliary waveform layers, which are
-	    //played at the wrong rate if their rate differs from the
-	    //main model.  Need to discover and label with (X) or
-	    //something.
-	    
+	    if (sampleRate == mainModelRate) {
+		if (sampleRate != playbackRate) srNote = " " + tr("(R)");
+	    } else {
+		srNote = " " + tr("(X)");
+	    }
+
 	    QString desc = tr("%1 / %2Hz%3")
 		.arg(RealTime::frame2RealTime(waveformModel->getEndFrame(),
 					      sampleRate)
 		     .toText(false).c_str())
 		.arg(sampleRate)
-		.arg((m_manager &&
-		      sampleRate != m_manager->getPlaybackSampleRate()) ? " (R)" : "");
+		.arg(srNote);
 
 	    paint.drawText(width() - paint.fontMetrics().width(desc) - 5,
 			   height() - paint.fontMetrics().height() +