Old 01-11-2019, 08:40 AM   #721
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 2,469
Default

Quote:
Originally Posted by amagalma View Post
Hmm, so what is a PackageEntry? I thought it meant an entry in the ReaPack Package Browser. Not all packages have dll's.. For example, if I want to check and get the info about your Song Switcher script, is this possible? Or I can get info only about dll's?
It represents an installed package. I meant dll in the context of js_ReaScriptAPI. The GetOwner API function takes a filename (either relative to the resource path or absolute) and returns a PackageEntry for the package which installed it. For example, any of these gives a PackageEntry for Song switcher if installed:

Code:
reaper.ReaPack_GetOwner('Scripts/ReaTeam Scripts/Various/cfillion_Song switcher.lua')
reaper.ReaPack_GetOwner('Scripts/ReaTeam Scripts/Various/cfillion_Song switcher/cfillion_Song switcher (next).lua')
reaper.ReaPack_GetOwner('reaper_www_root/song_switcher.html')
That API was meant mostly for this kind of usage:
Code:
function onHelpButtonClick()
  local owner = reaper.ReaPack_GetOwner(({reaper.get_action_context()})[2])
  if owner then
    reaper.ReaPack_AboutInstalledPackage(owner)
    reaper.ReaPack_FreeEntry(owner)
  end
end
To get and check js_ReaScriptAPI's installed (not loaded!) version:
Code:
function getJSAPIVersion()
  -- less usable because of the platform-dependent filename
  local owner = reaper.ReaPack_GetOwner('UserPlugins/reaper_js_ReaScriptAPI64.dylib')
  if owner then
    local version = ({reaper.ReaPack_GetEntryInfo(owner)})[7]
    reaper.ReaPack_FreeEntry(owner)
    return version
  end
end

if reaper.ReaPack_CompareVersion(getJSAPIVersion(), "1.0.4") < 0 then
  reaper.ShowConsoleMsg("js_ReaScriptAPI is too old!\n")
end
Quote:
Originally Posted by amagalma View Post
No, I haven't seen it! This is great! Thanks! Question: submitting via Upload tools creates a pull request, meaning that I still have to log in to Github and merge the branch to master?
Exactly, so that we (ReaTeam members) can check public submissions and have them tested by the bot first. Since you're a ReaTeam member, you can self-merge your PR once the indexing bot has finished its work.

Quote:
Originally Posted by amagalma View Post
Something simple like this is enough or should I do more checks?
Like that, plus ProcessQueue(true) to immediately finish importing the repository and/or refresh opened windows (see the gist linked in my post above).

Last edited by cfillion; 01-11-2019 at 09:02 AM.
cfillion is offline   Reply With Quote
Old 01-13-2019, 08:20 AM   #722
amagalma
Human being with feelings
 
Join Date: Apr 2011
Posts: 1,463
Default

Thank you so much for all the help!
amagalma is offline   Reply With Quote
Old 01-13-2019, 05:05 PM   #723
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 735
Default

I would love to add my Ultraschall-API to ReaPack and I have some questions about adding my own github-repo to the ReaPack-Package-Manager and I hope, you can help.

First some general questions about it:
1. I intend to add at some point an extension-plugin, like the JS-plugin or SWS. As far as I understood, the JS-plugin can be installed via ReaPack. How does it do it? Can ReaPack unregister the plugin and runtime, install the new version and reregister it?
I tried to remove an old version of a plugin to install a new one while Reaper is running with a restart of Reaper after installation, but Reaper "blocks" the plugin by accessing it while it runs(which is logical, as Reaper is using it).
I wonder now, how ReaPack does this for the JS-Plugin?

2. I would need to install my API into the UserPlugins-folder, not the scripts-folder. Does the ReaPack-manager allow me to do that?


Now some questions about the process of adding my repo:
1. Is there a full explanation, how to do that? Some kind of manual? I just found one X-Raym wrote, but it is some time since he wrote it, so I guess, some information is outdated.

2. I read somewhere, that there's a tool, that creates the .xml-file needed by ReaPack, but where can I find it? I found on the ReaPack-site(https://reapack.com/upload) only a way to add files to the official ReaPack-repo.
Even though this would be possible to do, it would be too impractical, as I add bugfixes quite often and don't want to upload it every few days to the ReaPack-repo, but rather add my own repo instead.
Where can I find that tool and a manual to use it? And does it support a complex folder-structure with dozens of files as well?


Hope, you can help me with that.
Cheers and great work on the Package-Manager. It's one of the tools I thought "this is fantastic" the first time I ran it
__________________
Ultraschall-API: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs for Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is online now   Reply With Quote
Old 01-13-2019, 10:39 PM   #724
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 2,469
Default

