mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
Recoded hwdep API to follow modern conf style.
Added hwdep configuration to alsa.conf. Added documentation for hwdep interface.
This commit is contained in:
parent
daebb1d1f0
commit
d02979784f
7 changed files with 683 additions and 172 deletions
|
|
@ -14,22 +14,37 @@
|
|||
/** HwDep information container */
|
||||
typedef struct _snd_hwdep_info snd_hwdep_info_t;
|
||||
|
||||
/** HwDep interface */
|
||||
typedef enum _snd_hwdep_iface {
|
||||
SND_HWDEP_IFACE_OPL2 = SNDRV_HWDEP_IFACE_OPL2,
|
||||
SND_HWDEP_IFACE_OPL3 = SNDRV_HWDEP_IFACE_OPL3,
|
||||
SND_HWDEP_IFACE_OPL4 = SNDRV_HWDEP_IFACE_OPL4,
|
||||
SND_HWDEP_IFACE_SB16CSP = SNDRV_HWDEP_IFACE_SB16CSP,
|
||||
SND_HWDEP_IFACE_EMU10K1 = SNDRV_HWDEP_IFACE_EMU10K1,
|
||||
SND_HWDEP_IFACE_YSS225 = SNDRV_HWDEP_IFACE_YSS225,
|
||||
SND_HWDEP_IFACE_ICS2115 = SNDRV_HWDEP_IFACE_ICS2115,
|
||||
SND_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_LAST,
|
||||
SND_HWDEP_IFACE_OPL2 = SNDRV_HWDEP_IFACE_OPL2, /**< OPL2 raw driver */
|
||||
SND_HWDEP_IFACE_OPL3 = SNDRV_HWDEP_IFACE_OPL3, /**< OPL3 raw driver */
|
||||
SND_HWDEP_IFACE_OPL4 = SNDRV_HWDEP_IFACE_OPL4, /**< OPL4 raw driver */
|
||||
SND_HWDEP_IFACE_SB16CSP = SNDRV_HWDEP_IFACE_SB16CSP, /**< SB16CSP driver */
|
||||
SND_HWDEP_IFACE_EMU10K1 = SNDRV_HWDEP_IFACE_EMU10K1, /**< EMU10K1 driver */
|
||||
SND_HWDEP_IFACE_YSS225 = SNDRV_HWDEP_IFACE_YSS225, /**< YSS225 driver */
|
||||
SND_HWDEP_IFACE_ICS2115 = SNDRV_HWDEP_IFACE_ICS2115, /**< ICS2115 driver */
|
||||
SND_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_LAST, /**< last know hwdep interface */
|
||||
} snd_hwdep_iface_t;
|
||||
|
||||
/** open for reading */
|
||||
#define SND_HWDEP_OPEN_READ (O_RDONLY)
|
||||
/** open for writing */
|
||||
#define SND_HWDEP_OPEN_WRITE (O_WRONLY)
|
||||
/** open for reading and writing */
|
||||
#define SND_HWDEP_OPEN_DUPLEX (O_RDWR)
|
||||
/** flag: open in nonblock mode */
|
||||
#define SND_HWDEP_OPEN_NONBLOCK (O_NONBLOCK)
|
||||
|
||||
/** HwDep handle type */
|
||||
typedef enum _snd_hwdep_type {
|
||||
/** Kernel level HwDep */
|
||||
SND_HWDEP_TYPE_HW,
|
||||
/** Shared memory client HwDep (not yet implemented) */
|
||||
SND_HWDEP_TYPE_SHM,
|
||||
/** INET client HwDep (not yet implemented) */
|
||||
SND_HWDEP_TYPE_INET,
|
||||
} snd_hwdep_type_t;
|
||||
|
||||
/** HwDep handle */
|
||||
typedef struct _snd_hwdep snd_hwdep_t;
|
||||
|
||||
|
|
@ -37,16 +52,17 @@ typedef struct _snd_hwdep snd_hwdep_t;
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
int snd_hwdep_open(snd_hwdep_t **hwdep, int card, int device, int mode);
|
||||
int snd_hwdep_open(snd_hwdep_t **hwdep, const char *name, int mode);
|
||||
int snd_hwdep_close(snd_hwdep_t *hwdep);
|
||||
int snd_hwdep_poll_descriptors(snd_hwdep_t *hwdep, struct pollfd *pfds, unsigned int space);
|
||||
int snd_hwdep_block_mode(snd_hwdep_t *hwdep, int enable);
|
||||
int snd_hwdep_nonblock(snd_hwdep_t *hwdep, int nonblock);
|
||||
int snd_hwdep_info(snd_hwdep_t *hwdep, snd_hwdep_info_t * info);
|
||||
int snd_hwdep_ioctl(snd_hwdep_t *hwdep, unsigned int request, void * arg);
|
||||
ssize_t snd_hwdep_write(snd_hwdep_t *hwdep, const void *buffer, size_t size);
|
||||
ssize_t snd_hwdep_read(snd_hwdep_t *hwdep, void *buffer, size_t size);
|
||||
|
||||
size_t snd_hwdep_info_sizeof(void);
|
||||
/** allocate #snd_hwdep_info_t container on stack */
|
||||
#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)
|
||||
int snd_hwdep_info_malloc(snd_hwdep_info_t **ptr);
|
||||
void snd_hwdep_info_free(snd_hwdep_info_t *obj);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue