public TestControlsModuleFactory( IGpioConnectionDriverFactory gpioConnectionDriverFactory, IAmplifierReporter amplifierReporter, IDisposableReporter disposableReporter) : base(gpioConnectionDriverFactory, amplifierReporter, disposableReporter) { }
/// <summary>Initializes a new instance of the <see cref="ControlsModuleFactory"/> class.</summary> /// <param name="gpioConnectionDriverFactory">The gpio connection driver.</param> /// <param name="amplifierReporter">The amplifier reporter.</param> /// <param name="disposableReporter">The disposable reporter.</param> public ControlsModuleFactory( IGpioConnectionDriverFactory gpioConnectionDriverFactory, IAmplifierReporter amplifierReporter, IDisposableReporter disposableReporter) { this.gpioConnectionDriverFactory = gpioConnectionDriverFactory; this.amplifierReporter = amplifierReporter; this.controlsModule = new AsyncLazy <IControlsModule, PrivateControlModule>(() => { // Create Hardware var systemControlFactory = this.CreateSystemControlFactory(); var inputControls = this.CreateInputControls(this.gpioConnectionDriverFactory); var systemControl = systemControlFactory.Create(this.gpioConnectionDriverFactory); var amplifierFactory = this.CreateAmplifierFactory(); var amplifier = amplifierFactory.Create(this.amplifierReporter); var disposer = new Disposer( disposableReporter, systemControlFactory, amplifierFactory, inputControls.RemoteControl, inputControls.RfidTransceiver, inputControls.RotaryEncoder, inputControls.ButtonsGpioConnection); return(new PrivateControlModule(inputControls, systemControl, amplifier, disposer)); }); }
/// <summary> /// Creates the specified pin26 feature. /// </summary> /// <param name="amplifierReporter">The amplifier reporter.</param> /// <returns> /// The volume controls. /// </returns> public IAmplifier Create(IAmplifierReporter amplifierReporter) { // return new Amp(); var max9744Device = new Max9744Device( 0x4b, ConnectorPin.P1Pin07, ConnectorPin.P1Pin11, ProcessorPin.Pin02, ProcessorPin.Pin03, null, amplifierReporter); max9744Device.SetMuteState(true); max9744Device.SetShutdownState(false); var amplifier = new Max9744Amplifier(max9744Device, amplifierReporter); return(this.amplifiers.Add(amplifier, max9744Device)); }