breakdeps/eikkeysoundserver.cpp
author William Roberts <williamr@symbian.org>
Wed, 20 Oct 2010 13:07:29 +0100
changeset 126 faed561c44ed
parent 61 bdb0226b36a8
permissions -rw-r--r--
stem_MediaClientAudio.dll - work in progress mmfclienttoneplayer first attempt is done, but not tested mmfclientautioplayer hasn't really started
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
60
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
     1
/*
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
     2
* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
     3
* All rights reserved.
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
     8
*
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
     9
* Initial Contributors:
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    11
*
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    12
* Contributors:
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    13
*
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    14
* Description:  EikSrv keysound server.
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    15
*
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    16
*/
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    17
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    18
#include <e32svr.h>
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    19
#include <coemain.h>
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    20
#include <barsread.h>
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    21
#include <eiksrvui.rsg>
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    22
#include <s32mem.h>
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    23
#include "eikkeysoundserver.h"
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    24
#include <aknanimdllstd.h>
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    25
#include "AknEikAudioToneObserver.h"
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    26
#include <avkon.hrh>
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    27
#include <centralrepository.h>
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    28
#include <ProfileEngineSDKCRKeys.h>     // KProEngActiveKeypadVolume
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    29
#include <ataudioeventapi.h>
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    30
#include <e32uid.h>
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    31
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    32
// Declare thread entry point
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    33
GLDEF_C TInt KeySoundServerThreadStartFunction(TAny* aPtr);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    34
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    35
_LIT(KKeySoundServerThreadName,"KeySoundServerThread");
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    36
_LIT(KKeySoundServerSemaphoreName,"KeySoundServerSemaphore");
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    37
_LIT(KKeySoundServerDll,"AtSoundServerClient.dll");
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    38
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    39
const TInt KKeySoundServerStackSize     = 1024*8; // 8K
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    40
const TInt KAknSoundInfoMapGranularity  = 16;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    41
const TInt KKeyClickPreference          = 0x00140001;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    42
const TInt KKeySoundServerBufExpandSize = 1024*1; // 1K
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    43
const TInt KKeysoundServerDllUid        = 0x10281C86;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    44
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    45
typedef CATAudioEventAPI* (*PFUNC)(MATEventCompleteObserver& aCient);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    46
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    47
// =======================================
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    48
// CAknAnimKeySoundControl implementation.
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    49
// =======================================
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    50
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    51
CAknAnimKeySoundControl::CAknAnimKeySoundControl()
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    52
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    53
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    54
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    55
void CAknAnimKeySoundControl::ConstructL(RWindowGroup* aParent)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    56
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    57
    CreateWindowL(aParent);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    58
    SetExtent(TPoint(0,0),TSize(0,0));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    59
    Window().SetShadowDisabled(ETrue);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    60
    Window().Activate();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    61
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    62
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    63
// ================================
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    64
// RAknAnimKeySound implementation.
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    65
// ================================
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    66
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    67
RAknAnimKeySound::RAknAnimKeySound(RAnimDll& aAnimDll)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    68
:RAnim(aAnimDll)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    69
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    70
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    71
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    72
void RAknAnimKeySound::ConstructL(RWindowGroup* aParent)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    73
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    74
    iKeySoundControl = new(ELeave)CAknAnimKeySoundControl();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    75
    iKeySoundControl->ConstructL(aParent);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    76
    RAnim::Construct(*(iKeySoundControl->DrawableWindow()), EAnimKeySound, TPtrC8());
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    77
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    78
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    79
void RAknAnimKeySound::Close()
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    80
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    81
    delete iKeySoundControl;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    82
    iKeySoundControl = NULL;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    83
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    84
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    85
// ==================================
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    86
// CEikKeySoundServer implementation.
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    87
// ==================================
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    88
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    89
TInt CEikKeySoundServer::LaunchServer(TThreadId& aThreadId)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    90
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    91
    // First, check that ther server isn't already running.
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    92
    TFindServer findServer(__KEYSOUND_SERVER_NAME);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    93
    TFullName name;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    94
    if (findServer.Next(name) == KErrNone)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    95
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    96
        return KErrAlreadyExists;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    97
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    98
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
    99
    // Create a semaphore.
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   100
    RSemaphore globStartSignal;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   101
    TInt err = globStartSignal.CreateGlobal(KKeySoundServerSemaphoreName, EOwnerProcess);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   102
    if (err != KErrNone)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   103
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   104
        err=globStartSignal.OpenGlobal(KKeySoundServerSemaphoreName, EOwnerProcess);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   105
        if (err != KErrNone)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   106
            {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   107
            return err;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   108
            }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   109
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   110
    RThread keySoundServerThread;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   111
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   112
    err = keySoundServerThread.Create(
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   113
        KKeySoundServerThreadName,
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   114
        KeySoundServerThreadStartFunction,
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   115
        KKeySoundServerStackSize,
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   116
        NULL, // uses caller thread's heap
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   117
        NULL,
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   118
        EOwnerThread);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   119
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   120
    aThreadId = keySoundServerThread.Id();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   121
    keySoundServerThread.Resume();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   122
    keySoundServerThread.Close();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   123
    globStartSignal.Wait();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   124
    return err;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   125
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   126
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   127
// Construct the server object
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   128
LOCAL_C void DoKeySoundServerThreadStartFunctionL()
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   129
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   130
    CEikKeySoundServer::NewLC();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   131
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   132
    RSemaphore globStartSignal;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   133
    CleanupClosePushL(globStartSignal);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   134
    User::LeaveIfError(globStartSignal.OpenGlobal(KKeySoundServerSemaphoreName));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   135
    globStartSignal.Signal();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   136
    CleanupStack::PopAndDestroy(); // globStartSignal.Close()
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   137
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   138
    CActiveScheduler::Start();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   139
    CleanupStack::PopAndDestroy(); // keySoundServer
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   140
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   141
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   142
// Entry point into the new thread
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   143
GLDEF_C TInt KeySoundServerThreadStartFunction(TAny* /*aPtr*/)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   144
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   145
    __UHEAP_MARK;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   146
    RThread thread;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   147
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   148
    TInt err = User::RenameThread(KKeySoundServerThreadName);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   149
    if (err == KErrNone)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   150
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   151
        thread.SetPriority(EPriorityAbsoluteForeground);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   152
        thread.Close();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   153
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   154
        // Set up scheduler and cleanup stack for this thread
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   155
        CActiveScheduler* scheduler = new CActiveScheduler;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   156
        if (!scheduler)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   157
            {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   158
            return KErrNoMemory;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   159
            }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   160
        CActiveScheduler::Install(scheduler);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   161
        CTrapCleanup* trapCleanup = CTrapCleanup::New();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   162
        if (!trapCleanup)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   163
            {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   164
            return KErrNoMemory;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   165
            }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   166
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   167
        // Set initial trap harness, and construct server object
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   168
        TRAP(err,DoKeySoundServerThreadStartFunctionL());
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   169
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   170
        delete CActiveScheduler::Current();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   171
        delete trapCleanup;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   172
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   173
    __UHEAP_MARKEND;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   174
    return err;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   175
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   176
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   177
CEikKeySoundServer* CEikKeySoundServer::NewLC()
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   178
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   179
    CEikKeySoundServer* self = new(ELeave)CEikKeySoundServer();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   180
    CleanupStack::PushL(self);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   181
    self->ConstructL();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   182
    self->StartL(__KEYSOUND_SERVER_NAME);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   183
    return self;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   184
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   185
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   186
CEikKeySoundServer::CEikKeySoundServer()
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   187
:CServer2(EActivePriorityDefault),
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   188
iDisabledScanCode( -1 )
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   189
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   190
    // construct all system SID objects
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   191
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   192
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   193
void CEikKeySoundServer::ConstructL()
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   194
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   195
    iInit = EFalse;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   196
    iSidList = new(ELeave)CArrayFixFlat<TAknSoundID>(KAknSoundInfoMapGranularity);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   197
    iSoundList = new(ELeave)CArrayPtrFlat<CEikSoundInfo>(KAknSoundInfoMapGranularity);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   198
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   199
    // Default to loudest volume
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   200
    iKeypadVolume = CEikSoundInfo::EKeypadVolumeLoud;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   201
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   202
    TRAPD(err, iProfilesRepository = CRepository::NewL(KCRUidProfileEngine));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   203
    if (err == KErrNone)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   204
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   205
        iProfilesNotifyHandler = CCenRepNotifyHandler::NewL(*this,
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   206
                                                            *iProfilesRepository,
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   207
                                                            CCenRepNotifyHandler::EIntKey,
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   208
                                                            KProEngActiveKeypadVolume);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   209
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   210
        iWarningToneEnableHandler = CCenRepNotifyHandler::NewL( *this,
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   211
                                                                *iProfilesRepository,
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   212
                                                                CCenRepNotifyHandler::EIntKey,
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   213
                                                                KProEngActiveWarningTones);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   214
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   215
        iProfilesNotifyHandler->StartListeningL();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   216
        iWarningToneEnableHandler->StartListeningL();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   217
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   218
        iProfilesRepository->Get(KProEngActiveKeypadVolume, (TInt&)iKeypadVolume);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   219
        iProfilesRepository->Get(KProEngActiveWarningTones, iWarningToneEnabled);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   220
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   221
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   222
    iATSoundServerAPI = NULL;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   223
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   224
    RLibrary lib;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   225
    TUidType uidType( KDynamicLibraryUid, KSharedLibraryUid, TUid::Uid( KKeysoundServerDllUid ) );
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   226
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   227
    if(lib.Load(KKeySoundServerDll, uidType) == KErrNone)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   228
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   229
        PFUNC func = (PFUNC)lib.Lookup(1); /* NewL */
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   230
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   231
        TRAPD(error, iATSoundServerAPI = (CATAudioEventAPI*) func(*this));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   232
        if( error )
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   233
            {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   234
            iATSoundServerAPI = NULL;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   235
            }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   236
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   237
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   238
#ifdef _DEBUG
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   239
    RDebug::Print(_L("cenrep CEikKeySoundServer::ConstructL %d"), (TInt)iKeypadVolume);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   240
