@tspro/web-music-score 5.0.0 → 5.2.0
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.
- package/CHANGELOG.md +27 -0
- package/README.md +16 -13
- package/dist/audio/index.d.mts +15 -2
- package/dist/audio/index.d.ts +16 -3
- package/dist/audio/index.js +37 -78
- package/dist/audio/index.mjs +34 -68
- package/dist/audio-cg/index.d.mts +6 -1
- package/dist/audio-cg/index.d.ts +6 -1
- package/dist/audio-cg/index.js +1 -1
- package/dist/audio-cg/index.mjs +3 -3
- package/dist/audio-synth/index.d.mts +15 -0
- package/dist/audio-synth/index.d.ts +15 -0
- package/dist/audio-synth/index.js +95 -0
- package/dist/audio-synth/index.mjs +58 -0
- package/dist/{chunk-AAL3CMRO.mjs → chunk-6S5BDSCM.mjs} +2 -2
- package/dist/{chunk-J3KU3U4W.mjs → chunk-LC5JMIVF.mjs} +2 -2
- package/dist/{chunk-EYFT3RWB.mjs → chunk-XUGM7SCC.mjs} +5 -6
- package/dist/core/index.js +2 -2
- package/dist/core/index.mjs +3 -3
- package/dist/{guitar-CaZJDA05.d.ts → guitar-BsSayRsH.d.ts} +1 -1
- package/dist/iife/audio-cg.global.js +9 -2
- package/dist/iife/index.global.js +11 -11
- package/dist/{music-objects-3Hxlkxy6.d.mts → music-objects-CB05XryE.d.mts} +121 -45
- package/dist/{music-objects-CI7IjsjE.d.ts → music-objects-CwPOlqFi.d.ts} +123 -47
- package/dist/{note-eA2xPPiG.d.ts → note-CgCIBwvR.d.ts} +1 -1
- package/dist/pieces/index.d.mts +1 -1
- package/dist/pieces/index.d.ts +3 -3
- package/dist/pieces/index.js +1 -1
- package/dist/pieces/index.mjs +2 -2
- package/dist/react-ui/index.d.mts +34 -15
- package/dist/react-ui/index.d.ts +38 -19
- package/dist/react-ui/index.js +41 -32
- package/dist/react-ui/index.mjs +42 -33
- package/dist/{scale-DGx3tJH4.d.ts → scale-CBW4eTz7.d.ts} +2 -2
- package/dist/score/index.d.mts +2 -2
- package/dist/score/index.d.ts +5 -5
- package/dist/score/index.js +1951 -1514
- package/dist/score/index.mjs +1664 -1226
- package/dist/{tempo-GrstpD9G.d.ts → tempo-DMt3iwz9.d.ts} +1 -1
- package/dist/theory/index.d.ts +6 -6
- package/dist/theory/index.js +3 -4
- package/dist/theory/index.mjs +3 -3
- package/package.json +12 -2
|
@@ -288,7 +288,7 @@ declare class Note {
|
|
|
288
288
|
* @param b - Note b.
|
|
289
289
|
* @returns - -1, 0 or 1.
|
|
290
290
|
*/
|
|
291
|
-
static compareFunc(a: Note, b: Note): 1 |
|
|
291
|
+
static compareFunc(a: Note, b: Note): 1 | -1 | 0;
|
|
292
292
|
}
|
|
293
293
|
|
|
294
294
|
export { type Accidental as A, DefaultPitchNotation as D, GuitarNoteLabel as G, Note as N, type ParsedNote as P, SymbolSet as S, type NoteLetter as a, PitchNotation as b, PitchNotationList as c, DefaultGuitarNoteLabel as d, GuitarNoteLabelList as e, validateGuitarNoteLabel as f, getPitchNotationName as g, validatePitchNotation as v };
|
package/dist/pieces/index.d.mts
CHANGED
package/dist/pieces/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { M as MDocument } from '../music-objects-
|
|
2
|
-
import '../note-
|
|
3
|
-
import '../tempo-
|
|
1
|
+
import { M as MDocument } from '../music-objects-CwPOlqFi.js';
|
|
2
|
+
import '../note-CgCIBwvR.js';
|
|
3
|
+
import '../tempo-DMt3iwz9.js';
|
|
4
4
|
import '@tspro/ts-utils-lib';
|
|
5
5
|
|
|
6
6
|
/**
|
package/dist/pieces/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* WebMusicScore v5.
|
|
1
|
+
/* WebMusicScore v5.2.0 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
|
|
2
2
|
"use strict";
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
package/dist/pieces/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* WebMusicScore v5.
|
|
2
|
-
import "../chunk-
|
|
1
|
+
/* WebMusicScore v5.2.0 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
|
|
2
|
+
import "../chunk-LC5JMIVF.mjs";
|
|
3
3
|
|
|
4
4
|
// src/pieces/frere-jacques.ts
|
|
5
5
|
import { DocumentBuilder } from "@tspro/web-music-score/score";
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { c as Scale, S as ScaleType } from '../scale-DQP3b9Zx.mjs';
|
|
4
4
|
import { b as PitchNotation, G as GuitarNoteLabel, N as Note } from '../note-eA2xPPiG.mjs';
|
|
5
5
|
import { H as Handedness } from '../guitar-DdexKdN6.mjs';
|
|
6
|
-
import { D as DivRect, M as MDocument, n as ScoreEventListener, p as MRenderer, q as MPlaybackButtons } from '../music-objects-
|
|
6
|
+
import { D as DivRect, M as MDocument, n as ScoreEventListener, p as MRenderer, q as MPlaybackButtons } from '../music-objects-CB05XryE.mjs';
|
|
7
7
|
import '../tempo-dkctPkCS.mjs';
|
|
8
8
|
import '@tspro/ts-utils-lib';
|
|
9
9
|
|
|
@@ -236,15 +236,18 @@ interface MusicScoreViewProps {
|
|
|
236
236
|
* Music score view react component.
|
|
237
237
|
* ```ts
|
|
238
238
|
* // Using with React TSX/JSX
|
|
239
|
-
* import * as Score from "@tspro/web-music-score/
|
|
240
|
-
* import * as
|
|
239
|
+
* import * as Score from "@tspro/web-music-score/score";
|
|
240
|
+
* import * as ScoreUI from "@tspro/web-music-score/react-ui";
|
|
241
241
|
*
|
|
242
242
|
* // Render function of react component.
|
|
243
243
|
* render() {
|
|
244
|
-
*
|
|
244
|
+
* // Create document.
|
|
245
|
+
* const doc = new Score.DocumentBuilder()
|
|
246
|
+
* // Build document...
|
|
247
|
+
* .getDocument();
|
|
245
248
|
*
|
|
246
249
|
* return <>
|
|
247
|
-
* <
|
|
250
|
+
* <ScoreUI.MusicScoreView doc={doc} />
|
|
248
251
|
* </>;
|
|
249
252
|
* }
|
|
250
253
|
* ```
|
|
@@ -256,6 +259,10 @@ declare class MusicScoreView extends React.Component<MusicScoreViewProps, {}> {
|
|
|
256
259
|
render(): react_jsx_runtime.JSX.Element;
|
|
257
260
|
}
|
|
258
261
|
|
|
262
|
+
/**
|
|
263
|
+
* Playback buttons layout
|
|
264
|
+
* @deprecated - Use `PlaybackButtonsProps` properties `singlePlayStop`, `playStop` or `playPauseStop` instead.
|
|
265
|
+
*/
|
|
259
266
|
declare enum PlaybackButtonsLayout {
|
|
260
267
|
PlayStopSingle = 0,
|
|
261
268
|
PlayStop = 1,
|
|
@@ -263,7 +270,11 @@ declare enum PlaybackButtonsLayout {
|
|
|
263
270
|
}
|
|
264
271
|
interface PlaybackButtonsProps {
|
|
265
272
|
doc: MDocument;
|
|
273
|
+
/** @deprecated - Use `singlePlayStop`, `playStop` or `playPauseStop` properties instead. */
|
|
266
274
|
buttonLayout?: PlaybackButtonsLayout;
|
|
275
|
+
singlePlayStop?: boolean;
|
|
276
|
+
playStop?: boolean;
|
|
277
|
+
playPauseStop?: boolean;
|
|
267
278
|
playLabel?: string;
|
|
268
279
|
pauseLabel?: string;
|
|
269
280
|
stopLabel?: string;
|
|
@@ -275,20 +286,28 @@ interface PlaybackButtonsState {
|
|
|
275
286
|
* Usage:
|
|
276
287
|
* ```ts
|
|
277
288
|
* // Using with React TSX/JSX
|
|
278
|
-
* import * as Score from "
|
|
279
|
-
* import * as
|
|
289
|
+
* import * as Score from "@tspro/web-music-score/score";
|
|
290
|
+
* import * as ScoreUI from "@tspro/web-music-score/react-ui";
|
|
291
|
+
*
|
|
292
|
+
* // Create document.
|
|
293
|
+
* const doc = new Score.DocumentBuilder()
|
|
294
|
+
* // Build document...
|
|
295
|
+
* .getDocument();
|
|
296
|
+
*
|
|
297
|
+
* // Create default playback buttons (play, pause and stop buttons).
|
|
298
|
+
* <ScoreUI.PlaybackButtons doc={doc} />
|
|
280
299
|
*
|
|
281
|
-
* // Create
|
|
282
|
-
*
|
|
300
|
+
* // Create playback buttons with single play/stop button.
|
|
301
|
+
* <ScoreUI.PlaybackButtons doc={doc} singlePlayStop />
|
|
283
302
|
*
|
|
284
|
-
* // Create
|
|
285
|
-
* <
|
|
303
|
+
* // Create playback buttons with play and stop buttons.
|
|
304
|
+
* <ScoreUI.PlaybackButtons doc={doc} playStop />
|
|
286
305
|
*
|
|
287
|
-
* // Create playback buttons with
|
|
288
|
-
* <
|
|
306
|
+
* // Create playback buttons with play, pause and stop buttons.
|
|
307
|
+
* <ScoreUI.PlaybackButtons doc={doc} playPauseStop />
|
|
289
308
|
*
|
|
290
|
-
* //
|
|
291
|
-
* <
|
|
309
|
+
* // You can also set custom play, pause and stop button labels.
|
|
310
|
+
* <ScoreUI.PlaybackButtons doc={doc} playLabel="⏵" pauseLabel="⏸" stopLabel="⏹" />
|
|
292
311
|
* ```
|
|
293
312
|
*/
|
|
294
313
|
declare class PlaybackButtons extends React.Component<PlaybackButtonsProps, PlaybackButtonsState> {
|
package/dist/react-ui/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { c as Scale, S as ScaleType } from '../scale-
|
|
4
|
-
import { b as PitchNotation, G as GuitarNoteLabel, N as Note } from '../note-
|
|
5
|
-
import { H as Handedness } from '../guitar-
|
|
6
|
-
import { D as DivRect, M as MDocument, n as ScoreEventListener, p as MRenderer, q as MPlaybackButtons } from '../music-objects-
|
|
7
|
-
import '../tempo-
|
|
3
|
+
import { c as Scale, S as ScaleType } from '../scale-CBW4eTz7.js';
|
|
4
|
+
import { b as PitchNotation, G as GuitarNoteLabel, N as Note } from '../note-CgCIBwvR.js';
|
|
5
|
+
import { H as Handedness } from '../guitar-BsSayRsH.js';
|
|
6
|
+
import { D as DivRect, M as MDocument, n as ScoreEventListener, p as MRenderer, q as MPlaybackButtons } from '../music-objects-CwPOlqFi.js';
|
|
7
|
+
import '../tempo-DMt3iwz9.js';
|
|
8
8
|
import '@tspro/ts-utils-lib';
|
|
9
9
|
|
|
10
10
|
interface CircleOfFifthsProps {
|
|
@@ -236,15 +236,18 @@ interface MusicScoreViewProps {
|
|
|
236
236
|
* Music score view react component.
|
|
237
237
|
* ```ts
|
|
238
238
|
* // Using with React TSX/JSX
|
|
239
|
-
* import * as Score from "@tspro/web-music-score/
|
|
240
|
-
* import * as
|
|
239
|
+
* import * as Score from "@tspro/web-music-score/score";
|
|
240
|
+
* import * as ScoreUI from "@tspro/web-music-score/react-ui";
|
|
241
241
|
*
|
|
242
242
|
* // Render function of react component.
|
|
243
243
|
* render() {
|
|
244
|
-
*
|
|
244
|
+
* // Create document.
|
|
245
|
+
* const doc = new Score.DocumentBuilder()
|
|
246
|
+
* // Build document...
|
|
247
|
+
* .getDocument();
|
|
245
248
|
*
|
|
246
249
|
* return <>
|
|
247
|
-
* <
|
|
250
|
+
* <ScoreUI.MusicScoreView doc={doc} />
|
|
248
251
|
* </>;
|
|
249
252
|
* }
|
|
250
253
|
* ```
|
|
@@ -256,6 +259,10 @@ declare class MusicScoreView extends React.Component<MusicScoreViewProps, {}> {
|
|
|
256
259
|
render(): react_jsx_runtime.JSX.Element;
|
|
257
260
|
}
|
|
258
261
|
|
|
262
|
+
/**
|
|
263
|
+
* Playback buttons layout
|
|
264
|
+
* @deprecated - Use `PlaybackButtonsProps` properties `singlePlayStop`, `playStop` or `playPauseStop` instead.
|
|
265
|
+
*/
|
|
259
266
|
declare enum PlaybackButtonsLayout {
|
|
260
267
|
PlayStopSingle = 0,
|
|
261
268
|
PlayStop = 1,
|
|
@@ -263,7 +270,11 @@ declare enum PlaybackButtonsLayout {
|
|
|
263
270
|
}
|
|
264
271
|
interface PlaybackButtonsProps {
|
|
265
272
|
doc: MDocument;
|
|
273
|
+
/** @deprecated - Use `singlePlayStop`, `playStop` or `playPauseStop` properties instead. */
|
|
266
274
|
buttonLayout?: PlaybackButtonsLayout;
|
|
275
|
+
singlePlayStop?: boolean;
|
|
276
|
+
playStop?: boolean;
|
|
277
|
+
playPauseStop?: boolean;
|
|
267
278
|
playLabel?: string;
|
|
268
279
|
pauseLabel?: string;
|
|
269
280
|
stopLabel?: string;
|
|
@@ -275,20 +286,28 @@ interface PlaybackButtonsState {
|
|
|
275
286
|
* Usage:
|
|
276
287
|
* ```ts
|
|
277
288
|
* // Using with React TSX/JSX
|
|
278
|
-
* import * as Score from "
|
|
279
|
-
* import * as
|
|
289
|
+
* import * as Score from "@tspro/web-music-score/score";
|
|
290
|
+
* import * as ScoreUI from "@tspro/web-music-score/react-ui";
|
|
291
|
+
*
|
|
292
|
+
* // Create document.
|
|
293
|
+
* const doc = new Score.DocumentBuilder()
|
|
294
|
+
* // Build document...
|
|
295
|
+
* .getDocument();
|
|
296
|
+
*
|
|
297
|
+
* // Create default playback buttons (play, pause and stop buttons).
|
|
298
|
+
* <ScoreUI.PlaybackButtons doc={doc} />
|
|
280
299
|
*
|
|
281
|
-
* // Create
|
|
282
|
-
*
|
|
300
|
+
* // Create playback buttons with single play/stop button.
|
|
301
|
+
* <ScoreUI.PlaybackButtons doc={doc} singlePlayStop />
|
|
283
302
|
*
|
|
284
|
-
* // Create
|
|
285
|
-
* <
|
|
303
|
+
* // Create playback buttons with play and stop buttons.
|
|
304
|
+
* <ScoreUI.PlaybackButtons doc={doc} playStop />
|
|
286
305
|
*
|
|
287
|
-
* // Create playback buttons with
|
|
288
|
-
* <
|
|
306
|
+
* // Create playback buttons with play, pause and stop buttons.
|
|
307
|
+
* <ScoreUI.PlaybackButtons doc={doc} playPauseStop />
|
|
289
308
|
*
|
|
290
|
-
* //
|
|
291
|
-
* <
|
|
309
|
+
* // You can also set custom play, pause and stop button labels.
|
|
310
|
+
* <ScoreUI.PlaybackButtons doc={doc} playLabel="⏵" pauseLabel="⏸" stopLabel="⏹" />
|
|
292
311
|
* ```
|
|
293
312
|
*/
|
|
294
313
|
declare class PlaybackButtons extends React.Component<PlaybackButtonsProps, PlaybackButtonsState> {
|
package/dist/react-ui/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* WebMusicScore v5.
|
|
1
|
+
/* WebMusicScore v5.2.0 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
|
|
2
2
|
"use strict";
|
|
3
3
|
var __create = Object.create;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -621,7 +621,7 @@ var MusicScoreView = class extends React3.Component {
|
|
|
621
621
|
this.renderer.draw();
|
|
622
622
|
}
|
|
623
623
|
};
|
|
624
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("canvas", { style: { position: "relative" }, ref: setCanvas, children: "
|
|
624
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("canvas", { style: { position: "relative" }, ref: setCanvas, children: "Your browser does not support the HTML canvas tag." });
|
|
625
625
|
}
|
|
626
626
|
};
|
|
627
627
|
|
|
@@ -649,37 +649,46 @@ var PlaybackButtons = class extends React4.Component {
|
|
|
649
649
|
}
|
|
650
650
|
}
|
|
651
651
|
render() {
|
|
652
|
-
let { buttonLayout, playLabel, pauseLabel, stopLabel } = this.props;
|
|
652
|
+
let { buttonLayout, singlePlayStop, playStop, playPauseStop, playLabel, pauseLabel, stopLabel } = this.props;
|
|
653
653
|
let { controller } = this.state;
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
if (buttonLayout
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
654
|
+
playLabel != null ? playLabel : playLabel = "Play";
|
|
655
|
+
pauseLabel != null ? pauseLabel : pauseLabel = "Pause";
|
|
656
|
+
stopLabel != null ? stopLabel : stopLabel = "Stop";
|
|
657
|
+
if (singlePlayStop) buttonLayout = 0 /* PlayStopSingle */;
|
|
658
|
+
if (playStop) buttonLayout = 1 /* PlayStop */;
|
|
659
|
+
if (playPauseStop) buttonLayout = 2 /* PlayPauseStop */;
|
|
660
|
+
buttonLayout != null ? buttonLayout : buttonLayout = 2 /* PlayPauseStop */;
|
|
661
|
+
switch (buttonLayout) {
|
|
662
|
+
case 0 /* PlayStopSingle */:
|
|
663
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { className: "btn btn-primary", ref: (btn) => {
|
|
664
|
+
if (btn) controller.setPlayStopButton(btn, playLabel, stopLabel);
|
|
665
|
+
} });
|
|
666
|
+
case 1 /* PlayStop */:
|
|
667
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "btn-group", children: [
|
|
668
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { className: "btn btn-primary", ref: (btn) => {
|
|
669
|
+
if (btn) controller.setPlayButton(btn, playLabel);
|
|
670
|
+
} }),
|
|
671
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { className: "btn btn-primary", ref: (btn) => {
|
|
672
|
+
if (btn) controller.setStopButton(btn, stopLabel);
|
|
673
|
+
} })
|
|
674
|
+
] });
|
|
675
|
+
case 2 /* PlayPauseStop */:
|
|
676
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "btn-group", children: [
|
|
677
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { className: "btn btn-primary", ref: (btn) => {
|
|
678
|
+
if (btn) controller.setPlayButton(btn, playLabel);
|
|
679
|
+
} }),
|
|
680
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { className: "btn btn-primary", ref: (btn) => {
|
|
681
|
+
if (btn) controller.setPauseButton(btn, pauseLabel);
|
|
682
|
+
} }),
|
|
683
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { className: "btn btn-primary", ref: (btn) => {
|
|
684
|
+
if (btn) controller.setStopButton(btn, stopLabel);
|
|
685
|
+
} })
|
|
686
|
+
] });
|
|
687
|
+
default:
|
|
688
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
|
|
689
|
+
"Invalid button layout: ",
|
|
690
|
+
buttonLayout
|
|
691
|
+
] });
|
|
683
692
|
}
|
|
684
693
|
}
|
|
685
694
|
};
|
package/dist/react-ui/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/* WebMusicScore v5.
|
|
1
|
+
/* WebMusicScore v5.2.0 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
|
|
2
2
|
import {
|
|
3
3
|
__publicField
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-LC5JMIVF.mjs";
|
|
5
5
|
|
|
6
6
|
// src/react-ui/circle-of-fifths.tsx
|
|
7
7
|
import * as React from "react";
|
|
@@ -580,7 +580,7 @@ var MusicScoreView = class extends React3.Component {
|
|
|
580
580
|
this.renderer.draw();
|
|
581
581
|
}
|
|
582
582
|
};
|
|
583
|
-
return /* @__PURE__ */ jsx3("canvas", { style: { position: "relative" }, ref: setCanvas, children: "
|
|
583
|
+
return /* @__PURE__ */ jsx3("canvas", { style: { position: "relative" }, ref: setCanvas, children: "Your browser does not support the HTML canvas tag." });
|
|
584
584
|
}
|
|
585
585
|
};
|
|
586
586
|
|
|
@@ -608,37 +608,46 @@ var PlaybackButtons = class extends React4.Component {
|
|
|
608
608
|
}
|
|
609
609
|
}
|
|
610
610
|
render() {
|
|
611
|
-
let { buttonLayout, playLabel, pauseLabel, stopLabel } = this.props;
|
|
611
|
+
let { buttonLayout, singlePlayStop, playStop, playPauseStop, playLabel, pauseLabel, stopLabel } = this.props;
|
|
612
612
|
let { controller } = this.state;
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
if (buttonLayout
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
/* @__PURE__ */
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
/* @__PURE__ */
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
613
|
+
playLabel != null ? playLabel : playLabel = "Play";
|
|
614
|
+
pauseLabel != null ? pauseLabel : pauseLabel = "Pause";
|
|
615
|
+
stopLabel != null ? stopLabel : stopLabel = "Stop";
|
|
616
|
+
if (singlePlayStop) buttonLayout = 0 /* PlayStopSingle */;
|
|
617
|
+
if (playStop) buttonLayout = 1 /* PlayStop */;
|
|
618
|
+
if (playPauseStop) buttonLayout = 2 /* PlayPauseStop */;
|
|
619
|
+
buttonLayout != null ? buttonLayout : buttonLayout = 2 /* PlayPauseStop */;
|
|
620
|
+
switch (buttonLayout) {
|
|
621
|
+
case 0 /* PlayStopSingle */:
|
|
622
|
+
return /* @__PURE__ */ jsx4("button", { className: "btn btn-primary", ref: (btn) => {
|
|
623
|
+
if (btn) controller.setPlayStopButton(btn, playLabel, stopLabel);
|
|
624
|
+
} });
|
|
625
|
+
case 1 /* PlayStop */:
|
|
626
|
+
return /* @__PURE__ */ jsxs("div", { className: "btn-group", children: [
|
|
627
|
+
/* @__PURE__ */ jsx4("button", { className: "btn btn-primary", ref: (btn) => {
|
|
628
|
+
if (btn) controller.setPlayButton(btn, playLabel);
|
|
629
|
+
} }),
|
|
630
|
+
/* @__PURE__ */ jsx4("button", { className: "btn btn-primary", ref: (btn) => {
|
|
631
|
+
if (btn) controller.setStopButton(btn, stopLabel);
|
|
632
|
+
} })
|
|
633
|
+
] });
|
|
634
|
+
case 2 /* PlayPauseStop */:
|
|
635
|
+
return /* @__PURE__ */ jsxs("div", { className: "btn-group", children: [
|
|
636
|
+
/* @__PURE__ */ jsx4("button", { className: "btn btn-primary", ref: (btn) => {
|
|
637
|
+
if (btn) controller.setPlayButton(btn, playLabel);
|
|
638
|
+
} }),
|
|
639
|
+
/* @__PURE__ */ jsx4("button", { className: "btn btn-primary", ref: (btn) => {
|
|
640
|
+
if (btn) controller.setPauseButton(btn, pauseLabel);
|
|
641
|
+
} }),
|
|
642
|
+
/* @__PURE__ */ jsx4("button", { className: "btn btn-primary", ref: (btn) => {
|
|
643
|
+
if (btn) controller.setStopButton(btn, stopLabel);
|
|
644
|
+
} })
|
|
645
|
+
] });
|
|
646
|
+
default:
|
|
647
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
648
|
+
"Invalid button layout: ",
|
|
649
|
+
buttonLayout
|
|
650
|
+
] });
|
|
642
651
|
}
|
|
643
652
|
}
|
|
644
653
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N as Note, S as SymbolSet } from './note-
|
|
2
|
-
import { K as KeySignature } from './tempo-
|
|
1
|
+
import { N as Note, S as SymbolSet } from './note-CgCIBwvR.js';
|
|
2
|
+
import { K as KeySignature } from './tempo-DMt3iwz9.js';
|
|
3
3
|
|
|
4
4
|
/** Interval direction type. */
|
|
5
5
|
type IntervalDirection = "Unison" | "Ascending" | "Descending";
|
package/dist/score/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N as NoteOptions, R as RestOptions, S as StaffPreset, a as ScoreConfiguration, M as MDocument, V as VoiceId, T as TupletOptions, b as VerseNumber, L as LyricsOptions, c as StaffTabOrGroups, F as Fermata, d as Navigation, A as AnnotationText, e as Annotation, f as Label, C as Connective, g as TieType, h as NoteAnchor, i as VerticalPosition } from '../music-objects-
|
|
2
|
-
export {
|
|
1
|
+
import { N as NoteOptions, R as RestOptions, S as StaffPreset, a as ScoreConfiguration, M as MDocument, V as VoiceId, T as TupletOptions, b as VerseNumber, L as LyricsOptions, c as StaffTabOrGroups, F as Fermata, d as Navigation, A as AnnotationText, e as Annotation, f as Label, C as Connective, g as TieType, h as NoteAnchor, i as VerticalPosition } from '../music-objects-CB05XryE.mjs';
|
|
2
|
+
export { ad as Arpeggio, a5 as BaseConfig, a4 as Clef, D as DivRect, ah as DynamicsAnnotation, af as LyricsAlign, ag as LyricsHyphen, s as MAccidental, u as MArpeggio, H as MBarLineLeft, G as MBarLineRight, v as MBeamGroup, t as MConnective, x as MEnding, a3 as MExtensionLine, y as MFermata, z as MHeader, B as MImage, a2 as MLyrics, E as MMeasure, J as MNoteGroup, q as MPlaybackButtons, o as MPlayer, p as MRenderer, P as MRest, U as MRhythmColumn, W as MScoreRow, a0 as MSpecialText, X as MStaff, w as MStaffBeamGroup, K as MStaffNoteGroup, Q as MStaffRest, Z as MStaffSignature, I as MStaffTabBarLine, Y as MTab, O as MTabNoteGroup, $ as MTabRhythm, _ as MTabSignature, a1 as MText, r as MusicInterface, aj as PlayState, ak as PlayStateChangeListener, k as ScoreEvent, n as ScoreEventListener, j as ScoreEventType, m as ScoreObjectEvent, l as ScoreStaffPosEvent, a6 as StaffConfig, ae as StaffTabOrGroup, ac as Stem, a9 as StringNumber, a7 as TabConfig, ai as TempoAnnotation, aa as getStringNumbers, ab as getVerseNumbers, a8 as getVoiceIds } from '../music-objects-CB05XryE.mjs';
|
|
3
3
|
import { N as Note } from '../note-eA2xPPiG.mjs';
|
|
4
4
|
import { S as ScaleType, c as Scale } from '../scale-DQP3b9Zx.mjs';
|
|
5
5
|
import { N as NoteLength, i as NoteLengthStr, K as KeySignature, b as TimeSignature, T as TimeSignatures, B as BeamGrouping, k as TupletRatio } from '../tempo-dkctPkCS.mjs';
|
package/dist/score/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { N as NoteOptions, R as RestOptions, S as StaffPreset, a as ScoreConfiguration, M as MDocument, V as VoiceId, T as TupletOptions, b as VerseNumber, L as LyricsOptions, c as StaffTabOrGroups, F as Fermata, d as Navigation, A as AnnotationText, e as Annotation, f as Label, C as Connective, g as TieType, h as NoteAnchor, i as VerticalPosition } from '../music-objects-
|
|
2
|
-
export {
|
|
3
|
-
import { N as Note } from '../note-
|
|
4
|
-
import { S as ScaleType, c as Scale } from '../scale-
|
|
5
|
-
import { N as NoteLength, i as NoteLengthStr, K as KeySignature, b as TimeSignature, T as TimeSignatures, B as BeamGrouping, k as TupletRatio } from '../tempo-
|
|
1
|
+
import { N as NoteOptions, R as RestOptions, S as StaffPreset, a as ScoreConfiguration, M as MDocument, V as VoiceId, T as TupletOptions, b as VerseNumber, L as LyricsOptions, c as StaffTabOrGroups, F as Fermata, d as Navigation, A as AnnotationText, e as Annotation, f as Label, C as Connective, g as TieType, h as NoteAnchor, i as VerticalPosition } from '../music-objects-CwPOlqFi.js';
|
|
2
|
+
export { ad as Arpeggio, a5 as BaseConfig, a4 as Clef, D as DivRect, ah as DynamicsAnnotation, af as LyricsAlign, ag as LyricsHyphen, s as MAccidental, u as MArpeggio, H as MBarLineLeft, G as MBarLineRight, v as MBeamGroup, t as MConnective, x as MEnding, a3 as MExtensionLine, y as MFermata, z as MHeader, B as MImage, a2 as MLyrics, E as MMeasure, J as MNoteGroup, q as MPlaybackButtons, o as MPlayer, p as MRenderer, P as MRest, U as MRhythmColumn, W as MScoreRow, a0 as MSpecialText, X as MStaff, w as MStaffBeamGroup, K as MStaffNoteGroup, Q as MStaffRest, Z as MStaffSignature, I as MStaffTabBarLine, Y as MTab, O as MTabNoteGroup, $ as MTabRhythm, _ as MTabSignature, a1 as MText, r as MusicInterface, aj as PlayState, ak as PlayStateChangeListener, k as ScoreEvent, n as ScoreEventListener, j as ScoreEventType, m as ScoreObjectEvent, l as ScoreStaffPosEvent, a6 as StaffConfig, ae as StaffTabOrGroup, ac as Stem, a9 as StringNumber, a7 as TabConfig, ai as TempoAnnotation, aa as getStringNumbers, ab as getVerseNumbers, a8 as getVoiceIds } from '../music-objects-CwPOlqFi.js';
|
|
3
|
+
import { N as Note } from '../note-CgCIBwvR.js';
|
|
4
|
+
import { S as ScaleType, c as Scale } from '../scale-CBW4eTz7.js';
|
|
5
|
+
import { N as NoteLength, i as NoteLengthStr, K as KeySignature, b as TimeSignature, T as TimeSignatures, B as BeamGrouping, k as TupletRatio } from '../tempo-DMt3iwz9.js';
|
|
6
6
|
import '@tspro/ts-utils-lib';
|
|
7
7
|
|
|
8
8
|
/** Tuplet builder type. */
|