feat(ui): add bundled custom notification sounds

Adds three embedded WAV files as additional notification sound choices
(ids 17-19) alongside the existing 16 game sounds. Playback via NAudio
WaveOutEvent/WinMM, which works correctly on Wine/Linux.
This commit is contained in:
2026-05-21 20:07:09 +02:00
parent 969d5e6aa6
commit cc1c05add0
13 changed files with 253 additions and 14 deletions
+18 -8
View File
@@ -363,16 +363,26 @@ internal class MessageManager : IAsyncDisposable
if (notificationSound is { } soundId)
{
// ProcessMessage runs on the PendingMessageThread worker; the native
// UIGlobals.PlaySoundEffect must be marshalled onto the framework
// thread (reference_dalamud_framework_thread).
Plugin.Framework.RunOnFrameworkThread(() =>
if (soundId is >= 1 and <= 16)
{
unsafe
// ProcessMessage runs on the PendingMessageThread worker; the native
// UIGlobals.PlaySoundEffect must be marshalled onto the framework
// thread (reference_dalamud_framework_thread).
Plugin.Framework.RunOnFrameworkThread(() =>
{
UIGlobals.PlaySoundEffect(soundId);
}
});
unsafe
{
UIGlobals.PlaySoundEffect(soundId);
}
});
}
else if (soundId >= 17)
{
// Custom bundled sounds (ids 17-19) go through NAudio WaveOutEvent.
// NAudio manages its own playback thread, so no framework marshalling needed.
Plugin.CustomAudioPlayer.Play((int)soundId - 16);
}
// soundId == 0 (hand-edited config) falls through: plays nothing.
}
MessageProcessed?.Invoke(message);