VirtualBox

Ignore:
Timestamp:
Jul 20, 2010 4:53:40 PM (14 years ago)
Author:
vboxsync
Message:

Main: automatically fix host-specific audio drivers when loading machine settings

File:
1 edited

Legend:

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

    r30842 r30934  
    2929#include <iprt/path.h>
    3030#include <iprt/dir.h>
    31 #include <iprt/process.h>
    32 #include <iprt/ldr.h>
    3331#include <iprt/cpp/utils.h>
    3432
     
    117115        }
    118116    }
    119 
    120     /* Driver defaults which are OS specific */
    121 #if defined(RT_OS_WINDOWS)
    122 # ifdef VBOX_WITH_WINMM
    123     mDefaultAudioDriver = AudioDriverType_WinMM;
    124 # else /* VBOX_WITH_WINMM */
    125     mDefaultAudioDriver = AudioDriverType_DirectSound;
    126 # endif /* !VBOX_WITH_WINMM */
    127 #elif defined(RT_OS_SOLARIS)
    128     mDefaultAudioDriver = AudioDriverType_SolAudio;
    129 #elif defined(RT_OS_LINUX)
    130 # if defined(VBOX_WITH_PULSE)
    131     /* Check for the pulse library & that the pulse audio daemon is running. */
    132     if (RTProcIsRunningByName("pulseaudio") &&
    133         RTLdrIsLoadable("libpulse.so.0"))
    134         mDefaultAudioDriver = AudioDriverType_Pulse;
    135     else
    136 # endif /* VBOX_WITH_PULSE */
    137 # if defined(VBOX_WITH_ALSA)
    138         /* Check if we can load the ALSA library */
    139         if (RTLdrIsLoadable("libasound.so.2"))
    140             mDefaultAudioDriver = AudioDriverType_ALSA;
    141         else
    142 # endif /* VBOX_WITH_ALSA */
    143             mDefaultAudioDriver = AudioDriverType_OSS;
    144 #elif defined(RT_OS_DARWIN)
    145     mDefaultAudioDriver = AudioDriverType_CoreAudio;
    146 #elif defined(RT_OS_OS2)
    147     mDefaultAudioDriver = AudioDriverType_MMP;
    148 #elif defined(RT_OS_FREEBSD)
    149     mDefaultAudioDriver = AudioDriverType_OSS;
    150 #else
    151     mDefaultAudioDriver = AudioDriverType_Null;
    152 #endif
    153117
    154118    /* Confirm a successful initialization */
     
    805769    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    806770
    807     *aAudioDriver = mDefaultAudioDriver;
     771    *aAudioDriver = settings::MachineConfigFile::getHostDefaultAudioDriver();
    808772
    809773    return S_OK;
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