smoosic 1.0.40 → 1.0.41

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 (71) hide show
  1. package/build/smoosic.js +3 -3
  2. package/package.json +1 -1
  3. package/release/smoosic.js +3 -3
  4. package/src/smo/data/scoreModifiers.ts +2 -2
  5. package/src/ui/components/dialogs/timeSignature.vue +25 -4
  6. package/types/src/application/application.d.ts +103 -102
  7. package/types/src/application/common.d.ts +6 -0
  8. package/types/src/application/configuration.d.ts +75 -75
  9. package/types/src/application/dynamicInit.d.ts +6 -6
  10. package/types/src/application/eventHandler.d.ts +87 -81
  11. package/types/src/application/exports.d.ts +482 -485
  12. package/types/src/render/audio/oscillator.d.ts +99 -99
  13. package/types/src/render/audio/player.d.ts +143 -143
  14. package/types/src/render/audio/samples.d.ts +56 -56
  15. package/types/src/render/sui/NoteEntryCaret.d.ts +107 -0
  16. package/types/src/render/sui/NoteEntryMediator.d.ts +24 -0
  17. package/types/src/render/sui/configuration.d.ts +53 -49
  18. package/types/src/render/sui/formatter.d.ts +163 -161
  19. package/types/src/render/sui/layoutDebug.d.ts +46 -46
  20. package/types/src/render/sui/mapper.d.ts +138 -135
  21. package/types/src/render/sui/renderState.d.ts +92 -90
  22. package/types/src/render/sui/scoreRender.d.ts +97 -96
  23. package/types/src/render/sui/scoreView.d.ts +280 -279
  24. package/types/src/render/sui/scoreViewOperations.d.ts +604 -594
  25. package/types/src/render/sui/scroller.d.ts +41 -41
  26. package/types/src/render/sui/svgPageMap.d.ts +344 -344
  27. package/types/src/render/sui/textEdit.d.ts +316 -316
  28. package/types/src/render/sui/tracker.d.ts +10 -4
  29. package/types/src/render/vex/vxMeasure.d.ts +97 -97
  30. package/types/src/smo/data/common.d.ts +220 -220
  31. package/types/src/smo/data/measure.d.ts +511 -511
  32. package/types/src/smo/data/measureModifiers.d.ts +509 -508
  33. package/types/src/smo/data/music.d.ts +2 -1
  34. package/types/src/smo/data/note.d.ts +2 -0
  35. package/types/src/smo/data/noteModifiers.d.ts +2 -0
  36. package/types/src/smo/data/score.d.ts +7 -5
  37. package/types/src/smo/data/scoreModifiers.d.ts +441 -440
  38. package/types/src/smo/data/systemStaff.d.ts +2 -2
  39. package/types/src/smo/data/tuplet.d.ts +7 -0
  40. package/types/src/smo/midi/midiToSmo.d.ts +12 -12
  41. package/types/src/smo/midi/smoToMidi.d.ts +3 -3
  42. package/types/src/smo/mxml/smoToXml.d.ts +4 -4
  43. package/types/src/smo/mxml/xmlState.d.ts +3 -3
  44. package/types/src/smo/mxml/xmlToSmo.d.ts +2 -2
  45. package/types/src/smo/xform/operations.d.ts +3 -3
  46. package/types/src/smo/xform/selections.d.ts +154 -154
  47. package/types/src/ui/buttons/display.d.ts +1 -0
  48. package/types/src/ui/common.d.ts +69 -67
  49. package/types/src/ui/composable/draggable.d.ts +1 -1
  50. package/types/src/ui/configuration.d.ts +30 -30
  51. package/types/src/ui/dialogs/chordChange.d.ts +35 -35
  52. package/types/src/ui/dialogs/components/baseComponent.d.ts +158 -158
  53. package/types/src/ui/dialogs/components/button.d.ts +54 -54
  54. package/types/src/ui/dialogs/components/dropdown.d.ts +78 -78
  55. package/types/src/ui/dialogs/components/pitch.d.ts +95 -95
  56. package/types/src/ui/dialogs/components/rocker.d.ts +66 -66
  57. package/types/src/ui/dialogs/components/textInPlace.d.ts +90 -90
  58. package/types/src/ui/dialogs/components/textInput.d.ts +58 -58
  59. package/types/src/ui/dialogs/components/toggle.d.ts +53 -53
  60. package/types/src/ui/dialogs/dialog.d.ts +203 -203
  61. package/types/src/ui/dialogs/endings.d.ts +2 -2
  62. package/types/src/ui/dialogs/lyric.d.ts +39 -39
  63. package/types/src/ui/dialogs/measureFormat.d.ts +2 -2
  64. package/types/src/ui/dialogs/tempo.d.ts +3 -3
  65. package/types/src/ui/dialogs/textBlock.d.ts +55 -61
  66. package/types/src/ui/dialogs/timeSignature.d.ts +2 -34
  67. package/types/src/ui/exceptions.d.ts +15 -15
  68. package/types/src/ui/help.d.ts +6 -1
  69. package/types/src/ui/menus/manager.d.ts +59 -59
  70. package/types/src/ui/navigation.d.ts +44 -37
  71. package/types/typedoc.d.ts +157 -157
