2000-08-26 06:33:00 +02:00
|
|
|
/* -*- tab-width: 8; c-basic-offset: 4 -*- */
|
|
|
|
|
1998-10-11 19:00:29 +02:00
|
|
|
/*
|
|
|
|
* MSACM32 library
|
|
|
|
*
|
|
|
|
* Copyright 1998 Patrik Stridvall
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
1998-10-11 19:00:29 +02:00
|
|
|
*/
|
|
|
|
|
2003-09-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
2001-01-26 21:43:40 +01:00
|
|
|
#include <string.h>
|
2003-09-06 01:08:26 +02:00
|
|
|
#include "windef.h"
|
1999-02-17 14:51:06 +01:00
|
|
|
#include "winbase.h"
|
2000-11-28 23:40:56 +01:00
|
|
|
#include "winnls.h"
|
1998-10-11 19:00:29 +02:00
|
|
|
#include "winerror.h"
|
|
|
|
#include "mmsystem.h"
|
2004-08-11 21:35:34 +02:00
|
|
|
#define NOBITMAP
|
2003-09-06 01:08:26 +02:00
|
|
|
#include "mmreg.h"
|
1998-10-11 19:00:29 +02:00
|
|
|
#include "msacm.h"
|
|
|
|
#include "msacmdrv.h"
|
2000-08-26 06:33:00 +02:00
|
|
|
#include "wineacm.h"
|
2002-03-10 00:29:33 +01:00
|
|
|
#include "wine/debug.h"
|
1998-10-11 19:00:29 +02:00
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(msacm);
|
1999-04-19 16:56:29 +02:00
|
|
|
|
1998-10-11 19:00:29 +02:00
|
|
|
/***********************************************************************
|
2001-06-11 22:14:43 +02:00
|
|
|
* acmFilterChooseA (MSACM32.@)
|
1998-10-11 19:00:29 +02:00
|
|
|
*/
|
2000-08-26 06:33:00 +02:00
|
|
|
MMRESULT WINAPI acmFilterChooseA(PACMFILTERCHOOSEA pafltrc)
|
1998-10-11 19:00:29 +02:00
|
|
|
{
|
2000-08-26 06:33:00 +02:00
|
|
|
FIXME("(%p): stub\n", pafltrc);
|
|
|
|
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
|
|
|
return MMSYSERR_ERROR;
|
1998-10-11 19:00:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-06-11 22:14:43 +02:00
|
|
|
* acmFilterChooseW (MSACM32.@)
|
1998-10-11 19:00:29 +02:00
|
|
|
*/
|
2000-08-26 06:33:00 +02:00
|
|
|
MMRESULT WINAPI acmFilterChooseW(PACMFILTERCHOOSEW pafltrc)
|
1998-10-11 19:00:29 +02:00
|
|
|
{
|
2000-08-26 06:33:00 +02:00
|
|
|
FIXME("(%p): stub\n", pafltrc);
|
|
|
|
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
|
|
|
return MMSYSERR_ERROR;
|
1998-10-11 19:00:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-06-11 22:14:43 +02:00
|
|
|
* acmFilterDetailsA (MSACM32.@)
|
1998-10-11 19:00:29 +02:00
|
|
|
*/
|
2002-06-01 01:06:46 +02:00
|
|
|
MMRESULT WINAPI acmFilterDetailsA(HACMDRIVER had, PACMFILTERDETAILSA pafd,
|
2000-08-26 06:33:00 +02:00
|
|
|
DWORD fdwDetails)
|
1998-10-11 19:00:29 +02:00
|
|
|
{
|
2000-08-26 06:33:00 +02:00
|
|
|
ACMFILTERDETAILSW afdw;
|
|
|
|
MMRESULT mmr;
|
|
|
|
|
|
|
|
memset(&afdw, 0, sizeof(afdw));
|
|
|
|
afdw.cbStruct = sizeof(afdw);
|
|
|
|
afdw.dwFilterIndex = pafd->dwFilterIndex;
|
2002-06-01 01:06:46 +02:00
|
|
|
afdw.dwFilterTag = pafd->dwFilterTag;
|
2000-08-26 06:33:00 +02:00
|
|
|
afdw.pwfltr = pafd->pwfltr;
|
|
|
|
afdw.cbwfltr = pafd->cbwfltr;
|
|
|
|
|
|
|
|
mmr = acmFilterDetailsW(had, &afdw, fdwDetails);
|
|
|
|
if (mmr == MMSYSERR_NOERROR) {
|
2002-06-01 01:06:46 +02:00
|
|
|
pafd->dwFilterTag = afdw.dwFilterTag;
|
|
|
|
pafd->fdwSupport = afdw.fdwSupport;
|
2000-11-28 23:40:56 +01:00
|
|
|
WideCharToMultiByte( CP_ACP, 0, afdw.szFilter, -1, pafd->szFilter,
|
|
|
|
sizeof(pafd->szFilter), NULL, NULL );
|
2000-08-26 06:33:00 +02:00
|
|
|
}
|
|
|
|
return mmr;
|
1998-10-11 19:00:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-06-11 22:14:43 +02:00
|
|
|
* acmFilterDetailsW (MSACM32.@)
|
1998-10-11 19:00:29 +02:00
|
|
|
*/
|
2002-06-01 01:06:46 +02:00
|
|
|
MMRESULT WINAPI acmFilterDetailsW(HACMDRIVER had, PACMFILTERDETAILSW pafd,
|
2000-08-26 06:33:00 +02:00
|
|
|
DWORD fdwDetails)
|
1998-10-11 19:00:29 +02:00
|
|
|
{
|
2000-09-09 22:32:10 +02:00
|
|
|
MMRESULT mmr;
|
|
|
|
ACMFILTERTAGDETAILSA aftd;
|
|
|
|
|
2006-10-12 21:35:06 +02:00
|
|
|
TRACE("(%p, %p, %d)\n", had, pafd, fdwDetails);
|
2000-08-26 06:33:00 +02:00
|
|
|
|
2000-09-09 22:32:10 +02:00
|
|
|
memset(&aftd, 0, sizeof(aftd));
|
|
|
|
aftd.cbStruct = sizeof(aftd);
|
|
|
|
|
|
|
|
if (pafd->cbStruct < sizeof(*pafd)) return MMSYSERR_INVALPARAM;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2000-09-09 22:32:10 +02:00
|
|
|
switch (fdwDetails) {
|
|
|
|
case ACM_FILTERDETAILSF_FILTER:
|
|
|
|
if (pafd->dwFilterTag != pafd->pwfltr->dwFilterTag) {
|
|
|
|
mmr = MMSYSERR_INVALPARAM;
|
|
|
|
break;
|
|
|
|
}
|
2002-12-02 19:10:57 +01:00
|
|
|
if (had == NULL) {
|
2000-09-09 22:32:10 +02:00
|
|
|
PWINE_ACMDRIVERID padid;
|
|
|
|
|
|
|
|
mmr = ACMERR_NOTPOSSIBLE;
|
|
|
|
for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) {
|
|
|
|
/* should check for codec only */
|
2001-05-22 21:21:16 +02:00
|
|
|
if (!(padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) &&
|
2000-09-09 22:32:10 +02:00
|
|
|
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;
|
|
|
|
}
|
2002-06-01 01:06:46 +02:00
|
|
|
}
|
2000-09-09 22:32:10 +02:00
|
|
|
} else {
|
2001-04-23 20:14:41 +02:00
|
|
|
mmr = MSACM_Message(had, ACMDM_FILTER_DETAILS, (LPARAM)pafd, fdwDetails);
|
2000-09-09 22:32:10 +02:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ACM_FILTERDETAILSF_INDEX:
|
|
|
|
/* should check pafd->dwFilterIndex < aftd->cStandardFilters */
|
2001-04-23 20:14:41 +02:00
|
|
|
mmr = MSACM_Message(had, ACMDM_FILTER_DETAILS, (LPARAM)pafd, fdwDetails);
|
2000-09-09 22:32:10 +02:00
|
|
|
break;
|
|
|
|
default:
|
2006-10-12 21:35:06 +02:00
|
|
|
WARN("Unknown fdwDetails %08x\n", fdwDetails);
|
2000-09-09 22:32:10 +02:00
|
|
|
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,
|
2002-06-01 01:06:46 +02:00
|
|
|
PACMFILTERDETAILSW pafdw,
|
|
|
|
DWORD dwInstance,
|
2000-09-09 22:32:10 +02:00
|
|
|
DWORD fdwSupport)
|
|
|
|
{
|
|
|
|
struct MSACM_FilterEnumWtoA_Instance* pafei;
|
|
|
|
|
|
|
|
pafei = (struct MSACM_FilterEnumWtoA_Instance*)dwInstance;
|
|
|
|
|
2002-06-01 01:06:46 +02:00
|
|
|
pafei->pafda->dwFilterIndex = pafdw->dwFilterIndex;
|
|
|
|
pafei->pafda->dwFilterTag = pafdw->dwFilterTag;
|
|
|
|
pafei->pafda->fdwSupport = pafdw->fdwSupport;
|
2000-11-28 23:40:56 +01:00
|
|
|
WideCharToMultiByte( CP_ACP, 0, pafdw->szFilter, -1, pafei->pafda->szFilter,
|
|
|
|
sizeof(pafei->pafda->szFilter), NULL, NULL );
|
2000-09-09 22:32:10 +02:00
|
|
|
|
2002-06-01 01:06:46 +02:00
|
|
|
return (pafei->fnCallback)(hadid, pafei->pafda,
|
2000-09-09 22:32:10 +02:00
|
|
|
pafei->dwInstance, fdwSupport);
|
1998-10-11 19:00:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-06-11 22:14:43 +02:00
|
|
|
* acmFilterEnumA (MSACM32.@)
|
1998-10-11 19:00:29 +02:00
|
|
|
*/
|
2002-06-01 01:06:46 +02:00
|
|
|
MMRESULT WINAPI acmFilterEnumA(HACMDRIVER had, PACMFILTERDETAILSA pafda,
|
|
|
|
ACMFILTERENUMCBA fnCallback, DWORD dwInstance,
|
2000-08-26 06:33:00 +02:00
|
|
|
DWORD fdwEnum)
|
1998-10-11 19:00:29 +02:00
|
|
|
{
|
2000-09-09 22:32:10 +02: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;
|
|
|
|
|
2002-06-01 01:06:46 +02:00
|
|
|
return acmFilterEnumW(had, &afdw, MSACM_FilterEnumCallbackWtoA,
|
2000-09-09 22:32:10 +02:00
|
|
|
(DWORD)&afei, fdwEnum);
|
|
|
|
}
|
|
|
|
|
2002-06-01 01:06:46 +02:00
|
|
|
static BOOL MSACM_FilterEnumHelper(PWINE_ACMDRIVERID padid, HACMDRIVER had,
|
|
|
|
PACMFILTERDETAILSW pafd,
|
|
|
|
ACMFILTERENUMCBW fnCallback, DWORD dwInstance,
|
2000-09-09 22:32:10 +02:00
|
|
|
DWORD fdwEnum)
|
|
|
|
{
|
|
|
|
ACMFILTERTAGDETAILSW aftd;
|
2004-09-08 03:23:57 +02:00
|
|
|
unsigned int i, j;
|
2000-09-09 22:32:10 +02:00
|
|
|
|
2001-04-23 20:14:41 +02:00
|
|
|
for (i = 0; i < padid->cFilterTags; i++) {
|
2000-09-09 22:32:10 +02:00
|
|
|
memset(&aftd, 0, sizeof(aftd));
|
|
|
|
aftd.cbStruct = sizeof(aftd);
|
|
|
|
aftd.dwFilterTagIndex = i;
|
|
|
|
if (acmFilterTagDetailsW(had, &aftd, ACM_FILTERTAGDETAILSF_INDEX) != MMSYSERR_NOERROR)
|
|
|
|
continue;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
|
|
|
if ((fdwEnum & ACM_FILTERENUMF_DWFILTERTAG) &&
|
2000-09-09 22:32:10 +02:00
|
|
|
aftd.dwFilterTag != pafd->pwfltr->dwFilterTag)
|
|
|
|
continue;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2000-09-09 22:32:10 +02:00
|
|
|
for (j = 0; j < aftd.cStandardFilters; j++) {
|
|
|
|
pafd->dwFilterIndex = j;
|
|
|
|
pafd->dwFilterTag = aftd.dwFilterTag;
|
2002-06-01 01:06:46 +02:00
|
|
|
if (acmFilterDetailsW(had, pafd, ACM_FILTERDETAILSF_INDEX) != MMSYSERR_NOERROR)
|
2000-09-09 22:32:10 +02:00
|
|
|
continue;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-04-23 20:14:41 +02:00
|
|
|
if (!(fnCallback)((HACMDRIVERID)padid, pafd, dwInstance, padid->fdwSupport))
|
2002-06-01 01:06:46 +02:00
|
|
|
return FALSE;
|
2000-09-09 22:32:10 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return TRUE;
|
1998-10-11 19:00:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-06-11 22:14:43 +02:00
|
|
|
* acmFilterEnumW (MSACM32.@)
|
1998-10-11 19:00:29 +02:00
|
|
|
*/
|
2002-06-01 01:06:46 +02:00
|
|
|
MMRESULT WINAPI acmFilterEnumW(HACMDRIVER had, PACMFILTERDETAILSW pafd,
|
|
|
|
ACMFILTERENUMCBW fnCallback, DWORD dwInstance,
|
2000-08-26 06:33:00 +02:00
|
|
|
DWORD fdwEnum)
|
1998-10-11 19:00:29 +02:00
|
|
|
{
|
2000-09-09 22:32:10 +02:00
|
|
|
PWINE_ACMDRIVERID padid;
|
|
|
|
BOOL ret;
|
|
|
|
|
2006-10-12 21:35:06 +02:00
|
|
|
TRACE("(%p, %p, %p, %d, %d)\n",
|
2000-08-26 06:33:00 +02:00
|
|
|
had, pafd, fnCallback, dwInstance, fdwEnum);
|
2000-09-09 22:32:10 +02:00
|
|
|
|
|
|
|
if (pafd->cbStruct < sizeof(*pafd)) return MMSYSERR_INVALPARAM;
|
|
|
|
|
|
|
|
if (fdwEnum & ~(ACM_FILTERENUMF_DWFILTERTAG))
|
|
|
|
FIXME("Unsupported fdwEnum values\n");
|
|
|
|
|
|
|
|
if (had) {
|
|
|
|
HACMDRIVERID hadid;
|
|
|
|
|
2002-03-26 20:48:42 +01:00
|
|
|
if (acmDriverID((HACMOBJ)had, &hadid, 0) != MMSYSERR_NOERROR)
|
2000-09-09 22:32:10 +02:00
|
|
|
return MMSYSERR_INVALHANDLE;
|
2001-02-12 02:28:12 +01:00
|
|
|
MSACM_FilterEnumHelper(MSACM_GetDriverID(hadid), had, pafd,
|
|
|
|
fnCallback, dwInstance, fdwEnum);
|
|
|
|
return MMSYSERR_NOERROR;
|
2000-09-09 22:32:10 +02:00
|
|
|
}
|
|
|
|
for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) {
|
|
|
|
/* should check for codec only */
|
2002-06-01 01:06:46 +02:00
|
|
|
if ((padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) ||
|
2001-05-22 21:21:16 +02:00
|
|
|
acmDriverOpen(&had, (HACMDRIVERID)padid, 0) != MMSYSERR_NOERROR)
|
2000-09-09 22:32:10 +02:00
|
|
|
continue;
|
2002-06-01 01:06:46 +02:00
|
|
|
ret = MSACM_FilterEnumHelper(padid, had, pafd,
|
2000-09-09 22:32:10 +02:00
|
|
|
fnCallback, dwInstance, fdwEnum);
|
|
|
|
acmDriverClose(had, 0);
|
|
|
|
if (!ret) break;
|
|
|
|
}
|
|
|
|
return MMSYSERR_NOERROR;
|
1998-10-11 19:00:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-06-11 22:14:43 +02:00
|
|
|
* acmFilterTagDetailsA (MSACM32.@)
|
1998-10-11 19:00:29 +02:00
|
|
|
*/
|
2002-06-01 01:06:46 +02:00
|
|
|
MMRESULT WINAPI acmFilterTagDetailsA(HACMDRIVER had, PACMFILTERTAGDETAILSA paftda,
|
2000-08-26 06:33:00 +02:00
|
|
|
DWORD fdwDetails)
|
1998-10-11 19:00:29 +02:00
|
|
|
{
|
2000-08-26 06:33:00 +02: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) {
|
2002-06-01 01:06:46 +02:00
|
|
|
paftda->dwFilterTag = aftdw.dwFilterTag;
|
2000-08-26 06:33:00 +02:00
|
|
|
paftda->dwFilterTagIndex = aftdw.dwFilterTagIndex;
|
2002-06-01 01:06:46 +02:00
|
|
|
paftda->cbFilterSize = aftdw.cbFilterSize;
|
|
|
|
paftda->fdwSupport = aftdw.fdwSupport;
|
|
|
|
paftda->cStandardFilters = aftdw.cStandardFilters;
|
2000-11-28 23:40:56 +01:00
|
|
|
WideCharToMultiByte( CP_ACP, 0, aftdw.szFilterTag, -1, paftda->szFilterTag,
|
|
|
|
sizeof(paftda->szFilterTag), NULL, NULL );
|
2000-08-26 06:33:00 +02:00
|
|
|
}
|
|
|
|
return mmr;
|
1998-10-11 19:00:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-06-11 22:14:43 +02:00
|
|
|
* acmFilterTagDetailsW (MSACM32.@)
|
1998-10-11 19:00:29 +02:00
|
|
|
*/
|
2002-06-01 01:06:46 +02:00
|
|
|
MMRESULT WINAPI acmFilterTagDetailsW(HACMDRIVER had, PACMFILTERTAGDETAILSW paftd,
|
2000-08-26 06:33:00 +02:00
|
|
|
DWORD fdwDetails)
|
1998-10-11 19:00:29 +02:00
|
|
|
{
|
2000-09-09 22:32:10 +02:00
|
|
|
PWINE_ACMDRIVERID padid;
|
|
|
|
MMRESULT mmr;
|
|
|
|
|
2006-10-12 21:35:06 +02:00
|
|
|
TRACE("(%p, %p, %d)\n", had, paftd, fdwDetails);
|
2000-08-26 06:33:00 +02:00
|
|
|
|
2000-09-09 22:32:10 +02:00
|
|
|
if (fdwDetails & ~(ACM_FILTERTAGDETAILSF_FILTERTAG|ACM_FILTERTAGDETAILSF_INDEX|
|
|
|
|
ACM_FILTERTAGDETAILSF_LARGESTSIZE))
|
2000-08-26 06:33:00 +02:00
|
|
|
return MMSYSERR_INVALFLAG;
|
2000-09-09 22:32:10 +02:00
|
|
|
|
|
|
|
switch (fdwDetails) {
|
|
|
|
case ACM_FILTERTAGDETAILSF_FILTERTAG:
|
2002-12-02 19:10:57 +01:00
|
|
|
if (had == NULL) {
|
2000-09-09 22:32:10 +02:00
|
|
|
mmr = ACMERR_NOTPOSSIBLE;
|
|
|
|
for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) {
|
|
|
|
/* should check for codec only */
|
2001-05-22 21:21:16 +02:00
|
|
|
if (!(padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) &&
|
|
|
|
acmDriverOpen(&had, (HACMDRIVERID)padid, 0) == 0) {
|
2001-04-23 20:14:41 +02:00
|
|
|
mmr = MSACM_Message(had, ACMDM_FILTERTAG_DETAILS, (LPARAM)paftd, fdwDetails);
|
2000-09-09 22:32:10 +02:00
|
|
|
acmDriverClose(had, 0);
|
|
|
|
if (mmr == MMSYSERR_NOERROR) break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
2001-04-23 20:14:41 +02:00
|
|
|
mmr = MSACM_Message(had, ACMDM_FILTERTAG_DETAILS, (LPARAM)paftd, fdwDetails);
|
2000-09-09 22:32:10 +02:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ACM_FILTERTAGDETAILSF_INDEX:
|
|
|
|
/* FIXME should check paftd->dwFilterTagIndex < add.cFilterTags */
|
2001-04-23 20:14:41 +02:00
|
|
|
mmr = MSACM_Message(had, ACMDM_FILTERTAG_DETAILS, (LPARAM)paftd, fdwDetails);
|
2000-09-09 22:32:10 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ACM_FILTERTAGDETAILSF_LARGESTSIZE:
|
2002-12-02 19:10:57 +01:00
|
|
|
if (had == NULL) {
|
2000-09-09 22:32:10 +02:00
|
|
|
ACMFILTERTAGDETAILSW tmp;
|
|
|
|
DWORD ft = paftd->dwFilterTag;
|
|
|
|
|
|
|
|
mmr = ACMERR_NOTPOSSIBLE;
|
|
|
|
for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) {
|
|
|
|
/* should check for codec only */
|
2002-06-01 01:06:46 +02:00
|
|
|
if (!(padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) &&
|
2000-09-09 22:32:10 +02:00
|
|
|
acmDriverOpen(&had, (HACMDRIVERID)padid, 0) == 0) {
|
|
|
|
|
|
|
|
memset(&tmp, 0, sizeof(tmp));
|
|
|
|
tmp.cbStruct = sizeof(tmp);
|
|
|
|
tmp.dwFilterTag = ft;
|
|
|
|
|
2002-06-01 01:06:46 +02:00
|
|
|
if (MSACM_Message(had, ACMDM_FILTERTAG_DETAILS,
|
2001-04-23 20:14:41 +02:00
|
|
|
(LPARAM)&tmp, fdwDetails) == MMSYSERR_NOERROR) {
|
2000-09-09 22:32:10 +02:00
|
|
|
if (mmr == ACMERR_NOTPOSSIBLE ||
|
|
|
|
paftd->cbFilterSize < tmp.cbFilterSize) {
|
|
|
|
*paftd = tmp;
|
|
|
|
mmr = MMSYSERR_NOERROR;
|
2002-06-01 01:06:46 +02:00
|
|
|
}
|
2000-09-09 22:32:10 +02:00
|
|
|
}
|
|
|
|
acmDriverClose(had, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
2001-04-23 20:14:41 +02:00
|
|
|
mmr = MSACM_Message(had, ACMDM_FILTERTAG_DETAILS, (LPARAM)paftd, fdwDetails);
|
2000-09-09 22:32:10 +02:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2006-10-12 21:35:06 +02:00
|
|
|
WARN("Unsupported fdwDetails=%08x\n", fdwDetails);
|
2000-09-09 22:32:10 +02:00
|
|
|
mmr = MMSYSERR_ERROR;
|
|
|
|
}
|
|
|
|
|
2002-06-01 01:06:46 +02:00
|
|
|
if (mmr == MMSYSERR_NOERROR &&
|
2000-09-09 22:32:10 +02:00
|
|
|
paftd->dwFilterTag == WAVE_FORMAT_PCM && paftd->szFilterTag[0] == 0)
|
2000-11-28 23:40:56 +01:00
|
|
|
MultiByteToWideChar( CP_ACP, 0, "PCM", -1, paftd->szFilterTag,
|
|
|
|
sizeof(paftd->szFilterTag)/sizeof(WCHAR) );
|
2000-09-09 22:32:10 +02:00
|
|
|
|
|
|
|
return mmr;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct MSACM_FilterTagEnumWtoA_Instance {
|
|
|
|
PACMFILTERTAGDETAILSA paftda;
|
|
|
|
DWORD dwInstance;
|
|
|
|
ACMFILTERTAGENUMCBA fnCallback;
|
|
|
|
};
|
|
|
|
|
|
|
|
static BOOL CALLBACK MSACM_FilterTagEnumCallbackWtoA(HACMDRIVERID hadid,
|
2002-06-01 01:06:46 +02:00
|
|
|
PACMFILTERTAGDETAILSW paftdw,
|
|
|
|
DWORD dwInstance,
|
2000-09-09 22:32:10 +02:00
|
|
|
DWORD fdwSupport)
|
|
|
|
{
|
|
|
|
struct MSACM_FilterTagEnumWtoA_Instance* paftei;
|
|
|
|
|
|
|
|
paftei = (struct MSACM_FilterTagEnumWtoA_Instance*)dwInstance;
|
|
|
|
|
2002-06-01 01:06:46 +02:00
|
|
|
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 23:40:56 +01:00
|
|
|
WideCharToMultiByte( CP_ACP, 0, paftdw->szFilterTag, -1, paftei->paftda->szFilterTag,
|
|
|
|
sizeof(paftei->paftda->szFilterTag), NULL, NULL );
|
2000-09-09 22:32:10 +02:00
|
|
|
|
2002-06-01 01:06:46 +02:00
|
|
|
return (paftei->fnCallback)(hadid, paftei->paftda,
|
2000-09-09 22:32:10 +02:00
|
|
|
paftei->dwInstance, fdwSupport);
|
1998-10-11 19:00:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-06-11 22:14:43 +02:00
|
|
|
* acmFilterTagEnumA (MSACM32.@)
|
1998-10-11 19:00:29 +02:00
|
|
|
*/
|
2000-09-09 22:32:10 +02:00
|
|
|
MMRESULT WINAPI acmFilterTagEnumA(HACMDRIVER had, PACMFILTERTAGDETAILSA paftda,
|
2002-06-01 01:06:46 +02:00
|
|
|
ACMFILTERTAGENUMCBA fnCallback, DWORD dwInstance,
|
2000-08-26 06:33:00 +02:00
|
|
|
DWORD fdwEnum)
|
1998-10-11 19:00:29 +02:00
|
|
|
{
|
2000-09-09 22:32:10 +02: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;
|
|
|
|
|
2002-06-01 01:06:46 +02:00
|
|
|
return acmFilterTagEnumW(had, &aftdw, MSACM_FilterTagEnumCallbackWtoA,
|
2000-09-09 22:32:10 +02:00
|
|
|
(DWORD)&aftei, fdwEnum);
|
1998-10-11 19:00:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-06-11 22:14:43 +02:00
|
|
|
* acmFilterTagEnumW (MSACM32.@)
|
1998-10-11 19:00:29 +02:00
|
|
|
*/
|
2000-08-26 06:33:00 +02:00
|
|
|
MMRESULT WINAPI acmFilterTagEnumW(HACMDRIVER had, PACMFILTERTAGDETAILSW paftd,
|
2002-06-01 01:06:46 +02:00
|
|
|
ACMFILTERTAGENUMCBW fnCallback, DWORD dwInstance,
|
2000-08-26 06:33:00 +02:00
|
|
|
DWORD fdwEnum)
|
1998-10-11 19:00:29 +02:00
|
|
|
{
|
2000-09-09 22:32:10 +02:00
|
|
|
PWINE_ACMDRIVERID padid;
|
2004-09-08 03:23:57 +02:00
|
|
|
unsigned int i;
|
2000-09-09 22:32:10 +02:00
|
|
|
|
2006-10-12 21:35:06 +02:00
|
|
|
TRACE("(%p, %p, %p, %d, %d)\n",
|
2002-06-01 01:06:46 +02:00
|
|
|
had, paftd, fnCallback, dwInstance, fdwEnum);
|
2000-09-09 22:32:10 +02:00
|
|
|
|
|
|
|
if (paftd->cbStruct < sizeof(*paftd)) return MMSYSERR_INVALPARAM;
|
|
|
|
|
|
|
|
if (had) FIXME("had != NULL, not supported\n");
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2000-09-09 22:32:10 +02:00
|
|
|
for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) {
|
|
|
|
/* should check for codec only */
|
2001-05-22 21:21:16 +02:00
|
|
|
if (!(padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) &&
|
|
|
|
acmDriverOpen(&had, (HACMDRIVERID)padid, 0) == MMSYSERR_NOERROR) {
|
2001-04-23 20:14:41 +02:00
|
|
|
|
|
|
|
for (i = 0; i < padid->cFilterTags; i++) {
|
|
|
|
paftd->dwFilterTagIndex = i;
|
|
|
|
if (acmFilterTagDetailsW(had, paftd, ACM_FILTERTAGDETAILSF_INDEX) == MMSYSERR_NOERROR) {
|
|
|
|
if (!(fnCallback)((HACMDRIVERID)padid, paftd, dwInstance, padid->fdwSupport)) {
|
|
|
|
padid = NULL;
|
|
|
|
break;
|
2000-09-09 22:32:10 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
acmDriverClose(had, 0);
|
|
|
|
}
|
|
|
|
return MMSYSERR_NOERROR;
|
1998-10-11 19:00:29 +02:00
|
|
|
}
|