aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Voker572008-08-04 16:54:26 +0000
committerGravatar Voker572008-08-04 16:54:26 +0000
commit8c981bff3219e5ebe3f0aa96af657dbb77d2fba2 (patch)
tree5b95195c1563ece0fd18b5594117ea9b4d561268 /src
parentfixed the second part of #196 (diff)
downloadKVIrc-8c981bff3219e5ebe3f0aa96af657dbb77d2fba2.tar.gz
KVIrc-8c981bff3219e5ebe3f0aa96af657dbb77d2fba2.tar.bz2
KVIrc-8c981bff3219e5ebe3f0aa96af657dbb77d2fba2.zip
Added Phonon cmake module from KDE4, now using it.
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@2177 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src')
-rw-r--r--src/modules/snd/CMakeLists.txt2
-rw-r--r--src/modules/snd/libkvisnd.cpp32
2 files changed, 16 insertions, 18 deletions
diff --git a/src/modules/snd/CMakeLists.txt b/src/modules/snd/CMakeLists.txt
index fcb3c60b0..6e287b597 100644
--- a/src/modules/snd/CMakeLists.txt
+++ b/src/modules/snd/CMakeLists.txt
@@ -1,5 +1,7 @@
# CMakeLists for src/modules/snd
+INCLUDE_DIRECTORIES(${PHONON_INCLUDE_DIR})
+
IF(WIN32)
LIST(APPEND LIBS -lwinmm)
ENDIF()
diff --git a/src/modules/snd/libkvisnd.cpp b/src/modules/snd/libkvisnd.cpp
index d6208d6d1..4152f59f6 100644
--- a/src/modules/snd/libkvisnd.cpp
+++ b/src/modules/snd/libkvisnd.cpp
@@ -37,15 +37,10 @@
#include <QSound>
#ifdef COMPILE_PHONON_SUPPORT
- #ifdef COMPILE_KDE_SUPPORT
- #include <Phonon/MediaObject>
- #include <Phonon/Path>
- #include <Phonon/Global>
- #else //!COMPILE_KDE_SUPPORT
- #include <phonon>
- #endif //!COMPILE_KDE_SUPPORT
- Phonon::MediaObject * g_pPhononPlayer=0;
- #include <QUrl>
+ #include <phonon/mediaobject.h>
+ #include <phonon/path.h>
+ Phonon::MediaObject * g_pPhononPlayer=0;
+ #include <QUrl>
#endif //!COMPILE_PHONON_SUPPORT
#if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW)
@@ -98,6 +93,7 @@ KviSoundPlayer::KviSoundPlayer()
m_pSoundSystemDict = new KviPointerHashTable<QString,SoundSystemRoutine>(17,false);
m_pSoundSystemDict->setAutoDelete(true);
#ifdef COMPILE_PHONON_SUPPORT
+ qDebug("Inserting phonon");
m_pSoundSystemDict->insert("phonon",new SoundSystemRoutine(KVI_PTR2MEMBER(KviSoundPlayer::playPhonon)));
#endif //!COMPILE_PHONON_SUPPORT
#if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW)
@@ -230,12 +226,12 @@ void KviSoundPlayer::detectSoundSystem()
#ifdef COMPILE_PHONON_SUPPORT
bool KviSoundPlayer::playPhonon(const QString &szFileName)
{
- if(isMuted()) return true;
+ if(isMuted()) return true;
if(!g_pPhononPlayer) g_pPhononPlayer= Phonon::createPlayer(Phonon::MusicCategory);
- if(g_pPhononPlayer->state()!=Phonon::ErrorState)
- {
+ if(g_pPhononPlayer->state()!=Phonon::ErrorState)
+ {
g_pPhononPlayer->setCurrentSource(QUrl(szFileName));
- g_pPhononPlayer->play();
+ g_pPhononPlayer->play();
}
return true;
}
@@ -590,12 +586,12 @@ void KviSoundThread::run()
KviPhononSoundThread::KviPhononSoundThread(const QString &szFileName)
: KviSoundThread(szFileName)
{
- if(!g_pPhononPlayer)
- {
+ if(!g_pPhononPlayer)
+ {
g_pPhononPlayer = Phonon::createPlayer(Phonon::MusicCategory);
- } else {
- if(g_pPhononPlayer->state()!=Phonon::ErrorState)
- g_pPhononPlayer->setCurrentSource(QUrl(szFileName));
+ } else {
+ if(g_pPhononPlayer->state()!=Phonon::ErrorState)
+ g_pPhononPlayer->setCurrentSource(QUrl(szFileName));
}
}