diff options
author | marcus <marcus@FreeBSD.org> | 2003-06-20 00:47:33 +0000 |
---|---|---|
committer | marcus <marcus@FreeBSD.org> | 2003-06-20 00:47:33 +0000 |
commit | 8985f47fb00b78fea4be240e2c67e54b7d7699e8 (patch) | |
tree | bd23a4ed8ea5931762784352c975d02d3532b568 /audio/gnome-media | |
parent | 709ef57a5101a47eba62cba5dc7de493a81ed5bb (diff) | |
download | FreeBSD-ports-8985f47fb00b78fea4be240e2c67e54b7d7699e8.zip FreeBSD-ports-8985f47fb00b78fea4be240e2c67e54b7d7699e8.tar.gz |
Show real device names in gmix so it's easier to control individual
sound cards.
Submitted by: Hendrik Scholz <hscholz@raisdorf.net>
Diffstat (limited to 'audio/gnome-media')
-rw-r--r-- | audio/gnome-media/Makefile | 2 | ||||
-rw-r--r-- | audio/gnome-media/files/patch-gmix_gmix.c | 42 |
2 files changed, 43 insertions, 1 deletions
diff --git a/audio/gnome-media/Makefile b/audio/gnome-media/Makefile index 824b52f5..745beaa 100644 --- a/audio/gnome-media/Makefile +++ b/audio/gnome-media/Makefile @@ -7,7 +7,7 @@ PORTNAME= gnomemedia2 PORTVERSION= 2.2.1.1 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= audio gnome MASTER_SITES= ${MASTER_SITE_GNOME} MASTER_SITE_SUBDIR= sources/gnome-media/2.2 diff --git a/audio/gnome-media/files/patch-gmix_gmix.c b/audio/gnome-media/files/patch-gmix_gmix.c new file mode 100644 index 0000000..d306c14 --- /dev/null +++ b/audio/gnome-media/files/patch-gmix_gmix.c @@ -0,0 +1,42 @@ +--- gmix/gmix.c.orig Sun Mar 16 16:09:01 2003 ++++ gmix/gmix.c Sun Mar 16 16:13:09 2003 +@@ -591,6 +591,11 @@ + /* Masks for the channel data - OSS blows compared to ALSA */ + int recmask, recsrc, stereodee; + ++ /* FreeBSD device name detection */ ++ FILE *sndstat; ++ char line[256]; ++ char *devname, *p; ++ + /* + * create new device configureation + */ +@@ -659,7 +665,26 @@ + } + #else + new_device->card_name = g_strdup_printf ("OSS-%d-%d", num + 1, num + 1); +- g_snprintf (new_device->info.name, 31, "Card %d", num+1); ++ /* get soundcard name from /dev/sndstat on FreeBSD */ ++ sndstat = fopen("/dev/sndstat", "r"); ++ if (!sndstat) ++ g_snprintf (new_device->info.name, 31, "Card %d", num+1); ++ else { ++ while (fgets (line, 255, sndstat)) { ++ if (!strncmp (line, "pcm", 3) && (atoi (&line[3]) == num)) ++ { ++ devname = line; ++ while (*devname++ != '<') ++ ; ++ p = devname; ++ while (*p != '>') ++ p++; ++ *p = '\0'; ++ g_snprintf (new_device->info.name, 31, devname); ++ } ++ } ++ fclose(sndstat); ++ } + #endif + /* + * several bitmasks describing the mixer |