Merge branch 'master' of git.ardour.org:ardour/ardour
[ardour.git] / gtk2_ardour / add_video_dialog.cc
1 /*
2     Copyright (C) 2010-2013 Paul Davis
3     Author: Robin Gareus <robin@gareus.org>
4
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.
9
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.
14
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.
18
19 */
20 #ifdef WITH_VIDEOTIMELINE
21
22 #include <cstdio>
23 #include <cmath>
24
25 #include <sigc++/bind.h>
26 #include <curl/curl.h>
27
28 #include "pbd/error.h"
29 #include "pbd/convert.h"
30 #include "gtkmm2ext/utils.h"
31 #include "gtkmm2ext/rgb_macros.h"
32 #include "ardour/session_directory.h"
33 #include "ardour/profile.h"
34 #include "ardour/template_utils.h"
35 #include "ardour/session.h"
36 #include "ardour_ui.h"
37
38 #include "utils.h"
39 #include "add_video_dialog.h"
40 #include "utils_videotl.h"
41 #include "i18n.h"
42
43 using namespace Gtk;
44 using namespace std;
45 using namespace PBD;
46 using namespace ARDOUR;
47
48 #define PREVIEW_WIDTH (240)
49 #define PREVIEW_HEIGHT (180)
50
51 #ifndef MIN
52 #define MIN(a,b) ( (a) < (b) ? (a) : (b) )
53 #endif
54
55 AddVideoDialog::AddVideoDialog (Session* s)
56         : ArdourDialog (_("Set Video Track"))
57         , seek_slider (0,1000,1)
58         , preview_path ("")
59         , pi_duration ("-", Gtk::ALIGN_RIGHT, Gtk::ALIGN_CENTER, false)
60         , pi_aspect ("-", Gtk::ALIGN_RIGHT, Gtk::ALIGN_CENTER, false)
61         , pi_fps ("-", Gtk::ALIGN_RIGHT, Gtk::ALIGN_CENTER, false)
62         , chooser (FILE_CHOOSER_ACTION_OPEN)
63         , xjadeo_checkbox (_("Launch External Video Monitor"))
64         , set_session_fps_checkbox (_("Adjust Session Framerate to Match Video Framerate"))
65         , harvid_path ("")
66         , harvid_reset (_("Reload docroot"))
67         , harvid_list (ListStore::create(harvid_list_columns))
68         , harvid_list_view (harvid_list)
69 {
70         set_session (s);
71         set_name ("AddVideoDialog");
72         set_position (Gtk::WIN_POS_MOUSE);
73         set_modal (true);
74         set_skip_taskbar_hint (true);
75         set_resizable (true);
76         set_size_request (800, -1);
77
78         harvid_initialized = false;
79         std::string dstdir = video_dest_dir(_session->session_directory().video_path(), Config->get_video_server_docroot());
80
81
82         /* Harvid Browser */
83         harvid_list_view.append_column("", pixBufRenderer);
84         harvid_list_view.append_column(_("Filename"), harvid_list_columns.filename);
85
86         harvid_list_view.get_column(0)->set_alignment(0.5);
87         harvid_list_view.get_column(0)->add_attribute(pixBufRenderer, "stock-id", harvid_list_columns.id);
88         harvid_list_view.get_column(1)->set_expand(true);
89         harvid_list_view.get_column(1)->set_sort_column(harvid_list_columns.filename);
90         harvid_list_view.set_enable_search(true);
91         harvid_list_view.set_search_column(1);
92
93
94         //Glib::RefPtr<Gtk::TreeModelSort> refTreeModelSort = Gtk::TreeModelSort::create(harvid_list_view.get_model());
95         //refTreeModelSort->set_sort_column(harvid_list_columns.filename, Gtk::SORT_ASCENDING);
96         //harvid_list_view.set_model(refTreeModelSort);
97
98         harvid_list_view.get_selection()->set_mode (SELECTION_SINGLE);
99
100         harvid_list_view.get_selection()->signal_changed().connect(sigc::mem_fun(*this, &AddVideoDialog::harvid_list_view_selected));
101         harvid_list_view.signal_row_activated().connect (sigc::mem_fun (*this, &AddVideoDialog::harvid_list_view_activated));
102
103         VBox* vbox = manage (new VBox);
104         Gtk::ScrolledWindow *scroll = manage(new ScrolledWindow);
105         scroll->add(harvid_list_view);
106         scroll->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
107
108         HBox* hbox = manage (new HBox);
109         harvid_path.set_alignment (0, 0.5);
110         hbox->pack_start (harvid_path, true, true);
111         hbox->pack_start (harvid_reset, false, false);
112
113         vbox->pack_start (*hbox, false, false);
114         vbox->pack_start (*scroll, true, true);
115
116         notebook.append_page (*vbox, _("VideoServerIndex"));
117
118
119
120         /* file chooser */
121         chooser.set_border_width (4);
122 #ifdef GTKOSX
123         /* some broken redraw behaviour - this is a bandaid */
124         chooser.signal_selection_changed().connect (mem_fun (chooser, &Widget::queue_draw));
125 #endif
126         chooser.set_current_folder (dstdir);
127
128         Gtk::FileFilter video_filter;
129         Gtk::FileFilter matchall_filter;
130         video_filter.add_custom (FILE_FILTER_FILENAME, mem_fun(*this, &AddVideoDialog::on_video_filter));
131         video_filter.set_name (_("Video files"));
132
133         matchall_filter.add_pattern ("*.*");
134         matchall_filter.set_name (_("All files"));
135
136         chooser.add_filter (video_filter);
137         chooser.add_filter (matchall_filter);
138         chooser.set_select_multiple (false);
139
140         /* file import options */
141         import_combo.set_name ("PaddedButton");
142         import_combo.append_text(_("Reference From Current Location"));
143         import_combo.append_text(_("Hardlink or Copy to Session"));
144         import_combo.append_text(_("Transcode to Session"));
145         import_combo.set_active(2);
146
147         vbox = manage (new VBox);
148         vbox->pack_start (chooser, true, true, 0);
149         vbox->pack_start (import_combo, false, true, 4);
150
151         if (Config->get_video_server_docroot().size() > 0) {
152                 notebook.append_page (*vbox, _("Browse Files"));
153         }
154
155         /* Global Options*/
156         Gtk::Label* l;
157         VBox* options_box = manage (new VBox);
158
159         l = manage (new Label (_("<b>Options</b>"), Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, false));
160         l->set_use_markup ();
161
162         options_box->pack_start (*l, false, true, 4);
163         options_box->pack_start (xjadeo_checkbox, false, true, 2);
164         options_box->pack_start (set_session_fps_checkbox, false, true, 2);
165
166         /* preview pane */
167         VBox* previewpane = manage (new VBox);
168         Gtk::Table *table = manage(new Table(4,2));
169
170         table->set_row_spacings(2);
171         table->set_col_spacings(4);
172
173         l = manage (new Label (_("<b>Video Information</b>"), Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER, false));
174         l->set_use_markup ();
175         table->attach (*l, 0, 2, 0, 1, FILL, FILL);
176         l = manage (new Label (_("Duration:"), Gtk::ALIGN_RIGHT, Gtk::ALIGN_CENTER, false));
177         table->attach (*l, 0, 1, 1, 2, FILL, FILL);
178         table->attach (pi_duration, 1, 2, 1, 2, FILL, FILL);
179         l = manage (new Label (_("Frame rate:"), Gtk::ALIGN_RIGHT, Gtk::ALIGN_CENTER, false));
180         table->attach (*l, 0, 1, 2, 3, FILL, FILL);
181         table->attach (pi_fps, 1, 2, 2, 3, FILL, FILL);
182         l = manage (new Label (_("Aspect Ratio:"), Gtk::ALIGN_RIGHT, Gtk::ALIGN_CENTER, false));
183         table->attach (*l, 0, 1, 3, 4, FILL, FILL);
184         table->attach (pi_aspect, 1, 2, 3, 4, FILL, FILL);
185
186         preview_image = manage(new Gtk::Image);
187
188         imgbuf = Gdk::Pixbuf::create(Gdk::COLORSPACE_RGB, true, 8, PREVIEW_WIDTH, PREVIEW_HEIGHT);
189         imgbuf->fill(RGBA_TO_UINT(127,0,0,255));
190         preview_image->set(imgbuf);
191         seek_slider.set_draw_value(false);
192
193         hbox = manage (new HBox);
194         hbox->pack_start (*table, true, false);
195
196         Gtk::Alignment *al = manage(new Gtk::Alignment());
197         al->set_size_request(-1, 20);
198
199         previewpane->pack_start (*al, false, false);
200         previewpane->pack_start (*hbox, true, true, 6);
201         previewpane->pack_start (*preview_image, false, false);
202         previewpane->pack_start (seek_slider, false, false);
203
204         /* Overall layout */
205         hbox = manage (new HBox);
206         hbox->pack_start (notebook, true, true);
207         hbox->pack_start (*previewpane, false, false);
208
209         get_vbox()->set_spacing (4);
210         get_vbox()->pack_start (*hbox, true, true);
211         get_vbox()->pack_start (*options_box, false, false);
212
213
214         /* xjadeo checkbox */
215         if (ARDOUR_UI::instance()->video_timeline->found_xjadeo()
216                         /* TODO xjadeo setup w/ xjremote */
217                         && Config->get_video_server_docroot().size() > 0) {
218                 xjadeo_checkbox.set_active(true);  /* set in ardour_ui.cpp ?! */
219         } else {
220                 printf("xjadeo was not found or video-server docroot is unset (remote video-server)\n");
221                 xjadeo_checkbox.set_active(false);
222                 xjadeo_checkbox.set_sensitive(false);
223         }
224
225         /* FPS checkbox */
226         set_session_fps_checkbox.set_active(true);
227
228         /* Buttons */
229         add_button (Stock::CANCEL, RESPONSE_CANCEL);
230         ok_button = add_button (Stock::OK, RESPONSE_ACCEPT);
231         //ok_button->set_sensitive(false);
232         set_action_ok(false);
233
234         /* connect signals after eveything has been initialized */
235         chooser.signal_selection_changed().connect (mem_fun (*this, &AddVideoDialog::file_selection_changed));
236         chooser.signal_file_activated().connect (mem_fun (*this, &AddVideoDialog::file_activated));
237         //chooser.signal_update_preview().connect(sigc::mem_fun(*this, &AddVideoDialog::update_preview));
238         notebook.signal_switch_page().connect (sigc::hide_return (sigc::hide (sigc::hide (sigc::mem_fun (*this, &AddVideoDialog::page_switch)))));
239         seek_slider.signal_value_changed().connect(sigc::mem_fun(*this, &AddVideoDialog::seek_preview));
240         harvid_reset.signal_clicked().connect (sigc::mem_fun (*this, &AddVideoDialog::harvid_load_docroot));
241
242         show_all_children ();
243 }
244
245 AddVideoDialog::~AddVideoDialog ()
246 {
247 }
248
249 void
250 AddVideoDialog::on_show ()
251 {
252         Dialog::on_show ();
253 }
254
255 static bool check_video_file_extension(std::string file)
256 {
257         const char* suffixes[] = {
258                 ".avi"     , ".AVI"     ,
259                 ".mov"     , ".MOV"     ,
260                 ".ogg"     , ".OGG"     ,
261                 ".ogv"     , ".OGV"     ,
262                 ".mpg"     , ".MPG"     ,
263                 ".mov"     , ".MOV"     ,
264                 ".mp4"     , ".MP4"     ,
265                 ".mkv"     , ".MKV"     ,
266                 ".vob"     , ".VOB"     ,
267                 ".asf"     , ".ASF"     ,
268                 ".avs"     , ".AVS"     ,
269                 ".dts"     , ".DTS"     ,
270                 ".flv"     , ".FLV"     ,
271                 ".m4v"     , ".M4V"     ,
272                 ".matroska", ".MATROSKA",
273                 ".h264"    , ".H264"    ,
274                 ".dv"      , ".DV"      ,
275                 ".dirac"   , ".DIRAC"   ,
276                 ".webm"    , ".WEBM"    ,
277         };
278
279         for (size_t n = 0; n < sizeof(suffixes)/sizeof(suffixes[0]); ++n) {
280                 if (file.rfind (suffixes[n]) == file.length() - strlen (suffixes[n])) {
281                         return true;
282                 }
283         }
284
285         return false;
286 }
287
288 bool
289 AddVideoDialog::on_video_filter (const FileFilter::Info& filter_info)
290 {
291         return check_video_file_extension(filter_info.filename);
292 }
293
294 std::string
295 AddVideoDialog::file_name (bool &local_file)
296 {
297         int n = notebook.get_current_page ();
298         if (n == 1) {
299                 local_file = true;
300                 return chooser.get_filename();
301         } else {
302                 local_file = false;
303                 Gtk::TreeModel::iterator iter = harvid_list_view.get_selection()->get_selected();
304                 if(!iter) return "";
305
306                 std::string uri = (*iter)[harvid_list_columns.uri];
307                 std::string video_server_url = Config->get_video_server_url();
308
309                 /* check if video server is running locally */
310                 if (Config->get_video_server_docroot().size() > 0
311                                 && !video_server_url.compare(0, 16, "http://localhost"))
312                 {
313                         /* check if the file can be accessed */
314                         int plen;
315                         CURL *curl;
316                         curl = curl_easy_init();
317                         char *ue = curl_easy_unescape(curl, uri.c_str(), uri.length(), &plen);
318                         std::string path = Config->get_video_server_docroot() + ue;
319                         if (!::access(path.c_str(), R_OK)) {
320                                 uri = path;
321                                 local_file = true;
322                         }
323                         curl_easy_cleanup(curl);
324                         curl_free(ue);
325                 }
326                 return uri;
327         }
328 }
329
330 enum VtlImportOption
331 AddVideoDialog::import_option ()
332 {
333         int n = notebook.get_current_page ();
334         if (n == 0) { return VTL_IMPORT_NONE; }
335         int i = import_combo.get_active_row_number();
336         return static_cast<VtlImportOption>(i);
337 }
338
339 bool
340 AddVideoDialog::launch_xjadeo ()
341 {
342         return xjadeo_checkbox.get_active();
343 }
344
345 bool
346 AddVideoDialog::auto_set_session_fps ()
347 {
348         return set_session_fps_checkbox.get_active();
349 }
350
351 void
352 AddVideoDialog::set_action_ok (bool yn)
353 {
354         if (yn) {
355                 ok_button->set_sensitive(true);
356         } else {
357                 preview_path = "";
358                 pi_duration.set_text("-");
359                 pi_aspect.set_text("-");
360                 pi_fps.set_text("-");
361                 ok_button->set_sensitive(false);
362                 imgbuf->fill(RGBA_TO_UINT(0,0,0,255));
363                 video_draw_cross(imgbuf);
364                 preview_image->set(imgbuf);
365                 preview_image->show();
366         }
367 }
368
369 void
370 AddVideoDialog::file_selection_changed ()
371 {
372         if (chooser.get_filename().size() > 0) {
373                 std::string path = chooser.get_filename();
374                 bool ok =
375                                 check_video_file_extension(path)
376                                 &&  Glib::file_test(path.c_str(), Glib::FILE_TEST_IS_REGULAR | Glib::FILE_TEST_IS_SYMLINK)
377                                 && !Glib::file_test(path.c_str(), Glib::FILE_TEST_IS_DIR);
378                 set_action_ok(ok);
379                 if (ok) {
380                         request_preview(video_map_path(Config->get_video_server_docroot(), path));
381                 }
382         } else {
383                 set_action_ok(false);
384         }
385 }
386
387 void
388 AddVideoDialog::file_activated ()
389 {
390         if (chooser.get_filename().size() > 0) {
391                 std::string path = chooser.get_filename();
392                 // TODO check docroot -> set import options
393                 bool ok =
394                                 check_video_file_extension(path)
395                                 &&  Glib::file_test(path.c_str(), Glib::FILE_TEST_IS_REGULAR | Glib::FILE_TEST_IS_SYMLINK)
396                                 && !Glib::file_test(path.c_str(), Glib::FILE_TEST_IS_DIR);
397                 if (ok) {
398                         Gtk::Dialog::response(RESPONSE_ACCEPT);
399                 }
400         }
401 }
402
403 /**** Tree List Interaction ***/
404
405 void
406 AddVideoDialog::harvid_list_view_selected () {
407         Gtk::TreeModel::iterator iter = harvid_list_view.get_selection()->get_selected();
408         // TODO check docroot -> set import options, xjadeo
409         if(!iter) {
410                 set_action_ok(false);
411                 return;
412         }
413         if ((std::string)((*iter)[harvid_list_columns.id]) == Stock::DIRECTORY.id) {
414                 set_action_ok(false);
415         } else {
416                 set_action_ok(true);
417                 request_preview((*iter)[harvid_list_columns.uri]);
418         }
419 }
420
421 void
422 AddVideoDialog::harvid_list_view_activated (const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn*) {
423         Gtk::TreeModel::iterator iter = harvid_list->get_iter(path);
424         if (!iter) return;
425         std::string type = (*iter)[harvid_list_columns.id];
426         std::string url = (*iter)[harvid_list_columns.uri];
427
428 #if 0
429         printf ("A: %s %s %s\n",
430                         ((std::string)((*iter)[harvid_list_columns.id])).c_str(),
431                         ((std::string)((*iter)[harvid_list_columns.uri])).c_str(),
432                         ((std::string)((*iter)[harvid_list_columns.filename])).c_str());
433 #endif
434
435         if (type == Gtk::Stock::DIRECTORY.id) {
436                 harvid_request(url.c_str());
437         } else {
438                 Gtk::Dialog::response(RESPONSE_ACCEPT);
439         }
440 }
441
442 void
443 AddVideoDialog::harvid_load_docroot() {
444         set_action_ok(false);
445
446         std::string video_server_url = Config->get_video_server_url();
447         char url[2048];
448         snprintf(url, sizeof(url), "%s%sindex/"
449                 , video_server_url.c_str()
450                 , (video_server_url.length()>0 && video_server_url.at(video_server_url.length()-1) == '/')?"":"/");
451         harvid_request(url);
452         harvid_initialized = true;
453 }
454
455 bool
456 AddVideoDialog::page_switch() {
457         if (notebook.get_current_page () == 1) {
458                 file_selection_changed();
459                 return true;
460         }
461
462         if (harvid_initialized) {
463                 harvid_list_view_selected();
464         } else {
465                 harvid_load_docroot();
466         }
467         return true;
468 }
469
470 /**** Harvid HTTP interface ***/
471 void
472 AddVideoDialog::harvid_request(std::string u)
473 {
474         char url[2048];
475         int status;
476         snprintf(url, sizeof(url), "%s?format=csv", u.c_str());
477
478         harvid_list->clear();
479
480         char *res = curl_http_get(url, &status);
481         if (status != 200) {
482                 printf("request failed\n"); // XXX
483                 harvid_path.set_text(" - request failed -");
484                 free(res);
485                 return;
486         }
487
488         /* add up-to-parent */
489         size_t se = u.find_last_of("/", u.size()-2);
490         size_t ss = u.find("/index/");
491         if (se != string::npos && ss != string::npos && se > ss) {
492                 TreeModel::iterator new_row = harvid_list->append();
493                 TreeModel::Row row = *new_row;
494                 row[harvid_list_columns.id      ] = Gtk::Stock::DIRECTORY.id;
495                 row[harvid_list_columns.uri     ] = u.substr(0, se + 1);
496                 row[harvid_list_columns.filename] = X_("..");
497         }
498         if (se != string::npos) {
499                 int plen;
500                 std::string path = u.substr(ss + 6);
501                 CURL *curl;
502                 curl = curl_easy_init();
503                 char *ue = curl_easy_unescape(curl, path.c_str(), path.length(), &plen);
504                 harvid_path.set_text(std::string(ue));
505                 curl_easy_cleanup(curl);
506                 curl_free(ue);
507         } else {
508                 harvid_path.set_text(" ??? ");
509         }
510
511         if (!res) return;
512
513         std::vector<std::vector<std::string> > lines;
514         ParseCSV(std::string(res), lines);
515         for (std::vector<std::vector<std::string> >::iterator i = lines.begin(); i != lines.end(); ++i) {
516                 TreeModel::iterator new_row = harvid_list->append();
517                 TreeModel::Row row = *new_row;
518
519                 if (i->at(0) == X_("D")) {
520                         row[harvid_list_columns.id      ] = Gtk::Stock::DIRECTORY.id;
521                         row[harvid_list_columns.uri     ] = i->at(1).c_str();
522                         row[harvid_list_columns.filename] = i->at(2).c_str();
523                 } else {
524                         row[harvid_list_columns.id      ] = Gtk::Stock::MEDIA_PLAY.id;
525                         row[harvid_list_columns.uri     ] = i->at(2).c_str();
526                         row[harvid_list_columns.filename] = i->at(3).c_str();
527                 }
528         }
529
530         free(res);
531 }
532
533 void
534 AddVideoDialog::seek_preview()
535 {
536         if (preview_path.size() > 0)
537                 request_preview(preview_path);
538 }
539
540 void
541 AddVideoDialog::request_preview(std::string u)
542 {
543         std::string video_server_url = Config->get_video_server_url();
544
545         double video_file_fps;
546         long long int video_duration;
547         double video_start_offset;
548         double video_aspect_ratio;
549
550         int clip_width = PREVIEW_WIDTH;
551         int clip_height = PREVIEW_HEIGHT;
552         int clip_xoff, clip_yoff;
553
554         if (!video_query_info(video_server_url, u,
555                         video_file_fps, video_duration, video_start_offset, video_aspect_ratio))
556         {
557                 printf("image preview info request failed\n");
558                 // set_action_ok(false); // XXX only if docroot mismatch
559                 preview_path = "";
560                 pi_duration.set_text("-");
561                 pi_aspect.set_text("-");
562                 pi_fps.set_text("-");
563                 return;
564         }
565
566         if ((PREVIEW_WIDTH / (double)PREVIEW_HEIGHT) > video_aspect_ratio ) {
567                 clip_width = MIN(PREVIEW_WIDTH, rint(clip_height * video_aspect_ratio));
568         } else {
569                 clip_height = MIN(PREVIEW_HEIGHT, rint(clip_width / video_aspect_ratio));
570         }
571
572         pi_duration.set_text(string_compose("%1 sec", video_duration / video_file_fps));
573         pi_aspect.set_text(string_compose("%1", video_aspect_ratio));
574         pi_fps.set_text(string_compose("%1 fps", video_file_fps));
575
576         clip_xoff = (PREVIEW_WIDTH - clip_width)/2;
577         clip_yoff = (PREVIEW_HEIGHT - clip_height)/2;
578
579         char url[2048];
580         snprintf(url, sizeof(url), "%s%s?frame=%lli&w=%d&h=%di&file=%s&format=rgb"
581                 , video_server_url.c_str()
582                 , (video_server_url.length()>0 && video_server_url.at(video_server_url.length()-1) == '/')?"":"/"
583                 , (long long) (video_duration * seek_slider.get_value() / 1000.0)
584                 , clip_width, clip_height, u.c_str());
585
586         char *data = curl_http_get(url, NULL);
587         if (!data) {
588                 printf("image preview request failed %s\n", url);
589                 imgbuf->fill(RGBA_TO_UINT(0,0,0,255));
590                 video_draw_cross(imgbuf);
591                 preview_path = "";
592         } else {
593                 Glib::RefPtr<Gdk::Pixbuf> tmp;
594                 tmp = Gdk::Pixbuf::create_from_data ((guint8*) data, Gdk::COLORSPACE_RGB, false, 8, clip_width, clip_height, clip_width*3);
595                 if (clip_width != PREVIEW_WIDTH || clip_height != PREVIEW_HEIGHT) {
596                         imgbuf->fill(RGBA_TO_UINT(0,0,0,255));
597                 }
598                 tmp->copy_area (0, 0, clip_width, clip_height, imgbuf, clip_xoff, clip_yoff);
599                 preview_path = u;
600                 free(data);
601         }
602         preview_image->set(imgbuf);
603         preview_image->show();
604 }
605
606 #endif /* WITH_VIDEOTIMELINE */