Skip to content

Commit

Permalink
Release Alt+shift+left click to exclusive solo FX (bypass others) in …
Browse files Browse the repository at this point in the history
…TCP, MCP FX list (background) v1.0 (#1487)
  • Loading branch information
jopoet authored Jan 18, 2025
1 parent d267bfb commit 9877361
Showing 1 changed file with 50 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
-- @description Alt+shift+left click to exclusive solo FX (bypass others) in TCP, MCP FX list (background)
-- @author daodan
-- @version 1.0
-- @link Forum thread https://forum.cockos.com/showthread.php?p=2809719
-- @about
-- # Alt+shift+left click to exclusive solo FX (bypass others) in TCP, MCP FX list (background)
--
-- While script running you can alt+shift+left click FX in TCP, MCP FX list to solo this FX, i.e. bypass other FXs on this track.

function Checks()
if reaper.APIExists("CF_GetSWSVersion") == false then
reaper.ShowMessageBox("Please, install SWS/S&M extension","Checks failed",0)
return
end
if reaper.APIExists("JS_ReaScriptAPI_Version") == false then
reaper.ShowMessageBox("Please, install js_ReaScriptAPI extension","Checks failed",0)
return
end
return 1
end

function SetButtonState(set)
local is_new_value, filename, sec, cmd, mode, resolution, val = reaper.get_action_context()
reaper.SetToggleCommandState( sec, cmd, set or 0 )
reaper.RefreshToolbar2( sec, cmd )
end

local mousePressed = 0
local function main()
local mouse = reaper.JS_Mouse_GetState(-1)
if mouse & 25 == 25 then --check for alt+shift+left click
local x, y = reaper.GetMousePosition()
local trk, info = reaper.GetThingFromPoint(x, y)
if mousePressed==0 then
mousePressed = 1
if info == 'mcp.fxparm' or info == 'mcp.fxlist' or info == 'tcp.fxlist' or info == 'tcp.fxparm' then
reaper.Main_OnCommand(41110,0) -- Track: Select track under mouse
reaper.Main_OnCommand(reaper.NamedCommandLookup("_S&M_FXBYPALL2"),0) --SWS/S&M: Bypass all FX for selected tracks
end
end
else
mousePressed = 0
end
reaper.defer(main)
end

if not Checks() then return end
SetButtonState(1)
main()
reaper.atexit(SetButtonState)

0 comments on commit 9877361

Please sign in to comment.