How to distinguish a local TimeSig from a global TimeSig?
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 What you say makes sense. I… 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();
inedit.cpp
intoFraction stretch = (ns / fm->timesig());
(remove.reduced()
). HoweverFraction::operator/
already contains areduced()
so this doesn't work without changingFraction.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.
In reply to I was thinking of another… by njvdberg
I thought of the not reducing trick also, but then my head start spinning when I considered the opposite situation - global is 6/8, local is 3/4, and how we differentiate them. Maybe it's more obvious when looking at the code or stepping through in a debugger.