Old 05-02-2019, 09:40 AM   #441
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

I quickly checked on OSX High Sierra x64 with extension v0.985 and everything seems fine: "Render to File" and all the other windows that I tested, could be found.
juliansader is offline   Reply With Quote
Old 05-02-2019, 09:57 AM   #442
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Ok, I'll give it another try with the latest version.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 05-02-2019, 12:04 PM   #443
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Quote:
Originally Posted by Xenakios View Post
Do you mean you have tried linking with a prebuilt libpng? Cockos's WDL comes with the libpng sources to allow Lice to use png images, so it should be possible to just compile the needed source files directly with your project.
It seems the libpng/zlib version that comes with WDL is flaky. *grumble grumble*. All I needed to do was to download the newest versions of the source code from the web, and now it works fine.

v0.986 with JS_LICE_WritePNG coming up soon.

EDIT: Uploaded to ReaPack.

Last edited by juliansader; 05-03-2019 at 07:29 AM.
juliansader is offline   Reply With Quote
Old 05-02-2019, 12:31 PM   #444
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Awesome
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 05-02-2019, 12:59 PM   #445
lb0
Human being with feelings
 
Join Date: Apr 2014
Posts: 4,171
Default

Quote:
Originally Posted by juliansader View Post
It seems the libpng/zlib version that comes with WDL is flaky. *grumble grumble*. All I needed to do was to download the newest versions of the source code from the web, and now it works fine.

v0.986 with JS_LICE_WritePNG coming up soon.
Amazing!! - thank you so much Cannot wait!
__________________
Projects - Reascripts - Lua:
Smart Knobs 2 | LBX Stripper | LBX Floating FX Positioner
Donate via Paypal | LBX Tools Website
lb0 is offline   Reply With Quote
Old 05-03-2019, 08:01 AM   #446
lb0
Human being with feelings
 
Join Date: Apr 2014
Posts: 4,171
Default

Quote:
Originally Posted by juliansader View Post
EDIT: Uploaded to ReaPack.
Thank you! Going to try it out later.

Dumb question - How do LICE bitmaps relate to normal internal Reaper bitmaps? Is there anyway of blitting one to the other or capturing one from the other (or from a window) or simply converting one to t'other (GDI?)?

Or do I need to generate the LICE bitmap from scratch by loading in PNGs and drawing into the LICE bitmap?

Many thanks!!!

EDIT:

Looks like reaper.JS_GDI_Blit might be the best way to grab from screen to LICE bitmap.
__________________
Projects - Reascripts - Lua:
Smart Knobs 2 | LBX Stripper | LBX Floating FX Positioner
Donate via Paypal | LBX Tools Website

Last edited by lb0; 05-03-2019 at 08:23 AM.
lb0 is offline   Reply With Quote
Old 05-05-2019, 02:53 PM   #447
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,595
Default

@julian
https://forum.cockos.com/showpost.ph...&postcount=203

