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