|
|
|
|
@ -58,9 +58,10 @@ namespace Lib.Audio |
|
|
|
|
{ |
|
|
|
|
Controllable = controllable; |
|
|
|
|
ToggleSelectButtonLed(); |
|
|
|
|
InitializeFader(controllable); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void UnMapControllable() |
|
|
|
|
private void UnMapControllable() |
|
|
|
|
{ |
|
|
|
|
if (Controllable == null) |
|
|
|
|
return; |
|
|
|
|
@ -109,6 +110,17 @@ namespace Lib.Audio |
|
|
|
|
_acknowledgeMessage = null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void InitializeFader(IControllable controllable) |
|
|
|
|
{ |
|
|
|
|
if (Fader == null) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
float volume = controllable.GetVolume(); |
|
|
|
|
Fader.RelativePosition = volume; |
|
|
|
|
|
|
|
|
|
_midiCommunication.Send(new PitchWheelChangeMessage(0, _channelNumber, Fader.Position)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void ToggleSelectButtonLed() |
|
|
|
|
{ |
|
|
|
|
ISelectButton? selectButton = Buttons?.OfType<ISelectButton>().FirstOrDefault(); |
|
|
|
|
@ -127,5 +139,11 @@ namespace Lib.Audio |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override string ToString() => $"Channel {_channelNumber}"; |
|
|
|
|
|
|
|
|
|
public void Dispose() |
|
|
|
|
{ |
|
|
|
|
UnMapControllable(); |
|
|
|
|
_midiCommunication.Send(new PitchWheelChangeMessage(0, _channelNumber, 0)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |