sl@0: // Copyright (c) 2005-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 __A2DPBTHEADSETAUDIOIFSERVER_H__ sl@0: #define __A2DPBTHEADSETAUDIOIFSERVER_H__ sl@0: sl@0: #include sl@0: #include sl@0: #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS sl@0: #include sl@0: #endif sl@0: #include "A2dpBTHeadsetAudioIfClientServer.h" sl@0: sl@0: class CA2dpBTHeadsetAudioInterface; // fwd declaration sl@0: class TFourCC; sl@0: class TRange; sl@0: sl@0: /** sl@0: * CA2dpBTHeadsetAudioIfServer definition sl@0: */ sl@0: class CA2dpBTHeadsetAudioIfServer : public CMmfIpcServer sl@0: { sl@0: public: sl@0: IMPORT_C static TInt StartThread(TAny* aParms); // thread entry point sl@0: sl@0: static CA2dpBTHeadsetAudioIfServer* NewL(); sl@0: ~CA2dpBTHeadsetAudioIfServer(); sl@0: CMmfIpcSession* NewSessionL(const TVersion &aVersion) const; sl@0: private: sl@0: CA2dpBTHeadsetAudioIfServer(); sl@0: void ConstructL(); sl@0: private: sl@0: CA2dpBTHeadsetAudioInterface* iBTAudioInterface; sl@0: }; sl@0: sl@0: /** sl@0: * CA2dpBTHeadsetIfEventHandler sl@0: */ sl@0: class CA2dpBTHeadsetIfEventHandler : public CActive sl@0: { sl@0: public: sl@0: static CA2dpBTHeadsetIfEventHandler* NewL(); sl@0: ~CA2dpBTHeadsetIfEventHandler(); sl@0: void StartL(const RMmfIpcMessage& aMessage); sl@0: void Stop(); sl@0: private: sl@0: CA2dpBTHeadsetIfEventHandler(); sl@0: void RunL(); sl@0: void DoCancel(); sl@0: void ConstructL(); sl@0: private: sl@0: RMmfIpcMessage* iMessage; sl@0: }; sl@0: sl@0: /** sl@0: * CA2dpBTHeadsetAudioIfSession definition sl@0: */ sl@0: class CA2dpBTHeadsetAudioIfSession : public CMmfIpcSession sl@0: { sl@0: public: sl@0: static CA2dpBTHeadsetAudioIfSession* NewL(CA2dpBTHeadsetAudioInterface* aBTAudioInterface); sl@0: ~CA2dpBTHeadsetAudioIfSession(); sl@0: void ServiceL(const RMessage2& aMessage); sl@0: sl@0: private: sl@0: CA2dpBTHeadsetAudioIfSession(CA2dpBTHeadsetAudioInterface* aBTAudioInterface); sl@0: void ConstructL(); sl@0: sl@0: TBool DoInitializeL(const RMmfIpcMessage& aMessage); sl@0: TBool DoCancelInitializeL(const RMmfIpcMessage& aMessage); sl@0: TBool DoCopyFourCCArrayDataL(const RMmfIpcMessage& aMessage); sl@0: TBool DoCopyUintArrayDataL(const RMmfIpcMessage& aMessage, RArray aArray); sl@0: TBool DoCopyChannelsArrayDataL(const RMmfIpcMessage& aMessage); sl@0: TInt DoGetSupportedDataTypesL(const RMmfIpcMessage& aMessage);// returns error value sl@0: TInt DoGetSupportedSampleRatesL(const RMmfIpcMessage& aMessage); sl@0: TBool DoGetSupportedSampleRatesDiscreteL(const RMmfIpcMessage& aMessage); sl@0: TBool DoGetSupportedSampleRatesRangeL(const RMmfIpcMessage& aMessage); sl@0: TInt DoGetSupportedChannelsL(const RMmfIpcMessage& aMessage); sl@0: TBool DoGetStereoSupportL(const RMmfIpcMessage& aMessage); sl@0: TInt DoSetDataTypeL(const RMmfIpcMessage& aMessage); // returns error value sl@0: TInt DoSetSampleRateL(const RMmfIpcMessage& aMessage);// returns error value sl@0: TInt DoSetChannelsL(const RMmfIpcMessage& aMessage);// returns error value sl@0: TBool DoOpenDeviceL(const RMmfIpcMessage& aMessage); sl@0: TBool DoCancelOpenDevice(const RMmfIpcMessage& aMessage); sl@0: TBool DoCloseDeviceL(const RMmfIpcMessage& aMessage); sl@0: TBool DoVolumeL(const RMmfIpcMessage& aMessage); sl@0: TInt DoSetVolumeL(const RMmfIpcMessage& aMessage);// returns error value sl@0: TBool DoPlayDataL(const RMmfIpcMessage& aMessage); sl@0: TBool DoCancelPlayDataL(const RMmfIpcMessage& aMessage); sl@0: TBool DoFlushBufferL(const RMmfIpcMessage& aMessage); sl@0: TBool DoBytesPlayedL(const RMmfIpcMessage& aMessage); sl@0: TBool DoResetBytesPlayedL(const RMmfIpcMessage& aMessage); sl@0: TBool DoPauseBufferL(const RMmfIpcMessage& aMessage); sl@0: TBool DoResumePlayingL(const RMmfIpcMessage& aMessage); sl@0: TBool DoNotifyErrorL(const RMmfIpcMessage& aMessage); sl@0: TBool DoCancelNotifyErrorL(const RMmfIpcMessage& aMessage); sl@0: sl@0: private: sl@0: CA2dpBTHeadsetAudioInterface* iBTAudioInterface; // Not owned sl@0: // Hmm - one handler per asynch call and then no need to store messages? sl@0: CA2dpBTHeadsetIfEventHandler* iInitHandler; // AO to manage asynch calls to the interface sl@0: CA2dpBTHeadsetIfEventHandler* iOpenDeviceHandler; // AO to manage asynch calls to the interface sl@0: CA2dpBTHeadsetIfEventHandler* iCloseDeviceHandler; // AO to manage asynch calls to the interface sl@0: CA2dpBTHeadsetIfEventHandler* iPlayDataHandler; // AO to manage asynch calls to the interface sl@0: CA2dpBTHeadsetIfEventHandler* iNotifyErrorHandler; // AO to manage asynch calls to the interface sl@0: sl@0: RArray iFourCCArray; sl@0: RArray iDiscreteArray; sl@0: RArray iRangeArray; sl@0: RArray iStereoSupportArray; sl@0: }; sl@0: #endif