diff --git a/veejay-current/veejay-client/src/vj-api.c b/veejay-current/veejay-client/src/vj-api.c index db2b4bfa..0ebded09 100644 --- a/veejay-current/veejay-client/src/vj-api.c +++ b/veejay-current/veejay-client/src/vj-api.c @@ -4056,7 +4056,7 @@ static void load_effectchain_info() GtkWidget *tree = glade_xml_get_widget_( info->main_window, "tree_chain"); GtkListStore *store; gchar toggle[4]; - guint arr[6]; + guint arr[VIMS_CHAIN_LIST_ENTRY_VALUES]; GtkTreeIter iter; gint offset=0; @@ -4074,7 +4074,7 @@ static void load_effectchain_info() if(fxlen <= 0 ) { int i; - for( i = 0; i < 20; i ++ ) + for( i = 0; i < SAMPLE_MAX_EFFECTS; i ++ ) { gtk_list_store_append(store,&iter); gtk_list_store_set(store,&iter, FXC_ID, i ,-1); @@ -4090,13 +4090,13 @@ static void load_effectchain_info() while( offset < fxlen ) { - char line[12]; + char line[VIMS_CHAIN_LIST_ENTRY_LENGHT]; veejay_memset(arr,0,sizeof(arr)); veejay_memset(line,0,sizeof(line)); - strncpy( line, fxtext + offset, 8 ); - sscanf( line, "%02d%03d%1d%1d%1d", - &arr[0],&arr[1],&arr[2],&arr[3],&arr[4]); + strncpy( line, fxtext + offset, VIMS_CHAIN_LIST_ENTRY_LENGHT ); + sscanf( line, VIMS_CHAIN_LIST_ENTRY_FORMAT, + &arr[0],&arr[1],&arr[2],&arr[3],&arr[4],&arr[5],&arr[6]); // FIXME How to use of VIMS_CHAIN_LIST_ENTRY_VALUES ? char *name = _effect_get_description( arr[1] ); snprintf(toggle,sizeof(toggle),"%s",arr[3] == 1 ? "on" : "off" ); @@ -4114,9 +4114,9 @@ static void load_effectchain_info() { gchar *utf8_name = _utf8str( name ); char tmp[128]; - if( _effect_get_mix( arr[0] ) ) { - snprintf(tmp,sizeof(tmp),"%s %d", (info->uc.entry_tokens[ENTRY_SOURCE] == 0 ? "Sample " : "T " ), - info->uc.entry_tokens[ENTRY_CHANNEL]); + if( _effect_get_mix( arr[1] ) ) { + snprintf(tmp,sizeof(tmp),"%s %d", (arr[5] == 0 ? "Sample " : "T " ), + arr[6]); } else { snprintf(tmp,sizeof(tmp),"%s"," "); @@ -4138,11 +4138,11 @@ static void load_effectchain_info() g_object_unref( toggle ); g_object_unref( kf_togglepf ); } - offset += 8; + offset += VIMS_CHAIN_LIST_ENTRY_LENGHT; } // finally clean list end - while( last_index < 20 ) + while( last_index < SAMPLE_MAX_EFFECTS ) { gtk_list_store_append( store, &iter ); gtk_list_store_set( store, &iter, diff --git a/veejay-current/veejay-server/veejay/vims.h b/veejay-current/veejay-server/veejay/vims.h index 8c77f306..862dc2ca 100644 --- a/veejay-current/veejay-server/veejay/vims.h +++ b/veejay-current/veejay-server/veejay/vims.h @@ -280,6 +280,9 @@ enum { VIMS_VLOOPBACK_STOP = 46, }; +#define VIMS_CHAIN_LIST_ENTRY_LENGHT 12 // Size of sub message anwser (real size if SAMPLE_MAX_EFFECTS * VIMS_CHAIN_LIST_ENTRY_LENGHT) +#define VIMS_CHAIN_LIST_ENTRY_FORMAT "%02d%03d%1d%1d%1d%1d%03d" +#define VIMS_CHAIN_LIST_ENTRY_VALUES 7 // Number of values of the message enum { VJ_PLAYBACK_MODE_PLAIN = 2, diff --git a/veejay-current/veejay-server/veejay/vj-event.c b/veejay-current/veejay-server/veejay/vj-event.c index 228109d7..bfd6710b 100644 --- a/veejay-current/veejay-server/veejay/vj-event.c +++ b/veejay-current/veejay-server/veejay/vj-event.c @@ -8899,12 +8899,10 @@ void vj_event_send_chain_entry_parameters ( void *ptr, const char format[], va_ } } - - void vj_event_send_chain_list ( void *ptr, const char format[], va_list ap ) { int i; - char line[18]; + char line[VIMS_CHAIN_LIST_ENTRY_LENGHT]; int args[1]; char *str = NULL; veejay_t *v = (veejay_t*)ptr; @@ -8916,7 +8914,7 @@ void vj_event_send_chain_list ( void *ptr, const char format[], va_list ap ) if(SAMPLE_PLAYING(v)) { SAMPLE_DEFAULTS(args[0]); - char *print_buf = get_print_buf(16*SAMPLE_MAX_EFFECTS); + char *print_buf = get_print_buf(VIMS_CHAIN_LIST_ENTRY_LENGHT * SAMPLE_MAX_EFFECTS); for(i=0; i < SAMPLE_MAX_EFFECTS; i++) { int effect_id = sample_get_effect_any(args[0], i); @@ -8925,13 +8923,17 @@ void vj_event_send_chain_list ( void *ptr, const char format[], va_list ap ) int is_video = vj_effect_get_extra_frame(effect_id); int using_effect = sample_get_chain_status(args[0], i); int using_audio = 0; + int chain_source = sample_get_chain_source(args[0], i); + int chain_channel = sample_get_chain_channel(args[0], i); //int using_audio = sample_get_chain_audio(args[0],i); - sprintf(line,"%02d%03d%1d%1d%1d", + sprintf(line, VIMS_CHAIN_LIST_ENTRY_FORMAT, i, effect_id, is_video, (using_effect <= 0 ? 0 : 1 ), - (using_audio <= 0 ? 0 : 1 ) + (using_audio <= 0 ? 0 : 1 ), + chain_source, + chain_channel ); APPEND_MSG(print_buf,line); @@ -8944,7 +8946,7 @@ void vj_event_send_chain_list ( void *ptr, const char format[], va_list ap ) else if(STREAM_PLAYING(v)) { STREAM_DEFAULTS(args[0]); - char *print_buf = get_print_buf(16*SAMPLE_MAX_EFFECTS); + char *print_buf = get_print_buf(VIMS_CHAIN_LIST_ENTRY_LENGHT * SAMPLE_MAX_EFFECTS); for(i=0; i < SAMPLE_MAX_EFFECTS; i++) { @@ -8953,12 +8955,16 @@ void vj_event_send_chain_list ( void *ptr, const char format[], va_list ap ) { int is_video = vj_effect_get_extra_frame(effect_id); int using_effect = vj_tag_get_chain_status(args[0],i); - sprintf(line, "%02d%03d%1d%1d%1d", + int chain_source = sample_get_chain_source(args[0], i); + int chain_channel = sample_get_chain_channel(args[0], i); + sprintf(line, VIMS_CHAIN_LIST_ENTRY_FORMAT, i, effect_id, is_video, (using_effect <= 0 ? 0 : 1 ), - 0 + 0, + chain_source, + chain_channel ); APPEND_MSG(print_buf, line); }