2016-12-06 09:56:20 +00:00
|
|
|
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
2017-02-06 00:22:37 +00:00
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Framework.Audio;
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
2017-01-31 09:37:11 +00:00
|
|
|
|
namespace osu.Game.Overlays.Options.Sections.Audio
|
2016-11-03 04:26:49 +00:00
|
|
|
|
{
|
|
|
|
|
public class AudioDevicesOptions : OptionsSubsection
|
|
|
|
|
{
|
2016-11-04 03:01:11 +00:00
|
|
|
|
protected override string Header => "Devices";
|
2016-11-09 03:38:40 +00:00
|
|
|
|
|
2017-02-06 00:22:37 +00: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 04:26:49 +00:00
|
|
|
|
{
|
2017-02-06 00:22:37 +00:00
|
|
|
|
new OptionDropDown<string>()
|
|
|
|
|
{
|
|
|
|
|
Items = deviceItems,
|
|
|
|
|
Bindable = audio.AudioDevice
|
|
|
|
|
},
|
|
|
|
|
};
|
2016-11-03 04:26:49 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|