Old 01-19-2019, 10:24 AM   #201
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 1,040
Default

Quote:
Originally Posted by tparker24 View Post
I searched for "js_reascript" and then for "js_rea", but got no results. ("js_re" did show a bunch, but nothing with reascript).
Manage Repositories > "ReaTeam Extensions" is enabled? > Sync again.
Edgemeal is offline   Reply With Quote
Old 01-19-2019, 10:32 AM   #202
tparker24
Human being with feelings
 
Join Date: Dec 2017
Posts: 44
Default

Quote:
Originally Posted by Edgemeal View Post
Manage Repositories > "ReaTeam Extensions" is enabled? > Sync again.
Yes, they're all enabled. Did yet another "Refresh repositories", but still no luck.

I vaguely remember something about it being removed from Reapack ... could you perhaps give it a try?
tparker24 is offline   Reply With Quote
Old 01-19-2019, 10:46 AM   #203
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 1,040
Default

Quote:
Originally Posted by tparker24 View Post
Yes, they're all enabled. Did yet another "Refresh repositories", but still no luck.

I vaguely remember something about it being removed from Reapack ... could you perhaps give it a try?
Ya still there, v0.962. I have no clue what the problem could be, maybe exit reaper, delete the reapack cache/files, and re-setup?
Edgemeal is offline   Reply With Quote
Old 01-19-2019, 11:08 AM   #204
tparker24
Human being with feelings
 
Join Date: Dec 2017
Posts: 44
Default

Quote:
Originally Posted by Edgemeal View Post
Ya still there, v0.962. I have no clue what the problem could be, maybe exit reaper, delete the reapack cache/files, and re-setup?
Deleting the Reapack directory and starting over didn't really help.

FYI, my Reaper version is v5.965/x64.
tparker24 is offline   Reply With Quote
Old 01-19-2019, 11:12 AM   #205
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 8,453
Default

Quote:
Originally Posted by tparker24 View Post
I didn't see "Synchronize packages"
It's a dedicated menu entry in Reaper under ReaPack menu (here at least).



(I have ReaMenu installed, so it might look a bit different on your side.)

Last edited by nofish; 01-19-2019 at 11:18 AM.
nofish is offline   Reply With Quote
Old 01-19-2019, 11:20 AM   #206
tparker24
Human being with feelings
 
Join Date: Dec 2017
Posts: 44
Default

Quote:
Originally Posted by nofish View Post
It's a dedicated menu entry in Reaper (here at least).



(I have ReaMenu installed, so it might look a bit different on your side.)
Thanks. I also found that in Actions.

I imagine that Synchronize does the same thing as "Refresh repositories" (which is under the packages dropdown in the browser).
tparker24 is offline   Reply With Quote
Old 01-19-2019, 11:41 AM   #207
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 2,541
Default

Copy and paste this URL in Extensions > ReaPack > Import a repository:

Code:
https://github.com/ReaTeam/Extensions/raw/master/index.xml
The extensions repository is configured by default in ReaPack only since the v1.2.2rc2 pre-release. (The current public release is v1.2.1.)

Quote:
Originally Posted by tparker24 View Post
I imagine that Synchronize does the same thing as "Refresh repositories" (which is under the packages dropdown in the browser).
"Refresh repositories" only refreshes the list of available packages. Synchronize also updates installed packages (among other things).

Last edited by cfillion; 01-19-2019 at 12:33 PM.
cfillion is offline   Reply With Quote
Old 01-19-2019, 12:05 PM   #208
tparker24
Human being with feelings
 
Join Date: Dec 2017
Posts: 44
Default

Quote:
Originally Posted by cfillion View Post
Copy and paste this URL in Extensions > ReaPack > Import a repository:

Code:
https://github.com/ReaTeam/Extensions/raw/master/index.xml
The extensions repository is configured by default in ReaPack only since the v1.2.2rc2 pre-release. (The current public release is v1.2.1.)
Thanks, that did it!

Quote:
"Refresh repositories" only refreshes the package list. Synchronize also updates installed packages.
Is there a way to Sync from within the browser (only saw Refresh)?

Also, in all the excitement, it looks like Reapack no longer knows which I have previously installed -- as indicated by "i" in the first column of the browser. I don't suppose there's a way to get that info back?
tparker24 is offline   Reply With Quote
Old 01-19-2019, 12:11 PM   #209
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 2,541
Default

