13
0
Commit Graph

823 Commits

Author SHA1 Message Date
45bd2c47d8 Brush Drag: refactor Brush-drag into its own Drag class (operation is still weird though) 2021-06-17 10:56:30 -05:00
69af0e6964 Abort a copy-drag in the case where it would result in a copy at the same location
also code cleanup: clear_draggingview_list() avoids duplicated code
2021-06-17 10:56:30 -05:00
87ecc9b4ca Slip Contents Drag: fix undo 2021-06-17 10:56:30 -05:00
f281e7e3c3 Slip Contents Drag: disambiguate Slip Contents from prior Contents Trim 2021-06-17 10:56:30 -05:00
3d8bccb508 Slip Contents Drag: remove ContentsTrim modifier from the region boundaries
*now that you can grab "anywhere" in the region, trim edges are inferior because they are hard to hit
*modifier had to change anyway (since CTRL is used as a copy-drag on both mac and win), so that invalidates prior muscle memory
*potentially frees up modifier on the trim edge for some other purpose (anchored_trim)
2021-06-17 10:56:27 -05:00
fea3fb9e71 Slip Contents Drag: add ContentsDrag 2021-06-17 10:56:22 -05:00
c62b6e0e3e Control Points should not obey Lock Edit, which was intended to lock regions and notes at the time where they were recorded.
Control Points should ignore x_constraint which is set in Drag::motion and potentially other places.
The only thing that should prevent CP sliding is can_slide which is false for the points at the ends of a region.
2021-06-14 11:51:16 -05:00
232af15b51 fix position of region cue markers during drag and after when region position is not zero 2021-05-25 14:01:30 -06:00
54e0b7f230 renaming cue markers (via dbl-click) 2021-05-24 20:23:06 -06:00
ab2357dfa1 implement dragging for region/cue markers 2021-05-24 12:28:19 -06:00
2016710865 skeleton for RegionMarkerDrag 2021-05-24 09:12:19 -06:00
f1fe1c7066
Amend 445f9a51bf 2021-05-23 23:22:18 +02:00
445f9a51bf
Fix ripple undo/redo
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.
2021-05-23 17:42:33 +02:00
fd3220c3d7
Set uninitialized variable (fix playhead dragging) 2021-05-21 17:57:56 +02:00
ce1e05fc3d
Update DnD min. movement threshold -- #8686
Previously x-axis threshold was in samples. This is
useless unless zoomed in to the max. So in most cases
the first-move was always in x-direction, making constrained
y-axis drags near impossible.

Furthermore the threshold for copy-drags was increased
as per #8686
2021-05-08 04:28:36 +02:00
4db1c02bd1
Fix crashes when rippling many regions
Region positions were updated in the GUI, before the playlist
was catching up.

The butler thread reads a region using the region's new position,
but the playlist's old range.


Thread 1 (GUI)
```
#22 ARDOUR::Playlist::notify_layering_changed()
#26 ARDOUR::AudioPlaylist::region_changed
#27 ARDOUR::Playlist::region_changed_proxy
#35 ARDOUR::Region::send_change
#36 ARDOUR::Region::set_position
#37 RegionRippleDrag::remove_unselected_from_views
#38 RegionRippleDrag::finished
```

LayeringChanged() also triggers DiskIOProcessor::playlist_modified
which schedules a pending-override and summons the butler.
Note that when moving only a few regions the butler starts after all
updates have been completed.

Butler thread:
```
#4  ARDOUR::AudioRegion::read_at
#5  ARDOUR::AudioPlaylist::read
#6  ARDOUR::DiskReader::audio_read
#7  ARDOUR::DiskReader::overwrite_existing_audio
#8  ARDOUR::DiskReader::overwrite_existing_buffers
#9  ARDOUR::Track::overwrite_existing_buffers
#10 ARDOUR::Session::non_realtime_overwrite
```

