programming windows media player in c#

G

Guest

I am using the visual express edition 20005 for C#. I am trying to write a
program which will randomly play songs weighted by a 0 to 100 rating scale.
I can player a single song using the windows media player, but I cnnot play
music continuously. I need to either add an event handler which is triggered
by the end of a song, be able to loop while a song is being played while
testing for the end of the song or be able to add a playlist of the chosen
songs and play the playlist. I have tried to create a new playlist, using
the new playlist method, but when I try define an object of type playlist
(Playlist,playList PlayList) it doesn't recognize any of these as a defined
type.
Can someone help me with one or more of these approaches or another
alternative
 
C

Cryptik

I assume your using the Windows media SDK 9?

If so just capture the StatusChange event and then you can check the
status like this example:

private void axWindowsMediaPlayer1_StatusChange(object sender,
EventArgs e)
{
Console.WriteLine(axWindowsMediaPlayer1.status);
}

The Status will be something like "stopped" when the track is done
playing.


Kelly S. Elias
Webmaster
DevDistrict - C# Code Library
http://devdistrict.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top