Restore registry.db if you still have a copy of the files deleted earlier from the ReaPack directory (eg. in your trashbin or from a backup).

Quote:
Originally Posted by tparker24 View Post
Is there a way to Sync from within the browser (only saw Refresh)?
The browser doesn't have a synchronize button (it instead allows updating each package individually), but you can synchronize from the Extensions menu or the action list while the browser is opened.

Last edited by cfillion; 01-19-2019 at 12:27 PM.
cfillion is offline   Reply With Quote
Old 01-19-2019, 12:35 PM   #210
tparker24
Human being with feelings
 
Join Date: Dec 2017
Posts: 44
Default

Quote:
Originally Posted by cfillion View Post
Restore registry.db if you still have a copy of the files deleted earlier from the ReaPack directory (eg. in your trashbin or from a backup).
Yep, that worked, thanks!

Quote:
The browser doesn't have a synchronize button (it instead allows updating each package individually), but you can synchronize from the Extensions menu or the action list while the browser is opened.
Ok. Kind of a subtle distinction between Sync and Refresh, for just a simple user like me.
tparker24 is offline   Reply With Quote
Old 01-20-2019, 03:26 AM   #211
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 2,349
Default

Quote:
Originally Posted by mespotine View Post
It works only on Windows, but not on Mac, as if it can't find the HWND.
Oops, I found the source of the problem, and will quickly fix it in a new version.

EDIT: new version 0.963 uploaded. (Thanks for testing on macOS!)

Last edited by juliansader; 01-20-2019 at 11:56 AM.
juliansader is offline   Reply With Quote
Old 01-20-2019, 11:54 AM   #212
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 2,349
Default

Quote:
Originally Posted by Edgemeal View Post
Will this work?, and can still use true for JS_Window_Find?
Code:
Code:
local title = reaper.JS_Localize("Media Explorer", "common")
local explorer = reaper.JS_Window_Find(title, true)
Yes, this is how it is intended to work.

(BTW, the Media Explorer is one of the few windows for which the HWNDs can be retrieved using a native function, in this case OpenMediaExplorer.)
juliansader is offline   Reply With Quote
Old 01-20-2019, 01:00 PM   #213
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 808
Default

Quote:
Originally Posted by juliansader View Post
Oops, I found the source of the problem, and will quickly fix it in a new version.

EDIT: new version 0.963 uploaded. (Thanks for testing on macOS!)
Oh, thanks
__________________
Ultraschall-API - a Lua-functions-library4Reaper: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs4Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 01-20-2019, 03:45 PM   #214
Arthur McArthur
Human being with feelings
 
Join Date: Sep 2016
Location: Toronto
Posts: 434
Default

Could something in this extension be used to script something to resize a docked media explorer and/or sort it by date?
Arthur McArthur is offline   Reply With Quote
Old 01-20-2019, 04:11 PM   #215
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 808
Default

Yes...but it's tricky and fiddly.
And I think, you wouldn't be able to change the size of the labels, like Take Name, Status, and such, as it's probably not possible to get the size of them.

The attempt would be, to manipulate the mousecursor to click there and return the mousecursor to its original position again.

Problem is, when you change the size of the panels, we cannot find out about that, so we could click into the wrong label as the right label has been moved sideways due the resizing.
And clicking the wrong label accidentally would result into the wrong sorting order.

But I might be wrong on this...still learning these great functions myself
__________________
Ultraschall-API - a Lua-functions-library4Reaper: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs4Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 01-20-2019, 04:31 PM   #216
tparker24
Human being with feelings
 
Join Date: Dec 2017
Posts: 44
Default python "definition file"

Quote:
Originally Posted by mespotine View Post
And one other thing: Reaper and SWS have some kind of a definition-file, so Python can use the SWS-functions as well:

reaper_python.py and sws_python.py.

Is there something like that also available for your plugin?
Although I don't know much about Perl or C, I muddled through somehow and was able to cobble together the python interface file needed for python users. I'm calling it JS_ReaScriptAPI.py

You need to place it in your Plugins (not UserPlugins) directory. For example, in my portable install it goes in: D:\REAPER\Plugins

Then, in your python script, you need to have an import like: from JS_ReaScriptAPI import *