Quote:
Originally Posted by mespotine View Post
How does it do it? Can ReaPack unregister the plugin and runtime, install the new version and reregister it?
I tried to remove an old version of a plugin to install a new one while Reaper is running with a restart of Reaper after installation, but Reaper "blocks" the plugin by accessing it while it runs(which is logical, as Reaper is using it).
I wonder now, how ReaPack does this for the JS-Plugin?
REAPER must be restarted for the new version to be loaded, but I think you're referring to Windows' limitations disallowing writing to running executables. ReaPack works around that by moving the running .dll to a temporary location on that OS. (Overwriting or deleting running executables is allowed on Unix-like systems.)

Quote:
Originally Posted by mespotine View Post
2. I would need to install my API into the UserPlugins-folder, not the scripts-folder. Does the ReaPack-manager allow me to do that?
Mark either entire packages or individual files to go in UserPlugins as being of the "extension" type. I find it odd to have Lua scripts outside of the Scripts directory, however ReaPack-installed script files must be in a subdirectory named after the repository (eg. "Scripts/Ultraschall/api.lua"). Extension files do not have this requirement.

Quote:
Originally Posted by mespotine View Post
Now some questions about the process of adding my repo:
1. Is there a full explanation, how to do that? Some kind of manual? I just found one X-Raym wrote, but it is some time since he wrote it, so I guess, some information is outdated.

I read somewhere, that there's a tool, that creates the .xml-file needed by ReaPack, but where can I find it? Where can I find that tool and a manual to use it?
The tool is reapack-index. Its user guide is at https://github.com/cfillion/reapack-index/wiki. The XML index format itself is documented at https://github.com/cfillion/reapack/wiki/Index-Format.

https://reapack.com/upload, as a GUI editor, can help generate the metadata headers for reapack-index (just don't click on "Create pull request" if you want to use your own repository instead ).

Quote:
Originally Posted by mespotine View Post
And does it support a complex folder-structure with dozens of files as well?
I see your API .zip contains a few empty directories (eg. in 3rd_party_for_everyone). ReaPack, reapack-index, and git all only deals with actual files. Using an empty hidden file named ".gitkeep" or ".keep" is common.

Last edited by cfillion; 01-13-2019 at 10:47 PM.
cfillion is offline   Reply With Quote
Old 01-16-2019, 08:15 AM   #725
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 735
Default

@cfillion

Thanks for your answers

Quote:
Mark either entire packages or individual files to go in UserPlugins as being of the "extension" type. I find it odd to have Lua scripts outside of the Scripts directory, however ReaPack-installed script files must be in a subdirectory named after the repository (eg. "Scripts/Ultraschall/api.lua"). Extension files do not have this requirement.
So if I understood right, I can have ultraschall_api.lua in the UserPlugins-folder if I upload it as extension, while as script-upload, it must be in a subfolder, right?

Quote:
I see your API .zip contains a few empty directories (eg. in 3rd_party_for_everyone). ReaPack, reapack-index, and git all only deals with actual files. Using an empty hidden file named ".gitkeep" or ".keep" is common.
Thanks, added to my repo


Another question, how do you add JSFX-plugins into a running Reaper? Does Reaper need to be restarted for them to be added?

And a final question: what kinds of things can't be added using ReaPack-packagemanager? If I wanted to install the contents of a ReaperConfigZip-file from a repo using ReaPack rather than having to use ReaperConfigZip-file, what could I install and what would be missing?
e.g. could I add ini-files as well, that are stored in the RessourcesFolder?

I'm asking, as we think about using ReaPack for our Ultraschall-development.
We switched to managing the development-branch in git, however our betatesters are usually not that experienced with git to install the repo into a portable Reaper-version.
We would love to give betatesters an easy way of updating their beta-versions of Ultraschall using ReaPack.

Currently, we still would rely on building a ReaperConfigZip-file but this isn't flexible enough to represent the latest changes in the repo and slows down the pace of beta-testing...
__________________
Ultraschall-API: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs for Reaper: https://forum.cockos.com/showthread.php?t=207635

Last edited by mespotine; 01-16-2019 at 08:23 AM.
mespotine is online now   Reply With Quote
Old 01-16-2019, 08:57 AM   #726
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 2,469
Default

Quote:
Originally Posted by mespotine View Post
So if I understood right, I can have ultraschall_api.lua in the UserPlugins-folder if I upload it as extension, while as script-upload, it must be in a subfolder, right?
That's right. The type determines the root installation directory. You can choose the type of a package and optionally override it per-file (so, if you want it to be displayed as such, you could make a "Script" package install some "extension" files in UserPlugins).

