Encapsulated hwdep. Converted all enums to type safety

This commit is contained in:
Abramo Bagnara 2001-02-05 15:44:42 +00:00
parent a83b209df2
commit 5bf23ae9a1
32 changed files with 510 additions and 268 deletions

View File

@ -4,7 +4,8 @@ sysinclude_HEADERS = asoundlib.h
# This is the order they will be concatenated into asoundlib.h!
#
header_files=header.h version.h global.h input.h output.h error.h mixer.h \
pcm.h pcm_m4.h rawmidi.h rawmidi_m4.h timer.h hwdep.h control.h \
pcm.h pcm_m4.h rawmidi.h rawmidi_m4.h timer.h \
hwdep.h hwdep_m4.h control.h \
seq.h seqmid.h seq_midi_event.h \
conv.h instr.h conf.h footer.h

View File

@ -20,6 +20,20 @@
#include "../src/pcm/pcm_local.h"
typedef enum _snd_dev_type {
SND_DEV_TYPE_PCM,
SND_DEV_TYPE_CONTROL,
SND_DEV_TYPE_RAWMIDI,
SND_DEV_TYPE_TIMER,
SND_DEV_TYPE_HWDEP,
SND_DEV_TYPE_SEQ,
} snd_dev_type_t;
typedef enum _snd_transport_type {
SND_TRANSPORT_TYPE_SHM,
SND_TRANSPORT_TYPE_TCP,
} snd_transport_type_t;
#define SND_PCM_IOCTL_STATE _IO ('A', 0xf1)
#define SND_PCM_IOCTL_MMAP _IO ('A', 0xf2)
#define SND_PCM_IOCTL_MUNMAP _IO ('A', 0xf3)

View File

@ -1,10 +1,21 @@
typedef enum _snd_config_type {
enum _snd_config_type {
SND_CONFIG_TYPE_INTEGER,
SND_CONFIG_TYPE_REAL,
SND_CONFIG_TYPE_STRING,
SND_CONFIG_TYPE_COMPOUND,
} snd_config_type_t;
};
#ifdef SND_ENUM_TYPECHECK
typedef struct __snd_config_type *snd_config_type_t;
#else
typedef enum _snd_config_type snd_config_type_t;
#endif
#define SND_CONFIG_TYPE_INTEGER ((snd_config_type_t) SND_CONFIG_TYPE_INTEGER)
#define SND_CONFIG_TYPE_REAL ((snd_config_type_t) SND_CONFIG_TYPE_REAL)
#define SND_CONFIG_TYPE_STRING ((snd_config_type_t) SND_CONFIG_TYPE_STRING)
#define SND_CONFIG_TYPE_COMPOUND ((snd_config_type_t) SND_CONFIG_TYPE_COMPOUND)
typedef struct _snd_config snd_config_t;

View File

