smoosic 2.0.3 → 2.0.4

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 (245) hide show
  1. package/build/smoosic.js +395 -67
  2. package/changes.md +85 -0
  3. package/package.json +98 -82
  4. package/release/smoosic.js +395 -67
  5. package/specs/032-split-multimeasure-rests/checklists/requirements.md +40 -0
  6. package/specs/032-split-multimeasure-rests/contracts/grouping-contract.md +53 -0
  7. package/specs/032-split-multimeasure-rests/data-model.md +70 -0
  8. package/specs/032-split-multimeasure-rests/plan.md +81 -0
  9. package/specs/032-split-multimeasure-rests/quickstart.md +46 -0
  10. package/specs/032-split-multimeasure-rests/research.md +63 -0
  11. package/specs/032-split-multimeasure-rests/spec.md +127 -0
  12. package/specs/032-split-multimeasure-rests/tasks.md +174 -0
  13. package/specs/033-key-distance-transposition/checklists/requirements.md +35 -0
  14. package/specs/033-key-distance-transposition/contracts/spelling-api.md +36 -0
  15. package/specs/033-key-distance-transposition/data-model.md +49 -0
  16. package/specs/033-key-distance-transposition/plan.md +87 -0
  17. package/specs/033-key-distance-transposition/quickstart.md +40 -0
  18. package/specs/033-key-distance-transposition/research.md +82 -0
  19. package/specs/033-key-distance-transposition/spec.md +132 -0
  20. package/specs/033-key-distance-transposition/tasks.md +139 -0
  21. package/specs/034-smz-compressed-scores/checklists/requirements.md +35 -0
  22. package/specs/034-smz-compressed-scores/contracts/archive-api.md +30 -0
  23. package/specs/034-smz-compressed-scores/data-model.md +48 -0
  24. package/specs/034-smz-compressed-scores/plan.md +89 -0
  25. package/specs/034-smz-compressed-scores/quickstart.md +44 -0
  26. package/specs/034-smz-compressed-scores/research.md +86 -0
  27. package/specs/034-smz-compressed-scores/spec.md +137 -0
  28. package/specs/034-smz-compressed-scores/tasks.md +148 -0
  29. package/specs/035-paste-special/checklists/requirements.md +35 -0
  30. package/specs/035-paste-special/contracts/paste-special-api.md +50 -0
  31. package/specs/035-paste-special/data-model.md +47 -0
  32. package/specs/035-paste-special/plan.md +83 -0
  33. package/specs/035-paste-special/quickstart.md +51 -0
  34. package/specs/035-paste-special/research.md +97 -0
  35. package/specs/035-paste-special/spec.md +170 -0
  36. package/specs/035-paste-special/tasks.md +149 -0
  37. package/specs/036-autosave-recovery/checklists/requirements.md +36 -0
  38. package/specs/036-autosave-recovery/contracts/autosave-api.md +111 -0
  39. package/specs/036-autosave-recovery/data-model.md +70 -0
  40. package/specs/036-autosave-recovery/plan.md +87 -0
  41. package/specs/036-autosave-recovery/quickstart.md +65 -0
  42. package/specs/036-autosave-recovery/research.md +105 -0
  43. package/specs/036-autosave-recovery/spec.md +143 -0
  44. package/specs/036-autosave-recovery/tasks.md +165 -0
  45. package/specs/037-fix-new-part-dialog/checklists/requirements.md +38 -0
  46. package/specs/037-fix-new-part-dialog/contracts/create-part-api.md +84 -0
  47. package/specs/037-fix-new-part-dialog/data-model.md +68 -0
  48. package/specs/037-fix-new-part-dialog/plan.md +83 -0
  49. package/specs/037-fix-new-part-dialog/quickstart.md +58 -0
  50. package/specs/037-fix-new-part-dialog/research.md +86 -0
  51. package/specs/037-fix-new-part-dialog/spec.md +144 -0
  52. package/specs/037-fix-new-part-dialog/tasks.md +174 -0
  53. package/specs/038-per-measure-beam-groups/checklists/requirements.md +36 -0
  54. package/specs/038-per-measure-beam-groups/contracts/beam-groups-api.md +74 -0
  55. package/specs/038-per-measure-beam-groups/data-model.md +75 -0
  56. package/specs/038-per-measure-beam-groups/plan.md +84 -0
  57. package/specs/038-per-measure-beam-groups/quickstart.md +53 -0
  58. package/specs/038-per-measure-beam-groups/research.md +72 -0
  59. package/specs/038-per-measure-beam-groups/spec.md +146 -0
  60. package/specs/038-per-measure-beam-groups/tasks.md +132 -0
  61. package/specs/039-measure-fill-submenu/checklists/requirements.md +35 -0
  62. package/specs/039-measure-fill-submenu/contracts/measure-fill-api.md +56 -0
  63. package/specs/039-measure-fill-submenu/data-model.md +79 -0
  64. package/specs/039-measure-fill-submenu/plan.md +81 -0
  65. package/specs/039-measure-fill-submenu/quickstart.md +62 -0
  66. package/specs/039-measure-fill-submenu/research.md +68 -0
  67. package/specs/039-measure-fill-submenu/spec.md +153 -0
  68. package/specs/039-measure-fill-submenu/tasks.md +121 -0
  69. package/specs/040-dynamics-dialog-cleanup/checklists/requirements.md +36 -0
  70. package/specs/040-dynamics-dialog-cleanup/contracts/dynamics-dialog.md +52 -0
  71. package/specs/040-dynamics-dialog-cleanup/data-model.md +48 -0
  72. package/specs/040-dynamics-dialog-cleanup/plan.md +89 -0
  73. package/specs/040-dynamics-dialog-cleanup/quickstart.md +69 -0
  74. package/specs/040-dynamics-dialog-cleanup/research.md +80 -0
  75. package/specs/040-dynamics-dialog-cleanup/spec.md +120 -0
  76. package/specs/040-dynamics-dialog-cleanup/tasks.md +114 -0
  77. package/specs/041-delete-special/checklists/requirements.md +35 -0
  78. package/specs/041-delete-special/contracts/delete-special-api.md +41 -0
  79. package/specs/041-delete-special/data-model.md +40 -0
  80. package/specs/041-delete-special/plan.md +93 -0
  81. package/specs/041-delete-special/quickstart.md +41 -0
  82. package/specs/041-delete-special/research.md +75 -0
  83. package/specs/041-delete-special/spec.md +136 -0
  84. package/specs/041-delete-special/tasks.md +106 -0
  85. package/src/application/application.ts +13 -2
  86. package/src/application/exports.ts +401 -395
  87. package/src/application/generateVexTests.ts +2 -2
  88. package/src/render/sui/NoteEntryCaret.ts +117 -16
  89. package/src/render/sui/autosave.ts +265 -0
  90. package/src/render/sui/formatter.ts +12 -2
  91. package/src/render/sui/scoreChangeState.ts +8 -3
  92. package/src/render/sui/scoreView.ts +47 -2
  93. package/src/render/sui/scoreViewOperations.ts +2706 -2555
  94. package/src/render/sui/staffLineGeometry.ts +82 -0
  95. package/src/render/vex/vxMeasure.ts +22 -8
  96. package/src/render/vex/vxNote.ts +2 -4
  97. package/src/smo/data/measure.ts +58 -1
  98. package/src/smo/data/measureModifiers.ts +81 -1
  99. package/src/smo/data/music.ts +169 -359
  100. package/src/smo/data/note.ts +1 -1
  101. package/src/smo/data/noteModifiers.ts +12 -0
  102. package/src/smo/data/score.ts +167 -2
  103. package/src/smo/data/scoreModifiers.ts +46 -1
  104. package/src/smo/data/systemStaff.ts +43 -0
  105. package/src/smo/xform/beamers.ts +80 -6
  106. package/src/smo/xform/copypaste.ts +207 -47
  107. package/src/smo/xform/measureFill.ts +89 -0
  108. package/src/smo/xform/operations.ts +403 -61
  109. package/src/smo/xform/selections.ts +7 -0
  110. package/src/ui/components/dialogs/beamGroups.vue +106 -0
  111. package/src/ui/components/dialogs/deleteSpecial.vue +38 -0
  112. package/src/ui/components/dialogs/dynamics.vue +16 -3
  113. package/src/ui/components/dialogs/fileUpload.vue +2 -2
  114. package/src/ui/components/dialogs/hairpin.vue +3 -3
  115. package/src/ui/components/dialogs/newPart.vue +148 -184
  116. package/src/ui/components/dialogs/pasteSpecial.vue +49 -0
  117. package/src/ui/components/dialogs/recovery.vue +66 -0
  118. package/src/ui/components/dialogs/save.vue +11 -4
  119. package/src/ui/components/dialogs/scorePreferences.vue +23 -1
  120. package/src/ui/components/dialogs/slur.vue +6 -6
  121. package/src/ui/components/dialogs/tempo.vue +11 -3
  122. package/src/ui/components/dialogs/timeSignature.vue +5 -0
  123. package/src/ui/components/dialogs/volta.vue +3 -3
  124. package/src/ui/dialogs/annotationVue.ts +1 -1
  125. package/src/ui/dialogs/beamGroupsVue.ts +69 -0
  126. package/src/ui/dialogs/createPartHelpers.ts +68 -0
  127. package/src/ui/dialogs/deleteSpecial.ts +57 -0
  128. package/src/ui/dialogs/dynamicsVue.ts +87 -60
  129. package/src/ui/dialogs/factory.ts +0 -2
  130. package/src/ui/dialogs/fileDialogs.ts +63 -22
  131. package/src/ui/dialogs/instrument.ts +37 -30
  132. package/src/ui/dialogs/pasteSpecial.ts +59 -0
  133. package/src/ui/dialogs/preferences.ts +41 -40
  134. package/src/ui/dialogs/recovery.ts +49 -0
  135. package/src/ui/fileio/fileInput.ts +12 -3
  136. package/src/ui/fileio/scoreArchive.ts +151 -0
  137. package/src/ui/fileio/xhrLoader.ts +26 -0
  138. package/src/ui/i18n/language.ts +1 -1
  139. package/src/ui/menus/beams.ts +181 -112
  140. package/src/ui/menus/edit.ts +44 -6
  141. package/src/ui/menus/file.ts +21 -1
  142. package/src/ui/menus/measure.ts +40 -1
  143. package/tests/autosave.ts +332 -0
  144. package/tests/beamDotted.ts +56 -0
  145. package/tests/beamGroups.ts +338 -0
  146. package/tests/createPart.ts +292 -0
  147. package/tests/deleteSpecial.ts +350 -0
  148. package/tests/dynamicsFontSize.ts +132 -0
  149. package/tests/keyDistanceTransposition.ts +351 -0
  150. package/tests/measureFill.ts +295 -0
  151. package/tests/movePart.ts +94 -0
  152. package/tests/multimeasureRest.ts +338 -0
  153. package/tests/pasteIntoMeasure.ts +103 -0
  154. package/tests/pasteSpecial.ts +541 -0
  155. package/tests/quickBeam.ts +126 -0
  156. package/tests/scoreArchive.ts +218 -0
  157. package/tests/scoreChangeState.ts +2 -0
  158. package/tests/staffLineGeometry.ts +179 -0
  159. package/tests/timeSignatureDisplay.ts +58 -0
  160. package/tools/smoosic-schema.json +37 -0
  161. package/typedoc.ts +1 -1
  162. package/types/src/application/exports.d.ts +453 -447
  163. package/types/src/common/promiseHelpers.d.ts +30 -30
  164. package/types/src/common/vex.d.ts +224 -224
  165. package/types/src/render/sui/NoteEntryCaret.d.ts +107 -107
  166. package/types/src/render/sui/autosave.d.ts +99 -0
  167. package/types/src/render/sui/scoreView.d.ts +23 -0
  168. package/types/src/render/sui/scoreViewOperations.d.ts +759 -639
  169. package/types/src/render/sui/svgHelpers.d.ts +88 -88
  170. package/types/src/render/sui/svgPageMap.d.ts +344 -344
  171. package/types/src/render/sui/textEdit.d.ts +96 -96
  172. package/types/src/render/sui/textRender.d.ts +199 -199
  173. package/types/src/render/vex/smoAdapter.d.ts +47 -47
  174. package/types/src/render/vex/vxMeasure.d.ts +97 -97
  175. package/types/src/render/vex/vxNote.d.ts +56 -56
  176. package/types/src/render/vex/vxSystem.d.ts +71 -71
  177. package/types/src/smo/data/measure.d.ts +30 -0
  178. package/types/src/smo/data/measureModifiers.d.ts +568 -513
  179. package/types/src/smo/data/music.d.ts +74 -32
  180. package/types/src/smo/data/note.d.ts +498 -498
  181. package/types/src/smo/data/noteModifiers.d.ts +615 -606
  182. package/types/src/smo/data/score.d.ts +476 -421
  183. package/types/src/smo/data/scoreModifiers.d.ts +30 -0
  184. package/types/src/smo/data/scoreText.d.ts +334 -334
  185. package/types/src/smo/data/systemStaff.d.ts +14 -0
  186. package/types/src/smo/xform/beamers.d.ts +23 -1
  187. package/types/src/smo/xform/copypaste.d.ts +138 -2
  188. package/types/src/smo/xform/measureFill.d.ts +21 -0
  189. package/types/src/smo/xform/operations.d.ts +245 -129
  190. package/types/src/smo/xform/selections.d.ts +154 -154
  191. package/types/src/smo/xform/undo.d.ts +142 -142
  192. package/types/src/ui/buttons/button.d.ts +100 -100
  193. package/types/src/ui/buttons/ribbon.d.ts +70 -70
  194. package/types/src/ui/common.d.ts +76 -76
  195. package/types/src/ui/components/dialogs/chordText.d.ts +28 -28
  196. package/types/src/ui/components/dialogs/textBlockAtomNode.d.ts +20 -20
  197. package/types/src/ui/components/dialogs/textGroupHtml.d.ts +29 -29
  198. package/types/src/ui/composable/draggable.d.ts +15 -15
  199. package/types/src/ui/dialogs/adapter.d.ts +120 -120
  200. package/types/src/ui/dialogs/annotationVue.d.ts +9 -9
  201. package/types/src/ui/dialogs/audioSettings.d.ts +32 -32
  202. package/types/src/ui/dialogs/beamGroupsVue.d.ts +20 -0
  203. package/types/src/ui/dialogs/chordChangeVue.d.ts +8 -8
  204. package/types/src/ui/dialogs/createPartHelpers.d.ts +29 -0
  205. package/types/src/ui/dialogs/customTupletsVue.d.ts +9 -9
  206. package/types/src/ui/dialogs/deleteSpecial.d.ts +8 -0
  207. package/types/src/ui/dialogs/dialog.d.ts +203 -203
  208. package/types/src/ui/dialogs/dynamicsVue.d.ts +10 -10
  209. package/types/src/ui/dialogs/factory.d.ts +15 -15
  210. package/types/src/ui/dialogs/fileDialogs.d.ts +4 -4
  211. package/types/src/ui/dialogs/hairpin.d.ts +35 -35
  212. package/types/src/ui/dialogs/hairpinVue.d.ts +7 -7
  213. package/types/src/ui/dialogs/instrument.d.ts +3 -3
  214. package/types/src/ui/dialogs/keySignatureVue.d.ts +7 -7
  215. package/types/src/ui/dialogs/libraryVue.d.ts +15 -15
  216. package/types/src/ui/dialogs/lyricVue.d.ts +8 -8
  217. package/types/src/ui/dialogs/pasteSpecial.d.ts +8 -0
  218. package/types/src/ui/dialogs/pedalMarkingVue.d.ts +7 -7
  219. package/types/src/ui/dialogs/recovery.d.ts +8 -0
  220. package/types/src/ui/dialogs/rehearsalMark.d.ts +25 -25
  221. package/types/src/ui/dialogs/rehearsalMarkVue.d.ts +7 -7
  222. package/types/src/ui/dialogs/slur.d.ts +57 -57
  223. package/types/src/ui/dialogs/slurVue.d.ts +7 -7
  224. package/types/src/ui/dialogs/tempo.d.ts +50 -50
  225. package/types/src/ui/dialogs/tempoVue.d.ts +10 -10
  226. package/types/src/ui/dialogs/textBlockVue.d.ts +8 -8
  227. package/types/src/ui/dialogs/textBracket.d.ts +35 -35
  228. package/types/src/ui/dialogs/textBracketVue.d.ts +7 -7
  229. package/types/src/ui/dialogs/tie.d.ts +41 -41
  230. package/types/src/ui/dialogs/volta.d.ts +40 -40
  231. package/types/src/ui/dialogs/voltaVue.d.ts +7 -7
  232. package/types/src/ui/fileio/fileInput.d.ts +7 -1
  233. package/types/src/ui/fileio/library.d.ts +40 -40
  234. package/types/src/ui/fileio/scoreArchive.d.ts +55 -0
  235. package/types/src/ui/fileio/xhrLoader.d.ts +7 -0
  236. package/types/src/ui/menus/file.d.ts +8 -8
  237. package/types/src/ui/menus/language.d.ts +7 -7
  238. package/types/src/ui/menus/manager.d.ts +58 -58
  239. package/types/src/ui/menus/menu.d.ts +159 -159
  240. package/types/src/ui/menus/partSelection.d.ts +14 -14
  241. package/types/src/ui/menus/score.d.ts +8 -8
  242. package/types/src/ui/menus/staffModifier.d.ts +17 -17
  243. package/types/typedoc.d.ts +147 -147
  244. package/src/ui/dialogs/dynamics.ts +0 -141
  245. package/types/src/ui/dialogs/dynamics.d.ts +0 -37
