The Media Center Sandbox

Resources and discussion for developing experiences in the Windows Media Center platform.
Welcome to The Media Center Sandbox Sign in | Join | Help
in Search

Getting recording events

Last post 08-16-2008, 1:18 AM by ifflanb. 2 replies.
Sort Posts: Previous Next
  •  04-17-2007, 1:41 AM 2693

    Getting recording events

    I am working on an app for Vista MCE, and I have run into a problem... I am trying to get notified when a recording is scheduled or cancelled (or finished / changed). I have tried using the EventSchedule.ScheduleEventStateChanged, but I do not get a notification when a recording is scheduled (just like I expected from the documentation). Is there some way of getting this information?

    Ofcourse I could enumerate the scheduled recordings in an "infinite" loop and check for addition / removal of recordings, but I do not like that solution very much.

  •  04-25-2007, 1:15 AM 3028 in reply to 2693

    Re: Getting recording events

    (Resending - text editor did not work for me...)

    Hello Principher,

    Regarding the ScheduleEventStateChanged event, the following example should be notified on recording start / finish / cancel. When the schedule is newly created, that may not be notified. That is by the specification of this feature at this moment. From SDK document: "The following state changes are not notified: State change from None to any other state when creating a scheduled recording event."

    Hope this helps.

    ---

    public class EventListener {
        protected void OnScheduleEventStateChanged(object sender, ScheduleEventChangedEventArgs e)
        {
            int count = e.Changes.Length;
            for (int i = 0; i < count; i++)
            {
                Console.WriteLine("ScheduleEvent Id=\"{0}\"", e.Changes[i].ScheduleEventId);
                Console.WriteLine("  PreviousState: {0}", e.Changes[i].PreviousState.ToString());
                Console.WriteLine("  NewState: {0}", e.Changes[i].NewState.ToString());
            }
        }

        public static void Main(string[] args)
        {          
            EventSchedule scheduler = new EventSchedule();
            EventListener listener = new EventListener();
            scheduler.ScheduleEventStateChanged += listener.OnScheduleEventStateChanged;

            System.Threading.Thread.Sleep(600000); // 10 minutes
            scheduler.ScheduleEventStateChanged -= listener.OnScheduleEventStateChanged;
        }
    }
     

     

     

  •  08-16-2008, 1:18 AM 8108 in reply to 2693

    Re: Getting recording events

    Hi. Did you manage to get notification for when a recording is scheduled in Media Center? I am trying to do the same and any help would be appreciated.

    thanks

View as RSS news feed in XML
Powered by Community Server, by Telligent Systems