changeset 82:bf42d8d63885

* Some work on reloading play parameters from file (not quite working yet) * Win32: redirect stderr to console * A bit of menu reorganisation
author Chris Cannam
date Wed, 26 Apr 2006 14:09:55 +0000
parents f277a171749d
children b2067aff8cd6
files base/PlayParameterRepository.cpp base/PlayParameters.cpp base/TempDirectory.cpp plugin/FeatureExtractionPluginFactory.cpp plugin/PluginIdentifier.cpp
diffstat 5 files changed, 11 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/base/PlayParameterRepository.cpp	Tue Apr 25 22:14:43 2006 +0000
+++ b/base/PlayParameterRepository.cpp	Wed Apr 26 14:09:55 2006 +0000
@@ -39,6 +39,8 @@
 void
 PlayParameterRepository::addModel(const Model *model)
 {
+    std::cerr << "PlayParameterRepository:addModel " << model <<  std::endl;
+
     if (!getPlayParameters(model)) {
 
 	// Give all models the same type of play parameters for the
@@ -110,6 +112,7 @@
 PlayParameterRepository::playPluginConfigurationChanged(QString config)
 {
     PlayParameters *params = dynamic_cast<PlayParameters *>(sender());
+    std::cerr << "PlayParameterRepository::playPluginConfigurationChanged" << std::endl;
     for (ModelParameterMap::iterator i = m_playParameters.begin();
          i != m_playParameters.end(); ++i) {
         if (i->second == params) {
--- a/base/PlayParameters.cpp	Tue Apr 25 22:14:43 2006 +0000
+++ b/base/PlayParameters.cpp	Wed Apr 26 14:09:55 2006 +0000
@@ -23,7 +23,7 @@
 {
     QString s;
     s += indent;
-    s += QString("<playParameters mute=\"%1\" pan=\"%2\" gain=\"%3\" pluginId=\"%4\" %6")
+    s += QString("<playparameters mute=\"%1\" pan=\"%2\" gain=\"%3\" pluginId=\"%4\" %6")
         .arg(m_playMuted ? "true" : "false")
         .arg(m_playPan)
         .arg(m_playGain)
@@ -31,7 +31,7 @@
         .arg(extraAttributes);
     if (m_playPluginConfiguration != "") {
         s += ">\n  " + indent + m_playPluginConfiguration
-            + indent + "</playParameters>\n";
+            + "\n" + indent + "</playparameters>\n";
     } else {
         s += "/>\n";
     }
@@ -90,6 +90,7 @@
 {
     if (m_playPluginConfiguration != configuration) {
         m_playPluginConfiguration = configuration;
+        std::cerr << "PlayParameters(" << this << "): setPlayPluginConfiguration to \"" << configuration.toStdString() << "\"" << std::endl;
         emit playPluginConfigurationChanged(configuration);
         emit playParametersChanged();
     }
--- a/base/TempDirectory.cpp	Tue Apr 25 22:14:43 2006 +0000
+++ b/base/TempDirectory.cpp	Wed Apr 26 14:09:55 2006 +0000
@@ -160,6 +160,7 @@
 
     for (unsigned int i = 0; i < dir.count(); ++i) {
 
+        if (dir[i] == "." || dir[i] == "..") continue; // just for paranoia
         QFileInfo fi(dir.filePath(dir[i]));
 
         if (fi.isDir()) {
--- a/plugin/FeatureExtractionPluginFactory.cpp	Tue Apr 25 22:14:43 2006 +0000
+++ b/plugin/FeatureExtractionPluginFactory.cpp	Wed Apr 26 14:09:55 2006 +0000
@@ -146,7 +146,8 @@
             int index = 0;
 
             while ((descriptor = fn(index))) {
-                QString id = QString("vamp:%1:%2").arg(soname).arg(descriptor->name);
+                QString id = PluginIdentifier::createIdentifier
+                    ("vamp", soname, descriptor->name);
                 rv.push_back(id);
                 std::cerr << "Found id " << id.toStdString() << std::endl;
                 ++index;
--- a/plugin/PluginIdentifier.cpp	Tue Apr 25 22:14:43 2006 +0000
+++ b/plugin/PluginIdentifier.cpp	Wed Apr 26 14:09:55 2006 +0000
@@ -20,13 +20,14 @@
 
 #include "PluginIdentifier.h"
 #include <iostream>
+#include <QFileInfo>
 
 QString
 PluginIdentifier::createIdentifier(QString type,
 				   QString soName,
 				   QString label)
 {
-    QString identifier = type + ":" + soName + ":" + label;
+    QString identifier = type + ":" + QFileInfo(soName).baseName() + ":" + label;
     return identifier;
 }