21 #define MSC_VERSION "3.01"
22 static constexpr
int MSCVERSION = 301;
69 enum class HairpinType : signed char;
75 inline int staff2track(int staffIdx) {
return staffIdx << 2; }
76 inline int track2staff(
int voice) {
return voice >> 2; }
77 inline int track2voice(
int track) {
return track & 3; }
78 inline int trackZeroVoice(
int track) {
return track & ~3; }
80 static const int MAX_TAGS = 32;
82 static constexpr qreal INCH = 25.4;
83 static constexpr qreal PPI = 72.0;
84 static constexpr qreal DPI_F = 5;
85 static constexpr qreal DPI = 72.0 * DPI_F;
86 static constexpr qreal SPATIUM20 = 5.0 * (DPI / 72.0);
87 static constexpr qreal DPMM = DPI / INCH;
89 static constexpr
int MAX_STAVES = 4;
91 static const int SHADOW_NOTE_LIGHT = 135;
93 static const char mimeSymbolFormat[] =
"application/musescore/symbol";
94 static const char mimeSymbolListFormat[] =
"application/musescore/symbollist";
95 static const char mimeStaffListFormat[] =
"application/musescore/stafflist";
97 static const int VISUAL_STRING_NONE = -100;
99 static const int STRING_NONE = -1;
100 static const int FRET_NONE = -1;
107 enum class BracketType : signed char {
108 NORMAL, BRACE, SQUARE, LINE, NO_BRACKET = -1
115 enum class PlaceText : char {
123 enum class TransposeDirection : char {
131 enum class TransposeMode : char {
132 BY_KEY, BY_INTERVAL, DIATONICALLY
139 enum class SelectType : char {
147 enum class AccidentalVal : signed char {
159 enum class KeySigNatural : char {
169 enum class UpDownMode : char {
177 enum class StaffGroup : char {
178 STANDARD, PERCUSSION, TAB
180 const int STAFF_GROUP_MAX = int(StaffGroup::TAB) + 1;
182 enum class NoteHeadScheme : char {
185 HEAD_PITCHNAME_GERMAN,
189 HEAD_SHAPE_NOTE_7_AIKIN,
190 HEAD_SHAPE_NOTE_7_FUNK,
191 HEAD_SHAPE_NOTE_7_WALKER,
199 enum class BarLineType {
206 END_START_REPEAT = 0x40,
210 constexpr BarLineType operator| (BarLineType t1, BarLineType t2) {
211 return static_cast<BarLineType
>(
static_cast<int>(t1) |
static_cast<int>(t2));
213 constexpr
bool operator& (BarLineType t1, BarLineType t2) {
214 return static_cast<int>(t1) &
static_cast<int>(t2);
219 enum class IconType : signed char {
223 SBEAM, MBEAM, NBEAM, BEAM32, BEAM64, AUTOBEAM,
225 VFRAME, HFRAME, TFRAME, FFRAME,
MEASURE,
226 BRACKETS, PARENTHESES
236 NO_CHORD_REST_SELECTED,
238 NO_NOTE_REST_SELECTED,
239 NO_NOTE_SLUR_SELECTED,
241 NO_NOTE_FIGUREDBASS_SELECTED,
242 CANNOT_INSERT_TUPLET,
244 CANNOT_SPLIT_MEASURE_FIRST_BEAT,
245 CANNOT_SPLIT_MEASURE_TUPLET,
249 DEST_LOCAL_TIME_SIGNATURE,
253 CANNOT_CHANGE_LOCAL_TIMESIG,
268 class MPaintDevice :
public QPaintDevice {
271 virtual int metric(PaintDeviceMetric m)
const;
274 MPaintDevice() : QPaintDevice() {}
275 virtual QPaintEngine* paintEngine()
const;
276 virtual ~MPaintDevice() {}
286 static MStyle _baseStyle;
287 static MStyle _defaultStyle;
288 static MStyle* _defaultStyleForParts;
290 static QString _globalShare;
291 static int _hRaster, _vRaster;
292 static bool _verticalOrientation;
294 static MPaintDevice* _paintDevice;
302 static MsError _error;
303 static std::vector<MScoreError> errorList;
307 static const MStyle& baseStyle() {
return _baseStyle; }
308 static MStyle& defaultStyle() {
return _defaultStyle; }
309 static const MStyle* defaultStyleForParts() {
return _defaultStyleForParts; }
311 static bool readDefaultStyle(QString file);
312 static void setDefaultStyle(
const MStyle& s) { _defaultStyle = s; }
313 static void defaultStyleForPartsHasChanged();
315 static const QString& globalShare() {
return _globalShare; }
316 static qreal hRaster() {
return _hRaster; }
317 static qreal vRaster() {
return _vRaster; }
318 static void setHRaster(
int val) { _hRaster = val; }
319 static void setVRaster(
int val) { _vRaster = val; }
320 static void setNudgeStep(qreal val) { nudgeStep = val; }
321 static void setNudgeStep10(qreal val) { nudgeStep10 = val; }
322 static void setNudgeStep50(qreal val) { nudgeStep50 = val; }
324 static bool verticalOrientation() {
return _verticalOrientation; }
325 static void setVerticalOrientation(
bool val) { _verticalOrientation = val; }
327 static QColor selectColor[4];
328 static QColor defaultColor;
329 static QColor dropColor;
330 static QColor layoutBreakColor;
331 static QColor frameMarginColor;
332 static QColor bgColor;
333 static bool warnPitchRange;
335 static bool playRepeats;
336 static bool panPlayback;
337 static qreal nudgeStep;
338 static qreal nudgeStep10;
339 static qreal nudgeStep50;
340 static int defaultPlayDuration;
341 static QString lastError;
344 static bool noHorizontalStretch;
345 static bool noVerticalStretch;
346 static bool showSegmentShapes;
347 static bool showSkylines;
348 static bool showMeasureShapes;
349 static bool showBoundingRect;
350 static bool showSystemBoundingRect;
351 static bool showCorruptedMeasures;
352 static bool useFallbackFont;
354 static bool debugMode;
355 static bool testMode;
358 static int sampleRate;
360 static Sequencer* seq;
362 static bool saveTemplateMode;
365 static bool noExcerpts;
366 static bool noImages;
368 static bool pdfPrinting;
369 static bool svgPrinting;
370 static double pixelRatio;
372 static qreal verticalPageGap;
373 static qreal horizontalPageGapEven;
374 static qreal horizontalPageGapOdd;
376 static MPaintDevice* paintDevice();
378 static void setError(MsError e) { _error = e; }
379 static const char* errorMessage();
380 static const char* errorGroup();
387 inline static qreal center(qreal x1, qreal x2)
389 return (x1 + (x2 - x1) * .5);
396 inline static int limit(
int val,
int min,
int max)
406 Q_DECLARE_METATYPE(Ms::BarLineType);