Update contrib.
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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef __MMFAUDIOPOLICYSESSION_H__
17 #define __MMFAUDIOPOLICYSESSION_H__
21 #include <mmf/common/mmfipc.h>
22 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
23 #include <mmf/common/mmfipcserver.h>
25 #include "MmfAudioPolicyRequest.h"
26 #include "MmfPolicyClientServer.h"
27 #include "MmfDevSoundEventHandler.h"
28 #include <mmf/common/mmfstandardcustomcommands.h>
30 class CMMFAudioPolicyEventReceiver : public CBase
36 static CMMFAudioPolicyEventReceiver* NewL(const RMmfIpcMessage& aMessage);
37 ~CMMFAudioPolicyEventReceiver();
38 void SendEvent(const TMMFAudioPolicyEvent& aEvent);
39 void SendEvent(const TMMFEvent& aEvent);
41 CMMFAudioPolicyEventReceiver(const RMmfIpcMessage& aMessage);
43 RMmfIpcMessage iMessage;
44 TBool iNeedToCompleteMessage;
48 class CMMFAudioPolicyServer;
53 class CMMFAudioPolicySession : public CMmfIpcSession
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();
70 class TMMFAudioPolicyEventHolder
73 TMMFAudioPolicyEventHolder(const TMMFAudioPolicyEvent& aEvent, TBool aNeedsDeletion) : iEvent(aEvent),
74 iShallBeDeleted(aNeedsDeletion) {};
75 TMMFAudioPolicyEvent iEvent;
76 const TBool iShallBeDeleted;
81 CMMFAudioPolicySession();
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;
104 TMMFAudioPolicyPrioritySettings iAudioPolicyPrioritySettings;
105 TMMFAudioPolicyEventHolder iNoMemoryEventHolder;
106 TBool iNoMemoryEventUsed;