Changeset 89281 in vbox for trunk/src/VBox/Main/src-client
- Timestamp:
- May 25, 2021 5:00:06 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 144627
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r89098 r89281 3020 3020 3021 3021 #ifdef VBOX_WITH_AUDIO_VALIDATIONKIT 3022 GetExtraDataBoth(virtualBox, pMachine, "VBoxInternal2/Audio/VaKit/Enabled", &strTmp); 3023 const bool fVaKitEnabled = strTmp.equalsIgnoreCase("true") || strTmp.equalsIgnoreCase("1"); 3022 GetExtraDataBoth(virtualBox, pMachine, "VBoxInternal2/Audio/VaKit/Enabled", &strTmp); /* Deprecated; do not use! */ 3023 if (strTmp.isEmpty()) 3024 GetExtraDataBoth(virtualBox, pMachine, "VBoxInternal2/Audio/ValKit/Enabled", &strTmp); 3025 const bool fValKitEnabled = strTmp.equalsIgnoreCase("true") || strTmp.equalsIgnoreCase("1"); 3024 3026 #endif 3025 3027 /** @todo Implement an audio device class, similar to the audio backend class, to construct the common stuff … … 3146 3148 * The audio driver. 3147 3149 */ 3148 AudioDriverType_T enmAudioDriver; 3149 hrc = audioAdapter->COMGETTER(AudioDriver)(&enmAudioDriver); H(); 3150 const char *pszAudioDriver; 3151 switch (enmAudioDriver) 3152 { 3153 case AudioDriverType_Null: 3154 pszAudioDriver = "NullAudio"; 3155 break; 3150 const char *pszAudioDriver = NULL; 3151 #ifdef VBOX_WITH_AUDIO_VALIDATIONKIT 3152 if (fValKitEnabled) 3153 { 3154 pszAudioDriver = "ValidationKitAudio"; 3155 LogRel(("Audio: ValidationKit driver active\n")); 3156 } 3157 #endif 3158 /* If nothing else was selected before, ask the API. */ 3159 if (pszAudioDriver == NULL) 3160 { 3161 AudioDriverType_T enmAudioDriver; 3162 hrc = audioAdapter->COMGETTER(AudioDriver)(&enmAudioDriver); H(); 3163 switch (enmAudioDriver) 3164 { 3165 case AudioDriverType_Null: 3166 pszAudioDriver = "NullAudio"; 3167 break; 3156 3168 #ifdef RT_OS_WINDOWS 3157 3169 # ifdef VBOX_WITH_WINMM 3158 case AudioDriverType_WinMM:3170 case AudioDriverType_WinMM: 3159 3171 # error "Port WinMM audio backend!" /** @todo Still needed? */ 3160 break;3172 break; 3161 3173 # endif 3162 case AudioDriverType_DirectSound:3163 /* Use the windows audio session (WAS) API rather than Direct Sound on windows3164 versions we've tested it on (currently W10+). Since Vista, Direct Sound has3165 been emulated on top of WAS according to the docs, so better use WAS directly. */3166 pszAudioDriver = "DSoundAudio";3167 if (RTSystemGetNtVersion() >= RTSYSTEM_MAKE_NT_VERSION(10,0,0))3168 pszAudioDriver = "HostAudioWas";3169 break;3174 case AudioDriverType_DirectSound: 3175 /* Use the windows audio session (WAS) API rather than Direct Sound on windows 3176 versions we've tested it on (currently W10+). Since Vista, Direct Sound has 3177 been emulated on top of WAS according to the docs, so better use WAS directly. */ 3178 pszAudioDriver = "DSoundAudio"; 3179 if (RTSystemGetNtVersion() >= RTSYSTEM_MAKE_NT_VERSION(10,0,0)) 3180 pszAudioDriver = "HostAudioWas"; 3181 break; 3170 3182 #endif /* RT_OS_WINDOWS */ 3171 3183 #ifdef RT_OS_SOLARIS 3172 case AudioDriverType_SolAudio:3173 /* Should not happen, as the Solaris Audio backend is not around anymore.3174 * Remove this sometime later. */3175 LogRel(("Audio: WARNING: Solaris Audio is deprecated, please switch to OSS!\n"));3176 LogRel(("Audio: Automatically setting host audio backend to OSS\n"));3177 3178 /* Manually set backend to OSS for now. */3179 pszAudioDriver = "OSSAudio";3180 break;3184 case AudioDriverType_SolAudio: 3185 /* Should not happen, as the Solaris Audio backend is not around anymore. 3186 * Remove this sometime later. */ 3187 LogRel(("Audio: WARNING: Solaris Audio is deprecated, please switch to OSS!\n")); 3188 LogRel(("Audio: Automatically setting host audio backend to OSS\n")); 3189 3190 /* Manually set backend to OSS for now. */ 3191 pszAudioDriver = "OSSAudio"; 3192 break; 3181 3193 #endif 3182 3194 #ifdef VBOX_WITH_AUDIO_OSS 3183 case AudioDriverType_OSS:3184 pszAudioDriver = "OSSAudio";3185 break;3195 case AudioDriverType_OSS: 3196 pszAudioDriver = "OSSAudio"; 3197 break; 3186 3198 #endif 3187 3199 #ifdef VBOX_WITH_AUDIO_ALSA 3188 case AudioDriverType_ALSA:3189 pszAudioDriver = "ALSAAudio";3190 break;3200 case AudioDriverType_ALSA: 3201 pszAudioDriver = "ALSAAudio"; 3202 break; 3191 3203 #endif 3192 3204 #ifdef VBOX_WITH_AUDIO_PULSE 3193 case AudioDriverType_Pulse:3194 pszAudioDriver = "PulseAudio";3195 break;3205 case AudioDriverType_Pulse: 3206 pszAudioDriver = "PulseAudio"; 3207 break; 3196 3208 #endif 3197 3209 #ifdef RT_OS_DARWIN 3198 case AudioDriverType_CoreAudio:3199 pszAudioDriver = "CoreAudio";3200 break;3210 case AudioDriverType_CoreAudio: 3211 pszAudioDriver = "CoreAudio"; 3212 break; 3201 3213 #endif 3202 default: 3203 pszAudioDriver = "oops"; 3204 AssertFailedBreak(); 3214 default: 3215 pszAudioDriver = "oops"; 3216 AssertFailedBreak(); 3217 } 3205 3218 } 3206 3219 … … 3253 3266 LogRel(("Audio: Setting debug logging failed, rc=%Rrc\n", rc)); 3254 3267 } 3255 3256 #ifdef VBOX_WITH_AUDIO_VALIDATIONKIT3257 if (fVaKitEnabled)3258 {3259 /*3260 * The ValidationKit backend.3261 */3262 InsertConfigNodeF(pInst, &pLunL0, "LUN#%u", idxAudioLun);3263 i_configAudioDriver(audioAdapter, virtualBox, pMachine, pLunL0, "ValidationKitAudio");3264 idxAudioLun++;3265 3266 LogRel(("Audio: ValidationKit driver active\n"));3267 }3268 #endif /* VBOX_WITH_AUDIO_VALIDATIONKIT */3269 3268 } 3270 3269
Note:
See TracChangeset
for help on using the changeset viewer.