diff -r 000000000000 -r 79dd3e2336a0 mmhais/refacladapt/src/audiosource/buffersource.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmhais/refacladapt/src/audiosource/buffersource.h Fri Oct 08 19:40:43 2010 +0100 @@ -0,0 +1,84 @@ +/* +* Copyright (c) 2007-2008 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 BUFFERSOURCE_H +#define BUFFERSOURCE_H + +#include +#include +#include + +#include "moutputport.h" +#include "mstreambuffercontrol.h" + +#include + + +///// + // This is the implementation of CAudioSource API. + // + // @see CAudioComponent. + /// +NONSHARABLE_CLASS(CBufferSource) : public CActive, + public MMMFBufferSource, // A3F interface + public MOutputPort // Adaptation interface + + { +public: + + IMPORT_C static CBufferSource* NewL(); + ///// + // Destructor. + // + // Deletes all objects and releases all resource owned by this instance. + /// + virtual ~CBufferSource(); + + // from MMMFBufferSource + TInt SetDataSupplier(MMMFAudioDataSupplier& aSupplier); + TInt BufferFilled(CMMFBuffer* aBuffer); + TInt BuffersDiscarded(); + + // from class MOutputPort + TInt GetOutputPort(MOutputPort*& aOutputPort); + TInt FillBuffer(CMMFBuffer* aBuffer, MInputPort* aConsumer); + TInt BufferEmptied(CMMFBuffer* aBuffer); + TInt SetInput(MInputPort* aInput); + TInt RemoveInput(MInputPort* aInput); + TInt FlushBuffer(MFlushHandlerObserver* aFlushObserver); +private: + + void ConstructL(); + + CBufferSource(); + + void DoCancel(); + + void RunL(); + +private: + MFlushHandlerObserver* iObserver; + + MMMFAudioDataSupplier* iSupplier; + + MInputPort* iInput; + + CMMFBuffer* iBuffer; + }; + +#endif // BUFFERSOURCE_H