Files
MesenCE/UI/ViewModels/AudioPlayerViewModel.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

34 lines
774 B
C#

using CommunityToolkit.Mvvm.ComponentModel;
using Mesen.Config;
using Mesen.Interop;
using Mesen.Utilities;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Mesen.ViewModels
{
public partial class AudioPlayerViewModel : DisposableViewModel
{
[ObservableProperty] public partial AudioPlayerConfig Config { get; set; }
[ObservableProperty] public partial bool IsPaused { get; set; }
public AudioPlayerViewModel()
{
Config = ConfigManager.Config.AudioPlayer;
AddDisposable(Config.ObserveProp(nameof(Config.Volume), () => {
Config.ApplyConfig();
}));
}
public void UpdatePauseFlag()
{
IsPaused = EmuApi.IsPaused();
}
}
}