uifw/tsrc/public/basic/AknSoundServerStifTest/src/EikSrvSoundServerSession.cpp
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 2002-2007 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:  REikSrvSoundServerSession implementation. Direct copy from 
       
    15 *                AknAnimKeySound.cpp.
       
    16 *
       
    17 */
       
    18 
       
    19 #include <e32std.h>
       
    20 #include <eikkeysound.h>
       
    21 #include "eiksrvsoundserversession.h"
       
    22 
       
    23 // REikSrvSoundServerSession implementation:
       
    24 
       
    25 // -----------------------------------------------------------------------------
       
    26 // REikSrvSoundServerSession::Connect
       
    27 // -----------------------------------------------------------------------------
       
    28 //
       
    29 TInt REikSrvSoundServerSession::Connect()
       
    30     {
       
    31     // Create a session with zero message slots 
       
    32     // (since we have no asycronous calls).
       
    33     TInt ret=CreateSession
       
    34         (
       
    35         __KEYSOUND_SERVER_NAME,
       
    36         TVersion( 
       
    37             KKeySoundServMajorVN, 
       
    38             KKeySoundServMinorVN, 
       
    39             KKeySoundServBuildVN ),
       
    40         1
       
    41         );
       
    42     return ret;  
       
    43     }
       
    44 
       
    45 // -----------------------------------------------------------------------------
       
    46 // REikSrvSoundServerSession::KeyPressed
       
    47 //
       
    48 // NB. as this is asynchronous, the cancel should be provided also, anyway we rely on that 
       
    49 // keysound server will complete all requests relatively fast so we never stall on 
       
    50 // ~CAknAnimKeySound more than tens of milliseconds.
       
    51 // -----------------------------------------------------------------------------
       
    52 //
       
    53 void REikSrvSoundServerSession::KeyPressed( TInt aKey, TRequestStatus& aStatus, TBool aRepeat )
       
    54     {
       
    55     TIpcArgs args( aKey, aRepeat);    
       
    56     SendReceive( EKeySoundServerPlayKey, args, aStatus ); 
       
    57     }   
       
    58  
       
    59 // -----------------------------------------------------------------------------
       
    60 // REikSrvSoundServerSession::Init
       
    61 //
       
    62 // Added for testing purposes. Not copied from AknAnimKeySound.cpp!
       
    63 // -----------------------------------------------------------------------------
       
    64 //    
       
    65 void REikSrvSoundServerSession::Init(TInt aUid)
       
    66     {
       
    67     TPckgBuf<TInt> init(ETrue);
       
    68     TIpcArgs args (&init, aUid);
       
    69     SendReceive(EKeySoundServerInit, args);
       
    70     }   
       
    71     
       
    72 // End of file