Rev 7196 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
6920 | leency | 1 | int files_mas[2000]; |
2 | dword buf; |
||
3 | |||
4 | |||
5 | void OpenDirectory(dword folder_path) |
||
6 | { |
||
7 | int cur; |
||
8 | char temp_filename[4096]; |
||
9 | dword j, filesnum, end_pointer; |
||
10 | |||
11 | list.count = 0; |
||
12 | if (buf) free(buf); |
||
13 | if (GetDir(#buf, #filesnum, folder_path, DIRS_ONLYREAL)==0) |
||
14 | if (filesnum==0) |
||
15 | { |
||
16 | notify("'Error opening folder' -E"); |
||
17 | } |
||
18 | for (j=0; j |
||
19 | { |
||
20 | strcpy(#temp_filename, j*304 + buf+72); |
||
21 | end_pointer = #temp_filename+strlen(#temp_filename); |
||
7188 | leency | 22 | if (strcmpi(end_pointer-4,".mp3")==0) |
23 | || (strcmpi(end_pointer-4,".wav")==0) |
||
24 | || (strcmpi(end_pointer-3,".xm")==0) |
||
25 | { |
||
26 | cur = list.count; |
||
27 | files_mas[cur]=j; |
||
7196 | leency | 28 | list.count++; |
29 | if (list.count>=sizeof(files_mas)*sizeof(int)) break; |
||
7188 | leency | 30 | } |
6920 | leency | 31 | } |
32 | SortByName(0, list.count-1); |
||
33 | } |
||
34 | |||
35 | void SortByName(int a, b) |
||
36 | { |
||
37 | int j, i = a; |
||
38 | if (a >= b) return; |
||
39 | for (j = a; j <= b; j++) |
||
40 | if (strcmp(files_mas[j]*304 + buf+72, files_mas[b]*304 + buf+72)<=0) { files_mas[i] >< files_mas[j]; i++;} |
||
41 | SortByName(a, i-2); |
||
42 | SortByName(i, b); |
||
43 | } |
||
44 | |||
45 | void SetOpenedFileFirst(dword in_name) |
||
46 | { |
||
47 | int i; |
||
48 | dword opened_filename = in_name + strrchr(in_name, '/'); |
||
49 | for (i=0; i |
||
50 | { |
||
51 | if (strcmpi(opened_filename,files_mas[i]*304 + buf+72)==0) { files_mas[0]> |
||
52 | } |
||
53 | } |
||
54 | |||
7347 | leency | 55 | dword GetPlayingItemName() { |
6920 | leency | 56 | return files_mas[current_playing_file_n]*304 + buf+72; |
57 | } |
||
7347 | leency | 58 | |
59 | dword GetSelectedItemName() { |
||
60 | int cury = list.cur_y; |
||
61 | return files_mas[cury]*304 + buf+72; |
||
62 | }>=0)>=> |