John Keith
Guest
|
Posted:
Tue Aug 16, 2005 4:30 pm Post subject:
WMP Object model; How to access "player.currentMedia..." |
|
|
with out having to have the media actually playing.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmplay10/mmp_sdk/mediagetiteminfo.asp
....indicates that it is possible to access the current.media item(s) with
out having to start playback of the item. How is this done?
Here is my code so far... (this is VBA code from excel's VBE so it might be
a bit different than plain scripting.) If the line of code that starts
playback is skipped; it causes a run time error 91 "Object variable or with
block variable not set"
Sub Test2()
Dim Wmp As WindowsMediaPlayer
Set Wmp = CreateObject("WMPlayer.OCX.7")
Set FirstMedia = Wmp.mediaCollection.getAll.Item(0)
'this starts playback..
Wmp.currentMedia = FirstMedia
Dim Atts(), AtVal() As String
At_Count = Wmp.currentMedia.attributeCount
ReDim Atts(At_Count - 1), AtVal(At_Count - 1) As String
For I = 0 To At_Count - 1
Atts(I) = Wmp.currentMedia.getAttributeName(I)
AtVal(I) = Wmp.currentMedia.getItemInfo(Atts(I))
Next I
'this stops playback
Wmp.Controls.stop
End Sub
Ultimately I will be utilizing .setItemInfo to bring all of my ripped wav
files out of the <unknown> bucket.
--
Regards,
John
|
|