Here's my little python test script:
Code:
from JS_ReaScriptAPI import *
v = JS_ReaScriptAPI_Version(0)
RPR_ShowConsoleMsg(v)
This is unofficial, and there are no guarantees, but it works fine in my little test script.

Attached is the txt file (916 lines), which you need to rename to: JS_ReaScriptAPI.py
JS_ReaScriptAPI.txt

Hope this helps, but let me know if I've encroached on the author!

- Tom
tparker24 is offline   Reply With Quote
Old 01-20-2019, 04:40 PM   #217
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 808
Default

Quote:
Originally Posted by tparker24 View Post
Although I don't know much about Perl or C, I muddled through somehow and was able to cobble together the python interface file needed for python users. I'm calling it JS_ReaScriptAPI.py

You need to place it in your Plugins (not UserPlugins) directory. For example, in my portable install it goes in: D:\REAPER\Plugins

Then, in your python script, you need to have an import like: from JS_ReaScriptAPI import *


Here's my little python test script:
Code:
from JS_ReaScriptAPI import *
v = JS_ReaScriptAPI_Version(0)
RPR_ShowConsoleMsg(v)
This is unofficial, and there are no guarantees, but it works fine in my little test script.

Attached is the txt file (916 lines), which you need to rename to: JS_ReaScriptAPI.py
Attachment 35525

Hope this helps, but let me know if I've encroached on the author!

- Tom
Thank you
It will be very helpful for Python Scripters...
__________________
Ultraschall-API - a Lua-functions-library4Reaper: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs4Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 01-20-2019, 06:49 PM   #218
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 1,040
Default

Quote:
Originally Posted by mespotine View Post
Yes...but it's tricky and fiddly.
You could toggle the sort of the columns, but I'm not sure how to get the width of the LV columns. Here I just send the mouse messages to the control where I want to click inside it. For example the Size column left edge on my explorer is at about 100 pixels from the left of the LV control, If I send a message just to the right of that it toggles the Size column...

Code:
function JS_LMouseDownUp(hWnd, x, y)
  reaper.JS_WindowMessage_Post(hWnd, "WM_LBUTTONDOWN", 1, 0, x, y)
  reaper.JS_WindowMessage_Post(hWnd, "WM_LBUTTONUP", 0, 0, x, y)
end

-- get handle to media explorer
local title = reaper.JS_Localize("Media Explorer", "common")
local explorer = reaper.JS_Window_Find(title, true)
-- get handle to 'File' Listview
local container =  reaper.JS_Window_FindChildByID(explorer, 0)
local lv = reaper.JS_Window_FindChildByID(container, 1000)
-- get handle to listview header
local lv_header = reaper.JS_Window_HandleFromAddress(reaper.JS_WindowMessage_Send(lv,"0x101F",0,0,0,0))
-- get LV column count - BUT HOW TO GET COLUMN WIDTHS?
lv_column_count = reaper.JS_WindowMessage_Send(lv_header,"0x1200",0,0,0,0)
-- send mouse click to lv column header 102 pixels to right of left edge.
JS_LMouseDownUp(lv_header, 102, 0)

Last edited by Edgemeal; 02-07-2019 at 08:03 AM. Reason: add Y param
Edgemeal is offline   Reply With Quote
Old 01-20-2019, 07:54 PM   #219
Arthur McArthur
Human being with feelings
 
Join Date: Sep 2016
Location: Toronto
Posts: 434
Default

Quote:
Originally Posted by Edgemeal View Post
You could toggle the sort of the columns
Hmm I gave this a shot and it was working for about 10 minutes but now I'm getting this error:

Media Explorer Toggle Date test.lua:11: 'reaper.JS_Window_FindChildByID' argument 1: expected void*

Not sure what went wrong, but this does seem like it would work.
Arthur McArthur is offline   Reply With Quote
Old 01-20-2019, 08:25 PM   #220
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 1,040
Default

Quote:
Originally Posted by Arthur McArthur View Post
Hmm I gave this a shot and it was working for about 10 minutes but now I'm getting this error:

Media Explorer Toggle Date test.lua:11: 'reaper.JS_Window_FindChildByID' argument 1: expected void*

Not sure what went wrong, but this does seem like it would work.
I did get an error initially when trying to get lv header handle , I then used HandleFromAddress to solve, and combined it into one line. maybe break it down and check for error?

