Creator ruling (2026-10-30): TRAX is background music and is controlled separately from desktop and mic — so KISS it: - TRAX loses its own ladder and slider. It is one number plus ±5 dB buttons, disabled at the ends (−60 dB floor, +6 dB ceiling). - It STARTS at −50 dB, taken from the creator's own meter readings, and moves in 5 dB clicks. If that proves inaudible on their setup, six clicks lands at −20 — the buttons exist for exactly that, and `TraxDefaultDb` is one constant. - Layout follows: Desktop's volume now sits directly beneath its ladder, and the TRAX row (name, play/pause, level) sits beneath that, inside the GAME bay. The bays are MIC | GAME+TRAX | LIP-SYNC. - The metering tap on the player stays (it is how "is the music producing sound" is answered) but has no ladder of its own; the desktop bed already shows the music. Guards updated: TraxBayTests now asserts the stepper wiring and that the row has NO SegmentMeter; GameBayTests asserts the desktop fader sits below the desktop ladder.
38 lines
1.9 KiB
C#
38 lines
1.9 KiB
C#
using Xunit;
|
||
using ytLive.Helpers;
|
||
using ytLive.Services.Audio;
|
||
using ytLive.ViewModels;
|
||
|
||
namespace ytLive.Tests;
|
||
|
||
/// <summary>The GAME bay's badge must carry the gain the mixer actually applied — a duck indicator
|
||
/// that is not the real value is decoration, and this creator cannot hear whether it happened.
|
||
/// </summary>
|
||
public class GameBayTests
|
||
{
|
||
[Fact]
|
||
public void The_game_bay_binds_the_db_fader_and_a_real_duck_readout()
|
||
{
|
||
var dock = SourceAssert.Text("Controls", "AudioDock.xaml");
|
||
Assert.Contains("Value=\"{Binding GameVolumeDb, Mode=TwoWay}\"", dock);
|
||
// Desktop volume sits directly beneath its meter (creator's layout ruling).
|
||
var desktopMeter = dock.IndexOf("Level=\"{Binding GameMeterFraction}\"", System.StringComparison.Ordinal);
|
||
var desktopFader = dock.IndexOf("Value=\"{Binding GameVolumeDb, Mode=TwoWay}\"", System.StringComparison.Ordinal);
|
||
Assert.True(desktopFader > desktopMeter, "the desktop fader belongs under the desktop ladder");
|
||
Assert.Contains("Level=\"{Binding GameMeterFraction}\"", dock);
|
||
Assert.Contains("Text=\"{Binding GameDuckLabel}\"", dock);
|
||
Assert.Contains("Visibility=\"{Binding IsGameDucking, Converter={StaticResource BoolToVis}}\"", dock);
|
||
|
||
foreach (var name in new[] { "GameVolumeDb", "GameVolumeDbLabel", "GameMeterFraction", "IsGameDucking", "GameDuckLabel" })
|
||
Assert.NotNull(typeof(MainViewModel).GetProperty(name));
|
||
|
||
// The badge's number is the mixer's ducker, not a copy: the duck is −12.04 dB by design,
|
||
// and the label is produced from the live gain through the same dB scale as the faders.
|
||
Assert.Equal(-12.04, GainDb.ToDb(AutoDucker.DuckGain), 1);
|
||
Assert.Equal("-12.0 DUCK", GainDb.Label(GainDb.ToDb(AutoDucker.DuckGain)) + " DUCK");
|
||
|
||
// And the mixer exposes that gain rather than hiding it.
|
||
Assert.NotNull(typeof(AudioMixer).GetProperty("DuckGain"));
|
||
}
|
||
}
|