|
1 /* |
|
2 * Copyright (c) 2006 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 is responsible for getting MMF file information |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CMPXFILEINFOUTILITY_H |
|
21 #define CMPXFILEINFOUTILITY_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <e32hashtab.h> |
|
26 #include <mmf/common/mmfcontroller.h> |
|
27 #include <mmf/common/mmfcontrollerframework.h> |
|
28 |
|
29 // CLASS DECLARATION |
|
30 |
|
31 /** |
|
32 * File info utility class |
|
33 */ |
|
34 class CMPXFileInfoUtility : public CBase |
|
35 { |
|
36 public: // Constructors and destructor |
|
37 |
|
38 /** |
|
39 * Two-phased constructor: Normal C++ constructor & ConstructL. |
|
40 */ |
|
41 static CMPXFileInfoUtility* NewL(); |
|
42 |
|
43 /** |
|
44 * Two-phased constructor: Normal C++ constructor & ConstructL. |
|
45 */ |
|
46 static CMPXFileInfoUtility* NewLC(); |
|
47 |
|
48 /** |
|
49 * Destructor |
|
50 * Destroy the object and release all memory objects |
|
51 */ |
|
52 virtual ~CMPXFileInfoUtility(); |
|
53 |
|
54 public: // New functions |
|
55 |
|
56 /** |
|
57 * Open a file using audio controller. |
|
58 * The file is opened based on MIME type given mime type. |
|
59 * If MIME type is not provided, the file is opened by file handle |
|
60 * @param aFile, file handle |
|
61 * @param aMimeType, mime type of the file, by default it is KNullDesC |
|
62 */ |
|
63 void OpenFileL(RFile& aFile, |
|
64 const TDesC& aMimeType = KNullDesC); |
|
65 /** |
|
66 * Reset file info utility |
|
67 */ |
|
68 void Reset(); |
|
69 |
|
70 /** |
|
71 * Get the duration of a song |
|
72 * @return duration with micro seconds |
|
73 */ |
|
74 TTimeIntervalMicroSeconds Duration(); |
|
75 |
|
76 /** |
|
77 * Get the bit rate of a song |
|
78 * @return the bit rate of the song |
|
79 */ |
|
80 TUint BitRate(); |
|
81 |
|
82 /** |
|
83 * Get the sample rate of a song |
|
84 * @return the sample rate of the song |
|
85 */ |
|
86 TUint SampleRate(); |
|
87 |
|
88 private: |
|
89 |
|
90 /** |
|
91 * C++ default constructor |
|
92 */ |
|
93 CMPXFileInfoUtility(); |
|
94 |
|
95 /** |
|
96 * By default Symbian 2nd phase constructor is private. |
|
97 */ |
|
98 void ConstructL(); |
|
99 |
|
100 /** |
|
101 * Find a controller |
|
102 * The controller is searched by MIME type. If MIME type is empty, |
|
103 * the controller is searched by file name |
|
104 * @param aFileName file name |
|
105 * @param aMimeType, mime type of the file |
|
106 * @param aUid uid of the controller |
|
107 */ |
|
108 void FindController( const TDesC& aFileName, |
|
109 const TDesC& aMimeType, |
|
110 TUid& aUid); |
|
111 |
|
112 /** |
|
113 * Open a controller |
|
114 * @param aUid uid of the controller |
|
115 */ |
|
116 void OpenControllerL(const TUid& aUid); |
|
117 |
|
118 /** |
|
119 * Create an array to hold all the controller plugins that support audio |
|
120 */ |
|
121 void CreateAudioFormatsArrayL(); |
|
122 |
|
123 private: // Member variables |
|
124 |
|
125 // Controller for music file |
|
126 RPtrHashMap<TUint32, RMMFController> iMMFControllers; |
|
127 RMMFController *iController; |
|
128 TUint32 iCurrentControllerUid; |
|
129 TUint32 iUid1; |
|
130 TUint32 iUid2; |
|
131 |
|
132 RMMFControllerImplInfoArray iAudioControllers; |
|
133 }; |
|
134 |
|
135 #endif // CMPXFILEINFOUTILITY_H |
|
136 |
|
137 // End of File |
|
138 |