@coderline/alphatab 1.3.0-alpha.194 → 1.3.0-alpha.206

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.
@@ -869,6 +869,12 @@ declare class PlayerSettings {
869
869
  * Gets or sets whether the triplet feel should be applied/played during audio playback.
870
870
  */
871
871
  playTripletFeel: boolean;
872
+ /**
873
+ * Gets or sets how many milliseconds of audio samples should be buffered in total.
874
+ * Larger buffers cause a delay from when audio settings like volumes will be applied.
875
+ * Smaller buffers can cause audio crackling due to constant buffering that is happening.
876
+ */
877
+ bufferTimeInMilliseconds: number;
872
878
  }
873
879
 
874
880
  /**
@@ -3805,6 +3811,21 @@ declare class PlayerStateChangedEventArgs {
3805
3811
  constructor(state: PlayerState, stopped: boolean);
3806
3812
  }
3807
3813
 
3814
+ /**
3815
+ * Represents the info when the playback range changed.
3816
+ */
3817
+ declare class PlaybackRangeChangedEventArgs {
3818
+ /**
3819
+ * The new playback range.
3820
+ */
3821
+ readonly playbackRange: PlaybackRange | null;
3822
+ /**
3823
+ * Initializes a new instance of the {@link PlaybackRangeChangedEventArgs} class.
3824
+ * @param range The range.
3825
+ */
3826
+ constructor(playbackRange: PlaybackRange | null);
3827
+ }
3828
+
3808
3829
  /**
3809
3830
  * Represents the info when the time in the synthesizer changes.
3810
3831
  */
@@ -4028,6 +4049,10 @@ interface IAlphaSynth {
4028
4049
  * The event is fired when certain midi events were sent to the audio output device for playback.
4029
4050
  */
4030
4051
  readonly midiEventsPlayed: IEventEmitterOfT<MidiEventsPlayedEventArgs>;
4052
+ /**
4053
+ * The event is fired when the playback range within the player was updated.
4054
+ */
4055
+ readonly playbackRangeChanged: IEventEmitterOfT<PlaybackRangeChangedEventArgs>;
4031
4056
  }
4032
4057
 
4033
4058
  /**
@@ -4442,11 +4467,6 @@ declare class BoundsLookup {
4442
4467
  * Finishes the lookup for optimized access.
4443
4468
  */
4444
4469
  finish(): void;
4445
- /**
4446
- * Adds a new note to the lookup.
4447
- * @param bounds The note bounds to add.
4448
- */
4449
- addNote(bounds: NoteBounds): void;
4450
4470
  /**
4451
4471
  * Adds a new stave group to the lookup.
4452
4472
  * @param bounds The stave group bounds to add.
@@ -4480,6 +4500,12 @@ declare class BoundsLookup {
4480
4500
  * @returns The beat bounds if it was rendered, or null if no boundary information is available.
4481
4501
  */
4482
4502
  findBeat(beat: Beat): BeatBounds | null;
4503
+ /**
4504
+ * Tries to find the bounds of a given beat.
4505
+ * @param beat The beat to find.
4506
+ * @returns The beat bounds if it was rendered, or null if no boundary information is available.
4507
+ */
4508
+ findBeats(beat: Beat): BeatBounds[] | null;
4483
4509
  /**
4484
4510
  * Tries to find a beat at the given absolute position.
4485
4511
  * @param x The absolute X-position of the beat to find.
@@ -4927,14 +4953,21 @@ declare class AlphaTabApiBase<TSettings> {
4927
4953
  playedBeatChanged: IEventEmitterOfT<Beat>;
4928
4954
  private onPlayedBeatChanged;
4929
4955
  private _beatMouseDown;
4956
+ private _noteMouseDown;
4930
4957
  private _selectionStart;
4931
4958
  private _selectionEnd;
4932
4959
  beatMouseDown: IEventEmitterOfT<Beat>;
4933
4960
  beatMouseMove: IEventEmitterOfT<Beat>;
4934
4961
  beatMouseUp: IEventEmitterOfT<Beat | null>;
4962
+ noteMouseDown: IEventEmitterOfT<Note>;
4963
+ noteMouseMove: IEventEmitterOfT<Note>;
4964
+ noteMouseUp: IEventEmitterOfT<Note | null>;
4935
4965
  private onBeatMouseDown;
4966
+ private onNoteMouseDown;
4936
4967
  private onBeatMouseMove;
4968
+ private onNoteMouseMove;
4937
4969
  private onBeatMouseUp;
4970
+ private onNoteMouseUp;
4938
4971
  private updateSelectionCursor;
4939
4972
  private setupClickHandling;
4940
4973
  private cursorSelectRange;
@@ -4966,6 +4999,8 @@ declare class AlphaTabApiBase<TSettings> {
4966
4999
  private onPlayerPositionChanged;
4967
5000
  midiEventsPlayed: IEventEmitterOfT<MidiEventsPlayedEventArgs>;
4968
5001
  private onMidiEventsPlayed;
5002
+ playbackRangeChanged: IEventEmitterOfT<PlaybackRangeChangedEventArgs>;
5003
+ private onPlaybackRangeChanged;
4969
5004
  }
4970
5005
 
4971
5006
  /**
@@ -6568,7 +6603,7 @@ interface ISynthOutput {
6568
6603
  /**
6569
6604
  * Called when the output should be opened.
6570
6605
  */
