View Single Post
Old 05-10-2019, 10:38 AM   #13
Human being with feelings
tXShooter's Avatar
Join Date: Aug 2017
Posts: 301

Originally Posted by Lokasenna View Post
local songs = {}

... do stuff ...

elseif string.starts(nameOut, "Special " .. i) then -- found 'Start' marker
  songs[i] = {
    marked = true,
    startMarkerNum = retval,
    title = MkrSegments[2],
    singer = MkrSegments[3],
    startMarkerButtonText = reaper.format_timestr(posOut, ""),
  GUI.Val("Song" .. i .. "Tracks", MkrSegments[4])
  GUI.Val("Song" .. i .. "Scene", MkrSegments[5])
  GUI.elms["Song"..i.."StartButton"].func = EditSongStart
  GUI.elms["Song"..i.."StartButton"].params = {i}
Also note that I've changed the name of EditSongStart so that all of the buttons can use the same function, and then they can pass their i to it as a parameter.
.params = {i} would be what in this case? Or did you just tack that on as part of showing what else could be done with a table in this kind of setup?
"But be ye doers of the word, and not hearers only, deceiving your own selves."
tXShooter is offline   Reply With Quote