wheels for crikey, xml tweak and edl fix for nesting
authorGood Guy <[email protected]>
Sun, 25 Feb 2018 16:03:33 +0000 (09:03 -0700)
committerGood Guy <[email protected]>
Sun, 25 Feb 2018 16:03:33 +0000 (09:03 -0700)
cinelerra-5.1/cinelerra/edl.C
cinelerra-5.1/cinelerra/filexml.C
cinelerra-5.1/plugins/crikey/crikey.C
cinelerra-5.1/plugins/crikey/crikeywindow.C
cinelerra-5.1/plugins/crikey/crikeywindow.h

index 13c032635ed577041b765879425189b91e8d2708..49d4cecfc72a14b6197c6eef62e887b8ad09ec9a 100644 (file)
@@ -538,7 +538,8 @@ int EDL::copy(double start, double end, int all,
                        file->append_newline();
                }
 
-               copy_assets(start, end, file, all, output_path);
+               if( !parent_edl )
+                       copy_assets(start, end, file, all, output_path);
 
                for( int i=0; i<nested_edls.size(); ++i )
                        nested_edls[i]->copy_nested_edl(0, tracks->total_length(), 1,
index 1da5a5e067359d0a8aae04af44f59ced9bed0a64..aef297e41adf822d9c697cda88a7cdb05130dbe0 100644 (file)
@@ -76,9 +76,10 @@ XMLBuffer::~XMLBuffer()
 unsigned char *&XMLBuffer::demand(long len)
 {
        if( len > bsz ) {
-               len += BCTEXTLEN;
+               long sz = inp-bfr;
+               len += sz/2 + BCTEXTLEN;
                unsigned char *np = new unsigned char[len];
-               if( inp > bfr ) memcpy(np,bfr,inp-bfr);
+               if( sz > 0 ) memcpy(np,bfr,sz);
                inp = np + (inp-bfr);
                outp = np + (outp-bfr);
                lmt = np + len;  bsz = len;
index 92b7495849e13de91f429d031aa10434291ecef3..3ec93f7bfe952c06025ec6e05bebdd94fff807d2 100644 (file)
@@ -116,14 +116,15 @@ void CriKeyConfig::interpolate(CriKeyConfig &prev, CriKeyConfig &next,
        int prev_sz = prev.points.size(), next_sz = next.points.size();
        for( int i=0; i<prev_sz; ++i ) {
                CriKeyPoint *pt = prev.points[i], *nt = 0;
-               float x = pt->x, y = pt->y;
+               float x = pt->x, y = pt->y, t = pt->t;
                int k = next_sz;  // associated by tag id in next
                while( --k >= 0 && pt->tag != (nt=next.points[k])->tag );
                if( k >= 0 ) {
                        x = x * prev_scale + nt->x * next_scale;
                        y = y * prev_scale + nt->y * next_scale;
+                       t = t * prev_scale + nt->t * next_scale;
                }
-               add_point(pt->tag, pt->e, x, y, pt->t);
+               add_point(pt->tag, pt->e, x, y, t);
        }
 }
 
index ca8245a1a55fa9d5de597b77729eef1878554e6c..eaaa0b5ca3c01c33269688d22ee172c289fc7ff8 100644 (file)
@@ -225,6 +225,8 @@ int CriKeyWindow::grab_event(XEvent *event)
        switch( event->type ) {
        case ButtonPress:
                if( dragging ) return check_configure_change(0);
+               if( event->xbutton.button == WHEEL_UP )  return threshold->wheel_event(1);
+               if( event->xbutton.button == WHEEL_DOWN ) return threshold->wheel_event(-1);
                dragging = event->xbutton.state & ShiftMask ? -1 : 1;
                break;
        case ButtonRelease:
@@ -490,6 +492,16 @@ CriKeyThreshold::CriKeyThreshold(CriKeyWindow *gui, int x, int y, int w)
 {
        this->gui = gui;
        set_precision(0.005);
+       set_pagination(0.01, 0.1);
+}
+
+int CriKeyThreshold::wheel_event(int v)
+{
+       if( v > 0 ) increase_value();
+       else if( v < 0 ) decrease_value();
+       handle_event();
+       enable();
+       return 1;
 }
 
 int CriKeyThreshold::handle_event()
index 22188eec1bdd1fb60afd7e9d846dc424f7a64ec2..7338d2dd03f8b1996777e43df0ddf2e155f4b44a 100644 (file)
@@ -94,6 +94,7 @@ class CriKeyThreshold : public BC_FSlider
 public:
        CriKeyThreshold(CriKeyWindow *gui, int x, int y, int w);
        int handle_event();
+       int wheel_event(int v);
        CriKeyWindow *gui;
 };