@@ -1,639 +1,759 @@
1
- import { SuiScoreView, updateStaffModifierFunc } from './scoreView';
2
- import { SmoScore, engravingFontType } from '../../smo/data/score';
3
- import { SmoSystemStaffParams } from '../../smo/data/systemStaff';
4
- import { SmoPartInfo } from '../../smo/data/partInfo';
5
- import { SmoMeasure } from '../../smo/data/measure';
6
- import { KeyEvent, SvgBox, Pitch, PitchLetter } from '../../smo/data/common';
7
- import { SmoRenderConfiguration } from './configuration';
8
- import { SmoSystemGroup, SmoPageLayout, SmoGlobalLayout, SmoAudioPlayerSettings, SmoScorePreferences, SmoScoreInfo } from '../../smo/data/scoreModifiers';
9
- import { SmoTextGroup } from '../../smo/data/scoreText';
10
- import { SmoDynamicText, SmoArticulation, SmoOrnament, SmoLyric, SmoArpeggioType, SmoClefChange, SmoTabNote } from '../../smo/data/noteModifiers';
11
- import { SmoTempo, SmoVolta, SmoRehearsalMark, SmoMeasureFormat, SmoTimeSignature } from '../../smo/data/measureModifiers';
12
- import { UndoBuffer } from '../../smo/xform/undo';
13
- import { createStaffModifierType, MakeTupletOperation } from '../../smo/xform/operations';
14
- import { BatchSelectionOperation } from '../../smo/xform/operations';
15
- import { FontInfo } from '../../common/vex';
16
- import { SmoSelection, SmoSelector } from '../../smo/xform/selections';
17
- import { StaffModifierBase, SmoInstrument, SmoInstrumentParams, SmoStaffTextBracket, SmoTabStave } from '../../smo/data/staffModifiers';
18
- /**
19
- * MVVM-like operations on the displayed score.
20
- *
21
- * All operations that can be performed on a 'live' score go through this
22
- * module. It maps the score view to the actual score and makes sure the
23
- * model and view stay in sync.
24
- *
25
- * Because this object operates on the current selections,
26
- * all operations return promise so applications can wait for the
27
- * operation to complete and update the selection list.
28
- * @category SuiRender
29
- */
30
- export declare class SuiScoreViewOperations extends SuiScoreView {
31
- constructor(config: SmoRenderConfiguration, score: SmoScore, undoBuffer: UndoBuffer);
32
- /**
33
- * Add a new text group to the score
34
- * @param textGroup a new text group
35
- * @returns
36
- */
37
- addTextGroup(textGroup: SmoTextGroup): Promise<void>;
38
- /**
39
- * Remove the text group from the score
40
- * @param textGroup
41
- * @returns
42
- */
43
- removeTextGroup(textGroup: SmoTextGroup): Promise<void>;
44
- /**
45
- * UPdate an existing text group. The original is passed in, because since TG not tied to a musical
46
- * element, we need to find the one we're updating.
47
- * @param oldVersion
48
- * @param newVersion
49
- * @returns
50
- */
51
- updateTextGroup(newVersion: SmoTextGroup): Promise<void>;
52
- /**
53
- * load an mxml score remotely, return a promise that
54
- * completes when the file is loaded
55
- * @param url where to find the xml file
56
- * @returns
57
- */
58
- loadRemoteXml(url: string): Promise<any>;
59
- /**
60
- * load a remote score in SMO format
61
- * @param url url to find the score
62
- * @returns
63
- */
64
- loadRemoteJson(url: string): Promise<any>;
65
- /**
66
- * Load a remote score, return promise when it's been loaded
67
- * from afar.
68
- * @param pref
69
- * @returns
70
- */
71
- loadRemoteScore(url: string): Promise<any>;
72
- updateAudioSettings(pref: SmoAudioPlayerSettings): Promise<void>;
73
- /**
74
- * Global settings that control how the score editor behaves
75
- * @param pref
76
- * @returns
77
- */
78
- updateScorePreferences(pref: SmoScorePreferences): Promise<void>;
79
- /**
80
- * Update information about the score, composer etc.
81
- * @param scoreInfo
82
- * @returns
83
- */
84
- updateScoreInfo(scoreInfo: SmoScoreInfo): Promise<void>;
85
- addRemoveArpeggio(code: SmoArpeggioType): Promise<void>;
86
- /**
87
- * A clef change mid-measure (clefNote)
88
- * @param clef
89
- */
90
- addRemoveClefChange(clef: SmoClefChange): Promise<void>;
91
- /**
92
- * Modify the dynamics assoicated with the specific selection
93
- * @param selection
94
- * @param dynamic
95
- * @returns
96
- */
97
- addDynamic(selection: SmoSelection, dynamic: SmoDynamicText): Promise<void>;
98
- /**
99
- * Remove dynamics from the current selection
100
- * @param dynamic
101
- * @returns
102
- */
103
- removeDynamic(dynamic: SmoDynamicText): Promise<void>;
104
- /**
105
- * we never really delete a note, but we will convert it into a rest and if it's
106
- * already a rest we will try to hide it.
107
- * Operates on current selections
108
- * */
109
- deleteNote(): Promise<void>;
110
- /**
111
- * The lyric editor moves around, so we can't depend on the tracker for the
112
- * correct selection. We get it directly from the editor.
113
- *
114
- * @param selector - the selector of the note with the lyric to remove
115
- * @param lyric - a copy of the lyric to remove. We use the verse, parser to identify it
116
- * @returns render promise
117
- */
118
- removeLyric(selector: SmoSelector, lyric: SmoLyric): Promise<void>;
119
- /**
120
- * @param selector where to add or update the lyric
121
- * @param lyric a copy of the lyric to remove
122
- * @returns
123
- */
124
- addOrUpdateLyric(selector: SmoSelector, lyric: SmoLyric): Promise<void>;
125
- /**
126
- * @param selector the selector of the note with the annotation to remove
127
- * @param annotation a copy of the annotation to remove. We use the verse, parser to identify it
128
- * @returns render promise
129
- */
130
- removeAnnotation(selector: SmoSelector, annotation: SmoLyric): Promise<void>;
131
- /**
132
- * @param selector where to add or update the annotation
133
- * @param annotation a copy of the annotation to add/update
134
- * @returns
135
- */
136
- addOrUpdateAnnotation(selector: SmoSelector, annotation: SmoLyric): Promise<void>;
137
- /**
138
- * Delete all the notes for the currently selected voice
139
- * @returns
140
- */
141
- depopulateVoice(): Promise<void>;
142
- /**
143
- * Change the active voice in a multi-voice measure.
144
- * @param index
145
- * @returns
146
- */
147
- _changeActiveVoice(index: number): SmoSelection[];
148
- /**
149
- * Populate a new voice with default notes
150
- * @param index the voice to populate
151
- * @returns
152
- */
153
- populateVoice(index: number): Promise<void>;
154
- swapVoices(voice1: number, voice2: number): Promise<void>;
155
- /**
156
- * Assign an instrument to a set of measures
157
- * @param instrument the instrument to assign to the selections
158
- * @param selections
159
- * @returns
160
- */
161
- changeInstrument(instrument: SmoInstrument, selections: SmoSelection[]): Promise<void>;
162
- /**
163
- * Set the time signature for a selection
164
- * @param timeSignature actual time signature
165
- */
166
- setTimeSignature(timeSignature: SmoTimeSignature): Promise<void>;
167
- /**
168
- * Move selected staff up or down in the score.
169
- * @param index direction to move
170
- * @returns
171
- */
172
- moveStaffUpDown(index: number): Promise<void>;
173
- /**
174
- * Update the staff group for a score, which determines how the staves
175
- * are justified and bracketed
176
- * @param staffGroup
177
- */
178
- addOrUpdateStaffGroup(staffGroup: SmoSystemGroup): Promise<void>;
179
- removeStaffGroup(staffGroup: SmoSystemGroup): Promise<void>;
180
- clearSystemGroups(): Promise<void>;
181
- updateTabStave(tabStave: SmoTabStave): Promise<void>;
182
- removeTabStave(): Promise<void>;
183
- /**
184
- * Update tempo for all or part of the score
185
- * @param measure the measure with the tempo. Tempo is measure-wide parameter
186
- * @param scoreMode if true, update whole score. Else selections
187
- * @returns
188
- */
189
- updateTempoScore(measure: SmoMeasure, tempo: SmoTempo, scoreMode: boolean, selectionMode: boolean): Promise<void>;
190
- updateTabNote(tabNote: SmoTabNote): Promise<void>;
191
- removeTabNote(): Promise<void>;
192
- /**
193
- * 'remove' tempo, which means either setting the bars to the
194
- * default tempo, or the previously-set tempo.
195
- * @param scoreMode whether to reset entire score
196
- */
197
- removeTempo(measure: SmoMeasure, tempo: SmoTempo, scoreMode: boolean, selectionMode: boolean): Promise<void>;
198
- /**
199
- * Add a grace note to the selected real notes.
200
- */
201
- addGraceNote(): Promise<void>;
202
- /**
203
- * remove selected grace note
204
- * @returns
205
- */
206
- removeGraceNote(): Promise<void>;
207
- /**
208
- * Toggle slash in stem of grace note
209
- */
210
- slashGraceNotes(): Promise<void>;
211
- transposeScore(offset: number): Promise<void>;
212
- /**
213
- * transpose selected notes
214
- * @param offset 1/2 steps
215
- * @returns
216
- */
217
- transposeSelections(offset: number): Promise<void>;
218
- /**
219
- * toggle the accidental spelling of the selected notes
220
- * @returns
221
- */
222
- toggleEnharmonic(): Promise<void>;
223
- /**
224
- * Toggle cautionary/courtesy accidentals
225
- */
226
- toggleCourtesyAccidentals(): Promise<void>;
227
- /**
228
- * change the duration of notes for selected, creating more
229
- * or fewer notes.
230
- * After the change, reset the selection so it's as close as possible
231
- * to the original length
232
- * @param operation
233
- * @returns
234
- */
235
- batchDurationOperation(operation: BatchSelectionOperation): Promise<void>;
236
- /**
237
- * Toggle selected modifier on selected notes
238
- * @param modifier
239
- * @param ctor parent class constructor (e.g. SmoOrnament)
240
- * @returns
241
- */
242
- toggleArticulation(modifier: string, ctor: string): Promise<void>;
243
- setArticulation(modifier: SmoArticulation, set: boolean): Promise<void>;
244
- setOrnament(modifier: SmoOrnament, set: boolean): Promise<void>;
245
- /**
246
- * convert non-tuplet not to a tuplet
247
- * @param params
248
- */
249
- makeTuplet(params: MakeTupletOperation): Promise<void>;
250
- /**
251
- * Convert selected tuplet to a single (if possible) non-tuplet
252
- */
253
- unmakeTuplet(): Promise<void>;
254
- /**
255
- * Create a chord by adding an interval to selected note
256
- * @param interval 1/2 steps
257
- * @returns
258
- */
259
- setInterval(interval: number): Promise<void>;
260
- /**
261
- * change the selected chord into a single note
262
- * @returns
263
- */
264
- collapseChord(): Promise<void>;
265
- /**
266
- * Toggle chicken-scratches, for jazz improv, comping etc.
267
- */
268
- toggleSlash(): Promise<void>;
269
- /**
270
- * make selected notes into a rest, or visa-versa
271
- * @returns
272
- */
273
- makeRest(): Promise<void>;
274
- clearAllBeams(): Promise<void>;
275
- clearSelectedBeams(): Promise<void>;
276
- /**
277
- * toggle the 'end beam' flag for selected notes
278
- * @returns
279
- */
280
- unbeamSelections(): Promise<void>;
281
- toggleCue(): Promise<void>;
282
- /**
283
- * up or down
284
- * @returns
285
- */
286
- toggleBeamDirection(): Promise<void>;
287
- /**
288
- * Add the selected notes to a beam group
289
- */
290
- beamSelections(): Promise<void>;
291
- /**
292
- * change key signature for selected measures
293
- * @param keySignature vex key signature
294
- */
295
- addKeySignature(keySignature: string): Promise<void>;
296
- /**
297
- * Sets a pitch from the piano widget.
298
- * @param pitch {Pitch}
299
- * @param chordPedal {boolean} - indicates we are adding to a chord
300
- */
301
- setPitchPiano(pitch: Pitch, chordPedal: boolean): Promise<void>;
302
- /**
303
- * show or hide the piano widget
304
- * @param value to show it
305
- */
306
- showPiano(value: boolean): Promise<void>;
307
- /**
308
- * Render a pitch for each letter name-pitch in the string,
309
- * @param pitches letter names for pitches
310
- * @returns promise, resolved when all pitches rendered
311
- * @see setPitch
312
- */
313
- setPitchesPromise(pitches: PitchLetter[]): Promise<any>;
314
- setPitches(pitches: Pitch[]): Promise<void>;
315
- /**
316
- * Add a pitch to the score at the cursor. This tries to find the best pitch
317
- * to match the letter key (F vs F# for instance) based on key and surrounding notes
318
- * @param letter string
319
- */
320
- setPitch(letter: PitchLetter): Promise<void>;
321
- /**
322
- * Generic clipboard copy action
323
- */
324
- copy(): Promise<void>;
325
- /**
326
- * clipboard paste action
327
- * @returns
328
- */
329
- paste(): Promise<void>;
330
- /**
331
- * Paste only the chords.
332
- */
333
- pasteChords(): Promise<void>;
334
- /**
335
- * specify a note head other than the default for the duration
336
- * @param head
337
- */
338
- setNoteHead(head: string): Promise<void>;
339
- /**
340
- * Add a volta for selected measures
341
- */
342
- addEnding(): Promise<void>;
343
- /**
344
- * @param ending volta settings
345
- * @returns
346
- */
347
- updateEnding(ending: SmoVolta): Promise<void>;
348
- /**
349
- *
350
- * @param ending volta to remove
351
- * @returns
352
- */
353
- removeEnding(ending: SmoVolta): Promise<void>;
354
- /**
355
- *
356
- * @param position begin or end
357
- * @param barline barline type
358
- * @returns
359
- */
360
- setBarline(position: number, barline: number, bracket: number): Promise<void>;
361
- /**
362
- *
363
- * @param position start or end
364
- * @param symbol coda, etc.
365
- */
366
- setRepeatSymbol(position: number, symbol: number): Promise<void>;
367
- /**
368
- * toggle rehearsal mark on first selected measure
369
- * @returns
370
- */
371
- toggleRehearsalMark(): Promise<void>;
372
- /**
373
- * Finds the measure whose rehearsal mark has the given id, as a selection on the live score.
374
- * Rehearsal marks are column-wide, so the first staff holding it identifies the measure.
375
- * See specs/025-rehearsal-mark-dialog.
376
- */
377
- _findRehearsalMarkSelection(id: string): SmoSelection | null;
378
- /**
379
- * Replaces an existing rehearsal mark's settings on its measure, on every staff and in the
380
- * undo-copy store. Does nothing if the mark is no longer present (e.g. removed while its dialog
381
- * was open). See specs/025-rehearsal-mark-dialog.
382
- * @param mark the edited rehearsal mark
383
- */
384
- updateRehearsalMark(mark: SmoRehearsalMark): Promise<void>;
385
- /**
386
- * Removes an existing rehearsal mark from its measure on every staff and in the undo-copy store.
387
- * Does nothing if the mark is no longer present. See specs/025-rehearsal-mark-dialog.
388
- * @param mark the rehearsal mark to remove
389
- */
390
- removeRehearsalMark(mark: SmoRehearsalMark): Promise<void>;
391
- _removeStaffModifier(modifier: StaffModifierBase): void;
392
- /**
393
- * Remove selected modifier
394
- * @param modifier slur, hairpin, etc.
395
- * @returns
396
- */
397
- removeStaffModifier(modifier: StaffModifierBase): Promise<void>;
398
- /**
399
- * Change a staff modifier
400
- * @param original original version
401
- * @param modifier modified version
402
- * @returns
403
- */
404
- addOrUpdateStaffModifier(original: StaffModifierBase, modifier: StaffModifierBase): Promise<void>;
405
- lineOperation(op: createStaffModifierType<StaffModifierBase>): void;
406
- /**
407
- * Add crescendo to selection
408
- */
409
- crescendo(): Promise<void>;
410
- /**
411
- * Add crescendo to selection
412
- */
413
- crescendoBracket(): Promise<void>;
414
- /**
415
- * Add crescendo to selection
416
- */
417
- dimenuendo(): Promise<void>;
418
- /**
419
- * Add crescendo to selection
420
- */
421
- accelerando(): Promise<void>;
422
- /**
423
- * Add crescendo to selection
424
- */
425
- ritard(): Promise<void>;
426
- /**
427
- * diminuendo hairpin
428
- * @returns
429
- */
430
- decrescendo(): Promise<void>;
431
- removeTextBracket(bracket: SmoStaffTextBracket): Promise<void>;
432
- addOrReplaceStaffModifier(callback: updateStaffModifierFunc, modifier: StaffModifierBase): Promise<void>;
433
- addOrReplaceTextBracket(modifier: SmoStaffTextBracket): Promise<void>;
434
- /**
435
- * Slur selected notes
436
- * @returns
437
- */
438
- addSlur(): Promise<void>;
439
- /**
440
- * tie selected notes
441
- * @returns
442
- */
443
- tie(): Promise<void>;
444
- updateZoom(zoomFactor: number): Promise<void>;
445
- /**
446
- * set global page for score, zoom etc.
447
- * @param layout global SVG settings
448
- * @param previousLayout the layout as it was immediately before this change. Callers must
449
- * pass a snapshot taken before `layout` was mutated -- `this.score.layoutManager`'s current
450
- * value cannot be used for this, because dialogs (e.g. globalLayout.ts) bind directly to that
451
- * live object, so by the time this method runs it may already equal `layout`.
452
- * @returns
453
- */
454
- setGlobalLayout(layout: SmoGlobalLayout, previousLayout: SmoGlobalLayout): Promise<void>;
455
- /**
456
- * Set the layout of a single page
457
- * @param layout page layout
458
- * @param pageIndex which page to change
459
- * @returns
460
- */
461
- setPageLayout(layout: SmoPageLayout, pageIndex: number): Promise<void>;
462
- setPageLayouts(layout: SmoPageLayout, startIndex: number, endIndex: number): Promise<void>;
463
- /**
464
- * Update the music font
465
- * @param family
466
- * @returns
467
- */
468
- setEngravingFontFamily(family: engravingFontType): Promise<void>;
469
- /**
470
- * Upate global font used for chord changes
471
- * @param fontInfo
472
- * @returns
473
- */
474
- setChordFont(fontInfo: FontInfo): Promise<void>;
475
- /**
476
- * Update font used for lyrics
477
- * @param fontInfo
478
- * @returns
479
- */
480
- setLyricFont(fontInfo: FontInfo): Promise<void>;
481
- /**
482
- * @param value if false, lyric widths don't affect measure width
483
- * @returns
484
- */
485
- setLyricAdjustWidth(value: boolean): Promise<void>;
486
- /**
487
- * delete selected measures
488
- * @returns
489
- */
490
- deleteMeasure(): Promise<void>;
491
- /**
492
- * add number of measures, with default notes selections
493
- * @param append
494
- * @param numberToAdd
495
- * @returns
496
- */
497
- addMeasures(append: boolean, numberToAdd: number): Promise<void>;
498
- /**
499
- * add a single measure before or after selection
500
- * @param append
501
- * @returns
502
- */
503
- addMeasure(append: boolean): Promise<void>;
504
- /**
505
- * remove an entire line of music
506
- * @returns
507
- */
508
- removeStaff(): Promise<void>;
509
- /**
510
- * Add a new staff to an existing score, with default instrument for the staff part.
511
- * We base the staff parameters on a stave that currently exists in the score.
512
- * @param instrument
513
- * @returns
514
- */
515
- addStaff(instrument: SmoSystemStaffParams): Promise<void>;
516
- /**
517
- * Update part info assumes that the part is currently exposed - that
518
- * staff 0 is the first staff in the part prior to editing.
519
- * @param info
520
- */
521
- updatePartInfo(info: SmoPartInfo): Promise<void>;
522
- /**
523
- * A simpler API for applications to add a new staff to the score.
524
- * @param params - the instrument, which determines clef, etc.
525
- * @returns
526
- */
527
- addStaffSimple(params: Partial<SmoInstrumentParams>): Promise<void>;
528
- /**
529
- * Save the score to local storage.
530
- */
531
- quickSave(): void;
532
- updateRepeatCount(count: number): Promise<any>;
533
- /**
534
- * Update the measure formatting parameters for the current selection
535
- * @param format generic measure formatting parameters
536
- * @returns
537
- */
538
- setMeasureFormat(format: SmoMeasureFormat): Promise<any>;
539
- /**
540
- * Remove system breaks from the measure formatting for selected measures
541
- * @returns
542
- */
543
- removeSystemBreaks(): Promise<any>;
544
- renumberMeasures(measureIndex: number, displayIndex: number): Promise<void>;
545
- /**
546
- * Play the music from the starting selection
547
- * @returns
548
- */
549
- playFromSelection(): Promise<void>;
550
- stopPlayer(): void;
551
- pausePlayer(): void;
552
- /**
553
- * Proxy calls to move the tracker parameters according to the
554
- * rules of the 'Home' key (depending on shift/ctrl/alt)
555
- * @param ev
556
- * @returns
557
- */
558
- moveHome(ev: KeyEvent): Promise<any>;
559
- /**
560
- * Proxy calls to move the tracker parameters according to the
561
- * rules of the 'End' key (depending on shift/ctrl/alt)
562
- * @param ev
563
- * @returns
564
- */
565
- moveEnd(ev: KeyEvent): Promise<any>;
566
- /**
567
- * Grow the current selection by one to the left, if possible
568
- * @param ev
569
- * @returns
570
- */
571
- growSelectionLeft(): Promise<any>;
572
- /**
573
- * Grow the current selection by one to the right, if possible
574
- * @param ev
575
- * @returns
576
- */
577
- growSelectionRight(): Promise<any>;
578
- /**
579
- * Select the next tabbable modifier near one of the selected notes
580
- * @param keyEv
581
- * @returns
582
- */
583
- advanceModifierSelection(keyEv: KeyEvent): Promise<any>;
584
- /**
585
- * Select the next entire measure, if possible
586
- * @returns
587
- */
588
- growSelectionRightMeasure(): Promise<any>;
589
- /**
590
- * Advance cursor forwards, if possible
591
- * @param ev
592
- * @returns
593
- */
594
- moveSelectionRight(): Promise<any>;
595
- /**
596
- * Advance cursor backwards, if possible
597
- * @param ev
598
- * @returns
599
- */
600
- moveSelectionLeft(): Promise<any>;
601
- /**
602
- * Advance cursor back entire measure, if possible
603
- * @returns
604
- */
605
- moveSelectionLeftMeasure(): Promise<any>;
606
- /**
607
- * Advance cursor forward one measure, if possible
608
- * @returns
609
- */
610
- moveSelectionRightMeasure(): Promise<any>;
611
- /**
612
- * Move cursor to a higher pitch in the current chord, with wrap
613
- * @returns
614
- */
615
- moveSelectionPitchUp(): Promise<any>;
616
- /**
617
- * Move cursor to a lower pitch in the current chord, with wrap
618
- */
619
- moveSelectionPitchDown(): Promise<any>;
620
- /**
621
- * Move cursor up a staff in the system, if possible
622
- * @returns
623
- */
624
- moveSelectionUp(): Promise<any>;
625
- /**
626
- * Move cursor down a staff in the system, if possible
627
- * @returns
628
- */
629
- moveSelectionDown(): Promise<any>;
630
- /**
631
- * Set the current suggestions (hover element) as the selection
632
- * @returns
633
- */
634
- selectSuggestion(evData: KeyEvent): Promise<any>;
635
- /**
636
- * Find an element at the given box, and make it the current selection
637
- * */
638
- intersectingArtifact(evData: SvgBox): Promise<any>;
639
- }
1
+ import { SuiScoreView, updateStaffModifierFunc } from './scoreView';
2
+ import { SmoScore, engravingFontType } from '../../smo/data/score';
3
+ import { SmoSystemStaffParams } from '../../smo/data/systemStaff';
4
+ import { SmoPartInfo } from '../../smo/data/partInfo';
5
+ import { SmoMeasure } from '../../smo/data/measure';
6
+ import { KeyEvent, SvgBox, Pitch, PitchLetter } from '../../smo/data/common';
7
+ import { SmoRenderConfiguration } from './configuration';
8
+ import { SmoSystemGroup, SmoPageLayout, SmoGlobalLayout, SmoAudioPlayerSettings, SmoScorePreferences, SmoScoreInfo } from '../../smo/data/scoreModifiers';
9
+ import { SmoTextGroup } from '../../smo/data/scoreText';
10
+ import { SmoDynamicText, SmoArticulation, SmoOrnament, SmoLyric, SmoArpeggioType, SmoClefChange, SmoTabNote } from '../../smo/data/noteModifiers';
11
+ import { SmoTempo, SmoVolta, SmoRehearsalMark, SmoMeasureFormat, SmoTimeSignature } from '../../smo/data/measureModifiers';
12
+ import { UndoBuffer } from '../../smo/xform/undo';
13
+ import { createStaffModifierType, MakeTupletOperation } from '../../smo/xform/operations';
14
+ import { BatchSelectionOperation, AddPartParams, DeleteAttributeKind } from '../../smo/xform/operations';
15
+ import { MeasureFillType } from '../../smo/xform/measureFill';
16
+ import { FontInfo } from '../../common/vex';
17
+ import { PasteAttributeOptions } from '../../smo/xform/copypaste';
18
+ import { SmoSelection, SmoSelector } from '../../smo/xform/selections';
19
+ import { StaffModifierBase, SmoInstrument, SmoInstrumentParams, SmoStaffTextBracket, SmoTabStave } from '../../smo/data/staffModifiers';
20
+ import { AutosaveEntry } from './autosave';
21
+ /**
22
+ * MVVM-like operations on the displayed score.
23
+ *
24
+ * All operations that can be performed on a 'live' score go through this
25
+ * module. It maps the score view to the actual score and makes sure the
26
+ * model and view stay in sync.
27
+ *
28
+ * Because this object operates on the current selections,
29
+ * all operations return promise so applications can wait for the
30
+ * operation to complete and update the selection list.
31
+ * @category SuiRender
32
+ */
33
+ export declare class SuiScoreViewOperations extends SuiScoreView {
34
+ constructor(config: SmoRenderConfiguration, score: SmoScore, undoBuffer: UndoBuffer);
35
+ /**
36
+ * Add a new text group to the score
37
+ * @param textGroup a new text group
38
+ * @returns
39
+ */
40
+ addTextGroup(textGroup: SmoTextGroup): Promise<void>;
41
+ /**
42
+ * Remove the text group from the score
43
+ * @param textGroup
44
+ * @returns
45
+ */
46
+ removeTextGroup(textGroup: SmoTextGroup): Promise<void>;
47
+ /**
48
+ * UPdate an existing text group. The original is passed in, because since TG not tied to a musical
49
+ * element, we need to find the one we're updating.
50
+ * @param oldVersion
51
+ * @param newVersion
52
+ * @returns
53
+ */
54
+ updateTextGroup(newVersion: SmoTextGroup): Promise<void>;
55
+ /**
56
+ * load an mxml score remotely, return a promise that
57
+ * completes when the file is loaded
58
+ * @param url where to find the xml file
59
+ * @returns
60
+ */
61
+ loadRemoteXml(url: string): Promise<any>;
62
+ /**
63
+ * load a remote score in SMO format
64
+ * @param url url to find the score
65
+ * @returns
66
+ */
67
+ loadRemoteJson(url: string): Promise<any>;
68
+ /**
69
+ * Load a remote score, return promise when it's been loaded
70
+ * from afar.
71
+ * @param pref
72
+ * @returns
73
+ */
74
+ loadRemoteScore(url: string): Promise<any>;
75
+ updateAudioSettings(pref: SmoAudioPlayerSettings): Promise<void>;
76
+ /**
77
+ * Global settings that control how the score editor behaves
78
+ * @param pref
79
+ * @returns
80
+ */
81
+ updateScorePreferences(pref: SmoScorePreferences): Promise<void>;
82
+ /**
83
+ * Update information about the score, composer etc.
84
+ * @param scoreInfo
85
+ * @returns
86
+ */
87
+ updateScoreInfo(scoreInfo: SmoScoreInfo): Promise<void>;
88
+ addRemoveArpeggio(code: SmoArpeggioType): Promise<void>;
89
+ /**
90
+ * A clef change mid-measure (clefNote)
91
+ * @param clef
92
+ */
93
+ addRemoveClefChange(clef: SmoClefChange): Promise<void>;
94
+ /**
95
+ * Modify the dynamics assoicated with the specific selection
96
+ * @param selection
97
+ * @param dynamic
98
+ * @returns
99
+ */
100
+ addDynamic(selection: SmoSelection, dynamic: SmoDynamicText): Promise<void>;
101
+ /**
102
+ * Remove dynamics from the current selection
103
+ * @param dynamic
104
+ * @returns
105
+ */
106
+ removeDynamic(dynamic: SmoDynamicText): Promise<void>;
107
+ /**
108
+ * we never really delete a note, but we will convert it into a rest and if it's
109
+ * already a rest we will try to hide it.
110
+ * Operates on current selections
111
+ * */
112
+ deleteNote(): Promise<void>;
113
+ /**
114
+ * The lyric editor moves around, so we can't depend on the tracker for the
115
+ * correct selection. We get it directly from the editor.
116
+ *
117
+ * @param selector - the selector of the note with the lyric to remove
118
+ * @param lyric - a copy of the lyric to remove. We use the verse, parser to identify it
119
+ * @returns render promise
120
+ */
121
+ removeLyric(selector: SmoSelector, lyric: SmoLyric): Promise<void>;
122
+ /**
123
+ * @param selector where to add or update the lyric
124
+ * @param lyric a copy of the lyric to remove
125
+ * @returns
126
+ */
127
+ addOrUpdateLyric(selector: SmoSelector, lyric: SmoLyric): Promise<void>;
128
+ /**
129
+ * @param selector the selector of the note with the annotation to remove
130
+ * @param annotation a copy of the annotation to remove. We use the verse, parser to identify it
131
+ * @returns render promise
132
+ */
133
+ removeAnnotation(selector: SmoSelector, annotation: SmoLyric): Promise<void>;
134
+ /**
135
+ * @param selector where to add or update the annotation
136
+ * @param annotation a copy of the annotation to add/update
137
+ * @returns
138
+ */
139
+ addOrUpdateAnnotation(selector: SmoSelector, annotation: SmoLyric): Promise<void>;
140
+ /**
141
+ * Delete all the notes for the currently selected voice
142
+ * @returns
143
+ */
144
+ depopulateVoice(): Promise<void>;
145
+ /**
146
+ * Change the active voice in a multi-voice measure.
147
+ * @param index
148
+ * @returns
149
+ */
150
+ _changeActiveVoice(index: number): SmoSelection[];
151
+ /**
152
+ * Populate a new voice with default notes
153
+ * @param index the voice to populate
154
+ * @returns
155
+ */
156
+ populateVoice(index: number): Promise<void>;
157
+ swapVoices(voice1: number, voice2: number): Promise<void>;
158
+ /**
159
+ * Assign an instrument to a set of measures
160
+ * @param instrument the instrument to assign to the selections
161
+ * @param selections
162
+ * @returns
163
+ */
164
+ changeInstrument(instrument: SmoInstrument, selections: SmoSelection[]): Promise<void>;
165
+ /**
166
+ * Set the time signature for a selection
167
+ * @param timeSignature actual time signature
168
+ */
169
+ setTimeSignature(timeSignature: SmoTimeSignature): Promise<void>;
170
+ /**
171
+ * Move selected staff up or down in the score.
172
+ * @param index direction to move
173
+ * @returns
174
+ */
175
+ moveStaffUpDown(index: number): Promise<void>;
176
+ /**
177
+ * Update the staff group for a score, which determines how the staves
178
+ * are justified and bracketed
179
+ * @param staffGroup
180
+ */
181
+ addOrUpdateStaffGroup(staffGroup: SmoSystemGroup): Promise<void>;
182
+ removeStaffGroup(staffGroup: SmoSystemGroup): Promise<void>;
183
+ clearSystemGroups(): Promise<void>;
184
+ updateTabStave(tabStave: SmoTabStave): Promise<void>;
185
+ removeTabStave(): Promise<void>;
186
+ /**
187
+ * Update tempo for all or part of the score
188
+ * @param measure the measure with the tempo. Tempo is measure-wide parameter
189
+ * @param scoreMode if true, update whole score. Else selections
190
+ * @returns
191
+ */
192
+ updateTempoScore(measure: SmoMeasure, tempo: SmoTempo, scoreMode: boolean, selectionMode: boolean): Promise<void>;
193
+ updateTabNote(tabNote: SmoTabNote): Promise<void>;
194
+ removeTabNote(): Promise<void>;
195
+ /**
196
+ * 'remove' tempo, which means either setting the bars to the
197
+ * default tempo, or the previously-set tempo.
198
+ * @param scoreMode whether to reset entire score
199
+ */
200
+ removeTempo(measure: SmoMeasure, tempo: SmoTempo, scoreMode: boolean, selectionMode: boolean): Promise<void>;
201
+ /**
202
+ * Add a grace note to the selected real notes.
203
+ */
204
+ addGraceNote(): Promise<void>;
205
+ /**
206
+ * remove selected grace note
207
+ * @returns
208
+ */
209
+ removeGraceNote(): Promise<void>;
210
+ /**
211
+ * Toggle slash in stem of grace note
212
+ */
213
+ slashGraceNotes(): Promise<void>;
214
+ transposeScore(offset: number): Promise<void>;
215
+ /**
216
+ * transpose selected notes
217
+ * @param offset 1/2 steps
218
+ * @returns
219
+ */
220
+ transposeSelections(offset: number): Promise<void>;
221
+ /**
222
+ * toggle the accidental spelling of the selected notes
223
+ * @returns
224
+ */
225
+ toggleEnharmonic(): Promise<void>;
226
+ /**
227
+ * Toggle cautionary/courtesy accidentals
228
+ */
229
+ toggleCourtesyAccidentals(): Promise<void>;
230
+ /**
231
+ * change the duration of notes for selected, creating more
232
+ * or fewer notes.
233
+ * After the change, reset the selection so it's as close as possible
234
+ * to the original length
235
+ * @param operation
236
+ * @returns
237
+ */
238
+ batchDurationOperation(operation: BatchSelectionOperation): Promise<void>;
239
+ /**
240
+ * Toggle selected modifier on selected notes
241
+ * @param modifier
242
+ * @param ctor parent class constructor (e.g. SmoOrnament)
243
+ * @returns
244
+ */
245
+ toggleArticulation(modifier: string, ctor: string): Promise<void>;
246
+ setArticulation(modifier: SmoArticulation, set: boolean): Promise<void>;
247
+ setOrnament(modifier: SmoOrnament, set: boolean): Promise<void>;
248
+ /**
249
+ * convert non-tuplet not to a tuplet
250
+ * @param params
251
+ */
252
+ makeTuplet(params: MakeTupletOperation): Promise<void>;
253
+ /**
254
+ * Convert selected tuplet to a single (if possible) non-tuplet
255
+ */
256
+ unmakeTuplet(): Promise<void>;
257
+ /**
258
+ * Create a chord by adding an interval to selected note
259
+ * @param interval 1/2 steps
260
+ * @returns
261
+ */
262
+ setInterval(interval: number): Promise<void>;
263
+ /**
264
+ * change the selected chord into a single note
265
+ * @returns
266
+ */
267
+ collapseChord(): Promise<void>;
268
+ /**
269
+ * Toggle chicken-scratches, for jazz improv, comping etc.
270
+ */
271
+ toggleSlash(): Promise<void>;
272
+ /**
273
+ * make selected notes into a rest, or visa-versa
274
+ * @returns
275
+ */
276
+ makeRest(): Promise<void>;
277
+ clearAllBeams(): Promise<void>;
278
+ /**
279
+ * Set the beam grouping of measures, for compound or irregular meters such as 3 + 2 in 5/8.
280
+ * An empty grouping goes back to the default for the meter. This replaces any hand-placed beams
281
+ * in those measures.
282
+ * @param groups the longest beam group for each group in turn, whole numbers from 1 to 4
283
+ * @param scope the measures of the selected notes, or every measure in the score
284
+ */
285
+ setBeamGroups(groups: number[], scope: 'selections' | 'all'): Promise<void>;
286
+ /**
287
+ * Fill the selected measures with rests. This removes all the notes and voices in them, and anything
288
+ * attached to those notes, such as slurs and text. It is one undo step.
289
+ * @param fill which rests: the largest that fit, a rest for each beat, or eighth rests
290
+ */
291
+ fillMeasures(fill: MeasureFillType): Promise<void>;
292
+ clearSelectedBeams(): Promise<void>;
293
+ /**
294
+ * toggle the 'end beam' flag for selected notes
295
+ * @returns
296
+ */
297
+ unbeamSelections(): Promise<void>;
298
+ /**
299
+ * Put the selected notes back to automatic beaming, removing any hand-placed beam breaks and joins
300
+ */
301
+ autoBeamSelections(): Promise<void>;
302
+ /**
303
+ * Set the stem direction of the selected notes
304
+ * @param flagState one of SmoNote.flagStates: auto, up or down
305
+ */
306
+ setStemDirection(flagState: number): Promise<void>;
307
+ toggleCue(): Promise<void>;
308
+ /**
309
+ * up or down
310
+ * @returns
311
+ */
312
+ toggleBeamDirection(): Promise<void>;
313
+ /**
314
+ * Add the selected notes to a beam group
315
+ */
316
+ beamSelections(): Promise<void>;
317
+ /**
318
+ * change key signature for selected measures
319
+ * @param keySignature vex key signature
320
+ */
321
+ addKeySignature(keySignature: string): Promise<void>;
322
+ /**
323
+ * Sets a pitch from the piano widget.
324
+ * @param pitch {Pitch}
325
+ * @param chordPedal {boolean} - indicates we are adding to a chord
326
+ */
327
+ setPitchPiano(pitch: Pitch, chordPedal: boolean): Promise<void>;
328
+ /**
329
+ * show or hide the piano widget
330
+ * @param value to show it
331
+ */
332
+ showPiano(value: boolean): Promise<void>;
333
+ /**
334
+ * Render a pitch for each letter name-pitch in the string,
335
+ * @param pitches letter names for pitches
336
+ * @returns promise, resolved when all pitches rendered
337
+ * @see setPitch
338
+ */
339
+ setPitchesPromise(pitches: PitchLetter[]): Promise<any>;
340
+ setPitches(pitches: Pitch[]): Promise<void>;
341
+ /**
342
+ * Add a pitch to the score at the cursor. This tries to find the best pitch
343
+ * to match the letter key (F vs F# for instance) based on key and surrounding notes
344
+ * @param letter string
345
+ */
346
+ setPitch(letter: PitchLetter): Promise<void>;
347
+ /**
348
+ * Generic clipboard copy action
349
+ */
350
+ copy(): Promise<void>;
351
+ /**
352
+ * The voices that Select Voice can offer for the current selection: empty unless some selected
353
+ * measure has more than one voice.
354
+ */
355
+ getSelectVoiceChoices(): number[];
356
+ /**
357
+ * Select all the notes of a voice in the measures that currently have a selection. Only the
358
+ * selection changes: no edit is made and no undo is recorded.
359
+ * @param voice the voice to select (0-3)
360
+ */
361
+ selectVoice(voice: number): Promise<void>;
362
+ /**
363
+ * The most voices any of the selected measures has, for the Copy Voices menu
364
+ */
365
+ getSelectionVoiceCount(): number;
366
+ /**
367
+ * Where a voice paste would go, in the full score: the selected staff and measure, and the
368
+ * measures from there that the copied voices cover (adding up measure lengths until the copy fits,
369
+ * but not past the last measure). Null if nothing is selected or no voices are copied.
370
+ */
371
+ private _getVoicePasteRange;
372
+ /**
373
+ * The number of voices at the paste destination, for the Paste Voice menu: the most voices in
374
+ * any measure the paste would cover, on the staves it would cover. A voice number at or above
375
+ * this count is empty everywhere in the destination.
376
+ */
377
+ getDestinationVoiceCount(): number;
378
+ /**
379
+ * Copy a voice, or all the voices, of the selected measures. The copy always covers whole
380
+ * measures, from the start of the first selected measure to the end of the last.
381
+ * @param voice the voice to copy (0-3), or 'all'
382
+ */
383
+ copyVoices(voice: number | 'all'): Promise<void>;
384
+ /**
385
+ * Paste the voices copied with copyVoices, starting at the beginning of the first selected
386
+ * measure. A voice that doesn't exist in a measure is created there first.
387
+ * @param voice the voice to paste into (0-3) for a single copied voice; 'new' to paste a single
388
+ * copied voice into a new voice after the existing ones; or 'all' to paste every copied voice
389
+ * into the voice with the same number
390
+ */
391
+ pasteVoices(voice: number | 'all' | 'new'): Promise<void>;
392
+ /**
393
+ * clipboard paste action
394
+ * @returns
395
+ */
396
+ paste(): Promise<void>;
397
+ /**
398
+ * @returns true if notes have been copied, so there is something to paste
399
+ */
400
+ hasCopiedNotes(): boolean;
401
+ /**
402
+ * Paste only some kinds of marking (dynamics, lyrics, annotations, chords, articulations, ornaments)
403
+ * from the copied notes onto the notes at the current selection. The notes themselves are not changed.
404
+ * @param options the kinds to paste, and whether they replace or are added to the destination's markings
405
+ */
406
+ pasteAttributes(options: PasteAttributeOptions): Promise<void>;
407
+ /**
408
+ * Remove the chosen kinds of marking (dynamics, lyrics, annotations, chords, articulations, ornaments,
409
+ * grace notes, arpeggios, microtones) from the selected notes. The notes themselves are not changed.
410
+ * It is one undo step. Nothing happens, and no undo step is made, if no kind is chosen or the selected
411
+ * notes have none of them.
412
+ * @param kinds the kinds of marking to remove
413
+ */
414
+ deleteNoteAttributes(kinds: DeleteAttributeKind[]): Promise<void>;
415
+ /**
416
+ * specify a note head other than the default for the duration
417
+ * @param head
418
+ */
419
+ setNoteHead(head: string): Promise<void>;
420
+ /**
421
+ * Add a volta for selected measures
422
+ */
423
+ addEnding(): Promise<void>;
424
+ /**
425
+ * @param ending volta settings
426
+ * @returns
427
+ */
428
+ updateEnding(ending: SmoVolta): Promise<void>;
429
+ /**
430
+ *
431
+ * @param ending volta to remove
432
+ * @returns
433
+ */
434
+ removeEnding(ending: SmoVolta): Promise<void>;
435
+ /**
436
+ *
437
+ * @param position begin or end
438
+ * @param barline barline type
439
+ * @returns
440
+ */
441
+ setBarline(position: number, barline: number, bracket: number): Promise<void>;
442
+ /**
443
+ *
444
+ * @param position start or end
445
+ * @param symbol coda, etc.
446
+ */
447
+ setRepeatSymbol(position: number, symbol: number): Promise<void>;
448
+ /**
449
+ * toggle rehearsal mark on first selected measure
450
+ * @returns
451
+ */
452
+ toggleRehearsalMark(): Promise<void>;
453
+ /**
454
+ * Finds the measure whose rehearsal mark has the given id, as a selection on the live score.
455
+ * Rehearsal marks are column-wide, so the first staff holding it identifies the measure.
456
+ * See specs/025-rehearsal-mark-dialog.
457
+ */
458
+ _findRehearsalMarkSelection(id: string): SmoSelection | null;
459
+ /**
460
+ * Replaces an existing rehearsal mark's settings on its measure, on every staff and in the
461
+ * undo-copy store. Does nothing if the mark is no longer present (e.g. removed while its dialog
462
+ * was open). See specs/025-rehearsal-mark-dialog.
463
+ * @param mark the edited rehearsal mark
464
+ */
465
+ updateRehearsalMark(mark: SmoRehearsalMark): Promise<void>;
466
+ /**
467
+ * Removes an existing rehearsal mark from its measure on every staff and in the undo-copy store.
468
+ * Does nothing if the mark is no longer present. See specs/025-rehearsal-mark-dialog.
469
+ * @param mark the rehearsal mark to remove
470
+ */
471
+ removeRehearsalMark(mark: SmoRehearsalMark): Promise<void>;
472
+ _removeStaffModifier(modifier: StaffModifierBase): void;
473
+ /**
474
+ * Remove selected modifier
475
+ * @param modifier slur, hairpin, etc.
476
+ * @returns
477
+ */
478
+ removeStaffModifier(modifier: StaffModifierBase): Promise<void>;
479
+ /**
480
+ * Change a staff modifier
481
+ * @param original original version
482
+ * @param modifier modified version
483
+ * @returns
484
+ */
485
+ addOrUpdateStaffModifier(original: StaffModifierBase, modifier: StaffModifierBase): Promise<void>;
486
+ lineOperation(op: createStaffModifierType<StaffModifierBase>): void;
487
+ /**
488
+ * Add crescendo to selection
489
+ */
490
+ crescendo(): Promise<void>;
491
+ /**
492
+ * Add crescendo to selection
493
+ */
494
+ crescendoBracket(): Promise<void>;
495
+ /**
496
+ * Add crescendo to selection
497
+ */
498
+ dimenuendo(): Promise<void>;
499
+ /**
500
+ * Add crescendo to selection
501
+ */
502
+ accelerando(): Promise<void>;
503
+ /**
504
+ * Add crescendo to selection
505
+ */
506
+ ritard(): Promise<void>;
507
+ /**
508
+ * diminuendo hairpin
509
+ * @returns
510
+ */
511
+ decrescendo(): Promise<void>;
512
+ removeTextBracket(bracket: SmoStaffTextBracket): Promise<void>;
513
+ addOrReplaceStaffModifier(callback: updateStaffModifierFunc, modifier: StaffModifierBase): Promise<void>;
514
+ addOrReplaceTextBracket(modifier: SmoStaffTextBracket): Promise<void>;
515
+ /**
516
+ * Slur selected notes
517
+ * @returns
518
+ */
519
+ addSlur(): Promise<void>;
520
+ /**
521
+ * tie selected notes
522
+ * @returns
523
+ */
524
+ tie(): Promise<void>;
525
+ updateZoom(zoomFactor: number): Promise<void>;
526
+ /**
527
+ * Keep text groups in the same visual position when a layout changes: rescale by the
528
+ * svg scale ratio, and by the page width/height ratios. Groups are de-duplicated by
529
+ * identity, since a part's staves (and the view and store copies, after a part update)
530
+ * can share the same text group objects, and scaling one twice would double-apply it.
531
+ * @param textGroups groups to adjust
532
+ * @param previousLayout layout before the change
533
+ * @param layout layout after the change
534
+ */
535
+ static repositionTextGroups(textGroups: SmoTextGroup[], previousLayout: SmoGlobalLayout, layout: SmoGlobalLayout): void;
536
+ /**
537
+ * set global page for score, zoom etc.
538
+ * @param layout global SVG settings
539
+ * @param previousLayout the layout as it was immediately before this change. Callers must
540
+ * pass a snapshot taken before `layout` was mutated -- `this.score.layoutManager`'s current
541
+ * value cannot be used for this, because dialogs (e.g. globalLayout.ts) bind directly to that
542
+ * live object, so by the time this method runs it may already equal `layout`.
543
+ * @returns
544
+ */
545
+ setGlobalLayout(layout: SmoGlobalLayout, previousLayout: SmoGlobalLayout): Promise<void>;
546
+ /**
547
+ * Set the layout of a single page
548
+ * @param layout page layout
549
+ * @param pageIndex which page to change
550
+ * @returns
551
+ */
552
+ setPageLayout(layout: SmoPageLayout, pageIndex: number): Promise<void>;
553
+ setPageLayouts(layout: SmoPageLayout, startIndex: number, endIndex: number): Promise<void>;
554
+ /**
555
+ * Update the music font
556
+ * @param family
557
+ * @returns
558
+ */
559
+ setEngravingFontFamily(family: engravingFontType): Promise<void>;
560
+ /**
561
+ * Upate global font used for chord changes
562
+ * @param fontInfo
563
+ * @returns
564
+ */
565
+ setChordFont(fontInfo: FontInfo): Promise<void>;
566
+ /**
567
+ * Update font used for lyrics
568
+ * @param fontInfo
569
+ * @returns
570
+ */
571
+ setLyricFont(fontInfo: FontInfo): Promise<void>;
572
+ /**
573
+ * @param value if false, lyric widths don't affect measure width
574
+ * @returns
575
+ */
576
+ setLyricAdjustWidth(value: boolean): Promise<void>;
577
+ /**
578
+ * delete selected measures
579
+ * @returns
580
+ */
581
+ deleteMeasure(): Promise<void>;
582
+ /**
583
+ * add number of measures, with default notes selections
584
+ * @param append
585
+ * @param numberToAdd
586
+ * @returns
587
+ */
588
+ addMeasures(append: boolean, numberToAdd: number): Promise<void>;
589
+ /**
590
+ * add a single measure before or after selection
591
+ * @param append
592
+ * @returns
593
+ */
594
+ addMeasure(append: boolean): Promise<void>;
595
+ /**
596
+ * remove an entire line of music
597
+ * @returns
598
+ */
599
+ removeStaff(): Promise<void>;
600
+ /**
601
+ * Add a new staff to an existing score, with default instrument for the staff part.
602
+ * We base the staff parameters on a stave that currently exists in the score.
603
+ * @param instrument
604
+ * @returns
605
+ */
606
+ addStaff(instrument: SmoSystemStaffParams): Promise<void>;
607
+ /**
608
+ * Create a part, with one or two staves, at the requested place in the score. It is one undo step.
609
+ * See {@link SmoOperation.addPart}.
610
+ * @param params where the part goes, its instrument, name and abbreviation
611
+ */
612
+ createPart(params: AddPartParams): Promise<void>;
613
+ /**
614
+ * Update part info assumes that the part is currently exposed - that
615
+ * staff 0 is the first staff in the part prior to editing.
616
+ * @param info
617
+ */
618
+ updatePartInfo(info: SmoPartInfo): Promise<void>;
619
+ /**
620
+ * A simpler API for applications to add a new staff to the score.
621
+ * @param params - the instrument, which determines clef, etc.
622
+ * @returns
623
+ */
624
+ addStaffSimple(params: Partial<SmoInstrumentParams>): Promise<void>;
625
+ /**
626
+ * The autosaved snapshots, newest first, for the Recovery dialog.
627
+ * @returns each snapshot, with `available` false if its stored text is missing or damaged
628
+ */
629
+ listSnapshots(): (AutosaveEntry & {
630
+ available: boolean;
631
+ })[];
632
+ /**
633
+ * Replace the open score with an autosaved snapshot. The snapshot is kept, and the recovered
634
+ * score counts as having unsaved changes. The caller asks about unsaved changes in the open
635
+ * score first.
636
+ * @param id the snapshot's id, from listSnapshots
637
+ * @throws Error with a message for the user; the open score is left as it was
638
+ */
639
+ recoverSnapshot(id: number): Promise<void>;
640
+ /**
641
+ * Save the score to local storage.
642
+ */
643
+ quickSave(): void;
644
+ /**
645
+ * Called when the user has saved the score to a file. Only a save in the full Smoosic
646
+ * format counts: other formats (MusicXML, MIDI...) lose information, so the score still
647
+ * has unsaved changes. The save dialog doesn't know which formats are lossy; we do.
648
+ * @param extension the extension of the file that was saved, e.g. '.json'
649
+ * @returns true if the score is now considered saved
650
+ */
651
+ recordSave(extension: string): boolean;
652
+ updateRepeatCount(count: number): Promise<any>;
653
+ /**
654
+ * Update the measure formatting parameters for the current selection
655
+ * @param format generic measure formatting parameters
656
+ * @returns
657
+ */
658
+ setMeasureFormat(format: SmoMeasureFormat): Promise<any>;
659
+ /**
660
+ * Remove system breaks from the measure formatting for selected measures
661
+ * @returns
662
+ */
663
+ removeSystemBreaks(): Promise<any>;
664
+ renumberMeasures(measureIndex: number, displayIndex: number): Promise<void>;
665
+ /**
666
+ * Play the music from the starting selection
667
+ * @returns
668
+ */
669
+ playFromSelection(): Promise<void>;
670
+ stopPlayer(): void;
671
+ pausePlayer(): void;
672
+ /**
673
+ * Proxy calls to move the tracker parameters according to the
674
+ * rules of the 'Home' key (depending on shift/ctrl/alt)
675
+ * @param ev
676
+ * @returns
677
+ */
678
+ moveHome(ev: KeyEvent): Promise<any>;
679
+ /**
680
+ * Proxy calls to move the tracker parameters according to the
681
+ * rules of the 'End' key (depending on shift/ctrl/alt)
682
+ * @param ev
683
+ * @returns
684
+ */
685
+ moveEnd(ev: KeyEvent): Promise<any>;
686
+ /**
687
+ * Grow the current selection by one to the left, if possible
688
+ * @param ev
689
+ * @returns
690
+ */
691
+ growSelectionLeft(): Promise<any>;
692
+ /**
693
+ * Grow the current selection by one to the right, if possible
694
+ * @param ev
695
+ * @returns
696
+ */
697
+ growSelectionRight(): Promise<any>;
698
+ /**
699
+ * Select the next tabbable modifier near one of the selected notes
700
+ * @param keyEv
701
+ * @returns
702
+ */
703
+ advanceModifierSelection(keyEv: KeyEvent): Promise<any>;
704
+ /**
705
+ * Select the next entire measure, if possible
706
+ * @returns
707
+ */
708
+ growSelectionRightMeasure(): Promise<any>;
709
+ /**
710
+ * Advance cursor forwards, if possible
711
+ * @param ev
712
+ * @returns
713
+ */
714
+ moveSelectionRight(): Promise<any>;
715
+ /**
716
+ * Advance cursor backwards, if possible
717
+ * @param ev
718
+ * @returns
719
+ */
720
+ moveSelectionLeft(): Promise<any>;
721
+ /**
722
+ * Advance cursor back entire measure, if possible
723
+ * @returns
724
+ */
725
+ moveSelectionLeftMeasure(): Promise<any>;
726
+ /**
727
+ * Advance cursor forward one measure, if possible
728
+ * @returns
729
+ */
730
+ moveSelectionRightMeasure(): Promise<any>;
731
+ /**
732
+ * Move cursor to a higher pitch in the current chord, with wrap
733
+ * @returns
734
+ */
735
+ moveSelectionPitchUp(): Promise<any>;
736
+ /**
737
+ * Move cursor to a lower pitch in the current chord, with wrap
738
+ */
739
+ moveSelectionPitchDown(): Promise<any>;
740
+ /**
741
+ * Move cursor up a staff in the system, if possible
742
+ * @returns
743
+ */
744
+ moveSelectionUp(): Promise<any>;
745
+ /**
746
+ * Move cursor down a staff in the system, if possible
747
+ * @returns
748
+ */
749
+ moveSelectionDown(): Promise<any>;
750
+ /**
751
+ * Set the current suggestions (hover element) as the selection
752
+ * @returns
753
+ */
754
+ selectSuggestion(evData: KeyEvent): Promise<any>;
755
+ /**
756
+ * Find an element at the given box, and make it the current selection
757
+ * */
758
+ intersectingArtifact(evData: SvgBox): Promise<any>;
759
+ }