From 8b5f990267622100b3a1a7ff6fa346282aca4dda Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 10 Jun 2013 19:43:23 +0200 Subject: [PATCH] vtl: send A/V offset to video-monitor when launched --- gtk2_ardour/video_monitor.cc | 4 +++- gtk2_ardour/video_monitor.h | 1 + gtk2_ardour/video_timeline.cc | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/video_monitor.cc b/gtk2_ardour/video_monitor.cc index 7f9fd71da2..2e6f5157bf 100644 --- a/gtk2_ardour/video_monitor.cc +++ b/gtk2_ardour/video_monitor.cc @@ -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"); } diff --git a/gtk2_ardour/video_monitor.h b/gtk2_ardour/video_monitor.h index 23c435ff5e..59264fa012 100644 --- a/gtk2_ardour/video_monitor.h +++ b/gtk2_ardour/video_monitor.h @@ -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; diff --git a/gtk2_ardour/video_timeline.cc b/gtk2_ardour/video_timeline.cc index 6d84e34a28..7bf42299d7 100644 --- a/gtk2_ardour/video_timeline.cc +++ b/gtk2_ardour/video_timeline.cc @@ -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()) {