Only show user-presets in favorite sidebar
[ardour.git] / gtk2_ardour / transcode_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_transcode_video_dialog_h__
21 #define __gtk_ardour_transcode_video_dialog_h__
22
23 #include <string>
24
25 #include <gtkmm/adjustment.h>
26 #include <gtkmm/box.h>
27 #include <gtkmm/button.h>
28 #include <gtkmm/checkbutton.h>
29 #include <gtkmm/comboboxtext.h>
30 #include <gtkmm/label.h>
31 #include <gtkmm/entry.h>
32 #include <gtkmm/progressbar.h>
33 #include <gtkmm/spinbutton.h>
34
35 #include "ardour/types.h"
36 #include "ardour/template_utils.h"
37 #include "ardour_dialog.h"
38
39 #include "transcode_ffmpeg.h"
40
41 enum VtlTranscodeOption {
42  VTL_IMPORT_REFERENCE = 0,
43  VTL_IMPORT_TRANSCODED = 1,
44  VTL_IMPORT_NO_VIDEO = 2
45 };
46
47 /** @class TranscodeVideoDialog
48  *  @brief dialog-box and controller for importing video-files
49  */
50 class TranscodeVideoDialog : public ArdourDialog , public PBD::ScopedConnectionList
51 {
52 public:
53         TranscodeVideoDialog (ARDOUR::Session*, std::string);
54         ~TranscodeVideoDialog ();
55
56         std::string get_filename () { return path_entry.get_text(); }
57         std::string get_audiofile () { return audiofile; }
58         VtlTranscodeOption import_option ();
59         bool detect_ltc () { return ltc_detect.get_active (); }
60
61         void on_response (int response_id) {
62                 Gtk::Dialog::on_response (response_id);
63         }
64
65 private:
66         void on_show ();
67         void open_browse_dialog ();
68         void abort_clicked ();
69         void scale_combo_changed ();
70         void audio_combo_changed ();
71         void video_combo_changed ();
72         void aspect_checkbox_toggled ();
73         void bitrate_checkbox_toggled ();
74         void update_bitrate ();
75         void launch_audioonly ();
76         void launch_transcode ();
77         void launch_extract ();
78         void dialog_progress_mode ();
79         bool aborted;
80         bool pending_audio_extract;
81         std::string audiofile;
82         std::string infn;
83         double m_aspect;
84
85         PBD::Signal0<void> StartNextStage;
86         void finished ();
87         void update_progress (ARDOUR::samplecnt_t, ARDOUR::samplecnt_t);
88
89         TranscodeFfmpeg *transcoder;
90
91         Gtk::Label        path_label;
92         Gtk::Entry        path_entry;
93         Gtk::Button       browse_button;
94         Gtk::Button       transcode_button;
95
96         Gtk::VBox* vbox;
97         Gtk::Button *cancel_button;
98         Gtk::Button abort_button;
99
100         Gtk::VBox*  progress_box;
101         Gtk::Label  progress_label;
102         Gtk::ProgressBar pbar;
103
104         Gtk::ComboBoxText video_combo;
105         Gtk::ComboBoxText scale_combo;
106         Gtk::CheckButton  aspect_checkbox;
107         Gtk::Adjustment   height_adjustment;
108         Gtk::SpinButton   height_spinner;
109         Gtk::ComboBoxText audio_combo;
110         Gtk::CheckButton  ltc_detect;
111         Gtk::CheckButton  bitrate_checkbox;
112         Gtk::Adjustment   bitrate_adjustment;
113         Gtk::SpinButton   bitrate_spinner;
114 #if 1 /* tentative debug mode */
115         Gtk::CheckButton  debug_checkbox;
116 #endif
117
118 };
119
120 #endif /* __gtk_ardour_transcode_video_dialog_h__ */