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