summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2012-01-25 21:19:48 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2012-01-25 21:19:48 +0000
commit9b3aefec1b0da4b838ecc90df7080be539b2edba (patch)
tree1b6a5b4006c7c0af02d2f0cef3836253588ef263 /libs
parent18bc80a01c7154569f49d4c33b92e5753b65b438 (diff)
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
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/ardour/route.h2
-rw-r--r--libs/ardour/ardour/session.h4
-rw-r--r--libs/ardour/route.cc46
-rw-r--r--libs/ardour/session_rtevents.cc8
4 files changed, 47 insertions, 13 deletions
diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h
index 5c77627877..a0f9573562 100644
--- a/libs/ardour/ardour/route.h
+++ b/libs/ardour/ardour/route.h
@@ -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; }
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index 885b5aae24..ee9c457ca4 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -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);
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc
index 9233a77b14..645addd7ab 100644
--- a/libs/ardour/route.cc
+++ b/libs/ardour/route.cc
@@ -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);
}
diff --git a/libs/ardour/session_rtevents.cc b/libs/ardour/session_rtevents.cc
index 43d291c458..b5328a1548 100644
--- a/libs/ardour/session_rtevents.cc
+++ b/libs/ardour/session_rtevents.cc
@@ -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 */