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 __MMFDEVSOUNDSERVER_H__ sl@0: #define __MMFDEVSOUNDSERVER_H__ sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS sl@0: #include sl@0: #endif sl@0: #include "MmfAudioServer.h" sl@0: #include "MmfDevSoundServerStart.h" sl@0: sl@0: /** sl@0: Panic category and codes that MmfDevSoundServer raises on the client sl@0: @internalTechnology sl@0: */ sl@0: _LIT(KMMFDevSoundClientPanicCategory, "DevSoundClient"); sl@0: enum TMMFDevSoundClientPanicCodes sl@0: { sl@0: EMMFDevSoundPlayDataWithoutInitialize, sl@0: EMMFDevSoundRecordDataWithoutInitialize sl@0: }; sl@0: sl@0: class CMMFDevSoundServer; // declared here. sl@0: sl@0: NONSHARABLE_CLASS( CMMFDevSoundServer ): public CMmfIpcServer sl@0: /** sl@0: *@internalTechnology sl@0: */ sl@0: { sl@0: public: sl@0: IMPORT_C static CMMFDevSoundServer* NewL(CMMFAudioServer* aAudioServer, TProcessId& aClientPID); sl@0: ~CMMFDevSoundServer(); sl@0: CMmfIpcSession* NewSessionL(const TVersion &aVersion) const; sl@0: void IncrementSessionId(); sl@0: void DecrementSessionId(); sl@0: void SendEventToClient(TInt aSessionToAlert, TInt aSessionToBeLaunched); sl@0: void LaunchRequest(TInt aSessionId); sl@0: TInt DevSoundSessionId() {return iDevSoundSessionId;}; sl@0: TBool CheckClientCapabilities(); sl@0: void SetClientCapabilitiesL(TThreadId aTid); sl@0: sl@0: IMPORT_C static TInt StartThread(TAny* aParams); sl@0: sl@0: private: sl@0: sl@0: CMMFDevSoundServer(CMMFAudioServer* aAudioServer, TProcessId& aClientPID); sl@0: void ConstructL(); sl@0: static void RenamePrioritizeServer(); sl@0: static void StartThreadL(TDevSoundServerStart& aStart); sl@0: class CDelayDevSoundShutDown : public CActive sl@0: { sl@0: public: sl@0: // Construct/destruct sl@0: static CDelayDevSoundShutDown* NewL(); sl@0: ~CDelayDevSoundShutDown(); sl@0: // Request sl@0: void SetDelay(TTimeIntervalMicroSeconds32 aDelay); sl@0: private: sl@0: // Construct/destruct sl@0: CDelayDevSoundShutDown(); sl@0: void ConstructL(); sl@0: sl@0: // From CActive sl@0: void RunL(); sl@0: void DoCancel(); sl@0: private: sl@0: RTimer iTimer; // Has sl@0: }; sl@0: sl@0: sl@0: private: sl@0: TInt iDevSoundSessionId; sl@0: TInt iSessionToBeLaunched; sl@0: TProcessId iClientPID; sl@0: TBool iClientHasCaps; sl@0: CDelayDevSoundShutDown* iDelayDevSoundShutDown; sl@0: CMMFAudioServer* iAudioServer; sl@0: }; sl@0: sl@0: GLDEF_C void PanicClient(const RMmfIpcMessage& aMessage, TMMFDevSoundClientPanicCodes aPanicCode); sl@0: sl@0: /** sl@0: @SYMPatchable sl@0: @publishedPartner sl@0: sl@0: Patchable constant for licencee to set devsound server thread priority sl@0: Licencees should ensure that the devsound server thread priority is equal to the system server priority for better responsiveness. sl@0: If SYMBIAN_CURB_SYSTEMSERVER_PRIORITIES is defined, setting devsound server thread priority to EPriorityAbsoluteHigh will ensure sl@0: devsound server's thread priority is set to system server's priority. sl@0: If the macro is unavailable it is recommended to use EPriorityAbsoluteRealTime1. Usage of EPriorityAbsoluteRealTime1 requires ProtServ capability. sl@0: The constant can be changed at ROM build time using patchdata OBY keyword. sl@0: */ sl@0: IMPORT_C extern const TInt KDevsoundServerPriority; sl@0: sl@0: #endif