From: Good Guy Date: Sat, 14 Jul 2018 21:45:17 +0000 (-0600) Subject: bsd lang segv fix, enable bsd lv2, lv2 gui enable fix, proxy/ffmpeg toggle resize... X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=commitdiff_plain;h=502b6f3b6fd04f6b01c6d70dcb81aa304dd0db1c bsd lang segv fix, enable bsd lv2, lv2 gui enable fix, proxy/ffmpeg toggle resize fix, proxy format validation, reproxy vwindow asset fix, shortcuts docs --- diff --git a/cinelerra-5.1/blds/bsd.bld b/cinelerra-5.1/blds/bsd.bld index 6795b230..072a9ca7 100755 --- a/cinelerra-5.1/blds/bsd.bld +++ b/cinelerra-5.1/blds/bsd.bld @@ -6,10 +6,11 @@ export C_INCLUDE_PATH=/usr/local/include export CPLUS_INCLUDE_PATH=/usr/local/include export LIBRARY_PATH=/usr/local/lib alias make=gmake -./autogen.sh -CC=clang CXX=clang++ CFLAGS="-g -O2 -DFFMPEG3" ./configure --with-single-user \ - --disable-static-build --without-lv2 --disable-lame --disable-twolame \ +( ./autogen.sh + CC=clang CXX=clang++ CFLAGS="-g -O2 -DFFMPEG3" ./configure --with-single-user \ + --disable-static-build --with-lv2=auto --disable-lame --disable-twolame \ --with-oss --without-alsa --without-firewire --without-dv --without-dvb \ --without-video4linux2 --without-xxf86vm --without-ladspa-build \ --without-libzmpeg --without-commercial --without-thirdparty -gmake 2>&1 | tee log + gmake + gmake install ) 2>&1 | tee log diff --git a/cinelerra-5.1/blds/bsd.patch b/cinelerra-5.1/blds/bsd.patch index 31d18ba6..afc1e14f 100644 --- a/cinelerra-5.1/blds/bsd.patch +++ b/cinelerra-5.1/blds/bsd.patch @@ -176,10 +176,10 @@ index 1014baf5..f38094e9 100644 #define DVD_PAL_4x3 0 diff --git a/cinelerra-5.1/cinelerra/file.C b/cinelerra-5.1/cinelerra/file.C -index 03348e0a..552a140d 100644 +index 13e1b457..9cc2f116 100644 --- a/cinelerra-5.1/cinelerra/file.C +++ b/cinelerra-5.1/cinelerra/file.C -@@ -1584,7 +1584,10 @@ int File::record_fd() +@@ -1594,7 +1594,10 @@ int File::record_fd() void File::get_exe_path(char *result, char *bnp) { // Get executable path, basename @@ -205,10 +205,10 @@ index 3d21d2af..f3064199 100644 // check for isofs volume_id for dvd/cdrom diff --git a/cinelerra-5.1/configure.ac b/cinelerra-5.1/configure.ac -index 94f9b382..4c4bee11 100644 +index 1157b0a3..8c5ba61a 100644 --- a/cinelerra-5.1/configure.ac +++ b/cinelerra-5.1/configure.ac -@@ -16,15 +16,26 @@ CFG_CFLAGS+=" -Wno-unused-result" +@@ -16,8 +16,18 @@ CFG_CFLAGS+=" -Wno-unused-result" CFG_CFLAGS+=" -Wno-stringop-overflow" CFG_CFLAGS+=" -Wno-format-truncation" CFG_CFLAGS+=" -Wno-format-overflow" @@ -227,18 +227,7 @@ index 94f9b382..4c4bee11 100644 CFG_CFLAGS+=" -D__STDC_CONSTANT_MACROS" CFG_CFLAGS+=" -D__STDC_LIMIT_MACROS" CFG_CFLAGS+=" -DPNG_SKIP_SETJMP_CHECK=1" - CFG_CFLAGS+=" -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" --CFG_CFLAGS+=" -I/usr/include/freetype2" --CFG_CFLAGS+=" -I/usr/include/uuid" --CFG_CFLAGS+=" -I/usr/include/mjpegtools" -+CFG_CFLAGS+=" -I/usr/local/include" -+CFG_CFLAGS+=" -I/usr/local/include/freetype2 -I/usr/include/freetype2" -+CFG_CFLAGS+=" -I/usr/local/include/uuid -I/usr/include/uuid" -+CFG_CFLAGS+=" -I/usr/local/include/mjpegtools -I/usr/include/mjpegtools" - - AC_DEFUN([CHECK_WITH], [ - AC_ARG_WITH([$1], -@@ -126,7 +137,7 @@ AC_SUBST(MAK_INSTALLS) +@@ -127,7 +137,7 @@ AC_SUBST(MAK_INSTALLS) AC_SUBST(MAK_UNINSTALLS) if test "x$WANT_JOBS" = "xauto"; then @@ -290,7 +279,7 @@ index 40f5971f..73d47586 100644 float* get_values(); diff --git a/cinelerra-5.1/guicast/bcresources.C b/cinelerra-5.1/guicast/bcresources.C -index e3400600..f201028c 100644 +index 1e927303..165883de 100644 --- a/cinelerra-5.1/guicast/bcresources.C +++ b/cinelerra-5.1/guicast/bcresources.C @@ -38,6 +38,7 @@ @@ -340,169 +329,6 @@ index e3400600..f201028c 100644 shm_reply = 1; // Initialize -@@ -1681,6 +1671,87 @@ BC_FontEntry *BC_Resources::find_fontentry(const char *displayname, int style, - return style_match; - } - -+ -+class utf8conv { -+ uint8_t *obfr, *out, *oend; -+ uint8_t *ibfr, *inp, *iend; -+public: -+ utf8conv(void *out, int olen, void *inp, int ilen) { -+ this->obfr = this->out = (uint8_t*)out; -+ this->oend = this->out + olen; -+ this->ibfr = this->inp = (uint8_t*)inp; -+ this->iend = this->inp + ilen; -+ } -+ int cur() { return inp>=iend ? -1 : *inp; } -+ int next() { return inp>=iend ? -1 : *inp++; } -+ int next(int ch) { return out>=oend ? -1 : *out++ = ch; } -+ int ilen() { return inp-ibfr; } -+ int olen() { return out-obfr; } -+ int wnext(); -+ int wnext(unsigned int v); -+}; -+ -+int utf8conv:: -+wnext(unsigned int v) -+{ -+ if( v < 0x00000080 ) { next(v); return 1; } -+ int n = v < 0x00000800 ? 2 : v < 0x00010000 ? 3 : -+ v < 0x00200000 ? 4 : v < 0x04000000 ? 5 : 6; -+ int m = (0xff00 >> n), i = n-1; -+ next((v>>(6*i)) | m); -+ while( --i >= 0 ) next(((v>>(6*i)) & 0x3f) | 0x80); -+ return n; -+} -+ -+int utf8conv:: -+wnext() -+{ -+ int v = 0, n = 0, ch = next(); -+ if( ch == '\\' ) { -+ switch( (ch=next()) ) { -+ case 'n': return '\n'; -+ case 't': return '\t'; -+ case 'r': return '\r'; -+ case 'b': return '\b'; -+ case 'f': return '\f'; -+ case 'v': return '\v'; -+ case 'a': return '\a'; -+ case '0': case '1': case '2': case '3': -+ case '4': case '5': case '6': case '7': -+ v = ch - '0'; -+ for( int i=3; --i>0; v=v*8+ch, next() ) -+ if( (ch=cur()-'0') < 0 || ch >= 8 ) break; -+ return v; -+ case 'x': n = 2; break; -+ case 'u': n = 4; break; -+ case 'U': n = 8; break; -+ default: return ch; -+ } -+ for( int i=n; --i>=0; v=v*16+ch, next() ) { -+ if( (ch=cur()-'0')>=0 && ch<10 ) continue; -+ if( (ch-='A'-'0'-10)>=10 && ch<16 ) continue; -+ if( (ch-='a'-'A')<10 || ch>=16 ) break; -+ } -+ } -+ else if( ch >= 0x80 ) { -+ static const unsigned char byts[] = { -+ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 4, 5, -+ }; -+ int i = ch - 0xc0; -+ n = i<0 ? 0 : byts[i/4]; -+ for( v=ch, i=n; --i>=0; v+=next() ) v <<= 6; -+ static const unsigned int ofs[6] = { -+ 0x00000000U, 0x00003080U, 0x000E2080U, -+ 0x03C82080U, 0xFA082080U, 0x82082080U -+ }; -+ v -= ofs[n]; -+ } -+ else -+ v = ch; -+ return v; -+} -+ -+ - size_t BC_Resources::encode(const char *from_enc, const char *to_enc, - char *input, int input_length, char *output, int output_length) - { -@@ -1688,10 +1759,12 @@ size_t BC_Resources::encode(const char *from_enc, const char *to_enc, - iconv_t cd; - char *outbase = output; - -- if(!from_enc || *from_enc == 0) -+ if( !from_enc || *from_enc == 0 || -+ !strcmp(from_enc,"UTF8") || !strcmp(from_enc, "US-ASCII") ) - from_enc = "UTF-8"; - -- if(!to_enc || *to_enc == 0) -+ if( !to_enc || *to_enc == 0 || -+ !strcmp(to_enc,"UTF8") || !strcmp(to_enc, "US-ASCII") ) - to_enc = "UTF-8"; - - if(input_length < 0) -@@ -1701,32 +1774,45 @@ size_t BC_Resources::encode(const char *from_enc, const char *to_enc, - - if(strcmp(from_enc, to_enc) && inbytes) - { -- if((cd = iconv_open(to_enc, from_enc)) == (iconv_t)-1) -+ if( !strcmp(from_enc, "UTF-8") && !strcmp(to_enc,"UTF32LE") ) { -+ utf8conv uc(0,0, input,inbytes); -+ uint32_t *op = (uint32_t *)output; -+ uint32_t *ep = (uint32_t *)(output+output_length); -+ for( int wch; op=0; *op++=wch ); -+ output = (char *)op; -+ outbytes = (char*)ep - output; -+ } -+ else if( !strcmp(from_enc, "UTF32LE") && !strcmp(to_enc,"UTF-8") ) { -+ utf8conv uc(output,output_length, 0,0); -+ uint32_t *ip = (uint32_t *)input; -+ uint32_t *ep = (uint32_t *)(input+inbytes); -+ for( ; ip=0; ++ip ); -+ output += uc.olen(); -+ outbytes = output_length-uc.olen(); -+ } -+ else if((cd = iconv_open(to_enc, from_enc)) == (iconv_t)-1) - { - printf(_("Conversion from %s to %s is not available\n"), - from_enc, to_enc); - return 0; - } -- -- outbytes = output_length - 1; -- -- iconv(cd, &input, &inbytes, &output, &outbytes); -- -- iconv_close(cd); -- inbytes = output - outbase; -+ else { -+ outbytes = output_length - 1; -+ iconv(cd, &input, &inbytes, &output, &outbytes); -+ iconv_close(cd); -+ } - } - else if(inbytes) - { - memcpy(output, input, inbytes); -+ output += inbytes; - outbytes -= inbytes; - } -- for(int i = 0; i < 4; i++) -- { -+ if( outbytes > sizeof(uint32_t) ) -+ outbytes = sizeof(uint32_t); -+ for(int i = 0; i < outbytes; i++) - output[i] = 0; -- if(outbytes-- == 0) -- break; -- } -- return inbytes; -+ return output - outbase; - } - - void BC_Resources::encode_to_utf8(char *buffer, int buflen) diff --git a/cinelerra-5.1/guicast/bcsignals.C b/cinelerra-5.1/guicast/bcsignals.C index ed50cfb1..f1b894ba 100644 --- a/cinelerra-5.1/guicast/bcsignals.C diff --git a/cinelerra-5.1/cinelerra/mwindowedit.C b/cinelerra-5.1/cinelerra/mwindowedit.C index 53cb4c33..e2f55204 100644 --- a/cinelerra-5.1/cinelerra/mwindowedit.C +++ b/cinelerra-5.1/cinelerra/mwindowedit.C @@ -1881,6 +1881,7 @@ void MWindow::redo_entry(BC_WindowBase *calling_window_gui) update_plugin_guis(); gui->update(1, 2, 1, 1, 1, 1, 1); + gui->update_proxy_toggle(); gui->unlock_window(); cwindow->update(1, 1, 1, 1, 1); cwindow->gui->unlock_window(); @@ -2209,6 +2210,7 @@ void MWindow::undo_entry(BC_WindowBase *calling_window_gui) update_plugin_guis(); gui->update(1, 2, 1, 1, 1, 1, 1); + gui->update_proxy_toggle(); gui->unlock_window(); cwindow->update(1, 1, 1, 1, 1); cwindow->gui->unlock_window(); diff --git a/cinelerra-5.1/cinelerra/mwindowgui.C b/cinelerra-5.1/cinelerra/mwindowgui.C index f2789643..679a56e3 100644 --- a/cinelerra-5.1/cinelerra/mwindowgui.C +++ b/cinelerra-5.1/cinelerra/mwindowgui.C @@ -662,6 +662,27 @@ void MWindowGUI::update_patchbay() } } +void MWindowGUI::update_proxy_toggle() +{ + if( mwindow->edl->session->proxy_scale == 1 && + mwindow->edl->session->proxy_disabled_scale == 1 ) + proxy_toggle->hide_window(); + else + proxy_toggle->show_window(); +} + +void MWindowGUI::update_plugintoggles() +{ + for(int i = 0; i < TOTAL_PANES; i++) + { + if(pane[i]) + { + pane[i]->canvas->refresh_plugintoggles(); + } + } + +} + void MWindowGUI::draw_indexes(Indexable *indexable) { for(int i = 0; i < TOTAL_PANES; i++) @@ -711,11 +732,7 @@ void MWindowGUI::flash_canvas(int flush) int MWindowGUI::show_window(int flush) { int ret = BC_WindowBase::show_window(flush); - if( mwindow->edl->session->proxy_scale == 1 && - mwindow->edl->session->proxy_disabled_scale == 1 ) - proxy_toggle->hide_window(); - else - proxy_toggle->show_window(); + update_proxy_toggle(); return ret; } @@ -774,18 +791,6 @@ void MWindowGUI::set_playing_back(int value) } } -void MWindowGUI::update_plugintoggles() -{ - for(int i = 0; i < TOTAL_PANES; i++) - { - if(pane[i]) - { - pane[i]->canvas->refresh_plugintoggles(); - } - } - -} - void MWindowGUI::update_scrollbars(int flush) { for(int i = 0; i < TOTAL_PANES; i++) @@ -1402,14 +1407,6 @@ int MWindowGUI::menu_h() return mainmenu->get_h(); } -int MWindowGUI::mbuttons_w() -{ - int w = get_w(); - w -= mwindow->theme->ffmpeg_toggle[0]->get_w()+2; - w -= mwindow->theme->ffmpeg_toggle[0]->get_w()+2; - return w; -} - void MWindowGUI::start_x_pane_drag() { if(!x_pane_drag) diff --git a/cinelerra-5.1/cinelerra/mwindowgui.h b/cinelerra-5.1/cinelerra/mwindowgui.h index 5ca693e0..d4205162 100644 --- a/cinelerra-5.1/cinelerra/mwindowgui.h +++ b/cinelerra-5.1/cinelerra/mwindowgui.h @@ -124,6 +124,7 @@ public: void update_timebar(int flush_it); void update_timebar_highlights(); void update_patchbay(); + void update_proxy_toggle(); void update_plugintoggles(); void update_scrollbars(int flush); void draw_canvas(int mode, int hide_cursor); @@ -157,7 +158,6 @@ public: int save_defaults(BC_Hash *defaults); int menu_w(); int menu_h(); - int mbuttons_w(); // Draw on the status bar only. void show_message(const char *message, int color=-1); void update_default_message(); diff --git a/cinelerra-5.1/cinelerra/pluginlv2gui.C b/cinelerra-5.1/cinelerra/pluginlv2gui.C index ea5a1023..fd9a6f51 100644 --- a/cinelerra-5.1/cinelerra/pluginlv2gui.C +++ b/cinelerra-5.1/cinelerra/pluginlv2gui.C @@ -213,8 +213,7 @@ void PluginLV2ClientWindow::create_objects() int x = 10, y = 10, x1; add_subwindow(title = new BC_Title(x, y, client->title)); x1 = get_w() - BC_GenericButton::calculate_w(this, _("UI")) - 8; - add_subwindow(ui = new PluginLV2ClientUI(this, x1, y)); - ui->disable(); + add_subwindow(client_ui = new PluginLV2ClientUI(this, x1, y)); y += title->get_h() + 10; add_subwindow(varbl = new BC_Title(x, y, "")); add_subwindow(range = new BC_Title(x+160, y, "")); @@ -242,6 +241,7 @@ void PluginLV2ClientWindow::create_objects() show_window(1); if( client->server->mwindow->preferences->autostart_lv2ui ) { + client_ui->disable(); PluginLV2ParentUI *ui = get_ui(); ui->show(); } @@ -250,8 +250,8 @@ void PluginLV2ClientWindow::create_objects() int PluginLV2ClientWindow::resize_event(int w, int h) { int x1; - x1 = w - ui->get_w() - 8; - ui->reposition_window(x1, ui->get_y()); + x1 = w - client_ui->get_w() - 8; + client_ui->reposition_window(x1, client_ui->get_y()); x1 = w - reset->get_w() - 8; reset->reposition_window(x1, reset->get_y()); x1 = w - apply->get_w() - 8; @@ -358,7 +358,7 @@ void PluginLV2ClientWindow::lv2_set(int idx, float val) void PluginLV2ClientWindow::lv2_ui_enable() { lock_window("PluginLV2ClientWindow::lv2_update"); - ui->enable(); + client_ui->enable(); unlock_window(); } diff --git a/cinelerra-5.1/cinelerra/pluginlv2gui.h b/cinelerra-5.1/cinelerra/pluginlv2gui.h index c9f1aa67..0f93c7bb 100644 --- a/cinelerra-5.1/cinelerra/pluginlv2gui.h +++ b/cinelerra-5.1/cinelerra/pluginlv2gui.h @@ -96,7 +96,7 @@ public: PluginLV2ParentUI *get_ui(); PluginLV2Client *client; - PluginLV2ClientUI *ui; + PluginLV2ClientUI *client_ui; PluginLV2ClientReset *reset; PluginLV2ClientApply *apply; PluginLV2ClientPot *pot; diff --git a/cinelerra-5.1/cinelerra/proxy.C b/cinelerra-5.1/cinelerra/proxy.C index b534a10e..45feb595 100644 --- a/cinelerra-5.1/cinelerra/proxy.C +++ b/cinelerra-5.1/cinelerra/proxy.C @@ -161,6 +161,10 @@ void ProxyDialog::calculate_sizes() void ProxyDialog::handle_close_event(int result) { if( result ) return; + if( !File::renders_video(asset) ) { + eprintf("Specified format does not render video"); + return; + } mwindow->edl->session->proxy_use_scaler = use_scaler; mwindow->edl->session->proxy_auto_scale = auto_scale; mwindow->edl->session->proxy_beep = beep; @@ -260,13 +264,15 @@ Asset *ProxyRender::add_original(Indexable *idxbl, int new_scale) if( !proxy ) { proxy = new Asset(new_path); // new compression parameters - if( idxbl->get_video_frames() < 0 ) { + int64_t video_frames = idxbl->get_video_frames(); + if( video_frames < 0 ) { proxy->format = FILE_PNG; proxy->png_use_alpha = 1; proxy->video_length = -1; } else { proxy->copy_format(format_asset, 0); + proxy->video_length = video_frames; } proxy->awindow_folder = AW_PROXY_FOLDER; proxy->audio_data = 0; @@ -279,9 +285,7 @@ Asset *ProxyRender::add_original(Indexable *idxbl, int new_scale) if( proxy->height & 1 ) ++proxy->height; proxy->actual_height = proxy->height; proxy->frame_rate = idxbl->get_frame_rate(); - edl_assets->append(proxy); } - proxy->add_user(); orig_proxies.append(proxy); idxbl->add_user(); orig_idxbls.append(idxbl); @@ -658,6 +662,7 @@ void ProxyClient::process_package(LoadPackage *ptr) result = dst_file.open_file(preferences, proxy, 0, 1); if( result ) { proxy_render->failed = 1; + ::remove(proxy->path); return; } @@ -707,6 +712,8 @@ void ProxyClient::process_package(LoadPackage *ptr) mwindow->mainindexes->add_next_asset(0, asset); mwindow->mainindexes->start_build(); } + else + ::remove(proxy->path); } diff --git a/cinelerra-5.1/cinelerra/theme.C b/cinelerra-5.1/cinelerra/theme.C index b1deeb09..7bbcceb6 100644 --- a/cinelerra-5.1/cinelerra/theme.C +++ b/cinelerra-5.1/cinelerra/theme.C @@ -597,7 +597,7 @@ void Theme::get_mwindow_sizes(MWindowGUI *gui, int w, int h) { mbuttons_x = 0; mbuttons_y = gui->menu_h() + 1; - mbuttons_w = gui->mbuttons_w(); + mbuttons_w = w - (ffmpeg_toggle[0]->get_w()+2 + proxy_toggle[0]->get_w()+2); mbuttons_h = get_image("mbutton_bg")->get_h(); mclock_x = window_border - 5; mclock_y = mbuttons_y - 1 + mbuttons_h; diff --git a/cinelerra-5.1/configure.ac b/cinelerra-5.1/configure.ac index 94f9b382..1157b0a3 100644 --- a/cinelerra-5.1/configure.ac +++ b/cinelerra-5.1/configure.ac @@ -22,9 +22,10 @@ CFG_CFLAGS+=" -D__STDC_CONSTANT_MACROS" CFG_CFLAGS+=" -D__STDC_LIMIT_MACROS" CFG_CFLAGS+=" -DPNG_SKIP_SETJMP_CHECK=1" CFG_CFLAGS+=" -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" -CFG_CFLAGS+=" -I/usr/include/freetype2" -CFG_CFLAGS+=" -I/usr/include/uuid" -CFG_CFLAGS+=" -I/usr/include/mjpegtools" +CFG_CFLAGS+=" -I/usr/include -I/usr/local/include" +CFG_CFLAGS+=" -I/usr/include/freetype2 -I/usr/local/include/freetype2" +CFG_CFLAGS+=" -I/usr/include/uuid -I/usr/local/include/uuid" +CFG_CFLAGS+=" -I/usr/include/mjpegtools -I/usr/local/include/mjpegtools" AC_DEFUN([CHECK_WITH], [ AC_ARG_WITH([$1], @@ -556,7 +557,7 @@ CHECK_LIB([jbig], [jbig], [jbg_dec_init]) CHECK_LIB([vdpau], [vdpau], [vdp_device_create_x11]) #if test "x$HAVE_mjpegtools" = "xyes"; then -#CFG_CFLAGS+=" -I/usr/include/mjpegtools" +#CFG_CFLAGS+=" -I/usr/include/mjpegtools -I/usr/local/include/mjpegtools" #fi AC_DEFUN([CHECK_WANT], [ @@ -633,10 +634,10 @@ CHECK_WANT([LV2], [auto], [use lv2], [ CHECK_LIB([sord], [sord-0], [sord_world_new]) CHECK_LIB([serd], [serd-0], [serd_reader_new]) CHECK_LIB([sratom], [sratom-0], [sratom_new]) - CFLAGS="-I/usr/include/lilv-0" + CFLAGS="-I/usr/include/lilv-0 -I/usr/local/include/lilv-0" CHECK_HEADERS([lv2], [lilv headers], [lilv/lilv.h]) CHECK_LIB([suil], [suil-0], [suil_instance_new]) - CFLAGS="-I/usr/include/suil-0" + CFLAGS="-I/usr/include/suil-0 -I/usr/local/include/suil-0" CHECK_HEADERS([lv2], [suil headers], [suil/suil.h]) CFLAGS="$saved_CFLAGS"]) @@ -657,7 +658,7 @@ CHECK_WANT([OPENEXR], [auto], [use openexr], [ saved_CXXFLAGS="$CXXFLAGS" # ilmbase libs LIBS=" -lIlmImf -lIlmThread -lIex -lpthread" - CXXFLAGS="-I/usr/include/OpenEXR" + CXXFLAGS="-I/usr/include/OpenEXR -I/usr/local/include/OpenEXR" AC_LANG_PUSH(C++) AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include "ImfChannelList.h" @@ -678,7 +679,7 @@ EXROStream() : Imf::OStream("mypath") {} }; RESULT="$HAVE_OPENEXR" if test "x$RESULT" = "xyes"; then SHARED_openexr="$LIBS" - CFG_CFLAGS+=" -I/usr/include/OpenEXR" + CFG_CFLAGS+=" -I/usr/include/OpenEXR -I/usr/local/include/OpenEXR" fi LIBS="$saved_LIBS" CXXFLAGS="$saved_CXXFLAGS" @@ -792,7 +793,8 @@ PKG_PROVIDE([suil], [$WANT_LV2]) if test "x$WANT_LV2" = "xyes"; then if test "x$HAVE_lv2" = "xyes" -a "x$BUILD_lilv" = "x0"; then - CFG_CFLAGS+=' -I/usr/include/lilv-0 -I/usr/include/suil-0' + CFG_CFLAGS+=' -I/usr/include/lilv-0 -I/usr/local/include/lilv-0' + CFG_CFLAGS+=' -I/usr/include/suil-0 -I/usr/local/include/suil-0' fi fi @@ -859,7 +861,7 @@ if test "x$WANT_OPUS" = "xyes"; then FFMPEG_EXTRA_CFG+=' --enable-libopus' if test "x$HAVE_opus" = "xyes" -a "x$BUILD_opus" = "x0"; then EXTRA_LIBS+=' -lopus' - CFG_CFLAGS+=' -I/usr/include/opus' + CFG_CFLAGS+=' -I/usr/include/opus -I/usr/local/include/opus' fi fi @@ -1007,7 +1009,7 @@ if test "x$WANT_GIT_FFMPEG" != "xno"; then echo "ffmpeg.git := $WANT_GIT_FFMPEG" fi if test "x$WANT_OPUS" = "xyes" -a "x$BUILD_opus" = "x0"; then - echo 'ffmpeg.cflags+=" -I/usr/include/opus"' + echo 'ffmpeg.cflags+=" -I/usr/include/opus -I/usr/local/include/opus"' fi if test "x$X264_CFG_PARAMS" != "x" ; then echo "x264.cfg_params :=$X264_CFG_PARAMS --enable-static --enable-pic" diff --git a/cinelerra-5.1/doc/shortcuts.html b/cinelerra-5.1/doc/shortcuts.html index 59b56638..3e879c70 100644 --- a/cinelerra-5.1/doc/shortcuts.html +++ b/cinelerra-5.1/doc/shortcuts.html @@ -1158,6 +1158,12 @@ Shift-ctrl Move cursor to label left of cursor, expand selection + +
+ ← (left arrow) + Shift-alt + Move cursor to edit boundary left of cursor&expand +
→ (right arrow) @@ -1182,6 +1188,12 @@ Shift-ctrl Move cursor to label right of cursor, expand selection + +
+ → (right arrow) + Shift-alt + Move cursor to edit boundary right of cursor&expand +
,(comma) diff --git a/cinelerra-5.1/guicast/bcresources.C b/cinelerra-5.1/guicast/bcresources.C index e3400600..1e927303 100644 --- a/cinelerra-5.1/guicast/bcresources.C +++ b/cinelerra-5.1/guicast/bcresources.C @@ -1681,52 +1681,140 @@ BC_FontEntry *BC_Resources::find_fontentry(const char *displayname, int style, return style_match; } + +class utf8conv { + uint8_t *obfr, *out, *oend; + uint8_t *ibfr, *inp, *iend; +public: + utf8conv(void *out, int olen, void *inp, int ilen) { + this->obfr = this->out = (uint8_t*)out; + this->oend = this->out + olen; + this->ibfr = this->inp = (uint8_t*)inp; + this->iend = this->inp + ilen; + } + int cur() { return inp>=iend ? -1 : *inp; } + int next() { return inp>=iend ? -1 : *inp++; } + int next(int ch) { return out>=oend ? -1 : *out++ = ch; } + int ilen() { return inp-ibfr; } + int olen() { return out-obfr; } + int wnext(); + int wnext(unsigned int v); +}; + +int utf8conv:: +wnext(unsigned int v) +{ + if( v < 0x00000080 ) { next(v); return 1; } + int n = v < 0x00000800 ? 2 : v < 0x00010000 ? 3 : + v < 0x00200000 ? 4 : v < 0x04000000 ? 5 : 6; + int m = (0xff00 >> n), i = n-1; + next((v>>(6*i)) | m); + while( --i >= 0 ) next(((v>>(6*i)) & 0x3f) | 0x80); + return n; +} + +int utf8conv:: +wnext() +{ + int v = 0, n = 0, ch = next(); + if( ch == '\\' ) { + switch( (ch=next()) ) { + case 'n': return '\n'; + case 't': return '\t'; + case 'r': return '\r'; + case 'b': return '\b'; + case 'f': return '\f'; + case 'v': return '\v'; + case 'a': return '\a'; + case '0': case '1': case '2': case '3': + case '4': case '5': case '6': case '7': + v = ch - '0'; + for( int i=3; --i>0; v=v*8+ch, next() ) + if( (ch=cur()-'0') < 0 || ch >= 8 ) break; + return v; + case 'x': n = 2; break; + case 'u': n = 4; break; + case 'U': n = 8; break; + default: return ch; + } + for( int i=n; --i>=0; v=v*16+ch, next() ) { + if( (ch=cur()-'0')>=0 && ch<10 ) continue; + if( (ch-='A'-'0'-10)>=10 && ch<16 ) continue; + if( (ch-='a'-'A')<10 || ch>=16 ) break; + } + } + else if( ch >= 0x80 ) { + static const unsigned char byts[] = { + 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 4, 5, + }; + int i = ch - 0xc0; + n = i<0 ? 0 : byts[i/4]; + for( v=ch, i=n; --i>=0; v+=next() ) v <<= 6; + static const unsigned int ofs[6] = { + 0x00000000U, 0x00003080U, 0x000E2080U, + 0x03C82080U, 0xFA082080U, 0x82082080U + }; + v -= ofs[n]; + } + else + v = ch; + return v; +} + + size_t BC_Resources::encode(const char *from_enc, const char *to_enc, char *input, int input_length, char *output, int output_length) { - size_t inbytes, outbytes = 0; - iconv_t cd; - char *outbase = output; - - if(!from_enc || *from_enc == 0) + if( !from_enc || *from_enc == 0 || + !strcmp(from_enc,"UTF8") || !strcmp(from_enc, "US-ASCII") ) from_enc = "UTF-8"; - if(!to_enc || *to_enc == 0) + if( !to_enc || *to_enc == 0 || + !strcmp(to_enc,"UTF8") || !strcmp(to_enc, "US-ASCII") ) to_enc = "UTF-8"; - if(input_length < 0) - inbytes = strlen(input); - else - inbytes = input_length; - - if(strcmp(from_enc, to_enc) && inbytes) - { - if((cd = iconv_open(to_enc, from_enc)) == (iconv_t)-1) - { + iconv_t cd; + char *outbase = output; + size_t inbytes = input_length < 0 ? strlen(input) : input_length; + size_t outbytes = output_length; + + if( inbytes && outbytes ) { + if( !strcmp(from_enc, to_enc) ) { + if( inbytes > outbytes ) inbytes = outbytes; + memcpy(output, input, inbytes); + output += inbytes; + outbytes -= inbytes; + } + else if( !strcmp(from_enc, "UTF-8") && !strcmp(to_enc,"UTF32LE") ) { + utf8conv uc(0,0, input,inbytes); + uint32_t *op = (uint32_t *)output; + uint32_t *ep = (uint32_t *)(output+output_length); + for( int wch; op=0; *op++=wch ); + output = (char *)op; + outbytes = (char*)ep - output; + } + else if( !strcmp(from_enc, "UTF32LE") && !strcmp(to_enc,"UTF-8") ) { + utf8conv uc(output,output_length, 0,0); + uint32_t *ip = (uint32_t *)input; + uint32_t *ep = (uint32_t *)(input+inbytes); + for( ; ip=0; ++ip ); + output += uc.olen(); + outbytes -= uc.olen(); + } + else if( (cd = iconv_open(to_enc, from_enc)) != (iconv_t)-1 ) { + iconv(cd, &input, &inbytes, &output, &outbytes); + iconv_close(cd); + } + else { printf(_("Conversion from %s to %s is not available\n"), from_enc, to_enc); - return 0; } - - outbytes = output_length - 1; - - iconv(cd, &input, &inbytes, &output, &outbytes); - - iconv_close(cd); - inbytes = output - outbase; } - else if(inbytes) - { - memcpy(output, input, inbytes); - outbytes -= inbytes; - } - for(int i = 0; i < 4; i++) - { + if( outbytes > sizeof(uint32_t) ) + outbytes = sizeof(uint32_t); + for( uint32_t i = 0; i < outbytes; i++) output[i] = 0; - if(outbytes-- == 0) - break; - } - return inbytes; + return output - outbase; } void BC_Resources::encode_to_utf8(char *buffer, int buflen) diff --git a/cinelerra-5.1/plugins/theme_blond_cv/blondcvtheme.C b/cinelerra-5.1/plugins/theme_blond_cv/blondcvtheme.C index cf41fdff..0ee14d33 100644 --- a/cinelerra-5.1/plugins/theme_blond_cv/blondcvtheme.C +++ b/cinelerra-5.1/plugins/theme_blond_cv/blondcvtheme.C @@ -911,8 +911,8 @@ void BlondCVTheme::get_mwindow_sizes(MWindowGUI *gui, int w, int h) { mbuttons_x = 0; mbuttons_y = gui->mainmenu->get_h(); - mbuttons_w = w; - mbuttons_h = mbutton_left->get_h(); + mbuttons_w = w - (ffmpeg_toggle[0]->get_w()+2 + proxy_toggle[0]->get_w()+2); + mbuttons_h = get_image("mbutton_bg")->get_h(); mclock_x = 10; mclock_y = mbuttons_y + mbuttons_h + CWINDOW_METER_MARGIN; mclock_w = get_image("clock_bg")->get_w() - 40; diff --git a/cinelerra-5.1/plugins/theme_blue_dot/bluedottheme.C b/cinelerra-5.1/plugins/theme_blue_dot/bluedottheme.C index e53f8c9c..2915dc0b 100644 --- a/cinelerra-5.1/plugins/theme_blue_dot/bluedottheme.C +++ b/cinelerra-5.1/plugins/theme_blue_dot/bluedottheme.C @@ -952,7 +952,7 @@ void BlueDotTheme::get_mwindow_sizes(MWindowGUI *gui, int w, int h) // Position of menu buttons (start, stop, ff, etc.) mbuttons_x = 0; mbuttons_y = gui->mainmenu->get_h(); - mbuttons_w = w; + mbuttons_w = w - (ffmpeg_toggle[0]->get_w()+2 + proxy_toggle[0]->get_w()+2); mbuttons_h = get_image("mbutton_left")->get_h(); mclock_x = 20; //x position of digits in clock window mclock_y = mbuttons_y + 1 + mbuttons_h + CWINDOW_METER_MARGIN;