devsound/a3facf/inc/mbuffersource.h
changeset 0 40261b775718
equal deleted inserted replaced
-1:000000000000 0:40261b775718
       
     1 /*
       
     2 * Copyright (c) 2006-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 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 /**
       
    22  @file
       
    23  @publishedPartner 
       
    24  @released
       
    25 */
       
    26 
       
    27 #ifndef MBUFFERSOURCE_H
       
    28 #define MBUFFERSOURCE_H
       
    29 
       
    30 #include <a3f/a3fbase.h>
       
    31 #include <a3f/maudiodatasupplier.h>
       
    32 
       
    33 class CMMFBuffer;
       
    34 
       
    35 /**
       
    36  * Buffer source is used for providing audio data from outside the audio process.
       
    37  *
       
    38  * The type of the actual 'physical' source can be for example a file or a socket or the
       
    39  * data could also be generated. Nevertheless, the client (the MAudioDataSupplier) is responsible
       
    40  * for reading the data and providing it to the audio process by filling the buffers received
       
    41  * as a parameter with the callbacks in the MAudioDataSupplier interface.
       
    42  */
       
    43 class MMMFBufferSource
       
    44 	{
       
    45 	public:
       
    46 	/**
       
    47 	 * Initializes the source for using aSupplier as a data supplier.
       
    48 	 * 
       
    49 	 * The source must be initialized before it is attached to a stream.
       
    50 	 *
       
    51 	 * @param aSupplier a reference to the data supplier which will provide the audio data by
       
    52 	 * filling the buffers received with the callbacks.
       
    53 	 * @return an error code. KErrNone if successful, otherwise one of the system wide error codes.
       
    54 	 */
       
    55 	virtual TInt SetDataSupplier(MMMFAudioDataSupplier& aSupplier)=0;
       
    56 
       
    57 	/**
       
    58 	 * Indicates that a buffer received from this buffer source has
       
    59 	 * been filled with audio data.
       
    60 	 *
       
    61 	 * @param aBuffer the buffer that has been filled.
       
    62 	 * @return an error code. KErrNone if successful, otherwise one of the system wide error codes.
       
    63 	 */
       
    64 	virtual TInt BufferFilled(CMMFBuffer* aBuffer)=0;
       
    65 
       
    66 	/**
       
    67 	 * Acknowledges the call to MMMFAudioDataSupplier::DiscardBuffers().
       
    68 	 *
       
    69 	 * A DiscardBuffers() callback will be issued to MMMFAudioDataSupplier to request that any requested buffers have been discarded.
       
    70 	 * This call acknowledges that the data supplier has stopped using the buffers, and returns their control to the framework proper
       
    71 	 * 
       
    72 	 * @return an error code. KErrNone on success, otherwise one of the system wide error codes.
       
    73 	 */
       
    74 	virtual TInt BuffersDiscarded()=0;
       
    75 
       
    76 	};
       
    77 
       
    78 #endif // MBUFFERSOURCE_H