03-16-2018, 06:38 PM | #1 |
Human being with feelings
Join Date: Jan 2014
Location: Ontario, Canada
Posts: 1,629
|
API: GetLastTouchedFX() is broken with subprojects
GetLastTouchedFX() returns the track number, but if the last touched FX is in another project tab than the current one, the returned track number appears to always be 0 (i.e. master track).
We should either support a last-touched FX per project, in which case GetLastTouchedFX() should receive a project number as an argument (presumably spun off as a new function GetLastTouchedFXEx() or something) or if last-toucehd FX is a global thing, then it should return the project number for the FX, and return the correct track number. (Edit: updated from newer findings) Last edited by tack; 03-17-2018 at 06:46 AM. |
03-17-2018, 02:50 AM | #2 |
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 10,359
|
That would make sense
The long workarround is to first get all tracks of all projects, and for projects where track count is superior than the ID you get from the LastTouched funxtion, GetTrack and compare with the list of tracks you stored untill you find the right track (and so, project). Definitly sounds less efficient. IMHO it would be better to have a project parameter rather than having it return project ID (though it may not solve the same desire).
__________________
Free ReaScripts - Premium Scripts - Custom Scripts Dev - Learn ReaScript - XR Theme - Stash Files - ReaLinks - Website - ReaComics - Alien 2347 - Donation |
03-17-2018, 06:33 AM | #3 | |
Human being with feelings
Join Date: Jan 2014
Location: Ontario, Canada
Posts: 1,629
|
Quote:
Now as I look more closely, I see that if the last touched fx is from another tab, GetLastTouchedFX() returns true but indicates the track number is 0 (i.e. master track). This is wrong and unfortunately also renders your proposed workaround inoperable. (The idea still has problems anyway, because it's possible the track number in the other project is actually valid in the current project. But we do what we can to work around these frustrating API limitations, don't we. ) So the general problem here is that GetLastTouchedFX() is incompatible with subprojects. Last edited by tack; 03-17-2018 at 06:43 AM. |
|
03-20-2018, 04:24 PM | #4 |
Human being with feelings
Join Date: Jan 2014
Location: Ontario, Canada
Posts: 1,629
|
Just saw:
Code:
v5.78rc2 - March 18 2018 + API: GetLastTouchedFX() and GetFocusedFX() only succeed if FX is in active project [t=204540] |
01-02-2020, 08:38 AM | #5 | |
Human being with feelings
Join Date: Sep 2008
Location: Sweden
Posts: 7,552
|
Quote:
It is by no means obvious what "Returns true if the last touched FX parameter is valid, false otherwise" really means, especially since it talks about the *parameter*, not the FX. Thanks for this thread, it finally solved some things for me.
__________________
// MVHMF I never always did the right thing, but all I did wasn't wrong... |
|
Thread Tools | |
Display Modes | |
|
|