Skip to content

Commit 8eb3869

Browse files
committed
fix: Audio devices not detected after pipewire changes #558
1 parent 7d1c9a9 commit 8eb3869

2 files changed

Lines changed: 16 additions & 12 deletions

File tree

src/services/pipewire/peak.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,21 @@
88
#include <qvector.h>
99

1010
#include "node.hpp"
11+
#include "qml.hpp"
1112

1213
namespace qs::service::pipewire {
1314

14-
class PwNodeIface;
1515
class PwPeakStream;
1616

1717
} // namespace qs::service::pipewire
1818

19-
Q_DECLARE_OPAQUE_POINTER(qs::service::pipewire::PwNodeIface*);
20-
2119
namespace qs::service::pipewire {
2220

2321
///! Monitors peak levels of an audio node.
2422
/// Tracks volume peaks for a node across all its channels.
2523
///
2624
/// The peak monitor binds nodes similarly to @@PwObjectTracker when enabled.
27-
class PwNodePeakMonitor: public QObject {
25+
class QS_PIPEWIRE_EXPORT PwNodePeakMonitor: public QObject {
2826
Q_OBJECT;
2927
// clang-format off
3028
/// The node to monitor. Must be an audio node.

src/services/pipewire/qml.hpp

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
#include "node.hpp"
1515
#include "registry.hpp"
1616

17+
#if defined(__GNUC__) || defined(__clang__)
18+
#define QS_PIPEWIRE_EXPORT [[gnu::visibility("default")]]
19+
#else
20+
#define QS_PIPEWIRE_EXPORT
21+
#endif
22+
1723
namespace qs::service::pipewire {
1824

1925
class PwNodeIface;
@@ -30,7 +36,7 @@ class PwObjectRefIface {
3036
virtual void unref() = 0;
3137
};
3238

33-
class PwObjectIface
39+
class QS_PIPEWIRE_EXPORT PwObjectIface
3440
: public QObject
3541
, public PwObjectRefIface {
3642
Q_OBJECT;
@@ -53,7 +59,7 @@ private slots:
5359
};
5460

5561
///! Contains links to all pipewire objects.
56-
class Pipewire: public QObject {
62+
class QS_PIPEWIRE_EXPORT Pipewire: public QObject {
5763
Q_OBJECT;
5864
// clang-format off
5965
/// All nodes present in pipewire.
@@ -172,7 +178,7 @@ private slots:
172178
};
173179

174180
///! Tracks non-monitor link connections to a given node.
175-
class PwNodeLinkTracker: public QObject {
181+
class QS_PIPEWIRE_EXPORT PwNodeLinkTracker: public QObject {
176182
Q_OBJECT;
177183
// clang-format off
178184
/// The node to track connections to.
@@ -217,7 +223,7 @@ private slots:
217223
/// Extra properties of a @@PwNode if the node is an audio node.
218224
///
219225
/// See @@PwNode.audio.
220-
class PwNodeAudioIface: public QObject {
226+
class QS_PIPEWIRE_EXPORT PwNodeAudioIface: public QObject {
221227
Q_OBJECT;
222228
// clang-format off
223229
/// If the node is currently muted. Setting this property changes the mute state.
@@ -267,7 +273,7 @@ class PwNodeAudioIface: public QObject {
267273
};
268274

269275
///! A node in the pipewire connection graph.
270-
class PwNodeIface: public PwObjectIface {
276+
class QS_PIPEWIRE_EXPORT PwNodeIface: public PwObjectIface {
271277
Q_OBJECT;
272278
/// The pipewire object id of the node.
273279
///
@@ -347,7 +353,7 @@ class PwNodeIface: public PwObjectIface {
347353
///! A connection between pipewire nodes.
348354
/// Note that there is one link per *channel* of a connection between nodes.
349355
/// You usually want @@PwLinkGroup.
350-
class PwLinkIface: public PwObjectIface {
356+
class QS_PIPEWIRE_EXPORT PwLinkIface: public PwObjectIface {
351357
Q_OBJECT;
352358
/// The pipewire object id of the link.
353359
///
@@ -385,7 +391,7 @@ class PwLinkIface: public PwObjectIface {
385391

386392
///! A group of connections between pipewire nodes.
387393
/// A group of connections between pipewire nodes, one per source->target pair.
388-
class PwLinkGroupIface
394+
class QS_PIPEWIRE_EXPORT PwLinkGroupIface
389395
: public QObject
390396
, public PwObjectRefIface {
391397
Q_OBJECT;
@@ -434,7 +440,7 @@ class PwLinkGroupIface
434440
/// Properties that require their object be bound to use are clearly marked. You do not
435441
/// need to bind the object unless mentioned in the description of the property you
436442
/// want to use.
437-
class PwObjectTracker: public QObject {
443+
class QS_PIPEWIRE_EXPORT PwObjectTracker: public QObject {
438444
Q_OBJECT;
439445
/// The list of objects to bind. May contain nulls.
440446
Q_PROPERTY(QList<QObject*> objects READ objects WRITE setObjects NOTIFY objectsChanged);

0 commit comments

Comments
 (0)