mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Feat: text to speech source controls PTT of connected sinks
This commit is contained in:
parent
77a7397f1c
commit
1374f270eb
@ -72,6 +72,7 @@ export class TextToSpeechSource extends AudioSource {
|
||||
/* Start playing the file at the selected position */
|
||||
this.#source.start(0, this.#currentPosition);
|
||||
this.#playing = true;
|
||||
this.getConnectedTo().forEach((sink) => sink.setPtt(true));
|
||||
const now = Date.now() / 1000;
|
||||
this.#lastUpdateTime = now;
|
||||
|
||||
@ -102,6 +103,7 @@ export class TextToSpeechSource extends AudioSource {
|
||||
this.#source.stop();
|
||||
this.#source.disconnect();
|
||||
this.#playing = false;
|
||||
this.getConnectedTo().forEach((sink) => sink.setPtt(false));
|
||||
|
||||
const now = Date.now() / 1000;
|
||||
this.#currentPosition += now - this.#lastUpdateTime;
|
||||
|
||||
@ -80,12 +80,8 @@ export const UnitSinkPanel = forwardRef((props: { sink: UnitSink; shortcutKeys:
|
||||
<OlStateButton
|
||||
checked={props.sink.getPtt()}
|
||||
icon={faMicrophoneLines}
|
||||
onClick={() => {}}
|
||||
onMouseDown={() => {
|
||||
props.sink.setPtt(true);
|
||||
}}
|
||||
onMouseUp={() => {
|
||||
props.sink.setPtt(false);
|
||||
onClick={() => {
|
||||
props.sink.setPtt(!props.sink.getPtt());
|
||||
}}
|
||||
tooltip="Talk on frequency"
|
||||
></OlStateButton>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user