VirtualBox

Ignore:
Timestamp:
Feb 28, 2008 6:43:08 PM (17 years ago)
Author:
vboxsync
Message:

Main: Reworked enums to avoid 1) weird duplication of enum name when referring to enum values in cross-platform code; 2) possible clashes on Win32 due to putting identifiers like Paused or Disabled to the global namespace (via C enums). In the new style, enums are used like this: a) USBDeviceState_T v = USBDeviceState_Busy from cross-platform non-Qt code; b) KUSBDeviceState v = KUSBDeviceState_Busy from Qt code; c) USBDeviceState v = USBDeviceState_Busy from plain Win32 and d) PRUInt32 USBDeviceState v = USBDeviceState::Busy from plain XPCOM.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/AudioAdapterImpl.cpp

    r6597 r7207  
    225225        switch (aAudioDriver)
    226226        {
    227             case AudioDriverType_NullAudioDriver:
     227            case AudioDriverType_Null:
    228228#ifdef RT_OS_WINDOWS
    229229# ifdef VBOX_WITH_WINMM
    230             case AudioDriverType_WINMMAudioDriver:
    231 # endif
    232             case AudioDriverType_DSOUNDAudioDriver:
     230            case AudioDriverType_WINMM:
     231# endif
     232            case AudioDriverType_DSOUND:
    233233#endif /* RT_OS_WINDOWS */
    234234#ifdef RT_OS_LINUX
    235             case AudioDriverType_OSSAudioDriver:
     235            case AudioDriverType_OSS:
    236236# ifdef VBOX_WITH_ALSA
    237             case AudioDriverType_ALSAAudioDriver:
     237            case AudioDriverType_ALSA:
    238238# endif
    239239# ifdef VBOX_WITH_PULSE
    240             case AudioDriverType_PulseAudioDriver:
     240            case AudioDriverType_Pulse:
    241241# endif
    242242#endif /* RT_OS_LINUX */
    243243#ifdef RT_OS_DARWIN
    244             case AudioDriverType_CoreAudioDriver:
    245 #endif 
     244            case AudioDriverType_Core:
     245#endif
    246246#ifdef RT_OS_OS2
    247             case AudioDriverType_MMPMAudioDriver:
    248 #endif 
     247            case AudioDriverType_MMPM:
     248#endif
    249249            {
    250250                mData.backup();
     
    324324/////////////////////////////////////////////////////////////////////////////
    325325
    326 /** 
     326/**
    327327 *  Loads settings from the given machine node.
    328328 *  May be called once right after this object creation.
    329  * 
     329 *
    330330 *  @param aMachineNode <Machine> node.
    331  * 
    332  *  @note Locks this object for writing. 
     331 *
     332 *  @note Locks this object for writing.
    333333 */
    334334HRESULT AudioAdapter::loadSettings (const settings::Key &aMachineNode)
     
    352352     * place when a setting of a newly created object must default to A while
    353353     * the same setting of an object loaded from the old settings file must
    354      * default to B. */ 
     354     * default to B. */
    355355
    356356    /* AudioAdapter node (required) */
     
    369369    /* now check the audio driver (required) */
    370370    const char *driver = audioAdapterNode.stringValue ("driver");
    371     mData->mAudioDriver = AudioDriverType_NullAudioDriver;
     371    mData->mAudioDriver = AudioDriverType_Null;
    372372    if      (strcmp (driver, "null") == 0)
    373373        ; /* Null has been set above */
     
    375375    else if (strcmp (driver, "winmm") == 0)
    376376#ifdef VBOX_WITH_WINMM
    377         mData->mAudioDriver = AudioDriverType_WINMMAudioDriver;
     377        mData->mAudioDriver = AudioDriverType_WINMM;
    378378#else
    379379        /* fall back to dsound */
    380         mData->mAudioDriver = AudioDriverType_DSOUNDAudioDriver;
     380        mData->mAudioDriver = AudioDriverType_DSOUND;
    381381#endif
    382382    else if (strcmp (driver, "dsound") == 0)
    383         mData->mAudioDriver = AudioDriverType_DSOUNDAudioDriver;
     383        mData->mAudioDriver = AudioDriverType_DSOUND;
    384384#endif // RT_OS_WINDOWS
    385385#ifdef RT_OS_LINUX
    386386    else if (strcmp (driver, "oss") == 0)
    387         mData->mAudioDriver = AudioDriverType_OSSAudioDriver;
     387        mData->mAudioDriver = AudioDriverType_OSS;
    388388    else if (strcmp (driver, "alsa") == 0)
    389389# ifdef VBOX_WITH_ALSA
    390         mData->mAudioDriver = AudioDriverType_ALSAAudioDriver;
     390        mData->mAudioDriver = AudioDriverType_ALSA;
    391391# else
    392392        /* fall back to OSS */
    393         mData->mAudioDriver = AudioDriverType_OSSAudioDriver;
     393        mData->mAudioDriver = AudioDriverType_OSS;
    394394# endif
    395395    else if (strcmp (driver, "pulse") == 0)
    396396# ifdef VBOX_WITH_PULSE
    397         mData->mAudioDriver = AudioDriverType_PulseAudioDriver;
     397        mData->mAudioDriver = AudioDriverType_Pulse;
    398398# else
    399399        /* fall back to OSS */
    400         mData->mAudioDriver = AudioDriverType_OSSAudioDriver;
     400        mData->mAudioDriver = AudioDriverType_OSS;
    401401# endif
    402402#endif // RT_OS_LINUX
    403403#ifdef RT_OS_DARWIN
    404404    else if (strcmp (driver, "coreaudio") == 0)
    405         mData->mAudioDriver = AudioDriverType_CoreAudioDriver;
     405        mData->mAudioDriver = AudioDriverType_Core;
    406406#endif
    407407#ifdef RT_OS_OS2
    408408    else if (strcmp (driver, "mmpm") == 0)
    409         mData->mAudioDriver = AudioDriverType_MMPMAudioDriver;
     409        mData->mAudioDriver = AudioDriverType_MMPM;
    410410#endif
    411411    else
     
    415415}
    416416
    417 /** 
     417/**
    418418 *  Saves settings to the given machine node.
    419  * 
     419 *
    420420 *  @param aMachineNode <Machine> node.
    421  * 
    422  *  @note Locks this object for reading. 
     421 *
     422 *  @note Locks this object for reading.
    423423 */
    424424HRESULT AudioAdapter::saveSettings (settings::Key &aMachineNode)
     
    454454    switch (mData->mAudioDriver)
    455455    {
    456         case AudioDriverType_NullAudioDriver:
     456        case AudioDriverType_Null:
    457457        {
    458458            driverStr = "null";
     
    460460        }
    461461#ifdef RT_OS_WINDOWS
    462             case AudioDriverType_WINMMAudioDriver:
     462            case AudioDriverType_WINMM:
    463463# ifdef VBOX_WITH_WINMM
    464464            {
     
    467467            }
    468468# endif
    469             case AudioDriverType_DSOUNDAudioDriver:
     469            case AudioDriverType_DSOUND:
    470470            {
    471471                driverStr = "dsound";
     
    474474#endif /* RT_OS_WINDOWS */
    475475#ifdef RT_OS_LINUX
    476             case AudioDriverType_ALSAAudioDriver:
     476            case AudioDriverType_ALSA:
    477477# ifdef VBOX_WITH_ALSA
    478478            {
     
    481481            }
    482482# endif
    483             case AudioDriverType_PulseAudioDriver:
     483            case AudioDriverType_Pulse:
    484484# ifdef VBOX_WITH_PULSE
    485485            {
     
    488488            }
    489489# endif
    490             case AudioDriverType_OSSAudioDriver:
     490            case AudioDriverType_OSS:
    491491            {
    492492                driverStr = "oss";
     
    495495#endif /* RT_OS_LINUX */
    496496#ifdef RT_OS_DARWIN
    497             case AudioDriverType_CoreAudioDriver:
     497            case AudioDriverType_Core:
    498498            {
    499499                driverStr = "coreaudio";
     
    502502#endif
    503503#ifdef RT_OS_OS2
    504             case AudioDriverType_MMPMAudioDriver:
     504            case AudioDriverType_MMPM:
    505505            {
    506506                driverStr = "mmpm";
     
    520520}
    521521
    522 /** 
     522/**
    523523 *  @note Locks this object for writing.
    524524 */
     
    544544}
    545545
    546 /** 
     546/**
    547547 *  @note Locks this object for writing, together with the peer object (also
    548548 *  for writing) if there is one.
     
    572572}
    573573
    574 /** 
     574/**
    575575 *  @note Locks this object for writing, together with the peer object
    576576 *  represented by @a aThat (locked for reading).
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