Skip to content

Commit

Permalink
feat: add VideoCodecBase and AudioCodecBase messengers
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-welker committed Aug 30, 2022
1 parent 197fb94 commit cc9675d
Showing 1 changed file with 25 additions and 7 deletions.
32 changes: 25 additions & 7 deletions 3-series/RoomBridges/MobileControlSIMPLRoomBridge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
using PepperDash.Essentials.Core.Lighting;
using PepperDash.Essentials.Core.Shades;
using PepperDash.Essentials.Devices.Common;
using PepperDash.Essentials.Devices.Common.VideoCodec;
using PepperDash.Essentials.Devices.Common.AudioCodec;

namespace PepperDash.Essentials.Room.MobileControl
{
Expand Down Expand Up @@ -867,7 +869,7 @@ private void CreateDestinationList(BasicConfig co)
/// Iterates device config and adds messengers as neede for each device type
/// </summary>
private void SetupDeviceMessengers()
{
{
try
{
foreach (var device in ConfigReader.ConfigObject.Devices)
Expand Down Expand Up @@ -929,7 +931,7 @@ private void SetupDeviceMessengers()
{
var camDevice = dev as CameraBase;
Debug.Console(1, this, "Adding CameraBaseMessenger for device: {0}", dev.Key);
var cameraMessenger = new CameraBaseMessenger(device.Key + "-" + Parent.Key, camDevice,
var messenger = new CameraBaseMessenger(device.Key + "-" + Parent.Key, camDevice,
"/device/" + device.Key);
Parent.AddDeviceMessenger(messenger);
continue;
Expand All @@ -942,9 +944,25 @@ private void SetupDeviceMessengers()
Debug.Console(1, this, "Adding ZoomRoomMessenger for device: {0}", dev.Key);

var zoomMessenger = new ZoomRoomMessenger(device.Key + "-" + Parent.Key, zoomDevice, "/device/" + dev.Key);
Parent.AddDeviceMessenger(zoomMessenger);
DeviceMessengers.Add(device.Key, zoomMessenger);
zoomMessenger.RegisterWithAppServer(Parent);
Parent.AddDeviceMessenger(zoomMessenger);
continue;
}

if(dev is VideoCodecBase)
{
var vcBase = dev as VideoCodecBase;

var messenger = new VideoCodecBaseMessenger(dev.Key + "-" + Parent.Key, vcBase, string.Format("/devices/{0}", dev.Key));
Parent.AddDeviceMessenger(messenger);
continue;
}

if(dev is AudioCodecBase)
{
var acBase = dev as AudioCodecBase;

var messenger = new AudioCodecBaseMessenger(dev.Key + "-" + Parent.Key, acBase, string.Format("/devices/{0}", dev.Key));
Parent.AddDeviceMessenger(messenger);
continue;
}

Expand All @@ -955,7 +973,7 @@ private void SetupDeviceMessengers()
Debug.Console(1, this, "Adding LightingBaseMessenger for device: {0}", deviceKey);
var messenger = new LightingBaseMessenger(deviceKey + "-" + Parent.Key,
lightingDevice, string.Format("/device/{0}", deviceKey));
Parent.AddDeviceMessenger(messenger);
Parent.AddDeviceMessenger(messenger);
continue;
}

Expand All @@ -966,7 +984,7 @@ private void SetupDeviceMessengers()
Debug.Console(1, this, "Adding ShadeBaseMessenger for device: {0}", deviceKey);
var messenger = new ShadeBaseMessenger(deviceKey + "-" + Parent.Key,
shadeDevice, string.Format("/device/{0}", deviceKey));
Parent.AddDeviceMessenger(messenger);
Parent.AddDeviceMessenger(messenger);
continue;
}

Expand Down

0 comments on commit cc9675d

Please sign in to comment.