<commit_before>﻿//Copyright (c) 2007-2016 ppy Pty Ltd <<EMAIL>>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE

namespace osu.Game.Overlays.Options.Sections.Audio
{
    public class AudioDevicesOptions : OptionsSubsection
    {
        protected override string Header => "Devices";

        public AudioDevicesOptions()
        {
            Children = new[]
            {
                new OptionLabel { Text = "Output device: TODO dropdown" }
            };
        }
    }
}<commit_msg>Allow audio device selection in settings<commit_after>﻿//Copyright (c) 2007-2016 ppy Pty Ltd <<EMAIL>>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE

using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Graphics;
using System.Collections.Generic;
using System.Linq;

namespace osu.Game.Overlays.Options.Sections.Audio
{
    public class AudioDevicesOptions : OptionsSubsection
    {
        protected override string Header => "Devices";

        private AudioManager audio;

        [BackgroundDependencyLoader]
        private void load(AudioManager audio)
        {
            this.audio = audio;
        }

        protected override void LoadComplete()
        {
            base.LoadComplete();

            var deviceItems = new List<KeyValuePair<string, string>>();
            deviceItems.Add(new KeyValuePair<string, string>("Standard", ""));
            deviceItems.AddRange(audio.GetDeviceNames().Select(d => new KeyValuePair<string, string>(d, d)));
            Children = new Drawable[]
            {
                new OptionDropDown<string>()
                {
                    Items = deviceItems,
                    Bindable = audio.AudioDevice
                },
            };
        }
    }
}
{'fraction_non_alphanumeric': 0.10156672069151809, 'fraction_numerical': 0.00864397622906537, 'mean_word_length': 2.1126050420168068, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 15, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6719651', 'n_tokens_mistral': 515, 'n_tokens_neox': 484, 'n_words': 111}