mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 07:46:29 +00:00
[MPLAY32]: Use a consistent type/naming for mci errors.
svn path=/trunk/; revision=66153
This commit is contained in:
parent
3c758ecb42
commit
56608c8fe0
1 changed files with 39 additions and 39 deletions
|
@ -44,26 +44,26 @@ static const TBBUTTON Buttons[] =
|
||||||
|
|
||||||
void EnableMenuItems(HWND hwnd)
|
void EnableMenuItems(HWND hwnd)
|
||||||
{
|
{
|
||||||
|
MCIERROR mciError;
|
||||||
MCI_GENERIC_PARMS mciGeneric;
|
MCI_GENERIC_PARMS mciGeneric;
|
||||||
MCI_DGV_RECT_PARMS mciVideoRect;
|
MCI_DGV_RECT_PARMS mciVideoRect;
|
||||||
MCI_DGV_WINDOW_PARMSW mciVideoWindow;
|
MCI_DGV_WINDOW_PARMSW mciVideoWindow;
|
||||||
DWORD dwError;
|
|
||||||
|
|
||||||
EnableMenuItem(hMainMenu, IDM_CLOSE_FILE, MF_BYCOMMAND | MF_ENABLED);
|
EnableMenuItem(hMainMenu, IDM_CLOSE_FILE, MF_BYCOMMAND | MF_ENABLED);
|
||||||
|
|
||||||
dwError = mciSendCommand(wDeviceId, MCI_CONFIGURE, MCI_TEST, (DWORD_PTR)&mciGeneric);
|
mciError = mciSendCommand(wDeviceId, MCI_CONFIGURE, MCI_TEST, (DWORD_PTR)&mciGeneric);
|
||||||
if (dwError == 0)
|
if (mciError == 0)
|
||||||
{
|
{
|
||||||
EnableMenuItem(hMainMenu, IDM_DEVPROPS, MF_BYCOMMAND | MF_ENABLED);
|
EnableMenuItem(hMainMenu, IDM_DEVPROPS, MF_BYCOMMAND | MF_ENABLED);
|
||||||
}
|
}
|
||||||
|
|
||||||
mciVideoWindow.hWnd = hwnd;
|
mciVideoWindow.hWnd = hwnd;
|
||||||
|
|
||||||
dwError = 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 (!dwError)
|
if (!mciError)
|
||||||
{
|
{
|
||||||
dwError = mciSendCommand(wDeviceId, MCI_WHERE, MCI_DGV_WHERE_SOURCE | MCI_TEST, (DWORD_PTR)&mciVideoRect);
|
mciError = mciSendCommand(wDeviceId, MCI_WHERE, MCI_DGV_WHERE_SOURCE | MCI_TEST, (DWORD_PTR)&mciVideoRect);
|
||||||
if (!dwError)
|
if (!mciError)
|
||||||
{
|
{
|
||||||
EnableMenuItem(hMainMenu, IDM_SWITCHVIEW, MF_BYCOMMAND | MF_ENABLED);
|
EnableMenuItem(hMainMenu, IDM_SWITCHVIEW, MF_BYCOMMAND | MF_ENABLED);
|
||||||
}
|
}
|
||||||
|
@ -155,17 +155,17 @@ SetImageList(HWND hwnd)
|
||||||
}
|
}
|
||||||
|
|
||||||
static VOID
|
static VOID
|
||||||
ShowMCIError(HWND hwnd, DWORD dwError)
|
ShowMCIError(HWND hwnd, MCIERROR mciError)
|
||||||
{
|
{
|
||||||
TCHAR szErrorMessage[MAX_MCISTR];
|
TCHAR szErrorMessage[MAX_MCISTR];
|
||||||
TCHAR szTempMessage[MAX_MCISTR + 44];
|
TCHAR szTempMessage[MAX_MCISTR + 44];
|
||||||
|
|
||||||
if (mciGetErrorString(dwError, szErrorMessage, sizeof(szErrorMessage) / sizeof(szErrorMessage[0])) == FALSE)
|
if (mciGetErrorString(mciError, szErrorMessage, sizeof(szErrorMessage) / sizeof(szErrorMessage[0])) == FALSE)
|
||||||
{
|
{
|
||||||
LoadString(hInstance, IDS_DEFAULTMCIERRMSG, szErrorMessage, sizeof(szErrorMessage) / sizeof(szErrorMessage[0]));
|
LoadString(hInstance, IDS_DEFAULTMCIERRMSG, szErrorMessage, sizeof(szErrorMessage) / sizeof(szErrorMessage[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
_stprintf(szTempMessage, _T("MMSYS%lu: %s"), dwError, szErrorMessage);
|
_stprintf(szTempMessage, _T("MMSYS%lu: %s"), mciError, szErrorMessage);
|
||||||
MessageBox(hwnd, szTempMessage, szAppTitle, MB_OK | MB_ICONEXCLAMATION);
|
MessageBox(hwnd, szTempMessage, szAppTitle, MB_OK | MB_ICONEXCLAMATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -391,13 +391,13 @@ GetDeviceFriendlyName(LPTSTR lpDeviceName, LPTSTR lpFriendlyName, DWORD dwFriend
|
||||||
static DWORD
|
static DWORD
|
||||||
CloseMciDevice(VOID)
|
CloseMciDevice(VOID)
|
||||||
{
|
{
|
||||||
|
MCIERROR mciError;
|
||||||
MCI_GENERIC_PARMS mciGeneric;
|
MCI_GENERIC_PARMS mciGeneric;
|
||||||
DWORD dwError;
|
|
||||||
|
|
||||||
if (bIsOpened)
|
if (bIsOpened)
|
||||||
{
|
{
|
||||||
dwError = mciSendCommand(wDeviceId, MCI_CLOSE, MCI_WAIT, (DWORD_PTR)&mciGeneric);
|
mciError = mciSendCommand(wDeviceId, MCI_CLOSE, MCI_WAIT, (DWORD_PTR)&mciGeneric);
|
||||||
if (dwError) return dwError;
|
if (mciError) return mciError;
|
||||||
bIsOpened = FALSE;
|
bIsOpened = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -409,10 +409,10 @@ CloseMciDevice(VOID)
|
||||||
static DWORD
|
static DWORD
|
||||||
OpenMciDevice(HWND hwnd, LPTSTR lpType, LPTSTR lpFileName)
|
OpenMciDevice(HWND hwnd, LPTSTR lpType, LPTSTR lpFileName)
|
||||||
{
|
{
|
||||||
|
MCIERROR mciError;
|
||||||
MCI_STATUS_PARMS mciStatus;
|
MCI_STATUS_PARMS mciStatus;
|
||||||
MCI_OPEN_PARMS mciOpen;
|
MCI_OPEN_PARMS mciOpen;
|
||||||
TCHAR szNewTitle[MAX_PATH];
|
TCHAR szNewTitle[MAX_PATH];
|
||||||
DWORD dwError;
|
|
||||||
|
|
||||||
if (bIsOpened)
|
if (bIsOpened)
|
||||||
{
|
{
|
||||||
|
@ -425,18 +425,18 @@ OpenMciDevice(HWND hwnd, LPTSTR lpType, LPTSTR lpFileName)
|
||||||
mciOpen.wDeviceID = 0;
|
mciOpen.wDeviceID = 0;
|
||||||
mciOpen.lpstrAlias = NULL;
|
mciOpen.lpstrAlias = NULL;
|
||||||
|
|
||||||
dwError = mciSendCommand(0, MCI_OPEN, MCI_OPEN_TYPE | MCI_OPEN_ELEMENT | MCI_WAIT, (DWORD_PTR)&mciOpen);
|
mciError = mciSendCommand(0, MCI_OPEN, MCI_OPEN_TYPE | MCI_OPEN_ELEMENT | MCI_WAIT, (DWORD_PTR)&mciOpen);
|
||||||
if (dwError != 0)
|
if (mciError != 0)
|
||||||
{
|
{
|
||||||
return dwError;
|
return mciError;
|
||||||
}
|
}
|
||||||
|
|
||||||
mciStatus.dwItem = MCI_STATUS_LENGTH;
|
mciStatus.dwItem = MCI_STATUS_LENGTH;
|
||||||
|
|
||||||
dwError = mciSendCommand(mciOpen.wDeviceID, MCI_STATUS, MCI_STATUS_ITEM | MCI_WAIT, (DWORD_PTR)&mciStatus);
|
mciError = mciSendCommand(mciOpen.wDeviceID, MCI_STATUS, MCI_STATUS_ITEM | MCI_WAIT, (DWORD_PTR)&mciStatus);
|
||||||
if (dwError != 0)
|
if (mciError != 0)
|
||||||
{
|
{
|
||||||
return dwError;
|
return mciError;
|
||||||
}
|
}
|
||||||
|
|
||||||
SendMessage(hTrackBar, TBM_SETRANGEMIN, (WPARAM) TRUE, (LPARAM) 1);
|
SendMessage(hTrackBar, TBM_SETRANGEMIN, (WPARAM) TRUE, (LPARAM) 1);
|
||||||
|
@ -495,24 +495,24 @@ StopPlayback(HWND hwnd)
|
||||||
static VOID
|
static VOID
|
||||||
SeekPlayback(HWND hwnd, DWORD dwNewPos)
|
SeekPlayback(HWND hwnd, DWORD dwNewPos)
|
||||||
{
|
{
|
||||||
|
MCIERROR mciError;
|
||||||
MCI_SEEK_PARMS mciSeek;
|
MCI_SEEK_PARMS mciSeek;
|
||||||
MCI_PLAY_PARMS mciPlay;
|
MCI_PLAY_PARMS mciPlay;
|
||||||
DWORD dwError;
|
|
||||||
|
|
||||||
if (bIsOpened)
|
if (bIsOpened)
|
||||||
{
|
{
|
||||||
mciSeek.dwTo = (DWORD_PTR)dwNewPos;
|
mciSeek.dwTo = (DWORD_PTR)dwNewPos;
|
||||||
dwError = mciSendCommand(wDeviceId, MCI_SEEK, MCI_WAIT | MCI_TO, (DWORD_PTR)&mciSeek);
|
mciError = mciSendCommand(wDeviceId, MCI_SEEK, MCI_WAIT | MCI_TO, (DWORD_PTR)&mciSeek);
|
||||||
if (dwError != 0)
|
if (mciError != 0)
|
||||||
{
|
{
|
||||||
ShowMCIError(hwnd, dwError);
|
ShowMCIError(hwnd, mciError);
|
||||||
}
|
}
|
||||||
|
|
||||||
mciPlay.dwCallback = (DWORD_PTR)hwnd;
|
mciPlay.dwCallback = (DWORD_PTR)hwnd;
|
||||||
dwError = mciSendCommand(wDeviceId, MCI_PLAY, MCI_NOTIFY, (DWORD_PTR)&mciPlay);
|
mciError = mciSendCommand(wDeviceId, MCI_PLAY, MCI_NOTIFY, (DWORD_PTR)&mciPlay);
|
||||||
if (dwError != 0)
|
if (mciError != 0)
|
||||||
{
|
{
|
||||||
ShowMCIError(hwnd, dwError);
|
ShowMCIError(hwnd, mciError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -566,15 +566,15 @@ SeekForwPlayback(HWND hwnd)
|
||||||
static VOID
|
static VOID
|
||||||
PausePlayback(HWND hwnd)
|
PausePlayback(HWND hwnd)
|
||||||
{
|
{
|
||||||
|
MCIERROR mciError;
|
||||||
MCI_GENERIC_PARMS mciGeneric;
|
MCI_GENERIC_PARMS mciGeneric;
|
||||||
DWORD dwError;
|
|
||||||
|
|
||||||
if (bIsOpened)
|
if (bIsOpened)
|
||||||
{
|
{
|
||||||
dwError = mciSendCommand(wDeviceId, MCI_PAUSE, MCI_WAIT, (DWORD_PTR)&mciGeneric);
|
mciError = mciSendCommand(wDeviceId, MCI_PAUSE, MCI_WAIT, (DWORD_PTR)&mciGeneric);
|
||||||
if (dwError != 0)
|
if (mciError != 0)
|
||||||
{
|
{
|
||||||
ShowMCIError(hwnd, dwError);
|
ShowMCIError(hwnd, mciError);
|
||||||
}
|
}
|
||||||
bIsPaused = TRUE;
|
bIsPaused = TRUE;
|
||||||
}
|
}
|
||||||
|
@ -583,15 +583,15 @@ PausePlayback(HWND hwnd)
|
||||||
static VOID
|
static VOID
|
||||||
ResumePlayback(HWND hwnd)
|
ResumePlayback(HWND hwnd)
|
||||||
{
|
{
|
||||||
|
MCIERROR mciError;
|
||||||
MCI_GENERIC_PARMS mciGeneric;
|
MCI_GENERIC_PARMS mciGeneric;
|
||||||
DWORD dwError;
|
|
||||||
|
|
||||||
if (bIsPaused)
|
if (bIsPaused)
|
||||||
{
|
{
|
||||||
dwError = mciSendCommand(wDeviceId, MCI_RESUME, MCI_WAIT, (DWORD_PTR)&mciGeneric);
|
mciError = mciSendCommand(wDeviceId, MCI_RESUME, MCI_WAIT, (DWORD_PTR)&mciGeneric);
|
||||||
if (dwError != 0)
|
if (mciError != 0)
|
||||||
{
|
{
|
||||||
ShowMCIError(hwnd, dwError);
|
ShowMCIError(hwnd, mciError);
|
||||||
}
|
}
|
||||||
bIsPaused = FALSE;
|
bIsPaused = FALSE;
|
||||||
}
|
}
|
||||||
|
@ -600,13 +600,13 @@ ResumePlayback(HWND hwnd)
|
||||||
static VOID
|
static VOID
|
||||||
ShowDeviceProperties(HWND hwnd)
|
ShowDeviceProperties(HWND hwnd)
|
||||||
{
|
{
|
||||||
|
MCIERROR mciError;
|
||||||
MCI_GENERIC_PARMS mciGeneric;
|
MCI_GENERIC_PARMS mciGeneric;
|
||||||
DWORD dwError;
|
|
||||||
|
|
||||||
dwError = mciSendCommand(wDeviceId, MCI_CONFIGURE, MCI_WAIT, (DWORD_PTR)&mciGeneric);
|
mciError = mciSendCommand(wDeviceId, MCI_CONFIGURE, MCI_WAIT, (DWORD_PTR)&mciGeneric);
|
||||||
if (dwError != 0)
|
if (mciError != 0)
|
||||||
{
|
{
|
||||||
ShowMCIError(hwnd, dwError);
|
ShowMCIError(hwnd, mciError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue