Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Bug Reports

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 07-22-2016, 09:58 AM   #1
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 4,099
Default Lua bug: reaper.TrackFX_SetPreset creates undo outside undo block (FIXED)

reposting this in the bug reports forum, since I think it is a bug and I posted it wrongly in the JSFX forum first.

I don't expect the "Change FX preset: Track 1: ReaEQ" to appear in the undo history. It should be enclosed by the Undo Block. So it seems a bug, that after the undo block is created, another undo entry is added for setting the preset. If you add multiple different TrackFX_SetPreset, a lot of undo entries are added.





code to test:
Code:
reaper.Undo_BeginBlock()
    local track=reaper.GetSelectedTrack(0,0)
    fxint=reaper.TrackFX_GetByName(track, "ReaEQ", true)
    if fxint>=0 then
        preset = reaper.TrackFX_SetPreset(track, fxint, "stock - Track Default") 
    end
reaper.Undo_EndBlock("Setting Preset", -1)


But it would be better if we could have an option in the reaper.TrackFX_SetPreset function to completely skip the creation of undo entry.
something like:

boolean reaper.TrackFX_SetPreset(MediaTrack track, integer fx, string presetname, boolean createundo)

I've totally failed trying to make it not adding the undo. help!
thanks
__________________
HeDaScripts for REAPER | VIP Donations
heda is offline   Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 02:57 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2017, vBulletin Solutions Inc.