Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::events Namespace Reference

Classes

class  ConnectedChildProcess
 A child process with a bidirectional IPC channel. More...
class  ChildProcessManager
 Manages a pool of child processes. More...
class  CoalescedUpdater
 Coalescing async update — trigger from any thread, callback runs on event thread. More...
class  LambdaCoalescedUpdater
 Lambda-based async updater (convenience). More...
class  MultiTimer
 MultiTimer — manages multiple named timers from a single object. More...
class  ActionBroadcaster
 ActionBroadcaster — string-based action dispatch (for menu commands, etc.). More...
class  ScopedLowPowerModeDisabler
 ScopedLowPowerModeDisabler — prevents OS power throttling during audio processing. More...
class  EventLoop
struct  Product
 Resolved product metadata. More...
struct  ProductLookupResult
 Outcome of a single product lookup invocation. More...
struct  Purchase
 Single transaction record. More...
class  IapClient
 Cross-platform in-app purchase surface. More...
class  InterprocessConnection
 Interprocess connection — send and receive length-prefixed messages. More...
class  InterprocessConnectionServer
 Interprocess connection server — listens for multiple client connections. More...
class  MainThreadDispatcher
class  MessageLoopIntegration
 Cross-platform introspection of the active main loop. More...
struct  LocalNotification
 Posted notification descriptor. More...
struct  NotificationActivation
 Delivered to set_handler() when the user activates a notification. More...
class  PushNotifications
 Cross-platform local notification surface. More...
class  ServicePublisher
 RAII service publisher. More...
class  ServiceBrowser
 RAII service browser. More...
class  Timer
class  MountedVolumeListChangeDetector
 Detects when volumes are mounted or unmounted. More...
class  NetworkServiceDiscovery
 mDNS-based network service discovery (Bonjour/DNS-SD). More...
class  LockingCoalescedUpdater
 Locking variant of CoalescedUpdater — blocks the trigger thread until the update is processed on the event thread. More...

Typedefs

using Clock = std::chrono::steady_clock
using TimePoint = Clock::time_point
using Duration = Clock::duration
using Task = std::function<void()>
using ProductLookupCallback = std::function<void(const ProductLookupResult&)>
using PurchaseCallback = std::function<void(const Purchase&)>
using RestoreCallback = std::function<void(const std::vector<Purchase>&)>
using PurchaseObserver = std::function<void(const Purchase&)>
using AuthorizationCallback = std::function<void(NotificationAuthorization)>
using NotificationHandler = std::function<void(const NotificationActivation&)>

Enumerations

enum class  PurchaseState {
  Unknown , Purchasing , Purchased , Restored ,
  Failed , Cancelled , Deferred , Unavailable
}
 Lifecycle state of a Purchase returned by the backend. More...
enum class  ProductLookupStatus { Ok , PartiallyOk , Failed , Unavailable }
 Outcome of a product lookup. More...
enum class  IpcTransport { NamedPipe , Socket , LocalSocket }
 Transport type for IPC. More...
enum class  IpcState { Disconnected , Connecting , Connected , Error }
 Connection state. More...
enum class  MainLoopKind : std::uint8_t {
  None = 0 , Cocoa = 1 , Win32 = 2 , GLib = 3 ,
  X11 = 4 , Wayland = 5 , Custom = 255
}
 The kind of native main loop currently integrated. More...
enum class  MainLoopPumpResult : std::uint8_t {
  HandledSource = 0 , TimedOut = 1 , Stopped = 2 , Finished = 3 ,
  Unsupported = 4 , WrongThread = 5
}
 Outcome of a bounded native-main-loop service slice. More...
enum class  NotificationAuthorization { NotDetermined , Denied , Granted , Unsupported }
 Outcome of request_authorization(). More...
enum class  ServiceDiscoveryAction { ServiceFound , ServiceLost }
 Action delivered to a ServiceBrowser callback. More...

Functions

MainThreadDispatcher::Token register_plugin_backend ()
 Register a process-wide Cocoa main-thread backend for plugin-mode use.
bool unregister_plugin_backend (MainThreadDispatcher::Token token)
 Tear down a backend installed via register_plugin_backend().
bool plugin_backend_available ()
 Whether the host platform has a plugin-mode backend implementation.
bool install_default_backend (NetworkServiceDiscovery &nsd)
 Try to install the host platform's default mDNS backend on nsd.

Typedef Documentation

◆ AuthorizationCallback

◆ Clock

using pulp::events::Clock = std::chrono::steady_clock

◆ Duration

using pulp::events::Duration = Clock::duration

◆ NotificationHandler

using pulp::events::NotificationHandler = std::function<void(const NotificationActivation&)>

◆ ProductLookupCallback

using pulp::events::ProductLookupCallback = std::function<void(const ProductLookupResult&)>

