1
00:00:01,840 --> 00:00:06,580
OK, so we've got our next song function now we need the previous song function, so let's head down

2
00:00:06,580 --> 00:00:10,090
to our buttons and let's find our back button.

3
00:00:10,120 --> 00:00:10,800
There it is.

4
00:00:11,200 --> 00:00:18,730
And let's give this a command of let's call its previous underscore song.

5
00:00:20,570 --> 00:00:22,310
So next song and previous song.

6
00:00:23,570 --> 00:00:33,680
And let's come down here to our function section here and let's go create a function to play previous

7
00:00:34,520 --> 00:00:37,310
song as defined previous song.

8
00:00:37,760 --> 00:00:42,920
Now we can basically, like I said in the last video, just copy all of the stuff.

9
00:00:44,300 --> 00:00:50,600
And paste it in, make sure it's tabbed over correctly and OK, what's the difference here?

10
00:00:50,990 --> 00:00:56,240
Well, in the last video, we're getting the next song, so we're taking the current song and adding

11
00:00:56,240 --> 00:00:56,820
one to it.

12
00:00:57,100 --> 00:01:02,630
Well, if we want the previous song, we just take the current song and subtract one from it.

13
00:01:02,630 --> 00:01:02,870
Right?

14
00:01:02,900 --> 00:01:03,870
Very, very difficult.

15
00:01:04,160 --> 00:01:05,660
So that should do it.

16
00:01:05,690 --> 00:01:09,380
So let's go ahead and save this head back over here and let's run this guy.

17
00:01:14,110 --> 00:01:16,000
So let's add a bunch of songs.

18
00:01:17,150 --> 00:01:18,450
Let's play one.

19
00:01:19,950 --> 00:01:22,500
And we can go back to.

20
00:01:32,520 --> 00:01:33,060
Was.

21
00:01:34,110 --> 00:01:34,980
Pick another one

22
00:01:38,880 --> 00:01:44,330
stop and we're good to go, so, all right, I think we've got all of our buttons done.

23
00:01:44,340 --> 00:01:47,130
We've got back Ford play, pause and stop.

24
00:01:47,400 --> 00:01:48,720
And we are coming right along.

25
00:01:48,720 --> 00:01:52,920
And I think you'll agree that, OK, some of these things were a little tricky.

26
00:01:52,920 --> 00:01:54,120
The pause button was a little tricky.

27
00:01:54,120 --> 00:01:55,950
These forward and back took a little bit of code.

28
00:01:56,130 --> 00:02:00,420
But as far as just playing a song, pygame makes it just incredibly easy, right?

29
00:02:00,450 --> 00:02:02,690
So, yeah, all there is to it.

30
00:02:02,700 --> 00:02:07,620
So in the next video, I think we'll start to create our status bar here down at the bottom that will

31
00:02:07,620 --> 00:02:12,600
show like how long the song is in minutes and seconds and things.

32
00:02:12,780 --> 00:02:15,450
And you know what the current position of the song is?

33
00:02:15,670 --> 00:02:20,520
If we're on if the song has been playing for 20 seconds, it'll show 20 seconds down there on the bottom

34
00:02:20,520 --> 00:02:21,120
status bar.

35
00:02:21,390 --> 00:02:23,400
And I think we'll start to look at that in the next video.
