mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Move WMP check to app startup
This commit is contained in:
parent
490bf59024
commit
2c3e1bfefa
4 changed files with 7 additions and 6 deletions
|
|
@ -271,6 +271,9 @@ namespace Flow.Launcher.Infrastructure.UserSettings
|
|||
public AnimationSpeeds AnimationSpeed { get; set; } = AnimationSpeeds.Medium;
|
||||
public int CustomAnimationLength { get; set; } = 360;
|
||||
|
||||
[JsonIgnore]
|
||||
public bool WMPInstalled { get; set; } = true;
|
||||
|
||||
|
||||
// This needs to be loaded last by staying at the bottom
|
||||
public PluginsSettings PluginSettings { get; set; } = new PluginsSettings();
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ namespace Flow.Launcher
|
|||
|
||||
_settingsVM = new SettingWindowViewModel(_updater, _portable);
|
||||
_settings = _settingsVM.Settings;
|
||||
_settings.WMPInstalled = WindowsMediaPlayerHelper.IsWindowsMediaPlayerInstalled();
|
||||
|
||||
AbstractPluginEnvironment.PreStartPluginExecutablePathUpdate(_settings);
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@ namespace Flow.Launcher
|
|||
private bool _animating;
|
||||
private bool isArrowKeyPressed = false;
|
||||
|
||||
private bool isWMPInstalled = true;
|
||||
private MediaPlayer animationSoundWMP;
|
||||
private SoundPlayer animationSoundWPF;
|
||||
|
||||
|
|
@ -509,8 +508,7 @@ namespace Flow.Launcher
|
|||
|
||||
private void InitSoundEffects()
|
||||
{
|
||||
isWMPInstalled = WindowsMediaPlayerHelper.IsWindowsMediaPlayerInstalled();
|
||||
if (isWMPInstalled)
|
||||
if (_settings.WMPInstalled)
|
||||
{
|
||||
animationSoundWMP = new MediaPlayer();
|
||||
animationSoundWMP.Open(new Uri(AppDomain.CurrentDomain.BaseDirectory + "Resources\\open.wav"));
|
||||
|
|
@ -523,8 +521,7 @@ namespace Flow.Launcher
|
|||
|
||||
private void SoundPlay()
|
||||
{
|
||||
|
||||
if (isWMPInstalled)
|
||||
if (_settings.WMPInstalled)
|
||||
{
|
||||
animationSoundWMP.Position = TimeSpan.Zero;
|
||||
animationSoundWMP.Volume = _settings.SoundVolume / 100.0;
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ namespace Flow.Launcher
|
|||
|
||||
private void CheckMediaPlayer()
|
||||
{
|
||||
if (!WindowsMediaPlayerHelper.IsWindowsMediaPlayerInstalled())
|
||||
if (settings.WMPInstalled)
|
||||
{
|
||||
WMPWarning.Visibility = Visibility.Visible;
|
||||
VolumeAdjustCard.Visibility = Visibility.Collapsed;
|
||||
|
|
|
|||
Loading…
Reference in a new issue