Changed incoming messages for a few features. Added default source select

This commit is contained in:
Heath Volmer
2017-12-12 11:11:33 -07:00
parent 762f13c708
commit ae496f556b
5 changed files with 18 additions and 6 deletions

View File

@@ -4,5 +4,5 @@
[assembly: AssemblyCompany("PepperDash Technology Corp")]
[assembly: AssemblyProduct("PepperDashEssentials")]
[assembly: AssemblyCopyright("Copyright © PepperDash Technology Corp 2017")]
[assembly: AssemblyVersion("1.0.7.*")]
[assembly: AssemblyVersion("1.0.8.*")]

View File

@@ -21,9 +21,16 @@ namespace PepperDash.Essentials
Parent = parent;
Room = room;
// we add actions to the messaging system with a path, and a related action. Custom action
// content objects can be handled in the controller's LineReceived method - and perhaps other
// sub-controller parsing could be attached to these classes, so that the systemController
// doesn't need to know about everything.
// Source Changes and room off
Parent.AddAction(string.Format(@"/room/{0}/status",Room.Key), new Action(() => Room_RoomFullStatus(Room)));
Parent.AddAction(string.Format(@"/room/{0}/source", Room.Key), new Action<SourceSelectMessageContent>(c => room.RunRouteAction(c.SourceSelect)));
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()));
@@ -247,8 +254,9 @@ namespace PepperDash.Essentials
public class SourceSelectMessageContent
{
public string Destination { get; set; }
public string SourceSelect { get; set; }
public string SourceListItem { get; set; }
//public string Destination { get; set; }
//public string SourceSelect { get; set; }
}
public delegate void PressAndHoldAction(bool b);

View File

@@ -359,7 +359,7 @@ namespace PepperDash.Essentials
CommunicationGather LineGathered = new CommunicationGather(SseClient, "\x0d\x0a");
LineGathered.LineReceived += new EventHandler<GenericCommMethodReceiveTextArgs>(LineGathered_LineReceived);
LineGathered.LineReceived += new EventHandler<GenericCommMethodReceiveTextArgs>(SSEClient_LineReceived);
}
else
{
@@ -381,7 +381,7 @@ namespace PepperDash.Essentials
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void LineGathered_LineReceived(object sender, GenericCommMethodReceiveTextArgs e)
void SSEClient_LineReceived(object sender, GenericCommMethodReceiveTextArgs e)
{
//Debug.Console(1, this, "Received from Server: '{0}'", e.Text);
@@ -493,6 +493,10 @@ namespace PepperDash.Essentials
.ToObject<SourceSelectMessageContent>());
}
}
else
{
Debug.Console(1, this, "-- Warning: Incoming message has no registered handler");
}
}