file size 3dgts+sfx, timebar tweak, mask msg
authorGood Guy <good1.2guy@gmail.com>
Wed, 7 Feb 2018 17:00:07 +0000 (10:00 -0700)
committerGood Guy <good1.2guy@gmail.com>
Wed, 7 Feb 2018 17:00:07 +0000 (10:00 -0700)
cinelerra-5.1/cinelerra/cwindowtool.C
cinelerra-5.1/cinelerra/vwindow.C
cinelerra-5.1/cinelerra/vwindowgui.C
cinelerra-5.1/guicast/bcfilebox.C

index 329b09ecc8bacacd120cf6ed7f965ebf5df5392a..f3fda9a4a85b47564b9de9c09028549fbaa611f0 100644 (file)
@@ -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;
 
index 206292f3cdc1e534c7f6ab7d1e74a65324d8f1f6..243327cde48690b60ae7ed283ee3e956c7a5d19f 100644 (file)
@@ -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();
        }
 }
index e5275cbc1c68900a90dc0a7bb51645d2842c5ada..db6312bcacba94ce3a2eb404de726eaa490feb38 100644 (file)
@@ -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;
 }
 
index 6c1ceb314b61d0a65aa3087919ae0c1ba826c544..03a49e9a9161c3968e3919d7660ce597c567d0d5 100644 (file)
@@ -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