martinfabian / MFXlist

https://forum.cockos.com/showthread.php?t=248411
5 stars 1 forks source link

Reaper setting "Auto float newly added FX window" messes with MFXlist... #33

Closed martinfabian closed 3 years ago

martinfabian commented 3 years ago

If the user has the option to "Auto-float newly added FX window" turned on, then when the user adds a new FX via the right-click menu, it seems that the code to toggle the window sees the window open (because Reaper just opened it) and so MFXlist closes the window. This is not as expected. So, when an FX is added via the right-click menu, MFXlist should check if the floating window is open, and in that case not do anything, else if the window is not open, MFXlist should open it. This is probably manageable by an extra parameter to the handleToggleWindow function; if the parameter is true then the window should not be closed if it is open.

martinfabian commented 3 years ago

A better solution is not using handleToggleWindowin handleMenu, but instead simply show the floating FX (and adding it to the openwin_list). that is:

-- handleToggleWindow(track, index, 2, true) -- true => if window already opened, then don't close it
rpr.TrackFX_Show(track, index, 3) -- 3 == show floating window
MFXlist.openwin_list:insert({track, index})

With the auto-float setting on, Reaper auto-floats the FX, and asking to open again the floating FX window seems to work as expected. With teh auto-float setting off, Reaper does not auto-float the FX but instead opens the floating window on the Show-call.

martinfabian commented 3 years ago

Solved in f170487