PulseAudio Qt Bindings
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 Context::instance()->d->setGenericVolume(index(), -1, volume, VolumeObject::d->cvolume(), &pa_context_set_source_volume_by_index);
40void Source::setMuted(
bool muted)
42 Context::instance()->d->setGenericMute(index(), muted, &pa_context_set_source_mute_by_index);
45void Source::setActivePortIndex(quint32 port_index)
47 Port *port = qobject_cast<Port *>(ports().at(port_index));
49 qCWarning(PULSEAUDIOQT) <<
"invalid port set request" << port_index;
52 Context::instance()->d->setGenericPort(index(), port->name(), &pa_context_set_source_port_by_index);
55void Source::setChannelVolume(
int channel, qint64 volume)
57 Context::instance()->d->setGenericVolume(index(), channel, volume, VolumeObject::d->cvolume(), &pa_context_set_source_volume_by_index);
60bool Source::isDefault()
const
62 return Context::instance()->server()->defaultSource() ==
this;
65void Source::setDefault(
bool enable)
67 if (!isDefault() && enable) {
68 Context::instance()->server()->setDefaultSource(
this);
72void Source::switchStreams()
74 const auto sourceOutputs = Context::instance()->sourceOutputs();
75 for (
const auto &sourceOutput : sourceOutputs) {
76 sourceOutput->setDeviceIndex(index());
82 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 Tue Mar 26 2024 11:20:07 by
doxygen 1.10.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.