Code:
local lv_head_adr = reaper.JS_WindowMessage_Send(lv,"0x101F",0,0,0,0) -- LVM_GETHEADER
msg(lv_head_adr)
local lv_header = reaper.JS_Window_HandleFromAddress(lv_head_adr)
msg(lv_header)
Edgemeal is offline   Reply With Quote
Old 01-20-2019, 08:43 PM   #221
Arthur McArthur
Human being with feelings
 
Join Date: Sep 2016
Location: Toronto
Posts: 434
Default

Gave that a shot and am now getting:

test.lua:1: 'reaper.JS_WindowMessage_Send' argument 1: expected void*
Arthur McArthur is offline   Reply With Quote
Old 01-20-2019, 08:57 PM   #222
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 808
Default

Does the HWND change by any chance? Maybe this happens, when the MediaExplorer is closed and no HWND is there anymore to work with...

@Arthur McArthur
Do you use Mac or Windows or Linux?
__________________
Ultraschall-API - a Lua-functions-library4Reaper: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs4Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 01-20-2019, 09:01 PM   #223
Arthur McArthur
Human being with feelings
 
Join Date: Sep 2016
Location: Toronto
Posts: 434
Default

I'm on Windows and the media explorer has remained open. It's weird, it works sometimes and then stops working without explanation.
Arthur McArthur is offline   Reply With Quote
Old 01-21-2019, 08:41 AM   #224
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 1,040
Default

Quote:
Originally Posted by Arthur McArthur View Post
I'm on Windows and the media explorer has remained open. It's weird, it works sometimes and then stops working without explanation.
Sometimes I'll be running a script from IDE window while Actions window is open and the code can't find a window anymore (return is nil), if I close the Actions window the code runs, or I close the IDE and Actions windows, re-open them and script runs from IDE again without error. So far have not seen code fail when running as actual action though.

Windows 7 / JS_API v0.962 / REAPER v5.965 / x64

Last edited by Edgemeal; 01-21-2019 at 10:15 AM. Reason: add system specs
Edgemeal is offline   Reply With Quote
Old 01-26-2019, 02:25 AM   #225
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,482
Default

@juliansader
Hi,


I have an issue with the save file function


for some reason sometimes it displays all the file of the choosen extension, and sometimes only the folder.


Here is a piece of code runs everal times:


https://i.imgur.com/gcXgFTa.gifv


Code:
if not reaper.JS_Dialog_BrowseForSaveFile then
  Msg("Please install JS_ReaScript REAPER extension")
else

 retval, file = reaper.JS_Dialog_BrowseForSaveFile( "Save Markers and Regions", '', "", ".csv" ) -- Save file

 if retval and file ~= '' then
  Main()
 end
  
end

Note that I don't succeed to reproduce if I only keep the save file line.


How come ?


WIn 10 and last JS vesion.



Thx !
X-Raym is offline   Reply With Quote
Old 01-26-2019, 05:29 AM   #226
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 2,349
Default

The extensionList string should strictly follow the format described in the API help (or in this post above). In your example, try this string:

"csv files (.csv)\0*.csv\0\0"
juliansader is offline   Reply With Quote
Old 01-26-2019, 07:30 AM   #227
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,482
Default

@juliansader
Excellent, here is my final string:


Code:
'csv files (.csv)\0*.csv\0All Files (*.*)\0*.*\0

Per default, just entering a File name will create a file without extension, the save doesn't force the extension based on the actual filter list, it would be nice if it could :P


Else, I suppose it could be handle by the script itself, but as this will be a common case, I worth having it default if possible, don't you think ?




BTW? \0 as seperator character is a very nice thing..... I really which GetUserInput to be like that, cause if you enter CSV in a multi line input window of this type, it just mess everything.
X-Raym is offline   Reply With Quote
Old 01-28-2019, 10:19 AM   #228
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 808
Default

I think I've found an issue JS_Mouse_GetState(), while using it on Mac(though I don't know, whether its a Mac-problem or a general problem).

I tried to write a script with it to get mouse-click-events in the ruler, which worked fine on Windows. However, when I tried the same script on Mac, it couldn't detect mouseclicks, when they were too short.
I think its because my Mac is much faster than my Windows-computer, so I think the mouseclicks are inbetween two defer-cycles and can't be detected because of that. Could be on Windows too, but I haven't noticed such a problem yet.

