Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release Alt+shift+left click to exclusive solo FX (bypass others) in TCP, MCP FX list (background) v1.0 #1487

Merged
merged 1 commit into from
Jan 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Loading