diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2006-01-08 02:56:49 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2006-01-08 02:56:49 +0000 |
commit | a20f41ab39cc034740ccd564c1057d8737d763d5 (patch) | |
tree | 6f713470d72ec04ad03efb1ad6380717476c29fd /gtk2_ardour/route_ui.cc | |
parent | 1186b1d881fac3d1d1b55954b84b958c988501c4 (diff) |
a metric ton of changes
git-svn-id: svn://localhost/trunk/ardour2@246 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/route_ui.cc')
-rw-r--r-- | gtk2_ardour/route_ui.cc | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc index 1780204321..82b6cac3bd 100644 --- a/gtk2_ardour/route_ui.cc +++ b/gtk2_ardour/route_ui.cc @@ -54,6 +54,7 @@ RouteUI::RouteUI (ARDOUR::Route& rt, ARDOUR::Session& sess, const char* m_name, xml_node = 0; mute_menu = 0; solo_menu = 0; + remote_control_menu = 0; ignore_toggle = false; wait_for_release = false; route_active_menu_item = 0; @@ -409,6 +410,58 @@ RouteUI::update_rec_display () } void +RouteUI::build_remote_control_menu () +{ + remote_control_menu = manage (new Menu); + refresh_remote_control_menu (); +} + +void +RouteUI::refresh_remote_control_menu () +{ + using namespace Menu_Helpers; + + RadioMenuItem::Group rc_group; + CheckMenuItem* rc_active; + uint32_t limit = _session.ntracks(); + char buf[32]; + + MenuList& rc_items = remote_control_menu->items(); + rc_items.clear (); + + /* note that this menu list starts at zero, not 1, because zero + is a valid, if useless, ID. + */ + + limit += 4; /* leave some breathing room */ + + for (uint32_t i = 0; i < limit; ++i) { + snprintf (buf, sizeof (buf), "%u", i); + rc_items.push_back (RadioMenuElem (rc_group, buf)); + rc_active = dynamic_cast<RadioMenuItem*>(&rc_items.back()); + if (_route.remote_control_id() == i) { + rc_active = dynamic_cast<CheckMenuItem*> (&rc_items.back()); + rc_active->set_active (); + } + rc_active->signal_activate().connect (bind (mem_fun (*this, &RouteUI::set_remote_control_id), i, rc_active)); + } +} + +void +RouteUI::set_remote_control_id (uint32_t id, CheckMenuItem* item) +{ + /* this is called when the radio menu item is toggled, and so + is actually invoked twice per menu selection. we only + care about the invocation for the item that was being + marked active. + */ + + if (item->get_active()) { + _route.set_remote_control_id (id); + } +} + +void RouteUI::build_solo_menu (void) { using namespace Menu_Helpers; @@ -840,3 +893,4 @@ RouteUI::map_frozen () } } } + |