Commit graph

1111 commits

Author SHA1 Message Date
Paul Davis
01381dad77 lollis: remove unnecessary drag object member 2023-06-26 14:18:18 -06:00
Paul Davis
f7130f5c02 lollipop drag: move all selected notes 2023-06-26 14:18:18 -06:00
Paul Davis
cf7ba80fc1 the basics of lollipop dragging 2023-06-26 14:18:18 -06:00
Paul Davis
2977205f3a add skeleton for lollipop drags 2023-06-26 14:18:18 -06:00
Colin Fletcher
72850d456f implement time-stretch from left of region
Make click & drag in the left-hand half of a region with the Timestretch
tool stretch the region on its left, leaving the end position of the new
time-stretched region in the same place as the end of the original.
2023-06-09 17:57:52 +01:00
Robin Gareus
04d50ab880
Fix mouse edit-point cursor when dragging
Editor::motion_handler() only updates the snap-cursor
when no drags are active. While dragging, Drag::motion is
responsible to set the cursor accordingly.

In many cases the snap-cursor simply remained stuck at
the most recent position. Since in many cases
(e.g. RubberbandSelectDrag) it makes no sense to show the
cursor, so Drag::start_grab now hides the cursor by default.

This also fixes cases where the cursor is shown, but
was displayed in the wrong location.
2023-06-07 02:38:39 +02:00
Robin Gareus
921b4aaa75
Allow to drag time selection markers 2023-06-01 21:37:40 +02:00
Ben Loftis
cc630c6bbe tempo mapping: clicking on a bar line should always make a new tempo marker
* the process of tempo mapping requires/encourages you to click on the
   last-known good marker, before continuing to make tempo tweaks

* this conflicts with the idea that clicking in a ruler should start a
    playhead-drag.  TBD.   but tempo-mapping is a special and rare operation.
2023-05-22 15:51:33 -05:00
Robin Gareus
c669ff58e5
Cleanup, fix Wunused-private-field 2023-05-22 22:29:42 +02:00
Robin Gareus
515e67f784
NO-OP: clang-format 2023-05-22 22:23:41 +02:00
Ben Loftis
a217c58ff5 tempo mapping: remove an unnecessary limit on tempo-drags
a) mouse-scaling is not 1:1
b) invalid tempo values are prevented internally anyway
2023-05-22 13:33:03 -05:00
Ben Loftis
ca5e56f98c tempo mapping: MappingTwist drag should differentiate between ramped and constant twist
TODO:  probably break these into separate ::Drag classes
2023-05-22 13:33:03 -05:00
Ben Loftis
9fa8e257a6 tempo mapping: Mapping Drags should inhibit horizontal autoscroll 2023-05-22 13:32:38 -05:00
Robin Gareus
dbebc0b7e0
Make Markers properly themable, use color-names
This simplifies code, and also immediately changes marker
colors when the theme is changed.
2023-05-18 01:26:35 +02:00
Ben Loftis
a258b82ce9 tweak behavior and naming of tempo-map drags:
* correctly handle clicks on the immediate right or left of a beat line
* prefer Mid-Twist and End-Stretch terminology over Twist and Linear
* static-tempo vs ramped-tempo is orthogonal to mid- and end- drags (TODO)
2023-05-04 09:33:08 -05:00
Ben Loftis
3f15a3a402 set playhead sensitivity via config (defaulted insensitive)
* in the 'fake_drag' case (dragging the playhead from the ruler), the
 mouse events are delivered to the playhead during the drag so we need
 to temporarily sensitize the playhead during that operation, then reset
 the sensitivity via config
2023-05-01 08:49:27 -05:00
Ben Loftis
5b42422c60 allow single-click in the mapping ruler to add tempo markers (again)
* this is useful to make a 'guard point' ...
* ... this just preserves/sustains the tempo from the prior tempo marker
2023-04-28 09:29:01 -05:00
Paul Davis
57d2a85c0a NO-OP: remove unused variable warning 2023-04-27 19:56:18 -06:00
Paul Davis
408aed9e85 no need for a tempo map reset after the remove-while-moving 2023-04-27 19:56:12 -06:00
Paul Davis
1a2fff932f prevent crash during ripple-mode dragging a region with copy enabled (weird crash but this stops it) 2023-04-18 13:48:59 -06:00
Paul Davis
23a9ce4651 more debug information 2023-04-16 10:33:48 -06:00
Paul Davis
88e4b40857 remove concept/implementation of a mapping stretch drag (aka "half twist")
This concept proved to be impossible.
2023-04-13 17:50:41 -06:00
Paul Davis
c10b265333 tempo mapping: various tweaks and improvements to workflow/Ux 2023-04-13 17:47:34 -06:00
Paul Davis
040dae9b0d tempo mapping: adjust BPM delta during a twist to reflect zoom level 2023-04-13 10:57:12 -06:00
Paul Davis
57398b1e5e tempo mappoing: use actual mouse cursors not canvas item cursors
Also some changes to attempt to do "half-twist" that will be removed soon.
2023-04-07 12:56:57 -06:00
Robin Gareus
dd542b8f4d
Use ARDOUR::PlaylistSet instead of local typedefs 2023-04-06 02:13:51 +02:00
Paul Davis
0aea2a2ef8 tempo twisting: GUI improvements, including undo/redo logic 2023-03-24 14:19:16 -06:00
Paul Davis
77cefd7721 new tempo mapping drag objects (API and implementation) 2023-03-24 14:19:16 -06:00
Paul Davis
6d5273e514 tempo marker drag: change type of stored bpm 2023-03-24 14:19:16 -06:00
Paul Davis
d61a741e4b mapping bar: some mouse handling 2023-03-24 14:19:16 -06:00
Paul Davis
38bb89c110 more functional tempo mapping
TempoMarker drag modifies tempo (and thus beat-time positions
and durations).

