Exemplo n.º 1
0
        public void SetStreamTarget(string detail, string source, Guid scheduleIdentifier, string target)
        {
            // Analyse
            var sourceIdentifier = SourceIdentifier.Parse(source);

            // Process
            ServerRuntime.VCRServer.SetStreamTarget(detail, sourceIdentifier, scheduleIdentifier, target);
        }
Exemplo n.º 2
0
        public GuideItem Find(string profile, string source, string pattern)
        {
            // Check mode
            var split = pattern.IndexOf('-');

            if (split < 0)
            {
                return(null);
            }

            // Split pattern
            var start = new DateTime(long.Parse(pattern.Substring(0, split)) * Tools.UnixTimeFactor + Tools.UnixTimeBias, DateTimeKind.Utc);
            var end   = new DateTime(long.Parse(pattern.Substring(split + 1)) * Tools.UnixTimeFactor + Tools.UnixTimeBias, DateTimeKind.Utc);

            // Forward
            return(ServerRuntime.VCRServer.FindProgramGuideEntry(profile, SourceIdentifier.Parse(source), start, end, GuideItem.Create));
        }
Exemplo n.º 3
0
        public JobScheduleInfo FindJob(string detail, string epg = null)
        {
            // May need to recreate the identifier
            if (detail.StartsWith("*"))
            {
                if (detail.Length == 1)
                {
                    detail = Guid.NewGuid().ToString("N") + Guid.NewGuid().ToString("N");
                }
                else
                {
                    detail = detail.Substring(1, 32) + Guid.NewGuid().ToString("N");
                }
            }

            // Parameter analysieren
            var schedule = ServerRuntime.ParseUniqueWebId(detail, out VCRJob job);

            // See if we have to initialize from program guide
            ProgramGuideEntry epgEntry = null;
            string            profile  = null;

            if (!string.IsNullOrEmpty(epg))
            {
                // Get parts
                var epgInfo = epg.Split(':');

                // Locate
                epgEntry = ServerRuntime.VCRServer.FindProgramGuideEntry(profile = epgInfo[1], SourceIdentifier.Parse(epgInfo[2]), new DateTime(long.Parse(epgInfo[0]), DateTimeKind.Utc));
            }

            // Information erzeugen
            return(JobScheduleInfo.Create(job, schedule, epgEntry, profile));
        }
Exemplo n.º 4
0
 public ZappingStatus Tune(string detail, string source) => ServerRuntime.VCRServer.LiveModeOperation(detail, true, null, SourceIdentifier.Parse(source), ZappingStatus.Create);
        public void GetInformations()
        {
            // Get the test source
            var testSource = Profile.FindSource(ConfigurationManager.AppSettings["Station"])[0];

            // Activate
            ServerImplementation.EndRequest(CardServer.BeginSelect(testSource.SelectionKey));

            // Create request helper
            var requestor = new RequestInformation(CardServer);

            // Remember
            var sources = ((GenericInformationResponse)requestor.BeginGetGroupInformation().Result).Strings.Select(s => SourceIdentifier.Parse(s)).ToArray();

            // Request data
            foreach (var group in ((NetworkInformationResponse)requestor.BeginGetNetworkInformation().Result).Groups)
            {
                Console.WriteLine(group);
            }

            // Resolve names
            var names = ((GenericInformationResponse)requestor.BeginGetSourceInformation(sources).Result).Strings;

            // Report
            for (int i = 0, imax = Math.Max(sources.Length, names.Length); i < imax; i++)
            {
                Console.WriteLine("{0} => {1}", sources[i], names[i]);
            }
        }
Exemplo n.º 6
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();
        }