From 04fc09312a93a568ae70286a9759a5d88a815555 Mon Sep 17 00:00:00 2001 From: Simon G Date: Mon, 26 Apr 2021 13:13:02 +0200 Subject: [PATCH] - use executable path --- Lib.Audio/Channel.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Lib.Audio/Channel.cs b/Lib.Audio/Channel.cs index 60bb5b8..b6651c0 100644 --- a/Lib.Audio/Channel.cs +++ b/Lib.Audio/Channel.cs @@ -70,7 +70,9 @@ namespace Lib.Audio { Controllable = controllable; ToggleSelectButtonLed(); - InitializeFader(controllable); + + if (Controllable.IsValid) + InitializeFader(controllable); } private void UnMapControllable() @@ -152,21 +154,21 @@ namespace Lib.Audio private void OnProcessManagerProcessStarted(object? sender, IObservedProcess process) { - if (Controllable?.Process == null) + if (Controllable == null) return; - if (!Controllable.Process.IsSameExecutable(process)) + if (!Controllable.ExecutablePath.Equals(process.FileName)) return; - Controllable = _controllableCollector.GetControllableForProcess(process); + Controllable = _controllableCollector.GetControllableForExecutable(Controllable.ExecutablePath); } private void OnProcessManagerProcessExited(object? sender, IObservedProcess process) { - if (Controllable?.Process == null) + if (Controllable == null) return; - if (!Controllable.Process.IsSameExecutable(process)) + if (!Controllable.ExecutablePath.Equals(process.FileName)) return; Controllable.IsValid = false; //TODO: Toggle Record button led