AFCodec Class Reference

The codec abstraction class of the Audio Framework. More...

#include <AFCodec.h>

Inheritance diagram for AFCodec:
AFUncopyable

List of all members.

Public Member Functions

 AFCodec (AFCore *core)
 Constructor for AFCodec.
virtual AF_STATUS Init (AFPath path)=0
 Abstracts the process of initializing a codec.
virtual VOID Deinit ()=0
 Abstracts the process of deinitializing a codec.
virtual BOOL PowerUp ()=0
 Abstracts the process of powering up the codec.
virtual BOOL PowerDown ()=0
 Abstracts the process of powering down the codec.
virtual DWORD GetInputGain ()=0
 Abstracts the process of getting the input gain from the codec.
virtual VOID SetInputGain (DWORD gain)=0
 Abstracts the process of setting the input gain to the codec.
virtual DWORD GetOutputGain ()=0
 Abstracts the process of getting the output gain from the codec.
virtual VOID SetOutputGain (DWORD gain)=0
 Abstracts the process of setting the output gain to the codec.
virtual BOOL GetInputMute ()=0
 Abstracts the process of checking whether the input stream is on mute or not.
virtual AF_STATUS SetInputMute (BOOL mute)=0
 Abstracts the process of muting/unmuting the input stream.
virtual BOOL GetOutputMute ()=0
 Abstracts the process of checking whether the output stream is on mute or not.
virtual AF_STATUS SetOutputMute (BOOL mute)=0
 Abstracts the process of muting/unmuting the output stream.
virtual VOID SetInputPower (BOOL isOn)=0
 Abstracts the process of turning on/off the ADCs in the codec.
virtual AF_STATUS SetOutputPower (BOOL isOn)=0
 Abstracts the process of turning on/off the DACs in the codec.
virtual AF_STATUS InitI2SBus (AFI2SBusCap *cap)=0
 Abstracts the process of initializing the I2S bus on the codec side.
virtual AFI2SBusCapsGetI2SBusCaps ()
 Abstracts the process of retrieving the capabilities of the codec.
virtual AFPathsGetIOPaths ()
virtual UCHAR GetSlaveAddress ()=0
 Get the slave address of the codec.
virtual UCHAR GetRegisterWidth ()=0
 Get the register width of the codec.
virtual DWORD GetPowerUsage ()=0
 Get the power usage of the codec to be reported back to the operating system.
virtual AF_STATUS SetSpeakerEnable (BOOL enable)=0
 Enable/disable forwarding the output stream to the external speakers.
virtual ~AFCodec ()
 Empty destructor for AFCodec.

Protected Attributes

AFCorecore
AFI2SBusCaps i2sBusCaps
AFPaths ioPaths
UCHAR codecSlaveAddress
UCHAR codecRegisterWidth
DWORD outputGain
DWORD inputGain
BOOL outputMute
BOOL inputMute

Detailed Description

The codec abstraction class of the Audio Framework.

Definition at line 64 of file AFCodec.h.


Constructor & Destructor Documentation

AFCodec::AFCodec ( AFCore core  )  [inline]

Constructor for AFCodec.

Parameters:
core A pointer to a AFCore owning this codec.

Definition at line 76 of file AFCodec.h.

virtual AFCodec::~AFCodec (  )  [inline, virtual]

Empty destructor for AFCodec.

Destructor: ~AFCodec

Definition at line 350 of file AFCodec.h.


Member Function Documentation

virtual VOID AFCodec::Deinit (  )  [pure virtual]

Abstracts the process of deinitializing a codec.

A derived class will provide the deinitialization sequence for a particular codec by overriding this member function.

virtual AFI2SBusCaps* AFCodec::GetI2SBusCaps (  )  [inline, virtual]

Abstracts the process of retrieving the capabilities of the codec.

Returns:
A pointer to AFI2SBusCaps.

Definition at line 287 of file AFCodec.h.

virtual DWORD AFCodec::GetInputGain (  )  [pure virtual]

Abstracts the process of getting the input gain from the codec.

Returns:
The current input gain used by the codec.
virtual BOOL AFCodec::GetInputMute (  )  [pure virtual]

Abstracts the process of checking whether the input stream is on mute or not.

Returns:
TRUE if input stream is on mute, FALSE otherwise.
virtual AFPaths* AFCodec::GetIOPaths (  )  [inline, virtual]

Definition at line 292 of file AFCodec.h.

virtual DWORD AFCodec::GetOutputGain (  )  [pure virtual]

Abstracts the process of getting the output gain from the codec.

Returns:
The current output gain used by the codec.
virtual BOOL AFCodec::GetOutputMute (  )  [pure virtual]

Abstracts the process of checking whether the output stream is on mute or not.

Returns:
TRUE if output stream is on mute, FALSE otherwise.
virtual DWORD AFCodec::GetPowerUsage (  )  [pure virtual]

