# HG changeset patch
# User hgs
# Date 1270153335 -10800
# Node ID bbb98528c666fc3027b43116995f476ee8410885
# Parent 48e74db5d5164d9404fbfd34d4b535316dce466f
201009
diff -r 48e74db5d516 -r bbb98528c666 inc/mpxvideoplayercustomviewmsgconsts.h
--- a/inc/mpxvideoplayercustomviewmsgconsts.h Thu Apr 01 23:13:36 2010 +0300
+++ b/inc/mpxvideoplayercustomviewmsgconsts.h Thu Apr 01 23:22:15 2010 +0300
@@ -15,7 +15,7 @@
*/
-// Version : %version: 2 %
+// Version : %version: da1mmcf#3 %
#ifndef __MPXVIDEOPLAYERCUSTOMVIEWMSGCONSTS_H__
#define __MPXVIDEOPLAYERCUSTOMVIEWMSGCONSTS_H__
@@ -29,4 +29,7 @@
const TInt KVcxCustomViewMessagePtr = 0x200211F9;
+const TInt KMpxVideoPlaybackPdlReloading = 0x20024339;
+
+
#endif // __MPXVIDEOPLAYERCUSTOMVIEWMSGCONSTS_H__
diff -r 48e74db5d516 -r bbb98528c666 layers.sysdef.xml
--- a/layers.sysdef.xml Thu Apr 01 23:13:36 2010 +0300
+++ b/layers.sysdef.xml Thu Apr 01 23:22:15 2010 +0300
@@ -14,8 +14,23 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -26,4 +41,4 @@
-
\ No newline at end of file
+
diff -r 48e74db5d516 -r bbb98528c666 mediasettings/group/bld.inf
--- a/mediasettings/group/bld.inf Thu Apr 01 23:13:36 2010 +0300
+++ b/mediasettings/group/bld.inf Thu Apr 01 23:22:15 2010 +0300
@@ -15,17 +15,11 @@
*/
-// Version : %version: 9 %
+// Version : %version: 11 %
#include
-#include "../videoplayersettingsengine/group/bld.inf"
#include "../mediasettingsengine/group/bld.inf"
-#include "../feedsettingsplugin/group/bld.inf"
-#include "../feedsettingsviews/group/bld.inf"
-#include "../mpsettbase/group/bld.inf"
-#include "../mediasettingsapp/group/bld.inf"
-#include "../gsvideoplugin/group/bld.inf"
PRJ_PLATFORMS
DEFAULT
diff -r 48e74db5d516 -r bbb98528c666 mediasettings/mediasettingsengine/src/MPSettingsModelForROP.cpp
--- a/mediasettings/mediasettingsengine/src/MPSettingsModelForROP.cpp Thu Apr 01 23:13:36 2010 +0300
+++ b/mediasettings/mediasettingsengine/src/MPSettingsModelForROP.cpp Thu Apr 01 23:22:15 2010 +0300
@@ -15,7 +15,7 @@
*/
-// Version : %version: 9 %
+// Version : %version: 10 %
@@ -1157,6 +1157,11 @@
{
MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::WapIdFromIapIdL(%d)"),aIapId);
+ TUint32 wap = 0;
+#ifdef __WINSCW__
+ wap = aIapId;
+#else
+
CMDBSession* db = CMDBSession::NewL( CMDBSession::LatestVersion() );
CleanupStack::PushL( db );
@@ -1169,16 +1174,17 @@
wapBearerRecord->iWAPIAP = aIapId;
TBool found = wapBearerRecord->FindL( *db );
-
if ( !found )
{
User::Leave(KErrNotFound);
}
- TUint32 wap = static_cast( wapBearerRecord->iWAPAccessPointId );
+ wap = static_cast( wapBearerRecord->iWAPAccessPointId );
CleanupStack::PopAndDestroy( wapBearerRecord );
CleanupStack::PopAndDestroy( db );
+
+#endif
MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::IapIdFromWapIdL() - return wap id: %d "), wap);
return wap;
@@ -1192,6 +1198,10 @@
{
MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::IapIdFromWapIdL(%d)"),aWapId);
+ TUint32 iap = 0;
+#ifdef __WINSCW__
+ iap = aWapId;
+#else
CMDBSession* db = CMDBSession::NewL( CMDBSession::LatestVersion() );
CleanupStack::PushL( db );
@@ -1210,10 +1220,12 @@
User::Leave(KErrNotFound);
}
- TUint32 iap = static_cast( wapBearerRecord->iWAPIAP );
+ iap = static_cast( wapBearerRecord->iWAPIAP );
CleanupStack::PopAndDestroy( wapBearerRecord );
CleanupStack::PopAndDestroy( db );
+
+#endif
MPX_DEBUG2(_L("#MS# CMPSettingsModelForROP::IapIdFromWapIdL() - return iap id: %d "), iap);
return iap;
diff -r 48e74db5d516 -r bbb98528c666 videocollection/bwins/videocollectionwrapperu.def
--- a/videocollection/bwins/videocollectionwrapperu.def Thu Apr 01 23:13:36 2010 +0300
+++ b/videocollection/bwins/videocollectionwrapperu.def Thu Apr 01 23:22:15 2010 +0300
@@ -2,67 +2,76 @@
?getThumbnail@VideoThumbnailData@@QAEPBVQIcon@@VTMPXItemId@@@Z @ 1 NONAME ; class QIcon const * VideoThumbnailData::getThumbnail(class TMPXItemId)
?sendAsyncStatus@VideoCollectionWrapper@@QAEXHAAVQVariant@@@Z @ 2 NONAME ; void VideoCollectionWrapper::sendAsyncStatus(int, class QVariant &)
??1VideoSortFilterProxyModel@@UAE@XZ @ 3 NONAME ; VideoSortFilterProxyModel::~VideoSortFilterProxyModel(void)
- ?startFetchingThumbnail@VideoThumbnailData@@QAEHHH@Z @ 4 NONAME ; int VideoThumbnailData::startFetchingThumbnail(int, int)
- ?removeThumbnail@VideoThumbnailData@@QAE_NVTMPXItemId@@@Z @ 5 NONAME ; bool VideoThumbnailData::removeThumbnail(class TMPXItemId)
- ?deleteItems@VideoSortFilterProxyModel@@QAEHABV?$QList@VQModelIndex@@@@@Z @ 6 NONAME ; int VideoSortFilterProxyModel::deleteItems(class QList const &)
- ?trUtf8@VideoThumbnailData@@SA?AVQString@@PBD0@Z @ 7 NONAME ; class QString VideoThumbnailData::trUtf8(char const *, char const *)
+ ?removeThumbnail@VideoThumbnailData@@QAE_NVTMPXItemId@@@Z @ 4 NONAME ; bool VideoThumbnailData::removeThumbnail(class TMPXItemId)
+ ?deleteItems@VideoSortFilterProxyModel@@QAEHABV?$QList@VQModelIndex@@@@@Z @ 5 NONAME ; int VideoSortFilterProxyModel::deleteItems(class QList const &)
+ ?trUtf8@VideoThumbnailData@@SA?AVQString@@PBD0@Z @ 6 NONAME ; class QString VideoThumbnailData::trUtf8(char const *, char const *)
+ ?instance@VideoCollectionWrapper@@SAAAV1@XZ @ 7 NONAME ; class VideoCollectionWrapper & VideoCollectionWrapper::instance(void)
?back@VideoSortFilterProxyModel@@QAEHXZ @ 8 NONAME ; int VideoSortFilterProxyModel::back(void)
?modelReady@VideoSortFilterProxyModel@@IAEXXZ @ 9 NONAME ; void VideoSortFilterProxyModel::modelReady(void)
- ?qt_metacall@VideoThumbnailData@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 10 NONAME ; int VideoThumbnailData::qt_metacall(enum QMetaObject::Call, int, void * *)
- ?fullDetailsReady@VideoSortFilterProxyModel@@IAEXH@Z @ 11 NONAME ; void VideoSortFilterProxyModel::fullDetailsReady(int)
- ??1VideoThumbnailData@@EAE@XZ @ 12 NONAME ; VideoThumbnailData::~VideoThumbnailData(void)
- ??_EVideoThumbnailData@@UAE@I@Z @ 13 NONAME ; VideoThumbnailData::~VideoThumbnailData(unsigned int)
- ?getMediaFilePathForId@VideoSortFilterProxyModel@@QAE?AVQString@@VTMPXItemId@@@Z @ 14 NONAME ; class QString VideoSortFilterProxyModel::getMediaFilePathForId(class TMPXItemId)
- ?qt_metacast@VideoCollectionWrapper@@UAEPAXPBD@Z @ 15 NONAME ; void * VideoCollectionWrapper::qt_metacast(char const *)
- ??0VideoSortFilterProxyModel@@QAE@PAVQObject@@@Z @ 16 NONAME ; VideoSortFilterProxyModel::VideoSortFilterProxyModel(class QObject *)
- ?startBackgroundFetching@VideoThumbnailData@@QAEXH@Z @ 17 NONAME ; void VideoThumbnailData::startBackgroundFetching(int)
+ ?albumChangedSlot@VideoSortFilterProxyModel@@AAEXXZ @ 10 NONAME ; void VideoSortFilterProxyModel::albumChangedSlot(void)
+ ?addItemsInAlbum@VideoSortFilterProxyModel@@QAEHVTMPXItemId@@ABV?$QList@VTMPXItemId@@@@@Z @ 11 NONAME ; int VideoSortFilterProxyModel::addItemsInAlbum(class TMPXItemId, class QList const &)
+ ?qt_metacall@VideoThumbnailData@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 12 NONAME ; int VideoThumbnailData::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ??1VideoThumbnailData@@EAE@XZ @ 13 NONAME ; VideoThumbnailData::~VideoThumbnailData(void)
+ ??_EVideoThumbnailData@@UAE@I@Z @ 14 NONAME ; VideoThumbnailData::~VideoThumbnailData(unsigned int)
+ ?getMediaFilePathForId@VideoSortFilterProxyModel@@QAE?AVQString@@VTMPXItemId@@@Z @ 15 NONAME ; class QString VideoSortFilterProxyModel::getMediaFilePathForId(class TMPXItemId)
+ ?qt_metacast@VideoCollectionWrapper@@UAEPAXPBD@Z @ 16 NONAME ; void * VideoCollectionWrapper::qt_metacast(char const *)
+ ?fullDetailsReady@VideoSortFilterProxyModel@@IAEXVTMPXItemId@@@Z @ 17 NONAME ; void VideoSortFilterProxyModel::fullDetailsReady(class TMPXItemId)
?tr@VideoSortFilterProxyModel@@SA?AVQString@@PBD0H@Z @ 18 NONAME ; class QString VideoSortFilterProxyModel::tr(char const *, char const *, int)
- ?instance@VideoThumbnailData@@SAAAV1@XZ @ 19 NONAME ; class VideoThumbnailData & VideoThumbnailData::instance(void)
- ?fetchItemDetails@VideoSortFilterProxyModel@@QAEHABVQModelIndex@@@Z @ 20 NONAME ; int VideoSortFilterProxyModel::fetchItemDetails(class QModelIndex const &)
- ??0VideoCollectionWrapper@@AAE@XZ @ 21 NONAME ; VideoCollectionWrapper::VideoCollectionWrapper(void)
- ?metaObject@VideoSortFilterProxyModel@@UBEPBUQMetaObject@@XZ @ 22 NONAME ; struct QMetaObject const * VideoSortFilterProxyModel::metaObject(void) const
- ?metaObject@VideoCollectionWrapper@@UBEPBUQMetaObject@@XZ @ 23 NONAME ; struct QMetaObject const * VideoCollectionWrapper::metaObject(void) const
- ?open@VideoSortFilterProxyModel@@QAEHH@Z @ 24 NONAME ; int VideoSortFilterProxyModel::open(int)
- ?lessThan@VideoSortFilterProxyModel@@MBE_NABVQModelIndex@@0@Z @ 25 NONAME ; bool VideoSortFilterProxyModel::lessThan(class QModelIndex const &, class QModelIndex const &) const
- ?getStaticMetaObject@VideoCollectionWrapper@@SAABUQMetaObject@@XZ @ 26 NONAME ; struct QMetaObject const & VideoCollectionWrapper::getStaticMetaObject(void)
- ?getStaticMetaObject@VideoSortFilterProxyModel@@SAABUQMetaObject@@XZ @ 27 NONAME ; struct QMetaObject const & VideoSortFilterProxyModel::getStaticMetaObject(void)
- ?trUtf8@VideoSortFilterProxyModel@@SA?AVQString@@PBD0@Z @ 28 NONAME ; class QString VideoSortFilterProxyModel::trUtf8(char const *, char const *)
- ?doSorting@VideoSortFilterProxyModel@@QAEXHW4SortOrder@Qt@@_N@Z @ 29 NONAME ; void VideoSortFilterProxyModel::doSorting(int, enum Qt::SortOrder, bool)
- ??_EVideoCollectionWrapper@@UAE@I@Z @ 30 NONAME ; VideoCollectionWrapper::~VideoCollectionWrapper(unsigned int)
- ?getStaticMetaObject@VideoThumbnailData@@SAABUQMetaObject@@XZ @ 31 NONAME ; struct QMetaObject const & VideoThumbnailData::getStaticMetaObject(void)
- ?getMediaIdAtIndex@VideoSortFilterProxyModel@@QAE?AVTMPXItemId@@ABVQModelIndex@@@Z @ 32 NONAME ; class TMPXItemId VideoSortFilterProxyModel::getMediaIdAtIndex(class QModelIndex const &)
- ?qt_metacall@VideoCollectionWrapper@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 33 NONAME ; int VideoCollectionWrapper::qt_metacall(enum QMetaObject::Call, int, void * *)
- ?trUtf8@VideoThumbnailData@@SA?AVQString@@PBD0H@Z @ 34 NONAME ; class QString VideoThumbnailData::trUtf8(char const *, char const *, int)
- ?enableBackgroundFetching@VideoThumbnailData@@QAEX_N@Z @ 35 NONAME ; void VideoThumbnailData::enableBackgroundFetching(bool)
- ?openItem@VideoSortFilterProxyModel@@QAEHABVQModelIndex@@@Z @ 36 NONAME ; int VideoSortFilterProxyModel::openItem(class QModelIndex const &)
- ?tr@VideoCollectionWrapper@@SA?AVQString@@PBD0H@Z @ 37 NONAME ; class QString VideoCollectionWrapper::tr(char const *, char const *, int)
- ?staticMetaObject@VideoSortFilterProxyModel@@2UQMetaObject@@B @ 38 NONAME ; struct QMetaObject const VideoSortFilterProxyModel::staticMetaObject
- ?tr@VideoSortFilterProxyModel@@SA?AVQString@@PBD0@Z @ 39 NONAME ; class QString VideoSortFilterProxyModel::tr(char const *, char const *)
- ?asyncStatus@VideoCollectionWrapper@@IAEXHAAVQVariant@@@Z @ 40 NONAME ; void VideoCollectionWrapper::asyncStatus(int, class QVariant &)
- ?initialize@VideoSortFilterProxyModel@@QAEHPAVVideoListDataModel@@@Z @ 41 NONAME ; int VideoSortFilterProxyModel::initialize(class VideoListDataModel *)
- ?shortDetailsReady@VideoSortFilterProxyModel@@IAEXH@Z @ 42 NONAME ; void VideoSortFilterProxyModel::shortDetailsReady(int)
- ?instance@VideoCollectionWrapper@@SAPAV1@XZ @ 43 NONAME ; class VideoCollectionWrapper * VideoCollectionWrapper::instance(void)
- ?thumbnailsFetched@VideoThumbnailData@@IAEXV?$QList@VTMPXItemId@@@@@Z @ 44 NONAME ; void VideoThumbnailData::thumbnailsFetched(class QList)
- ?trUtf8@VideoCollectionWrapper@@SA?AVQString@@PBD0@Z @ 45 NONAME ; class QString VideoCollectionWrapper::trUtf8(char const *, char const *)
- ?processSorting@VideoSortFilterProxyModel@@AAEXXZ @ 46 NONAME ; void VideoSortFilterProxyModel::processSorting(void)
- ?filterAcceptsRow@VideoSortFilterProxyModel@@MBE_NHABVQModelIndex@@@Z @ 47 NONAME ; bool VideoSortFilterProxyModel::filterAcceptsRow(int, class QModelIndex const &) const
- ?metaObject@VideoThumbnailData@@UBEPBUQMetaObject@@XZ @ 48 NONAME ; struct QMetaObject const * VideoThumbnailData::metaObject(void) const
- ?tr@VideoThumbnailData@@SA?AVQString@@PBD0H@Z @ 49 NONAME ; class QString VideoThumbnailData::tr(char const *, char const *, int)
- ?addNewCollection@VideoSortFilterProxyModel@@QAEHVQString@@0V?$QList@VTMPXItemId@@@@@Z @ 50 NONAME ; int VideoSortFilterProxyModel::addNewCollection(class QString, class QString, class QList)
- ?qt_metacast@VideoThumbnailData@@UAEPAXPBD@Z @ 51 NONAME ; void * VideoThumbnailData::qt_metacast(char const *)
- ?trUtf8@VideoSortFilterProxyModel@@SA?AVQString@@PBD0H@Z @ 52 NONAME ; class QString VideoSortFilterProxyModel::trUtf8(char const *, char const *, int)
- ?tr@VideoCollectionWrapper@@SA?AVQString@@PBD0@Z @ 53 NONAME ; class QString VideoCollectionWrapper::tr(char const *, char const *)
- ?decreaseReferenceCount@VideoCollectionWrapper@@QAEXXZ @ 54 NONAME ; void VideoCollectionWrapper::decreaseReferenceCount(void)
- ??_EVideoSortFilterProxyModel@@UAE@I@Z @ 55 NONAME ; VideoSortFilterProxyModel::~VideoSortFilterProxyModel(unsigned int)
- ?mInstance@VideoCollectionWrapper@@0PAV1@A @ 56 NONAME ; class VideoCollectionWrapper * VideoCollectionWrapper::mInstance
- ?getModel@VideoCollectionWrapper@@QAEPAVVideoSortFilterProxyModel@@XZ @ 57 NONAME ; class VideoSortFilterProxyModel * VideoCollectionWrapper::getModel(void)
- ?qt_metacall@VideoSortFilterProxyModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 58 NONAME ; int VideoSortFilterProxyModel::qt_metacall(enum QMetaObject::Call, int, void * *)
- ?freeThumbnailData@VideoThumbnailData@@QAEXXZ @ 59 NONAME ; void VideoThumbnailData::freeThumbnailData(void)
- ?qt_metacast@VideoSortFilterProxyModel@@UAEPAXPBD@Z @ 60 NONAME ; void * VideoSortFilterProxyModel::qt_metacast(char const *)
- ?staticMetaObject@VideoCollectionWrapper@@2UQMetaObject@@B @ 61 NONAME ; struct QMetaObject const VideoCollectionWrapper::staticMetaObject
- ?tr@VideoThumbnailData@@SA?AVQString@@PBD0@Z @ 62 NONAME ; class QString VideoThumbnailData::tr(char const *, char const *)
- ??1VideoCollectionWrapper@@EAE@XZ @ 63 NONAME ; VideoCollectionWrapper::~VideoCollectionWrapper(void)
- ?trUtf8@VideoCollectionWrapper@@SA?AVQString@@PBD0H@Z @ 64 NONAME ; class QString VideoCollectionWrapper::trUtf8(char const *, char const *, int)
- ??0VideoThumbnailData@@AAE@XZ @ 65 NONAME ; VideoThumbnailData::VideoThumbnailData(void)
- ?staticMetaObject@VideoThumbnailData@@2UQMetaObject@@B @ 66 NONAME ; struct QMetaObject const VideoThumbnailData::staticMetaObject
+ ?removeAlbums@VideoSortFilterProxyModel@@QAEHABV?$QList@VQModelIndex@@@@@Z @ 19 NONAME ; int VideoSortFilterProxyModel::removeAlbums(class QList const &)
+ ?instance@VideoThumbnailData@@SAAAV1@XZ @ 20 NONAME ; class VideoThumbnailData & VideoThumbnailData::instance(void)
+ ?fetchItemDetails@VideoSortFilterProxyModel@@QAEHABVQModelIndex@@@Z @ 21 NONAME ; int VideoSortFilterProxyModel::fetchItemDetails(class QModelIndex const &)
+ ??0VideoCollectionWrapper@@AAE@XZ @ 22 NONAME ; VideoCollectionWrapper::VideoCollectionWrapper(void)
+ ?metaObject@VideoSortFilterProxyModel@@UBEPBUQMetaObject@@XZ @ 23 NONAME ; struct QMetaObject const * VideoSortFilterProxyModel::metaObject(void) const
+ ?metaObject@VideoCollectionWrapper@@UBEPBUQMetaObject@@XZ @ 24 NONAME ; struct QMetaObject const * VideoCollectionWrapper::metaObject(void) const
+ ?open@VideoSortFilterProxyModel@@QAEHH@Z @ 25 NONAME ; int VideoSortFilterProxyModel::open(int)
+ ?lessThan@VideoSortFilterProxyModel@@MBE_NABVQModelIndex@@0@Z @ 26 NONAME ; bool VideoSortFilterProxyModel::lessThan(class QModelIndex const &, class QModelIndex const &) const
+ ?getStaticMetaObject@VideoCollectionWrapper@@SAABUQMetaObject@@XZ @ 27 NONAME ; struct QMetaObject const & VideoCollectionWrapper::getStaticMetaObject(void)
+ ?indexOfId@VideoSortFilterProxyModel@@QAE?AVQModelIndex@@VTMPXItemId@@@Z @ 28 NONAME ; class QModelIndex VideoSortFilterProxyModel::indexOfId(class TMPXItemId)
+ ??0VideoSortFilterProxyModel@@QAE@HPAVQObject@@@Z @ 29 NONAME ; VideoSortFilterProxyModel::VideoSortFilterProxyModel(int, class QObject *)
+ ?getStaticMetaObject@VideoSortFilterProxyModel@@SAABUQMetaObject@@XZ @ 30 NONAME ; struct QMetaObject const & VideoSortFilterProxyModel::getStaticMetaObject(void)
+ ?trUtf8@VideoSortFilterProxyModel@@SA?AVQString@@PBD0@Z @ 31 NONAME ; class QString VideoSortFilterProxyModel::trUtf8(char const *, char const *)
+ ?doSorting@VideoSortFilterProxyModel@@QAEXHW4SortOrder@Qt@@_N@Z @ 32 NONAME ; void VideoSortFilterProxyModel::doSorting(int, enum Qt::SortOrder, bool)
+ ?getOpenItem@VideoSortFilterProxyModel@@QBE?AVTMPXItemId@@XZ @ 33 NONAME ; class TMPXItemId VideoSortFilterProxyModel::getOpenItem(void) const
+ ?startBackgroundFetching@VideoThumbnailData@@QAEXPAVVideoSortFilterProxyModel@@H@Z @ 34 NONAME ; void VideoThumbnailData::startBackgroundFetching(class VideoSortFilterProxyModel *, int)
+ ??_EVideoCollectionWrapper@@UAE@I@Z @ 35 NONAME ; VideoCollectionWrapper::~VideoCollectionWrapper(unsigned int)
+ ?resolveAlbumName@VideoSortFilterProxyModel@@QBE?AVQString@@ABV2@@Z @ 36 NONAME ; class QString VideoSortFilterProxyModel::resolveAlbumName(class QString const &) const
+ ?setGenericIdFilter@VideoSortFilterProxyModel@@QAEXVTMPXItemId@@_N@Z @ 37 NONAME ; void VideoSortFilterProxyModel::setGenericIdFilter(class TMPXItemId, bool)
+ ?getStaticMetaObject@VideoThumbnailData@@SAABUQMetaObject@@XZ @ 38 NONAME ; struct QMetaObject const & VideoThumbnailData::getStaticMetaObject(void)
+ ?qt_metacall@VideoCollectionWrapper@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 39 NONAME ; int VideoCollectionWrapper::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ?trUtf8@VideoThumbnailData@@SA?AVQString@@PBD0H@Z @ 40 NONAME ; class QString VideoThumbnailData::trUtf8(char const *, char const *, int)
+ ?enableBackgroundFetching@VideoThumbnailData@@QAEX_N@Z @ 41 NONAME ; void VideoThumbnailData::enableBackgroundFetching(bool)
+ ?getMediaIdAtIndex@VideoSortFilterProxyModel@@QBE?AVTMPXItemId@@ABVQModelIndex@@@Z @ 42 NONAME ; class TMPXItemId VideoSortFilterProxyModel::getMediaIdAtIndex(class QModelIndex const &) const
+ ?connectSignals@VideoSortFilterProxyModel@@AAE_NXZ @ 43 NONAME ; bool VideoSortFilterProxyModel::connectSignals(void)
+ ?tr@VideoCollectionWrapper@@SA?AVQString@@PBD0H@Z @ 44 NONAME ; class QString VideoCollectionWrapper::tr(char const *, char const *, int)
+ ?staticMetaObject@VideoSortFilterProxyModel@@2UQMetaObject@@B @ 45 NONAME ; struct QMetaObject const VideoSortFilterProxyModel::staticMetaObject
+ ?tr@VideoSortFilterProxyModel@@SA?AVQString@@PBD0@Z @ 46 NONAME ; class QString VideoSortFilterProxyModel::tr(char const *, char const *)
+ ?asyncStatus@VideoCollectionWrapper@@IAEXHAAVQVariant@@@Z @ 47 NONAME ; void VideoCollectionWrapper::asyncStatus(int, class QVariant &)
+ ?initialize@VideoSortFilterProxyModel@@QAEHPAVVideoListDataModel@@@Z @ 48 NONAME ; int VideoSortFilterProxyModel::initialize(class VideoListDataModel *)
+ ?modelChanged@VideoSortFilterProxyModel@@IAEXXZ @ 49 NONAME ; void VideoSortFilterProxyModel::modelChanged(void)
+ ?thumbnailsFetched@VideoThumbnailData@@IAEXV?$QList@VTMPXItemId@@@@@Z @ 50 NONAME ; void VideoThumbnailData::thumbnailsFetched(class QList)
+ ?trUtf8@VideoCollectionWrapper@@SA?AVQString@@PBD0@Z @ 51 NONAME ; class QString VideoCollectionWrapper::trUtf8(char const *, char const *)
+ ?processSorting@VideoSortFilterProxyModel@@AAEXXZ @ 52 NONAME ; void VideoSortFilterProxyModel::processSorting(void)
+ ?getSorting@VideoSortFilterProxyModel@@QAEXAAHAAW4SortOrder@Qt@@@Z @ 53 NONAME ; void VideoSortFilterProxyModel::getSorting(int &, enum Qt::SortOrder &)
+ ?filterAcceptsRow@VideoSortFilterProxyModel@@MBE_NHABVQModelIndex@@@Z @ 54 NONAME ; bool VideoSortFilterProxyModel::filterAcceptsRow(int, class QModelIndex const &) const
+ ?metaObject@VideoThumbnailData@@UBEPBUQMetaObject@@XZ @ 55 NONAME ; struct QMetaObject const * VideoThumbnailData::metaObject(void) const
+ ?tr@VideoThumbnailData@@SA?AVQString@@PBD0H@Z @ 56 NONAME ; class QString VideoThumbnailData::tr(char const *, char const *, int)
+ ?disconnectSignals@VideoSortFilterProxyModel@@AAEXXZ @ 57 NONAME ; void VideoSortFilterProxyModel::disconnectSignals(void)
+ ?getModel@VideoCollectionWrapper@@QAEPAVVideoSortFilterProxyModel@@H@Z @ 58 NONAME ; class VideoSortFilterProxyModel * VideoCollectionWrapper::getModel(int)
+ ?trUtf8@VideoSortFilterProxyModel@@SA?AVQString@@PBD0H@Z @ 59 NONAME ; class QString VideoSortFilterProxyModel::trUtf8(char const *, char const *, int)
+ ?openItem@VideoSortFilterProxyModel@@QAEHVTMPXItemId@@@Z @ 60 NONAME ; int VideoSortFilterProxyModel::openItem(class TMPXItemId)
+ ?qt_metacast@VideoThumbnailData@@UAEPAXPBD@Z @ 61 NONAME ; void * VideoThumbnailData::qt_metacast(char const *)
+ ?tr@VideoCollectionWrapper@@SA?AVQString@@PBD0@Z @ 62 NONAME ; class QString VideoCollectionWrapper::tr(char const *, char const *)
+ ??_EVideoSortFilterProxyModel@@UAE@I@Z @ 63 NONAME ; VideoSortFilterProxyModel::~VideoSortFilterProxyModel(unsigned int)
+ ?addNewAlbum@VideoSortFilterProxyModel@@QAE?AVTMPXItemId@@ABVQString@@@Z @ 64 NONAME ; class TMPXItemId VideoSortFilterProxyModel::addNewAlbum(class QString const &)
+ ?enableThumbnailCreation@VideoThumbnailData@@QAEX_N@Z @ 65 NONAME ; void VideoThumbnailData::enableThumbnailCreation(bool)
+ ?qt_metacall@VideoSortFilterProxyModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 66 NONAME ; int VideoSortFilterProxyModel::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ?freeThumbnailData@VideoThumbnailData@@QAEXXZ @ 67 NONAME ; void VideoThumbnailData::freeThumbnailData(void)
+ ?shortDetailsReady@VideoSortFilterProxyModel@@IAEXVTMPXItemId@@@Z @ 68 NONAME ; void VideoSortFilterProxyModel::shortDetailsReady(class TMPXItemId)
+ ?qt_metacast@VideoSortFilterProxyModel@@UAEPAXPBD@Z @ 69 NONAME ; void * VideoSortFilterProxyModel::qt_metacast(char const *)
+ ?staticMetaObject@VideoCollectionWrapper@@2UQMetaObject@@B @ 70 NONAME ; struct QMetaObject const VideoCollectionWrapper::staticMetaObject
+ ?tr@VideoThumbnailData@@SA?AVQString@@PBD0@Z @ 71 NONAME ; class QString VideoThumbnailData::tr(char const *, char const *)
+ ??1VideoCollectionWrapper@@EAE@XZ @ 72 NONAME ; VideoCollectionWrapper::~VideoCollectionWrapper(void)
+ ?trUtf8@VideoCollectionWrapper@@SA?AVQString@@PBD0H@Z @ 73 NONAME ; class QString VideoCollectionWrapper::trUtf8(char const *, char const *, int)
+ ??0VideoThumbnailData@@AAE@XZ @ 74 NONAME ; VideoThumbnailData::VideoThumbnailData(void)
+ ?staticMetaObject@VideoThumbnailData@@2UQMetaObject@@B @ 75 NONAME ; struct QMetaObject const VideoThumbnailData::staticMetaObject
diff -r 48e74db5d516 -r bbb98528c666 videocollection/eabi/videocollectionwrapperu.def
--- a/videocollection/eabi/videocollectionwrapperu.def Thu Apr 01 23:13:36 2010 +0300
+++ b/videocollection/eabi/videocollectionwrapperu.def Thu Apr 01 23:22:15 2010 +0300
@@ -7,8 +7,8 @@
_ZN18VideoThumbnailData17freeThumbnailDataEv @ 6 NONAME
_ZN18VideoThumbnailData17thumbnailsFetchedE5QListI10TMPXItemIdE @ 7 NONAME
_ZN18VideoThumbnailData19getStaticMetaObjectEv @ 8 NONAME
- _ZN18VideoThumbnailData22startFetchingThumbnailEii @ 9 NONAME
- _ZN18VideoThumbnailData23startBackgroundFetchingEi @ 10 NONAME
+ _ZN18VideoThumbnailData23enableThumbnailCreationEb @ 9 NONAME
+ _ZN18VideoThumbnailData23startBackgroundFetchingEP25VideoSortFilterProxyModeli @ 10 NONAME
_ZN18VideoThumbnailData24enableBackgroundFetchingEb @ 11 NONAME
_ZN18VideoThumbnailData8instanceEv @ 12 NONAME
_ZN18VideoThumbnailDataC1Ev @ 13 NONAME
@@ -22,47 +22,56 @@
_ZN22VideoCollectionWrapper15sendAsyncStatusEiR8QVariant @ 21 NONAME
_ZN22VideoCollectionWrapper16staticMetaObjectE @ 22 NONAME DATA 16
_ZN22VideoCollectionWrapper19getStaticMetaObjectEv @ 23 NONAME
- _ZN22VideoCollectionWrapper22decreaseReferenceCountEv @ 24 NONAME
- _ZN22VideoCollectionWrapper8getModelEv @ 25 NONAME
- _ZN22VideoCollectionWrapper8instanceEv @ 26 NONAME
- _ZN22VideoCollectionWrapper9mInstanceE @ 27 NONAME DATA 4
- _ZN22VideoCollectionWrapperC1Ev @ 28 NONAME
- _ZN22VideoCollectionWrapperC2Ev @ 29 NONAME
- _ZN22VideoCollectionWrapperD0Ev @ 30 NONAME
- _ZN22VideoCollectionWrapperD1Ev @ 31 NONAME
- _ZN22VideoCollectionWrapperD2Ev @ 32 NONAME
- _ZN25VideoSortFilterProxyModel10initializeEP18VideoListDataModel @ 33 NONAME
- _ZN25VideoSortFilterProxyModel10modelReadyEv @ 34 NONAME
+ _ZN22VideoCollectionWrapper8getModelEi @ 24 NONAME
+ _ZN22VideoCollectionWrapper8instanceEv @ 25 NONAME
+ _ZN22VideoCollectionWrapperC1Ev @ 26 NONAME
+ _ZN22VideoCollectionWrapperC2Ev @ 27 NONAME
+ _ZN22VideoCollectionWrapperD0Ev @ 28 NONAME
+ _ZN22VideoCollectionWrapperD1Ev @ 29 NONAME
+ _ZN22VideoCollectionWrapperD2Ev @ 30 NONAME
+ _ZN25VideoSortFilterProxyModel10getSortingERiRN2Qt9SortOrderE @ 31 NONAME
+ _ZN25VideoSortFilterProxyModel10initializeEP18VideoListDataModel @ 32 NONAME
+ _ZN25VideoSortFilterProxyModel10modelReadyEv @ 33 NONAME
+ _ZN25VideoSortFilterProxyModel11addNewAlbumERK7QString @ 34 NONAME
_ZN25VideoSortFilterProxyModel11deleteItemsERK5QListI11QModelIndexE @ 35 NONAME
_ZN25VideoSortFilterProxyModel11qt_metacallEN11QMetaObject4CallEiPPv @ 36 NONAME
_ZN25VideoSortFilterProxyModel11qt_metacastEPKc @ 37 NONAME
- _ZN25VideoSortFilterProxyModel14processSortingEv @ 38 NONAME
- _ZN25VideoSortFilterProxyModel16addNewCollectionE7QStringS0_5QListI10TMPXItemIdE @ 39 NONAME
- _ZN25VideoSortFilterProxyModel16fetchItemDetailsERK11QModelIndex @ 40 NONAME
- _ZN25VideoSortFilterProxyModel16fullDetailsReadyEi @ 41 NONAME
- _ZN25VideoSortFilterProxyModel16staticMetaObjectE @ 42 NONAME DATA 16
- _ZN25VideoSortFilterProxyModel17getMediaIdAtIndexERK11QModelIndex @ 43 NONAME
- _ZN25VideoSortFilterProxyModel17shortDetailsReadyEi @ 44 NONAME
- _ZN25VideoSortFilterProxyModel19getStaticMetaObjectEv @ 45 NONAME
- _ZN25VideoSortFilterProxyModel21getMediaFilePathForIdE10TMPXItemId @ 46 NONAME
- _ZN25VideoSortFilterProxyModel4backEv @ 47 NONAME
- _ZN25VideoSortFilterProxyModel4openEi @ 48 NONAME
- _ZN25VideoSortFilterProxyModel8openItemERK11QModelIndex @ 49 NONAME
- _ZN25VideoSortFilterProxyModel9doSortingEiN2Qt9SortOrderEb @ 50 NONAME
- _ZN25VideoSortFilterProxyModelC1EP7QObject @ 51 NONAME
- _ZN25VideoSortFilterProxyModelC2EP7QObject @ 52 NONAME
- _ZN25VideoSortFilterProxyModelD0Ev @ 53 NONAME
- _ZN25VideoSortFilterProxyModelD1Ev @ 54 NONAME
- _ZN25VideoSortFilterProxyModelD2Ev @ 55 NONAME
- _ZNK18VideoThumbnailData10metaObjectEv @ 56 NONAME
- _ZNK22VideoCollectionWrapper10metaObjectEv @ 57 NONAME
- _ZNK25VideoSortFilterProxyModel10metaObjectEv @ 58 NONAME
- _ZNK25VideoSortFilterProxyModel16filterAcceptsRowEiRK11QModelIndex @ 59 NONAME
- _ZNK25VideoSortFilterProxyModel8lessThanERK11QModelIndexS2_ @ 60 NONAME
- _ZTI18VideoThumbnailData @ 61 NONAME
- _ZTI22VideoCollectionWrapper @ 62 NONAME
- _ZTI25VideoSortFilterProxyModel @ 63 NONAME
- _ZTV18VideoThumbnailData @ 64 NONAME
- _ZTV22VideoCollectionWrapper @ 65 NONAME
- _ZTV25VideoSortFilterProxyModel @ 66 NONAME
+ _ZN25VideoSortFilterProxyModel12modelChangedEv @ 38 NONAME
+ _ZN25VideoSortFilterProxyModel12removeAlbumsERK5QListI11QModelIndexE @ 39 NONAME
+ _ZN25VideoSortFilterProxyModel14connectSignalsEv @ 40 NONAME
+ _ZN25VideoSortFilterProxyModel14processSortingEv @ 41 NONAME
+ _ZN25VideoSortFilterProxyModel15addItemsInAlbumE10TMPXItemIdRK5QListIS0_E @ 42 NONAME
+ _ZN25VideoSortFilterProxyModel16albumChangedSlotEv @ 43 NONAME
+ _ZN25VideoSortFilterProxyModel16fetchItemDetailsERK11QModelIndex @ 44 NONAME
+ _ZN25VideoSortFilterProxyModel16fullDetailsReadyE10TMPXItemId @ 45 NONAME
+ _ZN25VideoSortFilterProxyModel16staticMetaObjectE @ 46 NONAME DATA 16
+ _ZN25VideoSortFilterProxyModel17disconnectSignalsEv @ 47 NONAME
+ _ZN25VideoSortFilterProxyModel17shortDetailsReadyE10TMPXItemId @ 48 NONAME
+ _ZN25VideoSortFilterProxyModel18setGenericIdFilterE10TMPXItemIdb @ 49 NONAME
+ _ZN25VideoSortFilterProxyModel19getStaticMetaObjectEv @ 50 NONAME
+ _ZN25VideoSortFilterProxyModel21getMediaFilePathForIdE10TMPXItemId @ 51 NONAME
+ _ZN25VideoSortFilterProxyModel4backEv @ 52 NONAME
+ _ZN25VideoSortFilterProxyModel4openEi @ 53 NONAME
+ _ZN25VideoSortFilterProxyModel8openItemE10TMPXItemId @ 54 NONAME
+ _ZN25VideoSortFilterProxyModel9doSortingEiN2Qt9SortOrderEb @ 55 NONAME
+ _ZN25VideoSortFilterProxyModel9indexOfIdE10TMPXItemId @ 56 NONAME
+ _ZN25VideoSortFilterProxyModelC1EiP7QObject @ 57 NONAME
+ _ZN25VideoSortFilterProxyModelC2EiP7QObject @ 58 NONAME
+ _ZN25VideoSortFilterProxyModelD0Ev @ 59 NONAME
+ _ZN25VideoSortFilterProxyModelD1Ev @ 60 NONAME
+ _ZN25VideoSortFilterProxyModelD2Ev @ 61 NONAME
+ _ZNK18VideoThumbnailData10metaObjectEv @ 62 NONAME
+ _ZNK22VideoCollectionWrapper10metaObjectEv @ 63 NONAME
+ _ZNK25VideoSortFilterProxyModel10metaObjectEv @ 64 NONAME
+ _ZNK25VideoSortFilterProxyModel11getOpenItemEv @ 65 NONAME
+ _ZNK25VideoSortFilterProxyModel16filterAcceptsRowEiRK11QModelIndex @ 66 NONAME
+ _ZNK25VideoSortFilterProxyModel16resolveAlbumNameERK7QString @ 67 NONAME
+ _ZNK25VideoSortFilterProxyModel17getMediaIdAtIndexERK11QModelIndex @ 68 NONAME
+ _ZNK25VideoSortFilterProxyModel8lessThanERK11QModelIndexS2_ @ 69 NONAME
+ _ZTI18VideoThumbnailData @ 70 NONAME
+ _ZTI22VideoCollectionWrapper @ 71 NONAME
+ _ZTI25VideoSortFilterProxyModel @ 72 NONAME
+ _ZTV18VideoThumbnailData @ 73 NONAME
+ _ZTV22VideoCollectionWrapper @ 74 NONAME
+ _ZTV25VideoSortFilterProxyModel @ 75 NONAME
diff -r 48e74db5d516 -r bbb98528c666 videocollection/inc/videocollectioncommon.h
--- a/videocollection/inc/videocollectioncommon.h Thu Apr 01 23:13:36 2010 +0300
+++ b/videocollection/inc/videocollectioncommon.h Thu Apr 01 23:22:15 2010 +0300
@@ -19,7 +19,9 @@
#define __VIDEOCOLLECTIONCOMMON_H__
-#include
+#include
+#include
+#include
namespace VideoCollectionCommon
{
@@ -71,23 +73,23 @@
* order than the VideoDetailLabelKeys.
*/
const char * const VideoDetailLabels[] = {
- QT_TR_NOOP("DRM: %1"),
- QT_TR_NOOP("Service: %1"),
- QT_TR_NOOP("Description: %1"),
- QT_TR_NOOP("Length: %1"),
- QT_TR_NOOP("Date: %1"),
- QT_TR_NOOP("Modified: %1"),
- QT_TR_NOOP("Location: %1"),
- QT_TR_NOOP("Author: %1"),
- QT_TR_NOOP("Copyright: %1"),
- QT_TR_NOOP("Audio Type: %1"),
- QT_TR_NOOP("Language: %1"),
- QT_TR_NOOP("Keywords: %1"),
- QT_TR_NOOP("Size: %1"),
- QT_TR_NOOP("Resolution: %1"),
- QT_TR_NOOP("Format: %1"),
- QT_TR_NOOP("Bitrate: %1")
- };
+ QT_TR_NOOP("txt_videos_list_drm"),
+ QT_TR_NOOP("Service:"), //TODO: localisation
+ QT_TR_NOOP("txt_videos_list_description"),
+ QT_TR_NOOP("txt_videos_list_duration"),
+ QT_TR_NOOP("txt_videos_list_date"),
+ QT_TR_NOOP("txt_videos_list_modified"),
+ QT_TR_NOOP("txt_videos_list_location"),
+ QT_TR_NOOP("txt_videos_list_author"),
+ QT_TR_NOOP("txt_videos_list_copyright"),
+ QT_TR_NOOP("Audio Type:"), //TODO: localisation
+ QT_TR_NOOP("txt_videos_list_language"),
+ QT_TR_NOOP("txt_videos_list_keywords"),
+ QT_TR_NOOP("txt_videos_list_file_size"),
+ QT_TR_NOOP("txt_videos_list_resolution"),
+ QT_TR_NOOP("txt_videos_list_format"),
+ QT_TR_NOOP("txt_videos_list_bitrate")
+};
/**
* Order of keys in the labels const array.
@@ -111,6 +113,26 @@
MetaKeyBitRate
};
+ /**
+ * Collection level app browsed to
+ */
+ enum TCollectionLevels
+ {
+ ELevelInvalid = -1,
+ ELevelCategory = 2,
+ ELevelVideos = 3,
+ ELevelDefaultColl = 4,
+ ELevelAlbum = 5
+ };
+
+ /**
+ * Container path levels.
+ */
+ enum ContainerPathLevels
+ {
+ PathLevelCategories = 1,
+ PathLevelVideos = 2
+ };
/**
* Collection related asyncronous
@@ -120,9 +142,29 @@
{
statusSingleDeleteFail = 1,
statusMultipleDeleteFail,
- statusMultipleDeleteSucceed
+ statusDeleteInProgress,
+ statusDeleteSucceed,
+ statusSingleRemoveFail,
+ statusMultiRemoveFail,
+ statusRemoveSucceed,
+ statusVideosAddedToCollection,
+ statusAllVideosAlreadyInCollection
};
-
+ /**
+ * Utility macro to trace heap consumption.
+ */
+#ifdef _DEBUG
+ #define TRACE_HEAP(prefix)\
+ {\
+ int totalAllocSpace = 0;\
+ User::AllocSize( totalAllocSpace );\
+ qDebug("[VIDEOCOLLECTION][HEAP]: %s, Total allocated space : %d",\
+ prefix,\
+ totalAllocSpace);\
+ }
+#else
+ #define TRACE_HEAP(prefix)
+#endif
}
#endif // __VIDEOCOLLECTIONCOMMON_H__
diff -r 48e74db5d516 -r bbb98528c666 videocollection/mpxmyvideoscollection/group/vcxmyvideoscollectionplugin.mmp
--- a/videocollection/mpxmyvideoscollection/group/vcxmyvideoscollectionplugin.mmp Thu Apr 01 23:13:36 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/group/vcxmyvideoscollectionplugin.mmp Thu Apr 01 23:22:15 2010 +0300
@@ -16,7 +16,6 @@
-
#include
#include
#include
@@ -38,18 +37,15 @@
SOURCE vcxmyvideoscategories.cpp
SOURCE vcxmyvideosmessagelist.cpp
SOURCE vcxmyvideosasyncfileoperations.cpp
-SOURCE vcxmyvideosdownloadcache.cpp
SOURCE vcxmyvideosdrivemonitor.cpp
SOURCE vcxmyvideosdriveinfo.cpp
SOURCE vcxmyvideosdrivemonitorevent.cpp
SOURCE vcxmyvideosactivetask.cpp
SOURCE vcxmyvideosopenhandler.cpp
-
-SOURCEPATH ../download/src
-SOURCE vcxmyvideosdownloadutil.cpp
-
-SOURCEPATH ../src
-SOURCE vcxmyvideostimer.cpp
+SOURCE vcxmyvideosmdsalbums.cpp
+SOURCE vcxmyvideosmdscmdqueue.cpp
+SOURCE vcxmyvideosalbums.cpp
+SOURCE vcxmyvideosalbum.cpp
SOURCEPATH ../data
@@ -58,7 +54,6 @@
END
USERINCLUDE ../inc
-USERINCLUDE ../download/inc
USERINCLUDE ../../inc
APP_LAYER_SYSTEMINCLUDE
@@ -72,10 +67,6 @@
LIBRARY flogger.lib
LIBRARY mdeclient.lib
LIBRARY efsrv.lib
-LIBRARY downloadmgr.lib
LIBRARY charconv.lib
-LIBRARY vcxconnectionutility.lib
-LIBRARY mediatorclient.lib
LIBRARY centralrepository.lib
-LIBRARY drmutility.lib
-LIBRARY platformenv.lib
\ No newline at end of file
+LIBRARY PlatformEnv.lib
diff -r 48e74db5d516 -r bbb98528c666 videocollection/mpxmyvideoscollection/inc/vcxmyvideosactivetask.h
--- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideosactivetask.h Thu Apr 01 23:13:36 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosactivetask.h Thu Apr 01 23:22:15 2010 +0300
@@ -28,11 +28,22 @@
NONSHARABLE_CLASS( MVcxMyVideosActiveTaskObserver )
{
public:
+
+ enum TStepResult
+ {
+ EMoreToCome,
+ EDone,
+ /**
+ * Observer is responsible for calling Done or ContinueStepping if returning this.
+ */
+ EStopStepping
+ };
+
/**
* Handle the execution of a step
- * @return ETrue if complete, EFalse if more to do
+ * @return TStepResult
*/
- virtual TBool HandleStepL() = 0;
+ virtual TStepResult HandleStepL() = 0;
/**
* Handle the completion of the operation
*/
@@ -84,7 +95,26 @@
*/
CMPXCommand& GetCommand();
+ /**
+ * Get the command for the current task.
+ * @return the current command, ownership does not move.
+ */
+ CMPXMedia* Command();
+
+ /**
+ * If observer returns EStopStepping from HandleStepL, then observer must call
+ * this or ContinueStepping when sub operation is finished.
+ * Can be used to run async operations.
+ */
+ void Done();
+ /**
+ * If observer returns EStopStepping from HandleStepL, then observer must call
+ * this or Done when sub operation is finished.
+ * Can be used to run async operations.
+ */
+ void ContinueStepping();
+
protected: // From base class
/**
diff -r 48e74db5d516 -r bbb98528c666 videocollection/mpxmyvideoscollection/inc/vcxmyvideosalbum.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosalbum.h Thu Apr 01 23:22:15 2010 +0300
@@ -0,0 +1,216 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Class representing album in My Videos collection.
+*/
+
+
+#ifndef CVCXMYVIDEOSALBUM_H
+#define CVCXMYVIDEOSALBUM_H
+
+// INCLUDES
+#include
+#include
+
+class CMPXMedia;
+class CVcxMyVideosCollectionPlugin;
+
+// CLASS DECLARATION
+
+/**
+ * Contains information about video which belongs to some album.
+ * These are stored to CVcxMyVideosAlbum::iVideoList.
+ */
+NONSHARABLE_CLASS(TVcxMyVideosAlbumVideo)
+ {
+ public:
+
+ /**
+ * Constructor.
+ */
+ TVcxMyVideosAlbumVideo::TVcxMyVideosAlbumVideo();
+
+ /**
+ * = operator.
+ */
+ TVcxMyVideosAlbumVideo& operator=( const TVcxMyVideosAlbumVideo& aVideo );
+ private:
+
+ /**
+ * Set values.
+ */
+ void Set( TUint32 aMdsId, TUint32 aRelationMdsId, CMPXMedia* aVideo );
+
+ public:
+ TUint32 iMdsId; //Video object ID in MDS.
+ TUint32 iRelationMdsId; //Relation ID in MDS, this is used when removing items from album.
+ CMPXMedia* iMedia;
+ };
+
+/**
+ * Contains list of videos belonging to an album. Videos can be searched, added and
+ * removed. Videos are kept in sorting order by MDS ID to speed up access. Pointers
+ * to media objects in collection cache are also stored to speed up access.
+ * Contains also logic for keeping album media attributes up to date.
+ */
+NONSHARABLE_CLASS(CVcxMyVideosAlbum) : public CBase
+ {
+public:
+ // Constructors and destructor
+
+ /**
+ * Destructor.
+ */
+ ~CVcxMyVideosAlbum();
+
+ /**
+ * Two-phased constructor.
+ */
+ static CVcxMyVideosAlbum* NewL( CVcxMyVideosCollectionPlugin& aCollectionPlugin );
+
+ /**
+ * Two-phased constructor.
+ */
+ static CVcxMyVideosAlbum* NewLC( CVcxMyVideosCollectionPlugin& aCollectionPlugin );
+
+ // new methods
+
+ /**
+ * Sets up this album.
+ *
+ * @param aAlbum Media class to set from.
+ */
+ void SetL( /*CMPXMedia& aAlbum*/ );
+
+ /**
+ * Sorts iVideoList by MDS ID.
+ */
+ void Sort();
+
+ /**
+ * Checks if aMdsId belongs to this album. Checking is
+ * done using bisection method.
+ *
+ * @param aMdsId Id to check.
+ */
+ TBool BelongsToAlbum( TUint32 aMdsId );
+
+ /**
+ * Finds video from iVideoList. Uses bisection method, ie
+ * is fast.
+ *
+ * @param aMdsId Video to find.
+ * @param aVideo If found, this is filled with data.
+ * @param aIndex Position in iVideoList where from the video
+ * was found.
+ * @return System-wide error code. If != KErrNone, then
+ * aVideo and aIndex won't contain valid data.
+ */
+ TInt Video( TUint32 aMdsId, TVcxMyVideosAlbumVideo& aVideo, TInt& aIndex );
+
+ /**
+ * Adds aVideo to this album. The id array is kept in ascending order.
+ *
+ * @param aVideo Video to add.
+ */
+ void AddL( TVcxMyVideosAlbumVideo aVideo );
+
+ /**
+ * Removes videos from this album.
+ *
+ * @param aMdsIds Array containing IDs of the videos to remove.
+ */
+ void Remove( RArray& aMdsIds );
+
+ /**
+ * Removes aMdsId from this album.
+ *
+ * @param aMdsId ID to remove.
+ * @param aCompress If ETrue, then Compress is called to iVideoList.
+ * ETrue as default.
+ */
+ void Remove( TUint32 aMdsId, TBool aCompress = ETrue );
+
+ /**
+ * Updates album attributes from scratch.
+ */
+ void UpdateAttributesL();
+
+ /**
+ * Used for keeping RArray in integer order by
+ * TVcxMyVideosAlbumVideo::iMdsId.
+ *
+ * @param aVideo1 Video to compare
+ * @param aVideo2 Video to compare
+ * @return -1 if aVideo1 is smaller than aVideo2, 1 if aVideo1 is larger than
+ * aVideo2.
+ */
+ static TInt CompareVideosByMdsId( const TVcxMyVideosAlbumVideo& aVideo1,
+ const TVcxMyVideosAlbumVideo& aVideo2 );
+
+ /**
+ * Creates video list belonging to this album. Ownership goes to caller.
+ *
+ * @return Media containing media array. Array items are videos.
+ */
+ CMPXMedia* CreateVideoListL();
+
+ /**
+ * Appends items from aFromVideoList to aToVideoList if they belong to
+ * this album.
+ *
+ * @param aFromVideoList From list.
+ * @param aToVideoList To List.
+ * @param aNewItemStartIndex Start index of the copy. Items in aFromVideoList before this
+ * value are ignored.
+ */
+ void AppendToVideoListL( CMPXMedia& aFromVideoList,
+ CMPXMedia& aToVideoList, TInt aNewItemStartIndex );
+
+private:
+
+ /**
+ * Constructor for performing 1st stage construction
+ */
+ CVcxMyVideosAlbum( CVcxMyVideosCollectionPlugin& aCollectionPlugin );
+
+ /**
+ * EPOC default constructor for performing 2nd stage construction
+ */
+ void ConstructL();
+
+private: //data
+ CVcxMyVideosCollectionPlugin& iCollection;
+
+public: //data
+
+ /**
+ * MDS ID of this album.
+ */
+ TUint32 iMdsId;
+
+ /**
+ * MPX media object representing this album in collection, not own.
+ * The item is owned by CVcxMyVideosAlbums::iAlbumList
+ */
+ CMPXMedia* iMedia;
+
+ /**
+ * Array containing info about videos belonging to this album.
+ */
+ RArray iVideoList;
+
+ };
+
+#endif // CVCXMYVIDEOSALBUM_H
diff -r 48e74db5d516 -r bbb98528c666 videocollection/mpxmyvideoscollection/inc/vcxmyvideosalbums.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosalbums.h Thu Apr 01 23:22:15 2010 +0300
@@ -0,0 +1,305 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Albums related collection functionality.
+*/
+
+
+
+#ifndef VCXMYVIDEOSALBUMS_H
+#define VCXMYVIDEOSALBUMS_H
+
+// INCLUDES
+#include
+#include "vcxmyvideosmdsdb.h"
+#include "vcxmyvideosalbum.h"
+
+// FORWARD DECLARATIONS
+class CVcxMyVideosMdsDb;
+class CMPXMedia;
+class CVcxMyVideosCollectionPlugin;
+class CVcxMyVideosAlbum;
+
+// CONSTANTS
+
+// CLASS DECLARATION
+
+/**
+* Albums related collection functionality.
+*
+* @lib mpxmyvideoscollectionplugin.lib
+*/
+NONSHARABLE_CLASS(CVcxMyVideosAlbums) : public CBase, public MVcxMyVideosMdsAlbumsObserver
+ {
+ public: // Constructors and destructor
+
+ /**
+ * Two-phased constructor
+ * @return object constructed
+ */
+ static CVcxMyVideosAlbums* NewL( CVcxMyVideosCollectionPlugin& aCollectionPlugin );
+
+ /**
+ * Destructor
+ */
+ virtual ~CVcxMyVideosAlbums();
+
+ public: // new methods
+
+ /**
+ * Returns album from iAlbums array by MDS ID. Ownership does not move.
+ *
+ * @param aMdsId MDS ID of the album to get.
+ * @param aPos If given, then the position index in iAlbums is written here.
+ * Ownership does not move.
+ * @return Pointer to album or NULL if not found.
+ */
+ CVcxMyVideosAlbum* Album( TUint32 aMdsId, TInt* aPos = NULL );
+
+ /**
+ * Creates iAlbumList if it doesn't exist yet. The list is populated
+ * from async callback, HandleGetAlbumsResp().
+ */
+ void CreateAlbumListL();
+
+ /**
+ * Fetches MDS IDs from MDS for all videos belonging to albums.
+ * Ie fills iAlbums[*]->iVideoList[*].iMdsId (and iAlbums[*]->iVideoList[*].iRelationMdsId) fields.
+ * Causes several async calls to MDS.
+ */
+ void GetAlbumContentIdsL();
+
+ /**
+ * Adds videos to album.
+ *
+ * @param aCmd See attribute usage from vcxmyvideosdefs.h.
+ */
+ void AddVideosToAlbumL( CMPXMedia* aCmd );
+
+ /**
+ * Removes videos from album.
+ *
+ * @param aCmd See attribute usage from vcxmyvideosdefs.h.
+ */
+ void RemoveVideosFromAlbumL( CMPXMedia* aCmd );
+
+ /**
+ * Adds album to MDS and to this class. KMPXMediaGeneralTitle
+ * should be set in aCmd. Upon completion, the KMPXMediaGeneralId
+ * attribute contains the new MPX item ID. Leaves if could
+ * not add to MDS.
+ *
+ * @param aCmd Command object received from collection client.
+ */
+ void AddAlbumL( CMPXMedia& aCmd );
+
+ /**
+ * Removes albums from MDS. MDS delete events will clean up albums
+ * from this class.
+ *
+ * @param aCmd MPX command received from the client. Contains media array,
+ * which contains medias with album IDs set to KMPXMediaGeneralId.
+ * Ownership does not move.
+ */
+ void RemoveAlbumsFromMdsOnlyL( CMPXMedia* aCmd );
+
+ /**
+ * Removes albums from this object (iAlbumList and iAlbums).
+ * Called from MDS delete event. Album IDs which were removed are
+ * also removed from aAlbumIds array. After the call aAlbumIds
+ * will contain items which were not found and not deleted.
+ * Sends appropriate events to collection client.
+ *
+ * @param aAlbumIds Album IDs to be removed.
+ */
+ void RemoveAlbumsL( RArray& aAlbumIds );
+
+ /**
+ * Removes album from this class (iAlbumList and iAlbums).
+ * Adds event to message list but does not send it.
+ *
+ * @param aMdsIds Album MDS ID to be removed.
+ * @param aCompress If ETrue, then iAlbums is compressed,
+ * otherwise not.
+ * @return ETrue if album was found and removed.
+ */
+ TBool RemoveAlbum( TUint32 aMdsId, TBool aCompress );
+
+ /**
+ * Fetches albums from MDS. This is called from MDS insert event.
+ *
+ * @param aAlbumIds Album IDs to fetch.
+ */
+ void AddAlbumsFromMdsL( RArray& aAlbumIds );
+
+ /**
+ * From MVcxMyVideosMdsAlbumsObserver.
+ * Process albums arriving from MDS. Response to VcxMyVideosMdsAlbums::GetAlbumsL.
+ */
+ void HandleGetAlbumsRespL( CMPXMedia* aAlbumList );
+
+ /**
+ * From MVcxMyVideosMdsAlbumsObserver.
+ * Process content ids arriving from MDS. Response to VcxMyVideosMdsAlbums::GetAlbumContentIdsL.
+ *
+ * @param aAlbumId ID of the album.
+ * @param aAlbumContent Array containing MDS object IDs. This array is the same which
+ * was given in GetAlbumContentIdsL call.
+ */
+ void HandleGetAlbumContentIdsRespL( TUint32 aAlbumId,
+ RArray& aAlbumContentIds );
+
+ /**
+ * From MVcxMyVideosMdsAlbumsObserver.
+ * Response to VcxMyVideosMdsAlbums::GetAlbumsL.
+ * Sends insert events to collection clients.
+ *
+ * @param aAlbumList Pointer to same array which was given in GetAlbums call.
+ */
+ void HandleGetAlbumsResp( CMPXMedia* aAlbumList );
+
+ /**
+ * From MVcxMyVideosMdsAlbumsObserver.
+ * Process content ids arriving from MDS. Response to CVcxMyVideosMdsAlbums::GetAlbumContentIdsL.
+ *
+ * @param aAlbumId ID of the album.
+ * @param aAlbumContent Array containing MDS object IDs. This array is the same which
+ * was given in GetAlbumContentL call.
+ */
+ void HandleGetAlbumContentIdsResp( TUint32 aAlbumId,
+ RArray& aAlbumContentIds );
+
+ /**
+ * From MVcxMyVideosMdsAlbumsObserver.
+ * Process content videos arriving from MDS. Response to CVcxMyVideosMdsAlbums::GetAlbumContentVideosL.
+ *
+ * @param aAlbumId Album ID.
+ * @param aVideoList Media containing media array, array items are videos.
+ * @param aError Error code in case of failure.
+ * @param aFirstNewItemIndex The index of the first new item.
+ * @param aNewItemCount How many new items since the last results.
+ * @param aComplete ETrue is query is complete, EFalse if there is new to come.
+ */
+ void HandleGetAlbumContentVideosResp( TUint32 /*aAlbumId*/, CMPXMedia& /*aVideoList*/,
+ TInt /*aError*/, TInt /*aFirstNewItemIndex*/, TInt /*aNewItemCount*/, TBool /*aComplete*/ ) {}
+
+ /**
+ * From MVcxMyVideosMdsAlbumsObserver.
+ * Response to CVcxMyVideosMdsAlbums::AddVideosToAlbumL.
+ *
+ * @param aCmd Pointer to object which was given in AddVideosToAlbumL
+ * function call. Ownership does not move.
+ * @param aItemArray Item array which was tried to add to MDS.
+ */
+ void HandleAddVideosToAlbumResp( CMPXMedia* aCmd,
+ RPointerArray& aItemArray );
+
+ /**
+ * From MVcxMyVideosMdsAlbumsObserver.
+ * Response to CVcxMyVideosMdsAlbums::RemoveRelationsL.
+ */
+ void HandleRemoveRelationsResp( RArray& aRelationIds,
+ RArray& aResults );
+
+ /**
+ * From MVcxMyVideosMdsAlbumsObserver.
+ * Response to CVcxMyVideosMdsAlbums::RemoveAlbumsL.
+ */
+ void HandleRemoveAlbumsResp( CMPXMedia* aCmd,
+ RArray& aResultIds );
+
+ /**
+ * From MVcxMyVideosMdsAlbumsObserver.
+ * Relation events from MDS. This object is set as an observer at
+ * iCollection.ConstructL, CVcxMyVideosMdsDb::NewL(..,aAlbumsObserver,..).
+ */
+ void HandleRelationEvent( TObserverNotificationType aType,
+ const RArray& aRelationArray );
+ private:
+
+ /**
+ * Fills in iAlbums array. This is called when iAlbumList is ready.
+ * Pointers to CVcxMyVideosVideoCache::iVideoList are not filled
+ * in yet.
+ */
+ void CreateAlbumsL();
+
+ /**
+ * Constructor
+ */
+ CVcxMyVideosAlbums( CVcxMyVideosCollectionPlugin& aCollectionPlugin );
+
+ /**
+ * Symbian 2nd phase constructor.
+ */
+ void ConstructL();
+
+ /**
+ * Leaving version of HandleAddVideosToAlbumResp.
+ */
+ void DoHandleAddVideosToAlbumRespL( CMPXMedia* aCmd,
+ RPointerArray& aItemArray );
+
+ public:
+
+ /**
+ * Album list. This is given to client when categorylevel items are requested. Own.
+ * If this is destroyed/edited, then pointers have to be updated in iAlbums.
+ */
+ CMPXMedia* iAlbumList;
+
+ /**
+ * Array containing MDS IDs and pointers to album and video media items.
+ * Album media items are in iAlbumList and video media items are in
+ * CVcxMyVideosVideoCache::iVideoList.
+ */
+ RArray iAlbums;
+
+ /**
+ * ETrue when iAlbumList is ready and iAlbums contains video IDs.
+ */
+ TBool iAlbumListIsComplete;
+
+ private:
+
+ /**
+ * Owner of this object.
+ */
+ CVcxMyVideosCollectionPlugin& iCollection;
+
+ /**
+ * Used in MDS operations to store MDS video (or relation) IDs.
+ */
+ RArray iMdsOpTargetIds;
+
+ /**
+ * Store album video data during relation deletion. This is to
+ * avoid second search when resp arrives.
+ */
+ RArray iRemoveFromAlbumVideos;
+
+ /**
+ * Used in MDS operations to store operation results. Is in sync with iMdsOpTargetIds.
+ */
+ RArray iMdsOpResults;
+
+ /**
+ * Used in MDS operations to store operation results. Is in sync with iMdsOpTargetIds.
+ */
+ RArray iMdsOpResultsUint32;
+
+ };
+
+#endif // VCXMYVIDEOSALBUMS_H
+
+
diff -r 48e74db5d516 -r bbb98528c666 videocollection/mpxmyvideoscollection/inc/vcxmyvideosasyncfileoperations.h
--- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideosasyncfileoperations.h Thu Apr 01 23:13:36 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosasyncfileoperations.h Thu Apr 01 23:22:15 2010 +0300
@@ -27,10 +27,6 @@
#include
#include
-//#include "mpxdbactivetask.h" // change to <> when moved to s60 dir and remove temp .h-file
-
-#include "vcxmyvideosdownloadutil.h"
-
// FORWARD DECLARATIONS
class CVcxMyVideosCollectionPlugin;
@@ -83,9 +79,10 @@
/**
* Performs one Move or Copy operation. Called by HandleStep.
*
- * @return ETrue if operation was the last one, EFalse othewise.
+ * @return MVcxMyVideosActiveTaskObserver::EDone if was last operation,
+ * MVcxMyVideosActiveTaskObserver::EMoreToCome otherwise.
*/
- TBool HandleMoveOrCopyStepL();
+ MVcxMyVideosActiveTaskObserver::TStepResult HandleMoveOrCopyStepL();
/**
* Moves or copies video to another drive.
@@ -110,9 +107,10 @@
/**
* Performs one Delete operation. Called by HandleStep.
*
- * @return ETrue if operation was the last one, EFalse otherwise.
+ * @return MVcxMyVideosActiveTaskObserver::EDone if was last operation,
+ * MVcxMyVideosActiveTaskObserver::EMoreToCome otherwise.
*/
- TBool HandleDeleteStepL();
+ MVcxMyVideosActiveTaskObserver::TStepResult HandleDeleteStepL();
private:
diff -r 48e74db5d516 -r bbb98528c666 videocollection/mpxmyvideoscollection/inc/vcxmyvideoscollectionplugin.h
--- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideoscollectionplugin.h Thu Apr 01 23:13:36 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideoscollectionplugin.h Thu Apr 01 23:22:15 2010 +0300
@@ -11,12 +11,11 @@
*
* Contributors:
*
-* Description: Implementation of My Videos MPX Collection Plugin interface*
+* Description: Implementation of My Videos MPX Collection Plugin interface*
*/
-
#ifndef VCXMYVIDEOSCOLLECTIONPLUGIN_H
#define VCXMYVIDEOSCOLLECTIONPLUGIN_H
@@ -30,18 +29,17 @@
#include "vcxmyvideosactivetask.h"
#include "vcxmyvideosmdsdb.h"
-#include "vcxmyvideosdownloadutil.h"
// FORWARD DECLARATIONS
class CVcxMyVideosMdsDb;
class CMPXResource;
class CMPXMediaArray;
-class CVcxMyVideosDownloadUtil;
class CVcxMyVideosVideoCache;
class CVcxMyVideosCategories;
class CVcxMyVideosMessageList;
class CVcxMyVideosAsyncFileOperations;
class CVcxMyVideosOpenHandler;
+class CVcxMyVideosAlbums;
// CONSTANTS
@@ -55,13 +53,13 @@
NONSHARABLE_CLASS(CVcxMyVideosCollectionPlugin) :
public CMPXCollectionPlugin,
public MVcxMyVideosMdsDbObserver,
- public MVcxMyVideosActiveTaskObserver,
- public MVcxMyVideosDownloadUtilObserver
+ public MVcxMyVideosActiveTaskObserver
{
public: // Constructors and destructor
friend class CVcxMyVideosOpenHandler;
friend class CVcxMyVideosVideoCache;
+ friend class CVcxMyVideosAlbums;
/**
* Two-phased constructor
@@ -190,7 +188,7 @@
/**
* From MMPXDbActiveTaskObserver
*/
- TBool HandleStepL();
+ MVcxMyVideosActiveTaskObserver::TStepResult HandleStepL();
/**
* From MMPXDbActiveTaskObserver
@@ -226,26 +224,12 @@
* From MVcxMyVideosMdsDbObserver. Called when media is removed or inserted.
*/
void HandleObjectPresentNotification();
-
+
/**
* Leaving version of HandleObjectPresentNotification.
*/
void DoHandleObjectPresentNotificationL();
-
- /**
- * From CVcxMyVideosDownloadUtilObserver.
- */
- void HandleDlEvent( TVcxMyVideosDownloadState aState,
- TUint32 aDownloadId, TInt aProgress, TInt64 aDownloaded,
- TInt32 aError, TInt32 aGlobalError );
-
- /**
- * Leaving version of HandleDlEvent.
- */
- void DoHandleDlEventL( TVcxMyVideosDownloadState aState,
- TUint32 aDownloadId, TInt aProgress, TInt64 aDownloaded,
- TInt32 aError, TInt32 aGlobalError );
-
+
private:
/**
* Constructor
@@ -256,38 +240,6 @@
* Symbian 2nd phase constructor.
*/
void ConstructL ();
-
- /**
- * Synchronizes set of videos in cache with Download Manager.
- * Download related attributes are set in cache if corresponding
- * download is found.
- *
- * @param aItemsInCache Array of MDS IDs.
- */
- void SyncWithDownloadsL( RArray& aItemsInCache );
-
- /**
- * Synchronizes video with Download Manager.
- *
- * @aVideo Video to synchronize.
- * @aEventAdded Set to ETrue if event was added to iMessageList, does not change the
- * value otherwise.
- */
- void SyncVideoWithDownloadsL( CMPXMedia& aVideo, TBool& aEventAdded,
- TBool aAddEvent = ETrue );
-
- /**
- * Copies download attributes from aDownload to aVideo.
- *
- * @param aVideo Video in cache.
- * @param aDownload Corresponding download in Download Manager.
- * @param aSendMpxEvent ETrue if MPX item has been modified and caller should
- * send the modification event.
- */
- void SyncVideoAndDownloadL(
- CMPXMedia& aVideo,
- RHttpDownload& aDownload,
- TBool& aSendMpxEvent );
/**
* Copies KVcxMediaMyVideosTransactionId field from aRequest to aResp.
@@ -318,24 +270,7 @@
* fetching ongoing.
*/
void RestartVideoListFetchingL();
-
-
- /**
- * Sets download ID to 0 and download state to none. Updates MDS and sends
- * modified event.
- *
- * @param aDownloadId Download ID of the MPX item.
- */
- void SetDownloadIdToZeroL( TUint aDownloadId );
-
-
-#ifdef _DEBUG
- /**
- * Returns download state as a descriptor.
- */
- const TDesC& DownloadState( TUint8 aDlState );
-#endif
-
+
public:
/**
@@ -363,23 +298,6 @@
void SendMyVideosMessageL( TUint32 aMessageId, CMPXCommand* aCommand = NULL );
/**
- * Synchronizes video list with Download Manager.
- *
- * @param aVideoList Video list to synchronize.
- * @param aStartPos Items before aStartPos index are left out from synchronizing.
- * @param aSendEvents If ETrue and modifications are done to the list, then
- * MPX events are sent.
- */
- void SyncVideoListWithDownloadsL( CMPXMedia& aVideoList,
- TBool aSendEvents, TInt aStartPos = 0 );
-
- /**
- * Returns reference to iDownloadUtil. If iDownloadUtil is NULL then
- * it is created.
- */
- CVcxMyVideosDownloadUtil& DownloadUtilL();
-
- /**
* Sends messages to clients. If udeb version, adds messageid
* parameter to the message for debugging purposes. May or may not
* contain media list as parameter.
@@ -394,13 +312,13 @@
* @return Reference to iCategories member.
*/
CVcxMyVideosCategories& CategoriesL();
-
+
/**
- * Notifies to mediator listeners that a download has completed.
+ * Creates iAlbums if its not created yet and returns reference to it.
*
- * @param aVideo Downloaded video.
+ * @return Reference to iAlbums member.
*/
- void NotifyDownloadCompletedL( CMPXMedia& aVideo );
+ CVcxMyVideosAlbums& AlbumsL();
/**
* Notifies to mediator listeners that count of new videos has decreased.
@@ -435,7 +353,7 @@
* Executes command in several small steps.
*/
CVcxMyVideosActiveTask* iActiveTask;
-
+
private:
/**
@@ -443,12 +361,12 @@
* Own.
*/
CVcxMyVideosCategories* iCategories;
-
+
/**
- * Download util, own.
+ * Albums related functionality (except mds db operations). Own.
*/
- CVcxMyVideosDownloadUtil* iDownloadUtil;
-
+ CVcxMyVideosAlbums* iAlbums;
+
/**
* Target drive for Move operation.
*/
diff -r 48e74db5d516 -r bbb98528c666 videocollection/mpxmyvideoscollection/inc/vcxmyvideoscollectionutil.h
--- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideoscollectionutil.h Thu Apr 01 23:13:36 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideoscollectionutil.h Thu Apr 01 23:22:15 2010 +0300
@@ -11,17 +11,17 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
-
#ifndef VCXMYVIDEOSCOLLECTIONUTIL_H
#define VCXMYVIDEOSCOLLECTIONUTIL_H
// INCLUDES
+#include
// FORWARD DECLARATIONS
class CMPXMedia;
@@ -83,6 +83,15 @@
RArray& aMdsIds );
/**
+ * Appends all items from aFromList to aToList. New items will point to
+ * same shared memory.
+ *
+ * @param aToList List in which items are appended to.
+ * @param aFromList List in which items are copied from.
+ */
+ static void AppendToListL( CMPXMedia& aToList, CMPXMedia& aFromList );
+
+ /**
* Converts drive letter to drive number.
*
* @param aDrive drive letter
@@ -207,6 +216,44 @@
*/
static TInt Origin( TInt aCategoryId );
+ /**
+ * Gets KMPXMediaArrayContents attribute from aMedia. Leaves
+ * with KErrArgument is attribute is not supported.
+ *
+ * @param aMedia Media where from the attribute is fetched.
+ * @return Pointer to media array.
+ */
+ static CMPXMediaArray* MediaArrayL( CMPXMedia& aMedia );
+
+ /**
+ * Gets KVcxMediaMyVideosInt32Value attribute from aMedia. Leaves
+ * with KErrArgument if attribute is not supported.
+ *
+ * @param aMedia Media where from the attribute is fetched.
+ * @return Value of KVcxMediaMyVideosInt32Value attribute.
+ */
+ static TInt32 Int32ValueL( CMPXMedia& aMedia );
+
+ /**
+ * Gets KVcxMediaMyVideosUint32Value attribute from aMedia. Leaves
+ * with KErrArgument if attribute is not supported.
+ *
+ * @param aMedia Media where from the attribute is fetched.
+ * @return Value of KVcxMediaMyVideosUint32Value attribute.
+ */
+ static TUint32 Uint32ValueL( CMPXMedia& aMedia );
+
+ /**
+ * Gets KMPXMediaGeneralId attributes from aMediaArray and
+ * puts them to aIdArray. aIdArray is reset before adding.
+ *
+ * @param aMediaArray Media array containing media items which
+ * have KMPXMediaGeneralId attribute set.
+ * @param aIdArray Array where to the IDs are written to.
+ */
+ static void GetIdsFromMediaArrayL( CMPXMediaArray& aMediaArray,
+ RArray& aIdArray );
+
#ifdef _DEBUG
/**
* Prints process names which have file handle open to aFileName
diff -r 48e74db5d516 -r bbb98528c666 videocollection/mpxmyvideoscollection/inc/vcxmyvideosdownloadcache.h
--- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideosdownloadcache.h Thu Apr 01 23:13:36 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of the License "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Contains cached MDS media items which are being downloaded.*
-*/
-
-
-
-
-#ifndef VCXMYVIDEOSDOWNLOADCACHE_H
-#define VCXMYVIDEOSDOWNLOADCACHE_H
-
-// INCLUDES
-
-// FORWARD DECLARATIONS
-class CMPXMedia;
-
-// CONSTANTS
-
-// CLASS DECLARATION
-
-/**
-* Used for storing download ids and media object pointers to circular buffers for fast access.
-*
-* @lib mpxmyvideoscollectionplugin.lib
-*/
-NONSHARABLE_CLASS(CVcxMyVideosDownloadCache) : public CBase
- {
- public: // Constructors and destructor
-
- /**
- * Two-phased constructor
- * @return Object constructed
- */
- static CVcxMyVideosDownloadCache* NewL();
-
- /**
- * Destructor
- */
- virtual ~CVcxMyVideosDownloadCache();
-
- private:
- /**
- * Constructor
- */
- CVcxMyVideosDownloadCache();
-
- /**
- * Symbian 2nd phase constructor.
- */
- void ConstructL ();
-
- public:
- /**
- * Tries to find item with aDownloadId from Download Cache.
- *
- * @param aDownloadId Download ID in Download Manager.
- * @return Returns pointer to media object, NULL if not found.
- * Ownership does not move.
- */
- CMPXMedia* Get( TUint32 aDownloadId );
-
- /**
- * Adds download ID and index pair to Download Cache.
- *
- * @param aDownloadId Download ID in Download Manager
- * @param aVideo Pointer to video, ownership does not move.
- */
- void Add( TUint32 aDownloadId, CMPXMedia* aVideo );
-
- /**
- * Deletes item from Download Cache
- *
- * @param aVideo Video to remove.
- */
- void Delete( CMPXMedia* aVideo );
-
- private:
-
- /**
- * Array used as circular buffer, contains download ids.
- */
- RArray iDownloadId;
-
- /**
- * Array used as circular buffer, contains pointers to medias.
- */
- RPointerArray iMedia;
-
- /**
- * Current position of the circular buffers (iDownloadId and iMedia).
- * Next item added is written to this position.
- */
- TInt iPos;
-
- };
-
-#endif // VCXMYVIDEOSVIDEOCACHE_H
-
-
diff -r 48e74db5d516 -r bbb98528c666 videocollection/mpxmyvideoscollection/inc/vcxmyvideosmdsalbums.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosmdsalbums.h Thu Apr 01 23:22:15 2010 +0300
@@ -0,0 +1,500 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Provides albums support from MDS*
+*/
+
+
+
+#ifndef VCXMYVIDEOSMDSALBUMS_H
+#define VCXMYVIDEOSMDSALBUMS_H
+
+// INCLUDES
+#include
+#include
+#include "vcxmyvideosalbum.h"
+#include "vcxmyvideosmdsdb.h"
+
+// FORWARD DECLARATIONS
+class CMPXMedia;
+
+// CONSTANTS
+
+// CLASS DECLARATION
+
+/**
+* Provides albums support, uses MDS.
+*
+* @lib mpxmyvideoscollectionplugin.lib
+*/
+NONSHARABLE_CLASS(CVcxMyVideosMdsAlbums) :
+ public CActive,
+ public MMdEQueryObserver,
+ public MMdERelationItemObserver
+#if 0 // not used
+ ,
+ public MMdERelationObserver
+#endif
+ {
+ public: // Constructors and destructor
+
+ friend class CVcxMyVideosMdsCmdQueue;
+
+ enum TVcxAsyncOperation
+ {
+ EVcxNone,
+ EVcxAddVideosToAlbum,
+ EVcxRemoveRelations,
+ EVcxRemoveAlbums
+ };
+
+ /**
+ * Constructor.
+ *
+ * @param aMdsDb Owner of this object.
+ * @param aObserver Object which is listening album related events. If NULL, then
+ * no observer is set.
+ */
+ static CVcxMyVideosMdsAlbums* NewL( CVcxMyVideosMdsDb& aMdsDb,
+ MVcxMyVideosMdsAlbumsObserver* aObserver );
+
+ /**
+ * Destructor
+ */
+ virtual ~CVcxMyVideosMdsAlbums();
+
+ public: // new methods
+
+ /**
+ * Cancels possible ongoing asynchronous request.
+ *
+ * @param aType Defines what kind of request is cancelled.
+ */
+ void Cancel( CVcxMyVideosMdsDb::TRequestType aType = CVcxMyVideosMdsDb::EAll );
+
+ /**
+ * Gets My Videos albums from MDS asynchronously.
+ * HandleGetAlbumsResp() callback function is called when ready.
+ * Utilizes CVcxMyVideosMdsCmdQueue.
+ *
+ * @param aAlbumList Album list is written here. Caller owns this, ownership
+ * does not move.
+ * @param aClient Response call is done to this object.
+ */
+ void GetAlbumsL( CMPXMedia* aAlbumList, MVcxMyVideosMdsAlbumsObserver& aClient );
+
+ /**
+ * Gets album content IDs asynchronously.
+ * HandleGetAlbumContentIdsResp() callback function is called when ready.
+ * Utilizes CVcxMyVideosMdsCmdQueue.
+ *
+ * @param aAlbumId Album ID.
+ * @param aContentArray Item IDs which belog to aAlbum are written here. Caller must
+ * keep aContentArray available until HandleGetAlbumContentIdsResp
+ * has been called.
+ * @param aClient Response call is done to this object.
+ */
+ void GetAlbumContentIdsL( TUint32 aAlbumId, RArray& aContentArray,
+ MVcxMyVideosMdsAlbumsObserver& aClient );
+
+ /**
+ * Gets album content videos asynchronously.
+ * HandleGetAlbumContentVideosResp() callback function is called when ready.
+ * Utilizes CVcxMyVideosMdsCmdQueue.
+ *
+ * @param aAlbumId Album ID.
+ * @param aVideoList Media containing media array. Video media objects are added to media array.
+ * Caller must keep aVideoList available until callback has been called.
+ * @param aClient Response call is done to this object.
+ */
+ void GetAlbumContentVideosL( TUint32 aAlbumId, CMPXMedia& aVideoList,
+ MVcxMyVideosMdsAlbumsObserver& aClient );
+
+ /**
+ * Adds videos to album asynchronously. HandleAddVideosToAlbumResp() callback function
+ * is called when operation finishes.
+ * Utilizes CVcxMyVideosMdsCmdQueue.
+ *
+ * @param aMpxCmd Media containing command parameters: album ID and video ID list.
+ * Results are also written to this object. See media structure and
+ * used attributes from vcxmyvideosdef.c file,
+ * KVcxCommandMyVideosAddToAlbum command. Ownership does not move.
+ *
+ * @param aClient Response call is done to this object.
+ */
+ void AddVideosToAlbumL( CMPXMedia* aMpxCmd, MVcxMyVideosMdsAlbumsObserver& aClient );
+
+ /**
+ * Removes relations asynchronously.
+ * Utilizes CVcxMyVideosMdsCmdQueue.
+ *
+ * @param aRelationIds Relations which are removed.
+ * @param aResults In sync with aRelationIds. Result codes, KErrNone if successful,
+ * KErrGeneral if failed.
+ * @param aClient Response call is done to this object.
+ */
+ void RemoveRelationsL( RArray& aRelationIds,
+ RArray& aResults, MVcxMyVideosMdsAlbumsObserver& aClient );
+
+ /**
+ * Adds album to MDS. aAlbum should have KMPXMediaGeneralTitle attribute
+ * set. The MDS item ID of the created album is written to KMPXMediaGeneralId
+ * attribute.
+ *
+ * @param aAlbum Album which is added to database.
+ */
+ void AddAlbumL( CMPXMedia& aAlbum );
+
+ /**
+ * Removes albums asynchronously. HandleRemoveAlbumsResp() callback function
+ * is called when operation finishes.
+ * Utilizes CVcxMyVideosMdsCmdQueue.
+ *
+ * @param aMpxCmd Media containing command parameters: media array containing album IDs.
+ * Results are also written to this object. See media structure and
+ * used attributes from vcxmyvideosdef.c file,
+ * KVcxCommandMyVideosRemoveAlbums command. Ownership does not move.
+ *
+ * @param aClient Response call is done to this object.
+ */
+ void RemoveAlbumsL( CMPXMedia* aMpxCmd, MVcxMyVideosMdsAlbumsObserver& aClient );
+
+ protected:
+
+ /**
+ * From CActive.
+ * Called when operation completes.
+ */
+ void RunL();
+
+ /**
+ * From CActive.
+ * Actual implementation for cancelling.
+ */
+ void DoCancel();
+
+ private:
+
+ /**
+ * Constructor
+ */
+ CVcxMyVideosMdsAlbums( CVcxMyVideosMdsDb& aMdsDb,
+ MVcxMyVideosMdsAlbumsObserver* aObserver );
+
+ /**
+ * Symbian 2nd phase constructor.
+ */
+ void ConstructL();
+
+ /**
+ * Copies album data from aObject to aAlbum.
+ *
+ * @param aObject MDS object to copy data from.
+ * @param aAlbum MPX media to copy data to.
+ */
+ void Object2MediaL( CMdEObject& aObject, CMPXMedia& aAlbum );
+
+ /**
+ * Copies album data from aAlbum to aObject.
+ *
+ * @param aAlbum MPX media to copy data from.
+ * @param aObject MDS object to copy data to.
+ */
+ void Media2ObjectL( CMPXMedia& aAlbum, CMdEObject& aObject);
+
+ /**
+ * Gets various defintions from MDS and stores them to member variables.
+ */
+ void GetSchemaDefinitionsL();
+
+ /**
+ * Gets My Videos albums from MDS asynchronously.
+ * HandleGetAlbumsResp() callback function is called when ready.
+ *
+ * @param aAlbumList Album list is written here. Caller owns this, ownership
+ * does not move.
+ * @param aClient Callback is done to this object.
+ */
+ void DoGetAlbumsL( CMPXMedia* aAlbumList, MVcxMyVideosMdsAlbumsObserver& aClient );
+
+ /**
+ * Gets album content IDs from MDS asynchronously.
+ * HandleGetAlbumContentIdsResp() callback function is called when ready.
+ *
+ * @param aAlbumId Album ID.
+ * @param aContentArray Array containing MDS IDs which belong to aAlbum.
+ * Caller is responsible to keep array available
+ * until HandleGetAlbumContentResp has been called.
+ * @param aClient Callback is done to this object.
+ */
+ void DoGetAlbumContentIdsL( TUint32 aAlbumId,
+ RArray& aContentArray,
+ MVcxMyVideosMdsAlbumsObserver& aClient );
+
+ /**
+ * Gets album content videos from MDS asynchronously.
+ * HandleGetAlbumContentVideosResp() callback function is called when ready.
+ *
+ * @param aAlbumId Album ID.
+ * @param aVideoList Media containing empty media array. Videos are added to array. Caller
+ * must keep aVideoList available until HandleGetAlbumContentVideosResp
+ * is called.
+ * @param aClient Callback is done to this object.
+ */
+ void DoGetAlbumContentVideosL( TUint32 aAlbumId, CMPXMedia& aVideoList,
+ MVcxMyVideosMdsAlbumsObserver& aClient );
+
+ /**
+ * Adds videos to album asynchronously. HandleAddVideosToAlbumResp() callback function
+ * is called when operation finishes.
+ *
+ * @param aMpxCmd Media containing command parameters: album ID and video ID list.
+ * Results are also written to this object. See media structure and
+ * used attributes from vcxmyvideosdef.c file,
+ * KVcxCommandMyVideosAddToAlbum command. Ownership does not move.
+ * @param aClient Response call is done to this object.
+ */
+ void DoAddVideosToAlbumL( CMPXMedia* aMpxCmd, MVcxMyVideosMdsAlbumsObserver& aClient );
+
+ /**
+ * Removes relations asynchronously.
+ *
+ * @param aRelationIds Relations which are removed.
+ * @param aResults In sync with aRelationIds. Result codes, KErrNone if successful,
+ * KErrGeneral if failed.
+ * @param aClient Response call is done to this object.
+ */
+ void DoRemoveRelationsL( RArray& aRelationIds,
+ RArray& aResults, MVcxMyVideosMdsAlbumsObserver& aClient );
+
+ /**
+ * Removes albums asynchronously.
+ *
+ * @param aMpxCmd Media containing command parameters: array with albums IDs.
+ * @param aClient Response call is done to this object.
+ */
+ void CVcxMyVideosMdsAlbums::DoRemoveAlbumsL( CMPXMedia* aMpxCmd,
+ MVcxMyVideosMdsAlbumsObserver& aClient );
+
+ /**
+ * Handles album query responses.
+ *
+ * @param aQuery Query instance.
+ * @param aError KErrNone
, if the query was completed
+ * successfully. Otherwise one of the system-wide error
+ * codes.
+ */
+ void HandleAlbumQueryCompletedL(CMdEQuery& aQuery, TInt aError);
+
+ /**
+ * Handles video query responses.
+ *
+ * @param aQuery Query instance.
+ * @param aError KErrNone
, if the query was completed
+ * successfully. Otherwise one of the system-wide error
+ * codes.
+ * @param aFirstNewItemIndex Index of the first new item in the query.
+ * @param aNewItemCount How many new items were added.
+ * @param aComplete ETrue if query is complete, EFalse if new to come.
+ */
+ void HandleVideoQueryResultsL( CMdEQuery& aQuery, TInt aError,
+ TInt aFirstNewItemIndex, TInt aNewItemCount, TBool aComplete );
+
+ /**
+ * Handles relation query responses.
+ *
+ * @param aQuery Query instance.
+ * @param aError KErrNone
, if the query was completed
+ * successfully. Otherwise one of the system-wide error
+ * codes.
+ */
+ void HandleRelationQueryCompletedL( CMdEQuery& aQuery, TInt aError );
+
+ /**
+ * Called from RunL when video adding to album completes.
+ */
+ void HandleAddVideosToAlbumCompletedL();
+
+ /**
+ * Called from RunL when relations remove completes.
+ */
+ void HandleRemoveRelationsCompletedL();
+
+ /**
+ * Called from RunL when albums remove completes.
+ */
+ void HandleRemoveAlbumsCompletedL();
+
+ public:
+
+ /**
+ * From MMdEQueryObserver.
+ * Called to notify the observer that new results have been received
+ * in the query.
+ *
+ * @param aQuery Query instance that received new results.
+ * @param aFirstNewItemIndex Index of the first new item that was added
+ * to the result item array.
+ * @param aNewItemCount Number of items added to the result item
+ * array.
+ */
+ void HandleQueryNewResults(CMdEQuery& aQuery,
+ TInt aFirstNewItemIndex,
+ TInt aNewItemCount);
+
+ /**
+ * From MMdEQueryObserver.
+ * Called to notify the observer that the query has been completed,
+ * or that an error has occured.
+ *
+ * @param aQuery Query instance.
+ * @param aError KErrNone
, if the query was completed
+ * successfully. Otherwise one of the system-wide error
+ * codes.
+ */
+ void HandleQueryCompleted(CMdEQuery& aQuery, TInt aError);
+
+ /**
+ * From MMdERelationItemObserver
+ */
+ void HandleRelationItemNotification(CMdESession& aSession,
+ TObserverNotificationType aType,
+ const RArray& aRelationArray);
+
+#if 0 //not used
+ /**
+ * From MMdERelationObserver
+ */
+ void HandleRelationNotification(CMdESession& aSession,
+ TObserverNotificationType aType,
+ const RArray& aRelationIdArray);
+#endif
+
+ private:
+
+ /**
+ * Main class for Mds operations. Owns session to MDS.
+ */
+ CVcxMyVideosMdsDb& iMdsDb;
+
+ /**
+ * Observer of albums related events. May be NULL.
+ * not own.
+ */
+ MVcxMyVideosMdsAlbumsObserver* iObserver;
+
+ /**
+ * Asynchronous album object fetching query is stored here. Own.
+ */
+ CMdEObjectQuery* iAlbumQuery;
+
+ /**
+ * Asynchronous video object fetching query is stored here. Own.
+ */
+ CMdEObjectQuery* iVideoQuery;
+
+ /**
+ * Asynchronous relation fetching query is stored here. Own.
+ */
+ CMdERelationQuery* iRelationQuery;
+
+ /**
+ * The default namespace definition, not own.
+ */
+ CMdENamespaceDef* iNamespaceDef;
+
+ /**
+ * Album object definition, not own.
+ */
+ CMdEObjectDef* iAlbumObjectDef;
+
+ /**
+ * Album type property definition, not own.
+ */
+ CMdEPropertyDef* iTypePropertyDef;
+
+ /**
+ * "Contains" relation definition, not own.
+ */
+ CMdERelationDef* iContainsRelationDef;
+
+ /**
+ * Pointer to album list which is being fetched from MDS. Not own.
+ */
+ CMPXMedia* iAlbumList;
+
+ /**
+ * Pointer to video list which is being fetched from MDS. Not own.
+ */
+ CMPXMedia* iVideoList;
+
+ /**
+ * When doing some async operation to MDS, the album ID is stored here.
+ */
+ TUint32 iAlbumId;
+
+ /**
+ * When fetching album content from MDS, the pointer to content array is stored here.
+ * Only MDS ID is filled to TVideo.
+ * Not own.
+ */
+ RArray* iAlbumContent;
+
+ /**
+ * The pending async operation ID is stored here.
+ */
+ TVcxAsyncOperation iAsyncOperation;
+
+ /**
+ * Used for storing items during async mds operations.
+ */
+ RPointerArray iItemArray;
+
+ /**
+ * Used for storing result buffer during async mds operations.
+ */
+ RMdEDataBuffer iResultBuffer;
+
+ /**
+ * Used in async operations to store
+ * pointer to result array (which is owned by the user).
+ */
+ RArray* iResultArray;
+
+ /**
+ * Used in async operations to store
+ * pointer to result array (which is owned by the user).
+ */
+ RArray* iResultArrayUint32;
+
+ /**
+ * Used in async oprations (EVcxAddVideosToAlbum and EVcxRemoveVideosFromAlbum) to store
+ * pointer to item ID array (which is owned by the user).
+ */
+ RArray* iIdArray;
+
+ /**
+ * Used to store command parameters during async MDS operations. Not owned.
+ */
+ CMPXMedia* iMpxCmd;
+
+ /**
+ * Used to store pointer to client who initiated the async operation.
+ */
+ MVcxMyVideosMdsAlbumsObserver* iClient;
+
+ };
+
+#endif // VCXMYVIDEOSMDSALBUMS_H
+
+
diff -r 48e74db5d516 -r bbb98528c666 videocollection/mpxmyvideoscollection/inc/vcxmyvideosmdscmdqueue.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosmdscmdqueue.h Thu Apr 01 23:22:15 2010 +0300
@@ -0,0 +1,330 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Queues commands to MDS.
+*/
+
+
+
+#ifndef VCXMYVIDEOSMDSCMDQUEUE_H
+#define VCXMYVIDEOSMDSCMDQUEUE_H
+
+// INCLUDES
+#include
+#include "vcxmyvideosalbum.h"
+#include "vcxmyvideosmdsdb.h"
+
+// FORWARD DECLARATIONS
+class CMPXMedia;
+
+// CONSTANTS
+
+// CLASS DECLARATION
+
+/**
+* All MDS commands inherit this.
+*
+* @lib mpxmyvideoscollectionplugin.lib
+*/
+NONSHARABLE_CLASS(CVcxMyVideosMdsCmd) : public CBase
+ {
+ public:
+
+ /**
+ * Destructor
+ */
+ virtual ~CVcxMyVideosMdsCmd() {}
+
+ /**
+ * Command type. Used for casting the pointer to correct type.
+ */
+ CVcxMyVideosMdsDb::TRequestType iCmdType;
+
+ /**
+ * Pointer to client is stored here, used for performing response call.
+ */
+ MVcxMyVideosMdsAlbumsObserver* iClient;
+ };
+
+/**
+* Class which encapsulates GetVideoListL function parameters.
+*
+* @lib mpxmyvideoscollectionplugin.lib
+*/
+NONSHARABLE_CLASS(CVcxMyVideosMdsCmdGetVideoList) : public CVcxMyVideosMdsCmd
+ {
+ public:
+
+ /**
+ * Constructor
+ */
+ CVcxMyVideosMdsCmdGetVideoList() {}
+
+ /**
+ * Destructor
+ */
+ virtual ~CVcxMyVideosMdsCmdGetVideoList() {}
+
+ public:
+ /**
+ * Stored CreateVideoListL function parameters, see meanings from vcxmyvideosmdsdb.h file.
+ */
+ TVcxMyVideosSortingOrder iSortingOrder;
+ TBool iAscending;
+ TBool iFullDetails;
+ CMPXMedia** iVideoList;
+ };
+
+/**
+* Class which stores GetAlbumsL function arguments.
+*
+* @lib mpxmyvideoscollectionplugin.lib
+*/
+NONSHARABLE_CLASS(CVcxMyVideosMdsCmdGetAlbums) : public CVcxMyVideosMdsCmd
+ {
+ public: // Constructors and destructor
+
+ /**
+ * Constructor
+ */
+ CVcxMyVideosMdsCmdGetAlbums() {}
+
+ /**
+ * Destructor
+ */
+ virtual ~CVcxMyVideosMdsCmdGetAlbums() {}
+
+ public:
+ /**
+ * Stored GetAlbumsL function parameters, see meanings from vcxmyvideosmdsalbums.h file.
+ */
+ CMPXMedia* iAlbumList;
+ };
+
+/**
+* Class which stores GetAlbumContentIdsL function arguments.
+*
+* @lib mpxmyvideoscollectionplugin.lib
+*/
+NONSHARABLE_CLASS(CVcxMyVideosMdsCmdGetAlbumContentIds) : public CVcxMyVideosMdsCmd
+ {
+ public: // Constructors and destructor
+
+ /**
+ * Constructor
+ */
+ CVcxMyVideosMdsCmdGetAlbumContentIds() {}
+
+ /**
+ * Destructor
+ */
+ virtual ~CVcxMyVideosMdsCmdGetAlbumContentIds() {}
+
+ public:
+ /**
+ * Stored GetAlbumContentL function parameters, see meanings from vcxmyvideosmdsalbums.h file.
+ */
+ TUint32 iAlbumId;
+ RArray* iAlbumContent; //not own
+ };
+
+/**
+* Class which stores GetAlbumContentVideosL function arguments.
+*
+* @lib mpxmyvideoscollectionplugin.lib
+*/
+NONSHARABLE_CLASS(CVcxMyVideosMdsCmdGetAlbumContentVideos) : public CVcxMyVideosMdsCmd
+ {
+ public: // Constructors and destructor
+
+ /**
+ * Constructor
+ */
+ CVcxMyVideosMdsCmdGetAlbumContentVideos() {}
+
+ /**
+ * Destructor
+ */
+ virtual ~CVcxMyVideosMdsCmdGetAlbumContentVideos() {}
+
+ public:
+ /**
+ * Stored GetAlbumContentL function parameters, see meanings from vcxmyvideosmdsalbums.h file.
+ */
+ TUint32 iAlbumId;
+ CMPXMedia* iAlbumContentVideos; //not own
+ };
+
+/**
+* Class which stores AddVideosToAlbumL function arguments.
+*
+* @lib mpxmyvideoscollectionplugin.lib
+*/
+NONSHARABLE_CLASS(CVcxMyVideosMdsCmdAddVideosToAlbum) : public CVcxMyVideosMdsCmd
+ {
+ public: // Constructors and destructor
+
+ /**
+ * Constructor
+ */
+ CVcxMyVideosMdsCmdAddVideosToAlbum() {}
+
+ /**
+ * Destructor
+ */
+ virtual ~CVcxMyVideosMdsCmdAddVideosToAlbum() {}
+
+ public:
+ /**
+ * Stored AddVideosToAlbumL function parameters, see meanings from vcxmyvideosdefs.h
+ * KVcxCommandMyVideosAddToAlbum command descriptions.
+ */
+ CMPXMedia* iMpxCmd;
+ };
+
+/**
+* Class which stores RemoveRelationsL function arguments.
+*
+* @lib mpxmyvideoscollectionplugin.lib
+*/
+NONSHARABLE_CLASS(CVcxMyVideosMdsCmdRemoveRelations) : public CVcxMyVideosMdsCmd
+ {
+ public: // Constructors and destructor
+
+ /**
+ * Constructor
+ */
+ CVcxMyVideosMdsCmdRemoveRelations() {}
+
+ /**
+ * Destructor
+ */
+ virtual ~CVcxMyVideosMdsCmdRemoveRelations() {}
+
+ public:
+ /**
+ * Stored RemoveRelationsL function parameters, see meanings from vcxmyvideosmdsalbums.h file.
+ */
+ RArray* iRelationIds; //not own
+ RArray* iResults; //not own
+ };
+
+/**
+* Class which stores RemoveAlbumsL function arguments.
+*
+* @lib mpxmyvideoscollectionplugin.lib
+*/
+NONSHARABLE_CLASS(CVcxMyVideosMdsCmdRemoveAlbums) : public CVcxMyVideosMdsCmd
+ {
+ public: // Constructors and destructor
+
+ /**
+ * Constructor
+ */
+ CVcxMyVideosMdsCmdRemoveAlbums() {}
+
+ /**
+ * Destructor
+ */
+ virtual ~CVcxMyVideosMdsCmdRemoveAlbums() {}
+
+ public:
+ /**
+ * Stored RemoveAlbumsL function parameters, see meanings from vcxmyvideosmdsalbums.h file.
+ */
+ CMPXMedia* iMpxCmd; //not own
+ };
+
+/**
+* Queues MDS commands.
+*
+* @lib mpxmyvideoscollectionplugin.lib
+*/
+NONSHARABLE_CLASS(CVcxMyVideosMdsCmdQueue) : public CBase
+ {
+ public: // Constructors and destructor
+
+ /**
+ * Two-phased constructor
+ * @return object constructed
+ */
+ static CVcxMyVideosMdsCmdQueue* NewL( CVcxMyVideosMdsDb& aMdsDb );
+
+ /**
+ * Destructor
+ */
+ virtual ~CVcxMyVideosMdsCmdQueue();
+
+ public: // new methods
+
+ /**
+ * Executes command if queue is empty, otherwise adds it to queue.
+ * Ownership of aCmd moves to this object.
+ *
+ * @param aCmd Command to execute.
+ */
+ void ExecuteCmdL( CVcxMyVideosMdsCmd* aCmd );
+
+ /**
+ * Called when command finishes. Executes next command from the queue.
+ */
+ void CmdFinished();
+
+ /**
+ * Removes commands from command queue.
+ *
+ * @param aType Defines what kind of commands are removed from the command queue.
+ */
+ void Cancel( CVcxMyVideosMdsDb::TRequestType aType = CVcxMyVideosMdsDb::EAll );
+
+ private:
+
+ /**
+ * Constructor
+ */
+ CVcxMyVideosMdsCmdQueue( CVcxMyVideosMdsDb& aMdsDb );
+
+ /**
+ * Symbian 2nd phase constructor.
+ */
+ void ConstructL();
+
+ /**
+ * Executes the command.
+ *
+ * @param aCmd Command to execute, ownership does not move.
+ */
+ void DoExecuteCmdL( CVcxMyVideosMdsCmd* aCmd );
+
+ private:
+
+ /**
+ * Owner of this object.
+ */
+ CVcxMyVideosMdsDb& iMdsDb;
+
+ /**
+ * Command queue. Own.
+ */
+ RArray iQueue;
+
+ /**
+ * Set to ETrue when command is started and to EFalse
+ * when command finishes.
+ */
+ TBool iCmdInProgress;
+ };
+
+#endif // VCXMYVIDEOSMDSCMDQUEUE_H
+
+
diff -r 48e74db5d516 -r bbb98528c666 videocollection/mpxmyvideoscollection/inc/vcxmyvideosmdsdb.h
--- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideosmdsdb.h Thu Apr 01 23:13:36 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosmdsdb.h Thu Apr 01 23:22:15 2010 +0300
@@ -11,12 +11,11 @@
*
* Contributors:
*
-* Description: MPX My Videos collection plugins' MDS database class*
+* Description: MPX My Videos collection plugins' MDS database class*
*/
-
#ifndef VCXMYVIDEOSMDSDB_H
#define VCXMYVIDEOSMDSDB_H
@@ -25,14 +24,19 @@
#include
#include
#include
+#include
+#include "vcxmyvideosalbum.h"
+
+class CVcxMyVideosMdsAlbums;
+class CMPXMedia;
+class CVcxMyVideosMdsCmdQueue;
/**
* MPX My Videos collection MDS database observer class.
* Part of ECOM Plugin.
*/
NONSHARABLE_CLASS(MVcxMyVideosMdsDbObserver)
- {
-
+ {
public:
/*
@@ -56,7 +60,7 @@
virtual void HandleMyVideosDbEvent( TMPXChangeEventType aEvent, RArray& aId ) = 0;
/**
- * Handler function for list fetching events. This callback is called as a response
+ * Handler function for video list fetching events. This callback is called as a response
* to CreateVideoList( aSync = EFalse ).
*
* @param aVideoList List of videos fetched from MDS.
@@ -77,7 +81,86 @@
/**
- * MPX My Videos collection ECOM plugins' MDS database class.
+ * MPX My Videos collection MDS albums related functionality observer class.
+ * Part of ECOM Plugin.
+ */
+NONSHARABLE_CLASS(MVcxMyVideosMdsAlbumsObserver)
+ {
+ public:
+
+ /**
+ * This callback is called as a response to GetAlbumsL.
+ *
+ * @param aAlbumList List of albums fetched from MDS.
+ */
+ virtual void HandleGetAlbumsResp( CMPXMedia* aAlbumList ) = 0;
+
+ /**
+ * This callback is called as a response to GetAlbumContentIdsL.
+ *
+ * @param aAlbumId Album ID which was fetched.
+ * @param aContentArray Array containing MDS object IDs. This array is the same which
+ * was given in GetAlbumContentIdsL call.
+ */
+ virtual void HandleGetAlbumContentIdsResp( TUint32 aAlbumId,
+ RArray& aContentArray ) = 0;
+
+ /**
+ * Called as a response to GetAlbumContentVideosL.
+ *
+ * @param aAlbumId ID of the album containing the result videos.
+ * @param aVideoList Media containing array of videos.
+ * @param aError Error code in case of failure.
+ * @param aFirstNewItemIndex Index of the first new item.
+ * @param aNewItemCount How many new items in the query since the last results.
+ * @param aComplete ETrue if query is complete, EFalse if there is more to come.
+ */
+ virtual void HandleGetAlbumContentVideosResp( TUint32 aAlbumId, CMPXMedia& aVideoList,
+ TInt aError, TInt aFirstNewItemIndex, TInt aNewItemCount, TBool aComplete ) = 0;
+
+ /**
+ * Called as a response to AddVideosToAlbumL. Results are written from aItemArray
+ * to aCmd (KVcxMediaMyVideosInt32Value attribute). KErrNone if operation was successful,
+ * KErrGeneral otherwise.
+ *
+ * @param aCmd Pointer to same object which was given in AddVideosToAlbumL function call.
+ * @param aItemArray Array of relation items that were added to MDS.
+ */
+ virtual void HandleAddVideosToAlbumResp( CMPXMedia* aCmd,
+ RPointerArray& aItemArray ) = 0;
+
+ /**
+ * Called as a response to RemoveRelationsL.
+ *
+ * @param aRelationIds Relations which were tried to be removed.
+ * @param aResults Result codes, in sync with aRelationIds. KErrNone if successful,
+ * KErrGeneral if failed.
+ */
+ virtual void HandleRemoveRelationsResp( RArray& aRelationIds,
+ RArray& aResults ) = 0;
+
+ /**
+ * Called as a response to RemoveAlbumsL.
+ *
+ * @param aCmd Cmd which was given in RemoveAlbumsL call.
+ * @param aResults Result IDs.
+ */
+ virtual void HandleRemoveAlbumsResp( CMPXMedia* aCmd,
+ RArray& aResultIds ) = 0;
+
+ /**
+ * Event handler function for relation delete events.
+ *
+ * @param aType Event type
+ * @param aRelationArray Array containing relations.
+ */
+ virtual void HandleRelationEvent( TObserverNotificationType aType,
+ const RArray& aRelationArray ) = 0;
+
+ };
+
+/**
+ * MPX My Videos collection ECOM plugin's MDS database class.
*/
NONSHARABLE_CLASS(CVcxMyVideosMdsDb) :
public CBase,
@@ -89,17 +172,34 @@
public:
+ friend class CVcxMyVideosMdsAlbums;
+ friend class CVcxMyVideosMdsCmdQueue;
+
+ enum TRequestType
+ {
+ EAll,
+ EGetVideoList,
+ EGetAlbums,
+ EGetAlbumContentIds,
+ EGetAlbumContentVideos,
+ EAddVideosToAlbum,
+ ERemoveRelations,
+ ERemoveAlbums
+ };
+
/**
* Two-phased constructor.
* @param aObserver The db change observer.
*/
- static CVcxMyVideosMdsDb* NewL( MVcxMyVideosMdsDbObserver* aObserver, RFs& aFs );
+ static CVcxMyVideosMdsDb* NewL( MVcxMyVideosMdsDbObserver* aObserver,
+ MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver, RFs& aFs );
/**
* Two-phased constructor.
* @param aObserver The db change observer.
*/
- static CVcxMyVideosMdsDb* NewLC( MVcxMyVideosMdsDbObserver* aObserver, RFs& aFs );
+ static CVcxMyVideosMdsDb* NewLC( MVcxMyVideosMdsDbObserver* aObserver,
+ MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver, RFs& aFs );
/**
@@ -108,9 +208,30 @@
virtual ~CVcxMyVideosMdsDb();
/**
- * Cancels possible ongoing asynchronous operation.
+ * Cancels possible ongoing asynchronous operations.
+ *
+ * @param aType What kind of requests are cancelled.
*/
- void Cancel();
+ void Cancel( TRequestType aType = EAll );
+
+ /**
+ * Creates list of videos from MDS. This function utilizes CVcxMyVideosMdsQueue, ie
+ * commands are put in queue if there are other commands pending.
+ *
+ * @param aSortingOrder Sorting order, see values from TSortingOrder.
+ * @param aAscending Sort direction, if ETrue then ascending, else descending.
+ * @param aFullDetails If ETrue, then all details will be filled to media objects,
+ * if EFalse, then only subset.
+ * @param aVideoList Reference to pointer variable. Container type CMPXMedia class, contains
+ * CMPXMediaArray filled with CMPXMedia objects. If aVideoList
+ * pointer variable is NULL, then new medialist is created.
+ * If pointer variable already contains value, then the given medialist
+ * should have empty media array. New items are appended to it.
+ * Caller naturally owns the data.
+ *
+ */
+ void CreateVideoListL( TVcxMyVideosSortingOrder aSortingOrder,
+ TBool aAscending, TBool aFullDetails, CMPXMedia*& aVideoList );
/**
* Add new video.
@@ -137,24 +258,6 @@
void UpdateVideoL( CMPXMedia& aVideo );
/**
- * Create list of videos from MDS.
- *
- * @param aSortingOrder Sorting order, see values from TSortingOrder.
- * @param aAscending Sort direction, if ETrue then ascending, else descending.
- * @param aFullDetails If ETrue, then all details will be filled to media objects,
- * if EFalse, then only subset.
- * @param aVideoList Reference to pointer variable. Container type CMPXMedia class, contains
- * CMPXMediaArray filled with CMPXMedia objects. If aVideoList
- * pointer variable is NULL, then new medialist is created.
- * If pointer variable already contains value, then the given medialist
- * should have empty media array. New items are appended to it.
- * Caller naturally owns the data.
- *
- */
- void CreateVideoListL( TVcxMyVideosSortingOrder aSortingOrder,
- TBool aAscending, TBool aFullDetails, CMPXMedia*& aVideoList );
-
- /**
* Get one video item from MDS and create a new media
* object from it.
*
@@ -235,7 +338,8 @@
* @param aObserver The db change observer.
* @param aFs Session to file server.
*/
- CVcxMyVideosMdsDb( MVcxMyVideosMdsDbObserver* aObserver, RFs& aFs );
+ CVcxMyVideosMdsDb( MVcxMyVideosMdsDbObserver* aObserver,
+ MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver, RFs& aFs );
void ConstructL();
@@ -298,6 +402,37 @@
void DoHandleQueryNewResultsL(CMdEQuery& aQuery,
TInt aFirstNewItemIndex, TInt aNewItemCount);
+ /**
+ * Creates list of videos from MDS.
+ *
+ * @param aSortingOrder Sorting order, see values from TSortingOrder.
+ * @param aAscending Sort direction, if ETrue then ascending, else descending.
+ * @param aFullDetails If ETrue, then all details will be filled to media objects,
+ * if EFalse, then only subset.
+ * @param aVideoList Reference to pointer variable. Container type CMPXMedia class, contains
+ * CMPXMediaArray filled with CMPXMedia objects. If aVideoList
+ * pointer variable is NULL, then new medialist is created.
+ * If pointer variable already contains value, then the given medialist
+ * should have empty media array. New items are appended to it.
+ * Caller naturally owns the data.
+ *
+ */
+ void DoCreateVideoListL( TVcxMyVideosSortingOrder aSortingOrder,
+ TBool aAscending, TBool aFullDetails, CMPXMedia*& aVideoList );
+
+ /**
+ * Handles query complete events asynchronously.
+ */
+ static TInt AsyncHandleQueryCompleted( TAny* aPtr );
+
+ /**
+ * Sets Creation Date and Modified properties to object. Uses current date
+ * value.
+ *
+ * @param aObject Object to modify.
+ */
+ void SetCreationAndModifiedDatesL( CMdEObject& aObject );
+
public:
/**
@@ -306,17 +441,27 @@
*/
TBool iVideoListFetchingIsOngoing;
+ /**
+ * Album related functionality.
+ */
+ CVcxMyVideosMdsAlbums* iAlbums;
+
private: // data
/**
+ * Command queue. Own.
+ */
+ CVcxMyVideosMdsCmdQueue* iCmdQueue;
+
+ /**
* The MDS session object. Own.
*/
- CMdESession* iMDSSession;
+ CMdESession* iMdsSession;
/**
* The error code saved from the callbacks.
*/
- TInt iMDSError;
+ TInt iMdsError;
/**
* Asynchronous video list fetching query is stored here.
@@ -335,8 +480,8 @@
TBool iFullDetails;
/**
- * The default namespace definition. Not own.
- */
+ * The default namespace definition. Not own.
+ */
CMdENamespaceDef* iNamespaceDef;
/**
@@ -435,12 +580,14 @@
*/
CMdEPropertyDef* iLastPlayPositionPropertyDef;
+#if 0
/**
* 17.
* The Download ID property definition. Not own.
*/
CMdEPropertyDef* iDownloadIdPropertyDef;
-
+#endif
+
/**
* 18.
* Rating property definition, not own.
@@ -495,6 +642,18 @@
* The observer for db changes. Not own.
*/
MVcxMyVideosMdsDbObserver* iMdsDbObserver;
+
+ /**
+ * The observer for albums related database events. Not own.
+ */
+ MVcxMyVideosMdsAlbumsObserver* iAlbumsObserver;
+
+ /**
+ * Used to handle complete events asynchronously.
+ * This avoids problems like deleting query objects in the
+ * handler or starting new query from the handler.
+ */
+ CAsyncCallBack* iAsyncHandleQueryCompleteCaller;
};
#endif // VCXMYVIDEOSMDSDB_H
diff -r 48e74db5d516 -r bbb98528c666 videocollection/mpxmyvideoscollection/inc/vcxmyvideosopenhandler.h
--- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideosopenhandler.h Thu Apr 01 23:13:36 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosopenhandler.h Thu Apr 01 23:22:15 2010 +0300
@@ -11,11 +11,11 @@
*
* Contributors:
*
-* Description: Handles collection Open operation related functionality*
+* Description: Handles collection Open operation related functionality
+*
*/
-
#ifndef VCXMYVIDEOSOPENHANDLER_H
#define VCXMYVIDEOSOPENHANDLER_H
@@ -23,13 +23,24 @@
class MMPXCollectionPluginObserver;
class CVcxMyVideosMdsDb;
+#include "vcxmyvideosmdsdb.h"
+
+enum TVcxItemType
+ {
+ EVcxItemTypeNone,
+ EVcxItemTypeVideo,
+ EVcxItemTypeCategory,
+ EVcxItemTypeAlbum
+ };
+
/**
*/
-NONSHARABLE_CLASS( CVcxMyVideosOpenHandler ) : public CBase
+NONSHARABLE_CLASS( CVcxMyVideosOpenHandler ) : public CBase, public MVcxMyVideosMdsAlbumsObserver
{
friend class CVcxMyVideosVideoCache;
public:
+
/**
* Two-phased constructor
*/
@@ -52,18 +63,62 @@
void OpenL( const CMPXCollectionPath& aPath );
/**
- * Leaving version of HandleCreateVideoListResp.
- * Handler function for list fetching events. This callback is called as a response
- * to iCache.CreateVideoListL().
- *
- * @param aVideoList List of videos fetched from MDS.
- * @param aNewItemsStartIndex Start position for the new items added.
- * @param aComplete ETrue if list is complete and no more items are expected,
- * EFalse if there are more to come.
- */
+ * From MVcxMyVideosMdsAlbumsObserver.
+ */
+ void HandleAlbumOpenL();
+
+ /**
+ * From MVcxMyVideosMdsAlbumsObserver, no implementation.
+ */
+ void HandleGetAlbumsResp( CMPXMedia* /*aAlbumList*/ ) {}
+
+ /**
+ * From MVcxMyVideosMdsAlbumsObserver, no implementation.
+ */
+ void HandleGetAlbumContentIdsResp( TUint32 /*aAlbumId*/,
+ RArray& /*aContentArray*/ ) {}
+
+ /**
+ * From MVcxMyVideosMdsAlbumsObserver, no implementation.
+ */
+ void HandleAddVideosToAlbumResp( CMPXMedia* /*aCmd*/,
+ RPointerArray& /*aItemArray*/ ) {}
+
+ /**
+ * From MVcxMyVideosMdsAlbumsObserver, no implementation.
+ */
+ void HandleRemoveRelationsResp( RArray& /*aRelationIds*/,
+ RArray& /*aResults*/ ) {}
+
+ /**
+ * From MVcxMyVideosMdsAlbumsObserver, no implementation.
+ */
+ void HandleRemoveAlbumsResp( CMPXMedia* /*aCmd*/,
+ RArray& /*aResultIds*/ ) {}
+
+ /**
+ * From MVcxMyVideosMdsAlbumsObserver, no implementation.
+ */
+ void HandleRelationEvent( TObserverNotificationType /*aType*/,
+ const RArray& /*aRelationArray*/ ) {}
+
+ /**
+ * Called as a response to GetAlbumContentVideosL.
+ *
+ * @param aAlbumId ID of the album containing the result videos.
+ * @param aVideoList Media containing array of videos.
+ * @param aError Error code in case of failure.
+ * @param aFirstNewItemIndex Index of the first new item.
+ * @param aNewItemCount How many new items in the query since the last results.
+ * @param aComplete ETrue if query is complete, EFalse if there is more to come.
+ */
+ void HandleGetAlbumContentVideosResp( TUint32 aAlbumId, CMPXMedia& aVideoList,
+ TInt aError, TInt aFirstNewItemIndex, TInt aNewItemCount, TBool aComplete );
+
+
void DoHandleCreateVideoListRespL(
CMPXMedia* aVideoList, TInt aNewItemsStartIndex, TBool aComplete );
-
+
private:
/**
* 2nd-phase Constructor
@@ -77,6 +132,35 @@
CVcxMyVideosVideoCache& aCache,
CVcxMyVideosMdsDb& aMds );
+ /**
+ * Opens category.
+ *
+ * @param aCategoryId Category to open.
+ */
+ void OpenCategoryL( TUint32 aCategoryId );
+
+ /**
+ * Leaving version of HandleGetAlbumContentVideosResp.
+ */
+ void HandleGetAlbumContentVideosRespL(
+ TUint32 aAlbumId, CMPXMedia& /*aVideoList*/, TInt aError,
+ TInt /*aFirstNewItemIndex*/, TInt /*aNewItemCount*/, TBool aComplete );
+public:
+
+ /**
+ * If album is opened when the album list is not yet complete,
+ * then the album ID which is tried to open is stored here.
+ * The open processing is continued when album list is received
+ * from MDS. There can't be several album opens pending since
+ * we do not call HandleOpen before we get the album list.
+ */
+ TUint32 iPendingAlbumOpenId;
+
+ /**
+ * for testing, temp
+ */
+ CMPXMedia* iAlbumVideoList;
+
private: // data
/**
@@ -108,6 +192,26 @@
* This is in sync with iCategoryIdsBeingOpened.
*/
RArray iVideoListsBeingOpened;
+
+ /**
+ * The album IDs being opened are stored here. These values are used
+ * to filter list when items arrive from MDS.
+ * This is in sync with iAlbumVideoListsBeingOpened.
+ */
+ RArray iAlbumIdsBeingOpened;
+
+ /**
+ * Video lists for albums being opened are stored here.
+ * This is in sync with iAlbumIdsBeingOpened.
+ */
+ RArray iAlbumVideoListsBeingOpened;
+
+ /**
+ * Path being opened is stored here for the HandleOpenL call.
+ * Not Own.
+ */
+ const CMPXCollectionPath* iPath;
+
};
#endif // VCXMYVIDEOSACTIVETASK_H
diff -r 48e74db5d516 -r bbb98528c666 videocollection/mpxmyvideoscollection/inc/vcxmyvideostimer.h
--- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideostimer.h Thu Apr 01 23:13:36 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,120 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of the License "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Timer*
-*/
-
-
-
-
-#ifndef __CVCXMYVIDEOSTIMER_H__
-#define __CVCXMYVIDEOSTIMER_H__
-
-// INCLUDES
-#include
-
-// FORWARD DECLARATIONS
-class CVcxMyVideosTimer;
-
-// CLASS DECLARATION
-/**
-* This class specifies the function to be called when a timeout occurs.
-* Used in conjunction with CVcxTimer class.
-*/
-class MVcxMyVideosTimerObserver
- {
- public: // New functions
-
- /**
- * The function to be called when a timeout occurs.
- *
- * @param aTimer Pointer to timer which expired.
- */
- virtual void TimerExpired(CVcxMyVideosTimer* aTimer) = 0;
- };
-
-// CLASS DECLARATION
-/**
-* This class will notify an object after a specified timeout.
-*/
-NONSHARABLE_CLASS(CVcxMyVideosTimer) : public CTimer
- {
- public: // Constructors and destructors
-
- /**
- * Two-phased constructor.
- * Creates a CVcxMyVideosTimer object using two phase construction,
- * and returns a pointer to the created object.
- *
- * @param aPriority Priority to use for this timer.
- * @param aTimerObserver Object to notify of timeout event.
- * @return A pointer to the created instance of CVcxMyVideosTimer.
- */
- static CVcxMyVideosTimer* NewL( const TInt aPriority,
- MVcxMyVideosTimerObserver& aTimerObserver );
-
- /**
- * Two-phased constructor.
- * Creates a CVcxMyVideosTimer object using two phase construction,
- * and returns a pointer to the created object.
- *
- * @param aPriority Priority to use for this timer.
- * @param aTimerObserver Object to notify of timeout event.
- * @return A pointer to the created instance of CVcxMyVideosTimer.
- */
- static CVcxMyVideosTimer* NewLC( const TInt aPriority,
- MVcxMyVideosTimerObserver& aTimerObserver );
-
- /**
- * Destructor.
- * Destroys the object and releases all memory objects.
- */
- virtual ~CVcxMyVideosTimer();
-
- protected: // Functions from base classes
-
- /**
- * From CActive, RunL.
- * Called when operation completes.
- */
- void RunL();
-
- private: // Constructors and destructors
-
- /**
- * C++ default constructor.
- * Performs the first phase of two phase construction.
- *
- * @param aPriority Priority to use for this timer.
- * @param aTimeOutNotify An observer to notify.
- */
- CVcxMyVideosTimer( const TInt aPriority,
- MVcxMyVideosTimerObserver& aTimerObserver );
-
- /**
- * ConstructL.
- * 2nd phase constructor.
- */
- void ConstructL();
-
- private: // Data
-
- /**
- * The observer for this objects events.
- */
- MVcxMyVideosTimerObserver& iObserver;
- };
-
-#endif // __CVCXMYVIDEOSTIMER_H__
-
-// End of File
\ No newline at end of file
diff -r 48e74db5d516 -r bbb98528c666 videocollection/mpxmyvideoscollection/inc/vcxmyvideosvideocache.h
--- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideosvideocache.h Thu Apr 01 23:13:36 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosvideocache.h Thu Apr 01 23:22:15 2010 +0300
@@ -25,8 +25,6 @@
// FORWARD DECLARATIONS
class CVcxMyVideosCollectionPlugin;
class CMPXMedia;
-class CVcxMyVideosDownloadCache;
-class CRepository;
// CONSTANTS
@@ -224,16 +222,6 @@
CMPXMedia* FindVideoByMdsIdL( TUint32 aMdsId, TInt& aPos );
/**
- * Tries to find media with matching download ID from iVideoList and iPartialVideoList.
- * If aDownloadId is 0, then NULL is returned.
- *
- * @param aDownloadId ID to compare
- * @return Contains pointer to media if match found, NULL otherwise.
- * Pointer ownership is not moved to the caller.
- */
- CMPXMedia* FindVideoByDownloadIdL( TUint aDownloadId );
-
- /**
* Gets medias from iVideoList and iPartialVideoList.
*
* @param aMdsIds IDs of the items to fetch.
@@ -267,16 +255,19 @@
* @param aMdsIds Array containing MDS IDs of the videos to be added.
* @param aListFetchingWasCanceled This is set to EFalse if video list fetching from mds
* had to be cancelled. EFalse otherwise.
+ * @param aNonVideoIds If argument given then Ids which were detected to not be
+ * videos are written here. Caller owns the array, ownership
+ * does not move.
*/
- void AddVideosFromMdsL( RArray& aMdsIds, TBool& aListFetchingWasCanceled );
+ void AddVideosFromMdsL( RArray& aMdsIds, TBool& aListFetchingWasCanceled,
+ RArray* aNonVideoIds = NULL );
/**
* Deletes old and creates new iVideoList. After the function call iVideoList exists,
* but it might not contain any media items yet, only empty array.
* Media items are added to the list asynchronoysly in
* VcxMyVideosColletionPlugin::HandleCreateVideoListResp(), called by
- * VcxMyVideosMdsDb. When new items are added, they are synchronized with
- * Download Manager. Once iVideoList is complete, iVideoListIsPartial
+ * VcxMyVideosMdsDb. Once iVideoList is complete, iVideoListIsPartial
* is set to EFalse. During the video list fetching
* VcxMyVideosMdsDb::iVideoListFetchingIsOngoing is ETrue.
* If there is video list creation already ongoing
@@ -354,23 +345,9 @@
private:
/**
- * Circular buffer containing download id and media object pointer pairs.
- * Media object pointers are owned by iVideoList.
- * Used to speed up access to media objects which are used regularly during the
- * download.
- */
- CVcxMyVideosDownloadCache* iDownloadCache;
-
- /**
* My Videos collection plugin, owner of this object.
*/
CVcxMyVideosCollectionPlugin& iCollection;
-
- /**
- * Provides access to the sorting order key in cenrep. Own.
- */
- CRepository* iCenRep;
-
};
#endif // VCXMYVIDEOSVIDEOCACHE_H
diff -r 48e74db5d516 -r bbb98528c666 videocollection/mpxmyvideoscollection/src/vcxmyvideosactivetask.cpp
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosactivetask.cpp Thu Apr 01 23:13:36 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosactivetask.cpp Thu Apr 01 23:22:15 2010 +0300
@@ -112,27 +112,62 @@
}
// ---------------------------------------------------------------------------
+// Get the current media
+// ---------------------------------------------------------------------------
+//
+CMPXMedia* CVcxMyVideosActiveTask::Command()
+ {
+ return iCurCommand;
+ }
+
+// ---------------------------------------------------------------------------
// From CActive
// ---------------------------------------------------------------------------
//
void CVcxMyVideosActiveTask::RunL()
{
- // ETrue is done, EFalse is more to do
- //
- if( iObserver.HandleStepL() )
+ switch ( iObserver.HandleStepL() )
{
- iObserver.HandleOperationCompleted( KErrNone );
- delete iCurCommand;
- iCurCommand = NULL;
+ case MVcxMyVideosActiveTaskObserver::EDone:
+ Done();
+ break;
+
+ case MVcxMyVideosActiveTaskObserver::EMoreToCome:
+ ContinueStepping();
+ break;
+
+ //observer is responsible for calling Done or ContinueStepping
+ case MVcxMyVideosActiveTaskObserver::EStopStepping:
+ break;
}
- else
- {
- ++iCurStep;
- iStatus = KRequestPending;
- SetActive();
- TRequestStatus* status = &iStatus;
- User::RequestComplete( status, KErrNone );
- }
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosActiveTask::Done
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosActiveTask::Done()
+ {
+ MPX_DEBUG1("CVcxMyVideosActiveTask::Done() start");
+
+ iObserver.HandleOperationCompleted( KErrNone );
+ delete iCurCommand;
+ iCurCommand = NULL;
+
+ MPX_DEBUG1("CVcxMyVideosActiveTask::Done() exit");
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosActiveTask::ContinueStepping
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosActiveTask::ContinueStepping()
+ {
+ ++iCurStep;
+ iStatus = KRequestPending;
+ SetActive();
+ TRequestStatus* status = &iStatus;
+ User::RequestComplete( status, KErrNone );
}
// ---------------------------------------------------------------------------
diff -r 48e74db5d516 -r bbb98528c666 videocollection/mpxmyvideoscollection/src/vcxmyvideosalbum.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosalbum.cpp Thu Apr 01 23:22:15 2010 +0300
@@ -0,0 +1,298 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Class representing album in My Videos collection.
+*/
+
+#include
+#include
+#include
+#include
+#include "vcxmyvideosalbum.h"
+#include "vcxmyvideoscollectionplugin.h"
+#include "vcxmyvideosvideocache.h"
+#include "vcxmyvideoscollectionutil.h"
+
+
+// ---------------------------------------------------------------------------
+// TVcxMyVideosAlbumVideo::TVcxMyVideosAlbumVideo
+// ---------------------------------------------------------------------------
+//
+TVcxMyVideosAlbumVideo::TVcxMyVideosAlbumVideo()
+ {
+ Set( 0, 0, 0 );
+ }
+
+// ---------------------------------------------------------------------------
+// TVcxMyVideosAlbumVideo::operator=
+// ---------------------------------------------------------------------------
+//
+TVcxMyVideosAlbumVideo& TVcxMyVideosAlbumVideo::operator=( const TVcxMyVideosAlbumVideo& aVideo )
+ {
+ Set( aVideo.iMdsId, aVideo.iRelationMdsId, aVideo.iMedia );
+ return *this;
+ }
+
+// ---------------------------------------------------------------------------
+// TVcxMyVideosAlbumVideo::Set
+// ---------------------------------------------------------------------------
+//
+void TVcxMyVideosAlbumVideo::Set( TUint32 aMdsId, TUint32 aRelationMdsId, CMPXMedia* aVideo )
+ {
+ iMdsId = aMdsId;
+ iRelationMdsId = aRelationMdsId;
+ iMedia = aVideo;
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosAlbum::CVcxMyVideosAlbum
+// ---------------------------------------------------------------------------
+//
+CVcxMyVideosAlbum::CVcxMyVideosAlbum( CVcxMyVideosCollectionPlugin& aCollectionPlugin )
+: iCollection( aCollectionPlugin )
+ {
+ // No implementation required
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosAlbum::~CVcxMyVideosAlbum
+// ---------------------------------------------------------------------------
+//
+CVcxMyVideosAlbum::~CVcxMyVideosAlbum()
+ {
+ iVideoList.Close();
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosAlbum::NewLC
+// ---------------------------------------------------------------------------
+//
+CVcxMyVideosAlbum* CVcxMyVideosAlbum::NewLC( CVcxMyVideosCollectionPlugin& aCollectionPlugin )
+ {
+ CVcxMyVideosAlbum* self = new (ELeave) CVcxMyVideosAlbum( aCollectionPlugin );
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ return self;
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosAlbum::NewL
+// ---------------------------------------------------------------------------
+//
+CVcxMyVideosAlbum* CVcxMyVideosAlbum::NewL( CVcxMyVideosCollectionPlugin& aCollectionPlugin )
+ {
+ CVcxMyVideosAlbum* self = CVcxMyVideosAlbum::NewLC( aCollectionPlugin );
+ CleanupStack::Pop(); // self;
+ return self;
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosAlbum::ConstructL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbum::ConstructL()
+ {
+ iVideoList.Reset();
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosAlbum::Sort
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbum::Sort()
+ {
+ const TLinearOrder KOrderByMdsId(
+ CVcxMyVideosAlbum::CompareVideosByMdsId );
+
+ iVideoList.Sort( KOrderByMdsId );
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosAlbum::SetL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbum::SetL( /*CMPXMedia& aAlbum*/ )
+ {
+ //TODO:
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosAlbum::BelongsToAlbum
+// ---------------------------------------------------------------------------
+//
+TBool CVcxMyVideosAlbum::BelongsToAlbum( TUint32 aMdsId )
+ {
+ const TLinearOrder KOrderByMdsId(
+ CVcxMyVideosAlbum::CompareVideosByMdsId );
+
+ TInt index;
+ TVcxMyVideosAlbumVideo video;
+ video.iMdsId = aMdsId;
+ TInt err = iVideoList.FindInOrder( video, index, KOrderByMdsId );
+
+ if ( err != KErrNone )
+ {
+ return EFalse;
+ }
+
+ return ETrue;
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosAlbum::Video
+// ---------------------------------------------------------------------------
+//
+TInt CVcxMyVideosAlbum::Video( TUint32 aMdsId, TVcxMyVideosAlbumVideo& aVideo, TInt& aIndex )
+ {
+ const TLinearOrder KOrderByMdsId(
+ CVcxMyVideosAlbum::CompareVideosByMdsId );
+
+ TVcxMyVideosAlbumVideo videoToFind;
+ videoToFind.iMdsId = aMdsId;
+ TInt err = iVideoList.FindInOrder( videoToFind, aIndex, KOrderByMdsId );
+
+ if ( err == KErrNone )
+ {
+ aVideo = iVideoList[aIndex];
+ }
+
+ return err;
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosAlbum::AddL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbum::AddL( TVcxMyVideosAlbumVideo aVideo )
+ {
+ const TLinearOrder KOrderByMdsId(
+ CVcxMyVideosAlbum::CompareVideosByMdsId );
+
+ iVideoList.InsertInOrderAllowRepeatsL( aVideo, KOrderByMdsId );
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosAlbum::Remove
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbum::Remove( RArray& aMdsIds )
+ {
+ TInt count = aMdsIds.Count();
+ for ( TInt i = 0; i < count; i++ )
+ {
+ Remove( aMdsIds[i], EFalse /* don't compress */ );
+ }
+ iVideoList.Compress();
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosAlbum::Remove
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbum::Remove( TUint32 aMdsId, TBool aCompress )
+ {
+ const TLinearOrder KOrderByMdsId(
+ CVcxMyVideosAlbum::CompareVideosByMdsId );
+
+ TVcxMyVideosAlbumVideo video;
+ video.iMdsId = aMdsId;
+ TInt pos;
+ TInt err = iVideoList.FindInOrder( video, pos, KOrderByMdsId );
+ if ( err == KErrNone )
+ {
+ iVideoList.Remove( pos );
+ }
+ if ( aCompress )
+ {
+ iVideoList.Compress();
+ }
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosAlbum::UpdateAttributesL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbum::UpdateAttributesL()
+ {
+ //CalcNewVideoCountAndLatestNonWatchedL();
+ //CalcPlaytimeL();
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosAlbum::CompareVideosByMdsId
+// ---------------------------------------------------------------------------
+//
+TInt CVcxMyVideosAlbum::CompareVideosByMdsId( const TVcxMyVideosAlbumVideo& aVideo1,
+ const TVcxMyVideosAlbumVideo& aVideo2 )
+ {
+ if ( aVideo1.iMdsId == aVideo2.iMdsId )
+ {
+ return 0;
+ }
+
+ if ( aVideo1.iMdsId < aVideo2.iMdsId )
+ {
+ return -1;
+ }
+ return 1;
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosAlbum::CreateVideoListL
+// Creates album video list from iCollection.iCache->iVideoList.
+// ---------------------------------------------------------------------------
+//
+CMPXMedia* CVcxMyVideosAlbum::CreateVideoListL()
+ {
+ CMPXMedia* toVideoList = TVcxMyVideosCollectionUtil::CreateEmptyMediaListL();
+ CleanupStack::PushL( toVideoList );
+
+ AppendToVideoListL( *iCollection.iCache->iVideoList, *toVideoList, 0 );
+
+ CleanupStack::Pop( toVideoList );
+
+ return toVideoList;
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosAlbum::CreateVideoListL
+// Appends to video list items which belong to this album.
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbum::AppendToVideoListL( CMPXMedia& aFromVideoList,
+ CMPXMedia& aToVideoList, TInt aNewItemStartIndex )
+ {
+ if ( aNewItemStartIndex < 0 )
+ {
+ return;
+ }
+
+ CMPXMediaArray* fromArray = aFromVideoList.Value( KMPXMediaArrayContents );
+ CMPXMediaArray* toArray = aToVideoList.Value( KMPXMediaArrayContents );
+ TUint32 mdsId;
+ CMPXMedia* fromVideo;
+ TInt count = fromArray->Count();
+ for ( TInt i = aNewItemStartIndex; i < count; i++ )
+ {
+ fromVideo = fromArray->AtL( i );
+ mdsId = TVcxMyVideosCollectionUtil::IdL( *fromVideo ).iId1;
+ if ( BelongsToAlbum( mdsId ) )
+ {
+ CMPXMedia* toVideo = CMPXMedia::NewL( *fromVideo ); //share underlying memory
+ CleanupStack::PushL( toVideo );
+ toArray->AppendL( toVideo );
+ CleanupStack::Pop( toVideo );
+ }
+ }
+ }
diff -r 48e74db5d516 -r bbb98528c666 videocollection/mpxmyvideoscollection/src/vcxmyvideosalbums.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosalbums.cpp Thu Apr 01 23:22:15 2010 +0300
@@ -0,0 +1,566 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Albums related collection functionality (except db operations).
+*
+*/
+
+
+// INCLUDE FILES
+#include
+#include
+#include
+#include
+#include "vcxmyvideosalbums.h"
+#include "vcxmyvideoscollectionutil.h"
+#include "vcxmyvideoscollectionplugin.h"
+#include "vcxmyvideosmdsdb.h"
+#include "vcxmyvideosmdsalbums.h"
+#include "vcxmyvideoscollectionutil.h"
+#include "vcxmyvideosmessagelist.h"
+#include "vcxmyvideosopenhandler.h"
+
+// ============================ MEMBER FUNCTIONS =============================
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CVcxMyVideosAlbums::CVcxMyVideosAlbums( CVcxMyVideosCollectionPlugin& aCollection )
+: iCollection( aCollection )
+ {
+ }
+
+// ---------------------------------------------------------------------------
+// 2nd-phase constructor
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::ConstructL()
+ {
+ iAlbums.Reset();
+ }
+
+// ---------------------------------------------------------------------------
+// Two-Phase Constructor
+// ---------------------------------------------------------------------------
+//
+CVcxMyVideosAlbums* CVcxMyVideosAlbums::NewL( CVcxMyVideosCollectionPlugin& aCollection )
+ {
+ CVcxMyVideosAlbums* self = new(ELeave) CVcxMyVideosAlbums( aCollection );
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ CleanupStack::Pop( self );
+ return self;
+ }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CVcxMyVideosAlbums::~CVcxMyVideosAlbums()
+ {
+ delete iAlbumList;
+ TInt count = iAlbums.Count();
+ for ( TInt i = 0; i < count; i++ )
+ {
+ delete iAlbums[i];
+ }
+ iAlbums.Close();
+ iMdsOpTargetIds.Close();
+ iMdsOpResults.Close();
+ iMdsOpResultsUint32.Close();
+ iRemoveFromAlbumVideos.Close();
+ }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::CreateAlbumListL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::CreateAlbumListL()
+ {
+ if ( iAlbumList )
+ {
+ return;
+ }
+ iAlbumList = TVcxMyVideosCollectionUtil::CreateEmptyMediaListL();
+ iCollection.iMyVideosMdsDb->iAlbums->GetAlbumsL( iAlbumList, *this );
+ }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::CreateAlbumsL
+// Called when iAlbumList is ready, fills iAlbums.
+// Pointers to CVcxMyVideosVideoCache::iVideoList are not filled in yet.
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::CreateAlbumsL()
+ {
+ CMPXMediaArray* albumArray = iAlbumList->Value( KMPXMediaArrayContents );
+
+ TInt count = albumArray->Count();
+ CVcxMyVideosAlbum* album;
+ CMPXMedia* media;
+ for ( TInt i = 0; i < count; i++ )
+ {
+ media = albumArray->AtL( i );
+ album = CVcxMyVideosAlbum::NewLC( iCollection );
+ album->iMdsId = TVcxMyVideosCollectionUtil::IdL( *media ).iId1;
+ album->iMedia = media;
+ iAlbums.AppendL( album );
+ CleanupStack::Pop( album );
+ }
+ }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::GetAlbumContentIdsL
+// Fetches MDS IDs for all albums.
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::GetAlbumContentIdsL()
+ {
+ TInt count = iAlbums.Count();
+ for ( TInt i = 0; i < count; i++ )
+ {
+ // These calls go to queue and responses arrive asynchronously
+ // to HandleGetAlbumContentIdsRespL.
+ iCollection.iMyVideosMdsDb->iAlbums->GetAlbumContentIdsL( iAlbums[i]->iMdsId,
+ iAlbums[i]->iVideoList, *this );
+ }
+ }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::Album
+// ----------------------------------------------------------------------------
+//
+CVcxMyVideosAlbum* CVcxMyVideosAlbums::Album( TUint32 aMdsId, TInt* aPos )
+ {
+ TInt count = iAlbums.Count();
+ for ( TInt i = 0; i < count; i++ )
+ {
+ if ( iAlbums[i]->iMdsId == aMdsId )
+ {
+ if ( aPos )
+ {
+ *aPos = i;
+ }
+ return iAlbums[i];
+ }
+ }
+ return NULL;
+ }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::AddVideosToAlbumL
+// Command from MPX client.
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::AddVideosToAlbumL( CMPXMedia* aCmd )
+ {
+ iCollection.iMyVideosMdsDb->iAlbums->AddVideosToAlbumL( aCmd, *this );
+ }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::RemoveVideosFromAlbumL
+// Converts video mpx ids to relation ids and calls RemoveRelationsL.
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::RemoveVideosFromAlbumL( CMPXMedia* aCmd )
+ {
+ TInt albumId = TVcxMyVideosCollectionUtil::Uint32ValueL( *aCmd );
+ CMPXMediaArray* array = TVcxMyVideosCollectionUtil::MediaArrayL( *aCmd );
+ TVcxMyVideosAlbumVideo video;
+ TInt index;
+ TInt error;
+ CMPXMedia* media;
+ TInt count = array->Count();
+ iMdsOpTargetIds.Reset();
+ iMdsOpTargetIds.Reserve( count );
+ iRemoveFromAlbumVideos.Reset();
+ iRemoveFromAlbumVideos.Reserve( count );
+ TVcxMyVideosAlbumVideo paddingVideo;
+ paddingVideo.iMdsId = 0;
+ paddingVideo.iRelationMdsId = 0;
+
+ for ( TInt i = 0; i < count; i++ )
+ {
+ media = array->AtL( i );
+ error = Album( albumId )->Video(
+ TVcxMyVideosCollectionUtil::IdL( *media ).iId1, video, index );
+ if ( error == KErrNone )
+ {
+ iRemoveFromAlbumVideos.AppendL( video ); //store album video data now to avoid second search when response arrives
+ iMdsOpTargetIds.AppendL( video.iRelationMdsId );
+ }
+ else
+ {
+ iRemoveFromAlbumVideos.AppendL( paddingVideo ); //add dummy video to keep media array and iRemoveFromAlbumVideos in sync
+ }
+ }
+ iMdsOpResultsUint32.Reset();
+ iCollection.iMyVideosMdsDb->iAlbums->RemoveRelationsL(
+ iMdsOpTargetIds, iMdsOpResultsUint32, *this );
+ }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::AddAlbumL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::AddAlbumL( CMPXMedia& aCmd )
+ {
+ iCollection.iMyVideosMdsDb->iAlbums->AddAlbumL( aCmd );
+
+ TUint32 mdsId = TVcxMyVideosCollectionUtil::IdL( aCmd ).iId1;
+ if ( !Album( mdsId ) )
+ {
+ CMPXMediaArray* albumArray = iAlbumList->Value( KMPXMediaArrayContents );
+ albumArray->AppendL( aCmd );
+
+ CVcxMyVideosAlbum* album = CVcxMyVideosAlbum::NewLC( iCollection );
+ album->iMdsId = mdsId;
+ album->iMedia = albumArray->AtL( albumArray->Count() - 1 );
+ iAlbums.AppendL( album );
+ CleanupStack::Pop( album );
+
+ iCollection.iMessageList->AddEventL( TMPXItemId( mdsId, KVcxMvcMediaTypeAlbum ),
+ EMPXItemInserted, EVcxMyVideosListNoInfo, album->iMedia );
+ iCollection.iMessageList->SendL();
+ }
+ }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::RemoveAlbumsFromMdsOnlyL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::RemoveAlbumsFromMdsOnlyL( CMPXMedia* aCmd )
+ {
+ //TODO: find out what happens to relations, do we have to clean them out
+ iCollection.iMyVideosMdsDb->iAlbums->RemoveAlbumsL( aCmd, *this );
+ }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::RemoveAlbumsL
+// From MDS delete event.
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::RemoveAlbumsL( RArray& aAlbumIds )
+ {
+ TInt count = aAlbumIds.Count();
+ for ( TInt i = count -1; i >= 0; i-- )
+ {
+ TBool removed = RemoveAlbum( aAlbumIds[i], EFalse /* dont compress */);
+ if ( removed )
+ {
+ aAlbumIds.Remove( i );
+ }
+ }
+ iAlbums.Compress();
+
+ iCollection.iMessageList->SendL();
+ }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::RemoveAlbum
+// ----------------------------------------------------------------------------
+//
+TBool CVcxMyVideosAlbums::RemoveAlbum( TUint32 aMdsId, TBool aCompress )
+ {
+ TInt pos;
+ CVcxMyVideosAlbum* album = Album( aMdsId, &pos );
+ if ( album )
+ {
+ CMPXMediaArray* albumArray = TVcxMyVideosCollectionUtil::MediaArrayL( *iAlbumList );
+
+ iAlbums.Remove( pos );
+ albumArray->Remove( pos );
+
+ if ( aCompress )
+ {
+ iAlbums.Compress();
+ }
+ iCollection.iMessageList->AddEventL( TMPXItemId( aMdsId, KVcxMvcMediaTypeAlbum ),
+ EMPXItemDeleted, EVcxMyVideosListNoInfo );
+ return ETrue;
+ }
+ return EFalse;
+ }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::AddAlbumsFromMdsL
+// From MDS insert event, no need to fetch content since the album was just
+// created.
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::AddAlbumsFromMdsL( RArray& /*aAlbumIds*/ )
+ {
+ //TODO: implement if we want to support albums which are added by someone else
+ // than My Videos Collection.
+ }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::HandleGetAlbumsRespL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::HandleGetAlbumsRespL( CMPXMedia* aAlbumList )
+ {
+ // aAlbumList = iAlbums->iAlbumList
+ CMPXMediaArray* array = aAlbumList->Value( KMPXMediaArrayContents );
+ TInt count = array->Count();
+ TMPXItemId mpxId;
+ CMPXMedia* album;
+ for ( TInt i = 0; i < count; i++ )
+ {
+ album = array->AtL( i );
+ mpxId = TVcxMyVideosCollectionUtil::IdL( *album );
+ iCollection.iMessageList->AddEventL( mpxId, EMPXItemInserted, 0, album );
+ }
+ CreateAlbumsL(); //fills in iAlbums from iAlbumList
+ GetAlbumContentIdsL(); //fills iAlbums with MDS IDs of the videos asynchronously
+ iCollection.iMessageList->SendL();
+ }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::HandleGetAlbumContentIdsRespL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::HandleGetAlbumContentIdsRespL( TUint32 aAlbumId,
+ RArray& /*aAlbumContentIds*/ )
+ {
+ //&aAlbumContent = iAlbums[x]->iVideoList
+
+ CVcxMyVideosAlbum* album( Album( aAlbumId ) );
+ if ( album )
+ {
+ album->Sort(); //sorts iAlbum[x]->iVideoList by MDS ID.
+ }
+
+ //if last album -> album list is complete
+ if ( iAlbums[iAlbums.Count() -1]->iMdsId == aAlbumId )
+ {
+ MPX_DEBUG1("CVcxMyVideosAlbums:: content ids for last album arrived -> album list is complete" );
+ iAlbumListIsComplete = ETrue;
+
+ if ( iCollection.iOpenHandler->iPendingAlbumOpenId )
+ {
+ MPX_DEBUG1("CVcxMyVideosAlbums:: there was album open pending, calling HandleAlbumOpenL()" );
+
+ TRAPD( err, iCollection.iOpenHandler->HandleAlbumOpenL() );
+ if ( err != KErrNone )
+ {
+ MPX_DEBUG3("CVcxMyVideosAlbums:: HandleAlbumOpenL() left: %d, calling HandleOpen(NULL,%d)",
+ err, err);
+ iCollection.iObs->HandleOpen( static_cast(NULL), err );
+ }
+ }
+ }
+
+
+#ifdef _DEBUG
+ TInt count = album->iVideoList.Count();
+
+ MPX_DEBUG2("CVcxMyVideosCollectionPlugin:: content ids for album %d arrived", aAlbumId);
+
+ for ( TInt i = 0; i < album->iVideoList.Count(); i++ )
+ {
+ MPX_DEBUG2("CVcxMyVideosCollectionPlugin:: mds id = %d", album->iVideoList[i].iMdsId );
+ }
+#endif
+ }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::HandleGetAlbumsResp
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::HandleGetAlbumsResp( CMPXMedia* aAlbumList )
+ {
+ TRAP_IGNORE( HandleGetAlbumsRespL( aAlbumList ) );
+ }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::HandleGetAlbumContentIdsResp
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::HandleGetAlbumContentIdsResp( TUint32 aAlbumId,
+ RArray& aAlbumContent )
+ {
+ TRAP_IGNORE( HandleGetAlbumContentIdsRespL( aAlbumId, aAlbumContent ) );
+ }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::HandleAddVideosToAlbumResp
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::HandleAddVideosToAlbumResp( CMPXMedia* aCmd,
+ RPointerArray& aItemArray )
+ {
+ TRAPD( err, DoHandleAddVideosToAlbumRespL( aCmd, aItemArray ) );
+
+ if ( err != KErrNone )
+ {
+ CMPXMedia* cmd = iCollection.iActiveTask->Command();
+ if ( cmd )
+ {
+ cmd->SetTObjectValueL( KVcxMediaMyVideosInt32Value, err );
+ iCollection.iActiveTask->Done();
+ }
+ }
+ }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::DoHandleAddVideosToAlbumResp
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::DoHandleAddVideosToAlbumRespL( CMPXMedia* aCmd,
+ RPointerArray& aItemArray )
+ {
+ MPX_DEBUG1("CVcxMyVideosAlbums::DoHandleAddVideosToAlbumResp() start");
+
+ CMPXMediaArray* mediaArray = TVcxMyVideosCollectionUtil::MediaArrayL( *aCmd );
+
+ TVcxMyVideosAlbumVideo video;
+ TUint albumId;
+ CVcxMyVideosAlbum* album;
+
+ TInt count = aItemArray.Count();
+ for ( TInt i = 0; i < count; i++ )
+ {
+ video.iRelationMdsId = aItemArray[i]->Id();
+ MPX_DEBUG3( "CVcxMyVideosAlbums:: item result[%d] = %d (id)", i, video.iRelationMdsId );
+ if ( video.iRelationMdsId == KNoId )
+ {
+ mediaArray->AtL( i )->SetTObjectValueL( KVcxMediaMyVideosInt32Value, KErrGeneral );
+ }
+ else
+ {
+ mediaArray->AtL( i )->SetTObjectValueL( KVcxMediaMyVideosInt32Value, KErrNone );
+ video.iMdsId = TVcxMyVideosCollectionUtil::IdL( *mediaArray->AtL( i ) ).iId1;
+ albumId = TVcxMyVideosCollectionUtil::Uint32ValueL( *aCmd );
+ album = Album( albumId );
+ if ( album )
+ {
+ album->AddL( video );
+ iCollection.iMessageList->AddEventL( TMPXItemId( albumId, KVcxMvcMediaTypeAlbum ),
+ EMPXItemModified, EVcxMyVideosVideoListOrderChanged );
+ }
+ }
+ }
+
+ iCollection.iActiveTask->Done();
+ iCollection.iMessageList->SendL();
+
+ MPX_DEBUG1("CVcxMyVideosAlbums::DoHandleAddVideosToAlbumResp() exit");
+ }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::HandleRemoveRelationsResp
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::HandleRemoveRelationsResp( RArray& /*aRelationIds*/,
+ RArray& aResults )
+ {
+ MPX_DEBUG1("CVcxMyVideosAlbums::HandleRemoveRelationsResp() start");
+
+ // iRemoveFromAlbumVideos and mediaArray are in sync
+
+ CMPXMedia* cmd = iCollection.iActiveTask->Command();
+ CMPXMediaArray* mediaArray = TVcxMyVideosCollectionUtil::MediaArrayL( *cmd );
+ TInt count = iRemoveFromAlbumVideos.Count();
+ CMPXMedia* video;
+ TInt relationId;
+ for ( TInt i = 0; i < count; i++ )
+ {
+ video = mediaArray->AtL( i );
+ relationId = iRemoveFromAlbumVideos[i].iRelationMdsId;
+ if ( relationId != 0 &&
+ aResults.Find( relationId ) != KErrNotFound )
+ {
+ video->SetTObjectValueL( KVcxMediaMyVideosInt32Value, KErrNone );
+ }
+ else
+ {
+ video->SetTObjectValueL( KVcxMediaMyVideosInt32Value, KErrGeneral );
+ }
+ }
+ iRemoveFromAlbumVideos.Reset();
+
+ iCollection.iActiveTask->Done();
+
+ MPX_DEBUG1("CVcxMyVideosAlbums::HandleRemoveRelationsResp() exit");
+ }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::HandleRemoveAlbumsResp
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::HandleRemoveAlbumsResp( CMPXMedia* aCmd,
+ RArray& aResultIds )
+ {
+ CMPXMediaArray* mediaArray = TVcxMyVideosCollectionUtil::MediaArrayL( *aCmd );
+ TInt count = mediaArray->Count();
+ TUint32 mdsId;
+ CMPXMedia* album;
+ for ( TInt i = 0; i < count; i++ )
+ {
+ album = mediaArray->AtL( i );
+ mdsId = TVcxMyVideosCollectionUtil::IdL( *album ).iId1;
+ if ( aResultIds.Find( mdsId ) != KErrNotFound )
+ {
+ album->SetTObjectValueL( KVcxMediaMyVideosInt32Value, KErrNone );
+ }
+ else
+ {
+ album->SetTObjectValueL( KVcxMediaMyVideosInt32Value, KErrGeneral );
+ }
+ }
+
+ iCollection.iActiveTask->Done();
+ }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::HandleRelationEvent
+// Only relation removed events are received here.
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::HandleRelationEvent( TObserverNotificationType /*aType*/,
+ const RArray& aRelationArray )
+ {
+ TRAP_IGNORE(
+
+ TUint albumId;
+ CVcxMyVideosAlbum* album;
+ TInt count = aRelationArray.Count();
+ for ( TInt i = 0; i < count; i++ )
+ {
+ albumId = aRelationArray[i].LeftObjectId();
+
+ if ( iAlbumListIsComplete )
+ {
+ album = Album( albumId );
+ if ( album )
+ {
+ album->Remove( aRelationArray[i].RightObjectId(), ETrue /* compress */ );
+ }
+ iCollection.iMessageList->AddEventL( TMPXItemId( albumId, KVcxMvcMediaTypeAlbum ),
+ EMPXItemModified, EVcxMyVideosVideoListOrderChanged );
+ }
+ else
+ {
+ //We are fetching albums already, we assume that it will be up to date.
+ //If that is not the case, then we should set some flag here and restart
+ //album fetching from scratch.
+ }
+ }
+ iCollection.iMessageList->SendL();
+
+ );
+ }
+
+// END OF FILE
diff -r 48e74db5d516 -r bbb98528c666 videocollection/mpxmyvideoscollection/src/vcxmyvideosasyncfileoperations.cpp
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosasyncfileoperations.cpp Thu Apr 01 23:13:36 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosasyncfileoperations.cpp Thu Apr 01 23:22:15 2010 +0300
@@ -34,7 +34,6 @@
#include "vcxmyvideoscollectionplugin.h"
#include "vcxmyvideoscollection.hrh"
#include "vcxmyvideoscollectionutil.h"
-#include "vcxmyvideosdownloadutil.h"
#include "vcxmyvideosvideocache.h"
#include "vcxmyvideoscategories.h"
#include "vcxmyvideosmessagelist.h"
@@ -221,13 +220,13 @@
// CVcxMyVideosAsyncFileOperations::HandleMoveOrCopyStepL
// ----------------------------------------------------------------------------
//
-TBool CVcxMyVideosAsyncFileOperations::HandleMoveOrCopyStepL()
+MVcxMyVideosActiveTaskObserver::TStepResult CVcxMyVideosAsyncFileOperations::HandleMoveOrCopyStepL()
{
CMPXMedia& cmd = iCollection.iActiveTask->GetCommand();
- TBool done;
+ MVcxMyVideosActiveTaskObserver::TStepResult stepResult;
- TBool isMoveOperation = EFalse;
+ TBool isMoveOperation = EFalse;
TUint32 cmdId = cmd.ValueTObjectL( KVcxMediaMyVideosCommandId );
if ( cmdId == KVcxCommandMyVideosMove )
{
@@ -285,7 +284,7 @@
if ( iCurrentOperationIndex > (iOperationIdArray.Count() - 1) )
{
iCurrentOperationIndex = 0;
- done = ETrue;
+ stepResult = MVcxMyVideosActiveTaskObserver::EDone;
if ( isMoveOperation )
{
SendOperationRespL( KVcxMessageMyVideosMoveResp );
@@ -297,10 +296,10 @@
}
else
{
- done = EFalse;
+ stepResult = MVcxMyVideosActiveTaskObserver::EMoreToCome;
}
- return done;
+ return stepResult;
}
// ----------------------------------------------------------------------------
@@ -431,12 +430,6 @@
video = iCollection.iMyVideosMdsDb->CreateVideoL( aMdsId, EFalse /* brief details */ );
}
- if ( !video )
- {
- MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: mds id %d not found from mds or cache", aMdsId);
- User::Leave( KErrNotFound );
- }
-
CleanupStack::PushL( video ); // 1->
// sanity checks
@@ -665,13 +658,13 @@
// CVcxMyVideosAsyncFileOperations::HandleDeleteStepL
// ----------------------------------------------------------------------------
//
-TBool CVcxMyVideosAsyncFileOperations::HandleDeleteStepL()
+MVcxMyVideosActiveTaskObserver::TStepResult CVcxMyVideosAsyncFileOperations::HandleDeleteStepL()
{
CMPXMedia& cmd = iCollection.iActiveTask->GetCommand();
//no sanity checks for array items, since we want to generate all events, even if there is nothing to delete
- TBool done;
+ MVcxMyVideosActiveTaskObserver::TStepResult stepResult;
TUint32 cmdId = cmd.ValueTObjectL( KVcxMediaMyVideosCommandId );
@@ -717,16 +710,15 @@
if ( iCurrentOperationIndex > (iOperationIdArray.Count() - 1) )
{
iCurrentOperationIndex = 0;
- done = ETrue;
-
+ stepResult = MVcxMyVideosActiveTaskObserver::EDone;
SendOperationRespL( KVcxMessageMyVideosDeleteResp );
}
else
{
- done = EFalse;
+ stepResult = MVcxMyVideosActiveTaskObserver::EMoreToCome;
}
- return done;
+ return stepResult;
}
diff -r 48e74db5d516 -r bbb98528c666 videocollection/mpxmyvideoscollection/src/vcxmyvideoscategories.cpp
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideoscategories.cpp Thu Apr 01 23:13:36 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideoscategories.cpp Thu Apr 01 23:22:15 2010 +0300
@@ -182,6 +182,8 @@
CleanupClosePushL( newVideosIncrements ); // 2->
TInt i;
+ videosIncrements.ReserveL( categoryCount );
+ newVideosIncrements.ReserveL( categoryCount );
for ( i = 0; i < categoryCount; i++ )
{
videosIncrements.AppendL( 0 );
@@ -280,12 +282,14 @@
{
category = aCategoryArray.AtL( i );
+ //codescanner warning: aVideosIncrements count is same as aCategoryArray count, so the range is checked
UpdateVideosCountL( *category, aVideosIncrements[i], KVcxMediaMyVideosCategoryItemCount,
EVcxMyVideosListNoInfo );
modified = ETrue;
}
+ //codescanner warning: aNewVideosIncrements count is same as aCategoryArray count, so the range is checked
if ( aNewVideosIncrements[i] != 0 )
{
category = aCategoryArray.AtL( i );
diff -r 48e74db5d516 -r bbb98528c666 videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionplugin.cpp
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionplugin.cpp Thu Apr 01 23:13:36 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionplugin.cpp Thu Apr 01 23:22:15 2010 +0300
@@ -11,12 +11,11 @@
*
* Contributors:
*
-* Description: Implementation of My Videos collection Plugin interface*
+* Description: Implementation of My Videos collection Plugin interface*
*/
-
// INCLUDE FILES
#include
#include
@@ -35,19 +34,13 @@
#include "vcxmyvideoscollectionplugin.h"
#include "vcxmyvideoscollection.hrh"
#include "vcxmyvideoscollectionutil.h"
-#include "vcxmyvideosdownloadutil.h"
#include "vcxmyvideosvideocache.h"
#include "vcxmyvideoscategories.h"
#include "vcxmyvideosmessagelist.h"
#include "vcxmyvideosasyncfileoperations.h"
#include "vcxmyvideosopenhandler.h"
-
-const TInt KMaxFileDeleteAttempts = 4;
-const TInt KFileDeleteLoopDelay = 100000;
-
-// Add 2000 new videos to memory card. Reboot phone, mds starts harvesting,
-// open my videos -> mds server crashes and lots of events is sent to client.
-// If one waits until all are harvested before opening my videos, it works.
+#include "vcxmyvideosmdsalbums.h"
+#include "vcxmyvideosalbums.h"
// ============================ MEMBER FUNCTIONS ==============================
@@ -78,13 +71,13 @@
MPX_DEBUG2("CVcxMyVideosCollectionPlugin:: this = %x", this);
delete iMyVideosMdsDb;
- delete iDownloadUtil;
delete iCache;
delete iMessageList;
delete iCategories;
delete iAsyncFileOperations;
delete iActiveTask;
delete iOpenHandler;
+ delete iAlbums;
iFs.Close();
}
@@ -108,7 +101,7 @@
User::LeaveIfError( iFs.Connect() );
- iMyVideosMdsDb = CVcxMyVideosMdsDb::NewL( this, iFs );
+ iMyVideosMdsDb = CVcxMyVideosMdsDb::NewL( this, &AlbumsL(), iFs );
iActiveTask = CVcxMyVideosActiveTask::NewL( *this );
iCache = CVcxMyVideosVideoCache::NewL( *this );
iMessageList = CVcxMyVideosMessageList::NewL( *this );
@@ -137,7 +130,7 @@
const TArray& /*aCaps*/,
CMPXAttributeSpecs* /*aSpecs*/)
{
- MPX_FUNC("CMPXMyVideosDbPlugin::MediaL");
+ MPX_FUNC("CVcxMyVideosCollectionPlugin::MediaL");
MPX_DEBUG_PATH(aPath);
RArray supportedIds;
@@ -170,7 +163,7 @@
if ( ids.Count() == 0 )
{
- MPX_DEBUG1("CMPXMyVideosDbPlugin:: request didn't contain any items ids, aborting");
+ MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: request didn't contain any items ids, aborting");
iObs->HandleMedia( NULL, KErrArgument );
CleanupStack::PopAndDestroy( &ids ); // <-2
@@ -186,27 +179,27 @@
if ( videoInCache )
{
// 0 attributes means "get all" -> can't use cache
- MPX_DEBUG2("CMPXMyVideosDbPlugin:: client is requesting %d attributes", aAttrs.Count());
+ MPX_DEBUG2("CVcxMyVideosCollectionPlugin:: client is requesting %d attributes", aAttrs.Count());
if ( aAttrs.Count() > 0 )
{
TBool nonSupportedAttrCanBeFoundFromMds;
if ( TVcxMyVideosCollectionUtil::AreSupported( *videoInCache, aAttrs,
nonSupportedAttrCanBeFoundFromMds ) )
{
- MPX_DEBUG1("CMPXMyVideosDbPlugin:: all attributes found from cache");
+ MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: all attributes found from cache");
useCachedVideo = ETrue;
}
else
{
- MPX_DEBUG1("CMPXMyVideosDbPlugin:: all attributes NOT found from cache");
+ MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: all attributes NOT found from cache");
if ( !nonSupportedAttrCanBeFoundFromMds )
{
- MPX_DEBUG1("CMPXMyVideosDbPlugin:: none of the non cached attrs can be found from MDS -> use cached version");
+ MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: none of the non cached attrs can be found from MDS -> use cached version");
useCachedVideo = ETrue;
}
else
{
- MPX_DEBUG1("CMPXMyVideosDbPlugin:: at least one of the non cached attributes can be found from MDS");
+ MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: at least one of the non cached attributes can be found from MDS");
}
}
}
@@ -216,12 +209,12 @@
if ( useCachedVideo )
{
- MPX_DEBUG1("CMPXMyVideosDbPlugin:: using cached video");
+ MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: using cached video");
video = CMPXMedia::CopyL( *videoInCache );
}
else
{
- MPX_DEBUG1("CMPXMyVideosDbPlugin:: fetching from MDS");
+ MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: fetching from MDS");
video = iMyVideosMdsDb->CreateVideoL( ids[0].iId1, ETrue /* full details */ );
}
@@ -318,6 +311,13 @@
iActiveTask->Cancel();
}
break;
+
+ case KVcxCommandMyVideosAddAlbum:
+ {
+ MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: sync KVcxCommandMyVideosAddAlbum arrived");
+ AlbumsL().AddAlbumL( aCmd );
+ }
+ break;
}
}
break;
@@ -427,6 +427,10 @@
{
MPX_FUNC("CVcxMyVideosCollectionPlugin::DoHandleMyVideosDbEventL");
+ RArray nonVideoIds;
+ nonVideoIds.Reset();
+ CleanupClosePushL( nonVideoIds );
+
switch ( aEvent )
{
case EMPXItemDeleted:
@@ -435,7 +439,8 @@
MPX_DEBUG1("CVcxMyVideosCollectionPlugin::DoHandleMyVideosDbEventL() Items from MDS deleted, deleting from cache |" );
MPX_DEBUG1("CVcxMyVideosCollectionPlugin::DoHandleMyVideosDbEventL() --------------------------------------------'");
- iCache->RemoveL( aId );
+ iCache->RemoveL( aId );
+ AlbumsL().RemoveAlbumsL( aId );
}
break;
@@ -448,22 +453,31 @@
if ( iMyVideosMdsDb->iVideoListFetchingIsOngoing )
{
MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: video list fetching is ongoing, ignoring add event");
+ CleanupStack::PopAndDestroy( &nonVideoIds );
return;
}
TBool videoListFetchingWasCancelled = EFalse;
-
+
// After the call, aId will contain only items which were actually inserted to cache.
// We receive add events for all object types. When fetching the item from MDS we use
- // video condition and only video objects are added to cache.
- iCache->AddVideosFromMdsL( aId, videoListFetchingWasCancelled );
+ // video condition and only video objects are added to cache. Items which were detected
+ // to not be videos are added to nonVideoIds.
+ iCache->AddVideosFromMdsL( aId, videoListFetchingWasCancelled, &nonVideoIds );
+
+#if 0 //TODO: do this if we want to support albums which are being added by someone else than My Videos Collection
+
+ //After the call nonVideoIds will contain only items which were actually added
+ //to albums.
+ AlbumsL().AddAlbumsFromMdsL( nonVideoIds );
+#endif
+
if ( videoListFetchingWasCancelled )
{
RestartVideoListFetchingL();
}
-
- SyncWithDownloadsL( aId );
}
+
break;
case EMPXItemModified:
@@ -488,24 +502,41 @@
}
}
}
- SyncWithDownloadsL( aId );
+
+ //TODO: handle album modify events
break;
}
-
- TInt pos;
- for ( TInt i = 0; i < aId.Count(); i++ )
- {
+
+ TInt pos;
+ TInt count = aId.Count();
+ for ( TInt i = 0; i < count; i++ )
+ {
+ if ( aEvent == EMPXItemInserted )
+ {
+ // add item from cache to the message if we have it.
+ CMPXMedia* video = iCache->FindVideoByMdsIdL( aId[i], pos );
+ TRAP_IGNORE( iMessageList->AddEventL( TMPXItemId( aId[i], KVcxMvcMediaTypeVideo),
+ aEvent, 0, video ) );
+ }
+ else
+ {
+ TRAP_IGNORE( iMessageList->AddEventL( TMPXItemId( aId[i], KVcxMvcMediaTypeVideo),
+ aEvent ) );
+ }
+ }
+
if ( aEvent == EMPXItemInserted )
{
- // add item from cache to the message if we have it.
- CMPXMedia* video = iCache->FindVideoByMdsIdL( aId[i], pos );
- TRAP_IGNORE( iMessageList->AddEventL( TMPXItemId( aId[i], 0), aEvent, 0, video ) );
+ //nonVideoIds are albums
+ TInt count = nonVideoIds.Count();
+ for ( TInt i = 0; i < count; i++ )
+ {
+ TRAP_IGNORE( iMessageList->AddEventL(
+ TMPXItemId( nonVideoIds[i], KVcxMvcMediaTypeAlbum ), aEvent ) );
+ }
}
- else
- {
- TRAP_IGNORE( iMessageList->AddEventL( TMPXItemId( aId[i], 0), aEvent ) );
- }
- }
+
+ CleanupStack::PopAndDestroy( &nonVideoIds );
iMessageList->SendL();
}
@@ -514,11 +545,11 @@
// CVcxMyVideosCollectionPlugin::HandleStepL
// ----------------------------------------------------------------------------
//
-TBool CVcxMyVideosCollectionPlugin::HandleStepL()
+MVcxMyVideosActiveTaskObserver::TStepResult CVcxMyVideosCollectionPlugin::HandleStepL()
{
MPX_FUNC("CVcxMyVideosCollectionPlugin::HandleStepL");
- TBool done(ETrue);
+ MVcxMyVideosActiveTaskObserver::TStepResult stepResult(MVcxMyVideosActiveTaskObserver::EDone);
switch ( iActiveTask->GetTask() )
{
@@ -537,8 +568,7 @@
MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: async KMPXCommandIdCollectionSet out");
- done = ETrue;
-
+ stepResult = MVcxMyVideosActiveTaskObserver::EDone;
break;
}
case KVcxCommandIdMyVideos:
@@ -553,183 +583,7 @@
TInt myVideosCmd( cmd.ValueTObjectL( KVcxMediaMyVideosCommandId ) );
switch ( myVideosCmd )
- {
- case KVcxCommandMyVideosStartDownload:
- {
- MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: Handling KVcxCommandMyVideosStartDownload command.");
-
- CMPXMedia* video = CMPXMedia::NewL( *(iActiveTask->GetCommand().Value(
- KMPXCommandColAddMedia)) );
- CleanupStack::PushL( video ); // 1->
-
- if ( !iCache->iVideoList )
- {
- MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: iVideoListCache = NULL -> creating new empty iVideoListCache");
- iCache->iVideoListIsPartial = ETrue;
- iCache->iVideoList = TVcxMyVideosCollectionUtil::CreateEmptyMediaListL();
- }
-
- TBool resume = EFalse;
-
- if ( video->IsSupported( KVcxMediaMyVideosDownloadId ) )
- {
- TUint32 downloadId = video->ValueTObjectL( KVcxMediaMyVideosDownloadId );
- if ( downloadId != 0 )
- {
- MPX_DEBUG2("CVcxMyVideosCollectionPlugin:: download id %d given by the client -> this is download resume",
- downloadId);
- resume = ETrue;
-
- // load the existing item to cache if its not there already
- }
- }
-
- if ( !resume )
- {
- if ( !video->IsSupported( KVcxMediaMyVideosRemoteUrl ) )
- {
- MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: KVcxMediaMyVideosRemoteUrl not supported -> leaving with KErrArgument");
- User::Leave( KErrArgument );
- }
-
- if ( video->ValueText( KVcxMediaMyVideosRemoteUrl ).Length() >
- KVcxMvcMaxUrlLength )
- {
- MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: url longer than 1024 -> leaving with KErrArgument");
- User::Leave( KErrArgument );
- }
-
- MPX_DEBUG2("CVcxMyVideosCollectionPlugin:: starting download for url: %S",
- &video->ValueText( KVcxMediaMyVideosRemoteUrl ) );
-
- video->SetTObjectValueL( KVcxMediaMyVideosOrigin, EVcxMyVideosOriginDownloaded );
- video->SetTObjectValueL( KVcxMediaMyVideosDownloadState,
- static_cast(EVcxMyVideosDlStateDownloading) );
- video->SetTObjectValueL( KMPXMediaGeneralFlags, EVcxMyVideosVideoNew );
-
- HBufC* fileName = DownloadUtilL().CreateFilePathL( *video );
- CleanupStack::PushL( fileName ); // 2->
- video->SetTextValueL( KMPXMediaGeneralUri, *fileName );
- CleanupStack::PopAndDestroy( fileName ); // <-2
- }
-
- TRAPD( err, DownloadUtilL().StartDownloadL( *video ) ); //download id is written to video object
-
- if ( err != KErrNone )
- {
- MPX_DEBUG2("CVcxMyVideosCollectionPlugin:: StartDownloadL left: %d", err);
- User::Leave( err );
- }
-
- if ( !resume )
- {
- TUint32 newDownloadId = video->ValueTObjectL( KVcxMediaMyVideosDownloadId );
- MPX_DEBUG2("CVcxMyVideosCollectionPlugin:: new download ID: %d",
- newDownloadId);
-
- AddVideoToMdsAndCacheL( *video );
- }
- else
- {
- // clear old error codes from the dl item
- TInt pos;
-
- CMPXMedia* videoInCache = iCache->FindVideoByMdsIdL(
- TVcxMyVideosCollectionUtil::IdL( *video ), pos );
- if ( videoInCache )
- {
- videoInCache->SetTObjectValueL( KVcxMediaMyVideosDownloadError, 0 );
- videoInCache->SetTObjectValueL( KVcxMediaMyVideosDownloadGlobalError, 0 );
- }
- }
-
- CleanupStack::PopAndDestroy( video ); // <-1
- done = ETrue;
- }
- break;
-
- case KVcxCommandMyVideosCancelDownload:
- {
- // Error code is returned to client if dl item was left to system.
- // If file delete fails, then mds item is also left to system.
-
- MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: Handling KVcxCommandMyVideosCancelDownload command.");
-
- CMPXMedia* video = CMPXMedia::NewL( *(iActiveTask->GetCommand().Value(
- KMPXCommandColAddMedia)) );
- CleanupStack::PushL( video ); // 1->
-
- if ( !video->IsSupported( KVcxMediaMyVideosDownloadId ) ||
- !video->IsSupported( KMPXMediaGeneralId ) ||
- !video->IsSupported( KMPXMediaGeneralUri ) )
- {
- MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: parameter missing, can't cancel dl, leaving with KErrArgument");
- User::Leave( KErrArgument );
- }
-
- TUint32 downloadId = video->ValueTObjectL(
- KVcxMediaMyVideosDownloadId );
- DownloadUtilL().CancelDownload( downloadId, ETrue /* remove file */ );
-
- if ( BaflUtils::FileExists( iFs, video->ValueText( KMPXMediaGeneralUri ) ) )
- {
- TMPXItemId mpxItemId = video->ValueTObjectL( KMPXMediaGeneralId );
- TInt err( KErrNone );
-
- for ( TInt i = 0; i < KMaxFileDeleteAttempts; i++ )
- {
- TRAP( err, AsyncFileOperationsL().DeleteVideoL( mpxItemId.iId1, ETrue ) );
-
- if ( err == KErrInUse )
- {
- MPX_DEBUG1( "CVcxMyVideosCollectionPlugin:: file is already in use, waiting a moment and try again");
- User::After( KFileDeleteLoopDelay );
- }
- else
- {
- break;
- }
- }
-
- if ( err != KErrNone && err != KErrNotFound )
- {
-#ifdef _DEBUG
- if ( err == KErrInUse )
- {
- TVcxMyVideosCollectionUtil::PrintOpenFileHandlesL(
- video->ValueText( KMPXMediaGeneralUri ), iFs );
- }
-#endif
-
- // Some error occured when cancelling download operation, dl item is however gone and file is left
- // -> change dl id to 0 and leave mpx collection item there. Report operation to client as a success.
- MPX_DEBUG1( "CVcxMyVideosCollectionPlugin:: dl item is gone from dl manager, file and mpx item are left, setting dl id to 0");
- TRAP_IGNORE( SetDownloadIdToZeroL( downloadId ) );
- }
- }
-
- CleanupStack::PopAndDestroy( video ); // <-1
- done = ETrue;
- }
- break;
-
- case KVcxCommandMyVideosPauseDownload:
- {
- CMPXMedia& cmd = iActiveTask->GetCommand();
- if ( !cmd.IsSupported( KVcxMediaMyVideosDownloadId ) )
- {
- User::Leave( KErrArgument );
- }
- else
- {
- TInt err = DownloadUtilL().PauseDownload(
- cmd.ValueTObjectL( KVcxMediaMyVideosDownloadId ) );
- User::LeaveIfError( err );
- }
- done = ETrue;
- }
- break;
-
+ {
case KVcxCommandMyVideosGetMediaFullDetailsByMpxId:
{
MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: KVcxCommandMyVideosGetMediaFullDetailsByMpxId received");
@@ -743,25 +597,16 @@
CMPXMedia* video = iMyVideosMdsDb->CreateVideoL(
mpxId.iId1, ETrue /* full details */ );
-
- if ( !video )
- {
- User::Leave( KErrGeneral );
- }
CleanupStack::PushL( video ); // 1->
-
- TBool eventsAdded;
- SyncVideoWithDownloadsL( *video, eventsAdded,
- EFalse /* dont add event to iMessageList */ );
-
+
cmd.SetCObjectValueL( KMPXCommandColAddMedia, video );
CleanupStack::PopAndDestroy( video ); // <-1
cmd.SetTObjectValueL(KMPXMessageCollectionId, TUid::Uid(
KVcxUidMyVideosMpxCollection));
- done = ETrue;
+ stepResult = MVcxMyVideosActiveTaskObserver::EDone;
}
break;
@@ -817,12 +662,8 @@
{
// Load items to cache
MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: loading requested items to iCache->iVideoList");
-
+
iCache->AddVideosFromMdsL( mdsIds, videoListFetchingWasCancelled );
- if ( mdsIds.Count() > 0 )
- {
- SyncWithDownloadsL( mdsIds );
- }
}
else
{
@@ -855,7 +696,7 @@
CleanupStack::PopAndDestroy( &mdsIds2 ); // <-2
CleanupStack::PopAndDestroy( &mdsIds ); // <-1
- done = ETrue;
+ stepResult = MVcxMyVideosActiveTaskObserver::EDone;
}
break;
@@ -863,16 +704,44 @@
case KVcxCommandMyVideosMove:
{
MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: KVcxCommandMyVideosMove or Copy step");
- done = AsyncFileOperationsL().HandleMoveOrCopyStepL();
+ stepResult = AsyncFileOperationsL().HandleMoveOrCopyStepL();
}
break;
case KVcxCommandMyVideosDelete:
{
MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: KVcxCommandMyVideosDelete step");
- done = AsyncFileOperationsL().HandleDeleteStepL();
+ stepResult = AsyncFileOperationsL().HandleDeleteStepL();
}
break;
+
+ case KVcxCommandMyVideosAddToAlbum:
+ iAlbums->AddVideosToAlbumL( &iActiveTask->GetCommand() );
+ stepResult = MVcxMyVideosActiveTaskObserver::EStopStepping;
+ break;
+
+ case KVcxCommandMyVideosRemoveFromAlbum:
+ iAlbums->RemoveVideosFromAlbumL( &iActiveTask->GetCommand() );
+ stepResult = MVcxMyVideosActiveTaskObserver::EStopStepping;
+ break;
+
+ case KVcxCommandMyVideosAddAlbum:
+ {
+ MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: async KVcxCommandMyVideosAddAlbum arrived");
+ AlbumsL().AddAlbumL( iActiveTask->GetCommand() );
+ stepResult = MVcxMyVideosActiveTaskObserver::EDone;
+ break;
+ }
+
+ case KVcxCommandMyVideosRemoveAlbums:
+ {
+ MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: async KVcxCommandMyVideosRemoveAlbums arrived");
+ AlbumsL().RemoveAlbumsFromMdsOnlyL( iActiveTask->Command() );
+ stepResult = MVcxMyVideosActiveTaskObserver::EStopStepping;
+ break;
+ }
+
+
}
}
break;
@@ -883,7 +752,7 @@
TMPXItemId mpxId = iActiveTask->GetCommand().ValueTObjectL(
KMPXMediaGeneralId );
AsyncFileOperationsL().DeleteVideoL( mpxId.iId1 );
- done = ETrue;
+ stepResult = MVcxMyVideosActiveTaskObserver::EDone;
break;
}
@@ -894,7 +763,7 @@
break;
}
}
- return done;
+ return stepResult;
}
@@ -910,10 +779,14 @@
if ( aErr != KErrNone )
{
MPX_DEBUG2("CVcxMyVideosCollectionPlugin:: Leave or cancel happened during the operation: %d", aErr);
- TRAPD( err, AsyncFileOperationsL().CancelOperationL( aErr ) ); // generates resp message for move,copy or delete operations
- if ( err != KErrNone )
+
+ if ( iAsyncFileOperations )
{
- MPX_DEBUG2("CVcxMyVideosCollectionPlugin:: failed to generate resp msg: %d", err);
+ TRAPD( err, AsyncFileOperationsL().CancelOperationL( aErr ) ); // generates resp message for move,copy or delete operations
+ if ( err != KErrNone )
+ {
+ MPX_DEBUG2("CVcxMyVideosCollectionPlugin:: failed to generate resp msg: %d", err);
+ }
}
}
@@ -926,435 +799,6 @@
}
// ----------------------------------------------------------------------------
-// CVcxMyVideosCollectionPlugin::HandleDlEvent
-// From CVcxMyVideosDownloadUtilObserver
-// ----------------------------------------------------------------------------
-//
-void CVcxMyVideosCollectionPlugin::HandleDlEvent( TVcxMyVideosDownloadState aState,
- TUint32 aDownloadId,
- TInt aProgress,
- TInt64 aDownloaded,
- TInt32 aError,
- TInt32 aGlobalError )
- {
- TRAPD( err, DoHandleDlEventL( aState, aDownloadId, aProgress,
- aDownloaded, aError, aGlobalError ) );
- if ( err != KErrNone )
- {
- MPX_DEBUG2("CVcxMyVideosCollectionPlugin:: DoHandleDlEventL left with error code: %d", err);
- }
- }
-
-// ----------------------------------------------------------------------------
-// CVcxMyVideosCollectionPlugin::DoHandleDlEventL
-// ----------------------------------------------------------------------------
-//
-void CVcxMyVideosCollectionPlugin::DoHandleDlEventL( TVcxMyVideosDownloadState aState,
- TUint32 aDownloadId,
- TInt aProgress,
- TInt64 aDownloaded,
- TInt32 aError,
- TInt32 aGlobalError )
- {
- MPX_FUNC("CVcxMyVideosCollectionPlugin::DoHandleDlEventL");
-
- CMPXMedia* video = iCache->FindVideoByDownloadIdL( aDownloadId );
-
- MPX_DEBUG3("CVcxMyVideosCollectionPlugin:: dl event for download ID %d, pointer = %x) arrived.", aDownloadId, video);
-
- TBool sendEvent = EFalse;
- if ( video )
- {
- TMPXItemId mpxId( TVcxMyVideosCollectionUtil::IdL( *video ) );
- MPX_DEBUG4("CVcxMyVideosCollectionPlugin:: MPX item (MDS ID %d) (DL ID %d) %S",
- mpxId.iId1, aDownloadId, &TVcxMyVideosCollectionUtil::Title( *video ) );
-
- TUint8 currentState = TVcxMyVideosCollectionUtil::DownloadStateL( *video );
-
- if ( currentState == EVcxMyVideosDlStateDownloaded )
- {
- MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: already in Downloaded state, discarding event");
- return;
- }
-
- if ( currentState != aState )
- {
- MPX_DEBUG5("CVcxMyVideosCollectionPlugin:: updating (mds id: %d) (dl id: %d) state: %S -> %S",
- mpxId.iId1, aDownloadId, &DownloadState( currentState ), &DownloadState( aState ) );
- video->SetTObjectValueL( KVcxMediaMyVideosDownloadState, static_cast(aState) );
- sendEvent = ETrue;
-
- if ( aState == EVcxMyVideosDlStateDownloaded )
- {
- MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: downloaded state received -> setting download id to 0");
-
- //1. set download id to 0
- video->SetTObjectValueL( KVcxMediaMyVideosDownloadId, 0 );
-
- //2. update drm flag
-#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
- RFile64 dlFile;
-#else
- RFile dlFile;
-#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
- TInt err = dlFile.Open( iFs, video->ValueText( KMPXMediaGeneralUri ), EFileRead );
- if ( err == KErrNone )
- {
- MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: file opened ok for drm reading");
- CleanupClosePushL( dlFile ); // 1->
- DRM::CDrmUtility* drmUtil = DRM::CDrmUtility::NewLC(); // 2->
- if ( drmUtil->IsProtectedL( dlFile ) )
- {
- MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: file is DRM protected, setting the property flag");
- TUint32 flags = video->ValueTObjectL( KMPXMediaGeneralFlags );
- flags |= EVcxMyVideosVideoDrmProtected;
- video->SetTObjectValueL( KMPXMediaGeneralFlags, flags );
- }
- else
- {
- MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: file is not DRM protected");
- }
- CleanupStack::PopAndDestroy( drmUtil ); // <-2
- CleanupStack::PopAndDestroy( &dlFile ); // <-1
- }
- else
- {
- MPX_DEBUG2("CVcxMyVideosCollectionPlugin:: file didnt open for drm reading, %d", err);
- }
- NotifyDownloadCompletedL( *video );
-
- //3. Update file size using iCache->UpdateVideoL function since it changes item position and
- // sends category modified events if necessarry.
- CMPXMedia* updateObject = CMPXMedia::NewL();
- CleanupStack::PushL( updateObject ); // 1->
- updateObject->SetTObjectValueL( KMPXMediaGeneralId, mpxId );
-#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
- updateObject->SetTObjectValueL( KMPXMediaGeneralExtSizeInt64,
- static_cast( aDownloaded ) );
- // set current value to 0 to force event sending and video list position updating
- video->SetTObjectValueL( KMPXMediaGeneralExtSizeInt64, 0 );
-#else
- updateObject->SetTObjectValueL( KMPXMediaGeneralSize,
- static_cast( aDownloaded ) );
- // set current value to 0 to force event sending and video list position updating
- video->SetTObjectValueL( KMPXMediaGeneralSize, 0 );
-#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
- iCache->UpdateVideoL( *updateObject );
- CleanupStack::PopAndDestroy( updateObject ); // <-1
- // find video again since it might have been deleted in iCache->UpdateVideoL
- TInt pos;
- video = iCache->FindVideoByMdsIdL( mpxId.iId1, pos );
-
- //file size and download id are saved to database
- iMyVideosMdsDb->UpdateVideoL( *video );
- sendEvent = EFalse; // MDS will send the event, this avoids duplicate
- }
-
- if ( aState == EVcxMyVideosDlStateFailed )
- {
- video->SetTObjectValueL( KVcxMediaMyVideosDownloadError, aError );
- video->SetTObjectValueL( KVcxMediaMyVideosDownloadGlobalError,
- aGlobalError );
- }
- }
- else
- {
- MPX_DEBUG2("CVcxMyVideosCollectionPlugin:: state was already same(%S), skipping state update.", &DownloadState( currentState ));
- }
-
- TInt8 currentProgress = video->ValueTObjectL( KVcxMediaMyVideosDownloadProgress );
- if ( currentProgress != aProgress )
- {
- MPX_DEBUG4("CVcxMyVideosCollectionPlugin:: (dl id: %d) progress: %d -> %d",
- aDownloadId, currentProgress, aProgress );
-
- video->SetTObjectValueL( KVcxMediaMyVideosDownloadProgress,
- static_cast( aProgress ) );
- // Don't send the update event for progress.
- //sendEvent = ETrue;
- }
- else
- {
- MPX_DEBUG2("CVcxMyVideosCollectionPlugin:: progress was already same(%d), skipping progress update.", currentProgress);
- }
-
- TInt64 currentFileSize = 0;
-#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
- if ( video->IsSupported( KMPXMediaGeneralExtSizeInt64 ) )
- {
- currentFileSize = video->ValueTObjectL( KMPXMediaGeneralExtSizeInt64 );
- }
-#else
- if ( video->IsSupported( KMPXMediaGeneralSize ) )
- {
- currentFileSize = video->ValueTObjectL( KMPXMediaGeneralSize );
- }
-#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
- if ( currentFileSize != aDownloaded )
- {
- MPX_DEBUG4("CVcxMyVideosCollectionPlugin:: updating (dl id: %d) size: %ld -> %ld",
- aDownloadId, currentFileSize, aDownloaded );
-
-#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
- video->SetTObjectValueL( KMPXMediaGeneralExtSizeInt64, aDownloaded );
-#else
- TInt newFileSize( aDownloaded );
- video->SetTObjectValueL( KMPXMediaGeneralSize, newFileSize );
-#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
- //sendEvent = ETrue;
- }
-
- if ( sendEvent )
- {
- iMessageList->AddEventL( mpxId, EMPXItemModified );
- iMessageList->SendL();
- }
- }
- else
- {
- if ( (aState != EVcxMyVideosDlStateDownloaded) && (aProgress < 100) &&
- !iCache->iVideoListIsPartial )
- {
- MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: -----------------------------------------------------------------------.");
- MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: Event for progressing download arrived, but the MPX/MDS item not found!|");
- MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: -> deleting download. |");
- MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: -----------------------------------------------------------------------'");
-
- RHttpDownload* download = DownloadUtilL().Download( aDownloadId );
- if ( download )
- {
- MPX_DEBUG2("CVcxMyVideosCollectionPlugin:: Download ID (%d) not found from MPX/MDS, deleting download!",
- aDownloadId );
- DownloadUtilL().DeleteDownloadAsync( aDownloadId, ETrue );
- }
- }
- }
- }
-
-// ----------------------------------------------------------------------------
-// CVcxMyVideosCollectionPlugin::SyncWithDownloadsL
-// ----------------------------------------------------------------------------
-//
-void CVcxMyVideosCollectionPlugin::SyncWithDownloadsL(
- RArray& aItemsInCache )
- {
- MPX_FUNC("CVcxMyVideosCollectionPlugin::SyncWithDownloadsL()");
-
- TBool eventsAdded = EFalse;
- for ( TInt i = 0; i < aItemsInCache.Count(); i++ )
- {
- TInt pos;
- CMPXMedia* video = iCache->FindVideoByMdsIdL( aItemsInCache[i], pos );
- if ( video )
- {
- SyncVideoWithDownloadsL( *video, eventsAdded );
- }
- }
- if ( eventsAdded )
- {
- iMessageList->SendL();
- }
- }
-
-// ----------------------------------------------------------------------------
-// CVcxMyVideosCollectionPlugin::SyncVideoWithDownloadsL
-// ----------------------------------------------------------------------------
-//
-void CVcxMyVideosCollectionPlugin::SyncVideoWithDownloadsL( CMPXMedia& aVideo,
- TBool& aEventAdded, TBool aAddEvent )
- {
- TInt downloadId( TVcxMyVideosCollectionUtil::DownloadIdL( aVideo ) );
-
- if ( downloadId )
- {
- RHttpDownload* download( DownloadUtilL().Download( downloadId ) );
-
- if ( download )
- {
- MPX_DEBUG2("CVcxMyVideosCollectionPlugin::SyncVideoWithDownloadsL() item (DL ID: %d) found from dl manager", downloadId);
-
- TBool modified = EFalse;
- SyncVideoAndDownloadL( aVideo, *download, modified );
- if ( modified && aAddEvent )
- {
- iMessageList->AddEventL( TVcxMyVideosCollectionUtil::IdL( aVideo ),
- EMPXItemModified );
- aEventAdded = ETrue;
- }
- }
- else
- {
- //download id != 0 and it is not found from download manager -> we set download id to 0
- MPX_DEBUG2("CVcxMyVideosCollectionPlugin:: download id %d != 0 and no corresponding download found from Download Manager",
- downloadId);
- MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: -> setting download id to 0");
- aVideo.SetTObjectValueL( KVcxMediaMyVideosDownloadId, 0 );
- iMyVideosMdsDb->UpdateVideoL( aVideo ); // if video list fetching is ongoing, this will leave with KErrNotReady
- }
- }
- }
-
-// ----------------------------------------------------------------------------
-// CVcxMyVideosCollectionPlugin::SyncVideoAndDownloadL
-// ----------------------------------------------------------------------------
-//
-void CVcxMyVideosCollectionPlugin::SyncVideoAndDownloadL(
- CMPXMedia& aVideo,
- RHttpDownload& aDownload,
- TBool& aModified )
- {
- MPX_FUNC("CVcxMyVideosCollectionPlugin::SyncVideoAndDownloadL()");
-
- aModified = EFalse;
-
- TBuf downloadUrl;
- aDownload.GetStringAttribute( EDlAttrReqUrl, downloadUrl );
- if ( aVideo.ValueText( KVcxMediaMyVideosRemoteUrl )
- != downloadUrl )
- {
- MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: urls in MPX and DL Manager differ!");
- MPX_DEBUG2("CVcxMyVideosCollectionPlugin:: remote url in MPX: %S",
- &(aVideo.ValueText( KVcxMediaMyVideosRemoteUrl )));
- MPX_DEBUG2("CVcxMyVideosCollectionPlugin:: remote url in DL Manager: %S",
- &downloadUrl);
- MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: -> updating MPX cache");
-
- aVideo.SetTextValueL( KVcxMediaMyVideosRemoteUrl, downloadUrl );
- aModified = ETrue;
- }
- else
- {
- MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: remote urls already same in dl manager and mpx");
- }
-
- // KVcxMediaMyVideosDownloadState
- TVcxMyVideosDownloadState dlStateInDlManager;
- DownloadUtilL().GetDownloadState( aDownload, dlStateInDlManager );
-
- TUint8 dlStateInMpxCache;
- if ( aVideo.IsSupported( KVcxMediaMyVideosDownloadState ))
- {
- dlStateInMpxCache = aVideo.ValueTObjectL( KVcxMediaMyVideosDownloadState );
- }
- else
- {
- dlStateInMpxCache = static_cast( EVcxMyVideosDlStateNone );
- }
-
- MPX_DEBUG2("CVcxMyVideosCollectionPlugin:: dl state in dl manager: %S", &DownloadState( dlStateInDlManager ));
- MPX_DEBUG2("CVcxMyVideosCollectionPlugin:: dl state in mpx cache: %S", &DownloadState( dlStateInMpxCache ));
-
- if ( static_cast( dlStateInDlManager ) != dlStateInMpxCache )
- {
- if ( dlStateInDlManager == EVcxMyVideosDlStateDownloaded )
- {
- // Download finished event has arrived when we weren't around, call event handler to get things right.
- // Collection is updated and download is deleted from Download Manager.
- MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: Download is in Finished state and collection has download id != 0");
- MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: -> we have missed download finished event, lets generate it by ourselves.");
-
- TUint64 downloaded( 0 );
- TUint8 progress( DownloadUtilL().DownloadProgress( aDownload, downloaded, EFalse ) );
- TUint32 downloadId( aVideo.ValueTObjectL( KVcxMediaMyVideosDownloadId ) );
- HandleDlEvent( dlStateInDlManager, downloadId,
- progress, downloaded, KErrNone, KErrNone );
- DownloadUtilL().DeleteDownloadAsync( downloadId, EFalse /* don't delete content */ );
- }
- else
- {
- MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: dl state in dl manager differs of mpx cache-> updating mpx cache");
- aVideo.SetTObjectValueL( KVcxMediaMyVideosDownloadState,
- static_cast( dlStateInDlManager ) );
- aModified = ETrue;
- }
- }
- else
- {
- MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: download state already same in dl manager and mds");
- }
-
- // KVcxMediaMyVideosDownloadProgress
- TUint64 downloaded = 0;
- TInt8 dlProgressInDlManager = DownloadUtilL().DownloadProgress(
- aDownload, downloaded, EFalse );
-
- TInt8 dlProgressInMpxCache;
- if ( aVideo.IsSupported( KVcxMediaMyVideosDownloadProgress ) )
- {
- dlProgressInMpxCache = aVideo.ValueTObjectL( KVcxMediaMyVideosDownloadProgress );
- }
- else
- {
- aVideo.SetTObjectValueL( KVcxMediaMyVideosDownloadProgress, 0 );
- dlProgressInMpxCache = 0;
- }
-
- MPX_DEBUG2("CVcxMyVideosCollectionPlugin:: dl progress in dl manager: %d", dlProgressInDlManager);
- MPX_DEBUG2("CVcxMyVideosCollectionPlugin:: dl progress in mpx cache: %d", dlProgressInMpxCache);
-
- if ( dlProgressInDlManager != dlProgressInMpxCache )
- {
- MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: dl progress in dl manager differs of mpx cache-> updating mpx cache");
- aVideo.SetTObjectValueL( KVcxMediaMyVideosDownloadProgress,
- static_cast( dlProgressInDlManager ) );
- aModified = ETrue;
- }
- else
- {
- MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: download progress already same in dl manager and mds");
- }
- }
-
-// ----------------------------------------------------------------------------
-// CVcxMyVideosCollectionPlugin::SyncVideoListWithDownloadsL
-// ----------------------------------------------------------------------------
-//
-void CVcxMyVideosCollectionPlugin::SyncVideoListWithDownloadsL( CMPXMedia& aVideoList,
- TBool aSendEvents, TInt aStartPos )
- {
- MPX_FUNC("CVcxMyVideosCollectionPlugin::SyncVideoListWithDownloadsL");
-
- CMPXMediaArray* videoArray = aVideoList.Value(
- KMPXMediaArrayContents);
-
- CMPXMedia* video;
-
- TBool eventsAdded = EFalse;
- for ( TInt i = aStartPos; i < videoArray->Count(); i++ )
- {
- video = (*videoArray)[i];
- SyncVideoWithDownloadsL( *video, eventsAdded, aSendEvents );
- }
- if ( eventsAdded )
- {
- iMessageList->SendL();
- }
- }
-
-// ----------------------------------------------------------------------------
-// CVcxMyVideosCollectionPlugin::DownloadUtil
-// ----------------------------------------------------------------------------
-//
-CVcxMyVideosDownloadUtil& CVcxMyVideosCollectionPlugin::DownloadUtilL()
- {
- if ( !iDownloadUtil )
- {
- iDownloadUtil = CVcxMyVideosDownloadUtil::NewL( *this, iFs );
- }
-
- if ( !iOrphanDownloadsCleared )
- {
- if ( !iCache->iVideoListIsPartial )
- {
- iOrphanDownloadsCleared = ETrue;
- iDownloadUtil->ClearOrphanDownloadsL( *iCache->iVideoList );
- }
- }
-
- return *iDownloadUtil;
- }
-
-// ----------------------------------------------------------------------------
// CVcxMyVideosCollectionPlugin::CategoriesL
// ----------------------------------------------------------------------------
//
@@ -1368,6 +812,20 @@
}
// ----------------------------------------------------------------------------
+// CVcxMyVideosCollectionPlugin::AlbumsL
+// TODO: Unecessarry func since we always load this
+// ----------------------------------------------------------------------------
+//
+CVcxMyVideosAlbums& CVcxMyVideosCollectionPlugin::AlbumsL()
+ {
+ if ( !iAlbums )
+ {
+ iAlbums = CVcxMyVideosAlbums::NewL( *this );
+ }
+ return *iAlbums;
+ }
+
+// ----------------------------------------------------------------------------
// CVcxMyVideosCollectionPlugin::HandleCreateVideoListResp
// ----------------------------------------------------------------------------
//
@@ -1438,6 +896,7 @@
}
}
+#if 0
// ----------------------------------------------------------------------------
// CVcxMyVideosCollectionPlugin::NotifyDownloadCompletedL
// ----------------------------------------------------------------------------
@@ -1464,6 +923,7 @@
CleanupStack::PopAndDestroy( buffer );
}
+#endif
// ----------------------------------------------------------------------------
// CVcxMyVideosCollectionPlugin::NotifyNewVideosCountDecreasedL
@@ -1486,9 +946,7 @@
stream.CommitL();
CleanupStack::PopAndDestroy( &stream );
-
- DownloadUtilL().NotifyNewVideosCountDecreased( *buffer );
-
+
CleanupStack::PopAndDestroy( buffer );
}
@@ -1626,6 +1084,7 @@
iMessageList->SendL();
}
+#if 0
// ----------------------------------------------------------------------------
// CVcxMyVideosCollectionPlugin::SetDownloadIdToZeroL
// ----------------------------------------------------------------------------
@@ -1676,3 +1135,4 @@
}
#endif
+#endif
diff -r 48e74db5d516 -r bbb98528c666 videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionutil.cpp
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionutil.cpp Thu Apr 01 23:13:36 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionutil.cpp Thu Apr 01 23:22:15 2010 +0300
@@ -11,13 +11,12 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
-
// INCLUDE FILES
#include
#include
@@ -166,7 +165,25 @@
}
}
}
-
+
+// ---------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::AppendToListL
+// New items in aToList will point to same shared memory as items in aFromList.
+// ---------------------------------------------------------------------------
+//
+void TVcxMyVideosCollectionUtil::AppendToListL( CMPXMedia& aToList, CMPXMedia& aFromList )
+ {
+ CMPXMedia* media;
+ CMPXMediaArray* toArray = aToList.Value( KMPXMediaArrayContents );
+ CMPXMediaArray* fromArray = aFromList.Value( KMPXMediaArrayContents );
+ TInt count = fromArray->Count();
+ for ( TInt i = 0; i < count; i++ )
+ {
+ media = CMPXMedia::NewL( *(fromArray->AtL( i )) ); // points to same shared memory
+ toArray->AppendL( media ); //ownership moves
+ }
+ }
+
// ---------------------------------------------------------------------------
// This helper function converts drive letter to drive number
// ---------------------------------------------------------------------------
@@ -213,7 +230,8 @@
{
aUniquePath = aPath.Mid( 0, pos );
}
- counterDigits.Format(_L("%d"), counter++);
+ _LIT(KPercentD, "%d");
+ counterDigits.Format( KPercentD, counter++ );
aUniquePath.Append( '_' );
aUniquePath.Append( '(' );
aUniquePath.AppendJustify( counterDigits, KMaxDigits, TAlign( ERight ), '0' );
@@ -458,7 +476,63 @@
}
return KErrNotFound;
}
-
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::MediaArrayL
+// ----------------------------------------------------------------------------
+//
+CMPXMediaArray* TVcxMyVideosCollectionUtil::MediaArrayL( CMPXMedia& aMedia )
+ {
+ if ( !aMedia.IsSupported( KMPXMediaArrayContents ) )
+ {
+ User::Leave( KErrArgument );
+ }
+
+ return aMedia.Value( KMPXMediaArrayContents );
+ }
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::Int32ValueL
+// ----------------------------------------------------------------------------
+//
+TInt32 TVcxMyVideosCollectionUtil::Int32ValueL( CMPXMedia& aMedia )
+ {
+ if ( !aMedia.IsSupported( KVcxMediaMyVideosInt32Value ) )
+ {
+ User::Leave( KErrArgument );
+ }
+ return aMedia.ValueTObjectL( KVcxMediaMyVideosInt32Value );
+ }
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::Uint32ValueL
+// ----------------------------------------------------------------------------
+//
+TUint32 TVcxMyVideosCollectionUtil::Uint32ValueL( CMPXMedia& aMedia )
+ {
+ if ( !aMedia.IsSupported( KVcxMediaMyVideosUint32Value ) )
+ {
+ User::Leave( KErrArgument );
+ }
+ return aMedia.ValueTObjectL( KVcxMediaMyVideosUint32Value );
+ }
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::GetIdsFromMediaArrayL
+// ----------------------------------------------------------------------------
+//
+void TVcxMyVideosCollectionUtil::GetIdsFromMediaArrayL( CMPXMediaArray& aMediaArray,
+ RArray& aIdArray )
+ {
+ TInt count = aMediaArray.Count();
+ aIdArray.Reset();
+ aIdArray.ReserveL( count );
+ for ( TInt i = 0; i < count; i++ )
+ {
+ aIdArray.AppendL( IdL( *aMediaArray.AtL( i ) ).iId1 );
+ }
+ }
+
#ifdef _DEBUG
// ----------------------------------------------------------------------------
// TVcxMyVideosCollectionUtil::PrintOpenFileHandlesL
@@ -500,7 +574,8 @@
//
void TVcxMyVideosCollectionUtil::GetProcessName( TInt aThreadId, TFullName& aProcessName )
{
- TFindThread find(_L("*"));
+ _LIT(KAsterixDes, "*");
+ TFindThread find( KAsterixDes );
while( find.Next( aProcessName ) == KErrNone )
{
RThread thread;
diff -r 48e74db5d516 -r bbb98528c666 videocollection/mpxmyvideoscollection/src/vcxmyvideosdownloadcache.cpp
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosdownloadcache.cpp Thu Apr 01 23:13:36 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,133 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of the License "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Download list cache. Circular buffer made for speeding up*
-*/
-
-
-
-
-// INCLUDE FILES
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include "vcxmyvideosdownloadcache.h"
-#include "vcxmyvideoscollectionplugin.h"
-#include "vcxmyvideosdownloadutil.h"
-#include "vcxmyvideoscollectionutil.h"
-#include "vcxmyvideoscategories.h"
-
-const TInt KVcxMvDownloadFindCacheSize = 20;
-
-// ============================ MEMBER FUNCTIONS ==============================
-
-// ----------------------------------------------------------------------------
-// Two-phased constructor.
-// ----------------------------------------------------------------------------
-//
-CVcxMyVideosDownloadCache* CVcxMyVideosDownloadCache::NewL()
- {
- CVcxMyVideosDownloadCache* self = new (ELeave) CVcxMyVideosDownloadCache();
- CleanupStack::PushL(self);
- self->ConstructL();
- CleanupStack::Pop(self);
- return self;
- }
-
-// ----------------------------------------------------------------------------
-// Destructor.
-// ----------------------------------------------------------------------------
-//
-CVcxMyVideosDownloadCache::~CVcxMyVideosDownloadCache()
- {
- MPX_FUNC("CVcxMyVideosDownloadCache::~CVcxMyVideosDownloadCache");
-
- iDownloadId.Close();
- iMedia.Close(); // pointers are not own
- }
-
-// ----------------------------------------------------------------------------
-// Constructor.
-// ----------------------------------------------------------------------------
-//
-CVcxMyVideosDownloadCache::CVcxMyVideosDownloadCache()
- {
- MPX_FUNC("CVcxMyVideosDownloadCache::CVcxMyVideosDownloadCache");
- }
-
-// ----------------------------------------------------------------------------
-// Symbian 2nd phase constructor can leave.
-// ----------------------------------------------------------------------------
-//
-void CVcxMyVideosDownloadCache::ConstructL ()
- {
- iDownloadId.Reset();
- iMedia.Reset();
- for ( TInt i = 0; i < KVcxMvDownloadFindCacheSize; i++ )
- {
- iDownloadId.Append( 0 );
- iMedia.Append( NULL );
- }
- }
-
-// ----------------------------------------------------------------------------
-// CVcxMyVideosDownloadCache::Get
-// ----------------------------------------------------------------------------
-//
-CMPXMedia* CVcxMyVideosDownloadCache::Get( TUint32 aDownloadId )
- {
- for ( TInt i = 0; i < KVcxMvDownloadFindCacheSize; i++ )
- {
- if ( iDownloadId[i] == aDownloadId )
- {
- return iMedia[i];
- }
- }
- return NULL;
- }
-
-// ----------------------------------------------------------------------------
-// CVcxMyVideosDownloadCache::Add
-// ----------------------------------------------------------------------------
-//
-void CVcxMyVideosDownloadCache::Add( TUint32 aDownloadId, CMPXMedia* aVideo )
- {
- iPos++;
- iPos %= KVcxMvDownloadFindCacheSize;
- iDownloadId[iPos] = aDownloadId;
- iMedia[iPos] = aVideo;
- }
-
-// ----------------------------------------------------------------------------
-// CVcxMyVideosDownloadCache::Delete
-// ----------------------------------------------------------------------------
-//
-void CVcxMyVideosDownloadCache::Delete( CMPXMedia* aVideo )
- {
- for ( TInt i = 0; i < KVcxMvDownloadFindCacheSize; i++ )
- {
- if ( iMedia[i] == aVideo )
- {
- iDownloadId[i] = 0;
- iMedia[i] = NULL;
- }
- }
- }
-
-// End of file
-
diff -r 48e74db5d516 -r bbb98528c666 videocollection/mpxmyvideoscollection/src/vcxmyvideosdrivemonitor.cpp
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosdrivemonitor.cpp Thu Apr 01 23:13:36 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosdrivemonitor.cpp Thu Apr 01 23:22:15 2010 +0300
@@ -155,46 +155,6 @@
}
}
-#if 0 // not used in mpx my videos collection
-// -----------------------------------------------------------------------------
-// CVcxMyVideosDriveMonitor::RegisterObserverL
-// -----------------------------------------------------------------------------
-//
-void CVcxMyVideosDriveMonitor::RegisterObserverL( MVcxMyVideosDriveMonitorObserver* aObserver )
- {
- iObservers.AppendL( aObserver );
-
- if ( !IsActive() )
- {
- iFs.NotifyChange( ENotifyDisk, iStatus );
- SetActive();
- }
- }
-
-// -----------------------------------------------------------------------------
-// CVcxMyVideosDriveMonitor::RemoveObserverL
-// -----------------------------------------------------------------------------
-//
-void CVcxMyVideosDriveMonitor::RemoveObserverL( MVcxMyVideosDriveMonitorObserver* aObserver )
- {
- TInt i;
- for ( i = 0; i < iObservers.Count(); i++ )
- {
- if ( aObserver == iObservers[i] )
- {
- iObservers.Remove( i );
- iObservers.Compress();
- break;
- }
- }
-
- if ( iObservers.Count() == 0 )
- {
- iFs.NotifyChangeCancel();
- }
- }
-#endif
-
/*
N96 without memory card:
26/09/2007 11:37:22 CIptvDriveMonitor:: drive[2]: type = EMediaNANDFlash
@@ -471,111 +431,6 @@
}
return KErrNotFound;
}
-
-#if 0 // not used by mpx my videos collection
-
-// -----------------------------------------------------------------------------
-// CVcxMyVideosDriveMonitor::PhoneMemoryDriveL
-// -----------------------------------------------------------------------------
-//
-TInt CVcxMyVideosDriveMonitor::PhoneMemoryDriveL()
- {
- TInt drive;
- User::LeaveIfError( drive = PhoneMemoryDrive() );
- return drive;
- }
-
-// -----------------------------------------------------------------------------
-// CVcxMyVideosDriveMonitor::PhoneMemoryDrive
-// -----------------------------------------------------------------------------
-//
-TInt CVcxMyVideosDriveMonitor::PhoneMemoryDrive()
- {
- TInt i;
- for ( i = 0; i < iAvailableDrives.Count(); i++ )
- {
- if ( iAvailableDrives[i].iDrive == EDriveC )
- {
- return iAvailableDrives[i].iDrive;
- }
- }
- return KErrNotFound;
- }
-
-
-// -----------------------------------------------------------------------------
-// CVcxMyVideosDriveMonitor::FixedDriveL
-// -----------------------------------------------------------------------------
-//
-TInt CVcxMyVideosDriveMonitor::FixedDriveL( TBool aExcludeCDrive )
- {
- TInt drive;
- User::LeaveIfError( drive = FixedDrive( aExcludeCDrive ) );
- return drive;
- }
-
-// -----------------------------------------------------------------------------
-// CVcxMyVideosDriveMonitor::FixedDrive
-// -----------------------------------------------------------------------------
-//
-TInt CVcxMyVideosDriveMonitor::FixedDrive( TBool aExcludeCDrive )
- {
- TInt i;
- for ( i = 0; i < iAvailableDrives.Count(); i++ )
- {
- MPX_DEBUG2("CVcxMyVideosDriveMonitor:: iAvailableDrives[%d]", i);
-
- if ( !(iAvailableDrives[i].iFlags & TVcxMyVideosDriveInfo::ERemovable) )
- {
- if ( iAvailableDrives[i].iDrive != EDriveC )
- {
- MPX_DEBUG2("CVcxMyVideosDriveMonitor:: FixedDrive() returning drive %d", iAvailableDrives[i].iDrive);
- return iAvailableDrives[i].iDrive;
- }
- else
- {
- if ( !aExcludeCDrive )
- {
- MPX_DEBUG2("CVcxMyVideosDriveMonitor:: FixedDrive() returning drive %d", iAvailableDrives[i].iDrive);
- return iAvailableDrives[i].iDrive;
- }
- }
- }
- }
- MPX_DEBUG1("CVcxMyVideosDriveMonitor:: FixedDrive() fixed drive not found");
- return KErrNotFound;
- }
-
-// -----------------------------------------------------------------------------
-// CVcxMyVideosDriveMonitor::IsMmcInserted()
-// -----------------------------------------------------------------------------
-//
-TBool CVcxMyVideosDriveMonitor::IsMmcInserted()
- {
- TInt drive = MemoryCardDrive();
-
- if ( drive == KErrNotFound )
- {
- return EFalse;
- }
-
- TInt arrayPos = ArrayPos( drive );
-
- if ( arrayPos == KErrNotFound )
- {
- return EFalse;
- }
-
- TUint32 flags = iAvailableDrives[arrayPos].iFlags;
-
- if ( (flags & TVcxMyVideosDriveInfo::ELocked) || (flags & TVcxMyVideosDriveInfo::EMediaNotPresent) )
- {
- return EFalse;
- }
-
- return ETrue;
- }
-#endif
// -----------------------------------------------------------------------------
// CVcxMyVideosDriveMonitor::RunL()
diff -r 48e74db5d516 -r bbb98528c666 videocollection/mpxmyvideoscollection/src/vcxmyvideosmdsalbums.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosmdsalbums.cpp Thu Apr 01 23:22:15 2010 +0300
@@ -0,0 +1,990 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Provides albums support utilizing MDS.
+*
+*/
+
+
+// INCLUDE FILES
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include "vcxmyvideosmdsalbums.h"
+#include "vcxmyvideosmdsdb.h"
+#include "vcxmyvideoscollectionutil.h"
+#include "vcxmyvideosmdscmdqueue.h"
+
+// ============================ MEMBER FUNCTIONS =============================
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CVcxMyVideosMdsAlbums::CVcxMyVideosMdsAlbums( CVcxMyVideosMdsDb& aMdsDb,
+ MVcxMyVideosMdsAlbumsObserver* aObserver )
+: CActive( EPriorityStandard ), iMdsDb( aMdsDb ), iObserver(aObserver)
+ {
+ }
+
+// ---------------------------------------------------------------------------
+// 2nd-phase constructor
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::ConstructL()
+ {
+ GetSchemaDefinitionsL();
+ CActiveScheduler::Add( this );
+
+ if ( iObserver )
+ {
+ //ENotifyAdd and ENotifyModify are not supported
+ iMdsDb.iMdsSession->AddRelationItemObserverL( *this, NULL,
+ ENotifyRemove, iMdsDb.iNamespaceDef );
+
+#if 0
+ // We receive only IDs from here. We need to make query to get
+ // relation objects-> slow to use. We use the response from
+ // the add operation instead. This way we don't receive
+ // add events if someone else adds videos to our albums
+ // but the performance is the best possible.
+ iMdsDb.iMdsSession->AddRelationObserverL( *this, NULL,
+ ENotifyAdd | ENotifyModify | ENotifyRemove );
+#endif
+ }
+
+ //TODO: do we need this?
+ //iMdsDb.iMdsSession->AddRelationPresentObserverL();
+ }
+
+// ---------------------------------------------------------------------------
+// Two-Phase Constructor
+// ---------------------------------------------------------------------------
+//
+CVcxMyVideosMdsAlbums* CVcxMyVideosMdsAlbums::NewL( CVcxMyVideosMdsDb& aMdsDb,
+ MVcxMyVideosMdsAlbumsObserver* aObserver )
+ {
+ CVcxMyVideosMdsAlbums* self = new(ELeave) CVcxMyVideosMdsAlbums( aMdsDb, aObserver );
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ CleanupStack::Pop( self );
+ return self;
+ }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CVcxMyVideosMdsAlbums::~CVcxMyVideosMdsAlbums()
+ {
+ delete iAlbumQuery;
+ delete iVideoQuery;
+ delete iRelationQuery;
+ delete iAlbumList;
+ iItemArray.Close();
+ iResultBuffer.Close();
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::Cancel
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::Cancel( CVcxMyVideosMdsDb::TRequestType aType )
+ {
+ if ( aType == CVcxMyVideosMdsDb::EAll || aType == CVcxMyVideosMdsDb::EGetAlbums )
+ {
+ if ( iAlbumQuery )
+ {
+ iAlbumQuery->Cancel();
+ }
+ }
+
+ if ( aType == CVcxMyVideosMdsDb::EAll || aType == CVcxMyVideosMdsDb::EGetAlbumContentIds )
+ {
+ if ( iRelationQuery )
+ {
+ iRelationQuery->Cancel();
+ }
+ }
+
+ if ( aType == CVcxMyVideosMdsDb::EAll || aType == CVcxMyVideosMdsDb::EGetAlbumContentVideos )
+ {
+ if ( iVideoQuery )
+ {
+ iVideoQuery->Cancel();
+ }
+ }
+
+
+ //TODO: cancel for "add to album"
+
+ //TODO: cancel for "remove from album"
+
+ //TODO: cancel for "remove albums"
+
+ // Seems like the only way to cancel these is to close session to MDS and reopen it...
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::GetAlbumsL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::GetAlbumsL( CMPXMedia* aAlbumList,
+ MVcxMyVideosMdsAlbumsObserver& aClient )
+ {
+ CVcxMyVideosMdsCmdGetAlbums* cmd = new (ELeave) CVcxMyVideosMdsCmdGetAlbums;
+ CleanupStack::PushL( cmd );
+ cmd->iCmdType = CVcxMyVideosMdsDb::EGetAlbums;
+ cmd->iClient = &aClient;
+ cmd->iAlbumList = aAlbumList;
+ iMdsDb.iCmdQueue->ExecuteCmdL( cmd ); //owneship moves
+ CleanupStack::Pop( cmd );
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::DoGetAlbumsL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::DoGetAlbumsL( CMPXMedia* aAlbumList,
+ MVcxMyVideosMdsAlbumsObserver& aClient )
+ {
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums::DoGetAlbumsL() start");
+
+ iAlbumList = aAlbumList; //store pointer to album list, we do not own this
+ iClient = &aClient;
+
+ delete iAlbumQuery;
+ iAlbumQuery = NULL;
+
+ iAlbumQuery = iMdsDb.iMdsSession->NewObjectQueryL( *iNamespaceDef, *iAlbumObjectDef, this );
+
+ CMdELogicCondition& rootCondition = iAlbumQuery->Conditions();
+ rootCondition.SetOperator( ELogicConditionOperatorOr );
+ rootCondition.AddObjectConditionL( *iAlbumObjectDef );
+ rootCondition.AddPropertyConditionL( *iTypePropertyDef,
+ TMdEIntRange( MdeConstants::Album::EAlbumUser, MdeConstants::Album::EAlbumUser,
+ EMdERangeTypeEqual ) );
+
+ iAlbumQuery->FindL();
+
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums::DoGetAlbumsL() exit");
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::GetAlbumContentIdsL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::GetAlbumContentIdsL( TUint32 aAlbumId,
+ RArray& aContentArray,
+ MVcxMyVideosMdsAlbumsObserver& aClient )
+ {
+ CVcxMyVideosMdsCmdGetAlbumContentIds* cmd = new (ELeave) CVcxMyVideosMdsCmdGetAlbumContentIds;
+ CleanupStack::PushL( cmd ); // 1->
+ cmd->iCmdType = CVcxMyVideosMdsDb::EGetAlbumContentIds;
+ cmd->iClient = &aClient;
+ cmd->iAlbumId = aAlbumId;
+ cmd->iAlbumContent = &aContentArray;
+ iMdsDb.iCmdQueue->ExecuteCmdL( cmd ); //owneship moves
+ CleanupStack::Pop( cmd ); // <-1
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::DoGetAlbumContentIdsL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::DoGetAlbumContentIdsL( TUint32 aAlbumId,
+ RArray& aContentArray,
+ MVcxMyVideosMdsAlbumsObserver& aClient )
+ {
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums::DoGetAlbumContentIdsL() start");
+
+ delete iRelationQuery;
+ iRelationQuery = NULL;
+
+ iClient = &aClient;
+ iAlbumId = aAlbumId;
+ iAlbumContent = &aContentArray;
+
+ iRelationQuery = iMdsDb.iMdsSession->NewRelationQueryL( *iNamespaceDef, this );
+
+ CMdELogicCondition& rootCondition = iRelationQuery->Conditions();
+
+ //relation left side contains and...
+ CMdERelationCondition& relationCondition =
+ rootCondition.AddRelationConditionL( *iContainsRelationDef, ERelationConditionSideLeft); // "AND"
+
+ CMdELogicCondition& leftCondition = relationCondition.LeftL();
+ CMdELogicCondition& rightCondition = relationCondition.RightL();
+
+ //...left side is album...
+ leftCondition.AddObjectConditionL( *iAlbumObjectDef );
+ //...and left id is aAlbumId..
+ leftCondition.AddObjectConditionL( aAlbumId );
+
+ //Right side is video
+ rightCondition.AddObjectConditionL( *iMdsDb.iVideoObjectDef );
+
+ iRelationQuery->FindL();
+
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums::DoGetAlbumContentIdsL() exit");
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::GetAlbumContentVideosL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::GetAlbumContentVideosL( TUint32 aAlbumId, CMPXMedia& aVideoList,
+ MVcxMyVideosMdsAlbumsObserver& aClient )
+ {
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums::GetAlbumContentVideosL() start");
+
+ CVcxMyVideosMdsCmdGetAlbumContentVideos* cmd = new (ELeave) CVcxMyVideosMdsCmdGetAlbumContentVideos;
+ CleanupStack::PushL( cmd ); // 1->
+ cmd->iCmdType = CVcxMyVideosMdsDb::EGetAlbumContentVideos;
+ cmd->iClient = &aClient;
+ cmd->iAlbumId = aAlbumId;
+ cmd->iAlbumContentVideos = &aVideoList;
+ iMdsDb.iCmdQueue->ExecuteCmdL( cmd ); //owneship moves
+ CleanupStack::Pop( cmd ); // <-1
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums::GetAlbumContentVideosL() exit");
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::DoGetAlbumContentVideosL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::DoGetAlbumContentVideosL( TUint32 aAlbumId, CMPXMedia& aVideoList,
+ MVcxMyVideosMdsAlbumsObserver& aClient )
+ {
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums::DoGetAlbumContentVideosL() start");
+
+ delete iVideoQuery;
+ iVideoQuery = NULL;
+
+ iClient = &aClient;
+ iVideoList = &aVideoList;
+ iAlbumId = aAlbumId;
+
+ iVideoQuery = iMdsDb.iMdsSession->NewObjectQueryL( *iNamespaceDef, *iMdsDb.iVideoObjectDef, this );
+ CMdELogicCondition& rootCondition = iVideoQuery->Conditions();
+ CMdERelationCondition& relationCondition =
+ rootCondition.AddRelationConditionL( *iContainsRelationDef );
+
+ CMdELogicCondition& leftCondition = relationCondition.LeftL();
+ CMdELogicCondition& rightCondition = relationCondition.RightL();
+
+ //...left side is an album...
+ leftCondition.AddObjectConditionL( *iAlbumObjectDef );
+ //...and left id is aAlbumId..
+ leftCondition.AddObjectConditionL( aAlbumId );
+
+ //and queried object is on the right side of the relation
+ relationCondition.SetSide( ERelationConditionSideRight );
+
+ const TInt maxItemsInQueryResult = 500;
+ iVideoQuery->FindL( KMdEQueryDefaultMaxCount, maxItemsInQueryResult );
+
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums::DoGetAlbumContentVideosL() exit");
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::GetSchemaDefinitionsL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::GetSchemaDefinitionsL()
+ {
+ iNamespaceDef = &(iMdsDb.iMdsSession->GetDefaultNamespaceDefL());
+
+ _LIT( KVcxAlbumObjectName, "Album" );
+ iAlbumObjectDef = &(iNamespaceDef->GetObjectDefL( KVcxAlbumObjectName ));
+
+ _LIT( KVcxTypePropertyName, "Type" );
+ iTypePropertyDef = &(iAlbumObjectDef->GetPropertyDefL( KVcxTypePropertyName ));
+
+ _LIT( KVcxContainsRelationName, "Contains" );
+ iContainsRelationDef =
+ &(iNamespaceDef->GetRelationDefL( KVcxContainsRelationName ));
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::Object2MediaL
+// For album objects only.
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::Object2MediaL(
+ CMdEObject& aObject,
+ CMPXMedia& aAlbum )
+ {
+ aAlbum.SetTObjectValueL(KMPXMediaGeneralType, EMPXGroup );
+
+ CMdEProperty* property = NULL;
+
+ // ID
+ TMPXItemId mpxId;
+ mpxId.iId1 = aObject.Id();
+ mpxId.iId2 = 2;
+ aAlbum.SetTObjectValueL( KMPXMediaGeneralId, mpxId );
+
+ // TITLE
+ if ( aObject.Property( *iMdsDb.iTitlePropertyDef, property, 0 ) != KErrNotFound )
+ {
+ aAlbum.SetTextValueL( KMPXMediaGeneralTitle,
+ static_cast(property)->Value());
+ }
+
+ // CREATION DATE
+ if ( aObject.Property( *iMdsDb.iCreationDatePropertyDef, property, 0 ) != KErrNotFound )
+ {
+ aAlbum.SetTObjectValueL( KMPXMediaGeneralDate,
+ static_cast(property)->Value().Int64() );
+ }
+
+ // MODIFIED DATE
+ if ( aObject.Property( *iMdsDb.iLastModifiedDatePropertyDef, property, 0 ) != KErrNotFound )
+ {
+ aAlbum.SetTObjectValueL( KVcxMediaMyVideosModifiedDate,
+ static_cast(property)->Value().Int64() );
+ }
+
+#if 0 //TODO
+ // ALBUM TYPE
+ if ( aObject.Property( *iTypePropertyDef, property, 0 ) != KErrNotFound )
+ {
+ aAlbum.SetTObjectValueL( KVcxMediaMyVideosAlbumType,
+ static_cast(property)->Value() );
+ }
+#endif
+
+ //TODO: usage count
+
+ aAlbum.SetTObjectValueL( KMPXMediaGeneralType, EMPXGroup );
+ aAlbum.SetTObjectValueL( KMPXMediaGeneralCategory, EMPXNoCategory );
+ aAlbum.SetTObjectValueL( KVcxMediaMyVideosCategoryItemCount, 0 );
+ aAlbum.SetTObjectValueL( KVcxMediaMyVideosCategoryNewItemCount, 0 );
+
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::Media2ObjectL
+// Called by AddAlbumL()
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::Media2ObjectL(
+ CMPXMedia& aAlbum,
+ CMdEObject& aObject)
+ {
+ CMdEProperty* property;
+
+ // MDS ID
+
+ // TITLE (NAME)
+ if ( aAlbum.IsSupported( KMPXMediaGeneralTitle ) )
+ {
+ if ( aObject.Property( *iMdsDb.iTitlePropertyDef, property, 0 ) != KErrNotFound )
+ {
+ static_cast(property)->SetValueL(
+ aAlbum.ValueText( KMPXMediaGeneralTitle ) );
+ }
+ else
+ {
+ aObject.AddTextPropertyL(
+ *iMdsDb.iTitlePropertyDef, aAlbum.ValueText( KMPXMediaGeneralTitle ) );
+ }
+ }
+
+ // KMPXMediaGeneralDate ( creation date )
+ if ( aAlbum.IsSupported( KMPXMediaGeneralDate ) )
+ {
+ TInt64 creationDateInt64 = 0;
+ creationDateInt64 = aAlbum.ValueTObjectL( KMPXMediaGeneralDate );
+ TTime creationDate( creationDateInt64 );
+ if ( aObject.Property( *iMdsDb.iCreationDatePropertyDef, property, 0 ) != KErrNotFound )
+ {
+ static_cast(property)->SetValueL( creationDate );
+ }
+ else
+ {
+ aObject.AddTimePropertyL( *iMdsDb.iCreationDatePropertyDef, creationDate );
+ }
+ }
+
+ // KVcxMediaMyVideosModifiedDate
+ if ( aAlbum.IsSupported( KVcxMediaMyVideosModifiedDate ) )
+ {
+ TInt64 modifiedDateInt64 = aAlbum.ValueTObjectL( KVcxMediaMyVideosModifiedDate );
+ TTime modifiedDate( modifiedDateInt64 );
+ if ( aObject.Property( *iMdsDb.iLastModifiedDatePropertyDef, property, 0 ) != KErrNotFound )
+ {
+ static_cast(property)->SetValueL( modifiedDate );
+ }
+ else
+ {
+ aObject.AddTimePropertyL( *iMdsDb.iLastModifiedDatePropertyDef, modifiedDate );
+ }
+ }
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::GetSchemaDefinitionsL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::HandleQueryNewResults(CMdEQuery& aQuery,
+ TInt aFirstNewItemIndex,
+ TInt aNewItemCount )
+ {
+ if ( &aQuery == iVideoQuery )
+ {
+ TRAPD( err, HandleVideoQueryResultsL( aQuery, KErrNone,
+ aFirstNewItemIndex, aNewItemCount, EFalse /* completed */ ) );
+ if ( err != KErrNone )
+ {
+ MPX_DEBUG2("CVcxMyVideosMdsAlbums:: HandleVideoQueryResultsL() left: %d", err);
+ }
+ }
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::HandleQueryCompleted
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::HandleQueryCompleted( CMdEQuery& aQuery, TInt aError )
+ {
+ if ( &aQuery == iAlbumQuery )
+ {
+ TRAPD( err, HandleAlbumQueryCompletedL( aQuery, aError ) );
+ if ( err != KErrNone )
+ {
+ MPX_DEBUG2("CVcxMyVideosMdsAlbums:: HandleAlbumQueryCompletedL() left: %d", err);
+ }
+ }
+ else if ( &aQuery == iVideoQuery )
+ {
+ TRAPD( err, HandleVideoQueryResultsL( aQuery, aError, 0, 0, ETrue /* completed */ ) );
+ if ( err != KErrNone )
+ {
+ MPX_DEBUG2("CVcxMyVideosMdsAlbums:: HandleVideoQueryResultsL() left: %d", err);
+ }
+ }
+ else if ( &aQuery == iRelationQuery )
+ {
+ TRAPD( err, HandleRelationQueryCompletedL( aQuery, aError ) );
+ if ( err != KErrNone )
+ {
+ MPX_DEBUG2("CVcxMyVideosMdsAlbums:: HandleRelationQueryCompletedL() left: %d", err);
+ }
+ }
+
+ iMdsDb.iCmdQueue->CmdFinished();
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::HandleAlbumQueryCompletedL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::HandleAlbumQueryCompletedL( CMdEQuery& /*aQuery*/, TInt aError )
+ {
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums::HandleAlbumQueryCompletedL() start");
+
+ if ( aError != KErrNone )
+ {
+ MPX_DEBUG2("CVcxMyVideosMdsAlbums:: object query failed with error: %d", aError);
+ return;
+ }
+
+ CMPXMediaArray* array = iAlbumList->Value( KMPXMediaArrayContents );
+
+ CMPXMedia* media;
+ TInt count = iAlbumQuery->Count();
+
+ iAlbumList->SetTObjectValueL( KMPXMediaArrayCount, count );
+
+ for ( TInt i = 0; i < count; i++ )
+ {
+ CMdEObject& object = iAlbumQuery->Result( i );
+
+ media = CMPXMedia::NewL();
+ CleanupStack::PushL( media ); // 1->
+
+ Object2MediaL( object, *media );
+
+#ifdef _DEBUG
+ TBuf<200> title;
+ title = TVcxMyVideosCollectionUtil::Title( *media );
+ MPX_DEBUG2("CVcxMyVideosMdsAlbums:: object title: %S", &title);
+#endif
+
+ array->AppendL( media );
+
+ CleanupStack::Pop( media ); // <-1
+ }
+
+ iClient->HandleGetAlbumsResp( iAlbumList );
+ iAlbumList = NULL;
+
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums::HandleAlbumQueryCompletedL() exit");
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::HandleVideoQueryCompletedL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::HandleVideoQueryResultsL( CMdEQuery& /*aQuery*/, TInt aError,
+ TInt aFirstNewItemIndex, TInt aNewItemCount, TBool aComplete )
+ {
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums::HandleVideoQueryResultsL() start");
+
+ if ( aComplete )
+ {
+ // error code given only if completed
+ if ( aError != KErrNone )
+ {
+ MPX_DEBUG2("CVcxMyVideosMdsAlbums:: object query failed with error: %d", aError);
+ }
+
+ iClient->HandleGetAlbumContentVideosResp( iAlbumId, *iVideoList,
+ aError, aFirstNewItemIndex, aNewItemCount, aComplete );
+ return;
+ }
+
+ CMPXMediaArray* array = iVideoList->Value( KMPXMediaArrayContents );
+
+ CMPXMedia* media;
+ TInt count = iVideoQuery->Count();
+
+ iVideoList->SetTObjectValueL( KMPXMediaArrayCount, count );
+
+ for ( TInt i = aFirstNewItemIndex; i < count; i++ )
+ {
+ CMdEObject& object = iVideoQuery->Result( i );
+
+ media = CMPXMedia::NewL();
+ CleanupStack::PushL( media ); // 1->
+
+ iMdsDb.Object2MediaL( object, *media );
+
+#ifdef _DEBUG
+ TBuf<200> title;
+ title = TVcxMyVideosCollectionUtil::Title( *media );
+ MPX_DEBUG2("CVcxMyVideosMdsAlbums:: object title: %S", &title);
+#endif
+
+ array->AppendL( media );
+
+ CleanupStack::Pop( media ); // <-1
+ }
+
+ iClient->HandleGetAlbumContentVideosResp( iAlbumId, *iVideoList,
+ aError, aFirstNewItemIndex, aNewItemCount, aComplete );
+ iVideoList = NULL;
+
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums::HandleVideoQueryResultsL() exit");
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::HandleRelationQueryCompletedL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::HandleRelationQueryCompletedL( CMdEQuery& /*aQuery*/, TInt aError )
+ {
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums::HandleRelationQueryCompletedL() start");
+
+ if ( aError != KErrNone )
+ {
+ MPX_DEBUG2("CVcxMyVideosMdsAlbums:: relation query failed with error: %d", aError);
+ return;
+ }
+
+ TInt count = iRelationQuery->Count();
+ TVcxMyVideosAlbumVideo video;
+ for ( TInt i = 0; i < count; i++ )
+ {
+ MPX_DEBUG4("Relation (id = %d): %d contains %d", iRelationQuery->Result( i ).Id(),
+ iRelationQuery->Result( i ).LeftObjectId(),
+ iRelationQuery->Result( i ).RightObjectId());
+ video.iMdsId = iRelationQuery->Result( i ).RightObjectId();
+ video.iRelationMdsId = iRelationQuery->Result( i ).Id();
+ iAlbumContent->AppendL( video );
+ }
+
+ iClient->HandleGetAlbumContentIdsResp( iAlbumId, *iAlbumContent );
+
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums::HandleRelationQueryCompletedL() exit");
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::AddVideosToAlbumL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::AddVideosToAlbumL( CMPXMedia* aCmd,
+ MVcxMyVideosMdsAlbumsObserver& aClient )
+ {
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums::AddVideosToAlbumL() start");
+
+ CVcxMyVideosMdsCmdAddVideosToAlbum* cmd = new (ELeave) CVcxMyVideosMdsCmdAddVideosToAlbum;
+ CleanupStack::PushL( cmd ); // 1->
+ cmd->iCmdType = CVcxMyVideosMdsDb::EAddVideosToAlbum;
+ cmd->iClient = &aClient;
+ cmd->iMpxCmd = aCmd;
+ iMdsDb.iCmdQueue->ExecuteCmdL( cmd ); //owneship moves
+ CleanupStack::Pop( cmd ); // <-1
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums::AddVideosToAlbumL() exit");
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::DoAddVideosToAlbumL
+// Called by iMdsDb.iCmdQueue
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::DoAddVideosToAlbumL( CMPXMedia* aCmd,
+ MVcxMyVideosMdsAlbumsObserver& aClient )
+ {
+ iItemArray.Reset();
+ iResultBuffer.Close();
+ CMdERelation* relation;
+ CMPXMediaArray* videoArray = TVcxMyVideosCollectionUtil::MediaArrayL( *aCmd );
+
+ TInt albumId = TVcxMyVideosCollectionUtil::Uint32ValueL( *aCmd );
+
+ TInt count = videoArray->Count();
+ iItemArray.Reserve( count );
+ for ( TInt i = 0; i < count; i++ )
+ {
+ relation = iMdsDb.iMdsSession->NewRelationL(
+ *iContainsRelationDef, albumId,
+ TVcxMyVideosCollectionUtil::IdL( *videoArray->AtL( i ) ) );
+ CleanupStack::PushL( relation );
+ iItemArray.AppendL( relation );
+ CleanupStack::Pop( relation );
+ }
+
+ iClient = &aClient;
+ iMpxCmd = aCmd;
+
+ iAsyncOperation = EVcxAddVideosToAlbum;
+
+ iMdsDb.iMdsSession->AddItemsAsyncL( iItemArray, iStatus, iResultBuffer );
+ SetActive();
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::RemoveRelationsL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::RemoveRelationsL( RArray& aRelationIds,
+ RArray& aResults, MVcxMyVideosMdsAlbumsObserver& aClient )
+ {
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums::RemoveRelationsL() start");
+
+ CVcxMyVideosMdsCmdRemoveRelations* cmd = new (ELeave) CVcxMyVideosMdsCmdRemoveRelations;
+ CleanupStack::PushL( cmd ); // 1->
+ cmd->iCmdType = CVcxMyVideosMdsDb::ERemoveRelations;
+ cmd->iClient = &aClient;
+ cmd->iRelationIds = &aRelationIds;
+ cmd->iResults = &aResults;
+ iMdsDb.iCmdQueue->ExecuteCmdL( cmd ); //owneship moves
+ CleanupStack::Pop( cmd ); // <-1
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums::RemoveRelationsL() exit");
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::DoRemoveRelationsL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::DoRemoveRelationsL( RArray& aRelationIds,
+ RArray& aResults, MVcxMyVideosMdsAlbumsObserver& aClient )
+ {
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums::DoRemoveRelationsL() start");
+
+ iResultBuffer.Close();
+
+ iClient = &aClient;
+ iResultArrayUint32 = &aResults;
+ iIdArray = &aRelationIds;
+
+ iAsyncOperation = EVcxRemoveRelations;
+
+ iMdsDb.iMdsSession->RemoveRelationsAsyncL( *iIdArray, iStatus, iResultBuffer, iNamespaceDef );
+ SetActive();
+
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums::DoRemoveRelationsL() exit");
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::AddAlbumL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::AddAlbumL( CMPXMedia& aAlbum )
+ {
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums::AddAlbumL() start");
+
+ if ( !iMdsDb.iMdsSession )
+ {
+ MPX_DEBUG2("CVcxMyVideosMdsAlbums:: no mds session(%d), leaving", iMdsDb.iMdsError);
+ User::Leave( iMdsDb.iMdsError );
+ }
+
+ CMdEObject* object = iMdsDb.iMdsSession->NewObjectLC(
+ *iAlbumObjectDef, KNullDesC ); // 1->
+
+ Media2ObjectL( aAlbum, *object );
+ iMdsDb.SetCreationAndModifiedDatesL( *object );
+
+ TUint32 mdsId;
+
+#ifdef _DEBUG
+ TRAPD( err, mdsId = iMdsDb.iMdsSession->AddObjectL( *object ) );
+
+ if ( err != KErrNone )
+ {
+ MPX_DEBUG2( "CVcxMyVideosMdsAlbums:: iMdsDb.iMdsSession->AddObjectL leaved with error: %d", err );
+ User::Leave( err );
+ }
+#else
+
+ mdsId = iMdsDb.iMdsSession->AddObjectL( *object );
+
+#endif
+
+ if ( mdsId == KNoId )
+ {
+ MPX_DEBUG1( "CVcxMyVideosMdsAlbums::AddAlbumL could not add new album" );
+ User::Leave( KErrGeneral );
+ }
+
+ MPX_DEBUG2( "CVcxMyVideosMdsAlbums::AddAlbumL album created, mds id: %d", mdsId );
+
+ aAlbum.SetTObjectValueL( KMPXMediaGeneralId, TMPXItemId( mdsId, KVcxMvcMediaTypeAlbum ) );
+
+ CleanupStack::PopAndDestroy( object ); // <-1
+
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums::AddAlbumL() exit");
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::RemoveAlbumsL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::RemoveAlbumsL( CMPXMedia* aMpxCmd, MVcxMyVideosMdsAlbumsObserver& aClient )
+ {
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums::RemoveAlbumsL() start");
+
+ CVcxMyVideosMdsCmdRemoveAlbums* cmd = new (ELeave) CVcxMyVideosMdsCmdRemoveAlbums;
+ CleanupStack::PushL( cmd ); // 1->
+ cmd->iCmdType = CVcxMyVideosMdsDb::ERemoveAlbums;
+ cmd->iClient = &aClient;
+ cmd->iMpxCmd = aMpxCmd;
+ iMdsDb.iCmdQueue->ExecuteCmdL( cmd ); //owneship moves
+ CleanupStack::Pop( cmd ); // <-1
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums::RemoveAlbumsL() exit");
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::DoRemoveAlbumsL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::DoRemoveAlbumsL( CMPXMedia* aMpxCmd,
+ MVcxMyVideosMdsAlbumsObserver& aClient )
+ {
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums::DoRemoveAlbumsL() start");
+
+ iResultBuffer.Close();
+
+ iClient = &aClient;
+ iMpxCmd = aMpxCmd;
+
+ RArray idArray;
+ CleanupClosePushL( idArray );
+
+ CMPXMediaArray* mediaArray = TVcxMyVideosCollectionUtil::MediaArrayL( *aMpxCmd );
+
+ TVcxMyVideosCollectionUtil::GetIdsFromMediaArrayL( *mediaArray, idArray );
+
+ iAsyncOperation = EVcxRemoveAlbums;
+
+ iMdsDb.iMdsSession->RemoveObjectsAsyncL( idArray, iStatus, iResultBuffer, iNamespaceDef );
+
+ CleanupStack::PopAndDestroy( &idArray );
+ SetActive();
+
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums::DoRemoveAlbumsL() exit");
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::RunL
+// From CActive.
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::RunL()
+ {
+#ifdef _DEBUG
+ TInt status = iStatus.Int();
+ if ( status != KErrNone )
+ {
+ MPX_DEBUG2("CVcxMyVideosMdsAlbums::RunL() iStatus = %d", status);
+ }
+#endif
+
+ switch ( iAsyncOperation )
+ {
+ case EVcxAddVideosToAlbum:
+ {
+ HandleAddVideosToAlbumCompletedL();
+ }
+ break;
+
+ case EVcxRemoveRelations:
+ HandleRemoveRelationsCompletedL();
+ break;
+
+ case EVcxRemoveAlbums:
+ HandleRemoveAlbumsCompletedL();
+ break;
+ }
+
+ iMdsDb.iCmdQueue->CmdFinished();
+ }
+
+//TODO: implement RunError
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::RunL
+// From CActive.
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::DoCancel()
+ {
+ //TODO:
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::HandleAddVideosToAlbumCompletedL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::HandleAddVideosToAlbumCompletedL()
+ {
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums::HandleAddVideosToAlbumCompletedL() start");
+
+ iMdsDb.iMdsSession->DeserializeItemsL( iResultBuffer, iItemArray );
+
+ iClient->HandleAddVideosToAlbumResp( iMpxCmd, iItemArray );
+ iResultBuffer.Close();
+ iItemArray.Close();
+
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums::HandleAddVideosToAlbumCompletedL() exit");
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::HandleRemoveRelationsCompletedL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::HandleRemoveRelationsCompletedL()
+ {
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums::HandleRemoveRelationsCompletedL() start");
+
+ iMdsDb.iMdsSession->DeserializeIdsL( iResultBuffer, NULL, NULL, iResultArrayUint32 );
+
+#ifdef _DEBUG
+ TItemId result;
+ TInt count = iResultArrayUint32->Count();
+ for ( TInt i = 0; i < count; i++ )
+ {
+ result = (*iResultArrayUint32)[i];
+ MPX_DEBUG3("relation remove result[%d] = %d", i, result);
+ }
+#endif
+
+ iClient->HandleRemoveRelationsResp( *iIdArray, *iResultArrayUint32 );
+
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums::HandleRemoveRelationsCompletedL() exit");
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::HandleRemoveAlbumsCompletedL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::HandleRemoveAlbumsCompletedL()
+ {
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums::HandleRemoveAlbumsCompletedL() start");
+
+ RArray resultArray;
+ resultArray.Reset();
+ CleanupClosePushL( resultArray );
+
+ iMdsDb.iMdsSession->DeserializeIdsL( iResultBuffer, &resultArray, NULL, NULL );
+
+#ifdef _DEBUG
+ TItemId result;
+ TInt count = resultArray.Count();
+
+ MPX_DEBUG2("CVcxMyVideosMdsAlbums:: remove albums result count = %d", count);
+
+ for ( TInt i = 0; i < count; i++ )
+ {
+ result = resultArray[i];
+ MPX_DEBUG3("CVcxMyVideosMdsAlbums:: remove albums result[%d] = %d", i, result);
+ }
+#endif
+
+ iClient->HandleRemoveAlbumsResp( iMpxCmd, resultArray );
+
+ CleanupStack::PopAndDestroy( &resultArray );
+
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums::HandleRemoveRelationsCompletedL() exit");
+ }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::HandleRelationItemNotification
+// From MMdERelationItemObserver
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::HandleRelationItemNotification(CMdESession& /*aSession*/,
+ TObserverNotificationType aType,
+ const RArray& aRelationArray)
+ {
+ iObserver->HandleRelationEvent( aType, aRelationArray );
+ }
+
+#if 0 //not used
+// ----------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::HandleRelationNotification
+// From MMdERelationObserver
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::HandleRelationNotification(CMdESession& /*aSession*/,
+ TObserverNotificationType aType,
+ const RArray& aRelationIdArray)
+ {
+ iObserver->HandleRelationIdEvent( aType, aRelationIdArray );
+
+ switch ( aType )
+ {
+ case ENotifyAdd:
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums:: ENotifyAdd");
+ break;
+ case ENotifyModify:
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums:: ENotifyModify");
+ break;
+ case ENotifyRemove:
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums:: ENotifyRemove");
+ break;
+ }
+ }
+#endif
+
+// END OF FILE
diff -r 48e74db5d516 -r bbb98528c666 videocollection/mpxmyvideoscollection/src/vcxmyvideosmdscmdqueue.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosmdscmdqueue.cpp Thu Apr 01 23:22:15 2010 +0300
@@ -0,0 +1,231 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Queues commands to MDS.
+*
+*/
+
+
+// INCLUDE FILES
+#include
+#include
+#include "vcxmyvideosmdscmdqueue.h"
+#include "vcxmyvideosmdsdb.h"
+#include "vcxmyvideosmdsalbums.h"
+
+
+// ============================ MEMBER FUNCTIONS =============================
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CVcxMyVideosMdsCmdQueue::CVcxMyVideosMdsCmdQueue( CVcxMyVideosMdsDb& aMdsDb )
+: iMdsDb( aMdsDb )
+ {
+ }
+
+// ---------------------------------------------------------------------------
+// 2nd-phase constructor
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsCmdQueue::ConstructL()
+ {
+ iQueue.Reset();
+ }
+
+// ---------------------------------------------------------------------------
+// Two-Phase Constructor
+// ---------------------------------------------------------------------------
+//
+CVcxMyVideosMdsCmdQueue* CVcxMyVideosMdsCmdQueue::NewL( CVcxMyVideosMdsDb& aMdsDb )
+ {
+ CVcxMyVideosMdsCmdQueue* self = new(ELeave) CVcxMyVideosMdsCmdQueue( aMdsDb );
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ CleanupStack::Pop( self );
+ return self;
+ }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CVcxMyVideosMdsCmdQueue::~CVcxMyVideosMdsCmdQueue()
+ {
+ for ( TInt i = 0; i < iQueue.Count(); i++ )
+ {
+ delete iQueue[i];
+ }
+ iQueue.Close();
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsCmdQueue::Cancel
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsCmdQueue::Cancel( CVcxMyVideosMdsDb::TRequestType aType )
+ {
+ TInt count = iQueue.Count()-1;
+ for ( TInt i = count; i >= 0; i-- )
+ {
+ if ( iQueue[i]->iCmdType == aType || aType == CVcxMyVideosMdsDb::EAll )
+ {
+ delete iQueue[i];
+ iQueue[i] = NULL;
+ iQueue.Remove( i );
+ }
+ }
+ iQueue.Compress();
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsCmdQueue::ExecuteCmdL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsCmdQueue::ExecuteCmdL( CVcxMyVideosMdsCmd* aCmd )
+ {
+ if ( iQueue.Count() == 0 && !iCmdInProgress )
+ {
+ DoExecuteCmdL( aCmd ); //ownership does not move
+ delete aCmd;
+ }
+ else
+ {
+ iQueue.AppendL( aCmd );
+ }
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsCmdQueue::CmdFinished
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsCmdQueue::CmdFinished()
+ {
+ iCmdInProgress = EFalse;
+
+ TInt err( KErrGeneral );
+ while ( err != KErrNone )
+ {
+ if ( iQueue.Count() == 0 )
+ {
+ break;
+ }
+
+ TInt cmdIndexToExecute;
+ // Let other commads bypass EGetVideoList
+ if ( iQueue.Count() > 1 && iQueue[0]->iCmdType == CVcxMyVideosMdsDb::EGetVideoList )
+ {
+ cmdIndexToExecute = 1;
+ }
+ else
+ {
+ cmdIndexToExecute = 0;
+ }
+ TRAP( err, DoExecuteCmdL( iQueue[cmdIndexToExecute] ) ); //ownership does not move
+ delete iQueue[cmdIndexToExecute];
+ iQueue[cmdIndexToExecute] = NULL;
+ iQueue.Remove( cmdIndexToExecute );
+ iQueue.Compress();
+
+#ifdef _DEBUG
+ if ( err != KErrNone )
+ {
+ MPX_DEBUG2("CVcxMyVideosMdsCmdQueue:: MDS cmd failed: %d", err);
+ }
+#endif
+ }
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsCmdQueue::DoExecuteCmdL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsCmdQueue::DoExecuteCmdL( CVcxMyVideosMdsCmd* aCmd )
+ {
+ switch ( aCmd->iCmdType )
+ {
+ case CVcxMyVideosMdsDb::EGetVideoList:
+ {
+ CVcxMyVideosMdsCmdGetVideoList* cmd =
+ static_cast( aCmd );
+ iMdsDb.DoCreateVideoListL( cmd->iSortingOrder,
+ cmd->iAscending,
+ cmd->iFullDetails,
+ *cmd->iVideoList );
+ iCmdInProgress = ETrue;
+ }
+ break;
+
+ case CVcxMyVideosMdsDb::EGetAlbums:
+ {
+ CVcxMyVideosMdsCmdGetAlbums* cmd = static_cast( aCmd );
+ iMdsDb.iAlbums->DoGetAlbumsL( cmd->iAlbumList, *cmd->iClient );
+ iCmdInProgress = ETrue;
+ }
+ break;
+
+ case CVcxMyVideosMdsDb::EGetAlbumContentIds:
+ {
+ CVcxMyVideosMdsCmdGetAlbumContentIds* cmd =
+ static_cast( aCmd );
+ iMdsDb.iAlbums->DoGetAlbumContentIdsL( cmd->iAlbumId, *cmd->iAlbumContent,
+ *cmd->iClient );
+ iCmdInProgress = ETrue;
+ }
+ break;
+
+ case CVcxMyVideosMdsDb::EGetAlbumContentVideos:
+ {
+ CVcxMyVideosMdsCmdGetAlbumContentVideos* cmd =
+ static_cast( aCmd );
+ iMdsDb.iAlbums->DoGetAlbumContentVideosL( cmd->iAlbumId, *cmd->iAlbumContentVideos,
+ *cmd->iClient );
+ iCmdInProgress = ETrue;
+ }
+ break;
+
+ case CVcxMyVideosMdsDb::EAddVideosToAlbum:
+ {
+ CVcxMyVideosMdsCmdAddVideosToAlbum* cmd =
+ static_cast( aCmd );
+ iMdsDb.iAlbums->DoAddVideosToAlbumL( cmd->iMpxCmd,
+ *cmd->iClient );
+ iCmdInProgress = ETrue;
+ }
+ break;
+
+ case CVcxMyVideosMdsDb::ERemoveRelations:
+ {
+ CVcxMyVideosMdsCmdRemoveRelations* cmd =
+ static_cast( aCmd );
+ iMdsDb.iAlbums->DoRemoveRelationsL( *cmd->iRelationIds, *cmd->iResults,
+ *cmd->iClient );
+ iCmdInProgress = ETrue;
+ }
+ break;
+
+ case CVcxMyVideosMdsDb::ERemoveAlbums:
+ {
+ CVcxMyVideosMdsCmdRemoveAlbums* cmd =
+ static_cast( aCmd );
+ iMdsDb.iAlbums->DoRemoveAlbumsL( cmd->iMpxCmd, *cmd->iClient );
+ iCmdInProgress = ETrue;
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+// END OF FILE
diff -r 48e74db5d516 -r bbb98528c666 videocollection/mpxmyvideoscollection/src/vcxmyvideosmdsdb.cpp
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosmdsdb.cpp Thu Apr 01 23:13:36 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosmdsdb.cpp Thu Apr 01 23:22:15 2010 +0300
@@ -56,7 +56,6 @@
_LIT( KVcxOriginPropertyName, "Origin" ); //16
_LIT( KVcxDurationPropertyName, "Duration" ); //17
_LIT( KVcxLastPlayPositionPropertyName, "LastPlayPosition" ); //10
-_LIT( KVcxDownloadIdPropertyName, "DownloadID" ); //18
_LIT( KVcxRatingPropertyName, "Rating" ); //19
_LIT( KVcxBitratePropertyName, "Bitrate" ); //20
_LIT( KVcxAudioFourCcPropertyName, "AudioFourCC" ); //21
@@ -68,8 +67,9 @@
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
//
-CVcxMyVideosMdsDb::CVcxMyVideosMdsDb( MVcxMyVideosMdsDbObserver* aObserver, RFs& aFs )
-: iFs( aFs ), iMdsDbObserver(aObserver)
+CVcxMyVideosMdsDb::CVcxMyVideosMdsDb( MVcxMyVideosMdsDbObserver* aObserver,
+ MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver, RFs& aFs )
+: iFs( aFs ), iMdsDbObserver(aObserver), iAlbumsObserver(aAlbumsObserver)
{
}
@@ -129,7 +129,7 @@
iMdsSession->AddObjectPresentObserverL( *this );
- iAlbums = CVcxMyVideosMdsAlbums::NewL( *this );
+ iAlbums = CVcxMyVideosMdsAlbums::NewL( *this, iAlbumsObserver );
TCallBack callBack( AsyncHandleQueryCompleted, this );
iAsyncHandleQueryCompleteCaller = new (ELeave) CAsyncCallBack( callBack,
@@ -145,7 +145,6 @@
MPX_DEBUG1( "CVcxMyVideosMdsDb::--------------------------------------------------------------." );
MPX_DEBUG3( "CVcxMyVideosMdsDb::HandleObjectPresentNotification( aPresent = %1d, count = %3d) |", aPresent, aObjectIdArray.Count() );
MPX_DEBUG1( "CVcxMyVideosMdsDb::--------------------------------------------------------------'" );
- //iMdsDbObserver->HandleObjectPresentNotification();
TObserverNotificationType type;
if ( aPresent )
@@ -163,10 +162,11 @@
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
//
-CVcxMyVideosMdsDb* CVcxMyVideosMdsDb::NewL( MVcxMyVideosMdsDbObserver* aObserver, RFs& aFs )
+CVcxMyVideosMdsDb* CVcxMyVideosMdsDb::NewL( MVcxMyVideosMdsDbObserver* aObserver,
+ MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver, RFs& aFs )
{
CVcxMyVideosMdsDb* self =
- CVcxMyVideosMdsDb::NewLC( aObserver, aFs );
+ CVcxMyVideosMdsDb::NewLC( aObserver, aAlbumsObserver, aFs );
CleanupStack::Pop( self );
return self;
}
@@ -175,10 +175,10 @@
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
//
-CVcxMyVideosMdsDb* CVcxMyVideosMdsDb::NewLC(
- MVcxMyVideosMdsDbObserver* aObserver, RFs& aFs )
+CVcxMyVideosMdsDb* CVcxMyVideosMdsDb::NewLC( MVcxMyVideosMdsDbObserver* aObserver,
+ MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver, RFs& aFs )
{
- CVcxMyVideosMdsDb* self = new( ELeave ) CVcxMyVideosMdsDb( aObserver, aFs );
+ CVcxMyVideosMdsDb* self = new( ELeave ) CVcxMyVideosMdsDb( aObserver, aAlbumsObserver, aFs );
CleanupStack::PushL( self );
self->ConstructL();
return self;
@@ -250,18 +250,23 @@
*iVideoObjectDef, aVideo.ValueText( KMPXMediaGeneralUri ) ); // 1->
// check if the file exists and use the creation time from the file
-
+
+ SetCreationAndModifiedDatesL( *object );
+
+#if 0
TTime time;
time.UniversalTime();
TTimeIntervalSeconds timeOffset = User::UTCOffset();
TTime localTime = time + timeOffset;
-
+
+ const TInt secondsInMinute( 60 );
object->AddTimePropertyL( *iCreationDatePropertyDef, localTime );
- object->AddInt16PropertyL( *iTimeOffsetPropertyDef, timeOffset.Int() / 60 );
+ object->AddInt16PropertyL( *iTimeOffsetPropertyDef, timeOffset.Int() / secondsInMinute );
object->AddTimePropertyL( *iLastModifiedDatePropertyDef, localTime );
+#endif
object->AddUint8PropertyL( *iOriginPropertyDef,
aVideo.ValueTObjectL( KVcxMediaMyVideosOrigin ) );
-
+
CMdEProperty* property;
// Type can not be modified normally, so set it here
@@ -365,7 +370,7 @@
CMdEObject* object =
iMdsSession->OpenObjectL( mpxId.iId1, *iVideoObjectDef );
- if ( object == NULL )
+ if ( !object )
{
// No object with this ID was found!
MPX_DEBUG1("CVcxMyVideosMdsDb::UpdateVideoL no object found");
@@ -404,7 +409,8 @@
{
MPX_FUNC( "CVcxMyVideosMdsDb::CreateVideoListL" );
- CVcxMyVideosMdsCmdGetVideoList* cmd = CVcxMyVideosMdsCmdGetVideoList::NewL();
+ CVcxMyVideosMdsCmdGetVideoList* cmd = new (ELeave) CVcxMyVideosMdsCmdGetVideoList;
+ CleanupStack::PushL( cmd ); // 1->
cmd->iCmdType = CVcxMyVideosMdsDb::EGetVideoList;
cmd->iSortingOrder = aSortingOrder;
cmd->iAscending = aAscending;
@@ -412,6 +418,7 @@
cmd->iVideoList = &aVideoList;
iCmdQueue->ExecuteCmdL( cmd ); //ownership moves
+ CleanupStack::Pop( cmd ); // <-1
}
// ---------------------------------------------------------------------------
@@ -512,7 +519,8 @@
iFullDetails = aFullDetails;
- iVideoQuery->FindL(KMdEQueryDefaultMaxCount, 500);
+ const TInt maxItemsInQueryResult = 500;
+ iVideoQuery->FindL( KMdEQueryDefaultMaxCount, maxItemsInQueryResult );
aVideoList->SetTObjectValueL( KMPXMediaGeneralType, EMPXGroup );
aVideoList->SetTObjectValueL( KMPXMediaArrayCount, mediaArray->Count() );
@@ -644,20 +652,21 @@
CMdEObject* object = ObjectL( aId );
- CMPXMedia* video = NULL;
-
- if ( object )
+ if ( !object )
{
- CleanupStack::PushL( object ); // 1->
+ MPX_DEBUG2("CVcxMyVideosMdsDb:: mds id %d not found from mds", aId);
+ User::Leave( KErrNotFound );
+ }
+
+ CleanupStack::PushL( object ); // 1->
- video = CMPXMedia::NewL( );
- CleanupStack::PushL( video ); // 2->
+ CMPXMedia* video = CMPXMedia::NewL( );
+ CleanupStack::PushL( video ); // 2->
- Object2MediaL( *object, *video, aFullDetails );
+ Object2MediaL( *object, *video, aFullDetails );
- CleanupStack::Pop( video ); // <-2
- CleanupStack::PopAndDestroy( object ); // <-1
- }
+ CleanupStack::Pop( video ); // <-2
+ CleanupStack::PopAndDestroy( object ); // <-1
return video;
}
@@ -704,8 +713,6 @@
{
MPX_DEBUG1( "CVcxMyVideosMdsDb:: Videolist fetching was going on");
iVideoListFetchingIsOngoing = EFalse;
-// delete iVideoQuery;
-// iVideoQuery = NULL;
iMdsDbObserver->HandleCreateVideoListResp( iVideoList, -1 /* -1 = no new items */,
ETrue /* complete */);
}
@@ -954,6 +961,7 @@
aVideo.SetTObjectValueL( KMPXMediaGeneralLastPlaybackPosition, pos );
}
+#if 0
//18. DOWNLOAD ID (BRIEF)
if ( aObject.Property( *iDownloadIdPropertyDef, property, 0 ) != KErrNotFound )
{
@@ -964,7 +972,8 @@
{
aVideo.SetTObjectValueL( KVcxMediaMyVideosDownloadId, 0 );
}
-
+#endif
+
//19. RATING (FULL)
if ( aObject.Property( *iRatingPropertyDef, property, 0 ) != KErrNotFound
&& aFullDetails )
@@ -1320,7 +1329,8 @@
aObject.AddReal32PropertyL( *iLastPlayPositionPropertyDef, lastPlaybackPos );
}
}
-
+
+#if 0
// 18. DOWNLOAD ID
if ( aVideo.IsSupported( KVcxMediaMyVideosDownloadId ) )
{
@@ -1335,7 +1345,8 @@
aObject.AddUint32PropertyL( *iDownloadIdPropertyDef, dlId );
}
}
-
+#endif
+
// 19. RATING
if ( aVideo.IsSupported( KVcxMediaMyVideosRating ) )
{
@@ -1493,9 +1504,11 @@
iAudioLanguagePropertyDef = &(iVideoObjectDef->GetPropertyDefL(
KVcxAudioLanguagePropertyName )); //14
+#if 0
iDownloadIdPropertyDef = &(iVideoObjectDef->GetPropertyDefL(
KVcxDownloadIdPropertyName )); //18
-
+#endif
+
}
// ---------------------------------------------------------------------------
@@ -1536,3 +1549,19 @@
}
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsDb::SetCreationAndModifiedDatesL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsDb::SetCreationAndModifiedDatesL( CMdEObject& aObject )
+ {
+ TTime time;
+ time.UniversalTime();
+ TTimeIntervalSeconds timeOffset = User::UTCOffset();
+ TTime localTime = time + timeOffset;
+
+ const TInt secondsInMinute( 60 );
+ aObject.AddTimePropertyL( *iCreationDatePropertyDef, localTime );
+ aObject.AddInt16PropertyL( *iTimeOffsetPropertyDef, timeOffset.Int() / secondsInMinute );
+ aObject.AddTimePropertyL( *iLastModifiedDatePropertyDef, localTime );
+ }
diff -r 48e74db5d516 -r bbb98528c666 videocollection/mpxmyvideoscollection/src/vcxmyvideosmessagelist.cpp
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosmessagelist.cpp Thu Apr 01 23:13:36 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosmessagelist.cpp Thu Apr 01 23:22:15 2010 +0300
@@ -130,7 +130,7 @@
{
message->SetTObjectValueL( KVcxMediaMyVideosInt32Value, aExtraInfo );
}
-
+
MPX_DEBUG1("CVcxMyVideosMessageList:: appending to message array");
iMessageArray->AppendL( message ); // ownership moves
@@ -299,9 +299,7 @@
iMessageList->SetTObjectValueL(KMPXMessageGeneralId, KVcxCommandIdMyVideos);
iMessageList->SetTObjectValueL(KVcxMediaMyVideosCommandId, KVcxMessageMyVideosMessageArray );
- iMessageList->SetTObjectValueL