1
00:00:01,800 --> 00:00:07,020
OK, so we've got our play function now, we want to deal with our stop button, so let's come down

2
00:00:07,020 --> 00:00:10,020
here to the stop button and here it is.

3
00:00:10,500 --> 00:00:12,540
And let's give this a command.

4
00:00:14,520 --> 00:00:15,930
Equal stop.

5
00:00:16,290 --> 00:00:18,820
All right, so there we go.

6
00:00:18,840 --> 00:00:20,630
So let's not create that stop function.

7
00:00:20,650 --> 00:00:28,770
So underneath our play function, let's go create stop function and let's define, stop and what do

8
00:00:28,770 --> 00:00:29,300
we want to do?

9
00:00:29,310 --> 00:00:33,210
So to stop a song, it's actually really, really simple.

10
00:00:34,020 --> 00:00:39,180
We just go, actually, I'm just going to copy this whole thing and paste it in.

11
00:00:39,360 --> 00:00:47,330
So pygame, that mixer, that music does stop and we don't need to pass anything and that will work.

12
00:00:47,340 --> 00:00:48,930
So let's go out and save this and run it.

13
00:00:50,820 --> 00:00:55,250
So pull this over, add a bunch of songs you.

14
00:00:57,410 --> 00:00:58,490
And let's play one.

15
00:01:01,540 --> 00:01:04,300
And we could stop and it stops now.

16
00:01:05,940 --> 00:01:06,610
Check this out.

17
00:01:06,630 --> 00:01:12,420
This green bar is still here, even though we're not playing, maybe we want that to go away when we

18
00:01:12,420 --> 00:01:13,280
click the stop button.

19
00:01:15,070 --> 00:01:19,300
To sort of designate that it has stopped or something that eventually were going to be a little counter

20
00:01:19,300 --> 00:01:24,760
down here at the bottom, that shows seconds of a song and like as it's moving along, the count will

21
00:01:24,760 --> 00:01:27,670
increase, you know, one second, two seconds, five seconds, 10 seconds.

22
00:01:27,880 --> 00:01:29,740
And when they click stop, that will stop.

23
00:01:29,750 --> 00:01:32,950
But we might also want, like I said, to get rid of this bar.

24
00:01:32,950 --> 00:01:35,120
So let's just do that just to see how we can do it.

25
00:01:35,410 --> 00:01:37,390
So underneath here, let's go.

26
00:01:37,840 --> 00:01:40,540
Let's give this a comment of stop the song.

27
00:01:41,720 --> 00:01:49,910
And let's give this a comment of clear playlist bar, I guess, and to do this, we would just go.

28
00:01:49,940 --> 00:01:58,670
Remember, our playlist is called Playlist Box so we could call playlist box dot selection, underscore

29
00:01:58,670 --> 00:01:59,300
clear.

30
00:02:00,350 --> 00:02:02,030
And we want to pass an active.

31
00:02:02,210 --> 00:02:05,090
So we want to clear the misspelled selection.

32
00:02:06,480 --> 00:02:08,980
So there we go.

33
00:02:09,240 --> 00:02:12,630
So we want to clear the active bar, the active selection.

34
00:02:12,750 --> 00:02:14,310
That's that green bar, right?

35
00:02:14,330 --> 00:02:16,640
So let's take this head back over here.

36
00:02:18,470 --> 00:02:20,690
And add a bunch of songs you.

37
00:02:22,340 --> 00:02:28,040
Play one and we click this boom, it stops the song and that bar disappears.

38
00:02:28,220 --> 00:02:33,110
Now we can click on some other thing, play it, stop, it disappears.

39
00:02:33,410 --> 00:02:35,540
So maybe you want to do that.

40
00:02:35,540 --> 00:02:36,230
Maybe you don't.

41
00:02:36,410 --> 00:02:39,560
I think it's probably a good idea because it's going to help us out with some other things later on

42
00:02:39,560 --> 00:02:40,280
that we'll look at.

43
00:02:40,790 --> 00:02:43,090
But, you know, sort of up to you at this point.

44
00:02:43,100 --> 00:02:44,990
So, OK, we've got our play button down.

45
00:02:44,990 --> 00:02:46,610
We've got our stop button down.

46
00:02:46,850 --> 00:02:51,770
Now, we should probably do the pause button, and that's going to be a little bit trickier, but not

47
00:02:51,770 --> 00:02:52,170
too bad.

48
00:02:52,170 --> 00:02:53,540
And we'll look at that in the next video.
