Update contrib.
2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
19 #ifndef RESOURCEDATA_H
20 #define RESOURCEDATA_H
25 #include <mmf/server/mmfhwdevice.h>
26 #include "audiocodec.h"
29 _LIT16(KFileNameFormat,"HwDev0x%x.rsc");
30 const TInt8 KResFileNameLength = 20;
31 const TInt8 KResFileNameAndPathLength = 50;
35 // Class is used to read capabilities and initilaization data from codec
36 // resource data files.
38 NONSHARABLE_CLASS (CResourceData) : public CBase
40 public: // Constructors and destructor
43 // Two-phased constructor.
45 // @param aResourceUid UID of the resource whose data to read.
46 // @return CResourceData* Pointer to a newly constructed object.
48 static CResourceData* NewL(TUid aResourceUid);
58 // Reads the capabilities data.
60 // @param aMode Mode of the resource.
61 // @param aConf On return from a succesful call, contains the capabilities data.
64 TInt GetSSampleRates(TMode aMode, RArray<TInt>& aSampleRate);
65 TInt GetSModes(TMode aMode, RArray<TUid>& aModeConfig);
75 //2nd phase constructor is private.
76 //The param is the UID of the resource whose data to read.
78 void ConstructL(TUid aResourceUid);
81 //Utility method for seeking resource to the correct mode. Leaves with
82 //KErrNotFound if mode is not found in the opened resource.
84 //aMode is the codec mode.
86 TInt SeekToMode(TMode aMode);
93 // Resource file data.
94 HBufC8* iResourceData;
96 // Resource file reader.
97 TResourceReader iResourceReader;
99 // Resource data end pointer (for safety checks).
100 const TUint8* iResourceDataEnd;
103 #endif // RESOURCEDATA_H