summaryrefslogtreecommitdiffstats
path: root/src/plugins/qnx-audio/audio/qnxaudiooutput.h
diff options
context:
space:
mode:
authorJames McDonnell <jmcdonnell@blackberry.com>2017-03-24 11:34:30 -0400
committerJames McDonnell <jmcdonnell@blackberry.com>2017-03-27 19:04:01 +0000
commit883df8dfda760fdbe850303383ba098887abbf62 (patch)
tree1839f3e9aa41e97217795ac83242a9eb70191da7 /src/plugins/qnx-audio/audio/qnxaudiooutput.h
parent1221f6a7e3767e14d2afdfc806120953bd6535be (diff)
io-audio based audio management for QNX 7.0.0
Add code to setup and handle io-audio based audio management notifications. Add InterruptedState to QAudio::State. Indicates that this stream is in a suspended state because another higher priority stream currently has control of the audio device. Playback cannot resume until the higher priority stream relinquishes control of the audio device. Adjust the documentation for QAudio::State SuspendedState to reflect the fact that audio management events can also put the stream into this state. Add InterruptedState handling to the spectrum example. Change-Id: Ie8616af03ae4c503de1d0571a222e5853035cc0e Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
Diffstat (limited to 'src/plugins/qnx-audio/audio/qnxaudiooutput.h')
-rw-r--r--src/plugins/qnx-audio/audio/qnxaudiooutput.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/plugins/qnx-audio/audio/qnxaudiooutput.h b/src/plugins/qnx-audio/audio/qnxaudiooutput.h
index c4fe37516..85aadf4b9 100644
--- a/src/plugins/qnx-audio/audio/qnxaudiooutput.h
+++ b/src/plugins/qnx-audio/audio/qnxaudiooutput.h
@@ -45,6 +45,7 @@
#include <QTime>
#include <QTimer>
#include <QIODevice>
+#include <QSocketNotifier>
#include <sys/asoundlib.h>
#include <sys/neutrino.h>
@@ -93,8 +94,14 @@ private:
void setError(QAudio::Error error);
void setState(QAudio::State state);
+ void addPcmEventFilter();
+ void createPcmNotifiers();
+ void destroyPcmNotifiers();
void setTypeName(snd_pcm_channel_params_t *params);
+ void suspendInternal(QAudio::State suspendState);
+ void resumeInternal();
+
friend class QnxPushIODevice;
qint64 write(const char *data, qint64 len);
@@ -115,6 +122,13 @@ private:
QTime m_startTimeStamp;
QTime m_intervalTimeStamp;
qint64 m_intervalOffset;
+
+#if _NTO_VERSION >= 700
+ QSocketNotifier *m_pcmNotifier;
+
+private slots:
+ void pcmNotifierActivated(int socket);
+#endif
};
class QnxPushIODevice : public QIODevice