@coderline/alphatab 1.6.0-alpha.1415 → 1.6.0-alpha.1418
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/dist/alphaTab.core.min.mjs +2 -2
- package/dist/alphaTab.core.mjs +236 -87
- package/dist/alphaTab.d.ts +85 -22
- package/dist/alphaTab.js +235 -86
- package/dist/alphaTab.min.js +2 -2
- package/dist/alphaTab.min.mjs +1 -1
- package/dist/alphaTab.mjs +1 -1
- package/dist/alphaTab.vite.js +1 -1
- package/dist/alphaTab.vite.mjs +1 -1
- package/dist/alphaTab.webpack.js +1 -1
- package/dist/alphaTab.webpack.mjs +1 -1
- package/dist/alphaTab.worker.min.mjs +1 -1
- package/dist/alphaTab.worker.mjs +1 -1
- package/dist/alphaTab.worklet.min.mjs +1 -1
- package/dist/alphaTab.worklet.mjs +1 -1
- package/package.json +1 -1
package/dist/alphaTab.core.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* alphaTab v1.6.0-alpha.
|
|
2
|
+
* alphaTab v1.6.0-alpha.1418 (develop, build 1418)
|
|
3
3
|
*
|
|
4
4
|
* Copyright © 2025, Daniel Kuschny and Contributors, All rights reserved.
|
|
5
5
|
*
|
|
@@ -1413,7 +1413,7 @@ class SyncPointData {
|
|
|
1413
1413
|
this.barOccurence = 0;
|
|
1414
1414
|
/**
|
|
1415
1415
|
* The modified tempo at which the cursor should move (aka. the tempo played within the external audio track).
|
|
1416
|
-
* This information is used together with
|
|
1416
|
+
* This information is used together with normal tempo changes to calculate how much faster/slower the
|
|
1417
1417
|
* cursor playback is performed to align with the audio track.
|
|
1418
1418
|
*/
|
|
1419
1419
|
this.modifiedTempo = 0;
|
|
@@ -29070,7 +29070,7 @@ class Font {
|
|
|
29070
29070
|
}
|
|
29071
29071
|
switch (typeof v) {
|
|
29072
29072
|
case 'undefined':
|
|
29073
|
-
return
|
|
29073
|
+
return undefined;
|
|
29074
29074
|
case 'object': {
|
|
29075
29075
|
const m = v;
|
|
29076
29076
|
const families = m.get('families');
|
|
@@ -29150,10 +29150,13 @@ class Font {
|
|
|
29150
29150
|
return Font.withFamilyList(families, fontSize, fontStyle, fontWeight);
|
|
29151
29151
|
}
|
|
29152
29152
|
default:
|
|
29153
|
-
return
|
|
29153
|
+
return undefined;
|
|
29154
29154
|
}
|
|
29155
29155
|
}
|
|
29156
29156
|
static toJson(font) {
|
|
29157
|
+
if (!font) {
|
|
29158
|
+
return undefined;
|
|
29159
|
+
}
|
|
29157
29160
|
const o = new Map();
|
|
29158
29161
|
o.set('families', font.families);
|
|
29159
29162
|
o.set('size', font.size);
|
|
@@ -30160,6 +30163,14 @@ class CoreSettingsSerializer {
|
|
|
30160
30163
|
/*@target web*/
|
|
30161
30164
|
o.set("fontdirectory", obj.fontDirectory);
|
|
30162
30165
|
/*@target web*/
|
|
30166
|
+
if (obj.smuflFontSources !== null) {
|
|
30167
|
+
const m = new Map();
|
|
30168
|
+
o.set("smuflfontsources", m);
|
|
30169
|
+
for (const [k, v] of obj.smuflFontSources) {
|
|
30170
|
+
m.set(k.toString(), v);
|
|
30171
|
+
}
|
|
30172
|
+
}
|
|
30173
|
+
/*@target web*/
|
|
30163
30174
|
o.set("file", obj.file);
|
|
30164
30175
|
/*@target web*/
|
|
30165
30176
|
o.set("tex", obj.tex);
|
|
@@ -30183,6 +30194,13 @@ class CoreSettingsSerializer {
|
|
|
30183
30194
|
obj.fontDirectory = v;
|
|
30184
30195
|
return true;
|
|
30185
30196
|
/*@target web*/
|
|
30197
|
+
case "smuflfontsources":
|
|
30198
|
+
obj.smuflFontSources = new Map();
|
|
30199
|
+
JsonHelper.forEach(v, (v, k) => {
|
|
30200
|
+
obj.smuflFontSources.set(JsonHelper.parseEnum(k, FontFileFormat), v);
|
|
30201
|
+
});
|
|
30202
|
+
return true;
|
|
30203
|
+
/*@target web*/
|
|
30186
30204
|
case "file":
|
|
30187
30205
|
obj.file = v;
|
|
30188
30206
|
return true;
|
|
@@ -30226,6 +30244,7 @@ class RenderingResourcesSerializer {
|
|
|
30226
30244
|
return null;
|
|
30227
30245
|
}
|
|
30228
30246
|
const o = new Map();
|
|
30247
|
+
o.set("smuflfont", Font.toJson(obj.smuflFont));
|
|
30229
30248
|
o.set("copyrightfont", Font.toJson(obj.copyrightFont));
|
|
30230
30249
|
o.set("titlefont", Font.toJson(obj.titleFont));
|
|
30231
30250
|
o.set("subtitlefont", Font.toJson(obj.subTitleFont));
|
|
@@ -30252,6 +30271,9 @@ class RenderingResourcesSerializer {
|
|
|
30252
30271
|
}
|
|
30253
30272
|
static setProperty(obj, property, v) {
|
|
30254
30273
|
switch (property) {
|
|
30274
|
+
case "smuflfont":
|
|
30275
|
+
obj.smuflFont = Font.fromJson(v);
|
|
30276
|
+
return true;
|
|
30255
30277
|
case "copyrightfont":
|
|
30256
30278
|
obj.copyrightFont = Font.fromJson(v);
|
|
30257
30279
|
return true;
|
|
@@ -34229,15 +34251,6 @@ class Html5Canvas {
|
|
|
34229
34251
|
this._color = new Color(0, 0, 0, 0xff);
|
|
34230
34252
|
this._font = new Font('Arial', 10, FontStyle.Plain);
|
|
34231
34253
|
this._lineWidth = 0;
|
|
34232
|
-
const fontElement = document.createElement('span');
|
|
34233
|
-
fontElement.classList.add('at');
|
|
34234
|
-
document.body.appendChild(fontElement);
|
|
34235
|
-
const style = window.getComputedStyle(fontElement);
|
|
34236
|
-
let family = style.fontFamily;
|
|
34237
|
-
if (family.startsWith('"') || family.startsWith("'")) {
|
|
34238
|
-
family = family.substr(1, family.length - 2);
|
|
34239
|
-
}
|
|
34240
|
-
this._musicFont = new Font(family, Number.parseFloat(style.fontSize), FontStyle.Plain);
|
|
34241
34254
|
this._measureCanvas = document.createElement('canvas');
|
|
34242
34255
|
this._measureCanvas.width = 10;
|
|
34243
34256
|
this._measureCanvas.height = 10;
|
|
@@ -34252,6 +34265,7 @@ class Html5Canvas {
|
|
|
34252
34265
|
return null;
|
|
34253
34266
|
}
|
|
34254
34267
|
beginRender(width, height) {
|
|
34268
|
+
this._musicFont = this.settings.display.resources.smuflFont;
|
|
34255
34269
|
const scale = this.settings.display.scale;
|
|
34256
34270
|
this._canvas = document.createElement('canvas');
|
|
34257
34271
|
this._canvas.width = (width * Environment.HighDpiFactor) | 0;
|
|
@@ -38709,7 +38723,11 @@ class SelectionInfo {
|
|
|
38709
38723
|
*/
|
|
38710
38724
|
class AlphaTabApiBase {
|
|
38711
38725
|
/**
|
|
38712
|
-
* The actual player mode which is currently active
|
|
38726
|
+
* The actual player mode which is currently active.
|
|
38727
|
+
* @remarks
|
|
38728
|
+
* Allows determining whether a backing track or the synthesizer is active in case automatic detection is enabled.
|
|
38729
|
+
* @category Properties - Player
|
|
38730
|
+
* @since 1.6.0
|
|
38713
38731
|
*/
|
|
38714
38732
|
get actualPlayerMode() {
|
|
38715
38733
|
return this._actualPlayerMode;
|
|
@@ -43839,10 +43857,6 @@ class BrowserUiFacade {
|
|
|
43839
43857
|
return this.areAllFontsLoaded();
|
|
43840
43858
|
}
|
|
43841
43859
|
areAllFontsLoaded() {
|
|
43842
|
-
Environment.bravuraFontChecker.checkForFontAvailability();
|
|
43843
|
-
if (!Environment.bravuraFontChecker.isFontLoaded) {
|
|
43844
|
-
return false;
|
|
43845
|
-
}
|
|
43846
43860
|
let isAnyNotLoaded = false;
|
|
43847
43861
|
for (const checker of this._fontCheckers.values()) {
|
|
43848
43862
|
if (!checker.isFontLoaded) {
|
|
@@ -43879,7 +43893,6 @@ class BrowserUiFacade {
|
|
|
43879
43893
|
rootElement.classList.add('alphaTab');
|
|
43880
43894
|
this.rootContainer = new HtmlElementContainer(rootElement);
|
|
43881
43895
|
this.areWorkersSupported = 'Worker' in window;
|
|
43882
|
-
Environment.bravuraFontChecker.fontLoaded.on(this.onFontLoaded.bind(this));
|
|
43883
43896
|
this._intersectionObserver = new IntersectionObserver(this.onElementVisibilityChanged.bind(this), {
|
|
43884
43897
|
threshold: [0, 0.01, 1]
|
|
43885
43898
|
});
|
|
@@ -43947,7 +43960,7 @@ class BrowserUiFacade {
|
|
|
43947
43960
|
this._contents = element.element.innerHTML;
|
|
43948
43961
|
element.element.innerHTML = '';
|
|
43949
43962
|
}
|
|
43950
|
-
this.
|
|
43963
|
+
this.createStyleElements(settings);
|
|
43951
43964
|
this._file = settings.core.file;
|
|
43952
43965
|
}
|
|
43953
43966
|
setupFontCheckers(settings) {
|
|
@@ -43973,10 +43986,15 @@ class BrowserUiFacade {
|
|
|
43973
43986
|
}
|
|
43974
43987
|
destroy() {
|
|
43975
43988
|
this.rootContainer.element.innerHTML = '';
|
|
43989
|
+
const webFont = this._webFont;
|
|
43990
|
+
webFont.usages--;
|
|
43991
|
+
if (webFont.usages <= 0) {
|
|
43992
|
+
webFont.element.remove();
|
|
43993
|
+
}
|
|
43976
43994
|
}
|
|
43977
43995
|
createCanvasElement() {
|
|
43978
43996
|
const canvasElement = document.createElement('div');
|
|
43979
|
-
canvasElement.
|
|
43997
|
+
canvasElement.classList.add('at-surface', `at${this._webFont.fontSuffix}`);
|
|
43980
43998
|
canvasElement.style.fontSize = '0';
|
|
43981
43999
|
canvasElement.style.overflow = 'hidden';
|
|
43982
44000
|
canvasElement.style.lineHeight = '0';
|
|
@@ -44074,9 +44092,132 @@ class BrowserUiFacade {
|
|
|
44074
44092
|
initialRender();
|
|
44075
44093
|
}
|
|
44076
44094
|
}
|
|
44077
|
-
|
|
44078
|
-
const
|
|
44079
|
-
|
|
44095
|
+
createStyleElements(settings) {
|
|
44096
|
+
const root = this._api.container.element.ownerDocument;
|
|
44097
|
+
BrowserUiFacade.createSharedStyleElement(root);
|
|
44098
|
+
// SmuFl Font Specific style
|
|
44099
|
+
const smuflFontSources = settings.core.smuflFontSources ?? CoreSettings.buildDefaultSmuflFontSources(settings.core.fontDirectory);
|
|
44100
|
+
// create a simple unique hash for the font source definition
|
|
44101
|
+
// as data urls might be used we don't want to just use the plain strings.
|
|
44102
|
+
const hash = BrowserUiFacade.cyrb53(smuflFontSources.values());
|
|
44103
|
+
// reuse existing style if available
|
|
44104
|
+
const registeredWebFonts = BrowserUiFacade._registeredWebFonts;
|
|
44105
|
+
if (registeredWebFonts.has(hash)) {
|
|
44106
|
+
const webFont = registeredWebFonts.get(hash);
|
|
44107
|
+
webFont.usages++;
|
|
44108
|
+
webFont.checker.fontLoaded.on(this.onFontLoaded.bind(this));
|
|
44109
|
+
this._webFont = webFont;
|
|
44110
|
+
return;
|
|
44111
|
+
}
|
|
44112
|
+
const fontSuffix = registeredWebFonts.size === 0 ? '' : String(registeredWebFonts.size);
|
|
44113
|
+
const familyName = `alphaTab${fontSuffix}`;
|
|
44114
|
+
const src = Array.from(smuflFontSources.entries())
|
|
44115
|
+
.map(e => `url(${JSON.stringify(e[1])}) format('${BrowserUiFacade.cssFormat(e[0])}')`)
|
|
44116
|
+
.join(',');
|
|
44117
|
+
const css = `
|
|
44118
|
+
@font-face {
|
|
44119
|
+
font-display: block;
|
|
44120
|
+
font-family: '${familyName}';
|
|
44121
|
+
src: ${src};
|
|
44122
|
+
font-weight: normal;
|
|
44123
|
+
font-style: normal;
|
|
44124
|
+
}
|
|
44125
|
+
.at-surface.at${fontSuffix} .at {
|
|
44126
|
+
font-family: '${familyName}';
|
|
44127
|
+
speak: none;
|
|
44128
|
+
font-style: normal;
|
|
44129
|
+
font-weight: normal;
|
|
44130
|
+
font-variant: normal;
|
|
44131
|
+
text-transform: none;
|
|
44132
|
+
line-height: 1;
|
|
44133
|
+
line-height: 1;
|
|
44134
|
+
-webkit-font-smoothing: antialiased;
|
|
44135
|
+
-moz-osx-font-smoothing: grayscale;
|
|
44136
|
+
font-size: ${Environment.MusicFontSize}px;
|
|
44137
|
+
overflow: visible !important;
|
|
44138
|
+
}`;
|
|
44139
|
+
const styleElement = root.createElement('style');
|
|
44140
|
+
styleElement.id = `alphaTabStyle${fontSuffix}`;
|
|
44141
|
+
styleElement.innerHTML = css;
|
|
44142
|
+
root.getElementsByTagName('head').item(0).appendChild(styleElement);
|
|
44143
|
+
const checker = new FontLoadingChecker([familyName]);
|
|
44144
|
+
checker.fontLoaded.on(this.onFontLoaded.bind(this));
|
|
44145
|
+
this._fontCheckers.set(familyName, checker);
|
|
44146
|
+
checker.checkForFontAvailability();
|
|
44147
|
+
settings.display.resources.smuflFont = new Font(familyName, Environment.MusicFontSize, FontStyle.Plain, FontWeight.Regular);
|
|
44148
|
+
const webFont = {
|
|
44149
|
+
element: styleElement,
|
|
44150
|
+
fontSuffix,
|
|
44151
|
+
usages: 1,
|
|
44152
|
+
checker
|
|
44153
|
+
};
|
|
44154
|
+
registeredWebFonts.set(hash, webFont);
|
|
44155
|
+
this._webFont = webFont;
|
|
44156
|
+
}
|
|
44157
|
+
static cssFormat(format) {
|
|
44158
|
+
switch (format) {
|
|
44159
|
+
case FontFileFormat.EmbeddedOpenType:
|
|
44160
|
+
return 'embedded-opentype';
|
|
44161
|
+
case FontFileFormat.Woff:
|
|
44162
|
+
return 'woff';
|
|
44163
|
+
case FontFileFormat.Woff2:
|
|
44164
|
+
return 'woff2';
|
|
44165
|
+
case FontFileFormat.OpenType:
|
|
44166
|
+
return 'opentype';
|
|
44167
|
+
case FontFileFormat.TrueType:
|
|
44168
|
+
return 'truetype';
|
|
44169
|
+
case FontFileFormat.Svg:
|
|
44170
|
+
return 'svg';
|
|
44171
|
+
}
|
|
44172
|
+
}
|
|
44173
|
+
/**
|
|
44174
|
+
* cyrb53 (c) 2018 bryc (github.com/bryc)
|
|
44175
|
+
* License: Public domain (or MIT if needed). Attribution appreciated.
|
|
44176
|
+
* A fast and simple 53-bit string hash function with decent collision resistance.
|
|
44177
|
+
* Largely inspired by MurmurHash2/3, but with a focus on speed/simplicity
|
|
44178
|
+
* @param str
|
|
44179
|
+
* @param seed
|
|
44180
|
+
* @returns
|
|
44181
|
+
*/
|
|
44182
|
+
static cyrb53(strings, seed = 0) {
|
|
44183
|
+
let h1 = 0xdeadbeef ^ seed;
|
|
44184
|
+
let h2 = 0x41c6ce57 ^ seed;
|
|
44185
|
+
for (const str of strings) {
|
|
44186
|
+
for (let i = 0; i < str.length; i++) {
|
|
44187
|
+
const ch = str.charCodeAt(i);
|
|
44188
|
+
h1 = Math.imul(h1 ^ ch, 2654435761);
|
|
44189
|
+
h2 = Math.imul(h2 ^ ch, 1597334677);
|
|
44190
|
+
}
|
|
44191
|
+
}
|
|
44192
|
+
h1 = Math.imul(h1 ^ (h1 >>> 16), 2246822507);
|
|
44193
|
+
h1 ^= Math.imul(h2 ^ (h2 >>> 13), 3266489909);
|
|
44194
|
+
h2 = Math.imul(h2 ^ (h2 >>> 16), 2246822507);
|
|
44195
|
+
h2 ^= Math.imul(h1 ^ (h1 >>> 13), 3266489909);
|
|
44196
|
+
return 4294967296 * (2097151 & h2) + (h1 >>> 0);
|
|
44197
|
+
}
|
|
44198
|
+
/**
|
|
44199
|
+
* Creates the default CSS styles used across all alphaTab instances.
|
|
44200
|
+
* @target web
|
|
44201
|
+
* @internal
|
|
44202
|
+
*/
|
|
44203
|
+
static createSharedStyleElement(root) {
|
|
44204
|
+
let styleElement = root.getElementById('alphaTabStyle');
|
|
44205
|
+
if (!styleElement) {
|
|
44206
|
+
styleElement = document.createElement('style');
|
|
44207
|
+
styleElement.id = 'alphaTabStyleShared';
|
|
44208
|
+
const css = `
|
|
44209
|
+
.at-surface * {
|
|
44210
|
+
cursor: default;
|
|
44211
|
+
vertical-align: top;
|
|
44212
|
+
overflow: visible;
|
|
44213
|
+
}
|
|
44214
|
+
.at-surface-svg text {
|
|
44215
|
+
dominant-baseline: central;
|
|
44216
|
+
white-space:pre;
|
|
44217
|
+
}`;
|
|
44218
|
+
styleElement.innerHTML = css;
|
|
44219
|
+
document.getElementsByTagName('head').item(0).appendChild(styleElement);
|
|
44220
|
+
}
|
|
44080
44221
|
}
|
|
44081
44222
|
parseTracks(tracksData) {
|
|
44082
44223
|
if (!tracksData) {
|
|
@@ -44458,6 +44599,7 @@ class BrowserUiFacade {
|
|
|
44458
44599
|
return new BackingTrackPlayer(new AudioElementBackingTrackSynthOutput(), this._api.settings.player.bufferTimeInMilliseconds);
|
|
44459
44600
|
}
|
|
44460
44601
|
}
|
|
44602
|
+
BrowserUiFacade._registeredWebFonts = new Map();
|
|
44461
44603
|
|
|
44462
44604
|
/**
|
|
44463
44605
|
* Represents the progress of any data being loaded.
|
|
@@ -60715,9 +60857,9 @@ class VersionInfo {
|
|
|
60715
60857
|
print(`build date: ${VersionInfo.date}`);
|
|
60716
60858
|
}
|
|
60717
60859
|
}
|
|
60718
|
-
VersionInfo.version = '1.6.0-alpha.
|
|
60719
|
-
VersionInfo.date = '2025-05-
|
|
60720
|
-
VersionInfo.commit = '
|
|
60860
|
+
VersionInfo.version = '1.6.0-alpha.1418';
|
|
60861
|
+
VersionInfo.date = '2025-05-21T02:08:19.492Z';
|
|
60862
|
+
VersionInfo.commit = '1f6342282295a9544ebc36ddd38d73d220d2caab';
|
|
60721
60863
|
|
|
60722
60864
|
/**
|
|
60723
60865
|
* A factory for custom layout engines.
|
|
@@ -60749,59 +60891,6 @@ class RenderEngineFactory {
|
|
|
60749
60891
|
* @partial
|
|
60750
60892
|
*/
|
|
60751
60893
|
class Environment {
|
|
60752
|
-
/**
|
|
60753
|
-
* @target web
|
|
60754
|
-
* @internal
|
|
60755
|
-
*/
|
|
60756
|
-
static createStyleElement(elementDocument, fontDirectory) {
|
|
60757
|
-
let styleElement = elementDocument.getElementById('alphaTabStyle');
|
|
60758
|
-
if (!styleElement) {
|
|
60759
|
-
if (!fontDirectory) {
|
|
60760
|
-
Logger.error('AlphaTab', 'Font directory could not be detected, cannot create style element');
|
|
60761
|
-
return;
|
|
60762
|
-
}
|
|
60763
|
-
styleElement = elementDocument.createElement('style');
|
|
60764
|
-
styleElement.id = 'alphaTabStyle';
|
|
60765
|
-
const css = `
|
|
60766
|
-
@font-face {
|
|
60767
|
-
font-display: block;
|
|
60768
|
-
font-family: 'alphaTab';
|
|
60769
|
-
src: url('${fontDirectory}Bravura.eot');
|
|
60770
|
-
src: url('${fontDirectory}Bravura.eot?#iefix') format('embedded-opentype')
|
|
60771
|
-
, url('${fontDirectory}Bravura.woff') format('woff')
|
|
60772
|
-
, url('${fontDirectory}Bravura.otf') format('opentype')
|
|
60773
|
-
, url('${fontDirectory}Bravura.svg#Bravura') format('svg');
|
|
60774
|
-
font-weight: normal;
|
|
60775
|
-
font-style: normal;
|
|
60776
|
-
}
|
|
60777
|
-
.at-surface * {
|
|
60778
|
-
cursor: default;
|
|
60779
|
-
vertical-align: top;
|
|
60780
|
-
overflow: visible;
|
|
60781
|
-
}
|
|
60782
|
-
.at-surface-svg text {
|
|
60783
|
-
dominant-baseline: central;
|
|
60784
|
-
white-space:pre;
|
|
60785
|
-
}
|
|
60786
|
-
.at {
|
|
60787
|
-
font-family: 'alphaTab';
|
|
60788
|
-
speak: none;
|
|
60789
|
-
font-style: normal;
|
|
60790
|
-
font-weight: normal;
|
|
60791
|
-
font-variant: normal;
|
|
60792
|
-
text-transform: none;
|
|
60793
|
-
line-height: 1;
|
|
60794
|
-
line-height: 1;
|
|
60795
|
-
-webkit-font-smoothing: antialiased;
|
|
60796
|
-
-moz-osx-font-smoothing: grayscale;
|
|
60797
|
-
font-size: ${Environment.MusicFontSize}px;
|
|
60798
|
-
overflow: visible !important;
|
|
60799
|
-
}`;
|
|
60800
|
-
styleElement.innerHTML = css;
|
|
60801
|
-
elementDocument.getElementsByTagName('head').item(0).appendChild(styleElement);
|
|
60802
|
-
Environment.bravuraFontChecker.checkForFontAvailability();
|
|
60803
|
-
}
|
|
60804
|
-
}
|
|
60805
60894
|
/**
|
|
60806
60895
|
* @target web
|
|
60807
60896
|
* @internal
|
|
@@ -60877,7 +60966,9 @@ class Environment {
|
|
|
60877
60966
|
catch (e) {
|
|
60878
60967
|
}
|
|
60879
60968
|
// normal browser include as <script>
|
|
60880
|
-
if ('document' in Environment.globalThis &&
|
|
60969
|
+
if ('document' in Environment.globalThis &&
|
|
60970
|
+
document.currentScript &&
|
|
60971
|
+
document.currentScript instanceof HTMLScriptElement) {
|
|
60881
60972
|
return document.currentScript.src;
|
|
60882
60973
|
}
|
|
60883
60974
|
return null;
|
|
@@ -61355,11 +61446,6 @@ Environment.scriptFile = Environment.detectScriptFile();
|
|
|
61355
61446
|
* @target web
|
|
61356
61447
|
*/
|
|
61357
61448
|
Environment.fontDirectory = Environment.detectFontDirectory();
|
|
61358
|
-
/**
|
|
61359
|
-
* @target web
|
|
61360
|
-
* @internal
|
|
61361
|
-
*/
|
|
61362
|
-
Environment.bravuraFontChecker = new FontLoadingChecker(['alphaTab']);
|
|
61363
61449
|
Environment.renderEngines = Environment.createDefaultRenderEngines();
|
|
61364
61450
|
/**
|
|
61365
61451
|
* @internal
|
|
@@ -61370,12 +61456,58 @@ Environment.layoutEngines = Environment.createDefaultLayoutEngines();
|
|
|
61370
61456
|
*/
|
|
61371
61457
|
Environment.staveProfiles = Environment.createDefaultStaveProfiles();
|
|
61372
61458
|
|
|
61459
|
+
/**
|
|
61460
|
+
* Lists the known file formats for font files.
|
|
61461
|
+
* @target web
|
|
61462
|
+
*/
|
|
61463
|
+
var FontFileFormat;
|
|
61464
|
+
(function (FontFileFormat) {
|
|
61465
|
+
/**
|
|
61466
|
+
* .eot
|
|
61467
|
+
*/
|
|
61468
|
+
FontFileFormat[FontFileFormat["EmbeddedOpenType"] = 0] = "EmbeddedOpenType";
|
|
61469
|
+
/**
|
|
61470
|
+
* .woff
|
|
61471
|
+
*/
|
|
61472
|
+
FontFileFormat[FontFileFormat["Woff"] = 1] = "Woff";
|
|
61473
|
+
/**
|
|
61474
|
+
* .woff2
|
|
61475
|
+
*/
|
|
61476
|
+
FontFileFormat[FontFileFormat["Woff2"] = 2] = "Woff2";
|
|
61477
|
+
/**
|
|
61478
|
+
* .otf
|
|
61479
|
+
*/
|
|
61480
|
+
FontFileFormat[FontFileFormat["OpenType"] = 3] = "OpenType";
|
|
61481
|
+
/**
|
|
61482
|
+
* .ttf
|
|
61483
|
+
*/
|
|
61484
|
+
FontFileFormat[FontFileFormat["TrueType"] = 4] = "TrueType";
|
|
61485
|
+
/**
|
|
61486
|
+
* .svg
|
|
61487
|
+
*/
|
|
61488
|
+
FontFileFormat[FontFileFormat["Svg"] = 5] = "Svg";
|
|
61489
|
+
})(FontFileFormat || (FontFileFormat = {}));
|
|
61373
61490
|
/**
|
|
61374
61491
|
* All main settings of alphaTab controlling rather general aspects of its behavior.
|
|
61375
61492
|
* @json
|
|
61376
61493
|
* @json_declaration
|
|
61377
61494
|
*/
|
|
61378
61495
|
class CoreSettings {
|
|
61496
|
+
/**
|
|
61497
|
+
* Builds the default SMuFL font sources for the usage with alphaTab in cases
|
|
61498
|
+
* where no custom {@link smuflFontSources} are provided.
|
|
61499
|
+
* @param fontDirectory The {@link fontDirectory} configured.
|
|
61500
|
+
* @target web
|
|
61501
|
+
*/
|
|
61502
|
+
static buildDefaultSmuflFontSources(fontDirectory) {
|
|
61503
|
+
const map = new Map();
|
|
61504
|
+
// WOFF, WOFF2 and OTF should cover all our platform needs
|
|
61505
|
+
const prefix = fontDirectory ?? '';
|
|
61506
|
+
map.set(FontFileFormat.Woff2, `${prefix}Bravura.woff2`);
|
|
61507
|
+
map.set(FontFileFormat.Woff, `${prefix}Bravura.woff`);
|
|
61508
|
+
map.set(FontFileFormat.OpenType, `${prefix}Bravura.otf`);
|
|
61509
|
+
return map;
|
|
61510
|
+
}
|
|
61379
61511
|
/**
|
|
61380
61512
|
* @target web
|
|
61381
61513
|
*/
|
|
@@ -61401,12 +61533,27 @@ class CoreSettings {
|
|
|
61401
61533
|
* where the Web Font files of [Bravura](https://github.com/steinbergmedia/bravura) are. Normally alphaTab expects
|
|
61402
61534
|
* them to be in a `font` subfolder beside the script file. If this is not the case, this setting must be used to configure the path.
|
|
61403
61535
|
* Alternatively also a global variable `ALPHATAB_FONT` can be set on the page before initializing alphaTab.
|
|
61536
|
+
*
|
|
61537
|
+
* Use {@link smuflFontSources} for more flexible font configuration.
|
|
61404
61538
|
* @defaultValue `"${AlphaTabScriptFolder}/font/"`
|
|
61405
61539
|
* @category Core - JavaScript Specific
|
|
61406
61540
|
* @target web
|
|
61407
61541
|
* @since 0.9.6
|
|
61408
61542
|
*/
|
|
61409
61543
|
this.fontDirectory = null;
|
|
61544
|
+
/**
|
|
61545
|
+
* Defines the URLs from which to load the SMuFL compliant font files.
|
|
61546
|
+
* @remarks
|
|
61547
|
+
* These sources will be used to load and register the webfonts on the page so
|
|
61548
|
+
* they are available for rendering the music sheet. The sources can be set to any
|
|
61549
|
+
* CSS compatible URL which can be passed into `url()`.
|
|
61550
|
+
* See https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/src#url
|
|
61551
|
+
* @defaultValue Bravura files located at {@link fontDirectory} .
|
|
61552
|
+
* @category Core - JavaScript Specific
|
|
61553
|
+
* @target web
|
|
61554
|
+
* @since 1.6.0
|
|
61555
|
+
*/
|
|
61556
|
+
this.smuflFontSources = null;
|
|
61410
61557
|
/**
|
|
61411
61558
|
* The full URL to the input file to be loaded.
|
|
61412
61559
|
* @remarks
|
|
@@ -65031,9 +65178,11 @@ const _barrel = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
|
65031
65178
|
ActiveBeatsChangedEventArgs,
|
|
65032
65179
|
AlphaSynth,
|
|
65033
65180
|
AlphaSynthAudioWorkletOutput,
|
|
65181
|
+
AlphaSynthBase,
|
|
65034
65182
|
AlphaSynthScriptProcessorOutput,
|
|
65035
65183
|
AlphaSynthWebAudioOutputBase,
|
|
65036
65184
|
AlphaSynthWebWorkerApi,
|
|
65185
|
+
BackingTrackSyncPoint,
|
|
65037
65186
|
CircularSampleBuffer,
|
|
65038
65187
|
MidiEventsPlayedEventArgs,
|
|
65039
65188
|
PlaybackRange,
|
|
@@ -65047,4 +65196,4 @@ const _jsonbarrel = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.definePropert
|
|
|
65047
65196
|
__proto__: null
|
|
65048
65197
|
}, Symbol.toStringTag, { value: 'Module' }));
|
|
65049
65198
|
|
|
65050
|
-
export { AlphaTabApi, AlphaTabApiBase, AlphaTabError, AlphaTabErrorType, ConsoleLogger, CoreSettings, DisplaySettings, Environment, FileLoadError, FingeringMode, FormatError, ImporterSettings, LayoutMode, LogLevel, Logger, NotationElement, NotationMode, NotationSettings, PlayerMode, PlayerOutputMode, PlayerSettings, ProgressEventArgs, RenderEngineFactory, RenderingResources, ResizeEventArgs, ScrollMode, Settings, SlidePlaybackSettings, StaveProfile, SystemsLayoutMode, TabRhythmMode, VibratoPlaybackSettings, WebPlatform, _barrel$5 as exporter, _barrel$7 as importer, _barrel$6 as io, _jsonbarrel as json, VersionInfo as meta, _barrel$4 as midi, _barrel$3 as model, _barrel$1 as platform, _barrel$2 as rendering, _barrel as synth };
|
|
65199
|
+
export { AlphaTabApi, AlphaTabApiBase, AlphaTabError, AlphaTabErrorType, ConsoleLogger, CoreSettings, DisplaySettings, Environment, FileLoadError, FingeringMode, FontFileFormat, FormatError, ImporterSettings, LayoutMode, LogLevel, Logger, NotationElement, NotationMode, NotationSettings, PlayerMode, PlayerOutputMode, PlayerSettings, ProgressEventArgs, RenderEngineFactory, RenderingResources, ResizeEventArgs, ScrollMode, Settings, SlidePlaybackSettings, StaveProfile, SystemsLayoutMode, TabRhythmMode, VibratoPlaybackSettings, WebPlatform, _barrel$5 as exporter, _barrel$7 as importer, _barrel$6 as io, _jsonbarrel as json, VersionInfo as meta, _barrel$4 as midi, _barrel$3 as model, _barrel$1 as platform, _barrel$2 as rendering, _barrel as synth };
|