- Mute/deafen status now goes out through clientupdate instead of clientedit, which silently rejected client_input_muted/output_muted since they are runtime status, not editable client properties. - Publish client_input_hardware so other clients see "Microphone Disabled" instead of silence while another tab holds the capture device; track input/output hardware flags for other clients too, and show a distinct grey "disabled" icon instead of reusing the red "muted" one for both the tree and the info panel. - Implement TS3's Enable/Disable/Toggle Local Mic Mute hotkeys: they silence capture like a real mute, but never touch the published mute status or play a sound. - A speaker's "talking" indicator only ever cleared when its zero-length end-of-burst voice packet arrived; if that one UDP packet was lost, the indicator stuck until their next burst. Add a watchdog that clears it after 200ms of silence from that speaker regardless.
56 lines
1.5 KiB
Java
56 lines
1.5 KiB
Java
package com.ts3client.ui;
|
|
|
|
import javax.swing.ImageIcon;
|
|
|
|
/**
|
|
* The state of the local client on one server, as the tree shows it for any other
|
|
* client — the states are listed in the order the official client gives them
|
|
* priority, the strongest one first.
|
|
*/
|
|
enum SelfState {
|
|
|
|
DISCONNECTED("Not connected"),
|
|
DEAFENED("Speakers muted"),
|
|
MIC_MUTED("Microphone muted"),
|
|
MIC_LOCAL_MUTED("Microphone locally muted"),
|
|
AWAY("Away"),
|
|
COMMANDER_TALKING("Talking (channel commander)"),
|
|
COMMANDER("Channel commander"),
|
|
TALKING("Talking"),
|
|
IDLE("Connected");
|
|
|
|
private final String label;
|
|
|
|
SelfState(String label) {
|
|
this.label = label;
|
|
}
|
|
|
|
String label() {
|
|
return label;
|
|
}
|
|
|
|
/** The icon this state is drawn with, from the active icon pack. */
|
|
ImageIcon icon(int size) {
|
|
switch (this) {
|
|
case DISCONNECTED:
|
|
return Icons.app(size);
|
|
case DEAFENED:
|
|
return Icons.speakerMuted(size);
|
|
case MIC_MUTED:
|
|
return Icons.micMuted(size);
|
|
case MIC_LOCAL_MUTED:
|
|
return Icons.micLocalMuted(size);
|
|
case AWAY:
|
|
return Icons.clientAway(size);
|
|
case COMMANDER_TALKING:
|
|
return Icons.clientCommanderTalking(size);
|
|
case COMMANDER:
|
|
return Icons.clientCommander(size);
|
|
case TALKING:
|
|
return Icons.clientTalking(size);
|
|
default:
|
|
return Icons.clientIdle(size);
|
|
}
|
|
}
|
|
}
|