#endif
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   241
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   242
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   243
CEikKeySoundServer::~CEikKeySoundServer()
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   244
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   245
    if (iProfilesNotifyHandler)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   246
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   247
        iProfilesNotifyHandler->StopListening();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   248
        delete iProfilesNotifyHandler;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   249
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   250
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   251
    if (iWarningToneEnableHandler)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   252
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   253
        iWarningToneEnableHandler->StopListening();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   254
        delete iWarningToneEnableHandler;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   255
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   256
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   257
    delete iProfilesRepository;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   258
    delete iDefaultSoundMap;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   259
    delete iSoundList;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   260
    delete iSidList;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   261
    delete iATSoundServerAPI;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   262
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   263
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   264
CSession2* CEikKeySoundServer::NewSessionL(const TVersion& aVersion,
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   265
    const RMessage2& /*aMessage*/) const
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   266
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   267
    TVersion ver(KKeySoundServMajorVN, KKeySoundServMinorVN, KKeySoundServBuildVN);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   268
    if (!User::QueryVersionSupported(ver, aVersion))
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   269
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   270
        User::Leave(KErrNotSupported);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   271
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   272
    return CEikKeySoundSession::NewL(CONST_CAST(CEikKeySoundServer*,this));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   273
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   274
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   275
void CEikKeySoundServer::InitL(const RMessage2& aMessage)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   276
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   277
    TPckg<TInt> pckgBuf(iInit);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   278
    aMessage.WriteL(0, pckgBuf);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   279
    iInit = ETrue;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   280
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   281
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   282
void CEikKeySoundServer::Complete(TInt aError, TAudioThemeEvent aEvent)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   283
	{
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   284
	if( aError != KErrNone && aError != ESilencedError 
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   285
	    && aError != EEventCurrentlyPlaying && aError != KErrUnderflow)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   286
		{
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   287
		PlaySid(aEvent, ETrue);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   288
		}
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   289
	}
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   290
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   291
void CEikKeySoundServer::PlaySid(TInt aSid, TBool aPlaySelf)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   292
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   293
    if (aSid == EAvkonSIDWarningTone && iWarningToneEnabled == 0)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   294
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   295
        // Don't play warning tone, when the warning tone is disabled in setting.
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   296
        return;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   297
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   298
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   299
    TInt error(KErrNone);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   300
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   301
// special cases when the sound is always played in the key sound server
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   302
    if (aSid <= 1000 || aSid == EAvkonSIDStandardKeyClick ||
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   303
        aSid == EAvkonSIDReadialCompleteTone || aSid == EAvkonSIDPowerOffTone ||
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   304
        aSid == EAvkonSIDPowerOnTone || aSid == EAvkonSIDVoiceRecordingTone ||
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   305
        aSid == EAvkonSIDVoiceRecordingStartTone ||
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   306
        aSid == EAvkonSIDVoiceRecordingStopTone || aSid == EAvkonSIDNetBusy ||
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   307
        aSid == EAvkonSIDNetCallWaiting || aSid == EAvkonSIDNetReorder ||
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   308
        aSid == EAvkonSIDNetCongestion || aSid == EAvkonSIDNetSpecialInformation ||
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   309
        aSid == EAvkonSIDNetRadioNotAvailable || aSid == EAvkonSIDIHFActive ||
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   310
        aSid == EAvkonSIDRadioPathAcknowledge || aSid == EAvkonSIDDial ||
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   311
        aSid == EAvkonSIDRingGoing || aSid == EAvkonSIDLocationRequest ||
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   312
        aSid == EAvkonSIDInformationTone || aSid == EAvkonSIDConfirmationTone ) 
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   313
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   314
        aPlaySelf = ETrue;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   315
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   316
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   317
	if(!iATSoundServerAPI)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   318
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   319
    	aPlaySelf = ETrue;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   320
    	}
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   321
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   322
    if(!aPlaySelf && iATSoundServerAPI)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   323
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   324
        TAudioThemeEvent event = static_cast<TAudioThemeEvent>(aSid);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   325
        TRAP(error, iATSoundServerAPI->SendAudioEventL(event, EFalse));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   326
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   327
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   328
    if (aPlaySelf || error)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   329
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   330
        TKeyArrayFix sidKey(_FOFF(TAknSoundID, iSid), ECmpTUint);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   331
        TAknSoundID soundId;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   332
        soundId.iSid = aSid;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   333
        TInt index;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   334
        if (iSidList->FindIsq(soundId, sidKey, index) == 0)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   335
            {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   336
            CEikSoundInfo* info = ((*iSidList)[index]).iSoundInfo;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   337
            if (info && info->Volume() != CEikSoundInfo::EKeypadVolumeOff )
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   338
                {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   339
                TRAP_IGNORE(info->PlayL());
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   340
#if defined(EIKKSS_DEBUGSOUNDID)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   341
                RDebug::Print(_L("Playing SoundID:%d"), aSid & 0xffff);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   342
#endif
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   343
                LOGTEXT2(_L(" PlaySid(): Index:%d, pointer:%d"), index, (TInt)info);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   344
                }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   345
            }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   346
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   347
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   348
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   349
void CEikKeySoundServer::StopSid(TInt aSid)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   350
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   351
    TKeyArrayFix sidKey(_FOFF(TAknSoundID, iSid), ECmpTUint);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   352
    TAknSoundID soundId;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   353
    soundId.iSid = aSid;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   354
    TInt index;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   355
    if (iSidList->FindIsq(soundId, sidKey, index) == 0)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   356
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   357
        CEikSoundInfo* info = ((*iSidList)[index]).iSoundInfo;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   358
        if (info)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   359
            {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   360
            info->Stop();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   361
#if defined(EIKKSS_DEBUGSOUNDID)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   362
            RDebug::Print(_L("Force Stopping SoundID:%d"), aSid & 0xffff);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   363
#endif
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   364
            }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   365
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   366
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   367
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   368
void CEikKeySoundServer::SetVolumeForPreferenceType(TInt aPreference,
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   369
    CEikSoundInfo::TVolumeSetting aVolume)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   370
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   371
    TInt count = iSoundList->Count();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   372
    for (TInt ii = 0; ii < count; ii++)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   373
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   374
        CEikSoundInfo* info = (*iSoundList)[ii];
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   375
        if (info)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   376
            {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   377
            if (info->Preference() == aPreference)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   378
                {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   379
                info->SetVolume(aVolume);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   380
                }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   381
            }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   382
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   383
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   384
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   385
void CEikKeySoundServer::SetDisabledScanCode( TInt aScanCode )
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   386
	{
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   387
	iDisabledScanCode = aScanCode;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   388
	}
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   389
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   390
TInt CEikKeySoundServer::DisabledScanCode()
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   391
	{
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   392
	return iDisabledScanCode;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   393
	}
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   394
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   395
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   396
void CEikKeySoundServer::HandleNotifyInt(TUint32 aId, TInt aNewValue)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   397
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   398
    if (aId == KProEngActiveKeypadVolume)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   399
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   400
        iKeypadVolume = (CEikSoundInfo::TVolumeSetting)aNewValue;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   401
        SetVolumeForPreferenceType( KKeyClickPreference, iKeypadVolume );
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   402
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   403
    else if (aId == KProEngActiveWarningTones)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   404
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   405
        iWarningToneEnabled = aNewValue;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   406
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   407
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   408
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   409
// ===================================
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   410
// CEikKeySoundSession implementation.
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   411
// ===================================
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   412
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   413
CEikKeySoundSession* CEikKeySoundSession::NewL(CEikKeySoundServer* aServer)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   414
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   415
    CEikKeySoundSession* self = new(ELeave)CEikKeySoundSession(aServer);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   416
    CleanupStack::PushL(self);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   417
    self->ConstructL();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   418
    CleanupStack::Pop();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   419
    return self;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   420
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   421
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   422
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   423
CEikKeySoundSession::CEikKeySoundSession(CEikKeySoundServer* aServer)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   424
:CSession2(), iServer(aServer)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   425
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   426
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   427
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   428
CEikKeySoundSession::~CEikKeySoundSession()
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   429
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   430
    RemoveSids(iClientUid);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   431
    if (iHasLockedContext)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   432
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   433
        if( iServer )
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   434
            {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   435
            iServer->SetContextLocked(EFalse);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   436
            }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   437
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   438
    if (iOwnsDefaultSounds)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   439
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   440
        RemoveSids(0);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   441
        iServer->iInit = EFalse;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   442
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   443
    if (iSoundStack)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   444
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   445
        if (iSoundStack->Count() > 0)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   446
            {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   447
            // Bottom entry is owned by server, so remove before deleting other sound maps
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   448
            iSoundStack->Delete(0);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   449
            iSoundStack->ResetAndDestroy();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   450
            }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   451
        // Make sure server isn't using this soundstack
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   452
        if (iServer->iCurrentSoundStack == iSoundStack)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   453
            {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   454
            iServer->iCurrentSoundStack = NULL;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   455
            }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   456
        delete iSoundStack;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   457
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   458
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   459
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   460
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   461
void CEikKeySoundSession::ConstructL()
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   462
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   463
    iSoundStack = CEikKeySoundStack::NewL();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   464
    if (iServer->iDefaultSoundMap)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   465
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   466
        iSoundStack->AppendL(iServer->iDefaultSoundMap);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   467
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   468
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   469
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   470
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   471
void CEikKeySoundSession::ServiceL(const RMessage2& aMessage)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   472
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   473
    if (aMessage.Function() == EKeySoundServerPlayKey)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   474
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   475
        TInt scancode = aMessage.Int0() & 0xff;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   476
        TBool repeat = aMessage.Int1();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   477
        aMessage.Complete(KErrNone);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   478
        TInt sid;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   479
        if (iServer->iCurrentSoundStack)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   480
            {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   481
            if (iServer->iCurrentSoundStack->Find(scancode, repeat, sid))
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   482
                {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   483
                if ( scancode != iServer->DisabledScanCode() )
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   484
                	{
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   485
                    iServer->PlaySid(sid, EFalse);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   486
                	}
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   487
                else
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   488
                	{
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   489
                	iServer->SetDisabledScanCode( -1 );
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   490
                	}
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   491
                }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   492
            }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   493
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   494
    else
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   495
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   496
        TRAPD(err, DispatchMessageL(aMessage));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   497
        aMessage.Complete(err);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   498
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   499
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   500
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   501
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   502
void CEikKeySoundSession::DispatchMessageL(const RMessage2& aMessage)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   503
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   504
    switch (aMessage.Function())
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   505
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   506
        case EKeySoundServerInit:
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   507
            iClientUid = aMessage.Int1();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   508
            iServer->InitL(aMessage);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   509
            break;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   510
        case EKeySoundServerPlaySID:
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   511
            iServer->PlaySid(aMessage.Int0(), EFalse);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   512
            break;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   513
        case EKeySoundServerAddSIDS:
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   514
            AddSoundIdBufferL(aMessage);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   515
            break;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   516
        case EKeySoundServerPushContext:
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   517
            PushContextL(aMessage);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   518
            break;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   519
        case EKeySoundServerPopContext:
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   520
            PopContext();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   521
            break;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   522
        case EKeySoundServerTopContext:
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   523
            {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   524
            TInt id = 0;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   525
            if (iServer->iCurrentSoundStack && iServer->iCurrentSoundStack->Count())
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   526
                {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   527
                CEikKeySoundMap* map = iServer->iCurrentSoundStack->At(
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   528
                    iServer->iCurrentSoundStack->Count() - 1);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   529
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   530
                id = map->ContextResourceId();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   531
                }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   532
            TPckg<TInt> pckg(id);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   533
            aMessage.WriteL(0, pckg);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   534
            break;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   535
            }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   536
        case EKeySoundServerBringToForeground:
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   537
            if ( !iServer->ContextLocked() )
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   538
                {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   539
                iServer->iCurrentSoundStack = iSoundStack;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   540
                }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   541
            break;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   542
        case EKeySoundServerStopCurrentTone:
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   543
            iServer->StopSid(aMessage.Int0());
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   544
            break;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   545
        case EKeySoundServerLockContext:
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   546
            // We do not want lock twice and we do not want lock other's context.
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   547
            if ( !iServer->ContextLocked() && iServer->iCurrentSoundStack == iSoundStack )
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   548
                {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   549
                iServer->SetContextLocked( ETrue );
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   550
                iHasLockedContext = ETrue;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   551
                }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   552
            break;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   553
        case EKeySoundServerReleaseContext:
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   554
            iServer->SetContextLocked( EFalse );
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   555
            iHasLockedContext = EFalse;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   556
            break;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   557
        case EKeySoundServerCloseServer:
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   558
            {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   559
            RProcess myProcess;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   560
            TUid myUid = myProcess.SecureId();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   561
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   562
            // This server command is not allowed to be called outside eiksrvs process.
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   563
            if (aMessage.SecureId() != myProcess.SecureId())
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   564
                {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   565
                User::Leave(KErrPermissionDenied);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   566
                }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   567
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   568
            CActiveScheduler::Stop();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   569
            break;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   570
            }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   571
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   572
        case EKeySoundServerDisableNextKeySound:
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   573
            iServer->SetDisabledScanCode( aMessage.Int0() );
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   574
            break;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   575
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   576
        default:
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   577
            User::Leave(KErrNotSupported);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   578
            break;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   579
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   580
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   581
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   582
void CEikKeySoundSession::AddSoundIdBufferL(const RMessage2& aMessage)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   583
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   584
    TInt uid = aMessage.Int0();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   585
    TInt size = aMessage.Int1();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   586
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   587
    // CBufFlat requires that size must be positive and not larger than KMaxTInt / 2.
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   588
    // Without this check the KeySoundServer could panic.
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   589
    if (size <= 0 || size >= ((KMaxTInt / 2) - KKeySoundServerBufExpandSize))
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   590
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   591
        User::Leave(KErrArgument);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   592
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   593
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   594
    if (uid == 0)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   595
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   596
        // Remember if this session is loading the default sounds,
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   597
        // so they can be restored if this session goes down.
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   598
        iOwnsDefaultSounds = ETrue;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   599
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   600
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   601
    CBufFlat* buffer = CBufFlat::NewL(KKeySoundServerBufExpandSize);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   602
    CleanupStack::PushL(buffer);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   603
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   604
    buffer->ExpandL(0,size);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   605
    TPtr8 buf(buffer->Ptr(0));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   606
    aMessage.ReadL(2,buf);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   607
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   608
    // Internalize the data from the stream
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   609
    RBufReadStream readStream;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   610
    readStream.Open(*buffer);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   611
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   612
    CleanupClosePushL(readStream);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   613
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   614
    TInt count = readStream.ReadUint16L();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   615
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   616
    for (TInt ii = 0; ii < count; ii++)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   617
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   618
        TAknSoundID soundId;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   619
        soundId.iSid = readStream.ReadUint32L();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   620
        soundId.iAppUid = uid;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   621
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   622
        TInt priority = readStream.ReadUint16L();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   623
        TInt preference = readStream.ReadUint32L();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   624
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   625
        TInt type = readStream.ReadInt8L();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   626
        switch (type)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   627
            {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   628
            case 0: // File
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   629
                {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   630
                CAknFileSoundInfo* soundInfo = new(ELeave)CAknFileSoundInfo(priority, preference);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   631
                CleanupStack::PushL(soundInfo);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   632
                soundId.iSoundInfo = soundInfo;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   633
                TFileName file;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   634
                readStream >> file;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   635
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   636
                TInt volume = readStream.ReadInt8L();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   637
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   638
                if ( volume >= CEikSoundInfo::ESoundVolume0
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   639
                    && volume <= CEikSoundInfo::ESoundVolume9 )
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   640
                    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   641
                    soundInfo->SetVolume((CEikSoundInfo::TVolumeSetting)volume);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   642
                    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   643
                // No need to use else, because sound infos default to the loudest.
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   644
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   645
                AddFileSidL(soundId, soundInfo, file);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   646
                CleanupStack::Pop();    // soundInfo
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   647
                break;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   648
                }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   649
            case 1: // tone
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   650
                {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   651
                CAknToneSoundInfo* soundInfo = new(ELeave)CAknToneSoundInfo(priority, preference);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   652
                CleanupStack::PushL(soundInfo);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   653
                soundId.iSoundInfo = soundInfo;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   654
                soundInfo->iFrequency = readStream.ReadUint16L();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   655
                TInt64 ms(STATIC_CAST(TUint,readStream.ReadUint32L()));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   656
                soundInfo->iMs = TTimeIntervalMicroSeconds(ms);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   657
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   658
                TInt volume = readStream.ReadInt8L();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   659
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   660
                if ( volume >= CEikSoundInfo::ESoundVolume0
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   661
                    && volume <= CEikSoundInfo::ESoundVolume9 )
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   662
                    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   663
                    soundInfo->SetVolume((CEikSoundInfo::TVolumeSetting)volume);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   664
                    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   665
                // No need to use else, because sound infos default to the loudest.
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   666
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   667
                AddToneSidL(soundId, soundInfo);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   668
                CleanupStack::Pop();    // soundInfo
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   669
                break;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   670
                }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   671
            case 2: // sequence
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   672
                {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   673
                CAknSequenceSoundInfo* soundInfo = new(ELeave)CAknSequenceSoundInfo(priority,
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   674
                    preference);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   675
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   676
                CleanupStack::PushL(soundInfo);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   677
                soundInfo->ReadSequenceL(readStream);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   678
                soundId.iSoundInfo = soundInfo;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   679
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   680
                TInt volume = readStream.ReadInt8L();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   681
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   682
                if ( volume >= CEikSoundInfo::ESoundVolume0
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   683
                    && volume <= CEikSoundInfo::ESoundVolume9 )
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   684
                    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   685
                    soundInfo->SetVolume((CEikSoundInfo::TVolumeSetting)volume);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   686
                    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   687
                // No need to use else, because sound infos default to the loudest.
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   688
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   689
                AddSequenceSidL(soundId, soundInfo);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   690
                CleanupStack::Pop();    // soundinfo
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   691
                break;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   692
                }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   693
            } // end of switch
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   694
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   695
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   696
    CleanupStack::PopAndDestroy(2); // readstream close, buffer
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   697
    // Set default volumes.
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   698
    iServer->SetVolumeForPreferenceType(KKeyClickPreference, iServer->iKeypadVolume);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   699
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   700
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   701
void CEikKeySoundSession::RemoveSids(TInt aUid)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   702
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   703
    TUint uid = aUid << 16;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   704
    if (!iServer->iSidList)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   705
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   706
        return;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   707
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   708
    TInt count = iServer->iSidList->Count();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   709
    for (TInt ii=0; ii<count; ii++)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   710
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   711
        TAknSoundID& id = iServer->iSidList->At(ii);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   712
        if ( (id.iSid & 0xffff0000) == uid)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   713
            {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   714
            // Check first for possible duplicate sid. It is possible to have duplicates
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   715
            // in some cases when 2 instances of same application (uid) are running
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   716
            // simultaneusly, e.g. the real application and an embedded instance of
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   717
            // the application.
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   718
            TBool duplicateFound = EFalse;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   719
            for (TInt jj = ii + 1; jj < count; jj++)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   720
                {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   721
                TAknSoundID& possibleDuplicateId = iServer->iSidList->At(jj);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   722
                if (possibleDuplicateId.iSid == id.iSid)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   723
                    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   724
                    duplicateFound = ETrue;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   725
                    break;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   726
                    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   727
                }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   728
            // If no duplicate found, sid is deleted. Else duplicate will be
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   729
            // deleted when the for-loop reaches it (unless there is even more duplicates).
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   730
            if (!duplicateFound)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   731
                {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   732
                // Remove sound at this position
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   733
                delete id.iSoundInfo;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   734
                if (iServer->iSoundList)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   735
                    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   736
                    iServer->iSoundList->Delete(ii);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   737
                    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   738
                iServer->iSidList->Delete(ii);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   739
                ii--;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   740
                count--;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   741
                }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   742
            }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   743
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   744
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   745
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   746
void CEikKeySoundSession::PushContextL(const RMessage2& aMessage)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   747
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   748
    TInt items = aMessage.Int0();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   749
    TInt uid = aMessage.Int2();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   750
    TInt resSize = (items * 5);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   751
    TInt contextResId = aMessage.Int3();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   752
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   753
    // CBufFlat requires that resSize must be positive and not larger than KMaxTInt / 2.
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   754
    // Without this check the KeySoundServer could panic.
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   755
    if (resSize <= 0 || resSize >= ((KMaxTInt / 2) - KKeySoundServerBufExpandSize))
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   756
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   757
        User::Leave(KErrArgument);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   758
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   759
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   760
    CBufFlat* buffer = CBufFlat::NewL(KKeySoundServerBufExpandSize);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   761
    CleanupStack::PushL(buffer);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   762
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   763
    buffer->ExpandL(0,resSize);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   764
    TPtr8 buf(buffer->Ptr(0));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   765
    aMessage.ReadL(1,buf);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   766
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   767
    // Internalize the data from the stream
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   768
    RBufReadStream readStream;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   769
    readStream.Open(*buffer);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   770
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   771
    CleanupClosePushL(readStream);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   772
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   773
    CEikKeySoundMap* soundMap = CEikKeySoundMap::NewL();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   774
    CleanupStack::PushL(soundMap);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   775
    soundMap->SetContextResourceId(contextResId);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   776
    soundMap->InternalizeL(readStream, items, uid);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   777
    iSoundStack->AppendL(soundMap);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   778
    CleanupStack::Pop();    //   soundMap
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   779
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   780
    if (iServer->iDefaultSoundMap == NULL)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   781
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   782
        iServer->iDefaultSoundMap = soundMap;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   783
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   784
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   785
    CleanupStack::PopAndDestroy(2); // readstream close, buffer
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   786
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   787
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   788
void CEikKeySoundSession::PopContext()
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   789
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   790
    if (iSoundStack)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   791
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   792
        TInt count = iSoundStack->Count();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   793
        if (count > 1)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   794
            {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   795
            delete iSoundStack->At(count-1);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   796
            iSoundStack->Delete(count-1);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   797
            }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   798
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   799
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   800
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   801
void CEikKeySoundSession::AddToneSidL(const TAknSoundID& aSoundID, CAknToneSoundInfo* aSoundInfo)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   802
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   803
    aSoundInfo->InitL();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   804
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   805
    TKeyArrayFix sidKey(_FOFF(TAknSoundID, iSid), ECmpTUint);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   806
    if (iServer->iSidList && iServer->iSoundList)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   807
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   808
        TInt position = iServer->iSidList->InsertIsqAllowDuplicatesL(aSoundID, sidKey);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   809
        TRAPD(err,
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   810
        iServer->iSoundList->AppendL(aSoundInfo));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   811
        if (err != KErrNone)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   812
            {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   813
            iServer->iSidList->Delete(position);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   814
            }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   815
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   816
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   817
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   818
void CEikKeySoundSession::AddSequenceSidL(const TAknSoundID& aSoundID,
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   819
    CAknSequenceSoundInfo* aSoundInfo)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   820
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   821
    aSoundInfo->InitL();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   822
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   823
    TKeyArrayFix sidKey(_FOFF(TAknSoundID, iSid), ECmpTUint);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   824
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   825
    if (iServer->iSidList && iServer->iSoundList)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   826
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   827
        TInt position = iServer->iSidList->InsertIsqAllowDuplicatesL(aSoundID, sidKey);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   828
        TRAPD(err,
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   829
        iServer->iSoundList->AppendL(aSoundInfo));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   830
        if (err != KErrNone)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   831
            {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   832
            iServer->iSidList->Delete(position);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   833
            }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   834
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   835
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   836
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   837
void CEikKeySoundSession::AddFileSidL(const TAknSoundID& aSoundID, CAknFileSoundInfo* aSoundInfo,
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   838
    const TDesC& aFileName)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   839
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   840
    aSoundInfo->InitL(aFileName, NULL);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   841
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   842
    TKeyArrayFix sidKey(_FOFF(TAknSoundID, iSid), ECmpTUint);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   843
    if (iServer->iSidList && iServer->iSoundList)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   844
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   845
        TInt position = iServer->iSidList->InsertIsqAllowDuplicatesL(aSoundID, sidKey);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   846
        TRAPD(err,
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   847
        iServer->iSoundList->AppendL(aSoundInfo));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   848
        if (err != KErrNone)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   849
            {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   850
            iServer->iSidList->Delete(position);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   851
            }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   852
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   853
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   854
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   855
// =============================
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   856
// CEikSoundInfo implementation.
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   857
// =============================
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   858
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   859
CEikSoundInfo::CEikSoundInfo(TInt aPriority, TInt aPreference)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   860
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   861
    iPriority = aPriority;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   862
    iPreference = aPreference;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   863
    iVolume = ESoundVolume9; // default to loudest
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   864
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   865
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   866
CEikSoundInfo::~CEikSoundInfo()
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   867
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   868
    LOGTEXT(_L("CEikSoundInfo::~CEikSoundInfo(). Destructor."));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   869
    // Empty implementation.
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   870
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   871
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   872
TInt CEikSoundInfo::Preference()
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   873
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   874
    return iPreference;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   875
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   876
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   877
CEikSoundInfo::TVolumeSetting CEikSoundInfo::Volume()
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   878
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   879
    return iVolume;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   880
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   881
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   882
// ==================================
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   883
// CAknSynthSoundInfo implementation.
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   884
// ==================================
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   885
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   886
CAknSynthSoundInfo::CAknSynthSoundInfo(TInt aPriority, TInt aPreference)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   887
: CEikSoundInfo(aPriority, aPreference), iPlayedStatically(EFalse)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   888
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   889
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   890
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   891
CAknSynthSoundInfo::~CAknSynthSoundInfo()
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   892
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   893
    LOGTEXT(_L("CAknSynthSoundInfo::~CAknSynthSoundInfo(). Destructor."));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   894
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   895
    // Stops playing and deletes instances if they exist.
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   896
    Stop();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   897
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   898
    delete iToneObserver;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   899
    delete iTonePlayer;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   900
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   901
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   902
void CAknSynthSoundInfo::Prepare()
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   903
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   904
    LOGTEXT(_L("CAknSynthSoundInfo::Prepare()."));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   905
    // This base class method should never be called.
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   906
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   907
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   908
void CAknSynthSoundInfo::InitL()
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   909
    {
61
bdb0226b36a8 Break Eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents: 60
diff changeset
   910
#if 0
bdb0226b36a8 Break Eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents: 60
diff changeset
   911
	// Keyclicks are played with a statically reserved CMdaAudioToneUtility.
60
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   912
    // Same concerns also error tones (this is a hack to avoid an endless error dialog
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   913
    // loop because of audio server crash).
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   914
    if ((iPriority == EAvkonKeyClickPriority && iPreference == KKeyClickPreference) ||
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   915
        (iPriority == EAvkonErrorNotePriority && iPreference == EAvkonErrorNotePreference))
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   916
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   917
        LOGTEXT(_L("CAknSynthSoundInfo::InitL(). Static init."));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   918
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   919
        iPlayedStatically = ETrue;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   920
        iToneObserver = CAknEikAudioToneObserver::NewL(*this);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   921
        iTonePlayer = CMdaAudioToneUtility::NewL(*iToneObserver, NULL); // Synchronous
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   922
        }
