Old 05-03-2020, 06:38 AM   #321
joe2
Human being with feelings
 
Join Date: Sep 2008
Location: UK
Posts: 370
Default

Many more "desc" options for GetSetProjectInfo_String, please. :-)

e.g. GRID [0], FEEDBACK, PANLAW, etc.

Really, it should be possible to get/set any project setting with a script.

I think being able to modify more project settings has been a long-standing FR for quite a few people.

Thanks!


[0] Because right now, I'd like to be able to change "Grid snap spacing" with a script. Note, this *isn't* the same as "Grid settings ... line spacing", for which many actions already exist.


I should have researched more thoroughly before posting this, I suppose! I think everything I want to achieve can actually be done using SNM_GetIntConfigVar, SNM_SetIntConfigVar, SNM_GetDoubleConfigVar and SNM_SetDoubleConfigVar. And I'm guessing it'd cover most everything you'd want to do in this context.

(And FWIW, I found these extra docs very useful for my use case: https://mespotin.uber.space/Ultrasch...l#projshowgrid)

So ignore this request!

Last edited by joe2; 05-26-2020 at 04:32 AM.
joe2 is offline   Reply With Quote
Old 05-23-2020, 06:21 PM   #322
daxliniere
Human being with feelings
 
daxliniere's Avatar
 
Join Date: Nov 2008
Location: London, UK
Posts: 2,024
Default

Would it be possible to allow scripts to write Take Markers during recording, please?

The intention is to enable this script to utilise the great new Take Marker system: https://forum.cockos.com/showthread.php?t=175925
__________________
Dax Liniere
London's newest premium studio complex! (Facebook)
[i7-4790K, 12Gb RAM, Win8.1x64, NVidia GT710, UAD2-OCTO, FireFaceUFX, REAPER x64]
daxliniere is offline   Reply With Quote
Old 06-29-2020, 12:26 AM   #323
todoublez
Human being with feelings
 
todoublez's Avatar
 
Join Date: Aug 2019
Location: beijing
Posts: 390
Default pin feature

is thrr any API can allow us to make a auto-pin fx & fx chain window script?

kinda frustrating when I try to open multiple fx window on MCP.
they keep falling back to the lower layer If I forgot to pin them manually.
really wish they can b always on top.
__________________
Reaper 6.12 / SWS/S&M: v2.11.0 / Hackintosh OSX High Sierra 10.13.6
i9 9900KS / 8 Cores base:4.0Ghz turbo:5.0Ghz / 64G RAM /
JS_ReaScriptAPI: v1.215 / Ultraschall API: v43220.00
todoublez is offline   Reply With Quote
Old 06-29-2020, 03:57 AM   #324
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 2,191
Default

Quote:
Originally Posted by todoublez View Post
is thrr any API can allow us to make a auto-pin fx & fx chain window script?

kinda frustrating when I try to open multiple fx window on MCP.
they keep falling back to the lower layer If I forgot to pin them manually.
really wish they can b always on top.

Auto-pin lua script:

Code:
local pinned = {}
local click = reaper.NamedCommandLookup('_S&M_MOUSE_L_CLICK')

function main()
  local retval, list = reaper.JS_Window_ListFind( "tb", true )
  for address in list:gmatch("[^,]+") do
    local pin = reaper.JS_Window_HandleFromAddress( address )
    local parent = reaper.JS_Window_GetParent( pin )
    local title = reaper.JS_Window_GetTitle( parent )
    if not pinned[title] then
      if title:find("^FX:") or title:find("^VST:") or title:find("^JS:") then
        local x, y = reaper.GetMousePosition()
        local _, left, top, right, bottom = reaper.JS_Window_GetClientRect( pin )
        reaper.JS_Mouse_SetPosition( left+8, top+8 )
        reaper.Main_OnCommand(click, 0)
        reaper.JS_Mouse_SetPosition( x, y )
        pinned[title] = true
        reaper.ShowConsoleMsg("pinned " .. title .. "\n")
      end
    end
  end
end
main()
amagalma is offline   Reply With Quote
Old 06-29-2020, 05:31 AM   #325
todoublez
Human being with feelings
 
todoublez's Avatar
 
Join Date: Aug 2019
Location: beijing
Posts: 390
Default

Quote:
Originally Posted by amagalma View Post
Auto-pin lua script:

Code:
local pinned = {}
local click = reaper.NamedCommandLookup('_S&M_MOUSE_L_CLICK')

function main()
  local retval, list = reaper.JS_Window_ListFind( "tb", true )
  for address in list:gmatch("[^,]+") do
    local pin = reaper.JS_Window_HandleFromAddress( address )
    local parent = reaper.JS_Window_GetParent( pin )
    local title = reaper.JS_Window_GetTitle( parent )
    if not pinned[title] then
      if title:find("^FX:") or title:find("^VST:") or title:find("^JS:") then
        local x, y = reaper.GetMousePosition()
        local _, left, top, right, bottom = reaper.JS_Window_GetClientRect( pin )
        reaper.JS_Mouse_SetPosition( left+8, top+8 )
        reaper.Main_OnCommand(click, 0)
        reaper.JS_Mouse_SetPosition( x, y )
        pinned[title] = true
        reaper.ShowConsoleMsg("pinned " .. title .. "\n")
      end
    end
  end
end
main()
Hi amagalma !
Just tried the script,but nothing happen here :/
is this a background wrking script ? or do I have to fire them everytime I need the FX window be pinned ?
Perhaps I miss something , plz help
__________________
Reaper 6.12 / SWS/S&M: v2.11.0 / Hackintosh OSX High Sierra 10.13.6
i9 9900KS / 8 Cores base:4.0Ghz turbo:5.0Ghz / 64G RAM /
JS_ReaScriptAPI: v1.215 / Ultraschall API: v43220.00
todoublez is offline   Reply With Quote
Old 06-29-2020, 06:05 AM   #326
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 2,191
Default

Oh, yes. You are on OSX.
Change this:
Code:
reaper.JS_Mouse_SetPosition( left+8, top+8 )
To this:
Code:
reaper.JS_Mouse_SetPosition( left+8, bottom+8 )
It's a background script

Oh. And get rid of the ShowConsoleMsg line!

I am on Android mobile now and can't do it myself...

Last edited by amagalma; 06-29-2020 at 06:21 AM.
amagalma is offline   Reply With Quote
Old 06-29-2020, 06:19 AM   #327
todoublez
Human being with feelings
 
todoublez's Avatar
 
Join Date: Aug 2019
Location: beijing
Posts: 390
Default

Quote:
Originally Posted by amagalma View Post
Oh, yes. You are on OSX.
Change this:
Code:
reaper.JS_Mouse_SetPosition( left+8, top+8 )
To this:
Code:
reaper.JS_Mouse_SetPosition( left+8, bottom+8 )
It's a background script
Still not wrking
and it doesn't shows on/off state. is it normal ?
__________________
Reaper 6.12 / SWS/S&M: v2.11.0 / Hackintosh OSX High Sierra 10.13.6
i9 9900KS / 8 Cores base:4.0Ghz turbo:5.0Ghz / 64G RAM /
JS_ReaScriptAPI: v1.215 / Ultraschall API: v43220.00
todoublez is offline   Reply With Quote
Old 06-29-2020, 07:54 AM   #328
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 1,864
Default

Quote:
Originally Posted by amagalma View Post
Auto-pin lua script:
Neat! I didn't know about '_S&M_MOUSE_L_CLICK'.

Did you ever figure out how to detect if a pin is enabled or not? My only guess is to check if a certain style is set, but I'm not sure which one, quick test,..

EDIT Trying style & WS_EX_TOPMOST...

Code:
local style = reaper.JS_Window_GetLong(pin, "EXSTYLE") & 0x8 -- WS_EX_TOPMOST
reaper.ShowConsoleMsg( style .. "\n") 
-- Win10 x64(1909) results,
-- pinned = 8
-- Not pinned = 0

Last edited by Edgemeal; 06-29-2020 at 08:18 AM.
Edgemeal is offline   Reply With Quote
Old 06-29-2020, 08:36 AM   #329
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 2,191
Default

Quote:
Originally Posted by todoublez View Post
Still not wrking
and it doesn't shows on/off state. is it normal ?

It is missing the on/off state code. I did it quickly. I can add it.. Unfortunately, I can't test at the moment why it is not working on macOS because my VMWare Catalina broke :/ I have to re-install...


Quote:
Originally Posted by Edgemeal View Post
Neat! I didn't know about '_S&M_MOUSE_L_CLICK'.
EDIT Trying style & WS_EX_TOPMOST...

Code:
local style = reaper.JS_Window_GetLong(pin, "EXSTYLE") & 0x8 -- WS_EX_TOPMOST
reaper.ShowConsoleMsg( style .. "\n") 
-- Win10 x64(1909) results,
-- pinned = 8
-- Not pinned = 0

Nice Edgemeal!


I used the S&M action because I could not make it work using WM_LBUTTON messages for some reason...
amagalma is offline   Reply With Quote
Old 06-29-2020, 09:10 AM   #330
todoublez
Human being with feelings
 
todoublez's Avatar
 
Join Date: Aug 2019
Location: beijing
Posts: 390
Default

Quote:
Originally Posted by amagalma View Post
It is missing the on/off state code. I did it quickly. I can add it.. Unfortunately, I can't test at the moment why it is not working on macOS because my VMWare Catalina broke :/ I have to re-install...
waiting for ur final code
this is a wonderful and handy feature !
many thanx to u ,have a wonderful day !
__________________
Reaper 6.12 / SWS/S&M: v2.11.0 / Hackintosh OSX High Sierra 10.13.6
i9 9900KS / 8 Cores base:4.0Ghz turbo:5.0Ghz / 64G RAM /
JS_ReaScriptAPI: v1.215 / Ultraschall API: v43220.00
todoublez is offline   Reply With Quote
Old 06-29-2020, 10:05 AM   #331
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 1,864
Default

Quote:
Originally Posted by amagalma View Post
I used the S&M action because I could not make it work using WM_LBUTTON messages for some reason...
Ya, when I was working on same thing I tried every msg I could think of (using VS/Win32) and only way to change pin state was the same way your doing it.

Just be aware that if a pin is behind another window you'll be clicking whatever window is in front of that pin! Maybe set the pin foreground first?
Edgemeal is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 12:23 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.