Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
 public void DestroyEmitter(ISoundEmitter emitter)
 {
     if (emitter is ALSoundEmitter alEmitter)
     {
         alEmitter.Dispose();
     }
     else
     {
         throw new NotSupportedException("Emitter from another adapter was provided");
     }
 }
Ejemplo n.º 3
0
 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;
 }
Ejemplo n.º 4
0
		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;
		}
Ejemplo n.º 5
0
 public void RemoveSoundEmitter(ISoundEmitter i_SoundEmmiter)
 {
     i_SoundEmmiter.SoundActionOccurred -= soundEmitter_SoundActionOccurred;
 }
Ejemplo n.º 6
0
 public void AddSoundEmitter(ISoundEmitter i_SoundEmmiter)
 {
     i_SoundEmmiter.SoundActionOccurred += soundEmitter_SoundActionOccurred;
 }
Ejemplo n.º 7
0
 public AudioSystem(World world, IAudioAdapter audioAdapter) : base(world)
 {
     this.listener      = audioAdapter.CreateListener();
     this.globalEmitter = audioAdapter.CreateEmitter();
     this.audioAdapter  = audioAdapter;
 }