feat(clients): expose all channel codec params + guest nickname everywhere
Channel create/edit UIs only surfaced a subset of the core's vc_audio_config, and DRED was exposed nowhere. While adding it, found a latent ABI mismatch: both Swift AudioConfig and the C# VcAudioConfigNative blittable struct were one int short of the native vc_audio_config (missing the trailing `dred`), so native read past the managed struct in vc_create_channel/vc_edit_channel. - core marshaling: thread `dred` through Swift (Models/Marshaling/toNative) and C# (Structs/Models/Marshaling/VoiceCatClient) -- fixes the ABI gap + enables it - windows: add the one missing DRED checkbox to ChannelEditDialog - macos: ChannelEditSheet now exposes application, sample rate, packet loss, complexity, and DRED (was stereo/bitrate/frame/FEC/DTX only) - ios: rebuild ChannelEditView into a full create+edit form (all params); add SessionState.editChannel + an admin Edit swipe action (iOS had no edit UI) - guest nickname: add a dedicated `nickname` to SavedServer on macOS+iOS (backward-compatible Codable), shown in Guest mode, wired into the guest auth path -- guests could not set a display name on either before (only Windows) Verified: macOS + iOS (sim, arm64) xcodebuild BUILD SUCCEEDED; core ctest 22/23 (only external_pcm aborts on a pre-existing shutdown mutex race; no C++ changed).
This commit is contained in:
@@ -28,6 +28,7 @@ public sealed class ChannelEditDialog : Form
|
||||
private CheckBox _chkFec = null!;
|
||||
private NumericUpDown _numExpectedLoss = null!;
|
||||
private CheckBox _chkDtx = null!;
|
||||
private CheckBox _chkDred = null!;
|
||||
private NumericUpDown _numComplexity = null!;
|
||||
|
||||
public ChannelEditInfo? Result { get; private set; }
|
||||
@@ -183,7 +184,7 @@ public sealed class ChannelEditDialog : Form
|
||||
|
||||
private void BuildAudioPage(TabPage page, AudioConfigInfo? audio)
|
||||
{
|
||||
audio ??= new AudioConfigInfo(0, false, 48000, 0, 20, 0, true, 0, false, 10);
|
||||
audio ??= new AudioConfigInfo(0, false, 48000, 0, 20, 0, true, 0, false, 10, false);
|
||||
|
||||
int y = 16;
|
||||
int labelWidth = 150;
|
||||
@@ -314,6 +315,17 @@ public sealed class ChannelEditDialog : Form
|
||||
TabIndex = 18,
|
||||
};
|
||||
page.Controls.Add(_chkDtx);
|
||||
y += 28;
|
||||
|
||||
_chkDred = new CheckBox
|
||||
{
|
||||
Text = "D&RED (deep redundancy)",
|
||||
Location = new Point(inputX, y),
|
||||
AutoSize = true,
|
||||
Checked = audio.Dred,
|
||||
TabIndex = 19,
|
||||
};
|
||||
page.Controls.Add(_chkDred);
|
||||
}
|
||||
|
||||
private static void AddLabel(Control parent, string text, int x, int y, int width)
|
||||
@@ -362,7 +374,8 @@ public sealed class ChannelEditDialog : Form
|
||||
Fec: _chkFec.Checked,
|
||||
ExpectedPacketLoss: (uint)_numExpectedLoss.Value,
|
||||
Dtx: _chkDtx.Checked,
|
||||
Complexity: (uint)_numComplexity.Value);
|
||||
Complexity: (uint)_numComplexity.Value,
|
||||
Dred: _chkDred.Checked);
|
||||
|
||||
Result = new ChannelEditInfo(
|
||||
Id: _editingId,
|
||||
|
||||
@@ -876,7 +876,7 @@ public partial class MainForm : Form
|
||||
var editInfo = new ChannelEditInfo(
|
||||
channel.Id, channel.ParentId, channel.Name, channel.Topic,
|
||||
channel.PasswordProtected, null, channel.MaxUsers, 0,
|
||||
new AudioConfigInfo(0, false, 48000, 0, 20, 0, true, 0, false, 10));
|
||||
new AudioConfigInfo(0, false, 48000, 0, 20, 0, true, 0, false, 10, false));
|
||||
|
||||
using var dlg = new ChannelEditDialog(_channels, editInfo);
|
||||
if (dlg.ShowDialog(this) != DialogResult.OK || dlg.Result is null) return;
|
||||
|
||||
@@ -188,7 +188,7 @@ public sealed class VoiceCatClientSmokeTests : IDisposable
|
||||
Password: null,
|
||||
MaxUsers: 42,
|
||||
SortOrder: 0,
|
||||
Audio: new AudioConfigInfo(0, true, 48000, 64000, 20, 1, true, 5, false, 10))));
|
||||
Audio: new AudioConfigInfo(0, true, 48000, 64000, 20, 1, true, 5, false, 10, false))));
|
||||
Assert.True(PumpUntil(client,
|
||||
() => events.Any(e => e.Type == VcEventType.GenericResult && e.Result == VcResult.Ok), 3000),
|
||||
"CreateChannel did not succeed");
|
||||
@@ -208,7 +208,7 @@ public sealed class VoiceCatClientSmokeTests : IDisposable
|
||||
null,
|
||||
100,
|
||||
0,
|
||||
new AudioConfigInfo(0, true, 48000, 64000, 20, 1, true, 5, false, 10))));
|
||||
new AudioConfigInfo(0, true, 48000, 64000, 20, 1, true, 5, false, 10, false))));
|
||||
events.Clear();
|
||||
Assert.True(PumpUntil(client,
|
||||
() => events.Any(e => e.Type == VcEventType.GenericResult && e.Result == VcResult.Ok), 3000),
|
||||
|
||||
@@ -96,7 +96,8 @@ internal static class Marshaling
|
||||
native.Fec != 0,
|
||||
native.ExpectedPacketLoss,
|
||||
native.Dtx != 0,
|
||||
native.Complexity);
|
||||
native.Complexity,
|
||||
native.Dred != 0);
|
||||
|
||||
public static PermissionsInfo ToManaged(in VcPermissionsNative native) => new(
|
||||
native.CanCreateTempChannel != 0,
|
||||
|
||||
@@ -71,4 +71,5 @@ public sealed record AudioConfigInfo(
|
||||
bool Fec,
|
||||
uint ExpectedPacketLoss,
|
||||
bool Dtx,
|
||||
uint Complexity);
|
||||
uint Complexity,
|
||||
bool Dred);
|
||||
|
||||
@@ -61,6 +61,7 @@ internal struct VcAudioConfigNative
|
||||
public uint ExpectedPacketLoss;
|
||||
public int Dtx;
|
||||
public uint Complexity;
|
||||
public int Dred;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
|
||||
@@ -346,6 +346,7 @@ public sealed class VoiceCatClient : IDisposable
|
||||
ExpectedPacketLoss = info.Audio.ExpectedPacketLoss,
|
||||
Dtx = info.Audio.Dtx ? 1 : 0,
|
||||
Complexity = info.Audio.Complexity,
|
||||
Dred = info.Audio.Dred ? 1 : 0,
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user