◆ PurchaseCallback

using pulp::events::PurchaseCallback = std::function<void(const Purchase&)>

◆ PurchaseObserver

using pulp::events::PurchaseObserver = std::function<void(const Purchase&)>

◆ RestoreCallback

using pulp::events::RestoreCallback = std::function<void(const std::vector<Purchase>&)>

◆ Task

using pulp::events::Task = std::function<void()>

◆ TimePoint

using pulp::events::TimePoint = Clock::time_point

Enumeration Type Documentation

◆ IpcState

enum class pulp::events::IpcState
strong

Connection state.

Enumerator
Disconnected 
Connecting 
Connected 
Error 

◆ IpcTransport

enum class pulp::events::IpcTransport
strong

Transport type for IPC.

Enumerator
NamedPipe 
Socket 
LocalSocket 

◆ MainLoopKind

enum class pulp::events::MainLoopKind : std::uint8_t
strong

The kind of native main loop currently integrated.

This is reported by whichever backend is active in MainThreadDispatcher. It is None when no backend is registered — e.g. a unit test process, a headless server, or a Pulp plugin loaded into a host that hasn't called register_plugin_backend().

Enumerator
None 

No native main loop integration.

Cocoa 

macOS / iOS NSRunLoop / CFRunLoop.

Win32 

Windows MsgWaitForMultipleObjects / GetMessage.

GLib 

Linux glib GMainLoop (GNOME / GTK hosts).

X11 

Bare X11 XNextEvent loop.

Wayland 

Wayland wl_display_dispatch loop.

Custom 

Caller-registered loop (SDL, custom dispatcher).

◆ MainLoopPumpResult

enum class pulp::events::MainLoopPumpResult : std::uint8_t
strong

Outcome of a bounded native-main-loop service slice.

Enumerator
HandledSource 

At least one native source was handled.

TimedOut 

The bounded interval elapsed without a source.

Stopped 

The native loop was explicitly stopped.

Finished 

The native loop has no sources or timers.

Unsupported 

This platform has no bounded pump implementation.

WrongThread 

The call was not made on the process main thread.

◆ NotificationAuthorization

Outcome of request_authorization().

Enumerator
NotDetermined 

The OS has never been asked.

Denied 

The user (or policy) declined.

Granted 

The app may post notifications.

Unsupported 

No notification backend on this build.

◆ ProductLookupStatus

Outcome of a product lookup.

Enumerator
Ok 

All requested SKUs resolved.

PartiallyOk 

Some SKUs resolved; unknown_skus lists the misses.

Failed 

Backend reported an error before any lookup.

Unavailable 

No IAP backend on this build.

◆ PurchaseState

enum class pulp::events::PurchaseState
strong

Lifecycle state of a Purchase returned by the backend.

Enumerator
Unknown 

Backend hasn't resolved the transaction yet.

Purchasing 

User has been prompted; payment in flight.

Purchased 

Payment cleared; entitlement should be granted.

Restored 

Re-issued via restore(); entitlement should be granted.

Failed 

Backend reported an error (see Purchase::error).

Cancelled 

User cancelled the purchase prompt.

Deferred 

Awaiting external action (Ask-to-Buy / parental approval).

Unavailable 

No IAP backend on this build / SKU not configured.

◆ ServiceDiscoveryAction

Action delivered to a ServiceBrowser callback.

Enumerator
ServiceFound 
ServiceLost 

Function Documentation

◆ install_default_backend()

bool pulp::events::install_default_backend ( NetworkServiceDiscovery & nsd)

Try to install the host platform's default mDNS backend on nsd.

Returns true if a real backend was installed (Bonjour on Apple platforms today; Avahi / WinRT are not built in yet). Returns false when the build was not compiled with a backend for this OS, so callers can install_backend(my_own) and try again or log a clear "no mDNS available" message instead of silently browsing nothing.

◆ plugin_backend_available()

bool pulp::events::plugin_backend_available ( )

Whether the host platform has a plugin-mode backend implementation.

True on macOS; false elsewhere. Tests and adapters can branch on this to keep platform-agnostic assertions tight.

◆ register_plugin_backend()

MainThreadDispatcher::Token pulp::events::register_plugin_backend ( )

Register a process-wide Cocoa main-thread backend for plugin-mode use.

Returns a token that must be passed to unregister_plugin_backend().

Returns 0 on non-macOS platforms — callers should still pair the call with a corresponding unregister_plugin_backend(0) for symmetry; the unregister will no-op on a zero token.

◆ unregister_plugin_backend()

bool pulp::events::unregister_plugin_backend ( MainThreadDispatcher::Token token)

Tear down a backend installed via register_plugin_backend().

Returns true if the token was live and removed (or the call was a benign no-op for a zero token on a non-Apple build).