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

Record using ClickToRecord XML (method ScheduleRecording)

Last post 06-15-2007, 10:09 AM by Charlie. 6 replies.
Sort Posts: Previous Next
  •  06-13-2007, 4:18 AM 3582

    Record using ClickToRecord XML (method ScheduleRecording)

    I am trying to build a simple record button in my MCML application that will record a program, using the program title that is typed in a textfield.

    I am using the AddInHost.Current.MediaCenterEnvironment.TVSchedule.ScheduleRecording(). My Click-To-Record XML file looks like this:

    <?xml version="1.0" encoding="utf-8" ?>
    <clickToRecord xmlns="urn:schemas-microsoft-com:ehome:clicktorecord">
      <body>
        <metadata>
          <description>Record program</description>
        </metadata>
        <programRecord prepadding="-300" postpadding="300" allowAlternateAirings="true">
          <program>
            <key field="urn:schemas-microsoft-com:ehome:epg:program#title" match="exact">" + ProgramTitle + "</key>
          </program>
          <airing searchSpan="180">
            <key field="urn:schemas-microsoft-com:ehome:epg:airing#starttime">2006-06-13T13:55:00Z</key>
          </airing>
        </programRecord>
      </body>
    </clickToRecord>

     

    Where ProgramTitle is the string I get withing the C# function, with the content of my textbox. When I try to run this from within MCE (after I have installed my application), I get the error message that the schedule request is invalid. I have no way of debugging so all I know is that it does not work, however I can't figure out why.

     

    I have based my XML document on the MSDN resource:

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/MedctrSDK/htm/clicktorecordclass.asp

     

    Can anyone please help me?

  •  06-13-2007, 11:23 AM 3585 in reply to 3582

    Re: Record using ClickToRecord XML (method ScheduleRecording)

    First of all, make sure you are using the freshest documentation for Click To Record XML located at http://msdn2.microsoft.com/en-us/library/bb189583.aspx.

    Second, use the Click To Record Wizard tool which ships with the SDK to create the XML, then compare to yours for troubleshooting.


    Charlie Owen (Microsoft)
  •  06-13-2007, 2:33 PM 3586 in reply to 3585

    Re: Record using ClickToRecord XML (method ScheduleRecording)

    I don't think the link is quite right! :)
  •  06-13-2007, 9:54 PM 3592 in reply to 3586

    Re: Record using ClickToRecord XML (method ScheduleRecording)

    AndyC:
    I don't think the link is quite right! :)

    ... thats one hell of a freudian slip..

    any issues you care to discuss Charlie (apple envy? lol)..

     

  •  06-14-2007, 7:40 AM 3599 in reply to 3592

    Re: Record using ClickToRecord XML (method ScheduleRecording)

    Ah, that tool worked great! Thanks a lot!!

     

    Is it also possible to get the media information for that recording that I have just scheduled? So airdate and time, title etc etc.

  •  06-15-2007, 9:23 AM 3614 in reply to 3599

    Re: Record using ClickToRecord XML (method ScheduleRecording)

    Aero1441:

    Is it also possible to get the media information for that recording that I have just scheduled? So airdate and time, title etc etc.

    Yes (for Vista Media Center).

    You can use Microsoft.MediaCenter.TV.Scheduling.EventSchdule.CreateScheduleRequest() method instead of ScheduleRecording method. You will get an instance of ScheduleRequest upon succeeded scheduling, and that object has title etc, and also one or more ScheduleEvents objects which have date and time etc.


    Hiroshi Ohno (Microsoft)
  •  06-15-2007, 10:09 AM 3616 in reply to 3614

    Re: Record using ClickToRecord XML (method ScheduleRecording)

    Whoops...! Yes, I'd like to annouce Leopard will be shipping Windows Media Center instead of Front Row / Apple TV. Also, the temperature in hell has dropped below 32 degree fahrenheit, and Steve Jobs has become CEO of Microsoft and will immediately withdraw the PC and Mac commercials.

    Link has been revised above, but here it is: http://msdn2.microsoft.com/en-us/library/bb189583.aspx


    Charlie Owen (Microsoft)
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems