summaryrefslogtreecommitdiff
blob: 5d0b05f52c4cedf4f36f04e532e26f3ec5d3a4ff (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
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
diff -Naur jamin-0.9.0.orig/configure.in jamin-0.9.0/configure.in
--- jamin-0.9.0.orig/configure.in	2004-08-05 10:39:43.000000000 -0700
+++ jamin-0.9.0/configure.in	2004-09-29 23:53:58.269328327 -0700
@@ -1,7 +1,7 @@
 dnl Process this file with autoconf to produce a configure script.
 
 AC_INIT(configure.in)
-AM_INIT_AUTOMAKE(jamin, 0.9.0)
+AM_INIT_AUTOMAKE(jamin, 0.9.03)
 AM_CONFIG_HEADER(config.h)
 AM_MAINTAINER_MODE
 
@@ -32,11 +32,13 @@
 	[AC_DEFINE(HAVE_POSIX_SCHED,,[POSIX scheduler support])])
 
 PKG_CHECK_MODULES(JACK, jack >= 0.80.0)
+AC_CHECK_LIB(jack,jack_create_thread,
+	[AC_DEFINE(HAVE_JACK_CREATE_THREAD,,[JACK supports thread creation])])
 AC_CHECK_LIB(jack,jack_ringbuffer_create,
-	[AC_DEFINE(HAVE_JACK_RINGBUFFER,,[JACK has ringbuffer support])],)
+	[AC_DEFINE(HAVE_JACK_RINGBUFFER,,[JACK has ringbuffer support])])
 AC_CHECK_LIB(jack,jack_client_name_size,
 	[AC_DEFINE(HAVE_JACK_CLIENT_NAME_SIZE,,
-		[JACK returns client name size])],)
+		[JACK returns client name size])])
 
 [if test "${enable_double_fft+set}" = set; then]
 	PKG_CHECK_MODULES(FFTW, fftw3 >= 3.0, AC_DEFINE(FFTW_TYPE, [double], [Datatype used by installed FFTW libraries]), [AC_MSG_ERROR([Didn't find any double precision FFTW3 libraries])])
diff -Naur jamin-0.9.0.orig/src/compressor-ui.c jamin-0.9.0/src/compressor-ui.c
--- jamin-0.9.0.orig/src/compressor-ui.c	2004-07-17 07:34:58.000000000 -0700
+++ jamin-0.9.0/src/compressor-ui.c	2004-09-29 23:53:58.271327996 -0700
@@ -139,13 +139,6 @@
 	ma[i] = scale;
 
 	auto_gain[i] = 0;
-
-        prev_value_at[i] = -1.0;
-        prev_value_re[i] = -1.0;
-        prev_value_th[i] = 1.0;
-        prev_value_ra[i] = -1.0;
-        prev_value_kn[i] = -1.0;
-        prev_value_ma[i] = -1.0;
     }
 }
 
@@ -166,14 +159,7 @@
 
   if (!suspend_gang && gang_at[i])
     {
-      if (prev_value_at[i] > 0.0)
-        {
-          diff = value - prev_value_at[i];
-        }
-      else
-        {
-          diff = 0.0;
-        }
+      diff = value - prev_value_at[i];
 
       for (j = 0 ; j < XO_BANDS ; j++)
         {
@@ -213,14 +199,7 @@
 
   if (!suspend_gang && gang_re[i])
     {
-      if (prev_value_re[i] > 0.0)
-        {
-          diff = value - prev_value_re[i];
-        }
-      else
-        {
-          diff = 0.0;
-        }
+      diff = value - prev_value_re[i];
 
       for (j = 0 ; j < XO_BANDS ; j++)
         {
@@ -260,14 +239,7 @@
 
   if (!suspend_gang && gang_th[i])
     {
-      if (prev_value_th[i] < 0.0)
-        {
-          diff = value - prev_value_th[i];
-        }
-      else
-        {
-          diff = 0.0;
-        }
+      diff = value - prev_value_th[i];
 
       for (j = 0 ; j < XO_BANDS ; j++)
         {
@@ -317,14 +289,7 @@
 
   if (!suspend_gang && gang_ra[i])
     {
-      if (prev_value_ra[i] > 0.0)
-        {
-          diff = value - prev_value_ra[i];
-        }
-      else
-        {
-          diff = 0.0;
-        }
+      diff = value - prev_value_ra[i];
 
       for (j = 0 ; j < XO_BANDS ; j++)
         {
@@ -374,14 +339,7 @@
 
   if (!suspend_gang && gang_kn[i])
     {
-      if (prev_value_kn[i] > 0.0)
-        {
-          diff = value - prev_value_kn[i];
-        }
-      else
-        {
-          diff = 0.0;
-        }
+      diff = value - prev_value_kn[i];
 
       for (j = 0 ; j < XO_BANDS ; j++)
         {
@@ -423,14 +381,7 @@
 
   if (!suspend_gang && gang_ma[i])
     {
-      if (prev_value_ma[i] > 0.0)
-        {
-          diff = value - prev_value_ma[i];
-        }
-      else
-        {
-          diff = 0.0;
-        }
+      diff = value - prev_value_ma[i];
 
       for (j = 0 ; j < XO_BANDS ; j++)
         {
@@ -581,7 +532,7 @@
       gang_at[band] = FALSE;
       gtk_widget_modify_fg ((GtkWidget *) lab_at[band], GTK_STATE_NORMAL, 
                             get_color (TEXT_COLOR));
-      prev_value_at[band] = -1.0;
+      prev_value_at[band] = gtk_adjustment_get_value (adj_at[band]);
     }
   else
     {
@@ -598,7 +549,7 @@
       gang_re[band] = FALSE;
       gtk_widget_modify_fg ((GtkWidget *) lab_re[band], GTK_STATE_NORMAL, 
                             get_color (TEXT_COLOR));
-      prev_value_re[band] = -1.0;
+      prev_value_re[band] = gtk_adjustment_get_value (adj_re[band]);
     }
   else
     {
@@ -615,7 +566,7 @@
       gang_th[band] = FALSE;
       gtk_widget_modify_fg ((GtkWidget *) lab_th[band], GTK_STATE_NORMAL, 
                             get_color (TEXT_COLOR));
-      prev_value_th[band] = 1.0;
+      prev_value_th[band] = gtk_adjustment_get_value (adj_th[band]);
     }
   else
     {
@@ -632,7 +583,7 @@
       gang_ra[band] = FALSE;
       gtk_widget_modify_fg ((GtkWidget *) lab_ra[band], GTK_STATE_NORMAL, 
                             get_color (TEXT_COLOR));
-      prev_value_ra[band] = -1.0;
+      prev_value_ra[band] = gtk_adjustment_get_value (adj_ra[band]);
     }
   else
     {
@@ -648,7 +599,7 @@
       gang_kn[band] = FALSE;
       gtk_widget_modify_fg ((GtkWidget *) lab_kn[band], GTK_STATE_NORMAL, 
                             get_color (TEXT_COLOR));
-      prev_value_kn[band] = -1.0;
+      prev_value_kn[band] = gtk_adjustment_get_value (adj_kn[band]);
     }
   else
     {
@@ -665,7 +616,7 @@
       gang_ma[band] = FALSE;
       gtk_widget_modify_fg ((GtkWidget *) lab_ma[band], GTK_STATE_NORMAL, 
                             get_color (TEXT_COLOR));
-      prev_value_ma[band] = -1.0;
+      prev_value_ma[band] = gtk_adjustment_get_value (adj_ma[band]);
     }
   else
     {
diff -Naur jamin-0.9.0.orig/src/io.c jamin-0.9.0/src/io.c
--- jamin-0.9.0.orig/src/io.c	2004-04-02 18:47:19.000000000 -0800
+++ jamin-0.9.0/src/io.c	2004-09-29 23:54:06.053042018 -0700
@@ -58,6 +58,8 @@
  *	+ JACK not running realtime
  */
 
+#include "config.h"
+
 #include <stdio.h>
 #include <stdarg.h>
 #include <stdlib.h>
@@ -71,8 +73,10 @@
 #include <errno.h>
 #include <assert.h>
 #include <jack/jack.h>
+#ifdef HAVE_JACK_CREATE_THREAD
+#include <jack/thread.h>
+#endif
 
-#include "config.h"
 #include "ringbuffer.h"		/* uses <jack/ringbuffer.h>, if available */
 #include "process.h"
 #include "resource.h"
@@ -857,9 +861,12 @@
 {
     int rc;
     int policy;
-    struct sched_param rt_param, my_param;
+    struct sched_param rt_param;
     pthread_attr_t attributes;
     pthread_attr_init(&attributes);
+#ifndef HAVE_JACK_CREATE_THREAD
+    struct sched_param my_param;
+#endif
 
     /* Set priority and scheduling parameters based on the attributes
      * of the JACK client thread. */
@@ -884,6 +891,23 @@
     } else
 	IF_DEBUG(DBG_TERSE, io_trace("JACK subsystem not realtime"));
 
+#ifdef HAVE_JACK_CREATE_THREAD
+
+    rc = jack_create_thread(&dsp_thread, rt_param.sched_priority,
+			    jst.realtime, io_dsp_thread, NULL);
+    switch (rc) {
+    case 0:
+	IF_DEBUG(DBG_TERSE, io_trace("DSP thread created"));
+	break;
+    case EPERM:
+	io_errlog(EPERM, "no realtime privileges for DSP thread");
+	break;
+    default:
+	io_errlog(rc, "error creating DSP thread");
+    }
+
+#else  /* !HAVE_JACK_CREATE_THREAD */
+
     rc = pthread_attr_setschedpolicy(&attributes, policy);
     if (rc) {
 	io_errlog(EPERM, "cannot set scheduling policy, rc = %d.", rc);
@@ -984,10 +1008,11 @@
     /* return this thread to the scheduler it used before */
     sched_setscheduler(0, policy, &my_param);
     IF_DEBUG(DBG_TERSE, io_trace("DSP thread finally created"));
-    return 0;
-#else /* !HAVE_POSIX_SCHED */
-    return rc;
+    rc = 0;
 #endif /* HAVE_POSIX_SCHED */
+#endif /* HAVE_JACK_CREATE_THREAD */
+
+    return rc;
 }