2 Copyright (C) 2010 Paul Davis
3 Author: Robin Gareus <robin@gareus.org>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #include <sigc++/bind.h>
22 #include "ardour/tempo.h"
24 #include "pbd/file_utils.h"
25 #include "pbd/convert.h"
26 #include "ardour/session_directory.h"
28 #include "ardour_ui.h"
29 #include "public_editor.h"
30 #include "gui_thread.h"
32 #include "canvas_impl.h"
33 #include "simpleline.h"
34 #include "utils_videotl.h"
35 #include "rgb_macros.h"
36 #include "video_timeline.h"
38 #include <gtkmm2ext/utils.h>
40 #include <curl/curl.h>
45 using namespace ARDOUR;
47 using namespace Timecode;
49 VideoTimeLine::VideoTimeLine (PublicEditor *ed, ArdourCanvas::Group *vbg, int initial_height)
51 , videotl_bar_group(vbg)
52 , bar_height(initial_height)
54 video_start_offset = 0L;
58 auto_set_session_fps = false;
59 video_offset_lock = false;
60 video_aspect_ratio = 4.0/3.0;
61 Config->ParameterChanged.connect (*this, invalidator (*this), ui_bind (&VideoTimeLine::parameter_changed, this, _1), gui_context());
62 video_server_url = video_get_server_url(Config);
63 server_docroot = video_get_docroot(Config);
66 video_file_fps = 25.0;
69 reopen_vmonitor=false;
72 VtlUpdate.connect (*this, invalidator (*this), boost::bind (&PublicEditor::queue_visual_videotimeline_update, editor), gui_context());
73 GuiUpdate.connect (*this, invalidator (*this), boost::bind (&VideoTimeLine::gui_update, this, _1), gui_context());
76 VideoTimeLine::~VideoTimeLine ()
81 /* close and save settings */
83 VideoTimeLine::save_session ()
89 LocaleGuard lg (X_("POSIX"));
91 XMLNode* node = new XMLNode(X_("Videomonitor"));
93 node->add_property (X_("active"), (vmonitor && vmonitor->is_started())?"yes":"no");
94 _session->add_extra_xml (*node);
97 if (vmonitor->is_started()) {
98 vmonitor->query_full_state(true);
100 vmonitor->save_session();
104 node = _session->extra_xml (X_("Videotimeline"));
106 node->add_property (X_("id"), id().to_s());
107 node->add_property (X_("Height"), editor->get_videotl_bar_height());
108 node->add_property (X_("VideoOffsetLock"), video_offset_lock?X_("1"):X_("0"));
109 node->add_property (X_("VideoOffset"), video_offset);
110 node->add_property (X_("AutoFPS"), auto_set_session_fps?X_("1"):X_("0"));
113 /* close and save settings */
115 VideoTimeLine::close_session ()
117 if (video_duration == 0) {
120 sessionsave.disconnect();
121 close_video_monitor();
126 GuiUpdate("set-xjadeo-sensitive-off");
127 GuiUpdate("video-unavailable");
131 VideoTimeLine::sync_session_state ()
133 if (!_session || !vmonitor || !vmonitor->is_started()) {
139 /** load settings from session */
141 VideoTimeLine::set_session (ARDOUR::Session *s)
143 SessionHandlePtr::set_session (s);
144 if (!_session) { return ; }
146 _session->SaveSession.connect_same_thread (sessionsave, boost::bind (&VideoTimeLine::save_session, this));
147 LocaleGuard lg (X_("POSIX"));
149 XMLNode* node = _session->extra_xml (X_("Videotimeline"));
151 if (!node || !node->property (X_("Filename"))) {
155 ARDOUR_UI::instance()->start_video_server((Gtk::Window*)0, false);
159 const XMLProperty* proph = node->property (X_("Height"));
161 editor->set_video_timeline_height(atoi(proph->value()));
163 #if 0 /* TODO THINK: set FPS first time only ?! */
164 const XMLProperty* propasfps = node->property (X_("AutoFPS"));
166 auto_set_session_fps = atoi(propasfps->value())?true:false;
170 const XMLProperty* propoffset = node->property (X_("VideoOffset"));
172 video_offset = atoll(propoffset->value());
173 video_offset_p = video_offset;
176 const XMLProperty* proplock = node->property (X_("VideoOffsetLock"));
178 video_offset_lock = atoi(proplock->value())?true:false;
181 const XMLProperty* localfile = node->property (X_("LocalFile"));
183 local_file = atoi(localfile->value())?true:false;
186 const XMLProperty* propf = node->property (X_("Filename"));
187 video_file_info(propf->value(), local_file);
189 if ((node = _session->extra_xml (X_("Videomonitor")))) {
190 const XMLProperty* prop = node->property (X_("active"));
191 if (prop && prop->value() == "yes" && found_xjadeo() && !video_filename.empty() && local_file) {
192 open_video_monitor();
196 _session->register_with_memento_command_factory(id(), this);
197 _session->config.ParameterChanged.connect (*this, invalidator (*this), ui_bind (&VideoTimeLine::parameter_changed, this, _1), gui_context());
201 VideoTimeLine::set_offset_locked (bool v) {
202 if (_session && v != video_offset_lock) {
203 _session->set_dirty ();
205 video_offset_lock = v;
209 VideoTimeLine::toggle_offset_locked () {
210 video_offset_lock = !video_offset_lock;
212 _session->set_dirty ();
217 VideoTimeLine::save_undo ()
219 if (_session && video_offset_p != video_offset) {
220 _session->set_dirty ();
222 video_offset_p = video_offset;
226 VideoTimeLine::set_state (const XMLNode& node, int /*version*/)
228 LocaleGuard lg (X_("POSIX"));
229 const XMLProperty* propoffset = node.property (X_("VideoOffset"));
231 video_offset = atoll(propoffset->value());
233 ARDOUR_UI::instance()->flush_videotimeline_cache(true);
238 VideoTimeLine::get_state ()
240 XMLNode* node = new XMLNode (X_("Videotimeline"));
241 LocaleGuard lg (X_("POSIX"));
242 node->add_property (X_("VideoOffset"), video_offset_p);
247 VideoTimeLine::remove_frames ()
249 for (VideoFrames::iterator i = video_frames.begin(); i != video_frames.end(); ++i ) {
250 VideoImageFrame *frame = (*i);
254 video_frames.clear();
258 VideoTimeLine::get_video_frame (framepos_t vfn, int cut, int rightend)
261 for (VideoFrames::iterator i = video_frames.begin(); i != video_frames.end(); ++i) {
262 VideoImageFrame *frame = (*i);
263 if (abs(frame->get_video_frame_number()-vfn)<=cut
264 && frame->get_rightend() == rightend) { return frame; }
270 VideoTimeLine::get_apv()
272 // XXX: dup code - TODO use this fn in update_video_timeline()
273 float apv = -1; /* audio frames per video frame; */
274 if (!_session) return apv;
276 if (_session->config.get_use_video_file_fps()) {
277 if (video_file_fps == 0 ) return apv;
279 if (_session->timecode_frames_per_second() == 0 ) return apv;
282 if (_session->config.get_videotimeline_pullup()) {
283 apv = _session->frame_rate();
285 apv = _session->nominal_frame_rate();
287 if (_session->config.get_use_video_file_fps()) {
288 apv /= video_file_fps;
290 apv /= _session->timecode_frames_per_second();
296 VideoTimeLine::update_video_timeline()
298 if (!_session) return;
300 if (_session->config.get_use_video_file_fps()) {
301 if (video_file_fps == 0 ) return;
303 if (_session->timecode_frames_per_second() == 0 ) return;
306 double frames_per_unit = editor->unit_to_frame(1.0);
307 framepos_t leftmost_frame = editor->leftmost_position();
310 * 1) calculate how many frames there should be in current zoom (plus 1 page on each side)
311 * 2) calculate first frame and distance between video-frames (according to zoom)
312 * 3) destroy/add frames
313 * 4) reposition existing frames
314 * 5) assign framenumber to frames -> request/decode video.
317 /* video-file and session properties */
318 double display_vframe_width; /* unit: pixels ; width of one thumbnail in the timeline */
319 float apv; /* audio frames per video frame; */
320 framepos_t leftmost_video_frame; /* unit: video-frame number ; temporary var -> vtl_start */
322 /* variables needed to render videotimeline -- what needs to computed first */
323 framepos_t vtl_start; /* unit: audio-frames ; first displayed video-frame */
324 framepos_t vtl_dist; /* unit: audio-frames ; distance between displayed video-frames */
325 unsigned int visible_video_frames; /* number of frames that fit on current canvas */
327 if (_session->config.get_videotimeline_pullup()) {
328 apv = _session->frame_rate();
330 apv = _session->nominal_frame_rate();
332 if (_session->config.get_use_video_file_fps()) {
333 apv /= video_file_fps;
335 apv /= _session->timecode_frames_per_second();
338 display_vframe_width = bar_height * video_aspect_ratio;
340 if (apv > frames_per_unit * display_vframe_width) {
341 /* high-zoom: need space between successive video-frames */
342 vtl_dist = rint(apv);
344 /* continous timeline: skip video-frames */
345 vtl_dist = ceil(display_vframe_width * frames_per_unit / apv) * apv;
348 assert (vtl_dist > 0);
351 leftmost_video_frame = floor (floor((leftmost_frame - video_start_offset - video_offset ) / vtl_dist) * vtl_dist / apv);
353 vtl_start = rint (video_offset + video_start_offset + leftmost_video_frame * apv);
354 visible_video_frames = 2 + ceil(editor->current_page_frames() / vtl_dist); /* +2 left+right partial frames */
356 /* expand timeline (cache next/prev page images) */
357 vtl_start -= visible_video_frames * vtl_dist;
358 visible_video_frames *=3;
360 if (vtl_start < video_offset ) {
361 visible_video_frames += ceil(vtl_start/vtl_dist);
362 vtl_start = video_offset;
365 /* apply video-file constraints */
366 if (vtl_start > video_start_offset + video_duration + video_offset ) {
367 visible_video_frames = 0;
369 /* TODO optimize: compute rather than iterate */
370 while (visible_video_frames > 0 && vtl_start + (visible_video_frames-1) * vtl_dist >= video_start_offset + video_duration + video_offset) {
371 --visible_video_frames;
379 while (video_frames.size() < visible_video_frames) {
380 VideoImageFrame *frame;
381 frame = new VideoImageFrame(*editor, *videotl_bar_group, display_vframe_width, bar_height, video_server_url, translated_filename());
382 frame->ImgChanged.connect (*this, invalidator (*this), boost::bind (&PublicEditor::queue_visual_videotimeline_update, editor), gui_context());
383 video_frames.push_back(frame);
386 VideoFrames outdated_video_frames;
387 std::list<int> remaining;
389 outdated_video_frames = video_frames;
392 /* when zoomed out, ignore shifts by +-1 frame
393 * which can occur due to rounding errors when
394 * scrolling to a new leftmost-audio frame.
397 if (vtl_dist/apv < 3.0) cut =0;
402 for (unsigned int vfcount=0; vfcount < visible_video_frames; ++vfcount){
403 framepos_t vfpos = vtl_start + vfcount * vtl_dist; /* unit: audio-frames */
404 framepos_t vframeno = rint ( (vfpos - video_offset) / apv); /* unit: video-frames */
405 vfpos = (vframeno * apv ) + video_offset; /* audio-frame corresponding to /rounded/ video-frame */
407 int rightend = -1; /* unit: pixels */
408 if (vfpos + vtl_dist > video_start_offset + video_duration + video_offset) {
409 rightend = display_vframe_width * (video_start_offset + video_duration + video_offset - vfpos) / vtl_dist;
410 //printf("lf(e): %lu\n", vframeno); // XXX
412 VideoImageFrame * frame = get_video_frame(vframeno, cut, rightend);
414 frame->set_position(vfpos-leftmost_frame);
415 outdated_video_frames.remove(frame);
417 remaining.push_back(vfcount);
421 for (VideoFrames::iterator i = outdated_video_frames.begin(); i != outdated_video_frames.end(); ++i ) {
422 VideoImageFrame *frame = (*i);
423 if (remaining.empty()) {
424 frame->set_position(-2 * vtl_dist); /* move off screen */
426 int vfcount=remaining.front();
427 remaining.pop_front();
428 framepos_t vfpos = vtl_start + vfcount * vtl_dist; /* unit: audio-frames */
429 framepos_t vframeno = rint ((vfpos - video_offset) / apv); /* unit: video-frames */
430 int rightend = -1; /* unit: pixels */
431 if (vfpos + vtl_dist > video_start_offset + video_duration + video_offset) {
432 rightend = display_vframe_width * (video_start_offset + video_duration + video_offset - vfpos) / vtl_dist;
433 //printf("lf(n): %lu\n", vframeno); // XXX
435 frame->set_position(vfpos-leftmost_frame);
436 frame->set_videoframe(vframeno, rightend);
442 VideoTimeLine::translated_filename ()
445 return video_filename;
447 return video_map_path(server_docroot, video_filename);
452 VideoTimeLine::video_file_info (std::string filename, bool local)
456 if (filename.at(0) == G_DIR_SEPARATOR || !local_file) {
457 video_filename = filename;
459 video_filename = Glib::build_filename (_session->session_directory().video_path(), filename);
462 long long int _duration;
463 double _start_offset;
465 if (!video_query_info(
466 video_server_url, translated_filename(),
467 video_file_fps, _duration, _start_offset, video_aspect_ratio)) {
468 warning << _("Parsing video file info failed. Is the Video Server running? Is the file readable by the Video Server? Does the docroot match? Is it a video file?") << endmsg;
470 GuiUpdate("set-xjadeo-sensitive-off");
471 GuiUpdate("video-unavailable");
474 video_duration = _duration * _session->nominal_frame_rate() / video_file_fps;
475 video_start_offset = _start_offset * _session->nominal_frame_rate();
477 if (auto_set_session_fps && video_file_fps != _session->timecode_frames_per_second()) {
478 switch ((int)floorf(video_file_fps*1000.0)) {
480 _session->config.set_timecode_format(timecode_23976);
483 _session->config.set_timecode_format(timecode_24);
487 _session->config.set_timecode_format(timecode_24976);
490 _session->config.set_timecode_format(timecode_25);
493 _session->config.set_timecode_format(timecode_2997drop);
496 _session->config.set_timecode_format(timecode_30);
499 _session->config.set_timecode_format(timecode_5994);
502 _session->config.set_timecode_format(timecode_60);
505 warning << string_compose (
506 _("Failed to set session-framerate: '%1' does not have a corresponding option setting in %2."),
507 video_file_fps, PROGRAM_NAME ) << endmsg;
510 _session->config.set_video_pullup(0); /* TODO only set if set_timecode_format() was successful ?!*/
512 if (floor(video_file_fps*100) != floor(_session->timecode_frames_per_second()*100)) {
513 warning << string_compose(
514 _("Video file's framerate is not equal to %1 session timecode's framerate: '%2' vs '%3'"),
515 PROGRAM_NAME, video_file_fps, _session->timecode_frames_per_second())
518 flush_local_cache ();
520 if (found_xjadeo() && local_file) {
521 GuiUpdate("set-xjadeo-sensitive-on");
522 if (vmonitor && vmonitor->is_started()) {
524 /* xjadeo <= 0.6.4 has a bug where changing the video-file may segfauls
525 * if the geometry changes to a different line-size alignment
527 reopen_vmonitor = true;
530 vmonitor->set_fps(video_file_fps);
531 vmonitor->open(video_filename);
534 } else if (!local_file) {
535 #if 1 /* temp debug/devel message */
536 // TODO - call xjremote remotely.
537 printf("the given video file can not be accessed on localhost, video monitoring is not currently supported for this case\n");
538 GuiUpdate("set-xjadeo-sensitive-off");
542 GuiUpdate("video-available");
547 VideoTimeLine::check_server ()
551 snprintf(url, sizeof(url), "%s%sstatus"
552 , video_server_url.c_str()
553 , (video_server_url.length()>0 && video_server_url.at(video_server_url.length()-1) == '/')?"":"/"
555 char *res=curl_http_get(url, NULL);
557 if (strstr(res, "status: ok, online.")) { ok = true; }
564 VideoTimeLine::check_server_docroot ()
568 std::vector<std::vector<std::string> > lines;
570 if (video_server_url.find("/localhost:") == string::npos) {
573 snprintf(url, sizeof(url), "%s%src?format=csv"
574 , video_server_url.c_str()
575 , (video_server_url.length()>0 && video_server_url.at(video_server_url.length()-1) == '/')?"":"/"
577 char *res=curl_http_get(url, NULL);
582 ParseCSV(std::string(res), lines);
584 || lines.at(0).empty()
585 || lines.at(0).at(0) != video_get_docroot(Config)) {
586 warning << string_compose(
587 _("Video-server docroot mismatch. %1: '%2', video-server: '%3'. This usually means that the video server was not started by ardour and uses a different document-root."),
588 PROGRAM_NAME, video_get_docroot(Config), lines.at(0).at(0))
590 ok = false; // TODO allow to override
597 VideoTimeLine::gui_update(std::string const & t) {
598 /* this is to be called via GuiUpdate() only. */
599 ENSURE_GUI_THREAD (*this, &VideoTimeLine::queue_visual_videotimeline_update)
600 if (t == "videotimeline-update") {
601 editor->queue_visual_videotimeline_update();
602 } else if (t == "set-xjadeo-active-off") {
603 editor->toggle_xjadeo_proc(0);
604 } else if (t == "set-xjadeo-active-on") {
605 editor->toggle_xjadeo_proc(1);
606 } else if (t == "set-xjadeo-sensitive-on") {
607 editor->set_xjadeo_sensitive(true);
608 } else if (t == "set-xjadeo-sensitive-off") {
609 editor->toggle_xjadeo_proc(0);
610 //close_video_monitor();
611 editor->set_xjadeo_sensitive(false);
612 } else if (t == "xjadeo-window-ontop-on") {
613 editor->toggle_xjadeo_viewoption(1, 1);
614 } else if (t == "xjadeo-window-ontop-off") {
615 editor->toggle_xjadeo_viewoption(1, 0);
616 } else if (t == "xjadeo-window-osd-timecode-on") {
617 editor->toggle_xjadeo_viewoption(2, 1);
618 } else if (t == "xjadeo-window-osd-timecode-off") {
619 editor->toggle_xjadeo_viewoption(2, 0);
620 } else if (t == "xjadeo-window-osd-frame-on") {
621 editor->toggle_xjadeo_viewoption(3, 1);
622 } else if (t == "xjadeo-window-osd-frame-off") {
623 editor->toggle_xjadeo_viewoption(3, 0);
624 } else if (t == "xjadeo-window-osd-box-on") {
625 editor->toggle_xjadeo_viewoption(4, 1);
626 } else if (t == "xjadeo-window-osd-box-off") {
627 editor->toggle_xjadeo_viewoption(4, 0);
628 } else if (t == "xjadeo-window-fullscreen-on") {
629 editor->toggle_xjadeo_viewoption(5, 1);
630 } else if (t == "xjadeo-window-fullscreen-off") {
631 editor->toggle_xjadeo_viewoption(5, 0);
632 } else if (t == "xjadeo-window-letterbox-on") {
633 editor->toggle_xjadeo_viewoption(6, 1);
634 } else if (t == "xjadeo-window-letterbox-off") {
635 editor->toggle_xjadeo_viewoption(6, 0);
636 } else if (t == "video-available") {
637 editor->set_close_video_sensitive(true);
638 } else if (t == "video-unavailable") {
639 editor->set_close_video_sensitive(false);
644 VideoTimeLine::set_height (int height) {
645 if (_session && bar_height != height) {
646 _session->set_dirty ();
653 VideoTimeLine::vmon_update () {
654 if (vmonitor && vmonitor->is_started()) {
655 vmonitor->set_offset(video_offset); // TODO proper re-init xjadeo w/o restart not just offset.
660 VideoTimeLine::flush_local_cache () {
666 VideoTimeLine::flush_cache () {
669 snprintf(url, sizeof(url), "%s%sadmin/flush_cache"
670 , video_server_url.c_str()
671 , (video_server_url.length()>0 && video_server_url.at(video_server_url.length()-1) == '/')?"":"/"
673 char *res=curl_http_get(url, NULL);
677 if (vmonitor && vmonitor->is_started()) {
678 reopen_vmonitor=true;
681 video_file_info(video_filename, local_file);
686 VideoTimeLine::parameter_changed (std::string const & p)
688 if (p == "video-server-url") {
689 set_video_server_url (video_get_server_url(Config));
690 } else if (p == "video-server-docroot") {
691 set_video_server_docroot (video_get_docroot(Config));
692 } else if (p == "video-advanced-setup") {
693 set_video_server_url (video_get_server_url(Config));
694 set_video_server_docroot (video_get_docroot(Config));
696 if (p == "use-video-file-fps" || p == "videotimeline-pullup" ) { /* session->config parameter */
702 VideoTimeLine::set_video_server_url(std::string vsu) {
703 flush_local_cache ();
704 video_server_url = vsu;
709 VideoTimeLine::set_video_server_docroot(std::string vsr) {
710 flush_local_cache ();
711 server_docroot = vsr;
715 /* video-monitor for this timeline */
717 VideoTimeLine::find_xjadeo () {
718 std::string xjadeo_file_path;
719 if (getenv("XJREMOTE")) {
720 _xjadeo_bin = strdup(getenv("XJREMOTE")); // XXX TODO: free it?!
721 } else if (find_file_in_search_path (SearchPath(Glib::getenv("PATH")), X_("xjremote"), xjadeo_file_path)) {
722 _xjadeo_bin = xjadeo_file_path;
724 else if (Glib::file_test(X_("/Applications/Jadeo.app/Contents/MacOS/xjremote"), Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_EXECUTABLE)) {
725 _xjadeo_bin = X_("/Applications/Jadeo.app/Contents/MacOS/xjremote");
727 /* TODO: win32: allow to configure PATH to xjremote */
728 else if (Glib::file_test(X_("C:\\Program Files\\xjadeo\\xjremote.exe"), Glib::FILE_TEST_EXISTS)) {
729 _xjadeo_bin = X_("C:\\Program Files\\xjadeo\\xjremote.exe");
731 else if (Glib::file_test(X_("C:\\Program Files\\xjadeo\\xjremote.bat"), Glib::FILE_TEST_EXISTS)) {
732 _xjadeo_bin = X_("C:\\Program Files\\xjadeo\\xjremote.bat");
735 _xjadeo_bin = X_("");
736 warning << _("Video-monitor 'xjadeo' was not found. Please install http://xjadeo.sf.net/ "
737 "(a custom path to xjadeo can be specified by setting the XJREMOTE environment variable. "
738 "It should point to an application compatible with xjadeo's remote-control interface 'xjremote').")
744 VideoTimeLine::open_video_monitor() {
745 if (!found_xjadeo()) return;
747 vmonitor = new VideoMonitor(editor, _xjadeo_bin);
748 vmonitor->set_session(_session);
749 vmonitor->set_offset(video_offset);
750 vmonitor->Terminated.connect (sigc::mem_fun (*this, &VideoTimeLine::terminated_video_monitor));
751 vmonitor->UiState.connect (*this, invalidator (*this), boost::bind (&VideoTimeLine::gui_update, this, _1), gui_context());
752 } else if (vmonitor->is_started()) {
758 * the idea is to selective ignore certain monitor window
759 * states if xjadeo is not running on the same host as ardour.
760 * However with the removal of the video-monitor-startup-dialogue
761 * (git rev 5a4d0fff0) these settings are currently not accessible.
763 int xj_settings_mask = vmonitor->restore_settings_mask();
765 /* load mask from Session */
766 XMLNode* node = _session->extra_xml (X_("XJRestoreSettings"));
768 const XMLProperty* prop = node->property (X_("mask"));
770 xj_settings_mask = atoi(prop->value());
775 vmonitor->restore_settings_mask(xj_settings_mask);
778 if (!vmonitor->start()) {
779 warning << "launching xjadeo failed.." << endmsg;
780 close_video_monitor();
782 GuiUpdate("set-xjadeo-active-on");
783 vmonitor->set_fps(video_file_fps);
784 vmonitor->open(video_filename);
787 XMLNode* node = _session->extra_xml (X_("Videomonitor"));
789 const XMLProperty* prop = node->property (X_("active"));
790 if (prop && prop->value() != "yes") _session->set_dirty ();
792 _session->set_dirty ();
800 VideoTimeLine::close_video_monitor() {
801 if (vmonitor && vmonitor->is_started()) {
807 VideoTimeLine::control_video_monitor(int what, int param) {
808 if (!vmonitor || !vmonitor->is_started()) {
811 vmonitor->send_cmd(what, param);
816 VideoTimeLine::terminated_video_monitor () {
818 vmonitor->save_session();
822 GuiUpdate("set-xjadeo-active-off");
823 if (reopen_vmonitor) {
824 reopen_vmonitor=false;
825 open_video_monitor();
828 _session->set_dirty ();
834 VideoTimeLine::manual_seek_video_monitor (framepos_t pos)
836 if (!vmonitor) { return; }
837 if (!vmonitor->is_started()) { return; }
838 if (!vmonitor->synced_by_manual_seeks()) { return; }
839 vmonitor->manual_seek(pos, false, video_offset); // XXX -> set offset in xjadeo