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

#include <ump_session.hpp>

Public Member Functions

 UmpSession ()
 UmpSession (UmpSessionConfig cfg)
 ~UmpSession ()
 UmpSession (const UmpSession &)=delete
UmpSession & operator= (const UmpSession &)=delete
bool os_backend_active () const noexcept
 Returns true if the OS-backed UMP backend is live (CoreMIDI client created etc).
std::vector< UmpEndpointInfo > enumerate_endpoints () const
 Snapshot the OS endpoints known to the system, plus every virtual endpoint registered through this session.
UmpEndpoint * open_endpoint (const std::string &id, UmpOpenStatus *status=nullptr)
 Open (or attach to) an endpoint by id.
std::shared_ptr< VirtualUmpEndpoint > register_virtual_endpoint (VirtualUmpEndpointConfig cfg)
 Register a virtual endpoint with the session.
bool unregister_virtual_endpoint (const std::string &id)
 Drop a virtual endpoint.
std::size_t virtual_endpoint_count () const
 Number of virtual endpoints currently registered.
bool wire_virtual_loopback (const std::string &from_id, const std::string &to_id)
 Connect two virtual endpoints in a loopback: every packet sent into from is delivered to to.

Constructor & Destructor Documentation

◆ UmpSession() [1/3]

pulp::midi::UmpSession::UmpSession ( )

◆ UmpSession() [2/3]

pulp::midi::UmpSession::UmpSession ( UmpSessionConfig cfg)
explicit

◆ ~UmpSession()

pulp::midi::UmpSession::~UmpSession ( )

◆ UmpSession() [3/3]

pulp::midi::UmpSession::UmpSession ( const UmpSession & )
delete

Member Function Documentation

◆ enumerate_endpoints()

std::vector< UmpEndpointInfo > pulp::midi::UmpSession::enumerate_endpoints ( ) const

Snapshot the OS endpoints known to the system, plus every virtual endpoint registered through this session.

Cheap; safe to call from any thread.

◆ open_endpoint()

UmpEndpoint * pulp::midi::UmpSession::open_endpoint ( const std::string & id,
UmpOpenStatus * status = nullptr )

Open (or attach to) an endpoint by id.

The returned endpoint pointer is owned by the session: the caller borrows it for as long as the session lives. Returns nullptr on failure; status (when non-null) is filled with the reason.

◆ operator=()

UmpSession & pulp::midi::UmpSession::operator= ( const UmpSession & )
delete

◆ os_backend_active()

bool pulp::midi::UmpSession::os_backend_active ( ) const
noexcept

Returns true if the OS-backed UMP backend is live (CoreMIDI client created etc).

On a virtual-only session this is false.

◆ register_virtual_endpoint()

std::shared_ptr< VirtualUmpEndpoint > pulp::midi::UmpSession::register_virtual_endpoint ( VirtualUmpEndpointConfig cfg)

Register a virtual endpoint with the session.

The session retains a reference (so enumerate_endpoints() lists it); the returned shared_ptr is the caller's handle for direct send() / deliver() operations.

◆ unregister_virtual_endpoint()

bool pulp::midi::UmpSession::unregister_virtual_endpoint ( const std::string & id)

Drop a virtual endpoint.

Idempotent; returns true if a matching endpoint was found and removed.

◆ virtual_endpoint_count()

std::size_t pulp::midi::UmpSession::virtual_endpoint_count ( ) const

Number of virtual endpoints currently registered.

◆ wire_virtual_loopback()

bool pulp::midi::UmpSession::wire_virtual_loopback ( const std::string & from_id,
const std::string & to_id )

Connect two virtual endpoints in a loopback: every packet sent into from is delivered to to.

Useful for headless tests where you want a round-trip without the OS layer. Returns false if either endpoint id is unknown.


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