Results 1 to 2 of 2

Thread: Playlists & automaticly playing one track after the other...

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Posts
    201

    Playlists & automaticly playing one track after the other...

    Hiya Guys,

    Over the last 3 days i've been batteling with the issue of playlists. I'm currently using windows media for mp3 playback how ever i do not understand why the command "AxWindowsMediaPlayer1.Ctlcontrols.play()" doesn't start playback immediatly. I've been over this so many time in the last few days i think i've just confused my self.

    Over view of how it works... Form2 updates 1 list box with the path and 1 with the Artist & track, it then invokes the PlayMusic procedure (subroutine) on form1. However it will not begin playback until it has done all its jumpig around, gone back to form2 and closed it. Only then will playback begin.

    Surely it should begin playback as soon as the command is issued, or am i not understanding something??
    Please any help in sheding light on this would be a god send.

    Many thanks

    Dave


    ::Edit::

    oh the code might help :-D

    Friend Sub PlayMusic()
    Console.WriteLine("PlayMusic " & AxWindowsMediaPlayer1.playState)
    If AxWindowsMediaPlayer1.playState <> 3 Then
    AxWindowsMediaPlayer1.URL = (PathQueue.Items(0))
    AxWindowsMediaPlayer1.Ctlcontrols.play()
    PlayingInfo.Text = ("Now Playing :" & vbCrLf & vbCrLf & ArtistSongQueue.Items(0))
    PathQueue.Items.RemoveAt(0)
    ArtistSongQueue.Items.RemoveAt(0)
    End If

    End Sub

    Friend Sub PlayNext()
    Console.WriteLine("PlayMusic " & AxWindowsMediaPlayer1.playState)
    If CheckFlag = 1 Then
    AxWindowsMediaPlayer1.URL = (PathQueue.Items(0))
    AxWindowsMediaPlayer1.Ctlcontrols.play()
    PlayingInfo.Text = ("Now Playing :" & vbCrLf & vbCrLf & ArtistSongQueue.Items(0))
    PathQueue.Items.RemoveAt(0)
    ArtistSongQueue.Items.RemoveAt(0)
    CheckFlag = 0
    End If

    End Sub

    Friend Sub AxWindowsMediaPlayer1_PlayStateChange(ByVal sender As Object, ByVal e As AxWMPLib._WMPOCXEvents_PlayStateChangeEvent) Handles AxWindowsMediaPlayer1.PlayStateChange
    Console.WriteLine("Playstate " & AxWindowsMediaPlayer1.playState)
    If AxWindowsMediaPlayer1.playState = 8 And CheckFlag = 0 Then
    CheckFlag = CheckFlag + 1
    PlayingInfo.Text = ("Now Playing :")
    PlayNext()
    End If
    End Sub
    Last edited by QuattroDave; Jan 27th, 2009 at 03:26 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width