diff options
| author | 2017-12-27 20:22:42 +0000 | |
|---|---|---|
| committer | 2017-12-27 20:22:42 +0000 | |
| commit | 582252f695587d3b9f67f1cee24315aff5f8ba2d (patch) | |
| tree | 96e5650359b5704fd46309b057dba22ecbdabcc6 /src | |
| parent | Workaround to vc_redist #2335 (#2336) (diff) | |
| download | KVIrc-582252f695587d3b9f67f1cee24315aff5f8ba2d.tar.gz KVIrc-582252f695587d3b9f67f1cee24315aff5f8ba2d.tar.bz2 KVIrc-582252f695587d3b9f67f1cee24315aff5f8ba2d.zip | |
Fix the sound system autodetection (#2278)
* Automatically detect a sound system during first startup.
Previously, the default system for Windows was "null".
* Remove phonon from the sound system autodetection list.
Our phonon detection code didn't work well, and "qt" is a safe
default for Linux.
Diffstat (limited to 'src')
| -rw-r--r-- | src/modules/setup/libkvisetup.cpp | 8 | ||||
| -rw-r--r-- | src/modules/snd/libkvisnd.cpp | 10 |
2 files changed, 8 insertions, 10 deletions
diff --git a/src/modules/setup/libkvisetup.cpp b/src/modules/setup/libkvisetup.cpp index 606ca9ac6..4c576e3a8 100644 --- a/src/modules/setup/libkvisetup.cpp +++ b/src/modules/setup/libkvisetup.cpp @@ -33,10 +33,13 @@ #include "KviWindow.h" #include "KviTheme.h" #include "KviIrcServerDataBase.h" +#include "KviModuleManager.h" #include <QString> #include <QFile> +extern KVIRC_API KviModuleManager * g_pModuleManager; + // this will be chosen during the setup process QString g_szChoosenIncomingDirectory; int g_iThemeToApply = THEME_APPLY_NONE; @@ -117,6 +120,11 @@ KVIMODULEEXPORTFUNC void setup_finish() delete pParams; KVI_OPTION_BOOL(KviOption_boolShowServersConnectDialogOnStart) = true; } + + // detect the most appropriate sound system + KviModule * m = g_pModuleManager->getModule("snd"); + if(m) + m->ctrl("detectSoundSystem", nullptr); } } diff --git a/src/modules/snd/libkvisnd.cpp b/src/modules/snd/libkvisnd.cpp index a324b91a9..92ea18fa6 100644 --- a/src/modules/snd/libkvisnd.cpp +++ b/src/modules/snd/libkvisnd.cpp @@ -210,16 +210,6 @@ bool KviSoundPlayer::event(QEvent * e) void KviSoundPlayer::detectSoundSystem() { -#ifdef COMPILE_PHONON_SUPPORT - // FIXME: Phonon seems to freeze on windows sometimes.. maybe it's better to auto-detect winmm ? - if(!m_pPhononPlayer) - m_pPhononPlayer = Phonon::createPlayer(Phonon::MusicCategory); - if(m_pPhononPlayer->state() != Phonon::ErrorState) - { - KVI_OPTION_STRING(KviOption_stringSoundSystem) = "phonon"; - return; - } -#endif #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) KVI_OPTION_STRING(KviOption_stringSoundSystem) = "winmm"; #else |
