Options
All
  • Public
  • Public/Protected
  • All
Menu

Abstract base class for a NoteSequence visualizer.

Hierarchy

Index

Constructors

constructor

  • BaseVisualizer constructor.

    @param sequence The NoteSequence to be visualized. @param canvas The element where the visualization should be displayed. @param config Visualization configuration options.

    Parameters

    Returns BaseVisualizer

Properties

Protected config

Protected height

height: number

noteSequence

noteSequence: INoteSequence

Protected parentElement

parentElement: HTMLElement

Protected sequenceIsQuantized

sequenceIsQuantized: boolean

Protected width

width: number

Methods

Protected Abstract clear

  • clear(): void

Protected getNoteEndTime

  • getNoteEndTime(note: INote): number

Protected getNotePosition

  • getNotePosition(note: INote, noteIndex: number): object
  • Parameters

    • note: INote
    • noteIndex: number

    Returns object

    • h: number
    • w: number
    • x: number
    • y: number

Protected getNoteStartTime

  • getNoteStartTime(note: INote): number

Protected getSize

  • getSize(): object

Protected isPaintingActiveNote

  • isPaintingActiveNote(note: INote, playedNote: INote): boolean

Abstract redraw

  • redraw(activeNote?: INote, scrollIntoView?: boolean): number
  • Redraws the entire note sequence, optionally painting a note as active

    Parameters

    • Optional activeNote: INote

      (Optional) If specified, this Note will be painted in the active color.

    • Optional scrollIntoView: boolean

      (Optional) If specified and the note being painted is offscreen, the parent container will be scrolled so that the note is in view.

    Returns number

    The x position of the painted active note. Useful for automatically advancing the visualization if the note was painted outside of the screen.

Protected scrollIntoViewIfNeeded

  • scrollIntoViewIfNeeded(scrollIntoView: boolean, activeNotePosition: number): void
  • Parameters

    • scrollIntoView: boolean
    • activeNotePosition: number

    Returns void

Generated using TypeDoc