|
|
|
@ -5,7 +5,6 @@ |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Linq; |
|
|
|
using System.Linq; |
|
|
|
using Lib.Audio.Interfaces; |
|
|
|
using Lib.Audio.Interfaces; |
|
|
|
using Lib.ProcessManaging.Interfaces; |
|
|
|
|
|
|
|
using NAudio.CoreAudioApi; |
|
|
|
using NAudio.CoreAudioApi; |
|
|
|
|
|
|
|
|
|
|
|
namespace Lib.Audio |
|
|
|
namespace Lib.Audio |
|
|
|
@ -14,15 +13,24 @@ namespace Lib.Audio |
|
|
|
{ |
|
|
|
{ |
|
|
|
private readonly List<AudioSessionControl> _audioSessionControls; |
|
|
|
private readonly List<AudioSessionControl> _audioSessionControls; |
|
|
|
|
|
|
|
|
|
|
|
public Controllable(List<AudioSessionControl> audioSessionControls, IObservedProcess? process, string name) |
|
|
|
public Controllable(List<AudioSessionControl> audioSessionControls, string executablePath, string name) |
|
|
|
{ |
|
|
|
{ |
|
|
|
_audioSessionControls = audioSessionControls; |
|
|
|
_audioSessionControls = audioSessionControls; |
|
|
|
Process = process; |
|
|
|
ExecutablePath = executablePath; |
|
|
|
Name = name; |
|
|
|
Name = name; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Controllable(string executablePath) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
IsValid = false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ExecutablePath = executablePath; |
|
|
|
|
|
|
|
Name = ""; |
|
|
|
|
|
|
|
_audioSessionControls = new List<AudioSessionControl>(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public bool IsValid { get; set; } = true; |
|
|
|
public bool IsValid { get; set; } = true; |
|
|
|
public IObservedProcess? Process { get; } |
|
|
|
public string ExecutablePath { get; } |
|
|
|
public string Name { get; } |
|
|
|
public string Name { get; } |
|
|
|
public string? IconPath => _audioSessionControls.FirstOrDefault(c => !string.IsNullOrEmpty(c.IconPath))?.IconPath; //FixMe |
|
|
|
public string? IconPath => _audioSessionControls.FirstOrDefault(c => !string.IsNullOrEmpty(c.IconPath))?.IconPath; //FixMe |
|
|
|
|
|
|
|
|
|
|
|
|