if (Config->get_edit_mode() == Splice) {
_drags->add (new RegionSpliceDrag (this, item, region_view, selection->regions.by_layer()));
} else {
- RegionSelection s = get_equivalent_regions (selection->regions, ARDOUR::Properties::select.property_id);
- _drags->add (new RegionMoveDrag (this, item, region_view, s.by_layer(), false, false));
+ _drags->add (new RegionMoveDrag (this, item, region_view, selection->regions.by_layer(), false, false));
}
-
- /* sync the canvas to what we think is its current state */
- update_canvas_now();
}
void
/* Note: pull-up/down are applied here: frame_rate() vs. nominal_frame_rate() */
if (_session->config.get_use_video_file_fps()) {
- video_frame_offset = floor(offset * fps / audio_frame_rate);
+ video_frame_offset = floor(offset * fps / audio_sample_rate);
} else {
- video_frame_offset = floor(offset * _session->timecode_frames_per_second() / audio_frame_rate);
+ video_frame_offset = floor(offset * _session->timecode_frames_per_second() / audio_sample_rate);
}
- // TODO remember if changed..
+ if (video_offset == video_frame_offset) { return; }
+ video_offset = video_frame_offset;
+
std::ostringstream osstream1; osstream1 << -1 * video_frame_offset;
process->write_to_stdin("set offset " + osstream1.str() + "\n");
}
} else {
int vfcount=remaining.front();
remaining.pop_front();
- framepos_t vfpos = vtl_start + vfcount * vtl_dist; /* unit: audio-samples */
- framepos_t vframeno = rint ((vfpos - GOFFSET) / apv); /* unit: video-frames */
+ framepos_t vfpos = vtl_start + vfcount * vtl_dist; /* unit: audio-frames */
+ framepos_t vframeno = rint ((vfpos - video_offset) / apv); /* unit: video-frames */
int rightend = -1; /* unit: pixels */
- if (vfpos + vtl_dist > video_start_offset + video_duration + GOFFSET) {
- rightend = display_vframe_width * (video_start_offset + video_duration + GOFFSET - vfpos) / vtl_dist;
+ if (vfpos + vtl_dist > video_start_offset + video_duration + video_offset) {
+ rightend = display_vframe_width * (video_start_offset + video_duration + video_offset - vfpos) / vtl_dist;
+ //printf("lf(n): %lu\n", vframeno); // XXX
}
- frame->set_position(vfpos-leftmost_frame);
+ frame->set_position(vfpos);
frame->set_videoframe(vframeno, rightend);
}
}