diff framework/Document.cpp @ 83:c60bf8995166

* Ensure plugin version is updated when a transform is re-run using a newer plugin -- so that the plugin version saved in the session corresponds with the one that was actually used, not the one previously specified * Fix uninitialised font size in preferences -- was causing all sorts of grief
author Chris Cannam
date Mon, 28 Jan 2008 17:43:44 +0000
parents 0948bf800422
children dd74c5332b49
line wrap: on
line diff
--- a/framework/Document.cpp	Fri Jan 25 18:15:57 2008 +0000
+++ b/framework/Document.cpp	Mon Jan 28 17:43:44 2008 +0000
@@ -453,10 +453,24 @@
     model = ModelTransformerFactory::getInstance()->transform
         (transform, input, message);
 
+    // The transform we actually used was presumably identical to the
+    // one asked for, except that the version of the plugin may
+    // differ.  It's possible that the returned message contains a
+    // warning about this; that doesn't concern us here, but we do
+    // need to ensure that the transform we remember is correct for
+    // what was actually applied, with the current plugin version.
+
+    Transform applied = transform;
+    applied.setPluginVersion
+        (TransformFactory::getInstance()->
+         getDefaultTransformFor(transform.getIdentifier(),
+                                lrintf(transform.getSampleRate()))
+         .getPluginVersion());
+
     if (!model) {
 	std::cerr << "WARNING: Document::addDerivedModel: no output model for transform " << transform.getIdentifier().toStdString() << std::endl;
     } else {
-	addDerivedModel(transform, input, model);
+	addDerivedModel(applied, input, model);
     }
 
     return model;