From: Good Guy Date: Wed, 7 Feb 2018 17:00:07 +0000 (-0700) Subject: file size 3dgts+sfx, timebar tweak, mask msg X-Git-Url: https://git.cinelerra-gg.org/git/?a=commitdiff_plain;h=3594cc12d62e8bf2c92e4e897aaf130645cbbc56;p=goodguy%2Fhistory.git file size 3dgts+sfx, timebar tweak, mask msg --- diff --git a/cinelerra-5.1/cinelerra/cwindowtool.C b/cinelerra-5.1/cinelerra/cwindowtool.C index 329b09ec..f3fda9a4 100644 --- a/cinelerra-5.1/cinelerra/cwindowtool.C +++ b/cinelerra-5.1/cinelerra/cwindowtool.C @@ -2050,11 +2050,8 @@ int CWindowDisableOpenGLMasking::handle_event() CWindowMaskGUI::CWindowMaskGUI(MWindow *mwindow, CWindowTool *thread) - : CWindowToolGUI(mwindow, - thread, - _(PROGRAM_NAME ": Mask"), - 330, - 310) + : CWindowToolGUI(mwindow, thread, + _(PROGRAM_NAME ": Mask"), 330, 320) { this->mwindow = mwindow; this->thread = thread; @@ -2122,6 +2119,8 @@ void CWindowMaskGUI::create_objects() y += title->get_h() + margin; add_subwindow(title = new BC_Title(x, y, _("Press Ctrl to move a control point"))); y += title->get_h() + margin; + add_subwindow(title = new BC_Title(x, y, _("Shift+click Delete to delete the mask"))); + y += title->get_h() + margin; add_subwindow(title = new BC_Title(x, y, _("Press Alt to translate the mask"))); y += 30; diff --git a/cinelerra-5.1/cinelerra/vwindow.C b/cinelerra-5.1/cinelerra/vwindow.C index 206292f3..243327cd 100644 --- a/cinelerra-5.1/cinelerra/vwindow.C +++ b/cinelerra-5.1/cinelerra/vwindow.C @@ -351,6 +351,7 @@ void VWindow::update_position(int change_type, double position = edl->local_session->get_selectionstart(1); if(lock_window) gui->lock_window("VWindow::update_position"); gui->clock->update(position); + gui->timebar->update(1); if(lock_window) gui->unlock_window(); } } diff --git a/cinelerra-5.1/cinelerra/vwindowgui.C b/cinelerra-5.1/cinelerra/vwindowgui.C index e5275cbc..db6312bc 100644 --- a/cinelerra-5.1/cinelerra/vwindowgui.C +++ b/cinelerra-5.1/cinelerra/vwindowgui.C @@ -348,8 +348,6 @@ int VWindowGUI::keypress_event() break; } if(!result) result = transport->keypress_event(); - if( result && !vwindow->playback_engine->is_playing_back ) - timebar->update(1); return result; } diff --git a/cinelerra-5.1/guicast/bcfilebox.C b/cinelerra-5.1/guicast/bcfilebox.C index 6c1ceb31..03a49e9a 100644 --- a/cinelerra-5.1/guicast/bcfilebox.C +++ b/cinelerra-5.1/guicast/bcfilebox.C @@ -794,6 +794,13 @@ int BC_FileBox::extract_extension(char *out, const char *in) return 0; } +static inline int64_t ipow(int m, int n) +{ + int64_t v = 1; + for( int64_t vv=m; n>0; vv*=vv,n>>=1 ) if( n & 1 ) v *= vv; + return v; +} + int BC_FileBox::create_tables() { delete_tables(); @@ -821,7 +828,27 @@ int BC_FileBox::create_tables() // { if(!is_dir) { - sprintf(string, "%jd", file_item->size); + int64_t size = file_item->size; +#if 1 + int len = 1; + static const char *suffix[] = { "", "K", "M", "G", "T", "P" }; + for( int64_t s=size; len<15 && (s/=10)>0; ++len ); + int drop = len-3; + if( drop > 0 ) { + size /= ipow(10,drop); + int sfx = (len-1)/3; + int digits = (sfx+1)*3 - len; + int64_t frac = ipow(10,digits); + int mantisa = size / frac; + int fraction = size - mantisa*frac; + if( fraction ) + sprintf(string, "%d.%0*d%s", mantisa, digits, fraction, suffix[sfx]); + else + sprintf(string, "%d%s", mantisa, suffix[sfx]); + } + else +#endif + sprintf(string, "%jd", size); new_item = new BC_ListBoxItem(string, get_resources()->file_color); } else