Subversion Repositories Kolibri OS

Rev

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

Rev 7219 Rev 7229
Line 16... Line 16...
16
#include "../lib/obj/libimg.h"
16
#include "../lib/obj/libimg.h"
17
#include "../lib/obj/libini.h"
17
#include "../lib/obj/libini.h"
18
#include "../lib/obj/proc_lib.h"
18
#include "../lib/obj/proc_lib.h"
19
#include "../lib/obj/box_lib.h"
19
#include "../lib/obj/box_lib.h"
Line 20... Line -...
20
 
-
 
21
#include "../lib/patterns/libimg_load_skin.h"
20
 
Line 22... Line 21...
22
#include "../lib/patterns/simple_open_dialog.h"
21
#include "../lib/patterns/simple_open_dialog.h"
23
 
22
 
24
//===================================================//
23
//===================================================//
Line 34... Line 33...
34
#define ABOUT_MESSAGE "Pixie Player v2.81
33
#define ABOUT_MESSAGE "Pixie Player v2.81
Line 35... Line 34...
35
 
34
 
36
A tiny music folder player.
35
     A tiny music folder player.
Line 37... Line 36...
37
Supports MP3, WAV, XM audio file formats.
36
     Supports MP3, WAV, XM audio file formats.
38
 
37
 
39
Controls:
38
Hot keys:
40
Open file: O key
39
 Open file: O key
41
Play/Stop: Space or P key
40
 Play/Stop: Space or P key
42
Start playing selected file: Enter
41
 Start playing selected file: Enter
Line 143... Line 142...
143
			{
142
			{
144
				if (mouse.vert) && (list.MouseScroll(mouse.vert)) DrawPlayList();
143
				if (mouse.vert) && (list.MouseScroll(mouse.vert)) DrawPlayList();
145
				if (mouse.dblclick) EventStartPlayingSelectedItem();
144
				if (mouse.dblclick) EventStartPlayingSelectedItem();
146
				if (mouse.down) && (mouse.key&MOUSE_LEFT) 
145
				if (mouse.down) && (mouse.key&MOUSE_LEFT) 
147
					&& (list.ProcessMouse(mouse.x, mouse.y)) DrawPlayList();
146
					&& (list.ProcessMouse(mouse.x, mouse.y)) DrawPlayList();
148
				if (mouse.down) && (mouse.key&MOUSE_RIGHT) CreateThread(#EventShowAbout,#menu_stak+4092);
147
				if (mouse.down) && (mouse.key&MOUSE_RIGHT) EventShowAbout();
149
			}
148
			}
150
			if(mouse.key&MOUSE_LEFT) && (mouse.x<14) 
149
			if(mouse.key&MOUSE_LEFT) && (mouse.x<14) 
151
				&& (window_mode == WINDOW_MODE_SMALL) EventDragWindow();
150
				&& (window_mode == WINDOW_MODE_SMALL) EventDragWindow();
152
			break;
151
			break;
153
		case evButton:
152
		case evButton:
Line 178... Line 177...
178
			if (key_scancode==SCAN_CODE_RIGHT) RunProgram("/sys/@VOLUME", "+");
177
			if (key_scancode==SCAN_CODE_RIGHT) RunProgram("/sys/@VOLUME", "+");
179
			if (key_scancode==SCAN_CODE_LEFT)  RunProgram("/sys/@VOLUME", "-");
178
			if (key_scancode==SCAN_CODE_LEFT)  RunProgram("/sys/@VOLUME", "-");
180
			if (key_scancode==SCAN_CODE_ENTER) EventStartPlayingSelectedItem();
179
			if (key_scancode==SCAN_CODE_ENTER) EventStartPlayingSelectedItem();
181
			if (key_scancode==SCAN_CODE_DEL) EventDeleteItem();
180
			if (key_scancode==SCAN_CODE_DEL) EventDeleteItem();
182
			if (key_scancode==SCAN_CODE_KEY_P)||(key_scancode==SCAN_CODE_SPACE) EventPlayAndPause();
181
			if (key_scancode==SCAN_CODE_KEY_P)||(key_scancode==SCAN_CODE_SPACE) EventPlayAndPause();
-
 
182
			if (key_scancode==SCAN_CODE_F1) EventShowAbout();
183
			if (list.ProcessKey(key_scancode)) DrawPlayList();
183
			if (list.ProcessKey(key_scancode)) DrawPlayList();
184
			break;
184
			break;
185
		case evReDraw:
185
		case evReDraw:
186
			if (window_mode == WINDOW_MODE_NORMAL) 
186
			if (window_mode == WINDOW_MODE_NORMAL) 
187
				DefineDragableWindow(win_x_normal, win_y_normal, skin.w - 1, skin.h + list.h-1);
187
				DefineDragableWindow(win_x_normal, win_y_normal, skin.w - 1, skin.h + list.h-1);
Line 517... Line 517...
517
	else DrawPlayList();
517
	else DrawPlayList();
518
}
518
}
Line 519... Line 519...
519
 
