This sample would be classified in the 'fun' category of neat things you can do with MCML and animations. Enjoy...!

<Mcml xmlns="http://schemas.microsoft.com/2006/mcml"
   xmlns:sys="assembly://mscorlib/System"
   xmlns:me="Me">

 <UI Name="Move">

  <Locals>
   <!-- A ListDataSet that handles content / order change events -->
   <ArrayListDataSet Name="MyList">
    <Source>
     <sys:String String="a"/>
     <sys:String String="b"/>
     <sys:String String="c"/>
     <sys:String String="d"/>
     <sys:String String="e"/>
     <sys:String String="f"/>
     <sys:String String="g"/>
     <sys:String String="h"/>
     <sys:String String="i"/>
     <sys:String String="j"/>
     <sys:String String="k"/>
     <sys:String String="l"/>
     <sys:String String="m"/>
     <sys:String String="n"/>
     <sys:String String="o"/>
     <sys:String String="p"/>
     <sys:String String="q"/>
     <sys:String String="r"/>
     <sys:String String="s"/>
     <sys:String String="t"/>
     <sys:String String="u"/>
     <sys:String String="v"/>
     <sys:String String="w"/>
     <sys:String String="x"/>
     <sys:String String="y"/>
     <sys:String String="z"/>
    </Source>
   </ArrayListDataSet>

   <!-- A timer that fires every now and then to kick off a move event. -->
   <Timer Name="Timer" Interval="100" AutoRepeat="true" Enabled="true"/>

   <!-- Values that hold the old and new index to used with the Move() method -->
   <!-- to affect the position of individual items in the ArrayListDataSet. -->
   <sys:Int32 Name="OldIndex" Int32="0"/>
   <sys:Int32 Name="NewIndex" Int32="0"/>

   <!-- A random used to generate values for OldIndex and NewIndex. -->
   <sys:Random Name="RandomGenerator"/>
  </Locals>

  <Rules>
   <!-- A rule that evaluates for each tick of the timer. -->
   <Changed Source="[Timer.Tick]">
    <Actions>
     <!-- Generate a random start and end index -->
     <Invoke Target="[RandomGenerator.Next]" maxValue="[MyList.Count]" ResultTarget="[OldIndex]" ExclusiveApply="false"/>
     <Invoke Target="[RandomGenerator.Next]" maxValue="[MyList.Count]" ResultTarget="[NewIndex]" ExclusiveApply="false"/>

     <!-- Invoke the Move() method which will modify the order -->
     <!-- of the ArrayListDataSet -->
     <Invoke Target="[MyList.Move]" oldIndex="[OldIndex]" newIndex="[NewIndex]"/>

     <!-- View the changes made to the indexes using a tool like DebugView to view. -->
     <!-- See
