views:

625

answers:

0

I'm looking to synchronize media libraries from other programs to Windows Media Player via .NET (specifically C#) code. The other programs allow for Smart Playlists and I would like to preserve that in Windows Media Player (WMP) now that it is capable of it as well. From what I can tell it's only possible to create the Smart Playlist through the interactive UI and not through interop code. I've found that it's possible to create a static playlist through something like the following:

WMPLib.WindowsMediaPlayerClass wmpCore = new WMPLib.WindowsMediaPlayerClass();
WMPLib.IWMPPlaylist playlist = wmpCore.playlistCollection.newPlaylist("Some New Playlist");
playlist.insertItem(0, ...);

The problem is that this is a static list. Does anybody have any advice/pointers for making Smart Playlists? Worst case I suppose I could force it by creating the WPL playlist file as it is just XML and import that into WMP, but something about that method seems like a bad hack.