[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdemultimedia/phonon-xine
From:       Matthias Kretz <kretz () kde ! org>
Date:       2007-06-16 21:11:05
Message-ID: 1182028265.806820.20776.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 676420 by mkretz:

implement operator<<(kdbgstream &, Phonon::State) for nicer debug output

 M  +40 -6     xineengine.h  


--- trunk/KDE/kdemultimedia/phonon-xine/xineengine.h #676419:676420
@@ -21,13 +21,18 @@
 #ifndef XINEENGINE_H
 #define XINEENGINE_H
 
+#include <QtCore/QEvent>
+#include <QtCore/QSet>
+#include <QtCore/QSize>
+#include <QtCore/QString>
+#include <QtCore/QStringList>
+
+#include <Phonon/Global>
+
+#include <KDebug>
+#include <KSharedConfig>
+
 #include <xine.h>
-#include <QEvent>
-#include <QString>
-#include <QSet>
-#include <QStringList>
-#include <ksharedconfig.h>
-#include <QSize>
 
 namespace Phonon
 {
@@ -136,5 +141,34 @@
 }
 }
 
+/**
+ * Implements needed operator to use Phonon::State with kDebug
+ */
+inline kdbgstream &operator<<(kdbgstream &stream, const Phonon::State state)
+{
+    switch(state)
+    {
+    case Phonon::ErrorState:
+        stream << "ErrorState";
+        break;
+    case Phonon::LoadingState:
+        stream << "LoadingState";
+        break;
+    case Phonon::StoppedState:
+        stream << "StoppedState";
+        break;
+    case Phonon::PlayingState:
+        stream << "PlayingState";
+        break;
+    case Phonon::BufferingState:
+        stream << "BufferingState";
+        break;
+    case Phonon::PausedState:
+        stream << "PausedState";
+        break;
+    }
+    return stream;
+}
+
 #endif // XINEENGINE_H
 // vim: sw=4 ts=4 tw=80 et
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic