@@ -116,6 +116,13 @@ class Pipewire: public QObject {
116116 // /
117117 // / See @@defaultAudioSource for the current default source, regardless of preference.
118118 Q_PROPERTY (qs::service::pipewire::PwNodeIface* preferredDefaultAudioSource READ defaultConfiguredAudioSource WRITE setDefaultConfiguredAudioSource NOTIFY defaultConfiguredAudioSourceChanged);
119+ // / This property is true if quickshell has completed its initial sync with
120+ // / the pipewire server. If true, nodes, links and sync/source preferences will be
121+ // / in a good state.
122+ // /
123+ // / > [!NOTE] You can use the pipewire object before it is ready, but some nodes/links
124+ // / > may be missing, and preference metadata may be null.
125+ Q_PROPERTY (bool ready READ isReady NOTIFY readyChanged);
119126 // clang-format on
120127 QML_ELEMENT;
121128 QML_SINGLETON;
@@ -136,13 +143,17 @@ class Pipewire: public QObject {
136143 [[nodiscard]] PwNodeIface* defaultConfiguredAudioSource () const ;
137144 static void setDefaultConfiguredAudioSource (PwNodeIface* node);
138145
146+ [[nodiscard]] static bool isReady ();
147+
139148signals:
140149 void defaultAudioSinkChanged ();
141150 void defaultAudioSourceChanged ();
142151
143152 void defaultConfiguredAudioSinkChanged ();
144153 void defaultConfiguredAudioSourceChanged ();
145154
155+ void readyChanged ();
156+
146157private slots:
147158 void onNodeAdded (PwNode* node);
148159 void onNodeRemoved (QObject* object);
@@ -294,6 +305,11 @@ class PwNodeIface: public PwObjectIface {
294305 // / The presence or absence of this property can be used to determine if a node
295306 // / manages audio, regardless of if it is bound. If non null, the node is an audio node.
296307 Q_PROPERTY (qs::service::pipewire::PwNodeAudioIface* audio READ audio CONSTANT);
308+ // / True if the node is fully bound and ready to use.
309+ // /
310+ // / > [!NOTE] The node may be used before it is fully bound, but some data
311+ // / > may be missing or incorrect.
312+ Q_PROPERTY (bool ready READ isReady NOTIFY readyChanged);
297313 QML_NAMED_ELEMENT (PwNode);
298314 QML_UNCREATABLE (" PwNodes cannot be created directly" );
299315
@@ -307,13 +323,15 @@ class PwNodeIface: public PwObjectIface {
307323 [[nodiscard]] QString nickname () const ;
308324 [[nodiscard]] bool isSink () const ;
309325 [[nodiscard]] bool isStream () const ;
326+ [[nodiscard]] bool isReady () const ;
310327 [[nodiscard]] QVariantMap properties () const ;
311328 [[nodiscard]] PwNodeAudioIface* audio () const ;
312329
313330 static PwNodeIface* instance (PwNode* node);
314331
315332signals:
316333 void propertiesChanged ();
334+ void readyChanged ();
317335
318336private:
319337 PwNode* mNode ;
0 commit comments