Skip to content

Commit

Permalink
Update cfillion_Song switcher.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
cfillion authored Oct 13, 2024
1 parent 167f43c commit dc2114d
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions Various/cfillion_Song switcher.lua
Original file line number Diff line number Diff line change
Expand Up @@ -160,24 +160,6 @@ local function loadTracks()
return songs
end

local function getParentProject(track)
local search = reaper.GetMediaTrackInfo_Value(track, 'P_PROJECT')

if reaper.JS_Window_HandleFromAddress then
return reaper.JS_Window_HandleFromAddress(search)
end

for i = 0, math.huge do
local project = reaper.EnumProjects(i)
if not project then break end

local master = reaper.GetMasterTrack(project)
if search == reaper.GetMediaTrackInfo_Value(master, 'P_PROJECT') then
return project
end
end
end

local function isSongValid(song)
for _,track in ipairs(song.tracks) do
if not pcall(reaper.GetTrackNumMediaItems, track) then
Expand Down Expand Up @@ -403,6 +385,24 @@ local function execRemoteActions()
end
end

local function getParentProject(track)
local search = reaper.GetMediaTrackInfo_Value(track, 'P_PROJECT')

if reaper.JS_Window_HandleFromAddress then
return reaper.JS_Window_HandleFromAddress(search)
end

for i = 0, math.huge do
local project = reaper.EnumProjects(i)
if not project then break end

local master = reaper.GetMasterTrack(project)
if search == reaper.GetMediaTrackInfo_Value(master, 'P_PROJECT') then
return project
end
end
end

local function execTakeMarkers()
if not reaper.GetNumTakeMarkers then return end -- REAPER v5

Expand Down

0 comments on commit dc2114d

Please sign in to comment.