}
if (sfbrowser == 0) {
- sfbrowser = new SoundFileOmega (*this, _("Add Existing Media"), _session, 0, true, mode_hint);
+ sfbrowser = new SoundFileOmega (_("Add Existing Media"), _session, 0, true, mode_hint);
} else {
sfbrowser->set_mode (mode_hint);
}
}
if (sfbrowser == 0) {
- sfbrowser = new SoundFileOmega (*this, _("Add Existing Media"), _session, audio_track_cnt, midi_track_cnt, true);
+ sfbrowser = new SoundFileOmega (_("Add Existing Media"), _session, audio_track_cnt, midi_track_cnt, true);
} else {
sfbrowser->reset (audio_track_cnt, midi_track_cnt);
}
sfbrowser->show_all ();
-
-
- bool keepRunning;
-
- do {
- keepRunning = false;
-
- int response = sfbrowser->run ();
-
- switch (response) {
- case RESPONSE_APPLY:
- // leave the dialog open
- break;
-
- case RESPONSE_OK:
- sfbrowser->hide ();
- break;
-
- default:
- // cancel from the browser - we are done
- sfbrowser->hide ();
- return;
- }
-
- /* lets do it */
-
- vector<string> upaths = sfbrowser->get_paths ();
- for (vector<string>::iterator x = upaths.begin(); x != upaths.end(); ++x) {
- paths.push_back (*x);
- }
-
- ImportPosition pos = sfbrowser->get_position ();
- ImportMode mode = sfbrowser->get_mode ();
- ImportDisposition chns = sfbrowser->get_channel_disposition ();
- framepos_t where;
-
- switch (pos) {
- case ImportAtEditPoint:
- where = get_preferred_edit_position ();
- break;
- case ImportAtTimestamp:
- where = -1;
- break;
- case ImportAtPlayhead:
- where = playhead_cursor->current_frame;
- break;
- case ImportAtStart:
- where = _session->current_start_frame();
- break;
- }
-
- SrcQuality quality = sfbrowser->get_src_quality();
-
-
- if (sfbrowser->copy_files_btn.get_active()) {
- do_import (paths, chns, mode, quality, where);
- } else {
- do_embed (paths, chns, mode, where);
- }
-
- if (response == RESPONSE_APPLY) {
- sfbrowser->clear_selection ();
- keepRunning = true;
- }
-
- } while (keepRunning);
}
void
typedef std::map<PBD::ID,boost::shared_ptr<ARDOUR::Source> > SourceMap;
/**
- * Updating is still disabled, see note in libs/ardour/import.cc Session::import_audiofiles()
+ * Updating is still disabled, see note in libs/ardour/import.cc Session::import_files()
*
* all_or_nothing:
* true = show "Update", "Import" and "Skip"
set_canvas_cursor (_cursors->wait);
gdk_flush ();
- /* start import thread for this spec. this will ultimately call Session::import_audiofiles()
+ /* start import thread for this spec. this will ultimately call Session::import_files()
which, if successful, will add the files as regions to the region list. its up to us
(the GUI) to direct additional steps after that.
*/
if ((s = _session->source_by_path_and_channel (path, n)) == 0) {
source = boost::dynamic_pointer_cast<AudioFileSource> (
- SourceFactory::createReadable (DataType::AUDIO, *_session,
+ SourceFactory::createExternal (DataType::AUDIO, *_session,
path, n,
(mode == ImportAsTapeTrack
? Source::Destructive
*/
framecnt_t len = (*x)->length (pos);
if (len == 0) {
- len = (60 / 120) * _session->frame_rate ();
+ len = (60.0 / 120.0) * _session->frame_rate ();
}
plist.add (ARDOUR::Properties::start, 0);
int n = 0;
framepos_t rlen = 0;
+ begin_reversible_command (Operations::insert_file);
+
for (vector<boost::shared_ptr<Region> >::iterator r = regions.begin(); r != regions.end(); ++r, ++n) {
boost::shared_ptr<AudioRegion> ar = boost::dynamic_pointer_cast<AudioRegion> (*r);
}
}
+ commit_reversible_command ();
+
/* setup peak file building in another thread */
for (SourceList::iterator x = sources.begin(); x != sources.end(); ++x) {
int
Editor::finish_bringing_in_material (boost::shared_ptr<Region> region, uint32_t in_chans, uint32_t out_chans, framepos_t& pos,
- ImportMode mode, boost::shared_ptr<Track>& existing_track)
+ ImportMode mode, boost::shared_ptr<Track>& existing_track)
{
boost::shared_ptr<AudioRegion> ar = boost::dynamic_pointer_cast<AudioRegion>(region);
boost::shared_ptr<MidiRegion> mr = boost::dynamic_pointer_cast<MidiRegion>(region);
boost::shared_ptr<Playlist> playlist = existing_track->playlist();
boost::shared_ptr<Region> copy (RegionFactory::create (region, region->properties()));
- begin_reversible_command (Operations::insert_file);
playlist->clear_changes ();
playlist->add_region (copy, pos);
_session->add_command (new StatefulDiffCommand (playlist));
- commit_reversible_command ();
break;
}
existing_track = at.front();
} else if (mr) {
- list<boost::shared_ptr<MidiTrack> > mt (_session->new_midi_track (boost::shared_ptr<PluginInfo>(), Normal, 0, 1));
+ list<boost::shared_ptr<MidiTrack> > mt (_session->new_midi_track (ChanCount (DataType::MIDI, 1),
+ ChanCount (DataType::MIDI, 1),
+ boost::shared_ptr<PluginInfo>(),
+ Normal, 0, 1));
if (mt.empty()) {
return -1;
boost::shared_ptr<Playlist> playlist = existing_track->playlist();
boost::shared_ptr<Region> copy (RegionFactory::create (region, true));
- begin_reversible_command (Operations::insert_file);
playlist->clear_changes ();
playlist->add_region (copy, pos);
_session->add_command (new StatefulDiffCommand (playlist));
- commit_reversible_command ();
break;
}
if (!at.empty()) {
boost::shared_ptr<Playlist> playlist = at.front()->playlist();
boost::shared_ptr<Region> copy (RegionFactory::create (region, true));
- begin_reversible_command (Operations::insert_file);
playlist->clear_changes ();
playlist->add_region (copy, pos);
_session->add_command (new StatefulDiffCommand (playlist));
- commit_reversible_command ();
}
break;
}
void *
Editor::import_thread ()
{
- _session->import_audiofiles (import_status);
+ _session->import_files (import_status);
pthread_exit_pbd (0);
/*NOTREACHED*/
return 0;