Changeset View
Changeset View
Standalone View
Standalone View
src/pulseaudio.cpp
Show First 20 Lines • Show All 291 Lines • ▼ Show 20 Line(s) | 291 | if (sinks.count() == 1) { | |||
---|---|---|---|---|---|
292 | return static_cast<Sink *>(sinks.objectAt(0)); | 292 | return static_cast<Sink *>(sinks.objectAt(0)); | ||
293 | } | 293 | } | ||
294 | 294 | | |||
295 | auto lookForState = [this](Device::State state) { | 295 | auto lookForState = [this](Device::State state) { | ||
296 | Sink *ret = nullptr; | 296 | Sink *ret = nullptr; | ||
297 | QMapIterator<quint32, Sink *> it(context()->sinks().data()); | 297 | QMapIterator<quint32, Sink *> it(context()->sinks().data()); | ||
298 | while (it.hasNext()) { | 298 | while (it.hasNext()) { | ||
299 | it.next(); | 299 | it.next(); | ||
300 | if (it.value()->state() != state) { | 300 | if (it.value()->isVirtualDevice() || it.value()->state() != state) { | ||
301 | continue; | 301 | continue; | ||
302 | } | 302 | } | ||
303 | if (!ret) { | 303 | if (!ret) { | ||
304 | ret = it.value(); | 304 | ret = it.value(); | ||
305 | } else if (it.value() == defaultSink()) { | 305 | } else if (it.value() == defaultSink()) { | ||
306 | ret = it.value(); | 306 | ret = it.value(); | ||
307 | break; | 307 | break; | ||
308 | } | 308 | } | ||
▲ Show 20 Lines • Show All 77 Lines • Show Last 20 Lines |