Old 05-15-2020, 08:51 AM   #1201
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,054
Default

AS51:

__________________
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-15-2020, 12:05 PM   #1202
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 7,239
Default

Hi talented people. Using the reaper.JS_LICE_WritePNG() function
to save the captured screen to a file. it seems the png's saved with the v1.201 are not saved correctly.. here in windows x64 at least. I cannot open them and they are like 1Kb only. going back to js_ReaScriptAPI version 1.01 and it works.

Thank you for js_ReaScriptAPI which is amazing. still exploring.
heda is offline   Reply With Quote
Old 05-15-2020, 12:05 PM   #1203
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Thanks for testing! I have copied the results to the pre-release thread.

The next-to-last version of the extension, v1.010, contains a few improvements in compositing over v1.002, although I don't think those improvements would affect the flickering that you reported.
juliansader is offline   Reply With Quote
Old 05-15-2020, 12:09 PM   #1204
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Quote:
Originally Posted by heda View Post
Hi talented people. Using the reaper.JS_LICE_WritePNG() function to save the captured screen to a file. it seems the png's saved with the v1.201 are not saved correctly.. here in windows x64 at least. I cannot open them and they are like 1Kb only. going back to js_ReaScriptAPI version 1.01 and it works.

Thank you for js_ReaScriptAPI which is amazing. still exploring.
There was indeed an update in the libpng library between v1.010 and v1.200, but everything seemed to work fine in my own tests.

Which OS are you using, and does it happen with all pngs?
juliansader is offline   Reply With Quote
Old 05-15-2020, 12:19 PM   #1205
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 7,239
Default

Quote:
Originally Posted by juliansader View Post
There was indeed an update in the libpng library between v1.010 and v1.200, but everything seemed to work fine in my own tests.

Which OS are you using, and does it happen with all pngs?
win7 x64... I'll try to test it on windows 10 later
yes.. everytime. the png only has a few header bytes
heda is offline   Reply With Quote
Old 05-15-2020, 01:26 PM   #1206
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,913
Default SetCursorPos

Is there an equivalent to the Win32 API SetCursorPos?
Edgemeal is offline   Reply With Quote
Old 05-15-2020, 01:29 PM   #1207
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,054
Default

Quote:
Originally Posted by juliansader View Post
Thanks for testing! I have copied the results to the pre-release thread.

The next-to-last version of the extension, v1.010, contains a few improvements in compositing over v1.002, although I don't think those improvements would affect the flickering that you reported.
You are welcome Julian! Thanks for doing so many great things!

Concerning the flickering: it's funny, because in classic mode this never happened. But I don't know enough about all that to judge where this comes from
__________________
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-15-2020, 01:44 PM   #1208
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,721
Default

I tested AS51 with Metal on the latest +dev. I couldn't reproduce all of the issues, but I did see some where the image being drawn was partly offscreen. I'll see if that is an issue on our end, but JS_Composite should perhaps clip things?
Justin is offline   Reply With Quote
Old 05-15-2020, 01:57 PM   #1209
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Quote:
Originally Posted by Edgemeal View Post
Is there an equivalent to the Win32 API SetCursorPos?
JS_Mouse_SetPosition
juliansader is offline   Reply With Quote
Old 05-15-2020, 02:05 PM   #1210
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Quote:
Originally Posted by Justin View Post
I tested AS51 with Metal on the latest +dev. I couldn't reproduce all of the issues, but I did see some where the image being drawn was partly offscreen. I'll see if that is an issue on our end, but JS_Composite should perhaps clip things?
Version 1.010 and later do clip if the invalidated area is smaller than the client area (it employs two steps: first LICE_ScaledBlit the bitmaps into a temporary buffer and then BitBlt only the invalidated region into the window).

However, if the invalidated area covers the entire client area, it assumes that REAPER will clip blits that are partly offscreen.

It will be easy to adapt JS_Composite to clip everything to the client area.
juliansader is offline   Reply With Quote
Old 05-15-2020, 04:05 PM   #1211
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,913
Default

Quote:
Originally Posted by juliansader View Post
JS_Mouse_SetPosition
Awesome! Just what I needed for "Auto move LICEcap" script! Moves LICEcap window when mouse gets near its edges.

Thanks again!
Edgemeal is offline   Reply With Quote
Old 05-15-2020, 07:34 PM   #1212
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 Edgemeal View Post
Awesome! Just what I needed for "Auto move LICEcap" script! Moves LICEcap window when mouse gets near its edges.

