-}
-
-void
-RouteUI::build_remote_control_menu ()
-{
- remote_control_menu = new Menu;
- refresh_remote_control_menu ();
-}
-
-void
-RouteUI::refresh_remote_control_menu ()
-{
- ENSURE_GUI_THREAD (mem_fun (*this, &RouteUI::refresh_remote_control_menu));
-
- // only refresh the menu if it has been instantiated
-
- if (remote_control_menu == 0) {
- return;
- }
-
- using namespace Menu_Helpers;
-
- RadioMenuItem::Group rc_group;
- CheckMenuItem* rc_active;
- uint32_t limit = _session.ntracks() + _session.nbusses();
- 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 */
-
- rc_items.push_back (RadioMenuElem (rc_group, _("None")));
- if (_route->remote_control_id() == 0) {
- rc_active = dynamic_cast<CheckMenuItem*> (&rc_items.back());
- rc_active->set_active ();
- }
-
- for (uint32_t i = 1; 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.
- */