1
00:00:01,930 --> 00:00:07,520
In the last video, we grabbed the current number of our song and then we added one to it.

2
00:00:07,780 --> 00:00:09,100
Now we need to play that.

3
00:00:09,130 --> 00:00:16,420
So first, let's grab the song title from the playlist.

4
00:00:18,220 --> 00:00:23,350
So let's go Tong equals and we could just copy playlist box.

5
00:00:25,240 --> 00:00:26,170
doGet.

6
00:00:27,680 --> 00:00:29,640
And then which song do we want to get?

7
00:00:29,660 --> 00:00:31,280
Do we want to get the active one?

8
00:00:31,520 --> 00:00:35,660
No, we don't really want to get the active when we could, but we need the numbered one.

9
00:00:35,660 --> 00:00:38,840
So to do that, let's call next underscore one.

10
00:00:39,050 --> 00:00:39,360
Right.

11
00:00:39,680 --> 00:00:43,160
So this is the song that we want to play this next one.

12
00:00:43,430 --> 00:00:47,960
Now, remember, it's returning this as just the name.

13
00:00:48,170 --> 00:00:54,890
And we need to just like with our play function, we need to add this other stuff to it so that we can

14
00:00:54,890 --> 00:00:55,910
play the new song.

15
00:00:55,910 --> 00:00:56,160
Right.

16
00:00:56,180 --> 00:01:07,040
So let's just copy the song thing here and let's comment this ad directory structure stuff to the song

17
00:01:07,040 --> 00:01:10,230
title and let's just paste this in.

18
00:01:10,640 --> 00:01:16,680
So now song will be whatever the song title is with this C section, be three slash audio and dot and

19
00:01:16,700 --> 00:01:17,390
B three at the end.

20
00:01:17,420 --> 00:01:20,840
So now we have the next song, the next one.

21
00:01:21,080 --> 00:01:25,090
We've got it in a format now that we can look up and play.

22
00:01:25,340 --> 00:01:27,340
Now all we have to do is play it.

23
00:01:27,350 --> 00:01:32,460
So let's just head up to our play function again and let's just grab these two things.

24
00:01:32,840 --> 00:01:34,920
This is what we use to play songs, right?

25
00:01:34,970 --> 00:01:37,430
So let's just copy these in.

26
00:01:38,620 --> 00:01:45,850
To our next song function, and we should be good to go, so, OK, let's save this and give it a run.

27
00:01:46,120 --> 00:01:46,990
Fingers crossed.

28
00:01:46,990 --> 00:01:47,860
See if that worked.

29
00:01:48,550 --> 00:01:51,010
So let's add a bunch of songs.

30
00:01:52,860 --> 00:01:54,510
And let's just pick one.

31
00:02:01,650 --> 00:02:02,130
Forward.

32
00:02:05,120 --> 00:02:10,040
Now we're having a little bit of problem and also this thing isn't updating when we go forward.

33
00:02:10,050 --> 00:02:12,050
So let's take a look at this.

34
00:02:12,620 --> 00:02:16,250
Also, if we click it several times, it's not kind of updating.

35
00:02:16,250 --> 00:02:18,190
It's just staying on the current song.

36
00:02:18,200 --> 00:02:20,570
So let's go first.

37
00:02:20,570 --> 00:02:23,490
Let's clear that box, that bar that is highlighted it.

38
00:02:23,680 --> 00:02:26,570
So let's go clear active bar.

39
00:02:28,640 --> 00:02:33,200
In playlist, so let's go playlist.

40
00:02:34,740 --> 00:02:42,780
Underscore box dot selection, underscore, clear, and we want to clear all of them, right.

41
00:02:43,140 --> 00:02:45,090
So let's go from zero to end.

42
00:02:47,040 --> 00:02:50,280
All right, so let's save this and run it, see if what that did.

43
00:02:53,560 --> 00:02:54,730
Let's add a bunch of songs.

44
00:02:56,590 --> 00:02:57,460
Let's click one.

45
00:03:00,130 --> 00:03:06,100
Now, when we look forward, it goes to the next song in that bar disappears at least.

46
00:03:06,400 --> 00:03:06,730
All right.

