mirror of
https://github.com/Boof2015/prism.git
synced 2026-08-19 20:09:43 +02:00
clean up dead code
This commit is contained in:
@@ -57,7 +57,7 @@ function isDocumentHidden(): boolean {
|
|||||||
return typeof document !== 'undefined' && document.hidden === true
|
return typeof document !== 'undefined' && document.hidden === true
|
||||||
}
|
}
|
||||||
|
|
||||||
export function resolveNativeCapturePollDelay(chunkCount: number): number {
|
function resolveNativeCapturePollDelay(chunkCount: number): number {
|
||||||
if (isDocumentHidden()) {
|
if (isDocumentHidden()) {
|
||||||
return 16
|
return 16
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -253,18 +253,10 @@ export class AudioRouter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setSampleRate(rate: number): void {
|
|
||||||
this._sampleRate = rate
|
|
||||||
}
|
|
||||||
|
|
||||||
getSampleRate(): number {
|
getSampleRate(): number {
|
||||||
return this._sampleRate
|
return this._sampleRate
|
||||||
}
|
}
|
||||||
|
|
||||||
setCapturing(capturing: boolean): void {
|
|
||||||
this._capturing = capturing
|
|
||||||
}
|
|
||||||
|
|
||||||
isCapturing(): boolean {
|
isCapturing(): boolean {
|
||||||
return this._capturing
|
return this._capturing
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,28 +127,6 @@ export class NativeVisualizerTransport {
|
|||||||
this.demand = nextDemand
|
this.demand = nextDemand
|
||||||
}
|
}
|
||||||
|
|
||||||
setSampleRate(sampleRate: number): void {
|
|
||||||
const nextSampleRate = Math.max(1, Math.floor(sampleRate) || 1)
|
|
||||||
if (nextSampleRate === this.sampleRate) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
this.sampleRate = nextSampleRate
|
|
||||||
if (!this.bridge.isAvailable()) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.demand.oscilloscope) {
|
|
||||||
this.bridge.oscilloscope.setSampleRate(nextSampleRate)
|
|
||||||
}
|
|
||||||
if (this.demand.spectrum) {
|
|
||||||
this.bridge.spectrum.setSampleRate(nextSampleRate)
|
|
||||||
}
|
|
||||||
if (this.demand.vectorscope) {
|
|
||||||
this.bridge.vectorscope.setSampleRate(nextSampleRate)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
handleChunk(left: Float32Array, right: Float32Array, meta: NativeVisualizerTransportChunkMeta = {}): void {
|
handleChunk(left: Float32Array, right: Float32Array, meta: NativeVisualizerTransportChunkMeta = {}): void {
|
||||||
if (!this.capturing || !this.bridge.isAvailable()) {
|
if (!this.capturing || !this.bridge.isAvailable()) {
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -699,7 +699,6 @@ test('NativeVisualizerTransport resets cached state on session changes and sampl
|
|||||||
})
|
})
|
||||||
assert.deepEqual(Array.from(transport.getLatestSpectrumMagnitudes() ?? []), [1, 1])
|
assert.deepEqual(Array.from(transport.getLatestSpectrumMagnitudes() ?? []), [1, 1])
|
||||||
|
|
||||||
transport.setSampleRate(96000)
|
|
||||||
transport.reset({
|
transport.reset({
|
||||||
sessionId: 8,
|
sessionId: 8,
|
||||||
sampleRate: 96000,
|
sampleRate: 96000,
|
||||||
|
|||||||
Reference in New Issue
Block a user