- fader is initialized by xmlFader

- add more information
master
Simon G 5 years ago
parent 5352ce4b12
commit 629be75e44
  1. 3
      Lib.Audio/Controls/Factories/IFaderFactory.cs
  2. 13
      Lib.Audio/Controls/Fader.cs
  3. 5
      Lib.Audio/Controls/Interfaces/IFader.cs

@ -3,11 +3,12 @@
// Copyright(c) 2021 SimonG. All Rights Reserved.
using Lib.Audio.Controls.Interfaces;
using Lib.Driver.Xml;
namespace Lib.Audio.Controls.Factories
{
public interface IFaderFactory
{
IFader Create();
IFader Create(XmlFader xmlFader);
}
}

@ -4,23 +4,30 @@
using System;
using Lib.Audio.Controls.Interfaces;
using Lib.Driver.Xml;
namespace Lib.Audio.Controls
{
public class Fader : IFader
{
private float _position;
private int _position;
public float Position
public Fader(XmlFader xmlFader) => NoteNumber = xmlFader.NoteNumber;
public int NoteNumber { get; }
public int Position
{
get => _position;
private set
set
{
_position = value;
PositionChanged?.Invoke(this, _position);
}
}
public bool IsTouched { get; set; }
public event EventHandler<float>? PositionChanged;
}
}

@ -8,7 +8,10 @@ namespace Lib.Audio.Controls.Interfaces
{
public interface IFader
{
float Position { get; } //TODO: float or double?
int NoteNumber { get; }
int Position { get; set; }
bool IsTouched { get; set; }
event EventHandler<float>? PositionChanged;
}

Loading…
Cancel
Save