Author: hbelusca
Date: Sun Aug 24 15:40:34 2014
New Revision: 63940
URL:
http://svn.reactos.org/svn/reactos?rev=63940&view=rev
Log:
[MPLAY32]
Implement a single-window mode for videos.
Patch by Ricardo Hanke.
TO ALL TRANSLATORS: Update the translations!
CORE-7910 #resolve #comment Committed, thanks!
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/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] Sun Aug 24 15:40:34
2014
@@ -19,6 +19,10 @@
MENUITEM "St&op\tCtrl+S", IDC_STOP
MENUITEM SEPARATOR
MENUITEM "Repea&t\tCtrl+T", IDM_REPEAT
+ END
+ POPUP "&View"
+ BEGIN
+ MENUITEM "Single-Window &Mode", IDM_SWITCHVIEW
END
POPUP "&Device"
BEGIN
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] Sun Aug 24 15:40:34
2014
@@ -20,6 +20,10 @@
MENUITEM "St&op\tCtrl+S", IDC_STOP
MENUITEM SEPARATOR
MENUITEM "Repea&t\tCtrl+T", IDM_REPEAT
+ END
+ POPUP "&View"
+ BEGIN
+ MENUITEM "Single-Window &Mode", IDM_SWITCHVIEW
END
POPUP "&Device"
BEGIN
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] Sun Aug 24 15:40:34
2014
@@ -15,6 +15,10 @@
MENUITEM "St&opp\tStrg+S", IDC_STOP
MENUITEM SEPARATOR
MENUITEM "W&iederholen\tStrg+T", IDM_REPEAT
+ END
+ POPUP "&Ansicht"
+ BEGIN
+ MENUITEM "Einzelfenster-&Modus", IDM_SWITCHVIEW
END
POPUP "&Gerät"
BEGIN
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] Sun Aug 24 15:40:34
2014
@@ -15,6 +15,10 @@
MENUITEM "St&op\tCtrl+S", IDC_STOP
MENUITEM SEPARATOR
MENUITEM "Repea&t\tCtrl+T", IDM_REPEAT
+ END
+ POPUP "&View"
+ BEGIN
+ MENUITEM "Single-Window &Mode", IDM_SWITCHVIEW
END
POPUP "&Device"
BEGIN
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] Sun Aug 24 15:40:34
2014
@@ -15,6 +15,10 @@
MENUITEM "St&op\tCtrl+S", IDC_STOP
MENUITEM SEPARATOR
MENUITEM "Repea&t\tCtrl+T", IDM_REPEAT
+ END
+ POPUP "&View"
+ BEGIN
+ MENUITEM "Single-Window &Mode", IDM_SWITCHVIEW
END
POPUP "&Device"
BEGIN
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] Sun Aug 24 15:40:34
2014
@@ -15,6 +15,10 @@
MENUITEM "St&op\tCtrl+S", IDC_STOP
MENUITEM SEPARATOR
MENUITEM "Répé&ter\tCtrl+T", IDM_REPEAT
+ END
+ POPUP "&View"
+ BEGIN
+ MENUITEM "Single-Window &Mode", IDM_SWITCHVIEW
END
POPUP "Périp&hérique"
BEGIN
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] Sun Aug 24 15:40:34
2014
@@ -15,6 +15,10 @@
MENUITEM "St&op\tCtrl+S", IDC_STOP
MENUITEM SEPARATOR
MENUITEM "Repea&t\tCtrl+T", IDM_REPEAT
+ END
+ POPUP "&View"
+ BEGIN
+ MENUITEM "Single-Window &Mode", IDM_SWITCHVIEW
END
POPUP "&Device"
BEGIN
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] Sun Aug 24 15:40:34
2014
@@ -15,6 +15,10 @@
MENUITEM "St&op\tCtrl+S", IDC_STOP
MENUITEM SEPARATOR
MENUITEM "Repea&t\tCtrl+T", IDM_REPEAT
+ END
+ POPUP "&View"
+ BEGIN
+ MENUITEM "Single-Window &Mode", IDM_SWITCHVIEW
END
POPUP "&Device"
BEGIN
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] Sun Aug 24 15:40:34
2014
@@ -15,6 +15,10 @@
MENUITEM "St&op\tCtrl+S", IDC_STOP
MENUITEM SEPARATOR
MENUITEM "Repea&t\tCtrl+T", IDM_REPEAT
+ END
+ POPUP "&View"
+ BEGIN
+ MENUITEM "Single-Window &Mode", IDM_SWITCHVIEW
END
POPUP "&Device"
BEGIN
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] Sun Aug 24 15:40:34
2014
@@ -15,6 +15,10 @@
MENUITEM "St&op\tCtrl+S", IDC_STOP
MENUITEM SEPARATOR
MENUITEM "Repea&t\tCtrl+T", IDM_REPEAT
+ END
+ POPUP "&View"
+ BEGIN
+ MENUITEM "Single-Window &Mode", IDM_SWITCHVIEW
END
POPUP "&Device"
BEGIN
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] Sun Aug 24 15:40:34
2014
@@ -15,6 +15,10 @@
MENUITEM "St&op\tCtrl+S", IDC_STOP
MENUITEM SEPARATOR
MENUITEM "Repea&t\tCtrl+T", IDM_REPEAT
+ END
+ POPUP "&View"
+ BEGIN
+ MENUITEM "Single-Window &Mode", IDM_SWITCHVIEW
END
POPUP "&Device"
BEGIN
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] Sun Aug 24 15:40:34
2014
@@ -23,6 +23,10 @@
MENUITEM "St&op\tCtrl+S", IDC_STOP
MENUITEM SEPARATOR
MENUITEM "Repea&t\tCtrl+T", IDM_REPEAT
+ END
+ POPUP "&View"
+ BEGIN
+ MENUITEM "Single-Window &Mode", IDM_SWITCHVIEW
END
POPUP "&UrzÄ
dzenie"
BEGIN
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] Sun Aug 24 15:40:34
2014
@@ -17,6 +17,10 @@
MENUITEM "St&op\tCtrl+S", IDC_STOP
MENUITEM SEPARATOR
MENUITEM "Repea&t\tCtrl+T", IDM_REPEAT
+ END
+ POPUP "&View"
+ BEGIN
+ MENUITEM "Single-Window &Mode", IDM_SWITCHVIEW
END
POPUP "&Device"
BEGIN
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] Sun Aug 24 15:40:34
2014
@@ -21,6 +21,10 @@
MENUITEM "St&op\tCtrl+S", IDC_STOP
MENUITEM SEPARATOR
MENUITEM "Repea&t\tCtrl+T", IDM_REPEAT
+ END
+ POPUP "&View"
+ BEGIN
+ MENUITEM "Single-Window &Mode", IDM_SWITCHVIEW
END
POPUP "&Dispozitiv"
BEGIN
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] Sun Aug 24 15:40:34
2014
@@ -15,6 +15,10 @@
MENUITEM "St&op\tCtrl+S", IDC_STOP
MENUITEM SEPARATOR
MENUITEM "Repea&t\tCtrl+T", IDM_REPEAT
+ END
+ POPUP "&View"
+ BEGIN
+ MENUITEM "Single-Window &Mode", IDM_SWITCHVIEW
END
POPUP "&УÑÑÑойÑÑво"
BEGIN
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] Sun Aug 24 15:40:34
2014
@@ -20,6 +20,10 @@
MENUITEM "St&op\tCtrl+S", IDC_STOP
MENUITEM SEPARATOR
MENUITEM "Repea&t\tCtrl+T", IDM_REPEAT
+ END
+ POPUP "&View"
+ BEGIN
+ MENUITEM "Single-Window &Mode", IDM_SWITCHVIEW
END
POPUP "&Device"
BEGIN
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] Sun Aug 24 15:40:34
2014
@@ -19,6 +19,10 @@
MENUITEM "St&op\tCtrl+S", IDC_STOP
MENUITEM SEPARATOR
MENUITEM "Repea&t\tCtrl+T", IDM_REPEAT
+ END
+ POPUP "&View"
+ BEGIN
+ MENUITEM "Single-Window &Mode", IDM_SWITCHVIEW
END
POPUP "&Device"
BEGIN
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] Sun Aug 24 15:40:34
2014
@@ -22,6 +22,10 @@
MENUITEM "St&op\tCtrl+S", IDC_STOP
MENUITEM SEPARATOR
MENUITEM "Repea&t\tCtrl+T", IDM_REPEAT
+ END
+ POPUP "&View"
+ BEGIN
+ MENUITEM "Single-Window &Mode", IDM_SWITCHVIEW
END
POPUP "&Device"
BEGIN
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] Sun Aug 24 15:40:34
2014
@@ -17,6 +17,10 @@
MENUITEM "St&op\tCtrl+S", IDC_STOP
MENUITEM SEPARATOR
MENUITEM "Repea&t\tCtrl+T", IDM_REPEAT
+ END
+ POPUP "&View"
+ BEGIN
+ MENUITEM "Single-Window &Mode", IDM_SWITCHVIEW
END
POPUP "&Aygıt"
BEGIN
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] Sun Aug 24 15:40:34
2014
@@ -23,6 +23,10 @@
MENUITEM "St&op\tCtrl+S", IDC_STOP
MENUITEM SEPARATOR
MENUITEM "Repea&t\tCtrl+T", IDM_REPEAT
+ END
+ POPUP "&View"
+ BEGIN
+ MENUITEM "Single-Window &Mode", IDM_SWITCHVIEW
END
POPUP "&Device"
BEGIN
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] Sun Aug 24 15:40:34
2014
@@ -17,6 +17,10 @@
MENUITEM "St&op\tCtrl+S", IDC_STOP
MENUITEM SEPARATOR
MENUITEM "Repea&t\tCtrl+T", IDM_REPEAT
+ END
+ POPUP "&View"
+ BEGIN
+ MENUITEM "Single-Window &Mode", IDM_SWITCHVIEW
END
POPUP "&Device"
BEGIN
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] Sun Aug 24 15:40:34
2014
@@ -23,6 +23,10 @@
MENUITEM "St&op\tCtrl+S", IDC_STOP
MENUITEM SEPARATOR
MENUITEM "Repea&t\tCtrl+T", IDM_REPEAT
+ END
+ POPUP "&View"
+ BEGIN
+ MENUITEM "Single-Window &Mode", IDM_SWITCHVIEW
END
POPUP "&Device"
BEGIN
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] Sun Aug 24 15:40:34
2014
@@ -19,7 +19,9 @@
BOOL bIsOpened = FALSE;
BOOL bIsPaused = FALSE;
BOOL bRepeat = FALSE;
+BOOL bIsSingleWindow = FALSE;
UINT MaxFilePos = 0;
+RECT PrevWindowPos;
/* ToolBar Buttons */
@@ -35,9 +37,11 @@
{TBICON_FORWARD, IDC_FORWARD, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0}
};
-void EnableMenuItems(void)
+void EnableMenuItems(HWND hwnd)
{
MCI_GENERIC_PARMS mciGeneric;
+ MCI_DGV_RECT_PARMS mciVideoRect;
+ MCI_DGV_WINDOW_PARMSW mciVideoWindow;
DWORD dwError;
EnableMenuItem(hMainMenu, IDM_CLOSE_FILE, MF_BYCOMMAND | MF_ENABLED);
@@ -47,12 +51,38 @@
{
EnableMenuItem(hMainMenu, IDM_DEVPROPS, MF_BYCOMMAND | MF_ENABLED);
}
+
+ mciVideoWindow.hWnd = hwnd;
+
+ dwError = mciSendCommand(wDeviceId, MCI_WINDOW, MCI_DGV_WINDOW_HWND | MCI_TEST,
(DWORD)(LPSTR)&mciVideoWindow);
+ if (!dwError)
+ {
+ dwError = mciSendCommand(wDeviceId, MCI_WHERE, MCI_DGV_WHERE_SOURCE | MCI_TEST,
(DWORD)(LPSTR)&mciVideoRect);
+ if (!dwError)
+ {
+ EnableMenuItem(hMainMenu, IDM_SWITCHVIEW, MF_BYCOMMAND | MF_ENABLED);
+ }
+ }
}
void DisableMenuItems(void)
{
EnableMenuItem(hMainMenu, IDM_CLOSE_FILE, MF_BYCOMMAND | MF_GRAYED);
EnableMenuItem(hMainMenu, IDM_DEVPROPS, MF_BYCOMMAND | MF_GRAYED);
+ EnableMenuItem(hMainMenu, IDM_SWITCHVIEW, MF_BYCOMMAND | MF_GRAYED);
+}
+
+void ResizeClientArea(HWND hwnd, int nWidth, int nHeight)
+{
+ RECT rcClientRect;
+ RECT rcWindowRect;
+ POINT ptDifference;
+
+ GetClientRect(hwnd, &rcClientRect);
+ GetWindowRect(hwnd, &rcWindowRect);
+ ptDifference.x = (rcWindowRect.right - rcWindowRect.left) - rcClientRect.right;
+ ptDifference.y = (rcWindowRect.bottom - rcWindowRect.top) - rcClientRect.bottom;
+ MoveWindow(hwnd, rcWindowRect.left, rcWindowRect.top, nWidth + ptDifference.x,
nHeight + ptDifference.y, TRUE);
}
static VOID
@@ -213,6 +243,77 @@
return FALSE;
}
+static VOID
+SwitchViewMode(HWND hwnd)
+{
+ MCIERROR mciError;
+ MCI_DGV_RECT_PARMS mciVideoRect;
+ MCI_DGV_WINDOW_PARMSW mciVideoWindow;
+ RECT rcToolbarRect;
+ RECT rcTempRect;
+
+ mciVideoWindow.hWnd = hwnd;
+
+ mciError = mciSendCommand(wDeviceId, MCI_WINDOW, MCI_DGV_WINDOW_HWND | MCI_TEST,
(DWORD)(LPSTR)&mciVideoWindow);
+ if (mciError)
+ {
+ return;
+ }
+
+ mciError = mciSendCommand(wDeviceId, MCI_WHERE, MCI_DGV_WHERE_SOURCE | MCI_TEST,
(DWORD)(LPSTR)&mciVideoRect);
+ if (mciError)
+ {
+ return;
+ }
+
+ if (!bIsSingleWindow)
+ {
+ GetWindowRect(hwnd, &PrevWindowPos);
+
+ SetParent(hTrackBar, hToolBar);
+
+ mciError = mciSendCommand(wDeviceId, MCI_WHERE, MCI_DGV_WHERE_SOURCE,
(DWORD)(LPSTR)&mciVideoRect);
+ if (mciError)
+ {
+ ShowMCIError(hwnd, mciError);
+ return;
+ }
+
+ 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)(LPSTR)&mciVideoWindow);
+ if (mciError)
+ {
+ ShowMCIError(hwnd, mciError);
+ return;
+ }
+
+ GetWindowRect(hToolBar, &rcTempRect);
+ MoveWindow(hTrackBar, 180, 0, rcTempRect.right - rcTempRect.left - 180, 25,
TRUE);
+
+ CheckMenuItem(hMainMenu, IDM_SWITCHVIEW, MF_BYCOMMAND | MF_CHECKED);
+ bIsSingleWindow = TRUE;
+ }
+ else
+ {
+ bIsSingleWindow = FALSE;
+ CheckMenuItem(hMainMenu, IDM_SWITCHVIEW, MF_BYCOMMAND | MF_UNCHECKED);
+
+ mciVideoWindow.hWnd = MCI_DGV_WINDOW_DEFAULT;
+ mciError = mciSendCommand(wDeviceId, MCI_WINDOW, MCI_DGV_WINDOW_HWND,
(DWORD)(LPSTR)&mciVideoWindow);
+ if (mciError)
+ {
+ ShowMCIError(hwnd, mciError);
+ return;
+ }
+
+ SetParent(hTrackBar, hwnd);
+
+ MoveWindow(hwnd, PrevWindowPos.left, PrevWindowPos.top, PrevWindowPos.right -
PrevWindowPos.left, PrevWindowPos.bottom - PrevWindowPos.top, TRUE);
+ }
+}
+
static DWORD
CloseMciDevice(VOID)
{
@@ -295,7 +396,7 @@
bIsOpened = TRUE;
_tcscpy(szPrevFile, lpFileName);
- EnableMenuItems();
+ EnableMenuItems(hwnd);
return 0;
}
@@ -307,6 +408,12 @@
{
SendMessage(hTrackBar, TBM_SETPOS, (WPARAM) TRUE, (LPARAM) 1);
KillTimer(hwnd, IDT_PLAYTIMER);
+
+ if (bIsSingleWindow)
+ {
+ SwitchViewMode(hwnd);
+ }
+
CloseMciDevice();
}
}
@@ -497,6 +604,11 @@
LoadString(hInstance, IDS_UNKNOWNFILEEXT, szErrorMessage, sizeof(szErrorMessage)
/ sizeof(TCHAR));
MessageBox(hwnd, szErrorMessage, szAppTitle, MB_OK | MB_ICONEXCLAMATION);
return;
+ }
+
+ if (bIsOpened)
+ {
+ StopPlayback(hwnd);
}
mciError = OpenMciDevice(hwnd, szDeviceName, szLocalFileName);
@@ -622,12 +734,14 @@
{
LPRECT pRect = (LPRECT)lParam;
- if (pRect->right - pRect->left < MAIN_WINDOW_MIN_WIDTH)
- pRect->right = pRect->left + MAIN_WINDOW_MIN_WIDTH;
-
- if (pRect->bottom - pRect->top != MAIN_WINDOW_HEIGHT)
- pRect->bottom = pRect->top + MAIN_WINDOW_HEIGHT;
-
+ if (!bIsSingleWindow)
+ {
+ if (pRect->right - pRect->left < MAIN_WINDOW_MIN_WIDTH)
+ pRect->right = pRect->left + MAIN_WINDOW_MIN_WIDTH;
+
+ if (pRect->bottom - pRect->top != MAIN_WINDOW_HEIGHT)
+ pRect->bottom = pRect->top + MAIN_WINDOW_HEIGHT;
+ }
return TRUE;
}
@@ -635,14 +749,33 @@
{
RECT Rect;
UINT Size;
+ RECT ToolbarRect;
+ MCI_DGV_PUT_PARMS mciPut;
if (hToolBar && hTrackBar)
{
SendMessage(hToolBar, TB_AUTOSIZE, 0, 0);
SendMessage(hToolBar, TB_GETITEMRECT, 1, (LPARAM)&Rect);
- Size = GetSystemMetrics(SM_CYMENU) + Rect.bottom;
- MoveWindow(hTrackBar, 0, 0, LOWORD(lParam), HIWORD(lParam) - Size,
TRUE);
+ if (!bIsSingleWindow)
+ {
+ Size = GetSystemMetrics(SM_CYMENU) + Rect.bottom;
+ MoveWindow(hTrackBar, 0, 0, LOWORD(lParam), HIWORD(lParam) - Size,
TRUE);
+ }
+ else
+ {
+ MoveWindow(hTrackBar, 180, 0, LOWORD(lParam) - 180, 25, TRUE);
+
+ GetClientRect(hwnd, &Rect);
+ GetClientRect(hToolBar, &ToolbarRect);
+
+ mciPut.rc.top = 0;
+ mciPut.rc.left = 0;
+ mciPut.rc.right = Rect.right;
+ mciPut.rc.bottom = Rect.bottom - (ToolbarRect.bottom -
ToolbarRect.top) - 2;
+
+ mciSendCommand(wDeviceId, MCI_PUT, MCI_DGV_PUT_DESTINATION |
MCI_DGV_RECT | MCI_WAIT, (DWORD)&mciPut);
+ }
}
return 0L;
}
@@ -660,6 +793,15 @@
{
SendMessage(hTrackBar, TBM_SETPOS, TRUE, 0);
}
+ }
+ }
+ break;
+
+ case WM_NCLBUTTONDBLCLK:
+ {
+ if (wParam == HTCAPTION)
+ {
+ SwitchViewMode(hwnd);
}
}
break;
@@ -732,6 +874,10 @@
break;
}
+ case IDM_SWITCHVIEW:
+ SwitchViewMode(hwnd);
+ break;
+
case IDM_DEVPROPS:
ShowDeviceProperties(hwnd);
break;
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] Sun Aug 24 15:40:34
2014
@@ -41,6 +41,7 @@
#define IDM_VOLUMECTL 1004
#define IDM_DEVPROPS 1005
#define IDM_REPEAT 1006
+#define IDM_SWITCHVIEW 1007
/* ToolBar Icons */
#define TBICON_PLAY 0