コード例 #1
0
        protected override void WillShow()
        {
            base.WillShow();

            _tabs.ButtonEvent           += TabsOnButtonEvent;
            _channelButtons.ButtonEvent += ChannelButtonsOnButtonEvent;

            if (_currentId == 0)
            {
                _tabs.SetInterlockedFeedback(1);
                _currentId = _receiverIds[1];
            }

            Device.BooleanInput[Digitals.IptvTabsVisible].BoolValue = _receiverIds.Count > 1;

            TripleCare.GetChannels(ConfigManager.Config.TriplePlayServerAddress, -1, (success, channels) =>
            {
                if (success && channels != null)
                {
                    var channelOrder = channels
                                       .OrderBy(c => c.Number)
                                       .Take((int)_channelList.MaxNumberOfItems)
                                       .ToArray();

                    CloudLog.Debug("Received {0} channels from server", channelOrder.Count());
                    try
                    {
                        _channelList.ClearList(true);
                        foreach (var channel in channelOrder)
                        {
                            _channelList.AddItem(channel.Name, channel, true);
                        }
                        _channelList.SetListSizeToItemCount();
                    }
                    catch (Exception e)
                    {
                        CloudLog.Exception(e, "Error loading channels into list");
                    }
                }
                else
                {
                    CloudLog.Warn("Could not load channel list from server");
                }
            });
        }
コード例 #2
0
        protected override void WillShow()
        {
            base.WillShow();
            _closeBtn.ButtonEvent += CloseBtnOnButtonEvent;
            _sourceButtons.ButtonEvent += SourceButtonsOnButtonEvent;
            
            Codec.Conference.Presentation.StatusChange += PresentationOnStatusChange;

            _list.ClearList(true);
            foreach (var source in UIController.Room.Sources
                .Where(s => s.Type != SourceType.VideoConference)
                .Cast<ASource>())
            {
                var index = _list.AddItem(source.Name, source, true);
                _list[index].IconNumber = (ushort) source.Icon;
            }
            _list.SetListSizeToItemCount();
            UpdateFeedback();
        }
コード例 #3
0
        private void SelectedProcessorOnUpdateReceived(OneBeyond device, UpdateFeedbackEventArgs args)
        {
            switch (args.Type)
            {
            case UpdateType.LayoutsUpdated:
                _layoutsList.ClearList();
                foreach (var item in ((Dictionary <ushort, string>)args.Value))
                {
                    _layoutsList.AddItem(item.Value, item.Key, true);
                }
                _layoutsList.SetListSizeToItemCount();
                break;

            case UpdateType.CurrentLayoutUpdated:
                _layoutsList.SetSelectedItem(_layoutsList[(ushort)args.Value]);
                break;

            case UpdateType.RoomConfigsUpdated:
                _roomConfigsList.ClearList();
                foreach (var item in ((Dictionary <ushort, string>)args.Value))
                {
                    _roomConfigsList.AddItem(item.Value, item.Key, true);
                }
                _roomConfigsList.SetListSizeToItemCount();
                break;

            case UpdateType.CurrentRoomConfigUpdated:
                _layoutsList.SetSelectedItem(_roomConfigsList[(ushort)args.Value]);
                var cameras = SelectedProcessor.GetCamerasForConfig((ushort)args.Value);
                _cameraSelectList.ClearList(true);
                SelectedCamera = null;
                foreach (var camera in cameras)
                {
                    _cameraSelectList.AddItem(camera.Name, camera, true);
                }
                _cameraSelectList.SetListSizeToItemCount();
                break;

            case UpdateType.AutoSwitchStatusUpdated:
                _autoSwitchEnableButton.Feedback = Convert.ToBoolean(args.Value);
                break;

            case UpdateType.CameraSelectUpdated:
                _cameraSelectList.SetSelectedItem(_cameraSelectList[(ushort)args.Value]);
                var cam = _cameraSelectList[(ushort)args.Value].LinkedObject as OneBeyondCameraConfig;
                if (cam != null)
                {
                    SelectedCamera = ((ASystem)UIController.System).Cameras[cam.Id];
                    Debug.WriteInfo("Selected camera", "{0} {1}", cam.Name, cam.IpAddress);
                }
                break;

            case UpdateType.RecordStatusUpdated:
                _cameraButtons[Digitals.CameraRecordBtn].Feedback = Convert.ToBoolean(args.Value);
                break;

            case UpdateType.StreamStatusUpdated:
                _cameraButtons[Digitals.CameraStreamBtn].Feedback = Convert.ToBoolean(args.Value);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }