summaryrefslogtreecommitdiffstats
path: root/src/gui/NodeMenu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/NodeMenu.cpp')
-rw-r--r--src/gui/NodeMenu.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gui/NodeMenu.cpp b/src/gui/NodeMenu.cpp
index 5434f6be..08524ade 100644
--- a/src/gui/NodeMenu.cpp
+++ b/src/gui/NodeMenu.cpp
@@ -46,6 +46,7 @@ NodeMenu::NodeMenu(BaseObjectType* cobject,
{
xml->get_widget("node_popup_gui_menuitem", _popup_gui_menuitem);
xml->get_widget("node_embed_gui_menuitem", _embed_gui_menuitem);
+ xml->get_widget("node_enabled_menuitem", _enabled_menuitem);
xml->get_widget("node_randomize_menuitem", _randomize_menuitem);
}
@@ -60,6 +61,8 @@ NodeMenu::init(App& app, SPtr<const Client::BlockModel> block)
sigc::mem_fun(signal_popup_gui, &sigc::signal<void>::emit));
_embed_gui_menuitem->signal_toggled().connect(
sigc::mem_fun(this, &NodeMenu::on_menu_embed_gui));
+ _enabled_menuitem->signal_toggled().connect(
+ sigc::mem_fun(this, &NodeMenu::on_menu_enabled));
_randomize_menuitem->signal_activate().connect(
sigc::mem_fun(this, &NodeMenu::on_menu_randomize));
@@ -76,6 +79,9 @@ NodeMenu::init(App& app, SPtr<const Client::BlockModel> block)
_embed_gui_menuitem->hide();
}
+ const Atom& enabled = block->get_property(_app->uris().ingen_enabled);
+ _enabled_menuitem->set_active(!enabled.is_valid() || enabled.get<int32_t>());
+
if (plugin && plugin->type() == PluginModel::LV2) {
LilvNode* pset_Preset = lilv_new_uri(plugin->lilv_world(),
@@ -159,6 +165,14 @@ NodeMenu::on_menu_embed_gui()
}
void
+NodeMenu::on_menu_enabled()
+{
+ _app->set_property(_object->uri(),
+ _app->uris().ingen_enabled,
+ _app->forge().make(bool(_enabled_menuitem->get_active())));
+}
+
+void
NodeMenu::on_menu_randomize()
{
_app->interface()->bundle_begin();