Commit graph

183 commits

Author SHA1 Message Date
Joachim Schmitz
474e8152cd fix #275218: fix MSVC C4456 warnings
reg. a declaration shadowing a previously declared local
variable,
"Warning C4456: declaration of 'XXX' hides previous local
declaration"
2018-09-27 17:38:19 +02:00
ws
a64d5d81d3 add preparations for 'skyline' algorithm to calculate system distance 2018-09-03 09:54:20 +02:00
Joachim Schmitz
632f830f5f Fix #275218: fix MSVC compiler warnings
* Warnings C4304, C4804 and C4838.
* Warnings C4065 and most C4702 (all but two).
* Warnings C4701.
* Warnings C4244.
* Warnings C4457.
* Warnings C4459.
* Some warnings C4456, due to nested `foreach` loops.
2018-08-14 10:03:49 +02:00
Andres Fernandez de Prado
3acc363498 Solved all compilation errors on MSVC
This commit contains changes required for MuseScore to compile under MSVC with no errors.

There are several general categories of problems that resulted in errors with the compilation. Main issues:
- Variable Length Arrays (VLA). This is a non-standard extension to C++, supported by clang toolchains, but not by MSVC. The initial workaround is to use std::vector<> instead of VLAs, eventually (if needed) with the original variable pointing to the beginning of the allocated array. More efficient alternatives are possible if profiling shows any code using VLAs to be timing-critical.
- Floating-point constants not suffixed with "f" are doubles by default; in some instances, this leads to narrowing conversion errors (in other instances, just warnings).
- MSVC does not support "or"/"and"/"not" in lieu of "||"/"&&"/"!". Changed unconditionally to use standard C++ symbols.
- MSVC does not support the "__builtin_unreachable()" compiler hint. A similar, albeit not exactly equal, alternative is "__assume(0)", which is MSVC-specific.
- MSVC does not support ranges in case statements. Replaced with list of cases instead of range (non-conditionally)

Detailed changes, with per-file comments:

- all.h: opt-in to deprecated features, include <io.h> and <process.h> instead of POSIX <unistd.h>, undefine "STRING_NONE" and "small", which Microsoft defines as macros, which result in compilation errors.
- effects/compressor/zita.cpp: eliminated narrowing conversion error by appending "f" to float constants.
- fluid/voice.cpp: appended "f" to float constants to eliminate narrowing conversion errors/warnings
- libmscore/beam.cpp: conditionally replaced VLA
- libmscore/edit.cpp: conditionally replaced VLA
- libmscore/element.cpp: appended "f" to float constant
- libmscore/fret.cpp: changed or -> ||
- libmscore/layout.cpp: conditionally replaced VLA
- libmscore/mscore.cpp: conditionally replaced "__builtin_unreachable()" with "__assume(0)" for MSVC
- libmscore/scorefile.coo: use correct char representation conversion for MSVC
- libmscore/stringdata.cpp: conditionally replaced VLA
- libmscore/system.cpp: conditionally replaced VLA
- libmscroe/text.cpp: replaced range in case statement.
- manual/genManual.cpp: use getopt() replacement.
- midi/midifile.cpp: conditionally replaced VLA. This does not use the default replacement.
- mscore/bb.cpp: replaced range in case statement.
- mscore/capella.cpp: conditionally replaced VLA. Changed and -> &&
- mscore/driver:cpp: preclude errors due to macro redefinitions.
- mscore/editstyle.cpp: conditionally replaced "__builtin_unreachable()" with "__assume(0)" for MSVC
- mscore/importgtp-gp6.cpp: conditionally replaced VLA.
- mscore/instrwidget.cpp: conditionally replaced VLA.
- mscore/jackaudio.cpp: conditionally replaced VLA. Preclude errors due to macro redefinitions.
- mscore/jackweakapi.cpp: Preclude errors due to macro redefinitions. Replacement for __atribute__((constructor)) through static object construction for MSVC. Force use of LoadLibraryA instead of LoadLibrary.
- mscore/mididriver.h: Changed not -> !
- mscore/musescore.cpp: Changed not -> !. Conditionally replaced VLA.
- mscore/resourceManager.cpp: conditionally replaced VLA.
- mscore/timeline.cpp: conditionally replaced VLA.
- omr/omrpage.cpp: conditionally replaced VLA.
- synthesizer/msynthesizer.cpp: replaced UNIX sleep(1) method with MSVC Sleep(1000) (equivalent, but in ms instead of seconds)
- synthesizer/msynthsizer.h: appended "f" to float constant
- thirdparty/poppler/config.h: set defines for MSVC to preclude the use of inexistent libraries.
- thirdparty/poppler/poppler/poppler-config.h: set defines for MSVC to preclude the use of inexistent libraries. Eliminated #defines for fmin and fmax which where causing problems.
- thirdparty/poppler/poppler/PSOutputDev.cc: added #include <algorithm> for  std::min() and std::max(). Note this is required per-C++ standard.
- thirdparty/portmidi/pm_win/pmwinmm.c: undefined UNICODE to use char-based library functions.
- thirdparty/qzip/qzip.cpp: changed or -> ||
- thirdparty/rtf2html/rtf_keyword.h: file format changed from Apple to UNIX, as MSVC does not supported the former.

(NOT error related, just improvement on previous commit; manual/getopt/README.md: added link to source article)
2018-08-03 09:15:42 +02:00
Dag Henning Liodden Sørbø
b1cb83acab Use new preference model for part style 2018-02-16 00:05:38 +01:00
Dag Henning Liodden Sørbø
2b6cb8b432 Change to new preferences model
The old Preferences struct holding all preferences are removed in favor of a
new Preferences class which acts as a proxy for QSettings. The settings stored
in QSettings are accessed directly through access methods like getBool(key),
getInt(key), etc. and changed with setPreference(key, value).

