public MetronomeForm() { this.metronome = Program.ServiceProvider.GetService(typeof(IMetronome)) as IMetronome ?? throw new ServiceNotConfiguredException(nameof(IMetronome)); this.soundEmitter = Program.ServiceProvider.GetService(typeof(ISoundEmitter)) as ISoundEmitter ?? throw new ServiceNotConfiguredException(nameof(ISoundEmitter)); this.InitializeComponent(); this.SetDataBindings(); this.metronome.Ticked += (s, e) => this.soundEmitter.Sound(); }
public void DestroyEmitter(ISoundEmitter emitter) { if (emitter is ALSoundEmitter alEmitter) { alEmitter.Dispose(); } else { throw new NotSupportedException("Emitter from another adapter was provided"); } }
public AGSSayComponent(IGameState state, IGameFactory factory, IInput input, ISayLocationProvider location, FastFingerChecker fastFingerChecker, ISayConfig sayConfig, IBlockingEvent <BeforeSayEventArgs> onBeforeSay, ISoundEmitter emitter, ISpeechCache speechCache) { _state = state; _factory = factory; _input = input; _location = location; _fastFingerChecker = fastFingerChecker; _emitter = emitter; _speechCache = speechCache; SpeechConfig = sayConfig; OnBeforeSay = onBeforeSay; }
public AGSSayBehavior(IGameState state, IGameFactory factory, IInput input, ISayLocationProvider location, FastFingerChecker fastFingerChecker, ISayConfig sayConfig, IHasOutfit outfit, IFaceDirectionBehavior faceDirection, IBlockingEvent<BeforeSayEventArgs> onBeforeSay, ISoundEmitter emitter, ISpeechCache speechCache) { _state = state; _factory = factory; _input = input; _location = location; _fastFingerChecker = fastFingerChecker; _outfit = outfit; _faceDirection = faceDirection; _emitter = emitter; _speechCache = speechCache; SpeechConfig = sayConfig; OnBeforeSay = onBeforeSay; }
public void RemoveSoundEmitter(ISoundEmitter i_SoundEmmiter) { i_SoundEmmiter.SoundActionOccurred -= soundEmitter_SoundActionOccurred; }
public void AddSoundEmitter(ISoundEmitter i_SoundEmmiter) { i_SoundEmmiter.SoundActionOccurred += soundEmitter_SoundActionOccurred; }
public AudioSystem(World world, IAudioAdapter audioAdapter) : base(world) { this.listener = audioAdapter.CreateListener(); this.globalEmitter = audioAdapter.CreateEmitter(); this.audioAdapter = audioAdapter; }