8#include "private/qalsaaudiosource_p.h"
9#include "private/qalsaaudiosink_p.h"
10#include "private/qalsaaudiodevice_p.h"
12#include <alsa/asoundlib.h>
27 return std::string_view{
str.get() } == sv;
47 if (snd_device_name_hint(-1,
"pcm", &hints) < 0) {
48 qWarning() <<
"no alsa devices available";
57 unique_str
name{ snd_device_name_get_hint(
entry,
"NAME") };
59 unique_str descr{ snd_device_name_get_hint(
entry,
"DESC") };
60 unique_str io{ snd_device_name_get_hint(
entry,
"IOID") };
62 if (descr && (!io || (io ==
filter))) {
74 bool hasDefault =
false;
80 devices.append(infop->create());
81 if (!hasDefault && infop->id.startsWith(
"default")) {
82 infop->isDefault =
true;
85 if (!sysdefault && infop->id.startsWith(
"sysdefault"))
90 if (!hasDefault && sysdefault) {
92 sysdefault->isDefault =
true;
95 if (!hasDefault &&
devices.size() > 0) {
99 infop->isDefault =
true;
100 devices.prepend(infop->create());
104 snd_device_name_free_hint(hints);
The QAudioDevice class provides an information about audio devices and their functionality.
Mode
Describes the mode of this device.
QByteArray id
\qmlproperty string QtMultimedia::audioDevice::id
QObject * parent() const
Returns a pointer to the parent object.
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Combined button and popup list for selecting options.
std::unique_ptr< char, free_char > unique_str
constexpr bool operator!=(const timespec &t1, const timespec &t2)
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
bool operator==(const QRandomGenerator &rng1, const QRandomGenerator &rng2)
void operator()(char *c) const