Options
All
  • Public
  • Public/Protected
  • All
Menu

The graphical counterpart of a MusicSheet

Hierarchy

  • GraphicalMusicSheet

Index

Constructors

Properties

Accessors

Methods

Constructors

Properties

composer: GraphicalLabel
copyright: GraphicalLabel
cursors: GraphicalLine[] = []
leadSheet: boolean = false
lyricist: GraphicalLabel
measureList: GraphicalMeasure[][] = []

measures (i,j) where i is the measure number and j the staff index (e.g. staff indices 0, 1 for two piano parts)

minAllowedSystemWidth: number
musicPages: GraphicalMusicPage[] = []
musicSheet: MusicSheet
numberOfStaves: number
selectionEndSymbol: SelectionEndSymbol
selectionStartSymbol: SelectionStartSymbol
subtitle: GraphicalLabel
verticalGraphicalStaffEntryContainers: VerticalGraphicalStaffEntryContainer[] = []

Accessors

  • get LeadSheet(): boolean
  • set LeadSheet(value: boolean): void
  • get MinAllowedSystemWidth(): number
  • set MinAllowedSystemWidth(value: number): void
  • get NumberOfStaves(): number

Methods

  • EnforceRedrawOfMusicSystems(): void
  • GetInterpolatedIndexInVerticalContainers(musicTimestamp: Fraction): number
  • GetNearestGraphicalObject<T>(clickPosition: PointF2D, className?: string, startSearchArea?: number, maxSearchArea?: number, searchAreaIncrement?: number, shouldBeIncludedTest?: ((objectToTest: T) => boolean)): T
  • Generic method to find graphical objects on the sheet at a given location.

    Type Parameters

    Parameters

    • clickPosition: PointF2D

      Position in units where we are searching on the sheet

    • className: string = GraphicalObject.name

      String representation of the class we want to find. Must extend GraphicalObject

    • startSearchArea: number = 5

      The area in units around our point to look for our graphical object, default 5

    • maxSearchArea: number = 20

      The max area we want to search around our point

    • searchAreaIncrement: number = 5

      The amount we expand our search area for each iteration that we don't find an object of the given type

    • shouldBeIncludedTest: ((objectToTest: T) => boolean) = undefined

      A callback that determines if the object should be included in our results- return false for no, true for yes

        • (objectToTest: T): boolean
        • Parameters

          • objectToTest: T

          Returns boolean

    Returns T

  • GetNearestObject<T>(clickPosition: PointF2D, className: string): T
  • Returns nearest object of type T near clickPosition. E.g. GetNearestObject(pos, GraphicalMeasure.name) returns the nearest measure. Note that there is also GetNearestStaffEntry(), which has a bit more specific code for staff entries.

    Type Parameters

    Parameters

    • clickPosition: PointF2D
    • className: string

    Returns T

  • GetNextVisibleContainerIndex(index: number): number
  • GetNumberOfFollowedInstruments(): number
  • GetNumberOfVisibleInstruments(): number
  • GetPreviousVisibleContainerIndex(index: number): number
  • Returns the index of the closest previous (earlier) vertical container which has at least some visible staff entry, with respect to the given index.

    Parameters

    • index: number

    Returns number

  • Does a binary search on the container list and returns the VerticalContainer with the given Timestamp. The search begins at startIndex, if given. If the timestamp cannot be found, null is returned.

    Parameters

    • timestamp: Fraction

      The timestamp for which the container shall be found.

    • startIndex: number = 0

      The index from which the search starts in the container list.

    Returns VerticalGraphicalStaffEntryContainer

  • Initialize(): void
  • findClosestLeftStaffEntry(fractionalIndex: number, searchOnlyVisibleEntries: boolean): GraphicalStaffEntry
  • findClosestRightStaffEntry(fractionalIndex: number, returnOnlyVisibleEntries: boolean): GraphicalStaffEntry
  • findGraphicalMeasure(measureIndex: number, staffIndex: number): GraphicalMeasure
  • findGraphicalMeasureByMeasureNumber(measureNumber: number, staffIndex: number): GraphicalMeasure
  • getClickedObject<T>(positionOnMusicSheet: PointF2D): T
  • getClickedObjectOfType<T>(positionOnMusicSheet: PointF2D): T
  • getFirstVisibleMeasuresListFromIndices(start: number, end: number): GraphicalMeasure[]
  • getLastGraphicalMeasureFromIndex(staffIndex: number, lastRendered?: boolean): GraphicalMeasure
  • getLongestStaffEntryDuration(index: number): Fraction
  • getMeasureIndex(graphicalMeasure: GraphicalMeasure, measureIndex: number, inListIndex: number): boolean
  • getVisibleStavesIndicesFromSourceMeasure(visibleMeasures: GraphicalMeasure[]): number[]
  • reCalculate(): void

Generated using TypeDoc