From dc7878760da040ad74b077318d2e9868d427199a Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 23 Dec 2013 10:28:32 +0100 Subject: vtl: do not lock audio [to video] when extracting audio-only. --- gtk2_ardour/ardour_ui.cc | 3 ++- gtk2_ardour/editor.h | 2 +- gtk2_ardour/editor_videotimeline.cc | 12 +++++------- gtk2_ardour/public_editor.h | 2 +- 4 files changed, 9 insertions(+), 10 deletions(-) (limited to 'gtk2_ardour') diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 6824ecff9e..8487d1d547 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -3565,7 +3565,8 @@ ARDOUR_UI::add_video (Gtk::Window* float_window) if (!transcode_video_dialog->get_audiofile().empty()) { editor->embed_audio_from_video( transcode_video_dialog->get_audiofile(), - video_timeline->get_offset() + video_timeline->get_offset(), + (transcode_video_dialog->import_option() != VTL_IMPORT_NO_VIDEO) ); } switch (transcode_video_dialog->import_option()) { diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 9e4b3ada19..3a74fa22ed 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -1449,7 +1449,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void toggle_video_timeline_locked (); void set_video_timeline_locked (const bool); void queue_visual_videotimeline_update (); - void embed_audio_from_video (std::string, framepos_t n = 0); + void embed_audio_from_video (std::string, framepos_t n = 0, bool lock_position_to_video = true); PBD::Signal0 EditorFreeze; PBD::Signal0 EditorThaw; diff --git a/gtk2_ardour/editor_videotimeline.cc b/gtk2_ardour/editor_videotimeline.cc index 7d1c009d58..d4522353c2 100644 --- a/gtk2_ardour/editor_videotimeline.cc +++ b/gtk2_ardour/editor_videotimeline.cc @@ -93,13 +93,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 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 (); @@ -111,13 +108,14 @@ Editor::embed_audio_from_video (std::string path, framepos_t n) boost::shared_ptr track; 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()); } diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h index 1905875141..cf497d88fb 100644 --- a/gtk2_ardour/public_editor.h +++ b/gtk2_ardour/public_editor.h @@ -299,7 +299,7 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible, publi virtual void set_xjadeo_sensitive (bool onoff) = 0; virtual int get_videotl_bar_height () const = 0; virtual void set_video_timeline_height (const int h) = 0; - virtual void embed_audio_from_video (std::string, framepos_t n = 0) = 0; + virtual void embed_audio_from_video (std::string, framepos_t n = 0, bool lock_position_to_video = true) = 0; virtual void export_video (bool range = false) = 0; virtual RouteTimeAxisView* get_route_view_by_route_id (const PBD::ID& id) const = 0; -- cgit v1.2.3