comparison gui/ui/actions.c @ 33615:1f9a31d4f114

Replace all playback integer constants by their symbolic constants.
author ib
date Wed, 22 Jun 2011 12:53:30 +0000
parents 79743a5cf4f0
children f3300b0c38a9
comparison
equal deleted inserted replaced
33614:79743a5cf4f0 33615:1f9a31d4f114
138 138
139 void uiPlay(void) 139 void uiPlay(void)
140 { 140 {
141 if (!guiInfo.Filename || 141 if (!guiInfo.Filename ||
142 (guiInfo.Filename[0] == 0) || 142 (guiInfo.Filename[0] == 0) ||
143 (guiInfo.Playing == 1)) 143 (guiInfo.Playing == GUI_PLAY))
144 return; 144 return;
145 145
146 if (guiInfo.Playing == 2) { 146 if (guiInfo.Playing == GUI_PAUSE) {
147 uiPause(); 147 uiPause();
148 return; 148 return;
149 } 149 }
150 150
151 guiGetEvent(guiSetState, (void *)GUI_PLAY); 151 guiGetEvent(guiSetState, (void *)GUI_PLAY);
157 void uiPause(void) 157 void uiPause(void)
158 { 158 {
159 if (!guiInfo.Playing) 159 if (!guiInfo.Playing)
160 return; 160 return;
161 161
162 if (guiInfo.Playing == 1) { 162 if (guiInfo.Playing == GUI_PLAY) {
163 mp_cmd_t *cmd = calloc(1, sizeof(*cmd)); 163 mp_cmd_t *cmd = calloc(1, sizeof(*cmd));
164 cmd->id = MP_CMD_PAUSE; 164 cmd->id = MP_CMD_PAUSE;
165 cmd->name = strdup("pause"); 165 cmd->name = strdup("pause");
166 mp_input_queue_cmd(cmd); 166 mp_input_queue_cmd(cmd);
167 } else 167 } else
168 guiInfo.Playing = 1; 168 guiInfo.Playing = GUI_PLAY;
169 } 169 }
170 170
171 void uiState(void) 171 void uiState(void)
172 { 172 {
173 if (guiInfo.Playing == 0 || guiInfo.Playing == 2) { 173 if (guiInfo.Playing == GUI_STOP || guiInfo.Playing == GUI_PAUSE) {
174 btnModify(evPlaySwitchToPause, btnReleased); 174 btnModify(evPlaySwitchToPause, btnReleased);
175 btnModify(evPauseSwitchToPlay, btnDisabled); 175 btnModify(evPauseSwitchToPlay, btnDisabled);
176 } else { 176 } else {
177 btnModify(evPlaySwitchToPause, btnDisabled); 177 btnModify(evPlaySwitchToPause, btnDisabled);
178 btnModify(evPauseSwitchToPlay, btnReleased); 178 btnModify(evPauseSwitchToPlay, btnReleased);
312 void uiCurr(void) 312 void uiCurr(void)
313 { 313 {
314 plItem *curr; 314 plItem *curr;
315 int stop = 0; 315 int stop = 0;
316 316
317 if (guiInfo.Playing == 2) 317 if (guiInfo.Playing == GUI_PAUSE)
318 return; 318 return;
319 319
320 switch (guiInfo.StreamType) { 320 switch (guiInfo.StreamType) {
321 #ifdef CONFIG_DVDREAD 321 #ifdef CONFIG_DVDREAD
322 case STREAMTYPE_DVD: 322 case STREAMTYPE_DVD:
342 } 342 }
343 343
344 if (stop) 344 if (stop)
345 uiEventHandling(evStop, 0); 345 uiEventHandling(evStop, 0);
346 346
347 if (guiInfo.Playing == 1) 347 if (guiInfo.Playing == GUI_PLAY)
348 uiEventHandling(evPlay, 0); 348 uiEventHandling(evPlay, 0);
349 } 349 }
350 350
351 void uiPrev(void) 351 void uiPrev(void)
352 { 352 {
353 plItem *prev; 353 plItem *prev;
354 int stop = 0; 354 int stop = 0;
355 355
356 if (guiInfo.Playing == 2) 356 if (guiInfo.Playing == GUI_PAUSE)
357 return; 357 return;
358 358
359 switch (guiInfo.StreamType) { 359 switch (guiInfo.StreamType) {
360 #ifdef CONFIG_DVDREAD 360 #ifdef CONFIG_DVDREAD
361 case STREAMTYPE_DVD: 361 case STREAMTYPE_DVD:
396 } 396 }
397 397
398 if (stop) 398 if (stop)
399 uiEventHandling(evStop, 0); 399 uiEventHandling(evStop, 0);
400 400
401 if (guiInfo.Playing == 1) 401 if (guiInfo.Playing == GUI_PLAY)
402 uiEventHandling(evPlay, 0); 402 uiEventHandling(evPlay, 0);
403 } 403 }
404 404
405 void uiNext(void) 405 void uiNext(void)
406 { 406 {
407 int stop = 0; 407 int stop = 0;
408 plItem *next; 408 plItem *next;
409 409
410 if (guiInfo.Playing == 2) 410 if (guiInfo.Playing == GUI_PAUSE)
411 return; 411 return;
412 412
413 switch (guiInfo.StreamType) { 413 switch (guiInfo.StreamType) {
414 #ifdef CONFIG_DVDREAD 414 #ifdef CONFIG_DVDREAD
415 case STREAMTYPE_DVD: 415 case STREAMTYPE_DVD:
456 } 456 }
457 457
458 if (stop) 458 if (stop)
459 uiEventHandling(evStop, 0); 459 uiEventHandling(evStop, 0);
460 460
461 if (guiInfo.Playing == 1) 461 if (guiInfo.Playing == GUI_PLAY)
462 uiEventHandling(evPlay, 0); 462 uiEventHandling(evPlay, 0);
463 } 463 }
464 464
465 void uiStop(void) 465 void uiStop(void)
466 { 466 {