Anyway, as deferred ReaScripts can only run about 30 times per second and when they are run quick, the amount of time could be too short to notice mouseclicks.

So I think, the function should work something like that:
a background-thread constantly listens to the mouse-events/keyboard modifier-states.
When I run the JS_Mouse_GetState-function, it will return the current mouse-state(as usual) and in addition a csv-string, that contains all mousestates that happened since last time calling JS_Mouse_GetState or at least since the last defer-cycle.
That way, I couldn't miss any of them, no matter how short they are.

I have no idea how easy or hard this would be to implement, but it would improve heavily on Mouse-State-Management.


With that, I could add to my API a Mouse-Event-defer-script, that returns the mouseclicks(including dragging and doubleclick) in specific HWNDs, which would improve using mouse-states heavily(my dream is to program a clickable UI in the VideoProcessor-window).

Quote:
Originally Posted by X-Raym View Post
BTW? \0 as seperator character is a very nice thing..... I really which GetUserInput to be like that, cause if you enter CSV in a multi line input window of this type, it just mess everything.
Yep, that's really clever to do
__________________
Ultraschall-API - a Lua-functions-library4Reaper: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs4Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 01-31-2019, 06:32 AM   #229
reapero
Human being with feelings
 
Join Date: Aug 2011
Posts: 120
Default

Hey, dumb question probably but how come this:

Code:
retval, fileNames = reaper.JS_Dialog_BrowseForOpenFiles( "Select files", "C:\\", _, _, true )

reaper.ShowConsoleMsg(fileNames)
returns only the path, and not the file names?
reapero is offline   Reply With Quote
Old 01-31-2019, 06:58 AM   #230
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 808
Default

It is a string, where each entry is separated from each other by a \0

Path\0filename1\0filename2\0filename3 etc.

The \0 is equivalent to some extend to a nil in Lua, therefore Lua thinks, it ends after the path.
But with string.gmatch() or string.match(), you can search for the other ones as well.

See this post for a code snippet:

https://forum.cockos.com/showpost.ph...&postcount=133
__________________
Ultraschall-API - a Lua-functions-library4Reaper: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs4Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 02-01-2019, 12:21 PM   #231
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 2,349
Default

Quote:
Originally Posted by mespotine View Post
I think I've found an issue JS_Mouse_GetState(), while using it on Mac(though I don't know, whether its a Mac-problem or a general problem).

I tried to write a script with it to get mouse-click-events in the ruler, which worked fine on Windows. However, when I tried the same script on Mac, it couldn't detect mouseclicks, when they were too short.
To make sure that you detect even short mouse clicks, you have to use the WindowMessage functions to intercept mouse clicks in a specific window.
juliansader is offline   Reply With Quote
Old 02-01-2019, 01:39 PM   #232
reapero
Human being with feelings
 
Join Date: Aug 2011
Posts: 120
Default

Quote:
Originally Posted by mespotine View Post
It is a string, where each entry is separated from each other by a \0

Path\0filename1\0filename2\0filename3 etc.

The \0 is equivalent to some extend to a nil in Lua, therefore Lua thinks, it ends after the path.
But with string.gmatch() or string.match(), you can search for the other ones as well.

See this post for a code snippet:

https://forum.cockos.com/showpost.ph...&postcount=133
Thanks a lot Mespotine! You guys rock
reapero is offline   Reply With Quote
Old 02-01-2019, 02:36 PM   #233
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 2,349
Default

Quote:
Originally Posted by reapero View Post
Hey, dumb question probably but how come this:

Code:
retval, fileNames = reaper.JS_Dialog_BrowseForOpenFiles( "Select files", "C:\\", _, _, true )

reaper.ShowConsoleMsg(fileNames)
returns only the path, and not the file names?
The API function actually returns the path and all the file names, as Mespotine described. The problem is simply a display issue: REAPER's IDE and Console assume that all strings are null-terminated "C strings", and only display strings up to the first \0, so it may seem as if a string is not complete.

A related issue is that the IDE and Console don't display floating point values to the full precision, and only display about 14 digits. So don't always trust what you see in the display...

Under the hood, REAPER knows the entire string and the full precision numbers.

