Link to home
Start Free TrialLog in
Avatar of majnun
majnun

asked on

VB .NET : cuing up mulitple files in a Windows Media Player object

I'm using the windows media player (v9) from the SDK, embedded as a control in a windows form.

I am implementing a drag drop from an array of filenames.

I know how to set the URL property to play a particular file, but how do I cue up mulitple files. I do not want to mess around with the user's media library, i just want to duplicate the drag and drop multiple files into the "Now Playing" section.

Also, an oddity, i have to rem out the following line that is created when dragging the control from the toolbox in Visual Studio to the form (wmp is the name of the windows media player object):

Me.wmp.enabled = True

Otherwise i get an error message.

Most important to me is figuring out the cuing up multiple files, if anyone understands why i need to rem out that line i'd be grateful.

Thanks!
Avatar of armoghan
armoghan
Flag of Pakistan image

I dont get it fully.
Why dont you create a simple Queue of all the Files added and show them, introduce back and forward functionality and thats it.
Avatar of majnun
majnun

ASKER

Yes, I've thought of implementing a listbox with filenames, and stepping through them with custom forward and back buttons... however, I'd imagine that the windows media player object ought to have all that functionality built in.

If I can't find a solution using wmp i'll just create my own interface for it, but i'd rather just use the wmp object to do all the work if possible.
Avatar of majnun

ASKER

If I create my own interface, does the wmp object fire an event when the current song reaches its end so I can tell it to play the next song in my custom cue?
I have lost the code for the media player which I made, but i do remember it had the song finished and start events.
Other way could be to see if duration of the song is equal to the ran file. i.e. if Duration - Current File position = 0, then the file has ended..

I had to do a similar thing so I used playlists...

They are just a modified XML file as below:

<ASX version = "3.0">
<TITLE>Basic Playlist Demo</TITLE>
    <ENTRY>
        <TITLE>An Entry in a basic playlist</TITLE>
        <AUTHOR>Microsoft Corporation</AUTHOR>
        <COPYRIGHT>(c)2000 Microsoft Corporation</COPYRIGHT>
        <REF HREF = "mms://proseware.com/path/Yourfile.wma" />
    </ENTRY>
</ASX>



This is a link to MSDN where they have a section explaining them and how to use them.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmplay10/mmp_sdk/metafileplaylists.asp

Once created they can be fed directly into the player

Simple
Avatar of majnun

ASKER

Biochemist:

I'm trying to avoid the custom playlist from showing up in the media player when used outside the application I am writing... a while ago i tried a similar approach and the playlist I added, actually showed up (in the windows media user data folder?) of the users profile... i don't want to "clutter" the users windows media player with playlists that I create with the application... do you know if the method you have suggested will have this problem?

Thanks!
I will try and find the project that I used it in and have a look... I can't remember off hand
ASKER CERTIFIED SOLUTION
Avatar of The_Biochemist
The_Biochemist

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial