mmfenh/enhancedaudioplayerutility/AudioStreaming/AudioClientStreamSource/inc/S60AudioClientStreamSource.h
changeset 0 71ca22bcf22a
equal deleted inserted replaced
-1:000000000000 0:71ca22bcf22a
       
     1 /*
       
     2 * Copyright (c) 2005 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:  Definition of the S60 Audio Client Stream Source
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __CS60AUDIOSTREAMSOURCE_H__
       
    19 #define __CS60AUDIOSTREAMSOURCE_H__
       
    20 
       
    21 #include <e32std.h>
       
    22 #include <e32base.h>
       
    23 #include "MS60AudioStreamSourceObserver.h"
       
    24 #include <mmfbase.h>
       
    25 #include "S60AudioSource.h"
       
    26 #include "S60ClientAudioBuffer.h"
       
    27 
       
    28 //FORWARD DECLARATION
       
    29 class CS60SourceEventDispatcher;
       
    30 class CWriteRequest;
       
    31 
       
    32 /**
       
    33 *  This class defines the S60 audio stream source functions.
       
    34 *
       
    35 *  @lib S60AudioStreamSource.lib
       
    36 *  @since 3.1
       
    37 */
       
    38 class CS60AudioStreamSource: public CS60AudioBaseSource
       
    39 	{
       
    40 
       
    41 	public: // Constructors and destructor
       
    42 
       
    43 	    /**
       
    44         * Factory function for creating the Stream Source object.
       
    45         * @since 3.1
       
    46         * @return pointer to CS60AudioStreamSource object
       
    47         */
       
    48 		IMPORT_C static CS60AudioStreamSource* NewL( MS60AudioStreamSourceObserver& aObserver,
       
    49 													 const TDesC8& aMimeType);
       
    50 
       
    51 		/**
       
    52         *	Destructor
       
    53         */
       
    54 		virtual ~CS60AudioStreamSource();
       
    55 
       
    56     public: // New functions
       
    57 
       
    58 		/**
       
    59         * Write the specified buffer to source
       
    60         * @param aBuffer Buffer to be processed.
       
    61         * @since 3.1
       
    62         * @return One of the Standard Return Error Codes
       
    63         */
       
    64 		IMPORT_C virtual TInt WriteAudioData(CClientAudioBuffer& aBuffer);
       
    65 
       
    66 		/**
       
    67         * Sets the Size of the Source
       
    68         * @param aSize size to be set.
       
    69         * @return One of the Standard Return Error Codes
       
    70         * @since 3.1
       
    71         */
       
    72 		IMPORT_C virtual TInt SetSize(TUint aSize);
       
    73 
       
    74 		/**
       
    75         * Get the minimum size of buffer that can be processed.
       
    76         * @return One of the Standard Return Error Codes
       
    77         * @since 3.1
       
    78         */
       
    79 		IMPORT_C virtual TInt GetMinimumBufferSize();
       
    80 
       
    81 		/**
       
    82         * Gets the Size of the Source
       
    83         * @return The Size of the Source
       
    84         * @since 3.1
       
    85         */
       
    86 		IMPORT_C virtual TUint GetSize();
       
    87 
       
    88 
       
    89 		/**
       
    90         * Gets the Mimetype of the Source
       
    91         * @param aMimeType mimetype of the Source.
       
    92         * @since 3.1
       
    93         */
       
    94 		IMPORT_C virtual void GetMimeType(TDes8& aMimeType);
       
    95 
       
    96 		/**
       
    97         * Gets the Position in the Source
       
    98         * @return The Position in the Source
       
    99         * @since 3.1
       
   100         */
       
   101 		IMPORT_C virtual TInt64 GetPosition();
       
   102 
       
   103 		/**
       
   104         * Sets the Position in the Source
       
   105         * @param aPosition position to be set in the Source.
       
   106         * @return One of the Standard Return Error Codes
       
   107         * @since 3.1
       
   108         */
       
   109 		IMPORT_C virtual TInt SetPosition(TInt64 aPosition);
       
   110 
       
   111 	private:
       
   112 
       
   113 		/**
       
   114         * Gets the RandomSeek Capability from the Source
       
   115         * @return ETrue/EFalse depending on the Support capability
       
   116         * @since 3.1
       
   117         */
       
   118 		virtual TBool IsRandomSeekingSupported();
       
   119 
       
   120 		/**
       
   121         * Gets the Seeking Capability from the Source
       
   122         * @return ETrue/EFalse depending on the Support capability
       
   123         * @since 3.1
       
   124         */
       
   125 		virtual TBool IsSeekingSupported();
       
   126 
       
   127 
       
   128 	private:
       
   129 
       
   130 		/**
       
   131 		* Private C++ constructor for this class.
       
   132         * @since 3.1
       
   133         * @return -
       
   134         */
       
   135 		CS60AudioStreamSource();
       
   136 
       
   137 		void ConstructL(MS60AudioStreamSourceObserver& aObserver, const TDesC8& aMimeType );
       
   138 
       
   139 	private:
       
   140 
       
   141 		void FindControllersL();
       
   142 
       
   143 		TBool GetFreeRequestSlot(TInt& index);
       
   144 
       
   145 	private: // Data
       
   146 
       
   147 		// Array to hold list of controllers suitable to handle the requested format
       
   148 		RMMFControllerImplInfoArray iControllers;
       
   149 		HBufC8* iMimeType;
       
   150 		TInt64 iPosition;
       
   151 		CS60SourceEventDispatcher* iDispatcher;
       
   152 		RPointerArray<CWriteRequest> iWriteRequests;
       
   153 		TUint iSize;
       
   154 
       
   155 	};
       
   156 
       
   157 #endif // __CS60AUDIOSTREAMSOURCE_H__
       
   158 
       
   159 //  End of File