Commit b8ba8459 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

Implemented most of '*Format*' API.

Improved internal object and messages handling. Started some '*Filter*' functions. Fixed standard headers for Winelib. Fixed acmMetrics.
parent d2f8bf6f
......@@ -3,3 +3,4 @@
Makefile
libmsacm.so.1.0
libmsacm32.so.1.0
msacm.s
......@@ -16,6 +16,9 @@ C_SRCS = \
msacm_main.c \
stream.c
RC_SRCS = \
msacm.rc
@MAKE_DLL_RULES@
### Dependencies:
......
......@@ -142,8 +142,8 @@ MMRESULT WINAPI acmDriverDetailsW(HACMDRIVERID hadid, PACMDRIVERDETAILSW padd, D
return MMSYSERR_INVALFLAG;
mmr = acmDriverOpen(&acmDrvr, hadid, 0);
if (mmr == 0) {
mmr = (MMRESULT)acmDriverMessage(acmDrvr, ACMDM_DRIVER_DETAILS, (LPARAM) padd, 0);
if (mmr == MMSYSERR_NOERROR) {
mmr = (MMRESULT)MSACM_Message(acmDrvr, ACMDM_DRIVER_DETAILS, (LPARAM)padd, 0);
acmDriverClose(acmDrvr, 0);
}
......@@ -157,25 +157,25 @@ MMRESULT WINAPI acmDriverDetailsW(HACMDRIVERID hadid, PACMDRIVERDETAILSW padd, D
MMRESULT WINAPI acmDriverEnum(ACMDRIVERENUMCB fnCallback, DWORD dwInstance, DWORD fdwEnum)
{
PWINE_ACMDRIVERID p;
DWORD fdwSupport;
ACMDRIVERDETAILSW add;
if (!fnCallback) {
return MMSYSERR_INVALPARAM;
}
if (!fnCallback) return MMSYSERR_INVALPARAM;
if (fdwEnum && ~(ACM_DRIVERENUMF_NOLOCAL|ACM_DRIVERENUMF_DISABLED)) {
if (fdwEnum && ~(ACM_DRIVERENUMF_NOLOCAL|ACM_DRIVERENUMF_DISABLED))
return MMSYSERR_INVALFLAG;
}
add.cbStruct = sizeof(add);
for (p = MSACM_pFirstACMDriverID; p; p = p->pNextACMDriverID) {
fdwSupport = ACMDRIVERDETAILS_SUPPORTF_CODEC;
if (acmDriverDetailsW((HACMDRIVERID)p, &add, 0) != MMSYSERR_NOERROR)
continue;
if (!p->bEnabled) {
if (fdwEnum & ACM_DRIVERENUMF_DISABLED)
fdwSupport |= ACMDRIVERDETAILS_SUPPORTF_DISABLED;
add.fdwSupport |= ACMDRIVERDETAILS_SUPPORTF_DISABLED;
else
continue;
}
(*fnCallback)((HACMDRIVERID) p, dwInstance, fdwSupport);
if (!(*fnCallback)((HACMDRIVERID)p, dwInstance, add.fdwSupport))
break;
}
return MMSYSERR_NOERROR;
......@@ -188,16 +188,16 @@ MMRESULT WINAPI acmDriverID(HACMOBJ hao, PHACMDRIVERID phadid, DWORD fdwDriverID
{
PWINE_ACMOBJ pao;
pao = MSACM_GetObj(hao);
if (!pao)
return MMSYSERR_INVALHANDLE;
if (!phadid)
return MMSYSERR_INVALPARAM;
if (fdwDriverID)
return MMSYSERR_INVALFLAG;
pao = MSACM_GetObj(hao, WINE_ACMOBJ_DONTCARE);
if (!pao)
return MMSYSERR_INVALHANDLE;
*phadid = (HACMDRIVERID) pao->pACMDriverID;
return MMSYSERR_NOERROR;
......@@ -205,21 +205,16 @@ MMRESULT WINAPI acmDriverID(HACMOBJ hao, PHACMDRIVERID phadid, DWORD fdwDriverID
/***********************************************************************
* acmDriverMessage (MSACM32.9)
* FIXME
* Not implemented
*
*/
LRESULT WINAPI acmDriverMessage(HACMDRIVER had, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
{
PWINE_ACMDRIVER pad = MSACM_GetDriver(had);
if (!pad)
if ((uMsg >= ACMDM_USER && uMsg < ACMDM_RESERVED_LOW) ||
uMsg == ACMDM_DRIVER_ABOUT ||
uMsg == DRV_QUERYCONFIGURE ||
uMsg == DRV_CONFIGURE)
return MSACM_Message(had, uMsg, lParam1, lParam2);
return MMSYSERR_INVALPARAM;
/* FIXME: Check if uMsg legal */
if (!SendDriverMessage(pad->hDrvr, uMsg, lParam1, lParam2))
return MMSYSERR_NOTSUPPORTED;
return MMSYSERR_NOERROR;
}
......@@ -246,6 +241,7 @@ MMRESULT WINAPI acmDriverOpen(PHACMDRIVER phad, HACMDRIVERID hadid, DWORD fdwOpe
pad = HeapAlloc(MSACM_hHeap, 0, sizeof(WINE_ACMDRIVER));
if (!pad) return MMSYSERR_NOMEM;
pad->obj.dwType = WINE_ACMOBJ_DRIVER;
pad->obj.pACMDriverID = padid;
if (!padid->hInstModule)
......
/* -*- tab-width: 8; c-basic-offset: 4 -*- */
/*
* MSACM32 library
*
......@@ -9,15 +11,15 @@
#include "mmsystem.h"
#include "msacm.h"
#include "msacmdrv.h"
#include "wineacm.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(msacm)
DEFAULT_DEBUG_CHANNEL(msacm);
/***********************************************************************
* acmFilterChooseA (MSACM32.13)
*/
MMRESULT WINAPI acmFilterChooseA(
PACMFILTERCHOOSEA pafltrc)
MMRESULT WINAPI acmFilterChooseA(PACMFILTERCHOOSEA pafltrc)
{
FIXME("(%p): stub\n", pafltrc);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
......@@ -27,8 +29,7 @@ MMRESULT WINAPI acmFilterChooseA(
/***********************************************************************
* acmFilterChooseW (MSACM32.14)
*/
MMRESULT WINAPI acmFilterChooseW(
PACMFILTERCHOOSEW pafltrc)
MMRESULT WINAPI acmFilterChooseW(PACMFILTERCHOOSEW pafltrc)
{
FIXME("(%p): stub\n", pafltrc);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
......@@ -38,44 +39,52 @@ MMRESULT WINAPI acmFilterChooseW(
/***********************************************************************
* acmFilterDetailsA (MSACM32.15)
*/
MMRESULT WINAPI acmFilterDetailsA(
HACMDRIVER had, PACMFILTERDETAILSA pafd, DWORD fdwDetails)
MMRESULT WINAPI acmFilterDetailsA(HACMDRIVER had, PACMFILTERDETAILSA pafd,
DWORD fdwDetails)
{
if(fdwDetails & ~(ACM_FILTERDETAILSF_FILTER))
return MMSYSERR_INVALFLAG;
ACMFILTERDETAILSW afdw;
MMRESULT mmr;
/* FIXME
* How does the driver know if the ANSI or
* the UNICODE variant of PACMFILTERDETAILS is used?
* It might check cbStruct or does it only accept ANSI.
*/
return (MMRESULT) acmDriverMessage(
had, ACMDM_FILTER_DETAILS,
(LPARAM) pafd, (LPARAM) fdwDetails
);
memset(&afdw, 0, sizeof(afdw));
afdw.cbStruct = sizeof(afdw);
afdw.dwFilterIndex = pafd->dwFilterIndex;
afdw.dwFilterTag = pafd->dwFilterTag;
afdw.pwfltr = pafd->pwfltr;
afdw.cbwfltr = pafd->cbwfltr;
mmr = acmFilterDetailsW(had, &afdw, fdwDetails);
if (mmr == MMSYSERR_NOERROR) {
pafd->dwFilterTag = afdw.dwFilterTag;
pafd->fdwSupport = afdw.fdwSupport;
lstrcpyWtoA(pafd->szFilter, afdw.szFilter);
}
return mmr;
}
/***********************************************************************
* acmFilterDetailsW (MSACM32.16)
*/
MMRESULT WINAPI acmFilterDetailsW(
HACMDRIVER had, PACMFILTERDETAILSW pafd, DWORD fdwDetails)
MMRESULT WINAPI acmFilterDetailsW(HACMDRIVER had, PACMFILTERDETAILSW pafd,
DWORD fdwDetails)
{
FIXME("(0x%08x, %p, %ld): stub\n", had, pafd, fdwDetails);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return MMSYSERR_ERROR;
TRACE("(0x%08x, %p, %ld)\n", had, pafd, fdwDetails);
if (fdwDetails & ~(ACM_FILTERDETAILSF_FILTER))
return MMSYSERR_INVALFLAG;
return MSACM_Message(had, ACMDM_FILTER_DETAILS,
(LPARAM) pafd, (LPARAM) fdwDetails);
}
/***********************************************************************
* acmFilterEnumA (MSACM32.17)
*/
MMRESULT WINAPI acmFilterEnumA(
HACMDRIVER had, PACMFILTERDETAILSA pafd,
ACMFILTERENUMCBA fnCallback, DWORD dwInstance, DWORD fdwEnum)
MMRESULT WINAPI acmFilterEnumA(HACMDRIVER had, PACMFILTERDETAILSA pafd,
ACMFILTERENUMCBA fnCallback, DWORD dwInstance,
DWORD fdwEnum)
{
FIXME("(0x%08x, %p, %p, %ld, %ld): stub\n",
had, pafd, fnCallback, dwInstance, fdwEnum
);
had, pafd, fnCallback, dwInstance, fdwEnum);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return MMSYSERR_ERROR;
}
......@@ -83,13 +92,12 @@ MMRESULT WINAPI acmFilterEnumA(
/***********************************************************************
* acmFilterEnumW (MSACM32.18)
*/
MMRESULT WINAPI acmFilterEnumW(
HACMDRIVER had, PACMFILTERDETAILSW pafd,
ACMFILTERENUMCBW fnCallback, DWORD dwInstance, DWORD fdwEnum)
MMRESULT WINAPI acmFilterEnumW(HACMDRIVER had, PACMFILTERDETAILSW pafd,
ACMFILTERENUMCBW fnCallback, DWORD dwInstance,
DWORD fdwEnum)
{
FIXME("(0x%08x, %p, %p, %ld, %ld): stub\n",
had, pafd, fnCallback, dwInstance, fdwEnum
);
had, pafd, fnCallback, dwInstance, fdwEnum);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return MMSYSERR_ERROR;
}
......@@ -97,46 +105,55 @@ MMRESULT WINAPI acmFilterEnumW(
/***********************************************************************
* acmFilterTagDetailsA (MSACM32.19)
*/
MMRESULT WINAPI acmFilterTagDetailsA(
HACMDRIVER had, PACMFILTERTAGDETAILSA paftd, DWORD fdwDetails)
MMRESULT WINAPI acmFilterTagDetailsA(HACMDRIVER had, PACMFILTERTAGDETAILSA paftda,
DWORD fdwDetails)
{
if(fdwDetails &
~(ACM_FILTERTAGDETAILSF_FILTERTAG|
ACM_FILTERTAGDETAILSF_LARGESTSIZE))
return MMSYSERR_INVALFLAG;
ACMFILTERTAGDETAILSW aftdw;
MMRESULT mmr;
/* FIXME
* How does the driver know if the ANSI or
* the UNICODE variant of PACMFILTERTAGDETAILS is used?
* It might check cbStruct or does it only accept ANSI.
*/
return (MMRESULT) acmDriverMessage(
had, ACMDM_FILTERTAG_DETAILS,
(LPARAM) paftd, (LPARAM) fdwDetails
);
memset(&aftdw, 0, sizeof(aftdw));
aftdw.cbStruct = sizeof(aftdw);
aftdw.dwFilterTagIndex = paftda->dwFilterTagIndex;
aftdw.dwFilterTag = paftda->dwFilterTag;
mmr = acmFilterTagDetailsW(had, &aftdw, fdwDetails);
if (mmr == MMSYSERR_NOERROR) {
paftda->dwFilterTag = aftdw.dwFilterTag;
paftda->dwFilterTagIndex = aftdw.dwFilterTagIndex;
paftda->cbFilterSize = aftdw.cbFilterSize;
paftda->fdwSupport = aftdw.fdwSupport;
paftda->cStandardFilters = aftdw.cStandardFilters;
lstrcpyWtoA(paftda->szFilterTag, aftdw.szFilterTag);
}
return mmr;
}
/***********************************************************************
* acmFilterTagDetailsW (MSACM32.20)
*/
MMRESULT WINAPI acmFilterTagDetailsW(
HACMDRIVER had, PACMFILTERTAGDETAILSW paftd, DWORD fdwDetails)
MMRESULT WINAPI acmFilterTagDetailsW(HACMDRIVER had, PACMFILTERTAGDETAILSW paftd,
DWORD fdwDetails)
{
FIXME("(0x%08x, %p, %ld): stub\n", had, paftd, fdwDetails);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return MMSYSERR_ERROR;
TRACE("(0x%08x, %p, %ld)\n", had, paftd, fdwDetails);
if (fdwDetails &
~(ACM_FILTERTAGDETAILSF_FILTERTAG|
ACM_FILTERTAGDETAILSF_LARGESTSIZE))
return MMSYSERR_INVALFLAG;
return MSACM_Message(had, ACMDM_FILTERTAG_DETAILS,
(LPARAM)paftd, (LPARAM)fdwDetails);
}
/***********************************************************************
* acmFilterTagEnumA (MSACM32.21)
*/
MMRESULT WINAPI acmFilterTagEnumA(
HACMDRIVER had, PACMFILTERTAGDETAILSA paftd,
ACMFILTERTAGENUMCBA fnCallback, DWORD dwInstance, DWORD fdwEnum)
MMRESULT WINAPI acmFilterTagEnumA(HACMDRIVER had, PACMFILTERTAGDETAILSA paftd,
ACMFILTERTAGENUMCBA fnCallback, DWORD dwInstance,
DWORD fdwEnum)
{
FIXME("(0x%08x, %p, %p, %ld, %ld): stub\n",
had, paftd, fnCallback, dwInstance, fdwEnum
);
had, paftd, fnCallback, dwInstance, fdwEnum);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return MMSYSERR_ERROR;
}
......@@ -144,13 +161,12 @@ MMRESULT WINAPI acmFilterTagEnumA(
/***********************************************************************
* acmFilterTagEnumW (MSACM32.22)
*/
MMRESULT WINAPI acmFilterTagEnumW(
HACMDRIVER had, PACMFILTERTAGDETAILSW paftd,
ACMFILTERTAGENUMCBW fnCallback, DWORD dwInstance, DWORD fdwEnum)
MMRESULT WINAPI acmFilterTagEnumW(HACMDRIVER had, PACMFILTERTAGDETAILSW paftd,
ACMFILTERTAGENUMCBW fnCallback, DWORD dwInstance,
DWORD fdwEnum)
{
FIXME("(0x%08x, %p, %p, %ld, %ld): stub\n",
had, paftd, fnCallback, dwInstance, fdwEnum
);
had, paftd, fnCallback, dwInstance, fdwEnum);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return MMSYSERR_ERROR;
}
......@@ -30,7 +30,7 @@ PWINE_ACMDRIVERID MSACM_pFirstACMDriverID = NULL;
PWINE_ACMDRIVERID MSACM_pLastACMDriverID = NULL;
/***********************************************************************
* MSACM_RegisterDriver32()
* MSACM_RegisterDriver()
*/
PWINE_ACMDRIVERID MSACM_RegisterDriver(LPSTR pszDriverAlias, LPSTR pszFileName,
HINSTANCE hinstModule)
......@@ -40,6 +40,8 @@ PWINE_ACMDRIVERID MSACM_RegisterDriver(LPSTR pszDriverAlias, LPSTR pszFileName,
TRACE("('%s', '%s', 0x%08x)\n", pszDriverAlias, pszFileName, hinstModule);
padid = (PWINE_ACMDRIVERID) HeapAlloc(MSACM_hHeap, 0, sizeof(WINE_ACMDRIVERID));
padid->obj.dwType = WINE_ACMOBJ_DRIVERID;
padid->obj.pACMDriverID = padid;
padid->pszDriverAlias = HEAP_strdupA(MSACM_hHeap, 0, pszDriverAlias);
padid->pszFileName = HEAP_strdupA(MSACM_hHeap, 0, pszFileName);
padid->hInstModule = hinstModule;
......@@ -57,7 +59,7 @@ PWINE_ACMDRIVERID MSACM_RegisterDriver(LPSTR pszDriverAlias, LPSTR pszFileName,
}
/***********************************************************************
* MSACM_RegisterAllDrivers32()
* MSACM_RegisterAllDrivers()
*/
void MSACM_RegisterAllDrivers(void)
{
......@@ -95,7 +97,7 @@ void MSACM_RegisterAllDrivers(void)
}
/***********************************************************************
* MSACM_UnregisterDriver32()
* MSACM_UnregisterDriver()
*/
PWINE_ACMDRIVERID MSACM_UnregisterDriver(PWINE_ACMDRIVERID p)
{
......@@ -127,7 +129,7 @@ PWINE_ACMDRIVERID MSACM_UnregisterDriver(PWINE_ACMDRIVERID p)
}
/***********************************************************************
* MSACM_UnregisterAllDrivers32()
* MSACM_UnregisterAllDrivers()
* FIXME
* Where should this function be called?
*/
......@@ -139,27 +141,40 @@ void MSACM_UnregisterAllDrivers(void)
}
/***********************************************************************
* MSACM_GetDriverID32()
* MSACM_GetObj()
*/
PWINE_ACMDRIVERID MSACM_GetDriverID(HACMDRIVERID hDriverID)
PWINE_ACMOBJ MSACM_GetObj(HACMOBJ hObj, DWORD type)
{
return (PWINE_ACMDRIVERID)hDriverID;
PWINE_ACMOBJ pao = (PWINE_ACMOBJ)hObj;
if (IsBadReadPtr(pao, sizeof(WINE_ACMOBJ)) ||
((type != WINE_ACMOBJ_DONTCARE) && (type != pao->dwType)))
return NULL;
return pao;
}
/***********************************************************************
* MSACM_GetDriver32()
* MSACM_GetDriverID()
*/
PWINE_ACMDRIVER MSACM_GetDriver(HACMDRIVER hDriver)
PWINE_ACMDRIVERID MSACM_GetDriverID(HACMDRIVERID hDriverID)
{
return (PWINE_ACMDRIVER)hDriver;
return (PWINE_ACMDRIVERID)MSACM_GetObj((HACMOBJ)hDriverID, WINE_ACMOBJ_DRIVERID);
}
/***********************************************************************
* MSACM_GetObj32()
* MSACM_GetDriver()
*/
PWINE_ACMOBJ MSACM_GetObj(HACMOBJ hObj)
PWINE_ACMDRIVER MSACM_GetDriver(HACMDRIVER hDriver)
{
return (PWINE_ACMOBJ)hObj;
return (PWINE_ACMDRIVER)MSACM_GetObj((HACMOBJ)hDriver, WINE_ACMOBJ_DRIVER);
}
/***********************************************************************
* MSACM_Message()
*/
MMRESULT MSACM_Message(HACMDRIVER had, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
{
PWINE_ACMDRIVER pad = MSACM_GetDriver(had);
return pad ? SendDriverMessage(pad->hDrvr, uMsg, lParam1, lParam2) : MMSYSERR_INVALHANDLE;
}
/*
* Top level resource file for MS ACM
*
*/
#include "windef.h"
#include "winuser.h"
#include "wineacm.h"
LANGUAGE 0,0
DLG_ACMFORMATCHOOSE_ID DIALOG DISCARDABLE 10, 20, 225, 100
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Sound Selection"
FONT 8, "MS Shell Dlg"
BEGIN
LTEXT "&Name:", -1, 5, 5, 115, 8, NOT WS_GROUP
COMBOBOX IDD_ACMFORMATCHOOSE_CMB_CUSTOM, 5, 15, 115, 60,
CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "&Save As...", IDD_ACMFORMATCHOOSE_BTN_SETNAME, 125, 14, 45, 14
PUSHBUTTON "&Remove", IDD_ACMFORMATCHOOSE_BTN_DELNAME, 175, 14, 45, 14
LTEXT "&Format:", -1, 5, 41, 44, 8, NOT WS_GROUP
COMBOBOX IDD_ACMFORMATCHOOSE_CMB_FORMATTAG, 50, 39, 170, 60,
CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
LTEXT "&Attributes:", -1, 5, 59, 44, 8, NOT WS_GROUP
#if 0
COMBOBOX IDD_ACMFORMATCHOOSE_CMB_FORMAT, 50, 57, 170, 60,
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP |
CBS_OWNERDRAWFIXED | CBS_HASSTRINGS
#else
COMBOBOX IDD_ACMFORMATCHOOSE_CMB_FORMAT, 50, 57, 170, 60,
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
#endif
DEFPUSHBUTTON "OK", IDOK, 48, 80, 40, 14
PUSHBUTTON "Cancel", IDCANCEL, 92, 80, 40, 14
PUSHBUTTON "&Help", IDD_ACMFORMATCHOOSE_BTN_HELP, 136, 80, 40, 14
END
name msacm32
type win32
init MSACM32_LibMain
rsrc msacm
import winmm.dll
import kernel32.dll
......
......@@ -20,6 +20,7 @@ DEFAULT_DEBUG_CHANNEL(msacm);
/**********************************************************************/
static DWORD MSACM_dwProcessesAttached = 0;
HINSTANCE MSACM_hInstance32 = 0;
/***********************************************************************
* MSACM_LibMain (MSACM32.init)
......@@ -32,6 +33,7 @@ BOOL WINAPI MSACM32_LibMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReser
case DLL_PROCESS_ATTACH:
if (MSACM_dwProcessesAttached == 0) {
MSACM_hHeap = HeapCreate(0, 0x10000, 0);
MSACM_hInstance32 = hInstDLL;
MSACM_RegisterAllDrivers();
}
MSACM_dwProcessesAttached++;
......@@ -42,6 +44,7 @@ BOOL WINAPI MSACM32_LibMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReser
MSACM_UnregisterAllDrivers();
HeapDestroy(MSACM_hHeap);
MSACM_hHeap = (HANDLE) NULL;
MSACM_hInstance32 = (HINSTANCE)NULL;
}
break;
case DLL_THREAD_ATTACH:
......@@ -89,12 +92,13 @@ DWORD WINAPI acmGetVersion(void)
*/
MMRESULT WINAPI acmMetrics(HACMOBJ hao, UINT uMetric, LPVOID pMetric)
{
PWINE_ACMOBJ pao = MSACM_GetObj(hao);
PWINE_ACMOBJ pao = MSACM_GetObj(hao, WINE_ACMOBJ_DONTCARE);
BOOL bLocal = TRUE;
PWINE_ACMDRIVERID padid;
DWORD val = 0;
MMRESULT mmr = MMSYSERR_NOERROR;
FIXME("(0x%08x, %d, %p): stub\n", hao, uMetric, pMetric);
TRACE("(0x%08x, %d, %p);\n", hao, uMetric, pMetric);
switch (uMetric) {
case ACM_METRIC_COUNT_DRIVERS:
......@@ -107,7 +111,7 @@ MMRESULT WINAPI acmMetrics(HACMOBJ hao, UINT uMetric, LPVOID pMetric)
if (padid->bEnabled /* && (local(padid) || !bLocal) */)
val++;
*(LPDWORD)pMetric = val;
return 0;
break;
case ACM_METRIC_COUNT_CODECS:
if (!pao)
......@@ -120,7 +124,7 @@ MMRESULT WINAPI acmMetrics(HACMOBJ hao, UINT uMetric, LPVOID pMetric)
if (padid->bEnabled /* && (local(padid) || !bLocal) */)
val++;
*(LPDWORD)pMetric = val;
return 0;
break;
case ACM_METRIC_COUNT_CONVERTERS:
bLocal = FALSE;
......@@ -131,7 +135,7 @@ MMRESULT WINAPI acmMetrics(HACMOBJ hao, UINT uMetric, LPVOID pMetric)
if (padid->bEnabled /* && (local(padid) || !bLocal) */)
val++;
*(LPDWORD)pMetric = val;
return 0;
break;
case ACM_METRIC_COUNT_FILTERS:
bLocal = FALSE;
......@@ -142,7 +146,7 @@ MMRESULT WINAPI acmMetrics(HACMOBJ hao, UINT uMetric, LPVOID pMetric)
if (padid->bEnabled /* && (local(padid) || !bLocal) */)
val++;
*(LPDWORD)pMetric = val;
return 0;
break;
case ACM_METRIC_COUNT_DISABLED:
bLocal = FALSE;
......@@ -154,13 +158,32 @@ MMRESULT WINAPI acmMetrics(HACMOBJ hao, UINT uMetric, LPVOID pMetric)
if (!padid->bEnabled /* && (local(padid) || !bLocal) */)
val++;
*(LPDWORD)pMetric = val;
return 0;
break;
case ACM_METRIC_MAX_SIZE_FORMAT:
/* FIXME: According to MSDN, this should return the size of the largest WAVEFORMATEX
structure in the system. How is this calculated? */
*(LPDWORD)pMetric = sizeof (WAVEFORMATEX);
return 0;
{
ACMFORMATTAGDETAILSW aftd;
aftd.cbStruct = sizeof(aftd);
aftd.dwFormatTag = WAVE_FORMAT_UNKNOWN;
if (hao == (HACMOBJ)NULL) {
mmr = acmFormatTagDetailsW((HACMDRIVER)NULL, &aftd, ACM_FORMATTAGDETAILSF_LARGESTSIZE);
} else if (MSACM_GetObj(hao, WINE_ACMOBJ_DRIVER)) {
mmr = acmFormatTagDetailsW((HACMDRIVER)hao, &aftd, ACM_FORMATTAGDETAILSF_LARGESTSIZE);
} else if (MSACM_GetObj(hao, WINE_ACMOBJ_DRIVERID)) {
HACMDRIVER had;
if (acmDriverOpen(&had, (HACMDRIVERID)hao, 0) == 0) {
mmr = acmFormatTagDetailsW((HACMDRIVER)hao, &aftd, ACM_FORMATTAGDETAILSF_LARGESTSIZE);
acmDriverClose(had, 0);
}
} else {
mmr = MMSYSERR_INVALHANDLE;
}
if (mmr == MMSYSERR_NOERROR) *(LPDWORD)pMetric = aftd.cbFormatSize;
}
break;
case ACM_METRIC_COUNT_HARDWARE:
case ACM_METRIC_HARDWARE_WAVE_INPUT:
......@@ -169,7 +192,8 @@ MMRESULT WINAPI acmMetrics(HACMOBJ hao, UINT uMetric, LPVOID pMetric)
case ACM_METRIC_DRIVER_SUPPORT:
case ACM_METRIC_DRIVER_PRIORITY:
default:
return MMSYSERR_NOTSUPPORTED;
FIXME("(0x%08x, %d, %p): stub\n", hao, uMetric, pMetric);
mmr = MMSYSERR_NOTSUPPORTED;
}
return MMSYSERR_NOERROR;
return mmr;
}
......@@ -165,6 +165,7 @@ MMRESULT WINAPI acmStreamOpen(PHACMSTREAM phas, HACMDRIVER had, PWAVEFORMATEX pw
goto errCleanUp;
}
was->obj.dwType = WINE_ACMOBJ_STREAM;
was->obj.pACMDriverID = wad->obj.pACMDriverID;
was->pDrv = wad;
was->hAcmDriver = 0; /* not to close it in acmStreamClose */
......@@ -180,6 +181,7 @@ MMRESULT WINAPI acmStreamOpen(PHACMSTREAM phas, HACMDRIVER had, PWAVEFORMATEX pw
ret = acmDriverOpen(&had, (HACMDRIVERID)wadi, 0L);
if (ret == MMSYSERR_NOERROR) {
if ((wad = MSACM_GetDriver(had)) != 0) {
was->obj.dwType = WINE_ACMOBJ_STREAM;
was->obj.pACMDriverID = wad->obj.pACMDriverID;
was->pDrv = wad;
was->hAcmDriver = had;
......
......@@ -6,8 +6,14 @@
typedef struct _WINE_ACMDRIVERID *PWINE_ACMDRIVERID;
typedef struct _WINE_ACMDRIVER *PWINE_ACMDRIVER;
#define WINE_ACMOBJ_DONTCARE 0x5EED0000
#define WINE_ACMOBJ_DRIVERID 0x5EED0001
#define WINE_ACMOBJ_DRIVER 0x5EED0002
#define WINE_ACMOBJ_STREAM 0x5EED0003
typedef struct _WINE_ACMOBJ
{
DWORD dwType;
PWINE_ACMDRIVERID pACMDriverID;
} WINE_ACMOBJ, *PWINE_ACMOBJ;
......@@ -29,6 +35,7 @@ typedef struct _WINE_ACMSTREAM
typedef struct _WINE_ACMDRIVERID
{
WINE_ACMOBJ obj;
LPSTR pszDriverAlias;
LPSTR pszFileName;
HINSTANCE hInstModule; /* NULL if global */
......@@ -43,13 +50,33 @@ typedef struct _WINE_ACMDRIVERID
extern HANDLE MSACM_hHeap;
extern PWINE_ACMDRIVERID MSACM_pFirstACMDriverID;
extern PWINE_ACMDRIVERID MSACM_pLastACMDriverID;
PWINE_ACMDRIVERID MSACM_RegisterDriver(
LPSTR pszDriverAlias, LPSTR pszFileName,
extern PWINE_ACMDRIVERID MSACM_RegisterDriver(LPSTR pszDriverAlias, LPSTR pszFileName,
HINSTANCE hinstModule);
void MSACM_RegisterAllDrivers(void);
PWINE_ACMDRIVERID MSACM_UnregisterDriver(PWINE_ACMDRIVERID p);
void MSACM_UnregisterAllDrivers(void);
PWINE_ACMDRIVERID MSACM_GetDriverID(HACMDRIVERID hDriverID);
PWINE_ACMDRIVER MSACM_GetDriver(HACMDRIVER hDriver);
PWINE_ACMOBJ MSACM_GetObj(HACMOBJ hObj);
extern void MSACM_RegisterAllDrivers(void);
extern PWINE_ACMDRIVERID MSACM_UnregisterDriver(PWINE_ACMDRIVERID p);
extern void MSACM_UnregisterAllDrivers(void);
extern PWINE_ACMDRIVERID MSACM_GetDriverID(HACMDRIVERID hDriverID);
extern PWINE_ACMDRIVER MSACM_GetDriver(HACMDRIVER hDriver);
extern PWINE_ACMOBJ MSACM_GetObj(HACMOBJ hObj, DWORD type);
extern MMRESULT MSACM_Message(HACMDRIVER, UINT, LPARAM, LPARAM);
/* From msacm32.c */
extern HINSTANCE MSACM_hInstance32;
/* Dialog box templates */
#define DLG_ACMFORMATCHOOSE_ID 70
#define IDD_ACMFORMATCHOOSE_BTN_HELP 9
#define IDD_ACMFORMATCHOOSE_CMB_CUSTOM 100
#define IDD_ACMFORMATCHOOSE_CMB_FORMATTAG 101
#define IDD_ACMFORMATCHOOSE_CMB_FORMAT 102
#define IDD_ACMFORMATCHOOSE_BTN_SETNAME 103
#define IDD_ACMFORMATCHOOSE_BTN_DELNAME 104
#define DLG_ACMFILTERCHOOSE_ID 71
#define IDD_ACMFILTERCHOOSE_BTN_HELP 9
#define IDD_ACMFILTERCHOOSE_CMB_CUSTOM 100
#define IDD_ACMFILTERCHOOSE_CMB_FILTERTAG 101
#define IDD_ACMFILTERCHOOSE_CMB_FILTER 102
#define IDD_ACMFILTERCHOOSE_BTN_SETNAME 103
#define IDD_ACMFILTERCHOOSE_BTN_DELNAME 104
......@@ -205,6 +205,7 @@ typedef UINT CALLBACK (*ACMFILTERCHOOSEHOOKPROCA)(
typedef UINT CALLBACK (*ACMFILTERCHOOSEHOOKPROCW)(
HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam
);
#define ACMFILTERCHOOSEHOOKPROC WINELIB_NAME_AW(ACMFILTERCHOOSEHOOKPROC)
typedef UINT CALLBACK (*ACMFILTERCHOOSEHOOKPROC16)(
HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam
......@@ -217,6 +218,7 @@ typedef UINT CALLBACK (*ACMFORMATCHOOSEHOOKPROCA)(
typedef UINT CALLBACK (*ACMFORMATCHOOSEHOOKPROCW)(
HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam
);
#define ACMFORMATCHOOSEHOOKPROC WINELIB_NAME_AW(ACMFORMATCHOOSEHOOKPROC)
typedef UINT16 CALLBACK (*ACMFORMATCHOOSEHOOKPROC16)(
HWND16 hwnd, UINT16 uMsg, WPARAM16 wParam, LPARAM lParam
......@@ -278,6 +280,9 @@ typedef struct _ACMDRIVERDETAILSW
WCHAR szFeatures[ACMDRIVERDETAILS_FEATURES_CHARS];
} ACMDRIVERDETAILSW, *PACMDRIVERDETAILSW;
DECL_WINELIB_TYPE_AW(ACMDRIVERDETAILS);
DECL_WINELIB_TYPE_AW(PACMDRIVERDETAILS);
typedef struct _ACMDRIVERDETAILS16
{
DWORD cbStruct;
......@@ -356,6 +361,9 @@ typedef struct _ACMFILTERCHOOSEW
ACMFILTERCHOOSEHOOKPROCW pfnHook;
} ACMFILTERCHOOSEW, *PACMFILTERCHOOSEW;
DECL_WINELIB_TYPE_AW(ACMFILTERCHOOSE);
DECL_WINELIB_TYPE_AW(PACMFILTERCHOOSE);
typedef struct _ACMFILTERCHOOSE16
{
DWORD cbStruct;
......@@ -404,6 +412,9 @@ typedef struct _ACMFILTERDETAILSW
WCHAR szFilter[ACMFILTERDETAILS_FILTER_CHARS];
} ACMFILTERDETAILSW, *PACMFILTERDETAILSW;
DECL_WINELIB_TYPE_AW(ACMFILTERDETAILS);
DECL_WINELIB_TYPE_AW(PACMFILTERDETAILS);
typedef struct _ACMFILTERDETAILS16
{
DWORD cbStruct;
......@@ -437,6 +448,9 @@ typedef struct _ACMFILTERTAGDETAILSW
WCHAR szFilterTag[ACMFILTERTAGDETAILS_FILTERTAG_CHARS];
} ACMFILTERTAGDETAILSW, *PACMFILTERTAGDETAILSW;
DECL_WINELIB_TYPE_AW(ACMFILTERTAGDETAILS);
DECL_WINELIB_TYPE_AW(PACMFILTERTAGDETAILS);
typedef struct _ACMFILTERTAGDETAILS16
{
DWORD cbStruct;
......@@ -500,6 +514,9 @@ typedef struct _ACMFORMATCHOOSEW
ACMFORMATCHOOSEHOOKPROCW pfnHook;
} ACMFORMATCHOOSEW, *PACMFORMATCHOOSEW;
DECL_WINELIB_TYPE_AW(ACMFORMATCHOOSE);
DECL_WINELIB_TYPE_AW(PACMFORMATCHOOSE);
typedef struct _ACMFORMATCHOOSE16
{
DWORD cbStruct;
......@@ -548,6 +565,9 @@ typedef struct _ACMFORMATDETAILSW
WCHAR szFormat[ACMFORMATDETAILS_FORMAT_CHARS];
} ACMFORMATDETAILSW, *PACMFORMATDETAILSW;
DECL_WINELIB_TYPE_AW(ACMFORMATDETAILS);
DECL_WINELIB_TYPE_AW(PACMFORMATDETAILS);
typedef struct _ACMFORMATDETAILS16
{
DWORD cbStruct;
......@@ -581,6 +601,9 @@ typedef struct _ACMFORMATTAGDETAILSW
WCHAR szFormatTag[ACMFORMATTAGDETAILS_FORMATTAG_CHARS];
} ACMFORMATTAGDETAILSW, *PACMFORMATTAGDETAILSW;
DECL_WINELIB_TYPE_AW(ACMFORMATTAGDETAILS);
DECL_WINELIB_TYPE_AW(PACMFORMATTAGDETAILS);
typedef struct _ACMFORMATTAGDETAILS16
{
DWORD cbStruct;
......@@ -623,6 +646,8 @@ typedef BOOL CALLBACK (*ACMFILTERENUMCBW)(
DWORD dwInstance, DWORD fdwSupport
);
#define ACMFILTERENUMCB WINELIB_NAME_AW(ACMFILTERENUMCB)
typedef BOOL16 CALLBACK (*ACMFILTERENUMCB16)(
HACMDRIVERID16 hadid, LPACMFILTERDETAILS16 pafd,
DWORD dwInstance, DWORD fdwSupport
......@@ -638,6 +663,8 @@ typedef BOOL CALLBACK (*ACMFILTERTAGENUMCBW)(
DWORD dwInstance, DWORD fdwSupport
);
#define ACMFILTERTAGENUMCB WINELIB_NAME_AW(ACMFILTERTAGENUMCB)
typedef BOOL16 CALLBACK (*ACMFILTERTAGENUMCB16)(
HACMDRIVERID16 hadid, LPACMFILTERTAGDETAILS16 paftd,
DWORD dwInstance, DWORD fdwSupport
......@@ -653,6 +680,8 @@ typedef BOOL CALLBACK (*ACMFORMATENUMCBW)(
DWORD dwInstance, DWORD fdwSupport
);
#define ACMFORMATENUMCB WINELIB_NAME_AW(ACMFORMATENUMCB)
typedef BOOL16 CALLBACK (*ACMFORMATENUMCB16)(
HACMDRIVERID16 hadid, LPACMFORMATDETAILS16 pafd,
DWORD dwInstance, DWORD fdwSupport
......@@ -668,6 +697,8 @@ typedef BOOL CALLBACK (*ACMFORMATTAGENUMCBW)(
DWORD dwInstance, DWORD fdwSupport
);
#define ACMFORMATTAGENUMCB WINELIB_NAME_AW(ACMFORMATTAGENUMCB)
typedef BOOL16 CALLBACK (*ACMFORMATTAGENUMCB16)(
HACMDRIVERID16 hadid, LPACMFORMATTAGDETAILS16 paftd,
DWORD dwInstance, DWORD fdwSupport
......@@ -786,6 +817,8 @@ MMRESULT WINAPI acmDriverAddW(
PHACMDRIVERID phadid, HINSTANCE hinstModule,
LPARAM lParam, DWORD dwPriority, DWORD fdwAdd
);
#define acmDriverAdd WINELIB_NAME_AW(acmDriverAdd)
MMRESULT WINAPI acmDriverClose(
HACMDRIVER had, DWORD fdwClose
);
......@@ -795,6 +828,8 @@ MMRESULT WINAPI acmDriverDetailsA(
MMRESULT WINAPI acmDriverDetailsW(
HACMDRIVERID hadid, PACMDRIVERDETAILSW padd, DWORD fdwDetails
);
#define acmDriverDetails WINELIB_NAME_AW(acmDriverDetails)
MMRESULT WINAPI acmDriverEnum(
ACMDRIVERENUMCB fnCallback, DWORD dwInstance, DWORD fdwEnum
);
......@@ -819,12 +854,16 @@ MMRESULT WINAPI acmFilterChooseA(
MMRESULT WINAPI acmFilterChooseW(
PACMFILTERCHOOSEW pafltrc
);
#define acmFilterChoose WINELIB_NAME_AW(acmFilterChoose)
MMRESULT WINAPI acmFilterDetailsA(
HACMDRIVER had, PACMFILTERDETAILSA pafd, DWORD fdwDetails
);
MMRESULT WINAPI acmFilterDetailsW(
HACMDRIVER had, PACMFILTERDETAILSW pafd, DWORD fdwDetails
);
#define acmFilterDetails WINELIB_NAME_AW(acmFilterDetails)
MMRESULT WINAPI acmFilterEnumA(
HACMDRIVER had, PACMFILTERDETAILSA pafd,
ACMFILTERENUMCBA fnCallback, DWORD dwInstance, DWORD fdwEnum
......@@ -833,12 +872,16 @@ MMRESULT WINAPI acmFilterEnumW(
HACMDRIVER had, PACMFILTERDETAILSW pafd,
ACMFILTERENUMCBW fnCallback, DWORD dwInstance, DWORD fdwEnum
);
#define acmFilterEnum WINELIB_NAME_AW(acmFilterEnum)
MMRESULT WINAPI acmFilterTagDetailsA(
HACMDRIVER had, PACMFILTERTAGDETAILSA paftd, DWORD fdwDetails
);
MMRESULT WINAPI acmFilterTagDetailsW(
HACMDRIVER had, PACMFILTERTAGDETAILSW paftd, DWORD fdwDetails
);
#define acmFilterTagDetails WINELIB_NAME_AW(acmFilterTagDetails)
MMRESULT WINAPI acmFilterTagEnumA(
HACMDRIVER had, PACMFILTERTAGDETAILSA paftd,
ACMFILTERTAGENUMCBA fnCallback, DWORD dwInstance, DWORD fdwEnum
......@@ -847,18 +890,24 @@ MMRESULT WINAPI acmFilterTagEnumW(
HACMDRIVER had, PACMFILTERTAGDETAILSW paftd,
ACMFILTERTAGENUMCBW fnCallback, DWORD dwInstance, DWORD fdwEnum
);
#define acmFilterTagEnum WINELIB_NAME_AW(acmFilterTagEnum)
MMRESULT WINAPI acmFormatChooseA(
PACMFORMATCHOOSEA pafmtc
);
MMRESULT WINAPI acmFormatChooseW(
PACMFORMATCHOOSEW pafmtc
);
#define acmFormatChoose WINELIB_NAME_AW(acmFormatChoose)
MMRESULT WINAPI acmFormatDetailsA(
HACMDRIVER had, PACMFORMATDETAILSA pafd, DWORD fdwDetails
);
MMRESULT WINAPI acmFormatDetailsW(
HACMDRIVER had, PACMFORMATDETAILSW pafd, DWORD fdwDetails
);
#define acmFormatDetails WINELIB_NAME_AW(acmFormatDetails)
MMRESULT WINAPI acmFormatEnumA(
HACMDRIVER had, PACMFORMATDETAILSA pafd,
ACMFORMATENUMCBA fnCallback, DWORD dwInstance, DWORD fdwEnum
......@@ -867,6 +916,8 @@ MMRESULT WINAPI acmFormatEnumW(
HACMDRIVER had, PACMFORMATDETAILSW pafd,
ACMFORMATENUMCBW fnCallback, DWORD dwInstance, DWORD fdwEnum
);
#define acmFormatEnum WINELIB_NAME_AW(acmFormatEnum)
MMRESULT WINAPI acmFormatSuggest(
HACMDRIVER had, PWAVEFORMATEX pwfxSrc, PWAVEFORMATEX pwfxDst,
DWORD cbwfxDst, DWORD fdwSuggest
......@@ -877,6 +928,8 @@ MMRESULT WINAPI acmFormatTagDetailsA(
MMRESULT WINAPI acmFormatTagDetailsW(
HACMDRIVER had, PACMFORMATTAGDETAILSW paftd, DWORD fdwDetails
);
#define acmFormatTagDetails WINELIB_NAME_AW(acmFormatTagDetails)
MMRESULT WINAPI acmFormatTagEnumA(
HACMDRIVER had, PACMFORMATTAGDETAILSA paftd,
ACMFORMATTAGENUMCBA fnCallback, DWORD dwInstance, DWORD fdwEnum
......@@ -885,6 +938,8 @@ MMRESULT WINAPI acmFormatTagEnumW(
HACMDRIVER had, PACMFORMATTAGDETAILSW paftd,
ACMFORMATTAGENUMCBW fnCallback, DWORD dwInstance, DWORD fdwEnum
);
#define acmFormatTagEnum WINELIB_NAME_AW(acmFormatTagEnum)
DWORD WINAPI acmGetVersion(
);
MMRESULT WINAPI acmMetrics(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment