diff --git a/PepperDashEssentials/AppServer/Messengers/Ddvc01AtcMessenger.cs b/PepperDashEssentials/AppServer/Messengers/Ddvc01AtcMessenger.cs index b578018b..72e2f8d3 100644 --- a/PepperDashEssentials/AppServer/Messengers/Ddvc01AtcMessenger.cs +++ b/PepperDashEssentials/AppServer/Messengers/Ddvc01AtcMessenger.cs @@ -19,7 +19,8 @@ namespace PepperDash.Essentials.AppServer.Messengers /// /// 221 /// - const uint BDialHangup = 221; + const uint BDialHangupOnHook = 221; + /// /// 251 /// @@ -134,7 +135,7 @@ namespace PepperDash.Essentials.AppServer.Messengers { CurrentCallItem.Status = (eCodecCallStatus)Enum.Parse(typeof(eCodecCallStatus), s, true); //GetCurrentCallList(); - SendCallsList(); + SendFullStatus(); }); EISC.SetStringSigAction(SCurrentCallNumber, s => @@ -162,7 +163,8 @@ namespace PepperDash.Essentials.AppServer.Messengers // Add straight pulse calls Action addAction = (s, u) => AppServerController.AddAction(MessagePath + s, new Action(() => EISC.PulseBool(u, 100))); - addAction("/endCallById", BDialHangup); + addAction("/endCallById", BDialHangupOnHook); + addAction("/endAllCalls", BDialHangupOnHook); addAction("/acceptById", BIncomingAnswer); addAction("/rejectById", BIncomingReject); addAction("/speedDial1", BSpeedDial1); diff --git a/PepperDashEssentials/AppServer/Messengers/Ddvc01VtcMessenger.cs b/PepperDashEssentials/AppServer/Messengers/Ddvc01VtcMessenger.cs index d6f20ab4..b05bc93b 100644 --- a/PepperDashEssentials/AppServer/Messengers/Ddvc01VtcMessenger.cs +++ b/PepperDashEssentials/AppServer/Messengers/Ddvc01VtcMessenger.cs @@ -123,6 +123,15 @@ namespace PepperDash.Essentials.AppServer.Messengers /// const uint BCameraModeOff = 833; + /// + /// 841 + /// + const uint BCameraSelfView = 841; + + /// + /// 842 + /// + const uint BCameraLayout = 842; /********* Ushorts *********/ @@ -330,6 +339,11 @@ namespace PepperDash.Essentials.AppServer.Messengers EISC.SetSigTrueAction(BCameraModeManual, () => PostCameraMode()); EISC.SetSigTrueAction(BCameraModeOff, () => PostCameraMode()); + EISC.SetBoolSigAction(BCameraSelfView, b => PostStatusMessage(new + { + cameraSelfView = b + })); + EISC.SetUShortSigAction(UCameraNumberSelect, (u) => PostSelectedCamera()); @@ -347,6 +361,7 @@ namespace PepperDash.Essentials.AppServer.Messengers Action addAction = (s, u) => AppServerController.AddAction(MessagePath + s, new Action(() => EISC.PulseBool(u, 100))); addAction("/endCallById", BDialHangup); + addAction("/endAllCalls", BDialHangup); addAction("/acceptById", BIncomingAnswer); addAction("/rejectById", BIncomingReject); addAction("/speedDial1", BSpeedDial1); @@ -356,6 +371,8 @@ namespace PepperDash.Essentials.AppServer.Messengers addAction("/cameraModeAuto", BCameraModeAuto); addAction("/cameraModeManual", BCameraModeManual); addAction("/cameraModeOff", BCameraModeOff); + addAction("/cameraSelfView", BCameraSelfView); + addAction("/cameraLayout", BCameraLayout); asc.AddAction("/cameraSelect", new Action(SelectCamera)); @@ -437,6 +454,7 @@ namespace PepperDash.Essentials.AppServer.Messengers { calls = GetCurrentCallList(), cameraMode = GetCameraMode(), + cameraSelfView = EISC.GetBool(BCameraSelfView), currentCallString = EISC.GetString(SCurrentCallNumber), currentDialString = EISC.GetString(SCurrentDialString), directoryContactSelected = new @@ -448,8 +466,9 @@ namespace PepperDash.Essentials.AppServer.Messengers isInCall = EISC.GetString(SHookState) == "Connected", hasDirectory = true, hasDirectorySearch = false, - hasRecents = true, + hasRecents = !EISC.BooleanOutput[502].BoolValue, hasCameras = true, + showCamerasWhenNotInCall = EISC.BooleanOutput[503].BoolValue, selectedCamera = GetSelectedCamera(), }); } diff --git a/PepperDashEssentials/AppServer/RoomBridges/CotijaDdvc01RoomBridge.cs b/PepperDashEssentials/AppServer/RoomBridges/CotijaDdvc01RoomBridge.cs index fdd73989..1720778c 100644 --- a/PepperDashEssentials/AppServer/RoomBridges/CotijaDdvc01RoomBridge.cs +++ b/PepperDashEssentials/AppServer/RoomBridges/CotijaDdvc01RoomBridge.cs @@ -27,6 +27,11 @@ namespace PepperDash.Essentials.Room.Cotija /// public const uint RoomIsOn = 301; + /// + /// 12 + /// + public const uint PrivacyMute = 12; + /// /// 41 /// @@ -38,15 +43,15 @@ namespace PepperDash.Essentials.Room.Cotija /// /// 51 /// - public const uint ActivitySharePress = 51; + public const uint ActivityShare = 51; /// /// 52 /// - public const uint ActivityPhoneCallPress = 52; + public const uint ActivityPhoneCall = 52; /// /// 53 /// - public const uint ActivityVideoCallPress = 53; + public const uint ActivityVideoCall = 53; /// /// 1 @@ -85,6 +90,14 @@ namespace PepperDash.Essentials.Room.Cotija /// public const uint ConfigIsReady = 501; /// + /// 502 + /// + public const uint HideVideoConfRecents = 502; + /// + /// 503 + /// + public const uint ShowCameraWhenNotInCall = 503; + /// /// 601 /// public const uint SourceShareDisableStartJoin = 601; @@ -319,16 +332,26 @@ namespace PepperDash.Essentials.Room.Cotija })); Parent.AddAction(@"/room/room1/defaultsource", new Action(() => - EISC.PulseBool(BoolJoin.ActivitySharePress))); - Parent.AddAction(@"/room/room1/activityVideo", new Action(() => - EISC.PulseBool(BoolJoin.ActivityVideoCallPress))); + EISC.PulseBool(BoolJoin.ActivityShare))); Parent.AddAction(@"/room/room1/activityPhone", new Action(() => - EISC.PulseBool(BoolJoin.ActivityPhoneCallPress))); + EISC.PulseBool(BoolJoin.ActivityPhoneCall))); + Parent.AddAction(@"/room/room1/activityVideo", new Action(() => + EISC.PulseBool(BoolJoin.ActivityVideoCall))); Parent.AddAction(@"/room/room1/volumes/master/level", new Action(u => EISC.SetUshort(UshortJoin.MasterVolumeLevel, u))); Parent.AddAction(@"/room/room1/volumes/master/muteToggle", new Action(() => EISC.PulseBool(BoolJoin.MasterVolumeIsMuted))); + Parent.AddAction(@"/room/room1/volumes/master/privacyMuteToggle", new Action(() => + EISC.PulseBool(BoolJoin.PrivacyMute))); + for (uint i = 2; i <= 7; i++) + { + var index = i; + Parent.AddAction(string.Format(@"/room/room1/volumes/level-{0}/level", index), new Action(u => + EISC.SetUshort(index, u))); + Parent.AddAction(string.Format(@"/room/room1/volumes/level-{0}/muteToggle", index), new Action(() => + EISC.PulseBool(index))); + } Parent.AddAction(@"/room/room1/shutdownStart", new Action(() => EISC.PulseBool(BoolJoin.ShutdownStart))); @@ -387,7 +410,6 @@ namespace PepperDash.Essentials.Room.Cotija } } })); - EISC.SetBoolSigAction(BoolJoin.MasterVolumeIsMuted, b => PostStatusMessage(new { @@ -399,6 +421,48 @@ namespace PepperDash.Essentials.Room.Cotija } } })); + EISC.SetBoolSigAction(BoolJoin.PrivacyMute, b => + PostStatusMessage(new + { + volumes = new + { + master = new + { + privacyMuted = b + } + } + })); + + for (uint i = 2; i <= 7; i++) + { + var index = i; // local scope for lambdas + EISC.SetUShortSigAction(index, u => // start at join 2 + { + // need a dict in order to create the level-n property on auxFaders + var dict = new Dictionary(); + dict.Add("level-" + index, new { level = u }); + PostStatusMessage(new + { + volumes = new + { + auxFaders = dict, + } + }); + }); + EISC.SetBoolSigAction(index, b => + { + // need a dict in order to create the level-n property on auxFaders + var dict = new Dictionary(); + dict.Add("level-" + index, new { muted = b }); + PostStatusMessage(new + { + volumes = new + { + auxFaders = dict, + } + }); + }); + } // shutdown things @@ -421,6 +485,23 @@ namespace PepperDash.Essentials.Room.Cotija // Config things EISC.SetSigTrueAction(BoolJoin.ConfigIsReady, LoadConfigValues); + + // Activity modes + EISC.SetSigTrueAction(BoolJoin.ActivityShare, () => UpdateActivity(1)); + EISC.SetSigTrueAction(BoolJoin.ActivityPhoneCall, () => UpdateActivity(2)); + EISC.SetSigTrueAction(BoolJoin.ActivityVideoCall, () => UpdateActivity(3)); + } + + + /// + /// Updates activity states + /// + void UpdateActivity(int mode) + { + PostStatusMessage(new + { + activityMode = mode, + }); } /// @@ -471,17 +552,6 @@ namespace PepperDash.Essentials.Room.Cotija rmProps.RoomPhoneNumber = EISC.StringOutput[StringJoin.ConfigRoomPhoneNumber].StringValue; rmProps.RoomURI = EISC.StringOutput[StringJoin.ConfigRoomURI].StringValue; rmProps.SpeedDials = new List(); - // add speed dials as long as there are more - up to 4 - -#warning fix speed dials - 512-515 names, 516-519 numbers - for (uint i = 512; i <= 519; i = i + 2) - { - var num = EISC.StringOutput[i].StringValue; - if (string.IsNullOrEmpty(num)) - break; - var name = EISC.StringOutput[i + 1].StringValue; - rmProps.SpeedDials.Add(new DDVC01SpeedDial { Number = num, Name = name}); - } // This MAY need a check rmProps.AudioCodecKey = "audioCodec"; @@ -575,7 +645,7 @@ namespace PepperDash.Essentials.Room.Cotija co.SourceLists.Add("default", newSl); - // build "audioCodec" config if we need + // Build "audioCodec" config if we need if (!string.IsNullOrEmpty(rmProps.AudioCodecKey)) { var acFavs = new List(); @@ -610,25 +680,11 @@ namespace PepperDash.Essentials.Room.Cotija co.Devices.Add(acConf); } + // Build Video codec config if (!string.IsNullOrEmpty(rmProps.VideoCodecKey)) { -#warning Break out these video codec favs + // No favorites, for now? var favs = new List(); - for (uint i = 0; i < 4; i++) - { - if (!EISC.GetBool(BoolJoin.SpeedDialVisibleStartJoin + i)) - { - break; - } - favs.Add(new PepperDash.Essentials.Devices.Common.Codec.CodecActiveCallItem() - { - Name = EISC.GetString(StringJoin.SpeedDialNameStartJoin + i), - Number = EISC.GetString(StringJoin.SpeedDialNumberStartJoin + i), - Type = PepperDash.Essentials.Devices.Common.Codec.eCodecCallType.Audio - }); - } - - // cameras var camsProps = new List(); @@ -689,39 +745,41 @@ namespace PepperDash.Essentials.Room.Cotija { if (ConfigIsLoaded) { - var count = EISC.UShortOutput[801].UShortValue; + var count = EISC.UShortOutput[101].UShortValue; Debug.Console(1, this, "The Fader Count is : {0}", count); // build volumes object, serialize and put in content of method below - var auxFaders = new List(); - // Create auxFaders - for (uint i = 2; i <= count; i++) - { - auxFaders.Add( - new Volume(string.Format("level-{0}", i), - EISC.UShortOutput[i].UShortValue, - EISC.BooleanOutput[i].BoolValue, - EISC.StringOutput[800 + i].StringValue, - true, - "someting.png")); - } + var auxFaderDict = new Dictionary(); + for (uint i = 2; i <= count; i++) + { + auxFaderDict.Add("level-" + i, + new Volume("level-" + i, + EISC.UShortOutput[i].UShortValue, + EISC.BooleanOutput[i].BoolValue, + EISC.StringOutput[i].StringValue, + true, + "someting.png")); + } var volumes = new Volumes(); volumes.Master = new Volume("master", EISC.UShortOutput[UshortJoin.MasterVolumeLevel].UShortValue, EISC.BooleanOutput[BoolJoin.MasterVolumeIsMuted].BoolValue, - EISC.StringOutput[801].StringValue, + EISC.StringOutput[1].StringValue, true, "something.png"); + volumes.Master.HasPrivacyMute = true; + volumes.Master.PrivacyMuted = EISC.BooleanOutput[BoolJoin.PrivacyMute].BoolValue; - volumes.AuxFaders = auxFaders; + volumes.AuxFaders = auxFaderDict; PostStatusMessage(new { + activityMode = GetActivityMode(), isOn = EISC.BooleanOutput[BoolJoin.RoomIsOn].BoolValue, selectedSourceKey = EISC.StringOutput[StringJoin.SelectedSourceKey].StringValue, volumes = volumes @@ -736,6 +794,18 @@ namespace PepperDash.Essentials.Room.Cotija } } + /// + /// Returns the activity mode int + /// + /// + int GetActivityMode() + { + if (EISC.BooleanOutput[BoolJoin.ActivityPhoneCall].BoolValue) return 2; + else if (EISC.BooleanOutput[BoolJoin.ActivityShare].BoolValue) return 1; + else if (EISC.BooleanOutput[BoolJoin.ActivityVideoCall].BoolValue) return 3; + return 0; + } + /// /// Helper for posting status message /// diff --git a/PepperDashEssentials/AppServer/Volumes.cs b/PepperDashEssentials/AppServer/Volumes.cs index 38de8ef2..cf22181a 100644 --- a/PepperDashEssentials/AppServer/Volumes.cs +++ b/PepperDashEssentials/AppServer/Volumes.cs @@ -14,11 +14,11 @@ namespace PepperDash.Essentials.Room.Cotija public Volume Master { get; set; } [JsonProperty("auxFaders")] - public List AuxFaders { get; set; } + public Dictionary AuxFaders { get; set; } public Volumes() { - AuxFaders = new List(); + AuxFaders = new Dictionary(); } } @@ -39,6 +39,13 @@ namespace PepperDash.Essentials.Room.Cotija [JsonProperty("hasMute")] public bool HasMute { get; set; } + [JsonProperty("hasPrivacyMute")] + public bool HasPrivacyMute { get; set; } + + [JsonProperty("privacyMuted")] + public bool PrivacyMuted { get; set; } + + [JsonProperty("muteIcon")] public string MuteIcon { get; set; }