You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update BuyOne_Update FX chain at object selection when one FX window at a time enabled.lua (ReaTeam#1174)
* Update BuyOne_Update FX chain at object selection when one FX window at a time enabled.lua
* Update BuyOne_Update FX chain at object selection when one FX window at a time enabled.lua
* Update BuyOne_Update FX chain at object selection when one FX window at a time enabled.lua
* Update BuyOne_Update FX chain at object selection when one FX window at a time enabled.lua
* Update BuyOne_Update FX chain at object selection when one FX window at a time enabled.lua
* Update BuyOne_Update FX chain at object selection when one FX window at a time enabled.lua
* Update BuyOne_Update FX chain at object selection when one FX window at a time enabled.lua
* Update BuyOne_Update FX chain at object selection when one FX window at a time enabled.lua
* Update BuyOne_Update FX chain at object selection when one FX window at a time enabled.lua
* Update BuyOne_Update FX chain at object selection when one FX window at a time enabled.lua
ifCheck_reaper_ini('fxfloat_focus')&2==0thenr.MB(space(6)..'The script only makes sense when option\n\n"Only allow one FX chain window open at a time"\n\n'..space(9)..'is enabled at Preferences -> Plug-ins', 'ERROR',0)
111
-
returnr.defer(function() ifnotblathenreturnendend) end
172
+
returnr.defer(function() ifnotblathenreturnendend) end
localinit_take=r.GetSelectedMediaItem(0,0) andr.GetActiveTake(r.GetSelectedMediaItem(0,0)) -- ensures that track selection gets priority and there's no competition between track and take fx chains of selected objects when the script is launched because act_take ~= init_take condition won't be true
@@ -131,20 +197,22 @@ local act_take = item and r.GetActiveTake(item)
ifsel_trand (sel_tr~=init_trorcurr_ctx~=init_ctx) andcurr_ctx==0-- curr_ctx ~= init_ctx makes sure track and take fx chains can be switched even if object selection hasn't changed
200
+
localchain_op=chain_opand (r.GetFocusedFX() >0orGetMonFXProps() >=0orjsAPIandr.JS_Window_GetTitle(r.JS_Window_Find('FX: ', false)):match('FX: [ItemMonigsTrack]+')) ornotchain_op-- empty FX chains are ignored by GetFocusedFX() so have to be detected via window props search
ifnotignore_trandsel_trand (sel_tr~=init_trorcurr_ctx~=init_ctx) andcurr_ctx==0andDOCKER_STATEandchain_op-- curr_ctx ~= init_ctx makes sure track and take fx chains can be switched even if object selection hasn't changed
136
204
then
137
-
localmaster, track-- specifically declared, otherwise empty fx chains get opened, because the vars become global and don't depend on the below condition any longer
138
-
ifmain_chandr.TrackFX_GetCount(sel_tr) >0then
205
+
localmaster, track-- specifically declared, otherwise empty fx chains get opened even if not enabled, because the vars become global and don't depend on the below condition any longer
iftake_chandact_takeandact_take~=init_takeandr.TakeFX_GetCount(act_take) >0andcurr_ctx==1-- curr_ctx ~= init_ctx condition isn't used so take FX chain doesn't compete with track FX chain completely preventing it from loading in tabbed dock layout
215
+
ifnotpref_open_tr_chandtake_chandact_takeandact_take~=init_takeand(empty_chornotempty_chandr.TakeFX_GetCount(act_take) >0)andcurr_ctx==1andDOCKER_STATEandchain_op-- curr_ctx ~= init_ctx condition isn't used so take FX chain doesn't compete with track FX chain completely preventing it from loading in tabbed dock layout
148
216
then
149
217
r.Main_OnCommand(40638,0) -- Item: Show FX chain for item take
150
218
init_take=act_take
@@ -153,7 +221,7 @@ or change_focus and act_take ~= init_take and r.SetCursorContext(1) or curr_ctx
153
221
154
222
ifr.CountSelectedMediaItems(0) ==0theninit_take=nilend-- reset, ensures that FX chain of the last selected item can be re-opened after the item was deselected and selected again
155
223
--[needed when curr_ctx ~= init_ctx isn't used as a condition to switch to take fx chain since it's commented out in the track fx chain selection routine to prevent auto-switching to take fx chain in tabbed docker layout]
156
-
ifr.CountSelectedTracks(0) ==0theninit_tr=nilend-- reset, ensures that FX chain of the last selected track can be re-opened after the track was deselected and selected again
224
+
ifr.CountSelectedTracks2(0, true) ==0theninit_tr=nilend--wantmaster true; reset, ensures that FX chain of the last selected track can be re-opened after the track was deselected and selected again;
0 commit comments