/// <summary> /// Sets feedback for the given room /// </summary> public void SetFeedbackForRoom(EssentialsHuddleSpaceRoom room) { var itemToSet = Items.FirstOrDefault(i => i.Room == room); if (itemToSet != null) { SetFeedback(itemToSet.Index, true); } }
void SetCurrentRoom(EssentialsHuddleSpaceRoom room) { if (_CurrentRoom == room) { return; } // Disconnect current (probably never called) room.ConfigChanged -= room_ConfigChanged; room.ConfigChanged += room_ConfigChanged; RefreshCurrentRoom(room); }
public SmartObjectRoomsListItem(EssentialsHuddleSpaceRoom room, uint index, SmartObjectRoomsList parent, Action <bool> buttonAction) { Room = room; Parent = parent; Index = index; if (room == null) { return; } // Set "now" states parent.SetItemMainText(index, room.Name); UpdateItem(room.CurrentSourceInfo); // Watch for later changes room.CurrentSourceChange += new SourceInfoChangeHandler(room_CurrentSourceInfoChange); parent.SetItemButtonAction(index, buttonAction); }
/// <summary> /// Helper for property setter. Sets the panel to the given room, latching up all functionality /// </summary> public void RefreshCurrentRoom(EssentialsHuddleSpaceRoom room) { if (_CurrentRoom != null) { // Disconnect current room _CurrentRoom.CurrentVolumeDeviceChange -= this.CurrentRoom_CurrentAudioDeviceChange; ClearAudioDeviceConnections(); _CurrentRoom.CurrentSourceChange -= this.CurrentRoom_SourceInfoChange; DisconnectSource(_CurrentRoom.CurrentSourceInfo); _CurrentRoom.ShutdownPromptTimer.HasStarted -= ShutdownPromptTimer_HasStarted; _CurrentRoom.ShutdownPromptTimer.HasFinished -= ShutdownPromptTimer_HasFinished; _CurrentRoom.ShutdownPromptTimer.WasCancelled -= ShutdownPromptTimer_WasCancelled; _CurrentRoom.OnFeedback.OutputChange -= CurrentRoom_OnFeedback_OutputChange; _CurrentRoom.IsWarmingUpFeedback.OutputChange -= CurrentRoom_IsWarmingFeedback_OutputChange; _CurrentRoom.IsCoolingDownFeedback.OutputChange -= IsCoolingDownFeedback_OutputChange; } _CurrentRoom = room; if (_CurrentRoom != null) { // get the source list config and set up the source list var config = ConfigReader.ConfigObject.SourceLists; if (config.ContainsKey(_CurrentRoom.SourceListKey)) { var srcList = config[_CurrentRoom.SourceListKey]; // Setup sources list uint i = 1; // counter for UI list foreach (var kvp in srcList) { var srcConfig = kvp.Value; if (!srcConfig.IncludeInSourceList) // Skip sources marked this way { continue; } var actualSource = DeviceManager.GetDeviceForKey(srcConfig.SourceKey) as Device; if (actualSource == null) { Debug.Console(1, "Cannot assign missing source '{0}' to source UI list", srcConfig.SourceKey); continue; } var routeKey = kvp.Key; var item = new SubpageReferenceListSourceItem(i++, SourcesSrl, srcConfig, b => { if (!b) { UiSelectSource(routeKey); } }); SourcesSrl.AddItem(item); // add to the SRL item.RegisterForSourceChange(_CurrentRoom); } SourcesSrl.Count = (ushort)(i - 1); } // Name and logo TriList.StringInput[UIStringJoin.CurrentRoomName].StringValue = _CurrentRoom.Name; if (_CurrentRoom.LogoUrl == null) { TriList.BooleanInput[UIBoolJoin.LogoDefaultVisible].BoolValue = true; TriList.BooleanInput[UIBoolJoin.LogoUrlVisible].BoolValue = false; } else { TriList.BooleanInput[UIBoolJoin.LogoDefaultVisible].BoolValue = false; TriList.BooleanInput[UIBoolJoin.LogoUrlVisible].BoolValue = true; TriList.StringInput[UIStringJoin.LogoUrl].StringValue = _CurrentRoom.LogoUrl; } // Shutdown timer _CurrentRoom.ShutdownPromptTimer.HasStarted += ShutdownPromptTimer_HasStarted; _CurrentRoom.ShutdownPromptTimer.HasFinished += ShutdownPromptTimer_HasFinished; _CurrentRoom.ShutdownPromptTimer.WasCancelled += ShutdownPromptTimer_WasCancelled; // Link up all the change events from the room _CurrentRoom.OnFeedback.OutputChange += CurrentRoom_OnFeedback_OutputChange; CurrentRoom_SyncOnFeedback(); _CurrentRoom.IsWarmingUpFeedback.OutputChange += CurrentRoom_IsWarmingFeedback_OutputChange; _CurrentRoom.IsCoolingDownFeedback.OutputChange += IsCoolingDownFeedback_OutputChange; _CurrentRoom.CurrentVolumeDeviceChange += CurrentRoom_CurrentAudioDeviceChange; RefreshAudioDeviceConnections(); _CurrentRoom.CurrentSourceChange += CurrentRoom_SourceInfoChange; RefreshSourceInfo(); (Parent as EssentialsPanelMainInterfaceDriver).HeaderDriver.SetupHeaderButtons(this, CurrentRoom); } else { // Clear sigs that need to be TriList.StringInput[UIStringJoin.CurrentRoomName].StringValue = "Select a room"; } }
/// <summary> /// Sets up Header Buttons for the EssentialsHuddleSpaceRoom type /// </summary> public void SetupHeaderButtons(EssentialsHuddlePanelAvFunctionsDriver avDriver, EssentialsHuddleSpaceRoom currentRoom) { HeaderButtonsAreSetUp = false; TriList.SetBool(UIBoolJoin.TopBarHabaneroDynamicVisible, true); var roomConf = currentRoom.PropertiesConfig; // Register for the PopupInterlock IsShowsFeedback event to tie the header carets subpage visiblity to it Parent.AvDriver.PopupInterlock.StatusChanged -= PopupInterlock_StatusChanged; Parent.AvDriver.PopupInterlock.StatusChanged += PopupInterlock_StatusChanged; SetUpGear(avDriver, currentRoom); SetUpHelpButton(roomConf); uint nextJoin = 3953; nextJoin = SetUpEnvironmentButton(Parent.EnvironmentDriver, nextJoin); // blank any that remain for (var i = nextJoin; i > 3950; i--) { TriList.SetString(i, "Blank"); TriList.SetSigFalseAction(i, () => { }); } HeaderButtonsAreSetUp = true; }