Get the power usage of the codec to be reported back to the operating system.

Member function: GetPowerUsage

Returns:
The power usage.
virtual UCHAR AFCodec::GetRegisterWidth (  )  [pure virtual]

Get the register width of the codec.

Member function: GetRegisterWidth

Returns:
The current register width.
virtual UCHAR AFCodec::GetSlaveAddress (  )  [pure virtual]

Get the slave address of the codec.

Member function: GetSlaveAddress

Returns:
The slave address.
virtual AF_STATUS AFCodec::Init ( AFPath  path  )  [pure virtual]

Abstracts the process of initializing a codec.

A derived class will provide the initialization sequence for a particular codec by overriding this member function.

Parameters:
path An audio path to be initialized on the codec start-up.
Returns:
AFS_SUCCESS on success. Check for failure using the AF_FAILURE macro in AFMessages.h.
virtual AF_STATUS AFCodec::InitI2SBus ( AFI2SBusCap cap  )  [pure virtual]

Abstracts the process of initializing the I2S bus on the codec side.

Parameters:
cap A pointer to a AFI2SBusCap providing the capabilities of the codec.
Returns:
AFS_SUCCESS on success. Check for failure using the AF_FAILURE macro in AFMessages.h.
virtual BOOL AFCodec::PowerDown (  )  [pure virtual]

Abstracts the process of powering down the codec.

This function is called by the upper layers of the driver to power-down the codec. A derived class will provide the functionality for a particular codec by overriding this member function.

Returns:
TRUE on success, otherwise FALSE.
virtual BOOL AFCodec::PowerUp (  )  [pure virtual]

Abstracts the process of powering up the codec.

This function is called by the upper layers of the driver to power-up the codec. A derived class will provide the functionality for a particular codec by overriding this member function.

Returns:
TRUE on success, otherwise FALSE.
virtual VOID AFCodec::SetInputGain ( DWORD  gain  )  [pure virtual]

Abstracts the process of setting the input gain to the codec.

Parameters:
gain The gain level.
virtual AF_STATUS AFCodec::SetInputMute ( BOOL  mute  )  [pure virtual]

Abstracts the process of muting/unmuting the input stream.

Parameters:
mute If TRUE the input stream is muted, otherwise unmuted.
Returns:
AFS_SUCCESS on success. Check for failure using the AF_FAILURE macro in AFMessages.h.
virtual VOID AFCodec::SetInputPower ( BOOL  isOn  )  [pure virtual]

Abstracts the process of turning on/off the ADCs in the codec.

Parameters:
isOn If TRUE the ADCs are turned on, otherwise they are turned off.
virtual VOID AFCodec::SetOutputGain ( DWORD  gain  )  [pure virtual]

Abstracts the process of setting the output gain to the codec.

Parameters:
gain The gain level.
virtual AF_STATUS AFCodec::SetOutputMute ( BOOL  mute  )  [pure virtual]

Abstracts the process of muting/unmuting the output stream.

Parameters:
mute If TRUE the output stream is muted, otherwise unmuted.
Returns:
AFS_SUCCESS on success. Check for failure using the AF_FAILURE macro in AFMessages.h.
virtual AF_STATUS AFCodec::SetOutputPower ( BOOL  isOn  )  [pure virtual]

Abstracts the process of turning on/off the DACs in the codec.

Parameters:
isOn If TRUE the DACs are turned on, otherwise they are turned off.
Returns:
AFS_SUCCESS on success. Check for failure using the AF_FAILURE macro in AFMessages.h.
virtual AF_STATUS AFCodec::SetSpeakerEnable ( BOOL  enable  )  [pure virtual]

Enable/disable forwarding the output stream to the external speakers.

Member function: SetSpeakerEnable

Parameters:
enable If TRUE enable forwarding, otherwise disable it.
Returns:
AFS_SUCCESS on success. Check for failure using the AF_FAILURE macro in AFMessages.h.

Member Data Documentation

UCHAR AFCodec::codecRegisterWidth [protected]

The register width is the maximum number of bytes needed to address all registers in the codec.

Definition at line 358 of file AFCodec.h.

UCHAR AFCodec::codecSlaveAddress [protected]

Definition at line 357 of file AFCodec.h.

AFCore* AFCodec::core [protected]

Definition at line 352 of file AFCodec.h.

Definition at line 354 of file AFCodec.h.

DWORD AFCodec::inputGain [protected]

Definition at line 362 of file AFCodec.h.

BOOL AFCodec::inputMute [protected]

Definition at line 365 of file AFCodec.h.

Definition at line 355 of file AFCodec.h.

DWORD AFCodec::outputGain [protected]

Definition at line 361 of file AFCodec.h.

BOOL AFCodec::outputMute [protected]

Definition at line 364 of file AFCodec.h.


The documentation for this class was generated from the following file:

Generated on Sun Sep 27 12:36:35 2009 for Audio Framework by  doxygen 1.6.1