57 enum class Direction : uint8_t
68 const spa_dict &props);
105 PwPropertyDict properties;
108 struct PendingNodeRecord
110 PendingNodeRecord(ObjectId, ObjectSerial serial, std::optional<ObjectSerial> deviceSerial,
111 PwPropertyDict properties);
114 std::optional<ObjectSerial> deviceSerial;
115 PwPropertyDict properties;
116 std::unique_ptr<NodeEventListener> enumFormatListener;
117 std::unique_ptr<CoreEventDoneListener> enumFormatDoneListener;
118 QFuture<std::vector<SpaObjectAudioFormat>> formatFuture;
122 const std::shared_ptr<std::optional<std::vector<SpaObjectAudioFormat>>> formatResults;
128 std::optional<ObjectSerial> deviceSerial;
129 PwPropertyDict properties;
130 SpaObjectAudioFormat format;
134 struct PendingRecords
136 std::list<PendingNodeRecord> m_sources;
137 std::list<PendingNodeRecord> m_sinks;
138 std::vector<ObjectSerial> m_removals;
140 std::optional<std::variant<QByteArray, NoDefaultDeviceType>> m_defaultSource;
141 std::optional<std::variant<QByteArray, NoDefaultDeviceType>> m_defaultSink;
143 void removeRecordsForObject(ObjectSerial);
145 QMutex m_pendingRecordsMutex;
149 mutable QReadWriteLock m_mutex;
153 std::optional<QByteArray> m_defaultSourceName;
154 std::optional<QByteArray> m_defaultSinkName;
156 QThread m_compressionTimerThread{
this };
157 QChronoTimer m_compressionTimer;
158 void startCompressionTimer();
161 void audioDevicesChanged(
bool verifyThreading =
true);
162 void updateSources(std::list<PendingNodeRecord> addedNodes,
163 QSpan<
const ObjectSerial> removedObjects);
164 void updateSinks(std::list<PendingNodeRecord> addedNodes,
165 QSpan<
const ObjectSerial> removedObjects);
167 void updateSourcesOrSinks(std::list<PendingNodeRecord>, QSpan<
const ObjectSerial>);
169 QList<QAudioDevice> m_sourceDeviceList;
170 QList<QAudioDevice> m_sinkDeviceList;
172 std::optional<ObjectSerial> findDeviceSerial(std::string_view deviceName)
const;
175 std::optional<ObjectSerial> findNodeSerialForNodeName(std::string_view nodeName)
const;
179 mutable QReadWriteLock m_objectDictMutex;
183 std::vector<SharedObjectRemoveObserver>