concerning media player

renee

where do I post pause button code




Answer this question

concerning media player

  • Ilia

    Private Sub btpause_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btpause.Click
    tmr.Stop()
    If WMP.playState = WMPPlayState.wmppsPlaying Then
    WMP.Ctlcontrols.pause()


    btpause.Text = "paused"
    btpause.ForeColor = Color.Aqua
    Else
    tmr.Start()
    If WMP.playState = WMPPlayState.wmppsPaused Then

    WMP.Ctlcontrols.play()

    btpause.Text = "pause"
    btpause.ForeColor = Color.Beige
    End If
    End If
    End Sub


    how is this...

    these two lines must be copied into the btplay and btstop events
    and any other events that might be triggered whilst the btpause button is in paused mode

    btpause.Text = "pause"
    btpause.ForeColor = Color.Beige



  • John Woodiwiss

    wow that sounds complicated.....but first....this is my pause button........

    then I thought I would like a back button......dont know if it should keep repeating last song or not,

    at the moment it just rewinds the current track to start......mmmm

    what do ya think

    pause button

    Private Sub btpause_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btpause.Click

    If WMP.playState = WMPPlayState.wmppsPlaying Then

    WMP.Ctlcontrols.pause()

    tmr.Stop()

    ProgressBar.Value = ProgressBar.Value

    btpause.Text = "paused"

    btpause.ForeColor = Color.Aqua

    Else

    If WMP.playState = WMPPlayState.wmppsPaused Then

    WMP.Ctlcontrols.play()

    tmr.Start()

    btpause.Text = "pause"

    btpause.ForeColor = Color.Beige

    End If

    End If

    End Sub

    back button

    Private Sub btback_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btback.Click

    WMP.Ctlcontrols.stop()

    Static LastSong As String = "last"

    tmr.Start()

    btpause.Text = "pause"

    btpause.ForeColor = Color.Beige

    ProgressBar.Value = 0

    WMP.Ctlcontrols.play()

    End Sub



  • Jb4e

    It's still unformatted........



  • Han Qiao

    btpause.Text = "pause"

    btpause.ForeColor = Color.Beige

    ps.....these two lines have to be copied into the play and stop button events



  • KamiNoChikara

    ok . understood

    I,ll get back to you when I know how to format the code



  • Indinfer

    ok..so as I was saying

    I thought I would like to be able to make the current song repeat.....if you like a song you may wish to replay it a couple of times.......

    but the best I can do is this....which restarts the song, .

    if you catch it before the next song starts

    can you help

    Private Sub btback_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btback.Click

    WMP.Ctlcontrols.stop()

    tmr.Start()

    ProgressBar.Value = 0
    btpause.Text = "pause"
    btpause.ForeColor = Color.Beige
    WMP.Ctlcontrols.play()


    End Sub



  • Quilnux

    gorgeous! just gorgeous in every way !



  • Vajz

    Private Sub btpause_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btpause.Click

    If WMP.playState = WMPPlayState.wmppsPlaying Then

    WMP.Ctlcontrols.pause()

    tmr.Stop()

    ProgressBar.Value = ProgressBar.Value

    btpause.Text = "paused"

    btpause.ForeColor = Color.Aqua

    Else

    If WMP.playState = WMPPlayState.wmppsPaused Then

    WMP.Ctlcontrols.play()

    tmr.Start()

    btpause.Text = "pause"

    btpause.ForeColor = Color.Beige

    End If

    End If

    End Sub



  • Dan Rooney

    Here's the point. It's a burden and I recognize that. I'm here to help you.

    So in my eyes, the question becomes, to what extent are you willing to help someone who is helping you Who is to assume the burden.

    It's not easy to debug a noobie's code. It's much worse when I have to do the mental gymnastics to format your code in my head. That really distracts me from helping you. I'm really willing to work hard for people but I do have expectations. My expectation is that they do their share of the work and not have me do all of it.

    If they want to put unreadable code up, fine. In that case, I feel they haven't done everything they can to make things easy for the volunteer who is helping them. When I have questions, and I do. I go to great pains to do all possible work for the person who is going to help me. I do everything I can to support them and they know that. When I see unformatted code, I really feel that the person I'm helping isn't doing their share given that we are a team. I realize that most newbies don't know any better. But to a person who is used to reading code, that formatting is very important. We as much "feel" the code as read it. That "feel" is eradicated when code is not formated. It's like asking a coder to read the code with one eye.

    All I'm asking you to do is to make things easy for me, so I can help you.



  • Simulacrum

     

    I think if you have Word, you should cut and paste your code into Word, and then cut and paste that onto the board. If you don't have Word, you have Wordpad.

    I really don't like reading code that not's formatted and if you noticed, I never answer questions where people don't format their code and I always format mine.



  • tayeen

    sorry.cant do that.....

    I,m trying to learn vb here ..not word....sorry

    u cant teach an old dog new tricks.....it looks right in wordpad but when pasted it not......lol

    renee.....I have never used office in my life ,it dont interest me....its like me trying to teach you to plaster a wall

    give me a break....please....aint I got enough on my plate



  • pappascd

    It's described here.

    http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1049186&SiteID=1

    I'm not the only one making the request.



  • Shughes

     

    Overall your code looks pretty good.

    This does Nothing.

                    ProgressBar.Value = ProgressBar.Value

    Static LastSong As String = "last"

    I'm not quite sure what this does ..........

    One general concept. Usually when I am in a code block that is going to stop a timer. I stop it in the very first line of code in that code block. It won;t hurt you here, but not doing so can cause erratic results.   Treat timers as if they are potentially dangerous BECAUSE of the ability to cause erratic results.

    I really like that you made the pause button handle both pause and resume.

     



  • Jagjot Singh

     

    Here. I don't know what happened to the thread.

    I also have some design work for you.

    Make a Listview with

    View = Details

    Checkboxes = true

    Fullrowselect = true

    We are going to use some tricks with the listview (LV) and then  manually add the LV items

    Loading of the lv items will be driven   like the file.infos in ChooseRandomSong

    Roughly, ever so roughly, this is what loading should look like:

    Dim lvi as listviewitem

    For each file as File.infos  in fi

    If   file.extension.tolower = (“.mp3”) then

             Lvi = new listviewitem(file.name)
             lvi.tag = file.fullname
             Lvi.items.add(lvi)

    End if

    Next

    You'll notice the listview items carry the songname and listview tags receive the full path of the song.

    We'll use the contants of the tag for the player and the random routine.

    You also need to think about how to store your choices. This should keep you busy for the evening.

    Please note this is pseudo code. It's close to runnable but not quite. Any thing that's missing is in last nights'c code.

    Renee

     



  • concerning media player