57 enum class Direction : uint8_t
68 const spa_dict &props);
104 PwPropertyDict properties;
107 struct PendingNodeRecord
109 PendingNodeRecord(ObjectId, ObjectSerial serial, std::optional<ObjectSerial> deviceSerial,
110 PwPropertyDict properties);
113 std::optional<ObjectSerial> deviceSerial;
114 PwPropertyDict properties;
115 std::unique_ptr<NodeEventListener> enumFormatListener;
116 std::unique_ptr<CoreEventDoneListener> enumFormatDoneListener;
117 QFuture<std::vector<SpaObjectAudioFormat>> formatFuture;
121 const std::shared_ptr<std::optional<std::vector<SpaObjectAudioFormat>>> formatResults;
127 std::optional<ObjectSerial> deviceSerial;
128 PwPropertyDict properties;
129 SpaObjectAudioFormat format;
133 struct PendingRecords
135 std::list<PendingNodeRecord> m_sources;
136 std::list<PendingNodeRecord> m_sinks;
137 std::vector<ObjectSerial> m_removals;
139 std::optional<std::variant<QByteArray, NoDefaultDeviceType>> m_defaultSource;
140 std::optional<std::variant<QByteArray, NoDefaultDeviceType>> m_defaultSink;
142 void removeRecordsForObject(ObjectSerial);
144 QMutex m_pendingRecordsMutex;
148 mutable QReadWriteLock m_mutex;
152 std::optional<QByteArray> m_defaultSourceName;
153 std::optional<QByteArray> m_defaultSinkName;
155 QThread m_compressionTimerThread{
this };
156 QChronoTimer m_compressionTimer;
157 void startCompressionTimer();
160 void audioDevicesChanged(
bool verifyThreading =
true);
161 void updateSources(std::list<PendingNodeRecord> addedNodes,
162 QSpan<
const ObjectSerial> removedObjects);
163 void updateSinks(std::list<PendingNodeRecord> addedNodes,
164 QSpan<
const ObjectSerial> removedObjects);
166 void updateSourcesOrSinks(std::list<PendingNodeRecord>, QSpan<
const ObjectSerial>);
168 QList<QAudioDevice> m_sourceDeviceList;
169 QList<QAudioDevice> m_sinkDeviceList;
171 std::optional<ObjectSerial> findDeviceSerial(std::string_view deviceName)
const;
174 std::optional<ObjectSerial> findNodeSerialForNodeName(std::string_view nodeName)
const;
178 mutable QReadWriteLock m_objectDictMutex;
182 std::vector<SharedObjectRemoveObserver>