OK, so we've got our next song function now we need the previous song function, so let's head down
to our buttons and let's find our back button.
There it is.
And let's give this a command of let's call its previous underscore song.
So next song and previous song.
And let's come down here to our function section here and let's go create a function to play previous
song as defined previous song.
Now we can basically, like I said in the last video, just copy all of the stuff.
And paste it in, make sure it's tabbed over correctly and OK, what's the difference here?
Well, in the last video, we're getting the next song, so we're taking the current song and adding
one to it.
Well, if we want the previous song, we just take the current song and subtract one from it.
Right?
Very, very difficult.
So that should do it.
So let's go ahead and save this head back over here and let's run this guy.
So let's add a bunch of songs.
Let's play one.
And we can go back to.
Was.
Pick another one
stop and we're good to go, so, all right, I think we've got all of our buttons done.
We've got back Ford play, pause and stop.
And we are coming right along.
And I think you'll agree that, OK, some of these things were a little tricky.
The pause button was a little tricky.
These forward and back took a little bit of code.
But as far as just playing a song, pygame makes it just incredibly easy, right?
So, yeah, all there is to it.
So in the next video, I think we'll start to create our status bar here down at the bottom that will
show like how long the song is in minutes and seconds and things.
And you know what the current position of the song is?
If we're on if the song has been playing for 20 seconds, it'll show 20 seconds down there on the bottom
status bar.
And I think we'll start to look at that in the next video.