示例#1
0
        public override void Initialize(GameContext context)
        {
            base.Initialize(context);

            audioHandler = ServiceLocator.Get<IAudioHandler>();
            soundTimer = new GameTimer(TimeSpan.FromMilliseconds(500));
        }
示例#2
0
 public NoiseDetectorViewModel(INoiseDetectorOptions options, IAudioHandler audio, IEventAggregator eventAggregator)
 {
     _noiseDetectorOptions = options;
     _audio = audio;
     _audio.AudioEventAvailable += OnAudioEventAvailable;
     _eventAggregator            = eventAggregator;
     _eventAggregator.GetEvent <NoiseDetectorChangeEvent>().Subscribe(OnStopRequested);
 }
示例#3
0
 public void OnDestroy()
 {
     _handler?.Dispose();
     _handler = null;
     if (_instance == this)
     {
         _instance = null;
     }
 }
 public SNESSystem(ICPU cpu, IRenderer renderer, IROM rom, IPPU ppu, IAPU apu, IAudioHandler audioHandler)
 {
     CPU          = cpu;
     Renderer     = renderer;
     AudioHandler = audioHandler;
     ROM          = rom;
     rom?.SetSystem(this);
     PPU = ppu;
     PPU?.SetSystem(this);
     APU = apu;
     CPU?.SetSystem(this);
 }
示例#5
0
        public override void Initialize(GameContext context)
        {
            base.Initialize(context);

            gui = new GuiManager(Context.Input, Context.Graphics.Device, Context.Graphics.SpriteBatch);

            InitializeInput();

            audioHandler = ServiceLocator.Get<IAudioHandler>();

            context.Input.Mouse.ShowCursor = true;
            context.Input.Mouse.AutoCenter = false;
        }
        public GameplayGameState(IGameCustomizationHandler Handler, FieldInitializer pFieldInitializer, IAudioHandler pAudio, MenuState MainMenu)
        {
            Sounds        = pAudio;
            GameHandler   = Handler;
            MainMenuState = MainMenu;

            PlayField = new TetrisField(Handler.DefaultTheme, Handler);
            //PlayField.Settings = Settings;
            PlayField.OnThemeChangeEvent += PlayField_OnThemeChangeEvent;
            if (pFieldInitializer != null)
            {
                pFieldInitializer.Initialize(PlayField);
            }
            PlayField.BlockGroupSet += PlayField_BlockGroupSet;
            PlayField.SetStandardHotLines();
        }
示例#7
0
        void InitializeHandler()
        {
            switch (source)
            {
            case AudioInputSource.CSCore:
                _handler = new CSCoreHandler();
                break;

            case AudioInputSource.Unity:
                print("Lmao not yet.");
                //FIXME: make this shit work lol
                break;
            }

            //setup the audio handler
            _handler.Initialize(size);


            print("Audio Handler Initialized.");
            print("Using type: " + source.ToString() + " with FFT size of: " + (int)size);
        }
示例#8
0
 protected virtual void Awake()
 {
     _diedHandler          = GetComponent <DiedHandler>();
     _enemyAnimatorHandler = GetComponent <AttackedAnimatorHandler>();
     _audioPlayer          = GetComponent <IAudioHandler>();
 }
示例#9
0
 static NetworkHandler()
 {
     socketService = DependencyService.Get <ISockets>();
     audioHandler  = DependencyService.Get <IAudioHandler>(); //new Audio.AudioHandler();
 }
 public void UnSubscribe(IAudioHandler item)
 {
     handlers.Remove(item);
 }
 public void Subscribe(IAudioHandler item)
 {
     handlers.Add(item);
 }