The Windows Media Center Platform Team Blog RSS 2.0
 Wednesday, November 21, 2007

Working through the last revision of the SDK I found it was really hard to discern the development environment for successfully developing a Windows Media Center application -- mainly because you can't read what we write before installing the SDK...! :-)

So, let me take a moment to give you what I consider the bare minimum install set for a development machine in the order they should be installed.

Windows Vista Home Premium or Windows Vista Ultimate

Visual C# 2005 Express Edition
http://go.microsoft.com/fwlink/?LinkId=51411

Visual C# 2005 Express Edition SP1
http://download.microsoft.com/download/7/7/3/7737290f-98e8-45bf-9075-85cc6ae34bf1/VS80sp1-KB926749-X86-INTL.exe

Visual Studio 2005 Service Pack 1 Update for Windows Vista
http://download.microsoft.com/download/c/7/d/c7d9b927-f4e6-4ab2-8399-79a2d5cdfac9/VS80sp1-KB932232-X86-ENU.exe

Visual C# 2008 Express Edition
http://go.microsoft.com/?linkid=7729278

Windows Media Center Software Development Kit 5.3
http://www.microsoft.com/downloads/details.aspx?familyid=a43ea0b7-b85f-4612-aa08-3bf128c5873e

I've put these links over on the navigation bar at http://blog.mediacentersandbox.com as well for future reference.

Charlie

Categories: SDK | Comments [0] | # | Posted on Wednesday, November 21, 2007 11:38:23 PM (GMT Standard Time, UTC+00:00)   
 Monday, November 19, 2007

An updated version of the Windows Media Center Software Development Kit is now available for download from http://www.microsoft.com/downloads/details.aspx?familyid=a43ea0b7-b85f-4612-aa08-3bf128c5873e&displaylang=en. This is the same link as before so no need to change your bookmarks. These links also persist in the navigation section at http://blog.mediacentersandbox.com/.

Here is a list of what's new or changed with this release...

MCML Preview Tool Automation Model
An improved automation model allows a tools developer to load an MCML file, refresh the current view, and close or get the position and size of the current instance. New command-line switches specify a folder to watch and automatically refresh when any resource in the folder changes.

Changes to the MCML Preview Tool Launcher
The improved MCML Preview Tool Launcher takes advantage of the new MCML Preview Tool automation model and command-line switches.

Additional Documentation on Animations in MCML

Check out the new or improved documentation on these topics:

  • Working with Animations in MCML
  • Using Keyframes in Animation
  • Applying Interpolations to Keyframes
  • Setting the Weight on Interpolations
  • Playing Different Types of Animations in Response to Events

MCML Animation Explorer
MCML Animation Explorer is a new tool that helps developers learn animation in MCML. Instead of writing XML you can work with a bunch of knobs and switches in a graphical user interface and see the resulting MCML as well as the visuals in the MCML Preview Tool.

New Visual Studio Templates
The following templates have been added for C#:

  • The Windows Media Center Application – Background template creates a project for a Windows Media Center background application.
  • The Windows Media Center Application – Fundamental template creates a project that provides a basic framework for creating a Windows Media Center application.

Visual Studio 2008 Support
The application templates now work with Visual Studio 2008.

Deprecated Features
The following platform features have been deprecated with this release:

  • Hosting for Microsoft .NET Framework 3.0 Extensible Application Markup Language (XAML) browser applications (XBAPs).
  • The Triple-tap / Soft-keyboard ActiveX control for hosted HTML applications.
  • Support for using alternative shells to run and host HTML applications.
Categories: SDK | Comments [12] | # | Posted on Monday, November 19, 2007 11:52:28 PM (GMT Standard Time, UTC+00:00)   
 Thursday, October 25, 2007

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 5:49:34 AM (GMT Standard Time, UTC+00:00)   
 Wednesday, October 03, 2007

PowerPlaylist adds a custom Start Menu strip with up to five tiles to Windows Media Center in Windows Vista. Each tile represents an audio, slideshow and / or visualization combination which will start when the tile is selected. PowerPlaylist is very customizable by the consumer using the PowerPlaylist Editor, including the title of the custom Start Menu strip and the name, image, audio source, slideshow folder and visualization for each tile. It's over on CodePlex.com so has full source code available with the Microsoft Permissive License.

Check it out at http://www.codeplex.com/powerplaylist.

Categories: Sample | Comments [0] | # | Posted on Wednesday, October 03, 2007 3:42:19 AM (GMT Standard Time, UTC+00:00)   
 Saturday, September 22, 2007

The day after the geek dinner Scott Hanselman and I sat down to chat about developing for Windows Media Center for Hanselminutes 82. The result is a pretty nice introduction to what you need for development, the tools included in the SDK, some of the samples which are included in the SDK and some basic beginner concepts. Here is a detailed list of links which corresponds to the various topics we covered during the podcast.

Enjoy...!

