@coderline/alphatab 1.6.0-alpha.1418 → 1.6.0-alpha.1421

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.
@@ -192,7 +192,8 @@ declare class AlphaSynthBase implements IAlphaSynth {
192
192
  readonly playbackRangeChanged: IEventEmitterOfT<PlaybackRangeChangedEventArgs>;
193
193
  /* Excluded from this release type: hasSamplesForProgram */
194
194
  /* Excluded from this release type: hasSamplesForPercussion */
195
- loadBackingTrack(_score: Score, _syncPoints: BackingTrackSyncPoint[]): void;
195
+ loadBackingTrack(_score: Score): void;
196
+ updateSyncPoints(_syncPoints: BackingTrackSyncPoint[]): void;
196
197
  }
197
198
 
198
199
  /**
@@ -350,6 +351,7 @@ declare class AlphaSynthWebWorkerApi implements IAlphaSynth {
350
351
  onOutputSamplesPlayed(samples: number): void;
351
352
  private onOutputReady;
352
353
  loadBackingTrack(_score: Score): void;
354
+ updateSyncPoints(_syncPoints: BackingTrackSyncPoint[]): void;
353
355
  }
354
356
 
355
357
  /**
@@ -1399,6 +1401,12 @@ export declare class AlphaTabApiBase<TSettings> {
1399
1401
  * @since 1.6.0
1400
1402
  */
1401
1403
  loadMidiForScore(): void;
1404
+ /**
1405
+ * Triggers an update of the sync points for the current score after modification within the data model
1406
+ * @category Methods - Player
1407
+ * @since 1.6.0
1408
+ */
1409
+ updateSyncPoints(): void;
1402
1410
  /**
1403
1411
  * Changes the volume of the given tracks.
1404
1412
  * @param tracks The tracks for which the volume should be changed.
@@ -3078,11 +3086,6 @@ declare class BackingTrack {
3078
3086
  * @json_ignore
3079
3087
  */
3080
3088
  rawAudioFile: Uint8Array | undefined;
3081
- /**
3082
- * The number of milliseconds the audio should be shifted to align with the song.
3083
- * (e.g. negative values allow skipping potential silent parts at the start of the file and directly start with the first note).
3084
- */
3085
- padding: number;
3086
3089
  }
3087
3090
 
3088
3091
  /**
@@ -3094,9 +3097,12 @@ declare class BackingTrackSyncPoint {
3094
3097
  constructor(tick: number, data: SyncPointData);
3095
3098
  }
3096
3099
 
3097
- declare class BackingTrackSyncPointWithTime extends BackingTrackSyncPoint {
3098
- time: number;
3099
- constructor(tick: number, data: SyncPointData, time: number);
3100
+ declare class BackingTrackSyncPointWithTime {
3101
+ alphaTabTick: number;
3102
+ alphaTabTime: number;
3103
+ modifiedTempo: number;
3104
+ millisecondOffset: number;
3105
+ constructor(tick: number, time: number, modifiedTempo: number, millisecondOffset: number);
3100
3106
  }
3101
3107
 
3102
3108
  /**
@@ -7038,7 +7044,12 @@ declare interface IAlphaSynth {
7038
7044
  * Loads the synchronization information from the given score (used for backing tracks and external media).
7039
7045
  * @param score
7040
7046
  */
7041
- loadBackingTrack(score: Score, syncPoints: BackingTrackSyncPoint[]): void;
7047
+ loadBackingTrack(score: Score): void;
7048
+ /**
7049
+ * Updates the points used to synchronize the backing track with the synthesized audio for correct cursor placement.
7050
+ * @param syncPoints
7051
+ */
7052
+ updateSyncPoints(syncPoints: BackingTrackSyncPoint[]): void;
7042
7053
  /**
7043
7054
  * Applies the given transposition pitches to be used during playback.
7044
7055
  * @param transpositionPitches a map defining the transposition pitches for midi channel.
@@ -8809,7 +8820,13 @@ declare class MasterBarTickLookup {
8809
8820
  * Gets or sets the MasterBar which is played.
8810
8821
  */
8811
8822
  masterBar: MasterBar;
8823
+ /**
8824
+ * The first beat in the bar.
8825
+ */
8812
8826
  firstBeat: BeatTickLookup | null;
8827
+ /**
8828
+ * The last beat in the bar.
8829
+ */
8813
8830
  lastBeat: BeatTickLookup | null;
8814
8831
  /**
8815
8832
  * Inserts `newNextBeat` after `currentBeat` in the linked list of items and updates.
@@ -9168,6 +9185,17 @@ declare class MidiFileGenerator {
9168
9185
  private addProgramChange;
9169
9186
  static buildTranspositionPitches(score: Score, settings: Settings): Map<number, number>;
9170
9187
  private generateChannel;
9188
+ /**
9189
+ * Generates the sync points for the given score without re-generating the midi itself.
9190
+ * @remarks
9191
+ * Use this method if a re-generation of the sync points after modification is required.
9192
+ * It correctly handles repeats and places sync points accoridng to their absolute midi tick when they
9193
+ * need to be considered for synchronization.
9194
+ * @param score The song for which to regenerate the sync points.
9195
+ * @returns The generated sync points for usage in the backing track playback.
9196
+ */
9197
+ static generateSyncPoints(score: Score): BackingTrackSyncPoint[];
9198
+ private static playThroughSong;
9171
9199
  private static toChannelShort;
9172
9200
  private generateMasterBar;
9173
9201
  private generateBar;
@@ -9288,6 +9316,7 @@ declare class MidiFileSequencer {
9288
9316
  mainUpdateSyncPoints(syncPoints: BackingTrackSyncPoint[]): void;
9289
9317
  currentTimePositionToTickPosition(timePosition: number): number;
9290
9318
  private updateCurrentTempo;
9319
+ private updateSyncPoints;
9291
9320
  mainTimePositionFromBackingTrack(timePosition: number, backingTrackLength: number): number;
9292
9321
  mainTimePositionToBackingTrack(timePosition: number, backingTrackLength: number): number;
9293
9322
  private tickPositionToTimePositionWithSpeed;
@@ -9365,7 +9394,10 @@ declare class MidiSequencerState {
9365
9394
  declare class MidiTickLookup {
9366
9395
  private _currentMasterBar;
9367
9396
  /* Excluded from this release type: masterBarLookup */
9368
- /* Excluded from this release type: masterBars */
9397
+ /**
9398
+ * A list of all {@link MasterBarTickLookup} sorted by time.
9399
+ */
9400
+ readonly masterBars: MasterBarTickLookup[];
9369
9401
  /**
9370
9402
  * The information about which bars are displayed via multi-bar rests.
9371
9403
  * The key is the start bar, and the value is the additional bars in sequential order.