33dff96a20
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. |
||
---|---|---|
.. | ||
channel.cpp | ||
channel.h | ||
CMakeLists.txt | ||
filter.cpp | ||
filter.h | ||
instrument.cpp | ||
instrument.h | ||
README | ||
sample.h | ||
sfz.cpp | ||
voice.cpp | ||
voice.h | ||
zerberus.cpp | ||
zerberus.h | ||
zerberus_gui.ui | ||
zerberusgui.cpp | ||
zerberusgui.h | ||
zone.cpp | ||
zone.h |
References * Cakewalk® Synthesizers: From Presets to Power User, Second Edition Simon Cann - Course Technology - 2009 Zerberus Supported and Unsupported SFZ Opcodes == Supported -- Instrument definition group region Sample Definition sample Input controls loccN hiccN lochan hichan key lokey hikey lovel hivel loccN hiccN hirand lorand seq_length seq_position trigger attack release first legato off_by off_mode fast normal on_loccN on_hiccN Sample Player delay offset loop_mode no_loop one_shot loop_continuous loop_sustain loop_start loop_end Performance Parameters Pitch transpose tune pitch_keycenter pitch_keytrack Pitch EG Pitch LFO Filter fil_type cutoff fil_veltrack Filter EG Filter LFO Amplifier pan volume amp_veltrack rt_decay Amplifier EG ampeg_delay ampeg_start ampeg_attack ampeg_hold ampeg_decay ampeg_sustain ampeg_vel2delay ampeg_vel2attack ampeg_vel2hold ampeg_vel2decay ampeg_vel2sustain ampeg_vel2release ampeg_release Amplifier LFO Equalizer Effects Not in SFZ 1.0 note_offset octave_offset Unsupported -- Input Controls lobend hibend lochanaft hichanaft lopolyaft hipolyaft lopbm hipbm sw_lokey sw_hikey sw_last sw_down sw_up sw_previous sw_vel Performance Parameters Sample Player delay_random delay_ccN offset_random offset_ccN end count sync_beats sync_offset Pitch pitch_veltrack pitch_random bend_up bend_down bend_step Pitch EG pitcheg_delay pitcheg_start pitcheg_attack pitcheg_hold pitcheg_decay pitcheg_sustain pitcheg_release pitcheg_depth pitcheg_vel2delay pitcheg_vel2attack pitcheg_vel2hold pitcheg_vel2decay pitcheg_vel2sustain pitcheg_vel2release pitcheg_vel2depth Pitch LFO pitchlfo_delay pitchlfo_fade pitchlfo_freq pitchlfo_depth pitchlfo_depthccN pitchlfo_depthchanaft pitchlfo_depthpolyaft pitchlfo_freqccN pitchlfo_freqpolyaft Filter cutoff_ccN cutoff_chanaft cutoff_polyaft resonance fil_keytrack fil_keycenter fil_random Filter EG fileg_delay fileg_start fileg_attack fileg_hold fileg_decay fileg_sustain fileg_release fileg_depth fileg_vel2delay fileg_vel2attack fileg_vel2hold fileg_vel2decay fileg_vel2sustain fileg_vel2release fileg_vel2depth Filter LFO fillfo_delay fillfo_fade fillfo_freq fillfo_depth fillfo_depthccN fillfo_depthchanaft fillfo_depthpolyaft fillfo_freqccN fillfo_freqchanaft fillfo_freqpolyaft Amplifier width position amp_keytrack amp_keycenter amp_velcurve_1 amo_velcurve_127 amp_random output gain_ccN xfin_lokey xfin_hikey xfout_lokey xfout_hikey xf_keycurve xfin_lovel xfin_hivel xfout_lovel xfout_hivel xf_velcurve xfin_loccN xfin_hiccN xfout_loccN xfout_hiccN xf)cccurve Amplifier EG ampeg_delayccN ampeg_startccN ampeg_attackccN ampeg_holdccN ampeg_decayccN ampeg_sustainccN ampeg_releaseccN Amplifier LFO amplfo_delay amplfo_fade amplfo_freq amplfo_depth amplfo_depthccN amplfo_depthchanaft amplfo_depthpolyaft amplfo_freqccN amplfo_freqchanaft amplfo_freqpolyaft Equalizer eq1_freq eq2_freq eq3_freq eq1_freqccN eq2_freqccN eq3_freqccN eq1_vel2freq eq2_vel2freq eq3_vel2freq eq1_bw eq2_bw eq3_bw eq1_bwccN eq2_bwccN eq3_bwccN eq1_gain eq2_gain eq3_gain eq1_gainccN eq2_gainccN eq3_gainccN eq1_vel2gain eq2_vel2gain eq3_vel2gain Effects effect1 effect2