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 |
|
sl@0
|
17 |
#ifndef __MMFBTDEVSOUNDEVENTHANDLER_H
|
sl@0
|
18 |
#define __MMFBTDEVSOUNDEVENTHANDLER_H
|
sl@0
|
19 |
|
sl@0
|
20 |
#include <e32base.h>
|
sl@0
|
21 |
#include <e32std.h>
|
sl@0
|
22 |
#include "MmfBtPolicyClientServer.h"
|
sl@0
|
23 |
|
sl@0
|
24 |
class CMMFDevSoundSessionXtnd;
|
sl@0
|
25 |
|
sl@0
|
26 |
class RMMFAudioPolicyProxy;
|
sl@0
|
27 |
|
sl@0
|
28 |
|
sl@0
|
29 |
class TMMFAudioPolicyEvent
|
sl@0
|
30 |
{
|
sl@0
|
31 |
public:
|
sl@0
|
32 |
/**
|
sl@0
|
33 |
Constructor.
|
sl@0
|
34 |
|
sl@0
|
35 |
@internalTechnology
|
sl@0
|
36 |
|
sl@0
|
37 |
@param "aEventType" "A code to define the type of event."
|
sl@0
|
38 |
@param "aErrorCode" "The error code associated with the event."
|
sl@0
|
39 |
@since 7.0s
|
sl@0
|
40 |
*/
|
sl@0
|
41 |
// TMMFAudioPolicyEvent(TAudioPolicyEventType aEventType, TInt aErrorCode) : iEventType(aEventType), iErrorCode(aErrorCode) {};
|
sl@0
|
42 |
|
sl@0
|
43 |
/**
|
sl@0
|
44 |
Default constructor.
|
sl@0
|
45 |
|
sl@0
|
46 |
Provided so this class can be packaged in a TPckgBuf<>.
|
sl@0
|
47 |
@since 7.0s
|
sl@0
|
48 |
*/
|
sl@0
|
49 |
TMMFAudioPolicyEvent() : iEventType(EMMFAudioPolicyNoEvent), iErrorCode(KErrNone) {};
|
sl@0
|
50 |
|
sl@0
|
51 |
enum TAudioPolicyEventType
|
sl@0
|
52 |
{
|
sl@0
|
53 |
EMMFAudioPolicyNoEvent = 0,
|
sl@0
|
54 |
EMMFAudioPolicySwitchToIdle,
|
sl@0
|
55 |
EMMFAudioPolicyPriorityTooLow,
|
sl@0
|
56 |
EMMFAudioPolicyResourceNotification
|
sl@0
|
57 |
};
|
sl@0
|
58 |
|
sl@0
|
59 |
TAudioPolicyEventType iEventType;
|
sl@0
|
60 |
TInt iErrorCode;
|
sl@0
|
61 |
TMMFAudioPolicyState iState;
|
sl@0
|
62 |
|
sl@0
|
63 |
};
|
sl@0
|
64 |
|
sl@0
|
65 |
typedef TPckgBuf<TMMFAudioPolicyEvent> TMMFAudioPolicyEventPckg;
|
sl@0
|
66 |
|
sl@0
|
67 |
class CMMFDevSoundEventHandler : public CActive
|
sl@0
|
68 |
/**
|
sl@0
|
69 |
*@internalTechnology
|
sl@0
|
70 |
*/
|
sl@0
|
71 |
{
|
sl@0
|
72 |
public:
|
sl@0
|
73 |
static CMMFDevSoundEventHandler* NewL(RMMFAudioPolicyProxy* aAudioPolicyProxy);
|
sl@0
|
74 |
~CMMFDevSoundEventHandler();
|
sl@0
|
75 |
void ReceiveEvents();
|
sl@0
|
76 |
void CancelReceiveEvents();
|
sl@0
|
77 |
void RunL();
|
sl@0
|
78 |
TInt RunError(TInt aError);
|
sl@0
|
79 |
void DoCancel();
|
sl@0
|
80 |
void SetDevSoundInfo(CMMFDevSoundSessionXtnd* aDevSound);
|
sl@0
|
81 |
|
sl@0
|
82 |
private:
|
sl@0
|
83 |
void ConstructL();
|
sl@0
|
84 |
CMMFDevSoundEventHandler(RMMFAudioPolicyProxy* aAudioPolicyProxy);
|
sl@0
|
85 |
private:
|
sl@0
|
86 |
enum {EGranularity=8};
|
sl@0
|
87 |
RMMFAudioPolicyProxy* iAudioPolicyProxy;
|
sl@0
|
88 |
TMMFAudioPolicyEventPckg iAudioPolicyEventPckg;
|
sl@0
|
89 |
TRequestStatus iRequestStatus;
|
sl@0
|
90 |
TInt iDevSoundId;
|
sl@0
|
91 |
CMMFDevSoundSessionXtnd* iDevSound;
|
sl@0
|
92 |
};
|
sl@0
|
93 |
|
sl@0
|
94 |
|
sl@0
|
95 |
|
sl@0
|
96 |
|
sl@0
|
97 |
#endif
|