Commit graph

1165 commits

Author SHA1 Message Date
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