|
|
|
12-31-2018, 11:10 PM
|
#1
|
Human being with feelings
Join Date: Nov 2010
Posts: 2,436
|
Any idea how to resize dockers through scripts?
You know those REAPER configurations that take one track in mixer, make it sidebar layout and resize it so it looks like inspector layout?
But lets say you use multiple themes, each with different layouts and you don't want to WALTER yourself out of this situation. Instead, you want to resize dockers with API so you can easily add more themes later.
I'll first attempt to solve this with python and pywin32 library for it, but maybe some of you already have some code snippets on what is the best way to accomplish this? Maybe update screensets file before loading the screenset? (but if memory serves me right, screensets file is read once and that's it...can't edit it while REAPER is running)
__________________
REAPER ReWorked: An elegant and self-sufficient all-around REAPER configuration
Other stuff
Last edited by Breeder; 09-03-2020 at 03:28 PM.
|
|
|
01-02-2019, 05:56 AM
|
#2
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,458
|
With this code I can get the info of all docks - visible or hidden :
Code:
local hWnd_array = reaper.new_array({}, 100)
reaper.JS_Window_ArrayFind("REAPER_dock", true, hWnd_array)
dock = hWnd_array.table()
for i = 1, #dock do
local hwnd = reaper.JS_Window_HandleFromAddress(dock[i])
local _, left, top, right, bottom = reaper.JS_Window_GetClientRect( hwnd )
dock[i] = {hwnd = hwnd, l = left, t = top, r = right, b = bottom, w = (right-left), h = (bottom-top)}
end
But when I try to resize using reaper.JS_Window_Resize, is seems to just move the contents of the dock without resizing. I am afraid that is all I can offer . Someone, more knowledgeable maybe can help?... ( I am interested in this too. Reaper Docks are a mystery to me)
Last edited by amagalma; 01-02-2019 at 06:01 AM.
|
|
|
01-02-2019, 12:33 PM
|
#3
|
Human being with feelings
Join Date: Jan 2017
Location: Los Angeles
Posts: 1,161
|
AFAIK, you can't.
Reaper.ini holds dock dimensions, but overwriting the values doesn't have any affect without restarting Reaper. I've tried to have real-time control over dock dimensions with no success.
|
|
|
01-02-2019, 12:37 PM
|
#4
|
Human being with feelings
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,921
|
Quote:
Originally Posted by amagalma
But when I try to resize using reaper.JS_Window_Resize, is seems to just move the contents of the dock without resizing.
|
Try, reaper.JS_Window_SetPosition , tried on bottom docker, it resizes but then the rest of reaper interface also needs a refresh so all the other stuff is resized also, Hmmmmm?
EDIT
OK, if I send a mouse click to the docker it acts as if I resized the docker with mouse, and REAPER interface is fixed!
Code:
function JS_LMouseDownUp(hWnd)
reaper.JS_WindowMessage_Post(hWnd, "WM_LBUTTONDOWN", 0, 0, 0, 0)
reaper.JS_WindowMessage_Post(hWnd, "WM_LBUTTONUP", 0, 0, 0, 0)
end
local hWnd_array = reaper.new_array({}, 100)
reaper.JS_Window_ArrayFind("REAPER_dock", true, hWnd_array)
dock = hWnd_array.table()
for i = 1, #dock do
local hwnd = reaper.JS_Window_HandleFromAddress(dock[i])
local _, left, top, right, bottom = reaper.JS_Window_GetClientRect( hwnd )
dock[i] = {hwnd = hwnd, l = left, t = top, r = right, b = bottom, w = (right-left), h = (bottom-top)}
end
-- dock[10] is my bottom docker, shrink height by 60 pixels..
reaper.JS_Window_SetPosition( dock[10].hwnd, dock[10].l, dock[10].t, dock[10].w, dock[10].h-60)
-- click it , workaround so REAPER resizes other objects!
JS_LMouseDownUp(dock[10].hwnd)
Last edited by Edgemeal; 01-02-2019 at 07:02 PM.
|
|
|
01-02-2019, 12:54 PM
|
#5
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,458
|
Nope! I tried it with my left docker
Code:
-- dock[4] is my left docker. Increase width by 100 pixels
reaper.JS_Window_SetPosition( dock[4].hwnd, dock[4].l, dock[4].t, dock[4].w+100, dock[4].h)
Didn't work. It just shifted the contents
Edit: Still does not work, even with the mouseclick. I am talking about the left docker which is next to the TCP trackview.
Last edited by amagalma; 01-02-2019 at 01:00 PM.
|
|
|
01-02-2019, 01:35 PM
|
#6
|
Human being with feelings
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,921
|
Quote:
Originally Posted by amagalma
Nope! I tried it with my left docker
Code:
-- dock[4] is my left docker. Increase width by 100 pixels
reaper.JS_Window_SetPosition( dock[4].hwnd, dock[4].l, dock[4].t, dock[4].w+100, dock[4].h)
Didn't work. It just shifted the contents
Edit: Still does not work, even with the mouseclick. I am talking about the left docker which is next to the TCP trackview.
|
Ya left is weird, I can resize width of right tho.
|
|
|
01-02-2019, 11:52 PM
|
#7
|
Human being with feelings
Join Date: Nov 2010
Posts: 2,436
|
Hey guys - thanks for all the responses!
I remember from SWS that pretty much anything you want is possible using win32 - the trick is taking care of all the little corner cases and that needs testing and then some more testing
Edgemeal, I think you might just be unto something. The only trouble I see with mouse click simulations is presented in a question: "Will it work if something glitches or takes a bit too long to load". I guess that's the testing part
In any case - I believe that changing REAPER themes during production can offer significant creativity boost and this script could shave off the hours needed to REWALTER every theme you plan on using. I'll definetly check it out when I catch the time, thank you so, so much guys, you're golden! <3
|
|
|
03-01-2019, 11:07 AM
|
#8
|
Human being with feelings
Join Date: Nov 2007
Location: Lucas, TX, USA (via Luleå, Sweden)
Posts: 2,009
|
Is there any update on this?
I am trying to use the code above to change the size of my floating FX docker.
It moves the contents of the FX window inside the docker to a new position, but I want to move the position of the entire docker (which is floating).
Am I missing something? Or is the API not quite capable of this yet?
__________________
Best Regards, Ernie "lunker" Lundqvist
BDSM (Bad Dog Studio Musicians)
Windows 10 running on Z390 + i7-8700
|
|
|
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 04:00 AM.
|