@ -5,102 +5,118 @@
* *
****************************************************************************/
/* sndrv aliasing */
typedef struct sndrv_aes_iec958 snd_aes_iec958_t;
typedef union sndrv_digital_audio snd_digital_audio_t;
typedef enum sndrv_card_type snd_card_type;
typedef struct sndrv_ctl_hw_info snd_ctl_hw_info_t;
typedef enum sndrv_control_type snd_control_type_t;
typedef enum sndrv_control_iface snd_control_iface_t;
typedef struct sndrv_control_id snd_control_id_t;
typedef struct sndrv_control_list snd_control_list_t;
typedef struct sndrv_control_info snd_control_info_t;
typedef struct sndrv_control snd_control_t;
typedef enum sndrv_ctl_event_type snd_ctl_event_type_t;
typedef struct sndrv_ctl_event snd_ctl_event_t;
#define SND_CARD_TYPE_GUS_CLASSIC SNDRV_CARD_TYPE_GUS_CLASSIC
#define SND_CARD_TYPE_GUS_EXTREME SNDRV_CARD_TYPE_GUS_EXTREME
#define SND_CARD_TYPE_GUS_ACE SNDRV_CARD_TYPE_GUS_ACE
#define SND_CARD_TYPE_GUS_MAX SNDRV_CARD_TYPE_GUS_MAX
#define SND_CARD_TYPE_AMD_INTERWAVE SNDRV_CARD_TYPE_AMD_INTERWAVE
#define SND_CARD_TYPE_SB_10 SNDRV_CARD_TYPE_SB_10
#define SND_CARD_TYPE_SB_20 SNDRV_CARD_TYPE_SB_20
#define SND_CARD_TYPE_SB_PRO SNDRV_CARD_TYPE_SB_PRO
#define SND_CARD_TYPE_SB_16 SNDRV_CARD_TYPE_SB_16
#define SND_CARD_TYPE_SB_AWE SNDRV_CARD_TYPE_SB_AWE
#define SND_CARD_TYPE_ESS_ES1688 SNDRV_CARD_TYPE_ESS_ES1688
#define SND_CARD_TYPE_OPL3_SA2 SNDRV_CARD_TYPE_OPL3_SA2
#define SND_CARD_TYPE_MOZART SNDRV_CARD_TYPE_MOZART
#define SND_CARD_TYPE_S3_SONICVIBES SNDRV_CARD_TYPE_S3_SONICVIBES
#define SND_CARD_TYPE_ENS1370 SNDRV_CARD_TYPE_ENS1370
#define SND_CARD_TYPE_ENS1371 SNDRV_CARD_TYPE_ENS1371
#define SND_CARD_TYPE_CS4232 SNDRV_CARD_TYPE_CS4232
#define SND_CARD_TYPE_CS4236 SNDRV_CARD_TYPE_CS4236
#define SND_CARD_TYPE_AMD_INTERWAVE_STB SNDRV_CARD_TYPE_AMD_INTERWAVE_STB
#define SND_CARD_TYPE_ESS_ES1938 SNDRV_CARD_TYPE_ESS_ES1938
#define SND_CARD_TYPE_ESS_ES18XX SNDRV_CARD_TYPE_ESS_ES18XX
#define SND_CARD_TYPE_CS4231 SNDRV_CARD_TYPE_CS4231
#define SND_CARD_TYPE_OPTI92X SNDRV_CARD_TYPE_OPTI92X
#define SND_CARD_TYPE_SERIAL SNDRV_CARD_TYPE_SERIAL
#define SND_CARD_TYPE_AD1848 SNDRV_CARD_TYPE_AD1848
#define SND_CARD_TYPE_TRID4DWAVEDX SNDRV_CARD_TYPE_TRID4DWAVEDX
#define SND_CARD_TYPE_TRID4DWAVENX SNDRV_CARD_TYPE_TRID4DWAVENX
#define SND_CARD_TYPE_SGALAXY SNDRV_CARD_TYPE_SGALAXY
#define SND_CARD_TYPE_CS46XX SNDRV_CARD_TYPE_CS46XX
#define SND_CARD_TYPE_WAVEFRONT SNDRV_CARD_TYPE_WAVEFRONT
#define SND_CARD_TYPE_TROPEZ SNDRV_CARD_TYPE_TROPEZ
#define SND_CARD_TYPE_TROPEZPLUS SNDRV_CARD_TYPE_TROPEZPLUS
#define SND_CARD_TYPE_MAUI SNDRV_CARD_TYPE_MAUI
#define SND_CARD_TYPE_CMI8330 SNDRV_CARD_TYPE_CMI8330
#define SND_CARD_TYPE_DUMMY SNDRV_CARD_TYPE_DUMMY
#define SND_CARD_TYPE_ALS100 SNDRV_CARD_TYPE_ALS100
#define SND_CARD_TYPE_SHARE SNDRV_CARD_TYPE_SHARE
#define SND_CARD_TYPE_SI_7018 SNDRV_CARD_TYPE_SI_7018
#define SND_CARD_TYPE_OPTI93X SNDRV_CARD_TYPE_OPTI93X
#define SND_CARD_TYPE_MTPAV SNDRV_CARD_TYPE_MTPAV
#define SND_CARD_TYPE_VIRMIDI SNDRV_CARD_TYPE_VIRMIDI
#define SND_CARD_TYPE_EMU10K1 SNDRV_CARD_TYPE_EMU10K1
#define SND_CARD_TYPE_HAMMERFALL SNDRV_CARD_TYPE_HAMMERFALL
#define SND_CARD_TYPE_HAMMERFALL_LIGHT SNDRV_CARD_TYPE_HAMMERFALL_LIGHT
#define SND_CARD_TYPE_ICE1712 SNDRV_CARD_TYPE_ICE1712
#define SND_CARD_TYPE_CMI8338 SNDRV_CARD_TYPE_CMI8338
#define SND_CARD_TYPE_CMI8738 SNDRV_CARD_TYPE_CMI8738
#define SND_CARD_TYPE_AD1816A SNDRV_CARD_TYPE_AD1816A
#define SND_CARD_TYPE_INTEL8X0 SNDRV_CARD_TYPE_INTEL8X0
#define SND_CARD_TYPE_ESS_ESOLDM1 SNDRV_CARD_TYPE_ESS_ESOLDM1
#define SND_CARD_TYPE_ESS_ES1968 SNDRV_CARD_TYPE_ESS_ES1968
#define SND_CARD_TYPE_ESS_ES1978 SNDRV_CARD_TYPE_ESS_ES1978
#define SND_CARD_TYPE_DIGI96 SNDRV_CARD_TYPE_DIGI96
#define SND_CARD_TYPE_VIA82C686A SNDRV_CARD_TYPE_VIA82C686A
#define SND_CARD_TYPE_FM801 SNDRV_CARD_TYPE_FM801
#define SND_CARD_TYPE_AZT2320 SNDRV_CARD_TYPE_AZT2320
#define SND_CARD_TYPE_PRODIF_PLUS SNDRV_CARD_TYPE_PRODIF_PLUS
#define SND_CARD_TYPE_YMFPCI SNDRV_CARD_TYPE_YMFPCI
#define SND_CARD_TYPE_CS4281 SNDRV_CARD_TYPE_CS4281
#define SND_CARD_TYPE_MPU401_UART SNDRV_CARD_TYPE_MPU401_UART
#define SND_CARD_TYPE_ALS4000 SNDRV_CARD_TYPE_ALS4000
#define SND_CARD_TYPE_ALLEGRO_1 SNDRV_CARD_TYPE_ALLEGRO_1
#define SND_CARD_TYPE_ALLEGRO SNDRV_CARD_TYPE_ALLEGRO
#define SND_CARD_TYPE_MAESTRO3 SNDRV_CARD_TYPE_MAESTRO3
#define SND_CARD_TYPE_AWACS SNDRV_CARD_TYPE_AWACS
#define SND_CARD_TYPE_NM256AV SNDRV_CARD_TYPE_NM256AV
#define SND_CARD_TYPE_NM256ZX SNDRV_CARD_TYPE_NM256ZX
#define SND_CARD_TYPE_VIA8233 SNDRV_CARD_TYPE_VIA8233
#define SND_CARD_TYPE_LAST SNDRV_CARD_TYPE_LAST
#define SND_CONTROL_TYPE_NONE SNDRV_CONTROL_TYPE_NONE
#define SND_CONTROL_TYPE_BOOLEAN SNDRV_CONTROL_TYPE_BOOLEAN
#define SND_CONTROL_TYPE_INTEGER SNDRV_CONTROL_TYPE_INTEGER
#define SND_CONTROL_TYPE_ENUMERATED SNDRV_CONTROL_TYPE_ENUMERATED
#define SND_CONTROL_TYPE_BYTES SNDRV_CONTROL_TYPE_BYTES
#define SND_CONTROL_TYPE_IEC958 SNDRV_CONTROL_TYPE_IEC958
#define SND_CONTROL_IFACE_CARD SNDRV_CONTROL_IFACE_CARD
#define SND_CONTROL_IFACE_HWDEP SNDRV_CONTROL_IFACE_HWDEP
#define SND_CONTROL_IFACE_MIXER SNDRV_CONTROL_IFACE_MIXER
#define SND_CONTROL_IFACE_PCM SNDRV_CONTROL_IFACE_PCM
#define SND_CONTROL_IFACE_RAWMIDI SNDRV_CONTROL_IFACE_RAWMIDI
#define SND_CONTROL_IFACE_TIMER SNDRV_CONTROL_IFACE_TIMER
#define SND_CONTROL_IFACE_SEQUENCER SNDRV_CONTROL_IFACE_SEQUENCER
#ifdef SND_ENUM_TYPECHECK
typedef enum sndrv_card_type snd_card_type;
typedef enum sndrv_control_type snd_control_type_t;
typedef enum sndrv_control_iface snd_control_iface_t;
typedef enum sndrv_ctl_event_type snd_ctl_event_type_t;
#else
typedef struct __snd_card_type *snd_card_type;
typedef struct __snd_control_type *snd_control_type_t;
typedef struct __snd_control_iface *snd_control_iface_t;
typedef struct __snd_ctl_event_type *snd_ctl_event_type_t;
#endif
#define SND_CARD_TYPE_GUS_CLASSIC ((snd_card_type_t) SNDRV_CARD_TYPE_GUS_CLASSIC)
#define SND_CARD_TYPE_GUS_EXTREME ((snd_card_type_t) SNDRV_CARD_TYPE_GUS_EXTREME)
#define SND_CARD_TYPE_GUS_ACE ((snd_card_type_t) SNDRV_CARD_TYPE_GUS_ACE)
#define SND_CARD_TYPE_GUS_MAX ((snd_card_type_t) SNDRV_CARD_TYPE_GUS_MAX)
#define SND_CARD_TYPE_AMD_INTERWAVE ((snd_card_type_t) SNDRV_CARD_TYPE_AMD_INTERWAVE)
#define SND_CARD_TYPE_SB_10 ((snd_card_type_t) SNDRV_CARD_TYPE_SB_10)
#define SND_CARD_TYPE_SB_20 ((snd_card_type_t) SNDRV_CARD_TYPE_SB_20)
#define SND_CARD_TYPE_SB_PRO ((snd_card_type_t) SNDRV_CARD_TYPE_SB_PRO)
#define SND_CARD_TYPE_SB_16 ((snd_card_type_t) SNDRV_CARD_TYPE_SB_16)
#define SND_CARD_TYPE_SB_AWE ((snd_card_type_t) SNDRV_CARD_TYPE_SB_AWE)
#define SND_CARD_TYPE_ESS_ES1688 ((snd_card_type_t) SNDRV_CARD_TYPE_ESS_ES1688)
#define SND_CARD_TYPE_OPL3_SA2 ((snd_card_type_t) SNDRV_CARD_TYPE_OPL3_SA2)
#define SND_CARD_TYPE_MOZART ((snd_card_type_t) SNDRV_CARD_TYPE_MOZART)
#define SND_CARD_TYPE_S3_SONICVIBES ((snd_card_type_t) SNDRV_CARD_TYPE_S3_SONICVIBES)
#define SND_CARD_TYPE_ENS1370 ((snd_card_type_t) SNDRV_CARD_TYPE_ENS1370)
#define SND_CARD_TYPE_ENS1371 ((snd_card_type_t) SNDRV_CARD_TYPE_ENS1371)
#define SND_CARD_TYPE_CS4232 ((snd_card_type_t) SNDRV_CARD_TYPE_CS4232)
#define SND_CARD_TYPE_CS4236 ((snd_card_type_t) SNDRV_CARD_TYPE_CS4236)
#define SND_CARD_TYPE_AMD_INTERWAVE_STB ((snd_card_type_t) SNDRV_CARD_TYPE_AMD_INTERWAVE_STB)
#define SND_CARD_TYPE_ESS_ES1938 ((snd_card_type_t) SNDRV_CARD_TYPE_ESS_ES1938)
#define SND_CARD_TYPE_ESS_ES18XX ((snd_card_type_t) SNDRV_CARD_TYPE_ESS_ES18XX)
#define SND_CARD_TYPE_CS4231 ((snd_card_type_t) SNDRV_CARD_TYPE_CS4231)
#define SND_CARD_TYPE_OPTI92X ((snd_card_type_t) SNDRV_CARD_TYPE_OPTI92X)
#define SND_CARD_TYPE_SERIAL ((snd_card_type_t) SNDRV_CARD_TYPE_SERIAL)
#define SND_CARD_TYPE_AD1848 ((snd_card_type_t) SNDRV_CARD_TYPE_AD1848)
#define SND_CARD_TYPE_TRID4DWAVEDX ((snd_card_type_t) SNDRV_CARD_TYPE_TRID4DWAVEDX)
#define SND_CARD_TYPE_TRID4DWAVENX ((snd_card_type_t) SNDRV_CARD_TYPE_TRID4DWAVENX)
#define SND_CARD_TYPE_SGALAXY ((snd_card_type_t) SNDRV_CARD_TYPE_SGALAXY)
#define SND_CARD_TYPE_CS46XX ((snd_card_type_t) SNDRV_CARD_TYPE_CS46XX)
#define SND_CARD_TYPE_WAVEFRONT ((snd_card_type_t) SNDRV_CARD_TYPE_WAVEFRONT)
#define SND_CARD_TYPE_TROPEZ ((snd_card_type_t) SNDRV_CARD_TYPE_TROPEZ)
#define SND_CARD_TYPE_TROPEZPLUS ((snd_card_type_t) SNDRV_CARD_TYPE_TROPEZPLUS)
#define SND_CARD_TYPE_MAUI ((snd_card_type_t) SNDRV_CARD_TYPE_MAUI)
#define SND_CARD_TYPE_CMI8330 ((snd_card_type_t) SNDRV_CARD_TYPE_CMI8330)
#define SND_CARD_TYPE_DUMMY ((snd_card_type_t) SNDRV_CARD_TYPE_DUMMY)
#define SND_CARD_TYPE_ALS100 ((snd_card_type_t) SNDRV_CARD_TYPE_ALS100)
#define SND_CARD_TYPE_SHARE ((snd_card_type_t) SNDRV_CARD_TYPE_SHARE)
#define SND_CARD_TYPE_SI_7018 ((snd_card_type_t) SNDRV_CARD_TYPE_SI_7018)
#define SND_CARD_TYPE_OPTI93X ((snd_card_type_t) SNDRV_CARD_TYPE_OPTI93X)
#define SND_CARD_TYPE_MTPAV ((snd_card_type_t) SNDRV_CARD_TYPE_MTPAV)
#define SND_CARD_TYPE_VIRMIDI ((snd_card_type_t) SNDRV_CARD_TYPE_VIRMIDI)
#define SND_CARD_TYPE_EMU10K1 ((snd_card_type_t) SNDRV_CARD_TYPE_EMU10K1)
#define SND_CARD_TYPE_HAMMERFALL ((snd_card_type_t) SNDRV_CARD_TYPE_HAMMERFALL)
#define SND_CARD_TYPE_HAMMERFALL_LIGHT ((snd_card_type_t) SNDRV_CARD_TYPE_HAMMERFALL_LIGHT)
#define SND_CARD_TYPE_ICE1712 ((snd_card_type_t) SNDRV_CARD_TYPE_ICE1712)
#define SND_CARD_TYPE_CMI8338 ((snd_card_type_t) SNDRV_CARD_TYPE_CMI8338)
#define SND_CARD_TYPE_CMI8738 ((snd_card_type_t) SNDRV_CARD_TYPE_CMI8738)
#define SND_CARD_TYPE_AD1816A ((snd_card_type_t) SNDRV_CARD_TYPE_AD1816A)
#define SND_CARD_TYPE_INTEL8X0 ((snd_card_type_t) SNDRV_CARD_TYPE_INTEL8X0)
#define SND_CARD_TYPE_ESS_ESOLDM1 ((snd_card_type_t) SNDRV_CARD_TYPE_ESS_ESOLDM1)
#define SND_CARD_TYPE_ESS_ES1968 ((snd_card_type_t) SNDRV_CARD_TYPE_ESS_ES1968)
#define SND_CARD_TYPE_ESS_ES1978 ((snd_card_type_t) SNDRV_CARD_TYPE_ESS_ES1978)
#define SND_CARD_TYPE_DIGI96 ((snd_card_type_t) SNDRV_CARD_TYPE_DIGI96)
#define SND_CARD_TYPE_VIA82C686A ((snd_card_type_t) SNDRV_CARD_TYPE_VIA82C686A)
#define SND_CARD_TYPE_FM801 ((snd_card_type_t) SNDRV_CARD_TYPE_FM801)
#define SND_CARD_TYPE_AZT2320 ((snd_card_type_t) SNDRV_CARD_TYPE_AZT2320)
#define SND_CARD_TYPE_PRODIF_PLUS ((snd_card_type_t) SNDRV_CARD_TYPE_PRODIF_PLUS)
#define SND_CARD_TYPE_YMFPCI ((snd_card_type_t) SNDRV_CARD_TYPE_YMFPCI)
#define SND_CARD_TYPE_CS4281 ((snd_card_type_t) SNDRV_CARD_TYPE_CS4281)
#define SND_CARD_TYPE_MPU401_UART ((snd_card_type_t) SNDRV_CARD_TYPE_MPU401_UART)
#define SND_CARD_TYPE_ALS4000 ((snd_card_type_t) SNDRV_CARD_TYPE_ALS4000)
#define SND_CARD_TYPE_ALLEGRO_1 ((snd_card_type_t) SNDRV_CARD_TYPE_ALLEGRO_1)
#define SND_CARD_TYPE_ALLEGRO ((snd_card_type_t) SNDRV_CARD_TYPE_ALLEGRO)
#define SND_CARD_TYPE_MAESTRO3 ((snd_card_type_t) SNDRV_CARD_TYPE_MAESTRO3)
#define SND_CARD_TYPE_AWACS ((snd_card_type_t) SNDRV_CARD_TYPE_AWACS)
#define SND_CARD_TYPE_NM256AV ((snd_card_type_t) SNDRV_CARD_TYPE_NM256AV)
#define SND_CARD_TYPE_NM256ZX ((snd_card_type_t) SNDRV_CARD_TYPE_NM256ZX)
#define SND_CARD_TYPE_VIA8233 ((snd_card_type_t) SNDRV_CARD_TYPE_VIA8233)
#define SND_CARD_TYPE_LAST ((snd_card_type_t) SNDRV_CARD_TYPE_LAST)
#define SND_CONTROL_TYPE_NONE ((snd_control_type_t) SNDRV_CONTROL_TYPE_NONE)
#define SND_CONTROL_TYPE_BOOLEAN ((snd_control_type_t) SNDRV_CONTROL_TYPE_BOOLEAN)
#define SND_CONTROL_TYPE_INTEGER ((snd_control_type_t) SNDRV_CONTROL_TYPE_INTEGER)
#define SND_CONTROL_TYPE_ENUMERATED ((snd_control_type_t) SNDRV_CONTROL_TYPE_ENUMERATED)
#define SND_CONTROL_TYPE_BYTES ((snd_control_type_t) SNDRV_CONTROL_TYPE_BYTES)
#define SND_CONTROL_TYPE_IEC958 ((snd_control_type_t) SNDRV_CONTROL_TYPE_IEC958)
#define SND_CONTROL_IFACE_CARD ((snd_control_iface_t) SNDRV_CONTROL_IFACE_CARD)
#define SND_CONTROL_IFACE_HWDEP ((snd_control_iface_t) SNDRV_CONTROL_IFACE_HWDEP)
#define SND_CONTROL_IFACE_MIXER ((snd_control_iface_t) SNDRV_CONTROL_IFACE_MIXER)
#define SND_CONTROL_IFACE_PCM ((snd_control_iface_t) SNDRV_CONTROL_IFACE_PCM)
#define SND_CONTROL_IFACE_RAWMIDI ((snd_control_iface_t) SNDRV_CONTROL_IFACE_RAWMIDI)
#define SND_CONTROL_IFACE_TIMER ((snd_control_iface_t) SNDRV_CONTROL_IFACE_TIMER)
#define SND_CONTROL_IFACE_SEQUENCER ((snd_control_iface_t) SNDRV_CONTROL_IFACE_SEQUENCER)
#define SND_CTL_EVENT_REBUILD ((snd_ctl_event_type_t) SNDRV_CTL_EVENT_REBUILD)
#define SND_CTL_EVENT_VALUE ((snd_ctl_event_type_t) SNDRV_CTL_EVENT_VALUE)
#define SND_CTL_EVENT_CHANGE ((snd_ctl_event_type_t) SNDRV_CTL_EVENT_CHANGE)
#define SND_CTL_EVENT_ADD ((snd_ctl_event_type_t) SNDRV_CTL_EVENT_ADD)
#define SND_CTL_EVENT_REMOVE ((snd_ctl_event_type_t) SNDRV_CTL_EVENT_REMOVE)
#define SND_CONTROL_ACCESS_READ SNDRV_CONTROL_ACCESS_READ
#define SND_CONTROL_ACCESS_WRITE SNDRV_CONTROL_ACCESS_WRITE
#define SND_CONTROL_ACCESS_READWRITE SNDRV_CONTROL_ACCESS_READWRITE
@ -108,19 +124,25 @@ typedef struct sndrv_ctl_event snd_ctl_event_t;
#define SND_CONTROL_ACCESS_INACTIVE SNDRV_CONTROL_ACCESS_INACTIVE
#define SND_CONTROL_ACCESS_LOCK SNDRV_CONTROL_ACCESS_LOCK
#define SND_CONTROL_ACCESS_INDIRECT SNDRV_CONTROL_ACCESS_INDIRECT
#define SND_CTL_EVENT_REBUILD SNDRV_CTL_EVENT_REBUILD
#define SND_CTL_EVENT_VALUE SNDRV_CTL_EVENT_VALUE
#define SND_CTL_EVENT_CHANGE SNDRV_CTL_EVENT_CHANGE
#define SND_CTL_EVENT_ADD SNDRV_CTL_EVENT_ADD
#define SND_CTL_EVENT_REMOVE SNDRV_CTL_EVENT_REMOVE
enum _snd_ctl_type {
SND_CTL_TYPE_HW,
SND_CTL_TYPE_SHM,
SND_CTL_TYPE_INET
};
#ifdef SND_ENUM_TYPECHECK
typedef struct __snd_ctl_type *snd_ctl_type_t;
#else
typedef enum _snd_ctl_type snd_ctl_type_t;
#endif
#define SND_CTL_TYPE_HW ((snd_ctl_type_t) SND_CTL_TYPE_HW)
#define SND_CTL_TYPE_SHM ((snd_ctl_type_t) SND_CTL_TYPE_SHM)
#define SND_CTL_TYPE_INET ((snd_ctl_type_t) SND_CTL_TYPE_INET)
typedef struct _snd_ctl snd_ctl_t;
typedef enum _snd_ctl_type { SND_CTL_TYPE_HW,
SND_CTL_TYPE_SHM,
SND_CTL_TYPE_INET
} snd_ctl_type_t;
typedef struct _snd_ctl_callbacks {
void *private_data; /* may be used by an application */
void (*rebuild) (snd_ctl_t *handle, void *private_data);

View File

@ -2,13 +2,39 @@
* Global defines
*/
#define SND_DEV_TYPE_PCM 0
#define SND_DEV_TYPE_CONTROL 1
#define SND_DEV_TYPE_RAWMIDI 2
#define SND_DEV_TYPE_TIMER 3
#define SND_DEV_TYPE_HWDEP 4
#define SND_DEV_TYPE_SEQ 5
#ifdef SNDRV_LITTLE_ENDIAN
#define SND_LITTLE_ENDIAN SNDRV_LITTLE_ENDIAN
#endif
#define SND_TRANSPORT_TYPE_SHM 0
#define SND_TRANSPORT_TYPE_TCP 1
#ifdef SNDRV_BIG_ENDIAN
#define SND_BIG_ENDIAN SNDRV_BIG_ENDIAN
#endif
//#define SND_ENUM_TYPECHECK
#ifdef SND_ENUM_TYPECHECK
#define snd_enum_to_int(v) ((unsigned int)(unsigned long)(v))
#define snd_int_to_enum(v) ((void *)(unsigned long)(v))
#define snd_enum_incr(v) (++(unsigned long)(v))
#else
#define snd_enum_to_int(v) (v)
#define snd_int_to_enum(v) (v)
#define snd_enum_incr(v) (++(v))
#endif
enum _snd_set_mode {
SND_CHANGE,
SND_TRY,
SND_TEST,
};
#ifdef SND_ENUM_TYPECHECK
typedef struct __snd_set_mode *snd_set_mode_t;
#else
typedef enum _snd_set_mode snd_set_mode_t;
#endif
#define SND_CHANGE ((snd_set_mode_t) SND_CHANGE)
#define SND_TRY ((snd_set_mode_t) SND_TRY)
#define SND_TEST ((snd_set_mode_t) SND_TEST)

View File

@ -37,35 +37,3 @@
#define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
#endif
#ifdef SNDRV_LITTLE_ENDIAN
#define SND_LITTLE_ENDIAN SNDRV_LITTLE_ENDIAN
#endif
#ifdef SNDRV_BIG_ENDIAN
#define SND_BIG_ENDIAN SNDRV_BIG_ENDIAN
#endif
enum _snd_set_mode {
SND_CHANGE,
SND_TRY,
SND_TEST,
};
//#define SND_ENUM_TYPECHECK
#ifdef SND_ENUM_TYPECHECK
typedef struct __snd_set_mode *snd_set_mode_t;
#define snd_enum_to_int(v) ((unsigned int)(unsigned long)(v))
#define snd_int_to_enum(v) ((void *)(unsigned long)(v))
#define snd_enum_incr(v) (++(unsigned long)(v))
#else
typedef enum _snd_set_mode snd_set_mode_t;
#define snd_enum_to_int(v) (v)
#define snd_int_to_enum(v) (v)
#define snd_enum_incr(v) (++(v))
#endif
#define SND_CHANGE ((snd_set_mode_t) SND_CHANGE)
#define SND_TRY ((snd_set_mode_t) SND_TRY)
#define SND_TEST ((snd_set_mode_t) SND_TEST)

View File

@ -5,17 +5,22 @@
* *
****************************************************************************/
/* sndrv aliasing */
typedef struct _snd_hwdep_info snd_hwdep_info_t;
#ifdef SND_ENUM_TYPECHECK
typedef struct __snd_hwdep_type *snd_hwdep_type_t;
#else
typedef enum sndrv_hwdep_type snd_hwdep_type_t;
typedef struct sndrv_hwdep_info snd_hwdep_info_t;
#define SND_HWDEP_TYPE_OPL2 SNDRV_HWDEP_TYPE_OPL2
#define SND_HWDEP_TYPE_OPL3 SNDRV_HWDEP_TYPE_OPL3
#define SND_HWDEP_TYPE_OPL4 SNDRV_HWDEP_TYPE_OPL4
#define SND_HWDEP_TYPE_SB16CSP SNDRV_HWDEP_TYPE_SB16CSP
#define SND_HWDEP_TYPE_EMU10K1 SNDRV_HWDEP_TYPE_EMU10K1
#define SND_HWDEP_TYPE_YSS225 SNDRV_HWDEP_TYPE_YSS225
#define SND_HWDEP_TYPE_ICS2115 SNDRV_HWDEP_TYPE_ICS2115
#define SND_HWDEP_TYPE_LAST SNDRV_HWDEP_TYPE_LAST
#endif
#define SND_HWDEP_TYPE_OPL2 ((snd_hwdep_type_t) SNDRV_HWDEP_TYPE_OPL2)
#define SND_HWDEP_TYPE_OPL3 ((snd_hwdep_type_t) SNDRV_HWDEP_TYPE_OPL3)
#define SND_HWDEP_TYPE_OPL4 ((snd_hwdep_type_t) SNDRV_HWDEP_TYPE_OPL4)
#define SND_HWDEP_TYPE_SB16CSP ((snd_hwdep_type_t) SNDRV_HWDEP_TYPE_SB16CSP)
#define SND_HWDEP_TYPE_EMU10K1 ((snd_hwdep_type_t) SNDRV_HWDEP_TYPE_EMU10K1)
#define SND_HWDEP_TYPE_YSS225 ((snd_hwdep_type_t) SNDRV_HWDEP_TYPE_YSS225)
#define SND_HWDEP_TYPE_ICS2115 ((snd_hwdep_type_t) SNDRV_HWDEP_TYPE_ICS2115)
#define SND_HWDEP_TYPE_LAST ((snd_hwdep_type_t) SNDRV_HWDEP_TYPE_LAST)
#define SND_HWDEP_OPEN_READ (O_RDONLY)
#define SND_HWDEP_OPEN_WRITE (O_WRONLY)

26
include/hwdep_m4.h Normal file
View File

@ -0,0 +1,26 @@
#ifdef __cplusplus
extern "C" {
#endif
size_t snd_hwdep_info_sizeof();
#define snd_hwdep_info_alloca(ptr) ({assert(ptr); *ptr = (snd_hwdep_info_t *) alloca(snd_hwdep_info_sizeof()); 0;})
int snd_hwdep_info_malloc(snd_hwdep_info_t **ptr);
void snd_hwdep_info_free(snd_hwdep_info_t *obj);
void snd_hwdep_info_copy(snd_hwdep_info_t *dst, const snd_hwdep_info_t *src);
unsigned int snd_hwdep_info_get_device(const snd_hwdep_info_t *obj);
int snd_hwdep_info_get_card(const snd_hwdep_info_t *obj);
const char * snd_hwdep_info_get_id(const snd_hwdep_info_t *obj);
const char * snd_hwdep_info_get_name(const snd_hwdep_info_t *obj);
snd_hwdep_type_t snd_hwdep_info_get_type(const snd_hwdep_info_t *obj);
void snd_hwdep_info_set_device(snd_hwdep_info_t *obj, unsigned int val);
#ifdef __cplusplus
}
#endif

View File

@ -1,10 +1,19 @@
typedef struct _snd_input snd_input_t;
typedef enum _snd_input_type {
enum _snd_input_type {
SND_INPUT_STDIO,
SND_INPUT_BUFFER,
} snd_input_type_t;
};
#ifdef SND_ENUM_TYPECHECK
typedef struct __snd_input_type *snd_input_type_t;
#else
typedef enum _snd_input_type snd_input_type_t;
#endif
#define SND_INPUT_STDIO ((snd_input_type_t) SND_INPUT_STDIO)
#define SND_INPUT_BUFFER ((snd_input_type_t) SND_INPUT_BUFFER)
#ifdef __cplusplus
extern "C" {

View File

@ -29,6 +29,8 @@
#define _snd_rawmidi_params sndrv_rawmidi_params
#define _snd_rawmidi_status sndrv_rawmidi_status
#define _snd_hwdep_info sndrv_hwdep_info
#include "asoundlib.h"
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)

View File

@ -24,7 +24,8 @@ int snd_mixer_poll_descriptor(snd_mixer_t *handle);
* Simple (legacy) mixer API
*/
typedef enum _snd_mixer_channel_id {
enum _snd_mixer_channel_id {
SND_MIXER_CHN_UNKNOWN = -1,
SND_MIXER_CHN_FRONT_LEFT = 0,
SND_MIXER_CHN_FRONT_RIGHT,
SND_MIXER_CHN_FRONT_CENTER,
@ -33,15 +34,31 @@ typedef enum _snd_mixer_channel_id {
SND_MIXER_CHN_WOOFER,
SND_MIXER_CHN_LAST = 31,
SND_MIXER_CHN_MONO = SND_MIXER_CHN_FRONT_LEFT
} snd_mixer_channel_id_t;
};
#define SND_MIXER_CHN_MASK_MONO (1<<SND_MIXER_CHN_MONO)
#define SND_MIXER_CHN_MASK_FRONT_LEFT (1<<SND_MIXER_CHN_FRONT_LEFT)
#define SND_MIXER_CHN_MASK_FRONT_RIGHT (1<<SND_MIXER_CHN_FRONT_RIGHT)
#define SND_MIXER_CHN_MASK_FRONT_CENTER (1<<SND_MIXER_CHN_FRONT_CENTER)
#define SND_MIXER_CHN_MASK_REAR_LEFT (1<<SND_MIXER_CHN_REAR_LEFT)
#define SND_MIXER_CHN_MASK_REAR_RIGHT (1<<SND_MIXER_CHN_REAR_RIGHT)
#define SND_MIXER_CHN_MASK_WOOFER (1<<SND_MIXER_CHN_WOOFER)
#ifdef SND_ENUM_TYPECHECK
typedef struct __snd_mixer_channel_id *snd_mixer_channel_id_t;
#else
typedef enum _snd_mixer_channel_id snd_mixer_channel_id_t;
#endif
#define SND_MIXER_CHN_UNKNOWN ((snd_mixer_channel_id_t) SND_MIXER_CHN_UNKNOWN)
#define SND_MIXER_CHN_FRONT_LEFT ((snd_mixer_channel_id_t) SND_MIXER_CHN_FRONT_LEFT)
#define SND_MIXER_CHN_FRONT_RIGHT ((snd_mixer_channel_id_t) SND_MIXER_CHN_FRONT_RIGHT)
#define SND_MIXER_CHN_FRONT_CENTER ((snd_mixer_channel_id_t) SND_MIXER_CHN_FRONT_CENTER)
#define SND_MIXER_CHN_REAR_LEFT ((snd_mixer_channel_id_t) SND_MIXER_CHN_REAR_LEFT)
#define SND_MIXER_CHN_REAR_RIGHT ((snd_mixer_channel_id_t) SND_MIXER_CHN_REAR_RIGHT)
#define SND_MIXER_CHN_WOOFER ((snd_mixer_channel_id_t) SND_MIXER_CHN_WOOFER)
#define SND_MIXER_CHN_LAST ((snd_mixer_channel_id_t) SND_MIXER_CHN_LAST)
#define SND_MIXER_CHN_MONO ((snd_mixer_channel_id_t) SND_MIXER_CHN_MONO)
#define SND_MIXER_CHN_MASK_MONO (1<<snd_enum_to_int(SND_MIXER_CHN_MONO))
#define SND_MIXER_CHN_MASK_FRONT_LEFT (1<<snd_enum_to_int(SND_MIXER_CHN_FRONT_LEFT))
#define SND_MIXER_CHN_MASK_FRONT_RIGHT (1<<snd_enum_to_int(SND_MIXER_CHN_FRONT_RIGHT))
#define SND_MIXER_CHN_MASK_FRONT_CENTER (1<<snd_enum_to_int(SND_MIXER_CHN_FRONT_CENTER))
#define SND_MIXER_CHN_MASK_REAR_LEFT (1<<snd_enum_to_int(SND_MIXER_CHN_REAR_LEFT))
#define SND_MIXER_CHN_MASK_REAR_RIGHT (1<<snd_enum_to_int(SND_MIXER_CHN_REAR_RIGHT))
#define SND_MIXER_CHN_MASK_WOOFER (1<<snd_enum_to_int(SND_MIXER_CHN_WOOFER))
#define SND_MIXER_CHN_MASK_STEREO (SND_MIXER_CHN_MASK_FRONT_LEFT|SND_MIXER_CHN_MASK_FRONT_RIGHT)
#define SND_MIXER_SCTCAP_VOLUME (1<<0)
@ -103,7 +120,7 @@ typedef struct _snd_mixer_simple_callbacks {
extern "C" {
#endif
const char *snd_mixer_simple_channel_name(int channel);
const char *snd_mixer_simple_channel_name(snd_mixer_channel_id_t channel);
int snd_mixer_simple_control_list(snd_mixer_t *handle, snd_mixer_simple_control_list_t *list);
int snd_mixer_simple_control_read(snd_mixer_t *handle, snd_mixer_simple_control_t *simple);
int snd_mixer_simple_control_write(snd_mixer_t *handle, snd_mixer_simple_control_t *simple);

View File

@ -1,10 +1,20 @@
typedef struct _snd_output snd_output_t;
typedef enum _snd_output_type {
enum _snd_output_type {
SND_OUTPUT_STDIO,
SND_OUTPUT_BUFFER,
} snd_output_type_t;
};
#ifdef SND_ENUM_TYPECHECK
typedef struct __snd_output_type *snd_output_type_t;
#else
typedef enum _snd_output_type snd_output_type_t;
#endif
#define SND_OUTPUT_STDIO ((snd_output_type_t) SND_OUTPUT_STDIO)
#define SND_OUTPUT_BUFFER ((snd_output_type_t) SND_OUTPUT_BUFFER)
#ifdef __cplusplus
extern "C" {

View File

@ -13,18 +13,17 @@ typedef struct _snd_pcm_access_mask snd_pcm_access_mask_t;
typedef struct _snd_pcm_format_mask snd_pcm_format_mask_t;
typedef struct _snd_pcm_subformat_mask snd_pcm_subformat_mask_t;
/* sndrv aliasing */
#ifdef SND_ENUM_TYPECHECK
typedef struct _snd_pcm_class *snd_pcm_class_t;
typedef struct _snd_pcm_subclass *snd_pcm_subclass_t;
typedef struct _snd_pcm_stream *snd_pcm_stream_t;
typedef struct _snd_pcm_access *snd_pcm_access_t;
typedef struct _snd_pcm_format *snd_pcm_format_t;
typedef struct _snd_pcm_subformat *snd_pcm_subformat_t;
typedef struct _snd_pcm_state *snd_pcm_state_t;
typedef struct _snd_pcm_start *snd_pcm_start_t;
typedef struct _snd_pcm_xrun *snd_pcm_xrun_t;
typedef struct _snd_pcm_tstamp *snd_pcm_tstamp_t;
typedef struct __snd_pcm_class *snd_pcm_class_t;
typedef struct __snd_pcm_subclass *snd_pcm_subclass_t;
typedef struct __snd_pcm_stream *snd_pcm_stream_t;
typedef struct __snd_pcm_access *snd_pcm_access_t;
typedef struct __snd_pcm_format *snd_pcm_format_t;
typedef struct __snd_pcm_subformat *snd_pcm_subformat_t;
typedef struct __snd_pcm_state *snd_pcm_state_t;
typedef struct __snd_pcm_start *snd_pcm_start_t;
typedef struct __snd_pcm_xrun *snd_pcm_xrun_t;
typedef struct __snd_pcm_tstamp *snd_pcm_tstamp_t;
#else
typedef enum sndrv_pcm_class snd_pcm_class_t;
typedef enum sndrv_pcm_subclass snd_pcm_subclass_t;
@ -53,7 +52,7 @@ typedef enum sndrv_pcm_tstamp snd_pcm_tstamp_t;
#define SND_PCM_ACCESS_RW_INTERLEAVED ((snd_pcm_access_t) SNDRV_PCM_ACCESS_RW_INTERLEAVED)
#define SND_PCM_ACCESS_RW_NONINTERLEAVED ((snd_pcm_access_t) SNDRV_PCM_ACCESS_RW_NONINTERLEAVED)
#define SND_PCM_ACCESS_LAST ((snd_pcm_access_t) SNDRV_PCM_ACCESS_LAST)
#define SND_PCM_FORMAT_NONE ((snd_pcm_format_t) -1)
#define SND_PCM_FORMAT_UNKNOWN ((snd_pcm_format_t) -1)
#define SND_PCM_FORMAT_S8 ((snd_pcm_format_t) SNDRV_PCM_FORMAT_S8)
#define SND_PCM_FORMAT_U8 ((snd_pcm_format_t) SNDRV_PCM_FORMAT_U8)
#define SND_PCM_FORMAT_S16_LE ((snd_pcm_format_t) SNDRV_PCM_FORMAT_S16_LE)
@ -145,7 +144,7 @@ typedef struct timeval snd_timestamp_t;
typedef struct _snd_pcm snd_pcm_t;
typedef enum _snd_pcm_type {
enum _snd_pcm_type {
SND_PCM_TYPE_HW,
SND_PCM_TYPE_MULTI,
SND_PCM_TYPE_FILE,
@ -164,7 +163,32 @@ typedef enum _snd_pcm_type {
SND_PCM_TYPE_MIX,
SND_PCM_TYPE_DROUTE,
SND_PCM_TYPE_LBSERVER,
} snd_pcm_type_t;
};
#ifdef SND_ENUM_TYPECHECK
typedef struct __snd_pcm_type *snd_pcm_type_t;
#else
typedef enum _snd_pcm_type snd_pcm_type_t;
#endif
#define SND_PCM_TYPE_HW ((snd_pcm_type_t) SND_PCM_TYPE_HW)
#define SND_PCM_TYPE_MULTI ((snd_pcm_type_t) SND_PCM_TYPE_MULTI)
#define SND_PCM_TYPE_FILE ((snd_pcm_type_t) SND_PCM_TYPE_FILE)
#define SND_PCM_TYPE_NULL ((snd_pcm_type_t) SND_PCM_TYPE_NULL)
#define SND_PCM_TYPE_SHM ((snd_pcm_type_t) SND_PCM_TYPE_SHM)
#define SND_PCM_TYPE_INET ((snd_pcm_type_t) SND_PCM_TYPE_INET)
#define SND_PCM_TYPE_COPY ((snd_pcm_type_t) SND_PCM_TYPE_COPY)
#define SND_PCM_TYPE_LINEAR ((snd_pcm_type_t) SND_PCM_TYPE_LINEAR)
#define SND_PCM_TYPE_ALAW ((snd_pcm_type_t) SND_PCM_TYPE_ALAW)
#define SND_PCM_TYPE_MULAW ((snd_pcm_type_t) SND_PCM_TYPE_MULAW)
#define SND_PCM_TYPE_ADPCM ((snd_pcm_type_t) SND_PCM_TYPE_ADPCM)
#define SND_PCM_TYPE_RATE ((snd_pcm_type_t) SND_PCM_TYPE_RATE)
#define SND_PCM_TYPE_ROUTE ((snd_pcm_type_t) SND_PCM_TYPE_ROUTE)
#define SND_PCM_TYPE_PLUG ((snd_pcm_type_t) SND_PCM_TYPE_PLUG)
#define SND_PCM_TYPE_SHARE ((snd_pcm_type_t) SND_PCM_TYPE_SHARE)
#define SND_PCM_TYPE_MIX ((snd_pcm_type_t) SND_PCM_TYPE_MIX)
#define SND_PCM_TYPE_DROUTE ((snd_pcm_type_t) SND_PCM_TYPE_DROUTE)
#define SND_PCM_TYPE_LBSERVER ((snd_pcm_type_t) SND_PCM_TYPE_LBSERVER)
typedef struct _snd_pcm_channel_area {
void *addr; /* base address of channel samples */

View File

@ -9,15 +9,15 @@ typedef struct _snd_rawmidi_info snd_rawmidi_info_t;
typedef struct _snd_rawmidi_params snd_rawmidi_params_t;
typedef struct _snd_rawmidi_status snd_rawmidi_status_t;
/* sndrv aliasing */
#ifdef SND_ENUM_TYPECHECK
typedef struct _snd_rawmidi_stream *snd_rawmidi_stream_t;
typedef struct __snd_rawmidi_stream *snd_rawmidi_stream_t;
#else
typedef enum sndrv_rawmidi_stream snd_rawmidi_stream_t;
#endif
#define SND_RAWMIDI_STREAM_OUTPUT ((snd_rawmidi_stream_t) SNDRV_RAWMIDI_STREAM_OUTPUT)
#define SND_RAWMIDI_STREAM_INPUT ((snd_rawmidi_stream_t) SNDRV_RAWMIDI_STREAM_INPUT)
#define SND_RAWMIDI_INFO_OUTPUT SNDRV_RAWMIDI_INFO_OUTPUT
#define SND_RAWMIDI_INFO_INPUT SNDRV_RAWMIDI_INFO_INPUT
#define SND_RAWMIDI_INFO_DUPLEX SNDRV_RAWMIDI_INFO_DUPLEX
@ -30,11 +30,21 @@ typedef enum sndrv_rawmidi_stream snd_rawmidi_stream_t;
typedef struct _snd_rawmidi snd_rawmidi_t;
typedef enum _snd_rawmidi_type {
enum _snd_rawmidi_type {
SND_RAWMIDI_TYPE_HW,
SND_RAWMIDI_TYPE_SHM,
SND_RAWMIDI_TYPE_INET,
} snd_rawmidi_type_t;
};
#ifdef SND_ENUM_TYPECHECK
typedef struct __snd_rawmidi_type *snd_rawmidi_type_t;
#else
typedef enum _snd_rawmidi_type snd_rawmidi_type_t;
#endif
#define SND_RAWMIDI_TYPE_HW ((snd_rawmidi_type_t) SND_RAWMIDI_TYPE_HW)
#define SND_RAWMIDI_TYPE_SHM ((snd_rawmidi_type_t) SND_RAWMIDI_TYPE_SHM)
#define SND_RAWMIDI_TYPE_INET ((snd_rawmidi_type_t) SND_RAWMIDI_TYPE_INET)
#ifdef __cplusplus
extern "C" {

View File

@ -5,13 +5,10 @@
* *
****************************************************************************/
/* sndrv aliasing */
typedef sndrv_seq_tick_time_t snd_seq_tick_time_t;
typedef sndrv_seq_position_t snd_seq_position_t;
typedef sndrv_seq_frequency_t snd_seq_frequency_t;
typedef sndrv_seq_instr_cluster_t snd_seq_instr_cluster_t;
typedef enum sndrv_seq_client_type snd_seq_client_type_t;
typedef enum sndrv_seq_stop_mode snd_seq_stop_mode_t;
typedef struct sndrv_seq_port_info snd_seq_port_info_t;
typedef struct sndrv_seq_port_subscribe snd_seq_port_subscribe_t;
typedef struct sndrv_seq_event snd_seq_event_t;
@ -37,6 +34,9 @@ typedef struct sndrv_seq_instr_put snd_seq_instr_put_t;
typedef struct sndrv_seq_instr_get snd_seq_instr_get_t;
typedef union sndrv_seq_timestamp snd_seq_timestamp_t;
typedef enum sndrv_seq_client_type snd_seq_client_type_t;
typedef enum sndrv_seq_stop_mode snd_seq_stop_mode_t;
#define snd_seq_event_bounce_ext_data sndrv_seq_event_bounce_ext_data
#define snd_seq_ev_is_result_type sndrv_seq_ev_is_result_type
#define snd_seq_ev_is_channel_type sndrv_seq_ev_is_channel_type
@ -300,11 +300,21 @@ typedef union sndrv_seq_timestamp snd_seq_timestamp_t;
#define SND_SEQ_NONBLOCK 1
typedef enum _snd_seq_type {
enum _snd_seq_type {
SND_SEQ_TYPE_HW,
SND_SEQ_TYPE_SHM,
SND_SEQ_TYPE_INET,
} snd_seq_type_t;
};
#ifdef SND_ENUM_TYPECHECK
typedef struct __snd_seq_type *snd_seq_type_t;
#else
typedef enum _snd_seq_type snd_seq_type_t;
#endif
#define SND_SEQ_TYPE_HW ((snd_seq_type_t) SND_SEQ_TYPE_HW)
#define SND_SEQ_TYPE_SHM ((snd_seq_type_t) SND_SEQ_TYPE_SHM)
#define SND_SEQ_TYPE_INET ((snd_seq_type_t) SND_SEQ_TYPE_INET)
typedef struct _snd_seq snd_seq_t;

View File

@ -5,27 +5,34 @@
* *
****************************************************************************/
/* sndrv aliasing */
typedef enum sndrv_timer_type snd_timer_type_t;
typedef enum sndrv_timer_slave_type snd_timer_slave_type_t;
typedef enum sndrv_timer_global snd_timer_global_t;
typedef struct sndrv_timer_id snd_timer_id_t;
typedef struct sndrv_timer_select snd_timer_select_t;
typedef struct sndrv_timer_info snd_timer_info_t;
typedef struct sndrv_timer_params snd_timer_params_t;
typedef struct sndrv_timer_status snd_timer_status_t;
typedef struct sndrv_timer_read snd_timer_read_t;
#define SND_TIMER_TYPE_NONE SNDRV_TIMER_TYPE_NONE
#define SND_TIMER_TYPE_SLAVE SNDRV_TIMER_TYPE_SLAVE
#define SND_TIMER_TYPE_GLOBAL SNDRV_TIMER_TYPE_GLOBAL
#define SND_TIMER_TYPE_CARD SNDRV_TIMER_TYPE_CARD
#define SND_TIMER_TYPE_PCM SNDRV_TIMER_TYPE_PCM
#define SND_TIMER_STYPE_NONE SNDRV_TIMER_STYPE_NONE
#define SND_TIMER_STYPE_APPLICATION SNDRV_TIMER_STYPE_APPLICATION
#define SND_TIMER_STYPE_SEQUENCER SNDRV_TIMER_STYPE_SEQUENCER
#define SND_TIMER_STYPE_OSS_SEQUENCER SNDRV_TIMER_STYPE_OSS_SEQUENCER
#ifdef SND_ENUM_TYPECHECK
typedef struct __snd_timer_type *snd_timer_type_t;
typedef struct __snd_timer_slave_type *snd_timer_slave_type_t;
#else
typedef enum sndrv_timer_type snd_timer_type_t;
typedef enum sndrv_timer_slave_type snd_timer_slave_type_t;
#endif
#define SND_TIMER_TYPE_NONE ((snd_timer_type_t) SNDRV_TIMER_TYPE_NONE)
#define SND_TIMER_TYPE_SLAVE ((snd_timer_type_t) SNDRV_TIMER_TYPE_SLAVE)
#define SND_TIMER_TYPE_GLOBAL ((snd_timer_type_t) SNDRV_TIMER_TYPE_GLOBAL)
#define SND_TIMER_TYPE_CARD ((snd_timer_type_t) SNDRV_TIMER_TYPE_CARD)
#define SND_TIMER_TYPE_PCM ((snd_timer_type_t) SNDRV_TIMER_TYPE_PCM)
#define SND_TIMER_STYPE_NONE ((snd_timer_slave_type_t) SNDRV_TIMER_STYPE_NONE
#define SND_TIMER_STYPE_APPLICATION ((snd_timer_slave_type_t) SNDRV_TIMER_STYPE_APPLICATION
#define SND_TIMER_STYPE_SEQUENCER ((snd_timer_slave_type_t) SNDRV_TIMER_STYPE_SEQUENCER
#define SND_TIMER_STYPE_OSS_SEQUENCER ((snd_timer_slave_type_t) SNDRV_TIMER_STYPE_OSS_SEQUENCER
#define SND_TIMER_GLOBAL_SYSTEM SNDRV_TIMER_GLOBAL_SYSTEM
#define SND_TIMER_GLOBAL_RTC SNDRV_TIMER_GLOBAL_RTC
#define SND_TIMER_FLG_SLAVE SNDRV_TIMER_FLG_SLAVE
#define SND_TIMER_PARBIT_FLAGS SNDRV_TIMER_PARBIT_FLAGS
#define SND_TIMER_PARBIT_TICKS SNDRV_TIMER_PARBIT_TICKS

View File

@ -651,7 +651,7 @@ int snd_config_add(snd_config_t *father, snd_config_t *leaf)
int snd_config_delete(snd_config_t *config)
{
assert(config);
switch (config->type) {
switch (snd_enum_to_int(config->type)) {
case SND_CONFIG_TYPE_COMPOUND:
{
int err;
@ -755,7 +755,7 @@ int snd_config_set(snd_config_t *config, ...)
va_list arg;
va_start(arg, config);
assert(config);
switch (config->type) {
switch (snd_enum_to_int(config->type)) {
case SND_CONFIG_TYPE_INTEGER:
config->u.integer = va_arg(arg, long);
break;
@ -803,7 +803,7 @@ int snd_config_string_get(snd_config_t *config, char **ptr)
int snd_config_get(snd_config_t *config, void *ptr)
{
assert(config && ptr);
switch (config->type) {
switch (snd_enum_to_int(config->type)) {
case SND_CONFIG_TYPE_INTEGER:
* (long*) ptr = config->u.integer;
break;
@ -908,7 +908,7 @@ static int _snd_config_save_leaf(snd_config_t *n, snd_output_t *out,
{
int err;
unsigned int k;
switch (n->type) {
switch (snd_enum_to_int(n->type)) {
case SND_CONFIG_TYPE_INTEGER:
snd_output_printf(out, "%ld", n->u.integer);
break;

View File

@ -1,6 +1,6 @@
EXTRA_LTLIBRARIES=libhwdep.la
libhwdep_la_SOURCES = hwdep.c
libhwdep_la_SOURCES = hwdep.c hwdep_m4.c
all: libhwdep.la

View File

@ -110,7 +110,7 @@ int snd_hwdep_block_mode(snd_hwdep_t *hwdep, int enable)
return 0;
}
int snd_hwdep_info(snd_hwdep_t *hwdep, snd_hwdep_info_t * info)
int snd_hwdep_info(snd_hwdep_t *hwdep, snd_hwdep_info_t *info)
{
if (!hwdep || !info)
return -EINVAL;

86
src/hwdep/hwdep_m4.c Normal file
View File

@ -0,0 +1,86 @@
/*
* Hwdep - Automatically generated functions
* Copyright (c) 2001 by Abramo Bagnara <abramo@alsa-project.org>
*
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#include <errno.h>
#include <assert.h>
#include "local.h"
size_t snd_hwdep_info_sizeof()
{
return sizeof(snd_hwdep_info_t);
}
int snd_hwdep_info_malloc(snd_hwdep_info_t **ptr)
{
assert(ptr);
*ptr = malloc(sizeof(snd_hwdep_info_t));
if (!*ptr)
return -ENOMEM;
return 0;
}
void snd_hwdep_info_free(snd_hwdep_info_t *obj)
{
free(obj);
}
void snd_hwdep_info_copy(snd_hwdep_info_t *dst, const snd_hwdep_info_t *src)
{
assert(dst && src);
*dst = *src;
}
unsigned int snd_hwdep_info_get_device(const snd_hwdep_info_t *obj)
{
assert(obj);
return obj->device;
}
int snd_hwdep_info_get_card(const snd_hwdep_info_t *obj)
{
assert(obj);
return obj->card;
}
const char * snd_hwdep_info_get_id(const snd_hwdep_info_t *obj)
{
assert(obj);
return obj->id;
}
const char * snd_hwdep_info_get_name(const snd_hwdep_info_t *obj)
{
assert(obj);
return obj->name;
}
snd_hwdep_type_t snd_hwdep_info_get_type(const snd_hwdep_info_t *obj)
{
assert(obj);
return snd_int_to_enum(obj->type);
}
void snd_hwdep_info_set_device(snd_hwdep_info_t *obj, unsigned int val)
{
assert(obj);
obj->device = val;
}

View File

@ -83,20 +83,22 @@ int snd_mixer_poll_descriptor(snd_mixer_t *handle)
return snd_ctl_poll_descriptor(handle->ctl_handle);
}
const char *snd_mixer_simple_channel_name(int channel)
const char *snd_mixer_simple_channel_name(snd_mixer_channel_id_t channel)
{
static char *array[6] = {
"Front-Left",
"Front-Right",
"Front-Center",
"Rear-Left",
"Rear-Right",
"Woofer"
static char *array[snd_enum_to_int(SND_MIXER_CHN_LAST) + 1] = {
[SND_MIXER_CHN_FRONT_LEFT] = "Front Left",
[SND_MIXER_CHN_FRONT_RIGHT] = "Front Right",
[SND_MIXER_CHN_FRONT_CENTER] = "Front Center",
[SND_MIXER_CHN_REAR_LEFT] = "Rear Left",
[SND_MIXER_CHN_REAR_RIGHT] = "Rear Right",
[SND_MIXER_CHN_WOOFER] = "Woofer"
};
if (channel < 0 || channel > 5)
char *p;
assert(channel <= SND_MIXER_CHN_LAST);
p = array[snd_enum_to_int(channel)];
if (!p)
return "?";
return array[channel];
return p;
}
int snd_mixer_simple_control_list(snd_mixer_t *handle, snd_mixer_simple_control_list_t *list)

View File

@ -218,14 +218,7 @@ int snd_pcm_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2)
int snd_pcm_unlink(snd_pcm_t *pcm)
{
int fd;
switch (pcm->type) {
case SND_PCM_TYPE_HW:
case SND_PCM_TYPE_MULTI:
fd = snd_pcm_poll_descriptor(pcm);
break;
default:
return -ENOSYS;
}
fd = snd_pcm_link_descriptor(pcm);
if (ioctl(fd, SNDRV_PCM_IOCTL_UNLINK) < 0) {
SYSERR("SNDRV_PCM_IOCTL_UNLINK failed");
return -errno;
@ -409,7 +402,7 @@ snd_pcm_format_t snd_pcm_format_value(const char* name)
return format;
}
}
return SND_PCM_FORMAT_NONE;
return SND_PCM_FORMAT_UNKNOWN;
}
const char *snd_pcm_subformat_name(snd_pcm_subformat_t subformat)

View File

@ -600,7 +600,7 @@ int _snd_pcm_adpcm_open(snd_pcm_t **pcmp, char *name,
char *sname = NULL;
int err;
snd_pcm_t *spcm;
snd_pcm_format_t sformat = SND_PCM_FORMAT_NONE;
snd_pcm_format_t sformat = SND_PCM_FORMAT_UNKNOWN;
snd_config_foreach(i, conf) {
snd_config_t *n = snd_config_entry(i);
if (strcmp(n->id, "comment") == 0)
@ -625,7 +625,7 @@ int _snd_pcm_adpcm_open(snd_pcm_t **pcmp, char *name,
return -EINVAL;
}
sformat = snd_pcm_format_value(f);
if (sformat == SND_PCM_FORMAT_NONE) {
if (sformat == SND_PCM_FORMAT_UNKNOWN) {
ERR("Unknown sformat");
return -EINVAL;
}
@ -643,7 +643,7 @@ int _snd_pcm_adpcm_open(snd_pcm_t **pcmp, char *name,
ERR("sname is not defined");
return -EINVAL;
}
if (sformat == SND_PCM_FORMAT_NONE) {
if (sformat == SND_PCM_FORMAT_UNKNOWN) {
ERR("sformat is not defined");
return -EINVAL;
}

View File

@ -473,7 +473,7 @@ int _snd_pcm_alaw_open(snd_pcm_t **pcmp, char *name,
char *sname = NULL;
int err;
snd_pcm_t *spcm;
snd_pcm_format_t sformat = SND_PCM_FORMAT_NONE;
snd_pcm_format_t sformat = SND_PCM_FORMAT_UNKNOWN;
snd_config_foreach(i, conf) {
snd_config_t *n = snd_config_entry(i);
if (strcmp(n->id, "comment") == 0)
@ -498,7 +498,7 @@ int _snd_pcm_alaw_open(snd_pcm_t **pcmp, char *name,
return -EINVAL;
}
sformat = snd_pcm_format_value(f);
if (sformat == SND_PCM_FORMAT_NONE) {
if (sformat == SND_PCM_FORMAT_UNKNOWN) {
ERR("Unknown sformat");
return -EINVAL;
}
@ -516,7 +516,7 @@ int _snd_pcm_alaw_open(snd_pcm_t **pcmp, char *name,
ERR("sname is not defined");
return -EINVAL;
}
if (sformat == SND_PCM_FORMAT_NONE) {
if (sformat == SND_PCM_FORMAT_UNKNOWN) {
ERR("sformat is not defined");
return -EINVAL;
}

View File

@ -371,7 +371,7 @@ int _snd_pcm_linear_open(snd_pcm_t **pcmp, char *name,
char *sname = NULL;
int err;
snd_pcm_t *spcm;
snd_pcm_format_t sformat = SND_PCM_FORMAT_NONE;
snd_pcm_format_t sformat = SND_PCM_FORMAT_UNKNOWN;
snd_config_foreach(i, conf) {
snd_config_t *n = snd_config_entry(i);
if (strcmp(n->id, "comment") == 0)
@ -396,7 +396,7 @@ int _snd_pcm_linear_open(snd_pcm_t **pcmp, char *name,
return -EINVAL;
}
sformat = snd_pcm_format_value(f);
if (sformat == SND_PCM_FORMAT_NONE) {
if (sformat == SND_PCM_FORMAT_UNKNOWN) {
ERR("Unknown sformat %s", f);
return err;
}
@ -413,7 +413,7 @@ int _snd_pcm_linear_open(snd_pcm_t **pcmp, char *name,
ERR("sname is not defined");
return -EINVAL;
}
if (sformat == SND_PCM_FORMAT_NONE) {
if (sformat == SND_PCM_FORMAT_UNKNOWN) {
ERR("sformat is not defined");
return -EINVAL;
}

View File

@ -26,7 +26,7 @@
#define bswap_16 swab16
#define bswap_32 swab32
#define bswap_64 swab64
#define SND_PCM_FORMAT_NONE (-1)
#define SND_PCM_FORMAT_UNKNOWN (-1)
#define snd_enum_to_int(v) (v)
#define snd_int_to_enum(v) (v)
#else
@ -442,7 +442,7 @@ snd_pcm_format_t snd_pcm_build_linear_format(int width, int unsignd, int big_end
width = 3;
break;
default:
return SND_PCM_FORMAT_NONE;
return SND_PCM_FORMAT_UNKNOWN;
}
return snd_int_to_enum(((int(*)[2][2])linear_formats)[width][!!unsignd][!!big_endian]);
}

View File

@ -488,7 +488,7 @@ int _snd_pcm_mulaw_open(snd_pcm_t **pcmp, char *name,
char *sname = NULL;
int err;
snd_pcm_t *spcm;
snd_pcm_format_t sformat = SND_PCM_FORMAT_NONE;
snd_pcm_format_t sformat = SND_PCM_FORMAT_UNKNOWN;
snd_config_foreach(i, conf) {
snd_config_t *n = snd_config_entry(i);
if (strcmp(n->id, "comment") == 0)
@ -513,7 +513,7 @@ int _snd_pcm_mulaw_open(snd_pcm_t **pcmp, char *name,
return -EINVAL;
}
sformat = snd_pcm_format_value(f);
if (sformat == SND_PCM_FORMAT_NONE) {
if (sformat == SND_PCM_FORMAT_UNKNOWN) {
ERR("Unknown sformat");
return -EINVAL;
}
@ -531,7 +531,7 @@ int _snd_pcm_mulaw_open(snd_pcm_t **pcmp, char *name,
ERR("sname is not defined");
return -EINVAL;
}
if (sformat == SND_PCM_FORMAT_NONE) {
if (sformat == SND_PCM_FORMAT_UNKNOWN) {
ERR("sformat is not defined");
return -EINVAL;
}

View File

@ -132,7 +132,7 @@ static snd_pcm_format_t snd_pcm_plug_slave_format(snd_pcm_format_t format, const
}
/* Fall through */
default:
return SND_PCM_FORMAT_NONE;
return SND_PCM_FORMAT_UNKNOWN;
}
}
@ -144,7 +144,7 @@ static snd_pcm_format_t snd_pcm_plug_slave_format(snd_pcm_format_t format, const
if (snd_pcm_format_mask_test(format_mask, f))
return f;
}
return SND_PCM_FORMAT_NONE;
return SND_PCM_FORMAT_UNKNOWN;
}
w = snd_pcm_format_width(format);
u = snd_pcm_format_unsigned(format);
@ -158,7 +158,7 @@ static snd_pcm_format_t snd_pcm_plug_slave_format(snd_pcm_format_t format, const
for (sgn = 0; sgn < 2; ++sgn) {
snd_pcm_format_t f;
f = snd_pcm_build_linear_format(w1, u1, e1);
assert(f != SND_PCM_FORMAT_NONE);
assert(f != SND_PCM_FORMAT_UNKNOWN);
if (snd_pcm_format_mask_test(format_mask, f))
return f;
u1 = !u1;
@ -172,7 +172,7 @@ static snd_pcm_format_t snd_pcm_plug_slave_format(snd_pcm_format_t format, const
dw = -8;
}
}
return SND_PCM_FORMAT_NONE;
return SND_PCM_FORMAT_UNKNOWN;
}
#define SND_PCM_FMTBIT_PLUG (SND_PCM_FMTBIT_LINEAR | \
@ -401,9 +401,8 @@ static int snd_pcm_plug_hw_refine_cprepare(snd_pcm_t *pcm ATTRIBUTE_UNUSED, snd_
static int snd_pcm_plug_hw_refine_sprepare(snd_pcm_t *pcm ATTRIBUTE_UNUSED, snd_pcm_hw_params_t *sparams)
{
snd_pcm_plug_t *plug = pcm->private;
snd_pcm_t *slave = plug->req_slave;
return snd_pcm_hw_params_any(slave, sparams);
_snd_pcm_hw_params_any(sparams);
return 0;
}
static int snd_pcm_plug_hw_refine_schange(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
@ -436,7 +435,7 @@ static int snd_pcm_plug_hw_refine_schange(snd_pcm_t *pcm, snd_pcm_hw_params_t *p
f = format;
else {
f = snd_pcm_plug_slave_format(format, sformat_mask);
if (f == SND_PCM_FORMAT_NONE)
if (f == SND_PCM_FORMAT_UNKNOWN)
continue;
}
snd_pcm_format_mask_set(&sfmt_mask, f);
@ -496,7 +495,7 @@ static int snd_pcm_plug_hw_refine_cchange(snd_pcm_t *pcm ATTRIBUTE_UNUSED,
f = format;
else {
f = snd_pcm_plug_slave_format(format, sformat_mask);
if (f == SND_PCM_FORMAT_NONE)
if (f == SND_PCM_FORMAT_UNKNOWN)
continue;
}
snd_pcm_format_mask_set(&fmt_mask, format);

View File

@ -258,7 +258,7 @@ static int snd_pcm_rate_hw_refine_sprepare(snd_pcm_t *pcm, snd_pcm_hw_params_t *
_snd_pcm_hw_params_any(sparams);
_snd_pcm_hw_param_set_mask(sparams, SND_PCM_HW_PARAM_ACCESS,
&saccess_mask);
if (rate->sformat != SND_PCM_FORMAT_NONE) {
if (rate->sformat != SND_PCM_FORMAT_UNKNOWN) {
_snd_pcm_hw_params_set_format(sparams, rate->sformat);
_snd_pcm_hw_params_set_subformat(sparams, SND_PCM_SUBFORMAT_STD);
}
@ -277,7 +277,7 @@ static int snd_pcm_rate_hw_refine_schange(snd_pcm_t *pcm, snd_pcm_hw_params_t *p
unsigned int links = (SND_PCM_HW_PARBIT_CHANNELS |
SND_PCM_HW_PARBIT_PERIOD_TIME |
SND_PCM_HW_PARBIT_TICK_TIME);
if (rate->sformat == SND_PCM_FORMAT_NONE)
if (rate->sformat == SND_PCM_FORMAT_UNKNOWN)
links |= (SND_PCM_HW_PARBIT_FORMAT |
SND_PCM_HW_PARBIT_SUBFORMAT |
SND_PCM_HW_PARBIT_SAMPLE_BITS |
@ -307,7 +307,7 @@ static int snd_pcm_rate_hw_refine_cchange(snd_pcm_t *pcm, snd_pcm_hw_params_t *p
unsigned int links = (SND_PCM_HW_PARBIT_CHANNELS |
SND_PCM_HW_PARBIT_PERIOD_TIME |
SND_PCM_HW_PARBIT_TICK_TIME);
if (rate->sformat == SND_PCM_FORMAT_NONE)
if (rate->sformat == SND_PCM_FORMAT_UNKNOWN)
links |= (SND_PCM_HW_PARBIT_FORMAT |
SND_PCM_HW_PARBIT_SUBFORMAT |
SND_PCM_HW_PARBIT_SAMPLE_BITS |
@ -542,7 +542,7 @@ snd_pcm_sframes_t snd_pcm_rate_slave_frames(snd_pcm_t *pcm, snd_pcm_sframes_t fr
static void snd_pcm_rate_dump(snd_pcm_t *pcm, snd_output_t *out)
{
snd_pcm_rate_t *rate = pcm->private;
if (rate->sformat == SND_PCM_FORMAT_NONE)
if (rate->sformat == SND_PCM_FORMAT_UNKNOWN)
snd_output_printf(out, "Rate conversion PCM (%d)\n",
rate->srate);
else
@ -577,7 +577,7 @@ int snd_pcm_rate_open(snd_pcm_t **pcmp, char *name, snd_pcm_format_t sformat, in
snd_pcm_t *pcm;
snd_pcm_rate_t *rate;
assert(pcmp && slave);
if (sformat != SND_PCM_FORMAT_NONE &&
if (sformat != SND_PCM_FORMAT_UNKNOWN &&
snd_pcm_format_linear(sformat) != 1)
return -EINVAL;
rate = calloc(1, sizeof(snd_pcm_rate_t));
@ -625,7 +625,7 @@ int _snd_pcm_rate_open(snd_pcm_t **pcmp, char *name,
char *sname = NULL;
int err;
snd_pcm_t *spcm;
snd_pcm_format_t sformat = SND_PCM_FORMAT_NONE;
snd_pcm_format_t sformat = SND_PCM_FORMAT_UNKNOWN;
long srate = -1;
snd_config_foreach(i, conf) {
snd_config_t *n = snd_config_entry(i);
@ -651,7 +651,7 @@ int _snd_pcm_rate_open(snd_pcm_t **pcmp, char *name,
return -EINVAL;
}
sformat = snd_pcm_format_value(f);
if (sformat == SND_PCM_FORMAT_NONE) {
if (sformat == SND_PCM_FORMAT_UNKNOWN) {
ERR("Unknown sformat");
return -EINVAL;
}

View File

@ -465,7 +465,7 @@ static int snd_pcm_route_hw_refine_sprepare(snd_pcm_t *pcm, snd_pcm_hw_params_t
_snd_pcm_hw_params_any(sparams);
_snd_pcm_hw_param_set_mask(sparams, SND_PCM_HW_PARAM_ACCESS,
&saccess_mask);
if (route->sformat != SND_PCM_FORMAT_NONE) {
if (route->sformat != SND_PCM_FORMAT_UNKNOWN) {
_snd_pcm_hw_params_set_format(sparams, route->sformat);
_snd_pcm_hw_params_set_subformat(sparams, SND_PCM_SUBFORMAT_STD);
}
@ -488,7 +488,7 @@ static int snd_pcm_route_hw_refine_schange(snd_pcm_t *pcm, snd_pcm_hw_params_t *
SND_PCM_HW_PARBIT_BUFFER_SIZE |
SND_PCM_HW_PARBIT_BUFFER_TIME |
SND_PCM_HW_PARBIT_TICK_TIME);
if (route->sformat == SND_PCM_FORMAT_NONE)
if (route->sformat == SND_PCM_FORMAT_UNKNOWN)
links |= (SND_PCM_HW_PARBIT_FORMAT |
SND_PCM_HW_PARBIT_SUBFORMAT |
SND_PCM_HW_PARBIT_SAMPLE_BITS);
@ -512,7 +512,7 @@ static int snd_pcm_route_hw_refine_cchange(snd_pcm_t *pcm, snd_pcm_hw_params_t *
SND_PCM_HW_PARBIT_BUFFER_SIZE |
SND_PCM_HW_PARBIT_BUFFER_TIME |
SND_PCM_HW_PARBIT_TICK_TIME);
if (route->sformat == SND_PCM_FORMAT_NONE)
if (route->sformat == SND_PCM_FORMAT_UNKNOWN)
links |= (SND_PCM_HW_PARBIT_FORMAT |
SND_PCM_HW_PARBIT_SUBFORMAT |
SND_PCM_HW_PARBIT_SAMPLE_BITS);
@ -642,7 +642,7 @@ static void snd_pcm_route_dump(snd_pcm_t *pcm, snd_output_t *out)
{
snd_pcm_route_t *route = pcm->private;
unsigned int dst;
if (route->sformat == SND_PCM_FORMAT_NONE)
if (route->sformat == SND_PCM_FORMAT_UNKNOWN)
snd_output_printf(out, "Route conversion PCM\n");
else
snd_output_printf(out, "Route conversion PCM (sformat=%s)\n",
@ -774,7 +774,7 @@ int snd_pcm_route_open(snd_pcm_t **pcmp, char *name,
snd_pcm_route_t *route;
int err;
assert(pcmp && slave && ttable);
if (sformat != SND_PCM_FORMAT_NONE &&
if (sformat != SND_PCM_FORMAT_UNKNOWN &&
snd_pcm_format_linear(sformat) != 1)
return -EINVAL;
route = calloc(1, sizeof(snd_pcm_route_t));
@ -886,7 +886,7 @@ int _snd_pcm_route_open(snd_pcm_t **pcmp, char *name,
char *sname = NULL;
int err;
snd_pcm_t *spcm;
snd_pcm_format_t sformat = SND_PCM_FORMAT_NONE;
snd_pcm_format_t sformat = SND_PCM_FORMAT_UNKNOWN;
long schannels = -1;
snd_config_t *tt = NULL;
snd_pcm_route_ttable_entry_t ttable[MAX_CHANNELS*MAX_CHANNELS];
@ -915,7 +915,7 @@ int _snd_pcm_route_open(snd_pcm_t **pcmp, char *name,
return -EINVAL;
}
sformat = snd_pcm_format_value(f);
if (sformat == SND_PCM_FORMAT_NONE) {
if (sformat == SND_PCM_FORMAT_UNKNOWN) {
ERR("Unknown sformat");
return -EINVAL;
}

View File

@ -469,7 +469,7 @@ static int snd_pcm_share_hw_refine_cprepare(snd_pcm_t *pcm, snd_pcm_hw_params_t
share->channels_count, 0);
if (err < 0)
return err;
if (slave->format != SND_PCM_FORMAT_NONE) {
if (slave->format != SND_PCM_FORMAT_UNKNOWN) {
err = _snd_pcm_hw_params_set_format(params, slave->format);
if (err < 0)
return err;
@ -1371,7 +1371,7 @@ int _snd_pcm_share_open(snd_pcm_t **pcmp, char *name, snd_config_t *conf,
unsigned int channels_count = 0;
long schannels_count = -1;
unsigned int schannel_max = 0;
snd_pcm_format_t sformat = SND_PCM_FORMAT_NONE;
snd_pcm_format_t sformat = SND_PCM_FORMAT_UNKNOWN;
long srate = -1;
snd_config_foreach(i, conf) {
@ -1398,7 +1398,7 @@ int _snd_pcm_share_open(snd_pcm_t **pcmp, char *name, snd_config_t *conf,
return -EINVAL;
}
sformat = snd_pcm_format_value(f);
if (sformat == SND_PCM_FORMAT_NONE) {
if (sformat == SND_PCM_FORMAT_UNKNOWN) {
ERR("Unknown format %s", f);
return -EINVAL;
}

View File

@ -73,7 +73,7 @@ typedef struct {
struct _snd_seq {
char *name;
int type;
snd_seq_type_t type;
int streams;
int mode;
int poll_fd;