rpms/alsa-utils/devel alsa-utils.spec, 1.29, 1.30 alsaunmute.c, 1.5, 1.6
fedora-cvs-commits at redhat.com
fedora-cvs-commits at redhat.com
Wed Jan 25 09:53:30 UTC 2006
- Previous message (by thread): rpms/autofs/devel autofs-4.1.4-ldap-depricated.patch,1.1,1.2
- Next message (by thread): rpms/udev/FC-4 firmware_helper.c, NONE, 1.1 hotplug.rules, NONE, 1.1 path_id, NONE, 1.1 udev-071-rh.patch, NONE, 1.1 sources, 1.22, 1.23 start_udev, 1.36, 1.37 udev.rules, 1.27, 1.28 udev.spec, 1.92, 1.93 ata_identify-Makefile, 1.3, NONE ata_identify.c, 1.4, NONE udev-039-dircheck.patch, 1.1, NONE udev-039-media.patch, 1.1, NONE udev-039-scsi_id-tmp_dir.patch, 1.1, NONE udev-039-static.patch, 1.3, NONE udev-048-selinux.patch, 1.1, NONE udev-056-selinux.patch, 1.1, NONE udev.get_persistent_device_name.sh, 1.3, NONE udev.get_unique_drive_id.sh, 1.3, NONE udev.get_unique_hardware_path.sh, 1.3, NONE udev.permissions, 1.9, NONE udev.rules.persistent, 1.5, NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: stransky
Update of /cvs/dist/rpms/alsa-utils/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv20462
Modified Files:
alsa-utils.spec alsaunmute.c
Log Message:
volume option
Index: alsa-utils.spec
===================================================================
RCS file: /cvs/dist/rpms/alsa-utils/devel/alsa-utils.spec,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- alsa-utils.spec 12 Jan 2006 14:17:30 -0000 1.29
+++ alsa-utils.spec 25 Jan 2006 09:53:26 -0000 1.30
@@ -3,7 +3,7 @@
Summary: Advanced Linux Sound Architecture (ALSA) utilities
Name: alsa-utils
Version: 1.0.11
-Release: 1.rc2
+Release: 2.rc2
License: GPL
Group: Applications/Multimedia
URL: http://www.alsa-project.org/
@@ -69,6 +69,9 @@
/usr/share/locale/*
%changelog
+* Wed Jan 25 2006 Martin Stransky <stransky at redhat.com> 1.0.11-2.rc2
+- added volume option to alsaunmute utility (for s-c-s)
+
* Thu Jan 12 2006 Martin Stransky <stransky at redhat.com> 1.0.11-1.rc2
- new upstream
Index: alsaunmute.c
===================================================================
RCS file: /cvs/dist/rpms/alsa-utils/devel/alsaunmute.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- alsaunmute.c 10 Nov 2005 09:12:44 -0000 1.5
+++ alsaunmute.c 25 Jan 2006 09:53:26 -0000 1.6
@@ -16,6 +16,8 @@
*
*/
+#define VERSION "0.2"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -259,6 +261,16 @@
return(NULL);
}
+void set_volume(int volume)
+{
+ int i;
+
+ for (i = 0; i < sizeof(channels) / sizeof(channels[0]); i++) {
+ if (channels[i].play_volume > 1)
+ channels[i].play_volume = volume;
+ }
+}
+
void check_data(void)
{
char *p_tmp;
@@ -272,13 +284,15 @@
void usage(char *p_name)
{
- printf("Alsa Unmute utility, Copyright 2005 Red Hat, Inc.\n");
+ printf("Alsa Unmute utility, Version %s, Copyright 2005 Red Hat, Inc.\n",VERSION);
printf("This software may be freely redistributed under the terms of the GNU\n");
printf("public license.\n\n");
- printf("usage: %s card_number [-v]\n\n", p_name);
- printf(" card_number - number of unmuted card\n");
- printf(" [-v] - verbose mode\n\n");
+ printf("Usage: alsaunmute card_number [-v] [-s volume]\n\n", p_name);
+ printf(" card_number - number of unmuted card\n");
+ printf(" [-v] - verbose mode\n");
+ printf(" [-s volume] - set this volume level instead of the default (75%)\n");
+ printf(" the volume is number from 0 to 100\n\n");
exit(0);
}
@@ -290,6 +304,8 @@
{
const char *p_driver;
int index;
+ int volume = 75;
+ int param;
if (argc < 2) {
usage(argv[0]);
@@ -298,10 +314,19 @@
index = atoi(argv[1]);
p_driver = get_card_driver(index);
+
+ for(param = 2; param < argc; param++) {
+ if (!strcmp(argv[param],"-v") || !strcmp(argv[param],"-V")) {
+ verbose = TRUE;
+ continue;
+ }
- if (argc == 3 && (!strcmp(argv[2],"-v") || !strcmp(argv[2],"-V"))) {
- verbose = TRUE;
+ if (param+1 < argc && (!strcmp(argv[param],"-s") || !strcmp(argv[param],"-S"))) {
+ param++;
+ volume = atoi(argv[param]);
+ }
}
+
if(!p_driver) {
fprintf(stderr,"Wrong card index %d...\n",index);
@@ -309,11 +334,14 @@
}
if(verbose) {
- fprintf(stderr,"Card %d Driver %s...\n",index,p_driver);
+ fprintf(stderr,"Card %d Driver %s Volume %d%%...\n",index,p_driver,volume);
}
check_data();
+ // setting volume
+ set_volume(volume);
+
// default settings for all cards
unmute_card(index,"");
- Previous message (by thread): rpms/autofs/devel autofs-4.1.4-ldap-depricated.patch,1.1,1.2
- Next message (by thread): rpms/udev/FC-4 firmware_helper.c, NONE, 1.1 hotplug.rules, NONE, 1.1 path_id, NONE, 1.1 udev-071-rh.patch, NONE, 1.1 sources, 1.22, 1.23 start_udev, 1.36, 1.37 udev.rules, 1.27, 1.28 udev.spec, 1.92, 1.93 ata_identify-Makefile, 1.3, NONE ata_identify.c, 1.4, NONE udev-039-dircheck.patch, 1.1, NONE udev-039-media.patch, 1.1, NONE udev-039-scsi_id-tmp_dir.patch, 1.1, NONE udev-039-static.patch, 1.3, NONE udev-048-selinux.patch, 1.1, NONE udev-056-selinux.patch, 1.1, NONE udev.get_persistent_device_name.sh, 1.3, NONE udev.get_unique_drive_id.sh, 1.3, NONE udev.get_unique_hardware_path.sh, 1.3, NONE udev.permissions, 1.9, NONE udev.rules.persistent, 1.5, NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the fedora-cvs-commits
mailing list