Region read fails:
```
 libs/ardour/audioregion.cc:503  assert (position >= _position);
(gdb) p position
$1 = 1312000
(gdb) p _position
$2 = {<PBD::PropertyTemplate<long>> = {_have_old = true,
    _current = 1336000, _old = 1312000} }
```
2021-05-07 21:56:09 +02:00
e570a290c4 add a few casts to avoid compiler warnings regarding size_type vs int
The class members are int because they need to hold negative (out-of-bound) values as sentinels
2021-05-06 12:03:27 -06:00
b75118ee13 a more robust value check for 8cb09ab2cf modification 2021-05-05 18:48:53 -06:00
8cb09ab2cf fix for region-drag to the dropzone (#8672)
The DraggingView's time_axis_view (index) is set to the size of _time_axis_views
in ::motion() near line 1149. This makes it invalid as index into the vector.
2021-05-05 18:33:44 -06:00
0aef128207 fix assumption that during dragging, a DraggingView's time_axis_view field is always a positive integer within range 2021-05-04 11:55:23 -06:00
5bfc507cb3 fix out-of-bounds access to a vector.
If the time axis view is not found, i will equal N, and _views[i] is out of bounds
2021-05-04 11:54:50 -06:00
ac53a9bbf8 remove unnecessary 2nd argument from Session::request_locate() calls (default value is identical) 2021-05-03 17:40:41 -06:00
7a89d56009
Fix insert + ripple undo/redo
Playlist changes do not include region-property changes.
When inserting a region, position(s) of other Regions may
change and those changes have to be recorded explicitly (for now).

see also RegionRippleDrag.
2021-04-29 22:56:09 +02:00
52b7e68102 use new Session transport API calls in GUI 2021-04-19 16:14:08 -06:00
d4c3e43b03
Address another -Wunused-private-field
TrackSelection is just a different name for TrackViewList
the private _editor is no longer needed nor used.
2021-03-18 04:06:46 +01:00
24398f0df2 click in automation track in object/grab mode adds a new automation point 2021-02-09 22:44:35 -07:00
4769c387f3
Expose EditorCursor via public editor API
This is in preparation to subscribe to playhead cursor position
changes in the recorder-UI.

This change also clean up the API, replacing a public variable
with a const access method and follows #12 of
https://ardour.org/styleguide.html
2021-01-08 18:39:56 +01:00
b59e687f83 prevent addition mouse button press/release events while an existing drag is still underway from interfering (fixes #8529) 2021-01-07 22:55:44 -07:00
Johannes Mueller
9b2228d6fd Fix ripple moving automation points
When ripple moving a region all the subsequent regions will be moved, next
region in the playlist after the dragged one first, last region of the playlist
last.

Thus, when an automation point is ripple moved along a region past the starting
point of the next region, it will be moved again along with the next region as
the move of the next region occurs after moving the automation point.

This fix reverses the sequence of the ripple moves, last region in the playlist
will be moved first, the next after the dragged one, last. So no temporary
overlap of regions will occur.
2020-07-07 19:39:16 +02:00
d99dd1e3ec
Fix auto-play when locating via drag/click in the editor 2020-07-07 18:53:42 +02:00
8dfb49f446 do not clear a MIDI region's note selection when drag-creating a note 2020-05-05 17:57:53 -06:00
51795d2e11
Fix contents-drag (ignore snap) #8073
The "new" snap-to-visual-grid mechanism is not useful for
Contents-trim. That would require a relative grid.
2020-05-01 22:12:39 +02:00
cc32d42388 use new API to get selected MIDI regions and clear current note selection in a MIDI region 2020-04-16 17:48:12 -06:00
899d696a97
Fix another typo #8016 2020-04-16 22:09:01 +02:00
Johannes Mueller
6d75d40533 Quick and dirty dropping support for rippling across tracks
Ripple editing will be reworked some point after 6.0
2020-04-14 23:45:17 +02:00
Johannes Mueller
d2f5edf64f Fix #8012 to some extent.
As soon as we ripple drag the selected region out of the original track,
::remove_unselected_from_views() is called and the rippled regions on the
original track are not covered when ::remove_selected_from_views() is called
again in ::finished(). Therefore we need to shift the regions remaining on the
original track back and forth again, in order to have them properly in the undo
history.
2020-04-14 22:43:15 +02:00
Johannes Mueller
d5f25f998b Fix #7007: ::clear_owned_changes() on rippled Playlist before commit
RegionMoveDrag::finished_no_copy() calls ::clear_changes() on every selected
Region and then sets their positions again before committing the command to the
UndoHistory. By doing that no changes from the previous transaction spill over
into the current transaction.

This needs to be done in a similar way by in RegionRippleDrag::finished()
because otherwise a following undo action would also undo the changes of the
previous transaction for all the non selected rippled regions.

RegionRippleDrags across tracks are still borked, though.
2020-04-13 23:56:52 +02:00
fbc48bdf34
Fix end vs. length bug when creating regions - #7978
set_length() includes the end.
A Region starting at 0 and ending at 0, has a length of 1
(think counting fence-posts, or video-frames).
2020-04-05 20:24:11 +02:00
75adc33629
Remove unused variable 2020-04-01 22:55:06 +02:00
6291433e27 set Editor::_pending_locate_request to true before sending locate request. 2020-03-25 18:39:59 -06:00
4151ec1907 remove accumulated debug output 2020-03-25 15:12:30 -06:00
1b05ebbafa more playhead-drag/click locate debugging 2020-03-25 12:33:46 -06:00
77ab1a39b8 more playhead-drag/click locate debugging 2020-03-25 11:48:53 -06:00
becfad91c2 more playhead-drag/click locate debugging 2020-03-25 11:48:18 -06:00
41ff788a76 more playhead-drag/click locate debugging 2020-03-25 11:03:18 -06:00
ec345037b0
Suppress debug output in optimized builds 2020-03-25 16:43:24 +01:00
777ac65831 debug output 2020-03-24 18:55:16 -06:00
384ded905d debug output 2020-03-24 18:39:46 -06:00
47767738b9 rename DoTheRightThing to RollIfAppropriate 2020-01-18 08:49:18 -07:00
3c00048b0c Session::request_locate() takes a tri-valued second argument for "roll-after-locate"
This allows callers to defer logic about auto-play/current rolling state and more to TransportFSM where it
can be cnentralized and is less ambiguous
2020-01-18 08:49:18 -07:00