From: Good Guy Date: Sun, 19 Mar 2017 21:25:48 +0000 (-0600) Subject: fixed font fix, cursor grab fix, xlat mods, vid opts X-Git-Url: https://git.cinelerra-gg.org/git/?a=commitdiff_plain;h=20dab381c3f5c0c0bd48cd7014ab67857eb80155;p=goodguy%2Fhistory.git fixed font fix, cursor grab fix, xlat mods, vid opts --- diff --git a/cinelerra-5.1/ffmpeg/video/16mmto264.mp4 b/cinelerra-5.1/ffmpeg/video/16mmto264.mp4 new file mode 100644 index 00000000..f67f7181 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/16mmto264.mp4 @@ -0,0 +1,22 @@ +mp4 libx264 +#From Edouard's script: +# x264 --tune grain --preset medium --level 4.1 --sar 1:1 --slices 4 --b-pyramid strict\ +# --aud --bframes 3 --keyint 24 --bitrate 25000 --vbv-maxrate 40000 --vbv-bufsize 30000\ +# --aq-mode 2 --colorprim undef --transfer bt709 --colormatrix bt709 -o outputfile pipefile.y4m & +bluray-compat=0 +id=0x1011 +level=41 +preset=medium +sar=1:1 +color_primaries=unspecified +colorspace=bt709 +color_trc=bt709 +cin_bitrate=25000000 +tune=grain +aq-mode=autovariance +slices=4 +b-pyramid=strict +bufsize=30000000 +maxrate=40000000 +refs=3 +x264opts cabac=1:keyint=24 diff --git a/cinelerra-5.1/ffmpeg/video/v308.qt b/cinelerra-5.1/ffmpeg/video/v308.qt new file mode 100644 index 00000000..b382c97d --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/v308.qt @@ -0,0 +1 @@ +mov v308 diff --git a/cinelerra-5.1/ffmpeg/video/v410.qt b/cinelerra-5.1/ffmpeg/video/v410.qt new file mode 100644 index 00000000..eb885c95 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/v410.qt @@ -0,0 +1 @@ +mov v410 diff --git a/cinelerra-5.1/guicast/bcwindowbase.C b/cinelerra-5.1/guicast/bcwindowbase.C index e4a0ef6b..b827113a 100644 --- a/cinelerra-5.1/guicast/bcwindowbase.C +++ b/cinelerra-5.1/guicast/bcwindowbase.C @@ -2009,7 +2009,7 @@ void BC_WindowBase::init_cursors() downleft_resize_cursor = XCreateFontCursor(display, XC_bottom_left_corner); downright_resize_cursor = XCreateFontCursor(display, XC_bottom_right_corner); hourglass_cursor = XCreateFontCursor(display, XC_watch); - + grabbed_cursor = create_grab_cursor(); static char cursor_data[] = { 0,0,0,0, 0,0,0,0 }; Colormap colormap = DefaultColormap(display, screen); @@ -2021,49 +2021,6 @@ void BC_WindowBase::init_cursors() pixmap_bottom, pixmap_bottom, &black, &black, 0, 0); // XDefineCursor(display, win, transparent_cursor); XFreePixmap(display, pixmap_bottom); - - int iw = 23, iw1 = iw-1, iw2 = iw/2; - int ih = 23, ih1 = ih-1, ih2 = ih/2; - VFrame grab(iw,ih,BC_RGB888); - grab.clear_frame(); - grab.set_pixel_color(RED); // fg - grab.draw_smooth(iw2,0, iw1,0, iw1,ih2); - grab.draw_smooth(iw1,ih2, iw1,ih1, iw2,ih1); - grab.draw_smooth(iw2,ih1, 0,ih1, 0,ih2); - grab.draw_smooth(0,ih2, 0,0, iw2,0); - grab.set_pixel_color(WHITE); // bg - grab.draw_line(0,ih2, iw2-2,ih2); - grab.draw_line(iw2+2,ih2, iw1,ih2); - grab.draw_line(iw2,0, iw2,ih2-2); - grab.draw_line(iw2,ih2+2, iw2,ih1); - - int bpl = (iw+7)/8, isz = bpl * ih; - char img[isz]; memset(img, 0, isz); - char msk[isz]; memset(msk, 0, isz); - unsigned char **rows = grab.get_rows(); - for( int iy=0; iy>3] |= (1<<(ix&7)); - if( !ip[1] ) op[ix>>3] |= (1<<(ix&7)); - } - } - unsigned long white_pix = WhitePixel(display, screen); - unsigned long black_pix = BlackPixel(display, screen); - Pixmap img_xpm = XCreatePixmapFromBitmapData(display, rootwin, - img, iw,ih, white_pix,black_pix, 1); - Pixmap msk_xpm = XCreatePixmapFromBitmapData(display, rootwin, - msk, iw,ih, white_pix,black_pix, 1); - - XColor fc, bc; - fc.flags = bc.flags = DoRed | DoGreen | DoBlue; - fc.red = 0xffff; fc.green = fc.blue = 0; // fg - bc.red = bc.green = bc.blue = 0x0000; // bg - grabbed_cursor = XCreatePixmapCursor(display, img_xpm,msk_xpm, &fc,&bc, iw2,ih2); - XFreePixmap(display, img_xpm); - XFreePixmap(display, msk_xpm); } int BC_WindowBase::evaluate_color_model(int client_byte_order, int server_byte_order, int depth) @@ -2215,6 +2172,53 @@ int BC_WindowBase::create_shared_colors() return 0; } +Cursor BC_WindowBase::create_grab_cursor() +{ + int iw = 23, iw1 = iw-1, iw2 = iw/2; + int ih = 23, ih1 = ih-1, ih2 = ih/2; + VFrame grab(iw,ih,BC_RGB888); + grab.clear_frame(); + grab.set_pixel_color(RED); // fg + grab.draw_smooth(iw2,0, iw1,0, iw1,ih2); + grab.draw_smooth(iw1,ih2, iw1,ih1, iw2,ih1); + grab.draw_smooth(iw2,ih1, 0,ih1, 0,ih2); + grab.draw_smooth(0,ih2, 0,0, iw2,0); + grab.set_pixel_color(WHITE); // bg + grab.draw_line(0,ih2, iw2-2,ih2); + grab.draw_line(iw2+2,ih2, iw1,ih2); + grab.draw_line(iw2,0, iw2,ih2-2); + grab.draw_line(iw2,ih2+2, iw2,ih1); + + int bpl = (iw+7)/8, isz = bpl * ih; + char img[isz]; memset(img, 0, isz); + char msk[isz]; memset(msk, 0, isz); + unsigned char **rows = grab.get_rows(); + for( int iy=0; iy>3] |= (1<<(ix&7)); + if( !ip[1] ) op[ix>>3] |= (1<<(ix&7)); + } + } + unsigned long white_pix = WhitePixel(display, screen); + unsigned long black_pix = BlackPixel(display, screen); + Pixmap img_xpm = XCreatePixmapFromBitmapData(display, rootwin, + img, iw,ih, white_pix,black_pix, 1); + Pixmap msk_xpm = XCreatePixmapFromBitmapData(display, rootwin, + msk, iw,ih, white_pix,black_pix, 1); + + XColor fc, bc; + fc.flags = bc.flags = DoRed | DoGreen | DoBlue; + fc.red = 0xffff; fc.green = fc.blue = 0; // fg + bc.red = bc.green = bc.blue = 0x0000; // bg + Cursor cursor = XCreatePixmapCursor(display, img_xpm,msk_xpm, &fc,&bc, iw2,ih2); + XFreePixmap(display, img_xpm); + XFreePixmap(display, msk_xpm); + return cursor; +} + int BC_WindowBase::allocate_color_table() { int red, green, blue, color; @@ -2610,21 +2614,22 @@ Cursor BC_WindowBase::get_cursor_struct(int cursor) { switch(cursor) { - case ARROW_CURSOR: return top_level->arrow_cursor; break; + case ARROW_CURSOR: return top_level->arrow_cursor; case CROSS_CURSOR: return top_level->cross_cursor; - case IBEAM_CURSOR: return top_level->ibeam_cursor; break; - case VSEPARATE_CURSOR: return top_level->vseparate_cursor; break; - case HSEPARATE_CURSOR: return top_level->hseparate_cursor; break; - case MOVE_CURSOR: return top_level->move_cursor; break; - case LEFT_CURSOR: return top_level->left_cursor; break; - case RIGHT_CURSOR: return top_level->right_cursor; break; - case UPRIGHT_ARROW_CURSOR: return top_level->upright_arrow_cursor; break; - case UPLEFT_RESIZE: return top_level->upleft_resize_cursor; break; - case UPRIGHT_RESIZE: return top_level->upright_resize_cursor; break; - case DOWNLEFT_RESIZE: return top_level->downleft_resize_cursor; break; - case DOWNRIGHT_RESIZE: return top_level->downright_resize_cursor; break; - case HOURGLASS_CURSOR: return top_level->hourglass_cursor; break; - case TRANSPARENT_CURSOR: return top_level->transparent_cursor; break; + case IBEAM_CURSOR: return top_level->ibeam_cursor; + case VSEPARATE_CURSOR: return top_level->vseparate_cursor; + case HSEPARATE_CURSOR: return top_level->hseparate_cursor; + case MOVE_CURSOR: return top_level->move_cursor; + case LEFT_CURSOR: return top_level->left_cursor; + case RIGHT_CURSOR: return top_level->right_cursor; + case UPRIGHT_ARROW_CURSOR: return top_level->upright_arrow_cursor; + case UPLEFT_RESIZE: return top_level->upleft_resize_cursor; + case UPRIGHT_RESIZE: return top_level->upright_resize_cursor; + case DOWNLEFT_RESIZE: return top_level->downleft_resize_cursor; + case DOWNRIGHT_RESIZE: return top_level->downright_resize_cursor; + case HOURGLASS_CURSOR: return top_level->hourglass_cursor; + case TRANSPARENT_CURSOR: return top_level->transparent_cursor; + case GRABBED_CURSOR: return top_level->grabbed_cursor; } return 0; } @@ -3356,7 +3361,7 @@ int BC_WindowBase::grab_buttons() XSync(top_level->display, False); if( XGrabButton(top_level->display, AnyButton, AnyModifier, top_level->rootwin, True, ButtonPressMask | ButtonReleaseMask, - GrabModeAsync, GrabModeSync, None, grabbed_cursor) == GrabSuccess ) { + GrabModeAsync, GrabModeSync, None, None) == GrabSuccess ) { set_active_subwindow(this); return 0; } @@ -3370,11 +3375,14 @@ void BC_WindowBase::ungrab_buttons() } void BC_WindowBase::grab_cursor() { - XDefineCursor(top_level->display, top_level->rootwin, grabbed_cursor); + Cursor cursor_grab = get_cursor_struct(GRABBED_CURSOR); + XGrabPointer(top_level->display, top_level->rootwin, True, + PointerMotionMask | ButtonPressMask | ButtonReleaseMask, + GrabModeAsync, GrabModeAsync, None, cursor_grab, CurrentTime); } void BC_WindowBase::ungrab_cursor() { - XUndefineCursor(top_level->display, top_level->rootwin); + XUngrabPointer(top_level->display, CurrentTime); } // for get_root_w/h diff --git a/cinelerra-5.1/guicast/bcwindowbase.h b/cinelerra-5.1/guicast/bcwindowbase.h index 891daf06..d06f062d 100644 --- a/cinelerra-5.1/guicast/bcwindowbase.h +++ b/cinelerra-5.1/guicast/bcwindowbase.h @@ -557,6 +557,7 @@ private: int create_private_colors(); int create_color(int color); int create_shared_colors(); + Cursor create_grab_cursor(); // Get width of a single line. Used by get_text_width int get_single_text_width(int font, const char *text, int length); int get_single_text_width(int font, const wchar_t *text, int length); diff --git a/cinelerra-5.1/guicast/cursors.h b/cinelerra-5.1/guicast/cursors.h index f15ff70a..f39d165a 100644 --- a/cinelerra-5.1/guicast/cursors.h +++ b/cinelerra-5.1/guicast/cursors.h @@ -38,5 +38,6 @@ #define CROSS_CURSOR 12 #define HOURGLASS_CURSOR 13 #define TRANSPARENT_CURSOR 14 +#define GRABBED_CURSOR 15 #endif diff --git a/cinelerra-5.1/plugins/titler/titler.C b/cinelerra-5.1/plugins/titler/titler.C index ad9e772f..aea73e5a 100644 --- a/cinelerra-5.1/plugins/titler/titler.C +++ b/cinelerra-5.1/plugins/titler/titler.C @@ -65,7 +65,7 @@ #include #include -#define FIXED_FONT "Bitstream Vera Sans Mono (Bits)" +#define FIXED_FONT "bitstream vera sans mono (bitstream)" #define SMALL (1.0 / 64.0) #define MAX_FLT 3.40282347e+38 diff --git a/cinelerra-5.1/po/xlat.C b/cinelerra-5.1/po/xlat.C index 2b59312e..1aa1881f 100644 --- a/cinelerra-5.1/po/xlat.C +++ b/cinelerra-5.1/po/xlat.C @@ -62,21 +62,21 @@ static bool is_opnr(int ch) return 0; } -// converts libreoffice csv to string (with quotes attached) +// converts libreoffice csv stuttered quoted string (with quotes attached) // quote marks only static void xlat1(uint8_t *&in, uint8_t *out) { uint8_t *ibp = in, *obp = out; - unsigned ch; + unsigned ch, lch = 0; if( (ch=wnext(in)) == '\"' ) { bool is_nested = in[0] == '\"' && in[1] == '\"'; while( (ch=wnext(in)) != 0 ) { - if( ch == '\"' ) { + if( ch == '\"' && lch != '\\' ) { uint8_t *bp = in; unsigned nch = wnext(in); if( nch != '\"' ) { in = bp; break; } } - wnext(out, ch); + wnext(out, lch = ch); } if( is_nested && ch == '"' ) { while( out > obp && *(out-1) == ' ' ) --out; @@ -108,14 +108,16 @@ static inline unsigned gch(uint8_t *&in) { // converts string (with opn/cls attached) to c string static void xlat2(uint8_t *in, uint8_t *out) { - unsigned lch = gch(in), rch = 1, ch = 0; + unsigned lch = gch(in), sep = 0, rch = 0, ch; if( lch ) { if( is_opnr(lch) ) { for( uint8_t *ip=in; (ch=gch(ip))!=0; rch=ch ); - if( lch == rch ) { lch = gch(in); rch = 0; } + if( lch == rch ) { sep = lch; lch = gch(in); } + } + while( (ch=gch(in)) != 0 ) { + wnext(out, lch); lch = ch; } - while( (ch=gch(in)) != 0 ) { wnext(out, lch); lch = ch; } - if( rch ) wnext(out, lch); + if( !sep ) wnext(out, lch); } *out = 0; } @@ -167,7 +169,7 @@ static void xlat4(const char *cp, uint8_t *out) case '\r': ch = 'r'; break; case '\t': ch = 't'; break; case '\v': ch = 'v'; break; - case '\"': wnext(out,ch); // fall thru + case '\"': break; default: wnext(out,ch); continue; } wnext(out,'\\'); @@ -366,6 +368,7 @@ static bool chkfmt(int no, uint8_t *ap, uint8_t *bp, uint8_t *cp) bch = bp >= bep ? 0 : wnext(bp); } if( !ach || !bch ) break; + if( !*ap && !*bp ) break; // if % on a and % on b and is fmt_spec if( is_per(ach) && is_per(bch) && (n=fmt_spec(ap)) > 0 ) { if( apr && apr != bpr ) wnext(cp,apr); @@ -493,8 +496,8 @@ void scan_po(FILE *ifp, FILE *ofp) if( it == trans.end() || it->first.compare(key) ) { fprintf(stderr, "no trans line %d: %s\n", no, ibfr); xlat3(key.c_str(), &tbfr[7]); - no += bputs(tbfr, ofp); - no += bputs((uint8_t*)"#msgstr \"\"", ofp); + //no += bputs(tbfr, ofp); + no += bputs((uint8_t*)"msgstr \"\"", ofp); } else if( 0 && !it->second.ok ) { fprintf(stderr, "bad fmt line %d: %s\n", no, ibfr);