2013-03-12 17:00:09 -04:00
|
|
|
/*
|
2019-08-02 17:26:43 -04:00
|
|
|
* Copyright (C) 2013-2017 Robin Gareus <robin@gareus.org>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
2013-03-12 17:00:09 -04:00
|
|
|
#ifndef __gtk_ardour_transcode_video_dialog_h__
|
|
|
|
#define __gtk_ardour_transcode_video_dialog_h__
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
2017-07-16 21:48:18 -04:00
|
|
|
#include <gtkmm/adjustment.h>
|
|
|
|
#include <gtkmm/box.h>
|
|
|
|
#include <gtkmm/button.h>
|
|
|
|
#include <gtkmm/checkbutton.h>
|
|
|
|
#include <gtkmm/comboboxtext.h>
|
|
|
|
#include <gtkmm/entry.h>
|
2022-02-07 16:46:23 -05:00
|
|
|
#include <gtkmm/label.h>
|
2017-07-16 21:48:18 -04:00
|
|
|
#include <gtkmm/progressbar.h>
|
|
|
|
#include <gtkmm/spinbutton.h>
|
2013-03-12 17:00:09 -04:00
|
|
|
|
|
|
|
#include "ardour/template_utils.h"
|
2022-02-07 16:46:23 -05:00
|
|
|
#include "ardour/types.h"
|
2013-03-12 17:00:09 -04:00
|
|
|
#include "ardour_dialog.h"
|
|
|
|
|
|
|
|
#include "transcode_ffmpeg.h"
|
|
|
|
|
2013-03-29 07:20:09 -04:00
|
|
|
enum VtlTranscodeOption {
|
2022-02-07 16:46:23 -05:00
|
|
|
VTL_IMPORT_REFERENCE = 0,
|
|
|
|
VTL_IMPORT_TRANSCODED = 1,
|
|
|
|
VTL_IMPORT_NO_VIDEO = 2
|
2013-03-29 07:20:09 -04:00
|
|
|
};
|
|
|
|
|
2013-03-12 17:00:09 -04:00
|
|
|
/** @class TranscodeVideoDialog
|
|
|
|
* @brief dialog-box and controller for importing video-files
|
|
|
|
*/
|
2022-02-07 16:46:23 -05:00
|
|
|
class TranscodeVideoDialog : public ArdourDialog, public PBD::ScopedConnectionList
|
2013-03-12 17:00:09 -04:00
|
|
|
{
|
2017-07-01 15:11:14 -04:00
|
|
|
public:
|
2013-03-12 17:00:09 -04:00
|
|
|
TranscodeVideoDialog (ARDOUR::Session*, std::string);
|
|
|
|
~TranscodeVideoDialog ();
|
|
|
|
|
2013-03-29 07:20:09 -04:00
|
|
|
VtlTranscodeOption import_option ();
|
2013-03-12 17:00:09 -04:00
|
|
|
|
2022-02-07 16:46:23 -05:00
|
|
|
std::string get_filename ()
|
|
|
|
{
|
|
|
|
return path_entry.get_text ();
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string get_audiofile ()
|
|
|
|
{
|
|
|
|
return audiofile;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool detect_ltc ()
|
|
|
|
{
|
|
|
|
return ltc_detect.get_active ();
|
|
|
|
}
|
|
|
|
|
|
|
|
void on_response (int response_id)
|
|
|
|
{
|
2017-04-20 13:03:52 -04:00
|
|
|
Gtk::Dialog::on_response (response_id);
|
|
|
|
}
|
|
|
|
|
2017-07-01 15:11:14 -04:00
|
|
|
private:
|
2013-03-12 17:00:09 -04:00
|
|
|
void on_show ();
|
|
|
|
void open_browse_dialog ();
|
|
|
|
void abort_clicked ();
|
|
|
|
void scale_combo_changed ();
|
|
|
|
void audio_combo_changed ();
|
2013-03-29 07:20:09 -04:00
|
|
|
void video_combo_changed ();
|
2013-03-12 17:00:09 -04:00
|
|
|
void aspect_checkbox_toggled ();
|
|
|
|
void bitrate_checkbox_toggled ();
|
|
|
|
void update_bitrate ();
|
|
|
|
void launch_audioonly ();
|
|
|
|
void launch_transcode ();
|
2017-07-01 15:11:14 -04:00
|
|
|
void launch_extract ();
|
2013-03-12 17:00:09 -04:00
|
|
|
void dialog_progress_mode ();
|
2022-02-07 16:46:23 -05:00
|
|
|
void finished (int);
|
|
|
|
void update_progress (ARDOUR::samplecnt_t, ARDOUR::samplecnt_t);
|
|
|
|
|
|
|
|
bool aborted;
|
|
|
|
bool pending_audio_extract;
|
2013-03-12 17:00:09 -04:00
|
|
|
std::string audiofile;
|
|
|
|
std::string infn;
|
2022-02-07 16:46:23 -05:00
|
|
|
double m_aspect;
|
2013-03-12 17:00:09 -04:00
|
|
|
|
|
|
|
PBD::Signal0<void> StartNextStage;
|
|
|
|
|
2022-02-07 16:46:23 -05:00
|
|
|
TranscodeFfmpeg* transcoder;
|
2013-03-12 17:00:09 -04:00
|
|
|
|
2022-02-07 16:46:23 -05:00
|
|
|
Gtk::Label path_label;
|
|
|
|
Gtk::Entry path_entry;
|
|
|
|
Gtk::Button browse_button;
|
|
|
|
Gtk::Button transcode_button;
|
2013-03-12 17:00:09 -04:00
|
|
|
|
2022-02-07 16:46:23 -05:00
|
|
|
Gtk::VBox* vbox;
|
|
|
|
Gtk::Button* cancel_button;
|
|
|
|
Gtk::Button abort_button;
|
2013-03-12 17:00:09 -04:00
|
|
|
|
2022-02-07 16:46:23 -05:00
|
|
|
Gtk::VBox* progress_box;
|
|
|
|
Gtk::Label progress_label;
|
2013-03-12 17:00:09 -04:00
|
|
|
Gtk::ProgressBar pbar;
|
|
|
|
|
2013-03-29 07:20:09 -04:00
|
|
|
Gtk::ComboBoxText video_combo;
|
2013-03-12 17:00:09 -04:00
|
|
|
Gtk::ComboBoxText scale_combo;
|
|
|
|
Gtk::CheckButton aspect_checkbox;
|
|
|
|
Gtk::Adjustment height_adjustment;
|
|
|
|
Gtk::SpinButton height_spinner;
|
|
|
|
Gtk::ComboBoxText audio_combo;
|
2015-09-20 12:37:39 -04:00
|
|
|
Gtk::CheckButton ltc_detect;
|
2013-03-12 17:00:09 -04:00
|
|
|
Gtk::CheckButton bitrate_checkbox;
|
|
|
|
Gtk::Adjustment bitrate_adjustment;
|
|
|
|
Gtk::SpinButton bitrate_spinner;
|
|
|
|
Gtk::CheckButton debug_checkbox;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __gtk_ardour_transcode_video_dialog_h__ */
|