multimediacommsengine/tsrc/MCETestUI/MCETestUIEngine/src/TMCETestUIEngineCmdDeleteAudioCodec.cpp
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:    Implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #include "TMCETestUIEngineCmdDeleteAudioCodec.h"
       
    21 #include "CMceTestUIEngineVideoCodec.h"
       
    22 #include "CMceTestUIEngineCodec.h"
       
    23 #include "cmcetestuiengineaudiostream.h"
       
    24 #include <mceaudiostream.h>
       
    25 #include <mceaudiocodec.h>
       
    26 #include <mceamrcodec.h>
       
    27 #include <mceg711codec.h>
       
    28 #include <mceg729codec.h>
       
    29 #include <mceilbccodec.h>
       
    30 #include <mcedtmfcodec.h>
       
    31 #include <mceredcodec.h>
       
    32 #include <mcecncodec.h>
       
    33 #include <mcedefs.h>
       
    34 #include <mcemanager.h>
       
    35 #include <mcecodec.h>
       
    36 #include <mcevideocodec.h>
       
    37 
       
    38 // -----------------------------------------------------------------------------
       
    39 // TMCETestUIEngineCmdDeleteAudioCodec::TMCETestUIEngineCmdDeleteAudioCodec
       
    40 // -----------------------------------------------------------------------------
       
    41 //
       
    42 TMCETestUIEngineCmdDeleteAudioCodec::TMCETestUIEngineCmdDeleteAudioCodec( 
       
    43 		            CMCETestUIEngine& aEngine,
       
    44 		            CMCETestUIEngineCodec& aCodec  )
       
    45     : TMCETestUIEngineCmdBase( aEngine ),
       
    46       iCodec( aCodec )
       
    47     {
       
    48     }
       
    49 
       
    50 // -----------------------------------------------------------------------------
       
    51 // TMCETestUIEngineCmdDeleteSession::ExecuteL
       
    52 // -----------------------------------------------------------------------------
       
    53 //
       
    54 EXPORT_C void TMCETestUIEngineCmdDeleteAudioCodec::ExecuteL()
       
    55 	{
       
    56 	iEngine.DeleteAudioCodec( iCodec );
       
    57 	}
       
    58 	
       
    59 // -----------------------------------------------------------------------------
       
    60 // TMCETestUIEngineCmdDeleteSession::Caption
       
    61 // -----------------------------------------------------------------------------
       
    62 //
       
    63 EXPORT_C const TDesC& TMCETestUIEngineCmdDeleteAudioCodec::Caption() const
       
    64 	{
       
    65 	return KCommandCaptionDeleteAudioCodec;
       
    66 	}
       
    67 
       
    68 
       
    69 // -----------------------------------------------------------------------------
       
    70 // TMCETestUIEngineCmdDeleteVideoCodec::TMCETestUIEngineCmdDeleteVideoCodec
       
    71 // -----------------------------------------------------------------------------
       
    72 //
       
    73 TMCETestUIEngineCmdDeleteVideoCodec::TMCETestUIEngineCmdDeleteVideoCodec( 
       
    74 		            CMCETestUIEngine& aEngine,
       
    75 		            CMCETestUIEngineVideoCodec& aCodec  )
       
    76     : TMCETestUIEngineCmdBase( aEngine ),
       
    77       iCodec( aCodec )
       
    78     {
       
    79     }
       
    80 
       
    81 // -----------------------------------------------------------------------------
       
    82 // TMCETestUIEngineCmdDeleteVideoCodec::ExecuteL
       
    83 // -----------------------------------------------------------------------------
       
    84 //
       
    85 EXPORT_C void TMCETestUIEngineCmdDeleteVideoCodec::ExecuteL()
       
    86 	{
       
    87 	iEngine.DeleteVideoCodec( iCodec );
       
    88 	}
       
    89 	
       
    90 // -----------------------------------------------------------------------------
       
    91 // TMCETestUIEngineCmdDeleteSession::Caption
       
    92 // -----------------------------------------------------------------------------
       
    93 //
       
    94 EXPORT_C const TDesC& TMCETestUIEngineCmdDeleteVideoCodec::Caption() const
       
    95 	{
       
    96 	return KCommandCaptionDeleteVideoCodec;
       
    97 	}
       
    98 // -----------------------------------------------------------------------------
       
    99 // TMCETestUIEngineCmdAddCodec::TMCETestUIEngineCmdAddCodec
       
   100 // -----------------------------------------------------------------------------
       
   101 //
       
   102 TMCETestUIEngineCmdAddCodec::TMCETestUIEngineCmdAddCodec( 
       
   103 		            CMCETestUIEngine& aEngine,
       
   104 		            CMCETestUIEngineAudioStream& aAudioStream  )
       
   105     : TMCETestUIEngineCmdBase( aEngine ),
       
   106       iAudioStream( aAudioStream )
       
   107     {
       
   108     }
       
   109 
       
   110 // -----------------------------------------------------------------------------
       
   111 // TMCETestUIEngineCmdAddCodec::ExecuteL
       
   112 // -----------------------------------------------------------------------------
       
   113 //
       
   114 EXPORT_C void TMCETestUIEngineCmdAddCodec::ExecuteL()
       
   115 	{
       
   116 	const RPointerArray<const CMceAudioCodec>& codecs =  iEngine.MCEManager().SupportedAudioCodecs();
       
   117 	TInt codecIndex = 0;
       
   118 	iEngine.GetCodecTypeL( codecIndex  );
       
   119 	switch(codecIndex)
       
   120 		{
       
   121 			case 0:
       
   122 				{
       
   123 				for( int i = 0; i < codecs.Count(); i++ )
       
   124 			    {
       
   125 			   			    
       
   126 			    // Search for AMR codec 
       
   127 				    if( codecs[i]->SdpName().Find( KMceSDPNameAMR )  == KErrNone)
       
   128 				        {
       
   129 				    	iAudioStream.AudioStream().AddCodecL(codecs[i]->CloneL());
       
   130 				    	}
       
   131 			    }
       
   132 				break;
       
   133 				}
       
   134 			case 1:
       
   135 				{
       
   136 				for( int i = 0; i < codecs.Count(); i++ )
       
   137 			    {
       
   138 			   			    
       
   139 			    // Search for PCMU codec 
       
   140 				    if( codecs[i]->SdpName().Find( KMceSDPNamePCMU ) == KErrNone)
       
   141 				        {
       
   142 				    	iAudioStream.AudioStream().AddCodecL(codecs[i]->CloneL());
       
   143 				    	}
       
   144 			    }
       
   145 				break;
       
   146 				}
       
   147 			case 2:
       
   148 				{
       
   149 				for( int i = 0; i < codecs.Count(); i++ )
       
   150 			    {
       
   151 			   			    
       
   152 			    // Search for PCMU codec 
       
   153 				    if( codecs[i]->SdpName().Find( KMceSDPNamePCMA ) == KErrNone)
       
   154 				        {
       
   155 				    	iAudioStream.AudioStream().AddCodecL(codecs[i]->CloneL());
       
   156 				    	}
       
   157 			    }
       
   158 				break;
       
   159 				}
       
   160 			case 3:
       
   161 				{
       
   162 				for( int i = 0; i < codecs.Count(); i++ )
       
   163 			    {
       
   164 			   			    
       
   165 			    // Search for G729 codec 
       
   166 				    if( codecs[i]->SdpName().Find( KMceSDPNameG729 ) == KErrNone)
       
   167 				        {
       
   168 				    	iAudioStream.AudioStream().AddCodecL(codecs[i]->CloneL());
       
   169 				    	}
       
   170 			    }
       
   171 				break;
       
   172 				}
       
   173 			case 4:
       
   174 				{
       
   175 				for( int i = 0; i < codecs.Count(); i++ )
       
   176 			    {
       
   177 			   			    
       
   178 			    // Search for iLBC codec 
       
   179 				    if( codecs[i]->SdpName().Find( KMceSDPNameiLBC ) == KErrNone)
       
   180 				        {
       
   181 				    	iAudioStream.AudioStream().AddCodecL(codecs[i]->CloneL());
       
   182 				    	}
       
   183 			    }
       
   184 				break;
       
   185 				}
       
   186 			case 5:
       
   187 				{
       
   188 				for( int i = 0; i < codecs.Count(); i++ )
       
   189 			    {
       
   190 			   			    
       
   191 			    // Search for iLBC codec 
       
   192 				    if( codecs[i]->SdpName().Find( KMceSDPNameDtmf ) == KErrNone)
       
   193 				        {
       
   194 				    	iAudioStream.AudioStream().AddCodecL(codecs[i]->CloneL());
       
   195 				    	}
       
   196 			    }
       
   197 				break;
       
   198 				}
       
   199 			case 6:
       
   200 				{
       
   201 				for( int i = 0; i < codecs.Count(); i++ )
       
   202 			    {
       
   203 			   			    
       
   204 			    // Search for iLBC codec 
       
   205 				    if( codecs[i]->SdpName().Find( KMceSDPNameRed ) == KErrNone)
       
   206 				        {
       
   207 				    	iAudioStream.AudioStream().AddCodecL(codecs[i]->CloneL());
       
   208 				    	}
       
   209 			    }
       
   210 				break;
       
   211 				}
       
   212 			case 7:
       
   213 				{
       
   214 				for( int i = 0; i < codecs.Count(); i++ )
       
   215 			    {
       
   216 			   			    
       
   217 			    // Search for iLBC codec 
       
   218 				    if( codecs[i]->SdpName().Find( KMceSDPNameCn ) == KErrNone)
       
   219 				        {
       
   220 				    	iAudioStream.AudioStream().AddCodecL(codecs[i]->CloneL());
       
   221 				    	}
       
   222 			    }
       
   223 				break;
       
   224 				}
       
   225 			default:
       
   226 			   break;
       
   227 		}
       
   228 	 iEngine.EngineStateChangedL();
       
   229 	}
       
   230 	
       
   231 // -----------------------------------------------------------------------------
       
   232 // TMCETestUIEngineCmdAddCodec::Caption
       
   233 // -----------------------------------------------------------------------------
       
   234 //
       
   235 EXPORT_C const TDesC& TMCETestUIEngineCmdAddCodec::Caption() const
       
   236 	{
       
   237 	return KCommandCaptionAddCodec;
       
   238 	}
       
   239 
       
   240 // -----------------------------------------------------------------------------
       
   241 // TMCETestUIEngineCmdEnableAudioCodec::TMCETestUIEngineCmdEnableAudioCodec
       
   242 // -----------------------------------------------------------------------------
       
   243 //
       
   244 TMCETestUIEngineCmdEnableAudioCodec::TMCETestUIEngineCmdEnableAudioCodec( 
       
   245 		            CMCETestUIEngine& aEngine,
       
   246 		            CMCETestUIEngineCodec& aCodec  )
       
   247     : TMCETestUIEngineCmdBase( aEngine ),
       
   248       iCodec( aCodec )
       
   249     {
       
   250     }
       
   251 
       
   252 // -----------------------------------------------------------------------------
       
   253 // TMCETestUIEngineCmdEnableAudioCodec::ExecuteL
       
   254 // -----------------------------------------------------------------------------
       
   255 //
       
   256 EXPORT_C void TMCETestUIEngineCmdEnableAudioCodec::ExecuteL()
       
   257 	{
       
   258 	iCodec.Codec().SetStateL(CMceCodec::EEnabled);
       
   259 	iEngine.EngineStateChangedL();
       
   260 	}
       
   261 	
       
   262 // -----------------------------------------------------------------------------
       
   263 // TMCETestUIEngineCmdEnableAudioCodec::Caption
       
   264 // -----------------------------------------------------------------------------
       
   265 //
       
   266 EXPORT_C const TDesC& TMCETestUIEngineCmdEnableAudioCodec::Caption() const
       
   267 	{
       
   268 	return KCommandCaptionEnableVideoCodec;
       
   269 	}
       
   270 
       
   271 
       
   272 // -----------------------------------------------------------------------------
       
   273 // TMCETestUIEngineCmdDisableAudioCodec::TMCETestUIEngineCmdDisableAudioCodec
       
   274 // -----------------------------------------------------------------------------
       
   275 //
       
   276 TMCETestUIEngineCmdDisableAudioCodec::TMCETestUIEngineCmdDisableAudioCodec( 
       
   277 		            CMCETestUIEngine& aEngine,
       
   278 		            CMCETestUIEngineCodec& aCodec  )
       
   279     : TMCETestUIEngineCmdBase( aEngine ),
       
   280       iCodec( aCodec )
       
   281     {
       
   282     }
       
   283 
       
   284 // -----------------------------------------------------------------------------
       
   285 // TMCETestUIEngineCmdDisableAudioCodec::ExecuteL
       
   286 // -----------------------------------------------------------------------------
       
   287 //
       
   288 EXPORT_C void TMCETestUIEngineCmdDisableAudioCodec::ExecuteL()
       
   289 	{
       
   290 	iCodec.Codec().SetStateL(CMceCodec::EDisabled);
       
   291 	iEngine.EngineStateChangedL();
       
   292 	}
       
   293 	
       
   294 // -----------------------------------------------------------------------------
       
   295 // TMCETestUIEngineCmdDisableAudioCodec::Caption
       
   296 // -----------------------------------------------------------------------------
       
   297 //
       
   298 EXPORT_C const TDesC& TMCETestUIEngineCmdDisableAudioCodec::Caption() const
       
   299 	{
       
   300 	return KCommandCaptionDisableVideoCodec;
       
   301 	}
       
   302 // -----------------------------------------------------------------------------
       
   303 // TMCETestUIEngineCmdStandByAudioCodec::TMCETestUIEngineCmdStandByAudioCodec
       
   304 // -----------------------------------------------------------------------------
       
   305 //
       
   306 TMCETestUIEngineCmdStandByAudioCodec::TMCETestUIEngineCmdStandByAudioCodec( 
       
   307 		            CMCETestUIEngine& aEngine,
       
   308 		            CMCETestUIEngineCodec& aCodec  )
       
   309     : TMCETestUIEngineCmdBase( aEngine ),
       
   310       iCodec( aCodec )
       
   311     {
       
   312     }
       
   313 
       
   314 // -----------------------------------------------------------------------------
       
   315 // TMCETestUIEngineCmdStandByAudioCodec::ExecuteL
       
   316 // -----------------------------------------------------------------------------
       
   317 //
       
   318 EXPORT_C void TMCETestUIEngineCmdStandByAudioCodec::ExecuteL()
       
   319 	{
       
   320 	iCodec.Codec().SetStateL(CMceCodec::EStandby);
       
   321 	iEngine.EngineStateChangedL();
       
   322 	}
       
   323 	
       
   324 // -----------------------------------------------------------------------------
       
   325 // TMCETestUIEngineCmdStandByAudioCodec::Caption
       
   326 // -----------------------------------------------------------------------------
       
   327 //
       
   328 EXPORT_C const TDesC& TMCETestUIEngineCmdStandByAudioCodec::Caption() const
       
   329 	{
       
   330 	return KCommandCaptionStandByVideoCodec;
       
   331 	}
       
   332 
       
   333 
       
   334 // -----------------------------------------------------------------------------
       
   335 // TMCETestUIEngineCmdEnableVideoCodec::TMCETestUIEngineCmdEnableVideoCodec
       
   336 // -----------------------------------------------------------------------------
       
   337 //
       
   338 TMCETestUIEngineCmdEnableVideoCodec::TMCETestUIEngineCmdEnableVideoCodec( 
       
   339 		            CMCETestUIEngine& aEngine,
       
   340 		            CMCETestUIEngineVideoCodec& aCodec  )
       
   341     : TMCETestUIEngineCmdBase( aEngine ),
       
   342       iCodec( aCodec )
       
   343     {
       
   344     }
       
   345 
       
   346 // -----------------------------------------------------------------------------
       
   347 // TMCETestUIEngineCmdEnableVideoCodec::ExecuteL
       
   348 // -----------------------------------------------------------------------------
       
   349 //
       
   350 EXPORT_C void TMCETestUIEngineCmdEnableVideoCodec::ExecuteL()
       
   351 	{
       
   352 	iCodec.Codec().SetStateL(CMceCodec::EEnabled);
       
   353 	iEngine.EngineStateChangedL();
       
   354 	}
       
   355 	
       
   356 // -----------------------------------------------------------------------------
       
   357 // TMCETestUIEngineCmdEnableVideoCodec::Caption
       
   358 // -----------------------------------------------------------------------------
       
   359 //
       
   360 EXPORT_C const TDesC& TMCETestUIEngineCmdEnableVideoCodec::Caption() const
       
   361 	{
       
   362 	return KCommandCaptionEnableVideoCodec;
       
   363 	}
       
   364 
       
   365 
       
   366 // -----------------------------------------------------------------------------
       
   367 // TMCETestUIEngineCmdDisableVideoCodec::TMCETestUIEngineCmdDisableVideoCodec
       
   368 // -----------------------------------------------------------------------------
       
   369 //
       
   370 TMCETestUIEngineCmdDisableVideoCodec::TMCETestUIEngineCmdDisableVideoCodec( 
       
   371 		            CMCETestUIEngine& aEngine,
       
   372 		            CMCETestUIEngineVideoCodec& aCodec  )
       
   373     : TMCETestUIEngineCmdBase( aEngine ),
       
   374       iCodec( aCodec )
       
   375     {
       
   376     }
       
   377 
       
   378 // -----------------------------------------------------------------------------
       
   379 // TMCETestUIEngineCmdDisableVideoCodec::ExecuteL
       
   380 // -----------------------------------------------------------------------------
       
   381 //
       
   382 EXPORT_C void TMCETestUIEngineCmdDisableVideoCodec::ExecuteL()
       
   383 	{
       
   384 	iCodec.Codec().SetStateL(CMceCodec::EDisabled);
       
   385 	iEngine.EngineStateChangedL();
       
   386 	}
       
   387 	
       
   388 // -----------------------------------------------------------------------------
       
   389 // TMCETestUIEngineCmdDisableVideoCodec::Caption
       
   390 // -----------------------------------------------------------------------------
       
   391 //
       
   392 EXPORT_C const TDesC& TMCETestUIEngineCmdDisableVideoCodec::Caption() const
       
   393 	{
       
   394 	return KCommandCaptionDisableVideoCodec;
       
   395 	}
       
   396 // -----------------------------------------------------------------------------
       
   397 // TMCETestUIEngineCmdStandByVideoCodec::TMCETestUIEngineCmdStandByVideoCodec
       
   398 // -----------------------------------------------------------------------------
       
   399 //
       
   400 TMCETestUIEngineCmdStandByVideoCodec::TMCETestUIEngineCmdStandByVideoCodec( 
       
   401 		            CMCETestUIEngine& aEngine,
       
   402 		            CMCETestUIEngineVideoCodec& aCodec  )
       
   403     : TMCETestUIEngineCmdBase( aEngine ),
       
   404       iCodec( aCodec )
       
   405     {
       
   406     }
       
   407 
       
   408 // -----------------------------------------------------------------------------
       
   409 // TMCETestUIEngineCmdStandByVideoCodec::ExecuteL
       
   410 // -----------------------------------------------------------------------------
       
   411 //
       
   412 EXPORT_C void TMCETestUIEngineCmdStandByVideoCodec::ExecuteL()
       
   413 	{
       
   414 	iCodec.Codec().SetStateL(CMceCodec::EStandby);
       
   415 	iEngine.EngineStateChangedL();
       
   416 	}
       
   417 	
       
   418 // -----------------------------------------------------------------------------
       
   419 // TMCETestUIEngineCmdStandByVideoCodec::Caption
       
   420 // -----------------------------------------------------------------------------
       
   421 //
       
   422 EXPORT_C const TDesC& TMCETestUIEngineCmdStandByVideoCodec::Caption() const
       
   423 	{
       
   424 	return KCommandCaptionStandByVideoCodec;
       
   425 	}
       
   426 
       
   427 
       
   428 
       
   429 // End of File