mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 07:45:00 +01:00
Relative snap - support magnetic mode (hackishly for now)
This commit is contained in:
parent
bbafb8f137
commit
91a34c596d
9 changed files with 92 additions and 11 deletions
|
|
@ -2653,6 +2653,16 @@ Editor::snap_to (framepos_t& start, RoundMode direction, bool for_mark)
|
|||
snap_to_internal (start, direction, for_mark);
|
||||
}
|
||||
|
||||
void
|
||||
Editor::snap_to_no_magnets (framepos_t& start, RoundMode direction, bool for_mark)
|
||||
{
|
||||
if (!_session || _snap_mode == SnapOff) {
|
||||
return;
|
||||
}
|
||||
|
||||
snap_to_internal (start, direction, for_mark, true);
|
||||
}
|
||||
|
||||
void
|
||||
Editor::timecode_snap_to_internal (framepos_t& start, RoundMode direction, bool /*for_mark*/)
|
||||
{
|
||||
|
|
@ -2720,7 +2730,7 @@ Editor::timecode_snap_to_internal (framepos_t& start, RoundMode direction, bool
|
|||
}
|
||||
|
||||
void
|
||||
Editor::snap_to_internal (framepos_t& start, RoundMode direction, bool for_mark)
|
||||
Editor::snap_to_internal (framepos_t& start, RoundMode direction, bool for_mark, bool no_magnets)
|
||||
{
|
||||
const framepos_t one_second = _session->frame_rate();
|
||||
const framepos_t one_minute = _session->frame_rate() * 60;
|
||||
|
|
@ -2890,6 +2900,10 @@ Editor::snap_to_internal (framepos_t& start, RoundMode direction, bool for_mark)
|
|||
|
||||
case SnapMagnetic:
|
||||
|
||||
if (no_magnets) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (presnap > start) {
|
||||
if (presnap > (start + pixel_to_sample(snap_threshold))) {
|
||||
start = presnap;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue