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