Mercurial > mplayer.hg
comparison mplayer.c @ 18913:2dc84d07332c
Initial win32 gui release.
author | vayne |
---|---|
date | Thu, 06 Jul 2006 01:51:31 +0000 |
parents | 89af7441989b |
children | d9a75b26da6c |
comparison
equal
deleted
inserted
replaced
18912:7ebb8863726d | 18913:2dc84d07332c |
---|---|
2536 | 2536 |
2537 #ifdef USE_TV | 2537 #ifdef USE_TV |
2538 tv_param_immediate = 1; | 2538 tv_param_immediate = 1; |
2539 #endif | 2539 #endif |
2540 | 2540 |
2541 #if defined(WIN32) && defined(HAVE_NEW_GUI) | |
2542 char *cmdline = GetCommandLine(); | |
2543 if(!strstr(cmdline, "-slave")) | |
2544 use_gui=1; | |
2545 #else | |
2541 if ( argv[0] ) | 2546 if ( argv[0] ) |
2542 if(!strcmp(argv[0],"gmplayer") || | 2547 if(!strcmp(argv[0],"gmplayer") || |
2543 (strrchr(argv[0],'/') && !strcmp(strrchr(argv[0],'/'),"/gmplayer") ) ) | 2548 (strrchr(argv[0],'/') && !strcmp(strrchr(argv[0],'/'),"/gmplayer") ) ) |
2544 use_gui=1; | 2549 use_gui=1; |
2550 #endif | |
2545 | 2551 |
2546 mconfig = m_config_new(); | 2552 mconfig = m_config_new(); |
2547 m_config_register_options(mconfig,mplayer_opts); | 2553 m_config_register_options(mconfig,mplayer_opts); |
2548 // TODO : add something to let modules register their options | 2554 // TODO : add something to let modules register their options |
2549 mp_input_register_options(mconfig); | 2555 mp_input_register_options(mconfig); |
2568 filename = play_tree_iter_get_file(playtree_iter,1); | 2574 filename = play_tree_iter_get_file(playtree_iter,1); |
2569 } | 2575 } |
2570 } | 2576 } |
2571 } | 2577 } |
2572 | 2578 |
2579 #if defined(WIN32) && defined(HAVE_NEW_GUI) | |
2580 void *runningmplayer = FindWindow("MPlayer GUI for Windows", "MPlayer for Windows"); | |
2581 if(runningmplayer && filename && use_gui){ | |
2582 COPYDATASTRUCT csData; | |
2583 char file[MAX_PATH]; | |
2584 char *filepart = filename; | |
2585 if(GetFullPathName(filename, MAX_PATH, file, &filepart)){ | |
2586 csData.dwData = 0; | |
2587 csData.cbData = strlen(file)*2; | |
2588 csData.lpData = file; | |
2589 SendMessage(runningmplayer, WM_COPYDATA, (WPARAM)runningmplayer, (LPARAM)&csData); | |
2590 } | |
2591 } | |
2592 #endif | |
2593 | |
2573 #ifdef WIN32 | 2594 #ifdef WIN32 |
2574 if(proc_priority){ | 2595 if(proc_priority){ |
2575 int i; | 2596 int i; |
2576 for(i=0; priority_presets_defs[i].name; i++){ | 2597 for(i=0; priority_presets_defs[i].name; i++){ |
2577 if(strcasecmp(priority_presets_defs[i].name, proc_priority) == 0) | 2598 if(strcasecmp(priority_presets_defs[i].name, proc_priority) == 0) |
2596 char cwd[PATH_MAX+2]; | 2617 char cwd[PATH_MAX+2]; |
2597 // Free Playtree and Playtree-Iter as it's not used by the GUI. | 2618 // Free Playtree and Playtree-Iter as it's not used by the GUI. |
2598 play_tree_iter_free(playtree_iter); | 2619 play_tree_iter_free(playtree_iter); |
2599 playtree_iter=NULL; | 2620 playtree_iter=NULL; |
2600 | 2621 |
2622 #ifndef WIN32 //Allow playing movies from network drives. eg. \\Desktop\c\somemovie.avi | |
2601 if (getcwd(cwd, PATH_MAX) != (char *)NULL) | 2623 if (getcwd(cwd, PATH_MAX) != (char *)NULL) |
2602 { | 2624 { |
2603 strcat(cwd, "/"); | 2625 strcat(cwd, "/"); |
2604 // Prefix relative paths with current working directory | 2626 // Prefix relative paths with current working directory |
2605 play_tree_add_bpf(playtree, cwd); | 2627 play_tree_add_bpf(playtree, cwd); |
2606 } | 2628 } |
2629 #endif /* WIN32 */ | |
2607 // Import initital playtree into GUI. | 2630 // Import initital playtree into GUI. |
2608 import_initial_playtree_into_gui(playtree, mconfig, enqueue); | 2631 import_initial_playtree_into_gui(playtree, mconfig, enqueue); |
2609 } | 2632 } |
2610 #endif /* HAVE_NEW_GUI */ | 2633 #endif /* HAVE_NEW_GUI */ |
2611 | 2634 |