diff audioio/AudioGenerator.cpp @ 418:8d2112977aa0 tonioni

Don't clear ring buffers & regenerate when adding a model that is muted anyway
author Chris Cannam
date Tue, 11 Nov 2014 16:34:22 +0000
parents f747be6743ab
children aa6fb3516e28
line wrap: on
line diff
--- a/audioio/AudioGenerator.cpp	Mon Nov 10 09:20:33 2014 +0000
+++ b/audioio/AudioGenerator.cpp	Tue Nov 11 16:34:22 2014 +0000
@@ -124,12 +124,20 @@
 	}
     }
 
+    const Playable *playable = model;
+    if (!playable || !playable->canPlay()) return 0;
+
+    PlayParameters *parameters =
+	PlayParameterRepository::getInstance()->getPlayParameters(playable);
+
+    bool willPlay = !parameters->isPlayMuted();
+    
     if (usesClipMixer(model)) {
         ClipMixer *mixer = makeClipMixerFor(model);
         if (mixer) {
             QMutexLocker locker(&m_mutex);
             m_clipMixerMap[model] = mixer;
-            return true;
+            return willPlay;
         }
     }
 
@@ -138,7 +146,7 @@
         if (synth) {
             QMutexLocker locker(&m_mutex);
             m_continuousSynthMap[model] = synth;
-            return true;
+            return willPlay;
         }
     }