PulseAudio Qt Bindings

sourceoutput.cpp
1 /*
2  SPDX-FileCopyrightText: 2014-2015 Harald Sitter <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6 
7 #include "sourceoutput.h"
8 #include "sourceoutput_p.h"
9 
10 #include "context.h"
11 #include "context_p.h"
12 #include "stream_p.h"
13 
14 namespace PulseAudioQt
15 {
16 SourceOutput::SourceOutput(QObject *parent)
17  : Stream(parent)
18  , d(new SourceOutputPrivate(this))
19 {
20 }
21 
22 SourceOutput::~SourceOutput()
23 {
24 }
25 
26 SourceOutputPrivate::SourceOutputPrivate(SourceOutput *q)
27  : q(q)
28 {
29 }
30 
31 void SourceOutputPrivate::update(const pa_source_output_info *info)
32 {
33  q->Stream::d->updateStream(info);
34  if (q->Stream::d->m_deviceIndex != info->source) {
35  q->Stream::d->m_deviceIndex = info->source;
36  Q_EMIT q->deviceIndexChanged();
37  }
38 }
39 
40 void SourceOutput::setDeviceIndex(quint32 deviceIndex)
41 {
42  Context::instance()->d->setGenericDeviceForStream(index(), deviceIndex, &pa_context_move_source_output_by_index);
43 }
44 
45 void SourceOutput::setVolume(qint64 volume)
46 {
47  Context::instance()->d->setGenericVolume(index(), -1, volume, VolumeObject::d->cvolume(), &pa_context_set_source_output_volume);
48 }
49 
50 void SourceOutput::setMuted(bool muted)
51 {
52  Context::instance()->d->setGenericMute(index(), muted, &pa_context_set_source_output_mute);
53 }
54 
55 void SourceOutput::setChannelVolume(int channel, qint64 volume)
56 {
57  Context::instance()->d->setGenericVolume(index(), channel, volume, VolumeObject::d->cvolume(), &pa_context_set_source_output_volume);
58 }
59 
60 void SourceOutput::setChannelVolumes(const QVector<qint64> &channelVolumes)
61 {
62  Context::instance()->d->setGenericVolumes(index(), channelVolumes, VolumeObject::d->m_volume, &pa_context_set_source_output_volume);
63 }
64 
65 } // PulseAudioQt
The primary namespace of PulseAudioQt.
Definition: card.cpp:16
void setMuted(bool muted) override
Set whether this object is muted.
void setVolume(qint64 volume) override
Set the volume for this object.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Mon Jun 27 2022 04:15:49 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.