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