Changeset 103395 in vbox for trunk/src/VBox/Main
- Timestamp:
- Feb 16, 2024 9:18:42 AM (12 months ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/AudioSettingsImpl.h
r98103 r103395 65 65 // public methods only for internal purposes 66 66 bool i_canChangeSettings(void); 67 Machine *i_getMachine(void); 67 68 void i_onAdapterChanged(IAudioAdapter *pAdapter); 68 69 void i_onHostDeviceChanged(IHostAudioDevice *pDevice, bool fIsNew, AudioDeviceState_T enmState, IVirtualBoxErrorInfo *pErrInfo); -
trunk/src/VBox/Main/src-server/AudioAdapterImpl.cpp
r101313 r103395 234 234 if (FAILED(autoCaller.hrc())) return autoCaller.hrc(); 235 235 236 /* the machine needs to be mutable */ 237 AutoMutableStateDependency adep(m->pParent->i_getMachine()); 238 if (FAILED(adep.hrc())) return adep.hrc(); 239 236 240 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 237 241 … … 242 246 alock.release(); 243 247 244 m->pParent->i_onSettingsChanged(); // m Parent is const, needs no locking248 m->pParent->i_onSettingsChanged(); // m->pParent is const, needs no locking 245 249 m->pParent->i_onAdapterChanged(this); 246 250 } … … 265 269 AutoCaller autoCaller(this); 266 270 if (FAILED(autoCaller.hrc())) return autoCaller.hrc(); 271 272 /* the machine needs to be mutable */ 273 AutoMutableOrSavedOrRunningStateDependency adep(m->pParent->i_getMachine()); 274 if (FAILED(adep.hrc())) return adep.hrc(); 267 275 268 276 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 275 283 alock.release(); 276 284 277 m->pParent->i_onSettingsChanged(); // m Parent is const, needs no locking285 m->pParent->i_onSettingsChanged(); // m->pParent is const, needs no locking 278 286 m->pParent->i_onAdapterChanged(this); 279 287 } … … 298 306 AutoCaller autoCaller(this); 299 307 if (FAILED(autoCaller.hrc())) return autoCaller.hrc(); 308 309 /* the machine needs to be mutable */ 310 AutoMutableOrSavedOrRunningStateDependency adep(m->pParent->i_getMachine()); 311 if (FAILED(adep.hrc())) return adep.hrc(); 300 312 301 313 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 308 320 alock.release(); 309 321 310 m->pParent->i_onSettingsChanged(); // m Parent is const, needs no locking322 m->pParent->i_onSettingsChanged(); // m->pParent is const, needs no locking 311 323 m->pParent->i_onAdapterChanged(this); 312 324 } … … 331 343 AutoCaller autoCaller(this); 332 344 if (FAILED(autoCaller.hrc())) return autoCaller.hrc(); 345 346 /* the machine needs to be mutable */ 347 AutoMutableOrSavedStateDependency adep(m->pParent->i_getMachine()); 348 if (FAILED(adep.hrc())) return adep.hrc(); 333 349 334 350 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 345 361 alock.release(); 346 362 347 m->pParent->i_onSettingsChanged(); // m Parent is const, needs no locking363 m->pParent->i_onSettingsChanged(); // m->pParent is const, needs no locking 348 364 } 349 365 else … … 373 389 AutoCaller autoCaller(this); 374 390 if (FAILED(autoCaller.hrc())) return autoCaller.hrc(); 391 392 /* the machine needs to be mutable */ 393 AutoMutableStateDependency adep(m->pParent->i_getMachine()); 394 if (FAILED(adep.hrc())) return adep.hrc(); 375 395 376 396 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 415 435 alock.release(); 416 436 417 m->pParent->i_onSettingsChanged(); // m Parent is const, needs no locking437 m->pParent->i_onSettingsChanged(); // m->pParent is const, needs no locking 418 438 } 419 439 } … … 438 458 AutoCaller autoCaller(this); 439 459 if (FAILED(autoCaller.hrc())) return autoCaller.hrc(); 460 461 /* the machine needs to be mutable */ 462 AutoMutableStateDependency adep(m->pParent->i_getMachine()); 463 if (FAILED(adep.hrc())) return adep.hrc(); 440 464 441 465 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 494 518 alock.release(); 495 519 496 m->pParent->i_onSettingsChanged(); // m Parent is const, needs no locking520 m->pParent->i_onSettingsChanged(); // m->pParent is const, needs no locking 497 521 } 498 522 … … 539 563 AutoCaller autoCaller(this); 540 564 if (FAILED(autoCaller.hrc())) return autoCaller.hrc(); 565 566 /* the machine needs to be mutable */ 567 AutoMutableStateDependency adep(m->pParent->i_getMachine()); 568 if (FAILED(adep.hrc())) return adep.hrc(); 541 569 542 570 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); -
trunk/src/VBox/Main/src-server/AudioSettingsImpl.cpp
r98288 r103395 247 247 } 248 248 249 Machine *AudioSettings::i_getMachine(void) 250 { 251 return m->pMachine; // m->pMachine is const, needs no locking 252 } 253 249 254 /** 250 255 * Gets called when the machine object needs to know that audio adapter settings … … 256 261 { 257 262 AssertPtrReturnVoid(pAdapter); 258 m->pMachine->i_onAudioAdapterChange(pAdapter); // m Parentis const, needs no locking263 m->pMachine->i_onAudioAdapterChange(pAdapter); // m->pMachine is const, needs no locking 259 264 } 260 265 … … 272 277 { 273 278 AssertPtrReturnVoid(pDevice); 274 m->pMachine->i_onHostAudioDeviceChange(pDevice, fIsNew, enmState, pErrInfo); // m Parentis const, needs no locking279 m->pMachine->i_onHostAudioDeviceChange(pDevice, fIsNew, enmState, pErrInfo); // m->pMachine is const, needs no locking 275 280 } 276 281
Note:
See TracChangeset
for help on using the changeset viewer.