61
bdb0226b36a8 Break Eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents: 60
diff changeset
   923
#endif
60
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   924
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   925
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   926
void CAknSynthSoundInfo::PlayL()
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   927
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   928
    LOGTEXT(_L("CAknSynthSoundInfo::PlayL()."));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   929
    LOGTEXT3(_L(" This:%d, iPriority:%d, iPreference:%d"), (TInt)this, iPriority, iPreference);
61
bdb0226b36a8 Break Eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents: 60
diff changeset
   930
#if 0
60
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   931
    // Stops playing and deletes instances if they exist.
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   932
    Stop();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   933
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   934
    if (!iPlayedStatically)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   935
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   936
        // Create new tone player and observer.
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   937
        iToneObserver = CAknEikAudioToneObserver::NewL(*this);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   938
        iTonePlayer = CMdaAudioToneUtility::NewL(*iToneObserver, NULL); // Synchronous
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   939
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   940
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   941
    // Prepare to play either a tone or a sequence depending on subclass.
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   942
    Prepare();
61
bdb0226b36a8 Break Eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents: 60
diff changeset
   943
#endif
60
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   944
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   945
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   946
void CAknSynthSoundInfo::DoPlay()
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   947
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   948
    LOGTEXT(_L("CAknSynthSoundInfo::DoPlay()."));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   949
    LOGTEXT3(_L(" This:%d, iPriority:%d, iPreference:%d"), (TInt)this, iPriority, iPreference);
