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
@@ -443,11 +443,11 @@ export interface SmoGlobalLayout {
443
443
  displayMode: displayMode
444
444
  }
445
445
 
446
- export function isSmoGlobalLayout(params: Partial<SmoGlobalLayout>): params is SmoGlobalLayout {
446
+ export function isSmoGlobalLayout(params: any): params is SmoGlobalLayout {
447
447
  const requiredAttributes: GlobalLayoutAttributes[] = ['svgScale', 'zoomScale', 'noteSpacing', 'pageWidth', 'pageHeight', 'proportionality', 'maxMeasureSystem', 'displayMode'];
448
448
  let rv = true;
449
449
  for (const attr in requiredAttributes) {
450
- if (typeof(params[attr]) === 'undefined') {
450
+ if (typeof(params[attr as any]) === 'undefined') {
451
451
  rv = false;
452
452
  break;
453
453
  } else {
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { ref, toRef, Ref, watch, reactive, computed } from 'vue';
2
+ import { ref, toRef, Ref, watch, reactive, computed, toDisplayString } from 'vue';
3
3
  import numberInputApp from './numberInput.vue';
4
4
  import { default as tsComponent } from './tsComponent.vue';
5
5
  import {
@@ -19,6 +19,8 @@ interface Props {
19
19
  cancelCb: () => Promise<void>
20
20
  }
21
21
  const props = defineProps<Props>();
22
+ const { domId, label, commitCb, cancelCb, } = { ...props };
23
+
22
24
  const timeSignature = props.timeSignature;
23
25
  watch(timeSignature, () => {
24
26
  console.log('changed!');
@@ -59,9 +61,28 @@ const applyToOptions: SelectOption[] = [{
59
61
  const applyTo: Ref<string> = ref('Selected');
60
62
 
61
63
 
62
- const { domId, label, commitCb, cancelCb, } = { ...props };
63
- const display = computed(() => timeSignature.value.display);
64
- const displayString = computed(() => timeSignature.value.displayString);
64
+ const display: Ref<boolean> = ref(false);
65
+ display.value = timeSignature.value.display;
66
+ watch(display, async (newValue: boolean , oldValue: boolean) => {
67
+ if (newValue === oldValue) {
68
+ return;
69
+ }
70
+ const ts = new SmoTimeSignature(timeSignature.value);
71
+ ts.display = newValue;
72
+ await props.updateTimeSignatureCb(ts);
73
+ });
74
+
75
+ const displayString: Ref<string> = ref('');
76
+ displayString.value = timeSignature.value.displayString;
77
+ watch(displayString, async (newValue: string, oldValue: string) => {
78
+ if (newValue === oldValue) {
79
+ return;
80
+ }
81
+ const ts = new SmoTimeSignature(timeSignature.value);
82
+ ts.displayString = newValue;
83
+ await props.updateTimeSignatureCb(ts);
84
+ });
85
+
65
86
  const getTsLabel = (ix: number) => {
66
87
  return ix === 0 ? 'Time' : 'Compound';
67
88
  }
@@ -1,102 +1,103 @@
1
- import { SmoConfiguration, SmoConfigurationParams } from './configuration';
2
- import { SmoScore } from '../smo/data/score';
3
- import { UndoBuffer } from '../smo/xform/undo';
4
- import { SuiRenderState } from '../render/sui/renderState';
5
- import { SuiScoreViewOperations } from '../render/sui/scoreViewOperations';
6
- import { SuiTracker } from '../render/sui/tracker';
7
- import { SuiMenuManager } from '../ui/menus/manager';
8
- import { BrowserEventSource } from '../ui/eventSource';
9
- import { RibbonButtons } from '../ui/buttons/ribbon';
10
- import { SuiKeyCommands } from './keyCommands';
11
- import { SuiEventHandler } from './eventHandler';
12
- import { KeyBinding } from './common';
13
- import { SuiNavigation } from '../render/sui/configuration';
14
- export interface pairType {
15
- [key: string]: string;
16
- }
17
- /**
18
- * Score renderer instance
19
- * @internal
20
- */
21
- export interface SuiRendererInstance {
22
- view: SuiScoreViewOperations;
23
- eventSource: BrowserEventSource;
24
- undoBuffer: UndoBuffer;
25
- renderer: SuiRenderState;
26
- }
27
- /**
28
- * Global instance for debugging
29
- * @internal
30
- */
31
- export interface SuiInstance {
32
- view: SuiScoreViewOperations;
33
- navigation: SuiNavigation;
34
- eventSource: BrowserEventSource;
35
- undoBuffer: UndoBuffer;
36
- tracker: SuiTracker;
37
- keyCommands: SuiKeyCommands;
38
- menus: SuiMenuManager;
39
- eventHandler: SuiEventHandler;
40
- ribbon: RibbonButtons;
41
- }
42
- /**
43
- * Parse query string for application
44
- * @category SuiApplication
45
- */
46
- export declare class QueryParser {
47
- pairs: pairType[];
48
- queryPair(str: string): pairType;
49
- constructor();
50
- }
51
- /** SuiApplication
52
- * main entry point of application. Based on the configuration,
53
- * either start the default UI, or initialize library mode and
54
- * await further instructions.
55
- * @category SuiApplication
56
- */
57
- export declare class SuiApplication {
58
- scoreLibrary: any;
59
- instance: SuiInstance | null;
60
- config: SmoConfiguration;
61
- score: SmoScore | null;
62
- navigation?: SuiNavigation;
63
- view: SuiScoreViewOperations | null;
64
- createUiDom(): void;
65
- static configure(params: Partial<SmoConfigurationParams>): Promise<SuiApplication>;
66
- constructor(config: SmoConfiguration);
67
- static instance: SuiInstance;
68
- static initSync(): void;
69
- /**
70
- // Different applications can create their own key bindings, these are the defaults.
71
- // Many editor commands can be reached by a single keystroke. For more advanced things there
72
- // are menus.
73
- */
74
- static get keyBindingDefaults(): KeyBinding[];
75
- /**
76
- * Initialize the library according to instruction in config object:
77
- * 1. Try to load a new score
78
- * 2. If in application mode, start the UI. If in translation mode, start translation
79
- * @returns
80
- */
81
- initialize(): Promise<SuiApplication>;
82
- /**
83
- * Create the initial score we use to populate the UI etc:
84
- * 0. if translation mode, return empty promise, it won't be used anyway
85
- * 1. if remoteScore is set in config, try to load from remote
86
- * 2. if initialScore is set, use that
87
- * 3. if a score is saved locally with quick save (browser local cache), use that
88
- * 4. if all else fails, return an 'empty' score.
89
- * @returns promise for a remote load. If a local load, will resolve immediately
90
- */
91
- createScore(): Promise<SmoScore | null>;
92
- tryParse(scoreJson: string): SmoScore;
93
- createView(score: SmoScore): SuiRendererInstance | null;
94
- /**
95
- * Convenience constructor, take the score and render it in the
96
- * configured rendering space.
97
- */
98
- createUi(): void;
99
- static loadMusicFont(face: string, url: string): Promise<void>;
100
- static registerFonts(): Promise<void>;
101
- static _deferLanguageSelection(lang: string): void;
102
- }
1
+ import { SmoConfiguration, SmoConfigurationParams } from './configuration';
2
+ import { SmoScore } from '../smo/data/score';
3
+ import { UndoBuffer } from '../smo/xform/undo';
4
+ import { SuiRenderState } from '../render/sui/renderState';
5
+ import { SuiScoreViewOperations } from '../render/sui/scoreViewOperations';
6
+ import { SuiTracker } from '../render/sui/tracker';
7
+ import { SuiMenuManager } from '../ui/menus/manager';
8
+ import { BrowserEventSource } from '../ui/eventSource';
9
+ import { RibbonButtons } from '../ui/buttons/ribbon';
10
+ import { SuiKeyCommands } from './keyCommands';
11
+ import { SuiEventHandler } from './eventHandler';
12
+ import { KeyBinding } from './common';
13
+ import { SuiNavigation } from '../render/sui/configuration';
14
+ export interface pairType {
15
+ [key: string]: string;
16
+ }
17
+ /**
18
+ * Score renderer instance
19
+ * @internal
20
+ */
21
+ export interface SuiRendererInstance {
22
+ view: SuiScoreViewOperations;
23
+ eventSource: BrowserEventSource;
24
+ undoBuffer: UndoBuffer;
25
+ renderer: SuiRenderState;
26
+ }
27
+ /**
28
+ * Global instance for debugging
29
+ * @internal
30
+ */
31
+ export interface SuiInstance {
32
+ view: SuiScoreViewOperations;
33
+ navigation: SuiNavigation;
34
+ eventSource: BrowserEventSource;
35
+ undoBuffer: UndoBuffer;
36
+ tracker: SuiTracker;
37
+ keyCommands: SuiKeyCommands;
38
+ menus: SuiMenuManager;
39
+ eventHandler: SuiEventHandler;
40
+ ribbon: RibbonButtons;
41
+ }
42
+ /**
43
+ * Parse query string for application
44
+ * @category SuiApplication
45
+ */
46
+ export declare class QueryParser {
47
+ pairs: pairType[];
48
+ queryPair(str: string): pairType;
49
+ constructor();
50
+ }
51
+ /** SuiApplication
52
+ * main entry point of application. Based on the configuration,
53
+ * either start the default UI, or initialize library mode and
54
+ * await further instructions.
55
+ * @category SuiApplication
56
+ */
57
+ export declare class SuiApplication {
58
+ scoreLibrary: any;
59
+ instance: SuiInstance | null;
60
+ config: SmoConfiguration;
61
+ score: SmoScore | null;
62
+ firstTimeUser: boolean;
63
+ navigation?: SuiNavigation;
64
+ view: SuiScoreViewOperations | null;
65
+ createUiDom(): void;
66
+ static configure(params: Partial<SmoConfigurationParams>): Promise<SuiApplication>;
67
+ constructor(config: SmoConfiguration);
68
+ static instance: SuiInstance;
69
+ static initSync(): void;
70
+ /**
71
+ // Different applications can create their own key bindings, these are the defaults.
72
+ // Many editor commands can be reached by a single keystroke. For more advanced things there
73
+ // are menus.
74
+ */
75
+ static get keyBindingDefaults(): KeyBinding[];
76
+ /**
77
+ * Initialize the library according to instruction in config object:
78
+ * 1. Try to load a new score
79
+ * 2. If in application mode, start the UI. If in translation mode, start translation
80
+ * @returns
81
+ */
82
+ initialize(): Promise<SuiApplication>;
83
+ /**
84
+ * Create the initial score we use to populate the UI etc:
85
+ * 0. if translation mode, return empty promise, it won't be used anyway
86
+ * 1. if remoteScore is set in config, try to load from remote
87
+ * 2. if initialScore is set, use that
88
+ * 3. if a score is saved locally with quick save (browser local cache), use that
89
+ * 4. if all else fails, return an 'empty' score.
90
+ * @returns promise for a remote load. If a local load, will resolve immediately
91
+ */
92
+ createScore(): Promise<SmoScore | null>;
93
+ tryParse(scoreJson: string): SmoScore;
94
+ createView(score: SmoScore): SuiRendererInstance | null;
95
+ /**
96
+ * Convenience constructor, take the score and render it in the
97
+ * configured rendering space.
98
+ */
99
+ createUi(): void;
100
+ static loadMusicFont(face: string, url: string): Promise<void>;
101
+ static registerFonts(): Promise<void>;
102
+ static _deferLanguageSelection(lang: string): void;
103
+ }
@@ -48,6 +48,8 @@ export declare abstract class ModalEventHandler {
48
48
  abstract mouseClick(ev: any): Promise<void>;
49
49
  abstract evKey(evdata: any): Promise<void>;
50
50
  abstract keyUp(evdata: any): void;
51
+ abstract mouseUp(ev: any): void;
52
+ abstract mouseDown(ev: any): void;
51
53
  }
52
54
  export type handler = (ev: any) => void;
53
55
  /**
@@ -63,12 +65,16 @@ export declare class ModalEventHandlerProxy {
63
65
  keyupHandler: EventHandler | null;
64
66
  mouseMoveHandler: EventHandler | null;
65
67
  mouseClickHandler: EventHandler | null;
68
+ mouseUpHandler: EventHandler | null;
69
+ mouseDownHandler: EventHandler | null;
66
70
  constructor(evSource: BrowserEventSource);
67
71
  set handler(value: ModalEventHandler);
68
72
  evKey(ev: any): Promise<void>;
69
73
  keyUp(ev: any): void;
70
74
  mouseMove(ev: any): void;
71
75
  mouseClick(ev: any): Promise<void>;
76
+ mouseUp(ev: any): void;
77
+ mouseDown(ev: any): void;
72
78
  bindEvents(): void;
73
79
  unbindKeyboardForModal(dialog: ModalComponent): void;
74
80
  }
@@ -1,75 +1,75 @@
1
- import { SmoScore } from "../smo/data/score";
2
- import { ModalEventHandler } from "./common";
3
- import { KeyBindingConfiguration, SmoUiConfiguration } from "../ui/configuration";
4
- import { RibbonLayout } from "../ui/common";
5
- import { ButtonDefinition } from "../ui/buttons/button";
6
- import { SuiAudioAnimationParams } from "../render/audio/musicCursor";
7
- export type SmoMode = 'library' | 'application' | 'translate';
8
- export type ConfigurationStringOption = 'language' | 'libraryUrl' | 'remoteScore';
9
- export type ConfigurationNumberOption = 'demonPollTime' | 'idleRedrawTime';
10
- export declare var ConfigurationStringOptions: ConfigurationStringOption[];
11
- export declare var ConfigurationNumberOptions: ConfigurationNumberOption[];
12
- /**
13
- * Application configuration parameters, can be referenced by the running application or changed
14
- * mode - whether this is a library or application (library does rendering, application starts the UI)
15
- * language - startup language
16
- * initialScore? - the library score JSON, if you are loading from a JSON string, or a SmoScore object
17
- * remoteScore? - path to a remote score, if loading from an URL
18
- * domContainer - the top-level of the UI, including the music and all the HTML controls. This must exist before the application starts.
19
- * scoreDomContainer - the parent of the actual score. In application mode, the application creates this.
20
- * navigation - creates scoreDomContainer under domContainer, along with other UI scaffolding.
21
- *
22
- * @category SuiApplication
23
- */
24
- export interface SmoConfigurationParams {
25
- mode: SmoMode;
26
- smoPath?: string;
27
- language: string;
28
- initialScore?: string | SmoScore;
29
- remoteScore?: string;
30
- domContainer: string | HTMLElement;
31
- leftControls?: string | HTMLElement;
32
- topControls?: string | HTMLElement;
33
- libraryUrl?: string;
34
- demonPollTime: number;
35
- idleRedrawTime: number;
36
- ribbonLayout?: RibbonLayout;
37
- buttonDefinition?: ButtonDefinition[];
38
- audioAnimation: SuiAudioAnimationParams;
39
- }
40
- /**
41
- * Configures smoosic library or application. It is a union of UI, rendering and application configuration parameters
42
- * @param mode - score mode `'library' | 'application' | 'translate'`
43
- * Library mode starts the view but not the UI. application mode starts the UI and expects UI parameters.
44
- * translation mode is the translation editor, for creating translations for dialog/menu components
45
- * @param language - startup language
46
- * @param initialScore? - the library score JSON, if you are loading from a JSON string, or a SmoScore object
47
- * @param remoteScore? - path to a remote score, if loading from an URL
48
- * @param scoreDomContainer - the parent of the svg container (required)
49
- * @param leftControls - the location of the vertical button control, applies if mode is 'application'
50
- * @param topControls - the location of the horizontal button control, applies if mode is 'application'
51
- * @param libraryUrl - loader URL for Smo libraries, applies if application mode
52
- * @param demonPollTime - how often we poll the score to see if it's changed
53
- * @param idleRedrawTime - how often the entire score re-renders
54
- * @category SuiApplication
55
- */
56
- export declare class SmoConfiguration implements SmoUiConfiguration {
57
- mode: SmoMode;
58
- language: string;
59
- domContainer?: string | HTMLElement;
60
- initialScore?: string | SmoScore;
61
- remoteScore?: string;
62
- leftControls?: string | HTMLElement;
63
- topControls?: string | HTMLElement;
64
- libraryUrl?: string;
65
- demonPollTime: number;
66
- idleRedrawTime: number;
67
- keys?: KeyBindingConfiguration;
68
- eventHandler?: ModalEventHandler;
69
- ribbonLayout: RibbonLayout;
70
- audioAnimation: SuiAudioAnimationParams;
71
- buttonDefinition: ButtonDefinition[];
72
- static get defaults(): SmoConfigurationParams;
73
- static get keyBindingDefaults(): KeyBindingConfiguration;
74
- constructor(params: Partial<SmoConfigurationParams>);
75
- }
1
+ import { SmoScore } from "../smo/data/score";
2
+ import { ModalEventHandler } from "./common";
3
+ import { KeyBindingConfiguration, SmoUiConfiguration } from "../ui/configuration";
4
+ import { RibbonLayout } from "../ui/common";
5
+ import { ButtonDefinition } from "../ui/buttons/button";
6
+ import { SuiAudioAnimationParams } from "../render/audio/musicCursor";
7
+ export type SmoMode = 'library' | 'application' | 'translate';
8
+ export type ConfigurationStringOption = 'language' | 'libraryUrl' | 'remoteScore';
9
+ export type ConfigurationNumberOption = 'demonPollTime' | 'idleRedrawTime';
10
+ export declare var ConfigurationStringOptions: ConfigurationStringOption[];
11
+ export declare var ConfigurationNumberOptions: ConfigurationNumberOption[];
12
+ /**
13
+ * Application configuration parameters, can be referenced by the running application or changed
14
+ * mode - whether this is a library or application (library does rendering, application starts the UI)
15
+ * language - startup language
16
+ * initialScore? - the library score JSON, if you are loading from a JSON string, or a SmoScore object
17
+ * remoteScore? - path to a remote score, if loading from an URL
18
+ * domContainer - the top-level of the UI, including the music and all the HTML controls. This must exist before the application starts.
19
+ * scoreDomContainer - the parent of the actual score. In application mode, the application creates this.
20
+ * navigation - creates scoreDomContainer under domContainer, along with other UI scaffolding.
21
+ *
22
+ * @category SuiApplication
23
+ */
24
+ export interface SmoConfigurationParams {
25
+ mode: SmoMode;
26
+ smoPath?: string;
27
+ language: string;
28
+ initialScore?: string | SmoScore;
29
+ remoteScore?: string;
30
+ domContainer: string | HTMLElement;
31
+ leftControls?: string | HTMLElement;
32
+ topControls?: string | HTMLElement;
33
+ libraryUrl?: string;
34
+ demonPollTime: number;
35
+ idleRedrawTime: number;
36
+ ribbonLayout?: RibbonLayout;
37
+ buttonDefinition?: ButtonDefinition[];
38
+ audioAnimation: SuiAudioAnimationParams;
39
+ }
40
+ /**
41
+ * Configures smoosic library or application. It is a union of UI, rendering and application configuration parameters
42
+ * @param mode - score mode `'library' | 'application' | 'translate'`
43
+ * Library mode starts the view but not the UI. application mode starts the UI and expects UI parameters.
44
+ * translation mode is the translation editor, for creating translations for dialog/menu components
45
+ * @param language - startup language
46
+ * @param initialScore? - the library score JSON, if you are loading from a JSON string, or a SmoScore object
47
+ * @param remoteScore? - path to a remote score, if loading from an URL
48
+ * @param scoreDomContainer - the parent of the svg container (required)
49
+ * @param leftControls - the location of the vertical button control, applies if mode is 'application'
50
+ * @param topControls - the location of the horizontal button control, applies if mode is 'application'
51
+ * @param libraryUrl - loader URL for Smo libraries, applies if application mode
52
+ * @param demonPollTime - how often we poll the score to see if it's changed
53
+ * @param idleRedrawTime - how often the entire score re-renders
54
+ * @category SuiApplication
55
+ */
56
+ export declare class SmoConfiguration implements SmoUiConfiguration {
57
+ mode: SmoMode;
58
+ language: string;
59
+ domContainer?: string | HTMLElement;
60
+ initialScore?: string | SmoScore;
61
+ remoteScore?: string;
62
+ leftControls?: string | HTMLElement;
63
+ topControls?: string | HTMLElement;
64
+ libraryUrl?: string;
65
+ demonPollTime: number;
66
+ idleRedrawTime: number;
67
+ keys?: KeyBindingConfiguration;
68
+ eventHandler?: ModalEventHandler;
69
+ ribbonLayout: RibbonLayout;
70
+ audioAnimation: SuiAudioAnimationParams;
71
+ buttonDefinition: ButtonDefinition[];
72
+ static get defaults(): SmoConfigurationParams;
73
+ static get keyBindingDefaults(): KeyBindingConfiguration;
74
+ constructor(params: Partial<SmoConfigurationParams>);
75
+ }
@@ -1,6 +1,6 @@
1
- /**
2
- * Dynamic constructors are factories for UI elements (dialogs, menus) that control musical elements (e.g. slur, dynamics etc).
3
- * We create them before the score,
4
- * so that when the score is rendered, elements of the score can be bound to the appropriate UI elements.
5
- */
6
- export declare const createDialogFactories: () => void;
1
+ /**
2
+ * Dynamic constructors are factories for UI elements (dialogs, menus) that control musical elements (e.g. slur, dynamics etc).
3
+ * We create them before the score,
4
+ * so that when the score is rendered, elements of the score can be bound to the appropriate UI elements.
5
+ */
6
+ export declare const createDialogFactories: () => void;
@@ -1,81 +1,87 @@
1
- import { KeyEvent } from '../smo/data/common';
2
- import { SuiExceptionHandler } from '../ui/exceptions';
3
- import { Qwerty } from '../ui/qwerty';
4
- import { SuiPiano } from '../render/sui/piano';
5
- import { CompleteNotifier } from '../ui/common';
6
- import { SuiTracker } from '../render/sui/tracker';
7
- import { SuiScoreViewOperations } from '../render/sui/scoreViewOperations';
8
- import { BrowserEventSource } from '../ui/eventSource';
9
- import { SuiKeyCommands } from './keyCommands';
10
- import { KeyBinding, ModalEventHandler } from './common';
11
- import { ModifierTab } from '../smo/xform/selections';
12
- import { SuiMenuManager } from '../ui/menus/manager';
13
- import { SmoConfiguration } from './configuration';
14
- import { SuiNavigation } from '../render/sui/configuration';
15
- /**
16
- * Handle keyboard/mouse events, and pass them to the renderer and other UI elements.
17
- * @category SuiApplication
18
- */
19
- export interface EventHandlerParams {
20
- view: SuiScoreViewOperations;
21
- eventSource: BrowserEventSource;
22
- tracker: SuiTracker;
23
- navigation: SuiNavigation;
24
- keyCommands: SuiKeyCommands;
25
- menus: SuiMenuManager;
26
- completeNotifier: CompleteNotifier;
27
- keyBindings: KeyBinding[];
28
- config: SmoConfiguration;
29
- }
30
- /**
31
- * this is the default keyboard/mouse handler for smoosic in application mode.
32
- * It diverts key events to tracker or key commmands as appropriate, and mouse events to
33
- * tracker. Modal elements take this control away temporarily.
34
- *
35
- * It also handles some global events such as window resize and scroll of the music region.
36
- * @category SuiApplication
37
- */
38
- export declare class SuiEventHandler implements ModalEventHandler {
39
- static reentry: boolean;
40
- static keyboardUi: Qwerty;
41
- static showQwerty(): void;
42
- static instance: SuiEventHandler;
43
- static debugMask: number;
44
- static altKeyPressed: boolean;
45
- static ctrlKeyPressed: boolean;
46
- static shiftKeyPressed: boolean;
47
- view: SuiScoreViewOperations;
48
- eventSource: BrowserEventSource;
49
- tracker: SuiTracker;
50
- keyBind: KeyBinding[];
51
- completeNotifier: CompleteNotifier;
52
- keyCommands: SuiKeyCommands;
53
- resizing: boolean;
54
- undoStatus: number;
55
- trackScrolling: boolean;
56
- config: SmoConfiguration;
57
- keyHandlerObj: any;
58
- menus: SuiMenuManager;
59
- piano: SuiPiano | null;
60
- exhandler: SuiExceptionHandler;
61
- navigation: SuiNavigation;
62
- constructor(params: EventHandlerParams);
63
- private handleScrollEventDefer;
64
- handleScrollEvent(): void;
65
- createPiano(): void;
66
- resizeEvent(): void;
67
- createModifierDialog(modifierSelection: ModifierTab): import("./exports").SuiDialogBase | null;
68
- trackerModifierSelect(ev: KeyEvent): void;
69
- bindResize(): void;
70
- get renderElement(): Element;
71
- static get editorKeyBindingDefaults(): KeyBinding[];
72
- static get trackerKeyBindingDefaults(): KeyBinding[];
73
- helpControls(): void;
74
- menuHelp(): void;
75
- keyUp(evdata: any): void;
76
- handleMetaKeyDown(evdata: any): void;
77
- evKey(evdata: any): Promise<void>;
78
- mouseMove(ev: any): void;
79
- mouseClick(ev: any): Promise<void>;
80
- bindEvents(): void;
81
- }
1
+ import { KeyEvent } from '../smo/data/common';
2
+ import { SuiExceptionHandler } from '../ui/exceptions';
3
+ import { Qwerty } from '../ui/qwerty';
4
+ import { SuiPiano } from '../render/sui/piano';
5
+ import { CompleteNotifier } from '../ui/common';
6
+ import { SuiTracker } from '../render/sui/tracker';
7
+ import { SuiScoreViewOperations } from '../render/sui/scoreViewOperations';
8
+ import { BrowserEventSource } from '../ui/eventSource';
9
+ import { SuiKeyCommands } from './keyCommands';
10
+ import { KeyBinding, ModalEventHandler } from './common';
11
+ import { ModifierTab } from '../smo/xform/selections';
12
+ import { SuiMenuManager } from '../ui/menus/manager';
13
+ import { SmoConfiguration } from './configuration';
14
+ import { NoteEntryCaret } from '../render/sui/NoteEntryCaret';
15
+ import { NoteEntryMediator } from "../render/sui/NoteEntryMediator";
16
+ import { SuiNavigation } from '../render/sui/configuration';
17
+ /**
18
+ * Handle keyboard/mouse events, and pass them to the renderer and other UI elements.
19
+ * @category SuiApplication
20
+ */
21
+ export interface EventHandlerParams {
22
+ view: SuiScoreViewOperations;
23
+ eventSource: BrowserEventSource;
24
+ tracker: SuiTracker;
25
+ navigation: SuiNavigation;
26
+ keyCommands: SuiKeyCommands;
27
+ menus: SuiMenuManager;
28
+ completeNotifier: CompleteNotifier;
29
+ keyBindings: KeyBinding[];
30
+ config: SmoConfiguration;
31
+ }
32
+ /**
33
+ * this is the default keyboard/mouse handler for smoosic in application mode.
34
+ * It diverts key events to tracker or key commmands as appropriate, and mouse events to
35
+ * tracker. Modal elements take this control away temporarily.
36
+ *
37
+ * It also handles some global events such as window resize and scroll of the music region.
38
+ * @category SuiApplication
39
+ */
40
+ export declare class SuiEventHandler implements ModalEventHandler {
41
+ static reentry: boolean;
42
+ static keyboardUi: Qwerty;
43
+ static showQwerty(): void;
44
+ static instance: SuiEventHandler;
45
+ static debugMask: number;
46
+ static altKeyPressed: boolean;
47
+ static ctrlKeyPressed: boolean;
48
+ static shiftKeyPressed: boolean;
49
+ view: SuiScoreViewOperations;
50
+ eventSource: BrowserEventSource;
51
+ tracker: SuiTracker;
52
+ keyBind: KeyBinding[];
53
+ completeNotifier: CompleteNotifier;
54
+ keyCommands: SuiKeyCommands;
55
+ resizing: boolean;
56
+ undoStatus: number;
57
+ trackScrolling: boolean;
58
+ config: SmoConfiguration;
59
+ keyHandlerObj: any;
60
+ menus: SuiMenuManager;
61
+ piano: SuiPiano | null;
62
+ exhandler: SuiExceptionHandler;
63
+ navigation: SuiNavigation;
64
+ noteEntryCaret: NoteEntryCaret;
65
+ noteEntryMediator: NoteEntryMediator;
66
+ constructor(params: EventHandlerParams);
67
+ private handleScrollEventDefer;
68
+ handleScrollEvent(): void;
69
+ createPiano(): void;
70
+ resizeEvent(): void;
71
+ createModifierDialog(modifierSelection: ModifierTab): import("./exports").SuiDialogBase | null;
72
+ trackerModifierSelect(ev: KeyEvent): void;
73
+ bindResize(): void;
74
+ get renderElement(): Element;
75
+ static get editorKeyBindingDefaults(): KeyBinding[];
76
+ static get trackerKeyBindingDefaults(): KeyBinding[];
77
+ helpControls(): void;
78
+ menuHelp(): void;
79
+ keyUp(evdata: any): void;
80
+ handleMetaKeyDown(evdata: any): void;
81
+ evKey(evdata: any): Promise<void>;
82
+ mouseMove(ev: any): void;
83
+ mouseClick(ev: any): Promise<void>;
84
+ mouseUp(ev: any): void;
85
+ mouseDown(ev: any): Promise<void>;
86
+ bindEvents(): void;
87
+ }