Skip to content
Snippets Groups Projects
Commit 9dad6f40 authored by Guillem Bartrina's avatar Guillem Bartrina
Browse files

add clone iterator, this will allow us to interact with the instances of the clone

parent bdc1b00b
No related branches found
No related tags found
1 merge request!521add clone iterator, this will allow us to interact with the instances of the clone
...@@ -237,6 +237,8 @@ struct _glist ...@@ -237,6 +237,8 @@ struct _glist
#define gl_gobj gl_obj.te_g #define gl_gobj gl_obj.te_g
#define gl_pd gl_gobj.g_pd #define gl_pd gl_gobj.g_pd
typedef void (*t_canvas_iterator)(t_canvas *x, void *data);
/*-------------------universal preset stuff---------------------*/ /*-------------------universal preset stuff---------------------*/
// for the universal preset_node ability (see g_editor.c doconnect/disconnect functions) // for the universal preset_node ability (see g_editor.c doconnect/disconnect functions)
// this is where all the classes capable of being controlled via preset should be defined // this is where all the classes capable of being controlled via preset should be defined
......
...@@ -65,6 +65,16 @@ typedef struct _clone ...@@ -65,6 +65,16 @@ typedef struct _clone
int x_suppressvoice; /* suppress voice number as $1 arg */ int x_suppressvoice; /* suppress voice number as $1 arg */
} t_clone; } t_clone;
/* the given 'it' function is executed over each of the underlying canvases
(they are passed as first parameter). 'data' is passed as second argument */
void clone_iterate(t_pd *z, t_canvas_iterator it, void* data)
{
t_clone *x = (t_clone *)z;
int i;
for(i = 0; i < x->x_n; i++)
it(x->x_vec[i].c_gl, data);
}
int clone_match(t_pd *z, t_symbol *name, t_symbol *dir) int clone_match(t_pd *z, t_symbol *name, t_symbol *dir)
{ {
t_clone *x = (t_clone *)z; t_clone *x = (t_clone *)z;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment