proxy cpus usage, unlock win before render_proxy, snap tweaks
[goodguy/history.git] / cinelerra-5.1 / cinelerra / mwindowmove.C
index cffc71df0ea33bcda33bc7d5e57999726bd766fe..08a623f8f0a454cdad59e0624b6114cb81e0210c 100644 (file)
@@ -695,6 +695,12 @@ int MWindow::next_edit_handle(int shift_down)
        double position = edl->local_session->get_selectionend(1);
        Units::fix_double(&position);
        double new_position = INFINITY;
+
+       double max_rate = edl->get_frame_rate();
+       int sample_rate = edl->get_sample_rate();
+       if( sample_rate > max_rate ) max_rate = sample_rate;
+       double min_movement = max_rate > 0 ? 1. / max_rate : 1e-6;
+
 // Test for edit handles after cursor position
        for (Track *track = edl->tracks->first; track; track = track->next)
        {
@@ -704,6 +710,7 @@ int MWindow::next_edit_handle(int shift_down)
                        {
                                double edit_end = track->from_units(edit->startproject + edit->length);
                                Units::fix_double(&edit_end);
+                               if( fabs(edit_end-position) < min_movement ) continue;
                                if (edit_end > position && edit_end < new_position)
                                        new_position = edit_end;
                        }
@@ -761,6 +768,12 @@ int MWindow::prev_edit_handle(int shift_down)
        double position = edl->local_session->get_selectionstart(1);
        double new_position = -1;
        Units::fix_double(&position);
+
+       double max_rate = edl->get_frame_rate();
+       int sample_rate = edl->get_sample_rate();
+       if( sample_rate > max_rate ) max_rate = sample_rate;
+       double min_movement = max_rate > 0 ? 1. / max_rate : 1e-6;
+
 // Test for edit handles before cursor position
        for (Track *track = edl->tracks->first; track; track = track->next)
        {
@@ -770,6 +783,7 @@ int MWindow::prev_edit_handle(int shift_down)
                        {
                                double edit_end = track->from_units(edit->startproject);
                                Units::fix_double(&edit_end);
+                               if( fabs(edit_end-position) < min_movement ) continue;
                                if (edit_end < position && edit_end > new_position)
                                        new_position = edit_end;
                        }