Subversion Repositories Kolibri OS

Rev

Rev 6920 | Rev 7196 | Go to most recent revision | 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
 
19
	for (j=0; j
20
	{
21
		strcpy(#temp_filename, j*304 + buf+72);
22
		end_pointer = #temp_filename+strlen(#temp_filename);
7188 leency 23
		if (strcmpi(end_pointer-4,".mp3")==0)
24
		|| (strcmpi(end_pointer-4,".wav")==0)
25
		|| (strcmpi(end_pointer-3,".xm")==0)
26
		{
27
			cur = list.count;
28
			files_mas[cur]=j;
29
			list.count++;
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
 
55
dword Getcur_yItemName() {
56
	return files_mas[current_playing_file_n]*304 + buf+72;
57
}