From 4326f8ba71f4af1f3e3c48c9f3a02d8e3e0590f7 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 15 Jan 2015 19:49:29 +0000 Subject: Node bypass. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5515 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/NodeMenu.cpp | 14 ++++++++++++++ src/gui/NodeMenu.hpp | 2 ++ src/gui/NodeModule.cpp | 6 ++++++ src/gui/ingen_gui.ui | 10 ++++++++++ 4 files changed, 32 insertions(+) (limited to 'src/gui') 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 block) sigc::mem_fun(signal_popup_gui, &sigc::signal::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 block) _embed_gui_menuitem->hide(); } + const Atom& enabled = block->get_property(_app->uris().ingen_enabled); + _enabled_menuitem->set_active(!enabled.is_valid() || enabled.get()); + if (plugin && plugin->type() == PluginModel::LV2) { LilvNode* pset_Preset = lilv_new_uri(plugin->lilv_world(), @@ -158,6 +164,14 @@ NodeMenu::on_menu_embed_gui() signal_embed_gui.emit(_embed_gui_menuitem->get_active()); } +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() { diff --git a/src/gui/NodeMenu.hpp b/src/gui/NodeMenu.hpp index 969afecf..d84bc84f 100644 --- a/src/gui/NodeMenu.hpp +++ b/src/gui/NodeMenu.hpp @@ -50,12 +50,14 @@ public: protected: void on_menu_disconnect(); void on_menu_embed_gui(); + void on_menu_enabled(); void on_menu_randomize(); void on_preset_activated(const std::string& uri); bool on_preset_clicked(const std::string& uri, GdkEventButton* ev); Gtk::MenuItem* _popup_gui_menuitem; Gtk::CheckMenuItem* _embed_gui_menuitem; + Gtk::CheckMenuItem* _enabled_menuitem; Gtk::MenuItem* _randomize_menuitem; Gtk::Menu* _presets_menu; }; diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp index 722cfa83..40303ad7 100644 --- a/src/gui/NodeModule.cpp +++ b/src/gui/NodeModule.cpp @@ -438,6 +438,12 @@ NodeModule::property_changed(const Raul::URI& key, const Atom& value) } else if (!value.get() && _gui_widget) { embed_gui(false); } + } else if (key == uris.ingen_enabled) { + if (value.get()) { + set_dash_length(0.0); + } else { + set_dash_length(5.0); + } } } else if (value.type() == uris.forge.String) { if (key == uris.lv2_name diff --git a/src/gui/ingen_gui.ui b/src/gui/ingen_gui.ui index eb3f2684..2b711ce0 100644 --- a/src/gui/ingen_gui.ui +++ b/src/gui/ingen_gui.ui @@ -2081,6 +2081,16 @@ Contributors: Embed GUI + + + True + False + False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Enabled + True + + Randomi_ze -- cgit v1.2.1