import { EngravingRules } from "./EngravingRules" ; import { PlacementEnum } from "../VoiceData/Expressions/AbstractExpression" ; export enum ColoringModes { XML = 0 , AutoColoring = 1 , CustomColorSet = 2 } export enum DrawingParametersEnum { allon = "allon" , compact = "compact" , compacttight = "compacttight" , default = "default" , leadsheet = "leadsheet" , preview = "preview" , thumbnail = "thumbnail" } /** Internal drawing/rendering parameters and broad modes like compact and thumbnail. Overlap with EngravingRules. */ export class DrawingParameters { /** will set other settings if changed with set method */ private drawingParametersEnum : DrawingParametersEnum ; private rules : EngravingRules = new EngravingRules ( ) ; public drawHighlights : boolean ; public drawErrors : boolean ; public drawSelectionStartSymbol : boolean ; public drawSelectionEndSymbol : boolean ; public drawCursors : boolean ; public drawActivitySymbols : boolean ; public drawScrollIndicator : boolean ; public drawComments : boolean ; public drawMarkedAreas : boolean ; public drawTitle : boolean = true ; public drawSubtitle : boolean = true ; public drawLyricist : boolean = true ; public drawComposer : boolean = true ; public drawCredits : boolean = true ; public drawPartNames : boolean = true ; public coloringMode : ColoringModes ; public fingeringPosition : PlacementEnum = PlacementEnum . Left ; /** Draw notes set to be invisible (print-object="no" in XML). */ public drawHiddenNotes : boolean = false ; constructor ( drawingParameters = DrawingParametersEnum . default ) { this . DrawingParametersEnum = drawingParameters ; } /** Sets drawing parameters enum and changes settings flags accordingly. */ public set DrawingParametersEnum ( drawingParametersEnum ) { this . drawingParametersEnum = drawingParametersEnum ; switch ( drawingParametersEnum ) { case DrawingParametersEnum . allon : this . setForAllOn ( ) ; break ; case DrawingParametersEnum . thumbnail : this . setForThumbnail ( ) ; break ; case DrawingParametersEnum . leadsheet : this . setForLeadsheet ( ) ; break ; case DrawingParametersEnum . compact : this . setForCompactMode ( ) ; break ; case DrawingParametersEnum . compacttight : this . setForCompactTightMode ( ) ; break ; case DrawingParametersEnum . default : default : this . setForDefault ( ) ; } } public get DrawingParametersEnum ( ) : DrawingParametersEnum { return this . drawingParametersEnum ; } public setForAllOn ( ) { this . drawHighlights = true ; this . drawErrors = true ; this . drawSelectionStartSymbol = true ; this . drawSelectionEndSymbol = true ; this . drawCursors = true ; this . drawActivitySymbols = true ; this . drawScrollIndicator = true ; this . drawComments = true ; this . drawMarkedAreas = true ; this . DrawTitle = true ; this . DrawSubtitle = true ; this . DrawComposer = true ; this . DrawLyricist = true ; this . drawCredits = true ; this . DrawPartNames = true ; this . drawHiddenNotes = true ; this . rules . CompactMode = false ; } public setForDefault ( ) { this . rules . loadDefaultValues ( ) ; this . setForAllOn ( ) ; this . drawHiddenNotes = false ; } public setForThumbnail ( ) { this . drawHighlights = false ; this . drawErrors = false ; this . drawSelectionStartSymbol = false ; this . drawSelectionStartSymbol = false ; this . drawCursors = false ; this . drawActivitySymbols = false ; this . drawScrollIndicator = false ; this . drawComments = true ; this . drawMarkedAreas = true ; this . drawHiddenNotes = false ; } public setForCompactMode ( ) { this . rules . CompactMode = true ; this . DrawCredits = false ; this . drawHiddenNotes = false ; } public setForCompactTightMode ( ) { this . setForCompactMode ( ) ; this . DrawPartNames = false ; this . rules . VoiceSpacingMultiplierVexflow = 0.65 ; this . rules . VoiceSpacingAddendVexflow = 2.0 ; this . rules . MinSkyBottomDistBetweenStaves = 1.0 ; this . rules . MinSkyBottomDistBetweenSystems = 1.0 ; this . rules . BetweenStaffDistance = 2.5 ; this . rules . StaffDistance = 3.5 ; this . rules . MinimumDistanceBetweenSystems = 1 ; this . rules . PageBottomMargin = 0.0 ; this . rules . PageLeftMargin = 2.0 ; this . rules . PageRightMargin = 2.0 ; } public setForLeadsheet ( ) { this . drawHighlights = false ; this . drawErrors = false ; this . drawSelectionStartSymbol = true ; this . drawSelectionEndSymbol = true ; this . drawCursors = true ; this . drawActivitySymbols = false ; this . drawScrollIndicator = true ; this . drawComments = true ; this . drawMarkedAreas = true ; } public get DrawCredits ( ) : boolean { return this . drawCredits ; } public set DrawCredits ( value ) { this . drawCredits = value ; this . DrawComposer = value ; this . DrawTitle = value ; this . DrawSubtitle = value ; this . DrawLyricist = value ; } public get DrawTitle ( ) : boolean { return this . drawTitle ; } /** Enable or disable drawing the Title of the piece. If disabled, will disable drawing Subtitle as well. */ public set DrawTitle ( value ) { this . drawTitle = value ; this . rules . RenderTitle = value ; if ( ! value ) { this . DrawSubtitle = false ; } } public get DrawSubtitle ( ) : boolean { return this . drawSubtitle ; } /** Enable or disable drawing the Subtitle of the piece. If enabled, will enable drawing Title as well. */ public set DrawSubtitle ( value ) { this . drawSubtitle = value ; this . rules . RenderSubtitle = value ; if ( value ) { this . DrawTitle = true ; } } public get DrawComposer ( ) : boolean { return this . drawComposer ; } /** Enable or disable drawing a label for the Composer of the piece. */ public set DrawComposer ( value ) { this . drawComposer = value ; this . rules . RenderComposer = value ; } public get DrawLyricist ( ) : boolean { return this . drawLyricist ; } public set DrawLyricist ( value ) { this . drawLyricist = value ; this . rules . RenderLyricist = value ; } public get DrawPartNames ( ) : boolean { return this . drawPartNames ; } public set DrawPartNames ( value ) { this . drawPartNames = value ; this . rules . RenderPartNames = value ; if ( ! this . rules . RenderPartNames ) { this . rules . RenderPartAbbreviations = false ; } } public get FingeringPosition ( ) : PlacementEnum { return this . fingeringPosition ; } public set FingeringPosition ( value ) { this . fingeringPosition = value ; this . rules . FingeringPosition = value ; } public get Rules ( ) : EngravingRules { return this . rules ; } public set Rules ( value ) { this . rules = value ; } }