new upstream version
This commit is contained in:
parent
0268ed8730
commit
1f34d938d9
@ -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
|
||||
|
@ -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 <stransky@redhat.com> 1.0.10rc1-3
|
||||
* Thu Nov 24 2005 Martin Stransky <stransky@redhat.com> 1.0.10rf-1
|
||||
- new upstream version
|
||||
- added alias for snd-azx
|
||||
|
||||
* Wed Nov 9 2005 Martin Stransky <stransky@redhat.com> 1.0.10rc1-2
|
||||
|
46
alsacard.c
Normal file
46
alsacard.c
Normal file
@ -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 <stdio.h>
|
||||
#include <string.h>
|
||||
#include <alsa/asoundlib.h>
|
||||
|
||||
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);
|
||||
}
|
Loading…
Reference in New Issue
Block a user