diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index d7e4d3c1b7..df79aca78e 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -809,7 +809,7 @@ RouteTimeAxisView::set_height (uint32_t h) gm.get_gain_slider().show(); mute_button->show(); - if (!_route || _route->is_master()) { + if (!_route || _route->is_control()) { solo_button->hide(); } else { solo_button->show(); @@ -835,7 +835,7 @@ RouteTimeAxisView::set_height (uint32_t h) gm.get_gain_slider().hide(); mute_button->show(); - if (!_route || _route->is_master()) { + if (!_route || _route->is_control()) { solo_button->hide(); } else { solo_button->show(); diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc index ba805f7d4b..2662ba9664 100644 --- a/gtk2_ardour/route_ui.cc +++ b/gtk2_ardour/route_ui.cc @@ -209,7 +209,7 @@ RouteUI::set_route (boost::shared_ptr rp) mute_button->show(); - if (_route->is_master()) { + if (_route->is_control()) { solo_button->hide (); } else { solo_button->show(); @@ -646,17 +646,24 @@ RouteUI::update_solo_display () ignore_toggle = false; } + if (x) { + solo_button->set_visual_state (1); + } else { + solo_button->set_visual_state (0); + } + + } else { if (solo_button->get_active() != (x = _route->soloed())){ ignore_toggle = true; - solo_button->set_active(x); + solo_button->set_active (x); ignore_toggle = false; } if (_route->solo_isolated()) { solo_button->set_visual_state (2); - } else if (_route->soloed()) { + } else if (x) { solo_button->set_visual_state (1); } else { solo_button->set_visual_state (0); diff --git a/libs/ardour/ardour/rc_configuration_vars.h b/libs/ardour/ardour/rc_configuration_vars.h index 5217ea6aa7..237ff1d3d3 100644 --- a/libs/ardour/ardour/rc_configuration_vars.h +++ b/libs/ardour/ardour/rc_configuration_vars.h @@ -87,6 +87,7 @@ CONFIG_VARIABLE (bool, show_solo_mutes, "show-solo-mutes", false) CONFIG_VARIABLE (bool, solo_mute_override, "solo-mute-override", false) CONFIG_VARIABLE (bool, tape_machine_mode, "tape-machine-mode", false) CONFIG_VARIABLE (gain_t, solo_mute_gain, "solo-mute-gain", 0.0) +CONFIG_VARIABLE (std::string, monitor_bus_preferred_bundle, "monitor-bus-preferred-bundle", "") /* click */ diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc index 2397999a26..8c14466b00 100644 --- a/libs/ardour/io.cc +++ b/libs/ardour/io.cc @@ -1255,6 +1255,18 @@ IO::set_name_in_state (XMLNode& node, const string& new_name) bool IO::connected_to (boost::shared_ptr other) const { + if (!other) { + /* do we have any connections at all? */ + + for (PortSet::const_iterator p = _ports.begin(); p != _ports.end(); ++p) { + if (p->connected()) { + return true; + } + } + + return false; + } + assert (_direction != other->direction()); uint32_t i, j; diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index a6af898f38..2eeaba176f 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -1282,7 +1282,6 @@ Route::configure_processors_unlocked (ProcessorStreams* err) list< pair >::iterator c = configuration.begin(); for (ProcessorList::iterator p = _processors.begin(); p != _processors.end(); ++p, ++c) { (*p)->configure_io(c->first, c->second); - (*p)->activate(); processor_max_streams = ChanCount::max(processor_max_streams, c->first); processor_max_streams = ChanCount::max(processor_max_streams, c->second); out = c->second; @@ -1928,7 +1927,7 @@ Route::listen_via (boost::shared_ptr route, bool active) _control_outs = listener; } - add_processor (listener, PreFader); + add_processor (listener, (Config->get_listen_position() == AfterFaderListen ? PostFader : PreFader)); return 0; } diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index e470c2623e..67989d5ebf 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -655,10 +655,14 @@ Session::when_engine_running () add_bundle (c); } } + + BootMessage (_("Setup signal flow and plugins")); - if (Config->get_auto_connect_standard_busses() && !no_auto_connect()) { + hookup_io (); - if (_master_out) { + if (!no_auto_connect()) { + + if (_master_out && Config->get_auto_connect_standard_busses()) { /* if requested auto-connect the outputs to the first N physical ports. */ @@ -707,36 +711,52 @@ Session::when_engine_running () } } - /* connect control out to physical outs, but use ones after the master - if possible + /* if control out is not connected, + connect control out to physical outs, but use ones after the master if possible */ - /* XXX this logic is wrong for mixed port types */ + if (!_control_out->output()->connected_to (boost::shared_ptr())) { - uint32_t shift = _master_out->n_outputs().n_audio(); - uint32_t mod = _master_out->n_outputs().n_audio(); - limit = _control_out->n_outputs().n_audio(); + if (!Config->get_monitor_bus_preferred_bundle().empty()) { - for (uint32_t n = 0; n < limit; ++n) { + boost::shared_ptr b = bundle_by_name (Config->get_monitor_bus_preferred_bundle()); - Port* p = _control_out->output()->nth (n); - string connect_to = _engine.get_nth_physical_output (DataType (p->type()), (n+shift) % mod); - - if (!connect_to.empty()) { - if (_control_out->output()->connect (p, connect_to, this)) { - error << string_compose (_("cannot connect control output %1 to %2"), n, connect_to) - << endmsg; - break; + if (b) { + _control_out->output()->connect_ports_to_bundle (b, this); + } else { + warning << string_compose (_("The preferred I/O for the monitor bus (%1) cannot be found"), + Config->get_monitor_bus_preferred_bundle()) + << endmsg; + } + + } else { + + /* XXX this logic is wrong for mixed port types */ + + uint32_t shift = _master_out->n_outputs().n_audio(); + uint32_t mod = _engine.n_physical_outputs (DataType::AUDIO); + limit = _control_out->n_outputs().n_audio(); + + cerr << "Connecting " << limit << " control out ports, shift is " << shift << " mod is " << mod << endl; + + for (uint32_t n = 0; n < limit; ++n) { + + Port* p = _control_out->output()->nth (n); + string connect_to = _engine.get_nth_physical_output (DataType (p->type()), (n+shift) % mod); + + if (!connect_to.empty()) { + if (_control_out->output()->connect (p, connect_to, this)) { + error << string_compose (_("cannot connect control output %1 to %2"), n, connect_to) + << endmsg; + break; + } + } } } } } } - BootMessage (_("Setup signal flow and plugins")); - - hookup_io (); - /* catch up on send+insert cnts */ _state_of_the_state = StateOfTheState (_state_of_the_state & ~(CannotSave|Dirty)); @@ -2336,10 +2356,14 @@ Session::route_solo_changed (void* src, boost::weak_ptr wpr) delta = -1; } + /* now mod the solo level of all other routes except master & control outs + so that they will be silent if appropriate. + */ + solo_update_disabled = true; for (RouteList::iterator i = r->begin(); i != r->end(); ++i) { - if ((*i)->feeds (route)) { + if ((*i)->feeds (route) && !(*i)->is_hidden() && !(*i)->is_master() && !(*i)->is_control()) { /* do it */ (*i)->mod_solo_level (delta); } @@ -2347,13 +2371,13 @@ Session::route_solo_changed (void* src, boost::weak_ptr wpr) /* make sure master is never muted by solo */ - if (_master_out->solo_level() == 0) { + if (route != _master_out && _master_out->solo_level() == 0 && !_master_out->soloed()) { _master_out->mod_solo_level (1); } /* ditto for control outs make sure master is never muted by solo */ - if (_control_out && _control_out->solo_level() == 0) { + if (route != _control_out && _control_out && _control_out->solo_level() == 0) { _control_out->mod_solo_level (1); }