6571
- open(): void;
6606
+ open(bufferTimeInMilliseconds: number): void;
6572
6607
  /**
6573
6608
  * Called when the output should start the playback.
6574
6609
  */
@@ -6623,6 +6658,7 @@ declare class AlphaSynth implements IAlphaSynth {
6623
6658
  private _countInVolume;
6624
6659
  private _playedEventsQueue;
6625
6660
  private _midiEventsPlayedFilter;
6661
+ private _notPlayedSamples;
6626
6662
  /**
6627
6663
  * Gets the {@link ISynthOutput} used for playing the generated samples.
6628
6664
  */
@@ -6655,7 +6691,7 @@ declare class AlphaSynth implements IAlphaSynth {
6655
6691
  * Initializes a new instance of the {@link AlphaSynth} class.
6656
6692
  * @param output The output to use for playing the generated samples.
6657
6693
  */
6658
- constructor(output: ISynthOutput);
6694
+ constructor(output: ISynthOutput, bufferTimeInMilliseconds: number);
6659
6695
  play(): boolean;
6660
6696
  private playInternal;
6661
6697
  pause(): void;
@@ -6674,9 +6710,9 @@ declare class AlphaSynth implements IAlphaSynth {
6674
6710
  resetChannelStates(): void;
6675
6711
  setChannelSolo(channel: number, solo: boolean): void;
6676
6712
  setChannelVolume(channel: number, volume: number): void;
6677
- private onAudioSettingsUpdate;
6678
6713
  private onSamplesPlayed;
6679
6714
  private checkForFinish;
6715
+ private stopOneTimeMidi;
6680
6716
  private updateTimePosition;
6681
6717
  readonly ready: IEventEmitter;
6682
6718
  readonly readyForPlayback: IEventEmitter;
@@ -6688,6 +6724,7 @@ declare class AlphaSynth implements IAlphaSynth {
6688
6724
  readonly stateChanged: IEventEmitterOfT<PlayerStateChangedEventArgs>;
6689
6725
  readonly positionChanged: IEventEmitterOfT<PositionChangedEventArgs>;
6690
6726
  readonly midiEventsPlayed: IEventEmitterOfT<MidiEventsPlayedEventArgs>;
6727
+ readonly playbackRangeChanged: IEventEmitterOfT<PlaybackRangeChangedEventArgs>;
6691
6728
  }
6692
6729
 
6693
6730
  /**
@@ -6733,7 +6770,7 @@ declare class AlphaSynthWebWorkerApi implements IAlphaSynth {
6733
6770
  set isLooping(value: boolean);
6734
6771
  get playbackRange(): PlaybackRange | null;
6735
6772
  set playbackRange(value: PlaybackRange | null);
6736
- constructor(player: ISynthOutput, alphaSynthScriptFile: string, logLevel: LogLevel);
6773
+ constructor(player: ISynthOutput, alphaSynthScriptFile: string, logLevel: LogLevel, bufferTimeInMilliseconds: number);
6737
6774
  destroy(): void;
6738
6775
  play(): boolean;
6739
6776
  pause(): void;
@@ -6761,6 +6798,7 @@ declare class AlphaSynthWebWorkerApi implements IAlphaSynth {
6761
6798
  readonly stateChanged: IEventEmitterOfT<PlayerStateChangedEventArgs>;
6762
6799
  readonly positionChanged: IEventEmitterOfT<PositionChangedEventArgs>;
6763
6800
  readonly midiEventsPlayed: IEventEmitterOfT<MidiEventsPlayedEventArgs>;
6801
+ readonly playbackRangeChanged: IEventEmitterOfT<PlaybackRangeChangedEventArgs>;
6764
6802
  onOutputSampleRequest(): void;
6765
6803
  onOutputSamplesPlayed(samples: number): void;
6766
6804
  private onOutputReady;
@@ -6774,6 +6812,8 @@ type index_d_PlayerState = PlayerState;
6774
6812
  declare const index_d_PlayerState: typeof PlayerState;
6775
6813
  type index_d_PlayerStateChangedEventArgs = PlayerStateChangedEventArgs;
6776
6814
  declare const index_d_PlayerStateChangedEventArgs: typeof PlayerStateChangedEventArgs;
6815
+ type index_d_PlaybackRangeChangedEventArgs = PlaybackRangeChangedEventArgs;
6816
+ declare const index_d_PlaybackRangeChangedEventArgs: typeof PlaybackRangeChangedEventArgs;
6777
6817
  type index_d_PositionChangedEventArgs = PositionChangedEventArgs;
6778
6818
  declare const index_d_PositionChangedEventArgs: typeof PositionChangedEventArgs;
6779
6819
  type index_d_AlphaSynthWebWorkerApi = AlphaSynthWebWorkerApi;
@@ -6784,6 +6824,7 @@ declare namespace index_d {
6784
6824
  index_d_PlaybackRange as PlaybackRange,
6785
6825
  index_d_PlayerState as PlayerState,
6786
6826
  index_d_PlayerStateChangedEventArgs as PlayerStateChangedEventArgs,
6827
+ index_d_PlaybackRangeChangedEventArgs as PlaybackRangeChangedEventArgs,
6787
6828
  index_d_PositionChangedEventArgs as PositionChangedEventArgs,
6788
6829
  index_d_AlphaSynthWebWorkerApi as AlphaSynthWebWorkerApi,
6789
6830
  };