Ejemplo n.º 1
0
 public override void InitializeComponent(ICore core)
 {
     base.InitializeComponent(core);
     this.Mode = this.Configuration.GetElement <SelectionConfigurationElement>(
         OscilloscopeBehaviourConfiguration.SECTION,
         OscilloscopeBehaviourConfiguration.MODE_ELEMENT
         );
     this.Duration = this.Configuration.GetElement <IntegerConfigurationElement>(
         OscilloscopeBehaviourConfiguration.SECTION,
         OscilloscopeBehaviourConfiguration.DURATION_ELEMENT
         );
     this.Smooth = this.Configuration.GetElement <BooleanConfigurationElement>(
         VisualizationBehaviourConfiguration.SECTION,
         VisualizationBehaviourConfiguration.SMOOTH_ELEMENT
         );
     this.SmoothingFactor = this.Configuration.GetElement <IntegerConfigurationElement>(
         VisualizationBehaviourConfiguration.SECTION,
         VisualizationBehaviourConfiguration.SMOOTH_FACTOR_ELEMENT
         );
     this.Configuration.GetElement <IntegerConfigurationElement>(
         VisualizationBehaviourConfiguration.SECTION,
         VisualizationBehaviourConfiguration.INTERVAL_ELEMENT
         ).ConnectValue(value => this.UpdateInterval = value);
     this.Mode.ValueChanged            += this.OnValueChanged;
     this.Duration.ValueChanged        += this.OnValueChanged;
     this.Smooth.ValueChanged          += this.OnValueChanged;
     this.SmoothingFactor.ValueChanged += this.OnValueChanged;
     var task = this.CreateBitmap();
 }
Ejemplo n.º 2
0
 public override void InitializeComponent(ICore core)
 {
     base.InitializeComponent(core);
     this.Core           = core;
     this.EnabledElement = this.Configuration.GetElement <BooleanConfigurationElement>(
         BassOutputConfiguration.SECTION,
         BassOutputTempoStreamComponentBehaviourConfiguration.ENABLED
         );
     this.TempoElement = this.Configuration.GetElement <IntegerConfigurationElement>(
         BassOutputConfiguration.SECTION,
         BassOutputTempoStreamComponentBehaviourConfiguration.TEMPO
         );
     this.PitchElement = this.Configuration.GetElement <IntegerConfigurationElement>(
         BassOutputConfiguration.SECTION,
         BassOutputTempoStreamComponentBehaviourConfiguration.PITCH
         );
     this.RateElement = this.Configuration.GetElement <IntegerConfigurationElement>(
         BassOutputConfiguration.SECTION,
         BassOutputTempoStreamComponentBehaviourConfiguration.RATE
         );
     this.EnabledElement.ValueChanged += this.OnEnabledChanged;
     this.TempoElement.ValueChanged   += this.OnValueChanged;
     this.PitchElement.ValueChanged   += this.OnPitchChanged;
     this.RateElement.ValueChanged    += this.OnRateChanged;
 }
Ejemplo n.º 3
0
 public override void InitializeComponent(ICore core)
 {
     this.Cache         = ComponentRegistry.Instance.GetComponent <WaveFormCache>();
     this.Output        = core.Components.Output;
     this.Configuration = core.Components.Configuration;
     this.Resolution    = this.Configuration.GetElement <IntegerConfigurationElement>(
         WaveBarBehaviourConfiguration.SECTION,
         WaveBarBehaviourConfiguration.RESOLUTION_ELEMENT
         );
     base.InitializeComponent(core);
 }
Ejemplo n.º 4
0
 public override void InitializeComponent(ICore core)
 {
     this.PlaylistBrowser   = core.Components.PlaylistBrowser;
     this.PlaybackManager   = core.Managers.Playback;
     this.OutputStreamQueue = core.Components.OutputStreamQueue;
     this.PlaybackManager.CurrentStreamChanged += this.OnCurrentStreamChanged;
     this.Configuration = core.Components.Configuration;
     this.Count         = this.Configuration.GetElement <IntegerConfigurationElement>(
         PlaybackBehaviourConfiguration.SECTION,
         EnqueueNextItemBehaviourConfiguration.COUNT
         );
     base.InitializeComponent(core);
 }
Ejemplo n.º 5
0
 public override void InitializeComponent(ICore core)
 {
     this.Configuration = core.Components.Configuration;
     this.Mode          = this.Configuration.GetElement <SelectionConfigurationElement>(
         OscilloscopeBehaviourConfiguration.SECTION,
         OscilloscopeBehaviourConfiguration.MODE_ELEMENT
         );
     this.Duration = this.Configuration.GetElement <IntegerConfigurationElement>(
         OscilloscopeBehaviourConfiguration.SECTION,
         OscilloscopeBehaviourConfiguration.DURATION_ELEMENT
         );
     base.InitializeComponent(core);
 }
Ejemplo n.º 6
0
 public override void InitializeComponent(ICore core)
 {
     this.SignalEmitter         = core.Components.SignalEmitter;
     this.SignalEmitter.Signal += this.OnSignal;
     this.Configuration         = core.Components.Configuration;
     this.ImageMode             = this.Configuration.GetElement <SelectionConfigurationElement>(
         WindowsUserInterfaceConfiguration.SECTION,
         LibraryBrowserBehaviourConfiguration.LIBRARY_BROWSER_TILE_IMAGE
         );
     this.TileSize = this.Configuration.GetElement <IntegerConfigurationElement>(
         WindowsUserInterfaceConfiguration.SECTION,
         LibraryBrowserBehaviourConfiguration.LIBRARY_BROWSER_TILE_SIZE
         );
     this.ImageMode.ValueChanged += this.OnValueChanged;
     this.TileSize.ValueChanged  += this.OnValueChanged;
 }
