@coderline/alphatab 1.3.0-alpha.362 → 1.3.0-alpha.375

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/README.md CHANGED
@@ -65,4 +65,4 @@ Copyright © 2000-2022 JetBrains s.r.o. JetBrains and the JetBrains logo are reg
65
65
 
66
66
  ... to [Bernhard Schelling](https://github.com/schellingb/TinySoundFont) the author of TinySoundFont and [Steve Folta](https://github.com/stevefolta/SFZero) the author of SFZero for providing the core of the synthesis engine.
67
67
 
68
- ... to all you people using alphaTab providing new feature ideas and and bug reports.
68
+ ... to all you people using alphaTab providing new feature ideas and bug reports.
@@ -154,19 +154,29 @@ declare enum FontWeight {
154
154
  declare class Font {
155
155
  private _css;
156
156
  private _cssScale;
157
- private _family;
157
+ private _families;
158
158
  private _style;
159
159
  private _weight;
160
160
  private _size;
161
161
  private reset;
162
162
  /**
163
- * Gets the font family name.
163
+ * Gets the first font family name.
164
+ * @deprecated Consider using {@link families} for multi font family support.
164
165
  */
165
166
  get family(): string;
166
167
  /**
167
- * Sets the font family name.
168
+ * Sets the font family list.
169
+ * @deprecated Consider using {@link families} for multi font family support.
168
170
  */
169
171
  set family(value: string);
172
+ /**
173
+ * Gets the font family name.
174
+ */
175
+ get families(): string[];
176
+ /**
177
+ * Sets the font family name.
178
+ */
179
+ set families(value: string[]);
170
180
  /**
171
181
  * Gets the font size in pixels.
172
182
  */
@@ -201,6 +211,14 @@ declare class Font {
201
211
  * @param weight The weight.
202
212
  */
203
213
  constructor(family: string, size: number, style?: FontStyle, weight?: FontWeight);
214
+ /**
215
+ * Initializes a new instance of the {@link Font} class.
216
+ * @param families The families.
217
+ * @param size The size.
218
+ * @param style The style.
219
+ * @param weight The weight.
220
+ */
221
+ static withFamilyList(families: string[], size: number, style?: FontStyle, weight?: FontWeight): Font;
204
222
  toCssString(scale?: number): string;
205
223
  static fromJson(v: unknown): Font | null;
206
224
  static toJson(font: Font): Map<string, unknown>;
@@ -1380,7 +1398,7 @@ declare enum KeySignature {
1380
1398
  */
1381
1399
  FSharp = 6,
1382
1400
  /**
1383
- * C# (8 sharp)
1401
+ * C# (7 sharp)
1384
1402
  */
1385
1403
  CSharp = 7
1386
1404
  }
@@ -6591,6 +6609,7 @@ declare class ScoreRenderer implements IScoreRenderer {
6591
6609
 
6592
6610
  type index_d$1_RenderFinishedEventArgs = RenderFinishedEventArgs;
6593
6611
  declare const index_d$1_RenderFinishedEventArgs: typeof RenderFinishedEventArgs;
6612
+ type index_d$1_IScoreRenderer = IScoreRenderer;
6594
6613
  type index_d$1_ScoreRenderer = ScoreRenderer;
6595
6614
  declare const index_d$1_ScoreRenderer: typeof ScoreRenderer;
6596
6615
  type index_d$1_BarBounds = BarBounds;
@@ -6610,6 +6629,7 @@ declare const index_d$1_StaveGroupBounds: typeof StaveGroupBounds;
6610
6629
  declare namespace index_d$1 {
6611
6630
  export {
6612
6631
  index_d$1_RenderFinishedEventArgs as RenderFinishedEventArgs,
6632
+ index_d$1_IScoreRenderer as IScoreRenderer,
6613
6633
  index_d$1_ScoreRenderer as ScoreRenderer,
6614
6634
  index_d$1_BarBounds as BarBounds,
6615
6635
  index_d$1_BeatBounds as BeatBounds,
@@ -6758,6 +6778,45 @@ declare class AlphaSynth implements IAlphaSynth {
6758
6778
  readonly playbackRangeChanged: IEventEmitterOfT<PlaybackRangeChangedEventArgs>;
6759
6779
  }
6760
6780
 
6781
+ /**
6782
+ * Represents a fixed size circular sample buffer that can be written to and read from.
6783
+ * @csharp_public
6784
+ */
6785
+ declare class CircularSampleBuffer {
6786
+ private _buffer;
6787
+ private _writePosition;
6788
+ private _readPosition;
6789
+ /**
6790
+ * Gets the number of samples written to the buffer.
6791
+ */
6792
+ count: number;
6793
+ /**
6794
+ * Initializes a new instance of the {@link CircularSampleBuffer} class.
6795
+ * @param size The size.
6796
+ */
6797
+ constructor(size: number);
6798
+ /**
6799
+ * Clears all samples written to this buffer.
6800
+ */
6801
+ clear(): void;
6802
+ /**
6803
+ * Writes the given samples to this buffer.
6804
+ * @param data The sample array to read from.
6805
+ * @param offset
6806
+ * @param count
6807
+ * @returns
6808
+ */
6809
+ write(data: Float32Array, offset: number, count: number): number;
6810
+ /**
6811
+ * Reads the requested amount of samples from the buffer.
6812
+ * @param data The sample array to store the read elements.
6813
+ * @param offset The offset within the destination buffer to put the items at.
6814
+ * @param count The number of items to read from this buffer.
6815
+ * @returns The number of items actually read from the buffer.
6816
+ */
6817
+ read(data: Float32Array, offset: number, count: number): number;
6818
+ }
6819
+
6761
6820
  /**
6762
6821
  * a WebWorker based alphaSynth which uses the given player as output.
6763
6822
  * @target web
@@ -6835,10 +6894,80 @@ declare class AlphaSynthWebWorkerApi implements IAlphaSynth {
6835
6894
  private onOutputReady;
6836
6895
  }
6837
6896
 
6897
+ /**
6898
+ * @target web
6899
+ */
6900
+ declare abstract class AlphaSynthWebAudioOutputBase implements ISynthOutput {
6901
+ protected static readonly BufferSize: number;
6902
+ protected static readonly PreferredSampleRate: number;
6903
+ protected _context: AudioContext | null;
6904
+ protected _buffer: AudioBuffer | null;
6905
+ protected _source: AudioBufferSourceNode | null;
6906
+ private _resumeHandler?;
6907
+ get sampleRate(): number;
6908
+ activate(resumedCallback?: () => void): void;
6909
+ private patchIosSampleRate;
6910
+ private createAudioContext;
6911
+ open(bufferTimeInMilliseconds: number): void;
6912
+ private registerResumeHandler;
6913
+ private unregisterResumeHandler;
6914
+ play(): void;
6915
+ pause(): void;
6916
+ destroy(): void;
6917
+ abstract addSamples(f: Float32Array): void;
6918
+ abstract resetSamples(): void;
6919
+ readonly ready: IEventEmitter;
6920
+ readonly samplesPlayed: IEventEmitterOfT<number>;
6921
+ readonly sampleRequest: IEventEmitter;
6922
+ protected onSamplesPlayed(numberOfSamples: number): void;
6923
+ protected onSampleRequest(): void;
6924
+ protected onReady(): void;
6925
+ }
6926
+
6927
+ /**
6928
+ * This class implements a HTML5 Web Audio API based audio output device
6929
+ * for alphaSynth using the legacy ScriptProcessor node.
6930
+ * @target web
6931
+ */
6932
+ declare class AlphaSynthScriptProcessorOutput extends AlphaSynthWebAudioOutputBase {
6933
+ private _audioNode;
6934
+ private _circularBuffer;
6935
+ private _bufferCount;
6936
+ private _requestedBufferCount;
6937
+ open(bufferTimeInMilliseconds: number): void;
6938
+ play(): void;
6939
+ pause(): void;
6940
+ addSamples(f: Float32Array): void;
6941
+ resetSamples(): void;
6942
+ private requestBuffers;
6943
+ private _outputBuffer;
6944
+ private generateSound;
6945
+ }
6946
+
6947
+ /**
6948
+ * This class implements a HTML5 Web Audio API based audio output device
6949
+ * for alphaSynth. It can be controlled via a JS API.
6950
+ * @target web
6951
+ */
6952
+ declare class AlphaSynthAudioWorkletOutput extends AlphaSynthWebAudioOutputBase {
6953
+ private _worklet;
6954
+ private _bufferTimeInMilliseconds;
6955
+ open(bufferTimeInMilliseconds: number): void;
6956
+ play(): void;
6957
+ private handleMessage;
6958
+ pause(): void;
6959
+ addSamples(f: Float32Array): void;
6960
+ resetSamples(): void;
6961
+ }
6962
+
6838
6963
  type index_d_AlphaSynth = AlphaSynth;
6839
6964
  declare const index_d_AlphaSynth: typeof AlphaSynth;
6965
+ type index_d_CircularSampleBuffer = CircularSampleBuffer;
6966
+ declare const index_d_CircularSampleBuffer: typeof CircularSampleBuffer;
6840
6967
  type index_d_PlaybackRange = PlaybackRange;
6841
6968
  declare const index_d_PlaybackRange: typeof PlaybackRange;
6969
+ type index_d_ISynthOutput = ISynthOutput;
6970
+ type index_d_IAlphaSynth = IAlphaSynth;
6842
6971
  type index_d_PlayerState = PlayerState;
6843
6972
  declare const index_d_PlayerState: typeof PlayerState;
6844
6973
  type index_d_PlayerStateChangedEventArgs = PlayerStateChangedEventArgs;
@@ -6847,20 +6976,35 @@ type index_d_PlaybackRangeChangedEventArgs = PlaybackRangeChangedEventArgs;
6847
6976
  declare const index_d_PlaybackRangeChangedEventArgs: typeof PlaybackRangeChangedEventArgs;
6848
6977
  type index_d_PositionChangedEventArgs = PositionChangedEventArgs;
6849
6978
  declare const index_d_PositionChangedEventArgs: typeof PositionChangedEventArgs;
6979
+ type index_d_MidiEventsPlayedEventArgs = MidiEventsPlayedEventArgs;
6980
+ declare const index_d_MidiEventsPlayedEventArgs: typeof MidiEventsPlayedEventArgs;
6850
6981
  type index_d_ActiveBeatsChangedEventArgs = ActiveBeatsChangedEventArgs;
6851
6982
  declare const index_d_ActiveBeatsChangedEventArgs: typeof ActiveBeatsChangedEventArgs;
6852
6983
  type index_d_AlphaSynthWebWorkerApi = AlphaSynthWebWorkerApi;
6853
6984
  declare const index_d_AlphaSynthWebWorkerApi: typeof AlphaSynthWebWorkerApi;
6985
+ type index_d_AlphaSynthWebAudioOutputBase = AlphaSynthWebAudioOutputBase;
6986
+ declare const index_d_AlphaSynthWebAudioOutputBase: typeof AlphaSynthWebAudioOutputBase;
6987
+ type index_d_AlphaSynthScriptProcessorOutput = AlphaSynthScriptProcessorOutput;
6988
+ declare const index_d_AlphaSynthScriptProcessorOutput: typeof AlphaSynthScriptProcessorOutput;
6989
+ type index_d_AlphaSynthAudioWorkletOutput = AlphaSynthAudioWorkletOutput;
6990
+ declare const index_d_AlphaSynthAudioWorkletOutput: typeof AlphaSynthAudioWorkletOutput;
6854
6991
  declare namespace index_d {
6855
6992
  export {
6856
6993
  index_d_AlphaSynth as AlphaSynth,
6994
+ index_d_CircularSampleBuffer as CircularSampleBuffer,
6857
6995
  index_d_PlaybackRange as PlaybackRange,
6996
+ index_d_ISynthOutput as ISynthOutput,
6997
+ index_d_IAlphaSynth as IAlphaSynth,
6858
6998
  index_d_PlayerState as PlayerState,
6859
6999
  index_d_PlayerStateChangedEventArgs as PlayerStateChangedEventArgs,
6860
7000
  index_d_PlaybackRangeChangedEventArgs as PlaybackRangeChangedEventArgs,
6861
7001
  index_d_PositionChangedEventArgs as PositionChangedEventArgs,
7002
+ index_d_MidiEventsPlayedEventArgs as MidiEventsPlayedEventArgs,
6862
7003
  index_d_ActiveBeatsChangedEventArgs as ActiveBeatsChangedEventArgs,
6863
7004
  index_d_AlphaSynthWebWorkerApi as AlphaSynthWebWorkerApi,
7005
+ index_d_AlphaSynthWebAudioOutputBase as AlphaSynthWebAudioOutputBase,
7006
+ index_d_AlphaSynthScriptProcessorOutput as AlphaSynthScriptProcessorOutput,
7007
+ index_d_AlphaSynthAudioWorkletOutput as AlphaSynthAudioWorkletOutput,
6864
7008
  };
6865
7009
  }
6866
7010