os/mm/mmlibs/mmfw/inc/Mda/Common/Resource.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/mmlibs/mmfw/inc/Mda/Common/Resource.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,252 @@
     1.4 +// Copyright (c) 1997-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 "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.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 +// Mda\Common\Resource.h
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +#ifndef __MDA_COMMON_RESOURCE_H__
    1.22 +#define __MDA_COMMON_RESOURCE_H__
    1.23 +
    1.24 +// Standard EPOC32 includes
    1.25 +#include <e32base.h>
    1.26 +
    1.27 +// Public Media Server includes
    1.28 +#include <mda/common/base.h>
    1.29 +#include <mda/common/port.h>
    1.30 +#include <mda/common/controller.h>
    1.31 +#include <mda/common/resource.hrh>
    1.32 +
    1.33 +// Uids
    1.34 +MDA_UID(KUidMdaClipLocation) // Resource Clip Location/Format type Uids
    1.35 +MDA_UID(KUidMdaClipFormat) 
    1.36 +MDA_UID(KUidMdaStreamDevice) // Resource Stream Device Uid
    1.37 +MDA_UID(KUidMdaFileResLoc) // Clip Location Uids
    1.38 +MDA_UID(KUidMdaDesResLoc) 
    1.39 +MDA_UID(KUidMdaUrlResLoc) 
    1.40 +
    1.41 +/**
    1.42 +@publishedAll
    1.43 +@deprecated
    1.44 +*/
    1.45 +const TInt KMdaRepeatForever = -2;
    1.46 +
    1.47 +/**
    1.48 +@publishedAll
    1.49 +@deprecated
    1.50 +
    1.51 +Abstract base class for providing the location of audio clip data.
    1.52 +
    1.53 +The location could be a filename or the address of a descriptor. An object of the derived class 
    1.54 +is passed as a parameter to CMdaAudioRecorderUtility::OpenL() (to record a clip) or 
    1.55 +CMdaAudioConvertUtility::OpenL() (to convert a clip to another format). This class could be
    1.56 +derived from to create new types of clip location.
    1.57 +
    1.58 +@see TMdaFileClipLocation
    1.59 +@see TMdaDesClipLocation
    1.60 +*/
    1.61 +class TMdaClipLocation : public TMdaPackage
    1.62 +	{
    1.63 +protected:
    1.64 +	inline TMdaClipLocation(TUid aUid, TInt aDerivedSize);
    1.65 +public:
    1.66 +
    1.67 +	/**
    1.68 +	The size of the whole audio clip in bytes.
    1.69 +	*/
    1.70 +	TInt iSize; // In bytes
    1.71 +
    1.72 +	/**
    1.73 +	The size of the part of the clip in bytes currently accessible. For example, a clip whose
    1.74 +	location is a URL might be larger than the amount currently available to the client.
    1.75 +	*/
    1.76 +	TInt iVisible; // In bytes
    1.77 +	};
    1.78 +
    1.79 +/**
    1.80 +@publishedAll
    1.81 +@deprecated
    1.82 +
    1.83 +The base class for audio clip sound formats.
    1.84 +
    1.85 +This class is a package designed to wrap up the UID (and possibly other data) of an audio clip format.
    1.86 +
    1.87 +A clip format object (for instance TMdaWavClipFormat, TMdaAuClipFormat or TMdaRawAudioClipFormat) is passed
    1.88 +as a parameter to CMdaAudioRecorderUtility::OpenL(), and to CMdaAudioConvertUtility::OpenL().
    1.89 +*/
    1.90 +class TMdaClipFormat : public TMdaPackage
    1.91 +	{
    1.92 +public:
    1.93 +	inline TMdaClipFormat();
    1.94 +protected:
    1.95 +	inline TMdaClipFormat(TUid aUid, TInt aDerivedSize);
    1.96 +	};
    1.97 +
    1.98 +/**
    1.99 +@publishedAll
   1.100 +@deprecated
   1.101 +
   1.102 +Not used by MMF
   1.103 +*/
   1.104 +class TMdaStreamDevice : public TMdaPackage
   1.105 +	{
   1.106 +protected:
   1.107 +	inline TMdaStreamDevice(TUid aUid, TInt aDerivedSize);
   1.108 +	};
   1.109 +
   1.110 +// Clip Locations
   1.111 +
   1.112 +/**
   1.113 +@publishedAll
   1.114 +@deprecated
   1.115 +
   1.116 +A package containing the name of a file that stores audio clip data.
   1.117 +
   1.118 +An object of this class can be passed to CMdaAudioRecorderUtility::OpenL(), or to CMdaAudioConvertUtility::OpenL().
   1.119 +*/
   1.120 +class TMdaFileClipLocation : public TMdaClipLocation
   1.121 +	{
   1.122 +public:
   1.123 +	inline TMdaFileClipLocation();
   1.124 +	inline TMdaFileClipLocation(const TDesC& aName);
   1.125 +public:
   1.126 +	/**
   1.127 +	The name of the file that contains the audio clip data.
   1.128 +	*/
   1.129 +	TBuf<256> iName;
   1.130 +	};
   1.131 +
   1.132 +/**
   1.133 +@publishedAll
   1.134 +@deprecated
   1.135 +
   1.136 +A package containing a non-modifiable 8 bit descriptor that stores binary audio clip data.
   1.137 +
   1.138 +An object of this class can be passed to CMdaAudioRecorderUtility::OpenL(), or to CMdaAudioConvertUtility::OpenL().
   1.139 +*/
   1.140 +class TMdaDesClipLocation : public TMdaClipLocation
   1.141 +	{
   1.142 +public:
   1.143 +	inline TMdaDesClipLocation();
   1.144 +	inline TMdaDesClipLocation(TDes8& aWriteableDes);
   1.145 +	inline TMdaDesClipLocation(const TDesC8& aReadOnlyDes);
   1.146 +public:
   1.147 +	/**
   1.148 +	The ID of the current thread.
   1.149 +	*/
   1.150 +	TThreadId iThreadId;
   1.151 +	/**
   1.152 +	The descriptor that contains the binary audio clip data.
   1.153 +	*/
   1.154 +	TDesC8* iDes;
   1.155 +	};
   1.156 +
   1.157 +/**
   1.158 +@publishedAll
   1.159 +@deprecated
   1.160 +
   1.161 +Not used in MMF
   1.162 +*/
   1.163 +class TMdaUrlClipLocation : public TMdaClipLocation
   1.164 +	{
   1.165 +public:
   1.166 +	inline TMdaUrlClipLocation();
   1.167 +	inline TMdaUrlClipLocation(const TDesC& aUrl, TInt aIapId, const TDesC8& aMimeType = KNullDesC8);
   1.168 +public:
   1.169 +	TBuf<256> iUrl;
   1.170 +	TBuf8<256> iMimeType;
   1.171 +	TInt iIapId;
   1.172 +	};
   1.173 +
   1.174 +
   1.175 +// Inline functions
   1.176 +	
   1.177 +/**
   1.178 +Protected constructor. This can be called from a derived class, with a UID 
   1.179 +identifying the type of clip location and the size of the derived class.
   1.180 +
   1.181 +@param  aUid
   1.182 +        A UID that identifies the type of package.
   1.183 +@param  aDerivedSize 
   1.184 +        The size of the derived class.
   1.185 +*/
   1.186 +inline TMdaClipLocation::TMdaClipLocation(TUid aUid, TInt aDerivedSize) :
   1.187 +TMdaPackage(KUidMdaClipLocation,aUid,aDerivedSize) {}
   1.188 +
   1.189 +/**
   1.190 +The default constructor initialises the object so that it can be identified by the media server.
   1.191 +*/
   1.192 +inline TMdaClipFormat::TMdaClipFormat(TUid aUid, TInt aDerivedSize) :
   1.193 +TMdaPackage(KUidMdaClipFormat,aUid,aDerivedSize) {}
   1.194 +
   1.195 +inline TMdaClipFormat::TMdaClipFormat() : 
   1.196 +TMdaPackage(KUidMdaClipFormat,KNullUid,sizeof(TMdaClipFormat)) {}
   1.197 +
   1.198 +inline TMdaStreamDevice::TMdaStreamDevice(TUid aUid, TInt aDerivedSize) :
   1.199 +TMdaPackage(KUidMdaStreamDevice,aUid,aDerivedSize) {}
   1.200 +
   1.201 +/**
   1.202 +Default constructor. Initialises the package attributes so that it can be sent to the server. The filename is not initialised.
   1.203 +*/
   1.204 +inline TMdaFileClipLocation::TMdaFileClipLocation() :
   1.205 +TMdaClipLocation(KUidMdaFileResLoc,sizeof(TMdaFileClipLocation)) {}
   1.206 +
   1.207 +/**
   1.208 +Constructor with a filename.
   1.209 +
   1.210 +@param  aName
   1.211 +        The name of the file that contains the audio clip data.
   1.212 +*/
   1.213 +inline TMdaFileClipLocation::TMdaFileClipLocation(const TDesC& aName) :
   1.214 +TMdaClipLocation(KUidMdaFileResLoc,sizeof(TMdaFileClipLocation)),
   1.215 +iName(aName) {}
   1.216 +
   1.217 +inline TMdaUrlClipLocation::TMdaUrlClipLocation() :
   1.218 +TMdaClipLocation(KUidMdaUrlResLoc,sizeof(TMdaUrlClipLocation)) {}
   1.219 +
   1.220 +inline TMdaUrlClipLocation::TMdaUrlClipLocation(const TDesC& aUrl, TInt aIapId, const TDesC8& aMimeType) :
   1.221 +TMdaClipLocation(KUidMdaUrlResLoc,sizeof(TMdaUrlClipLocation)),
   1.222 +iUrl(aUrl),iMimeType(aMimeType), iIapId(aIapId) {}
   1.223 +
   1.224 +
   1.225 +/**
   1.226 +Default constructor. Initialises the package attributes so that it can be sent to the server. The
   1.227 +thread ID is initialised, but the descriptor is not.
   1.228 +*/
   1.229 +inline TMdaDesClipLocation::TMdaDesClipLocation() :
   1.230 +TMdaClipLocation(KUidMdaDesResLoc,sizeof(TMdaDesClipLocation)),
   1.231 +iThreadId(RThread().Id()) {}
   1.232 +
   1.233 +/**
   1.234 +Constructor with a non-modifiable descriptor. Initialises the thread ID and the descriptor.
   1.235 +
   1.236 +@param  aReadOnlyDes 
   1.237 +        A non-modifiable descriptor which contains the sound data.
   1.238 +*/
   1.239 +inline TMdaDesClipLocation::TMdaDesClipLocation(const TDesC8& aReadOnlyDes) :
   1.240 +TMdaClipLocation(KUidMdaDesResLoc,sizeof(TMdaDesClipLocation)),
   1.241 +iThreadId(RThread().Id()),
   1.242 +iDes(&(TDesC8&)aReadOnlyDes) {}
   1.243 +
   1.244 +/**
   1.245 +Constructor with a modifiable descriptor. Initialises the thread ID and the descriptor.
   1.246 +
   1.247 +@param  aWriteableDes
   1.248 +        A modifiable descriptor which contains the sound data.
   1.249 +*/
   1.250 +inline TMdaDesClipLocation::TMdaDesClipLocation(TDes8& aWriteableDes) :
   1.251 +TMdaClipLocation(KUidMdaDesResLoc,sizeof(TMdaDesClipLocation)),
   1.252 +iThreadId(RThread().Id()),
   1.253 +iDes(&aWriteableDes) {}
   1.254 +
   1.255 +#endif