Merge branch 'master' into cairocanvas
[ardour.git] / gtk2_ardour / editor_videotimeline.cc
index fcb1d31ba07df482bfe5a66d70e4e9c2c9c91f53..83a9745b893b1399f374610a447a351dc2a96c46 100644 (file)
@@ -35,6 +35,7 @@
 #include "export_video_infobox.h"
 #include "interthread_progress_window.h"
 
+#include "pbd/openuri.h"
 #include "i18n.h"
 
 using namespace std;
@@ -95,7 +96,7 @@ Editor::embed_audio_from_video (std::string path, framepos_t n)
        ipw.show ();
 
        boost::shared_ptr<ARDOUR::Track> track;
-       bool ok = (import_sndfiles (paths, Editing::ImportAsTrack, ARDOUR::SrcBest, n, 1, 1, track, false) == 0);
+       bool ok = (import_sndfiles (paths, Editing::ImportDistinctFiles, Editing::ImportAsTrack, ARDOUR::SrcBest, n, 1, 1, track, false) == 0);
        if (ok && track) {
                boost::shared_ptr<ARDOUR::Playlist> pl = track->playlist();
                pl->find_next_region(n, ARDOUR::End, 0)->set_video_locked(true);
@@ -108,16 +109,24 @@ Editor::embed_audio_from_video (std::string path, framepos_t n)
 }
 
 void
-Editor::export_video ()
+Editor::export_video (bool range)
 {
        if (ARDOUR::Config->get_show_video_export_info()) {
                ExportVideoInfobox infobox (_session);
-               infobox.run();
+               Gtk::ResponseType rv = (Gtk::ResponseType) infobox.run();
                if (infobox.show_again()) {
                        ARDOUR::Config->set_show_video_export_info(false);
                }
+               switch (rv) {
+                       case GTK_RESPONSE_YES:
+                               PBD::open_uri (ARDOUR::Config->get_reference_manual_url() + "/video-timeline/operations/#export");
+                               break;
+                       default:
+                               break;
+               }
        }
-       ExportVideoDialog dialog (*this, _session);
-       dialog.run();
+       ExportVideoDialog dialog (_session, get_selection().time, range);
+       Gtk::ResponseType r = (Gtk::ResponseType) dialog.run();
+       (void) r; // keep gcc quiet
        dialog.hide();
 }