os/mm/devsound/sounddevbt/src/server/MmfBtAudioPolicySession.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 #ifndef __MMFBTAUDIOPOLICYSESSION_H__
    17 #define __MMFBTAUDIOPOLICYSESSION_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 "MmfBtAudioPolicyRequest.h"  
    26 #include "MmfBtPolicyClientServer.h"
    27 #include "MmfBtDevSoundEventHandler.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(TMMFAudioPolicyEvent& aEvent);
    66 	CMMFAudioPolicyServer* Server();
    67 
    68 private:
    69 	class TMMFAudioPolicyEventHolder
    70 		{
    71 	public:
    72 		TMMFAudioPolicyEventHolder(const TMMFAudioPolicyEvent& aEvent) : iEvent(aEvent) {};
    73 		TMMFAudioPolicyEvent iEvent;
    74 		TSglQueLink iLink;
    75 		};
    76 
    77 private:
    78 	CMMFAudioPolicySession();
    79 	void ConstructL();
    80 	void MakeRequestL(const RMmfIpcMessage& aMessage);
    81 	TBool UpdateStateL(const RMmfIpcMessage& aMessage);
    82 	TBool ReceiveEventsL(const RMmfIpcMessage& aMessage);
    83 	TBool CancelReceiveEvents();
    84 	TBool GetPlayFormatsSupportedL(const RMmfIpcMessage& aMessage);
    85 	TBool GetRecordFormatsSupportedL(const RMmfIpcMessage& aMessage);
    86 	TBool GetPlayFormatL(const RMmfIpcMessage& aMessage);
    87 	TBool GetRecordFormatL(const RMmfIpcMessage& aMessage);
    88 	TBool SetDevSoundInfoL(const RMmfIpcMessage& aMessage);
    89 	TBool LaunchRequest();
    90 	TBool RequestResourceNotificationL(const RMmfIpcMessage& aMessage);
    91 	TBool CancelRequestResourceNotificationL(const RMmfIpcMessage& aMessage);
    92 	TBool StopNotificationL(const RMmfIpcMessage& aMessage);
    93 	TBool GetResourceNotificationEventL(const RMmfIpcMessage& aMessage);
    94 	CMMFAudioPolicyServer* iServer;
    95 	CMMFAudioPolicyRequest* iAudioPolicyRequest;
    96 	CAudioPolicy* iAudioPolicy;
    97 	CMMFAudioPolicyEventReceiver* iEventReceiver;
    98 	TSglQue<TMMFAudioPolicyEventHolder> iEventsQue;
    99 	TInt iPolicySessionId;
   100 	TPolicyResponse iPolicyResponse;
   101 	TInt iDevSoundId;
   102 	TMMFAudioPolicyPrioritySettings	iAudioPolicyPrioritySettings;
   103 	};
   104 
   105 
   106 #endif