diff audioio/AudioGenerator.cpp @ 307:6eb15c3aee0a tonioni

More toward using clip mixer
author Chris Cannam
date Tue, 07 Jan 2014 13:10:35 +0000
parents 9716c75499ef
children 289d65722123
line wrap: on
line diff
--- a/audioio/AudioGenerator.cpp	Tue Jan 07 13:04:29 2014 +0000
+++ b/audioio/AudioGenerator.cpp	Tue Jan 07 13:10:35 2014 +0000
@@ -27,6 +27,8 @@
 #include "data/model/SparseOneDimensionalModel.h"
 #include "data/model/NoteData.h"
 
+#include "ClipMixer.h"
+
 #include <iostream>
 #include <cmath>
 
@@ -115,14 +117,14 @@
 	    return true;
 	}
     }
-/*!!!
-    RealTimePluginInstance *plugin = loadPluginFor(model);
-    if (plugin) {
+
+    ClipMixer *mixer = makeClipMixerFor(model);
+    if (mixer) {
         QMutexLocker locker(&m_mutex);
-        m_synthMap[model] = plugin;
+        m_clipMixerMap[model] = mixer;
         return true;
     }
-*/
+
     return false;
 }
 
@@ -137,15 +139,14 @@
         return;
     }
 
-    if (m_synthMap.find(model) == m_synthMap.end()) return;
-/*!!!    
-    RealTimePluginInstance *plugin = loadPluginFor(model);
-    if (plugin) {
+    if (m_clipMixerMap.find(model) == m_clipMixerMap.end()) return;
+
+    ClipMixer *mixer = makeClipMixerFor(model);
+    if (mixer) {
         QMutexLocker locker(&m_mutex);
-        delete m_synthMap[model];
-        m_synthMap[model] = plugin;
+        m_clipMixerMap[model] = mixer;
+        return true;
     }
-*/
 }
 /*!!!
 void
@@ -180,11 +181,11 @@
         plugin->configure("sampledir", m_sampleDir.toStdString());
     }
 } 
-
-RealTimePluginInstance *
-AudioGenerator::loadPluginFor(const Model *model)
+*/
+ClipMixer *
+AudioGenerator::makeClipMixerFor(const Model *model)
 {
-    QString pluginId, configurationXml;
+    QString sampleId;
 
     const Playable *playable = model;
     if (!playable || !playable->canPlay()) return 0;
@@ -192,17 +193,21 @@
     PlayParameters *parameters =
 	PlayParameterRepository::getInstance()->getPlayParameters(playable);
     if (parameters) {
-        pluginId = parameters->getPlaySampleId();
-        configurationXml = parameters->getPlayPluginConfiguration();
+        sampleId = parameters->getPlaySampleId();
     }
 
-    std::cerr << "AudioGenerator::loadPluginFor(" << model << "): id = " << pluginId << std::endl;
+    std::cerr << "AudioGenerator::loadPluginFor(" << model << "): sample id = " << sampleId << std::endl;
 
-    if (pluginId == "") {
-        SVDEBUG << "AudioGenerator::loadPluginFor(" << model << "): parameters contain empty plugin ID, skipping" << endl;
+    if (sampleId == "") {
+        SVDEBUG << "AudioGenerator::loadPluginFor(" << model << "): no sample, skipping" << endl;
         return 0;
     }
 
+
+
+
+
+
     RealTimePluginInstance *plugin = loadPlugin(pluginId, "");
     if (!plugin) return 0;