vtl: send A/V offset to video-monitor when launched

This commit is contained in:
Robin Gareus 2013-06-10 19:43:23 +02:00
parent f5a8e563e8
commit 8b5f990267
3 changed files with 5 additions and 1 deletions

View File

@ -496,7 +496,9 @@ VideoMonitor::set_offset (ARDOUR::frameoffset_t offset)
video_frame_offset = floor(offset * _session->timecode_frames_per_second() / audio_frame_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");
}

View File

@ -99,6 +99,7 @@ class VideoMonitor : public sigc::trackable , public ARDOUR::SessionHandlePtr, p
void xjadeo_sync_setup ();
ARDOUR::framepos_t manually_seeked_frame;
ARDOUR::frameoffset_t video_offset;
bool sync_by_manual_seek;
sigc::connection clock_connection;
sigc::connection state_connection;

View File

@ -700,6 +700,7 @@ VideoTimeLine::open_video_monitor() {
if (!vmonitor) {
vmonitor = new VideoMonitor(editor, _xjadeo_bin);
vmonitor->set_session(_session);
vmonitor->set_offset(video_offset);
vmonitor->Terminated.connect (sigc::mem_fun (*this, &VideoTimeLine::terminated_video_monitor));
vmonitor->UiState.connect (*this, invalidator (*this), boost::bind (&VideoTimeLine::gui_update, this, _1), gui_context());
} else if (vmonitor->is_started()) {