sl@0: // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #ifndef __MMFAUDIOSERVER_H__ sl@0: #define __MMFAUDIOSERVER_H__ sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS sl@0: #include sl@0: #endif sl@0: class CStartAndMonitorDevSoundThread; sl@0: sl@0: class CMMFAudioServer : public CMmfIpcServer sl@0: /** sl@0: *@internalTechnology sl@0: */ sl@0: { sl@0: public: sl@0: static CMMFAudioServer* NewL(); sl@0: ~CMMFAudioServer(); sl@0: CMmfIpcSession* NewSessionL(const TVersion &aVersion) const; sl@0: void IncrementSessionId(); sl@0: void DecrementSessionId(); sl@0: sl@0: void IncrementDevSoundCount(); sl@0: void DecrementDevSoundCount(); sl@0: sl@0: void SendEventToClient(TInt aSessionToAlert, TInt aSessionToBeLaunched); sl@0: void LaunchRequest(TInt aSessionId); sl@0: //CAudioPolicy* AudioPolicy() {return iAudioPolicy;}; sl@0: TInt AudioServerSessionId() {return iAudioServerSessionId;}; sl@0: TInt StartDevSoundServerL(TName& aDevSoundName) const; sl@0: RServer2& PolicyServerHandle(); sl@0: private: sl@0: sl@0: class CDelayAudioServerShutDown : public CActive sl@0: { sl@0: public: sl@0: // Construct/destruct sl@0: static CDelayAudioServerShutDown* NewL(); sl@0: ~CDelayAudioServerShutDown(); sl@0: // Request sl@0: void SetDelay(TTimeIntervalMicroSeconds32 aDelay); sl@0: private: sl@0: // Construct/destruct sl@0: CDelayAudioServerShutDown(); sl@0: void ConstructL(); sl@0: sl@0: // From CActive sl@0: void RunL(); sl@0: void DoCancel(); sl@0: private: sl@0: RTimer iShutDownTimer; // Has sl@0: }; sl@0: sl@0: private: sl@0: CMMFAudioServer(); sl@0: void ConstructL(); sl@0: sl@0: private: sl@0: TInt iAudioServerSessionId; sl@0: TInt iDevSoundCount; sl@0: TInt iSessionToBeLaunched; sl@0: TInt iGlobalNum; sl@0: CDelayAudioServerShutDown* iDelayAudioServerShutDown; sl@0: mutable RPointerArray iDevSoundServList; sl@0: RServer2 iPolicyServerHandle; sl@0: }; sl@0: sl@0: class CStartAndMonitorDevSoundThread: public CActive sl@0: { sl@0: public: sl@0: static CStartAndMonitorDevSoundThread* NewL(CMMFAudioServer* aAudioServer); sl@0: ~CStartAndMonitorDevSoundThread(); sl@0: TInt StartDevSoundServerL(RMessage2& aMessage, TName& aDevSoundName, TInt aUniqueNum); sl@0: private: sl@0: // Construct sl@0: CStartAndMonitorDevSoundThread(CMMFAudioServer* aAudioServer); sl@0: void ConstructL(); sl@0: sl@0: // From CActive sl@0: void RunL(); sl@0: void DoCancel(); sl@0: private: sl@0: CMMFAudioServer* iAudioServer; sl@0: RThread iServer; sl@0: }; sl@0: #include "MmfBtAudioServer.inl" sl@0: #endif