X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fsfdb_ui.cc;h=8e92d7948f7104b0f607a13250b3c5629f4fe8d9;hb=13745017273db26968557a3efb63c7ba6a5ab6d3;hp=899748747d690b82334a8c5809e494fd742d7a2b;hpb=2ba58dfe65bb0c5ba7d5eb18a1566fa79eeb6993;p=ardour.git diff --git a/gtk2_ardour/sfdb_ui.cc b/gtk2_ardour/sfdb_ui.cc index 899748747d..8e92d7948f 100644 --- a/gtk2_ardour/sfdb_ui.cc +++ b/gtk2_ardour/sfdb_ui.cc @@ -474,6 +474,23 @@ SoundFileBox::audition () r = boost::dynamic_pointer_cast (RegionFactory::create (srclist, plist, false)); } + frameoffset_t audition_position = 0; + switch(_import_position) { + case ImportAtTimestamp: + audition_position = 0; + break; + case ImportAtPlayhead: + audition_position = _session->transport_frame(); + break; + case ImportAtStart: + audition_position = _session->current_start_frame(); + break; + case ImportAtEditPoint: + audition_position = PublicEditor::instance().get_preferred_edit_position (); + break; + } + r->set_position(audition_position); + _session->audition_region(r); } @@ -1662,6 +1679,7 @@ SoundFileOmega::SoundFileOmega (string title, ARDOUR::Session* s, str.push_back (_("session start")); set_popdown_strings (where_combo, str); where_combo.set_active_text (str.front()); + where_combo.signal_changed().connect (sigc::mem_fun (*this, &SoundFileOmega::where_combo_changed)); Label* l = manage (new Label); l->set_markup (_("Add files as ...")); @@ -1855,6 +1873,12 @@ SoundFileOmega::src_combo_changed() preview.set_src_quality(get_src_quality()); } +void +SoundFileOmega::where_combo_changed() +{ + preview.set_import_position(get_position()); +} + ImportDisposition SoundFileOmega::get_channel_disposition () const {