diff base/PlayParameterRepository.cpp @ 57:7439f1696314

* Add editing for auralisation plugin parameters and programs * Rename and reorganise the sample plugin sample set
author Chris Cannam
date Thu, 23 Mar 2006 15:49:41 +0000
parents d397ea0a79f5
children f277a171749d
line wrap: on
line diff
--- a/base/PlayParameterRepository.cpp	Wed Mar 22 17:38:29 2006 +0000
+++ b/base/PlayParameterRepository.cpp	Thu Mar 23 15:49:41 2006 +0000
@@ -48,9 +48,21 @@
 
 	    m_playParameters[model] = new PlayParameters;
 
+            m_playParameters[model]->setPlayPluginId
+                (AudioGenerator::getDefaultPlayPluginId(model));
+
+            m_playParameters[model]->setPlayPluginConfiguration
+                (AudioGenerator::getDefaultPlayPluginConfiguration(model));
+
 	    connect(m_playParameters[model], SIGNAL(playParametersChanged()),
 		    this, SLOT(playParametersChanged()));
 
+	    connect(m_playParameters[model], SIGNAL(playPluginIdChanged(QString)),
+		    this, SLOT(playPluginIdChanged(QString)));
+
+	    connect(m_playParameters[model], SIGNAL(playPluginConfigurationChanged(QString)),
+		    this, SLOT(playPluginConfigurationChanged(QString)));
+
 	} else {
 
 	    std::cerr << "PlayParameterRepository: Model " << model << " not playable" <<  std::endl;
@@ -75,7 +87,34 @@
 void
 PlayParameterRepository::playParametersChanged()
 {
-    emit playParametersChanged(dynamic_cast<PlayParameters *>(sender()));
+    PlayParameters *params = dynamic_cast<PlayParameters *>(sender());
+    emit playParametersChanged(params);
+}
+
+void
+PlayParameterRepository::playPluginIdChanged(QString id)
+{
+    PlayParameters *params = dynamic_cast<PlayParameters *>(sender());
+    for (ModelParameterMap::iterator i = m_playParameters.begin();
+         i != m_playParameters.end(); ++i) {
+        if (i->second == params) {
+            emit playPluginIdChanged(i->first, id);
+            return;
+        }
+    }
+}
+
+void
+PlayParameterRepository::playPluginConfigurationChanged(QString config)
+{
+    PlayParameters *params = dynamic_cast<PlayParameters *>(sender());
+    for (ModelParameterMap::iterator i = m_playParameters.begin();
+         i != m_playParameters.end(); ++i) {
+        if (i->second == params) {
+            emit playPluginConfigurationChanged(i->first, config);
+            return;
+        }
+    }
 }
 
 void