Connecting Tech Pros Worldwide Help | Site Map

programming windows media player in c#

Sirmarty
Guest
 
Posts: n/a
#1: Oct 28 '06
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
Cryptik
Guest
 
Posts: n/a
#2: Oct 28 '06

re: programming windows media player in c#


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:
Quote:
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
Closed Thread