summaryrefslogtreecommitdiff
path: root/audio/xamp/patches/patch-ac
blob: 45b92d7a2803b3dd592ddc8efa6ea7007873cbe8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
$NetBSD: patch-ac,v 1.2 2000/10/18 11:22:44 rh Exp $

--- QtAMP.cpp.orig	Fri Jul 31 22:29:58 1998
+++ QtAMP.cpp	Tue Oct 17 17:48:13 2000
@@ -24,10 +24,12 @@
 
 #include <sys/types.h>
 #include <sys/stat.h>
+#ifndef OS_NetBSD
 #include <sched.h>
+#include <sys/soundcard.h>
+#endif
 #include <sys/socket.h>
 #include <sys/ioctl.h>
-#include <sys/soundcard.h>
 #include <sys/time.h>
 #include <sys/resource.h>
 #include <errno.h>
@@ -89,7 +91,11 @@
 	if ((mixer = open("/dev/mixer", O_RDWR)) < 0)
 	    die("Error opening /dev/mixer, exiting\n");
 	ioctl(mixer, SOUND_MIXER_READ_PCM, &v);
-#endif OS_Linux
+#endif
+
+#ifdef OS_NetBSD
+	audioSetMixer();
+#endif
 	
 	/* where mine resource file is located */
 	char home[500];
@@ -428,6 +434,13 @@
 	int x = (tv*256 + tvl);
 	ioctl(mixer, SOUND_MIXER_WRITE_PCM, &x);
 #endif
+
+#ifdef OS_NetBSD
+	if (tvr == 0)
+		audioSetVolume(vr);
+	else
+		audioSetBalance(vr, tvr);
+#endif
 }
 
 void QtAMP::bal_slider_moved(int bal)
@@ -437,6 +450,10 @@
 	sprintf(volum,"Balance: %d",tvr);
 	vol_slider_moved(vr);
 	playLabel->setText( volum );
+
+#ifdef OS_NetBSD
+	audioSetBalance(vr, tvr);
+#endif
 }
 
 void QtAMP::bal_slider_released()
@@ -1077,12 +1094,24 @@
 		  int x = (tv*256 + tvl);
 		  ioctl(mixer, SOUND_MIXER_WRITE_PCM, &x);
 #endif
+
+#ifdef OS_NetBSD
+	int vr = 0;
+	audioSetVolume(vr);
+#endif
 	  }
 	if (mute == 0)
 	  {
 #ifdef OS_Linux
 		  int x = (7*256 + 7);
 		  ioctl(mixer, SOUND_MIXER_WRITE_PCM, &x);
+#endif
+
+#ifdef OS_NetBSD  
+	if (tvr == 0)
+		audioSetVolume(vr);
+	else
+		audioSetBalance(vr, tvr);
 #endif
 	  }
 	mute=!mute;