VirtualBox

Changeset 98028 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Jan 9, 2023 9:46:16 AM (2 years ago)
Author:
vboxsync
Message:

Audio/Main: Made the Backupable<T> align with the rest of Main (via a private struct), added more documentation.

Location:
trunk/src/VBox/Main
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/AudioAdapterImpl.h

    r96407 r98028  
    8585    HRESULT setProperty(const com::Utf8Str &aKey, const com::Utf8Str &aValue);
    8686
    87     AudioSettings * const              mParent;
    88     const ComObjPtr<AudioAdapter>      mPeer;
    89     Backupable<settings::AudioAdapter> mData;
     87private:
     88
     89    struct Data;
     90    Data *m;
    9091};
    9192
  • trunk/src/VBox/Main/include/AudioSettingsImpl.h

    r96407 r98028  
    6464
    6565    // public methods only for internal purposes
    66     Machine* i_getParent(void);
    6766    bool     i_canChangeSettings(void);
    6867    void     i_onAdapterChanged(IAudioAdapter *pAdapter);
  • trunk/src/VBox/Main/src-server/AudioAdapterImpl.cpp

    r98011 r98028  
    4141
    4242
     43////////////////////////////////////////////////////////////////////////////////
     44//
     45// AudioAdapter private data definition
     46//
     47////////////////////////////////////////////////////////////////////////////////
     48
     49struct AudioAdapter::Data
     50{
     51    Data()
     52        : pParent(NULL)
     53    { }
     54
     55    AudioSettings * const          pParent;
     56    const ComObjPtr<AudioAdapter>  pPeer;
     57
     58    // use the XML settings structure in the members for simplicity
     59    Backupable<settings::AudioAdapter> bd;
     60};
     61
    4362// constructor / destructor
    4463/////////////////////////////////////////////////////////////////////////////
    4564
    4665AudioAdapter::AudioAdapter()
    47     : mParent(NULL)
    4866{
    4967}
     
    6886
    6987/**
    70  *  Initializes the audio adapter object.
    71  *
    72  *  @param aParent  Handle of the parent object.
     88 * Initializes the audio adapter object.
     89 *
     90 * @returns HRESULT
     91 * @param   aParent             Pointer of the parent object.
    7392 */
    7493HRESULT AudioAdapter::init(AudioSettings *aParent)
    7594{
    76     LogFlowThisFunc(("aParent=%p\n", aParent));
    77 
    7895    ComAssertRet(aParent, E_INVALIDARG);
    7996
     
    8299    AssertReturn(autoInitSpan.isOk(), E_FAIL);
    83100
    84     unconst(mParent)   = aParent;
     101    m = new Data();
     102
     103    unconst(m->pParent) = aParent;
    85104    /* mPeer is left null */
    86 
    87     mData.allocate();
    88105
    89106    /* We now always default to the "Default" audio driver, to make it easier
     
    91108     *
    92109     * This can be changed by the user explicitly, if needed / wanted. */
    93     mData->driverType  = AudioDriverType_Default;
    94     mData->fEnabledIn  = false;
    95     mData->fEnabledOut = false;
     110    m->bd.allocate();
     111    m->bd->driverType  = AudioDriverType_Default;
     112    m->bd->fEnabledIn  = false;
     113    m->bd->fEnabledOut = false;
    96114
    97115    /* Confirm a successful initialization */
     
    102120
    103121/**
    104  *  Initializes the audio adapter object given another audio adapter object
    105  *  (a kind of copy constructor). This object shares data with
    106  *  the object passed as an argument.
    107  *
    108  *  @note This object must be destroyed before the original object
    109  *  it shares data with is destroyed.
    110  *
    111  *  @note Locks @a aThat object for reading.
     122 * Initializes the audio adapter object given another audio adapter object
     123 * (a kind of copy constructor). This object shares data with
     124 * the object passed as an argument.
     125 *
     126 * @note This object must be destroyed before the original object
     127 *       it shares data with is destroyed.
     128 *
     129 * @note Locks @a aThat object for reading.
     130 *
     131 * @returns HRESULT
     132 * @param   aParent             Pointer of the parent object.
     133 * @param   aThat               Pointer to audio adapter to use settings from.
    112134 */
    113135HRESULT AudioAdapter::init(AudioSettings *aParent, AudioAdapter *aThat)
    114136{
    115     LogFlowThisFunc(("aParent=%p, aThat=%p\n", aParent, aThat));
    116 
    117137    ComAssertRet(aParent && aThat, E_INVALIDARG);
    118138
     
    121141    AssertReturn(autoInitSpan.isOk(), E_FAIL);
    122142
    123     unconst(mParent) = aParent;
    124     unconst(mPeer) = aThat;
     143    m = new Data();
     144
     145    unconst(m->pParent) = aParent;
     146    unconst(m->pPeer)   = aThat;
    125147
    126148    AutoCaller thatCaller(aThat);
     
    128150
    129151    AutoReadLock thatLock(aThat COMMA_LOCKVAL_SRC_POS);
    130     mData.share(aThat->mData);
     152    m->bd.share(aThat->m->bd);
    131153
    132154    /* Confirm a successful initialization */
     
    137159
    138160/**
    139  *  Initializes the audio adapter object given another audio adapter object
    140  *  (a kind of copy constructor). This object makes a private copy of data
    141  *  of the original object passed as an argument.
    142  *
    143  *  @note Locks @a aThat object for reading.
     161 * Initializes the audio adapter object given another audio adapter object
     162 * (a kind of copy constructor). This object makes a private copy of data
     163 * of the original object passed as an argument.
     164 *
     165 * @note Locks @a aThat object for reading.
     166 *
     167 * @returns HRESULT
     168 * @param   aParent             Pointer of the parent object.
     169 * @param   aThat               Pointer to audio adapter to use settings from.
    144170 */
    145171HRESULT AudioAdapter::initCopy(AudioSettings *aParent, AudioAdapter *aThat)
    146172{
    147     LogFlowThisFunc(("aParent=%p, aThat=%p\n", aParent, aThat));
    148 
    149173    ComAssertRet(aParent && aThat, E_INVALIDARG);
    150174
     
    153177    AssertReturn(autoInitSpan.isOk(), E_FAIL);
    154178
    155     unconst(mParent) = aParent;
     179    m = new Data();
     180
     181    unconst(m->pParent) = aParent;
    156182    /* mPeer is left null */
    157183
     
    160186
    161187    AutoReadLock thatLock(aThat COMMA_LOCKVAL_SRC_POS);
    162     mData.attachCopy(aThat->mData);
     188    m->bd.attachCopy(aThat->m->bd);
    163189
    164190    /* Confirm a successful initialization */
     
    174200void AudioAdapter::uninit(void)
    175201{
    176     LogFlowThisFunc(("\n"));
    177 
    178202    /* Enclose the state transition Ready->InUninit->NotReady */
    179203    AutoUninitSpan autoUninitSpan(this);
     
    181205        return;
    182206
    183     unconst(mPeer)   = NULL;
    184     unconst(mParent) = NULL;
    185 
    186     mData.free();
     207    unconst(m->pPeer) = NULL;
     208    unconst(m->pParent) = NULL;
     209
     210    delete m;
     211    m = NULL;
    187212}
    188213
     
    197222    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    198223
    199     *aEnabled = mData->fEnabled;
     224    *aEnabled = m->bd->fEnabled;
    200225
    201226    return S_OK;
     
    209234    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    210235
    211     if (mData->fEnabled != RT_BOOL(aEnabled))
    212     {
    213         mData.backup();
    214         mData->fEnabled = RT_BOOL(aEnabled);
     236    if (m->bd->fEnabled != RT_BOOL(aEnabled))
     237    {
     238        m->bd.backup();
     239        m->bd->fEnabled = RT_BOOL(aEnabled);
    215240        alock.release();
    216241
    217         mParent->i_onSettingsChanged(); // mParent is const, needs no locking
    218         mParent->i_onAdapterChanged(this);
     242        m->pParent->i_onSettingsChanged(); // mParent is const, needs no locking
     243        m->pParent->i_onAdapterChanged(this);
    219244    }
    220245
     
    229254    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    230255
    231     *aEnabled = mData->fEnabledIn;
     256    *aEnabled = RT_BOOL(m->bd->fEnabledIn);
    232257
    233258    return S_OK;
     
    241266    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    242267
    243     if (RT_BOOL(aEnabled) != mData->fEnabledIn)
    244     {
    245         mData.backup();
    246         mData->fEnabledIn = RT_BOOL(aEnabled);
     268    if (RT_BOOL(aEnabled) != m->bd->fEnabledIn)
     269    {
     270        m->bd.backup();
     271        m->bd->fEnabledIn = RT_BOOL(aEnabled);
    247272
    248273        alock.release();
    249274
    250         mParent->i_onSettingsChanged(); // mParent is const, needs no locking
    251         mParent->i_onAdapterChanged(this);
     275        m->pParent->i_onSettingsChanged(); // mParent is const, needs no locking
     276        m->pParent->i_onAdapterChanged(this);
    252277    }
    253278
     
    262287    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    263288
    264     *aEnabled = mData->fEnabledOut;
     289    *aEnabled = RT_BOOL(m->bd->fEnabledOut);
    265290
    266291    return S_OK;
     
    274299    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    275300
    276     if (RT_BOOL(aEnabled) != mData->fEnabledOut)
    277     {
    278         mData.backup();
    279         mData->fEnabledOut = RT_BOOL(aEnabled);
     301    if (RT_BOOL(aEnabled) != m->bd->fEnabledOut)
     302    {
     303        m->bd.backup();
     304        m->bd->fEnabledOut = RT_BOOL(aEnabled);
    280305
    281306        alock.release();
    282307
    283         mParent->i_onSettingsChanged(); // mParent is const, needs no locking
    284         mParent->i_onAdapterChanged(this);
     308        m->pParent->i_onSettingsChanged(); // mParent is const, needs no locking
     309        m->pParent->i_onAdapterChanged(this);
    285310    }
    286311
     
    295320    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    296321
    297     *aAudioDriver = mData->driverType;
     322    *aAudioDriver = m->bd->driverType;
    298323
    299324    return S_OK;
     
    309334    HRESULT rc = S_OK;
    310335
    311     if (mData->driverType != aAudioDriver)
     336    if (m->bd->driverType != aAudioDriver)
    312337    {
    313338        if (settings::MachineConfigFile::isAudioDriverAllowedOnThisHost(aAudioDriver))
    314339        {
    315             mData.backup();
    316             mData->driverType = aAudioDriver;
     340            m->bd.backup();
     341            m->bd->driverType = aAudioDriver;
    317342
    318343            alock.release();
    319344
    320             mParent->i_onSettingsChanged(); // mParent is const, needs no locking
     345            m->pParent->i_onSettingsChanged(); // mParent is const, needs no locking
    321346        }
    322347        else
     
    337362    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    338363
    339     *aAudioController = mData->controllerType;
     364    *aAudioController = m->bd->controllerType;
    340365
    341366    return S_OK;
     
    351376    HRESULT hrc = S_OK;
    352377
    353     if (mData->controllerType != aAudioController)
     378    if (m->bd->controllerType != aAudioController)
    354379    {
    355380        AudioCodecType_T defaultCodec;
     
    379404        if (SUCCEEDED(hrc))
    380405        {
    381             mData.backup();
    382             mData->controllerType = aAudioController;
    383             mData->codecType      = defaultCodec;
     406            m->bd.backup();
     407            m->bd->controllerType = aAudioController;
     408            m->bd->codecType      = defaultCodec;
    384409
    385410            alock.release();
    386411
    387             mParent->i_onSettingsChanged(); // mParent is const, needs no locking
     412            m->pParent->i_onSettingsChanged(); // mParent is const, needs no locking
    388413        }
    389414    }
     
    399424    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    400425
    401     *aAudioCodec = mData->codecType;
     426    *aAudioCodec = m->bd->codecType;
    402427
    403428    return S_OK;
     
    416441     * ensure that the codec type matches the audio controller
    417442     */
    418     switch (mData->controllerType)
     443    switch (m->bd->controllerType)
    419444    {
    420445        case AudioControllerType_AC97:
     
    442467        default:
    443468            AssertMsgFailed(("Wrong audio controller type %d\n",
    444                              mData->controllerType));
     469                             m->bd->controllerType));
    445470            hrc = E_FAIL;
    446471    }
     
    451476                        aAudioCodec);
    452477
    453     if (mData->codecType != aAudioCodec)
    454     {
    455         mData.backup();
    456         mData->codecType = aAudioCodec;
     478    if (m->bd->codecType != aAudioCodec)
     479    {
     480        m->bd.backup();
     481        m->bd->codecType = aAudioCodec;
    457482
    458483        alock.release();
    459484
    460         mParent->i_onSettingsChanged(); // mParent is const, needs no locking
     485        m->pParent->i_onSettingsChanged(); // mParent is const, needs no locking
    461486    }
    462487
     
    474499
    475500    aProperties.resize(0);
    476     StringsMap::const_iterator cit = mData->properties.begin();
    477     while(cit != mData->properties.end())
     501    StringsMap::const_iterator cit = m->bd->properties.begin();
     502    while(cit != m->bd->properties.end())
    478503    {
    479504        Utf8Str key = cit->first;
     
    492517    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    493518
    494     settings::StringsMap::const_iterator cit = mData->properties.find(aKey);
    495     if (cit != mData->properties.end())
     519    settings::StringsMap::const_iterator cit = m->bd->properties.find(aKey);
     520    if (cit != m->bd->properties.end())
    496521        aValue = cit->second;
    497522
     
    511536    Utf8Str strOldValue;
    512537
    513     settings::StringsMap::const_iterator cit = mData->properties.find(aKey);
    514     if (cit != mData->properties.end())
     538    settings::StringsMap::const_iterator cit = m->bd->properties.find(aKey);
     539    if (cit != m->bd->properties.end())
    515540        strOldValue = cit->second;
    516541
     
    518543    {
    519544        if (aValue.isEmpty())
    520             mData->properties.erase(aKey);
     545            m->bd->properties.erase(aKey);
    521546        else
    522             mData->properties[aKey] = aValue;
     547            m->bd->properties[aKey] = aValue;
    523548    }
    524549
     
    535560
    536561/**
    537  *  Loads settings from the given machine node.
    538  *  May be called once right after this object creation.
    539  *
    540  *  @param data Configuration settings.
    541  *
    542  *  @note Locks this object for writing.
     562 * Loads settings from the given machine node.
     563 * May be called once right after this object creation.
     564 *
     565 * @returns HRESULT
     566 * @param   data                Audio adapter configuration settings to load from.
     567 *
     568 * @note Locks this object for writing.
    543569 */
    544570HRESULT AudioAdapter::i_loadSettings(const settings::AudioAdapter &data)
     
    559585     * the same setting of an object loaded from the old settings file must
    560586     * default to B. */
    561     mData.assignCopy(&data);
    562 
    563     return S_OK;
    564 }
    565 
    566 /**
    567  *  Saves settings to the given machine node.
    568  *
    569  *  @param data Configuration settings.
    570  *
    571  *  @note Locks this object for reading.
     587    m->bd.assignCopy(&data);
     588
     589    return S_OK;
     590}
     591
     592/**
     593 * Saves settings to the given machine node.
     594 *
     595 * @returns HRESULT
     596 * @param   data                Audio adapter configuration settings to save to.
     597 *
     598 * @note Locks this object for reading.
    572599 */
    573600HRESULT AudioAdapter::i_saveSettings(settings::AudioAdapter &data)
     
    578605    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    579606
    580     data = *mData.data();
    581 
    582     return S_OK;
    583 }
    584 
    585 /**
    586  *  @note Locks this object for writing.
     607    data = *m->bd.data();
     608
     609    return S_OK;
     610}
     611
     612/**
     613 * Rolls back the current configuration to a former state.
     614 *
     615 * @note Locks this object for writing.
    587616 */
    588617void AudioAdapter::i_rollback()
     
    594623    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    595624
    596     mData.rollback();
    597 }
    598 
    599 /**
    600  *  @note Locks this object for writing, together with the peer object (also
    601  *  for writing) if there is one.
     625    m->bd.rollback();
     626}
     627
     628/**
     629 * Commits the current settings and propagates those to a peer (if assigned).
     630 *
     631 * @note Locks this object for writing, together with the peer object (also
     632 *       for writing) if there is one.
    602633 */
    603634void AudioAdapter::i_commit()
     
    608639
    609640    /* sanity too */
    610     AutoCaller peerCaller(mPeer);
     641    AutoCaller peerCaller(m->pPeer);
    611642    AssertComRCReturnVoid(peerCaller.rc());
    612643
    613644    /* lock both for writing since we modify both (mPeer is "master" so locked
    614645     * first) */
    615     AutoMultiWriteLock2 alock(mPeer, this COMMA_LOCKVAL_SRC_POS);
    616 
    617     if (mData.isBackedUp())
    618     {
    619         mData.commit();
    620         if (mPeer)
     646    AutoMultiWriteLock2 alock(m->pPeer, this COMMA_LOCKVAL_SRC_POS);
     647
     648    if (m->bd.isBackedUp())
     649    {
     650        m->bd.commit();
     651        if (m->pPeer)
    621652        {
    622653            /* attach new data to the peer and reshare it */
    623             mPeer->mData.attach(mData);
    624         }
    625     }
    626 }
    627 
    628 /**
    629  *  @note Locks this object for writing, together with the peer object
    630  *  represented by @a aThat (locked for reading).
     654            m->pPeer->m->bd.attach(m->bd);
     655        }
     656    }
     657}
     658
     659/**
     660 * Copies settings from a given audio adapter object.
     661 *
     662 * This object makes a private copy of data of the original object passed as
     663 * an argument.
     664 *
     665 * @note Locks this object for writing, together with the peer object
     666 *       represented by @a aThat (locked for reading).
     667 *
     668 * @param aThat                 Audio adapter to load settings from.
    631669 */
    632670void AudioAdapter::i_copyFrom(AudioAdapter *aThat)
     
    648686
    649687    /* this will back up current data */
    650     mData.assignCopy(aThat->mData);
     688    m->bd.assignCopy(aThat->m->bd);
    651689}
    652690/* vi: set tabstop=4 shiftwidth=4 expandtab: */
  • trunk/src/VBox/Main/src-server/AudioSettingsImpl.cpp

    r96407 r98028  
    4848{
    4949    Data()
    50         : pParent(NULL)
     50        : pMachine(NULL)
    5151    { }
    5252
    53     Machine * const                pParent;
     53    Machine * const                pMachine;
    5454    const ComObjPtr<AudioAdapter>  pAdapter;
    5555    const ComObjPtr<AudioSettings> pPeer;
     
    7676 * Initializes the audio settings object.
    7777 *
    78  * @param aParent  Handle of the parent object.
     78 * @returns HRESULT
     79 * @param   aParent             Pointer of the parent object.
    7980 */
    8081HRESULT AudioSettings::init(Machine *aParent)
    8182{
    82     LogFlowThisFunc(("aParent=%p\n", aParent));
    83 
    8483    ComAssertRet(aParent, E_INVALIDARG);
    8584
     
    9190
    9291    /* share the parent weakly */
    93     unconst(m->pParent) = aParent;
     92    unconst(m->pMachine) = aParent;
    9493
    9594    /* create the audio adapter object (always present, default is disabled) */
     
    109108 *
    110109 * @note This object must be destroyed before the original object
    111  * it shares data with is destroyed.
     110 *       it shares data with is destroyed.
    112111 *
    113112 * @note Locks @a aThat object for reading.
     113 *
     114 * @returns HRESULT
     115 * @param   aParent             Pointer of the parent object.
     116 * @param   aThat               Pointer to audio adapter to use settings from.
    114117 */
    115118HRESULT AudioSettings::init(Machine *aParent, AudioSettings *aThat)
    116119{
    117     LogFlowThisFuncEnter();
    118     LogFlowThisFunc(("aParent: %p, aThat: %p\n", aParent, aThat));
    119 
    120120    ComAssertRet(aParent && aThat, E_INVALIDARG);
    121121
     
    126126    m = new Data();
    127127
    128     unconst(m->pParent) = aParent;
    129     unconst(m->pPeer)   = aThat;
     128    unconst(m->pMachine) = aParent;
     129    unconst(m->pPeer)    = aThat;
    130130
    131131    AutoCaller thatCaller(aThat);
     
    134134    AutoReadLock thatlock(aThat COMMA_LOCKVAL_SRC_POS);
    135135
    136     unconst(m->pAdapter) = aThat->m->pAdapter;
     136    HRESULT hrc = unconst(m->pAdapter).createObject();
     137    ComAssertComRCRet(hrc, hrc);
     138    hrc = m->pAdapter->init(this, aThat->m->pAdapter);
     139    ComAssertComRCRet(hrc, hrc);
    137140
    138141    autoInitSpan.setSucceeded();
    139142
    140     LogFlowThisFuncLeave();
    141143    return S_OK;
    142144}
     
    148150 *
    149151 * @note Locks @a aThat object for reading.
     152 *
     153 * @returns HRESULT
     154 * @param   aParent             Pointer of the parent object.
     155 * @param   aThat               Pointer to audio adapter to use settings from.
    150156 */
    151157HRESULT AudioSettings::initCopy(Machine *aParent, AudioSettings *aThat)
    152158{
    153     LogFlowThisFuncEnter();
    154     LogFlowThisFunc(("aParent: %p, aThat: %p\n", aParent, aThat));
    155 
    156159    ComAssertRet(aParent && aThat, E_INVALIDARG);
    157160
     
    162165    m = new Data();
    163166
    164     unconst(m->pParent) = aParent;
     167    unconst(m->pMachine) = aParent;
    165168    // pPeer is left null
    166169
     
    175178    autoInitSpan.setSucceeded();
    176179
    177     LogFlowThisFuncLeave();
    178180    return S_OK;
    179181}
     
    185187void AudioSettings::uninit(void)
    186188{
    187     LogFlowThisFunc(("\n"));
    188 
    189189    /* Enclose the state transition Ready->InUninit->NotReady */
    190190    AutoUninitSpan autoUninitSpan(this);
     
    192192        return;
    193193
     194    unconst(m->pPeer)    = NULL;
     195    unconst(m->pMachine) = NULL;
     196
    194197    delete m;
    195198    m = NULL;
     
    230233
    231234/**
    232  * Returns the parent object as a weak pointer.
    233  */
    234 Machine* AudioSettings::i_getParent(void)
    235 {
    236     AutoCaller autoCaller(this);
    237     AssertComRCReturn(autoCaller.rc(), NULL);
    238 
    239     AssertPtrReturn(m, NULL);
    240     return m->pParent;
    241 }
    242 
    243 /**
    244235 * Determines whether the audio settings currently can be changed or not.
    245236 *
     
    248239bool AudioSettings::i_canChangeSettings(void)
    249240{
    250     AutoAnyStateDependency adep(m->pParent);
     241    AutoAnyStateDependency adep(m->pMachine);
    251242    if (FAILED(adep.rc()))
    252243        return false;
     
    259250 * Gets called when the machine object needs to know that audio adapter settings
    260251 * have been changed.
     252 *
     253 * @param   pAdapter             Pointer to audio adapter which has changed.
    261254 */
    262255void AudioSettings::i_onAdapterChanged(IAudioAdapter *pAdapter)
    263256{
    264     LogFlowThisFuncEnter();
    265 
    266257    AssertPtrReturnVoid(pAdapter);
    267 
    268     m->pParent->i_onAudioAdapterChange(pAdapter); // mParent is const, needs no locking
    269 
    270     LogFlowThisFuncLeave();
     258    m->pMachine->i_onAudioAdapterChange(pAdapter); // mParent is const, needs no locking
    271259}
    272260
     
    274262 * Gets called when the machine object needs to know that a host audio device
    275263 * has been changed.
     264 *
     265 * @param   pDevice             Host audio device which has changed.
     266 * @param   fIsNew              Set to \c true if this is a new device (i.e. has not been present before), \c false if not.
     267 * @param   enmState            The current state of the device.
     268 * @param   pErrInfo            Additional error information in case of error(s).
    276269 */
    277270void AudioSettings::i_onHostDeviceChanged(IHostAudioDevice *pDevice,
    278271                                          bool fIsNew, AudioDeviceState_T enmState, IVirtualBoxErrorInfo *pErrInfo)
    279272{
    280     LogFlowThisFuncEnter();
    281 
    282273    AssertPtrReturnVoid(pDevice);
    283 
    284     m->pParent->i_onHostAudioDeviceChange(pDevice, fIsNew, enmState, pErrInfo); // mParent is const, needs no locking
    285 
    286     LogFlowThisFuncLeave();
     274    m->pMachine->i_onHostAudioDeviceChange(pDevice, fIsNew, enmState, pErrInfo); // mParent is const, needs no locking
    287275}
    288276
     
    293281void AudioSettings::i_onSettingsChanged(void)
    294282{
    295     LogFlowThisFuncEnter();
    296 
    297     AutoWriteLock mlock(m->pParent COMMA_LOCKVAL_SRC_POS);
    298     m->pParent->i_setModified(Machine::IsModified_AudioSettings);
     283    AutoWriteLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS);
     284    m->pMachine->i_setModified(Machine::IsModified_AudioSettings);
    299285    mlock.release();
    300 
    301     LogFlowThisFuncLeave();
    302286}
    303287
     
    306290 * May be called once right after this object creation.
    307291 *
    308  * @param data Configuration settings.
     292 * @returns HRESULT
     293 * @param   data                Audio adapter configuration settings to load from.
    309294 *
    310295 * @note Locks this object for writing.
     
    324309
    325310/**
    326  * Saves settings to the given node.
    327  *
    328  * @param data Configuration settings.
     311 * Saves audio settings to the given machine node.
     312 *
     313 * @returns HRESULT
     314 * @param   data                Audio configuration settings to save to.
    329315 *
    330316 * @note Locks this object for reading.
     
    344330
    345331/**
     332 * Copies settings from a given audio settings object.
     333 *
     334 * This object makes a private copy of data of the original object passed as
     335 * an argument.
     336 *
    346337 * @note Locks this object for writing, together with the peer object
    347  * represented by @a aThat (locked for reading).
     338 *       represented by @a aThat (locked for reading).
     339 *
     340 * @param aThat                 Audio settings to load from.
    348341 */
    349342void AudioSettings::i_copyFrom(AudioSettings *aThat)
     
    406399
    407400/**
     401 * Rolls back the current configuration to a former state.
     402 *
    408403 * @note Locks this object for writing.
    409404 */
     
    422417
    423418/**
     419 * Commits the current settings and propagates those to a peer (if assigned).
     420 *
    424421 * @note Locks this object for writing, together with the peer object (also
    425  * for writing) if there is one.
     422 *       for writing) if there is one.
    426423 */
    427424void AudioSettings::i_commit(void)
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