|
1 /* |
|
2 * Copyright (c) 2007-2007 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 the License "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: Contains music file specific information |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <mclfitem.h> |
|
20 #include <liwgenericparam.h> |
|
21 |
|
22 #include "mgmusicfile.h" |
|
23 |
|
24 |
|
25 _LIT8( KMgSongName, "SongName" ); |
|
26 _LIT8( KMgArtist, "Artist" ); |
|
27 _LIT8( KMgAlbum, "Album" ); |
|
28 _LIT8( KMgGenre, "Genre" ); |
|
29 _LIT8( KMgTrackNumber, "TrackNumber" ); |
|
30 _LIT8( KMgComposer, "Composer" ); |
|
31 |
|
32 |
|
33 const TInt KMGServiceMaxTIntLength = 11; |
|
34 |
|
35 // --------------------------------------------------------------------------- |
|
36 // CMgMusicFile::NewL |
|
37 // Two-phased constructor |
|
38 // --------------------------------------------------------------------------- |
|
39 // |
|
40 |
|
41 CMgMusicFile* CMgMusicFile::NewL() |
|
42 { |
|
43 return new( ELeave ) CMgMusicFile(); |
|
44 } |
|
45 |
|
46 |
|
47 // --------------------------------------------------------------------------- |
|
48 // CMgMusicFile::FillInfoL |
|
49 // Fills the attributes specific to music files |
|
50 // --------------------------------------------------------------------------- |
|
51 // |
|
52 void CMgMusicFile::FillInfoL( CLiwDefaultMap *aOutputMap, const MCLFItem& aClfItem ) |
|
53 { |
|
54 |
|
55 TPtrC artist; // artist name |
|
56 TPtrC songName; // songname |
|
57 TBuf<KMGServiceMaxTIntLength> trackNumber; // track number |
|
58 TPtrC album; // album of the song |
|
59 TPtrC genre; // song genre |
|
60 TPtrC composer; // song composer |
|
61 TInt32 trackNo( 0 ); |
|
62 |
|
63 //Calling base class function for comman attributes |
|
64 FillCommonAttributesL( aOutputMap, aClfItem ); |
|
65 |
|
66 aClfItem.GetField( ECLFFieldIdArtist, artist ); |
|
67 aClfItem.GetField( ECLFFieldIdSongName, songName ); |
|
68 |
|
69 |
|
70 if( KErrNone == aClfItem.GetField( ECLFFieldIdTrackNumber, trackNo ) ) |
|
71 { |
|
72 trackNumber.Num( trackNo ); |
|
73 } |
|
74 |
|
75 aClfItem.GetField( ECLFFieldIdAlbum, album ); |
|
76 aClfItem.GetField( ECLFFieldIdGenre, genre ); |
|
77 aClfItem.GetField( ECLFFieldIdComposer, composer ); |
|
78 aOutputMap->InsertL( KMgArtist,TLiwVariant( artist ) ); |
|
79 aOutputMap->InsertL( KMgSongName,TLiwVariant( songName) ); |
|
80 aOutputMap->InsertL( KMgTrackNumber,TLiwVariant( trackNumber) ); |
|
81 aOutputMap->InsertL( KMgAlbum,TLiwVariant( album) ); |
|
82 aOutputMap->InsertL( KMgGenre,TLiwVariant( genre) ); |
|
83 aOutputMap->InsertL( KMgComposer,TLiwVariant( composer) ); |
|
84 } |
|
85 |
|
86 |
|
87 |
|
88 |
|
89 |
|
90 |
|
91 |
|
92 |