Thanks again!
Nice scriptidea, I should check that out...
__________________
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-16-2020, 03:18 PM   #1213
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 13,333
Default

Quote:
Originally Posted by Edgemeal View Post
Awesome! Just what I needed for "Auto move LICEcap" script! Moves LICEcap window when mouse gets near its edges.
This looks really cool.
vitalker is online now   Reply With Quote
Old 05-18-2020, 03:27 AM   #1214
cohler
Banned
 
Join Date: Dec 2018
Posts: 642
Default BUG question: Dragging fade edge reverts fade to default

Does anyone here know of a solution to the following bug/major problem in REAPER?

I posted this also in a bug thread but have received no response of any kind as usual from the developers.

If you create a cross fade and customize it with various asymmetric fade shapes and lengths, as soon as you go to drag either the left or right edge of the fade, it instantly (and for no documented reason) reverts the the fade shapes back to defaults on both sides and reverts the fade lengths back to fit precisely between the two item edges.

This is a particularly annoying bug for anyone doing acoustical music editing, which involves a large fraction of time adjusting crossfades.


Last edited by cohler; 05-18-2020 at 03:39 AM. Reason: add video
cohler is offline   Reply With Quote
Old 05-18-2020, 03:51 AM   #1215
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,587
Default

How is that related to JS_API?
Sexan is online now   Reply With Quote
Old 05-18-2020, 04:36 AM   #1216
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,054
Default

Not at all
__________________
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-18-2020, 06:28 AM   #1217
cohler
Banned
 
Join Date: Dec 2018
Posts: 642
Default

Quote:
Originally Posted by Sexan View Post
How is that related to JS_API?
I thought Julian or one of you might know the answer to this question, that's all. And I thought this was in the developer's forum area...
cohler is offline   Reply With Quote
Old 05-18-2020, 07:39 AM   #1218
Ideosound
Human being with feelings
 
Ideosound's Avatar
 
Join Date: Oct 2017
Location: U.K
Posts: 542
Default

Quote:
Originally Posted by cohler View Post
I thought Julian or one of you might know the answer to this question, that's all. And I thought this was in the developer's forum area...
Just post your bug report on every dev update thread on the forum until the devs respond to it. Sometimes they fix things but don't actually say in the thread it is on their list. Odd I know.
Ideosound is offline   Reply With Quote
Old 05-18-2020, 10:59 AM   #1219
Klangfarben
Human being with feelings
 
Join Date: Jul 2016
Location: Los Angeles, CA
Posts: 1,701
Default

Quote:
Originally Posted by Ideosound View Post
Just post your bug report on every dev update thread on the forum until the devs respond to it. Sometimes they fix things but don't actually say in the thread it is on their list. Odd I know.
That's literally the worst idea ever. It's just going to piss the devs off especially as Justin has specifically asked people not to do that.

Just post it in the bug reports forum or the main Reascript/JSFX forum here, rather than in Julian's JS API thread which is specific to his API. If it can be dealt with via a script, someone will know. If not, then it has at least been reported as a bug.
Klangfarben is offline   Reply With Quote
Old 05-18-2020, 02:21 PM   #1220
Ideosound
Human being with feelings
 
Ideosound's Avatar
 
Join Date: Oct 2017
Location: U.K
Posts: 542
Default

Quote:
Originally Posted by Klangfarben View Post
That's literally the worst idea ever. It's just going to piss the devs off especially as Justin has specifically asked people not to do that.
Ah yeah ok then not a good idea! I take that back. Your advice is a lot more sensible.
Ideosound is offline   Reply With Quote
Old 05-18-2020, 04:21 PM   #1221
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,913
Default

Quote:
Originally Posted by vitalker View Post
This looks really cool.
Might look cool, but moving even small-ish window around the screen basically defeats the purpose of the LICE option "...make smaller gifs" and file sizes get big pretty quick!
Better to just set LICE to only area you need to capture with a reasonable FPS.
Edgemeal is offline   Reply With Quote
Old 05-19-2020, 02:15 AM   #1222
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 13,333
Default

Quote:
Originally Posted by Edgemeal View Post
Might look cool, but moving even small-ish window around the screen basically defeats the purpose of the LICE option "
Ah, I see.
vitalker is online now   Reply With Quote
Old 05-21-2020, 06:26 AM   #1223
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Is there a way to set the windowstyle in a way, that resizing it is not possible?
And does this work on Mac and Linux 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-21-2020, 07:41 AM   #1224
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,913
Default

