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