diff options
author | Thomas O Fredericks <mrtof@users.sourceforge.net> | 2009-10-12 20:40:34 +0000 |
---|---|---|
committer | Thomas O Fredericks <mrtof@users.sourceforge.net> | 2009-10-12 20:40:34 +0000 |
commit | a89ed77a5c948bbb91083fc4e5272713edaf8587 (patch) | |
tree | 8af75ba3acb782488122696b7dcc190abc7f78fb /src/param.c | |
parent | 3fcf217797b7c91f1371968d7de4124c9999f646 (diff) |
Added no preset saving to param
svn path=/trunk/externals/tof/; revision=12583
Diffstat (limited to 'src/param.c')
-rw-r--r-- | src/param.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/param.c b/src/param.c index 0d29ac3..473f172 100644 --- a/src/param.c +++ b/src/param.c @@ -45,6 +45,7 @@ typedef struct _paramClass { t_symbol* send; t_symbol* set_s; int nowaitforbang; + int nopresets; } t_paramClass; typedef struct _paramClass_inlet2 @@ -127,7 +128,15 @@ static void paramClass_get(t_paramClass *x, t_symbol** s, int* ac, t_atom** av) } // SPECIAL PARAM SAVE FUNCTION -static void paramClass_save(t_paramClass *x, t_binbuf* bb) { +static void paramClass_save(t_paramClass *x, t_binbuf* bb,int f) { + + //post("save:%i",f); + + + // f = -1 for the main save file + // f => 0 if it is a preset + if ( f >= 0 && x->nopresets) return; + //Put my data in binbuf if ((x->selector != &s_bang)) { int ac = x->ac + 2; @@ -180,20 +189,27 @@ static void* paramClass_new(t_symbol *s, int ac, t_atom *av) x->noloadbang = tof_find_tag('/',gensym("/nlb"), ac-1, av+1); //post("nlb: %i",x->noloadbang); + + + // FIND THE WAIT FOR BANG TAG: /wfb + x->nowaitforbang = !(tof_find_tag('/',gensym("/wfb"), ac-1, av+1)); // FIND THE NO SAVE TAG: /ns int nosave = tof_find_tag('/',gensym("/ns"), ac-1, av+1); //post("ns: %i",nosave); - // FIND THE WAIT FOR BANG TAG: /wfb - x->nowaitforbang = !(tof_find_tag('/',gensym("/wfb"), ac-1, av+1)); + // FIND THE NO PRESET TAG: /nps + x->nopresets = tof_find_tag('/',gensym("/nps"), ac-1, av+1); // REGISTER PARAM t_paramSaveMethod paramSaveMethod = NULL; t_paramGUIMethod paramGUIMethod = NULL; + + //post("no save:%i",nosave); + if ( x->gac > 0 ) paramGUIMethod = (t_paramGUIMethod) paramClass_GUI; - if ( nosave = 0 ) paramSaveMethod = (t_paramSaveMethod) paramClass_save; + if ( nosave == 0 ) paramSaveMethod = (t_paramSaveMethod) paramClass_save; x->param = param_register(x,root,path, \ (t_paramGetMethod) paramClass_get, \ |