+ LatencyDialog dialog (_route->name() + _(" latency"), *(_route->output()), _session->frame_rate(), _session->engine().frames_per_cycle());
+}
+
+void
+RouteUI::save_as_template ()
+{
+ sys::path path;
+ Glib::ustring safe_name;
+ string name;
+
+ path = ARDOUR::user_route_template_directory ();
+
+ if (g_mkdir_with_parents (path.to_string().c_str(), 0755)) {
+ error << string_compose (_("Cannot create route template directory %1"), path.to_string()) << endmsg;
+ return;
+ }
+
+ Prompter p (true); // modal
+
+ p.set_title (_("Save As Template"));
+ p.set_prompt (_("Template name:"));
+ switch (p.run()) {
+ case RESPONSE_ACCEPT:
+ break;
+ default:
+ return;
+ }
+
+ p.hide ();
+ p.get_result (name, true);
+
+ safe_name = legalize_for_path (name);
+ safe_name += template_suffix;
+
+ path /= safe_name;
+
+ _route->save_as_template (path.to_string(), name);
+}
+
+void
+RouteUI::check_rec_enable_sensitivity ()
+{
+ if (_session->transport_rolling() && rec_enable_button->get_active() && Config->get_disable_disarm_during_roll()) {
+ rec_enable_button->set_sensitive (false);
+ } else {
+ rec_enable_button->set_sensitive (true);
+ }
+}
+
+void
+RouteUI::parameter_changed (string const & p)
+{
+ if (p == "disable-disarm-during-roll") {
+ check_rec_enable_sensitivity ();
+ } else if (p == "solo-control-is-listen-control") {
+ set_button_names ();
+ } else if (p == "listen-position") {
+ set_button_names ();
+ }
+}
+
+void
+RouteUI::step_gain_up ()
+{
+ _route->set_gain (dB_to_coefficient (accurate_coefficient_to_dB (_route->gain_control()->get_value()) + 0.1), this);
+}
+
+void
+RouteUI::page_gain_up ()
+{
+ _route->set_gain (dB_to_coefficient (accurate_coefficient_to_dB (_route->gain_control()->get_value()) + 0.5), this);
+}
+
+void
+RouteUI::step_gain_down ()
+{
+ _route->set_gain (dB_to_coefficient (accurate_coefficient_to_dB (_route->gain_control()->get_value()) - 0.1), this);
+}
+
+void
+RouteUI::page_gain_down ()
+{
+ _route->set_gain (dB_to_coefficient (accurate_coefficient_to_dB (_route->gain_control()->get_value()) - 0.5), this);
+}
+
+void
+RouteUI::open_remote_control_id_dialog ()
+{
+ ArdourDialog dialog (_("Remote Control ID"));
+
+ uint32_t const limit = _session->ntracks() + _session->nbusses () + 4;
+
+ HBox* hbox = manage (new HBox);
+ hbox->set_spacing (6);
+ hbox->pack_start (*manage (new Label (_("Remote control ID:"))));
+ SpinButton* spin = manage (new SpinButton);
+ spin->set_digits (0);
+ spin->set_increments (1, 10);
+ spin->set_range (0, limit);
+ spin->set_value (_route->remote_control_id());
+ hbox->pack_start (*spin);
+ dialog.get_vbox()->pack_start (*hbox);
+
+ dialog.add_button (Stock::CANCEL, RESPONSE_CANCEL);
+ dialog.add_button (Stock::APPLY, RESPONSE_ACCEPT);
+
+ dialog.show_all ();
+ int const r = dialog.run ();
+
+ if (r == RESPONSE_ACCEPT) {
+ _route->set_remote_control_id (spin->get_value_as_int ());
+ }