helgoboss / reaper-rs

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

README: Usage step-by-step guide for extension plugins doesn't work on MacOS #79

Closed eureka-cpu closed 1 month ago

eureka-cpu commented 2 months ago

Hello @helgoboss I'm trying to get up and running with the minimal example under Usage for creating an extension plugin. The guide says I can create a symbolic link to <path-to-REAPER>/UserPlugins> but doing so on MacOS doesn't seem to do anything. It's entirely possible I'm lacking some primitive knowledge of where to look, but starting up REAPER after creating the symbolic link as the guide says doesn't seem to do anything.

Some questions I have:

  1. The guide mentions it will be printed to the console, where is the console? Is the console my terminal, REAPER itself, etc?
  2. Is the symbolic link path in the guide literal? Upon installing REAPER and checking its contents, there is a folder there called Plugins at REAPER.app/contents/Plugins, which has the pre-packaged plugins, but there isn't a UserPlugins folder at REAPER.app/ so I created the folder prior to creating the symbolic link.

Edit: I've also confirmed that adding a symbolic link to the Plugins folder mentioned above does not work either.

eureka-cpu commented 2 months ago

Here is my hello world plugin:

use c_str_macro::c_str;
use reaper_low::{Reaper, ReaperPluginContext};
use reaper_macros::reaper_extension_plugin;

#[reaper_extension_plugin]
pub fn plugin_main(context: &ReaperPluginContext) -> Result<(), Box<dyn std::error::Error>> {
    let reaper = Reaper::load(context);
    unsafe {
        Reaper::ShowConsoleMsg(&reaper, c_str!("Hello, World!").as_ptr());
    }
    Ok(())
}

I'm on REAPER v7.15, and my plugin reaper_lib_hello_world.dylib is symbolically linked to /Applications/REAPER.app/UserPlugins/reaper_lib_hello_world.dylib.

eureka-cpu commented 2 months ago

REAPER documentation for extension plugins doesn't seem to specify where to place the extension either: https://www.reaper.fm/sdk/plugin/plugin.php

eureka-cpu commented 2 months ago

@Levitanus I've also checked out your fork, rea-rs, great stuff there, but it didn't have a guide on how to get started hence I'm here trying to use reaper-rs. I see you've made several commits here, would you happen to know what I'm doing wrong?

I'm happy to make a pull request that updates the README, and contribute to rea-rs as well if I can get up and running.

smoothdeveloper commented 2 months ago

@eureka-cpu I remember trying out stuff, it is in ~/Library/Application\ Support/REAPER/UserPlugins that your project .dylib should be placed, and it should be named reaper_yourextensionname.dylib.

Also, you may need to check "Privacy & Security" in System Settings after loading Reaper once with the extension, to make sure it is enabled.

eureka-cpu commented 2 months ago

@eureka-cpu I remember trying out stuff, it is in ~/Library/Application\ Support/REAPER/UserPlugins that your project .dylib should be placed, and it should be named reaper_yourextensionname.dylib.

Also, you may need to check "Privacy & Security" in System Settings after loading Reaper once with the extension, to make sure it is enabled.

@smoothdeveloper you're an absolute chad. Thanks for the reply, will test this out asap.

eureka-cpu commented 2 months ago

Also, how would you go about finding this path for other systems? Ideally I'd like to have builds for Linux and Windows as well

smoothdeveloper commented 2 months ago

@eureka-cpu not 100% sure but you can check if you have access to such systems:

Linux: ~/.config/REAPER/UserPlugins/ Windows: %appdata%\REAPER\UserPlugins

eureka-cpu commented 2 months ago

So I've got this set:

eureka@yabai ~/Library ls Application\ Support/REAPER/UserPlugins/        
reaper_lib_hello_world.dylib

And REAPER has full disk access in Security & Privacy, but the plugin still doesn't appear to do anything.

eureka-cpu commented 1 month ago

So I've got this set:

eureka@yabai ~/Library ls Application\ Support/REAPER/UserPlugins/        
reaper_lib_hello_world.dylib

And REAPER has full disk access in Security & Privacy, but the plugin still doesn't appear to do anything.

I found the issue: I didn't read the docs for ln -s and symlinked to the wrong place (effectively symlinking to nowhere) hence it wasn't able to find the plugin. Once given the correct path to the plugin, it worked! 🎉

Thanks for your help @smoothdeveloper and @Levitanus