- initialize fader for newly found process

master
Simon G 5 years ago
parent ddd68e7377
commit 971922272e
  1. 10
      Lib.Audio/Channel.cs

@ -72,7 +72,7 @@ namespace Lib.Audio
ToggleSelectButtonLed();
if (Controllable.IsValid)
InitializeFader(controllable);
InitializeFader();
}
private void UnMapControllable()
@ -124,12 +124,12 @@ namespace Lib.Audio
_acknowledgeMessage = null;
}
private void InitializeFader(IControllable controllable)
private void InitializeFader()
{
if (Fader == null)
if (Fader == null || Controllable == null)
return;
float volume = controllable.GetVolume();
float volume = Controllable.GetVolume();
Fader.RelativePosition = volume;
_midiCommunication.Send(new PitchWheelChangeMessage(0, _channelNumber, Fader.Position));
@ -161,6 +161,8 @@ namespace Lib.Audio
return;
Controllable = _controllableCollector.GetControllableForExecutable(Controllable.ExecutablePath);
if (Controllable != null)
InitializeFader();
}
private void OnProcessManagerProcessExited(object? sender, IObservedProcess process)

Loading…
Cancel
Save