Closed GavinRay97 closed 3 years ago
Okay, so because I had no way of telling whether the code was ever even being run, I added code to write a dummy text file to /UserPlugins
just to be sure something was happening:
fn write_test_file() {
fs::write(
"C:\\Users\\rayga\\AppData\\Roaming\\REAPER\\UserPlugins\\testfile.txt",
"Rust extension .dll code was executed",
)
.expect("Unable to write file");
}
#[reaper_extension_plugin]
fn plugin_main(context: PluginContext) -> Result<(), Box<dyn Error>> {
let session = ReaperSession::load(context);
session
.reaper()
.show_console_msg("Hello world from reaper-rs medium-level API!");
write_test_file();
Ok(())
}
Starting up again, the file was not written. So clearly, this plugin is never even getting initialized 🙁
After investing more, I noticed that almost all of the native plugins, have names beginning with prefix reaper_
.
On the wild chance that this might fix it, I tried renaming extension to reaper_my_extension.dll
, and running again:
And then...
🤯
Okay, so the extension name has to begin with reaper_
in order for it to be loaded I suppose?
I will submit a PR with a note in the README about this if that is okay?
Hi! Yes, it needs to start with "reaper_". A README entry is a good idea!
Hi! Yes, it needs to start with "reaper_". A README entry is a good idea!
Awesome, sent! =D
So I believe I have everything configured + compiled right, tried to fit all the pertinent stuff in this screenshot:
After compiling, I copied the
.dll
into/REAPER/UserPlugins
, and launched REAPER, but didn't see any console message, or find it in the Actions list/Extension menu:I tried copying all of the files in the
target
build folder that had the same name as the.dll
(maybe the.dll
needs these as dependencies?) intoUserPlugins
too, but still no luck:Sorry if this is stupid -- I'm not sure I can figure out what I've done wrong