The previous formula was erroneous for negative numbers due to the
rounding method: it relied on integer division result being rounded
down while it is actually rounded to zero (or, in older language
standards - unspecified). This makes a difference for negative
numbers, and the ticks result often (always?) differed from the
correct result by 1.
This commit corrects the calculation by making the rounding happen
only for positive integer numbers division (denominator is assumed
to be positive within Fraction class).
- tick names a position on the time axis
- tick is always a Fraction()
- only Measure() and Segment() (and Tuplet?) have a tick value
- tick() for an generic element return only a sensible value if isMeasure() or isSegment() or isSegment(parent())
- "ticks" names a duration stored in a Fraction()
- the tick value for an Segment is relative to its measure
- rename "duration" to "ticks"
- rename afrac() to tick()
- rename rfrac() to rtick()
- rename some variables, changing "fraction" into "tick"
(example: actualFraction() into actualTicks())
- Lyrics ticks are written as Fraction, on read if xmlreader sees a "/" it reads a fraction
else midi ticks for backwards compatibility
- Move Qml plugin engine out of libmscore
- Add Pid::TICK handling to Element class
- Make tick QML property correspond to absolute tick in all contexts
That is a temporary solution though, a proper solution would
require revising Pid::TICK handling
- Move plugins API to api directory
- Rename ElementW -> Element (PluginAPI namespace)
- Remove Qt meta-object macros from Score in libmscore
- Remove string-based access to properties from QML
- Remove unused functions from Note
- Rename QML properties names to camel case
Two reasons:
- They were named so in MuseScore 2.X.
- Using underscored_names is less consistent with MuseScore
coding style.
* without SCRIPT_INTERFACE, Qt 5.7 is enough
* cursor.cpp depends on FractionWrapper
* backwards-compatible QString + QStringRef construction
* let Q_NAMESPACE and Q_ENUM_NS depend on SCRIPT_INTERFACE
* Ms::Direction must be Q_DECLARE_METATYPE
* elide plugin-related headers from the build without SCRIPT_INTERFACE
* supply matching ifdefs for pluginManager calls in main code
This is based on changes by ABL <antonio.lotti@alice.it>
and I merely made it rely on the SCRIPT_INTERFACE compilation
option more (so it does not break anything when SCRIPT_INTERFACE
is on — that is, by default), to make backporting this easier.
Add header defining DBL_MIN and DBL_MAX, and add multiple
inclusion guards around "config.h" as it’s included in many
places.
adding semicolons for Q_DECLARE_METATYPE() and
Q_DECLARE_OPERATORS_FOR_FLAGS(), removing semicolons from Q_PROPERTY()
(QtCreator complains about them) and fixing a comment, reformatting for
alignment