471,610 Members | 1,355 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,610 software developers and data experts.

programming windows media player in c#

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
Oct 28 '06 #1
1 14451
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
Sirmarty wrote:
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
Oct 28 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Mickel Grönroos | last post: by
reply views Thread by Ricky W. Hunt | last post: by
4 posts views Thread by BobAchgill | last post: by
3 posts views Thread by UJ | last post: by
1 post views Thread by sri2097 | last post: by
reply views Thread by CCCYYYY | last post: by
1 post views Thread by ZEDKYRIE | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.