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