From bd434f202db5b96a15e9e3fa27f37e7f9b6bc3a9 Mon Sep 17 00:00:00 2001 From: Niels Elburg Date: Mon, 4 Dec 2006 20:33:01 +0000 Subject: [PATCH] cleanup, bugfixes git-svn-id: svn://code.dyne.org/veejay/trunk@691 eb8d1916-c9e9-0310-b8de-cf0c9472ead5 --- veejay-current/gveejay-reloaded/callback.c | 261 +- veejay-current/gveejay-reloaded/multitrack.c | 5 +- veejay-current/gveejay-reloaded/vj-api.c | 36 +- veejay-current/libsample/sampleadm.c | 3 +- veejay-current/libvje/effects/blob.c | 3 +- veejay-current/libvje/effects/chromamagick.c | 13 +- veejay-current/libvje/effects/color.c | 2 +- veejay-current/libvje/effects/colormap.c | 2 - veejay-current/libvje/effects/common.c | 14 +- veejay-current/libvje/effects/complexinvert.c | 3 - .../libvje/effects/complexsaturate.c | 4 - veejay-current/libvje/effects/complexsync.c | 1 - .../libvje/effects/complexthreshold.c | 10 +- veejay-current/libvje/effects/enhancemask.c | 2 +- veejay-current/libvje/effects/flare.c | 6 - veejay-current/libvje/effects/goom.c | 24 +- veejay-current/libvje/effects/goom.h | 2 +- veejay-current/libvje/effects/magicmirror.c | 1 - .../libvje/effects/magicscratcher.c | 1 - veejay-current/libvje/effects/mirrors.c | 1 - veejay-current/libvje/effects/morphology.c | 5 +- veejay-current/libvje/effects/noisepencil.c | 2 - veejay-current/libvje/effects/smear.c | 6 +- veejay-current/libvje/effects/split.c | 3 - veejay-current/libvje/effects/zoom.c | 2 +- veejay-current/libvje/vj-effman.c | 2 +- veejay-current/share/gveejay.reloaded.glade | 2968 ++++++++--------- veejay-current/veejay/liblavplayvj.c | 8 - veejay-current/veejay/vj-event.c | 14 +- veejay-current/veejay/vj-font.c | 20 +- veejay-current/veejay/vj-font.h | 2 +- veejay-current/veejay/vj-perform.c | 2 +- 32 files changed, 1706 insertions(+), 1722 deletions(-) diff --git a/veejay-current/gveejay-reloaded/callback.c b/veejay-current/gveejay-reloaded/callback.c index 740e473e..4a97ae78 100644 --- a/veejay-current/gveejay-reloaded/callback.c +++ b/veejay-current/gveejay-reloaded/callback.c @@ -33,6 +33,9 @@ static int bg_[4]; static int fg_[4]; static int ln_[4]; + +static void change_box_color_rgb( GtkWidget *box, int r, int g, int b,int a, int fill ); + void text_defaults() { bg_[0] = 255; bg_[1] = 255; bg_[2] = 255; bg_[3] = 0; @@ -2608,6 +2611,125 @@ on_vims_messenger_single_clicked( void ) } } +static void srt_load_subtitle(int sid) +{ + gint len = 0; + gint seq_id = 0; + gint tc1l=0; + gint tc2l=0; + char tc1[20]; + char tc2[20]; + char tmp[1000]; + gint tlen=0; + gint ln[4]; + gint fg[4]; + gint bg[4]; + gint use_bg = 0; + gint outline = 0; + gint size = 0; + gint font = 0; + gint x =0; + gint y = 0; + + //multi_vims( VIMS_SRT_SELECT, "%d", sid ); + veejay_msg(0, "Loading subtitle '%d'", sid ); + multi_vims( VIMS_SRT_INFO, "%d", sid ); + gchar *text = recv_vims( 6,&len ); + + veejay_msg(0, "raw text: '%s'", text); + + bzero(tmp,1000); + bzero(tc1,20); + bzero(tc2,20); + + clear_textview_buffer( "textview_text" ); + int s1=0,s2=0; + int n = 0; + if(text && len > 0 ) + { + sscanf( text,"%5d%9d%9d%2d", &seq_id ,&s1,&s2,&tc1l ); + strncpy( tc1, text+7+18,tc1l ); + sscanf( text+7+18+tc1l,"%2d", &tc2l ); + strncpy( tc2, text+7+18+tc1l + 2, tc2l ); + sscanf( text+7+18+tc1l+2+tc2l, "%3d", &tlen ); + strncpy( tmp, text + 7 + 18 + tc1l + 2 + tc2l + 3, tlen ); + n = sscanf( text+7+18 + tc1l+2+tc2l+3+tlen,"%04d%04d%03d%03d%03d%03d%03d%03d%03d%03d%03d%03d%03d%03d%03d%03d%03d%03d", + &x,&y, &font, &size, &bg[0],&bg[1],&bg[2],&fg[0],&fg[1],&fg[2],&use_bg,&outline,&ln[0],&ln[1], + &ln[2],&bg[3],&fg[3],&ln[3] ); + } + + srt_locked_ = 1; + + update_spin_range( "spin_text_start",0, get_total_frames(),s1); + update_spin_range( "spin_text_end",0, get_total_frames(),s2); + + + veejay_msg(0, "x=%d,y=%d, font=%d,size=%d,bg=[%d,%d,%d,%d]", + x,y,font,size,bg[0],bg[1],bg[2],bg[3] ); + veejay_msg(0, "fg=[%d,%d,%d,%d], ln=[%d,%d,%d,%d]", + fg[0],fg[1],fg[2],fg[3],ln[0],ln[1],ln[2],ln[3] ); + + set_textview_buffer( "textview_text", tmp ); + + update_spin_value( "spin_text_start" ,s1); + update_spin_value( "spin_text_end", s2 ); + + change_box_color_rgb( + glade_xml_get_widget(info->main_window, "boxbg" ), + bg[0],bg[1],bg[2],bg[3], (is_button_toggled( "textcolorbg" ) ? 1 : 0 ) ); + + change_box_color_rgb( + glade_xml_get_widget(info->main_window, "boxtext" ), + fg[0],fg[1],fg[2],fg[3], (is_button_toggled( "textcolorfg" ) ? 1: 0) ); + + + change_box_color_rgb( + glade_xml_get_widget( info->main_window, "boxln" ), + ln[0],ln[1],ln[2],ln[3], (is_button_toggled( "textcolorln" ) ? 1: 0) ); + + memcpy( bg_, bg, sizeof(bg_)); + memcpy( fg_, fg, sizeof(fg_)); + memcpy( ln_, ln, sizeof(ln_)); + + set_toggle_button( "use_bg", use_bg ); + set_toggle_button( "use_outline", outline); + update_spin_value( "spin_text_size", size ); + update_spin_value( "spin_text_x", x ); + update_spin_value( "spin_text_y", y ); + + if(is_button_toggled( "textcolorfg") ) + { + update_slider_value( "textcolorred", fg_[0],0 ); + update_slider_value( "textcolorblue",fg_[2],0 ); + update_slider_value( "textcolorgreen",fg_[1],0); + update_slider_value( "textcoloralpha", fg_[3],0); + } + else if( is_button_toggled( "textcolorbg") ) + { + update_slider_value( "textcolorred", bg_[0],0 ); + update_slider_value( "textcolorblue",bg_[2],0 ); + update_slider_value( "textcolorgreen",bg_[1],0); + update_slider_value( "textcoloralpha",bg_[3],0); + } + else if ( is_button_toggled( "textcolorln" )) + { + update_slider_value( "textcolorred", ln_[0],0 ); + update_slider_value( "textcolorblue",ln_[2],0 ); + update_slider_value( "textcolorgreen",ln_[1],0); + update_slider_value( "textcoloralpha", ln_[3],0); + } + GtkWidget *combo = glade_xml_get_widget( info->main_window, "combobox_fonts" ); + gtk_combo_box_set_active( GTK_COMBO_BOX( combo ), font ); + + +// glade_xml_get_widget( info->main_window, "combobox_textsrt" ); +// gtk_combo_box_set_active( GTK_COMBO_BOX( combo ), seq_id-1 ); + + + srt_locked_ = 0; + + if(text) free(text); +} void on_button_text_new_clicked( GtkWidget *w, gpointer data ) { @@ -2626,7 +2748,18 @@ void on_button_text_new_clicked( GtkWidget *w, gpointer data ) multi_vims( VIMS_SRT_ADD, "%d %d %d %d %d %s", 0,s1,s2,x,y,text ); - gint font = gtk_combo_box_get_active( GTK_COMBO_BOX( w ) ); + int tmp = 0; + gchar *new_srt_id = recv_vims( 5, &tmp ); + + if(tmp>0) + { + int id = 0; + sscanf( new_srt_id, "%d", &id ); + g_free(new_srt_id); + srt_seq_ = id; + } + +/* gint font = gtk_combo_box_get_active( GTK_COMBO_BOX( w ) ); gint size = get_nums( "spin_text_size" ); gint use_border = is_button_toggled( "use_bg" ); gint outline = is_button_toggled( "use_outline"); @@ -2643,8 +2776,10 @@ void on_button_text_new_clicked( GtkWidget *w, gpointer data ) multi_vims( VIMS_FONT_COL, "%d %d %d %d %d", bg_[0],bg_[1],bg_[2],bg_[3], 2 ); multi_vims( VIMS_FONT_COL, "%d %d %d %d %d", ln_[0],ln_[1],ln_[2],ln_[3], 3 ); multi_vims( VIMS_FONT_COL, "%d %d %d %d %d", use_border, outline,0,0,0 ); - +*/ free(text); + veejay_msg(0, "New SRT: %d",srt_seq_); + srt_load_subtitle( srt_seq_ ); info->uc.reload_hint[HINT_HISTORY] = 1; } @@ -2739,6 +2874,7 @@ void on_button_text_update_clicked(GtkWidget *w, gpointer data) gint s1 = get_nums( "spin_text_start" ); gint s2 = get_nums( "spin_text_end" ); gchar *text = get_textview_buffer( "textview_text" ); + veejay_msg(0, "srt_seq = %d",srt_seq_ ); if(text) multi_vims( VIMS_SRT_UPDATE, "%d %d %d %s", srt_seq_, s1,s2,text ); } @@ -2799,125 +2935,12 @@ void on_combobox_textsrt_changed( GtkWidget *w, gpointer data) gchar *k = gtk_combo_box_get_active_text( GTK_COMBO_BOX(w) ); int sid = atoi(k); - printf("Selected '%d'\n", sid); - -// srt_seq_ = 1 + gtk_combo_box_get_active( GTK_COMBO_BOX( w ) ); - gint len = 0; - - multi_vims( VIMS_SRT_SELECT, "%d", sid ); - multi_vims( VIMS_SRT_INFO, "%d", sid ); - - gchar *text = recv_vims( 6,&len ); - gint seq_id = 0; - gint tc1l=0; - gint tc2l=0; - char tc1[20]; - char tc2[20]; - char tmp[1000]; - gint tlen=0; - bzero(tmp,1000); - bzero(tc1,20); - bzero(tc2,20); - gint ln[4]; - gint fg[4]; - gint bg[4]; - gint use_bg = 0; - gint outline = 0; - gint size = 0; - gint font = 0; - gint x =0; - gint y = 0; - - clear_textview_buffer( "textview_text" ); - int s1=0,s2=0; - int n = 0; - if(text && len > 0 ) + if( sid > 0) { - sscanf( text,"%5d%2d%9d%9d", &seq_id ,&tc1l,&s1,&s2 ); - strncpy( tc1, text+7+18,tc1l ); - sscanf( text+7+18+tc1l,"%2d", &tc2l ); - strncpy( tc2, text+7+18+tc1l + 2, tc2l ); - sscanf( text+7+18+tc1l+2+tc2l, "%3d", &tlen ); - strncpy( tmp, text + 7 + 18 + tc1l + 2 + tc2l + 3, tlen ); - n = sscanf( text+7+18 + tc1l+2+tc2l+3+tlen,"%04d%04d%03d%03d%03d%03d%03d%03d%03d%03d%03d%03d%03d%03d%03d%03d%03d%03d", - &x,&y, &font, &size, &bg[0],&bg[1],&bg[2],&fg[0],&fg[1],&fg[2],&use_bg,&outline,&ln[0],&ln[1], - &ln[2],&bg[3],&fg[3],&ln[3] ); + multi_vims( VIMS_SRT_SELECT, "%d", sid ); + srt_seq_ = sid; + srt_load_subtitle(sid); } - - veejay_msg(0, "tokens: %d, %s",n,text ); - - update_spin_range( "spin_text_start",0, get_total_frames(),s1); - update_spin_range( "spin_text_end",0, get_total_frames(),s2); - - - veejay_msg(0, "x=%d,y=%d, font=%d,size=%d,bg=[%d,%d,%d,%d]", - x,y,font,size,bg[0],bg[1],bg[2],bg[3] ); - veejay_msg(0, "fg=[%d,%d,%d,%d], ln=[%d,%d,%d,%d]", - fg[0],fg[1],fg[2],fg[3],ln[0],ln[1],ln[2],ln[3] ); - - srt_locked_ = 1; - srt_seq_ = seq_id; - - set_textview_buffer( "textview_text", tmp ); - - update_spin_value( "spin_text_start" ,s1); - update_spin_value( "spin_text_end", s2 ); - - change_box_color_rgb( - glade_xml_get_widget(info->main_window, "boxbg" ), - bg[0],bg[1],bg[2],bg[3], (is_button_toggled( "textcolorbg" ) ? 1 : 0 ) ); - - change_box_color_rgb( - glade_xml_get_widget(info->main_window, "boxtext" ), - fg[0],fg[1],fg[2],fg[3], (is_button_toggled( "textcolorfg" ) ? 1: 0) ); - - - change_box_color_rgb( - glade_xml_get_widget( info->main_window, "boxln" ), - ln[0],ln[1],ln[2],ln[3], (is_button_toggled( "textcolorln" ) ? 1: 0) ); - - memcpy( bg_, bg, sizeof(bg_)); - memcpy( fg_, fg, sizeof(fg_)); - memcpy( ln_, ln, sizeof(ln_)); - - set_toggle_button( "use_bg", use_bg ); - set_toggle_button( "use_outline", outline); - update_spin_value( "spin_text_size", size ); - update_spin_value( "spin_text_x", x ); - update_spin_value( "spin_text_y", y ); - - if(is_button_toggled( "textcolorfg") ) - { - update_slider_value( "textcolorred", fg_[0],0 ); - update_slider_value( "textcolorblue",fg_[2],0 ); - update_slider_value( "textcolorgreen",fg_[1],0); - update_slider_value( "textcoloralpha", fg_[3],0); - } - else if( is_button_toggled( "textcolorbg") ) - { - update_slider_value( "textcolorred", bg_[0],0 ); - update_slider_value( "textcolorblue",bg_[2],0 ); - update_slider_value( "textcolorgreen",bg_[1],0); - update_slider_value( "textcoloralpha",bg_[3],0); - } - else if ( is_button_toggled( "textcolorln" )) - { - update_slider_value( "textcolorred", ln_[0],0 ); - update_slider_value( "textcolorblue",ln_[2],0 ); - update_slider_value( "textcolorgreen",ln_[1],0); - update_slider_value( "textcoloralpha", ln_[3],0); - } - GtkWidget *combo = glade_xml_get_widget( info->main_window, "combobox_fonts" ); - gtk_combo_box_set_active( GTK_COMBO_BOX( combo ), font ); - - - glade_xml_get_widget( info->main_window, "combobox_textsrt" ); - gtk_combo_box_set_active( GTK_COMBO_BOX( combo ), seq_id-1 ); - - - srt_locked_ = 0; - - if(text) free(text); } diff --git a/veejay-current/gveejay-reloaded/multitrack.c b/veejay-current/gveejay-reloaded/multitrack.c index c207f0dd..d94c2cb7 100644 --- a/veejay-current/gveejay-reloaded/multitrack.c +++ b/veejay-current/gveejay-reloaded/multitrack.c @@ -1513,7 +1513,7 @@ void *mt_preview( gpointer user_data ) if(mt->quit) { G_UNLOCK( mt_lock ); - g_thread_exit(NULL); + break; } if(!lt->preview ) @@ -1614,8 +1614,9 @@ void *mt_preview( gpointer user_data ) g_usleep(sleepy); //@ clear our buffer } + gdk_pixbuf_unref( nopreview ); - + g_thread_exit(NULL); } diff --git a/veejay-current/gveejay-reloaded/vj-api.c b/veejay-current/gveejay-reloaded/vj-api.c index bef95bd2..62a19d8a 100644 --- a/veejay-current/gveejay-reloaded/vj-api.c +++ b/veejay-current/gveejay-reloaded/vj-api.c @@ -625,8 +625,6 @@ static void unlock_preview_(const char *f, int line) static void gtk_image_set_from_pixbuf__( GtkImage *w, GdkPixbuf *p, const char *f, int l ) { #ifdef STRICT_CHECKING - veejay_msg(0, "%s called by %s: %d" , __FUNCTION__, f, l ); - assert( GTK_IS_IMAGE(w) ); #endif gtk_image_set_from_pixbuf(w, p); @@ -635,8 +633,6 @@ static void gtk_image_set_from_pixbuf__( GtkImage *w, GdkPixbuf *p, const char * static void gtk_widget_set_sensitive___( GtkWidget *w, gboolean state, const char *f, int l ) { #ifdef STRICT_CHECKING - veejay_msg(0, "%s called by %s: %d", __FUNCTION__, f, l ); - assert( GTK_IS_WIDGET(w) ); #endif gtk_widget_set_sensitive(w, state ); @@ -5416,6 +5412,11 @@ static void reload_srt() gint i = 0; gchar *p = srts; gchar *token = NULL; + + if( len == 0 ) + disable_widget( "SRTframe"); + else + enable_widget( "SRTframe"); veejay_msg(0, "%s", srts ); while( i < len ) { @@ -6697,21 +6698,31 @@ void vj_gui_preview(void) int vj_gui_reconnect(char *hostname,char *group_name, int port_num) { - if(info->client) - vj_client_free(info->client); +// if(info->client) +// vj_client_free(info->client); - info->client = vj_client_alloc(0,0,0); +// info->client = vj_client_alloc(0,0,0); + + if(info->client ) + { + veejay_msg(VEEJAY_MSG_ERROR, "Must disconnect first"); + return 0; + } + + if(!info->client) + info->client = vj_client_alloc(0,0,0); + if(!vj_client_connect( info->client, hostname, group_name, port_num ) ) { if(info->client) vj_client_free(info->client); info->client = NULL; - printf("UNVERIFIED ERROR: Unable to connect %s:%d\n",hostname,port_num); - exit(0); return 0; } + vj_msg(VEEJAY_MSG_INFO, "New connection with Veejay running on %s port %d", (group_name == NULL ? hostname : group_name), port_num ); + int k = 0; for( k = 0; k < 3; k ++ ) memset( info->history_tokens[k] , 0, (sizeof(int) * STATUS_TOKENS) ); @@ -6726,9 +6737,9 @@ int vj_gui_reconnect(char *hostname,char *group_name, int port_num) (gpointer*) info, NULL ); + load_editlist_info(); - if(info->rawdata) - free(info->rawdata); + info->rawdata = (guchar*) vj_malloc(sizeof(guchar) * info->el.width * info->el.height * 3); memset(info->rawdata,0,sizeof(guchar) * info->el.width * info->el.height * 3 ); memset( &vims_keys_list, 0, sizeof(vims_keys_t)); @@ -6860,6 +6871,9 @@ void vj_gui_disconnect() { vj_client_close(info->client); vj_client_free(info->client); + if(info->rawdata) + free(info->rawdata); + info->rawdata = NULL; info->client = NULL; } /* reset all trees */ diff --git a/veejay-current/libsample/sampleadm.c b/veejay-current/libsample/sampleadm.c index 17bb3f02..5c1b0a77 100644 --- a/veejay-current/libsample/sampleadm.c +++ b/veejay-current/libsample/sampleadm.c @@ -253,7 +253,7 @@ sample_info *sample_skeleton_new(long startFrame, long endFrame) char tmp_file[20]; sample_info *si; - int i, j, n, id = 0; + int i, j; if (!initialized) { return NULL; @@ -719,7 +719,6 @@ int sample_set_marker_start(int sample_id, int marker) int sample_set_marker(int sample_id, int start, int end) { sample_info *si = sample_get(sample_id); - int tmp; if(!si) return -1; if( start < si->first_frame ) diff --git a/veejay-current/libvje/effects/blob.c b/veejay-current/libvje/effects/blob.c index 44d60e92..22f40e5b 100644 --- a/veejay-current/libvje/effects/blob.c +++ b/veejay-current/libvje/effects/blob.c @@ -220,9 +220,8 @@ void blob_apply(VJFrame *frame, uint8_t *srcY = frame->data[0]; uint8_t *srcCb= frame->data[1]; uint8_t *srcCr= frame->data[2]; - int i,j,k; + int i,k; int s; - int op_a, op_b; double max = speed / 10.0; blob_func f = blob_render(); diff --git a/veejay-current/libvje/effects/chromamagick.c b/veejay-current/libvje/effects/chromamagick.c index 63850a8d..843db1de 100644 --- a/veejay-current/libvje/effects/chromamagick.c +++ b/veejay-current/libvje/effects/chromamagick.c @@ -650,7 +650,7 @@ void chromamagic_substract(VJFrame *frame, VJFrame *frame2, int w, int h, int op uint8_t *Cb2 = frame2->data[1]; uint8_t *Cr2 = frame2->data[2]; - int a ,b, c; + int a ,b; const unsigned int o1 = op_a; const unsigned int o2 = 255 - op_a; @@ -659,20 +659,15 @@ void chromamagic_substract(VJFrame *frame, VJFrame *frame2, int w, int h, int op a = Y[i]; b = Y2[i]; - c = a - ((b * o1) >> 8); - Y[i] = CLAMP_Y(c); + Y[i] = a - ((b * o1) >> 8); a = Cb[i]; b = Cb2[i]; - c = (((a * o2) + (b * o1))>>8); - CLAMP_UV(c); - Cb[i] = c; + Cb[i] = (((a * o2) + (b * o1))>>8); a = Cr[i]; b = Cr2[i]; - c = (((a * o2) + (b * o1)) >> 8); - CLAMP_UV(c); - Cr[i] = c; + Cr[i] = (((a * o2) + (b * o1)) >> 8); } } diff --git a/veejay-current/libvje/effects/color.c b/veejay-current/libvje/effects/color.c index 98b8004c..f60b7ab7 100644 --- a/veejay-current/libvje/effects/color.c +++ b/veejay-current/libvje/effects/color.c @@ -62,7 +62,7 @@ void color_apply(VJFrame *frame, int width, int height, const unsigned int cr_b = opacity_b * 58; const unsigned int cr_c = opacity_c * 114; - uint8_t p1,p2,q1,q2; + int p1,p2,q1,q2; const int uv_len = frame->uv_len; uint8_t *Cb = frame->data[1]; diff --git a/veejay-current/libvje/effects/colormap.c b/veejay-current/libvje/effects/colormap.c index 905cc01f..71ad773b 100644 --- a/veejay-current/libvje/effects/colormap.c +++ b/veejay-current/libvje/effects/colormap.c @@ -55,8 +55,6 @@ void colormap_apply( VJFrame *frame, int width, int height, int r, int g, int b) { unsigned int i; int len = (width * height); - int uv_len = frame->uv_len; - uint8_t *Y = frame->data[0]; uint8_t *Cb = frame->data[1]; uint8_t *Cr = frame->data[2]; diff --git a/veejay-current/libvje/effects/common.c b/veejay-current/libvje/effects/common.c index 78a6f107..188f2c35 100644 --- a/veejay-current/libvje/effects/common.c +++ b/veejay-current/libvje/effects/common.c @@ -739,7 +739,7 @@ uint8_t bl_pix_colordodge_Y(uint8_t y1, uint8_t y2) uint8_t bl_pix_mulsub_Y(uint8_t y1, uint8_t y2) { - uint8_t a, b, new_Y; + uint8_t a, b; a = y1; b = (0xff - y2); if( a < 16 ) @@ -751,15 +751,9 @@ uint8_t bl_pix_mulsub_Y(uint8_t y1, uint8_t y2) uint8_t bl_pix_lighten_Y(uint8_t y1, uint8_t y2) { - uint8_t a, b, new_Y; - a = y1; - b = y2; - if (a > b) { - new_Y = a; - } else { - new_Y = b; - } - return new_Y; + if (y1 > y2) + return y1; + return y2; } uint8_t bl_pix_difference_Y(uint8_t y1, uint8_t y2) diff --git a/veejay-current/libvje/effects/complexinvert.c b/veejay-current/libvje/effects/complexinvert.c index 547dce3a..2c0e92f3 100644 --- a/veejay-current/libvje/effects/complexinvert.c +++ b/veejay-current/libvje/effects/complexinvert.c @@ -81,9 +81,6 @@ void complexinvert_apply(VJFrame *frame, int width, uint8_t *Y = frame->data[0]; uint8_t *Cb= frame->data[1]; uint8_t *Cr= frame->data[2]; - uint8_t *Y2 = frame->data[0]; - uint8_t *Cb2= frame->data[1]; - uint8_t *Cr2= frame->data[2]; int iy=pixel_Y_lo_,iu=128,iv=128; _rgb2yuv( r,g,b, iy,iu,iv ); _y = (float) iy; diff --git a/veejay-current/libvje/effects/complexsaturate.c b/veejay-current/libvje/effects/complexsaturate.c index 6eca71a6..8fab4066 100644 --- a/veejay-current/libvje/effects/complexsaturate.c +++ b/veejay-current/libvje/effects/complexsaturate.c @@ -73,7 +73,6 @@ void complexsaturation_apply(VJFrame *frame, int width, int height, int i_angle, int r, int g, int b, int adjust_v, int adjust_degrees, int i_noise) { - double dsaturation,dcolor; // double degrees = adjust_degrees * 0.01; // double dsat = adjust_v * 0.01; @@ -95,9 +94,6 @@ void complexsaturation_apply(VJFrame *frame, int width, uint8_t *Y = frame->data[0]; uint8_t *Cb= frame->data[1]; uint8_t *Cr= frame->data[2]; - uint8_t *Y2 = frame->data[0]; - uint8_t *Cb2= frame->data[1]; - uint8_t *Cr2= frame->data[2]; int iy=pixel_Y_lo_,iu=128,iv=128; _rgb2yuv( r,g,b, iy,iu,iv ); _y = (float) iy; diff --git a/veejay-current/libvje/effects/complexsync.c b/veejay-current/libvje/effects/complexsync.c index 80b30b18..9ddbc0a6 100644 --- a/veejay-current/libvje/effects/complexsync.c +++ b/veejay-current/libvje/effects/complexsync.c @@ -67,7 +67,6 @@ void complexsync_apply(VJFrame *frame, VJFrame *frame2, int width, int height, i { const int len = frame->len; - const int uv_len = frame->uv_len; uint8_t *Y = frame->data[0]; uint8_t *Cb = frame->data[1]; uint8_t *Cr = frame->data[2]; diff --git a/veejay-current/libvje/effects/complexthreshold.c b/veejay-current/libvje/effects/complexthreshold.c index e243bfd0..54d5faf2 100644 --- a/veejay-current/libvje/effects/complexthreshold.c +++ b/veejay-current/libvje/effects/complexthreshold.c @@ -73,7 +73,7 @@ int accept_tpixel(uint8_t fg_cb, uint8_t fg_cr, int cb, int cr, short xx, yy; /* convert foreground to xz coordinates where x direction is defined by key color */ - uint8_t val; + int val; xx = ((fg_cb * cb) + (fg_cr * cr)) >> 7; @@ -124,7 +124,7 @@ void complexthreshold_apply(VJFrame *frame, VJFrame *frame2, int width, //float noise_level = 350.0; unsigned int pos; int matrix[5]; - uint8_t val, tmp1; + int val, tmp1; const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Cb = frame->data[1]; @@ -258,13 +258,13 @@ void complexthreshold_apply(VJFrame *frame, VJFrame *frame2, int width, kbg = 255; } - val = Y[pos] + (kbg * bg_y[pos]) >> 8; + val = (Y[pos] + (kbg * bg_y[pos])) >> 8; Y[pos] = CLAMP_Y(val); - val = Cb[pos] + (kbg * bg_cb[pos]) >> 8; + val = (Cb[pos] + (kbg * bg_cb[pos])) >> 8; Cb[pos] = CLAMP_UV(val); - val = Cr[pos] + (kbg * bg_cr[pos]) >> 8; + val = (Cr[pos] + (kbg * bg_cr[pos])) >> 8; Cr[pos] = CLAMP_UV(val); } } diff --git a/veejay-current/libvje/effects/enhancemask.c b/veejay-current/libvje/effects/enhancemask.c index 07eb4946..a6361ca5 100644 --- a/veejay-current/libvje/effects/enhancemask.c +++ b/veejay-current/libvje/effects/enhancemask.c @@ -72,7 +72,7 @@ void enhancemask_apply(VJFrame *frame, int width, int height, int *s ) { /* The sharpen comes from yuvdenoiser, we like grainy video so 512 is allowed. */ - register int d,e,m; + register int d,m; // unsigned int op0,op1; // op0 = (s[1] > 255) ? 255 : s[1]; // op1 = 255 - op1; diff --git a/veejay-current/libvje/effects/flare.c b/veejay-current/libvje/effects/flare.c index e2ea2e7d..7330412d 100644 --- a/veejay-current/libvje/effects/flare.c +++ b/veejay-current/libvje/effects/flare.c @@ -219,15 +219,9 @@ void flare_simple( VJFrame *frame, VJFrame *frame2, int w, int h, int op_a ) { unsigned int i; unsigned int len = w* h; - int uv_len = frame->uv_len; uint8_t *Y = frame->data[0]; - uint8_t *Cb= frame->data[1]; - uint8_t *Cr= frame->data[2]; uint8_t *Y2 = frame2->data[0]; - uint8_t *Cb2= frame2->data[1]; - uint8_t *Cr2= frame2->data[2]; - int a, b, c, d; const uint8_t solid = 255 - op_a; uint8_t premul; for (i = 0; i < len; i++) diff --git a/veejay-current/libvje/effects/goom.c b/veejay-current/libvje/effects/goom.c index 3dec84e8..c1e02b53 100644 --- a/veejay-current/libvje/effects/goom.c +++ b/veejay-current/libvje/effects/goom.c @@ -31,14 +31,17 @@ static int last_= 0; vj_effect *goomfx_init(int w, int h) { vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect)); - ve->num_params = 1; + ve->num_params = 2; ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */ ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */ ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */ ve->limits[0][0] = 0; - ve->limits[1][0] = 2500; - ve->defaults[0] = 25; + ve->limits[1][0] = 10; + ve->limits[0][1] = 100; + ve->limits[1][1] = 5000; + ve->defaults[0] = 2; + ve->defaults[1] = 2500; ve->description = "Goom"; ve->sub_format = 0; ve->extra_frame = 0; @@ -64,20 +67,13 @@ void goomfx_free() goom_ = NULL; } -void goomfx_apply( VJFrame *frame, int width, int height, int val) +void goomfx_apply( VJFrame *frame, int width, int height, int val, int val2) { unsigned int i; - int len = (width * height); - int uv_len = frame->uv_len; - uint8_t *Y = frame->data[0]; - uint8_t *Cb = frame->data[1]; - uint8_t *Cr = frame->data[2]; - - float fps = (float) val; - int chunks = frame->len / 1024; int16_t data[2][1024]; + float fps = (float)val2 * 0.01f; int j; if( last_ >= chunks ) @@ -92,8 +88,8 @@ void goomfx_apply( VJFrame *frame, int width, int height, int val) goom_update( goom_, data, - 0, - -1, + val, + fps, NULL, NULL ); diff --git a/veejay-current/libvje/effects/goom.h b/veejay-current/libvje/effects/goom.h index 7645ea28..4b49b52e 100644 --- a/veejay-current/libvje/effects/goom.h +++ b/veejay-current/libvje/effects/goom.h @@ -25,7 +25,7 @@ #include vj_effect *goomfx_init(int w, int h); -void goomfx_apply( VJFrame *frame, int width, int height, int val); +void goomfx_apply( VJFrame *frame, int width, int height, int val, int val2); int goomfx_malloc(int w, int h); void goomfx_free(); #endif diff --git a/veejay-current/libvje/effects/magicmirror.c b/veejay-current/libvje/effects/magicmirror.c index 323275ee..7be55d60 100644 --- a/veejay-current/libvje/effects/magicmirror.c +++ b/veejay-current/libvje/effects/magicmirror.c @@ -63,7 +63,6 @@ vj_effect *magicmirror_init(int w, int h) int magicmirror_malloc(int w, int h) { - unsigned int i; magicmirrorbuf[0] = (uint8_t*)vj_malloc(sizeof(uint8_t) * w * h * 3); if(!magicmirrorbuf[0]) return 0; magicmirrorbuf[1] = magicmirrorbuf[0] + (w*h); diff --git a/veejay-current/libvje/effects/magicscratcher.c b/veejay-current/libvje/effects/magicscratcher.c index 36d9c5c1..3c82d632 100644 --- a/veejay-current/libvje/effects/magicscratcher.c +++ b/veejay-current/libvje/effects/magicscratcher.c @@ -101,7 +101,6 @@ void magicscratcher_apply(VJFrame *frame, uint8_t *Cr= frame->data[2]; int uv_width = frame->uv_width; int uv_height = frame->uv_height; - const int uv_len = frame->uv_len; /* param 6 is cool ,8,7,10,13,15, ,9,11,12,14, 16 voor default ?, 17 (!),18,19, 20(!), 21, 24,,25,30 */ diff --git a/veejay-current/libvje/effects/mirrors.c b/veejay-current/libvje/effects/mirrors.c index de0062ca..66cf20a4 100644 --- a/veejay-current/libvje/effects/mirrors.c +++ b/veejay-current/libvje/effects/mirrors.c @@ -86,7 +86,6 @@ void _mirrors_v( uint8_t *yuv[3], int width, int height, int factor, int swap) } void _mirrors_h( uint8_t *yuv[3], int width, int height, int factor, int swap) { - unsigned int len = width * height; unsigned int line_height = height / ( factor + 1); unsigned int nr = height / line_height; diff --git a/veejay-current/libvje/effects/morphology.c b/veejay-current/libvje/effects/morphology.c index 99e87c84..55bb0b0c 100644 --- a/veejay-current/libvje/effects/morphology.c +++ b/veejay-current/libvje/effects/morphology.c @@ -89,8 +89,7 @@ morph_func _morphology_function(int i) { if( i == 0 ) return _dilate_kernel3x3; - if( i == 1 ) - return _erode_kernel3x3; + return _erode_kernel3x3; } @@ -104,7 +103,7 @@ void morphology_apply( VJFrame *frame, int width, int height, int threshold, int uint8_t *Y = frame->data[0]; uint8_t *Cb = frame->data[1]; uint8_t *Cr = frame->data[2]; - uint8_t kernels[4][9] ={ + uint8_t kernels[8][9] ={ { 1,1,1, 1,1,1 ,1,1,1 },//0 { 0,1,0, 1,1,1, 0,1,0 },//1 { 0,0,0, 1,1,1, 0,0,0 },//2 diff --git a/veejay-current/libvje/effects/noisepencil.c b/veejay-current/libvje/effects/noisepencil.c index c5546169..caa45f68 100644 --- a/veejay-current/libvje/effects/noisepencil.c +++ b/veejay-current/libvje/effects/noisepencil.c @@ -111,8 +111,6 @@ void noisepencil_2_apply(uint8_t *src[3], int width, int height, int coeef , int int r, c; double k = (coeef/1000.0); - uint8_t d; - uint8_t b; int len = (width*height)-width; uint8_t tmp; diff --git a/veejay-current/libvje/effects/smear.c b/veejay-current/libvje/effects/smear.c index 941f6e99..580bc4a5 100644 --- a/veejay-current/libvje/effects/smear.c +++ b/veejay-current/libvje/effects/smear.c @@ -101,9 +101,9 @@ static void _smear_apply_y_avg(VJFrame *frame, int width, int height, int val) { if(j >= height) j = height-1; i = j * width + x; - Y[y*width+x] = Y[i]+Y[y*width+x]>>1; - Cb[y*width+x] = ((Cb[i]-128)+(Cb[y*width+x]-128)>>1)+128; - Cr[y*width+x] = ((Cr[i]-128)+(Cr[y*width+x]-128)>>1)+128; + Y[y*width+x] = (Y[i]+Y[y*width+x])>>1; + Cb[y*width+x] = (((Cb[i]-128)+(Cb[y*width+x]-128))>>1)+128; + Cr[y*width+x] = (((Cr[i]-128)+(Cr[y*width+x]-128))>>1)+128; } } } diff --git a/veejay-current/libvje/effects/split.c b/veejay-current/libvje/effects/split.c index 9ca90a1b..08fafeec 100644 --- a/veejay-current/libvje/effects/split.c +++ b/veejay-current/libvje/effects/split.c @@ -349,7 +349,6 @@ void split_corner_framedata_ul(VJFrame *frame, VJFrame *frame2, unsigned int h_len = height / 2; unsigned int x, y; unsigned int y1; - const int uv_height = frame->uv_height; const int uv_width = frame->uv_width; const int uv_wlen = frame->uv_width / 2; const int uv_hlen = frame->uv_height / 2; @@ -383,9 +382,7 @@ void split_corner_framedata_ur(VJFrame *frame, VJFrame *frame2, unsigned int h_len = height / 2; unsigned int x, y; unsigned int y1; - const int uv_height = frame->uv_height; const int uv_width = frame->uv_width; - const int uv_len = uv_height * uv_width; const int uv_wlen = frame->uv_width / 2; const int uv_hlen = frame->uv_height / 2; uint8_t *Y = frame->data[0]; diff --git a/veejay-current/libvje/effects/zoom.c b/veejay-current/libvje/effects/zoom.c index 1290c4bb..0dd33e34 100644 --- a/veejay-current/libvje/effects/zoom.c +++ b/veejay-current/libvje/effects/zoom.c @@ -24,7 +24,7 @@ #include #include -static uint8_t *zoom_buffer[3]; +//static uint8_t *zoom_buffer[3]; vj_effect *zoom_init(int width , int height) { diff --git a/veejay-current/libvje/vj-effman.c b/veejay-current/libvje/vj-effman.c index 8fa1833d..84c71e96 100644 --- a/veejay-current/libvje/vj-effman.c +++ b/veejay-current/libvje/vj-effman.c @@ -317,7 +317,7 @@ void vj_effman_apply_image_effect( bathroom_apply(frames[0],frameinfo->width,frameinfo->height,arg[0],arg[1]); break; case VJ_IMAGE_EFFECT_GOOM: - goomfx_apply( frames[0], frameinfo->width,frameinfo->height,arg[0]); + goomfx_apply( frames[0], frameinfo->width,frameinfo->height,arg[0],arg[1]); break; case VJ_IMAGE_EFFECT_ZOOM: zoom_apply(frames[0], frameinfo->width, frameinfo->height,arg[0],arg[1],arg[2]); diff --git a/veejay-current/share/gveejay.reloaded.glade b/veejay-current/share/gveejay.reloaded.glade index a5c1e453..cca201c3 100644 --- a/veejay-current/share/gveejay.reloaded.glade +++ b/veejay-current/share/gveejay.reloaded.glade @@ -7718,99 +7718,20 @@ Quicktime-MJPEG 0 - - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - False - 0 - - - - True - 1 -2 -3 -4 -5 - False - True - True - - - - 0 - False - True - - - - - - - - - - True - <b>Select SRT Sequence</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - False - True - - - - - + True False 0 - + True 0 0.5 GTK_SHADOW_ETCHED_IN - + True 0.5 0.5 @@ -7822,56 +7743,29 @@ Quicktime-MJPEG 0 - + True False 0 - + True False 0 - - 50 + True - Start - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - 75 - True - True - 1 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 1 0 100 1 10 10 - + 1 +2 +3 +4 +5 + False + True + True + 0 @@ -7879,460 +7773,6 @@ Quicktime-MJPEG True - - - - True - 00:00:00:00 - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - True - False - - - - - 4 - False - True - - - - - - True - False - 0 - - - - 50 - True - End - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - 75 - True - True - 1 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 1 0 100 1 10 10 - - - - 0 - False - True - - - - - - True - 00:00:00:00 - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - True - False - - - - - 4 - False - False - - - - - - - - - - True - <b>Timeline</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - True - True - - - - - 0 - False - True - - - - - - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - 3 - 6 - False - 0 - 0 - - - - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - False - 0 - - - - True - Veejay Font - False - True - True - - - - 0 - False - True - - - - - - - - - - True - <b></b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - 6 - 0 - 1 - fill - - - - - - True - False - 0 - - - - True - False - 0 - - - - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - False - 0 - - - - True - False - 0 - - - - True - <b>X</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - 1 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 1 0 1000 1 10 10 - - - - 0 - True - True - - - - - 0 - True - True - - - - - - True - False - 0 - - - - True - <b>Y</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - 1 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 1 0 1000 1 10 10 - - - - 0 - True - True - - - - - 0 - True - True - - - - - - - - - - True - <b>Position</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - True - True - - - - - - 0 @@ -8342,14 +7782,277 @@ Quicktime-MJPEG - + + True + False + 0 + + + + True + New SRT Sequence + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_new.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Delete this SRT Sequence + True + GTK_RELIEF_NORMAL + True + + + + + True + button_skull.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + Apply Text and Start/End position + True + GTK_RELIEF_NORMAL + True + + + + + True + icon_apply.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + Load SRT file + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_open.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 4 + False + False + + + + + + True + Save SRT file + True + GTK_RELIEF_NORMAL + True + + + + + True + icon_save.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + 0 + True + True + + + + + + + + + 0 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + False + 0 + + + True 0 0.5 - GTK_SHADOW_NONE + GTK_SHADOW_ETCHED_IN - + True 0.5 0.5 @@ -8361,20 +8064,252 @@ Quicktime-MJPEG 0 - + True False 0 - + True - 0 - 0 - GTK_SHADOW_IN + False + 0 - + + 50 + True + Start + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + 75 + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 0 100 1 10 10 + + + + 0 + False + True + + + + + + True + 00:00:00:00 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + False + + + + + 4 + False + True + + + + + + True + False + 0 + + + + 50 + True + End + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + 75 + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 0 100 1 10 10 + + + + 0 + False + True + + + + + + True + 00:00:00:00 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + False + + + + + 4 + False + False + + + + + + + + + + True + <b>Timeline</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + 3 + 6 + False + 0 + 0 + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + True 0.5 0.5 @@ -8382,170 +8317,28 @@ Quicktime-MJPEG 1 0 0 - 0 + 12 0 - + True - 3 - 2 False - 0 - 0 + 0 - + True - Foreground color - True - FG - True - GTK_RELIEF_NORMAL + Veejay Font + False + True True - True - False - True - + - 0 - 1 - 0 - 1 - fill - - - - - - - True - Background color - True - BG - True - GTK_RELIEF_NORMAL - True - False - False - True - textcolorfg - - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - Line color - True - LC - True - GTK_RELIEF_NORMAL - True - False - False - True - textcolorfg - - - - 0 - 1 - 2 - 3 - fill - - - - - - - True - Set this foreground color - True - GTK_RELIEF_NORMAL - True - - - - - 24 - 24 - True - - - - - 1 - 2 - 0 - 1 - fill - - - - - - - True - Set this background color - True - GTK_RELIEF_NORMAL - True - - - - - 24 - 24 - True - - - - - 1 - 2 - 1 - 2 - fill - - - - - - - True - Set this line color - True - GTK_RELIEF_NORMAL - True - - - - - 24 - 24 - True - - - - - 1 - 2 - 2 - 3 - fill - + 0 + False + True @@ -8554,7 +8347,7 @@ Quicktime-MJPEG - + True <b></b> False @@ -8577,391 +8370,947 @@ Quicktime-MJPEG - 2 - False - True + 0 + 6 + 0 + 1 + fill - + True False 0 - + True - 0 - 0.5 - GTK_SHADOW_IN + False + 0 - + True - 0.5 - 0.5 - 1 - 1 - 31 - 0 - 0 - 0 + 0 + 0.5 + GTK_SHADOW_ETCHED_IN - + True - False - 0 + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 - + True - True - Border - True - GTK_RELIEF_NORMAL - True - False - False - True - - - - 0 - False - False - - + False + 0 - - - True - True - Outline - True - GTK_RELIEF_NORMAL - True - False - False - True - + + + True + False + 0 + + + + True + <b>X</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 0 1000 1 10 10 + + + + 0 + True + True + + + + + 0 + True + True + + + + + + True + False + 0 + + + + True + <b>Y</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 0 1000 1 10 10 + + + + 0 + True + True + + + + + 0 + True + True + + - - 0 - False - False - + + + + True + <b>Position</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + 0 + True + True + + + + + - 2 - False + 0 + True True - + True 0 - 0 - GTK_SHADOW_IN + 0.5 + GTK_SHADOW_NONE - + True 0.5 0.5 1 1 - 17 + 0 0 - 4 - 4 + 12 + 0 - + True - 4 - 5 False - 0 - 0 + 0 - - 24 - 24 + True + 0 + 0 + GTK_SHADOW_IN + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 0 + 0 + + + + True + 3 + 2 + False + 0 + 0 + + + + True + Foreground color + True + FG + True + GTK_RELIEF_NORMAL + True + True + False + True + + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + Background color + True + BG + True + GTK_RELIEF_NORMAL + True + False + False + True + textcolorfg + + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + Line color + True + LC + True + GTK_RELIEF_NORMAL + True + False + False + True + textcolorfg + + + + 0 + 1 + 2 + 3 + fill + + + + + + + True + Set this foreground color + True + GTK_RELIEF_NORMAL + True + + + + + 24 + 24 + True + + + + + 1 + 2 + 0 + 1 + fill + + + + + + + True + Set this background color + True + GTK_RELIEF_NORMAL + True + + + + + 24 + 24 + True + + + + + 1 + 2 + 1 + 2 + fill + + + + + + + True + Set this line color + True + GTK_RELIEF_NORMAL + True + + + + + 24 + 24 + True + + + + + 1 + 2 + 2 + 3 + fill + + + + + + + + + + + True + <b></b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + - 1 - 2 - 0 - 1 - fill + 2 + False + True - - 24 - 24 + True - - - 1 - 2 - 1 - 2 - fill - fill - - + False + 0 - - - 24 - 24 - True - - - 1 - 2 - 2 - 3 - fill - fill - - + + + True + 0 + 0.5 + GTK_SHADOW_IN - - - 100 - True - True - True - GTK_POS_RIGHT - 0 - GTK_UPDATE_CONTINUOUS - False - 255 0 255 1 10 0 - - - - 2 - 5 - 0 - 1 - fill - - + + + True + 0.5 + 0.5 + 1 + 1 + 31 + 0 + 0 + 0 - - - 100 - True - True - True - GTK_POS_RIGHT - 0 - GTK_UPDATE_CONTINUOUS - False - 255 0 255 1 10 0 - - - - 2 - 5 - 1 - 2 - fill - fill - - + + + True + False + 0 - - - 100 - True - True - True - GTK_POS_RIGHT - 0 - GTK_UPDATE_CONTINUOUS - False - 255 0 255 1 10 0 - - - - 2 - 5 - 2 - 3 - fill - fill - - + + + True + True + Border + True + GTK_RELIEF_NORMAL + True + False + False + True + + + + 0 + False + False + + - - - 100 - True - True - True - GTK_POS_RIGHT - 0 - GTK_UPDATE_CONTINUOUS - False - 0 0 255 1 10 0 - - - - 2 - 5 - 3 - 4 - fill - fill - - + + + True + True + Outline + True + GTK_RELIEF_NORMAL + True + False + False + True + + + + 0 + False + False + + + + + + + + + 2 + False + True + + - - - True - <b>R</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - 4 - fill - - - + + + True + 0 + 0 + GTK_SHADOW_IN - - - True - <b>G</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - 4 - fill - - - + + + True + 0.5 + 0.5 + 1 + 1 + 17 + 0 + 4 + 4 - - - True - <b>B</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 2 - 3 - 4 - fill - - - + + + True + 4 + 5 + False + 0 + 0 - - - True - <b>A</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 + + + 24 + 24 + True + + + 1 + 2 + 0 + 1 + fill + + + + + + 24 + 24 + True + + + 1 + 2 + 1 + 2 + fill + fill + + + + + + 24 + 24 + True + + + 1 + 2 + 2 + 3 + fill + fill + + + + + + 100 + True + True + True + GTK_POS_RIGHT + 0 + GTK_UPDATE_CONTINUOUS + False + 255 0 255 1 10 0 + + + + 2 + 5 + 0 + 1 + fill + + + + + + 100 + True + True + True + GTK_POS_RIGHT + 0 + GTK_UPDATE_CONTINUOUS + False + 255 0 255 1 10 0 + + + + 2 + 5 + 1 + 2 + fill + fill + + + + + + 100 + True + True + True + GTK_POS_RIGHT + 0 + GTK_UPDATE_CONTINUOUS + False + 255 0 255 1 10 0 + + + + 2 + 5 + 2 + 3 + fill + fill + + + + + + 100 + True + True + True + GTK_POS_RIGHT + 0 + GTK_UPDATE_CONTINUOUS + False + 0 0 255 1 10 0 + + + + 2 + 5 + 3 + 4 + fill + fill + + + + + + True + <b>R</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + 4 + fill + + + + + + + True + <b>G</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + 4 + fill + + + + + + + True + <b>B</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + 4 + fill + + + + + + + True + <b>A</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 3 + 4 + 4 + fill + + + + + + + + + + 2 + False + True + + - 0 - 1 - 3 - 4 - 4 - fill - + 0 + True + True + + + + True + <b>Color</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + - 2 - False + 0 + True True - 0 - True - True + 3 + 6 + 1 + 3 + fill + fill + + + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 100 1 10 10 + + + + + + + + + True + <b>Size</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 2 + 3 + 1 + 2 + 3 + fill + fill @@ -8970,9 +9319,91 @@ Quicktime-MJPEG - + True - <b>Color</b> + <b>Font</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + True + GTK_POLICY_ALWAYS + GTK_POLICY_ALWAYS + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + True + False + True + GTK_JUSTIFY_LEFT + GTK_WRAP_NONE + True + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + + + True + <b>Text</b> False True GTK_JUSTIFY_LEFT @@ -8999,461 +9430,20 @@ Quicktime-MJPEG - - 3 - 6 - 1 - 3 - fill - fill - - - - - - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - True - 1 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 0 0 100 1 10 10 - - - - - - - - - True - <b>Size</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 2 - 3 - 1 - 2 - 3 - fill - fill - - - - - - True - <b>Font</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - label_item - - - - - 2 - False - True - - - - - - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - False - 0 - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - False - 0 - - - - True - New SRT Sequence - True - GTK_RELIEF_NORMAL - True - - - - - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 - - - - True - False - 2 - - - - True - icon_new.png - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - - - - 0 - False - False - - - - - - True - Delete this SRT Sequence - True - GTK_RELIEF_NORMAL - True - - - - - True - button_skull.png - 0.5 - 0.5 - 0 - 0 - - - - - 0 - False - False - - - - - - True - Apply Text and Start/End position - True - GTK_RELIEF_NORMAL - True - - - - - True - icon_apply.png - 0.5 - 0.5 - 0 - 0 - - - - - 0 - False - False - - - - - - True - Load SRT file - True - GTK_RELIEF_NORMAL - True - - - - - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 - - - - True - False - 2 - - - - True - icon_open.png - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - - - - 4 - False - False - - - - - - True - Save SRT file - True - GTK_RELIEF_NORMAL - True - - - - - True - icon_save.png - 0.5 - 0.5 - 0 - 0 - - - - - 0 - False - False - - - - - - - 3 - True - True - - - - - - - 0 - False - False - - - - - - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - True - GTK_POLICY_ALWAYS - GTK_POLICY_ALWAYS - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - True - False - True - GTK_JUSTIFY_LEFT - GTK_WRAP_NONE - True - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - - - - - - True - <b>Text</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item + 0 + True + True 0 - True + False True diff --git a/veejay-current/veejay/liblavplayvj.c b/veejay-current/veejay/liblavplayvj.c index a29eedb9..8eb6531b 100644 --- a/veejay-current/veejay/liblavplayvj.c +++ b/veejay-current/veejay/liblavplayvj.c @@ -265,10 +265,6 @@ void veejay_change_state_save(veejay_t * info, int new_state) (video_playback_setup *) info->settings; settings->state = new_state; } -void veejay_set_sampling(veejay_t *info, subsample_mode_t m) -{ - video_playback_setup *settings = (video_playback_setup*) info->settings; -} int veejay_set_framedup(veejay_t *info, int n) { video_playback_setup *settings = (video_playback_setup*) settings; @@ -349,10 +345,6 @@ int veejay_set_speed(veejay_t * info, int speed) vj_jack_continue( settings->current_playback_speed ); #endif -/* if( settings->current_playback_speed != 0 && - settings->state != LAVPLAY_STATE_PLAYING) - veejay_change_state( info, LAVPLAY_STATE_PLAYING );*/ - return 1; } diff --git a/veejay-current/veejay/vj-event.c b/veejay-current/veejay/vj-event.c index f9ad49e9..484658d9 100644 --- a/veejay-current/veejay/vj-event.c +++ b/veejay-current/veejay/vj-event.c @@ -2127,13 +2127,6 @@ void vj_event_quit(void *ptr, const char format[], va_list ap) void vj_event_sample_mode(void *ptr, const char format[], va_list ap) { - veejay_t *v = (veejay_t *) ptr; - if(v->settings->sample_mode == SSM_420_JPEG_BOX) - veejay_set_sampling( v, SSM_420_JPEG_TR ); - else - veejay_set_sampling( v, SSM_420_JPEG_BOX ); - veejay_msg(VEEJAY_MSG_WARNING, "Sampling of 2x2 -> 1x1 is set to [%s]", - (v->settings->sample_mode == SSM_420_JPEG_BOX ? "lame box filter" : "triangle linear filter")); } void vj_event_bezerk(void *ptr, const char format[], va_list ap) @@ -8245,10 +8238,13 @@ void vj_event_add_subtitle( void *ptr, const char format[], va_list ap ) return; } - vj_font_new_text( v->font, text, args[1], args[2], args[0] ); + int id = vj_font_new_text( v->font, text, args[1], args[2], args[0] ); vj_font_set_position( v->font, args[3] ,args[4] ); - + + char newslot[50]; + sprintf(newslot, "%05d%05d", 5,id ); + SEND_MSG(v,newslot); } void vj_event_upd_subtitle( void *ptr, const char format[], va_list ap ) { diff --git a/veejay-current/veejay/vj-font.c b/veejay-current/veejay/vj-font.c index 3e2ca285..8aac85f8 100644 --- a/veejay-current/veejay/vj-font.c +++ b/veejay-current/veejay/vj-font.c @@ -704,7 +704,7 @@ char *vj_font_get_sequence( void *font, int seq ) return strdup(tmp); } -void vj_font_new_text( void *font, char *text, long lo,long hi, int seq) +int vj_font_new_text( void *font, char *text, long lo,long hi, int seq) { vj_font_t *ff = (vj_font_t*) font; @@ -725,6 +725,7 @@ void vj_font_new_text( void *font, char *text, long lo,long hi, int seq) font_unlock(ff); + return seq; } void vj_font_del_text( void *font, int seq ) { @@ -1207,7 +1208,15 @@ static int configure(vj_font_t *f, int size, int font) } if( f->face ) + { + for( c = 0; c < 256 ; c ++) + { + if( f->glyphs[c] ) + FT_Done_Glyph( f->glyphs[c] ); + } FT_Done_Face( f->face ); + } + if ( (error = FT_New_Face( f->library, f->font, 0, &(f->face) )) != 0) { veejay_msg(VEEJAY_MSG_ERROR,"Cannot load face: %s (error #%d)\n ", f->font, error); @@ -1310,14 +1319,16 @@ static int get_default_font( vj_font_t *f ) } default_fonts[] = { "Bitstream Vera Sans (Roman)", "Bitstream Vera Serif (Roman)", + "New (Regular)", + "New", NULL, }; int i,j; - for( i = 0; i < f->index; i ++ ) + for( i = 0; i < f->font_index; i ++ ) { for( j = 0; default_fonts[i].name != NULL ; j ++ ) { - if( strcasecmp( default_fonts[i].name, f->font_list ) == 0 ) + if( strcasecmp( default_fonts[i].name, f->font_list[i] ) == 0 ) return i; } } @@ -1386,7 +1397,6 @@ void *vj_font_init( int w, int h, float fps ) return NULL; } - f->current_font = -1; int df = get_default_font( f ); veejay_msg(0, "Loaded %d fonts, size = %d", f->font_index,f->current_size ); @@ -1789,7 +1799,7 @@ int vj_font_norender(void *ctx, long position) vj_font_t *f = (vj_font_t *) ctx; if( position < 0 || position >= f->index_len ) - return; + return 0; if(!f->dictionary || !f->index ) return 0; diff --git a/veejay-current/veejay/vj-font.h b/veejay-current/veejay/vj-font.h index 94a5cb78..ad1f3ddd 100644 --- a/veejay-current/veejay/vj-font.h +++ b/veejay-current/veejay/vj-font.h @@ -33,7 +33,7 @@ void *vj_font_get_plain_dict( void *font ); void vj_font_set_constraints_and_dict( void *font, long lo, long hi, float fps, void *dict ); void vj_font_dictionary_destroy(void *dict); int vj_font_clear_text( void *font ); -void vj_font_new_text( void *font, char *text, uint64_t s1,uint64_t s2, int seq); +int vj_font_new_text( void *font, char *text, uint64_t s1,uint64_t s2, int seq); void vj_font_del_text( void *font, int seq ); char **vj_font_get_all_fonts( void *font ); void vj_font_set_lncolor( void *font, int r, int g, int b, int a ); diff --git a/veejay-current/veejay/vj-perform.c b/veejay-current/veejay/vj-perform.c index 9246da85..bba2210b 100644 --- a/veejay-current/veejay/vj-perform.c +++ b/veejay-current/veejay/vj-perform.c @@ -2149,13 +2149,13 @@ int vj_perform_sample_complete_buffers(veejay_t * info, int entry, const int ski if(chain_fade) vj_perform_pre_chain( info, frames[0] ); - int is_444; for(chain_entry = 0; chain_entry < SAMPLE_MAX_EFFECTS; chain_entry++) { vj_perform_render_chain_entry( info, chain_entry, skip_incr,0); } *hint444 = frames[0]->ssm; + return 1; }