Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
PhosphorServicePipeWire::PwSinkModel Class Reference

Convenience subclass pre-pinned to Audio/Sink. More...

#include <PhosphorServicePipeWire/PwNodeModel.h>

Inheritance diagram for PhosphorServicePipeWire::PwSinkModel:
[legend]

Public Member Functions

 PwSinkModel (QObject *parent=nullptr)
Public Member Functions inherited from PhosphorServicePipeWire::PwNodeModel
 PwNodeModel (QObject *parent=nullptr)
 ~PwNodeModel () override
PipeWireConnection * connection () const
QStringList mediaClasses () const
int rowCount (const QModelIndex &parent=QModelIndex()) const override
QVariant data (const QModelIndex &index, int role) const override
QHash< int, QByteArray > roleNames () const override
PwNode * firstNode () const
PwNode * nodeAt (int row) const
 The node at row, or null when row is out of range.

Additional Inherited Members

Public Types inherited from PhosphorServicePipeWire::PwNodeModel
enum  Role {
  NodeRole = Qt::UserRole + 1 , IdRole = Qt::UserRole + 2 , NameRole = Qt::UserRole + 3 , NickRole = Qt::UserRole + 4 ,
  DescriptionRole = Qt::UserRole + 5 , MediaClassRole = Qt::UserRole + 6 , ChannelCountRole = Qt::UserRole + 7 , VolumesRole = Qt::UserRole + 8 ,
  MutedRole = Qt::UserRole + 9
}
 Row 0, or null when the model is empty. More...
Public Slots inherited from PhosphorServicePipeWire::PwNodeModel
void setConnection (PipeWireConnection *connection)
 Attach the model to a PipeWireConnection (or detach by passing nullptr).
void setMediaClasses (const QStringList &classes)
 Replace the media-class filter set.
Signals inherited from PhosphorServicePipeWire::PwNodeModel
void connectionChanged ()
void mediaClassesChanged ()
void countChanged ()
void firstNodeChanged ()

Detailed Description

Convenience subclass pre-pinned to Audio/Sink.

Designed for QML PwSinkModel { connection: PipeWireHost.connection }. Mirrors the pattern used in phosphor-service-mpris' MprisPlayerModel.

Copy/move suppression is inherited from PwNodeModel; redeclaring Q_DISABLE_COPY_MOVE here would only add noise to the moc table without changing the contract.

Not marked final even though the design rationale excludes further subclassing: qmlRegisterType<PwSinkModel> (and the sibling registrations below) instantiate Qt's internal QQmlPrivate::QQmlElement<T>, which is declared final class QQmlElement final : public T — that subclass cannot derive from a final base, so adding final here breaks the build with cannot derive from 'final' base 'PwSinkModel'. The "leaf convenience wrapper" contract is enforced socially / via code review instead; callers that need a different media-class filter should still instantiate PwNodeModel directly and set mediaClasses.

Constructor & Destructor Documentation

◆ PwSinkModel()

PhosphorServicePipeWire::PwSinkModel::PwSinkModel ( QObject * parent = nullptr)
explicit

The documentation for this class was generated from the following file:
  • phosphor-service-pipewire/include/PhosphorServicePipeWire/PwNodeModel.h