47
00:03:06,820 --> 00:03:08,300
So, all right, we're almost there.

48
00:03:09,040 --> 00:03:13,190
We now want to sort of move that to the next song, right?

49
00:03:13,210 --> 00:03:19,330
So move active bar to next song.

50
00:03:20,080 --> 00:03:25,740
And to do that, we go playlist underscore box that activate.

51
00:03:26,230 --> 00:03:27,480
Which one do we want to activate.

52
00:03:27,490 --> 00:03:31,330
We want to activate next one which remember is up here.

53
00:03:31,570 --> 00:03:33,460
It's the the next song.

54
00:03:34,270 --> 00:03:36,130
It's our current song plus one.

55
00:03:36,530 --> 00:03:41,810
So this is returning a no it's saying hey, activate number four or whatever.

56
00:03:41,830 --> 00:03:42,050
Right.

57
00:03:42,070 --> 00:03:43,780
So let's save this and run see it.

58
00:03:43,780 --> 00:03:44,440
That worked.

59
00:03:45,590 --> 00:03:50,240
I like to run things after doing just one thing, instead of doing like 10 things and then running it,

60
00:03:50,600 --> 00:03:53,450
because if something didn't work, you're not sure which thing works.

61
00:03:53,450 --> 00:03:57,350
So it's kind of tedious doing it this way, but it's always better to do it this way.

62
00:03:57,350 --> 00:03:57,600
So.

63
00:03:57,830 --> 00:03:58,220
All right.

64
00:03:58,220 --> 00:04:00,320
Let's click loophole plaît.

65
00:04:02,730 --> 00:04:11,700
And now let's go from now, you can see the underlying bar moved and this still doesn't work.

66
00:04:12,210 --> 00:04:15,170
So we're getting there, getting some errors here.

67
00:04:15,180 --> 00:04:17,120
So let's head back over here.

68
00:04:17,520 --> 00:04:26,220
And finally, the last step is to set the active bar to the next song.

69
00:04:27,810 --> 00:04:34,620
So this active is the thing that underlines it, the active bar is the thing that has the actual bar,

70
00:04:34,620 --> 00:04:42,990
so we would just go play ListBox, that selection underscore set and we want to set next underscore

71
00:04:42,990 --> 00:04:43,500
one.

72
00:04:44,630 --> 00:04:47,240
And then last equals none.

73
00:04:47,810 --> 00:04:54,570
So we want to select with list boxes, you have the option to select more than one thing, right?

74
00:04:54,800 --> 00:04:58,340
So we just want to select one thing, one item, one song.

75
00:04:58,470 --> 00:05:00,340
So we set last to none.

76
00:05:00,740 --> 00:05:07,350
So, OK, let's go ahead and give us some space there and OK, let's save this and run it.

77
00:05:07,730 --> 00:05:10,200
That should do the trick on the screen.

78
00:05:10,550 --> 00:05:11,180
All right.

79
00:05:12,770 --> 00:05:14,750
So much songs you.

80
00:05:16,290 --> 00:05:24,660
Pick one and we go, the next one pops back down, we go to the next one, it pops back down.

81
00:05:27,180 --> 00:05:28,790
So why is it working now?

82
00:05:28,800 --> 00:05:34,200
And it wasn't working earlier because this all starts out with the selection.

83
00:05:34,410 --> 00:05:37,320
So with the song not being selected, nothing can happen.

84
00:05:37,320 --> 00:05:38,180
The song can't play.

85
00:05:38,190 --> 00:05:38,910
We can't do anything.

86
00:05:38,910 --> 00:05:46,650
So we have to move that selection bar at Green Bar around in order for this whole thing to work.

87
00:05:46,800 --> 00:05:47,750
We've done that now.

88
00:05:47,760 --> 00:05:48,540
And so now it works.

89
00:05:48,550 --> 00:05:50,880
So that's all there is to the forward button.

90
00:05:50,910 --> 00:05:54,780
I will in the next video will do the background and we're basically just going to copy and paste everything

91
00:05:54,780 --> 00:06:00,390
from our forward function and change it from plus to minus.

92
00:06:00,570 --> 00:06:02,010
And we'll do that in the next video.
