From b8d68a5bc0c0c454d9e5ab0eb810647231c6ec78 Mon Sep 17 00:00:00 2001 From: Simon G Date: Thu, 8 Apr 2021 17:14:49 +0200 Subject: [PATCH] - fix nullable warnings --- Lib.Audio/Channel.cs | 4 ++-- Lib.Audio/Controls/Fader.cs | 2 +- Lib.Audio/Controls/Interfaces/IFader.cs | 2 +- Lib.Audio/Interfaces/IChannel.cs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Lib.Audio/Channel.cs b/Lib.Audio/Channel.cs index 712a45a..ad91bde 100644 --- a/Lib.Audio/Channel.cs +++ b/Lib.Audio/Channel.cs @@ -28,7 +28,7 @@ namespace Lib.Audio public IFader Fader { get; } public IKnob Knob { get; } public List Buttons { get; } - public IControllable Controllable { get; private set; } + public IControllable? Controllable { get; private set; } public void AllocateControllable(IControllable controllable) => Controllable = controllable; @@ -42,6 +42,6 @@ namespace Lib.Audio return buttons; } - private void OnFaderPositionChanged(object? sender, float position) => Controllable.SetVolume(position); + private void OnFaderPositionChanged(object? sender, float position) => Controllable?.SetVolume(position); } } \ No newline at end of file diff --git a/Lib.Audio/Controls/Fader.cs b/Lib.Audio/Controls/Fader.cs index cba245a..15aee42 100644 --- a/Lib.Audio/Controls/Fader.cs +++ b/Lib.Audio/Controls/Fader.cs @@ -21,6 +21,6 @@ namespace Lib.Audio.Controls } } - public event EventHandler PositionChanged; + public event EventHandler? PositionChanged; } } \ No newline at end of file diff --git a/Lib.Audio/Controls/Interfaces/IFader.cs b/Lib.Audio/Controls/Interfaces/IFader.cs index 475bb50..b14d440 100644 --- a/Lib.Audio/Controls/Interfaces/IFader.cs +++ b/Lib.Audio/Controls/Interfaces/IFader.cs @@ -10,6 +10,6 @@ namespace Lib.Audio.Controls.Interfaces { float Position { get; } //TODO: float or double? - event EventHandler PositionChanged; + event EventHandler? PositionChanged; } } \ No newline at end of file diff --git a/Lib.Audio/Interfaces/IChannel.cs b/Lib.Audio/Interfaces/IChannel.cs index 80b712a..789e8d3 100644 --- a/Lib.Audio/Interfaces/IChannel.cs +++ b/Lib.Audio/Interfaces/IChannel.cs @@ -14,7 +14,7 @@ namespace Lib.Audio.Interfaces IKnob Knob { get; } List Buttons { get; } - IControllable Controllable { get; } + IControllable? Controllable { get; } void AllocateControllable(IControllable controllable); }