Moves global update of solo state and emission of Session::SoloChanged to
a single point after 1 to N solo controls are changed.
Also avoid unnecessarily emitted Activated() signal for listen controls,
though Process::{activate,deactive}() should probably be redesigned to
avoid this in a "deeper" way
Route::set_listen (bool yn)
{
if (_monitor_send) {
Route::set_listen (bool yn)
{
if (_monitor_send) {
+ if (_monitor_send->active() == yn) {
+ return;
+ }
if (yn) {
_monitor_send->activate ();
} else {
if (yn) {
_monitor_send->activate ();
} else {
-
- update_route_solo_state ();
void
Session::route_solo_changed (bool self_solo_changed, Controllable::GroupControlDisposition group_override, boost::weak_ptr<Route> wpr)
{
void
Session::route_solo_changed (bool self_solo_changed, Controllable::GroupControlDisposition group_override, boost::weak_ptr<Route> wpr)
{
- DEBUG_TRACE (DEBUG::Solo, string_compose ("route solo change, self = %1\n", self_solo_changed));
+ DEBUG_TRACE (DEBUG::Solo, string_compose ("route solo change, self = %1, update\n", self_solo_changed));
boost::shared_ptr<Route> route (wpr.lock());
boost::shared_ptr<Route> route (wpr.lock());
RouteGroup* rg = route->route_group ();
const bool group_already_accounted_for = (group_override == Controllable::ForGroup);
RouteGroup* rg = route->route_group ();
const bool group_already_accounted_for = (group_override == Controllable::ForGroup);
+ DEBUG_TRACE (DEBUG::Solo, string_compose ("propagate to session, group accounted for ? %1\n", group_already_accounted_for));
+
if (delta == 1 && Config->get_exclusive_solo()) {
/* new solo: disable all other solos, but not the group if its solo-enabled */
if (delta == 1 && Config->get_exclusive_solo()) {
/* new solo: disable all other solos, but not the group if its solo-enabled */
DEBUG_TRACE (DEBUG::Solo, "propagation complete\n");
DEBUG_TRACE (DEBUG::Solo, "propagation complete\n");
- update_route_solo_state (r);
-
/* now notify that the mute state of the routes not involved in the signal
pathway of the just-solo-changed route may have altered.
*/
/* now notify that the mute state of the routes not involved in the signal
pathway of the just-solo-changed route may have altered.
*/
for (RouteList::iterator i = uninvolved.begin(); i != uninvolved.end(); ++i) {
DEBUG_TRACE (DEBUG::Solo, string_compose ("mute change for %1, which neither feeds or is fed by %2\n", (*i)->name(), route->name()));
(*i)->act_on_mute ();
for (RouteList::iterator i = uninvolved.begin(); i != uninvolved.end(); ++i) {
DEBUG_TRACE (DEBUG::Solo, string_compose ("mute change for %1, which neither feeds or is fed by %2\n", (*i)->name(), route->name()));
(*i)->act_on_mute ();
- (*i)->mute_control()->Changed (false, Controllable::NoGroup);
+ /* Session will emit SoloChanged() after all solo changes are
+ * complete, which should be used by UIs to update mute status
+ */
-
- SoloChanged (); /* EMIT SIGNAL */
- set_dirty();
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
if ((*i)->can_solo()) {
if (Config->get_solo_control_is_listen_control()) {
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
if ((*i)->can_solo()) {
if (Config->get_solo_control_is_listen_control()) {
- if ((*i)->self_soloed() || (*i)->solo_control()->get_masters_value()) {
+ if ((*i)->solo_control()->soloed_by_self_or_masters()) {
listeners++;
something_listening = true;
}
} else {
(*i)->set_listen (false);
listeners++;
something_listening = true;
}
} else {
(*i)->set_listen (false);
- if ((*i)->can_solo() && ((*i)->self_soloed() || (*i)->solo_control()->get_masters_value())) {
+ if ((*i)->can_solo() && (*i)->solo_control()->soloed_by_self_or_masters()) {
something_soloed = true;
}
}
something_soloed = true;
}
}
DEBUG_TRACE (DEBUG::Solo, string_compose ("solo state updated by session, soloed? %1 listeners %2 isolated %3\n",
something_soloed, listeners, isolated));
DEBUG_TRACE (DEBUG::Solo, string_compose ("solo state updated by session, soloed? %1 listeners %2 isolated %3\n",
something_soloed, listeners, isolated));
+
+
+ SoloChanged (); /* EMIT SIGNAL */
+ set_dirty();
void
Session::rt_set_controls (boost::shared_ptr<ControlList> cl, double val, Controllable::GroupControlDisposition gcd)
{
void
Session::rt_set_controls (boost::shared_ptr<ControlList> cl, double val, Controllable::GroupControlDisposition gcd)
{
+ /* Note that we require that all controls in the ControlList are of the
+ same type.
+ */
+ if (cl->empty()) {
+ return;
+ }
+
for (ControlList::iterator c = cl->begin(); c != cl->end(); ++c) {
(*c)->set_value (val, gcd);
}
for (ControlList::iterator c = cl->begin(); c != cl->end(); ++c) {
(*c)->set_value (val, gcd);
}
+
+ /* some controls need global work to take place after they are set. Do
+ * that here.
+ */
+
+ switch (cl->front()->parameter().type()) {
+ case SoloAutomation:
+ update_route_solo_state ();
+ break;
+ default:
+ break;
+ }