Files
voice-cat/clients/windows/VoiceCat.Interop/Models.cs
Talon d397731db9 feat(audio): per-stream mix controls in Windows client + vc_get_remote_stream getter
PerUserTuningDialog previously broadcast one gain/mute/NR set to *all* of a
user's streams, even though the core mixer (AudioEngine::RemoteStream) and
the C ABI (vc_set_remote_stream) were already per-stream. The UI had no
per-mix controls anywhere.

Reworks the dialog to enumerate ListUserStreams on open and render one row
per stream (kind + label + Gain + Mute + NR), each wiring only to its own
stream_id. Adds a read-back ABI counterpart, vc_get_remote_stream, so the
dialog opens at the listener's actual current per-stream settings (defaults
1.0/unmuted/NR-off) rather than always 100%. Additive ABI change only; no
existing symbols touched.

Tests: test_m3_multistream extended with getter round-trip assertions; new
C# smoke test exercises the full P/Invoke marshaling path with two clients.
Docs: voice.md §10 notes the getter. NR checkbox keeps its honest
'passthrough' label (NS DSP still unbuilt per §8).
2026-06-18 02:06:44 +02:00

75 lines
1.6 KiB
C#

// Plain managed record types — what survives past the native struct/free-list lifetime
// (Marshaling.cs converts the native *Native structs into these and immediately frees the
// native list). Nothing here holds an IntPtr.
namespace VoiceCat.Interop;
public sealed record ChannelInfo(
uint Id,
uint ParentId,
string Name,
string Topic,
bool PasswordProtected,
uint MaxUsers);
public sealed record ChannelEditInfo(
uint Id,
uint ParentId,
string Name,
string Topic,
bool PasswordProtected,
string? Password,
uint MaxUsers,
uint SortOrder,
AudioConfigInfo Audio);
public sealed record UserInfo(
uint Id,
string Nickname,
bool IsGuest,
uint ChannelId,
bool SelfMicMuted,
bool SelfDeafened,
bool ServerMuted,
bool ServerDeafened);
public sealed record PermissionsInfo(
bool CanCreateTempChannel,
bool CanKick,
bool CanBan,
bool CanMoveUsers,
bool CanAdminAccounts,
bool IsAdmin);
public sealed record AccountInfo(
string Username,
bool IsAdmin,
ulong CreatedAtUnixMs,
ulong LastLoginUnixMs);
public sealed record StreamSummary(
uint StreamId,
VcStreamKind Kind,
string Label);
public sealed record RemoteStreamState(
float Gain,
bool Muted,
bool NoiseReduction);
public sealed record DeviceInfo(
string Id,
string Name,
bool IsDefault);
public sealed record AudioConfigInfo(
uint Codec,
bool Stereo,
uint SampleRate,
uint BitrateBps,
uint FrameMs,
uint Application,
bool Fec,
uint ExpectedPacketLoss,
bool Dtx,
uint Complexity);