#include <fcntl.h>
#include <sigc++/bind.h>
-#include <libgen.h>
+
+#include <glib/gstdio.h>
#include "pbd/error.h"
#include "pbd/convert.h"
#include "ardour_ui.h"
#include "gui_thread.h"
-#include "utils.h"
#include "opts.h"
#include "transcode_video_dialog.h"
#include "utils_videotl.h"
bool ffok = false;
if (!transcoder->ffexec_ok()) {
- l = manage (new Label (_("No ffprobe or ffmpeg executables could be found on this system. Video Import is not possible until you install those tools. See the Log widow for more information."), Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, false));
+ l = manage (new Label (_("No ffprobe or ffmpeg executables could be found on this system. Video Import is not possible until you install those tools. See the Log window for more information."), Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, false));
l->set_line_wrap();
options_box->pack_start (*l, false, true, 4);
aspect_checkbox.set_sensitive(false);
options_box->pack_start (*l, false, true, 4);
video_combo.set_name ("PaddedButton");
- video_combo.append_text(_("Do Not Import Video"));
- video_combo.append_text(_("Reference From Current Location"));
+ video_combo.append_text(_("Reference From Current Location (Previously Transcoded Files Only)"));
if (ffok) {
video_combo.append_text(_("Import/Transcode Video to Session"));
- video_combo.set_active(2);
- } else {
video_combo.set_active(1);
+ } else {
+ video_combo.set_active(0);
video_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);
t->attach (*l, 0, 1, 2, 3);
audio_combo.set_name ("PaddedButton");
t->attach (audio_combo, 1, 4, 2, 3);
- audio_combo.append_text("No audio");
- if (as.size() > 0) {
+ if (as.size() == 0) {
+ audio_combo.append_text(_("No Audio Track Present"));
+ audio_combo.set_sensitive(false);
+ } else {
+ audio_combo.append_text(_("Do Not Extract Audio"));
for (TranscodeFfmpeg::FFAudioStreams::iterator it = as.begin(); it < as.end(); ++it) {
audio_combo.append_text((*it).name);
}
TranscodeVideoDialog::finished ()
{
if (aborted) {
- unlink(path_entry.get_text().c_str());
+ ::g_unlink(path_entry.get_text().c_str());
if (!audiofile.empty()) {
- unlink(audiofile.c_str());
+ ::g_unlink(audiofile.c_str());
}
Gtk::Dialog::response(RESPONSE_CANCEL);
} else {
void
TranscodeVideoDialog::launch_transcode ()
{
- if (video_combo.get_active_row_number() != 2) {
+ if (video_combo.get_active_row_number() != 1) {
launch_audioonly();
return;
}
void
TranscodeVideoDialog::video_combo_changed ()
{
- int i = video_combo.get_active_row_number();
- if (i != 2) {
+ const int i = video_combo.get_active_row_number();
+ if (i != 1) {
scale_combo.set_sensitive(false);
aspect_checkbox.set_sensitive(false);
height_spinner.set_sensitive(false);
bitrate_checkbox.set_sensitive(true);
bitrate_spinner.set_sensitive(true);
}
+ if (i == 2 && audio_combo.get_active_row_number() == 0) {
+ audio_combo.set_active(1);
+ }
}
void
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