programming windows media player in c#

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sirmarty

    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,playL ist 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

    #2
    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 axWindowsMediaP layer1_StatusCh ange(object sender,
    EventArgs e)
    {
    Console.WriteLi ne(axWindowsMed iaPlayer1.statu s);
    }

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


    Kelly S. Elias
    Webmaster
    DevDistrict - C# Code Library



    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,playL ist 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

    Comment

    Working...