Commit graph

1187 commits

Author SHA1 Message Date
Paul Davis
30a7f44c12 fix geometry calculations during NoteCreateDrags.
This also only uses the draw length parameter if no motion
occured during the NoteCreateDrag. Otherwise it uses the length that was
dragged (which is subjected to a threshold).
2024-10-17 07:44:30 -06:00
Paul Davis
dd211c4329 prefer nullptr to 0 2024-10-17 07:44:30 -06:00
Paul Davis
c97f4f4016 various changes to editor drag code to correctly use a bounding item 2024-10-17 07:44:30 -06:00
Paul Davis
030052e57f don't double-apply the effect of a drag with a bounding item to _grab_y 2024-10-17 07:44:30 -06:00
Paul Davis
6ee97f93bb more manual fixes after a substantial rebase 2024-10-17 07:44:30 -06:00
Paul Davis
bef7c48fe9 the state of things in pianorule, committed for travel purposes 2024-10-17 07:44:30 -06:00
Paul Davis
96ccb96b3b redesign drag API to provide a bounding item, not just "trackview only"
This allows rubberband drags on both the main editor and the separate piano roll to wokr
correctly.
2024-10-17 07:44:30 -06:00
Paul Davis
14b95116e1 move various action registry stuff into EditingContext 2024-10-17 07:44:30 -06:00
Paul Davis
5acedc036a fix up event handling so that MIDI note drag works in cue editor 2024-10-17 07:44:30 -06:00
Paul Davis
f425a974d6 the continuing co-evolution of Editor,EditingContext & MidiCueEditor 2024-10-17 07:44:30 -06:00
Paul Davis
10b48d2cc4 lock in some major steps for the midi cue/pianoroll editor 2024-10-17 07:44:29 -06:00
Paul Davis
c39558471f remove current slice usage/members 2024-10-17 07:44:29 -06:00
Paul Davis
33298a0ba0 get region-create drags working and no crashes (nut also no note) for note-drags 2024-10-17 07:44:29 -06:00
Paul Davis
54c41372cc fix a rebase error 2024-10-17 07:44:29 -06:00
Paul Davis
a550b6482f start using the now-compilable MidiView
Nothing yet derives from this, but MIDI display items and drags
do use it.
2024-10-17 07:44:29 -06:00
Paul Davis
dee8e920e6 editing refactoring, the drag part 2024-10-17 07:44:29 -06:00
Paul Davis
21610015ed make sure SelectionRemove case is handled for selection ops
Also fix formatting for switch/case statements
2024-08-06 17:36:35 -06:00
Paul Davis
af5c99dd05 move definition of selection operations in to ARDOUR namespace
This is a rare commit that I think should be done for GUI and libs at the same time
2024-08-02 11:50:21 -06:00
Robin Gareus
0f4fb04344
Prevent crash when dragging notes near 1|0|0
When moving the mouse fast it can happen that the resulting
position (note_qn + dx) becomes negative. Which causes
tempo-map ramp calculations to fail and the application aborts.
2024-08-02 17:53:26 +02:00
Robin Gareus
59e50c0e16
Better version of 1471950e (Note-drag dx) 2024-08-01 19:17:05 +02:00
Robin Gareus
1471950e24
Fix dragging MIDI events when using a tempo-map
This keeps mouse pointer and the dragged note in sync.
See also https://discourse.ardour.org/t/110511
2024-08-01 19:03:01 +02:00
Robin Gareus
44d01f5951
Update coverage frame while timming regions #9725 2024-06-21 17:36:28 +02:00
Robin Gareus
24f574772e
Hide coverage frame when dragging layered region #9725 2024-06-21 17:25:57 +02:00
Paul Davis
93e1e1c1f2 remove Cue, CD, Scene, Punch, Loop rulers, consolidate to just a pair (ranges, locations)
a menu allows choosing between all markers or 1 specific type, and all ranges or 1 specific type

more work required on menu structure and menu options/dialogs to specify the type of new location
and range marker creation
2024-05-16 22:58:55 -06:00
Robin Gareus
38adfdf79e
Add custom color for region effect automation 2024-04-23 21:56:26 +02:00
Robin Gareus
b2d4280e0f
Add support for Region Fx Automation 2024-04-23 21:56:22 +02:00
Robin Gareus
cbf38408c9
Fix crash when using Ripple with a RegionMoveDrag
See also 1a2fff932f
2024-01-07 14:15:36 +01:00
Robin Gareus
067a124fd1
Suspend signal emission of Locations during Drag
This significantly speeds up Location Drag/motion
2023-12-08 21:48:23 +01:00
Robin Gareus
71e049202c
Fix crash when clicking on region boundary box to start Drag
The box outlines a given region, the grab position may be earlier
than the region's position.

Previously this caused a crash (uncaught exception):

