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;
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;
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();
}
}
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();
// {
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