summaryrefslogtreecommitdiffstats
path: root/src/PulseAudioQt/streamrestore.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/PulseAudioQt/streamrestore.h')
-rw-r--r--src/PulseAudioQt/streamrestore.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/src/PulseAudioQt/streamrestore.h b/src/PulseAudioQt/streamrestore.h
new file mode 100644
index 0000000..cb74006
--- /dev/null
+++ b/src/PulseAudioQt/streamrestore.h
@@ -0,0 +1,74 @@
+/*
+ SPDX-FileCopyrightText: 2016 David Rosca <nowrep@gmail.com>
+
+ SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
+*/
+
+#ifndef STREAMRESTORE_H
+#define STREAMRESTORE_H
+
+#include "pulseobject.h"
+
+struct pa_ext_stream_restore_info;
+
+namespace PulseAudioQt
+{
+class PULSEAUDIOQT_EXPORT StreamRestore : public PulseObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QString device READ device WRITE setDevice NOTIFY deviceChanged)
+ Q_PROPERTY(qint64 volume READ volume WRITE setVolume NOTIFY volumeChanged)
+ Q_PROPERTY(bool muted READ isMuted WRITE setMuted NOTIFY mutedChanged)
+ Q_PROPERTY(bool hasVolume READ hasVolume CONSTANT)
+ Q_PROPERTY(bool volumeWritable READ isVolumeWritable CONSTANT)
+ Q_PROPERTY(QVector<QString> channels READ channels NOTIFY channelsChanged)
+ Q_PROPERTY(QVector<qreal> channelVolumes READ channelVolumes NOTIFY channelVolumesChanged)
+ Q_PROPERTY(quint32 deviceIndex READ deviceIndex WRITE setDeviceIndex NOTIFY deviceIndexChanged)
+ // Not a IndexedPulseObject since pa_ext_stream_restore_info does not have an index member
+ Q_PROPERTY(quint32 index READ index CONSTANT)
+
+public:
+ ~StreamRestore();
+
+ QString device() const;
+ void setDevice(const QString &device);
+
+ qint64 volume() const;
+ void setVolume(qint64 volume);
+
+ bool isMuted() const;
+ void setMuted(bool muted);
+
+ bool hasVolume() const;
+ bool isVolumeWritable() const;
+
+ QVector<QString> channels() const;
+
+ QVector<qreal> channelVolumes() const;
+
+ quint32 index() const;
+
+ quint32 deviceIndex() const;
+ void setDeviceIndex(quint32 deviceIndex);
+
+ void setChannelVolume(int channel, qint64 volume);
+
+Q_SIGNALS:
+ void deviceChanged();
+ void volumeChanged();
+ void mutedChanged();
+ void channelsChanged();
+ void channelVolumesChanged();
+ void deviceIndexChanged();
+
+private:
+ explicit StreamRestore(quint32 index, const QVariantMap &properties, QObject *parent);
+
+ class StreamRestorePrivate *const d;
+ friend class MapBase<StreamRestore, pa_ext_stream_restore_info>;
+ friend class ContextPrivate;
+};
+
+} // PulseAudioQt
+
+#endif // STREAMRESTORE_H