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

List:       kde-commits
Subject:    branches/work/kdelibs-phonon/phonon
From:       Matthias Kretz <kretz () kde ! org>
Date:       2006-01-28 19:34:24
Message-ID: 1138476864.135626.1123.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 503316 by mkretz:

add operator<< for kdDebug and Phonon::State
can somebody tell me why I get unresolved symbols when putting the
implementation into the cpp file instead of making it inline in the
header file?


 M  +1 -1      Makefile.am  
 A             state.cpp   [License: LGPL (v2)]
 M  +35 -3     state.h  


--- branches/work/kdelibs-phonon/phonon/Makefile.am #503315:503316
@@ -30,7 +30,7 @@
 		       backendcapabilities.h namedescriptiontuple.h audiosource.h \
 		       videosource.h
 
-libphononcore_la_SOURCES = object.cpp factory.cpp abstractmediaproducer.cpp mediaobject.cpp \
+libphononcore_la_SOURCES = state.cpp object.cpp factory.cpp abstractmediaproducer.cpp mediaobject.cpp \
 			  avcapture.cpp factory.skel \
 			  mixeriface.skel audiopath.cpp videopath.cpp \
 			  audiooutput.cpp abstractvideooutput.cpp \
--- branches/work/kdelibs-phonon/phonon/state.h #503315:503316
@@ -16,9 +16,10 @@
     Boston, MA 02110-1301, USA.
 
 */
-#ifndef Phonon_STATE_H
-#define Phonon_STATE_H
+#ifndef PHONON_STATE_H
+#define PHONON_STATE_H
 
+#include <kdelibs_export.h>
 namespace Phonon
 {
 	/**
@@ -62,5 +63,36 @@
 
 } //namespace Phonon
 
+class kdbgstream;
+#include <kdebug.h>
+/**
+ * Implements needed operator to use Phonon::State with kdDebug
+ */
+inline PHONON_EXPORT kdbgstream& operator<<( kdbgstream & stream, const Phonon::State state )
+{
+	switch( state )
+	{
+		case Phonon::ErrorState:
+			stream << "Error";
+			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;
+}
+
 // vim: sw=4 ts=4 tw=80 noet
-#endif // Phonon_STATE_H
+#endif // PHONON_STATE_H
[prev in list] [next in list] [prev in thread] [next in thread] 

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