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__
|
|
|
|
|
|
|
|
#include "mscore.h"
|
|
|
|
#include "spatium.h"
|
|
|
|
#include "articulation.h"
|
2016-03-02 13:20:19 +01:00
|
|
|
#include "page.h"
|
|
|
|
#include "chordlist.h"
|
2012-05-26 14:26:10 +02:00
|
|
|
|
2013-05-13 18:49:17 +02:00
|
|
|
namespace Ms {
|
|
|
|
|
2012-05-26 14:26:10 +02:00
|
|
|
class Xml;
|
|
|
|
struct ChordDescription;
|
|
|
|
class PageFormat;
|
|
|
|
class ChordList;
|
|
|
|
class Element;
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
// StyleIdx
|
2016-08-15 14:30:06 +02:00
|
|
|
//
|
|
|
|
// Keep in sync with styleTypes[] in style.cpp
|
2012-05-26 14:26:10 +02:00
|
|
|
//---------------------------------------------------------
|
|
|
|
|
2016-07-08 19:33:17 +02:00
|
|
|
enum class StyleIdx : int {
|
|
|
|
NOSTYLE = -1,
|
2014-05-26 15:31:36 +02:00
|
|
|
staffUpperBorder,
|
|
|
|
staffLowerBorder,
|
|
|
|
staffDistance,
|
|
|
|
akkoladeDistance,
|
|
|
|
|
|
|
|
minSystemDistance,
|
|
|
|
maxSystemDistance,
|
|
|
|
|
|
|
|
lyricsDistance,
|
2016-08-18 10:22:07 +02:00
|
|
|
lyricsMinTopDistance,
|
2014-05-26 15:31:36 +02:00
|
|
|
lyricsMinBottomDistance,
|
|
|
|
lyricsLineHeight,
|
|
|
|
|
|
|
|
figuredBassFontFamily,
|
|
|
|
figuredBassFontSize,
|
|
|
|
figuredBassYOffset,
|
|
|
|
figuredBassLineHeight,
|
|
|
|
figuredBassAlignment,
|
|
|
|
figuredBassStyle,
|
|
|
|
systemFrameDistance,
|
|
|
|
frameSystemDistance,
|
|
|
|
minMeasureWidth,
|
|
|
|
|
|
|
|
barWidth,
|
|
|
|
doubleBarWidth,
|
|
|
|
endBarWidth,
|
|
|
|
doubleBarDistance,
|
|
|
|
endBarDistance,
|
|
|
|
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,
|
2016-05-25 12:10:52 +02:00
|
|
|
ambitusMargin,
|
2014-05-26 15:31:36 +02:00
|
|
|
timesigLeftMargin,
|
|
|
|
|
|
|
|
clefKeyRightMargin,
|
2016-03-02 13:20:19 +01:00
|
|
|
/**/ clefKeyDistance,
|
|
|
|
/**/ clefTimesigDistance,
|
|
|
|
/**/ keyTimesigDistance,
|
2016-03-05 19:50:55 +01:00
|
|
|
keyBarlineDistance,
|
2016-04-19 15:18:17 +02:00
|
|
|
systemHeaderDistance,
|
2016-04-20 18:56:08 +02:00
|
|
|
systemHeaderTimeSigDistance,
|
2016-03-02 13:20:19 +01:00
|
|
|
|
2014-05-26 15:31:36 +02:00
|
|
|
clefBarlineDistance,
|
2016-05-04 10:27:40 +02:00
|
|
|
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,
|
|
|
|
|
|
|
|
hairpinY,
|
|
|
|
hairpinHeight,
|
|
|
|
hairpinContHeight,
|
|
|
|
hairpinLineWidth,
|
|
|
|
|
|
|
|
pedalY,
|
|
|
|
pedalLineWidth,
|
|
|
|
pedalLineStyle,
|
|
|
|
|
|
|
|
trillY,
|
|
|
|
harmonyY,
|
|
|
|
harmonyFretDist,
|
|
|
|
minHarmonyDistance,
|
|
|
|
maxHarmonyBarDistance,
|
|
|
|
capoPosition,
|
|
|
|
fretNumMag,
|
|
|
|
fretNumPos,
|
|
|
|
fretY,
|
|
|
|
|
|
|
|
showPageNumber,
|
|
|
|
showPageNumberOne,
|
|
|
|
pageNumberOddEven,
|
|
|
|
showMeasureNumber,
|
|
|
|
showMeasureNumberOne,
|
|
|
|
measureNumberInterval,
|
|
|
|
measureNumberSystem,
|
|
|
|
|
|
|
|
measureNumberAllStaffs,
|
|
|
|
smallNoteMag,
|
|
|
|
graceNoteMag,
|
|
|
|
smallStaffMag,
|
|
|
|
smallClefMag,
|
|
|
|
genClef,
|
|
|
|
genKeysig,
|
2015-02-16 16:39:13 +01:00
|
|
|
// genTimesig,
|
2014-05-26 15:31:36 +02:00
|
|
|
genCourtesyTimesig,
|
|
|
|
genCourtesyKeysig,
|
|
|
|
genCourtesyClef,
|
|
|
|
|
2014-06-21 15:16:17 +02:00
|
|
|
swingRatio,
|
|
|
|
swingUnit,
|
|
|
|
|
2014-05-26 15:31:36 +02:00
|
|
|
useStandardNoteNames,
|
|
|
|
useGermanNoteNames,
|
2014-12-10 08:12:00 +01:00
|
|
|
useFullGermanNoteNames,
|
2014-05-26 15:31:36 +02:00
|
|
|
useSolfeggioNoteNames,
|
2014-12-10 08:12:00 +01:00
|
|
|
useFrenchNoteNames,
|
2014-12-17 18:15:26 +01:00
|
|
|
automaticCapitalization,
|
2014-05-26 15:31:36 +02:00
|
|
|
lowerCaseMinorChords,
|
2014-12-10 08:12:00 +01:00
|
|
|
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,
|
|
|
|
|
|
|
|
SlurEndWidth,
|
|
|
|
SlurMidWidth,
|
|
|
|
SlurDottedWidth,
|
|
|
|
MinTieLength,
|
|
|
|
|
|
|
|
SectionPause,
|
|
|
|
MusicalSymbolFont,
|
2014-07-26 11:03:22 +02:00
|
|
|
MusicalTextFont,
|
2014-05-26 15:31:36 +02:00
|
|
|
|
|
|
|
showHeader,
|
2014-06-06 12:40:22 +02:00
|
|
|
// headerStyled,
|
2014-05-26 15:31:36 +02:00
|
|
|
headerFirstPage,
|
|
|
|
headerOddEven,
|
|
|
|
evenHeaderL,
|
|
|
|
evenHeaderC,
|
|
|
|
evenHeaderR,
|
|
|
|
oddHeaderL,
|
|
|
|
oddHeaderC,
|
|
|
|
oddHeaderR,
|
|
|
|
|
|
|
|
showFooter,
|
2014-06-06 12:40:22 +02:00
|
|
|
// footerStyled,
|
2014-05-26 15:31:36 +02:00
|
|
|
footerFirstPage,
|
|
|
|
footerOddEven,
|
|
|
|
evenFooterL,
|
|
|
|
evenFooterC,
|
|
|
|
evenFooterR,
|
|
|
|
oddFooterL,
|
|
|
|
oddFooterC,
|
|
|
|
oddFooterR,
|
|
|
|
|
|
|
|
voltaY,
|
|
|
|
voltaHook,
|
|
|
|
voltaLineWidth,
|
|
|
|
voltaLineStyle,
|
|
|
|
|
|
|
|
ottavaY,
|
|
|
|
ottavaHook,
|
|
|
|
ottavaLineWidth,
|
|
|
|
ottavaLineStyle,
|
|
|
|
ottavaNumbersOnly,
|
|
|
|
|
|
|
|
tabClef,
|
|
|
|
|
|
|
|
tremoloWidth,
|
|
|
|
tremoloBoxHeight,
|
|
|
|
tremoloStrokeWidth,
|
|
|
|
tremoloDistance,
|
2015-06-22 17:41:06 +02:00
|
|
|
// TODO tremoloBeamLengthMultiplier,
|
|
|
|
// TODO tremoloMaxBeamLength,
|
2014-05-26 15:31:36 +02:00
|
|
|
|
|
|
|
linearStretch,
|
|
|
|
crossMeasureValues,
|
|
|
|
keySigNaturals,
|
|
|
|
|
|
|
|
tupletMaxSlope,
|
|
|
|
tupletOufOfStaff,
|
|
|
|
tupletVHeadDistance,
|
|
|
|
tupletVStemDistance,
|
|
|
|
tupletStemLeftDistance,
|
|
|
|
tupletStemRightDistance,
|
|
|
|
tupletNoteLeftDistance,
|
|
|
|
tupletNoteRightDistance,
|
2015-07-06 10:58:05 +02:00
|
|
|
tupletBracketWidth,
|
2016-07-08 16:48:04 +02:00
|
|
|
tupletDirection,
|
|
|
|
tupletNumberType,
|
|
|
|
tupletBracketType,
|
2014-05-26 15:31:36 +02:00
|
|
|
|
2015-01-16 14:51:09 +01:00
|
|
|
barreLineWidth,
|
|
|
|
fretMag,
|
2015-01-22 15:31:32 +01:00
|
|
|
scaleBarlines,
|
2015-01-26 10:23:35 +01:00
|
|
|
barGraceDistance,
|
2015-10-03 23:55:33 +02:00
|
|
|
lyricsDashMinLength,
|
|
|
|
lyricsDashMaxLength,
|
2016-08-15 14:30:06 +02:00
|
|
|
lyricsDashMaxDistance,
|
2015-10-03 23:55:33 +02:00
|
|
|
lyricsDashForce,
|
2015-01-16 14:51:09 +01:00
|
|
|
|
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-03-03 17:10:50 +01:00
|
|
|
fermataAnchor,
|
|
|
|
shortfermataAnchor,
|
|
|
|
longfermataAnchor,
|
|
|
|
verylongfermataAnchor,
|
|
|
|
sforzatoAnchor,
|
|
|
|
staccatoAnchor,
|
|
|
|
staccatissimoAnchor,
|
|
|
|
tenutoAnchor,
|
|
|
|
portatoAnchor,
|
|
|
|
marcatoAnchor,
|
|
|
|
fadeinAnchor,
|
|
|
|
fadeoutAnchor,
|
|
|
|
volumeswellAnchor,
|
|
|
|
wigglesawtoothAnchor,
|
|
|
|
wigglesawtoothwideAnchor,
|
|
|
|
wigglevibratolargefasterAnchor,
|
|
|
|
wigglevibratolargeslowestAnchor,
|
|
|
|
ouvertAnchor,
|
|
|
|
plusstopAnchor,
|
|
|
|
upbowAnchor,
|
|
|
|
downbowAnchor,
|
|
|
|
reverseturnAnchor,
|
|
|
|
turnAnchor,
|
|
|
|
trillAnchor,
|
|
|
|
prallAnchor,
|
|
|
|
mordentAnchor,
|
|
|
|
prallprallAnchor,
|
|
|
|
prallmordentAnchor,
|
|
|
|
upprallAnchor,
|
|
|
|
downprallAnchor,
|
|
|
|
upmordentAnchor,
|
|
|
|
downmordentAnchor,
|
|
|
|
pralldownAnchor,
|
|
|
|
prallupAnchor,
|
|
|
|
lineprallAnchor,
|
|
|
|
schleiferAnchor,
|
|
|
|
snappizzicatoAnchor,
|
|
|
|
thumbAnchor,
|
|
|
|
lutefingeringthumbAnchor,
|
|
|
|
lutefingering1stAnchor,
|
|
|
|
lutefingering2ndAnchor,
|
|
|
|
lutefingering3rdAnchor,
|
|
|
|
|
2016-07-25 12:29:24 +02:00
|
|
|
autoplaceHairpinDynamicsDistance,
|
2016-08-02 17:00:49 +02:00
|
|
|
dynamicsMinDistance,
|
2016-07-25 12:29:24 +02:00
|
|
|
|
2014-05-26 15:31:36 +02:00
|
|
|
STYLES
|
2012-05-26 14:26:10 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
// MStyle
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
class MStyle {
|
2016-03-02 13:20:19 +01:00
|
|
|
QVector<QVariant> _values;
|
|
|
|
QVector<qreal> _precomputedValues;
|
|
|
|
|
|
|
|
ChordList _chordList;
|
|
|
|
QList<TextStyle> _textStyles;
|
|
|
|
PageFormat _pageFormat;
|
|
|
|
|
|
|
|
bool _customChordList; // if true, chordlist will be saved as part of score
|
|
|
|
|
|
|
|
void precomputeValues();
|
2012-05-26 14:26:10 +02:00
|
|
|
|
|
|
|
public:
|
|
|
|
MStyle();
|
|
|
|
MStyle(const MStyle&);
|
|
|
|
MStyle& operator=(const MStyle&);
|
2016-03-03 17:10:50 +01:00
|
|
|
// ~MStyle() {}
|
2012-05-26 14:26:10 +02:00
|
|
|
|
|
|
|
bool isDefault(StyleIdx idx) const;
|
|
|
|
const ChordDescription* chordDescription(int id) const;
|
2016-03-02 13:20:19 +01:00
|
|
|
ChordList* chordList() { return &_chordList; }
|
2014-03-15 12:15:49 +01:00
|
|
|
|
2013-06-11 20:26:16 +02:00
|
|
|
void setChordList(ChordList*, bool custom = true); // Style gets ownership of ChordList
|
2012-05-26 14:26:10 +02:00
|
|
|
|
2014-07-03 11:22:42 +02:00
|
|
|
const TextStyle& textStyle(TextStyleType) const;
|
2012-05-26 14:26:10 +02:00
|
|
|
const TextStyle& textStyle(const QString& name) const;
|
2014-07-03 11:22:42 +02:00
|
|
|
TextStyleType textStyleType(const QString& name) const;
|
2012-05-26 14:26:10 +02:00
|
|
|
void setTextStyle(const TextStyle& ts);
|
|
|
|
void addTextStyle(const TextStyle& ts);
|
|
|
|
void removeTextStyle(const TextStyle& ts);
|
|
|
|
const QList<TextStyle>& textStyles() const;
|
2013-08-09 11:42:24 +02:00
|
|
|
|
2016-03-02 13:20:19 +01:00
|
|
|
void set(StyleIdx idx, const QVariant& v);
|
|
|
|
|
|
|
|
QVariant value(StyleIdx idx) const { return _values[int(idx)]; }
|
|
|
|
qreal pvalue(StyleIdx idx) const { return _precomputedValues[int(idx)]; }
|
2012-05-26 14:26:10 +02:00
|
|
|
|
|
|
|
bool load(QFile* qf);
|
2013-01-11 18:10:18 +01:00
|
|
|
void load(XmlReader& e);
|
2012-05-26 14:26:10 +02:00
|
|
|
void save(Xml& xml, bool optimize);
|
2016-03-02 13:20:19 +01:00
|
|
|
|
|
|
|
PageFormat* pageFormat() { return &_pageFormat; }
|
|
|
|
const PageFormat* pageFormat() const { return &_pageFormat; }
|
|
|
|
|
2012-05-26 14:26:10 +02:00
|
|
|
void setPageFormat(const PageFormat& pf);
|
2016-03-02 13:20:19 +01:00
|
|
|
|
2012-05-26 14:26:10 +02:00
|
|
|
ArticulationAnchor articulationAnchor(int id) const;
|
2016-07-09 17:07:12 +02:00
|
|
|
static StyleIdx articulationAnchorIdx(int id);
|
2015-01-22 16:27:16 +01:00
|
|
|
|
2016-03-02 13:20:19 +01:00
|
|
|
static const char* valueType(const StyleIdx);
|
|
|
|
static const char* valueName(const StyleIdx);
|
2012-05-26 14:26:10 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
extern void initStyle(MStyle*);
|
|
|
|
|
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
|