version 1.11, 2004/07/06 02:46:06 |
version 1.12, 2006/03/14 19:36:44 |
|
|
#include <sys/audioio.h> |
#include <sys/audioio.h> |
|
|
struct field *findfield(char *name); |
struct field *findfield(char *name); |
void prfield(struct field *p, char *sep); |
void prfield(struct field *p, const char *sep); |
void rdfield(struct field *p, char *q); |
void rdfield(struct field *p, char *q); |
void getinfo(int fd); |
void getinfo(int fd); |
void usage(void); |
void usage(void); |
|
|
int properties, fullduplex, rerror; |
int properties, fullduplex, rerror; |
|
|
struct field { |
struct field { |
char *name; |
const char *name; |
void *valp; |
void *valp; |
int format; |
int format; |
#define STRING 1 |
#define STRING 1 |
|
|
}; |
}; |
|
|
struct { |
struct { |
char *ename; |
const char *ename; |
int eno; |
u_int eno; |
} encs[] = { |
} encs[] = { |
{ AudioEmulaw, AUDIO_ENCODING_ULAW }, |
{ AudioEmulaw, AUDIO_ENCODING_ULAW }, |
{ "ulaw", AUDIO_ENCODING_ULAW }, |
{ "ulaw", AUDIO_ENCODING_ULAW }, |
|
|
}; |
}; |
|
|
static struct { |
static struct { |
char *name; |
const char *name; |
u_int prop; |
u_int prop; |
} props[] = { |
} props[] = { |
{ "full_duplex", AUDIO_PROP_FULLDUPLEX }, |
{ "full_duplex", AUDIO_PROP_FULLDUPLEX }, |
|
|
} |
} |
|
|
void |
void |
prfield(struct field *p, char *sep) |
prfield(struct field *p, const char *sep) |
{ |
{ |
u_int v; |
u_int v; |
char *cm; |
const char *cm; |
int i; |
int i; |
|
|
if (sep) |
if (sep) |
|
|
int aflag = 0, canwrite, writeinfo = 0; |
int aflag = 0, canwrite, writeinfo = 0; |
struct stat dstat, ostat; |
struct stat dstat, ostat; |
struct field *p; |
struct field *p; |
char *file; |
const char *file; |
char *sep = "="; |
const char *sep = "="; |
|
|
if ((file = getenv("AUDIOCTLDEVICE")) == 0 || *file == '\0') |
if ((file = getenv("AUDIOCTLDEVICE")) == 0 || *file == '\0') |
file = "/dev/audioctl"; |
file = "/dev/audioctl"; |