author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 24 Nov 2009 08:56:33 +0200 | |
changeset 33 | 50974a8b132e |
parent 19 | 989d2f495d90 |
permissions | -rw-r--r-- |
19 | 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 |
||
33
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
20 |
#include <MCLFItem.h> |
19 | 21 |
|
22 |
#include <liwgenericparam.h> |
|
23 |
#include "mgmusicfile.h" |
|
24 |
||
25 |
||
26 |
||
27 |
_LIT8( KMgSongName, "SongName" ); |
|
28 |
_LIT8( KMgArtist, "Artist" ); |
|
29 |
_LIT8( KMgAlbum, "Album" ); |
|
30 |
_LIT8( KMgGenre, "Genre" ); |
|
31 |
_LIT8( KMgTrackNumber, "TrackNumber" ); |
|
32 |
_LIT8( KMgComposer, "Composer" ); |
|
33 |
||
34 |
||
35 |
const TInt KMGServiceMaxTIntLength = 11; |
|
36 |
||
37 |
// --------------------------------------------------------------------------- |
|
38 |
// CMgMusicFile::NewL |
|
39 |
// Two-phased constructor |
|
40 |
// --------------------------------------------------------------------------- |
|
41 |
// |
|
42 |
||
43 |
CMgMusicFile* CMgMusicFile::NewL() |
|
44 |
{ |
|
45 |
CMgMusicFile* self = new( ELeave ) CMgMusicFile(); |
|
46 |
return self; |
|
47 |
} |
|
48 |
||
49 |
||
50 |
// --------------------------------------------------------------------------- |
|
51 |
// CMgMusicFile::FillInfo |
|
52 |
// Fills the attributes specific to music files |
|
53 |
// --------------------------------------------------------------------------- |
|
54 |
// |
|
55 |
void CMgMusicFile::FillInfo( CLiwDefaultMap *aOutputMap, const MCLFItem& aClfItem ) |
|
56 |
{ |
|
57 |
||
58 |
TPtrC artist; // artist name |
|
59 |
TPtrC songName; // songname |
|
60 |
TBuf<KMGServiceMaxTIntLength> trackNumber; // track number |
|
61 |
TPtrC album; // album of the song |
|
62 |
TPtrC genre; // song genre |
|
63 |
TPtrC composer; // song composer |
|
64 |
FillCommonAttributes( aOutputMap, aClfItem ); |
|
65 |
aClfItem.GetField( ECLFFieldIdArtist, artist ); |
|
66 |
aClfItem.GetField( ECLFFieldIdSongName, songName ); |
|
67 |
TInt32 trackNo( 0 ); |
|
68 |
if( KErrNone == aClfItem.GetField( ECLFFieldIdTrackNumber, trackNo ) ) |
|
69 |
{ |
|
70 |
trackNumber.Num( trackNo ); |
|
71 |
} |
|
72 |
aClfItem.GetField( ECLFFieldIdAlbum, album ); |
|
73 |
aClfItem.GetField( ECLFFieldIdGenre, genre ); |
|
74 |
aClfItem.GetField( ECLFFieldIdComposer, composer ); |
|
75 |
aOutputMap->InsertL( KMgArtist,TLiwVariant( artist ) ); |
|
76 |
aOutputMap->InsertL( KMgSongName,TLiwVariant( songName) ); |
|
77 |
aOutputMap->InsertL( KMgTrackNumber,TLiwVariant( trackNumber) ); |
|
78 |
aOutputMap->InsertL( KMgAlbum,TLiwVariant( album) ); |
|
79 |
aOutputMap->InsertL( KMgGenre,TLiwVariant( genre) ); |
|
80 |
aOutputMap->InsertL( KMgComposer,TLiwVariant( composer) ); |
|
81 |
} |
|
82 |
||
83 |
||
84 |
||
85 |
||
86 |
||
87 |
||
88 |
||
89 |