Ejemplo n.º 7
0
 public override void InitializeComponent(ICore core)
 {
     if (core.Components.Output != null)
     {
         core.Components.Output.IsStartedChanged += (sender, e) =>
         {
             if (this.Queue.Count > 0)
             {
                 Logger.Write(this, LogLevel.Warn, "Output state changed, disposing queued output streams.");
                 this.Clear();
             }
         };
     }
     this.Configuration = core.Components.Configuration;
     this.Count         = this.Configuration.GetElement <IntegerConfigurationElement>(
         PlaybackBehaviourConfiguration.SECTION,
         EnqueueNextItemBehaviourConfiguration.COUNT
         );
     base.InitializeComponent(core);
 }
Ejemplo n.º 8
0
 public override void InitializeComponent(ICore core)
 {
     this.Core            = core;
     this.PlaylistManager = core.Managers.Playlist;
     this.Configuration   = core.Components.Configuration;
     this.Destination     = this.Configuration.GetElement <SelectionConfigurationElement>(
         BassEncoderBehaviourConfiguration.SECTION,
         BassEncoderBehaviourConfiguration.DESTINATION_ELEMENT
         );
     this.Location = this.Configuration.GetElement <TextConfigurationElement>(
         BassEncoderBehaviourConfiguration.SECTION,
         BassEncoderBehaviourConfiguration.DESTINATION_LOCATION_ELEMENT
         );
     this.CopyTags = this.Configuration.GetElement <BooleanConfigurationElement>(
         BassEncoderBehaviourConfiguration.SECTION,
         BassEncoderBehaviourConfiguration.COPY_TAGS
         );
     this.Threads = this.Configuration.GetElement <IntegerConfigurationElement>(
         BassEncoderBehaviourConfiguration.SECTION,
         BassEncoderBehaviourConfiguration.THREADS_ELEMENT
         );
     base.InitializeComponent(core);
 }
Ejemplo n.º 9
0
        public override void InitializeComponent(ICore core)
        {
            base.InitializeComponent(core);
            PlaybackStateNotifier.Notify += this.OnNotify;
            this.Output = core.Components.Output;
            this.Bars   = this.Configuration.GetElement <SelectionConfigurationElement>(
                SpectrumBehaviourConfiguration.SECTION,
                SpectrumBehaviourConfiguration.BARS_ELEMENT
                );
            this.ShowPeaks = this.Configuration.GetElement <BooleanConfigurationElement>(
                SpectrumBehaviourConfiguration.SECTION,
                SpectrumBehaviourConfiguration.PEAKS_ELEMENT
                );
            this.HighCut = this.Configuration.GetElement <BooleanConfigurationElement>(
                SpectrumBehaviourConfiguration.SECTION,
                SpectrumBehaviourConfiguration.HIGH_CUT_ELEMENT
                );
            this.Smooth = this.Configuration.GetElement <BooleanConfigurationElement>(
                SpectrumBehaviourConfiguration.SECTION,
                SpectrumBehaviourConfiguration.SMOOTH_ELEMENT
                );
            this.SmoothingFactor = this.Configuration.GetElement <IntegerConfigurationElement>(
                SpectrumBehaviourConfiguration.SECTION,
                SpectrumBehaviourConfiguration.SMOOTH_FACTOR_ELEMENT
                );
            this.HoldInterval = this.Configuration.GetElement <IntegerConfigurationElement>(
                SpectrumBehaviourConfiguration.SECTION,
                SpectrumBehaviourConfiguration.HOLD_ELEMENT
                );
            this.UpdateInterval = this.Configuration.GetElement <IntegerConfigurationElement>(
                SpectrumBehaviourConfiguration.SECTION,
                SpectrumBehaviourConfiguration.INTERVAL_ELEMENT
                );
            this.FFTSize = this.Configuration.GetElement <SelectionConfigurationElement>(
                SpectrumBehaviourConfiguration.SECTION,
                SpectrumBehaviourConfiguration.FFT_SIZE_ELEMENT
                );
            this.Amplitude = this.Configuration.GetElement <IntegerConfigurationElement>(
                SpectrumBehaviourConfiguration.SECTION,
                SpectrumBehaviourConfiguration.AMPLITUDE_ELEMENT
                );
            this.ScalingFactor.ValueChanged   += this.OnValueChanged;
            this.Bars.ValueChanged            += this.OnValueChanged;
            this.ShowPeaks.ValueChanged       += this.OnValueChanged;
            this.HighCut.ValueChanged         += this.OnValueChanged;
            this.Smooth.ValueChanged          += this.OnValueChanged;
            this.SmoothingFactor.ValueChanged += this.OnValueChanged;
            this.HoldInterval.ValueChanged    += this.OnValueChanged;
            this.UpdateInterval.ValueChanged  += this.OnValueChanged;
            this.FFTSize.ValueChanged         += this.OnValueChanged;
            this.Amplitude.ValueChanged       += this.OnValueChanged;
#if NET40
            var task = TaskEx.Run(async() =>
#else
            var task = Task.Run(async() =>
#endif
            {
                await this.CreateBitmap().ConfigureAwait(false);
                if (PlaybackStateNotifier.IsPlaying)
                {
                    this.Start();
                }
            });
        }