@@ -5,7 +5,7 @@
5
5
  * **/
6
6
  import { SmoObjectParams, SmoAttrs, Pitch, ElementLike } from './common';
7
7
  import { SmoMeasure, SmoMeasureParamsSer } from './measure';
8
- import { SmoRehearsalMarkParams, SmoTempoTextParams, SmoVolta } from './measureModifiers';
8
+ import { SmoRehearsalMarkParams, SmoTempoParams, SmoVolta } from './measureModifiers';
9
9
  import { SmoInstrumentParams, StaffModifierBase, SmoInstrument, SmoInstrumentMeasure, SmoTie, SmoStaffTextBracket, SmoStaffTextBracketParamsSer, StaffModifierBaseSer, SmoTabStave, SmoStaffHairpin } from './staffModifiers';
10
10
  import { SmoPartInfo, SmoPartInfoParamsSer } from './partInfo';
11
11
  import { SmoSelector } from '../xform/selections';
@@ -220,7 +220,7 @@ export declare class SmoSystemStaff implements SmoObjectParams {
220
220
  applyBeams(): void;
221
221
  addRehearsalMark(index: number, parameters: SmoRehearsalMarkParams): void;
222
222
  removeTempo(index: number): void;
223
- addTempo(tempo: SmoTempoTextParams, index: number): void;
223
+ addTempo(tempo: SmoTempoParams, index: number): void;
224
224
  removeRehearsalMark(index: number): void;
225
225
  /**
226
226
  * Sync the staff modifier indices between the full score and the score view, which may
@@ -31,6 +31,13 @@ export declare class SmoTupletTree {
31
31
  constructor(params: SmoTupletTreeParams);
32
32
  static syncTupletIds(tupletTrees: SmoTupletTree[], voices: SmoVoice[]): void;
33
33
  static adjustTupletIndexes(tupletTrees: SmoTupletTree[], voice: number, startTick: number, diff: number): void;
34
+ /**
35
+ * When pasting a tuplet into am measure, adjust the tuplet indices for tuplets that come after.
36
+ * @param tupletTrees
37
+ * @param voice
38
+ * @param measure
39
+ */
40
+ static adjustMeasureTupletIndices(tupletTrees: SmoTupletTree[], voice: number, measure: SmoMeasure): void;
34
41
  static getTupletForNoteIndex(tupletTrees: SmoTupletTree[], voiceIx: number, noteIx: number): SmoTuplet | null;
35
42
  static getTupletTreeForNoteIndex(tupletTrees: SmoTupletTree[], voiceIx: number, noteIx: number): SmoTupletTree | null;
36
43
  static getTupletHierarchyForNoteIndex(tupletTrees: SmoTupletTree[], voiceIx: number, noteIx: number): SmoTuplet[];
@@ -1,10 +1,10 @@
1
1
  import { Clef, Pitch } from "../data/common";
2
2
  import { SmoMeasure } from "../data/measure";
3
- import { SmoTempoText, TimeSignature } from "../data/measureModifiers";
3
+ import { SmoTempo, SmoTimeSignature } from "../data/measureModifiers";
4
4
  import { SmoNote } from "../data/note";
5
5
  import { SmoScore } from "../data/score";
6
6
  import { SmoTuplet } from "../data/tuplet";
7
- export type MidiEventType = 'text' | 'copyrightNotice' | 'trackName' | 'instrumentName' | 'lyrics' | 'marker' | 'cuePoint' | 'channelPrefix' | 'portPrefix' | 'endOfTrack' | 'setTempo' | 'smpteOffset' | 'timeSignature' | 'keySignature' | 'sequencerSpecific' | 'unknownMeta' | 'noteOff' | 'noteOn' | 'noteAftertouch' | 'controller' | 'programChange' | 'channelAftertouch' | 'pitchBend';
7
+ export type MidiEventType = 'text' | 'copyrightNotice' | 'trackName' | 'instrumentName' | 'lyrics' | 'marker' | 'cuePoint' | 'channelPrefix' | 'portPrefix' | 'endOfTrack' | 'setTempo' | 'smpteOffset' | 'SmoTimeSignature' | 'keySignature' | 'sequencerSpecific' | 'unknownMeta' | 'noteOff' | 'noteOn' | 'noteAftertouch' | 'controller' | 'programChange' | 'channelAftertouch' | 'pitchBend';
8
8
  /**
9
9
  * These are the midi events as defined by the parser.
10
10
  * @category serialization
@@ -29,8 +29,8 @@ export interface MidiTrackEvent {
29
29
  */
30
30
  export interface RunningMetadata {
31
31
  keySignature: string;
32
- timeSignature: TimeSignature;
33
- tempo: SmoTempoText;
32
+ timeSignature: SmoTimeSignature;
33
+ tempo: SmoTempo;
34
34
  }
35
35
  /**
36
36
  * @category serialization
@@ -58,8 +58,8 @@ export interface EventSmoData {
58
58
  tupletInfo: MidiTupletInfo | null;
59
59
  isRest: boolean;
60
60
  isTied: boolean;
61
- timeSignature: TimeSignature;
62
- tempo: SmoTempoText;
61
+ timeSignature: SmoTimeSignature;
62
+ tempo: SmoTempo;
63
63
  keySignature: string;
64
64
  measure: number;
65
65
  tick: number;
@@ -70,8 +70,8 @@ export declare function getValueForTick<T>(arg: Record<number, T>, tick: number)
70
70
  * @category serialization
71
71
  */
72
72
  export declare class MidiToSmo {
73
- timeSignatureMap: Record<number, TimeSignature>;
74
- tempoMap: Record<number, SmoTempoText>;
73
+ SmoTimeSignatureMap: Record<number, SmoTimeSignature>;
74
+ tempoMap: Record<number, SmoTempo>;
75
75
  keySignatureMap: Record<number, string>;
76
76
  tieMap: Record<number, number[]>;
77
77
  timeDivision: number;
@@ -102,13 +102,13 @@ export declare class MidiToSmo {
102
102
  * @param ticks
103
103
  * @returns
104
104
  */
105
- getTempo(ticks: number): SmoTempoText;
105
+ getTempo(ticks: number): SmoTempo;
106
106
  /**
107
107
  * @internal
108
108
  * @param ticks
109
109
  * @returns
110
110
  */
111
- getTimeSignature(ticks: number): TimeSignature;
111
+ getSmoTimeSignature(ticks: number): SmoTimeSignature;
112
112
  /**
113
113
  * @internal
114
114
  * @param ticks
@@ -121,8 +121,8 @@ export declare class MidiToSmo {
121
121
  * @returns
122
122
  */
123
123
  getMetadata(ticks: number): {
124
- tempo: SmoTempoText;
125
- timeSignature: TimeSignature;
124
+ tempo: SmoTempo;
125
+ timeSignature: SmoTimeSignature;
126
126
  keySignature: string;
127
127
  };
128
128
  /**
@@ -1,4 +1,4 @@
1
- import { TimeSignature, SmoTempoText } from '../data/measureModifiers';
1
+ import { SmoTimeSignature, SmoTempo } from '../data/measureModifiers';
2
2
  import { SmoScore } from '../data/score';
3
3
  /**
4
4
  * @category serialization
@@ -6,8 +6,8 @@ import { SmoScore } from '../data/score';
6
6
  export interface MidiTrackHash {
7
7
  track: any;
8
8
  lastMeasure: number;
9
- timeSignature?: TimeSignature;
10
- tempo?: SmoTempoText;
9
+ timeSignature?: SmoTimeSignature;
10
+ tempo?: SmoTempo;
11
11
  keySignature?: string;
12
12
  }
13
13
  /**
@@ -3,9 +3,9 @@ import { SmoNote } from '../data/note';
3
3
  import { SmoMeasure, SmoVoice } from '../data/measure';
4
4
  import { SmoSystemStaff } from '../data/systemStaff';
5
5
  import { SmoScore } from '../data/score';
6
- import { TimeSignature } from '../data/measureModifiers';
6
+ import { SmoTimeSignature } from '../data/measureModifiers';
7
7
  import { SmoSelector } from '../xform/selections';
8
- import { SmoTempoText } from '../data/measureModifiers';
8
+ import { SmoTempo } from '../data/measureModifiers';
9
9
  /**
10
10
  * @category serialization
11
11
  */
@@ -38,8 +38,8 @@ export interface SmoState {
38
38
  note?: SmoNote;
39
39
  beamState: number;
40
40
  beamTicks: number;
41
- timeSignature?: TimeSignature;
42
- tempo?: SmoTempoText;
41
+ timeSignature?: SmoTimeSignature;
42
+ tempo?: SmoTempo;
43
43
  currentTupletLevel: number;
44
44
  }
45
45
  /**
@@ -3,7 +3,7 @@ import { SmoScore } from '../data/score';
3
3
  import { SmoFormattingManager, SmoSystemGroup } from '../data/scoreModifiers';
4
4
  import { SmoSystemStaff } from '../data/systemStaff';
5
5
  import { SmoInstrument, SmoInstrumentParams, SmoSlurParams } from '../data/staffModifiers';
6
- import { SmoTempoText } from '../data/measureModifiers';
6
+ import { SmoTempo } from '../data/measureModifiers';
7
7
  import { SmoPartInfo } from '../data/partInfo';
8
8
  import { SmoMeasure } from '../data/measure';
9
9
  import { SmoNote } from '../data/note';
@@ -154,7 +154,7 @@ export interface XmlPartGroup {
154
154
  export declare class XmlState {
155
155
  static get defaults(): {
156
156
  divisions: number;
157
- tempo: SmoTempoText;
157
+ tempo: SmoTempo;
158
158
  timeSignature: string;
159
159
  keySignature: string;
160
160
  clefInfo: never[];
@@ -186,7 +186,7 @@ export declare class XmlState {
186
186
  completedTupletStates: XmlCompletedTupletState[];
187
187
  tupletStatesInProgress: Record<number, XmlTupletState>;
188
188
  tickCursor: number;
189
- tempo: SmoTempoText;
189
+ tempo: SmoTempo;
190
190
  staffArray: XmlStaffInfo[];
191
191
  staffIndex: number;
192
192
  graceNotes: SmoGraceNote[];
@@ -1,6 +1,6 @@
1
1
  import { XmlState } from './xmlState';
2
2
  import { SmoLayoutManager } from '../data/scoreModifiers';
3
- import { SmoTempoText } from '../data/measureModifiers';
3
+ import { SmoTempo } from '../data/measureModifiers';
4
4
  import { SmoScore } from '../data/score';
5
5
  /**
6
6
  * A class that takes a music XML file and outputs a {@link SmoScore}
@@ -68,7 +68,7 @@ export declare class XmlToSmo {
68
68
  */
69
69
  static tempo(element: Element): {
70
70
  staffId: number;
71
- tempo: SmoTempoText;
71
+ tempo: SmoTempo;
72
72
  }[];
73
73
  /**
74
74
  * /score-partwise/measure/direction/dynamics
@@ -3,7 +3,7 @@ import { SmoNote } from '../data/note';
3
3
  import { SmoScore } from '../data/score';
4
4
  import { SmoSystemStaff, SmoSystemStaffParams } from '../data/systemStaff';
5
5
  import { SmoGraceNote, SmoDynamicText, SmoTabNote } from '../data/noteModifiers';
6
- import { SmoRehearsalMark, SmoMeasureText, SmoVolta, SmoMeasureFormat, SmoTempoText, SmoBarline, TimeSignature, SmoRepeatSymbol } from '../data/measureModifiers';
6
+ import { SmoRehearsalMark, SmoMeasureText, SmoVolta, SmoMeasureFormat, SmoTempo, SmoBarline, SmoTimeSignature, SmoRepeatSymbol } from '../data/measureModifiers';
7
7
  import { SmoStaffHairpin, SmoSlur, SmoTie, StaffModifierBase, SmoInstrument, SmoSlurParams, SmoStaffTextBracket, SmoTabStave } from '../data/staffModifiers';
8
8
  import { SmoSystemGroup } from '../data/scoreModifiers';
9
9
  import { SmoTextGroup } from '../data/scoreText';
@@ -42,7 +42,7 @@ export declare class SmoOperation {
42
42
  static swapVoice(selections: SmoSelection[], voice1: number, voice2: number): void;
43
43
  static setTabStave(score: SmoScore, tabStave: SmoTabStave): void;
44
44
  static removeTabStave(score: SmoScore, tabStaves: SmoTabStave[]): void;
45
- static setTimeSignature(score: SmoScore, selections: SmoSelection[], timeSignature: TimeSignature): void;
45
+ static setTimeSignature(score: SmoScore, selections: SmoSelection[], timeSignature: SmoTimeSignature): void;
46
46
  static batchSelectionOperation(score: SmoScore, selections: SmoSelection[], operation: BatchSelectionOperation): void;
47
47
  static doubleDuration(selection: SmoSelection): boolean;
48
48
  static halveDuration(selection: SmoSelection): boolean;
@@ -87,7 +87,7 @@ export declare class SmoOperation {
87
87
  static removeMeasureText(score: SmoScore, selection: SmoSelection, mt: SmoMeasureText): void;
88
88
  static removeRehearsalMark(score: SmoScore, selection: SmoSelection): void;
89
89
  static addRehearsalMark(score: SmoScore, selection: SmoSelection, rehearsalMark: SmoRehearsalMark): void;
90
- static addTempo(score: SmoScore, selection: SmoSelection, tempo: SmoTempoText): void;
90
+ static addTempo(score: SmoScore, selection: SmoSelection, tempo: SmoTempo): void;
91
91
  static setMeasureBarline(score: SmoScore, selection: SmoSelection, barline: SmoBarline): void;
92
92
  static setRepeatSymbol(score: SmoScore, selection: SmoSelection, sym: SmoRepeatSymbol): void;
93
93
  static interval(selection: SmoSelection, interval: number): boolean;
@@ -1,154 +1,154 @@
1
- /**
2
- * Editing operations are performed on selections. A selection can be different things, from a single pitch
3
- * to many notes. These classes standardize some standard selection operations.
4
- * SmoSelector
5
- * @module /smo/xform/selections
6
- */
7
- import { SmoScore, SmoModifier } from '../data/score';
8
- import { SmoMeasure } from '../data/measure';
9
- import { SmoNote } from '../data/note';
10
- import { SmoSystemStaff } from '../data/systemStaff';
11
- import { SvgBox, SvgPoint } from '../data/common';
12
- /**
13
- * Modifier tab is a modifier and its bounding box, that can be tabbed to with the keyboard
14
- * @category SmoTransform
15
- */
16
- export interface ModifierTab {
17
- modifier: SmoModifier;
18
- selection: SmoSelection | null;
19
- box: SvgBox;
20
- index: number;
21
- }
22
- /**
23
- * There are 2 parts to a selection: the actual musical bits that are selected, and the
24
- * indices that define what was selected. This is the latter. The actual object does not
25
- * have any methods so there is no constructor.
26
- * @category SmoTransform
27
- * */
28
- export declare class SmoSelector {
29
- static get default(): SmoSelector;
30
- staff: number;
31
- measure: number;
32
- voice: number;
33
- tick: number;
34
- pitches: number[];
35
- static measureSelector(staff: number, measure: number): SmoSelector;
36
- static fromMeasure(measure: SmoMeasure): SmoSelector;
37
- static sameNote(sel1: SmoSelector, sel2: SmoSelector): boolean;
38
- static sameMeasure(sel1: SmoSelector, sel2: SmoSelector): boolean;
39
- static sameStaff(sel1: SmoSelector, sel2: SmoSelector): boolean;
40
- /**
41
- * Return gt, not considering the voice (e.g. gt in time)
42
- * @param sel1
43
- * @param sel2
44
- */
45
- static gtInTime(sel1: SmoSelector, sel2: SmoSelector): boolean;
46
- /**
47
- * return true if sel1 > sel2
48
- */
49
- static gt(sel1: SmoSelector, sel2: SmoSelector): boolean;
50
- static eq(sel1: SmoSelector, sel2: SmoSelector): boolean;
51
- static neq(sel1: SmoSelector, sel2: SmoSelector): boolean;
52
- /**
53
- * return true if sel1 < sel2
54
- */
55
- static lt(sel1: SmoSelector, sel2: SmoSelector): boolean;
56
- /**
57
- * return true if sel1 >= sel2
58
- */
59
- static gteq(sel1: SmoSelector, sel2: SmoSelector): boolean;
60
- /**
61
- * return true if sel1 <= sel2
62
- */
63
- static lteq(sel1: SmoSelector, sel2: SmoSelector): boolean;
64
- static order(a: SmoSelector, b: SmoSelector): SmoSelector[];
65
- static getNoteKey(selector: SmoSelector): string;
66
- static getMeasureKey(selector: SmoSelector): string;
67
- static contains(testSel: SmoSelector, selStart: SmoSelector, selEnd: SmoSelector): boolean;
68
- static overlaps(start1: SmoSelector, end1: SmoSelector, start2: SmoSelector, end2: SmoSelector): boolean;
69
- static selectorNoteKey(selector: SmoSelector): string;
70
- }
71
- /**
72
- * The fields in a selection. We have the 5 musical cardinal directions of staff, measure, note, pitches,
73
- * and a selector. The pitches are indices
74
- * @category SmoTransform
75
- * */
76
- export interface SmoSelectionParams {
77
- selector: SmoSelector;
78
- _staff: SmoSystemStaff;
79
- _measure: SmoMeasure;
80
- _note?: SmoNote;
81
- _pitches?: number[];
82
- type?: string;
83
- box?: SvgBox;
84
- }
85
- /**
86
- * A selection is a {@link SmoSelector} and a set of references to musical elements, like measure etc.
87
- * The staff and measure are always a part of the selection, and possible a voice and note,
88
- * and one or more pitches. Selections can also be made from the UI by clicking on an element
89
- * or navigating to an element with the keyboard.
90
- * @category SmoTransform
91
- * */
92
- export declare class SmoSelection {
93
- selector: SmoSelector;
94
- _staff: SmoSystemStaff;
95
- _measure: SmoMeasure;
96
- _note: SmoNote | null;
97
- _pitches: number[];
98
- box: SvgBox | null;
99
- scrollBox: SvgPoint | null;
100
- static measureSelection(score: SmoScore, staffIndex: number, measureIndex: number): SmoSelection | null;
101
- static measuresInColumn(score: SmoScore, staffIndex: number): SmoSelection[];
102
- static noteSelection(score: SmoScore, staffIndex: number, measureIndex: number, voiceIndex: number, tickIndex: number): SmoSelection | null;
103
- static noteFromSelector(score: SmoScore, selector: SmoSelector): SmoSelection | null;
104
- static selectionsToEnd(score: SmoScore, staff: number, startMeasure: number): SmoSelection[];
105
- static selectionFromSelector(score: SmoScore, selector: SmoSelector): SmoSelection | null;
106
- static pitchSelection(score: SmoScore, staffIndex: number, measureIndex: number, voiceIndex: number, tickIndex: number, pitches: number[]): SmoSelection;
107
- /**
108
- * Return the selection that is tickCount ticks after the current selection.
109
- * @param score
110
- * @param selection
111
- * @param tickCount
112
- * @returns
113
- */
114
- static advanceTicks(score: SmoScore, selection: SmoSelection, tickCount: number): SmoSelection | null;
115
- /**
116
- * Count the number of tick indices between selector 1 and selector 2;
117
- * @param score
118
- * @param sel1
119
- * @param sel2
120
- * @returns
121
- */
122
- static countTickIndices(score: SmoScore, sel1: SmoSelector, sel2: SmoSelector): number;
123
- /**
124
- * Count the number of tick indices between selector 1 and selector 2;
125
- * @param score
126
- * @param sel1
127
- * @param sel2
128
- * @returns
129
- */
130
- static countTicks(score: SmoScore, sel1: SmoSelector, sel2: SmoSelector): number;
131
- static nextNoteSelectionIncludeVoice(score: SmoScore, staffIndex: number, measureIndex: number, voiceIndex: number, tickIndex: number): SmoSelection | null;
132
- static nextNoteSelection(score: SmoScore, staffIndex: number, measureIndex: number, voiceIndex: number, tickIndex: number): SmoSelection | null;
133
- /**
134
- *
135
- * @param score
136
- * @param selector
137
- * @returns
138
- */
139
- static innerSelections(score: SmoScore, startSelector: SmoSelector, endSelector: SmoSelector): SmoSelection[];
140
- static nextNoteSelectionFromSelector(score: SmoScore, selector: SmoSelector): SmoSelection | null;
141
- static lastNoteSelectionFromSelector(score: SmoScore, selector: SmoSelector): SmoSelection | null;
142
- static lastNoteSelection(score: SmoScore, staffIndex: number, measureIndex: number, voiceIndex: number, tickIndex: number): SmoSelection | null;
143
- static lastNoteSelectionNonRest(score: SmoScore, staffIndex: number, measureIndex: number, voiceIndex: number, tickIndex: number): SmoSelection | null;
144
- static nextNoteSelectionNonRest(score: SmoScore, staffIndex: number, measureIndex: number, voiceIndex: number, tickIndex: number): SmoSelection | null;
145
- static getMeasureList(selections: SmoSelection[]): SmoSelection[];
146
- static getMeasuresBetween(score: SmoScore, fromSelector: SmoSelector, toSelector: SmoSelector): SmoSelection[];
147
- static selectionsSameMeasure(selections: SmoSelection[]): boolean;
148
- static selectionsSameStaff(selections: SmoSelection[]): boolean;
149
- constructor(params: SmoSelectionParams);
150
- get staff(): SmoSystemStaff;
151
- get measure(): SmoMeasure;
152
- get note(): SmoNote | null;
153
- get pitches(): number[];
154
- }
1
+ /**
2
+ * Editing operations are performed on selections. A selection can be different things, from a single pitch
3
+ * to many notes. These classes standardize some standard selection operations.
4
+ * SmoSelector
5
+ * @module /smo/xform/selections
6
+ */
7
+ import { SmoScore, SmoModifier } from '../data/score';
8
+ import { SmoMeasure } from '../data/measure';
9
+ import { SmoNote } from '../data/note';
10
+ import { SmoSystemStaff } from '../data/systemStaff';
11
+ import { SvgBox, SvgPoint } from '../data/common';
12
+ /**
13
+ * Modifier tab is a modifier and its bounding box, that can be tabbed to with the keyboard
14
+ * @category SmoTransform
15
+ */
16
+ export interface ModifierTab {
17
+ modifier: SmoModifier;
18
+ selection: SmoSelection | null;
19
+ box: SvgBox;
20
+ index: number;
21
+ }
22
+ /**
23
+ * There are 2 parts to a selection: the actual musical bits that are selected, and the
24
+ * indices that define what was selected. This is the latter. The actual object does not
25
+ * have any methods so there is no constructor.
26
+ * @category SmoTransform
27
+ * */
28
+ export declare class SmoSelector {
29
+ static get default(): SmoSelector;
30
+ staff: number;
31
+ measure: number;
32
+ voice: number;
33
+ tick: number;
34
+ pitches: number[];
35
+ static measureSelector(staff: number, measure: number): SmoSelector;
36
+ static fromMeasure(measure: SmoMeasure): SmoSelector;
37
+ static sameNote(sel1: SmoSelector, sel2: SmoSelector): boolean;
38
+ static sameMeasure(sel1: SmoSelector, sel2: SmoSelector): boolean;
39
+ static sameStaff(sel1: SmoSelector, sel2: SmoSelector): boolean;
40
+ /**
41
+ * Return gt, not considering the voice (e.g. gt in time)
42
+ * @param sel1
43
+ * @param sel2
44
+ */
45
+ static gtInTime(sel1: SmoSelector, sel2: SmoSelector): boolean;
46
+ /**
47
+ * return true if sel1 > sel2
48
+ */
49
+ static gt(sel1: SmoSelector, sel2: SmoSelector): boolean;
50
+ static eq(sel1: SmoSelector, sel2: SmoSelector): boolean;
51
+ static neq(sel1: SmoSelector, sel2: SmoSelector): boolean;
52
+ /**
53
+ * return true if sel1 < sel2
54
+ */
55
+ static lt(sel1: SmoSelector, sel2: SmoSelector): boolean;
56
+ /**
57
+ * return true if sel1 >= sel2
58
+ */
59
+ static gteq(sel1: SmoSelector, sel2: SmoSelector): boolean;
60
+ /**
61
+ * return true if sel1 <= sel2
62
+ */
63
+ static lteq(sel1: SmoSelector, sel2: SmoSelector): boolean;
64
+ static order(a: SmoSelector, b: SmoSelector): SmoSelector[];
65
+ static getNoteKey(selector: SmoSelector): string;
66
+ static getMeasureKey(selector: SmoSelector): string;
67
+ static contains(testSel: SmoSelector, selStart: SmoSelector, selEnd: SmoSelector): boolean;
68
+ static overlaps(start1: SmoSelector, end1: SmoSelector, start2: SmoSelector, end2: SmoSelector): boolean;
69
+ static selectorNoteKey(selector: SmoSelector): string;
70
+ }
71
+ /**
72
+ * The fields in a selection. We have the 5 musical cardinal directions of staff, measure, note, pitches,
73
+ * and a selector. The pitches are indices
74
+ * @category SmoTransform
75
+ * */
76
+ export interface SmoSelectionParams {
77
+ selector: SmoSelector;
78
+ _staff: SmoSystemStaff;
79
+ _measure: SmoMeasure;
80
+ _note?: SmoNote;
81
+ _pitches?: number[];
82
+ type?: string;
83
+ box?: SvgBox;
84
+ }
85
+ /**
86
+ * A selection is a {@link SmoSelector} and a set of references to musical elements, like measure etc.
87
+ * The staff and measure are always a part of the selection, and possible a voice and note,
88
+ * and one or more pitches. Selections can also be made from the UI by clicking on an element
89
+ * or navigating to an element with the keyboard.
90
+ * @category SmoTransform
91
+ * */
92
+ export declare class SmoSelection {
93
+ selector: SmoSelector;
94
+ _staff: SmoSystemStaff;
95
+ _measure: SmoMeasure;
96
+ _note: SmoNote | null;
97
+ _pitches: number[];
98
+ box: SvgBox | null;
99
+ scrollBox: SvgPoint | null;
100
+ static measureSelection(score: SmoScore, staffIndex: number, measureIndex: number): SmoSelection | null;
101
+ static measuresInColumn(score: SmoScore, staffIndex: number): SmoSelection[];
102
+ static noteSelection(score: SmoScore, staffIndex: number, measureIndex: number, voiceIndex: number, tickIndex: number): SmoSelection | null;
103
+ static noteFromSelector(score: SmoScore, selector: SmoSelector): SmoSelection | null;
104
+ static selectionsToEnd(score: SmoScore, staff: number, startMeasure: number): SmoSelection[];
105
+ static selectionFromSelector(score: SmoScore, selector: SmoSelector): SmoSelection | null;
106
+ static pitchSelection(score: SmoScore, staffIndex: number, measureIndex: number, voiceIndex: number, tickIndex: number, pitches: number[]): SmoSelection;
107
+ /**
108
+ * Return the selection that is tickCount ticks after the current selection.
109
+ * @param score
110
+ * @param selection
111
+ * @param tickCount
112
+ * @returns
113
+ */
114
+ static advanceTicks(score: SmoScore, selection: SmoSelection, tickCount: number): SmoSelection | null;
115
+ /**
116
+ * Count the number of tick indices between selector 1 and selector 2;
117
+ * @param score
118
+ * @param sel1
119
+ * @param sel2
120
+ * @returns
121
+ */
122
+ static countTickIndices(score: SmoScore, sel1: SmoSelector, sel2: SmoSelector): number;
123
+ /**
124
+ * Count the number of tick indices between selector 1 and selector 2;
125
+ * @param score
126
+ * @param sel1
127
+ * @param sel2
128
+ * @returns
129
+ */
130
+ static countTicks(score: SmoScore, sel1: SmoSelector, sel2: SmoSelector): number;
131
+ static nextNoteSelectionIncludeVoice(score: SmoScore, staffIndex: number, measureIndex: number, voiceIndex: number, tickIndex: number): SmoSelection | null;
132
+ static nextNoteSelection(score: SmoScore, staffIndex: number, measureIndex: number, voiceIndex: number, tickIndex: number): SmoSelection | null;
133
+ /**
134
+ *
135
+ * @param score
136
+ * @param selector
137
+ * @returns
138
+ */
139
+ static innerSelections(score: SmoScore, startSelector: SmoSelector, endSelector: SmoSelector): SmoSelection[];
140
+ static nextNoteSelectionFromSelector(score: SmoScore, selector: SmoSelector): SmoSelection | null;
141
+ static lastNoteSelectionFromSelector(score: SmoScore, selector: SmoSelector): SmoSelection | null;
142
+ static lastNoteSelection(score: SmoScore, staffIndex: number, measureIndex: number, voiceIndex: number, tickIndex: number): SmoSelection | null;
143
+ static lastNoteSelectionNonRest(score: SmoScore, staffIndex: number, measureIndex: number, voiceIndex: number, tickIndex: number): SmoSelection | null;
144
+ static nextNoteSelectionNonRest(score: SmoScore, staffIndex: number, measureIndex: number, voiceIndex: number, tickIndex: number): SmoSelection | null;
145
+ static getMeasureList(selections: SmoSelection[]): SmoSelection[];
146
+ static getMeasuresBetween(score: SmoScore, fromSelector: SmoSelector, toSelector: SmoSelector): SmoSelection[];
147
+ static selectionsSameMeasure(selections: SmoSelection[]): boolean;
148
+ static selectionsSameStaff(selections: SmoSelection[]): boolean;
149
+ constructor(params: SmoSelectionParams);
150
+ get staff(): SmoSystemStaff;
151
+ get measure(): SmoMeasure;
152
+ get note(): SmoNote | null;
153
+ get pitches(): number[];
154
+ }
@@ -10,6 +10,7 @@ export declare class DisplaySettings extends SuiButton {
10
10
  handleKeyDown(ev: KeyEvent): void;
11
11
  enablePartSelection(): void;
12
12
  handleScoreChange(ev: any): void;
13
+ setView(): void;
13
14
  refresh(): void;
14
15
  zoomout(): void;
15
16
  zoomin(): void;