/// <summary> /// Initializes a new instance of the <see cref="VolumeModule" /> class. /// </summary> /// <param name="amplifier">The amplifier.</param> /// <param name="volumeControl">The volume control.</param> /// <param name="audioOutputStatusUpdater">The audio output status updater.</param> /// <param name="volumeRepository">The volume repository.</param> /// <param name="volumeIncrementStep">The volume increment step.</param> /// <param name="volumeServiceReporter">The volume service reporter.</param> public VolumeModule( IAmplifier amplifier, IVolumeControl volumeControl, IAudioOutputStatusUpdater audioOutputStatusUpdater, IVolumeRepository volumeRepository, Percentage volumeIncrementStep, IVolumeServiceReporter volumeServiceReporter) { this.VolumeService = new VolumeService( amplifier, volumeControl, audioOutputStatusUpdater, volumeRepository, new VolumeAdjuster(volumeIncrementStep), volumeServiceReporter); }
/// <summary> /// Initializes a new instance of the <see cref="VolumeService" /> class. /// </summary> /// <param name="amplifier">The amplifier.</param> /// <param name="volumeControl">The volume control.</param> /// <param name="audioOutputStatusUpdater">The player status.</param> /// <param name="volumeRepository">The volume repository.</param> /// <param name="volumeAdjuster">The volume adjuster.</param> /// <param name="volumeServiceReporter">The volume controller reporter.</param> public VolumeService( IAmplifier amplifier, IVolumeControl volumeControl, IAudioOutputStatusUpdater audioOutputStatusUpdater, IVolumeRepository volumeRepository, VolumeAdjuster volumeAdjuster, IVolumeServiceReporter?volumeServiceReporter) { this.volumeAdjuster = volumeAdjuster; this.amplifier = amplifier; this.volumeControl = volumeControl; this.audioOutputStatusUpdater = audioOutputStatusUpdater; this.volumeRepository = volumeRepository; this.volumeServiceReporter = volumeServiceReporter; this.volumeServiceReporter?.SetSource(this); this.audioOutputStatusUpdater.AudioOutputStatusChanged += this.OnAudioOutputStatusUpdaterStatusChanged; }