|
1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __MMFAUDIOPOLICYSESSION_H__ |
|
17 #define __MMFAUDIOPOLICYSESSION_H__ |
|
18 |
|
19 #include <e32base.h> |
|
20 #include <e32std.h> |
|
21 #include <mmf/common/mmfipc.h> |
|
22 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
23 #include <mmf/common/mmfipcserver.h> |
|
24 #endif |
|
25 #include "MmfAudioPolicyRequest.h" |
|
26 #include "MmfPolicyClientServer.h" |
|
27 #include "MmfDevSoundEventHandler.h" |
|
28 #include <mmf/common/mmfstandardcustomcommands.h> |
|
29 |
|
30 class CMMFAudioPolicyEventReceiver : public CBase |
|
31 /** |
|
32 *@internalTechnology |
|
33 */ |
|
34 { |
|
35 public: |
|
36 static CMMFAudioPolicyEventReceiver* NewL(const RMmfIpcMessage& aMessage); |
|
37 ~CMMFAudioPolicyEventReceiver(); |
|
38 void SendEvent(const TMMFAudioPolicyEvent& aEvent); |
|
39 void SendEvent(const TMMFEvent& aEvent); |
|
40 private: |
|
41 CMMFAudioPolicyEventReceiver(const RMmfIpcMessage& aMessage); |
|
42 private: |
|
43 RMmfIpcMessage iMessage; |
|
44 TBool iNeedToCompleteMessage; |
|
45 }; |
|
46 |
|
47 class CAudioPolicy; |
|
48 class CMMFAudioPolicyServer; |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 class CMMFAudioPolicySession : public CMmfIpcSession |
|
54 /** |
|
55 *@internalTechnology |
|
56 */ |
|
57 { |
|
58 public: |
|
59 static CMMFAudioPolicySession* NewL(); |
|
60 ~CMMFAudioPolicySession(); |
|
61 void CreateL(const CMmfIpcServer& aServer); |
|
62 void ServiceL(const RMmfIpcMessage& aMessage); |
|
63 CMMFAudioPolicyRequest* AudioPolicyRequest(void) {return iAudioPolicyRequest;}; |
|
64 TInt PolicySessionId(void) {return iPolicySessionId;}; |
|
65 void SendEventToClient(const TMMFAudioPolicyEvent& aEvent); |
|
66 CMMFAudioPolicyServer* Server(); |
|
67 void ClearEventQ(); |
|
68 |
|
69 private: |
|
70 class TMMFAudioPolicyEventHolder |
|
71 { |
|
72 public: |
|
73 TMMFAudioPolicyEventHolder(const TMMFAudioPolicyEvent& aEvent, TBool aNeedsDeletion) : iEvent(aEvent), |
|
74 iShallBeDeleted(aNeedsDeletion) {}; |
|
75 TMMFAudioPolicyEvent iEvent; |
|
76 const TBool iShallBeDeleted; |
|
77 TSglQueLink iLink; |
|
78 }; |
|
79 |
|
80 private: |
|
81 CMMFAudioPolicySession(); |
|
82 void ConstructL(); |
|
83 void MakeRequestL(const RMmfIpcMessage& aMessage); |
|
84 TBool UpdateStateL(const RMmfIpcMessage& aMessage); |
|
85 TBool ReceiveEventsL(const RMmfIpcMessage& aMessage); |
|
86 TBool CancelReceiveEvents(); |
|
87 TBool GetPlayFormatsSupportedL(const RMmfIpcMessage& aMessage); |
|
88 TBool GetRecordFormatsSupportedL(const RMmfIpcMessage& aMessage); |
|
89 TBool GetPlayFormatL(const RMmfIpcMessage& aMessage); |
|
90 TBool GetRecordFormatL(const RMmfIpcMessage& aMessage); |
|
91 TBool SetDevSoundInfoL(const RMmfIpcMessage& aMessage); |
|
92 TBool LaunchRequest(); |
|
93 TBool RequestResourceNotificationL(const RMmfIpcMessage& aMessage); |
|
94 TBool CancelRequestResourceNotificationL(const RMmfIpcMessage& aMessage); |
|
95 TBool StopNotificationL(const RMmfIpcMessage& aMessage); |
|
96 TBool GetResourceNotificationEventL(const RMmfIpcMessage& aMessage) const; |
|
97 CMMFAudioPolicyServer* iServer; |
|
98 CMMFAudioPolicyRequest* iAudioPolicyRequest; |
|
99 CAudioPolicy* iAudioPolicy; |
|
100 CMMFAudioPolicyEventReceiver* iEventReceiver; |
|
101 TSglQue<TMMFAudioPolicyEventHolder> iEventsQue; |
|
102 TInt iPolicySessionId; |
|
103 TInt iDevSoundId; |
|
104 TMMFAudioPolicyPrioritySettings iAudioPolicyPrioritySettings; |
|
105 TMMFAudioPolicyEventHolder iNoMemoryEventHolder; |
|
106 TBool iNoMemoryEventUsed; |
|
107 TInt iEventQSize; |
|
108 }; |
|
109 |
|
110 |
|
111 #endif |