public override void InitializeComponent(ICore core) { this.Configuration = core.Components.Configuration; this.Bars = this.Configuration.GetElement <SelectionConfigurationElement>( SpectrumBehaviourConfiguration.SECTION, SpectrumBehaviourConfiguration.BARS_ELEMENT ); base.InitializeComponent(core); }
public override void InitializeComponent(ICore core) { this.Configuration = core.Components.Configuration; this.Order = this.Configuration.GetElement <SelectionConfigurationElement>( PlaylistBehaviourConfiguration.SECTION, PlaylistBehaviourConfiguration.ORDER_ELEMENT ); base.InitializeComponent(core); }
public override void InitializeComponent(ICore core) { this.Configuration = core.Components.Configuration; this.Orientation = this.Configuration.GetElement <SelectionConfigurationElement>( PeakMeterBehaviourConfiguration.SECTION, PeakMeterBehaviourConfiguration.ORIENTATION ); base.InitializeComponent(core); }
public override void InitializeComponent(ICore core) { this.Configuration = core.Components.Configuration; this.Mode = this.Configuration.GetElement <SelectionConfigurationElement>( WaveBarBehaviourConfiguration.SECTION, WaveBarBehaviourConfiguration.MODE_ELEMENT ); base.InitializeComponent(core); }
public override void InitializeComponent(ICore core) { this.MetaDataManager = core.Managers.MetaData; this.Configuration = core.Components.Configuration; this.Write = this.Configuration.GetElement <SelectionConfigurationElement>( MetaDataBehaviourConfiguration.SECTION, MetaDataBehaviourConfiguration.WRITE_ELEMENT ); base.InitializeComponent(core); }
public override void InitializeComponent(ICore core) { this.Configuration = core.Components.Configuration; this.Layout = this.Configuration.GetElement <SelectionConfigurationElement>( WindowsUserInterfaceConfiguration.SECTION, WindowsUserInterfaceConfiguration.LAYOUT_ELEMENT ); this.Layout.ConnectValue(value => this.UpdateProvider()); base.InitializeComponent(core); }
public override void InitializeComponent(ICore core) { this.Core = core; this.Configuration = core.Components.Configuration; this.Format = this.Configuration.GetElement <SelectionConfigurationElement>( BassEncoderBehaviourConfiguration.SECTION, BassEncoderBehaviourConfiguration.FORMAT_ELEMENT ); base.InitializeComponent(core); }
public override void InitializeComponent(ICore core) { this.FileFactory = ComponentRegistry.Instance.GetComponent <TagLibFileFactory>(); this.Configuration = core.Components.Configuration; this.EmbeddedImages = this.Configuration.GetElement <BooleanConfigurationElement>( MetaDataBehaviourConfiguration.SECTION, MetaDataBehaviourConfiguration.READ_EMBEDDED_IMAGES ); this.LooseImages = this.Configuration.GetElement <BooleanConfigurationElement>( MetaDataBehaviourConfiguration.SECTION, MetaDataBehaviourConfiguration.READ_LOOSE_IMAGES ); this.ImagesPreference = this.Configuration.GetElement <SelectionConfigurationElement>( MetaDataBehaviourConfiguration.SECTION, MetaDataBehaviourConfiguration.IMAGES_PREFERENCE ); this.CopyImages = this.Configuration.GetElement <BooleanConfigurationElement>( MetaDataBehaviourConfiguration.SECTION, MetaDataBehaviourConfiguration.COPY_IMAGES_ELEMENT ); this.MaxImageSize = this.Configuration.GetElement <IntegerConfigurationElement>( MetaDataBehaviourConfiguration.SECTION, MetaDataBehaviourConfiguration.MAX_IMAGE_SIZE ); this.Extended = this.Configuration.GetElement <BooleanConfigurationElement>( MetaDataBehaviourConfiguration.SECTION, MetaDataBehaviourConfiguration.READ_EXTENDED_TAGS ); this.MusicBrainz = this.Configuration.GetElement <BooleanConfigurationElement>( MetaDataBehaviourConfiguration.SECTION, MetaDataBehaviourConfiguration.READ_MUSICBRAINZ_TAGS ); this.Lyrics = this.Configuration.GetElement <BooleanConfigurationElement>( MetaDataBehaviourConfiguration.SECTION, MetaDataBehaviourConfiguration.READ_LYRICS_TAGS ); this.ReplayGain = this.Configuration.GetElement <BooleanConfigurationElement>( MetaDataBehaviourConfiguration.SECTION, MetaDataBehaviourConfiguration.READ_REPLAY_GAIN_TAGS ); this.Popularimeter = this.Configuration.GetElement <BooleanConfigurationElement>( MetaDataBehaviourConfiguration.SECTION, MetaDataBehaviourConfiguration.READ_POPULARIMETER_TAGS ); this.Documents = this.Configuration.GetElement <BooleanConfigurationElement>( MetaDataBehaviourConfiguration.SECTION, MetaDataBehaviourConfiguration.READ_DOCUMENTS ); this.Write = this.Configuration.GetElement <SelectionConfigurationElement>( MetaDataBehaviourConfiguration.SECTION, MetaDataBehaviourConfiguration.WRITE_ELEMENT ); base.InitializeComponent(core); }
public override void InitializeComponent(ICore core) { this.Output = core.Components.Output; this.Database = core.Factories.Database.Create(); this.MetaDataSourceFactory = core.Factories.MetaDataSource; this.Configuration = core.Components.Configuration; this.Write = this.Configuration.GetElement <SelectionConfigurationElement>( MetaDataBehaviourConfiguration.SECTION, MetaDataBehaviourConfiguration.WRITE_ELEMENT ); base.InitializeComponent(core); }
static Spectrum() { var configuration = ComponentRegistry.Instance.GetComponent <IConfiguration>(); if (configuration == null) { return; } BarCount = configuration.GetElement <SelectionConfigurationElement>( SpectrumBehaviourConfiguration.SECTION, SpectrumBehaviourConfiguration.BARS_ELEMENT ); }
public override void InitializeComponent(Interfaces.ICore core) { this.Behaviour = ComponentRegistry.Instance.GetComponent <LyricsBehaviour>(); this.Configuration = core.Components.Configuration; this.AutoLookup = this.Configuration.GetElement <BooleanConfigurationElement>( LyricsBehaviourConfiguration.SECTION, LyricsBehaviourConfiguration.AUTO_LOOKUP ); this.AutoLookupProvider = this.Configuration.GetElement <SelectionConfigurationElement>( LyricsBehaviourConfiguration.SECTION, LyricsBehaviourConfiguration.AUTO_LOOKUP_PROVIDER ); base.InitializeComponent(core); }
public override void InitializeComponent(ICore core) { base.InitializeComponent(core); this.Bands = this.Configuration.GetElement <SelectionConfigurationElement>( SpectrumBehaviourConfiguration.SECTION, SpectrumBehaviourConfiguration.BANDS_ELEMENT ); this.ShowPeaks = this.Configuration.GetElement <BooleanConfigurationElement>( SpectrumBehaviourConfiguration.SECTION, SpectrumBehaviourConfiguration.PEAKS_ELEMENT ); this.ShowRms = this.Configuration.GetElement <BooleanConfigurationElement>( SpectrumBehaviourConfiguration.SECTION, SpectrumBehaviourConfiguration.RMS_ELEMENT ); this.ShowCrestFactor = this.Configuration.GetElement <BooleanConfigurationElement>( SpectrumBehaviourConfiguration.SECTION, SpectrumBehaviourConfiguration.CREST_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.HoldInterval = this.Configuration.GetElement <IntegerConfigurationElement>( SpectrumBehaviourConfiguration.SECTION, SpectrumBehaviourConfiguration.HOLD_ELEMENT ); this.Configuration.GetElement <IntegerConfigurationElement>( VisualizationBehaviourConfiguration.SECTION, VisualizationBehaviourConfiguration.INTERVAL_ELEMENT ).ConnectValue(value => this.UpdateInterval = value); this.FFTSize = this.Configuration.GetElement <SelectionConfigurationElement>( VisualizationBehaviourConfiguration.SECTION, VisualizationBehaviourConfiguration.FFT_SIZE_ELEMENT ); this.Bands.ValueChanged += this.OnValueChanged; this.ShowPeaks.ValueChanged += this.OnValueChanged; this.ShowRms.ValueChanged += this.OnValueChanged; this.ShowCrestFactor.ValueChanged += this.OnValueChanged; this.Smooth.ValueChanged += this.OnValueChanged; this.SmoothingFactor.ValueChanged += this.OnValueChanged; this.HoldInterval.ValueChanged += this.OnValueChanged; this.FFTSize.ValueChanged += this.OnValueChanged; var task = this.CreateBitmap(); }
public static EventHandler Loader(SelectionConfigurationElement presetElement, TextConfigurationElement layoutElement, IEnumerable <Preset> presets) { return((sender, e) => { var preset = presets.FirstOrDefault( _preset => string.Equals(_preset.Id, presetElement.Value.Id, StringComparison.OrdinalIgnoreCase) ); if (preset == null) { //The slected preset was not found. return; } layoutElement.Value = preset.Layout; }); }
public override void InitializeComponent(ICore core) { this.MetaDataManager = core.Managers.MetaData; this.Enabled = core.Components.Configuration.GetElement <BooleanConfigurationElement>( MetaDataBehaviourConfiguration.SECTION, MetaDataBehaviourConfiguration.BACKGROUND_WRITE_ELEMENT ); this.Write = core.Components.Configuration.GetElement <SelectionConfigurationElement>( MetaDataBehaviourConfiguration.SECTION, MetaDataBehaviourConfiguration.WRITE_ELEMENT ); this.Enabled.ValueChanged += this.OnValueChanged; this.Write.ValueChanged += this.OnValueChanged; this.Refresh(); base.InitializeComponent(core); }
static Spectrum() { var configuration = ComponentRegistry.Instance.GetComponent <IConfiguration>(); if (configuration == null) { return; } Enabled = configuration.GetElement <BooleanConfigurationElement>( SpectrumBehaviourConfiguration.SECTION, SpectrumBehaviourConfiguration.ENABLED_ELEMENT ); Bars = configuration.GetElement <SelectionConfigurationElement>( SpectrumBehaviourConfiguration.SECTION, SpectrumBehaviourConfiguration.BARS_ELEMENT ); }
public override void InitializeComponent(ICore core) { this.StatisticsManager = ComponentRegistry.Instance.GetComponent <StatisticsManager>(); this.PlaybackManager = core.Managers.Playback; this.Configuration = core.Components.Configuration; this.Enabled = this.Configuration.GetElement <BooleanConfigurationElement>( PlaybackBehaviourConfiguration.SECTION, PlaybackStatisticsBehaviourConfiguration.ENABLED ); this.Enabled.ValueChanged += this.OnValueChanged; this.Write = this.Configuration.GetElement <SelectionConfigurationElement>( MetaDataBehaviourConfiguration.SECTION, MetaDataBehaviourConfiguration.WRITE_ELEMENT ); this.Refresh(); base.InitializeComponent(core); }
protected virtual void OnUpdate(SelectionConfigurationElement element) { foreach (var option in element.Options.ToArray()) { if (this.Contains(option.Id)) { this.Update(option); } else { this.Add(option); } if (this.Value != null && string.Equals(this.Value.Id, option.Id, StringComparison.OrdinalIgnoreCase)) { this.Value.Update(option); } } if (this.DefaultValue != null) { var value = element.GetOption(this.DefaultValue.Id); if (value != null) { this.DefaultValue.Update(value); } } if (this.Value == null) { if (element.Value != null) { this.Value = element.Value; } else { this.Value = this.Options.FirstOrDefault(option => option.IsDefault); } } }
public override void InitializeComponent(ICore core) { this.PlaybackManager = core.Managers.Playback; this.MetaDataManager = core.Managers.MetaData; this.Configuration = core.Components.Configuration; this.Enabled = this.Configuration.GetElement <BooleanConfigurationElement>( MetaDataBehaviourConfiguration.SECTION, MetaDataBehaviourConfiguration.READ_LYRICS_TAGS ); this.AutoScroll = this.Configuration.GetElement <BooleanConfigurationElement>( LyricsBehaviourConfiguration.SECTION, LyricsBehaviourConfiguration.AUTO_SCROLL ); this.AutoLookup = this.Configuration.GetElement <BooleanConfigurationElement>( LyricsBehaviourConfiguration.SECTION, LyricsBehaviourConfiguration.AUTO_LOOKUP ); this.AutoLookup.ConnectValue(value => { if (value) { Logger.Write(this, LogLevel.Debug, "Enabling auto lookup."); this.PlaybackManager.CurrentStreamChanged += this.OnCurrentStreamChanged; } else { Logger.Write(this, LogLevel.Debug, "Disabling auto lookup."); this.PlaybackManager.CurrentStreamChanged -= this.OnCurrentStreamChanged; } }); this.AutoLookupProvider = this.Configuration.GetElement <SelectionConfigurationElement>( LyricsBehaviourConfiguration.SECTION, LyricsBehaviourConfiguration.AUTO_LOOKUP_PROVIDER ); base.InitializeComponent(core); }
protected virtual void Update(SelectionConfigurationElement element) { this.WithOptions(element.Options); }