PulseAudio Qt Bindings

volumeobject.h
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#ifndef VOLUMEOBJECT_H
8#define VOLUMEOBJECT_H
9
10#include "indexedpulseobject.h"
11
12namespace PulseAudioQt
13{
14/**
15 * An PulseObject that has a volume. Can be a Device or a Stream.
16 */
17class PULSEAUDIOQT_EXPORT VolumeObject : public IndexedPulseObject
18{
19 Q_OBJECT
20 Q_PROPERTY(qint64 volume READ volume WRITE setVolume NOTIFY volumeChanged)
21 Q_PROPERTY(bool muted READ isMuted WRITE setMuted NOTIFY mutedChanged)
22 Q_PROPERTY(bool volumeWritable READ isVolumeWritable NOTIFY isVolumeWritableChanged)
23 Q_PROPERTY(QStringList channels READ channels NOTIFY channelsChanged)
24 Q_PROPERTY(QList<qint64> channelVolumes READ channelVolumes WRITE setChannelVolumes NOTIFY channelVolumesChanged)
25 Q_PROPERTY(QStringList rawChannels READ rawChannels NOTIFY rawChannelsChanged)
26
27public:
28 ~VolumeObject() override;
29
30 /**
31 * This object's volume
32 */
33 qint64 volume() const;
34
35 /**
36 * Set the volume for this object.
37 * This affects all channels.
38 * The volume must be between PulseAudioQt::minimumVolume() and PulseAudioQt::maximumVolume().
39 */
40 virtual void setVolume(qint64 volume) = 0;
41
42 /**
43 * Whether this object is muted.
44 */
45 bool isMuted() const;
46
47 /**
48 * Set whether this object is muted.
49 */
50 virtual void setMuted(bool muted) = 0;
51
52 bool isVolumeWritable() const;
53
54 QStringList channels() const;
55 QStringList rawChannels() const;
56 QList<qint64> channelVolumes() const;
57 virtual void setChannelVolumes(const QList<qint64> &channelVolumes) = 0;
58 Q_INVOKABLE virtual void setChannelVolume(int channel, qint64 volume) = 0;
59
60Q_SIGNALS:
61 void volumeChanged();
62 void mutedChanged();
63 void isVolumeWritableChanged();
64 void channelsChanged();
65 void rawChannelsChanged();
66 void channelVolumesChanged();
67
68protected:
69 /** @private */
70 explicit VolumeObject(QObject *parent);
71 /** @private */
72 std::unique_ptr<class VolumeObjectPrivate> d;
73 friend class DevicePrivate;
74 friend class StreamPrivate;
75};
76
77} // PulseAudioQt
78
79#endif // VOLUMEOBJECT_H
An PulseObject that has a volume.
virtual void setMuted(bool muted)=0
Set whether this object is muted.
virtual void setVolume(qint64 volume)=0
Set the volume for this object.
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 Fri Dec 6 2024 12:11:21 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.