|
|
|
09-02-2017, 12:00 PM
|
#1
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
API function: my_getViewport buggy?
I've tried a lot around with that function, as I hoped, it would give me control over the boundaries and position of the Reaper-Window itself.
But instead, it does nothing I can figure out of. No matter what I'm putting into the parameters, if I use them as "pointer variable" to get something(as sometimes reaperarrays work) or as a parameter so set something, it doesn't do anything I can make us of.
I'm not sure, whether this function is broken or useless, but I don't know for sure.
So, how to make it do anything? Or is it for something, no one knows? Is it working or is it buggy?
|
|
|
09-02-2017, 04:36 PM
|
#2
|
Human being with feelings
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
|
There's absolutely no documentation for it, that's the problem. If you google the function name you can actually find it used in a .cpp on (IIRC) Landoleet, Justin's dev server.
I've been able to do this much with it in Lua:
Code:
local _, _, w, h = reaper.my_getViewport(0, 0, 0, 0, 0, 0, 0, 0, 1)
reaper.ShowConsoleMsg("Screen width = "..tostring(w).."\nScreen height = "..tostring(h))
- The 30px missing from Height are my taskbar, I think.
- It has issues with multiple monitors.
|
|
|
09-08-2017, 09:29 AM
|
#3
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
It's a pity that it's not documented. Having the boundaries of the main Reaper-window would allow tons of cool features immediately.
Especially, as a lot of information on position of GUI-elements are stored in the reaper.ini.
I just figured out, how to do Client2Screen2Client-pixelconversion for the x-ccordinate for the main-Reaper window, yet.
The y-coordinate is still missing in my toolbox... :/
|
|
|
09-08-2017, 07:41 PM
|
#4
|
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 15,721
|
Quote:
Originally Posted by Lokasenna
There's absolutely no documentation for it, that's the problem. If you google the function name you can actually find it used in a .cpp on (IIRC) Landoleet, Justin's dev server.
I've been able to do this much with it in Lua:
Code:
local _, _, w, h = reaper.my_getViewport(0, 0, 0, 0, 0, 0, 0, 0, 1)
reaper.ShowConsoleMsg("Screen width = "..tostring(w).."\nScreen height = "..tostring(h))
- The 30px missing from Height are my taskbar, I think.
- It has issues with multiple monitors.
|
Heh I don't think this was ever actually intended to be used from Lua...
Explanation:
Code:
local l, t, r, b = reaper.my_getViewport(0, 0, 0, 0, pl, pt, pr, pb, want_workspace)
returns left/top/right/bottom of viewport. If want_workspace is 0, then returns the full monitor coordinates, otherwise returns the workspace.
pl/pt/pr/pb define a rectangle which will be used for multimonitors -- it will return the viewport that that rectangle is on/closest to.
|
|
|
09-10-2017, 08:25 AM
|
#5
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
@justin
thanx for the description
|
|
|
01-23-2021, 02:49 PM
|
#6
|
Human being with feelings
Join Date: Sep 2019
Posts: 1,134
|
Would be great if it tracked and returned the relative size of the work area rather than the absolute one for when the main window is shrunk
|
|
|
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 06:00 AM.
|