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