Solved

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

Posted on 2004-10-21
315 Views
Last Modified: 2012-05-05
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!
0
Question by:majnun
    8 Comments
     
    LVL 18

    Expert Comment

    by:armoghan
    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.
    0
     

    Author Comment

    by:majnun
    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.
    0
     

    Author Comment

    by:majnun
    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?
    0
     
    LVL 18

    Expert Comment

    by:armoghan
    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..

    0
     
    LVL 6

    Expert Comment

    by:The_Biochemist
    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
    0
     

    Author Comment

    by:majnun
    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!
    0
     
    LVL 6

    Expert Comment

    by:The_Biochemist
    I will try and find the project that I used it in and have a look... I can't remember off hand
    0
     
    LVL 6

    Accepted Solution

    by:
    been having a bit of a play and The answer is yes and no...

    at first it doesn't add it to the playlists (on my computer anyway) but after using an individual playlist a few times (3-4 times) it does get added.

    However using WMP to play ANYTHING will get it added to their playlists eventually... I have been doing a lot of WMP and WMP encoder projects recently and my playlists have become completely mangled.

    The player unfortunately seems to have most of the inherant functionality of the propper WMP player you can download from MS including adding things to playlists... it just doesn't seem to bee too efficient at it!

    I have also tried to find any extended elements that can be added to the ASX playlists mentioned previously to stop them being added but unfortunately not.

    One thing you could try (sorry I ran out of time to look myself) though is to work out how to manipulate the WMP library i.e. check if the playlists that have been used are present in the library and then remove them - I know the functionality is available and should be documented somewhere around teh previous link I posted to MSDN as the WMP docuentation is VERY thurough (which is good gor MS!)



    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone. Privacy Policy Terms of Use

    Featured Post

    IT Security CISA, CISSP & CISM Certification

    Master the advanced techniques required to protect network resources from external threats with the IT Cyber Security bundle. Built around industry best-practice guidelines, the IT Cyber Security bundle consists of three in-depth courses.

    Suggested Solutions

    Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
    If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
    With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
    This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

    875 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now