comparison gui/win32/interface.c @ 33731:81f71d910333

Cosmetic: Change prefix for symbolic constants from GMP to GUI. GMP could be confused with the GNU Multiple Precision Arithmetic Library. Additionally, rename NEW_FILE SET_FILE and PREPARATION PREPARE to phrase requests.
author ib
date Tue, 05 Jul 2011 12:05:06 +0000
parents b4c64f168b29
children 90c992ac5011
comparison
equal deleted inserted replaced
33730:b4c64f168b29 33731:81f71d910333
172 dvdname[0] = 0; 172 dvdname[0] = 0;
173 strcat(dvdname, "DVD Movie"); 173 strcat(dvdname, "DVD Movie");
174 GetVolumeInformation(dvd_device, dvdname, MAX_PATH, NULL, NULL, NULL, NULL, 0); 174 GetVolumeInformation(dvd_device, dvdname, MAX_PATH, NULL, NULL, NULL, NULL, 0);
175 capitalize(dvdname); 175 capitalize(dvdname);
176 mp_msg(MSGT_GPLAYER, MSGL_V, "Opening DVD %s -> %s\n", dvd_device, dvdname); 176 mp_msg(MSGT_GPLAYER, MSGL_V, "Opening DVD %s -> %s\n", dvd_device, dvdname);
177 gui(GMP_PREPARATION, (void *) STREAMTYPE_DVD); 177 gui(GUI_PREPARE, (void *) STREAMTYPE_DVD);
178 mygui->playlist->clear_playlist(mygui->playlist); 178 mygui->playlist->clear_playlist(mygui->playlist);
179 mygui->playlist->add_track(mygui->playlist, filename, NULL, dvdname, 0); 179 mygui->playlist->add_track(mygui->playlist, filename, NULL, dvdname, 0);
180 mygui->startplay(mygui); 180 mygui->startplay(mygui);
181 break; 181 break;
182 } 182 }
216 mp_input_queue_cmd(mp_input_parse_cmd("quit")); 216 mp_input_queue_cmd(mp_input_parse_cmd("quit"));
217 break; 217 break;
218 } 218 }
219 case evStop: 219 case evStop:
220 if(guiInfo.Playing) 220 if(guiInfo.Playing)
221 gui(GMP_SET_STATE, (void *) GUI_STOP); 221 gui(GUI_SET_STATE, (void *) GUI_STOP);
222 break; 222 break;
223 case evSetMoviePosition: 223 case evSetMoviePosition:
224 { 224 {
225 rel_seek_secs = guiInfo.Position / 100.0f; 225 rel_seek_secs = guiInfo.Position / 100.0f;
226 abs_seek_pos = 3; 226 abs_seek_pos = 3;
286 { 286 {
287 guiInfo.Title = guiInfo.DVD.current_title; 287 guiInfo.Title = guiInfo.DVD.current_title;
288 guiInfo.Chapter = guiInfo.DVD.current_chapter; 288 guiInfo.Chapter = guiInfo.DVD.current_chapter;
289 guiInfo.Angle = guiInfo.DVD.current_angle; 289 guiInfo.Angle = guiInfo.DVD.current_angle;
290 guiInfo.DiskChanged = 1; 290 guiInfo.DiskChanged = 1;
291 gui(GMP_SET_STATE, (void *) GUI_PLAY); 291 gui(GUI_SET_STATE, (void *) GUI_PLAY);
292 break; 292 break;
293 } 293 }
294 #endif 294 #endif
295 default: 295 default:
296 { 296 {
297 guiInfo.FilenameChanged = guiInfo.NewPlay = 1; 297 guiInfo.FilenameChanged = guiInfo.NewPlay = 1;
298 update_playlistwindow(); 298 update_playlistwindow();
299 uiGotoTheNext = guiInfo.Playing? 0 : 1; 299 uiGotoTheNext = guiInfo.Playing? 0 : 1;
300 gui(GMP_SET_STATE, (void *) GUI_STOP); 300 gui(GUI_SET_STATE, (void *) GUI_STOP);
301 gui(GMP_SET_STATE, (void *) GUI_PLAY); 301 gui(GUI_SET_STATE, (void *) GUI_PLAY);
302 break; 302 break;
303 } 303 }
304 } 304 }
305 break; 305 break;
306 } 306 }
322 { 322 {
323 uiPause(); 323 uiPause();
324 return; 324 return;
325 } 325 }
326 guiInfo.NewPlay = 1; 326 guiInfo.NewPlay = 1;
327 gui(GMP_SET_STATE, (void *) GUI_PLAY); 327 gui(GUI_SET_STATE, (void *) GUI_PLAY);
328 } 328 }
329 329
330 void uiPause( void ) 330 void uiPause( void )
331 { 331 {
332 if(!guiInfo.Playing) return; 332 if(!guiInfo.Playing) return;
497 playtree = mpctx_get_playtree_iter(guiInfo.mpcontext); 497 playtree = mpctx_get_playtree_iter(guiInfo.mpcontext);
498 } 498 }
499 499
500 switch (what) 500 switch (what)
501 { 501 {
502 case GMP_PREPARATION: 502 case GUI_PREPARE:
503 { 503 {
504 gui(GMP_NEW_FILE, 0); 504 gui(GUI_SET_FILE, 0);
505 guiInfo.DiskChanged = 0; 505 guiInfo.DiskChanged = 0;
506 guiInfo.FilenameChanged = 0; 506 guiInfo.FilenameChanged = 0;
507 guiInfo.NewPlay = 0; 507 guiInfo.NewPlay = 0;
508 switch(guiInfo.StreamType) 508 switch(guiInfo.StreamType)
509 { 509 {
526 filename = strdup(guiInfo.Filename); 526 filename = strdup(guiInfo.Filename);
527 else if(filename) 527 else if(filename)
528 strcpy(guiInfo.Filename, filename); 528 strcpy(guiInfo.Filename, filename);
529 break; 529 break;
530 } 530 }
531 case GMP_SET_AUDIO: 531 case GUI_SET_AUDIO:
532 { 532 {
533 guiInfo.MovieWindow = (arg && !guiInfo.sh_video); 533 guiInfo.MovieWindow = (arg && !guiInfo.sh_video);
534 // NOTE: This type doesn't mean (and never meant) that we have 534 // NOTE: This type doesn't mean (and never meant) that we have
535 // *just* audio, so there probably should be a check before 535 // *just* audio, so there probably should be a check before
536 // hiding (see gui/interface.c). 536 // hiding (see gui/interface.c).
537 if(IsWindowVisible(mygui->subwindow)) 537 if(IsWindowVisible(mygui->subwindow))
538 ShowWindow(mygui->subwindow, SW_HIDE); 538 ShowWindow(mygui->subwindow, SW_HIDE);
539 break; 539 break;
540 } 540 }
541 case GMP_SET_CONTEXT: 541 case GUI_SET_CONTEXT:
542 guiInfo.mpcontext = arg; 542 guiInfo.mpcontext = arg;
543 break; 543 break;
544 case GMP_SET_VIDEO: 544 case GUI_SET_VIDEO:
545 { 545 {
546 guiInfo.sh_video = arg; 546 guiInfo.sh_video = arg;
547 if (arg) 547 if (arg)
548 { 548 {
549 sh_video_t *sh = arg; 549 sh_video_t *sh = arg;
557 update_subwindow(); 557 update_subwindow();
558 558
559 } 559 }
560 break; 560 break;
561 } 561 }
562 case GMP_SETUP_VIDEO_WINDOW: 562 case GUI_SETUP_VIDEO_WINDOW:
563 { 563 {
564 guiInfo.MovieWidth = vo_dwidth; 564 guiInfo.MovieWidth = vo_dwidth;
565 guiInfo.MovieHeight = vo_dheight; 565 guiInfo.MovieHeight = vo_dheight;
566 566
567 sub_aspect = (float)guiInfo.MovieWidth/guiInfo.MovieHeight; 567 sub_aspect = (float)guiInfo.MovieWidth/guiInfo.MovieHeight;
568 if(WinID != -1) 568 if(WinID != -1)
569 update_subwindow(); 569 update_subwindow();
570 break; 570 break;
571 } 571 }
572 case GMP_SET_STREAM: 572 case GUI_SET_STREAM:
573 { 573 {
574 guiInfo.StreamType = stream->type; 574 guiInfo.StreamType = stream->type;
575 switch(stream->type) 575 switch(stream->type)
576 { 576 {
577 #ifdef CONFIG_DVDREAD 577 #ifdef CONFIG_DVDREAD
591 break; 591 break;
592 #endif 592 #endif
593 } 593 }
594 break; 594 break;
595 } 595 }
596 case GMP_REDRAW: 596 case GUI_REDRAW:
597 mygui->updatedisplay(mygui, mygui->mainwindow); 597 mygui->updatedisplay(mygui, mygui->mainwindow);
598 break; 598 break;
599 case GMP_SET_AFILTER: 599 case GUI_SET_AFILTER:
600 guiInfo.afilter = arg; 600 guiInfo.afilter = arg;
601 break; 601 break;
602 case GMP_SET_STATE: 602 case GUI_SET_STATE:
603 { 603 {
604 guiInfo.Playing = (int) arg; 604 guiInfo.Playing = (int) arg;
605 switch (guiInfo.Playing) 605 switch (guiInfo.Playing)
606 { 606 {
607 case GUI_PLAY: 607 case GUI_PLAY:
621 guiInfo.Playing = GUI_PAUSE; 621 guiInfo.Playing = GUI_PAUSE;
622 break; 622 break;
623 } 623 }
624 break; 624 break;
625 } 625 }
626 case GMP_RUN_COMMAND: 626 case GUI_RUN_COMMAND:
627 { 627 {
628 mp_msg(MSGT_GPLAYER,MSGL_V, "cmd: %d\n", (int) arg); 628 mp_msg(MSGT_GPLAYER,MSGL_V, "cmd: %d\n", (int) arg);
629 /* MPlayer asks us to quit */ 629 /* MPlayer asks us to quit */
630 switch((int) arg) 630 switch((int) arg)
631 { 631 {
652 default: 652 default:
653 break; 653 break;
654 } 654 }
655 break; 655 break;
656 } 656 }
657 case GMP_NEW_FILE: 657 case GUI_SET_FILE:
658 { 658 {
659 audio_id = -1; 659 audio_id = -1;
660 video_id = -1; 660 video_id = -1;
661 dvdsub_id = -1; 661 dvdsub_id = -1;
662 vobsub_id = -1; 662 vobsub_id = -1;
678 } 678 }
679 if(gtkCacheOn) stream_cache_size = gtkCacheSize; 679 if(gtkCacheOn) stream_cache_size = gtkCacheSize;
680 if(gtkAutoSyncOn) autosync = gtkAutoSync; 680 if(gtkAutoSyncOn) autosync = gtkAutoSync;
681 break; 681 break;
682 } 682 }
683 case GMP_SET_MIXER: 683 case GUI_SET_MIXER:
684 { 684 {
685 if(audio_out) 685 if(audio_out)
686 { 686 {
687 /* Some audio_out drivers do not support balance e.g. dsound */ 687 /* Some audio_out drivers do not support balance e.g. dsound */
688 /* FIXME this algo is not correct */ 688 /* FIXME this algo is not correct */
694 else 694 else
695 guiInfo.Balance = 50.0f; 695 guiInfo.Balance = 50.0f;
696 } 696 }
697 break; 697 break;
698 } 698 }
699 case GMP_END_FILE: 699 case GUI_END_FILE:
700 { 700 {
701 if(!uiGotoTheNext && guiInfo.Playing) 701 if(!uiGotoTheNext && guiInfo.Playing)
702 { 702 {
703 uiGotoTheNext = 1; 703 uiGotoTheNext = 1;
704 break; 704 break;
738 if(style == WS_VISIBLE | WS_POPUP) 738 if(style == WS_VISIBLE | WS_POPUP)
739 { 739 {
740 style = WS_OVERLAPPEDWINDOW | WS_SIZEBOX; 740 style = WS_OVERLAPPEDWINDOW | WS_SIZEBOX;
741 SetWindowLong(mygui->subwindow, GWL_STYLE, style); 741 SetWindowLong(mygui->subwindow, GWL_STYLE, style);
742 } 742 }
743 gui(GMP_SET_STATE, (void *) GUI_STOP); 743 gui(GUI_SET_STATE, (void *) GUI_STOP);
744 break; 744 break;
745 } 745 }
746 default: 746 default:
747 mp_msg(MSGT_GPLAYER, MSGL_ERR, "[GUI] GOT UNHANDLED EVENT %i\n", what); 747 mp_msg(MSGT_GPLAYER, MSGL_ERR, "[GUI] GOT UNHANDLED EVENT %i\n", what);
748 } 748 }