Quote:
Originally Posted by mespotine View Post
Another question, how do you add JSFX-plugins into a running Reaper? Does Reaper need to be restarted for them to be added?
Only extension plugins require a restart. REAPER detects newly added JSFX automatically.

Quote:
Originally Posted by mespotine View Post
And a final question: what kinds of things can't be added using ReaPack-packagemanager? If I wanted to install the contents of a ReaperConfigZip-file from a repo using ReaPack rather than having to use ReaperConfigZip-file, what could I install and what would be missing?
e.g. could I add ini-files as well, that are stored in the RessourcesFolder?
ReaPack packages can currently write files into the AutomationItems, ColorThemes, Data, Effects, LangPack, MIDINoteNames, ProjectTemplates, reaper_www_root, Scripts, TrackTemplates and UserPlugins directories. Writing directly to the resource directory is not allowed (unsafe, especially considering many users choose to install everything).

I'm not sure how well externally overwriting an .ini while REAPER is running would work as some settings are kept in memory...

Last edited by cfillion; 01-16-2019 at 09:10 AM.
cfillion is offline   Reply With Quote
Old 01-16-2019, 09:21 AM   #727
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 735
Default

Ah, sounds good.

Would it be an option to add an API-function to ReaPack, that allows me programmatically install a ReaPack-package?
Like reaper.ReaPack_InstallPackage(string xml_file) ?

That way, I could install our git and do the rest with ini-files manually within one script, but I would need to know first, whether it was installed.
With such a function, I would be able to know that within my script.
__________________
Ultraschall-API: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs for Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is online now   Reply With Quote
Old 01-16-2019, 09:29 AM   #728
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 2,469
Default

There is no API to manage individual packages, however you can configure your repository to install every packages it contains and synchronize. GetOwner can detect whether a package is installed.

You can also open the package browser with a filter of your choice pre-filled (BrowsePackage(searchPattern)).

(Alternatively, maybe the .ini-copying script could be included along with the rest, only waiting to be manually run after installation?)

Last edited by cfillion; 01-16-2019 at 09:38 AM.
cfillion is offline   Reply With Quote
Old 01-20-2019, 08:04 PM   #729
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 735
Default

Is it mandatory to have a versions-tag in all my files? For instance, I have several .txt-files, whose functionality will break when I add a version-tag into it, as they are no MIDI-name-files.

As far as I understand, the version-tag is only necessary for the generating of the xml-file but once it is generated, it's not necessary anymore.
Meaning, I could add this version-information manually somehow into the xml-file instead leaving it out of the TXT-files, right?

And as far as I understood, I can put my files somewhere else too, like on localhost to experiment with it, right?

Edit:
The last answer I can give myself: Yes, I can put them somewhere else, even on a localhost, installation to test around before putting something into the net
__________________
Ultraschall-API: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs for Reaper: https://forum.cockos.com/showthread.php?t=207635

Last edited by mespotine; 01-20-2019 at 08:54 PM.
mespotine is online now   Reply With Quote
Old 01-21-2019, 01:17 AM   #730
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 2,469
Default

@version is only required for the package files (files describing a package to reapack-index using metadata). If these .txt files are not packages themselves, but are instead part of some other package, they don't need anything (reapack-index will give a warning unless they have @noindex, but will ultimately ignore them nevertheless).

Yes, you can manually edit the .xml file. As for localhost: yes, and file:// URIs are also supported (on the ReaPack side).
cfillion is offline   Reply With Quote
Old 01-22-2019, 10:14 AM   #731
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 735
Default

