How to distinguish a local TimeSig from a global TimeSig?

• Jan 17, 2020 - 20:31

When looking into #299246: Hiding courtesy time signature only works for the first staff I saw the method isLocal() in class TimeSig returns _stretch != Fraction(1,1).
This puzzles me because if I have a piece in 3/4, a local TimeSig 5/4 has a stretch of 4/5. Now isLocal() returns true, as expected. However, if there is a local TimeSig 6/8, the stretch is 1/1. For the function of the stretch I can understand this but for such local TimeSig isLocal() will return false and the TimeSig is seen as a global TimeSig.

It seems to me a we need a different way to discriminate a local form a global TimeSig. Do I overlook something?


Comments

What you say makes sense. I suppose we should add a flag. not sure if it needs to be fully exposed as a property and written to the file or if this can be properly established on read as is.

In reply to by Marc Sabatella

I was thinking of another approach: Do not reduce stretch for the TimeSig. This should be easy by changing Fraction stretch = (ns / fm->timesig()).reduced(); in edit.cpp into Fraction stretch = (ns / fm->timesig()); (remove .reduced()). However Fraction::operator/ already contains a reduced() so this doesn't work without changing Fraction.h which isn't a very good idea, I think.
I will try to add a new flag and see whether it should be fully exposed or not.

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