diff options
-rw-r--r-- | gtk2_ardour/video_timeline.cc | 44 | ||||
-rw-r--r-- | gtk2_ardour/video_timeline.h | 3 |
2 files changed, 47 insertions, 0 deletions
diff --git a/gtk2_ardour/video_timeline.cc b/gtk2_ardour/video_timeline.cc index bcbf19d4f7..72b0dff654 100644 --- a/gtk2_ardour/video_timeline.cc +++ b/gtk2_ardour/video_timeline.cc @@ -720,6 +720,11 @@ VideoTimeLine::set_video_server_docroot(std::string vsr) { /* video-monitor for this timeline */ void +VideoTimeLine::xjadeo_readversion (std::string d, size_t /* s */) { + xjadeo_version += d; +} + +void VideoTimeLine::find_xjadeo () { std::string xjadeo_file_path; #ifdef PLATFORM_WINDOWS @@ -770,6 +775,45 @@ VideoTimeLine::find_xjadeo () { "see also http://manual.ardour.org/video-timeline/setup/") << endmsg; } + if (found_xjadeo ()) { + ARDOUR::SystemExec version_check(_xjadeo_bin, X_("--version")); + xjadeo_version = ""; + version_check.ReadStdout.connect_same_thread (*this, boost::bind (&VideoTimeLine::xjadeo_readversion, this, _1 ,_2)); + version_check.Terminated.connect_same_thread (*this, boost::bind (&VideoTimeLine::xjadeo_readversion, this, "\n" ,1)); + if (version_check.start(2)) { + warning << _( + "Video-monitor 'xjadeo' cannot be launched." + ) << endmsg; + _xjadeo_bin = X_(""); + return; + } + + version_check.wait (); + int timeout = 300; + while (xjadeo_version.empty() && --timeout) { + Glib::usleep(10000); + } + + bool v_ok = false; + size_t vo = xjadeo_version.find(" version "); + if (vo != string::npos) { + int v_major, v_minor, v_micro; + if(sscanf(xjadeo_version.substr(vo + 9, string::npos).c_str(),"%d.%d.%d", + &v_major, &v_minor, &v_micro) == 3) + { + if (v_major >= 1) v_ok = true; + else if (v_major == 0 && v_minor >= 8) v_ok = true; + else if (v_major == 0 && v_minor >= 7 && v_micro >= 7) v_ok = true; + } + } + if (!v_ok) { + _xjadeo_bin = X_(""); + warning << _( + "Video-monitor 'xjadeo' is too old. " + "Please install xjadeo version 0.7.7 or later. http://xjadeo.sf.net/" + ) << endmsg; + } + } } void diff --git a/gtk2_ardour/video_timeline.h b/gtk2_ardour/video_timeline.h index dd61d2ef73..f84e613cc8 100644 --- a/gtk2_ardour/video_timeline.h +++ b/gtk2_ardour/video_timeline.h @@ -123,6 +123,9 @@ class VideoTimeLine : public sigc::trackable, public ARDOUR::SessionHandlePtr, p std::string video_server_url; std::string server_docroot; + void xjadeo_readversion (std::string d, size_t s); + std::string xjadeo_version; + typedef std::list<VideoImageFrame*> VideoFrames; VideoFrames video_frames; VideoImageFrame *get_video_frame (framepos_t vfn, int cut=0, int rightend = -1); |