1
00:00:01,870 --> 00:00:06,700
OK, so we've got our menubar when we click this to add a song, we want the directory that pops up

2
00:00:06,700 --> 00:00:11,220
in this box to be our audio directory by default, and it's not by default.

3
00:00:11,470 --> 00:00:14,650
So let's head back over our code and let's do that really quickly.

4
00:00:14,830 --> 00:00:19,870
And to do this, we just head over to our add song function and our file dialogue thing.

5
00:00:19,870 --> 00:00:24,760
And in here we can add any sort of attributes that we want so we can set the initial directory that

6
00:00:24,760 --> 00:00:29,800
we want to pop up by calling initial R that's for directory.

7
00:00:30,070 --> 00:00:30,940
And what do we want?

8
00:00:30,950 --> 00:00:32,590
We want to put this in audio.

9
00:00:34,710 --> 00:00:36,330
Slash, right?

10
00:00:36,570 --> 00:00:42,790
This is a relative path, we could put the absolute path by going see Colin forward slash, let's see

11
00:00:43,310 --> 00:00:46,860
three forward slash audio, you do it that way.

12
00:00:46,860 --> 00:00:53,850
But since we're saving this file in our MP three directory, we don't have to be explicit here.

13
00:00:53,850 --> 00:00:55,740
We can just type audio forward slash.

14
00:00:56,130 --> 00:00:59,070
So, OK, so let's go ahead and save this and run it.

15
00:00:59,100 --> 00:01:00,060
Make sure that worked.

16
00:01:02,130 --> 00:01:07,230
And we could add songs we see boom, it pops in this audio directory, there's all those files that

17
00:01:07,230 --> 00:01:09,670
I put in in the last video, and that's cool.

18
00:01:09,690 --> 00:01:13,110
Now, one thing, these are MP three files.

19
00:01:13,230 --> 00:01:15,980
You may have other files in there.

20
00:01:15,990 --> 00:01:19,680
They may be word documents or HTML files or anything at all.

21
00:01:19,860 --> 00:01:25,400
We only want MP three songs to show up when we click this thing because we will only want to add maybe

22
00:01:25,440 --> 00:01:25,950
three songs.

23
00:01:25,950 --> 00:01:26,760
So how do we do that?

24
00:01:26,770 --> 00:01:28,380
Well, let's work on that now.

25
00:01:29,070 --> 00:01:31,080
Head back over to our code and.

26
00:01:32,210 --> 00:01:36,260
One other thing, I want to put a title here, so let's just type title.

27
00:01:37,780 --> 00:01:44,560
And choose a song, so whenever that box pops up, it has a little title top, you probably didn't notice

28
00:01:44,560 --> 00:01:46,250
it, but now that will say choose a song.

29
00:01:46,270 --> 00:01:52,690
So now we want to designate the types of files that will appear when that thing pops up so we can go

30
00:01:52,690 --> 00:01:57,510
file types and set this equal to and we go boom, boom.

31
00:01:57,520 --> 00:01:58,030
So.

32
00:01:59,570 --> 00:02:05,780
See, there are two sets of parentheses here, right, and inside of here, we want to type MP three

33
00:02:06,140 --> 00:02:14,330
files and then a comma and then we want to go Star Dot MP three.

34
00:02:15,020 --> 00:02:15,200
Right.

35
00:02:15,300 --> 00:02:22,010
And this is saying allow MP three files with file extension DOT, MP three.

36
00:02:22,160 --> 00:02:27,020
And that's how we find out what kind of files they're allowed, what kind of files.

37
00:02:27,020 --> 00:02:29,720
Dot MP three files in this story stands for everything.

38
00:02:29,720 --> 00:02:33,980
So it's saying let any file name that ends in MP three.

39
00:02:33,980 --> 00:02:37,430
So this star is the any the any file name.

40
00:02:37,430 --> 00:02:40,430
So that's the name of the file DOT MP three.

41
00:02:40,820 --> 00:02:41,560
So OK.

42
00:02:41,810 --> 00:02:43,970
And then outside of this.

43
00:02:44,890 --> 00:02:47,560
We put a comma and then we could do that.

44
00:02:47,590 --> 00:02:48,910
So this is a.

45
00:02:49,860 --> 00:02:57,390
Python lips, so this is a python tuple, if you're familiar with those, and this is just the format

46
00:02:57,390 --> 00:02:57,810
that we use.

47
00:02:57,820 --> 00:03:01,940
So it's going to save this and come back here, run this guy again.

48
00:03:03,240 --> 00:03:05,280
And click add song.

49
00:03:06,830 --> 00:03:11,900
And now you can see right here, it says MP three files, and then it has that thing there, that MP

50
00:03:11,900 --> 00:03:15,740
three files that we just typed in, that's what's showing up right there.

51
00:03:16,220 --> 00:03:20,630
And then MP three, and then this is only showing MP three files.

52
00:03:20,990 --> 00:03:26,060
So, OK, now when we click this and click open, nothing actually happens.

53
00:03:26,300 --> 00:03:36,050
But that file name has been sort of assigned to this song Variable and let's create.

54
00:03:37,170 --> 00:03:46,830
Down here at the very bottom, let's create a label and temporary label and let's call this my label

55
00:03:47,160 --> 00:03:48,270
and it's a label.

56
00:03:51,130 --> 00:03:57,160
And we want to put it in root and we want the text equal nothing, and then let's go my underscore label,

57
00:03:57,460 --> 00:03:58,390
dot pack.

58
00:03:59,340 --> 00:04:05,850
And give this Árpád why of 20, so we're creating a label, it won't have any text and it'll be down

59
00:04:05,850 --> 00:04:06,960
at the bottom of our app.

60
00:04:07,440 --> 00:04:11,010
So now let's take this my label and come up here to our function here.

61
00:04:11,310 --> 00:04:14,460
And then let's just go my label config.

62
00:04:16,990 --> 00:04:18,970
And set the text Ekwall.

63
00:04:19,850 --> 00:04:21,380
This variable song.

64
00:04:22,500 --> 00:04:25,370
All right, so let's save this and run this again.

65
00:04:28,460 --> 00:04:31,250
Now, when we add a song, let's add this, not me.

66
00:04:32,270 --> 00:04:40,040
You can see this is what it returns C, Capital C and B. three slash audio slash, not underscore Megg

67
00:04:40,050 --> 00:04:40,610
MP three.

68
00:04:40,610 --> 00:04:43,310
So it's returning the name of the song.

69
00:04:43,640 --> 00:04:46,460
So we can now put this thing in our playlist.

70
00:04:46,460 --> 00:04:48,440
And that's, I think, what we'll do in the next video.