http://www.microsoft.com/technet/sysinternals/utilities/debugview.mspx -->
     <DebugTrace Message="Moving from from {0} to {1}">
      <Params>
       <ObjectPath ObjectPath="[OldIndex]"/>
       <ObjectPath ObjectPath="[NewIndex]"/>
      </Params>
     </DebugTrace>
    </Actions>
   </Changed>
  </Rules>

  <Content>
   <Repeater Source="[MyList]" Layout="HorizontalFlow">
    <Content>
     <!-- The UI used for our item, passing in the Index and value from -->
     <!-- the ArrayListDataSet. -->
     <me:Item Index="[RepeatedItemIndex]" Value="[RepeatedItem!sys:String]">
      <Animations>
       <!-- Each time the index changes for the ArrayListDataItem -->
       <!-- run this animation. Depending on the timer interval this can have -->
       <!-- a cumulative effect as the animation is applied across the range -->
       <!-- determined by the random number generator for OldIndex and NewIndex. -->
       <!-- A timer interval of 100 or less demonstrates this effect well. -->
       <Animation Type="Move">
        <Keyframes>
         <PositionKeyframe Time="0.00" RelativeTo="Current" Interpolation="SCurve"/>
         <PositionKeyframe Time="0.15" RelativeTo="Current" Value="0,-20,0"/>
         <PositionKeyframe Time="0.35" RelativeTo="Final" Value="0,-20,0"/>
         <PositionKeyframe Time="0.50" RelativeTo="Final" Interpolation="SCurve"/>
        </Keyframes>
       </Animation>
      </Animations>
     </me:Item>
    </Content>
   </Repeater>
  </Content>
 </UI>

 <UI Name="Item">

  <Properties>
   <!-- These are set as each item is created in the repeater. -->
   <Index Name="Index" Index="$Required"/>
   <sys:String Name="Value" String="$Required"/>
  </Properties>

  <Rules>
   <!-- Bind the index. Note when the index changes we see the change reflected -->
   <!-- in the visuals without any explicit code setting the value. -->
   <Binding Source="[Index.Value.ToString]" Target="[IndexLabel.Content]"/>
  </Rules>

  <Content>
   <Panel Layout="VerticalFlow">
    <Children>
     <!-- The text from the ArrayListDataSet which is repeated. -->
     <Text Content="[Value]" Color="White" Font="Courier New, 24"/>
     <!-- The index of the item in the ArrayListDataSet. -->
     <Text Name="IndexLabel" Color="Gray" Font="Courier New, 12">
      <Animations>
       <!-- Each time the index changes animate the number beneath the text. -->
       <!-- Like the other animation this can have a cumulative effect -->
       <!-- as the timer interval is lowered. -->
       <Animation Type="ContentChangeHide">
        <Keyframes>
         <PositionKeyframe Time="0.00" RelativeTo="Current" Interpolation="Log"/>
         <PositionKeyframe Time="0.50" RelativeTo="Current" Value="0,100,0"/>
         <AlphaKeyframe Time="0.00" RelativeTo="Current" Interpolation="Log"/>
         <AlphaKeyframe Time="0.50" RelativeTo="Current" Value="0"/>
        </Keyframes>
       </Animation>
      </Animations>
     </Text>
    </Children>
   </Panel>
  </Content>

 </UI>

</Mcml>



Categories: Sample | Comments [0] | # | Posted on Thursday, October 25, 2007 6:49:34 AM (GMT Daylight Time, UTC+01:00)   

This sample demonstrates how to use the PlaySound Element with the Timer Class to create a playback loop which does not use the PlayMedia Method and therefore is not reflected in the Windows Media Center user experience.

<Mcml xmlns="http://schemas.microsoft.com/2006/mcml">

 <UI Name="Default">

  <Locals>
   <Timer Name="MyTimer" Interval="10000" Enabled="true" AutoRepeat="true"/>
  </Locals>

  <Rules>
   <Rule>
    <Conditions>
     <Modified Source="[MyTimer.Tick]" InitialEvaluate="true"/>
    </Conditions>
    <Actions>
     <!-- MyContent.wav is of a known length which     -->
     <!--is slightly shorter than the interval defined -->
     <!--in the timer.                                 -->
     <PlaySound Sound="
file://MyContent.wav"/>
    </Actions>
   </Rule>
  </Rules>

  <Content>
   <Text Content="PlaySound + Timer" Color="White"/>
  </Content>

 </UI>

</Mcml>



Categories: Sample | Comments [0] | # | Posted on Wednesday, September 12, 2007 12:46:07 AM (GMT Daylight Time, UTC+01:00)   

Aaron's got a great writeup on this over at his personal blog: Mailbag: How can I create a loading page for an MCML application?



Categories: Sample | Comments [3] | # | Posted on Saturday, March 3, 2007 3:51:22 PM (GMT Standard Time, UTC+00:00)   

I recently undertook an exercise to convert the installer source files for the Q sample application in the Windows Media Center SDK from WiX v2.0 to WiX v3.0.  Since I wasn't sure how much general interest this topic would have, I posted an item on my personal blog that describes this experience.

Of particular interest to me in WiX v3.0 is the Votive Visual Studio 2005 add-in.  Votive allows you to create a WiX project (.wixproj) and include it in the solution for your Windows Media Center application.  Then, you can easily configure Visual Studio to rebuild your application binaries and repackage the MSI sequentially.  You can also use MSBuild to perform these build steps if you would like to script your build process instead of using the Visual Studio IDE.

