users: add shift-u alphabetical list with per-user listen volume controls

This commit is contained in:
Jage9
2026-02-22 19:15:03 -05:00
parent 590e33d374
commit fe230bd53d
8 changed files with 120 additions and 4 deletions

View File

@@ -41,6 +41,7 @@ export class PeerManager {
nickname: userData.nickname ?? 'user...',
x: userData.x ?? 20,
y: userData.y ?? 20,
listenGain: 1,
pc,
};
@@ -145,6 +146,18 @@ export class PeerManager {
peer.nickname = nickname;
}
setPeerListenGain(id: string, gain: number): void {
const peer = this.peers.get(id);
if (!peer) return;
peer.listenGain = gain;
}
getPeerListenGain(id: string): number {
const peer = this.peers.get(id);
if (!peer) return 1;
return Number.isFinite(peer.listenGain) ? Math.max(0, peer.listenGain as number) : 1;
}
async setOutputDevice(deviceId: string): Promise<void> {
this.outputDeviceId = deviceId;
for (const peer of this.peers.values()) {