2 Copyright (C) 2010 Paul Davis
3 Author: Robin Gareus <robin@gareus.org>
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.
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.
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.
20 #ifndef __gtk_ardour_transcode_video_dialog_h__
21 #define __gtk_ardour_transcode_video_dialog_h__
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>
35 #include "ardour/types.h"
36 #include "ardour/template_utils.h"
37 #include "ardour_dialog.h"
39 #include "transcode_ffmpeg.h"
41 enum VtlTranscodeOption {
42 VTL_IMPORT_REFERENCE = 0,
43 VTL_IMPORT_TRANSCODED = 1,
44 VTL_IMPORT_NO_VIDEO = 2
47 /** @class TranscodeVideoDialog
48 * @brief dialog-box and controller for importing video-files
50 class TranscodeVideoDialog : public ArdourDialog , public PBD::ScopedConnectionList
53 TranscodeVideoDialog (ARDOUR::Session*, std::string);
54 ~TranscodeVideoDialog ();
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 (); }
61 void on_response (int response_id) {
62 Gtk::Dialog::on_response (response_id);
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 ();
80 bool pending_audio_extract;
81 std::string audiofile;
85 PBD::Signal0<void> StartNextStage;
87 void update_progress (ARDOUR::framecnt_t, ARDOUR::framecnt_t);
89 TranscodeFfmpeg *transcoder;
91 Gtk::Label path_label;
92 Gtk::Entry path_entry;
93 Gtk::Button browse_button;
94 Gtk::Button transcode_button;
97 Gtk::Button *cancel_button;
98 Gtk::Button abort_button;
100 Gtk::VBox* progress_box;
101 Gtk::Label progress_label;
102 Gtk::ProgressBar pbar;
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;
120 #endif /* __gtk_ardour_transcode_video_dialog_h__ */