Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages   Examples  

Hardware Dependant Interface


Defines

#define SND_HWDEP_DLSYM_VERSION   _dlsym_hwdep_001
#define SND_HWDEP_OPEN_READ   (O_RDONLY)
#define SND_HWDEP_OPEN_WRITE   (O_WRONLY)
#define SND_HWDEP_OPEN_DUPLEX   (O_RDWR)
#define SND_HWDEP_OPEN_NONBLOCK   (O_NONBLOCK)
#define snd_hwdep_info_alloca(ptr)   do { assert(ptr); *ptr = (snd_hwdep_info_t *) alloca(snd_hwdep_info_sizeof()); memset(*ptr, 0, snd_hwdep_info_sizeof()); } while (0)

Typedefs

typedef _snd_hwdep_info snd_hwdep_info_t
typedef enum _snd_hwdep_iface snd_hwdep_iface_t
typedef enum _snd_hwdep_type snd_hwdep_type_t
typedef _snd_hwdep snd_hwdep_t

Enumerations

enum  _snd_hwdep_iface {
  SND_HWDEP_IFACE_OPL2 = 0, SND_HWDEP_IFACE_OPL3, SND_HWDEP_IFACE_OPL4, SND_HWDEP_IFACE_SB16CSP,
  SND_HWDEP_IFACE_EMU10K1, SND_HWDEP_IFACE_YSS225, SND_HWDEP_IFACE_ICS2115, SND_HWDEP_IFACE_LAST = SND_HWDEP_IFACE_ICS2115
}
enum  _snd_hwdep_type { SND_HWDEP_TYPE_HW, SND_HWDEP_TYPE_SHM, SND_HWDEP_TYPE_INET }

Functions

int snd_hwdep_open (snd_hwdep_t **hwdep, const char *name, int mode)
 Opens a new connection to the HwDep interface. More...

int snd_hwdep_close (snd_hwdep_t *hwdep)
 close HwDep handle. More...

int snd_hwdep_poll_descriptors (snd_hwdep_t *hwdep, struct pollfd *pfds, unsigned int space)
 get poll descriptors. More...

int snd_hwdep_poll_descriptors_revents (snd_hwdep_t *hwdep, struct pollfd *pfds, unsigned int nfds, unsigned short *revents)
 get returned events from poll descriptors. More...

int snd_hwdep_nonblock (snd_hwdep_t *hwdep, int nonblock)
 set nonblock mode. More...

int snd_hwdep_info (snd_hwdep_t *hwdep, snd_hwdep_info_t *info)
 get information about HwDep handle. More...

int snd_hwdep_ioctl (snd_hwdep_t *hwdep, unsigned int request, void *arg)
 do hardware dependent ioctl. More...

ssize_t snd_hwdep_write (snd_hwdep_t *hwdep, const void *buffer, size_t size)
 write bytes using HwDep handle. More...

ssize_t snd_hwdep_read (snd_hwdep_t *hwdep, void *buffer, size_t size)
 read bytes using HwDep handle. More...

size_t snd_hwdep_info_sizeof (void)
 get size of the snd_hwdep_info_t structure in bytes. More...

int snd_hwdep_info_malloc (snd_hwdep_info_t **ptr)
 allocate a new snd_hwdep_info_t structure. More...

void snd_hwdep_info_free (snd_hwdep_info_t *obj)
 frees the snd_hwdep_info_t structure. More...

void snd_hwdep_info_copy (snd_hwdep_info_t *dst, const snd_hwdep_info_t *src)
 copy one snd_hwdep_info_t structure to another. More...

unsigned int snd_hwdep_info_get_device (const snd_hwdep_info_t *obj)
 get hwdep device number. More...

int snd_hwdep_info_get_card (const snd_hwdep_info_t *obj)
 get hwdep card number. More...

const char * snd_hwdep_info_get_id (const snd_hwdep_info_t *obj)
 get hwdep driver identifier. More...

