diff options
author | David Robillard <d@drobilla.net> | 2015-01-15 19:49:29 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2015-01-15 19:49:29 +0000 |
commit | 4326f8ba71f4af1f3e3c48c9f3a02d8e3e0590f7 (patch) | |
tree | 15d37aa76d390385e847fad8160bd22df52dfe2c /src/gui | |
parent | 81df927a7faa49fd7057276df6dc67e386ca565c (diff) | |
download | ingen-4326f8ba71f4af1f3e3c48c9f3a02d8e3e0590f7.tar.gz ingen-4326f8ba71f4af1f3e3c48c9f3a02d8e3e0590f7.tar.bz2 ingen-4326f8ba71f4af1f3e3c48c9f3a02d8e3e0590f7.zip |
Node bypass.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5515 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/NodeMenu.cpp | 14 | ||||
-rw-r--r-- | src/gui/NodeMenu.hpp | 2 | ||||
-rw-r--r-- | src/gui/NodeModule.cpp | 6 | ||||
-rw-r--r-- | src/gui/ingen_gui.ui | 10 |
4 files changed, 32 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(); 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<int32_t>() && _gui_widget) { embed_gui(false); } + } else if (key == uris.ingen_enabled) { + if (value.get<int32_t>()) { + 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 @@ -2082,6 +2082,16 @@ Contributors: </object> </child> <child> + <object class="GtkCheckMenuItem" id="node_enabled_menuitem"> + <property name="visible">True</property> + <property name="use_action_appearance">False</property> + <property name="can_focus">False</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="label" translatable="yes">Enabled</property> + <property name="active">True</property> + </object> + </child> + <child> <object class="GtkImageMenuItem" id="node_randomize_menuitem"> <property name="label" translatable="yes">Randomi_ze</property> <property name="use_action_appearance">False</property> |