* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#define WIN32_NO_STATUS
-
#include <assert.h>
#include <stdarg.h>
-//#include <string.h>
-#include <windef.h>
-#include <winbase.h>
-#include <wingdi.h>
-#include <winuser.h>
-#include <winnls.h>
-//#include "mmsystem.h"
-//#include "mmreg.h"
-//#include "msacm.h"
-#include <msacmdrv.h>
-#include <wine/debug.h>
+#include <string.h>
+#include "windef.h"
+#include "winbase.h"
+#include "wingdi.h"
+#include "winuser.h"
+#include "winnls.h"
+#include "mmsystem.h"
+#include "mmreg.h"
+#include "msacm.h"
+#include "msacmdrv.h"
+#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(g711);
{1, 8, 22050}, {2, 8, 22050}, {1, 8, 44100}, {2, 8, 44100},
};
-#define NUM_PCM_FORMATS (sizeof(PCM_Formats) / sizeof(PCM_Formats[0]))
-#define NUM_ALAW_FORMATS (sizeof(ALaw_Formats) / sizeof(ALaw_Formats[0]))
-#define NUM_ULAW_FORMATS (sizeof(ULaw_Formats) / sizeof(ULaw_Formats[0]))
-
/***********************************************************************
* G711_GetFormatIndex
*/
switch (wfx->wFormatTag)
{
case WAVE_FORMAT_PCM:
- hi = NUM_PCM_FORMATS;
+ hi = ARRAY_SIZE(PCM_Formats);
fmts = PCM_Formats;
break;
case WAVE_FORMAT_ALAW:
- hi = NUM_ALAW_FORMATS;
+ hi = ARRAY_SIZE(ALaw_Formats);
fmts = ALaw_Formats;
break;
case WAVE_FORMAT_MULAW:
- hi = NUM_ULAW_FORMATS;
+ hi = ARRAY_SIZE(ULaw_Formats);
fmts = ULaw_Formats;
break;
default:
* charge.
*
* SUN SOURCE CODE IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING
- * THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
*
* Sun source code is provided with no support and without any obligation on
ulaw2alaw(unsigned char uval)
{
uval &= 0xff;
- return (unsigned char) ((uval & 0x80) ? (0xD5 ^ (_u2a[0xFF ^ uval] - 1)) :
- (unsigned char) (0x55 ^ (_u2a[0x7F ^ uval] - 1)));
+ return (uval & 0x80) ? (0xD5 ^ (_u2a[0xFF ^ uval] - 1)) : (0x55 ^ (_u2a[0x7F ^ uval] - 1));
}
/* -------------------------------------------------------------------------------*/
{
add->fccType = ACMDRIVERDETAILS_FCCTYPE_AUDIOCODEC;
add->fccComp = ACMDRIVERDETAILS_FCCCOMP_UNDEFINED;
- add->wMid = 0xFF;
- add->wPid = 0x00;
+ add->wMid = MM_MICROSOFT;
+ add->wPid = MM_MSFT_ACM_G711;
add->vdwACM = 0x01000000;
add->vdwDriver = 0x01000000;
add->fdwSupport = ACMDRIVERDETAILS_SUPPORTF_CODEC;
add->cFormatTags = 3; /* PCM, G711 A-LAW & MU-LAW */
add->cFilterTags = 0;
add->hicon = NULL;
- MultiByteToWideChar( CP_ACP, 0, "WINE-G711", -1,
- add->szShortName, sizeof(add->szShortName)/sizeof(WCHAR) );
+ MultiByteToWideChar( CP_ACP, 0, "Microsoft CCITT G.711", -1,
+ add->szShortName, ARRAY_SIZE( add->szShortName ));
MultiByteToWideChar( CP_ACP, 0, "Wine G711 converter", -1,
- add->szLongName, sizeof(add->szLongName)/sizeof(WCHAR) );
+ add->szLongName, ARRAY_SIZE( add->szLongName ));
MultiByteToWideChar( CP_ACP, 0, "Brought to you by the Wine team...", -1,
- add->szCopyright, sizeof(add->szCopyright)/sizeof(WCHAR) );
+ add->szCopyright, ARRAY_SIZE( add->szCopyright ));
MultiByteToWideChar( CP_ACP, 0, "Refer to LICENSE file", -1,
- add->szLicensing, sizeof(add->szLicensing)/sizeof(WCHAR) );
+ add->szLicensing, ARRAY_SIZE( add->szLicensing ));
add->szFeatures[0] = 0;
return MMSYSERR_NOERROR;
aftd->dwFormatTagIndex = 1;
break;
}
- /* fall thru */
+ /* fall through */
case ACM_FORMATTAGDETAILSF_FORMATTAG:
switch (aftd->dwFormatTag)
{
case 0:
aftd->dwFormatTag = WAVE_FORMAT_PCM;
aftd->cbFormatSize = sizeof(PCMWAVEFORMAT);
- aftd->cStandardFormats = NUM_PCM_FORMATS;
+ aftd->cStandardFormats = ARRAY_SIZE(PCM_Formats);
lstrcpyW(aftd->szFormatTag, szPcm);
break;
case 1:
aftd->dwFormatTag = WAVE_FORMAT_ALAW;
aftd->cbFormatSize = sizeof(WAVEFORMATEX);
- aftd->cStandardFormats = NUM_ALAW_FORMATS;
+ aftd->cStandardFormats = ARRAY_SIZE(ALaw_Formats);
lstrcpyW(aftd->szFormatTag, szALaw);
break;
case 2:
aftd->dwFormatTag = WAVE_FORMAT_MULAW;
aftd->cbFormatSize = sizeof(WAVEFORMATEX);
- aftd->cStandardFormats = NUM_ULAW_FORMATS;
+ aftd->cStandardFormats = ARRAY_SIZE(ULaw_Formats);
lstrcpyW(aftd->szFormatTag, szULaw);
break;
}
switch (afd->dwFormatTag)
{
case WAVE_FORMAT_PCM:
- if (afd->dwFormatIndex >= NUM_PCM_FORMATS) return ACMERR_NOTPOSSIBLE;
+ if (afd->dwFormatIndex >= ARRAY_SIZE(PCM_Formats)) return ACMERR_NOTPOSSIBLE;
afd->pwfx->nChannels = PCM_Formats[afd->dwFormatIndex].nChannels;
afd->pwfx->nSamplesPerSec = PCM_Formats[afd->dwFormatIndex].rate;
afd->pwfx->wBitsPerSample = PCM_Formats[afd->dwFormatIndex].nBits;
afd->pwfx->nAvgBytesPerSec = afd->pwfx->nSamplesPerSec * afd->pwfx->nBlockAlign;
break;
case WAVE_FORMAT_ALAW:
- if (afd->dwFormatIndex >= NUM_ALAW_FORMATS) return ACMERR_NOTPOSSIBLE;
+ if (afd->dwFormatIndex >= ARRAY_SIZE(ALaw_Formats)) return ACMERR_NOTPOSSIBLE;
afd->pwfx->nChannels = ALaw_Formats[afd->dwFormatIndex].nChannels;
afd->pwfx->nSamplesPerSec = ALaw_Formats[afd->dwFormatIndex].rate;
afd->pwfx->wBitsPerSample = ALaw_Formats[afd->dwFormatIndex].nBits;
afd->pwfx->cbSize = 0;
break;
case WAVE_FORMAT_MULAW:
- if (afd->dwFormatIndex >= NUM_ULAW_FORMATS) return ACMERR_NOTPOSSIBLE;
+ if (afd->dwFormatIndex >= ARRAY_SIZE(ULaw_Formats)) return ACMERR_NOTPOSSIBLE;
afd->pwfx->nChannels = ULaw_Formats[afd->dwFormatIndex].nChannels;
afd->pwfx->nSamplesPerSec = ULaw_Formats[afd->dwFormatIndex].rate;
afd->pwfx->wBitsPerSample = ULaw_Formats[afd->dwFormatIndex].nBits;
adfs->pwfxDst->nBlockAlign = adfs->pwfxDst->nChannels;
adfs->pwfxDst->nAvgBytesPerSec = adfs->pwfxDst->nSamplesPerSec * adfs->pwfxSrc->nChannels;
break;
- default:
- FIXME("\n");
- break;
}
return MMSYSERR_NOERROR;
WARN("Unsupported query %08x\n", adss->fdwSize);
return MMSYSERR_NOTSUPPORTED;
}
- FIXME("\n");
return MMSYSERR_NOERROR;
}