MuseScore Plugins 3.2.3
Plugins API for MuseScore
Loading...
Searching...
No Matches
types.h
1//=============================================================================
2// MuseScore
3// Music Composition & Notation
4//
5// Copyright (C) 2017 Werner Schweer
6//
7// This program is free software; you can redistribute it and/or modify
8// it under the terms of the GNU General Public License version 2
9// as published by the Free Software Foundation and appearing in
10// the file LICENCE.GPL
11//=============================================================================
12
13#ifndef __TYPES_H__
14#define __TYPES_H__
15
16#include "config.h"
17
21
22namespace Ms {
23#ifdef SCRIPT_INTERFACE
24Q_NAMESPACE
25#endif
26
27//-------------------------------------------------------------------
32//-------------------------------------------------------------------
33
34enum class ElementType {
54 STEM, // list STEM before NOTE: notes in TAB might 'break' stems
55 NOTE, // and this requires stems to be drawn before notes
56 CLEF, // elements from CLEF to TIMESIG need to be in the order
57 KEYSIG, // in which they appear in a measure
142
145 };
146
147//---------------------------------------------------------
148// AccidentalType
149//---------------------------------------------------------
150// NOTE: keep this in sync with with accList array
151enum class AccidentalType : char {
159 //SHARP3,
160 //FLAT3,
164
165 // Gould arrow quartertone
176
177 // Stein-Zimmermann
182
183 // Arel-Ezgi-Uzdilek (AEU)
188
189 // Extended Helmholtz-Ellis accidentals (just intonation)
196
203
210
217
224
231
234
242
243 // Persian
248 };
249
250//---------------------------------------------------------
251// NoteType
252//---------------------------------------------------------
253
254enum class NoteType {
258 APPOGGIATURA = 0x2, // grace notes
259 GRACE4 = 0x4,
260 GRACE16 = 0x8,
261 GRACE32 = 0x10,
265 INVALID = 0xFF
267 };
268
269constexpr NoteType operator| (NoteType t1, NoteType t2) {
270 return static_cast<NoteType>(static_cast<int>(t1) | static_cast<int>(t2));
271 }
272constexpr bool operator& (NoteType t1, NoteType t2) {
273 return static_cast<int>(t1) & static_cast<int>(t2);
274 }
275
276
277//---------------------------------------------------------
278// Direction
279//---------------------------------------------------------
280
281enum class Direction {
285 };
286
287//---------------------------------------------------------
288// GlissandoType
289//---------------------------------------------------------
290
291enum class GlissandoType {
295 };
296
297//---------------------------------------------------------
298// GlissandoStyle
299//---------------------------------------------------------
300
306
307//---------------------------------------------------------
308// Placement
309//---------------------------------------------------------
310
311enum class Placement {
315 };
316
317//---------------------------------------------------------
318// OffsetType
319//---------------------------------------------------------
320
321enum class OffsetType : char {
324 };
325
326//-------------------------------------------------------------------
327// SegmentType
328//
329// Type values determine the order of segments for a given tick
330//-------------------------------------------------------------------
331
332enum class SegmentType {
334 Invalid = 0x0,
337 KeySig = 0x4,
338 Ambitus = 0x8,
339 TimeSig = 0x10,
341 Clef = 0x40,
342 BarLine = 0x80,
343 Breath = 0x100,
344 //--
345 ChordRest = 0x200,
346 //--
347 EndBarLine = 0x400,
350 All = -1,
354 };
355
356constexpr SegmentType operator| (const SegmentType t1, const SegmentType t2) {
357 return static_cast<SegmentType>(static_cast<int>(t1) | static_cast<int>(t2));
358 }
359constexpr bool operator& (const SegmentType t1, const SegmentType t2) {
360 return static_cast<int>(t1) & static_cast<int>(t2);
361 }
362
363//-------------------------------------------------------------------
364// Tid
368//-------------------------------------------------------------------
369
423
424//---------------------------------------------------------
425// Align
426//---------------------------------------------------------
427
428enum class Align : char {
429 LEFT = 0,
430 RIGHT = 1,
431 HCENTER = 2,
432 TOP = 0,
433 BOTTOM = 4,
434 VCENTER = 8,
435 BASELINE = 16,
436 CENTER = Align::HCENTER | Align::VCENTER,
437 HMASK = Align::LEFT | Align::RIGHT | Align::HCENTER,
438 VMASK = Align::TOP | Align::BOTTOM | Align::VCENTER | Align::BASELINE
439 };
440
441constexpr Align operator| (Align a1, Align a2) {
442 return static_cast<Align>(static_cast<char>(a1) | static_cast<char>(a2));
443 }
444constexpr bool operator& (Align a1, Align a2) {
445 return static_cast<char>(a1) & static_cast<char>(a2);
446 }
447constexpr Align operator~ (Align a) {
448 return static_cast<Align>(~static_cast<char>(a));
449 }
450
451//---------------------------------------------------------
452// FontStyle
453//---------------------------------------------------------
454
455enum class FontStyle : char {
456 Normal = 0, Bold = 1, Italic = 2, Underline = 4
457 };
458
459constexpr FontStyle operator+ (FontStyle a1, FontStyle a2) {
460 return static_cast<FontStyle>(static_cast<char>(a1) | static_cast<char>(a2));
461 }
462constexpr FontStyle operator- (FontStyle a1, FontStyle a2) {
463 return static_cast<FontStyle>(static_cast<char>(a1) & ~static_cast<char>(a2));
464 }
465constexpr bool operator& (FontStyle a1, FontStyle a2) {
466 return static_cast<bool>(static_cast<char>(a1) & static_cast<char>(a2));
467 }
468
469//---------------------------------------------------------
470// Tuplets
471//---------------------------------------------------------
472
473enum class TupletNumberType : char { SHOW_NUMBER, SHOW_RELATION, NO_TEXT };
474enum class TupletBracketType : char { AUTO_BRACKET, SHOW_BRACKET, SHOW_NO_BRACKET };
475
476#ifdef SCRIPT_INTERFACE
477Q_ENUM_NS(ElementType)
478Q_ENUM_NS(AccidentalType)
479Q_ENUM_NS(Direction)
480Q_ENUM_NS(GlissandoType)
481Q_ENUM_NS(GlissandoStyle)
482Q_ENUM_NS(Placement)
483Q_ENUM_NS(SegmentType)
484Q_ENUM_NS(Tid)
485Q_ENUM_NS(NoteType)
486#endif
487
488//hack: to force the build system to run moc on this file
490class Mops : public QObject {
491 Q_GADGET
492 };
493
494extern Direction toDirection(const QString&);
495extern const char* toString(Direction);
496extern QString toUserString(Direction);
497extern void fillComboBoxDirection(QComboBox*);
498
499
500} // namespace Ms
501
502Q_DECLARE_METATYPE(Ms::Align)
503
504Q_DECLARE_METATYPE(Ms::Direction);
505
506Q_DECLARE_METATYPE(Ms::NoteType);
507
508#endif
Definition cursor.cpp:29
NoteType
Definition types.h:254
@ GRACE32
Definition types.h:261
@ GRACE16
Definition types.h:260
@ GRACE8_AFTER
Definition types.h:262
@ NORMAL
Definition types.h:256
@ APPOGGIATURA
Definition types.h:258
@ GRACE16_AFTER
Definition types.h:263
@ ACCIACCATURA
Definition types.h:257
@ GRACE4
Definition types.h:259
@ GRACE32_AFTER
Definition types.h:264
ElementType
Definition types.h:34
@ NOTELINE
Definition types.h:121
@ OTTAVA_SEGMENT
Definition types.h:88
@ REHEARSAL_MARK
Definition types.h:79
@ SELECTION
Definition types.h:106
@ ARPEGGIO
Definition types.h:51
@ DYNAMIC
Definition types.h:67
@ NOTE
Definition types.h:55
@ TIE_SEGMENT
Definition types.h:46
@ BAR_LINE
Definition types.h:47
@ FBOX
Definition types.h:137
@ FERMATA
Definition types.h:65
@ TUPLET
Definition types.h:75
@ PAGE
Definition types.h:111
@ STEM
Definition types.h:54
@ IMAGE
Definition types.h:104
@ TEXTLINE_SEGMENT
Definition types.h:93
@ HBOX
Definition types.h:134
@ TEXTLINE
Definition types.h:119
@ LET_RING_SEGMENT
Definition types.h:90
@ LYRICS
Definition types.h:70
@ JUMP
Definition types.h:73
@ MARKER
Definition types.h:72
@ PALM_MUTE
Definition types.h:118
@ CHORD
Definition types.h:128
@ SEGMENT
Definition types.h:125
@ HOOK
Definition types.h:69
@ PALM_MUTE_SEGMENT
Definition types.h:92
@ REST
Definition types.h:60
@ TBOX
Definition types.h:136
@ HAIRPIN
Definition types.h:112
@ LASSO
Definition types.h:107
@ BEAM
Definition types.h:68
@ PEDAL_SEGMENT
Definition types.h:95
@ FSYMBOL
Definition types.h:110
@ HAIRPIN_SEGMENT
Definition types.h:87
@ TEXT
Definition types.h:42
@ BRACKET
Definition types.h:124
@ VIBRATO_SEGMENT
Definition types.h:91
@ SLUR
Definition types.h:129
@ SYSTEM_TEXT
Definition types.h:78
@ BREATH
Definition types.h:61
@ STAFF_TEXT
Definition types.h:77
@ TREMOLOBAR
Definition types.h:85
@ OSSIA
Definition types.h:139
@ COMPOUND
Definition types.h:127
@ TRILL
Definition types.h:115
@ LYRICSLINE
Definition types.h:122
@ VBOX
Definition types.h:135
@ LET_RING
Definition types.h:116
@ NOTEHEAD
Definition types.h:101
@ STAFF_STATE
Definition types.h:100
@ STEM_SLASH
Definition types.h:50
@ MEASURE
Definition types.h:105
@ TREMOLO
Definition types.h:103
@ STAFF_LINES
Definition types.h:48
@ ELEMENT
Definition types.h:130
@ VOLTA_SEGMENT
Definition types.h:94
@ STAFF
Definition types.h:39
@ TIE
Definition types.h:63
@ SYMBOL
Definition types.h:41
@ OTTAVA
Definition types.h:113
@ MAXTYPE
Definition types.h:143
@ TIMESIG
Definition types.h:59
@ FINGERING
Definition types.h:74
@ PART
Definition types.h:38
@ HARMONY
Definition types.h:82
@ LEDGER_LINE
Definition types.h:53
@ TEMPO_TEXT
Definition types.h:76
@ AMBITUS
Definition types.h:58
@ NOTEDOT
Definition types.h:102
@ LAYOUT_BREAK
Definition types.h:98
@ GLISSANDO
Definition types.h:123
@ MEASURE_LIST
Definition types.h:133
@ ELEMENT_LIST
Definition types.h:131
@ PEDAL
Definition types.h:114
@ KEYSIG
Definition types.h:57
@ VIBRATO
Definition types.h:117
@ FIGURED_BASS
Definition types.h:71
@ SCORE
Definition types.h:40
@ ARTICULATION
Definition types.h:64
@ INVALID
Definition types.h:36
@ STAFFTYPE_CHANGE
Definition types.h:81
@ ACCIDENTAL
Definition types.h:52
@ CHORDLINE
Definition types.h:66
@ SPACER
Definition types.h:99
@ SLUR_SEGMENT
Definition types.h:45
@ INSTRUMENT_NAME
Definition types.h:44
@ TEXTLINE_BASE
Definition types.h:120
@ FRET_DIAGRAM
Definition types.h:83
@ TRILL_SEGMENT
Definition types.h:89
@ ICON
Definition types.h:138
@ INSTRUMENT_CHANGE
Definition types.h:80
@ SYSTEM_DIVIDER
Definition types.h:49
@ LYRICSLINE_SEGMENT
Definition types.h:96
@ TAB_DURATION_SYMBOL
Definition types.h:109
@ GLISSANDO_SEGMENT
Definition types.h:97
@ BRACKET_ITEM
Definition types.h:37
@ BEND
Definition types.h:84
@ CLEF
Definition types.h:56
@ BAGPIPE_EMBELLISHMENT
Definition types.h:140
@ SHADOW_NOTE
Definition types.h:108
@ REPEAT_MEASURE
Definition types.h:62
@ VOLTA
Definition types.h:86
@ MEASURE_NUMBER
Definition types.h:43
@ SYSTEM
Definition types.h:126
@ STAFF_LIST
Definition types.h:132
@ STICKING
Definition types.h:141
Direction
Definition types.h:281
@ DOWN
Definition types.h:283
@ AUTO
Definition types.h:283
@ UP
Definition types.h:283
OffsetType
Definition types.h:321
@ SPATIUM
offset in staff space units
Definition types.h:323
@ ABS
offset in point units
Definition types.h:322
SegmentType
Definition types.h:332
@ Breath
Definition types.h:343
@ Invalid
Definition types.h:334
@ Clef
Definition types.h:341
@ TimeSig
Definition types.h:339
@ Ambitus
Definition types.h:338
@ StartRepeatBarLine
Definition types.h:340
@ ChordRest
Definition types.h:345
@ BeginBarLine
Definition types.h:335
@ BarLine
Definition types.h:342
@ TimeSigAnnounce
Definition types.h:349
@ All
Includes all barline types.
Definition types.h:350
@ KeySig
Definition types.h:337
@ EndBarLine
Definition types.h:347
@ HeaderClef
Definition types.h:336
@ KeySigAnnounce
Definition types.h:348
Placement
Definition types.h:311
@ BELOW
Definition types.h:313
@ ABOVE
Definition types.h:313
GlissandoType
Definition types.h:291
@ STRAIGHT
Definition types.h:293
@ WAVY
Definition types.h:293
Tid
Enumerates the list of built-in text substyles.
Definition types.h:370
@ USER2
Definition types.h:415
@ FOOTER
Definition types.h:411
@ REPEAT_LEFT
Definition types.h:398
@ DYNAMICS
Definition types.h:386
@ TRANSLATOR
Definition types.h:391
@ SUBTITLE
Definition types.h:374
@ LYRICS_ODD
Definition types.h:377
TEXT_STYLES
Definition types.h:420
@ INSTRUMENT_EXCERPT
Definition types.h:385
@ INSTRUMENT_LONG
Definition types.h:383
@ DEFAULT
Definition types.h:372
@ COMPOSER
Definition types.h:375
@ LH_GUITAR_FINGERING
Definition types.h:380
@ HARMONY_B
Definition types.h:396
@ REPEAT_RIGHT
Definition types.h:399
@ USER5
Definition types.h:418
@ TITLE
Definition types.h:373
@ HEADER
Definition types.h:410
@ TEMPO
Definition types.h:388
@ USER1
Definition types.h:414
@ LYRICS_EVEN
Definition types.h:378
@ RH_GUITAR_FINGERING
Definition types.h:381
@ USER6
Definition types.h:419
@ INSTRUMENT_SHORT
Definition types.h:384
@ FRAME
Definition types.h:400
@ USER3
Definition types.h:416
@ HARMONY_A
Definition types.h:395
@ METRONOME
Definition types.h:389
@ USER4
Definition types.h:417
@ EXPRESSION
Definition types.h:387
@ POET
Definition types.h:376
@ STRING_NUMBER
Definition types.h:382
GlissandoStyle
Definition types.h:301
@ WHITE_KEYS
Definition types.h:303
@ CHROMATIC
Definition types.h:303
@ BLACK_KEYS
Definition types.h:303
@ DIATONIC
Definition types.h:303
AccidentalType
Definition types.h:151
@ NATURAL_EQUAL_TEMPERED
Definition types.h:237
@ NATURAL_TWO_ARROWS_DOWN
Definition types.h:204
@ FLAT_SLASH2
Definition types.h:184
@ SORI
Definition types.h:244
@ FLAT_SLASH
Definition types.h:185
@ SHARP_SHARP
Definition types.h:163
@ SHARP_ONE_ARROW_UP
Definition types.h:199
@ FLAT2_ARROW_DOWN
Definition types.h:175
@ SHARP_SLASH
Definition types.h:180
@ SHARP2_ARROW_UP
Definition types.h:172
@ RAISE_ONE_TRIDECIMAL_QUARTERTONE
Definition types.h:233
@ MIRRORED_FLAT
Definition types.h:178
@ SHARP_SLASH4
Definition types.h:181
@ LOWER_ONE_TRIDECIMAL_QUARTERTONE
Definition types.h:232
@ NATURAL_ONE_ARROW_DOWN
Definition types.h:192
@ DOUBLE_FLAT_ONE_ARROW_DOWN
Definition types.h:190
@ DOUBLE_SHARP_ONE_ARROW_UP
Definition types.h:200
@ DOUBLE_FLAT_EQUAL_TEMPERED
Definition types.h:235
@ SHARP_SLASH3
Definition types.h:186
@ FLAT_THREE_ARROWS_UP
Definition types.h:220
@ MIRRORED_FLAT2
Definition types.h:179
@ FLAT_TWO_ARROWS_DOWN
Definition types.h:202
@ LOWER_ONE_UNDECIMAL_QUARTERTONE
Definition types.h:229
@ NATURAL_TWO_ARROWS_UP
Definition types.h:209
@ DOUBLE_SHARP_EQUAL_TEMPERED
Definition types.h:239
@ SHARP_ARROW_UP
Definition types.h:170
@ SHARP_THREE_ARROWS_UP
Definition types.h:222
@ DOUBLE_FLAT_TWO_ARROWS_UP
Definition types.h:207
@ NATURAL_SHARP
Definition types.h:162
@ NATURAL
Definition types.h:155
@ LOWER_TWO_SEPTIMAL_COMMAS
Definition types.h:227
@ DOUBLE_SHARP_TWO_ARROWS_UP
Definition types.h:212
@ DOUBLE_FLAT_THREE_ARROWS_UP
Definition types.h:219
@ QUARTER_SHARP_EQUAL_TEMPERED
Definition types.h:241
@ DOUBLE_FLAT_THREE_ARROWS_DOWN
Definition types.h:213
@ DOUBLE_SHARP_THREE_ARROWS_DOWN
Definition types.h:218
@ SHARP_TWO_ARROWS_UP
Definition types.h:211
@ SHARP_THREE_ARROWS_DOWN
Definition types.h:216
@ DOUBLE_FLAT_ONE_ARROW_UP
Definition types.h:195
@ SHARP_TWO_ARROWS_DOWN
Definition types.h:205
@ QUARTER_FLAT_EQUAL_TEMPERED
Definition types.h:240
@ RAISE_TWO_SEPTIMAL_COMMAS
Definition types.h:228
@ SHARP2_ARROW_DOWN
Definition types.h:173
@ SHARP_EQUAL_TEMPERED
Definition types.h:238
@ NATURAL_THREE_ARROWS_UP
Definition types.h:221
@ SHARP2
Definition types.h:157
@ NATURAL_ARROW_UP
Definition types.h:168
@ SHARP
Definition types.h:156
@ DOUBLE_FLAT_TWO_ARROWS_DOWN
Definition types.h:201
@ FLAT2_ARROW_UP
Definition types.h:174
@ SHARP_ONE_ARROW_DOWN
Definition types.h:193
@ NATURAL_ARROW_DOWN
Definition types.h:169
@ NATURAL_ONE_ARROW_UP
Definition types.h:198
@ FLAT_ARROW_UP
Definition types.h:166
@ SHARP_SLASH2
Definition types.h:187
@ NATURAL_THREE_ARROWS_DOWN
Definition types.h:215
@ END
Definition types.h:246
@ FLAT_ONE_ARROW_DOWN
Definition types.h:191
@ NONE
Definition types.h:153
@ FLAT_TWO_ARROWS_UP
Definition types.h:208
@ NATURAL_FLAT
Definition types.h:161
@ SHARP_ARROW_DOWN
Definition types.h:171
@ KORON
Definition types.h:245
@ DOUBLE_SHARP_TWO_ARROWS_DOWN
Definition types.h:206
@ FLAT2
Definition types.h:158
@ RAISE_ONE_UNDECIMAL_QUARTERTONE
Definition types.h:230
@ LOWER_ONE_SEPTIMAL_COMMA
Definition types.h:225
@ RAISE_ONE_SEPTIMAL_COMMA
Definition types.h:226
@ FLAT_ARROW_DOWN
Definition types.h:167
@ DOUBLE_SHARP_ONE_ARROW_DOWN
Definition types.h:194
@ FLAT_ONE_ARROW_UP
Definition types.h:197
@ DOUBLE_SHARP_THREE_ARROWS_UP
Definition types.h:223
@ FLAT_EQUAL_TEMPERED
Definition types.h:236
@ FLAT
Definition types.h:154
@ FLAT_THREE_ARROWS_DOWN
Definition types.h:214