2:15 Software Development Kit http://www.microsoft.com/downloads/details.aspx?familyid=a43ea0b7-b85f-4612-aa08-3bf128c5873e&displaylang=en
2:29 Visual C# 2005 Express Edition http://msdn2.microsoft.com/en-us/express/aa975050.aspx
2:38 Media Center Markup Language http://msdn2.microsoft.com/en-us/library/bb189823.aspx
3:40 MCML Preview Tool http://msdn2.microsoft.com/en-us/library/bb189325.aspx
6:30 Z Sample Application http://blog.mediacentersandbox.com/IntroducingTheZSampleApplication.aspx
11:46 Remoting of the User Interface http://blog.mediacentersandbox.com/AQuickPeekUnderTheHoodPartOneOfFour.aspx and http://blog.mediacentersandbox.com/AQuickPeekUnderTheHoodPartTwoOfFour.aspx (we never got around to parts 3 and 4 -- they would have been much deeper than we really needed to go).
12:15 Remote Control and Input Handlers http://msdn2.microsoft.com/en-us/library/bb189195.aspx
18:08 Managed Code Object Model http://msdn2.microsoft.com/en-us/library/ms816271.aspx
19:00 Application Types Which Leverage MCML: Local and Web http://msdn2.microsoft.com/en-us/library/ms816272.aspx
21:00 Installation and Registration of Applications http://msdn2.microsoft.com/en-us/library/ms815407.aspx
23:10 Q Sample Application (Screenshot) http://play.mediacentersandbox.com/sample/5/q/screencap.png
24:14 MCML Sampler (Screenshot) http://play.mediacentersandbox.com/sample/5/mcmlsampler/screencap.png
25:01 Databinding in MCML http://msdn2.microsoft.com/en-us/library/bb188939.aspx
26:28 Defining a <UI> http://msdn2.microsoft.com/en-us/library/bb189704.aspx
27:37 <UI> Properties http://msdn2.microsoft.com/en-us/library/bb189635.aspx
28:04 Media Center Sandbox http://blog.mediacentersandbox.com
28:30 Visual Studio 2008 'Orcas' Templates from Aaron Stebner http://blogs.msdn.com/astebner/archive/2007/09/11/4873223.aspx
28:45 Using the Visual Studio Templates http://msdn2.microsoft.com/en-us/library/bb189732.aspx

Categories: Resources | Sample | SDK | Template | Comments [5] | # | Posted on Saturday, September 22, 2007 3:39:28 AM (GMT Standard Time, UTC+00:00)   
 Friday, September 14, 2007

I'm pleased to announce the addition of Steven Harding to our Community Dev Expert team joining Niall and Andrew.

Steven is the author of Yougle, MoreWithMyMusic and EMUCenter for Windows Media Center in Windows Vista and several other experiences built for prior versions of Windows Media Center. He also has created a poker game timer which tells you the current blinds, the current ante and how long until they next go up -- all with text-to-speech announcements of blind increases and warnings when they are getting near.

In addition, he is a contributor to the The Digital Lifestyle Developer Blog (part of the excellent group of resources made available by Ian Dixon over at http://thedigitallifestyle.com/cs/).

Steven has contributed over 400 posts to our developer forums over at http://discuss.mediacentersandbox.com making him one of the most prolific and helpful individuals in the community. His passion for Windows Media Center and the platform shine through in his postings and advocacy on behalf of other developers.

You can identify Steven in the forums by his rather esoteric alias of IgnoranceIsBliss in the forums (perhaps he'll comment here on how he decided on that moniker) as well as a new banner in his postings that looks like this:

Congratulations, Steven -- certainly well deserved.

Categories: Discussion | Comments [0] | # | Posted on Friday, September 14, 2007 6:32:20 AM (GMT Standard Time, UTC+00:00)   
 Wednesday, September 12, 2007

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 Tuesday, September 11, 2007 11:46:07 PM (GMT Standard Time, UTC+00:00)   
 Saturday, August 25, 2007

Use this guide to replace the button in the application template with the one from the Z sample application. This is a good example of separation of logic/data from the visuals enabling development of each to remain separate in a distributed development environment.

1.       Start a new application with the Windows Media Center Application template and complete the application as outlined in the readme.htm file.

2.       Using Windows Explorer copy the following files from the Z sample application source folder into the corresponding new application folders, overwriting existing files if present:

a.        \Markup\Button.mcml

b.       \markup\Styles.mcml

c.        \images\ButtonFocus.png

d.       \images\ButtonNonFocus.png

3.       Select the Images folder in Solution Explorer.

4.       Select Project > Add Existing Item from the menu.

5.       In the Add Existing Item dialog:

a.        Select Image Files in the Files of type drop down list.

b.       Navigate to the \Images folder for the project and multi-select ButtonFocus.png and ButtonNonFocus.png by clicking on them with the mouse while holding down the Control key on the keyboard.

c.        Click the Add button.

6.       Open Resources.resx for editing.

7.       In Resources.resx:

a.        Press Control+2 on the keyboard to switch to images.

b.       Drag and drop ButtonFocus.png, ButtonNonFocus.png and ButtonNonFocus.png from the Solution Explorer into Resource.resx to embed these files in the assembly.

8.       Double click \Markup\Button.mcml in Solution Explorer for to open for editing.

9.       Find and replace every instance of "resx://Z/Z" with "resx://[ApplicationName]/[ApplicationName]" where [ApplicationName] is the name of your project. For example: "resx://Z/Z.Resources/Styles" would read "resx://Application1/Application1.Resources/Styles"

10.    Double click \Markup\Styles.mcml in Solution Explorer for to open for editing.

11.    In Styles.mcml:

a.        Delete the following MCML: <Image Name="ContainerImage" Source="resx://Z/Z.Resources/Container" NineGrid="40,40,40,40"/>

b.       Add the following MCML: <Color Name="BackgroundColor" Color="Black"/>

c.        Find and replace every instance of "resx://Z/Z" with "resx://[ApplicationName]/[ApplicationName]" where [ApplicationName] is the name of your project.

12.    Select Compile and test using DevInstall.cmd or create the MSI as outlined in readme.htm to install and test.

Categories: Template | Comments [0] | # | Posted on Saturday, August 25, 2007 3:39:47 AM (GMT Standard Time, UTC+00:00)   
Blogroll
About

Disclaimer
All information available via this site is provided 'as is' with no warranties and confers no rights.

© Copyright 2008 Microsoft Corporation.

Sign In
All Content © 2008, Microsoft Corporation.