Skip to content

Namespace gme::osc

Namespace List > gme > osc

Public Functions

Type Name
lo_address makeAddress (const std::string & host, int port) noexcept
Create a liblo UDP address for host:port .
int sendFloat (lo_address target, const char * path, float value) noexcept
Send a single-float OSC message to a pre-built target address.

Public Functions Documentation

function makeAddress

Create a liblo UDP address for host:port .

lo_address gme::osc::makeAddress (
    const std::string & host,
    int port
) noexcept

Thin wrapper over lo_address_new(host.c_str(), std::to_string(port).c_str()) with a C++-friendly signature.

Parameters:

  • host Hostname or IP string, e.g. "127.0.0.1". Null-terminated.
  • port UDP port number (1–65535).

Returns:

Valid lo_address on success. nullptr if lo_address_new fails (bad host/port string or system resource exhaustion).

Exception:

  • Never (noexcept).

Note:

Ownership: caller is responsible for lo_address_free when done. In FadeRegistry, this is done inside cancelFade, cancelAll, and the destructor path for completed/errored fades.

** **

lo_address addr = gme::osc::makeAddress("127.0.0.1", 9234);
if (!addr) { return; }  // log and reject fade

function sendFloat

Send a single-float OSC message to a pre-built target address.

int gme::osc::sendFloat (
    lo_address target,
    const char * path,
    float value
) noexcept

Parameters:

  • target Non-null liblo address handle. Lifetime owned by the caller. Created via makeAddress or lo_address_new.
  • path Null-terminated OSC path beginning with /. Must not contain spaces (OSC path spec).
  • value Float value to send. Serialised as OSC type f (32-bit IEEE 754, passed to liblo as double).

Returns:

0 on success. Negative liblo errno code on failure (same semantics as lo_send).

Exception:

  • Never (noexcept).

Note:

Thread safety: safe from any single thread. Not re-entrant on the same lo_address (liblo is not thread-safe per address). Since each ActiveFade owns a distinct lo_address, concurrent calls on different fades are safe.

** **

lo_address addr = gme::osc::makeAddress("127.0.0.1", 9000);
int rc = gme::osc::sendFloat(addr, "/gain", 0.5f);
lo_address_free(addr);


The documentation for this class was generated from the following file src/osc/OscSender.h