Example #1
0
        private void PopulateDeviceList()
        {
            IEnumerable <string> deviceNames = Enumerable.Empty <string>();

            if (!OSTailoredCode.IsUnixHost)
            {
                if (rbOutputMethodDirectSound.Checked)
                {
                    deviceNames = DirectSoundSoundOutput.GetDeviceNames();
                }
                if (rbOutputMethodXAudio2.Checked)
                {
                    deviceNames = XAudio2SoundOutput.GetDeviceNames();
                }
            }
            if (rbOutputMethodOpenAL.Checked)
            {
                deviceNames = OpenALSoundOutput.GetDeviceNames();
            }

            listBoxSoundDevices.Items.Clear();
            listBoxSoundDevices.Items.Add("<default>");
            listBoxSoundDevices.SelectedIndex = 0;
            foreach (var name in deviceNames)
            {
                listBoxSoundDevices.Items.Add(name);
                if (name == _config.SoundDevice)
                {
                    listBoxSoundDevices.SelectedItem = name;
                }
            }
        }
Example #2
0
        private void PopulateDeviceList()
        {
            IEnumerable <string> deviceNames = Enumerable.Empty <string>();

#if WINDOWS
            if (rbOutputMethodDirectSound.Checked)
            {
                deviceNames = DirectSoundSoundOutput.GetDeviceNames();
            }
            if (rbOutputMethodXAudio2.Checked)
            {
                deviceNames = XAudio2SoundOutput.GetDeviceNames();
            }
#endif
            if (rbOutputMethodOpenAL.Checked)
            {
                deviceNames = OpenALSoundOutput.GetDeviceNames();
            }
            listBoxSoundDevices.Items.Clear();
            listBoxSoundDevices.Items.Add("<default>");
            listBoxSoundDevices.SelectedIndex = 0;
            foreach (var name in deviceNames)
            {
                listBoxSoundDevices.Items.Add(name);
                if (name == Global.Config.SoundDevice)
                {
                    listBoxSoundDevices.SelectedItem = name;
                }
            }
        }