public Spectrum() { this.InitializeComponent(); this.Timer = new Timer(); this.Timer.Interval = UPDATE_INTERVAL; this.Timer.AutoReset = false; this.Timer.Elapsed += this.OnElapsed; if (Enabled != null) { Enabled.ConnectValue(value => { if (value) { this.Visibility = Visibility.Visible; this.Timer.Start(); } else { this.Visibility = Visibility.Collapsed; this.Timer.Stop(); } }); } if (Bars != null) { Bars.ConnectValue(value => this.Configure( SpectrumBehaviourConfiguration.GetBars(value), SpectrumBehaviourConfiguration.GetWidth(value) ) ); } }
protected override void CreateViewBox() { this.RendererData = Create( this.Output, this.Bitmap.PixelWidth, this.Bitmap.PixelHeight, SpectrumBehaviourConfiguration.GetBars(this.Bars.Value), VisualizationBehaviourConfiguration.GetFFTSize(this.FFTSize.Value), this.ShowPeaks.Value, this.HighCut.Value ); this.Viewbox = new Rect(0, 0, this.GetPixelWidth(), this.Bitmap.PixelHeight); }
protected virtual Task RefreshBitmap() { return(Windows.Invoke(() => { this.RendererData = Create( this.Output, this.Bitmap.PixelWidth, this.Bitmap.PixelHeight, SpectrumBehaviourConfiguration.GetBars(this.Bars.Value), VisualizationBehaviourConfiguration.GetFFTSize(this.FFTSize.Value), this.ShowPeaks.Value, this.HighCut.Value ); })); }
protected override void CreateViewBox() { this.RendererData = Create( this.Output, this.Bitmap.PixelWidth, this.Bitmap.PixelHeight, SpectrumBehaviourConfiguration.GetBars(this.Bars.Value), SpectrumBehaviourConfiguration.GetFFTSize(this.FFTSize.Value), this.HoldInterval.Value, this.UpdateInterval.Value, this.SmoothingFactor.Value, this.Amplitude.Value, this.ShowPeaks.Value, this.HighCut.Value ); this.Viewbox = new Rect(0, 0, this.GetPixelWidth(), this.Bitmap.PixelHeight); }
protected virtual Task RefreshBitmap() { return(Windows.Invoke(() => { this.RendererData = Create( this.Output, this.Bitmap.PixelWidth, this.Bitmap.PixelHeight, SpectrumBehaviourConfiguration.GetBars(this.Bars.Value), SpectrumBehaviourConfiguration.GetFFTSize(this.FFTSize.Value), this.HoldInterval.Value, this.UpdateInterval.Value, this.SmoothingFactor.Value, this.Amplitude.Value, this.ShowPeaks.Value, this.HighCut.Value ); })); }