Retail EoR has no music system: the linked winmm MIDI player has zero callers, 'music' appears zero times in the 65 MB decomp, SoundType has no music member, InitPrefs registers no music key, and the install ships no music files. So PlayMusic/StopMusic/MusicVolume and the AudioSettings Music knob are deleted rather than left as an API modelling dead code — the string-keyed signature was the tell, since every other entry point is DID-keyed. Old settings.json files carrying a 'music' key still load; the reader ignores unknown keys and the next save drops it. The Ambient slider is now surfaced, because slice A5 gave it something to drive, and its default returns to retail's 1.0 from an invented 0.8 — InitPrefs defaults every sound preference to unity. The panel rule is unchanged: no slider that does nothing. r05-audio-sound.md gets a SUPERSEDED banner naming its five wrong sections (falloff, pan, voice pool, selection, music, ambient) so a future reader reaches the lane notes instead of the Ghidra-era reads that this campaign spent its first two slices undoing. TS-9 re-scoped from 'any MP3 cue' to the measured blast radius: exactly 1 MP3 among 786 shipped waves, a ~2 s mono clip. Its original framing assumed a music system that does not exist. The ADPCM count remains unmeasured and is named as the open question. Deferred deliberately: #321's sound-cache decode-dedup race. It is a pre-existing concurrency flake rather than audio-parity behaviour, and shipping a speculative fix to a race I have not reproduced is exactly the shortcut this project's no-workarounds rule exists to prevent. Campaign A is code-complete; the plan carries the closeout. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
44 lines
1.5 KiB
C#
44 lines
1.5 KiB
C#
using AcDream.UI.Abstractions.Panels.Settings;
|
|
|
|
namespace AcDream.UI.Abstractions.Tests.Panels.Settings;
|
|
|
|
/// <summary>
|
|
/// L.0: <see cref="AudioSettings"/> default-pin tests. Defaults must
|
|
/// match the OpenAL engine's hard-coded constructor values so a user
|
|
/// who has never opened the Audio tab gets identical behaviour to the
|
|
/// pre-Phase-L world.
|
|
/// </summary>
|
|
public sealed class AudioSettingsTests
|
|
{
|
|
[Fact]
|
|
public void Default_values_match_engine_constructor_defaults()
|
|
{
|
|
// Retail's SoundManager::InitPrefs @ 0x005503F0 defaults every sound
|
|
// preference to 1.0; acdream's extra master matches. The Music knob is
|
|
// gone (retail has no music system) and Ambient's invented 0.8 with it.
|
|
var d = AudioSettings.Default;
|
|
Assert.Equal(1.0f, d.Master);
|
|
Assert.Equal(1.0f, d.Sfx);
|
|
Assert.Equal(1.0f, d.Ambient);
|
|
}
|
|
|
|
[Fact]
|
|
public void Equality_is_value_based()
|
|
{
|
|
var a = AudioSettings.Default;
|
|
var b = AudioSettings.Default with { Master = 0.5f };
|
|
var c = AudioSettings.Default with { Master = 0.5f };
|
|
Assert.NotEqual(a, b);
|
|
Assert.Equal(b, c);
|
|
}
|
|
|
|
[Fact]
|
|
public void With_expression_clones_one_field()
|
|
{
|
|
var d = AudioSettings.Default with { Ambient = 0.25f };
|
|
Assert.Equal(0.25f, d.Ambient);
|
|
// Other fields untouched.
|
|
Assert.Equal(AudioSettings.Default.Master, d.Master);
|
|
Assert.Equal(AudioSettings.Default.Sfx, d.Sfx);
|
|
}
|
|
}
|