VirtualBox

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


Ignore:
Timestamp:
Jan 11, 2018 4:20:27 PM (7 years ago)
Author:
vboxsync
Message:

Audio/Main: Also added the driver name to the AudioDriver base class.

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

Legend:

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

    • Property svn:executable deleted
    r70538 r70544  
    2525
    2626/**
    27  * Audio driver configuration for audio drivers implemented 
    28  * in Main. 
     27 * Audio driver configuration for audio drivers implemented
     28 * in Main.
    2929 */
    3030struct AudioDriverCfg
    3131{
    32     AudioDriverCfg(Utf8Str a_strDev = "", unsigned a_uInst = 0, unsigned a_uLUN = 0)
     32    AudioDriverCfg(Utf8Str a_strDev = "", unsigned a_uInst = 0, unsigned a_uLUN = 0,
     33                   Utf8Str a_strName = "")
    3334        : strDev(a_strDev)
    3435        , uInst(a_uInst)
    35         , uLUN(a_uLUN) { }
     36        , uLUN(a_uLUN)
     37        , strName(a_strName) { }
    3638
    3739    AudioDriverCfg& operator=(AudioDriverCfg that)
    3840    {
    39         this->strDev = that.strDev;
    40         this->uInst  = that.uInst;
    41         this->uLUN   = that.uLUN;
     41        this->strDev  = that.strDev;
     42        this->uInst   = that.uInst;
     43        this->uLUN    = that.uLUN;
     44        this->strName = that.strName;
    4245
    4346        return *this;
     
    5154     *  Set the UINT8_MAX if not attached. */
    5255    unsigned             uLUN;
     56    /** The driver name. */
     57    Utf8Str              strName;
    5358};
    5459
     
    6974    AudioDriverCfg *GetConfig(void) { return &mCfg; }
    7075
    71     Console *GetParent(void) { return mpConsole; }   
     76    Console *GetParent(void) { return mpConsole; }
    7277
    7378    bool IsAttached(void) { return mfAttached; }
     
    8287
    8388    /**
    84      * Optional (virtual) function to give the derived audio driver 
    85      * class the ability to add more driver configuration entries when 
     89     * Optional (virtual) function to give the derived audio driver
     90     * class the ability to add more driver configuration entries when
    8691     * setting up.
    87      * 
    88      * @param pLunCfg           CFGM configuration node of the driver.   
     92     *
     93     * @param pLunCfg           CFGM configuration node of the driver.
    8994     */
    9095    virtual void configureDriver(PCFGMNODE pLunCfg) { RT_NOREF(pLunCfg); }
  • trunk/src/VBox/Main/src-client/AudioDriver.cpp

    • Property svn:executable deleted
    r70538 r70544  
    9494        pCfg->uLUN = pThis->getFreeLUN();
    9595
    96     LogFunc(("strDevice=%s, uInst=%u, uLUN=%u\n", pCfg->strDev.c_str(), pCfg->uInst, pCfg->uLUN));
     96    LogFunc(("strName=%s, strDevice=%s, uInst=%u, uLUN=%u\n",
     97             pCfg->strName.c_str(), pCfg->strDev.c_str(), pCfg->uInst, pCfg->uLUN));
    9798
    9899    vrc = pThis->Configure(pCfg, true /* Attach */);
     
    105106    }
    106107    else
    107         LogRel(("VRDE: Failed to attach audio driver, rc=%Rrc\n", vrc));
     108        LogRel(("%s: Failed to attach audio driver, rc=%Rrc\n", pCfg->strName.c_str(), vrc));
    108109
    109110    return vrc;
     
    131132    AudioDriverCfg *pCfg = &pThis->mCfg;
    132133
    133     LogFunc(("strDevice=%s, uInst=%u, uLUN=%u\n", pCfg->strDev.c_str(), pCfg->uInst, pCfg->uLUN));
     134    LogFunc(("strName=%s, strDevice=%s, uInst=%u, uLUN=%u\n",
     135             pCfg->strName.c_str(), pCfg->strDev.c_str(), pCfg->uInst, pCfg->uLUN));
    134136
    135137    vrc = PDMR3DriverDetach(ptrVM.rawUVM(), pCfg->strDev.c_str(), pCfg->uInst, pCfg->uLUN, "AUDIO",
     
    145147    }
    146148    else
    147         LogRel(("VRDE: Failed to detach audio driver, rc=%Rrc\n", vrc));
     149        LogRel(("%s: Failed to detach audio driver, rc=%Rrc\n", pCfg->strName.c_str(), vrc));
    148150
    149151    return vrc;
     
    186188        if (!pDevLun)
    187189        {
    188             LogRel2(("VRDE: Configuring audio driver\n"));
     190            LogRel2(("%s: Configuring audio driver\n", mCfg.strName.c_str()));
    189191
    190192            PCFGMNODE pLunL0;
     
    194196            PCFGMNODE pLunCfg;
    195197            CFGMR3InsertNode(pLunL0,   "Config", &pLunCfg);
    196                 CFGMR3InsertString (pLunCfg, "DriverName",    "AudioVRDE");
     198                CFGMR3InsertStringF(pLunCfg, "DriverName",    "%s", mCfg.strName.c_str());
    197199                CFGMR3InsertInteger(pLunCfg, "InputEnabled",  0); /* Play safe by default. */
    198200                CFGMR3InsertInteger(pLunCfg, "OutputEnabled", 1);
     
    200202            PCFGMNODE pLunL1;
    201203            CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1);
    202                 CFGMR3InsertString(pLunL1, "Driver", "AudioVRDE");
     204                CFGMR3InsertStringF(pLunL1, "Driver", "%s", mCfg.strName.c_str());
    203205
    204206                CFGMR3InsertNode(pLunL1, "Config", &pLunCfg);
     
    212214        if (pDevLun)
    213215        {
    214             LogRel2(("VRDE: Unconfiguring audio driver\n"));
     216            LogRel2(("%s: Unconfiguring audio driver\n", mCfg.strName.c_str()));
    215217            CFGMR3RemoveNode(pDevLun);
    216218        }
  • trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp

    r70537 r70544  
    29752975            }
    29762976
    2977             AudioDriverCfg Cfg(strAudioDevice, 0 /* Instance */, uAudioLUN);
     2977            AudioDriverCfg Cfg(strAudioDevice, 0 /* Instance */, uAudioLUN, "AudioVRDE");
    29782978            rc = mAudioVRDE->Configure(&Cfg, RT_BOOL(fVRDEEnabled) /* Attach */);
    29792979            if (   RT_SUCCESS(rc)
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