aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/snd/libkvisnd.cpp
diff options
context:
space:
mode:
authorGravatar Fabio Bas2008-07-01 11:09:32 +0000
committerGravatar Fabio Bas2008-07-01 11:09:32 +0000
commita0277f3d57a2bd16ab568f2527f8f7326c43229b (patch)
tree693453c558c492fad5f492cce6cf1939f9bdc973 /src/modules/snd/libkvisnd.cpp
parenttrayicon pics were missing at make install on win32 (diff)
downloadKVIrc-a0277f3d57a2bd16ab568f2527f8f7326c43229b.tar.gz
KVIrc-a0277f3d57a2bd16ab568f2527f8f7326c43229b.tar.bz2
KVIrc-a0277f3d57a2bd16ab568f2527f8f7326c43229b.zip
fix for phonon support (working on mingw32+mplayer backend :))
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@1974 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/snd/libkvisnd.cpp')
-rw-r--r--src/modules/snd/libkvisnd.cpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/modules/snd/libkvisnd.cpp b/src/modules/snd/libkvisnd.cpp
index 5293cfa2f..d6208d6d1 100644
--- a/src/modules/snd/libkvisnd.cpp
+++ b/src/modules/snd/libkvisnd.cpp
@@ -44,7 +44,8 @@
#else //!COMPILE_KDE_SUPPORT
#include <phonon>
#endif //!COMPILE_KDE_SUPPORT
- Phonon::MediaObject * g_pPhononPlayer=0;
+ Phonon::MediaObject * g_pPhononPlayer=0;
+ #include <QUrl>
#endif //!COMPILE_PHONON_SUPPORT
#if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW)
@@ -179,7 +180,7 @@ bool KviSoundPlayer::event(QEvent * e)
void KviSoundPlayer::detectSoundSystem()
{
#ifdef COMPILE_PHONON_SUPPORT
- if(!g_pPhononPlayer) g_pPhononPlayer= Phonon::createPlayer(Phonon::NotificationCategory);
+ if(!g_pPhononPlayer) g_pPhononPlayer= Phonon::createPlayer(Phonon::MusicCategory);
if(g_pPhononPlayer->state()!=Phonon::ErrorState) KVI_OPTION_STRING(KviOption_stringSoundSystem) = "phonon";
return;
#endif
@@ -229,9 +230,13 @@ void KviSoundPlayer::detectSoundSystem()
#ifdef COMPILE_PHONON_SUPPORT
bool KviSoundPlayer::playPhonon(const QString &szFileName)
{
- if(isMuted()) return true;
- g_pPhononPlayer->setCurrentSource(szFileName);
- g_pPhononPlayer->play();
+ if(isMuted()) return true;
+ if(!g_pPhononPlayer) g_pPhononPlayer= Phonon::createPlayer(Phonon::MusicCategory);
+ if(g_pPhononPlayer->state()!=Phonon::ErrorState)
+ {
+ g_pPhononPlayer->setCurrentSource(QUrl(szFileName));
+ g_pPhononPlayer->play();
+ }
return true;
}
#endif //!COMPILE_PHONON_SUPPORT
@@ -585,8 +590,13 @@ void KviSoundThread::run()
KviPhononSoundThread::KviPhononSoundThread(const QString &szFileName)
: KviSoundThread(szFileName)
{
- if(!g_pPhononPlayer) g_pPhononPlayer = Phonon::createPlayer(szFileName);
- else g_pPhononPlayer->setCurrentSource(szFileName);
+ if(!g_pPhononPlayer)
+ {
+ g_pPhononPlayer = Phonon::createPlayer(Phonon::MusicCategory);
+ } else {
+ if(g_pPhononPlayer->state()!=Phonon::ErrorState)
+ g_pPhononPlayer->setCurrentSource(QUrl(szFileName));
+ }
}
KviPhononSoundThread::~KviPhononSoundThread()