vtl: open-video dialog tweaks
[ardour.git] / gtk2_ardour / add_video_dialog.h
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 #ifndef __gtk_ardour_add_video_dialog_h__
23 #define __gtk_ardour_add_video_dialog_h__
24
25 #include <string>
26
27 #include <gtkmm.h>
28
29 #include "ardour/types.h"
30 #include "ardour/template_utils.h"
31 #include <gtkmm/filechooserwidget.h>
32 #include "ardour_dialog.h"
33
34 enum VtlImportOption {
35  VTL_IMPORT_NONE = 0,
36  VTL_IMPORT_TRANSCODE = 1,
37 };
38
39 class AddVideoDialog : public ArdourDialog
40 {
41   public:
42         AddVideoDialog (ARDOUR::Session*);
43         ~AddVideoDialog ();
44
45         std::string file_name (bool &local_file);
46         VtlImportOption import_option ();
47         bool launch_xjadeo ();
48         bool auto_set_session_fps ();
49
50   private:
51         void on_show ();
52         bool page_switch();
53         void set_action_ok(bool yn);
54
55         /* preview pane related */
56         void request_preview(std::string vpath);
57         void seek_preview();
58
59         Gtk::Image *preview_image;
60         Gtk::HScale seek_slider;
61         Glib::RefPtr<Gdk::Pixbuf> imgbuf;
62         std::string preview_path;
63         Gtk::Label pi_tcin;
64         Gtk::Label pi_tcout;
65         Gtk::Label pi_aspect;
66         Gtk::Label pi_fps;
67
68         /* file chooser related */
69         void file_selection_changed ();
70         void file_activated ();
71         bool on_video_filter (const Gtk::FileFilter::Info& filter_info);
72
73         Gtk::FileChooserWidget chooser;
74
75         Gtk::CheckButton  xjadeo_checkbox;
76         Gtk::CheckButton  set_session_fps_checkbox;
77         Gtk::Notebook notebook;
78         Gtk::Button *ok_button;
79
80         /* Harvid Browser related */
81         class HarvidColumns : public Gtk::TreeModel::ColumnRecord
82         {
83           public:
84                 Gtk::TreeModelColumn<std::string> id;
85                 Gtk::TreeModelColumn<std::string> uri;
86                 Gtk::TreeModelColumn<std::string> filename;
87
88                 HarvidColumns() {
89                         add(id);
90                         add(filename);
91                         add(uri);
92                 }
93         };
94
95         Gtk::CellRendererPixbuf pixBufRenderer;
96
97         void harvid_list_view_selected ();
98         void harvid_list_view_activated (const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn*);
99         void harvid_request(std::string u);
100         void harvid_load_docroot();
101
102         bool harvid_initialized;
103         Gtk::Label harvid_path;
104         Gtk::Button harvid_reset;
105         HarvidColumns harvid_list_columns;
106         Glib::RefPtr<Gtk::ListStore> harvid_list;
107         Gtk::TreeView harvid_list_view;
108 };
109
110 #endif /* __gtk_ardour_add_video_dialog_h__ */
111
112 #endif /* WITH_VIDEOTIMELINE */