#include "ardour/auditioner.h"
#include "ardour/audioregion.h"
#include "ardour/audiofilesource.h"
+#include "ardour/midi_region.h"
#include "ardour/smf_source.h"
#include "ardour/region_factory.h"
#include "ardour/source_factory.h"
#include "gain_meter.h"
#include "main_clock.h"
#include "public_editor.h"
+#include "timers.h"
#include "sfdb_freesound_mootcher.h"
case ImportAsTapeTrack:
return _("as new tape tracks");
}
- /*NOTREACHED*/
+ abort(); /*NOTREACHED*/
return _("as new tracks");
}
if (SMFSource::valid_midi_file (path)) {
- boost::shared_ptr<SMFSource> ms =
- boost::dynamic_pointer_cast<SMFSource> (
- SourceFactory::createExternal (DataType::MIDI, *_session,
- path, 0, Source::Flag (0), false));
+ boost::shared_ptr<SMFSource> ms;
+ try {
+ ms = boost::dynamic_pointer_cast<SMFSource> (
+ 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 (_("<b>Midi File Information</b>"));
afs = boost::dynamic_pointer_cast<AudioFileSource> (
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<SrcFileSource> sfs (new SrcFileSource(*_session, afs, _src_quality));
srclist.push_back(sfs);
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
to do embedding (or if we are importing a MIDI file).
*/
- if (Config->get_only_copy_imported_files()) {
+ if (ARDOUR_UI::config()->get_only_copy_imported_files()) {
copy_files_btn.set_sensitive (false);
} else {
copy_files_btn.set_sensitive (false);
* or any file if we are under nsm control */
bool const must_copy = _session->get_nsm_state() || have_a_midi_file || notebook.get_current_page() == 2;
- if (Config->get_only_copy_imported_files()) {
+ if (ARDOUR_UI::config()->get_only_copy_imported_files()) {
if (selection_can_be_embedded_with_links && !must_copy) {
copy_files_btn.set_sensitive (true);
hbox->pack_start (*vbox, false, false);
options.pack_start (*hbox, false, false);
+ l = manage (new Label);
+ l->set_markup (_("<b>Instrument</b>"));
+
+ 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"));
if (x == disposition_map.end()) {
fatal << string_compose (_("programming error: %1 (%2)"), "unknown string for import disposition", str) << endmsg;
- /*NOTREACHED*/
+ abort(); /*NOTREACHED*/
}
return x->second;
ImportPosition pos = get_position ();
ImportMode mode = get_mode ();
ImportDisposition chns = get_channel_disposition ();
+ PluginInfoPtr instrument = instrument_combo.selected_instrument();
framepos_t where;
switch (pos) {
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) {