Quote:
Originally Posted by Breeder
I'm trying to set tempo envelope display range via .lua script but I can't seem to make REAPER redraw the envelope with the new values.
Code:
local tempoenvmin = reaper.SNM_GetIntConfigVar("tempoenvmin", -222)
local tempoenvmax = reaper.SNM_GetIntConfigVar("tempoenvmax", -222)
local button, value = reaper.GetUserInputs("Set tempo map display range", 2, "Min:,Max:", tempoenvmin .. "," .. tempoenvmax)
if button == true then
local min, max = value:match'(.*),(.*)'
min, max = math.floor(tonumber(min)), math.floor(tonumber(max))
if min > max then local tmp = min; min = max; max = tmp; end
if min <= 0 then min = tempoenvmin end
reaper.PreventUIRefresh(1)
reaper.SNM_SetIntConfigVar("tempoenvmin", min)
reaper.SNM_SetIntConfigVar("tempoenvmax", max)
reaper.PreventUIRefresh(-1)
reaper.UpdateArrange()
reaper.UpdateTimeline()
reaper.TrackList_AdjustWindows(false)
end
Update API doesn't seem to work and so doesn't the show/hide tempo envelope action run after the script.
Anyone got any idea on how to do this?
|
Haven't tested this, but you could try triggering an update by zooming in once and zooming out once.
It's forced but may help.
If not, then it's probably a case,where setting the config-vars doesn't update the UI.