Quantcast
Channel: Media Foundation Development for Windows Desktop forum
Viewing all articles
Browse latest Browse all 1079

SetItemInfo for a playlist directly...not through the embedded AxWindowsMediaPlayer1

$
0
0

I have a program that creates and accesses Windows Media Playlists (for audio / *.wma files).

Recently, I have tried to set attributes, other than: Title and Author. When I try using SetItemInfo("<attribute>","<attribute value>"), the <attribute> does not save back to the permanent *.wpl file. In other words, if I use for example:

wmpMyPlaylistCollection = AxWindowsMediaPlayer1.playlistCollection
wmpMyPLArray = wmpMyPlaylistCollection.getByName(<SomePlayListName>)

wmpMyPlaylist.setItemInfo("UserCustom1", "ThisIsATest")

and then try and access it:

Debug.Print("UserCustom1: " & wmpMyPlaylist.getItemInfo("UserCustom1"))

This is my output:

UserCustom1: ThisIsATest

And if I use the code:

For IX = 0 To wmpMyPlaylist.attributeCount - 1
  Debug.Print(IX & "). " & wmpMyPlaylist.attributeName(IX).ToString)
Next

one of the Debug.Print statements will produce: UserCustom1

However, if I go back and re-select the wmpMyPlaylist from the library via the first 2 lines of the code:

wmpMyPlaylistCollection = AxWindowsMediaPlayer1.playlistCollection
wmpMyPLArray = wmpMyPlaylistCollection.getByName(<SomePlayListName>)
Then:
Debug.Print("UserCustom1: " & wmpMyPlaylist.getItemInfo("UserCustom1"))

will produce:
UserCustom1: <and a blank here>

and the for next loop:

For IX = 0 To wmpMyPlaylist.attributeCount - 1
  Debug.Print(IX & "). " & wmpMyPlaylist.attributeName(IX).ToString)
Next

will not have the entry: UserCustom1

By doing some research, I found the MSDN Library entry for:

IWMPMedia::setItemInfo method

which states in the "Remarks" section:

If you embed the Windows Media Player control in your application, file attributes that you change will not be written to the digital media file until the user runs Windows Media Player.

So...how can I call the setItemInfo against the playlist, without running it through the embedded "AxWindowsMediaPlayer1".

Anybody know how to do this?

Thanks for your time in advance.



Paul D. Goldstein Forceware Systems, Inc.


Viewing all articles
Browse latest Browse all 1079

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>