Thanks for all your answers(and I hope you don't mind more questions from me )

What element in the xml-file triggers the updating-process in the ReaPack-Manager? I suppose, a changed/added version-element tells the plugin "there's an update to consider"?
__________________
Ultraschall-API: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs for Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is online now   Reply With Quote
Old 01-22-2019, 10:34 AM   #732
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 2,469
Default

"Synchronize packages" updates when a version whose number is higher than the installed one is found in the XML index. Fox example:

Code:
> reaper.ReaPack_CompareVersions('1.0', '1.0.1')
{-1, ""} -- 1.0.1 is higher: update

> reaper.ReaPack_CompareVersions('2.0', '1.0.1')
{1,  ""} -- lower: do nothing

> reaper.ReaPack_CompareVersions('1.2.3', '1.2.3.0')
{0,  ""} -- same: do nothing

> reaper.ReaPack_CompareVersions('1.0beta', '1.0')
{-1, ""} -- 1.0 is higher: update

> reaper.ReaPack_CompareVersions('1.0', '2.0beta')
{-1, ""} -- 2.0beta is higher: see below
There are additional rules for handling pre-releases (versions containing alphabetical segments). Pre-releases are not automatically updated to unless the current version is also a pre-release and there are no stable releases in between.

Last edited by cfillion; 01-22-2019 at 10:44 AM.
cfillion is offline   Reply With Quote
Old 01-28-2019, 10:41 AM   #733
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 735
Default

So when in doubt, I should do a quick check for a versionstring using ReaPack_CompareVersions to be safe. Good to know


Another thing, is there a way to run the synchronize-procedure(including a possible auto-install) programmatically or is it only useable by the user, clicking the synchronize-button/menuentry?

And a little Feature-Request:
Would it be possible to add a way to automatically run a script after installing an extension?
For example, Lokasenna's Gui-Lib needs a script to be run before I can use his Gui-Lib, to store some of the paths needed by his Gui-Lib. I think, it would be better, if this could be done automatically by automatically running such a script, to make it more user-friendly.
I think a simple, register this startup-script, run it once and unregister it again would be the easiest way to do it.

For myself, I need it to automatically register some of my scripts into the reaper-kb.ini. I want to add it using proper ActionCommandIDs and description-texts, which can't be done in any other way than putting it into the ini-file and after that restarting Reaper. This would be in-line with the need of restarting Reaper after installing an extension.
This could also solve my problem I described in some posts above, where I wanted to replace the ini-files in the ressources-folder, which could be done by me then automatically, before restarting Reaper.

The other option, using __startup.lua in the Scripts-folder isn't an option, as I can't know, if a user has such a script already which would be overwritten by me that way...
__________________
Ultraschall-API: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs for Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is online now   Reply With Quote
Old 02-09-2019, 02:01 PM   #734
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 2,266
Default

I would like to include mouse cursor files with some of my scripts, but I am not sure about the Provide syntax that I should use.

I have tried the following (intended to install the cur file from ReaTeam/ReaScripts/MIDI editor/ into the same directory as the script), but it doesn't seem to work:
Code:
Provides: 
  [main=midi_editor,midi_inlineeditor] .
  "js_Mouse editing - Slice notes.cur"
juliansader is offline   Reply With Quote
Old 02-09-2019, 07:52 PM   #735
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 2,469
Default

Quote:
Originally Posted by mespotine View Post
Another thing, is there a way to run the synchronize-procedure(including a possible auto-install) programmatically or is it only useable by the user, clicking the synchronize-button/menuentry?
Code:
reaper.Main_OnCommand(reaper.NamedCommandLookup('_REAPACK_SYNC'), 0)
Quote:
Originally Posted by juliansader View Post
I would like to include mouse cursor files with some of my scripts, but I am not sure about the Provide syntax that I should use.

I have tried the following (intended to install the cur file from ReaTeam/ReaScripts/MIDI editor/ into the same directory as the script), but it doesn't seem to work:
Code:
Provides: 
  [main=midi_editor,midi_inlineeditor] .
  "js_Mouse editing - Slice notes.cur"
Remove the quotes. You can use https://reapack.com/upload to upload the files and have the provides tag generated automatically for you.

Also it would be better to avoid putting js_ and .lua in the package display name (at some point in the future I'll do a repository-wide metadata cleanup).

Last edited by cfillion; 02-09-2019 at 08:29 PM.
cfillion is offline   Reply With Quote
Old 02-14-2019, 10:58 PM   #736
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 2,469
Default

ReaPack v1.2.2rc3

Should be released as stable in a few days.

Added:
  • implement SHA-256 checksum verification for downloaded files
  • browser: add "Synchronize packages" to the menu [p=2084579]
  • browser: add "Upload packages" action to the menu opening https://reapack.com/upload
  • receipt: annotate installation type and previous version
Fixed:
  • import: fix possible crash after downloading indexes
cfillion is offline   Reply With Quote
Old Today, 06:39 AM   #737
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 735
Default

Is there a way to tell the user, which requirements are there for a ReaPack in the index.xml-file?
Like "I need SWS version x.x.x to be installed" or "JS-Plugin version x.y.z" or something?

I haven't found something like that and would love to signal that during installation. Maybe including the possibility to open the websites(SWS)/add ReaPacks(JS-Extension) that holds the feature would be cool.
But at least a dialog that says needs feature x.y.z. to be installed to work properly..
__________________
Ultraschall-API: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs for Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine 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 08:20 AM.


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