61
bdb0226b36a8 Break Eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents: 60
diff changeset
   950
#if 0
60
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   951
    if (iTonePlayer->State() == EMdaAudioToneUtilityPrepared)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   952
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   953
        LOGTEXT(_L(" CAknSynthSoundInfo::DoPlay(). Prepare successful, play."));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   954
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   955
        iTonePlayer->SetPriority(iPriority,(TMdaPriorityPreference)iPreference);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   956
        DoSetVolume(iTonePlayer);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   957
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   958
        LOGTEXT1(_L(" iVolume just before calling play: %d"), iVolume);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   959
        LOGTEXT1(_L(" Volume from iTonePlayer: %d"), iTonePlayer->Volume());
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   960
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   961
        iTonePlayer->Play();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   962
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   963
    else
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   964
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   965
        LOGTEXT(_L(" CAknSynthSoundInfo::DoPlay(). Prepare failed, delete!"));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   966
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   967
        if (!iPlayedStatically)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   968
            {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   969
            LOGTEXT(_L(" CAknSynthSoundInfo::DoPlay(). Deleting iTonePlayer and iToneObserver."));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   970
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   971
            delete iTonePlayer;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   972
            iTonePlayer = NULL;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   973
            delete iToneObserver;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   974
            iToneObserver = NULL;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   975
            }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   976
        }