BBTRuler drag modifies the map but not positions/durations
2023-03-24 14:19:16 -06:00
Paul Davis
d25a615e20 API development for time domain flipping (GUI edition) 2023-03-24 14:19:15 -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
Ben Loftis
4de53fa600 make regions transparent during fade-handle drags
* during drag and trim operations, we use "dragging region" transparency
  so you can see the audio data beneath your region(s)

* we already do this for region-end-trim fade drags, which is a special
   kind of trim operation, accessed from the 'lower' drag handle

* now we also trigger transparency for regular fade trims.

   see discussion at:
https://discourse.ardour.org/t/regions-transparency-in-7-2/108060/31
2023-03-17 11:56:08 -05:00
Robin Gareus
adf1eb34fb
Fix drawing percussive hits (#9234)
* HitCreateDrag::start_grab does not need to do anything
  a hit cannot be past end of region. Drawing at or past
  the end of a region will create a new region (not an event)
* HitCreateDrag::finished now calculates the position like
  NoteCreateDrag::finished.
* the selection does not need to be cleared. Creating new
  notes/hits selectes the newly created ones.
2023-02-11 20:27:43 +01:00
Paul Davis
f1d784afbb deep fix to the way automation control point drags are handled/computed
The old code could not snap to the grid, because it had a lot of confusion about pixels vs. time,
and between line-origin-relative time and absolute time
2023-02-10 11:11:51 -07:00
Paul Davis
fe64ab9d31 control point drag: set time domain to match the list being modified
Previously this used the editor's default time domain
2023-02-06 21:04:17 -07:00
Paul Davis
c41de90abd drags: add API to set time domain of a drag
This can slightly improve efficiency of temporal computation
during the drag.
2023-02-06 21:04:17 -07:00
Paul Davis
e883c39e7a control point drag: fix the way bounding-to-region is computed 2023-02-06 21:04:17 -07:00
Robin Gareus
86d9bcf525 Remove direct use of audio-engine rate (2/2)
This is in preparation for sample-rate independence.
2023-01-22 20:07:40 +01:00
Robin Gareus
d322cfabdc
Use same time-domain for all drag copied regions
When copying regions from multiple tracks, use the same
time domain for each region (depends on grid).

The primary region position is set the time-domain from
RegionMotionDrag::_last_position replacing the region's
prior time-domain. Other regions should follow suit and not
retain their time-domain.

Fixes: Enable snap-to-grid, select regions on multiple tracks,
ctrl+drag copy them.
2023-01-10 22:39:44 +01:00
Paul Davis
253419a321 tempo marker drag: update GUI during drag 2022-12-20 21:54:59 -07:00
Paul Davis
b48821887d restore primary-drag in BBT ruler function 2022-12-19 13:35:27 -07:00
Paul Davis
90ae38e353 note create drag: tweak to fix dragging when snap is not bars 2022-12-19 12:19:05 -07:00
Paul Davis
615aff92d7 note create drags: work better if snapping to bars 2022-12-19 12:19:05 -07:00
Robin Gareus
f003bee985
Use a dedicated Canvas Group for MRV
This fixes rendering of opaque MIDI regions (previously
MIDI regions were always transparent). This change provides a
way to "flatten" layered MIDI regions, while still allowing
to show the note-line and grid behind the regions.
2022-12-10 02:37:05 +01:00
Robin Gareus
f47e517c86
Fix duplicate undo crash
Double-clicking on a line in internal edit mode adds
a new point in the line. In this case LineDrag need not
manage automation events because the "add" functions already
do. see AutomationTimeAxisView::add_automation_event and
AudioRegionView::add_gain_point_event
2022-11-02 02:05:58 +01:00
Paul Davis
31f78813e3 fix another mis-use of timepos_t::increment() 2022-10-28 14:34:59 -06:00
Paul Davis
b1118910c7 time signature not meter mark 2022-10-27 13:51:38 -06:00
Paul Davis
a3d3fb9c14 fix placement (snap) of percussive-mode drawn notes (#9041) 2022-10-27 08:31:44 -06:00