1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-24 02:47:37 +08:00
osu-lazer/osu.Game/Overlays/Options/Sections/Audio/AudioDevicesOptions.cs

41 lines
1.2 KiB
C#
Raw Normal View History

2016-12-06 17:56:20 +08:00
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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
2016-11-03 12:26:49 +08:00
{
public class AudioDevicesOptions : OptionsSubsection
{
protected override string Header => "Devices";
2016-11-09 11:38:40 +08:00
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[]
2016-11-03 12:26:49 +08:00
{
new OptionDropDown<string>()
{
Items = deviceItems,
Bindable = audio.AudioDevice
},
};
2016-11-03 12:26:49 +08:00
}
}
}