61
bdb0226b36a8 Break Eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents: 60
diff changeset
   977
#endif
60
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   978
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   979
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   980
void CAknSynthSoundInfo::Stop()
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   981
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   982
    LOGTEXT(_L("CAknSynthSoundInfo::Stop()."));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   983
    LOGTEXT3(_L(" This:%d, iPriority:%d, iPreference:%d"), (TInt)this, iPriority, iPreference);
61
bdb0226b36a8 Break Eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents: 60
diff changeset
   984
#if 0
60
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   985
    // Stop playing and delete tone player if it exists.
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   986
    if (iTonePlayer)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   987
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   988
        LOGTEXT(_L(" CAknSynthSoundInfo::Stop(). iTonePlayer exists."));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   989
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   990
        if (iTonePlayer->State() == EMdaAudioToneUtilityPlaying)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   991
            {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   992
            LOGTEXT(_L(" CAknSynthSoundInfo::Stop(). Playing, call CancelPlay()."));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   993
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   994
            iTonePlayer->CancelPlay();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   995
            }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   996
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   997
        if (!iPlayedStatically)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   998
            {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
   999
            LOGTEXT(_L(" CAknSynthSoundInfo::Stop(). Dynamic playing. Deleting iTonePlayer."));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1000
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1001
            delete iTonePlayer;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1002
            iTonePlayer = NULL;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1003
            }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1004
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1005
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1006
    // Delete also tone observer if it exists.
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1007
    if (iToneObserver)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1008
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1009
        LOGTEXT(_L(" CAknSynthSoundInfo::Stop(). iToneObserver exists."));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1010
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1011
        if (!iPlayedStatically)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1012
            {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1013
            LOGTEXT(_L(" CAknSynthSoundInfo::Stop(). Dynamic playing. Deleting iToneObserver."));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1014
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1015
            delete iToneObserver;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1016
            iToneObserver = NULL;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1017
            }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1018
        }
