Commit Graph

1095 Commits

Author SHA1 Message Date
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
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
Paul Davis 1a44e612e9 ctrl-dragging a tempo mark uses horizontal, not vertical motion to adjust tempo 2022-05-24 17:10:25 -06:00
Paul Davis d8ba73f542 temporal: change "clamped" terminology to "continuing" (since that's what the GUI calls it) (GUI edition) 2022-05-23 08:07:08 -06:00
Ben Loftis e0f9f11dfc automation-range-drag: if lane is empty, use current value for guard points
* in the case where there are no existing automation points, then
 initiating an automation range drag  (select range, switch to Draw)
 should initialize the line at the current knob position
2022-05-16 07:16:25 -05:00
Ben Loftis f7abe8dacd fix: RegionMotionDrag actions are always rippling to other tracks
* if we aren't in RippleAll, you should only ripple the regions
 on the same track as the grabbed region
2022-05-14 14:16:21 -05:00
Paul Davis 6f973af1e1 tempo end drag: make this work with new implementation 2022-05-13 19:05:13 -06:00
Paul Davis db17a46498 tempo twist drag: changes to work with new (old) implementation 2022-05-13 19:05:13 -06:00
Paul Davis a60412373a tempo map editing: re-enable stretch tempo drag 2022-05-13 19:05:13 -06:00
Ben Loftis 83d0892777 when drawing notes, the grid should be scaled to the zoom scale
this prevents the case where have enabled snap, and you add a note that
 appears to be on a bar line. but actually it is {some Grid value} off,
 it just looks right because of pixel rounding.
2022-05-11 11:45:33 -05:00
Ben Loftis a60dfc19d2 take Snap enablement into account when drawing new notes
* snap_to_bbt assumes that snap is enabled and you want to snap to bbt
* snap_to() is the generic form to snap to the user's snap+grid settings
2022-05-11 11:38:54 -05:00
Ben Loftis de9f18b4f9 when Drawing MIDI notes, enforce a minimum length
This fixes the issue where you click to create a note, but move the mouse
 just a little, resulting in a note of invisibly small length

Do the calculation in ::motion so it displays the final
 size while you are dragging. "what you see is what you will get"
2022-05-10 20:00:26 -05:00
Ben Loftis 5310e1e099 create_note: fix a few thinkos which resulted in nested undo 2022-05-10 15:47:56 -05:00
Ben Loftis 9fcf8b3a11 midi_region_view: rename commit_resizing -> finish_resizing
* 'commit' suggests that this function would commit an undo record
2022-05-10 15:47:48 -05:00
Paul Davis 6f9aa3677f tempo markers: ctrl-drag now alters tempo for that section 2022-05-10 09:46:08 -06:00
Paul Davis 66a3513dbd remove copy option for TempoMarkerDrag
This just seems like a dumb UI to implement. Drag-copying tempo markers is not a thing
2022-05-10 09:46:08 -06:00
Paul Davis eff34f2e1b use editor tempo editing API rather than TempoMap API 2022-05-10 09:46:08 -06:00
Paul Davis b5487415ec editing: a partiaally implemented version of TempoTwistDrag, to be completed. 2022-05-02 16:47:23 -06:00
Paul Davis 0a99d67dac meter marker drag: better initialization of map member 2022-05-02 11:50:34 -06:00
Paul Davis 90a38a2b31 fix tempo marker drag crash caused by use of uninitialized map member 2022-05-02 11:49:43 -06:00
Paul Davis 789abc561d MIDI editing: fix selection during note resize drags
The ::start_drag() implementation now defers add/extend selection logic to
MidiRegionView::note_selected(), and drops the original limitation that we did
not do extend-selection on button press, only button release.
2022-04-17 22:18:31 -06:00
Paul Davis 7293904e53 use new TempoCommand when putting tempo map ops into undo/redo history 2022-04-08 11:58:04 -06:00
Paul Davis 883a44e6a4 temporal: TempoMap::use() returns a const ptr to enforce semantics (GUI version)
This commit leaves two issues outstanding:

1. unclear/ugly semantics for drag operations that reset the GUI thread's tempo map to the writable copy
2. undo/redo for the tempo map

These will be addressed in future commits
2022-04-08 11:58:04 -06:00
Paul Davis 1a8b80e56e drop experimental use of RegionView::DisplaySuspender during trim drags 2022-04-05 20:52:10 -06:00
Paul Davis 582661dbd0 as an experiment, prevent redisplay of (MIDI) regions during trimming
This doesn't actually work right now because of a conflicting design in MidiRegionView, but
could be promising. Or it might be reverted
2022-04-05 20:52:10 -06:00
Paul Davis ae8c043fe1 regionviews: use integer counter instead of boolean to control redisplay of contents 2022-04-05 20:52:09 -06:00
Paul Davis b3ccccb48f add #warning to code that should be fixed ASAP but not pre-Mixbus8 release 2022-03-21 13:00:01 -06:00
Robin Gareus fead587a5a
Remove debug output 2022-03-21 18:47:53 +01:00
Robin Gareus f6646eaa2d
Fix undo/redo when moving regions to a different track
This was broken during development of ripple-all.
First explicit rdiff_and_add_command() was used, but
when that was reverted later, the original stateful_diff
was not restored.

989408626d
1ccf272d58
2022-03-21 18:47:53 +01:00
Robin Gareus 139d54ac9b
Fix automation range drag guard points
This addresses an issue with missing guard points at the
beginning of a range drag when the range is not snapped to
a musical grid.

Note that the code below "same thing for the end" does not use
.beats() either.
2022-03-18 02:31:31 +01:00
Paul Davis e3b66825eb superclock_ticks_per_second: GUI edition changes 2022-03-17 14:15:59 -06:00
Robin Gareus 9f29986a16
Fix Wreorder 2022-03-17 17:12:08 +01:00
Ben Loftis 01ef5a5b24 ripple (gui part): should_ripple_all() encapsulates modes Ripple+RippleAll 2022-03-14 19:26:41 -05:00
luz paz 364f2f0788 Fix typos in gtk2_ardour/ directory
Found via `codespell -q 3 -S *.po,./share/patchfiles,./libs -L ba,buss,busses,doubleclick,hsi,ontop,ro,seh,siz,sur,te,trough,ue`
2022-01-26 12:35:38 -05:00
Paul Davis 4c433106a4 add interview mode to preferences and fix up implementation 2022-01-24 11:29:36 -07:00