Include pbd/crossthread.cc in the mingw build
[ardour.git] / gtk2_ardour / editor_videotimeline.cc
index ce373f0406dc47aba72147ee2d0c70bf517fbf4b..259e3e36e17f68126f18c4d8354ee44fa63ec815 100644 (file)
@@ -18,8 +18,6 @@
 
 */
 
-#include <jack/types.h>
-
 #include <glib/gstdio.h>
 
 #include "ardour/profile.h"
@@ -29,8 +27,7 @@
 
 #include "ardour_ui.h"
 #include "editor.h"
-#include "simplerect.h"
-#include "canvas_impl.h"
+#include "canvas/rectangle.h"
 #include "editing.h"
 #include "audio_time_axis.h"
 #include "video_image_frame.h"
@@ -49,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->property_y2().set_value(nh);
        ARDOUR_UI::instance()->video_timeline->set_height(videotl_bar_height * timebar_height);
        update_ruler_visibility();
 }
@@ -59,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();
        }
@@ -95,13 +80,10 @@ Editor::toggle_video_timeline_locked ()
 }
 
 void
-Editor::embed_audio_from_video (std::string path, framepos_t n)
+Editor::embed_audio_from_video (std::string path, framepos_t n, bool lock_position_to_video)
 {
        vector<std::string> paths;
        paths.push_back(path);
-#if 0
-       do_import (paths, Editing::ImportDistinctFiles, Editing::ImportAsTrack, ARDOUR::SrcBest, n);
-#else
        current_interthread_info = &import_status;
        import_status.current = 1;
        import_status.total = paths.size ();
@@ -113,18 +95,19 @@ Editor::embed_audio_from_video (std::string path, framepos_t n)
        boost::shared_ptr<ARDOUR::Track> track;
        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);
+               if (lock_position_to_video) {
+                       boost::shared_ptr<ARDOUR::Playlist> pl = track->playlist();
+                       pl->find_next_region(n, ARDOUR::End, 0)->set_video_locked(true);
+               }
                _session->save_state ("");
        }
 
        import_status.all_done = true;
-#endif
        ::g_unlink(path.c_str());
 }
 
 void
-Editor::export_video ()
+Editor::export_video (bool range)
 {
        if (ARDOUR::Config->get_show_video_export_info()) {
                ExportVideoInfobox infobox (_session);
@@ -140,12 +123,8 @@ Editor::export_video ()
                                break;
                }
        }
-       ExportVideoDialog dialog (_session, get_selection().time);
+       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
 }