Lua strings aren't null-terminated, and Lua itself doesn't actually care about \0 characters inside strings. For example, when MIDI events are packed into strings for MIDI_Get/SetAllEvts, the string contains lots and lots of \0 bytes.
juliansader is offline   Reply With Quote
Old 02-07-2019, 07:27 AM   #234
reapero
Human being with feelings
 
Join Date: Aug 2011
Posts: 120
Default

Thanks for the insight JS!

I have a related question to the API i guess. I want to share a reaper configuration with some people, and i want the extension to be in for them so they dont have to install it separately.

1) Will they have to install a different version if they are on a mac? (I am on a PC). I guess this question also applies for SWS.

2) In case they dont, or in case i wanna share my config with anothe PC user..where does the API sit exaclty? In the Export configuration dialog, where you can select what to inlude in your exported config i see "configuration", "Reascripts", "Misc data"...Not really sure what to include in the config if i dont want them to install the API. Maybe they have to and this just doesnt matter
reapero is offline   Reply With Quote
Old 02-08-2019, 06:45 AM   #235
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 8,453
Default

Quote:
Originally Posted by reapero View Post
1) Will they have to install a different version if they are on a mac? (I am on a PC). I guess this question also applies for SWS.
Yes, they are different files on Win and Mac (.dll/.dylib)

Quote:
2) In case they dont, or in case i wanna share my config with anothe PC user..where does the API sit exaclty? In the Export configuration dialog, where you can select what to inlude in your exported config i see "configuration", "Reascripts", "Misc data"...Not really sure what to include in the config if i dont want them to install the API. Maybe they have to and this just doesnt matter
I just quickly looked through the Export configuration, seems to me there's no option to include user extensions (maybe I missed it though).
nofish is offline   Reply With Quote
Old 02-09-2019, 10:53 AM   #236
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 808
Default

No, UserPlugins can't be exported, unfortunately. This would help a lot, as putting both versions into the folder would make that much easier...
__________________
Ultraschall-API - a Lua-functions-library4Reaper: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs4Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 02-13-2019, 03:10 PM   #237
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 2,078
Default

how does "reaper.JS_Window_ListAllChild" now work? sorry have not been here for a while, I'm not up to date with stuff. I've use it to find Track list (TCP) but now it expects a number?

This is how I've used to get it:
Code:
function get_track_zoom_offset(tr,y_end,h,scroll)
    reaper.JS_Window_ListAllChild(main_wnd, "test", "list") -- here
    local found = reaper.GetExtState("test", "list")
    if not found then return end
    local fl,offset
    for adr in found:gmatch("%w+") do -- here
      local handl = reaper.JS_Window_HandleFromAddress(tonumber(adr)) --here
      if reaper.JS_Window_GetLongPtr(handl, "USER") == tr then --here
        if mixer_wnd ~= reaper.JS_Window_GetParent(reaper.JS_Window_GetParent(handl)) then fl = handl break end
      end
    end
    if not fl then return end
    local __, __, ztop, __, __ = reaper.JS_Window_GetRect(fl)
    if y_end > (ztop + h - 1) then offset = y_end - ztop - h end
    return offset
end

Last edited by Sexan; 02-13-2019 at 03:15 PM.
Sexan is offline   Reply With Quote
Old 02-14-2019, 02:49 AM   #238
Embass
Human being with feelings
 
Embass's Avatar
 
Join Date: Jan 2014
Posts: 333
Default

Lua: integer retval, string list = reaper.JS_Window_ListAllChild(identifier parentHWND)

Finds all child windows of the specified parent.

Returns:
* retval: The number of windows found; negative if an error occurred.
* list: A comma-separated string of hexadecimal values.
Embass is offline   Reply With Quote
Old 02-14-2019, 03:41 AM   #239
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 2,349
Default

Quote:
Originally Posted by Sexan View Post
how does "reaper.JS_Window_ListAllChild" now work? sorry have not been here for a while, I'm not up to date with stuff
Since REAPER v5.95, API functions can return long strings (as well as strings with \0 characters), so it is no longer necessary to use ExtStates as a workaround.

As Embass posted above, the "List" functions now return the list string directly, instead of via ExtStates.
juliansader is offline   Reply With Quote
Old 02-16-2019, 07:48 PM   #240
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 2,349
Default

v0.964 released:
I realized that WDL/swell does not properly implement the important function IsWindow for Linux (which may lead to nasty crashes), so I quickly wrote the function myself.
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 11:18 PM.


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