From 2386340f2a3bb0890cf900f187c20e42a1b03caf Mon Sep 17 00:00:00 2001 From: Dmitry Khrustalev Date: Mon, 31 Aug 2020 15:25:43 -0300 Subject: [PATCH] Extract interface from Channel class #2 --- CarefulAudioRepair/Data/Channel.cs | 2 +- CarefulAudioRepair/Data/IChannel.cs | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 CarefulAudioRepair/Data/IChannel.cs diff --git a/CarefulAudioRepair/Data/Channel.cs b/CarefulAudioRepair/Data/Channel.cs index d0bc981..85ae30e 100644 --- a/CarefulAudioRepair/Data/Channel.cs +++ b/CarefulAudioRepair/Data/Channel.cs @@ -13,7 +13,7 @@ namespace CarefulAudioRepair.Data /// /// Represents audio samples for one channel. /// - internal class Channel : IDisposable + internal class Channel : IDisposable, IChannel { private ScannerTools scannerTools; diff --git a/CarefulAudioRepair/Data/IChannel.cs b/CarefulAudioRepair/Data/IChannel.cs new file mode 100644 index 0000000..df6bbb3 --- /dev/null +++ b/CarefulAudioRepair/Data/IChannel.cs @@ -0,0 +1,24 @@ +// +// Copyright (c) Dmitrii Khrustalev. All rights reserved. +// + +using System; +using System.Threading.Tasks; + +namespace CarefulAudioRepair.Data +{ + internal interface IChannel + { + bool IsPreprocessed { get; } + int LengthSamples { get; } + int NumberOfPatches { get; } + + void Dispose(); + Patch[] GetAllPatches(); + double[] GetInputRange(int start, int length); + double GetInputSample(int position); + double GetOutputSample(int position); + double GetPredictionErr(int position); + Task ScanAsync(IProgress status, IProgress progress); + } +} \ No newline at end of file