summaryrefslogtreecommitdiff
path: root/gtk2_ardour/plugin_ui.h
diff options
context:
space:
mode:
authorJulien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr>2016-07-28 19:43:43 +0200
committerJulien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr>2016-07-28 23:19:08 +0200
commit63bbcf968a11a3d6e89a6983d7bb810f487d63c1 (patch)
tree5bf12399b8953d75608b32561d9e19ff646baad8 /gtk2_ardour/plugin_ui.h
parent1d173bc84fb36f73be2bc9d58251ac110e4148eb (diff)
GenericUI: only connect one PropertyChanged callback
The code connected the callback to the PropertyChanged signal from the plugin once per filepath control created. Should the plugin have several files to open, this would be at best wasteful and at worst racy. Connect the callback a single time, since the same callback handles all property updates that we're interested in. Also rename the methods, members and typedefs so that it's clear what the code is trying to do.
Diffstat (limited to 'gtk2_ardour/plugin_ui.h')
-rw-r--r--gtk2_ardour/plugin_ui.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/gtk2_ardour/plugin_ui.h b/gtk2_ardour/plugin_ui.h
index 721289ac0b..001054bae9 100644
--- a/gtk2_ardour/plugin_ui.h
+++ b/gtk2_ardour/plugin_ui.h
@@ -263,7 +263,9 @@ class GenericPluginUI : public PlugUIBase, public Gtk::VBox
std::vector<ControlUI*> input_controls;
std::vector<ControlUI*> input_controls_with_automation;
std::vector<ControlUI*> output_controls;
+
sigc::connection screen_update_connection;
+
void output_update();
void build ();
@@ -291,12 +293,12 @@ class GenericPluginUI : public PlugUIBase, public Gtk::VBox
bool integer_printer (char* buf, Gtk::Adjustment &, ControlUI *);
bool midinote_printer(char* buf, Gtk::Adjustment &, ControlUI *);
- void set_property (const ARDOUR::ParameterDescriptor& desc,
- Gtk::FileChooserButton* widget);
- void property_changed (uint32_t key, const ARDOUR::Variant& value);
+ typedef std::map<uint32_t, Gtk::FileChooserButton*> FilePathControls;
+ FilePathControls _filepath_controls;
+ void set_path_property (const ARDOUR::ParameterDescriptor& desc,
+ Gtk::FileChooserButton* widget);
+ void path_property_changed (uint32_t key, const ARDOUR::Variant& value);
- typedef std::map<uint32_t, Gtk::FileChooserButton*> PropertyControls;
- PropertyControls _property_controls;
};
class PluginUIWindow : public ArdourWindow