os/mm/devsound/devsoundrefplugin/src/platsec/server/AudioServer/MmfAudioServer.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2004-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 __MMFAUDIOSERVER_H__
    17 #define __MMFAUDIOSERVER_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 "mmfAudioPolicyProxy.h"
    26 
    27 class CStartAndMonitorDevSoundThread;
    28 class RMMFDevSoundServerProxy;
    29 
    30 class CMMFAudioServer : public CMmfIpcServer
    31 /**
    32 *@internalTechnology
    33 */
    34 	{
    35 public:
    36 	static CMMFAudioServer* NewL();
    37 	~CMMFAudioServer();
    38 	CMmfIpcSession* NewSessionL(const TVersion &aVersion) const;
    39 	void IncrementSessionId();
    40 	void DecrementSessionId();
    41 
    42 	void IncrementDevSoundCount();
    43 	void DecrementDevSoundCount();
    44 
    45 	void SendEventToClient(TInt aSessionToAlert, TInt aSessionToBeLaunched);
    46 	void LaunchRequest(TInt aSessionId);
    47 	//CAudioPolicy* AudioPolicy() {return iAudioPolicy;};
    48 	TInt AudioServerSessionId() {return iAudioServerSessionId;};
    49 	TInt StartDevSoundServer(RMMFDevSoundServerProxy& aDevSoundSessionHandle) const;
    50 	RServer2& PolicyServerHandle();
    51 private:
    52 
    53 	class CDelayAudioServerShutDown : public CActive
    54         {
    55     public:
    56         // Construct/destruct
    57         static CDelayAudioServerShutDown* NewL();
    58         ~CDelayAudioServerShutDown(); 
    59         // Request
    60         void SetDelay(TTimeIntervalMicroSeconds32 aDelay);   
    61     private:
    62         // Construct/destruct
    63         CDelayAudioServerShutDown();
    64         void ConstructL();
    65     
    66         // From CActive
    67         void RunL();
    68         void DoCancel();   
    69     private:
    70         RTimer iShutDownTimer;      // Has
    71         };
    72 
    73 private:
    74 	CMMFAudioServer();
    75 	void ConstructL();
    76 
    77 private:
    78 	TInt iAudioServerSessionId;
    79 	TInt iDevSoundCount;
    80 	TInt iSessionToBeLaunched;
    81 	CDelayAudioServerShutDown* iDelayAudioServerShutDown;
    82 	mutable RPointerArray<CStartAndMonitorDevSoundThread> iDevSoundServList;
    83 	RServer2 iPolicyServerHandle;
    84 	RMMFAudioPolicyProxy* iAudioPolicyProxy;
    85 	};
    86 
    87 class CStartAndMonitorDevSoundThread: public CActive
    88 	{
    89 public:
    90 	static CStartAndMonitorDevSoundThread* NewL(CMMFAudioServer* aAudioServer);
    91 	~CStartAndMonitorDevSoundThread();
    92 	TInt StartDevSoundServer(RMessage2& aMessage, RMMFDevSoundServerProxy& aDevSoundSessionHandle);
    93 private:
    94 	// Construct
    95 	CStartAndMonitorDevSoundThread(CMMFAudioServer* aAudioServer);
    96 	void ConstructL();
    97    
    98 	// From CActive
    99 	void RunL();
   100 	void DoCancel();
   101 private:
   102 	CMMFAudioServer* iAudioServer;
   103 	RThread iServer;
   104         };
   105         
   106 class RMMFDevSoundServerProxy : public RMmfSessionBase
   107 	{
   108 public:
   109 	TInt Open(RServer2& aDevSoundServerHandle);
   110 	};
   111 	
   112 #include "MmfAudioServer.inl"
   113 #endif