Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: GetSWSVersion() #975

Closed
mespotine opened this issue Apr 17, 2018 · 6 comments
Closed

Feature Request: GetSWSVersion() #975

mespotine opened this issue Apr 17, 2018 · 6 comments

Comments

@mespotine
Copy link

mespotine commented Apr 17, 2018

I would love to have a simple function, that returns the currently installed SWS-version.
That way, I could include in my scripts a small check, if the right SWS-version is installed and if not, display an error-message.

Especially with scripts, that shall be used by other people as well, this would be a great benefit and much better than an error-message displayed that functionxyz() wasn't found...

The returned values should be compareable, so I could do something like

if needed_sws_version>reaper.GetSWSVersion() then
reaper.MB("Wrong SWS version", "", 0)
return
end

@cfillion
Copy link
Collaborator

cfillion commented Apr 18, 2018

You can do feature detection to directly test whether the function(s) you require exists.

if not reaper.RequiredSWSFunction then
  reaper.MB("This script requires SWS v1.2.3.4.", 'Title', 0)
  return
end

@mespotine
Copy link
Author

mespotine commented Apr 18, 2018

This wouldn't be sufficient, as the functions evolve for new functionality.
Like Pull Request #960 "BR_MouseContext" which does not support automation items in the current released version of SWS, but will in the future.
Just checking for the existence of the function doesn't tell me, whether it already supports automation items. With the version-number, I could determine it 100%-percently.

@cfillion
Copy link
Collaborator

CF_GetSWSVersion

@mespotine
Copy link
Author

Perfect, thank you @cfillion :)

@mespotine
Copy link
Author

mespotine commented Aug 26, 2018

As SWS is slowly progressing, some beta-builds are out there with a different subset of functions/actions for bugtesting. But one of the problems is, that it is really difficult to differentiate between these different builds(usually reflecting either the current Master or a PR-build).

The following thread describes the problem quite good: https://forum.cockos.com/showthread.php?t=210391

Therefore I propose the following addition to GetSWSVersion:
string SWS_version, string betabuild_version = reaper.GetSWSVersion()

This string must be set by developers, who put out beta-releases according to something like:
"Developername: PR or Issue-name with issuenumber - releasenumber and date"

That way, it would be easier to detect, whether I use an unofficial beta-build for bugtesting.
In addition to that: If there would be one build by noFish and one by Julian Sader, I could easily see, whether I had the right one installed AND if it's the latest build to give comments on bugs and issues regarding functions.

This could be very helpful when helping you finding bugs early on.

What do you think?

@cfillion
Copy link
Collaborator

cfillion commented Aug 27, 2018

There's also the possibility of (automatically) using the latest git branch/commit sha1 or a unique, ever incrementing build number. This would work well with continuous integration (as @swstim proposed...). But in my opinion not so much with manual dev builds: maintaining a betabuild_version is an extra burden and can very easily be forgotten.

@swstim swstim closed this as completed in beebe35 Feb 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants