Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BR_GetMouseCursorContext broken #1908

Open
saxmand opened this issue Oct 18, 2024 · 6 comments · May be fixed by #1909
Open

BR_GetMouseCursorContext broken #1908

saxmand opened this issue Oct 18, 2024 · 6 comments · May be fixed by #1909
Assignees
Labels

Comments

@saxmand
Copy link

saxmand commented Oct 18, 2024

I'm trying to use BR_GetMouseCursorContext to get details on the envelope lanes without luck. I believe it's broken.
The only thing I get is "envelope segment" when it's in an automation item.
I've checked on MacOS and @nofishonfriday checked on Windows.
I've tried with the latest version of SWS and this simple code below.

Testing script:

function msg(m)
  return reaper.ShowConsoleMsg(tostring(m) .. "\n")
end

lastDetailsOut = -1

function GetMouseCursorDetails()

  windowOut, segmentOut, detailsOut = reaper.BR_GetMouseCursorContext()
  
  if lastDetailsOut ~= detailsOut then
    msg("detailsOut: " .. detailsOut)
  end
  
  lastDetailsOut = detailsOut
  
  reaper.defer(GetMouseCursorDetails)
end

GetMouseCursorDetails()

The issue was also tracked earlier here:
#1735

@cfillion cfillion self-assigned this Oct 18, 2024
@cfillion cfillion added the bug label Oct 18, 2024
cfillion added a commit to cfillion/sws that referenced this issue Oct 18, 2024
…default behavior outside of automation items"

Fixes reaper-oss#1908, regression from 9916097
@cfillion
Copy link
Member

cfillion commented Oct 18, 2024

Thanks, fixing! As a workaround you can disable the lane option "Project default behavior outside of automation items".

Also there will be builds in the pull request linked below in about an hour.

cfillion added a commit to cfillion/sws that referenced this issue Oct 18, 2024
…default behavior outside of automation items"

Fixes reaper-oss#1908, regression from 9916097
cfillion added a commit to cfillion/sws that referenced this issue Oct 18, 2024
…default behavior outside of automation items"

Fixes reaper-oss#1908, regression from 9916097
@saxmand
Copy link
Author

saxmand commented Oct 18, 2024

That's awesome. I've not been able to find the option you mentioned. Will check the build tomorrow.

@cfillion
Copy link
Member

It's in the envelope lane's context menu:

Screen Shot 2024-10-18 at 14 59 05

@saxmand
Copy link
Author

saxmand commented Oct 19, 2024

Nice.

So I checked the build. It's close to working.

  • It seems to overshoot the position of points and segments a bit, so when I'm a little below a point or segment it already thinks I'm at them, and when I go to the "top" of a point, it sees it as empty.
  • it does not catch points inside Automation Items

I wonder if the overshoot has to do with padding. Not sure if it's using the underlying reaper.GetEnvelopeInfo_Value, cause then maybe it should use I_TCPH_USED instead of I_TCPH?

I included a video just as it might be easier to see than a gif, cause you can start and stop:

BR_GetMouseCursorContext.behavior2.mp4

@nofishonfriday
Copy link
Collaborator

It seems to overshoot the position of points and segments a bit, so when I'm a little below a point or segment it already thinks I'm at them, and when I go to the "top" of a point, it sees it as empty.

Yes, the detection offset appeared when automation items were introduced, because of their bottom 'strip', I think the whole envelope got shifted upwards then.

@saxmand
Copy link
Author

saxmand commented Oct 19, 2024

Appreciate it. Makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants