Import via Drag/Drop previously worked by selecting a track,
and then importing to the selected track.
This approach fails when the selected track is in a track-group,
and selecting the track also selects other tracks of different type.
Now the track to drop onto is passed directly passed through to
::finish_bringing_in_material as existing_track.
This commit leaves two issues outstanding:
1. unclear/ugly semantics for drag operations that reset the GUI thread's tempo map to the writable copy
2. undo/redo for the tempo map
These will be addressed in future commits
This will need some refinement, we should only copy the settings
if the file in question was previously auditioned, and perhaps
only if GMsynth.lv2 is used.
THe length of a Source(File) is always measured from its start. In this sense,
the length is like a position on the timeline, which is a duration with an
implicit origin, or a Region start, also a duration with an implicit origin (in
that case the start of the Source). There is no good reason for using
a timecnt_t for this value, because the position component of a timecnt_t
(the origin for the duration) is implicit and always zero. So we make
this property into a timepos_t, and include a number of asserts() to check
for common possible coding errors related to the time domain
Previously a triggerbox_ui.h change triggered a complete UI
rebuild. This follows the concept of other editor_selection
lists which use forward declarations.
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.
Ripple edit undo/redo needs a "recursive diff" of all regions
in the playlist. To work properly owned changes have to be
cleared first, previously unrelated edits were be collected too.
This includes a more consistent version of
7a89d56009 using rdiff() instead of explicitly
saving region diffs.
Resampling or copying files during import can take a long time.
If a save, or pending save is called while importing,
it is postponed until after import has completed.
If the file has a timestamp, it should be set in the region during import.
This keeps the BWF timestamp from being lost and allows the region context
menu item "Move to original Position" to work.
It does not affect where the region will be positioned during import. That
still follows the import dialog menu selection (playhead, session start,
etc). It just maintains data that the user can decided to use if needed.
This change also allows files to be imported to the source list and then
later placed on the timeline in the correct timestamped position.