summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Uwe Broulik <[email protected]>2016-11-08 11:51:55 +0100
committerKai Uwe Broulik <[email protected]>2016-11-08 11:51:55 +0100
commitc64fe1cfcf347ced1d4957b247d7a23571a5dc2d (patch)
treef831fd97926aa85868440f0ec5d9ddfc4dfbc24b
parent3c760965e6b645cb2ac7e5c0fcf747c80f165d3a (diff)
[Stream] Expose "corked" property
It denotes whether there is actually something going on on a playback stream vs. it merely existing. Differential Revision: https://phabricator.kde.org/D3300
-rw-r--r--src/stream.cpp6
-rw-r--r--src/stream.h8
2 files changed, 14 insertions, 0 deletions
diff --git a/src/stream.cpp b/src/stream.cpp
index b060129..27fd4c2 100644
--- a/src/stream.cpp
+++ b/src/stream.cpp
@@ -27,6 +27,7 @@ Stream::Stream(QObject *parent)
: VolumeObject(parent)
, m_clientIndex(PA_INVALID_INDEX)
, m_virtualStream(false)
+ , m_corked(false)
{
m_volumeWritable = false;
m_hasVolume = false;
@@ -56,4 +57,9 @@ quint32 Stream::deviceIndex() const
return m_deviceIndex;
}
+bool Stream::isCorked() const
+{
+ return m_corked;
+}
+
} // QPulseAudio
diff --git a/src/stream.h b/src/stream.h
index bf12a81..ad7dcc5 100644
--- a/src/stream.h
+++ b/src/stream.h
@@ -42,6 +42,7 @@ class Q_DECL_EXPORT Stream : public VolumeObject
Q_PROPERTY(QPulseAudio::Client *client READ client NOTIFY clientChanged)
Q_PROPERTY(bool virtualStream READ isVirtualStream NOTIFY virtualStreamChanged)
Q_PROPERTY(quint32 deviceIndex READ deviceIndex WRITE setDeviceIndex NOTIFY deviceIndexChanged)
+ Q_PROPERTY(bool corked READ isCorked NOTIFY corkedChanged)
public:
template <typename PAInfo>
void updateStream(const PAInfo *info)
@@ -68,12 +69,17 @@ public:
m_virtualStream = info->client == PA_INVALID_INDEX;
emit virtualStreamChanged();
}
+ if (m_corked != info->corked) {
+ m_corked = info->corked;
+ emit corkedChanged();
+ }
}
QString name() const;
Client *client() const;
bool isVirtualStream() const;
quint32 deviceIndex() const;
+ bool isCorked() const;
virtual void setDeviceIndex(quint32 deviceIndex) = 0;
@@ -82,6 +88,7 @@ signals:
void clientChanged();
void virtualStreamChanged();
void deviceIndexChanged();
+ void corkedChanged();
protected:
Stream(QObject *parent);
@@ -93,6 +100,7 @@ private:
QString m_name;
quint32 m_clientIndex;
bool m_virtualStream;
+ bool m_corked;
};
} // QPulseAudio