smoosic 1.0.24 → 1.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (189) hide show
  1. package/build/smoosic.js +1 -1
  2. package/package.json +1 -1
  3. package/release/smoosic.js +1 -1
  4. package/release/styles/ribbon.css +5 -10
  5. package/src/application/exports.ts +1 -0
  6. package/src/styles/ribbon.css +5 -10
  7. package/types/src/application/application.d.ts +102 -102
  8. package/types/src/application/common.d.ts +74 -74
  9. package/types/src/application/configuration.d.ts +74 -74
  10. package/types/src/application/dom.d.ts +8 -8
  11. package/types/src/application/dynamicInit.d.ts +1 -1
  12. package/types/src/application/eventHandler.d.ts +78 -78
  13. package/types/src/application/exports.d.ts +494 -493
  14. package/types/src/application/generateVexTests.d.ts +10 -10
  15. package/types/src/application/keyCommands.d.ts +90 -90
  16. package/types/src/common/bootstrap.bundle.d.ts +1138 -1138
  17. package/types/src/common/htmlHelpers.d.ts +105 -105
  18. package/types/src/common/jszip.d.ts +2 -2
  19. package/types/src/common/midi-parser.d.ts +38 -38
  20. package/types/src/common/promiseHelpers.d.ts +30 -30
  21. package/types/src/common/serializationHelpers.d.ts +29 -29
  22. package/types/src/common/textformatter.d.ts +140 -140
  23. package/types/src/common/vex.d.ts +222 -222
  24. package/types/src/render/audio/musicCursor.d.ts +25 -25
  25. package/types/src/render/audio/oscillator.d.ts +98 -98
  26. package/types/src/render/audio/player.d.ts +141 -141
  27. package/types/src/render/audio/samples.d.ts +56 -56
  28. package/types/src/render/sui/configuration.d.ts +12 -12
  29. package/types/src/render/sui/formatter.d.ts +151 -151
  30. package/types/src/render/sui/layoutDebug.d.ts +43 -43
  31. package/types/src/render/sui/mapper.d.ts +116 -116
  32. package/types/src/render/sui/piano.d.ts +46 -46
  33. package/types/src/render/sui/renderState.d.ts +88 -88
  34. package/types/src/render/sui/scoreRender.d.ts +93 -93
  35. package/types/src/render/sui/scoreView.d.ts +267 -267
  36. package/types/src/render/sui/scoreViewOperations.d.ts +594 -594
  37. package/types/src/render/sui/scroller.d.ts +34 -34
  38. package/types/src/render/sui/svgHelpers.d.ts +85 -85
  39. package/types/src/render/sui/svgPageMap.d.ts +318 -318
  40. package/types/src/render/sui/textEdit.d.ts +310 -310
  41. package/types/src/render/sui/textRender.d.ts +189 -189
  42. package/types/src/render/sui/tracker.d.ts +90 -90
  43. package/types/src/render/vex/glyphDimensions.d.ts +23 -23
  44. package/types/src/render/vex/smoAdapter.d.ts +46 -46
  45. package/types/src/render/vex/toVex.d.ts +13 -13
  46. package/types/src/render/vex/vxMeasure.d.ts +95 -95
  47. package/types/src/render/vex/vxNote.d.ts +55 -55
  48. package/types/src/render/vex/vxSystem.d.ts +64 -64
  49. package/types/src/smo/data/common.d.ts +220 -220
  50. package/types/src/smo/data/measure.d.ts +510 -510
  51. package/types/src/smo/data/measureModifiers.d.ts +506 -506
  52. package/types/src/smo/data/music.d.ts +438 -438
  53. package/types/src/smo/data/note.d.ts +485 -485
  54. package/types/src/smo/data/noteModifiers.d.ts +590 -590
  55. package/types/src/smo/data/partInfo.d.ts +162 -162
  56. package/types/src/smo/data/score.d.ts +395 -395
  57. package/types/src/smo/data/scoreModifiers.d.ts +433 -433
  58. package/types/src/smo/data/scoreText.d.ts +277 -277
  59. package/types/src/smo/data/staffModifiers.d.ts +767 -767
  60. package/types/src/smo/data/systemStaff.d.ts +238 -238
  61. package/types/src/smo/data/tuplet.d.ts +146 -146
  62. package/types/src/smo/midi/midiToSmo.d.ts +198 -198
  63. package/types/src/smo/midi/smoToMidi.d.ts +23 -23
  64. package/types/src/smo/mxml/smoToXml.d.ts +165 -165
  65. package/types/src/smo/mxml/xmlHelpers.d.ts +140 -140
  66. package/types/src/smo/mxml/xmlState.d.ts +257 -257
  67. package/types/src/smo/mxml/xmlToSmo.d.ts +92 -92
  68. package/types/src/smo/xform/beamers.d.ts +46 -46
  69. package/types/src/smo/xform/copypaste.d.ts +99 -99
  70. package/types/src/smo/xform/operations.d.ts +127 -127
  71. package/types/src/smo/xform/roadmap.d.ts +70 -70
  72. package/types/src/smo/xform/selections.d.ts +153 -153
  73. package/types/src/smo/xform/tickDuration.d.ts +155 -155
  74. package/types/src/smo/xform/tickMap.d.ts +34 -34
  75. package/types/src/smo/xform/undo.d.ts +142 -142
  76. package/types/src/smo/xform/updateAudio.d.ts +9 -9
  77. package/types/src/styles/font_metrics/Commissioner-Medium-Metrics.d.ts +871 -871
  78. package/types/src/styles/font_metrics/ConcertOne-Regular.d.ts +871 -871
  79. package/types/src/styles/font_metrics/Merriweather-Regular.d.ts +871 -871
  80. package/types/src/styles/font_metrics/arial_metrics.d.ts +870 -870
  81. package/types/src/styles/font_metrics/ssp-sans-metrics.d.ts +871 -871
  82. package/types/src/styles/font_metrics/ssp-serif-metrics.d.ts +871 -871
  83. package/types/src/styles/font_metrics/times_metrics.d.ts +870 -870
  84. package/types/src/ui/buttons/button.d.ts +95 -95
  85. package/types/src/ui/buttons/collapsable.d.ts +42 -42
  86. package/types/src/ui/buttons/display.d.ts +23 -23
  87. package/types/src/ui/buttons/ribbon.d.ts +76 -76
  88. package/types/src/ui/common.d.ts +45 -45
  89. package/types/src/ui/composable/draggable.d.ts +12 -12
  90. package/types/src/ui/configuration.d.ts +31 -31
  91. package/types/src/ui/dialogs/adapter.d.ts +107 -107
  92. package/types/src/ui/dialogs/addMeasure.d.ts +20 -20
  93. package/types/src/ui/dialogs/arpeggio.d.ts +2 -2
  94. package/types/src/ui/dialogs/articulation.d.ts +2 -2
  95. package/types/src/ui/dialogs/audioSettings.d.ts +32 -32
  96. package/types/src/ui/dialogs/chordChange.d.ts +35 -35
  97. package/types/src/ui/dialogs/clefChange.d.ts +2 -2
  98. package/types/src/ui/dialogs/components/baseComponent.d.ts +158 -158
  99. package/types/src/ui/dialogs/components/button.d.ts +54 -54
  100. package/types/src/ui/dialogs/components/buttonArray.d.ts +101 -101
  101. package/types/src/ui/dialogs/components/checkdrop.d.ts +27 -27
  102. package/types/src/ui/dialogs/components/dragText.d.ts +27 -27
  103. package/types/src/ui/dialogs/components/dropdown.d.ts +78 -78
  104. package/types/src/ui/dialogs/components/fileDownload.d.ts +28 -28
  105. package/types/src/ui/dialogs/components/fontComponent.d.ts +32 -32
  106. package/types/src/ui/dialogs/components/noteText.d.ts +98 -98
  107. package/types/src/ui/dialogs/components/pitch.d.ts +95 -95
  108. package/types/src/ui/dialogs/components/rocker.d.ts +66 -66
  109. package/types/src/ui/dialogs/components/staffComponents.d.ts +77 -77
  110. package/types/src/ui/dialogs/components/textCheck.d.ts +38 -38
  111. package/types/src/ui/dialogs/components/textInPlace.d.ts +90 -90
  112. package/types/src/ui/dialogs/components/textInput.d.ts +58 -58
  113. package/types/src/ui/dialogs/components/tie.d.ts +41 -41
  114. package/types/src/ui/dialogs/components/toggle.d.ts +53 -53
  115. package/types/src/ui/dialogs/components/tree.d.ts +46 -46
  116. package/types/src/ui/dialogs/customTuplets.d.ts +25 -25
  117. package/types/src/ui/dialogs/dialog.d.ts +201 -201
  118. package/types/src/ui/dialogs/durations.d.ts +2 -2
  119. package/types/src/ui/dialogs/dynamics.d.ts +37 -37
  120. package/types/src/ui/dialogs/endings.d.ts +61 -61
  121. package/types/src/ui/dialogs/factory.d.ts +15 -15
  122. package/types/src/ui/dialogs/fileDialogs.d.ts +4 -4
  123. package/types/src/ui/dialogs/fonts.d.ts +2 -2
  124. package/types/src/ui/dialogs/globalLayout.d.ts +2 -2
  125. package/types/src/ui/dialogs/gracenote.d.ts +2 -2
  126. package/types/src/ui/dialogs/hairpin.d.ts +35 -35
  127. package/types/src/ui/dialogs/instrument.d.ts +3 -3
  128. package/types/src/ui/dialogs/keySignature.d.ts +33 -33
  129. package/types/src/ui/dialogs/library.d.ts +70 -70
  130. package/types/src/ui/dialogs/lyric.d.ts +39 -39
  131. package/types/src/ui/dialogs/measureFormat.d.ts +52 -52
  132. package/types/src/ui/dialogs/microtones.d.ts +2 -2
  133. package/types/src/ui/dialogs/noteHead.d.ts +2 -2
  134. package/types/src/ui/dialogs/ornament.d.ts +2 -2
  135. package/types/src/ui/dialogs/pageLayout.d.ts +2 -2
  136. package/types/src/ui/dialogs/partInfo.d.ts +2 -2
  137. package/types/src/ui/dialogs/pedalMarking.d.ts +35 -35
  138. package/types/src/ui/dialogs/pitch.d.ts +2 -2
  139. package/types/src/ui/dialogs/preferences.d.ts +2 -2
  140. package/types/src/ui/dialogs/scoreId.d.ts +2 -2
  141. package/types/src/ui/dialogs/scoreView.d.ts +2 -2
  142. package/types/src/ui/dialogs/slur.d.ts +57 -57
  143. package/types/src/ui/dialogs/staffGroup.d.ts +2 -2
  144. package/types/src/ui/dialogs/tabNote.d.ts +32 -32
  145. package/types/src/ui/dialogs/tabStave.d.ts +43 -43
  146. package/types/src/ui/dialogs/tempo.d.ts +50 -50
  147. package/types/src/ui/dialogs/textBlock.d.ts +61 -61
  148. package/types/src/ui/dialogs/textBracket.d.ts +35 -35
  149. package/types/src/ui/dialogs/tie.d.ts +41 -41
  150. package/types/src/ui/dialogs/timeSignature.d.ts +34 -34
  151. package/types/src/ui/dialogs/transposeScore.d.ts +2 -2
  152. package/types/src/ui/dialogs/volta.d.ts +40 -40
  153. package/types/src/ui/eventSource.d.ts +63 -63
  154. package/types/src/ui/exceptions.d.ts +12 -12
  155. package/types/src/ui/fileio/fileInput.d.ts +12 -12
  156. package/types/src/ui/fileio/library.d.ts +40 -40
  157. package/types/src/ui/fileio/xhrLoader.d.ts +18 -18
  158. package/types/src/ui/help.d.ts +22 -22
  159. package/types/src/ui/i18n/language.d.ts +37 -37
  160. package/types/src/ui/i18n/language_ar.d.ts +5 -5
  161. package/types/src/ui/i18n/language_de.d.ts +1 -1
  162. package/types/src/ui/i18n/language_en.d.ts +18 -18
  163. package/types/src/ui/i18n/translationEditor.d.ts +14 -14
  164. package/types/src/ui/keyBindings/default/editorKeys.d.ts +7 -7
  165. package/types/src/ui/keyBindings/default/trackerKeys.d.ts +7 -7
  166. package/types/src/ui/menus/beams.d.ts +13 -13
  167. package/types/src/ui/menus/edit.d.ts +8 -8
  168. package/types/src/ui/menus/file.d.ts +26 -26
  169. package/types/src/ui/menus/help.d.ts +8 -8
  170. package/types/src/ui/menus/keySignature.d.ts +13 -13
  171. package/types/src/ui/menus/language.d.ts +12 -12
  172. package/types/src/ui/menus/manager.d.ts +57 -57
  173. package/types/src/ui/menus/measure.d.ts +8 -8
  174. package/types/src/ui/menus/menu.d.ts +136 -136
  175. package/types/src/ui/menus/note.d.ts +8 -8
  176. package/types/src/ui/menus/partSelection.d.ts +19 -19
  177. package/types/src/ui/menus/parts.d.ts +50 -50
  178. package/types/src/ui/menus/score.d.ts +20 -20
  179. package/types/src/ui/menus/staffModifier.d.ts +21 -21
  180. package/types/src/ui/menus/text.d.ts +8 -8
  181. package/types/src/ui/menus/timeSignature.d.ts +12 -12
  182. package/types/src/ui/menus/tuplets.d.ts +13 -13
  183. package/types/src/ui/menus/voices.d.ts +8 -8
  184. package/types/src/ui/modalDialogs.d.ts +1 -1
  185. package/types/src/ui/navigation.d.ts +15 -15
  186. package/types/src/ui/qwerty.d.ts +41 -41
  187. package/types/src/ui/ribbonLayout/default/defaultRibbon.d.ts +15 -15
  188. package/types/src/ui/ribbonLayout/default/tabletRibbon.d.ts +22 -22
  189. package/types/typedoc.d.ts +158 -158
