Compilation fixes...

This commit is contained in:
Jaroslav Kysela 1999-06-13 10:09:54 +00:00
parent 55708f7849
commit 551d49e092
6 changed files with 38 additions and 37 deletions

View file

@ -163,7 +163,7 @@ int soundcard_setup_merge_switches(int cardno)
continue; continue;
} }
soundcard_setup_merge_sw(pcm->pswitches, rpcm->pswitches, soundcard->no, pcm->no, "PCM playback"); soundcard_setup_merge_sw(pcm->pswitches, rpcm->pswitches, soundcard->no, pcm->no, "PCM playback");
soundcard_setup_merge_sw(pcm->rswitches, rpcm->rswitches, soundcard->no, pcm->no, "PCM record"); soundcard_setup_merge_sw(pcm->rswitches, rpcm->rswitches, soundcard->no, pcm->no, "PCM capture");
} }
for (rrawmidi = rsoundcard->rawmidis; rrawmidi; rrawmidi = rrawmidi->next) { for (rrawmidi = rsoundcard->rawmidis; rrawmidi; rrawmidi = rrawmidi->next) {
for (rawmidi = soundcard->rawmidis; rawmidi; rawmidi = rawmidi->next) { for (rawmidi = soundcard->rawmidis; rawmidi; rawmidi = rawmidi->next) {
@ -429,8 +429,8 @@ int soundcard_setup_process_switches(int cardno)
for (ctlsw = pcm->rswitches; ctlsw; ctlsw = ctlsw->next) { for (ctlsw = pcm->rswitches; ctlsw; ctlsw = ctlsw->next) {
if (ctlsw->change) if (ctlsw->change)
if (!soundcard_open_ctl(&ctlhandle, soundcard)) { if (!soundcard_open_ctl(&ctlhandle, soundcard)) {
if ((err = snd_ctl_pcm_record_switch_write(ctlhandle, pcm->no, &ctlsw->s)) < 0) if ((err = snd_ctl_pcm_capture_switch_write(ctlhandle, pcm->no, &ctlsw->s)) < 0)
error("PCM record switch '%s' write error: %s", ctlsw->s.name, snd_strerror(err)); error("PCM capture switch '%s' write error: %s", ctlsw->s.name, snd_strerror(err));
} }
} }
} }

View file

@ -215,7 +215,7 @@ static int switch_list(void *handle, snd_switch_list_t *list, int interface, int
case 2: case 2:
return snd_ctl_pcm_playback_switch_list(handle, device, list); return snd_ctl_pcm_playback_switch_list(handle, device, list);
case 3: case 3:
return snd_ctl_pcm_record_switch_list(handle, device, list); return snd_ctl_pcm_capture_switch_list(handle, device, list);
case 4: case 4:
return snd_ctl_rawmidi_output_switch_list(handle, device, list); return snd_ctl_rawmidi_output_switch_list(handle, device, list);
case 5: case 5:
@ -235,7 +235,7 @@ static int switch_read(void *handle, snd_switch_t *sw, int interface, int device
case 2: case 2:
return snd_ctl_pcm_playback_switch_read(handle, device, sw); return snd_ctl_pcm_playback_switch_read(handle, device, sw);
case 3: case 3:
return snd_ctl_pcm_record_switch_read(handle, device, sw); return snd_ctl_pcm_capture_switch_read(handle, device, sw);
case 4: case 4:
return snd_ctl_rawmidi_output_switch_read(handle, device, sw); return snd_ctl_rawmidi_output_switch_read(handle, device, sw);
case 5: case 5:
@ -256,7 +256,7 @@ static int switch_write(void *handle, snd_switch_t *sw, int interface, int devic
case 2: case 2:
return snd_ctl_pcm_playback_switch_write(handle, device, sw); return snd_ctl_pcm_playback_switch_write(handle, device, sw);
case 3: case 3:
return snd_ctl_pcm_record_switch_write(handle, device, sw); return snd_ctl_pcm_capture_switch_write(handle, device, sw);
case 4: case 4:
return snd_ctl_rawmidi_output_switch_write(handle, device, sw); return snd_ctl_rawmidi_output_switch_write(handle, device, sw);
case 5: case 5:
@ -947,7 +947,7 @@ int soundcard_setup_write(const char *cfgfile, int cardno)
fprintf(out, " }\n"); fprintf(out, " }\n");
} }
if (pcm->rswitches) { if (pcm->rswitches) {
fprintf(out, " record {"); fprintf(out, " capture {");
soundcard_setup_write_switches(out, " ", SND_INTERFACE_PCM, &pcm->rswitches); soundcard_setup_write_switches(out, " ", SND_INTERFACE_PCM, &pcm->rswitches);
fprintf(out, " }\n"); fprintf(out, " }\n");
} }

View file

@ -297,7 +297,7 @@ int show_mux1_info(void *handle, snd_mixer_element_info_t *info, const char *spa
snd_mixer_routes_t routes; snd_mixer_routes_t routes;
snd_mixer_eid_t *element; snd_mixer_eid_t *element;
printf("%sMux supports none input: %s\n", space, (info->data.mux1.attribute & SND_MIXER_MUX1_NONE) ? "YES" : "NO"); printf("%sMux supports none input: %s\n", space, (info->data.mux1.attrib & SND_MIXER_MUX1_NONE) ? "YES" : "NO");
bzero(&elements, sizeof(elements)); bzero(&elements, sizeof(elements));
if ((err = snd_mixer_elements(handle, &elements)) < 0) { if ((err = snd_mixer_elements(handle, &elements)) < 0) {
error("Mixer %i/%i elements error: %s", card, device, snd_strerror(err)); error("Mixer %i/%i elements error: %s", card, device, snd_strerror(err));
@ -366,9 +366,9 @@ int show_element_info(void *handle, snd_mixer_eid_t *eid, const char *space)
switch (info.eid.type) { switch (info.eid.type) {
case SND_MIXER_ETYPE_INPUT: case SND_MIXER_ETYPE_INPUT:
case SND_MIXER_ETYPE_OUTPUT: case SND_MIXER_ETYPE_OUTPUT:
if (info.data.io.attribute) { if (info.data.io.attrib) {
printf("%sAttributes%s\n", space, printf("%sAttributes%s\n", space,
info.data.io.attribute & SND_MIXER_EIO_DIGITAL ? " digital" : ""); info.data.io.attrib & SND_MIXER_EIO_DIGITAL ? " digital" : "");
} }
for (idx = 0; idx < info.data.io.voices; idx++) { for (idx = 0; idx < info.data.io.voices; idx++) {
if (!info.data.io.pvoices[idx].vindex) { if (!info.data.io.pvoices[idx].vindex) {

View file

@ -53,7 +53,7 @@
char *command; char *command;
snd_pcm_t *pcm_handle; snd_pcm_t *pcm_handle;
struct snd_pcm_playback_info pinfo; struct snd_pcm_playback_info pinfo;
struct snd_pcm_record_info rinfo; struct snd_pcm_capture_info rinfo;
snd_pcm_format_t rformat, format; snd_pcm_format_t rformat, format;
int timelimit = 0; int timelimit = 0;
int quiet_mode = 0; int quiet_mode = 0;
@ -69,7 +69,7 @@ int vocmajor, vocminor;
/* needed prototypes */ /* needed prototypes */
static void playback(char *filename); static void playback(char *filename);
static void record(char *filename); static void capture(char *filename);
static void begin_voc(int fd, u_long count); static void begin_voc(int fd, u_long count);
static void end_voc(int fd); static void end_voc(int fd);
@ -77,7 +77,7 @@ static void begin_wave(int fd, u_long count);
static void end_wave(int fd); static void end_wave(int fd);
static void begin_au(int fd, u_long count); static void begin_au(int fd, u_long count);
struct fmt_record { struct fmt_capture {
void (*start) (int fd, u_long count); void (*start) (int fd, u_long count);
void (*end) (int fd); void (*end) (int fd);
char *what; char *what;
@ -122,7 +122,7 @@ static void check_new_format(snd_pcm_format_t * format)
} }
} else { } else {
if (rinfo.min_rate > format->rate || rinfo.max_rate < format->rate) { if (rinfo.min_rate > format->rate || rinfo.max_rate < format->rate) {
fprintf(stderr, "%s: unsupported rate %iHz for record (valid range is %iHz-%iHz)\n", command, format->rate, rinfo.min_rate, rinfo.max_rate); fprintf(stderr, "%s: unsupported rate %iHz for capture (valid range is %iHz-%iHz)\n", command, format->rate, rinfo.min_rate, rinfo.max_rate);
exit(1); exit(1);
} }
if (!(rinfo.formats & (1 << format->format))) { if (!(rinfo.formats & (1 << format->format))) {
@ -166,7 +166,7 @@ static void device_list(void)
struct snd_ctl_hw_info info; struct snd_ctl_hw_info info;
snd_pcm_info_t pcminfo; snd_pcm_info_t pcminfo;
snd_pcm_playback_info_t playinfo; snd_pcm_playback_info_t playinfo;
snd_pcm_record_info_t recinfo; snd_pcm_capture_info_t recinfo;
mask = snd_cards_mask(); mask = snd_cards_mask();
if (!mask) { if (!mask) {
@ -198,7 +198,7 @@ static void device_list(void)
pcminfo.name); pcminfo.name);
printf(" Directions: %s%s%s\n", printf(" Directions: %s%s%s\n",
pcminfo.flags & SND_PCM_INFO_PLAYBACK ? "playback " : "", pcminfo.flags & SND_PCM_INFO_PLAYBACK ? "playback " : "",
pcminfo.flags & SND_PCM_INFO_RECORD ? "record " : "", pcminfo.flags & SND_PCM_INFO_CAPTURE ? "capture " : "",
pcminfo.flags & SND_PCM_INFO_DUPLEX ? "duplex " : ""); pcminfo.flags & SND_PCM_INFO_DUPLEX ? "duplex " : "");
if ((err = snd_ctl_pcm_playback_info(handle, dev, &playinfo)) < 0) { if ((err = snd_ctl_pcm_playback_info(handle, dev, &playinfo)) < 0) {
printf("Error: control digital audio playback info (%i): %s\n", card, snd_strerror(err)); printf("Error: control digital audio playback info (%i): %s\n", card, snd_strerror(err));
@ -214,12 +214,12 @@ static void device_list(void)
printf(" %s%s\n", get_format(idx), printf(" %s%s\n", get_format(idx),
playinfo.hw_formats & (1 << idx) ? " [hardware]" : ""); playinfo.hw_formats & (1 << idx) ? " [hardware]" : "");
} }
if ((err = snd_ctl_pcm_record_info(handle, dev, &recinfo)) < 0) { if ((err = snd_ctl_pcm_capture_info(handle, dev, &recinfo)) < 0) {
printf("Error: control digital audio record info (%i): %s\n", card, snd_strerror(err)); printf("Error: control digital audio capture info (%i): %s\n", card, snd_strerror(err));
continue; continue;
} }
} }
if (pcminfo.flags & SND_PCM_INFO_RECORD) { if (pcminfo.flags & SND_PCM_INFO_CAPTURE) {
printf(" Record:\n"); printf(" Record:\n");
printf(" Rate range: %iHz-%iHz\n", recinfo.min_rate, recinfo.max_rate); printf(" Rate range: %iHz-%iHz\n", recinfo.min_rate, recinfo.max_rate);
printf(" Voices range: %i-%i\n", recinfo.min_channels, recinfo.max_channels); printf(" Voices range: %i-%i\n", recinfo.min_channels, recinfo.max_channels);
@ -249,7 +249,7 @@ int main(int argc, char *argv[])
command = argv[0]; command = argv[0];
active_format = FORMAT_DEFAULT; active_format = FORMAT_DEFAULT;
if (strstr(argv[0], "arecord")) { if (strstr(argv[0], "arecord")) {
direction = SND_PCM_OPEN_RECORD; direction = SND_PCM_OPEN_CAPTURE;
active_format = FORMAT_WAVE; active_format = FORMAT_WAVE;
command = "Arecord"; command = "Arecord";
} else if (strstr(argv[0], "aplay")) { } else if (strstr(argv[0], "aplay")) {
@ -396,8 +396,8 @@ int main(int argc, char *argv[])
tmp = pinfo.buffer_size; tmp = pinfo.buffer_size;
tmp /= 4; /* 4 fragments are best */ tmp /= 4; /* 4 fragments are best */
} else { } else {
if ((err = snd_pcm_record_info(pcm_handle, &rinfo)) < 0) { if ((err = snd_pcm_capture_info(pcm_handle, &rinfo)) < 0) {
fprintf(stderr, "Error: record info error: %s\n", snd_strerror(err)); fprintf(stderr, "Error: capture info error: %s\n", snd_strerror(err));
return 1; return 1;
} }
tmp = rinfo.buffer_size; tmp = rinfo.buffer_size;
@ -420,13 +420,13 @@ int main(int argc, char *argv[])
if (direction == SND_PCM_OPEN_PLAYBACK) if (direction == SND_PCM_OPEN_PLAYBACK)
playback(NULL); playback(NULL);
else else
record(NULL); capture(NULL);
} else { } else {
while (optind <= argc - 1) { while (optind <= argc - 1) {
if (direction == SND_PCM_OPEN_PLAYBACK) if (direction == SND_PCM_OPEN_PLAYBACK)
playback(argv[optind++]); playback(argv[optind++]);
else else
record(argv[optind++]); capture(argv[optind++]);
} }
} }
snd_pcm_close(pcm_handle); snd_pcm_close(pcm_handle);
@ -562,7 +562,7 @@ static void set_format(void)
unsigned int bps; /* bytes per second */ unsigned int bps; /* bytes per second */
unsigned int size; /* fragment size */ unsigned int size; /* fragment size */
struct snd_pcm_playback_params pparams; struct snd_pcm_playback_params pparams;
struct snd_pcm_record_params rparams; struct snd_pcm_capture_params rparams;
bps = format.rate * format.channels; bps = format.rate * format.channels;
switch (format.format) { switch (format.format) {
@ -597,15 +597,15 @@ static void set_format(void)
exit(1); exit(1);
} }
} else { } else {
if (snd_pcm_record_format(pcm_handle, &format) < 0) { if (snd_pcm_capture_format(pcm_handle, &format) < 0) {
fprintf(stderr, "%s: unable to set record format %s, %iHz, %i voices\n", command, get_format(format.format), format.rate, format.channels); fprintf(stderr, "%s: unable to set capture format %s, %iHz, %i voices\n", command, get_format(format.format), format.rate, format.channels);
exit(1); exit(1);
} }
memset(&rparams, 0, sizeof(rparams)); memset(&rparams, 0, sizeof(rparams));
rparams.fragment_size = size; rparams.fragment_size = size;
rparams.fragments_min = 1; rparams.fragments_min = 1;
if (snd_pcm_record_params(pcm_handle, &rparams) < 0) { if (snd_pcm_capture_params(pcm_handle, &rparams) < 0) {
fprintf(stderr, "%s: unable to set record params\n", command); fprintf(stderr, "%s: unable to set capture params\n", command);
exit(1); exit(1);
} }
} }
@ -1059,9 +1059,9 @@ void playback_go(int fd, int loaded, u_long count, int rtype, char *name)
} /* while (count) */ } /* while (count) */
} }
/* recording raw data, this proc handels WAVE files and .VOCs (as one block) */ /* captureing raw data, this proc handels WAVE files and .VOCs (as one block) */
void record_go(int fd, int loaded, u_long count, int rtype, char *name) void capture_go(int fd, int loaded, u_long count, int rtype, char *name)
{ {
int l; int l;
u_long c; u_long c;
@ -1089,7 +1089,7 @@ void record_go(int fd, int loaded, u_long count, int rtype, char *name)
} }
/* /*
* let's play or record it (record_type says VOC/WAVE/raw) * let's play or capture it (capture_type says VOC/WAVE/raw)
*/ */
static void playback(char *name) static void playback(char *name)
@ -1145,11 +1145,11 @@ static void playback(char *name)
close(fd); close(fd);
} }
static void record(char *name) static void capture(char *name)
{ {
int fd; int fd;
snd_pcm_flush_record(pcm_handle); snd_pcm_flush_capture(pcm_handle);
if (!name || !strcmp(name, "-")) { if (!name || !strcmp(name, "-")) {
fd = 1; fd = 1;
name = "stdout"; name = "stdout";
@ -1165,6 +1165,6 @@ static void record(char *name)
isn't a problem (this can only be in 8 bit mono) */ isn't a problem (this can only be in 8 bit mono) */
if (fmt_rec_table[active_format].start) if (fmt_rec_table[active_format].start)
fmt_rec_table[active_format].start(fd, count); fmt_rec_table[active_format].start(fd, count);
record_go(fd, 0, count, active_format, name); capture_go(fd, 0, count, active_format, name);
fmt_rec_table[active_format].end(fd); fmt_rec_table[active_format].end(fd);
} }

View file

@ -26,7 +26,7 @@ AC_SUBST(CURSESLIB)
dnl Check for Gtk+ dnl Check for Gtk+
AM_PATH_GTK(1.0.1) AM_PATH_GTK(1.0.1)
CFLAGS="$CFLAGS $GTK_CFLAGS" CFLAGS="$CFLAGS $GTK_CFLAGS"
LDFLAGS="$LDFLAGS $GTK_LIBS" # LDFLAGS="$LDFLAGS $GTK_LIBS"
AM_CONFIG_HEADER(include/aconfig.h) AM_CONFIG_HEADER(include/aconfig.h)

View file

@ -1,4 +1,5 @@
bin_PROGRAMS = xamixer2 bin_PROGRAMS = xamixer2
xamixer2_SOURCES = main.h structs.h xamixer2.c xamixer2.h callbacks.c callbacks.h cinit.c cinit.h display.c display.h util.c util.h config.c config.h switches.c switches.h options.c options.h xamixer2_SOURCES = main.h structs.h xamixer2.c xamixer2.h callbacks.c callbacks.h cinit.c cinit.h display.c display.h util.c util.h config.c config.h switches.c switches.h options.c options.h
xamixer2_LDFLAGS = $(GTK_LIBS)
sysconf_DATA = xamixer.conf sysconf_DATA = xamixer.conf
EXTRA_DIST = README COPYING INSTALL AUTHORS NEWS TODO xamixer.home xamixer.conf EXTRA_DIST = README COPYING INSTALL AUTHORS NEWS TODO xamixer.home xamixer.conf