MeasureBase::_repeatMeasure inconsistent interpretation when some but not all staves contain measure repeat symbols
I haven't tested this, but I can tell just by looking at the code that there is a logical error in the setting & unsetting of the boolean _repeatMeasure:
- start with a multi-stave score.
- add a single measure repeat symbols to one stave of a particular measure. Doing this will set the value _repeatMeasure to true here https://github.com/musescore/MuseScore/blob/master/libmscore/segment.cp… and that will cause MeasureBase::getProperty(P_ID::REPEAT_MEASURE) to return true for that measure here https://github.com/musescore/MuseScore/blob/master/libmscore/measurebas….
- now go add a measure repeat symbol to another stave of that same measure. Doing this won't change the value of _repeatMeasure.
- now remove ONE of those measure repeat symbols. Doing this once will set the value of _repeatMeasure to be false here https://github.com/musescore/MuseScore/blob/master/libmscore/segment.cp…
But now we are in a situation where that measure contains a repeat measure element in one stave, but the value of _repeatMeasure is set to false, so MeasureBase::getProperty(P_ID::REPEAT_MEASURE) will return false.
The problem is that when some but not all staves of a measure contain a repeat measure symbol, the value of _repeatMeasure could sometimes be true but sometime be false depending on whether the user previously removed another repeat measure symbol from that measure.
Now the good news is that I don't think that this will currently cause any incorrect behavior, because I can't find anywhere in the code where P_ID::REPEAT_MEASURE is used outside of MeasureBase::getProperty and setProperty.
But this is causing me a headache when implementing #10220: Add a two and four measure (multi-measure) repeat sign with playback because the meaning of this boolean is unclear for measures with multiple-stave. I'd prefer removing this property or replacing it with a more meaningful property.
Comments
I think _repeatMeasure and all the construct around it is not used. I tried to remove it here https://github.com/musescore/MuseScore/pull/2858
ok, thanks for removing that. I couldn't determine if it was used anywhere either, and it was just confusing me.
Fixed in branch master, commit 66dc473364
fix #127556: remove _repeatMeasure property from MeasureBase
Fixed in branch master, commit b88917831d
Merge pull request #2858 from lasconic/fix-127556
fix #127556: remove _repeatMeasure property from MeasureBase
Automatically closed -- issue fixed for 2 weeks with no activity.