@@ -721,16 +721,16 @@ export class AlphaTabApiBase<TSettings> {
721721
722722 private appendRenderResult ( result : RenderFinishedEventArgs , isLast : boolean ) : void {
723723 // resizing the canvas and wrapper elements at the end is enough
724- // it avoids flickering on resizes and re-renders.
724+ // it avoids flickering on resizes and re-renders.
725725 // the individual partials are anyhow sized correctly
726- if ( isLast ) {
726+ if ( isLast ) {
727727 this . canvasElement . width = result . totalWidth ;
728728 this . canvasElement . height = result . totalHeight ;
729729 if ( this . _cursorWrapper ) {
730730 this . _cursorWrapper . width = result . totalWidth ;
731731 this . _cursorWrapper . height = result . totalHeight ;
732732 }
733- }
733+ }
734734
735735 if ( result . width > 0 || result . height > 0 ) {
736736 this . uiFacade . beginAppendRenderResults ( result ) ;
@@ -1441,7 +1441,7 @@ export class AlphaTabApiBase<TSettings> {
14411441 }
14421442
14431443 /**
1444- *
1444+ *
14451445 * @returns true if a new player was created, false if no player was created (includes destroy & reuse of the current one)
14461446 */
14471447 private setupOrDestroyPlayer ( ) : boolean {
@@ -1495,9 +1495,9 @@ export class AlphaTabApiBase<TSettings> {
14951495 }
14961496
14971497 /**
1498- * Re-creates the midi for the current score and loads it.
1498+ * Re-creates the midi for the current score and loads it.
14991499 * @remarks
1500- * This will result in the player to stop playback. Some setting changes require re-genration of the midi song.
1500+ * This will result in the player to stop playback. Some setting changes require re-genration of the midi song.
15011501 * @category Methods - Player
15021502 * @since 1.6.0
15031503 */
@@ -1526,10 +1526,26 @@ export class AlphaTabApiBase<TSettings> {
15261526
15271527 const player = this . _player ;
15281528 player . loadMidiFile ( midiFile ) ;
1529- player . loadBackingTrack ( score , generator . syncPoints ) ;
1529+ player . loadBackingTrack ( score ) ;
1530+ player . updateSyncPoints ( generator . syncPoints ) ;
15301531 player . applyTranspositionPitches ( generator . transpositionPitches ) ;
15311532 }
15321533
1534+ /**
1535+ * Triggers an update of the sync points for the current score after modification within the data model
1536+ * @category Methods - Player
1537+ * @since 1.6.0
1538+ */
1539+ public updateSyncPoints ( ) {
1540+ if ( ! this . score ) {
1541+ return ;
1542+ }
1543+
1544+ const score = this . score ! ;
1545+ const player = this . _player ;
1546+ player . updateSyncPoints ( MidiFileGenerator . generateSyncPoints ( score ) ) ;
1547+ }
1548+
15331549 /**
15341550 * Changes the volume of the given tracks.
15351551 * @param tracks The tracks for which the volume should be changed.
0 commit comments