X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fsfdb_ui.cc;h=699627365080a2a1e4c7867cea290db7aaf2f92d;hb=30a698f42e3ee6be5a63ea1143413cf8329f444e;hp=c7f3d2dac5e3f27b0e6f043fd9b377b4dbb779de;hpb=64fa63212f7e79bab16147817211a33a3f7c8fba;p=ardour.git diff --git a/gtk2_ardour/sfdb_ui.cc b/gtk2_ardour/sfdb_ui.cc index c7f3d2dac5..6996273650 100644 --- a/gtk2_ardour/sfdb_ui.cc +++ b/gtk2_ardour/sfdb_ui.cc @@ -68,6 +68,7 @@ #include "gain_meter.h" #include "main_clock.h" #include "public_editor.h" +#include "timers.h" #include "sfdb_freesound_mootcher.h" @@ -283,10 +284,15 @@ SoundFileBox::setup_labels (const string& filename) if (SMFSource::valid_midi_file (path)) { - boost::shared_ptr ms = - boost::dynamic_pointer_cast ( - SourceFactory::createExternal (DataType::MIDI, *_session, - path, 0, Source::Flag (0), false)); + boost::shared_ptr ms; + try { + ms = boost::dynamic_pointer_cast ( + SourceFactory::createExternal (DataType::MIDI, *_session, + path, 0, Source::Flag (0), false)); + } catch (const std::exception& e) { + error << string_compose(_("Could not read file: %1 (%2)."), + path, e.what()) << endmsg; + } preview_label.set_markup (_("Midi File Information")); @@ -440,7 +446,7 @@ SoundFileBox::audition () afs = boost::dynamic_pointer_cast ( SourceFactory::createExternal (DataType::AUDIO, *_session, path, n, - Source::Flag (0), false)); + Source::Flag (ARDOUR::AudioFileSource::NoPeakFile), false)); if (afs->sample_rate() != _session->nominal_frame_rate()) { boost::shared_ptr sfs (new SrcFileSource(*_session, afs, _src_quality)); srclist.push_back(sfs); @@ -851,7 +857,7 @@ SoundFileBrowser::remove_gain_meter () void SoundFileBrowser::start_metering () { - metering_connection = ARDOUR_UI::instance()->SuperRapidScreenUpdate.connect (sigc::mem_fun(*this, &SoundFileBrowser::meter)); + metering_connection = Timers::super_rapid_connect (sigc::mem_fun(*this, &SoundFileBrowser::meter)); } void @@ -1746,6 +1752,18 @@ SoundFileOmega::SoundFileOmega (string title, ARDOUR::Session* s, hbox->pack_start (*vbox, false, false); options.pack_start (*hbox, false, false); + l = manage (new Label); + l->set_markup (_("Instrument")); + + vbox = manage (new VBox); + vbox->set_border_width (12); + vbox->set_spacing (6); + vbox->pack_start (*l, false, false); + vbox->pack_start (instrument_combo, false, false); + hbox = manage (new HBox); + hbox->pack_start (*vbox, false, false); + options.pack_start (*hbox, false, false); + str.clear (); str.push_back (_("Best")); str.push_back (_("Good")); @@ -1949,6 +1967,7 @@ SoundFileOmega::do_something (int action) ImportPosition pos = get_position (); ImportMode mode = get_mode (); ImportDisposition chns = get_channel_disposition (); + PluginInfoPtr instrument = instrument_combo.selected_instrument(); framepos_t where; switch (pos) { @@ -1969,9 +1988,9 @@ SoundFileOmega::do_something (int action) SrcQuality quality = get_src_quality(); if (copy_files_btn.get_active()) { - PublicEditor::instance().do_import (paths, chns, mode, quality, where); + PublicEditor::instance().do_import (paths, chns, mode, quality, where, instrument); } else { - PublicEditor::instance().do_embed (paths, chns, mode, where); + PublicEditor::instance().do_embed (paths, chns, mode, where, instrument); } if (action == RESPONSE_OK) {