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}
24
25StreamPrivate::StreamPrivate(Stream *q)
26 : q(q)
27{
28}
29
30StreamPrivate::~StreamPrivate()
31{
32}
33
34Client *Stream::client() const
35{
36 const auto &clients = Context::instance()->d->m_clients.data();
37 auto it = std::find_if(clients.begin(), clients.end(), [this](Client *client) {
38 return client->index() == d->m_clientIndex;
39 });
40 if (it != clients.end()) {
41 return *it;
42 }
43 return nullptr;
44}
45
46bool Stream::isVirtualStream() const
47{
48 return d->m_virtualStream;
49}
50
51quint32 Stream::deviceIndex() const
52{
53 return d->m_deviceIndex;
54}
55
56bool Stream::isCorked() const
57{
58 return d->m_corked;
59}
60
61bool Stream::hasVolume() const
62{
63 return d->m_hasVolume;
64}
65
66} // 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 Sat Dec 21 2024 16:57:59 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.