Three bugs fixed across the full stack (proto/server/core/ABI/Win/macOS/iOS): 1. Join/Leave Voice now truly subscribes/unsubscribes from the voice plane. Previously the button only toggled the local mic — receiving was always on (gated by channel membership alone). Added a protocol-level voice subscription concept: new SubscribeVoiceRequest/UnsubscribeVoiceRequest/VoiceSubscriptionResult proto messages, User.voice_subscribed field, vc_join_voice/vc_leave_voice C ABI functions, VC_EVENT_VOICE_STATE event, server-side voice_subscribed flag checked by the SFU relay recipient filter, and core-client gating of remote-stream decoder setup. All three clients rewired to subscribe+mic on Join / unsubscribe on Leave. Text chat works regardless of voice subscription. 2. Channel edit dialog now shows the channel's actual current settings. The read struct vc_channel was missing sort_order and audio fields — only the write struct vc_channel_info had them. Extended vc_channel with both (additive, no ABI break), updated the session model and list_channels marshaling to populate them, and updated all three clients' edit callers to use actual channel info instead of hardcoded defaults. 3. Channel parameter updates now automatically restart everyone's streams. Previously editing a channel's audio config persisted and broadcast a ChannelEvent::UPDATED, but no layer restarted streams — encoders/decoders are frozen at announce time. handle_channel_event now detects audio-config changes on the user's current channel and stop->starts each active local stream. The server reads the updated config on re-announce; peers wire up fresh decoders at the new ssrc. All 29 CTest tests pass; Windows DLL + C# client build clean. Apple clients not yet compile-verified (Windows environment).
111 lines
2.7 KiB
C#
111 lines
2.7 KiB
C#
// Mirrors of voicecat.h's enums. Keep these in lockstep with core/include/voicecat.h —
|
|
// values are append-only per the C ABI's house rule, so it's safe to add new members at the
|
|
// end here too, but never renumber/remove existing ones.
|
|
namespace VoiceCat.Interop;
|
|
|
|
public enum VcResult
|
|
{
|
|
Ok = 0,
|
|
NotImplemented = 1,
|
|
InvalidArg = 2,
|
|
NotConnected = 3,
|
|
Already = 4,
|
|
AuthFailed = 5,
|
|
PermissionDenied = 6,
|
|
Timeout = 7,
|
|
Io = 8,
|
|
Protocol = 9,
|
|
Crypto = 10,
|
|
Audio = 11,
|
|
Internal = 12,
|
|
}
|
|
|
|
public enum VcLogLevel
|
|
{
|
|
Trace = 0,
|
|
Debug = 1,
|
|
Info = 2,
|
|
Warn = 3,
|
|
Error = 4,
|
|
Off = 5,
|
|
}
|
|
|
|
public enum VcConnectionState
|
|
{
|
|
Disconnected = 0,
|
|
Connecting = 1,
|
|
TlsHandshake = 2,
|
|
Authenticating = 3,
|
|
Connected = 4,
|
|
/// <summary>M4: handshake succeeded, waiting on vc_confirm_server_identity().</summary>
|
|
VerifyingIdentity = 5,
|
|
}
|
|
|
|
public enum VcTextScope
|
|
{
|
|
Channel = 0,
|
|
Private = 1,
|
|
Server = 2,
|
|
}
|
|
|
|
public enum VcDeviceKind
|
|
{
|
|
Input = 0,
|
|
Output = 1,
|
|
}
|
|
|
|
public enum VcStreamKind
|
|
{
|
|
Mic = 0,
|
|
/// <summary>System/desktop audio (WASAPI loopback on Windows).</summary>
|
|
ScreenAudio = 1,
|
|
AuxDevice = 2,
|
|
}
|
|
|
|
/// <summary>Send-side input gate (docs/voice.md §11).</summary>
|
|
public enum VcInputMode
|
|
{
|
|
VoiceActivation = 0,
|
|
PushToTalk = 1,
|
|
AlwaysOn = 2, // transmit unconditionally, no VAD gate
|
|
}
|
|
|
|
public enum VcEventType
|
|
{
|
|
ConnectionState = 0,
|
|
AuthResult = 1,
|
|
ChannelList = 2,
|
|
UserJoined = 3,
|
|
UserLeft = 4,
|
|
UserUpdated = 5,
|
|
TextMessage = 6,
|
|
StreamStarted = 7,
|
|
StreamStopped = 8,
|
|
TalkState = 9,
|
|
Error = 10,
|
|
Disconnected = 11,
|
|
/// <summary>M4: reply to VoiceCatClient.JoinChannelAsync's underlying vc_join_channel.</summary>
|
|
JoinResult = 12,
|
|
/// <summary>M4: the TOFU server-identity gate — see VcTofuStatus.</summary>
|
|
ServerIdentity = 13,
|
|
/// <summary>M5: async result for moderation/admin/channel operations.</summary>
|
|
GenericResult = 14,
|
|
/// <summary>M5: reply to VoiceCatClient.RequestAccountList — call ListAccounts() to read.</summary>
|
|
AccountList = 15,
|
|
/// <summary>Voice-plane subscription state. u32a = 1 (subscribed) or 0 (unsubscribed).</summary>
|
|
VoiceState = 16,
|
|
}
|
|
|
|
/// <summary>
|
|
/// TOFU server-identity classification. Pins the TLS leaf certificate's own SHA-256
|
|
/// fingerprint (real, verifiable from the handshake) — NOT the declared Ed25519 identity
|
|
/// fingerprint from ServerHello, which is informational/display-only (see
|
|
/// VoiceCatClient.GetServerIdentityDisplay and docs/security.md §1.1).
|
|
/// </summary>
|
|
public enum VcTofuStatus
|
|
{
|
|
FirstConnect = 0,
|
|
Matched = 1,
|
|
Mismatch = 2,
|
|
}
|