1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/devsound/a3fdevsound/src/devsoundadaptor/cdevcommoncontrol.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,88 @@
1.4 +/*
1.5 +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +*
1.19 +*/
1.20 +
1.21 +#ifndef CDEVCOMMONCONTROL_H
1.22 +#define CDEVCOMMONCONTROL_H
1.23 +
1.24 +#include "cdevaudiocontrol.h"
1.25 +#include <a3f/a3f_trace_utils.h>
1.26 +#include <a3f/maudioprocessingunitobserver.h>
1.27 +
1.28 +/**
1.29 + * CDevCommonControl
1.30 + *
1.31 + * Common functionality required by:
1.32 + * CDevPlayControl
1.33 + * CDevRecordControl
1.34 + * CDevToneControl
1.35 + *
1.36 + * @lib mmfdevsoundadaptation.lib
1.37 + * @since
1.38 + */
1.39 +
1.40 +NONSHARABLE_CLASS(CDevCommonControl) : public CDevAudioControl,
1.41 + public MAudioProcessingUnitObserver
1.42 + {
1.43 +public:
1.44 + CDevCommonControl();
1.45 + ~CDevCommonControl();
1.46 +
1.47 + // from CDevAudioControl
1.48 + TInt Stop();
1.49 + TInt Pause();
1.50 + TInt Resume();
1.51 +
1.52 + // from MAudioProcessingUnitObserver
1.53 + void StateEvent(MAudioStream& aStream, TInt aError, TAudioState aNewState);
1.54 + void ProcessingUnitError(MAudioProcessingUnit* aInstance, TInt aError);
1.55 +
1.56 + // from MAudioContextObserver
1.57 + void ContextEvent(TUid aEvent, TInt aError);
1.58 +
1.59 +protected:
1.60 + // methods introduced by this class
1.61 + virtual void FinishWithError(TInt aError) = 0;
1.62 +
1.63 +private:
1.64 + // Internal functions which together implement CDevCommonControl::ContextEvent
1.65 + void ContextEventUpdateWithoutStateEventNoError();
1.66 + void ContextEventUpdateWithoutStateEventButWithError(TInt aError);
1.67 + void ContextEventUpdateWithStateEventNoError();
1.68 + void ContextEventStateDevSoundAdaptorLoading();
1.69 + void ContextEventStateDevSoundAdaptorUnloading();
1.70 + void ContextEventStateDevSoundAdaptorStopping();
1.71 + void ContextEventStateDevSoundAdaptorUninitializing();
1.72 + void ContextEventStateDevSoundAdaptorBeingPreempted();
1.73 + void ContextEventPauseResumeSequenceDueToEmptyBuffers(TBool aFlush);
1.74 + void ContextEventUpdateWithStateEventAndError(TInt aError);
1.75 + void ContextEventUpdateComplete(TInt aError);
1.76 + void ContextEventPreEmption(TUid aEvent, TInt aError);
1.77 + void ContextEventAbort(TInt aError);
1.78 + void ContextEventErrorStateDevSoundAdaptorActivating(TInt aError);
1.79 + void ContextEventErrorStateDevSoundAdaptorBeingPreempted();
1.80 + void ContextEventAsynchronousPlayCompletion(TInt aError);
1.81 + void ContextEventAsynchronousInitializeComplete(TInt aError);
1.82 + void ContextEventStopDevSoundNotifications();
1.83 +
1.84 +private:
1.85 + TBool iBeingPreempted;
1.86 + TBool iPreemptionClash;
1.87 + };
1.88 +
1.89 +#endif // CDEVCOMMONCONTROL_H
1.90 +
1.91 +// end of file