@coderline/alphatab 1.4.0 → 1.4.3
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 +1 -1
- package/dist/alphaTab.core.mjs +57 -23
- package/dist/alphaTab.d.ts +22 -1
- package/dist/alphaTab.js +57 -23
- package/dist/alphaTab.min.js +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.mjs +1 -1
- package/dist/alphaTab.worklet.mjs +1 -1
- package/dist/font/Bravura-FONTLOG.txt +345 -345
- package/dist/font/Bravura-OFL-FAQ.txt +369 -369
- package/dist/font/Bravura-OFL.txt +94 -94
- package/dist/font/Bravura.svg +3864 -3864
- package/dist/soundfont/LICENSE +10 -10
- package/dist/soundfont/README.md +19 -19
- package/package.json +1 -1
package/dist/alphaTab.core.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* alphaTab v1.4.
|
|
2
|
+
* alphaTab v1.4.3 (, build 16)
|
|
3
3
|
*
|
|
4
4
|
* Copyright © 2025, Daniel Kuschny and Contributors, All rights reserved.
|
|
5
5
|
*
|
|
@@ -24332,10 +24332,10 @@ class Hydra {
|
|
|
24332
24332
|
// 6.1 Sample Data Format in the smpl Sub-chunk
|
|
24333
24333
|
// The smpl sub-chunk, if present, contains one or more "samples" of digital audio information in the form
|
|
24334
24334
|
// of linearly coded sixteen bit, signed, little endian (least significant byte first) words.
|
|
24335
|
-
|
|
24336
|
-
samples = new Float32Array(
|
|
24337
|
-
for (let i = 0; i <
|
|
24338
|
-
samples[i] =
|
|
24335
|
+
const dataView = new DataView(sampleBytes.buffer, sampleBytes.byteOffset, sampleBytes.length);
|
|
24336
|
+
samples = new Float32Array(sampleBytes.length / 2);
|
|
24337
|
+
for (let i = 0; i < samples.length; i++) {
|
|
24338
|
+
samples[i] = dataView.getInt16(i * 2, true) / 32767;
|
|
24339
24339
|
}
|
|
24340
24340
|
}
|
|
24341
24341
|
this._sampleCache.set(key, samples);
|
|
@@ -28032,6 +28032,7 @@ class BeatBounds {
|
|
|
28032
28032
|
finish(scale = 1) {
|
|
28033
28033
|
this.realBounds.scaleWith(scale);
|
|
28034
28034
|
this.visualBounds.scaleWith(scale);
|
|
28035
|
+
this.onNotesX *= scale;
|
|
28035
28036
|
if (this.notes) {
|
|
28036
28037
|
for (const n of this.notes) {
|
|
28037
28038
|
n.finish(scale);
|
|
@@ -29799,6 +29800,24 @@ class MasterBarTickLookup {
|
|
|
29799
29800
|
}
|
|
29800
29801
|
}
|
|
29801
29802
|
|
|
29803
|
+
/**
|
|
29804
|
+
* Describes how a cursor should be moving.
|
|
29805
|
+
*/
|
|
29806
|
+
var MidiTickLookupFindBeatResultCursorMode;
|
|
29807
|
+
(function (MidiTickLookupFindBeatResultCursorMode) {
|
|
29808
|
+
/**
|
|
29809
|
+
* Unknown/Undetermined mode. Should not happen on user level.
|
|
29810
|
+
*/
|
|
29811
|
+
MidiTickLookupFindBeatResultCursorMode[MidiTickLookupFindBeatResultCursorMode["Unknown"] = 0] = "Unknown";
|
|
29812
|
+
/**
|
|
29813
|
+
* The cursor should animate to the next beat.
|
|
29814
|
+
*/
|
|
29815
|
+
MidiTickLookupFindBeatResultCursorMode[MidiTickLookupFindBeatResultCursorMode["ToNextBext"] = 1] = "ToNextBext";
|
|
29816
|
+
/**
|
|
29817
|
+
* The cursor should animate to the end of the bar (typically on repeats and jumps)
|
|
29818
|
+
*/
|
|
29819
|
+
MidiTickLookupFindBeatResultCursorMode[MidiTickLookupFindBeatResultCursorMode["ToEndOfBar"] = 2] = "ToEndOfBar";
|
|
29820
|
+
})(MidiTickLookupFindBeatResultCursorMode || (MidiTickLookupFindBeatResultCursorMode = {}));
|
|
29802
29821
|
/**
|
|
29803
29822
|
* Represents the results of searching the currently played beat.
|
|
29804
29823
|
* @see MidiTickLookup.FindBeat
|
|
@@ -29823,6 +29842,10 @@ class MidiTickLookupFindBeatResult {
|
|
|
29823
29842
|
* Gets or sets the duration in milliseconds how long this lookup is valid.
|
|
29824
29843
|
*/
|
|
29825
29844
|
this.duration = 0;
|
|
29845
|
+
/**
|
|
29846
|
+
* The mode how the cursor should be handled.
|
|
29847
|
+
*/
|
|
29848
|
+
this.cursorMode = MidiTickLookupFindBeatResultCursorMode.Unknown;
|
|
29826
29849
|
this.masterBar = masterBar;
|
|
29827
29850
|
}
|
|
29828
29851
|
calculateDuration() {
|
|
@@ -29831,7 +29854,7 @@ class MidiTickLookupFindBeatResult {
|
|
|
29831
29854
|
this.duration = MidiUtils.ticksToMillis(this.tickDuration, this.masterBar.tempoChanges[0].tempo);
|
|
29832
29855
|
}
|
|
29833
29856
|
else {
|
|
29834
|
-
// Performance Note: I still wonder if we cannot calculate these slices efficiently ahead-of-time.
|
|
29857
|
+
// Performance Note: I still wonder if we cannot calculate these slices efficiently ahead-of-time.
|
|
29835
29858
|
// the sub-slicing in the lookup across beats makes it a bit tricky to do on-the-fly
|
|
29836
29859
|
// but maybe on finalizing the tick lookup?
|
|
29837
29860
|
// slow path: need to walk through the tick time-axis and calculate for each slice the milliseconds
|
|
@@ -29947,20 +29970,30 @@ class MidiTickLookup {
|
|
|
29947
29970
|
return null;
|
|
29948
29971
|
}
|
|
29949
29972
|
fillNextBeat(current, trackLookup) {
|
|
29950
|
-
current.nextBeat = this.findBeatInMasterBar(current.masterBar, current.beatLookup.nextBeat, current.end, trackLookup,
|
|
29973
|
+
current.nextBeat = this.findBeatInMasterBar(current.masterBar, current.beatLookup.nextBeat, current.end, trackLookup, true);
|
|
29951
29974
|
if (current.nextBeat == null) {
|
|
29952
29975
|
current.nextBeat = this.findBeatSlow(trackLookup, current, current.end, true);
|
|
29953
29976
|
}
|
|
29954
29977
|
// if we have the next beat take the difference between the times as duration
|
|
29955
29978
|
if (current.nextBeat) {
|
|
29956
29979
|
current.tickDuration = current.nextBeat.start - current.start;
|
|
29980
|
+
current.cursorMode = MidiTickLookupFindBeatResultCursorMode.ToNextBext;
|
|
29957
29981
|
current.calculateDuration();
|
|
29958
29982
|
}
|
|
29959
29983
|
// no next beat, animate to the end of the bar (could be an incomplete bar)
|
|
29960
29984
|
if (!current.nextBeat) {
|
|
29961
29985
|
current.tickDuration = current.masterBar.end - current.start;
|
|
29986
|
+
current.cursorMode = MidiTickLookupFindBeatResultCursorMode.ToEndOfBar;
|
|
29962
29987
|
current.calculateDuration();
|
|
29963
29988
|
}
|
|
29989
|
+
// if the next beat is not directly the next master bar (e.g. jumping back or forth)
|
|
29990
|
+
// we report no next beat and animate to the end
|
|
29991
|
+
if (current.nextBeat &&
|
|
29992
|
+
current.nextBeat.masterBar.masterBar.index != current.masterBar.masterBar.index + 1 &&
|
|
29993
|
+
(current.nextBeat.masterBar.masterBar.index != current.masterBar.masterBar.index ||
|
|
29994
|
+
current.nextBeat.beat.playbackStart <= current.beat.playbackStart)) {
|
|
29995
|
+
current.cursorMode = MidiTickLookupFindBeatResultCursorMode.ToEndOfBar;
|
|
29996
|
+
}
|
|
29964
29997
|
}
|
|
29965
29998
|
findBeatSlow(trackLookup, currentBeatHint, tick, isNextSearch) {
|
|
29966
29999
|
// get all beats within the masterbar
|
|
@@ -29988,7 +30021,7 @@ class MidiTickLookup {
|
|
|
29988
30021
|
// scan through beats and find first one which has a beat visible
|
|
29989
30022
|
while (masterBar) {
|
|
29990
30023
|
if (masterBar.firstBeat) {
|
|
29991
|
-
let beat = this.findBeatInMasterBar(masterBar, masterBar.firstBeat, tick, trackLookup,
|
|
30024
|
+
let beat = this.findBeatInMasterBar(masterBar, masterBar.firstBeat, tick, trackLookup, isNextSearch);
|
|
29992
30025
|
if (beat) {
|
|
29993
30026
|
return beat;
|
|
29994
30027
|
}
|
|
@@ -30003,10 +30036,10 @@ class MidiTickLookup {
|
|
|
30003
30036
|
* @param currentStartLookup
|
|
30004
30037
|
* @param tick
|
|
30005
30038
|
* @param visibleTracks
|
|
30006
|
-
* @param
|
|
30039
|
+
* @param isNextSearch
|
|
30007
30040
|
* @returns
|
|
30008
30041
|
*/
|
|
30009
|
-
findBeatInMasterBar(masterBar, currentStartLookup, tick, visibleTracks,
|
|
30042
|
+
findBeatInMasterBar(masterBar, currentStartLookup, tick, visibleTracks, isNextSearch) {
|
|
30010
30043
|
if (!currentStartLookup) {
|
|
30011
30044
|
return null;
|
|
30012
30045
|
}
|
|
@@ -30020,7 +30053,7 @@ class MidiTickLookup {
|
|
|
30020
30053
|
// found the matching beat lookup but none of the beats are visible
|
|
30021
30054
|
// in this case scan further to the next lookup which has any visible beat
|
|
30022
30055
|
if (!startBeat) {
|
|
30023
|
-
if (
|
|
30056
|
+
if (isNextSearch) {
|
|
30024
30057
|
let currentMasterBar = masterBar;
|
|
30025
30058
|
while (currentMasterBar != null && startBeat == null) {
|
|
30026
30059
|
while (currentStartLookup != null) {
|
|
@@ -30066,15 +30099,15 @@ class MidiTickLookup {
|
|
|
30066
30099
|
if (startBeat == null) {
|
|
30067
30100
|
return null;
|
|
30068
30101
|
}
|
|
30069
|
-
const result = this.createResult(masterBar, startBeatLookup, startBeat,
|
|
30102
|
+
const result = this.createResult(masterBar, startBeatLookup, startBeat, isNextSearch, visibleTracks);
|
|
30070
30103
|
return result;
|
|
30071
30104
|
}
|
|
30072
|
-
createResult(masterBar, beatLookup, beat,
|
|
30105
|
+
createResult(masterBar, beatLookup, beat, isNextSearch, visibleTracks) {
|
|
30073
30106
|
const result = new MidiTickLookupFindBeatResult(masterBar);
|
|
30074
30107
|
result.beat = beat;
|
|
30075
30108
|
result.beatLookup = beatLookup;
|
|
30076
30109
|
result.tickDuration = beatLookup.end - beatLookup.start;
|
|
30077
|
-
if (
|
|
30110
|
+
if (!isNextSearch) {
|
|
30078
30111
|
this.fillNextBeat(result, visibleTracks);
|
|
30079
30112
|
}
|
|
30080
30113
|
result.calculateDuration();
|
|
@@ -32812,7 +32845,7 @@ class AlphaTabApiBase {
|
|
|
32812
32845
|
this.player.positionChanged.on(e => {
|
|
32813
32846
|
this._previousTick = e.currentTick;
|
|
32814
32847
|
this.uiFacade.beginInvoke(() => {
|
|
32815
|
-
this.cursorUpdateTick(e.currentTick, false);
|
|
32848
|
+
this.cursorUpdateTick(e.currentTick, false, false, e.isSeek);
|
|
32816
32849
|
});
|
|
32817
32850
|
});
|
|
32818
32851
|
this.player.stateChanged.on(e => {
|
|
@@ -32833,14 +32866,14 @@ class AlphaTabApiBase {
|
|
|
32833
32866
|
* @param stop
|
|
32834
32867
|
* @param shouldScroll whether we should scroll to the bar (if scrolling is active)
|
|
32835
32868
|
*/
|
|
32836
|
-
cursorUpdateTick(tick, stop, shouldScroll = false) {
|
|
32869
|
+
cursorUpdateTick(tick, stop, shouldScroll = false, forceUpdate = false) {
|
|
32837
32870
|
let cache = this._tickCache;
|
|
32838
32871
|
if (cache) {
|
|
32839
32872
|
let tracks = this._trackIndexLookup;
|
|
32840
32873
|
if (tracks != null && tracks.size > 0) {
|
|
32841
32874
|
let beat = cache.findBeat(tracks, tick, this._currentBeat);
|
|
32842
32875
|
if (beat) {
|
|
32843
|
-
this.cursorUpdateBeat(beat, stop, shouldScroll);
|
|
32876
|
+
this.cursorUpdateBeat(beat, stop, shouldScroll, forceUpdate || this.playerState === PlayerState.Paused);
|
|
32844
32877
|
}
|
|
32845
32878
|
}
|
|
32846
32879
|
}
|
|
@@ -32866,7 +32899,8 @@ class AlphaTabApiBase {
|
|
|
32866
32899
|
if (!forceUpdate &&
|
|
32867
32900
|
beat === previousBeat?.beat &&
|
|
32868
32901
|
cache === previousCache &&
|
|
32869
|
-
previousState === this._playerState
|
|
32902
|
+
previousState === this._playerState &&
|
|
32903
|
+
previousBeat?.start === lookupResult.start) {
|
|
32870
32904
|
return;
|
|
32871
32905
|
}
|
|
32872
32906
|
let beatBoundings = cache.findBeat(beat);
|
|
@@ -32879,7 +32913,7 @@ class AlphaTabApiBase {
|
|
|
32879
32913
|
this._previousCursorCache = cache;
|
|
32880
32914
|
this._previousStateForCursor = this._playerState;
|
|
32881
32915
|
this.uiFacade.beginInvoke(() => {
|
|
32882
|
-
this.internalCursorUpdateBeat(beat, nextBeat, duration, stop, beatsToHighlight, cache, beatBoundings, shouldScroll);
|
|
32916
|
+
this.internalCursorUpdateBeat(beat, nextBeat, duration, stop, beatsToHighlight, cache, beatBoundings, shouldScroll, lookupResult.cursorMode);
|
|
32883
32917
|
});
|
|
32884
32918
|
}
|
|
32885
32919
|
/**
|
|
@@ -32942,7 +32976,7 @@ class AlphaTabApiBase {
|
|
|
32942
32976
|
}
|
|
32943
32977
|
}
|
|
32944
32978
|
}
|
|
32945
|
-
internalCursorUpdateBeat(beat, nextBeat, duration, stop, beatsToHighlight, cache, beatBoundings, shouldScroll) {
|
|
32979
|
+
internalCursorUpdateBeat(beat, nextBeat, duration, stop, beatsToHighlight, cache, beatBoundings, shouldScroll, cursorMode) {
|
|
32946
32980
|
const barCursor = this._barCursor;
|
|
32947
32981
|
const beatCursor = this._beatCursor;
|
|
32948
32982
|
let barBoundings = beatBoundings.barBounds.masterBarBounds;
|
|
@@ -32974,7 +33008,7 @@ class AlphaTabApiBase {
|
|
|
32974
33008
|
if (this.settings.player.enableAnimatedBeatCursor) {
|
|
32975
33009
|
let nextBeatX = barBoundings.visualBounds.x + barBoundings.visualBounds.w;
|
|
32976
33010
|
// get position of next beat on same system
|
|
32977
|
-
if (nextBeat) {
|
|
33011
|
+
if (nextBeat && cursorMode == MidiTickLookupFindBeatResultCursorMode.ToNextBext) {
|
|
32978
33012
|
// if we are moving within the same bar or to the next bar
|
|
32979
33013
|
// transition to the next beat, otherwise transition to the end of the bar.
|
|
32980
33014
|
let nextBeatBoundings = cache.findBeat(nextBeat);
|
|
@@ -52127,8 +52161,8 @@ class CoreSettings {
|
|
|
52127
52161
|
// </auto-generated>
|
|
52128
52162
|
class VersionInfo {
|
|
52129
52163
|
}
|
|
52130
|
-
VersionInfo.version = '1.4.
|
|
52131
|
-
VersionInfo.date = '2025-
|
|
52164
|
+
VersionInfo.version = '1.4.3';
|
|
52165
|
+
VersionInfo.date = '2025-04-13T21:11:16.350Z';
|
|
52132
52166
|
|
|
52133
52167
|
var index$4 = /*#__PURE__*/Object.freeze({
|
|
52134
52168
|
__proto__: null,
|
package/dist/alphaTab.d.ts
CHANGED
|
@@ -7057,6 +7057,23 @@ declare class MasterBarTickLookup {
|
|
|
7057
7057
|
addBeat(beat: Beat, beatPlaybackStart: number, sliceStart: number, sliceDuration: number): void;
|
|
7058
7058
|
}
|
|
7059
7059
|
|
|
7060
|
+
/**
|
|
7061
|
+
* Describes how a cursor should be moving.
|
|
7062
|
+
*/
|
|
7063
|
+
declare enum MidiTickLookupFindBeatResultCursorMode {
|
|
7064
|
+
/**
|
|
7065
|
+
* Unknown/Undetermined mode. Should not happen on user level.
|
|
7066
|
+
*/
|
|
7067
|
+
Unknown = 0,
|
|
7068
|
+
/**
|
|
7069
|
+
* The cursor should animate to the next beat.
|
|
7070
|
+
*/
|
|
7071
|
+
ToNextBext = 1,
|
|
7072
|
+
/**
|
|
7073
|
+
* The cursor should animate to the end of the bar (typically on repeats and jumps)
|
|
7074
|
+
*/
|
|
7075
|
+
ToEndOfBar = 2
|
|
7076
|
+
}
|
|
7060
7077
|
/**
|
|
7061
7078
|
* Represents the results of searching the currently played beat.
|
|
7062
7079
|
* @see MidiTickLookup.FindBeat
|
|
@@ -7087,6 +7104,10 @@ declare class MidiTickLookupFindBeatResult {
|
|
|
7087
7104
|
* Gets or sets the duration in milliseconds how long this lookup is valid.
|
|
7088
7105
|
*/
|
|
7089
7106
|
duration: number;
|
|
7107
|
+
/**
|
|
7108
|
+
* The mode how the cursor should be handled.
|
|
7109
|
+
*/
|
|
7110
|
+
cursorMode: MidiTickLookupFindBeatResultCursorMode;
|
|
7090
7111
|
get start(): number;
|
|
7091
7112
|
get end(): number;
|
|
7092
7113
|
constructor(masterBar: MasterBarTickLookup);
|
|
@@ -7154,7 +7175,7 @@ declare class MidiTickLookup {
|
|
|
7154
7175
|
* @param currentStartLookup
|
|
7155
7176
|
* @param tick
|
|
7156
7177
|
* @param visibleTracks
|
|
7157
|
-
* @param
|
|
7178
|
+
* @param isNextSearch
|
|
7158
7179
|
* @returns
|
|
7159
7180
|
*/
|
|
7160
7181
|
private findBeatInMasterBar;
|
package/dist/alphaTab.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* alphaTab v1.4.
|
|
2
|
+
* alphaTab v1.4.3 (, build 16)
|
|
3
3
|
*
|
|
4
4
|
* Copyright © 2025, Daniel Kuschny and Contributors, All rights reserved.
|
|
5
5
|
*
|
|
@@ -24338,10 +24338,10 @@
|
|
|
24338
24338
|
// 6.1 Sample Data Format in the smpl Sub-chunk
|
|
24339
24339
|
// The smpl sub-chunk, if present, contains one or more "samples" of digital audio information in the form
|
|
24340
24340
|
// of linearly coded sixteen bit, signed, little endian (least significant byte first) words.
|
|
24341
|
-
|
|
24342
|
-
samples = new Float32Array(
|
|
24343
|
-
for (let i = 0; i <
|
|
24344
|
-
samples[i] =
|
|
24341
|
+
const dataView = new DataView(sampleBytes.buffer, sampleBytes.byteOffset, sampleBytes.length);
|
|
24342
|
+
samples = new Float32Array(sampleBytes.length / 2);
|
|
24343
|
+
for (let i = 0; i < samples.length; i++) {
|
|
24344
|
+
samples[i] = dataView.getInt16(i * 2, true) / 32767;
|
|
24345
24345
|
}
|
|
24346
24346
|
}
|
|
24347
24347
|
this._sampleCache.set(key, samples);
|
|
@@ -28038,6 +28038,7 @@
|
|
|
28038
28038
|
finish(scale = 1) {
|
|
28039
28039
|
this.realBounds.scaleWith(scale);
|
|
28040
28040
|
this.visualBounds.scaleWith(scale);
|
|
28041
|
+
this.onNotesX *= scale;
|
|
28041
28042
|
if (this.notes) {
|
|
28042
28043
|
for (const n of this.notes) {
|
|
28043
28044
|
n.finish(scale);
|
|
@@ -29805,6 +29806,24 @@
|
|
|
29805
29806
|
}
|
|
29806
29807
|
}
|
|
29807
29808
|
|
|
29809
|
+
/**
|
|
29810
|
+
* Describes how a cursor should be moving.
|
|
29811
|
+
*/
|
|
29812
|
+
var MidiTickLookupFindBeatResultCursorMode;
|
|
29813
|
+
(function (MidiTickLookupFindBeatResultCursorMode) {
|
|
29814
|
+
/**
|
|
29815
|
+
* Unknown/Undetermined mode. Should not happen on user level.
|
|
29816
|
+
*/
|
|
29817
|
+
MidiTickLookupFindBeatResultCursorMode[MidiTickLookupFindBeatResultCursorMode["Unknown"] = 0] = "Unknown";
|
|
29818
|
+
/**
|
|
29819
|
+
* The cursor should animate to the next beat.
|
|
29820
|
+
*/
|
|
29821
|
+
MidiTickLookupFindBeatResultCursorMode[MidiTickLookupFindBeatResultCursorMode["ToNextBext"] = 1] = "ToNextBext";
|
|
29822
|
+
/**
|
|
29823
|
+
* The cursor should animate to the end of the bar (typically on repeats and jumps)
|
|
29824
|
+
*/
|
|
29825
|
+
MidiTickLookupFindBeatResultCursorMode[MidiTickLookupFindBeatResultCursorMode["ToEndOfBar"] = 2] = "ToEndOfBar";
|
|
29826
|
+
})(MidiTickLookupFindBeatResultCursorMode || (MidiTickLookupFindBeatResultCursorMode = {}));
|
|
29808
29827
|
/**
|
|
29809
29828
|
* Represents the results of searching the currently played beat.
|
|
29810
29829
|
* @see MidiTickLookup.FindBeat
|
|
@@ -29829,6 +29848,10 @@
|
|
|
29829
29848
|
* Gets or sets the duration in milliseconds how long this lookup is valid.
|
|
29830
29849
|
*/
|
|
29831
29850
|
this.duration = 0;
|
|
29851
|
+
/**
|
|
29852
|
+
* The mode how the cursor should be handled.
|
|
29853
|
+
*/
|
|
29854
|
+
this.cursorMode = MidiTickLookupFindBeatResultCursorMode.Unknown;
|
|
29832
29855
|
this.masterBar = masterBar;
|
|
29833
29856
|
}
|
|
29834
29857
|
calculateDuration() {
|
|
@@ -29837,7 +29860,7 @@
|
|
|
29837
29860
|
this.duration = MidiUtils.ticksToMillis(this.tickDuration, this.masterBar.tempoChanges[0].tempo);
|
|
29838
29861
|
}
|
|
29839
29862
|
else {
|
|
29840
|
-
// Performance Note: I still wonder if we cannot calculate these slices efficiently ahead-of-time.
|
|
29863
|
+
// Performance Note: I still wonder if we cannot calculate these slices efficiently ahead-of-time.
|
|
29841
29864
|
// the sub-slicing in the lookup across beats makes it a bit tricky to do on-the-fly
|
|
29842
29865
|
// but maybe on finalizing the tick lookup?
|
|
29843
29866
|
// slow path: need to walk through the tick time-axis and calculate for each slice the milliseconds
|
|
@@ -29953,20 +29976,30 @@
|
|
|
29953
29976
|
return null;
|
|
29954
29977
|
}
|
|
29955
29978
|
fillNextBeat(current, trackLookup) {
|
|
29956
|
-
current.nextBeat = this.findBeatInMasterBar(current.masterBar, current.beatLookup.nextBeat, current.end, trackLookup,
|
|
29979
|
+
current.nextBeat = this.findBeatInMasterBar(current.masterBar, current.beatLookup.nextBeat, current.end, trackLookup, true);
|
|
29957
29980
|
if (current.nextBeat == null) {
|
|
29958
29981
|
current.nextBeat = this.findBeatSlow(trackLookup, current, current.end, true);
|
|
29959
29982
|
}
|
|
29960
29983
|
// if we have the next beat take the difference between the times as duration
|
|
29961
29984
|
if (current.nextBeat) {
|
|
29962
29985
|
current.tickDuration = current.nextBeat.start - current.start;
|
|
29986
|
+
current.cursorMode = MidiTickLookupFindBeatResultCursorMode.ToNextBext;
|
|
29963
29987
|
current.calculateDuration();
|
|
29964
29988
|
}
|
|
29965
29989
|
// no next beat, animate to the end of the bar (could be an incomplete bar)
|
|
29966
29990
|
if (!current.nextBeat) {
|
|
29967
29991
|
current.tickDuration = current.masterBar.end - current.start;
|
|
29992
|
+
current.cursorMode = MidiTickLookupFindBeatResultCursorMode.ToEndOfBar;
|
|
29968
29993
|
current.calculateDuration();
|
|
29969
29994
|
}
|
|
29995
|
+
// if the next beat is not directly the next master bar (e.g. jumping back or forth)
|
|
29996
|
+
// we report no next beat and animate to the end
|
|
29997
|
+
if (current.nextBeat &&
|
|
29998
|
+
current.nextBeat.masterBar.masterBar.index != current.masterBar.masterBar.index + 1 &&
|
|
29999
|
+
(current.nextBeat.masterBar.masterBar.index != current.masterBar.masterBar.index ||
|
|
30000
|
+
current.nextBeat.beat.playbackStart <= current.beat.playbackStart)) {
|
|
30001
|
+
current.cursorMode = MidiTickLookupFindBeatResultCursorMode.ToEndOfBar;
|
|
30002
|
+
}
|
|
29970
30003
|
}
|
|
29971
30004
|
findBeatSlow(trackLookup, currentBeatHint, tick, isNextSearch) {
|
|
29972
30005
|
// get all beats within the masterbar
|
|
@@ -29994,7 +30027,7 @@
|
|
|
29994
30027
|
// scan through beats and find first one which has a beat visible
|
|
29995
30028
|
while (masterBar) {
|
|
29996
30029
|
if (masterBar.firstBeat) {
|
|
29997
|
-
let beat = this.findBeatInMasterBar(masterBar, masterBar.firstBeat, tick, trackLookup,
|
|
30030
|
+
let beat = this.findBeatInMasterBar(masterBar, masterBar.firstBeat, tick, trackLookup, isNextSearch);
|
|
29998
30031
|
if (beat) {
|
|
29999
30032
|
return beat;
|
|
30000
30033
|
}
|
|
@@ -30009,10 +30042,10 @@
|
|
|
30009
30042
|
* @param currentStartLookup
|
|
30010
30043
|
* @param tick
|
|
30011
30044
|
* @param visibleTracks
|
|
30012
|
-
* @param
|
|
30045
|
+
* @param isNextSearch
|
|
30013
30046
|
* @returns
|
|
30014
30047
|
*/
|
|
30015
|
-
findBeatInMasterBar(masterBar, currentStartLookup, tick, visibleTracks,
|
|
30048
|
+
findBeatInMasterBar(masterBar, currentStartLookup, tick, visibleTracks, isNextSearch) {
|
|
30016
30049
|
if (!currentStartLookup) {
|
|
30017
30050
|
return null;
|
|
30018
30051
|
}
|
|
@@ -30026,7 +30059,7 @@
|
|
|
30026
30059
|
// found the matching beat lookup but none of the beats are visible
|
|
30027
30060
|
// in this case scan further to the next lookup which has any visible beat
|
|
30028
30061
|
if (!startBeat) {
|
|
30029
|
-
if (
|
|
30062
|
+
if (isNextSearch) {
|
|
30030
30063
|
let currentMasterBar = masterBar;
|
|
30031
30064
|
while (currentMasterBar != null && startBeat == null) {
|
|
30032
30065
|
while (currentStartLookup != null) {
|
|
@@ -30072,15 +30105,15 @@
|
|
|
30072
30105
|
if (startBeat == null) {
|
|
30073
30106
|
return null;
|
|
30074
30107
|
}
|
|
30075
|
-
const result = this.createResult(masterBar, startBeatLookup, startBeat,
|
|
30108
|
+
const result = this.createResult(masterBar, startBeatLookup, startBeat, isNextSearch, visibleTracks);
|
|
30076
30109
|
return result;
|
|
30077
30110
|
}
|
|
30078
|
-
createResult(masterBar, beatLookup, beat,
|
|
30111
|
+
createResult(masterBar, beatLookup, beat, isNextSearch, visibleTracks) {
|
|
30079
30112
|
const result = new MidiTickLookupFindBeatResult(masterBar);
|
|
30080
30113
|
result.beat = beat;
|
|
30081
30114
|
result.beatLookup = beatLookup;
|
|
30082
30115
|
result.tickDuration = beatLookup.end - beatLookup.start;
|
|
30083
|
-
if (
|
|
30116
|
+
if (!isNextSearch) {
|
|
30084
30117
|
this.fillNextBeat(result, visibleTracks);
|
|
30085
30118
|
}
|
|
30086
30119
|
result.calculateDuration();
|
|
@@ -32818,7 +32851,7 @@
|
|
|
32818
32851
|
this.player.positionChanged.on(e => {
|
|
32819
32852
|
this._previousTick = e.currentTick;
|
|
32820
32853
|
this.uiFacade.beginInvoke(() => {
|
|
32821
|
-
this.cursorUpdateTick(e.currentTick, false);
|
|
32854
|
+
this.cursorUpdateTick(e.currentTick, false, false, e.isSeek);
|
|
32822
32855
|
});
|
|
32823
32856
|
});
|
|
32824
32857
|
this.player.stateChanged.on(e => {
|
|
@@ -32839,14 +32872,14 @@
|
|
|
32839
32872
|
* @param stop
|
|
32840
32873
|
* @param shouldScroll whether we should scroll to the bar (if scrolling is active)
|
|
32841
32874
|
*/
|
|
32842
|
-
cursorUpdateTick(tick, stop, shouldScroll = false) {
|
|
32875
|
+
cursorUpdateTick(tick, stop, shouldScroll = false, forceUpdate = false) {
|
|
32843
32876
|
let cache = this._tickCache;
|
|
32844
32877
|
if (cache) {
|
|
32845
32878
|
let tracks = this._trackIndexLookup;
|
|
32846
32879
|
if (tracks != null && tracks.size > 0) {
|
|
32847
32880
|
let beat = cache.findBeat(tracks, tick, this._currentBeat);
|
|
32848
32881
|
if (beat) {
|
|
32849
|
-
this.cursorUpdateBeat(beat, stop, shouldScroll);
|
|
32882
|
+
this.cursorUpdateBeat(beat, stop, shouldScroll, forceUpdate || this.playerState === PlayerState.Paused);
|
|
32850
32883
|
}
|
|
32851
32884
|
}
|
|
32852
32885
|
}
|
|
@@ -32872,7 +32905,8 @@
|
|
|
32872
32905
|
if (!forceUpdate &&
|
|
32873
32906
|
beat === previousBeat?.beat &&
|
|
32874
32907
|
cache === previousCache &&
|
|
32875
|
-
previousState === this._playerState
|
|
32908
|
+
previousState === this._playerState &&
|
|
32909
|
+
previousBeat?.start === lookupResult.start) {
|
|
32876
32910
|
return;
|
|
32877
32911
|
}
|
|
32878
32912
|
let beatBoundings = cache.findBeat(beat);
|
|
@@ -32885,7 +32919,7 @@
|
|
|
32885
32919
|
this._previousCursorCache = cache;
|
|
32886
32920
|
this._previousStateForCursor = this._playerState;
|
|
32887
32921
|
this.uiFacade.beginInvoke(() => {
|
|
32888
|
-
this.internalCursorUpdateBeat(beat, nextBeat, duration, stop, beatsToHighlight, cache, beatBoundings, shouldScroll);
|
|
32922
|
+
this.internalCursorUpdateBeat(beat, nextBeat, duration, stop, beatsToHighlight, cache, beatBoundings, shouldScroll, lookupResult.cursorMode);
|
|
32889
32923
|
});
|
|
32890
32924
|
}
|
|
32891
32925
|
/**
|
|
@@ -32948,7 +32982,7 @@
|
|
|
32948
32982
|
}
|
|
32949
32983
|
}
|
|
32950
32984
|
}
|
|
32951
|
-
internalCursorUpdateBeat(beat, nextBeat, duration, stop, beatsToHighlight, cache, beatBoundings, shouldScroll) {
|
|
32985
|
+
internalCursorUpdateBeat(beat, nextBeat, duration, stop, beatsToHighlight, cache, beatBoundings, shouldScroll, cursorMode) {
|
|
32952
32986
|
const barCursor = this._barCursor;
|
|
32953
32987
|
const beatCursor = this._beatCursor;
|
|
32954
32988
|
let barBoundings = beatBoundings.barBounds.masterBarBounds;
|
|
@@ -32980,7 +33014,7 @@
|
|
|
32980
33014
|
if (this.settings.player.enableAnimatedBeatCursor) {
|
|
32981
33015
|
let nextBeatX = barBoundings.visualBounds.x + barBoundings.visualBounds.w;
|
|
32982
33016
|
// get position of next beat on same system
|
|
32983
|
-
if (nextBeat) {
|
|
33017
|
+
if (nextBeat && cursorMode == MidiTickLookupFindBeatResultCursorMode.ToNextBext) {
|
|
32984
33018
|
// if we are moving within the same bar or to the next bar
|
|
32985
33019
|
// transition to the next beat, otherwise transition to the end of the bar.
|
|
32986
33020
|
let nextBeatBoundings = cache.findBeat(nextBeat);
|
|
@@ -52133,8 +52167,8 @@
|
|
|
52133
52167
|
// </auto-generated>
|
|
52134
52168
|
class VersionInfo {
|
|
52135
52169
|
}
|
|
52136
|
-
VersionInfo.version = '1.4.
|
|
52137
|
-
VersionInfo.date = '2025-
|
|
52170
|
+
VersionInfo.version = '1.4.3';
|
|
52171
|
+
VersionInfo.date = '2025-04-13T21:11:16.350Z';
|
|
52138
52172
|
|
|
52139
52173
|
var index$4 = /*#__PURE__*/Object.freeze({
|
|
52140
52174
|
__proto__: null,
|