class MeasureBase::repeatFlags() - replaced by new methods???

• Apr 16, 2016 - 17:36

I see that MeasureBase::repeatFlags() no longer exists, but there are some new methods/properties that seem to aim to replace it (measurebase.h line 169):{syntaxhighlighter SPEC}
bool repeatEnd() const { return _repeatEnd; }
bool repeatStart() const { return _repeatStart; }
bool repeatMeasure() const { return _repeatMeasure; }
bool repeatJump() const { return _repeatJump; }
{/syntaxhighlighter}

Am I correct in these assumptions?

Also note that the class Repeat still exists, will it be disappearing soon? It's convenient to be able to store a repeatFlags variable of type Repeat, and do bitwise comparisons; why did this change to a potentially less convenient structure? If these new boolean methods are the only way to get repeat information, then I'll have to change my one class Repeat variable to multiple boolean variables, which seems like a step in the wrong direction. If I'm wrong about this, please set me straight. Thanks.


Comments

FWIW, technical questions about the source code are better suited to the developers mailing list. Realistically, questions about the extensive changes made for the new layout can probably only be answered by Werner at this point.

In reply to by sideways

See the "Development" link in menu at right of this page for info on the devdelopers mailing list, the IRC channel, and other resources for development. But Werner is almot never on IRC, which is why I suggested the mailing list. For development-related discussions that don't require his input, IRC is often the best place to go.

update: It turns out that I have no need for Repeat::NONE, I remembered using it, but upon digging I found nothing. Except for the fact that there is only one place where the current master uses it, here: https://github.com/musescore/MuseScore/blob/master/mscore/importgtp.cpp…

So I will not be creating a PR for this. I can however confirm that the new isXXX() functions do replace Measure::repeatFlags() for what I need to do, and clearly for what MuseScore/master needs to do. I don't know if importgtp.cpp is even used, but if it is, there you go.

I assume that class Repeat will go away soon. I am no longer using it.

original post
The main issue I'm seeing is that there is no replacement for Repeat::NONE. I am going to create a new branch and create a bool repeatNone() function that looks like this:
{syntaxhighlighter SPEC}
bool repeatNone() const {return !_repeatEnd && !_repeatStart && !_repeatMeasure && !_repeatJump;}
{/syntaxhighlighter}

I'm post a new issue and PR in a little while... Hopefully y'all are comfortable with a small mod to measurebase.h.

Do you still have an unanswered question? Please log in first to post your question.