@@ -1,267 +1,267 @@
1
- import { SmoScore } from '../../smo/data/score';
2
- import { SmoGraceNote } from '../../smo/data/noteModifiers';
3
- import { SmoSystemStaff } from '../../smo/data/systemStaff';
4
- import { SmoPartInfo } from '../../smo/data/partInfo';
5
- import { StaffModifierBase } from '../../smo/data/staffModifiers';
6
- import { SmoSelection, SmoSelector } from '../../smo/xform/selections';
7
- import { UndoBuffer } from '../../smo/xform/undo';
8
- import { PasteBuffer } from '../../smo/xform/copypaste';
9
- import { SuiScroller } from './scroller';
10
- import { SuiTracker } from './tracker';
11
- import { SmoRenderConfiguration } from './configuration';
12
- import { SuiRenderState } from './renderState';
13
- import { SuiAudioAnimationParams } from '../audio/musicCursor';
14
- /**
15
- * Indicates a stave is/is not displayed in the score
16
- * @category SuiRender
17
- */
18
- export interface ViewMapEntry {
19
- show: boolean;
20
- }
21
- export type updateSelectionFunc = (score: SmoScore, selections: SmoSelection[]) => void;
22
- export type updateSingleSelectionFunc = (score: SmoScore, selection: SmoSelection) => void;
23
- export type updateStaffModifierFunc = (score: SmoScore, fromSelection: SmoSelection, toSelection: SmoSelection) => void;
24
- /**
25
- * Base class for all operations on the rendered score. The base class handles the following:
26
- * 1. Undo and recording actions for the operation
27
- * 2. Maintain/change which staves in the score are displayed (staff map)
28
- * 3. Mapping between the displayed score and the data representation
29
- * @category SuiRender
30
- */
31
- export declare abstract class SuiScoreView {
32
- static Instance: SuiScoreView | null;
33
- score: SmoScore;
34
- storeScore: SmoScore;
35
- staffMap: number[];
36
- storeUndo: UndoBuffer;
37
- tracker: SuiTracker;
38
- renderer: SuiRenderState;
39
- scroller: SuiScroller;
40
- storePaste: PasteBuffer;
41
- config: SmoRenderConfiguration;
42
- audioAnimation: SuiAudioAnimationParams;
43
- constructor(config: SmoRenderConfiguration, svgContainer: HTMLElement, score: SmoScore, scrollSelector: HTMLElement, undoBuffer: UndoBuffer);
44
- /**
45
- * Await on the full update of the score
46
- * @returns
47
- */
48
- renderPromise(): Promise<any>;
49
- /**
50
- * Await on the partial update of the score in the view
51
- * @returns
52
- */
53
- updatePromise(): Promise<any>;
54
- awaitRender(): Promise<any>;
55
- /**
56
- * await on the full update of the score, also resetting the viewport (to reflect layout changes)
57
- * @returns
58
- */
59
- refreshViewport(): Promise<any>;
60
- handleScrollEvent(scrollLeft: number, scrollTop: number): void;
61
- getPartMap(): {
62
- keys: number[];
63
- partMap: Record<number, SmoPartInfo>;
64
- };
65
- /**
66
- * Any method that modifies a set of selections can call this to update
67
- * the score view and the backing score.
68
- * @param actor
69
- * @param selections
70
- */
71
- modifyCurrentSelections(label: string, actor: updateSelectionFunc): Promise<void>;
72
- /**
73
- * Any method that modifies a set of selections can call this to update
74
- * the score view and the backing score.
75
- * @param actor
76
- * @param selections
77
- */
78
- modifySelection(label: string, selection: SmoSelection, actor: updateSelectionFunc): Promise<void>;
79
- /**
80
- * Any method that modifies a set of selections can call this to update
81
- * the score view and the backing score.
82
- * @param actor
83
- * @param selections
84
- */
85
- modifySelectionNoWait(label: string, selection: SmoSelection, actor: updateSingleSelectionFunc): Promise<void>;
86
- /**
87
- * Modifiy a set of columns, e.g. tempo, time, key. This has different undo behavior, don't
88
- * pend on the result because there may be a combination of operations.
89
- * @param label
90
- * @param selections
91
- * @param actor
92
- */
93
- modifyColumnsSelectionsNoWait(label: string, selections: SmoSelection[], actor: updateSingleSelectionFunc): void;
94
- /**
95
- * This is used in some Smoosic demos and pens.
96
- * @param action any action, but most usefully a SuiScoreView method
97
- * @param repetition number of times to repeat, waiting on render promise between
98
- * if not specified, defaults to 1
99
- * @returns promise, resolved action has been completed and score is updated.
100
- */
101
- waitableAction(action: () => void, repetition?: number): Promise<unknown>;
102
- /**
103
- * The plural form of _getEquivalentSelection
104
- * @param selections
105
- * @returns
106
- */
107
- _getEquivalentSelections(selections: SmoSelection[]): SmoSelection[];
108
- getPasteMeasureList(): SmoSelection[];
109
- /**
110
- * A staff modifier has changed, create undo operations for the measures affected
111
- * @param label
112
- * @param staffModifier
113
- * @param subtype
114
- */
115
- undoStaffModifier(label: string, staffModifier: StaffModifierBase, subtype: number): void;
116
- /**
117
- * Return the index of the page that is in the center of the client screen.
118
- */
119
- getFocusedPage(): number;
120
- /**
121
- * Create a rectangle undo, like a multiple columns but not necessarily the whole
122
- * score.
123
- */
124
- _undoColumn(label: string, measureIndex: number): void;
125
- /**
126
- * Score preferences don't affect the display, but they do have an undo
127
- * @param label
128
- */
129
- _undoScorePreferences(label: string): void;
130
- undoColumnRange(label: string, measureSelections: SmoSelection[]): void;
131
- undoMeasureRange(label: string, measureSelections: SmoSelection[]): SmoSelection[];
132
- /**
133
- * Add to the undo buffer the current set of measures selected.
134
- * @param label
135
- * @returns
136
- */
137
- undoTrackerMeasureSelections(label: string): SmoSelection[];
138
- /**
139
- * operation that only affects the first selection. Setup undo for the measure
140
- */
141
- _undoFirstMeasureSelection(label: string): SmoSelection;
142
- /**
143
- * Add the selection to the undo buffer
144
- * @param label
145
- * @param selection
146
- */
147
- _undoSelection(label: string, selection: SmoSelection): void;
148
- /**
149
- * Add multiple selections to the undo buffer as a group
150
- * @param label
151
- * @param selections
152
- */
153
- _undoSelections(label: string, selections: SmoSelection[]): void;
154
- /**
155
- * Update renderer for measures that have changed
156
- */
157
- _renderChangedMeasures(measureSelections: SmoSelection[]): void;
158
- /**
159
- * Update renderer for some columns
160
- * @param fromSelector
161
- * @param toSelector
162
- */
163
- _renderRectangle(fromSelector: SmoSelector, toSelector: SmoSelector): void;
164
- /**
165
- * Setup undo for operation that affects the whole score
166
- * @param label
167
- */
168
- _undoScore(label: string): void;
169
- /**
170
- * Get the selector from this.storeScore that maps to the displayed selector from this.score
171
- * @param selector
172
- * @returns
173
- */
174
- _getEquivalentSelector(selector: SmoSelector): any;
175
- /**
176
- * Get the equivalent staff id from this.storeScore that maps to the displayed selector from this.score
177
- * @param staffId
178
- * @returns
179
- */
180
- _getEquivalentStaff(staffId: number): number;
181
- /**
182
- * Get the equivalent selection from this.storeScore that maps to the displayed selection from this.score
183
- * @param selection
184
- * @returns
185
- */
186
- _getEquivalentSelection(selection: SmoSelection): SmoSelection | null;
187
- /**
188
- * Get the equivalent selection from this.storeScore that maps to the displayed selection from this.score
189
- * @param selection
190
- * @returns
191
- */
192
- _getEquivalentGraceNote(selection: SmoSelection, gn: SmoGraceNote): SmoGraceNote;
193
- /**
194
- * Get the rectangle of selections indicated by the parameters from the score
195
- * @param startSelector
196
- * @param endSelector
197
- * @param score
198
- * @returns
199
- */
200
- _getRectangleSelections(startSelector: SmoSelector, endSelector: SmoSelector): SmoSelection[];
201
- /**
202
- * set the grouping flag for undo operations
203
- * @param val
204
- */
205
- groupUndo(val: boolean): void;
206
- /**
207
- * Show all staves, 1:1 mapping of view score staff to stored score staff
208
- */
209
- get defaultStaffMap(): number[];
210
- /**
211
- * Bootstrapping function, creates the renderer and associated timers
212
- */
213
- startRenderingEngine(): void;
214
- /**
215
- * Gets the current mapping of displayed staves to score staves (this.storeScore)
216
- * @returns
217
- */
218
- getView(): ViewMapEntry[];
219
- /**
220
- * Update the staff ID when the view changes
221
- */
222
- setMappedStaffIds(): void;
223
- resetPartView(): void;
224
- /**
225
- * Exposes a part: hides non-part staves, shows part staves.
226
- * Note this will reset the view. After this operation, staff 0 will
227
- * be the selected part.
228
- * @param staff
229
- */
230
- exposePart(staff: SmoSystemStaff): void;
231
- /**
232
- * Indicates if the score is displaying in part-mode vs. score mode.
233
- * @returns
234
- */
235
- isPartExposed(): boolean;
236
- /**
237
- * Parts have different formatting options from the parent score, indluding layout. Reset
238
- * them when exposing a part.
239
- */
240
- _mapPartFormatting(): void;
241
- /**
242
- * Update the list of staves in the score that are displayed.
243
- */
244
- setView(rows: ViewMapEntry[]): void;
245
- /**
246
- * view all the staffs in score mode.
247
- */
248
- viewAll(): void;
249
- /**
250
- * If the score is non-transposed, transpose the part so it is in the
251
- * correct key.
252
- */
253
- _setTransposing(): void;
254
- /**
255
- * Update the view after loading or restoring a completely new score
256
- * @param score
257
- * @returns
258
- */
259
- changeScore(score: SmoScore): Promise<any>;
260
- replaceMeasureView(measureRange: number[]): void;
261
- /**
262
- * for the view score, the renderer decides what to render
263
- * depending on what is undone.
264
- * @returns
265
- */
266
- undo(): Promise<void>;
267
- }
1
+ import { SmoScore } from '../../smo/data/score';
2
+ import { SmoGraceNote } from '../../smo/data/noteModifiers';
3
+ import { SmoSystemStaff } from '../../smo/data/systemStaff';
4
+ import { SmoPartInfo } from '../../smo/data/partInfo';
5
+ import { StaffModifierBase } from '../../smo/data/staffModifiers';
6
+ import { SmoSelection, SmoSelector } from '../../smo/xform/selections';
7
+ import { UndoBuffer } from '../../smo/xform/undo';
8
+ import { PasteBuffer } from '../../smo/xform/copypaste';
9
+ import { SuiScroller } from './scroller';
10
+ import { SuiTracker } from './tracker';
11
+ import { SmoRenderConfiguration } from './configuration';
12
+ import { SuiRenderState } from './renderState';
13
+ import { SuiAudioAnimationParams } from '../audio/musicCursor';
14
+ /**
15
+ * Indicates a stave is/is not displayed in the score
16
+ * @category SuiRender
17
+ */
18
+ export interface ViewMapEntry {
19
+ show: boolean;
20
+ }
21
+ export type updateSelectionFunc = (score: SmoScore, selections: SmoSelection[]) => void;
22
+ export type updateSingleSelectionFunc = (score: SmoScore, selection: SmoSelection) => void;
23
+ export type updateStaffModifierFunc = (score: SmoScore, fromSelection: SmoSelection, toSelection: SmoSelection) => void;
24
+ /**
25
+ * Base class for all operations on the rendered score. The base class handles the following:
26
+ * 1. Undo and recording actions for the operation
27
+ * 2. Maintain/change which staves in the score are displayed (staff map)
28
+ * 3. Mapping between the displayed score and the data representation
29
+ * @category SuiRender
30
+ */
31
+ export declare abstract class SuiScoreView {
32
+ static Instance: SuiScoreView | null;
33
+ score: SmoScore;
34
+ storeScore: SmoScore;
35
+ staffMap: number[];
36
+ storeUndo: UndoBuffer;
37
+ tracker: SuiTracker;
38
+ renderer: SuiRenderState;
39
+ scroller: SuiScroller;
40
+ storePaste: PasteBuffer;
41
+ config: SmoRenderConfiguration;
42
+ audioAnimation: SuiAudioAnimationParams;
43
+ constructor(config: SmoRenderConfiguration, svgContainer: HTMLElement, score: SmoScore, scrollSelector: HTMLElement, undoBuffer: UndoBuffer);
44
+ /**
45
+ * Await on the full update of the score
46
+ * @returns
47
+ */
48
+ renderPromise(): Promise<any>;
49
+ /**
50
+ * Await on the partial update of the score in the view
51
+ * @returns
52
+ */
53
+ updatePromise(): Promise<any>;
54
+ awaitRender(): Promise<any>;
55
+ /**
56
+ * await on the full update of the score, also resetting the viewport (to reflect layout changes)
57
+ * @returns
58
+ */
59
+ refreshViewport(): Promise<any>;
60
+ handleScrollEvent(scrollLeft: number, scrollTop: number): void;
61
+ getPartMap(): {
62
+ keys: number[];
63
+ partMap: Record<number, SmoPartInfo>;
64
+ };
65
+ /**
66
+ * Any method that modifies a set of selections can call this to update
67
+ * the score view and the backing score.
68
+ * @param actor
69
+ * @param selections
70
+ */
71
+ modifyCurrentSelections(label: string, actor: updateSelectionFunc): Promise<void>;
72
+ /**
73
+ * Any method that modifies a set of selections can call this to update
74
+ * the score view and the backing score.
75
+ * @param actor
76
+ * @param selections
77
+ */
78
+ modifySelection(label: string, selection: SmoSelection, actor: updateSelectionFunc): Promise<void>;
79
+ /**
80
+ * Any method that modifies a set of selections can call this to update
81
+ * the score view and the backing score.
82
+ * @param actor
83
+ * @param selections
84
+ */
85
+ modifySelectionNoWait(label: string, selection: SmoSelection, actor: updateSingleSelectionFunc): Promise<void>;
86
+ /**
87
+ * Modifiy a set of columns, e.g. tempo, time, key. This has different undo behavior, don't
88
+ * pend on the result because there may be a combination of operations.
89
+ * @param label
90
+ * @param selections
91
+ * @param actor
92
+ */
93
+ modifyColumnsSelectionsNoWait(label: string, selections: SmoSelection[], actor: updateSingleSelectionFunc): void;
94
+ /**
95
+ * This is used in some Smoosic demos and pens.
96
+ * @param action any action, but most usefully a SuiScoreView method
97
+ * @param repetition number of times to repeat, waiting on render promise between
98
+ * if not specified, defaults to 1
99
+ * @returns promise, resolved action has been completed and score is updated.
100
+ */
101
+ waitableAction(action: () => void, repetition?: number): Promise<unknown>;
102
+ /**
103
+ * The plural form of _getEquivalentSelection
104
+ * @param selections
105
+ * @returns
106
+ */
107
+ _getEquivalentSelections(selections: SmoSelection[]): SmoSelection[];
108
+ getPasteMeasureList(): SmoSelection[];
109
+ /**
110
+ * A staff modifier has changed, create undo operations for the measures affected
111
+ * @param label
112
+ * @param staffModifier
113
+ * @param subtype
114
+ */
115
+ undoStaffModifier(label: string, staffModifier: StaffModifierBase, subtype: number): void;
116
+ /**
117
+ * Return the index of the page that is in the center of the client screen.
118
+ */
119
+ getFocusedPage(): number;
120
+ /**
121
+ * Create a rectangle undo, like a multiple columns but not necessarily the whole
122
+ * score.
123
+ */
124
+ _undoColumn(label: string, measureIndex: number): void;
125
+ /**
126
+ * Score preferences don't affect the display, but they do have an undo
127
+ * @param label
128
+ */
129
+ _undoScorePreferences(label: string): void;
130
+ undoColumnRange(label: string, measureSelections: SmoSelection[]): void;
131
+ undoMeasureRange(label: string, measureSelections: SmoSelection[]): SmoSelection[];
132
+ /**
133
+ * Add to the undo buffer the current set of measures selected.
134
+ * @param label
135
+ * @returns
136
+ */
137
+ undoTrackerMeasureSelections(label: string): SmoSelection[];
138
+ /**
139
+ * operation that only affects the first selection. Setup undo for the measure
140
+ */
141
+ _undoFirstMeasureSelection(label: string): SmoSelection;
142
+ /**
143
+ * Add the selection to the undo buffer
144
+ * @param label
145
+ * @param selection
146
+ */
147
+ _undoSelection(label: string, selection: SmoSelection): void;
148
+ /**
149
+ * Add multiple selections to the undo buffer as a group
150
+ * @param label
151
+ * @param selections
152
+ */
153
+ _undoSelections(label: string, selections: SmoSelection[]): void;
154
+ /**
155
+ * Update renderer for measures that have changed
156
+ */
157
+ _renderChangedMeasures(measureSelections: SmoSelection[]): void;
158
+ /**
159
+ * Update renderer for some columns
160
+ * @param fromSelector
161
+ * @param toSelector
162
+ */
163
+ _renderRectangle(fromSelector: SmoSelector, toSelector: SmoSelector): void;
164
+ /**
165
+ * Setup undo for operation that affects the whole score
166
+ * @param label
167
+ */
168
+ _undoScore(label: string): void;
169
+ /**
170
+ * Get the selector from this.storeScore that maps to the displayed selector from this.score
171
+ * @param selector
172
+ * @returns
173
+ */
174
+ _getEquivalentSelector(selector: SmoSelector): any;
175
+ /**
176
+ * Get the equivalent staff id from this.storeScore that maps to the displayed selector from this.score
177
+ * @param staffId
178
+ * @returns
179
+ */
180
+ _getEquivalentStaff(staffId: number): number;
181
+ /**
182
+ * Get the equivalent selection from this.storeScore that maps to the displayed selection from this.score
183
+ * @param selection
184
+ * @returns
185
+ */
186
+ _getEquivalentSelection(selection: SmoSelection): SmoSelection | null;
187
+ /**
188
+ * Get the equivalent selection from this.storeScore that maps to the displayed selection from this.score
189
+ * @param selection
190
+ * @returns
191
+ */
192
+ _getEquivalentGraceNote(selection: SmoSelection, gn: SmoGraceNote): SmoGraceNote;
193
+ /**
194
+ * Get the rectangle of selections indicated by the parameters from the score
195
+ * @param startSelector
196
+ * @param endSelector
197
+ * @param score
198
+ * @returns
199
+ */
200
+ _getRectangleSelections(startSelector: SmoSelector, endSelector: SmoSelector): SmoSelection[];
201
+ /**
202
+ * set the grouping flag for undo operations
203
+ * @param val
204
+ */
205
+ groupUndo(val: boolean): void;
206
+ /**
207
+ * Show all staves, 1:1 mapping of view score staff to stored score staff
208
+ */
209
+ get defaultStaffMap(): number[];
210
+ /**
211
+ * Bootstrapping function, creates the renderer and associated timers
212
+ */
213
+ startRenderingEngine(): void;
214
+ /**
215
+ * Gets the current mapping of displayed staves to score staves (this.storeScore)
216
+ * @returns
217
+ */
218
+ getView(): ViewMapEntry[];
219
+ /**
220
+ * Update the staff ID when the view changes
221
+ */
222
+ setMappedStaffIds(): void;
223
+ resetPartView(): void;
224
+ /**
225
+ * Exposes a part: hides non-part staves, shows part staves.
226
+ * Note this will reset the view. After this operation, staff 0 will
227
+ * be the selected part.
228
+ * @param staff
229
+ */
230
+ exposePart(staff: SmoSystemStaff): void;
231
+ /**
232
+ * Indicates if the score is displaying in part-mode vs. score mode.
233
+ * @returns
234
+ */
235
+ isPartExposed(): boolean;
236
+ /**
237
+ * Parts have different formatting options from the parent score, indluding layout. Reset
238
+ * them when exposing a part.
239
+ */
240
+ _mapPartFormatting(): void;
241
+ /**
242
+ * Update the list of staves in the score that are displayed.
243
+ */
244
+ setView(rows: ViewMapEntry[]): void;
245
+ /**
246
+ * view all the staffs in score mode.
247
+ */
248
+ viewAll(): void;
249
+ /**
250
+ * If the score is non-transposed, transpose the part so it is in the
251
+ * correct key.
252
+ */
253
+ _setTransposing(): void;
254
+ /**
255
+ * Update the view after loading or restoring a completely new score
256
+ * @param score
257
+ * @returns
258
+ */
259
+ changeScore(score: SmoScore): Promise<any>;
260
+ replaceMeasureView(measureRange: number[]): void;
261
+ /**
262
+ * for the view score, the renderer decides what to render
263
+ * depending on what is undone.
264
+ * @returns
265
+ */
266
+ undo(): Promise<void>;
267
+ }