コード例 #1
0
ファイル: Spectrum.xaml.cs プロジェクト: hainam2101/FoxTunes
 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)
                               )
                           );
     }
 }
コード例 #2
0
 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);
 }
コード例 #3
0
 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
             );
     }));
 }
コード例 #4
0
 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);
 }
コード例 #5
0
 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
             );
     }));
 }