Open mespotine opened 6 years ago
I think it would be better if REAPER extended it's own ValidatePtr
to check extension-defined types. This would at the same time allow for runtime validation of custom argument types with much better error messages for scripters.
reaper.BR_FreeEnv(reaper.GetMasterTrack(), false)
^ This currently runs without any error.
Almost all datatypes in Reaper are checkable, so when I write a script or a function, I can check, whether an object is a valid ReaProject, MediaItem, MediaTrack, etc.
But I have no chance to check, if an object, given to a parameter, is a valid FastString or a valid BR_Envelope. So, when I give a function, that expects a BR-Envelope something else, I can't check and take appropriate action. Instead, it will produce an error, stopping execution of a script.
So I would love to have functions, with which I can check, whether an object is a valid FastString or a valid BR_Envelope and return a boolean, true(valid) or false(not valid).