For folks working on creating deployment solutions for Windows Media Center applications, I encourage you to check out this blog post and download the sample setup source files and build scripts that are included in the post.

You can find the blog post at http://blogs.msdn.com/astebner/archive/2006/12/10/converting-the-q-sample-application-setup-to-use-wix-v3-0-and-votive.aspx.

Aaron

 



Categories: Sample | Comments [0] | # | Posted on Wednesday, December 13, 2006 1:08:38 AM (GMT Standard Time, UTC+00:00)   

For years we have had folks ask us for a complete end to end sample. Allow me to take a brief moment of your time and introduce you to our newest family member...

Z

Here are screenshots of what you get with this sample application which debuts with the Windows Media Center Software Development Kit we are making available today:

An on screen keyboard designed to work especially well for remote control (while still working quite naturally for mouse and keyboard). For example, Channel Up / Down allows you to cycle through pages of characters (we ship EN-US uppercase, lowercase and symbols) without having to navigate off of the characters themselves. You can expand the number of pages by adding additional MCML to the source. A commented QWERTY version is already present in the source if you prefer that approach for your end users.

The login page demonstrates a typical username, password and remember me functionality. It's not actually wired up to anything for authentication, but provides a ready made example appropriate for most login experiences.

The top level navigation ('Main Menu') features a nice animation to highlight the row which has current focus. The hypothetical Z company is a triple play, offering great content for Movies, TV and Music. You will begin to notice the animated 'living' background and multiple levels of transparency within and across objects.

The main menu features promotional items which can drill down to the detail page for that item. A good bit of Z is data driven using XML and the SDK includes the Microsoft Access database used to create the XML for developers who want to start with Z and expand features.

Selecting the Movies item takes us to the gallery featuring all movies. The galleries have working filters similar to the pivot points in Windows Media Center. Here we begin to see that in Z, content is king. The design is heavily weighted towards highlighting the images associated with the content and a de-emphasis of the user interface elements.

Selecting one of the items in the gallery takes us to the details page where content is really highlighted with a full screen image. Note the alpha blending of graphics. This is also a good chance to point out the Z main menu logo at the top as well as the Search and Downloads buttons at the bottom which persist on almost every page in Z.

After selecting the Preview button you are treated to the graphics alpha blended on top of a full screen video. In this case it's a sample from the Windows Media High Definition Showcase.

After selecting the Purchase button, Z begins the download of the content using a download manager service (again, full source code included in the SDK) which runs in the background. You can exit out of Z and even close Windows Media Center and the download will continue. By default, downloaded files are placed in \users\public\videos\ so they can be viewed in the Windows Media Center Videos gallery. Note the dialog box customization with Z logo.

Navigating down to and selecting the Downloads button takes us to a page where we can monitor the status of all current downloads, complete with working progress bar.

Here we see the TV gallery which showcases reuse of the same focus elements as other galleries but sized differently and arranged in two rows. In addition, the TV feature is 'deeper' than Movies -- it features 'Shows' which can be selected to see the 'Episodes'. This is designed to show how flexible the databinding is in Media Center Markup Language.

Drilling down to one of the TV episode items ('Error Amice') takes you to a details page which demonstrates use of the FindService method. As with Movie Preview we have alpha blended graphics (we can't show you a screen shot of that because we don't have rights to the images in the TV show -- but it works :-).

Selecting the 'Poena Commemorandum' item in the TV strip on the Main Menu takes you to a details page where you can schedule an individual recording using the Click To Record API. Note the Dialog box customization with the show image instead of the Z logo.

The Music feature in Z is designed to enumerate files and folders located in \users\public\music\ and offer them up to the user. This was one of the last features we implemented and we didn't have time to 'make it pretty' via interop with Windows Media Player to get additional metadata and album art. There have been a few requests from end users to be able to walk folders and this example provides a good starting point. When you select and individual music file we add it to the queue using the PlayMedia method. If there are no other items in the queue it immediately starts playing.

