Changeset 56459 in vbox for trunk/src/VBox/Main/src-server
- Timestamp:
- Jun 16, 2015 4:24:14 PM (10 years ago)
- Location:
- trunk/src/VBox/Main/src-server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/AudioAdapterImpl.cpp
r56096 r56459 39 39 AudioDriverType_T mAudioDriver; 40 40 AudioControllerType_T mAudioController; 41 AudioCodecType_T mAudioCodec; 41 42 settings::StringsMap properties; 42 43 }; … … 348 349 } 349 350 351 HRESULT AudioAdapter::getAudioCodec(AudioCodecType_T *aAudioCodec) 352 { 353 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 354 355 *aAudioCodec = mData->m->mAudioCodec; 356 357 return S_OK; 358 } 359 360 HRESULT AudioAdapter::setAudioCodec(AudioCodecType_T aAudioCodec) 361 { 362 /* the machine needs to be mutable */ 363 AutoMutableStateDependency adep(mParent); 364 if (FAILED(adep.rc())) return adep.rc(); 365 366 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 367 368 HRESULT rc = S_OK; 369 370 /* 371 * which audio hardware type are we supposed to use? 372 */ 373 switch (mData->m->mAudioController) 374 { 375 case AudioControllerType_AC97: 376 { 377 if ( (aAudioCodec != AudioCodecType_STAC9700) 378 && (aAudioCodec != AudioCodecType_AD1980)) 379 rc = E_INVALIDARG; 380 break; 381 } 382 383 case AudioControllerType_SB16: 384 { 385 if (aAudioCodec != AudioCodecType_SB16) 386 rc = E_INVALIDARG; 387 break; 388 } 389 390 case AudioControllerType_HDA: 391 { 392 if (aAudioCodec != AudioCodecType_STAC9221) 393 rc = E_INVALIDARG; 394 break; 395 } 396 397 default: 398 AssertMsgFailed (("Wrong audio controller type %d\n", 399 mData->m->mAudioController)); 400 rc = E_FAIL; 401 } 402 403 if (!SUCCEEDED(rc)) 404 return setError(rc, 405 tr ("Invalid audio codec type %d"), 406 aAudioCodec); 407 408 if (mData->m->mAudioCodec != aAudioCodec) 409 { 410 mData->m.backup(); 411 mData->m->mAudioCodec = aAudioCodec; 412 alock.release(); 413 AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS); // mParent is const, needs no locking 414 mParent->i_setModified(Machine::IsModified_AudioAdapter); 415 } 416 417 return rc; 418 } 419 350 420 HRESULT AudioAdapter::getPropertiesList(std::vector<com::Utf8Str>& aProperties) 351 421 { -
trunk/src/VBox/Main/src-server/GuestOSTypeImpl.cpp
r55401 r56459 38 38 , mChipsetType(ChipsetType_PIIX3) 39 39 , mAudioControllerType(AudioControllerType_AC97) 40 , mAudioCodecType(AudioCodecType_STAC9700) 40 41 { 41 42 } … … 126 127 unconst(mChipsetType) = ostype.chipsetType; 127 128 unconst(mAudioControllerType) = ostype.audioControllerType; 129 unconst(mAudioCodecType) = ostype.audioCodecType; 128 130 129 131 /* Confirm a successful initialization when it's the case */ … … 371 373 372 374 375 HRESULT GuestOSType::getRecommendedAudioCodec(AudioCodecType_T *aAudioCodec) 376 { 377 *aAudioCodec = mAudioCodecType; 378 379 return S_OK; 380 } 381 382 373 383 HRESULT GuestOSType::getRecommendedFloppy(BOOL *aRecommendedFloppy) 374 384 {
Note:
See TracChangeset
for help on using the changeset viewer.