vtuis/lcvtplugin/src/common/tlcvtaudiostate.cpp
branchRCL_3
changeset 24 f15ac8e65a02
equal deleted inserted replaced
23:890b5dd735f8 24:f15ac8e65a02
       
     1 /*
       
     2 * Copyright (c) 2008 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:  Audio state class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <cvtengmodel.h>
       
    20 
       
    21 #include "tlcvtaudiostate.h"
       
    22 #include "lcvtutility.h"
       
    23 
       
    24 // -----------------------------------------------------------------------------
       
    25 // TLcVtAudioState::UpdateFlags
       
    26 // -----------------------------------------------------------------------------
       
    27 //
       
    28 void TLcVtAudioState::UpdateFlags()
       
    29     {
       
    30     TInt avail( 0 );
       
    31 
       
    32     LcVtUtility::GetAudioRoutingAvailability( iModel.Audio(), avail );
       
    33 
       
    34     const TBool videoCallConnected ( iModel.Media().VideoCallConnected());
       
    35     //Before update AudioRouting, video call state must to be checked.
       
    36     //AudioRouting can not be changed if call is not in EConnected state.
       
    37     if ( videoCallConnected )
       
    38         {
       
    39         if ( avail & LcVtUtility::EDeactivateBtHandsfree )
       
    40             {
       
    41             SetFlag( ECanDeactivateBtHf );
       
    42             }
       
    43         if ( avail & LcVtUtility::EActivateBtHandsfree )
       
    44             {
       
    45             SetFlag( ECanActivateBtHf );
       
    46             }
       
    47         if ( avail & LcVtUtility::EDeactivateLoudspeaker )
       
    48             {
       
    49             SetFlag( ECanDeactivateLoudspeaker );
       
    50             }
       
    51         if ( avail & LcVtUtility::EActivateLoudspeaker )
       
    52             {
       
    53             SetFlag( ECanActivateLoudspeaker );
       
    54             }
       
    55         }
       
    56 
       
    57     LcVtUtility::GetOutgoingMediaState( iModel.Media(), avail );
       
    58 
       
    59     if ( avail & MVtEngMedia::EMediaAudio )
       
    60         {
       
    61         SetFlag( EIsAudio );
       
    62         }
       
    63 
       
    64     TInt status ( 0 );
       
    65     iModel.Media().GetMediaState( MVtEngMedia::EMediaOutgoing, status );
       
    66     if ( !(status & MVtEngMedia::EMediaAudioChannelOpen ) )
       
    67         {
       
    68         SetFlag( EIsAudioPermanentlyStopped );
       
    69         }
       
    70 
       
    71     }