Beispiel #1
0
        private HLE.Switch InitializeSwitchInstance()
        {
            HLE.Switch instance = new HLE.Switch(_renderer, _audioOut);

            instance.Initialize();

            return(instance);
        }
Beispiel #2
0
        private HLE.Switch InitializeSwitchInstance()
        {
            _virtualFileSystem.Reload();

            HLE.Switch instance = new HLE.Switch(_virtualFileSystem, _contentManager, InitializeRenderer(), InitializeAudioEngine());

            instance.Initialize();

            return(instance);
        }
Beispiel #3
0
        private void InitializeSwitchInstance()
        {
            _virtualFileSystem.Reload();

            IRenderer  renderer    = new Renderer();
            IAalOutput audioEngine = new DummyAudioOut();

            if (ConfigurationState.Instance.System.AudioBackend.Value == AudioBackend.SoundIo)
            {
                if (SoundIoAudioOut.IsSupported)
                {
                    audioEngine = new SoundIoAudioOut();
                }
                else
                {
                    Logger.Warning?.Print(LogClass.Audio, "SoundIO is not supported, falling back to dummy audio out.");
                }
            }
            else if (ConfigurationState.Instance.System.AudioBackend.Value == AudioBackend.OpenAl)
            {
                if (OpenALAudioOut.IsSupported)
                {
                    audioEngine = new OpenALAudioOut();
                }
                else
                {
                    Logger.Warning?.Print(LogClass.Audio, "OpenAL is not supported, trying to fall back to SoundIO.");

                    if (SoundIoAudioOut.IsSupported)
                    {
                        Logger.Warning?.Print(LogClass.Audio, "Found SoundIO, changing configuration.");

                        ConfigurationState.Instance.System.AudioBackend.Value = AudioBackend.SoundIo;
                        SaveConfig();

                        audioEngine = new SoundIoAudioOut();
                    }
                    else
                    {
                        Logger.Warning?.Print(LogClass.Audio, "SoundIO is not supported, falling back to dummy audio out.");
                    }
                }
            }

            _emulationContext = new HLE.Switch(_virtualFileSystem, _contentManager, _userChannelPersistence, renderer, audioEngine)
            {
                UiHandler = _uiHandler
            };

            _emulationContext.Initialize();
        }