os/mm/devsound/devsoundrefplugin/src/platsec/server/AudioServer/MmfDevSoundServer.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/devsound/devsoundrefplugin/src/platsec/server/AudioServer/MmfDevSoundServer.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,112 @@
     1.4 +// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#ifndef __MMFDEVSOUNDSERVER_H__
    1.20 +#define __MMFDEVSOUNDSERVER_H__
    1.21 +
    1.22 +#include <e32base.h>
    1.23 +#include <e32def.h>
    1.24 +#include <e32std.h>
    1.25 +#include <mmf/common/mmfipc.h>
    1.26 +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
    1.27 +#include <mmf/common/mmfipcserver.h>
    1.28 +#endif
    1.29 +#include "MmfAudioServer.h"
    1.30 +#include "MmfDevSoundServerStart.h"
    1.31 +
    1.32 +/** 
    1.33 +Panic category and codes that MmfDevSoundServer raises on the client
    1.34 +@internalTechnology
    1.35 +*/
    1.36 +_LIT(KMMFDevSoundClientPanicCategory, "DevSoundClient");
    1.37 +enum TMMFDevSoundClientPanicCodes
    1.38 +	{
    1.39 +	EMMFDevSoundPlayDataWithoutInitialize,
    1.40 +	EMMFDevSoundRecordDataWithoutInitialize
    1.41 +	};
    1.42 +	
    1.43 +class CMMFDevSoundServer; // declared here.
    1.44 +
    1.45 +NONSHARABLE_CLASS( CMMFDevSoundServer ): public CMmfIpcServer
    1.46 +/**
    1.47 +*@internalTechnology
    1.48 +*/
    1.49 +	{
    1.50 +public:
    1.51 +	IMPORT_C static CMMFDevSoundServer* NewL(CMMFAudioServer* aAudioServer, TProcessId& aClientPID);
    1.52 +	~CMMFDevSoundServer();
    1.53 +	CMmfIpcSession* NewSessionL(const TVersion &aVersion) const;
    1.54 +	void IncrementSessionId();
    1.55 +	void DecrementSessionId();
    1.56 +	void SendEventToClient(TInt aSessionToAlert, TInt aSessionToBeLaunched);
    1.57 +	void LaunchRequest(TInt aSessionId);
    1.58 +	TInt DevSoundSessionId() {return iDevSoundSessionId;};
    1.59 +	TBool CheckClientCapabilities();
    1.60 +	void SetClientCapabilitiesL(TThreadId aTid);
    1.61 +	
    1.62 +	IMPORT_C static TInt StartThread(TAny* aParams);
    1.63 +
    1.64 +private:
    1.65 +    
    1.66 +    CMMFDevSoundServer(CMMFAudioServer* aAudioServer, TProcessId& aClientPID);
    1.67 +	void ConstructL();
    1.68 +	static void RenamePrioritizeServer();
    1.69 +	static void StartThreadL(TDevSoundServerStart& aStart);
    1.70 +	class CDelayDevSoundShutDown : public CActive
    1.71 +        {
    1.72 +    public:
    1.73 +        // Construct/destruct
    1.74 +        static CDelayDevSoundShutDown* NewL();
    1.75 +        ~CDelayDevSoundShutDown(); 
    1.76 +        // Request
    1.77 +        void SetDelay(TTimeIntervalMicroSeconds32 aDelay);   
    1.78 +    private:
    1.79 +        // Construct/destruct
    1.80 +        CDelayDevSoundShutDown();
    1.81 +        void ConstructL();
    1.82 +    
    1.83 +        // From CActive
    1.84 +        void RunL();
    1.85 +        void DoCancel();   
    1.86 +    private:
    1.87 +        RTimer iTimer;      // Has
    1.88 +        };
    1.89 +
    1.90 +
    1.91 +private:
    1.92 +	TInt iDevSoundSessionId;	
    1.93 +	TInt iSessionToBeLaunched;
    1.94 +	TProcessId iClientPID;
    1.95 +	TBool iClientHasCaps;
    1.96 +	CDelayDevSoundShutDown* iDelayDevSoundShutDown;
    1.97 +	CMMFAudioServer* iAudioServer;
    1.98 +	};
    1.99 +
   1.100 +GLDEF_C void PanicClient(const RMmfIpcMessage& aMessage, TMMFDevSoundClientPanicCodes aPanicCode);
   1.101 +
   1.102 +/**
   1.103 +@SYMPatchable
   1.104 +@publishedPartner
   1.105 + 
   1.106 +Patchable constant for licencee to set devsound server thread priority
   1.107 +Licencees should ensure that the devsound server thread priority is equal to the system server priority for better responsiveness.
   1.108 +If SYMBIAN_CURB_SYSTEMSERVER_PRIORITIES is defined, setting devsound server thread priority to EPriorityAbsoluteHigh will ensure
   1.109 +devsound server's thread priority is set to system server's priority.
   1.110 +If the macro is unavailable it is recommended to use EPriorityAbsoluteRealTime1. Usage of EPriorityAbsoluteRealTime1 requires ProtServ capability.
   1.111 +The constant can be changed at ROM build time using patchdata OBY keyword.
   1.112 + */
   1.113 +IMPORT_C extern const TInt KDevsoundServerPriority;
   1.114 +
   1.115 +#endif