Subversion Repositories Kolibri OS

Rev

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

Rev 5775 Rev 5789
Line 77... Line 77...
77
	byte mouse_clicked;
77
	byte mouse_clicked;
78
	dword tmp_x,tmp_y;
78
	dword tmp_x,tmp_y;
79
	dword z1,z2;
79
	dword z1,z2;
Line 80... Line 80...
80
	
80
	
81
	mem_Init();
-
 
82
	SetEventMask(0x27);
81
	mem_Init();
83
	load_dll(boxlib, #box_lib_init,0);
82
	load_dll(boxlib, #box_lib_init,0);
84
	load_dll(libio, #libio_init,1);
83
	load_dll(libio, #libio_init,1);
85
	load_dll(libimg, #libimg_init,1);
84
	load_dll(libimg, #libimg_init,1);
Line 99... Line 98...
99
		OpenDirectory(#work_folder);
98
		OpenDirectory(#work_folder);
100
		SetOpenedFileFirst(#param);
99
		SetOpenedFileFirst(#param);
101
	}
100
	}
Line 102... Line 101...
102
 
101
 
-
 
102
	StartPlayingMp3();
103
	StartPlayingMp3();
103
	list.SetFont(6, 9, 10000000b);
104
	list.SetSizes(1, skin.h, skin.w-1, 198, 18);
104
	list.SetSizes(1, skin.h, skin.w-1, 198, 18);
105
	if (list.count <= list.visible) 
105
	if (list.count <= list.visible) 
106
	{
106
	{
107
		list.h = list.count * list.line_h;
107
		list.h = list.count * list.line_h;
Line 110... Line 110...
110
	else
110
	else
111
	{
111
	{
112
		list.w -= scroll1.size_x;
112
		list.w -= scroll1.size_x;
113
	}
113
	}
Line -... Line 114...
-
 
114
 
114
 
115
	SetEventMask(0100111b);
115
	loop()
116
	loop()
116
	{
117
	{
117
	  WaitEventTimeout(10);
-
 
118
	  
-
 
119
	  //ActivateWindow(Form.ID);
118
	  WaitEventTimeout(10);
120
	  switch(EAX & 0xFF) {
119
	  switch(EAX & 0xFF) {
121
	  	case evMouse:
120
	  	case evMouse:
122
			if (!CheckActiveProcess(Form.ID)) break;
121
			if (!CheckActiveProcess(Form.ID)) break;
123
			mouse.get();
122
			mouse.get();
Line 126... Line 125...
126
			{
125
			{
127
				list.first = scroll1.position;
126
				list.first = scroll1.position;
128
				DrawPlayList();
127
				DrawPlayList();
129
				break;
128
				break;
130
			}
129
			}
131
			if(mouse.down)
-
 
132
			{
-
 
133
				if (mouse.vert) if (list.MouseScroll(mouse.vert)) 
130
			if (list.MouseOver(mouse.x, mouse.y))
134
				{
131
			{
-
 
132
				if (mouse.vert) if (list.MouseScroll(mouse.vert)) DrawPlayList();
135
					DrawPlayList();
133
				if (mouse.dblclick) StartPlayingMp3();
-
 
134
				if (mouse.key&MOUSE_LEFT) if (list.ProcessMouse(mouse.x, mouse.y)) DrawPlayList();
-
 
135
				if (mouse.key&MOUSE_RIGHT) notify("'Pixies Player v1.2\nChange sound volume: Left/Right key\nChange skin: F1/F2\nMute: M key' -St\n");
136
				}
136
			}
137
				if (list.MouseOver(mouse.x, mouse.y)) mouse_clicked = true;
-
 
138
				else if(mouse.y < skin.h) && (mouse.x < 13)
-
 
139
				{
-
 
140
					//drag window - emulate windows header
137
			//drag window - emulate windows header
-
 
138
			if(mouse.key&MOUSE_LEFT) && (mouse.y
-
 
139
			{
141
						tmp_x = mouse.x;
140
				tmp_x = mouse.x;
142
						tmp_y = mouse.y;
141
				tmp_y = mouse.y;
143
						do {
142
				do {
144
							mouse.get();
143
					mouse.get();
145
							if (tmp_x!=mouse.x) || (tmp_y!=mouse.y) 
144
					if (tmp_x!=mouse.x) || (tmp_y!=mouse.y) 
Line 154... Line 153...
154
								MoveSize(z1 , z2, OLD, OLD);
153
						MoveSize(z1 , z2, OLD, OLD);
155
								DrawWindow();
154
						DrawWindow();
156
							}
155
					}
157
							pause(1);
156
					pause(1);
158
						} while (mouse.lkm);
157
				} while (mouse.lkm);
159
					if (mouse.pkm) && (mouse.y > skin.h) 
-
 
160
						notify("'Pixies Player v1.11\nChange sound volume: Left/Right key\nChange skin: F1/F2\nMute: M key' -St\n");
-
 
161
					break;
-
 
162
				}
-
 
163
				else if(mouse.up)
-
 
164
				{
-
 
165
					if (mouse_clicked)&&(list.ProcessMouse(mouse.x, mouse.y))
-
 
166
					{
-
 
167
						StartPlayingMp3();
-
 
168
						mouse_clicked = false;
-
 
169
					}
158
			}
170
					break;
159
			break;
171
				}
-
 
172
			}
-
 
173
		case evButton:
160
		case evButton:
174
			id=GetButtonID();
161
			id=GetButtonID();
175
			switch(id) {
162
			switch(id) {
176
				case BUTTON_WINDOW_CLOSE:
163
				case BUTTON_WINDOW_CLOSE:
177
					StopPlayingMp3();
164
					StopPlayingMp3();
Line 229... Line 216...
229
			break;
216
			break;
Line 230... Line 217...
230
	  
217
	  
231
		case evKey:
218
		case evKey:
Line 232... Line 219...
232
			GetKeys();
219
			GetKeys();
233
			
220
			
234
			if (key_scancode==003) SetColorThemeLight();
221
			if (key_scancode==059) SetColorThemeLight();
235
			if (key_scancode==004) SetColorThemeDark();
222
			if (key_scancode==060) SetColorThemeDark();
236
			if (key_scancode==SCAN_CODE_LEFT) RunProgram("@VOLUME", "-");
223
			if (key_scancode==SCAN_CODE_LEFT) RunProgram("@VOLUME", "-");
237
			if (key_scancode==SCAN_CODE_RIGHT) RunProgram("@VOLUME", "+");
224
			if (key_scancode==SCAN_CODE_RIGHT) RunProgram("@VOLUME", "+");
238
			if (key_scancode==050) RunProgram("@VOLUME", "m");
225
			if (key_scancode==050) RunProgram("@VOLUME", "m");
Line 254... Line 241...
254
		default:
241
		default:
255
			if (playback_mode == PLAYBACK_MODE_PLAYING) && (GetProcessSlot(player_run_id)==0)
242
			if (playback_mode == PLAYBACK_MODE_PLAYING) && (GetProcessSlot(player_run_id)==0)
256
			{
243
			{
257
				if (current_playing_file_n < list.count) 
244
				if (current_playing_file_n < list.count) 
258
				{
245
				{
259
					current_playing_file_n = list.current;
246
					current_playing_file_n++;
260
					if (list.KeyDown()) StartPlayingMp3();
247
					StartPlayingMp3();
261
				}
248
				}
262
				else
249
				else
263
				{
250
				{
264
					StopPlayingMp3();
251
					StopPlayingMp3();
265
					DrawWindow();
252
					DrawWindow();
Line 313... Line 300...
313
void StopPlayingMp3() 
300
void StopPlayingMp3() 
314
{
301
{
315
	if (player_run_id) player_run_id = KillProcess(player_run_id);
302
	if (player_run_id) player_run_id = KillProcess(player_run_id);
316
	if (notify_run_id) notify_run_id = KillProcess(notify_run_id);
303
	if (notify_run_id) notify_run_id = KillProcess(notify_run_id);
317
	playback_mode = PLAYBACK_MODE_STOPED;
304
	playback_mode = PLAYBACK_MODE_STOPED;
-
 
305
	DrawTopPanel();
-
 
306
	DrawPlayList();
318
}
307
}
Line 319... Line 308...
319
 
308
 
320
 
309