<div dir="ltr"><div><div>Maybe this is useful: <a href="https://github.com/milasudril/lv2plug/blob/master/lv2spectohpp.php">https://github.com/milasudril/lv2plug/blob/master/lv2spectohpp.php</a><br><br></div>It takes a JSON file containing properties needed to describe an LV2 plug, and generates a C++ include file. There is also a companion script that generates the lv2 manifest from the same file. The class generated by the php script, is used to instanciate the portmap <a href="https://github.com/milasudril/lv2plug/blob/master/portmap.hpp">https://github.com/milasudril/lv2plug/blob/master/portmap.hpp</a>. The portmap is then used from<br><br><span class="gmail-pl-k">template</span><<span class="gmail-pl-k">class</span> <span class="gmail-pl-en">Client</span>>
      
      
                <span class="gmail-pl-k">void</span> <span class="gmail-pl-en">portConnect</span>(LV2_Handle handle,<span class="gmail-pl-c1">uint32_t</span> port,<span class="gmail-pl-k">void</span>* data)<br><br><a href="https://github.com/milasudril/lv2plug/blob/master/client.hpp">https://github.com/milasudril/lv2plug/blob/master/client.hpp</a>, which is the module that interfaces with the host.<br><br></div>The system works well for audio and control ports. Atom (MIDI) ports are also connected to the correct pointer type, but atoms themselfs are void pointers, so the type safety does not go further than const correctness. If possible, I would like to fix this, within the Zero Overhead Abstraction Principle, but I do not know how.<br><div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-12-03 16:07 GMT+01:00 David Robillard <span dir="ltr"><<a href="mailto:d@drobilla.net" target="_blank">d@drobilla.net</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Sat, 2016-12-03 at 12:41 +0700, Stefan Riha wrote:<br>
> I was wondering if this mailing list is open to questions about plugin<br>
> development in the Rust programming language?<br>
><br>
> See e.g.:<br>
><br>
> <a href="http://stackoverflow.com/questions/40944524/safe-rust-interface-for-c-plugin-interface" rel="noreferrer" target="_blank">http://stackoverflow.com/<wbr>questions/40944524/safe-rust-<wbr>interface-for-c-plugin-<wbr>interface</a><br>
<br>
All good, I'd love to see this taken further and find Rust very<br>
appealing in many ways, but haven't yet gotten any real experience<br>
working with it so can't be of much help on the idiomatic Rust side of<br>
things.<br>
<br>
I imagine that in order to make a type safe wrapper you'll have to deal<br>
with connect_port automagically in the wrapper since it inherently<br>
requires casting from untyped buffers...<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
dr<br>
<br>
<br>
______________________________<wbr>_________________<br>
Devel mailing list<br>
<a href="mailto:Devel@lists.lv2plug.in">Devel@lists.lv2plug.in</a><br>
<a href="http://lists.lv2plug.in/listinfo.cgi/devel-lv2plug.in" rel="noreferrer" target="_blank">http://lists.lv2plug.in/<wbr>listinfo.cgi/devel-lv2plug.in</a><br>
</font></span></blockquote></div><br></div>