Commit graph

66 commits

Author SHA1 Message Date
Marc Sabatella
ec6f167f0b fix #286645: scale elements 2019-04-11 06:36:32 -06: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
c95dfd5a40 Make it possible to record elements written to MSCX 2018-10-29 16:30:19 +02:00
ws
6dbff17ca7 fix compat114 issues 2018-10-26 10:41:30 +02:00
Dmitri Ovodok
c354eb24c3 Remove read300 functions 2018-09-19 01:57:37 +03:00
Andres Fernandez de Prado
33dff96a20 This commit contains changes required for MuseScore to compile under MSVC with no warnings.
This commit contains changes required for MuseScore to compile under MSVC with no warnings.

MuseScore is being compiled with the /W4 setting (warning level 4), which is similar to -wall -wextra on clang. This generates lots of warnings on MSVC, mainly for non-standard constructs and for constructs which might be bugs or might lead to bugs.

Most warnings are in the following categories:
- Name hiding: a variable hides a variable with the same name on a larger scope (or a field, or a function parameter). This can easily lead to bugs, and it is a best practice to avoid hiding variable names (see recommendation ES.12 in the C++ Core Guidelines by Stroustrop & Sutter (http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-reuse : ES.12: Do not reuse names in nested scopes)
- Narrowing conversion: a numeric conversion results in loss of significant digits (for example, double -> float). The general recommendation is to use a cast to indicate this is designed behaviour.
- Unreachable code: in several instances, there is unreachable code. The unreachable code is commented out.
- (Potentially) uninitialized local variable. Just initialized the vars.
- foreach(,) -> for(:): this does not generate a warning per-se (only a few of these generate warnings due to name hiding), but changed in keeping with "MuseScore Coding Rules" (https://musescore.org/en/handbook/musescore-coding-rules#Loops), which tells explicitly "Use C++11's "for" instead of Qt's "foreach":" ... "If you happen to be fixing some code and see a "foreach", please change that loop into a "for"."

Most changes are in the categories indicated above. The next listing shows detailed changes for files which are *not* of the aforementioned types.

- all.h: Disable warning C4127 (conditional expression is constant - generated in Qt header file qvector.h)
- awl/aslider.h: unreachable code.
- awl/knob.cpp: name hiding
- awl/mslider.cpp: name hiding
- awl/slider.cpp: name hiding
- bww2mxml/parser.cpp: name hiding
- effects/compressor/compressor.cpp: narrowing conversion
- effects/zita1/zitagui.cpp: name hiding
- fluid/fluid.cpp: foreach replacement. Name hiding.
- fluid/mod.cpp: name hiding.
- fluid/sfont.cpp: foreach replacement. Name hiding. Initialize vars.
- fluid/voice.cpp: Name hiding.
- libmscore/accidental.cpp: Name hiding.
- libmscore/ambitus.cpp: Initialize vars.
- libmscore/barline.cpp: Name hiding. Unreachable code.
- libmscore/beam.cpp: Name hiding.
- libmscore/chordrest.cpp: Unreachable code.
- libmscore/scorefile.cpp: Name hiding.
- manual/genManual.cpp: Name hiding. foreach replacement.
- midi/midifile.cpp: Name hiding. Unreachable code.
- omr/importpdf.cpp: Name hiding. foreach replacement.
- omr/omr.cpp: Name hiding. foreach replacement.
- omr/omrpage.cpp: Name hiding. foreach replacement.
- omr/omrview.cpp: Name hiding. foreach replacement.
- synthesizer/event.cpp: Unreachable code.
- zerberus\channel.cpp: Narrowing conversion.
- zerberus\instrument.cpp: Name hiding.
- zerberus\sfz.cpp: Name hiding.
- zerberus\voice.h: Suppress warning C4201: "nonstandard extension used: nameless struct/union"
- zerberus\zerberus.cpp: Name hiding. Unreferenced parameter.
- zerberus\zerberusgui.cpp: Name hiding.
2018-08-03 09:15:42 +02:00
ws
175d5aadb3 cleanup ElementFlags interface, use more Placement properties on mxml import/export 2018-07-04 12:41:14 +02:00
ws
33d1cd7fb4 rename StyleIdx -> Sid and P_ID -> Pid 2018-03-27 15:36:00 +02:00
Werner Schweer
1943bd1ff1 replace most static_cast in libmscore 2017-12-20 16:49:58 +01:00
divya-urs
28d4e39b05 accessibility: nextElement and prevElement 2017-07-13 23:52:00 +05:30
lasconic
dee95b59e9 add screenreader info for text and dynamics 2017-06-15 17:01:47 +02:00
Werner Schweer
867f2582f6 move Segment::Type into SegmentType 2017-03-08 13:12:26 +01:00
Werner Schweer
90b1991912 replace Q_OBJECT with Q_GADGET for all Element based classes 2017-02-17 15:48:28 +01:00
Joachim Schmitz
39c4224c4c fix #166231: Ambitus gets reported an octave to high
in Inspector, status bar and screen reader.
Also getting rid of superfluos backslashes and an unneded code
duplication
2017-01-30 09:20:12 +01:00
Werner Schweer
1d4c6b2f21 move Element::type() to ScoreElement 2017-01-18 14:16:33 +01:00
Werner Schweer
660b393b98 change StaffType interface 2016-12-14 15:44:24 +01:00
Werner Schweer
c5f46bb208 rename Xml() -> XmlWriter() 2016-11-19 11:51:21 +01:00
lasconic
9ef6f6d97e Change storage of notehead type and group in Ambitus 2016-10-18 17:58:38 +02:00
Werner Schweer
b511d0a490 section break implies line break 2016-10-13 14:28:00 +02:00
werner
1a8cdf1da4 remove many setLayoutAll() calls; cleanups 2016-06-14 10:32:34 +02:00
ws
bd17c1b08b fix #109016: part extraction and ambitus 2016-05-25 12:10:52 +02:00
ZackTheCardshark
cdc82364e4 Fix #100396: change "note heads" to "noteheads"
See http://music.stackexchange.com/questions/42722/notehead-or-note-head

(also correct "fo" to "for" in comment)
2016-05-02 21:22:29 -04:00
ws
9db0540ad2 fix Spatium/QVariant conversions 2016-04-13 11:35:22 +02:00
ws
bbd802f8ae framework for partial relayout 2016-04-13 11:35:21 +02:00
ws
492709f203 code cleanups 2016-04-13 11:10:17 +02:00
ws
9f933d8503 Layout reorganization 2016-04-13 11:05:04 +02:00
ws
6f2cf4c2c1 fix build for gcc 5.2 2015-10-27 11:30:09 +01:00
Maurizio M. Gavioli
a658b39b13 Ambitus: Ignore non-played notes
While calculating (or updating) the range of an ambitus element, notes with the `play` flag turned off are now ignored.

For a specific request, see: https://musescore.org/en/node/69476

The request was about ignoring cue notes; as cue notes are not categorized as such in the programme and what really counts is the play/non-play flag, I decided to use it as a criterion.
2015-07-18 11:13:28 +02:00
ws
e9222d1b45 move enums Accidental::Role and ::Type 2015-04-03 18:24:12 +02:00
Marc Sabatella
a52827e501 add ability to turn off automatic capitalization of chord symbols 2014-12-17 12:37:06 -07:00
Marc Sabatella
fbdd224791 add chord symbol style options: full german, french, lwoer case bass, all caps note names 2014-12-10 00:12:00 -07:00
lasconic
66a3e5c6a6 fix #30471 2014-08-22 16:52:31 +02:00
Andrei Tuicu
c3ff25358b fix 30281
Fix readability
Optimize string allocation
	modified:   libmscore/accidental.cpp
	modified:   libmscore/ambitus.cpp
	modified:   libmscore/articulation.cpp
	modified:   libmscore/barline.cpp
	modified:   libmscore/chord.cpp
	modified:   libmscore/chordline.cpp
	modified:   libmscore/chordrest.cpp
	modified:   libmscore/dynamic.cpp
	modified:   libmscore/fingering.cpp
	modified:   libmscore/hairpin.cpp
	modified:   libmscore/harmony.cpp
	modified:   libmscore/jump.cpp
	modified:   libmscore/keysig.cpp
	modified:   libmscore/marker.cpp
	modified:   libmscore/measure.cpp
	modified:   libmscore/note.cpp
	modified:   libmscore/ottava.cpp
	modified:   libmscore/rest.cpp
	modified:   libmscore/score.h
	modified:   libmscore/tempotext.cpp
	modified:   libmscore/text.cpp
	modified:   libmscore/timesig.cpp
	modified:   libmscore/tremolo.cpp
	modified:   libmscore/trill.cpp
	modified:   libmscore/volta.cpp
	modified:   mscore/scoreaccessibility.cpp
2014-08-21 20:33:11 +03:00
Andrei Tuicu
6460485d3f Score accessibility system.
Provides screen-reader feedback for the selected element.
2014-08-19 00:09:13 +03:00
Andrei Tuicu
9caa98b130 Added 4 new navigation commands:
- next element
- previous element
- first element
- last element
2014-08-17 17:25:21 +03:00
Joachim Schmitz
e95d169d5c move Direction and DirectionH into MScore
needed to make them available to the plugin framework
2014-06-26 12:03:14 +02:00
Joachim Schmitz
54e2e167b6 move NoteHeadType to NoteHead::Type
needed to make it available to the plugin framework
2014-06-26 12:01:50 +02:00
Joachim Schmitz
3f2fc6166a move NoteHeadGroup to NoteHead::Group
needed to make it available to the plugin framework
2014-06-26 12:01:10 +02:00
Joachim Schmitz
b6be7a9852 rename AccidentalRole and AccidentalType to Role and Type 2014-06-26 11:57:41 +02:00
Joachim Schmitz
e6e7436177 move SegmentType to Segment::Type and make int again
needed to make it available to the plugin framework
and the memory saved is not worth the performance penalty
2014-06-26 11:57:39 +02:00
Joachim Schmitz
75623c53dc move ElementType to Element::Type
needed to make it available to the Plugin framework
2014-06-26 11:57:35 +02:00
ws
b4066a7976 stronger typing for key 2014-06-20 17:07:22 +02:00
Joachim Schmitz
5a9b6395de avoid warnings reg. unused variables 2014-06-17 14:35:16 +02:00
Joachim Schmitz
dba4644b70 use correct format specifiers
%d rather than %ld for int resp. %hhd vs. %d for char
2014-06-10 09:27:39 +02:00
ws
e8be73f41b fix transposition when changing instrument 2014-06-04 10:40:26 +02:00
ws
b7dd5af499 update KeySig implementation 2014-06-03 15:28:10 +02:00
ws
e1b1246e0c make SegmentType an global enum class 2014-06-01 20:24:29 +02:00
Joachim Schmitz
4e048f1712 convert enum Key into enum class
and to be able to ret rid of the KEY_ prefix, change enum Tpc's members
by adding (back) the prefix TPC_
2014-05-30 13:37:39 +02:00
Joachim Schmitz
7f1b612615 convert enum P_ID into enum class 2014-05-26 18:18:01 +02:00
Joachim Schmitz
0b43247956 convert enum StyleIdx into enum class 2014-05-26 15:31:36 +02:00