os/mm/devsound/devsoundrefplugin/src/platsec/server/AudioServer/MmfDevSoundServer.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) 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 __MMFDEVSOUNDSERVER_H__
    17 #define __MMFDEVSOUNDSERVER_H__
    18 
    19 #include <e32base.h>
    20 #include <e32def.h>
    21 #include <e32std.h>
    22 #include <mmf/common/mmfipc.h>
    23 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
    24 #include <mmf/common/mmfipcserver.h>
    25 #endif
    26 #include "MmfAudioServer.h"
    27 #include "MmfDevSoundServerStart.h"
    28 
    29 /** 
    30 Panic category and codes that MmfDevSoundServer raises on the client
    31 @internalTechnology
    32 */
    33 _LIT(KMMFDevSoundClientPanicCategory, "DevSoundClient");
    34 enum TMMFDevSoundClientPanicCodes
    35 	{
    36 	EMMFDevSoundPlayDataWithoutInitialize,
    37 	EMMFDevSoundRecordDataWithoutInitialize
    38 	};
    39 	
    40 class CMMFDevSoundServer; // declared here.
    41 
    42 NONSHARABLE_CLASS( CMMFDevSoundServer ): public CMmfIpcServer
    43 /**
    44 *@internalTechnology
    45 */
    46 	{
    47 public:
    48 	IMPORT_C static CMMFDevSoundServer* NewL(CMMFAudioServer* aAudioServer, TProcessId& aClientPID);
    49 	~CMMFDevSoundServer();
    50 	CMmfIpcSession* NewSessionL(const TVersion &aVersion) const;
    51 	void IncrementSessionId();
    52 	void DecrementSessionId();
    53 	void SendEventToClient(TInt aSessionToAlert, TInt aSessionToBeLaunched);
    54 	void LaunchRequest(TInt aSessionId);
    55 	TInt DevSoundSessionId() {return iDevSoundSessionId;};
    56 	TBool CheckClientCapabilities();
    57 	void SetClientCapabilitiesL(TThreadId aTid);
    58 	
    59 	IMPORT_C static TInt StartThread(TAny* aParams);
    60 
    61 private:
    62     
    63     CMMFDevSoundServer(CMMFAudioServer* aAudioServer, TProcessId& aClientPID);
    64 	void ConstructL();
    65 	static void RenamePrioritizeServer();
    66 	static void StartThreadL(TDevSoundServerStart& aStart);
    67 	class CDelayDevSoundShutDown : public CActive
    68         {
    69     public:
    70         // Construct/destruct
    71         static CDelayDevSoundShutDown* NewL();
    72         ~CDelayDevSoundShutDown(); 
    73         // Request
    74         void SetDelay(TTimeIntervalMicroSeconds32 aDelay);   
    75     private:
    76         // Construct/destruct
    77         CDelayDevSoundShutDown();
    78         void ConstructL();
    79     
    80         // From CActive
    81         void RunL();
    82         void DoCancel();   
    83     private:
    84         RTimer iTimer;      // Has
    85         };
    86 
    87 
    88 private:
    89 	TInt iDevSoundSessionId;	
    90 	TInt iSessionToBeLaunched;
    91 	TProcessId iClientPID;
    92 	TBool iClientHasCaps;
    93 	CDelayDevSoundShutDown* iDelayDevSoundShutDown;
    94 	CMMFAudioServer* iAudioServer;
    95 	};
    96 
    97 GLDEF_C void PanicClient(const RMmfIpcMessage& aMessage, TMMFDevSoundClientPanicCodes aPanicCode);
    98 
    99 /**
   100 @SYMPatchable
   101 @publishedPartner
   102  
   103 Patchable constant for licencee to set devsound server thread priority
   104 Licencees should ensure that the devsound server thread priority is equal to the system server priority for better responsiveness.
   105 If SYMBIAN_CURB_SYSTEMSERVER_PRIORITIES is defined, setting devsound server thread priority to EPriorityAbsoluteHigh will ensure
   106 devsound server's thread priority is set to system server's priority.
   107 If the macro is unavailable it is recommended to use EPriorityAbsoluteRealTime1. Usage of EPriorityAbsoluteRealTime1 requires ProtServ capability.
   108 The constant can be changed at ROM build time using patchdata OBY keyword.
   109  */
   110 IMPORT_C extern const TInt KDevsoundServerPriority;
   111 
   112 #endif