Commit Graph

1028 Commits

Author SHA1 Message Date
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
Paul Davis 44f169bc56 automation line drag: fix crash during segment drags
a drag on a segment without adjacent points would crash because we never
set the _grab_button for the Drag, so the LineDrag object never gets deleted
on mouse-up. This leaves a dangling reversible command, which will then
cause an assert(false) crash in the next Editor::begin_reversible_command()
2022-10-26 16:55:27 -06:00
Paul Davis e2c5a0777b GUI companion to 4dc582321 - make tempo marker drag smoother/more efficient
No reason to do a "mid tempo" update if the marker did not move
2022-10-25 11:10:36 -06:00
Robin Gareus 63c78ebced Fix MIDI edit opertaiont (trim, draw) across tempo-changes
In the presence of tempo-changes distinguishing between offsets and
absolute positions is signficant. It is only valid to convert absolute
times using the tempo-map

Furthermore since GUI zoom-factor is time-invariant (samples per pixel),
all GUI operations must explictly use samples (or timecnt). It is not
valid (and problematic) to use use a location dependent timepos.
2022-10-23 19:12:31 +02:00
Paul Davis 254297355e increment/decrement name changes ... out with old in with the new (gui) 2022-10-07 17:30:45 -06:00
Paul Davis 45e21de209 implement and adopt new conventions for AudioClock use
The class now has two separate methods for setting a duration or a point
value. They MUST be used appropriately, because their behavior is different.

When ::set_duration() is used in timecode mode, an extent (inclusive-end
length) is shown rather than a length.

Some objects, such as the TimeInfoBox, now deliberately shown an inclusive end
for their "end" clock, but this not universally followed, pending more feedback
from users and investigating of conventions in other DAWs.
2022-10-07 16:24:56 -06:00
Paul Davis 0938d21c30 change add new bbt marker from primary-click to context-click on BBT ruler 2022-10-03 14:16:34 -06:00
Paul Davis 340253a095 bbt markers should be freely draggable regardless of grid setting 2022-09-26 11:15:52 -06:00
Paul Davis fba4a5ff73 fix region drag across tracks that auto-partitioned the receiving playlist
Confusion caused during nutempo development when a boolean related to nick_m's old
"for music" concept ended up becoming the "auto_partition" argument instead
2022-09-24 14:27:20 -06:00
Paul Davis 451fb3e761 fix crash when dragging BBT marker (must use audio time) 2022-09-23 15:51:17 -06:00
Paul Davis 2e0bfae628 midi note drawing: use RoundNearest not RoundDownMaybe for note ends 2022-09-22 16:21:07 -06:00
Paul Davis 1a736d2c86 hand-drawn MIDI regions should always use beat-time 2022-09-09 12:17:44 -06:00
Paul Davis fc6ad8ebd9 bbt markers: all the basics of dragging, editing, removing 2022-08-17 16:40:35 -06:00
Paul Davis 6784f0e5dc basic skeleton for BBT marker drag 2022-08-17 16:40:02 -06:00
Paul Davis 3259ab2d41 tempodisplay: correctly redisplay tempo map stuff after adding a BBT marker 2022-08-17 16:39:32 -06:00
Ben Loftis 904491611f rippled region drags should apply on all tracks with selected regions 2022-07-19 12:33:33 -05:00
Robin Gareus 9e5fb6ea40
DnD: prefer explicit "first-move-happened" (see also 4556f55d8e)
In case of auto-scroll it is apparently possible that the
move_threshold_passed, but ::motion() is not called.

There already is an explicit _starting_point_passed variable
that is set when first_move occurred. So far it was just unused.
2022-07-18 18:41:17 +02:00
Ben Loftis 5df0e3d226 relax the requirement that Cue Markers must be quantized to the grid,
when dragging their location

* it should be possible to launch an arbitrary (non-quantized) sound
 'anytime' on the timeline

* this was already possible anyway, by switching the Grid to None
2022-07-18 11:34:57 -05:00
Robin Gareus 4556f55d8e
Fix Trim-drag abort
When no movement has occurred, TrimDrag::motion was never called
and `begin_reversible_command()` was not called. There is nothing
to undo. This fixes
`commit_reversible_command(Command*): Assertion `_current_trans' failed`
2022-07-17 16:02:53 +02:00
Ben Loftis 419f934ecd support group-override when starting a new Range selection 2022-07-14 17:28:07 -05:00
Paul Davis bf87916fb1 tempo display: further simplifications to handling map changes
When a tempo map change originates from a drag, we know the required redraws have
already been done. Use a new bool member, ignore_map_change, to tell the Editor
to ignore the map change signal. For all other map changes, do the full reset.
2022-06-28 10:16:31 -06:00
Paul Davis 6dfaac9e94 redesign the mechanisms for updating tempo/meter display during drags and other map changes
We now simply move markers during drags, and do not seek to create/delete markers.

When the map is changed, we rebuild the markers from scratch. This might need optimization to avoid doing
when the editor itself changed the map.
2022-06-27 22:21:27 -06:00
Paul Davis b2d553cc51 editor: fix HitCreateDrag to (a) not crash (b) use the right length (c) snap correctly 2022-06-22 13:31:08 -06:00
Paul Davis d47b581cbb remove RegionRippleDrag
This used to be a distinct kind of drag, but ended up being refactored into
something that happens during a regular drag. Has not been used in quite some time.
2022-06-21 15:52:16 -06:00
Paul Davis de2c553e1a improvements to BBT marker dialog appearance and behavior 2022-06-03 13:20:13 -06:00
Paul Davis b806ccf373 timestretching: fix inaccuracies in generated length
The design ignored the ratio computed by the drag interaction, and relied on getting the stretch
ratio from the dialog. This truncated the actual ratio, leading to (relatively) small errors
in the length of the generated region.

Now, if the ratio provided by the drag is not (1/1) (i.e. a single click while in timefx mode)
then the percentage stretch spinner is marked insensitive and the stretch ratio is taken from
the given ratio. For single clicks, the user can still adjust the percentage as they wish
2022-05-31 12:36:54 -06:00
Paul Davis 265f5d8342 numerous fixes for meter marker drag 2022-05-30 21:14:57 -06:00
Paul Davis 7168139861 abort reversible command if add-bbt-marker is cancelled 2022-05-29 14:41:55 -06:00
Paul Davis fdd634f530 add ctrl-drag on tempo bar/ruler to adjust tempo more directly 2022-05-29 14:19:27 -06:00
Paul Davis e2e6274956 libardour: change API of Session::request_locate() to include "force" argument (GUI edition) 2022-05-27 18:49:23 -06:00
Paul Davis 69ee83e6ce require explicit time domain for most region-centric drags
This removed one #warning nutempo line.
2022-05-27 15:57:14 -06:00
Paul Davis 399a5b3f25 convert use of operator* for tim::line types with ::scale(ratio_t) (GUI edition) 2022-05-27 12:47:44 -06:00
Mads Kiilerich cc6a1e2d6f gtk2_ardour/editor_drag.cc: fix confusing newline 2022-05-24 17:15:37 -06:00
Paul Davis 2ec6d45d6d temporal: remove the concept of a time domain for the tempo map (GUI edition) 2022-05-24 17:10:25 -06:00