Merge branch 'master' into cairocanvas
[ardour.git] / gtk2_ardour / editor_videotimeline.cc
index a4a0b1b2109a25a16b33a229dfb9468cd529d38f..83a9745b893b1399f374610a447a351dc2a96c46 100644 (file)
@@ -17,7 +17,6 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
 */
-#ifdef WITH_VIDEOTIMELINE
 
 #include <jack/types.h>
 
@@ -36,6 +35,7 @@
 #include "export_video_infobox.h"
 #include "interthread_progress_window.h"
 
+#include "pbd/openuri.h"
 #include "i18n.h"
 
 using namespace std;
@@ -46,9 +46,7 @@ Editor::set_video_timeline_height (const int h)
        if (videotl_bar_height == h) { return; }
        if (h < 2 || h > 8) { return; }
   videotl_bar_height = h;
-       const double nh = (videotl_bar_height * timebar_height - ((ARDOUR::Profile->get_sae())?1.0:0.0));
        videotl_label.set_size_request (-1, (int)timebar_height * videotl_bar_height);
-       videotl_bar->set_y1(nh);
        ARDOUR_UI::instance()->video_timeline->set_height(videotl_bar_height * timebar_height);
        update_ruler_visibility();
 }
@@ -56,16 +54,6 @@ Editor::set_video_timeline_height (const int h)
 void
 Editor::update_video_timeline (bool flush)
 {
-#if DEBUG
-       framepos_t rightmost_frame = leftmost_frame + current_page_frames();
-       std::cout << "VIDEO SCROLL: " << leftmost_frame << " -- " << rightmost_frame << std::endl;
-       std::cout << "SCROLL UNITS: " << frame_to_unit(leftmost_frame) << " -- " << frame_to_unit(rightmost_frame)
-                 << " = " << frame_to_unit(rightmost_frame) - frame_to_unit(leftmost_frame)
-                       << std::endl;
-#endif
-
-       // TODO later: make this a list for mult. video tracks
-       // also modify  ardour_ui_dialogs.cc : set_session()
        if (flush) {
                ARDOUR_UI::instance()->video_timeline->flush_local_cache();
        }
@@ -108,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);
@@ -121,23 +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);
+       ExportVideoDialog dialog (_session, get_selection().time, range);
        Gtk::ResponseType r = (Gtk::ResponseType) dialog.run();
+       (void) r; // keep gcc quiet
        dialog.hide();
-#if 0
-       if (r == Gtk::RESPONSE_ACCEPT) {
-               ARDOUR_UI::instance()->popup_error(string_compose(_("Export Successful: %1"),dialog.get_exported_filename()));
-       }
-#endif
 }
-
-#endif /* WITH_VIDEOTIMELINE */