45 std::string
name =
"Pulp Virtual UMP";
70 bool is_open() const noexcept
override {
return open_.load(std::memory_order_acquire); }
80 std::uint64_t
sent_count() const noexcept {
return sent_.load(std::memory_order_relaxed); }
81 std::uint64_t
delivered_count() const noexcept {
return delivered_.load(std::memory_order_relaxed); }
92 mutable std::mutex cb_mu_;
95 std::atomic<bool> open_{
true};
96 std::atomic<std::uint64_t> sent_{0};
97 std::atomic<std::uint64_t> delivered_{0};
Polymorphic endpoint handle.
Definition ump_endpoint.hpp:69
void set_receive_callback(UmpReceiveCallback cb) override
Register the receive callback.
void close()
Tear-down hook — marks is_open() false and detaches the callback.
bool is_open() const noexcept override
True iff the endpoint is currently usable (port connected, virtual endpoint live).
Definition ump_virtual_endpoint.hpp:70
bool send(const UmpPacket &packet) override
send() writes a packet "out" of this endpoint.
bool deliver(const UmpPacket &packet, double timestamp_sec=0.0)
Deliver a packet directly to the receive callback as if it arrived from elsewhere.
const UmpEndpointInfo & info() const noexcept override
Snapshot of the endpoint's static metadata.
Definition ump_virtual_endpoint.hpp:61
std::uint64_t sent_count() const noexcept
Atomic counters useful for tests; never load-bearing for the real backend (CoreMIDI counters live els...
Definition ump_virtual_endpoint.hpp:80
std::uint64_t delivered_count() const noexcept
Definition ump_virtual_endpoint.hpp:81
VirtualUmpEndpoint(VirtualUmpEndpointConfig cfg)
Definition custom_node_events.hpp:26
std::function< void(const UmpPacket &packet, double timestamp_sec)> UmpReceiveCallback
Receive callback.
Definition ump_endpoint.hpp:64
Direction the endpoint exposes.
Definition ump_endpoint.hpp:40
Static description of an endpoint discovered on the system or registered virtually.
Definition ump_endpoint.hpp:47
Configuration for a newly-registered virtual endpoint.
Definition ump_virtual_endpoint.hpp:44
bool loopback
True if send() should also fire the receive callback (round-trip loopback).
Definition ump_virtual_endpoint.hpp:50
std::string name
Definition ump_virtual_endpoint.hpp:45
UmpEndpointDirection direction
Direction the endpoint advertises in its info().
Definition ump_virtual_endpoint.hpp:54