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