VirtualBox

Changeset 56512 in vbox


Ignore:
Timestamp:
Jun 18, 2015 12:00:19 PM (9 years ago)
Author:
vboxsync
Message:

Main/AC97: Propagate codec model setting through CFGM.

Location:
trunk/src/VBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/DevIchAc97.cpp

    r56085 r56512  
    20762076     * Validations.
    20772077     */
    2078     if (!CFGMR3AreValuesValid(pCfg, "Type\0"))
     2078    if (!CFGMR3AreValuesValid(pCfg, "Codec\0"))
    20792079        return PDMDEV_SET_ERROR(pDevIns, VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES,
    20802080                                N_("Invalid configuration for the AC'97 device"));
    20812081
    20822082    /*
    2083      * Determine the chip type.
     2083     * Determine the codec model.
    20842084     */
    2085     char szType[20];
    2086     int rc = CFGMR3QueryStringDef(pCfg, "Type", &szType[0], sizeof(szType), "STAC9700");
     2085    char szCodec[20];
     2086    int rc = CFGMR3QueryStringDef(pCfg, "Codec", &szCodec[0], sizeof(szCodec), "STAC9700");
    20872087    if (RT_FAILURE(rc))
    20882088        return PDMDEV_SET_ERROR(pDevIns, VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES,
    2089                                 N_("AC'97 configuration error: Querying \"Type\" as string failed"));
     2089                                N_("AC'97 configuration error: Querying \"Codec\" as string failed"));
    20902090
    20912091    /*
     
    20952095     */
    20962096    bool fChipAD1980 = false;
    2097     if (!strcmp(szType, "STAC9700"))
     2097    if (!strcmp(szCodec, "STAC9700"))
    20982098        fChipAD1980 = false;
    2099     else if (!strcmp(szType, "AD1980"))
     2099    else if (!strcmp(szCodec, "AD1980"))
    21002100        fChipAD1980 = true;
    21012101    else
    21022102    {
    21032103        return PDMDevHlpVMSetError(pDevIns, VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES, RT_SRC_POS,
    2104                                    N_("AC'97 configuration error: The \"Type\" value \"%s\" is unsupported"),
    2105                                    szType);
     2104                                   N_("AC'97 configuration error: The \"Codec\" value \"%s\" is unsupported"),
     2105                                   szCodec);
    21062106    }
    21072107
  • trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp

    r56319 r56512  
    26952695            AudioControllerType_T audioController;
    26962696            hrc = audioAdapter->COMGETTER(AudioController)(&audioController);               H();
     2697            AudioCodecType_T audioCodec;
     2698            hrc = audioAdapter->COMGETTER(AudioCodec)(&audioCodec);                         H();
    26972699            switch (audioController)
    26982700            {
     
    27052707                    hrc = pBusMgr->assignPCIDevice("ichac97", pInst);                       H();
    27062708                    InsertConfigNode(pInst,    "Config", &pCfg);
     2709                    switch (audioCodec)
     2710                    {
     2711                        case AudioCodecType_STAC9700:
     2712                            InsertConfigString(pCfg,   "Codec", "STAC9700");
     2713                            break;
     2714                        case AudioCodecType_AD1980:
     2715                            InsertConfigString(pCfg,   "Codec", "AD1980");
     2716                            break;
     2717                    }
    27072718                    break;
    27082719                }
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