Esempio n. 1
0
        /// <summary>
        /// Wählt einen neuen Sender.
        /// </summary>
        /// <param name="context">Der zu wählende Sender.</param>
        /// <returns>Name des neuen Senders inklsuive der gewählten Tonspur
        /// oder <i>null</i>.</returns>
        public override string SetStation( object context )
        {
            // Stop sending data
            Accessor.Stop();

            // Restart videotext caching from scratch
            Adaptor.VideoText.Deactivate( true );

            // Change type
            var source = (VCRNETRestProxy.Source) context;

            // Change the program
            VCRNETRestProxy.TuneSync( m_serverRoot, Profile, source.source );

            // Remember
            CurrentSource = source;
            CurrentService = null;

            // Store to settings
            return (Adaptor.RemoteInfo.VCRStation = source.nameWithProvider);
        }
Esempio n. 2
0
        /// <summary>
        /// Ermittelt die aktuelle Senderliste.
        /// </summary>
        public override void LoadStations()
        {
            // Allow restriction on channels
            Favorites.EnableFavorites();

            // Reset all
            CurrentSource = null;
            CurrentService = null;
            Sources.Clear();

            // Check free TV mode
            var free = Adaptor.ChannelInfo.FreeTV;
            var pay = Adaptor.ChannelInfo.PayTV;

            // Check service type
            var radio = Adaptor.ChannelInfo.UseRadio;
            var tv = Adaptor.ChannelInfo.UseTV;

            // Get radio and video separatly
            for (int radioFlag = 2; radioFlag-- > 0; )
                foreach (var source in VCRNETRestProxy.ReadSourcesSync( m_serverRoot, Profile, radioFlag == 0, radioFlag == 1 ))
                {
                    // Add anything to map
                    Sources[SourceIdentifier.Parse( source.source )] = source;

                    // Check type
                    if (radioFlag == 1)
                    {
                        // See if radio is allowed
                        if (tv && !radio)
                            continue;
                    }
                    else
                    {
                        // See if TV is allowed
                        if (radio && !tv)
                            continue;
                    }

                    // Check encryption
                    if (source.encrypted)
                    {
                        // Only if encrypted is allowed
                        if (free && !pay)
                            continue;
                    }
                    else
                    {
                        // Only if free is allowed
                        if (pay && !free)
                            continue;
                    }

                    // Process
                    Favorites.AddChannel( source.nameWithProvider, source );
                }

            // Finished
            Favorites.FillChannelList();
        }