@coderline/alphatab 1.3.0-alpha.140 → 1.3.0-alpha.144
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.d.ts +12 -2
- package/dist/alphaTab.js +158 -114
- package/dist/alphaTab.min.js +3 -3
- package/dist/alphaTab.min.mjs +3 -3
- package/dist/alphaTab.mjs +158 -114
- package/package.json +1 -1
package/dist/alphaTab.d.ts
CHANGED
|
@@ -4730,6 +4730,7 @@ declare class AlphaTabApiBase<TSettings> {
|
|
|
4730
4730
|
private _previousTick;
|
|
4731
4731
|
private _playerState;
|
|
4732
4732
|
private _currentBeat;
|
|
4733
|
+
private _currentBarBounds;
|
|
4733
4734
|
private _previousStateForCursor;
|
|
4734
4735
|
private _previousCursorCache;
|
|
4735
4736
|
private _lastScroll;
|
|
@@ -4739,12 +4740,18 @@ declare class AlphaTabApiBase<TSettings> {
|
|
|
4739
4740
|
* updates the cursors to highlight the beat at the specified tick position
|
|
4740
4741
|
* @param tick
|
|
4741
4742
|
* @param stop
|
|
4743
|
+
* @param shouldScroll whether we should scroll to the bar (if scrolling is active)
|
|
4742
4744
|
*/
|
|
4743
4745
|
private cursorUpdateTick;
|
|
4744
4746
|
/**
|
|
4745
4747
|
* updates the cursors to highlight the specified beat
|
|
4746
4748
|
*/
|
|
4747
4749
|
private cursorUpdateBeat;
|
|
4750
|
+
/**
|
|
4751
|
+
* Initiates a scroll to the cursor
|
|
4752
|
+
*/
|
|
4753
|
+
scrollToCursor(): void;
|
|
4754
|
+
internalScrollToCursor(barBoundings: MasterBarBounds): void;
|
|
4748
4755
|
private internalCursorUpdateBeat;
|
|
4749
4756
|
playedBeatChanged: IEventEmitterOfT<Beat>;
|
|
4750
4757
|
private onPlayedBeatChanged;
|
|
@@ -6151,7 +6158,7 @@ declare class StaveGroup {
|
|
|
6151
6158
|
paint(cx: number, cy: number, canvas: ICanvas): void;
|
|
6152
6159
|
paintPartial(cx: number, cy: number, canvas: ICanvas, startIndex: number, count: number): void;
|
|
6153
6160
|
finalizeGroup(): void;
|
|
6154
|
-
|
|
6161
|
+
buildBoundingsLookup(cx: number, cy: number): void;
|
|
6155
6162
|
getBarX(index: number): number;
|
|
6156
6163
|
}
|
|
6157
6164
|
|
|
@@ -6428,7 +6435,7 @@ declare class TuningContainerGlyph extends RowContainerGlyph {
|
|
|
6428
6435
|
}
|
|
6429
6436
|
|
|
6430
6437
|
/**
|
|
6431
|
-
* This is the base
|
|
6438
|
+
* This is the base class for creating new layouting engines for the score renderer.
|
|
6432
6439
|
*/
|
|
6433
6440
|
declare abstract class ScoreLayout {
|
|
6434
6441
|
private _barRendererLookup;
|
|
@@ -6472,6 +6479,9 @@ declare class ScoreRenderer implements IScoreRenderer {
|
|
|
6472
6479
|
canvas: ICanvas | null;
|
|
6473
6480
|
score: Score | null;
|
|
6474
6481
|
tracks: Track[] | null;
|
|
6482
|
+
/**
|
|
6483
|
+
* @internal
|
|
6484
|
+
*/
|
|
6475
6485
|
layout: ScoreLayout | null;
|
|
6476
6486
|
settings: Settings;
|
|
6477
6487
|
boundsLookup: BoundsLookup | null;
|
package/dist/alphaTab.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* alphaTab v1.3.0-alpha.
|
|
2
|
+
* alphaTab v1.3.0-alpha.144 (develop, build 144)
|
|
3
3
|
*
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2022, Daniel Kuschny and Contributors, All rights reserved.
|
|
5
5
|
*
|
|
6
6
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
7
7
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
@@ -4585,7 +4585,12 @@
|
|
|
4585
4585
|
if (this.masterBars.length !== 0) {
|
|
4586
4586
|
bar.previousMasterBar = this.masterBars[this.masterBars.length - 1];
|
|
4587
4587
|
bar.previousMasterBar.nextMasterBar = bar;
|
|
4588
|
-
|
|
4588
|
+
// TODO: this will not work on anacrusis. Correct anacrusis durations are only working
|
|
4589
|
+
// when there are beats with playback positions already computed which requires full finish
|
|
4590
|
+
// chicken-egg problem here. temporarily forcing anacrusis length here to 0
|
|
4591
|
+
bar.start =
|
|
4592
|
+
bar.previousMasterBar.start +
|
|
4593
|
+
(bar.previousMasterBar.isAnacrusis ? 0 : bar.previousMasterBar.calculateDuration());
|
|
4589
4594
|
}
|
|
4590
4595
|
// if the group is closed only the next upcoming header can
|
|
4591
4596
|
// reopen the group in case of a repeat alternative, so we
|
|
@@ -14411,7 +14416,7 @@
|
|
|
14411
14416
|
this.firstTimeSignatureNumerator = 0;
|
|
14412
14417
|
this.firstTimeSignatureDenominator = 0;
|
|
14413
14418
|
this.synthData = [];
|
|
14414
|
-
this.division =
|
|
14419
|
+
this.division = MidiUtils.QuarterTime;
|
|
14415
14420
|
this.eventIndex = 0;
|
|
14416
14421
|
this.currentTime = 0;
|
|
14417
14422
|
this.playbackRange = null;
|
|
@@ -14921,13 +14926,12 @@
|
|
|
14921
14926
|
const samples = new Float32Array(samplesLeft);
|
|
14922
14927
|
let samplesPos = 0;
|
|
14923
14928
|
const sampleBuffer = new Uint8Array(2048);
|
|
14924
|
-
const testBuffer = new Int16Array((sampleBuffer.length / 2) | 0);
|
|
14925
14929
|
while (samplesLeft > 0) {
|
|
14926
14930
|
let samplesToRead = Math.min(samplesLeft, (sampleBuffer.length / 2) | 0);
|
|
14927
14931
|
reader.read(sampleBuffer, 0, samplesToRead * 2);
|
|
14928
14932
|
for (let i = 0; i < samplesToRead; i++) {
|
|
14929
|
-
|
|
14930
|
-
samples[samplesPos + i] =
|
|
14933
|
+
const shortSample = TypeConversions.int32ToInt16((sampleBuffer[i * 2 + 1] << 8) | sampleBuffer[i * 2]);
|
|
14934
|
+
samples[samplesPos + i] = shortSample / 32767;
|
|
14931
14935
|
}
|
|
14932
14936
|
samplesLeft -= samplesToRead;
|
|
14933
14937
|
samplesPos += samplesToRead;
|
|
@@ -21513,6 +21517,9 @@
|
|
|
21513
21517
|
this.canvas = null;
|
|
21514
21518
|
this.score = null;
|
|
21515
21519
|
this.tracks = null;
|
|
21520
|
+
/**
|
|
21521
|
+
* @internal
|
|
21522
|
+
*/
|
|
21516
21523
|
this.layout = null;
|
|
21517
21524
|
this.boundsLookup = null;
|
|
21518
21525
|
this.width = 0;
|
|
@@ -24039,6 +24046,7 @@
|
|
|
24039
24046
|
this._previousTick = 0;
|
|
24040
24047
|
this._playerState = PlayerState.Paused;
|
|
24041
24048
|
this._currentBeat = null;
|
|
24049
|
+
this._currentBarBounds = null;
|
|
24042
24050
|
this._previousStateForCursor = PlayerState.Paused;
|
|
24043
24051
|
this._previousCursorCache = null;
|
|
24044
24052
|
this._lastScroll = 0;
|
|
@@ -24641,7 +24649,7 @@
|
|
|
24641
24649
|
this._playerState = PlayerState.Paused;
|
|
24642
24650
|
// we need to update our position caches if we render a tablature
|
|
24643
24651
|
this.renderer.postRenderFinished.on(() => {
|
|
24644
|
-
this.cursorUpdateTick(this._previousTick, false);
|
|
24652
|
+
this.cursorUpdateTick(this._previousTick, false, this._previousTick > 10);
|
|
24645
24653
|
});
|
|
24646
24654
|
if (this.player) {
|
|
24647
24655
|
this.player.positionChanged.on(e => {
|
|
@@ -24668,15 +24676,16 @@
|
|
|
24668
24676
|
* updates the cursors to highlight the beat at the specified tick position
|
|
24669
24677
|
* @param tick
|
|
24670
24678
|
* @param stop
|
|
24679
|
+
* @param shouldScroll whether we should scroll to the bar (if scrolling is active)
|
|
24671
24680
|
*/
|
|
24672
|
-
cursorUpdateTick(tick, stop) {
|
|
24681
|
+
cursorUpdateTick(tick, stop, shouldScroll = false) {
|
|
24673
24682
|
let cache = this._tickCache;
|
|
24674
24683
|
if (cache) {
|
|
24675
24684
|
let tracks = this.tracks;
|
|
24676
24685
|
if (tracks.length > 0) {
|
|
24677
24686
|
let beat = cache.findBeat(tracks, tick, this._currentBeat);
|
|
24678
24687
|
if (beat) {
|
|
24679
|
-
this.cursorUpdateBeat(beat, stop);
|
|
24688
|
+
this.cursorUpdateBeat(beat, stop, shouldScroll);
|
|
24680
24689
|
}
|
|
24681
24690
|
}
|
|
24682
24691
|
}
|
|
@@ -24684,7 +24693,7 @@
|
|
|
24684
24693
|
/**
|
|
24685
24694
|
* updates the cursors to highlight the specified beat
|
|
24686
24695
|
*/
|
|
24687
|
-
cursorUpdateBeat(lookupResult, stop) {
|
|
24696
|
+
cursorUpdateBeat(lookupResult, stop, shouldScroll) {
|
|
24688
24697
|
const beat = lookupResult.currentBeat;
|
|
24689
24698
|
const nextBeat = lookupResult.nextBeat;
|
|
24690
24699
|
const duration = lookupResult.duration;
|
|
@@ -24699,9 +24708,6 @@
|
|
|
24699
24708
|
let previousBeat = this._currentBeat;
|
|
24700
24709
|
let previousCache = this._previousCursorCache;
|
|
24701
24710
|
let previousState = this._previousStateForCursor;
|
|
24702
|
-
this._currentBeat = lookupResult;
|
|
24703
|
-
this._previousCursorCache = cache;
|
|
24704
|
-
this._previousStateForCursor = this._playerState;
|
|
24705
24711
|
if (beat === (previousBeat === null || previousBeat === void 0 ? void 0 : previousBeat.currentBeat) && cache === previousCache && previousState === this._playerState) {
|
|
24706
24712
|
return;
|
|
24707
24713
|
}
|
|
@@ -24709,15 +24715,81 @@
|
|
|
24709
24715
|
if (!beatBoundings) {
|
|
24710
24716
|
return;
|
|
24711
24717
|
}
|
|
24718
|
+
// only if we really found some bounds we remember the beat and cache we used to
|
|
24719
|
+
// actually show the cursor
|
|
24720
|
+
this._currentBeat = lookupResult;
|
|
24721
|
+
this._previousCursorCache = cache;
|
|
24722
|
+
this._previousStateForCursor = this._playerState;
|
|
24712
24723
|
this.uiFacade.beginInvoke(() => {
|
|
24713
|
-
this.internalCursorUpdateBeat(beat, nextBeat, duration, stop, beatsToHighlight, cache, beatBoundings);
|
|
24724
|
+
this.internalCursorUpdateBeat(beat, nextBeat, duration, stop, beatsToHighlight, cache, beatBoundings, shouldScroll);
|
|
24714
24725
|
});
|
|
24715
24726
|
}
|
|
24716
|
-
|
|
24727
|
+
/**
|
|
24728
|
+
* Initiates a scroll to the cursor
|
|
24729
|
+
*/
|
|
24730
|
+
scrollToCursor() {
|
|
24731
|
+
const barBounds = this._currentBarBounds;
|
|
24732
|
+
if (barBounds) {
|
|
24733
|
+
this.internalScrollToCursor(barBounds);
|
|
24734
|
+
}
|
|
24735
|
+
}
|
|
24736
|
+
internalScrollToCursor(barBoundings) {
|
|
24737
|
+
let scrollElement = this.uiFacade.getScrollContainer();
|
|
24738
|
+
let isVertical = Environment.getLayoutEngineFactory(this.settings.display.layoutMode).vertical;
|
|
24739
|
+
let mode = this.settings.player.scrollMode;
|
|
24740
|
+
if (isVertical) {
|
|
24741
|
+
// when scrolling on the y-axis, we preliminary check if the new beat/bar have
|
|
24742
|
+
// moved on the y-axis
|
|
24743
|
+
let y = barBoundings.realBounds.y + this.settings.player.scrollOffsetY;
|
|
24744
|
+
if (y !== this._lastScroll) {
|
|
24745
|
+
this._lastScroll = y;
|
|
24746
|
+
switch (mode) {
|
|
24747
|
+
case exports.ScrollMode.Continuous:
|
|
24748
|
+
let elementOffset = this.uiFacade.getOffset(scrollElement, this.container);
|
|
24749
|
+
this.uiFacade.scrollToY(scrollElement, elementOffset.y + y, this.settings.player.scrollSpeed);
|
|
24750
|
+
break;
|
|
24751
|
+
case exports.ScrollMode.OffScreen:
|
|
24752
|
+
let elementBottom = scrollElement.scrollTop + this.uiFacade.getOffset(null, scrollElement).h;
|
|
24753
|
+
if (barBoundings.visualBounds.y + barBoundings.visualBounds.h >= elementBottom ||
|
|
24754
|
+
barBoundings.visualBounds.y < scrollElement.scrollTop) {
|
|
24755
|
+
let scrollTop = barBoundings.realBounds.y + this.settings.player.scrollOffsetY;
|
|
24756
|
+
this.uiFacade.scrollToY(scrollElement, scrollTop, this.settings.player.scrollSpeed);
|
|
24757
|
+
}
|
|
24758
|
+
break;
|
|
24759
|
+
}
|
|
24760
|
+
}
|
|
24761
|
+
}
|
|
24762
|
+
else {
|
|
24763
|
+
// when scrolling on the x-axis, we preliminary check if the new bar has
|
|
24764
|
+
// moved on the x-axis
|
|
24765
|
+
let x = barBoundings.visualBounds.x;
|
|
24766
|
+
if (x !== this._lastScroll) {
|
|
24767
|
+
this._lastScroll = x;
|
|
24768
|
+
switch (mode) {
|
|
24769
|
+
case exports.ScrollMode.Continuous:
|
|
24770
|
+
let scrollLeftContinuous = barBoundings.realBounds.x + this.settings.player.scrollOffsetX;
|
|
24771
|
+
this._lastScroll = barBoundings.visualBounds.x;
|
|
24772
|
+
this.uiFacade.scrollToX(scrollElement, scrollLeftContinuous, this.settings.player.scrollSpeed);
|
|
24773
|
+
break;
|
|
24774
|
+
case exports.ScrollMode.OffScreen:
|
|
24775
|
+
let elementRight = scrollElement.scrollLeft + this.uiFacade.getOffset(null, scrollElement).w;
|
|
24776
|
+
if (barBoundings.visualBounds.x + barBoundings.visualBounds.w >= elementRight ||
|
|
24777
|
+
barBoundings.visualBounds.x < scrollElement.scrollLeft) {
|
|
24778
|
+
let scrollLeftOffScreen = barBoundings.realBounds.x + this.settings.player.scrollOffsetX;
|
|
24779
|
+
this._lastScroll = barBoundings.visualBounds.x;
|
|
24780
|
+
this.uiFacade.scrollToX(scrollElement, scrollLeftOffScreen, this.settings.player.scrollSpeed);
|
|
24781
|
+
}
|
|
24782
|
+
break;
|
|
24783
|
+
}
|
|
24784
|
+
}
|
|
24785
|
+
}
|
|
24786
|
+
}
|
|
24787
|
+
internalCursorUpdateBeat(beat, nextBeat, duration, stop, beatsToHighlight, cache, beatBoundings, shouldScroll) {
|
|
24717
24788
|
let barCursor = this._barCursor;
|
|
24718
24789
|
let beatCursor = this._beatCursor;
|
|
24719
24790
|
let barBoundings = beatBoundings.barBounds.masterBarBounds;
|
|
24720
24791
|
let barBounds = barBoundings.visualBounds;
|
|
24792
|
+
this._currentBarBounds = barBoundings;
|
|
24721
24793
|
barCursor.setBounds(barBounds.x, barBounds.y, barBounds.w, barBounds.h);
|
|
24722
24794
|
// move beat to start position immediately
|
|
24723
24795
|
if (this.settings.player.enableAnimatedBeatCursor) {
|
|
@@ -24728,90 +24800,45 @@
|
|
|
24728
24800
|
if (this.settings.player.enableElementHighlighting) {
|
|
24729
24801
|
this.uiFacade.removeHighlights();
|
|
24730
24802
|
}
|
|
24731
|
-
|
|
24732
|
-
|
|
24733
|
-
|
|
24734
|
-
|
|
24735
|
-
|
|
24736
|
-
|
|
24737
|
-
|
|
24738
|
-
|
|
24739
|
-
|
|
24740
|
-
|
|
24741
|
-
|
|
24742
|
-
|
|
24743
|
-
|
|
24744
|
-
|
|
24745
|
-
|
|
24746
|
-
|
|
24747
|
-
|
|
24748
|
-
|
|
24749
|
-
|
|
24750
|
-
|
|
24751
|
-
|
|
24752
|
-
|
|
24753
|
-
}
|
|
24754
|
-
}
|
|
24755
|
-
}
|
|
24756
|
-
// we need to put the transition to an own animation frame
|
|
24757
|
-
// otherwise the stop animation above is not applied.
|
|
24758
|
-
this.uiFacade.beginInvoke(() => {
|
|
24759
|
-
beatCursor.transitionToX(duration, nextBeatX);
|
|
24760
|
-
});
|
|
24761
|
-
}
|
|
24762
|
-
}
|
|
24763
|
-
if (!this._beatMouseDown && this.settings.player.scrollMode !== exports.ScrollMode.Off) {
|
|
24764
|
-
let scrollElement = this.uiFacade.getScrollContainer();
|
|
24765
|
-
let isVertical = Environment.getLayoutEngineFactory(this.settings.display.layoutMode).vertical;
|
|
24766
|
-
let mode = this.settings.player.scrollMode;
|
|
24767
|
-
if (isVertical) {
|
|
24768
|
-
// when scrolling on the y-axis, we preliminary check if the new beat/bar have
|
|
24769
|
-
// moved on the y-axis
|
|
24770
|
-
let y = barBoundings.realBounds.y + this.settings.player.scrollOffsetY;
|
|
24771
|
-
if (y !== this._lastScroll) {
|
|
24772
|
-
this._lastScroll = y;
|
|
24773
|
-
switch (mode) {
|
|
24774
|
-
case exports.ScrollMode.Continuous:
|
|
24775
|
-
let elementOffset = this.uiFacade.getOffset(scrollElement, this.container);
|
|
24776
|
-
this.uiFacade.scrollToY(scrollElement, elementOffset.y + y, this.settings.player.scrollSpeed);
|
|
24777
|
-
break;
|
|
24778
|
-
case exports.ScrollMode.OffScreen:
|
|
24779
|
-
let elementBottom = scrollElement.scrollTop + this.uiFacade.getOffset(null, scrollElement).h;
|
|
24780
|
-
if (barBoundings.visualBounds.y + barBoundings.visualBounds.h >= elementBottom ||
|
|
24781
|
-
barBoundings.visualBounds.y < scrollElement.scrollTop) {
|
|
24782
|
-
let scrollTop = barBoundings.realBounds.y + this.settings.player.scrollOffsetY;
|
|
24783
|
-
this.uiFacade.scrollToY(scrollElement, scrollTop, this.settings.player.scrollSpeed);
|
|
24784
|
-
}
|
|
24785
|
-
break;
|
|
24786
|
-
}
|
|
24787
|
-
}
|
|
24788
|
-
}
|
|
24789
|
-
else {
|
|
24790
|
-
// when scrolling on the x-axis, we preliminary check if the new bar has
|
|
24791
|
-
// moved on the x-axis
|
|
24792
|
-
let x = barBoundings.visualBounds.x;
|
|
24793
|
-
if (x !== this._lastScroll) {
|
|
24794
|
-
this._lastScroll = x;
|
|
24795
|
-
switch (mode) {
|
|
24796
|
-
case exports.ScrollMode.Continuous:
|
|
24797
|
-
let scrollLeftContinuous = barBoundings.realBounds.x + this.settings.player.scrollOffsetX;
|
|
24798
|
-
this._lastScroll = barBoundings.visualBounds.x;
|
|
24799
|
-
this.uiFacade.scrollToX(scrollElement, scrollLeftContinuous, this.settings.player.scrollSpeed);
|
|
24800
|
-
break;
|
|
24801
|
-
case exports.ScrollMode.OffScreen:
|
|
24802
|
-
let elementRight = scrollElement.scrollLeft + this.uiFacade.getOffset(null, scrollElement).w;
|
|
24803
|
-
if (barBoundings.visualBounds.x + barBoundings.visualBounds.w >= elementRight ||
|
|
24804
|
-
barBoundings.visualBounds.x < scrollElement.scrollLeft) {
|
|
24805
|
-
let scrollLeftOffScreen = barBoundings.realBounds.x + this.settings.player.scrollOffsetX;
|
|
24806
|
-
this._lastScroll = barBoundings.visualBounds.x;
|
|
24807
|
-
this.uiFacade.scrollToX(scrollElement, scrollLeftOffScreen, this.settings.player.scrollSpeed);
|
|
24808
|
-
}
|
|
24809
|
-
break;
|
|
24803
|
+
// actively playing? -> animate cursor and highlight items
|
|
24804
|
+
let shouldNotifyBeatChange = false;
|
|
24805
|
+
if (this._playerState === PlayerState.Playing && !stop) {
|
|
24806
|
+
if (this.settings.player.enableElementHighlighting && beatsToHighlight) {
|
|
24807
|
+
for (let highlight of beatsToHighlight) {
|
|
24808
|
+
let className = BeatContainerGlyph.getGroupId(highlight);
|
|
24809
|
+
this.uiFacade.highlightElements(className, beat.voice.bar.index);
|
|
24810
|
+
}
|
|
24811
|
+
}
|
|
24812
|
+
if (this.settings.player.enableAnimatedBeatCursor) {
|
|
24813
|
+
let nextBeatX = barBoundings.visualBounds.x + barBoundings.visualBounds.w;
|
|
24814
|
+
// get position of next beat on same stavegroup
|
|
24815
|
+
if (nextBeat) {
|
|
24816
|
+
// if we are moving within the same bar or to the next bar
|
|
24817
|
+
// transition to the next beat, otherwise transition to the end of the bar.
|
|
24818
|
+
if ((nextBeat.voice.bar.index === beat.voice.bar.index && nextBeat.index > beat.index) ||
|
|
24819
|
+
nextBeat.voice.bar.index === beat.voice.bar.index + 1) {
|
|
24820
|
+
let nextBeatBoundings = cache.findBeat(nextBeat);
|
|
24821
|
+
if (nextBeatBoundings &&
|
|
24822
|
+
nextBeatBoundings.barBounds.masterBarBounds.staveGroupBounds ===
|
|
24823
|
+
barBoundings.staveGroupBounds) {
|
|
24824
|
+
nextBeatX = nextBeatBoundings.visualBounds.x;
|
|
24810
24825
|
}
|
|
24811
24826
|
}
|
|
24812
24827
|
}
|
|
24828
|
+
// we need to put the transition to an own animation frame
|
|
24829
|
+
// otherwise the stop animation above is not applied.
|
|
24830
|
+
this.uiFacade.beginInvoke(() => {
|
|
24831
|
+
beatCursor.transitionToX(duration / this.playbackSpeed, nextBeatX);
|
|
24832
|
+
});
|
|
24813
24833
|
}
|
|
24814
|
-
|
|
24834
|
+
shouldScroll = !stop;
|
|
24835
|
+
shouldNotifyBeatChange = true;
|
|
24836
|
+
}
|
|
24837
|
+
if (shouldScroll && !this._beatMouseDown && this.settings.player.scrollMode !== exports.ScrollMode.Off) {
|
|
24838
|
+
this.internalScrollToCursor(barBoundings);
|
|
24839
|
+
}
|
|
24840
|
+
// trigger an event for others to indicate which beat/bar is played
|
|
24841
|
+
if (shouldNotifyBeatChange) {
|
|
24815
24842
|
this.onPlayedBeatChanged(beat);
|
|
24816
24843
|
}
|
|
24817
24844
|
}
|
|
@@ -25118,8 +25145,10 @@
|
|
|
25118
25145
|
if (this._isDestroyed) {
|
|
25119
25146
|
return;
|
|
25120
25147
|
}
|
|
25121
|
-
this.
|
|
25122
|
-
|
|
25148
|
+
if (this.score !== null && this.tracks.length > 0) {
|
|
25149
|
+
this.playerPositionChanged.trigger(e);
|
|
25150
|
+
this.uiFacade.triggerEvent(this.container, 'playerPositionChanged', e);
|
|
25151
|
+
}
|
|
25123
25152
|
}
|
|
25124
25153
|
onMidiEventsPlayed(e) {
|
|
25125
25154
|
if (this._isDestroyed) {
|
|
@@ -26580,6 +26609,7 @@
|
|
|
26580
26609
|
canvasElement.style.fontSize = '0';
|
|
26581
26610
|
canvasElement.style.overflow = 'hidden';
|
|
26582
26611
|
canvasElement.style.lineHeight = '0';
|
|
26612
|
+
canvasElement.style.position = 'relative';
|
|
26583
26613
|
return new HtmlElementContainer(canvasElement);
|
|
26584
26614
|
}
|
|
26585
26615
|
triggerEvent(container, name, details = null, originalEvent) {
|
|
@@ -32042,7 +32072,6 @@
|
|
|
32042
32072
|
this.paintPartial(cx + this.x, cy + this.y, canvas, 0, this.masterBarsRenderers.length);
|
|
32043
32073
|
}
|
|
32044
32074
|
paintPartial(cx, cy, canvas, startIndex, count) {
|
|
32045
|
-
this.buildBoundingsLookup(cx, cy);
|
|
32046
32075
|
for (let i = 0, j = this._allStaves.length; i < j; i++) {
|
|
32047
32076
|
this._allStaves[i].paint(cx, cy, canvas, startIndex, count);
|
|
32048
32077
|
}
|
|
@@ -32300,7 +32329,7 @@
|
|
|
32300
32329
|
}
|
|
32301
32330
|
}
|
|
32302
32331
|
/**
|
|
32303
|
-
* This is the base
|
|
32332
|
+
* This is the base class for creating new layouting engines for the score renderer.
|
|
32304
32333
|
*/
|
|
32305
32334
|
class ScoreLayout {
|
|
32306
32335
|
constructor(renderer) {
|
|
@@ -32514,7 +32543,7 @@
|
|
|
32514
32543
|
: this.firstBarX;
|
|
32515
32544
|
e.y = y;
|
|
32516
32545
|
e.totalWidth = this.width;
|
|
32517
|
-
e.totalHeight =
|
|
32546
|
+
e.totalHeight = y + height;
|
|
32518
32547
|
e.firstMasterBarIndex = -1;
|
|
32519
32548
|
e.lastMasterBarIndex = -1;
|
|
32520
32549
|
this.registerPartial(e, canvas => {
|
|
@@ -32529,6 +32558,7 @@
|
|
|
32529
32558
|
|
|
32530
32559
|
class HorizontalScreenLayoutPartialInfo {
|
|
32531
32560
|
constructor() {
|
|
32561
|
+
this.x = 0;
|
|
32532
32562
|
this.width = 0;
|
|
32533
32563
|
this.masterBars = [];
|
|
32534
32564
|
}
|
|
@@ -32597,6 +32627,7 @@
|
|
|
32597
32627
|
let countPerPartial = this.renderer.settings.display.barCountPerPartial;
|
|
32598
32628
|
let partials = [];
|
|
32599
32629
|
let currentPartial = new HorizontalScreenLayoutPartialInfo();
|
|
32630
|
+
let renderX = 0;
|
|
32600
32631
|
while (currentBarIndex <= endBarIndex) {
|
|
32601
32632
|
let result = this._group.addBars(this.renderer.tracks, currentBarIndex);
|
|
32602
32633
|
if (result) {
|
|
@@ -32606,6 +32637,8 @@
|
|
|
32606
32637
|
let previousPartial = partials[partials.length - 1];
|
|
32607
32638
|
previousPartial.masterBars.push(score.masterBars[currentBarIndex]);
|
|
32608
32639
|
previousPartial.width += result.width;
|
|
32640
|
+
renderX += result.width;
|
|
32641
|
+
currentPartial.x += renderX;
|
|
32609
32642
|
}
|
|
32610
32643
|
else {
|
|
32611
32644
|
currentPartial.masterBars.push(score.masterBars[currentBarIndex]);
|
|
@@ -32613,14 +32646,17 @@
|
|
|
32613
32646
|
// no targetPartial here because previous partials already handled this code
|
|
32614
32647
|
if (currentPartial.masterBars.length >= countPerPartial) {
|
|
32615
32648
|
if (partials.length === 0) {
|
|
32616
|
-
|
|
32649
|
+
// respect accolade and on first partial
|
|
32650
|
+
currentPartial.width += this._group.accoladeSpacing + this._pagePadding[0];
|
|
32617
32651
|
}
|
|
32652
|
+
renderX += currentPartial.width;
|
|
32618
32653
|
partials.push(currentPartial);
|
|
32619
32654
|
Logger.debug(this.name, 'Finished partial from bar ' +
|
|
32620
32655
|
currentPartial.masterBars[0].index +
|
|
32621
32656
|
' to ' +
|
|
32622
32657
|
currentPartial.masterBars[currentPartial.masterBars.length - 1].index, null);
|
|
32623
32658
|
currentPartial = new HorizontalScreenLayoutPartialInfo();
|
|
32659
|
+
currentPartial.x = renderX;
|
|
32624
32660
|
}
|
|
32625
32661
|
}
|
|
32626
32662
|
}
|
|
@@ -32629,7 +32665,7 @@
|
|
|
32629
32665
|
// don't miss the last partial if not empty
|
|
32630
32666
|
if (currentPartial.masterBars.length > 0) {
|
|
32631
32667
|
if (partials.length === 0) {
|
|
32632
|
-
currentPartial.width += this._group.
|
|
32668
|
+
currentPartial.width += this._group.accoladeSpacing + this._pagePadding[0];
|
|
32633
32669
|
}
|
|
32634
32670
|
partials.push(currentPartial);
|
|
32635
32671
|
Logger.debug(this.name, 'Finished partial from bar ' +
|
|
@@ -32643,7 +32679,7 @@
|
|
|
32643
32679
|
currentBarIndex = 0;
|
|
32644
32680
|
let x = 0;
|
|
32645
32681
|
for (let i = 0; i < partials.length; i++) {
|
|
32646
|
-
|
|
32682
|
+
const partial = partials[i];
|
|
32647
32683
|
const e = new RenderFinishedEventArgs();
|
|
32648
32684
|
e.x = x;
|
|
32649
32685
|
e.y = 0;
|
|
@@ -32654,14 +32690,19 @@
|
|
|
32654
32690
|
e.firstMasterBarIndex = partial.masterBars[0].index;
|
|
32655
32691
|
e.lastMasterBarIndex = partial.masterBars[partial.masterBars.length - 1].index;
|
|
32656
32692
|
x += partial.width;
|
|
32693
|
+
// pull to local scope for lambda
|
|
32657
32694
|
const partialBarIndex = currentBarIndex;
|
|
32695
|
+
const partialIndex = i;
|
|
32696
|
+
this._group.buildBoundingsLookup(this._group.x, this._group.y);
|
|
32658
32697
|
this.registerPartial(e, canvas => {
|
|
32659
32698
|
canvas.color = this.renderer.settings.display.resources.mainGlyphColor;
|
|
32660
32699
|
canvas.textAlign = TextAlign.Left;
|
|
32661
32700
|
let renderX = this._group.getBarX(partial.masterBars[0].index) + this._group.accoladeSpacing;
|
|
32662
|
-
if (
|
|
32701
|
+
if (partialIndex === 0) {
|
|
32663
32702
|
renderX -= this._group.x + this._group.accoladeSpacing;
|
|
32664
32703
|
}
|
|
32704
|
+
canvas.color = this.renderer.settings.display.resources.mainGlyphColor;
|
|
32705
|
+
canvas.textAlign = TextAlign.Left;
|
|
32665
32706
|
Logger.debug(this.name, 'Rendering partial from bar ' +
|
|
32666
32707
|
partial.masterBars[0].index +
|
|
32667
32708
|
' to ' +
|
|
@@ -32956,6 +32997,7 @@
|
|
|
32956
32997
|
args.height = height;
|
|
32957
32998
|
args.firstMasterBarIndex = group.firstBarIndex;
|
|
32958
32999
|
args.lastMasterBarIndex = group.lastBarIndex;
|
|
33000
|
+
group.buildBoundingsLookup(0, 0);
|
|
32959
33001
|
this.registerPartial(args, canvas => {
|
|
32960
33002
|
this.renderer.canvas.color = this.renderer.settings.display.resources.mainGlyphColor;
|
|
32961
33003
|
this.renderer.canvas.textAlign = TextAlign.Left;
|
|
@@ -40108,23 +40150,25 @@
|
|
|
40108
40150
|
* @target web
|
|
40109
40151
|
*/
|
|
40110
40152
|
static detectScriptFile() {
|
|
40111
|
-
// normal browser include as <script>
|
|
40112
|
-
if ('document' in Environment.globalThis && document.currentScript) {
|
|
40113
|
-
return document.currentScript.src;
|
|
40114
|
-
}
|
|
40115
40153
|
// browser include as ES6 import
|
|
40116
40154
|
// <script type="module">
|
|
40117
40155
|
// import * as alphaTab from 'dist/alphaTab.js';
|
|
40118
40156
|
try {
|
|
40119
40157
|
// @ts-ignore
|
|
40120
|
-
const
|
|
40121
|
-
|
|
40122
|
-
|
|
40158
|
+
const importUrl = {};
|
|
40159
|
+
// avoid using file:// urls in case of
|
|
40160
|
+
// bundlers like webpack
|
|
40161
|
+
if (importUrl && importUrl.indexOf('file://') === -1) {
|
|
40162
|
+
return importUrl;
|
|
40123
40163
|
}
|
|
40124
40164
|
}
|
|
40125
40165
|
catch (e) {
|
|
40126
40166
|
// ignore potential errors
|
|
40127
40167
|
}
|
|
40168
|
+
// normal browser include as <script>
|
|
40169
|
+
if ('document' in Environment.globalThis && document.currentScript) {
|
|
40170
|
+
return document.currentScript.src;
|
|
40171
|
+
}
|
|
40128
40172
|
return null;
|
|
40129
40173
|
}
|
|
40130
40174
|
/**
|
|
@@ -40552,8 +40596,8 @@
|
|
|
40552
40596
|
// </auto-generated>
|
|
40553
40597
|
class VersionInfo {
|
|
40554
40598
|
}
|
|
40555
|
-
VersionInfo.version = '1.3.0-alpha.
|
|
40556
|
-
VersionInfo.date = '
|
|
40599
|
+
VersionInfo.version = '1.3.0-alpha.144';
|
|
40600
|
+
VersionInfo.date = '2022-01-16T17:33:59.910Z';
|
|
40557
40601
|
|
|
40558
40602
|
var index$5 = /*#__PURE__*/Object.freeze({
|
|
40559
40603
|
__proto__: null,
|