コード例 #1
0
        /// <summary>
        /// Erneuert die Liste der verfügbaren Sender.
        /// </summary>
        /// <remarks>
        /// Dabei werden die Einschränkungen des Anwenders bezüglich PayTV / FreeTV
        /// und Radio / Fernsehen berücksichtigt.
        /// </remarks>
        public override void LoadStations()
        {
            // Allow restriction on channels
            Favorites.EnableFavorites();

            // Encryption
            bool allowRadio   = ChannelInfo.UseRadio;
            bool allowEncrypt = ChannelInfo.PayTV;
            bool allowFree    = ChannelInfo.FreeTV;
            bool allowTV      = ChannelInfo.UseTV;

            // Process all
            foreach (SourceSelection source in Profile.AllSourcesByDisplayName)
            {
                // Convert
                Station station = (Station)source.Source;

                // Check for encryption
                if (station.IsEncrypted || station.IsService)
                {
                    // See if this is allowed
                    if (!allowEncrypt && allowFree)
                    {
                        continue;
                    }
                }
                else
                {
                    // See if this is allowed
                    if (!allowFree && allowEncrypt)
                    {
                        continue;
                    }
                }

                // Check for type
                if (station.SourceType == SourceTypes.Radio)
                {
                    // See if this is allowed
                    if (!allowRadio && allowTV)
                    {
                        continue;
                    }
                }
                else if (station.SourceType == SourceTypes.TV)
                {
                    // See if this is allowed
                    if (!allowTV && allowRadio)
                    {
                        continue;
                    }
                }

                // Register
                Favorites.AddChannel(source.DisplayName, source);
            }

            // Finished
            Favorites.FillChannelList();
        }
コード例 #2
0
        /// <summary>
        /// Ermittelt die Liste der verfügbaren Aufzeichnungen.
        /// </summary>
        public override void LoadStations()
        {
            // Nothing to do
            if (m_Paths.Length < 2)
            {
                return;
            }

            // Forbid restriction on channels
            Favorites.DisableFavorites();

            // Create the format
            var format = new string( '0', m_Paths.Length.ToString().Length );

            // Load it
            for (var i = 0; i < m_Paths.Length; ++i)
            {
                // Remember
                Favorites.AddChannel(string.Format(Properties.Resources.PartialRecording, (1 + i).ToString(format)), m_Paths[i]);
            }

            // Finish
            Favorites.FillChannelList();
        }
コード例 #3
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();
        }
コード例 #4
0
        /// <summary>
        /// Ermittelt die Liste der verfügbaren Aufzeichnungen.
        /// </summary>
        public override void LoadStations()
        {
            // Index to set default upon
            int startupIndex = -1;

            // Special
            if (m_StartupStation != null)
            {
                if (m_StartupStation.StartsWith("dvbnet:"))
                {
                    // Get the index
                    startupIndex = int.Parse(m_StartupStation.Substring(7));

                    // No direct default
                    m_StartupStation = null;
                }
            }

            // Reset current channel
            m_DefaultStation = m_StartupStation;
            m_StartupStation = null;

            // Forbid restriction on channels
            Favorites.DisableFavorites();

            // All names already in use
            var duplicates = new Dictionary <string, int>();

            // Find all current activities
            foreach (var activity in VCRNETRestProxy.GetActivitiesForProfile(Adaptor.EndPoint, Profile))
            {
                // Create the information record
                var item = new JobScheduleInfo(activity);
                var name = activity.name;

                // Read counter
                int cnt;
                if (duplicates.TryGetValue(name, out cnt))
                {
                    name = string.Format("{0} ({1})", name, cnt);
                }
                else
                {
                    cnt = 0;
                }

                // Store back
                duplicates[name] = ++cnt;

                // Add to list
                Favorites.AddChannel(name, item);

                // Remember
                if (m_DefaultStation == null)
                {
                    if ((startupIndex < 0) || (startupIndex == activity.streamIndex))
                    {
                        m_DefaultStation = name;
                    }
                }
            }

            // Finish
            Favorites.FillChannelList();
        }