Changeset 20260 in vbox
- Timestamp:
- Jun 4, 2009 10:12:12 AM (16 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/AudioAdapterImpl.cpp
r19058 r20260 63 63 AssertReturn (autoInitSpan.isOk(), E_FAIL); 64 64 65 /* Get the default audio driver out of the system properties */ 66 ComPtr<IVirtualBox> VBox; 67 HRESULT rc = aParent->COMGETTER(Parent)(VBox.asOutParam()); 68 if (FAILED(rc)) return rc; 69 ComPtr<ISystemProperties> sysProps; 70 rc = VBox->COMGETTER(SystemProperties)(sysProps.asOutParam()); 71 if (FAILED(rc)) return rc; 72 AudioDriverType_T defaultAudioDriver; 73 rc = sysProps->COMGETTER(DefaultAudioDriver)(&defaultAudioDriver); 74 if (FAILED(rc)) return rc; 75 65 76 unconst (mParent) = aParent; 66 77 /* mPeer is left null */ 67 78 68 79 mData.allocate(); 80 mData->mAudioDriver = defaultAudioDriver; 69 81 70 82 /* Confirm a successful initialization */ … … 339 351 mEnabled = false; 340 352 mAudioController = AudioControllerType_AC97; 341 /* Driver defaults which are OS specific */ 342 #if defined (RT_OS_WINDOWS) 343 # ifdef VBOX_WITH_WINMM 344 mAudioDriver = AudioDriverType_WinMM; 345 # else /* VBOX_WITH_WINMM */ 346 mAudioDriver = AudioDriverType_DirectSound; 347 # endif /* !VBOX_WITH_WINMM */ 348 #elif defined (RT_OS_SOLARIS) 349 mAudioDriver = AudioDriverType_SolAudio; 350 #elif defined (RT_OS_LINUX) 351 # if defined (VBOX_WITH_PULSE) 352 /* Check for the pulse library & that the pulse audio daemon is running. */ 353 if (RTProcIsRunningByName ("pulseaudio") && 354 RTLdrIsLoadable ("libpulse.so.0")) 355 mAudioDriver = AudioDriverType_Pulse; 356 else 357 # endif /* VBOX_WITH_PULSE */ 358 # if defined (VBOX_WITH_ALSA) 359 /* Check if we can load the ALSA library */ 360 if (RTLdrIsLoadable ("libasound.so.2")) 361 mAudioDriver = AudioDriverType_ALSA; 362 else 363 # endif /* VBOX_WITH_ALSA */ 364 mAudioDriver = AudioDriverType_OSS; 365 #elif defined (RT_OS_DARWIN) 366 mAudioDriver = AudioDriverType_CoreAudio; 367 #elif defined (RT_OS_OS2) 368 mAudioDriver = AudioDriverType_MMP; 369 #elif defined (RT_OS_FREEBSD) 370 mAudioDriver = AudioDriverType_OSS; 371 #else 353 /* Driver defaults to the null audio driver */ 372 354 mAudioDriver = AudioDriverType_Null; 373 #endif374 355 } 375 356 -
trunk/src/VBox/Main/SystemPropertiesImpl.cpp
r19727 r20260 32 32 #include <iprt/path.h> 33 33 #include <iprt/dir.h> 34 #include <iprt/process.h> 34 35 35 36 #include <VBox/err.h> … … 113 114 } 114 115 116 /* Driver defaults which are OS specific */ 117 #if defined (RT_OS_WINDOWS) 118 # ifdef VBOX_WITH_WINMM 119 mDefaultAudioDriver = AudioDriverType_WinMM; 120 # else /* VBOX_WITH_WINMM */ 121 mDefaultAudioDriver = AudioDriverType_DirectSound; 122 # endif /* !VBOX_WITH_WINMM */ 123 #elif defined (RT_OS_SOLARIS) 124 mDefaultAudioDriver = AudioDriverType_SolAudio; 125 #elif defined (RT_OS_LINUX) 126 # if defined (VBOX_WITH_PULSE) 127 /* Check for the pulse library & that the pulse audio daemon is running. */ 128 if (RTProcIsRunningByName ("pulseaudio") && 129 RTLdrIsLoadable ("libpulse.so.0")) 130 mDefaultAudioDriver = AudioDriverType_Pulse; 131 else 132 # endif /* VBOX_WITH_PULSE */ 133 # if defined (VBOX_WITH_ALSA) 134 /* Check if we can load the ALSA library */ 135 if (RTLdrIsLoadable ("libasound.so.2")) 136 mDefaultAudioDriver = AudioDriverType_ALSA; 137 else 138 # endif /* VBOX_WITH_ALSA */ 139 mDefaultAudioDriver = AudioDriverType_OSS; 140 #elif defined (RT_OS_DARWIN) 141 mDefaultAudioDriver = AudioDriverType_CoreAudio; 142 #elif defined (RT_OS_OS2) 143 mDefaultAudioDriver = AudioDriverType_MMP; 144 #elif defined (RT_OS_FREEBSD) 145 mDefaultAudioDriver = AudioDriverType_OSS; 146 #else 147 mDefaultAudioDriver = AudioDriverType_Null; 148 #endif 149 115 150 /* Confirm a successful initialization */ 116 151 if (SUCCEEDED (rc)) … … 540 575 } 541 576 577 STDMETHODIMP SystemProperties::COMGETTER(DefaultAudioDriver) (AudioDriverType_T *aAudioDriver) 578 { 579 if (!aAudioDriver) 580 return E_POINTER; 581 582 AutoCaller autoCaller (this); 583 CheckComRCReturnRC (autoCaller.rc()); 584 585 AutoReadLock alock (this); 586 587 *aAudioDriver = mDefaultAudioDriver; 588 589 return S_OK; 590 } 591 542 592 // public methods only for internal purposes 543 593 ///////////////////////////////////////////////////////////////////////////// -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r20220 r20260 7491 7491 name="ISystemProperties" 7492 7492 extends="$unknown" 7493 uuid=" 0760e03f-06d0-481e-9f81-be43fef092ba"7493 uuid="63bfd184-df69-4949-9159-a923cf7b1207" 7494 7494 wsmap="managed" 7495 7495 > … … 7756 7756 This value specifies how many old release log files are kept. 7757 7757 </desc> 7758 </attribute> 7759 7760 <attribute name="defaultAudioDriver" type="AudioDriverType" readonly="yes"> 7761 <desc>This value hold the default audio driver for the current 7762 system.</desc> 7758 7763 </attribute> 7759 7764 </interface> -
trunk/src/VBox/Main/include/SystemPropertiesImpl.h
r19239 r20260 93 93 STDMETHOD(COMGETTER(LogHistoryCount)) (ULONG *count); 94 94 STDMETHOD(COMSETTER(LogHistoryCount)) (ULONG count); 95 STDMETHOD(COMGETTER(DefaultAudioDriver)) (AudioDriverType_T *aAudioDriver); 95 96 96 97 // public methods only for internal purposes … … 144 145 BOOL mHWVirtExEnabled; 145 146 ULONG mLogHistoryCount; 147 AudioDriverType_T mDefaultAudioDriver; 146 148 }; 147 149
Note:
See TracChangeset
for help on using the changeset viewer.