mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-29 04:15:00 +00:00
Re-added api for volume and mute
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -4,5 +4,5 @@
|
||||
[assembly: AssemblyCompany("PepperDash Technology Corp")]
|
||||
[assembly: AssemblyProduct("PepperDashEssentials")]
|
||||
[assembly: AssemblyCopyright("Copyright © PepperDash Technology Corp 2017")]
|
||||
[assembly: AssemblyVersion("1.0.10.*")]
|
||||
[assembly: AssemblyVersion("1.0.11.*")]
|
||||
|
||||
|
||||
@@ -31,9 +31,11 @@ namespace PepperDash.Essentials
|
||||
Parent.AddAction(string.Format(@"/room/{0}/source", Room.Key), new Action<SourceSelectMessageContent>(c => room.RunRouteAction(c.SourceListItem)));
|
||||
Parent.AddAction(string.Format(@"/room/{0}/defaultsource", Room.Key), new Action(Room.RunDefaultRoute));
|
||||
|
||||
Parent.AddAction(string.Format(@"/room/{0}/event/masterVolumeUpBtn", Room.Key), new PressAndHoldAction(b => room.CurrentVolumeControls.VolumeUp(b)));
|
||||
Parent.AddAction(string.Format(@"/room/{0}/event/masterVolumeDownBtn", Room.Key), new PressAndHoldAction(b => room.CurrentVolumeControls.VolumeDown(b)));
|
||||
Parent.AddAction(string.Format(@"/room/{0}/event/muteToggle", Room.Key), new Action(() => room.CurrentVolumeControls.MuteToggle()));
|
||||
//Parent.AddAction(string.Format(@"/room/{0}/event/masterVolumeUpBtn", Room.Key), new PressAndHoldAction(b => room.CurrentVolumeControls.VolumeUp(b)));
|
||||
//Parent.AddAction(string.Format(@"/room/{0}/event/masterVolumeDownBtn", Room.Key), new PressAndHoldAction(b => room.CurrentVolumeControls.VolumeDown(b)));
|
||||
Parent.AddAction(string.Format(@"/room/{0}/masterVolumeLevel", Room.Key), new Action<ushort>(u =>
|
||||
(room.CurrentVolumeControls as IBasicVolumeWithFeedback).SetVolume(u)));
|
||||
Parent.AddAction(string.Format(@"/room/{0}/masterVolumeMuteToggle", Room.Key), new Action(() => room.CurrentVolumeControls.MuteToggle()));
|
||||
|
||||
Room.CurrentSingleSourceChange += new SourceInfoChangeHandler(Room_CurrentSingleSourceChange);
|
||||
|
||||
|
||||
@@ -205,33 +205,23 @@ namespace PepperDash.Essentials
|
||||
{
|
||||
try
|
||||
{
|
||||
//if(Client == null)
|
||||
if(Client == null)
|
||||
Client = new HttpClient();
|
||||
Client.Verbose = true;
|
||||
Client.KeepAlive = true;
|
||||
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
HttpClientRequest request = new HttpClientRequest();
|
||||
request.RequestType = RequestType.Post;
|
||||
string url = string.Format("http://{0}/api/system/{1}/status", Config.ServerUrl, SystemUuid);
|
||||
request.Url.Parse(url);
|
||||
request.KeepAlive = true;
|
||||
request.Header.ContentType = "application/json";
|
||||
// Ignore any null objects when serializing and remove formatting
|
||||
string ignored = JsonConvert.SerializeObject(o, Formatting.None, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
|
||||
Debug.Console(1, this, "Posting to '{0}':\n{1}", url, ignored);
|
||||
request.ContentString = ignored;
|
||||
request.FinalizeHeader();
|
||||
Client.DispatchAsync(request, (r, err) => { if (r != null) { Debug.Console(1, this, "Status Response Code: {0}", r.Code); } });
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
Debug.Console(1, this, "PostToServer exception: {0}", e);
|
||||
}
|
||||
HttpClientRequest request = new HttpClientRequest();
|
||||
request.RequestType = RequestType.Post;
|
||||
string url = string.Format("http://{0}/api/system/{1}/status", Config.ServerUrl, SystemUuid);
|
||||
request.Url.Parse(url);
|
||||
request.KeepAlive = true;
|
||||
request.Header.ContentType = "application/json";
|
||||
// Ignore any null objects when serializing and remove formatting
|
||||
string ignored = JsonConvert.SerializeObject(o, Formatting.None, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
|
||||
Debug.Console(1, this, "Posting to '{0}':\n{1}", url, ignored);
|
||||
request.ContentString = ignored;
|
||||
request.FinalizeHeader();
|
||||
Client.DispatchAsync(request, (r, err) => { if (r != null) { Debug.Console(1, this, "Status Response Code: {0}", r.Code); } });
|
||||
|
||||
//ResetOrStartHearbeatTimer();
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user