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);
66 template<
typename Type,
typename PAInfo>
79 int count()
const override
81 return m_data.
count();
84 int indexOfObject(
QObject *
object)
const override
86 return m_data.
indexOf(
static_cast<Type *
>(
object));
89 QObject *objectAt(
int index)
const override
91 return m_data.
at(index);
97 removeEntry(m_data.
at(m_data.
count() - 1)->index());
99 m_pendingRemovals.
clear();
102 void insert(Type *
object)
106 const int modelIndex = m_data.
count();
108 Q_EMIT aboutToBeAdded(modelIndex);
110 m_hash[
object->index()] = object;
111 Q_EMIT added(modelIndex,
object);
121 if (m_pendingRemovals.
remove(info->index)) {
126 auto *obj = m_hash.
value(info->index);
129 obj->d->update(info);
132 obj->d->update(info);
136 void removeEntry(quint32 index)
139 m_pendingRemovals.
insert(index);
141 const int modelIndex = m_data.
indexOf(m_hash.
value(index));
142 Q_EMIT aboutToBeRemoved(modelIndex);
144 auto object = m_hash.
take(index);
145 Q_EMIT removed(modelIndex,
object);
const T value(const Key &key) const const
bool remove(const T &value)
void append(const T &value)
int indexOf(const T &value, int from) const const
The primary namespace of PulseAudioQt.
Maps a specific index to a specific object pointer.
const T & at(int i) const const
bool contains(const T &value) const const
bool isEmpty() const const
QSet::iterator insert(const T &value)
int count(const T &value) const const
bool contains(const Key &key) const const
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Fri Sep 29 2023 04:01:10 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.