|
|
|
09-05-2019, 10:46 AM
|
#1
|
Human being with feelings
Join Date: Apr 2014
Posts: 398
|
Get external screen width & heigth via Reascript
Hey guys!
Is there a way to retrieve external screen width & heigth with the API function reaper.my_getViewport?
I would like to move the focused FX either at the center of the main screen or the center of the external screen.
Thank you!
|
|
|
09-05-2019, 10:57 AM
|
#2
|
Human being with feelings
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
|
As far as I've been able to tell, my_getviewport can only return the total screen area and not individual monitors; my GUI used to use it to center windows and dual-monitor users kept having the window pop up right in between their screens.
|
|
|
09-06-2019, 07:39 AM
|
#3
|
Human being with feelings
Join Date: Apr 2014
Posts: 398
|
Thanks for the reply Lokasenna!
In my case, I have a dual monitor setup and fortunately my_getviewport give me the width & heigth of my main screen only.
So it seems there is no way currently to call the size of a specific external screen.
I'm gonna live with it!
:-)
Cheers!
|
|
|
09-06-2019, 08:10 AM
|
#4
|
Human being with feelings
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,913
|
If you know there are two displays and you have the width of the first display then add 1 to that and pass it to JS_Window_GetViewportFromRect, it should return the bounds of the next display, but if there is only one display it will just return the first display bounds, Tested on Win10,..
Code:
x1 = 1921 -- monitor#1 width+1 (left position of 2nd monitor)
local left, top, right, bottom = reaper.JS_Window_GetViewportFromRect(x1, 0, 1, 1, true)
js_ReaScriptAPI extension
Last edited by Edgemeal; 09-08-2019 at 12:19 PM.
Reason: add link
|
|
|
09-06-2019, 10:10 AM
|
#5
|
Human being with feelings
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
|
+1
Note: Requires the JS extension, and not all of the functions in there work on Linux just FYI.
|
|
|
09-10-2019, 06:35 AM
|
#6
|
Human being with feelings
Join Date: Apr 2014
Posts: 398
|
Nice!
Will try it today!
Is there a list of the JS functions not working on Linux somewhere Lokasenna?
|
|
|
09-10-2019, 06:42 AM
|
#7
|
Human being with feelings
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
|
Nothing comprehensive. Julian has added notes to some of his commands though, so if you search for Linux in the docs you'll get a few hits: https://www.extremraym.com/cloud/reascript-doc/
|
|
|
09-10-2019, 06:59 AM
|
#8
|
Human being with feelings
Join Date: Apr 2014
Posts: 398
|
Thank you!
|
|
|
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 02:12 AM.
|