diff --git a/PepperDashEssentials/ControlSystem.cs b/PepperDashEssentials/ControlSystem.cs index be78aaf9..53ea9e13 100644 --- a/PepperDashEssentials/ControlSystem.cs +++ b/PepperDashEssentials/ControlSystem.cs @@ -490,21 +490,17 @@ namespace PepperDash.Essentials } } + AddRoomAndBuildMC(room); + if (room is IEssentialsHuddleSpaceRoom) { - DeviceManager.AddDevice(room); Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is EssentialsHuddleSpaceRoom, attempting to add to DeviceManager with Fusion with IP-ID {0:X2}", fusionIpId); DeviceManager.AddDevice(new Core.Fusion.EssentialsHuddleSpaceFusionSystemControllerBase(room, fusionIpId, fusionJoinMapKey)); - - Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge..."); - - CreateMobileControlBridge(room); } else if (room is IEssentialsHuddleVtc1Room) { - DeviceManager.AddDevice(room); if (!(room is EssentialsCombinedHuddleVtc1Room)) { @@ -512,28 +508,15 @@ namespace PepperDash.Essentials DeviceManager.AddDevice(new EssentialsHuddleVtc1FusionController((IEssentialsHuddleVtc1Room)room, fusionIpId, fusionJoinMapKey)); } - Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge..."); - - CreateMobileControlBridge(room); } else if (room is EssentialsTechRoom) { - DeviceManager.AddDevice(room); Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is EssentialsTechRoom, Attempting to add to DeviceManager with Fusion with IP-ID {0:X2}", fusionIpId); DeviceManager.AddDevice(new EssentialsTechRoomFusionSystemController((EssentialsTechRoom)room, fusionIpId, fusionJoinMapKey)); - Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge"); - - CreateMobileControlBridge(room); } - else - { - Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is NOT EssentialsRoom, attempting to add to DeviceManager w/o Fusion"); - DeviceManager.AddDevice(room); - } - fusionIpId += 1; } else @@ -547,6 +530,15 @@ namespace PepperDash.Essentials } + private static void AddRoomAndBuildMC(IEssentialsRoom room) + { + DeviceManager.AddDevice(room); + + Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge"); + + CreateMobileControlBridge(room); + } + private static void CreateMobileControlBridge(object room) { var mobileControl = GetMobileControlDevice(); diff --git a/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs b/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs index 5a2bd34f..20d1ce75 100644 --- a/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs +++ b/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs @@ -19,32 +19,41 @@ namespace PepperDash.Essentials.Room.Config /// Returns a room object from this config data /// /// - public static Device GetRoomObject(DeviceConfig roomConfig) + public static IKeyed GetRoomObject(DeviceConfig roomConfig) { var typeName = roomConfig.Type.ToLower(); - if (typeName == "huddle") - { - return new EssentialsHuddleSpaceRoom(roomConfig); - } - if (typeName == "huddlevtc1") + switch (typeName) { - return new EssentialsHuddleVtc1Room(roomConfig); + case "huddle" : + { + return new EssentialsHuddleSpaceRoom(roomConfig); + } + case "huddlevtc1" : + { + return new EssentialsHuddleVtc1Room(roomConfig); + } + case "ddvc01bridge" : + { + return new Device(roomConfig.Key, roomConfig.Name); // placeholder device that does nothing. + } + case "dualdisplay" : + { + return new EssentialsDualDisplayRoom(roomConfig); + } + case "combinedhuddlevtc1" : + { + return new EssentialsCombinedHuddleVtc1Room(roomConfig); + } + case "techroom" : + { + return new EssentialsTechRoom(roomConfig); + } + default : + { + return Core.DeviceFactory.GetDevice(roomConfig); + } } - if (typeName == "ddvc01bridge") - { - return new Device(roomConfig.Key, roomConfig.Name); // placeholder device that does nothing. - } - if (typeName == "dualdisplay") - { - return new EssentialsDualDisplayRoom(roomConfig); - } - if (typeName == "combinedhuddlevtc1") - { - return new EssentialsCombinedHuddleVtc1Room(roomConfig); - } - - return typeName != "techroom" ? null : new EssentialsTechRoom(roomConfig); } /// diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/VideoCodecControllerJoinMap.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/VideoCodecControllerJoinMap.cs index 07c5c4bc..1e99bef7 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/VideoCodecControllerJoinMap.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/VideoCodecControllerJoinMap.cs @@ -1145,21 +1145,21 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps - #region Analog - - // TODO [ ] hotfix/videocodecbase-max-meeting-xsig-set - [JoinName("MeetingsToDisplay")] - public JoinDataComplete MeetingsToDisplay = new JoinDataComplete( - new JoinData - { - JoinNumber = 40, - JoinSpan = 1 - }, - new JoinMetadata - { - Description = "Set/FB the number of meetings to display via the bridge xsig; default: 3 meetings.", - JoinCapabilities = eJoinCapabilities.ToFromSIMPL, - JoinType = eJoinType.Analog + #region Analog + + // TODO [ ] hotfix/videocodecbase-max-meeting-xsig-set + [JoinName("MeetingsToDisplay")] + public JoinDataComplete MeetingsToDisplay = new JoinDataComplete( + new JoinData + { + JoinNumber = 40, + JoinSpan = 1 + }, + new JoinMetadata + { + Description = "Set/FB the number of meetings to display via the bridge xsig; default: 3 meetings.", + JoinCapabilities = eJoinCapabilities.ToFromSIMPL, + JoinType = eJoinType.Analog }); [JoinName("SelectCall")] diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/IVolumeAndAudioInterfaces.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/IVolumeAndAudioInterfaces.cs index 1cff62fc..254eada2 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/IVolumeAndAudioInterfaces.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/IVolumeAndAudioInterfaces.cs @@ -7,25 +7,53 @@ using Crestron.SimplSharp; namespace PepperDash.Essentials.Core { /// - /// Defines minimal volume control methods + /// Defines minimal volume and mute control methods /// - public interface IBasicVolumeControls + public interface IBasicVolumeControls : IHasVolumeControl, IHasMuteControl { - void VolumeUp(bool pressRelease); - void VolumeDown(bool pressRelease); - void MuteToggle(); } + /// + /// Defines basic volume control methods + /// + public interface IHasVolumeControl + { + void VolumeUp(bool pressRelease); + void VolumeDown(bool pressRelease); + } + + /// + /// Defines volume control methods and properties with feedback + /// + public interface IHasVolumeControlWithFeedback : IHasVolumeControl + { + void SetVolume(ushort level); + IntFeedback VolumeLevelFeedback { get; } + } + + /// + /// Defines basic mute control methods + /// + public interface IHasMuteControl + { + void MuteToggle(); + } + + /// + /// Defines mute control methods and properties with feedback + /// + public interface IHasMuteControlWithFeedback : IHasMuteControl + { + BoolFeedback MuteFeedback { get; } + void MuteOn(); + void MuteOff(); + } + /// /// Adds feedback and direct volume level set to IBasicVolumeControls /// - public interface IBasicVolumeWithFeedback : IBasicVolumeControls + public interface IBasicVolumeWithFeedback : IBasicVolumeControls, IHasVolumeControlWithFeedback, IHasMuteControlWithFeedback { - void SetVolume(ushort level); - void MuteOn(); - void MuteOff(); - IntFeedback VolumeLevelFeedback { get; } - BoolFeedback MuteFeedback { get; } } /// diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Lighting/LightingBase.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Lighting/LightingBase.cs index 569d2005..0549985c 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Lighting/LightingBase.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Lighting/LightingBase.cs @@ -99,13 +99,18 @@ namespace PepperDash.Essentials.Core.Lighting var sceneIndex = 0; foreach (var scene in lightingDevice.LightingScenes) { - trilist.SetSigTrueAction((uint)(joinMap.SelectSceneDirect.JoinNumber + sceneIndex), () => lightingDevice.SelectScene(lightingDevice.LightingScenes[sceneIndex])); + var index1 = sceneIndex; + trilist.SetSigTrueAction((uint)(joinMap.SelectSceneDirect.JoinNumber + sceneIndex), () => + { + var index = index1; + Debug.Console(2, this, "LightingDevice: sceneIndex: {0} index: {1} > inside action", index1, index); + lightingDevice.SelectScene(lightingDevice.LightingScenes[index]); + }); scene.IsActiveFeedback.LinkInputSig(trilist.BooleanInput[(uint)(joinMap.SelectSceneDirect.JoinNumber + sceneIndex)]); trilist.StringInput[(uint)(joinMap.SelectSceneDirect.JoinNumber + sceneIndex)].StringValue = scene.Name; trilist.BooleanInput[(uint)(joinMap.ButtonVisibility.JoinNumber + sceneIndex)].BoolValue = true; sceneIndex++; } - return joinMap; } diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Display/NECPSXMDisplay.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Display/NECPSXMDisplay.cs index 176f28ac..a674b11a 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Display/NECPSXMDisplay.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Display/NECPSXMDisplay.cs @@ -308,7 +308,7 @@ namespace PepperDash.Essentials.Devices.Displays //Send((string)selector); } - void SetVolume(ushort level) + public void SetVolume(ushort level) { var levelString = string.Format("{0}{1:X4}\x03", VolumeLevelPartialCmd, level); AppendChecksumAndSend(levelString); @@ -333,10 +333,13 @@ namespace PepperDash.Essentials.Devices.Displays Send(MuteOnCmd); } - void IBasicVolumeWithFeedback.SetVolume(ushort level) + + /* + public void IBasicVolumeWithFeedback.SetVolume(ushort level) { SetVolume(level); } + */ #endregion diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Display/PanasonicThDisplay.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Display/PanasonicThDisplay.cs index b8d33bd1..9acc395e 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Display/PanasonicThDisplay.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Display/PanasonicThDisplay.cs @@ -290,7 +290,7 @@ namespace PepperDash.Essentials.Devices.Displays //Send((string)selector); } - void SetVolume(ushort level) + public void SetVolume(ushort level) { var levelString = string.Format("{0}{1:X3}\x03", VolumeLevelPartialCmd, level); @@ -315,11 +315,12 @@ namespace PepperDash.Essentials.Devices.Displays Send(MuteOnCmd); } + /* void IBasicVolumeWithFeedback.SetVolume(ushort level) { SetVolume(level); } - + */ #endregion #region IBasicVolumeControls Members