VirtualBox

Changeset 95364 in vbox for trunk/src/VBox/Main/xml


Ignore:
Timestamp:
Jun 24, 2022 4:51:21 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
151958
Message:

Main/FE: Added new audio driver type "default" to make it possible to move VMs (appliances) between different platforms without the need of changing the audio driver explicitly. When the "default" driver is selected, the best audio backend option for a platform will be used.

While at it, also added the "WAS" (Windows Audio Session) driver type for which we only had a hack so far. This now can be explicitly selected, also by the frontends. bugref:10051

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/xml/Settings.cpp

    r95338 r95364  
    46054605        // settings before 1.3 used lower case so make sure this is case-insensitive
    46064606        strTemp.toUpper();
    4607         if (strTemp == "NULL")
     4607        if (strTemp == "DEFAULT")
     4608            aa.driverType = AudioDriverType_Default;
     4609        else if (strTemp == "NULL")
    46084610            aa.driverType = AudioDriverType_Null;
     4611        else if (strTemp == "WAS")
     4612            aa.driverType = AudioDriverType_WAS;
    46094613        else if (strTemp == "WINMM")
    46104614            aa.driverType = AudioDriverType_WinMM;
     
    46214625        else if (strTemp == "COREAUDIO")
    46224626            aa.driverType = AudioDriverType_CoreAudio;
    4623         else if (strTemp == "MMPM")
     4627        else if (strTemp == "MMPM") /* Deprecated; only kept for backwards compatibility. */
    46244628            aa.driverType = AudioDriverType_MMPM;
    46254629        else
     
    73147318        switch (hw.audioAdapter.driverType)
    73157319        {
     7320            case AudioDriverType_Default: pcszDriver = "Default"; break;
    73167321            case AudioDriverType_WinMM: pcszDriver = "WinMM"; break;
    73177322            case AudioDriverType_DirectSound: pcszDriver = "DirectSound"; break;
     7323            case AudioDriverType_WAS: pcszDriver = "WAS"; break;
     7324            case AudioDriverType_ALSA: pcszDriver = "ALSA"; break;
     7325            case AudioDriverType_OSS: pcszDriver = "OSS"; break;
     7326            case AudioDriverType_Pulse: pcszDriver = "Pulse"; break;
     7327            case AudioDriverType_CoreAudio: pcszDriver = "CoreAudio"; break;
    73187328            case AudioDriverType_SolAudio: pcszDriver = "SolAudio"; break;
    7319             case AudioDriverType_ALSA: pcszDriver = "ALSA"; break;
    7320             case AudioDriverType_Pulse: pcszDriver = "Pulse"; break;
    7321             case AudioDriverType_OSS: pcszDriver = "OSS"; break;
    7322             case AudioDriverType_CoreAudio: pcszDriver = "CoreAudio"; break;
    73237329            case AudioDriverType_MMPM: pcszDriver = "MMPM"; break;
    73247330            default: /*case AudioDriverType_Null:*/ pcszDriver = "Null"; break;
     
    82368242 * the current host platform. For example, this would return false
    82378243 * for AudioDriverType_DirectSound when compiled on a Linux host.
    8238  * @param drv AudioDriverType_* enum to test.
    8239  * @return true only if the current host supports that driver.
     8244 *
     8245*  @return \c true if the current host supports the driver, \c false if not.
     8246 * @param enmDrvType            AudioDriverType_* enum to test.
    82408247 */
    82418248/*static*/
    8242 bool MachineConfigFile::isAudioDriverAllowedOnThisHost(AudioDriverType_T drv)
    8243 {
    8244     switch (drv)
    8245     {
     8249bool MachineConfigFile::isAudioDriverAllowedOnThisHost(AudioDriverType_T enmDrvType)
     8250{
     8251    switch (enmDrvType)
     8252    {
     8253        case AudioDriverType_Default:
     8254            RT_FALL_THROUGH();
    82468255        case AudioDriverType_Null:
    82478256#ifdef RT_OS_WINDOWS
     8257        case AudioDriverType_WAS:
     8258            /* We only support WAS on systems we tested so far (Vista+). */
     8259            if (RTSystemGetNtVersion() < RTSYSTEM_MAKE_NT_VERSION(6,1,0))
     8260                break;
     8261            RT_FALL_THROUGH();
    82488262        case AudioDriverType_DirectSound:
    82498263#endif
     
    82758289 * or ALSA are actually supported on the first call.
    82768290 *
     8291 * When more than one supported audio stack is available, choose the most suited
     8292 * (probably newest in most cases) one.
     8293 *
    82778294 * @return Default audio driver type for this host platform.
    82788295 */
     
    82818298{
    82828299#if defined(RT_OS_WINDOWS)
     8300    if (RTSystemGetNtVersion() >= RTSYSTEM_MAKE_NT_VERSION(6,1,0))
     8301        return AudioDriverType_WAS;
    82838302    return AudioDriverType_DirectSound;
    82848303
     
    83018320             if (RTLdrIsLoadable("libasound.so.2"))
    83028321                s_enmLinuxDriver = AudioDriverType_ALSA;
    8303         else
    83048322# endif /* VBOX_WITH_AUDIO_ALSA */
    8305             s_enmLinuxDriver = AudioDriverType_OSS;
     8323# ifdef VBOX_WITH_AUDIO_OSS
     8324             else
     8325                s_enmLinuxDriver = AudioDriverType_OSS;
     8326# endif /* VBOX_WITH_AUDIO_OSS */
    83068327    }
    83078328    return s_enmLinuxDriver;
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