Skip to content

Commit

Permalink
fix #56151: instrument change not muting on solo
Browse files Browse the repository at this point in the history
  • Loading branch information
lasconic committed Apr 14, 2015
1 parent 29b21f7 commit 1143189
Showing 1 changed file with 25 additions and 13 deletions.
38 changes: 25 additions & 13 deletions mscore/mixer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,30 +338,42 @@ void PartEdit::soloToggled(bool val)
if (val) {
mute->setChecked(false);
for (Part* p : part->score()->parts()) {
for (Channel* a : p->instrument()->channel()) {
a->soloMute = (channel != a && !a->solo);
a->solo = (channel == a || a->solo);
if (a->soloMute)
seq->stopNotes(a->channel);
const InstrumentList* il = p->instruments();
for (auto i = il->begin(); i != il->end(); ++i) {
const Instrument* instr = i->second;
for (Channel* a : instr->channel()) {
a->soloMute = (channel != a && !a->solo);
a->solo = (channel == a || a->solo);
if (a->soloMute)
seq->stopNotes(a->channel);
}
}
}
emit soloChanged(true);
}
else { //do nothing except if it's the last solo to be switched off
bool found = false;
for (Part* p : part->score()->parts()) {
for (Channel* a : p->instrument()->channel()) {
if (a->solo){
found = true;
break;
}
const InstrumentList* il = p->instruments();
for (auto i = il->begin(); i != il->end(); ++i) {
const Instrument* instr = i->second;
for (Channel* a : instr->channel()) {
if (a->solo){
found = true;
break;
}
}
}
}
if (!found){
foreach(Part* p, part->score()->parts()) {
for (Channel* a : p->instrument()->channel()) {
a->soloMute = false;
a->solo = false;
const InstrumentList* il = p->instruments();
for (auto i = il->begin(); i != il->end(); ++i) {
const Instrument* instr = i->second;
for (Channel* a : instr->channel()) {
a->soloMute = false;
a->solo = false;
}
}
}
emit soloChanged(false);
Expand Down

0 comments on commit 1143189

Please sign in to comment.