14#include "volumeobject_p.h"
20 , d(new SourcePrivate(this))
22 connect(Context::instance()->server(), &Server::defaultSourceChanged,
this, &Source::defaultChanged);
25SourcePrivate::SourcePrivate(Source *q)
30void SourcePrivate::update(
const pa_source_info *info)
32 q->Device::d->updateDevice(info);
35void Source::setVolume(qint64 volume)
37 qCDebug(PULSEAUDIOQT) <<
"Changing volume of Source" << name() <<
" to " << volume;
38 Context::instance()->d->setGenericVolume(index(), -1, volume, VolumeObject::d->cvolume(), &pa_context_set_source_volume_by_index);
41void Source::setMuted(
bool muted)
43 Context::instance()->d->setGenericMute(index(), muted, &pa_context_set_source_mute_by_index);
46void Source::setActivePortIndex(quint32 port_index)
48 Port *port = qobject_cast<Port *>(ports().at(port_index));
50 qCWarning(PULSEAUDIOQT) <<
"invalid port set request" << port_index;
53 Context::instance()->d->setGenericPort(index(), port->name(), &pa_context_set_source_port_by_index);
56void Source::setChannelVolume(
int channel, qint64 volume)
58 Context::instance()->d->setGenericVolume(index(), channel, volume, VolumeObject::d->cvolume(), &pa_context_set_source_volume_by_index);
61bool Source::isDefault()
const
63 return Context::instance()->server()->defaultSource() ==
this;
66void Source::setDefault(
bool enable)
68 if (!isDefault() && enable) {
69 Context::instance()->server()->setDefaultSource(
this);
73void Source::switchStreams()
75 const auto sourceOutputs = Context::instance()->sourceOutputs();
76 for (
const auto &sourceOutput : sourceOutputs) {
77 sourceOutput->setDeviceIndex(index());
83 Context::instance()->d->setGenericVolumes(index(), volumes, VolumeObject::d->m_volume, &pa_context_set_source_volume_by_index);
The primary namespace of PulseAudioQt.
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:18:01 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.