Subversion Repositories Kolibri OS

Rev

Rev 7232 | Rev 7348 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7232 Rev 7347
Line 28... Line 28...
28
 
28
 
29
//simple open dialog data
29
//simple open dialog data
30
char default_dir[] = "/rd/1";
30
char default_dir[] = "/rd/1";
Line 31... Line 31...
31
od_filter filter2 = { 15, "MP3\0WAV\0XM\0\0" };
31
od_filter filter2 = { 15, "MP3\0WAV\0XM\0\0" };
Line 32... Line 32...
32
 
32
 
33
#define ABOUT_MESSAGE "Pixie Player v2.9 Final
33
#define ABOUT_MESSAGE "Pixie Player v2.91 Final
Line 34... Line 34...
34
 
34
 
Line 40... Line 40...
40
 Play/Stop: Space or P key
40
 Play/Stop: Space or P key
41
 Start playing selected file: Enter
41
 Start playing selected file: Enter
42
 Goto next/previous track: Ctrl + Left/Right
42
 Goto next/previous track: Ctrl + Left/Right
43
 Change sound volume: Left/Right key
43
 Change sound volume: Left/Right key
44
 Remove from the list: Delete
44
 Remove from the list: Delete
-
 
45
 Permanently delete file: Shift + Delete
45
 Repeat: R
46
 Repeat: R
46
 Shuffle: S
47
 Shuffle: S
47
 Mute: M
48
 Mute: M
Line 48... Line 49...
48
 
49
 
Line 168... Line 169...
168
			if (key_modifier&KEY_LCTRL) || (key_modifier&KEY_RCTRL) {
169
			if (key_modifier&KEY_LCTRL) || (key_modifier&KEY_RCTRL) {
169
				if (key_scancode==SCAN_CODE_LEFT) EventPlaybackPrevious();
170
				if (key_scancode==SCAN_CODE_LEFT) EventPlaybackPrevious();
170
				if (key_scancode==SCAN_CODE_RIGHT) EventPlaybackNext();
171
				if (key_scancode==SCAN_CODE_RIGHT) EventPlaybackNext();
171
				break;
172
				break;
172
			}		
173
			}
-
 
174
			if (key_modifier&KEY_LSHIFT) || (key_modifier&KEY_RSHIFT) {
-
 
175
				if (key_scancode==SCAN_CODE_DEL) EventPermanentlyDeleteFile();
-
 
176
				break;
-
 
177
			}
173
			if (key_scancode==SCAN_CODE_KEY_O) EventFileDialogOpen();
178
			if (key_scancode==SCAN_CODE_KEY_O) EventFileDialogOpen();
174
			if (key_scancode==SCAN_CODE_KEY_M) RunProgram("/sys/@VOLUME", "m");
179
			if (key_scancode==SCAN_CODE_KEY_M) RunProgram("/sys/@VOLUME", "m");
175
			if (key_scancode==SCAN_CODE_KEY_R) EventRepeatClick();
180
			if (key_scancode==SCAN_CODE_KEY_R) EventRepeatClick();
176
			if (key_scancode==SCAN_CODE_KEY_S) EventShuffleClick();
181
			if (key_scancode==SCAN_CODE_KEY_S) EventShuffleClick();
177
			if (key_scancode==SCAN_CODE_RIGHT) RunProgram("/sys/@VOLUME", "+");
182
			if (key_scancode==SCAN_CODE_RIGHT) RunProgram("/sys/@VOLUME", "+");
178
			if (key_scancode==SCAN_CODE_LEFT)  RunProgram("/sys/@VOLUME", "-");
183
			if (key_scancode==SCAN_CODE_LEFT)  RunProgram("/sys/@VOLUME", "-");
179
			if (key_scancode==SCAN_CODE_ENTER) EventStartPlayingSelectedItem();
184
			if (key_scancode==SCAN_CODE_ENTER) EventStartPlayingSelectedItem();
180
			if (key_scancode==SCAN_CODE_DEL) EventDeleteItem();
185
			if (key_scancode==SCAN_CODE_DEL) EventRemoveItemFromList();
181
			if (key_scancode==SCAN_CODE_KEY_P)||(key_scancode==SCAN_CODE_SPACE) EventPlayAndPause();
