PulseAudio Qt Bindings
15#include <pulse/ext-stream-restore.h>
16#include <pulse/pulseaudio.h>
22#include "sinkinput_p.h"
24#include "sourceoutput_p.h"
25#include "streamrestore_p.h"
49 virtual int count()
const = 0;
50 virtual QObject *objectAt(
int index)
const = 0;
51 virtual int indexOfObject(
QObject *
object)
const = 0;
54 void aboutToBeAdded(
int index);
55 void added(
int index,
QObject *
object);
56 void aboutToBeRemoved(
int index);
57 void removed(
int index,
QObject *
object);
66template<
typename Type,
typename PAInfo>
77 int count()
const override
79 return m_data.
count();
82 int indexOfObject(
QObject *
object)
const override
84 return m_data.
indexOf(
static_cast<Type *
>(
object));
87 QObject *objectAt(
int index)
const override
89 return m_data.
at(index);
95 removeEntry(m_data.
at(m_data.
count() - 1)->index());
97 m_pendingRemovals.
clear();
100 void insert(Type *
object)
104 const int modelIndex = m_data.
count();
106 Q_EMIT aboutToBeAdded(modelIndex);
108 m_hash[
object->index()] = object;
109 Q_EMIT added(modelIndex,
object);
119 if (m_pendingRemovals.
remove(info->index)) {
124 auto *
obj = m_hash.
value(info->index);
127 obj->d->update(info);
130 obj->d->update(info);
134 void removeEntry(
quint32 index)
137 m_pendingRemovals.
insert(index);
139 const int modelIndex = m_data.
indexOf(m_hash.
value(index));
140 Q_EMIT aboutToBeRemoved(modelIndex);
142 auto object = m_hash.
take(index);
143 Q_EMIT removed(modelIndex,
object);
Maps a specific index to a specific object pointer.
The primary namespace of PulseAudioQt.
bool contains(const Key &key) const const
bool isEmpty() const const
T value(const Key &key) const const
void append(QList< T > &&value)
const_reference at(qsizetype i) const const
bool contains(const AT &value) const const
qsizetype count() const const
qsizetype indexOf(const AT &value, qsizetype from) const const
void removeAt(qsizetype i)
QObject * parent() const const
T qobject_cast(QObject *object)
iterator insert(const T &value)
bool remove(const T &value)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jun 14 2024 11:52:34 by
doxygen 1.10.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.