From 42c7ac457ace872180f804429daa14c446dfedf0 Mon Sep 17 00:00:00 2001 From: Simon G Date: Thu, 8 Apr 2021 14:56:46 +0200 Subject: [PATCH] - start implementing fader --- Lib.Audio/Controls/Fader.cs | 15 ++++++++++++++- Lib.Audio/Controls/Interfaces/IFader.cs | 6 +++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Lib.Audio/Controls/Fader.cs b/Lib.Audio/Controls/Fader.cs index b9ea12f..cba245a 100644 --- a/Lib.Audio/Controls/Fader.cs +++ b/Lib.Audio/Controls/Fader.cs @@ -2,12 +2,25 @@ // Created: 2021-04-07 // Copyright(c) 2021 SimonG. All Rights Reserved. +using System; using Lib.Audio.Controls.Interfaces; namespace Lib.Audio.Controls { public class Fader : IFader { - + private float _position; + + public float Position + { + get => _position; + private set + { + _position = value; + PositionChanged?.Invoke(this, _position); + } + } + + 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 1741180..475bb50 100644 --- a/Lib.Audio/Controls/Interfaces/IFader.cs +++ b/Lib.Audio/Controls/Interfaces/IFader.cs @@ -2,10 +2,14 @@ // Created: 2021-04-07 // Copyright(c) 2021 SimonG. All Rights Reserved. +using System; + namespace Lib.Audio.Controls.Interfaces { public interface IFader { - + float Position { get; } //TODO: float or double? + + event EventHandler PositionChanged; } } \ No newline at end of file