os/mm/devsound/devsoundrefplugin/src/platsec/server/AudioServer/MmfDevSoundServer.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200 (2014-06-10)
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
#ifndef __MMFDEVSOUNDSERVER_H__
sl@0
    17
#define __MMFDEVSOUNDSERVER_H__
sl@0
    18
sl@0
    19
#include <e32base.h>
sl@0
    20
#include <e32def.h>
sl@0
    21
#include <e32std.h>
sl@0
    22
#include <mmf/common/mmfipc.h>
sl@0
    23
#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
sl@0
    24
#include <mmf/common/mmfipcserver.h>
sl@0
    25
#endif
sl@0
    26
#include "MmfAudioServer.h"
sl@0
    27
#include "MmfDevSoundServerStart.h"
sl@0
    28
sl@0
    29
/** 
sl@0
    30
Panic category and codes that MmfDevSoundServer raises on the client
sl@0
    31
@internalTechnology
sl@0
    32
*/
sl@0
    33
_LIT(KMMFDevSoundClientPanicCategory, "DevSoundClient");
sl@0
    34
enum TMMFDevSoundClientPanicCodes
sl@0
    35
	{
sl@0
    36
	EMMFDevSoundPlayDataWithoutInitialize,
sl@0
    37
	EMMFDevSoundRecordDataWithoutInitialize
sl@0
    38
	};
sl@0
    39
	
sl@0
    40
class CMMFDevSoundServer; // declared here.
sl@0
    41
sl@0
    42
NONSHARABLE_CLASS( CMMFDevSoundServer ): public CMmfIpcServer
sl@0
    43
/**
sl@0
    44
*@internalTechnology
sl@0
    45
*/
sl@0
    46
	{
sl@0
    47
public:
sl@0
    48
	IMPORT_C static CMMFDevSoundServer* NewL(CMMFAudioServer* aAudioServer, TProcessId& aClientPID);
sl@0
    49
	~CMMFDevSoundServer();
sl@0
    50
	CMmfIpcSession* NewSessionL(const TVersion &aVersion) const;
sl@0
    51
	void IncrementSessionId();
sl@0
    52
	void DecrementSessionId();
sl@0
    53
	void SendEventToClient(TInt aSessionToAlert, TInt aSessionToBeLaunched);
sl@0
    54
	void LaunchRequest(TInt aSessionId);
sl@0
    55
	TInt DevSoundSessionId() {return iDevSoundSessionId;};
sl@0
    56
	TBool CheckClientCapabilities();
sl@0
    57
	void SetClientCapabilitiesL(TThreadId aTid);
sl@0
    58
	
sl@0
    59
	IMPORT_C static TInt StartThread(TAny* aParams);
sl@0
    60
sl@0
    61
private:
sl@0
    62
    
sl@0
    63
    CMMFDevSoundServer(CMMFAudioServer* aAudioServer, TProcessId& aClientPID);
sl@0
    64
	void ConstructL();
sl@0
    65
	static void RenamePrioritizeServer();
sl@0
    66
	static void StartThreadL(TDevSoundServerStart& aStart);
sl@0
    67
	class CDelayDevSoundShutDown : public CActive
sl@0
    68
        {
sl@0
    69
    public:
sl@0
    70
        // Construct/destruct
sl@0
    71
        static CDelayDevSoundShutDown* NewL();
sl@0
    72
        ~CDelayDevSoundShutDown(); 
sl@0
    73
        // Request
sl@0
    74
        void SetDelay(TTimeIntervalMicroSeconds32 aDelay);   
sl@0
    75
    private:
sl@0
    76
        // Construct/destruct
sl@0
    77
        CDelayDevSoundShutDown();
sl@0
    78
        void ConstructL();
sl@0
    79
    
sl@0
    80
        // From CActive
sl@0
    81
        void RunL();
sl@0
    82
        void DoCancel();   
sl@0
    83
    private:
sl@0
    84
        RTimer iTimer;      // Has
sl@0
    85
        };
sl@0
    86
sl@0
    87
sl@0
    88
private:
sl@0
    89
	TInt iDevSoundSessionId;	
sl@0
    90
	TInt iSessionToBeLaunched;
sl@0
    91
	TProcessId iClientPID;
sl@0
    92
	TBool iClientHasCaps;
sl@0
    93
	CDelayDevSoundShutDown* iDelayDevSoundShutDown;
sl@0
    94
	CMMFAudioServer* iAudioServer;
sl@0
    95
	};
sl@0
    96
sl@0
    97
GLDEF_C void PanicClient(const RMmfIpcMessage& aMessage, TMMFDevSoundClientPanicCodes aPanicCode);
sl@0
    98
sl@0
    99
/**
sl@0
   100
@SYMPatchable
sl@0
   101
@publishedPartner
sl@0
   102
 
sl@0
   103
Patchable constant for licencee to set devsound server thread priority
sl@0
   104
Licencees should ensure that the devsound server thread priority is equal to the system server priority for better responsiveness.
sl@0
   105
If SYMBIAN_CURB_SYSTEMSERVER_PRIORITIES is defined, setting devsound server thread priority to EPriorityAbsoluteHigh will ensure
sl@0
   106
devsound server's thread priority is set to system server's priority.
sl@0
   107
If the macro is unavailable it is recommended to use EPriorityAbsoluteRealTime1. Usage of EPriorityAbsoluteRealTime1 requires ProtServ capability.
sl@0
   108
The constant can be changed at ROM build time using patchdata OBY keyword.
sl@0
   109
 */
sl@0
   110
IMPORT_C extern const TInt KDevsoundServerPriority;
sl@0
   111
sl@0
   112
#endif