Пример #1
0
        private void ZapTimerElapsed(object sender, EventArgs eventArgs)
        {
            // Zap to channel
            int number;

            if (!int.TryParse(ChannelNumberOrIndex, out number) || number < 1)
            {
                return;
            }

            IWorkflowManager  workflowManager = ServiceRegistration.Get <IWorkflowManager>();
            SlimTvClientModel model           = workflowManager.GetModel(SlimTvClientModel.MODEL_ID) as SlimTvClientModel;

            if (model == null)
            {
                return;
            }

            SlimTvClientSettings settings = ServiceRegistration.Get <ISettingsManager>().Load <SlimTvClientSettings>();

            if (settings.ZapByChannelIndex)
            {
                // Channel index starts by 0, user enters 1 based numbers
                number--;
                _ = model.TuneByIndex(number);
            }
            else
            {
                _ = model.TuneByChannelNumber(number);
            }

            ClearZapTimer();
        }
Пример #2
0
        public override void Save()
        {
            SlimTvClientSettings settings = SettingsManager.Load <SlimTvClientSettings>();

            settings.ShowSeriesInfo = Yes;
            SettingsManager.Save(settings);
        }
Пример #3
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.ClearAndReset();
                Channels.AddRange(channels);
                Channels.FireListChanged();
                // Check user zapping setting for channel index vs. number preferance
                SlimTvClientSettings settings = ServiceRegistration.Get <ISettingsManager>().Load <SlimTvClientSettings>();
                if (settings.ZapByChannelIndex)
                {
                    for (int i = 0; i < Channels.Count; i++)
                    {
                        Channels[i].ChannelNumber = i + 1;
                    }
                }
                // 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);
                }
            }
        }
        public override void Save()
        {
            SlimTvClientSettings settings = SettingsManager.Load <SlimTvClientSettings>();

            settings.ShowRecordingStartedNotifications = Yes;
            SettingsManager.Save(settings);
        }
Пример #5
0
 protected void UpdatePropertiesFromSettings(SlimTvClientSettings settings)
 {
     ShowChannelNames   = settings.EpgShowChannelNames;
     ShowChannelNumbers = settings.EpgShowChannelNumbers;
     ShowChannelLogos   = settings.EpgShowChannelLogos;
     ShowGenreColors    = settings.EpgShowGenreColors;
 }
Пример #6
0
        public override void Save()
        {
            SlimTvClientSettings settings = SettingsManager.Load <SlimTvClientSettings>();

            settings.RecordingNotificationDuration = (int)_value;
            SettingsManager.Save(settings);
        }
        public override void Save()
        {
            SlimTvClientSettings settings = SettingsManager.Load <SlimTvClientSettings>();

            settings.EpgNumberOfRows = (int)_value;
            SettingsManager.Save(settings);
        }
Пример #8
0
        private void ZapTimerElapsed(object sender, EventArgs eventArgs)
        {
            // Zap to channel
            int number;

            if (!int.TryParse(ChannelNumberOrIndex, out number))
            {
                return;
            }

            ClearZapTimer();

#if DEBUG_FOCUS
            ServiceRegistration.Get <MediaPortal.Common.Logging.ILogger>().Debug("EPG: ChannelZapModel goto {0}", number);
#endif
            SlimTvClientSettings settings        = ServiceRegistration.Get <ISettingsManager>().Load <SlimTvClientSettings>();
            IWorkflowManager     workflowManager = ServiceRegistration.Get <IWorkflowManager>();
            if (workflowManager.CurrentNavigationContext.WorkflowModelId == SlimTvMultiChannelGuideModel.MODEL_ID)
            {
                SlimTvMultiChannelGuideModel guide = workflowManager.GetModel(SlimTvMultiChannelGuideModel.MODEL_ID) as SlimTvMultiChannelGuideModel;
                if (guide == null)
                {
                    return;
                }
                if (settings.ZapByChannelIndex)
                {
                    // Channel index starts by 0, user enters 1 based numbers
                    number--;
                    guide.GoToChannelIndex(number);
                }
                else
                {
                    guide.GoToChannelNumber(number);
                }
                return;
            }
            SlimTvClientModel model = workflowManager.GetModel(SlimTvClientModel.MODEL_ID) as SlimTvClientModel;
            if (model == null)
            {
                return;
            }

            // Special case "0", we use it for "zap back" to tune previous watched channel
            if (number == 0)
            {
                _ = model.ZapBack();
                return;
            }

            if (settings.ZapByChannelIndex)
            {
                // Channel index starts by 0, user enters 1 based numbers
                number--;
                _ = model.TuneByIndex(number);
            }
            else
            {
                _ = model.TuneByChannelNumber(number);
            }
        }
