From: Jaroslav Kysela Date: Mon, 20 Aug 2001 13:15:30 +0000 (+0000) Subject: The main header file is not dependant on asound.h from driver. X-Git-Tag: v1.0.3~701 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=79531a4eb0d8ebc237baf0feabcdb99fc260b5ee;p=alsa-lib.git The main header file is not dependant on asound.h from driver. --- diff --git a/include/control.h b/include/control.h index 3574b4ab..8bb0b009 100644 --- a/include/control.h +++ b/include/control.h @@ -38,58 +38,82 @@ typedef struct _snd_ctl_event snd_ctl_event_t; /** CTL element type */ typedef enum _snd_ctl_elem_type { /** Invalid type */ - SND_CTL_ELEM_TYPE_NONE = SNDRV_CTL_ELEM_TYPE_NONE, + SND_CTL_ELEM_TYPE_NONE = 0, /** Boolean contents */ - SND_CTL_ELEM_TYPE_BOOLEAN = SNDRV_CTL_ELEM_TYPE_BOOLEAN, + SND_CTL_ELEM_TYPE_BOOLEAN, /** Integer contents */ - SND_CTL_ELEM_TYPE_INTEGER = SNDRV_CTL_ELEM_TYPE_INTEGER, + SND_CTL_ELEM_TYPE_INTEGER, /** Enumerated contents */ - SND_CTL_ELEM_TYPE_ENUMERATED = SNDRV_CTL_ELEM_TYPE_ENUMERATED, + SND_CTL_ELEM_TYPE_ENUMERATED, /** Bytes contents */ - SND_CTL_ELEM_TYPE_BYTES = SNDRV_CTL_ELEM_TYPE_BYTES, + SND_CTL_ELEM_TYPE_BYTES, /** IEC958 (S/PDIF) setting content */ - SND_CTL_ELEM_TYPE_IEC958 = SNDRV_CTL_ELEM_TYPE_IEC958, - SND_CTL_ELEM_TYPE_LAST = SNDRV_CTL_ELEM_TYPE_LAST, + SND_CTL_ELEM_TYPE_IEC958, + SND_CTL_ELEM_TYPE_LAST = SND_CTL_ELEM_TYPE_IEC958, } snd_ctl_elem_type_t; /** CTL related interface */ typedef enum _snd_ctl_elem_iface { /** Card level */ - SND_CTL_ELEM_IFACE_CARD = SNDRV_CTL_ELEM_IFACE_CARD, + SND_CTL_ELEM_IFACE_CARD = 0, /** Hardware dependent device */ - SND_CTL_ELEM_IFACE_HWDEP = SNDRV_CTL_ELEM_IFACE_HWDEP, + SND_CTL_ELEM_IFACE_HWDEP, /** Mixer */ - SND_CTL_ELEM_IFACE_MIXER = SNDRV_CTL_ELEM_IFACE_MIXER, + SND_CTL_ELEM_IFACE_MIXER, /** PCM */ - SND_CTL_ELEM_IFACE_PCM = SNDRV_CTL_ELEM_IFACE_PCM, + SND_CTL_ELEM_IFACE_PCM, /** RawMidi */ - SND_CTL_ELEM_IFACE_RAWMIDI = SNDRV_CTL_ELEM_IFACE_RAWMIDI, + SND_CTL_ELEM_IFACE_RAWMIDI, /** Timer */ - SND_CTL_ELEM_IFACE_TIMER = SNDRV_CTL_ELEM_IFACE_TIMER, + SND_CTL_ELEM_IFACE_TIMER, /** Sequencer */ - SND_CTL_ELEM_IFACE_SEQUENCER = SNDRV_CTL_ELEM_IFACE_SEQUENCER, - SND_CTL_ELEM_IFACE_LAST = SNDRV_CTL_ELEM_IFACE_LAST, + SND_CTL_ELEM_IFACE_SEQUENCER, + SND_CTL_ELEM_IFACE_LAST = SND_CTL_ELEM_IFACE_SEQUENCER, } snd_ctl_elem_iface_t; /** Event class */ typedef enum _snd_ctl_event_type { /** Elements related event */ - SND_CTL_EVENT_ELEM = SNDRV_CTL_EVENT_ELEM, - SND_CTL_EVENT_LAST = SNDRV_CTL_EVENT_LAST, + SND_CTL_EVENT_ELEM = 0, + SND_CTL_EVENT_LAST = SND_CTL_EVENT_ELEM, }snd_ctl_event_type_t; /** Element has been removed (Warning: test this first and if set don't - * test the other masks) \hideinitializer */ -#define SND_CTL_EVENT_MASK_REMOVE SNDRV_CTL_EVENT_MASK_REMOVE -/** Element has been added \hideinitializer */ -#define SND_CTL_EVENT_MASK_ADD SNDRV_CTL_EVENT_MASK_ADD -/** Element info has been changed \hideinitializer */ -#define SND_CTL_EVENT_MASK_INFO SNDRV_CTL_EVENT_MASK_INFO + * test the other masks) \hideinitializer */ +#define SND_CTL_EVENT_MASK_REMOVE (~0U) /** Element value has been changed \hideinitializer */ -#define SND_CTL_EVENT_MASK_VALUE SNDRV_CTL_EVENT_MASK_VALUE - +#define SND_CTL_EVENT_MASK_VALUE (1<<0) +/** Element info has been changed \hideinitializer */ +#define SND_CTL_EVENT_MASK_INFO (1<<1) +/** Element has been added \hideinitializer */ +#define SND_CTL_EVENT_MASK_ADD (1<<2) + +/** CTL name helper */ +#define SND_CTL_NAME_NONE "" +/** CTL name helper */ +#define SND_CTL_NAME_PLAYBACK "Playback " +/** CTL name helper */ +#define SND_CTL_NAME_CAPTURE "Capture " + +/** CTL name helper */ +#define SND_CTL_NAME_IEC958_NONE "" +/** CTL name helper */ +#define SND_CTL_NAME_IEC958_SWITCH "Switch" +/** CTL name helper */ +#define SND_CTL_NAME_IEC958_VOLUME "Volume" +/** CTL name helper */ +#define SND_CTL_NAME_IEC958_DEFAULT "Default" +/** CTL name helper */ +#define SND_CTL_NAME_IEC958_MASK "Mask" +/** CTL name helper */ +#define SND_CTL_NAME_IEC958_CON_MASK "Con Mask" +/** CTL name helper */ +#define SND_CTL_NAME_IEC958_PRO_MASK "Pro Mask" +/** CTL name helper */ +#define SND_CTL_NAME_IEC958_PCM_STREAM "PCM Stream" /** Element name for IEC958 (S/PDIF) */ -#define SND_CTL_NAME_IEC958 SNDRV_CTL_NAME_IEC958 +#define SND_CTL_NAME_IEC958(expl,direction,what) "IEC958 " expl SND_CTL_NAME_##direction SND_CTL_NAME_IEC958_##what + /** CTL type */ typedef enum _snd_ctl_type { diff --git a/include/global.h b/include/global.h index 8e2d56e3..42455d80 100644 --- a/include/global.h +++ b/include/global.h @@ -4,16 +4,6 @@ * \{ */ -#ifdef SNDRV_LITTLE_ENDIAN -#define SND_LITTLE_ENDIAN SNDRV_LITTLE_ENDIAN -#endif - -#ifdef SNDRV_BIG_ENDIAN -#define SND_BIG_ENDIAN SNDRV_BIG_ENDIAN -#endif - -/** \} */ - /** helper macro for SND_DLSYM_BUILD_VERSION */ #define __SND_DLSYM_VERSION(name, version) _ ## name ## version /** build version for versioned dynamic symbol */ @@ -34,3 +24,6 @@ int snd_async_add_handler(snd_async_handler_t **handler, int fd, int snd_async_del_handler(snd_async_handler_t *handler); int snd_async_handler_get_fd(snd_async_handler_t *handler); void *snd_async_handler_get_callback_private(snd_async_handler_t *handler); + +/** \} */ + diff --git a/include/header.h b/include/header.h index 44114969..fb7150c5 100644 --- a/include/header.h +++ b/include/header.h @@ -28,7 +28,6 @@ #ifndef __ASOUNDLIB_H #define __ASOUNDLIB_H -#include #include #include #include @@ -36,6 +35,7 @@ #include #include #include +#include #include #include diff --git a/include/hwdep.h b/include/hwdep.h index 48bf4be2..8743fcd7 100644 --- a/include/hwdep.h +++ b/include/hwdep.h @@ -19,14 +19,14 @@ typedef struct _snd_hwdep_info snd_hwdep_info_t; /** HwDep interface */ typedef enum _snd_hwdep_iface { - 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_OPL2 = 0, /**< 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 = SND_HWDEP_IFACE_ICS2115, /**< last know hwdep interface */ } snd_hwdep_iface_t; /** open for reading */ diff --git a/include/instr.h b/include/instr.h index 29f14799..870d458a 100644 --- a/include/instr.h +++ b/include/instr.h @@ -62,45 +62,48 @@ void snd_instr_header_set_follow_alias(snd_instr_header_t *info, int val); */ /** instrument types */ -#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 */ +#define SND_SEQ_INSTR_ATYPE_DATA 0 /**< instrument data */ +#define SND_SEQ_INSTR_ATYPE_ALIAS 1 /**< instrument alias */ /** instrument ASCII identifiers */ -#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 */ +#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 */ /** instrument types */ -#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 */ +#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 */ /** put commands */ -#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 */ +#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 */ /** get commands */ -#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 */ +#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 */ + +/* query flags */ +#define SND_SEQ_INSTR_QUERY_FOLLOW_ALIAS (1<<0) /** free commands */ -#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 */ +#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 */ /** diff --git a/include/local.h b/include/local.h index db15b0da..0905e304 100644 --- a/include/local.h +++ b/include/local.h @@ -44,7 +44,6 @@ #define _snd_hwdep_info sndrv_hwdep_info -#define _SND_SEQ_IN_LOCAL 1 #define _snd_seq_queue_tempo sndrv_seq_queue_tempo #define _snd_seq_client_info sndrv_seq_client_info #define _snd_seq_port_info sndrv_seq_port_info @@ -58,6 +57,7 @@ #define _snd_seq_remove_events sndrv_seq_remove_events #define _snd_instr_header sndrv_seq_instr_header +#if 0 typedef struct sndrv_seq_addr snd_seq_addr_t; #define snd_seq_tick_time_t sndrv_seq_tick_time_t typedef struct sndrv_seq_real_time snd_seq_real_time_t; @@ -65,6 +65,7 @@ typedef union sndrv_seq_timestamp snd_seq_timestamp_t; typedef struct sndrv_seq_instr snd_seq_instr_t; typedef struct sndrv_seq_event snd_seq_event_t; #define snd_seq_instr_cluster_t sndrv_seq_instr_cluster_t +#endif #define _snd_timer_id sndrv_timer_id #define _snd_timer_select sndrv_timer_select @@ -72,6 +73,8 @@ typedef struct sndrv_seq_event snd_seq_event_t; #define _snd_timer_params sndrv_timer_params #define _snd_timer_status sndrv_timer_status +#include +#include #include "asoundlib.h" #include "list.h" diff --git a/include/pcm.h b/include/pcm.h index 68996d7b..1bb1b37f 100644 --- a/include/pcm.h +++ b/include/pcm.h @@ -32,47 +32,47 @@ typedef struct _snd_pcm_subformat_mask snd_pcm_subformat_mask_t; /** PCM class */ typedef enum _snd_pcm_class { /** standard device */ - SND_PCM_CLASS_GENERIC = SNDRV_PCM_CLASS_GENERIC, + SND_PCM_CLASS_GENERIC = 0, /** multichannel device */ - SND_PCM_CLASS_MULTI = SNDRV_PCM_CLASS_MULTI, + SND_PCM_CLASS_MULTI, /** software modem device */ - SND_PCM_CLASS_MODEM = SNDRV_PCM_CLASS_MODEM, + SND_PCM_CLASS_MODEM, /** digitizer device */ - SND_PCM_CLASS_DIGITIZER = SNDRV_PCM_CLASS_DIGITIZER, - SND_PCM_CLASS_LAST = SNDRV_PCM_CLASS_LAST, + SND_PCM_CLASS_DIGITIZER, + SND_PCM_CLASS_LAST = SND_PCM_CLASS_DIGITIZER, } snd_pcm_class_t; /** PCM subclass */ typedef enum _snd_pcm_subclass { /** subdevices are mixed together */ - SND_PCM_SUBCLASS_GENERIC_MIX = SNDRV_PCM_SUBCLASS_GENERIC_MIX, + SND_PCM_SUBCLASS_GENERIC_MIX = 0, /** multichannel subdevices are mixed together */ - SND_PCM_SUBCLASS_MULTI_MIX = SNDRV_PCM_SUBCLASS_MULTI_MIX, - SND_PCM_SUBCLASS_LAST = SNDRV_PCM_SUBCLASS_LAST, + SND_PCM_SUBCLASS_MULTI_MIX, + SND_PCM_SUBCLASS_LAST = SND_PCM_SUBCLASS_MULTI_MIX, } snd_pcm_subclass_t; /** PCM stream (direction) */ typedef enum _snd_pcm_stream { /** Playback stream */ - SND_PCM_STREAM_PLAYBACK = SNDRV_PCM_STREAM_PLAYBACK, + SND_PCM_STREAM_PLAYBACK = 0, /** Capture stream */ - SND_PCM_STREAM_CAPTURE = SNDRV_PCM_STREAM_CAPTURE, - SND_PCM_STREAM_LAST = SNDRV_PCM_STREAM_LAST, + SND_PCM_STREAM_CAPTURE, + SND_PCM_STREAM_LAST = SND_PCM_STREAM_CAPTURE, } snd_pcm_stream_t; /** PCM access type */ typedef enum _snd_pcm_access { /** mmap access with simple interleaved channels */ - SND_PCM_ACCESS_MMAP_INTERLEAVED = SNDRV_PCM_ACCESS_MMAP_INTERLEAVED, + SND_PCM_ACCESS_MMAP_INTERLEAVED = 0, /** mmap access with simple non interleaved channels */ - SND_PCM_ACCESS_MMAP_NONINTERLEAVED = SNDRV_PCM_ACCESS_MMAP_NONINTERLEAVED, + SND_PCM_ACCESS_MMAP_NONINTERLEAVED, /** mmap access with complex placement */ - SND_PCM_ACCESS_MMAP_COMPLEX = SNDRV_PCM_ACCESS_MMAP_COMPLEX, + SND_PCM_ACCESS_MMAP_COMPLEX, /** snd_pcm_readi/snd_pcm_writei access */ - SND_PCM_ACCESS_RW_INTERLEAVED = SNDRV_PCM_ACCESS_RW_INTERLEAVED, + SND_PCM_ACCESS_RW_INTERLEAVED, /** snd_pcm_readn/snd_pcm_writen access */ - SND_PCM_ACCESS_RW_NONINTERLEAVED = SNDRV_PCM_ACCESS_RW_NONINTERLEAVED, - SND_PCM_ACCESS_LAST = SNDRV_PCM_ACCESS_LAST, + SND_PCM_ACCESS_RW_NONINTERLEAVED, + SND_PCM_ACCESS_LAST = SND_PCM_ACCESS_RW_NONINTERLEAVED, } snd_pcm_access_t; /** PCM sample format */ @@ -80,129 +80,153 @@ typedef enum _snd_pcm_format { /** Unknown */ SND_PCM_FORMAT_UNKNOWN = -1, /** Signed 8 bit */ - SND_PCM_FORMAT_S8 = SNDRV_PCM_FORMAT_S8, + SND_PCM_FORMAT_S8 = 0, /** Unsigned 8 bit */ - SND_PCM_FORMAT_U8 = SNDRV_PCM_FORMAT_U8, + SND_PCM_FORMAT_U8, /** Signed 16 bit Little Endian */ - SND_PCM_FORMAT_S16_LE = SNDRV_PCM_FORMAT_S16_LE, + SND_PCM_FORMAT_S16_LE, /** Signed 16 bit Big Endian */ - SND_PCM_FORMAT_S16_BE = SNDRV_PCM_FORMAT_S16_BE, + SND_PCM_FORMAT_S16_BE, /** Unsigned 16 bit Little Endian */ - SND_PCM_FORMAT_U16_LE = SNDRV_PCM_FORMAT_U16_LE, + SND_PCM_FORMAT_U16_LE, /** Unsigned 16 bit Big Endian */ - SND_PCM_FORMAT_U16_BE = SNDRV_PCM_FORMAT_U16_BE, + SND_PCM_FORMAT_U16_BE, /** Signed 24 bit Little Endian */ - SND_PCM_FORMAT_S24_LE = SNDRV_PCM_FORMAT_S24_LE, + SND_PCM_FORMAT_S24_LE, /** Signed 24 bit Big Endian */ - SND_PCM_FORMAT_S24_BE = SNDRV_PCM_FORMAT_S24_BE, + SND_PCM_FORMAT_S24_BE, /** Unsigned 24 bit Little Endian */ - SND_PCM_FORMAT_U24_LE = SNDRV_PCM_FORMAT_U24_LE, + SND_PCM_FORMAT_U24_LE, /** Unsigned 24 bit Big Endian */ - SND_PCM_FORMAT_U24_BE = SNDRV_PCM_FORMAT_U24_BE, + SND_PCM_FORMAT_U24_BE, /** Signed 32 bit Little Endian */ - SND_PCM_FORMAT_S32_LE = SNDRV_PCM_FORMAT_S32_LE, + SND_PCM_FORMAT_S32_LE, /** Signed 32 bit Big Endian */ - SND_PCM_FORMAT_S32_BE = SNDRV_PCM_FORMAT_S32_BE, + SND_PCM_FORMAT_S32_BE, /** Unsigned 32 bit Little Endian */ - SND_PCM_FORMAT_U32_LE = SNDRV_PCM_FORMAT_U32_LE, + SND_PCM_FORMAT_U32_LE, /** Unsigned 32 bit Big Endian */ - SND_PCM_FORMAT_U32_BE = SNDRV_PCM_FORMAT_U32_BE, + SND_PCM_FORMAT_U32_BE, /** Float 32 bit Little Endian */ - SND_PCM_FORMAT_FLOAT_LE = SNDRV_PCM_FORMAT_FLOAT_LE, + SND_PCM_FORMAT_FLOAT_LE, /** Float 32 bit Big Endian */ - SND_PCM_FORMAT_FLOAT_BE = SNDRV_PCM_FORMAT_FLOAT_BE, + SND_PCM_FORMAT_FLOAT_BE, /** Float 64 bit Little Endian */ - SND_PCM_FORMAT_FLOAT64_LE = SNDRV_PCM_FORMAT_FLOAT64_LE, + SND_PCM_FORMAT_FLOAT64_LE, /** Float 64 bit Big Endian */ - SND_PCM_FORMAT_FLOAT64_BE = SNDRV_PCM_FORMAT_FLOAT64_BE, + SND_PCM_FORMAT_FLOAT64_BE, /** IEC-958 Little Endian */ - SND_PCM_FORMAT_IEC958_SUBFRAME_LE = SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE, + SND_PCM_FORMAT_IEC958_SUBFRAME_LE, /** IEC-958 Big Endian */ - SND_PCM_FORMAT_IEC958_SUBFRAME_BE = SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE, + SND_PCM_FORMAT_IEC958_SUBFRAME_BE, /** Mu-Law */ - SND_PCM_FORMAT_MU_LAW = SNDRV_PCM_FORMAT_MU_LAW, + SND_PCM_FORMAT_MU_LAW, /** A-Law */ - SND_PCM_FORMAT_A_LAW = SNDRV_PCM_FORMAT_A_LAW, + SND_PCM_FORMAT_A_LAW, /** Ima-ADPCM */ - SND_PCM_FORMAT_IMA_ADPCM = SNDRV_PCM_FORMAT_IMA_ADPCM, + SND_PCM_FORMAT_IMA_ADPCM, /** MPEG */ - SND_PCM_FORMAT_MPEG = SNDRV_PCM_FORMAT_MPEG, + SND_PCM_FORMAT_MPEG, /** GSM */ - SND_PCM_FORMAT_GSM = SNDRV_PCM_FORMAT_GSM, + SND_PCM_FORMAT_GSM, /** Special */ - SND_PCM_FORMAT_SPECIAL = SNDRV_PCM_FORMAT_SPECIAL, - SND_PCM_FORMAT_LAST = SNDRV_PCM_FORMAT_LAST, + SND_PCM_FORMAT_SPECIAL = 31, + SND_PCM_FORMAT_LAST = SND_PCM_FORMAT_SPECIAL, + +#if __BYTE_ORDER == __LITTLE_ENDIAN /** Signed 16 bit CPU endian */ - SND_PCM_FORMAT_S16 = SNDRV_PCM_FORMAT_S16, + SND_PCM_FORMAT_S16 = SND_PCM_FORMAT_S16_LE, /** Unsigned 16 bit CPU endian */ - SND_PCM_FORMAT_U16 = SNDRV_PCM_FORMAT_U16, + SND_PCM_FORMAT_U16 = SND_PCM_FORMAT_U16_LE, /** Signed 24 bit CPU endian */ - SND_PCM_FORMAT_S24 = SNDRV_PCM_FORMAT_S24, + SND_PCM_FORMAT_S24 = SND_PCM_FORMAT_S24_LE, /** Unsigned 24 bit CPU endian */ - SND_PCM_FORMAT_U24 = SNDRV_PCM_FORMAT_U24, + SND_PCM_FORMAT_U24 = SND_PCM_FORMAT_U24_LE, /** Signed 32 bit CPU endian */ - SND_PCM_FORMAT_S32 = SNDRV_PCM_FORMAT_S32, + SND_PCM_FORMAT_S32 = SND_PCM_FORMAT_S32_LE, /** Unsigned 32 bit CPU endian */ - SND_PCM_FORMAT_U32 = SNDRV_PCM_FORMAT_U32, + SND_PCM_FORMAT_U32 = SND_PCM_FORMAT_U32_LE, /** Float 32 bit CPU endian */ - SND_PCM_FORMAT_FLOAT = SNDRV_PCM_FORMAT_FLOAT, + SND_PCM_FORMAT_FLOAT = SND_PCM_FORMAT_FLOAT_LE, /** Float 64 bit CPU endian */ - SND_PCM_FORMAT_FLOAT64 = SNDRV_PCM_FORMAT_FLOAT64, + SND_PCM_FORMAT_FLOAT64 = SND_PCM_FORMAT_FLOAT64_LE, /** IEC-958 CPU Endian */ - SND_PCM_FORMAT_IEC958_SUBFRAME = SNDRV_PCM_FORMAT_IEC958_SUBFRAME, + SND_PCM_FORMAT_IEC958_SUBFRAME = SND_PCM_FORMAT_IEC958_SUBFRAME_LE, +#elif __BYTE_ORDER == __BIG_ENDIAN + /** Signed 16 bit CPU endian */ + SND_PCM_FORMAT_S16 = SND_PCM_FORMAT_S16_BE, + /** Unsigned 16 bit CPU endian */ + SND_PCM_FORMAT_U16 = SND_PCM_FORMAT_U16_BE, + /** Signed 24 bit CPU endian */ + SND_PCM_FORMAT_S24 = SND_PCM_FORMAT_S24_BE, + /** Unsigned 24 bit CPU endian */ + SND_PCM_FORMAT_U24 = SND_PCM_FORMAT_U24_BE, + /** Signed 32 bit CPU endian */ + SND_PCM_FORMAT_S32 = SND_PCM_FORMAT_S32_BE, + /** Unsigned 32 bit CPU endian */ + SND_PCM_FORMAT_U32 = SND_PCM_FORMAT_U32_BE, + /** Float 32 bit CPU endian */ + SND_PCM_FORMAT_FLOAT = SND_PCM_FORMAT_FLOAT_BE, + /** Float 64 bit CPU endian */ + SND_PCM_FORMAT_FLOAT64 = SND_PCM_FORMAT_FLOAT64_BE, + /** IEC-958 CPU Endian */ + SND_PCM_FORMAT_IEC958_SUBFRAME = SND_PCM_FORMAT_IEC958_SUBFRAME_BE, +#else +#error "Unknown endian" +#endif } snd_pcm_format_t; /** PCM sample subformat */ typedef enum _snd_pcm_subformat { /** Standard */ - SND_PCM_SUBFORMAT_STD = SNDRV_PCM_SUBFORMAT_STD, - SND_PCM_SUBFORMAT_LAST = SNDRV_PCM_SUBFORMAT_LAST, + SND_PCM_SUBFORMAT_STD = 0, + SND_PCM_SUBFORMAT_LAST = SND_PCM_SUBFORMAT_STD, } snd_pcm_subformat_t; /** PCM state */ typedef enum _snd_pcm_state { /** Open */ - SND_PCM_STATE_OPEN = SNDRV_PCM_STATE_OPEN, + SND_PCM_STATE_OPEN = 0, /** Setup installed */ - SND_PCM_STATE_SETUP = SNDRV_PCM_STATE_SETUP, + SND_PCM_STATE_SETUP, /** Ready to start */ - SND_PCM_STATE_PREPARED = SNDRV_PCM_STATE_PREPARED, + SND_PCM_STATE_PREPARED, /** Running */ - SND_PCM_STATE_RUNNING = SNDRV_PCM_STATE_RUNNING, + SND_PCM_STATE_RUNNING, /** Stopped: underrun (playback) or overrun (capture) detected */ - SND_PCM_STATE_XRUN = SNDRV_PCM_STATE_XRUN, + SND_PCM_STATE_XRUN, /** Draining: running (playback) or stopped (capture) */ - SND_PCM_STATE_DRAINING = SNDRV_PCM_STATE_DRAINING, + SND_PCM_STATE_DRAINING, /** Paused */ - SND_PCM_STATE_PAUSED = SNDRV_PCM_STATE_PAUSED, - SND_PCM_STATE_LAST = SNDRV_PCM_STATE_LAST, + SND_PCM_STATE_PAUSED, + SND_PCM_STATE_LAST = SND_PCM_STATE_PAUSED, } snd_pcm_state_t; /** PCM start mode */ typedef enum _snd_pcm_start { /** Automatic start on data read/write */ - SND_PCM_START_DATA, + SND_PCM_START_DATA = 0, /** Explicit start */ SND_PCM_START_EXPLICIT, - SND_PCM_START_LAST, + SND_PCM_START_LAST = SND_PCM_START_EXPLICIT, } snd_pcm_start_t; /** PCM xrun mode */ typedef enum _snd_pcm_xrun { /** Xrun detection disabled */ - SND_PCM_XRUN_NONE, + SND_PCM_XRUN_NONE = 0, /** Stop on xrun detection */ SND_PCM_XRUN_STOP, - SND_PCM_XRUN_LAST, + SND_PCM_XRUN_LAST = SND_PCM_XRUN_STOP, } snd_pcm_xrun_t; /** PCM timestamp mode */ typedef enum _snd_pcm_tstamp { /** No timestamp */ - SND_PCM_TSTAMP_NONE = SNDRV_PCM_TSTAMP_NONE, + SND_PCM_TSTAMP_NONE = 0, /** Update mmap'ed timestamp */ - SND_PCM_TSTAMP_MMAP = SNDRV_PCM_TSTAMP_MMAP, - SND_PCM_TSTAMP_LAST = SNDRV_PCM_TSTAMP_LAST, + SND_PCM_TSTAMP_MMAP, + SND_PCM_TSTAMP_LAST = SND_PCM_TSTAMP_MMAP, } snd_pcm_tstamp_t; /** Unsigned frames quantity */ @@ -223,7 +247,7 @@ typedef struct _snd_pcm snd_pcm_t; /** PCM type */ enum _snd_pcm_type { /** Kernel level PCM */ - SND_PCM_TYPE_HW, + SND_PCM_TYPE_HW = 0, /** Hooked PCM */ SND_PCM_TYPE_HOOKS, /** One ore more linked PCM with exclusive access to selected @@ -725,7 +749,7 @@ void snd_pcm_info_set_stream(snd_pcm_info_t *obj, snd_pcm_stream_t val); /** type of pcm hook */ typedef enum _snd_pcm_hook_type { - SND_PCM_HOOK_TYPE_HW_PARAMS, + SND_PCM_HOOK_TYPE_HW_PARAMS = 0, SND_PCM_HOOK_TYPE_HW_FREE, SND_PCM_HOOK_TYPE_CLOSE, SND_PCM_HOOK_TYPE_LAST = SND_PCM_HOOK_TYPE_CLOSE, diff --git a/include/rawmidi.h b/include/rawmidi.h index e7e6f8a3..779dce63 100644 --- a/include/rawmidi.h +++ b/include/rawmidi.h @@ -24,10 +24,10 @@ typedef struct _snd_rawmidi_status snd_rawmidi_status_t; /** RawMidi stream (direction) */ typedef enum _snd_rawmidi_stream { /** Output stream */ - SND_RAWMIDI_STREAM_OUTPUT = SNDRV_RAWMIDI_STREAM_OUTPUT, + SND_RAWMIDI_STREAM_OUTPUT = 0, /** Input stream */ - SND_RAWMIDI_STREAM_INPUT = SNDRV_RAWMIDI_STREAM_INPUT, - SND_RAWMIDI_STREAM_LAST = SNDRV_RAWMIDI_STREAM_LAST, + SND_RAWMIDI_STREAM_INPUT, + SND_RAWMIDI_STREAM_LAST = SND_RAWMIDI_STREAM_INPUT, } snd_rawmidi_stream_t; /** Append \hideinitializer */ diff --git a/include/seq_event.h b/include/seq_event.h index 00cb953e..518e316c 100644 --- a/include/seq_event.h +++ b/include/seq_event.h @@ -210,10 +210,6 @@ enum snd_seq_event_type { }; -#ifdef _SND_SEQ_IN_LOCAL -#include -#else - /** Sequencer event address */ typedef struct snd_seq_addr { unsigned char client; /**< Client id */ @@ -429,7 +425,5 @@ typedef struct snd_seq_event { } data; /**< event data... */ } snd_seq_event_t; -#endif /* _SND_SEQ_IN_LOCAL */ - /** \} */ diff --git a/include/timer.h b/include/timer.h index 8a25e146..ba28d44b 100644 --- a/include/timer.h +++ b/include/timer.h @@ -29,27 +29,27 @@ typedef struct sndrv_timer_read snd_timer_read_t; /** timer master class */ typedef enum _snd_timer_class { - SND_TIMER_CLASS_NONE = SNDRV_TIMER_CLASS_NONE, /**< invalid */ - SND_TIMER_CLASS_SLAVE = SNDRV_TIMER_CLASS_SLAVE, /**< slave timer */ - SND_TIMER_CLASS_GLOBAL = SNDRV_TIMER_CLASS_GLOBAL, /**< global timer */ - SND_TIMER_CLASS_CARD = SNDRV_TIMER_CLASS_CARD, /**< card timer */ - SND_TIMER_CLASS_PCM = SNDRV_TIMER_CLASS_PCM, /**< PCM timer */ - SND_TIMER_CLASS_LAST = SNDRV_TIMER_CLASS_LAST, /**< last timer */ + SND_TIMER_CLASS_NONE = -1, /**< invalid */ + SND_TIMER_CLASS_SLAVE = 0, /**< slave timer */ + SND_TIMER_CLASS_GLOBAL, /**< global timer */ + SND_TIMER_CLASS_CARD, /**< card timer */ + SND_TIMER_CLASS_PCM, /**< PCM timer */ + SND_TIMER_CLASS_LAST = SND_TIMER_CLASS_PCM, /**< last timer */ } snd_timer_class_t; /** timer slave class */ typedef enum _snd_timer_slave_class { - SND_TIMER_SCLASS_NONE = SNDRV_TIMER_SCLASS_NONE, /**< none */ - SND_TIMER_SCLASS_APPLICATION = SNDRV_TIMER_SCLASS_APPLICATION, /**< for internal use */ - SND_TIMER_SCLASS_SEQUENCER = SNDRV_TIMER_SCLASS_SEQUENCER, /**< sequencer timer */ - SND_TIMER_SCLASS_OSS_SEQUENCER = SNDRV_TIMER_SCLASS_OSS_SEQUENCER, /**< OSS sequencer timer */ - SND_TIMER_SCLASS_LAST = SNDRV_TIMER_SCLASS_LAST, /**< last slave timer */ + SND_TIMER_SCLASS_NONE = 0, /**< none */ + SND_TIMER_SCLASS_APPLICATION, /**< for internal use */ + SND_TIMER_SCLASS_SEQUENCER, /**< sequencer timer */ + SND_TIMER_SCLASS_OSS_SEQUENCER, /**< OSS sequencer timer */ + SND_TIMER_SCLASS_LAST = SND_TIMER_SCLASS_OSS_SEQUENCER, /**< last slave timer */ } snd_timer_slave_class_t; /** global timer - system */ -#define SND_TIMER_GLOBAL_SYSTEM SNDRV_TIMER_GLOBAL_SYSTEM +#define SND_TIMER_GLOBAL_SYSTEM 0 /** global timer - RTC */ -#define SND_TIMER_GLOBAL_RTC SNDRV_TIMER_GLOBAL_RTC +#define SND_TIMER_GLOBAL_RTC 1 /** timer open mode flag - nonblock */ #define SND_TIMER_OPEN_NONBLOCK 1 @@ -57,7 +57,7 @@ typedef enum _snd_timer_slave_class { /** timer handle type */ typedef enum _snd_timer_type { /** Kernel level HwDep */ - SND_TIMER_TYPE_HW, + SND_TIMER_TYPE_HW = 0, /** Shared memory client timer (not yet implemented) */ SND_TIMER_TYPE_SHM, /** INET client timer (not yet implemented) */ diff --git a/src/pcm/pcm_plug.c b/src/pcm/pcm_plug.c index 378ff8a4..00c4af7f 100644 --- a/src/pcm/pcm_plug.c +++ b/src/pcm/pcm_plug.c @@ -26,7 +26,7 @@ enum snd_pcm_plug_route_policy { PLUG_ROUTE_POLICY_NONE, PLUG_ROUTE_POLICY_DEFAULT, PLUG_ROUTE_POLICY_COPY, - PLUG_ROUTE_POLICY_SUM, + PLUG_ROUTE_POLICY_AVERAGE, PLUG_ROUTE_POLICY_DUP, }; @@ -263,10 +263,12 @@ static int snd_pcm_plug_change_channels(snd_pcm_t *pcm, snd_pcm_t **new, snd_pcm if (rpolicy == PLUG_ROUTE_POLICY_DEFAULT) { rpolicy = PLUG_ROUTE_POLICY_COPY; if (pcm->stream == SND_PCM_STREAM_CAPTURE && clt->channels == 1) - rpolicy = PLUG_ROUTE_POLICY_SUM; + rpolicy = PLUG_ROUTE_POLICY_AVERAGE; + if (pcm->stream == SND_PCM_STREAM_PLAYBACK && slv->channels == 1) + rpolicy = PLUG_ROUTE_POLICY_AVERAGE; } switch (rpolicy) { - case PLUG_ROUTE_POLICY_SUM: + case PLUG_ROUTE_POLICY_AVERAGE: case PLUG_ROUTE_POLICY_DUP: if (clt->channels > slv->channels) { n = clt->channels; @@ -275,7 +277,7 @@ static int snd_pcm_plug_change_channels(snd_pcm_t *pcm, snd_pcm_t **new, snd_pcm } while (n-- > 0) { snd_pcm_route_ttable_entry_t v = FULL; - if (rpolicy == PLUG_ROUTE_POLICY_SUM) { + if (rpolicy == PLUG_ROUTE_POLICY_AVERAGE) { if (pcm->stream == SND_PCM_STREAM_PLAYBACK && clt->channels > slv->channels) { int srcs = clt->channels / slv->channels; @@ -822,8 +824,8 @@ int _snd_pcm_plug_open(snd_pcm_t **pcmp, const char *name, SNDERR("Table is defined, route policy is ignored"); if (!strcmp(str, "default")) route_policy = PLUG_ROUTE_POLICY_DEFAULT; - else if (!strcmp(str, "sum")) - route_policy = PLUG_ROUTE_POLICY_SUM; + else if (!strcmp(str, "average")) + route_policy = PLUG_ROUTE_POLICY_AVERAGE; else if (!strcmp(str, "copy")) route_policy = PLUG_ROUTE_POLICY_COPY; else if (!strcmp(str, "duplicate")) diff --git a/src/seq/seq.c b/src/seq/seq.c index 1fa300a3..b22d3da9 100644 --- a/src/seq/seq.c +++ b/src/seq/seq.c @@ -902,7 +902,7 @@ int snd_seq_port_info_get_port(const snd_seq_port_info_t *info) const snd_seq_addr_t *snd_seq_port_info_get_addr(const snd_seq_port_info_t *info) { assert(info); - return &info->addr; + return (snd_seq_addr_t *)&info->addr; } /** @@ -1034,7 +1034,7 @@ void snd_seq_port_info_set_port(snd_seq_port_info_t *info, int port) void snd_seq_port_info_set_addr(snd_seq_port_info_t *info, const snd_seq_addr_t *addr) { assert(info); - info->addr = *addr; + info->addr = *(struct sndrv_seq_addr *)addr; } /** @@ -1308,7 +1308,7 @@ void snd_seq_port_subscribe_copy(snd_seq_port_subscribe_t *dst, const snd_seq_po const snd_seq_addr_t *snd_seq_port_subscribe_get_sender(const snd_seq_port_subscribe_t *info) { assert(info); - return &info->sender; + return (snd_seq_addr_t *)&info->sender; } /** @@ -1319,7 +1319,7 @@ const snd_seq_addr_t *snd_seq_port_subscribe_get_sender(const snd_seq_port_subsc const snd_seq_addr_t *snd_seq_port_subscribe_get_dest(const snd_seq_port_subscribe_t *info) { assert(info); - return &info->dest; + return (snd_seq_addr_t *)&info->dest; } /** @@ -1559,7 +1559,7 @@ int snd_seq_query_subscribe_get_port(const snd_seq_query_subscribe_t *info) const snd_seq_addr_t *snd_seq_query_subscribe_get_root(const snd_seq_query_subscribe_t *info) { assert(info); - return &info->root; + return (snd_seq_addr_t *)&info->root; } /** @@ -1603,7 +1603,7 @@ int snd_seq_query_subscribe_get_num_subs(const snd_seq_query_subscribe_t *info) const snd_seq_addr_t *snd_seq_query_subscribe_get_addr(const snd_seq_query_subscribe_t *info) { assert(info); - return &info->addr; + return (snd_seq_addr_t *)&info->addr; } /** @@ -1680,7 +1680,7 @@ void snd_seq_query_subscribe_set_port(snd_seq_query_subscribe_t *info, int port) void snd_seq_query_subscribe_set_root(snd_seq_query_subscribe_t *info, const snd_seq_addr_t *addr) { assert(info); - info->root = *addr; + info->root = *(struct sndrv_seq_addr *)addr; } /** @@ -2104,7 +2104,7 @@ snd_seq_tick_time_t snd_seq_queue_status_get_tick_time(const snd_seq_queue_statu const snd_seq_real_time_t *snd_seq_queue_status_get_real_time(const snd_seq_queue_status_t *info) { assert(info); - return &info->time; + return (snd_seq_real_time_t *)&info->time; } /** @@ -2893,7 +2893,7 @@ int snd_seq_remove_events_get_queue(const snd_seq_remove_events_t *info) const snd_seq_timestamp_t *snd_seq_remove_events_get_time(const snd_seq_remove_events_t *info) { assert(info); - return &info->time; + return (snd_seq_timestamp_t *)&info->time; } /** @@ -2904,7 +2904,7 @@ const snd_seq_timestamp_t *snd_seq_remove_events_get_time(const snd_seq_remove_e const snd_seq_addr_t *snd_seq_remove_events_get_dest(const snd_seq_remove_events_t *info) { assert(info); - return &info->dest; + return (snd_seq_addr_t *)&info->dest; } /** @@ -2970,7 +2970,7 @@ void snd_seq_remove_events_set_queue(snd_seq_remove_events_t *info, int queue) void snd_seq_remove_events_set_time(snd_seq_remove_events_t *info, const snd_seq_timestamp_t *time) { assert(info); - info->time = *time; + info->time = *(union sndrv_seq_timestamp *)time; } /** @@ -2981,7 +2981,7 @@ void snd_seq_remove_events_set_time(snd_seq_remove_events_t *info, const snd_seq void snd_seq_remove_events_set_dest(snd_seq_remove_events_t *info, const snd_seq_addr_t *addr) { assert(info); - info->dest = *addr; + info->dest = *(struct sndrv_seq_addr *)addr; } /** @@ -3020,13 +3020,13 @@ void snd_seq_remove_events_set_tag(snd_seq_remove_events_t *info, int tag) /* compare timestamp between events */ /* return 1 if a >= b; otherwise return 0 */ -static inline int snd_seq_compare_tick_time(sndrv_seq_tick_time_t *a, sndrv_seq_tick_time_t *b) +static inline int snd_seq_compare_tick_time(snd_seq_tick_time_t *a, snd_seq_tick_time_t *b) { /* compare ticks */ return (*a >= *b); } -static inline int snd_seq_compare_real_time(struct sndrv_seq_real_time *a, struct sndrv_seq_real_time *b) +static inline int snd_seq_compare_real_time(snd_seq_real_time_t *a, snd_seq_real_time_t *b) { /* compare real time */ if (a->tv_sec > b->tv_sec) @@ -3055,17 +3055,17 @@ static int remove_match(snd_seq_remove_events_t *info, snd_seq_event_t *ev) } if (info->remove_mode & SNDRV_SEQ_REMOVE_TIME_AFTER) { if (info->remove_mode & SNDRV_SEQ_REMOVE_TIME_TICK) - res = snd_seq_compare_tick_time(&ev->time.tick, &info->time.tick); + res = snd_seq_compare_tick_time(&ev->time.tick, (snd_seq_tick_time_t *)&info->time.tick); else - res = snd_seq_compare_real_time(&ev->time.time, &info->time.time); + res = snd_seq_compare_real_time(&ev->time.time, (snd_seq_real_time_t *)&info->time.time); if (!res) return 0; } if (info->remove_mode & SNDRV_SEQ_REMOVE_TIME_BEFORE) { if (info->remove_mode & SNDRV_SEQ_REMOVE_TIME_TICK) - res = snd_seq_compare_tick_time(&ev->time.tick, &info->time.tick); + res = snd_seq_compare_tick_time(&ev->time.tick, (snd_seq_tick_time_t *)&info->time.tick); else - res = snd_seq_compare_real_time(&ev->time.time, &info->time.time); + res = snd_seq_compare_real_time(&ev->time.time, (snd_seq_real_time_t *)&info->time.time); if (res) return 0; } @@ -3411,7 +3411,7 @@ void snd_instr_header_copy(snd_instr_header_t *dst, const snd_instr_header_t *sr const snd_seq_instr_t *snd_instr_header_get_id(const snd_instr_header_t *info) { assert(info); - return &info->id.instr; + return (snd_seq_instr_t *)&info->id.instr; } /** @@ -3488,7 +3488,7 @@ const char *snd_instr_header_get_format(const snd_instr_header_t *info) const snd_seq_instr_t *snd_instr_header_get_alias(const snd_instr_header_t *info) { assert(info); - return &info->data.data.alias; + return (snd_seq_instr_t *)&info->data.data.alias; } /** @@ -3521,7 +3521,7 @@ int snd_instr_header_get_follow_alias(const snd_instr_header_t *info) void snd_instr_header_set_id(snd_instr_header_t *info, const snd_seq_instr_t *id) { assert(info && id); - info->id.instr = *id; + info->id.instr = *(struct sndrv_seq_instr *)id; } /** @@ -3598,7 +3598,7 @@ void snd_instr_header_set_format(snd_instr_header_t *info, const char *format) void snd_instr_header_set_alias(snd_instr_header_t *info, const snd_seq_instr_t *instr) { assert(info && instr); - info->data.data.alias = *instr; + info->data.data.alias = *(struct sndrv_seq_instr *)instr; } /** diff --git a/src/seq/seq_event.c b/src/seq/seq_event.c index 5f6c6ee7..d0fbdad0 100644 --- a/src/seq/seq_event.c +++ b/src/seq/seq_event.c @@ -5,7 +5,7 @@ * \date 2001 */ -#include "../../include/asoundlib.h" +#include "local.h" #ifndef DOC_HIDDEN #define FIXED_EV(x) (_SND_SEQ_TYPE(SND_SEQ_EVFLG_FIXED) | _SND_SEQ_TYPE(x)) diff --git a/test/Makefile.am b/test/Makefile.am index f36e4e8f..cff0eb96 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,4 +1,4 @@ -check_PROGRAMS=control mixer switches pause pcm pcmtest latency seq \ +check_PROGRAMS=control mixer switches pause pcm latency seq \ playmidi1 timer loopback rawmidi midiloop cardid control_LDADD=../src/libasound.la @@ -6,7 +6,6 @@ mixer_LDADD=../src/libasound.la switches_LDADD=../src/libasound.la pause_LDADD=../src/libasound.la pcm_LDADD=../src/libasound.la -pcmtest_LDADD=../src/libasound.la latency_LDADD=../src/libasound.la seq_LDADD=../src/libasound.la playmidi1_LDADD=../src/libasound.la diff --git a/test/pcmtest.c b/test/pcmtest.c deleted file mode 100644 index c32d5af7..00000000 --- a/test/pcmtest.c +++ /dev/null @@ -1,178 +0,0 @@ -#include -#include -#include "../include/asoundlib.h" - -void info_channel(snd_pcm_t *handle, int channel, char *id) -{ - snd_pcm_stream_info_t stream_info; - int err; - - bzero(&stream_info, sizeof(stream_info)); - stream_info.channel = channel; - if ((err = snd_pcm_stream_info(handle, &stream_info))<0) { - fprintf(stderr, "channel info error: %s\n", snd_strerror(err)); - return; - } - printf("%s INFO:\n", id); - printf(" subdevice : %i\n", stream_info.subdevice); - printf(" subname : '%s'\n", stream_info.subname); - printf(" channel : %i\n", stream_info.channel); - printf(" mode : "); - switch (stream_info.mode) { - case SND_PCM_MODE_FRAME: - printf("frame\n"); - break; - case SND_PCM_MODE_FRAGMENT: - printf("fragment\n"); - break; - default: - printf("unknown\n"); - } - printf(" sync : 0x%x, 0x%x, 0x%x, 0x%x\n", - stream_info.sync.id32[0], - stream_info.sync.id32[1], - stream_info.sync.id32[2], - stream_info.sync.id32[3]); - printf(" flags :"); - if (stream_info.flags & SND_PCM_STREAM_INFO_MMAP) - printf(" mmap"); - if (stream_info.flags & SND_PCM_STREAM_INFO_FRAME) - printf(" frame"); - if (stream_info.flags & SND_PCM_STREAM_INFO_FRAGMENT) - printf(" fragment"); - if (stream_info.flags & SND_PCM_STREAM_INFO_BATCH) - printf(" batch"); - if (stream_info.flags & SND_PCM_STREAM_INFO_INTERLEAVE) - printf(" interleave"); - if (stream_info.flags & SND_PCM_STREAM_INFO_NONINTERLEAVE) - printf(" noninterleave"); - if (stream_info.flags & SND_PCM_STREAM_INFO_BLOCK_TRANSFER) - printf(" block_transfer"); - if (stream_info.flags & SND_PCM_STREAM_INFO_OVERRANGE) - printf(" overrange"); - printf("\n"); - printf(" formats :"); - if (stream_info.formats & SND_PCM_FMTBIT_MU_LAW) - printf(" mu-Law"); - if (stream_info.formats & SND_PCM_FMTBIT_A_LAW) - printf(" a-Law"); - if (stream_info.formats & SND_PCM_FMTBIT_IMA_ADPCM) - printf(" IMA-ADPCM"); - if (stream_info.formats & SND_PCM_FMTBIT_U8) - printf(" U8"); - if (stream_info.formats & SND_PCM_FMTBIT_S16_LE) - printf(" S16-LE"); - if (stream_info.formats & SND_PCM_FMTBIT_S16_BE) - printf(" S16-BE"); - if (stream_info.formats & SND_PCM_FMTBIT_S8) - printf(" S8"); - if (stream_info.formats & SND_PCM_FMTBIT_U16_LE) - printf(" U16-LE"); - if (stream_info.formats & SND_PCM_FMTBIT_U16_BE) - printf(" U16-BE"); - if (stream_info.formats & SND_PCM_FMTBIT_MPEG) - printf(" MPEG"); - if (stream_info.formats & SND_PCM_FMTBIT_GSM) - printf(" GSM"); - if (stream_info.formats & SND_PCM_FMTBIT_S24_LE) - printf(" S24-LE"); - if (stream_info.formats & SND_PCM_FMTBIT_S24_BE) - printf(" S24-BE"); - if (stream_info.formats & SND_PCM_FMTBIT_U24_LE) - printf(" U24-LE"); - if (stream_info.formats & SND_PCM_FMTBIT_U24_BE) - printf(" U24-BE"); - if (stream_info.formats & SND_PCM_FMTBIT_S32_LE) - printf(" S32-LE"); - if (stream_info.formats & SND_PCM_FMTBIT_S32_BE) - printf(" S32-BE"); - if (stream_info.formats & SND_PCM_FMTBIT_U32_LE) - printf(" U32-LE"); - if (stream_info.formats & SND_PCM_FMTBIT_U32_BE) - printf(" U32-BE"); - if (stream_info.formats & SND_PCM_FMTBIT_FLOAT) - printf(" Float"); - if (stream_info.formats & SND_PCM_FMTBIT_FLOAT64) - printf(" Float64"); - if (stream_info.formats & SND_PCM_FMTBIT_IEC958_SUBFRAME_LE) - printf(" IEC958-LE"); - if (stream_info.formats & SND_PCM_FMTBIT_IEC958_SUBFRAME_BE) - printf(" IEC958-BE"); - if (stream_info.formats & SND_PCM_FMTBIT_SPECIAL) - printf(" Special"); - printf("\n"); - printf(" rates :"); - if (stream_info.rates & SND_PCM_RATE_CONTINUOUS) - printf(" Continuous"); - if (stream_info.rates & SND_PCM_RATE_KNOT) - printf(" Knot"); - if (stream_info.rates & SND_PCM_RATE_8000) - printf(" 8000"); - if (stream_info.rates & SND_PCM_RATE_11025) - printf(" 11025"); - if (stream_info.rates & SND_PCM_RATE_16000) - printf(" 16000"); - if (stream_info.rates & SND_PCM_RATE_22050) - printf(" 22050"); - if (stream_info.rates & SND_PCM_RATE_32000) - printf(" 32000"); - if (stream_info.rates & SND_PCM_RATE_44100) - printf(" 44100"); - if (stream_info.rates & SND_PCM_RATE_48000) - printf(" 48000"); - if (stream_info.rates & SND_PCM_RATE_88200) - printf(" 88200"); - if (stream_info.rates & SND_PCM_RATE_96000) - printf(" 96000"); - if (stream_info.rates & SND_PCM_RATE_176400) - printf(" 176400"); - if (stream_info.rates & SND_PCM_RATE_192000) - printf(" 192000"); - printf("\n"); - printf(" min_rate : %i\n", stream_info.min_rate); - printf(" max_rate : %i\n", stream_info.max_rate); - printf(" min_channels : %i\n", stream_info.min_channels); - printf(" max_channels : %i\n", stream_info.max_channels); - printf(" buffer_size : %i\n", stream_info.buffer_size); - printf(" min_frag_size : %i\n", stream_info.min_fragment_size); - printf(" max_frag_size : %i\n", stream_info.max_fragment_size); - printf(" fragment_align : %i\n", stream_info.fragment_align); - printf(" fifo_size : %i\n", stream_info.fifo_size); - printf(" mmap_size : %li\n", stream_info.mmap_size); - printf(" mixer_device : %i\n", stream_info.mixer_device); - printf(" mixer_eid : '%s',%i,%i\n", stream_info.mixer_eid.name, stream_info.mixer_eid.index, stream_info.mixer_eid.type); -} - -void info(void) -{ - snd_pcm_t *handle; - snd_pcm_info_t info; - int err; - - if ((err = snd_pcm_open(&handle, 0, 0, SND_PCM_OPEN_DUPLEX))<0) { - fprintf(stderr, "open error: %s\n", snd_strerror(err)); - return; - } - if ((err = snd_pcm_info(handle, &info))<0) { - fprintf(stderr, "pcm info error: %s\n", snd_strerror(err)); - return; - } - printf("INFO:\n"); - printf(" type : 0x%x\n", info.type); - printf(" flags : 0x%x\n", info.flags); - printf(" id : '%s'\n", info.id); - printf(" name : '%s'\n", info.name); - printf(" playback : %i\n", info.playback); - printf(" capture : %i\n", info.capture); - if (info.flags & SND_PCM_INFO_PLAYBACK) - info_channel(handle, SND_PCM_STREAM_PLAYBACK, "Playback"); - if (info.flags & SND_PCM_INFO_CAPTURE) - info_channel(handle, SND_PCM_STREAM_CAPTURE, "Capture"); - snd_pcm_close(handle); -} - -int main(void ) -{ - info(); - return 0; -}