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
22namespace Ms {
23#ifdef SCRIPT_INTERFACE
24Q_NAMESPACE
25#endif
26
27//-------------------------------------------------------------------
32//-------------------------------------------------------------------
33
34enum class ElementType {
36 INVALID = 0,
38 PART,
39 STAFF,
40 SCORE,
41 SYMBOL,
42 TEXT,
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
58 AMBITUS,
59 TIMESIG,
60 REST,
61 BREATH,
63 TIE,
65 FERMATA,
67 DYNAMIC,
68 BEAM,
69 HOOK,
70 LYRICS,
72 MARKER,
73 JUMP,
75 TUPLET,
82 HARMONY,
84 BEND,
86 VOLTA,
99 SPACER,
101 NOTEHEAD,
102 NOTEDOT,
103 TREMOLO,
104 IMAGE,
105 MEASURE,
106 SELECTION,
107 LASSO,
110 FSYMBOL,
111 PAGE,
112 HAIRPIN,
113 OTTAVA,
114 PEDAL,
115 TRILL,
116 LET_RING,
117 VIBRATO,
118 PALM_MUTE,
119 TEXTLINE,
121 NOTELINE,
123 GLISSANDO,
124 BRACKET,
125 SEGMENT,
126 SYSTEM,
127 COMPOUND,
128 CHORD,
129 SLUR,
130 ELEMENT,
134 HBOX,
135 VBOX,
136 TBOX,
137 FBOX,
138 ICON,
139 OSSIA,
141 STICKING,
142
143 MAXTYPE
145 };
146
147//---------------------------------------------------------
148// AccidentalType
149//---------------------------------------------------------
150// NOTE: keep this in sync with with accList array
151enum class AccidentalType : char {
153 NONE,
154 FLAT,
155 NATURAL,
156 SHARP,
157 SHARP2,
158 FLAT2,
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
244 SORI,
245 KORON,
246 END
248 };
249
250//---------------------------------------------------------
251// NoteType
252//---------------------------------------------------------
253
254enum class NoteType {
256 NORMAL = 0,
257 ACCIACCATURA = 0x1,
258 APPOGGIATURA = 0x2, // grace notes
259 GRACE4 = 0x4,
260 GRACE16 = 0x8,
261 GRACE32 = 0x10,
262 GRACE8_AFTER = 0x20,
263 GRACE16_AFTER = 0x40,
264 GRACE32_AFTER = 0x80,
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 {
283 AUTO, UP, DOWN
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 {
313 ABOVE, BELOW
315 };
316
317//---------------------------------------------------------
318// OffsetType
319//---------------------------------------------------------
320
321enum class OffsetType : char {
322 ABS,
323 SPATIUM
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,
335 BeginBarLine = 0x1,
336 HeaderClef = 0x2,
337 KeySig = 0x4,
338 Ambitus = 0x8,
339 TimeSig = 0x10,
340 StartRepeatBarLine = 0x20,
341 Clef = 0x40,
342 BarLine = 0x80,
343 Breath = 0x100,
344 //--
345 ChordRest = 0x200,
346 //--
347 EndBarLine = 0x400,
348 KeySigAnnounce = 0x800,
349 TimeSigAnnounce = 0x1000,
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
370enum class Tid {
372 DEFAULT,
373 TITLE,
374 SUBTITLE,
375 COMPOSER,
376 POET,
379 FINGERING,
386 DYNAMICS,
388 TEMPO,
389 METRONOME,
392 TUPLET,
393 SYSTEM,
394 STAFF,
395 HARMONY_A,
396 HARMONY_B,
398 REPEAT_LEFT, // align to start of measure
399 REPEAT_RIGHT, // align to end of measure
400 FRAME,
401 TEXTLINE,
402 GLISSANDO,
403 OTTAVA,
404 VOLTA,
405 PEDAL,
406 LET_RING,
407 PALM_MUTE,
408 HAIRPIN,
409 BEND,
410 HEADER,
411 FOOTER,
413 STICKING,
414 USER1,
415 USER2,
416 USER3,
417 USER4,
418 USER5,
419 USER6,
422 };
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
ElementType
Definition types.h:34
Direction
Definition types.h:281
OffsetType
Definition types.h:321
@ SPATIUM
offset in staff space units
@ ABS
offset in point units
SegmentType
Definition types.h:332
@ All
Includes all barline types.
Placement
Definition types.h:311
GlissandoType
Definition types.h:291
Tid
Enumerates the list of built-in text substyles.
Definition types.h:370
@ INSTRUMENT_EXCERPT
@ INSTRUMENT_LONG
@ LH_GUITAR_FINGERING
@ REPEAT_RIGHT
@ RH_GUITAR_FINGERING
@ INSTRUMENT_SHORT
@ STRING_NUMBER
GlissandoStyle
Definition types.h:301
AccidentalType
Definition types.h:151