fix #4405, by explicitly cancelling solo when a route's inputs drop to zero
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 25 Jan 2012 15:30:02 +0000 (15:30 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 25 Jan 2012 15:30:02 +0000 (15:30 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@11346 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/ardour/route.h
libs/ardour/ardour/session.h
libs/ardour/route.cc
libs/ardour/session_rtevents.cc

index 1724439dc2d2b45610c340fd161f0d3ee80e88ff..5c776278771212dab5f0ac86d199f1be7dda7062 100644 (file)
@@ -148,6 +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 ();
 
        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; }
index 1df8ac6c49d84046275236b6070ed6a2cf9b7e46..885b5aae24c01e13f5a88f3f9fb929515039f617 100644 (file)
@@ -618,6 +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 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);
@@ -1477,6 +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_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);
index 0f04a3743d8bdf2e46561d7f8eebfda95c269662..9233a77b147a029a435e76408882ccabcbd20c3a 100644 (file)
@@ -2824,11 +2824,30 @@ Route::nonrealtime_handle_transport_stopped (bool /*abort_ignored*/, bool did_lo
 void
 Route::input_change_handler (IOChange change, void * /*src*/)
 {
+       bool need_to_queue_solo_change = true;
+
        if ((change.type & IOChange::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) {
+               if (need_to_queue_solo_change) {
+                       _session.cancel_solo_after_disconnect (shared_from_this());
+               } else {
+                       cancel_solo_after_disconnect ();
+               }
+       }
+}
+
+void
+Route::cancel_solo_after_disconnect ()
+{
+       _soloed_by_others_upstream = 0;
+       set_mute_master_solo ();
+       solo_changed (false, this);
 }
 
 uint32_t
index ca1ee319c7d93e32c7497c2a52dbf84547977148..43d291c45870b239d51e513a2f43e71eb14a41b1 100644 (file)
@@ -71,6 +71,26 @@ Session::rt_set_solo (boost::shared_ptr<RouteList> rl, bool yn, bool /* group_ov
        set_dirty();
 }
 
+void
+Session::cancel_solo_after_disconnect (boost::shared_ptr<Route> r, 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));
+}
+
+void
+Session::rt_cancel_solo_after_disconnect (boost::shared_ptr<RouteList> rl, bool /*yn */, bool /* group_override */)
+{
+       for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
+               if (!(*i)->is_hidden()) {
+                       (*i)->cancel_solo_after_disconnect ();
+               }
+       }
+       /* no need to call set-dirty - the disconnect will already have done that */
+}
+
 void
 Session::set_just_one_solo (boost::shared_ptr<Route> r, bool yn, SessionEvent::RTeventCallback after)
 {