Only Win10 here, but maybe try,

WS_THICKFRAME: The window has a sizing border. Same as the WS_SIZEBOX style.
https://docs.microsoft.com/en-us/win.../window-styles

EDIT Don't allow user to resize or maximize window...
Code:
function Main()
  window = reaper.JS_Window_Create("Testing", "myClass", 120, 120, 300, 300)
  local style = reaper.JS_Window_GetLong(window, "STYLE")
  style = style & (0xFFFFFFFF - (WS_THICKFRAME | WS_MAXIMIZEBOX))
  reaper.JS_Window_SetLong(window, "STYLE", style)
end

WS_THICKFRAME = 0x40000
WS_MAXIMIZEBOX = 0x10000

Main()

Last edited by Edgemeal; 05-21-2020 at 07:53 AM.
Edgemeal is offline   Reply With Quote
Old 05-21-2020, 09:14 AM   #1225
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 Edgemeal View Post
Only Win10 here, but maybe try,

WS_THICKFRAME: The window has a sizing border. Same as the WS_SIZEBOX style.
https://docs.microsoft.com/en-us/win.../window-styles

EDIT Don't allow user to resize or maximize window...
Code:
function Main()
  window = reaper.JS_Window_Create("Testing", "myClass", 120, 120, 300, 300)
  local style = reaper.JS_Window_GetLong(window, "STYLE")
  style = style & (0xFFFFFFFF - (WS_THICKFRAME | WS_MAXIMIZEBOX))
  reaper.JS_Window_SetLong(window, "STYLE", style)
end

WS_THICKFRAME = 0x40000
WS_MAXIMIZEBOX = 0x10000

Main()
Thanks
__________________
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-21-2020, 09:48 AM   #1226
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

I have uploaded v1.215 with the following changes:
* Fixed: LICE_WritePNG when image has transparency.
* New: LICE_LoadJPG, LICE_WriteJPG.
* Updated: If Metal graphics, JS_Composite clips to client area.
juliansader is offline   Reply With Quote
Old 05-21-2020, 09:56 AM   #1227
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
I have uploaded v1.215 with the following changes:
* Fixed: LICE_WritePNG when image has transparency.
* New: LICE_LoadJPG, LICE_WriteJPG.
AWESOME!!!

So I can resize png and jpg images and store them right away?
__________________
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-21-2020, 12:03 PM   #1228
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 3,451
Default

Quote:
Originally Posted by juliansader View Post
I have uploaded v1.215 with the following changes:
* Fixed: LICE_WritePNG when image has transparency.
* New: LICE_LoadJPG, LICE_WriteJPG.
* Updated: If Metal graphics, JS_Composite clips to client area.

Thank you!

What is the current state of the Metal/JS_Composite problem? Is it considered to be solved?
__________________
Most of my scripts can be found in ReaPack.
If you find them useful, a donation would be greatly appreciated! Thank you! :)

Last edited by amagalma; 05-22-2020 at 02:59 AM.
amagalma is offline   Reply With Quote
Old 05-21-2020, 10:16 PM   #1229
dsyrock
Human being with feelings
 
dsyrock's Avatar
 
Join Date: Sep 2018
Location: China
Posts: 565
Default

I have a question about JS_Dialog_BrowseForOpenFiles

After I using it to read a file, for example E:\bak\test.wav, then Reaper will occupy the path that it load from, in this case E:\bak will be lock up.

Is there any way to prevent?
dsyrock is offline   Reply With Quote
Old 05-22-2020, 02:44 PM   #1230
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
So I can resize png and jpg images and store them right away?
Yep. (Note that LICE_Resize only resizes the bitmap coordinates, and does not do anything to the bitmap image contents. You have to use another function such as LICE_ScaledBlit to resize the images.)


