 |
|
|
01-19-2019, 11:12 AM
|
#201
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 11,789
|
Quote:
Originally Posted by tparker24
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.
|
|
|
01-19-2019, 11:20 AM
|
#202
|
Human being with feelings
Join Date: Dec 2017
Posts: 83
|
Quote:
Originally Posted by nofish
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).
|
|
|
01-19-2019, 11:41 AM
|
#203
|
Human being with feelings
Join Date: May 2015
Location: Québec, Canada
Posts: 4,365
|
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
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.
|
|
|
01-19-2019, 12:05 PM
|
#204
|
Human being with feelings
Join Date: Dec 2017
Posts: 83
|
Quote:
Originally Posted by cfillion
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?
|
|
|
01-19-2019, 12:11 PM
|
#205
|
Human being with feelings
Join Date: May 2015
Location: Québec, Canada
Posts: 4,365
|
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
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.
|
|
|
01-19-2019, 12:35 PM
|
#206
|
Human being with feelings
Join Date: Dec 2017
Posts: 83
|
Quote:
Originally Posted by cfillion
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.
|
|
|
01-20-2019, 03:26 AM
|
#207
|
Human being with feelings
Join Date: Jul 2009
Posts: 3,714
|
Quote:
Originally Posted by mespotine
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.
|
|
|
01-20-2019, 11:54 AM
|
#208
|
Human being with feelings
Join Date: Jul 2009
Posts: 3,714
|
Quote:
Originally Posted by Edgemeal
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.)
|
|
|
01-20-2019, 01:00 PM
|
#209
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,113
|
Quote:
Originally Posted by juliansader
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
|
|
|
01-20-2019, 03:45 PM
|
#210
|
Human being with feelings
Join Date: Sep 2016
Location: Toronto
Posts: 678
|
Could something in this extension be used to script something to resize a docked media explorer and/or sort it by date?
|
|
|
01-20-2019, 04:11 PM
|
#211
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,113
|
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
|
|
|
01-20-2019, 04:31 PM
|
#212
|
Human being with feelings
Join Date: Dec 2017
Posts: 83
|
python "definition file"
Quote:
Originally Posted by mespotine
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
|
|
|
01-20-2019, 04:40 PM
|
#213
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,113
|
Quote:
Originally Posted by tparker24
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...
|
|
|
01-20-2019, 06:49 PM
|
#214
|
Human being with feelings
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,469
|
Quote:
Originally Posted by mespotine
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
|
|
|
01-20-2019, 07:54 PM
|
#215
|
Human being with feelings
Join Date: Sep 2016
Location: Toronto
Posts: 678
|
Quote:
Originally Posted by Edgemeal
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.
|
|
|
01-20-2019, 08:25 PM
|
#216
|
Human being with feelings
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,469
|
Quote:
Originally Posted by Arthur McArthur
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)
|
|
|
01-20-2019, 08:43 PM
|
#217
|
Human being with feelings
Join Date: Sep 2016
Location: Toronto
Posts: 678
|
Gave that a shot and am now getting:
test.lua:1: 'reaper.JS_WindowMessage_Send' argument 1: expected void*
|
|
|
01-20-2019, 08:57 PM
|
#218
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,113
|
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?
|
|
|
01-20-2019, 09:01 PM
|
#219
|
Human being with feelings
Join Date: Sep 2016
Location: Toronto
Posts: 678
|
I'm on Windows and the media explorer has remained open. It's weird, it works sometimes and then stops working without explanation.
|
|
|
01-21-2019, 08:41 AM
|
#220
|
Human being with feelings
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,469
|
Quote:
Originally Posted by Arthur McArthur
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
|
|
|
01-26-2019, 02:25 AM
|
#221
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,229
|
@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 !
|
|
|
01-26-2019, 05:29 AM
|
#222
|
Human being with feelings
Join Date: Jul 2009
Posts: 3,714
|
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"
|
|
|
01-26-2019, 07:30 AM
|
#223
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,229
|
@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.
|
|
|
01-28-2019, 10:19 AM
|
#224
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,113
|
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
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
|
|
|
01-31-2019, 06:32 AM
|
#225
|
Human being with feelings
Join Date: Aug 2011
Posts: 478
|
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?
|
|
|
01-31-2019, 06:58 AM
|
#226
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,113
|
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
|
|
|
02-01-2019, 12:21 PM
|
#227
|
Human being with feelings
Join Date: Jul 2009
Posts: 3,714
|
Quote:
Originally Posted by mespotine
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.
|
|
|
02-01-2019, 01:39 PM
|
#228
|
Human being with feelings
Join Date: Aug 2011
Posts: 478
|
Quote:
Originally Posted by mespotine
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
|
|
|
02-01-2019, 02:36 PM
|
#229
|
Human being with feelings
Join Date: Jul 2009
Posts: 3,714
|
Quote:
Originally Posted by reapero
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.
|
|
|
02-07-2019, 07:27 AM
|
#230
|
Human being with feelings
Join Date: Aug 2011
Posts: 478
|
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
|
|
|
02-08-2019, 06:45 AM
|
#231
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 11,789
|
Quote:
Originally Posted by reapero
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).
|
|
|
02-09-2019, 10:53 AM
|
#232
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,113
|
No, UserPlugins can't be exported, unfortunately. This would help a lot, as putting both versions into the folder would make that much easier...
|
|
|
02-13-2019, 03:10 PM
|
#233
|
Human being with feelings
Join Date: Jun 2009
Location: Croatia
Posts: 3,547
|
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.
|
|
|
02-14-2019, 02:49 AM
|
#234
|
Human being with feelings
Join Date: Jan 2014
Posts: 867
|
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.
|
|
|
02-14-2019, 03:41 AM
|
#235
|
Human being with feelings
Join Date: Jul 2009
Posts: 3,714
|
Quote:
Originally Posted by Sexan
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.
|
|
|
02-16-2019, 07:48 PM
|
#236
|
Human being with feelings
Join Date: Jul 2009
Posts: 3,714
|
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.
|
|
|
02-17-2019, 03:29 PM
|
#237
|
Human being with feelings
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,469
|
@ juliansader
Any plans to add support for ComboBox list like you did for ListView?
|
|
|
02-18-2019, 03:20 AM
|
#238
|
Human being with feelings
Join Date: Aug 2011
Posts: 478
|
Quik question: would it be possible to get render path - getting it from the first textbox in the Output section of the Render dialgo - using this API?
Or maybe its possible even without using the js_extension? I searched for this on the regular API but couldnt find anything.
|
|
|
02-18-2019, 06:24 AM
|
#239
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,113
|
I'm working on that for the Ultraschall-Api. Just some minor bugs to be fixed, I can give you even the rendered-filenames you can expect for a project.
|
|
|
02-18-2019, 06:40 AM
|
#240
|
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 4,880
|
That's pretty awesome, thanks mespo!
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 04:22 AM.
|