File: pd_error.patch

package info (click to toggle)
jsusfx 0.4.0-7
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,912 kB
  • sloc: ansic: 19,352; cpp: 9,314; php: 403; yacc: 338; python: 163; makefile: 124; lex: 113; sh: 6
file content (83 lines) | stat: -rw-r--r-- 2,661 bytes parent folder | download | duplicates (3)
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
Description: replace error() with pd_error()
 the former was removed from Pd's public API with Pd-0.52
Author: IOhannes m zmölnig
Bug: https://github.com/asb2m10/jsusfx/issues/38
Last-Update: 2021-12-20
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- jsusfx.orig/pd/jsusfx_pd.cpp
+++ jsusfx/pd/jsusfx_pd.cpp
@@ -107,7 +107,9 @@
     bool dspOn;
     WDL_Mutex dspLock;
 
-    JsusFxPd(JsusFxPathLibrary &pathLibrary) : JsusFx(pathLibrary) {
+    const void*object;
+
+    JsusFxPd(JsusFxPathLibrary &pathLibrary, const void*obj = nullptr) : JsusFx(pathLibrary), object(obj) {
         midi = &midiHead[0];
         NSEEL_addfunc_varparm("midisend",3,NSEEL_PProc_THIS,&midisend);
     }
@@ -182,7 +184,7 @@
         vsnprintf(output, 4095, fmt, argptr);
         va_end(argptr);
 
-        error("%s", output);
+        pd_error(object, "%s", output);
     }
 
     void flushMidi() {
@@ -276,7 +278,7 @@
             filename += ".jsfx";
             
             if ( ! x->path->resolveDataPath(string(filename), result) ) {
-                error("jsusfx~: unable to find script %s", newFile->s_name);
+                pd_error(x, "jsusfx~: unable to find script %s", newFile->s_name);
                 return;
             }
         }
@@ -302,7 +304,7 @@
     if ( i > 64 || i < 0 )
         return;
     if ( ! x->fx->sliders[i].exists ) {
-        error("jsusfx~: slider number %d is not assigned for this effect", i);
+        pd_error(x, "jsusfx~: slider number %d is not assigned for this effect", i);
         return;
     }
     x->fx->moveSlider(i, value, 1);
@@ -313,7 +315,7 @@
     if ( i > 64 || i < 0 )
         return;
     if ( ! x->fx->sliders[i].exists ) {
-        error("jsusfx~: slider number %d is not assigned for this effect", i);
+        pd_error(x, "jsusfx~: slider number %d is not assigned for this effect", i);
         return;
     }
     x->fx->moveSlider(i, value, 0);
@@ -401,7 +403,7 @@
     x->bypass = true;
     x->user_bypass = false;
     x->scriptpath[0] = 0;
-    x->fx = new JsusFxPd(*(x->path));
+    x->fx = new JsusFxPd(*(x->path), x);
     x->x_clock = clock_new(x, (t_method)jsusfx_midiout);
 
     x->pinIn = 2;
@@ -482,7 +484,7 @@
     }
 
     if ( script == NULL || script->s_name[0] == 0) {
-        error("jsfx~: missing script");
+        pd_error(0, "jsfx~: missing script");
         return NULL;
     }
     
@@ -491,7 +493,7 @@
     x->bypass = true;
     x->user_bypass = false;
     x->scriptpath[0] = 0;
-    x->fx = new JsusFxPd(*(x->path));
+    x->fx = new JsusFxPd(*(x->path), x);
     x->x_clock = clock_new(x, (t_method)jsusfx_midiout);
     
     x->pinIn = 2;