61
bdb0226b36a8 Break Eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents: 60
diff changeset
  1019
#endif
60
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1020
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1021
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1022
void CAknSynthSoundInfo::SetVolume(TVolumeSetting aVolume)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1023
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1024
    iVolume = aVolume;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1025
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1026
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1027
void CAknSynthSoundInfo::DoSetVolume(CMdaAudioToneUtility* aTonePlayer)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1028
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1029
    TInt max = aTonePlayer->MaxVolume();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1030
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1031
    if ( max == 0x0000ffff ) // 16bit -1 i.e. not set
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1032
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1033
        max = (TInt)ESoundVolume9; // Set it to our max
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1034
        }
61
bdb0226b36a8 Break Eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents: 60
diff changeset
  1035
#if 0
60
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1036
    TInt volume = 0;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1037
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1038
    if ( Preference() != KKeyClickPreference ) // Other sounds than key click
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1039
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1040
        aTonePlayer->SetVolume( ((TInt)iVolume * max )/(TInt)ESoundVolume9);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1041
        return;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1042
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1043
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1044
    switch (iVolume)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1045
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1046
        case EKeypadVolumeOff:
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1047
            break;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1048
        case EKeypadVolumeQuiet:
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1049
            volume = max / 3;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1050
            break;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1051
        case EKeypadVolumeMedium:
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1052
            volume = (max * 2) / 3;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1053
            break;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1054
        default: //case EKeypadVolumeLoud:
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1055
            volume = max;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1056
            break;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1057
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1058
    aTonePlayer->SetVolume(volume);
