diff -r 000000000000 -r b8ed18f6c07b devsound/a3fdevsound/src/devsoundadaptor/cdevcommoncontrol.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/devsound/a3fdevsound/src/devsoundadaptor/cdevcommoncontrol.h Thu Oct 07 22:34:12 2010 +0100 @@ -0,0 +1,88 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef CDEVCOMMONCONTROL_H +#define CDEVCOMMONCONTROL_H + +#include "cdevaudiocontrol.h" +#include +#include + +/** + * CDevCommonControl + * + * Common functionality required by: + * CDevPlayControl + * CDevRecordControl + * CDevToneControl + * + * @lib mmfdevsoundadaptation.lib + * @since + */ + +NONSHARABLE_CLASS(CDevCommonControl) : public CDevAudioControl, + public MAudioProcessingUnitObserver + { +public: + CDevCommonControl(); + ~CDevCommonControl(); + + // from CDevAudioControl + TInt Stop(); + TInt Pause(); + TInt Resume(); + + // from MAudioProcessingUnitObserver + void StateEvent(MAudioStream& aStream, TInt aError, TAudioState aNewState); + void ProcessingUnitError(MAudioProcessingUnit* aInstance, TInt aError); + + // from MAudioContextObserver + void ContextEvent(TUid aEvent, TInt aError); + +protected: + // methods introduced by this class + virtual void FinishWithError(TInt aError) = 0; + +private: + // Internal functions which together implement CDevCommonControl::ContextEvent + void ContextEventUpdateWithoutStateEventNoError(); + void ContextEventUpdateWithoutStateEventButWithError(TInt aError); + void ContextEventUpdateWithStateEventNoError(); + void ContextEventStateDevSoundAdaptorLoading(); + void ContextEventStateDevSoundAdaptorUnloading(); + void ContextEventStateDevSoundAdaptorStopping(); + void ContextEventStateDevSoundAdaptorUninitializing(); + void ContextEventStateDevSoundAdaptorBeingPreempted(); + void ContextEventPauseResumeSequenceDueToEmptyBuffers(TBool aFlush); + void ContextEventUpdateWithStateEventAndError(TInt aError); + void ContextEventUpdateComplete(TInt aError); + void ContextEventPreEmption(TUid aEvent, TInt aError); + void ContextEventAbort(TInt aError); + void ContextEventErrorStateDevSoundAdaptorActivating(TInt aError); + void ContextEventErrorStateDevSoundAdaptorBeingPreempted(); + void ContextEventAsynchronousPlayCompletion(TInt aError); + void ContextEventAsynchronousInitializeComplete(TInt aError); + void ContextEventStopDevSoundNotifications(); + +private: + TBool iBeingPreempted; + TBool iPreemptionClash; + }; + +#endif // CDEVCOMMONCONTROL_H + +// end of file