[mplay32]

Media Player error handling by Ricardo Hanke
CORE-7800 #resolve #comment Committed in r61968. Thx for help.

svn path=/trunk/; revision=61968
This commit is contained in:
Daniel Reimer 2014-02-03 20:32:25 +00:00
parent bf29979bf7
commit 9921d75509
24 changed files with 40 additions and 10 deletions

View file

@ -38,4 +38,5 @@ BEGIN
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

View file

@ -39,4 +39,5 @@ BEGIN
IDS_APPTITLE "ReactOS Přehrávač multimédií"
IDS_PLAY "Přehrát"
IDS_DEFAULTMCIERRMSG "No description is available for this error"
IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename extension."
END

View file

@ -34,4 +34,5 @@ BEGIN
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

View file

@ -34,4 +34,5 @@ BEGIN
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

View file

@ -34,4 +34,5 @@ BEGIN
IDS_APPTITLE "Reproductor Multimedia de ReactOS"
IDS_PLAY "Reproducir"
IDS_DEFAULTMCIERRMSG "No description is available for this error"
IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename extension."
END

View file

@ -34,4 +34,5 @@ BEGIN
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

View file

@ -34,4 +34,5 @@ BEGIN
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

View file

@ -34,4 +34,5 @@ BEGIN
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

View file

@ -34,4 +34,5 @@ BEGIN
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

View file

@ -34,4 +34,5 @@ BEGIN
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

View file

@ -34,4 +34,5 @@ BEGIN
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

View file

@ -41,4 +41,5 @@ BEGIN
IDS_APPTITLE "ReactOS Multimedia Player"
IDS_PLAY "Odtwórz"
IDS_DEFAULTMCIERRMSG "No description is available for this error"
IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename extension."
END

View file

@ -36,4 +36,5 @@ BEGIN
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

View file

@ -40,4 +40,5 @@ BEGIN
IDS_APPTITLE "Lector multimedia"
IDS_PLAY "Lecturare"
IDS_DEFAULTMCIERRMSG "Nu există descriere pentru această eroare"
IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename extension."
END

View file

@ -34,4 +34,5 @@ BEGIN
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

View file

@ -39,4 +39,5 @@ BEGIN
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

View file

@ -38,4 +38,5 @@ BEGIN
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

View file

@ -41,4 +41,5 @@ BEGIN
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

View file

@ -36,4 +36,5 @@ BEGIN
IDS_APPTITLE "Ortam Oynatıcısı"
IDS_PLAY "Çal"
IDS_DEFAULTMCIERRMSG "No description is available for this error"
IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename extension."
END

View file

@ -42,4 +42,5 @@ BEGIN
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

View file

@ -36,4 +36,5 @@ BEGIN
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

View file

@ -42,4 +42,5 @@ BEGIN
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

View file

@ -216,7 +216,7 @@ CloseMciDevice(VOID)
DisableMenuItems();
return TRUE;
return 0;
}
static DWORD
@ -241,7 +241,6 @@ OpenMciDevice(HWND hwnd, LPTSTR lpType, LPTSTR lpFileName)
dwError = mciSendCommand(0, MCI_OPEN, MCI_OPEN_TYPE | MCI_OPEN_ELEMENT | MCI_WAIT, (DWORD_PTR)&mciOpen);
if (dwError != 0)
{
ShowMCIError(hwnd, dwError);
return dwError;
}
@ -250,7 +249,6 @@ OpenMciDevice(HWND hwnd, LPTSTR lpType, LPTSTR lpFileName)
dwError = mciSendCommand(mciOpen.wDeviceID, MCI_STATUS, MCI_STATUS_ITEM | MCI_WAIT, (DWORD_PTR)&mciStatus);
if (dwError != 0)
{
ShowMCIError(hwnd, dwError);
return dwError;
}
@ -287,7 +285,7 @@ OpenMciDevice(HWND hwnd, LPTSTR lpType, LPTSTR lpFileName)
EnableMenuItems();
return TRUE;
return 0;
}
static VOID
@ -415,7 +413,7 @@ ShowDeviceProperties(HWND hwnd)
dwError = mciSendCommand(wDeviceId, MCI_CONFIGURE, MCI_WAIT, (DWORD_PTR)&mciGeneric);
if (dwError != 0)
{
MessageBox(0, _T("Can't display the device properties!"), NULL, MB_OK);
ShowMCIError(hwnd, dwError);
}
}
@ -448,7 +446,6 @@ PlayFile(HWND hwnd, LPTSTR lpFileName)
TCHAR szLocalFileName[MAX_PATH];
TCHAR szDeviceName[MAX_PATH];
DWORD dwSize;
BOOL IsSupported;
MCIERROR mciError;
if (lpFileName == NULL)
@ -470,11 +467,21 @@ PlayFile(HWND hwnd, LPTSTR lpFileName)
dwSize = sizeof(szDeviceName) - 2;
_tcsnset(szDeviceName, _T('\0'), dwSize / sizeof(TCHAR));
IsSupported = IsSupportedFileExtension(szLocalFileName, szDeviceName, &dwSize);
if (IsSupported == TRUE)
if (!IsSupportedFileExtension(szLocalFileName, szDeviceName, &dwSize))
{
OpenMciDevice(hwnd, szDeviceName, szLocalFileName);
TCHAR szErrorMessage[256];
LoadString(hInstance, IDS_UNKNOWNFILEEXT, szErrorMessage, sizeof(szErrorMessage) / sizeof(TCHAR));
MessageBox(hwnd, szErrorMessage, szAppTitle, MB_OK | MB_ICONEXCLAMATION);
return;
}
mciError = OpenMciDevice(hwnd, szDeviceName, szLocalFileName);
if (mciError != 0)
{
ShowMCIError(hwnd, mciError);
return;
}
SetTimer(hwnd, IDT_PLAYTIMER, 100, (TIMERPROC) PlayTimerProc);
@ -540,7 +547,7 @@ MainWndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
TCHAR droppedfile[MAX_PATH];
drophandle = (HDROP)wParam;
DragQueryFile(drophandle, 0, droppedfile, sizeof(droppedfile));
DragQueryFile(drophandle, 0, droppedfile, sizeof(droppedfile) / sizeof(TCHAR));
DragFinish(drophandle);
PlayFile(hwnd, droppedfile);
break;

View file

@ -25,6 +25,7 @@
#define IDS_ALL_TYPES_FILTER 108
#define IDS_PLAY 109
#define IDS_DEFAULTMCIERRMSG 110
#define IDS_UNKNOWNFILEEXT 111
/* Menu */
#define IDR_MAINMENU 500