|
1 /* |
|
2 * Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
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". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: This class implements resource file handling for AMR PlayControllerPlugin. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include <AMRAudioPlayControllerResource.rsg> |
|
22 #include "AMRAudioPlayControllerResource.h" |
|
23 #include "DebugMacros.h" |
|
24 #include <data_caging_path_literals.hrh> |
|
25 |
|
26 // LOCAL CONSTANTS AND MACROS |
|
27 |
|
28 _LIT(KDirAndFile,"z:AMRAudioPlayControllerResource.rsc"); |
|
29 |
|
30 // ============================ MEMBER FUNCTIONS =============================== |
|
31 |
|
32 // ----------------------------------------------------------------------------- |
|
33 // CAMRAudioPlayControllerResource::CAMRAudioPlayControllerResource |
|
34 // C++ default constructor can NOT contain any code, that |
|
35 // might leave. |
|
36 // ----------------------------------------------------------------------------- |
|
37 // |
|
38 CAMRAudioPlayControllerResource::CAMRAudioPlayControllerResource() |
|
39 { |
|
40 } |
|
41 |
|
42 // ----------------------------------------------------------------------------- |
|
43 // CAMRAudioPlayControllerResource::ConstructL |
|
44 // Symbian 2nd phase constructor can leave. |
|
45 // ----------------------------------------------------------------------------- |
|
46 // |
|
47 void CAMRAudioPlayControllerResource::ConstructL() |
|
48 { |
|
49 DP0(_L("CAMRAudioPlayControllerResource::ConstructL")); |
|
50 TParse* fp = new(ELeave) TParse(); |
|
51 CleanupStack::PushL(fp); |
|
52 fp->Set(KDirAndFile, &KDC_RESOURCE_FILES_DIR, NULL); |
|
53 ReadResourceFileL(fp->FullName(), AMRDECODER); |
|
54 CleanupStack::Pop(fp); |
|
55 delete fp; |
|
56 } |
|
57 |
|
58 // ----------------------------------------------------------------------------- |
|
59 // CAMRAudioPlayControllerResource::NewL |
|
60 // Two-phased constructor. |
|
61 // ----------------------------------------------------------------------------- |
|
62 // |
|
63 CAMRAudioPlayControllerResource* CAMRAudioPlayControllerResource::NewL() |
|
64 { |
|
65 DP0(_L("CAMRAudioPlayControllerResource::NewL")); |
|
66 CAMRAudioPlayControllerResource* self = new(ELeave) CAMRAudioPlayControllerResource(); |
|
67 CleanupStack::PushL(self); |
|
68 self->ConstructL(); |
|
69 CleanupStack::Pop(self); // self |
|
70 return self; |
|
71 } |
|
72 |
|
73 // Destructor |
|
74 CAMRAudioPlayControllerResource::~CAMRAudioPlayControllerResource() |
|
75 { |
|
76 } |
|
77 |
|
78 // ----------------------------------------------------------------------------- |
|
79 // CAMRAudioPlayControllerResource::ReadCodecConfigParametersL |
|
80 // Reads the configuration parameters for AMR Decoder. |
|
81 // ----------------------------------------------------------------------------- |
|
82 // |
|
83 void CAMRAudioPlayControllerResource::ReadCodecConfigParametersL() |
|
84 { |
|
85 DP0(_L("CAMRAudioPlayControllerResource::ReadCodecConfigParametersL")); |
|
86 iCodecConfigParams.Append( iResourceReader.ReadInt32() ); // [0] Concealment Level |
|
87 iCodecConfigParams.Append(NULL); // [1] frame table pointer |
|
88 iCodecConfigParams.Append(NULL); // [2] render control |
|
89 iCodecConfigParams.Append(NULL); // [3] mark play end control |
|
90 iCodecConfigParams.Append(NULL); // [4] enable / disable |
|
91 } |
|
92 |
|
93 // End of File |