61
bdb0226b36a8 Break Eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents: 60
diff changeset
  1059
#endif
60
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1060
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1061
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1062
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1063
// =================================
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1064
// CAknToneSoundInfo implementation.
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1065
// =================================
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1066
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1067
CAknToneSoundInfo::CAknToneSoundInfo(TInt aPriority, TInt aPreference)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1068
: CAknSynthSoundInfo(aPriority, aPreference)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1069
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1070
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1071
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1072
CAknToneSoundInfo::~CAknToneSoundInfo()
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1073
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1074
    LOGTEXT(_L("CAknToneSoundInfo::~CAknToneSoundInfo(). Destructor."));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1075
    // Empty implementation.
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1076
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1077
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1078
void CAknToneSoundInfo::Prepare()
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1079
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1080
    LOGTEXT(_L("CAknToneSoundInfo::Prepare()."));
61
bdb0226b36a8 Break Eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents: 60
diff changeset
  1081
#if 0
60
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1082
    // Prepare
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1083
    iTonePlayer->PrepareToPlayTone(iFrequency, iMs);
61
bdb0226b36a8 Break Eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents: 60
diff changeset
  1084
#endif
60
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1085
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1086
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1087
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1088
// =====================================
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1089
// CAknSequenceSoundInfo implementation.
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1090
// =====================================
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1091
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1092
CAknSequenceSoundInfo::CAknSequenceSoundInfo(TInt aPriority, TInt aPreference)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1093
: CAknSynthSoundInfo(aPriority, aPreference)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1094
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1095
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1096
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1097
CAknSequenceSoundInfo::~CAknSequenceSoundInfo()
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1098
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1099
    LOGTEXT(_L("CAknSequenceSoundInfo::~CAknSequenceSoundInfo(). Destructor."));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1100
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1101
    delete iSequence;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1102
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1103
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1104
void CAknSequenceSoundInfo::Prepare()
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1105
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1106
    LOGTEXT(_L("CAknSequenceSoundInfo::Prepare()."));
61
bdb0226b36a8 Break Eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents: 60
diff changeset
  1107
#if 0
60
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1108
    // Prepare
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1109
    iTonePlayer->PrepareToPlayDesSequence(*iSequence);
61
bdb0226b36a8 Break Eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents: 60
diff changeset
  1110
#endif
60
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1111
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1112
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1113
void CAknSequenceSoundInfo::ReadSequenceL(RReadStream& aStream)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1114
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1115
    delete iSequence;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1116
    iSequence = NULL;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1117
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1118
    TInt length = aStream.ReadInt16L();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1119
    iSequence = HBufC8::NewMaxL(length);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1120
    TPtr8 ptr = iSequence->Des();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1121
    for (TInt ii = 0; ii < length; ii++)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1122
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1123
        ptr[ii] = aStream.ReadUint8L();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1124
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1125
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1126
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1127
// =================================
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1128
// CAknFileSoundInfo implementation.
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1129
// =================================
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1130
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1131
CAknFileSoundInfo::CAknFileSoundInfo(TInt aPriority, TInt aPreference)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1132
: CEikSoundInfo(aPriority, aPreference)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1133
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1134
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1135
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1136
CAknFileSoundInfo::~CAknFileSoundInfo()
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1137
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1138
    delete iAudioPlayer;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1139
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1140
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1141
void CAknFileSoundInfo::InitL(const TDesC& aFileName, CMdaServer* aMdaServer)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1142
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1143
    LOGTEXT(_L("CAknFileSoundInfo::InitL() - Filename:"));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1144
    LOGTEXT(aFileName);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1145
    iFileName = aFileName;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1146
    LOGTEXT(_L(" CAknFileSoundInfo::InitL() - Exit"));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1147
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1148
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1149
void CAknFileSoundInfo::PlayL()
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1150
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1151
    LOGTEXT(_L("CAknFileSoundInfo::PlayL()."));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1152
    LOGTEXT3(_L(" This:%d, iPriority:%d, iPreference:%d"), (TInt)this, iPriority, iPreference);