```gdb
__cxa_throw () at /lib/x86_64-linux-gnu/libstdc++.so.6
Temporal::timecnt_t::timecnt_t(Temporal::timecnt_t const&, Temporal::timepos_t const&) at ../libs/temporal/timeline.cc:79
RegionMoveDrag::setup_pointer_offset() at ../gtk2_ardour/editor_drag.cc:2226
```
2023-11-21 20:17:20 +01:00
Paul Davis
cd29e03c05 selection dragging: use time domain given to drag, not editor default 2023-11-03 15:11:38 -06:00
Paul Davis
ef0938a16d more improvements to velocity drawing (including straight line) 2023-10-27 11:50:15 -06:00
Paul Davis
91fbb1c65b first steps towards improving straight line drags for velocity 2023-10-27 11:50:15 -06:00
Paul Davis
edc0e636e2 allow users to opt for "select only the last drawn note" when drawing notes 2023-10-17 22:03:47 -06:00
Paul Davis
d6323a1686 GUI side of 122c9141 (API change for TempoMap::move_meter()) 2023-10-07 11:11:31 -06:00
Robin Gareus
b87937a20e
Fix crash when double-clicking on TempoMap Ruler markers
heap-use-after-free. Marker is deleted (and re-created), when
the tempo-map edit is aborted:

```
    #0 0x7f77528ac017 in operator delete(void*) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:160
    #1 0x55f81062800d in TempoMarker::~TempoMarker() ../gtk2_ardour/marker.cc:794
    #2 0x55f80ffb2fc0 in Editor::reset_tempo_marks() ../gtk2_ardour/editor_tempodisplay.cc:205
    #3 0x55f80ffb2b19 in Editor::reset_metric_marks() ../gtk2_ardour/editor_tempodisplay.cc:185
    #4 0x55f80ffb49fb in Editor::tempo_map_changed() ../gtk2_ardour/editor_tempodisplay.cc:301
    #5 0x55f80ffbdf00 in Editor::abort_tempo_map_edit() ../gtk2_ardour/editor_tempodisplay.cc:850
    #6 0x55f80fcf967a in TempoMarkerDrag::finished(_GdkEvent*, bool) ../gtk2_ardour/editor_drag.cc:333
```

Since no movement occurred, the tempo-map was not changed.
however we need to drop the lock and writable thread-pointer...
2023-10-07 15:35:15 +02:00
Robin Gareus
4a8dc04f14
Remove ScrubDrag and vari-speed based fake-scrubbing 2023-10-05 21:53:39 +02:00
Paul Davis
364c892c68 remove debug output 2023-10-03 11:13:57 -06:00
Paul Davis
764ed125a4 region gain line freehand draw: ensure drawn line is above waveform 2023-10-02 12:04:57 -06:00
Paul Davis
18819a48a9 region gain and MIDI CC freehand line drawing
This involved a significant change in event handling for automation region views,
but it brings it into line with how it works for other things. On button press
we initiate a drag, then if no motion occurs, the Drag returns false during
finalization, and only then do we continue through Editor::button_release_handler()
to eventually end up in ::add_automation_event().

Although it is a substantial change, the fact that it now works the same
way for audio regions, automation regions and automation tracks seems
like a definite plus.
2023-09-30 11:09:58 -06:00
Paul Davis
b2bb8e9bac move (empty) Drag destructor into source file and add DEBUG_TRACE 2023-09-30 11:09:58 -06:00
Paul Davis
944fcf251d initial refactoring of freehand line drawing
This sets the state to use it with MIDI CC and region gain.

class names LineMerger and MergeableLine need revisiting
2023-09-30 11:09:58 -06:00
Robin Gareus
bed041cf96
Set DnD time's time-domain
Drag::_raw_grab_time is set to the correct time-domain. However
during ::motion() and other operations the adjusted time was
always AudioTime.

Most notably this caused editor->selection->time to have
different time-domains for start and end.
2023-09-28 00:41:17 +02:00
Ben Loftis
72761734e8 region groups: more fixes for drag-copy and range-paste operations 2023-09-27 11:06:40 -05:00
Paul Davis
d892614742 fix DEBUG_TRACE message about a drag 2023-09-25 11:01:22 -06:00
Robin Gareus
36f8d48e93
Add editing mode to select marker click behavior
So far this only adds actions, not a GUI dropdown or
context menu. See also f9a121ce9c
2023-09-13 03:16:24 +02:00
Paul Davis
28af3c2024 i like nullptr 2023-09-11 10:26:54 -06:00
Paul Davis
fa78fe1f33 fix incorrect design of abort-tempo-map-edit operation 2023-09-11 10:26:54 -06:00
Paul Davis
734a62101f remove use of Tempo::active() from GUI
This has not been accessible in the GUI since 7.0.
2023-09-11 10:26:54 -06:00
Paul Davis
250174b16e don't bother locating at end of no-motion marker drag if using external sync 2023-09-07 14:23:08 -06:00
Paul Davis
f9a121ce9c click (no drag) on markers locates there, unless using marker as edit point 2023-09-07 14:23:08 -06:00