#include "ardour/session.h"
#include "ardour/solo_control.h"
-#include "i18n.h"
+#include "pbd/i18n.h"
using namespace ARDOUR;
using namespace std;
void
SoloControl::clear_all_solo_state ()
{
- // ideally this function will never do anything, it only exists to forestall Murphy
+ bool change = false;
-#ifndef NDEBUG
- // these are really debug messages, but of possible interest.
if (self_soloed()) {
- PBD::info << string_compose (_("Cleared Explicit solo: %1\n"), name());
+ PBD::info << string_compose (_("Cleared Explicit solo: %1\n"), name()) << endmsg;
+ actually_set_value (0.0, Controllable::NoGroup);
+ change = true;
}
- if (_soloed_by_others_upstream || _soloed_by_others_downstream) {
- PBD::info << string_compose (_("Cleared Implicit solo: %1 up:%2 down:%3\n"),
- name(), _soloed_by_others_upstream, _soloed_by_others_downstream);
+
+ if (_soloed_by_others_upstream) {
+ PBD::info << string_compose (_("Cleared upstream solo: %1 up:%2\n"), name(), _soloed_by_others_upstream)
+ << endmsg;
+ _soloed_by_others_upstream = 0;
+ change = true;
}
-#endif
- _soloed_by_others_upstream = 0;
- _soloed_by_others_downstream = 0;
+ if (_soloed_by_others_downstream) {
+ PBD::info << string_compose (_("Cleared downstream solo: %1 down:%2\n"), name(), _soloed_by_others_downstream)
+ << endmsg;
+ _soloed_by_others_downstream = 0;
+ change = true;
+ }
- set_self_solo (false);
_transition_into_solo = 0; /* Session does not need to propagate */
- Changed (false, Controllable::UseGroup); /* EMIT SIGNAL */
+
+ if (change) {
+ Changed (false, Controllable::NoGroup); /* EMIT SIGNAL */
+ }
}
int
-SoloControl::set_state (XMLNode const & node, int)
+SoloControl::set_state (XMLNode const & node, int version)
{
+ if (SlavableAutomationControl::set_state(node, version)) {
+ return -1;
+ }
+
XMLProperty const * prop;
if ((prop = node.property ("self-solo")) != 0) {
_transition_into_solo = 0;
+ /* Notice that we call get_boolean_masters() BEFORE we call
+ * update_boolean_masters_records(), in order to know what
+ * our master state was BEFORE it gets changed.
+ */
+
if (m->get_value()) {
/* this master is now enabled */
if (!self_soloed() && get_boolean_masters() == 0) {
+ /* not self-soloed, wasn't soloed by masters before */
send_signal = true;
_transition_into_solo = 1;
}
} else {
if (!self_soloed() && get_boolean_masters() == 1) {
+ /* not self-soloed, soloed by just 1 master before */
_transition_into_solo = -1;
send_signal = true;
}