const char * snd_hwdep_info_get_name (const snd_hwdep_info_t *obj)
 get hwdep driver name. More...

snd_hwdep_iface_t snd_hwdep_info_get_iface (const snd_hwdep_info_t *obj)
 get hwdep protocol interface. More...

void snd_hwdep_info_set_device (snd_hwdep_info_t *obj, unsigned int val)
 set hwdep device number. More...


Detailed Description

The Hardware Dependant Interface.

Define Documentation

#define SND_HWDEP_DLSYM_VERSION   _dlsym_hwdep_001
 

dlsym version for interface entry callback

#define snd_hwdep_info_alloca ptr       do { assert(ptr); *ptr = (snd_hwdep_info_t *) alloca(snd_hwdep_info_sizeof()); memset(*ptr, 0, snd_hwdep_info_sizeof()); } while (0)
 

allocate snd_hwdep_info_t container on stack

#define SND_HWDEP_OPEN_DUPLEX   (O_RDWR)
 

open for reading and writing

#define SND_HWDEP_OPEN_NONBLOCK   (O_NONBLOCK)
 

open mode flag: open in nonblock mode

#define SND_HWDEP_OPEN_READ   (O_RDONLY)
 

open for reading

#define SND_HWDEP_OPEN_WRITE   (O_WRONLY)
 

open for writing


Typedef Documentation

typedef enum _snd_hwdep_iface snd_hwdep_iface_t
 

HwDep interface

typedef struct _snd_hwdep_info snd_hwdep_info_t
 

HwDep information container

typedef struct _snd_hwdep snd_hwdep_t
 

HwDep handle

typedef enum _snd_hwdep_type snd_hwdep_type_t
 

HwDep handle type


Enumeration Type Documentation

enum _snd_hwdep_iface
 

HwDep interface

Enumeration values:
SND_HWDEP_IFACE_OPL2  OPL2 raw driver
SND_HWDEP_IFACE_OPL3  OPL3 raw driver
SND_HWDEP_IFACE_OPL4  OPL4 raw driver
SND_HWDEP_IFACE_SB16CSP  SB16CSP driver
SND_HWDEP_IFACE_EMU10K1  EMU10K1 driver
SND_HWDEP_IFACE_YSS225  YSS225 driver
SND_HWDEP_IFACE_ICS2115  ICS2115 driver
SND_HWDEP_IFACE_LAST  last know hwdep interface

enum _snd_hwdep_type
 

HwDep handle type

Enumeration values:
SND_HWDEP_TYPE_HW  Kernel level HwDep
SND_HWDEP_TYPE_SHM  Shared memory client HwDep (not yet implemented)
SND_HWDEP_TYPE_INET  INET client HwDep (not yet implemented)


Function Documentation

int snd_hwdep_close snd_hwdep_t   hwdep
 

close HwDep handle.

Parameters:
hwdep  HwDep handle
Returns:
0 on success otherwise a negative error code
Closes the specified HwDep handle and frees all associated resources.

int snd_hwdep_info snd_hwdep_t   hwdep,
snd_hwdep_info_t   info
 

get information about HwDep handle.

Parameters:
hwdep  HwDep handle
info  pointer to a snd_hwdep_info_t structure to be filled
Returns:
0 on success otherwise a negative error code

void snd_hwdep_info_copy snd_hwdep_info_t   dst,
const snd_hwdep_info_t   src
 

copy one snd_hwdep_info_t structure to another.

Parameters:
dst  destination snd_hwdep_info_t structure
src  source snd_hwdep_info_t structure

void snd_hwdep_info_free snd_hwdep_info_t   info
 

frees the snd_hwdep_info_t structure.

Parameters:
info  pointer to the snd_hwdep_info_t structure to free
Frees the given snd_hwdep_info_t structure using the standard free C library function.

int snd_hwdep_info_get_card const snd_hwdep_info_t   obj
 

get hwdep card number.

