ae0beafd37ff0484ba67cb8de0b23b9e94bc7be7
[ardour.git] / gtk2_ardour / export_video_dialog.h
1 /*
2     Copyright (C) 2010 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_export_video_dialog_h__
23 #define __gtk_ardour_export_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 "ardour_dialog.h"
32
33 #include "transcode_ffmpeg.h"
34
35 /** @class ExportVideoDialog
36  *  @brief dialog box and controller for video-file export
37  *
38  *  The ExportVideoDialog includes audio export functions,
39  *  video-encoder presets, progress dialogs and uses
40  *  \ref TranscodeFfmpeg to communicate with ffmpeg.
41  */
42 class ExportVideoDialog : public ArdourDialog , public PBD::ScopedConnectionList
43 {
44   public:
45         ExportVideoDialog (PublicEditor&, ARDOUR::Session*);
46         ~ExportVideoDialog ();
47
48         std::string get_exported_filename () { return outfn_path_entry.get_text(); }
49
50   private:
51         PublicEditor& editor;
52
53         void on_show ();
54         void abort_clicked ();
55         void launch_export ();
56         void encode_pass (int);
57         void change_file_extension (std::string);
58
59         void open_outfn_dialog ();
60         void open_invid_dialog ();
61         void scale_checkbox_toggled ();
62         void preset_combo_changed ();
63         void video_codec_combo_changed ();
64         void aspect_checkbox_toggled ();
65         void fps_checkbox_toggled ();
66
67         bool aborted;
68         bool twopass;
69
70         void finished ();
71         void update_progress (ARDOUR::framecnt_t, ARDOUR::framecnt_t);
72
73         TranscodeFfmpeg *transcoder;
74         std::string insnd;
75
76         Gtk::Label        outfn_path_label;
77         Gtk::Entry        outfn_path_entry;
78         Gtk::Button       outfn_browse_button;
79         Gtk::Label        invid_path_label;
80         Gtk::Entry        invid_path_entry;
81         Gtk::Button       invid_browse_button;
82         Gtk::ComboBoxText insnd_combo;
83         Gtk::Button       transcode_button;
84
85         Gtk::VBox* vbox;
86         Gtk::Button *cancel_button;
87         Gtk::Button abort_button;
88
89         Gtk::VBox*  progress_box;
90         Gtk::ProgressBar pbar;
91
92         Gtk::ComboBoxText audio_codec_combo;
93         Gtk::ComboBoxText video_codec_combo;
94         Gtk::ComboBoxText video_bitrate_combo;
95         Gtk::ComboBoxText audio_bitrate_combo;
96         Gtk::ComboBoxText audio_samplerate_combo;
97         Gtk::ComboBoxText preset_combo;
98
99         Gtk::CheckButton  scale_checkbox;
100         Gtk::Adjustment   width_adjustment;
101         Gtk::SpinButton   width_spinner;
102         Gtk::Adjustment   height_adjustment;
103         Gtk::SpinButton   height_spinner;
104         Gtk::CheckButton  aspect_checkbox;
105         Gtk::ComboBoxText aspect_combo;
106         Gtk::CheckButton  normalize_checkbox;
107         Gtk::CheckButton  twopass_checkbox;
108         Gtk::CheckButton  optimizations_checkbox;
109         Gtk::Label        optimizations_label;
110         Gtk::CheckButton  deinterlace_checkbox;
111         Gtk::CheckButton  bframes_checkbox;
112         Gtk::CheckButton  fps_checkbox;
113         Gtk::ComboBoxText fps_combo;
114         Gtk::CheckButton  meta_checkbox;
115 #if 1 /* tentative debug mode */
116         Gtk::CheckButton  debug_checkbox;
117 #endif
118 };
119
120 #endif /* __gtk_ardour_export_video_dialog_h__ */
121
122 #endif /* WITH_VIDEOTIMELINE */