# HG changeset patch # User ib # Date 1307361335 0 # Node ID d068eac6cbf9efc74d2d163b1628784ba54678e0 # Parent b1bda1dded0816030c193febc5f194e305f2eba2 Make option '-noidle' working for the GUI. So far, -idle was implicitly a default option to the GUI (although the corresponding option variable was set to the '-noidle' value). Explicitly set option '-idle' in the GUI now, remove the error (both message and exit) that "the -idle option cannot be used with GMPlayer", start the GUI without filename in either mode (idle or noidle) and go to play_next_file only as long as the GUI has something to play (or -idle was given). This allows using option '-noidle' for the GUI which can be used to quit it after it has finished playing. diff -r b1bda1dded08 -r d068eac6cbf9 DOCS/man/de/mplayer.1 --- a/DOCS/man/de/mplayer.1 Sun Jun 05 14:54:41 2011 +0000 +++ b/DOCS/man/de/mplayer.1 Mon Jun 06 11:55:35 2011 +0000 @@ -1096,6 +1096,11 @@ abzuspielen ist. Hauptsächlich für den Slave-Modus nützlich, in dem MPlayer durch Eingabekommandos gesteuert werden kann. +.br +Für +.B gmplayer +ist \-idle der Standard, \-noidle beendet die GUI, nachdem alle Dateien +wiedergegeben worden sind. . .TP .B \-input diff -r b1bda1dded08 -r d068eac6cbf9 DOCS/man/en/mplayer.1 --- a/DOCS/man/en/mplayer.1 Sun Jun 05 14:54:41 2011 +0000 +++ b/DOCS/man/en/mplayer.1 Mon Jun 06 11:55:35 2011 +0000 @@ -1089,6 +1089,11 @@ Makes MPlayer wait idly instead of quitting when there is no file to play. Mostly useful in slave mode where MPlayer can be controlled through input commands. +.br +For +.B gmplayer +\-idle is the default, \-noidle will quit the GUI after all files have been +played. . .TP .B \-input diff -r b1bda1dded08 -r d068eac6cbf9 gui/cfg.c --- a/gui/cfg.c Sun Jun 05 14:54:41 2011 +0000 +++ b/gui/cfg.c Mon Jun 06 11:55:35 2011 +0000 @@ -256,6 +256,8 @@ char *cfg; FILE *f; + player_idle_mode = 1; // GUI is in idle mode by default + // configuration cfg = get_path("gui.conf"); diff -r b1bda1dded08 -r d068eac6cbf9 help/help_mp-cs.h --- a/help/help_mp-cs.h Sun Jun 05 14:54:41 2011 +0000 +++ b/help/help_mp-cs.h Mon Jun 06 11:55:35 2011 +0000 @@ -150,7 +150,6 @@ #define MSGTR_IncreaseRTCMaxUserFreq "Zkuste přidat \"echo %lu > /proc/sys/dev/rtc/max-user-freq\" do startovacích\n skriptů vašeho systému.\n" #define MSGTR_LinuxRTCInitErrorPieOn "Chyba inicializace Linuxových RTC v ioctl (rtc_pie_on): %s\n" #define MSGTR_UsingTimingType "Používám %s časování.\n" -#define MSGTR_NoIdleAndGui "Volbu -idle nelze použít pro GMPlayer.\n" #define MSGTR_MenuInitialized "Menu inicializováno: %s\n" #define MSGTR_MenuInitFailed "Selhala inicializace menu.\n" #define MSGTR_Getch2InitializedTwice "VAROVÁNÍ: getch2_init volána dvakrát!\n" diff -r b1bda1dded08 -r d068eac6cbf9 help/help_mp-de.h --- a/help/help_mp-de.h Sun Jun 05 14:54:41 2011 +0000 +++ b/help/help_mp-de.h Mon Jun 06 11:55:35 2011 +0000 @@ -170,7 +170,6 @@ #define MSGTR_IncreaseRTCMaxUserFreq "Versuche, \"echo %lu > /proc/sys/dev/rtc/max-user-freq\" zu deinen Systemstartskripten hinzuzufügen.\n" #define MSGTR_LinuxRTCInitErrorPieOn "Linux-RTC-Initialisierungsfehler in ioctl (rtc_pie_on): %s\n" #define MSGTR_UsingTimingType "Benutze %s-Zeitgeber.\n" -#define MSGTR_NoIdleAndGui "Die Option -idle kann mit GMPlayer nicht verwendet werden.\n" #define MSGTR_MenuInitialized "Menü initialisiert: %s\n" #define MSGTR_MenuInitFailed "Initialisierung des Menüs fehlgeschlagen.\n" #define MSGTR_Getch2InitializedTwice "WARNUNG: getch2_init doppelt aufgerufen!\n" diff -r b1bda1dded08 -r d068eac6cbf9 help/help_mp-en.h --- a/help/help_mp-en.h Sun Jun 05 14:54:41 2011 +0000 +++ b/help/help_mp-en.h Mon Jun 06 11:55:35 2011 +0000 @@ -159,7 +159,6 @@ #define MSGTR_IncreaseRTCMaxUserFreq "Try adding \"echo %lu > /proc/sys/dev/rtc/max-user-freq\" to your system startup scripts.\n" #define MSGTR_LinuxRTCInitErrorPieOn "Linux RTC init error in ioctl (rtc_pie_on): %s\n" #define MSGTR_UsingTimingType "Using %s timing.\n" -#define MSGTR_NoIdleAndGui "The -idle option cannot be used with GMPlayer.\n" #define MSGTR_MenuInitialized "Menu initialized: %s\n" #define MSGTR_MenuInitFailed "Menu init failed.\n" #define MSGTR_Getch2InitializedTwice "WARNING: getch2_init called twice!\n" diff -r b1bda1dded08 -r d068eac6cbf9 help/help_mp-es.h --- a/help/help_mp-es.h Sun Jun 05 14:54:41 2011 +0000 +++ b/help/help_mp-es.h Mon Jun 06 11:55:35 2011 +0000 @@ -164,7 +164,6 @@ #define MSGTR_IncreaseRTCMaxUserFreq "Pruebe agregando \"echo %lu > /proc/sys/dev/rtc/max-user-freq\" a los scripts de inicio de su sistema.\n" #define MSGTR_LinuxRTCInitErrorPieOn "Error iniciando Linux RTC en llamada a ioctl (rtc_pie_on): %s\n" #define MSGTR_UsingTimingType "Usando temporización %s.\n" -#define MSGTR_NoIdleAndGui "La opción -idle no puede usarse con GMPlayer.\n" #define MSGTR_MenuInitialized "Menú inicializado: %s\n" #define MSGTR_MenuInitFailed "Fallo en inicialización del menú.\n" #define MSGTR_Getch2InitializedTwice "ADVERTENCIA: getch2_init llamada dos veces!\n" diff -r b1bda1dded08 -r d068eac6cbf9 help/help_mp-fr.h --- a/help/help_mp-fr.h Sun Jun 05 14:54:41 2011 +0000 +++ b/help/help_mp-fr.h Mon Jun 06 11:55:35 2011 +0000 @@ -155,7 +155,6 @@ #define MSGTR_IncreaseRTCMaxUserFreq "Essayer ajout \"echo %lu > /proc/sys/dev/rtc/max-user-freq\" au script de démarrage de votre système.\n" #define MSGTR_LinuxRTCInitErrorPieOn "Erreur init RTC Linux dans ioctl (rtc_pie_on) : %s\n" #define MSGTR_UsingTimingType "Utilisation de minuterie %s.\n" -#define MSGTR_NoIdleAndGui "L'option -idle ne peut être utilisée avec GMPlayer.\n" #define MSGTR_MenuInitialized "Menu initialisé : %s\n" #define MSGTR_MenuInitFailed "Échec d'initialisation du menu.\n" #define MSGTR_Getch2InitializedTwice "ATTENTION : getch2_init appelé deux fois !\n" diff -r b1bda1dded08 -r d068eac6cbf9 help/help_mp-hu.h --- a/help/help_mp-hu.h Sun Jun 05 14:54:41 2011 +0000 +++ b/help/help_mp-hu.h Mon Jun 06 11:55:35 2011 +0000 @@ -155,7 +155,6 @@ #define MSGTR_IncreaseRTCMaxUserFreq "Próbáld ki ezt: \"echo %lu > /proc/sys/dev/rtc/max-user-freq\" hozzáadni a rendszer indító script-jeidhez!\n" #define MSGTR_LinuxRTCInitErrorPieOn "Linux RTC inicializálási hiba az ioctl-ben (rtc_pie_on): %s\n" #define MSGTR_UsingTimingType "%s időzítés használata.\n" -#define MSGTR_NoIdleAndGui "Az -idle opció nem használható a GMPlayerrel.\n" #define MSGTR_MenuInitialized "Menü inicializálva: %s\n" #define MSGTR_MenuInitFailed "Menü inicializálás nem sikerült.\n" #define MSGTR_Getch2InitializedTwice "FIGYELEM: getch2_init kétszer lett meghívva!\n" diff -r b1bda1dded08 -r d068eac6cbf9 help/help_mp-it.h --- a/help/help_mp-it.h Sun Jun 05 14:54:41 2011 +0000 +++ b/help/help_mp-it.h Mon Jun 06 11:55:35 2011 +0000 @@ -156,7 +156,6 @@ "agli script di avvio del sistema.\n" #define MSGTR_LinuxRTCInitErrorPieOn "Linux RTC: errore di init in ioctl (rtc_pie_on): %s\n" #define MSGTR_UsingTimingType "Uso la temporizzazione %s.\n" -#define MSGTR_NoIdleAndGui "L'opzione -idle non può essere usata con GMPlayer.\n" #define MSGTR_MenuInitialized "Menu inizializzato: %s\n" #define MSGTR_MenuInitFailed "Inizializzazione Menu fallita.\n" #define MSGTR_Getch2InitializedTwice "WARNING: getch2_init chiamata 2 volte!\n" diff -r b1bda1dded08 -r d068eac6cbf9 help/help_mp-pl.h --- a/help/help_mp-pl.h Sun Jun 05 14:54:41 2011 +0000 +++ b/help/help_mp-pl.h Mon Jun 06 11:55:35 2011 +0000 @@ -150,7 +150,6 @@ #define MSGTR_IncreaseRTCMaxUserFreq "Spróbuj dodać \"echo %lu > /proc/sys/dev/rtc/max-user-freq\" do skryptów startowych swojego systemu.\n" #define MSGTR_LinuxRTCInitErrorPieOn "Błąd RTC Linuxa w ioctl (rtc_pie_on): %s\n" #define MSGTR_UsingTimingType "Używam synchronizacji %s.\n" -#define MSGTR_NoIdleAndGui "Opcja -idle nie może być używana z GMPlayer.\n" #define MSGTR_MenuInitialized "Menu zainicjowane: %s\n" #define MSGTR_MenuInitFailed "Nie mogę zainicjować menu.\n" #define MSGTR_Getch2InitializedTwice "UWAGA: getch2_init wywołany dwukrotnie!\n" diff -r b1bda1dded08 -r d068eac6cbf9 help/help_mp-ru.h --- a/help/help_mp-ru.h Sun Jun 05 14:54:41 2011 +0000 +++ b/help/help_mp-ru.h Mon Jun 06 11:55:35 2011 +0000 @@ -152,7 +152,6 @@ #define MSGTR_IncreaseRTCMaxUserFreq "Попробуйте добавить \"echo %lu > /proc/sys/dev/rtc/max-user-freq\" \nв загрузочные скрипты Вашей системы.\n" #define MSGTR_LinuxRTCInitErrorPieOn "Ошибка инициализации Linux RTC в ioctl (rtc_pie_on): %s\n" #define MSGTR_UsingTimingType "Используется %s синхронизация.\n" -#define MSGTR_NoIdleAndGui "Опция -idle не может быть использована вместе с GMPlayer.\n" #define MSGTR_MenuInitialized "Меню инициализировано: %s\n" #define MSGTR_MenuInitFailed "Не могу инициализировать меню.\n" #define MSGTR_Getch2InitializedTwice "ПРЕДУПРЕЖДЕНИЕ: getch2_init вызван дважды!\n" diff -r b1bda1dded08 -r d068eac6cbf9 help/help_mp-sk.h --- a/help/help_mp-sk.h Sun Jun 05 14:54:41 2011 +0000 +++ b/help/help_mp-sk.h Mon Jun 06 11:55:35 2011 +0000 @@ -150,7 +150,6 @@ #define MSGTR_IncreaseRTCMaxUserFreq "Skúste pridať \"echo %lu > /proc/sys/dev/rtc/max-user-freq\" do štartovacích skriptov vášho systému.\n" #define MSGTR_LinuxRTCInitErrorPieOn "Chyba pri inicializácii Linuxových RTC v ioctl (rtc_pie_on): %s\n" #define MSGTR_UsingTimingType "Používam %s časovanie.\n" -#define MSGTR_NoIdleAndGui "Voľba -idle sa nedá použiť pre GMPlayer.\n" #define MSGTR_MenuInitialized "Menu inicializované: %s\n" #define MSGTR_MenuInitFailed "Zlyhala inicializácia menu.\n" #define MSGTR_Getch2InitializedTwice "VAROVANIE: getch2_init je volaná dvakrát!\n" diff -r b1bda1dded08 -r d068eac6cbf9 help/help_mp-tr.h --- a/help/help_mp-tr.h Sun Jun 05 14:54:41 2011 +0000 +++ b/help/help_mp-tr.h Mon Jun 06 11:55:35 2011 +0000 @@ -154,7 +154,6 @@ #define MSGTR_IncreaseRTCMaxUserFreq "\"echo %lu > /proc/sys/dev/rtc/max-user-freq\" seçeneğini sistem açılış betiklerine eklemeyi deneyiniz.\n" #define MSGTR_LinuxRTCInitErrorPieOn "ioctl'de Linux RTC açılış hatası (rtc_pie_on): %s\n" #define MSGTR_UsingTimingType "%s zamanlaması kullanılıyor.\n" -#define MSGTR_NoIdleAndGui "GMPlayer ile -idle seçeneği kullanılamaz.\n" #define MSGTR_MenuInitialized "Menü başlatıldı: %s\n" #define MSGTR_MenuInitFailed " Menü başlatılamadı.\n" #define MSGTR_Getch2InitializedTwice "UYARI:getch2_init iki defa çağırıldı!\n" diff -r b1bda1dded08 -r d068eac6cbf9 help/help_mp-uk.h --- a/help/help_mp-uk.h Sun Jun 05 14:54:41 2011 +0000 +++ b/help/help_mp-uk.h Mon Jun 06 11:55:35 2011 +0000 @@ -145,7 +145,6 @@ #define MSGTR_IncreaseRTCMaxUserFreq "Спробуйте додати \"echo %lu > /proc/sys/dev/rtc/max-user-freq\" до скриптів запуску системи.\n" #define MSGTR_LinuxRTCInitErrorPieOn "Помилка ініціалізації Linux RTC у ioctl (rtc_pie_on): %s\n" #define MSGTR_UsingTimingType "Використовую %s синхронізацію.\n" -#define MSGTR_NoIdleAndGui "Опція -idle не викориcтовується в GMPlayer.\n" #define MSGTR_MenuInitialized "Меню ініціалізовано: %s\n" #define MSGTR_MenuInitFailed "Ініціалізація меню невдале.\n" #define MSGTR_Getch2InitializedTwice "ПОПЕРЕДЖЕННЯ: getch2_init визвано двічі!\n" diff -r b1bda1dded08 -r d068eac6cbf9 help/help_mp-zh_CN.h --- a/help/help_mp-zh_CN.h Sun Jun 05 14:54:41 2011 +0000 +++ b/help/help_mp-zh_CN.h Mon Jun 06 11:55:35 2011 +0000 @@ -159,7 +159,6 @@ #define MSGTR_IncreaseRTCMaxUserFreq "尝试添加 \"echo %lu > /proc/sys/dev/rtc/max-user-freq\" 到你的系统启动脚本中。\n" #define MSGTR_LinuxRTCInitErrorPieOn "ioctl (rtc_pie_on) 中出现 Linux RTC 初始置错误:%s\n" #define MSGTR_UsingTimingType "正在使用 %s 计时。\n" -#define MSGTR_NoIdleAndGui "GMPLayer 无法使用选项 -idle。\n" #define MSGTR_MenuInitialized "菜单已初始化:%s\n" #define MSGTR_MenuInitFailed "菜单初始化失败。\n" #define MSGTR_Getch2InitializedTwice "警告:getch2_init 被两次调用!\n" diff -r b1bda1dded08 -r d068eac6cbf9 help/help_mp-zh_TW.h --- a/help/help_mp-zh_TW.h Sun Jun 05 14:54:41 2011 +0000 +++ b/help/help_mp-zh_TW.h Mon Jun 06 11:55:35 2011 +0000 @@ -154,7 +154,6 @@ #define MSGTR_IncreaseRTCMaxUserFreq "試圖添加 \"echo %lu > /proc/sys/dev/rtc/max-user-freq\" 到你的係統啟動脚本。\n" #define MSGTR_LinuxRTCInitErrorPieOn "Linux RTC 初始化錯誤在 ioctl (rtc_pie_on): %s\n" #define MSGTR_UsingTimingType "正在使用 %s 計時。\n" -#define MSGTR_NoIdleAndGui "GMPLayer 不能使用選項 -idle。\n" #define MSGTR_MenuInitialized "菜單已初始化: %s\n" #define MSGTR_MenuInitFailed "菜單初始化失敗。\n" #define MSGTR_Getch2InitializedTwice "警告: getch2_init 被調用兩次!\n" diff -r b1bda1dded08 -r d068eac6cbf9 mplayer.c --- a/mplayer.c Sun Jun 05 14:54:41 2011 +0000 +++ b/mplayer.c Mon Jun 06 11:55:35 2011 +0000 @@ -2960,18 +2960,14 @@ if (opt_exit) exit_player(EXIT_NONE); - if (player_idle_mode && use_gui) { - mp_msg(MSGT_CPLAYER, MSGL_FATAL, MSGTR_NoIdleAndGui); - exit_player_with_rc(EXIT_NONE, 1); - } - - if (!filename && !player_idle_mode) { - if (!use_gui) { + if (!filename) { + if (use_gui) + gui_no_filename = 1; + else if (!player_idle_mode) { // no file/vcd/dvd -> show HELP: mp_msg(MSGT_CPLAYER, MSGL_INFO, help_text); exit_player_with_rc(EXIT_NONE, 0); - } else - gui_no_filename = 1; + } } /* Display what configure line was used */ @@ -4173,7 +4169,7 @@ } #endif - if (use_gui || mpctx->playtree_iter != NULL || player_idle_mode) { + if ((use_gui && guiIntfStruct.Playing) || mpctx->playtree_iter != NULL || player_idle_mode) { if (!mpctx->playtree_iter) filename = NULL; mpctx->eof = 0; diff -r b1bda1dded08 -r d068eac6cbf9 mplayer.h --- a/mplayer.h Sun Jun 05 14:54:41 2011 +0000 +++ b/mplayer.h Mon Jun 06 11:55:35 2011 +0000 @@ -31,6 +31,7 @@ extern int autosync; extern int frame_dropping; extern int slave_mode; +extern int player_idle_mode; extern int use_menu; extern float audio_delay;