519
 
520
void EventShowAbout()
520
void EventShowAbout()
-
 
521
{
-
 
522
	CreateThread(#ShowAboutThread,#menu_stak+4092);
-
 
523
}
-
 
524
 
-
 
525
void ShowAboutThread()
521
{
526
{
522
	proc_info pop_up;
527
	proc_info pop_up;
523
	loop() switch(WaitEvent())
528
	loop() switch(WaitEvent())
524
	{
529
	{
525
		case evButton: 
530
		case evButton: 
Line 530... Line 535...
530
			if (key_scancode == SCAN_CODE_ESC) ExitProcess();
535
			if (key_scancode == SCAN_CODE_ESC) ExitProcess();
531
			break;
536
			break;
532
		case evReDraw:
537
		case evReDraw:
533
			DefineDragableWindow(150, 200, 400, 346);
538
			DefineDragableWindow(150, 200, 400, 346);
534
			GetProcessInfo(#pop_up, SelfInfo);
539
			GetProcessInfo(#pop_up, SelfInfo);
-
 
540
 
535
			DrawBar(0, 0, pop_up.width, pop_up.height, theme.color_top_panel_bg);
541
			DrawBar(0, 0, pop_up.width, pop_up.height, theme.color_top_panel_bg);
536
			DrawRectangle(0, 0, pop_up.width, pop_up.height, theme.color_list_border);
542
			DrawRectangle(0, 0, pop_up.width, pop_up.height, theme.color_list_border);
537
			WriteTextLines(10, 10, 0x90, theme.color_top_panel_song_name, ABOUT_MESSAGE, 19);
-
 
Line 538... Line 543...
538
 
543
 
539
			DefineHiddenButton(pop_up.width - 27, 1, 26, 15, BUTTON_WINDOW_CLOSE);
544
			DefineHiddenButton(pop_up.width - 27, 1, 26, 15, BUTTON_WINDOW_CLOSE);
540
			img_draw stdcall(skin.image, pop_up.width-28, 0, 28, 18, skin.w - 29, 0);
545
			img_draw stdcall(skin.image, pop_up.width-28, 0, 28, 18, skin.w - 29, 0);
541
			DrawCaptButton(pop_up.width-10-80, pop_up.height - 34, 80, 24, 2, 
546
			DrawCaptButton(pop_up.width-10-80, pop_up.height - 34, 80, 24, 2, 
-
 
547
			  theme.color_list_active_bg, theme.color_top_panel_song_name, "Cool");
-
 
548
			
-
 
549
			WriteTextLines(10, 10, 0x90, theme.color_top_panel_song_name, ABOUT_MESSAGE, 19);
-
 
550
			DrawIcon32(10, 48, theme.color_top_panel_bg, 65);
542
			  theme.color_list_active_bg, theme.color_top_panel_song_name, "Cool");
551
 
543
	}
552
	}
Line 544... Line 553...
544
}
553
}