X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Feditor_videotimeline.cc;h=b5184539fc92b090ca5eadf63be8d3647beb4724;hb=9ccc56e162554c292b25408246e3680b8f14eea7;hp=fcb1d31ba07df482bfe5a66d70e4e9c2c9c91f53;hpb=74f2472c7d829e5f462b445bf46a0995fbcb3e3c;p=ardour.git diff --git a/gtk2_ardour/editor_videotimeline.cc b/gtk2_ardour/editor_videotimeline.cc index fcb1d31ba0..b5184539fc 100644 --- a/gtk2_ardour/editor_videotimeline.cc +++ b/gtk2_ardour/editor_videotimeline.cc @@ -18,7 +18,7 @@ */ -#include +#include "pbd/gstdio_compat.h" #include "ardour/profile.h" #include "ardour/rc_configuration.h" @@ -32,10 +32,10 @@ #include "audio_time_axis.h" #include "video_image_frame.h" #include "export_video_dialog.h" -#include "export_video_infobox.h" #include "interthread_progress_window.h" -#include "i18n.h" +#include "pbd/openuri.h" +#include "pbd/i18n.h" using namespace std; @@ -53,6 +53,9 @@ Editor::set_video_timeline_height (const int h) void Editor::update_video_timeline (bool flush) { + // catch GUIIdle -> Editor::idle_visual_changer during quit/close + assert (ARDOUR_UI::instance()->video_timeline); + if (flush) { ARDOUR_UI::instance()->video_timeline->flush_local_cache(); } @@ -79,13 +82,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, samplepos_t n, bool lock_position_to_video) { vector 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 (); @@ -95,29 +95,15 @@ Editor::embed_audio_from_video (std::string path, framepos_t n) ipw.show (); boost::shared_ptr 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 pl = track->playlist(); - pl->find_next_region(n, ARDOUR::End, 0)->set_video_locked(true); + if (lock_position_to_video) { + boost::shared_ptr pl = track->playlist(); + pl->find_next_region(n, ARDOUR::End, 0)->set_video_locked(true); + } _session->save_state (""); } import_status.all_done = true; -#endif - unlink(path.c_str()); -} - -void -Editor::export_video () -{ - if (ARDOUR::Config->get_show_video_export_info()) { - ExportVideoInfobox infobox (_session); - infobox.run(); - if (infobox.show_again()) { - ARDOUR::Config->set_show_video_export_info(false); - } - } - ExportVideoDialog dialog (*this, _session); - dialog.run(); - dialog.hide(); + ::g_unlink(path.c_str()); }