Today I wanted to finish my script Toggle bypass focused fx. It works for track fx but doesn't work with FX on items.
And I wanted to finish it and I started to write a code like this
Code:
retval, trnum, itnum, fxnum = r.GetFocusedFX()
if retval == 1 then -- track FX is focused
tr = r.GetTrack(0,trnum-1)
en = r.TrackFX_GetEnabled(tr, fxnum)
r.TrackFX_SetEnabled(tr, fxnum, not en)
elseif retval == 2 then -- item FX is focused
tr = r.GetTrack(0,trnum-1)
item = r.GetTrackMediaItem( tr, itnum-1)
but wait..
I need to get the take right now and then use TakeFX_GetEnabled(take, fx) but
GetFocusedFX() doesn't return neither take nor take number what the freak?
Of course I can try track or item chunks but maybe there's a better way.