summaryrefslogtreecommitdiffstats
path: root/src/multimedia/audio/qaudio.cpp
diff options
context:
space:
mode:
authorMichael Goddard <michael.goddard@nokia.com>2011-11-01 12:46:48 +1000
committerQt by Nokia <qt-info@nokia.com>2011-11-02 02:38:02 +0100
commit7dfb883df639f8d80cec7bd2c51eb37561bc4522 (patch)
tree96fd66844a9733a354d7890bd3d71ba6c326fe23 /src/multimedia/audio/qaudio.cpp
parent6a3a442ea6326ca5e94bd214ad4c88a9f9ec84f3 (diff)
Declare more metatypes and debug operators.
Nearly all of the multimedia metatypes used in the auto tests are now declared properly, and a large number of the types have debug operators as well. Removed the superfluous decls as well. Change-Id: I42cfe37562db0c71d9811b4577fc326a3326ccc9 Reviewed-by: Jonas Rabbe <jonas.rabbe@nokia.com>
Diffstat (limited to 'src/multimedia/audio/qaudio.cpp')
-rw-r--r--src/multimedia/audio/qaudio.cpp44
1 files changed, 43 insertions, 1 deletions
diff --git a/src/multimedia/audio/qaudio.cpp b/src/multimedia/audio/qaudio.cpp
index bb18f8448..610db2f35 100644
--- a/src/multimedia/audio/qaudio.cpp
+++ b/src/multimedia/audio/qaudio.cpp
@@ -41,7 +41,7 @@
#include <qaudio.h>
-
+#include <QDebug>
QT_BEGIN_NAMESPACE
@@ -98,6 +98,48 @@ public:
\value AudioInput audio input device
*/
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug dbg, QAudio::Error error)
+{
+ switch (error) {
+ case QAudio::NoError:
+ return dbg.nospace() << "NoError";
+ case QAudio::OpenError:
+ return dbg.nospace() << "OpenError";
+ case QAudio::IOError:
+ return dbg.nospace() << "IOError";
+ case QAudio::UnderrunError:
+ return dbg.nospace() << "UnderrunError";
+ case QAudio::FatalError:
+ return dbg.nospace() << "FatalError";
+ }
+}
+
+QDebug operator<<(QDebug dbg, QAudio::State state)
+{
+ switch (state) {
+ case QAudio::ActiveState:
+ return dbg.nospace() << "ActiveState";
+ case QAudio::SuspendedState:
+ return dbg.nospace() << "SuspendedState";
+ case QAudio::StoppedState:
+ return dbg.nospace() << "StoppedState";
+ case QAudio::IdleState:
+ return dbg.nospace() << "IdleState";
+ }
+}
+
+QDebug operator<<(QDebug dbg, QAudio::Mode mode)
+{
+ switch (mode) {
+ case QAudio::AudioInput:
+ return dbg.nospace() << "AudioInput";
+ case QAudio::AudioOutput:
+ return dbg.nospace() << "AudioOutput";
+ }
+}
+#endif
+
QT_END_NAMESPACE