change precision on colorpicker hue, rework edl_shared class decls for older cplrs...
authorGood Guy <[email protected]>
Fri, 24 Apr 2020 17:24:52 +0000 (11:24 -0600)
committerGood Guy <[email protected]>
Fri, 24 Apr 2020 17:24:52 +0000 (11:24 -0600)
cinelerra-5.1/cinelerra/colorpicker.C
cinelerra-5.1/cinelerra/edl.C
cinelerra-5.1/cinelerra/edl.h
cinelerra-5.1/cinelerra/pluginset.C

index 7c0a38d0d946fa8364b5e0c84c25ed442d2110e2..d14b4c1f90da8044bc96efdedecd9b9f67f434fe 100644 (file)
@@ -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"));
index ca0d149c0e5042c4a4642bed651517f5fb0abca0..6739dec89dab284da8dec9be63a6128e5e6fe0c0 100644 (file)
@@ -2199,8 +2199,7 @@ void EDL::replace_assets(ArrayList<Indexable*> &orig_idxbls, ArrayList<Asset*> &
 int EDL::collect_effects(EDL *&group)
 {
 // to remap shared plugins in copied plugin stack
-       class shared : public ArrayList<int> { public: int trk; };
-       class shared_list : public ArrayList<shared> {} 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<SharedLocation> {
-       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;
index b17b4f97f84467b4131d42c4559bfc0318ba5944..80aadb2c4f708a07387ff688adc5e40af32a0a2d 100644 (file)
@@ -25,6 +25,7 @@
 #include <stdio.h>
 #include <stdint.h>
 
+#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<int> { public: int trk; };
+class edl_shared_list : public ArrayList<edl_shared> {};
+class edl_SharedLocations : public ArrayList<SharedLocation> {
+public:
+       void add(int trk, int plg);
+};
+
 #endif
index 575f04651ce78c10fc33d24958b618ecb4c65ac4..b0c096e44d8d2bdb23739f1ebc45f88e9ac0bbe2 100644 (file)
@@ -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;
 }