Old 02-01-2017, 05:45 AM   #1
me2beats
Human being with feelings
 
me2beats's Avatar
 
Join Date: Jul 2015
Location: Yekaterinburg, Russia
Posts: 358
Default GetFocusedFX - itnum, fxnum.. takenum ??

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.
me2beats is offline   Reply With Quote
Old 02-05-2017, 02:43 PM   #2
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 10,242
Default

Got it, extending this API for 5.34pre1, it will include the take number as the high 16 bits of fxnum.
Justin is offline   Reply With Quote
Old 02-05-2017, 05:52 PM   #3
me2beats
Human being with feelings
 
me2beats's Avatar
 
Join Date: Jul 2015
Location: Yekaterinburg, Russia
Posts: 358
Default

Quote:
Originally Posted by Justin View Post
Got it, extending this API for 5.34pre1, it will include the take number as the high 16 bits of fxnum.
oh thank you Justin!
dreams come true
me2beats is offline   Reply With Quote
Old 03-02-2017, 03:32 AM   #4
amagalma
Human being with feelings
 
Join Date: Apr 2011
Posts: 885
Default

Did this happen?
amagalma is offline   Reply With Quote
Old 03-02-2017, 08:48 PM   #5
me2beats
Human being with feelings
 
me2beats's Avatar
 
Join Date: Jul 2015
Location: Yekaterinburg, Russia
Posts: 358
Default

Quote:
Originally Posted by amagalma View Post
Did this happen?
yep
me2beats is offline   Reply With Quote
Old 03-04-2017, 01:48 PM   #6
amagalma
Human being with feelings
 
Join Date: Apr 2011
Posts: 885
Default

The help file has not been updated to reflect the change.
amagalma is offline   Reply With Quote
Reply

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 09:46 AM.


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