NO-OP whitespace & foratting of header files
[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 "time_selection.h"
32 #include "transcode_ffmpeg.h"
33
34 /** @class ExportVideoDialog
35  *  @brief dialog box and controller for video-file export
36  *
37  *  The ExportVideoDialog includes audio export functions,
38  *  video-encoder presets, progress dialogs and uses
39  *  \ref TranscodeFfmpeg to communicate with ffmpeg.
40  */
41 class ExportVideoDialog : public ArdourDialog , public PBD::ScopedConnectionList
42 {
43 public:
44         ExportVideoDialog ();
45         ~ExportVideoDialog ();
46
47         std::string get_exported_filename () { return outfn_path_entry.get_text(); }
48
49         void apply_state(TimeSelection &tme, bool range);
50
51         XMLNode& get_state ();
52         void set_state (const XMLNode &);
53
54         void on_response (int response_id) {
55                 Gtk::Dialog::on_response (response_id);
56         }
57
58 private:
59         TimeSelection export_range;
60
61         void on_show ();
62         void abort_clicked ();
63         void launch_export ();
64         void encode_pass (int);
65         void change_file_extension (std::string);
66         void width_value_changed ();
67         void height_value_changed ();
68
69         void set_original_file_information ();
70
71         void open_outfn_dialog ();
72         void open_invid_dialog ();
73         void scale_checkbox_toggled ();
74         void preset_combo_changed ();
75         void video_codec_combo_changed ();
76         void aspect_checkbox_toggled ();
77         void fps_checkbox_toggled ();
78
79         bool _aborted;
80         bool _twopass;
81         bool _firstpass;
82         bool _normalize;
83
84         void finished ();
85         void update_progress (ARDOUR::framecnt_t, ARDOUR::framecnt_t);
86
87         boost::shared_ptr<ARDOUR::ExportStatus> status;
88         sigc::connection audio_progress_connection;
89         gint audio_progress_display ();
90         float _previous_progress;
91
92         TranscodeFfmpeg *_transcoder;
93         std::string _insnd;
94
95         float _video_source_aspect_ratio;
96         bool _suspend_signals;
97         bool _suspend_dirty;
98
99         Gtk::Label        outfn_path_label;
100         Gtk::Entry        outfn_path_entry;
101         Gtk::Button       outfn_browse_button;
102         Gtk::Label        invid_path_label;
103         Gtk::Entry        invid_path_entry;
104         Gtk::Button       invid_browse_button;
105         Gtk::ComboBoxText insnd_combo;
106         Gtk::Button       transcode_button;
107
108         Gtk::VBox* vbox;
109         Gtk::Button *cancel_button;
110         Gtk::Button abort_button;
111
112         Gtk::VBox*  progress_box;
113         Gtk::ProgressBar pbar;
114
115         Gtk::ComboBoxText audio_codec_combo;
116         Gtk::ComboBoxText video_codec_combo;
117         Gtk::ComboBoxText video_bitrate_combo;
118         Gtk::ComboBoxText audio_bitrate_combo;
119         Gtk::ComboBoxText audio_samplerate_combo;
120         Gtk::ComboBoxText preset_combo;
121
122         Gtk::CheckButton  scale_checkbox;
123         Gtk::CheckButton  scale_aspect;
124         Gtk::Adjustment   width_adjustment;
125         Gtk::SpinButton   width_spinner;
126         Gtk::Adjustment   height_adjustment;
127         Gtk::SpinButton   height_spinner;
128         Gtk::CheckButton  aspect_checkbox;
129         Gtk::ComboBoxText aspect_combo;
130         Gtk::CheckButton  normalize_checkbox;
131         Gtk::CheckButton  twopass_checkbox;
132         Gtk::CheckButton  optimizations_checkbox;
133         Gtk::Label        optimizations_label;
134         Gtk::CheckButton  deinterlace_checkbox;
135         Gtk::CheckButton  bframes_checkbox;
136         Gtk::CheckButton  fps_checkbox;
137         Gtk::ComboBoxText fps_combo;
138         Gtk::CheckButton  meta_checkbox;
139 #if 1 /* tentative debug mode */
140         Gtk::CheckButton  debug_checkbox;
141 #endif
142 };
143
144 #endif /* __gtk_ardour_export_video_dialog_h__ */