tags:

views:

126

answers:

2

I have Windows Vista MCML app, and I need to figure out the current name of the file playing.

The Media Center SDK alludes to using MediaMetadata["Title"] to get this information, unfortunately this does not work with playlists (.wpl) files as there is no method for getting the position in the playlist.

A: 

Have you tried:

MediaContext.GetProperty(TrackTitle)

I've also seen samples that in the markup for the media display layout file they specify an element such as:

<music-title duration = "2000" x="69" y="29" width="187" height="20"/>

Good Luck!

Jason Stevenson
+1  A: 

Turns out this can not be easily done.

There are 4 options.

  1. Never use play lists, in that case MediaMetadata["Title"] is good enough.
  2. Examine remote file handles in ehshell.exe.
  3. Inject a remote thread in ehshell.exe, establish communication and use reflection to read it.
  4. Write a DirectShow filter and communicate with it.

Update: This is fixed in Windows 7. It is unclear if its going to be back ported to Vista MCE yet.

Second Update: Looks like Microsoft have changed the behavior of MediaMetadata["Title"] in a recent hotfix, it now returns both the filename without an extension and the playlist name.

Sam Saffron