Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::osc::OscChannel Class Reference

#include <osc_channel.hpp>

Public Member Functions

 ~OscChannel () override
bool send (const std::uint8_t *data, std::size_t size) override
 Send a message.
void on_message (pulp::runtime::MessageCallback callback) override
 Install / replace callbacks.
void on_closed (pulp::runtime::ChannelClosedCallback callback) override
void on_error (pulp::runtime::ChannelErrorCallback callback) override
void close () override
 Close the channel. Idempotent. Fires the closed callback.
bool is_open () const override
 Whether the channel is currently usable.
bool send (const Message &msg)
 Convenience — encode and send a structured OSC message.
std::string local_address () const
 Address and port the receiving side is bound to; empty / 0 when closed.
std::uint16_t local_port () const
bool send (std::string_view text)
virtual bool send_text (std::string_view text)

Static Public Member Functions

static std::unique_ptr< OscChannel > open (std::string_view host, std::uint16_t remote_port, std::uint16_t local_port, OscChannelOptions options={})
 Construct a bidirectional channel: sender targets (host, remote_port) and the receiver listens on local_port.

Constructor & Destructor Documentation

◆ ~OscChannel()

pulp::osc::OscChannel::~OscChannel ( )
override

Member Function Documentation

◆ close()

void pulp::osc::OscChannel::close ( )
overridevirtual

Close the channel. Idempotent. Fires the closed callback.

Implements pulp::runtime::MessageChannel.

◆ is_open()

bool pulp::osc::OscChannel::is_open ( ) const
inlineoverridevirtual

Whether the channel is currently usable.

Implements pulp::runtime::MessageChannel.

◆ local_address()

std::string pulp::osc::OscChannel::local_address ( ) const
inline

Address and port the receiving side is bound to; empty / 0 when closed.

◆ local_port()

std::uint16_t pulp::osc::OscChannel::local_port ( ) const
inline

◆ on_closed()

void pulp::osc::OscChannel::on_closed ( pulp::runtime::ChannelClosedCallback callback)
overridevirtual

◆ on_error()

void pulp::osc::OscChannel::on_error ( pulp::runtime::ChannelErrorCallback callback)
overridevirtual

◆ on_message()

void pulp::osc::OscChannel::on_message ( pulp::runtime::MessageCallback callback)
overridevirtual

Install / replace callbacks.

Safe to call at any time; callbacks installed during send-processing apply to subsequent messages.

Implements pulp::runtime::MessageChannel.

◆ open()

std::unique_ptr< OscChannel > pulp::osc::OscChannel::open ( std::string_view host,
std::uint16_t remote_port,
std::uint16_t local_port,
OscChannelOptions options = {} )
static

Construct a bidirectional channel: sender targets (host, remote_port) and the receiver listens on local_port.

Returns nullptr if either endpoint fails to open.

◆ send() [1/3]

bool pulp::osc::OscChannel::send ( const Message & msg)

Convenience — encode and send a structured OSC message.

◆ send() [2/3]

bool pulp::osc::OscChannel::send ( const std::uint8_t * data,
std::size_t size )
overridevirtual

Send a message.

Returns true if the payload was accepted for transmission (queued or written); false if the channel is closed, errored, or the payload was rejected (e.g., frame too large).

The default overload sends binary; override send_text if the transport distinguishes text from binary.

Implements pulp::runtime::MessageChannel.

◆ send() [3/3]

bool pulp::runtime::MessageChannel::send ( std::string_view text)
inlineinherited

◆ send_text()

virtual bool pulp::runtime::MessageChannel::send_text ( std::string_view text)
inlinevirtualinherited

The documentation for this class was generated from the following file: