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
|
2002-03-09 23:29:33 +00: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 12:49:52 +00:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
1998-10-11 17:00:29 +00:00
|
|
|
*/
|
|
|
|
|
2003-09-05 23:08:26 +00:00
|
|
|
#include <stdarg.h>
|
2001-01-26 20:43:40 +00:00
|
|
|
#include <string.h>
|
2003-09-05 23:08:26 +00:00
|
|
|
#include "windef.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"
|
2004-08-11 19:35:34 +00:00
|
|
|
#define NOBITMAP
|
2003-09-05 23:08:26 +00:00
|
|
|
#include "mmreg.h"
|
1998-10-11 17:00:29 +00:00
|
|
|
#include "msacm.h"
|
|
|
|
#include "msacmdrv.h"
|
2000-08-26 04:33:00 +00:00
|
|
|
#include "wineacm.h"
|
2002-03-09 23:29:33 +00:00
|
|
|
#include "wine/debug.h"
|
1998-10-11 17:00:29 +00:00
|
|
|
|
2002-03-09 23:29:33 +00:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(msacm);
|
1999-04-19 14:56:29 +00:00
|
|
|
|
1998-10-11 17:00:29 +00:00
|
|
|
/***********************************************************************
|
2001-06-11 20:14:43 +00:00
|
|
|
* acmFilterChooseA (MSACM32.@)
|
1998-10-11 17:00:29 +00:00
|
|
|
*/
|
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
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-06-11 20:14:43 +00:00
|
|
|
* acmFilterChooseW (MSACM32.@)
|
1998-10-11 17:00:29 +00:00
|
|
|
*/
|
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
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-06-11 20:14:43 +00:00
|
|
|
* acmFilterDetailsA (MSACM32.@)
|
1998-10-11 17:00:29 +00:00
|
|
|
*/
|
2002-05-31 23:06:46 +00:00
|
|
|
MMRESULT WINAPI acmFilterDetailsA(HACMDRIVER had, PACMFILTERDETAILSA pafd,
|
2000-08-26 04:33:00 +00:00
|
|
|
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;
|
2002-05-31 23:06:46 +00:00
|
|
|
afdw.dwFilterTag = pafd->dwFilterTag;
|
2000-08-26 04:33:00 +00:00
|
|
|
afdw.pwfltr = pafd->pwfltr;
|
|
|
|
afdw.cbwfltr = pafd->cbwfltr;
|
|
|
|
|
|
|
|
mmr = acmFilterDetailsW(had, &afdw, fdwDetails);
|
|
|
|
if (mmr == MMSYSERR_NOERROR) {
|
2002-05-31 23:06:46 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-06-11 20:14:43 +00:00
|
|
|
* acmFilterDetailsW (MSACM32.@)
|
1998-10-11 17:00:29 +00:00
|
|
|
*/
|
2002-05-31 23:06:46 +00:00
|
|
|
MMRESULT WINAPI acmFilterDetailsW(HACMDRIVER had, PACMFILTERDETAILSW pafd,
|
2000-08-26 04:33:00 +00:00
|
|
|
DWORD fdwDetails)
|
1998-10-11 17:00:29 +00:00
|
|
|
{
|
2000-09-09 20:32:10 +00:00
|
|
|
MMRESULT mmr;
|
|
|
|
ACMFILTERTAGDETAILSA aftd;
|
|
|
|
|
2006-10-12 19:35:06 +00:00
|
|
|
TRACE("(%p, %p, %d)\n", had, pafd, fdwDetails);
|
2000-08-26 04:33:00 +00:00
|
|
|
|
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;
|
2002-05-31 23:06:46 +00:00
|
|
|
|
2000-09-09 20:32:10 +00:00
|
|
|
switch (fdwDetails) {
|
|
|
|
case ACM_FILTERDETAILSF_FILTER:
|
|
|
|
if (pafd->dwFilterTag != pafd->pwfltr->dwFilterTag) {
|
|
|
|
mmr = MMSYSERR_INVALPARAM;
|
|
|
|
break;
|
|
|
|
}
|
2002-12-02 18:10:57 +00:00
|
|
|
if (had == NULL) {
|
2000-09-09 20:32:10 +00:00
|
|
|
PWINE_ACMDRIVERID padid;
|
|
|
|
|
|
|
|
mmr = ACMERR_NOTPOSSIBLE;
|
|
|
|
for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) {
|
|
|
|
/* should check for codec only */
|
2001-05-22 19:21:16 +00:00
|
|
|
if (!(padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) &&
|
2000-09-09 20:32:10 +00: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-05-31 23:06:46 +00:00
|
|
|
}
|
2000-09-09 20:32:10 +00:00
|
|
|
} else {
|
2001-04-23 18:14:41 +00:00
|
|
|
mmr = MSACM_Message(had, ACMDM_FILTER_DETAILS, (LPARAM)pafd, fdwDetails);
|
2000-09-09 20:32:10 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ACM_FILTERDETAILSF_INDEX:
|
|
|
|
/* should check pafd->dwFilterIndex < aftd->cStandardFilters */
|
2001-04-23 18:14:41 +00:00
|
|
|
mmr = MSACM_Message(had, ACMDM_FILTER_DETAILS, (LPARAM)pafd, fdwDetails);
|
2000-09-09 20:32:10 +00:00
|
|
|
break;
|
|
|
|
default:
|
2006-10-12 19:35:06 +00:00
|
|
|
WARN("Unknown fdwDetails %08x\n", fdwDetails);
|
2000-09-09 20:32:10 +00:00
|
|
|
mmr = MMSYSERR_INVALFLAG;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
TRACE("=> %d\n", mmr);
|
|
|
|
return mmr;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct MSACM_FilterEnumWtoA_Instance {
|
2009-02-17 21:36:06 +00:00
|
|
|
PACMFILTERDETAILSA pafda;
|
|
|
|
DWORD_PTR dwInstance;
|
|
|
|
ACMFILTERENUMCBA fnCallback;
|
2000-09-09 20:32:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static BOOL CALLBACK MSACM_FilterEnumCallbackWtoA(HACMDRIVERID hadid,
|
2002-05-31 23:06:46 +00:00
|
|
|
PACMFILTERDETAILSW pafdw,
|
2009-02-05 08:52:31 +00:00
|
|
|
DWORD_PTR dwInstance,
|
2000-09-09 20:32:10 +00:00
|
|
|
DWORD fdwSupport)
|
|
|
|
{
|
|
|
|
struct MSACM_FilterEnumWtoA_Instance* pafei;
|
|
|
|
|
|
|
|
pafei = (struct MSACM_FilterEnumWtoA_Instance*)dwInstance;
|
|
|
|
|
2002-05-31 23:06:46 +00:00
|
|
|
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
|
|
|
|
2002-05-31 23:06:46 +00:00
|
|
|
return (pafei->fnCallback)(hadid, pafei->pafda,
|
2000-09-09 20:32:10 +00:00
|
|
|
pafei->dwInstance, fdwSupport);
|
1998-10-11 17:00:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-06-11 20:14:43 +00:00
|
|
|
* acmFilterEnumA (MSACM32.@)
|
1998-10-11 17:00:29 +00:00
|
|
|
*/
|
2002-05-31 23:06:46 +00:00
|
|
|
MMRESULT WINAPI acmFilterEnumA(HACMDRIVER had, PACMFILTERDETAILSA pafda,
|
2009-02-05 08:52:31 +00:00
|
|
|
ACMFILTERENUMCBA fnCallback,
|
|
|
|
DWORD_PTR 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;
|
|
|
|
|
2002-05-31 23:06:46 +00:00
|
|
|
return acmFilterEnumW(had, &afdw, MSACM_FilterEnumCallbackWtoA,
|
2009-02-17 21:36:06 +00:00
|
|
|
(DWORD_PTR)&afei, fdwEnum);
|
2000-09-09 20:32:10 +00:00
|
|
|
}
|
|
|
|
|
2002-05-31 23:06:46 +00:00
|
|
|
static BOOL MSACM_FilterEnumHelper(PWINE_ACMDRIVERID padid, HACMDRIVER had,
|
|
|
|
PACMFILTERDETAILSW pafd,
|
2009-02-17 21:36:06 +00:00
|
|
|
ACMFILTERENUMCBW fnCallback,
|
|
|
|
DWORD_PTR dwInstance, DWORD fdwEnum)
|
2000-09-09 20:32:10 +00:00
|
|
|
{
|
|
|
|
ACMFILTERTAGDETAILSW aftd;
|
2004-09-08 01:23:57 +00:00
|
|
|
unsigned int i, j;
|
2000-09-09 20:32:10 +00:00
|
|
|
|
2001-04-23 18:14:41 +00:00
|
|
|
for (i = 0; i < padid->cFilterTags; i++) {
|
2000-09-09 20:32:10 +00:00
|
|
|
memset(&aftd, 0, sizeof(aftd));
|
|
|
|
aftd.cbStruct = sizeof(aftd);
|
|
|
|
aftd.dwFilterTagIndex = i;
|
|
|
|
if (acmFilterTagDetailsW(had, &aftd, ACM_FILTERTAGDETAILSF_INDEX) != MMSYSERR_NOERROR)
|
|
|
|
continue;
|
2002-05-31 23:06:46 +00:00
|
|
|
|
|
|
|
if ((fdwEnum & ACM_FILTERENUMF_DWFILTERTAG) &&
|
2000-09-09 20:32:10 +00:00
|
|
|
aftd.dwFilterTag != pafd->pwfltr->dwFilterTag)
|
|
|
|
continue;
|
2002-05-31 23:06:46 +00:00
|
|
|
|
2000-09-09 20:32:10 +00:00
|
|
|
for (j = 0; j < aftd.cStandardFilters; j++) {
|
|
|
|
pafd->dwFilterIndex = j;
|
|
|
|
pafd->dwFilterTag = aftd.dwFilterTag;
|
2002-05-31 23:06:46 +00:00
|
|
|
if (acmFilterDetailsW(had, pafd, ACM_FILTERDETAILSF_INDEX) != MMSYSERR_NOERROR)
|
2000-09-09 20:32:10 +00:00
|
|
|
continue;
|
2002-05-31 23:06:46 +00:00
|
|
|
|
2001-04-23 18:14:41 +00:00
|
|
|
if (!(fnCallback)((HACMDRIVERID)padid, pafd, dwInstance, padid->fdwSupport))
|
2002-05-31 23:06:46 +00:00
|
|
|
return FALSE;
|
2000-09-09 20:32:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return TRUE;
|
1998-10-11 17:00:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-06-11 20:14:43 +00:00
|
|
|
* acmFilterEnumW (MSACM32.@)
|
1998-10-11 17:00:29 +00:00
|
|
|
*/
|
2002-05-31 23:06:46 +00:00
|
|
|
MMRESULT WINAPI acmFilterEnumW(HACMDRIVER had, PACMFILTERDETAILSW pafd,
|
2009-02-05 08:52:31 +00:00
|
|
|
ACMFILTERENUMCBW fnCallback,
|
|
|
|
DWORD_PTR dwInstance, DWORD fdwEnum)
|
1998-10-11 17:00:29 +00:00
|
|
|
{
|
2000-09-09 20:32:10 +00:00
|
|
|
PWINE_ACMDRIVERID padid;
|
|
|
|
BOOL ret;
|
|
|
|
|
2009-02-05 08:52:31 +00:00
|
|
|
TRACE("(%p, %p, %p, %ld, %d)\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;
|
|
|
|
|
2002-03-26 19:48:42 +00:00
|
|
|
if (acmDriverID((HACMOBJ)had, &hadid, 0) != MMSYSERR_NOERROR)
|
2000-09-09 20:32:10 +00:00
|
|
|
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 */
|
2002-05-31 23:06:46 +00:00
|
|
|
if ((padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) ||
|
2001-05-22 19:21:16 +00:00
|
|
|
acmDriverOpen(&had, (HACMDRIVERID)padid, 0) != MMSYSERR_NOERROR)
|
2000-09-09 20:32:10 +00:00
|
|
|
continue;
|
2002-05-31 23:06:46 +00:00
|
|
|
ret = MSACM_FilterEnumHelper(padid, had, pafd,
|
2000-09-09 20:32:10 +00:00
|
|
|
fnCallback, dwInstance, fdwEnum);
|
|
|
|
acmDriverClose(had, 0);
|
|
|
|
if (!ret) break;
|
|
|
|
}
|
|
|
|
return MMSYSERR_NOERROR;
|
1998-10-11 17:00:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-06-11 20:14:43 +00:00
|
|
|
* acmFilterTagDetailsA (MSACM32.@)
|
1998-10-11 17:00:29 +00:00
|
|
|
*/
|
2002-05-31 23:06:46 +00:00
|
|
|
MMRESULT WINAPI acmFilterTagDetailsA(HACMDRIVER had, PACMFILTERTAGDETAILSA paftda,
|
2000-08-26 04:33:00 +00:00
|
|
|
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) {
|
2002-05-31 23:06:46 +00:00
|
|
|
paftda->dwFilterTag = aftdw.dwFilterTag;
|
2000-08-26 04:33:00 +00:00
|
|
|
paftda->dwFilterTagIndex = aftdw.dwFilterTagIndex;
|
2002-05-31 23:06:46 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-06-11 20:14:43 +00:00
|
|
|
* acmFilterTagDetailsW (MSACM32.@)
|
1998-10-11 17:00:29 +00:00
|
|
|
*/
|
2002-05-31 23:06:46 +00:00
|
|
|
MMRESULT WINAPI acmFilterTagDetailsW(HACMDRIVER had, PACMFILTERTAGDETAILSW paftd,
|
2000-08-26 04:33:00 +00:00
|
|
|
DWORD fdwDetails)
|
1998-10-11 17:00:29 +00:00
|
|
|
{
|
2000-09-09 20:32:10 +00:00
|
|
|
PWINE_ACMDRIVERID padid;
|
|
|
|
MMRESULT mmr;
|
|
|
|
|
2006-10-12 19:35:06 +00:00
|
|
|
TRACE("(%p, %p, %d)\n", had, paftd, fdwDetails);
|
2000-08-26 04:33:00 +00:00
|
|
|
|
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:
|
2002-12-02 18:10:57 +00:00
|
|
|
if (had == NULL) {
|
2000-09-09 20:32:10 +00:00
|
|
|
mmr = ACMERR_NOTPOSSIBLE;
|
|
|
|
for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) {
|
|
|
|
/* should check for codec only */
|
2001-05-22 19:21:16 +00:00
|
|
|
if (!(padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) &&
|
|
|
|
acmDriverOpen(&had, (HACMDRIVERID)padid, 0) == 0) {
|
2001-04-23 18:14:41 +00:00
|
|
|
mmr = MSACM_Message(had, ACMDM_FILTERTAG_DETAILS, (LPARAM)paftd, fdwDetails);
|
2000-09-09 20:32:10 +00:00
|
|
|
acmDriverClose(had, 0);
|
|
|
|
if (mmr == MMSYSERR_NOERROR) break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
2001-04-23 18:14:41 +00:00
|
|
|
mmr = MSACM_Message(had, ACMDM_FILTERTAG_DETAILS, (LPARAM)paftd, fdwDetails);
|
2000-09-09 20:32:10 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ACM_FILTERTAGDETAILSF_INDEX:
|
|
|
|
/* FIXME should check paftd->dwFilterTagIndex < add.cFilterTags */
|
2001-04-23 18:14:41 +00:00
|
|
|
mmr = MSACM_Message(had, ACMDM_FILTERTAG_DETAILS, (LPARAM)paftd, fdwDetails);
|
2000-09-09 20:32:10 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ACM_FILTERTAGDETAILSF_LARGESTSIZE:
|
2002-12-02 18:10:57 +00:00
|
|
|
if (had == NULL) {
|
2000-09-09 20:32:10 +00:00
|
|
|
ACMFILTERTAGDETAILSW tmp;
|
|
|
|
DWORD ft = paftd->dwFilterTag;
|
|
|
|
|
|
|
|
mmr = ACMERR_NOTPOSSIBLE;
|
|
|
|
for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) {
|
|
|
|
/* should check for codec only */
|
2002-05-31 23:06:46 +00:00
|
|
|
if (!(padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) &&
|
2000-09-09 20:32:10 +00:00
|
|
|
acmDriverOpen(&had, (HACMDRIVERID)padid, 0) == 0) {
|
|
|
|
|
|
|
|
memset(&tmp, 0, sizeof(tmp));
|
|
|
|
tmp.cbStruct = sizeof(tmp);
|
|
|
|
tmp.dwFilterTag = ft;
|
|
|
|
|
2002-05-31 23:06:46 +00:00
|
|
|
if (MSACM_Message(had, ACMDM_FILTERTAG_DETAILS,
|
2001-04-23 18:14:41 +00:00
|
|
|
(LPARAM)&tmp, fdwDetails) == MMSYSERR_NOERROR) {
|
2000-09-09 20:32:10 +00:00
|
|
|
if (mmr == ACMERR_NOTPOSSIBLE ||
|
|
|
|
paftd->cbFilterSize < tmp.cbFilterSize) {
|
|
|
|
*paftd = tmp;
|
|
|
|
mmr = MMSYSERR_NOERROR;
|
2002-05-31 23:06:46 +00:00
|
|
|
}
|
2000-09-09 20:32:10 +00:00
|
|
|
}
|
|
|
|
acmDriverClose(had, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
2001-04-23 18:14:41 +00:00
|
|
|
mmr = MSACM_Message(had, ACMDM_FILTERTAG_DETAILS, (LPARAM)paftd, fdwDetails);
|
2000-09-09 20:32:10 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2006-10-12 19:35:06 +00:00
|
|
|
WARN("Unsupported fdwDetails=%08x\n", fdwDetails);
|
2000-09-09 20:32:10 +00:00
|
|
|
mmr = MMSYSERR_ERROR;
|
|
|
|
}
|
|
|
|
|
2002-05-31 23:06:46 +00:00
|
|
|
if (mmr == MMSYSERR_NOERROR &&
|
2000-09-09 20:32:10 +00:00
|
|
|
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 {
|
2009-02-17 21:36:06 +00:00
|
|
|
PACMFILTERTAGDETAILSA paftda;
|
|
|
|
DWORD_PTR dwInstance;
|
|
|
|
ACMFILTERTAGENUMCBA fnCallback;
|
2000-09-09 20:32:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static BOOL CALLBACK MSACM_FilterTagEnumCallbackWtoA(HACMDRIVERID hadid,
|
2002-05-31 23:06:46 +00:00
|
|
|
PACMFILTERTAGDETAILSW paftdw,
|
2009-02-05 08:52:31 +00:00
|
|
|
DWORD_PTR dwInstance,
|
2000-09-09 20:32:10 +00:00
|
|
|
DWORD fdwSupport)
|
|
|
|
{
|
|
|
|
struct MSACM_FilterTagEnumWtoA_Instance* paftei;
|
|
|
|
|
|
|
|
paftei = (struct MSACM_FilterTagEnumWtoA_Instance*)dwInstance;
|
|
|
|
|
2002-05-31 23:06:46 +00: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 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
|
|
|
|
2002-05-31 23:06:46 +00:00
|
|
|
return (paftei->fnCallback)(hadid, paftei->paftda,
|
2000-09-09 20:32:10 +00:00
|
|
|
paftei->dwInstance, fdwSupport);
|
1998-10-11 17:00:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-06-11 20:14:43 +00:00
|
|
|
* acmFilterTagEnumA (MSACM32.@)
|
1998-10-11 17:00:29 +00:00
|
|
|
*/
|
2000-09-09 20:32:10 +00:00
|
|
|
MMRESULT WINAPI acmFilterTagEnumA(HACMDRIVER had, PACMFILTERTAGDETAILSA paftda,
|
2009-02-05 08:52:31 +00:00
|
|
|
ACMFILTERTAGENUMCBA fnCallback,
|
|
|
|
DWORD_PTR 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;
|
|
|
|
|
2002-05-31 23:06:46 +00:00
|
|
|
return acmFilterTagEnumW(had, &aftdw, MSACM_FilterTagEnumCallbackWtoA,
|
2009-02-17 21:36:06 +00:00
|
|
|
(DWORD_PTR)&aftei, fdwEnum);
|
1998-10-11 17:00:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-06-11 20:14:43 +00:00
|
|
|
* acmFilterTagEnumW (MSACM32.@)
|
1998-10-11 17:00:29 +00:00
|
|
|
*/
|
2000-08-26 04:33:00 +00:00
|
|
|
MMRESULT WINAPI acmFilterTagEnumW(HACMDRIVER had, PACMFILTERTAGDETAILSW paftd,
|
2009-02-05 08:52:31 +00:00
|
|
|
ACMFILTERTAGENUMCBW fnCallback,
|
|
|
|
DWORD_PTR dwInstance, DWORD fdwEnum)
|
1998-10-11 17:00:29 +00:00
|
|
|
{
|
2000-09-09 20:32:10 +00:00
|
|
|
PWINE_ACMDRIVERID padid;
|
2004-09-08 01:23:57 +00:00
|
|
|
unsigned int i;
|
2000-09-09 20:32:10 +00:00
|
|
|
|
2009-02-05 08:52:31 +00:00
|
|
|
TRACE("(%p, %p, %p, %ld, %d)\n",
|
2002-05-31 23:06:46 +00:00
|
|
|
had, paftd, fnCallback, dwInstance, fdwEnum);
|
2000-09-09 20:32:10 +00:00
|
|
|
|
|
|
|
if (paftd->cbStruct < sizeof(*paftd)) return MMSYSERR_INVALPARAM;
|
|
|
|
|
|
|
|
if (had) FIXME("had != NULL, not supported\n");
|
2002-05-31 23:06:46 +00:00
|
|
|
|
2000-09-09 20:32:10 +00:00
|
|
|
for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) {
|
|
|
|
/* should check for codec only */
|
2001-05-22 19:21:16 +00:00
|
|
|
if (!(padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) &&
|
|
|
|
acmDriverOpen(&had, (HACMDRIVERID)padid, 0) == MMSYSERR_NOERROR) {
|
2001-04-23 18:14:41 +00: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 20:32:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
acmDriverClose(had, 0);
|
|
|
|
}
|
|
|
|
return MMSYSERR_NOERROR;
|
1998-10-11 17:00:29 +00:00
|
|
|
}
|