Example #1
0
        static void Main_PSIRun( string[] args )
        {
            // Create the server
            using (VCRServer server = new VCRServer( new DirectoryInfo( @"C:\temp\VCR.NET 3.9 Alpha\Jobs" ) ))
            {
                // Attach to the profile state of interest
                ProfileState nova = server.FindProfile( "DVB-S2" );
                ProfileState nexus = server.FindProfile( "Nexus" );

                // Report
                Console.WriteLine( "{0} {1}", nova.ProfileName, nova.NextSourceUpdateTime );
                Console.WriteLine( "{0} {1}", nexus.ProfileName, nexus.NextSourceUpdateTime );
            }
        }
        static void Main_FindRecording( string[] args )
        {
            // Create the server
            using (VCRServer server = new VCRServer( new DirectoryInfo( @"C:\temp\VCR.NET 3.9 Alpha\Jobs" ) ))
            {
                // Attach to the state of a profile
                ProfileState nexus = server.FindProfile( "Nexus" );

                // Get the next job to execute
                VCRRecordingInfo next = nexus.NextJob;

                // Get recording information for the next jon
                bool incomplete;
                VCRRecordingInfo[] hidden;
                FullInfo full = nexus.FindNextRecording( DateTime.UtcNow, out incomplete, out hidden );

                // Prepare it
                using (HardwareRequest request = nexus.CreateRecordingRequest( next, DateTime.UtcNow ))
                {
                    // Set end time
                    request.Recording.EndsAt = DateTime.UtcNow.AddSeconds( 30 );

                    // Report
                    Console.WriteLine( "Recording {0}", request.Recording.FileName );

                    // Process it
                    request.Start();

                    // Wait
                    while (request.IsRunning)
                        Thread.Sleep( 100 );
                }
            }
        }
Example #3
0
        static void Main_EPGScan( string[] args )
        {
            // Create the server
            using (VCRServer server = new VCRServer( new DirectoryInfo( @"C:\temp\VCR.NET 3.9 Alpha\Jobs" ) ))
            {
                // Attach to the profile state of interest
                ProfileState state = server.FindProfile( "DVB-S2" );

                // Report all
                Console.WriteLine( ProgramGuideManager.UpdateEnabled );
                Console.WriteLine( state.ProgramGuide.NextUpdateTime );

                // Create request
                using (ProgramGuideRequest request = state.CreateProgramGuideRequest())
                    if (null != request)
                    {
                        // Manipulate
                        request.Recording.EndsAt = DateTime.UtcNow.AddSeconds( 30 );

                        // Get the information
                        FullInfo info0 = request.CreateFullInformation();

                        // Start it
                        request.Start();

                        // Wait for end
                        for (; request.IsRunning; Thread.Sleep( 2500 ))
                            Console.WriteLine( "Collecting... {0}", DateTime.Now );

                        // Get the information
                        FullInfo info1 = request.CreateFullInformation();

                        // Report
                        Console.WriteLine( info1.Recording.TotalSize );
                    }
            }
        }