os/mm/devsound/sounddevbt/src/server/MmfBtAudioPolicyServer.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     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 __MMFBTAUDIOPOLICYSERVER_H__
    17 #define __MMFBTAUDIOPOLICYSERVER_H__
    18 
    19 #include <e32base.h>
    20 #include <e32std.h>
    21 #include "MmfBtAudioPolicy.h"
    22 #include "MmfBtPolicyClientServer.h"
    23 
    24 class CMMFAudioPolicyServer; // declared here.
    25 
    26 NONSHARABLE_CLASS( CMMFAudioPolicyServer ): public CMmfIpcServer
    27 /**
    28 *@internalTechnology
    29 */
    30 	{
    31 public:
    32 	static CMMFAudioPolicyServer* NewL(); 
    33 	~CMMFAudioPolicyServer();
    34 	CMmfIpcSession* NewSessionL(const TVersion &aVersion) const;
    35 	void IncrementSessionId();
    36 	void SendEventToClient(TInt aSessionToAlert, TInt aSessionToBeLaunched, TMMFAudioPolicyEvent& aEvent);
    37 	void LaunchRequest(TInt aSessionId, TMMFAudioPolicyEvent& aEvent);
    38 	CAudioPolicy* AudioPolicy() {return iAudioPolicy;};
    39 	TInt PolicySessionId() {return iPolicySessionId;};
    40 	static TInt SendNotification(TAny* aAny);
    41 	TBool IsTimerActive() const;
    42 	
    43 	IMPORT_C static TInt StartThread(TAny* aParams);
    44 	void IncrementSessionCount();
    45 	void DecrementSessionCount();
    46 	TInt PolicySessionCount();
    47 
    48 	void StopNotificationTimer();
    49 	void StartNotificationTimer();
    50 
    51 private:
    52 	class CNotificationTimer : public CTimer
    53 		{
    54 	public:
    55 		static CNotificationTimer* NewL(TCallBack aCallBack);
    56 	private:
    57 		virtual void RunL();
    58 		CNotificationTimer(TCallBack aCallBack);
    59 	private:
    60 		TCallBack iCallBack;
    61 		};
    62 	
    63 	CMMFAudioPolicyServer();
    64 	void ConstructL();
    65 
    66 private:
    67 	TInt iPolicySessionId;	
    68 	TInt iSessionToBeLaunched;
    69 	CAudioPolicy* iAudioPolicy;
    70 	TInt iPolicySessionCount;
    71 	CNotificationTimer* iNotificationTimer;
    72 	};
    73 
    74 #endif