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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
|
--- ../xmmix-1.2/Imakefile Sun Jul 14 19:48:56 1996
+++ ./Imakefile Fri Oct 24 23:34:17 1997
@@ -43,7 +43,7 @@
* #include "Motif.tmpl"
* #include "Motif.rules"
*/
-LOCAL_LIBRARIES= XmClientLibs
+LOCAL_LIBRARIES= -lXm -lXt -lX11 -lossaudio
/*
--- ../xmmix-1.2/appenv.h Sun Jul 14 19:48:59 1996
+++ ./appenv.h Fri Oct 24 23:33:47 1997
@@ -59,7 +59,11 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
+#ifdef __NetBSD__
+#include <soundcard.h>
+#else
#include <sys/soundcard.h>
+#endif
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
--- ../xmmix-1.2/main.c Thu Nov 7 17:01:43 1996
+++ ./main.c Mon Aug 11 23:12:51 1997
@@ -159,7 +159,7 @@
post_realize_config(&widgets);
/* Register callback routines */
- register_callbacks(&widgets);
+ register_callbacks(&widgets, app);
/* Initialize screen controls */
mx_start(&widgets);
--- ../xmmix-1.2/mixer.c Thu Nov 7 17:00:26 1996
+++ ./mixer.c Mon Aug 11 23:20:15 1997
@@ -104,6 +104,14 @@
***********************/
+#ifdef __NetBSD__
+void
+mxchg(int sig)
+{
+ deliverSIGIO();
+}
+#endif
+
/*
* do_ioctl
* Perform ioctl command. If file is not yet open or if we
@@ -681,11 +689,13 @@
/* Query sound driver version */
if ((fp = fopen("/dev/sndstat", "r")) == NULL) {
if (!app_data.demo) {
+#ifndef __NetBSD__
fprintf(errfp, "%s: %s: %s\n",
PROGNAME,
"Cannot open /dev/sndstat",
"assuming pre-3.0 sound driver.");
maxdevs = MAXDEVS_V2;
+#endif
}
return;
}
@@ -915,6 +925,7 @@
mx_start(widgets_t *m)
{
char msg[256];
+ int one = 1;
if (app_data.autoload != NULL && app_data.autoload[0] != '\0' &&
strcmp(app_data.autoload, "/dev/null") != 0) {
@@ -930,6 +941,14 @@
}
}
+#if defined(__NetBSD__)
+ signal(SIGIO, mxchg);
+ ioctl(dev_fd, FIOASYNC, &one);
+#endif
+
+ /* Query hardware mixer settings */
+ mx_queryhw(&widgets);
+
/* Update screen controls to match current status */
mx_updctl(m);
}
@@ -1531,6 +1550,22 @@
if (p->reason != XmCR_FOCUS || form == (Widget) NULL)
return;
+ /* Query hardware mixer settings */
+ mx_queryhw(&widgets);
+
+ /* Update screen controls */
+ mx_updctl(&widgets);
+}
+
+
+/*
+ * mx_change
+ * Mixer device has changed
+ */
+/*ARGSUSED*/
+void
+mx_change(XtPointer client_data)
+{
/* Query hardware mixer settings */
mx_queryhw(&widgets);
--- ../xmmix-1.2/mixer.h Sun Jul 14 19:49:04 1996
+++ ./mixer.h Mon Aug 11 23:19:17 1997
@@ -78,6 +78,7 @@
extern void mx_fsok_btn(Widget, XtPointer, XtPointer);
extern void mx_fscancel_btn(Widget, XtPointer, XtPointer);
extern void mx_focuschg(Widget, XtPointer, XtPointer);
+extern void mx_change(XtPointer);
#endif /* __MIXER_H__ */
--- ../xmmix-1.2/widget.c Sun Jul 14 19:49:09 1996
+++ ./widget.c Sat Oct 25 00:24:43 1997
@@ -973,6 +973,10 @@
delw = XmInternAtom(display, "WM_DELETE_WINDOW", False);
}
+static XtSignalId sigid;
+void deliverSIGIO() {
+ XtNoticeSignal(sigid);
+}
/*
* register_callbacks
@@ -985,7 +989,7 @@
* Nothing
*/
void
-register_callbacks(widgets_t *m)
+register_callbacks(widgets_t *m, XtAppContext app)
{
int i;
@@ -1126,6 +1130,15 @@
XmNfocusCallback,
(XtCallbackProc) mx_focuschg, (XtPointer) m->form
);
+
+#ifdef __NetBSD__
+ /*
+ * Mixer SIGIO change callback
+ */
+ sigid = XtAppAddSignal(app,
+ (XtSignalCallbackProc) mx_change, (XtPointer) 0
+ );
+#endif
/*
* Install WM_DELETE_WINDOW handler
--- ../xmmix-1.2/widget.h Sun Jul 14 19:49:10 1996
+++ ./widget.h Mon Aug 11 23:13:43 1997
@@ -119,7 +119,7 @@
extern void widget_init(widgets_t *);
extern void create_widgets(widgets_t *);
extern void post_realize_config(widgets_t *);
-extern void register_callbacks(widgets_t *);
+extern void register_callbacks(widgets_t *, XtAppContext);
#endif /* __WIDGET_H__ */
|