Files
MesenCE/UI/Config/AudioPlayerConfig.cs
SourMesen 40335ce735 UI: Update to Avalonia 12, .NET 10 and replace ReactiveUI with MVVM community toolkit (#142)
Also fixes DX11.0 support (for Win7 PCs that aren't fully updated), which stopped working after the recent variable refresh rate changes
2026-07-03 16:04:42 +09:00

36 lines
939 B
C#

using CommunityToolkit.Mvvm.ComponentModel;
using Mesen.Interop;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace Mesen.Config
{
public partial class AudioPlayerConfig : BaseConfig<AudioPlayerConfig>
{
[ObservableProperty] public partial UInt32 Volume { get; set; } = 100;
[ObservableProperty] public partial bool Repeat { get; set; } = false;
[ObservableProperty] public partial bool Shuffle { get; set; } = false;
public void ApplyConfig()
{
ConfigApi.SetAudioPlayerConfig(new InteropAudioPlayerConfig() {
Volume = Volume,
Repeat = Repeat,
Shuffle = Shuffle,
});
}
}
[StructLayout(LayoutKind.Sequential)]
public struct InteropAudioPlayerConfig
{
public UInt32 Volume;
[MarshalAs(UnmanagedType.I1)] public bool Repeat;
[MarshalAs(UnmanagedType.I1)] public bool Shuffle;
}
}