changeset 148:0c22273a1d8c

* Enable threaded decoding for Ogg and MP3 files. Needs some work on reducing updates to the overview widget
author Chris Cannam
date Wed, 06 Jun 2007 16:24:55 +0000
parents 140ea2569bcc
children 37cb005f7c40
files audioio/AudioCallbackPlaySource.cpp audioio/AudioCallbackPlaySource.h transform/FeatureExtractionPluginTransform.cpp
diffstat 3 files changed, 21 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/audioio/AudioCallbackPlaySource.cpp	Wed Jun 06 14:42:41 2007 +0000
+++ b/audioio/AudioCallbackPlaySource.cpp	Wed Jun 06 16:24:55 2007 +0000
@@ -214,10 +214,20 @@
 	emit modelReplaced();
     }
 
+    connect(model, SIGNAL(modelChanged(size_t, size_t)),
+            this, SLOT(modelChanged(size_t, size_t)));
+
     m_condition.wakeAll();
 }
 
 void
+AudioCallbackPlaySource::modelChanged(size_t startFrame, size_t endFrame)
+{
+    std::cerr << "AudioCallbackPlaySource::modelChanged(" << startFrame << "," << endFrame << ")" << std::endl;
+    if (endFrame > m_lastModelEndFrame) m_lastModelEndFrame = endFrame;
+}
+
+void
 AudioCallbackPlaySource::removeModel(Model *model)
 {
     m_mutex.lock();
@@ -226,6 +236,9 @@
     std::cout << "AudioCallbackPlaySource::removeModel(" << model << ")" << std::endl;
 #endif
 
+    disconnect(model, SIGNAL(modelChanged(size_t, size_t)),
+               this, SLOT(modelChanged(size_t, size_t)));
+
     m_models.erase(model);
 
     if (m_models.empty()) {
--- a/audioio/AudioCallbackPlaySource.h	Wed Jun 06 14:42:41 2007 +0000
+++ b/audioio/AudioCallbackPlaySource.h	Wed Jun 06 16:24:55 2007 +0000
@@ -233,6 +233,7 @@
     void playSelectionModeChanged();
     void playParametersChanged(PlayParameters *);
     void preferenceChanged(PropertyContainer::PropertyName);
+    void modelChanged(size_t startFrame, size_t endFrame);
 
 protected:
     ViewManager                     *m_viewManager;
--- a/transform/FeatureExtractionPluginTransform.cpp	Wed Jun 06 14:42:41 2007 +0000
+++ b/transform/FeatureExtractionPluginTransform.cpp	Wed Jun 06 16:24:55 2007 +0000
@@ -242,7 +242,13 @@
     if (!input) return;
 
     while (!input->isReady()) {
-        if (dynamic_cast<WaveFileModel *>(input)) break; // no need to wait
+/*
+        if (dynamic_cast<WaveFileModel *>(input)) {
+            std::cerr << "FeatureExtractionPluginTransform::run: Model is not ready, but it's not a WaveFileModel (it's a " << typeid(input).name() << "), so that's OK" << std::endl;
+            sleep(2);
+            break; // no need to wait
+        }
+*/
         std::cerr << "FeatureExtractionPluginTransform::run: Waiting for input model to be ready..." << std::endl;
         sleep(1);
     }