Getting back into plugin programing, and I feel like I must be missing something obvious, but maybe someone else can help me see what it is…
Code:
void SeqBaseWidget::appendExpanderContextMenu(Menu* menu){
Plugin* p = plugin::getPlugin("JPLab");
//...
}
Error:
src/JPSeqBase.cpp: In member function 'virtual void JP::SeqBaseWidget::appendExpanderContextMenu(rack::ui::Menu*)':
src/JPSeqBase.cpp:4403:29: error: 'getPlugin' is not a member of 'rack::plugin'; did you mean 'Plugin'?
4403 | Plugin* p = plugin::getPlugin("JPLab");
| ^~~~~~~~~
| Plugin
You could add #pragma message “in in my plugin.hpp”, assuming pragma message works in gcc - I think it does.
I guess if you did the include on a full path you can control it? like "#include “…/…/some-path/the-file-I-want.hpp”? I’ve never run into this in rack - I guess it’s unusual for a plugin to call some rack functions at global scope… don’t know.
I don’t know. @cschol would know. Or you can try it with the toolchain build. I’m guess there is some macro that expands to the sdk path? Or if not you could always pass RACK_DIR into your cpp file? Kind of like the way it’s already used in the make file"
You only include rack.hpp in your plugin, not plugin.hpp.
plugin.hpp is also not exposed in rack.hpp and therefore not part of the public API.
See the note at the top of rack.hpp and proceed knowing that this is unsupported/unstable.
Yeah that makes sense. Thanks. This won’t be the first time I’ve skirted the API.
It does seem weird to me that VCV Rack API: VCV Rack API includes functions that aren’t part of the API. But in general I don’t actually find that website that helpful.