From 28225c37859a74d59211f584abd785860eef9c13 Mon Sep 17 00:00:00 2001 From: Good Guy Date: Fri, 24 Apr 2020 11:24:52 -0600 Subject: [PATCH] change precision on colorpicker hue, rework edl_shared class decls for older cplrs, fix keyframe tabbing --- cinelerra-5.1/cinelerra/colorpicker.C | 2 ++ cinelerra-5.1/cinelerra/edl.C | 21 ++++++++++----------- cinelerra-5.1/cinelerra/edl.h | 11 ++++++++++- cinelerra-5.1/cinelerra/pluginset.C | 17 +++++++++++++---- 4 files changed, 35 insertions(+), 16 deletions(-) diff --git a/cinelerra-5.1/cinelerra/colorpicker.C b/cinelerra-5.1/cinelerra/colorpicker.C index 7c0a38d0..d14b4c1f 100644 --- a/cinelerra-5.1/cinelerra/colorpicker.C +++ b/cinelerra-5.1/cinelerra/colorpicker.C @@ -252,6 +252,8 @@ void ColorGUI::create_objects() x += hue->get_w() + xs10; hsv_h = new PaletteHSV(this, x,y= y0, hsv.h, 0, 360); + hsv_h->set_increment(1); + hsv_h->set_precision(1); hsv_h->create_objects(); hsv_h->set_tooltip(_("Hue")); hsv_s = new PaletteHSV(this, x,y+=ys25, hsv.s, 0, 1); hsv_s->create_objects(); hsv_s->set_tooltip(_("Saturation")); diff --git a/cinelerra-5.1/cinelerra/edl.C b/cinelerra-5.1/cinelerra/edl.C index ca0d149c..6739dec8 100644 --- a/cinelerra-5.1/cinelerra/edl.C +++ b/cinelerra-5.1/cinelerra/edl.C @@ -2199,8 +2199,7 @@ void EDL::replace_assets(ArrayList &orig_idxbls, ArrayList & int EDL::collect_effects(EDL *&group) { // to remap shared plugins in copied plugin stack - class shared : public ArrayList { public: int trk; }; - class shared_list : public ArrayList {} shared_map; + edl_shared_list shared_map; int ret = 0; EDL *new_edl = new EDL(parent_edl ? parent_edl : this); new_edl->create_objects(); @@ -2214,7 +2213,7 @@ int EDL::collect_effects(EDL *&group) if( !edit ) continue; if( !track->record ) { ret = COLLECT_EFFECTS_RECORD; break; } Track *new_track = 0; - shared *location = 0; + edl_shared *location = 0; int64_t start_pos = edit->startproject; int64_t end_pos = start_pos + edit->length; int pluginsets = track->plugin_set.size(); @@ -2267,7 +2266,7 @@ int EDL::collect_effects(EDL *&group) int m = shared_map.size(), n = -1; while( --m>=0 && shared_map[m].trk!=trk ); if( m >= 0 ) { - shared &location = shared_map[m]; + edl_shared &location = shared_map[m]; n = location.size(); while( --n>=0 && location[n]!=set ); } @@ -2282,16 +2281,16 @@ int EDL::collect_effects(EDL *&group) return ret; } +void edl_SharedLocations::add(int trk, int plg) +{ + SharedLocation &s = append(); + s.module = trk; s.plugin = plg; +} + // inserts pluginsets in group to first selected edit in tracks int EDL::insert_effects(EDL *group, Track *first_track) { - class SharedLocations : public ArrayList { - public: - void add(int trk, int plg) { - SharedLocation &s = append(); - s.module = trk; s.plugin = plg; - } - } edl_locs, new_locs; + edl_SharedLocations edl_locs, new_locs; Track *new_track = group->tracks->first; if( !first_track ) first_track = tracks->first; Track *track = first_track; diff --git a/cinelerra-5.1/cinelerra/edl.h b/cinelerra-5.1/cinelerra/edl.h index b17b4f97..80aadb2c 100644 --- a/cinelerra-5.1/cinelerra/edl.h +++ b/cinelerra-5.1/cinelerra/edl.h @@ -25,6 +25,7 @@ #include #include +#include "arraylist.h" #include "asset.inc" #include "assets.inc" #include "autoconf.inc" @@ -47,7 +48,7 @@ #include "pluginserver.h" #include "preferences.inc" #include "recordlabel.inc" -#include "sharedlocation.inc" +#include "sharedlocation.h" #include "theme.inc" #include "tracks.inc" #include "vedit.inc" @@ -305,4 +306,12 @@ public: EDL *parent_edl; }; +// remap plugin shares in collect/paste effects +class edl_shared : public ArrayList { public: int trk; }; +class edl_shared_list : public ArrayList {}; +class edl_SharedLocations : public ArrayList { +public: + void add(int trk, int plg); +}; + #endif diff --git a/cinelerra-5.1/cinelerra/pluginset.C b/cinelerra-5.1/cinelerra/pluginset.C index 575f0465..b0c096e4 100644 --- a/cinelerra-5.1/cinelerra/pluginset.C +++ b/cinelerra-5.1/cinelerra/pluginset.C @@ -164,11 +164,20 @@ KeyFrame *PluginSet::nearest_keyframe(int64_t pos, int dir) pos = first->startproject; else if( last && pos > last->startproject+last->length ) pos = last->startproject+last->length; + KeyFrame *keyframe = 0; Plugin *plugin = (Plugin*)editof(pos, dir, 0); - if( !plugin ) return 0; - KeyFrame *keyframe = (KeyFrame *)(dir == PLAY_FORWARD ? - plugin->keyframes->nearest_after(pos) : - plugin->keyframes->nearest_before(pos)); + if( dir == PLAY_FORWARD ) { + for( ; !keyframe && plugin; plugin=(Plugin*)plugin->next ) { + if( plugin->plugin_type == PLUGIN_NONE ) continue; + keyframe = (KeyFrame *)plugin->keyframes->nearest_after(pos); + } + } + else { + for( ; !keyframe && plugin; plugin=(Plugin*)plugin->previous ) { + if( plugin->plugin_type == PLUGIN_NONE ) continue; + keyframe = (KeyFrame *)plugin->keyframes->nearest_before(pos); + } + } return keyframe; } -- 2.26.2