MuseScore/libmscore/style.h

905 lines
20 KiB
C
Raw Normal View History

2012-05-26 14:26:10 +02:00
//=============================================================================
// MuseScore
// Music Composition & Notation
//
// Copyright (C) 2002-2011 Werner Schweer
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2
// as published by the Free Software Foundation and appearing in
// the file LICENCE.GPL
//=============================================================================
#ifndef __STYLE_H__
#define __STYLE_H__
2016-03-02 13:20:19 +01:00
#include "chordlist.h"
2012-05-26 14:26:10 +02:00
2013-05-13 18:49:17 +02:00
namespace Ms {
2018-03-27 15:36:00 +02:00
enum class Pid : int;
2016-11-19 11:51:21 +01:00
class XmlWriter;
2012-05-26 14:26:10 +02:00
struct ChordDescription;
class Element;
//---------------------------------------------------------
2018-03-27 15:36:00 +02:00
// Sid
//
// Keep in sync with styleTypes[] in style.cpp
2012-05-26 14:26:10 +02:00
//---------------------------------------------------------
2018-03-27 15:36:00 +02:00
enum class Sid {
NOSTYLE = -1,
pageWidth,
pageHeight,
pagePrintableWidth,
pageEvenLeftMargin,
pageOddLeftMargin,
pageEvenTopMargin,
pageEvenBottomMargin,
pageOddTopMargin,
pageOddBottomMargin,
pageTwosided,
2014-05-26 15:31:36 +02:00
staffUpperBorder,
staffLowerBorder,
staffDistance,
akkoladeDistance,
minSystemDistance,
maxSystemDistance,
2016-08-26 12:43:43 +02:00
lyricsPlacement,
lyricsPosAbove,
lyricsPosBelow,
lyricsMinTopDistance,
2014-05-26 15:31:36 +02:00
lyricsMinBottomDistance,
lyricsLineHeight,
2016-08-26 12:43:43 +02:00
lyricsDashMinLength,
lyricsDashMaxLength,
lyricsDashMaxDistance,
lyricsDashForce,
lyricsAlignVerseNumber,
lyricsLineThickness,
2014-05-26 15:31:36 +02:00
figuredBassFontFamily,
2017-01-16 20:51:12 +01:00
// figuredBassFontSize,
2014-05-26 15:31:36 +02:00
figuredBassYOffset,
figuredBassLineHeight,
figuredBassAlignment,
figuredBassStyle,
systemFrameDistance,
frameSystemDistance,
minMeasureWidth,
barWidth,
doubleBarWidth,
endBarWidth,
doubleBarDistance,
endBarDistance,
repeatBarlineDotSeparation,
2014-05-26 15:31:36 +02:00
repeatBarTips,
startBarlineSingle,
startBarlineMultiple,
bracketWidth,
bracketDistance,
akkoladeWidth,
akkoladeBarDistance,
2015-07-25 08:43:02 +02:00
dividerLeft,
dividerLeftSym,
dividerLeftX,
dividerLeftY,
dividerRight,
dividerRightSym,
dividerRightX,
dividerRightY,
2014-05-26 15:31:36 +02:00
clefLeftMargin,
keysigLeftMargin,
ambitusMargin,
2014-05-26 15:31:36 +02:00
timesigLeftMargin,
timesigScale,
2014-05-26 15:31:36 +02:00
clefKeyRightMargin,
2016-10-06 12:21:28 +02:00
clefKeyDistance,
clefTimesigDistance,
keyTimesigDistance,
keyBarlineDistance,
systemHeaderDistance,
systemHeaderTimeSigDistance,
2016-03-02 13:20:19 +01:00
2014-05-26 15:31:36 +02:00
clefBarlineDistance,
timesigBarlineDistance,
2014-05-26 15:31:36 +02:00
stemWidth,
shortenStem,
shortStemProgression,
shortestStem,
beginRepeatLeftMargin,
minNoteDistance,
barNoteDistance,
barAccidentalDistance,
multiMeasureRestMargin,
noteBarDistance,
measureSpacing,
staffLineWidth,
ledgerLineWidth,
ledgerLineLength,
accidentalDistance,
accidentalNoteDistance,
beamWidth,
beamDistance,
beamMinLen,
beamNoSlope,
dotMag,
dotNoteDistance,
dotRestDistance,
dotDotDistance,
propertyDistanceHead,
propertyDistanceStem,
propertyDistance,
articulationMag,
lastSystemFillLimit,
2016-11-18 14:28:53 +01:00
hairpinPlacement,
hairpinPosAbove,
hairpinPosBelow,
2014-05-26 15:31:36 +02:00
hairpinHeight,
hairpinContHeight,
hairpinLineWidth,
2018-03-27 14:40:34 +02:00
hairpinFontFace,
hairpinFontSize,
hairpinFontBold,
hairpinFontItalic,
hairpinFontUnderline,
hairpinTextAlign,
2014-05-26 15:31:36 +02:00
2016-11-18 14:28:53 +01:00
pedalPlacement,
pedalPosAbove,
pedalPosBelow,
2014-05-26 15:31:36 +02:00
pedalLineWidth,
pedalLineStyle,
2017-02-07 18:48:23 +01:00
pedalBeginTextOffset,
2017-06-08 15:43:05 +02:00
pedalHookHeight,
2018-03-27 14:40:34 +02:00
pedalFontFace,
pedalFontSize,
pedalFontBold,
pedalFontItalic,
pedalFontUnderline,
pedalTextAlign,
2014-05-26 15:31:36 +02:00
2016-11-18 14:28:53 +01:00
trillPlacement,
trillPosAbove,
trillPosBelow,
2017-11-30 22:14:12 +01:00
vibratoPlacement,
vibratoPosAbove,
vibratoPosBelow,
2014-05-26 15:31:36 +02:00
harmonyY,
harmonyFretDist,
minHarmonyDistance,
maxHarmonyBarDistance,
capoPosition,
fretNumMag,
fretNumPos,
fretY,
fretMinDistance,
2014-05-26 15:31:36 +02:00
showPageNumber,
showPageNumberOne,
pageNumberOddEven,
showMeasureNumber,
showMeasureNumberOne,
measureNumberInterval,
measureNumberSystem,
measureNumberAllStaffs,
smallNoteMag,
graceNoteMag,
smallStaffMag,
smallClefMag,
genClef,
genKeysig,
genCourtesyTimesig,
genCourtesyKeysig,
genCourtesyClef,
swingRatio,
swingUnit,
2014-05-26 15:31:36 +02:00
useStandardNoteNames,
useGermanNoteNames,
useFullGermanNoteNames,
2014-05-26 15:31:36 +02:00
useSolfeggioNoteNames,
useFrenchNoteNames,
automaticCapitalization,
2014-05-26 15:31:36 +02:00
lowerCaseMinorChords,
lowerCaseBassNotes,
allCapsNoteNames,
2014-05-26 15:31:36 +02:00
chordStyle,
chordsXmlFile,
chordDescriptionFile,
concertPitch,
createMultiMeasureRests,
minEmptyMeasures,
minMMRestWidth,
hideEmptyStaves,
dontHideStavesInFirstSystem,
hideInstrumentNameIfOneInstrument,
gateTime,
tenutoGateTime,
staccatoGateTime,
slurGateTime,
ArpeggioNoteDistance,
ArpeggioLineWidth,
ArpeggioHookLen,
ArpeggioHiddenInStdIfTab,
2014-05-26 15:31:36 +02:00
SlurEndWidth,
SlurMidWidth,
SlurDottedWidth,
MinTieLength,
2017-06-24 15:52:00 +02:00
SlurMinDistance,
2014-05-26 15:31:36 +02:00
SectionPause,
MusicalSymbolFont,
2014-07-26 11:03:22 +02:00
MusicalTextFont,
2014-05-26 15:31:36 +02:00
showHeader,
headerFirstPage,
headerOddEven,
evenHeaderL,
evenHeaderC,
evenHeaderR,
oddHeaderL,
oddHeaderC,
oddHeaderR,
showFooter,
footerFirstPage,
footerOddEven,
evenFooterL,
evenFooterC,
evenFooterR,
oddFooterL,
oddFooterC,
oddFooterR,
voltaY,
voltaHook,
voltaLineWidth,
voltaLineStyle,
2018-03-27 14:40:34 +02:00
voltaFontFace,
voltaFontSize,
voltaFontBold,
voltaFontItalic,
voltaFontUnderline,
voltaAlign,
voltaOffset,
2014-05-26 15:31:36 +02:00
2016-11-18 14:28:53 +01:00
ottavaPlacement,
ottavaPosAbove,
ottavaPosBelow,
2014-05-26 15:31:36 +02:00
ottavaHook,
ottavaLineWidth,
ottavaLineStyle,
ottavaNumbersOnly,
2018-03-27 14:40:34 +02:00
ottavaFontFace,
ottavaFontSize,
ottavaFontBold,
ottavaFontItalic,
ottavaFontUnderline,
ottavaTextAlign,
2014-05-26 15:31:36 +02:00
tabClef,
tremoloWidth,
tremoloBoxHeight,
tremoloStrokeWidth,
tremoloDistance,
// TODO tremoloBeamLengthMultiplier,
// TODO tremoloMaxBeamLength,
2014-05-26 15:31:36 +02:00
linearStretch,
crossMeasureValues,
keySigNaturals,
tupletMaxSlope,
tupletOufOfStaff,
tupletVHeadDistance,
tupletVStemDistance,
tupletStemLeftDistance,
tupletStemRightDistance,
tupletNoteLeftDistance,
tupletNoteRightDistance,
tupletBracketWidth,
tupletDirection,
tupletNumberType,
tupletBracketType,
2018-03-27 14:40:34 +02:00
tupletFontFace,
tupletFontSize,
tupletFontBold,
tupletFontItalic,
tupletFontUnderline,
tupletAlign,
2014-05-26 15:31:36 +02:00
barreLineWidth,
fretMag,
scaleBarlines,
barGraceDistance,
2016-01-04 14:48:58 +01:00
minVerticalDistance,
2016-03-02 13:20:19 +01:00
ornamentStyle,
spatium,
2016-01-04 14:48:58 +01:00
2016-07-25 12:29:24 +02:00
autoplaceHairpinDynamicsDistance,
2016-11-18 14:28:53 +01:00
dynamicsPlacement,
dynamicsPosAbove,
dynamicsPosBelow,
2016-08-02 17:00:49 +02:00
dynamicsMinDistance,
autoplaceVerticalAlignRange,
2016-07-25 12:29:24 +02:00
textLinePlacement,
textLinePosAbove,
textLinePosBelow,
2016-09-20 17:13:54 +02:00
tremoloBarLineWidth,
2017-02-10 15:13:23 +01:00
jumpPosAbove,
markerPosAbove,
2016-09-20 17:13:54 +02:00
2017-01-16 20:51:12 +01:00
defaultFontFace,
defaultFontSize,
defaultFontSpatiumDependent,
defaultFontBold,
defaultFontItalic,
defaultFontUnderline,
defaultAlign,
defaultFrame,
defaultFrameSquare,
defaultFrameCircle,
defaultFramePadding,
defaultFrameWidth,
defaultFrameRound,
defaultFrameFgColor,
defaultFrameBgColor,
defaultOffset,
defaultOffsetType,
defaultSystemFlag,
2018-03-27 14:40:34 +02:00
defaultText,
2017-01-16 20:51:12 +01:00
titleFontFace,
titleFontSize,
titleFontSpatiumDependent,
titleFontBold,
titleFontItalic,
titleFontUnderline,
titleAlign,
titleOffset,
titleOffsetType,
subTitleFontFace,
subTitleFontSize,
subTitleFontSpatiumDependent,
subTitleFontBold,
subTitleFontItalic,
subTitleFontUnderline,
subTitleAlign,
subTitleOffset,
subTitleOffsetType,
composerFontFace,
composerFontSize,
composerFontSpatiumDependent,
composerFontBold,
composerFontItalic,
composerFontUnderline,
composerAlign,
composerOffset,
composerOffsetType,
lyricistFontFace,
lyricistFontSize,
lyricistFontSpatiumDependent,
lyricistFontBold,
lyricistFontItalic,
lyricistFontUnderline,
lyricistAlign,
lyricistOffset,
lyricistOffsetType,
lyricsOddFontFace,
lyricsOddFontSize,
lyricsOddFontBold,
lyricsOddFontItalic,
lyricsOddFontUnderline,
lyricsOddAlign,
lyricsOddOffset,
lyricsEvenFontFace,
lyricsEvenFontSize,
lyricsEvenFontBold,
lyricsEvenFontItalic,
lyricsEvenFontUnderline,
lyricsEvenAlign,
lyricsEvenOffset,
fingeringFontFace,
fingeringFontSize,
fingeringFontBold,
fingeringFontItalic,
fingeringFontUnderline,
fingeringAlign,
fingeringFrame,
fingeringFrameSquare,
fingeringFrameCircle,
fingeringFramePadding,
fingeringFrameWidth,
fingeringFrameRound,
fingeringFrameFgColor,
fingeringFrameBgColor,
2017-01-17 17:52:17 +01:00
fingeringOffset,
2017-01-16 20:51:12 +01:00
lhGuitarFingeringFontFace,
lhGuitarFingeringFontSize,
lhGuitarFingeringFontBold,
lhGuitarFingeringFontItalic,
lhGuitarFingeringFontUnderline,
lhGuitarFingeringAlign,
lhGuitarFingeringFrame,
lhGuitarFingeringFrameSquare,
lhGuitarFingeringFrameCircle,
lhGuitarFingeringFramePadding,
lhGuitarFingeringFrameWidth,
lhGuitarFingeringFrameRound,
lhGuitarFingeringFrameFgColor,
lhGuitarFingeringFrameBgColor,
lhGuitarFingeringOffset,
rhGuitarFingeringFontFace,
rhGuitarFingeringFontSize,
rhGuitarFingeringFontBold,
rhGuitarFingeringFontItalic,
rhGuitarFingeringFontUnderline,
rhGuitarFingeringAlign,
rhGuitarFingeringFrame,
rhGuitarFingeringFrameSquare,
rhGuitarFingeringFrameCircle,
rhGuitarFingeringFramePadding,
rhGuitarFingeringFrameWidth,
rhGuitarFingeringFrameRound,
rhGuitarFingeringFrameFgColor,
rhGuitarFingeringFrameBgColor,
rhGuitarFingeringOffset,
stringNumberFontFace,
stringNumberFontSize,
stringNumberFontBold,
stringNumberFontItalic,
stringNumberFontUnderline,
stringNumberAlign,
stringNumberFrame,
stringNumberFrameSquare,
stringNumberFrameCircle,
stringNumberFramePadding,
stringNumberFrameWidth,
stringNumberFrameRound,
stringNumberFrameFgColor,
stringNumberFrameBgColor,
stringNumberOffset,
longInstrumentFontFace,
longInstrumentFontSize,
longInstrumentFontBold,
longInstrumentFontItalic,
longInstrumentFontUnderline,
longInstrumentAlign,
2017-01-16 20:51:12 +01:00
shortInstrumentFontFace,
shortInstrumentFontSize,
shortInstrumentFontBold,
shortInstrumentFontItalic,
shortInstrumentFontUnderline,
shortInstrumentAlign,
2017-01-16 20:51:12 +01:00
partInstrumentFontFace,
partInstrumentFontSize,
partInstrumentFontBold,
partInstrumentFontItalic,
partInstrumentFontUnderline,
dynamicsFontFace,
dynamicsFontSize,
dynamicsFontBold,
dynamicsFontItalic,
dynamicsFontUnderline,
dynamicsAlign,
expressionFontFace,
expressionFontSize,
expressionFontBold,
expressionFontItalic,
expressionFontUnderline,
expressionAlign,
tempoFontFace,
tempoFontSize,
tempoFontBold,
tempoFontItalic,
tempoFontUnderline,
tempoAlign,
tempoOffset,
tempoSystemFlag,
2017-02-08 13:27:35 +01:00
tempoPlacement,
tempoPosAbove,
tempoPosBelow,
tempoMinDistance,
2017-01-16 20:51:12 +01:00
metronomeFontFace,
metronomeFontSize,
metronomeFontBold,
metronomeFontItalic,
metronomeFontUnderline,
measureNumberFontFace,
measureNumberFontSize,
measureNumberFontBold,
measureNumberFontItalic,
measureNumberFontUnderline,
measureNumberOffset,
measureNumberOffsetType,
translatorFontFace,
translatorFontSize,
translatorFontBold,
translatorFontItalic,
translatorFontUnderline,
systemFontFace,
systemFontSize,
systemFontBold,
systemFontItalic,
systemFontUnderline,
systemOffset,
2017-01-23 10:54:57 +01:00
systemOffsetType,
2017-10-20 12:23:39 +02:00
systemAlign,
2017-01-16 20:51:12 +01:00
2018-02-01 15:36:20 +01:00
staffTextFontFace,
staffTextFontSize,
staffTextFontBold,
staffTextFontItalic,
staffTextFontUnderline,
staffTextAlign,
staffTextOffset,
staffTextOffsetType,
staffTextPlacement,
staffTextPosAbove,
staffTextPosBelow,
staffTextMinDistance,
2017-01-16 20:51:12 +01:00
chordSymbolFontFace,
chordSymbolFontSize,
chordSymbolFontBold,
chordSymbolFontItalic,
chordSymbolFontUnderline,
2017-10-20 12:00:15 +02:00
chordSymbolAlign,
2017-01-16 20:51:12 +01:00
rehearsalMarkFontFace,
rehearsalMarkFontSize,
rehearsalMarkFontBold,
rehearsalMarkFontItalic,
rehearsalMarkFontUnderline,
2017-09-14 11:20:13 +02:00
rehearsalMarkAlign,
2017-01-16 20:51:12 +01:00
rehearsalMarkFrame,
rehearsalMarkFrameSquare,
rehearsalMarkFrameCircle,
rehearsalMarkFramePadding,
rehearsalMarkFrameWidth,
rehearsalMarkFrameRound,
rehearsalMarkFrameFgColor,
rehearsalMarkFrameBgColor,
2017-02-08 18:11:51 +01:00
rehearsalMarkPlacement,
rehearsalMarkPosAbove,
rehearsalMarkPosBelow,
rehearsalMarkMinDistance,
2017-01-16 20:51:12 +01:00
repeatLeftFontFace,
repeatLeftFontSize,
repeatLeftFontBold,
repeatLeftFontItalic,
repeatLeftFontUnderline,
2017-02-10 15:13:23 +01:00
repeatLeftAlign,
2018-03-21 14:05:33 +01:00
repeatLeftPlacement,
2017-01-16 20:51:12 +01:00
repeatRightFontFace,
repeatRightFontSize,
repeatRightFontBold,
repeatRightFontItalic,
repeatRightFontUnderline,
2017-02-10 15:13:23 +01:00
repeatRightAlign,
2018-03-21 14:05:33 +01:00
repeatRightPlacement,
2017-01-16 20:51:12 +01:00
frameFontFace,
frameFontSize,
frameFontBold,
frameFontItalic,
frameFontUnderline,
2017-01-25 15:54:46 +01:00
frameAlign,
2017-01-16 20:51:12 +01:00
textLineFontFace,
textLineFontSize,
textLineFontBold,
textLineFontItalic,
textLineFontUnderline,
glissandoFontFace,
glissandoFontSize,
glissandoFontBold,
glissandoFontItalic,
glissandoFontUnderline,
glissandoLineWidth,
2018-03-27 14:40:34 +02:00
glissandoText,
2017-01-16 20:51:12 +01:00
bendFontFace,
bendFontSize,
bendFontBold,
bendFontItalic,
bendFontUnderline,
bendLineWidth,
2018-03-19 11:57:08 +01:00
bendArrowWidth,
2017-01-16 20:51:12 +01:00
headerFontFace,
headerFontSize,
headerFontBold,
headerFontItalic,
headerFontUnderline,
footerFontFace,
footerFontSize,
footerFontBold,
footerFontItalic,
footerFontUnderline,
instrumentChangeFontFace,
instrumentChangeFontSize,
instrumentChangeFontBold,
instrumentChangeFontItalic,
instrumentChangeFontUnderline,
2018-02-01 15:36:20 +01:00
instrumentChangeAlign,
2017-01-16 20:51:12 +01:00
instrumentChangeOffset,
figuredBassFontFace,
figuredBassFontSize,
figuredBassFontBold,
figuredBassFontItalic,
figuredBassFontUnderline,
2017-01-18 14:16:33 +01:00
user1FontFace,
user1FontSize,
user1FontBold,
user1FontItalic,
user1FontUnderline,
user1Align,
user1Offset,
user1OffsetType,
2017-01-18 14:16:33 +01:00
user2FontFace,
user2FontSize,
user2FontBold,
user2FontItalic,
user2FontUnderline,
user2Align,
user2Offset,
user2OffsetType,
user3FontFace,
user3FontSize,
user3FontBold,
user3FontItalic,
user3FontUnderline,
user3Align,
user3Offset,
user3OffsetType,
user4FontFace,
user4FontSize,
user4FontBold,
user4FontItalic,
user4FontUnderline,
user4Align,
user4Offset,
user4OffsetType,
user5FontFace,
user5FontSize,
user5FontBold,
user5FontItalic,
user5FontUnderline,
user5Align,
user5Offset,
user5OffsetType,
user6FontFace,
user6FontSize,
user6FontBold,
user6FontItalic,
user6FontUnderline,
user6Align,
user6Offset,
user6OffsetType,
2017-01-18 14:16:33 +01:00
2017-11-27 16:55:52 +01:00
letRingFontFace,
letRingFontSize,
letRingFontBold,
letRingFontItalic,
letRingFontUnderline,
letRingTextAlign,
letRingHookHeight,
letRingPlacement,
letRingPosAbove,
letRingPosBelow,
letRingLineWidth,
letRingLineStyle,
letRingBeginTextOffset,
letRingText,
palmMuteFontFace,
palmMuteFontSize,
palmMuteFontBold,
palmMuteFontItalic,
palmMuteFontUnderline,
palmMuteTextAlign,
palmMuteHookHeight,
2017-11-28 09:28:59 +01:00
palmMutePlacement,
palmMutePosAbove,
palmMutePosBelow,
palmMuteLineWidth,
palmMuteLineStyle,
palmMuteBeginTextOffset,
palmMuteText,
2017-11-27 16:55:52 +01:00
fermataPosAbove,
fermataPosBelow,
fermataMinDistance,
2014-05-26 15:31:36 +02:00
STYLES
2012-05-26 14:26:10 +02:00
};
2017-01-16 20:51:12 +01:00
//---------------------------------------------------------
// StyledProperty
//---------------------------------------------------------
struct StyledProperty {
2018-03-28 10:43:28 +02:00
Sid sid;
Pid pid;
2017-01-16 20:51:12 +01:00
};
//-------------------------------------------------------------------
2018-03-21 14:05:33 +01:00
// SubStyleId
2017-01-16 20:51:12 +01:00
// Enumerate the list of built-in substyles
// must be in sync with namedStyles array
//-------------------------------------------------------------------
2018-03-21 14:05:33 +01:00
enum class SubStyleId {
EMPTY,
2017-01-16 20:51:12 +01:00
DEFAULT,
TITLE,
SUBTITLE,
COMPOSER,
POET,
2018-03-21 14:05:33 +01:00
LYRIC_ODD,
LYRIC_EVEN,
2017-01-16 20:51:12 +01:00
FINGERING,
LH_GUITAR_FINGERING,
RH_GUITAR_FINGERING,
STRING_NUMBER,
INSTRUMENT_LONG,
INSTRUMENT_SHORT,
INSTRUMENT_EXCERPT,
DYNAMICS,
EXPRESSION,
TEMPO,
METRONOME,
MEASURE_NUMBER,
TRANSLATOR,
TUPLET,
SYSTEM,
STAFF,
HARMONY,
REHEARSAL_MARK,
REPEAT_LEFT, // align to start of measure
REPEAT_RIGHT, // align to end of measure
FRAME,
TEXTLINE,
GLISSANDO,
OTTAVA,
2018-03-27 14:40:34 +02:00
VOLTA,
2017-01-16 20:51:12 +01:00
PEDAL,
2017-11-27 16:55:52 +01:00
LET_RING,
PALM_MUTE,
2017-01-16 20:51:12 +01:00
HAIRPIN,
BEND,
HEADER,
FOOTER,
INSTRUMENT_CHANGE,
FIGURED_BASS,
2018-03-22 09:51:50 +01:00
BEAM,
BOX,
FRET,
2018-04-12 12:58:26 +02:00
TREMOLO_BAR,
2018-04-12 18:14:19 +02:00
TIMESIG,
2018-05-07 19:05:34 +02:00
STEM,
2017-01-18 14:16:33 +01:00
USER1,
USER2,
USER3,
USER4,
USER5,
USER6,
2017-01-16 20:51:12 +01:00
SUBSTYLES
};
2012-05-26 14:26:10 +02:00
//---------------------------------------------------------
// MStyle
//---------------------------------------------------------
class MStyle {
2018-03-27 15:36:00 +02:00
std::array<QVariant, int(Sid::STYLES)> _values;
std::array<qreal, int(Sid::STYLES)> _precomputedValues;
2016-03-02 13:20:19 +01:00
ChordList _chordList;
bool _customChordList; // if true, chordlist will be saved as part of score
2012-05-26 14:26:10 +02:00
public:
MStyle();
2017-01-17 09:58:32 +01:00
void precomputeValues();
2018-03-27 15:36:00 +02:00
QVariant value(Sid idx) const;
qreal pvalue(Sid idx) const { return _precomputedValues[int(idx)]; }
void set(Sid idx, const QVariant& v);
2017-01-16 20:51:12 +01:00
2018-03-27 15:36:00 +02:00
bool isDefault(Sid idx) const;
2017-01-16 20:51:12 +01:00
2012-05-26 14:26:10 +02:00
const ChordDescription* chordDescription(int id) const;
2016-03-02 13:20:19 +01:00
ChordList* chordList() { return &_chordList; }
void setChordList(ChordList*, bool custom = true); // Style gets ownership of ChordList
2016-09-19 22:57:36 +02:00
void setCustomChordList(bool t) { _customChordList = t; }
2012-05-26 14:26:10 +02:00
bool load(QFile* qf);
2013-01-11 18:10:18 +01:00
void load(XmlReader& e);
2016-11-19 11:51:21 +01:00
void save(XmlWriter& xml, bool optimize);
2017-01-16 20:51:12 +01:00
bool readProperties(XmlReader&);
2016-03-02 13:20:19 +01:00
2018-03-27 15:36:00 +02:00
static const char* valueType(const Sid);
static const char* valueName(const Sid);
static Sid styleIdx(const QString& name);
2012-05-26 14:26:10 +02:00
};
2018-03-21 14:05:33 +01:00
typedef std::vector<StyledProperty> SubStyle;
extern const SubStyle emptyStyle;
2018-04-12 12:06:59 +02:00
extern const SubStyle defaultStyle;
2018-03-21 14:05:33 +01:00
extern const SubStyle fingeringStyle;
const SubStyle& subStyle(SubStyleId);
const SubStyle& subStyle(const char*);
const char* subStyleName(SubStyleId);
QString subStyleUserName(SubStyleId);
SubStyleId subStyleFromName(const QString&);
2017-01-16 20:51:12 +01:00
#ifndef NDEBUG
extern void checkStyles();
#endif
2012-05-26 14:26:10 +02:00
2013-05-13 18:49:17 +02:00
} // namespace Ms
2014-03-10 10:50:12 +01:00
2012-05-26 14:26:10 +02:00
#endif