Skip to content

Commit

Permalink
Added DoomSquirrel_Toggle mute between selected tracks & track under …
Browse files Browse the repository at this point in the history
…mouse
  • Loading branch information
tuomiorava committed Jul 13, 2024
1 parent 2b5009d commit 83c95d4
Showing 1 changed file with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
-- @description DoomSquirrel_Toggle mute between selected tracks & track under mouse
-- @author DoomSquirrel
-- @license GPL v3
-- @about
-- # Toggle mute between selected tracks & track under mouse
-- Switches track mute states between the selected track(s) and the track under mouse.
-- Ensures that the selected track and the track under the mouse do not have
-- the same mute state - so that you can toggle which one you're hearing.
-- @repository
-- https://github.com/tuomiorava/REAPER-ReaScripts
-- @links
-- My music = http://iki.fi/atolonen
-- @donation
-- Donate via PayPal https://www.paypal.com/donate/?hosted_button_id=2BEA2GHZMAW9A
-- @version 1.0
-- @changelog
-- Initial release

local muteSw = 1
local mousetr = reaper.GetTrackFromPoint(reaper.GetMousePosition())

if (mousetr) then
_, mute = reaper.GetTrackUIMute(mousetr)
muteSw = (mute and 0 or 1)
reaper.SetTrackUIMute(mousetr, muteSw, 0)
end

for i = 0, reaper.CountTracks(0) do
local tr = reaper.GetTrack(0, i)

if (tr) then
if (reaper.IsTrackSelected(tr)) then
reaper.SetTrackUIMute(tr, (muteSw == 1 and 0 or 1), 0)
end
end
end

0 comments on commit 83c95d4

Please sign in to comment.