186
			if (key_scancode==SCAN_CODE_KEY_P)||(key_scancode==SCAN_CODE_SPACE) EventPlayAndPause();
182
			if (key_scancode==SCAN_CODE_F1) EventShowAbout();
187
			if (key_scancode==SCAN_CODE_F1) EventShowAbout();
183
			if (list.ProcessKey(key_scancode)) DrawPlayList();
188
			if (list.ProcessKey(key_scancode)) DrawPlayList();
184
			break;
189
			break;
185
		case evReDraw:
190
		case evReDraw:
Line 390... Line 395...
390
	if (current_playing_file_n < 0) { 
395
	if (current_playing_file_n < 0) { 
391
		current_playing_file_n = 0; 
396
		current_playing_file_n = 0; 
392
		return; 
397
		return; 
393
	}
398
	}
394
	playback_mode = PLAYBACK_MODE_PLAYING;
399
	playback_mode = PLAYBACK_MODE_PLAYING;
395
	strlcpy(#current_filename, Getcur_yItemName(), sizeof(current_filename));
400
	strlcpy(#current_filename, GetPlayingItemName(), sizeof(current_filename));
396
	sprintf(#item_path,"-h %s/%s",#work_folder,#current_filename);
401
	sprintf(#item_path,"-h %s/%s",#work_folder,#current_filename);
397
	current_filename[strrchr(#current_filename, '.')-1] = '\0';
402
	current_filename[strrchr(#current_filename, '.')-1] = '\0';
398
	DrawPlayList();
403
	DrawPlayList();
399
	DrawTopPanel();
404
	DrawTopPanel();
400
	player_run_id = RunProgram("/sys/media/ac97snd", #item_path);	
405
	player_run_id = RunProgram("/sys/media/ac97snd", #item_path);	
Line 498... Line 503...
498
{
503
{
499
	shuffle ^= 1;
504
	shuffle ^= 1;
500
	DrawTopPanel();
505
	DrawTopPanel();
501
}
506
}
Line 502... Line 507...
502
 
507
 
503
void EventDeleteItem()
508
void EventRemoveItemFromList()
504
{
509
{
505
	int i;
510
	int i;
506
	if (list.cur_y == current_playing_file_n) EventStopPlaying();
511
	if (list.cur_y == current_playing_file_n) EventStopPlaying();
507
	for (i=list.cur_y; i
512
	for (i=list.cur_y; i
Line 515... Line 520...
515
		if (window_mode==WINDOW_MODE_NORMAL) MoveSize(OLD, OLD, OLD, skin.h + list.h);
520
		if (window_mode==WINDOW_MODE_NORMAL) MoveSize(OLD, OLD, OLD, skin.h + list.h);
516
	}
521
	}
517
	else DrawPlayList();
522
	else DrawPlayList();
518
}
523
}
Line -... Line 524...
-
 
524
 
-
 
525
void EventPermanentlyDeleteFile()
-
 
526
{
-
 
527
	char item_path[4096];
-
 
528
	sprintf(#item_path,"%s/%s",#work_folder,GetSelectedItemName());
-
 
529
	DeleteFile(#item_path);
-
 
530
	EventRemoveItemFromList();
-
 
531
}
519
 
532
 
520
void EventShowAbout()
533
void EventShowAbout()
521
{
534
{
522
	CreateThread(#ShowAboutThread,#menu_stak+4092);
535
	CreateThread(#ShowAboutThread,#menu_stak+4092);
Line 533... Line 546...
533
		case evKey:
546
		case evKey:
534
			GetKeys();
547
			GetKeys();
535
			if (key_scancode == SCAN_CODE_ESC) ExitProcess();
548
			if (key_scancode == SCAN_CODE_ESC) ExitProcess();
536
			break;
549
			break;
537
		case evReDraw:
550
		case evReDraw:
538
			DefineDragableWindow(150, 200, 400, 346);
551
			DefineDragableWindow(150, 200, 400, 368);
539
			GetProcessInfo(#pop_up, SelfInfo);
552
			GetProcessInfo(#pop_up, SelfInfo);
Line 540... Line 553...
540
 
553
 
541
			DrawBar(0, 0, pop_up.width, pop_up.height, theme.color_top_panel_bg);
554
			DrawBar(0, 0, pop_up.width, pop_up.height, theme.color_top_panel_bg);