author | hgs |
Tue, 31 Aug 2010 17:25:42 +0530 | |
changeset 19 | 08315a312857 |
parent 18 | 1edf350003c5 |
child 26 | 367228f82b66 |
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 |
} |
|
16 | 115 |
#ifdef USE_HIGHLIGHTER |
18 | 116 |
/*//Get the media file extension and store |
16 | 117 |
TBuf<KMaxExtLength> extension; |
118 |
GetExtension(aObject.Uri(),extension); |
|
18 | 119 |
AddToFieldExcerptL(extension);*/ |
120 |
//Adding title to first line of highlighter |
|
121 |
CMdEPropertyDef& titlePropDef = aObjectDef.GetPropertyDefL(MdeConstants::Object::KTitleProperty ); |
|
122 |
if(aObject.Property( titlePropDef, property ) != KErrNotFound) |
|
123 |
{ |
|
124 |
//Add field to document |
|
125 |
CMdETextProperty* textProperty = static_cast< CMdETextProperty* > (property ); |
|
126 |
if(textProperty->Value() != KNullDesC) |
|
127 |
{ |
|
128 |
index_item->AddHLDisplayFieldL(textProperty->Value()); |
|
129 |
} |
|
130 |
} |
|
16 | 131 |
#endif |
0
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
132 |
CMdEPropertyDef& albumPropDef = aObjectDef.GetPropertyDefL(MdeConstants::Audio::KAlbumProperty ); |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
133 |
if(aObject.Property( albumPropDef, property )!= KErrNotFound) |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
134 |
{ |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
135 |
//Add field to document |
9 | 136 |
CMdETextProperty* textProperty = static_cast< CMdETextProperty* > (property); |
0
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
137 |
AddFiledtoDocumentL(*index_item, |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
138 |
MdeConstants::Audio::KAlbumProperty, |
9 | 139 |
textProperty->Value(), |
140 |
CDocumentField::EStoreYes | CDocumentField::EIndexTokenized | CDocumentField::EIndexFreeText); |
|
5
3bc31ad99ee7
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
2
diff
changeset
|
141 |
AddToFieldExcerptL(textProperty->Value());//Add Album to excerpt |
0
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
142 |
} |
9 | 143 |
|
0
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
144 |
CMdEPropertyDef& artistPropDef = aObjectDef.GetPropertyDefL(MdeConstants::Audio::KAlbumArtistProperty ); |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
145 |
if(aObject.Property( artistPropDef, property ) != KErrNotFound) |
9 | 146 |
{ |
147 |
//Add field to document |
|
148 |
CMdETextProperty* textProperty = static_cast< CMdETextProperty* > (property ); |
|
149 |
AddFiledtoDocumentL(*index_item, |
|
150 |
MdeConstants::Audio::KAlbumArtistProperty, |
|
151 |
textProperty->Value(), |
|
152 |
CDocumentField::EStoreYes | CDocumentField::EIndexTokenized | CDocumentField::EIndexFreeText); |
|
153 |
AddToFieldExcerptL(textProperty->Value());//Add Albumartist to excerpt |
|
154 |
} |
|
155 |
//orginal artist property |
|
0
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
156 |
CMdEPropertyDef& origartistPropDef = aObjectDef.GetPropertyDefL(MdeConstants::Audio::KOriginalArtistProperty ); |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
157 |
if(aObject.Property( origartistPropDef, property ) != KErrNotFound) |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
158 |
{ |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
159 |
//Add field to document |
9 | 160 |
CMdETextProperty* textProperty = static_cast< CMdETextProperty* > (property ); |
0
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
161 |
AddFiledtoDocumentL(*index_item, |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
162 |
MdeConstants::Audio::KOriginalArtistProperty, |
9 | 163 |
textProperty->Value(), |
164 |
CDocumentField::EStoreYes | CDocumentField::EIndexTokenized | CDocumentField::EIndexFreeText); |
|
5
3bc31ad99ee7
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
2
diff
changeset
|
165 |
AddToFieldExcerptL(textProperty->Value());//Add Original to excerpt |
9 | 166 |
} |
167 |
//Get composer property |
|
0
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
168 |
CMdEPropertyDef& composerPropDef = aObjectDef.GetPropertyDefL(MdeConstants::Audio::KComposerProperty ); |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
169 |
if(aObject.Property( composerPropDef, property ) != KErrNotFound) |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
170 |
{ |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
171 |
//Add field to document |
9 | 172 |
CMdETextProperty* textProperty = static_cast< CMdETextProperty* > (property ); |
0
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
173 |
AddFiledtoDocumentL(*index_item, |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
174 |
MdeConstants::Audio::KComposerProperty, |
9 | 175 |
textProperty->Value(), |
176 |
CDocumentField::EStoreYes | CDocumentField::EIndexTokenized | CDocumentField::EIndexFreeText); |
|
5
3bc31ad99ee7
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
2
diff
changeset
|
177 |
AddToFieldExcerptL(textProperty->Value());//Add composer to excerpt |
0
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
178 |
} |
9 | 179 |
//Get author property |
180 |
CMdEPropertyDef& authorPropDef = aObjectDef.GetPropertyDefL(MdeConstants::MediaObject::KAuthorProperty ); |
|
181 |
if(aObject.Property( authorPropDef, property ) != KErrNotFound) |
|
182 |
{ |
|
183 |
//Add field to document |
|
184 |
CMdETextProperty* textProperty = static_cast< CMdETextProperty* > (property ); |
|
185 |
AddFiledtoDocumentL(*index_item, |
|
186 |
MdeConstants::MediaObject::KAuthorProperty, |
|
187 |
textProperty->Value(), |
|
188 |
CDocumentField::EStoreYes | CDocumentField::EIndexTokenized | CDocumentField::EIndexFreeText); |
|
189 |
AddToFieldExcerptL(textProperty->Value()); |
|
190 |
} |
|
191 |
//Get comment property |
|
192 |
CMdEPropertyDef& commentPropDef = aObjectDef.GetPropertyDefL(MdeConstants::MediaObject::KCommentProperty ); |
|
193 |
if(aObject.Property( commentPropDef, property ) != KErrNotFound) |
|
194 |
{ |
|
195 |
//Add field to document |
|
196 |
CMdETextProperty* textProperty = static_cast< CMdETextProperty* > (property ); |
|
197 |
AddFiledtoDocumentL(*index_item, |
|
198 |
MdeConstants::MediaObject::KCommentProperty, |
|
199 |
textProperty->Value()); |
|
200 |
AddToFieldExcerptL(textProperty->Value()); |
|
201 |
} |
|
202 |
||
203 |
//Get description property |
|
204 |
CMdEPropertyDef& descriprionPropDef = aObjectDef.GetPropertyDefL(MdeConstants::MediaObject::KDescriptionProperty ); |
|
205 |
if(aObject.Property( descriprionPropDef, property ) != KErrNotFound) |
|
206 |
{ |
|
207 |
//Add field to document |
|
208 |
CMdETextProperty* textProperty = static_cast< CMdETextProperty* > (property ); |
|
209 |
AddFiledtoDocumentL(*index_item, |
|
210 |
MdeConstants::MediaObject::KDescriptionProperty, |
|
211 |
textProperty->Value()); |
|
212 |
AddToFieldExcerptL(textProperty->Value()); |
|
213 |
} |
|
214 |
//Copyright property |
|
215 |
CMdEPropertyDef& copyrightPropDef = aObjectDef.GetPropertyDefL(MdeConstants::MediaObject::KCopyrightProperty ); |
|
216 |
if(aObject.Property( copyrightPropDef, property ) != KErrNotFound) |
|
217 |
{ |
|
218 |
//Add field to document |
|
219 |
CMdETextProperty* textProperty = static_cast< CMdETextProperty* > (property ); |
|
220 |
AddFiledtoDocumentL(*index_item, |
|
221 |
MdeConstants::MediaObject::KCopyrightProperty, |
|
222 |
textProperty->Value()); |
|
223 |
AddToFieldExcerptL(textProperty->Value()); |
|
224 |
} |
|
225 |
//Get genre property |
|
226 |
CMdEPropertyDef& genrePropDef = aObjectDef.GetPropertyDefL(MdeConstants::MediaObject::KGenreProperty ); |
|
227 |
if(aObject.Property( genrePropDef, property ) != KErrNotFound) |
|
228 |
{ |
|
229 |
//Add field to document |
|
230 |
CMdETextProperty* textProperty = static_cast< CMdETextProperty* > (property ); |
|
231 |
AddFiledtoDocumentL(*index_item, |
|
232 |
MdeConstants::MediaObject::KGenreProperty, |
|
233 |
textProperty->Value()); |
|
234 |
AddToFieldExcerptL(textProperty->Value()); |
|
235 |
} |
|
236 |
||
237 |
//Size property |
|
238 |
CMdEPropertyDef& sizePropDef = aObjectDef.GetPropertyDefL(MdeConstants::Object::KSizeProperty); |
|
239 |
if(aObject.Property( sizePropDef, property )!= KErrNotFound) |
|
240 |
{ |
|
13 | 241 |
//Add field to document |
242 |
CMdEUint32Property& sizeProperty = static_cast < CMdEUint32Property& > (*property ); |
|
243 |
TBuf<32> buf; |
|
244 |
buf.Format(_L("%u"), sizeProperty.Value()); |
|
245 |
AddFiledtoDocumentL(*index_item, |
|
246 |
MdeConstants::Object::KSizeProperty, |
|
247 |
buf, |
|
248 |
CDocumentField::EStoreYes | CDocumentField::EIndexUnTokenized); |
|
249 |
AddToFieldExcerptL(buf); |
|
9 | 250 |
} |
251 |
||
252 |
//Get legal property |
|
253 |
CMdEPropertyDef& legalPropDef = aObjectDef.GetPropertyDefL(MdeConstants::MediaObject::KLegalProperty ); |
|
254 |
if(aObject.Property( legalPropDef, property ) != KErrNotFound) |
|
255 |
{ |
|
256 |
//Add field to document |
|
257 |
CMdETextProperty* textProperty = static_cast< CMdETextProperty* > (property ); |
|
258 |
AddFiledtoDocumentL(*index_item, |
|
259 |
MdeConstants::MediaObject::KLegalProperty, |
|
260 |
textProperty->Value()); |
|
261 |
AddToFieldExcerptL(textProperty->Value()); |
|
262 |
} |
|
263 |
//Get track property |
|
264 |
CMdEPropertyDef& trackPropDef = aObjectDef.GetPropertyDefL(MdeConstants::MediaObject::KTrackProperty ); |
|
265 |
if(aObject.Property( trackPropDef, property ) != KErrNotFound) |
|
266 |
{ |
|
267 |
//Add field to document |
|
13 | 268 |
CMdEUint16Property& trackProperty = static_cast < CMdEUint16Property& > (*property ); |
269 |
TBuf<32> buf; |
|
270 |
buf.Format(_L("%d"), trackProperty.Value()); |
|
271 |
AddFiledtoDocumentL(*index_item, |
|
272 |
MdeConstants::MediaObject::KTrackProperty, |
|
273 |
buf); |
|
274 |
||
9 | 275 |
} |
276 |
// Capturedate property |
|
277 |
CMdEPropertyDef& captureDatePropDef = aObjectDef.GetPropertyDefL(MdeConstants::MediaObject::KCaptureDateProperty); |
|
278 |
if(aObject.Property( captureDatePropDef, property ) != KErrNotFound) |
|
279 |
{ |
|
13 | 280 |
//Add field to document |
281 |
CMdETimeProperty& timeProperty = static_cast < CMdETimeProperty& > (*property); |
|
282 |
TDateTime time = timeProperty.Value().DateTime(); |
|
283 |
TBuf<32> buf; |
|
284 |
buf.Format( KFormatDateTime, time.Year(), |
|
285 |
time.Month() + 1, |
|
286 |
time.Day() + 1, |
|
287 |
time.Hour(), |
|
288 |
time.Minute()); |
|
289 |
||
290 |
AddFiledtoDocumentL(*index_item, |
|
291 |
MdeConstants::MediaObject::KCaptureDateProperty, |
|
292 |
buf, |
|
293 |
CDocumentField::EStoreYes | CDocumentField::EIndexUnTokenized); |
|
294 |
||
295 |
//Format for excerpt field |
|
296 |
buf.Format( KExcerptFormat, time.Year(), |
|
297 |
time.Month() + 1, |
|
298 |
time.Day() + 1, |
|
299 |
time.Hour(), |
|
300 |
time.Minute()); |
|
301 |
AddToFieldExcerptL(buf); |
|
9 | 302 |
} |
303 |
//Get LastModifiedDate property |
|
304 |
CMdEPropertyDef& dateTimePropDef = aObjectDef.GetPropertyDefL(MdeConstants::Object::KLastModifiedDateProperty); |
|
305 |
if(aObject.Property( dateTimePropDef, property ) != KErrNotFound) |
|
306 |
{ |
|
13 | 307 |
//Add field to document |
308 |
CMdETimeProperty& timeProperty = static_cast < CMdETimeProperty& > (*property); |
|
309 |
TDateTime time = timeProperty.Value().DateTime(); |
|
310 |
TBuf<32> buf; |
|
311 |
buf.Format( KFormatDateTime, time.Year(), |
|
312 |
time.Month() + 1, |
|
313 |
time.Day() + 1, |
|
314 |
time.Hour(), |
|
9 | 315 |
time.Minute()); |
13 | 316 |
|
317 |
AddFiledtoDocumentL(*index_item, |
|
318 |
MdeConstants::Object::KLastModifiedDateProperty, |
|
319 |
buf, |
|
320 |
CDocumentField::EStoreYes | CDocumentField::EIndexUnTokenized); |
|
321 |
//Format for excerpt field |
|
322 |
buf.Format( KExcerptFormat, time.Year(), |
|
323 |
time.Month() + 1, |
|
324 |
time.Day() + 1, |
|
325 |
time.Hour(), |
|
326 |
time.Minute()); |
|
327 |
AddToFieldExcerptL(buf); |
|
9 | 328 |
} |
329 |
//Get duration property |
|
330 |
CMdEPropertyDef& durationPropDef = aObjectDef.GetPropertyDefL(MdeConstants::MediaObject::KDurationProperty ); |
|
331 |
if(aObject.Property( durationPropDef, property ) != KErrNotFound) |
|
332 |
{ |
|
13 | 333 |
//Add field to document |
334 |
CMdEReal32Property& durationProperty = static_cast < CMdEReal32Property& > (*property ); |
|
335 |
TBuf<32> buf; |
|
336 |
buf.Format(_L("%f"), durationProperty.Value()); |
|
337 |
AddFiledtoDocumentL(*index_item, |
|
338 |
MdeConstants::MediaObject::KDurationProperty, |
|
339 |
buf ); |
|
340 |
||
9 | 341 |
} |
13 | 342 |
|
343 |
index_item->AddExcerptL(*iExcerpt); |
|
344 |
||
0
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
345 |
CPIXLOGSTRING("END CCPIXMediaAudioDoc::GetCpixDocumentL"); |
2
208a4ba3894c
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
346 |
OstTraceFunctionExit0( CCPIXMEDIAAUDIODOC_GETCPIXDOCUMENTL_EXIT ); |
0
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
347 |
return index_item; |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
348 |
} |
ccd0fd43f247
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
349 |
//End of life |