epoc32/include/mda/common/resource.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 resource.h
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // 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
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Mda\Common\Resource.h
       
    15 // 
       
    16 //
       
    17 
       
    18 #ifndef __MDA_COMMON_RESOURCE_H__
       
    19 #define __MDA_COMMON_RESOURCE_H__
       
    20 
       
    21 // Standard EPOC32 includes
       
    22 #include <e32base.h>
       
    23 
       
    24 // Public Media Server includes
       
    25 #include <mda/common/base.h>
       
    26 #include <mda/common/port.h>
       
    27 #include <mda/common/controller.h>
       
    28 #include <mda/common/resource.hrh>
       
    29 
       
    30 // Uids
       
    31 MDA_UID(KUidMdaClipLocation) // Resource Clip Location/Format type Uids
       
    32 MDA_UID(KUidMdaClipFormat) 
       
    33 MDA_UID(KUidMdaStreamDevice) // Resource Stream Device Uid
       
    34 MDA_UID(KUidMdaFileResLoc) // Clip Location Uids
       
    35 MDA_UID(KUidMdaDesResLoc) 
       
    36 MDA_UID(KUidMdaUrlResLoc) 
       
    37 
       
    38 /**
       
    39 @publishedAll
       
    40 @deprecated
       
    41 */
       
    42 const TInt KMdaRepeatForever = -2;
       
    43 
       
    44 /**
       
    45 @publishedAll
       
    46 @deprecated
       
    47 
       
    48 Abstract base class for providing the location of audio clip data.
       
    49 
       
    50 The location could be a filename or the address of a descriptor. An object of the derived class 
       
    51 is passed as a parameter to CMdaAudioRecorderUtility::OpenL() (to record a clip) or 
       
    52 CMdaAudioConvertUtility::OpenL() (to convert a clip to another format). This class could be
       
    53 derived from to create new types of clip location.
       
    54 
       
    55 @see TMdaFileClipLocation
       
    56 @see TMdaDesClipLocation
       
    57 */
       
    58 class TMdaClipLocation : public TMdaPackage
       
    59 	{
       
    60 protected:
       
    61 	inline TMdaClipLocation(TUid aUid, TInt aDerivedSize);
       
    62 public:
       
    63 
       
    64 	/**
       
    65 	The size of the whole audio clip in bytes.
       
    66 	*/
       
    67 	TInt iSize; // In bytes
       
    68 
       
    69 	/**
       
    70 	The size of the part of the clip in bytes currently accessible. For example, a clip whose
       
    71 	location is a URL might be larger than the amount currently available to the client.
       
    72 	*/
       
    73 	TInt iVisible; // In bytes
       
    74 	};
       
    75 
       
    76 /**
       
    77 @publishedAll
       
    78 @deprecated
       
    79 
       
    80 The base class for audio clip sound formats.
       
    81 
       
    82 This class is a package designed to wrap up the UID (and possibly other data) of an audio clip format.
       
    83 
       
    84 A clip format object (for instance TMdaWavClipFormat, TMdaAuClipFormat or TMdaRawAudioClipFormat) is passed
       
    85 as a parameter to CMdaAudioRecorderUtility::OpenL(), and to CMdaAudioConvertUtility::OpenL().
       
    86 */
       
    87 class TMdaClipFormat : public TMdaPackage
       
    88 	{
       
    89 public:
       
    90 	inline TMdaClipFormat();
       
    91 protected:
       
    92 	inline TMdaClipFormat(TUid aUid, TInt aDerivedSize);
       
    93 	};
       
    94 
       
    95 /**
       
    96 @publishedAll
       
    97 @deprecated
       
    98 
       
    99 Not used by MMF
       
   100 */
       
   101 class TMdaStreamDevice : public TMdaPackage
       
   102 	{
       
   103 protected:
       
   104 	inline TMdaStreamDevice(TUid aUid, TInt aDerivedSize);
       
   105 	};
       
   106 
       
   107 // Clip Locations
       
   108 
       
   109 /**
       
   110 @publishedAll
       
   111 @deprecated
       
   112 
       
   113 A package containing the name of a file that stores audio clip data.
       
   114 
       
   115 An object of this class can be passed to CMdaAudioRecorderUtility::OpenL(), or to CMdaAudioConvertUtility::OpenL().
       
   116 */
       
   117 class TMdaFileClipLocation : public TMdaClipLocation
       
   118 	{
       
   119 public:
       
   120 	inline TMdaFileClipLocation();
       
   121 	inline TMdaFileClipLocation(const TDesC& aName);
       
   122 public:
       
   123 	/**
       
   124 	The name of the file that contains the audio clip data.
       
   125 	*/
       
   126 	TBuf<256> iName;
       
   127 	};
       
   128 
       
   129 /**
       
   130 @publishedAll
       
   131 @deprecated
       
   132 
       
   133 A package containing a non-modifiable 8 bit descriptor that stores binary audio clip data.
       
   134 
       
   135 An object of this class can be passed to CMdaAudioRecorderUtility::OpenL(), or to CMdaAudioConvertUtility::OpenL().
       
   136 */
       
   137 class TMdaDesClipLocation : public TMdaClipLocation
       
   138 	{
       
   139 public:
       
   140 	inline TMdaDesClipLocation();
       
   141 	inline TMdaDesClipLocation(TDes8& aWriteableDes);
       
   142 	inline TMdaDesClipLocation(const TDesC8& aReadOnlyDes);
       
   143 public:
       
   144 	/**
       
   145 	The ID of the current thread.
       
   146 	*/
       
   147 	TThreadId iThreadId;
       
   148 	/**
       
   149 	The descriptor that contains the binary audio clip data.
       
   150 	*/
       
   151 	TDesC8* iDes;
       
   152 	};
       
   153 
       
   154 /**
       
   155 @publishedAll
       
   156 @deprecated
       
   157 
       
   158 Not used in MMF
       
   159 */
       
   160 class TMdaUrlClipLocation : public TMdaClipLocation
       
   161 	{
       
   162 public:
       
   163 	inline TMdaUrlClipLocation();
       
   164 	inline TMdaUrlClipLocation(const TDesC& aUrl, TInt aIapId, const TDesC8& aMimeType = KNullDesC8);
       
   165 public:
       
   166 	TBuf<256> iUrl;
       
   167 	TBuf8<256> iMimeType;
       
   168 	TInt iIapId;
       
   169 	};
       
   170 
       
   171 
       
   172 // Inline functions
       
   173 	
       
   174 /**
       
   175 Protected constructor. This can be called from a derived class, with a UID 
       
   176 identifying the type of clip location and the size of the derived class.
       
   177 
       
   178 @param  aUid
       
   179         A UID that identifies the type of package.
       
   180 @param  aDerivedSize 
       
   181         The size of the derived class.
       
   182 */
       
   183 inline TMdaClipLocation::TMdaClipLocation(TUid aUid, TInt aDerivedSize) :
       
   184 TMdaPackage(KUidMdaClipLocation,aUid,aDerivedSize) {}
       
   185 
       
   186 /**
       
   187 The default constructor initialises the object so that it can be identified by the media server.
       
   188 */
       
   189 inline TMdaClipFormat::TMdaClipFormat(TUid aUid, TInt aDerivedSize) :
       
   190 TMdaPackage(KUidMdaClipFormat,aUid,aDerivedSize) {}
       
   191 
       
   192 inline TMdaClipFormat::TMdaClipFormat() : 
       
   193 TMdaPackage(KUidMdaClipFormat,KNullUid,sizeof(TMdaClipFormat)) {}
       
   194 
       
   195 inline TMdaStreamDevice::TMdaStreamDevice(TUid aUid, TInt aDerivedSize) :
       
   196 TMdaPackage(KUidMdaStreamDevice,aUid,aDerivedSize) {}
       
   197 
       
   198 /**
       
   199 Default constructor. Initialises the package attributes so that it can be sent to the server. The filename is not initialised.
       
   200 */
       
   201 inline TMdaFileClipLocation::TMdaFileClipLocation() :
       
   202 TMdaClipLocation(KUidMdaFileResLoc,sizeof(TMdaFileClipLocation)) {}
       
   203 
       
   204 /**
       
   205 Constructor with a filename.
       
   206 
       
   207 @param  aName
       
   208         The name of the file that contains the audio clip data.
       
   209 */
       
   210 inline TMdaFileClipLocation::TMdaFileClipLocation(const TDesC& aName) :
       
   211 TMdaClipLocation(KUidMdaFileResLoc,sizeof(TMdaFileClipLocation)),
       
   212 iName(aName) {}
       
   213 
       
   214 inline TMdaUrlClipLocation::TMdaUrlClipLocation() :
       
   215 TMdaClipLocation(KUidMdaUrlResLoc,sizeof(TMdaUrlClipLocation)) {}
       
   216 
       
   217 inline TMdaUrlClipLocation::TMdaUrlClipLocation(const TDesC& aUrl, TInt aIapId, const TDesC8& aMimeType) :
       
   218 TMdaClipLocation(KUidMdaUrlResLoc,sizeof(TMdaUrlClipLocation)),
       
   219 iUrl(aUrl),iMimeType(aMimeType), iIapId(aIapId) {}
       
   220 
       
   221 
       
   222 /**
       
   223 Default constructor. Initialises the package attributes so that it can be sent to the server. The
       
   224 thread ID is initialised, but the descriptor is not.
       
   225 */
       
   226 inline TMdaDesClipLocation::TMdaDesClipLocation() :
       
   227 TMdaClipLocation(KUidMdaDesResLoc,sizeof(TMdaDesClipLocation)),
       
   228 iThreadId(RThread().Id()) {}
       
   229 
       
   230 /**
       
   231 Constructor with a non-modifiable descriptor. Initialises the thread ID and the descriptor.
       
   232 
       
   233 @param  aReadOnlyDes 
       
   234         A non-modifiable descriptor which contains the sound data.
       
   235 */
       
   236 inline TMdaDesClipLocation::TMdaDesClipLocation(const TDesC8& aReadOnlyDes) :
       
   237 TMdaClipLocation(KUidMdaDesResLoc,sizeof(TMdaDesClipLocation)),
       
   238 iThreadId(RThread().Id()),
       
   239 iDes(&(TDesC8&)aReadOnlyDes) {}
       
   240 
       
   241 /**
       
   242 Constructor with a modifiable descriptor. Initialises the thread ID and the descriptor.
       
   243 
       
   244 @param  aWriteableDes
       
   245         A modifiable descriptor which contains the sound data.
       
   246 */
       
   247 inline TMdaDesClipLocation::TMdaDesClipLocation(TDes8& aWriteableDes) :
       
   248 TMdaClipLocation(KUidMdaDesResLoc,sizeof(TMdaDesClipLocation)),
       
   249 iThreadId(RThread().Id()),
       
   250 iDes(&aWriteableDes) {}
       
   251 
       
   252 #endif