Path: blob/master/thirdparty/linuxbsd_headers/alsa/hwdep.h
9903 views
/**1* \file include/hwdep.h2* \brief Application interface library for the ALSA driver3* \author Jaroslav Kysela <[email protected]>4* \author Abramo Bagnara <[email protected]>5* \author Takashi Iwai <[email protected]>6* \date 1998-20017*8* Application interface library for the ALSA driver9*/10/*11* This library is free software; you can redistribute it and/or modify12* it under the terms of the GNU Lesser General Public License as13* published by the Free Software Foundation; either version 2.1 of14* the License, or (at your option) any later version.15*16* This program is distributed in the hope that it will be useful,17* but WITHOUT ANY WARRANTY; without even the implied warranty of18* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the19* GNU Lesser General Public License for more details.20*21* You should have received a copy of the GNU Lesser General Public22* License along with this library; if not, write to the Free Software23* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA24*25*/2627#ifndef __ALSA_HWDEP_H28#define __ALSA_HWDEP_H2930#ifdef __cplusplus31extern "C" {32#endif3334/**35* \defgroup HwDep Hardware Dependant Interface36* The Hardware Dependant Interface.37* \{38*/3940/** dlsym version for interface entry callback */41#define SND_HWDEP_DLSYM_VERSION _dlsym_hwdep_0014243/** HwDep information container */44typedef struct _snd_hwdep_info snd_hwdep_info_t;4546/** HwDep DSP status container */47typedef struct _snd_hwdep_dsp_status snd_hwdep_dsp_status_t;4849/** HwDep DSP image container */50typedef struct _snd_hwdep_dsp_image snd_hwdep_dsp_image_t;5152/** HwDep interface */53typedef enum _snd_hwdep_iface {54SND_HWDEP_IFACE_OPL2 = 0, /**< OPL2 raw driver */55SND_HWDEP_IFACE_OPL3, /**< OPL3 raw driver */56SND_HWDEP_IFACE_OPL4, /**< OPL4 raw driver */57SND_HWDEP_IFACE_SB16CSP, /**< SB16CSP driver */58SND_HWDEP_IFACE_EMU10K1, /**< EMU10K1 driver */59SND_HWDEP_IFACE_YSS225, /**< YSS225 driver */60SND_HWDEP_IFACE_ICS2115, /**< ICS2115 driver */61SND_HWDEP_IFACE_SSCAPE, /**< Ensoniq SoundScape ISA card (MC68EC000) */62SND_HWDEP_IFACE_VX, /**< Digigram VX cards */63SND_HWDEP_IFACE_MIXART, /**< Digigram miXart cards */64SND_HWDEP_IFACE_USX2Y, /**< Tascam US122, US224 & US428 usb */65SND_HWDEP_IFACE_EMUX_WAVETABLE, /**< EmuX wavetable */66SND_HWDEP_IFACE_BLUETOOTH, /**< Bluetooth audio */67SND_HWDEP_IFACE_USX2Y_PCM, /**< Tascam US122, US224 & US428 raw USB PCM */68SND_HWDEP_IFACE_PCXHR, /**< Digigram PCXHR */69SND_HWDEP_IFACE_SB_RC, /**< SB Extigy/Audigy2NX remote control */70SND_HWDEP_IFACE_HDA, /**< HD-audio */71SND_HWDEP_IFACE_USB_STREAM, /**< direct access to usb stream */72SND_HWDEP_IFACE_FW_DICE, /**< TC DICE FireWire device */73SND_HWDEP_IFACE_FW_FIREWORKS, /**< Echo Audio Fireworks based device */74SND_HWDEP_IFACE_FW_BEBOB, /**< BridgeCo BeBoB based device */75SND_HWDEP_IFACE_FW_OXFW, /**< Oxford OXFW970/971 based device */76SND_HWDEP_IFACE_FW_DIGI00X, /* Digidesign Digi 002/003 family */77SND_HWDEP_IFACE_FW_TASCAM, /* TASCAM FireWire series */7879SND_HWDEP_IFACE_LAST = SND_HWDEP_IFACE_FW_TASCAM /**< last known hwdep interface */80} snd_hwdep_iface_t;8182/** open for reading */83#define SND_HWDEP_OPEN_READ (O_RDONLY)84/** open for writing */85#define SND_HWDEP_OPEN_WRITE (O_WRONLY)86/** open for reading and writing */87#define SND_HWDEP_OPEN_DUPLEX (O_RDWR)88/** open mode flag: open in nonblock mode */89#define SND_HWDEP_OPEN_NONBLOCK (O_NONBLOCK)9091/** HwDep handle type */92typedef enum _snd_hwdep_type {93/** Kernel level HwDep */94SND_HWDEP_TYPE_HW,95/** Shared memory client HwDep (not yet implemented) */96SND_HWDEP_TYPE_SHM,97/** INET client HwDep (not yet implemented) */98SND_HWDEP_TYPE_INET99} snd_hwdep_type_t;100101/** HwDep handle */102typedef struct _snd_hwdep snd_hwdep_t;103104int snd_hwdep_open(snd_hwdep_t **hwdep, const char *name, int mode);105int snd_hwdep_close(snd_hwdep_t *hwdep);106int snd_hwdep_poll_descriptors(snd_hwdep_t *hwdep, struct pollfd *pfds, unsigned int space);107int snd_hwdep_poll_descriptors_count(snd_hwdep_t *hwdep);108int snd_hwdep_poll_descriptors_revents(snd_hwdep_t *hwdep, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);109int snd_hwdep_nonblock(snd_hwdep_t *hwdep, int nonblock);110int snd_hwdep_info(snd_hwdep_t *hwdep, snd_hwdep_info_t * info);111int snd_hwdep_dsp_status(snd_hwdep_t *hwdep, snd_hwdep_dsp_status_t *status);112int snd_hwdep_dsp_load(snd_hwdep_t *hwdep, snd_hwdep_dsp_image_t *block);113int snd_hwdep_ioctl(snd_hwdep_t *hwdep, unsigned int request, void * arg);114ssize_t snd_hwdep_write(snd_hwdep_t *hwdep, const void *buffer, size_t size);115ssize_t snd_hwdep_read(snd_hwdep_t *hwdep, void *buffer, size_t size);116117size_t snd_hwdep_info_sizeof(void);118/** allocate #snd_hwdep_info_t container on stack */119#define snd_hwdep_info_alloca(ptr) __snd_alloca(ptr, snd_hwdep_info)120int snd_hwdep_info_malloc(snd_hwdep_info_t **ptr);121void snd_hwdep_info_free(snd_hwdep_info_t *obj);122void snd_hwdep_info_copy(snd_hwdep_info_t *dst, const snd_hwdep_info_t *src);123124unsigned int snd_hwdep_info_get_device(const snd_hwdep_info_t *obj);125int snd_hwdep_info_get_card(const snd_hwdep_info_t *obj);126const char *snd_hwdep_info_get_id(const snd_hwdep_info_t *obj);127const char *snd_hwdep_info_get_name(const snd_hwdep_info_t *obj);128snd_hwdep_iface_t snd_hwdep_info_get_iface(const snd_hwdep_info_t *obj);129void snd_hwdep_info_set_device(snd_hwdep_info_t *obj, unsigned int val);130131size_t snd_hwdep_dsp_status_sizeof(void);132/** allocate #snd_hwdep_dsp_status_t container on stack */133#define snd_hwdep_dsp_status_alloca(ptr) __snd_alloca(ptr, snd_hwdep_dsp_status)134int snd_hwdep_dsp_status_malloc(snd_hwdep_dsp_status_t **ptr);135void snd_hwdep_dsp_status_free(snd_hwdep_dsp_status_t *obj);136void snd_hwdep_dsp_status_copy(snd_hwdep_dsp_status_t *dst, const snd_hwdep_dsp_status_t *src);137138unsigned int snd_hwdep_dsp_status_get_version(const snd_hwdep_dsp_status_t *obj);139const char *snd_hwdep_dsp_status_get_id(const snd_hwdep_dsp_status_t *obj);140unsigned int snd_hwdep_dsp_status_get_num_dsps(const snd_hwdep_dsp_status_t *obj);141unsigned int snd_hwdep_dsp_status_get_dsp_loaded(const snd_hwdep_dsp_status_t *obj);142unsigned int snd_hwdep_dsp_status_get_chip_ready(const snd_hwdep_dsp_status_t *obj);143144size_t snd_hwdep_dsp_image_sizeof(void);145/** allocate #snd_hwdep_dsp_image_t container on stack */146#define snd_hwdep_dsp_image_alloca(ptr) __snd_alloca(ptr, snd_hwdep_dsp_image)147int snd_hwdep_dsp_image_malloc(snd_hwdep_dsp_image_t **ptr);148void snd_hwdep_dsp_image_free(snd_hwdep_dsp_image_t *obj);149void snd_hwdep_dsp_image_copy(snd_hwdep_dsp_image_t *dst, const snd_hwdep_dsp_image_t *src);150151unsigned int snd_hwdep_dsp_image_get_index(const snd_hwdep_dsp_image_t *obj);152const char *snd_hwdep_dsp_image_get_name(const snd_hwdep_dsp_image_t *obj);153const void *snd_hwdep_dsp_image_get_image(const snd_hwdep_dsp_image_t *obj);154size_t snd_hwdep_dsp_image_get_length(const snd_hwdep_dsp_image_t *obj);155156void snd_hwdep_dsp_image_set_index(snd_hwdep_dsp_image_t *obj, unsigned int _index);157void snd_hwdep_dsp_image_set_name(snd_hwdep_dsp_image_t *obj, const char *name);158void snd_hwdep_dsp_image_set_image(snd_hwdep_dsp_image_t *obj, void *buffer);159void snd_hwdep_dsp_image_set_length(snd_hwdep_dsp_image_t *obj, size_t length);160161/** \} */162163#ifdef __cplusplus164}165#endif166167#endif /* __ALSA_HWDEP_H */168169170171