summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/NodeMenu.cpp11
-rw-r--r--src/gui/NodeMenu.hpp1
-rw-r--r--src/gui/ingen_gui.glade14
3 files changed, 26 insertions, 0 deletions
diff --git a/src/gui/NodeMenu.cpp b/src/gui/NodeMenu.cpp
index 43c0bf75..accf8ef1 100644
--- a/src/gui/NodeMenu.cpp
+++ b/src/gui/NodeMenu.cpp
@@ -36,11 +36,13 @@ NodeMenu::NodeMenu(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml
{
Gtk::Menu* node_menu = NULL;
xml->get_widget("node_menu", node_menu);
+ xml->get_widget("node_learn_menuitem", _learn_menuitem);
xml->get_widget("node_controls_menuitem", _controls_menuitem);
xml->get_widget("node_popup_gui_menuitem", _popup_gui_menuitem);
xml->get_widget("node_embed_gui_menuitem", _embed_gui_menuitem);
xml->get_widget("node_randomize_menuitem", _randomize_menuitem);
+ node_menu->remove(*_learn_menuitem);
node_menu->remove(*_controls_menuitem);
node_menu->remove(*_popup_gui_menuitem);
node_menu->remove(*_embed_gui_menuitem);
@@ -51,6 +53,7 @@ NodeMenu::NodeMenu(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml
insert(*_controls_menuitem, 0);
insert(*_popup_gui_menuitem, 0);
insert(*_embed_gui_menuitem, 0);
+ insert(*_learn_menuitem, 0);
}
@@ -59,6 +62,9 @@ NodeMenu::init(SharedPtr<NodeModel> node)
{
ObjectMenu::init(node);
+ _learn_menuitem->signal_activate().connect(sigc::mem_fun(this,
+ &NodeMenu::on_menu_learn));
+
_controls_menuitem->signal_activate().connect(sigc::bind(
sigc::mem_fun(App::instance().window_factory(), &WindowFactory::present_controls),
node));
@@ -84,6 +90,11 @@ NodeMenu::init(SharedPtr<NodeModel> node)
else
_randomize_menuitem->hide();
+ if (plugin->uri() == "http://drobilla.net/ns/ingen#control_node")
+ _learn_menuitem->show();
+ else
+ _learn_menuitem->hide();
+
_enable_signal = true;
}
diff --git a/src/gui/NodeMenu.hpp b/src/gui/NodeMenu.hpp
index d31aded2..c37dc415 100644
--- a/src/gui/NodeMenu.hpp
+++ b/src/gui/NodeMenu.hpp
@@ -60,6 +60,7 @@ protected:
void on_menu_embed_gui();
void on_menu_randomize();
+ Gtk::MenuItem* _learn_menuitem;
Gtk::MenuItem* _controls_menuitem;
Gtk::MenuItem* _popup_gui_menuitem;
Gtk::CheckMenuItem* _embed_gui_menuitem;
diff --git a/src/gui/ingen_gui.glade b/src/gui/ingen_gui.glade
index cabf3377..402e5466 100644
--- a/src/gui/ingen_gui.glade
+++ b/src/gui/ingen_gui.glade
@@ -3267,6 +3267,20 @@ Thank you for contributing.</property>
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<child>
+ <widget class="GtkImageMenuItem" id="node_learn_menuitem">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="tooltip" translatable="yes">Learn from the next received event</property>
+ <property name="label" translatable="yes">_Learn</property>
+ <property name="use_underline">True</property>
+ <child internal-child="image">
+ <widget class="GtkImage" id="menu-item-image25">
+ <property name="stock">gtk-media-record</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
<widget class="GtkImageMenuItem" id="node_controls_menuitem">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>