From: Good Guy Date: Sun, 25 Feb 2018 16:03:33 +0000 (-0700) Subject: wheels for crikey, xml tweak and edl fix for nesting X-Git-Url: https://git.cinelerra-gg.org/git/?a=commitdiff_plain;h=36bd2d2bbbe534bf04307149bf6162a70c088656;p=goodguy%2Fhistory.git wheels for crikey, xml tweak and edl fix for nesting --- diff --git a/cinelerra-5.1/cinelerra/edl.C b/cinelerra-5.1/cinelerra/edl.C index 13c03263..49d4cecf 100644 --- a/cinelerra-5.1/cinelerra/edl.C +++ b/cinelerra-5.1/cinelerra/edl.C @@ -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; icopy_nested_edl(0, tracks->total_length(), 1, diff --git a/cinelerra-5.1/cinelerra/filexml.C b/cinelerra-5.1/cinelerra/filexml.C index 1da5a5e0..aef297e4 100644 --- a/cinelerra-5.1/cinelerra/filexml.C +++ b/cinelerra-5.1/cinelerra/filexml.C @@ -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; diff --git a/cinelerra-5.1/plugins/crikey/crikey.C b/cinelerra-5.1/plugins/crikey/crikey.C index 92b74958..3ec93f7b 100644 --- a/cinelerra-5.1/plugins/crikey/crikey.C +++ b/cinelerra-5.1/plugins/crikey/crikey.C @@ -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; ix, 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); } } diff --git a/cinelerra-5.1/plugins/crikey/crikeywindow.C b/cinelerra-5.1/plugins/crikey/crikeywindow.C index ca8245a1..eaaa0b5c 100644 --- a/cinelerra-5.1/plugins/crikey/crikeywindow.C +++ b/cinelerra-5.1/plugins/crikey/crikeywindow.C @@ -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() diff --git a/cinelerra-5.1/plugins/crikey/crikeywindow.h b/cinelerra-5.1/plugins/crikey/crikeywindow.h index 22188eec..7338d2dd 100644 --- a/cinelerra-5.1/plugins/crikey/crikeywindow.h +++ b/cinelerra-5.1/plugins/crikey/crikeywindow.h @@ -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; };