diff options
-rw-r--r-- | k_cext.c | 25 | ||||
-rw-r--r-- | k_cext.h | 10 |
2 files changed, 34 insertions, 1 deletions
@@ -353,3 +353,28 @@ int k_cext_setvalue(char c[],float f) } return value_setfloat(gensym(c),f); } + +void k_cext_sendfloat (char c[],float f) +{ + static t_symbol *k_cext_internal_symbol=NULL; + while ( isspace(c[0]) ) + { + c++; + } + if(k_cext_internal_symbol==NULL) k_cext_internal_symbol=gensym(c); + if(k_cext_internal_symbol->s_thing) + pd_float(k_cext_internal_symbol->s_thing, f); +} + +void k_cext_sendsymbol (char c[],char s[]) +{ + static t_symbol *k_cext_internal_symbol=NULL; + while ( isspace(c[0]) ) + { + c++; + } + if(k_cext_internal_symbol==NULL) + k_cext_internal_symbol=gensym(c); + if(k_cext_internal_symbol->s_thing) + pd_symbol(k_cext_internal_symbol->s_thing, gensym(s)); +} @@ -77,9 +77,11 @@ K_EXTERN void k_sys_makecompilestring(char *to,char *name,char *funcname); K_EXTERN void k_sys_deletefile(char *name); K_EXTERN void k_sys_init(void); -/* TB value accessing functions*/ +/* TB value accessing / send functions */ K_EXTERN t_float k_cext_getvalue(char c[]); K_EXTERN int k_cext_setvalue(char c[],float f); +K_EXTERN void k_cext_sendfloat (char c[],float f); +K_EXTERN void k_cext_sendsymbol (char c[],char s[]); #define V(a) (x->values[a]) @@ -121,6 +123,12 @@ int k_cext_setvalue(char c[],float f); #define VALUE(char) k_cext_getvalue(char) #define SETVALUE(char,float) k_cext_setvalue(char,float) +/* TB: send float and symbol functions */ +void k_cext_sendfloat (char c[],float f); +void k_cext_sendsymbol (char c[],char s[]); +#define SENDFLOAT(char,float) k_cext_sendfloat(char,float) +#define SENDSYMBOL(char1,char2) k_cext_sendsymbol(char1,char2) + #define IF if( #define FOR for( |