diff options
| author | 2009-05-07 19:24:05 +0000 | |
|---|---|---|
| committer | 2009-05-07 19:24:05 +0000 | |
| commit | 04d34254b411b3e56a945e331ac6179b228f0315 (patch) | |
| tree | 2d815c5ddffa29b2253d6c7995cf216f4b184b05 | |
| parent | missed 3 files in previous commit (diff) | |
| download | KVIrc-04d34254b411b3e56a945e331ac6179b228f0315.tar.gz KVIrc-04d34254b411b3e56a945e331ac6179b228f0315.tar.bz2 KVIrc-04d34254b411b3e56a945e331ac6179b228f0315.zip | |
Cleaned up a bit phonon support
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@3197 17fca916-40b9-46aa-a4ea-0a15b648b75c
| -rw-r--r-- | src/modules/snd/libkvisnd.cpp | 33 |
1 files changed, 5 insertions, 28 deletions
diff --git a/src/modules/snd/libkvisnd.cpp b/src/modules/snd/libkvisnd.cpp index c6eac4f82..a03158c0c 100644 --- a/src/modules/snd/libkvisnd.cpp +++ b/src/modules/snd/libkvisnd.cpp @@ -89,7 +89,6 @@ 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) @@ -120,7 +119,10 @@ KviSoundPlayer::~KviSoundPlayer() KviThreadManager::killPendingEvents(this); delete m_pSoundSystemDict; - //TODO cleck g_pPhononPlayer cleaning +#ifdef COMPILE_PHONON_SUPPORT + if(g_pPhononPlayer) + g_pPhononPlayer->deleteLater(); +#endif g_pSoundPlayer = 0; } @@ -205,7 +207,7 @@ void KviSoundPlayer::detectSoundSystem() bool KviSoundPlayer::playPhonon(const QString &szFileName) { if(isMuted()) return true; - if(!g_pPhononPlayer) g_pPhononPlayer= Phonon::createPlayer(Phonon::MusicCategory); + if(!g_pPhononPlayer) g_pPhononPlayer= Phonon::createPlayer(Phonon::NotificationCategory); if(g_pPhononPlayer->state()!=Phonon::ErrorState) { g_pPhononPlayer->setCurrentSource(QUrl(szFileName)); @@ -527,31 +529,6 @@ void KviSoundThread::run() } #endif //COMPILE_ESD_SUPPORT - - #ifdef COMPILE_PHONON_SUPPORT - - KviPhononSoundThread::KviPhononSoundThread(const QString &szFileName) - : KviSoundThread(szFileName) - { - if(!g_pPhononPlayer) - { - g_pPhononPlayer = Phonon::createPlayer(Phonon::MusicCategory); - } else { - if(g_pPhononPlayer->state()!=Phonon::ErrorState) - g_pPhononPlayer->setCurrentSource(QUrl(szFileName)); - } - } - - KviPhononSoundThread::~KviPhononSoundThread() - { - } - - void KviPhononSoundThread::play() - { - g_pPhononPlayer->play(); - } - #endif //!COMPILE_PHONON_SUPPORT - #endif //!COMPILE_ON_WINDOWS |
