Author: hbelusca
Date: Fri Mar 6 23:49:49 2015
New Revision: 66593
URL:
http://svn.reactos.org/svn/reactos?rev=66593&view=rev
Log:
[MPLAY32]
- Additional improvements by Ricardo Hanke, see CORE-8477 for all the details!
- Add support for play/pause button: now we change its icon and tooltip.
- Do not block when repeatedly change play/pause state.
Modified:
trunk/reactos/base/applications/mplay32/lang/bg-BG.rc
trunk/reactos/base/applications/mplay32/lang/cs-CZ.rc
trunk/reactos/base/applications/mplay32/lang/de-DE.rc
trunk/reactos/base/applications/mplay32/lang/en-US.rc
trunk/reactos/base/applications/mplay32/lang/es-ES.rc
trunk/reactos/base/applications/mplay32/lang/fr-FR.rc
trunk/reactos/base/applications/mplay32/lang/he-IL.rc
trunk/reactos/base/applications/mplay32/lang/it-IT.rc
trunk/reactos/base/applications/mplay32/lang/ja-JP.rc
trunk/reactos/base/applications/mplay32/lang/nl-NL.rc
trunk/reactos/base/applications/mplay32/lang/no-NO.rc
trunk/reactos/base/applications/mplay32/lang/pl-PL.rc
trunk/reactos/base/applications/mplay32/lang/pt-BR.rc
trunk/reactos/base/applications/mplay32/lang/ro-RO.rc
trunk/reactos/base/applications/mplay32/lang/ru-RU.rc
trunk/reactos/base/applications/mplay32/lang/sk-SK.rc
trunk/reactos/base/applications/mplay32/lang/sq-AL.rc
trunk/reactos/base/applications/mplay32/lang/sv-SE.rc
trunk/reactos/base/applications/mplay32/lang/tr-TR.rc
trunk/reactos/base/applications/mplay32/lang/uk-UA.rc
trunk/reactos/base/applications/mplay32/lang/zh-CN.rc
trunk/reactos/base/applications/mplay32/lang/zh-TW.rc
trunk/reactos/base/applications/mplay32/mplay32.c
trunk/reactos/base/applications/mplay32/mplay32.h
trunk/reactos/base/applications/mplay32/resource.h
Modified: trunk/reactos/base/applications/mplay32/lang/bg-BG.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/bg-BG.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/bg-BG.rc [iso-8859-1] Fri Mar 6 23:49:49
2015
@@ -55,8 +55,8 @@
IDS_TOOLTIP_SEEKBACK "ТÑÑÑене назад"
IDS_TOOLTIP_SEEKFORW "ТÑÑÑене напÑед"
IDS_TOOLTIP_FORWARD "ТÑÑÑене напÑед"
+ IDS_TOOLTIP_PAUSE "Pause"
IDS_APPTITLE "ÐÑлÑимедийниÑÑ Ð²ÑзпÑоизводиÑел на
РеакÑÐС"
IDS_PLAY "ÐÑзпÑоизвеждане"
IDS_DEFAULTMCIERRMSG "No description is available for this error."
- IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename
extension."
END
Modified: trunk/reactos/base/applications/mplay32/lang/cs-CZ.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/cs-CZ.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/cs-CZ.rc [iso-8859-1] Fri Mar 6 23:49:49
2015
@@ -56,8 +56,8 @@
IDS_TOOLTIP_SEEKBACK "Posunout zpÄt"
IDS_TOOLTIP_SEEKFORW "Posunout vpÅed"
IDS_TOOLTIP_FORWARD "PÅeskoÄit vpÅed"
+ IDS_TOOLTIP_PAUSE "Pause"
IDS_APPTITLE "ReactOS PÅehrávaÄ multimédiÃ"
IDS_PLAY "PÅehrát"
IDS_DEFAULTMCIERRMSG "Pro tuto chybu nenà dostupný žádný popis."
- IDS_UNKNOWNFILEEXT "Nelze urÄit typ zaÅÃzenà z dané pÅÃpony
souboru."
END
Modified: trunk/reactos/base/applications/mplay32/lang/de-DE.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/de-DE.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/de-DE.rc [iso-8859-1] Fri Mar 6 23:49:49
2015
@@ -51,8 +51,8 @@
IDS_TOOLTIP_SEEKBACK "Schneller Rücklauf"
IDS_TOOLTIP_SEEKFORW "Schneller Vorlauf"
IDS_TOOLTIP_FORWARD "Weiter"
+ IDS_TOOLTIP_PAUSE "Pause"
IDS_APPTITLE "ReactOS Multimedia Player"
IDS_PLAY "Abspielen"
IDS_DEFAULTMCIERRMSG "Für diesen Fehler steht keine Beschreibung zur
Verfügung."
- IDS_UNKNOWNFILEEXT "Kann keinen Gerätetyp aus der angegebenen
Dateinamenerweiterung ermitteln."
END
Modified: trunk/reactos/base/applications/mplay32/lang/en-US.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/en-US.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/en-US.rc [iso-8859-1] Fri Mar 6 23:49:49
2015
@@ -51,8 +51,8 @@
IDS_TOOLTIP_SEEKBACK "Seek Backward"
IDS_TOOLTIP_SEEKFORW "Seek Forward"
IDS_TOOLTIP_FORWARD "Skip Forward"
+ IDS_TOOLTIP_PAUSE "Pause"
IDS_APPTITLE "ReactOS Multimedia Player"
IDS_PLAY "Play"
IDS_DEFAULTMCIERRMSG "No description is available for this error."
- IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename
extension."
END
Modified: trunk/reactos/base/applications/mplay32/lang/es-ES.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/es-ES.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/es-ES.rc [iso-8859-1] Fri Mar 6 23:49:49
2015
@@ -51,8 +51,8 @@
IDS_TOOLTIP_SEEKBACK "Rebobinar"
IDS_TOOLTIP_SEEKFORW "Avance rápido"
IDS_TOOLTIP_FORWARD "Siguiente marca"
+ IDS_TOOLTIP_PAUSE "Pause"
IDS_APPTITLE "Reproductor multimedia de ReactOS"
IDS_PLAY "Reproducir"
IDS_DEFAULTMCIERRMSG "No hay una descripción disponible para este error."
- IDS_UNKNOWNFILEEXT "No se puede determinar el tipo de dispositivo a partir de
la extensión del archivo."
END
Modified: trunk/reactos/base/applications/mplay32/lang/fr-FR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/fr-FR.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/fr-FR.rc [iso-8859-1] Fri Mar 6 23:49:49
2015
@@ -51,8 +51,8 @@
IDS_TOOLTIP_SEEKBACK "Retour rapide"
IDS_TOOLTIP_SEEKFORW "Avance rapide"
IDS_TOOLTIP_FORWARD "Suivant"
+ IDS_TOOLTIP_PAUSE "Pause"
IDS_APPTITLE "ReactOS Multimedia Player"
IDS_PLAY "Lire"
IDS_DEFAULTMCIERRMSG "No description is available for this error."
- IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename
extension."
END
Modified: trunk/reactos/base/applications/mplay32/lang/he-IL.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/he-IL.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/he-IL.rc [iso-8859-1] Fri Mar 6 23:49:49
2015
@@ -51,8 +51,8 @@
IDS_TOOLTIP_SEEKBACK "×פש ××××¨× ×ת"
IDS_TOOLTIP_SEEKFORW "×פש ק××××"
IDS_TOOLTIP_FORWARD "××× ×§××××"
+ IDS_TOOLTIP_PAUSE "Pause"
IDS_APPTITLE "× ×× ×××××××××× ×©× ReactOS"
IDS_PLAY "× ××"
IDS_DEFAULTMCIERRMSG "No description is available for this error."
- IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename
extension."
END
Modified: trunk/reactos/base/applications/mplay32/lang/it-IT.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/it-IT.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/it-IT.rc [iso-8859-1] Fri Mar 6 23:49:49
2015
@@ -51,8 +51,8 @@
IDS_TOOLTIP_SEEKBACK "Riavvolgimento rapido"
IDS_TOOLTIP_SEEKFORW "Avanzamento rapido"
IDS_TOOLTIP_FORWARD "Successivo"
+ IDS_TOOLTIP_PAUSE "Pause"
IDS_APPTITLE "Riproduttore multimediale ReactOS"
IDS_PLAY "Riproduci"
IDS_DEFAULTMCIERRMSG "No description is available for this error."
- IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename
extension."
END
Modified: trunk/reactos/base/applications/mplay32/lang/ja-JP.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/ja-JP.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/ja-JP.rc [iso-8859-1] Fri Mar 6 23:49:49
2015
@@ -51,8 +51,8 @@
IDS_TOOLTIP_SEEKBACK "å¾ãã¸ã·ã¼ã¯"
IDS_TOOLTIP_SEEKFORW "åã¸ã·ã¼ã¯"
IDS_TOOLTIP_FORWARD "åã¸ã¹ããã"
+ IDS_TOOLTIP_PAUSE "Pause"
IDS_APPTITLE "ReactOS ãã«ãã¡ãã£ã¢ ãã¬ã¼ã¤ã¼"
IDS_PLAY "åç"
IDS_DEFAULTMCIERRMSG "No description is available for this error."
- IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename
extension."
END
Modified: trunk/reactos/base/applications/mplay32/lang/nl-NL.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/nl-NL.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/nl-NL.rc [iso-8859-1] Fri Mar 6 23:49:49
2015
@@ -51,8 +51,8 @@
IDS_TOOLTIP_SEEKBACK "Terugspoelen"
IDS_TOOLTIP_SEEKFORW "Vooruitspoelen"
IDS_TOOLTIP_FORWARD "Volgende"
+ IDS_TOOLTIP_PAUSE "Pause"
IDS_APPTITLE "ReactOS Multimedia Player"
IDS_PLAY "Play"
IDS_DEFAULTMCIERRMSG "No description is available for this error."
- IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename
extension."
END
Modified: trunk/reactos/base/applications/mplay32/lang/no-NO.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/no-NO.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/no-NO.rc [iso-8859-1] Fri Mar 6 23:49:49
2015
@@ -51,8 +51,8 @@
IDS_TOOLTIP_SEEKBACK "Søke tilbake"
IDS_TOOLTIP_SEEKFORW "Søke fremover"
IDS_TOOLTIP_FORWARD "Spole fremover"
+ IDS_TOOLTIP_PAUSE "Pause"
IDS_APPTITLE "ReactOS Multimedia avspiller"
IDS_PLAY "Spill"
IDS_DEFAULTMCIERRMSG "No description is available for this error."
- IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename
extension."
END
Modified: trunk/reactos/base/applications/mplay32/lang/pl-PL.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/pl-PL.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/pl-PL.rc [iso-8859-1] Fri Mar 6 23:49:49
2015
@@ -59,8 +59,8 @@
IDS_TOOLTIP_SEEKBACK "PrzewiÅ do tyÅu"
IDS_TOOLTIP_SEEKFORW "PrzewiÅ do przodu"
IDS_TOOLTIP_FORWARD "Przeskocz do przodu"
+ IDS_TOOLTIP_PAUSE "Pause"
IDS_APPTITLE "Odtwarzacz multimedialny ReactOS"
IDS_PLAY "Odtwórz"
IDS_DEFAULTMCIERRMSG "Brak dostÄpnego opisu dla tego bÅÄdu."
- IDS_UNKNOWNFILEEXT "Nie można okreÅliÄ typu urzÄ
dzenia z podanego rozszerzenia pliku."
END
Modified: trunk/reactos/base/applications/mplay32/lang/pt-BR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/pt-BR.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/pt-BR.rc [iso-8859-1] Fri Mar 6 23:49:49
2015
@@ -53,8 +53,8 @@
IDS_TOOLTIP_SEEKBACK "Procurar Anterior"
IDS_TOOLTIP_SEEKFORW "Procurar Próximo"
IDS_TOOLTIP_FORWARD "Pular Próxima"
+ IDS_TOOLTIP_PAUSE "Pause"
IDS_APPTITLE "ReactOS Multimedia Player"
IDS_PLAY "Executar"
IDS_DEFAULTMCIERRMSG "No description is available for this error."
- IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename
extension."
END
Modified: trunk/reactos/base/applications/mplay32/lang/ro-RO.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/ro-RO.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/ro-RO.rc [iso-8859-1] Fri Mar 6 23:49:49
2015
@@ -57,8 +57,8 @@
IDS_TOOLTIP_SEEKBACK "DeruleazÄ Ã®napoi"
IDS_TOOLTIP_SEEKFORW "DeruleazÄ Ã®nainte"
IDS_TOOLTIP_FORWARD "Salt la urmÄtor"
+ IDS_TOOLTIP_PAUSE "Pause"
IDS_APPTITLE "Lector multimedia"
IDS_PLAY "Lecturare"
IDS_DEFAULTMCIERRMSG "Nu existÄ descriere pentru aceastÄ eroare."
- IDS_UNKNOWNFILEEXT "Nu se poate determina tipul dispozitivului din extensia
fiÈierului."
END
Modified: trunk/reactos/base/applications/mplay32/lang/ru-RU.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/ru-RU.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/ru-RU.rc [iso-8859-1] Fri Mar 6 23:49:49
2015
@@ -51,8 +51,8 @@
IDS_TOOLTIP_SEEKBACK "ÐеÑемоÑка назад"
IDS_TOOLTIP_SEEKFORW "ÐеÑемоÑка впеÑед"
IDS_TOOLTIP_FORWARD "ÐпеÑед"
+ IDS_TOOLTIP_PAUSE "Pause"
IDS_APPTITLE "ÐÑоигÑÑваÑÐµÐ»Ñ ReactOS"
IDS_PLAY "ÐоÑпÑоизвеÑÑи"
IDS_DEFAULTMCIERRMSG "ÐеизвеÑÑÐ½Ð°Ñ Ð¾Ñибка."
- IDS_UNKNOWNFILEEXT "Ðевозможно опÑеделиÑÑ Ñип
ÑÑÑÑойÑÑва мÑлÑÑимедиа Ð´Ð»Ñ Ð·Ð°Ð´Ð°Ð½Ð½Ð¾Ð³Ð¾ ÑаÑÑиÑениÑ
Ñайла."
END
Modified: trunk/reactos/base/applications/mplay32/lang/sk-SK.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/sk-SK.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/sk-SK.rc [iso-8859-1] Fri Mar 6 23:49:49
2015
@@ -56,8 +56,8 @@
IDS_TOOLTIP_SEEKBACK "Vyhľadať dozadu"
IDS_TOOLTIP_SEEKFORW "Vyhľadať dopredu"
IDS_TOOLTIP_FORWARD "PreskoÄiÅ¥ dopredu"
+ IDS_TOOLTIP_PAUSE "Pause"
IDS_APPTITLE "Multimediálny prehrávaÄ systému ReactOS"
IDS_PLAY "Prehrať"
IDS_DEFAULTMCIERRMSG "No description is available for this error."
- IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename
extension."
END
Modified: trunk/reactos/base/applications/mplay32/lang/sq-AL.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/sq-AL.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/sq-AL.rc [iso-8859-1] Fri Mar 6 23:49:49
2015
@@ -55,8 +55,8 @@
IDS_TOOLTIP_SEEKBACK "Kërko mbrapa"
IDS_TOOLTIP_SEEKFORW "Kërko përpara"
IDS_TOOLTIP_FORWARD "Kalo para"
+ IDS_TOOLTIP_PAUSE "Pause"
IDS_APPTITLE "Programi muzikor i ReactOS"
IDS_PLAY "Fillo"
IDS_DEFAULTMCIERRMSG "No description is available for this error."
- IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename
extension."
END
Modified: trunk/reactos/base/applications/mplay32/lang/sv-SE.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/sv-SE.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/sv-SE.rc [iso-8859-1] Fri Mar 6 23:49:49
2015
@@ -58,8 +58,8 @@
IDS_TOOLTIP_SEEKBACK "Sök bakåt"
IDS_TOOLTIP_SEEKFORW "Sök framåt"
IDS_TOOLTIP_FORWARD "Spola fremåt"
+ IDS_TOOLTIP_PAUSE "Pause"
IDS_APPTITLE "ReactOS Multimediaspelare"
IDS_PLAY "Play"
IDS_DEFAULTMCIERRMSG "No description is available for this error."
- IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename
extension."
END
Modified: trunk/reactos/base/applications/mplay32/lang/tr-TR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/tr-TR.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/tr-TR.rc [iso-8859-1] Fri Mar 6 23:49:49
2015
@@ -53,8 +53,8 @@
IDS_TOOLTIP_SEEKBACK "Geri Sar"
IDS_TOOLTIP_SEEKFORW "Ä°leri Sar"
IDS_TOOLTIP_FORWARD "Bir Sonrakine Geç"
+ IDS_TOOLTIP_PAUSE "Pause"
IDS_APPTITLE "Ãoklu Ortam Oynatıcısı"
IDS_PLAY "Ãal"
IDS_DEFAULTMCIERRMSG "Bu yanlıÅlıÄın tanımı yoktur."
- IDS_UNKNOWNFILEEXT "Verilen kütük türünden aygıt türü
belirlenemiyor."
END
Modified: trunk/reactos/base/applications/mplay32/lang/uk-UA.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/uk-UA.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/uk-UA.rc [iso-8859-1] Fri Mar 6 23:49:49
2015
@@ -59,8 +59,8 @@
IDS_TOOLTIP_SEEKBACK "ÐеÑемоÑÑÐ²Ð°Ð½Ð½Ñ Ð½Ð°Ð·Ð°Ð´"
IDS_TOOLTIP_SEEKFORW "ÐеÑемоÑÑÐ²Ð°Ð½Ð½Ñ Ð²Ð¿ÐµÑед"
IDS_TOOLTIP_FORWARD "ÐпеÑед"
+ IDS_TOOLTIP_PAUSE "Pause"
IDS_APPTITLE "ÐÑогÑÐ°Ð²Ð°Ñ ReactOS"
IDS_PLAY "ÐÑдÑвоÑиÑи"
IDS_DEFAULTMCIERRMSG "No description is available for this error."
- IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename
extension."
END
Modified: trunk/reactos/base/applications/mplay32/lang/zh-CN.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/zh-CN.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/zh-CN.rc [iso-8859-1] Fri Mar 6 23:49:49
2015
@@ -53,8 +53,8 @@
IDS_TOOLTIP_SEEKBACK "å¿«é"
IDS_TOOLTIP_SEEKFORW "å¿«è¿"
IDS_TOOLTIP_FORWARD "ååè·³è¿"
+ IDS_TOOLTIP_PAUSE "Pause"
IDS_APPTITLE "ReactOS å¤åªä½ææ¾å¨"
IDS_PLAY "ææ¾"
IDS_DEFAULTMCIERRMSG "该é误没æå¯ç¨çæè¿°."
- IDS_UNKNOWNFILEEXT
"该设å¤ç±»åä»ç»å®çæ件æ©å±åæ æ³æå®."
END
Modified: trunk/reactos/base/applications/mplay32/lang/zh-TW.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/zh-TW.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/zh-TW.rc [iso-8859-1] Fri Mar 6 23:49:49
2015
@@ -59,8 +59,8 @@
IDS_TOOLTIP_SEEKBACK "å¾é"
IDS_TOOLTIP_SEEKFORW "åé²"
IDS_TOOLTIP_FORWARD "å¿«è½"
+ IDS_TOOLTIP_PAUSE "Pause"
IDS_APPTITLE "ReactOS å¤åªé«ææ¾å¨"
IDS_PLAY "ææ¾"
IDS_DEFAULTMCIERRMSG "No description is available for this error."
- IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename
extension."
END
Modified: trunk/reactos/base/applications/mplay32/mplay32.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/mplay32.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/mplay32.c [iso-8859-1] Fri Mar 6 23:49:49
2015
@@ -6,6 +6,8 @@
#include "mplay32.h"
+#define IDT_PLAYTIMER 1000
+
#define MAIN_WINDOW_HEIGHT 125
#define MAIN_WINDOW_MIN_WIDTH 250
#define MAX_MCISTR 256
@@ -20,9 +22,7 @@
TCHAR szDefaultFilter[MAX_PATH] = _T("");
TCHAR *szFilter = NULL;
-WORD wDeviceId;
-BOOL bIsOpened = FALSE;
-BOOL bIsPaused = FALSE;
+WORD wDeviceId = 0;
BOOL bRepeat = FALSE;
BOOL bIsSingleWindow = FALSE;
UINT MaxFilePos = 0;
@@ -39,7 +39,8 @@
{TBICON_BACKWARD, IDC_BACKWARD, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0},
{TBICON_SEEKBACK, IDC_SEEKBACK, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0},
{TBICON_SEEKFORW, IDC_SEEKFORW, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0},
- {TBICON_FORWARD, IDC_FORWARD, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0}
+ {TBICON_FORWARD, IDC_FORWARD, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0},
+// {TBICON_PAUSE, IDC_PAUSE, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0}
};
void EnableMenuItems(HWND hwnd)
@@ -47,7 +48,7 @@
MCIERROR mciError;
MCI_GENERIC_PARMS mciGeneric;
MCI_DGV_RECT_PARMS mciVideoRect;
- MCI_DGV_WINDOW_PARMSW mciVideoWindow;
+ MCI_DGV_WINDOW_PARMSW mciVideoWindow;
EnableMenuItem(hMainMenu, IDM_CLOSE_FILE, MF_BYCOMMAND | MF_ENABLED);
@@ -59,7 +60,7 @@
mciVideoWindow.hWnd = hwnd;
- mciError = mciSendCommand(wDeviceId, MCI_WINDOW, MCI_DGV_WINDOW_HWND | MCI_TEST,
(DWORD_PTR)&mciVideoWindow);
+ mciError = mciSendCommand(wDeviceId, MCI_WINDOW, MCI_DGV_WINDOW_HWND | MCI_TEST,
(DWORD_PTR)&mciVideoWindow);
if (!mciError)
{
mciError = mciSendCommand(wDeviceId, MCI_WHERE, MCI_DGV_WHERE_SOURCE | MCI_TEST,
(DWORD_PTR)&mciVideoRect);
@@ -148,6 +149,10 @@
LoadImage(hInstance, MAKEINTRESOURCE(IDB_FORWARDICON),
IMAGE_BITMAP, 16, 16, LR_DEFAULTCOLOR),
RGB(255, 255, 255));
+ ImageList_AddMasked(hImageList,
+ LoadImage(hInstance, MAKEINTRESOURCE(IDB_PAUSEICON),
IMAGE_BITMAP, 16, 16, LR_DEFAULTCOLOR),
+ RGB(255, 255, 255));
+
ImageList_Destroy((HIMAGELIST)SendMessage(hToolBar,
TB_SETIMAGELIST,
0,
@@ -160,9 +165,9 @@
TCHAR szErrorMessage[MAX_MCISTR];
TCHAR szTempMessage[MAX_MCISTR + 44];
- if (mciGetErrorString(mciError, szErrorMessage, sizeof(szErrorMessage) /
sizeof(szErrorMessage[0])) == FALSE)
- {
- LoadString(hInstance, IDS_DEFAULTMCIERRMSG, szErrorMessage,
sizeof(szErrorMessage) / sizeof(szErrorMessage[0]));
+ if (mciGetErrorString(mciError, szErrorMessage, ARRAYSIZE(szErrorMessage)) == FALSE)
+ {
+ LoadString(hInstance, IDS_DEFAULTMCIERRMSG, szErrorMessage,
ARRAYSIZE(szErrorMessage));
}
StringCbPrintf(szTempMessage, sizeof(szTempMessage), _T("MMSYS%lu: %s"),
mciError, szErrorMessage);
@@ -172,7 +177,7 @@
static VOID
InitControls(HWND hwnd)
{
- INT NumButtons = sizeof(Buttons) / sizeof(Buttons[0]);
+ INT NumButtons = ARRAYSIZE(Buttons);
InitCommonControls();
@@ -219,63 +224,24 @@
SendMessage(hToolBar, TB_ADDBUTTONS, NumButtons, (LPARAM)Buttons);
}
-static BOOL
-IsSupportedFileExtension(LPTSTR lpFileName, LPTSTR lpDeviceName, LPDWORD dwSize)
-{
- HKEY hKey;
- DWORD dwType;
- TCHAR *pathend;
-
- pathend = _tcsrchr(lpFileName, '.');
-
- if (pathend == NULL)
- {
- return FALSE;
- }
-
- pathend++;
-
- if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Microsoft\\Windows
NT\\CurrentVersion\\MCI Extensions"), 0, KEY_READ, &hKey) == ERROR_SUCCESS)
- {
- if (RegQueryValueEx(hKey, pathend, NULL, &dwType, (LPBYTE)lpDeviceName,
dwSize) == ERROR_SUCCESS)
- {
- RegCloseKey(hKey);
- if (dwType != REG_SZ)
- {
- return FALSE;
- }
-
- return TRUE;
- }
-
- RegCloseKey(hKey);
- }
-
- return FALSE;
-}
-
static VOID
SwitchViewMode(HWND hwnd)
{
MCIERROR mciError;
MCI_DGV_RECT_PARMS mciVideoRect;
- MCI_DGV_WINDOW_PARMSW mciVideoWindow;
+ MCI_DGV_WINDOW_PARMSW mciVideoWindow;
RECT rcToolbarRect;
RECT rcTempRect;
mciVideoWindow.hWnd = hwnd;
- mciError = mciSendCommand(wDeviceId, MCI_WINDOW, MCI_DGV_WINDOW_HWND | MCI_TEST,
(DWORD_PTR)&mciVideoWindow);
- if (mciError)
- {
+ mciError = mciSendCommand(wDeviceId, MCI_WINDOW, MCI_DGV_WINDOW_HWND | MCI_TEST,
(DWORD_PTR)&mciVideoWindow);
+ if (mciError != 0)
return;
- }
mciError = mciSendCommand(wDeviceId, MCI_WHERE, MCI_DGV_WHERE_SOURCE | MCI_TEST,
(DWORD_PTR)&mciVideoRect);
- if (mciError)
- {
+ if (mciError != 0)
return;
- }
if (!bIsSingleWindow)
{
@@ -284,17 +250,17 @@
SetParent(hTrackBar, hToolBar);
mciError = mciSendCommand(wDeviceId, MCI_WHERE, MCI_DGV_WHERE_SOURCE,
(DWORD_PTR)&mciVideoRect);
- if (mciError)
+ if (mciError != 0)
{
ShowMCIError(hwnd, mciError);
return;
}
- GetWindowRect(hToolBar, &rcToolbarRect);
+ GetWindowRect(hToolBar, &rcToolbarRect);
ResizeClientArea(hwnd, mciVideoRect.rc.right, mciVideoRect.rc.bottom +
(rcToolbarRect.bottom - rcToolbarRect.top));
- mciError = mciSendCommand(wDeviceId, MCI_WINDOW, MCI_DGV_WINDOW_HWND,
(DWORD_PTR)&mciVideoWindow);
- if (mciError)
+ mciError = mciSendCommand(wDeviceId, MCI_WINDOW, MCI_DGV_WINDOW_HWND,
(DWORD_PTR)&mciVideoWindow);
+ if (mciError != 0)
{
ShowMCIError(hwnd, mciError);
return;
@@ -313,7 +279,7 @@
mciVideoWindow.hWnd = MCI_DGV_WINDOW_DEFAULT;
mciError = mciSendCommand(wDeviceId, MCI_WINDOW, MCI_DGV_WINDOW_HWND,
(DWORD_PTR)&mciVideoWindow);
- if (mciError)
+ if (mciError != 0)
{
ShowMCIError(hwnd, mciError);
return;
@@ -371,10 +337,8 @@
mciOpen.lpstrAlias = NULL;
mciError = mciSendCommand(0, MCI_OPEN, MCI_OPEN_TYPE | MCI_WAIT,
(DWORD_PTR)&mciOpen);
- if (mciError)
- {
+ if (mciError != 0)
return mciError;
- }
mciInfo.dwCallback = 0;
mciInfo.lpstrReturn = lpFriendlyName;
@@ -388,17 +352,17 @@
return mciError;
}
-static DWORD
+static MCIERROR
CloseMciDevice(VOID)
{
MCIERROR mciError;
MCI_GENERIC_PARMS mciGeneric;
- if (bIsOpened)
+ if (wDeviceId)
{
mciError = mciSendCommand(wDeviceId, MCI_CLOSE, MCI_WAIT,
(DWORD_PTR)&mciGeneric);
- if (mciError) return mciError;
- bIsOpened = FALSE;
+ if (mciError != 0) return mciError;
+ wDeviceId = 0;
}
DisableMenuItems();
@@ -406,18 +370,17 @@
return 0;
}
-static DWORD
+static MCIERROR
OpenMciDevice(HWND hwnd, LPTSTR lpType, LPTSTR lpFileName)
{
MCIERROR mciError;
MCI_STATUS_PARMS mciStatus;
MCI_OPEN_PARMS mciOpen;
- TCHAR szNewTitle[MAX_PATH + 128];
-
- if (bIsOpened)
- {
+ DWORD dwFlags = MCI_OPEN_ELEMENT | MCI_WAIT;
+ TCHAR szNewTitle[MAX_PATH + 3 + 256];
+
+ if (wDeviceId)
CloseMciDevice();
- }
mciOpen.lpstrDeviceType = lpType;
mciOpen.lpstrElementName = lpFileName;
@@ -425,41 +388,40 @@
mciOpen.wDeviceID = 0;
mciOpen.lpstrAlias = NULL;
- mciError = mciSendCommand(0, MCI_OPEN, MCI_OPEN_TYPE | MCI_OPEN_ELEMENT | MCI_WAIT,
(DWORD_PTR)&mciOpen);
+ if (lpType)
+ dwFlags |= MCI_OPEN_TYPE;
+
+ mciError = mciSendCommand(0, MCI_OPEN, dwFlags, (DWORD_PTR)&mciOpen);
if (mciError != 0)
- {
return mciError;
- }
mciStatus.dwItem = MCI_STATUS_LENGTH;
mciError = mciSendCommand(mciOpen.wDeviceID, MCI_STATUS, MCI_STATUS_ITEM | MCI_WAIT,
(DWORD_PTR)&mciStatus);
if (mciError != 0)
- {
return mciError;
- }
-
- SendMessage(hTrackBar, TBM_SETRANGEMIN, (WPARAM) TRUE, (LPARAM) 1);
- SendMessage(hTrackBar, TBM_SETRANGEMAX, (WPARAM) TRUE, (LPARAM) mciStatus.dwReturn);
+
+ SendMessage(hTrackBar, TBM_SETRANGEMIN, (WPARAM)TRUE, (LPARAM)1);
+ SendMessage(hTrackBar, TBM_SETRANGEMAX, (WPARAM)TRUE, (LPARAM)mciStatus.dwReturn);
SendMessage(hTrackBar, TBM_SETPAGESIZE, 0, 10);
SendMessage(hTrackBar, TBM_SETLINESIZE, 0, 1);
- SendMessage(hTrackBar, TBM_SETPOS, (WPARAM) TRUE, (LPARAM) 1);
+ SendMessage(hTrackBar, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)1);
if (mciStatus.dwReturn < 10000)
{
- SendMessage(hTrackBar, TBM_SETTICFREQ, (WPARAM) 100, (LPARAM) 0);
+ SendMessage(hTrackBar, TBM_SETTICFREQ, (WPARAM)100, (LPARAM)0);
}
else if (mciStatus.dwReturn < 100000)
{
- SendMessage(hTrackBar, TBM_SETTICFREQ, (WPARAM) 1000, (LPARAM) 0);
+ SendMessage(hTrackBar, TBM_SETTICFREQ, (WPARAM)1000, (LPARAM)0);
}
else if (mciStatus.dwReturn < 1000000)
{
- SendMessage(hTrackBar, TBM_SETTICFREQ, (WPARAM) 10000, (LPARAM) 0);
+ SendMessage(hTrackBar, TBM_SETTICFREQ, (WPARAM)10000, (LPARAM)0);
}
else
{
- SendMessage(hTrackBar, TBM_SETTICFREQ, (WPARAM) 100000, (LPARAM) 0);
+ SendMessage(hTrackBar, TBM_SETTICFREQ, (WPARAM)100000, (LPARAM)0);
}
StringCbPrintf(szNewTitle, sizeof(szNewTitle), _T("%s - %s"), szAppTitle,
lpFileName);
@@ -467,7 +429,6 @@
MaxFilePos = mciStatus.dwReturn;
wDeviceId = mciOpen.wDeviceID;
- bIsOpened = TRUE;
StringCbCopy(szPrevFile, sizeof(szPrevFile), lpFileName);
EnableMenuItems(hwnd);
@@ -475,21 +436,52 @@
return 0;
}
+static DWORD
+GetDeviceMode(HWND hwnd)
+{
+ MCIERROR mciError;
+ MCI_STATUS_PARMS mciStatus;
+
+ mciStatus.dwItem = MCI_STATUS_MODE;
+ mciError = mciSendCommand(wDeviceId, MCI_STATUS, MCI_WAIT | MCI_STATUS_ITEM,
(DWORD_PTR)&mciStatus);
+ if (mciError != 0)
+ {
+ ShowMCIError(hwnd, mciError);
+ return MCI_MODE_NOT_READY;
+ }
+
+ return mciStatus.dwReturn;
+}
+
static VOID
StopPlayback(HWND hwnd)
{
- if (bIsOpened)
- {
- SendMessage(hTrackBar, TBM_SETPOS, (WPARAM) TRUE, (LPARAM) 1);
- KillTimer(hwnd, IDT_PLAYTIMER);
-
- if (bIsSingleWindow)
- {
- SwitchViewMode(hwnd);
- }
-
- CloseMciDevice();
- }
+ MCIERROR mciError;
+ MCI_GENERIC_PARMS mciGeneric;
+
+ if (wDeviceId == 0) return;
+
+ SendMessage(hTrackBar, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)1);
+ KillTimer(hwnd, IDT_PLAYTIMER);
+
+ mciGeneric.dwCallback = (DWORD_PTR)hwnd;
+ mciError = mciSendCommand(wDeviceId, MCI_STOP, MCI_NOTIFY,
(DWORD_PTR)&mciGeneric);
+ if (mciError != 0)
+ {
+ ShowMCIError(hwnd, mciError);
+ return;
+ }
+
+ mciSendCommand(wDeviceId, MCI_SEEK, MCI_WAIT | MCI_SEEK_TO_START, 0);
+
+ SendMessage(hToolBar,
+ TB_SETCMDID,
+ 0,
+ IDC_PLAY);
+ SendMessage(hToolBar,
+ TB_CHANGEBITMAP,
+ IDC_PLAY,
+ IDB_PLAYICON - IDB_PLAYICON);
}
static VOID
@@ -499,21 +491,20 @@
MCI_SEEK_PARMS mciSeek;
MCI_PLAY_PARMS mciPlay;
- if (bIsOpened)
- {
- mciSeek.dwTo = (DWORD_PTR)dwNewPos;
- mciError = mciSendCommand(wDeviceId, MCI_SEEK, MCI_WAIT | MCI_TO,
(DWORD_PTR)&mciSeek);
- if (mciError != 0)
- {
- ShowMCIError(hwnd, mciError);
- }
-
- mciPlay.dwCallback = (DWORD_PTR)hwnd;
- mciError = mciSendCommand(wDeviceId, MCI_PLAY, MCI_NOTIFY,
(DWORD_PTR)&mciPlay);
- if (mciError != 0)
- {
- ShowMCIError(hwnd, mciError);
- }
+ if (wDeviceId == 0) return;
+
+ mciSeek.dwTo = (DWORD_PTR)dwNewPos;
+ mciError = mciSendCommand(wDeviceId, MCI_SEEK, MCI_WAIT | MCI_TO,
(DWORD_PTR)&mciSeek);
+ if (mciError != 0)
+ {
+ ShowMCIError(hwnd, mciError);
+ }
+
+ mciPlay.dwCallback = (DWORD_PTR)hwnd;
+ mciError = mciSendCommand(wDeviceId, MCI_PLAY, MCI_NOTIFY, (DWORD_PTR)&mciPlay);
+ if (mciError != 0)
+ {
+ ShowMCIError(hwnd, mciError);
}
}
@@ -523,14 +514,14 @@
MCI_STATUS_PARMS mciStatus;
DWORD dwNewPos;
- if (!bIsOpened) return;
+ if (wDeviceId == 0) return;
mciStatus.dwItem = MCI_STATUS_POSITION;
mciSendCommand(wDeviceId, MCI_STATUS, MCI_STATUS_ITEM, (DWORD_PTR)&mciStatus);
dwNewPos = mciStatus.dwReturn - 1;
- if((UINT)dwNewPos <= 1)
+ if ((UINT)dwNewPos <= 1)
{
StopPlayback(hwnd);
}
@@ -546,14 +537,14 @@
MCI_STATUS_PARMS mciStatus;
DWORD dwNewPos;
- if (!bIsOpened) return;
+ if (wDeviceId == 0) return;
mciStatus.dwItem = MCI_STATUS_POSITION;
mciSendCommand(wDeviceId, MCI_STATUS, MCI_STATUS_ITEM, (DWORD_PTR)&mciStatus);
dwNewPos = mciStatus.dwReturn + 1;
- if((UINT)dwNewPos >= MaxFilePos)
+ if ((UINT)dwNewPos >= MaxFilePos)
{
StopPlayback(hwnd);
}
@@ -564,37 +555,46 @@
}
static VOID
-PausePlayback(HWND hwnd)
+TogglePlaybackState(HWND hwnd)
{
MCIERROR mciError;
MCI_GENERIC_PARMS mciGeneric;
-
- if (bIsOpened)
- {
- mciError = mciSendCommand(wDeviceId, MCI_PAUSE, MCI_WAIT,
(DWORD_PTR)&mciGeneric);
- if (mciError != 0)
- {
- ShowMCIError(hwnd, mciError);
- }
- bIsPaused = TRUE;
- }
-}
-
-static VOID
-ResumePlayback(HWND hwnd)
-{
- MCIERROR mciError;
- MCI_GENERIC_PARMS mciGeneric;
-
- if (bIsPaused)
- {
- mciError = mciSendCommand(wDeviceId, MCI_RESUME, MCI_WAIT,
(DWORD_PTR)&mciGeneric);
- if (mciError != 0)
- {
- ShowMCIError(hwnd, mciError);
- }
- bIsPaused = FALSE;
- }
+ DWORD dwMode;
+ ULONG idBmp = IDB_PLAYICON;
+ ULONG idCmd = IDC_PLAY;
+
+ if (wDeviceId == 0) return;
+
+ dwMode = GetDeviceMode(hwnd);
+ if (dwMode == MCI_MODE_PLAY)
+ {
+ mciGeneric.dwCallback = (DWORD_PTR)hwnd;
+ mciError = mciSendCommand(wDeviceId, MCI_PAUSE, MCI_NOTIFY,
(DWORD_PTR)&mciGeneric);
+ idBmp = IDB_PLAYICON;
+ idCmd = IDC_PLAY;
+ }
+ else if (dwMode == MCI_MODE_PAUSE)
+ {
+ mciGeneric.dwCallback = (DWORD_PTR)hwnd;
+ mciError = mciSendCommand(wDeviceId, MCI_RESUME, MCI_NOTIFY,
(DWORD_PTR)&mciGeneric);
+ idBmp = IDB_PAUSEICON;
+ idCmd = IDC_PAUSE;
+ }
+
+ if (mciError != 0)
+ {
+ ShowMCIError(hwnd, mciError);
+ return;
+ }
+
+ SendMessage(hToolBar,
+ TB_SETCMDID,
+ 0,
+ idCmd);
+ SendMessage(hToolBar,
+ TB_CHANGEBITMAP,
+ idCmd,
+ idBmp - IDB_PLAYICON);
}
static VOID
@@ -617,13 +617,13 @@
MCI_PLAY_PARMS mciPlay;
DWORD dwPos;
- if (!bIsOpened) KillTimer(hwnd, IDT_PLAYTIMER);
+ if (wDeviceId == 0) KillTimer(hwnd, IDT_PLAYTIMER);
mciStatus.dwItem = MCI_STATUS_POSITION;
mciSendCommand(wDeviceId, MCI_STATUS, MCI_STATUS_ITEM, (DWORD_PTR)&mciStatus);
dwPos = mciStatus.dwReturn;
- if((UINT)dwPos >= MaxFilePos)
+ if ((UINT)dwPos >= MaxFilePos)
{
if (!bRepeat)
{
@@ -638,61 +638,17 @@
}
else
{
- SendMessage(hTrackBar, TBM_SETPOS, (WPARAM) TRUE, (LPARAM) dwPos);
- }
-}
-
-static VOID
-PlayFile(HWND hwnd, LPTSTR lpFileName)
-{
+ SendMessage(hTrackBar, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)dwPos);
+ }
+}
+
+static VOID
+StartPlayback(HWND hwnd)
+{
+ MCIERROR mciError;
MCI_PLAY_PARMS mciPlay;
- TCHAR szLocalFileName[MAX_PATH];
- TCHAR szDeviceName[MAX_PATH];
- DWORD dwSize;
- MCIERROR mciError;
-
- if (lpFileName == NULL)
- {
- if (szPrevFile[0] == _T('\0'))
- return;
-
- StringCbCopy(szLocalFileName, sizeof(szLocalFileName), szPrevFile);
- }
- else
- {
- StringCbCopy(szLocalFileName, sizeof(szLocalFileName), lpFileName);
- }
-
- if (GetFileAttributes(szLocalFileName) == INVALID_FILE_ATTRIBUTES)
- {
- return;
- }
-
- dwSize = sizeof(szDeviceName) - 2;
- _tcsnset(szDeviceName, _T('\0'), dwSize / sizeof(TCHAR));
-
- if (!IsSupportedFileExtension(szLocalFileName, szDeviceName, &dwSize))
- {
- TCHAR szErrorMessage[256];
-
- LoadString(hInstance, IDS_UNKNOWNFILEEXT, szErrorMessage, sizeof(szErrorMessage)
/ sizeof(szErrorMessage[0]));
- MessageBox(hwnd, szErrorMessage, szAppTitle, MB_OK | MB_ICONEXCLAMATION);
- return;
- }
-
- if (bIsOpened)
- {
- StopPlayback(hwnd);
- }
-
- mciError = OpenMciDevice(hwnd, szDeviceName, szLocalFileName);
- if (mciError != 0)
- {
- ShowMCIError(hwnd, mciError);
- return;
- }
-
- SetTimer(hwnd, IDT_PLAYTIMER, 100, (TIMERPROC) PlayTimerProc);
+
+ SetTimer(hwnd, IDT_PLAYTIMER, 100, (TIMERPROC)PlayTimerProc);
mciSendCommand(wDeviceId, MCI_SEEK, MCI_WAIT | MCI_SEEK_TO_START, 0);
@@ -704,7 +660,63 @@
if (mciError != 0)
{
ShowMCIError(hwnd, mciError);
- }
+ return;
+ }
+
+ SendMessage(hToolBar,
+ TB_SETCMDID,
+ 0,
+ IDC_PAUSE);
+ SendMessage(hToolBar,
+ TB_CHANGEBITMAP,
+ IDC_PAUSE,
+ IDB_PAUSEICON - IDB_PLAYICON);
+}
+
+static VOID
+CloseMediaFile(HWND hwnd)
+{
+ StopPlayback(hwnd);
+
+ if (bIsSingleWindow)
+ SwitchViewMode(hwnd);
+
+ CloseMciDevice();
+ SetWindowText(hwnd, szAppTitle);
+}
+
+static VOID
+OpenMediaFile(HWND hwnd, LPTSTR lpFileName)
+{
+ MCIERROR mciError;
+ TCHAR szLocalFileName[MAX_PATH];
+
+ if (lpFileName == NULL)
+ {
+ if (szPrevFile[0] == _T('\0'))
+ return;
+
+ StringCbCopy(szLocalFileName, sizeof(szLocalFileName), szPrevFile);
+ }
+ else
+ {
+ StringCbCopy(szLocalFileName, sizeof(szLocalFileName), lpFileName);
+ }
+
+ if (GetFileAttributes(szLocalFileName) == INVALID_FILE_ATTRIBUTES)
+ return;
+
+ if (wDeviceId)
+ CloseMediaFile(hwnd);
+
+ mciError = OpenMciDevice(hwnd, NULL, szLocalFileName);
+ if (mciError != 0)
+ {
+ ShowMCIError(hwnd, mciError);
+ return;
+ }
+
+ StartPlayback(hwnd);
}
static VOID
@@ -733,7 +745,7 @@
HKEY hKey = NULL;
/* Always load the default (all files) filter */
- LoadString(hInstance, IDS_ALL_TYPES_FILTER, szDefaultFilter, sizeof(szDefaultFilter)
/ sizeof(szDefaultFilter[0]));
+ LoadString(hInstance, IDS_ALL_TYPES_FILTER, szDefaultFilter,
ARRAYSIZE(szDefaultFilter));
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Microsoft\\Windows
NT\\CurrentVersion\\MCI Extensions"), 0, KEY_READ, &hKey) != ERROR_SUCCESS)
{
@@ -749,9 +761,7 @@
szExtensionList = malloc(dwMaskLen * sizeof(TCHAR));
if (!szExtensionList)
- {
goto Failure;
- }
dwNumDevices = GetNumDevices();
@@ -763,21 +773,15 @@
szFilter = malloc(dwFilterSize);
if (!szFilter)
- {
goto Failure;
- }
szExtension = malloc((dwValueNameLen + 1) * sizeof(TCHAR));
if (!szExtension)
- {
goto Failure;
- }
szDevice = malloc(dwValueDataSize + sizeof(TCHAR));
if (!szDevice)
- {
goto Failure;
- }
ZeroMemory(szFilter, dwFilterSize);
@@ -813,7 +817,7 @@
if (RegEnumValue(hKey, i, szExtension, &dwExtensionLen, NULL, NULL,
(LPBYTE)szDevice, &dwDeviceSize) == ERROR_SUCCESS)
{
CharLowerBuff(szDevice, dwDeviceSize / sizeof(TCHAR));
- CharLowerBuff(szDeviceName, sizeof(szDeviceName) /
sizeof(szDeviceName[0]));
+ CharLowerBuff(szDeviceName, ARRAYSIZE(szDeviceName));
if (_tcscmp(szDeviceName, szDevice) == 0)
{
CharLowerBuff(szExtension, dwExtensionLen);
@@ -835,7 +839,7 @@
uSizeRemain -= sizeof(*c);
/* Append the filter mask */
- StringCbCopyEx(c, uSizeRemain, szExtensionList, &c, &uSizeRemain, 0);
+ StringCbCopyEx(c, uSizeRemain, szExtensionList, &c, &uSizeRemain, 0);
/* Skip another char to seperate the elements of the filter mask */
c++;
@@ -870,7 +874,7 @@
uSizeRemain -= sizeof(*c);
/* Append the filter mask */
- StringCbCopyEx(c, uSizeRemain, szExtensionList, &c, &uSizeRemain, 0);
+ StringCbCopyEx(c, uSizeRemain, szExtensionList, &c, &uSizeRemain, 0);
Cleanup:
if (szExtensionList) free(szExtensionList);
@@ -896,7 +900,7 @@
uSizeRemain -= sizeof(*c);
/* Append the filter mask */
- StringCbCopyEx(c, uSizeRemain, szDefaultExtension, &c, &uSizeRemain, 0);
+ StringCbCopyEx(c, uSizeRemain, szDefaultExtension, &c, &uSizeRemain, 0);
goto Cleanup;
}
@@ -916,7 +920,7 @@
ZeroMemory(&OpenFileName, sizeof(OpenFileName));
- if (!GetCurrentDirectory(sizeof(szCurrentDir) / sizeof(szCurrentDir[0]),
szCurrentDir))
+ if (!GetCurrentDirectory(ARRAYSIZE(szCurrentDir), szCurrentDir))
{
StringCbCopy(szCurrentDir, sizeof(szCurrentDir), _T("c:\\"));
}
@@ -926,15 +930,15 @@
OpenFileName.hInstance = hInstance;
OpenFileName.lpstrFilter = szFilter;
OpenFileName.lpstrFile = szFile;
- OpenFileName.nMaxFile = sizeof(szFile) / sizeof(szFile[0]);
+ OpenFileName.nMaxFile = ARRAYSIZE(szFile);
OpenFileName.lpstrInitialDir = szCurrentDir;
OpenFileName.Flags = OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST |
OFN_HIDEREADONLY | OFN_SHAREAWARE;
OpenFileName.lpstrDefExt = _T("\0");
- if (GetOpenFileName(&OpenFileName))
- {
- PlayFile(hwnd, OpenFileName.lpstrFile);
- }
+ if (!GetOpenFileName(&OpenFileName))
+ return;
+
+ OpenMediaFile(hwnd, OpenFileName.lpstrFile);
}
LRESULT CALLBACK
@@ -955,9 +959,9 @@
TCHAR droppedfile[MAX_PATH];
drophandle = (HDROP)wParam;
- DragQueryFile(drophandle, 0, droppedfile, sizeof(droppedfile) /
sizeof(droppedfile[0]));
+ DragQueryFile(drophandle, 0, droppedfile, ARRAYSIZE(droppedfile));
DragFinish(drophandle);
- PlayFile(hwnd, droppedfile);
+ OpenMediaFile(hwnd, droppedfile);
break;
}
@@ -995,6 +999,9 @@
case IDC_FORWARD:
lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_FORWARD);
break;
+ case IDC_PAUSE:
+ lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_PAUSE);
+ break;
}
break;
}
@@ -1054,11 +1061,11 @@
case WM_HSCROLL:
{
- if (hTrackBar == (HWND) lParam)
+ if (hTrackBar == (HWND)lParam)
{
- if (bIsOpened)
+ if (wDeviceId)
{
- DWORD dwNewPos = (DWORD) SendMessage(hTrackBar, TBM_GETPOS, 0, 0);
+ DWORD dwNewPos = (DWORD)SendMessage(hTrackBar, TBM_GETPOS, 0, 0);
SeekPlayback(hwnd, dwNewPos);
}
else
@@ -1083,20 +1090,23 @@
switch (LOWORD(wParam))
{
case IDC_PLAY:
+ case IDC_PAUSE:
{
- if (bIsOpened)
+ if (wDeviceId)
{
- if (bIsPaused)
- ResumePlayback(hwnd);
- else
- PausePlayback(hwnd);
+ DWORD dwMode = GetDeviceMode(hwnd);
+
+ if ((dwMode == MCI_MODE_STOP) || (dwMode == MCI_MODE_OPEN))
+ StartPlayback(hwnd);
+ else if ((dwMode == MCI_MODE_PAUSE) || (dwMode = MCI_MODE_PLAY))
+ TogglePlaybackState(hwnd);
}
else
{
if (szPrevFile[0] == _T('\0'))
OpenFileDialog(hwnd);
else
- PlayFile(hwnd, NULL);
+ OpenMediaFile(hwnd, NULL);
}
break;
}
@@ -1127,8 +1137,8 @@
return 0;
case IDM_CLOSE_FILE:
- StopPlayback(hwnd);
szPrevFile[0] = _T('\0');
+ CloseMediaFile(hwnd);
break;
case IDM_REPEAT:
@@ -1174,7 +1184,7 @@
}
case WM_DESTROY:
- StopPlayback(hwnd);
+ CloseMediaFile(hwnd);
PostQuitMessage(0);
return 0;
}
@@ -1194,9 +1204,9 @@
hInstance = hInst;
- LoadString(hInstance, IDS_APPTITLE, szAppTitle, sizeof(szAppTitle) /
sizeof(szAppTitle[0]));
-
- WndClass.cbSize = sizeof(WNDCLASSEX);
+ LoadString(hInstance, IDS_APPTITLE, szAppTitle, ARRAYSIZE(szAppTitle));
+
+ WndClass.cbSize = sizeof(WndClass);
WndClass.lpszClassName = szClassName;
WndClass.lpfnWndProc = MainWndProc;
WndClass.hInstance = hInstance;
@@ -1247,7 +1257,7 @@
ShowWindow(hwnd, SW_SHOW);
UpdateWindow(hwnd);
- PlayFile(hwnd, lpCmdLine);
+ OpenMediaFile(hwnd, lpCmdLine);
/* Message Loop */
while (GetMessage(&msg, NULL, 0, 0))
Modified: trunk/reactos/base/applications/mplay32/mplay32.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/mplay32.h [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/mplay32.h [iso-8859-1] Fri Mar 6 23:49:49
2015
@@ -14,17 +14,3 @@
#include <strsafe.h>
#include "resource.h"
-
-#define IDT_PLAYTIMER 1000
-
-#define UNSUPPORTED_FILE 0
-#define WAVE_FILE 1
-#define MIDI_FILE 2
-#define AUDIOCD_FILE 3
-#define AVI_FILE 4
-
-typedef struct
-{
- TCHAR szExt[MAX_PATH];
- UINT uType;
-} TYPEBYEXT;
Modified: trunk/reactos/base/applications/mplay32/resource.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/resource.h [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/resource.h [iso-8859-1] Fri Mar 6 23:49:49
2015
@@ -22,10 +22,10 @@
#define IDS_TOOLTIP_SEEKBACK 105
#define IDS_TOOLTIP_SEEKFORW 106
#define IDS_TOOLTIP_FORWARD 107
-#define IDS_ALL_TYPES_FILTER 108
-#define IDS_PLAY 109
-#define IDS_DEFAULTMCIERRMSG 110
-#define IDS_UNKNOWNFILEEXT 111
+#define IDS_TOOLTIP_PAUSE 108
+#define IDS_ALL_TYPES_FILTER 109
+#define IDS_PLAY 110
+#define IDS_DEFAULTMCIERRMSG 111
/* Menu */
#define IDR_MAINMENU 500
@@ -60,3 +60,4 @@
#define IDC_SEEKBACK 1504
#define IDC_SEEKFORW 1505
#define IDC_FORWARD 1506
+#define IDC_PAUSE 1507