From 1f34d938d9474c6cf261d61f09da51c7a0e817dc Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Nov 24 2005 13:47:29 +0000 Subject: new upstream version --- diff --git a/.cvsignore b/.cvsignore index 77eda12..7a1c92d 100644 --- a/.cvsignore +++ b/.cvsignore @@ -5,3 +5,4 @@ alsa-utils-1.0.9.tar.bz2 alsacard.c alsa-utils-1.0.9a.tar.bz2 alsa-utils-1.0.10rc1.tar.bz2 +alsa-utils-1.0.10.tar.bz2 diff --git a/alsa-utils.spec b/alsa-utils.spec index 012c718..93cef9d 100644 --- a/alsa-utils.spec +++ b/alsa-utils.spec @@ -1,10 +1,10 @@ -%define version_tar 1.0.10rc1 -%define version_pack 1.0.10rc1 +%define version_tar 1.0.10 +%define version_pack 1.0.10rf Summary: Advanced Linux Sound Architecture (ALSA) utilities Name: alsa-utils Version: %{version_pack} -Release: 3 +Release: 1 License: GPL Group: Applications/Multimedia URL: http://www.alsa-project.org/ @@ -70,7 +70,8 @@ install -m 755 alsacard %{buildroot}/bin /usr/share/locale/* %changelog -* Thu Nov 10 2005 Martin Stransky 1.0.10rc1-3 +* Thu Nov 24 2005 Martin Stransky 1.0.10rf-1 +- new upstream version - added alias for snd-azx * Wed Nov 9 2005 Martin Stransky 1.0.10rc1-2 diff --git a/alsacard.c b/alsacard.c new file mode 100644 index 0000000..b9b0901 --- /dev/null +++ b/alsacard.c @@ -0,0 +1,46 @@ +/* Copyright 2005 Red Hat, Inc. + * + * This software may be freely redistributed under the terms of the GNU + * public license. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ +#include +#include +#include + +int get_card_device(const char *p_device) +{ + int err; + snd_ctl_t *handle; + snd_ctl_card_info_t *info; + + snd_ctl_card_info_alloca(&info); + + if ((err = snd_ctl_open(&handle, "default", 0)) < 0) { + fprintf(stderr,"Open error: %s\n", snd_strerror(err)); + return(0); + } + if ((err = snd_ctl_card_info(handle, info)) < 0) { + fprintf(stderr,"HW info error: %s\n", snd_strerror(err)); + return(0); + } + + return (snd_ctl_card_info_get_card(info)); +} + +int main(int argc, char *argv[]) +{ + char *p_device = "default"; + int card; + + if (argc > 1 && argv[1]) + p_device = argv[1]; + + card = get_card_device(p_device); + printf("%d",card); + return (card); +} diff --git a/sources b/sources index cec4260..27c74fc 100644 --- a/sources +++ b/sources @@ -1,2 +1 @@ -84a139aff67d14024a3f3e4e9c586367 alsacard.c -98e757012434ad3f2b9241ca04afd521 alsa-utils-1.0.10rc1.tar.bz2 +94bdec65e9c3fd02f7ef8ceb8f918afe alsa-utils-1.0.10.tar.bz2