Mercurial > mplayer.hg
comparison gui/win32/interface.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 |
---|---|
241 case evSetBalance: | 241 case evSetBalance: |
242 case evSetVolume: | 242 case evSetVolume: |
243 { | 243 { |
244 float l,r; | 244 float l,r; |
245 | 245 |
246 if (guiInfo.Playing == 0) | 246 if (guiInfo.Playing == GUI_STOP) |
247 break; | 247 break; |
248 | 248 |
249 if (guiInfo.Balance == 50.0f) | 249 if (guiInfo.Balance == 50.0f) |
250 mixer_setvolume(mixer, guiInfo.Volume, guiInfo.Volume); | 250 mixer_setvolume(mixer, guiInfo.Volume, guiInfo.Volume); |
251 | 251 |
316 void uiPlay( void ) | 316 void uiPlay( void ) |
317 { | 317 { |
318 if((!guiInfo.Filename ) || (guiInfo.Filename[0] == 0)) | 318 if((!guiInfo.Filename ) || (guiInfo.Filename[0] == 0)) |
319 return; | 319 return; |
320 | 320 |
321 if(guiInfo.Playing > 0) | 321 if(guiInfo.Playing > GUI_STOP) |
322 { | 322 { |
323 uiPause(); | 323 uiPause(); |
324 return; | 324 return; |
325 } | 325 } |
326 guiInfo.NewPlay = 1; | 326 guiInfo.NewPlay = 1; |
329 | 329 |
330 void uiPause( void ) | 330 void uiPause( void ) |
331 { | 331 { |
332 if(!guiInfo.Playing) return; | 332 if(!guiInfo.Playing) return; |
333 | 333 |
334 if(guiInfo.Playing == 1) | 334 if(guiInfo.Playing == GUI_PLAY) |
335 { | 335 { |
336 mp_cmd_t * cmd = calloc(1, sizeof(*cmd)); | 336 mp_cmd_t * cmd = calloc(1, sizeof(*cmd)); |
337 cmd->id=MP_CMD_PAUSE; | 337 cmd->id=MP_CMD_PAUSE; |
338 cmd->name=strdup("pause"); | 338 cmd->name=strdup("pause"); |
339 mp_input_queue_cmd(cmd); | 339 mp_input_queue_cmd(cmd); |
340 } else guiInfo.Playing = 1; | 340 } else guiInfo.Playing = GUI_PLAY; |
341 } | 341 } |
342 | 342 |
343 void uiNext(void) | 343 void uiNext(void) |
344 { | 344 { |
345 if(guiInfo.Playing == 2) return; | 345 if(guiInfo.Playing == GUI_PAUSE) return; |
346 switch(guiInfo.StreamType) | 346 switch(guiInfo.StreamType) |
347 { | 347 { |
348 #ifdef CONFIG_DVDREAD | 348 #ifdef CONFIG_DVDREAD |
349 case STREAMTYPE_DVD: | 349 case STREAMTYPE_DVD: |
350 if(guiInfo.DVD.current_chapter == (guiInfo.DVD.chapters - 1)) | 350 if(guiInfo.DVD.current_chapter == (guiInfo.DVD.chapters - 1)) |
362 mygui->startplay(mygui); | 362 mygui->startplay(mygui); |
363 } | 363 } |
364 | 364 |
365 void uiPrev(void) | 365 void uiPrev(void) |
366 { | 366 { |
367 if(guiInfo.Playing == 2) return; | 367 if(guiInfo.Playing == GUI_PAUSE) return; |
368 switch(guiInfo.StreamType) | 368 switch(guiInfo.StreamType) |
369 { | 369 { |
370 #ifdef CONFIG_DVDREAD | 370 #ifdef CONFIG_DVDREAD |
371 case STREAMTYPE_DVD: | 371 case STREAMTYPE_DVD: |
372 if(guiInfo.DVD.current_chapter == 1) | 372 if(guiInfo.DVD.current_chapter == 1) |
665 guiInfo.Playing = (int) arg; | 665 guiInfo.Playing = (int) arg; |
666 switch (guiInfo.Playing) | 666 switch (guiInfo.Playing) |
667 { | 667 { |
668 case GUI_PLAY: | 668 case GUI_PLAY: |
669 { | 669 { |
670 guiInfo.Playing = 1; | 670 guiInfo.Playing = GUI_PLAY; |
671 break; | 671 break; |
672 } | 672 } |
673 case GUI_STOP: | 673 case GUI_STOP: |
674 { | 674 { |
675 guiInfo.Playing = 0; | 675 guiInfo.Playing = GUI_STOP; |
676 if(movie_aspect >= 0) | 676 if(movie_aspect >= 0) |
677 movie_aspect = -1; | 677 movie_aspect = -1; |
678 update_subwindow(); | 678 update_subwindow(); |
679 break; | 679 break; |
680 } | 680 } |
681 case GUI_PAUSE: | 681 case GUI_PAUSE: |
682 guiInfo.Playing = 2; | 682 guiInfo.Playing = GUI_PAUSE; |
683 break; | 683 break; |
684 } | 684 } |
685 break; | 685 break; |
686 } | 686 } |
687 case guiIEvent: | 687 case guiIEvent: |
910 wp.cx = rd.right-rd.left; | 910 wp.cx = rd.right-rd.left; |
911 wp.cy = rd.bottom-rd.top; | 911 wp.cy = rd.bottom-rd.top; |
912 wp.flags = SWP_NOOWNERZORDER | SWP_SHOWWINDOW; | 912 wp.flags = SWP_NOOWNERZORDER | SWP_SHOWWINDOW; |
913 | 913 |
914 /* erase the bitmap image if there's video */ | 914 /* erase the bitmap image if there's video */ |
915 if(guiInfo.Playing != 0 && guiInfo.sh_video) | 915 if(guiInfo.Playing != GUI_STOP && guiInfo.sh_video) |
916 SendMessage(mygui->subwindow, WM_ERASEBKGND, (WPARAM)GetDC(mygui->subwindow), 0); | 916 SendMessage(mygui->subwindow, WM_ERASEBKGND, (WPARAM)GetDC(mygui->subwindow), 0); |
917 | 917 |
918 /* reset the window aspect */ | 918 /* reset the window aspect */ |
919 SendMessage(mygui->subwindow, WM_WINDOWPOSCHANGED, 0, (LPARAM)&wp); | 919 SendMessage(mygui->subwindow, WM_WINDOWPOSCHANGED, 0, (LPARAM)&wp); |
920 return 0; | 920 return 0; |