MeasureBase::_repeatMeasure inconsistent interpretation when some but not all staves contain measure repeat symbols

• Oct 6, 2016 - 09:45
Reported version
3.0
Type
Functional
Severity
S4 - Minor
Status
closed
Project

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:

  1. start with a multi-stave score.
  2. 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….
  3. now go add a measure repeat symbol to another stave of that same measure. Doing this won't change the value of _repeatMeasure.
  4. 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