PulseAudio Qt Bindings

stream.cpp
1/*
2 SPDX-FileCopyrightText: 2014-2015 Harald Sitter <sitter@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6
7#include "stream.h"
8#include "context_p.h"
9#include "stream_p.h"
10#include "volumeobject_p.h"
11
12namespace PulseAudioQt
13{
14Stream::Stream(QObject *parent)
15 : VolumeObject(parent)
16 , d(new StreamPrivate(this))
17{
18 VolumeObject::d->m_volumeWritable = false;
19}
20
21Stream::~Stream()
22{
23 delete d;
24}
25
26StreamPrivate::StreamPrivate(Stream *q)
27 : q(q)
28{
29}
30
31StreamPrivate::~StreamPrivate()
32{
33}
34
35Client *Stream::client() const
36{
37 const auto &clients = Context::instance()->d->m_clients.data();
38 auto it = std::find_if(clients.begin(), clients.end(), [this](Client *client) {
39 return client->index() == d->m_clientIndex;
40 });
41 if (it != clients.end()) {
42 return *it;
43 }
44 return nullptr;
45}
46
47bool Stream::isVirtualStream() const
48{
49 return d->m_virtualStream;
50}
51
52quint32 Stream::deviceIndex() const
53{
54 return d->m_deviceIndex;
55}
56
57bool Stream::isCorked() const
58{
59 return d->m_corked;
60}
61
62bool Stream::hasVolume() const
63{
64 return d->m_hasVolume;
65}
66
67} // PulseAudioQt
The primary namespace of PulseAudioQt.
Definition card.cpp:17
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 31 2024 17:22:44 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.