aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorThomas O Fredericks <mrtof@users.sourceforge.net>2009-10-21 22:37:36 +0000
committerThomas O Fredericks <mrtof@users.sourceforge.net>2009-10-21 22:37:36 +0000
commit99b0b62ca25ec04b1629691a3644fdc513a52924 (patch)
tree688d0ac3575d19d7c9033f66c29e9cbc53cb5601 /test
parent4d1507c165853e01072fa166ccd36842d3574822 (diff)
Replaced paramGui abstraction by a class
svn path=/trunk/externals/tof/; revision=12629
Diffstat (limited to 'test')
-rw-r--r--test/test.c97
1 files changed, 97 insertions, 0 deletions
diff --git a/test/test.c b/test/test.c
new file mode 100644
index 0000000..9c31307
--- /dev/null
+++ b/test/test.c
@@ -0,0 +1,97 @@
+
+
+//#include "tof.h"
+//#include "param.h"
+#include "m_pd.h"
+#include "g_canvas.h"
+
+static t_class *test_class;
+
+
+typedef struct _test
+{
+ t_object x_obj;
+ t_outlet* outlet;
+ t_symbol* name;
+ t_canvas* canvas;
+ //t_symbol* target;
+ //t_class* empty_s;
+ //t_symbol* root;
+
+} t_test;
+
+
+
+// Dump out
+static void test_bang(t_test *x) {
+ t_atom a;
+ if (x->canvas) {
+
+ SETFLOAT(&a,1);
+ pd_typedmess((t_pd*)x->canvas,gensym("vis"),1,&a);
+ }
+
+}
+
+
+
+static void test_free(t_test *x)
+{
+ if (x->canvas) {
+ //post("Deleting it");
+ pd_free((t_pd *)x->canvas);
+ }
+ x->canvas = NULL;
+}
+
+
+static void *test_new(t_symbol *s, int ac, t_atom *av) {
+ t_test *x = (t_test *)pd_new(test_class);
+
+ // create a new canvas
+ x->name = gensym("xiu");
+
+ t_atom a;
+ SETSYMBOL(&a, x->name);
+ pd_typedmess(&pd_objectmaker,gensym("pd"),1,&a);
+
+ x->canvas = (t_canvas*) pd_newest();
+
+ // From this point on, we are hoping the "pd" object has been created
+
+ // Change name to match pd's canvas naming scheme
+ x->name = gensym("pd-xiu");
+
+
+
+ // Hide the window (stupid way of doing this)
+ if (x->canvas) {
+ SETFLOAT(&a,0);
+ pd_typedmess((t_pd*)x->canvas,gensym("vis"),1,&a);
+ }
+
+ // Try to change its name
+ //canvas_setargs(int argc, t_atom *argv);
+
+ x->outlet = outlet_new(&x->x_obj, &s_list);
+
+ return (x);
+}
+
+void test_setup(void) {
+ test_class = class_new(gensym("test"),
+ (t_newmethod)test_new, (t_method)test_free,
+ sizeof(t_test), 0, A_GIMME, 0);
+
+ class_addbang(test_class, test_bang);
+ //class_addsymbol(test_class, test_symbol);
+
+ //class_addmethod(test_class, (t_method) test_values, gensym("values"), A_DEFSYMBOL,0);
+
+ //class_addmethod(test_class, (t_method) test_guis, gensym("guis"), A_DEFSYMBOL,0);
+ //class_addmethod(test_class, (t_method) test_updateguis, gensym("updateguis"), A_DEFSYMBOL,0);
+
+
+ //class_addmethod(test_class, (t_method) test_update_guis, gensym("update"), A_DEFSYMBOL,0);
+
+}