1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/devsound/devsoundrefplugin/src/server/MmfDevSoundEventHandler.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,90 @@
1.4 +// Copyright (c) 2001-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 +
1.20 +#ifndef __MMFDEVSOUNDEVENTHANDLER_H
1.21 +#define __MMFDEVSOUNDEVENTHANDLER_H
1.22 +
1.23 +#include <e32base.h>
1.24 +#include <e32std.h>
1.25 +#include "MmfPolicyClientServer.h"
1.26 +
1.27 +class CMMFDevSoundSessionXtnd;
1.28 +
1.29 +class RMMFAudioPolicyProxy;
1.30 +
1.31 +
1.32 +class TMMFAudioPolicyEvent
1.33 + {
1.34 +public:
1.35 +
1.36 +/**
1.37 + Default constructor.
1.38 +
1.39 + Provided so this class can be packaged in a TPckgBuf<>.
1.40 + @since 7.0s
1.41 +*/
1.42 + TMMFAudioPolicyEvent() : iEventType(EMMFAudioPolicyNoEvent), iErrorCode(KErrNone) {};
1.43 +
1.44 + enum TAudioPolicyEventType
1.45 + {
1.46 + EMMFAudioPolicyNoEvent = 0,
1.47 + EMMFAudioPolicySwitchToIdle,
1.48 + EMMFAudioPolicyPriorityTooLow,
1.49 + EMMFAudioPolicyResourceNotification
1.50 + };
1.51 +
1.52 + TMMFAudioPolicyEvent(TAudioPolicyEventType aType, TInt aError, TMMFAudioPolicyState aState) :
1.53 + iEventType(aType), iErrorCode(aError), iState(aState) {};
1.54 +
1.55 + TAudioPolicyEventType iEventType;
1.56 + TInt iErrorCode;
1.57 + TMMFAudioPolicyState iState;
1.58 +
1.59 + };
1.60 +
1.61 +typedef TPckgBuf<TMMFAudioPolicyEvent> TMMFAudioPolicyEventPckg;
1.62 +
1.63 +class CMMFDevSoundEventHandler : public CActive
1.64 +/**
1.65 +*@internalTechnology
1.66 +*/
1.67 + {
1.68 +public:
1.69 + static CMMFDevSoundEventHandler* NewL(RMMFAudioPolicyProxy* aAudioPolicyProxy);
1.70 + ~CMMFDevSoundEventHandler();
1.71 + void ReceiveEvents();
1.72 + void CancelReceiveEvents();
1.73 + void RunL();
1.74 + TInt RunError(TInt aError);
1.75 + void DoCancel();
1.76 + void SetDevSoundInfo(CMMFDevSoundSessionXtnd* aDevSound);
1.77 +
1.78 +private:
1.79 + void ConstructL();
1.80 + CMMFDevSoundEventHandler(RMMFAudioPolicyProxy* aAudioPolicyProxy);
1.81 +private:
1.82 + enum {EGranularity=8};
1.83 + RMMFAudioPolicyProxy* iAudioPolicyProxy;
1.84 + TMMFAudioPolicyEventPckg iAudioPolicyEventPckg;
1.85 + TRequestStatus iRequestStatus;
1.86 + TInt iDevSoundId;
1.87 + CMMFDevSoundSessionXtnd* iDevSound;
1.88 + };
1.89 +
1.90 +
1.91 +
1.92 +
1.93 +#endif