Quote:
Originally Posted by amagalma View Post
What is the current state of the Metal/JS_Composite problem? Is it considered to be solved?
The opacity problem (which caused the huge opaque blocks in my MIDI scripts) and the stretching problem (which caused your guidelines and Sexan's areas to disappear, since they both make use of single-pixel bitmaps that are stretched into lines or rextangles) are both fixed.

Stevie did report lots of flickering, unfortunately. I'm not sure what the cause of the flickering is, whether other users will report the same problem, or whether any further improvements in Metal are in the works.
juliansader is offline   Reply With Quote
Old 05-22-2020, 02:51 PM   #1231
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Quote:
Originally Posted by dsyrock View Post
I have a question about JS_Dialog_BrowseForOpenFiles

After I using it to read a file, for example E:\bak\test.wav, then Reaper will occupy the path that it load from, in this case E:\bak will be lock up.

Is there any way to prevent?
Could you please give some more information? (Which functions did you use to open and read the file? What happens when the file is locked? Which other functions or applications cannot access the file?)
juliansader is offline   Reply With Quote
Old 05-22-2020, 03:11 PM   #1232
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,054
Default

Quote:
Originally Posted by juliansader View Post
Yep. (Note that LICE_Resize only resizes the bitmap coordinates, and does not do anything to the bitmap image contents. You have to use another function such as LICE_ScaledBlit to resize the images.)




The opacity problem (which caused the huge opaque blocks in my MIDI scripts) and the stretching problem (which caused your guidelines and Sexan's areas to disappear, since they both make use of single-pixel bitmaps that are stretched into lines or rextangles) are both fixed.

Stevie did report lots of flickering, unfortunately. I'm not sure what the cause of the flickering is, whether other users will report the same problem, or whether any further improvements in Metal are in the works.
@Julian, this solved ALL of my issues in MacOS! Thank you!!!
__________________
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-22-2020, 03:22 PM   #1233
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Quote:
Originally Posted by _Stevie_ View Post
@Julian, this solved ALL of my issues in MacOS! Thank you!!!
Are you *not* seeing the flickering any more, even in Metal mode? That would be very good news!
juliansader is offline   Reply With Quote
Old 05-22-2020, 03:25 PM   #1234
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,054
Default

Quote:
Originally Posted by juliansader View Post
Are you *not* seeing the flickering any more, even in Metal mode? That would be very good news!
I checked quickly with AS51 (Metal mode) and there was no flickering at alll!
So I would say it’s fixed. But I will check in-depth tomorrow.
__________________
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-22-2020, 07:36 PM   #1235
dsyrock
Human being with feelings
 
dsyrock's Avatar
 
Join Date: Sep 2018
Location: China
Posts: 565
Default

Quote:
Originally Posted by juliansader View Post
Could you please give some more information? (Which functions did you use to open and read the file? What happens when the file is locked? Which other functions or applications cannot access the file?)
I am using reaper.JS_Dialog_BrowseForOpenFiles.

For example, I use it to load/read E:\bak\test.wav, then Reaper will occupy the FOLDER E:\bak. I mean I can't change it's name, or delete it in window's explorer.
dsyrock is offline   Reply With Quote
Old 05-23-2020, 09:34 AM   #1236
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 3,451
Default

Quote:
Originally Posted by dsyrock View Post
I am using reaper.JS_Dialog_BrowseForOpenFiles.

For example, I use it to load/read E:\bak\test.wav, then Reaper will occupy the FOLDER E:\bak. I mean I can't change it's name, or delete it in window's explorer.

I confirm. Should this happen? It's like we have used file = io.open() in lua and then forgot to file:close()
__________________
Most of my scripts can be found in ReaPack.
If you find them useful, a donation would be greatly appreciated! Thank you! :)
amagalma is offline   Reply With Quote
Old 05-23-2020, 10:43 AM   #1237
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 7,239
Default

something similar happens with the Xen_StartSourcePreview function

I use to play an audio file. And then you cannot delete that audio file until you close REAPER.

Another question: Is there a way to know what percentage of the audio has been played? Or at least when it has finished playing?

Maybe if there is a function to know when it has finished playing, it could also close the file for read.
heda is offline   Reply With Quote
Old 05-23-2020, 11:36 AM   #1238
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 heda View Post
Another question: Is there a way to know what percentage of the audio has been played? Or at least when it has finished playing?
Unfortunately no. You would need to retrieve the length of the file somehow and calculate it on your own.
But if I remember correctly, the preview-functions need the PCM_Source and this probably would need to be destroyed later. But I might be wrong.
__________________
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-24-2020, 11:25 AM   #1239
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,054
Default

@Julian, is there a way to "un-destroy" or re-create:

Code:
reaper.JS_LICE_Clear()
What I basically want to do is: when a key is pressed, show an object, when the key is released, hide it.
__________________
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

Last edited by _Stevie_; 05-24-2020 at 12:02 PM.
_Stevie_ is offline   Reply With Quote
Old 05-24-2020, 03:55 PM   #1240
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Could you elaborate a little on what you are trying to do?
juliansader 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 05:08 AM.


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