static void Main3(string[] args) { // Attach to job manager VCRServer server = new VCRServer(new DirectoryInfo(@"C:\temp\VCR.NET 3.9 Alpha\Jobs")); JobManager jobs = server.JobManager; // Get the profile Profile nexus = VCRProfiles.FindProfile("Nexus"); // Find the next recording VCRRecordingInfo rec = jobs.FindNextJob(new DateTime(2009, 2, 19, 20, 0, 0), null, nexus); if (null != rec) { if (rec.StartsAt.HasValue) { using (RecordingRequest recording = jobs.CreateRecording(rec, rec.StartsAt.Value, nexus)) { // Get the information FullInfo info0 = recording.CreateFullInformation(); // Start it recording.BeginExecute(false); // Report Console.WriteLine("Recording..."); Console.ReadLine(); // Get the information FullInfo info1 = recording.CreateFullInformation(); } } } // Done Console.WriteLine("Done"); Console.ReadLine(); }
static void Main1(string[] args) { // Attach to job manager VCRServer server = new VCRServer(new DirectoryInfo(@"C:\temp\VCR.NET 3.9 Alpha\Jobs")); JobManager jobs = server.JobManager; // Process all profiles foreach (Profile profile in VCRProfiles.Profiles) { // Report Console.WriteLine(profile.Name); // Start time DateTime start = DateTime.UtcNow; // Process a bit for (int i = 10; i-- > 0;) { // Helper data VCRRecordingInfo[] included; bool inComplete; // Find the recording FullInfo info = jobs.FindNextRecording(start, profile, out inComplete, out included); VCRRecordingInfo rec = info.Recording; VCRJob job = jobs[rec.JobUniqueID.Value]; VCRSchedule sched = job[rec.ScheduleUniqueID.Value]; // Report Console.WriteLine("\t{0} {1} {2} ({3}) {4} {5} {6} {7}", rec.StartsAt.Value.ToLocalTime(), rec.EndsAt.ToLocalTime().TimeOfDay, job.Name, sched.Name, inComplete, included.Length, rec.JobUniqueID, rec.ScheduleUniqueID); // Report foreach (VCRRecordingInfo include in included) { Console.WriteLine("\t\t{0} {1} {2} {3} {4}", include.Source.GetUniqueName(), include.StartsAt.Value.ToLocalTime(), include.EndsAt.ToLocalTime().TimeOfDay, include.JobUniqueID, include.ScheduleUniqueID); } // Report foreach (StreamInfo stream in info.Streams) { foreach (ScheduleInfo schedule in stream.Schedules) { Console.WriteLine("\t\t{0} {1} {2} {3}", schedule.JobUniqueID, schedule.ScheduleUniqueID, schedule.StartsAt.ToLocalTime(), schedule.EndsAt.ToLocalTime().TimeOfDay); } } // Advance start = rec.EndsAt; } // Helper data VCRRecordingInfo[] incDummy; bool dummyFlag; // Start timer Stopwatch timer = Stopwatch.StartNew(); // Measure for (int n = 0; ++n > 0;) { // Find the recording jobs.FindNextRecording(DateTime.UtcNow, profile, out dummyFlag, out incDummy); // Get the time TimeSpan delta = timer.Elapsed; if (delta.TotalSeconds >= 5) { // Report Console.WriteLine("{0}ms", delta.TotalMilliseconds / n); // Done break; } } } // Get the profile Profile nexus = VCRProfiles.FindProfile("Nexus"); // Find the next recording VCRRecordingInfo rec2 = jobs.FindNextJob(new DateTime(2009, 2, 19, 20, 0, 0), null, nexus); if (null != rec2) { if (rec2.StartsAt.HasValue) { using (RecordingRequest recording = jobs.CreateRecording(rec2, rec2.StartsAt.Value, nexus)) { // Get the information FullInfo info0 = recording.CreateFullInformation(); #if EXEC // Start it recording.BeginExecute(false); // Report Console.WriteLine("Recording..."); Console.ReadLine(); // Get the information FullInfo info1 = recording.CreateFullInformation(); #endif } } } // Done Console.WriteLine("Done"); Console.ReadLine(); }