|
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: MPX album art utility |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CMPXALBUMARTUTIL_H |
|
20 #define CMPXALBUMARTUTIL_H |
|
21 |
|
22 #include <gdi.h> |
|
23 #include <metadatafield.hrh> |
|
24 #include <thumbnailmanager.h> |
|
25 #include <thumbnailmanagerobserver.h> |
|
26 |
|
27 class CMPXMedia; |
|
28 class MMPXAlbumArtUtilObserver; |
|
29 class CMPXImageUtil; |
|
30 class CRepository; |
|
31 /** |
|
32 * Music Player common utility class |
|
33 */ |
|
34 class CMPXAlbumArtUtil: public CBase, public MThumbnailManagerObserver |
|
35 { |
|
36 public: |
|
37 /** |
|
38 * Two phased contructor |
|
39 */ |
|
40 IMPORT_C static CMPXAlbumArtUtil* NewL(); |
|
41 |
|
42 /** |
|
43 * Destuctor |
|
44 */ |
|
45 IMPORT_C ~CMPXAlbumArtUtil(); |
|
46 |
|
47 /** |
|
48 * Extract album art data, |
|
49 * |
|
50 * @since S60 3.2.3 |
|
51 * @param aProp media property. the media must contain the following |
|
52 * attributes: |
|
53 * TMPXAttribute( KMPXMediaIdMusic, EMPXMediaMusicAlbumArtFileName ) |
|
54 * TMPXAttribute( KMPXMediaIdGeneral, EMPXMediaGeneralUri ) |
|
55 * @param aObs callback after the operation completed. |
|
56 * @param aSize The size of the required destination BMP. |
|
57 * @param aDisplayMode the display mode of the destination BMP |
|
58 * @return bitmap object |
|
59 */ |
|
60 IMPORT_C void ExtractAlbumArtL(const CMPXMedia& aProp, |
|
61 MMPXAlbumArtUtilObserver& aObs, |
|
62 const TSize& aSize, |
|
63 TDisplayMode aDisplayMode = EColor64K); |
|
64 |
|
65 /** |
|
66 * Cancel outstanding asynch requests |
|
67 * @since S60 3.2.3 |
|
68 */ |
|
69 IMPORT_C void CancelRequest(); |
|
70 |
|
71 |
|
72 public: // from base class MThumbnailManagerObserver |
|
73 |
|
74 /** |
|
75 * From MThumbnailManagerObserver |
|
76 * Preview thumbnail generation or loading is complete. |
|
77 * |
|
78 * @param aThumbnail An object representing the resulting thumbnail. |
|
79 * @param aId Request ID for the operation |
|
80 */ |
|
81 void ThumbnailPreviewReady( MThumbnailData& aThumbnail, TThumbnailRequestId aId ); |
|
82 |
|
83 /** |
|
84 * From MThumbnailManagerObserver |
|
85 * Final thumbnail bitmap generation or loading is complete. |
|
86 * |
|
87 * @param aError Error code. |
|
88 * @param aThumbnail An object representing the resulting thumbnail. |
|
89 * @param aId Request ID for the operation. |
|
90 */ |
|
91 void ThumbnailReady( TInt aError, MThumbnailData& aThumbnail, TThumbnailRequestId aId ); |
|
92 |
|
93 private: |
|
94 /** |
|
95 * C++ constructor |
|
96 */ |
|
97 CMPXAlbumArtUtil(); |
|
98 |
|
99 /** |
|
100 * Second phase constructor |
|
101 * |
|
102 */ |
|
103 void ConstructL(); |
|
104 |
|
105 /** |
|
106 * Extract binary meta data from file |
|
107 * |
|
108 * @since S60 3.2.3 |
|
109 * @param aFileName file name |
|
110 * @param aFieldId metadata field id |
|
111 * |
|
112 */ |
|
113 HBufC8* ExtractBinaryMetaDataLC(const TDesC& aFilename, |
|
114 TMetaDataFieldId aFieldId); |
|
115 |
|
116 /** ----------------------------------------------------------------------------- |
|
117 * Extract Thumbnail for the current song |
|
118 * ----------------------------------------------------------------------------- |
|
119 */ |
|
120 void ExtractThumbnailL( const CMPXMedia* aMedia); |
|
121 |
|
122 private: |
|
123 CMPXImageUtil* iArtUtil; |
|
124 CThumbnailManager* iThumbnailManager; // Owned |
|
125 TDisplayMode iDisplayMode ; //Owned |
|
126 TSize iImageSize; |
|
127 TSize iFullScreenImageSize; |
|
128 TSize iGridViewImageSize; |
|
129 TInt iReqId; |
|
130 HBufC* iFilename; |
|
131 MMPXAlbumArtUtilObserver* iObserver; |
|
132 }; |
|
133 |
|
134 #endif // CMPXALBUMARTUTIL_H |
|
135 |
|
136 // End of File |