2000-08-26 04:33:00 +00:00
|
|
|
/* -*- tab-width: 8; c-basic-offset: 4 -*- */
|
|
|
|
|
1998-10-11 17:00:29 +00:00
|
|
|
/*
|
|
|
|
* MSACM32 library
|
|
|
|
*
|
|
|
|
* Copyright 1998 Patrik Stridvall
|
|
|
|
*/
|
|
|
|
|
2001-01-26 20:43:40 +00:00
|
|
|
#include <string.h>
|
1999-02-17 13:51:06 +00:00
|
|
|
#include "winbase.h"
|
2000-11-28 22:40:56 +00:00
|
|
|
#include "winnls.h"
|
1998-10-11 17:00:29 +00:00
|
|
|
#include "winerror.h"
|
|
|
|
#include "mmsystem.h"
|
|
|
|
#include "msacm.h"
|
|
|
|
#include "msacmdrv.h"
|
2000-08-26 04:33:00 +00:00
|
|
|
#include "wineacm.h"
|
1999-05-14 08:17:14 +00:00
|
|
|
#include "debugtools.h"
|
1998-10-11 17:00:29 +00:00
|
|
|
|
2000-08-26 04:33:00 +00:00
|
|
|
DEFAULT_DEBUG_CHANNEL(msacm);
|
1999-04-19 14:56:29 +00:00
|
|
|
|
1998-10-11 17:00:29 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* acmFilterChooseA (MSACM32.13)
|
|
|
|
*/
|
2000-08-26 04:33:00 +00:00
|
|
|
MMRESULT WINAPI acmFilterChooseA(PACMFILTERCHOOSEA pafltrc)
|
1998-10-11 17:00:29 +00:00
|
|
|
{
|
2000-08-26 04:33:00 +00:00
|
|
|
FIXME("(%p): stub\n", pafltrc);
|
|
|
|
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
|
|
|
return MMSYSERR_ERROR;
|
1998-10-11 17:00:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* acmFilterChooseW (MSACM32.14)
|
|
|
|
*/
|
2000-08-26 04:33:00 +00:00
|
|
|
MMRESULT WINAPI acmFilterChooseW(PACMFILTERCHOOSEW pafltrc)
|
1998-10-11 17:00:29 +00:00
|
|
|
{
|
2000-08-26 04:33:00 +00:00
|
|
|
FIXME("(%p): stub\n", pafltrc);
|
|
|
|
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
|
|
|
return MMSYSERR_ERROR;
|
1998-10-11 17:00:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* acmFilterDetailsA (MSACM32.15)
|
|
|
|
*/
|
2000-08-26 04:33:00 +00:00
|
|
|
MMRESULT WINAPI acmFilterDetailsA(HACMDRIVER had, PACMFILTERDETAILSA pafd,
|
|
|
|
DWORD fdwDetails)
|
1998-10-11 17:00:29 +00:00
|
|
|
{
|
2000-08-26 04:33:00 +00:00
|
|
|
ACMFILTERDETAILSW afdw;
|
|
|
|
MMRESULT mmr;
|
|
|
|
|
|
|
|
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;
|
2000-11-28 22:40:56 +00:00
|
|
|
WideCharToMultiByte( CP_ACP, 0, afdw.szFilter, -1, pafd->szFilter,
|
|
|
|
sizeof(pafd->szFilter), NULL, NULL );
|
2000-08-26 04:33:00 +00:00
|
|
|
}
|
|
|
|
return mmr;
|
1998-10-11 17:00:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* acmFilterDetailsW (MSACM32.16)
|
|
|
|
*/
|
2000-08-26 04:33:00 +00:00
|
|
|
MMRESULT WINAPI acmFilterDetailsW(HACMDRIVER had, PACMFILTERDETAILSW pafd,
|
|
|
|
DWORD fdwDetails)
|
1998-10-11 17:00:29 +00:00
|
|
|
{
|
2000-09-09 20:32:10 +00:00
|
|
|
MMRESULT mmr;
|
|
|
|
ACMFILTERTAGDETAILSA aftd;
|
|
|
|
|
2000-08-26 04:33:00 +00:00
|
|
|
TRACE("(0x%08x, %p, %ld)\n", had, pafd, fdwDetails);
|
|
|
|
|
2000-09-09 20:32:10 +00:00
|
|
|
memset(&aftd, 0, sizeof(aftd));
|
|
|
|
aftd.cbStruct = sizeof(aftd);
|
|
|
|
|
|
|
|
if (pafd->cbStruct < sizeof(*pafd)) return MMSYSERR_INVALPARAM;
|
|
|
|
|
|
|
|
switch (fdwDetails) {
|
|
|
|
case ACM_FILTERDETAILSF_FILTER:
|
|
|
|
if (pafd->dwFilterTag != pafd->pwfltr->dwFilterTag) {
|
|
|
|
mmr = MMSYSERR_INVALPARAM;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (had == (HACMDRIVER)NULL) {
|
|
|
|
PWINE_ACMDRIVERID padid;
|
|
|
|
|
|
|
|
mmr = ACMERR_NOTPOSSIBLE;
|
|
|
|
for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) {
|
|
|
|
/* should check for codec only */
|
|
|
|
if (padid->bEnabled &&
|
|
|
|
acmDriverOpen(&had, (HACMDRIVERID)padid, 0) == 0) {
|
|
|
|
mmr = MSACM_Message(had, ACMDM_FILTER_DETAILS,
|
|
|
|
(LPARAM)pafd, (LPARAM)fdwDetails);
|
|
|
|
acmDriverClose(had, 0);
|
|
|
|
if (mmr == MMSYSERR_NOERROR) break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
mmr = MSACM_Message(had, ACMDM_FILTER_DETAILS,
|
|
|
|
(LPARAM)pafd, (LPARAM)fdwDetails);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ACM_FILTERDETAILSF_INDEX:
|
|
|
|
/* should check pafd->dwFilterIndex < aftd->cStandardFilters */
|
|
|
|
mmr = MSACM_Message(had, ACMDM_FILTER_DETAILS,
|
|
|
|
(LPARAM)pafd, (LPARAM)fdwDetails);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
WARN("Unknown fdwDetails %08lx\n", fdwDetails);
|
|
|
|
mmr = MMSYSERR_INVALFLAG;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
TRACE("=> %d\n", mmr);
|
|
|
|
return mmr;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct MSACM_FilterEnumWtoA_Instance {
|
|
|
|
PACMFILTERDETAILSA pafda;
|
|
|
|
DWORD dwInstance;
|
|
|
|
ACMFILTERENUMCBA fnCallback;
|
|
|
|
};
|
|
|
|
|
|
|
|
static BOOL CALLBACK MSACM_FilterEnumCallbackWtoA(HACMDRIVERID hadid,
|
|
|
|
PACMFILTERDETAILSW pafdw,
|
|
|
|
DWORD dwInstance,
|
|
|
|
DWORD fdwSupport)
|
|
|
|
{
|
|
|
|
struct MSACM_FilterEnumWtoA_Instance* pafei;
|
|
|
|
|
|
|
|
pafei = (struct MSACM_FilterEnumWtoA_Instance*)dwInstance;
|
|
|
|
|
|
|
|
pafei->pafda->dwFilterIndex = pafdw->dwFilterIndex;
|
|
|
|
pafei->pafda->dwFilterTag = pafdw->dwFilterTag;
|
|
|
|
pafei->pafda->fdwSupport = pafdw->fdwSupport;
|
2000-11-28 22:40:56 +00:00
|
|
|
WideCharToMultiByte( CP_ACP, 0, pafdw->szFilter, -1, pafei->pafda->szFilter,
|
|
|
|
sizeof(pafei->pafda->szFilter), NULL, NULL );
|
2000-09-09 20:32:10 +00:00
|
|
|
|
|
|
|
return (pafei->fnCallback)(hadid, pafei->pafda,
|
|
|
|
pafei->dwInstance, fdwSupport);
|
1998-10-11 17:00:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* acmFilterEnumA (MSACM32.17)
|
|
|
|
*/
|
2000-09-09 20:32:10 +00:00
|
|
|
MMRESULT WINAPI acmFilterEnumA(HACMDRIVER had, PACMFILTERDETAILSA pafda,
|
2000-08-26 04:33:00 +00:00
|
|
|
ACMFILTERENUMCBA fnCallback, DWORD dwInstance,
|
|
|
|
DWORD fdwEnum)
|
1998-10-11 17:00:29 +00:00
|
|
|
{
|
2000-09-09 20:32:10 +00:00
|
|
|
ACMFILTERDETAILSW afdw;
|
|
|
|
struct MSACM_FilterEnumWtoA_Instance afei;
|
|
|
|
|
|
|
|
memset(&afdw, 0, sizeof(afdw));
|
|
|
|
afdw.cbStruct = sizeof(afdw);
|
|
|
|
afdw.dwFilterIndex = pafda->dwFilterIndex;
|
|
|
|
afdw.dwFilterTag = pafda->dwFilterTag;
|
|
|
|
afdw.pwfltr = pafda->pwfltr;
|
|
|
|
afdw.cbwfltr = pafda->cbwfltr;
|
|
|
|
|
|
|
|
afei.pafda = pafda;
|
|
|
|
afei.dwInstance = dwInstance;
|
|
|
|
afei.fnCallback = fnCallback;
|
|
|
|
|
|
|
|
return acmFilterEnumW(had, &afdw, MSACM_FilterEnumCallbackWtoA,
|
|
|
|
(DWORD)&afei, fdwEnum);
|
|
|
|
}
|
|
|
|
|
|
|
|
static BOOL MSACM_FilterEnumHelper(PWINE_ACMDRIVERID padid, HACMDRIVER had,
|
|
|
|
PACMFILTERDETAILSW pafd,
|
|
|
|
ACMFILTERENUMCBW fnCallback, DWORD dwInstance,
|
|
|
|
DWORD fdwEnum)
|
|
|
|
{
|
|
|
|
ACMDRIVERDETAILSW add;
|
|
|
|
ACMFILTERTAGDETAILSW aftd;
|
|
|
|
int i, j;
|
|
|
|
|
|
|
|
add.cbStruct = sizeof(add);
|
|
|
|
|
|
|
|
if (acmDriverDetailsW((HACMDRIVERID)padid, &add, 0) != MMSYSERR_NOERROR) return FALSE;
|
|
|
|
|
|
|
|
for (i = 0; i < add.cFilterTags; i++) {
|
|
|
|
memset(&aftd, 0, sizeof(aftd));
|
|
|
|
aftd.cbStruct = sizeof(aftd);
|
|
|
|
aftd.dwFilterTagIndex = i;
|
|
|
|
if (acmFilterTagDetailsW(had, &aftd, ACM_FILTERTAGDETAILSF_INDEX) != MMSYSERR_NOERROR)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if ((fdwEnum & ACM_FILTERENUMF_DWFILTERTAG) &&
|
|
|
|
aftd.dwFilterTag != pafd->pwfltr->dwFilterTag)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
for (j = 0; j < aftd.cStandardFilters; j++) {
|
|
|
|
pafd->dwFilterIndex = j;
|
|
|
|
pafd->dwFilterTag = aftd.dwFilterTag;
|
|
|
|
if (acmFilterDetailsW(had, pafd, ACM_FILTERDETAILSF_INDEX) != MMSYSERR_NOERROR)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (!(fnCallback)((HACMDRIVERID)padid, pafd, dwInstance, add.fdwSupport))
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return TRUE;
|
1998-10-11 17:00:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* acmFilterEnumW (MSACM32.18)
|
|
|
|
*/
|
2000-08-26 04:33:00 +00:00
|
|
|
MMRESULT WINAPI acmFilterEnumW(HACMDRIVER had, PACMFILTERDETAILSW pafd,
|
|
|
|
ACMFILTERENUMCBW fnCallback, DWORD dwInstance,
|
|
|
|
DWORD fdwEnum)
|
1998-10-11 17:00:29 +00:00
|
|
|
{
|
2000-09-09 20:32:10 +00:00
|
|
|
PWINE_ACMDRIVERID padid;
|
|
|
|
BOOL ret;
|
|
|
|
|
|
|
|
TRACE("(0x%08x, %p, %p, %ld, %ld)\n",
|
2000-08-26 04:33:00 +00:00
|
|
|
had, pafd, fnCallback, dwInstance, fdwEnum);
|
2000-09-09 20:32:10 +00:00
|
|
|
|
|
|
|
if (pafd->cbStruct < sizeof(*pafd)) return MMSYSERR_INVALPARAM;
|
|
|
|
|
|
|
|
if (fdwEnum & ~(ACM_FILTERENUMF_DWFILTERTAG))
|
|
|
|
FIXME("Unsupported fdwEnum values\n");
|
|
|
|
|
|
|
|
if (had) {
|
|
|
|
HACMDRIVERID hadid;
|
|
|
|
|
|
|
|
if (acmDriverID(had, &hadid, 0) != MMSYSERR_NOERROR)
|
|
|
|
return MMSYSERR_INVALHANDLE;
|
2001-02-12 01:28:12 +00:00
|
|
|
MSACM_FilterEnumHelper(MSACM_GetDriverID(hadid), had, pafd,
|
|
|
|
fnCallback, dwInstance, fdwEnum);
|
|
|
|
return MMSYSERR_NOERROR;
|
2000-09-09 20:32:10 +00:00
|
|
|
}
|
|
|
|
for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) {
|
|
|
|
/* should check for codec only */
|
|
|
|
if (!padid->bEnabled || acmDriverOpen(&had, (HACMDRIVERID)padid, 0) != MMSYSERR_NOERROR)
|
|
|
|
continue;
|
|
|
|
ret = MSACM_FilterEnumHelper(padid, had, pafd,
|
|
|
|
fnCallback, dwInstance, fdwEnum);
|
|
|
|
acmDriverClose(had, 0);
|
|
|
|
if (!ret) break;
|
|
|
|
}
|
|
|
|
return MMSYSERR_NOERROR;
|
1998-10-11 17:00:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* acmFilterTagDetailsA (MSACM32.19)
|
|
|
|
*/
|
2000-08-26 04:33:00 +00:00
|
|
|
MMRESULT WINAPI acmFilterTagDetailsA(HACMDRIVER had, PACMFILTERTAGDETAILSA paftda,
|
|
|
|
DWORD fdwDetails)
|
1998-10-11 17:00:29 +00:00
|
|
|
{
|
2000-08-26 04:33:00 +00:00
|
|
|
ACMFILTERTAGDETAILSW aftdw;
|
|
|
|
MMRESULT mmr;
|
|
|
|
|
|
|
|
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;
|
2000-11-28 22:40:56 +00:00
|
|
|
WideCharToMultiByte( CP_ACP, 0, aftdw.szFilterTag, -1, paftda->szFilterTag,
|
|
|
|
sizeof(paftda->szFilterTag), NULL, NULL );
|
2000-08-26 04:33:00 +00:00
|
|
|
}
|
|
|
|
return mmr;
|
1998-10-11 17:00:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* acmFilterTagDetailsW (MSACM32.20)
|
|
|
|
*/
|
2000-08-26 04:33:00 +00:00
|
|
|
MMRESULT WINAPI acmFilterTagDetailsW(HACMDRIVER had, PACMFILTERTAGDETAILSW paftd,
|
|
|
|
DWORD fdwDetails)
|
1998-10-11 17:00:29 +00:00
|
|
|
{
|
2000-09-09 20:32:10 +00:00
|
|
|
PWINE_ACMDRIVERID padid;
|
|
|
|
MMRESULT mmr;
|
|
|
|
|
2000-08-26 04:33:00 +00:00
|
|
|
TRACE("(0x%08x, %p, %ld)\n", had, paftd, fdwDetails);
|
|
|
|
|
2000-09-09 20:32:10 +00:00
|
|
|
if (fdwDetails & ~(ACM_FILTERTAGDETAILSF_FILTERTAG|ACM_FILTERTAGDETAILSF_INDEX|
|
|
|
|
ACM_FILTERTAGDETAILSF_LARGESTSIZE))
|
2000-08-26 04:33:00 +00:00
|
|
|
return MMSYSERR_INVALFLAG;
|
2000-09-09 20:32:10 +00:00
|
|
|
|
|
|
|
switch (fdwDetails) {
|
|
|
|
case ACM_FILTERTAGDETAILSF_FILTERTAG:
|
|
|
|
if (had == (HACMDRIVER)NULL) {
|
|
|
|
mmr = ACMERR_NOTPOSSIBLE;
|
|
|
|
for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) {
|
|
|
|
/* should check for codec only */
|
|
|
|
if (padid->bEnabled && acmDriverOpen(&had, (HACMDRIVERID)padid, 0) == 0) {
|
|
|
|
mmr = MSACM_Message(had, ACMDM_FILTERTAG_DETAILS,
|
|
|
|
(LPARAM)paftd, (LPARAM)fdwDetails);
|
|
|
|
acmDriverClose(had, 0);
|
|
|
|
if (mmr == MMSYSERR_NOERROR) break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
mmr = MSACM_Message(had, ACMDM_FILTERTAG_DETAILS,
|
|
|
|
(LPARAM)paftd, (LPARAM)fdwDetails);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ACM_FILTERTAGDETAILSF_INDEX:
|
|
|
|
/* FIXME should check paftd->dwFilterTagIndex < add.cFilterTags */
|
|
|
|
mmr = MSACM_Message(had, ACMDM_FILTERTAG_DETAILS,
|
|
|
|
(LPARAM)paftd, (LPARAM)fdwDetails);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ACM_FILTERTAGDETAILSF_LARGESTSIZE:
|
|
|
|
if (had == (HACMDRIVER)NULL) {
|
|
|
|
ACMFILTERTAGDETAILSW tmp;
|
|
|
|
DWORD ft = paftd->dwFilterTag;
|
|
|
|
|
|
|
|
mmr = ACMERR_NOTPOSSIBLE;
|
|
|
|
for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) {
|
|
|
|
/* should check for codec only */
|
|
|
|
if (padid->bEnabled &&
|
|
|
|
acmDriverOpen(&had, (HACMDRIVERID)padid, 0) == 0) {
|
|
|
|
|
|
|
|
memset(&tmp, 0, sizeof(tmp));
|
|
|
|
tmp.cbStruct = sizeof(tmp);
|
|
|
|
tmp.dwFilterTag = ft;
|
|
|
|
|
|
|
|
if (MSACM_Message(had, ACMDM_FILTERTAG_DETAILS,
|
|
|
|
(LPARAM)&tmp,
|
|
|
|
(LPARAM)fdwDetails) == MMSYSERR_NOERROR) {
|
|
|
|
if (mmr == ACMERR_NOTPOSSIBLE ||
|
|
|
|
paftd->cbFilterSize < tmp.cbFilterSize) {
|
|
|
|
*paftd = tmp;
|
|
|
|
mmr = MMSYSERR_NOERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
acmDriverClose(had, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
mmr = MSACM_Message(had, ACMDM_FILTERTAG_DETAILS,
|
|
|
|
(LPARAM)paftd, (LPARAM)fdwDetails);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
WARN("Unsupported fdwDetails=%08lx\n", fdwDetails);
|
|
|
|
mmr = MMSYSERR_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mmr == MMSYSERR_NOERROR &&
|
|
|
|
paftd->dwFilterTag == WAVE_FORMAT_PCM && paftd->szFilterTag[0] == 0)
|
2000-11-28 22:40:56 +00:00
|
|
|
MultiByteToWideChar( CP_ACP, 0, "PCM", -1, paftd->szFilterTag,
|
|
|
|
sizeof(paftd->szFilterTag)/sizeof(WCHAR) );
|
2000-09-09 20:32:10 +00:00
|
|
|
|
|
|
|
return mmr;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct MSACM_FilterTagEnumWtoA_Instance {
|
|
|
|
PACMFILTERTAGDETAILSA paftda;
|
|
|
|
DWORD dwInstance;
|
|
|
|
ACMFILTERTAGENUMCBA fnCallback;
|
|
|
|
};
|
|
|
|
|
|
|
|
static BOOL CALLBACK MSACM_FilterTagEnumCallbackWtoA(HACMDRIVERID hadid,
|
|
|
|
PACMFILTERTAGDETAILSW paftdw,
|
|
|
|
DWORD dwInstance,
|
|
|
|
DWORD fdwSupport)
|
|
|
|
{
|
|
|
|
struct MSACM_FilterTagEnumWtoA_Instance* paftei;
|
|
|
|
|
|
|
|
paftei = (struct MSACM_FilterTagEnumWtoA_Instance*)dwInstance;
|
|
|
|
|
|
|
|
paftei->paftda->dwFilterTagIndex = paftdw->dwFilterTagIndex;
|
|
|
|
paftei->paftda->dwFilterTag = paftdw->dwFilterTag;
|
|
|
|
paftei->paftda->cbFilterSize = paftdw->cbFilterSize;
|
|
|
|
paftei->paftda->fdwSupport = paftdw->fdwSupport;
|
|
|
|
paftei->paftda->cStandardFilters = paftdw->cStandardFilters;
|
2000-11-28 22:40:56 +00:00
|
|
|
WideCharToMultiByte( CP_ACP, 0, paftdw->szFilterTag, -1, paftei->paftda->szFilterTag,
|
|
|
|
sizeof(paftei->paftda->szFilterTag), NULL, NULL );
|
2000-09-09 20:32:10 +00:00
|
|
|
|
|
|
|
return (paftei->fnCallback)(hadid, paftei->paftda,
|
|
|
|
paftei->dwInstance, fdwSupport);
|
1998-10-11 17:00:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* acmFilterTagEnumA (MSACM32.21)
|
|
|
|
*/
|
2000-09-09 20:32:10 +00:00
|
|
|
MMRESULT WINAPI acmFilterTagEnumA(HACMDRIVER had, PACMFILTERTAGDETAILSA paftda,
|
2000-08-26 04:33:00 +00:00
|
|
|
ACMFILTERTAGENUMCBA fnCallback, DWORD dwInstance,
|
|
|
|
DWORD fdwEnum)
|
1998-10-11 17:00:29 +00:00
|
|
|
{
|
2000-09-09 20:32:10 +00:00
|
|
|
ACMFILTERTAGDETAILSW aftdw;
|
|
|
|
struct MSACM_FilterTagEnumWtoA_Instance aftei;
|
|
|
|
|
|
|
|
memset(&aftdw, 0, sizeof(aftdw));
|
|
|
|
aftdw.cbStruct = sizeof(aftdw);
|
|
|
|
aftdw.dwFilterTagIndex = paftda->dwFilterTagIndex;
|
|
|
|
aftdw.dwFilterTag = paftda->dwFilterTag;
|
|
|
|
|
|
|
|
aftei.paftda = paftda;
|
|
|
|
aftei.dwInstance = dwInstance;
|
|
|
|
aftei.fnCallback = fnCallback;
|
|
|
|
|
|
|
|
return acmFilterTagEnumW(had, &aftdw, MSACM_FilterTagEnumCallbackWtoA,
|
|
|
|
(DWORD)&aftei, fdwEnum);
|
1998-10-11 17:00:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* acmFilterTagEnumW (MSACM32.22)
|
|
|
|
*/
|
2000-08-26 04:33:00 +00:00
|
|
|
MMRESULT WINAPI acmFilterTagEnumW(HACMDRIVER had, PACMFILTERTAGDETAILSW paftd,
|
|
|
|
ACMFILTERTAGENUMCBW fnCallback, DWORD dwInstance,
|
|
|
|
DWORD fdwEnum)
|
1998-10-11 17:00:29 +00:00
|
|
|
{
|
2000-09-09 20:32:10 +00:00
|
|
|
PWINE_ACMDRIVERID padid;
|
|
|
|
ACMDRIVERDETAILSW add;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
TRACE("(0x%08x, %p, %p, %ld, %ld)\n",
|
|
|
|
had, paftd, fnCallback, dwInstance, fdwEnum);
|
|
|
|
|
|
|
|
if (paftd->cbStruct < sizeof(*paftd)) return MMSYSERR_INVALPARAM;
|
|
|
|
|
|
|
|
if (had) FIXME("had != NULL, not supported\n");
|
|
|
|
|
|
|
|
for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) {
|
|
|
|
/* should check for codec only */
|
|
|
|
if (padid->bEnabled && acmDriverOpen(&had, (HACMDRIVERID)padid, 0) == MMSYSERR_NOERROR) {
|
|
|
|
add.cbStruct = sizeof(add);
|
|
|
|
|
|
|
|
if (acmDriverDetailsW((HACMDRIVERID)padid, &add, 0) == MMSYSERR_NOERROR) {
|
|
|
|
for (i = 0; i < add.cFilterTags; i++) {
|
|
|
|
paftd->dwFilterTagIndex = i;
|
|
|
|
if (acmFilterTagDetailsW(had, paftd, ACM_FILTERTAGDETAILSF_INDEX) == MMSYSERR_NOERROR) {
|
|
|
|
if (!(fnCallback)((HACMDRIVERID)padid, paftd, dwInstance,
|
|
|
|
add.fdwSupport)) {
|
|
|
|
padid = NULL;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
acmDriverClose(had, 0);
|
|
|
|
}
|
|
|
|
return MMSYSERR_NOERROR;
|
1998-10-11 17:00:29 +00:00
|
|
|
}
|