Removed unneeded callback

This commit is contained in:
WolverinDEV 2019-05-21 22:19:42 +02:00
parent e50bcde66b
commit 86a3d15a8a
5 changed files with 10 additions and 13 deletions

View file

@ -9,8 +9,6 @@
/// <reference path="log.ts" />
/// <reference path="PPTListener.ts" />
import type = app.type;
let settings: Settings;
const js_render = window.jsrender || $;

View file

@ -75,7 +75,6 @@ namespace audio {
}
export interface AbstractInput {
callback_state_change: () => any;
callback_begin: () => any;
callback_end: () => any;

View file

@ -76,7 +76,7 @@ class RecorderProfile {
this.record_supported = true;
}
async initialize() {
async initialize() : Promise<void> {
await this.load();
await this.reinitialize_filter();
await this.input.start();
@ -97,7 +97,12 @@ class RecorderProfile {
};
this.input.callback_state_change = () => {
this.record_supported = this.input.current_state() === audio.recorder.InputState.RECORDING || this.input.current_state() === audio.recorder.InputState.DRY;
const new_state = this.input.current_state() === audio.recorder.InputState.RECORDING || this.input.current_state() === audio.recorder.InputState.DRY;
if(new_state === this.record_supported)
return;
this.record_supported = new_state;
if(this.callback_support_change)
this.callback_support_change();
}
@ -171,7 +176,7 @@ class RecorderProfile {
} else if(this.config.vad_type === "active") {}
}
async unmount() {
async unmount() : Promise<void> {
if(this.callback_unmount)
this.callback_unmount();
if(this.input) {
@ -184,6 +189,7 @@ class RecorderProfile {
this.callback_start = undefined;
this.callback_stop = undefined;
this.callback_unmount = undefined;
this.current_handler = undefined;
}

View file

@ -241,7 +241,6 @@ namespace audio {
private _filters: filter.Filter[] = [];
private _filter_active: boolean = false;
callback_state_change: () => any = undefined;
callback_begin: () => any = undefined;
callback_end: () => any = undefined;

View file

@ -209,10 +209,6 @@ namespace audio {
recorder.callback_start = this.handleVoiceStarted.bind(this);
recorder.callback_stop = this.handleVoiceEnded.bind(this);
recorder.callback_support_change = () => {
this.connection.client.update_voice_status(undefined);
};
if(this._type == VoiceEncodeType.NATIVE_ENCODE) {
if(!this.local_audio_stream)
this.setup_native(); /* requires initialized audio */
@ -238,9 +234,8 @@ namespace audio {
callback_audio: buffer => this.handleVoiceData(buffer, false)
} as audio.recorder.CallbackInputConsumer);
}
} else {
this.connection.client.update_voice_status(undefined);
}
this.connection.client.update_voice_status(undefined);
}
get_encoder_type() : VoiceEncodeType { return this._type; }