os/mm/devsound/sounddevbt/src/server/MmfBtDevSoundEventHandler.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     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 __MMFBTDEVSOUNDEVENTHANDLER_H
    18 #define __MMFBTDEVSOUNDEVENTHANDLER_H
    19 
    20 #include <e32base.h>
    21 #include <e32std.h>
    22 #include "MmfBtPolicyClientServer.h"
    23 
    24 class CMMFDevSoundSessionXtnd;
    25 
    26 class RMMFAudioPolicyProxy;
    27 
    28 
    29 class TMMFAudioPolicyEvent
    30 	{
    31 public:
    32 /**
    33 	Constructor.
    34 
    35 	@internalTechnology
    36 
    37 	@param "aEventType"	"A code to define the type of event."
    38 	@param "aErrorCode"	"The error code associated with the event."
    39 	@since 7.0s
    40 */
    41 //	TMMFAudioPolicyEvent(TAudioPolicyEventType aEventType, TInt aErrorCode) : iEventType(aEventType), iErrorCode(aErrorCode) {};
    42 
    43 /**
    44 	Default constructor.
    45 
    46 	Provided so this class can be packaged in a TPckgBuf<>.
    47 	@since 7.0s
    48 */
    49 	TMMFAudioPolicyEvent() : iEventType(EMMFAudioPolicyNoEvent), iErrorCode(KErrNone) {};
    50 
    51 	enum TAudioPolicyEventType
    52 		{
    53 		EMMFAudioPolicyNoEvent = 0,
    54 		EMMFAudioPolicySwitchToIdle,
    55 		EMMFAudioPolicyPriorityTooLow,
    56 		EMMFAudioPolicyResourceNotification
    57 		};
    58 
    59 	TAudioPolicyEventType iEventType;
    60 	TInt iErrorCode;
    61 	TMMFAudioPolicyState iState;				
    62 
    63 	};
    64 
    65 typedef TPckgBuf<TMMFAudioPolicyEvent> TMMFAudioPolicyEventPckg;
    66 
    67 class CMMFDevSoundEventHandler : public CActive
    68 /**
    69 *@internalTechnology
    70 */
    71 	{
    72 public:
    73 	static CMMFDevSoundEventHandler* NewL(RMMFAudioPolicyProxy* aAudioPolicyProxy);
    74 	~CMMFDevSoundEventHandler();
    75 	void ReceiveEvents();
    76 	void CancelReceiveEvents();
    77 	void RunL();
    78 	TInt RunError(TInt aError);
    79 	void DoCancel();
    80 	void SetDevSoundInfo(CMMFDevSoundSessionXtnd* aDevSound);
    81 
    82 private:
    83 	void ConstructL();
    84 	CMMFDevSoundEventHandler(RMMFAudioPolicyProxy* aAudioPolicyProxy);
    85 private:
    86 	enum {EGranularity=8};
    87 	RMMFAudioPolicyProxy*  iAudioPolicyProxy;
    88 	TMMFAudioPolicyEventPckg	iAudioPolicyEventPckg;
    89 	TRequestStatus	iRequestStatus;
    90 	TInt			iDevSoundId;
    91 	CMMFDevSoundSessionXtnd*	iDevSound;
    92 	};
    93 
    94 
    95 
    96 
    97 #endif