Пример #9
0
        public override void Save()
        {
            SlimTvClientSettings settings = SettingsManager.Load <SlimTvClientSettings>();

            settings.ZapFromGuide = Yes;
            SettingsManager.Save(settings);
        }
Пример #10
0
        public override void Save()
        {
            SlimTvClientSettings settings = SettingsManager.Load <SlimTvClientSettings>();

            settings.AutoStartTV = Yes;
            SettingsManager.Save(settings);
        }
Пример #11
0
        private void ShowZapOSD()
        {
            SlimTvClientSettings settings          = ServiceRegistration.Get <ISettingsManager>().Load <SlimTvClientSettings>();
            ISuperLayerManager   superLayerManager = ServiceRegistration.Get <ISuperLayerManager>();

            superLayerManager.ShowSuperLayer(CHANNEL_ZAP_SUPERLAYER_SCREEN_NAME, TimeSpan.FromSeconds(settings.ZapTimeout));
        }
Пример #12
0
        public override void Save()
        {
            SlimTvClientSettings settings = SettingsManager.Load <SlimTvClientSettings>();

            settings.ZapByChannelIndex = Yes;
            SettingsManager.Save(settings);
        }
Пример #13
0
        public override void Save()
        {
            SlimTvClientSettings settings = SettingsManager.Load <SlimTvClientSettings>();

            settings.EpgShowGenreColors = Yes;
            SettingsManager.Save(settings);
        }
        public override void Save()
        {
            SlimTvClientSettings settings = SettingsManager.Load <SlimTvClientSettings>();

            settings.EpgVisibleHours = _value;
            SettingsManager.Save(settings);
        }
Пример #15
0
        public override void Save()
        {
            SlimTvClientSettings settings = SettingsManager.Load <SlimTvClientSettings>();

            settings.ZapTimeout = _value;
            SettingsManager.Save(settings);
        }
Пример #16
0
        public override void Save()
        {
            SlimTvClientSettings settings = SettingsManager.Load <SlimTvClientSettings>();

            settings.HideAllChannelsGroup = Yes;
            SettingsManager.Save(settings);
            _ = ChannelContext.Instance.InitChannelGroups();
        }
Пример #17
0
        private void ReSetZapTimer()
        {
            ShowZapOSD();
            SlimTvClientSettings settings = ServiceRegistration.Get <ISettingsManager>().Load <SlimTvClientSettings>();

            if (_zapTimer == null)
            {
                _zapTimer = new DelayedEvent(settings.ZapTimeout * 1000);
                _zapTimer.OnEventHandler += ZapTimerElapsed;
            }
            _zapTimer.EnqueueEvent(this, EventArgs.Empty);
        }
Пример #18
0
        /// <summary>
        /// Sets or resets the zap timer. When the timer elapses, the new selected channel is tuned.
        /// </summary>
        private void ReSetSkipTimer()
        {
            ShowOSD();
            UpdateRunningChannelPrograms(ChannelContext.Instance.Channels[_zapChannelIndex]);

            if (_zapTimer == null)
            {
                SlimTvClientSettings settings = ServiceRegistration.Get <ISettingsManager>().Load <SlimTvClientSettings>();
                _zapTimer = new DelayedEvent(settings.ZapTimeout * 1000);
                _zapTimer.OnEventHandler += ZapTimerElapsed;
            }
            // In case of new user action, reset the timer.
            _zapTimer.EnqueueEvent(this, EventArgs.Empty);
        }
 protected void UpdatePropertiesFromSettings(SlimTvClientSettings settings)
 {
     ShowChannelNames     = settings.EpgShowChannelNames;
     ShowChannelNumbers   = settings.EpgShowChannelNumbers;
     ShowChannelLogos     = settings.EpgShowChannelLogos;
     ShowGenreColors      = settings.EpgShowGenreColors;
     NumberOfRows         = settings.EpgNumberOfRows;
     VisibleHours         = settings.EpgVisibleHours;
     ZapTimeout           = settings.ZapTimeout;
     ZapFromGuide         = settings.ZapFromGuide;
     AutoStartTV          = settings.AutoStartTV;
     ShowSeriesInfo       = settings.ShowSeriesInfo;
     ZapByChannelIndex    = settings.ZapByChannelIndex;
     HideAllChannelsGroup = settings.HideAllChannelsGroup;
     ShowRecordingStartedNotifications = settings.ShowRecordingStartedNotifications;
     ShowRecordingEndedNotifications   = settings.ShowRecordingEndedNotifications;
     RecordingNotificationDuration     = settings.RecordingNotificationDuration;
     SingleChannelGuideDays            = settings.SingleChannelGuideDays;
 }