Optimize automation-event process splitting
[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 #ifdef interface
26 #undef interface
27 #endif
28
29 #include <gtkmm/box.h>
30 #include <gtkmm/button.h>
31 #include <gtkmm/cellrendererpixbuf.h>
32 #include <gtkmm/checkbutton.h>
33 #include <gtkmm/filechooserwidget.h>
34 #include <gtkmm/image.h>
35 #include <gtkmm/label.h>
36 #include <gtkmm/liststore.h>
37 #include <gtkmm/notebook.h>
38 #include <gtkmm/scale.h>
39 #include <gtkmm/treemodel.h>
40 #include <gtkmm/treeview.h>
41
42 #include "ardour/types.h"
43 #include "ardour/template_utils.h"
44 #include <gtkmm/filechooserwidget.h>
45 #include "ardour_dialog.h"
46
47 enum VtlImportOption {
48  VTL_IMPORT_NONE = 0,
49  VTL_IMPORT_TRANSCODE = 1,
50 };
51
52 class AddVideoDialog : public ArdourDialog
53 {
54 public:
55         AddVideoDialog (ARDOUR::Session*);
56         ~AddVideoDialog ();
57
58         std::string file_name (bool &local_file);
59         VtlImportOption import_option ();
60         bool launch_xjadeo ();
61         bool auto_set_session_fps ();
62
63 private:
64         void on_show ();
65         bool page_switch();
66         void set_action_ok(bool yn);
67         void clear_preview_image();
68
69         /* preview pane related */
70         void request_preview(std::string vpath);
71         void seek_preview();
72
73         Gtk::Image *preview_image;
74         Gtk::HScale seek_slider;
75         Glib::RefPtr<Gdk::Pixbuf> imgbuf;
76         std::string preview_path;
77         Gtk::Label pi_tcin;
78         Gtk::Label pi_tcout;
79         Gtk::Label pi_aspect;
80         Gtk::Label pi_fps;
81
82         /* file chooser related */
83         void file_selection_changed ();
84         void file_activated ();
85         bool on_video_filter (const Gtk::FileFilter::Info& filter_info);
86
87         Gtk::FileChooserWidget chooser;
88
89         Gtk::CheckButton  xjadeo_checkbox;
90         Gtk::CheckButton  set_session_fps_checkbox;
91         Gtk::Notebook notebook;
92         Gtk::Button *ok_button;
93
94         Gtk::VBox server_index_box;
95         Gtk::VBox file_chooser_box;
96         Gtk::HBox browser_container;
97
98         /* Harvid Browser related */
99         class HarvidColumns : public Gtk::TreeModel::ColumnRecord
100         {
101         public:
102                 Gtk::TreeModelColumn<std::string> id;
103                 Gtk::TreeModelColumn<std::string> uri;
104                 Gtk::TreeModelColumn<std::string> filename;
105
106                 HarvidColumns() {
107                         add(id);
108                         add(filename);
109                         add(uri);
110                 }
111         };
112
113         Gtk::CellRendererPixbuf pixBufRenderer;
114
115         void harvid_list_view_selected ();
116         void harvid_list_view_activated (const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn*);
117         void harvid_request(std::string u);
118         void harvid_load_docroot();
119
120         bool harvid_initialized;
121         Gtk::Label harvid_path;
122         Gtk::Button harvid_reset;
123         HarvidColumns harvid_list_columns;
124         Glib::RefPtr<Gtk::ListStore> harvid_list;
125         Gtk::TreeView harvid_list_view;
126
127         bool show_advanced;
128         bool loaded_docroot;
129 };
130
131 #endif /* __gtk_ardour_add_video_dialog_h__ */