os/mm/devsound/sounddevbt/src/server/MmfBtAudioPolicySession.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/devsound/sounddevbt/src/server/MmfBtAudioPolicySession.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,106 @@
     1.4 +// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#ifndef __MMFBTAUDIOPOLICYSESSION_H__
    1.20 +#define __MMFBTAUDIOPOLICYSESSION_H__
    1.21 +
    1.22 +#include <e32base.h>
    1.23 +#include <e32std.h>
    1.24 +#include <mmf/common/mmfipc.h>
    1.25 +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
    1.26 +#include <mmf/common/mmfipcserver.h>
    1.27 +#endif
    1.28 +#include "MmfBtAudioPolicyRequest.h"  
    1.29 +#include "MmfBtPolicyClientServer.h"
    1.30 +#include "MmfBtDevSoundEventHandler.h"
    1.31 +#include <mmf/common/mmfstandardcustomcommands.h>
    1.32 +
    1.33 +class CMMFAudioPolicyEventReceiver : public CBase
    1.34 +/**
    1.35 +*@internalTechnology
    1.36 +*/
    1.37 +	{
    1.38 +public:
    1.39 +	static CMMFAudioPolicyEventReceiver* NewL(const RMmfIpcMessage& aMessage);
    1.40 +	~CMMFAudioPolicyEventReceiver();
    1.41 +	void SendEvent(const TMMFAudioPolicyEvent& aEvent);
    1.42 +	void SendEvent(const TMMFEvent& aEvent);
    1.43 +private:
    1.44 +	CMMFAudioPolicyEventReceiver(const RMmfIpcMessage& aMessage);
    1.45 +private:
    1.46 +	RMmfIpcMessage iMessage;
    1.47 +	TBool iNeedToCompleteMessage;
    1.48 +	};
    1.49 +
    1.50 +class CAudioPolicy;
    1.51 +class CMMFAudioPolicyServer;
    1.52 +
    1.53 +
    1.54 +
    1.55 +
    1.56 +class CMMFAudioPolicySession : public CMmfIpcSession
    1.57 +/**
    1.58 +*@internalTechnology
    1.59 +*/
    1.60 +	{
    1.61 +public:
    1.62 +	static CMMFAudioPolicySession* NewL();
    1.63 +	~CMMFAudioPolicySession();
    1.64 +	void CreateL(const CMmfIpcServer& aServer);
    1.65 +	void ServiceL(const RMmfIpcMessage& aMessage);
    1.66 +	CMMFAudioPolicyRequest* AudioPolicyRequest(void) {return iAudioPolicyRequest;};
    1.67 +	TInt PolicySessionId(void) {return iPolicySessionId;};
    1.68 +	void SendEventToClient(TMMFAudioPolicyEvent& aEvent);
    1.69 +	CMMFAudioPolicyServer* Server();
    1.70 +
    1.71 +private:
    1.72 +	class TMMFAudioPolicyEventHolder
    1.73 +		{
    1.74 +	public:
    1.75 +		TMMFAudioPolicyEventHolder(const TMMFAudioPolicyEvent& aEvent) : iEvent(aEvent) {};
    1.76 +		TMMFAudioPolicyEvent iEvent;
    1.77 +		TSglQueLink iLink;
    1.78 +		};
    1.79 +
    1.80 +private:
    1.81 +	CMMFAudioPolicySession();
    1.82 +	void ConstructL();
    1.83 +	void MakeRequestL(const RMmfIpcMessage& aMessage);
    1.84 +	TBool UpdateStateL(const RMmfIpcMessage& aMessage);
    1.85 +	TBool ReceiveEventsL(const RMmfIpcMessage& aMessage);
    1.86 +	TBool CancelReceiveEvents();
    1.87 +	TBool GetPlayFormatsSupportedL(const RMmfIpcMessage& aMessage);
    1.88 +	TBool GetRecordFormatsSupportedL(const RMmfIpcMessage& aMessage);
    1.89 +	TBool GetPlayFormatL(const RMmfIpcMessage& aMessage);
    1.90 +	TBool GetRecordFormatL(const RMmfIpcMessage& aMessage);
    1.91 +	TBool SetDevSoundInfoL(const RMmfIpcMessage& aMessage);
    1.92 +	TBool LaunchRequest();
    1.93 +	TBool RequestResourceNotificationL(const RMmfIpcMessage& aMessage);
    1.94 +	TBool CancelRequestResourceNotificationL(const RMmfIpcMessage& aMessage);
    1.95 +	TBool StopNotificationL(const RMmfIpcMessage& aMessage);
    1.96 +	TBool GetResourceNotificationEventL(const RMmfIpcMessage& aMessage);
    1.97 +	CMMFAudioPolicyServer* iServer;
    1.98 +	CMMFAudioPolicyRequest* iAudioPolicyRequest;
    1.99 +	CAudioPolicy* iAudioPolicy;
   1.100 +	CMMFAudioPolicyEventReceiver* iEventReceiver;
   1.101 +	TSglQue<TMMFAudioPolicyEventHolder> iEventsQue;
   1.102 +	TInt iPolicySessionId;
   1.103 +	TPolicyResponse iPolicyResponse;
   1.104 +	TInt iDevSoundId;
   1.105 +	TMMFAudioPolicyPrioritySettings	iAudioPolicyPrioritySettings;
   1.106 +	};
   1.107 +
   1.108 +
   1.109 +#endif