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