Base class for all operations on the rendered score. The base class handles the following:

1. Undo and recording actions for the operation
2. Maintain/change which staves in the score are displayed (staff map)
3. Mapping between the displayed score and the data representation

### Hierarchy

- SuiScoreView
  - SuiScoreViewOperations

## Index

### Constructors

- constructor

### Accessors

- defaultStaffMap

### Methods

- _getEquivalentGraceNote
- _getEquivalentSelection
- _getEquivalentSelections
- _getEquivalentSelector
- _getEquivalentStaff
- _getRectangleSelections
- _mapPartFormatting
- _renderChangedMeasures
- _renderRectangle
- _setTransposing
- _undoColumn
- _undoFirstMeasureSelection
- _undoScore
- _undoScorePreferences
- _undoSelection
- _undoSelections
- _undoStaffModifier
- _undoTrackerMeasureSelections
- changeScore
- exposePart
- getFocusedPage
- getView
- groupUndo
- isPartExposed
- refreshViewport
- renderPromise
- setMappedStaffIds
- setView
- startRenderingEngine
- undo
- updatePromise
- viewAll
- waitableAction

## Constructors

### constructor

- new SuiScoreView(config: SmoRenderConfiguration, svgContainer: HTMLElement, score: SmoScore, scrollSelector: HTMLElement, undoBuffer: UndoBuffer): SuiScoreView

- - Defined in src/render/sui/scoreView.ts:52

  #### Parameters

  - ##### config: SmoRenderConfiguration

  - ##### svgContainer: HTMLElement

  - ##### score: SmoScore

  - ##### scrollSelector: HTMLElement

  - ##### undoBuffer: UndoBuffer

  #### Returns SuiScoreView

## Accessors

### defaultStaffMap

- get defaultStaffMap(): number[]

- - Defined in src/render/sui/scoreView.ts:372

  Show all staves, 1:1 mapping of view score staff to stored score staff

  #### Returns number[]

## Methods

### _getEquivalentGraceNote

- _getEquivalentGraceNote(selection: SmoSelection, gn: SmoGraceNote): SmoGraceNote

- - Defined in src/render/sui/scoreView.ts:330

  Get the equivalent selection from this.storeScore that maps to the displayed selection from this.score

  #### Parameters

  - ##### selection: SmoSelection

  - ##### gn: SmoGraceNote

  #### Returns SmoGraceNote

### _getEquivalentSelection

- _getEquivalentSelection(selection: SmoSelection): null | SmoSelection

- - Defined in src/render/sui/scoreView.ts:308

  Get the equivalent selection from this.storeScore that maps to the displayed selection from this.score

  #### Parameters

  - ##### selection: SmoSelection

  #### Returns null | SmoSelection

### _getEquivalentSelections

- _getEquivalentSelections(selections: SmoSelection[]): SmoSelection[]

- - Defined in src/render/sui/scoreView.ts:132

  The plural form of _getEquivalentSelection

  #### Parameters

  - ##### selections: SmoSelection[]

  #### Returns SmoSelection[]

### _getEquivalentSelector

- _getEquivalentSelector(selector: SmoSelector): any

- - Defined in src/render/sui/scoreView.ts:290

  Get the selector from this.storeScore that maps to the displayed selector from this.score

  #### Parameters

  - ##### selector: SmoSelector

  #### Returns any

### _getEquivalentStaff

- _getEquivalentStaff(staffId: number): number

- - Defined in src/render/sui/scoreView.ts:300

  Get the equivalent staff id from this.storeScore that maps to the displayed selector from this.score

  #### Parameters

  - ##### staffId: number

  #### Returns number

### _getRectangleSelections

- _getRectangleSelections(startSelector: SmoSelector, endSelector: SmoSelector): SmoSelection[]

- - Defined in src/render/sui/scoreView.ts:346

  Get the rectangle of selections indicated by the parameters from the score

  #### Parameters

  - ##### startSelector: SmoSelector

  - ##### endSelector: SmoSelector

  #### Returns SmoSelection[]

### _mapPartFormatting

- _mapPartFormatting(): void

- - Defined in src/render/sui/scoreView.ts:447

  Parts have different formatting options from the parent score, indluding layout. Reset them when exposing a part.

  #### Returns void

### _renderChangedMeasures

- _renderChangedMeasures(measureSelections: SmoSelection[]): void

- - Defined in src/render/sui/scoreView.ts:256

  Update renderer for measures that have changed

  #### Parameters

  - ##### measureSelections: SmoSelection[]

  #### Returns void

### _renderRectangle

- _renderRectangle(fromSelector: SmoSelector, toSelector: SmoSelector): void

- - Defined in src/render/sui/scoreView.ts:269

  Update renderer for some columns

  #### Parameters

  - ##### fromSelector: SmoSelector

  - ##### toSelector: SmoSelector

  #### Returns void

### _setTransposing

- _setTransposing(): void

- - Defined in src/render/sui/scoreView.ts:522

  Update score based on transposing flag.

  #### Returns void

### _undoColumn

- _undoColumn(label: string, measureIndex: number): void

- - Defined in src/render/sui/scoreView.ts:176

  Create a rectangle undo, like a multiple columns but not necessarily the whole score.

  #### Parameters

  - ##### label: string

  - ##### measureIndex: number

  #### Returns void

### _undoFirstMeasureSelection

- _undoFirstMeasureSelection(label: string): SmoSelection

