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,433 +1,433 @@
1
- import { SmoMeasureFormat, SmoMeasureFormatParamsSer } from './measureModifiers';
2
- import { SmoAttrs, SmoModifierBase, SvgBox } from './common';
3
- import { SmoMeasure } from './measure';
4
- import { SmoSelector } from '../xform/selections';
5
- /**
6
- * Base class for all {@link SmoScore} modifiers.
7
- * It is used to de/serialize the objects.
8
- * @category SmoObject
9
- */
10
- export declare abstract class SmoScoreModifierBase implements SmoModifierBase {
11
- /**
12
- * constructor
13
- *
14
- * @type {string}
15
- * @memberof SmoScoreModifierBase
16
- */
17
- ctor: string;
18
- /**
19
- * When rendered, keep track of the box
20
- *
21
- * @type {(SvgBox | null)}
22
- * @memberof SmoScoreModifierBase
23
- */
24
- logicalBox: SvgBox | null;
25
- /**
26
- * attributes for identification
27
- *
28
- * @type {SmoAttrs}
29
- * @memberof SmoScoreModifierBase
30
- */
31
- attrs: SmoAttrs;
32
- constructor(ctor: string);
33
- abstract serialize(): any;
34
- static deserialize(jsonObj: any): any;
35
- }
36
- /**
37
- * For global/default font settings.
38
- * @category SmoObject
39
- * @param name to distinguish: chord, lyric etc.
40
- * @param family font family
41
- * @param size in points
42
- * @param custom used to distinguish a specific text is not the default
43
- */
44
- export interface FontPurpose {
45
- /**
46
- * name of the purpose
47
- * { ENGRAVING: 1, SCORE: 2, CHORDS: 3, LYRICS: 4 }
48
- */
49
- name: string;
50
- /**
51
- * purpose enumeration
52
- */
53
- purpose: number;
54
- /**
55
- * font family
56
- */
57
- family: string;
58
- /**
59
- * default font size
60
- */
61
- size: number;
62
- /**
63
- * a flag that can be used to indicate if this is the global default, or a customization.
64
- * For lyrics for instance, most lyrics would use the custom font, this would be true if
65
- * it was overridden
66
- */
67
- custom: boolean;
68
- }
69
- export type SmoScoreInfoKey = 'name' | 'title' | 'subTitle' | 'composer' | 'copyright';
70
- export declare const SmoScoreInfoKeys: string[];
71
- /**
72
- * Information about the score itself, like composer etc.
73
- * @category SmoObject
74
- */
75
- export interface SmoScoreInfo {
76
- /**
77
- * deprecated, now defaults to title
78
- */
79
- name: string;
80
- /**
81
- * name of score
82
- */
83
- title: string;
84
- /**
85
- * subtitle/opus
86
- */
87
- subTitle: string;
88
- /**
89
- * who wrote it
90
- */
91
- composer: string;
92
- /**
93
- * copyright information
94
- */
95
- copyright: string;
96
- /**
97
- * for version tracking
98
- */
99
- version: number;
100
- }
101
- export type SmoScorePreferenceBool = 'autoPlay' | 'autoAdvance' | 'showPiano' | 'hideEmptyLines' | 'transposingScore' | 'autoScrollPlayback' | 'showPartNames';
102
- export type SmoScorePreferenceNumber = 'defaultDupleDuration' | 'defaultTripleDuration';
103
- export declare const SmoScorePreferenceBools: SmoScorePreferenceBool[];
104
- export declare const SmoScorePreferenceNumbers: SmoScorePreferenceNumber[];
105
- /**
106
- * Global score/program behavior preferences, see below for parameters
107
- * @category SmoObject
108
- */
109
- export interface SmoScorePreferencesParams {
110
- autoPlay: boolean;
111
- autoAdvance: boolean;
112
- autoScrollPlayback: boolean;
113
- defaultDupleDuration: number;
114
- defaultTripleDuration: number;
115
- showPiano: boolean;
116
- hideEmptyLines: boolean;
117
- transposingScore: boolean;
118
- showPartNames: boolean;
119
- }
120
- /**
121
- * Some default SMO behavior
122
- * @param autoPlay play a new note or chord
123
- * @param autoAdvance Sibelius-like behavior of advancing cursor when a letter note is placed
124
- * @param defaultDupleDuration in ticks, even metered measures
125
- * @param defaultTripleDuration in ticks, 6/8 etc.
126
- * @param showPiano show the piano widget in the score
127
- * @param hideEmptyLines Hide empty lines in full score
128
- * @param transposingScore Whether to show the score parts in concert key
129
- * @category SmoObject
130
- */
131
- export declare class SmoScorePreferences {
132
- autoPlay: boolean;
133
- autoAdvance: boolean;
134
- defaultDupleDuration: number;
135
- defaultTripleDuration: number;
136
- showPiano: boolean;
137
- hideEmptyLines: boolean;
138
- autoScrollPlayback: boolean;
139
- transposingScore: boolean;
140
- showPartNames: boolean;
141
- static get defaults(): SmoScorePreferencesParams;
142
- constructor(params: SmoScorePreferencesParams);
143
- serialize(): SmoScorePreferencesParams;
144
- }
145
- /**
146
- * non-musical information about the score
147
- * @category serialization
148
- */
149
- export interface ScoreMetadataSer {
150
- fonts: FontPurpose[];
151
- preferences: SmoScorePreferencesParams;
152
- renumberingMap: Record<string, string>;
153
- scoreInfo: SmoScoreInfo;
154
- }
155
- /**
156
- * Map of measure formatting to measure IDs. We only save non-default formats
157
- * @category SmoObject
158
- * @param measureFormats
159
- * @param partIndex
160
- */
161
- export interface SmoFormattingManagerParams {
162
- /**
163
- * map of index to {@link SmoMeasureFormat} objects
164
- */
165
- measureFormats?: SmoMeasureFormat[];
166
- /**
167
- * the associated part, or -1 for the score
168
- */
169
- partIndex?: number;
170
- }
171
- /**
172
- * A score can have different views - one for the score itself and one for each
173
- * part, and each part can have its own formatting and text.
174
- * *Note*: I may move this to part info module.
175
- * @param measureFormats map of index to {@link SmoMeasureFormat} objects
176
- * @param partIndex the associated part, or -1 for the score
177
- * @category SmoObject
178
- */
179
- export declare class SmoFormattingManager extends SmoScoreModifierBase {
180
- measureFormats: Record<number, SmoMeasureFormat>;
181
- partIndex: number;
182
- static get forScore(): number;
183
- static get defaults(): SmoFormattingManagerParams;
184
- constructor(params: SmoFormattingManagerParams);
185
- /**
186
- * Update the measure format for the measure at the given index
187
- * @param format
188
- */
189
- updateMeasureFormat(format: SmoMeasureFormat): void;
190
- /**
191
- * Update the measure format based on the format of a given measure
192
- * @param measure
193
- */
194
- updateFormat(measure: SmoMeasure): void;
195
- serialize(): SmoMeasureFormatParamsSer[];
196
- }
197
- export type SmoAudioPlayerType = 'sampler' | 'synthesizer';
198
- /**
199
- * Constructor parameters for audio player
200
- * @category SmoObject
201
- */
202
- export interface SmoAudioPlayerParameters {
203
- playerType?: SmoAudioPlayerType;
204
- waveform?: OscillatorType;
205
- reverbEnable?: boolean;
206
- reverbDelay?: number;
207
- reverbDecay?: number;
208
- }
209
- /**
210
- * web audio API defines this
211
- * @param otype
212
- * @returns
213
- */
214
- export declare function IsOscillatorType(otype: OscillatorType | string): otype is OscillatorType;
215
- /**
216
- * Audio playback parameters. Just fun stuff.
217
- * @category SmoObject
218
- */
219
- export declare class SmoAudioPlayerSettings extends SmoScoreModifierBase {
220
- static get defaults(): SmoAudioPlayerParameters;
221
- static get attributes(): string[];
222
- playerType: SmoAudioPlayerType;
223
- waveform: OscillatorType;
224
- reverbEnable: boolean;
225
- reverbDelay: number;
226
- reverbDecay: number;
227
- constructor(params: SmoAudioPlayerParameters);
228
- serialize(): any;
229
- }
230
- export type ScaledPageAttributes = 'leftMargin' | 'rightMargin' | 'topMargin' | 'bottomMargin' | 'interGap' | 'intraGap';
231
- /**
232
- * Constructor parameters for {@link SmoPageLayout}, part of {@link SmoLayoutManager}
233
- * @category SmoObject
234
- */
235
- export interface SmoPageLayoutParams {
236
- leftMargin: number;
237
- rightMargin: number;
238
- topMargin: number;
239
- bottomMargin: number;
240
- interGap: number;
241
- intraGap: number;
242
- }
243
- /**
244
- * Define margins and other layout information associated with a specific page, and may
245
- * be different on different pages.
246
- * @category SmoObject
247
- */
248
- export declare class SmoPageLayout extends SmoScoreModifierBase {
249
- static get defaults(): SmoPageLayoutParams;
250
- static get attributes(): ScaledPageAttributes[];
251
- leftMargin: number;
252
- rightMargin: number;
253
- topMargin: number;
254
- bottomMargin: number;
255
- interGap: number;
256
- intraGap: number;
257
- constructor(params: SmoPageLayoutParams);
258
- serialize(): any;
259
- }
260
- export type ScaledGlobalAttributes = 'pageWidth' | 'pageHeight';
261
- export type GlobalLayoutAttributes = 'pageWidth' | 'pageHeight' | 'noteSpacing' | 'svgScale' | 'zoomScale' | 'proportionality' | 'maxMeasureSystem';
262
- export declare const GlobalLayoutAttributesArray: GlobalLayoutAttributes[];
263
- /**
264
- * Global layout are parameters that determine the layout of the whole score, because they affect the containing svg element
265
- * @category SmoObject
266
- */
267
- export interface SmoGlobalLayout {
268
- svgScale: number;
269
- zoomScale: number;
270
- noteSpacing: number;
271
- pageWidth: number;
272
- pageHeight: number;
273
- proportionality: number;
274
- maxMeasureSystem: number;
275
- }
276
- /**
277
- * Used to create {@link SmoLayoutManagerParams}
278
- * @category SmoObject
279
- */
280
- export interface ScaledPageLayout {
281
- svgScale: number;
282
- zoomScale: number;
283
- noteSpacing: number;
284
- pageWidth: number;
285
- pageHeight: number;
286
- leftMargin: number;
287
- rightMargin: number;
288
- topMargin: number;
289
- bottomMargin: number;
290
- interGap: number;
291
- intraGap: number;
292
- pages: number;
293
- maxMeasureSystem: number;
294
- }
295
- /**
296
- * Constructor parameters for {@link SmoLayoutManager}
297
- * @category SmoObject
298
- */
299
- export interface SmoLayoutManagerParams {
300
- /**
301
- * global svg settings for zoom, page width/height
302
- */
303
- globalLayout: SmoGlobalLayout;
304
- /**
305
- * page margins for each page
306
- */
307
- pageLayouts: SmoPageLayout[];
308
- }
309
- /**
310
- * @category serialization
311
- */
312
- export interface SmoLayoutManagerParamsSer {
313
- /**
314
- * constructor
315
- */
316
- ctor: string;
317
- /**
318
- * global svg settings for zoom, page width/height
319
- */
320
- globalLayout: SmoGlobalLayout;
321
- /**
322
- * page margins for each page
323
- */
324
- pageLayouts: SmoPageLayoutParams[];
325
- }
326
- /**
327
- * Storage and utilities for layout information in the score. Each
328
- * manager has one set of page height/width, since svg element
329
- * must have single length/width and viewbox.
330
- * Each page can have different margins.
331
- * @category SmoObject
332
- */
333
- export declare class SmoLayoutManager extends SmoScoreModifierBase {
334
- static get defaultLayout(): SmoGlobalLayout;
335
- static get defaults(): SmoLayoutManagerParams;
336
- static get attributes(): GlobalLayoutAttributes[];
337
- static get scaledPageAttributes(): ScaledPageAttributes[];
338
- static get scaledGlobalAttributes(): ScaledGlobalAttributes[];
339
- static areLayoutsEqual(g1: SmoGlobalLayout, g2: SmoGlobalLayout): boolean;
340
- static isZoomChange(g1: SmoGlobalLayout, g2: SmoGlobalLayout): boolean;
341
- /**
342
- * Adjust zoom width so the score takes up the whole score area
343
- */
344
- zoomToWidth(screenWidth: number): void;
345
- static getScaledPageLayout(globalLayout: SmoGlobalLayout, pageLayout: SmoPageLayout, pages: number): ScaledPageLayout;
346
- globalLayout: SmoGlobalLayout;
347
- pageLayouts: SmoPageLayout[];
348
- constructor(params: SmoLayoutManagerParams);
349
- trimPages(pageCount: number): void;
350
- getZoomScale(): number;
351
- serialize(): SmoLayoutManagerParamsSer;
352
- updateGlobalLayout(params: SmoGlobalLayout): void;
353
- addToPageLayouts(pageNum: number): void;
354
- getGlobalLayout(): SmoGlobalLayout;
355
- getScaledPageLayout(pageIndex: number): ScaledPageLayout;
356
- getPageLayout(pageIndex: number): SmoPageLayout;
357
- getPageLayouts(): SmoPageLayout[];
358
- updatePage(pageLayout: SmoPageLayout, pageIndex: number): void;
359
- }
360
- /**
361
- * constructor parameters for system groups (groupings of staves in the score)
362
- * @param leftConnector
363
- * @param rightConnector
364
- * @param mapType
365
- * @param text
366
- * @param shortText
367
- * @param justify
368
- * @param startSelector not used
369
- * @param endSelector not used
370
- * @category SmoObject
371
- */
372
- export interface SmoSystemGroupParams {
373
- /**
374
- * bracket etc.
375
- */
376
- leftConnector: number;
377
- /**
378
- * bracket etc.
379
- */
380
- rightConnector: number;
381
- /**
382
- * future, score groups can be different for different parts of the score
383
- */
384
- mapType: number;
385
- /**
386
- * whether to justify the notes in the group
387
- */
388
- justify: boolean;
389
- /**
390
- * if mapped to a range, start
391
- */
392
- startSelector: SmoSelector;
393
- /**
394
- * if mapped to a range, end
395
- */
396
- endSelector: SmoSelector;
397
- }
398
- /**
399
- * @category serialization
400
- */
401
- export interface SmoSystemGroupParamsSer extends SmoSystemGroupParams {
402
- /**
403
- * constructor
404
- */
405
- ctor: string;
406
- }
407
- /**
408
- * System group is the grouping of staves into a system.
409
- * @category SmoObject
410
- * */
411
- export declare class SmoSystemGroup extends SmoScoreModifierBase {
412
- static get connectorTypes(): Record<string, number>;
413
- static get connectorTypeNames(): Record<number, string>;
414
- static get mapTypes(): Record<string, number>;
415
- static get attributes(): string[];
416
- static get defaults(): SmoSystemGroupParams;
417
- static isSystemGroup(modifier: SmoSystemGroup | SmoModifierBase): modifier is SmoSystemGroup;
418
- leftConnector: number;
419
- rightConnector: number;
420
- mapType: number;
421
- text: string;
422
- shortText: string;
423
- justify: boolean;
424
- startSelector: SmoSelector;
425
- endSelector: SmoSelector;
426
- attrs: SmoAttrs;
427
- constructor(params: SmoSystemGroupParams);
428
- stavesOverlap(group: SmoSystemGroup): boolean;
429
- measuresOverlap(group: SmoSystemGroup): boolean;
430
- overlaps(group: SmoSystemGroup): boolean;
431
- serialize(): SmoSystemGroupParamsSer;
432
- }
433
- export declare const scoreModifierDynamicCtorInit: () => void;
1
+ import { SmoMeasureFormat, SmoMeasureFormatParamsSer } from './measureModifiers';
2
+ import { SmoAttrs, SmoModifierBase, SvgBox } from './common';
3
+ import { SmoMeasure } from './measure';
4
+ import { SmoSelector } from '../xform/selections';
5
+ /**
6
+ * Base class for all {@link SmoScore} modifiers.
7
+ * It is used to de/serialize the objects.
8
+ * @category SmoObject
9
+ */
10
+ export declare abstract class SmoScoreModifierBase implements SmoModifierBase {
11
+ /**
12
+ * constructor
13
+ *
14
+ * @type {string}
15
+ * @memberof SmoScoreModifierBase
16
+ */
17
+ ctor: string;
18
+ /**
19
+ * When rendered, keep track of the box
20
+ *
21
+ * @type {(SvgBox | null)}
22
+ * @memberof SmoScoreModifierBase
23
+ */
24
+ logicalBox: SvgBox | null;
25
+ /**
26
+ * attributes for identification
27
+ *
28
+ * @type {SmoAttrs}
29
+ * @memberof SmoScoreModifierBase
30
+ */
31
+ attrs: SmoAttrs;
32
+ constructor(ctor: string);
33
+ abstract serialize(): any;
34
+ static deserialize(jsonObj: any): any;
35
+ }
36
+ /**
37
+ * For global/default font settings.
38
+ * @category SmoObject
39
+ * @param name to distinguish: chord, lyric etc.
40
+ * @param family font family
41
+ * @param size in points
42
+ * @param custom used to distinguish a specific text is not the default
43
+ */
44
+ export interface FontPurpose {
45
+ /**
46
+ * name of the purpose
47
+ * { ENGRAVING: 1, SCORE: 2, CHORDS: 3, LYRICS: 4 }
48
+ */
49
+ name: string;
50
+ /**
51
+ * purpose enumeration
52
+ */
53
+ purpose: number;
54
+ /**
55
+ * font family
56
+ */
57
+ family: string;
58
+ /**
59
+ * default font size
60
+ */
61
+ size: number;
62
+ /**
63
+ * a flag that can be used to indicate if this is the global default, or a customization.
64
+ * For lyrics for instance, most lyrics would use the custom font, this would be true if
65
+ * it was overridden
66
+ */
67
+ custom: boolean;
68
+ }
69
+ export type SmoScoreInfoKey = 'name' | 'title' | 'subTitle' | 'composer' | 'copyright';
70
+ export declare const SmoScoreInfoKeys: string[];
71
+ /**
72
+ * Information about the score itself, like composer etc.
73
+ * @category SmoObject
74
+ */
75
+ export interface SmoScoreInfo {
76
+ /**
77
+ * deprecated, now defaults to title
78
+ */
79
+ name: string;
80
+ /**
81
+ * name of score
82
+ */
83
+ title: string;
84
+ /**
85
+ * subtitle/opus
86
+ */
87
+ subTitle: string;
88
+ /**
89
+ * who wrote it
90
+ */
91
+ composer: string;
92
+ /**
93
+ * copyright information
94
+ */
95
+ copyright: string;
96
+ /**
97
+ * for version tracking
98
+ */
99
+ version: number;
100
+ }
101
+ export type SmoScorePreferenceBool = 'autoPlay' | 'autoAdvance' | 'showPiano' | 'hideEmptyLines' | 'transposingScore' | 'autoScrollPlayback' | 'showPartNames';
102
+ export type SmoScorePreferenceNumber = 'defaultDupleDuration' | 'defaultTripleDuration';
103
+ export declare const SmoScorePreferenceBools: SmoScorePreferenceBool[];
104
+ export declare const SmoScorePreferenceNumbers: SmoScorePreferenceNumber[];
105
+ /**
106
+ * Global score/program behavior preferences, see below for parameters
107
+ * @category SmoObject
108
+ */
109
+ export interface SmoScorePreferencesParams {
110
+ autoPlay: boolean;
111
+ autoAdvance: boolean;
112
+ autoScrollPlayback: boolean;
113
+ defaultDupleDuration: number;
114
+ defaultTripleDuration: number;
115
+ showPiano: boolean;
116
+ hideEmptyLines: boolean;
117
+ transposingScore: boolean;
118
+ showPartNames: boolean;
119
+ }
120
+ /**
121
+ * Some default SMO behavior
122
+ * @param autoPlay play a new note or chord
123
+ * @param autoAdvance Sibelius-like behavior of advancing cursor when a letter note is placed
124
+ * @param defaultDupleDuration in ticks, even metered measures
125
+ * @param defaultTripleDuration in ticks, 6/8 etc.
126
+ * @param showPiano show the piano widget in the score
127
+ * @param hideEmptyLines Hide empty lines in full score
128
+ * @param transposingScore Whether to show the score parts in concert key
129
+ * @category SmoObject
130
+ */
131
+ export declare class SmoScorePreferences {
132
+ autoPlay: boolean;
133
+ autoAdvance: boolean;
134
+ defaultDupleDuration: number;
135
+ defaultTripleDuration: number;
136
+ showPiano: boolean;
137
+ hideEmptyLines: boolean;
138
+ autoScrollPlayback: boolean;
139
+ transposingScore: boolean;
140
+ showPartNames: boolean;
141
+ static get defaults(): SmoScorePreferencesParams;
142
+ constructor(params: SmoScorePreferencesParams);
143
+ serialize(): SmoScorePreferencesParams;
144
+ }
145
+ /**
146
+ * non-musical information about the score
147
+ * @category serialization
148
+ */
149
+ export interface ScoreMetadataSer {
150
+ fonts: FontPurpose[];
151
+ preferences: SmoScorePreferencesParams;
152
+ renumberingMap: Record<string, string>;
153
+ scoreInfo: SmoScoreInfo;
154
+ }
155
+ /**
156
+ * Map of measure formatting to measure IDs. We only save non-default formats
157
+ * @category SmoObject
158
+ * @param measureFormats
159
+ * @param partIndex
160
+ */
161
+ export interface SmoFormattingManagerParams {
162
+ /**
163
+ * map of index to {@link SmoMeasureFormat} objects
164
+ */
165
+ measureFormats?: SmoMeasureFormat[];
166
+ /**
167
+ * the associated part, or -1 for the score
168
+ */
169
+ partIndex?: number;
170
+ }
171
+ /**
172
+ * A score can have different views - one for the score itself and one for each
173
+ * part, and each part can have its own formatting and text.
174
+ * *Note*: I may move this to part info module.
175
+ * @param measureFormats map of index to {@link SmoMeasureFormat} objects
176
+ * @param partIndex the associated part, or -1 for the score
177
+ * @category SmoObject
178
+ */
179
+ export declare class SmoFormattingManager extends SmoScoreModifierBase {
180
+ measureFormats: Record<number, SmoMeasureFormat>;
181
+ partIndex: number;
182
+ static get forScore(): number;
183
+ static get defaults(): SmoFormattingManagerParams;
184
+ constructor(params: SmoFormattingManagerParams);
185
+ /**
186
+ * Update the measure format for the measure at the given index
187
+ * @param format
188
+ */
189
+ updateMeasureFormat(format: SmoMeasureFormat): void;
190
+ /**
191
+ * Update the measure format based on the format of a given measure
192
+ * @param measure
193
+ */
194
+ updateFormat(measure: SmoMeasure): void;
195
+ serialize(): SmoMeasureFormatParamsSer[];
196
+ }
197
+ export type SmoAudioPlayerType = 'sampler' | 'synthesizer';
198
+ /**
199
+ * Constructor parameters for audio player
200
+ * @category SmoObject
201
+ */
202
+ export interface SmoAudioPlayerParameters {
203
+ playerType?: SmoAudioPlayerType;
204
+ waveform?: OscillatorType;
205
+ reverbEnable?: boolean;
206
+ reverbDelay?: number;
207
+ reverbDecay?: number;
208
+ }
209
+ /**
210
+ * web audio API defines this
211
+ * @param otype
212
+ * @returns
213
+ */
214
+ export declare function IsOscillatorType(otype: OscillatorType | string): otype is OscillatorType;
215
+ /**
216
+ * Audio playback parameters. Just fun stuff.
217
+ * @category SmoObject
218
+ */
219
+ export declare class SmoAudioPlayerSettings extends SmoScoreModifierBase {
220
+ static get defaults(): SmoAudioPlayerParameters;
221
+ static get attributes(): string[];
222
+ playerType: SmoAudioPlayerType;
223
+ waveform: OscillatorType;
224
+ reverbEnable: boolean;
225
+ reverbDelay: number;
226
+ reverbDecay: number;
227
+ constructor(params: SmoAudioPlayerParameters);
228
+ serialize(): any;
229
+ }
230
+ export type ScaledPageAttributes = 'leftMargin' | 'rightMargin' | 'topMargin' | 'bottomMargin' | 'interGap' | 'intraGap';
231
+ /**
232
+ * Constructor parameters for {@link SmoPageLayout}, part of {@link SmoLayoutManager}
233
+ * @category SmoObject
234
+ */
235
+ export interface SmoPageLayoutParams {
236
+ leftMargin: number;
237
+ rightMargin: number;
238
+ topMargin: number;
239
+ bottomMargin: number;
240
+ interGap: number;
241
+ intraGap: number;
242
+ }
243
+ /**
244
+ * Define margins and other layout information associated with a specific page, and may
245
+ * be different on different pages.
246
+ * @category SmoObject
247
+ */
248
+ export declare class SmoPageLayout extends SmoScoreModifierBase {
249
+ static get defaults(): SmoPageLayoutParams;
250
+ static get attributes(): ScaledPageAttributes[];
251
+ leftMargin: number;
252
+ rightMargin: number;
253
+ topMargin: number;
254
+ bottomMargin: number;
255
+ interGap: number;
256
+ intraGap: number;
257
+ constructor(params: SmoPageLayoutParams);
258
+ serialize(): any;
259
+ }
260
+ export type ScaledGlobalAttributes = 'pageWidth' | 'pageHeight';
261
+ export type GlobalLayoutAttributes = 'pageWidth' | 'pageHeight' | 'noteSpacing' | 'svgScale' | 'zoomScale' | 'proportionality' | 'maxMeasureSystem';
262
+ export declare const GlobalLayoutAttributesArray: GlobalLayoutAttributes[];
263
+ /**
264
+ * Global layout are parameters that determine the layout of the whole score, because they affect the containing svg element
265
+ * @category SmoObject
266
+ */
267
+ export interface SmoGlobalLayout {
268
+ svgScale: number;
269
+ zoomScale: number;
270
+ noteSpacing: number;
271
+ pageWidth: number;
272
+ pageHeight: number;
273
+ proportionality: number;
274
+ maxMeasureSystem: number;
275
+ }
276
+ /**
277
+ * Used to create {@link SmoLayoutManagerParams}
278
+ * @category SmoObject
279
+ */
280
+ export interface ScaledPageLayout {
281
+ svgScale: number;
282
+ zoomScale: number;
283
+ noteSpacing: number;
284
+ pageWidth: number;
285
+ pageHeight: number;
286
+ leftMargin: number;
287
+ rightMargin: number;
288
+ topMargin: number;
289
+ bottomMargin: number;
290
+ interGap: number;
291
+ intraGap: number;
292
+ pages: number;
293
+ maxMeasureSystem: number;
294
+ }
295
+ /**
296
+ * Constructor parameters for {@link SmoLayoutManager}
297
+ * @category SmoObject
298
+ */
299
+ export interface SmoLayoutManagerParams {
300
+ /**
301
+ * global svg settings for zoom, page width/height
302
+ */
303
+ globalLayout: SmoGlobalLayout;
304
+ /**
305
+ * page margins for each page
306
+ */
307
+ pageLayouts: SmoPageLayout[];
308
+ }
309
+ /**
310
+ * @category serialization
311
+ */
312
+ export interface SmoLayoutManagerParamsSer {
313
+ /**
314
+ * constructor
315
+ */
316
+ ctor: string;
317
+ /**
318
+ * global svg settings for zoom, page width/height
319
+ */
320
+ globalLayout: SmoGlobalLayout;
321
+ /**
322
+ * page margins for each page
323
+ */
324
+ pageLayouts: SmoPageLayoutParams[];
325
+ }
326
+ /**
327
+ * Storage and utilities for layout information in the score. Each
328
+ * manager has one set of page height/width, since svg element
329
+ * must have single length/width and viewbox.
330
+ * Each page can have different margins.
331
+ * @category SmoObject
332
+ */
333
+ export declare class SmoLayoutManager extends SmoScoreModifierBase {
334
+ static get defaultLayout(): SmoGlobalLayout;
335
+ static get defaults(): SmoLayoutManagerParams;
336
+ static get attributes(): GlobalLayoutAttributes[];
337
+ static get scaledPageAttributes(): ScaledPageAttributes[];
338
+ static get scaledGlobalAttributes(): ScaledGlobalAttributes[];
339
+ static areLayoutsEqual(g1: SmoGlobalLayout, g2: SmoGlobalLayout): boolean;
340
+ static isZoomChange(g1: SmoGlobalLayout, g2: SmoGlobalLayout): boolean;
341
+ /**
342
+ * Adjust zoom width so the score takes up the whole score area
343
+ */
344
+ zoomToWidth(screenWidth: number): void;
345
+ static getScaledPageLayout(globalLayout: SmoGlobalLayout, pageLayout: SmoPageLayout, pages: number): ScaledPageLayout;
346
+ globalLayout: SmoGlobalLayout;
347
+ pageLayouts: SmoPageLayout[];
348
+ constructor(params: SmoLayoutManagerParams);
349
+ trimPages(pageCount: number): void;
350
+ getZoomScale(): number;
351
+ serialize(): SmoLayoutManagerParamsSer;
352
+ updateGlobalLayout(params: SmoGlobalLayout): void;
353
+ addToPageLayouts(pageNum: number): void;
354
+ getGlobalLayout(): SmoGlobalLayout;
355
+ getScaledPageLayout(pageIndex: number): ScaledPageLayout;
356
+ getPageLayout(pageIndex: number): SmoPageLayout;
357
+ getPageLayouts(): SmoPageLayout[];
358
+ updatePage(pageLayout: SmoPageLayout, pageIndex: number): void;
359
+ }
360
+ /**
361
+ * constructor parameters for system groups (groupings of staves in the score)
362
+ * @param leftConnector
363
+ * @param rightConnector
364
+ * @param mapType
365
+ * @param text
366
+ * @param shortText
367
+ * @param justify
368
+ * @param startSelector not used
369
+ * @param endSelector not used
370
+ * @category SmoObject
371
+ */
372
+ export interface SmoSystemGroupParams {
373
+ /**
374
+ * bracket etc.
375
+ */
376
+ leftConnector: number;
377
+ /**
378
+ * bracket etc.
379
+ */
380
+ rightConnector: number;
381
+ /**
382
+ * future, score groups can be different for different parts of the score
383
+ */
384
+ mapType: number;
385
+ /**
386
+ * whether to justify the notes in the group
387
+ */
388
+ justify: boolean;
389
+ /**
390
+ * if mapped to a range, start
391
+ */
392
+ startSelector: SmoSelector;
393
+ /**
394
+ * if mapped to a range, end
395
+ */
396
+ endSelector: SmoSelector;
397
+ }
398
+ /**
399
+ * @category serialization
400
+ */
401
+ export interface SmoSystemGroupParamsSer extends SmoSystemGroupParams {
402
+ /**
403
+ * constructor
404
+ */
405
+ ctor: string;
406
+ }
407
+ /**
408
+ * System group is the grouping of staves into a system.
409
+ * @category SmoObject
410
+ * */
411
+ export declare class SmoSystemGroup extends SmoScoreModifierBase {
412
+ static get connectorTypes(): Record<string, number>;
413
+ static get connectorTypeNames(): Record<number, string>;
414
+ static get mapTypes(): Record<string, number>;
415
+ static get attributes(): string[];
416
+ static get defaults(): SmoSystemGroupParams;
417
+ static isSystemGroup(modifier: SmoSystemGroup | SmoModifierBase): modifier is SmoSystemGroup;
418
+ leftConnector: number;
419
+ rightConnector: number;
420
+ mapType: number;
421
+ text: string;
422
+ shortText: string;
423
+ justify: boolean;
424
+ startSelector: SmoSelector;
425
+ endSelector: SmoSelector;
426
+ attrs: SmoAttrs;
427
+ constructor(params: SmoSystemGroupParams);
428
+ stavesOverlap(group: SmoSystemGroup): boolean;
429
+ measuresOverlap(group: SmoSystemGroup): boolean;
430
+ overlaps(group: SmoSystemGroup): boolean;
431
+ serialize(): SmoSystemGroupParamsSer;
432
+ }
433
+ export declare const scoreModifierDynamicCtorInit: () => void;