}
}
+void EDL::deglitch(double position)
+{
+ if( !session->cursor_on_frames ) return;
+ Track *current_track = tracks->first;
+ for( ; current_track; current_track=current_track->next ) {
+ if( !current_track->record ) continue;
+ if( current_track->data_type != TRACK_AUDIO ) continue;
+ ATrack *atrack = (ATrack*)current_track;
+ atrack->deglitch(position,
+ session->labels_follow_edits,
+ session->plugins_follow_edits,
+ session->autos_follow_edits);
+ }
+}
-int EDL::clear(double start,
- double end,
- int clear_labels,
- int clear_plugins,
- int edit_autos)
+int EDL::clear(double start, double end,
+ int clear_labels, int clear_plugins, int edit_autos)
{
if(start == end)
{
" output_h: %d\n"
" aspect_w: %f\n"
" aspect_h: %f\n"
- " color_model: %d\n"
- " proxy_scale: %d\n",
+ " color_model: %d\n",
session->video_channels,
session->video_tracks,
session->frame_rate,
session->output_h,
session->aspect_w,
session->aspect_h,
- session->color_model,
- session->proxy_scale);
+ session->color_model);
fprintf(fp," CLIPS\n");
fprintf(fp," total: %d\n", clips.total);
}
+double EDL::next_edit(double position)
+{
+ Units::fix_double(&position);
+ double new_position = tracks->total_length();
+
+ double max_rate = get_frame_rate();
+ int sample_rate = 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 position
+ for( Track *track=tracks->first; track; track=track->next ) {
+ if( !track->record ) continue;
+ for( Edit *edit=track->edits->first; edit; edit=edit->next ) {
+ 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;
+ }
+ }
+ return new_position;
+}
+
+double EDL::prev_edit(double position)
+{
+ Units::fix_double(&position);
+ double new_position = -1;
+
+ double max_rate = get_frame_rate();
+ int sample_rate = 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=tracks->first; track; track=track->next ) {
+ if( !track->record ) continue;
+ for( Edit *edit=track->edits->first; edit; edit=edit->next ) {
+ 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;
+ }
+ }
+ return new_position;
+}
+