diff --git a/src/engraving/dom/actionicon.h b/src/engraving/dom/actionicon.h index 394f23d721057..caca33c77c045 100644 --- a/src/engraving/dom/actionicon.h +++ b/src/engraving/dom/actionicon.h @@ -26,7 +26,7 @@ #include "engravingitem.h" namespace mu::engraving { -enum class ActionIconType { +enum class ActionIconType : signed char { UNDEFINED = -1, ACCIACCATURA, diff --git a/src/engraving/dom/beam.h b/src/engraving/dom/beam.h index 5e21b6f2d2350..954b6c575dc6d 100644 --- a/src/engraving/dom/beam.h +++ b/src/engraving/dom/beam.h @@ -33,8 +33,8 @@ class Factory; class Skyline; class System; class Beam; -enum class ActionIconType; -enum class SpannerSegmentType; +enum class ActionIconType : signed char; +enum class SpannerSegmentType : char; struct TremAnchor { ChordRest* chord1 = nullptr; diff --git a/src/engraving/dom/beambase.h b/src/engraving/dom/beambase.h index 30758addb25b5..1c8d835f44fd3 100644 --- a/src/engraving/dom/beambase.h +++ b/src/engraving/dom/beambase.h @@ -46,7 +46,7 @@ struct BeamFragment { double py2[2]; }; -enum class ChordBeamAnchorType { +enum class ChordBeamAnchorType : char { Start, End, Middle }; diff --git a/src/engraving/dom/engravingitem.h b/src/engraving/dom/engravingitem.h index 2c19459f8171e..2a25e94ad2c0b 100644 --- a/src/engraving/dom/engravingitem.h +++ b/src/engraving/dom/engravingitem.h @@ -76,7 +76,7 @@ class StaffType; // OffsetChange //--------------------------------------------------------- -enum class OffsetChange { +enum class OffsetChange : signed char { RELATIVE_OFFSET = -1, NONE = 0, ABSOLUTE_OFFSET = 1 @@ -124,7 +124,7 @@ enum class ElementFlag { typedef muse::Flags ElementFlags; DECLARE_OPERATORS_FOR_FLAGS(ElementFlags) -enum class KerningType +enum class KerningType : char { KERNING, NON_KERNING, diff --git a/src/engraving/dom/glissando.h b/src/engraving/dom/glissando.h index 8e99fd422cd9c..201afe9232b3e 100644 --- a/src/engraving/dom/glissando.h +++ b/src/engraving/dom/glissando.h @@ -31,7 +31,7 @@ namespace mu::engraving { class Glissando; class Note; -enum class GlissandoType; +enum class GlissandoType : char; //--------------------------------------------------------- // @@ GlissandoSegment diff --git a/src/engraving/dom/mcursor.h b/src/engraving/dom/mcursor.h index 2dd0886ecf0a7..a6c91494a7744 100644 --- a/src/engraving/dom/mcursor.h +++ b/src/engraving/dom/mcursor.h @@ -33,7 +33,7 @@ class MasterScore; class TDuration; class TimeSig; class Chord; -enum class Key; +enum class Key : signed char; //--------------------------------------------------------- // MCursor diff --git a/src/engraving/dom/note.h b/src/engraving/dom/note.h index dd105f1656d60..c72659d255ef1 100644 --- a/src/engraving/dom/note.h +++ b/src/engraving/dom/note.h @@ -51,7 +51,7 @@ class Spanner; class StaffType; class StretchedBend; class NoteEditData; -enum class AccidentalType; +enum class AccidentalType : unsigned char; static constexpr int MAX_DOTS = 4; diff --git a/src/engraving/dom/pitchspelling.h b/src/engraving/dom/pitchspelling.h index c69e99eea415d..86290a2dda15a 100644 --- a/src/engraving/dom/pitchspelling.h +++ b/src/engraving/dom/pitchspelling.h @@ -31,7 +31,7 @@ namespace mu::engraving { class MidiNote; class Note; -enum class Key; +enum class Key : signed char; const int INVALID_PITCH = -1; diff --git a/src/engraving/dom/score.h b/src/engraving/dom/score.h index 7e1b80e648e33..d759d8da6679b 100644 --- a/src/engraving/dom/score.h +++ b/src/engraving/dom/score.h @@ -144,14 +144,14 @@ struct NoteVal; struct ShowAnchors; enum class BeatType : char; -enum class Key; +enum class Key : signed char; enum class HairpinType : signed char; enum class SegmentType; enum class OttavaType : char; enum class Voicing : signed char; enum class HDuration : signed char; -enum class AccidentalType; -enum class LayoutBreakType; +enum class AccidentalType : unsigned char; +enum class LayoutBreakType : char; enum class LoopBoundaryType : signed char { Unknown = -1, diff --git a/src/engraving/dom/staff.h b/src/engraving/dom/staff.h index 0f2227dab04c7..911f4e7571e80 100644 --- a/src/engraving/dom/staff.h +++ b/src/engraving/dom/staff.h @@ -48,7 +48,7 @@ class Score; class StaffType; class TimeSig; -enum class Key; +enum class Key : signed char; //--------------------------------------------------------- // Staff diff --git a/src/engraving/dom/types.h b/src/engraving/dom/types.h index b84ccd5f444fc..31ed25d252e4e 100644 --- a/src/engraving/dom/types.h +++ b/src/engraving/dom/types.h @@ -22,7 +22,7 @@ #pragma once -#include +#include #include "global/containers.h" @@ -34,7 +34,7 @@ namespace mu::engraving { class EngravingItem; -enum class CommandType { +enum class CommandType : signed char { Unknown = -1, // Parts @@ -148,7 +148,7 @@ enum class CommandType { //--------------------------------------------------------- // NOTE: keep this in sync with accList array in accidentals.cpp -enum class AccidentalType { +enum class AccidentalType : unsigned char { ///.\{ NONE, FLAT, @@ -331,7 +331,7 @@ enum class AccidentalType { // NoteType //--------------------------------------------------------- -enum class NoteType { +enum class NoteType : unsigned char { ///.\{ NORMAL = 0, ACCIACCATURA = 0x1, @@ -348,19 +348,19 @@ enum class NoteType { constexpr NoteType operator|(NoteType t1, NoteType t2) { - return static_cast(static_cast(t1) | static_cast(t2)); + return static_cast(static_cast(t1) | static_cast(t2)); } constexpr bool operator&(NoteType t1, NoteType t2) { - return static_cast(t1) & static_cast(t2); + return static_cast(t1) & static_cast(t2); } //--------------------------------------------------------- // HarmonyType //--------------------------------------------------------- -enum class HarmonyType { +enum class HarmonyType : char { ///.\{ STANDARD, ROMAN, @@ -372,7 +372,7 @@ enum class HarmonyType { // MMRestRangeBracketType //--------------------------------------------------------- -enum class MMRestRangeBracketType { +enum class MMRestRangeBracketType : char { ///.\{ BRACKETS, PARENTHESES, NONE ///\} @@ -413,7 +413,7 @@ enum class SegmentType { KeySigAnnounce = 0x1000, TimeSigAnnounce = 0x2000, //-- - All = -1, ///< Includes all barline types + All = 0xffff, ///< Includes all barline types /// Alias for `BeginBarLine | StartRepeatBarLine | BarLine | EndBarLine` BarLineType = BeginBarLine | StartRepeatBarLine | BarLine | EndBarLine, ///\} @@ -496,14 +496,14 @@ enum class TripletFeelType : char { SCOTTISH_16TH }; -enum class GuitarBendType { +enum class GuitarBendType : char { BEND, PRE_BEND, GRACE_NOTE_BEND, SLIGHT_BEND, }; -enum class GuitarBendShowHoldLine { +enum class GuitarBendShowHoldLine : char { AUTO, SHOW, HIDE, diff --git a/src/engraving/dom/utils.h b/src/engraving/dom/utils.h index de96bcfa43db6..8f527086282d9 100644 --- a/src/engraving/dom/utils.h +++ b/src/engraving/dom/utils.h @@ -40,7 +40,7 @@ class System; class Tuplet; class Volta; -enum class Key; +enum class Key : signed char; extern RectF handleRect(const PointF& pos); diff --git a/src/engraving/rendering/iscorerenderer.h b/src/engraving/rendering/iscorerenderer.h index a6cec0fbdaa39..507e3fcd2bd67 100644 --- a/src/engraving/rendering/iscorerenderer.h +++ b/src/engraving/rendering/iscorerenderer.h @@ -60,7 +60,7 @@ class Harmony; class Image; -enum class KerningType; +enum class KerningType : char; class KeySig; class LedgerLine; diff --git a/src/engraving/rendering/score/beamtremololayout.h b/src/engraving/rendering/score/beamtremololayout.h index 594cd0c18f19d..0f9fe49212b36 100644 --- a/src/engraving/rendering/score/beamtremololayout.h +++ b/src/engraving/rendering/score/beamtremololayout.h @@ -35,12 +35,12 @@ class Chord; class ChordRest; class Beam; class TremoloTwoChord; -enum class ActionIconType; -enum class SpannerSegmentType; -enum class ChordBeamAnchorType; +enum class ActionIconType : signed char; +enum class SpannerSegmentType : char; +enum class ChordBeamAnchorType : char; } -enum class SlopeConstraint +enum class SlopeConstraint : char { NO_CONSTRAINT, FLAT, diff --git a/src/engraving/rendering/score/horizontalspacing.h b/src/engraving/rendering/score/horizontalspacing.h index 6995715c58e31..e29b6e33dd63d 100644 --- a/src/engraving/rendering/score/horizontalspacing.h +++ b/src/engraving/rendering/score/horizontalspacing.h @@ -36,8 +36,8 @@ class Segment; struct Spring; class Measure; class System; -enum class ElementType; -enum class KerningType; +enum class ElementType : unsigned char; +enum class KerningType : char; } namespace mu::engraving::rendering::score { diff --git a/src/engraving/types/symid.h b/src/engraving/types/symid.h index 3a7fbd9ce832e..1542796161e44 100644 --- a/src/engraving/types/symid.h +++ b/src/engraving/types/symid.h @@ -24,7 +24,7 @@ #define MU_ENGRAVING_SYMID_H namespace mu::engraving { -enum class SmuflAnchorId { +enum class SmuflAnchorId : char { stemDownNW, stemUpSE, stemDownSW, diff --git a/src/engraving/types/types.h b/src/engraving/types/types.h index cb158999a368d..2467e319ee0f2 100644 --- a/src/engraving/types/types.h +++ b/src/engraving/types/types.h @@ -63,7 +63,7 @@ using semitone_t = int8_t; /// of elements on the canvas. /// Note: keep in sync with array in TConv //------------------------------------------------------------------- -enum class ElementType { +enum class ElementType : unsigned char { ///.\{ INVALID = 0, BRACKET_ITEM, @@ -253,21 +253,21 @@ enum class OrnamentStyle : char { }; // P_TYPE::GLISS_STYLE -enum class GlissandoStyle { +enum class GlissandoStyle : char { CHROMATIC, WHITE_KEYS, BLACK_KEYS, DIATONIC, PORTAMENTO }; // --- Layout --- // P_TYPE::ALIGN -enum class AlignV { +enum class AlignV : char { TOP, VCENTER, BOTTOM, BASELINE }; -enum class AlignH { +enum class AlignH : char { LEFT, RIGHT, HCENTER @@ -300,12 +300,12 @@ struct Align { }; // P_TYPE::PLACEMENT_V -enum class PlacementV { +enum class PlacementV : char { ABOVE, BELOW }; // P_TYPE::PLACEMENT_H -enum class PlacementH { +enum class PlacementH : char { LEFT, CENTER, RIGHT }; @@ -315,7 +315,7 @@ enum class TextPlace : char { }; // P_TYPE::DIRECTION -enum class DirectionV { +enum class DirectionV : char { AUTO, UP, DOWN }; @@ -337,7 +337,7 @@ enum class AutoOnOff : char { }; //! Note: from lowest to highest priority -enum class VoiceAssignment { +enum class VoiceAssignment : char { ALL_VOICE_IN_INSTRUMENT, ALL_VOICE_IN_STAFF, CURRENT_VOICE_ONLY @@ -382,7 +382,7 @@ struct DurationTypeWithDots // --- Types --- // P_TYPE::LAYOUTBREAK_TYPE -enum class LayoutBreakType { +enum class LayoutBreakType : char { PAGE, LINE, SECTION, NOBREAK }; @@ -680,7 +680,7 @@ enum class ArpeggioType : unsigned char { NORMAL, UP, DOWN, BRACKET, UP_STRAIGHT, DOWN_STRAIGHT }; -enum class IntervalStep { +enum class IntervalStep : char { UNISON, SECOND, THIRD, @@ -691,7 +691,7 @@ enum class IntervalStep { OCTAVE }; -enum class IntervalType { +enum class IntervalType : char { AUTO, AUGMENTED, MAJOR, @@ -737,13 +737,13 @@ struct OrnamentInterval static const OrnamentInterval DEFAULT_ORNAMENT_INTERVAL = OrnamentInterval(IntervalStep::SECOND, IntervalType::AUTO); -enum class OrnamentShowAccidental { +enum class OrnamentShowAccidental : char { DEFAULT, ANY_ALTERATION, ALWAYS, }; -enum class PartialSpannerDirection : char { +enum class PartialSpannerDirection : signed char { NONE = -1, INCOMING, OUTGOING, @@ -757,7 +757,7 @@ enum class PartialSpannerDirection : char { /// Must be in sync with textStyles (in textstyle.cpp) //------------------------------------------------------------------- // P_TYPE::TEXT_STYLE -enum class TextStyleType { +enum class TextStyleType : unsigned char { DEFAULT, // Page-oriented styles @@ -843,14 +843,14 @@ enum class TextStyleType { IGNORED_TYPES // used for types no longer relevant (mainly Figured bass text type) }; -enum class AnnotationCategory { +enum class AnnotationCategory : signed char { Undefined = -1, TempoAnnotation, PlayingAnnotation, Other, }; -enum class PlayingTechniqueType { +enum class PlayingTechniqueType : signed char { Undefined = -1, Natural, Pizzicato, @@ -870,7 +870,7 @@ enum class PlayingTechniqueType { JazzTone, }; -enum class GradualTempoChangeType { +enum class GradualTempoChangeType : signed char { Undefined = -1, Accelerando, Allargando, @@ -917,7 +917,7 @@ enum class AccidentalVal : signed char { MAX = SHARP3 }; -enum class FermataType { +enum class FermataType : signed char { Undefined = -1, VeryShort, Short, @@ -933,7 +933,7 @@ enum class ChordLineType : char { PLOP, SCOOP }; -enum class SlurStyleType { +enum class SlurStyleType : signed char { Undefined = -1, Solid, Dotted, @@ -998,11 +998,11 @@ enum class BracketType : signed char { using InstrumentTrackIdList = std::vector; using InstrumentTrackIdSet = std::unordered_set; -enum EmbellishmentType {}; +enum EmbellishmentType : unsigned char {}; -enum DrumNum {}; +enum DrumNum : unsigned char {}; -enum class GlissandoType { +enum class GlissandoType : char { STRAIGHT, WAVY }; @@ -1049,7 +1049,7 @@ enum class VibratoType : char { GUITAR_VIBRATO, GUITAR_VIBRATO_WIDE, VIBRATO_SAWTOOTH, VIBRATO_SAWTOOTH_WIDE }; -enum class ArticulationTextType { +enum class ArticulationTextType : char { NO_TEXT, TAP, SLAP, @@ -1060,28 +1060,28 @@ enum class LyricsSyllabic : char { SINGLE, BEGIN, END, MIDDLE }; -enum class LyricsDashSystemStart { +enum class LyricsDashSystemStart : char { STANDARD, UNDER_HEADER, UNDER_FIRST_NOTE }; -enum class NoteLineEndPlacement { +enum class NoteLineEndPlacement : char { LEFT_EDGE, OFFSET_ENDS, }; -enum class SpannerSegmentType { +enum class SpannerSegmentType : char { SINGLE, BEGIN, MIDDLE, END }; -enum class TiePlacement { +enum class TiePlacement : char { AUTO, INSIDE, OUTSIDE, }; -enum class TieDotsPlacement { +enum class TieDotsPlacement : char { AUTO, BEFORE_DOTS, AFTER_DOTS @@ -1091,7 +1091,7 @@ enum class TieDotsPlacement { // Key //--------------------------------------------------------- -enum class Key { +enum class Key : signed char { C_B = -7, G_B, D_B, @@ -1154,7 +1154,7 @@ struct SettingsCompat { // recreates all. //--------------------------------------------------------- -enum class UpdateMode { +enum class UpdateMode : char { DoNothing, Update, // do screen refresh of RectF "refresh" UpdateAll, // do complete screen refresh @@ -1185,7 +1185,7 @@ struct std::hash } }; -enum class ScoreStylePreset { +enum class ScoreStylePreset : char { DEFAULT = 0, MSN_16MM, MSN_18MM, diff --git a/src/importexport/mei/internal/meiimporter.h b/src/importexport/mei/internal/meiimporter.h index 72254a03b5f80..bb745a6b776a2 100644 --- a/src/importexport/mei/internal/meiimporter.h +++ b/src/importexport/mei/internal/meiimporter.h @@ -50,7 +50,7 @@ class Score; class Spanner; class Tuplet; class VBox; -enum class NoteType; +enum class NoteType : unsigned char; enum class TimeSigType : char; struct ClefTypeList; } diff --git a/src/importexport/midi/internal/midiimport/importmidi_inner.h b/src/importexport/midi/internal/midiimport/importmidi_inner.h index 348ebb3bc6fba..fda80b1113bdc 100644 --- a/src/importexport/midi/internal/midiimport/importmidi_inner.h +++ b/src/importexport/midi/internal/midiimport/importmidi_inner.h @@ -39,7 +39,7 @@ // --------------------------------------------------------------------------------------- namespace mu::engraving { -enum class Key; +enum class Key : signed char; class Staff; class Score; class TDuration; diff --git a/src/importexport/musicxml/internal/musicxml/shared/musicxmlsupport.h b/src/importexport/musicxml/internal/musicxml/shared/musicxmlsupport.h index d96da412e9dbc..ba9dbd4905860 100644 --- a/src/importexport/musicxml/internal/musicxml/shared/musicxmlsupport.h +++ b/src/importexport/musicxml/internal/musicxml/shared/musicxmlsupport.h @@ -26,7 +26,7 @@ #include "serialization/xmlstreamreader.h" namespace mu::engraving { -enum class AccidentalType; +enum class AccidentalType : unsigned char; class Articulation; class Chord; class Fraction; diff --git a/src/notation/internal/inotationundostack.h b/src/notation/internal/inotationundostack.h index c0754d9c9d931..f5921f0393b18 100644 --- a/src/notation/internal/inotationundostack.h +++ b/src/notation/internal/inotationundostack.h @@ -29,7 +29,7 @@ namespace mu::engraving { class EditData; -enum class ElementType; +enum class ElementType : unsigned char; } namespace mu::notation { diff --git a/src/palette/internal/palette.h b/src/palette/internal/palette.h index e13df45c4b4ab..6dfec410a6ea5 100644 --- a/src/palette/internal/palette.h +++ b/src/palette/internal/palette.h @@ -37,7 +37,7 @@ #include "iinteractive.h" namespace mu::engraving { -enum class ActionIconType; +enum class ActionIconType : signed char; class XmlWriter; class XMLReader; } diff --git a/src/palette/view/widgets/palettewidget.h b/src/palette/view/widgets/palettewidget.h index 3775402569129..caf756cb0779a 100644 --- a/src/palette/view/widgets/palettewidget.h +++ b/src/palette/view/widgets/palettewidget.h @@ -39,7 +39,7 @@ #include "iinteractive.h" namespace mu::engraving { -enum class ActionIconType; +enum class ActionIconType : signed char; class XmlWriter; class XmlReader; }