|
|
|
11-13-2018, 12:23 PM
|
#1
|
Human being with feelings
Join Date: May 2018
Location: Los Angeles
Posts: 1,719
|
How to refresh Region Render Matrix -- aka what the hell is (HWND hwnd)??
Hi guys,
I wrote a script to populate the Render Matrix with populated regions per track. Works great except sometimes I have to click on the Render Matrix dock to refresh it even though I have these at ehe end of my script:
Code:
reaper.PreventUIRefresh(-1)
reaper.DockWindowRefresh()
reaper.Undo_EndBlock("Populated Region Render Matrix",-1)
reaper.UpdateArrange()
I think I need this command maybe?
reaper.DockWindowRefreshForHWND( hwnd )
What is HWND??
Thanks for any help.
P.S. I looked over the docs but must have overlooked something... couldn't find definitions of HWND... just references.
__________________
Cheers... Andrew K
Reaper v6.80+dev0621 - June 21 2023 Catalina Mac Mini 2020 6 core i7 64GB RAM OS: Catalina 4K monitor RME RayDAT card with Sync Card and extended Light Pipe.
Last edited by Thonex; 11-13-2018 at 12:34 PM.
|
|
|
11-13-2018, 12:55 PM
|
#2
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
|
Have you tried using the (seemingly) equivalent function which doesn't take a HWND? (not sure if this works)
DockWindowRefresh()
Generally speaking afaik a HWND is a handle (or specific, 'typed' pointer) to a window ('window handle').
E.g. you can get the HWND of Reaper's main window with GetMainHwnd()
I don't know what kind of HWND DockWindowRefreshForHWND expects though.
Last edited by nofish; 11-13-2018 at 01:02 PM.
|
|
|
11-13-2018, 01:06 PM
|
#3
|
Human being with feelings
Join Date: May 2018
Location: Los Angeles
Posts: 1,719
|
Quote:
Originally Posted by nofish
Have you tried using the (seemingly) equivalent function which doesn't take a HWND? (not sure if this works)
DockWindowRefresh()
|
Thanks nofish,
Yeah... I tried that (see second line of code in my example on the OP).
No dice.
__________________
Cheers... Andrew K
Reaper v6.80+dev0621 - June 21 2023 Catalina Mac Mini 2020 6 core i7 64GB RAM OS: Catalina 4K monitor RME RayDAT card with Sync Card and extended Light Pipe.
|
|
|
11-13-2018, 01:08 PM
|
#4
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
|
Missed that, sorry.
No other idea then unfortunately.
|
|
|
11-13-2018, 01:09 PM
|
#5
|
Human being with feelings
Join Date: May 2018
Location: Los Angeles
Posts: 1,719
|
Quote:
Originally Posted by nofish
Missed that, sorry.
No other idea then unfortunately.
|
No worries... I even tried putting that line as the last line of update code in the script... no luck.
__________________
Cheers... Andrew K
Reaper v6.80+dev0621 - June 21 2023 Catalina Mac Mini 2020 6 core i7 64GB RAM OS: Catalina 4K monitor RME RayDAT card with Sync Card and extended Light Pipe.
|
|
|
11-13-2018, 01:58 PM
|
#6
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
You can get the HWND of the Region Render Matrix window with this:
Code:
w = reaper.JS_Window_Find( "Region Render Matrix", true )
You need the js_ReaScriptAPI extension for this .
Then try:
Code:
reaper.DockWindowRefreshForHWND(w)
and see if it works ...
|
|
|
11-13-2018, 02:35 PM
|
#7
|
Human being with feelings
Join Date: May 2018
Location: Los Angeles
Posts: 1,719
|
Quote:
Originally Posted by amagalma
You can get the HWND of the Region Render Matrix window with this:
Code:
w = reaper.JS_Window_Find( "Region Render Matrix", true )
You need the js_ReaScriptAPI extension for this .
Then try:
Code:
reaper.DockWindowRefreshForHWND(w)
and see if it works ...
|
Thank amagalma,
Yeah... I tried that too and I get the same behavior. I installed that JS extension as you said.. I get no errors, but I still have to hover over the Render Matrix window to get it to refresh.
I'm wondering if this is a Mac thing.
__________________
Cheers... Andrew K
Reaper v6.80+dev0621 - June 21 2023 Catalina Mac Mini 2020 6 core i7 64GB RAM OS: Catalina 4K monitor RME RayDAT card with Sync Card and extended Light Pipe.
|
|
|
11-13-2018, 04:33 PM
|
#8
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,875
|
I have a script pack with region render matrix and it updates fine,
see screenshot there:
https://www.extremraym.com/en/downlo...region-matrix/
Im awqy from the code I dont remember how I did the refresh part, but it is possible without the HWD thing.
|
|
|
11-13-2018, 04:58 PM
|
#9
|
Human being with feelings
Join Date: May 2018
Location: Los Angeles
Posts: 1,719
|
Quote:
Originally Posted by X-Raym
|
Nice one X-Raym!
Yeah... I already scripted my own version LOL.... works perfectly... except for the refresh. Now it's more of on OCD issue/mystery for me
So far I've tried:
• reaper.DockWindowRefreshForHWND(w) (using JS_Rescript extension)
• DockWindowRefresh()
• reaper.JS_Mouse_SetPosition( x, y ) where the x,y is right on top of the Region Render Matrix chart
• I even tried toggling show/hide Region Render Matrix... nothing works until I simply manually hover my mouse over the Region Render Matrix or manually toggle its show/hide.
__________________
Cheers... Andrew K
Reaper v6.80+dev0621 - June 21 2023 Catalina Mac Mini 2020 6 core i7 64GB RAM OS: Catalina 4K monitor RME RayDAT card with Sync Card and extended Light Pipe.
Last edited by Thonex; 11-13-2018 at 06:10 PM.
|
|
|
11-13-2018, 07:58 PM
|
#10
|
Human being with feelings
Join Date: Sep 2018
Location: China
Posts: 565
|
I made a similar script before, https://forum.cockos.com/showthread.php?t=212325
I just tried to edit the script and add a line at the end
Code:
reaper.Main_OnCommand(41888,0) --View: Show region render matrix window
It worked, only if you don't open the render matrix window before you run the script
|
|
|
11-13-2018, 08:57 PM
|
#11
|
Human being with feelings
Join Date: May 2018
Location: Los Angeles
Posts: 1,719
|
Quote:
Originally Posted by dsyrock
I made a similar script before, https://forum.cockos.com/showthread.php?t=212325
I just tried to edit the script and add a line at the end
Code:
reaper.Main_OnCommand(41888,0) --View: Show region render matrix window
It worked, only if you don't open the render matrix window before you run the script
|
Thanks dsyrock,
Yeah... I found that to be the case here too... but if you already have the Render matrix window open, you have to manually close and open it. Really odd.
Are you on Mac?
__________________
Cheers... Andrew K
Reaper v6.80+dev0621 - June 21 2023 Catalina Mac Mini 2020 6 core i7 64GB RAM OS: Catalina 4K monitor RME RayDAT card with Sync Card and extended Light Pipe.
|
|
|
11-13-2018, 09:27 PM
|
#12
|
Human being with feelings
Join Date: Sep 2018
Location: China
Posts: 565
|
Quote:
Originally Posted by Thonex
Thanks dsyrock,
Yeah... I found that to be the case here too... but if you already have the Render matrix window open, you have to manually close and open it. Really odd.
Are you on Mac?
|
Oh, I'm on PC. The refreshing doesn't mean a lot for me, because I usually open "Render to file" first, then select the region render matrix after.
|
|
|
11-14-2018, 03:00 AM
|
#13
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,875
|
I checked my code, Here is what you need :
- reaper.TrackList_AdjustWindows( false )
I hope your RRM scripts will be different than mine :P
|
|
|
11-14-2018, 08:38 AM
|
#14
|
Human being with feelings
Join Date: Sep 2018
Location: China
Posts: 565
|
Quote:
Originally Posted by X-Raym
I checked my code, Here is what you need :
- reaper.TrackList_AdjustWindows( false )
I hope your RRM scripts will be different than mine :P
|
GREAT! How did you find it can refresh the region render matrix window? It's hard to guess from it's name
|
|
|
11-14-2018, 08:55 AM
|
#15
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,875
|
@dysrock
I always find a way :P
|
|
|
11-14-2018, 09:30 AM
|
#16
|
Human being with feelings
Join Date: May 2018
Location: Los Angeles
Posts: 1,719
|
Quote:
Originally Posted by X-Raym
I checked my code, Here is what you need :
- reaper.TrackList_AdjustWindows( false )
I hope your RRM scripts will be different than mine :P
|
Hi X-Raym,
Fantastic solution... very clever!!
My code is most probably very different than yours LOL. I'd be surprised if we had the same approach... I used Time Selection and the built-in command "Select All Items in Time Selection on Selected Tracks" (or whatever it's called) to cycle through the regions. I was going to post it but saw you had a paid link and out of respect I decided not to... but if you are curious.... I can post mine.
The main function is about 50 lines of code.
Basically... I do this...
User Selects the tracks they want to monitor... and the range with Time Sections
Then I do this:
• Count regions and log all their start and end point.
• Count tracks
• Loop through all and deselect all matrix boxes. (to clear out the matrix)
then...
• create a nested loop of Regions and selected tracks
• set Time Selection to L/R boundaries of each Region and run command "Select All Items in Time Selection on Selected Tracks" (or whatever it's called)
• Then loop through selected items and check box for each track on that region.
Done.
Cheers.
__________________
Cheers... Andrew K
Reaper v6.80+dev0621 - June 21 2023 Catalina Mac Mini 2020 6 core i7 64GB RAM OS: Catalina 4K monitor RME RayDAT card with Sync Card and extended Light Pipe.
Last edited by Thonex; 11-14-2018 at 11:37 AM.
|
|
|
11-14-2018, 10:57 AM
|
#17
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,875
|
What you achieved could indeed be achieved with my scripts. So thanks for your consideration.
I confirm they worked differently, I avoid native actions as much as possible :P Also, mine worked with earlier version of REAPER which had a bug with unsetting a region in the RRM, so it has more fancy code to handle that (but nothing bad for performance), that's why my scripts were mostly interesting, it was this hack :P Now it is fixed, scripting for RRM is more friendly.
|
|
|
11-14-2018, 11:30 AM
|
#18
|
Human being with feelings
Join Date: May 2018
Location: Los Angeles
Posts: 1,719
|
Quote:
Originally Posted by X-Raym
I avoid native actions as much as possible :P
|
Interesting. I usually test and compare.
Many of my script have to work over thousands of measures with (sometimes) tens of thousands of Items. I found nothing faster for selecting items within a range across selected tracks than using that native action.
Also it's way easier for me to code
__________________
Cheers... Andrew K
Reaper v6.80+dev0621 - June 21 2023 Catalina Mac Mini 2020 6 core i7 64GB RAM OS: Catalina 4K monitor RME RayDAT card with Sync Card and extended Light Pipe.
|
|
|
11-14-2018, 11:36 AM
|
#19
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,875
|
Of course, it is a question of context, and I totally understand why it isbmore efficient in that particular case :P
|
|
|
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:09 AM.
|