File indexing completed on 2024-09-29 04:15:18

0001 /*
0002     SPDX-FileCopyrightText: 2014-2015 Harald Sitter <sitter@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #ifndef STREAM_H
0008 #define STREAM_H
0009 
0010 #include <QString>
0011 
0012 #include "volumeobject.h"
0013 
0014 // Properties need fully qualified classes even with pointers.
0015 #include "client.h"
0016 
0017 namespace PulseAudioQt
0018 {
0019 class StreamPrivate;
0020 
0021 class PULSEAUDIOQT_EXPORT Stream : public VolumeObject
0022 {
0023     Q_OBJECT
0024     Q_PROPERTY(PulseAudioQt::Client *client READ client NOTIFY clientChanged)
0025     Q_PROPERTY(bool virtualStream READ isVirtualStream NOTIFY virtualStreamChanged)
0026     Q_PROPERTY(quint32 deviceIndex READ deviceIndex WRITE setDeviceIndex NOTIFY deviceIndexChanged)
0027     Q_PROPERTY(bool corked READ isCorked NOTIFY corkedChanged)
0028     Q_PROPERTY(bool hasVolume READ hasVolume NOTIFY hasVolumeChanged)
0029 
0030 public:
0031     ~Stream();
0032 
0033     Client *client() const;
0034     bool isVirtualStream() const;
0035     quint32 deviceIndex() const;
0036     bool isCorked() const;
0037     bool hasVolume() const;
0038 
0039     virtual void setDeviceIndex(quint32 deviceIndex) = 0;
0040 
0041 Q_SIGNALS:
0042     void clientChanged();
0043     void virtualStreamChanged();
0044     void deviceIndexChanged();
0045     void corkedChanged();
0046     void hasVolumeChanged();
0047 
0048 protected:
0049     /** @private */
0050     explicit Stream(QObject *parent);
0051     /** @private */
0052     class StreamPrivate *const d;
0053 
0054     friend class SinkInputPrivate;
0055     friend class SourceOutputPrivate;
0056 };
0057 
0058 } // PulseAudioQt
0059 
0060 #endif // STREAM_H