-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: deprecate some names (#578)
- Loading branch information
Showing
65 changed files
with
519 additions
and
239 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
import {InjectionToken} from '@angular/core'; | ||
|
||
export const AUDIO_CONTEXT = new InjectionToken<BaseAudioContext>( | ||
'[AUDIO_CONTEXT]: Web Audio API context', | ||
export const WA_AUDIO_CONTEXT = new InjectionToken<BaseAudioContext>( | ||
'[WA_AUDIO_CONTEXT]', | ||
{ | ||
providedIn: 'root', | ||
factory: () => new AudioContext(), | ||
}, | ||
); | ||
|
||
/** | ||
* @deprecated: drop in v5.0, use {@link WA_AUDIO_CONTEXT} | ||
*/ | ||
export const AUDIO_CONTEXT = WA_AUDIO_CONTEXT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
import type {ExistingProvider, Type} from '@angular/core'; | ||
import {InjectionToken} from '@angular/core'; | ||
|
||
export const AUDIO_NODE = new InjectionToken<AudioNode | null>( | ||
'[AUDIO_NODE]: Web Audio API audio node', | ||
{ | ||
factory: () => null, | ||
}, | ||
); | ||
export const WA_AUDIO_NODE = new InjectionToken<AudioNode | null>('[WA_AUDIO_NODE]', { | ||
factory: () => null, | ||
}); | ||
|
||
export function asAudioNode(useExisting: Type<AudioNode>): ExistingProvider { | ||
return { | ||
provide: AUDIO_NODE, | ||
provide: WA_AUDIO_NODE, | ||
useExisting, | ||
}; | ||
} | ||
|
||
/** | ||
* @deprecated: drop in v5.0, use {@link WA_AUDIO_NODE} | ||
*/ | ||
export const AUDIO_NODE = WA_AUDIO_NODE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
import {InjectionToken} from '@angular/core'; | ||
|
||
export const AUDIO_WORKLET_PROCESSORS = new InjectionToken<readonly string[]>( | ||
'[AUDIO_WORKLET_PROCESSORS]: Web Audio API worklet processors paths', | ||
export const WA_AUDIO_WORKLET_PROCESSORS = new InjectionToken<readonly string[]>( | ||
'[WA_AUDIO_WORKLET_PROCESSORS]', | ||
{ | ||
providedIn: 'root', | ||
factory: () => [], | ||
}, | ||
); | ||
|
||
/** | ||
* @deprecated: drop in v5.0, use {@link WA_AUDIO_WORKLET_PROCESSORS} | ||
*/ | ||
export const AUDIO_WORKLET_PROCESSORS = WA_AUDIO_WORKLET_PROCESSORS; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
import {inject, InjectionToken} from '@angular/core'; | ||
|
||
import {AUDIO_CONTEXT} from './audio-context'; | ||
import {WA_AUDIO_CONTEXT} from './audio-context'; | ||
|
||
export const AUDIO_WORKLET_SUPPORT = new InjectionToken<boolean>( | ||
'[AUDIO_WORKLET_SUPPORT]: AudioWorklet browser support', | ||
export const WA_AUDIO_WORKLET_SUPPORT = new InjectionToken<boolean>( | ||
'[WA_AUDIO_WORKLET_SUPPORT]', | ||
{ | ||
factory: () => !!inject(AUDIO_CONTEXT).audioWorklet, | ||
factory: () => !!inject(WA_AUDIO_CONTEXT).audioWorklet, | ||
}, | ||
); | ||
|
||
/** | ||
* @deprecated: drop in v5.0, use {@link WA_AUDIO_WORKLET_SUPPORT} | ||
*/ | ||
export const AUDIO_WORKLET_SUPPORT = WA_AUDIO_WORKLET_SUPPORT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,25 @@ | ||
import {inject, InjectionToken} from '@angular/core'; | ||
|
||
import {AUDIO_CONTEXT} from './audio-context'; | ||
import {WA_AUDIO_CONTEXT} from './audio-context'; | ||
|
||
/** | ||
* This is mostly for internal use only | ||
*/ | ||
export const CONSTRUCTOR_SUPPORT = new InjectionToken<boolean>( | ||
'[CONSTRUCTOR_SUPPORT]: Tests if constructor mode of node creation is supported or a fallback to factory method is needed', | ||
export const WA_CONSTRUCTOR_SUPPORT = new InjectionToken<boolean>( | ||
'[WA_CONSTRUCTOR_SUPPORT]', | ||
{ | ||
providedIn: 'root', | ||
factory: () => { | ||
try { | ||
return !!new GainNode(inject(AUDIO_CONTEXT)); | ||
return !!new GainNode(inject(WA_AUDIO_CONTEXT)); | ||
} catch (_) { | ||
return false; | ||
} | ||
}, | ||
}, | ||
); | ||
|
||
/** | ||
* @deprecated: drop in v5.0, use {@link WA_CONSTRUCTOR_SUPPORT} | ||
*/ | ||
export const CONSTRUCTOR_SUPPORT = WA_CONSTRUCTOR_SUPPORT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
import {InjectionToken} from '@angular/core'; | ||
|
||
export const FEEDBACK_COEFFICIENTS = new InjectionToken<number[]>( | ||
'[FEEDBACK_COEFFICIENTS]: A sequence of feedback coefficients for IIRFilterNode', | ||
export const WA_FEEDBACK_COEFFICIENTS = new InjectionToken<number[]>( | ||
'[WA_FEEDBACK_COEFFICIENTS]', | ||
); | ||
|
||
/** | ||
* @deprecated: drop in v5.0, use {@link WA_FEEDBACK_COEFFICIENTS} | ||
*/ | ||
export const FEEDBACK_COEFFICIENTS = WA_FEEDBACK_COEFFICIENTS; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
import {InjectionToken} from '@angular/core'; | ||
|
||
export const FEEDFORWARD_COEFFICIENTS = new InjectionToken<number[]>( | ||
'[FEEDFORWARD_COEFFICIENTS]: A sequence of feedforward coefficients for IIRFilterNode', | ||
export const WA_FEEDFORWARD_COEFFICIENTS = new InjectionToken<number[]>( | ||
'[WA_FEEDFORWARD_COEFFICIENTS]', | ||
); | ||
|
||
/** | ||
* @deprecated: drop in v5.0, use {@link WA_FEEDFORWARD_COEFFICIENTS} | ||
*/ | ||
export const FEEDFORWARD_COEFFICIENTS = WA_FEEDFORWARD_COEFFICIENTS; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
import {InjectionToken} from '@angular/core'; | ||
|
||
export const MEDIA_STREAM = new InjectionToken<MediaStream>( | ||
'[MEDIA_STREAM]: MediaStream for MediaStreamAudioSourceNode', | ||
); | ||
export const WA_MEDIA_STREAM = new InjectionToken<MediaStream>('[WA_MEDIA_STREAM]'); | ||
|
||
/** | ||
* @deprecated: drop in v5.0, use {@link WA_MEDIA_STREAM} | ||
*/ | ||
export const MEDIA_STREAM = WA_MEDIA_STREAM; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
import {InjectionToken} from '@angular/core'; | ||
|
||
export const WEB_AUDIO_SUPPORT = new InjectionToken<boolean>( | ||
'[WEB_AUDIO_SUPPORT]: Web Audio API support', | ||
export const WA_WEB_AUDIO_SUPPORT = new InjectionToken<boolean>( | ||
'[WA_WEB_AUDIO_SUPPORT]', | ||
{ | ||
providedIn: 'root', | ||
factory: () => !!AudioContext, | ||
}, | ||
); | ||
|
||
/** | ||
* @deprecated: drop in v5.0, use {@link WA_WEB_AUDIO_SUPPORT} | ||
*/ | ||
export const WEB_AUDIO_SUPPORT = WA_WEB_AUDIO_SUPPORT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
import {InjectionToken} from '@angular/core'; | ||
|
||
export const CANVAS_2D_CONTEXT = new InjectionToken<CanvasRenderingContext2D>( | ||
'[CANVAS_2D_CONTEXT]: Canvas 2D rendering context', | ||
export const WA_CANVAS_2D_CONTEXT = new InjectionToken<CanvasRenderingContext2D>( | ||
'[WA_CANVAS_2D_CONTEXT]', | ||
); | ||
|
||
/** | ||
* @deprecated: drop in v5.0, use {@link WA_CANVAS_2D_CONTEXT} | ||
*/ | ||
export const CANVAS_2D_CONTEXT = WA_CANVAS_2D_CONTEXT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.