uifw/AvKon/src/aknsoundsystem.cpp
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 2002 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 // AKNSOUNDSYSTEM.CPP
       
    19 //
       
    20 // Copyright (c) 1997-2001 Symbian Ltd.  All rights reserved.
       
    21 //
       
    22 
       
    23 // CAknKeySoundSystem - interface for controlling keysounds
       
    24 
       
    25 
       
    26 #include "aknsoundsystem.h"
       
    27 #include "aknsoundplayer.h"
       
    28 #include <eikenv.h>
       
    29 #include <eikappui.h>
       
    30 #include <eikapp.h>
       
    31 #include <avkon.rsg>
       
    32 
       
    33 // CAknKeySoundSystem
       
    34 
       
    35 EXPORT_C CAknKeySoundSystem* CAknKeySoundSystem::NewL(TInt aUid)
       
    36     {
       
    37     CAknKeySoundSystem* self = new(ELeave)CAknKeySoundSystem();
       
    38     CleanupStack::PushL(self);
       
    39     self->ConstructL(aUid);
       
    40     CleanupStack::Pop();    // self
       
    41     return self;
       
    42     }
       
    43 
       
    44 CAknKeySoundSystem::CAknKeySoundSystem()
       
    45     {
       
    46     }
       
    47 
       
    48 EXPORT_C CAknKeySoundSystem::~CAknKeySoundSystem()
       
    49     {
       
    50     delete iSoundPlayer;
       
    51     }
       
    52 
       
    53 
       
    54 void CAknKeySoundSystem::ConstructL(TInt aUid)
       
    55     {
       
    56     iSoundPlayer = CAknSoundPlayer::NewL(aUid);
       
    57     iSoundPlayer->ConstructL();
       
    58     }
       
    59 
       
    60 
       
    61 EXPORT_C void CAknKeySoundSystem::PushContextL(TInt aResourceId)
       
    62     {
       
    63     iSoundPlayer->PushContextL(aResourceId);
       
    64     }
       
    65 
       
    66 EXPORT_C void CAknKeySoundSystem::PopContext()
       
    67     {
       
    68     iSoundPlayer->PopContext();
       
    69     }
       
    70 
       
    71 EXPORT_C void CAknKeySoundSystem::PlaySound(const TKeyEvent& aKeyEvent)
       
    72     {
       
    73     iSoundPlayer->PlaySound(aKeyEvent.iScanCode, aKeyEvent.iRepeats);
       
    74     }
       
    75 
       
    76 EXPORT_C void  CAknKeySoundSystem::PlaySound(TInt aSid)
       
    77     {
       
    78     iSoundPlayer->Play(aSid);
       
    79     }
       
    80 
       
    81 
       
    82 EXPORT_C void CAknKeySoundSystem::AddAppSoundInfoListL(TInt aResourceId)
       
    83     {
       
    84     iSoundPlayer->AddAppSoundInfoListL(aResourceId);
       
    85     }
       
    86 
       
    87 
       
    88 EXPORT_C void CAknKeySoundSystem::BringToForeground()
       
    89     {
       
    90     iSoundPlayer->BringToForeground();
       
    91     }
       
    92 
       
    93 EXPORT_C void CAknKeySoundSystem::StopSound(TInt aSid)
       
    94     {
       
    95     iSoundPlayer->Stop(aSid);
       
    96     }
       
    97 
       
    98 EXPORT_C void CAknKeySoundSystem::LockContext()
       
    99     {
       
   100     iSoundPlayer->LockContext();
       
   101     }
       
   102 
       
   103 EXPORT_C void CAknKeySoundSystem::ReleaseContext()
       
   104     {
       
   105     iSoundPlayer->ReleaseContext();
       
   106     }
       
   107 
       
   108 EXPORT_C TInt CAknKeySoundSystem::RequestSoundInfoL(TInt aAvkonSid, CAknSoundInfo& aInfo)
       
   109     {
       
   110     return iSoundPlayer->RequestSoundInfoL(aAvkonSid, aInfo);
       
   111     }
       
   112 
       
   113 EXPORT_C TInt CAknKeySoundSystem::TopContext()
       
   114     {
       
   115     return iSoundPlayer->TopContext();      
       
   116     }
       
   117     
       
   118     
       
   119     
       
   120 void CAknKeySoundSystem::DisableNextKeySound( TInt aScanCode )
       
   121 	{
       
   122 	iSoundPlayer->DisableNextKeySound( aScanCode );
       
   123 	}
       
   124 
       
   125 
       
   126 
       
   127 EXPORT_C CAknSoundInfo* CAknSoundInfo::NewL()
       
   128     {
       
   129     return new ( ELeave ) CAknSoundInfo();
       
   130     }
       
   131 
       
   132 CAknSoundInfo::CAknSoundInfo()
       
   133     {
       
   134     }
       
   135 
       
   136 EXPORT_C CAknSoundInfo::~CAknSoundInfo()
       
   137     {   
       
   138     delete iFile;
       
   139     delete iSequence;
       
   140     }
       
   141 
       
   142 EXPORT_C void CAknSoundInfo::InternalizeL( RReadStream& /*aStream*/ )
       
   143     {
       
   144     }   
       
   145 
       
   146 EXPORT_C void CAknSoundInfo::ExternalizeL( RWriteStream& /*aStream*/ ) const
       
   147     {   
       
   148     }
       
   149 
       
   150 
       
   151 // End of File