mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/src/TmsAudioServicesTestClassBlocks.cpp
branchRCL_3
changeset 11 3570217d8c21
parent 9 f5c5c82a163e
child 19 095bea5f582e
equal deleted inserted replaced
9:f5c5c82a163e 11:3570217d8c21
   146 // Run specified method. Contains also table of test mothods and their names.
   146 // Run specified method. Contains also table of test mothods and their names.
   147 // -----------------------------------------------------------------------------
   147 // -----------------------------------------------------------------------------
   148 //
   148 //
   149 TInt CTmsAudioServicesTestClass::RunMethodL(CStifItemParser& aItem)
   149 TInt CTmsAudioServicesTestClass::RunMethodL(CStifItemParser& aItem)
   150     {
   150     {
   151     static TStifFunctionInfo const
   151     static TStifFunctionInfo const KFunctions[] =
   152     KFunctions[] =
       
   153         {
   152         {
   154         // Copy this line for every implemented function.
   153         // Copy this line for every implemented function.
   155         // First string is the function name used in TestScripter script file.
   154         // First string is the function name used in TestScripter script file.
   156         // Second is the actual implementation member function.
   155         // Second is the actual implementation member function.
   157 
   156 
   178         ENTRY( "ReSetDownlinkFormat", CTmsAudioServicesTestClass::ReSetDownlinkFormat ),
   177         ENTRY( "ReSetDownlinkFormat", CTmsAudioServicesTestClass::ReSetDownlinkFormat ),
   179         ENTRY( "ReSetUplinkFormat", CTmsAudioServicesTestClass::ReSetUplinkFormat ),
   178         ENTRY( "ReSetUplinkFormat", CTmsAudioServicesTestClass::ReSetUplinkFormat ),
   180         ENTRY( "OpenDownlink", CTmsAudioServicesTestClass::OpenDownlink ),
   179         ENTRY( "OpenDownlink", CTmsAudioServicesTestClass::OpenDownlink ),
   181         ENTRY( "OpenUplink", CTmsAudioServicesTestClass::OpenUplink ),
   180         ENTRY( "OpenUplink", CTmsAudioServicesTestClass::OpenUplink ),
   182         ENTRY( "Gain", CTmsAudioServicesTestClass::Gain ),
   181         ENTRY( "Gain", CTmsAudioServicesTestClass::Gain ),
   183         ENTRY( "AddGlobleGainEffectToStream", CTmsAudioServicesTestClass::AddGlobleGainEffectToStream),
   182         ENTRY( "AddGlobalGainEffectToStream", CTmsAudioServicesTestClass::AddGlobalGainEffectToStream),
   184         ENTRY( "RemoveGlobleGainEffectToStream", CTmsAudioServicesTestClass::RemoveGlobleGainEffectToStream),
   183         ENTRY( "RemoveGlobalGainEffectToStream", CTmsAudioServicesTestClass::RemoveGlobalGainEffectToStream),
   185         ENTRY( "Volume", CTmsAudioServicesTestClass::Volume ),
   184         ENTRY( "Volume", CTmsAudioServicesTestClass::Volume ),
   186         ENTRY( "AddGlobleVolumeEffectToStream", CTmsAudioServicesTestClass::AddGlobleVolumeEffectToStream),
   185         ENTRY( "AddGlobalVolumeEffectToStream", CTmsAudioServicesTestClass::AddGlobalVolumeEffectToStream),
   187         ENTRY( "RemoveGlobleVolumeEffectToStream", CTmsAudioServicesTestClass::RemoveGlobleVolumeEffectToStream),
   186         ENTRY( "RemoveGlobalVolumeEffectToStream", CTmsAudioServicesTestClass::RemoveGlobalVolumeEffectToStream),
   188         ENTRY( "CreateGlobleGainEffect", CTmsAudioServicesTestClass::CreateGlobleGainEffect),
   187         ENTRY( "CreateGlobalGainEffect", CTmsAudioServicesTestClass::CreateGlobalGainEffect),
   189         ENTRY( "Close", CTmsAudioServicesTestClass::Close ),
   188         ENTRY( "Close", CTmsAudioServicesTestClass::Close ),
   190         ENTRY( "Start", CTmsAudioServicesTestClass::Start ),
   189         ENTRY( "Start", CTmsAudioServicesTestClass::Start ),
   191         ENTRY( "Pause", CTmsAudioServicesTestClass::Pause ),
   190         ENTRY( "Pause", CTmsAudioServicesTestClass::Pause ),
   192         ENTRY( "Stop", CTmsAudioServicesTestClass::Stop ),
   191         ENTRY( "Stop", CTmsAudioServicesTestClass::Stop ),
   193         ENTRY( "GetBitRateList", CTmsAudioServicesTestClass::GetBitRateList ),
   192         ENTRY( "GetBitRateList", CTmsAudioServicesTestClass::GetBitRateList ),
   673                 //      AddVolumeEffectToStream();
   672                 //      AddVolumeEffectToStream();
   674                 }
   673                 }
   675                 break;
   674                 break;
   676             case TMS_EFFECT_GLOBAL_VOL:
   675             case TMS_EFFECT_GLOBAL_VOL:
   677                 {
   676                 {
   678                 error = CreateVolumeGlobleEffect();
   677                 error = CreateVolumeGlobalEffect();
   679                 //       AddGlobleVolumeEffectToStream();
   678                 //       AddGlobalVolumeEffectToStream();
   680                 }
   679                 }
   681                 break;
   680                 break;
   682             case TMS_EFFECT_GAIN:
   681             case TMS_EFFECT_GAIN:
   683                 {
   682                 {
   684                 error = CreateGainEffect();
   683                 error = CreateGainEffect();
   685                 //        AddGainEffectToStream();
   684                 //        AddGainEffectToStream();
   686                 }
   685                 }
   687                 break;
   686                 break;
   688             case TMS_EFFECT_GLOBAL_GAIN:
   687             case TMS_EFFECT_GLOBAL_GAIN:
   689                 {
   688                 {
   690                 error = CreateGlobleGainEffect();
   689                 error = CreateGlobalGainEffect();
   691                 //        AddGlobleGainEffectToStream();
   690                 //        AddGlobalGainEffectToStream();
   692                 }
   691                 }
   693                 break;
   692                 break;
   694             default:
   693             default:
   695                 error = KErrNotSupported;
   694                 error = KErrNotSupported;
   696                 break;
   695                 break;
  1032         }
  1031         }
  1033 
  1032 
  1034     return error;
  1033     return error;
  1035     }
  1034     }
  1036 
  1035 
  1037 TInt CTmsAudioServicesTestClass::CreateDownlinkStream(CStifItemParser& /*aItem*/)
  1036 TInt CTmsAudioServicesTestClass::CreateDownlinkStream(
       
  1037         CStifItemParser& /*aItem*/)
  1038     {
  1038     {
  1039     FTRACE(FPrint(_L("CTmsAudioServicesTestClass::CreateDownlinkStream")));
  1039     FTRACE(FPrint(_L("CTmsAudioServicesTestClass::CreateDownlinkStream")));
  1040     iLog->Log(_L("CTmsAudioServicesTestClass::CreateDownlinkStream"));
  1040     iLog->Log(_L("CTmsAudioServicesTestClass::CreateDownlinkStream"));
  1041     TInt error = KErrNone;
  1041     TInt error = KErrNone;
  1042 
  1042 
  1194             error = iTmsDnlink->SetFormat(iTmsFormat);
  1194             error = iTmsDnlink->SetFormat(iTmsFormat);
  1195             }
  1195             }
  1196 
  1196 
  1197         if (error != KErrNone)
  1197         if (error != KErrNone)
  1198             {
  1198             {
  1199             iLog->Log(_L("CTmsAudioServicesTestClass::SetDownlinkFormat - failed, return error = %d" ),
  1199             iLog->Log(_L("CTmsAudioServicesTestClass::SetDownlinkFormat - failed, return error = %d" ), error);
  1200                     error);
       
  1201             return error;
  1200             return error;
  1202             }
  1201             }
  1203         }
  1202         }
  1204     else
  1203     else
  1205         {
  1204         {
  1219     if (iTmsDnlink && iTmsFormatDn)
  1218     if (iTmsDnlink && iTmsFormatDn)
  1220         {
  1219         {
  1221         error = iTmsDnlink->ResetFormat(iTmsFormatDn);
  1220         error = iTmsDnlink->ResetFormat(iTmsFormatDn);
  1222         if (error != KErrNone)
  1221         if (error != KErrNone)
  1223             {
  1222             {
  1224             iLog->Log(_L("CTmsAudioServicesTestClass::ReSetDownlinkFormat - failed, return error = %d" ),
  1223             iLog->Log(_L("CTmsAudioServicesTestClass::ReSetDownlinkFormat - failed, return error = %d" ), error);
  1225                     error);
       
  1226             return error;
  1224             return error;
  1227             }
  1225             }
  1228         }
  1226         }
  1229     else
  1227     else
  1230         {
  1228         {
  1271 
  1269 
  1272     if (iTmsUplink)
  1270     if (iTmsUplink)
  1273         {
  1271         {
  1274         if (iTmsFormatUp)
  1272         if (iTmsFormatUp)
  1275             {
  1273             {
  1276             iLog->Log(
  1274             iLog->Log(_L("CTmsAudioServicesTestClass::SetUplinkFormat - iTmsFormatUp"));
  1277                     _L("CTmsAudioServicesTestClass::SetUplinkFormat - iTmsFormatUp"));
       
  1278             error = iTmsUplink->SetFormat(iTmsFormatUp);
  1275             error = iTmsUplink->SetFormat(iTmsFormatUp);
  1279             }
  1276             }
  1280         else
  1277         else
  1281             {
  1278             {
  1282             iLog->Log(_L("CTmsAudioServicesTestClass::SetUplinkFormat - iTmsFormat"));
  1279             iLog->Log(_L("CTmsAudioServicesTestClass::SetUplinkFormat - iTmsFormat"));
  1283             error = iTmsUplink->SetFormat(iTmsFormat);
  1280             error = iTmsUplink->SetFormat(iTmsFormat);
  1284             }
  1281             }
  1285 
  1282 
  1286         if (error != KErrNone)
  1283         if (error != KErrNone)
  1287             {
  1284             {
  1288             iLog->Log(_L("CTmsAudioServicesTestClass::SetUplinkFormat - failed, return error = %d" ),
  1285             iLog->Log(_L("CTmsAudioServicesTestClass::SetUplinkFormat - failed, return error = %d" ), error);
  1289                     error);
       
  1290             return error;
  1286             return error;
  1291             }
  1287             }
  1292         }
  1288         }
  1293     else
  1289     else
  1294         {
  1290         {
  1395             {
  1391             {
  1396             //iRecBufPtr.Set(NULL, 0, 0);
  1392             //iRecBufPtr.Set(NULL, 0, 0);
  1397             iRecBufReady = EFalse;
  1393             iRecBufReady = EFalse;
  1398             //iUpLinkCodec = ENULL;
  1394             //iUpLinkCodec = ENULL;
  1399             iTmsUplink->Deinit();
  1395             iTmsUplink->Deinit();
       
  1396             iTmsUplink->RemoveObserver(*this);
  1400             iUpLinkStatus = UNINITIALIZED;
  1397             iUpLinkStatus = UNINITIALIZED;
  1401             iLog->Log(_L("Close Uplink"));
  1398             iLog->Log(_L("Close Uplink"));
  1402             AddExpectedEvent(EUplinkClosed, KMediumTimeout);
  1399             AddExpectedEvent(EUplinkClosed, KMediumTimeout);
  1403             }
  1400             }
  1404         else if (closeType == KTagDnlink)
  1401         else if (closeType == KTagDnlink)
  1405             {
  1402             {
  1406             //iPlayBufPtr.Set(NULL, 0, 0);
  1403             //iPlayBufPtr.Set(NULL, 0, 0);
  1407             iTmsDnlink->Deinit();
  1404             iTmsDnlink->Deinit();
       
  1405             iTmsDnlink->RemoveObserver(*this);
  1408             iDnLinkStatus = UNINITIALIZED;
  1406             iDnLinkStatus = UNINITIALIZED;
  1409             iPlayBufReady = EFalse;
  1407             iPlayBufReady = EFalse;
  1410             // iDnLinkCodec = ENULL;
  1408             // iDnLinkCodec = ENULL;
  1411             iLog->Log(_L("Close Dnlink"));
  1409             iLog->Log(_L("Close Dnlink"));
  1412             AddExpectedEvent(EDownlinkClosed, KMediumTimeout);
  1410             AddExpectedEvent(EDownlinkClosed, KMediumTimeout);
  1589     aItem.GetNextInt(effecttype);
  1587     aItem.GetNextInt(effecttype);
  1590 
  1588 
  1591     if (effecttype == TMS_EFFECT_GAIN)
  1589     if (effecttype == TMS_EFFECT_GAIN)
  1592         {
  1590         {
  1593         RDebug::Printf("[TMS STIF] GAIN, GetMaxLevel");
  1591         RDebug::Printf("[TMS STIF] GAIN, GetMaxLevel");
  1594         ret = static_cast<TMSGainEffect*>(iTmsUplinkEffect)->GetMaxLevel(
  1592         ret = static_cast<TMSGainEffect*> (iTmsUplinkEffect)->GetMaxLevel(
  1595                 iMaxGain);
  1593                 iMaxGain);
  1596         RDebug::Printf("[TMS STIF] GAIN, GetMaxLevel Level [%d] Ret Err [%d]", iMaxGain, ret);
  1594         RDebug::Printf("[TMS STIF] GAIN, GetMaxLevel Level [%d] Ret Err [%d]", iMaxGain, ret);
  1597         RDebug::Printf("[TMS STIF] GAIN, SetLevel to [%d]", iMaxGain);
  1595         RDebug::Printf("[TMS STIF] GAIN, SetLevel to [%d]", iMaxGain);
  1598         ret = static_cast<TMSGainEffect*>(iTmsUplinkEffect)->SetLevel(iMaxGain);
  1596         ret = static_cast<TMSGainEffect*>(iTmsUplinkEffect)->SetLevel(iMaxGain);
  1599         RDebug::Printf("[TMS STIF] GAIN, SetLevel ret [%d]", ret);
  1597         RDebug::Printf("[TMS STIF] GAIN, SetLevel ret [%d]", ret);
  1600         iLog->Log(_L("SetMaxGain: %d"), iMaxGain);
  1598         iLog->Log(_L("SetMaxGain: %d"), iMaxGain);
  1601         RDebug::Printf("[TMS STIF] GAIN, GetLevel");
  1599         RDebug::Printf("[TMS STIF] GAIN, GetLevel");
  1602         ret = static_cast<TMSGainEffect*>(iTmsUplinkEffect)->GetLevel(iGain);
  1600         ret = static_cast<TMSGainEffect*> (iTmsUplinkEffect)->GetLevel(iGain);
  1603         RDebug::Printf("[TMS STIF] GAIN, Exp Level [%d] Ret Level [%d] Ret Err [%d]", iMaxGain, iGain, ret);
  1601         RDebug::Printf("[TMS STIF] GAIN, Exp Level [%d] Ret Level [%d] Ret Err [%d]", iMaxGain, iGain, ret);
  1604         if (iGain != iMaxGain)
  1602         if (iGain != iMaxGain)
  1605             {
  1603             {
  1606             iLog->Log(_L("GetGain doesn't return expected MaxGain!!! returned Gain = %d"), iGain);
  1604             iLog->Log(_L("GetGain doesn't return expected MaxGain!!! returned Gain = %d"), iGain);
  1607             return KErrUnexpectedValue;
  1605             return KErrUnexpectedValue;
  1608             }
  1606             }
  1609 
  1607 
  1610         static_cast<TMSGainEffect*>(iTmsUplinkEffect)->SetLevel(0);
  1608         static_cast<TMSGainEffect*> (iTmsUplinkEffect)->SetLevel(0);
  1611         iLog->Log(_L("MuteMic"));
  1609         iLog->Log(_L("MuteMic"));
  1612         static_cast<TMSGainEffect*>(iTmsUplinkEffect)->GetLevel(iGain);
  1610         static_cast<TMSGainEffect*> (iTmsUplinkEffect)->GetLevel(iGain);
  1613 
  1611 
  1614         if (iGain != 0)
  1612         if (iGain != 0)
  1615             {
  1613             {
  1616             iLog->Log(_L("GetGain does not return expected Mute value!!! returned Gain = %d"), iGain);
  1614             iLog->Log(_L("GetGain does not return expected Mute value!!! returned Gain = %d"), iGain);
  1617             return KErrUnexpectedValue;
  1615             return KErrUnexpectedValue;
  1618             }
  1616             }
  1619         }
  1617         }
  1620     else if (effecttype == TMS_EFFECT_GLOBAL_GAIN)
  1618     else if (effecttype == TMS_EFFECT_GLOBAL_GAIN)
  1621         {
  1619         {
  1622         RDebug::Printf("[TMS STIF] GLOBAL GAIN, GetMaxLevel");
  1620         RDebug::Printf("[TMS STIF] GLOBAL GAIN, GetMaxLevel");
  1623         ret = static_cast<TMSGlobalGainEffect*>(iGlobalGain)->GetMaxLevel(
  1621         ret = static_cast<TMSGlobalGainEffect*> (iGlobalGain)->GetMaxLevel(
  1624                 iMaxGain);
  1622                 iMaxGain);
  1625         RDebug::Printf("[TMS STIF] GLOBAL GAIN, GetMaxLevel Level [%d] Ret Err [%d]", iMaxGain, ret);
  1623         RDebug::Printf("[TMS STIF] GLOBAL GAIN, GetMaxLevel Level [%d] Ret Err [%d]", iMaxGain, ret);
  1626         RDebug::Printf("[TMS STIF] GLOBAL GAIN, SetLevel to [%d]", iMaxGain);
  1624         RDebug::Printf("[TMS STIF] GLOBAL GAIN, SetLevel to [%d]", iMaxGain);
  1627         ret = static_cast<TMSGlobalGainEffect*>(iGlobalGain)->SetLevel(
  1625         ret = static_cast<TMSGlobalGainEffect*> (iGlobalGain)->SetLevel(
  1628                 iMaxGain);
  1626                 iMaxGain);
  1629         RDebug::Printf("[TMS STIF] GLOBAL GAIN, SetLevel ret [%d]", ret);
  1627         RDebug::Printf("[TMS STIF] GLOBAL GAIN, SetLevel ret [%d]", ret);
  1630         iLog->Log(_L("SetGlobleMaxGain: %d"), iMaxGain);
  1628         iLog->Log(_L("SetGlobalMaxGain: %d"), iMaxGain);
  1631         RDebug::Printf("[TMS STIF] GLOBAL GAIN, GetLevel");
  1629         RDebug::Printf("[TMS STIF] GLOBAL GAIN, GetLevel");
  1632         ret = static_cast<TMSGlobalGainEffect*>(iGlobalGain)->GetLevel(iGain);
  1630         ret = static_cast<TMSGlobalGainEffect*>(iGlobalGain)->GetLevel(iGain);
  1633         RDebug::Printf("[TMS STIF] GLOBAL GAIN, Exp Level [%d] Ret Level [%d] Ret Err [%d]", iMaxGain, iGain, ret);
  1631         RDebug::Printf("[TMS STIF] GLOBAL GAIN, Exp Level [%d] Ret Level [%d] Ret Err [%d]", iMaxGain, iGain, ret);
  1634         if (iGain != iMaxGain)
  1632         if (iGain != iMaxGain)
  1635             {
  1633             {
  1636             iLog->Log(_L("GetGain doesn't return expected Globle MaxGain!!! returned Gain = %d"), iGain);
  1634             iLog->Log(_L("GetGain doesn't return expected Global MaxGain!!! returned Gain = %d"), iGain);
  1637             return KErrUnexpectedValue;
  1635             return KErrUnexpectedValue;
  1638             }
  1636             }
  1639 
  1637 
  1640         static_cast<TMSGlobalGainEffect*>(iGlobalGain)->SetLevel(0);
  1638         static_cast<TMSGlobalGainEffect*> (iGlobalGain)->SetLevel(0);
  1641         iLog->Log(_L("MuteMic"));
  1639         iLog->Log(_L("MuteMic"));
  1642         static_cast<TMSGlobalGainEffect*>(iGlobalGain)->GetLevel(iGain);
  1640         static_cast<TMSGlobalGainEffect*> (iGlobalGain)->GetLevel(iGain);
  1643 
  1641 
  1644         if (iGain != 0)
  1642         if (iGain != 0)
  1645             {
  1643             {
  1646             iLog->Log(_L("GetGain does not return expected loble Mute value!!! returned Gain = %d"), iGain);
  1644             iLog->Log(_L("GetGain does not return expected loble Mute value!!! returned Gain = %d"), iGain);
  1647             return KErrUnexpectedValue;
  1645             return KErrUnexpectedValue;
  1663     aItem.GetNextInt(effecttype);
  1661     aItem.GetNextInt(effecttype);
  1664 
  1662 
  1665     if (effecttype == TMS_EFFECT_VOLUME)
  1663     if (effecttype == TMS_EFFECT_VOLUME)
  1666         {
  1664         {
  1667         RDebug::Printf("[TMS STIF] Volume, GetMaxLevel");
  1665         RDebug::Printf("[TMS STIF] Volume, GetMaxLevel");
  1668         ret = static_cast<TMSVolumeEffect*>(iTmsDnlinkEffect)->GetMaxLevel(
  1666         ret = static_cast<TMSVolumeEffect*> (iTmsDnlinkEffect)->GetMaxLevel(
  1669                 iMaxVolume);
  1667                 iMaxVolume);
  1670         RDebug::Printf("[TMS STIF] MaxLevel [%d] Ret Error [%d]", iMaxVolume, ret);
  1668         RDebug::Printf("[TMS STIF] MaxLevel [%d] Ret Error [%d]", iMaxVolume, ret);
  1671         RDebug::Printf("[TMS STIF] Volume, SetLevel to MaxLevel [%d]", iMaxVolume);
  1669         RDebug::Printf("[TMS STIF] Volume, SetLevel to MaxLevel [%d]", iMaxVolume);
  1672         ret = static_cast<TMSVolumeEffect*>(iTmsDnlinkEffect)->SetLevel(
  1670         ret = static_cast<TMSVolumeEffect*> (iTmsDnlinkEffect)->SetLevel(
  1673                 iMaxVolume);
  1671                 iMaxVolume);
  1674         RDebug::Printf("[TMS STIF] SetLevel Ret Error [%d]", ret);
  1672         RDebug::Printf("[TMS STIF] SetLevel Ret Error [%d]", ret);
  1675         iLog->Log(_L("SetMaxVolume: %d"), iMaxVolume);
  1673         iLog->Log(_L("SetMaxVolume: %d"), iMaxVolume);
  1676         RDebug::Printf("[TMS STIF] GetLevel");
  1674         RDebug::Printf("[TMS STIF] GetLevel");
  1677         ret = static_cast<TMSVolumeEffect*>(iTmsDnlinkEffect)->GetLevel(
  1675         ret = static_cast<TMSVolumeEffect*> (iTmsDnlinkEffect)->GetLevel(
  1678                 iVolume);
  1676                 iVolume);
  1679         RDebug::Printf("[TMS STIF] Level [%d] Ret Error [%d]", iVolume, ret);
  1677         RDebug::Printf("[TMS STIF] Level [%d] Ret Error [%d]", iVolume, ret);
  1680         if (iVolume != iMaxVolume)
  1678         if (iVolume != iMaxVolume)
  1681             {
  1679             {
  1682             iLog->Log(_L("GetVolume doesn't return expected MaxVolume!!! returned Volume = %d"), iVolume);
  1680             iLog->Log(_L("GetVolume doesn't return expected MaxVolume!!! returned Volume = %d"), iVolume);
  1683             return KErrUnexpectedValue;
  1681             return KErrUnexpectedValue;
  1684             }
  1682             }
  1685 
  1683 
  1686         RDebug::Printf("[TMS STIF] Volume, SetLevel to 0 ");
  1684         RDebug::Printf("[TMS STIF] Volume, SetLevel to 0 ");
  1687         ret = static_cast<TMSVolumeEffect*>(iTmsDnlinkEffect)->SetLevel(0);
  1685         ret = static_cast<TMSVolumeEffect*> (iTmsDnlinkEffect)->SetLevel(0);
  1688         RDebug::Printf("[TMS STIF] SetLevel Ret Error [%d]", ret);
  1686         RDebug::Printf("[TMS STIF] SetLevel Ret Error [%d]", ret);
  1689         iLog->Log(_L("Mute Volume"));
  1687         iLog->Log(_L("Mute Volume"));
  1690         ret = static_cast<TMSVolumeEffect*>(iTmsDnlinkEffect)->GetLevel(
  1688         ret = static_cast<TMSVolumeEffect*> (iTmsDnlinkEffect)->GetLevel(
  1691                 iVolume);
  1689                 iVolume);
  1692         RDebug::Printf("[TMS STIF] Level [%d] Ret Error [%d]", iVolume, ret);
  1690         RDebug::Printf("[TMS STIF] Level [%d] Ret Error [%d]", iVolume, ret);
  1693         if (iVolume != 0)
  1691         if (iVolume != 0)
  1694             {
  1692             {
  1695             iLog->Log(_L("GetVolume does not return expected Mute value!!! returned Volume = %d"), iVolume);
  1693             iLog->Log(_L("GetVolume does not return expected Mute value!!! returned Volume = %d"), iVolume);
  1697             }
  1695             }
  1698         }
  1696         }
  1699     else if (effecttype == TMS_EFFECT_GLOBAL_VOL)
  1697     else if (effecttype == TMS_EFFECT_GLOBAL_VOL)
  1700         {
  1698         {
  1701         RDebug::Printf("[TMS STIF] GLOBAL_VOL, Get Current Level");
  1699         RDebug::Printf("[TMS STIF] GLOBAL_VOL, Get Current Level");
  1702         ret = static_cast<TMSGlobalVolEffect*>(iGlobalVol)->GetLevel(iVolume);
  1700         ret = static_cast<TMSGlobalVolEffect*> (iGlobalVol)->GetLevel(iVolume);
  1703         RDebug::Printf("[TMS STIF] Current Vol Level [%d] Ret Error [%d]", iVolume, ret);
  1701         RDebug::Printf("[TMS STIF] Current Vol Level [%d] Ret Error [%d]", iVolume, ret);
  1704         RDebug::Printf("[TMS STIF] GLOBAL_VOL, GetMaxLevel");
  1702         RDebug::Printf("[TMS STIF] GLOBAL_VOL, GetMaxLevel");
  1705         ret = static_cast<TMSGlobalVolEffect*>(iGlobalVol)->GetMaxLevel(
  1703         ret = static_cast<TMSGlobalVolEffect*> (iGlobalVol)->GetMaxLevel(
  1706                 iMaxVolume);
  1704                 iMaxVolume);
  1707         RDebug::Printf("[TMS STIF] MaxLevel [%d] Ret Error [%d]", iMaxVolume, ret);
  1705         RDebug::Printf("[TMS STIF] MaxLevel [%d] Ret Error [%d]", iMaxVolume, ret);
  1708         RDebug::Printf("[TMS STIF] GLOBAL_VOL, SetLevel to [%d]", iMaxVolume);
  1706         RDebug::Printf("[TMS STIF] GLOBAL_VOL, SetLevel to [%d]", iMaxVolume);
  1709         ret = static_cast<TMSGlobalVolEffect*>(iGlobalVol)->SetLevel(
  1707         ret = static_cast<TMSGlobalVolEffect*> (iGlobalVol)->SetLevel(
  1710                 iMaxVolume);
  1708                 iMaxVolume);
  1711         RDebug::Printf("[TMS STIF] SetLevel Ret Error [%d]", ret);
  1709         RDebug::Printf("[TMS STIF] SetLevel Ret Error [%d]", ret);
  1712         iLog->Log(_L("SetMaxGlobleVolume: %d"), iMaxVolume);
  1710         iLog->Log(_L("SetMaxGlobalVolume: %d"), iMaxVolume);
  1713         RDebug::Printf("[TMS STIF] GLOBAL_VOL,GetLevel");
  1711         RDebug::Printf("[TMS STIF] GLOBAL_VOL,GetLevel");
  1714         ret = static_cast<TMSGlobalVolEffect*>(iGlobalVol)->GetLevel(iVolume);
  1712         ret = static_cast<TMSGlobalVolEffect*> (iGlobalVol)->GetLevel(iVolume);
  1715         RDebug::Printf("[TMS STIF] Expected Level [%d] Ret Level [%d] Ret Error [%d]", iMaxVolume, iVolume, ret);
  1713         RDebug::Printf("[TMS STIF] Expected Level [%d] Ret Level [%d] Ret Error [%d]", iMaxVolume, iVolume, ret);
  1716         iLog->Log(_L("GetMaxGlobleVolume: %d"), iVolume);
  1714         iLog->Log(_L("GetMaxGlobalVolume: %d"), iVolume);
  1717         if (iVolume != iMaxVolume)
  1715         if (iVolume != iMaxVolume)
  1718             {
  1716             {
  1719             iLog->Log(_L("GetGlobleVolume doesn't return expected MaxVolume!!! returned Volume = %d"), iVolume);
  1717             iLog->Log(_L("GetGlobalVolume doesn't return expected MaxVolume!!! returned Volume = %d"), iVolume);
  1720             return KErrUnexpectedValue;
  1718             return KErrUnexpectedValue;
  1721             }
  1719             }
  1722 
  1720 
  1723         static_cast<TMSGlobalVolEffect*>(iGlobalVol)->SetLevel(0);
  1721         static_cast<TMSGlobalVolEffect*> (iGlobalVol)->SetLevel(0);
  1724         iLog->Log(_L("Mute Globle Volume"));
  1722         iLog->Log(_L("Mute Global Volume"));
  1725         static_cast<TMSGlobalVolEffect*>(iGlobalVol)->GetLevel(iVolume);
  1723         static_cast<TMSGlobalVolEffect*> (iGlobalVol)->GetLevel(iVolume);
  1726 
  1724 
  1727         if (iVolume != 0)
  1725         if (iVolume != 0)
  1728             {
  1726             {
  1729             iLog->Log(_L("GetGlobleVolume does not return expected Mute value!!! returned Volume = %d"), iVolume);
  1727             iLog->Log(_L("GetGlobalVolume does not return expected Mute value!!! returned Volume = %d"), iVolume);
  1730             return KErrUnexpectedValue;
  1728             return KErrUnexpectedValue;
  1731             }
  1729             }
  1732         }
  1730         }
  1733     else
  1731     else
  1734         {
  1732         {
  1806             }
  1804             }
  1807         }
  1805         }
  1808     return error;
  1806     return error;
  1809     }
  1807     }
  1810 
  1808 
  1811 TInt CTmsAudioServicesTestClass::AddGlobalRoutingObserver(CStifItemParser& /*aItem */)
  1809 TInt CTmsAudioServicesTestClass::AddGlobalRoutingObserver(
       
  1810         CStifItemParser& /*aItem */)
  1812     {
  1811     {
  1813     iLog->Log(_L("CTmsAudioServicesTestClass::AddGlobalRoutingObserver"));
  1812     iLog->Log(_L("CTmsAudioServicesTestClass::AddGlobalRoutingObserver"));
  1814     TInt error = KErrNone;
  1813     TInt error = KErrNone;
  1815 
  1814 
  1816     if (iTmsGlobalRouting)
  1815     if (iTmsGlobalRouting)
  1823         iLog->Log(_L("CTmsAudioServicesTestClass::AddGlobalRoutingObserver failed error [%d]"), error);
  1822         iLog->Log(_L("CTmsAudioServicesTestClass::AddGlobalRoutingObserver failed error [%d]"), error);
  1824         }
  1823         }
  1825     return error;
  1824     return error;
  1826     }
  1825     }
  1827 
  1826 
  1828 TInt CTmsAudioServicesTestClass::DeleteGlobalRoutingObserver(CStifItemParser& /*aItem*/)
  1827 TInt CTmsAudioServicesTestClass::DeleteGlobalRoutingObserver(
       
  1828         CStifItemParser& /*aItem*/)
  1829     {
  1829     {
  1830     iLog->Log(_L("CTmsAu dioServicesTestClass::DeleteGlobalRoutingObserver"));
  1830     iLog->Log(_L("CTmsAu dioServicesTestClass::DeleteGlobalRoutingObserver"));
  1831     TInt error = KErrNone;
  1831     TInt error = KErrNone;
  1832 
  1832 
  1833     if (iTmsGlobalRouting)
  1833     if (iTmsGlobalRouting)
  1896             iLog-> Log(KMsgBadTestParameters);
  1896             iLog-> Log(KMsgBadTestParameters);
  1897             error = KErrBadTestParameter;
  1897             error = KErrBadTestParameter;
  1898             return error;
  1898             return error;
  1899             }
  1899             }
  1900 
  1900 
  1901         AddExpectedEvent(ESetOutputComplete, KLongTimeout);
  1901         AddExpectedEvent(ESetOutputComplete, KShortTimeout);
  1902         }
  1902         }
  1903 
  1903 
  1904     return error;
  1904     return error;
  1905     }
  1905     }
  1906 
  1906 
  2157         {
  2157         {
  2158         if (bitRate == KTagMin)
  2158         if (bitRate == KTagMin)
  2159             {
  2159             {
  2160             if (iBitratesVector.size() > 0)
  2160             if (iBitratesVector.size() > 0)
  2161                 {
  2161                 {
  2162                 std::vector<guint>::iterator iBitrate =
  2162                 std::vector<guint>::iterator iBitrate = iBitratesVector.begin();
  2163                         iBitratesVector.begin();
       
  2164                 error = iTmsFormatUp -> SetBitRate(*iBitrate);
  2163                 error = iTmsFormatUp -> SetBitRate(*iBitrate);
  2165                 iLog->Log(_L("BR set %d"), *iBitrate);
  2164                 iLog->Log(_L("BR set %d"), *iBitrate);
  2166                 }
  2165                 }
  2167             }
  2166             }
  2168         else if (bitRate == KTagMax)
  2167         else if (bitRate == KTagMax)
  2239     TBool aVad;
  2238     TBool aVad;
  2240 
  2239 
  2241     switch (iUpLinkCodec)
  2240     switch (iUpLinkCodec)
  2242         {
  2241         {
  2243         case TMS_FORMAT_G711:
  2242         case TMS_FORMAT_G711:
  2244             error = static_cast<TMSG711Format*>(iTmsFormatUp)->GetVADMode(aVad);
  2243             error = static_cast<TMSG711Format*> (iTmsFormatUp)->GetVADMode(
       
  2244                     aVad);
  2245             break;
  2245             break;
  2246         case TMS_FORMAT_G729:
  2246         case TMS_FORMAT_G729:
  2247             error = static_cast<TMSG729Format*>(iTmsFormatUp)->GetVADMode(aVad);
  2247             error = static_cast<TMSG729Format*> (iTmsFormatUp)->GetVADMode(
       
  2248                     aVad);
  2248             break;
  2249             break;
  2249         case TMS_FORMAT_ILBC:
  2250         case TMS_FORMAT_ILBC:
  2250             error = static_cast<TMSILBCFormat*>(iTmsFormatUp)->GetVADMode(aVad);
  2251             error = static_cast<TMSILBCFormat*> (iTmsFormatUp)->GetVADMode(
       
  2252                     aVad);
  2251             break;
  2253             break;
  2252         default:
  2254         default:
  2253             break;
  2255             break;
  2254         }
  2256         }
  2255 
  2257 
  2270     iVad = (iVad) ? EFalse : ETrue;
  2272     iVad = (iVad) ? EFalse : ETrue;
  2271 
  2273 
  2272     switch (iUpLinkCodec)
  2274     switch (iUpLinkCodec)
  2273         {
  2275         {
  2274         case TMS_FORMAT_G711:
  2276         case TMS_FORMAT_G711:
  2275             error = static_cast<TMSG711Format*>(iTmsFormatUp)->SetVADMode(iVad);
  2277             error = static_cast<TMSG711Format*> (iTmsFormatUp)->SetVADMode(
       
  2278                     iVad);
  2276             break;
  2279             break;
  2277         case TMS_FORMAT_G729:
  2280         case TMS_FORMAT_G729:
  2278             error = static_cast<TMSG729Format*>(iTmsFormatUp)->SetVADMode(iVad);
  2281             error = static_cast<TMSG729Format*> (iTmsFormatUp)->SetVADMode(
       
  2282                     iVad);
  2279             break;
  2283             break;
  2280         case TMS_FORMAT_ILBC:
  2284         case TMS_FORMAT_ILBC:
  2281             error = static_cast<TMSILBCFormat*>(iTmsFormatUp)->SetVADMode(iVad);
  2285             error = static_cast<TMSILBCFormat*> (iTmsFormatUp)->SetVADMode(
       
  2286                     iVad);
  2282             break;
  2287             break;
  2283         default:
  2288         default:
  2284             break;
  2289             break;
  2285         }
  2290         }
  2286     iLog->Log(_L("VAD set: %d"), iVad);
  2291     iLog->Log(_L("VAD set: %d"), iVad);
  2296     if (error == KErrNone)
  2301     if (error == KErrNone)
  2297         {
  2302         {
  2298         if ((linkType == KTagUplink) && (iUpLinkCodec == TMS_FORMAT_G711))
  2303         if ((linkType == KTagUplink) && (iUpLinkCodec == TMS_FORMAT_G711))
  2299             {
  2304             {
  2300             TMSG711CodecMode aMode;
  2305             TMSG711CodecMode aMode;
  2301             static_cast<TMSG711Format*>(iTmsFormatUp)->GetMode(aMode);
  2306             static_cast<TMSG711Format*> (iTmsFormatUp)->GetMode(aMode);
  2302 
  2307 
  2303             if (aMode == TMS_G711_CODEC_MODE_ALAW)
  2308             if (aMode == TMS_G711_CODEC_MODE_ALAW)
  2304                 {
  2309                 {
  2305                 iLog->Log(_L("UPL Mode: aLaw"));
  2310                 iLog->Log(_L("UPL Mode: aLaw"));
  2306                 }
  2311                 }
  2315             }
  2320             }
  2316         else if ((linkType == KTagUplink)
  2321         else if ((linkType == KTagUplink)
  2317                 && (iUpLinkCodec == TMS_FORMAT_ILBC))
  2322                 && (iUpLinkCodec == TMS_FORMAT_ILBC))
  2318             {
  2323             {
  2319             TMSILBCCodecMode aMode;
  2324             TMSILBCCodecMode aMode;
  2320             static_cast<TMSILBCFormat*>(iTmsFormatUp)->GetMode(aMode);
  2325             static_cast<TMSILBCFormat*> (iTmsFormatUp)->GetMode(aMode);
  2321 
  2326 
  2322             if (aMode == TMS_ILBC_CODEC_MODE_20MS_FRAME)
  2327             if (aMode == TMS_ILBC_CODEC_MODE_20MS_FRAME)
  2323                 {
  2328                 {
  2324                 iLog->Log(_L("UPL Mode: 20ms frame"));
  2329                 iLog->Log(_L("UPL Mode: 20ms frame"));
  2325                 }
  2330                 }
  2334             }
  2339             }
  2335         else if ((linkType == KTagDnlink)
  2340         else if ((linkType == KTagDnlink)
  2336                 && (iDnLinkCodec == TMS_FORMAT_G711))
  2341                 && (iDnLinkCodec == TMS_FORMAT_G711))
  2337             {
  2342             {
  2338             TMSG711CodecMode aMode;
  2343             TMSG711CodecMode aMode;
  2339             static_cast<TMSG711Format*>(iTmsFormatDn)->GetMode(aMode);
  2344             static_cast<TMSG711Format*> (iTmsFormatDn)->GetMode(aMode);
  2340 
  2345 
  2341             if (aMode == TMS_G711_CODEC_MODE_ALAW)
  2346             if (aMode == TMS_G711_CODEC_MODE_ALAW)
  2342                 {
  2347                 {
  2343                 iLog->Log(_L("DNL Mode: aLaw"));
  2348                 iLog->Log(_L("DNL Mode: aLaw"));
  2344                 }
  2349                 }
  2353             }
  2358             }
  2354         else if ((linkType == KTagDnlink)
  2359         else if ((linkType == KTagDnlink)
  2355                 && (iDnLinkCodec == TMS_FORMAT_ILBC))
  2360                 && (iDnLinkCodec == TMS_FORMAT_ILBC))
  2356             {
  2361             {
  2357             TMSILBCCodecMode aMode;
  2362             TMSILBCCodecMode aMode;
  2358             static_cast<TMSILBCFormat*>(iTmsFormatDn)->GetMode(aMode);
  2363             static_cast<TMSILBCFormat*> (iTmsFormatDn)->GetMode(aMode);
  2359 
  2364 
  2360             if (aMode == TMS_ILBC_CODEC_MODE_20MS_FRAME)
  2365             if (aMode == TMS_ILBC_CODEC_MODE_20MS_FRAME)
  2361                 {
  2366                 {
  2362                 iLog->Log(_L("DNL Mode: 20ms frame"));
  2367                 iLog->Log(_L("DNL Mode: 20ms frame"));
  2363                 }
  2368                 }
  2396         {
  2401         {
  2397         if ((linkType == KTagUplink) && (iUpLinkCodec == TMS_FORMAT_G711)
  2402         if ((linkType == KTagUplink) && (iUpLinkCodec == TMS_FORMAT_G711)
  2398                 && (mode == KTagALaw))
  2403                 && (mode == KTagALaw))
  2399             {
  2404             {
  2400             iLog->Log(_L("UPL Mode Set: aLaw"));
  2405             iLog->Log(_L("UPL Mode Set: aLaw"));
  2401             static_cast<TMSG711Format*>(iTmsFormatUp)->SetMode(
  2406             static_cast<TMSG711Format*> (iTmsFormatUp)->SetMode(
  2402                     TMS_G711_CODEC_MODE_ALAW);
  2407                     TMS_G711_CODEC_MODE_ALAW);
  2403             }
  2408             }
  2404         else if ((linkType == KTagUplink)
  2409         else if ((linkType == KTagUplink)
  2405                 && (iUpLinkCodec == TMS_FORMAT_G711) && (mode == KTagULaw))
  2410                 && (iUpLinkCodec == TMS_FORMAT_G711) && (mode == KTagULaw))
  2406             {
  2411             {
  2407             iLog->Log(_L("UPL Mode Set: uLaw"));
  2412             iLog->Log(_L("UPL Mode Set: uLaw"));
  2408             static_cast<TMSG711Format*>(iTmsFormatUp)->SetMode(
  2413             static_cast<TMSG711Format*> (iTmsFormatUp)->SetMode(
  2409                     TMS_G711_CODEC_MODE_MULAW);
  2414                     TMS_G711_CODEC_MODE_MULAW);
  2410             }
  2415             }
  2411         else if ((linkType == KTagUplink)
  2416         else if ((linkType == KTagUplink)
  2412                 && (iUpLinkCodec == TMS_FORMAT_ILBC) && (mode == KTag20ms))
  2417                 && (iUpLinkCodec == TMS_FORMAT_ILBC) && (mode == KTag20ms))
  2413             {
  2418             {
  2414             iLog->Log(_L("UPL Mode Set: 20ms frame"));
  2419             iLog->Log(_L("UPL Mode Set: 20ms frame"));
  2415             static_cast<TMSILBCFormat*>(iTmsFormatUp)->SetMode(
  2420             static_cast<TMSILBCFormat*> (iTmsFormatUp)->SetMode(
  2416                     TMS_ILBC_CODEC_MODE_20MS_FRAME);
  2421                     TMS_ILBC_CODEC_MODE_20MS_FRAME);
  2417             }
  2422             }
  2418         else if ((linkType == KTagUplink)
  2423         else if ((linkType == KTagUplink)
  2419                 && (iUpLinkCodec == TMS_FORMAT_ILBC) && (mode == KTag30ms))
  2424                 && (iUpLinkCodec == TMS_FORMAT_ILBC) && (mode == KTag30ms))
  2420             {
  2425             {
  2421             iLog->Log(_L("UPL Mode Set: 30ms frame"));
  2426             iLog->Log(_L("UPL Mode Set: 30ms frame"));
  2422             static_cast<TMSILBCFormat*>(iTmsFormatUp)->SetMode(
  2427             static_cast<TMSILBCFormat*> (iTmsFormatUp)->SetMode(
  2423                     TMS_ILBC_CODEC_MODE_30MS_FRAME);
  2428                     TMS_ILBC_CODEC_MODE_30MS_FRAME);
  2424             }
  2429             }
  2425         else if ((linkType == KTagDnlink)
  2430         else if ((linkType == KTagDnlink)
  2426                 && (iDnLinkCodec == TMS_FORMAT_G711) && (mode == KTagALaw))
  2431                 && (iDnLinkCodec == TMS_FORMAT_G711) && (mode == KTagALaw))
  2427             {
  2432             {
  2428             iLog->Log(_L("DNL Mode Set: aLaw"));
  2433             iLog->Log(_L("DNL Mode Set: aLaw"));
  2429             static_cast<TMSG711Format*>(iTmsFormatDn)->SetMode(
  2434             static_cast<TMSG711Format*> (iTmsFormatDn)->SetMode(
  2430                     TMS_G711_CODEC_MODE_ALAW);
  2435                     TMS_G711_CODEC_MODE_ALAW);
  2431             }
  2436             }
  2432         else if ((linkType == KTagDnlink)
  2437         else if ((linkType == KTagDnlink)
  2433                 && (iDnLinkCodec == TMS_FORMAT_G711) && (mode == KTagULaw))
  2438                 && (iDnLinkCodec == TMS_FORMAT_G711) && (mode == KTagULaw))
  2434             {
  2439             {
  2435             iLog->Log(_L("DNL Mode Set: uLaw"));
  2440             iLog->Log(_L("DNL Mode Set: uLaw"));
  2436             static_cast<TMSG711Format*>(iTmsFormatDn)->SetMode(
  2441             static_cast<TMSG711Format*> (iTmsFormatDn)->SetMode(
  2437                     TMS_G711_CODEC_MODE_MULAW);
  2442                     TMS_G711_CODEC_MODE_MULAW);
  2438             }
  2443             }
  2439         else if ((linkType == KTagDnlink)
  2444         else if ((linkType == KTagDnlink)
  2440                 && (iDnLinkCodec == TMS_FORMAT_ILBC) && (mode == KTag20ms))
  2445                 && (iDnLinkCodec == TMS_FORMAT_ILBC) && (mode == KTag20ms))
  2441             {
  2446             {
  2442             iLog->Log(_L("DNL Mode Set: 20ms frame"));
  2447             iLog->Log(_L("DNL Mode Set: 20ms frame"));
  2443             static_cast<TMSILBCFormat*>(iTmsFormatDn)->SetMode(
  2448             static_cast<TMSILBCFormat*> (iTmsFormatDn)->SetMode(
  2444                     TMS_ILBC_CODEC_MODE_20MS_FRAME);
  2449                     TMS_ILBC_CODEC_MODE_20MS_FRAME);
  2445             }
  2450             }
  2446         else if ((linkType == KTagDnlink)
  2451         else if ((linkType == KTagDnlink)
  2447                 && (iDnLinkCodec == TMS_FORMAT_ILBC) && (mode == KTag30ms))
  2452                 && (iDnLinkCodec == TMS_FORMAT_ILBC) && (mode == KTag30ms))
  2448             {
  2453             {
  2449             iLog->Log(_L("DNL Mode Set: 30ms frame"));
  2454             iLog->Log(_L("DNL Mode Set: 30ms frame"));
  2450             static_cast<TMSILBCFormat*>(iTmsFormatDn)->SetMode(
  2455             static_cast<TMSILBCFormat*> (iTmsFormatDn)->SetMode(
  2451                     TMS_ILBC_CODEC_MODE_30MS_FRAME);
  2456                     TMS_ILBC_CODEC_MODE_30MS_FRAME);
  2452             }
  2457             }
  2453         else
  2458         else
  2454             {
  2459             {
  2455             iLog->Log(KMsgBadTestParameters);
  2460             iLog->Log(KMsgBadTestParameters);
  2466     TInt error = KErrNone;
  2471     TInt error = KErrNone;
  2467     TBool aCng = EFalse;
  2472     TBool aCng = EFalse;
  2468     switch (iDnLinkCodec)
  2473     switch (iDnLinkCodec)
  2469         {
  2474         {
  2470         case TMS_FORMAT_G711:
  2475         case TMS_FORMAT_G711:
  2471             error = static_cast<TMSG711Format*>(iTmsFormatDn)->GetCNG(aCng);
  2476             error = static_cast<TMSG711Format*> (iTmsFormatDn)->GetCNG(aCng);
  2472             iLog->Log(_L("CNG: %d"), aCng);
  2477             iLog->Log(_L("CNG: %d"), aCng);
  2473             break;
  2478             break;
  2474         case TMS_FORMAT_ILBC:
  2479         case TMS_FORMAT_ILBC:
  2475             error = static_cast<TMSILBCFormat*>(iTmsFormatDn)->GetCNG(aCng);
  2480             error = static_cast<TMSILBCFormat*> (iTmsFormatDn)->GetCNG(aCng);
  2476             iLog->Log(_L("CNG: %d"), aCng);
  2481             iLog->Log(_L("CNG: %d"), aCng);
  2477             break;
  2482             break;
  2478         default:
  2483         default:
  2479             break;
  2484             break;
  2480         }
  2485         }
  2487     return error;
  2492     return error;
  2488     }
  2493     }
  2489 
  2494 
  2490 TInt CTmsAudioServicesTestClass::ToggleCNG(CStifItemParser & /*aItem*/)
  2495 TInt CTmsAudioServicesTestClass::ToggleCNG(CStifItemParser & /*aItem*/)
  2491     {
  2496     {
  2492 
       
  2493     iLog ->Log(_L("CTmsAudioServicesTestClass::ToggleCNG"));
  2497     iLog ->Log(_L("CTmsAudioServicesTestClass::ToggleCNG"));
  2494     TInt error = KErrNone;
  2498     TInt error = KErrNone;
  2495     iCng = (iCng) ? EFalse : ETrue;
  2499     iCng = (iCng) ? EFalse : ETrue;
  2496     switch (iDnLinkCodec)
  2500     switch (iDnLinkCodec)
  2497         {
  2501         {
  2498         case TMS_FORMAT_G711:
  2502         case TMS_FORMAT_G711:
  2499             static_cast<TMSG711Format*>(iTmsFormatDn)->SetCNG(iCng);
  2503             static_cast<TMSG711Format*> (iTmsFormatDn)->SetCNG(iCng);
  2500             iLog->Log(_L("CNG set: %d"), iCng);
  2504             iLog->Log(_L("CNG set: %d"), iCng);
  2501             break;
  2505             break;
  2502         case TMS_FORMAT_ILBC:
  2506         case TMS_FORMAT_ILBC:
  2503             static_cast<TMSILBCFormat*>(iTmsFormatDn)->SetCNG(iCng);
  2507             static_cast<TMSILBCFormat*> (iTmsFormatDn)->SetCNG(iCng);
  2504             iLog->Log(_L("CNG set: %d"), iCng);
  2508             iLog->Log(_L("CNG set: %d"), iCng);
  2505             break;
  2509             break;
  2506         default:
  2510         default:
  2507             break;
  2511             break;
  2508         }
  2512         }
  2514     iLog->Log(_L("CTmsAudioServicesTestClass::GetPLC"));
  2518     iLog->Log(_L("CTmsAudioServicesTestClass::GetPLC"));
  2515     TInt error = KErrNone;
  2519     TInt error = KErrNone;
  2516     TBool aPlc = EFalse;
  2520     TBool aPlc = EFalse;
  2517     if (iDnLinkCodec == TMS_FORMAT_G711)
  2521     if (iDnLinkCodec == TMS_FORMAT_G711)
  2518         {
  2522         {
  2519         static_cast<TMSG711Format*>(iTmsFormatDn)->GetPlc(aPlc);
  2523         static_cast<TMSG711Format*> (iTmsFormatDn)->GetPlc(aPlc);
  2520         iLog->Log(_L("PLC: %d"), aPlc);
  2524         iLog->Log(_L("PLC: %d"), aPlc);
  2521         }
  2525         }
  2522 
  2526 
  2523     if (aPlc != iPlc)
  2527     if (aPlc != iPlc)
  2524         {
  2528         {
  2534     iLog ->Log(_L("CTmsAudioServicesTestClass::TogglePLC"));
  2538     iLog ->Log(_L("CTmsAudioServicesTestClass::TogglePLC"));
  2535     TInt error = KErrNone;
  2539     TInt error = KErrNone;
  2536     iPlc = (iPlc) ? EFalse : ETrue;
  2540     iPlc = (iPlc) ? EFalse : ETrue;
  2537     if (iDnLinkCodec == TMS_FORMAT_G711)
  2541     if (iDnLinkCodec == TMS_FORMAT_G711)
  2538         {
  2542         {
  2539         error = static_cast<TMSG711Format*>(iTmsFormatDn)->SetPlc(iPlc);
  2543         error = static_cast<TMSG711Format*> (iTmsFormatDn)->SetPlc(iPlc);
  2540         iLog->Log(_L("PLC set: %d"), iPlc);
  2544         iLog->Log(_L("PLC set: %d"), iPlc);
  2541         }
  2545         }
  2542 
  2546 
  2543     return error;
  2547     return error;
  2544     }
  2548     }
  2558     TInt error = KErrNone;
  2562     TInt error = KErrNone;
  2559     if (iTmsDnlink && iTmsClientSource)
  2563     if (iTmsDnlink && iTmsClientSource)
  2560         {
  2564         {
  2561         error = iTmsDnlink->AddSource(iTmsClientSource);
  2565         error = iTmsDnlink->AddSource(iTmsClientSource);
  2562         }
  2566         }
  2563     iLog->Log(
  2567     iLog->Log(_L("CTmsAudioServicesTestClass::AddClientSrcToDnlStream Error [%d]"), error);
  2564             _L("CTmsAudioServicesTestClass::AddClientSrcToDnlStream Error [%d]"),
       
  2565             error);
       
  2566     return error;
  2568     return error;
  2567     }
  2569     }
  2568 
  2570 
  2569 // NOTE: CS and IP
  2571 // NOTE: CS and IP
  2570 TInt CTmsAudioServicesTestClass::AddMicSrcToUplStream(CStifItemParser& /*aItem*/)
  2572 TInt CTmsAudioServicesTestClass::AddMicSrcToUplStream(CStifItemParser& /*aItem*/)
  2638     {
  2640     {
  2639     iLog->Log(_L("CTmsAudioServicesTestClass::AddSourceObserver"));
  2641     iLog->Log(_L("CTmsAudioServicesTestClass::AddSourceObserver"));
  2640     TInt error = KErrNone;
  2642     TInt error = KErrNone;
  2641     if (iTmsClientSource)
  2643     if (iTmsClientSource)
  2642         {
  2644         {
  2643         error = static_cast<TMSClientSource*>(iTmsClientSource)->AddObserver(
  2645         error = static_cast<TMSClientSource*> (iTmsClientSource)->AddObserver(
  2644                 *this, NULL);
  2646                 *this, NULL);
  2645         }
  2647         }
  2646     return error;
  2648     return error;
  2647     }
  2649     }
  2648 
  2650 
  2651     {
  2653     {
  2652     iLog->Log(_L("CTmsAudioServicesTestClass::RemoveSourceObserver"));
  2654     iLog->Log(_L("CTmsAudioServicesTestClass::RemoveSourceObserver"));
  2653     TInt error = KErrNone;
  2655     TInt error = KErrNone;
  2654     if (iTmsClientSource)
  2656     if (iTmsClientSource)
  2655         {
  2657         {
  2656         error = static_cast<TMSClientSource*>(iTmsClientSource)->RemoveObserver(
  2658         error = static_cast<TMSClientSource*> (iTmsClientSource)->RemoveObserver(*this);
  2657                 *this);
       
  2658         }
  2659         }
  2659     return error;
  2660     return error;
  2660     }
  2661     }
  2661 
  2662 
  2662 TInt CTmsAudioServicesTestClass::AddClientSinkToUplStream(
  2663 TInt CTmsAudioServicesTestClass::AddClientSinkToUplStream(
  2737     {
  2738     {
  2738     iLog ->Log(_L("CTmsAudioServicesTestClass::AddSinkObserver"));
  2739     iLog ->Log(_L("CTmsAudioServicesTestClass::AddSinkObserver"));
  2739     TInt error = KErrNone;
  2740     TInt error = KErrNone;
  2740     if (iTmsUplink && iTmsClientSink)
  2741     if (iTmsUplink && iTmsClientSink)
  2741         {
  2742         {
  2742         error = static_cast<TMSClientSink*>(iTmsClientSink)->AddObserver(*this,
  2743         error = static_cast<TMSClientSink*> (iTmsClientSink)->AddObserver(
  2743                 NULL);
  2744                 *this, NULL);
  2744         }
  2745         }
  2745     return error;
  2746     return error;
  2746     }
  2747     }
  2747 
  2748 
  2748 TInt CTmsAudioServicesTestClass::RemoveSinkObserver(CStifItemParser& /*aItem*/)
  2749 TInt CTmsAudioServicesTestClass::RemoveSinkObserver(CStifItemParser& /*aItem*/)
  2749     {
  2750     {
  2750     iLog->Log(_L("CTmsAudioServicesTestClass::RemoveSinkObserver"));
  2751     iLog->Log(_L("CTmsAudioServicesTestClass::RemoveSinkObserver"));
  2751     TInt error = KErrNone;
  2752     TInt error = KErrNone;
  2752     if (iTmsUplink && iTmsClientSink)
  2753     if (iTmsUplink && iTmsClientSink)
  2753         {
  2754         {
  2754         error = static_cast<TMSClientSink*>(iTmsClientSink)->RemoveObserver(
  2755         error = static_cast<TMSClientSink*> (iTmsClientSink)->RemoveObserver(
  2755                 *this);
  2756                 *this);
  2756         }
  2757         }
  2757     return error;
  2758     return error;
  2758     }
  2759     }
  2759 
  2760 
  2764     if (iFactory && iTmsDnlink && !iTmsDnlinkEffect)
  2765     if (iFactory && iTmsDnlink && !iTmsDnlinkEffect)
  2765         {
  2766         {
  2766         status = iFactory->CreateEffect(TMS_EFFECT_VOLUME, iTmsDnlinkEffect);
  2767         status = iFactory->CreateEffect(TMS_EFFECT_VOLUME, iTmsDnlinkEffect);
  2767         if (status == KErrNone)
  2768         if (status == KErrNone)
  2768             {
  2769             {
  2769             static_cast<TMSVolumeEffect*>(iTmsDnlinkEffect)->AddObserver(*this,
  2770             static_cast<TMSVolumeEffect*> (iTmsDnlinkEffect)->AddObserver(
  2770                     NULL);
  2771                     *this, NULL);
  2771             }
  2772             }
  2772         }
  2773         }
  2773     RDebug::Printf("[TMS STIF] CreateVolumeEffect Return [%d]", status);
  2774     RDebug::Printf("[TMS STIF] CreateVolumeEffect Return [%d]", status);
  2774     return status;
  2775     return status;
  2775     }
  2776     }
  2776 
  2777 
  2777 gint CTmsAudioServicesTestClass::CreateVolumeGlobleEffect()
  2778 gint CTmsAudioServicesTestClass::CreateVolumeGlobalEffect()
  2778     {
  2779     {
  2779     iLog->Log(_L("CTmsAudioServicesTestClass::CreateVolumeGlobleEffect"));
  2780     iLog->Log(_L("CTmsAudioServicesTestClass::CreateVolumeGlobalEffect"));
  2780     gint status(KErrNone);
  2781     gint status(KErrNone);
  2781     if (iFactory && !iGlobalVol)
  2782     if (iFactory && !iGlobalVol)
  2782         {
  2783         {
  2783         status = iFactory->CreateEffect(TMS_EFFECT_GLOBAL_VOL, iGlobalVol);
  2784         status = iFactory->CreateEffect(TMS_EFFECT_GLOBAL_VOL, iGlobalVol);
  2784 
       
  2785         if (status == KErrNone)
  2785         if (status == KErrNone)
  2786             {
  2786             {
  2787             static_cast<TMSGlobalVolEffect*>(iGlobalVol)->AddObserver(*this,
  2787             static_cast<TMSGlobalVolEffect*> (iGlobalVol)->AddObserver(*this,
  2788                     NULL);
  2788                     NULL);
  2789             iLog->Log(_L("CTmsAudioServicesTestClass::CreateVolumeGlobleEffect - AddObserver"));
  2789             iLog->Log(_L("CTmsAudioServicesTestClass::CreateVolumeGlobalEffect - AddObserver"));
  2790             }
  2790             }
  2791         }
  2791         }
  2792     RDebug::Printf("[TMS STIF] CreateVolumeGlobleEffect Return [%d]", status);
  2792     RDebug::Printf("[TMS STIF] CreateVolumeGlobalEffect Return [%d]", status);
  2793     return status;
  2793     return status;
  2794     }
  2794     }
  2795 
  2795 
  2796 TInt CTmsAudioServicesTestClass::AddVolumeEffectToStream(
  2796 TInt CTmsAudioServicesTestClass::AddVolumeEffectToStream(
  2797         CStifItemParser& /*aItem*/)
  2797         CStifItemParser& /*aItem*/)
  2803         error = iTmsDnlink->AddEffect(iTmsDnlinkEffect);
  2803         error = iTmsDnlink->AddEffect(iTmsDnlinkEffect);
  2804         }
  2804         }
  2805     return error;
  2805     return error;
  2806     }
  2806     }
  2807 
  2807 
  2808 TInt CTmsAudioServicesTestClass::AddGlobleVolumeEffectToStream(
  2808 TInt CTmsAudioServicesTestClass::AddGlobalVolumeEffectToStream(
  2809         CStifItemParser& /*aItem*/)
  2809         CStifItemParser& /*aItem*/)
  2810     {
  2810     {
  2811     iLog->Log(_L("CTmsAudioServicesTestClass::AddGlobleVolumeEffectToStream"));
  2811     iLog->Log(_L("CTmsAudioServicesTestClass::AddGlobalVolumeEffectToStream"));
  2812     TInt error = KErrNone;
  2812     TInt error = KErrNone;
  2813     if (iTmsDnlink && iGlobalVol)
  2813     if (iTmsDnlink && iGlobalVol)
  2814         {
  2814         {
  2815         error = iTmsDnlink->AddEffect(iGlobalVol);
  2815         error = iTmsDnlink->AddEffect(iGlobalVol);
  2816         }
  2816         }
  2817     return error;
  2817     return error;
  2818     }
  2818     }
  2819 
  2819 
  2820 TInt CTmsAudioServicesTestClass::RemoveGlobleVolumeEffectToStream(
  2820 TInt CTmsAudioServicesTestClass::RemoveGlobalVolumeEffectToStream(
  2821         CStifItemParser& /*aItem*/)
  2821         CStifItemParser& /*aItem*/)
  2822     {
  2822     {
  2823     iLog->Log(_L("CTmsAudioServicesTestClass::RemoveGlobleVolumeEffectToStream"));
  2823     iLog->Log(_L("CTmsAudioServicesTestClass::RemoveGlobalVolumeEffectToStream"));
  2824     TInt error = KErrNone;
  2824     TInt error = KErrNone;
  2825     if (iTmsDnlink && iGlobalVol)
  2825     if (iTmsDnlink && iGlobalVol)
  2826         {
  2826         {
  2827         error = iTmsDnlink->RemoveEffect(iGlobalVol);
  2827         error = iTmsDnlink->RemoveEffect(iGlobalVol);
  2828         }
  2828         }
  2837     if (iFactory && iTmsUplink && !iTmsUplinkEffect)
  2837     if (iFactory && iTmsUplink && !iTmsUplinkEffect)
  2838         {
  2838         {
  2839         status = iFactory->CreateEffect(TMS_EFFECT_GAIN, iTmsUplinkEffect);
  2839         status = iFactory->CreateEffect(TMS_EFFECT_GAIN, iTmsUplinkEffect);
  2840         if (status == KErrNone)
  2840         if (status == KErrNone)
  2841             {
  2841             {
  2842             static_cast<TMSGainEffect*>(iTmsUplinkEffect)->AddObserver(*this,
  2842             static_cast<TMSGainEffect*> (iTmsUplinkEffect)->AddObserver(
  2843                     NULL);
  2843                     *this, NULL);
  2844             }
  2844             }
  2845         }
  2845         }
  2846     RDebug::Printf("[TMS STIF] CreateGainEffect Return [%d]", status);
  2846     RDebug::Printf("[TMS STIF] CreateGainEffect Return [%d]", status);
  2847     return status;
  2847     return status;
  2848     }
  2848     }
  2849 
  2849 
  2850 gint CTmsAudioServicesTestClass::CreateGlobleGainEffect()
  2850 gint CTmsAudioServicesTestClass::CreateGlobalGainEffect()
  2851     {
  2851     {
  2852     iLog->Log(_L("CTmsAudioServicesTestClass::CreateGlobleGainEffect"));
  2852     iLog->Log(_L("CTmsAudioServicesTestClass::CreateGlobalGainEffect"));
  2853     gint status(KErrNone);
  2853     gint status(KErrNone);
  2854     if (iFactory && !iGlobalGain)
  2854     if (iFactory && !iGlobalGain)
  2855         {
  2855         {
  2856         status = iFactory->CreateEffect(TMS_EFFECT_GLOBAL_GAIN, iGlobalGain);
  2856         status = iFactory->CreateEffect(TMS_EFFECT_GLOBAL_GAIN, iGlobalGain);
  2857         if (status == KErrNone)
  2857         if (status == KErrNone)
  2858             {
  2858             {
  2859             static_cast<TMSGlobalGainEffect*>(iGlobalGain)->AddObserver(*this,
  2859             static_cast<TMSGlobalGainEffect*> (iGlobalGain)->AddObserver(
  2860                     NULL);
  2860                     *this, NULL);
  2861             }
  2861             }
  2862         }
  2862         }
  2863     RDebug::Printf("[TMS STIF] CreateGlobleGainEffect Return [%d]", status);
  2863     RDebug::Printf("[TMS STIF] CreateGlobalGainEffect Return [%d]", status);
  2864     return status;
  2864     return status;
  2865     }
  2865     }
  2866 
  2866 
  2867 TInt CTmsAudioServicesTestClass::AddGainEffectToStream(
  2867 TInt CTmsAudioServicesTestClass::AddGainEffectToStream(
  2868         CStifItemParser& /*aItem*/)
  2868         CStifItemParser& /*aItem*/)
  2874         error = iTmsUplink->AddEffect(iTmsUplinkEffect);
  2874         error = iTmsUplink->AddEffect(iTmsUplinkEffect);
  2875         }
  2875         }
  2876     return error;
  2876     return error;
  2877     }
  2877     }
  2878 
  2878 
  2879 TInt CTmsAudioServicesTestClass::AddGlobleGainEffectToStream(
  2879 TInt CTmsAudioServicesTestClass::AddGlobalGainEffectToStream(
  2880         CStifItemParser& /*aItem*/)
  2880         CStifItemParser& /*aItem*/)
  2881     {
  2881     {
  2882     iLog->Log(_L("CTmsAudioServicesTestClass::AddGlobleGainEffectToStream"));
  2882     iLog->Log(_L("CTmsAudioServicesTestClass::AddGlobalGainEffectToStream"));
  2883     TInt error = KErrNone;
  2883     TInt error = KErrNone;
  2884     if (iTmsUplink && iGlobalGain)
  2884     if (iTmsUplink && iGlobalGain)
  2885         {
  2885         {
  2886         error = iTmsUplink->AddEffect(iGlobalGain);
  2886         error = iTmsUplink->AddEffect(iGlobalGain);
  2887         }
  2887         }
  2888     return error;
  2888     return error;
  2889     }
  2889     }
  2890 
  2890 
  2891 TInt CTmsAudioServicesTestClass::RemoveGlobleGainEffectToStream(
  2891 TInt CTmsAudioServicesTestClass::RemoveGlobalGainEffectToStream(
  2892         CStifItemParser& /*aItem*/)
  2892         CStifItemParser& /*aItem*/)
  2893     {
  2893     {
  2894     iLog->Log(_L("CTmsAudioServicesTestClass::RemoveGlobleGainEffectToStream"));
  2894     iLog->Log(_L("CTmsAudioServicesTestClass::RemoveGlobalGainEffectToStream"));
  2895     TInt error = KErrNone;
  2895     TInt error = KErrNone;
  2896     if (iTmsUplink && iGlobalGain)
  2896     if (iTmsUplink && iGlobalGain)
  2897         {
  2897         {
  2898         error = iTmsUplink->RemoveEffect(iGlobalGain);
  2898         error = iTmsUplink->RemoveEffect(iGlobalGain);
  2899         }
  2899         }
  2923         iRecBuf->GetDataPtr(srcptr);
  2923         iRecBuf->GetDataPtr(srcptr);
  2924         iRecBuf->GetDataSize(srcsize);
  2924         iRecBuf->GetDataSize(srcsize);
  2925 
  2925 
  2926         Mem::Copy(desptr, srcptr, srcsize);
  2926         Mem::Copy(desptr, srcptr, srcsize);
  2927 
  2927 
  2928         static_cast<TMSClientSource*>(iTmsClientSource)->BufferFilled(
  2928         static_cast<TMSClientSource*> (iTmsClientSource)->BufferFilled(
  2929                 *iPlayBuf);
  2929                 *iPlayBuf);
  2930         static_cast<TMSClientSink*>(iTmsClientSink)->BufferProcessed(iRecBuf);
  2930         static_cast<TMSClientSink*> (iTmsClientSink)->BufferProcessed(iRecBuf);
  2931 
  2931 
  2932         iPlayBufReady = EFalse; // buf filled, ready for FillBuffer
  2932         iPlayBufReady = EFalse; // buf filled, ready for FillBuffer
  2933         iRecBufReady = EFalse; // buf consumed, ready for EmptyBuffer
  2933         iRecBufReady = EFalse;  // buf consumed, ready for EmptyBuffer
  2934         }
  2934         }
  2935 
  2935 
  2936     iLog->Log(_L("CTmsAudioServicesTestClass::DoLoopback END"));
  2936     iLog->Log(_L("CTmsAudioServicesTestClass::DoLoopback END"));
  2937     }
  2937     }
  2938 
  2938