VirtualBox

Ignore:
Timestamp:
May 21, 2021 11:57:55 AM (4 years ago)
Author:
vboxsync
Message:

Audio: Converted PDMAUDIODSTSRCUNION, PDMAUDIORECSRC and PDMAUDIOPLAYBACKDST into a single enum type PDMAUDIOPATH. bugref:9890

File:
1 edited

Legend:

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

    r89213 r89218  
    17471747 * @param   pDrv                Driver to retrieve driver stream for.
    17481748 * @param   enmDir              Stream direction to retrieve.
    1749  * @param   dstSrc              Stream destination / source to retrieve.
    1750  */
    1751 static PSB16DRIVERSTREAM sb16GetDrvStream(PSB16DRIVER pDrv, PDMAUDIODIR enmDir, PDMAUDIODSTSRCUNION dstSrc)
     1749 * @param   enmPath             Stream destination / source to retrieve.
     1750 */
     1751static PSB16DRIVERSTREAM sb16GetDrvStream(PSB16DRIVER pDrv, PDMAUDIODIR enmDir, PDMAUDIOPATH enmPath)
    17521752{
    17531753    PSB16DRIVERSTREAM pDrvStream = NULL;
    17541754
    1755     if (enmDir == PDMAUDIODIR_IN)
    1756         return NULL; /** @todo Recording not implemented yet. */
    1757 
    17581755    if (enmDir == PDMAUDIODIR_OUT)
    17591756    {
    1760         LogFunc(("enmDst=%RU32\n", dstSrc.enmDst));
    1761 
    1762         switch (dstSrc.enmDst)
     1757        LogFunc(("enmPath=%d\n", enmPath));
     1758
     1759        switch (enmPath)
    17631760        {
    1764             case PDMAUDIOPLAYBACKDST_FRONT:
     1761            case PDMAUDIOPATH_OUT_FRONT:
    17651762                pDrvStream = &pDrv->Out;
    17661763                break;
     
    17711768    }
    17721769    else
    1773         AssertFailed();
     1770        Assert(enmDir == PDMAUDIODIR_IN /** @todo Recording not implemented yet. */);
    17741771
    17751772    return pDrvStream;
     
    18001797    int rc;
    18011798
    1802     PSB16DRIVERSTREAM pDrvStream = sb16GetDrvStream(pDrv, pStreamCfg->enmDir, pStreamCfg->u);
     1799    PSB16DRIVERSTREAM pDrvStream = sb16GetDrvStream(pDrv, pStreamCfg->enmDir, pStreamCfg->enmPath);
    18031800    if (pDrvStream)
    18041801    {
     
    18681865 * @param   pMixSink    Mixer sink to remove audio streams from.
    18691866 * @param   enmDir      Stream direction to remove.
    1870  * @param   dstSrc      Stream destination / source to remove.
     1867 * @param   enmPath     Stream destination / source to remove.
    18711868 * @param   pDrv        Driver stream to remove.
    18721869 */
    18731870static void sb16RemoveDrvStream(PPDMDEVINS pDevIns, PAUDMIXSINK pMixSink, PDMAUDIODIR enmDir,
    1874                                 PDMAUDIODSTSRCUNION dstSrc, PSB16DRIVER pDrv)
    1875 {
    1876     PSB16DRIVERSTREAM pDrvStream = sb16GetDrvStream(pDrv, enmDir, dstSrc);
     1871                                PDMAUDIOPATH enmPath, PSB16DRIVER pDrv)
     1872{
     1873    PSB16DRIVERSTREAM pDrvStream = sb16GetDrvStream(pDrv, enmDir, enmPath);
    18771874    if (pDrvStream)
    18781875    {
     
    18961893 * @param   pMixSink    Mixer sink to remove audio streams from.
    18971894 * @param   enmDir      Stream direction to remove.
    1898  * @param   dstSrc      Stream destination / source to remove.
     1895 * @param   enmPath     Stream destination / source to remove.
    18991896 */
    19001897static void sb16RemoveDrvStreams(PPDMDEVINS pDevIns, PSB16STATE pThis, PAUDMIXSINK pMixSink,
    1901                                  PDMAUDIODIR enmDir, PDMAUDIODSTSRCUNION dstSrc)
     1898                                 PDMAUDIODIR enmDir, PDMAUDIOPATH enmPath)
    19021899{
    19031900    AssertPtrReturnVoid(pMixSink);
     
    19061903    RTListForEach(&pThis->lstDrv, pDrv, SB16DRIVER, Node)
    19071904    {
    1908         sb16RemoveDrvStream(pDevIns, pMixSink, enmDir, dstSrc, pDrv);
     1905        sb16RemoveDrvStream(pDevIns, pMixSink, enmDir, enmPath, pDrv);
    19091906    }
    19101907}
     
    22092206        {
    22102207            pStream->Cfg.enmDir    = PDMAUDIODIR_OUT;
    2211             pStream->Cfg.u.enmDst  = PDMAUDIOPLAYBACKDST_FRONT;
     2208            pStream->Cfg.enmPath   = PDMAUDIOPATH_OUT_FRONT;
    22122209            pStream->Cfg.enmLayout = PDMAUDIOSTREAMLAYOUT_NON_INTERLEAVED;
    22132210
     
    22522249    AssertReturn(PDMAudioPropsAreValid(&pStream->Cfg.Props), VERR_INVALID_PARAMETER);
    22532250
    2254     PDMAUDIODSTSRCUNION dstSrc;
    2255     PDMAUDIODIR         enmDir;
    2256 
    22572251    switch (pStream->uIdx)
    22582252    {
    22592253        case SB16_IDX_OUT:
    2260         {
    22612254            pStream->Cfg.enmDir      = PDMAUDIODIR_OUT;
    2262             pStream->Cfg.u.enmDst    = PDMAUDIOPLAYBACKDST_FRONT;
     2255            pStream->Cfg.enmPath     = PDMAUDIOPATH_OUT_FRONT;
    22632256            pStream->Cfg.enmLayout   = PDMAUDIOSTREAMLAYOUT_NON_INTERLEAVED;
    22642257
    22652258            RTStrCopy(pStream->Cfg.szName, sizeof(pStream->Cfg.szName), "Output");
    2266 
    2267             dstSrc.enmDst = PDMAUDIOPLAYBACKDST_FRONT;
    2268             enmDir        = PDMAUDIODIR_OUT;
    2269             break;
    2270         }
     2259            break;
    22712260
    22722261        default:
     
    23012290
    23022291    sb16RemoveDrvStreams(pDevIns, pThis,
    2303                          sb16StreamIndexToSink(pThis, pStream->uIdx), pStream->Cfg.enmDir, pStream->Cfg.u);
     2292                         sb16StreamIndexToSink(pThis, pStream->uIdx), pStream->Cfg.enmDir, pStream->Cfg.enmPath);
    23042293
    23052294    rc = sb16AddDrvStreams(pDevIns, pThis, pMixerSink, &pStream->Cfg);
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