1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/mmf/server/mmfclip.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -0,0 +1,187 @@
1.4 +// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +#ifndef __MMFCLIP_H_
1.20 +#define __MMFCLIP_H_
1.21 +
1.22 +#include <mmf/server/mmfdatasource.h>
1.23 +#include <mmf/server/mmfdatasink.h>
1.24 +#include <mmf/server/mmfbuffer.h>
1.25 +#include <mmf/common/mmfutilities.h>
1.26 +
1.27 +/**
1.28 +@publishedAll
1.29 +@released
1.30 +
1.31 +Abstract class to represent a source or sink that contains a multimedia clip (i.e. not a stream or hardware device).
1.32 +
1.33 +Typical examples are a file or an area of memory (descriptor).
1.34 +*/
1.35 +class CMMFClip : public CBase, public MDataSource, public MDataSink
1.36 + {
1.37 +public :
1.38 + //asynchronous Read/WriteBufferLs
1.39 +
1.40 + /**
1.41 + Reads aLength number of bytes of data from the offset, aPosition into the buffer, aBuffer.
1.42 + Intended for asynchronous usage.
1.43 +
1.44 + This is a virtual function that each derived class must implement.
1.45 +
1.46 + @param aLength
1.47 + The number of bytes to read.
1.48 + @param aBuffer
1.49 + The buffer to read the data into.
1.50 + @param aPosition
1.51 + The offset from which to start reading.
1.52 + @param aConsumer
1.53 + The sink of tha data read from the clip. Will be informed of read if not NULL.
1.54 + */
1.55 + virtual void ReadBufferL( TInt aLength, CMMFBuffer* aBuffer, TInt aPosition, MDataSink* aConsumer) = 0 ;
1.56 +
1.57 + /**
1.58 + Writes aLength number of bytes of data from the offset, aPosition from the buffer, aBuffer.
1.59 + Intended for asynchronous usage.
1.60 +
1.61 + This is a virtual function that each derived class must implement.
1.62 +
1.63 + @param aLength
1.64 + The number of bytes to write.
1.65 + @param aBuffer
1.66 + The buffer to write the data into.
1.67 + @param aPosition
1.68 + The offset from which to start writing.
1.69 + @param aSupplier
1.70 + The source of the data writen to the clip. Will be informed of write if not NULL.
1.71 + */
1.72 + virtual void WriteBufferL( TInt aLength, CMMFBuffer* aBuffer, TInt aPosition, MDataSource* aSupplier) = 0 ;
1.73 +
1.74 + /**
1.75 + Reads the maximum number of bytes of data from the offset, aPosition into the buffer, aBuffer.
1.76 + Intended for asynchronous usage.
1.77 +
1.78 + This is a virtual function that each derived class must implement.
1.79 +
1.80 + @param aBuffer
1.81 + The buffer to read the data into.
1.82 + @param aPosition
1.83 + The offset from which to start reading.
1.84 + @param aConsumer
1.85 + The sink of tha data read from the clip. Will be informed of read if not NULL.
1.86 + */
1.87 + virtual void ReadBufferL( CMMFBuffer* aBuffer, TInt aPosition, MDataSink* aConsumer) = 0 ;
1.88 +
1.89 + /**
1.90 + Writes the maximum number of bytes of data from the offset, aPosition from the buffer, aBuffer.
1.91 + Intended for asynchronous usage.
1.92 +
1.93 + This is a virtual function that each derived class must implement.
1.94 +
1.95 + @param aBuffer
1.96 + The buffer to write the data into.
1.97 + @param aPosition
1.98 + The offset from which to start writing.
1.99 + @param aSupplier
1.100 + The source of the data writen to the clip. Will be informed of write if not NULL.
1.101 + */
1.102 + virtual void WriteBufferL( CMMFBuffer* aBuffer, TInt aPosition, MDataSource* aSupplier) = 0 ;
1.103 +
1.104 + //synchronous Read/WriteBufferLs
1.105 +
1.106 + /**
1.107 + Reads the maximum number of bytes of data from the offset, aPosition into the buffer, aBuffer.
1.108 + Intended for synchronous usage.
1.109 +
1.110 + This is a virtual function that each derived class must implement.
1.111 +
1.112 + @param aBuffer
1.113 + The buffer to read the data into.
1.114 + @param aPosition
1.115 + The offset from which to start reading.
1.116 + */
1.117 + virtual void ReadBufferL( CMMFBuffer* aBuffer, TInt aPosition) = 0 ;
1.118 +
1.119 + /**
1.120 + Writes the maximum number of bytes of data from the offset, aPosition from the buffer, aBuffer.
1.121 + Intended for synchronous usage.
1.122 +
1.123 + This is a virtual function that each derived class must implement.
1.124 +
1.125 + @param aBuffer
1.126 + The buffer to write the data into.
1.127 + @param aPosition
1.128 + The offset from which to start writing.
1.129 + */
1.130 + virtual void WriteBufferL( CMMFBuffer* aBuffer, TInt aPosition) = 0 ;
1.131 +
1.132 + /**
1.133 + Returns the amount of space available for the clip.
1.134 +
1.135 + This is a virtual function that each derived class must implement.
1.136 +
1.137 + @return The amount of space available.
1.138 + */
1.139 + virtual TInt64 BytesFree() = 0 ;
1.140 +
1.141 + /**
1.142 + Returns the size of the clip in bytes.
1.143 +
1.144 + This is a virtual function that each derived class must implement.
1.145 +
1.146 + @return The size of the clip.
1.147 + */
1.148 + virtual TInt Size() = 0 ;
1.149 +
1.150 + /**
1.151 + Deletes the clip.
1.152 +
1.153 + This should be overriden in the derived classes, the default version returns KErrNotSupported.
1.154 +
1.155 + @return An error code indicating if the function call was successful. KErrNone on success, otherwise
1.156 + another of the system-wide error codes.
1.157 + */
1.158 + virtual TInt Delete() {return KErrNotSupported;}
1.159 +
1.160 + /**
1.161 + Sets the size of the clip. This should be overriden in the derived
1.162 + classes, the default version returns KErrNotSupported.
1.163 +
1.164 + @param aSize
1.165 + The size of the clip.
1.166 +
1.167 + @return An error code indicating if the function call was successful. KErrNone on success, otherwise
1.168 + another of the system-wide error codes.
1.169 + */
1.170 + inline virtual TInt SetSize(TInt aSize);
1.171 +
1.172 +protected :
1.173 + /**
1.174 + Protected constructor.
1.175 +
1.176 + @param aSourceType
1.177 + The source type.
1.178 + @param aSinkType
1.179 + The sink type.
1.180 + */
1.181 + CMMFClip( TUid aSourceType, TUid aSinkType ) : MDataSource( aSourceType ), MDataSink( aSinkType ) {}
1.182 + } ;
1.183 +
1.184 +inline TInt CMMFClip::SetSize(TInt /*aSize*/)
1.185 +{
1.186 + return KErrNotSupported;
1.187 +}
1.188 +
1.189 +
1.190 +#endif