DevCodec.h revision bc1484a141a5638d1c26739e77e8a47c77dc2da3
/* $Id$ */
/** @file
* DevCodec - VBox ICH Intel HD Audio Codec.
*/
/*
* Copyright (C) 2006-2008 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#ifndef DEV_CODEC_H
#define DEV_CODEC_H
struct CODECState;
struct INTELHDLinkState;
typedef DECLCALLBACK(int) FNCODECVERBPROCESSOR(struct CODECState *pState, uint32_t cmd, uint64_t *pResp);
typedef FNCODECVERBPROCESSOR *PFNCODECVERBPROCESSOR;
typedef FNCODECVERBPROCESSOR **PPFNCODECVERBPROCESSOR;
/* RPM 5.3.1 */
typedef struct CODECVERB
{
/* operation bitness mask */
} CODECVERB;
#define CODECNODE_F0_PARAM_LENGTH 0x14
#define CODECNODE_F02_PARAM_LENGTH 16
typedef struct CODECCOMMONNODE
{
const char *name;
/* RPM 5.3.6 */
typedef struct ROOTCODECNODE
{
#define AMPLIFIER_SIZE 60
#define AMPLIFIER_IN 0
#define AMPLIFIER_OUT 1
#define AMPLIFIER_LEFT 1
#define AMPLIFIER_RIGHT 0
typedef struct DACNODE
{
typedef struct ADCNODE
{
typedef struct SPDIFOUTNODE
{
typedef struct SPDIFINNODE
{
} SPDIFINNODE, *PSPDIFINNODE;
typedef struct AFGCODECNODE
{
typedef struct PORTNODE
{
typedef struct DIGOUTNODE
{
} DIGOUTNODE, *PDIGOUTNODE;
typedef struct DIGINNODE
{
} DIGINNODE, *PDIGINNODE;
typedef struct ADCMUXNODE
{
} ADCMUXNODE, *PADCMUXNODE;
typedef struct PCBEEPNODE
{
} PCBEEPNODE, *PPCBEEPNODE;
typedef struct CDNODE
{
typedef struct VOLUMEKNOBNODE
{
typedef struct ADCVOLNODE
{
} ADCVOLNODE, *PADCVOLNODE;
typedef struct RESNODE
{
typedef union CODECNODE
{
} CODECNODE, *PCODECNODE;
typedef enum
{
PI_INDEX = 0, /* PCM in */
PO_INDEX, /* PCM out */
MC_INDEX, /* Mic in */
typedef enum
{
} ENMCODEC;
# define MAX_AUDIO_FORMAT 64
# define AUDIO_FORMAT_SELECTOR(pState, dir, hz, mult, divizor) ((pState)->aSwVoice##dir[(hz)*24 + (mult)*8 + (divizor)])
# define AFMT_HZ_48K 0
# define AFMT_HZ_44_1K 1
# define AFMT_MULT_X1 0
# define AFMT_MULT_X2 1
# define AFMT_MULT_X4 3
# define AFMT_DIV_X1 0
# define AFMT_DIV_X2 1
# define AFMT_DIV_X3 2
# define AFMT_DIV_X4 3
# define AFMT_DIV_X5 4
# define AFMT_DIV_X6 5
# define AFMT_DIV_X7 6
# define AFMT_DIV_X8 7
#else
#endif
typedef struct CODECState
{
int cVerbs;
#ifndef VBOX_WITH_AUDIO_FLEXIBLE_FORMAT
/** PCM in */
/** PCM out */
/** Mic in */
#else
#endif
void *pHDAState;
bool fInReset;
const uint8_t cTotalNodes;
const uint8_t *au8AdcVols;
const uint8_t *au8AdcMuxs;
const uint8_t *au8Pcbeeps;
const uint8_t *au8SpdifIns;
const uint8_t *au8SpdifOuts;
const uint8_t *au8DigInPins;
const uint8_t *au8DigOutPins;
const uint8_t *au8VolKnobs;
const uint8_t *au8Reserveds;
const uint8_t u8AdcVolsLineIn;
const uint8_t u8DacLineOut;
DECLR3CALLBACKMEMBER(int, pfnLookup, (struct CODECState *pState, uint32_t verb, PPFNCODECVERBPROCESSOR));
} CODECState;
#endif