Sam Saffron
Sam Saffron

Reputation: 131112

How do I get the filename of the currently playing file in Vista Media Center?

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.

Upvotes: 2

Views: 389

Answers (2)

Sam Saffron
Sam Saffron

Reputation: 131112

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.

Upvotes: 1

Jason Stevenson
Jason Stevenson

Reputation: 4000

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!

Upvotes: 0

Related Questions