os/mm/devsound/sounddevbt/PlatSec/src/Server/AudioServer/MmfBtAudioServer.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 class CStartAndMonitorDevSoundThread;
    26 
    27 class CMMFAudioServer : public CMmfIpcServer
    28 /**
    29 *@internalTechnology
    30 */
    31 	{
    32 public:
    33 	static CMMFAudioServer* NewL();
    34 	~CMMFAudioServer();
    35 	CMmfIpcSession* NewSessionL(const TVersion &aVersion) const;
    36 	void IncrementSessionId();
    37 	void DecrementSessionId();
    38 
    39 	void IncrementDevSoundCount();
    40 	void DecrementDevSoundCount();
    41 
    42 	void SendEventToClient(TInt aSessionToAlert, TInt aSessionToBeLaunched);
    43 	void LaunchRequest(TInt aSessionId);
    44 	//CAudioPolicy* AudioPolicy() {return iAudioPolicy;};
    45 	TInt AudioServerSessionId() {return iAudioServerSessionId;};
    46 	TInt StartDevSoundServerL(TName& aDevSoundName) const;
    47 	RServer2& PolicyServerHandle();
    48 private:
    49 
    50 	class CDelayAudioServerShutDown : public CActive
    51         {
    52     public:
    53         // Construct/destruct
    54         static CDelayAudioServerShutDown* NewL();
    55         ~CDelayAudioServerShutDown(); 
    56         // Request
    57         void SetDelay(TTimeIntervalMicroSeconds32 aDelay);   
    58     private:
    59         // Construct/destruct
    60         CDelayAudioServerShutDown();
    61         void ConstructL();
    62     
    63         // From CActive
    64         void RunL();
    65         void DoCancel();   
    66     private:
    67         RTimer iShutDownTimer;      // Has
    68         };
    69 
    70 private:
    71 	CMMFAudioServer();
    72 	void ConstructL();
    73 
    74 private:
    75 	TInt iAudioServerSessionId;
    76 	TInt iDevSoundCount;
    77 	TInt iSessionToBeLaunched;
    78 	TInt iGlobalNum;
    79 	CDelayAudioServerShutDown* iDelayAudioServerShutDown;
    80 	mutable RPointerArray<CStartAndMonitorDevSoundThread> iDevSoundServList;
    81 	RServer2 iPolicyServerHandle;
    82 	};
    83 
    84 class CStartAndMonitorDevSoundThread: public CActive
    85 	{
    86 public:
    87 	static CStartAndMonitorDevSoundThread* NewL(CMMFAudioServer* aAudioServer);
    88 	~CStartAndMonitorDevSoundThread();
    89 	TInt StartDevSoundServerL(RMessage2& aMessage, TName& aDevSoundName, TInt aUniqueNum);
    90 private:
    91 	// Construct
    92 	CStartAndMonitorDevSoundThread(CMMFAudioServer* aAudioServer);
    93 	void ConstructL();
    94    
    95 	// From CActive
    96 	void RunL();
    97 	void DoCancel();
    98 private:
    99 	CMMFAudioServer* iAudioServer;
   100 	RThread iServer;
   101         };
   102 #include "MmfBtAudioServer.inl"
   103 #endif