head 1.24; access; symbols pkgsrc-2013Q2:1.24.0.8 pkgsrc-2013Q2-base:1.24 pkgsrc-2012Q4:1.24.0.6 pkgsrc-2012Q4-base:1.24 pkgsrc-2011Q4:1.24.0.4 pkgsrc-2011Q4-base:1.24 pkgsrc-2011Q2:1.24.0.2 pkgsrc-2011Q2-base:1.24 pkgsrc-2010Q4:1.23.0.48 pkgsrc-2010Q4-base:1.23 pkgsrc-2010Q3:1.23.0.46 pkgsrc-2010Q3-base:1.23 pkgsrc-2010Q2:1.23.0.44 pkgsrc-2010Q2-base:1.23 pkgsrc-2010Q1:1.23.0.42 pkgsrc-2010Q1-base:1.23 pkgsrc-2009Q4:1.23.0.40 pkgsrc-2009Q4-base:1.23 pkgsrc-2009Q3:1.23.0.38 pkgsrc-2009Q3-base:1.23 pkgsrc-2009Q2:1.23.0.36 pkgsrc-2009Q2-base:1.23 pkgsrc-2009Q1:1.23.0.34 pkgsrc-2009Q1-base:1.23 pkgsrc-2008Q4:1.23.0.32 pkgsrc-2008Q4-base:1.23 pkgsrc-2008Q3:1.23.0.30 pkgsrc-2008Q3-base:1.23 cube-native-xorg:1.23.0.28 cube-native-xorg-base:1.23 pkgsrc-2008Q2:1.23.0.26 pkgsrc-2008Q2-base:1.23 cwrapper:1.23.0.24 pkgsrc-2008Q1:1.23.0.22 pkgsrc-2008Q1-base:1.23 pkgsrc-2007Q4:1.23.0.20 pkgsrc-2007Q4-base:1.23 pkgsrc-2007Q3:1.23.0.18 pkgsrc-2007Q3-base:1.23 pkgsrc-2007Q2:1.23.0.16 pkgsrc-2007Q2-base:1.23 pkgsrc-2007Q1:1.23.0.14 pkgsrc-2007Q1-base:1.23 pkgsrc-2006Q4:1.23.0.12 pkgsrc-2006Q4-base:1.23 pkgsrc-2006Q3:1.23.0.10 pkgsrc-2006Q3-base:1.23 pkgsrc-2006Q2:1.23.0.8 pkgsrc-2006Q2-base:1.23 pkgsrc-2006Q1:1.23.0.6 pkgsrc-2006Q1-base:1.23 pkgsrc-2005Q4:1.23.0.4 pkgsrc-2005Q4-base:1.23 pkgsrc-2005Q3:1.23.0.2 pkgsrc-2005Q3-base:1.23 pkgsrc-2005Q2:1.22.0.10 pkgsrc-2005Q2-base:1.22 pkgsrc-2005Q1:1.22.0.8 pkgsrc-2005Q1-base:1.22 pkgsrc-2004Q4:1.22.0.6 pkgsrc-2004Q4-base:1.22 pkgsrc-2004Q3:1.22.0.4 pkgsrc-2004Q3-base:1.22 pkgsrc-2004Q2:1.22.0.2 pkgsrc-2004Q2-base:1.22 pkgsrc-2004Q1:1.21.0.4 pkgsrc-2004Q1-base:1.21 pkgsrc-2003Q4:1.21.0.2 pkgsrc-2003Q4-base:1.21 netbsd-1-6-1:1.20.0.6 netbsd-1-6-1-base:1.20 netbsd-1-6:1.20.0.8 netbsd-1-6-RELEASE-base:1.20 pkgviews:1.20.0.4 pkgviews-base:1.20 buildlink2:1.20.0.2 buildlink2-base:1.20 netbsd-1-5-PATCH003:1.20 netbsd-1-5-PATCH001:1.16 netbsd-1-5-RELEASE:1.12 netbsd-1-4-PATCH003:1.12 pkgsrc-base:1.1.1.1 TNF:1.1.1; locks; strict; comment @# @; 1.24 date 2011.03.06.16.02.32; author wiz; state dead; branches; next 1.23; 1.23 date 2005.09.08.22.37.53; author abs; state Exp; branches; next 1.22; 1.22 date 2004.05.10.18.29.30; author tron; state Exp; branches; next 1.21; 1.21 date 2003.02.14.22.33.03; author wiz; state dead; branches; next 1.20; 1.20 date 2002.03.18.08.21.13; author wiz; state Exp; branches; next 1.19; 1.19 date 2002.02.04.17.07.02; author rxg; state dead; branches; next 1.18; 1.18 date 2002.01.14.20.48.53; author hubertf; state Exp; branches; next 1.17; 1.17 date 2001.11.27.02.07.10; author hubertf; state Exp; branches; next 1.16; 1.16 date 2001.03.01.17.09.03; author jlam; state Exp; branches; next 1.15; 1.15 date 2001.01.26.09.32.42; author wiz; state dead; branches; next 1.14; 1.14 date 2000.12.08.21.24.52; author wiz; state Exp; branches; next 1.13; 1.13 date 2000.12.08.21.18.36; author wiz; state Exp; branches; next 1.12; 1.12 date 2000.09.01.15.58.37; author toshii; state Exp; branches; next 1.11; 1.11 date 2000.08.26.16.41.49; author wiz; state Exp; branches; next 1.10; 1.10 date 99.07.12.00.53.53; author hubertf; state dead; branches; next 1.9; 1.9 date 99.06.29.00.58.30; author hubertf; state Exp; branches; next 1.8; 1.8 date 99.06.18.00.46.11; author hubertf; state Exp; branches; next 1.7; 1.7 date 99.06.16.03.06.36; author hubertf; state Exp; branches; next 1.6; 1.6 date 99.06.15.02.06.39; author hubertf; state Exp; branches; next 1.5; 1.5 date 99.06.07.01.14.09; author hubertf; state Exp; branches; next 1.4; 1.4 date 99.05.27.00.49.45; author hubertf; state Exp; branches; next 1.3; 1.3 date 99.05.15.18.50.58; author he; state Exp; branches; next 1.2; 1.2 date 99.05.15.03.49.14; author hubertf; state Exp; branches; next 1.1; 1.1 date 99.05.13.00.01.58; author hubertf; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 99.05.13.00.01.58; author hubertf; state Exp; branches; next ; desc @@ 1.24 log @Remove GTK1 using packages for which noone spoke up for the last two weeks on pkgsrc-users in the thread "[HEADS UP] Package removal -- please check". @ text @$NetBSD: patch-ab,v 1.23 2005/09/08 22:37:53 abs Exp $ --- src/cpu_perc.c.orig 2002-05-02 21:08:34.000000000 +0200 +++ src/cpu_perc.c 2004-05-10 20:22:09.000000000 +0200 @@@@ -66,7 +66,11 @@@@ /* find where the proc fs is mounted, some strange people could mount it in another place than /proc, it can even be not mounted at all */ { +#if defined(__NetBSD__) && (__NetBSD_Version__ >= 299000900) + struct statvfs *mntbufp; +#else struct statfs *mntbufp; +#endif int fs_count; int procfs_found = 0; @ 1.23 log @Catch some NetBSD statvfs() checks phrased alternatively as > 200030000 rather than >= 200040000 and one enterprisingly hidden as > 200050000 @ text @d1 1 a1 1 $NetBSD: patch-ab,v 1.22 2004/05/10 18:29:30 tron Exp $ @ 1.22 log @Make this build under NetBSD 2.0D and above with statvfs(2). @ text @d1 1 a1 1 $NetBSD$ d9 1 a9 1 +#if defined(__NetBSD__) && (__NetBSD_Version__ > 200030000) @ 1.21 log @Removed unneeded patch. @ text @d1 1 a1 1 $NetBSD: patch-ab,v 1.20 2002/03/18 08:21:13 wiz Exp $ d3 14 a16 11 --- src/Makefile.in.orig Mon Mar 18 09:11:54 2002 +++ src/Makefile.in @@@@ -105,7 +105,7 @@@@ INCLUDES = -I$(srcdir) -I$(builddir) \ -I$(top_srcdir) -I$(top_builddir) \ -DLOCALEDIR=\""$(localedir)"\" \ - -I$(includedir) $(GTK_CFLAGS) \ + $(GTK_CFLAGS) \ $(GDK_PIXBUF_CFLAGS) @ 1.20 log @Strongly buildlinkify once again. @ text @d1 1 a1 1 $NetBSD$ @ 1.19 log @ Changes: - Added --geometry command line option. - Updated French translation. - Playlist now scrolls with drag and drop. - Adding directory contents to a playlist now sorts the contents first. * Fixed ogg filenames with spaces. * Made the M3U file reading actually work. * Minor other fixes. Close pkg/15435 @ text @d1 1 a1 1 $NetBSD: patch-ab,v 1.18 2002/01/14 20:48:53 hubertf Exp $ d3 9 a11 18 --- configure.orig Thu Jan 3 21:40:19 2002 +++ configure @@@@ -2290,7 +2290,6 @@@@ FALSE_FALSE= fi -localedir='${prefix}/share/locale' ALL_LINGUAS="cs de fr ja pt_BR zh_TW" @@@@ -4121,6 +4120,9 @@@@ < $srcdir/po/POTFILES.in > po/POTFILES + +DATADIRNAME="${PKGLOCALEDIR}" +localedir='${prefix}/${DATADIRNAME}/locale' @ 1.18 log @Update gqmpeg to 0.12.0. Changes: + Added bitrate etc. information and comment support for ogg files, including a comment editor. + Song titles and comments are now customizable, and are saved in the playlist (to customize use right click menu in playlist). + Added Traditional Chinese translation (zh_TW). - Added help window (displays README). - Basic read-only support for m3u 3.0 titles saved in a playlist. * Fix (at least improved) --dockwm behavior. * Several misc fixes. Update submitted by Rui-Xiang Guo in PR 15242 @ text @d1 1 a1 1 $NetBSD$ @ 1.17 log @Update gqmpeg to 0.10.0. Changes: * Added video4linux radio tuner support of /dev/radio, stations are added by 'opening custom' and choosing 'Radio station'. * Updated French translation. * Allow user options entry for ogg123. * Attempt to set the correct ogg123 device for the platform. * Added (untested) support for mixers on Tru64 and HPUX. * Added Russian ID3 tag support (configure --enable-russian). * Show overwrite confirm dialog when overwriting a playlist. * Fix closing of a pipe twice in ogg123 module. * Fix incorrect warning flags during ogg123 playback. * Make double size work again. * Minor bug fixes. @ text @d3 1 a3 1 --- configure.orig Sat Oct 27 00:26:56 2001 d12 2 a13 2 ALL_LINGUAS="cs de fr ja pt_BR" @@@@ -4121,6 +4120,8 @@@@ d17 1 @ 1.16 log @Use PKGLOCALEDIR for the location of the installed locale files. Also add a few GNOME files to the PLIST, remove redundant CPPFLAGS, and use DEINSTALL_FILE to specify location of deinstallation script. @ text @d3 1 a3 1 --- configure.orig Wed Feb 28 02:00:28 2001 d5 1 a5 1 @@@@ -2192,7 +2192,6 @@@@ d13 1 a13 1 @@@@ -4023,6 +4022,8 @@@@ @ 1.15 log @This file is obsolete (patch integrated). @ text @d1 1 a1 1 $NetBSD: patch-ab,v 1.14 2000/12/08 21:24:52 wiz Exp $ d3 19 a21 14 --- src/mixer.c.orig Sun Dec 3 06:44:59 2000 +++ src/mixer.c @@@@ -309,7 +320,10 @@@@ /* if problem, revert back to this: device->device_name = infos[i].label.name; */ - device->device_name = g_strconcat(infos[infos[i].mixer_class].label.name, "." ,infos[i].label.name, NULL); + if (0 <= infos[i].mixer_class && infos[i].mixer_class < ndev) + device->device_name = g_strconcat(infos[infos[i].mixer_class].label.name, "." ,infos[i].label.name, NULL); + else + device->device_name = infos[i].label.name; device->stereo = 1; device->recordable = 0; device_list = g_list_append(device_list, device); @ 1.14 log @Remove unneeded part of the patch. @ text @d1 1 a1 1 $NetBSD: patch-ab,v 1.13 2000/12/08 21:18:36 wiz Exp $ @ 1.13 log @Update to 0.8.1. Changes since 0.7.3: New skin format; skin editor (press tilde (~)); repeat 1 and A-B buttons; optional delay between songs (counted down); user options for mpg123 in preferences; ipc commands --skin_set, --volume and --status; randomize playlist in right-click menu; updated translations, some bugfixes. @ text @d1 1 a1 1 $NetBSD$ a4 18 @@@@ -265,6 +265,17 @@@@ mixer_devinfo_t *infos; mixer_ctrl_t *values; +char * +catstr(char *p, char *q) +{ + char *r = malloc(strlen(p) + strlen(q) + 2); + strcpy(r, p); + strcat(r, "."); + strcat(r, q); + return r; +} + + void mixer_init(gint init_device_id) { int fd, i, ndev; @ 1.12 log @Make sure if mixer_devinfo's mixer_class points to a valid index. (This doesn't hold for uaudio(4), which caused SEGV on startup.) @ text @d3 2 a4 2 --- src/mixer.c.orig Mon Jul 24 07:25:50 2000 +++ src/mixer.c Fri Sep 1 21:42:16 2000 d23 5 a27 5 @@@@ -306,7 +317,12 @@@@ if (infos[i].type == AUDIO_MIXER_VALUE) { DeviceData *device = g_new0(DeviceData, 1); device->device_id = i; - device->device_name = infos[i].label.name; d29 1 a29 3 + device->device_name = + catstr(infos[infos[i].mixer_class].label.name, + infos[i].label.name); @ 1.11 log @Bugfix: Make choosing `outputs.line' as volume control device possible, even if `inputs.line' also exists and comes earlier (both were noted only as `line' before). @ text @d3 2 a4 2 --- src/mixer.c.orig Mon Jul 24 00:25:50 2000 +++ src/mixer.c d23 1 a23 1 @@@@ -306,7 +317,9 @@@@ d28 6 a33 3 + device->device_name = + catstr(infos[infos[i].mixer_class].label.name, + infos[i].label.name); @ 1.10 log @Update to V0.6.3. Changes: This release adds support for the newly released mpg123 0.59r. New features include mpg123's --aggresive support (for higher priority, see README), freeamp support, and NetBSD native sound mixer support. This release also fixes ipc on NetBSD, crashes in g_hook_next_valid(), and more, leading to a more robust program. @ text @d1 1 a1 1 $NetBSD: patch-ab,v 1.9 1999/06/29 00:58:30 hubertf Exp $ d3 5 a7 5 --- mixer.c.orig Wed Jun 2 05:50:45 1999 +++ mixer.c Sun Jun 20 00:44:06 1999 @@@@ -24,7 +24,7 @@@@ #include #endif d9 2 a10 47 -#if defined(sun) && defined(__svr4__) +#if defined(sun) && defined(__svr4__) || defined(__NetBSD__) #include #endif @@@@ -32,11 +32,6 @@@@ #include #endif -#ifdef __NetBSD__ -#include -#undef _POSIX_SOURCE -#endif - #ifdef __sgi #include #include @@@@ -65,7 +60,7 @@@@ static GList *device_list = NULL; static DeviceData *current_device = NULL; -#if defined (linux) || defined (__FreeBSD__) || defined (__NetBSD__) +#if defined (linux) || defined (__FreeBSD__) void mixer_init(gint init_device_id) { char *device_names[] = SOUND_DEVICE_NAMES; @@@@ -100,11 +95,7 @@@@ /* get device listing */ for (i=0; idevice_id = i; @@@@ -186,6 +177,166 @@@@ return vol; } +#elif defined(__NetBSD__) +mixer_devinfo_t *infos; +mixer_ctrl_t *values; +void mixer_init(gint init_device_id) d12 5 a16 67 + int fd, i, ndev; + char *mixer_device; + audio_device_t adev; + mixer_devinfo_t dinfo; + + mixer_device = getenv("MIXERDEVICE"); + if (mixer_device == NULL) + mixer_device = "/dev/mixer0"; + + if ((fd = open(mixer_device, O_RDWR)) == -1) { + perror(mixer_device); + mixer_enabled = FALSE; + } + + if (ioctl(fd, AUDIO_GETDEV, &adev) == -1) { + perror(mixer_device); + close(fd); + mixer_enabled = FALSE; + } + + for (ndev = 0; ; ndev++) { + dinfo.index = ndev; + if (ioctl(fd, AUDIO_MIXER_DEVINFO, &dinfo) == -1) + break; + } + infos = calloc(ndev, sizeof *infos); + values = calloc(ndev, sizeof *values); + + for (i = 0; i < ndev; i++) { + infos[i].index = i; + ioctl(fd, AUDIO_MIXER_DEVINFO, &infos[i]); + } + + for (i = 0; i < ndev; i++) { + values[i].dev = i; + values[i].type = infos[i].type; + if (infos[i].type == AUDIO_MIXER_VALUE) { + DeviceData *device = g_new0(DeviceData, 1); + device->device_id = i; + device->device_name = infos[i].label.name; + device->stereo = 1; + device_list = g_list_append(device_list, device); + + values[i].un.value.num_channels = 2; + if (ioctl(fd, AUDIO_MIXER_READ, &values[i]) == -1) { + values[i].un.value.num_channels = 1; + if (ioctl(fd, AUDIO_MIXER_READ, &values[i]) == -1) + perror("AUDIO_MIXER_READ"); + } + + if (debug_mode) printf("Mixer device added to list: %d, %s, %d\n", + device->device_id, device->device_name, + device->stereo); + if (init_device_id == i) current_device = device; + } + } + + close(fd); + + if (device_list) { + mixer_enabled = TRUE; + if (!current_device) + current_device = device_list->data; + current_vol = mixer_get_vol(current_device); + } else { + mixer_enabled = FALSE; + } a18 5 +static void mixer_set_vol(DeviceData *device, gint vol) +{ + int fd; + char *mixer_device; + mixer_ctrl_t *m; d20 1 a20 91 + mixer_device = getenv("MIXERDEVICE"); + if (mixer_device == NULL) + mixer_device = "/dev/mixer0"; + + if ((fd = open(mixer_device, O_RDWR)) == -1) { + perror(mixer_device); + close(fd); + } + + m = &values[device->device_id]; + if (ioctl(fd, AUDIO_MIXER_WRITE, m) == -1) { + perror("AUDIO_MIXER_WRITE"); + close(fd); + } + + close(fd); + + if (m->un.value.num_channels == 2) { + /* input and output seem to only have one channel?? */ + if (device->device_id == 13 || device->device_id == 14) { + m->un.value.level[0] = vol * AUDIO_MAX_GAIN / 100; + } else if (current_bal < 50) { + m->un.value.level[0] = vol * AUDIO_MAX_GAIN / 100; + m->un.value.level[1] = m->un.value.level[0] * current_bal / 50; + } else if (current_bal > 50) { + m->un.value.level[1] = vol * AUDIO_MAX_GAIN / 100; + m->un.value.level[0] = m->un.value.level[1] * (100 - current_bal) / 50; + } else { + m->un.value.level[0] = m->un.value.level[1] = vol * AUDIO_MAX_GAIN / 100; + } + } else { + m->un.value.level[0] = vol * AUDIO_MAX_GAIN / 100; + } + /* from AUDIO_MIN_GAIN (0) to AUDIO_MAX_GAIN (255) */ + + if (debug_mode) printf("volume set to %d (%d)\n", vol, current_bal); +} + +static gint mixer_get_vol(DeviceData *device) +{ + int fd; + char *mixer_device; + mixer_ctrl_t *m; + + mixer_device = getenv("MIXERDEVICE"); + if (mixer_device == NULL) + mixer_device = "/dev/mixer0"; + + if ((fd = open(mixer_device, O_RDWR)) == -1) { + perror(mixer_device); + close(fd); + return -1; + } + + m = &values[device->device_id]; + if (ioctl(fd, AUDIO_MIXER_READ, m) == -1) { + perror("AUDIO_MIXER_READ"); + close(fd); + return -1; + } + + close(fd); + + if (m->un.value.num_channels == 2) { + if (m->un.value.level[0] > m->un.value.level[1]) { + current_bal = m->un.value.level[1] * 50 / m->un.value.level[0]; + return m->un.value.level[0] * 100 / AUDIO_MAX_GAIN; + } else if (m->un.value.level[0] < m->un.value.level[1]) { + current_bal = 100 - (m->un.value.level[0] * 50 / m->un.value.level[1]); + return m->un.value.level[1] * 100 / AUDIO_MAX_GAIN; + } else { + current_bal = 50; + return m->un.value.level[0] * 100 / AUDIO_MAX_GAIN; + } + } else { + current_bal = 50; + return m->un.value.level[0] * 100 / AUDIO_MAX_GAIN; + } +} + #elif defined(sun) && defined(__svr4__) static int device_ids[] = { AUDIO_SPEAKER, AUDIO_LINE_OUT, @@@@ -444,7 +595,7 @@@@ #endif -#if defined(sun) && defined(__svr4__) +#if defined(sun) && defined(__svr4__) || defined(__NetBSD__) /* from 0 through 100% */ void set_volume(gint vol) d22 12 @ 1.9 log @Latest patches by Rui-Xiang Guo : The new patch only use /dev/mixer0 to control everything. @ text @d1 1 a1 1 $NetBSD$ @ 1.8 log @Enable blanc-tuning on native sound system Patch submitted by Rui-Xiang Guo - whee! @ text @d1 1 a1 19 $NetBSD: patch-ab,v 1.7 1999/06/16 03:06:36 hubertf Exp $ From rxg@@ms25.url.com.tw Tue Jun 15 02:49:50 1999 Date: Mon, 14 Jun 1999 13:58:57 +0100 From: Rui-Xiang Guo To: Hubert Feyrer Subject: Re: pkg/7768: new patches for 'gqmpeg' I send you the patch for saving your time. :) Should we need to remove some unnecesarry mixer control(eg. mic)? This patch has a small bug. When you choose the mixer control 'master', the balance control is unusable. The rest controls are OK. We can fix this but I never use balance control except testing this patch. :> Can you tell me what you think? Thanks! [ Part 2: "Attached Text" ] $NetBSD: patch-ab,v 1.7 1999/06/16 03:06:36 hubertf Exp $ d4 1 a4 1 +++ mixer.c Wed Jun 16 15:32:50 1999 d48 1 a48 1 @@@@ -186,6 +177,207 @@@@ d93 7 a99 1 + if (infos[i].type != AUDIO_MIXER_CLASS) { a105 11 + } + } + close(fd); + + for (i = 0; i < ndev; i++) { + if (infos[i].type == AUDIO_MIXER_VALUE) { + DeviceData *device = g_new0(DeviceData, 1); + device->device_id = i; + device->device_name = infos[i].label.name; + device->stereo = 1; + device_list = g_list_append(device_list, device); d114 2 a128 1 + char *audioctl_device; a129 2 + audio_device_t adev; + audio_info_t ainfo; d132 3 a134 3 + audioctl_device = getenv("AUDIOCTLDEVICE"); + if (audioctl_device == NULL) + audioctl_device = "/dev/audioctl0"; d136 3 a138 3 + if ((fd = open(audioctl_device, O_RDONLY)) == -1) { + perror(audioctl_device); + mixer_enabled = FALSE; d141 3 a143 2 + if (ioctl(fd, AUDIO_GETDEV, &adev) == -1) { + perror(audioctl_device); a144 1 + mixer_enabled = FALSE; a146 12 + AUDIO_INITINFO(&ainfo); + /* from AUDIO_LEFT_BALANCE (0) to AUDIO_RIGHT_BALANCE (64) */ + ainfo.play.balance = current_bal * AUDIO_RIGHT_BALANCE / 100; + + if (device->device_id == 0) + /* from AUDIO_MIN_GAIN (0) to AUDIO_MAX_GAIN (255) */ + ainfo.play.gain = vol * AUDIO_MAX_GAIN / 100; + + if (ioctl(fd, AUDIO_SETINFO, &ainfo) == -1) { + perror("AUDIO_SETINFO"); + close(fd); + } d149 12 a160 8 + if (device->device_id != 0) { + mixer_device = getenv("MIXERDEVICE"); + if (mixer_device == NULL) + mixer_device = "/dev/mixer0"; + + if ((fd = open(mixer_device, O_RDWR)) == -1) { + perror(mixer_device); + close(fd); d162 4 a166 10 + m = &values[device->device_id]; + if (ioctl(fd, AUDIO_MIXER_WRITE, m) == -1) { + perror("AUDIO_MIXER_WRITE"); + close(fd); + } + /* from AUDIO_MIN_GAIN (0) to AUDIO_MAX_GAIN (255) */ + m->un.value.level[0] = m->un.value.level[1] = vol * AUDIO_MAX_GAIN / 100; + + close(fd); + } a172 1 + char *audioctl_device; a173 2 + audio_device_t adev; + audio_info_t ainfo; d176 3 a178 3 + audioctl_device = getenv("AUDIOCTLDEVICE"); + if (audioctl_device == NULL) + audioctl_device = "/dev/audioctl0"; d180 3 a182 3 + if ((fd = open(audioctl_device, O_RDONLY)) == -1) { + perror(audioctl_device); + mixer_enabled = FALSE; d186 3 a188 2 + if (ioctl(fd, AUDIO_GETDEV, &adev) == -1) { + perror(audioctl_device); a189 1 + mixer_enabled = FALSE; a192 5 + if (ioctl(fd, AUDIO_GETINFO, &ainfo) == -1) { + perror("AUDIO_GETINFO"); + close(fd); + return -1; + } d195 12 a206 1 + if (ainfo.play.balance > AUDIO_RIGHT_BALANCE) a207 24 + else + current_bal = ainfo.play.balance * 100 / AUDIO_RIGHT_BALANCE; + + if (device->device_id == 0) + return ainfo.play.gain * 100 / AUDIO_MAX_GAIN; + else { + mixer_device = getenv("MIXERDEVICE"); + if (mixer_device == NULL) + mixer_device = "/dev/mixer0"; + + if ((fd = open(mixer_device, O_RDWR)) == -1) { + perror(mixer_device); + close(fd); + return -1; + } + + m = &values[device->device_id]; + if (ioctl(fd, AUDIO_MIXER_READ, m) == -1) { + perror("AUDIO_MIXER_READ"); + close(fd); + return -1; + } + close(fd); + d215 1 a215 1 @@@@ -444,7 +636,7 @@@@ @ 1.7 log @Use /dev/{audioctl,mixer}0 instead of /dev/{audioctl,mixer}. If users want some different device, there's always $MIXERDEVICE and $AUDIOCTLDEVICE. Submitted by Rui-Xiang Guo @ text @d1 1 a1 1 $NetBSD: patch-ab,v 1.6 1999/06/15 02:06:39 hubertf Exp $ d19 1 a19 1 $NetBSD: patch-ab,v 1.6 1999/06/15 02:06:39 hubertf Exp $ d22 1 a22 1 +++ mixer.c Mon Jun 14 14:14:29 1999 d66 1 a66 1 @@@@ -186,6 +177,199 @@@@ d175 4 d185 9 a193 3 + mixer_device = getenv("MIXERDEVICE"); + if (mixer_device == NULL) + mixer_device = "/dev/mixer0"; d195 7 a201 4 + if ((fd = open(mixer_device, O_RDWR)) == -1) { + perror(mixer_device); + close(fd); + } a202 3 + m = &values[device->device_id]; + if (ioctl(fd, AUDIO_MIXER_WRITE, m) == -1) { + perror("AUDIO_MIXER_WRITE"); a204 3 + /* from AUDIO_MIN_GAIN (0) to AUDIO_MAX_GAIN (255) */ + m->un.value.level[0] = m->un.value.level[1] = vol * AUDIO_MAX_GAIN / 100; + a205 2 + + close(fd); d239 1 d246 12 a257 1 + close(fd); d259 6 a264 6 + mixer_device = getenv("MIXERDEVICE"); + if (mixer_device == NULL) + mixer_device = "/dev/mixer0"; + + if ((fd = open(mixer_device, O_RDWR)) == -1) { + perror(mixer_device); a265 2 + return -1; + } d267 1 a267 5 + m = &values[device->device_id]; + if (ioctl(fd, AUDIO_MIXER_READ, m) == -1) { + perror("AUDIO_MIXER_READ"); + close(fd); + return -1; a268 3 + close(fd); + + return m->un.value.level[0] * 100 / AUDIO_MAX_GAIN; d274 1 a274 1 @@@@ -444,7 +628,7 @@@@ @ 1.6 log @Move to native NetBSD audio API, no more OSS. Contributed by Rui-Xiang Guo @ text @d1 1 a1 1 $NetBSD$ d19 1 a19 1 $NetBSD$ d82 1 a82 1 + mixer_device = "/dev/mixer"; d158 1 a158 1 + audioctl_device = "/dev/audioctl"; d183 1 a183 1 + mixer_device = "/dev/mixer"; d214 1 a214 1 + audioctl_device = "/dev/audioctl"; d244 1 a244 1 + mixer_device = "/dev/mixer"; @ 1.5 log @clean up patches a bit @ text @d1 34 a34 3 --- mixer.c.orig Mon Jun 7 02:19:57 1999 +++ mixer.c Mon Jun 7 02:20:03 1999 @@@@ -34,7 +34,6 @@@@ d36 2 a37 2 #ifdef __NetBSD__ #include d39 229 d270 5 a274 1 #ifdef __sgi @ 1.4 log @Update to V0.6.0 - Shoutcast/streaming support, including saving to playlists. - Multiple file selection in playlist window. - Drag n drop in playlist and main window, playlist can be ordered by dragging too (with the middle button). - BSD cpu utilization code patch. - SGI mixer support patch. - Window Maker docking option -dockwm, standard -dock option. - Ability to play a file not in playlist (right click menu->Open) - Ability to import playlists not created with gqmpeg - More complete ipc and command line options (gqmpeg -help for more). - If an ipc command is specified on the command line, and gqmpeg is not currently running, it is launched. - Internal interface redesigned, it should now be easy to add playback facilities for additional file types. - Pressing stop when already stopped now resets to beginning of playlist. - NetBSD mixer support. - The icecast / shoutcast netscape plugin now works. - Entries with tab completion are now obvious. (via tab arrow icon). - Better detection of mpg123 error messages, now prints unrecognized mpg123 messages as warnings (to the terminal). - Fix to set Solaris mixer device to /dev/audioctl. - Fix crash in shuffle code in some circumstances. - Various bugs fixes. @ text @d1 7 a7 6 $NetBSD$ --- mixer.c.orig Tue May 25 00:15:57 1999 +++ mixer.c Thu May 27 02:16:01 1999 @@@@ -42,6 +42,11 @@@@ #include d10 1 a10 8 +#ifdef __NetBSD__ +#include +#undef _POSIX_SOURCE +#endif + #define LEFT 1 #define RIGHT 256 #define LEFT_MASK 0x00ff @ 1.3 log @Don't skip "record" mixer devices on NetBSD, so that the volume control can stand a bigger chance of working on NetBSD. Tested with wss0 chip on i386, where the 'pcm' mixer (sub)device is the one which should be tweaked for volume control through libossaudio. @ text @d1 1 a1 1 $NetBSD: patch-ab,v 1.2 1999/05/15 03:49:14 hubertf Exp $ d3 4 a6 3 --- mixer.c.orig Sat Mar 27 13:38:09 1999 +++ mixer.c Sat May 15 20:19:54 1999 @@@@ -33,4 +33,9 @@@@ d16 1 a16 18 @@@@ -56,5 +61,5 @@@@ static DeviceData *current_device = NULL; -#if defined (linux) || defined (__FreeBSD__) +#if defined (linux) || defined (__FreeBSD__) || defined (__NetBSD__) void mixer_init(gint init_device_id) { @@@@ -91,5 +96,9 @@@@ for (i=0; i d15 1 a15 3 #define LEFT_MASK 0x00ff @@@@ -55,7 +60,7 @@@@ static GList *device_list = NULL; d22 11 a32 1 char *device_names[] = SOUND_DEVICE_NAMES; @ 1.1 log @Initial revision @ text @d1 1 a1 1 $NetBSD$ d9 1 a9 1 +#ifdef netbsd d22 1 a22 1 +#if defined (linux) || defined (__FreeBSD__) || defined (netbsd) @ 1.1.1.1 log @GQmpeg is a frontend to mpg123 with extensive themeability and playlist support. @ text @@