16#include "volumeobject_p.h"
22 , d(new SinkPrivate(this))
24 connect(Context::instance()->server(), &Server::defaultSinkChanged,
this, &Sink::defaultChanged);
27SinkPrivate::SinkPrivate(Sink *q)
36void SinkPrivate::update(
const pa_sink_info *info)
38 q->Device::d->updateDevice(info);
40 if (m_monitorIndex != info->monitor_source) {
41 m_monitorIndex = info->monitor_source;
42 Q_EMIT q->monitorIndexChanged();
46void Sink::setVolume(qint64 volume)
48 qCDebug(PULSEAUDIOQT) <<
"Changing volume of Sink" << name() <<
" to " << volume;
49 Context::instance()->d->setGenericVolume(index(), -1, volume, VolumeObject::d->cvolume(), &pa_context_set_sink_volume_by_index);
52void Sink::setMuted(
bool muted)
54 Context::instance()->d->setGenericMute(index(), muted, &pa_context_set_sink_mute_by_index);
57void Sink::setActivePortIndex(quint32 port_index)
59 Port *port = qobject_cast<Port *>(ports().at(port_index));
61 qCWarning(PULSEAUDIOQT) <<
"invalid port set request" << port_index;
64 Context::instance()->d->setGenericPort(index(), port->name(), &pa_context_set_sink_port_by_index);
67void Sink::setChannelVolume(
int channel, qint64 volume)
69 Context::instance()->d->setGenericVolume(index(), channel, volume, VolumeObject::d->cvolume(), &pa_context_set_sink_volume_by_index);
72bool Sink::isDefault()
const
74 return Context::instance()->server()->defaultSink() ==
this;
77void Sink::setDefault(
bool enable)
79 if (!isDefault() && enable) {
80 Context::instance()->server()->setDefaultSink(
this);
84quint32 Sink::monitorIndex()
const
86 return d->m_monitorIndex;
89void Sink::setChannelVolumes(
const QList<qint64> &channelVolumes)
91 Context::instance()->d->setGenericVolumes(index(), channelVolumes, VolumeObject::d->m_volume, &pa_context_set_sink_volume_by_index);
94void Sink::switchStreams()
96 const auto sinkInputs = Context::instance()->sinkInputs();
97 for (
const auto &sinkInput : sinkInputs) {
98 sinkInput->setDeviceIndex(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 Fri Nov 29 2024 11:50:05 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.