One PipeWire audio node — a sink, source, output stream, or input stream.
Vended by PipeWireConnection via nodes() / nodeAdded() / nodeRemoved(); never directly constructed from QML (registered as uncreatable so the metatype is visible to bindings without inviting accidental QML-side new PwNode()).
All Q_PROPERTY values are populated from PipeWire pw_node info and the SPA_PARAM_Props parameter:
- id, name, mediaClass come from the registry global event.
- nick and description come from the node-info properties hash (PipeWire convention: node.nick, node.description).
- channelCount, volumes, muted come from a SPA_PARAM_Props pod enumerated after construction and tracked via the node's param-changed event.
Volumes are linear amplitudes per channel (PipeWire's storage format). Consumers that want cubic / perceptual mapping for a UI slider should run them through a Mixer.Curve helper (added in a later milestone) — round-trips through the lib stay lossless.
Post-removal slot behavior: once the underlying daemon-side pw_node has been removed (between the daemon's global_remove event and the GUI's nodeRemoved firing, plus any tail where a QML binding still holds a stale pointer), setVolume / setVolumes / setMuted route the write through the owning PipeWireConnection to the loop thread. There, the registry lookup for the (now-gone) node id misses and the write is silently dropped — no error, no signal, no crash. Treat these slots as best-effort once the model has signalled removal.
| void PhosphorServicePipeWire::PwNode::setVolume |
( |
qreal | value | ) |
|
|
slot |
Set every channel's linear amplitude to value.
Convenience for QML sliders that drive a single bar across the whole node. The write is asynchronous: propsChanged fires after the daemon echoes the new SPA_PARAM_Props pod, not immediately.
Expected input range: linear amplitude, approximately [0.0, 1.0] for the normal mixer range, with values above 1.0 permitted for boost (PipeWire accepts them but most hardware sinks clip). Negative values are not part of the linear-amplitude contract: PipeWire may interpret them as phase-inverted (driver-dependent) or clamp them to zero, neither of which is a useful UI behaviour. Callers should clamp to [0.0, expected upper bound] at the UI layer before invoking; the slot forwards value to the daemon verbatim.