changeset 1186:8665e0ffa0d8 levelpanwidget

Merge from branch 3.0-integration
author Chris Cannam
date Wed, 14 Dec 2016 14:28:41 +0000
parents 6a6a63506e3f (current diff) f32828ea63d9 (diff)
children 306c24eeab10
files
diffstat 4 files changed, 24 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/view/Overview.cpp	Tue Dec 06 09:47:27 2016 +0000
+++ b/view/Overview.cpp	Wed Dec 14 14:28:41 2016 +0000
@@ -211,8 +211,6 @@
     paint.setClipRegion(e->region());
     paint.setRenderHints(QPainter::Antialiasing);
     
-    QRect r(rect());
-
     // We paint a rounded rect for each distinct set of view extents,
     // and we colour in the inside and outside of the rect that
     // corresponds to the current view. (One small caveat -- we don't
@@ -245,7 +243,6 @@
 	int x0 = getXForFrame(f0);
 	int x1 = getXForFrame(f1);
 
-
 	if (x1 <= x0) x1 = x0 + 1;
 
         std::pair<int, int> extent(x0, x1);
--- a/view/Pane.cpp	Tue Dec 06 09:47:27 2016 +0000
+++ b/view/Pane.cpp	Wed Dec 14 14:28:41 2016 +0000
@@ -1053,23 +1053,19 @@
     sv_samplerate_t modelRate = waveformModel->getSampleRate();
     sv_samplerate_t nativeRate = waveformModel->getNativeRate();
     sv_samplerate_t playbackRate = m_manager->getPlaybackSampleRate();
-    sv_samplerate_t outputRate = m_manager->getOutputSampleRate();
         
     QString srNote = "";
 
-    // Show (R) for waveform models that have been resampled or will
-    // be resampled on playback, and (X) for waveform models that will
-    // be played at the wrong rate because their rate differs from the
-    // current playback rate (which is not necessarily that of the
-    // main model).
-
-    if (playbackRate != 0) {
-        if (modelRate == playbackRate) {
-            if (modelRate != outputRate || modelRate != nativeRate) {
-                srNote = " " + tr("(R)");
-            }
-        } else {
+    // Show (R) for waveform models that have been resampled during
+    // load, and (X) for waveform models that will be played at the
+    // wrong rate because their rate differs from the current playback
+    // rate (which is not necessarily that of the main model).
+
+    if (modelRate != nativeRate) {
+        if (playbackRate != 0 && modelRate != playbackRate) {
             srNote = " " + tr("(X)");
+        } else {            
+            srNote = " " + tr("(R)");
         }
     }
 
@@ -2292,7 +2288,7 @@
     }
 
     if (e->phase() == Qt::ScrollBegin ||
-        fabs(d) >= 120 ||
+        std::abs(d) >= 120 ||
         (d > 0 && m_pendingWheelAngle < 0) ||
         (d < 0 && m_pendingWheelAngle > 0)) {
         m_pendingWheelAngle = d;
--- a/view/ViewManager.cpp	Tue Dec 06 09:47:27 2016 +0000
+++ b/view/ViewManager.cpp	Wed Dec 14 14:28:41 2016 +0000
@@ -159,6 +159,13 @@
 {
     if (m_playSource && m_playSource->isPlaying()) {
 	m_playbackFrame = m_playSource->getCurrentPlayingFrame();
+#ifdef DEBUG_VIEW_MANAGER
+        cout << "ViewManager::getPlaybackFrame(playing) -> " << m_playbackFrame << endl;
+#endif
+    } else {
+#ifdef DEBUG_VIEW_MANAGER
+        cout << "ViewManager::getPlaybackFrame(not playing) -> " << m_playbackFrame << endl;
+#endif
     }
     return m_playbackFrame;
 }
@@ -166,6 +173,9 @@
 void
 ViewManager::setPlaybackFrame(sv_frame_t f)
 {
+#ifdef DEBUG_VIEW_MANAGER
+    cerr << "ViewManager::setPlaybackFrame(" << f << ")" << endl;
+#endif
     if (f < 0) f = 0;
     if (m_playbackFrame != f) {
 	m_playbackFrame = f;
@@ -489,10 +499,10 @@
 }
 
 sv_samplerate_t
-ViewManager::getOutputSampleRate() const
+ViewManager::getDeviceSampleRate() const
 {
     if (m_playSource) {
-	return m_playSource->getTargetSampleRate();
+	return m_playSource->getDeviceSampleRate();
     }
     return 0;
 }
--- a/view/ViewManager.h	Tue Dec 06 09:47:27 2016 +0000
+++ b/view/ViewManager.h	Wed Dec 14 14:28:41 2016 +0000
@@ -172,9 +172,9 @@
     /**
      * The sample rate of the audio output device.  If the playback
      * sample rate differs from this, everything will be resampled at
-     * the output stage.
+     * the output stage (but not before).
      */
-    sv_samplerate_t getOutputSampleRate() const;
+    sv_samplerate_t getDeviceSampleRate() const;
 
     /**
      * The sample rate of the current main model.  This may in theory