Commit graph

24 commits

Author SHA1 Message Date
Dmitri Ovodok
baa17ff0d0 Correct fraction to ticks conversion for negative numbers
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).
2019-04-13 13:07:40 +03:00
Dmitri Ovodok
c789322faa Allow copy-pasting hairpins and hairpin+dynamics combinations 2019-03-27 10:24:08 +02:00
Dmitri Ovodok
7177cf8203 Extract propertyToString and propertyToString 2019-03-14 15:11:40 +02:00
Margus Niitsoo
70868cdd05 Moved fractions computation to .h file, unrolled gcd, made computations more efficient 2019-02-19 16:10:02 +02:00
ws
e8be7686eb fix fraction merge bugs
The following regression tests fail and are temporarily commented out:
- tst_mxml_io
- tst_guitarpro
- tst_scripting
- tst_runscripts
2019-02-18 11:47:31 +01:00
ws
ec3be9a99a Replacd integer midi tick values by fractions.
- 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
2019-02-18 11:46:05 +01:00
Dmitri Ovodok
ea81a9338c Add a new QML plugins API
- 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.
2019-01-24 17:36:05 +03:00
mirabilos
f941562f8a Fix build without SCRIPT_INTERFACE on Qt 5.7
* 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.
2019-01-24 17:36:01 +03:00
Dmitri Ovodok
2bd75bb3a7 Fix fermata time stretch handling on partial re-layout 2019-01-10 14:58:19 +03:00
Dmitri Ovodok
613a81da6e Add a conversion from Fraction to QString 2018-10-29 17:32:55 +02:00
Werner Schweer
e23ca8c80a update script interface 2017-02-27 12:19:30 +01:00
Werner Schweer
90b1991912 replace Q_OBJECT with Q_GADGET for all Element based classes 2017-02-17 15:48:28 +01:00
werner
b85cad9d83 replace ticks in mscore file by fraction 2016-07-07 16:20:29 +02:00
ws
841ce00af4 re-add linear layout 2016-04-13 12:05:47 +02:00
ws
9f933d8503 Layout reorganization 2016-04-13 11:05:04 +02:00
ws
64d9689e16 fix compilation without script interface 2015-05-07 11:36:27 +02:00
ws
7776d96720 expose Fraction to script interface 2015-04-07 10:26:33 +02:00
Joachim Schmitz
27ba0bada7 some purly cosmetic changes
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
2014-05-12 12:28:07 +02:00
Andrey M. Tokarev
57c69a6421 All midi import base on fractions 2013-07-13 14:48:44 +04:00
Andrey M. Tokarev
8587f8ef64 Refactoring of quantization 2013-05-27 03:48:38 +04:00
ws
9ebabcc2e5 add namespace Ms 2013-05-13 19:43:59 +02:00
ws
220db94494 reorganize synthesizer; add zita1 reverb 2013-04-03 12:50:21 +02:00
Werner Schweer
76e22b7ec7 polishing the plugin subsystem 2012-07-18 14:54:44 +02:00
Werner Schweer
1f9ccfcdce add libmscore
git-subtree-dir: libmscore
git-subtree-mainline: 412ca45401
git-subtree-split: 6047361bd0
2012-05-26 14:54:47 +02:00