Add Giant PTT: a full-screen talk button on Android and a resizable window on desktop
Holding it forces transmission in any input mode, past the voice-activation gate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -54,6 +54,7 @@ public final class CaptureVoiceInput implements VoiceInput {
|
||||
private final AtomicBoolean localMuted = new AtomicBoolean(false);
|
||||
private final AtomicBoolean transmitting = new AtomicBoolean(false);
|
||||
private final AtomicBoolean pttDown = new AtomicBoolean(false);
|
||||
private final AtomicBoolean forceDown = new AtomicBoolean(false);
|
||||
private final AtomicBoolean running = new AtomicBoolean(false);
|
||||
|
||||
private volatile Settings.InputMode mode;
|
||||
@@ -270,6 +271,11 @@ public final class CaptureVoiceInput implements VoiceInput {
|
||||
this.pttDown.set(down);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setForceTransmit(boolean down) {
|
||||
this.forceDown.set(down);
|
||||
}
|
||||
|
||||
public void setMuted(boolean m) {
|
||||
this.muted.set(m);
|
||||
}
|
||||
@@ -478,6 +484,7 @@ public final class CaptureVoiceInput implements VoiceInput {
|
||||
return false;
|
||||
}
|
||||
mutedTalking = false;
|
||||
if (forceDown.get()) return true;
|
||||
switch (mode) {
|
||||
case CONTINUOUS:
|
||||
return true;
|
||||
|
||||
@@ -71,6 +71,9 @@ public interface VoiceInput extends Microphone {
|
||||
|
||||
void setPushToTalk(boolean pressed);
|
||||
|
||||
/** Transmits while held, whatever the input mode or the gate says; a mute still wins. */
|
||||
void setForceTransmit(boolean pressed);
|
||||
|
||||
/** Receives the live input level on {@link InputLevel}'s scale, once per captured frame. */
|
||||
void setLevelListener(Consumer<Double> listener);
|
||||
|
||||
|
||||
@@ -107,6 +107,12 @@ public final class Sessions {
|
||||
if (mic != null) mic.setPushToTalk(talking);
|
||||
}
|
||||
|
||||
/** Transmits on the server holding the microphone while held, in any input mode. */
|
||||
public void setForceTransmit(boolean talking) {
|
||||
VoiceInput mic = microphoneOf(microphoneOwner);
|
||||
if (mic != null) mic.setForceTransmit(talking);
|
||||
}
|
||||
|
||||
/** Tells every connected microphone about a key press, as TS3 tells all its connections. */
|
||||
public void keyPressed() {
|
||||
for (ServerSession s : sessions) {
|
||||
|
||||
Reference in New Issue
Block a user