summaryrefslogtreecommitdiffstats
path: root/src/gui/NodeMenu.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-11-27 22:50:32 +0000
committerDavid Robillard <d@drobilla.net>2008-11-27 22:50:32 +0000
commitc58f17efff27f959147dfd231a8b059950d06e69 (patch)
treef10dd950a9b1b15461a6200f9396a989b3e1ad9d /src/gui/NodeMenu.cpp
parentcb1d3b65670febd0bd5c3ac7d128f45ef0a744a4 (diff)
downloadingen-c58f17efff27f959147dfd231a8b059950d06e69.tar.gz
ingen-c58f17efff27f959147dfd231a8b059950d06e69.tar.bz2
ingen-c58f17efff27f959147dfd231a8b059950d06e69.zip
MIDI learn for control node.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1806 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui/NodeMenu.cpp')
-rw-r--r--src/gui/NodeMenu.cpp11
1 files changed, 11 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;
}