mirror of
https://github.com/Boof2015/prism.git
synced 2026-08-16 16:21:11 +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
|
||||
}
|
||||
|
||||
export function resolveNativeCapturePollDelay(chunkCount: number): number {
|
||||
function resolveNativeCapturePollDelay(chunkCount: number): number {
|
||||
if (isDocumentHidden()) {
|
||||
return 16
|
||||
}
|
||||
|
||||
@@ -253,18 +253,10 @@ export class AudioRouter {
|
||||
}
|
||||
}
|
||||
|
||||
setSampleRate(rate: number): void {
|
||||
this._sampleRate = rate
|
||||
}
|
||||
|
||||
getSampleRate(): number {
|
||||
return this._sampleRate
|
||||
}
|
||||
|
||||
setCapturing(capturing: boolean): void {
|
||||
this._capturing = capturing
|
||||
}
|
||||
|
||||
isCapturing(): boolean {
|
||||
return this._capturing
|
||||
}
|
||||
|
||||
@@ -127,28 +127,6 @@ export class NativeVisualizerTransport {
|
||||
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 {
|
||||
if (!this.capturing || !this.bridge.isAvailable()) {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user