Refresh the device list.
Re-enumerates available devices. May trigger device callbacks for newly connected or disconnected devices.
148{
151 }
152
154 std::vector<DeviceEvent> events;
156
158 events.clear();
159 bool changed = false;
160 std::set<uint32_t> seen;
161
162 for (const auto& port : found) {
163 const std::string path = port.path.string();
164 const bool configured_port = std::ranges::any_of(roster.entries, [&](const auto& item) {
165 return item.second.configured && item.second.parent == 0 && same_port(item.second.info.port_name, path);
166 });
167 if (configured_port) {
168 continue;
169 }
170
171 const uint32_t
id =
id_for(roster,
"e:" + path);
172 seen.insert(id);
173 if (roster.entries.find(id) == roster.entries.end()) {
176 events.emplace_back(entry.info, true);
177 roster.entries.insert_or_assign(id, std::move(entry));
178 changed = true;
179 }
180 }
181
182 std::vector<uint32_t> gone;
183 for (const auto& [id, entry] : roster.entries) {
184 if (!entry.configured && entry.parent == 0 && !entry.device && !seen.contains(id)) {
185 gone.push_back(id);
186 }
187 }
188 for (const uint32_t id : gone) {
189 events.emplace_back(roster.entries.find(id)->second.info, false);
190 roster.entries.erase(id);
191 changed = true;
192 }
193
194 std::vector<uint32_t> orphans;
195 for (const auto& [id, entry] : roster.entries) {
196 if (entry.parent != 0 && roster.entries.find(entry.parent) == roster.entries.end()) {
197 orphans.push_back(id);
198 }
199 }
200 for (const uint32_t id : orphans) {
201 events.emplace_back(roster.entries.find(id)->second.info, false);
202 roster.entries.erase(id);
203 changed = true;
204 }
205
206 count = roster.entries.size();
207 return changed;
208 });
209
210 for (const auto& [info, connected] : events) {
212 }
213
215}
std::vector< double > count(std::span< const double > data, size_t n_windows, uint32_t hop_size, uint32_t window_size)
Sample count per window (as double for pipeline uniformity).