Z implements a search feature which returns results from the data XML and allows you to navigate directly to the detail page for the items found in the search. This works for Movies and TV but we didn't get around to enabling music. (Ah, work to book for vNext...!) It's also important to note anytime you navigate to a text box you can invoke the on screen keyboard.

At the top of every Z page (with the exception of login, main menu and on screen keyboard) there is a 'back to main' button which allows you to return to the Z Main Menu at any time. It's a graceful animation when it gets focus and the logo 'expands' to show the 'back to main' text.

Here I've brought up the mouse navigation and transport toolbars. Our design team did a great job making the 'back to main' button conform to the SDK guidelines for mouse overlays while at the same time giving it 'feature parity' with the Green Button and Back buttons native on the mouse toolbar.

Z was a wonderful group effort leveraging a great team both internal and external to Microsoft. A huge word of 'Thanks...!' goes out to the following folks.

The 'Softies...

Brian Kralyevich, Design Manager and Kristina Voros, Usability Engineer were invaluable in working with Method (see below) to make sure our design and usability was awesome and elegant.

Chris Glein, Software Development Engineer was responsible translating the design and making it a reality for the bulk of the data + logic (managed code) and UI (Media Center Markup Language).

Jeff Bogdan, Software Development Engineer took on the stretch goal of implementing the download manager using the new Windows Communication Foundation.

Michael Creasy, Software Design Engineer for Test and Reza Khoshbin provided the testing to make sure Z worked well and delivered what we said we wanted. Michael also provided some of the photography you find in Z.

