|
|
|
|
@ -7,6 +7,7 @@ using System.Collections.Generic; |
|
|
|
|
using System.Linq; |
|
|
|
|
using Lib.Audio.Factories; |
|
|
|
|
using Lib.Audio.Interfaces; |
|
|
|
|
using Lib.Logging; |
|
|
|
|
using Lib.ProcessManaging.Interfaces; |
|
|
|
|
using NAudio.CoreAudioApi; |
|
|
|
|
using NAudio.CoreAudioApi.Interfaces; |
|
|
|
|
@ -26,8 +27,8 @@ namespace Lib.Audio |
|
|
|
|
|
|
|
|
|
public List<IControllable> Controllables => CreateControllables(); |
|
|
|
|
|
|
|
|
|
public IControllable? GetControllableForProcess(IObservedProcess process) => |
|
|
|
|
Controllables.FirstOrDefault(c => c.Process != null && c.Process.IsSameExecutable(process)); |
|
|
|
|
public IControllable? GetControllableForExecutable(string executablePath) => |
|
|
|
|
Controllables.FirstOrDefault(c => c.ExecutablePath.Equals(executablePath)); |
|
|
|
|
|
|
|
|
|
private List<IControllable> CreateControllables() |
|
|
|
|
{ |
|
|
|
|
@ -74,8 +75,14 @@ namespace Lib.Audio |
|
|
|
|
name = process.Name; |
|
|
|
|
else |
|
|
|
|
name = id; |
|
|
|
|
|
|
|
|
|
if (process == null) |
|
|
|
|
{ |
|
|
|
|
Log.Write<ControllableCollector>($"Could not find process for session id {id}."); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
controllables.Add(_controllableFactory.Create(idSessions, process, name)); |
|
|
|
|
controllables.Add(_controllableFactory.Create(idSessions, process.FileName, name)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return controllables; |
|
|
|
|
|