Set playlist ID when importing to new tracks

This amends 730a0954 and b27bb586.
This also restores the original API for do_import()
and do_embed() as used by Lua scripts.

Note that this uses distinct IDs when importing both audio
and MIDI in the same DnD request.
This commit is contained in:
Robin Gareus 2021-07-08 05:24:02 +02:00
parent 2433b3059f
commit 2b066293fb
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
8 changed files with 54 additions and 54 deletions

View file

@ -1026,17 +1026,15 @@ EditorRegions::drag_data_received (const RefPtr<Gdk::DragContext>& context,
return;
}
string gid = Playlist::generate_pgroup_id();
if (_editor->convert_drop_to_paths (paths, context, x, y, data, info, dtime) == 0) {
samplepos_t pos = 0;
bool copy = ((context->get_actions () & (Gdk::ACTION_COPY | Gdk::ACTION_LINK | Gdk::ACTION_MOVE)) == Gdk::ACTION_COPY);
if (UIConfiguration::instance ().get_only_copy_imported_files () || copy) {
_editor->do_import (paths, Editing::ImportDistinctFiles, Editing::ImportAsRegion,
SrcBest, SMFTrackName, SMFTempoIgnore, pos, gid);
SrcBest, SMFTrackName, SMFTempoIgnore, pos);
} else {
_editor->do_embed (paths, Editing::ImportDistinctFiles, ImportAsRegion, pos, gid);
_editor->do_embed (paths, Editing::ImportDistinctFiles, ImportAsRegion, pos);
}
context->drag_finish (true, false, dtime);
}