Replies: 1 comment 2 replies
-
@inhahe tl;dr ideally you need to bind everything. You need to bind every class that is not stl in the library, so all of them are properly recognised on some function's return. Refer to this doc for details: https://pybind11.readthedocs.io/en/stable/advanced/cast/index.html So there are two tricks that you can actually use in case of
If you do not want to bother as much with everything, here some info on automatic binding (it really depends on your needs but from my experience, it is always better to have a fine tuned bindings written yourself): https://pybind11.readthedocs.io/en/stable/compiling.html#generating-binding-code-automatically |
Beta Was this translation helpful? Give feedback.
-
For example, in the JUCE audio library, AudioPluginInstance has a member getBus() which returns an AudioProcessor::Bus object, which has a member getCurrentLayout(), which returns an AudioChannelSet object, which has a member getChannelTypes(), which returns an array of enums...
So, how would I export that in my dll so that I could do something in Python like, for example..
p.getBus().getCurrentLayout().getChannelTypes()[0]
?And of course, on each level of nesting there are also other functions I'd want to access, not just one.
And also, some functions return juce::String objects which pybind11 can't cast automatically, it has to know to call .toStdString on them.
Thanks..
Beta Was this translation helpful? Give feedback.
All reactions