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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
|
$NetBSD: patch-ac,v 1.7 2002/12/02 20:29:49 drochner Exp $
--- src/io.c.orig Sun Nov 24 20:02:58 2002
+++ src/io.c Mon Dec 2 20:21:20 2002
@@ -19,6 +19,14 @@
#include <sys/wait.h>
#include <signal.h>
#include <time.h>
+#ifdef __NetBSD__
+# include <sys/ioctl.h>
+# ifdef HAVE_OSS
+# include <soundcard.h>
+# else
+# include <sys/audioio.h>
+# endif
+#endif
#if defined(linux) || defined(__FreeBSD__)
# include <sys/soundcard.h>
# include <sys/ioctl.h>
@@ -1200,22 +1208,22 @@
struct stat buf;
#endif
-#if defined(sun) || defined(aix) || defined(__OpenBSD__)
+#if defined(sun) || defined(aix) || defined(__OpenBSD__) || (defined(__NetBSD__) && !defined(HAVE_OSS))
gchar *audiodev;
#endif
dsp = NULL;
-#if defined(linux) || defined(__FreeBSD__)
+#if defined(linux) || defined(__FreeBSD__) || (defined(__NetBSD__) && defined(HAVE_OSS))
/* for linux check if /dev/dsp or /dev/dsp1 exist */
- if (stat("/dev/dsp",&buf) == 0) {
- dsp = g_list_append(dsp,"/dev/dsp");
+ if (stat("@DEVOSSAUDIO@",&buf) == 0) {
+ dsp = g_list_append(dsp,"@DEVOSSAUDIO@");
}
if (stat("/dev/dsp1",&buf) == 0) {
dsp = g_list_append(dsp,"/dev/dsp1");
}
#endif
-#if defined(sun) || defined(__OpenBSD__)
+#if defined(sun) || defined(__OpenBSD__) || (defined(__NetBSD__) && !defined(HAVE_OSS))
/* check if the user has any special audio-hardware running,
which set the AUDIODEV-environment-variable */
audiodev = getenv("AUDIODEV");
@@ -1297,15 +1305,15 @@
struct stat buf;
# endif
#endif
-#if defined(linux) || defined(__FreeBSD__)
+#if defined(linux) || defined(__FreeBSD__) || (defined(__NetBSD__) && defined(HAVE_OSS))
gchar tmp2[MAXLINE];
#endif
strcpy(ret,"");
-#if defined(linux) || defined(__FreeBSD__)
+#if defined(linux) || defined(__FreeBSD__) || (defined(__NetBSD__) && defined(HAVE_OSS))
- if (strncmp(dsp,"/dev/dsp",8) == 0) {
+ if (strncmp(dsp,"@DEVOSSAUDIO@",8) == 0) {
strcpy(tmp,dsp+8);
g_snprintf(tmp2,MAXLINE,"/dev/mixer%s",tmp);
@@ -1315,7 +1323,7 @@
}
}
#endif
-#if defined(sun) || defined(__OpenBSD__)
+#if defined(sun) || defined(__OpenBSD__) || (defined(__NetBSD__) && !defined(HAVE_OSS))
g_snprintf(tmp,MAXLINE,"%s%s",dsp,"ctl");
@@ -2795,10 +2803,10 @@
#if !(defined(__MACH__) && defined(__APPLE__))
gint mix;
#endif
-#if defined(linux) || defined(__FreeBSD__)
+#if defined(linux) || defined(__FreeBSD__) || (defined(__NetBSD__) && defined(HAVE_OSS))
gint val;
#endif
-#if defined(sun) || defined(__OpenBSD__)
+#if defined(sun) || defined(__OpenBSD__) || (defined(__NetBSD__) && !defined(HAVE_OSS))
audio_info_t ainfo;
#endif
#ifdef hpux
@@ -2813,7 +2821,7 @@
return -1;
}
-#if defined(linux) || defined(__FreeBSD__)
+#if defined(linux) || defined(__FreeBSD__) || (defined(__NetBSD__) && defined(HAVE_OSS))
dodebug(10,"quering mixer %s\n", setupdata.mix_device);
mix = open(setupdata.mix_device, O_RDWR);
@@ -2833,7 +2841,7 @@
return ((val & 0x7f) + ((val >> 8) & 0x7f))/2;
#endif
-#if defined(sun) || defined(__OpenBSD__)
+#if defined(sun) || defined(__OpenBSD__) || (defined(__NetBSD__) && !defined(HAVE_OSS))
dodebug(10,"quering mixer %s\n", setupdata.mix_device);
mix = open(setupdata.mix_device, O_RDONLY);
@@ -2921,7 +2929,7 @@
#if !(defined(__MACH__) && defined(__APPLE__))
gint mix;
#endif
-#if defined(sun) || defined(__OpenBSD__)
+#if defined(sun) || defined(__OpenBSD__) || (defined(__NetBSD__) && !defined(HAVE_OSS))
audio_info_t ainfo;
#endif
#ifdef aix
@@ -2939,7 +2947,7 @@
return -1;
}
-#if defined(linux) || defined(__FreeBSD__)
+#if defined(linux) || defined(__FreeBSD__) || (defined(__NetBSD__) && defined(HAVE_OSS))
dodebug(10,"setting mixer %s to %d\n", setupdata.mix_device, val);
mix = open(setupdata.mix_device, O_RDWR);
@@ -2957,7 +2965,7 @@
close(mix);
#endif
-#if defined(sun) || defined(__OpenBSD__)
+#if defined(sun) || defined(__OpenBSD__) || (defined(__NetBSD__) && !defined(HAVE_OSS))
dodebug(10,"setting mixer %s to %d\n", setupdata.mix_device, val);
mix = open(setupdata.mix_device, O_WRONLY);
|