author | hgs |
Mon, 12 Jul 2010 00:27:06 +0530 | |
changeset 13 | 0a2ec6860a93 |
parent 9 | 4a2987baf8f7 |
child 16 | e918432ddd92 |
permissions | -rw-r--r-- |
0
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
8 |
* |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
11 |
* |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
13 |
* |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
14 |
* Description: MDS to CPIX Audio Document fetcher |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
15 |
* |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
17 |
|
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
18 |
|
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
19 |
#include "cpixmediaaudiodoc.h" |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
20 |
#include <mdeobject.h> |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
21 |
#include <mdccommon.h> |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
22 |
#include <mdeitem.h> |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
23 |
#include <mdeconstants.h> |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
24 |
#include <mdeobjectdef.h> |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
25 |
#include "harvesterserverlogger.h" |
2
208a4ba3894c
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
26 |
#include "OstTraceDefinitions.h" |
5
3bc31ad99ee7
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
2
diff
changeset
|
27 |
#include "csearchdocument.h" |
2
208a4ba3894c
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
28 |
#ifdef OST_TRACE_COMPILER_IN_USE |
208a4ba3894c
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
29 |
#include "cpixmediaaudiodocTraces.h" |
208a4ba3894c
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
30 |
#endif |
208a4ba3894c
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
31 |
|
9 | 32 |
_LIT( KFormatDateTime, "%04d %02d %02d %02d %02d"); // yyyy mm dd hh mm |
33 |
_LIT( KExcerptFormat, "%04d/%02d/%02d %02d:%02d"); |
|
0
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
34 |
// ----------------------------------------------------------------------------- |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
35 |
// CCPIXDocFetcher::NewL() |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
36 |
// ----------------------------------------------------------------------------- |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
37 |
// |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
38 |
CCPIXMediaAudioDoc* CCPIXMediaAudioDoc::NewL() |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
39 |
{ |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
40 |
CCPIXMediaAudioDoc* self = CCPIXMediaAudioDoc::NewLC(); |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
41 |
CleanupStack::Pop(self); |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
42 |
return self; |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
43 |
} |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
44 |
|
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
45 |
// ----------------------------------------------------------------------------- |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
46 |
// CCPIXDocFetcher::NewLC() |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
47 |
// ----------------------------------------------------------------------------- |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
48 |
// |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
49 |
CCPIXMediaAudioDoc* CCPIXMediaAudioDoc::NewLC() |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
50 |
{ |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
51 |
CCPIXMediaAudioDoc* self = new (ELeave) CCPIXMediaAudioDoc(); |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
52 |
CleanupStack::PushL(self); |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
53 |
self->ConstructL(); |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
54 |
return self; |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
55 |
} |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
56 |
|
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
57 |
// ----------------------------------------------------------------------------- |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
58 |
// CCPIXDocFetcher::~CCPIXMediaAudioDoc() |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
59 |
// ----------------------------------------------------------------------------- |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
60 |
// |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
61 |
CCPIXMediaAudioDoc::~CCPIXMediaAudioDoc() |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
62 |
{ |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
63 |
|
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
64 |
} |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
65 |
|
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
66 |
// ----------------------------------------------------------------------------- |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
67 |
// CCPIXDocFetcher::CCPIXMediaAudioDoc() |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
68 |
// ----------------------------------------------------------------------------- |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
69 |
// |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
70 |
CCPIXMediaAudioDoc::CCPIXMediaAudioDoc() |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
71 |
{ |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
72 |
|
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
73 |
} |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
74 |
|
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
75 |
// ----------------------------------------------------------------------------- |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
76 |
// CCPIXDocFetcher::ConstructL() |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
77 |
// ----------------------------------------------------------------------------- |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
78 |
// |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
79 |
void CCPIXMediaAudioDoc::ConstructL() |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
80 |
{ |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
81 |
CCPIXDocFetcher::ConstructL();//Must have |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
82 |
|
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
83 |
} |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
84 |
|
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
85 |
// ----------------------------------------------------------------------------- |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
86 |
// CCPIXDocFetcher::GetCpixDocumentL() |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
87 |
// ----------------------------------------------------------------------------- |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
88 |
// |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
89 |
CSearchDocument* CCPIXMediaAudioDoc::GetCpixDocumentL(const CMdEObject& aObject, |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
90 |
const TDesC& aAppClass, |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
91 |
CMdEObjectDef& aObjectDef) |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
92 |
{ |
2
208a4ba3894c
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
93 |
OstTraceFunctionEntry0( CCPIXMEDIAAUDIODOC_GETCPIXDOCUMENTL_ENTRY ); |
0
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
94 |
CPIXLOGSTRING("START CCPIXMediaAudioDoc::GetCpixDocumentL"); |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
95 |
//Get basic document |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
96 |
CSearchDocument* index_item = CCPIXDocFetcher::GetCpixDocumentL(aObject,aAppClass,aObjectDef); |
5
3bc31ad99ee7
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
2
diff
changeset
|
97 |
//Reset Excerpt and append |
3bc31ad99ee7
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
2
diff
changeset
|
98 |
ResetExcerpt(); |
3bc31ad99ee7
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
2
diff
changeset
|
99 |
TInt slashpos = GetUri().LocateReverse('\\'); |
3bc31ad99ee7
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
2
diff
changeset
|
100 |
TPtrC name = GetUri().Mid( (slashpos+1) ); |
3bc31ad99ee7
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
2
diff
changeset
|
101 |
AddToFieldExcerptL(name); //Add name to excerpt field |
3bc31ad99ee7
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
2
diff
changeset
|
102 |
//additional properties here |
0
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
103 |
CMdEProperty* property(NULL); |
5
3bc31ad99ee7
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
2
diff
changeset
|
104 |
CMdEPropertyDef& artistPropDef1 = aObjectDef.GetPropertyDefL(MdeConstants::MediaObject::KArtistProperty ); |
9 | 105 |
if(aObject.Property( artistPropDef1, property ) != KErrNotFound) |
106 |
{ |
|
107 |
//Add field to document |
|
108 |
CMdETextProperty* textProperty = static_cast< CMdETextProperty* > (property ); |
|
109 |
AddFiledtoDocumentL(*index_item, |
|
110 |
MdeConstants::MediaObject::KArtistProperty, |
|
111 |
textProperty->Value(), |
|
112 |
CDocumentField::EStoreYes | CDocumentField::EIndexTokenized | CDocumentField::EIndexFreeText); |
|
113 |
AddToFieldExcerptL(textProperty->Value());//Add artist to excerpt |
|
114 |
} |
|
0
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
115 |
CMdEPropertyDef& albumPropDef = aObjectDef.GetPropertyDefL(MdeConstants::Audio::KAlbumProperty ); |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
116 |
if(aObject.Property( albumPropDef, property )!= KErrNotFound) |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
117 |
{ |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
118 |
//Add field to document |
9 | 119 |
CMdETextProperty* textProperty = static_cast< CMdETextProperty* > (property); |
0
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
120 |
AddFiledtoDocumentL(*index_item, |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
121 |
MdeConstants::Audio::KAlbumProperty, |
9 | 122 |
textProperty->Value(), |
123 |
CDocumentField::EStoreYes | CDocumentField::EIndexTokenized | CDocumentField::EIndexFreeText); |
|
5
3bc31ad99ee7
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
2
diff
changeset
|
124 |
AddToFieldExcerptL(textProperty->Value());//Add Album to excerpt |
0
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
125 |
} |
9 | 126 |
|
0
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
127 |
CMdEPropertyDef& artistPropDef = aObjectDef.GetPropertyDefL(MdeConstants::Audio::KAlbumArtistProperty ); |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
128 |
if(aObject.Property( artistPropDef, property ) != KErrNotFound) |
9 | 129 |
{ |
130 |
//Add field to document |
|
131 |
CMdETextProperty* textProperty = static_cast< CMdETextProperty* > (property ); |
|
132 |
AddFiledtoDocumentL(*index_item, |
|
133 |
MdeConstants::Audio::KAlbumArtistProperty, |
|
134 |
textProperty->Value(), |
|
135 |
CDocumentField::EStoreYes | CDocumentField::EIndexTokenized | CDocumentField::EIndexFreeText); |
|
136 |
AddToFieldExcerptL(textProperty->Value());//Add Albumartist to excerpt |
|
137 |
} |
|
138 |
//orginal artist property |
|
0
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
139 |
CMdEPropertyDef& origartistPropDef = aObjectDef.GetPropertyDefL(MdeConstants::Audio::KOriginalArtistProperty ); |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
140 |
if(aObject.Property( origartistPropDef, property ) != KErrNotFound) |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
141 |
{ |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
142 |
//Add field to document |
9 | 143 |
CMdETextProperty* textProperty = static_cast< CMdETextProperty* > (property ); |
0
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
144 |
AddFiledtoDocumentL(*index_item, |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
145 |
MdeConstants::Audio::KOriginalArtistProperty, |
9 | 146 |
textProperty->Value(), |
147 |
CDocumentField::EStoreYes | CDocumentField::EIndexTokenized | CDocumentField::EIndexFreeText); |
|
5
3bc31ad99ee7
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
2
diff
changeset
|
148 |
AddToFieldExcerptL(textProperty->Value());//Add Original to excerpt |
9 | 149 |
} |
150 |
//Get composer property |
|
0
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
151 |
CMdEPropertyDef& composerPropDef = aObjectDef.GetPropertyDefL(MdeConstants::Audio::KComposerProperty ); |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
152 |
if(aObject.Property( composerPropDef, property ) != KErrNotFound) |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
153 |
{ |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
154 |
//Add field to document |
9 | 155 |
CMdETextProperty* textProperty = static_cast< CMdETextProperty* > (property ); |
0
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
156 |
AddFiledtoDocumentL(*index_item, |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
157 |
MdeConstants::Audio::KComposerProperty, |
9 | 158 |
textProperty->Value(), |
159 |
CDocumentField::EStoreYes | CDocumentField::EIndexTokenized | CDocumentField::EIndexFreeText); |
|
5
3bc31ad99ee7
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
2
diff
changeset
|
160 |
AddToFieldExcerptL(textProperty->Value());//Add composer to excerpt |
0
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
161 |
} |
9 | 162 |
//Get author property |
163 |
CMdEPropertyDef& authorPropDef = aObjectDef.GetPropertyDefL(MdeConstants::MediaObject::KAuthorProperty ); |
|
164 |
if(aObject.Property( authorPropDef, property ) != KErrNotFound) |
|
165 |
{ |
|
166 |
//Add field to document |
|
167 |
CMdETextProperty* textProperty = static_cast< CMdETextProperty* > (property ); |
|
168 |
AddFiledtoDocumentL(*index_item, |
|
169 |
MdeConstants::MediaObject::KAuthorProperty, |
|
170 |
textProperty->Value(), |
|
171 |
CDocumentField::EStoreYes | CDocumentField::EIndexTokenized | CDocumentField::EIndexFreeText); |
|
172 |
AddToFieldExcerptL(textProperty->Value()); |
|
173 |
} |
|
174 |
//Get comment property |
|
175 |
CMdEPropertyDef& commentPropDef = aObjectDef.GetPropertyDefL(MdeConstants::MediaObject::KCommentProperty ); |
|
176 |
if(aObject.Property( commentPropDef, property ) != KErrNotFound) |
|
177 |
{ |
|
178 |
//Add field to document |
|
179 |
CMdETextProperty* textProperty = static_cast< CMdETextProperty* > (property ); |
|
180 |
AddFiledtoDocumentL(*index_item, |
|
181 |
MdeConstants::MediaObject::KCommentProperty, |
|
182 |
textProperty->Value()); |
|
183 |
AddToFieldExcerptL(textProperty->Value()); |
|
184 |
} |
|
185 |
||
186 |
//Get description property |
|
187 |
CMdEPropertyDef& descriprionPropDef = aObjectDef.GetPropertyDefL(MdeConstants::MediaObject::KDescriptionProperty ); |
|
188 |
if(aObject.Property( descriprionPropDef, property ) != KErrNotFound) |
|
189 |
{ |
|
190 |
//Add field to document |
|
191 |
CMdETextProperty* textProperty = static_cast< CMdETextProperty* > (property ); |
|
192 |
AddFiledtoDocumentL(*index_item, |
|
193 |
MdeConstants::MediaObject::KDescriptionProperty, |
|
194 |
textProperty->Value()); |
|
195 |
AddToFieldExcerptL(textProperty->Value()); |
|
196 |
} |
|
197 |
//Copyright property |
|
198 |
CMdEPropertyDef& copyrightPropDef = aObjectDef.GetPropertyDefL(MdeConstants::MediaObject::KCopyrightProperty ); |
|
199 |
if(aObject.Property( copyrightPropDef, property ) != KErrNotFound) |
|
200 |
{ |
|
201 |
//Add field to document |
|
202 |
CMdETextProperty* textProperty = static_cast< CMdETextProperty* > (property ); |
|
203 |
AddFiledtoDocumentL(*index_item, |
|
204 |
MdeConstants::MediaObject::KCopyrightProperty, |
|
205 |
textProperty->Value()); |
|
206 |
AddToFieldExcerptL(textProperty->Value()); |
|
207 |
} |
|
208 |
//Get genre property |
|
209 |
CMdEPropertyDef& genrePropDef = aObjectDef.GetPropertyDefL(MdeConstants::MediaObject::KGenreProperty ); |
|
210 |
if(aObject.Property( genrePropDef, property ) != KErrNotFound) |
|
211 |
{ |
|
212 |
//Add field to document |
|
213 |
CMdETextProperty* textProperty = static_cast< CMdETextProperty* > (property ); |
|
214 |
AddFiledtoDocumentL(*index_item, |
|
215 |
MdeConstants::MediaObject::KGenreProperty, |
|
216 |
textProperty->Value()); |
|
217 |
AddToFieldExcerptL(textProperty->Value()); |
|
218 |
} |
|
219 |
||
220 |
//Size property |
|
221 |
CMdEPropertyDef& sizePropDef = aObjectDef.GetPropertyDefL(MdeConstants::Object::KSizeProperty); |
|
222 |
if(aObject.Property( sizePropDef, property )!= KErrNotFound) |
|
223 |
{ |
|
13 | 224 |
//Add field to document |
225 |
CMdEUint32Property& sizeProperty = static_cast < CMdEUint32Property& > (*property ); |
|
226 |
TBuf<32> buf; |
|
227 |
buf.Format(_L("%u"), sizeProperty.Value()); |
|
228 |
AddFiledtoDocumentL(*index_item, |
|
229 |
MdeConstants::Object::KSizeProperty, |
|
230 |
buf, |
|
231 |
CDocumentField::EStoreYes | CDocumentField::EIndexUnTokenized); |
|
232 |
AddToFieldExcerptL(buf); |
|
9 | 233 |
} |
234 |
||
235 |
//Get legal property |
|
236 |
CMdEPropertyDef& legalPropDef = aObjectDef.GetPropertyDefL(MdeConstants::MediaObject::KLegalProperty ); |
|
237 |
if(aObject.Property( legalPropDef, property ) != KErrNotFound) |
|
238 |
{ |
|
239 |
//Add field to document |
|
240 |
CMdETextProperty* textProperty = static_cast< CMdETextProperty* > (property ); |
|
241 |
AddFiledtoDocumentL(*index_item, |
|
242 |
MdeConstants::MediaObject::KLegalProperty, |
|
243 |
textProperty->Value()); |
|
244 |
AddToFieldExcerptL(textProperty->Value()); |
|
245 |
} |
|
246 |
//Get track property |
|
247 |
CMdEPropertyDef& trackPropDef = aObjectDef.GetPropertyDefL(MdeConstants::MediaObject::KTrackProperty ); |
|
248 |
if(aObject.Property( trackPropDef, property ) != KErrNotFound) |
|
249 |
{ |
|
250 |
//Add field to document |
|
13 | 251 |
CMdEUint16Property& trackProperty = static_cast < CMdEUint16Property& > (*property ); |
252 |
TBuf<32> buf; |
|
253 |
buf.Format(_L("%d"), trackProperty.Value()); |
|
254 |
AddFiledtoDocumentL(*index_item, |
|
255 |
MdeConstants::MediaObject::KTrackProperty, |
|
256 |
buf); |
|
257 |
||
9 | 258 |
} |
259 |
// Capturedate property |
|
260 |
CMdEPropertyDef& captureDatePropDef = aObjectDef.GetPropertyDefL(MdeConstants::MediaObject::KCaptureDateProperty); |
|
261 |
if(aObject.Property( captureDatePropDef, property ) != KErrNotFound) |
|
262 |
{ |
|
13 | 263 |
//Add field to document |
264 |
CMdETimeProperty& timeProperty = static_cast < CMdETimeProperty& > (*property); |
|
265 |
TDateTime time = timeProperty.Value().DateTime(); |
|
266 |
TBuf<32> buf; |
|
267 |
buf.Format( KFormatDateTime, time.Year(), |
|
268 |
time.Month() + 1, |
|
269 |
time.Day() + 1, |
|
270 |
time.Hour(), |
|
271 |
time.Minute()); |
|
272 |
||
273 |
AddFiledtoDocumentL(*index_item, |
|
274 |
MdeConstants::MediaObject::KCaptureDateProperty, |
|
275 |
buf, |
|
276 |
CDocumentField::EStoreYes | CDocumentField::EIndexUnTokenized); |
|
277 |
||
278 |
//Format for excerpt field |
|
279 |
buf.Format( KExcerptFormat, time.Year(), |
|
280 |
time.Month() + 1, |
|
281 |
time.Day() + 1, |
|
282 |
time.Hour(), |
|
283 |
time.Minute()); |
|
284 |
AddToFieldExcerptL(buf); |
|
9 | 285 |
} |
286 |
//Get LastModifiedDate property |
|
287 |
CMdEPropertyDef& dateTimePropDef = aObjectDef.GetPropertyDefL(MdeConstants::Object::KLastModifiedDateProperty); |
|
288 |
if(aObject.Property( dateTimePropDef, property ) != KErrNotFound) |
|
289 |
{ |
|
13 | 290 |
//Add field to document |
291 |
CMdETimeProperty& timeProperty = static_cast < CMdETimeProperty& > (*property); |
|
292 |
TDateTime time = timeProperty.Value().DateTime(); |
|
293 |
TBuf<32> buf; |
|
294 |
buf.Format( KFormatDateTime, time.Year(), |
|
295 |
time.Month() + 1, |
|
296 |
time.Day() + 1, |
|
297 |
time.Hour(), |
|
9 | 298 |
time.Minute()); |
13 | 299 |
|
300 |
AddFiledtoDocumentL(*index_item, |
|
301 |
MdeConstants::Object::KLastModifiedDateProperty, |
|
302 |
buf, |
|
303 |
CDocumentField::EStoreYes | CDocumentField::EIndexUnTokenized); |
|
304 |
//Format for excerpt field |
|
305 |
buf.Format( KExcerptFormat, time.Year(), |
|
306 |
time.Month() + 1, |
|
307 |
time.Day() + 1, |
|
308 |
time.Hour(), |
|
309 |
time.Minute()); |
|
310 |
AddToFieldExcerptL(buf); |
|
9 | 311 |
} |
312 |
//Get duration property |
|
313 |
CMdEPropertyDef& durationPropDef = aObjectDef.GetPropertyDefL(MdeConstants::MediaObject::KDurationProperty ); |
|
314 |
if(aObject.Property( durationPropDef, property ) != KErrNotFound) |
|
315 |
{ |
|
13 | 316 |
//Add field to document |
317 |
CMdEReal32Property& durationProperty = static_cast < CMdEReal32Property& > (*property ); |
|
318 |
TBuf<32> buf; |
|
319 |
buf.Format(_L("%f"), durationProperty.Value()); |
|
320 |
AddFiledtoDocumentL(*index_item, |
|
321 |
MdeConstants::MediaObject::KDurationProperty, |
|
322 |
buf ); |
|
323 |
||
9 | 324 |
} |
13 | 325 |
|
326 |
index_item->AddExcerptL(*iExcerpt); |
|
327 |
||
0
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
328 |
CPIXLOGSTRING("END CCPIXMediaAudioDoc::GetCpixDocumentL"); |
2
208a4ba3894c
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
329 |
OstTraceFunctionExit0( CCPIXMEDIAAUDIODOC_GETCPIXDOCUMENTL_EXIT ); |
0
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
330 |
return index_item; |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
331 |
} |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
332 |
//End of life |