an improvement to the previous patch to catch up with solo state after a disconnect, but still not really done because it doesn't get triggered for both ends of a disconnect
git-svn-id: svn://localhost/ardour2/branches/3.0@11353 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
18bc80a01c
commit
9b3aefec1b
|
@ -148,7 +148,7 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember,
|
|||
|
||||
void set_solo (bool yn, void *src);
|
||||
bool soloed () const { return self_soloed () || soloed_by_others (); }
|
||||
void cancel_solo_after_disconnect ();
|
||||
void cancel_solo_after_disconnect (bool upstream);
|
||||
|
||||
bool soloed_by_others () const { return _soloed_by_others_upstream||_soloed_by_others_downstream; }
|
||||
bool soloed_by_others_upstream () const { return _soloed_by_others_upstream; }
|
||||
|
|
|
@ -618,7 +618,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
|
|||
|
||||
void set_solo (boost::shared_ptr<RouteList>, bool, SessionEvent::RTeventCallback after = rt_cleanup, bool group_override = false);
|
||||
void set_just_one_solo (boost::shared_ptr<Route>, bool, SessionEvent::RTeventCallback after = rt_cleanup);
|
||||
void cancel_solo_after_disconnect (boost::shared_ptr<Route>, SessionEvent::RTeventCallback after = rt_cleanup);
|
||||
void cancel_solo_after_disconnect (boost::shared_ptr<Route>, bool upstream, SessionEvent::RTeventCallback after = rt_cleanup);
|
||||
void set_mute (boost::shared_ptr<RouteList>, bool, SessionEvent::RTeventCallback after = rt_cleanup, bool group_override = false);
|
||||
void set_listen (boost::shared_ptr<RouteList>, bool, SessionEvent::RTeventCallback after = rt_cleanup, bool group_override = false);
|
||||
void set_record_enabled (boost::shared_ptr<RouteList>, bool, SessionEvent::RTeventCallback after = rt_cleanup, bool group_override = false);
|
||||
|
@ -1478,7 +1478,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
|
|||
return ev;
|
||||
}
|
||||
|
||||
void rt_cancel_solo_after_disconnect (boost::shared_ptr<RouteList>, bool /* ignored */, bool /* ignored*/ );
|
||||
void rt_cancel_solo_after_disconnect (boost::shared_ptr<RouteList>, bool upstream, bool /* ignored*/ );
|
||||
void rt_set_solo (boost::shared_ptr<RouteList>, bool yn, bool group_override);
|
||||
void rt_set_just_one_solo (boost::shared_ptr<RouteList>, bool yn, bool /* ignored*/ );
|
||||
void rt_set_mute (boost::shared_ptr<RouteList>, bool yn, bool group_override);
|
||||
|
|
|
@ -145,6 +145,8 @@ Route::init ()
|
|||
_input->changed.connect_same_thread (*this, boost::bind (&Route::input_change_handler, this, _1, _2));
|
||||
_input->PortCountChanging.connect_same_thread (*this, boost::bind (&Route::input_port_count_changing, this, _1));
|
||||
|
||||
_output->changed.connect_same_thread (*this, boost::bind (&Route::output_change_handler, this, _1, _2));
|
||||
|
||||
/* add amp processor */
|
||||
|
||||
_amp.reset (new Amp (_session));
|
||||
|
@ -2820,32 +2822,64 @@ Route::nonrealtime_handle_transport_stopped (bool /*abort_ignored*/, bool did_lo
|
|||
_roll_delay = _initial_delay;
|
||||
}
|
||||
|
||||
/** Called with the process lock held if change contains ConfigurationChanged */
|
||||
void
|
||||
Route::input_change_handler (IOChange change, void * /*src*/)
|
||||
{
|
||||
bool need_to_queue_solo_change = true;
|
||||
|
||||
if ((change.type & IOChange::ConfigurationChanged)) {
|
||||
/* This is called with the process lock held if change
|
||||
contains ConfigurationChanged
|
||||
*/
|
||||
need_to_queue_solo_change = false;
|
||||
configure_processors (0);
|
||||
_phase_invert.resize (_input->n_ports().n_audio ());
|
||||
io_changed (); /* EMIT SIGNAL */
|
||||
}
|
||||
|
||||
if (_fed_by.size() == 0 && _soloed_by_others_upstream) {
|
||||
cerr << _name << ": input change, connected ? " << _input->connected() << endl;
|
||||
|
||||
if (!_input->connected() && _soloed_by_others_upstream) {
|
||||
if (need_to_queue_solo_change) {
|
||||
_session.cancel_solo_after_disconnect (shared_from_this());
|
||||
_session.cancel_solo_after_disconnect (shared_from_this(), true);
|
||||
} else {
|
||||
cancel_solo_after_disconnect ();
|
||||
cancel_solo_after_disconnect (true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Route::cancel_solo_after_disconnect ()
|
||||
Route::output_change_handler (IOChange change, void * /*src*/)
|
||||
{
|
||||
_soloed_by_others_upstream = 0;
|
||||
bool need_to_queue_solo_change = true;
|
||||
|
||||
if ((change.type & IOChange::ConfigurationChanged)) {
|
||||
/* This is called with the process lock held if change
|
||||
contains ConfigurationChanged
|
||||
*/
|
||||
need_to_queue_solo_change = false;
|
||||
}
|
||||
|
||||
cerr << _name << ": output change, connected ? " << _output->connected() << endl;
|
||||
|
||||
if (!_output->connected() && _soloed_by_others_downstream) {
|
||||
if (need_to_queue_solo_change) {
|
||||
_session.cancel_solo_after_disconnect (shared_from_this(), false);
|
||||
} else {
|
||||
cancel_solo_after_disconnect (false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Route::cancel_solo_after_disconnect (bool upstream)
|
||||
{
|
||||
cerr << _name << " CSAD upstream ? " << upstream << endl;
|
||||
if (upstream) {
|
||||
_soloed_by_others_upstream = 0;
|
||||
} else {
|
||||
_soloed_by_others_downstream = 0;
|
||||
}
|
||||
set_mute_master_solo ();
|
||||
solo_changed (false, this);
|
||||
}
|
||||
|
|
|
@ -72,20 +72,20 @@ Session::rt_set_solo (boost::shared_ptr<RouteList> rl, bool yn, bool /* group_ov
|
|||
}
|
||||
|
||||
void
|
||||
Session::cancel_solo_after_disconnect (boost::shared_ptr<Route> r, SessionEvent::RTeventCallback after)
|
||||
Session::cancel_solo_after_disconnect (boost::shared_ptr<Route> r, bool upstream, SessionEvent::RTeventCallback after)
|
||||
{
|
||||
boost::shared_ptr<RouteList> rl (new RouteList);
|
||||
rl->push_back (r);
|
||||
|
||||
queue_event (get_rt_event (rl, false, after, false, &Session::rt_cancel_solo_after_disconnect));
|
||||
queue_event (get_rt_event (rl, upstream, after, false, &Session::rt_cancel_solo_after_disconnect));
|
||||
}
|
||||
|
||||
void
|
||||
Session::rt_cancel_solo_after_disconnect (boost::shared_ptr<RouteList> rl, bool /*yn */, bool /* group_override */)
|
||||
Session::rt_cancel_solo_after_disconnect (boost::shared_ptr<RouteList> rl, bool upstream, bool /* group_override */)
|
||||
{
|
||||
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
||||
if (!(*i)->is_hidden()) {
|
||||
(*i)->cancel_solo_after_disconnect ();
|
||||
(*i)->cancel_solo_after_disconnect (upstream);
|
||||
}
|
||||
}
|
||||
/* no need to call set-dirty - the disconnect will already have done that */
|
||||
|
|
Loading…
Reference in New Issue
Block a user