//Copyright (c) 2007-2016 ppy Pty Ltd . //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>(); deviceItems.Add(new KeyValuePair("Standard", "")); deviceItems.AddRange(audio.GetDeviceNames().Select(d => new KeyValuePair(d, d))); Children = new Drawable[] { new OptionDropDown() { Items = deviceItems, Bindable = audio.AudioDevice }, }; } } }