chrislo / brain

Use a Raspberry Pi to control my "studio"

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Refactor output classes to reuse a UDP socket

chrislo opened this issue · comments

I currently call UdpSocket::bind() in
output::send_osc_to_sampler() and output::send_osc_to_o2m. I think
binding the socket can take some time, and I noticed timing problems
when doing it on every iteration of the main loop (fixed in
62f1ead). It would be good to avoid doing that in the event loop too -
possibly by injecting a reference to the socket into output:: or by
creating a type.

This is now mostly done, there's a remaining place where we unnecessarily create an o2m output socket in the atom::init() code, but since this is only called once anyway, I'm going to leave it for now. The unnecessary multiple calls to UdpSocket::bind in the main event loop are now gone.