Fixed the dummy voice connection

canary
WolverinDEV 2020-09-07 19:07:14 +02:00
parent e50a8f5d6c
commit 8dd4cb285c
3 changed files with 20 additions and 3 deletions

View File

@ -5,14 +5,17 @@ import {
import {RecorderProfile} from "tc-shared/voice/RecorderProfile";
import {AbstractServerConnection} from "tc-shared/connection/ConnectionBase";
import {VoiceClient} from "tc-shared/voice/VoiceClient";
import {VoicePlayerLatencySettings, VoicePlayerState} from "tc-shared/voice/VoicePlayer";
import {WhisperSession} from "tc-shared/voice/VoiceWhisper";
import {VoicePlayerEvents, VoicePlayerLatencySettings, VoicePlayerState} from "tc-shared/voice/VoicePlayer";
import {WhisperSession, WhisperTarget} from "tc-shared/voice/VoiceWhisper";
import {Registry} from "tc-shared/events";
class DummyVoiceClient implements VoiceClient {
readonly events: Registry<VoicePlayerEvents>;
private readonly clientId: number;
private volume: number;
constructor(clientId: number) {
this.events = new Registry<VoicePlayerEvents>();
this.clientId = clientId;
this.volume = 1;
}
@ -41,6 +44,10 @@ class DummyVoiceClient implements VoiceClient {
flushBuffer() { }
abortReplay() { }
resetLatencySettings() {
}
}
export class DummyVoiceConnection extends AbstractVoiceConnection {
@ -120,4 +127,14 @@ export class DummyVoiceConnection extends AbstractVoiceConnection {
}
setWhisperSessionInitializer(initializer: WhisperSessionInitializer | undefined) { }
getWhisperTarget(): WhisperTarget | undefined {
return undefined;
}
startWhisper(target: WhisperTarget): Promise<void> {
return Promise.reject(tr("not supported"));
}
stopWhisper() { }
}

View File

@ -1,3 +1,4 @@
import "broadcastchannel-polyfill";
import * as log from "tc-shared/log";
import {LogCategory} from "tc-shared/log";
import {ConnectHandler} from "tc-shared/ipc/ConnectHandler";

View File

@ -1,5 +1,4 @@
import "webrtc-adapter";
import "broadcastchannel-polyfill";
import "./index.scss";
import "./FileTransfer";