- - Defined in src/render/sui/scoreView.ts:211

  operation that only affects the first selection. Setup undo for the measure

  #### Parameters

  - ##### label: string

  #### Returns SmoSelection

### _undoScore

- _undoScore(label: string): void

- - Defined in src/render/sui/scoreView.ts:279

  Setup undo for operation that affects the whole score

  #### Parameters

  - ##### label: string

  #### Returns void

### _undoScorePreferences

- _undoScorePreferences(label: string): void

- - Defined in src/render/sui/scoreView.ts:185

  Score preferences don't affect the display, but they do have an undo

  #### Parameters

  - ##### label: string

  #### Returns void

### _undoSelection

- _undoSelection(label: string, selection: SmoSelection): void

- - Defined in src/render/sui/scoreView.ts:227

  Add the selection to the undo buffer

  #### Parameters

  - ##### label: string

  - ##### selection: SmoSelection

  #### Returns void

### _undoSelections

- _undoSelections(label: string, selections: SmoSelection[]): void

- - Defined in src/render/sui/scoreView.ts:243

  Add multiple selections to the undo buffer as a group

  #### Parameters

  - ##### label: string

  - ##### selections: SmoSelection[]

  #### Returns void

### _undoStaffModifier

- _undoStaffModifier(label: string, staffModifier: StaffModifierBase, subtype: number): void

- - Defined in src/render/sui/scoreView.ts:148

  A staff modifier has changed, create undo operations for the measures affected

  #### Parameters

  - ##### label: string

  - ##### staffModifier: StaffModifierBase

  - ##### subtype: number

  #### Returns void

### _undoTrackerMeasureSelections

- _undoTrackerMeasureSelections(label: string): SmoSelection[]

- - Defined in src/render/sui/scoreView.ts:195

  Add to the undo buffer the current set of measures selected.

  #### Parameters

  - ##### label: string

  #### Returns SmoSelection[]

### changeScore

- changeScore(score: SmoScore): Promise<any>

- - Defined in src/render/sui/scoreView.ts:536

  Update the view after loading or restoring a completely new score

  #### Parameters

  - ##### score: SmoScore

  #### Returns Promise<any>

### exposePart

- exposePart(staff: SmoSystemStaff): void

- - Defined in src/render/sui/scoreView.ts:424

  Exposes a part: hides non-part staves, shows part staves. Note this will reset the view. After this operation, staff 0 will be the selected part.

  #### Parameters

  - ##### staff: SmoSystemStaff

  #### Returns void

### getFocusedPage

- getFocusedPage(): number

- - Defined in src/render/sui/scoreView.ts:160

  Return the index of the page that is in the center of the client screen.

  #### Returns number

### getView

- getView(): ViewMapEntry[]

- - Defined in src/render/sui/scoreView.ts:396

  Gets the current mapping of displayed staves to score staves (this.storeScore)

  #### Returns ViewMapEntry[]

### groupUndo

- groupUndo(val: boolean): void

- - Defined in src/render/sui/scoreView.ts:364

  set the grouping flag for undo operations

  #### Parameters

  - ##### val: boolean

  #### Returns void

### isPartExposed

- isPartExposed(): boolean

- - Defined in src/render/sui/scoreView.ts:440

  Indicates if the score is displaying in part-mode vs. score mode.

  #### Returns boolean

### refreshViewport

- refreshViewport(): Promise<any>

- - Defined in src/render/sui/scoreView.ts:95

  await on the full update of the score, also resetting the viewport (to reflect layout changes)

  #### Returns Promise<any>

### renderPromise

- renderPromise(): Promise<any>

- - Defined in src/render/sui/scoreView.ts:81

  Await on the full update of the score

  #### Returns Promise<any>

### setMappedStaffIds

- setMappedStaffIds(): void

- - Defined in src/render/sui/scoreView.ts:408

  Update the staff ID when the view changes

  #### Returns void

### setView

- setView(rows: ViewMapEntry[]): void

- - Defined in src/render/sui/scoreView.ts:466

  Update the list of staves in the score that are displayed.

  #### Parameters

  - ##### rows: ViewMapEntry[]

  #### Returns void

### startRenderingEngine

- startRenderingEngine(): void

- - Defined in src/render/sui/scoreView.ts:383

  Bootstrapping function, creates the renderer and associated timers

  #### Returns void

### undo

- undo(): void

- - Defined in src/render/sui/scoreView.ts:555

  for the view score, the renderer decides what to render depending on what is undone.

  #### Returns void

### updatePromise

- updatePromise(): Promise<any>

- - Defined in src/render/sui/scoreView.ts:88

  Await on the partial update of the score in the view

  #### Returns Promise<any>

### viewAll

- viewAll(): void

- - Defined in src/render/sui/scoreView.ts:511

  view all the staffs in score mode.

  #### Returns void

### waitableAction

- waitableAction(action: (() => void), repetition?: number): Promise<any>

- - Defined in src/render/sui/scoreView.ts:108

  This is used in some Smoosic demos and pens.

  #### Parameters

  - ##### action: (() => void)

    any action, but most usefully a SuiScoreView method

    - - (): void

      - #### Returns void

  - ##### Optional repetition: number

    number of times to repeat, waiting on render promise between if not specified, defaults to 1

  #### Returns Promise<any>

  promise, resolved action has been completed and score is updated.

Generated using TypeDoc