Added documentation for instrument and midi event functions.

Removed snd_enum_() macros.
Documentation changes in asoundlib.h.
This commit is contained in:
Jaroslav Kysela 2001-07-11 14:09:01 +00:00
parent 8eceb0cdc2
commit c20c954f3d
30 changed files with 440 additions and 227 deletions

View file

@ -23,12 +23,14 @@ stamp-vh: $(top_builddir)/configure.in
@echo " * version.h" >> ver.tmp
@echo " */" >> ver.tmp
@echo "" >> ver.tmp
@echo "#define SND_LIB_MAJOR $(SND_LIB_MAJOR)" >> ver.tmp
@echo "#define SND_LIB_MINOR $(SND_LIB_MINOR)" >> ver.tmp
@echo "#define SND_LIB_SUBMINOR $(SND_LIB_SUBMINOR)" >> ver.tmp
@echo "#define SND_LIB_MAJOR $(SND_LIB_MAJOR) /**< major number of library version */" >> ver.tmp
@echo "#define SND_LIB_MINOR $(SND_LIB_MINOR) /**< minor number of library version */" >> ver.tmp
@echo "#define SND_LIB_SUBMINOR $(SND_LIB_SUBMINOR) /**< subminor number of library version */" >> ver.tmp
@echo "/** library version */" >> ver.tmp
@echo "#define SND_LIB_VERSION ((SND_LIB_MAJOR<<16)|\\" >> ver.tmp
@echo " (SND_LIB_MINOR<<8)|\\" >> ver.tmp
@echo " SND_LIB_SUBMINOR)" >> ver.tmp
@echo "/** library version (string) */" >> ver.tmp
@echo "#define SND_LIB_VERSION_STR \"$(SND_LIB_VERSION)\"" >> ver.tmp
@echo >> ver.tmp
@cmp -s version.h ver.tmp \

View file

