mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
Encapsulated hwdep. Converted all enums to type safety
This commit is contained in:
parent
a83b209df2
commit
5bf23ae9a1
32 changed files with 510 additions and 268 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue