sl@0
|
1 |
// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
#ifndef __MMFBTAUDIOPOLICY_H__
|
sl@0
|
17 |
#define __MMFBTAUDIOPOLICY_H__
|
sl@0
|
18 |
|
sl@0
|
19 |
#include <e32base.h>
|
sl@0
|
20 |
#include <f32file.h>
|
sl@0
|
21 |
#include "MmfBtAudioPolicyRequest.h"
|
sl@0
|
22 |
#include <mmf/server/sounddevice.h>
|
sl@0
|
23 |
#include "MdaBtHwInfo.h"
|
sl@0
|
24 |
#include "MmfBtDevSoundEventHandler.h"
|
sl@0
|
25 |
#include "mmfstandardcustomcommands.h"
|
sl@0
|
26 |
#include "mmfcontrollerframeworkbase.h"
|
sl@0
|
27 |
|
sl@0
|
28 |
/**
|
sl@0
|
29 |
Panic category and codes for the AudioPolicy
|
sl@0
|
30 |
@internalTechnology
|
sl@0
|
31 |
*/
|
sl@0
|
32 |
_LIT(KMMFAudioPolicyPanicCategory, "MMFAudioPolicy");
|
sl@0
|
33 |
enum TMMFAudioPolicyPanicCodes
|
sl@0
|
34 |
{
|
sl@0
|
35 |
EMMFAudioPolicyRequestArrayOverflow
|
sl@0
|
36 |
};
|
sl@0
|
37 |
|
sl@0
|
38 |
class CAudioPolicy; // declared here.
|
sl@0
|
39 |
/******************************************************************************
|
sl@0
|
40 |
* Class Name: CAudioPolicy
|
sl@0
|
41 |
*
|
sl@0
|
42 |
* Description: This class is ultimately implemented by the product team based
|
sl@0
|
43 |
* on their requirements for audio behavior in the face of
|
sl@0
|
44 |
* multiple audio requests simultaneously. The reference
|
sl@0
|
45 |
* implementation is a simple priority scheme. If a request is
|
sl@0
|
46 |
* a higher priority, it gets played, even if termination of a
|
sl@0
|
47 |
* running request of lower prioirity is required.
|
sl@0
|
48 |
******************************************************************************/
|
sl@0
|
49 |
|
sl@0
|
50 |
class CMMFAudioPolicyServer;
|
sl@0
|
51 |
|
sl@0
|
52 |
NONSHARABLE_CLASS( CAudioPolicy ): public CBase
|
sl@0
|
53 |
/**
|
sl@0
|
54 |
*@internalTechnology
|
sl@0
|
55 |
*/
|
sl@0
|
56 |
{
|
sl@0
|
57 |
public:
|
sl@0
|
58 |
|
sl@0
|
59 |
IMPORT_C static CAudioPolicy* NewL(CMMFAudioPolicyServer* aAudioPolicyServer);
|
sl@0
|
60 |
void RemoveSessionFromList(CMMFAudioPolicyRequest* aAudioPolicyRequest);
|
sl@0
|
61 |
~CAudioPolicy();
|
sl@0
|
62 |
void MakeRequest(CMMFAudioPolicyRequest* aAudioPolicyRequest);
|
sl@0
|
63 |
void ModifyEntry(TInt aPolicySessionId, CMMFAudioPolicyRequest* aAudioPolicyRequest);
|
sl@0
|
64 |
void RemoveFromList(TInt aPolicySessionId);
|
sl@0
|
65 |
void LaunchRequest();
|
sl@0
|
66 |
CArrayFixFlat<CMMFAudioPolicyRequest>* AudioPolicyRequestArray();
|
sl@0
|
67 |
void DoSendNotification();
|
sl@0
|
68 |
TInt SetNotification(TInt aSessionId,TUid aEventType);
|
sl@0
|
69 |
inline CMdaHwInfo* MdaHwInfo(void) {return iMdaHwInfo;}
|
sl@0
|
70 |
protected:
|
sl@0
|
71 |
CAudioPolicy(CMMFAudioPolicyServer* aAudioPolicyServer);
|
sl@0
|
72 |
private:
|
sl@0
|
73 |
enum {EGranularity=8};
|
sl@0
|
74 |
CArrayFixFlat<CMMFAudioPolicyRequest>* iAudioPolicyRequestArray;
|
sl@0
|
75 |
TInt iSessionToAlert;
|
sl@0
|
76 |
TInt iSessionToBeLaunched;
|
sl@0
|
77 |
CMMFAudioPolicyServer* iAudioPolicyServer;
|
sl@0
|
78 |
CMdaHwInfo* iMdaHwInfo;
|
sl@0
|
79 |
TMMFAudioPolicyEvent iAudioPolicyEventToLaunch;
|
sl@0
|
80 |
TMMFAudioPolicyEvent iAudioPolicyEvent;
|
sl@0
|
81 |
|
sl@0
|
82 |
void ConstructL();
|
sl@0
|
83 |
TPolicyResponse ProcessRequest(CMMFAudioPolicyRequest* aAudioPolicyRequest);
|
sl@0
|
84 |
TPolicyResponse ComparePriorities(CMMFAudioPolicyRequest* aAudioPolicyRequest/*,TMMFAudioPolicyEvent& aEvent*/);
|
sl@0
|
85 |
void HandlePreferences(CMMFAudioPolicyRequest* aAudioPolicyRequest, TInt aPref, TPolicyResponse& aResponse);
|
sl@0
|
86 |
void SetSessionToAlert(TInt aSessionToAlert, TInt aSessionToBeLaunched, TMMFAudioPolicyEvent::TAudioPolicyEventType aEventType, TMMFAudioPolicyState aState );
|
sl@0
|
87 |
TBool IsRegisteredNotification(TInt aSessionId);
|
sl@0
|
88 |
TBool IsNotified();
|
sl@0
|
89 |
void ResetNotification();
|
sl@0
|
90 |
TInt CheckSessionToNotify();
|
sl@0
|
91 |
};
|
sl@0
|
92 |
|
sl@0
|
93 |
/**
|
sl@0
|
94 |
The function panic raises a panic from within the MmfAudioPolicy library
|
sl@0
|
95 |
@param The argument is a member of the enumeration TMMFAudioPolicyPanicCodes
|
sl@0
|
96 |
*/
|
sl@0
|
97 |
GLDEF_C void Panic(TMMFAudioPolicyPanicCodes aError);
|
sl@0
|
98 |
|
sl@0
|
99 |
#endif
|