|
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 MP3 PlayControllerPlugin. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include <MP3AudioPlayControllerResource.rsg> |
|
22 #include "MP3AudioPlayControllerResource.h" |
|
23 #include "DebugMacros.h" |
|
24 |
|
25 #include <data_caging_path_literals.hrh> |
|
26 |
|
27 // LOCAL CONSTANTS AND MACROS |
|
28 |
|
29 |
|
30 _LIT(KDirAndFile, "z:MP3AudioPlayControllerResource.rsc"); |
|
31 |
|
32 |
|
33 // ============================ MEMBER FUNCTIONS =============================== |
|
34 |
|
35 // ----------------------------------------------------------------------------- |
|
36 // CMP3AudioPlayControllerResource::CMP3AudioPlayControllerResource |
|
37 // C++ default constructor can NOT contain any code, that |
|
38 // might leave. |
|
39 // ----------------------------------------------------------------------------- |
|
40 // |
|
41 CMP3AudioPlayControllerResource::CMP3AudioPlayControllerResource() |
|
42 { |
|
43 } |
|
44 |
|
45 // ----------------------------------------------------------------------------- |
|
46 // CMP3AudioPlayControllerResource::ConstructL |
|
47 // Symbian 2nd phase constructor can leave. |
|
48 // ----------------------------------------------------------------------------- |
|
49 // |
|
50 void CMP3AudioPlayControllerResource::ConstructL() |
|
51 { |
|
52 DP0(_L("CMP3AudioPlayControllerResource::ConstructL")); |
|
53 // ReadResourceFileL(KResourceFile, MP3DECODER); |
|
54 |
|
55 TParse* fp = new(ELeave) TParse(); |
|
56 fp->Set(KDirAndFile, &KDC_RESOURCE_FILES_DIR, NULL); |
|
57 |
|
58 ReadResourceFileL(fp->FullName(), MP3DECODER); |
|
59 delete fp; |
|
60 } |
|
61 |
|
62 // ----------------------------------------------------------------------------- |
|
63 // CMP3AudioPlayControllerResource::NewL |
|
64 // Two-phased constructor. |
|
65 // ----------------------------------------------------------------------------- |
|
66 // |
|
67 CMP3AudioPlayControllerResource* CMP3AudioPlayControllerResource::NewL() |
|
68 { |
|
69 DP0(_L("CMP3AudioPlayControllerResource::NewL")); |
|
70 CMP3AudioPlayControllerResource* self = new(ELeave) CMP3AudioPlayControllerResource(); |
|
71 CleanupStack::PushL(self); |
|
72 self->ConstructL(); |
|
73 CleanupStack::Pop(self); // self |
|
74 return self; |
|
75 } |
|
76 |
|
77 // Destructor |
|
78 CMP3AudioPlayControllerResource::~CMP3AudioPlayControllerResource() |
|
79 { |
|
80 } |
|
81 |
|
82 // ----------------------------------------------------------------------------- |
|
83 // CMP3AudioPlayControllerResource::ReadCodecConfigParametersL |
|
84 // Reads the configuration parameters for MP3 Decoder. |
|
85 // ----------------------------------------------------------------------------- |
|
86 // |
|
87 void CMP3AudioPlayControllerResource::ReadCodecConfigParametersL() |
|
88 { |
|
89 DP0(_L("CMP3AudioPlayControllerResource::ReadCodecConfigParametersL")); |
|
90 iCodecConfigParams.Append( iResourceReader.ReadInt32() ); // [0] Stereo to Mono Switch |
|
91 iCodecConfigParams.Append( iResourceReader.ReadInt32() ); // [1] Decode Left or Right Channel |
|
92 iCodecConfigParams.Append( iResourceReader.ReadInt32() ); // [2] Decimation Factor |
|
93 iCodecConfigParams.Append( iResourceReader.ReadInt32() ); // [3] Concealment Level |
|
94 iCodecConfigParams.Append( iResourceReader.ReadInt32() ); // [4] Sample Length |
|
95 iCodecConfigParams.Append( iResourceReader.ReadInt32() ); // [5] Sample Frequency |
|
96 iCodecConfigParams.Append(NULL); // [6] frame table pointer |
|
97 iCodecConfigParams.Append(NULL); // [7] render control |
|
98 iCodecConfigParams.Append(NULL); // [8] samples per frame |
|
99 iCodecConfigParams.Append(NULL); // [9] mark play end control |
|
100 iCodecConfigParams.Append(NULL); // [10] enable / disable |
|
101 } |
|
102 |
|
103 // End of File |