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 "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Mda\Common\Resource.h
18 #ifndef __MDA_COMMON_RESOURCE_H__
19 #define __MDA_COMMON_RESOURCE_H__
21 // Standard EPOC32 includes
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>
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)
42 const TInt KMdaRepeatForever = -2;
48 Abstract base class for providing the location of audio clip data.
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.
55 @see TMdaFileClipLocation
56 @see TMdaDesClipLocation
58 class TMdaClipLocation : public TMdaPackage
61 inline TMdaClipLocation(TUid aUid, TInt aDerivedSize);
65 The size of the whole audio clip in bytes.
67 TInt iSize; // In bytes
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.
73 TInt iVisible; // In bytes
80 The base class for audio clip sound formats.
82 This class is a package designed to wrap up the UID (and possibly other data) of an audio clip format.
84 A clip format object (for instance TMdaWavClipFormat, TMdaAuClipFormat or TMdaRawAudioClipFormat) is passed
85 as a parameter to CMdaAudioRecorderUtility::OpenL(), and to CMdaAudioConvertUtility::OpenL().
87 class TMdaClipFormat : public TMdaPackage
90 inline TMdaClipFormat();
92 inline TMdaClipFormat(TUid aUid, TInt aDerivedSize);
101 class TMdaStreamDevice : public TMdaPackage
104 inline TMdaStreamDevice(TUid aUid, TInt aDerivedSize);
113 A package containing the name of a file that stores audio clip data.
115 An object of this class can be passed to CMdaAudioRecorderUtility::OpenL(), or to CMdaAudioConvertUtility::OpenL().
117 class TMdaFileClipLocation : public TMdaClipLocation
120 inline TMdaFileClipLocation();
121 inline TMdaFileClipLocation(const TDesC& aName);
124 The name of the file that contains the audio clip data.
133 A package containing a non-modifiable 8 bit descriptor that stores binary audio clip data.
135 An object of this class can be passed to CMdaAudioRecorderUtility::OpenL(), or to CMdaAudioConvertUtility::OpenL().
137 class TMdaDesClipLocation : public TMdaClipLocation
140 inline TMdaDesClipLocation();
141 inline TMdaDesClipLocation(TDes8& aWriteableDes);
142 inline TMdaDesClipLocation(const TDesC8& aReadOnlyDes);
145 The ID of the current thread.
149 The descriptor that contains the binary audio clip data.
160 class TMdaUrlClipLocation : public TMdaClipLocation
163 inline TMdaUrlClipLocation();
164 inline TMdaUrlClipLocation(const TDesC& aUrl, TInt aIapId, const TDesC8& aMimeType = KNullDesC8);
167 TBuf8<256> iMimeType;
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.
179 A UID that identifies the type of package.
181 The size of the derived class.
183 inline TMdaClipLocation::TMdaClipLocation(TUid aUid, TInt aDerivedSize) :
184 TMdaPackage(KUidMdaClipLocation,aUid,aDerivedSize) {}
187 The default constructor initialises the object so that it can be identified by the media server.
189 inline TMdaClipFormat::TMdaClipFormat(TUid aUid, TInt aDerivedSize) :
190 TMdaPackage(KUidMdaClipFormat,aUid,aDerivedSize) {}
192 inline TMdaClipFormat::TMdaClipFormat() :
193 TMdaPackage(KUidMdaClipFormat,KNullUid,sizeof(TMdaClipFormat)) {}
195 inline TMdaStreamDevice::TMdaStreamDevice(TUid aUid, TInt aDerivedSize) :
196 TMdaPackage(KUidMdaStreamDevice,aUid,aDerivedSize) {}
199 Default constructor. Initialises the package attributes so that it can be sent to the server. The filename is not initialised.
201 inline TMdaFileClipLocation::TMdaFileClipLocation() :
202 TMdaClipLocation(KUidMdaFileResLoc,sizeof(TMdaFileClipLocation)) {}
205 Constructor with a filename.
208 The name of the file that contains the audio clip data.
210 inline TMdaFileClipLocation::TMdaFileClipLocation(const TDesC& aName) :
211 TMdaClipLocation(KUidMdaFileResLoc,sizeof(TMdaFileClipLocation)),
214 inline TMdaUrlClipLocation::TMdaUrlClipLocation() :
215 TMdaClipLocation(KUidMdaUrlResLoc,sizeof(TMdaUrlClipLocation)) {}
217 inline TMdaUrlClipLocation::TMdaUrlClipLocation(const TDesC& aUrl, TInt aIapId, const TDesC8& aMimeType) :
218 TMdaClipLocation(KUidMdaUrlResLoc,sizeof(TMdaUrlClipLocation)),
219 iUrl(aUrl),iMimeType(aMimeType), iIapId(aIapId) {}
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.
226 inline TMdaDesClipLocation::TMdaDesClipLocation() :
227 TMdaClipLocation(KUidMdaDesResLoc,sizeof(TMdaDesClipLocation)),
228 iThreadId(RThread().Id()) {}
231 Constructor with a non-modifiable descriptor. Initialises the thread ID and the descriptor.
234 A non-modifiable descriptor which contains the sound data.
236 inline TMdaDesClipLocation::TMdaDesClipLocation(const TDesC8& aReadOnlyDes) :
237 TMdaClipLocation(KUidMdaDesResLoc,sizeof(TMdaDesClipLocation)),
238 iThreadId(RThread().Id()),
239 iDes(&(TDesC8&)aReadOnlyDes) {}
242 Constructor with a modifiable descriptor. Initialises the thread ID and the descriptor.
245 A modifiable descriptor which contains the sound data.
247 inline TMdaDesClipLocation::TMdaDesClipLocation(TDes8& aWriteableDes) :
248 TMdaClipLocation(KUidMdaDesResLoc,sizeof(TMdaDesClipLocation)),
249 iThreadId(RThread().Id()),
250 iDes(&aWriteableDes) {}