Example #1
0
        /// <summary>
        /// Create a new instance.
        /// </summary>
        /// <param name="id">The identifier of the service.</param>
        /// <param name="name">The name of the service.</param>
        public ServiceItem( Station id, string name )
        {
            // Split
            int split = name.IndexOf( ',' );

            // Remember
            Index = int.Parse( name.Substring( 0, split++ ) );
            Name = name.Substring( split );
            Identifier = id;
        }
Example #2
0
 /// <summary>
 /// Erzeugt eine exakte Kopie eines Senders.
 /// </summary>
 /// <param name="other">Der zu kopierende Sender.</param>
 public Station( Station other )
     : base( other )
 {
     // Copy over
     IsEncrypted = other.IsEncrypted;
     SourceType = other.SourceType;
     IsService = other.IsService;
     Provider = other.Provider;
     Name = other.Name;
 }
Example #3
0
        /// <summary>
        /// Create a new instance and start EPG parsing on PID <i>0x12</i>.
        /// </summary>
        /// <param name="device">Related hardware device.</param>
        /// <param name="portal">The currently show station.</param>
        public ServiceParser(IDeviceProvider device, Station portal)
        {
            // Remember
            DVBDevice = device;
            Portal = portal;

            // Create EPG parser
            EPGParser = new Parser(DVBDevice);

            // Attach handler
            EPGParser.SectionFound += new Parser.SectionFoundHandler(EPGSectionFound);
        }
Example #4
0
        /// <summary>
        /// Register a <see cref="Station"/> inside this transponder.
        /// </summary>
        /// <param name="station">The station to register.</param>
        internal void AddStation(Station station)
        {
            // Validate
            if (null == station) throw new ArgumentNullException("station");

            // See if it exists
            int i = m_Stations.IndexOf(station);

            // Check mode
            if (i < 0)
            {
                // Register new
                m_Stations.Add(station);
            }
            else
            {
                // Replace existing
                m_Stations[i] = station;
            }
        }
Example #5
0
        /// <summary>
        /// Clone a station an assign it to a new transponder.
        /// </summary>
        /// <param name="transponder">The target transponder.</param>
        /// <param name="other">The prototype station.</param>
        public Station(Transponder transponder, Station other)
            : base(other.NetworkIdentifier, other.TransportStreamIdentifier, other.ServiceIdentifier)
        {
            // Must hava a transponder and a name
            if (null == transponder) throw new ArgumentNullException("transponder");

            // Remember
            TransponderName = other.TransponderName;
            m_AudioMap = other.m_AudioMap;
            VideoType = other.VideoType;
            Encrypted = other.Encrypted;
            Transponder = transponder;
            VideoPID = other.VideoPID;
            AudioPID = other.AudioPID;
            PCRPID = other.PCRPID;
            TTXPID = other.TTXPID;
            AC3PID = other.AC3PID;
            Name = other.Name;

            // Link into transponder
            Transponder.AddStation(this);
        }
Example #6
0
        /// <summary>
        /// Change the active station.
        /// </summary>
        /// <remarks>
        /// This allows the client to keep the EPG filter installed
        /// when changing stations.
        /// </remarks>
        /// <param name="station">The new station to focus upon.</param>
        public void ChangeStation(Station station)
        {
            // Update
            lock (m_SyncStation) Portal = station;

            // Clear
            lock (m_ServiceNames) m_ServiceNames.Clear();
        }
        /// <summary>
        /// Verändert die Daten einer Quelle gemäß der Konfiguration dieser Instanz.
        /// </summary>
        /// <param name="station">Die zu verändernde Quelle.</param>
        /// <exception cref="ArgumentNullException">Es wurde keine Quelle angegeben.</exception>
        public void ApplyTo( Station station )
        {
            // Validate
            if (null == station)
                throw new ArgumentNullException( "station" );

            // Blind apply - even if identifier would not match
            if (!string.IsNullOrEmpty( Name ))
                station.Name = Name;
            if (!string.IsNullOrEmpty( Provider ))
                station.Provider = Provider;
            if (IsEncrypted.HasValue)
                station.IsEncrypted = IsEncrypted.Value;
            if (IsService.HasValue)
                station.IsService = IsService.Value;
            if (SourceType.HasValue)
                station.SourceType = SourceType.Value;
        }