61
bdb0226b36a8 Break Eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents: 60
diff changeset
  1153
#if 0
60
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1154
    // Stops playing and deletes audio player instance if it exist.
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1155
    Stop();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1156
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1157
    // Create audio player. DoPlay() will be called in all circumstances.
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1158
    iAudioPlayer = CMdaAudioPlayerUtility::NewFilePlayerL(iFileName, *this, iPriority,(TMdaPriorityPreference)iPreference );
61
bdb0226b36a8 Break Eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents: 60
diff changeset
  1159
#endif
60
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1160
    LOGTEXT(_L(" CAknFileSoundInfo::PlayL() - Exit"));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1161
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1162
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1163
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1164
void CAknFileSoundInfo::DoPlay()
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1165
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1166
    LOGTEXT(_L("CAknFileSoundInfo::DoPlay()."));
61
bdb0226b36a8 Break Eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents: 60
diff changeset
  1167
#if 0
60
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1168
    if (iPrepared)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1169
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1170
        LOGTEXT(_L(" CAknFileSoundInfo::DoPlay(). Prepared succesfull, play."));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1171
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1172
        // No need to set priority. It is already set in NewDesPlayerReadOnlyL().
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1173
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1174
        // Set volume.
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1175
        DoSetVolume(iAudioPlayer);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1176
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1177
        LOGTEXT1(_L(" iVolume just before calling play: %d"), iVolume);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1178
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1179
        iAudioPlayer->Play();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1180
        iPlaying = ETrue;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1181
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1182
    else
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1183
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1184
        LOGTEXT(_L(" CAknFileSoundInfo::DoPlay(). Prepare failed, delete!"));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1185
        LOGTEXT(_L(" CAknFileSoundInfo::DoPlay(). Deleting iAudioPlayer."));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1186
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1187
        delete iAudioPlayer;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1188
        iAudioPlayer = NULL;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1189
        }
61
bdb0226b36a8 Break Eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents: 60
diff changeset
  1190
#endif
60
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1191
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1192
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1193
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1194
void CAknFileSoundInfo::Stop()
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1195
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1196
    LOGTEXT(_L("CAknFileSoundInfo::Stop()."));
61
bdb0226b36a8 Break Eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents: 60
diff changeset
  1197
#if 0
60
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1198
    // Stop playing and delete audio player if it exists.
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1199
    if (iAudioPlayer)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1200
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1201
        LOGTEXT(_L(" CAknFileSoundInfo::Stop(). iAudioPlayer exists."));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1202
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1203
        if (iPlaying)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1204
            {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1205
            LOGTEXT(_L(" CAknFileSoundInfo::Stop(). Playing, call CancelPlay()."));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1206
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1207
            iAudioPlayer->Stop();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1208
            iPlaying = EFalse;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1209
            }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1210
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1211
        LOGTEXT(_L(" CAknFileSoundInfo::Stop(). Deleting iAudioPlayer."));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1212
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1213
        delete iAudioPlayer;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1214
        iAudioPlayer = NULL;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1215
        iPrepared = EFalse;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1216
        }
61
bdb0226b36a8 Break Eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents: 60
diff changeset
  1217
#endif
60
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1218
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1219
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1220
void CAknFileSoundInfo::MoscoStateChangeEvent(CBase* /*aObject*/, TInt /*aPreviousState*/,
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1221
    TInt /*aCurrentState*/, TInt /*aErrorCode*/)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1222
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1223
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1224
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1225
void CAknFileSoundInfo::SetVolume(TVolumeSetting aVolume)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1226
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1227
    iVolume = aVolume;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1228
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1229
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1230
void CAknFileSoundInfo::DoSetVolume(CMdaAudioPlayerUtility* aAudioPlayer)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1231
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1232
    TInt max = aAudioPlayer->MaxVolume();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1233
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1234
    if ( max == 0x0000ffff ) // 16bit -1 i.e. not set
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1235
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1236
        max = (TInt)ESoundVolume9; // Set it to our max
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1237
        }
61
bdb0226b36a8 Break Eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents: 60
diff changeset
  1238
#if 0
60
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1239
    TInt volume = 0;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1240
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1241
    if ( Preference() != KKeyClickPreference ) // Other sounds than key click
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1242
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1243
		//change (TInt)ESoundVolume9 to ((TInt)ESoundVolume9 + 1)) to keep consistent with audiotheme
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1244
        aAudioPlayer->SetVolume( ((TInt)iVolume * max )/((TInt)ESoundVolume9 + 1));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1245
        return;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1246
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1247
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1248
    switch (iVolume)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1249
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1250
        case EKeypadVolumeOff:
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1251
            break;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1252
        case EKeypadVolumeQuiet:
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1253
            volume = max / 3;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1254
            break;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1255
        case EKeypadVolumeMedium:
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1256
            volume = (max * 2) / 3;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1257
            break;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1258
        default: //case EKeypadVolumeLoud:
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1259
            volume = max;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1260
            break;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1261
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1262
    aAudioPlayer->SetVolume(volume);
61
bdb0226b36a8 Break Eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents: 60
diff changeset
  1263
#endif
60
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1264
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1265
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1266
void CAknFileSoundInfo::MapcInitComplete(TInt aError,
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1267
    const TTimeIntervalMicroSeconds& /*aDuration*/)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1268
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1269
    LOGTEXT(_L("CAknFileSoundInfo::MapcInitComplete()."));
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1270
    LOGTEXT1(_L(" aError:%d"), aError);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1271
    if (aError == KErrNone)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1272
        {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1273
        iPrepared = ETrue;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1274
        SetVolume(iVolume);
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1275
        }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1276
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1277
    DoPlay();
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1278
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1279
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1280
void CAknFileSoundInfo::MapcPlayComplete(TInt /*aError*/)
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1281
    {
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1282
    LOGTEXT(_L("CAknFileSoundInfo::MapcPlayComplete()"));
61
bdb0226b36a8 Break Eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents: 60
diff changeset
  1283
#if 0
60
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1284
    iPlaying = EFalse;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1285
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1286
    delete iAudioPlayer;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1287
    iAudioPlayer = NULL;
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1288
    iPrepared = EFalse;
61
bdb0226b36a8 Break Eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents: 60
diff changeset
  1289
#endif
60
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1290
    }
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1291
e17592a1211c Add files to break eiksrvui.dll dependency on MediaClientAudio.dll
markw <markw@symbian.org>
parents:
diff changeset
  1292
// End of file