int osc_veejay_handler( const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data ) { plugin_data_t *pd = (plugin_data_t*) user_data; veejay_t *info = pd->caller; veejay_lock( info ,__FUNCTION__ ); char *uri = osc_get_uri( data ); veejay_set_current_client( info, uri ); veejay_msg(0, "%s: client '%s', %s" , __FUNCTION__, uri,path ); // format of KEY in path!! free(uri); if( veejay_osc_property_calls_event( pd->instance, path, types, argv, data )) { veejay_unlock( info ,__FUNCTION__ ); return 0; } veejay_unlock( info ,__FUNCTION__ ); return 1; //@ try another method }
void osc_veejay_ui_tick( void *info, const char *path, const char *types, void **dargv, void *raw ) { char *uri = osc_get_uri( raw ); samplebank_tick_ui_client( uri ); free(uri); }
void osc_veejay_ui_init( void *info,const char *path, const char *types, void **dargv, void *raw) { lo_arg **argv = (lo_arg**) dargv; char *uri = osc_get_uri( raw ); veejay_add_client( info, uri ); veejay_init_ui( info, uri ); free(uri); }
int osc_sample_handler( const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data ) { plugin_data_t *pd = (plugin_data_t*) user_data; veejay_t *info = pd->caller; veejay_lock( info ,__FUNCTION__ ); char *uri = osc_get_uri( data ); veejay_set_current_client( info, uri ); veejay_msg(0, "%s: client '%s', path %s" , __FUNCTION__, uri ,path); // format of KEY in path!! free(uri); if( sample_osc_property_calls_event( pd->instance, path, types, argv, data )) { veejay_unlock( info ,__FUNCTION__ ); return 0; } veejay_msg(0, "%s: %s continues", __FUNCTION__, path ); char *required_format = sample_property_format_osc( pd->instance, path ); if(required_format == NULL ) { veejay_msg(0, "Plugin Path %s wrong format '%s' , need '%s'", path,types, required_format ); veejay_unlock( info ,__FUNCTION__ ); return 0; } if( strcmp( required_format , types ) != 0 ) { veejay_msg(0, "Sample Path %s wrong format '%s' , need '%s'", path,types, required_format ); veejay_unlock( info ,__FUNCTION__ ); return 0; } int n_elem = strlen(required_format); int k; free(required_format); if( types[0] == 'i' ) { int32_t *elements = (int32_t*) vj_malloc(sizeof(int32_t) * n_elem ); for( k = 0; k < n_elem; k ++ ) elements[k] = argv[k]->i32; sample_set_property_from_path( pd->instance, path,n_elem, (void*)elements ); free(elements); veejay_unlock( info ,__FUNCTION__ ); return 0; } else if( types[0] == 'd' ) { double *elements = (double*) vj_malloc(sizeof(double) * n_elem ); for( k = 0; k < n_elem; k ++ ) elements[k] = argv[k]->d; sample_set_property_from_path( pd->instance, path,n_elem, (void*)elements ); free(elements); veejay_unlock( info ,__FUNCTION__ ); return 0; } else if( types[0] == 's' ) { char **strs = vj_malloc(sizeof(char*) * n_elem ); for( k = 0; k < n_elem; k ++ ) strs[k] = strdup( (char*) &argv[k]->s ); sample_set_property_from_path( pd->instance, path, n_elem, (void*)strs ); for( k = 0; k < n_elem; k ++ ) if(strs[k]) free(strs[k]); veejay_unlock( info ,__FUNCTION__ ); return 0; } else if( types[0] == 'h' ) { uint64_t *elements = vj_malloc(sizeof(uint64_t) * n_elem ); for( k = 0; k < n_elem; k ++ ) elements[k] = argv[k]->h; sample_set_property_from_path( pd->instance, path, n_elem,(void*) elements ); veejay_unlock( info ,__FUNCTION__ ); return 0; } veejay_unlock( info ,__FUNCTION__ ); return 1; }
//@ plugin handler! int osc_plugin_handler( const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data ) { plugin_data_t *pd = (plugin_data_t*) user_data; veejay_t *info = pd->caller; veejay_lock(info,__FUNCTION__); char *uri = osc_get_uri( data ); free(uri); veejay_msg(0, "%s: client '%s', %s" , __FUNCTION__, uri,path ); // char *uri = osc_get_uri( data ); // veejay_set_current_client( info, uri ); // free(uri); char *required_format = plug_get_osc_format( pd->instance, pd->seq ); if( strcmp( required_format , types ) != 0 ) { veejay_msg(0, "Plugin Path %s wrong format '%s' , need '%s'", path,types, required_format ); veejay_unlock(info,__FUNCTION__ ); return 0; } int n_elem = strlen(required_format); int k; if( types[0] == 'i' ) { int32_t *elements = (int32_t*) vj_malloc(sizeof(int32_t) * n_elem ); for( k = 0; k < n_elem; k ++ ) elements[k] = argv[k]->i32; plug_set_parameter( pd->instance, pd->seq, n_elem, (void*)elements ); free(elements); veejay_unlock( info ,__FUNCTION__ ); return 0; } else if( types[0] == 'd' ) { double *elements = (double*) vj_malloc(sizeof(double) * n_elem ); for( k = 0; k < n_elem; k ++ ) elements[k] = argv[k]->d; plug_set_parameter( pd->instance, pd->seq, n_elem, (void*) elements ); free(elements); veejay_unlock( info ,__FUNCTION__ ); return 0; } else if( types[0] == 's' ) { char **strs = vj_malloc(sizeof(char*) * n_elem ); for( k = 0; k < n_elem; k ++ ) strs[k] = strdup( (char*) &argv[k]->s ); plug_set_parameter( pd->instance,pd->seq, n_elem, (void*) strs ); for( k = 0; k < n_elem; k ++ ) if(strs[k]) free(strs[k]); veejay_unlock( info ,__FUNCTION__ ); return 0; } veejay_unlock( info ,__FUNCTION__ ); return 1; //@ try another method }