Skip to content

Commit 0f02df6

Browse files
authored
Release Fade tool (works on context of mouse, razor or time selection) v2.2.3 (#1462)
- to avoid simultaneous work of Batch fade tool and changing fade under the mouse - ignore TS if one of it's edges is out of arrange view and the mouse is over an item.
1 parent 37ef008 commit 0f02df6

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

Items Editing/az_Fade tool (work on context of mouse, razor or time selection).lua

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-- @description Fade tool (works on context of mouse, razor or time selection)
22
-- @author AZ
3-
-- @version 2.2.2
4-
-- @changelog - fixed the case when there is selected item outside of time selection and nothing happened
3+
-- @version 2.2.3
4+
-- @changelog - to avoid simultaneous work of Batch fade tool and changing fade under the mouse - ignore TS if one of it's edges is out of arrange view and the mouse is over an item.
55
-- @provides
66
-- az_Fade tool (work on context of mouse, razor or time selection)/az_Options window for az_Fade tool.lua
77
-- [main] az_Fade tool (work on context of mouse, razor or time selection)/az_Open options for az_Fade tool.lua
@@ -2445,14 +2445,20 @@ if RazorEditSelectionExists() == true then
24452445
if UndoString then return UndoString end
24462446
else
24472447
local env = reaper.GetSelectedEnvelope(0)
2448-
start_TS, end_TS = reaper.GetSet_LoopTimeRange2( 0, false, false, 0, 0, 0 )
2448+
24492449
if env then
24502450
reaper.Undo_BeginBlock2( 0 )
24512451
reaper.PreventUIRefresh( 1 )
24522452
sTime = PointToMouse(env)
24532453
end
24542454
if UndoString then return UndoString end
24552455

2456+
local item_mouse, itemHalf = GetTopBottomItemHalf()
2457+
start_TS, end_TS = reaper.GetSet_LoopTimeRange2( 0, false, false, 0, 0, 0 )
2458+
local startArrange, endArrange = reaper.GetSet_ArrangeView2( 0, false, 0, 0, 0, 0 )
2459+
2460+
if item_mouse and (start_TS <= startArrange or end_TS >= endArrange) then start_TS = end_TS end
2461+
24562462
if start_TS ~= end_TS and reaper.CountSelectedMediaItems(0)> 0 and UndoString == nil then
24572463
reaper.Undo_BeginBlock2( 0 )
24582464
reaper.PreventUIRefresh( 1 )
@@ -2462,11 +2468,9 @@ else
24622468
UndoString = "FadeTool - time selection"
24632469
return UndoString
24642470
end
2465-
24662471
end
24672472

24682473
if UndoString == nil then
2469-
local item_mouse, itemHalf = GetTopBottomItemHalf()
24702474

24712475
if item_mouse then --and (Opt.IgnoreLockingMouse == true or fadesLock == 0) then
24722476
reaper.Undo_BeginBlock2( 0 )
@@ -2505,7 +2509,7 @@ end
25052509

25062510
---------------------------
25072511
-----------START-----------
2508-
CurVers = 2.22
2512+
CurVers = 2.23
25092513
version = tonumber( reaper.GetExtState(ExtStateName, "version") )
25102514
if version ~= CurVers then
25112515
if not version or version < 2.0 then

0 commit comments

Comments
 (0)