devsound/devsoundrefplugin/src/platsec/SoundDevice/MmfDevSoundCallbackHandler.h
changeset 0 40261b775718
equal deleted inserted replaced
-1:000000000000 0:40261b775718
       
     1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 
       
    17 #ifndef __MMFDEVSOUNDCALLBACKHANDLER_H
       
    18 #define __MMFDEVSOUNDCALLBACKHANDLER_H
       
    19 
       
    20 #include <e32base.h>
       
    21 #include <e32std.h>
       
    22 #include <mmf/common/mmfcontrollerframeworkbase.h>
       
    23 #include <mmf/server/sounddevice.h>
       
    24 #include "MmfDevSoundProxy.h"
       
    25 
       
    26 #include <e32msgqueue.h>
       
    27 	
       
    28 /*
       
    29  *
       
    30  *	Class Name:	CMsgQueueHandler
       
    31  *
       
    32  *	AO that manages the message queue
       
    33  *  @internalComponent
       
    34  *
       
    35  */
       
    36 class CMsgQueueHandler : public CActive
       
    37 	{
       
    38 public:
       
    39 	static CMsgQueueHandler* NewL(RMMFDevSoundProxy* aDevSoundProxy,
       
    40 								  MDevSoundObserver& aDevSoundObserver,
       
    41 								  RMsgQueue<TMMFDevSoundQueueItem>* aMsgQueue,
       
    42 								  MMMFDevSoundCustomInterfaceObserver& aDevSoundIntfcObserver);
       
    43 	void SetObserver(MDevSoundObserver& aDevSoundObserver);
       
    44 	~CMsgQueueHandler();
       
    45 	void ReceiveEvents();
       
    46 	void RunL();
       
    47 	TInt RunError(TInt aError);
       
    48 	void DoCancel();
       
    49 private:
       
    50 	CMsgQueueHandler(RMMFDevSoundProxy* aDevSoundProxy,
       
    51 					 MDevSoundObserver& aDevSoundObserver,
       
    52 					 RMsgQueue<TMMFDevSoundQueueItem>* aMsgQueue,
       
    53 					 MMMFDevSoundCustomInterfaceObserver& aDevSoundIntfcObserver);
       
    54 	void ConstructL();
       
    55 	
       
    56 	void ReceiveAllEvents();
       
    57 	
       
    58 	void DoInitComplete();
       
    59 	void DoPlayErrorComplete();
       
    60 	void DoRecordErrorComplete();
       
    61 	void DoBTBFCompleteL();
       
    62 	void DoBTBECompleteL();
       
    63 	void DoToneFinishedComplete();
       
    64 	void DoSendEventToClientComplete();
       
    65 	
       
    66 private:
       
    67 	RMMFDevSoundProxy* iDevSoundProxy;
       
    68 	MDevSoundObserver* iDevSoundObserver;
       
    69 	TMMFDevSoundProxyHwBufPckg iSetPckg;
       
    70 	
       
    71 	TMMFEventPckg iEventPckg;
       
    72 
       
    73 	RMsgQueue<TMMFDevSoundQueueItem>* iMsgQueue;
       
    74 	TMMFDevSoundQueueItem	iCurrentItem;
       
    75 	TMMFDevSoundProxyRequest iCurrentRequest;
       
    76 	
       
    77 	CMMFDataBuffer* iBuffer;	// buffer to be emptied
       
    78 	MMMFDevSoundCustomInterfaceObserver& iDevSoundIntfcObserver;
       
    79 	};
       
    80 
       
    81 #endif