helgoboss / reaper-rs

Rust bindings for the REAPER C++ API
MIT License
80 stars 8 forks source link

`Main_SaveProjectEx` is not loaded. #71

Open Levitanus opened 1 year ago

Levitanus commented 1 year ago

I'm not sure, where the issue corresponds to: reaper-low, CPP API or somewhere else.

I definitely used this function from Python 2-3 years ago. And I think, it exists with REAPER at least from the version 5. But now ApiExists("Main_SaveProjectEx") returns false and reaper_low falls by reason the function is not loaded. I'm not sure whether I'm able to investigate this issue.

update: I've checked, that REAPER exports this function on my machine, and it runs from Python.

helgoboss commented 1 year ago

I've never used "ApiExists()" and I think it's more intended for dynamic languages than for C++/Rust. In C++ you would simply check if the function pointer is not null. In Rust, this translates to: reaper.low().pointers().Main_SaveProjectEx.is_some()

Bonus: Unlike ApiExists(), it's type-safe :D

Levitanus commented 1 year ago

But, the case is not in ApiExists, but in the MainSaveProjectEx, which does not work particularly in rust.