Skip to content

Commit 963f193

Browse files
authored
Update amagalma_Split item at mouse cursor position ( Define crossfade and selection settings ).lua
1 parent 4990ecf commit 963f193

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

Items Editing/amagalma_Split item at mouse cursor position ( use defined crossfade and selection settings )/amagalma_Split item at mouse cursor position ( Define crossfade and selection settings ).lua

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ end
1313

1414
local chosen_selection = tonumber(reaper.GetExtState("amagalma_Split at mouse cursor position", "selection")) or 3
1515
local xfadeposition = tonumber(reaper.GetExtState("amagalma_Split at mouse cursor position", "xfadeposition")) or 1
16-
16+
local snaptogrid = tonumber(reaper.GetExtState("amagalma_Split at mouse cursor position", "snaptogrid")) or 0
1717

1818
local t = {
1919
{"#Selection after split:"},
@@ -24,7 +24,9 @@ local t = {
2424
{"#Auto crossfade position:"},
2525
{"on the left side", 1},
2626
{"centered at mouse cursor position", 0.5},
27-
{"on the right side", 0}
27+
{"on the right side", 0},
28+
{"|#Respect snap setting:"},
29+
{"snap to grid respected", snaptogrid}
2830
}
2931

3032

@@ -35,6 +37,8 @@ for i = 1, #t do
3537
if chosen_selection == i-1 then check = "!" end
3638
elseif i > 6 and i < 10 then
3739
if xfadeposition == t[i][2] then check = "!" end
40+
elseif i == 11 then
41+
if snaptogrid == 1 then check = "!" end
3842
end
3943
menu = menu .. check .. t[i][1] .. "|"
4044
end
@@ -53,6 +57,9 @@ gfx.quit()
5357

5458
if selection > 2 and selection <= 5 then
5559
reaper.SetExtState("amagalma_Split at mouse cursor position", "selection", t[selection-1][2], true)
56-
elseif selection > 6 then
60+
elseif selection > 6 and selection < 10 then
5761
reaper.SetExtState("amagalma_Split at mouse cursor position", "xfadeposition", t[selection][2], true)
62+
elseif selection == 11 then
63+
reaper.SetExtState("amagalma_Split at mouse cursor position", "snaptogrid", 1 - snaptogrid, true)
5864
end
65+
reaper.defer(function() end)

0 commit comments

Comments
 (0)