public void GoToChannelIndex(int number) { if (number >= 0 && number < ChannelList.Count) { SlimTvClientMessaging.SendSlimTvClientMessage(SlimTvClientMessaging.MessageType.GoToChannelIndex, "Channel", number); } }
protected override void OnCurrentGroupChanged(int oldindex, int newindex) { base.OnCurrentGroupChanged(oldindex, newindex); UpdateChannels(); UpdatePrograms(); // Notify listeners about group change SlimTvClientMessaging.SendSlimTvClientMessage(SlimTvClientMessaging.MessageType.GroupChanged); }
protected void UpdatePrograms() { UpdateProgramsForGroup(); foreach (ChannelProgramListItem channel in _channelList) { UpdateChannelPrograms(channel); } _channelList.FireChange(); SlimTvClientMessaging.SendSlimTvClientMessage(SlimTvClientMessaging.MessageType.ProgramsChanged); UpdateProgramsState(); }
/// <summary> /// Reload all channels if channel group is changed. /// </summary> /// <param name="oldindex">Index of previous selected entry</param> /// <param name="newindex">Index of current selected entry</param> private void ReloadChannels(int oldindex, int newindex) { IList <IChannel> channels; var tvHandler = ServiceRegistration.Get <ITvHandler>(false); if (tvHandler != null && tvHandler.ChannelAndGroupInfo.GetChannels(ChannelGroups.Current, out channels)) { Channels.Clear(); Channels.AddRange(channels); Channels.FireListChanged(); // Check if the current channel is part of new group and select it int selectedChannelId = tvHandler.ChannelAndGroupInfo.SelectedChannelId; if (tvHandler.ChannelAndGroupInfo != null && selectedChannelId != 0) { Channels.MoveTo(channel => channel.ChannelId == selectedChannelId); } } // Notify listeners about group change SlimTvClientMessaging.SendSlimTvClientMessage(SlimTvClientMessaging.MessageType.GroupChanged); }
protected async Task UpdateProgramsAfterScroll(TimeSpan difference) { await updatePrograms(); SlimTvClientMessaging.SendSlimTvClientMessage(SlimTvClientMessaging.MessageType.ProgramsChanged, "MoveCursor", difference); }
protected async Task UpdatePrograms() { await updatePrograms(); SlimTvClientMessaging.SendSlimTvClientMessage(SlimTvClientMessaging.MessageType.ProgramsChanged); }
/// <summary> /// Sets the current channel group and updates the channel list. /// </summary> public void SetGroup() { FillChannelGroupList(); UpdateChannels(); SlimTvClientMessaging.SendSlimTvClientMessage(SlimTvClientMessaging.MessageType.GroupChanged); }