13
0
Commit Graph

1114 Commits

Author SHA1 Message Date
757acf381e fix typo/thinko with const "division" value 2021-08-13 12:51:36 -06:00
c6370948c4 fix call to RegionMotionDrag constructor 2021-08-13 12:51:36 -06:00
40c9b1482a region move drag now requires named argument 2021-08-13 12:51:36 -06:00
6a71f9988e fix timeline type use in brush dragging 2021-08-13 12:51:36 -06:00
90264e1d0d fix timeline type use 2021-08-13 12:51:36 -06:00
88bed837c0 fix deadlock during tempo marker dragging, and don't start a tempo map update if a tempo point is inactive 2021-08-13 12:51:35 -06:00
f05b2ed93b remove another NUTEMPO #warning by allow grab starts in rubber band selection to use the default time domain 2021-08-13 12:51:35 -06:00
7244b03385 convert NoteCreateDrag::grid_aligned_beats() into a proxy for Editor::snap_to_bbt() 2021-08-13 12:51:35 -06:00
0ddfd7c873 force drag-created regions to use beat time for position 2021-08-13 12:51:34 -06:00
49424ab0e3 Region::_start should be a timepos_t not a timecnt_t (GUI edition) 2021-08-13 12:51:34 -06:00
dad56af802 remove another 3 NUTEMPO #warnings
These all involve converting between ControlList-relative time and absolute time
2021-08-13 12:51:34 -06:00
0162d3f9d6 GUI changes to *try* to adapt to a world without explicit beats<->samples converter objects (i.e. use AutomationLine::get_origin() instead 2021-08-13 12:51:34 -06:00
6536655a0a add explanatory comment 2021-08-13 12:51:34 -06:00
21e6f1cf50 (mostly) fix note drag creation drawing 2021-08-13 12:51:34 -06:00
b66b98ce58 remove 2 more NUTEMPO warnings by use Editor::default_time_domain() appropriately (but perhaps without enough user control) 2021-08-13 12:51:34 -06:00
39f52cd3ce remove unused and unnecessary Drag::snap_delta_music() code 2021-08-13 12:51:34 -06:00
cb66ae496c don't even pretend to use non-modal dialog API for the BBT marker dialog 2021-08-13 12:51:34 -06:00
d4f52498fa somewhat working dialog for BBT/Position marker creation 2021-08-13 12:51:34 -06:00
4911779157 manual fixups after a rebase against master 2021-08-13 12:51:34 -06:00
432fbe984a make "add BBT marker" test case use 3|1|0 for better testing 2021-08-13 12:51:34 -06:00
2445081dcc remove another NUTEMPO #warning - this one was just unnecessary concern 2021-08-13 12:51:34 -06:00
0f67dbf8cc remove another NUTEMPO #warning - use time domain of region's track for content trim dragging 2021-08-13 12:51:34 -06:00
18fba5dece whitespace adjustments 2021-08-13 12:51:33 -06:00
fe352311f6 make shift-leftclick on bbt ruler set that time to be 3|2|0 (experiment - GUI dialog to follow) 2021-08-13 12:51:33 -06:00
c22c8ed69f get TempoMarkerDrag and BBTRulerDrag to compile 2021-08-13 12:51:33 -06:00
c5c14e2416 remove two nutempo #warnings - initialize timecnt_t() using timedomain of route with first selected region (ripple dragging) 2021-08-13 12:51:33 -06:00
0114059c9d nutempo warning removal 2021-08-13 12:51:33 -06:00
125c20e148 manual fixups for recent rebase conflicts left in the wrong state (GUI edition) 2021-08-13 12:51:33 -06:00
42c74932a5 fixes/improvements for meter marker drags 2021-08-13 12:51:32 -06:00
b0725a8ab9 use new TempoMap::abort_update() API when drag does not end in map update 2021-08-13 12:51:32 -06:00
eaedcd79d4 fix a bunch of undo-able tempo map operations to use RCU 2021-08-13 12:51:32 -06:00
06f93e65b2 fix timefx to use ratio_t from the beginning of the operation 2021-08-13 12:51:32 -06:00
dee71c0a97 mostly fix region- and note-create drags 2021-08-13 12:51:32 -06:00
fa759d3507 fix direction for trim drags 2021-08-13 12:51:31 -06:00
9412130c01 use cleaned up Temporal ::quarters*_at* API (GUI edition) 2021-08-13 12:51:31 -06:00
0093ae07b0 cleanup after timecnt_t API changed (GUI edition) 2021-08-13 12:51:31 -06:00
cce695d33a changes required by fixing ambiguities in timepos_t/timecnt_t API (GUI edition) 2021-08-13 12:51:31 -06:00
18d64f0402 change all Region::nt_*() methods to names without the nt_ prefix (GUI version) 2021-08-13 12:51:30 -06:00
53c164f9fd GUI changes to get libtemporal setup at application startup 2021-08-13 12:51:30 -06:00
d2a94468d4 missing part of RCU update for tempo marker drag 2021-08-13 12:51:30 -06:00
42c38d313d try to use RCU updating when dragging tempo markers 2021-08-13 12:51:30 -06:00
49781e3b80 nominally fix up TempoMarkerDrag implementation for new TempoMap 2021-08-13 12:51:30 -06:00
90553b315f fix up memento command use for tempo map undo/redo 2021-08-13 12:51:30 -06:00
3c00fab75e remove/hide Session::tempo_map() and use TempoMap::use() instead (thread local shared ptr) (GUI edition) 2021-08-13 12:51:30 -06:00
f8df966914 clean up MeterMarkerDrag 2021-08-13 12:51:30 -06:00
f0d055ad4d more updates for new tempo map API 2021-08-13 12:51:30 -06:00
749a49c278 incorporating new tempo map API 2021-08-13 12:51:29 -06:00
f67029bd02 random commit to facilitate trivial move of work from laptop back to main system 2021-08-13 12:51:29 -06:00
2a08e4bdaa continued work on timeline types conversion. in theory, just editor_ops.cc remains 2021-08-13 12:51:29 -06:00
5b2a435e02 getting editor_drag.cc to compile 2021-08-13 12:51:29 -06:00
1b06fcb335 another snapshot of ongoing work on timeline types. still not compilable 2021-08-13 12:51:29 -06:00
7433bc27e0 intermediate, unfinished snapshot of ongoing timeline types work on GTK GUI 2021-08-13 12:51:29 -06:00
f4490f54c5 change Timecode::BBT_Time to use Temporal namespace, plus a couple of other minor changes to enable compilation
This still uses the tempo map object in libs/ardour, not the new one in libs/temporal, and isn't likely to be functional
(though it could be)
2021-08-13 12:51:28 -06:00
0a469527f1 updated Temporal::Beats ... GUI edition 2021-08-13 12:51:28 -06:00
32b77f549f fix marker positions after an aborted ripple drag 2021-08-13 12:51:28 -06:00
23aa663f9d when doing a ripple-all drag, move relevant markers during the drag too
Note that this is purely GUI-level: the ARDOUR::Locations are changed at the end of the drag
in Editor::ripple_marks()
2021-08-13 12:51:28 -06:00
140c5e818f somewhat simplify ripple-all by just grabbing all regions-at-or-after as the drag starts.
This means that we actually explicitly reposition all regions as part of the drag, and do not need to call
Editor::do_ripple(). We do still need to call Editor::ripple_marks() though
2021-08-13 12:51:28 -06:00
7afc45ac5c helpful comment 2021-08-13 12:51:28 -06:00
a1ef870866 prevent ripple drag from passing earlier region starts 2021-08-13 12:51:28 -06:00
311db08cc3 manual fixups for rebase-on-master issues 2021-08-13 12:51:28 -06:00
a95b1d2cd1 for RegionMotionDrag, set _earliest_time_limit if rippling (not yet used) 2021-08-13 12:51:28 -06:00
b04ea33f18 move Drag::_earliest_time_limit to be protected, not private 2021-08-13 12:51:27 -06:00
fbd6c7eaee add earliest_time_limit for Drag class 2021-08-13 12:51:27 -06:00
ac1d5bac0a improve rippling of marks to include any in the gap between the primary-dragged region and the one before it 2021-08-13 12:51:27 -06:00
fc5143772b fix deadlock-inducing failure-to-thaw during region drag (no copy) 2021-08-13 12:51:27 -06:00
1ccf272d58 ripple-all now moves markers too 2021-08-13 12:51:27 -06:00
ddbe0747a9 add whitespace 2021-08-13 12:51:27 -06:00
93982614c4 remove debug output 2021-08-13 12:51:27 -06:00
ff85496b03 we should clear property changes recursively for a region drag, not just toplevel properties 2021-08-13 12:51:27 -06:00
989408626d at end of no-copy region drag, do ripple if appropriate 2021-08-13 12:51:27 -06:00
6896f7228d fill ripple-excluded region container (non-copy drag) 2021-08-13 12:51:27 -06:00
4a1d09d474 determine potential ripple range for non-copy drag 2021-08-13 12:51:27 -06:00
6efbcf1ff7 add variables to track potential ripple at end of drag (no-copy) 2021-08-13 12:51:27 -06:00
741a86ccf6 add container for ripple-excluded regions (no-copy drag) 2021-08-13 12:51:27 -06:00
d2ebc58575 at end of copy-region drag, potentially do ripple 2021-08-13 12:51:27 -06:00
76de8ab3f9 fill ripple-excluded regions container 2021-08-13 12:51:27 -06:00
04c03199dc determine scope of potential end-of-drag ripple 2021-08-13 12:51:27 -06:00
283e2103ba add variables to determine scope of potential ripple at end of drag 2021-08-13 12:51:27 -06:00
7bd03b68ee add container for regions to be excluded from ripple 2021-08-13 12:51:27 -06:00
3e6de18919 move point at which to-be-rerippled regionviews are collected in a RegionMotionDrag 2021-08-13 12:51:27 -06:00
27a906444a clarify comment 2021-08-13 12:51:27 -06:00
e3c7ead943 no cross-track region drags in any ripple mode 2021-08-13 12:51:27 -06:00
0c77a35178 completely remove RegionRippleDrag, and merge Editor::add_region(_copy,}_drag() into one method 2021-08-13 12:51:27 -06:00
9d54bb08e7 remove almost all of RegionRippleDrag, collapsing down to just collecting additional RegionViews that need to be moved during the drag 2021-08-13 12:51:27 -06:00
963d2b6906 use Playlist::rdiff_and_add_command() rather than explicit code 2021-08-13 12:51:27 -06:00
90e4adfed1 ripple drag never allows y motion 2021-08-13 12:51:27 -06:00
eac366ec8e remove RegionRippleDrag::allow_moves_across_tracks since this was already unconditionally set to false
It was also commented "rippling across all tracks is the future", and created notable technical debt
2021-08-13 12:51:27 -06:00
5c830233ec implement ripple-all via select-all for selection drags 2021-08-13 12:51:27 -06:00
636f1331e8 stop using ripple callback API, add Editor::should_ripple() and Editor::do_ripple() to manage rippling 2021-08-13 12:51:27 -06:00
0e2bd5383c GUI changes to follow new Playlist::ripple() API
Current ripple callback does nothing at all
2021-08-13 12:51:27 -06:00
9635aca923 Slip Contents Drag: regions should draw transparently while dragging, so you can line-up transients 2021-08-06 08:29:42 -05:00
45bd2c47d8 Brush Drag: refactor Brush-drag into its own Drag class (operation is still weird though) 2021-06-17 10:56:30 -05:00
69af0e6964 Abort a copy-drag in the case where it would result in a copy at the same location
also code cleanup: clear_draggingview_list() avoids duplicated code
2021-06-17 10:56:30 -05:00
87ecc9b4ca Slip Contents Drag: fix undo 2021-06-17 10:56:30 -05:00
f281e7e3c3 Slip Contents Drag: disambiguate Slip Contents from prior Contents Trim 2021-06-17 10:56:30 -05:00
3d8bccb508 Slip Contents Drag: remove ContentsTrim modifier from the region boundaries
*now that you can grab "anywhere" in the region, trim edges are inferior because they are hard to hit
*modifier had to change anyway (since CTRL is used as a copy-drag on both mac and win), so that invalidates prior muscle memory
*potentially frees up modifier on the trim edge for some other purpose (anchored_trim)
2021-06-17 10:56:27 -05:00
fea3fb9e71 Slip Contents Drag: add ContentsDrag 2021-06-17 10:56:22 -05:00
c62b6e0e3e Control Points should not obey Lock Edit, which was intended to lock regions and notes at the time where they were recorded.
Control Points should ignore x_constraint which is set in Drag::motion and potentially other places.
The only thing that should prevent CP sliding is can_slide which is false for the points at the ends of a region.
2021-06-14 11:51:16 -05:00
232af15b51 fix position of region cue markers during drag and after when region position is not zero 2021-05-25 14:01:30 -06:00
54e0b7f230 renaming cue markers (via dbl-click) 2021-05-24 20:23:06 -06:00
ab2357dfa1 implement dragging for region/cue markers 2021-05-24 12:28:19 -06:00
2016710865 skeleton for RegionMarkerDrag 2021-05-24 09:12:19 -06:00
f1fe1c7066
Amend 445f9a51bf 2021-05-23 23:22:18 +02:00
445f9a51bf
Fix ripple undo/redo
Ripple edit undo/redo needs a "recursive diff" of all regions
in the playlist. To work properly owned changes have to be
cleared first, previously unrelated edits were be collected too.

This includes a more consistent version of
7a89d56009 using rdiff() instead of explicitly
saving region diffs.
2021-05-23 17:42:33 +02:00
fd3220c3d7
Set uninitialized variable (fix playhead dragging) 2021-05-21 17:57:56 +02:00
ce1e05fc3d
Update DnD min. movement threshold -- #8686
Previously x-axis threshold was in samples. This is
useless unless zoomed in to the max. So in most cases
the first-move was always in x-direction, making constrained
y-axis drags near impossible.

Furthermore the threshold for copy-drags was increased
as per #8686
2021-05-08 04:28:36 +02:00
4db1c02bd1
Fix crashes when rippling many regions
Region positions were updated in the GUI, before the playlist
was catching up.

The butler thread reads a region using the region's new position,
but the playlist's old range.


Thread 1 (GUI)
```
#22 ARDOUR::Playlist::notify_layering_changed()
#26 ARDOUR::AudioPlaylist::region_changed
#27 ARDOUR::Playlist::region_changed_proxy
#35 ARDOUR::Region::send_change
#36 ARDOUR::Region::set_position
#37 RegionRippleDrag::remove_unselected_from_views
#38 RegionRippleDrag::finished
```

LayeringChanged() also triggers DiskIOProcessor::playlist_modified
which schedules a pending-override and summons the butler.
Note that when moving only a few regions the butler starts after all
updates have been completed.

Butler thread:
```
#4  ARDOUR::AudioRegion::read_at
#5  ARDOUR::AudioPlaylist::read
#6  ARDOUR::DiskReader::audio_read
#7  ARDOUR::DiskReader::overwrite_existing_audio
#8  ARDOUR::DiskReader::overwrite_existing_buffers
#9  ARDOUR::Track::overwrite_existing_buffers
#10 ARDOUR::Session::non_realtime_overwrite
```

Region read fails:
```
 libs/ardour/audioregion.cc:503  assert (position >= _position);
(gdb) p position
$1 = 1312000
(gdb) p _position
$2 = {<PBD::PropertyTemplate<long>> = {_have_old = true,
    _current = 1336000, _old = 1312000} }
```
2021-05-07 21:56:09 +02:00
e570a290c4 add a few casts to avoid compiler warnings regarding size_type vs int
The class members are int because they need to hold negative (out-of-bound) values as sentinels
2021-05-06 12:03:27 -06:00
b75118ee13 a more robust value check for 8cb09ab2cf modification 2021-05-05 18:48:53 -06:00
8cb09ab2cf fix for region-drag to the dropzone (#8672)
The DraggingView's time_axis_view (index) is set to the size of _time_axis_views
in ::motion() near line 1149. This makes it invalid as index into the vector.
2021-05-05 18:33:44 -06:00
0aef128207 fix assumption that during dragging, a DraggingView's time_axis_view field is always a positive integer within range 2021-05-04 11:55:23 -06:00
5bfc507cb3 fix out-of-bounds access to a vector.
If the time axis view is not found, i will equal N, and _views[i] is out of bounds
2021-05-04 11:54:50 -06:00
ac53a9bbf8 remove unnecessary 2nd argument from Session::request_locate() calls (default value is identical) 2021-05-03 17:40:41 -06:00
7a89d56009
Fix insert + ripple undo/redo
Playlist changes do not include region-property changes.
When inserting a region, position(s) of other Regions may
change and those changes have to be recorded explicitly (for now).

see also RegionRippleDrag.
2021-04-29 22:56:09 +02:00
52b7e68102 use new Session transport API calls in GUI 2021-04-19 16:14:08 -06:00
d4c3e43b03
Address another -Wunused-private-field
TrackSelection is just a different name for TrackViewList
the private _editor is no longer needed nor used.
2021-03-18 04:06:46 +01:00
24398f0df2 click in automation track in object/grab mode adds a new automation point 2021-02-09 22:44:35 -07:00
4769c387f3
Expose EditorCursor via public editor API
This is in preparation to subscribe to playhead cursor position
changes in the recorder-UI.

This change also clean up the API, replacing a public variable
with a const access method and follows #12 of
https://ardour.org/styleguide.html
2021-01-08 18:39:56 +01:00
b59e687f83 prevent addition mouse button press/release events while an existing drag is still underway from interfering (fixes #8529) 2021-01-07 22:55:44 -07:00
Johannes Mueller
9b2228d6fd Fix ripple moving automation points
When ripple moving a region all the subsequent regions will be moved, next
region in the playlist after the dragged one first, last region of the playlist
last.

Thus, when an automation point is ripple moved along a region past the starting
point of the next region, it will be moved again along with the next region as
the move of the next region occurs after moving the automation point.

This fix reverses the sequence of the ripple moves, last region in the playlist
will be moved first, the next after the dragged one, last. So no temporary
overlap of regions will occur.
2020-07-07 19:39:16 +02:00
d99dd1e3ec
Fix auto-play when locating via drag/click in the editor 2020-07-07 18:53:42 +02:00
8dfb49f446 do not clear a MIDI region's note selection when drag-creating a note 2020-05-05 17:57:53 -06:00
51795d2e11
Fix contents-drag (ignore snap) #8073
The "new" snap-to-visual-grid mechanism is not useful for
Contents-trim. That would require a relative grid.
2020-05-01 22:12:39 +02:00
cc32d42388 use new API to get selected MIDI regions and clear current note selection in a MIDI region 2020-04-16 17:48:12 -06:00
899d696a97
Fix another typo #8016 2020-04-16 22:09:01 +02:00
Johannes Mueller
6d75d40533 Quick and dirty dropping support for rippling across tracks
Ripple editing will be reworked some point after 6.0
2020-04-14 23:45:17 +02:00
Johannes Mueller
d2f5edf64f Fix #8012 to some extent.
As soon as we ripple drag the selected region out of the original track,
::remove_unselected_from_views() is called and the rippled regions on the
original track are not covered when ::remove_selected_from_views() is called
again in ::finished(). Therefore we need to shift the regions remaining on the
original track back and forth again, in order to have them properly in the undo
history.
2020-04-14 22:43:15 +02:00
Johannes Mueller
d5f25f998b Fix #7007: ::clear_owned_changes() on rippled Playlist before commit
RegionMoveDrag::finished_no_copy() calls ::clear_changes() on every selected
Region and then sets their positions again before committing the command to the
UndoHistory. By doing that no changes from the previous transaction spill over
into the current transaction.

This needs to be done in a similar way by in RegionRippleDrag::finished()
because otherwise a following undo action would also undo the changes of the
previous transaction for all the non selected rippled regions.

RegionRippleDrags across tracks are still borked, though.
2020-04-13 23:56:52 +02:00
fbc48bdf34
Fix end vs. length bug when creating regions - #7978
set_length() includes the end.
A Region starting at 0 and ending at 0, has a length of 1
(think counting fence-posts, or video-frames).
2020-04-05 20:24:11 +02:00
75adc33629
Remove unused variable 2020-04-01 22:55:06 +02:00
6291433e27 set Editor::_pending_locate_request to true before sending locate request. 2020-03-25 18:39:59 -06:00
4151ec1907 remove accumulated debug output 2020-03-25 15:12:30 -06:00
1b05ebbafa more playhead-drag/click locate debugging 2020-03-25 12:33:46 -06:00
77ab1a39b8 more playhead-drag/click locate debugging 2020-03-25 11:48:53 -06:00
becfad91c2 more playhead-drag/click locate debugging 2020-03-25 11:48:18 -06:00
41ff788a76 more playhead-drag/click locate debugging 2020-03-25 11:03:18 -06:00
ec345037b0
Suppress debug output in optimized builds 2020-03-25 16:43:24 +01:00
777ac65831 debug output 2020-03-24 18:55:16 -06:00
384ded905d debug output 2020-03-24 18:39:46 -06:00
47767738b9 rename DoTheRightThing to RollIfAppropriate 2020-01-18 08:49:18 -07:00
3c00048b0c Session::request_locate() takes a tri-valued second argument for "roll-after-locate"
This allows callers to defer logic about auto-play/current rolling state and more to TransportFSM where it
can be cnentralized and is less ambiguous
2020-01-18 08:49:18 -07:00
edf9478fda
Fix endless loop when drag/copy locked region 2019-11-09 06:00:02 +01:00
a8f9ba4a5e
Preview video frame when dragging 2019-11-09 06:00:01 +01:00
58595a839b remove two unused variables 2019-10-10 16:52:00 -06:00
f491d7ec71
Use Fixed-length when drawing percussive events
Previously adding percussive-hits created sustained notes
using the current grid as duration. This allowed to create
overlapping notes with the overlap not being visible.

Most hardware MIDI drumkits do send an immediate note-off event
after each hit (if they send note-offs at all).
Ardour now follows suit and does the same when using the draw/edit tool.
2019-09-05 00:42:29 +02:00
a1b0991d26
Fix uninitialized argument value
TrimDrag::aborted() -> TrimDrag::finished() -> TrimDrag::motion ()
uses event->button.state
2019-08-20 04:06:31 +02:00
4050ca5633
Update GPL boilerplate and (C)
Copyright-holder and year information is extracted from git log.

git history begins in 2005. So (C) from 1998..2005 is lost. Also some
(C) assignment of commits where the committer didn't use --author.
2019-08-03 15:53:15 +02:00
31815b5f26
NO-OP: whitespace
This fixes mostly <tab> after <space> and similar <tab> not used
for indenting as well as some related code alignment issues.
2019-04-13 17:57:46 +02:00
56047a094c
AutomationRangeDrag tweaks for stacked layer view
Use y-pos and height of given TAV *layer* where the drag was initiated.
2019-03-30 01:19:47 +01:00
546d5d09b5
Remove unused variable 2019-03-30 01:15:17 +01:00
f40456a649
cont'd AutomationRangeDrag update
Properly adding guard-points for all lanes, not just the first found
for each range.
2019-03-30 00:14:26 +01:00
d8571e2572
cont'd AutomationRangeDrag updates -- safety commit
This is work in progress towards fixing stacked region's region-gain
and multiple discontinuous regions spanning multiple tracks.

AutomationRangeDrag::setup() still does not collect all AutomationLine
points for certain overlap scenarios. There's more to come...
2019-03-29 15:57:07 +01:00
0ee6b03144
Implement multi-region AutomationRange drag/drop 2019-03-27 23:25:28 +01:00
c09c7bab52
Update GUI, use Session::playlists() getter (2/2) 2019-03-19 05:14:40 +01:00
b24fef38b2 Fix for automation-line edits using the Range+Draw tool, when no line is already present. 2019-02-12 21:23:01 -06:00
3e442ae52b Session-range behavior (gtk2 part)
* Both the session-start and session-end point should follow the is-free option
  * Rename the end-is-free option to session-range-is-free, to reflect that change
  * This fixes the problem: recording before the start marker would move the Start,
    even if the user had already fixed the End marker.
2019-02-12 11:35:57 -06:00
245d48dbd0
NO-OP: Clarify function name 2018-11-28 15:16:25 +01:00
f150f6c074
Use central method to check for engine where required
These are generally places where tracks/busses are created or port
connections change.
2018-11-28 00:01:50 +01:00
57d7b5de65
GUI limitation: Require engine to add/remove tracks/busses 2018-11-27 13:18:39 +01:00
0883f02de9 new_grid: The Return of the snap_to_X functions.
We no longer assume that Snap always uses the visible ruler lines.
 If you want to snap to the grid, and ignore the users zoom scale, use SnapPref::SnapToGrid_Unscaled
 This fixes 2 (known) oversights: "snap region(s) to grid" and "regions whose start are left of the canvas edge".
2018-07-27 00:28:47 +02:00
fcabb27561 Remove some redundant calls to snap_to(). get_preferred_edit_position() already did it. 2018-02-27 08:55:17 -06:00
0299229e41 SoloSelection: gui part. 2018-02-11 09:39:45 -06:00
dc61256466 new_grid: Rewrite of Snap and Grid. (squashed commit)
Separate Snap from Grid.  Lots of naming changes.
Multiple simultaneous snap options allowed. Grid is one of the possible Snap options.
Grid uses the same data as the rulers.  Replace complicated tempo_lines with simple grid_lines.
The Grid is zoom-scale-sensitive along with the rulers.  If you are zoomed out, grid becomes coarser.
2018-02-09 09:59:39 -06:00
c6eab71435 new_snap: Snapped Cursor ( squashed commit )
Snapped Cursor is a line that follows the edit point, and indicates where the operation will occur.
This replaces and extends the line that appears with the Cut tool.
New associated preferences:  snap_threshold and show_snap_cursor.
2018-02-09 08:21:45 -06:00
1a8ac58c1a remove unused variables 2017-10-26 15:41:11 -04:00
7db12f6b12 convert codebase to use Temporal for various time types 2017-09-24 12:03:54 -04:00
30b087ab3d globally change all use of "frame" to refer to audio into "sample".
Generated by tools/f2s. Some hand-editing will be required in a few places to fix up comments related to timecode
and video in order to keep the legible
2017-09-18 12:39:17 -04:00
f9e7ffc601 no more per-track varispeed 2017-09-18 11:40:53 -04:00
nick_m
1c51435fa3 Calculate clamped tempo stretch ratios using the correct (musical) domain 2017-07-22 02:15:20 +10:00
nick_m
1399ef391d Remove redundant beat arg from TempoMap::add_meter
BBT time should be enough to determine the beat.
2017-07-22 02:15:20 +10:00
nick_m
cadb5c481c Disable tempo end/twist drag for meter-locked tempi
It was assumed that the drag takes place within an area of musical time.
This is not true for the space before any non-initial
meter-locked tempo.
In the case of the initial tempo, there is no previous section
to perform an end-drag on.
2017-07-22 02:15:20 +10:00
nick_m
2bec17ca1a Remove duplicated tempo curve colour change when dragging 2017-07-22 02:15:20 +10:00
nick_m
d94c630134 Fix various issues wrt BBTRulerDrag
If we've clicked on a tempo bar before the initial tempo,
don't allow anything to happen.
If it was just a click, ensure the tempo curve colour is restored.
2017-07-22 02:15:20 +10:00
611a150dfb Editor Summary: Don't require user to re-click to scroll + zoom.
* Use conventions similar to those used in CursorDrag.
2017-07-20 14:15:40 -05:00
40e2f9a68a CursorZoomDrag rework:
* If the use-time-rulers-to-zoom option is enabled, -all- cursor drags can zoom.
* Behavior has been tweaked so it is easy to scroll without zooming, if you want to.
2017-07-20 09:51:26 -05:00
Thomas Brand
63ea7b6516 NO-OP whitespace (updated GH PR #357) 2017-07-01 19:28:26 +02:00
f7c134863c Tweak/Change the zoom scale in RulerZoomDrag
This multiplier really should be based on the "responsiveness" of the
canvas..or something. I think this is an improvement for more complex sessions
with many regions.
2017-06-26 08:40:47 +10:00
fd36355e2c Log-scale/relative automation point dragging 2017-06-21 18:13:03 +02:00
1d28665f86 Use Stripable::Sorter in GUI consistently. 2017-06-17 04:36:39 +02:00
nick_m
8502aa18c5 NoteCreateDrag - Fix incorrect note length due to use of region-relative position 2017-06-10 03:49:01 +10:00
dc0139d4af use CoreSelection for track selection 2017-05-05 18:56:25 +01:00
e54413ee46 amend be62d335ee 2017-04-22 01:06:54 +02:00
be62d335ee fix endless loop when clicking on the canvas w/o backend 2017-04-21 23:54:33 +02:00
nick_m
028b042d2a snapped pencil drawing of new midi regions cannot be zero (7271).
- fixes a couple of other oddities in the behaviour.
2017-03-07 10:36:48 +11:00
nick_m
4512b67fa5 fix crash when dragging region from list. 2017-03-07 02:30:48 +11:00
nick_m
16089bff96 more linked midi region trim drag fixes.
- freeze the correct playlists on fiorst move.

	- only update the start offset of linked regions once the drag
	  has finished.
2017-03-06 15:51:53 +11:00
nick_m
fc47da6511 ensure no movement when draggin regions with x constrained.
- should fix 7260
2017-03-06 01:57:12 +11:00
nick_m
a445e82776 fix undo if a midi region start trim changed the source offset.
- this diffs all playlists that use the same source.

	- the secons part hould be a no-op, but needs testing
	  (trim drag undo on audio and midi regions)
2017-03-06 01:01:37 +11:00
nick_m
5c741b7a07 tempo editing updates
- a tempo marker may now be set to always continue (clamped)
	  this means that the end tempo of the previous section will
	  track the start tempo during tempo ops.
	  it mimics the behaviour in 5.8, with the gui indicating
	  the curves to be changed.
2017-03-05 05:21:56 +11:00
nick_m
345f38f1de undoing a create note drag restores screen position. 2017-03-05 02:06:49 +11:00
nick_m
1f9c26136c rework percussive hit spraying.
- the spray is limited to the first entered note.

	- all new notes are selected (requires a selection change to
	  MRV::create_note_at()
2017-03-05 01:57:10 +11:00
nick_m
fb4b72231a spraying percussive hits has one undo step per drag.
- should fix 7134
2017-03-05 01:50:04 +11:00
nick_m
243fd7a428 remove 'mouse:' verbose cursor when shift-dragging a curve. 2017-02-27 20:16:10 +01:00
nick_m
f8a6f8918d back to using shift-ctrl for pinch drag. set colours of affected curves. 2017-02-27 20:16:10 +01:00
nick_m
8e944953c6 highlight the tempo curve that is to be altered, modify text to suit. 2017-02-27 20:16:10 +01:00
nick_m
f4d51ee0d0 fix verbose cursor display when shift-dragging end tempo. 2017-02-27 20:16:10 +01:00
nick_m
636583e6ef restore pinch tempo. it now operates via shift + alt drag on the curve. 2017-02-27 20:16:10 +01:00
nick_m
211226983d remove tempo end drag (the control drag on the curve). a;ter tempo marker drag.
- holding down shift before initiating a tempo mark drag
	  alters the end tempo of the previous one as before, but
	  this is now a separate drag.
	- restore vertical dragging of the tempo mark to alter start/
	  end tempo. shift during the makrker drag alters start tempo.
	  xontrol + shift during the drag alters end tempo.
2017-02-27 20:16:10 +01:00
nick_m
1359f18543 fix formatting of bbtruler drag verbose cursor. 2017-02-27 20:16:10 +01:00
nick_m
97c4c2a28c complete changes to tempo type.
- this implements in the intention behind the previous commit.
	  a tempo mark is constant until its end has been changed by a
	  shift-drag on the next marker.
2017-02-27 20:16:10 +01:00
nick_m
ccb51a8ddb rework tempo editing.
most changes are due to a new design where tempo discontinuities at the
beginning of a ramped section may be set.
this allows easier mapping of live performance, especially in
the common case of a ramped ritard before the beginning of a new section.

feature summary:

holding constraint modifier (shift) while dragging the BBT ruler area
drags the tempo lines by changing the start tempo (as before)

holding copy modifier (control) while dragging the BBT ruler area
drags the tempo lines by changing the end tempo (ahem. not quite there)

dragging a tempo mark while holding constraint (shift) will change the
previous end tempo to match the marker position *worth trying*.

holding constraint and copy modifier (control + shift) while dragging
the BBT ruler area attempts to'pinch' or twist the surrounding tempi
sp that later ones are not repositioned (currently suffereng from
rounding errors)
2017-02-27 20:16:10 +01:00
542b789a42 probable fix for crash while dragging playhead 2017-02-19 19:44:37 +01:00
nick_m
858e44745b fix constrained region drags across tracks (7242). 2017-02-16 08:57:03 +11:00
234ea15499 do NOT remove tracks from selection during drag selection on the basis of geometry alone.
Membership of select-enabled route groups matters too.
2017-02-08 17:40:27 +01:00
nick_m
931910b046 hotfix for cross-track dragging bug with music-locked regions. 2017-02-07 05:08:54 +11:00
nick_m
4161a60244 NoteDrag copy modifier detection is no longer explicit. 2017-02-07 01:56:47 +11:00
nick_m
5031bdcf10 midi note drags are music-based.
- wysiwyg (during drag) when dragging more than one note across
	  a tempo change.

	- introduces a muscal equivalent of snap_delta (only used for
	  note drags atm)

	- split earliest note in selection into a separate function

	- MRV::copy_selection() returns the equivalent _primary note
  	  to avoid offset hell.

	- RV::snap_frame_to_frame returns a MusicFrame

	- prevent note drag moving before region start.
2017-02-05 05:02:01 +11:00
nick_m
04c484089c non-primary music-locked regions follow tempo changes while dragging.
- the contents still don't update but position is much
          more wysiwyg.
2017-02-04 22:57:36 +11:00
nick_m
d38dc86380 rework RegionMotionDrag so that we can actually drag a region to zero.
- did this ever work?
2017-02-04 22:57:36 +11:00
nick_m
b04f89be51 make dragging a region from the list not crash.
- its still a fake event, but we can at least get the snap correct.

	- playlist->add_region() parameters were whacky
	  (for Playlist::add_region_internal()?)
2017-02-04 22:57:36 +11:00
nick_m
970ed12fee fix thinko wrt Drag::adjusted_frame() 2017-02-04 22:57:36 +11:00
nick_m
650c1381d4 setup_snap_delta() need only take a framepos_t. 2017-02-04 22:57:36 +11:00
nick_m
59daffea1d rework snap
snap now fills in a struct (MusicFrame) which contins a snapped frame
along with a music divisor.
this gives useful information wrt magnetic snap which may or may not
have rounded to an exact musical position.

region position may now be set musically (using quarter notes for now).

this patch fixes several problems in the current code:

	- dragging a list of music-locked regions now maintains correct
	  musical offsets within the list.

	- splitting regions using magnetic snap works correctly (#7192)

	- cut drag should now work correctly with magnetic snap.

	- musical length of split midi regions is no longer frame based.
2017-02-04 22:57:36 +11:00
6de15a79cf improve range drag semantics
If a track is selected during the drag (by moving the mouse pointer into a new track), but it was not
selected at the start, and is then de-selected (by moving the mouse back out of it), then remove
it from the selection.
2017-01-25 21:46:24 +01:00
8dedea5ffa implement copy-drag for MIDI notes.
Probably some corner cases to be fixed, but pretty functional and largely modelled
on existing code (paste, drag, step add note etc.)
2017-01-23 21:58:02 +01:00
7960e1ddbf GUI follow up for new-MIDI-track API change 2017-01-20 21:47:09 +01:00
7551f6941f never remove tracks from selection during a range drag 2017-01-10 15:18:00 +00:00
nick_m
d0580ecfbc allow all types of range location (loop, start, end etc.) to be glued to bars and beats. 2016-12-29 01:39:31 +11:00
628c99d555 Follow Edits => Follow Range
* "Follow Edits" button had several behaviors that confused users.
* "Follow Range" only has 2 behaviors:
** Click anywhere in Range mode (or Smart mode) to locate the playhead.
** When you select a Range, "Play" will play the selected range.
2016-12-19 13:14:44 -06:00
nick_m
d4f7f5ffa2 TempoMap - rename some methods.
gui_move_tempo   -> gui_set_tempo_position
	gui_move_meter   -> gui_set_meter_position
	gui_dilate_tempo -> gui_stretch_tempo
2016-12-19 04:13:17 +11:00
nick_m
27b95300e2 add frame parameter for Meter ctor and TempoMap::replace_meter(). allow for various failures. 2016-12-19 04:02:01 +11:00
nick_m
c518bc3fb7 when dragging or copying multiple regions, respect position lock style.
- music-locked regions are moved by drag beat distance
	  (will conform to tempo changes over the drag distance)
	  audio-locked regions are moved by frame distance.
2016-12-14 02:08:59 +11:00
b34a614df4 Further fixes to non-cxx11 enabled builds
Hopefully all that is necessary this time
2016-12-13 17:10:30 +10:00
0eff7d4a0c Add option to Zoom to Selection on double click
Currently implemented for Region and Range selections.

The new option is false/off by default to maintain existing behaviour. I'm not
sure it should require another option, perhaps Zoom to Selection should be the
default and accessing the region properties dialog can be via Modifier+double
click, but further changes can be made on user feedback etc.

Related: #7112
2016-12-13 13:02:04 +10:00
nick_m
44e8181c36 only set the exact musical position of the primary region for move/copy drag. 2016-12-13 04:33:58 +11:00
nick_m
34e41a3ca6 rename MetricSection movable -> initial, but of course initial is !movable.. 2016-12-12 02:07:00 +11:00
Julien ROGER
c5cda446e0 Fix crash when track creation failed draging region
Add more check when creating a new track from a region drag into editor's empty area.

Fix #6496
2016-12-06 22:23:29 +10:00
nick_m
fcad5a337f decouple midi region note range and height from midi streamview.
- this allows a midi region drag to update the visible notes
	  correctly while crossing MIDI streamviews with a differing
	  note range.
	  as a side effect, fixes a bug where changing
	  note range on a track did not draw some notes
	  (apply_note_range redisplays the model).
2016-11-23 08:04:14 +11:00
nick_m
62f37da989 filter events in HitCreateDrag, remove some code. 2016-11-22 02:05:32 +11:00
nick_m
cc1d33a91d NoteCreateDrag - remove some code 2016-11-22 01:59:57 +11:00
73f3e479d3 Make Cut mode respect snap modifer 2016-11-21 22:19:56 +10:00
d4190d3761 Show cursor in Cut mode on button press at cutting position
Previously it would be shown at the mouse cursor position even though the
Region is cut/split at the snap/quantize point if no motion occurred.
2016-11-21 20:45:35 +10:00
4ec299779c Reparent cursor used in Cut mode so that it is on top and visible 2016-11-21 20:11:47 +10:00
nick_m
e0c06f39e1 clean up HitCreateDrag. should be a no-op. 2016-11-21 04:57:32 +11:00
nick_m
eef18c47fd fix compilation, rename PercussiveCreateDrag -> HitCreateDrag 2016-11-21 04:20:27 +11:00
nick_m
71c0c872b7 only spray percussive hits during create drag if the grid is in use. 2016-11-21 04:11:54 +11:00
nick_m
5bcb9adbf8 rework mouse hit creation (percussive mode) - mostly as per #7130.
- snap behaviour is round to nearest

	- holding down button 1 while dragging creates many
	  (if not already present) hits.
2016-11-21 04:02:21 +11:00
nick_m
4d0422a0fc NoteCreateDrag scope fix - should be a no-op. 2016-11-21 01:46:42 +11:00
nick_m
d92d9d3a79 use a minimum note length of whatever 1 px is in beats in NoteCreateDrag. 2016-11-21 01:44:56 +11:00
nick_m
cb64e926c2 NoteCreateDrag starts on button press.
- removes the separation between click and
	  drag-creation of notes noth now handled by the drag code).
2016-11-20 04:49:18 +11:00
nick_m
0e0b7667ed NoteCreateDrag::grid_frames works over a tempo change. 2016-11-20 04:42:20 +11:00
nick_m
ca046a8bb2 fix incorrect subdivision when dragging/trimming regions using magnetic snap.
- amends d2d2308588
2016-11-18 01:04:30 +11:00
nick_m
d2d2308588 magnetic snap uses note divisor appropriately.
- also looks nicer when resizing MIDI regions.
2016-11-17 04:08:13 +11:00
dac2d41ee2 Add option to zoom using button press in the time rulers and dragging vertically
This is a common operation used for zooming in other DAWs like Ableton Live and
Cubase. To support such a usage pattern without changing the existing behaviour
of the ruler area I've made it an option that is false by default.

The behaviour of RulerDragZoom is intentionally different than a CursorDrag
that occurs in the rest of the ruler area in that it doesn't follow the snap to
grid setting and no locate related stuff occurs until button release.

There are some issues with responsiveness with more than a few hundred regions
or a large amount of MIDI events/notes.

Implements feature #6768
2016-11-11 14:13:53 +10:00
nick_m
d9dea0a3aa rename Region pos_beats -> quarter_note 2016-11-11 03:37:08 +11:00
nick_m
33e95a1577 rename Tempo _beats_per_minute to _note_types_per_minute, provide pulse helpers.
- adds quarter_notes_per_minute(), note_divisions_per_minute (double)
	  pulses_per_minute() and frames_per_quarter_note()

	- this should be a no-op except for the use of tempo by
	  the vst callback which definitely uses quarter notes per minute.

	- the XML node for TempoSection named 'beats-per-minute'
	  has been renamed.
2016-11-11 03:37:08 +11:00
nick_m
594137f5cc remove public pulse methods from TempoMap.
- the only object whose musical position is not expressed in
	  quarter notes is MetricSection.
	  there is now no need to expose this.
2016-11-11 03:37:08 +11:00
nick_m
1d540605ac clamp setting tempo via vertical drag.
- a bit suboptimal. we really need the opposite of _trackview_only
	  to prevent jumping to track canvas scrolled coordinates in the first place.
2016-11-11 03:37:08 +11:00
nick_m
dca96d8b5d rename Region pulse to pos_beats. use new beat distance api where required.
- add more debugging output detecting regions whose
	  beat and frame position do not align on a playlist.
	  this is required as a check as we have never used
	  frame rounding on constant tempi before 8884a5723dc
2016-11-11 03:37:08 +11:00
nick_m
0e867b544b Refactor tempo api, include quarter-note distance in frames method.
- moves frame rounding up to TempoMap, which is needed
	  in order to calculate pulse distance without frame rounding.

	- the time unit for tempo is still minute, but this now also
	  applies to meter sections. (new audio locked meter sections no
	  longer require a frame position).

	- there is no longer a discontinuity
	  in the pulse for audio-locked meter/tempi.

	- temporarily add debugging output in Region::set_position()
	  to test for region beat not matching region frame.
2016-11-11 03:37:08 +11:00