diff options
| author | Michael <[email protected]> | 2017-01-29 11:59:18 -0500 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-01-29 11:59:18 -0500 |
| commit | abfd774638d509a0d5fe5a61fe69b890fa3e0fc6 (patch) | |
| tree | 62e7e7aea3a98615331180d28a3a5970f298d3a6 /ShiftOS.WinForms/ShiftOSAudioProvider.cs | |
| parent | b5d51784117f5fdecb14bc1cef6a6d2477a7c810 (diff) | |
| download | shiftos_thereturn-abfd774638d509a0d5fe5a61fe69b890fa3e0fc6.tar.gz shiftos_thereturn-abfd774638d509a0d5fe5a61fe69b890fa3e0fc6.tar.bz2 shiftos_thereturn-abfd774638d509a0d5fe5a61fe69b890fa3e0fc6.zip | |
Scripting changes and background music!
Diffstat (limited to 'ShiftOS.WinForms/ShiftOSAudioProvider.cs')
| -rw-r--r-- | ShiftOS.WinForms/ShiftOSAudioProvider.cs | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/ShiftOS.WinForms/ShiftOSAudioProvider.cs b/ShiftOS.WinForms/ShiftOSAudioProvider.cs new file mode 100644 index 0000000..f217325 --- /dev/null +++ b/ShiftOS.WinForms/ShiftOSAudioProvider.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Newtonsoft.Json; +using ShiftOS.Engine; + +namespace ShiftOS.WinForms +{ + class ShiftOSAudioProvider : IAudioProvider + { + public int Count + { + get + { + var wc = new System.Net.WebClient(); + return JsonConvert.DeserializeObject<List<string>>(wc.DownloadString("http://getshiftos.ml/api.php?q=soundtrack")).Count; + } + } + + private float _vol = 1.0f; + + public float Volume + { + get + { + return _vol; + } + + set + { + _vol = value; + } + } + + public byte[] GetTrack(int index) + { + var wc = new System.Net.WebClient(); + var st = JsonConvert.DeserializeObject<List<string>>(wc.DownloadString("http://getshiftos.ml/api.php?q=soundtrack")); + + return wc.DownloadData(st[index]); + } + } + + +} |
