public void GoToChannelIndex(int number)
 {
     if (number >= 0 && number < ChannelList.Count)
     {
         SlimTvClientMessaging.SendSlimTvClientMessage(SlimTvClientMessaging.MessageType.GoToChannelIndex, "Channel", number);
     }
 }
Esempio n. 2
0
 protected override void OnCurrentGroupChanged(int oldindex, int newindex)
 {
     base.OnCurrentGroupChanged(oldindex, newindex);
     UpdateChannels();
     UpdatePrograms();
     // Notify listeners about group change
     SlimTvClientMessaging.SendSlimTvClientMessage(SlimTvClientMessaging.MessageType.GroupChanged);
 }
Esempio n. 3
0
        protected void UpdatePrograms()
        {
            UpdateProgramsForGroup();
            foreach (ChannelProgramListItem channel in _channelList)
            {
                UpdateChannelPrograms(channel);
            }

            _channelList.FireChange();
            SlimTvClientMessaging.SendSlimTvClientMessage(SlimTvClientMessaging.MessageType.ProgramsChanged);
            UpdateProgramsState();
        }
Esempio n. 4
0
        /// <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);
        }
Esempio n. 7
0
 /// <summary>
 /// Sets the current channel group and updates the channel list.
 /// </summary>
 public void SetGroup()
 {
     FillChannelGroupList();
     UpdateChannels();
     SlimTvClientMessaging.SendSlimTvClientMessage(SlimTvClientMessaging.MessageType.GroupChanged);
 }