36 class MMTPDataProviderFramework; |
36 class MMTPDataProviderFramework; |
37 |
37 |
38 class CMmMtpDpMetadataAccessWrapper : public CBase |
38 class CMmMtpDpMetadataAccessWrapper : public CBase |
39 { |
39 { |
40 public: |
40 public: |
41 static CMmMtpDpMetadataAccessWrapper* NewL( RFs& aRfs, |
41 static CMmMtpDpMetadataAccessWrapper* NewL( RFs& aRfs, |
42 MMTPDataProviderFramework& aFramework ); |
42 MMTPDataProviderFramework& aFramework ); |
43 |
43 |
44 /** |
44 /** |
45 * Destructor |
45 * Destructor |
46 */ |
46 */ |
47 ~CMmMtpDpMetadataAccessWrapper(); |
47 ~CMmMtpDpMetadataAccessWrapper(); |
48 |
48 |
49 public: |
49 public: |
50 /** |
50 /** |
51 * Get all playlists from MPX database in the assigned store |
51 * Get all abstract medias from MPX database in the assigned store |
52 * @param aStoreRoot, specify in which drive playlists are stored |
52 * @param aStoreRoot, specify in which drive abstract medias are stored |
53 * @param aPlaylists, return result array |
53 * @param aAbstractMedias, return result array |
54 */ |
54 * @param aCategory, indicate the category of abstract medias |
55 IMPORT_C void GetAllPlaylistL( const TDesC& aStoreRoot, |
55 */ |
56 CMPXMediaArray** aPlaylists ); |
56 IMPORT_C void GetAllAbstractMediaL( const TDesC& aStoreRoot, |
57 |
57 CMPXMediaArray** aAbstractMedias, |
58 /** |
58 TMPXGeneralCategory aCategory ); |
59 * Get all references of specified playlist |
59 |
60 * @param aPlaylist, specify of which reference should be get |
60 /** |
|
61 * Get all references of specified abstract medias |
|
62 * @param aAbstractMedia, specify of which reference should be get |
61 * @param aReferences, return result array which stored handles of all references |
63 * @param aReferences, return result array which stored handles of all references |
62 */ |
64 */ |
63 IMPORT_C void GetAllReferenceL( CMPXMedia* aPlaylist, |
65 IMPORT_C void GetAllReferenceL( CMPXMedia* aAbstractMedia, |
64 CDesCArray& aReferences ); |
66 CDesCArray& aReferences ); |
65 |
67 |
66 /** |
68 /** |
67 * Get an playlist name from CMPXMedia object |
69 * Get an abstract media name from CMPXMedia object |
68 * @param aPlaylist, specify the source |
70 * @param aAbstractMedia, specify the source |
69 * @param aPlaylistName, return result |
71 * @param aCategory, specify the category |
70 */ |
72 * @return, name of the source, ownership transferred |
71 IMPORT_C void GetPlaylistNameL( CMPXMedia* aPlaylist, TDes& aPlaylistName ); |
73 */ |
72 |
74 IMPORT_C HBufC* GetAbstractMediaNameL( CMPXMedia* aAbstractMedia, |
73 /** |
75 TMPXGeneralCategory aCategory ); |
74 * Add object (music, video and playlist) info to DB |
76 /** |
|
77 * Add object (music, video, playlist and abstract album) info to DB |
75 * @param aFullFileName, full file name of file |
78 * @param aFullFileName, full file name of file |
76 * @return void |
79 * @return void |
77 */ |
80 */ |
78 void AddObjectL( const TDesC& aFullFileName, TBool aIsVideo = EFalse ); |
81 void AddObjectL( const TDesC& aFullFileName, TUint aFormatCode, TUint aSubFormatCode ); |
79 |
82 |
80 /** |
83 /** |
81 * Set playlist to DB |
84 * Set abstract media to DB |
82 * @param aPlaylistFileName, full file name of playlist file |
85 * @param aAbstractMediaFileName, full file name of abstract media file |
83 * @param aRefFileArray, a array to store the full file name of media files |
86 * @param aRefFileArray, a array to store the full file name of media files |
84 * @return void |
87 * @param aCategory, the category of abstract media |
85 */ |
88 * @return void |
86 IMPORT_C void SetPlaylistL( const TDesC& aPlaylistFileName, |
89 */ |
87 CDesCArray& aRefFileArray ); |
90 IMPORT_C void SetAbstractMediaL( const TDesC& aAbstractMediaFileName, |
|
91 CDesCArray& aRefFileArray, |
|
92 TMPXGeneralCategory aCategory ); |
88 |
93 |
89 /** |
94 /** |
90 * Gets a piece of metadata from the collection |
95 * Gets a piece of metadata from the collection |
91 * @param aPropCode, specify property code of aMediaProp |
96 * @param aPropCode, specify property code of aMediaProp |
92 * @param aNewData, object property value which will be get from |
97 * @param aNewData, object property value which will be get from |
138 * @param aFullFileName, the fullFileName of object |
143 * @param aFullFileName, the fullFileName of object |
139 * @param aWidth, the width of an object in pixels to set |
144 * @param aWidth, the width of an object in pixels to set |
140 * @parem aHeight, the height of an object in pixels to set |
145 * @parem aHeight, the height of an object in pixels to set |
141 */ |
146 */ |
142 void SetImageObjPropL( const TDesC& aFullFileName, |
147 void SetImageObjPropL( const TDesC& aFullFileName, |
143 const TUint32 aWidth, |
148 const TUint32 aWidth, |
144 const TUint32 aHeight ); |
149 const TUint32 aHeight ); |
145 |
150 |
146 /* |
151 /* |
147 * get image specific properties specific to videos |
152 * get image specific properties specific to videos |
148 * @param aFullFileName, the fullFileName of object |
153 * @param aFullFileName, the fullFileName of object |
149 * @param aWidth, the width of an object in pixels to get |
154 * @param aWidth, the width of an object in pixels to get |
150 * @parem aHeight, the height of an object in pixels to get |
155 * @parem aHeight, the height of an object in pixels to get |
151 */ |
156 */ |
152 void GetImageObjPropL( const TDesC& aFullFileName, |
157 void GetImageObjPropL( const TDesC& aFullFileName, |
153 TUint32& aWidth, |
158 TUint32& aWidth, |
154 TUint32& aHeight ); |
159 TUint32& aHeight ); |
155 |
160 |
156 /** |
161 /** |
157 * Get Modified object from DB |
162 * Get Modified object from DB |
158 * @param aStorageRoot, the root path of storage |
163 * @param aStorageRoot, the root path of storage |
159 * @param arrayCount, array count |
164 * @param arrayCount, array count |
160 * @param aRefFileArray, a array to store the full file name of media files |
165 * @param aRefFileArray, a array to store the full file name of media files |
161 * @return void |
166 * @return void |
162 */ |
167 */ |
163 IMPORT_C void GetModifiedContentL( const TDesC& aStorageRoot, |
168 IMPORT_C void GetModifiedContentL( const TDesC& aStorageRoot, |
164 TInt& arrayCount, |
169 TInt& arrayCount, |
165 CDesCArray& aRefFileArray ); |
170 CDesCArray& aRefFileArray ); |
166 |
171 |
167 /** |
172 /** |
168 * Updated Music DB |
173 * Updated Music DB |
169 * @return void |
174 * @return void |
170 */ |
175 */ |
171 IMPORT_C void UpdateMusicCollectionL(); |
176 IMPORT_C void UpdateMusicCollectionL(); |
172 |
177 |
173 /* |
178 /* |
174 * Called when the MTP session is initialised |
179 * Called when the MTP session is initialised |
175 */ |
180 */ |
176 void OpenSessionL(); |
181 void OpenSessionL(); |
177 |
182 |
178 /* |
183 /* |
179 * clean up db resource especially for video dp |
184 * clean up db resource especially for video dp |
180 */ |
185 */ |
181 void CloseSessionL(); |
186 void CloseSessionL(); |
182 |
187 |
183 /** |
188 /** |
184 * Cleanup database |
189 * Cleanup database |
185 */ |
190 */ |
186 IMPORT_C void CleanupDatabaseL(); |
191 IMPORT_C void CleanupDatabaseL(); |
187 |
192 |
188 /** |
193 /** |
189 * if the playlsit exist in the MPX DB |
194 * if the playlsit exist in the MPX DB |
190 * @param aSuid, the suid of playlsit |
195 * @param aSuid, the suid of playlsit |
191 */ |
196 */ |
192 TBool IsExistL( const TDesC& aSuid ); |
197 TBool IsExistL( const TDesC& aSuid ); |
193 |
198 |
194 // related to dummy files |
199 // related to dummy files |
195 /** |
200 /** |
196 * Add one dummy file to dummy files array |
201 * Add one dummy file to dummy files array |
197 */ |
202 */ |
198 IMPORT_C void AddDummyFileL( const TDesC& aDummyFileName ); |
203 IMPORT_C void AddDummyFileL( const TDesC& aDummyFileName ); |
199 |
204 |
200 /** |
205 /** |
201 * Delete one dummy file from dummy files array |
206 * Delete one dummy file from dummy files array |
202 */ |
207 */ |
203 IMPORT_C void DeleteDummyFile( const TDesC& aDummyFileName ); |
208 IMPORT_C void DeleteDummyFile( const TDesC& aDummyFileName ); |
204 |
209 |
205 /** |
210 /** |
206 * Create a Dummy File from the virtual playlist URI |
211 * Create a Dummy File from the virtual playlist URI |
207 * @param aPlaylistName, specify the filename of the dummy file |
212 * @param aPlaylistName, specify the filename of the dummy file |
208 */ |
213 */ |
209 IMPORT_C void CreateDummyFile( const TDesC& aPlaylistName ); |
214 IMPORT_C void CreateDummyFile( const TDesC& aPlaylistName ); |
210 |
215 |
211 private: |
216 private: |
212 |
217 |
213 CMmMtpDpMetadataAccessWrapper( RFs& aRfs, MMTPDataProviderFramework& aFramework ); |
218 CMmMtpDpMetadataAccessWrapper( RFs& aRfs, MMTPDataProviderFramework& aFramework ); |
214 |
219 |
215 void ConstructL(); |
220 void ConstructL(); |
216 |
221 |
217 TMPXGeneralCategory Category( const TUint aFormatCode ); |
222 TMPXGeneralCategory Category( const TUint aFormatCode ); |
218 |
223 |
219 /** |
224 /** |
220 * Remove all dummy file of which format is "pla", and leave the "m3u" |
225 * Remove all dummy file of which format is "pla", and leave the "m3u" |
221 */ |
226 */ |
222 void RemoveDummyFiles(); |
227 void RemoveDummyFiles(); |
223 |
228 |