GenericUI: subscribe to property changes before querying values
authorRobin Gareus <robin@gareus.org>
Sat, 9 Sep 2017 02:39:10 +0000 (04:39 +0200)
committerRobin Gareus <robin@gareus.org>
Sat, 9 Sep 2017 02:39:10 +0000 (04:39 +0200)
Fixes displaying the initial/current filename/path for plugins that have
a LV2:Patch path property.

gtk2_ardour/generic_pluginui.cc

index 62a69bef1eb1ebe80a4d1167d4022bad0e44ee5d..6d26da1b1e92bc5147cd3d1586331863a9a37f71 100644 (file)
@@ -208,14 +208,6 @@ GenericPluginUI::GenericPluginUI (boost::shared_ptr<PluginInsert> pi, bool scrol
                scroller.set_policy (Gtk::POLICY_AUTOMATIC, Gtk::POLICY_NEVER);
        }
 
-
-       /* Listen for property changes that are not notified normally because
-        * AutomationControl has only support for numeric values currently.
-        * The only case is Variant::PATH for now */
-       plugin->PropertyChanged.connect(*this, invalidator(*this),
-                                       boost::bind(&GenericPluginUI::path_property_changed, this, _1, _2),
-                                       gui_context());
-
        main_contents.show ();
 }
 
@@ -392,6 +384,14 @@ GenericPluginUI::build ()
                control_uis.push_back(cui);
        }
        if (!descs.empty()) {
+               /* Listen for property changes that are not notified normally because
+                * AutomationControl has only support for numeric values currently.
+                * The only case is Variant::PATH for now */
+               plugin->PropertyChanged.connect(*this, invalidator(*this),
+                               boost::bind(&GenericPluginUI::path_property_changed, this, _1, _2),
+                               gui_context());
+
+               /* and query current property value */
                plugin->announce_property_values();
        }