Since we are using QSettings directly the preferences are stored automatically
without the need for a custom write() and read() method like before.

The preferences.cpp/.h and prefdialog.cpp/h are refactored to have fewer
responsibilities than before. The Preferences class are all about storing and
retrieving preferences - it should not contain any code to handle any other
aspect of MuseScore.

Testing:
The Preferences class can be used in tests. All preferences are initialized with
default values in mtest. If a test requires that a preference has a specific
value it can be changed using setPreference() for that single test. In the tests
the preferences are stored in memory only.

The Preference class is supposed to be used as a singleton. In preferences.h an
'extern Preferences preferences' is set and it is defined in preferences.cpp. All
files which includes preferences.h have access to the 'preferences' singleton
and should use this to get and set preferences.
2018-02-08 16:59:10 +01:00
ws
35265cd358 implement new fermata element 2018-01-16 13:38:28 +01:00
Werner Schweer
020f7b1c08 fix vtst 'chord-space-1' 2017-12-11 12:35:23 +01:00
Werner Schweer
7365542a18 debugging option: disable slur autoplace 2017-08-16 16:59:04 +02:00
Joachim Schmitz
264b0386d4 Fix #243656: Warnings/Errors from lupdate
All but one...
2017-08-11 11:51:37 +02:00
Werner Schweer
3ab304d157 scripting update 2017-06-29 10:13:55 +02:00
Werner Schweer
e6d9ddcf3f more reset buttons for style values 2017-06-27 09:40:01 +02:00
Werner Schweer
4241b93649 update scripting interface 2017-06-22 12:42:14 +02:00
Werner Schweer
847d3656cf updates to scripting, text editing 2017-05-19 09:06:58 +02:00
lasconic
4d5cd902c2 export bitmap to svg with lower resolution than original when applicable 2017-05-17 19:39:21 +02:00
Werner Schweer
ac41fa396e update edit infrastructure 2017-03-31 13:03:30 +02:00
Werner Schweer
9d6dcb816a fix style loading 2017-03-15 13:35:27 +01:00
Werner Schweer
7554cafc1d move static MStyle behind styleTypes 2017-03-09 18:41:13 +01:00
Werner Schweer
cf42a3a377 fix #179926: add scale property for time signature 2017-03-09 13:37:53 +01:00
Werner Schweer
129d508144 move Ottava::Type into OttavaType 2017-03-08 14:18:34 +01:00
Werner Schweer
867f2582f6 move Segment::Type into SegmentType 2017-03-08 13:12:26 +01: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 Schweer
9a9dedf774 change PageFormat to simple style values 2017-01-23 21:53:51 +01:00
Werner Schweer
1d4c6b2f21 move Element::type() to ScoreElement 2017-01-18 14:16:33 +01:00
Werner Schweer
6ab16d83a3 enhance tick() method for text 2017-01-17 09:58:51 +01:00
Werner Schweer
5433d719d9 replace TextStyle by SubStyle 2017-01-16 20:59:21 +01:00
Werner Schweer
0b1aea952f layout for movements 2017-01-05 11:28:45 +01:00
Werner Schweer
01e5df432b fix #140266: no system header after horizontal frame; code cleanups 2016-12-12 10:31:37 +01:00
Werner Schweer
669ae615c6 more unified error reporting 2016-12-01 16:56:10 +01:00
Werner Schweer
107343b1aa fix #148121, #138326; add provisions for global insert mode 2016-12-01 13:35:48 +01:00
lasconic
e415dfe8b8 fix windows build 2016-11-28 18:25:27 +01:00
Werner Schweer
78c8428a22 rename Error to MsError 2016-11-28 17:58:22 +01:00
Werner Schweer
dfe4c7b433 in Range(): allow tuplets to be split in the middle 2016-11-28 17:25:37 +01:00
lasconic
86b27e570d update MuseJazz and MuseJazzText 2016-11-04 11:33:00 +01:00
lasconic
9dd79449fa fix font loading for MuseJazzText on Windows/Linux 2016-10-12 19:16:00 +02:00
lasconic
83e1d3c44b add MuseJazz score font and rename 2.0 MuseJazz to MuseJazzText 2016-10-11 15:26:49 +02:00
lasconic
855d2a6fac Font fallback is now an option. Use the correct font metadata when using the font fallback 2016-10-07 13:21:05 +02:00
Werner Schweer
e38215d41c update hairpin; fix drag of lines to staff > 1 2016-09-22 17:28:44 +02:00
werner
4ac407d90e misc. updates 2016-09-03 17:46:36 +02:00
heuchi
ba5f98e21e remove intToDirection converter for QVariant 2016-07-13 12:53:54 +02:00
lasconic
96aa04ecd4 better TextStyleType conversion 2016-07-12 16:40:23 +02:00
heuchi
457450d09a fix #116091: Regression: "Flip stem direction" command broken 2016-07-12 13:29:27 +02:00
werner
3172717cbb autoplace for volta 2016-07-10 12:00:57 +02:00
werner
b85cad9d83 replace ticks in mscore file by fraction 2016-07-07 16:20:29 +02:00
heuchi
d876d2fc98 expose class BarLine with property barLineType to QML 2016-06-10 23:29:35 +02:00
lasconic
ea736ea364 add debug menu option to hightlight corrupted measures 2016-06-03 18:26:51 +02:00
ws
2f9658090f fix rehearsal mark shape; add dynamic debug option show-bounding-box 2016-06-03 17:54:21 +02:00
ws
f97b26540a fix release mode build 2016-06-02 12:50:00 +02:00
ws
e6d5fe6a2c add Debug menu and make some debug flags runtime switchable 2016-06-02 12:13:00 +02:00