Commit Graph

203 Commits

Author SHA1 Message Date
Ben Loftis 72761734e8 region groups: more fixes for drag-copy and range-paste operations 2023-09-27 11:06:40 -05:00
Ben Loftis 0a12986639
Preserve existing region-group relationships
This solves several issues related to splitting or pasting regions, when
there is more than one layer.

Rather than assign a new group-id for "all the regions on the right of a
split", only ions that had a *prior* group-relationship should be
propagated into the new group.

Signed-off-by: Robin Gareus <robin@gareus.org>
2023-09-22 18:21:34 +02:00
Paul Davis 076cb86912 next iteration of changes to handle time domain bounces as undoable 2023-08-14 23:42:08 -06:00
Ben Loftis 1d5ec57794
region groups: define an API in region.h for grouped regions 2023-08-10 16:55:20 +02:00
Paul Davis d035cb0834 some minor cleanups after rebase against master 2023-08-02 17:21:56 -06:00
Paul Davis fa225846af new Temporal API to allow keeping MIDI notes in position after a map-tempo operation 2023-08-02 14:11:06 -06:00
Robin Gareus bb54bc0d40
Yet another attempt at fixing #9361 2023-06-10 03:33:51 +02:00
Robin Gareus ad49de022a
Too many drop-references handlers (#9363)
This fixes a random crash with stop-and-forget capture.

When aborting capture, the disk-writer can emit
 midi_write_source->drop_references ()
in the butler thread, which leads to a direct call to
Session::remove_source.

This can happen before or after Region::source_deleted
is called which is initiated from the same signal.

Furthermore it was possible that Region::source deleted
was called concurrently from the UI thread via SourceRemoved
for whole file regions, which lead to memory corruption.
2023-06-09 16:17:37 +02:00
Robin Gareus 92fbab32c6
Update codebase to use PBD::Progress (1/2) 2023-05-19 00:37:49 +02:00
Paul Davis 45490bf43f more functional tempo mapping 2023-03-24 14:19:16 -06:00
Paul Davis b35518e212 switch from boost::{shared,weak}_ptr to std::{shared,weak}_ptr
This is mostly a simple lexical search+replace but the absence of operator< for
std::weak_ptr<T> leads to some complications, particularly with Evoral::Sequence
and ExportPortChannel.
2023-03-24 14:19:15 -06:00
Paul Davis 39ed528e25 std-ize: convert all boost shared/weak ptr includes to <memory>
Also fix stdint.h -> cstdint and alphabetically order std includes
2023-03-24 14:19:15 -06:00
Robin Gareus 7b86ef8eff
Fix region gain for various edit operations
When deriving regions (split, cut), the Region Gain curve
must not be inherited as-is.

See also 8b0ab38675 and e40f58c106
2022-11-03 21:22:32 +01:00
Robin Gareus 0504db2a67 Update region delta-time API
This is the first step to fix various MIDI edit issues for sessions with
tempo-changes.

The old code, using .earlier returned an absolute position when
calculating a relative distance. This is only valid if the session has a
fixed tempo, and the origin is irrelevant when converting the timepos.

This resulted in follow up issues since there is a difference when
summing two positions (each with an origin) vs adding an offset to a
position.

Note: this API changes breaks compilation until the GUI is updated.
2022-10-23 19:05:48 +02:00
Paul Davis 88396347e6 increment/decrement name changes ... out with old in with the new (libs 2022-10-07 17:30:35 -06:00
Paul Davis be9fdd9873 libs: use {de,in}crement_by_domain() instead of {de,in} (libs) 2022-10-07 16:24:46 -06:00
Robin Gareus 2f810ad34e Allow to override region lock, and derive properties
This is required when adding locked regions to a playlist.
e.g. after a split or partition operation. It is only supposed
to be used from Playlist::add_region_internal() and
Playlist::partition_internal().
2022-10-07 00:35:51 +02:00
Robin Gareus 94637272e1
Mark MIDI regons as transparent by default, and convert old sessions 2022-09-09 19:07:49 +02:00
Robin Gareus cc07cde142
Simplify 86e6df15cc using a dedicated method 2022-07-04 18:05:43 +02:00
Paul Davis 39248d682d add ::time_domain() methods to Playlist and Region
These are heuristics based on data type for now. That may evolve over time,
but it's a reasonable place to begin
2022-05-27 15:56:13 -06:00
Ben Loftis 1fdfa53b9f region::absolute_time_to_region_beats() needs to incorporate start offset
* this fixes the Draw tool when adding notes;  if you tried to draw in
 a region with a trimmed front, the note would not get added in the correct
 location
2022-05-12 12:15:53 -05:00
Paul Davis 7bf89ce109 Constification: make Stateful::get_state() const, with all other required const-ness added (libs) 2022-04-06 21:56:59 -06:00
Robin Gareus ecb1d33c02
Remove Region::position remnants (see cc6c0f1263) 2022-03-04 22:38:41 +01:00
Paul Davis c6a31250ba alter Source::_length from timecnt_t to timepos_t
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
2022-01-28 15:52:27 -07:00
Robin Gareus ec6cd4539d
Implement Region::export()
This adds an abstract API, matching the exiting MIDIRegion::do_export(),
which allows to export multi-channel audio-files.
2022-01-28 01:58:37 +01:00
Ben Loftis f8432d0647 Triggerbox: these properties will not be stored in Region (reverts 3918ee) 2021-12-16 08:15:29 -06:00
Ben Loftis 3918ee2ed6 Add New Region variables for Clips
Properties are created for announcing changes, but values are not actually stored as undo-able properties.
2021-12-08 12:57:48 -06:00
Paul Davis e519dfc0aa fix timeline types in Region::move_cue_markers() decl 2021-08-13 12:51:36 -06:00
Paul Davis 56cde042cd Region::_start should be a timepos_t not a timecnt_t
It is an offset from an *implicit* origin (the source zero), not from an explicit origin,
and this fits with the concept underlying timepos_t. A timecnt_t requires an explicit origin,
which makes no sense in this context (just as it doesn't for the timeline as a whole).
2021-08-13 12:51:34 -06:00
Paul Davis 3bf6e013ee get rid of Region _last_position member, since the _last_length member has its own position 2021-08-13 12:51:34 -06:00
Paul Davis c0343a5a1a get rid of Region _position member, since the _length member has its own position 2021-08-13 12:51:34 -06:00
Paul Davis e188fbe0ee fix incorrect use timepos_t::position (incorrect ordering) 2021-08-13 12:51:31 -06:00
Paul Davis 82e84e6b92 change all Region::nt_*() methods to names without the nt_ prefix (library version) 2021-08-13 12:51:30 -06:00
Paul Davis bb9376c2b1 remove #warnings from region.cc related to Source object API 2021-08-13 12:51:30 -06:00
Paul Davis ff93c97296 add a new PBD::Property for time_domain
Not sure this is in the best place, but it needs to go somewhere
2021-08-13 12:51:29 -06:00
Paul Davis db8b054543 add required methods for region-relative time conversion 2021-08-13 12:51:29 -06:00
Paul Davis eae9d276fe libardour: conversion to use timeline types (mega-commit) 2021-08-13 12:51:29 -06:00
Paul Davis 889edfd0a0 fixup Region object to work with new factory methods for timeline types (and remove explicit music time-related members) 2021-08-13 12:51:28 -06:00
Paul Davis 67de08e78d more type changes for various Region related methods, using timepos_t/timeline_t 2021-08-13 12:51:28 -06:00
Paul Davis 70d53fda91 use Temporal::TimeRange in Region 2021-08-13 12:51:28 -06:00
Paul Davis 66bcf20950 ensure that all Region methods accepting timepos_t use a const & to avoid copy-construction 2021-08-13 12:51:28 -06:00
Paul Davis d40bdf5e95 first round of changes to use timeline types, here basically for Region position/length/start
UNFINISHED WORK. Does not compile. But region.cc will compile, hence this snapshot
2021-08-13 12:51:28 -06:00
Ben Loftis c2fb85e37e Cruft removal: behavior of Region List has changed; these functions are deprecated (libardour) 2021-06-08 08:33:48 -05:00
Paul Davis 3a1cfc837e libardour: API infrastructure for renaming cue markers 2021-05-24 20:23:06 -06:00
Paul Davis c2a012545b API infrastructure for dragging region/cue markers 2021-05-24 12:26:21 -06:00
Paul Davis 17dbdffc45 infrastructure APIs for region/cue marker removal and clear 2021-05-18 20:59:37 -06:00
Paul Davis 60a972a7de implement region marker deletion 2021-05-18 18:01:38 -06:00
Paul Davis 7cf9e3d89d remove Region::add_cue_marker() (force use of Source API instead) 2021-05-14 18:37:50 -06:00
Paul Davis 6dd516bc45 add non-const SourceList accessor to Region 2021-05-14 18:37:50 -06:00
Paul Davis 2791be7f2a add Region::add_cue_marker() 2021-05-14 18:37:50 -06:00