os/mm/devsound/sounddevbt/PlatSec/src/Server/AudioServer/MmfBtAudioServer.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/devsound/sounddevbt/PlatSec/src/Server/AudioServer/MmfBtAudioServer.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,103 @@
     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 __MMFAUDIOSERVER_H__
    1.20 +#define __MMFAUDIOSERVER_H__
    1.21 +
    1.22 +#include <e32base.h>
    1.23 +#include <e32std.h>
    1.24 +#include <mmf/common/mmfipc.h>
    1.25 +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
    1.26 +#include <mmf/common/mmfipcserver.h>
    1.27 +#endif
    1.28 +class CStartAndMonitorDevSoundThread;
    1.29 +
    1.30 +class CMMFAudioServer : public CMmfIpcServer
    1.31 +/**
    1.32 +*@internalTechnology
    1.33 +*/
    1.34 +	{
    1.35 +public:
    1.36 +	static CMMFAudioServer* NewL();
    1.37 +	~CMMFAudioServer();
    1.38 +	CMmfIpcSession* NewSessionL(const TVersion &aVersion) const;
    1.39 +	void IncrementSessionId();
    1.40 +	void DecrementSessionId();
    1.41 +
    1.42 +	void IncrementDevSoundCount();
    1.43 +	void DecrementDevSoundCount();
    1.44 +
    1.45 +	void SendEventToClient(TInt aSessionToAlert, TInt aSessionToBeLaunched);
    1.46 +	void LaunchRequest(TInt aSessionId);
    1.47 +	//CAudioPolicy* AudioPolicy() {return iAudioPolicy;};
    1.48 +	TInt AudioServerSessionId() {return iAudioServerSessionId;};
    1.49 +	TInt StartDevSoundServerL(TName& aDevSoundName) const;
    1.50 +	RServer2& PolicyServerHandle();
    1.51 +private:
    1.52 +
    1.53 +	class CDelayAudioServerShutDown : public CActive
    1.54 +        {
    1.55 +    public:
    1.56 +        // Construct/destruct
    1.57 +        static CDelayAudioServerShutDown* NewL();
    1.58 +        ~CDelayAudioServerShutDown(); 
    1.59 +        // Request
    1.60 +        void SetDelay(TTimeIntervalMicroSeconds32 aDelay);   
    1.61 +    private:
    1.62 +        // Construct/destruct
    1.63 +        CDelayAudioServerShutDown();
    1.64 +        void ConstructL();
    1.65 +    
    1.66 +        // From CActive
    1.67 +        void RunL();
    1.68 +        void DoCancel();   
    1.69 +    private:
    1.70 +        RTimer iShutDownTimer;      // Has
    1.71 +        };
    1.72 +
    1.73 +private:
    1.74 +	CMMFAudioServer();
    1.75 +	void ConstructL();
    1.76 +
    1.77 +private:
    1.78 +	TInt iAudioServerSessionId;
    1.79 +	TInt iDevSoundCount;
    1.80 +	TInt iSessionToBeLaunched;
    1.81 +	TInt iGlobalNum;
    1.82 +	CDelayAudioServerShutDown* iDelayAudioServerShutDown;
    1.83 +	mutable RPointerArray<CStartAndMonitorDevSoundThread> iDevSoundServList;
    1.84 +	RServer2 iPolicyServerHandle;
    1.85 +	};
    1.86 +
    1.87 +class CStartAndMonitorDevSoundThread: public CActive
    1.88 +	{
    1.89 +public:
    1.90 +	static CStartAndMonitorDevSoundThread* NewL(CMMFAudioServer* aAudioServer);
    1.91 +	~CStartAndMonitorDevSoundThread();
    1.92 +	TInt StartDevSoundServerL(RMessage2& aMessage, TName& aDevSoundName, TInt aUniqueNum);
    1.93 +private:
    1.94 +	// Construct
    1.95 +	CStartAndMonitorDevSoundThread(CMMFAudioServer* aAudioServer);
    1.96 +	void ConstructL();
    1.97 +   
    1.98 +	// From CActive
    1.99 +	void RunL();
   1.100 +	void DoCancel();
   1.101 +private:
   1.102 +	CMMFAudioServer* iAudioServer;
   1.103 +	RThread iServer;
   1.104 +        };
   1.105 +#include "MmfBtAudioServer.inl"
   1.106 +#endif