aboutsummaryrefslogtreecommitdiff
path: root/cyclone
diff options
context:
space:
mode:
Diffstat (limited to 'cyclone')
-rw-r--r--cyclone/hammer/funbuff.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/cyclone/hammer/funbuff.c b/cyclone/hammer/funbuff.c
index 8328ffd..b5a8dbd 100644
--- a/cyclone/hammer/funbuff.c
+++ b/cyclone/hammer/funbuff.c
@@ -2,6 +2,7 @@
* For information on usage and redistribution, and for a DISCLAIMER OF ALL
* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
+#include <libgen.h>
#include "m_pd.h"
#include "common/loud.h"
#include "common/vefl.h"
@@ -227,10 +228,16 @@ static void funbuff_dowrite(t_funbuff *x, t_symbol *fn)
t_binbuf *bb = binbuf_new();
char buf[MAXPDSTRING];
t_hammernode *np;
- binbuf_addv(bb, "s", atom_getsymbol(binbuf_getvec(x->x_ob.te_binbuf)));
+ /* specifying the object as cyclone/funbuff breaks the file writing/
+ * reading as the it doesn't start with 'funbuff'. A call to
+ * libgen/basename fixes this. fjk, 2015-01-24 */
+ t_symbol *objName = atom_getsymbol(binbuf_getvec(x->x_ob.te_binbuf));
+ objName->s_name = basename(objName->s_name);
+ binbuf_addv(bb, "s", objName);
for (np = x->x_tree.t_first; np; np = np->n_next)
binbuf_addv(bb, "if", np->n_key, HAMMERNODE_GETFLOAT(np));
canvas_makefilename(x->x_canvas, fn->s_name, buf, MAXPDSTRING);
+
binbuf_write(bb, buf, "", 0);
binbuf_free(bb);
}
@@ -270,7 +277,7 @@ static void funbuff_read(t_funbuff *x, t_symbol *s)
a bug? but CHECKME other classes (cf seq's filetype dilemma) */
static void funbuff_write(t_funbuff *x, t_symbol *s)
{
- if (s && s != &s_)
+ if (s && s != &s_)
funbuff_dowrite(x, s);
else /* CHECKME default name */
hammerpanel_save(x->x_filehandle,
@@ -523,4 +530,6 @@ void funbuff_setup(void)
gensym("debug"), A_DEFFLOAT, 0);
#endif
hammerfile_setup(funbuff_class, 1);
+ logpost(NULL, 4, "this is cyclone/funbuff %s, %dth %s build",
+ CYCLONE_VERSION, CYCLONE_BUILD, CYCLONE_RELEASE);
}