Some folks cannot start the script with newest version, are there some changes to JS_VKeys_GetState() ? It returns nil on newest version (I'm still on 0.984 while developing my script, did not update yet)
Sexan is online now   Reply With Quote
Old 05-05-2019, 08:39 PM   #448
lb0
Human being with feelings
 
Join Date: Apr 2014
Posts: 4,171
Default

Quote:
Originally Posted by Sexan View Post
@julian
https://forum.cockos.com/showpost.ph...&postcount=203

Some folks cannot start the script with newest version, are there some changes to JS_VKeys_GetState() ? It returns nil on newest version (I'm still on 0.984 while developing my script, did not update yet)
I gave it a test the other day and it has a new 'cutoff time' parameter - I simply put a number in the parameter field and your script started ok.

From API doc:

cutoffTime: A key is only regarded as down if it sent a KEYDOWN message after the cut-off time, not followed by KEYUP. (This is useful for excluding old KEYDOWN messages that weren't properly followed by KEYUP.)
If cutoffTime is positive, is it interpreted as absolute time in similar format as time_precise().
If cutoffTime is negative, it is relative to the current time.
__________________
Projects - Reascripts - Lua:
Smart Knobs 2 | LBX Stripper | LBX Floating FX Positioner
Donate via Paypal | LBX Tools Website
lb0 is offline   Reply With Quote
Old 05-06-2019, 05:17 AM   #449
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

This function among others related to vkeys are missing from the 0.986, at least from the api-docs.
Don't know, if this is intentional.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 05-06-2019, 07:32 AM   #450
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

I'm sorry to see that some users were inconvenienced by the changes.

As I mentioned on a previous page's changelog, the first version of the VKeys functions were completely overhauled in order to fix some problems and improve their functionality.

VKeys_ClearHistory caused interference between scripts when multiple scripts were checking the keyboard simultaneously, and VKeys_GetState were sometimes flummoxed by KEYDOWNs that were sent long ago but never followed by KEYUP.

Also, the new versions should now be first in keyboard processing queue, so will work properly in MIDI editor too. (Global shortcuts are probably still ahead, so may override scripts.)

Please note two remaining potential problems:
* On macOS, some keys (or REAPER's reinterpretation of the keys) send undocumented virtual key codes that fall outside the standard range. The VKeys function cannot yet detect or intercept these. I'm not sure which keys are affected, but the numerical keypad ENTER key is one of them.
* When two keys are held simultaneously, for example Ctrl+A, only one key seems to send repeat KEYDOWNs.
juliansader is offline   Reply With Quote
Old 05-06-2019, 07:35 AM   #451
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

What value-ranges are they, when they are invalid? Bigger than 255?
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 05-06-2019, 07:36 AM   #452
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Quote:
Originally Posted by mespotine View Post
What value-ranges are they, when they are invalid? Bigger than 255?
Yes .
juliansader is offline   Reply With Quote
Old 05-06-2019, 07:41 AM   #453
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Could these help(the keycodes for shortcuts in reaper-kb.ini):
https://github.com/Ultraschall/ultra...per-kb_ini.ini

or these(gfx.getkey-returned keyvalues)?
https://github.com/Ultraschall/ultra..._character.ini

I doubt it, but I hope, they could be a base for getting what is happening on Mac, as some of the keycodes are above 255.


Edit: and maybe it's a good idea to add this thread to your signature as well
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 05-06-2019, 07:48 AM   #454
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,595
Default

Quote:
Originally Posted by juliansader View Post
I'm sorry to see that some users were inconvenienced by the changes.

As I mentioned on a previous page's changelog, the first version of the VKeys functions were completely overhauled in order to fix some problems and improve their functionality.

VKeys_ClearHistory caused interference between scripts when multiple scripts were checking the keyboard simultaneously, and VKeys_GetState were sometimes flummoxed by KEYDOWNs that were sent long ago but never followed by KEYUP.

Also, the new versions should now be first in keyboard processing queue, so will work properly in MIDI editor too. (Global shortcuts are probably still ahead, so may override scripts.)

Please note two remaining potential problems:
* On macOS, some keys (or REAPER's reinterpretation of the keys) send undocumented virtual key codes that fall outside the standard range. The VKeys function cannot yet detect or intercept these. I'm not sure which keys are affected, but the numerical keypad ENTER key is one of them.
* When two keys are held simultaneously, for example Ctrl+A, only one key seems to send repeat KEYDOWNs.
No no its not a problem at all, I was just wondering since I've did not update my JS_API (thought maybe there was some error with new version)

BTW can the function grab which key was pressed or I need to make a whole ascii table (which I've partially already done)?

Last edited by Sexan; 05-06-2019 at 07:56 AM.
Sexan is online now   Reply With Quote
Old 05-06-2019, 07:59 AM   #455
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Quote:
Originally Posted by Sexan View Post
BTW can the function grab which key was pressed or I need to make a whole ascii table (which I've partially already done)?
Could you explain a bit more? (By "which key was pressed", do you mean something else than the array returned by the functions?)
juliansader is offline   Reply With Quote
Old 05-06-2019, 08:17 AM   #456
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,595
Default

uh sorry... ATM you need to set some "keys" or table with keys and then check if any of them was returned by function. Is that still the true with new VK_Key implementation?

I've made almost all the ASCII tbl and then check them with VK

Basically this (but with whole table)
Code:
local vk = {
            {code = 0x1B, name = 'ESC', press = false, hold = false, release = true},
            {code = 0x31, name = 'copy', press = false, hold = false, release = true},
            {code = 0x32, name = 'paste', press = false, hold = false, release = true},
            {code = 0x33, name = 'del', press = false, hold = false, release = true}
            }
function keys(tr, pos) 
  local OK, state = reaper.JS_VKeys_GetState()
  for i = 1, #vk do
    if state:byte(vk[i].code) ~= 0 then
Btw I've made my own hold,press,release state thats why that its there .
Maybe I'm going insane from coding so I don't know what I'm typing

And while you are here, how do you do intercepting with VK ? Same as before (JS_WindowMessage_Intercept)?

Last edited by Sexan; 05-06-2019 at 08:27 AM.
Sexan is online now   Reply With Quote
Old 05-06-2019, 09:09 AM   #457
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

How can I get the child-id a childhwnd has? I tried to bruteforce them using by doing FindChildById, but this doesn't return all of them. The Flac-outputformat in the Render to File-dialog is missing one of the text-captions using FindChildByID, but returns valid hwnd for all when using the FromPoint-function.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 05-06-2019, 09:45 AM   #458
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,913
Default

Quote:
Originally Posted by mespotine View Post
How can I get the child-id a childhwnd has?
try,...
Code:
id = reaper.JS_Window_GetLongPtr(hwnd, "ID")
Edgemeal is offline   Reply With Quote
Old 05-06-2019, 09:47 AM   #459
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Thnx Edgemeal
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 05-07-2019, 04:37 AM   #460
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,595
Default

I cannot make this work
Code:
view = reaper.JS_Window_FromPoint(reaper.GetMousePosition())
  
  peekOK, _, time, keys, _, x, y = reaper.JS_WindowMessage_Peek(view, "WM_LBUTTONDOWN")
  if peekOK and time ~= prevTime then
      L_press = true
      -- Left button has been pressed
  end
nothing is happening, am I doing something wrong or there were some changes?

Also is there any way to make this little cpu friendly?
Code:
 local retval, found = reaper.JS_Window_ListAllChild(main_wnd)
    for adr in found:gmatch("%w+") do
      local handl = reaper.JS_Window_HandleFromAddress(tonumber(adr))
      for i = 1 ,#tbl do
        if reaper.JS_Window_GetLongPtr(handl, "USER") == tbl[i].track then
          _, _, top, _, bottom = reaper.JS_Window_GetRect(handl)
        end
      end
Not really sure which one in there is a little cpu hungrier

Last edited by Sexan; 05-07-2019 at 05:12 AM.
Sexan is online now   Reply With Quote
Old 05-07-2019, 07:04 AM   #461
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Quote:
Originally Posted by Sexan View Post
I cannot make this work
nothing is happening, am I doing something wrong or there were some changes?
Unlike the VKeys functions, which are constantly updating keystrokes in the background, the WindowMessage functions must first be activated for a specific window. So before you can start Peeking, you must first run reaper.JS_WindowMessage_Intercept(view, "WM_LBUTTONDOWN", true/false), and when the script exists, release the intercept.


Quote:
Originally Posted by Sexan View Post
Also is there any way to make this little cpu friendly?
I will take a look at it.
juliansader is offline   Reply With Quote
Old 05-07-2019, 07:07 AM   #462
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,595
Default

Quote:
Originally Posted by juliansader View Post
Unlike the VKeys functions, which are constantly updating keystrokes in the background, the WindowMessage functions must first be activated for a specific window. So before you can start Peeking, you must first run reaper.JS_WindowMessage_Intercept(view, "WM_LBUTTONDOWN", true), and when the script exists, release the intercept.




I will take a look at it.
Oh yeah, I've forgot... Thank you! Is the same principle with intercepting VKeys? Just instead of WM_ I add VK code? (For WM I need to access mousewheel since I cannot get it from JS_Mouse_GetState,I have some nifty ideas, but everything else will go thru VK)
Sexan is online now   Reply With Quote
Old 05-07-2019, 07:50 AM   #463
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,054
Default

Guys, is there a way to send a mouse click without actually focusing the clicked window?
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Old 05-07-2019, 11:22 AM   #464
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Quote:
Originally Posted by Sexan View Post
Code:
 local retval, found = reaper.JS_Window_ListAllChild(main_wnd)
    for adr in found:gmatch("%w+") do
      local handl = reaper.JS_Window_HandleFromAddress(tonumber(adr))
      for i = 1 ,#tbl do
        if reaper.JS_Window_GetLongPtr(handl, "USER") == tbl[i].track then
          _, _, top, _, bottom = reaper.JS_Window_GetRect(handl)
        end
      end
Not really sure which one in there is a little cpu hungrier
This can indeed be made much faster.

* Firstly, take the GetLongPtr out of the loop. In my 100-track test project, this by itself improved speed from 0.025s to 0.003s:
Code:
      local handl = reaper.JS_Window_HandleFromAddress(tonumber(adr))
      local track = reaper.JS_Window_GetLongPtr(handl, "USER")
      for i = 1 ,#tbl do
        if tbl[i].track == track then
          _, _, top, _, bottom = reaper.JS_Window_GetRect(handl)
        end
      end
* Would it be possible to use the track pointer itself as the key in tbl, so that you don't have to iterate through every track? (Or keep a separate table that maps track pointers to their numbers.) This will improve speed from 0.003s to 0.0015s (the larger the project, the greater the improvement should be):
Code:
for adr in found:gmatch("%w+") do
    local handl = reaper.JS_Window_HandleFromAddress(tonumber(adr))
    local track = reaper.JS_Window_GetLongPtr(handl, "USER")
    if tbl[track] then
        local _, _, top, _, bottom = reaper.JS_Window_GetClientRect(handl)
        tbl[track].top, tbl[track].bottom = top, bottom
    end
end
* Arrays are faster than string lists, and the values inside an array can be directly accessed via JS_Int and JS_Double, or the array can be converted to a table. This will improve speed further to 0.001s:
Code:
a = reaper.new_array({}, 1000) -- or clear an existing array
reaper.JS_Window_ArrayAllChild(reaper.GetMainHwnd(), a)
local t = a.table()
for i, adr in ipairs(t) do
    local handl = reaper.JS_Window_HandleFromAddress(adr)
    local track = reaper.JS_Window_GetLongPtr(handl, "USER")
    if tbl[track] then
        local _, _, top, _, bottom = reaper.JS_Window_GetClientRect(handl)
        tbl[track].top, tbl[track].bottom = top, bottom
    end
end
Altogether, a 25x improvement!

EDIT: Corrected some copy/paste errors in the code.

Last edited by juliansader; 05-07-2019 at 03:37 PM.
juliansader is offline   Reply With Quote
Old 05-07-2019, 11:27 AM   #465
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Quote:
Originally Posted by Sexan View Post
And while you are here, how do you do intercepting with VK ? Same as before (JS_WindowMessage_Intercept)?
No, VKeys_Intercept works quite differently than WindowMessage_Intercept. From the API help:
Quote:
int reaper.JS_VKeys_Intercept(int keyCode, int intercept)

Intercepting (blocking) virtual keys work similar to the native function PreventUIRefresh: Each key has a (non-negative) intercept state, and the key is passed through as usual if the state equals 0, or blocked if the state is greater than 0.

keyCode: The virtual key code of the key, or -1 to change the state of all keys.

intercept: A script can increase the intercept state by passing +1, or lower the state by passing -1. Multiple scripts can block the same key, and the intercept state may reach up to 255. If zero is passed, the intercept state is not changed, but the current state is returned.

Returns: If keyCode refers to a single key, the intercept state of that key is returned. If keyCode = -1, the state of the key that is most strongly blocked (highest intercept state) is returned.
juliansader is offline   Reply With Quote
Old 05-07-2019, 02:45 PM   #466
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,595
Default

Wow, looks like I will be refactoring some stuff. Thank you
Sexan is online now   Reply With Quote
Old 05-07-2019, 07:20 PM   #467
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Another idea: If you keep a record of window addresses that are *not* track panes in another table tNotTracks[], you don't need to get their handles and userdata again. This brings speed down to below 0.6ms!
Code:
a = reaper.new_array({}, 1000) -- or clear an existing array
reaper.JS_Window_ArrayAllChild(reaper.GetMainHwnd(), a)
local t = a.table()
for i = 1, #t do
    local adr = t[i]
    if not tNotTracks[adr] then
        local handl = reaper.JS_Window_HandleFromAddress(adr)
        local user = reaper.JS_Window_GetLongPtr(handl, "USER")
        if tbl[user] then
            local _, _, top, _, bottom = reaper.JS_Window_GetClientRect(handl)
            tbl[user].top, tbl[user].bottom = top, bottom
        else
            tNotTracks[adr] = true
        end
    end
end
juliansader is offline   Reply With Quote
Old 05-08-2019, 04:31 AM   #468
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,595
Default

I still have few problematic functions that I need to figure out how to fix before modifying code. For now I've just made a simple mod ("GetLongPtr out of the loop") to "get_track_y_range" function but something hits cpu extremely hard as soon there are some envelope tracks there (while mouse is down or updating project x-y):
- AS over 50 tracks CPU 0.1%


- AS over 50 tracks one of them all envelope visible (default ones) CPU 6-7%


- This it the same even if there a 1 tracks and has envelopes so the track count does not matter



Since the current way I am getting the range of tracks "GetTrackFromRange(y_t, y_b)" is not the best (its in constant loop while mouse is down), but its the only way that I can efficiently get both track and envelope tracks. There is probably much simpler way to write that function but its not yet came to my mind. It would be much simpler if reaper.GetTrackFromPoint returns envelopes also but it only returns optional number 1 if envelope is under mouse

https://github.com/GoranKovac/ReaScr...ree/master/WIP
I would really appreciate if you can check it, if and when you have time




EDIT: Fixed the issue.... was my bad in other script

Last edited by Sexan; 05-09-2019 at 03:58 AM.
Sexan is online now   Reply With Quote
Old 05-08-2019, 06:23 AM   #469
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,913
Default

Quote:
Originally Posted by _Stevie_ View Post
Guys, is there a way to send a mouse click without actually focusing the clicked window?
How are you sending a mouse click now?

I've used this in a few scripts (in Windows) and the target window (or parent) doesn't steal the focus,..
Code:
function Post_LMouseDownUp(hwnd, x, y) -- x,y = location to click inside the window
  reaper.JS_WindowMessage_Post(hwnd, "WM_LBUTTONDOWN", 1, 0, x, y)
  reaper.JS_WindowMessage_Post(hwnd, "WM_LBUTTONUP", 0, 0, x, y)
end
If 'JS_WindowMessage_Post' doesn't work on a target window try 'JS_WindowMessage_Send' instead (Send waits for a return, Post doesn't).

If the target window does steal focus then it was probably coded that way, you could save the foreground/active window handles, click the mouse then restore the original foreground window.
Edgemeal is offline   Reply With Quote
Old 05-08-2019, 07:15 AM   #470
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,595
Default

Quote:
Originally Posted by juliansader View Post
Code:
a = reaper.new_array({}, 1000) -- or clear an existing array
reaper.JS_Window_ArrayAllChild(reaper.GetMainHwnd(), a)
local t = a.table()
for i, adr in ipairs(t) do
    local handl = reaper.JS_Window_HandleFromAddress(adr)
    local track = reaper.JS_Window_GetLongPtr(handl, "USER")
    if tbl[track] then
        local _, _, top, _, bottom = reaper.JS_Window_GetClientRect(handl)
        tbl[track].top, tbl[track].bottom = top, bottom
    end
end
This is incredibly fast, the only problem is track (user data) cannot be set as key so it needs guid and then we have ANOTHER problem is envelopes do not have guid...

EDIT: tostring(track)

Last edited by Sexan; 05-08-2019 at 07:28 AM.
Sexan is online now   Reply With Quote
Old 05-08-2019, 07:56 AM   #471
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Quote:
Originally Posted by juliansader View Post
Altogether, a 25x improvement!
I learn so much from you guys...
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 05-08-2019, 09:04 AM   #472
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,054
Default

Quote:
Originally Posted by Edgemeal View Post
How are you sending a mouse click now?
This is actually for a touchscreen. I'm using LBX Stripper on a touchscreen. The buttons I press execute a MIDI command, which will trigger an action in foobar2000 (via an AHK script).

So:
-> pressing a button in LBX Stripper sends MIDI data
-> AHK script converts MIDI message to "paste text" in foobar2000
-> foobar2000 loses focus because touchscreen was used
-> foobar2000 gets focus back because AHK is telling to do so
= result is a constant flickering when executing that action

Could a click on the touchscreen be re-interpreted by LUA to execute a click without changing the focus?
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Old 05-08-2019, 09:24 AM   #473
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,595
Default

Julian I've implemented your new method with array and its so fast it's disgusting...
Before drawing "shadows" of 25+ items would hit cpu pretty bad and stuff starts stuttering, now selected more than 100 items across 50 tracks barely gets 3%. Silky smooth and there is more room to improve it since my item "shadow" code is bad

I've updated the code on git (WIP folder)

Thank you very much!

Last edited by Sexan; 05-08-2019 at 09:41 AM.
Sexan is online now   Reply With Quote
Old 05-08-2019, 10:57 AM   #474
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
Default

Quote:
Originally Posted by Sexan View Post
its so fast it's disgusting...
Lol.
nofish is offline   Reply With Quote
Old 05-08-2019, 11:27 AM   #475
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,595
Default

haha

Julian I have another idea and dont know if possible:
instead of blitting for every item which is not fun,is it possible to create one big image with every item ? create little images and compose them to one?

also how can I blit only part of the screen (I want to make item shadows to item images)? I have the code already for item (screen) coordinates

Last edited by Sexan; 05-08-2019 at 11:32 AM.
Sexan is online now   Reply With Quote
Old 05-08-2019, 01:20 PM   #476
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,595
Default

Quote:
Originally Posted by Sexan View Post
- AS over 50 tracks CPU 0.1%

- AS over 50 tracks one of them all envelope visible (default ones) CPU 6-7%

- This it the same even if there a 1 tracks and has envelopes so the track count does not matter

https://github.com/GoranKovac/ReaScr...ree/master/WIP
Improved code and reduced cpu usage to minimum (added checking), but still envelopes spike the CPU while selected

EDIT: Found the issue! lol, the other script had an error... don't know why it was there anyway... reaper.UpdateTimeline(). Now everything silky smooth

Last edited by Sexan; 05-09-2019 at 03:55 AM.
Sexan is online now   Reply With Quote
Old 05-10-2019, 05:42 AM   #477
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

I added a preliminary version of my ChildHWNDIDs-docs for Reaper-windows.
Still missing a lot, but might be helpful already:

https://github.com/Ultraschall/ultra...s-ChildIDs.txt
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 05-10-2019, 02:30 PM   #478
lb0
Human being with feelings
 
Join Date: Apr 2014
Posts: 4,171
Default

Quote:
Originally Posted by mespotine View Post
I added a preliminary version of my ChildHWNDIDs-docs for Reaper-windows.
Still missing a lot, but might be helpful already:

https://github.com/Ultraschall/ultra...s-ChildIDs.txt
WOW!! What a HUGE list! Thank you for your hard work on this - this will be invaluable!
__________________
Projects - Reascripts - Lua:
Smart Knobs 2 | LBX Stripper | LBX Floating FX Positioner
Donate via Paypal | LBX Tools Website
lb0 is offline   Reply With Quote
Old 05-11-2019, 04:42 PM   #479
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 4,812
Default

Thanks man !
deeb is offline   Reply With Quote
Old 05-12-2019, 06:03 AM   #480
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,595
Default

@Julian

Is something like this possible?

Code:
local merge_bm = reaper.JS_LICE_CreateBitmap(true, 5000, 5000)
function test()
   for i = 1, #items do
      local item_bm[i]= reaper.JS_LICE_CreateBitmap(true, 1, 1)
      reaper.JS_LICE_FillRect(item_bm[i], item.x , item.y, item.w, item.h, 0x66557788, 1, "COPY" ) -- MAKE ITEM RECTANGLE
      reaper.JS_LICE_Blit( merge_bm, 0, 0, item_bm[i], 0, 0, 5000, 5000, 1, "COPY") -- BLIT ITEM RECTANGLE TO MERGE IMG
   end 
   reaper.JS_Composite(track_window, cursor.x , cursor.y, W, H, merge_bm, 0, 0, 1, 1)
end
So far I did not succeed, it just draws one big rectangle, but if its not possible I will stop trying. My code ATM draws and composites for every item.

Wanted to make envelope shadow also which I have coded, but drawing and compositing for every LICE line would not be a best thing...

Last edited by Sexan; 05-12-2019 at 06:10 AM.
Sexan is online now   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 11:25 AM.


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