multimediacommsengine/mmcecli/src/mceaudiocodec.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:    
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #include "mceaudiocodec.h"
       
    22 #include "mcesession.h"
       
    23 #include "mcemanager.h"
       
    24 #include "mcemediastream.h"
       
    25 #include "mcecomaudiocodec.h"
       
    26 #include "mceclientserver.h"
       
    27 #include "mcefactory.h"
       
    28 #include "mceevents.h"
       
    29 
       
    30 
       
    31 #define _FLAT_DATA static_cast<CMceComAudioCodec*>( iFlatData )
       
    32 #define FLAT_DATA( data ) _FLAT_DATA->data
       
    33 
       
    34 // ============================ MEMBER FUNCTIONS ===============================
       
    35 
       
    36 
       
    37 // -----------------------------------------------------------------------------
       
    38 // CMceAudioCodec::InitializeL
       
    39 // -----------------------------------------------------------------------------
       
    40 //
       
    41 void CMceAudioCodec::InitializeL( CMceMediaStream& aParent )
       
    42     {
       
    43     CMceCodec::InitializeL( aParent );
       
    44     }
       
    45 
       
    46 // -----------------------------------------------------------------------------
       
    47 // CMceAudioCodec::~CMceAudioCodec
       
    48 // -----------------------------------------------------------------------------
       
    49 //
       
    50 CMceAudioCodec::~CMceAudioCodec()
       
    51     {
       
    52     }
       
    53 
       
    54 // -----------------------------------------------------------------------------
       
    55 // CMceAudioCodec::SamplingFreq
       
    56 // -----------------------------------------------------------------------------
       
    57 //
       
    58 TUint CMceAudioCodec::SamplingFreq() const
       
    59     {
       
    60     return FLAT_DATA( iSamplingFreq );
       
    61     
       
    62     }
       
    63 
       
    64 // -----------------------------------------------------------------------------
       
    65 // CMceAudioCodec::VAD
       
    66 // -----------------------------------------------------------------------------
       
    67 //
       
    68 TBool CMceAudioCodec::VAD() const
       
    69     {
       
    70     return FLAT_DATA( iEnableVAD );
       
    71     }
       
    72 
       
    73 // -----------------------------------------------------------------------------
       
    74 // CMceAudioCodec::PTime
       
    75 // -----------------------------------------------------------------------------
       
    76 //
       
    77 TUint CMceAudioCodec::PTime() const        
       
    78     {
       
    79     return FLAT_DATA( iPTime );
       
    80     }
       
    81 
       
    82 // -----------------------------------------------------------------------------
       
    83 // CMceAudioCodec::MaxPTime
       
    84 // -----------------------------------------------------------------------------
       
    85 //
       
    86 TUint CMceAudioCodec::MaxPTime() const        
       
    87     {
       
    88     return FLAT_DATA( iMaxPTime );
       
    89     }
       
    90             
       
    91 // -----------------------------------------------------------------------------
       
    92 // CMceAudioCodec::CMceAudioCodec
       
    93 // -----------------------------------------------------------------------------
       
    94 //
       
    95 CMceAudioCodec::CMceAudioCodec() :
       
    96     CMceCodec()
       
    97     {
       
    98     }
       
    99 
       
   100 // -----------------------------------------------------------------------------
       
   101 // CMceAudioCodec::ConstructL
       
   102 // -----------------------------------------------------------------------------
       
   103 //
       
   104 void CMceAudioCodec::ConstructL( CMceComAudioCodec* aFlatData )
       
   105     {
       
   106     CMceCodec::ConstructL( aFlatData );
       
   107     }
       
   108             
       
   109 
       
   110 // -----------------------------------------------------------------------------
       
   111 // CMceAudioCodec::Factory
       
   112 // -----------------------------------------------------------------------------
       
   113 //
       
   114 TMceAudioCodecFactory CMceAudioCodec::Factory()
       
   115     {
       
   116     return TMceAudioCodecFactory();
       
   117     }
       
   118 
       
   119 // -----------------------------------------------------------------------------
       
   120 // CMceAudioCodec::ComparePreferences
       
   121 // -----------------------------------------------------------------------------
       
   122 //  
       
   123 TInt CMceAudioCodec::ComparePreferences( const CMceAudioCodec& aIndex1, 
       
   124                                          const CMceAudioCodec& aIndex2 )
       
   125     {
       
   126     if ( aIndex1.Preference() > aIndex2.Preference() )
       
   127         {
       
   128         return (1);
       
   129         }
       
   130     else if ( aIndex1.Preference() < aIndex2.Preference() )
       
   131         {
       
   132         return (-1);
       
   133         }
       
   134     else
       
   135         {
       
   136         return (0);
       
   137         }
       
   138     }
       
   139