replace Lock^Wshopping-bag icon with button-sensitivity
[ardour.git] / gtk2_ardour / export_video_dialog.cc
index 03b64cfbe387bab32061739647b6adbd54faa9d8..ce85fad81ef5c6129cb861c7bc00092239703740 100644 (file)
@@ -17,8 +17,6 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
 */
-#ifdef WITH_VIDEOTIMELINE
-
 #include <cstdio>
 #include <string>
 #include <sstream>
@@ -93,7 +91,6 @@ ExportVideoDialog::ExportVideoDialog (PublicEditor& ed, Session* s)
        set_session (s);
 
        set_name ("ExportVideoDialog");
-       set_position (Gtk::WIN_POS_MOUSE);
        set_modal (true);
        set_skip_taskbar_hint (true);
        set_resizable (false);
@@ -144,13 +141,13 @@ ExportVideoDialog::ExportVideoDialog (PublicEditor& ed, Session* s)
        vbox->pack_start (*path_hbox, false, false, 2);
 
        insnd_combo.set_name ("PaddedButton");
-       insnd_combo.append_text("from ardour session-start to session-end");
+       insnd_combo.append_text (string_compose (_("from the %1 session's start to the session's end"), PROGRAM_NAME));
 
        frameoffset_t av_offset = ARDOUR_UI::instance()->video_timeline->get_offset();
        if (av_offset < 0 ) {
-               insnd_combo.append_text("from 00:00:00:00 to video-end");
+               insnd_combo.append_text (_("from 00:00:00:00 to the video's end"));
        } else {
-               insnd_combo.append_text("from video-start to video-end");
+               insnd_combo.append_text (_("from the video's start to the video's end"));
        }
        insnd_combo.set_active(0);
 
@@ -158,12 +155,29 @@ ExportVideoDialog::ExportVideoDialog (PublicEditor& ed, Session* s)
        outfn_path_entry.set_text (_session->session_directory().export_path() + G_DIR_SEPARATOR +"export.avi");
 
        XMLNode* node = _session->extra_xml (X_("Videotimeline"));
-       if (node && node->property(X_("Filename"))) {
-               std::string filename = node->property(X_("Filename"))->value();
-               if (filename.at(0) != G_DIR_SEPARATOR) {
-                       filename = Glib::build_filename (_session->session_directory().video_path(), filename);
+       if (node) {
+               bool filenameset = false;
+               if (node->property(X_("OriginalVideoFile"))) {
+                       std::string filename = node->property(X_("OriginalVideoFile"))->value();
+                       if (Glib::file_test(filename, Glib::FILE_TEST_EXISTS)) {
+                               invid_path_entry.set_text (filename);
+                               filenameset = true;
+                       }
+               }
+               else if (!filenameset
+                               && node->property(X_("Filename"))
+                               && node->property(X_("LocalFile"))
+                               && node->property(X_("LocalFile"))->value() == X_("1")
+                               ) {
+                       std::string filename = node->property(X_("Filename"))->value();
+                       if (filename.at(0) != G_DIR_SEPARATOR) {
+                               filename = Glib::build_filename (_session->session_directory().video_path(), filename);
+                       }
+                       if (Glib::file_test(filename, Glib::FILE_TEST_EXISTS)) {
+                               invid_path_entry.set_text (filename);
+                               filenameset = true;
+                       }
                }
-               invid_path_entry.set_text (filename);
        }
 
        l = manage (new Label (_("<b>Settings:</b>"), Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, false));
@@ -419,7 +433,7 @@ ExportVideoDialog::launch_export ()
        cancel_button->hide();
        transcode_button.hide();
        pbar.set_size_request(300,-1);
-       pbar.set_text(_("Exporting Audio.."));
+       pbar.set_text(_("Exporting Audio..."));
        progress_box->show();
        aborted = false;
        twopass = twopass_checkbox.get_active();
@@ -544,7 +558,7 @@ ExportVideoDialog::launch_export ()
                Gtk::Dialog::response(RESPONSE_CANCEL);
                return;
        }
-       pbar.set_text (_("Encoding Video.."));
+       pbar.set_text (_("Encoding Video..."));
        encode_pass(1);
 }
 
@@ -584,7 +598,7 @@ ExportVideoDialog::encode_pass (int pass)
        ffs["-acodec"] = audio_codec_combo.get_active_text();
 
        if (video_bitrate_combo.get_active_text() == "retain" ) {
-               ffs["-sameq"]  = "-y"; // we use '-y' as dummy parameter for non key/value options
+               ffs["-qscale"]  = "0";
        } else {
                ffs["-b:v"]  = video_bitrate_combo.get_active_text();
        }
@@ -966,5 +980,3 @@ ExportVideoDialog::open_invid_dialog ()
                }
        }
 }
-
-#endif /* WITH_VIDEOTIMELINE */