예제 #1
0
 public override void InitializeComponent(ICore core)
 {
     this.Core          = core;
     this.Output        = core.Components.Output as IBassOutput;
     this.Output.Init  += this.OnInit;
     this.Output.Free  += this.OnFree;
     this.Configuration = core.Components.Configuration;
     this.Configuration.GetElement <SelectionConfigurationElement>(
         BassOutputConfiguration.SECTION,
         BassOutputConfiguration.OUTPUT_ELEMENT
         ).ConnectValue(value => this.Enabled = string.Equals(value.Id, BassWasapiStreamOutputConfiguration.OUTPUT_WASAPI_OPTION, StringComparison.OrdinalIgnoreCase));
     this.Configuration.GetElement <SelectionConfigurationElement>(
         BassOutputConfiguration.SECTION,
         BassWasapiStreamOutputConfiguration.ELEMENT_WASAPI_DEVICE
         ).ConnectValue(value => this.WasapiDevice = BassWasapiStreamOutputConfiguration.GetWasapiDevice(value));
     this.Configuration.GetElement <BooleanConfigurationElement>(
         BassOutputConfiguration.SECTION,
         BassWasapiStreamOutputConfiguration.ELEMENT_WASAPI_EXCLUSIVE
         ).ConnectValue(value => this.Exclusive = value);
     this.Configuration.GetElement <BooleanConfigurationElement>(
         BassOutputConfiguration.SECTION,
         BassWasapiStreamOutputConfiguration.ELEMENT_WASAPI_EVENT
         ).ConnectValue(value => this.EventDriven = value);
     this.Configuration.GetElement <BooleanConfigurationElement>(
         BassOutputConfiguration.SECTION,
         BassWasapiStreamOutputConfiguration.ELEMENT_WASAPI_ASYNC
         ).ConnectValue(value => this.Async = value);
     this.Configuration.GetElement <BooleanConfigurationElement>(
         BassOutputConfiguration.SECTION,
         BassWasapiStreamOutputConfiguration.ELEMENT_WASAPI_DITHER
         ).ConnectValue(value => this.Dither = value);
     this.Configuration.GetElement <BooleanConfigurationElement>(
         BassOutputConfiguration.SECTION,
         BassWasapiStreamOutputConfiguration.MIXER_ELEMENT
         ).ConnectValue(value => this.Mixer = value);
     this.Configuration.GetElement <BooleanConfigurationElement>(
         BassOutputConfiguration.SECTION,
         BassWasapiStreamOutputConfiguration.DOUBLE_BUFFER_ELEMENT
         ).ConnectValue(value => this.DoubleBuffer = value);
     this.Configuration.GetElement <DoubleConfigurationElement>(
         BassOutputConfiguration.SECTION,
         BassWasapiStreamOutputConfiguration.BUFFER_LENGTH_ELEMENT
         ).ConnectValue(value => this.BufferLength = Convert.ToSingle(value));
     this.Configuration.GetElement <BooleanConfigurationElement>(
         BassOutputConfiguration.SECTION,
         BassWasapiStreamOutputConfiguration.ELEMENT_WASAPI_RAW
         ).ConnectValue(value => this.Raw = value);
     this.BassStreamPipelineFactory       = ComponentRegistry.Instance.GetComponent <IBassStreamPipelineFactory>();
     if (this.BassStreamPipelineFactory != null)
     {
         this.BassStreamPipelineFactory.QueryingPipeline += this.OnQueryingPipeline;
         this.BassStreamPipelineFactory.CreatingPipeline += this.OnCreatingPipeline;
     }
     base.InitializeComponent(core);
 }
 public IEnumerable <ConfigurationSection> GetConfigurationSections()
 {
     return(BassWasapiStreamOutputConfiguration.GetConfigurationSections());
 }