@ -84,6 +84,7 @@ typedef enum _snd_ctl_event_type {
/** Element value has been changed \hideinitializer */
#define SND_CTL_EVENT_MASK_VALUE SNDRV_CTL_EVENT_MASK_VALUE
/** Element name for IEC958 (S/PDIF) */
#define SND_CTL_NAME_IEC958 SNDRV_CTL_NAME_IEC958
/** CTL type */

View file

@ -11,13 +11,21 @@
* \{
*/
/** convert 16-bit value from host to Little Endian byte order */
#define snd_host_to_LE_16(val) __cpu_to_le16(val)
/** convert 16-bit value from Little Endian to host byte order */
#define snd_LE_to_host_16(val) __le16_to_cpu(val)
/** convert 32-bit value from host to Little Endian byte order */
#define snd_host_to_LE_32(val) __cpu_to_le32(val)
/** convert 32-bit value from Little Endian to host byte order */
#define snd_LE_to_host_32(val) __le32_to_cpu(val)
/** convert 16-bit value from host to Big Endian byte order */
#define snd_host_to_BE_16(val) __cpu_to_be16(val)
/** convert 16-bit value from Big Endian to host byte order */
#define snd_BE_to_host_16(val) __be16_to_cpu(val)
/** convert 32-bit value from host to Big Endian byte order */
#define snd_host_to_BE_32(val) __cpu_to_be32(val)
/** convert 32-bit value from Big Endian to host byte order */
#define snd_BE_to_host_32(val) __be32_to_cpu(val)
/** \} */

View file

@ -4,8 +4,8 @@
* \{
*/
#define SND_ERROR_BEGIN 500000
#define SND_ERROR_INCOMPATIBLE_VERSION (SND_ERROR_BEGIN+0)
#define SND_ERROR_BEGIN 500000 /**< begin boundary of sound error codes */
#define SND_ERROR_INCOMPATIBLE_VERSION (SND_ERROR_BEGIN+0) /**< protocol is not compatible */
#ifdef __cplusplus
extern "C" {

View file

@ -12,10 +12,6 @@
#define SND_BIG_ENDIAN SNDRV_BIG_ENDIAN
#endif
#define snd_enum_to_int(v) (v)
#define snd_int_to_enum(v) (v)
#define snd_enum_incr(v) (++(v))
/** \} */
/** Async notification client handler */

View file

@ -39,14 +39,14 @@
#include <errno.h>
#ifndef ATTRIBUTE_UNUSED
#define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
#define ATTRIBUTE_UNUSED __attribute__ ((__unused__)) /**< don't print warning when attribute is not used */
#endif
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 95)
#define SNDERR(...) snd_lib_error(__FILE__, __LINE__, __FUNCTION__, 0, __VA_ARGS__)
#define SYSERR(...) snd_lib_error(__FILE__, __LINE__, __FUNCTION__, errno, __VA_ARGS__)
#define SNDERR(...) snd_lib_error(__FILE__, __LINE__, __FUNCTION__, 0, __VA_ARGS__) /**< show sound error */
#define SYSERR(...) snd_lib_error(__FILE__, __LINE__, __FUNCTION__, errno, __VA_ARGS__) /**< show system error */
#else
#define SNDERR(args...) snd_lib_error(__FILE__, __LINE__, __FUNCTION__, 0, ##args)
#define SYSERR(args...) snd_lib_error(__FILE__, __LINE__, __FUNCTION__, errno, ##args)
#define SNDERR(args...) snd_lib_error(__FILE__, __LINE__, __FUNCTION__, 0, ##args) /**< show sound error */
#define SYSERR(args...) snd_lib_error(__FILE__, __LINE__, __FUNCTION__, errno, ##args) /**< show system error */
#endif

View file

@ -25,7 +25,7 @@ do {\
assert(ptr);\
*ptr = (snd_instr_header_t *)alloca(snd_instr_header_sizeof());\
memset(*ptr, 0, snd_instr_header_sizeof());\
} while (0)
} while (0) /**< allocate instrument header on stack */
int snd_instr_header_malloc(snd_instr_header_t **ptr, size_t len);
void snd_instr_header_free(snd_instr_header_t *ptr);
void snd_instr_header_copy(snd_instr_header_t *dst, const snd_instr_header_t *src);
@ -61,45 +61,45 @@ void snd_instr_header_set_follow_alias(snd_instr_header_t *info, int val);
*/
/** instrument types */
#define SND_SEQ_INSTR_ATYPE_DATA 0 /**< instrument data */
#define SND_SEQ_INSTR_ATYPE_ALIAS 1 /**< instrument alias */
#define SND_SEQ_INSTR_ATYPE_DATA SNDRV_SEQ_INSTR_ATYPE_DATA /**< instrument data */
#define SND_SEQ_INSTR_ATYPE_ALIAS SNDRV_SEQ_INSTR_ATYPE_ALIAS /**< instrument alias */
/** instrument ASCII identifiers */
#define SND_SEQ_INSTR_ID_DLS1 "DLS1" /**< DLS1 */
#define SND_SEQ_INSTR_ID_DLS2 "DLS2" /**< DLS2 */
#define SND_SEQ_INSTR_ID_SIMPLE "Simple Wave" /**< Simple Wave */
#define SND_SEQ_INSTR_ID_SOUNDFONT "SoundFont" /**< SoundFont */
#define SND_SEQ_INSTR_ID_GUS_PATCH "GUS Patch" /**< Gravis Patch */
#define SND_SEQ_INSTR_ID_INTERWAVE "InterWave FFFF" /**< InterWave FFFF */
#define SND_SEQ_INSTR_ID_OPL2_3 "OPL2/3 FM" /**< OPL2/3 FM */
#define SND_SEQ_INSTR_ID_OPL4 "OPL4" /**< OPL4 */
#define SND_SEQ_INSTR_ID_DLS1 SNDRV_SEQ_INSTR_ID_DLS1 /**< DLS1 */
#define SND_SEQ_INSTR_ID_DLS2 SNDRV_SEQ_INSTR_ID_DLS2 /**< DLS2 */
#define SND_SEQ_INSTR_ID_SIMPLE SNDRV_SEQ_INSTR_ID_SIMPLE /**< Simple Wave */
#define SND_SEQ_INSTR_ID_SOUNDFONT SNDRV_SEQ_INSTR_ID_SOUNDFONT /**< SoundFont */
#define SND_SEQ_INSTR_ID_GUS_PATCH SNDRV_SEQ_INSTR_ID_GUS_PATCH /**< Gravis Patch */
#define SND_SEQ_INSTR_ID_INTERWAVE SNDRV_SEQ_INSTR_ID_INTERWAVE /**< InterWave FFFF */
#define SND_SEQ_INSTR_ID_OPL2_3 SNDRV_SEQ_INSTR_ID_OPL2_3 /**< OPL2/3 FM */
#define SND_SEQ_INSTR_ID_OPL4 SNDRV_SEQ_INSTR_ID_OPL4 /**< OPL4 */
/** instrument types */
#define SND_SEQ_INSTR_TYPE0_DLS1 (1<<0) /**< MIDI DLS v1 */
#define SND_SEQ_INSTR_TYPE0_DLS2 (1<<1) /**< MIDI DLS v2 */
#define SND_SEQ_INSTR_TYPE1_SIMPLE (1<<0) /**< Simple Wave */
#define SND_SEQ_INSTR_TYPE1_SOUNDFONT (1<<1) /**< EMU SoundFont */
#define SND_SEQ_INSTR_TYPE1_GUS_PATCH (1<<2) /**< Gravis UltraSound Patch */
#define SND_SEQ_INSTR_TYPE1_INTERWAVE (1<<3) /**< InterWave FFFF */
#define SND_SEQ_INSTR_TYPE2_OPL2_3 (1<<0) /**< Yamaha OPL2/3 FM */
#define SND_SEQ_INSTR_TYPE2_OPL4 (1<<1) /**< Yamaha OPL4 */
#define SND_SEQ_INSTR_TYPE0_DLS1 SNDRV_SEQ_INSTR_TYPE0_DLS1 /**< MIDI DLS v1 */
#define SND_SEQ_INSTR_TYPE0_DLS2 SNDRV_SEQ_INSTR_TYPE0_DLS2 /**< MIDI DLS v2 */
#define SND_SEQ_INSTR_TYPE1_SIMPLE SNDRV_SEQ_INSTR_TYPE1_SIMPLE /**< Simple Wave */
#define SND_SEQ_INSTR_TYPE1_SOUNDFONT SNDRV_SEQ_INSTR_TYPE1_SOUNDFONT /**< EMU SoundFont */
#define SND_SEQ_INSTR_TYPE1_GUS_PATCH SNDRV_SEQ_INSTR_TYPE1_GUS_PATCH /**< Gravis UltraSound Patch */
#define SND_SEQ_INSTR_TYPE1_INTERWAVE SNDRV_SEQ_INSTR_TYPE1_INTERWAVE /**< InterWave FFFF */
#define SND_SEQ_INSTR_TYPE2_OPL2_3 SNDRV_SEQ_INSTR_TYPE2_OPL2_3 /**< Yamaha OPL2/3 FM */
#define SND_SEQ_INSTR_TYPE2_OPL4 SNDRV_SEQ_INSTR_TYPE2_OPL4 /**< Yamaha OPL4 */
/** put commands */
#define SND_SEQ_INSTR_PUT_CMD_CREATE 0 /**< create a new layer */
#define SND_SEQ_INSTR_PUT_CMD_REPLACE 1 /**< replace the old layer with new one */
#define SND_SEQ_INSTR_PUT_CMD_MODIFY 2 /**< modify the existing layer */
#define SND_SEQ_INSTR_PUT_CMD_ADD 3 /**< add one to the existing layer */
#define SND_SEQ_INSTR_PUT_CMD_REMOVE 4 /**< remove the layer */
#define SND_SEQ_INSTR_PUT_CMD_CREATE SNDRV_SEQ_INSTR_PUT_CMD_CREATE /**< create a new layer */
#define SND_SEQ_INSTR_PUT_CMD_REPLACE SNDRV_SEQ_INSTR_PUT_CMD_REPLACE /**< replace the old layer with new one */
#define SND_SEQ_INSTR_PUT_CMD_MODIFY SNDRV_SEQ_INSTR_PUT_CMD_MODIFY /**< modify the existing layer */
#define SND_SEQ_INSTR_PUT_CMD_ADD SNDRV_SEQ_INSTR_PUT_CMD_ADD /**< add one to the existing layer */
#define SND_SEQ_INSTR_PUT_CMD_REMOVE SNDRV_SEQ_INSTR_PUT_CMD_REMOVE /**< remove the layer */
/** get commands */
#define SND_SEQ_INSTR_GET_CMD_FULL 0 /**< get the full data stream */
#define SND_SEQ_INSTR_GET_CMD_PARTIAL 1 /**< get the partial data stream */
#define SND_SEQ_INSTR_GET_CMD_FULL SNDRV_SEQ_INSTR_GET_CMD_FULL /**< get the full data stream */
#define SND_SEQ_INSTR_GET_CMD_PARTIAL SNDRV_SEQ_INSTR_GET_CMD_PARTIAL /**< get the partial data stream */
/** free commands */
#define SND_SEQ_INSTR_FREE_CMD_ALL 0 /**< remove all matching instruments */
#define SND_SEQ_INSTR_FREE_CMD_PRIVATE 1 /**< remove only private instruments */
#define SND_SEQ_INSTR_FREE_CMD_CLUSTER 2 /**< remove only cluster instruments */
#define SND_SEQ_INSTR_FREE_CMD_SINGLE 3 /**< remove single instrument */
#define SND_SEQ_INSTR_FREE_CMD_ALL SNDRV_SEQ_INSTR_FREE_CMD_ALL /**< remove all matching instruments */
#define SND_SEQ_INSTR_FREE_CMD_PRIVATE SNDRV_SEQ_INSTR_FREE_CMD_PRIVATE /**< remove only private instruments */
#define SND_SEQ_INSTR_FREE_CMD_CLUSTER SNDRV_SEQ_INSTR_FREE_CMD_CLUSTER /**< remove only cluster instruments */
#define SND_SEQ_INSTR_FREE_CMD_SINGLE SNDRV_SEQ_INSTR_FREE_CMD_SINGLE /**< remove single instrument */
/**

View file

@ -209,18 +209,31 @@ typedef sndrv_pcm_sframes_t snd_pcm_sframes_t;
/** Timestamp */
typedef struct timeval snd_timestamp_t;
/** device accepts mmaped access */
#define SND_PCM_INFO_MMAP SNDRV_PCM_INFO_MMAP
/** device accepts mmaped access with sample resolution */
#define SND_PCM_INFO_MMAP_VALID SNDRV_PCM_INFO_MMAP_VALID
/** device is doing double buffering */
#define SND_PCM_INFO_DOUBLE SNDRV_PCM_INFO_DOUBLE
/** device transfers samples in batch */
#define SND_PCM_INFO_BATCH SNDRV_PCM_INFO_BATCH
/** device accepts interleaved samples */
#define SND_PCM_INFO_INTERLEAVED SNDRV_PCM_INFO_INTERLEAVED
/** device accepts non-interleaved samples */
#define SND_PCM_INFO_NONINTERLEAVED SNDRV_PCM_INFO_NONINTERLEAVED
/** device accepts complex sample organization */
#define SND_PCM_INFO_COMPLEX SNDRV_PCM_INFO_COMPLEX
/** device is capable block transfers */
#define SND_PCM_INFO_BLOCK_TRANSFER SNDRV_PCM_INFO_BLOCK_TRANSFER
/** device can detect DAC/ADC overrange */
#define SND_PCM_INFO_OVERRANGE SNDRV_PCM_INFO_OVERRANGE
/** device is capable to pause */
#define SND_PCM_INFO_PAUSE SNDRV_PCM_INFO_PAUSE
/** device can do only half duplex */
#define SND_PCM_INFO_HALF_DUPLEX SNDRV_PCM_INFO_HALF_DUPLEX
/** device can do only joint duplex (same parameters) */
#define SND_PCM_INFO_JOINT_DUPLEX SNDRV_PCM_INFO_JOINT_DUPLEX
/** device can do a kind of synchronized start */
#define SND_PCM_INFO_SYNC_START SNDRV_PCM_INFO_SYNC_START
/** Non blocking mode \hideinitializer */