aboutsummaryrefslogtreecommitdiff
path: root/src/paramFile.h
diff options
context:
space:
mode:
authorThomas O Fredericks <mrtof@users.sourceforge.net>2009-10-26 21:11:49 +0000
committerThomas O Fredericks <mrtof@users.sourceforge.net>2009-10-26 21:11:49 +0000
commit71bb1c90837f8114a6fc962b1afcf074e2e17e63 (patch)
tree136de37d07aae76f16823982652e4a86dafb45c8 /src/paramFile.h
parent7541b9f1ba232dce4aceb41115c17292bd7298f4 (diff)
Added ifdefs to change the method of sending parameters
svn path=/trunk/externals/tof/; revision=12681
Diffstat (limited to 'src/paramFile.h')
-rw-r--r--src/paramFile.h54
1 files changed, 36 insertions, 18 deletions
diff --git a/src/paramFile.h b/src/paramFile.h
index 66d016c..fad3ea6 100644
--- a/src/paramFile.h
+++ b/src/paramFile.h
@@ -103,11 +103,12 @@ static void paramFile_do_load(t_paramFile* x, t_float f) {
t_symbol* root = x->root;
-
+ #ifndef USEBINDINGS
t_param* pp = get_param_list(root);
t_param* p;
if (pp) {
+ #endif
int r_error;
t_binbuf *bbuf = binbuf_new();
@@ -123,22 +124,28 @@ static void paramFile_do_load(t_paramFile* x, t_float f) {
while (bb_ac--) {
if (bb_av->a_type == A_SEMI) {
if ( IS_A_SYMBOL(av,0) && ac > 1) {
- /*
- #ifdef LOCAL
- t_symbol* path = atom_getsymbol(av);
- strcpy(param_buf_temp_a,root->s_name);
- strcat(param_buf_temp_a,path->s_name);
- t_symbol* s = gensym(param_buf_temp_a);
+ #ifdef USEBINDINGS
+ #ifdef LOCAL
+ t_symbol* path = atom_getsymbol(av);
+ strcpy(param_buf_temp_a,root->s_name);
+ strcat(param_buf_temp_a,path->s_name);
+ s = gensym(param_buf_temp_a);
+ #else
+ s = atom_getsymbol(av);
+ #endif
#else
- t_symbol* s = atom_getsymbol(av);
- #endif
- */
- s = atom_getsymbol(av);
- p = pp;
- while(p && p->path != s) p=p->next;
-
+ s = atom_getsymbol(av);
+ p = pp;
+ while(p && p->path != s) p=p->next;
+ #endif
- if (p) {
+
+ #ifdef USEBINDINGS
+ if (s->s_thing) {
+ #else
+ if (p) {
+ #endif
+
if ( ac > 3 && IS_A_SYMBOL(av,1) && atom_getsymbol(av+1) == &s_symbol) {
// STUPID MANAGEMENT OF SYMBOLS WITH SPACES
// This whole block is simply to convert symbols saved with spaces to complete symbols
@@ -157,11 +164,21 @@ static void paramFile_do_load(t_paramFile* x, t_float f) {
binbuf_free(bbuf_stupid);
t_atom* stupid_atom = getbytes(sizeof(*stupid_atom));
SETSYMBOL(stupid_atom, stupid_symbol);
- pd_typedmess(p->x, &s_symbol, 1, stupid_atom);
+
+ #ifdef USEBINDINGS
+ pd_typedmess(s->s_thing, &s_symbol, 1, stupid_atom);
+ #else
+ pd_typedmess(p->x, &s_symbol, 1, stupid_atom);
+ #endif
freebytes(stupid_atom, sizeof(*stupid_atom));
} else {
- pd_forwardmess(p->x, ac-1, av+1);
+ #ifdef USEBINDINGS
+ pd_forwardmess(s->s_thing, ac-1, av+1);
+ #else
+ pd_forwardmess(p->x, ac-1, av+1);
+ #endif
+
}
}
}
@@ -178,8 +195,9 @@ static void paramFile_do_load(t_paramFile* x, t_float f) {
binbuf_free(bbuf);
if ( r_error) pd_error(x, "%s: read failed", filename->s_name);
+ #ifndef USEBINDINGS
}
-
+ #endif
x->working = 0;