mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
added snd_hctl_ctl() function
ordinary mixer:
- revised Ordinary Mixer I/O type
- sndo_mixer_open() take PCMs rather than strings to pass
the real relationship
- an initial version of toplevel alisp script
more alisp development:
- renamed a* functions to A* functions (acall -> Acall etc.)
- many improvements (unset*, exfun, Acall pcm_info, Asnderr, Asyserr)
This commit is contained in:
parent
668a300229
commit
60585e25fc
16 changed files with 535 additions and 165 deletions
|
|
@ -13,8 +13,8 @@ static void help(void)
|
|||
printf(
|
||||
"Usage: omixer [OPTION]...\n"
|
||||
"-h,--help help\n"
|
||||
"-P,--pname playback device\n"
|
||||
"-C,--cname capture device\n"
|
||||
"-P,--pname playback PCM device\n"
|
||||
"-C,--cname capture PCM device\n"
|
||||
"\n");
|
||||
}
|
||||
|
||||
|
|
@ -29,6 +29,7 @@ int main(int argc, char *argv[])
|
|||
};
|
||||
int err, morehelp;
|
||||
char *pname = "default", *cname = "default";
|
||||
snd_pcm_t *phandle = NULL, *chandle = NULL;
|
||||
sndo_mixer_t *handle;
|
||||
|
||||
morehelp = 0;
|
||||
|
|
@ -54,11 +55,31 @@ int main(int argc, char *argv[])
|
|||
return 0;
|
||||
}
|
||||
|
||||
err = sndo_mixer_open(&handle, pname, cname, NULL);
|
||||
if (strcmp(pname, "-")) {
|
||||
err = snd_pcm_open(&phandle, pname, SND_PCM_STREAM_PLAYBACK, 0);
|
||||
if (err < 0) {
|
||||
fprintf(stderr, "Playback PCM open error: %s\n", snd_strerror(err));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
if (strcmp(cname, "-")) {
|
||||
err = snd_pcm_open(&chandle, cname, SND_PCM_STREAM_CAPTURE, 0);
|
||||
if (err < 0) {
|
||||
if (phandle)
|
||||
snd_pcm_close(phandle);
|
||||
fprintf(stderr, "Capture PCM open error: %s\n", snd_strerror(err));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
err = sndo_mixer_open(&handle, phandle, chandle, NULL);
|
||||
if (err < 0) {
|
||||
fprintf(stderr, "mixer open error: %s\n", snd_strerror(err));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
sndo_mixer_close(handle);
|
||||
snd_pcm_close(chandle);
|
||||
snd_pcm_close(phandle);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue