os/mm/devsound/sounddevbt/src/A2dpBlueTooth/server/A2dpBTHeadsetAudioIfServer.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200 (2012-06-15)
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
#ifndef __A2DPBTHEADSETAUDIOIFSERVER_H__
sl@0
    17
#define __A2DPBTHEADSETAUDIOIFSERVER_H__
sl@0
    18
sl@0
    19
#include <e32base.h>
sl@0
    20
#include <mmf/common/mmfipc.h>
sl@0
    21
#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
sl@0
    22
#include <mmf/common/mmfipcserver.h>
sl@0
    23
#endif
sl@0
    24
#include "A2dpBTHeadsetAudioIfClientServer.h"
sl@0
    25
sl@0
    26
class CA2dpBTHeadsetAudioInterface; // fwd declaration
sl@0
    27
class TFourCC;
sl@0
    28
class TRange;
sl@0
    29
sl@0
    30
/**
sl@0
    31
 *	CA2dpBTHeadsetAudioIfServer definition
sl@0
    32
 */
sl@0
    33
class CA2dpBTHeadsetAudioIfServer : public CMmfIpcServer
sl@0
    34
	{
sl@0
    35
public:
sl@0
    36
	IMPORT_C static TInt StartThread(TAny* aParms);	// thread entry point
sl@0
    37
	
sl@0
    38
	static CA2dpBTHeadsetAudioIfServer* NewL();
sl@0
    39
	~CA2dpBTHeadsetAudioIfServer();
sl@0
    40
	CMmfIpcSession* NewSessionL(const TVersion &aVersion) const;
sl@0
    41
private:
sl@0
    42
	CA2dpBTHeadsetAudioIfServer();
sl@0
    43
	void ConstructL();
sl@0
    44
private:
sl@0
    45
	CA2dpBTHeadsetAudioInterface* iBTAudioInterface;
sl@0
    46
	};
sl@0
    47
sl@0
    48
/**
sl@0
    49
 *	CA2dpBTHeadsetIfEventHandler
sl@0
    50
 */
sl@0
    51
class CA2dpBTHeadsetIfEventHandler : public CActive
sl@0
    52
	{
sl@0
    53
public:
sl@0
    54
	static CA2dpBTHeadsetIfEventHandler* NewL();
sl@0
    55
	~CA2dpBTHeadsetIfEventHandler();
sl@0
    56
	void StartL(const RMmfIpcMessage& aMessage);
sl@0
    57
	void Stop();
sl@0
    58
private:
sl@0
    59
	CA2dpBTHeadsetIfEventHandler();
sl@0
    60
	void RunL();
sl@0
    61
	void DoCancel();
sl@0
    62
	void ConstructL();
sl@0
    63
private:
sl@0
    64
	RMmfIpcMessage* iMessage;	
sl@0
    65
	};
sl@0
    66
	
sl@0
    67
/**
sl@0
    68
 *	CA2dpBTHeadsetAudioIfSession definition
sl@0
    69
 */
sl@0
    70
class CA2dpBTHeadsetAudioIfSession : public CMmfIpcSession
sl@0
    71
	{
sl@0
    72
public:
sl@0
    73
	static CA2dpBTHeadsetAudioIfSession* NewL(CA2dpBTHeadsetAudioInterface* aBTAudioInterface);
sl@0
    74
 	~CA2dpBTHeadsetAudioIfSession();
sl@0
    75
	void ServiceL(const RMessage2& aMessage);
sl@0
    76
	
sl@0
    77
private:
sl@0
    78
	CA2dpBTHeadsetAudioIfSession(CA2dpBTHeadsetAudioInterface* aBTAudioInterface);
sl@0
    79
	void ConstructL();
sl@0
    80
	
sl@0
    81
	TBool DoInitializeL(const RMmfIpcMessage& aMessage);
sl@0
    82
	TBool DoCancelInitializeL(const RMmfIpcMessage& aMessage);
sl@0
    83
	TBool DoCopyFourCCArrayDataL(const RMmfIpcMessage& aMessage);
sl@0
    84
	TBool DoCopyUintArrayDataL(const RMmfIpcMessage& aMessage, RArray<TUint> aArray);
sl@0
    85
	TBool DoCopyChannelsArrayDataL(const RMmfIpcMessage& aMessage);
sl@0
    86
	TInt  DoGetSupportedDataTypesL(const RMmfIpcMessage& aMessage);// returns error value
sl@0
    87
	TInt  DoGetSupportedSampleRatesL(const RMmfIpcMessage& aMessage);
sl@0
    88
	TBool DoGetSupportedSampleRatesDiscreteL(const RMmfIpcMessage& aMessage);
sl@0
    89
	TBool DoGetSupportedSampleRatesRangeL(const RMmfIpcMessage& aMessage);
sl@0
    90
	TInt  DoGetSupportedChannelsL(const RMmfIpcMessage& aMessage);
sl@0
    91
	TBool DoGetStereoSupportL(const RMmfIpcMessage& aMessage);
sl@0
    92
	TInt DoSetDataTypeL(const RMmfIpcMessage& aMessage);	// returns error value
sl@0
    93
	TInt DoSetSampleRateL(const RMmfIpcMessage& aMessage);// returns error value
sl@0
    94
	TInt DoSetChannelsL(const RMmfIpcMessage& aMessage);// returns error value
sl@0
    95
	TBool DoOpenDeviceL(const RMmfIpcMessage& aMessage);
sl@0
    96
	TBool DoCancelOpenDevice(const RMmfIpcMessage& aMessage);
sl@0
    97
	TBool DoCloseDeviceL(const RMmfIpcMessage& aMessage);
sl@0
    98
	TBool DoVolumeL(const RMmfIpcMessage& aMessage);
sl@0
    99
	TInt DoSetVolumeL(const RMmfIpcMessage& aMessage);// returns error value
sl@0
   100
	TBool DoPlayDataL(const RMmfIpcMessage& aMessage);
sl@0
   101
	TBool DoCancelPlayDataL(const RMmfIpcMessage& aMessage);
sl@0
   102
	TBool DoFlushBufferL(const RMmfIpcMessage& aMessage);
sl@0
   103
	TBool DoBytesPlayedL(const RMmfIpcMessage& aMessage);
sl@0
   104
	TBool DoResetBytesPlayedL(const RMmfIpcMessage& aMessage);
sl@0
   105
	TBool DoPauseBufferL(const RMmfIpcMessage& aMessage);
sl@0
   106
	TBool DoResumePlayingL(const RMmfIpcMessage& aMessage);
sl@0
   107
	TBool DoNotifyErrorL(const RMmfIpcMessage& aMessage);
sl@0
   108
	TBool DoCancelNotifyErrorL(const RMmfIpcMessage& aMessage);
sl@0
   109
sl@0
   110
private:
sl@0
   111
	CA2dpBTHeadsetAudioInterface* iBTAudioInterface;	// Not owned
sl@0
   112
	// Hmm - one handler per asynch call and then no need to store messages?
sl@0
   113
	CA2dpBTHeadsetIfEventHandler* iInitHandler;	// AO to manage asynch calls to the interface
sl@0
   114
	CA2dpBTHeadsetIfEventHandler* iOpenDeviceHandler;	// AO to manage asynch calls to the interface
sl@0
   115
	CA2dpBTHeadsetIfEventHandler* iCloseDeviceHandler;	// AO to manage asynch calls to the interface
sl@0
   116
	CA2dpBTHeadsetIfEventHandler* iPlayDataHandler;	// AO to manage asynch calls to the interface
sl@0
   117
	CA2dpBTHeadsetIfEventHandler* iNotifyErrorHandler;	// AO to manage asynch calls to the interface
sl@0
   118
	
sl@0
   119
	RArray<TFourCC> iFourCCArray;
sl@0
   120
	RArray<TUint> iDiscreteArray;
sl@0
   121
	RArray<TRange> iRangeArray;
sl@0
   122
	RArray<TUint> iStereoSupportArray;
sl@0
   123
	};
sl@0
   124
#endif