Parameters:
info  pointer to a snd_hwdep_info_t structure
Returns:
hwdep card number

unsigned int snd_hwdep_info_get_device const snd_hwdep_info_t   info
 

get hwdep device number.

Parameters:
info  pointer to a snd_hwdep_info_t structure
Returns:
hwdep device number

const char* snd_hwdep_info_get_id const snd_hwdep_info_t   obj
 

get hwdep driver identifier.

Parameters:
info  pointer to a snd_hwdep_info_t structure
Returns:
hwdep driver identifier

snd_hwdep_iface_t snd_hwdep_info_get_iface const snd_hwdep_info_t   obj
 

get hwdep protocol interface.

Parameters:
info  pointer to a snd_hwdep_info_t structure
Returns:
hwdep protocol interface

const char* snd_hwdep_info_get_name const snd_hwdep_info_t   obj
 

get hwdep driver name.

Parameters:
info  pointer to a snd_hwdep_info_t structure
Returns:
hwdep driver name

int snd_hwdep_info_malloc snd_hwdep_info_t **    info
 

allocate a new snd_hwdep_info_t structure.

Parameters:
ptr  returned pointer
Returns:
0 on success otherwise a negative error code if fails
Allocates a new snd_hwdep_info_t structure using the standard malloc C library function.

void snd_hwdep_info_set_device snd_hwdep_info_t   obj,
unsigned int    val
 

set hwdep device number.

Parameters:
info  pointer to a snd_hwdep_info_t structure
val  hwdep device

size_t snd_hwdep_info_sizeof  
 

get size of the snd_hwdep_info_t structure in bytes.

Returns:
size of the snd_hwdep_info_t structure in bytes

int snd_hwdep_ioctl snd_hwdep_t   hwdep,
unsigned int    request,
void *    arg
 

do hardware dependent ioctl.

Parameters:
hwdep  HwDep handle
request  ioctl command
arg  ioctl argument
Returns:
0 on success otherwise a negative error code

int snd_hwdep_nonblock snd_hwdep_t   hwdep,
int    nonblock
 

set nonblock mode.

Parameters:
hwdep  HwDep handle
nonblock  0 = block, 1 = nonblock mode
Returns:
0 on success otherwise a negative error code

int snd_hwdep_open snd_hwdep_t **    hwdep,
const char *    name,
int    mode
 

Opens a new connection to the HwDep interface.

Parameters:
hwdep  Returned handle (NULL if not wanted)
name  ASCII identifier of the HwDep handle
mode  Open mode
Returns:
0 on success otherwise a negative error code
Opens a new connection to the HwDep interface specified with an ASCII identifier and mode.

int snd_hwdep_poll_descriptors snd_hwdep_t   hwdep,
struct pollfd *    pfds,
unsigned int    space
 

get poll descriptors.

Parameters:
hwdep  HwDep handle
pfds  array of poll descriptors
space  space in the poll descriptor array
Returns:
count of filled descriptors

int snd_hwdep_poll_descriptors_revents snd_hwdep_t   hwdep,
struct pollfd *    pfds,
unsigned int    nfds,
unsigned short *    revents
 

get returned events from poll descriptors.

Parameters:
hwdep  HwDep handle
pfds  array of poll descriptors
nfds  count of poll descriptors
revents  returned events
Returns:
zero if success, otherwise a negative error code

ssize_t snd_hwdep_read snd_hwdep_t   hwdep,
void *    buffer,
size_t    size
 

read bytes using HwDep handle.

Parameters:
hwdep  HwDep handle
buffer  buffer to store the input bytes
size  input buffer size in bytes

ssize_t snd_hwdep_write snd_hwdep_t   hwdep,
const void *    buffer,
size_t    size
 

write bytes using HwDep handle.

Parameters:
hwdep  HwDep handle
buffer  buffer containing bytes to write
size  output buffer size in bytes


Generated on Thu Oct 24 15:15:01 2002 for ALSA project - the C library reference by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002