Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Shuffling that Playlist

badlands1[1] Matt Gertz over at the Visual Basic Team talks about his big problem with shuffling music and starts on how to solve it.  Matt's problem (and mine) is when you have your music on shuffle, the transitions could be too jarring.  In this installment, he shows you the basics at writing code against Windows Media Player.

His big three are (quoting Matt here)

  1. The player itself. Being a COM control, it gets wrapped for .NET so that you can write code against it without resorting to Declares, etc., and ends up being an object of type AxWMPLib.AxWindowsMediaPlayer. Properties on the player include which of its controls show and its visibility, whether it auto-plays (via its “Settings” property), actions such as Play and Stop (via the Ctlcontrols property), and so on.
  2. The playlist. This is the object that tells the player what media it should play. You don't “Dim” or “New” a playlist; instead, you ask the player for a new or existing playlist, and it returns an interface of type WMPLib.IWMPPlaylist to the result, on which you can then call methods.
  3. The media. Again, these are not objects that you create yourself. There are methods on the player and the playlist which will return interface values (WMPLib.IWMPMedia) for them. The playlist is made up of media objects.

Tag:

Follow the Discussion

  • RandyRandy

    ...or you could just expect WMP to support Shuffle By Album like a lot of other major players do.  That's nice because it auto-groups your shuffling by disc: it randomly picks track 1 from a disc, then plays the whole disc in order before moving onto another disc.  I've been waiting for it to appear in WMP since version 9, especially since a certain fruit-flavored player had it for the last 5 years.

  • friedfried

    Please explain how to prevent media control to play files automatically.

  • Clint RutkasClint I'm a "developer"

    @fried as you have a windows media control on your app or windows starting the application to playing them?

Remove this comment

Remove this thread

close

Comments Closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.