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");
130 VideoTimeLine::sync_session_state ()
132 if (!_session || !vmonitor || !vmonitor->is_started()) {
138 /** load settings from session */
140 VideoTimeLine::set_session (ARDOUR::Session *s)
142 SessionHandlePtr::set_session (s);
143 if (!_session) { return ; }
145 _session->SaveSession.connect_same_thread (sessionsave, boost::bind (&VideoTimeLine::save_session, this));
146 LocaleGuard lg (X_("POSIX"));
148 XMLNode* node = _session->extra_xml (X_("Videotimeline"));
150 if (!node || !node->property (X_("Filename"))) {
154 ARDOUR_UI::instance()->start_video_server((Gtk::Window*)0, false);
158 const XMLProperty* proph = node->property (X_("Height"));
160 editor->set_video_timeline_height(atoi(proph->value()));
162 #if 0 /* TODO THINK: set FPS first time only ?! */
163 const XMLProperty* propasfps = node->property (X_("AutoFPS"));
165 auto_set_session_fps = atoi(propasfps->value())?true:false;
169 const XMLProperty* propoffset = node->property (X_("VideoOffset"));
171 video_offset = atoll(propoffset->value());
172 video_offset_p = video_offset;
175 const XMLProperty* proplock = node->property (X_("VideoOffsetLock"));
177 video_offset_lock = atoi(proplock->value())?true:false;
180 const XMLProperty* localfile = node->property (X_("LocalFile"));
182 local_file = atoi(localfile->value())?true:false;
185 const XMLProperty* propf = node->property (X_("Filename"));
186 video_file_info(propf->value(), local_file);
188 if ((node = _session->extra_xml (X_("Videomonitor")))) {
189 const XMLProperty* prop = node->property (X_("active"));
190 if (prop && prop->value() == "yes" && found_xjadeo() && !video_filename.empty() && local_file) {
191 open_video_monitor();
195 _session->register_with_memento_command_factory(id(), this);
196 _session->config.ParameterChanged.connect (*this, invalidator (*this), ui_bind (&VideoTimeLine::parameter_changed, this, _1), gui_context());
200 VideoTimeLine::set_offset_locked (bool v) {
201 if (_session && v != video_offset_lock) {
202 _session->set_dirty ();
204 video_offset_lock = v;
208 VideoTimeLine::toggle_offset_locked () {
209 video_offset_lock = !video_offset_lock;
211 _session->set_dirty ();
216 VideoTimeLine::save_undo ()
218 if (_session && video_offset_p != video_offset) {
219 _session->set_dirty ();
221 video_offset_p = video_offset;
225 VideoTimeLine::set_state (const XMLNode& node, int /*version*/)
227 LocaleGuard lg (X_("POSIX"));
228 const XMLProperty* propoffset = node.property (X_("VideoOffset"));
230 video_offset = atoll(propoffset->value());
232 ARDOUR_UI::instance()->flush_videotimeline_cache(true);
237 VideoTimeLine::get_state ()
239 XMLNode* node = new XMLNode (X_("Videotimeline"));
240 LocaleGuard lg (X_("POSIX"));
241 node->add_property (X_("VideoOffset"), video_offset_p);
246 VideoTimeLine::remove_frames ()
248 for (VideoFrames::iterator i = video_frames.begin(); i != video_frames.end(); ++i ) {
249 VideoImageFrame *frame = (*i);
253 video_frames.clear();
257 VideoTimeLine::get_video_frame (framepos_t vfn, int cut, int rightend)
260 for (VideoFrames::iterator i = video_frames.begin(); i != video_frames.end(); ++i) {
261 VideoImageFrame *frame = (*i);
262 if (abs(frame->get_video_frame_number()-vfn)<=cut
263 && frame->get_rightend() == rightend) { return frame; }
269 VideoTimeLine::get_apv()
271 // XXX: dup code - TODO use this fn in update_video_timeline()
272 float apv = -1; /* audio frames per video frame; */
273 if (!_session) return apv;
275 if (_session->config.get_use_video_file_fps()) {
276 if (video_file_fps == 0 ) return apv;
278 if (_session->timecode_frames_per_second() == 0 ) return apv;
281 if (_session->config.get_videotimeline_pullup()) {
282 apv = _session->frame_rate();
284 apv = _session->nominal_frame_rate();
286 if (_session->config.get_use_video_file_fps()) {
287 apv /= video_file_fps;
289 apv /= _session->timecode_frames_per_second();
295 VideoTimeLine::update_video_timeline()
297 if (!_session) return;
299 if (_session->config.get_use_video_file_fps()) {
300 if (video_file_fps == 0 ) return;
302 if (_session->timecode_frames_per_second() == 0 ) return;
305 double frames_per_unit = editor->unit_to_frame(1.0);
306 framepos_t leftmost_frame = editor->leftmost_position();
309 * 1) calculate how many frames there should be in current zoom (plus 1 page on each side)
310 * 2) calculate first frame and distance between video-frames (according to zoom)
311 * 3) destroy/add frames
312 * 4) reposition existing frames
313 * 5) assign framenumber to frames -> request/decode video.
316 /* video-file and session properties */
317 double display_vframe_width; /* unit: pixels ; width of one thumbnail in the timeline */
318 float apv; /* audio frames per video frame; */
319 framepos_t leftmost_video_frame; /* unit: video-frame number ; temporary var -> vtl_start */
321 /* variables needed to render videotimeline -- what needs to computed first */
322 framepos_t vtl_start; /* unit: audio-frames ; first displayed video-frame */
323 framepos_t vtl_dist; /* unit: audio-frames ; distance between displayed video-frames */
324 unsigned int visible_video_frames; /* number of frames that fit on current canvas */
326 if (_session->config.get_videotimeline_pullup()) {
327 apv = _session->frame_rate();
329 apv = _session->nominal_frame_rate();
331 if (_session->config.get_use_video_file_fps()) {
332 apv /= video_file_fps;
334 apv /= _session->timecode_frames_per_second();
337 display_vframe_width = bar_height * video_aspect_ratio;
339 if (apv > frames_per_unit * display_vframe_width) {
340 /* high-zoom: need space between successive video-frames */
341 vtl_dist = rint(apv);
343 /* continous timeline: skip video-frames */
344 vtl_dist = ceil(display_vframe_width * frames_per_unit / apv) * apv;
347 assert (vtl_dist > 0);
350 leftmost_video_frame = floor (floor((leftmost_frame - video_start_offset - video_offset ) / vtl_dist) * vtl_dist / apv);
352 vtl_start = rint (video_offset + video_start_offset + leftmost_video_frame * apv);
353 visible_video_frames = 2 + ceil(editor->current_page_frames() / vtl_dist); /* +2 left+right partial frames */
355 /* expand timeline (cache next/prev page images) */
356 vtl_start -= visible_video_frames * vtl_dist;
357 visible_video_frames *=3;
359 if (vtl_start < video_offset ) {
360 visible_video_frames += ceil(vtl_start/vtl_dist);
361 vtl_start = video_offset;
364 /* apply video-file constraints */
365 if (vtl_start > video_start_offset + video_duration + video_offset ) {
366 visible_video_frames = 0;
368 /* TODO optimize: compute rather than iterate */
369 while (visible_video_frames > 0 && vtl_start + (visible_video_frames-1) * vtl_dist >= video_start_offset + video_duration + video_offset) {
370 --visible_video_frames;
378 while (video_frames.size() < visible_video_frames) {
379 VideoImageFrame *frame;
380 frame = new VideoImageFrame(*editor, *videotl_bar_group, display_vframe_width, bar_height, video_server_url, translated_filename());
381 frame->ImgChanged.connect (*this, invalidator (*this), boost::bind (&PublicEditor::queue_visual_videotimeline_update, editor), gui_context());
382 video_frames.push_back(frame);
385 VideoFrames outdated_video_frames;
386 std::list<int> remaining;
388 outdated_video_frames = video_frames;
391 /* when zoomed out, ignore shifts by +-1 frame
392 * which can occur due to rounding errors when
393 * scrolling to a new leftmost-audio frame.
396 if (vtl_dist/apv < 3.0) cut =0;
401 for (unsigned int vfcount=0; vfcount < visible_video_frames; ++vfcount){
402 framepos_t vfpos = vtl_start + vfcount * vtl_dist; /* unit: audio-frames */
403 framepos_t vframeno = rint ( (vfpos - video_offset) / apv); /* unit: video-frames */
404 vfpos = (vframeno * apv ) + video_offset; /* audio-frame corresponding to /rounded/ video-frame */
406 int rightend = -1; /* unit: pixels */
407 if (vfpos + vtl_dist > video_start_offset + video_duration + video_offset) {
408 rightend = display_vframe_width * (video_start_offset + video_duration + video_offset - vfpos) / vtl_dist;
409 //printf("lf(e): %lu\n", vframeno); // XXX
411 VideoImageFrame * frame = get_video_frame(vframeno, cut, rightend);
413 frame->set_position(vfpos-leftmost_frame);
414 outdated_video_frames.remove(frame);
416 remaining.push_back(vfcount);
420 for (VideoFrames::iterator i = outdated_video_frames.begin(); i != outdated_video_frames.end(); ++i ) {
421 VideoImageFrame *frame = (*i);
422 if (remaining.empty()) {
423 frame->set_position(-2 * vtl_dist); /* move off screen */
425 int vfcount=remaining.front();
426 remaining.pop_front();
427 framepos_t vfpos = vtl_start + vfcount * vtl_dist; /* unit: audio-frames */
428 framepos_t vframeno = rint ((vfpos - video_offset) / apv); /* unit: video-frames */
429 int rightend = -1; /* unit: pixels */
430 if (vfpos + vtl_dist > video_start_offset + video_duration + video_offset) {
431 rightend = display_vframe_width * (video_start_offset + video_duration + video_offset - vfpos) / vtl_dist;
432 //printf("lf(n): %lu\n", vframeno); // XXX
434 frame->set_position(vfpos-leftmost_frame);
435 frame->set_videoframe(vframeno, rightend);
441 VideoTimeLine::translated_filename ()
444 return video_filename;
446 return video_map_path(server_docroot, video_filename);
451 VideoTimeLine::video_file_info (std::string filename, bool local)
455 if (filename.at(0) == G_DIR_SEPARATOR || !local_file) {
456 video_filename = filename;
458 video_filename = Glib::build_filename (_session->session_directory().video_path(), filename);
461 long long int _duration;
462 double _start_offset;
464 if (!video_query_info(
465 video_server_url, translated_filename(),
466 video_file_fps, _duration, _start_offset, video_aspect_ratio)) {
467 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;
468 GuiUpdate("video-unavailable");
471 video_duration = _duration * _session->nominal_frame_rate() / video_file_fps;
472 video_start_offset = _start_offset * _session->nominal_frame_rate();
474 if (auto_set_session_fps && video_file_fps != _session->timecode_frames_per_second()) {
475 switch ((int)floorf(video_file_fps*1000.0)) {
477 _session->config.set_timecode_format(timecode_23976);
480 _session->config.set_timecode_format(timecode_24);
484 _session->config.set_timecode_format(timecode_24976);
487 _session->config.set_timecode_format(timecode_25);
490 _session->config.set_timecode_format(timecode_2997drop);
493 _session->config.set_timecode_format(timecode_30);
496 _session->config.set_timecode_format(timecode_5994);
499 _session->config.set_timecode_format(timecode_60);
502 warning << _("Failed to set session-framerate: ") << video_file_fps << _(" does not have a corresponding option setting in Ardour.") << endmsg; /* TODO: gettext arg */
505 _session->config.set_video_pullup(0); /* TODO only set if set_timecode_format() was successful ?!*/
507 if (floor(video_file_fps*100) != floor(_session->timecode_frames_per_second()*100)) {
508 warning << _("Video file's framerate is not equal to Ardour session timecode's framerate: ")
509 << video_file_fps << _(" vs ") << _session->timecode_frames_per_second() << endmsg;
511 flush_local_cache ();
513 if (found_xjadeo() && local_file) {
514 GuiUpdate("set-xjadeo-sensitive-on");
515 if (vmonitor && vmonitor->is_started()) {
517 /* xjadeo <= 0.6.4 has a bug where changing the video-file may segfauls
518 * if the geometry changes to a different line-size alignment
520 reopen_vmonitor = true;
523 vmonitor->set_fps(video_file_fps);
524 vmonitor->open(video_filename);
527 } else if (!local_file) {
528 #if 1 /* temp debug/devel message */
529 // TODO - call xjremote remotely.
530 printf("the given video file can not be accessed on localhost, video monitoring is not currently supported for this case\n");
531 GuiUpdate("set-xjadeo-sensitive-off");
535 GuiUpdate("video-available");
540 VideoTimeLine::check_server ()
544 snprintf(url, sizeof(url), "%s%sstatus"
545 , video_server_url.c_str()
546 , (video_server_url.length()>0 && video_server_url.at(video_server_url.length()-1) == '/')?"":"/"
548 char *res=curl_http_get(url, NULL);
550 if (strstr(res, "status: ok, online.")) { ok = true; }
557 VideoTimeLine::gui_update(std::string const & t) {
558 /* this is to be called via GuiUpdate() only. */
559 ENSURE_GUI_THREAD (*this, &VideoTimeLine::queue_visual_videotimeline_update)
560 if (t == "videotimeline-update") {
561 editor->queue_visual_videotimeline_update();
562 } else if (t == "set-xjadeo-active-off") {
563 editor->toggle_xjadeo_proc(0);
564 } else if (t == "set-xjadeo-active-on") {
565 editor->toggle_xjadeo_proc(1);
566 } else if (t == "set-xjadeo-sensitive-on") {
567 editor->set_xjadeo_sensitive(true);
568 } else if (t == "set-xjadeo-sensitive-off") {
569 editor->toggle_xjadeo_proc(0);
570 //close_video_monitor();
571 editor->set_xjadeo_sensitive(false);
572 } else if (t == "xjadeo-window-ontop-on") {
573 editor->toggle_xjadeo_viewoption(1, 1);
574 } else if (t == "xjadeo-window-ontop-off") {
575 editor->toggle_xjadeo_viewoption(1, 0);
576 } else if (t == "xjadeo-window-osd-timecode-on") {
577 editor->toggle_xjadeo_viewoption(2, 1);
578 } else if (t == "xjadeo-window-osd-timecode-off") {
579 editor->toggle_xjadeo_viewoption(2, 0);
580 } else if (t == "xjadeo-window-osd-frame-on") {
581 editor->toggle_xjadeo_viewoption(3, 1);
582 } else if (t == "xjadeo-window-osd-frame-off") {
583 editor->toggle_xjadeo_viewoption(3, 0);
584 } else if (t == "xjadeo-window-osd-box-on") {
585 editor->toggle_xjadeo_viewoption(4, 1);
586 } else if (t == "xjadeo-window-osd-box-off") {
587 editor->toggle_xjadeo_viewoption(4, 0);
588 } else if (t == "xjadeo-window-fullscreen-on") {
589 editor->toggle_xjadeo_viewoption(5, 1);
590 } else if (t == "xjadeo-window-fullscreen-off") {
591 editor->toggle_xjadeo_viewoption(5, 0);
592 } else if (t == "xjadeo-window-letterbox-on") {
593 editor->toggle_xjadeo_viewoption(6, 1);
594 } else if (t == "xjadeo-window-letterbox-off") {
595 editor->toggle_xjadeo_viewoption(6, 0);
596 } else if (t == "video-available") {
597 editor->set_close_video_sensitive(true);
598 } else if (t == "video-unavailable") {
599 editor->set_close_video_sensitive(false);
604 VideoTimeLine::set_height (int height) {
605 if (_session && bar_height != height) {
606 _session->set_dirty ();
613 VideoTimeLine::vmon_update () {
614 if (vmonitor && vmonitor->is_started()) {
615 vmonitor->set_offset(video_offset); // TODO proper re-init xjadeo w/o restart not just offset.
620 VideoTimeLine::flush_local_cache () {
626 VideoTimeLine::flush_cache () {
629 snprintf(url, sizeof(url), "%s%sadmin/flush_cache"
630 , video_server_url.c_str()
631 , (video_server_url.length()>0 && video_server_url.at(video_server_url.length()-1) == '/')?"":"/"
633 char *res=curl_http_get(url, NULL);
637 if (vmonitor && vmonitor->is_started()) {
638 reopen_vmonitor=true;
641 video_file_info(video_filename, local_file);
646 VideoTimeLine::parameter_changed (std::string const & p)
648 if (p == "video-server-url") {
649 set_video_server_url (video_get_server_url(Config));
650 } else if (p == "video-server-docroot") {
651 set_video_server_docroot (video_get_docroot(Config));
652 } else if (p == "video-advanced-setup") {
653 set_video_server_url (video_get_server_url(Config));
654 set_video_server_docroot (video_get_docroot(Config));
656 if (p == "use-video-file-fps" || p == "videotimeline-pullup" ) { /* session->config parameter */
662 VideoTimeLine::set_video_server_url(std::string vsu) {
663 flush_local_cache ();
664 video_server_url = vsu;
669 VideoTimeLine::set_video_server_docroot(std::string vsr) {
670 flush_local_cache ();
671 server_docroot = vsr;
675 /* video-monitor for this timeline */
677 VideoTimeLine::find_xjadeo () {
678 std::string xjadeo_file_path;
679 if (getenv("XJREMOTE")) {
680 _xjadeo_bin = strdup(getenv("XJREMOTE")); // XXX TODO: free it?!
681 } else if (find_file_in_search_path (SearchPath(Glib::getenv("PATH")), X_("xjremote"), xjadeo_file_path)) {
682 _xjadeo_bin = xjadeo_file_path;
684 else if (Glib::file_test(X_("/Applications/Jadeo.app/Contents/MacOS/xjremote"), Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_EXECUTABLE)) {
685 _xjadeo_bin = X_("/Applications/Jadeo.app/Contents/MacOS/xjremote");
687 /* TODO: win32: allow to configure PATH to xjremote */
688 else if (Glib::file_test(X_("C:\\Program Files\\xjadeo\\xjremote.exe"), Glib::FILE_TEST_EXISTS)) {
689 _xjadeo_bin = X_("C:\\Program Files\\xjadeo\\xjremote.exe");
691 else if (Glib::file_test(X_("C:\\Program Files\\xjadeo\\xjremote.bat"), Glib::FILE_TEST_EXISTS)) {
692 _xjadeo_bin = X_("C:\\Program Files\\xjadeo\\xjremote.bat");
695 _xjadeo_bin = X_("");
696 warning << _("Video-monitor 'xjadeo' was not found. Please install http://xjadeo.sf.net/ "
697 "(a custom path to xjadeo can be specified by setting the XJREMOTE environment variable. "
698 "It should point to an application compatible with xjadeo's remote-control interface 'xjremote').")
704 VideoTimeLine::open_video_monitor() {
705 if (!found_xjadeo()) return;
707 vmonitor = new VideoMonitor(editor, _xjadeo_bin);
708 vmonitor->set_session(_session);
709 vmonitor->set_offset(video_offset);
710 vmonitor->Terminated.connect (sigc::mem_fun (*this, &VideoTimeLine::terminated_video_monitor));
711 vmonitor->UiState.connect (*this, invalidator (*this), boost::bind (&VideoTimeLine::gui_update, this, _1), gui_context());
712 } else if (vmonitor->is_started()) {
718 * the idea is to selective ignore certain monitor window
719 * states if xjadeo is not running on the same host as ardour.
720 * However with the removal of the video-monitor-startup-dialogue
721 * (git rev 5a4d0fff0) these settings are currently not accessible.
723 int xj_settings_mask = vmonitor->restore_settings_mask();
725 /* load mask from Session */
726 XMLNode* node = _session->extra_xml (X_("XJRestoreSettings"));
728 const XMLProperty* prop = node->property (X_("mask"));
730 xj_settings_mask = atoi(prop->value());
735 vmonitor->restore_settings_mask(xj_settings_mask);
738 if (!vmonitor->start()) {
739 warning << "launching xjadeo failed.." << endmsg;
740 close_video_monitor();
742 GuiUpdate("set-xjadeo-active-on");
743 vmonitor->set_fps(video_file_fps);
744 vmonitor->open(video_filename);
747 XMLNode* node = _session->extra_xml (X_("Videomonitor"));
749 const XMLProperty* prop = node->property (X_("active"));
750 if (prop && prop->value() != "yes") _session->set_dirty ();
752 _session->set_dirty ();
760 VideoTimeLine::close_video_monitor() {
761 if (vmonitor && vmonitor->is_started()) {
767 VideoTimeLine::control_video_monitor(int what, int param) {
768 if (!vmonitor || !vmonitor->is_started()) {
771 vmonitor->send_cmd(what, param);
776 VideoTimeLine::terminated_video_monitor () {
778 vmonitor->save_session();
781 GuiUpdate("set-xjadeo-active-off");
783 if (reopen_vmonitor) {
784 reopen_vmonitor=false;
785 open_video_monitor();
788 _session->set_dirty ();
794 VideoTimeLine::manual_seek_video_monitor (framepos_t pos)
796 if (!vmonitor) { return; }
797 if (!vmonitor->is_started()) { return; }
798 if (!vmonitor->synced_by_manual_seeks()) { return; }
799 vmonitor->manual_seek(pos, false, video_offset); // XXX -> set offset in xjadeo