13
0

tweak A/V import logic

This commit is contained in:
Robin Gareus 2014-03-19 18:12:16 +01:00
parent 01082ff941
commit 7e2518ec77
2 changed files with 22 additions and 13 deletions

View File

@ -177,16 +177,18 @@ TranscodeVideoDialog::TranscodeVideoDialog (Session* s, std::string infile)
options_box->pack_start (*l, false, true, 4); options_box->pack_start (*l, false, true, 4);
video_combo.set_name ("PaddedButton"); video_combo.set_name ("PaddedButton");
video_combo.append_text(_("Do Not Import Video")); video_combo.append_text(_("Reference From Current Location (Previously Transcoded Files Only)"));
video_combo.append_text(_("Reference From Current Location"));
if (ffok) { if (ffok) {
video_combo.append_text(_("Import/Transcode Video to Session")); video_combo.append_text(_("Import/Transcode Video to Session"));
video_combo.set_active(2);
} else {
video_combo.set_active(1); video_combo.set_active(1);
} else {
video_combo.set_active(0);
video_combo.set_sensitive(false); video_combo.set_sensitive(false);
audio_combo.set_sensitive(false); audio_combo.set_sensitive(false);
} }
if (as.size() > 0) {
video_combo.append_text(_("Do Not Import Video (Audio Import Only)"));
}
options_box->pack_start (video_combo, false, false, 4); options_box->pack_start (video_combo, false, false, 4);
@ -226,10 +228,10 @@ TranscodeVideoDialog::TranscodeVideoDialog (Session* s, std::string infile)
audio_combo.set_name ("PaddedButton"); audio_combo.set_name ("PaddedButton");
t->attach (audio_combo, 1, 4, 2, 3); t->attach (audio_combo, 1, 4, 2, 3);
if (as.size() == 0) { if (as.size() == 0) {
audio_combo.append_text(_("No audio Track Present")); audio_combo.append_text(_("No Audio Track Present"));
audio_combo.set_sensitive(false); audio_combo.set_sensitive(false);
} else { } else {
audio_combo.append_text(_("Do not Extract Audio")); audio_combo.append_text(_("Do Not Extract Audio"));
for (TranscodeFfmpeg::FFAudioStreams::iterator it = as.begin(); it < as.end(); ++it) { for (TranscodeFfmpeg::FFAudioStreams::iterator it = as.begin(); it < as.end(); ++it) {
audio_combo.append_text((*it).name); audio_combo.append_text((*it).name);
} }
@ -367,7 +369,7 @@ TranscodeVideoDialog::dialog_progress_mode ()
void void
TranscodeVideoDialog::launch_transcode () TranscodeVideoDialog::launch_transcode ()
{ {
if (video_combo.get_active_row_number() != 2) { if (video_combo.get_active_row_number() != 1) {
launch_audioonly(); launch_audioonly();
return; return;
} }
@ -416,8 +418,8 @@ TranscodeVideoDialog::launch_transcode ()
void void
TranscodeVideoDialog::video_combo_changed () TranscodeVideoDialog::video_combo_changed ()
{ {
int i = video_combo.get_active_row_number(); const int i = video_combo.get_active_row_number();
if (i != 2) { if (i != 1) {
scale_combo.set_sensitive(false); scale_combo.set_sensitive(false);
aspect_checkbox.set_sensitive(false); aspect_checkbox.set_sensitive(false);
height_spinner.set_sensitive(false); height_spinner.set_sensitive(false);
@ -430,12 +432,19 @@ TranscodeVideoDialog::video_combo_changed ()
bitrate_checkbox.set_sensitive(true); bitrate_checkbox.set_sensitive(true);
bitrate_spinner.set_sensitive(true); bitrate_spinner.set_sensitive(true);
} }
if (i == 2 && audio_combo.get_active_row_number() == 0) {
audio_combo.set_active(1);
}
} }
void void
TranscodeVideoDialog::audio_combo_changed () TranscodeVideoDialog::audio_combo_changed ()
{ {
; if (video_combo.get_active_row_number() == 2
&& audio_combo.get_active_row_number() == 0)
{
audio_combo.set_active(1);
}
} }
void void

View File

@ -31,9 +31,9 @@
#include "transcode_ffmpeg.h" #include "transcode_ffmpeg.h"
enum VtlTranscodeOption { enum VtlTranscodeOption {
VTL_IMPORT_NO_VIDEO = 0, VTL_IMPORT_REFERENCE = 0,
VTL_IMPORT_REFERENCE = 1, VTL_IMPORT_TRANSCODED = 1,
VTL_IMPORT_TRANSCODED = 2 VTL_IMPORT_NO_VIDEO = 2
}; };
/** @class TranscodeVideoDialog /** @class TranscodeVideoDialog