X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Froute_ui.cc;h=1dc24594a62db64989712109635224a5de6067cd;hb=84aedbb532c46054f200d7312334da7c17776b8e;hp=6eca450f17bff5296794303b3459985723e76538;hpb=b5e1eb7538b9119e5b3abfb45d2ddf9f86331ffa;p=ardour.git diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc index 6eca450f17..1dc24594a6 100644 --- a/gtk2_ardour/route_ui.cc +++ b/gtk2_ardour/route_ui.cc @@ -210,6 +210,7 @@ RouteUI::init () _session->SoloChanged.connect (_session_connections, invalidator (*this), boost::bind (&RouteUI::solo_changed_so_update_mute, this), gui_context()); _session->TransportStateChange.connect (_session_connections, invalidator (*this), boost::bind (&RouteUI::check_rec_enable_sensitivity, this), gui_context()); _session->RecordStateChanged.connect (_session_connections, invalidator (*this), boost::bind (&RouteUI::session_rec_enable_changed, this), gui_context()); + _session->MonitorBusAddedOrRemoved.connect (_session_connections, invalidator (*this), boost::bind (&RouteUI::set_button_names, this), gui_context()); _session->config.ParameterChanged.connect (*this, invalidator (*this), boost::bind (&RouteUI::parameter_changed, this, _1), gui_context()); Config->ParameterChanged.connect (*this, invalidator (*this), boost::bind (&RouteUI::parameter_changed, this, _1), gui_context()); @@ -499,7 +500,7 @@ RouteUI::mute_press (GdkEventButton* ev) } boost::shared_ptr mc = _route->mute_control(); - mc->start_touch (_session->audible_frame ()); + mc->start_touch (_session->audible_sample ()); _session->set_controls (route_list_to_control_list (rl, &Stripable::mute_control), _route->muted_by_self() ? 0.0 : 1.0, Controllable::InverseGroup); } @@ -515,7 +516,7 @@ RouteUI::mute_press (GdkEventButton* ev) } boost::shared_ptr mc = _route->mute_control(); - mc->start_touch (_session->audible_frame ()); + mc->start_touch (_session->audible_sample ()); mc->set_value (!_route->muted_by_self(), Controllable::UseGroup); } } @@ -533,7 +534,7 @@ RouteUI::mute_release (GdkEventButton* /*ev*/) _mute_release = 0; } - _route->mute_control()->stop_touch (_session->audible_frame ()); + _route->mute_control()->stop_touch (_session->audible_sample ()); return false; } @@ -773,17 +774,15 @@ RouteUI::rec_enable_press(GdkEventButton* ev) if (BindingProxy::is_bind_action(ev) ) return false; - if (!_session->engine().connected()) { - MessageDialog msg (_("Not connected to AudioEngine - cannot engage record")); - msg.run (); + if (!ARDOUR_UI_UTILS::engine_is_running ()) { return false; } if (is_midi_track()) { - /* rec-enable button exits from step editing */ + /* rec-enable button exits from step editing, but not context click */ - if (midi_track()->step_editing()) { + if (!Keyboard::is_context_menu_event (ev) && midi_track()->step_editing()) { midi_track()->set_step_editing (false); return false; } @@ -906,17 +905,10 @@ RouteUI::monitor_release (GdkEventButton* ev, MonitorChoice monitor_choice) MonitorChoice mc; boost::shared_ptr rl; - /* XXX for now, monitoring choices are orthogonal. cue monitoring - will follow in 3.X but requires mixing the input and playback (disk) - signal together, which requires yet more buffers. - */ - if (t->monitoring_control()->monitoring_choice() & monitor_choice) { mc = MonitorChoice (t->monitoring_control()->monitoring_choice() & ~monitor_choice); } else { - /* this line will change when the options are non-orthogonal */ - // mc = MonitorChoice (t->monitoring_choice() | monitor_choice); - mc = monitor_choice; + mc = MonitorChoice (t->monitoring_control()->monitoring_choice() | monitor_choice); } if (Keyboard::modifier_state_equals (ev->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier|Keyboard::TertiaryModifier))) { @@ -1054,7 +1046,7 @@ RouteUI::build_sends_menu () ); items.push_back ( - MenuElem(_("Assign all tracks and buses (prefader)"), sigc::bind (sigc::mem_fun (*this, &RouteUI::create_sends), PreFader, true)) + MenuElem(_("Assign all tracks and busses (prefader)"), sigc::bind (sigc::mem_fun (*this, &RouteUI::create_sends), PreFader, true)) ); items.push_back ( @@ -1062,7 +1054,7 @@ RouteUI::build_sends_menu () ); items.push_back ( - MenuElem(_("Assign all tracks and buses (postfader)"), sigc::bind (sigc::mem_fun (*this, &RouteUI::create_sends), PostFader, true)) + MenuElem(_("Assign all tracks and busses (postfader)"), sigc::bind (sigc::mem_fun (*this, &RouteUI::create_sends), PostFader, true)) ); items.push_back ( @@ -1070,14 +1062,14 @@ RouteUI::build_sends_menu () ); items.push_back ( - MenuElem(_("Assign selected tracks and buses (prefader)"), sigc::bind (sigc::mem_fun (*this, &RouteUI::create_selected_sends), PreFader, true))); + MenuElem(_("Assign selected tracks and busses (prefader)"), sigc::bind (sigc::mem_fun (*this, &RouteUI::create_selected_sends), PreFader, true))); items.push_back ( MenuElem(_("Assign selected tracks (postfader)"), sigc::bind (sigc::mem_fun (*this, &RouteUI::create_selected_sends), PostFader, false)) ); items.push_back ( - MenuElem(_("Assign selected tracks and buses (postfader)"), sigc::bind (sigc::mem_fun (*this, &RouteUI::create_selected_sends), PostFader, true)) + MenuElem(_("Assign selected tracks and busses (postfader)"), sigc::bind (sigc::mem_fun (*this, &RouteUI::create_selected_sends), PostFader, true)) ); items.push_back (MenuElem(_("Copy track/bus gains to sends"), sigc::mem_fun (*this, &RouteUI::set_sends_gain_from_track))); @@ -1927,7 +1919,7 @@ RouteUI::map_frozen () void RouteUI::adjust_latency () { - LatencyDialog dialog (_route->name() + _(" latency"), *(_route->output()), _session->frame_rate(), AudioEngine::instance()->samples_per_cycle()); + LatencyDialog dialog (_route->name() + _(" latency"), *(_route->output()), _session->sample_rate(), AudioEngine::instance()->samples_per_cycle()); } @@ -2004,7 +1996,7 @@ RouteUI::parameter_changed (string const & p) if (p == "disable-disarm-during-roll") { check_rec_enable_sensitivity (); - } else if (p == "use-monitor-bus" || p == "solo-control-is-listen-control" || p == "listen-position") { + } else if (p == "solo-control-is-listen-control" || p == "listen-position") { set_button_names (); } else if (p == "session-monitoring") { update_monitoring_display (); @@ -2330,6 +2322,10 @@ RouteUI::manage_pins () void RouteUI::fan_out (bool to_busses, bool group) { + if (!ARDOUR_UI_UTILS::engine_is_running ()) { + return; + } + DisplaySuspender ds; boost::shared_ptr route = _route; boost::shared_ptr pi = boost::dynamic_pointer_cast (route->the_instrument ()); @@ -2375,19 +2371,27 @@ RouteUI::fan_out (bool to_busses, bool group) std::string bn = BUSNAME; boost::shared_ptr r = _session->route_by_name (bn); if (!r) { - if (to_busses) { - RouteList rl = _session->new_audio_route (busnames[bn], outputs, NULL, 1, bn, PresentationInfo::AudioBus, PresentationInfo::max_order); - r = rl.front (); - assert (r); - } else { - list > tl = - _session->new_audio_track (busnames[bn], outputs, NULL, 1, bn, PresentationInfo::max_order, Normal); - r = tl.front (); - assert (r); - - boost::shared_ptr cl (new ControlList); - cl->push_back (r->monitoring_control ()); - _session->set_controls (cl, (double) MonitorInput, Controllable::NoGroup); + try { + if (to_busses) { + RouteList rl = _session->new_audio_route (busnames[bn], outputs, NULL, 1, bn, PresentationInfo::AudioBus, PresentationInfo::max_order); + r = rl.front (); + assert (r); + } else { + list > tl = + _session->new_audio_track (busnames[bn], outputs, NULL, 1, bn, PresentationInfo::max_order, Normal); + r = tl.front (); + assert (r); + + boost::shared_ptr cl (new ControlList); + cl->push_back (r->monitoring_control ()); + _session->set_controls (cl, (double) MonitorInput, Controllable::NoGroup); + } + } catch (...) { + if (!to_group.empty()) { + boost::shared_ptr rl (&to_group); + _session->remove_routes (rl); + } + return; } r->input ()->disconnect (this); } @@ -2433,3 +2437,11 @@ RouteUI::stripable () const { return _route; } + +void +RouteUI::set_disk_io_point (DiskIOPoint diop) +{ + if (_route && is_track()) { + track()->set_disk_io_point (diop); + } +}