os/mm/mmhais/a3facl/src/buffersink/logicalbuffersink.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 /*
     2 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description:
    15 * Name        : logicalbuffersink.h
    16 * Part of     : ACL Logical Layer
    17 *
    18 */
    19 
    20 
    21 
    22 #ifndef LOGICALBUFFERSINK_H
    23 #define LOGICALBUFFERSINK_H
    24 
    25 #include <e32base.h>
    26 #include <f32file.h>
    27 #include <a3f/a3f_trace_utils.h>
    28 #include <a3f/mbuffersink.h>
    29 #include <a3f/maudiodataconsumer.h>
    30 
    31 #include "audioprocessingunit.h"
    32 
    33 #include <a3f/maudioprocessingunitobserver.h>
    34 
    35 
    36 class MLogicalSettingObserver;
    37 
    38 /**
    39 This is the implementation of CAudioSink API.
    40 
    41 @see CAudioComponent
    42 */
    43 NONSHARABLE_CLASS(CLogicalBufferSink) : public CAudioProcessingUnit,
    44 										public MMMFBufferSink,
    45 										public MMMFAudioDataConsumer
    46 	{
    47 friend class CAudioContext;
    48 friend class CLogicalAudioStream;
    49 
    50 public:
    51 
    52 	/**
    53 	Destructor.
    54 
    55 	Deletes all objects and releases all resource owned by this instance.
    56 	*/
    57 	virtual ~CLogicalBufferSink();
    58 
    59 	// from class MBufferSink
    60 	TInt SetDataConsumer(MMMFAudioDataConsumer& aConsumer);
    61 	TInt BufferEmptied(CMMFBuffer* aBuffer);
    62 	TInt BuffersDiscarded();
    63 
    64 	// from class CAudioProcessingUnit
    65 	virtual TBool IsTypeOf(TUid aTypeId) const;
    66 	virtual TAny* Interface(TUid aType);
    67 
    68 	// from MMMFAudioDataConsumer
    69 	void BufferToBeEmptied(MMMFBufferSink* aSink, CMMFBuffer* aBuffer);
    70 	void DiscardBuffers(MMMFBufferSink* aSink);
    71 	/**
    72 	Create a new instance.
    73 
    74 	@return CBufferSink* a pointer to the created instance.
    75 	*/
    76 	static CLogicalBufferSink* NewL(TAny* aParameters);
    77 
    78 private:
    79 
    80 	void ConstructL();
    81 
    82 	CLogicalBufferSink(TAny* aParameters);
    83 
    84 protected:
    85 	// The adaptation buffer sink
    86 	MMMFBufferSink* iAdaptationBufferSink;
    87 
    88 private:
    89 	// The client which requests data
    90 	MMMFAudioDataConsumer *iConsumer;
    91 
    92 	CMMFBuffer* iBuffer;
    93 	};
    94 
    95 #endif // LOGICALBUFFERSINK_H