1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/devsound/sounddevbt/src/A2dpBlueTooth/server/A2dpBTHeadsetAudioIfServer.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,124 @@
1.4 +// Copyright (c) 2005-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 __A2DPBTHEADSETAUDIOIFSERVER_H__
1.20 +#define __A2DPBTHEADSETAUDIOIFSERVER_H__
1.21 +
1.22 +#include <e32base.h>
1.23 +#include <mmf/common/mmfipc.h>
1.24 +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
1.25 +#include <mmf/common/mmfipcserver.h>
1.26 +#endif
1.27 +#include "A2dpBTHeadsetAudioIfClientServer.h"
1.28 +
1.29 +class CA2dpBTHeadsetAudioInterface; // fwd declaration
1.30 +class TFourCC;
1.31 +class TRange;
1.32 +
1.33 +/**
1.34 + * CA2dpBTHeadsetAudioIfServer definition
1.35 + */
1.36 +class CA2dpBTHeadsetAudioIfServer : public CMmfIpcServer
1.37 + {
1.38 +public:
1.39 + IMPORT_C static TInt StartThread(TAny* aParms); // thread entry point
1.40 +
1.41 + static CA2dpBTHeadsetAudioIfServer* NewL();
1.42 + ~CA2dpBTHeadsetAudioIfServer();
1.43 + CMmfIpcSession* NewSessionL(const TVersion &aVersion) const;
1.44 +private:
1.45 + CA2dpBTHeadsetAudioIfServer();
1.46 + void ConstructL();
1.47 +private:
1.48 + CA2dpBTHeadsetAudioInterface* iBTAudioInterface;
1.49 + };
1.50 +
1.51 +/**
1.52 + * CA2dpBTHeadsetIfEventHandler
1.53 + */
1.54 +class CA2dpBTHeadsetIfEventHandler : public CActive
1.55 + {
1.56 +public:
1.57 + static CA2dpBTHeadsetIfEventHandler* NewL();
1.58 + ~CA2dpBTHeadsetIfEventHandler();
1.59 + void StartL(const RMmfIpcMessage& aMessage);
1.60 + void Stop();
1.61 +private:
1.62 + CA2dpBTHeadsetIfEventHandler();
1.63 + void RunL();
1.64 + void DoCancel();
1.65 + void ConstructL();
1.66 +private:
1.67 + RMmfIpcMessage* iMessage;
1.68 + };
1.69 +
1.70 +/**
1.71 + * CA2dpBTHeadsetAudioIfSession definition
1.72 + */
1.73 +class CA2dpBTHeadsetAudioIfSession : public CMmfIpcSession
1.74 + {
1.75 +public:
1.76 + static CA2dpBTHeadsetAudioIfSession* NewL(CA2dpBTHeadsetAudioInterface* aBTAudioInterface);
1.77 + ~CA2dpBTHeadsetAudioIfSession();
1.78 + void ServiceL(const RMessage2& aMessage);
1.79 +
1.80 +private:
1.81 + CA2dpBTHeadsetAudioIfSession(CA2dpBTHeadsetAudioInterface* aBTAudioInterface);
1.82 + void ConstructL();
1.83 +
1.84 + TBool DoInitializeL(const RMmfIpcMessage& aMessage);
1.85 + TBool DoCancelInitializeL(const RMmfIpcMessage& aMessage);
1.86 + TBool DoCopyFourCCArrayDataL(const RMmfIpcMessage& aMessage);
1.87 + TBool DoCopyUintArrayDataL(const RMmfIpcMessage& aMessage, RArray<TUint> aArray);
1.88 + TBool DoCopyChannelsArrayDataL(const RMmfIpcMessage& aMessage);
1.89 + TInt DoGetSupportedDataTypesL(const RMmfIpcMessage& aMessage);// returns error value
1.90 + TInt DoGetSupportedSampleRatesL(const RMmfIpcMessage& aMessage);
1.91 + TBool DoGetSupportedSampleRatesDiscreteL(const RMmfIpcMessage& aMessage);
1.92 + TBool DoGetSupportedSampleRatesRangeL(const RMmfIpcMessage& aMessage);
1.93 + TInt DoGetSupportedChannelsL(const RMmfIpcMessage& aMessage);
1.94 + TBool DoGetStereoSupportL(const RMmfIpcMessage& aMessage);
1.95 + TInt DoSetDataTypeL(const RMmfIpcMessage& aMessage); // returns error value
1.96 + TInt DoSetSampleRateL(const RMmfIpcMessage& aMessage);// returns error value
1.97 + TInt DoSetChannelsL(const RMmfIpcMessage& aMessage);// returns error value
1.98 + TBool DoOpenDeviceL(const RMmfIpcMessage& aMessage);
1.99 + TBool DoCancelOpenDevice(const RMmfIpcMessage& aMessage);
1.100 + TBool DoCloseDeviceL(const RMmfIpcMessage& aMessage);
1.101 + TBool DoVolumeL(const RMmfIpcMessage& aMessage);
1.102 + TInt DoSetVolumeL(const RMmfIpcMessage& aMessage);// returns error value
1.103 + TBool DoPlayDataL(const RMmfIpcMessage& aMessage);
1.104 + TBool DoCancelPlayDataL(const RMmfIpcMessage& aMessage);
1.105 + TBool DoFlushBufferL(const RMmfIpcMessage& aMessage);
1.106 + TBool DoBytesPlayedL(const RMmfIpcMessage& aMessage);
1.107 + TBool DoResetBytesPlayedL(const RMmfIpcMessage& aMessage);
1.108 + TBool DoPauseBufferL(const RMmfIpcMessage& aMessage);
1.109 + TBool DoResumePlayingL(const RMmfIpcMessage& aMessage);
1.110 + TBool DoNotifyErrorL(const RMmfIpcMessage& aMessage);
1.111 + TBool DoCancelNotifyErrorL(const RMmfIpcMessage& aMessage);
1.112 +
1.113 +private:
1.114 + CA2dpBTHeadsetAudioInterface* iBTAudioInterface; // Not owned
1.115 + // Hmm - one handler per asynch call and then no need to store messages?
1.116 + CA2dpBTHeadsetIfEventHandler* iInitHandler; // AO to manage asynch calls to the interface
1.117 + CA2dpBTHeadsetIfEventHandler* iOpenDeviceHandler; // AO to manage asynch calls to the interface
1.118 + CA2dpBTHeadsetIfEventHandler* iCloseDeviceHandler; // AO to manage asynch calls to the interface
1.119 + CA2dpBTHeadsetIfEventHandler* iPlayDataHandler; // AO to manage asynch calls to the interface
1.120 + CA2dpBTHeadsetIfEventHandler* iNotifyErrorHandler; // AO to manage asynch calls to the interface
1.121 +
1.122 + RArray<TFourCC> iFourCCArray;
1.123 + RArray<TUint> iDiscreteArray;
1.124 + RArray<TRange> iRangeArray;
1.125 + RArray<TUint> iStereoSupportArray;
1.126 + };
1.127 +#endif