mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 21:24:54 +00:00
Added remaining Interface Extension Methods for all Huddle device types
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -173,8 +173,8 @@ namespace PepperDash.Essentials
|
|||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void AddSourcesToSystem(Room system, ConfigSourceList configList)
|
//static void AddSourcesToSystem(Room system, ConfigSourceList configList)
|
||||||
{
|
//{
|
||||||
//foreach (var configItem in configList.PresentationSources)
|
//foreach (var configItem in configList.PresentationSources)
|
||||||
//{
|
//{
|
||||||
// var src = (IPresentationSource)DeviceManager.GetDeviceForKey(configItem.SourceKey);
|
// var src = (IPresentationSource)DeviceManager.GetDeviceForKey(configItem.SourceKey);
|
||||||
@@ -184,7 +184,7 @@ namespace PepperDash.Essentials
|
|||||||
// Debug.Console(0, system, "cannot find source '{0}' from list {1}",
|
// Debug.Console(0, system, "cannot find source '{0}' from list {1}",
|
||||||
// configItem.SourceKey, configList.Name);
|
// configItem.SourceKey, configList.Name);
|
||||||
//}
|
//}
|
||||||
}
|
//}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Links up routing, creates tie lines
|
/// Links up routing, creates tie lines
|
||||||
|
|||||||
@@ -142,7 +142,14 @@
|
|||||||
<Compile Include="FOR REFERENCE Room\EssentialsRoom.cs" />
|
<Compile Include="FOR REFERENCE Room\EssentialsRoom.cs" />
|
||||||
<Compile Include="Room\Cotija\CotijaConfig.cs" />
|
<Compile Include="Room\Cotija\CotijaConfig.cs" />
|
||||||
<Compile Include="Room\Cotija\CotijaRoomBridge.cs" />
|
<Compile Include="Room\Cotija\CotijaRoomBridge.cs" />
|
||||||
|
<Compile Include="Room\Cotija\DeviceTypeInterfaces\IChannelExtensions.cs" />
|
||||||
|
<Compile Include="Room\Cotija\DeviceTypeInterfaces\IColorExtensions.cs" />
|
||||||
<Compile Include="Room\Cotija\DeviceTypeInterfaces\IDPadExtensions.cs" />
|
<Compile Include="Room\Cotija\DeviceTypeInterfaces\IDPadExtensions.cs" />
|
||||||
|
<Compile Include="Room\Cotija\DeviceTypeInterfaces\IDvrExtensions.cs" />
|
||||||
|
<Compile Include="Room\Cotija\DeviceTypeInterfaces\INumericExtensions.cs" />
|
||||||
|
<Compile Include="Room\Cotija\DeviceTypeInterfaces\IPowerExtensions.cs" />
|
||||||
|
<Compile Include="Room\Cotija\DeviceTypeInterfaces\ISetTopBoxControlsExtensions.cs" />
|
||||||
|
<Compile Include="Room\Cotija\DeviceTypeInterfaces\ITransportExtensions.cs" />
|
||||||
<Compile Include="Room\EssentialsPresentationRoom.cs" />
|
<Compile Include="Room\EssentialsPresentationRoom.cs" />
|
||||||
<Compile Include="Room\EssentialsRoomBase.cs" />
|
<Compile Include="Room\EssentialsRoomBase.cs" />
|
||||||
<Compile Include="Room\EssentialsRoomConfig.cs" />
|
<Compile Include="Room\EssentialsRoomConfig.cs" />
|
||||||
|
|||||||
Binary file not shown.
@@ -6,6 +6,7 @@ using Crestron.SimplSharp;
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Room.Cotija;
|
||||||
|
|
||||||
namespace PepperDash.Essentials
|
namespace PepperDash.Essentials
|
||||||
{
|
{
|
||||||
@@ -144,29 +145,28 @@ namespace PepperDash.Essentials
|
|||||||
var previousDev = info.SourceDevice;
|
var previousDev = info.SourceDevice;
|
||||||
|
|
||||||
// device type interfaces
|
// device type interfaces
|
||||||
//if (previousDev is ISetTopBoxControls)
|
if (previousDev is ISetTopBoxControls)
|
||||||
// (previousDev as ISetTopBoxControls).UnlinkButtons(TriList);
|
(previousDev as ISetTopBoxControls).UnlinkActions(Parent);
|
||||||
//// common interfaces
|
// common interfaces
|
||||||
//if (previousDev is IChannel)
|
if (previousDev is IChannel)
|
||||||
// (previousDev as IChannel).UnlinkButtons(TriList);
|
(previousDev as IChannel).UnlinkActions(Parent);
|
||||||
//if (previousDev is IColor)
|
if (previousDev is IColor)
|
||||||
// (previousDev as IColor).UnlinkButtons(TriList);
|
(previousDev as IColor).UnlinkActions(Parent);
|
||||||
if (previousDev is IDPad)
|
if (previousDev is IDPad)
|
||||||
(previousDev as IDPad).UnlinkActions(Parent);
|
(previousDev as IDPad).UnlinkActions(Parent);
|
||||||
//if (previousDev is IDvr)
|
if (previousDev is IDvr)
|
||||||
// (previousDev as IDvr).UnlinkButtons(TriList);
|
(previousDev as IDvr).UnlinkActions(Parent);
|
||||||
//if (previousDev is INumericKeypad)
|
if (previousDev is INumericKeypad)
|
||||||
// (previousDev as INumericKeypad).UnlinkButtons(TriList);
|
(previousDev as INumericKeypad).UnlinkActions(Parent);
|
||||||
//if (previousDev is IPower)
|
if (previousDev is IPower)
|
||||||
// (previousDev as IPower).UnlinkButtons(TriList);
|
(previousDev as IPower).UnlinkActions(Parent);
|
||||||
//if (previousDev is ITransport)
|
if (previousDev is ITransport)
|
||||||
// (previousDev as ITransport).UnlinkButtons(TriList);
|
(previousDev as ITransport).UnlinkActions(Parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
JObject roomStatus = new JObject();
|
JObject roomStatus = new JObject();
|
||||||
|
|
||||||
var huddleRoom = room as EssentialsHuddleSpaceRoom;
|
var huddleRoom = room as EssentialsHuddleSpaceRoom;
|
||||||
//roomStatus.Add("isOn", huddleRoom.OnFeedback.BoolValue);
|
|
||||||
roomStatus.Add("selectedSourceKey", huddleRoom.CurrentSourceInfoKey);
|
roomStatus.Add("selectedSourceKey", huddleRoom.CurrentSourceInfoKey);
|
||||||
|
|
||||||
JObject message = new JObject();
|
JObject message = new JObject();
|
||||||
@@ -182,26 +182,24 @@ namespace PepperDash.Essentials
|
|||||||
{
|
{
|
||||||
var dev = info.SourceDevice;
|
var dev = info.SourceDevice;
|
||||||
|
|
||||||
//if (dev is ISetTopBoxControls)
|
if (dev is ISetTopBoxControls)
|
||||||
// (dev as ISetTopBoxControls).LinkButtons(TriList);
|
(dev as ISetTopBoxControls).LinkActions(Parent);
|
||||||
//if (dev is IChannel)
|
if (dev is IChannel)
|
||||||
// (dev as IChannel).LinkButtons(TriList);
|
(dev as IChannel).LinkActions(Parent);
|
||||||
//if (dev is IColor)
|
if (dev is IColor)
|
||||||
// (dev as IColor).LinkButtons(TriList);
|
(dev as IColor).LinkActions(Parent);
|
||||||
if (dev is IDPad)
|
if (dev is IDPad)
|
||||||
(dev as IDPad).LinkActions(Parent);
|
(dev as IDPad).LinkActions(Parent);
|
||||||
//if (dev is IDvr)
|
if (dev is IDvr)
|
||||||
// (dev as IDvr).LinkButtons(TriList);
|
(dev as IDvr).LinkActions(Parent);
|
||||||
//if (dev is INumericKeypad)
|
if (dev is INumericKeypad)
|
||||||
// (dev as INumericKeypad).LinkButtons(TriList);
|
(dev as INumericKeypad).LinkActions(Parent);
|
||||||
//if (dev is IPower)
|
if (dev is IPower)
|
||||||
// (dev as IPower).LinkButtons(TriList);
|
(dev as IPower).LinkActions(Parent);
|
||||||
//if (dev is ITransport)
|
if (dev is ITransport)
|
||||||
// (dev as ITransport).LinkButtons(TriList);
|
(dev as ITransport).LinkActions(Parent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace PepperDash.Essentials
|
|||||||
|
|
||||||
HttpClient Client;
|
HttpClient Client;
|
||||||
|
|
||||||
Dictionary<string, Object> ActionDictionary = new Dictionary<string, Object>();
|
Dictionary<string, Object> ActionDictionary = new Dictionary<string, Object>(StringComparer.InvariantCultureIgnoreCase);
|
||||||
|
|
||||||
Dictionary<string, CTimer> PushedActions = new Dictionary<string, CTimer>();
|
Dictionary<string, CTimer> PushedActions = new Dictionary<string, CTimer>();
|
||||||
|
|
||||||
@@ -233,7 +233,10 @@ namespace PepperDash.Essentials
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Debug.Console(0, this, "Response from server: {0}\n{1}", resp.Code, err);
|
if (resp != null)
|
||||||
|
Debug.Console(1, this, "Response from server: {0}\n{1}", resp.Code, err);
|
||||||
|
else
|
||||||
|
Debug.Console(1, this, "Null response received from server.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Core;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Room.Cotija
|
||||||
|
{
|
||||||
|
public static class IChannelExtensions
|
||||||
|
{
|
||||||
|
public static void LinkActions(this IChannel dev, CotijaSystemController controller)
|
||||||
|
{
|
||||||
|
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||||
|
|
||||||
|
controller.AddAction(prefix + "chanup", new PressAndHoldAction(dev.ChannelUp));
|
||||||
|
controller.AddAction(prefix + "chandown", new PressAndHoldAction(dev.ChannelDown));
|
||||||
|
controller.AddAction(prefix + "lastchan", new PressAndHoldAction(dev.LastChannel));
|
||||||
|
controller.AddAction(prefix + "guide", new PressAndHoldAction(dev.Guide));
|
||||||
|
controller.AddAction(prefix + "info", new PressAndHoldAction(dev.Info));
|
||||||
|
controller.AddAction(prefix + "exit", new PressAndHoldAction(dev.Exit));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void UnlinkActions(this IChannel dev, CotijaSystemController controller)
|
||||||
|
{
|
||||||
|
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||||
|
|
||||||
|
controller.RemoveAction(prefix + "chanup");
|
||||||
|
controller.RemoveAction(prefix + "chandown");
|
||||||
|
controller.RemoveAction(prefix + "lastchan");
|
||||||
|
controller.RemoveAction(prefix + "guide");
|
||||||
|
controller.RemoveAction(prefix + "info");
|
||||||
|
controller.RemoveAction(prefix + "exit");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Core;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Room.Cotija
|
||||||
|
{
|
||||||
|
public static class IColorExtensions
|
||||||
|
{
|
||||||
|
public static void LinkActions(this IColor dev, CotijaSystemController controller)
|
||||||
|
{
|
||||||
|
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||||
|
|
||||||
|
controller.AddAction(prefix + "red", new PressAndHoldAction(dev.Red));
|
||||||
|
controller.AddAction(prefix + "green", new PressAndHoldAction(dev.Green));
|
||||||
|
controller.AddAction(prefix + "yellow", new PressAndHoldAction(dev.Yellow));
|
||||||
|
controller.AddAction(prefix + "blue", new PressAndHoldAction(dev.Blue));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void UnlinkActions(this IColor dev, CotijaSystemController controller)
|
||||||
|
{
|
||||||
|
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||||
|
|
||||||
|
controller.RemoveAction(prefix + "red");
|
||||||
|
controller.RemoveAction(prefix + "green");
|
||||||
|
controller.RemoveAction(prefix + "yellow");
|
||||||
|
controller.RemoveAction(prefix + "blue");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,7 +6,7 @@ using Crestron.SimplSharp;
|
|||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
|
|
||||||
namespace PepperDash.Essentials
|
namespace PepperDash.Essentials.Room.Cotija
|
||||||
{
|
{
|
||||||
public static class IDPadExtensions
|
public static class IDPadExtensions
|
||||||
{
|
{
|
||||||
@@ -14,13 +14,13 @@ namespace PepperDash.Essentials
|
|||||||
{
|
{
|
||||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||||
|
|
||||||
controller.AddAction(prefix + "up", new Action<bool>(dev.Up));
|
controller.AddAction(prefix + "up", new PressAndHoldAction(dev.Up));
|
||||||
controller.AddAction(prefix + "down", new Action<bool>(dev.Down));
|
controller.AddAction(prefix + "down", new PressAndHoldAction(dev.Down));
|
||||||
controller.AddAction(prefix + "left", new Action<bool>(dev.Left));
|
controller.AddAction(prefix + "left", new PressAndHoldAction(dev.Left));
|
||||||
controller.AddAction(prefix + "right", new Action<bool>(dev.Right));
|
controller.AddAction(prefix + "right", new PressAndHoldAction(dev.Right));
|
||||||
controller.AddAction(prefix + "select", new Action<bool>(dev.Select));
|
controller.AddAction(prefix + "select", new PressAndHoldAction(dev.Select));
|
||||||
controller.AddAction(prefix + "menu", new Action<bool>(dev.Menu));
|
controller.AddAction(prefix + "menu", new PressAndHoldAction(dev.Menu));
|
||||||
controller.AddAction(prefix + "exit", new Action<bool>(dev.Exit));
|
controller.AddAction(prefix + "exit", new PressAndHoldAction(dev.Exit));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void UnlinkActions(this IDPad dev, CotijaSystemController controller)
|
public static void UnlinkActions(this IDPad dev, CotijaSystemController controller)
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Core;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Room.Cotija
|
||||||
|
{
|
||||||
|
public static class IDvrExtensions
|
||||||
|
{
|
||||||
|
public static void LinkActions(this IDvr dev, CotijaSystemController controller)
|
||||||
|
{
|
||||||
|
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||||
|
|
||||||
|
controller.AddAction(prefix + "dvrlist", new PressAndHoldAction(dev.DvrList));
|
||||||
|
controller.AddAction(prefix + "record", new PressAndHoldAction(dev.Record));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void UnlinkActions(this IDvr dev, CotijaSystemController controller)
|
||||||
|
{
|
||||||
|
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||||
|
|
||||||
|
controller.RemoveAction(prefix + "dvrlist");
|
||||||
|
controller.RemoveAction(prefix + "record");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Core;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Room.Cotija
|
||||||
|
{
|
||||||
|
public static class INumericExtensions
|
||||||
|
{
|
||||||
|
public static void LinkActions(this INumericKeypad dev, CotijaSystemController controller)
|
||||||
|
{
|
||||||
|
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||||
|
|
||||||
|
controller.AddAction(prefix + "num0", new PressAndHoldAction(dev.Digit0));
|
||||||
|
controller.AddAction(prefix + "num1", new PressAndHoldAction(dev.Digit1));
|
||||||
|
controller.AddAction(prefix + "num2", new PressAndHoldAction(dev.Digit2));
|
||||||
|
controller.AddAction(prefix + "num3", new PressAndHoldAction(dev.Digit3));
|
||||||
|
controller.AddAction(prefix + "num4", new PressAndHoldAction(dev.Digit4));
|
||||||
|
controller.AddAction(prefix + "num5", new PressAndHoldAction(dev.Digit5));
|
||||||
|
controller.AddAction(prefix + "num6", new PressAndHoldAction(dev.Digit6));
|
||||||
|
controller.AddAction(prefix + "num7", new PressAndHoldAction(dev.Digit0));
|
||||||
|
controller.AddAction(prefix + "num8", new PressAndHoldAction(dev.Digit0));
|
||||||
|
controller.AddAction(prefix + "num9", new PressAndHoldAction(dev.Digit0));
|
||||||
|
controller.AddAction(prefix + "dash", new PressAndHoldAction(dev.KeypadAccessoryButton1));
|
||||||
|
controller.AddAction(prefix + "enter", new PressAndHoldAction(dev.KeypadAccessoryButton2));
|
||||||
|
#warning Deal with the Accessory functions on the numpad later
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void UnlinkActions(this INumericKeypad dev, CotijaSystemController controller)
|
||||||
|
{
|
||||||
|
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||||
|
|
||||||
|
controller.RemoveAction(prefix + "num0");
|
||||||
|
controller.RemoveAction(prefix + "num1");
|
||||||
|
controller.RemoveAction(prefix + "num2");
|
||||||
|
controller.RemoveAction(prefix + "num3");
|
||||||
|
controller.RemoveAction(prefix + "num4");
|
||||||
|
controller.RemoveAction(prefix + "num5");
|
||||||
|
controller.RemoveAction(prefix + "num6");
|
||||||
|
controller.RemoveAction(prefix + "num7");
|
||||||
|
controller.RemoveAction(prefix + "num8");
|
||||||
|
controller.RemoveAction(prefix + "num9");
|
||||||
|
controller.RemoveAction(prefix + "dash");
|
||||||
|
controller.RemoveAction(prefix + "enter");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Core;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Room.Cotija
|
||||||
|
{
|
||||||
|
public static class IPowerExtensions
|
||||||
|
{
|
||||||
|
public static void LinkActions(this IPower dev, CotijaSystemController controller)
|
||||||
|
{
|
||||||
|
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||||
|
|
||||||
|
controller.AddAction(prefix + "poweron", new Action(dev.PowerOn));
|
||||||
|
controller.AddAction(prefix + "poweroff", new Action(dev.PowerOff));
|
||||||
|
controller.AddAction(prefix + "powertoggle", new Action(dev.PowerToggle));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void UnlinkActions(this IPower dev, CotijaSystemController controller)
|
||||||
|
{
|
||||||
|
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||||
|
|
||||||
|
controller.RemoveAction(prefix + "poweron");
|
||||||
|
controller.RemoveAction(prefix + "poweroff");
|
||||||
|
controller.RemoveAction(prefix + "powertoggle");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Core;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Room.Cotija
|
||||||
|
{
|
||||||
|
public static class ISetTopBoxControlsExtensions
|
||||||
|
{
|
||||||
|
public static void LinkActions(this ISetTopBoxControls dev, CotijaSystemController controller)
|
||||||
|
{
|
||||||
|
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||||
|
|
||||||
|
controller.AddAction(prefix + "dvrlist", new PressAndHoldAction(dev.DvrList));
|
||||||
|
controller.AddAction(prefix + "replay", new PressAndHoldAction(dev.Replay));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void UnlinkActions(this ISetTopBoxControls dev, CotijaSystemController controller)
|
||||||
|
{
|
||||||
|
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||||
|
|
||||||
|
controller.RemoveAction(prefix + "dvrlist");
|
||||||
|
controller.RemoveAction(prefix + "replay");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Core;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Room.Cotija
|
||||||
|
{
|
||||||
|
public static class ITransportExtensions
|
||||||
|
{
|
||||||
|
public static void LinkActions(this ITransport dev, CotijaSystemController controller)
|
||||||
|
{
|
||||||
|
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||||
|
|
||||||
|
controller.AddAction(prefix + "play", new PressAndHoldAction(dev.Play));
|
||||||
|
controller.AddAction(prefix + "pause", new PressAndHoldAction(dev.Pause));
|
||||||
|
controller.AddAction(prefix + "stop", new PressAndHoldAction(dev.Stop));
|
||||||
|
controller.AddAction(prefix + "prevtrack", new PressAndHoldAction(dev.ChapPlus));
|
||||||
|
controller.AddAction(prefix + "nexttrack", new PressAndHoldAction(dev.ChapMinus));
|
||||||
|
controller.AddAction(prefix + "rewind", new PressAndHoldAction(dev.Rewind));
|
||||||
|
controller.AddAction(prefix + "ffwd", new PressAndHoldAction(dev.FFwd));
|
||||||
|
controller.AddAction(prefix + "record", new PressAndHoldAction(dev.Record));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void UnlinkActions(this ITransport dev, CotijaSystemController controller)
|
||||||
|
{
|
||||||
|
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||||
|
|
||||||
|
controller.RemoveAction(prefix + "play");
|
||||||
|
controller.RemoveAction(prefix + "pause");
|
||||||
|
controller.RemoveAction(prefix + "stop");
|
||||||
|
controller.RemoveAction(prefix + "prevtrack");
|
||||||
|
controller.RemoveAction(prefix + "nexttrack");
|
||||||
|
controller.RemoveAction(prefix + "rewind");
|
||||||
|
controller.RemoveAction(prefix + "ffwd");
|
||||||
|
controller.RemoveAction(prefix + "record");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user