Commit d8dfb24e authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

triage iem16's lack of shared lib with statically declared copy/pasta functions

It appears iem16 is supposed to be built as a single binary. Unfortunately
Pd-extended broke these up into separate binaries without setting up a
sensible cross-platform shared library.

Thus Pd-extended had creation-order problems where, for example, the tab16
classes depended on a table16 to already exist so that the relevant symbols
could resolve properly.

We have no way of knowing how people were using these classes in the wild with
Pd-extended. To support old Pd-extended patches we just use copy/pasta for a
few functions so that any of the classes can get their objects instantiated
without depending on any of the other classes already existing.
parent d6d32a03
......@@ -21,6 +21,19 @@ typedef struct _sigdel16read{
int x_zerodel; /* 0 or vecsize depending on read/write order */
} t_sigdel16read;
/* routine to check that all del16writes/del16reads/vds have same vecsize */
/* copied from del16write~.c so that there's no dependency on del16write~
existing before we instantiate an object from this class. (Also because
I don't feel like adding and bugfixing a shared library across platforms */
static void sigdel16write_checkvecsize(t_sigdel16write *x, int vecsize){
if (x->x_rsortno != ugen_getsortno()) {
x->x_vecsize = vecsize;
x->x_rsortno = ugen_getsortno();
}
else if (vecsize != x->x_vecsize)
pd_error(x, "del16read/del16write/vd vector size mismatch");
}
static void sigdel16read_16bit(t_sigdel16read *x, t_float f);
static void *sigdel16read_new(t_symbol *s, t_floatarg f){
......
......@@ -13,7 +13,7 @@
/* ----------------------------- del16write~ ----------------------------- */
/* routine to check that all del16writes/del16reads/vds have same vecsize */
void sigdel16write_checkvecsize(t_sigdel16write *x, int vecsize){
static void sigdel16write_checkvecsize(t_sigdel16write *x, int vecsize){
if (x->x_rsortno != ugen_getsortno()) {
x->x_vecsize = vecsize;
x->x_rsortno = ugen_getsortno();
......
/* copyleft (c) 2003 forum::fr::umlute -- IOhannes m zmlnig @ IEM
* based on d_array.c from pd:
* Copyright (c) 1997-1999 Miller Puckette and others.
* For information on usage and redistribution, and for a DISCLAIMER OF ALL
* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
#ifndef INCLUDE_IEM16_DELAY_H__
#define INCLUDE_IEM16_DELAY_H__
/* sampling */
#include "iem16.h"
#include <string.h>
#if defined __WIN32 || defined __WIN32__
static int ugen_getsortno(void){return 0;}
#else
extern int ugen_getsortno(void);
#endif
t_class *sigdel16write_class;
typedef struct del16writectl{
int c_n;
t_iem16_16bit *c_vec;
int c_phase;
} t_del16writectl;
typedef struct _sigdel16write{
t_object x_obj;
t_symbol *x_sym;
t_del16writectl x_cspace;
int x_sortno; /* DSP sort number at which this was last put on chain */
int x_rsortno; /* DSP sort # for first del16read or write in chain */
int x_vecsize; /* vector size for del16read~ to use */
float x_f;
} t_sigdel16write;
//void sigdel16write_checkvecsize(t_sigdel16write *x, int vecsize);
# define XTRASAMPS 4
# define SAMPBLK 4
#define DEFDELVS 64 /* LATER get this from canvas at DSP time */
#endif
......@@ -27,8 +27,8 @@ typedef struct _table16 {
} t_table16;
EXTERN int table16_getarray16(t_table16*x, int*size,t_iem16_16bit**vec);
EXTERN void table16_usedindsp(t_table16*x);
//EXTERN int table16_getarray16(t_table16*x, int*size,t_iem16_16bit**vec);
//EXTERN void table16_usedindsp(t_table16*x);
......
......@@ -8,6 +8,17 @@
#include "iem16_table.h"
/* the following two functions are copied from table16.c so that each class can
be instantiated without a dependency on table16 already existing */
static int table16_getarray16(t_table16*x, int*size,t_iem16_16bit**vec){
*size=x->x_size;
*vec =x->x_table;
return 1;
}
static void table16_usedindsp(t_table16*x){
x->x_usedindsp=1;
}
/* ------------ tab16play~ - non-transposing sample playback --------------- */
......
......@@ -8,6 +8,14 @@
#include "iem16_table.h"
/* the following function is copied from table16.c so that each class can
be instantiated without a dependency on table16 already existing */
static int table16_getarray16(t_table16*x, int*size,t_iem16_16bit**vec){
*size=x->x_size;
*vec =x->x_table;
return 1;
}
/* ---------- tab16read: control, non-interpolating ------------------------ */
static t_class *tab16read_class;
......
......@@ -8,6 +8,14 @@
#include "iem16_table.h"
/* the following function is copied from table16.c so that each class can
be instantiated without a dependency on table16 already existing */
static int table16_getarray16(t_table16*x, int*size,t_iem16_16bit**vec){
*size=x->x_size;
*vec =x->x_table;
return 1;
}
/* ---------- tab16read4: control, non-interpolating ------------------------ */
static t_class *tab16read4_class;
......
......@@ -8,6 +8,17 @@
#include "iem16_table.h"
/* the following two functions are copied from table16.c so that each class can
be instantiated without a dependency on table16 already existing */
static int table16_getarray16(t_table16*x, int*size,t_iem16_16bit**vec){
*size=x->x_size;
*vec =x->x_table;
return 1;
}
static void table16_usedindsp(t_table16*x){
x->x_usedindsp=1;
}
/******************** tab16read4~ ***********************/
......
......@@ -8,6 +8,17 @@
#include "iem16_table.h"
/* the following two functions are copied from table16.c so that each class can
be instantiated without a dependency on table16 already existing */
static int table16_getarray16(t_table16*x, int*size,t_iem16_16bit**vec){
*size=x->x_size;
*vec =x->x_table;
return 1;
}
static void table16_usedindsp(t_table16*x){
x->x_usedindsp=1;
}
/******************** tab16read~ ***********************/
......
......@@ -8,6 +8,18 @@
#include "iem16_table.h"
/* the following two functions are copied from table16.c so that each class can
be instantiated without a dependency on table16 already existing */
static int table16_getarray16(t_table16*x, int*size,t_iem16_16bit**vec){
*size=x->x_size;
*vec =x->x_table;
return 1;
}
static void table16_usedindsp(t_table16*x){
x->x_usedindsp=1;
}
/* ------------------------ tab16receive~ ------------------------- */
static t_class *tab16receive_class;
......
......@@ -8,6 +8,17 @@
#include "iem16_table.h"
/* the following two functions are copied from table16.c so that each class can
be instantiated without a dependency on table16 already existing */
static int table16_getarray16(t_table16*x, int*size,t_iem16_16bit**vec){
*size=x->x_size;
*vec =x->x_table;
return 1;
}
static void table16_usedindsp(t_table16*x){
x->x_usedindsp=1;
}
/* ------------------------ tab16send~ ------------------------- */
......
......@@ -8,6 +8,19 @@
#include "iem16_table.h"
/* the following two functions are copied from table16.c so that each class can
be instantiated without a dependency on table16 already existing */
static int table16_getarray16(t_table16*x, int*size,t_iem16_16bit**vec){
*size=x->x_size;
*vec =x->x_table;
return 1;
}
static void table16_usedindsp(t_table16*x){
x->x_usedindsp=1;
}
/* ------------------------- tab16write~ -------------------------- */
static t_class *tab16write_tilde_class;
......
......@@ -19,6 +19,20 @@ typedef struct _sig16vd{
float x_f;
} t_sig16vd;
/* routine to check that all del16writes/del16reads/vds have same vecsize */
/* copied from del16write~.c so that there's no dependency on del16write~
existing before we instantiate an object from this class. (Also because
I don't feel like adding and bugfixing a shared library across platforms */
static void sigdel16write_checkvecsize(t_sigdel16write *x, int vecsize){
if (x->x_rsortno != ugen_getsortno()) {
x->x_vecsize = vecsize;
x->x_rsortno = ugen_getsortno();
}
else if (vecsize != x->x_vecsize)
pd_error(x, "del16read/del16write/vd vector size mismatch");
}
static void *sig16vd_new(t_symbol *s){
t_sig16vd *x = (t_sig16vd *)pd_new(sig16vd_class);
if (!*s->s_name) s = gensym("vd~");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment