|
|
|
09-20-2021, 07:51 AM
|
#1
|
Human being with feelings
Join Date: Aug 2006
Location: Berlin
Posts: 11,818
|
Reporting a Focused FX via API for CSI not working?
Bit of a problem here and I can't say what it is. Bug, API change, programming error on our part(CSI project), but it's worth taking a look at because so many of us are using this functionality.
CSI does not always know when an insert effect window/view, docked or undocked is focused.
This is in reference to these two posts in the CSI thread.
My initial report
https://forum.cockos.com/showpost.ph...ostcount=14967
The result is that the plugin is not controlled unless you first make another plugin the focus, then back to the plugin you actually wish to focus, as Funkybot explains below.
Funkybots response which lead to this report
https://forum.cockos.com/showpost.ph...ostcount=14971
A technical limitation of the API ?
Maybe looking at the Github project will help. Maybe just telling Geoff what needs improving. Or maybe the API can be improved or added to.
Hope you can help here within what time you can spare.
Last edited by airon; 09-20-2021 at 10:14 AM.
|
|
|
09-24-2021, 04:19 AM
|
#2
|
Human being with feelings
Join Date: Aug 2006
Location: Berlin
Posts: 11,818
|
Is it a feature request when a control surface plugin can't always tell when a plugin is in focus ?
Should I ask to move this in the Feature Request section ?
|
|
|
09-24-2021, 05:59 AM
|
#3
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,109
|
Maybe Geoff could chime in and link to the specific code section where there's a problem with?
May make it easier for the Reaper devs to look into I'd think.
|
|
|
09-25-2021, 05:50 AM
|
#4
|
Human being with feelings
Join Date: Mar 2009
Location: Dartmouth, Nova Scotia
Posts: 11,252
|
Quote:
Originally Posted by nofish
Maybe Geoff could chime in and link to the specific code section where there's a problem with?
May make it easier for the Reaper devs to look into I'd think.
|
It's more a behaviour than a section -- @Funkybots's post explains it well.
https://forum.cockos.com/showpost.ph...ostcount=14971
I suspect, this is a product of "last focused plugin" behaviour -- even when the Window loses focus, it remains the "last focused plugin" in Reaper, we had to do some tricks to ascertain when the plugin window actually loses focus, and we don't get a notification when the newly focused plugin is the same as the "last focused plugin", so it's in around there somewhere.
Maybe there's a more reliable way to do this, I'm certainly open to anything anyone has, this has been problematic since day one
__________________
To install you need the CSI Software and Support Files
For installation instructions and documentation see the Wiki
Donate -- via PayPal to waddingtongeoff@gmail.com
|
|
|
09-25-2021, 07:02 AM
|
#5
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,109
|
From GetFocusedFX2 doc:
Quote:
Return value has 1 set if track FX, 2 if take/item FX, 4 set if FX is no longer focused but still open. tracknumber==0 means the master track, 1 means track 1, etc. itemnumber is zero-based (or -1 if not an item). For interpretation of fxnumber, see GetLastTouchedFX.
|
Maybe I'm misunderstanding, but wouldn't that be what to use?
Seems to work here:
Test code (Lua, but I think you get the ghist):
Code:
function msg(m)
return reaper.ShowConsoleMsg(tostring(m) .. "\n")
end
lastRetval = -1
function GetFocusedFX()
retval, tracknumber, itemnumber, fxnumber = reaper.GetFocusedFX2()
if lastRetval ~= retval then
if (retval & 4) == 4 then
msg("focus lost")
else
msg("has focus")
end
end
lastRetval = retval
reaper.defer(GetFocusedFX)
end
GetFocusedFX()
edit:
I'm using polling here, are you using a callback?
Then I wouldn't know.
Last edited by nofish; 09-25-2021 at 07:53 AM.
|
|
|
09-25-2021, 08:36 AM
|
#6
|
Human being with feelings
Join Date: Mar 2009
Location: Dartmouth, Nova Scotia
Posts: 11,252
|
Quote:
Originally Posted by nofish
From GetFocusedFX2 doc:
Maybe I'm misunderstanding, but wouldn't that be what to use?
Seems to work here:
Test code (Lua, but I think you get the ghist):
Code:
function msg(m)
return reaper.ShowConsoleMsg(tostring(m) .. "\n")
end
lastRetval = -1
function GetFocusedFX()
retval, tracknumber, itemnumber, fxnumber = reaper.GetFocusedFX2()
if lastRetval ~= retval then
if (retval & 4) == 4 then
msg("focus lost")
else
msg("has focus")
end
end
lastRetval = retval
reaper.defer(GetFocusedFX)
end
GetFocusedFX()
edit:
I'm using polling here, are you using a callback?
Then I wouldn't know.
|
Right now, I'm using a callback via CSURF_EXT_SETFOCUSEDFX, methinks I'm going to switch to polling, thanks
__________________
To install you need the CSI Software and Support Files
For installation instructions and documentation see the Wiki
Donate -- via PayPal to waddingtongeoff@gmail.com
|
|
|
09-25-2021, 09:10 AM
|
#7
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,109
|
Quote:
Originally Posted by Geoff Waddington
Right now, I'm using a callback via CSURF_EXT_SETFOCUSEDFX
|
Just tried out of curiousity.
I think I see the issue now, can confirm that when having a plugin focused, clicking somewhere else so it gets unfocused, than focusing same plugin again, CSURF_EXT_SETFOCUSEDFX doesn't get fired.
Is that it?
|
|
|
09-25-2021, 09:29 AM
|
#8
|
Human being with feelings
Join Date: Mar 2009
Location: Dartmouth, Nova Scotia
Posts: 11,252
|
Quote:
Originally Posted by nofish
Just tried out of curiousity.
I think I see the issue now, can confirm that when having a plugin focused, clicking somewhere else so it gets unfocused, than focusing same plugin again, CSURF_EXT_SETFOCUSEDFX doesn't get fired.
Is that it?
|
Yup, that's the one
__________________
To install you need the CSI Software and Support Files
For installation instructions and documentation see the Wiki
Donate -- via PayPal to waddingtongeoff@gmail.com
|
|
|
09-25-2021, 09:33 AM
|
#9
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,109
|
Hm..not sure if bug of FR to be honest, I think one could say focused plugin hasn't changed, so no need to fire it again.
But that's not up to me to decide anyway.
|
|
|
09-25-2021, 09:45 AM
|
#10
|
Human being with feelings
Join Date: Mar 2009
Location: Dartmouth, Nova Scotia
Posts: 11,252
|
Quote:
Originally Posted by nofish
Hm..not sure if bug of FR to be honest, I think one could say focused plugin hasn't changed, so no need to fire it again.
|
Agree, that's what I was trying to say earlier in the thread, it's not a wrong Reaper behaviour, it's just not of much help for us in our use case
__________________
To install you need the CSI Software and Support Files
For installation instructions and documentation see the Wiki
Donate -- via PayPal to waddingtongeoff@gmail.com
|
|
|
09-29-2021, 04:48 AM
|
#11
|
Human being with feelings
Join Date: Aug 2006
Location: Berlin
Posts: 11,818
|
2-5 Hz polling would be fine for me. It's not like I can flip my hands to another control in less than 200 milliseconds, or would rather wish to do so.
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 08:50 PM.
|