Skip to content

Commit

Permalink
Update smandrap_Select next track in TCP or in Mixer.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
smandrap authored Feb 15, 2024
1 parent 3cecd23 commit 111add6
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions Navigation/smandrap_Select next track in TCP or in Mixer.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
-- @description smandrap_Select next track in TCP or in Mixer.lua
-- @author smandrap
-- @version 1.0.0
-- @noindex
-- @about Select next visible track in TCP or Mixer.
-- @readme_skip
Expand All @@ -13,21 +12,21 @@ local function next_in_mcp()
local id = 0

if first_sel_t then id = reaper.GetMediaTrackInfo_Value(first_sel_t, 'IP_TRACKNUMBER') end



local tr_cnt = reaper.CountTracks()
if id >= tr_cnt then return end


--if id >= tr_cnt then return end

for i = id, tr_cnt - 1 do
local t = reaper.GetTrack(-1, i)
if reaper.IsTrackVisible(t, true) then

if reaper.IsTrackVisible(t, true) and reaper.GetMediaTrackInfo_Value(t, 'I_MCPW') > 0 then
reaper.SetOnlyTrackSelected(t)
return t
return
end
end

reaper.SetOnlyTrackSelected(first_sel_t) -- if everything fails

end


Expand Down

0 comments on commit 111add6

Please sign in to comment.