Aaron Stebner, Program Manager provide a ton of testing, code reviews, developer scripts, Visual Studio integration, source code control and the wonderful Wix (http://wix.sourceforge.net/) installer files which makes it super easy for developers to compile and build a ready made MSI with this sample out of the box.

Michael Palermiti and Lars Giusti provided images from their personal photography collection.

And our partners...

Method (http://www.method.com/) in San Francisco did a great job working with the design and usability team here at Microsoft to envision a back story for the hypothetical Z company as well as come up with several elegant (and highly usable) designs which really made 'the content king' as we requested. Let me give props to Wendy McKennon - Senior Interaction Designer, Tomas Celizna - Senior Designer, Jon Arnett - Senior Designer, Aaron Clinger - Design Technologist, Darcy DiNucci - Interaction Director, Robert Murdock - Design Director, David Nelson - Senior Design Technologist and Galen Myers - Relationship/Account Manager. You guys utterly ROCK...!

Thomas Hawk provided the bulk of the wonderful photos from his personal collection. We wanted some images which would really inspire designers and developers alike and evoke emotion to represent TV and movies. It is very gratifying to highlight the work of a capable photographer who is also an end user fan of Windows Media Center and a passionate blogger.

Watch for a subsequent post today on where you can go to download the Windows Media Center Software Development Kit 5.0. Once you've gotten the SDK we encourage you to compile this app, install and give it a whirl...!



Categories: Application | Sample | SDK | Comments [7] | # | Posted on Saturday, November 18, 2006 12:32:07 AM (GMT Standard Time, UTC+00:00)   

One of the developers on our team recently created a sample Windows Media Center Presentation Layer web application that demonstrates how to utilize a Host object to access data that is created dynamically on a server without requiring the page to reload.  This technique can be particularly useful when you want to update some content on a page that contains numerous assets that you do not want to re-download and/or if you want to avoid visible flashing and transitions for page reloads.

There are two components to this sample - the sample UI and the sample data generation file.

Sample UI component

A live version of the sample UI can be found at http://play.mediacentersandbox.com/Sample.DataTransfer.mcml.  It contains 2 UI elements: a DataTransfer UI, and the main UI.

DataTransfer UI

The DataTransfer UI is an abstraction layer that encapsulates the functionality of loading new data into an already visible MCML page. 

Consumers that want to use this DataTransfer object need to provide the following properties:

  • A ResultSet (which is an ArrayListDataSet object) to store the results of the server-side data generation
  • A RequestStatus (which is an EditableText object) to store the current status of the data transfer
  • A TargetSource (which is a string) to specify the URL where the data should come from
  • A RefreshCommand (which is a Command object) that will invoke a data refresh

Main UI

The main UI contains an example of a common usage scenario using the DataTransfer UI. It contains the following elements:

  • An instance of the DataTransfer UI
  • A button that triggers the DataTransfer object to refresh its data when invoked (this could be easily modified to automatically refresh the data by using a timer instead of a button that the user has to click)
  • A Text field to display the status of the data transfer - it is bound to the RequestStatus that is returned by the DataTransfer object
  • A Repeater to display the updated data - it is bound to the ResultSet that is returned by the DataTransfer object

Sample data generation file

A live version of the sample data generation file can be found at http://play.mediacentersandbox.com/RandomData.aspx.  The source code for it looks like this:

<%@ Page Language="C#" %>
<% Response.ContentType = "text/xml"; %><%Response.Expires=0; %>
<% Random r = new Random(); %>
<Mcml
    xmlns="http://schemas.microsoft.com/2006/mcml"
    xmlns:cor="assembly://MSCorLib/System"
    xmlns:me="Me"
>

  <UI Name="Result">
    <Properties>
      <ArrayListDataSet Name="ResultSet">
        <Source>
          <cor:String String="Random.Next = <%=r.Next()%>" />
          <cor:String String="Random.Next = <%=r.Next()%>" />
          <cor:String String="Random.Next = <%=r.Next()%>" />
          <cor:String String="Random.Next = <%=r.Next()%>" />
          <cor:String String="Random.Next = <%=r.Next()%>" />
          <cor:String String="Random.Next = <%=r.Next()%>" />
        </Source>
      </ArrayListDataSet>
    </Properties>
  </UI>

</Mcml>

You can try out this example on your Windows Vista Home Premium or Ultimate Edition RC1 or later system by downloading this RegisterMceApp XML file and running RegisterMceApp.exe <path to codeless_datatransfer_example.xml>

When you register this XML file, you will have an entry named Data Transfer Sample in the Program Library.  When you launch the sample in Windows Media Center and click the Load New Data button, the ResultSet object will be populated with 6 new random numbers, and since the ResultSet is bound to the repeater on the client UI, the data in the repeater will automatically update each time you click the button without requiring the entire page to refresh.  The UI will look like the following:

A couple of additional notes

  1. Keep in mind that due to the security restrictions in place for Windows Media Center Presentation Layer Web Applications, the UI page and the data generation page must both be hosted on the same web domain for this scenario to work as expected.  For this sample, both are hosted on the play.mediacentersandbox.com domain
  2. This scenario demonstrates a relatively simple dynamic data scenario.  For a more involved example of how to dynamically switch hosts, see the sample in McmlSampler named AdvancedMarkup.HostViewItem.mcml

Aaron

 



Categories: Sample | Comments [1] | # | Posted on Wednesday, October 4, 2006 2:14:38 AM (GMT Daylight Time, UTC+01:00)   

By default, when a user clicks on an entry point in the Windows Media Center UI to launch a Windows Media Center application, a new instance of the Windows Media Center hosting process (ehExtHost.exe) is created and a new instance of the application is started within that hosting process.

 

In addition, Windows Media Center maintains a back stack of up to 8 applications so that the user can press the back button on the remote control and return to the previous experience.  If a user clicks on an application entry point more than once, each instance of the application is also added to the Windows Media Center back stack up to the limit of 8 instances.

 

Because of this back stack behavior, it is possible to have up to 8 instances of the same Windows Media Center application running in separate ehExtHost processes on the user’s system.  Having multiple instances of the same Windows Media Center application running on the system simultaneously can cause the following problems: 

  • Performance – large applications can quickly consume a lot of system resources and slow down the overall system performance.  This is particularly problematic for hosted XBAP applications because XBAPs are hosted by another executable named PresentationHost.exe in addition to ehExtHost.exe.
  • Shared resources – if a Media Center application reads from and writes to shared data sources on the file system or in the registry, having multiple instances running at the same time can cause resource contention problems, race conditions and other problems in the application code. 

It is possible to code a Windows Media Center application to prevent multiple instances from being launched and running at the same time on the user’s system.  Jossef Goldberg, a program manager on the Windows Presentation Foundation (WPF) team, has posted a sample application to demonstrate how to accomplish this.  His example, which can be downloaded from this location, provides sample code for an XBAP application, but the concepts can be applied equally to Media Center Markup Language (MCML) applications or Windows Media Center Presentation Layer background applications.

 

This sample application includes 2 pieces:

  1. A stub application entry point that is used to ensure single instancing
  2. The “real” application entry point that contains the code and UI that the user sees within Windows Media Center

Both entry points are registered with Windows Media Center using the RegisterApplication API or the RegisterMceApp utility.  However, only the stub entry point will appear within the Windows Media Center UI and allow the user to click on it to invoke it.  The real entry point is registered with a hidden category so that the user cannot invoke it directly, which allows the stub entry point to manage invokation of the real entry point.

A mutex is created at the beginning of the Launch method in the stub entry point that is called by Windows Media Center when the user clicks on an entry point in the UI.  If the mutex is acquired successfully, the stub entry point code calls the LaunchEntryPoint API to create a new instance of the real entry point.  If the mutex is already held and cannot be created, the stub entry point code calls the ReturnToApplication API to navigate to the instance of the real entry point that is already running in the Windows Media Center back stack.

 

The following is an example implementation of the Launch method for a Windows Media Center stub entry point that can be used to ensure that at most a single instance of an application will be running at any given time.  You will need to replace <application_guid> and <entrypoint_guid> with the actual GUID values for your real entry point.

public void Launch(AddInHost host)
{
    // Create a named Mutex to check if an instance of this application is already running
    bool bMyMutexWasCreated;
    Mutex myMutex = new Mutex(true, "MyMediaCenterMutex", out bMyMutexWasCreated);

    if (!bMyMutexWasCreated) 
    {
      // If we get here, the application is already running; bring it to the foreground
      host.ApplicationContext.ReturnToApplication();
    }
    else
    {
      // If we get here, the application is not running; launch it now
      host.MediaCenterEnvironment.LaunchEntryPoint(new Guid("{<application_guid>}"), new Guid("{<entrypoint_guid>}"), null);     
    }
}

You can also try out a runnable XBAP sample application that implements the above algorithm by downloading the ZIP file at this location and following the instructions in LaunchSingleInstance_ReadMe.doc inside of the ZIP file.

Aaron

 



Categories: Sample | Comments [2] | # | Posted on Sunday, September 17, 2006 8:16:13 PM (GMT Daylight Time, UTC+01:00)   

Update: I added a few stations and changed the registration to use the /allusers switch (so this will show up on Media Center Extender) so pay attention to the setup instructions below.

Coding Friday resulted in a little Windows Media Center Presentation Layer Web Application called Veronicas Radio, named after a Program Manager on the Windows Media Center team who came to me one day and said 'hey, it would be cool if I could have all of my favorite streaming radio stations in a customized UI, just for me'. At least I remember the conversation going something like that. Anywho...

I took the helix we did for the Q app (see http://play.mediacentersandbox.com/mcml/rc1/helix.mcml for the codeless version) and added a call to PlayMedia to create a streaming radio URI. After applying a Gaussian blur to one of the sample pictures which ship with Windows to represent a background (nice pink) and station images (culled / created from their respective websites) we now have something that looks like this in Windows Media Center...

You can install this web app to your Diamond RC1 machine as follows:

  1. Download http://play.mediacentersandbox.com/mcml/rc1/setup.veronicasradio.zip
  2. Unzip the contents to your local machine.
  3. Open a command prompt with Administrator priviledges.
  4. Run setup.veronicasradio.cmd.
  5. Launch Windows Media Center and Select ‘Veronicas Radio’ in Program Library.

We think it would be pretty cool to see what other mods or hacks folks could do with the helix. Hit this URL with IE > View Source: http://play.mediacentersandbox.com/mcml/rc1/veronicasradio.mcml, modify to your liking, post to your own web server, post an installer (everything you need is in the install download for Veronicas Radio) and let's see what neat mashups you can create.

Charlie



Categories: Sample | Comments [1] | # | Posted on Saturday, September 16, 2006 12:26:48 AM (GMT Daylight Time, UTC+01:00)   

Hi, I'm Peter Dampier a Program Manager in the eHome division at Microsoft. Many thanks to Aaron and Charlie for this blog and the opportunity to post here.  One of the new features in Windows Vista Media Center post Beta 2 is extensibility for adding HD DVD and/or Blu-ray Disc movie playback to Windows Media Center in Vista.   I thought I'd spend a few moments here to explain this functionality...

There are two main features: 

  1. The ability to launch a third party playback application when a HD DVD or BD disc is inserted into the drive and MCE is full screen.  If MCE is not full screen then the regular 2’ Windows auto play is used.
  2. The ability to launch a third party application if a HD DVD or BD disc is in the optical drive and “Play DVD’ is selected from the MCE start menu

 To register your HD DVD or BD playback app there are two new categories for application registration:

 AutoPlay\HD DVD

 And

 AutoPlay\Blu-ray

Two examples are below.  These will register Notepad.exe to launch when MCE is full screen and a HD DVD is inserted and for Calc.exe to launch when a Blu-ray Disc is inserted.  These could also be regular native MCE applications (e.g. HTML/ActveX, MCML or XBAP).  For external .exe's the application developer will need to ensure that they restore MCE to its previous postion after the .exe closes.  A demonstration of how this can be done is available with the MCE games that ship in Vista (check out MCE's Program Library Game content).  Without this the user will be left in a state where they need to reach for the mouse or keyboard after finishing HD DVD playback in the external application versus automatically being returned to MCE. 

 

To use these samples save the XML below to c:\notepad.xml and c:\calc.xml.  Then register the apps with:

 

C:\Windows\ehome\RegisterMCEApp.exe /allusers c:\notepad.xml

C:\Windows\ehome\RegisterMCEApp.exe /allusers c:\calc.xml

 

To un-register:

 

C:\Windows\ehome\RegisterMCEApp.exe /u /allusers c:\notepad.xml

C:\Windows\ehome\RegisterMCEApp.exe /u /allusers c:\calc.xml

 

For the applications to show up in the regular MCE Program library they will also need to be registered against other categories with a separate registration.

 

XML for HD DVD – Launch notepad.exe:

 <application title="Notepad" id="{ABCE8379-F381-47b8-AE3D-EF6ADE750500}" companyname="Sample Company" companylogourl="http://company/icon2.jpg" description="HD DVD App">

    <entrypoint id="{ABCE8379-F381-47b8-AE3D-EF6ADE750501}" RUN="c:\windows\notepad.exe" title="Notepad (Sample HDDVD App)" description="Notepad - a text editor">

        <category category="AutoPlay\HD DVD"/>

    </entrypoint>

</application>

 

XML for Blu-ray Disc – Launch calc.exe

 

<application title="Notepad" id="{2C5ECB67-E585-4301-BAF4-5380FE6C26AB}" companyname="Sample Company" companylogourl=" http://company/icon2.jpg" description="BD App">

    <entrypoint id="{2C5ECB67-E585-4301-BAF4-5380FE6C26AB}" RUN="c:\windows\System32\Calc.exe" title="Calculator (Sample Blu-Ray App)" description="Calculator application ">

        <category category="AutoPlay\Blu-ray"/>

    </entrypoint>

</application>

 

If more than one application is registered against each category then the user is presented with a page to select the playback app they wish to use.

If no applications are registered the following dialogs appear:

 

 

 

Peter.



Categories: Sample | Comments [10] | # | Posted on Tuesday, August 15, 2006 4:25:19 AM (GMT Daylight Time, UTC+01:00)   
RSS
RSS 2.0
Search
Sign In | All Content © 2014 Charlie Owen

This is a personal weblog. The opinions expressed here represent my own and not those of my employer.


Powered by newtelligence dasBlog 2.3.9074.18820