Shuffling that Playlist

Published 01 November 07 08:43 AM | Coding4Fun 

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.
Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Randy said on November 1, 2007 1:47 PM:

...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.

# Coding4Fun : Shuffling that Playlist | Music said on December 31, 2007 12:44 AM:

PingBack from http://music.247blogging.info/?p=491

Leave a Comment

(required) 
(optional)
(required) 
Page view tracker