equal
deleted
inserted
replaced
17 |
17 |
18 |
18 |
19 #include "mediaplugin.h" |
19 #include "mediaplugin.h" |
20 |
20 |
21 #include <e32base.h> |
21 #include <e32base.h> |
22 |
22 #include <s32file.h> |
|
23 #include <bautils.h> |
23 #include "harvesterserverlogger.h" |
24 #include "harvesterserverlogger.h" |
24 #include "common.h" |
25 #include "common.h" |
25 #include "csearchdocument.h" |
26 #include "csearchdocument.h" |
26 #include "ccpixindexer.h" |
27 #include "ccpixindexer.h" |
27 #include "mdeharvester.h" |
28 #include "mdeharvester.h" |
39 #endif |
40 #endif |
40 |
41 |
41 |
42 |
42 //Constants |
43 //Constants |
43 _LIT(KPathTrailer, "\\root\\media\\audio"); |
44 _LIT(KPathTrailer, "\\root\\media\\audio"); |
|
45 _LIT(KManagerFileName, "AudioStore.temp"); |
44 |
46 |
45 //***** MEDAI AUDIO***** |
47 //***** MEDAI AUDIO***** |
46 #define MEDIA_QBASEAPPCLASS "@0:root media audio" |
48 #define MEDIA_QBASEAPPCLASS "@0:root media audio" |
47 #define LMEDIA_QBASEAPPCLASS L"@0:root media audio" |
49 #define LMEDIA_QBASEAPPCLASS L"@0:root media audio" |
48 #define MEDIAAPPCLASS "root media audio" |
50 #define MEDIAAPPCLASS "root media audio" |
50 |
52 |
51 #define MEDIAGENERICAPPCLASS ":root media audio" |
53 #define MEDIAGENERICAPPCLASS ":root media audio" |
52 #define LMEDIAGENERICAPPCLASS L":root media audio" |
54 #define LMEDIAGENERICAPPCLASS L":root media audio" |
53 #define DATABASEPATH "\\root\\media\\audio" |
55 #define DATABASEPATH "\\root\\media\\audio" |
54 #define LDATABASEPATH "\\root\\media\\audio" |
56 #define LDATABASEPATH "\\root\\media\\audio" |
|
57 |
55 |
58 |
56 // ----------------------------------------------------------------------------- |
59 // ----------------------------------------------------------------------------- |
57 CAudioPlugin* CAudioPlugin::NewL() |
60 CAudioPlugin* CAudioPlugin::NewL() |
58 { |
61 { |
59 CAudioPlugin* instance = CAudioPlugin::NewLC(); |
62 CAudioPlugin* instance = CAudioPlugin::NewLC(); |
92 TRAP_IGNORE(iIndexerUtil->UnMountAllDrivesL(_L(MEDIAGENERICAPPCLASS))); |
95 TRAP_IGNORE(iIndexerUtil->UnMountAllDrivesL(_L(MEDIAGENERICAPPCLASS))); |
93 delete iIndexerUtil; |
96 delete iIndexerUtil; |
94 delete iMMcMonitor; |
97 delete iMMcMonitor; |
95 delete iDBManager; |
98 delete iDBManager; |
96 delete iMdsItem; |
99 delete iMdsItem; |
|
100 iFs.Close(); |
97 } |
101 } |
98 |
102 |
99 // ----------------------------------------------------------------------------- |
103 // ----------------------------------------------------------------------------- |
100 void CAudioPlugin::ConstructL() |
104 void CAudioPlugin::ConstructL() |
101 { |
105 { |
102 iObjectJobQueueManager = CMdeObjectQueueManager::NewL(this); |
106 iObjectJobQueueManager = CMdeObjectQueueManager::NewL(this); |
|
107 // connect to file system |
|
108 User::LeaveIfError(iFs.Connect()); |
|
109 // Load the configuration |
|
110 TFileName pathWithoutDrive; |
|
111 iFs.CreatePrivatePath(EDriveC); |
|
112 iFilePath = _L("C:"); |
|
113 iFs.PrivatePath( pathWithoutDrive ); |
|
114 iFilePath.Append(pathWithoutDrive); |
|
115 iFilePath.Append(KManagerFileName); |
|
116 iObjectJobQueueManager->SetFilePath(iFilePath); |
103 } |
117 } |
104 |
118 |
105 // ----------------------------------------------------------------------------- |
119 // ----------------------------------------------------------------------------- |
106 void CAudioPlugin::StartPluginL() |
120 void CAudioPlugin::StartPluginL() |
107 { |
121 { |
128 // Start harvester for this plugin |
142 // Start harvester for this plugin |
129 iObserver->AddHarvestingQueue(this, _L(MEDIA_QBASEAPPCLASS) ); |
143 iObserver->AddHarvestingQueue(this, _L(MEDIA_QBASEAPPCLASS) ); |
130 TUid uidOfPlugin = {0x20029AB9}; |
144 TUid uidOfPlugin = {0x20029AB9}; |
131 iDBManager = CCPIXMDEDbManager::NewL(uidOfPlugin); |
145 iDBManager = CCPIXMDEDbManager::NewL(uidOfPlugin); |
132 iMdsItem = CMDSEntity::NewL(); |
146 iMdsItem = CMDSEntity::NewL(); |
|
147 if( BaflUtils::FileExists(iFs,iFilePath) ) |
|
148 LoadL(); |
133 OstTraceFunctionExit0( CAUDIOPLUGIN_STARTPLUGINL_EXIT ); |
149 OstTraceFunctionExit0( CAUDIOPLUGIN_STARTPLUGINL_EXIT ); |
134 } |
150 } |
135 |
151 |
136 void CAudioPlugin::HarvestingCompletedL() |
152 void CAudioPlugin::HarvestingCompletedL() |
137 { |
153 { |
332 } |
348 } |
333 } |
349 } |
334 |
350 |
335 void CAudioPlugin::PausePluginL() |
351 void CAudioPlugin::PausePluginL() |
336 { |
352 { |
337 OstTraceFunctionEntry0( CAUDIOPLUGIN_PAUSEPLUGINL_ENTRY ); |
353 OstTraceFunctionEntry0( CAUDIOPLUGIN_PAUSEPLUGINL_ENTRY ); |
338 iObjectJobQueueManager->PauseL(); |
354 iObjectJobQueueManager->PauseL(); |
339 OstTraceFunctionExit0( CAUDIOPLUGIN_PAUSEPLUGINL_EXIT ); |
355 OstTraceFunctionExit0( CAUDIOPLUGIN_PAUSEPLUGINL_EXIT ); |
340 } |
356 } |
341 |
357 |
342 void CAudioPlugin::ResumePluginL() |
358 void CAudioPlugin::ResumePluginL() |
343 { |
359 { |
344 OstTraceFunctionEntry0( CAUDIOPLUGIN_RESUMEPLUGINL_ENTRY ); |
360 OstTraceFunctionEntry0( CAUDIOPLUGIN_RESUMEPLUGINL_ENTRY ); |
345 iObjectJobQueueManager->ResumeL(); |
361 iObjectJobQueueManager->ResumeL(); |
346 OstTraceFunctionExit0( CAUDIOPLUGIN_RESUMEPLUGINL_EXIT ); |
362 OstTraceFunctionExit0( CAUDIOPLUGIN_RESUMEPLUGINL_EXIT ); |
|
363 } |
|
364 |
|
365 void CAudioPlugin::LoadL() |
|
366 { |
|
367 iObjectJobQueueManager->LoadQueuedItems(); |
|
368 } |
|
369 |
|
370 void CAudioPlugin::SaveL() |
|
371 { |
|
372 iObjectJobQueueManager->SaveQueuedItems(); |
347 } |
373 } |
348 |
374 |
349 #ifdef __PERFORMANCE_DATA |
375 #ifdef __PERFORMANCE_DATA |
350 void CAudioPlugin::UpdateLogL() |
376 void CAudioPlugin::UpdateLogL() |
351 { |
377 { |