public async Task SetToggleAsync(bool toggleValue, byte controlNumber, IAmpProfile profile, IMidiOutputDevice device, byte channel) => await MidiDeviceLocator.SelectForOutput(device.DeviceId) .ComposeControlChange() .WithChannel(channel) .WithControlNumber(controlNumber) .WithValue(this.GetToggleValue(toggleValue, profile)) .SendAsync();
private byte GetToggleValue(bool toggleValue, IAmpProfile profile) => toggleValue ? profile.ToggleOnValue : profile.ToggleOffValue;