VirtualBox

Ignore:
Timestamp:
Feb 23, 2009 12:37:31 PM (16 years ago)
Author:
vboxsync
Message:

Main: Select appropriate default audio driver on linux.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/AudioAdapterImpl.cpp

    r16588 r17013  
    2525
    2626#include <iprt/cpputils.h>
     27#include <iprt/ldr.h>
     28#include <iprt/process.h>
    2729
    2830#include <VBox/settings.h>
     
    329331// public methods only for internal purposes
    330332/////////////////////////////////////////////////////////////////////////////
     333
     334AudioAdapter::Data::Data()
     335{
     336    /* Generic defaults */
     337    mEnabled = false;
     338    mAudioController = AudioControllerType_AC97;
     339    /* Driver defaults which are OS specific */
     340#if defined (RT_OS_WINDOWS)
     341# ifdef VBOX_WITH_WINMM
     342    mAudioDriver = AudioDriverType_WinMM;
     343# else /* VBOX_WITH_WINMM */
     344    mAudioDriver = AudioDriverType_DirectSound;
     345# endif /* !VBOX_WITH_WINMM */
     346#elif defined (RT_OS_SOLARIS)
     347    mAudioDriver = AudioDriverType_SolAudio;
     348#elif defined (RT_OS_LINUX)
     349# if defined (VBOX_WITH_PULSE)
     350    /* Check for the pulse library & that the pulse audio daemon is running. */
     351    if (RTLdrIsLoadable ("libpulse.so.0") &&
     352        RTProcIsRunningByName ("pulseaudio"))
     353        mAudioDriver = AudioDriverType_Pulse;
     354    else
     355# endif /* VBOX_WITH_PULSE */
     356# if defined (VBOX_WITH_ALSA)
     357        /* Check if we can load the ALSA library */
     358        if (RTLdrIsLoadable ("libasound.so.2"))
     359            mAudioDriver = AudioDriverType_ALSA;
     360        else
     361# endif /* VBOX_WITH_ALSA */
     362            mAudioDriver = AudioDriverType_OSS;
     363#elif defined (RT_OS_DARWIN)
     364    mAudioDriver = AudioDriverType_CoreAudio;
     365#elif defined (RT_OS_OS2)
     366    mAudioDriver = AudioDriverType_MMP;;
     367#else
     368    mAudioDriver = AudioDriverType_Null;
     369#endif
     370}
    331371
    332372/**
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette