os/mm/devsound/devsoundrefplugin/src/server/MmfAudioPolicyServer.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 __MMFAUDIOPOLICYSERVER_H__
    17 #define __MMFAUDIOPOLICYSERVER_H__
    18 
    19 #include <e32base.h>
    20 #include <e32std.h>
    21 #include "MmfAudioPolicy.h"
    22 #include "MmfPolicyClientServer.h"
    23 #include "MmfAudioPolicyStart.h"
    24 
    25 class CMMFAudioPolicyServer; // declared here.
    26 
    27 NONSHARABLE_CLASS( CMMFAudioPolicyServer ): public CMmfIpcServer
    28 /**
    29 *@internalTechnology
    30 */
    31 	{
    32 public:
    33 	static CMMFAudioPolicyServer* NewL(); 
    34 	~CMMFAudioPolicyServer();
    35 	CMmfIpcSession* NewSessionL(const TVersion &aVersion) const;
    36 	void IncrementSessionId();
    37 	void SendEventToClient(TInt aSessionToAlert,const TMMFAudioPolicyEvent& aEvent);
    38 	void LaunchRequest(TInt aSessionId,const TMMFAudioPolicyEvent& aEvent);
    39 	inline CAudioPolicy* AudioPolicy() {return iAudioPolicy;};
    40 	inline TInt PolicySessionId() {return iPolicySessionId;};
    41 	static TInt SendNotification(TAny* aAny);
    42 	TBool IsTimerActive() const;
    43 	
    44 	IMPORT_C static TInt StartThread(TAny* aParams);
    45 	void IncrementSessionCount();
    46 	void DecrementSessionCount();
    47 	TInt PolicySessionCount();
    48 
    49 	void StopNotificationTimer();
    50 	void StartNotificationTimer(TBool aZeroDelay=EFalse);
    51 
    52 private:
    53 	class CNotificationTimer : public CTimer
    54 		{
    55 	public:
    56 		static CNotificationTimer* NewL(TCallBack aCallBack);
    57 	private:
    58 		virtual void RunL();
    59 		CNotificationTimer(TCallBack aCallBack);
    60 	private:
    61 		TCallBack iCallBack;
    62 		};
    63 	
    64 	CMMFAudioPolicyServer();
    65 	void ConstructL();
    66     static void StartThreadL(TServerStart& aStart);
    67 
    68 private:
    69 	TInt iPolicySessionId;	
    70 	CAudioPolicy* iAudioPolicy;
    71 	TInt iPolicySessionCount;
    72 	CNotificationTimer* iNotificationTimer;
    73 	};
    74 
    75 #endif