# HG changeset patch # User Pat Downey # Date 1277310179 -3600 # Node ID d3d3bd65fc7b0e310c1b94a96a2d497ea48352b9 # Parent c48470be1ba700561c7070c880e3ebdabf11eeba# Parent 9b6761e5bd303b0049e29d06e7a5532801caab08 Merge heads. diff -r 9b6761e5bd30 -r d3d3bd65fc7b inc/mpxvideo_debug.h --- a/inc/mpxvideo_debug.h Tue May 18 11:57:40 2010 +0100 +++ b/inc/mpxvideo_debug.h Wed Jun 23 17:22:59 2010 +0100 @@ -41,7 +41,7 @@ #ifdef _MPX_FILE_LOGGING_ #define FU_DEBUG MPXDebug::FileLog #else - #define FU_DEBUG MPXDebug::NullLog + #define FU_DEBUG #endif #endif @@ -49,15 +49,6 @@ class MPXDebug { public: - inline static void NullLog( TRefByValue /*aFmt*/, ... ) - { - } - - inline static void NullLog( TRefByValue /*aFunctionName*/, - TRefByValue /*aFmt*/, ... ) - { - } - inline static void FileLog( TRefByValue aFmt, ... ) { VA_LIST list; @@ -77,8 +68,8 @@ #define MPX_DEBUG TFusionLog::FusionLog #define MPX_ENTER_EXIT TEnterExitLog _s #else - #define MPX_DEBUG MPXDebug::NullLog - #define MPX_ENTER_EXIT MPXDebug::NullLog + #define MPX_DEBUG + #define MPX_ENTER_EXIT #endif @@ -160,8 +151,13 @@ FU_DEBUG(_KMPXErrorInfo, aErr, MPX_S(__FILE__), __LINE__);\ } -#define MPX_TRAP(_r, _s) TRAP(_r,_s);MPX_ERROR_LOG(_r); -#define MPX_TRAPD(_r, _s) TRAPD(_r,_s);MPX_ERROR_LOG(_r); +#ifdef _DEBUG + #define MPX_TRAP(_r, _s) TRAP(_r,_s);MPX_ERROR_LOG(_r); + #define MPX_TRAPD(_r, _s) TRAPD(_r,_s);MPX_ERROR_LOG(_r); +#else // _DEBUG + #define MPX_TRAP(_r, _s) TRAP(_r,_s);(_r=_r); + #define MPX_TRAPD(_r, _s) TRAPD(_r,_s);(_r=_r); +#endif // _DEBUG #endif // __MPXVIDEO_DEBUG_H__ diff -r 9b6761e5bd30 -r d3d3bd65fc7b inc/mpxvideoplayercustomviewmsgconsts.h --- a/inc/mpxvideoplayercustomviewmsgconsts.h Tue May 18 11:57:40 2010 +0100 +++ b/inc/mpxvideoplayercustomviewmsgconsts.h Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,8 @@ */ -// Version : %version: da1mmcf#3 % +// Version : %version: da1mmcf#4 % + #ifndef __MPXVIDEOPLAYERCUSTOMVIEWMSGCONSTS_H__ #define __MPXVIDEOPLAYERCUSTOMVIEWMSGCONSTS_H__ @@ -31,5 +32,6 @@ const TInt KMpxVideoPlaybackPdlReloading = 0x20024339; +const TInt KMpxVideoPlaybackPdlReloadComplete = 0x2002433A; #endif // __MPXVIDEOPLAYERCUSTOMVIEWMSGCONSTS_H__ diff -r 9b6761e5bd30 -r d3d3bd65fc7b inc/videoservices.h --- a/inc/videoservices.h Tue May 18 11:57:40 2010 +0100 +++ b/inc/videoservices.h Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: ou1cpsw#3 % +// Version : %version: 5 % #ifndef __VIDEOSERVICES_H__ #define __VIDEOSERVICES_H__ @@ -164,21 +164,61 @@ VideoServiceUriFetch* mServiceUriFetch; /** + * Deprecated VideoServiceUriFetch service instance. + */ + VideoServiceUriFetch* mServiceUriFetchDeprecatedNewService; + + /** + * Deprecated VideoServiceUriFetch service instance. + */ + VideoServiceUriFetch* mServiceUriFetchDeprecatedOldService; + + /** * VideoServicePlay service instance. */ VideoServicePlay* mServicePlay; /** + * VideoServicePlay service instance. + */ + VideoServicePlay* mServicePlayDeprecatedNewService; + + /** + * VideoServicePlay service instance. + */ + VideoServicePlay* mServicePlayDeprecatedOldService; + + /** * VideoServiceView service instance. */ VideoServiceView* mServiceView; /** + * VideoServiceView service instance. + */ + VideoServiceView* mServiceViewDeprecatedNewService; + + /** + * VideoServiceView service instance. + */ + VideoServiceView* mServiceViewDeprecatedOldService; + + /** * VideoServiceBrowse service instance. */ VideoServiceBrowse *mServiceBrowse; /** + * Deprecated VideoServiceBrowse service instance. + */ + VideoServiceBrowse *mServiceBrowseDeprecatedNewService; + + /** + * Deprecated VideoServiceBrowse service instance. + */ + VideoServiceBrowse *mServiceBrowseDeprecatedOldService; + + /** * Pointer of QVideoPlayerEngine. */ QVideoPlayerEngine* mEngine; diff -r 9b6761e5bd30 -r d3d3bd65fc7b layers.sysdef.xml --- a/layers.sysdef.xml Tue May 18 11:57:40 2010 +0100 +++ b/layers.sysdef.xml Wed Jun 23 17:22:59 2010 +0100 @@ -40,6 +40,12 @@ + + + + + + diff -r 9b6761e5bd30 -r d3d3bd65fc7b mediasettings/mediasettingsengine/group/MPSettROPModel.mmp --- a/mediasettings/mediasettingsengine/group/MPSettROPModel.mmp Tue May 18 11:57:40 2010 +0100 +++ b/mediasettings/mediasettingsengine/group/MPSettROPModel.mmp Wed Jun 23 17:22:59 2010 +0100 @@ -16,10 +16,11 @@ -// Version : %version: 5 % +// Version : %version: 6 % +#include #include TARGET mpsettropmodel.dll CAPABILITY CAP_ECOM_PLUGIN @@ -41,7 +42,7 @@ START RESOURCE MPSettingsROPModel.rss HEADER TARGET mpsettingsropmodel.rsc -TARGETPATH resource +TARGETPATH RESOURCE_FILES_DIR END USERINCLUDE . diff -r 9b6761e5bd30 -r d3d3bd65fc7b mediasettings/mediasettingsengine/rom/mpsettropmodel.iby --- a/mediasettings/mediasettingsengine/rom/mpsettropmodel.iby Tue May 18 11:57:40 2010 +0100 +++ b/mediasettings/mediasettingsengine/rom/mpsettropmodel.iby Wed Jun 23 17:22:59 2010 +0100 @@ -21,8 +21,6 @@ #include -ECOM_PLUGIN( mpsettropmodel.dll, 101f857b.rsc ) - -data=DATAZ_\resource\MPSettingsROPModel.rsc resource\MPSettingsROPModel.rsc +ECOM_PLUGIN( mpsettropmodel.dll, mpsettropmodel.rsc ) #endif // MPSETTROPMODEL_IBY \ No newline at end of file diff -r 9b6761e5bd30 -r d3d3bd65fc7b mediasettings/mediasettingsengine/rom/mpsettropmodelrsc.iby --- a/mediasettings/mediasettingsengine/rom/mpsettropmodelrsc.iby Tue May 18 11:57:40 2010 +0100 +++ b/mediasettings/mediasettingsengine/rom/mpsettropmodelrsc.iby Wed Jun 23 17:22:59 2010 +0100 @@ -22,7 +22,7 @@ #include -data=DATAZ_\APP_RESOURCE_DIR\MPSettingsROPModel.rsc APP_RESOURCE_DIR\MPSettingsROPModel.rsc +data=DATAZ_\RESOURCE_FILES_DIR\mpsettingsropmodel.rsc RESOURCE_FILES_DIR\mpsettingsropmodel.rsc #endif // MPSETTROPMODELRSC_IBY \ No newline at end of file diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/inc/videocollectiontrace.h --- a/videocollection/inc/videocollectiontrace.h Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/inc/videocollectiontrace.h Wed Jun 23 17:22:59 2010 +0100 @@ -29,11 +29,11 @@ #define DISABLE_TRACE 0 /** - * 0 = Tracing into RDebug in all builds. - * 1 = Tracing into RDebug in winscw, file in ARM. (Default) + * 0 = Tracing into RDebug in all builds. (Default) + * 1 = Tracing into RDebug in winscw, file in ARM. * 2 = Tracing into file in all builds. */ -#define TRACE_OUTPUT 1 +#define TRACE_OUTPUT 0 //----------------------------------------------------------------------------- // Trace configuration diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/mpxmyvideoscollection/inc/vcxmyvideosalbums.h --- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideosalbums.h Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosalbums.h Wed Jun 23 17:22:59 2010 +0100 @@ -180,6 +180,18 @@ * @param aMdsId MDS ID of the changed video. */ void VideoTitleChangedL( TUint32 aMdsId ); + + /** + * Called when video is added or removed from cache. Adds changed + * album indexes to iChangedAlbums. + */ + void VideoAddedOrRemovedFromCacheL( CMPXMedia& video ); + + /** + * Goes through iChangedAlbums and updates album attributes and adds + * changed events. + */ + void UpdateChangedAlbumsL(); protected: @@ -340,6 +352,13 @@ */ RArray iMdsOpResultsUint32; + /** + * When videos are removed or added from cache, the indexes of the + * changed albums are stored here. Reason is to calculate new attributes + * only once per changed album. + */ + RArray iChangedAlbums; + }; #endif // VCXMYVIDEOSALBUMS_H diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/mpxmyvideoscollection/inc/vcxmyvideosmdsalbums.h --- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideosmdsalbums.h Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosmdsalbums.h Wed Jun 23 17:22:59 2010 +0100 @@ -359,8 +359,13 @@ * Called from RunL when albums remove completes. */ void HandleRemoveAlbumsCompletedL(); + + /** + * Registers observing to MDS session. + */ + void SetObservingL(); - public: + protected: /** * From MMdEQueryObserver. @@ -396,14 +401,12 @@ TObserverNotificationType aType, const RArray& aRelationArray); -#if 0 //not used /** * From MMdERelationObserver */ void HandleRelationNotification(CMdESession& aSession, TObserverNotificationType aType, const RArray& aRelationIdArray); -#endif private: diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/mpxmyvideoscollection/inc/vcxmyvideosmdsdb.h --- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideosmdsdb.h Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosmdsdb.h Wed Jun 23 17:22:59 2010 +0100 @@ -280,14 +280,14 @@ * @param aObserver The db change observer. */ static CVcxMyVideosMdsDb* NewL( MVcxMyVideosMdsDbObserver* aObserver, - MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver, RFs& aFs ); + RFs& aFs, MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver = NULL ); /** * Two-phased constructor. * @param aObserver The db change observer. */ static CVcxMyVideosMdsDb* NewLC( MVcxMyVideosMdsDbObserver* aObserver, - MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver, RFs& aFs ); + RFs& aFs, MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver = NULL ); /** @@ -434,7 +434,7 @@ * @param aFs Session to file server. */ CVcxMyVideosMdsDb( MVcxMyVideosMdsDbObserver* aObserver, - MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver, RFs& aFs ); + RFs& aFs, MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver = NULL ); void ConstructL(); diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/mpxmyvideoscollection/inc/vcxmyvideosopenhandler.h --- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideosopenhandler.h Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosopenhandler.h Wed Jun 23 17:22:59 2010 +0100 @@ -24,15 +24,6 @@ class CVcxMyVideosMdsDb; #include "vcxmyvideosmdsdb.h" - -enum TVcxItemType - { - EVcxItemTypeNone, - EVcxItemTypeVideo, - EVcxItemTypeCategory, - EVcxItemTypeAlbum - }; - /** */ NONSHARABLE_CLASS( CVcxMyVideosOpenHandler ) : public CBase, public MVcxMyVideosMdsAlbumsObserver diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/mpxmyvideoscollection/inc/vcxmyvideosvideocache.h --- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideosvideocache.h Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosvideocache.h Wed Jun 23 17:22:59 2010 +0100 @@ -25,6 +25,7 @@ // FORWARD DECLARATIONS class CVcxMyVideosCollectionPlugin; class CMPXMedia; +class CRepository; // CONSTANTS @@ -490,7 +491,7 @@ /** * Set to ETrue when doing videolist fetching. */ - TBool IsFetchingVideoList; + TBool iIsFetchingVideoList; private: /** @@ -508,6 +509,12 @@ * order for fast access. */ CVcxMyVideosVideoListIndex* iVideoListIndex; + + /** + * Provides access to the sorting order key in cenrep. Own. + */ + CRepository* iCenRep; + }; #endif // VCXMYVIDEOSVIDEOCACHE_H diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/mpxmyvideoscollection/src/vcxmyvideosalbum.cpp --- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosalbum.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosalbum.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -294,8 +294,8 @@ // void CVcxMyVideosAlbum::CalculateAttributesL( TInt aStartIndex ) { + TInt videoCount = 0; TUint32 count = iVideoList.Count(); - iMedia->SetTObjectValueL( KVcxMediaMyVideosCategoryItemCount, count ); TInt newCount = 0; CMPXMedia* video; CMPXMedia* latestNewVideo = NULL; @@ -308,6 +308,7 @@ video = iCollection.iCache->FindVideoByMdsIdL( iVideoList[i].iMdsId, pos ); if ( video ) { + videoCount++; flags = TVcxMyVideosCollectionUtil::FlagsL( *video ); if ( flags & EVcxMyVideosVideoNew ) { @@ -321,7 +322,7 @@ } } } - iMedia->SetTObjectValueL( KVcxMediaMyVideosCategoryItemCount, count ); + iMedia->SetTObjectValueL( KVcxMediaMyVideosCategoryItemCount, videoCount ); iMedia->SetTObjectValueL( KVcxMediaMyVideosCategoryNewItemCount, newCount ); if ( latestNewVideo ) { diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/mpxmyvideoscollection/src/vcxmyvideosalbums.cpp --- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosalbums.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosalbums.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -49,6 +49,7 @@ void CVcxMyVideosAlbums::ConstructL() { iAlbums.Reset(); + iChangedAlbums.Reset(); } // --------------------------------------------------------------------------- @@ -81,6 +82,7 @@ iMdsOpResults.Close(); iMdsOpResultsUint32.Close(); iRemoveFromAlbumVideos.Close(); + iChangedAlbums.Close(); } // ---------------------------------------------------------------------------- @@ -766,4 +768,39 @@ NewVideoFlagChangedL( aMdsId ); // same calculation works for this } +// ---------------------------------------------------------------------------- +// CVcxMyVideosAlbums::VideoAddedOrRemovedFromCacheL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosAlbums::VideoAddedOrRemovedFromCacheL( CMPXMedia& aVideo ) + { + TInt count = iAlbums.Count(); + TUint32 mdsId = TVcxMyVideosCollectionUtil::IdL( aVideo ).iId1; + for ( TInt i = 0; i < count; i++ ) + { + if ( iAlbums[i]->BelongsToAlbum( mdsId ) ) + { + if ( iChangedAlbums.Find( i ) == KErrNotFound ) + { + iChangedAlbums.AppendL( i ); + } + } + } + } +// ---------------------------------------------------------------------------- +// CVcxMyVideosAlbums::UpdateChangedAlbumsL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosAlbums::UpdateChangedAlbumsL() + { + TInt count = iChangedAlbums.Count(); + for ( TInt i = 0; i < count; i++ ) + { + iCollection.iMessageList->AddEventL( + TMPXItemId( iAlbums[iChangedAlbums[i]]->iMdsId, KVcxMvcMediaTypeAlbum ), + EMPXItemModified, EVcxMyVideosVideoListOrderChanged ); + iAlbums[iChangedAlbums[i]]->CalculateAttributesL(); + } + iChangedAlbums.Reset(); + } // END OF FILE diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/mpxmyvideoscollection/src/vcxmyvideosasyncfileoperations.cpp --- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosasyncfileoperations.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosasyncfileoperations.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -49,8 +49,6 @@ CVcxMyVideosAsyncFileOperations* CVcxMyVideosAsyncFileOperations::NewL( CVcxMyVideosCollectionPlugin& aCollection ) { - MPX_FUNC("CVcxMyVideosAsyncFileOperations::NewL"); - CVcxMyVideosAsyncFileOperations* self = new (ELeave) CVcxMyVideosAsyncFileOperations( aCollection ); CleanupStack::PushL(self); @@ -65,8 +63,6 @@ // CVcxMyVideosAsyncFileOperations::~CVcxMyVideosAsyncFileOperations() { - MPX_FUNC("CVcxMyVideosAsyncFileOperations::~CVcxMyVideosAsyncFileOperations"); - iOperationIdArray.Close(); iOperationResult.Close(); delete iFileCopier; @@ -78,11 +74,9 @@ // Constructor. // ---------------------------------------------------------------------------- // -CVcxMyVideosAsyncFileOperations::CVcxMyVideosAsyncFileOperations( - CVcxMyVideosCollectionPlugin& aCollection ) +CVcxMyVideosAsyncFileOperations::CVcxMyVideosAsyncFileOperations( CVcxMyVideosCollectionPlugin& aCollection ) : iCollection( aCollection ) { - MPX_FUNC("CVcxMyVideosAsyncFileOperations::CVcxMyVideosAsyncFileOperations"); } // ---------------------------------------------------------------------------- @@ -579,17 +573,11 @@ MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: Copy succeeded"); if ( iIsMoveOperation ) { - MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: move case"); + MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: move op: deleting source file"); aErr = BaflUtils::DeleteFile( iCollection.iFs, iSourcePath ); if ( aErr != KErrNone ) { MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: delete for source file failed: %d", aErr ); - MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: deleting target file"); - TInt delErr = BaflUtils::DeleteFile( iCollection.iFs, iTargetPath ); - if ( delErr != KErrNone ) - { - MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: delete for target file failed: %d", delErr ); - } } } } @@ -598,15 +586,21 @@ MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: CopyFile failed: %d", aErr); } - // roll mds and cache back if file operations failed + // roll everything back if file operations failed if ( aErr != KErrNone ) { if ( iIsMoveOperation ) { - MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: move failed %d", aErr ); - MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: setting media path back and leaving." ); + MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: move operation failed %d", aErr ); + MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: setting media path back in MDS" ); iMediaForMoveOp->SetTextValueL( KMPXMediaGeneralUri, iSourcePath ); iCollection.SetVideoL( *iMediaForMoveOp ); + MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: deleting target file"); + TInt delErr = BaflUtils::DeleteFile( iCollection.iFs, iTargetPath ); + if ( delErr != KErrNone ) + { + MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: delete for target file failed: %d", delErr ); + } } else { diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/mpxmyvideoscollection/src/vcxmyvideoscategories.cpp --- a/videocollection/mpxmyvideoscollection/src/vcxmyvideoscategories.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideoscategories.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -202,11 +202,8 @@ media = videoListArray->AtL( i ); - if ( media->IsSupported( KVcxMediaMyVideosOrigin ) ) - { - origin = media->ValueTObjectL( KVcxMediaMyVideosOrigin ); - } - + origin = TVcxMyVideosCollectionUtil::OriginL( *media ); + TBool newVideo = EFalse; TUint32 flags = 0; @@ -549,16 +546,15 @@ { case -1: return KVcxMyVideosAllVideosCategoryIndex; - - case EVcxMyVideosOriginDownloaded: - return KVcxMyVideosDownloadsCategoryIndex; - + case EVcxMyVideosOriginCapturedWithCamera: return KVcxMyVideosCapturedCategoryIndex; + case EVcxMyVideosOriginDownloaded: +#ifndef VIDEO_COLLECTION_PLUGIN_TB92 + return KVcxMyVideosDownloadsCategoryIndex; +#endif case EVcxMyVideosOriginTvRecording: - return KVcxMyVideosTvRecordingsCategoryIndex; - case EVcxMyVideosOriginSideLoaded: case EVcxMyVideosOriginOther: default: diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionplugin.cpp --- a/videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionplugin.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionplugin.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -100,8 +100,11 @@ MPX_FUNC("CVcxMyVideosCollectionPlugin::ConstructL"); User::LeaveIfError( iFs.Connect() ); - - iMyVideosMdsDb = CVcxMyVideosMdsDb::NewL( this, &AlbumsL(), iFs ); +#ifdef VIDEO_COLLECTION_PLUGIN_TB92 + iMyVideosMdsDb = CVcxMyVideosMdsDb::NewL( this, iFs ); +#else + iMyVideosMdsDb = CVcxMyVideosMdsDb::NewL( this, iFs, &AlbumsL() ); +#endif iActiveTask = CVcxMyVideosActiveTask::NewL( *this ); iCache = CVcxMyVideosVideoCache::NewL( *this ); iMessageList = CVcxMyVideosMessageList::NewL( *this ); @@ -432,7 +435,9 @@ MPX_DEBUG1("CVcxMyVideosCollectionPlugin::DoHandleMyVideosDbEventL() --------------------------------------------'"); iCache->RemoveL( aId ); +#ifndef VIDEO_COLLECTION_PLUGIN_TB92 AlbumsL().RemoveAlbumsL( aId ); +#endif } break; @@ -457,12 +462,14 @@ // to not be videos are added to nonVideoIds. iCache->AddVideosFromMdsL( aId, videoListFetchingWasCancelled, &nonVideoIds ); +#ifndef VIDEO_COLLECTION_PLUGIN_TB92 #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 +#endif if ( videoListFetchingWasCancelled ) { @@ -478,7 +485,9 @@ MPX_DEBUG1("CVcxMyVideosCollectionPlugin::DoHandleMyVideosDbEventL() Items modified in MDS, updating cache |"); MPX_DEBUG1("CVcxMyVideosCollectionPlugin::DoHandleMyVideosDbEventL() --------------------------------------'"); CMPXMedia* video; +#ifndef VIDEO_COLLECTION_PLUGIN_TB92 CMPXMedia* album; +#endif TInt count = aId.Count(); for ( TInt i = count - 1; i >= 0; i-- ) { @@ -492,6 +501,10 @@ } else { +#ifdef VIDEO_COLLECTION_PLUGIN_TB92 + MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: couldn't find the modified item from MDS"); + aId.Remove( i ); +#else MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: item was not found from videos, checking albums"); album = iMyVideosMdsDb->iAlbums->GetAlbumL( aId[i] ); @@ -506,6 +519,7 @@ MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: couldn't find the modified item from MDS"); } aId.Remove( i ); +#endif } } @@ -531,6 +545,7 @@ } } +#ifndef VIDEO_COLLECTION_PLUGIN_TB92 //nonVideoIds are albums count = nonVideoIds.Count(); for ( TInt i = 0; i < count; i++ ) @@ -539,9 +554,11 @@ TMPXItemId( nonVideoIds[i], KVcxMvcMediaTypeAlbum ), aEvent ) ); } + iAlbums->UpdateChangedAlbumsL(); +#endif + CleanupStack::PopAndDestroy( &nonVideoIds ); - - iMessageList->SendL(); + iMessageList->SendL(); } // ---------------------------------------------------------------------------- @@ -904,35 +921,6 @@ } } -#if 0 -// ---------------------------------------------------------------------------- -// CVcxMyVideosCollectionPlugin::NotifyDownloadCompletedL -// ---------------------------------------------------------------------------- -// -void CVcxMyVideosCollectionPlugin::NotifyDownloadCompletedL( CMPXMedia& aVideo ) - { - const TInt KMediaExtSize( 8 ); - - HBufC8* buffer = HBufC8::NewL( KMediaExtSize ); - CleanupStack::PushL( buffer ); - TPtr8 des = buffer->Des(); - - RDesWriteStream stream; - CleanupClosePushL( stream ); - stream.Open( des ); - - aVideo.ExternalizeL( stream ); - - stream.CommitL(); - - CleanupStack::PopAndDestroy( &stream ); - - DownloadUtilL().NotifyDownloadCompleted( *buffer ); - - CleanupStack::PopAndDestroy( buffer ); - } -#endif - // ---------------------------------------------------------------------------- // CVcxMyVideosCollectionPlugin::NotifyNewVideosCountDecreasedL // ---------------------------------------------------------------------------- diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionutil.cpp --- a/videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionutil.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionutil.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -254,10 +254,19 @@ if ( aVideo.IsSupported( KVcxMediaMyVideosOrigin ) ) { origin = aVideo.ValueTObjectL( KVcxMediaMyVideosOrigin ); - if ( origin == EVcxMyVideosOriginSideLoaded ) +#ifdef VIDEO_COLLECTION_PLUGIN_TB92 + if ( origin != EVcxMyVideosOriginCapturedWithCamera ) { origin = EVcxMyVideosOriginOther; } +#else + if ( origin != EVcxMyVideosOriginCapturedWithCamera && + origin != EVcxMyVideosOriginDownloaded + ) + { + origin = EVcxMyVideosOriginOther; + } +#endif } return origin; } diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/mpxmyvideoscollection/src/vcxmyvideosmdsalbums.cpp --- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosmdsalbums.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosmdsalbums.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -50,27 +50,8 @@ void CVcxMyVideosMdsAlbums::ConstructL() { GetSchemaDefinitionsL(); - CActiveScheduler::Add( this ); - - if ( iObserver ) - { - //ENotifyAdd and ENotifyModify are not supported - iMdsDb.MdsSessionL().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.MdsSessionL().AddRelationObserverL( *this, NULL, - ENotifyAdd | ENotifyModify | ENotifyRemove ); -#endif - } - - //TODO: do we need this? - //iMdsDb.MdsSessionL().AddRelationPresentObserverL(); + SetObservingL(); + CActiveScheduler::Add( this ); } // --------------------------------------------------------------------------- @@ -160,6 +141,30 @@ } // --------------------------------------------------------------------------- +// CVcxMyVideosMdsAlbums::SetObservingL +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsAlbums::SetObservingL() + { + if ( iObserver ) + { + //ENotifyAdd and ENotifyModify are not supported + iMdsDb.MdsSessionL().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.MdsSessionL().AddRelationObserverL( *this, NULL, + ENotifyAdd | ENotifyModify | ENotifyRemove ); +#endif + } + } + +// --------------------------------------------------------------------------- // CVcxMyVideosMdsAlbums::GetAlbumsL // --------------------------------------------------------------------------- // @@ -1037,7 +1042,10 @@ TObserverNotificationType aType, const RArray& aRelationArray) { - iObserver->HandleRelationEvent( aType, aRelationArray ); + if ( iObserver ) + { + iObserver->HandleRelationEvent( aType, aRelationArray ); + } } #if 0 @@ -1054,7 +1062,10 @@ { case ENotifyAdd: MPX_DEBUG1("CVcxMyVideosMdsAlbums:: relation ENotifyAdd"); - iObserver->HandleRelationIdEvent( aType, aRelationIdArray ); + if ( iObserver ) + { + iObserver->HandleRelationIdEvent( aType, aRelationIdArray ); + } break; case ENotifyModify: MPX_DEBUG1("CVcxMyVideosMdsAlbums:: ENotifyModify"); diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/mpxmyvideoscollection/src/vcxmyvideosmdsdb.cpp --- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosmdsdb.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosmdsdb.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -2,7 +2,7 @@ * 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 "Eclipse Public License v1.0" +* 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". * @@ -159,15 +159,17 @@ } // --------------------------------------------------------------------------- +// CVcxMyVideosMdsDb::CVcxMyVideosMdsDb // --------------------------------------------------------------------------- // CVcxMyVideosMdsDb::CVcxMyVideosMdsDb( MVcxMyVideosMdsDbObserver* aObserver, - MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver, RFs& aFs ) + RFs& aFs, MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver ) : iFs( aFs ), iMdsDbObserver(aObserver), iAlbumsObserver(aAlbumsObserver) { } // --------------------------------------------------------------------------- +// CVcxMyVideosMdsDb::ConstructL // --------------------------------------------------------------------------- // void CVcxMyVideosMdsDb::ConstructL() @@ -233,6 +235,7 @@ if ( iAlbums ) { iAlbums->GetSchemaDefinitionsL(); + iAlbums->SetObservingL(); } } else @@ -273,10 +276,10 @@ // --------------------------------------------------------------------------- // CVcxMyVideosMdsDb* CVcxMyVideosMdsDb::NewL( MVcxMyVideosMdsDbObserver* aObserver, - MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver, RFs& aFs ) + RFs& aFs, MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver ) { CVcxMyVideosMdsDb* self = - CVcxMyVideosMdsDb::NewLC( aObserver, aAlbumsObserver, aFs ); + CVcxMyVideosMdsDb::NewLC( aObserver, aFs, aAlbumsObserver ); CleanupStack::Pop( self ); return self; } @@ -286,9 +289,9 @@ // --------------------------------------------------------------------------- // CVcxMyVideosMdsDb* CVcxMyVideosMdsDb::NewLC( MVcxMyVideosMdsDbObserver* aObserver, - MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver, RFs& aFs ) + RFs& aFs, MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver ) { - CVcxMyVideosMdsDb* self = new( ELeave ) CVcxMyVideosMdsDb( aObserver, aAlbumsObserver, aFs ); + CVcxMyVideosMdsDb* self = new( ELeave ) CVcxMyVideosMdsDb( aObserver, aFs, aAlbumsObserver ); CleanupStack::PushL( self ); self->ConstructL(); return self; @@ -1022,8 +1025,22 @@ //16. ORIGIN, KVcxMediaMyVideosOrigin if ( aObject.Property( *iOriginPropertyDef, property, 0 ) != KErrNotFound ) { - aVideo.SetTObjectValueL( KVcxMediaMyVideosOrigin, - static_cast(property)->Value() ); + TUint8 origin = static_cast(property)->Value(); +#ifdef VIDEO_COLLECTION_PLUGIN_TB92 + if( origin != EVcxMyVideosOriginCapturedWithCamera ) + { + origin = EVcxMyVideosOriginOther; + } +#else + if ( origin != EVcxMyVideosOriginCapturedWithCamera && + origin != EVcxMyVideosOriginDownloaded + ) + { + origin = EVcxMyVideosOriginOther; + } + +#endif + aVideo.SetTObjectValueL( KVcxMediaMyVideosOrigin, origin ); } //17. DURATION, (KMPXMediaGeneralDuration can't be used since it is TInt @@ -1572,11 +1589,6 @@ iAudioLanguagePropertyDef = &(iVideoObjectDef->GetPropertyDefL( KVcxAudioLanguagePropertyName )); //14 - -#if 0 - iDownloadIdPropertyDef = &(iVideoObjectDef->GetPropertyDefL( - KVcxDownloadIdPropertyName )); //18 -#endif } diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/mpxmyvideoscollection/src/vcxmyvideosmessagelist.cpp --- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosmessagelist.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosmessagelist.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -106,7 +106,7 @@ MPX_DEBUG1("CVcxMyVideosMessageList:: ----------------------------------------------'" ); #endif - if ( AlreadyInMessageListL( aId, aChange, aExtraInfo ) ) + if ( aChange == EMPXItemModified && AlreadyInMessageListL( aId, aChange, aExtraInfo ) ) { MPX_DEBUG1("CVcxMyVideosMessageList:: already in message list, skipping add"); return; diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/mpxmyvideoscollection/src/vcxmyvideosopenhandler.cpp --- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosopenhandler.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosopenhandler.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -125,8 +125,10 @@ case categoryLevel: { //we are at root level, return main level items (categories + albums) - + +#ifndef VIDEO_COLLECTION_PLUGIN_TB92 iCollection.AlbumsL().CreateAlbumListL(); //async +#endif // This is needed to update category counters. // Goes to queue if CreateAlbumListL command goes to execution @@ -139,8 +141,14 @@ CMPXMedia* itemList = TVcxMyVideosCollectionUtil::CreateEmptyMediaListL(); CleanupStack::PushL( itemList ); + + itemList->SetTObjectValueL( KVcxMediaMyVideosVideoListIsPartial, + !iCache.IsComplete() ); + TVcxMyVideosCollectionUtil::AppendToListL( *itemList, *iCollection.CategoriesL().iList ); +#ifndef VIDEO_COLLECTION_PLUGIN_TB92 TVcxMyVideosCollectionUtil::AppendToListL( *itemList, *iCollection.AlbumsL().iAlbumList ); +#endif itemList->SetCObjectValueL( KMPXMediaGeneralContainerPath, iPath ); iCollection.iObs->HandleOpen( itemList, KErrNone ); CleanupStack::PopAndDestroy( itemList ); @@ -152,7 +160,9 @@ { //we are at second level, return video list from some category or album +#ifndef VIDEO_COLLECTION_PLUGIN_TB92 iCollection.AlbumsL().CreateAlbumListL(); //async +#endif TMPXItemId categoryId( aPath.Id() ); @@ -219,6 +229,8 @@ { MPX_DEBUG1("CVcxMyVideosOpenHandler:: KVcxMvcCategoryIdAll: calling HandleOpen(iCache.iVideoList)"); iCache.iVideoList->SetCObjectValueL( KMPXMediaGeneralContainerPath, iPath ); + iCache.iVideoList->SetTObjectValueL( KVcxMediaMyVideosInt32Value, + EVcxMyVideosVideoListComplete ); iCollection.iObs->HandleOpen( iCache.iVideoList, KErrNone ); } else @@ -227,6 +239,8 @@ CMPXMedia* videoList = iCache.CreateVideoListByOriginL( origin ); MPX_DEBUG1("CVcxMyVideosOpenHandler:: calling HandleOpen(new list)"); videoList->SetCObjectValueL( KMPXMediaGeneralContainerPath, iPath ); + videoList->SetTObjectValueL( KVcxMediaMyVideosInt32Value, + EVcxMyVideosVideoListComplete ); iCollection.iObs->HandleOpen( videoList, KErrNone ); delete videoList; } @@ -262,8 +276,8 @@ iVideoListsBeingOpened.AppendL( videoList ); CleanupStack::Pop( videoList ); MPX_DEBUG1("CVcxMyVideosOpenHandler:: calling HandleOpen"); - iCache.iVideoList->SetCObjectValueL( KMPXMediaGeneralContainerPath, iPath ); - iCollection.iObs->HandleOpen( iCache.iVideoList, KErrNone ); + videoList->SetCObjectValueL( KMPXMediaGeneralContainerPath, iPath ); + iCollection.iObs->HandleOpen( videoList, KErrNone ); } else { @@ -322,7 +336,7 @@ // End event arrived iCache.SetComplete( ETrue ); - iCache.IsFetchingVideoList = EFalse; + iCache.iIsFetchingVideoList = EFalse; // Create modify event for All category. @@ -390,9 +404,6 @@ // void CVcxMyVideosOpenHandler::HandleAlbumOpenL() { - //TODO: If iVideoList is partial and fetching is already going on -> use the implementation below. - // If iVideoList is partial but fetching is not going on -> fetch only album items to iCache. - MPX_DEBUG1("CVcxMyVideosOpenHandler::HandleAlbumOpenL() start"); CVcxMyVideosAlbum* album = iCollection.AlbumsL().Album( iPendingAlbumOpenId ); @@ -402,15 +413,18 @@ { //videolist complete CMPXMedia* videoList = album->CreateVideoListL(); + CleanupStack::PushL( videoList ); // 1-> videoList->SetCObjectValueL( KMPXMediaGeneralContainerPath, iPath ); + videoList->SetTObjectValueL( KVcxMediaMyVideosInt32Value, + EVcxMyVideosVideoListComplete ); iCollection.iObs->HandleOpen( videoList, KErrNone ); - delete videoList; + CleanupStack::PopAndDestroy( videoList ); // <-1 iCollection.iMessageList->AddEventL( KVcxMessageMyVideosListComplete ); iCollection.iMessageList->SendL(); } else { - if ( iCollection.iCache->IsFetchingVideoList ) + if ( iCollection.iCache->iIsFetchingVideoList ) { MPX_DEBUG1("CVcxMyVideosOpenHandler:: videolist fetching already in progress -> use that to populate album"); @@ -437,9 +451,6 @@ } else { - // videolist incomplete and fetching hasn't been started - // TODO: Test how fast this is. If slow, then ditch the separate album fetching. - MPX_DEBUG1("CVcxMyVideosOpenHandler:: videolist partial and no fetching going on -> fetch the album videos separately"); delete iAlbumVideoList; @@ -500,6 +511,11 @@ MPX_DEBUG2("CVcxMyVideosOpenHandler:: First videos for album %d arrived, calling HandleOpen()", aAlbumId); iAlbumVideoList->SetCObjectValueL( KMPXMediaGeneralContainerPath, iPath ); + if ( aComplete ) + { + iAlbumVideoList->SetTObjectValueL( KVcxMediaMyVideosInt32Value, + EVcxMyVideosVideoListComplete ); + } iCollection.iObs->HandleOpen( iAlbumVideoList, aError ); iPendingAlbumOpenId = 0; } diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/mpxmyvideoscollection/src/vcxmyvideosvideocache.cpp --- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosvideocache.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosvideocache.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -14,7 +14,7 @@ * Description: Video list cache. Contains cached data from MDS.* */ -// Version : %version: TB101_57 % + // INCLUDE FILES @@ -344,18 +344,8 @@ { media = (*allVideosArray)[i]; - TUint8 mediaOrigin = EVcxMyVideosOriginOther; - - if ( media->IsSupported( KVcxMediaMyVideosOrigin ) ) - { - mediaOrigin = *(media->Value( KVcxMediaMyVideosOrigin )); - - if ( mediaOrigin == EVcxMyVideosOriginSideLoaded ) - { - mediaOrigin = EVcxMyVideosOriginOther; - } - } - + TUint8 mediaOrigin = TVcxMyVideosCollectionUtil::OriginL( *media ); + if ( mediaOrigin == aOrigin ) { filteredVideosArray->AppendL( *media ); @@ -749,7 +739,7 @@ TVcxMyVideosSortingOrder sortingOrder = SortingOrderL(); - if ( IsFetchingVideoList + if ( iIsFetchingVideoList && sortingOrder == iLastSortingOrder && !aForce ) { MPX_DEBUG1("CVcxMyVideosVideoCache:: iVideoList creation is already ongoing, skipping"); @@ -760,11 +750,11 @@ { MPX_DEBUG1("CVcxMyVideosVideoCache:: iVideoList was partial or in wrong order or aForce was ETrue, recreating"); - if ( IsFetchingVideoList ) + if ( iIsFetchingVideoList ) { MPX_DEBUG1("CVcxMyVideosVideoCache:: video list fetching is ongoing, canceling it"); iCollection.iMyVideosMdsDb->Cancel( CVcxMyVideosMdsDb::EGetVideoList ); - IsFetchingVideoList = EFalse; + iIsFetchingVideoList = EFalse; } ResetVideoListL(); @@ -790,7 +780,7 @@ EFalse /* brief list */, iVideoList /* use existing */ ); - IsFetchingVideoList = ETrue; + iIsFetchingVideoList = ETrue; iLastSortingOrder = sortingOrder; SetComplete( EFalse ); } @@ -947,14 +937,18 @@ TBool modified = EFalse; iCollection.CategoriesL().UpdateCategoryNewVideoNameAndDateL( *videoInCache, modified ); - + + TUint8 origin = TVcxMyVideosCollectionUtil::OriginL( *videoInCache ); + iCollection.CategoriesL().NewVideoFlagChangedL( oldFlags, newFlags, - videoInCache->ValueTObjectL( KVcxMediaMyVideosOrigin ), + origin, modified ); +#ifndef VIDEO_COLLECTION_PLUGIN_TB92 iCollection.AlbumsL().NewVideoFlagChangedL( TVcxMyVideosCollectionUtil::IdL( *videoInCache ).iId1 ); +#endif } changed = ETrue; } @@ -1146,7 +1140,7 @@ } } - // 22 + // 23 if ( aVideo.IsSupported( KMPXMediaVideoHeight ) ) { TUint16 height = aVideo.ValueTObjectL( KMPXMediaVideoHeight ); @@ -1196,8 +1190,10 @@ iCollection.CategoriesL().UpdateCategoryNewVideoNameAndDateL( *aVideoInCache, modified ); +#ifndef VIDEO_COLLECTION_PLUGIN_TB92 iCollection.AlbumsL().VideoTitleChangedL( TVcxMyVideosCollectionUtil::IdL( *aVideoInCache ).iId1 ); +#endif TVcxMyVideosSortingOrder sortingOrder = SortingOrderL(); if ( sortingOrder == EVcxMyVideosSortingName ) @@ -1443,17 +1439,18 @@ // TVcxMyVideosSortingOrder CVcxMyVideosVideoCache::SortingOrderL() { - TUid uid; - uid.iUid = KVcxMyVideosCollectionCenrepUid; - CRepository* cenRep = CRepository::NewL( uid ); - CleanupStack::PushL( cenRep ); // 1-> + + if( !iCenRep ) + { + TUid uid; + uid.iUid = KVcxMyVideosCollectionCenrepUid; + iCenRep = CRepository::NewL( uid ); + } TInt sortingOrderInCenrep; - TInt cenRepError = cenRep->Get( KVcxMyVideosCollectionCenrepKeySortingOrder, + TInt cenRepError = iCenRep->Get( KVcxMyVideosCollectionCenrepKeySortingOrder, sortingOrderInCenrep ); - - CleanupStack::PopAndDestroy( cenRep ); // <-1 TVcxMyVideosSortingOrder sortingOrder; @@ -1504,6 +1501,9 @@ if ( aUpdateCategories ) { iCollection.CategoriesL().VideoAddedL( aVideo ); +#ifndef VIDEO_COLLECTION_PLUGIN_TB92 + iCollection.AlbumsL().VideoAddedOrRemovedFromCacheL( aVideo ); +#endif } return KErrNone; @@ -1556,13 +1556,14 @@ MPX_DEBUG1("CVcxMyVideosVideoCache:: RemoveL failed since the item wasn't on cache"); return KErrNotFound; } - - TUint32 flags = TVcxMyVideosCollectionUtil::FlagsL( *video ); if ( aUpdateCategories && pos != KErrNotFound /* no need to update if item is on iPartialVideoList*/ ) { iCollection.CategoriesL().VideoRemovedL( *video ); +#ifndef VIDEO_COLLECTION_PLUGIN_TB92 + iCollection.AlbumsL().VideoAddedOrRemovedFromCacheL( *video ); +#endif } if ( pos != KErrNotFound ) @@ -1609,8 +1610,7 @@ { MPX_FUNC("CVcxMyVideosVideoCache::ResetVideoListL"); - //TODO: when should we cancel... - //iCollection.iMyVideosMdsDb->Cancel(); + iCollection.iMyVideosMdsDb->Cancel( CVcxMyVideosMdsDb::EGetVideoList ); CMPXMediaArray* mediaArray = iVideoList->ValueCObjectL( KMPXMediaArrayContents ); diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/inc/VCXTestMdsDbModifier.h --- a/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/inc/VCXTestMdsDbModifier.h Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/inc/VCXTestMdsDbModifier.h Wed Jun 23 17:22:59 2010 +0100 @@ -2,7 +2,7 @@ * 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 "Eclipse Public License v1.0" +* 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". * diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/src/VCXTestMdsDbModifier.cpp --- a/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/src/VCXTestMdsDbModifier.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/src/VCXTestMdsDbModifier.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -2,7 +2,7 @@ * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" +* 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". * diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/tsrc/stubs/inc/hbaction.h --- a/videocollection/tsrc/stubs/inc/hbaction.h Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/tsrc/stubs/inc/hbaction.h Wed Jun 23 17:22:59 2010 +0100 @@ -26,13 +26,8 @@ #include "hbicon.h" #include "hbmenu.h" -class XQServiceUtil -{ -public: - static void toBackground(bool value); - static bool isEmbedded(); - static bool isService(); -}; +#include "xqserviceutilstub.h" +#include "xqserviceproviderstub.h" class HbAction : public QAction { diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/tsrc/stubs/inc/hbinputdialog.h --- a/videocollection/tsrc/stubs/inc/hbinputdialog.h Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/tsrc/stubs/inc/hbinputdialog.h Wed Jun 23 17:22:59 2010 +0100 @@ -20,6 +20,8 @@ #define HBINPUT_DIALOG_H #include "hbwidget.h" +#include "hbaction.h" +#include #include class HbInputDialog : public HbWidget @@ -27,20 +29,58 @@ Q_OBJECT public: - HbInputDialog(QGraphicsItem *parent= 0) : HbWidget(parent) {} - ~HbInputDialog() {} + HbInputDialog(QGraphicsItem *parent= 0); + ~HbInputDialog(); /** - * Returns string in parameter text if mGetTextReturnValue is null QString. + * Create new HbMessageBox and call emitDialogFinished after this one to finish the sequence. + */ + void open( QObject* receiver = 0, const char* member = 0 ); + + /** + * Create new HbInputDialog after call to this and call emitDialogFinished to finish the sequence. */ - static QString getText(const QString &label,const QString &text = QString(), - bool *ok = 0, QGraphicsScene *scene = 0, QGraphicsItem *parent = 0); + void getText(const QString &heading + ,QObject *receiver + ,const char *member + ,const QString &text=QString() + ,QGraphicsScene *scene=0 + ,QGraphicsItem *parent=0); + + void emitDialogFinished( QObject* receiver, const char* member, int actionNum ); + + void setAttribute(int attribute); + + void setPromptText(const QString &text, int row = 0); + + void setValue(const QVariant &value, int row = 0); - static bool mGetTextFails; + QList actions() const + { + return mActions; + } + + QVariant value(int row = 0) { Q_UNUSED(row); mValueCallCount++; return mValueReturnValue; } + +signals: + + void finished(HbAction *action); - static QString mGetTextReturnValue; +public: + + QList mActions; + + QList mSetPromptTexts; + QList mSetValues; + static QString mLastHeading; + static QString mLastText; static int mGetTextCallCount; + static int mAttribute; + static int mOpenCallCount; + + static QVariant mValueReturnValue; + static int mValueCallCount; }; #endif //HBINPUT_DIALOG_H diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/tsrc/stubs/inc/hblistview.h --- a/videocollection/tsrc/stubs/inc/hblistview.h Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/tsrc/stubs/inc/hblistview.h Wed Jun 23 17:22:59 2010 +0100 @@ -275,6 +275,12 @@ Q_UNUSED(position); return mItem; } + + void setObjectName(const QString name) + { + Q_UNUSED(name); + } + public: /** diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/tsrc/stubs/inc/hbmessagebox.h --- a/videocollection/tsrc/stubs/inc/hbmessagebox.h Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/tsrc/stubs/inc/hbmessagebox.h Wed Jun 23 17:22:59 2010 +0100 @@ -19,22 +19,49 @@ #ifndef HBMESSAGEBOX_H #define HBMESSAGEBOX_H +#include #include +#include "hbaction.h" class QGraphicsWidget; class QGraphicsScene; class QGraphicsItem; -class HbMessageBox +class HbMessageBox : public QObject { + Q_OBJECT + public: + enum MessageBoxType { + MessageTypeInformation, + MessageTypeQuestion, + MessageTypeWarning + }; + + HbMessageBox(MessageBoxType type = MessageTypeInformation, QGraphicsItem *parent = 0); + HbMessageBox(const QString &text, MessageBoxType type = MessageTypeInformation, QGraphicsItem *parent = 0); + ~HbMessageBox(); + + /** + * Create new HbMessageBox and call emitDialogFinished after this one to finish the sequence. + */ + void open( QObject* receiver = 0, const char* member = 0 ); + + void emitDialogFinished( QObject* receiver, const char* member, int actionNum ); + + void show(); + + void setAttribute(int attribute); + /** stubbed from HbMessgeBox */ - static bool question(const QString &questionText, - const QString &primaryButtonText = QString(), - const QString &secondaryButtonText = QString(), - QGraphicsWidget *headWidget = 0, - QGraphicsScene *scene = 0, - QGraphicsItem *parent = 0); +/* static void question(const QString &questionText, + QObject *receiver, + const char *member, + const QString &primaryButtonText = tr("Yes"), + const QString &secondaryButtonText = tr("No"), + QGraphicsWidget *headWidget = 0, + QGraphicsScene *scene = 0, + QGraphicsItem *parent = 0 );*/ /** stubbed from HbMessgeBox */ static void information(const QString &informationText, @@ -47,8 +74,20 @@ QGraphicsWidget *headWidget = 0, QGraphicsScene *scene = 0, QGraphicsItem *parent = 0 ); + + QList actions() const + { + return mActions; + } + +signals: + + void finished(HbAction *action); + +public: + + QList mActions; + }; - - #endif // HBMESSAGEBOX_H diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/tsrc/stubs/inc/hbmessageboxdata.h --- a/videocollection/tsrc/stubs/inc/hbmessageboxdata.h Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/tsrc/stubs/inc/hbmessageboxdata.h Wed Jun 23 17:22:59 2010 +0100 @@ -28,6 +28,10 @@ mLatestTxt = ""; mWarningCallCount = 0; mInformationCallCount = 0; + mType = -1; + mAttribute = -1; + mOpenCallCount = 0; + mShowCallCount = 0; } public: // data @@ -35,8 +39,10 @@ static QString mLatestTxt; static int mWarningCallCount; static int mInformationCallCount; + static int mType; + static int mAttribute; + static int mOpenCallCount; + static int mShowCallCount; }; - - #endif // HBMESSAGEBOXDATA_H_ diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/tsrc/stubs/inc/testobjectstore.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/tsrc/stubs/inc/testobjectstore.h Wed Jun 23 17:22:59 2010 +0100 @@ -0,0 +1,49 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "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: +* +*/ + +#ifndef TESTOBJECTSTORE_H +#define TESTOBJECTSTORE_H + +#include +#include +#include + +class TestObjectStore : public QObject +{ + Q_OBJECT + +public: + + static TestObjectStore &instance(); + + void addObject(QObject *object); + +private slots: + + void objectDestroyed(QObject *obj); + +private: + + TestObjectStore(); + + ~TestObjectStore(); + + QList mObjects; + +}; + +#endif diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/tsrc/stubs/inc/videocollectionviewutilsdata.h --- a/videocollection/tsrc/stubs/inc/videocollectionviewutilsdata.h Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/tsrc/stubs/inc/videocollectionviewutilsdata.h Wed Jun 23 17:22:59 2010 +0100 @@ -20,6 +20,7 @@ #include #include +#include "videocollectioncommon.h" class VideoCollectionViewUtilsData { @@ -36,6 +37,7 @@ mIconString = ""; mPressedString = ""; mLastStatusAdditional = QVariant(); + mWidgetLevel = VideoCollectionCommon::ELevelInvalid; } public: // data @@ -49,6 +51,7 @@ static QString mIconString; static QString mPressedString; static QVariant mLastStatusAdditional; + static VideoCollectionCommon::TCollectionLevels mWidgetLevel; }; #endif /* VIDEOCOLLECTIONVIEWUTILSDATA_H */ diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/tsrc/stubs/inc/videolistwidgetdata.h --- a/videocollection/tsrc/stubs/inc/videolistwidgetdata.h Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/tsrc/stubs/inc/videolistwidgetdata.h Wed Jun 23 17:22:59 2010 +0100 @@ -29,6 +29,7 @@ mActivateReturnValue = 0; mActive = false; mDeactivateCount = 0; + mEmitActivatedIndex = QModelIndex(); } public: // data @@ -38,6 +39,7 @@ static int mActivateReturnValue; static bool mActive; static int mDeactivateCount; + static QModelIndex mEmitActivatedIndex; }; #endif /* VIDEOLISTWIDGETDATA_H */ diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/tsrc/stubs/inc/videoservicebrowse.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/tsrc/stubs/inc/videoservicebrowse.h Wed Jun 23 17:22:59 2010 +0100 @@ -0,0 +1,121 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "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: VideoServiceBrowse stub definition +* +*/ + +// Version : %version: 1 % + +#ifndef VIDEOSERVICEBROWSE_H +#define VIDEOSERVICEBROWSE_H + +//INCLUDES +#include +#include "xqserviceproviderstub.h" + +// FORWARD DECLARATIONS +class VideoServices; +class QLatin1String; + +class VideoServiceBrowse : public XQServiceProvider +{ + Q_OBJECT + +public: + VideoServiceBrowse( VideoServices *parent, QLatin1String service ); + ~VideoServiceBrowse(); + +public: + + /** + * Complete pending service request + * + * @param None + * @return None + */ + void complete(); + + /** + * Get current browsing category + * + * @param None + * @return VideoServices::TVideoCategory + */ + int getBrowseCategory() const; + + /** + * Return context title of videos application + * + * @param None + * @return QString + */ + QString contextTitle() const; + + /** + * Return sort role. + * + * @param None. + * @return int. + */ + int sortRole() const; + + /** + * Returns service active status + * + * @return bool true if active, false if not active + * + */ + bool isActive(); + +public slots: + + /** + * Browse video + * + * @param title, Title of the embedded Videos application + * @param category, Category which type of videos are browsed + * @param sort, Sort type. + * @return None + */ + void browseVideos(const QString &title, int category, int sortRole); + + /** + * Browse video + * + * @param category, Category which type of videos are browsed + * @param sort, Sort type. + * @return None + */ + void browseVideos(int category, int sortRole); + +private: + + /** request index of the service */ + int mRequestIndex; + + /** reference to VideoServices instance */ + VideoServices *mServiceApp; + + /** current browsing category */ + int mCategory; + + /** title of the service client, if not set "Videos" is used */ + QString mTitle; + + /** sorting role */ + int mSortRole; + +}; + +#endif//VIDEOSERVICEBROWSE_H diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/tsrc/stubs/inc/videoserviceurifetch.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/tsrc/stubs/inc/videoserviceurifetch.h Wed Jun 23 17:22:59 2010 +0100 @@ -0,0 +1,111 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "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: VideoServiceUriFetch stub definition +* +*/ + +#ifndef __VIDEOSERVICESURIFETCH_H__ +#define __VIDEOSERVICESURIFETCH_H__ + +//INCLUDES +#include "xqserviceproviderstub.h" +#include + +// FORWARD DECLARATIONS +class VideoServices; +class QLatin1String; + +class VideoServiceUriFetch : public XQServiceProvider +{ + + /** + * define to be able to use signals and slots + */ + Q_OBJECT + +public: + + /** + * contructor + */ + VideoServiceUriFetch( VideoServices *parent, QLatin1String service ); + + /** + * destructor + */ + ~VideoServiceUriFetch(); + + /** + * Returns service active status + * + * @return bool true if active, false if not active + * + */ + bool isActive(); + + /** + * Completes the service + * + * @param fileList list of file URIs + * + */ + void complete(QStringList filesList); + + /** + * Returns the context title set by service requestee + * + * @return QString the title + * + */ + QString contextTitle() const; + +public slots: // for QTHighway to notify provider about request + /* + * Client can use this method launch video URI fetching + * + */ + void fetch(); + + /* + * Client can use this method launch video URI fetching + * + * @param title title to be set + * + */ + void fetch(const QString& title); + +public slots: // for provider to notify client + void fetchFailed( int errorCode ); + +private: + void doComplete( QStringList filesList); + +private: + /* + * The request index + */ + int mRequestIndex; + + /* + * Pointer to owning VideoServices + */ + VideoServices* mServiceApp; + + /* + * The title requested by the service user + */ + QString mTitle; +}; + +#endif //__VIDEOSERVICESURIFETCH_H__ diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/tsrc/stubs/inc/xqserviceproviderstub.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/tsrc/stubs/inc/xqserviceproviderstub.h Wed Jun 23 17:22:59 2010 +0100 @@ -0,0 +1,44 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "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: stub +* +*/ + +#ifndef XQSERVICEABSTRACTSERVICESTUB_H +#define XQSERVICEABSTRACTSERVICESTUB_H + +#define XQ_EXPORT_PLUGIN2(x,y) + +#include +#include +#include + +class XQServiceProvider : public QObject +{ + Q_OBJECT + +public: + XQServiceProvider( const QString& service, QObject *parent = 0 ); + ~XQServiceProvider(); + + // void SetPlugin(QObject* impl_plugin); + +//Q_SIGNALS: + //void returnValueDelivered() ; + //void clientDisconnected() ; + +private: +}; + +#endif diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/tsrc/stubs/inc/xqserviceutilstub.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/tsrc/stubs/inc/xqserviceutilstub.h Wed Jun 23 17:22:59 2010 +0100 @@ -0,0 +1,35 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "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: stub +* +*/ + +#ifndef XQSERVICEUTILSTUB_H +#define XQSERVICEUTILSTUB_H + +#include +#include + +class XQServiceUtil +{ +public: + static void toBackground(bool value); + static bool isEmbedded(); + static bool isService(); + + static QString interfaceName(); + static QString operationName(); +}; + +#endif diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/tsrc/stubs/src/hbdocumentloader.cpp --- a/videocollection/tsrc/stubs/src/hbdocumentloader.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/tsrc/stubs/src/hbdocumentloader.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -309,5 +309,9 @@ { obj = new HbStackedWidget(); } + else if(name == DOCML_NAME_LBL_MARKALL) + { + obj = new HbLabel(); + } return obj; } diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/tsrc/stubs/src/hbinputdialog.cpp --- a/videocollection/tsrc/stubs/src/hbinputdialog.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/tsrc/stubs/src/hbinputdialog.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -16,37 +16,88 @@ */ #include "hbinputdialog.h" +#include "testobjectstore.h" -bool HbInputDialog::mGetTextFails = false; -QString HbInputDialog::mGetTextReturnValue = QString(); int HbInputDialog::mGetTextCallCount = 0; - +int HbInputDialog::mAttribute = -1; +QString HbInputDialog::mLastHeading = ""; +QString HbInputDialog::mLastText = ""; +QVariant HbInputDialog::mValueReturnValue = QVariant(); +int HbInputDialog::mValueCallCount = 0; +int HbInputDialog::mOpenCallCount = 0; -QString HbInputDialog::getText(const QString &label,const QString &text, - bool *ok, QGraphicsScene *scene, QGraphicsItem *parent) +HbInputDialog::HbInputDialog(QGraphicsItem *parent) : HbWidget(parent) { - Q_UNUSED(label); - Q_UNUSED(scene); - Q_UNUSED(parent); - mGetTextCallCount++; - QString textReturn; - if(HbInputDialog::mGetTextReturnValue.isNull()) - { - textReturn = text; - } - else - { - textReturn = mGetTextReturnValue; - } - if(mGetTextFails) - { - *ok = false; - textReturn = ""; - } - else - { - *ok = true; - } - return textReturn; + HbAction *action = new HbAction(); + mActions.append(action); + action = new HbAction(); + mActions.append(action); + + TestObjectStore::instance().addObject(this); +} + +HbInputDialog::~HbInputDialog() +{ + while(!mActions.isEmpty()) + { + delete mActions.takeFirst(); + } +} + +void HbInputDialog::open( QObject* receiver, const char* member ) +{ + Q_UNUSED(receiver); + Q_UNUSED(member); + + mOpenCallCount++; } +void HbInputDialog::getText(const QString &heading + ,QObject *receiver + ,const char *member + ,const QString &text + ,QGraphicsScene *scene + ,QGraphicsItem *parent) +{ + Q_UNUSED(receiver); + Q_UNUSED(member); + Q_UNUSED(scene); + Q_UNUSED(parent); + + mLastHeading = heading; + mLastText = text; + mGetTextCallCount++; +} + +void HbInputDialog::emitDialogFinished( QObject* receiver, const char* member, int actionNum ) +{ + if(connect(this, SIGNAL(finished(HbAction *)), receiver, member)) + { + emit finished(mActions.value(actionNum)); + disconnect(this, SIGNAL(finished(HbAction *)), receiver, member); + } +} + +void HbInputDialog::setAttribute(int attribute) +{ + HbInputDialog::mAttribute = attribute; +} + +void HbInputDialog::setPromptText(const QString &text, int row) +{ + while(mSetPromptTexts.count() < row+1) + { + mSetPromptTexts.append(""); + } + mSetPromptTexts[row] = text; +} + +void HbInputDialog::setValue(const QVariant &value, int row) +{ + while(mSetValues.count() < row+1) + { + mSetValues.append(""); + } + mSetValues[row] = value; +} + diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/tsrc/stubs/src/hbmessagebox.cpp --- a/videocollection/tsrc/stubs/src/hbmessagebox.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/tsrc/stubs/src/hbmessagebox.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -19,27 +19,71 @@ #include "hbmessagebox.h" #include "hbmessageboxdata.h" +#include "testobjectstore.h" bool HbMessageBoxData::mQuestionReturnValue = false; QString HbMessageBoxData::mLatestTxt = ""; int HbMessageBoxData::mWarningCallCount = 0; int HbMessageBoxData::mInformationCallCount = 0; +int HbMessageBoxData::mType = -1; +int HbMessageBoxData::mAttribute = -1; +int HbMessageBoxData::mOpenCallCount = 0; +int HbMessageBoxData::mShowCallCount = 0; -bool HbMessageBox::question(const QString &questionText, - const QString &primaryButtonText, - const QString &secondaryButtonText, - QGraphicsWidget *headWidget, - QGraphicsScene *scene, - QGraphicsItem *parent) +HbMessageBox::HbMessageBox(MessageBoxType type, QGraphicsItem *parent) +{ + Q_UNUSED(parent); + HbMessageBoxData::mType = type; + + HbAction *action = new HbAction(); + mActions.append(action); + action = new HbAction(); + mActions.append(action); + + TestObjectStore::instance().addObject(this); +} + +HbMessageBox::HbMessageBox(const QString &text, MessageBoxType type, QGraphicsItem *parent) { - Q_UNUSED(primaryButtonText); - Q_UNUSED(secondaryButtonText); - Q_UNUSED(headWidget); - Q_UNUSED(scene); Q_UNUSED(parent); + HbMessageBoxData::mLatestTxt = text; + HbMessageBoxData::mType = type; - HbMessageBoxData::mLatestTxt = questionText; - return HbMessageBoxData::mQuestionReturnValue; + HbAction *action = new HbAction(); + mActions.append(action); + action = new HbAction(); + mActions.append(action); + + TestObjectStore::instance().addObject(this); +} + +HbMessageBox::~HbMessageBox() +{ + while(!mActions.isEmpty()) + { + delete mActions.takeFirst(); + } +} + +void HbMessageBox::show() +{ + HbMessageBoxData::mShowCallCount++; +} + +void HbMessageBox::open( QObject* receiver, const char* member ) +{ + Q_UNUSED(receiver); + Q_UNUSED(member); + HbMessageBoxData::mOpenCallCount++; +} + +void HbMessageBox::emitDialogFinished( QObject* receiver, const char* member, int actionNum ) +{ + if(connect(this, SIGNAL(finished(HbAction *)), receiver, member)) + { + emit finished(mActions.value(actionNum)); + disconnect(this, SIGNAL(finished(HbAction *)), receiver, member); + } } void HbMessageBox::information(const QString &informationText, @@ -68,4 +112,9 @@ HbMessageBoxData::mWarningCallCount++; } +void HbMessageBox::setAttribute(int attribute) +{ + HbMessageBoxData::mAttribute = attribute; +} + // end of file diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/tsrc/stubs/src/testobjectstore.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/tsrc/stubs/src/testobjectstore.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -0,0 +1,55 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "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: +* +*/ + +#include "testobjectstore.h" + +TestObjectStore::TestObjectStore() +{ + +} + +TestObjectStore::~TestObjectStore() +{ + while(!mObjects.isEmpty()) + { + QObject *obj = mObjects.takeFirst(); + delete obj; + } +} + +TestObjectStore &TestObjectStore::instance() +{ + static TestObjectStore _store; + return _store; +} + +void TestObjectStore::addObject(QObject *object) +{ + if(connect(object, SIGNAL(destroyed(QObject *)), this, SLOT(objectDestroyed(QObject *)))) + { + mObjects.append(object); + } +} + +void TestObjectStore::objectDestroyed(QObject *obj) +{ + if(obj) + { + disconnect(obj, SIGNAL(destroyed(QObject *)), this, SLOT(objectDestroyed(QObject *))); + mObjects.removeOne(obj); + } +} diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/tsrc/stubs/src/videocollectionuiloader.cpp --- a/videocollection/tsrc/stubs/src/videocollectionuiloader.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/tsrc/stubs/src/videocollectionuiloader.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -97,8 +97,9 @@ storeOrphans(list); } -QGraphicsWidget* VideoCollectionUiLoader::doFindWidget(const QString &name) +QGraphicsWidget* VideoCollectionUiLoader::doFindWidget(const QString &name, bool loadIfNotFound) { + Q_UNUSED(loadIfNotFound); QGraphicsWidget *widget = 0; if(VideoCollectionUiLoaderData::mFindFailure) { @@ -111,8 +112,9 @@ return widget; } -QObject* VideoCollectionUiLoader::doFindObject(const QString &name) +QObject* VideoCollectionUiLoader::doFindObject(const QString &name, bool loadIfNotFound) { + Q_UNUSED(loadIfNotFound); QObject *object = 0; if(VideoCollectionUiLoaderData::mFindFailure) { @@ -199,7 +201,7 @@ QObject* VideoCollectionUiLoader::createObject(const QString& type, const QString &name) { - QObject* object = doFindObject(name); + QObject* object = doFindObject(name, true); if (!object) { if (name == DOCML_NAME_VIEW) diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/tsrc/stubs/src/videocollectionviewutils.cpp --- a/videocollection/tsrc/stubs/src/videocollectionviewutils.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/tsrc/stubs/src/videocollectionviewutils.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -28,6 +28,7 @@ QString VideoCollectionViewUtilsData::mIconString = ""; QString VideoCollectionViewUtilsData::mPressedString = ""; QVariant VideoCollectionViewUtilsData::mLastStatusAdditional = QVariant(); +VideoCollectionCommon::TCollectionLevels VideoCollectionViewUtilsData::mWidgetLevel = VideoCollectionCommon::ELevelInvalid; VideoCollectionViewUtils& VideoCollectionViewUtils::instance() { @@ -124,6 +125,17 @@ // not stubbed } +void VideoCollectionViewUtils::saveWidgetLevel(VideoCollectionCommon::TCollectionLevels &level) +{ + Q_UNUSED(level); + // not stubbed +} + +VideoCollectionCommon::TCollectionLevels VideoCollectionViewUtils::loadWidgetLevel() +{ + return VideoCollectionViewUtilsData::mWidgetLevel; +} + void VideoCollectionViewUtils::sortModel(VideoSortFilterProxyModel *model, bool async, VideoCollectionCommon::TCollectionLevels target) { diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/tsrc/stubs/src/videolistselectiondialog.cpp --- a/videocollection/tsrc/stubs/src/videolistselectiondialog.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/tsrc/stubs/src/videolistselectiondialog.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -144,4 +144,16 @@ // not stubbed } +void VideoListSelectionDialog::newAlbumNameDialogFinished(HbAction *action) +{ + Q_UNUSED(action); + // not stubbed +} + +void VideoListSelectionDialog::finalize(QString albumName) +{ + Q_UNUSED(albumName); + // not stubbed +} + // end of file diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/tsrc/stubs/src/videolistview.cpp --- a/videocollection/tsrc/stubs/src/videolistview.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/tsrc/stubs/src/videolistview.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -246,4 +246,10 @@ // not stubbed } +void VideoListView::createCollectionDialogFinished(HbAction *action) +{ + Q_UNUSED(action); + // not stubbed +} + // end of file diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/tsrc/stubs/src/videolistwidget.cpp --- a/videocollection/tsrc/stubs/src/videolistwidget.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/tsrc/stubs/src/videolistwidget.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -25,6 +25,7 @@ int VideoListWidgetData::mActivateReturnValue = 0; bool VideoListWidgetData::mActive = false; int VideoListWidgetData::mDeactivateCount = 0; +QModelIndex VideoListWidgetData::mEmitActivatedIndex = QModelIndex(); VideoListWidget::VideoListWidget(VideoCollectionUiLoader* uiLoader, HbView *parent): HbListView(parent), @@ -48,13 +49,13 @@ } int VideoListWidget::initialize(VideoSortFilterProxyModel &model, - VideoServices *videoServices) + VideoServices *videoServices, VideoCollectionCommon::TCollectionLevels level) { Q_UNUSED(videoServices); VideoListWidgetData::mInitializeCount++; mModel = &model; - + mCurrentLevel = level; return VideoListWidgetData::mInitializeReturnValue; } @@ -116,8 +117,7 @@ void VideoListWidget::emitActivated (const QModelIndex &modelIndex) { - Q_UNUSED(modelIndex); - // not stubbed + VideoListWidgetData::mEmitActivatedIndex = modelIndex; } void VideoListWidget::setSelectionMode(int mode) @@ -133,12 +133,6 @@ // not stubbed } -void VideoListWidget::panGesture (const QPointF &point) -{ - Q_UNUSED(point); - // not stubbed -} - void VideoListWidget::openItemSlot() { // not stubbed @@ -215,4 +209,22 @@ // not stubbed } +void VideoListWidget::renameDialogFinished(HbAction *action) +{ + Q_UNUSED(action); + // not stubbed +} + +void VideoListWidget::deleteItemDialogFinished(HbAction *action) +{ + Q_UNUSED(action); + // not stubbed +} + +void VideoListWidget::removeCollectionDialogFinished(HbAction *action) +{ + Q_UNUSED(action); + // not stubbed +} + // end of file diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/tsrc/stubs/src/videoservicebrowse.cpp --- a/videocollection/tsrc/stubs/src/videoservicebrowse.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/tsrc/stubs/src/videoservicebrowse.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,10 +15,11 @@ * */ -// Version : %version: 3 % +// Version : %version: 6 % #include +#include "xqserviceproviderstub.h" #include "videoservices.h" #include "videoservicebrowse.h" #include "mpxhbvideocommondefs.h" @@ -30,8 +31,8 @@ Constructor. \param parent, Pointer to the video services. */ -VideoServiceBrowse::VideoServiceBrowse(VideoServices* parent) - : XQServiceProvider( "TestListView" ) +VideoServiceBrowse::VideoServiceBrowse(VideoServices* parent, QLatin1String service) + : XQServiceProvider( service, parent ) , mRequestIndex( 0 ) , mServiceApp( parent ) { @@ -94,4 +95,18 @@ // not stubbed } +/*! + Browse videos. + \param category, Category which type of videos are browsed. + \return None. +*/ +void VideoServiceBrowse::browseVideos(int category, + int sortRole) +{ + Q_UNUSED(category); + Q_UNUSED(sortRole); + + // not stubbed +} + // End of file diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/tsrc/stubs/src/videoservices.cpp --- a/videocollection/tsrc/stubs/src/videoservices.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/tsrc/stubs/src/videoservices.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -70,8 +70,8 @@ mCurrentService(VideoServices::ENoService), mSortRole(0) { - mServiceUriFetch = new VideoServiceUriFetch(this); - mServiceBrowse = new VideoServiceBrowse(this); + mServiceUriFetch = new VideoServiceUriFetch(this, QLatin1String("TestListView")); + mServiceBrowse = new VideoServiceBrowse(this, QLatin1String("TestListView")); } VideoServices::~VideoServices() diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/tsrc/stubs/src/videoserviceurifetch.cpp --- a/videocollection/tsrc/stubs/src/videoserviceurifetch.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/tsrc/stubs/src/videoserviceurifetch.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,11 +15,12 @@ * */ +#include "xqserviceproviderstub.h" #include "videoserviceurifetch.h" #include "videoservices.h" -VideoServiceUriFetch::VideoServiceUriFetch(VideoServices* parent): - XQServiceProvider("TestListView"), +VideoServiceUriFetch::VideoServiceUriFetch(VideoServices* parent, QLatin1String service): + XQServiceProvider( service, parent ), mRequestIndex(0), mServiceApp(parent) { @@ -61,6 +62,11 @@ return QString(); } +void VideoServiceUriFetch::fetch() +{ + mServiceApp->setCurrentService(VideoServices::EUriFetcher); +} + void VideoServiceUriFetch::fetch(const QString& title) { Q_UNUSED(title); diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/tsrc/stubs/src/xqserviceprovider.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/tsrc/stubs/src/xqserviceprovider.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "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: Stub for xqserviceprovider + * + */ + +#include "xqserviceproviderstub.h" + +XQServiceProvider::XQServiceProvider( const QString& service, QObject *parent ) +{ + Q_UNUSED(service); + Q_UNUSED(parent); +} + +XQServiceProvider::~XQServiceProvider() +{ + +} + diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/tsrc/stubs/src/xqserviceutil.cpp --- a/videocollection/tsrc/stubs/src/xqserviceutil.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/tsrc/stubs/src/xqserviceutil.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,8 +15,9 @@ * */ -#include "hbaction.h" +#include "xqserviceutilstub.h" #include "xqserviceutilxtra.h" +#include "videoservices.h" void XQServiceUtil::toBackground(bool value) { @@ -37,4 +38,25 @@ return service; } +QString XQServiceUtil::interfaceName() +{ + VideoServices *videoServices = VideoServices::instance(); + QString interfaceName; + if(videoServices->currentService() == VideoServices::EUriFetcher) + { + interfaceName = "IVideoFetch"; + } + else if(videoServices->currentService() == VideoServices::EBrowse) + { + interfaceName = "IVideoBrowse"; + } + videoServices->decreaseReferenceCount(); + return interfaceName; +} + +QString XQServiceUtil::operationName() +{ + return QString(); +} + // End of file diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/tsrc/stubs/stubs.pro --- a/videocollection/tsrc/stubs/stubs.pro Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/tsrc/stubs/stubs.pro Wed Jun 23 17:22:59 2010 +0100 @@ -14,6 +14,8 @@ # Description: # +DEFINES += XQPLUGIN_H +DEFINES += XQSERVICEABSTRACTSERVICE_H DEFINES += XQSERVICEUTIL_H CONFIG += qtestlib \ @@ -23,11 +25,16 @@ LIBS += -lestor.dll \ -lfbscli.dll \ -lbitgdi.dll \ + -lmpxviewframeworkqt.dll \ -lxqplugins.dll \ - -lmpxviewframeworkqt.dll \ -lxqservice.dll HEADERS_TEMP = \ + inc/videoserviceurifetch.h \ + inc/videoservicebrowse.h \ + inc/xqserviceutilstub.h \ + inc/xqserviceproviderstub.h \ + inc/testobjectstore.h \ inc/hbabstractitemview.h \ inc/hbdocumentloader.h \ inc/hbaction.h \ @@ -81,11 +88,11 @@ ../../videocollectionwrapper/inc/videolistdatamodel.h \ ../../videocollectionwrapper/inc/videocollectionwrapper.h \ ../../videocollectionwrapper/inc/videosortfilterproxymodel.h \ - ../../videocollectionwrapper/inc/videothumbnaildata.h \ - ../../../videoplayerapp/videoplayerengine/inc/videoserviceurifetch.h \ - ../../../videoplayerapp/videoplayerengine/inc/videoservicebrowse.h + ../../videocollectionwrapper/inc/videothumbnaildata.h SOURCES_TEMP = \ + src/xqserviceprovider.cpp \ + src/testobjectstore.cpp \ src/hbdocumentloader.cpp \ src/hbaction.cpp \ src/hbcheckbox.cpp \ diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/tsrc/videoservicestestapp/inc/videoservicestestappview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/tsrc/videoservicestestapp/inc/videoservicestestappview.h Wed Jun 23 17:22:59 2010 +0100 @@ -0,0 +1,63 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "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: +* +*/ +#ifndef VIDEOSERVICESTESTAPPVIEW_H_ +#define VIDEOSERVICESTESTAPPVIEW_H_ + +#include +#include + +class XQApplicationManager; +class XQAiwRequest; +class HbLineEdit; + +class VideoServicesTestAppView : public HbView +{ + Q_OBJECT + +public: + VideoServicesTestAppView(QGraphicsItem *parent=0); + virtual ~VideoServicesTestAppView(); + +private slots: + void handleOk(const QVariant &result); + void handleError(int errorCode, const QString& errorMessage); + + void fetchVideo(); + void fetchVideoDeprecatedOldService(); + void fetchVideoDeprecatedNewService(); + void browseCapturedVideos(); + void browseCapturedVideosDeprecatedOldService(); + void browseCapturedVideosDeprecatedNewService(); + +public slots: + + void browseCapturedVideosFinished(HbAction *action); + void browseCapturedVideosDeprecatedOldServiceFinished(HbAction *action); + void browseCapturedVideosDeprecatedNewServiceFinished(HbAction *action); + +private: + void createLayout(); + +private: + XQApplicationManager mAppMgr; + XQAiwRequest* mReq; + HbLineEdit* mResultEdit; + HbLineEdit* mErrorCodeEdit; + HbLineEdit* mErrorEdit; +}; + +#endif /* VIDEOSERVICESTESTAPPVIEW_H_ */ diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/tsrc/videoservicestestapp/rom/videoservicestestapp.iby --- a/videocollection/tsrc/videoservicestestapp/rom/videoservicestestapp.iby Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/tsrc/videoservicestestapp/rom/videoservicestestapp.iby Wed Jun 23 17:22:59 2010 +0100 @@ -11,13 +11,13 @@ * * Contributors: * -* Description: hbvideoplayer.iby +* Description: videoservicetestapp.iby * */ -#ifndef __HBVIDEOSERVICESTESTAPP_IBY__ -#define __HBVIDEOSERVICESTESTAPP_IBY__ +#ifndef __VIDEOSERVICESTESTAPP_IBY__ +#define __VIDEOSERVICESTESTAPP_IBY__ #include #include @@ -27,4 +27,4 @@ data=DATAZ_/APP_RESOURCE_DIR/videoservicestestapp.rsc APP_RESOURCE_DIR/videoservicestestapp.rsc -#endif // __HBVIDEOSERVICESTESTAPP_IBY__ +#endif // __VIDEOSERVICESTESTAPP_IBY__ diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/tsrc/videoservicestestapp/sis/Nokia_RnDCert_02.der Binary file videocollection/tsrc/videoservicestestapp/sis/Nokia_RnDCert_02.der has changed diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/tsrc/videoservicestestapp/sis/Nokia_RnDCert_02.key --- a/videocollection/tsrc/videoservicestestapp/sis/Nokia_RnDCert_02.key Tue May 18 11:57:40 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXQIBAAKBgQC/TDP7KKIaf5+uW4OD2iVZuUMC2a+SeQTjf6srlKcOm+CpPNXn -uLNm/8fdEnyOIuRXPRKmqhs1n0JkxEGHynELWMTuKXbQx9SRAGUXzyneGn+IJNnO -vOKHWgKCouX2hfI8rtkdqJpqmO460gGsMgw+lsbeyWyW9lnfLxq+ZC7sqQIDAQAB -AoGBALmUWZE8GBaQ3P4u9WUCSd3DJkkrmXIFSULSZeH/chlwCwDjbbhArHothVzo -REE3hEFFlERvHbplZ+mNouzy7boduvgUzbksGrbGMLJ2qO1GzWWVwV+GzOWKd3ss -/98Gwoy5R8pjnkqUE2wP1iJFw0FjvUTKcYv/z6t3LLJ0CsoBAkEA+c7ixvsviQ3J -s0INytCKU2bf8fqFQJi1VI82ukxNsujGTQ9upVSjuvqPvWyDvvTdrUBHqO+3qPut -sEh01Q8aiQJBAMQKDJPVRu4ud3mwUfEavzL5EjqwG1k9VCNGYsT4FwtrHcxu1oP/ -pk6M3rIZukqomoEEnHWPMwhrK3fhBqi0OSECQQDr40VXege4FnH5OI2Hj4afHMyp -VdQQXGMWFyopnzXblFz0lXb43cTCIiorR9XcMqNFHybLypkWE5o+lRzlt55pAkBQ -P/zeF5Sts//cpL0mgdh7OVKpC6ZmZaCnwAx2rUhhuDu+kDDoYCLoTOps5fNI1LRK -1GRoC3LMo3Jr5IYhUYWBAkBpCpN6k4JU/mszq98EojHerQNxk8sPqvQKUzTutohT -1gLX9yepGayB/TtT2EEJDkWOlnTy/dvN6W3vzbJYz97x ------END RSA PRIVATE KEY----- diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/tsrc/videoservicestestapp/sis/videoservicestestapp.sisx Binary file videocollection/tsrc/videoservicestestapp/sis/videoservicestestapp.sisx has changed diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/tsrc/videoservicestestapp/src/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/tsrc/videoservicestestapp/src/main.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -0,0 +1,34 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "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: +* +*/ + +#include +#include +#include "videoservicestestappview.h" + +int main(int argc, char *argv[]) +{ + QCoreApplication::setOrganizationName("Nokia"); + QCoreApplication::setApplicationName("VideoServicesTestApp"); + + HbApplication app(argc, argv); + HbMainWindow mainWindow( 0, Hb::WindowFlagTransparent ); + mainWindow.setAttribute( Qt::WA_OpaquePaintEvent ); + VideoServicesTestAppView *mainView = new VideoServicesTestAppView; + mainWindow.addView(mainView); + mainWindow.show(); + return app.exec(); +} diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/tsrc/videoservicestestapp/src/videoservicestestappview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/tsrc/videoservicestestapp/src/videoservicestestappview.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -0,0 +1,504 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "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: +* +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "videoservicestestappview.h" + +VideoServicesTestAppView::VideoServicesTestAppView(QGraphicsItem *parent) : + HbView(parent), + mReq(0), + mResultEdit(0), + mErrorCodeEdit(0), + mErrorEdit(0) +{ + qDebug() << "VideoServicesTestAppView::VideoServicesTestAppView"; + createLayout(); +} + + +VideoServicesTestAppView::~VideoServicesTestAppView() +{ + qDebug() << "VideoServicesTestAppView::~VideoServicesTestAppView"; + delete mReq; +} + + +void VideoServicesTestAppView::handleOk(const QVariant &result) +{ + qDebug() << "VideoServicesTestAppView::handleOk"; + + if (!result.canConvert()) + { + mErrorEdit->setText("Corrupt result"); + } + else + { + QString text = result.value(); + if (text.isEmpty()) + { + text = "No result available in this service"; + } + mResultEdit->setText(text); + qDebug() << "VideoServicesTestAppView::handleOk" << ": result=" << text; + } + +} + + +void VideoServicesTestAppView::handleError(int errorCode, const QString& errorMessage) +{ + qDebug() << "VideoServicesTestAppView::handleError" << ": errorCode=" << errorCode << ", msg:" << errorMessage; + mErrorEdit->setText(errorMessage); + mErrorCodeEdit->setText(QString::number(errorCode)); +} + + +void VideoServicesTestAppView::createLayout() +{ + qDebug() << "VideoServicesTestAppView::createLayout"; + + QGraphicsLinearLayout* layout = new QGraphicsLinearLayout(Qt::Vertical); + + if (layout) + { + QGraphicsLinearLayout *topLayout = new QGraphicsLinearLayout(Qt::Vertical); + + if (topLayout) + { + //topLayout->addStretch(5); + + mResultEdit = new HbLineEdit; + HbLabel* label = new HbLabel("Result:"); + if (mResultEdit && label) + { + topLayout->addItem(label); + mResultEdit->setMaxRows(5); + topLayout->addItem(mResultEdit); + } + + mErrorCodeEdit = new HbLineEdit; + label = new HbLabel("Error code:"); + if (mErrorCodeEdit && label) + { + topLayout->addItem(label); + topLayout->addItem(mErrorCodeEdit); + } + + mErrorEdit = new HbLineEdit; + label = new HbLabel("Error description:"); + if (mErrorEdit && label) + { + topLayout->addItem(label); + mErrorEdit->setMaxRows(5); + topLayout->addItem(mErrorEdit); + } + + layout->addItem(topLayout); + //layout->setStretchFactor(topLayout, 5); + } + + QGraphicsLinearLayout *bottomLayout = new QGraphicsLinearLayout(Qt::Vertical); + + if (bottomLayout) + { + //bottomLayout->addStretch(); +/* + HbPushButton* button = new HbPushButton("Fetch video OLD IF OLD S"); + if (button) + { + connect(button, SIGNAL(clicked()), this, SLOT(fetchVideoDeprecatedOldService())); + bottomLayout->addItem(button); + } +*/ + HbPushButton* button = new HbPushButton("Fetch video OLD IF NEW S"); + if (button) + { + connect(button, SIGNAL(clicked()), this, SLOT(fetchVideoDeprecatedNewService())); + bottomLayout->addItem(button); + } + + button = new HbPushButton("Fetch video NEW IF NEW S"); + if (button) + { + connect(button, SIGNAL(clicked()), this, SLOT(fetchVideo())); + bottomLayout->addItem(button); + } + +/* + button = new HbPushButton("Browse \"Captured\" videos OLD IF OLD S"); + if (button) + { + connect(button, SIGNAL(clicked()), this, SLOT(browseCapturedVideosDeprecatedOldService())); + bottomLayout->addItem(button); + } +*/ + button = new HbPushButton("Browse \"Captured\" videos OLD IF NEW S"); + if (button) + { + connect(button, SIGNAL(clicked()), this, SLOT(browseCapturedVideosDeprecatedNewService())); + bottomLayout->addItem(button); + } + + + button = new HbPushButton("Browse \"Captured\" videos NEW IF"); + if (button) + { + connect(button, SIGNAL(clicked()), this, SLOT(browseCapturedVideos())); + bottomLayout->addItem(button); + } + + layout->addItem(bottomLayout); + } + + setLayout(layout); // Takes ownership of layout + } +} + + +void VideoServicesTestAppView::fetchVideo() +{ + qDebug() << "VideoServicesTestAppView::fetchVideo START"; + + mResultEdit->setText(""); + mErrorEdit->setText(""); + mErrorCodeEdit->setText(""); + + delete mReq; + mReq = 0; + mReq = mAppMgr.create(XQI_VIDEO_FETCH, "fetch()", true); + + qDebug() << "VideoServicesTestAppView::fetchVideo: mReq=" << mReq; + + if (!mReq) + { + mErrorEdit->setText("Failed to create REQ"); + return; + } + else + { + connect(mReq, SIGNAL(requestOk(const QVariant&)), SLOT(handleOk(const QVariant&))); + connect(mReq, SIGNAL(requestError(int,const QString&)), SLOT(handleError(int,const QString&))); + } + + // Set arguments for request (application title) + XQRequestInfo info; + info.setInfo("WindowTitle", ""); + mReq->setInfo(info); + + // Make the request + if (!mReq->send()) + { + mErrorEdit->setText("Failed to send REQ"); + qDebug() << "VideoServicesTestAppView::fetchVideo: XQAiwRequest::send returned false"; + } + + qDebug() << "VideoServicesTestAppView::fetchVideo END"; +} + + +void VideoServicesTestAppView::browseCapturedVideos() +{ + qDebug() << "VideoServicesTestAppView::browseCapturedVideos START"; + + mResultEdit->setText(""); + mErrorEdit->setText(""); + mErrorCodeEdit->setText(""); + + delete mReq; + mReq = 0; + + mReq = mAppMgr.create("com.nokia.symbian.IVideoBrowse", "browseVideos(int,int)", true); + + qDebug() << "VideoServicesTestAppView::browseCapturedVideos: mReq=" << mReq; + + if (!mReq) + { + mErrorEdit->setText("Failed to create REQ"); + return; + } + else + { + connect(mReq, SIGNAL(requestOk(QVariant)), SLOT(handleOk(QVariant))); + connect(mReq, SIGNAL(requestError(int,QString)), SLOT(handleError(int,QString))); + } + + // - title + XQRequestInfo info; + info.setInfo("WindowTitle", ""); + mReq->setInfo(info); + + HbInputDialog *dialog = new HbInputDialog(); + dialog->setAttribute(Qt::WA_DeleteOnClose); + dialog->setAdditionalRowVisible(true); + dialog->setInputMode(HbInputDialog::IntInput, 0); + dialog->setInputMode(HbInputDialog::IntInput, 1); + dialog->setPromptText("Enter category", 0); + dialog->setPromptText("Enter sort role", 1); + dialog->setValue(3, 0); + dialog->setValue(0, 1); + dialog->open(this, SLOT(browseCapturedVideosFinished(HbAction *))); + + qDebug() << "VideoServicesTestAppView::browseCapturedVideos END"; +} + +void VideoServicesTestAppView::browseCapturedVideosFinished(HbAction *action) +{ + HbInputDialog *dialog = static_cast(sender()); + + int category = dialog->value(0).toInt(); + int sortRole = dialog->value(1).toInt(); + + if(dialog->actions().first() == action) + { + // set arguments + QList args; + args.append(QVariant(category)); + args.append(QVariant(sortRole)); + mReq->setArguments(args); + + // Make the request + if (!mReq->send()) + { + mErrorEdit->setText("Failed to send REQ"); + qDebug() << "VideoServicesTestAppView::browseCapturedVideosFinished: XQAiwRequest::send returned false"; + } + } +} + +void VideoServicesTestAppView::fetchVideoDeprecatedOldService() +{ + qDebug() << "VideoServicesTestAppView::fetchVideo START"; + + mResultEdit->setText(""); + mErrorEdit->setText(""); + mErrorCodeEdit->setText(""); + + delete mReq; + mReq = 0; + mReq = mAppMgr.create("com.nokia.Videos", "IVideoFetch", "fetch(QString)", true); + + qDebug() << "VideoServicesTestAppView::fetchVideo: mReq=" << mReq; + + if (!mReq) + { + mErrorEdit->setText("Failed to create REQ"); + return; + } + else + { + connect(mReq, SIGNAL(requestOk(const QVariant&)), SLOT(handleOk(const QVariant&))); + connect(mReq, SIGNAL(requestError(int,const QString&)), SLOT(handleError(int,const QString&))); + } + + // Set arguments for request (application title) + QList args; + args << QVariant(QString("")); + mReq->setArguments(args); + + // Make the request + if (!mReq->send()) + { + mErrorEdit->setText("Failed to send REQ"); + qDebug() << "VideoServicesTestAppView::fetchVideo: XQAiwRequest::send returned false"; + } + + qDebug() << "VideoServicesTestAppView::fetchVideo END"; +} + +void VideoServicesTestAppView::fetchVideoDeprecatedNewService() +{ + qDebug() << "VideoServicesTestAppView::fetchVideo START"; + + mResultEdit->setText(""); + mErrorEdit->setText(""); + mErrorCodeEdit->setText(""); + + delete mReq; + mReq = 0; + mReq = mAppMgr.create("videoplayer", "IVideoFetch", "fetch(QString)", true); + + qDebug() << "VideoServicesTestAppView::fetchVideo: mReq=" << mReq; + + if (!mReq) + { + mErrorEdit->setText("Failed to create REQ"); + return; + } + else + { + connect(mReq, SIGNAL(requestOk(const QVariant&)), SLOT(handleOk(const QVariant&))); + connect(mReq, SIGNAL(requestError(int,const QString&)), SLOT(handleError(int,const QString&))); + } + + // Set arguments for request (application title) + QList args; + args << QVariant(QString("")); + mReq->setArguments(args); + + // Make the request + if (!mReq->send()) + { + mErrorEdit->setText("Failed to send REQ"); + qDebug() << "VideoServicesTestAppView::fetchVideo: XQAiwRequest::send returned false"; + } + + qDebug() << "VideoServicesTestAppView::fetchVideo END"; +} + + +void VideoServicesTestAppView::browseCapturedVideosDeprecatedOldService() +{ + qDebug() << "VideoServicesTestAppView::browseCapturedVideos START"; + + mResultEdit->setText(""); + mErrorEdit->setText(""); + mErrorCodeEdit->setText(""); + + delete mReq; + mReq = 0; + mReq = mAppMgr.create("com.nokia.Videos", "IVideoBrowse", "browseVideos(QString,int,int)", true); + + qDebug() << "VideoServicesTestAppView::browseCapturedVideos: mReq=" << mReq; + + if (!mReq) + { + mErrorEdit->setText("Failed to create REQ"); + return; + } + else + { + connect(mReq, SIGNAL(requestOk(QVariant)), SLOT(handleOk(QVariant))); + connect(mReq, SIGNAL(requestError(int,QString)), SLOT(handleError(int,QString))); + } + + HbInputDialog *dialog = new HbInputDialog(); + dialog->setAttribute(Qt::WA_DeleteOnClose); + dialog->setAdditionalRowVisible(true); + dialog->setInputMode(HbInputDialog::IntInput, 0); + dialog->setInputMode(HbInputDialog::IntInput, 1); + dialog->setPromptText("Enter category", 0); + dialog->setPromptText("Enter sort role", 1); + dialog->setValue(3, 0); + dialog->setValue(0, 1); + dialog->open(this, SLOT(browseCapturedVideosDeprecatedOldServiceFinished(HbAction *))); + + qDebug() << "VideoServicesTestAppView::browseCapturedVideos END"; +} + +void VideoServicesTestAppView::browseCapturedVideosDeprecatedOldServiceFinished(HbAction *action) +{ + HbInputDialog *dialog = static_cast(sender()); + + const QString title = ""; + + int category = dialog->value(0).toInt(); + int sortRole = dialog->value(1).toInt(); + + if(dialog->actions().first() == action) + { + // set arguments + QList args; + args.append(title); + args.append(QVariant(category)); + args.append(QVariant(sortRole)); + mReq->setArguments(args); + + // Make the request + if (!mReq->send()) + { + mErrorEdit->setText("Failed to send REQ"); + qDebug() << "VideoServicesTestAppView::browseCapturedVideosFinished: XQAiwRequest::send returned false"; + } + } +} + +void VideoServicesTestAppView::browseCapturedVideosDeprecatedNewService() +{ + qDebug() << "VideoServicesTestAppView::browseCapturedVideos START"; + + mResultEdit->setText(""); + mErrorEdit->setText(""); + mErrorCodeEdit->setText(""); + + delete mReq; + mReq = 0; + mReq = mAppMgr.create("videoplayer", "IVideoBrowse", "browseVideos(QString,int,int)", true); + + qDebug() << "VideoServicesTestAppView::browseCapturedVideos: mReq=" << mReq; + + if (!mReq) + { + mErrorEdit->setText("Failed to create REQ"); + return; + } + else + { + connect(mReq, SIGNAL(requestOk(QVariant)), SLOT(handleOk(QVariant))); + connect(mReq, SIGNAL(requestError(int,QString)), SLOT(handleError(int,QString))); + } + + HbInputDialog *dialog = new HbInputDialog(); + dialog->setAttribute(Qt::WA_DeleteOnClose); + dialog->setAdditionalRowVisible(true); + dialog->setInputMode(HbInputDialog::IntInput, 0); + dialog->setInputMode(HbInputDialog::IntInput, 1); + dialog->setPromptText("Enter category", 0); + dialog->setPromptText("Enter sort role", 1); + dialog->setValue(3, 0); + dialog->setValue(0, 1); + dialog->open(this, SLOT(browseCapturedVideosDeprecatedNewServiceFinished(HbAction *))); + + qDebug() << "VideoServicesTestAppView::browseCapturedVideos END"; +} + +void VideoServicesTestAppView::browseCapturedVideosDeprecatedNewServiceFinished(HbAction *action) +{ + HbInputDialog *dialog = static_cast(sender()); + + const QString title = ""; + + int category = dialog->value(0).toInt(); + int sortRole = dialog->value(1).toInt(); + + if(dialog->actions().first() == action) + { + // set arguments + QList args; + args.append(title); + args.append(QVariant(category)); + args.append(QVariant(sortRole)); + mReq->setArguments(args); + + // Make the request + if (!mReq->send()) + { + mErrorEdit->setText("Failed to send REQ"); + qDebug() << "VideoServicesTestAppView::browseCapturedVideosFinished: XQAiwRequest::send returned false"; + } + } +} + +// end of file diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/tsrc/videoservicestestapp/videoservicestestapp.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/tsrc/videoservicestestapp/videoservicestestapp.pro Wed Jun 23 17:22:59 2010 +0100 @@ -0,0 +1,34 @@ +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "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: +# +TEMPLATE = app +TARGET = videoservicestestapp + +CONFIG += hb +LIBS += -lxqservice -lxqserviceutil + +HEADERS += inc/videoservicestestappview.h + +SOURCES += src/videoservicestestappview.cpp \ + src/main.cpp + + +symbian { + TARGET.UID2 = 0x100039CE + TARGET.UID3 = 0x2002C341 + TARGET.CAPABILITY = ALL -TCB + INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE + + BLD_INF_RULES.prj_exports += "rom/videoservicestestapp.iby CORE_APP_LAYER_IBY_EXPORT_PATH(videoservicestestapp.iby)" +} diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionview/data/images/qtg_mono_video_all.svg --- a/videocollection/videocollectionview/data/images/qtg_mono_video_all.svg Tue May 18 11:57:40 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ - - - -]> - - - - - - diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionview/data/videocollectionview.qrc --- a/videocollection/videocollectionview/data/videocollectionview.qrc Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionview/data/videocollectionview.qrc Wed Jun 23 17:22:59 2010 +0100 @@ -3,9 +3,6 @@ collectionview.docml videolistselectiondialog.docml - - images/qtg_mono_video_all.svg - hbdialog.css diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionview/inc/videocollectionuiloader.h --- a/videocollection/videocollectionview/inc/videocollectionuiloader.h Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionview/inc/videocollectionuiloader.h Wed Jun 23 17:22:59 2010 +0100 @@ -78,24 +78,26 @@ * Returns the requested widget casted to correct type * * @param name Name of the widget + * @param loadIfNotFound Should the widget be loaded if not found in cache. * @return Pointer to the widget */ template - T* findWidget(const QString &name) + T* findWidget(const QString &name, bool loadIfNotFound = true) { - return qobject_cast(doFindWidget(name)); + return qobject_cast(doFindWidget(name, loadIfNotFound)); } /** * Returns the requested object casted to correct type * * @param name Name of the object + * @param loadIfNotFound Should the widget be loaded if not found in cache. * @return Pointer to the object */ template - T* findObject(const QString &name) + T* findObject(const QString &name, bool loadIfNotFound = true) { - return qobject_cast(doFindObject(name)); + return qobject_cast(doFindObject(name, loadIfNotFound)); } /** @@ -141,9 +143,10 @@ * Loads widget from document. * * @param name, Widget name. + * @param loadIfNotFound Should the widget be loaded if not found in cache. * @return QGraphicsWidget*. */ - QGraphicsWidget* doFindWidget(const QString &name); + QGraphicsWidget* doFindWidget(const QString &name, bool loadIfNotFound); /** * Loads object from document. @@ -151,7 +154,7 @@ * @param name, Object name. * @return QObject*. */ - QObject* doFindObject(const QString &name); + QObject* doFindObject(const QString &name, bool loadIfNotFound); /** * Adds a ui section to async loading queue. diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionview/inc/videocollectionviewutils.h --- a/videocollection/videocollectionview/inc/videocollectionviewutils.h Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionview/inc/videocollectionviewutils.h Wed Jun 23 17:22:59 2010 +0100 @@ -83,6 +83,21 @@ * Initilizes model sort values. */ static void sortModel(VideoSortFilterProxyModel *model, bool async, VideoCollectionCommon::TCollectionLevels target); + + /** + * Method saves the latest videolist widget level into activity manager db + * + * @param level type of widget + */ + static void saveWidgetLevel(VideoCollectionCommon::TCollectionLevels &level); + + /** + * Method loads the latest videolist widget level from activity manager db. + * Possible values are ELevelCategory or ELevelVideos + * + * @return VideoCollectionCommon::TCollectionLevels + */ + static VideoCollectionCommon::TCollectionLevels loadWidgetLevel(); public slots: diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionview/inc/videolistview.h --- a/videocollection/videocollectionview/inc/videolistview.h Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionview/inc/videolistview.h Wed Jun 23 17:22:59 2010 +0100 @@ -380,6 +380,11 @@ * Boolean for knowing when the model is ready. */ bool mModelReady; + + /** + * Boolean for knowing when the view is ready. + */ + bool mViewReady; /** * Hint level for the hint widget. diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionview/inc/videolistwidget.h --- a/videocollection/videocollectionview/inc/videolistwidget.h Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionview/inc/videolistwidget.h Wed Jun 23 17:22:59 2010 +0100 @@ -23,6 +23,7 @@ #include #include #include +#include "videoservices.h" #include "videocollectioncommon.h" class VideoSortFilterProxyModel; @@ -67,9 +68,13 @@ * layout and activates correct view based on the current orientation * * @param model Model for this list view. + * @param videoservices + * @param level presetted level for the widget * @return int 0 initialization ok, < 0 if fails. */ - int initialize(VideoSortFilterProxyModel &model, VideoServices* videoServices = 0); + int initialize(VideoSortFilterProxyModel &model, + VideoServices* videoServices = 0, + VideoCollectionCommon::TCollectionLevels level = VideoCollectionCommon::ELevelInvalid); /** * Method enables and displays current active view @@ -165,6 +170,12 @@ * Signaled by HbMessageBox when it's closed. */ void removeCollectionDialogFinished(HbAction *action); + + /** + * called or signaled when delayed initialization is reauired for the widget + * + */ + void doDelayedsSlot(); protected slots: @@ -174,12 +185,6 @@ * Saves current selected item's index to mCurrentIndex */ void longPressedSlot(HbAbstractViewItem *item, const QPointF &point); - - /** - * Re-implemented in case context menu is visible, the below list shoud not - * be panned. - */ - void panGesture(const QPointF &point); private slots: @@ -233,12 +238,6 @@ void playItemSlot(); /** - * slot is connected to view's doDelayeds -signal - * - */ - void doDelayedsSlot(); - - /** * Signaled when stepping back from collection in collection view * */ @@ -409,6 +408,11 @@ * ui loade object, not owned */ VideoCollectionUiLoader *mUiLoader; + + /** + * Service being provided + */ + VideoServices::TVideoService mService; }; #endif // VIDEOLISTWIDGET_H diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionview/sis/hbmyvideos_armv5_udeb.pkg --- a/videocollection/videocollectionview/sis/hbmyvideos_armv5_udeb.pkg Tue May 18 11:57:40 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -; hbmyvideos_armv5_udeb.pkg generated by qmake at Mon 4. May 16:02:32 2009 -; This file is generated by qmake and should not be modified by the user -; - -; Language -&EN - -; SIS header: name, uid, version -#{"hbmyvideos"},(0xE6c98bd2),1,0,0 - -; Localised Vendor name -%{"Nokia, Qt Software"} - -; Unique Vendor name -:"Nokia, Qt Software" - -; Dependencies -[0x101F7961],0,0,0,{"S60ProductID"} -[0x102032BE],0,0,0,{"S60ProductID"} -[0x102752AE],0,0,0,{"S60ProductID"} -[0x1028315F],0,0,0,{"S60ProductID"} -(0x2001E61C), 4, 5, 0, {"QtLibs pre-release"} - -; Executable and default resource files -"\epoc32\release\armv5\udeb\hbmyvideos.exe" - "!:\sys\bin\hbmyvideos.exe" -"\epoc32\data\z\resource\apps\hbmyvideos.rsc" - "!:\resource\apps\hbmyvideos.rsc" -"\epoc32\data\z\private\10003a3f\import\apps\hbmyvideos_reg.rsc" - "!:\private\10003a3f\import\apps\hbmyvideos_reg.rsc" diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionview/sis/hbmyvideos_armv5_udeb_withhb_wk11.pkg --- a/videocollection/videocollectionview/sis/hbmyvideos_armv5_udeb_withhb_wk11.pkg Tue May 18 11:57:40 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -; hbmyvideos_armv5_udeb.pkg generated by qmake at Wed 15. Apr 12:53:10 2009 -; This file is generated by qmake and should not be modified by the user -; - -; Language -&EN - -; SIS header: name, uid, version -#{"hbmyvideos"},(0xE47efc9b),1,0,0 - -; Localised Vendor name -%{"Nokia, Qt Software"} - -; Unique Vendor name -:"Nokia, Qt Software" - -; Dependencies -[0x101F7961],0,0,0,{"S60ProductID"} -[0x102032BE],0,0,0,{"S60ProductID"} -[0x102752AE],0,0,0,{"S60ProductID"} -[0x1028315F],0,0,0,{"S60ProductID"} -(0x2001E61C), 4, 5, 0, {"QtLibs pre-release"} - -; Executable and default resource files -"\epoc32\release\armv5\udeb\hbmyvideos.exe" - "!:\sys\bin\hbmyvideos.exe" -"\epoc32\data\z\resource\apps\hbmyvideos.rsc" - "!:\resource\apps\hbmyvideos.rsc" -"\epoc32\data\z\private\10003a3f\import\apps\hbmyvideos_reg.rsc" - "!:\private\10003a3f\import\apps\hbmyvideos_reg.rsc" -"\epoc32\release\armv5\udeb\qtnmwrapper.dll" - "!:\sys\bin\qtnmwrapper.dll" - - -;"r:\epoc32\release\armv5\udeb\HbPureNumeric.dll" - "!:\sys\bin\HbPureNumeric.dll" -;"r:\orbit\hbinputs\qmakepluginstubs\HbPureNumeric.qtplugin" - "!:\hbinputs\inputmethods\HbPureNumeric.qtplugin" -;"r:\epoc32\release\armv5\udeb\HbLatinMultitap.dll" - "!:\sys\bin\HbLatinMultitap.dll" -;"r:\orbit\hbinputs\qmakepluginstubs\HbLatinMultitap.qtplugin" - "!:\hbinputs\inputmethods\HbLatinMultitap.qtplugin" -;"r:\epoc32\release\armv5\udeb\touchinput.dll" - "!:\sys\bin\touchinput.dll" -"r:\orbit\hbinputs\qmakepluginstubs\touchinput.qtplugin" - "!:\hbinputs\inputmethods\touchinput.qtplugin" -"r:\orbit\hbinputs\resources\accent.png" - "!:\hbinputs\resources\accent.png" -"r:\orbit\hbinputs\resources\background.png" - "!:\hbinputs\resources\background.png" -"r:\orbit\hbinputs\resources\bullet.png" - "!:\hbinputs\resources\bullet.png" -"r:\orbit\hbinputs\resources\close_handle.png" - "!:\hbinputs\resources\close_handle.png" -"r:\orbit\hbinputs\resources\close_handle_background.png" - "!:\hbinputs\resources\close_handle_background.png" -"r:\orbit\hbinputs\resources\keypad_landscape.png" - "!:\hbinputs\resources\keypad_landscape.png" -"r:\orbit\hbinputs\resources\keypad_portrait.png" - "!:\hbinputs\resources\keypad_portrait.png" -"r:\orbit\hbinputs\resources\red_button.png" - "!:\hbinputs\resources\red_button.png" -"r:\orbit\hbinputs\resources\red_button_mask.png" - "!:\hbinputs\resources\red_button_mask.png" -"r:\orbit\hbinputs\resources\sym.png" - "!:\hbinputs\resources\sym.png" -"r:\orbit\hbinputs\resources\test_multimode_lower.png" - "!:\hbinputs\resources\test_multimode_lower.png" -"r:\orbit\hbinputs\resources\test_multimode_text.png" - "!:\hbinputs\resources\test_multimode_text.png" -"r:\orbit\hbinputs\resources\test_multimode_upper.png" - "!:\hbinputs\resources\test_multimode_upper.png" -"r:\orbit\hbinputs\resources\test_numbermode.png" - "!:\hbinputs\resources\test_numbermode.png" -"r:\orbit\hbinputs\resources\test_pinyin.png" - "!:\hbinputs\resources\test_pinyin.png" -"r:\orbit\hbinputs\resources\test_predictivemode_lower.png" - "!:\hbinputs\resources\test_predictivemode_lower.png" -"r:\orbit\hbinputs\resources\test_predictivemode_text.png" - "!:\hbinputs\resources\test_predictivemode_text.png" -"r:\orbit\hbinputs\resources\test_predictivemode_upper.png" - "!:\hbinputs\resources\test_predictivemode_upper.png" -"r:\orbit\hbinputs\resources\test_stroke.png" - "!:\hbinputs\resources\test_stroke.png" -"r:\orbit\hbinputs\resources\test_virtual_return.png" - "!:\hbinputs\resources\test_virtual_return.png" -"r:\orbit\hbinputs\resources\test_virtual_return_mask.png" - "!:\hbinputs\resources\test_virtual_return_mask.png" -"r:\orbit\hbinputs\resources\test_virtual_shift.png" - "!:\hbinputs\resources\test_virtual_shift.png" -"r:\orbit\hbinputs\resources\test_virtual_shift_mask.png" - "!:\hbinputs\resources\test_virtual_shift_mask.png" -"r:\orbit\hbinputs\resources\vkb_top.png" - "!:\hbinputs\resources\vkb_top.png" -"r:\orbit\hbinputs\resources\rocker_normal.svg" - "!:\hbinputs\resources\rocker_normal.svg" -"r:\orbit\hbinputs\resources\rocker_selection.svg" - "!:\hbinputs\resources\rocker_selection.svg" -"r:\epoc32\release\armv5\udeb\hb.dll" - "!:\sys\bin\hb.dll" -"r:\epoc32\release\armv5\udeb\hbinput.dll" - "!:\sys\bin\hbinput.dll" -;"r:\epoc32\release\armv5\udeb\hbviw.dll" - "!:\sys\bin\hbviw.dll" -;"r:\epoc32\release\armv5\udeb\hbhiw.dll" - "!:\sys\bin\hbhiw.dll" diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionview/sis/hbmyvideos_armv5_udeb_withhb_wk11.sisx Binary file videocollection/videocollectionview/sis/hbmyvideos_armv5_udeb_withhb_wk11.sisx has changed diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionview/sis/hbmyvideos_armv5_urel.pkg --- a/videocollection/videocollectionview/sis/hbmyvideos_armv5_urel.pkg Tue May 18 11:57:40 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -; hbmyvideos_armv5_urel.pkg generated by qmake at Mon 4. May 16:02:32 2009 -; This file is generated by qmake and should not be modified by the user -; - -; Language -&EN - -; SIS header: name, uid, version -#{"hbmyvideos"},(0xE6c98bd2),1,0,0 - -; Localised Vendor name -%{"Nokia, Qt Software"} - -; Unique Vendor name -:"Nokia, Qt Software" - -; Dependencies -[0x101F7961],0,0,0,{"S60ProductID"} -[0x102032BE],0,0,0,{"S60ProductID"} -[0x102752AE],0,0,0,{"S60ProductID"} -[0x1028315F],0,0,0,{"S60ProductID"} -(0x2001E61C), 4, 5, 0, {"QtLibs pre-release"} - -; Executable and default resource files -"\epoc32\release\armv5\urel\hbmyvideos.exe" - "!:\sys\bin\hbmyvideos.exe" -"\epoc32\data\z\resource\apps\hbmyvideos.rsc" - "!:\resource\apps\hbmyvideos.rsc" -"\epoc32\data\z\private\10003a3f\import\apps\hbmyvideos_reg.rsc" - "!:\private\10003a3f\import\apps\hbmyvideos_reg.rsc" diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionview/sis/hbmyvideos_armv5_urel.sisx Binary file videocollection/videocollectionview/sis/hbmyvideos_armv5_urel.sisx has changed diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionview/sis/hbmyvideos_gcce_udeb.pkg --- a/videocollection/videocollectionview/sis/hbmyvideos_gcce_udeb.pkg Tue May 18 11:57:40 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -; hbmyvideos_gcce_udeb.pkg generated by qmake at Mon 4. May 16:02:32 2009 -; This file is generated by qmake and should not be modified by the user -; - -; Language -&EN - -; SIS header: name, uid, version -#{"hbmyvideos"},(0xE6c98bd2),1,0,0 - -; Localised Vendor name -%{"Nokia, Qt Software"} - -; Unique Vendor name -:"Nokia, Qt Software" - -; Dependencies -[0x101F7961],0,0,0,{"S60ProductID"} -[0x102032BE],0,0,0,{"S60ProductID"} -[0x102752AE],0,0,0,{"S60ProductID"} -[0x1028315F],0,0,0,{"S60ProductID"} -(0x2001E61C), 4, 5, 0, {"QtLibs pre-release"} - -; Executable and default resource files -"\epoc32\release\gcce\udeb\hbmyvideos.exe" - "!:\sys\bin\hbmyvideos.exe" -"\epoc32\data\z\resource\apps\hbmyvideos.rsc" - "!:\resource\apps\hbmyvideos.rsc" -"\epoc32\data\z\private\10003a3f\import\apps\hbmyvideos_reg.rsc" - "!:\private\10003a3f\import\apps\hbmyvideos_reg.rsc" diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionview/sis/hbmyvideos_gcce_urel.pkg --- a/videocollection/videocollectionview/sis/hbmyvideos_gcce_urel.pkg Tue May 18 11:57:40 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -; hbmyvideos_gcce_urel.pkg generated by qmake at Mon 4. May 16:02:32 2009 -; This file is generated by qmake and should not be modified by the user -; - -; Language -&EN - -; SIS header: name, uid, version -#{"hbmyvideos"},(0xE6c98bd2),1,0,0 - -; Localised Vendor name -%{"Nokia, Qt Software"} - -; Unique Vendor name -:"Nokia, Qt Software" - -; Dependencies -[0x101F7961],0,0,0,{"S60ProductID"} -[0x102032BE],0,0,0,{"S60ProductID"} -[0x102752AE],0,0,0,{"S60ProductID"} -[0x1028315F],0,0,0,{"S60ProductID"} -(0x2001E61C), 4, 5, 0, {"QtLibs pre-release"} - -; Executable and default resource files -"\epoc32\release\gcce\urel\hbmyvideos.exe" - "!:\sys\bin\hbmyvideos.exe" -"\epoc32\data\z\resource\apps\hbmyvideos.rsc" - "!:\resource\apps\hbmyvideos.rsc" -"\epoc32\data\z\private\10003a3f\import\apps\hbmyvideos_reg.rsc" - "!:\private\10003a3f\import\apps\hbmyvideos_reg.rsc" diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionview/src/videocollectionuiloader.cpp --- a/videocollection/videocollectionview/src/videocollectionuiloader.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionview/src/videocollectionuiloader.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 21 % +// Version : %version: 22 % // INCLUDE FILES #include @@ -199,7 +199,7 @@ // doFindWidget // --------------------------------------------------------------------------- // -QGraphicsWidget* VideoCollectionUiLoader::doFindWidget(const QString &name) +QGraphicsWidget* VideoCollectionUiLoader::doFindWidget(const QString &name, bool loadIfNotFound) { FUNC_LOG; QGraphicsWidget *widget = 0; @@ -211,7 +211,7 @@ } // 2. load from document and initialize - else + else if (loadIfNotFound) { // find object from queue int index = indexInQueue(name); @@ -238,7 +238,7 @@ // doFindObject // --------------------------------------------------------------------------- // -QObject* VideoCollectionUiLoader::doFindObject(const QString &name) +QObject* VideoCollectionUiLoader::doFindObject(const QString &name, bool loadIfNotFound) { FUNC_LOG; QObject *object = 0; @@ -250,7 +250,7 @@ } // 2. load from document and initialize - else + else if (loadIfNotFound) { // find object from queue int index = indexInQueue(name); @@ -373,17 +373,15 @@ wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos); if(model) { - // open and sort model - model->open(VideoCollectionCommon::ELevelVideos); - VideoCollectionViewUtils::sortModel(model, true, VideoCollectionCommon::ELevelVideos); - + VideoCollectionViewUtils::sortModel(model, true, VideoCollectionCommon::ELevelVideos); + // init widget VideoServices *videoServices = 0; if (mIsService) { videoServices = VideoServices::instance(); } - videoList->initialize(*model, videoServices); + videoList->initialize(*model, videoServices, VideoCollectionCommon::ELevelVideos); } } } @@ -393,9 +391,8 @@ VideoCollectionCommon::EModelTypeCollections); if (model) { - model->open(VideoCollectionCommon::ELevelCategory); VideoCollectionViewUtils::sortModel(model, true, VideoCollectionCommon::ELevelCategory); - + // initialize video collection widget VideoListWidget *videoList = qobject_cast(object); @@ -407,7 +404,7 @@ { videoServices = VideoServices::instance(); } - videoList->initialize(*model, videoServices); + videoList->initialize(*model, videoServices, VideoCollectionCommon::ELevelCategory); } } } @@ -417,6 +414,10 @@ VideoCollectionCommon::EModelTypeCollectionContent); if (model) { + // collection content contains always a list of videos so we use + // ELevelVideos as target for sorting + VideoCollectionViewUtils::sortModel(model, false, VideoCollectionCommon::ELevelVideos); + VideoListWidget *videoList = qobject_cast(object); if (videoList) { @@ -426,6 +427,7 @@ { videoServices = VideoServices::instance(); } + // cannot set level at this point yet: it can be either default or user defined collection videoList->initialize(*model, videoServices); } } diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionview/src/videocollectionviewutils.cpp --- a/videocollection/videocollectionview/src/videocollectionviewutils.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionview/src/videocollectionviewutils.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,9 +15,11 @@ * */ -// Version : %version: 37 % +// Version : %version: 39 % // INCLUDE FILES +#include +#include #include #include #include @@ -32,6 +34,11 @@ #include "videosortfilterproxymodel.h" #include "videocollectiontrace.h" +// Object names. +const char* const VIEW_UTILS_OBJECT_NAME_STATUS_MSG = "vc:ViewUtilsStatusMessage"; +const char* const VIEW_UTILS_OBJECT_NAME_MESSAGE_BOX_WARNING = "vc:ViewUtilsMessageBoxWarning"; + +// Cenrep constants. const int KVideoCollectionViewCenrepUid(0x2002BC63); const int KVideoCollectionViewCenrepServiceIconKey(0x2); const int KVideoCollectionViewCenrepServiceIconPressedKey(0x3); @@ -40,15 +47,21 @@ const int KVideoCollectionViewCenrepCollectionsSortingRoleKey(0x7); const int KVideoCollectionViewCenrepCollectionsSortingOrderKey(0x8); +const int KAddToCollectionDataCount(2); +const int KAddToCollectionCountIndex(0); +const int KAddToCollectionNameIndex(1); + +static const char* ACTIVITY_VIDEOS_MAINVIEW = "VideosMainView"; + // --------------------------------------------------------------------------- // instance // --------------------------------------------------------------------------- // VideoCollectionViewUtils& VideoCollectionViewUtils::instance() { - FUNC_LOG; - static VideoCollectionViewUtils _popupInstance; - return _popupInstance; + FUNC_LOG; + static VideoCollectionViewUtils _popupInstance; + return _popupInstance; } // --------------------------------------------------------------------------- @@ -62,7 +75,6 @@ mCollectionsSortOrder(Qt::AscendingOrder) { FUNC_LOG; - } // --------------------------------------------------------------------------- @@ -72,7 +84,6 @@ VideoCollectionViewUtils::~VideoCollectionViewUtils() { FUNC_LOG; - } // --------------------------------------------------------------------------- @@ -304,6 +315,53 @@ } // --------------------------------------------------------------------------- +// saveWidgetLevel +// --------------------------------------------------------------------------- +// +void VideoCollectionViewUtils::saveWidgetLevel(VideoCollectionCommon::TCollectionLevels &level) +{ + FUNC_LOG; + HbActivityManager* activityManager = qobject_cast(qApp)->activityManager(); + if(!activityManager) + { + return; + } + // clean up any previous versions of this activity from the activity manager. + activityManager->removeActivity(ACTIVITY_VIDEOS_MAINVIEW); + + QVariant data = int(level); + + activityManager->addActivity(ACTIVITY_VIDEOS_MAINVIEW, data, QVariantHash()); + + +} + +// --------------------------------------------------------------------------- +// loadWidgetLevel +// --------------------------------------------------------------------------- +// +VideoCollectionCommon::TCollectionLevels VideoCollectionViewUtils::loadWidgetLevel() +{ + FUNC_LOG; + // all videos view is the default value to be returned in case nothing can be read + // from the activity manager + VideoCollectionCommon::TCollectionLevels level(VideoCollectionCommon::ELevelVideos); + + HbActivityManager* activityManager = qobject_cast(qApp)->activityManager(); + if(!activityManager) + { + return level; + } + QVariant data =activityManager->activityData(ACTIVITY_VIDEOS_MAINVIEW); + if(data.toInt() == VideoCollectionCommon::ELevelCategory) + { + level = VideoCollectionCommon::ELevelCategory; + } + return level; + +} + +// --------------------------------------------------------------------------- // showStatusMsgSlot // --------------------------------------------------------------------------- // @@ -335,11 +393,16 @@ case VideoCollectionCommon::statusMultiRemoveFail: msg = hbTrId("txt_videos_info_unable_to_remove_some_collections"); break; - case VideoCollectionCommon::statusVideosAddedToCollection: - format = hbTrId("txt_videos_dpopinfo_videos_added_to_1"); - if(additional.isValid()) + case VideoCollectionCommon::statusVideosAddedToCollection: + // videos added to collection - status should containg both count and collection name + if(additional.isValid() && additional.toList().count() == KAddToCollectionDataCount) { - msg = format.arg(additional.toString()); + int count = additional.toList().at(KAddToCollectionCountIndex).toInt(); + QString name = additional.toList().at(KAddToCollectionNameIndex).toString(); + if(count && name.length()) + { + msg = hbTrId("txt_videos_dpopinfo_ln_videos_added_to_1", count).arg(name); + } } error = false; break; @@ -347,10 +410,9 @@ msg = hbTrId("txt_videos_info_all_videos_already_added_to_this_c"); break; case VideoCollectionCommon::statusDeleteInProgress: - format = hbTrId("txt_videos_dpopinfo_ln_videos_are_being_deleted"); if(additional.isValid()) { - msg = format.arg(additional.toString()); + msg = hbTrId("txt_videos_dpopinfo_ln_videos_are_being_deleted", additional.toInt()); } error = false; break; @@ -362,7 +424,10 @@ { if(error) { - HbMessageBox::warning(msg); + HbMessageBox *messageBox = new HbMessageBox(msg, HbMessageBox::MessageTypeWarning); + messageBox->setAttribute(Qt::WA_DeleteOnClose); + messageBox->setObjectName(VIEW_UTILS_OBJECT_NAME_MESSAGE_BOX_WARNING); + messageBox->show(); } else { @@ -371,8 +436,10 @@ // only title can be two rows for HbNotificationDialog infoNote->setTitleTextWrapping(Hb::TextWordWrap); infoNote->setTitle(msg); + infoNote->setObjectName(VIEW_UTILS_OBJECT_NAME_STATUS_MSG); infoNote->show(); } } } +// End of file diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionview/src/videolistselectiondialog.cpp --- a/videocollection/videocollectionview/src/videolistselectiondialog.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionview/src/videolistselectiondialog.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 25 % +// Version : %version: 29 % // INCLUDE FILES #include @@ -37,6 +37,12 @@ #include "videocollectionclient.h" #include "videocollectiontrace.h" +// Object names. +const char* const SELECTION_DIALOG_OBJECT_NAME_LIST_WIDGET = "vc:SelectionDialogListWidget"; +const char* const SELECTION_DIALOG_OBJECT_NAME_NEW_COLLECTION = "vc:SelectionDialogNewCollection"; +const char* const SELECTION_DIALOG_OBJECT_NAME_BUTTON_OK = "vc:SelectionDialogButtonOk"; +const char* const SELECTION_DIALOG_OBJECT_NAME_BUTTON_CANCEL = "vc:SelectionDialogButtonCancel"; + /** * global qHash function required fo creating hash values for TMPXItemId -keys */ @@ -91,6 +97,7 @@ } // disable list related animations to make dialog faster mListWidget->setEnabledAnimations(HbAbstractItemView::None); + mListWidget->setObjectName(SELECTION_DIALOG_OBJECT_NAME_LIST_WIDGET); } } @@ -175,6 +182,7 @@ if(!mListWidget) { mListWidget = new VideoListWidget(mUiLoader); + mListWidget->setObjectName(SELECTION_DIALOG_OBJECT_NAME_LIST_WIDGET); if(mListWidget->initialize(*mModel) < 0) { ERROR(-1, "VideoListSelectionDialog::initDialog() failed to setup VideoListWidget."); @@ -217,11 +225,13 @@ if(!mPrimaryAction) { mPrimaryAction = new HbAction(hbTrId("txt_common_button_ok")); + mPrimaryAction->setObjectName(SELECTION_DIALOG_OBJECT_NAME_BUTTON_OK); addAction(mPrimaryAction); } if(!mSecondaryAction) { mSecondaryAction = new HbAction(hbTrId("txt_common_button_cancel")); + mSecondaryAction->setObjectName(SELECTION_DIALOG_OBJECT_NAME_BUTTON_CANCEL); addAction(mSecondaryAction); } @@ -277,10 +287,8 @@ mCheckboxContainer->setVisible(false); mListWidget->setSelectionMode(-1); mListWidget->activate(VideoCollectionCommon::ELevelCategory); - // need to set primaryaction disabled here in order for it - // get correctly updated at modelReady(), where it will be enabled - // if state would be same, no update will happen - mPrimaryAction->setDisabled(true); + // New collection button is always enabled for collection selection. + mPrimaryAction->setDisabled(false); } else { @@ -290,10 +298,8 @@ mCheckboxContainer->setVisible(true); mItemCount->setPlainText(tr("0/%1").arg(mModel->rowCount())); mCheckBox->setChecked(false); - // need to set primaryaction enabled here in order for it - // get correctly updated at modelReady(), where it will be disabled - // if state would be same, no update will happen - mPrimaryAction->setDisabled(false); + // Add button will be enabled when videos are selected from the list. + mPrimaryAction->setDisabled(true); } mHeading->setPlainText(headingTxt); // sort to make sure dialog has correctly filtered content @@ -345,16 +351,18 @@ return; } QString albumName(""); - if( mTypeOfSelection == ESelectCollection ) + if(mTypeOfSelection == ESelectCollection) { mTypeOfSelection = EAddToCollection; - if( mSelectedAlbumId == TMPXItemId::InvalidId()) + if(mSelectedAlbumId == TMPXItemId::InvalidId()) { QString label(hbTrId("txt_videos_title_enter_name")); HbInputDialog *dialog = new HbInputDialog(); + dialog->setObjectName(SELECTION_DIALOG_OBJECT_NAME_NEW_COLLECTION); dialog->setAttribute(Qt::WA_DeleteOnClose); - dialog->getText(label, this, SLOT(newAlbumNameDialogFinished(HbAction *)), - hbTrId("txt_videos_dialog_entry_new_collection")); + dialog->setPromptText(label); + dialog->setValue(hbTrId("txt_videos_dialog_entry_new_collection")); + dialog->open(this, SLOT(newAlbumNameDialogFinished(HbAction *))); } else { @@ -408,7 +416,10 @@ { albumName = getSelectedName(); } - QVariant data = albumName; + QList dataList; + dataList.append(QVariant(mSelectedVideos.count())); + dataList.append(QVariant(albumName)); + QVariant data = dataList; VideoCollectionViewUtils::instance().showStatusMsgSlot( VideoCollectionCommon::statusVideosAddedToCollection, data); @@ -522,7 +533,6 @@ FUNC_LOG; if(mTypeOfSelection == ESelectCollection) { - mPrimaryAction->setDisabled(false); if(!mModel->rowCount()) { // in case there are no user defined albums, @@ -532,10 +542,6 @@ return; } } - if(mTypeOfSelection != ESelectCollection) - { - mPrimaryAction->setDisabled(true); - } updateCounterSlot(); } @@ -676,7 +682,7 @@ name = model->data(index, VideoCollectionCommon::KeyTitle).toString(); } } - return name; } +// End of file diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionview/src/videolistview.cpp --- a/videocollection/videocollectionview/src/videolistview.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionview/src/videolistview.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 101 % +// Version : %version: 108 % // INCLUDE FILES #include @@ -47,6 +47,10 @@ #include "mpxhbvideocommondefs.h" #include "videocollectiontrace.h" +// Object names. +const char* const LIST_VIEW_OBJECT_NAME_CREATE_COLLECTION = "vc::ListViewInputDialogCreateCollection"; +const char* const LIST_VIEW_OBJECT_NAME_OPTIONS_MENU = "vc::ListViewOptionsMenu"; + // --------------------------------------------------------------------------- // Constructor // --------------------------------------------------------------------------- @@ -58,6 +62,7 @@ , mUiLoader( uiLoader ) , mIsService( false ) , mModelReady( false ) + , mViewReady( false ) , mHintLevel( VideoHintWidget::AllVideos ) , mVideoServices( 0 ) , mCurrentList( 0 ) @@ -118,14 +123,30 @@ connect(mVideoServices, SIGNAL(titleReady(const QString&)), this, SLOT(titleReadySlot(const QString&))); } } + QList params; + int videoListPhase = VideoCollectionUiLoaderParam::LoadPhasePrimary; + int collectionListPhase = VideoCollectionUiLoaderParam::LoadPhaseSecondary; + if(VideoCollectionViewUtils::loadWidgetLevel() == VideoCollectionCommon::ELevelCategory) + { + videoListPhase = VideoCollectionUiLoaderParam::LoadPhaseSecondary; + collectionListPhase = VideoCollectionUiLoaderParam::LoadPhasePrimary; + + + } // start loading objects and widgets - QList params; params.append(VideoCollectionUiLoaderParam( - DOCML_NAME_VC_VIDEOLISTWIDGET, - DOCML_VIDEOCOLLECTIONVIEW_FILE, - true, - VideoCollectionUiLoaderParam::LoadPhasePrimary)); + DOCML_NAME_VC_VIDEOLISTWIDGET, + DOCML_VIDEOCOLLECTIONVIEW_FILE, + true, + videoListPhase)); + params.append(VideoCollectionUiLoaderParam( + DOCML_NAME_VC_COLLECTIONWIDGET, + DOCML_VIDEOCOLLECTIONVIEW_FILE, + DOCML_VIDEOCOLLECTIONVIEW_SECTION_LIST, + true, + collectionListPhase)); + params.append(VideoCollectionUiLoaderParam( DOCML_NAME_OPTIONS_MENU, DOCML_VIDEOCOLLECTIONVIEW_FILE, @@ -175,13 +196,7 @@ DOCML_NAME_SORT_BY_SIZE, DOCML_VIDEOCOLLECTIONVIEW_FILE, false, - VideoCollectionUiLoaderParam::LoadPhaseSecondary)); - params.append(VideoCollectionUiLoaderParam( - DOCML_NAME_VC_COLLECTIONWIDGET, - DOCML_VIDEOCOLLECTIONVIEW_FILE, - DOCML_VIDEOCOLLECTIONVIEW_SECTION_LIST, - true, - VideoCollectionUiLoaderParam::LoadPhaseSecondary)); + VideoCollectionUiLoaderParam::LoadPhaseSecondary)); params.append(VideoCollectionUiLoaderParam( DOCML_NAME_VC_COLLECTIONCONTENTWIDGET, DOCML_VIDEOCOLLECTIONVIEW_FILE, @@ -217,6 +232,17 @@ mUiLoader->loadPhase(VideoCollectionUiLoaderParam::LoadPhasePrimary); params.clear(); + if(videoListPhase == VideoCollectionUiLoaderParam::LoadPhasePrimary) + { + mCurrentList = mUiLoader->findWidget( + DOCML_NAME_VC_VIDEOLISTWIDGET); + } + else + { + mCurrentList = mUiLoader->findWidget( + DOCML_NAME_VC_COLLECTIONWIDGET); + } + return 0; } @@ -289,7 +315,10 @@ { FUNC_LOG; mUiLoader->loadPhase(VideoCollectionUiLoaderParam::LoadPhaseSecondary); - emit doDelayeds(); + if(mCurrentList) + { + mCurrentList->doDelayedsSlot(); + } } // --------------------------------------------------------------------------- @@ -302,8 +331,9 @@ // if mModelReady is false, then it means that this is the first time modelReady // signal fires. Signaling that view is ready. - if(!mModelReady) + if(!mViewReady) { + mViewReady = true; emit viewReady(); } @@ -322,12 +352,10 @@ void VideoListView::layoutChangedSlot() { FUNC_LOG; + // Note that showHint should be executed before updateSubLabel as it + // can modify the mModelReady flag. + showHint(); updateSubLabel(); - - if(mModelReady) - { - showHint(); - } } // --------------------------------------------------------------------------- @@ -351,8 +379,9 @@ this, SLOT(handleAsyncStatusSlot(int, QVariant&))); HbMenu *menu = mUiLoader->findWidget(DOCML_NAME_OPTIONS_MENU); - if (menu) + if(menu) { + menu->setObjectName(LIST_VIEW_OBJECT_NAME_OPTIONS_MENU); menu->hide(); } @@ -370,6 +399,8 @@ if(mCurrentList) { + VideoCollectionCommon::TCollectionLevels level = mCurrentList->getLevel(); + VideoCollectionViewUtils::saveWidgetLevel(level); mCurrentList->deactivate(); } } @@ -407,9 +438,9 @@ int VideoListView::createToolbar() { FUNC_LOG; - // Create actiongroup and add all actions to it. This ensures that only one is + + // Create actiongroup and add all actions to it. This ensures that only one is // active at certain moment. - if(!mToolbarViewsActionGroup && !mToolbarCollectionActionGroup) { mToolbarViewsActionGroup = new QActionGroup(this); @@ -418,7 +449,7 @@ // create toolbar item actions // All Videos tab - mToolbarActions[ETBActionAllVideos] = createAction(":/images/qtg_mono_video_all.svg", + mToolbarActions[ETBActionAllVideos] = createAction("qtg_mono_video", mToolbarViewsActionGroup, SLOT(openAllVideosViewSlot())); // Collections tab @@ -468,8 +499,14 @@ mToolbarActions[ETBActionServices]->setCheckable(false); } - // Allvideos is checked at creation phase - mToolbarActions[ETBActionAllVideos]->setChecked(true); + if(mCurrentList->getLevel() == VideoCollectionCommon::ELevelCategory) + { + mToolbarActions[ETBActionCollections]->setChecked(true); + } + else + { + mToolbarActions[ETBActionAllVideos]->setChecked(true); + } bar->addActions(mToolbarViewsActionGroup->actions()); } @@ -514,30 +551,34 @@ VideoSortFilterProxyModel &model = mCurrentList->getModel(); - // prepare hint widget + if(!mModelReady && model.rowCount() == 0) + { + return; + } + + mModelReady = true; + + // decide if the hintwidget needs to be shown or not. + show = show && model.rowCount() == 0; + + // If show is false, then hint widget is fetched only if it exists. If + // show is true then hint widget is also created and prepared if it does not exists. VideoHintWidget *hintWidget = mUiLoader->findWidget( - DOCML_NAME_VC_VIDEOHINTWIDGET); + DOCML_NAME_VC_VIDEOHINTWIDGET, show); + if (hintWidget) { hintWidget->setLevel(mHintLevel); - if (mModelReady && - model.rowCount() == 0) + if (show) { - show ? hintWidget->activate() : hintWidget->deactivate(); - } - else - { - show = false; - hintWidget->deactivate(); - } - if(show) - { + hintWidget->activate(); bool showHintBtns = (mCurrentList->getLevel() != VideoCollectionCommon::ELevelDefaultColl); hintWidget->setButtonShown(showHintBtns); } else { + hintWidget->deactivate(); hintWidget->setButtonShown(true); } } @@ -595,7 +636,7 @@ model = &mCurrentList->getModel(); } - if (model) + if (model && mModelReady) { int itemCount = model->rowCount(); @@ -658,39 +699,26 @@ int VideoListView::activateVideosView() { FUNC_LOG; - VideoListWidget *videoList = - mUiLoader->findWidget( - DOCML_NAME_VC_VIDEOLISTWIDGET); - if (videoList) + + if(!mCurrentList) + { + return -1; + } + VideoCollectionCommon::TCollectionLevels level = mCurrentList->getLevel(); + + int result = mCurrentList->activate(level); + if(result < 0) { - VideoCollectionCommon::TCollectionLevels level = VideoCollectionCommon::ELevelVideos; - if (mCurrentList) - { - level = mCurrentList->getLevel(); - } - else - { - mCurrentList = videoList; - } - - int result = mCurrentList->activate(level); - if(result < 0) - { - ERROR(result, "VideoListView::activateVideosView() failed to activate."); - // activate failed, deactivate view so we get rid of dangling connections. - deactivateView(); - return -1; - } - - if (createToolbar() != 0) - { - ERROR(result, "VideoListView::activateVideosView() failed to create toolbar."); - deactivateView(); - return -1; - } + ERROR(result, "VideoListView::activateVideosView() failed to activate."); + // activate failed, deactivate view so we get rid of dangling connections. + deactivateView(); + return -1; } - else + + if (createToolbar() != 0) { + ERROR(result, "VideoListView::activateVideosView() failed to create toolbar."); + deactivateView(); return -1; } @@ -823,11 +851,10 @@ mCurrentList = videoListWidget; mCurrentList->activate(VideoCollectionCommon::ELevelVideos); - // since collection is not to be opened at this point, - // we do not receive lauoutChanged for updating the hind -widget - // if needed, need to show it here is needed setHintLevel(VideoHintWidget::AllVideos); - showHint(); + + // update the sublabel, as in most cases the data is already up to date. + updateSubLabel(); } } @@ -850,14 +877,13 @@ // activate video collection widget mCurrentList = collectionWidget; - mCurrentList->activate(VideoCollectionCommon::ELevelCategory); - - VideoSortFilterProxyModel &model = mCurrentList->getModel(); + mCurrentList->activate(VideoCollectionCommon::ELevelCategory); - VideoCollectionViewUtils::sortModel(&model, false, mCurrentList->getLevel()); - - // the collection view is not empty, so we can hide the hint in advance. + // the collection view is not empty, so we should hide the hint in advance. showHint(false); + + // also update the sublabel immediatelly, as the data is up to date almost always. + updateSubLabel(); } } @@ -1023,7 +1049,10 @@ HbInputDialog *dialog = new HbInputDialog(); dialog->setAttribute(Qt::WA_DeleteOnClose); - dialog->getText(label, this, SLOT(createCollectionDialogFinished(HbAction *)), text); + dialog->setObjectName(LIST_VIEW_OBJECT_NAME_CREATE_COLLECTION); + dialog->setPromptText(label); + dialog->setValue(text); + dialog->open(this, SLOT(createCollectionDialogFinished(HbAction *))); } // ------------------------------------------------------------------------------------------------- @@ -1033,7 +1062,6 @@ void VideoListView::createCollectionDialogFinished(HbAction *action) { FUNC_LOG; - Q_UNUSED(action); HbInputDialog *dialog = static_cast(sender()); @@ -1362,7 +1390,8 @@ } // Start fetching content before changing. - collectionContentWidget->getModel().openItem(itemId); + VideoSortFilterProxyModel &model = collectionContentWidget->getModel(); + model.openItem(itemId); // deactivat current widget. mCurrentList->deactivate(); @@ -1373,14 +1402,11 @@ updateSubLabel(); - // setup correct sorting, collection content contains always a list of videos so we use - // ELevelVideos as target for sorting - VideoCollectionViewUtils::sortModel(&mCurrentList->getModel(), false, VideoCollectionCommon::ELevelVideos); - mCurrentList->getModel().invalidate(); + model.invalidate(); // update hint widget for correct content + mModelReady = model.rowCount() > 0; setHintLevel(VideoHintWidget::Collection); - showHint(); // update toolbar for albums, default categories don't have one. if(level == VideoCollectionCommon::ELevelAlbum && @@ -1404,7 +1430,6 @@ } // restore animations for collection content widget collectionContentWidget->setEnabledAnimations(animationState); - } // ------------------------------------------------------------------------------------------------- @@ -1417,15 +1442,24 @@ if (name.compare(DOCML_NAME_VC_VIDEOLISTWIDGET) == 0) { connect(object, SIGNAL(command(int)), this, SIGNAL(command(int))); - connect(this, SIGNAL(doDelayeds()), object, SLOT(doDelayedsSlot())); + if(mCurrentList != object) + { + // this widget not yet activated so it's has been created on the second phase + // safe to call doDelayed right away + qobject_cast(object)->doDelayedsSlot(); + } } else if (name.compare(DOCML_NAME_VC_COLLECTIONWIDGET) == 0) { connect( object, SIGNAL(collectionOpened(bool, const QString&, const QModelIndex&)), this, SLOT(collectionOpenedSlot(bool, const QString&, const QModelIndex&))); - connect(this, SIGNAL(doDelayeds()), object, SLOT(doDelayedsSlot())); - emit(doDelayeds()); + if(mCurrentList != object) + { + // this widget not yet activated so it's has been created on the second phase + // safe to call doDelayed right away + qobject_cast(object)->doDelayedsSlot(); + } } else if (name.compare(DOCML_NAME_VC_COLLECTIONCONTENTWIDGET) == 0) { @@ -1433,8 +1467,12 @@ connect( object, SIGNAL(collectionOpened(bool, const QString&, const QModelIndex&)), this, SLOT(collectionOpenedSlot(bool, const QString&, const QModelIndex&))); - connect(this, SIGNAL(doDelayeds()), object, SLOT(doDelayedsSlot())); - emit(doDelayeds()); + if(mCurrentList != object) + { + // this widget not yet activated so it's has been created on the second phase + // safe to call doDelayed right away + qobject_cast(object)->doDelayedsSlot(); + } } else if (name.compare(DOCML_NAME_OPTIONS_MENU) == 0) { @@ -1514,5 +1552,4 @@ HbMessageBox::information(tr("Not implemented yet")); } -// end of file - +// End of file diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionview/src/videolistwidget.cpp --- a/videocollection/videocollectionview/src/videolistwidget.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionview/src/videolistwidget.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -18,6 +18,7 @@ #include "videocollectiontrace.h" #include "videolistwidget.h" +#include #include #include #include @@ -34,12 +35,28 @@ #include "videocollectionviewutils.h" #include "videocollectionuiloader.h" #include "videolistselectiondialog.h" -#include "videoservices.h" #include "videothumbnaildata.h" #include "videosortfilterproxymodel.h" #include "videocollectioncommon.h" #include "mpxhbvideocommondefs.h" +// Object names. +const char* const LIST_WIDGET_OBJECT_NAME_CONTEXT_MENU = "vc:ListWidgetContextMenu"; +const char* const LIST_WIDGET_OBJECT_NAME_DELETE_VIDEO = "vc:ListWidgetMessageBoxDeleteVideo"; +const char* const LIST_WIDGET_OBJECT_NAME_RENAME_VIDEO = "vc:ListWidgetInputDialogRenameVideo"; +const char* const LIST_WIDGET_OBJECT_NAME_REMOVE_COLLECTION = "vc:ListWidgetMessageBoxRemoveCollection"; +const char* const LIST_WIDGET_OBJECT_NAME_NAV_KEY_BACK = "vc:ListWidgetNavKeyBack"; +const char* const LIST_WIDGET_OBJECT_NAME_NAV_KEY_QUIT = "vc:ListWidgetNavKeyQuit"; +const char* const LIST_WIDGET_OBJECT_NAME_ACTION_ATTACH = "vc:ListWidgetActionAttach"; +const char* const LIST_WIDGET_OBJECT_NAME_ACTION_PLAY = "vc:ListWidgetActionPlay"; +const char* const LIST_WIDGET_OBJECT_NAME_ACTION_DETAILS = "vc:ListWidgetActionDetails"; +const char* const LIST_WIDGET_OBJECT_NAME_ACTION_DELETE = "vc:ListWidgetActionDelete"; +const char* const LIST_WIDGET_OBJECT_NAME_ACTION_OPEN = "vc:ListWidgetActionOpen"; +const char* const LIST_WIDGET_OBJECT_NAME_ACTION_ADD_TO = "vc:ListWidgetActionAddToCollection"; +const char* const LIST_WIDGET_OBJECT_NAME_ACTION_REMOVE_FROM = "vc:ListWidgetActionRemoveFromCollection"; +const char* const LIST_WIDGET_OBJECT_NAME_ACTION_RENAME = "vc:ListWidgetActionRename"; +const char* const LIST_WIDGET_OBJECT_NAME_ACTION_REMOVE_COLLECTION = "vc:ListWidgetActionRemoveCollection"; + // Interval in ms to report the scroll position. const int SCROLL_POSITION_TIMER_TIMEOUT = 100; @@ -58,7 +75,8 @@ mContextMenu(0), mSelectionMode(HbAbstractItemView::NoSelection), mScrollPositionTimer(0), -mUiLoader(uiLoader) +mUiLoader(uiLoader), +mService(VideoServices::ENoService) { FUNC_LOG_ADDR(this); } @@ -84,16 +102,27 @@ // initialize // --------------------------------------------------------------------------- // -int VideoListWidget::initialize(VideoSortFilterProxyModel &model, VideoServices* videoServices) +int VideoListWidget::initialize(VideoSortFilterProxyModel &model, + VideoServices* videoServices, + VideoCollectionCommon::TCollectionLevels level) { FUNC_LOG_ADDR(this); - mModel = &model; - + mModel = &model; mVideoServices = videoServices; + mCurrentLevel = level; if(mVideoServices) { mIsService = true; + + if(XQServiceUtil::interfaceName().contains("IVideoFetch")) + { + mService = VideoServices::EUriFetcher; + } + else if (XQServiceUtil::interfaceName().contains("IVideoBrowse")) + { + mService = VideoServices::EBrowse; + } } // init list view @@ -307,13 +336,12 @@ if (mIsService && mVideoServices && - mVideoServices->currentService() == VideoServices::EBrowse) + mService == VideoServices::EBrowse) { isBrowsingService = true; } return isBrowsingService; - } // --------------------------------------------------------------------------- @@ -330,22 +358,21 @@ if (isBrowsingService()) { mNavKeyAction = new HbAction(Hb::QuitNaviAction); - if (mNavKeyAction) - { - connect( - mNavKeyAction, SIGNAL(triggered()), - mVideoServices, SLOT(browsingEnded())); - } + mNavKeyAction->setObjectName(LIST_WIDGET_OBJECT_NAME_NAV_KEY_QUIT); + connect(mNavKeyAction, SIGNAL(triggered()), + mVideoServices, SLOT(browsingEnded())); } else if (mModel) { if (VideoCollectionCommon::EModelTypeCollectionContent == mModel->getType()) { mNavKeyAction = new HbAction(Hb::BackNaviAction); + mNavKeyAction->setObjectName(LIST_WIDGET_OBJECT_NAME_NAV_KEY_BACK); } else { mNavKeyAction = new HbAction(Hb::QuitNaviAction); + mNavKeyAction->setObjectName(LIST_WIDGET_OBJECT_NAME_NAV_KEY_QUIT); } } } @@ -384,6 +411,7 @@ HbMessageBox *messageBox = new HbMessageBox(text, HbMessageBox::MessageTypeQuestion); messageBox->setAttribute(Qt::WA_DeleteOnClose); + messageBox->setObjectName(LIST_WIDGET_OBJECT_NAME_DELETE_VIDEO); messageBox->open(this, SLOT(deleteItemDialogFinished(HbAction *))); } } @@ -420,54 +448,70 @@ } mContextMenu = new HbMenu(); - if (mContextMenu) + mContextMenu->setDismissPolicy(HbPopup::TapAnywhere); + mContextMenu->setObjectName(LIST_WIDGET_OBJECT_NAME_CONTEXT_MENU); + + if (mService == VideoServices::EUriFetcher) { - mContextMenu->setDismissPolicy(HbPopup::TapAnywhere); + mContextMenuActions[EActionAttach] = + mContextMenu->addAction(hbTrId("txt_videos_menu_attach"), this, SLOT(openItemSlot())); + mContextMenuActions[EActionAttach]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_ATTACH); + + mContextMenuActions[EActionPlay] = + mContextMenu->addAction(hbTrId("txt_videos_menu_play"), this, SLOT(playItemSlot())); + mContextMenuActions[EActionPlay]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_PLAY); - VideoServices::TVideoService service = VideoServices::ENoService; - if (mIsService && - mVideoServices) - { - service = mVideoServices->currentService(); - } + mContextMenuActions[EActionDetails] = + mContextMenu->addAction(hbTrId("txt_common_menu_details"), this, SLOT(openDetailsSlot())); + mContextMenuActions[EActionDetails]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_DETAILS); + } + else if (mService == VideoServices::EBrowse) + { + mContextMenuActions[EActionPlay] = + mContextMenu->addAction(hbTrId("txt_videos_menu_play"), this, SLOT(playItemSlot())); + mContextMenuActions[EActionPlay]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_PLAY); + + mContextMenuActions[EActionDelete] = + mContextMenu->addAction(hbTrId("txt_common_menu_delete"), this, SLOT(deleteItemSlot())); + mContextMenuActions[EActionDelete]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_DELETE); - if (service == VideoServices::EUriFetcher) - { - mContextMenuActions[EActionAttach] = - mContextMenu->addAction(hbTrId("txt_videos_menu_attach"), this, SLOT(openItemSlot())); - mContextMenuActions[EActionPlay] = - mContextMenu->addAction(hbTrId("txt_videos_menu_play"), this, SLOT(playItemSlot())); - mContextMenuActions[EActionDetails] = - mContextMenu->addAction(hbTrId("txt_common_menu_details"), this, SLOT(openDetailsSlot())); - } - else if (service == VideoServices::EBrowse) - { - mContextMenuActions[EActionPlay] = - mContextMenu->addAction(hbTrId("txt_videos_menu_play"), this, SLOT(playItemSlot())); - mContextMenuActions[EActionDelete] = - mContextMenu->addAction(hbTrId("txt_common_menu_delete"), this, SLOT(deleteItemSlot())); - mContextMenuActions[EActionDetails] = - mContextMenu->addAction(hbTrId("txt_common_menu_details"), this, SLOT(openDetailsSlot())); - } - else - { - mContextMenuActions[EActionPlay] = - mContextMenu->addAction(hbTrId("txt_videos_menu_play"), this, SLOT(playItemSlot())); - mContextMenuActions[EActionOpen] = - mContextMenu->addAction(hbTrId("txt_common_menu_open"), this, SLOT(openItemSlot())); - mContextMenuActions[EActionAddToCollection] = - mContextMenu->addAction(hbTrId("txt_videos_menu_add_to_collection"), this, SLOT(addToCollectionSlot())); - mContextMenuActions[EActionRemove] = - mContextMenu->addAction(hbTrId("txt_videos_menu_remove_from_collection"), this, SLOT(removeFromCollectionSlot())); - mContextMenuActions[EActionRename] = - mContextMenu->addAction(hbTrId("txt_common_menu_rename_item"), this, SLOT(renameSlot())); - mContextMenuActions[EActionRemoveCollection] = - mContextMenu->addAction(hbTrId("txt_videos_menu_remove_collection"), this, SLOT(removeCollectionSlot())); - mContextMenuActions[EActionDelete] = - mContextMenu->addAction(hbTrId("txt_common_menu_delete"), this, SLOT(deleteItemSlot())); - mContextMenuActions[EActionDetails] = - mContextMenu->addAction(hbTrId("txt_common_menu_details"), this, SLOT(openDetailsSlot())); - } + mContextMenuActions[EActionDetails] = + mContextMenu->addAction(hbTrId("txt_common_menu_details"), this, SLOT(openDetailsSlot())); + mContextMenuActions[EActionDetails]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_DETAILS); + } + else + { + mContextMenuActions[EActionPlay] = + mContextMenu->addAction(hbTrId("txt_videos_menu_play"), this, SLOT(playItemSlot())); + mContextMenuActions[EActionPlay]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_PLAY); + + mContextMenuActions[EActionOpen] = + mContextMenu->addAction(hbTrId("txt_common_menu_open"), this, SLOT(openItemSlot())); + mContextMenuActions[EActionOpen]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_OPEN); + + mContextMenuActions[EActionAddToCollection] = + mContextMenu->addAction(hbTrId("txt_videos_menu_add_to_collection"), this, SLOT(addToCollectionSlot())); + mContextMenuActions[EActionAddToCollection]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_ADD_TO); + + mContextMenuActions[EActionRemove] = + mContextMenu->addAction(hbTrId("txt_videos_menu_remove_from_collection"), this, SLOT(removeFromCollectionSlot())); + mContextMenuActions[EActionRemove]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_REMOVE_FROM); + + mContextMenuActions[EActionRename] = + mContextMenu->addAction(hbTrId("txt_common_menu_rename_item"), this, SLOT(renameSlot())); + mContextMenuActions[EActionRename]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_RENAME); + + mContextMenuActions[EActionRemoveCollection] = + mContextMenu->addAction(hbTrId("txt_videos_menu_remove_collection"), this, SLOT(removeCollectionSlot())); + mContextMenuActions[EActionRemoveCollection]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_REMOVE_COLLECTION); + + mContextMenuActions[EActionDelete] = + mContextMenu->addAction(hbTrId("txt_common_menu_delete"), this, SLOT(deleteItemSlot())); + mContextMenuActions[EActionDelete]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_DELETE); + + mContextMenuActions[EActionDetails] = + mContextMenu->addAction(hbTrId("txt_common_menu_details"), this, SLOT(openDetailsSlot())); + mContextMenuActions[EActionDetails]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_DETAILS); } } @@ -522,7 +566,9 @@ { mContextMenuActions[EActionAddToCollection]->setVisible(true); mContextMenuActions[EActionDelete]->setVisible(true); - } else { + } + else + { mContextMenuActions[EActionAttach]->setVisible(true); } mContextMenuActions[EActionPlay]->setVisible(true); @@ -609,7 +655,7 @@ { if(mIsService && mVideoServices && - mVideoServices->currentService() == VideoServices::EUriFetcher && + mService == VideoServices::EUriFetcher && mCurrentLevel != VideoCollectionCommon::ELevelCategory) { QVariant variant = mModel->data(index, VideoCollectionCommon::KeyFilePath); @@ -705,26 +751,6 @@ } // --------------------------------------------------------------------------- -// panGesture -// --------------------------------------------------------------------------- -// -void VideoListWidget::panGesture(const QPointF &point) -{ - FUNC_LOG_ADDR(this); - if (mContextMenu) - { - if (!mContextMenu->isVisible()) - { - HbListView::panGesture(point); - } - } - else - { - HbListView::panGesture(point); - } -} - -// --------------------------------------------------------------------------- // doDelayedsSlot // --------------------------------------------------------------------------- // @@ -793,7 +819,10 @@ HbInputDialog *dialog = new HbInputDialog(); dialog->setAttribute(Qt::WA_DeleteOnClose); - dialog->getText(label, this, SLOT(renameDialogFinished(HbAction *)), albumName); + dialog->setObjectName(LIST_WIDGET_OBJECT_NAME_RENAME_VIDEO); + dialog->setPromptText(label); + dialog->setValue(albumName); + dialog->open(this, SLOT(renameDialogFinished(HbAction *))); } } @@ -893,6 +922,7 @@ variant.toString()); HbMessageBox *messageBox = new HbMessageBox(text, HbMessageBox::MessageTypeQuestion); messageBox->setAttribute(Qt::WA_DeleteOnClose); + messageBox->setObjectName(LIST_WIDGET_OBJECT_NAME_REMOVE_COLLECTION); messageBox->open(this, SLOT(removeCollectionDialogFinished(HbAction *))); } } diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionview/tsrc/testlistview/src/testlistview.cpp --- a/videocollection/videocollectionview/tsrc/testlistview/src/testlistview.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionview/tsrc/testlistview/src/testlistview.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 38 % +// Version : %version: 44 % #define private public #include "videoservices.h" @@ -406,7 +406,7 @@ HbAction* allVideos = static_cast(actions.at(0)); QVERIFY( allVideos->isCheckable() ); - QCOMPARE( allVideos->icon().iconName(), QString(":/images/qtg_mono_video_all.svg") ); + QCOMPARE( allVideos->icon().iconName(), QString("qtg_mono_video") ); QVERIFY( allVideos->isChecked() ); HbAction* collections = static_cast(actions.at(1)); @@ -440,7 +440,8 @@ HbMainWindow *mainWnd = hbInstance->allMainWindows().value(0); mainWnd->unsetOrientation(false); - mTestView->mCurrentList = 0; + VideoListWidget *backup = mTestView->mCurrentList; + mTestView->mCurrentList = 0; HbDocumentLoader::mFindWidgetFails = true; QCOMPARE( mTestView->activateView(TMPXItemId::InvalidId()), -1 ); QVERIFY( VideoListWidgetData::mActive == false ); @@ -448,6 +449,7 @@ QCOMPARE( VideoListWidgetData::mActivateCount, 0 ); QCOMPARE( VideoListWidgetData::mDeactivateCount, 0 ); QVERIFY( mainWnd->mOrientationSet == false ); + mTestView->mCurrentList = backup; HbDocumentLoader::mFindWidgetFails = false; videoListWidget = mUiLoader->findWidget(DOCML_NAME_VC_VIDEOLISTWIDGET); @@ -517,6 +519,7 @@ // -browse service // -other category init(); + videoListWidget = mUiLoader->findWidget(DOCML_NAME_VC_VIDEOLISTWIDGET); VideoListWidgetData::reset(); VideoSortFilterProxyModelData::reset(); itemId.iId1 = KVcxMvcCategoryIdOther; @@ -525,7 +528,7 @@ QVERIFY(VideoListWidgetData::mActive); QCOMPARE(VideoListWidgetData::mActivateCount, 1); QCOMPARE(mTestView->mCollectionName.length(), 0); - QCOMPARE(mTestView->mCurrentList->getLevel(), VideoCollectionCommon::ELevelVideos); + //QCOMPARE(mTestView->mCurrentList->getLevel(), VideoCollectionCommon::ELevelVideos); QCOMPARE(VideoSortFilterProxyModelData::mLastItemId, TMPXItemId::InvalidId()); cleanup(); @@ -541,7 +544,7 @@ QVERIFY(VideoListWidgetData::mActive); QCOMPARE(VideoListWidgetData::mActivateCount, 1); QCOMPARE(mTestView->mCollectionName.length(), 0); - QCOMPARE(mTestView->mCurrentList->getLevel(), VideoCollectionCommon::ELevelVideos); +// QCOMPARE(mTestView->mCurrentList->getLevel(), VideoCollectionCommon::ELevelVideos); QCOMPARE(VideoSortFilterProxyModelData::mLastItemId, TMPXItemId::InvalidId()); cleanup(); @@ -940,9 +943,18 @@ { init(); mTestView->mModelReady = false; + mTestView->mViewReady = false; connect( this, SIGNAL(testSignal()), mTestView, SLOT(modelReadySlot()) ); + QSignalSpy spy(mTestView, SIGNAL(viewReady())); emit testSignal(); QVERIFY(mTestView->mModelReady); + QVERIFY(mTestView->mViewReady); + QCOMPARE(spy.count(), 1); + spy.clear(); + + emit testSignal(); + QCOMPARE(spy.count(), 0); + cleanup(); } @@ -957,9 +969,11 @@ //////////// // no current list //////////// + VideoListWidget *backup = mTestView->mCurrentList; + mTestView->mCurrentList = 0; emit testSignal(); QCOMPARE(VideoListSelectionDialogData::mMultiSelectionLaunchCount, 0); - + mTestView->mCurrentList = backup; mTestView->activateView(TMPXItemId::InvalidId()); //////////// @@ -1246,6 +1260,7 @@ { init(true); setRowCount(1); + mTestView->mModelReady = true; connect(this, SIGNAL(testLayoutChangedSignal()), mTestView, SLOT(layoutChangedSlot())); connect(this, SIGNAL(testCollectionOpenedSignal(bool, const QString&, const QModelIndex&)), mTestView, SLOT(collectionOpenedSlot(bool, const QString&, const QModelIndex&))); @@ -1283,35 +1298,49 @@ // void TestListView::testShowHint() { - init(true); + init(false); connect(this, SIGNAL(testLayoutChangedSignal()), mTestView, SLOT(layoutChangedSlot())); mTestView->mModelReady = true; // current list is null. (cannot be verified, run for coverity emit testLayoutChangedSignal(); mTestView->activateView(TMPXItemId::InvalidId()); - + disconnect(this, SIGNAL(testLayoutChangedSignal()), mTestView, SLOT(layoutChangedSlot())); + + cleanup(); + init(true); + mTestView->mModelReady = true; + connect(this, SIGNAL(testLayoutChangedSignal()), mTestView, SLOT(layoutChangedSlot())); + // hint widget cannot be loaded. (cannot be tested, run for coverity) VideoCollectionUiLoaderData::mFindFailureNameList.append(DOCML_NAME_VC_VIDEOHINTWIDGET); emit testLayoutChangedSignal(); VideoCollectionUiLoaderData::mFindFailureNameList.clear(); VideoHintWidget *hintWidget = mUiLoader->findWidget(DOCML_NAME_VC_VIDEOHINTWIDGET); + hintWidget->deactivate(); ///// // hint widget showing - // model not ready (need to use another slot for this) + // model not ready, row count zero. mTestView->mModelReady = false; + setRowCount(0); + VideoListWidget *backup = mTestView->mCurrentList; mTestView->mCurrentList = mUiLoader->findWidget(DOCML_NAME_VC_COLLECTIONWIDGET); - connect(this, SIGNAL(testSignal()), mTestView, SLOT(openAllVideosViewSlot())); - emit testSignal(); + emit testLayoutChangedSignal(); + QVERIFY(hintWidget->isVisible() == false); + QVERIFY(VideoHintWidgetData::mSettedButtonShowLevel); + mTestView->mCurrentList = backup; + + // model not ready, row count not zero. + setRowCount(1); + emit testLayoutChangedSignal(); QVERIFY(hintWidget->isVisible() == false ); QVERIFY(VideoHintWidgetData::mSettedButtonShowLevel); - disconnect(this, SIGNAL(testSignal()), mTestView, SLOT(openAllVideosViewSlot())); + QVERIFY(mTestView->mModelReady); // model ready, row count not zero mTestView->mModelReady = true; - setRowCount(1); emit testLayoutChangedSignal(); QVERIFY(hintWidget->isVisible() == false ); QVERIFY(VideoHintWidgetData::mSettedButtonShowLevel); @@ -1322,7 +1351,7 @@ QVERIFY(hintWidget->isVisible() == true ); QVERIFY(VideoHintWidgetData::mSettedButtonShowLevel); - // model ready, row count is zero show to be false + // model ready, row count is zero, show to be false connect(this, SIGNAL(testSignal()), mTestView, SLOT(openCollectionViewSlot())); emit testSignal(); QVERIFY(hintWidget->isVisible() == false ); @@ -1333,6 +1362,7 @@ //////// // toolbar setup + mTestView->activateView(TMPXItemId::InvalidId()); mTestView->mToolbarActions[VideoListView::ETBActionRemoveVideos]->setVisible(true); // mToolbarViewsActionGroup is null @@ -1453,18 +1483,22 @@ // Not initialized, no mCurrentList emit testSignal(index, 0, 0); - // TODO verify + // no verification needed, this tests that method does not crash if mCurrentList is not set. // Good case QVERIFY(mTestView->initializeView() == 0); mTestView->activateView(TMPXItemId::InvalidId()); setRowCount(1); + VideoListWidgetData::mEmitActivatedIndex = QModelIndex(); emit testSignal(index, 0, 0); - // TODO verify + QModelIndex expectedIndex = mTestView->mCurrentList->mModel->index(0,0); + QCOMPARE(VideoListWidgetData::mEmitActivatedIndex, expectedIndex); + + VideoListWidgetData::mEmitActivatedIndex = QModelIndex(); // Invalid index emit testSignal(index, -1, 0); - // TODO verify + QCOMPARE(VideoListWidgetData::mEmitActivatedIndex, QModelIndex()); disconnect(this, SIGNAL(testSignal()), mTestView, SLOT(doDelayedsSlot())); cleanup(); @@ -1519,39 +1553,49 @@ init(false); QVERIFY(connect(this, SIGNAL(testSignal()), mTestView, SLOT(createCollectionSlot()))); + HbInputDialog *dialog = new HbInputDialog(); + // not initialized, no mCurrentList emit testSignal(); - QCOMPARE(HbInputDialog::mGetTextCallCount, 0); + QCOMPARE(HbInputDialog::mOpenCallCount, 0); QVERIFY(VideoSortFilterProxyModelData::mLastAddedAlbumName == ""); QVERIFY(mTestView->initializeView() == 0); mTestView->activateView(TMPXItemId::InvalidId()); // dialog canceled - HbInputDialog::mGetTextFails = true; + HbInputDialog::mValueCallCount = 0; + HbInputDialog::mOpenCallCount = 0; emit testSignal(); - QCOMPARE(HbInputDialog::mGetTextCallCount, 1); + dialog->emitDialogFinished(mTestView, SLOT(createCollectionDialogFinished(HbAction *)), 1); QVERIFY(VideoSortFilterProxyModelData::mLastAddedAlbumName == ""); + QCOMPARE(HbInputDialog::mValueCallCount, 1); + QCOMPARE(HbInputDialog::mOpenCallCount, 1); // empty name - HbInputDialog::mGetTextFails = false; - HbInputDialog::mGetTextCallCount = 0; - HbInputDialog::mGetTextReturnValue = ""; + HbInputDialog::mValueCallCount = 0; + HbInputDialog::mValueReturnValue = ""; + HbInputDialog::mOpenCallCount = 0; emit testSignal(); - QCOMPARE(HbInputDialog::mGetTextCallCount, 1); + dialog->emitDialogFinished(mTestView, SLOT(createCollectionDialogFinished(HbAction *)), 0); QVERIFY(VideoSortFilterProxyModelData::mLastAddedAlbumName == ""); + QCOMPARE(HbInputDialog::mValueCallCount, 1); + QCOMPARE(HbInputDialog::mOpenCallCount, 1); // Good case. - HbInputDialog::mGetTextReturnValue = "testAlbum"; - HbInputDialog::mGetTextCallCount = 0; + HbInputDialog::mValueCallCount = 0; + HbInputDialog::mValueReturnValue = "testAlbum"; + HbInputDialog::mOpenCallCount = 0; emit testSignal(); - QCOMPARE(HbInputDialog::mGetTextCallCount, 1); + dialog->emitDialogFinished(mTestView, SLOT(createCollectionDialogFinished(HbAction *)), 0); QVERIFY(VideoSortFilterProxyModelData::mLastAddedAlbumName == "testAlbum"); + QCOMPARE(HbInputDialog::mValueCallCount, 1); + QCOMPARE(HbInputDialog::mOpenCallCount, 1); - HbInputDialog::mGetTextCallCount = 0; - HbInputDialog::mGetTextReturnValue = QString(); - VideoSortFilterProxyModelData::mLastAddedAlbumName = ""; - + HbInputDialog::mValueCallCount = 0; + HbInputDialog::mValueReturnValue = ""; + HbInputDialog::mOpenCallCount = 0; + VideoSortFilterProxyModelData::mLastAddedAlbumName = ""; disconnect(this, SIGNAL(testSignal()), mTestView, SLOT(createCollectionSlot())); cleanup(); } @@ -1637,11 +1681,11 @@ QVERIFY(allVideos); setRowCount(3, allVideos->mModel); // Must have different model than selection dialog has. Otherwise Qt optimizes rowCount calls - // to source model and VideoListDataModelData::mRowCountDecrement hack doesn't work. + // to source model and VideoListDataModelData::mRowCountDecrement doesn't work. + QVERIFY(mTestView->initializeView() == 0); QVERIFY(connect(this, SIGNAL(testSignal2()), mTestView, SLOT(openCollectionViewSlot()))); emit testSignal2(); disconnect(this, SIGNAL(testSignal2()), mTestView, SLOT(openCollectionViewSlot())); - QVERIFY(mTestView->initializeView() == 0); mTestView->activateView(TMPXItemId::InvalidId()); VideoListDataModelData::mRowCountDecrement = 1; mTestView->mCurrentList->mCurrentLevel = VideoCollectionCommon::ELevelAlbum; diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionview/tsrc/testlistwidget/inc/testlistwidget.h --- a/videocollection/videocollectionview/tsrc/testlistwidget/inc/testlistwidget.h Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionview/tsrc/testlistwidget/inc/testlistwidget.h Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 25 % +// Version : %version: 26 % #ifndef __TESTLISTWIDGET_H__ #define __TESTLISTWIDGET_H__ @@ -106,11 +106,6 @@ void testLongPressedSlot(); /** - * verifies panGesture - */ - void testPanGesture(); - - /** * verifies setContextMenu */ void testSetContextMenu(); diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionview/tsrc/testlistwidget/src/testlistwidget.cpp --- a/videocollection/videocollectionview/tsrc/testlistwidget/src/testlistwidget.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionview/tsrc/testlistwidget/src/testlistwidget.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 47 % +// Version : %version: 51 % #include #include @@ -86,14 +86,6 @@ { VideoListWidget::longPressedSlot(item, point); } - - /** - * calls pangesture - */ - void callPanGesture(const QPointF &point) - { - VideoListWidget::panGesture(point); - } }; // --------------------------------------------------------------------------- @@ -460,12 +452,12 @@ // current level is not ELevelCategory // mIsService is true, variant gotten is invalid - videoServices->mCurrentService = VideoServices::EUriFetcher; + mTestWidget->mService = VideoServices::EUriFetcher; VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, QVariant()); mTestWidget->mCurrentLevel = VideoCollectionCommon::ELevelVideos; mTestWidget->mIsService = true; mTestWidget->mVideoServices = videoServices; - fetchIndex = model->index(0, 0, QModelIndex()); + fetchIndex = model->index(5, 0, QModelIndex()); mTestWidget->callEmiteActivated(fetchIndex); QVERIFY(spysignal.count() == 0); QVERIFY(spysignalFileUri.count() == 0); @@ -474,7 +466,7 @@ // current level is not ELevelCategory // mIsService is true, variant gotten is valid - videoServices->mCurrentService = VideoServices::EUriFetcher; + mTestWidget->mService = VideoServices::EUriFetcher; VideoListDataModelData::setData(VideoCollectionCommon::KeyFilePath, data); fetchIndex = model->index(0, 0, QModelIndex()); mTestWidget->callEmiteActivated(fetchIndex); @@ -653,38 +645,6 @@ } // --------------------------------------------------------------------------- -// testPanGesture -// --------------------------------------------------------------------------- -// -void TestListWidget::testPanGesture() -{ - QPointF point(1,1); - // no context menu - mTestWidget->callPanGesture(point); - QVERIFY(HbListView::mPanGesturePoint == point); - - // create context menu - VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance(); - VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos); - mTestWidget->initialize(*model); - connect(this, SIGNAL(testSignal()), mTestWidget, SLOT(doDelayedsSlot())); - emit testSignal(); - disconnect(this, SIGNAL(testSignal()), mTestWidget, SLOT(doDelayedsSlot())); - - HbListView::mPanGesturePoint = QPointF(); - - // context menu visible - mTestWidget->mContextMenu->setVisible(true); - mTestWidget->callPanGesture(point); - QVERIFY(HbListView::mPanGesturePoint != point); - - // context menu not visible - mTestWidget->mContextMenu->setVisible(false); - mTestWidget->callPanGesture(point); - QVERIFY(HbListView::mPanGesturePoint == point); -} - -// --------------------------------------------------------------------------- // testSetContextMenu // --------------------------------------------------------------------------- // @@ -818,16 +778,16 @@ init(); setRowCount(1); model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos); - mTestWidget->initialize(*model); + VideoServices *videoServices = VideoServices::instance(); + mTestWidget->mIsService = true; + videoServices->mCurrentService = VideoServices::EUriFetcher; + mTestWidget->initialize(*model, videoServices); HbListView::mCurrentIndex = model->index(0, 0, QModelIndex()); mTestWidget->mItem->mModelIndex = HbListView::mCurrentIndex ; - VideoServices *videoServices = VideoServices::instance(); mTestWidget->mCurrentLevel = VideoCollectionCommon::ELevelAlbum; VideoSortFilterProxyModelData::mItemIds.append(itemId); - mTestWidget->mIsService = true; - mTestWidget->mVideoServices = videoServices; - videoServices->mCurrentService = VideoServices::EUriFetcher; + mTestWidget->callLongPressedSlot(item, point); iter = mTestWidget->mContextMenuActions.begin(); QVERIFY(iter != mTestWidget->mContextMenuActions.end()); @@ -901,7 +861,10 @@ mTestWidget->initialize(*model); connect(this, SIGNAL(testSignal()), mTestWidget, SLOT(deleteItemSlot())); + HbMessageBox *box = new HbMessageBox(); + // no model + VideoListDataModelData::mDataAccessCount = 0; VideoSortFilterProxyModel *tmp = mTestWidget->mModel; mTestWidget->mModel = 0; emit testSignal(); @@ -912,6 +875,7 @@ mTestWidget->mModel = tmp; // data fetched from item is invalid + VideoListDataModelData::mDataAccessCount = 0; setRowCount(1); mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex()); emit testSignal(); @@ -921,6 +885,7 @@ setRowCount(0); // data is valid + VideoListDataModelData::mDataAccessCount = 0; setRowCount(1); QVariant data = QString("test"); VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data); @@ -929,7 +894,8 @@ // messagebox question returns false HbMessageBoxData::mQuestionReturnValue = false; emit testSignal(); - QVERIFY(VideoListDataModelData::dataAccessCount() == 2); + box->emitDialogFinished(mTestWidget, SLOT(deleteItemDialogFinished(HbAction *)), 1); + QVERIFY(VideoListDataModelData::dataAccessCount() == 1); QVERIFY(!HbMessageBoxData::mLatestTxt.isEmpty()); QVERIFY(!VideoSortFilterProxyModelData::mLastIndex.isValid()); HbMessageBoxData::mLatestTxt = ""; @@ -938,10 +904,12 @@ VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data); // messagebox question returns true + VideoListDataModelData::mDataAccessCount = 0; VideoSortFilterProxyModelData::mDeleteItemsFails = false; HbMessageBoxData::mQuestionReturnValue = true; emit testSignal(); - QVERIFY(VideoListDataModelData::dataAccessCount() == 3); + box->emitDialogFinished(mTestWidget, SLOT(deleteItemDialogFinished(HbAction *)), 0); + QVERIFY(VideoListDataModelData::dataAccessCount() == 1); QVERIFY(!HbMessageBoxData::mLatestTxt.isEmpty()); QVERIFY(VideoSortFilterProxyModelData::mLastIndex.row() == 0); @@ -957,6 +925,8 @@ VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance(); VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos); + HbInputDialog *dialog = new HbInputDialog(); + connect(this, SIGNAL(testSignal()), mTestWidget, SLOT(renameSlot())); VideoSortFilterProxyModelData::reset(); @@ -965,70 +935,82 @@ // Good case VideoSortFilterProxyModelData::mLastAlbumNameInRename = ""; - HbInputDialog::mGetTextReturnValue = "renamedVideo"; - HbInputDialog::mGetTextCallCount = 0; + HbInputDialog::mValueReturnValue = "renamedVideo"; + HbInputDialog::mValueCallCount = 0; + HbInputDialog::mOpenCallCount = 0; setRowCount(1); VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(0, KVcxMvcMediaTypeAlbum)); QVariant data = QString("albumName"); VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data); mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex()); emit testSignal(); + dialog->emitDialogFinished(mTestWidget, SLOT(renameDialogFinished(HbAction *)), 0); QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "renamedVideo"); - QCOMPARE(HbInputDialog::mGetTextCallCount, 1); - + QCOMPARE(HbInputDialog::mOpenCallCount, 1); + QVERIFY(HbInputDialog::mValueCallCount == 1); + // New name is same as previous - HbInputDialog::mGetTextReturnValue = QString(); - HbInputDialog::mGetTextCallCount = 0; + HbInputDialog::mValueReturnValue = ""; + HbInputDialog::mValueCallCount = 0; + HbInputDialog::mOpenCallCount = 0; VideoSortFilterProxyModelData::mLastAlbumNameInRename = ""; data = QString("albumName"); VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data); mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex()); emit testSignal(); + dialog->emitDialogFinished(mTestWidget, SLOT(renameDialogFinished(HbAction *)), 0); QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == ""); - QCOMPARE(HbInputDialog::mGetTextCallCount, 1); + QCOMPARE(HbInputDialog::mOpenCallCount, 1); + QVERIFY(HbInputDialog::mValueCallCount == 1); + + // Dialog canceled + HbInputDialog::mValueReturnValue = ""; + HbInputDialog::mValueCallCount = 0; + HbInputDialog::mOpenCallCount = 0; + VideoSortFilterProxyModelData::mLastAlbumNameInRename = ""; + data = QString("albumName"); + VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data); + mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex()); + emit testSignal(); + dialog->emitDialogFinished(mTestWidget, SLOT(renameDialogFinished(HbAction *)), 1); + QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == ""); + QCOMPARE(HbInputDialog::mOpenCallCount, 1); + QVERIFY(HbInputDialog::mValueCallCount == 1); - // Getting name from input dialog fails - HbInputDialog::mGetTextFails = true; + // New name is empty. VideoSortFilterProxyModelData::mLastAlbumNameInRename = ""; - HbInputDialog::mGetTextReturnValue = QString(); - HbInputDialog::mGetTextCallCount = 0; + HbInputDialog::mValueReturnValue = ""; + HbInputDialog::mValueCallCount = 0; + HbInputDialog::mOpenCallCount = 0; + data = QString("albumName"); + VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data); + mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex()); + emit testSignal(); + dialog->emitDialogFinished(mTestWidget, SLOT(renameDialogFinished(HbAction *)), 0); + QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == ""); + QCOMPARE(HbInputDialog::mOpenCallCount, 1); + QVERIFY(HbInputDialog::mValueCallCount == 1); + + // Item is video + VideoSortFilterProxyModelData::mItemIds.clear(); + VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(0, KVcxMvcMediaTypeVideo)); + VideoSortFilterProxyModelData::mLastAlbumNameInRename = ""; + HbInputDialog::mValueReturnValue = ""; + HbInputDialog::mValueCallCount = 0; + HbInputDialog::mOpenCallCount = 0; data = QString("albumName"); VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data); mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex()); emit testSignal(); QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == ""); - QCOMPARE(HbInputDialog::mGetTextCallCount, 1); - - // New name is empty. - HbInputDialog::mGetTextFails = false; - VideoSortFilterProxyModelData::mLastAlbumNameInRename = ""; - HbInputDialog::mGetTextReturnValue = ""; - HbInputDialog::mGetTextCallCount = 0; - data = QString("albumName"); - VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data); - mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex()); - emit testSignal(); - QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == ""); - QCOMPARE(HbInputDialog::mGetTextCallCount, 1); - - // Item is video - VideoSortFilterProxyModelData::mItemIds.clear(); - VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(0, KVcxMvcMediaTypeVideo)); - HbInputDialog::mGetTextFails = false; - VideoSortFilterProxyModelData::mLastAlbumNameInRename = ""; - HbInputDialog::mGetTextReturnValue = ""; - HbInputDialog::mGetTextCallCount = 0; - data = QString("albumName"); - VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data); - mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex()); - emit testSignal(); - QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == ""); - QCOMPARE(HbInputDialog::mGetTextCallCount, 0); + QCOMPARE(HbInputDialog::mOpenCallCount, 0); + QVERIFY(HbInputDialog::mValueCallCount == 0); // No model VideoSortFilterProxyModelData::mLastAlbumNameInRename = ""; - HbInputDialog::mGetTextReturnValue = "renamedVideo"; - HbInputDialog::mGetTextCallCount = 0; + HbInputDialog::mValueReturnValue = "renamedVideo"; + HbInputDialog::mValueCallCount = 0; + HbInputDialog::mOpenCallCount = 0; VideoSortFilterProxyModelData::mItemIds.clear(); VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(0, KVcxMvcMediaTypeAlbum)); data = QString("albumName"); @@ -1039,12 +1021,13 @@ emit testSignal(); mTestWidget->mModel = tmp; QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == ""); - QCOMPARE(HbInputDialog::mGetTextCallCount, 0); + QCOMPARE(HbInputDialog::mOpenCallCount, 0); // Variant data is invalid VideoSortFilterProxyModelData::mLastAlbumNameInRename = ""; - HbInputDialog::mGetTextReturnValue = "renamedVideo"; - HbInputDialog::mGetTextCallCount = 0; + HbInputDialog::mValueReturnValue = "renamedVideo"; + HbInputDialog::mValueCallCount = 0; + HbInputDialog::mOpenCallCount = 0; VideoSortFilterProxyModelData::mItemIds.clear(); VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(0, KVcxMvcMediaTypeAlbum)); data = QVariant(); @@ -1052,7 +1035,7 @@ mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex()); emit testSignal(); QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == ""); - QCOMPARE(HbInputDialog::mGetTextCallCount, 0); + QCOMPARE(HbInputDialog::mOpenCallCount, 0); disconnect(this, SIGNAL(testSignal()), mTestWidget, SLOT(renameSlot())); } @@ -1233,6 +1216,7 @@ HbListView::mCurrentIndex = model->index(0, 0, QModelIndex()); connect(this, SIGNAL(testSignal()), mTestWidget, SLOT(removeCollectionSlot())); + HbMessageBox *box = new HbMessageBox(); setRowCount(2); TMPXItemId savedId = TMPXItemId(1,1); @@ -1258,6 +1242,7 @@ // valid data VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, "test"); emit testSignal(); + box->emitDialogFinished(mTestWidget, SLOT(removeCollectionDialogFinished(HbAction *)), 0); QVERIFY(VideoSortFilterProxyModelData::mLastIndex.isValid()); QVERIFY(VideoSortFilterProxyModelData::mLastIndex.row() == 1); QVERIFY(!HbMessageBoxData::mLatestTxt.isEmpty()); @@ -1267,6 +1252,7 @@ HbMessageBoxData::mLatestTxt = ""; HbMessageBoxData::mQuestionReturnValue = false; emit testSignal(); + box->emitDialogFinished(mTestWidget, SLOT(removeCollectionDialogFinished(HbAction *)), 1); QVERIFY(!VideoSortFilterProxyModelData::mLastIndex.isValid()); QVERIFY(!HbMessageBoxData::mLatestTxt.isEmpty()); diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionview/tsrc/testvideocollectionuiloader/src/testvideocollectionuiloader.cpp --- a/videocollection/videocollectionview/tsrc/testvideocollectionuiloader/src/testvideocollectionuiloader.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionview/tsrc/testvideocollectionuiloader/src/testvideocollectionuiloader.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -211,6 +211,15 @@ mTestObject->addData(params, this, SLOT(handleObjectReady(QObject*, const QString&))); + + // first test the findWidget with loadIfNotFound == false. + bannerWidget = + mTestObject->findWidget( + DOCML_NAME_VC_HEADINGBANNER, false); + QVERIFY(!bannerWidget); + QVERIFY(!mObjects.contains(DOCML_NAME_VC_HEADINGBANNER)); + + // then with default value. bannerWidget = mTestObject->findWidget( DOCML_NAME_VC_HEADINGBANNER); @@ -295,6 +304,13 @@ // -object added in loading queue params.append(addToCollectionParam); mTestObject->addData(params, this, SLOT(handleObjectReady(QObject*, const QString&))); + + // first test with loadIfNotFound == false + addToCollection = mTestObject->findObject(DOCML_NAME_ADD_TO_COLLECTION, false); + QVERIFY(!addToCollection); + QVERIFY(!mObjects.contains(DOCML_NAME_ADD_TO_COLLECTION)); + + // then with default value. addToCollection = mTestObject->findObject(DOCML_NAME_ADD_TO_COLLECTION); QVERIFY(addToCollection); QVERIFY(mObjects.contains(DOCML_NAME_ADD_TO_COLLECTION)); @@ -849,9 +865,9 @@ { if (name == DOCML_NAME_VIEW) { - HbMainWindow *window = hbInstance->allMainWindows().at(0); - if (window) + if(hbInstance->allMainWindows().count()) { + HbMainWindow *window = hbInstance->allMainWindows().at(0); HbView *view = qobject_cast(object); if (view) { diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionview/tsrc/testvideocollectionviewutils/inc/testvideocollectionviewutils.h --- a/videocollection/videocollectionview/tsrc/testvideocollectionviewutils/inc/testvideocollectionviewutils.h Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionview/tsrc/testvideocollectionviewutils/inc/testvideocollectionviewutils.h Wed Jun 23 17:22:59 2010 +0100 @@ -79,7 +79,11 @@ * verifies sortModel */ void testSortModel(); - + + /** + * verifies saveWidgetLevel & loadWidgetLevel + */ + void testSaveAndLoadWidgetLevel(); }; diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionview/tsrc/testvideocollectionviewutils/src/testvideocollectionviewutils.cpp --- a/videocollection/videocollectionview/tsrc/testvideocollectionviewutils/src/testvideocollectionviewutils.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionview/tsrc/testvideocollectionviewutils/src/testvideocollectionviewutils.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -27,6 +27,8 @@ #include "hbmessageboxdata.h" #include "hbnotificationdialog.h" #include "hblistview.h" +#include +#include #define private public #include "videocollectionviewutils.h" @@ -44,7 +46,9 @@ // int main(int argc, char *argv[]) { - QApplication app(argc, argv); + HbApplication app(argc, argv); + //HbMainWindow window; + //QApplication app(argc, argv); TestVideoVideoCollectionViewUtils tv; @@ -91,96 +95,148 @@ { VideoCollectionViewUtils &testObject(VideoCollectionViewUtils::instance()); QVariant additional; + QList dataList; QString txt = "__test__"; - HbMessageBoxData::mWarningCallCount = 0; HbNotificationDialog::mNotifDialogTitle = ""; HbNotificationDialog::mTitleTextWRapping = Hb::TextNoWrap; HbNotificationDialog::mAttribute = Qt::WA_Disabled; - + HbMessageBoxData::mType = -1; + HbMessageBoxData::mShowCallCount = 0; // status: VideoCollectionCommon::statusSingleDeleteFail additional = txt; testObject.showStatusMsgSlot(VideoCollectionCommon::statusSingleDeleteFail, additional); - QVERIFY(HbMessageBoxData::mWarningCallCount == 1); + QVERIFY(HbMessageBoxData::mType == HbMessageBox::MessageTypeWarning); + QVERIFY(HbMessageBoxData::mShowCallCount == 1); QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0); QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap); QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled); - HbMessageBoxData::mWarningCallCount = 0; + QVERIFY(HbMessageBoxData::mType == HbMessageBox::MessageTypeWarning); + HbMessageBoxData::mType = -1; + HbMessageBoxData::mShowCallCount = 0; HbMessageBoxData::mInformationCallCount = 0; - // - invalid additional additional = QVariant(); testObject.showStatusMsgSlot(VideoCollectionCommon::statusSingleDeleteFail, additional); - QVERIFY(HbMessageBoxData::mWarningCallCount == 0); + QVERIFY(HbMessageBoxData::mType == -1); + QVERIFY(HbMessageBoxData::mShowCallCount == 0); QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0); QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap); QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled); + HbMessageBoxData::mType = -1; + HbMessageBoxData::mShowCallCount = 0; // status: VideoCollectionCommon::statusMultipleDeleteFail additional = txt; testObject.showStatusMsgSlot(VideoCollectionCommon::statusMultipleDeleteFail, additional); - QVERIFY(HbMessageBoxData::mWarningCallCount == 1); + QVERIFY(HbMessageBoxData::mShowCallCount == 1); + QVERIFY(HbMessageBoxData::mType == HbMessageBox::MessageTypeWarning); QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0); QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap); QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled); - HbMessageBoxData::mWarningCallCount = 0; + HbMessageBoxData::mType = -1; + HbMessageBoxData::mShowCallCount = 0; // - invalid additional (no change, since additional not excepted) additional = QVariant(); testObject.showStatusMsgSlot(VideoCollectionCommon::statusMultipleDeleteFail, additional); - QVERIFY(HbMessageBoxData::mWarningCallCount == 1); + QVERIFY(HbMessageBoxData::mType == HbMessageBox::MessageTypeWarning); + QVERIFY(HbMessageBoxData::mShowCallCount == 1); QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0); QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap); QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled); - HbMessageBoxData::mWarningCallCount = 0; + HbMessageBoxData::mType = -1; + HbMessageBoxData::mShowCallCount = 0; // status: VideoCollectionCommon::statusMultipleRemoveFail (additional not needed) additional = QVariant(); testObject.showStatusMsgSlot(VideoCollectionCommon::statusMultiRemoveFail, additional); - QVERIFY(HbMessageBoxData::mWarningCallCount == 1); + QVERIFY(HbMessageBoxData::mShowCallCount == 1); + QVERIFY(HbMessageBoxData::mType == HbMessageBox::MessageTypeWarning); QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0); QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap); QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled); - HbMessageBoxData::mWarningCallCount = 0; + HbMessageBoxData::mType = -1; + HbMessageBoxData::mShowCallCount = 0; // status: VideoCollectionCommon::statusVideosAddedToCollection // notification dialog shown - additional = txt; + dataList.clear(); + dataList.append(QVariant(1)); // count + dataList.append(QVariant(txt)); // name + additional = dataList; testObject.showStatusMsgSlot(VideoCollectionCommon::statusVideosAddedToCollection, additional); - QVERIFY(HbMessageBoxData::mWarningCallCount == 0); + QVERIFY(HbMessageBoxData::mShowCallCount == 0); + QVERIFY(HbMessageBoxData::mType == -1); QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() > 0); QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextWordWrap); QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_DeleteOnClose); - HbMessageBoxData::mWarningCallCount = 0; HbNotificationDialog::mNotifDialogTitle = ""; HbNotificationDialog::mTitleTextWRapping = Hb::TextNoWrap; HbNotificationDialog::mAttribute = Qt::WA_Disabled; + + // - too few additional + dataList.clear(); + dataList.append(QVariant(txt)); // name + additional = dataList; + testObject.showStatusMsgSlot(VideoCollectionCommon::statusVideosAddedToCollection, additional); + QVERIFY(HbMessageBoxData::mShowCallCount == 0); + QVERIFY(HbMessageBoxData::mType == -1); + QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0); + QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap); + QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled); + // - empty message + dataList.clear(); + dataList.append(QVariant(1)); // count + dataList.append(QVariant("")); // name + additional = dataList; + testObject.showStatusMsgSlot(VideoCollectionCommon::statusVideosAddedToCollection, additional); + QVERIFY(HbMessageBoxData::mShowCallCount == 0); + QVERIFY(HbMessageBoxData::mType == -1); + QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0); + QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap); + QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled); + + // - with zero video count + dataList.clear(); + dataList.append(QVariant(0)); // count + dataList.append(QVariant(txt)); // name + additional = dataList; + testObject.showStatusMsgSlot(VideoCollectionCommon::statusVideosAddedToCollection, additional); + QVERIFY(HbMessageBoxData::mShowCallCount == 0); + QVERIFY(HbMessageBoxData::mType == -1); + QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0); + QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap); + QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled); + // - invalid additional additional = QVariant(); testObject.showStatusMsgSlot(VideoCollectionCommon::statusVideosAddedToCollection, additional); - QVERIFY(HbMessageBoxData::mWarningCallCount == 0); + QVERIFY(HbMessageBoxData::mShowCallCount == 0); QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0); QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap); QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled); // status: VideoCollectionCommon::statusAllVideosAlreadyInCollection testObject.showStatusMsgSlot(VideoCollectionCommon::statusAllVideosAlreadyInCollection, additional); - QVERIFY(HbMessageBoxData::mWarningCallCount == 1); + QVERIFY(HbMessageBoxData::mShowCallCount == 1); + QVERIFY(HbMessageBoxData::mType == HbMessageBox::MessageTypeWarning); QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0); QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap); QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled); - HbMessageBoxData::mWarningCallCount = 0; + HbMessageBoxData::mShowCallCount = 0; + HbMessageBoxData::mType = -1; // status: VideoCollectionCommon::statusDeleteInProgress additional = txt; testObject.showStatusMsgSlot(VideoCollectionCommon::statusDeleteInProgress, additional); - QVERIFY(HbMessageBoxData::mWarningCallCount == 0); + QVERIFY(HbMessageBoxData::mShowCallCount == 0); + QVERIFY(HbMessageBoxData::mType == -1); QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() > 0); QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextWordWrap); QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_DeleteOnClose); - HbMessageBoxData::mWarningCallCount = 0; HbNotificationDialog::mNotifDialogTitle = ""; HbNotificationDialog::mTitleTextWRapping = Hb::TextNoWrap; HbNotificationDialog::mAttribute = Qt::WA_Disabled; @@ -188,7 +244,8 @@ // - invalid additional additional = QVariant(); testObject.showStatusMsgSlot(VideoCollectionCommon::statusDeleteInProgress, additional); - QVERIFY(HbMessageBoxData::mWarningCallCount == 0); + QVERIFY(HbMessageBoxData::mShowCallCount == 0); + QVERIFY(HbMessageBoxData::mType == -1); QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0); QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap); QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled); @@ -196,16 +253,19 @@ // status: VideoCollectionCommon::statusSingleRemoveFail additional = txt; testObject.showStatusMsgSlot(VideoCollectionCommon::statusSingleRemoveFail, additional); - QVERIFY(HbMessageBoxData::mWarningCallCount == 1); + QVERIFY(HbMessageBoxData::mShowCallCount == 1); + QVERIFY(HbMessageBoxData::mType == HbMessageBox::MessageTypeWarning); QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0); QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap); QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled); - HbMessageBoxData::mWarningCallCount = 0; + HbMessageBoxData::mShowCallCount = 0; + HbMessageBoxData::mType = -1; // - invalid additional additional = QVariant(); testObject.showStatusMsgSlot(VideoCollectionCommon::statusSingleRemoveFail, additional); - QVERIFY(HbMessageBoxData::mWarningCallCount == 0); + QVERIFY(HbMessageBoxData::mShowCallCount == 0); + QVERIFY(HbMessageBoxData::mType == -1); QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0); QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap); QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled); @@ -213,33 +273,34 @@ // status: statusMultiRemoveFail additional = txt; testObject.showStatusMsgSlot(VideoCollectionCommon::statusMultiRemoveFail, additional); - QVERIFY(HbMessageBoxData::mWarningCallCount == 1); + QVERIFY(HbMessageBoxData::mShowCallCount == 1); + QVERIFY(HbMessageBoxData::mType == HbMessageBox::MessageTypeWarning); QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0); QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap); QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled); - HbMessageBoxData::mWarningCallCount = 0; + HbMessageBoxData::mShowCallCount = 0; + HbMessageBoxData::mType = -1; // invalid additional (no change, since additional not excepted) additional = QVariant(); testObject.showStatusMsgSlot(VideoCollectionCommon::statusMultiRemoveFail, additional); - QVERIFY(HbMessageBoxData::mWarningCallCount == 1); + QVERIFY(HbMessageBoxData::mShowCallCount == 1); + QVERIFY(HbMessageBoxData::mType == HbMessageBox::MessageTypeWarning); QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0); QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap); QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled); - HbMessageBoxData::mWarningCallCount = 0; - + HbMessageBoxData::mShowCallCount = 0; + HbMessageBoxData::mType = -1; // invalid state additional = txt; testObject.showStatusMsgSlot(0, additional); - QVERIFY(HbMessageBoxData::mWarningCallCount == 0); + QVERIFY(HbMessageBoxData::mShowCallCount == 0); + QVERIFY(HbMessageBoxData::mType == -1); QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0); QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap); QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled); - HbMessageBoxData::mWarningCallCount = 0; - } - // ----------------------------------------------------------------------------- // testSaveSortingValues @@ -636,6 +697,25 @@ QVERIFY(testObject.mCollectionsSortOrder == Qt::DescendingOrder); } +void TestVideoVideoCollectionViewUtils::testSaveAndLoadWidgetLevel() +{ + static const char* ACTIVITY_VIDEOS_MAINVIEW = "VideosMainView"; + + VideoCollectionCommon::TCollectionLevels level; + + // Invalid level + level = VideoCollectionCommon::ELevelInvalid; + VideoCollectionViewUtils::saveWidgetLevel(level); + level = VideoCollectionViewUtils::loadWidgetLevel(); + QVERIFY(level == VideoCollectionCommon::ELevelVideos); + + // Category level. + level = VideoCollectionCommon::ELevelCategory; + VideoCollectionViewUtils::saveWidgetLevel(level); + level = VideoCollectionViewUtils::loadWidgetLevel(); + QVERIFY(level == VideoCollectionCommon::ELevelCategory); +} + // End of file diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionview/tsrc/testvideocollectionviewutils/testvideocollectionviewutils.pro --- a/videocollection/videocollectionview/tsrc/testvideocollectionviewutils/testvideocollectionviewutils.pro Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionview/tsrc/testvideocollectionviewutils/testvideocollectionviewutils.pro Wed Jun 23 17:22:59 2010 +0100 @@ -53,7 +53,7 @@ \ # sources needed in test ../../src/videocollectionviewutils.cpp -TESTEDCLASS = videocollectionviewutils.cpp +TESTEDCLASS = videocollectionviewutils include(../../../tsrc/stubs/stubs.pro) diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionview/tsrc/testvideolistselectiondialog/src/testvideolistselectiondialog.cpp --- a/videocollection/videocollectionview/tsrc/testvideolistselectiondialog/src/testvideolistselectiondialog.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionview/tsrc/testvideolistselectiondialog/src/testvideolistselectiondialog.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -22,10 +22,11 @@ #include "hbdocumentloader.h" #include "hbstackedwidget.h" #include "hbcheckbox.h" +#include "hbinputdialog.h" #include "hbdialog.h" #include "hbwidget.h" #include "hblistview.h" -#include "hbinputdialog.h" +#include "hbmessagebox.h" #include "testvideolistselectiondialog.h" @@ -210,6 +211,8 @@ { VideoCollectionWrapperData::reset(); VideoListWidgetData::reset(); + cleanup(); + init(); QVERIFY(mInitOk == true); QVERIFY(mModel != 0); @@ -590,33 +593,35 @@ QVERIFY(VideoSortFilterProxyModelData::mItemIds.at(0) == TMPXItemId(1,0)); QVERIFY(VideoSortFilterProxyModelData::mItemIds.at(1) == TMPXItemId(2,0)); + HbInputDialog *dialog = new HbInputDialog(); VideoCollectionViewUtilsData::mLastError = -1; // mSelectedAlbumId == TMPXItemId::InvalidId()) mpxId = TMPXItemId::InvalidId(); - // queryNewAlbumSelected does not set selected - HbInputDialog::mGetTextFails = true; + // query for new album name does not set selected mTestObject->setupContent(VideoListSelectionDialog::ESelectCollection, mpxId); mTestObject->mSelectedVideos.insert(TMPXItemId(1,0)); mTestObject->mSelectedVideos.insert(TMPXItemId(2,0)); VideoSortFilterProxyModelData::reset(); VideoSortFilterProxyModelData::mNewAlbumId = TMPXItemId::InvalidId(); - mTestObject->exec(); + mTestObject->exec(); + dialog->emitDialogFinished(mTestObject, SLOT(newAlbumNameDialogFinished(HbAction *)), 1); // No selected. // type of selection does not change - QVERIFY(mTestObject->mTypeOfSelection == VideoListSelectionDialog::ESelectCollection); + QVERIFY(mTestObject->mTypeOfSelection == VideoListSelectionDialog::EAddToCollection); // since there's no selected videos, status code does not change QVERIFY(VideoCollectionViewUtilsData::mLastError == -1); QVERIFY(VideoSortFilterProxyModelData::mLastItemId == TMPXItemId::InvalidId()); QVERIFY(!VideoSortFilterProxyModelData::mItemIds.count()); - // queryNewAlbumSelected sets selected - HbInputDialog::mGetTextFails = false; + // query for new album name sets selected mTestObject->setupContent(VideoListSelectionDialog::ESelectCollection, mpxId); mTestObject->mSelectedVideos.insert(TMPXItemId(1,0)); mTestObject->mSelectedVideos.insert(TMPXItemId(2,0)); VideoSortFilterProxyModelData::reset(); VideoSortFilterProxyModelData::mNewAlbumId = TMPXItemId(1,2); + HbInputDialog::mValueReturnValue = QVariant(QString("testname")); mTestObject->exec(); + dialog->emitDialogFinished(mTestObject, SLOT(newAlbumNameDialogFinished(HbAction *)), 0); // Yes selected. // type of selection has changed QVERIFY(mTestObject->mTypeOfSelection == VideoListSelectionDialog::EAddToCollection); // videos added into collection @@ -679,13 +684,13 @@ VideoCollectionViewUtilsData::mLastError = -1; // selected album exist, selected videos exists, name for selected album exist // (using ESelectCollection type to fetch albumname) - HbInputDialog::mGetTextFails = false; mTestObject->setupContent(VideoListSelectionDialog::ESelectCollection, mpxId); mTestObject->mSelectedVideos.insert(TMPXItemId(1,0)); mTestObject->mSelectedVideos.insert(TMPXItemId(2,0)); VideoSortFilterProxyModelData::reset(); VideoSortFilterProxyModelData::mNewAlbumId = TMPXItemId(1,2); - mTestObject->exec(); + mTestObject->exec(); + dialog->emitDialogFinished(mTestObject, SLOT(newAlbumNameDialogFinished(HbAction *)), 0); // Yes selected. // type of selection has changed QVERIFY(mTestObject->mTypeOfSelection == VideoListSelectionDialog::EAddToCollection); // videos added into collection diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionwrapper/data/icons/pri_large_video.svg --- a/videocollection/videocollectionwrapper/data/icons/pri_large_video.svg Tue May 18 11:57:40 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionwrapper/data/videocollectionwrapper.qrc --- a/videocollection/videocollectionwrapper/data/videocollectionwrapper.qrc Tue May 18 11:57:40 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ - - - icons/pri_large_video.svg - - diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionwrapper/inc/videodatasignalreceiver.h --- a/videocollection/videocollectionwrapper/inc/videodatasignalreceiver.h Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionwrapper/inc/videodatasignalreceiver.h Wed Jun 23 17:22:59 2010 +0100 @@ -112,6 +112,11 @@ * @param itemId, item that has been modified. */ virtual void itemModifiedSlot(const TMPXItemId &itemId) = 0; + + /** + * Signalled when list is complete. + */ + virtual void listCompleteSlot() = 0; }; #endif // __VIDEOMODELOBSERVER_H diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionwrapper/inc/videolistdatamodel_p.h --- a/videocollection/videocollectionwrapper/inc/videolistdatamodel_p.h Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionwrapper/inc/videolistdatamodel_p.h Wed Jun 23 17:22:59 2010 +0100 @@ -183,6 +183,11 @@ * @param itemId, item that has been modified. */ void itemModifiedSlot(const TMPXItemId &itemId); + + /** + * Signalled when list is complete. + */ + void listCompleteSlot(); public: // services diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionwrapper/inc/videothumbnaildata_p.h --- a/videocollection/videocollectionwrapper/inc/videothumbnaildata_p.h Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionwrapper/inc/videothumbnaildata_p.h Wed Jun 23 17:22:59 2010 +0100 @@ -179,6 +179,17 @@ * */ const QIcon* defaultThumbnail(TMPXItemId mediaId); + + /** + * Loads icon from file or resource, the icon is scaled to size of the + * video list view thumbnail. + * + * @param iconName name of the file or resource. + * + * @return HbIcon the icon load from resource or file. + * + */ + HbIcon loadIcon(QString iconName); /** * Starts timer that continues the background thumbnail fetching at timeout. @@ -258,11 +269,6 @@ * - data is the actual thumbnail data. */ QHash mDefaultThumbnails; - - /** - * Default thumbnail for a category. - */ - QIcon *mDefaultTnCategory; /** * Current model, set at call to startBackgroundFetching. diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionwrapper/src/videocollectionlistener.cpp --- a/videocollection/videocollectionwrapper/src/videocollectionlistener.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionwrapper/src/videocollectionlistener.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 32 % +// Version : %version: 33 % // INCLUDE FILES #include @@ -120,19 +120,25 @@ if(categoryOrAlbumVideoList) { + // checks if there are new videos in the list that are not yet in our data model. + mSignalReceiver.newVideoListSlot(array); + mSignalReceiver.albumListAvailableSlot(pathId, array); - - // Update also all video list in case this is a default category. - if(pathId.iId2 == KVcxMvcMediaTypeCategory) - { - mSignalReceiver.newVideoListSlot(array); - } } else { mSignalReceiver.newVideoListSlot(array); } - } + + int listCompleted(-1); + if(mVideoUtils.mediaValue(&aEntries, KVcxMediaMyVideosInt32Value, listCompleted)) + { + if(listCompleted == EVcxMyVideosVideoListComplete) + { + mSignalReceiver.listCompleteSlot(); + } + } +} // ----------------------------------------------------------------------------- // HandleOpenL diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionwrapper/src/videodatacontainer.cpp --- a/videocollection/videocollectionwrapper/src/videodatacontainer.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionwrapper/src/videodatacontainer.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -14,7 +14,7 @@ * Description: VideoDataContainer class declaration* */ -// Version : %version: % +// Version : %version: 14 % // INCLUDE FILES #include @@ -119,6 +119,7 @@ // if item exist, do not add into container if(iter != mMediaData.end()) { + delete media; return; } mMediaIds.append(mediaId); diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionwrapper/src/videolistdatamodel_p.cpp --- a/videocollection/videocollectionwrapper/src/videolistdatamodel_p.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionwrapper/src/videolistdatamodel_p.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 37 % +// Version : %version: 38 % // INCLUDE FILES #include @@ -451,8 +451,8 @@ // signal that album has been updated emit q_ptr->albumChanged(); - // signal that model is ready - emit q_ptr->modelReady(); + // signal that model has changed. + emit q_ptr->modelChanged(); } @@ -497,9 +497,8 @@ { q_ptr->beginInsertRows(QModelIndex(), startIndex, endIndex); q_ptr->endInsertRows(); + emit q_ptr->modelChanged(); } - - emit q_ptr->modelReady(); } // ----------------------------------------------------------------------------- @@ -890,4 +889,13 @@ } } +// ----------------------------------------------------------------------------- +// listCompleteSlot +// ----------------------------------------------------------------------------- +// +void VideoListDataModelPrivate::listCompleteSlot() +{ + emit q_ptr->modelReady(); +} + // End of file diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionwrapper/src/videosortfilterproxymodel.cpp --- a/videocollection/videocollectionwrapper/src/videosortfilterproxymodel.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionwrapper/src/videosortfilterproxymodel.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 65 % +// Version : %version: 66 % // INCLUDE FILES #include @@ -525,11 +525,14 @@ // TMPXItemId VideoSortFilterProxyModel::getMediaIdAtIndex(const QModelIndex &index) const { - QModelIndex sourceIndex = mapToSource(index); TMPXItemId mpxId = TMPXItemId::InvalidId(); - if(mModel && sourceIndex.isValid()) + if(index.isValid()) { - mpxId = mModel->mediaIdAtIndex(sourceIndex.row()); + QModelIndex sourceIndex = mapToSource(index); + if(mModel && sourceIndex.isValid()) + { + mpxId = mModel->mediaIdAtIndex(sourceIndex.row()); + } } return mpxId; } diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionwrapper/src/videothumbnaildata_p.cpp --- a/videocollection/videocollectionwrapper/src/videothumbnaildata_p.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionwrapper/src/videothumbnaildata_p.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,12 +15,13 @@ * */ -// Version : %version: 21 % +// Version : %version: 24 % // INCLUDE FILES #include #include #include +#include #include #include @@ -45,12 +46,16 @@ // Priority for background thumbnail fetches. const int BACKGROUND_FETCH_PRIORITY = 3000; +// Size for default thumbnail, these match with large thumbnail in lists. +const int DEFAULT_THUMBNAIL_WIDTH = 114; +const int DEFAULT_THUMBNAIL_HEIGHT = 64; + /** * global qHash function required fo creating hash values for TMPXItemId -keys */ inline uint qHash(TMPXItemId key) -{ - QPair keyPair(key.iId1, key.iId2); +{ + QPair keyPair(key.iId1, key.iId2); return qHash(keyPair); } @@ -430,7 +435,7 @@ { if(!mDefaultThumbnails.contains(defaultIdVideo)) { - mDefaultThumbnails[defaultIdVideo] = HbIcon(":/icons/default_thumbnail_video.svg"); + mDefaultThumbnails[defaultIdVideo] = loadIcon("qtg_large_video"); } return &mDefaultThumbnails[defaultIdVideo].qicon(); } @@ -441,7 +446,7 @@ { if(!mDefaultThumbnails.contains(defaultIdAlbum)) { - mDefaultThumbnails[defaultIdAlbum] = HbIcon("qtg_large_video_collection"); + mDefaultThumbnails[defaultIdAlbum] = loadIcon("qtg_large_video_collection"); } return &mDefaultThumbnails[defaultIdAlbum].qicon(); } @@ -453,7 +458,7 @@ { if(!mDefaultThumbnails.contains(defaultIdDownloads)) { - mDefaultThumbnails[defaultIdDownloads] = HbIcon("qtg_large_video_download"); + mDefaultThumbnails[defaultIdDownloads] = loadIcon("qtg_large_video_download"); } return &mDefaultThumbnails[defaultIdDownloads].qicon(); } @@ -462,7 +467,7 @@ { if(!mDefaultThumbnails.contains(defaultIdCaptured)) { - mDefaultThumbnails[defaultIdCaptured] = HbIcon("qtg_large_video_capture"); + mDefaultThumbnails[defaultIdCaptured] = loadIcon("qtg_large_video_capture"); } return &mDefaultThumbnails[defaultIdCaptured].qicon(); } @@ -471,7 +476,7 @@ { if(!mDefaultThumbnails.contains(defaultIdAlbum)) { - mDefaultThumbnails[defaultIdAlbum] = HbIcon("qtg_large_video_collection"); + mDefaultThumbnails[defaultIdAlbum] = loadIcon("qtg_large_video_collection"); } return &mDefaultThumbnails[defaultIdAlbum].qicon(); } @@ -480,6 +485,56 @@ } // ----------------------------------------------------------------------------- +// VideoThumbnailDataPrivate::loadIcon() +// ----------------------------------------------------------------------------- +// +HbIcon VideoThumbnailDataPrivate::loadIcon(QString iconName) +{ + HbIcon icon(iconName); + + if(!icon.isNull()) + { + QPixmap dest = QPixmap(DEFAULT_THUMBNAIL_WIDTH, DEFAULT_THUMBNAIL_HEIGHT); + + // Scale the icon into the thumbnail area. + QPixmap source = icon.pixmap(); + // Smooth scaling is very expensive (size^2). Therefore we reduce the size + // to 2x of the destination size and using fast transformation before doing final smooth scaling. + if(source.size().width() > (6*dest.width()) || source.size().height() > (6*dest.height())) + { + QSize intermediate_size = QSize( dest.width() * 2, dest.height() * 2 ); + source = source.scaled(intermediate_size, Qt::KeepAspectRatio, Qt::FastTransformation ); + } + QPixmap scaled = source.scaled(dest.size(), Qt::KeepAspectRatio, Qt::SmoothTransformation); + + // Center the icon. + int xDiff = 0; + int yDiff = 0; + if(dest.width() > scaled.width()) + { + xDiff = (dest.width() - scaled.width()) / 2; + } + if(dest.height() > scaled.height()) + { + yDiff = (dest.height() - scaled.height()) / 2; + } + + // Paint it. + QPainter painter(&dest); + painter.setCompositionMode(QPainter::CompositionMode_Source); + painter.fillRect(dest.rect(), Qt::transparent); + painter.drawPixmap(xDiff, yDiff, scaled.width(), scaled.height(), scaled); + painter.end(); + + return HbIcon(dest); + } + else + { + return HbIcon(); + } +} + +// ----------------------------------------------------------------------------- // VideoThumbnailDataPrivate::removeThumbnail() // ----------------------------------------------------------------------------- // diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionwrapper/src/videothumbnailfetcher.cpp --- a/videocollection/videocollectionwrapper/src/videothumbnailfetcher.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionwrapper/src/videothumbnailfetcher.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 4 % +// Version : %version: 6 % // INCLUDE FILES #include @@ -302,13 +302,15 @@ void VideoThumbnailFetcher::thumbnailReadySlot(QPixmap tnData, void *internal, int requestId, int error) { INFO_2("VideoThumbnailFetcher::thumbnailReadySlot() requestId: %d, error: %d", requestId, error); + Q_UNUSED(requestId); TMPXItemId mediaId = TMPXItemId::InvalidId(); if(internal) { - mediaId = *(static_cast(internal)); + TMPXItemId *idPointer = static_cast(internal); + mediaId = *idPointer; + delete idPointer; } - delete internal; // Thumbnail has not been generated yet, put it into creation list. if(error == -1) diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionwrapper/tsrc/testvideocollectionclient/stub/inc/stubcollectionsignalreceiver.h --- a/videocollection/videocollectionwrapper/tsrc/testvideocollectionclient/stub/inc/stubcollectionsignalreceiver.h Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionwrapper/tsrc/testvideocollectionclient/stub/inc/stubcollectionsignalreceiver.h Wed Jun 23 17:22:59 2010 +0100 @@ -123,10 +123,18 @@ /** * No implementation needed for these tests */ - virtual void itemModifiedSlot(const TMPXItemId &itemId) + void itemModifiedSlot(const TMPXItemId &itemId) { Q_UNUSED(itemId); } + + /** + * No implementation needed for these tests + */ + void listCompleteSlot() + { + + } }; diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/inc/mediaobjectfactory.h --- a/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/inc/mediaobjectfactory.h Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/inc/mediaobjectfactory.h Wed Jun 23 17:22:59 2010 +0100 @@ -52,7 +52,7 @@ * * @return CMPXMedia */ - CMPXMedia* newMedia(int id = -1, int id2 = 0 ); + CMPXMedia* newMedia(int id = -1, int id2 = 0); /** * appends media object to mediaarray diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/src/mediaobjectfactory.cpp --- a/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/src/mediaobjectfactory.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/src/mediaobjectfactory.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -58,7 +58,7 @@ // newMedia // ----------------------------------------------------------------------------- // -CMPXMedia* MediaObjectFactory::newMedia(int id1, int id2 ) +CMPXMedia* MediaObjectFactory::newMedia(int id1, int id2) { CMPXMedia *media = NULL; TRAP_IGNORE(media = CMPXMedia::NewL()); diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/src/testvideocollectionlistener.cpp --- a/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/src/testvideocollectionlistener.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/src/testvideocollectionlistener.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -187,7 +187,8 @@ CMPXCollectionPath* collectionPath = 0; TRAP_IGNORE( collectionPath = CMPXCollectionPath::NewL(); - collectionPath->AppendL( KVcxUidMyVideosMpxCollection );); + collectionPath->AppendL( KVcxUidMyVideosMpxCollection ); + ); // empty array, path exists level incorrect (new video list, not category neither album level) mMediaFactory->putValuePtr(media, KMPXMediaGeneralContainerPath, collectionPath); @@ -204,7 +205,8 @@ collectionPath->AppendL( KVcxUidMyVideosMpxCollection ); collectionPath->AppendL( KVcxMvcCategoryIdAll);); - // array of items from different levels, everything is reported + // array of items from different levels, everything is reported + // first call does not contain the KVcxMediaMyVideosInt32Value. mStubCollectionClient->setCollectionLevel(VideoCollectionCommon::ELevelCategory); mMediaFactory->putArrayContent(array, mMediaFactory->newMedia(1, 2)); mMediaFactory->putValuePtr(media, KMPXMediaGeneralContainerPath, collectionPath); @@ -213,15 +215,19 @@ arrayToTest = static_cast(mSignalReceiver->getLatestPointerAddr()); QVERIFY(arrayToTest != 0); QVERIFY(arrayToTest->Count() == array->Count()); + QVERIFY(mSignalReceiver->getListComplete() == false); - mStubCollectionClient->setCollectionLevel(VideoCollectionCommon::ELevelVideos); delete array; - array = mMediaFactory->newMediaArray(); + array = mMediaFactory->newMediaArray(); mMediaFactory->putArrayContent(array, mMediaFactory->newMedia(1)); mMediaFactory->putArrayContent(array, mMediaFactory->newMedia(2)); mMediaFactory->putArrayContent(array, mMediaFactory->newMedia(3)); + // second call contains the KVcxMediaMyVideosInt32Value, but it's not equal to EVcxMyVideosVideoListComplete + int invalid(-100); + mMediaFactory->putTValue(media, KVcxMediaMyVideosInt32Value, invalid); + mMediaFactory->putValuePtr(media, KMPXMediaArrayContents, array); mMediaFactory->putValuePtr(media, KMPXMediaGeneralContainerPath, collectionPath); mStubCollection->callHandleOpenLFunc(*media, 0, true, 0 ); @@ -229,6 +235,7 @@ arrayToTest = static_cast(mSignalReceiver->getLatestPointerAddr()); QVERIFY(arrayToTest != 0); QVERIFY(arrayToTest->Count() == array->Count()); + QVERIFY(mSignalReceiver->getListComplete() == false); delete collectionPath; collectionPath = 0; @@ -238,12 +245,16 @@ collectionPath->AppendL( KVcxMvcMediaTypeCategory);); mMediaFactory->putValuePtr(media, KMPXMediaGeneralContainerPath, collectionPath); + // third call contains KVcxMediaMyVideosInt32Value with value EVcxMyVideosVideoListComplete. + int listComplete(EVcxMyVideosVideoListComplete); + mMediaFactory->putTValue(media, KVcxMediaMyVideosInt32Value, listComplete); + mStubCollection->callHandleOpenLFunc(*media, 0, true, 0 ); arrayToTest = static_cast(mSignalReceiver->getLatestPointerAddr()); QVERIFY(arrayToTest != 0); QVERIFY(arrayToTest->Count() == array->Count()); - + QVERIFY(mSignalReceiver->getListComplete()); CMPXMediaArray *gottenArray = static_cast(mSignalReceiver->getLatestPointerAddr()); QVERIFY(gottenArray->Count() == 3); diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/stub/inc/stubsignalreceiver.h --- a/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/stub/inc/stubsignalreceiver.h Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/stub/inc/stubsignalreceiver.h Wed Jun 23 17:22:59 2010 +0100 @@ -74,6 +74,11 @@ */ int getLatestIntegerData(); + /** + * return mListComplete + */ + bool getListComplete(); + public slots: /** @@ -133,6 +138,11 @@ */ virtual void itemModifiedSlot(const TMPXItemId &itemId); + /** + * Sets boolean mListComplete to true; + */ + void listCompleteSlot(); + private: /** * Contains address of latest pointer passed to object @@ -158,6 +168,11 @@ * contains contents of list received from signal */ QList mLatesListData; + + /** + * True if listCompleteSlot has been called. + */ + bool mListComplete; }; #endif diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/stub/src/stubsignalreceiver.cpp --- a/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/stub/src/stubsignalreceiver.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/stub/src/stubsignalreceiver.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -25,7 +25,8 @@ mLatestPtr(0), mLatestItemId(TMPXItemId::InvalidId()), mLatestModifiedItemId(TMPXItemId::InvalidId()), -mLatestInteger(-1) +mLatestInteger(-1), +mListComplete(false) { } @@ -50,6 +51,7 @@ mLatestModifiedItemId = TMPXItemId::InvalidId(); mLatesListData.clear(); mLatestInteger = -1; + mListComplete = false; } // ----------------------------------------------------------------------------- @@ -99,6 +101,15 @@ } // ----------------------------------------------------------------------------- +// getListComplete +// ----------------------------------------------------------------------------- +// +bool StubSignalReceiver::getListComplete() +{ + return mListComplete; +} + +// ----------------------------------------------------------------------------- // newVideoListSlot // ----------------------------------------------------------------------------- // @@ -204,6 +215,15 @@ } // ----------------------------------------------------------------------------- +// listCompleteSlot +// ----------------------------------------------------------------------------- +// +void StubSignalReceiver::listCompleteSlot() +{ + mListComplete = true; +} + +// ----------------------------------------------------------------------------- // albumRemoveFailureSlot // ----------------------------------------------------------------------------- // diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/testvideocollectionlistener.pro --- a/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/testvideocollectionlistener.pro Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/testvideocollectionlistener.pro Wed Jun 23 17:22:59 2010 +0100 @@ -35,8 +35,7 @@ inc/mediaobjectfactory.h \ stub/inc/stubcollection.h \ stub/inc/videocollectionclient.h \ - stub/inc/stubsignalreceiver.h \ - stub/inc/stubsignalreceiver.h \ + stub/inc/stubsignalreceiver.h \ ../../inc/videocollectionutils.h \ ../../inc/videodatasignalreceiver.h \ ../../inc/videocollectionlistener.h diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/inc/videolistdatamodel_p.h --- a/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/inc/videolistdatamodel_p.h Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/inc/videolistdatamodel_p.h Wed Jun 23 17:22:59 2010 +0100 @@ -315,7 +315,12 @@ * not used in stub */ void itemDeletedSlot(TMPXItemId id); - + + /** + * not used in stub + */ + void listCompleteSlot(); + public: /** diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/src/videolistdatamodel_p.cpp --- a/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/src/videolistdatamodel_p.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/src/videolistdatamodel_p.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -515,4 +515,12 @@ Q_UNUSED(id); } +// ----------------------------------------------------------------------------- +// listCompleteSlot +// ----------------------------------------------------------------------------- +// +void VideoListDataModelPrivate::listCompleteSlot() +{ +} + // End of file diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionwrapper/tsrc/testvideomodel_p/inc/testvideomodel_p.h --- a/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/inc/testvideomodel_p.h Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/inc/testvideomodel_p.h Wed Jun 23 17:22:59 2010 +0100 @@ -88,6 +88,11 @@ */ void signalVideoDetailsCompleted(CMPXMedia*); + /** + * emitted to get listCompleteSlot to be called. + */ + void signalListCompleteSlot(); + // test functions for the test framework private slots: /** @@ -248,6 +253,11 @@ * verifies getMediaIdFromIndex when fetching collections */ void testGetCollectionIdFromIndex(); + + /** + * verifies listCompleteSlot + */ + void testListCompleteSlot(); private: diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionwrapper/tsrc/testvideomodel_p/src/mediaobjectfactory.cpp --- a/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/src/mediaobjectfactory.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/src/mediaobjectfactory.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -397,7 +397,7 @@ TDateTime dateTime; - dateTime.Set(date.date().year(), TMonth(date.date().month() - 1), date.date().day(), + dateTime.Set(date.date().year(), TMonth(date.date().month() - 1), date.date().day() - 1, date.time().hour(), date.time().minute(), date.time().second(), date.time().msec()); TTime ttimeDate(dateTime); diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionwrapper/tsrc/testvideomodel_p/src/testvideomodel_p.cpp --- a/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/src/testvideomodel_p.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/src/testvideomodel_p.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -717,7 +717,7 @@ VideoListDataModel::mFirstRemoved = -1; VideoListDataModel::mLastRemoved = -1; - QSignalSpy spyModelReady(mStubModel, SIGNAL(modelReady())); + QSignalSpy spyModelChanged(mStubModel, SIGNAL(modelChanged())); mMediaFactory->removeArray(); mMediaFactory->createMediaItems(MEDIA_COUNT); @@ -728,8 +728,8 @@ QVERIFY(VideoListDataModel::mLastInserted == MEDIA_COUNT - 1); QVERIFY(VideoListDataModel::mFirstRemoved == -1); QVERIFY(VideoListDataModel::mLastRemoved == -1); - QCOMPARE(spyModelReady.count(), 1); - spyModelReady.clear(); + QCOMPARE(spyModelChanged.count(), 1); + spyModelChanged.clear(); VideoListDataModel::mFirstInserted = -1; VideoListDataModel::mLastInserted = -1; VideoListDataModel::mFirstRemoved = -1; @@ -743,7 +743,7 @@ QVERIFY(VideoListDataModel::mLastInserted == -1); QVERIFY(VideoListDataModel::mFirstRemoved == -1); QVERIFY(VideoListDataModel::mLastRemoved == -1); - QCOMPARE(spyModelReady.count(), 0); + QCOMPARE(spyModelChanged.count(), 0); VideoListDataModel::mFirstInserted = -1; VideoListDataModel::mLastInserted = -1; VideoListDataModel::mFirstRemoved = -1; @@ -758,8 +758,8 @@ QVERIFY(VideoListDataModel::mLastInserted == -1); QVERIFY(VideoListDataModel::mFirstRemoved == -1); QVERIFY(VideoListDataModel::mLastRemoved == -1); - QCOMPARE(spyModelReady.count(), 1); - spyModelReady.clear(); + QCOMPARE(spyModelChanged.count(), 0); + spyModelChanged.clear(); VideoListDataModel::mFirstInserted = -1; VideoListDataModel::mLastInserted = -1; VideoListDataModel::mFirstRemoved = -1; @@ -773,8 +773,8 @@ QVERIFY(VideoListDataModel::mLastInserted == -1); QVERIFY(VideoListDataModel::mFirstRemoved == -1); QVERIFY(VideoListDataModel::mLastRemoved == -1); - QCOMPARE(spyModelReady.count(), 1); - spyModelReady.clear(); + QCOMPARE(spyModelChanged.count(), 0); + spyModelChanged.clear(); VideoListDataModel::mFirstInserted = -1; VideoListDataModel::mLastInserted = -1; VideoListDataModel::mFirstRemoved = -1; @@ -818,6 +818,7 @@ // send 10 videos mMediaFactory->createMediaItems(10); emit signalNewVideoList(mMediaFactory->copyOfMediaArray()); + spyModelChanged.clear(); VideoListDataModel::mFirstInserted = -1; VideoListDataModel::mLastInserted = -1; @@ -1413,6 +1414,18 @@ disconnect(this, SIGNAL(signalNewVideoList(CMPXMediaArray*)), mTestObject, SLOT(newVideoListSlot(CMPXMediaArray*))); } +// ----------------------------------------------------------------------------- +// testListCompleteSlot +// ----------------------------------------------------------------------------- +// +void TestVideoModel_p::testListCompleteSlot() +{ + QVERIFY(connect(this, SIGNAL(signalListCompleteSlot()), mTestObject, SLOT(listCompleteSlot()))); + QSignalSpy spy(mStubModel, SIGNAL(modelReady())); + emit signalListCompleteSlot(); + QCOMPARE(spy.count(), 1); +} + // End of file diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata_p/src/testvideothumbnaildata_p.cpp --- a/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata_p/src/testvideothumbnaildata_p.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata_p/src/testvideothumbnaildata_p.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -162,12 +162,21 @@ // void TestVideoThumbnailData_p::testDestructor() { - mWrapper = 0; + init(); - mTestObject = new VideoThumbnailDataTester(); - delete mTestObject; mTestObject = 0; + mTestObject->getThumbnail(TMPXItemId(1, 0)); + mTestObject->getThumbnail(TMPXItemId(0, 1)); + + QPointer thumbFetcher = mTestObject->mThumbnailFetcher; + QPointer reportTimer = mTestObject->mTbnReportTimer; + QPointer fetchTimer = mTestObject->mBgFetchTimer; - //TODO + cleanup(); + + QCOMPARE(VideoThumbnailFetcher::mRequests.count(), 0); + QVERIFY(thumbFetcher == 0); + QVERIFY(reportTimer == 0); + QVERIFY(fetchTimer == 0); } // --------------------------------------------------------------------------- diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videocollectionwrapper/videocollectionwrapper.pro --- a/videocollection/videocollectionwrapper/videocollectionwrapper.pro Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videocollectionwrapper/videocollectionwrapper.pro Wed Jun 23 17:22:59 2010 +0100 @@ -75,5 +75,3 @@ -lestor.dll \ -lcentralrepository.dll \ -lflogger.dll - -RESOURCES += data/videocollectionwrapper.qrc diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videofiledetailsview/data/pri_large_video.svg --- a/videocollection/videofiledetailsview/data/pri_large_video.svg Tue May 18 11:57:40 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videofiledetailsview/data/videofiledetails.qrc --- a/videocollection/videofiledetailsview/data/videofiledetails.qrc Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videofiledetailsview/data/videofiledetails.qrc Wed Jun 23 17:22:59 2010 +0100 @@ -2,7 +2,4 @@ videofiledetails.xml - - pri_large_video.svg - diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videofiledetailsview/data/videofiledetails.xml --- a/videocollection/videofiledetailsview/data/videofiledetails.xml Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videofiledetailsview/data/videofiledetails.xml Wed Jun 23 17:22:59 2010 +0100 @@ -1,5 +1,5 @@ - + @@ -20,7 +20,7 @@ - + @@ -34,32 +34,22 @@ + + +
- - - - - - - - - - - - - - - + - + + - + @@ -67,16 +57,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - -
@@ -84,55 +98,54 @@ - + + + - + - + + - + - - - - - - - - - - - + + + - - + - - + - + + + + + + - - - - - - - + + + + + + + + + + + - - - diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videofiledetailsview/src/videofiledetailsviewplugin.cpp --- a/videocollection/videofiledetailsview/src/videofiledetailsviewplugin.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videofiledetailsview/src/videofiledetailsviewplugin.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 73 % +// Version : %version: 76 % // INCLUDE FILES #include @@ -46,10 +46,18 @@ #include "videodetailslabel.h" #include "videocollectiontrace.h" +// Object names. +const char* const VIDEO_DETAILS_OBJECT_NAME_THUMBLABEL = "vc:FileDetailsThumbnailLabel"; +const char* const VIDEO_DETAILS_OBJECT_NAME_DELETE_VIDEO = "vc:FileDetailsMessageBoxDeleteVideo"; +const char* const VIDEO_DETAILS_OBJECT_NAME_MESSAGE_BOX_WARNING = "vc:FileDetailsMessageBoxWarning"; +const char* const VIDEO_DETAILS_OBJECT_NAME_DELETE_ACTION = "vc:FileDetailsDelete"; +const char* const VIDEO_DETAILS_OBJECT_NAME_NAVKEY_BACK = "vc:FileDetailsNavKeyBack"; +const char* const VIDEO_DETAILS_OBJECT_NAME_TITLE_ANIM = "vc:FileDetailsTitleAnim"; + +// Docml constants. const char* const VIDEO_DETAILS_DOCML = ":/xml/videofiledetails.docml"; const char* const VIDEO_DETAILS_PORTRAIT = "portrait"; const char* const VIDEO_DETAILS_LANDSCAPE = "landscape"; -const char* const VIDEO_DETAILS_GFX_DEFAULT = ":/gfx/pri_large_video.svg"; const char* const VIDEO_DETAILS_VIEW = "videofiledetailsview"; const char* const VIDEO_DETAILS_TITLE = "mLblTitle"; const char* const VIDEO_DETAILS_THUMBNAIL = "mDetailsLabel"; @@ -57,6 +65,11 @@ const char* const VIDEO_DETAILS_MENUACTION_DELETE = "mOptionsDelete"; const char* const VIDEO_DETAILS_LISTWIDGET = "mDetailsList"; +// Default thumbnail. +const char* const VIDEO_DETAILS_GFX_DEFAULT = "qtg_large_video"; + +const int VIDEO_DETAILS_SECONDARY_TEXT_ROW_COUNT = 255; + // --------------------------------------------------------------------------- // Constructor // --------------------------------------------------------------------------- @@ -136,6 +149,7 @@ spec.setRole( HbFontSpec::Primary ); mTitleAnim->setFontSpec( spec ); mTitleAnim->setLoopCount(-1); + mTitleAnim->setObjectName(VIDEO_DETAILS_OBJECT_NAME_TITLE_ANIM); connect(mModel->sourceModel(), SIGNAL(shortDetailsReady(TMPXItemId)), @@ -160,9 +174,9 @@ // no deallocation needed for this since // stackedwidget takes ownership mThumbLabel = new VideoDetailsLabel; - mThumbLabel->setAlignment(Qt::AlignCenter); - + mThumbLabel->setObjectName(VIDEO_DETAILS_OBJECT_NAME_THUMBLABEL); + connect(mThumbLabel, SIGNAL(clicked(bool)), this, SLOT(startPlaybackSlot())); thumbWidget->addWidget(mThumbLabel); @@ -183,6 +197,7 @@ ERROR(-1, "VideoFileDetailsViewPlugin::createView() failed to delete action."); return; } + deleteAction->setObjectName(VIDEO_DETAILS_OBJECT_NAME_DELETE_ACTION); if (mIsService) { @@ -195,7 +210,8 @@ // Create navigation keys. mNavKeyBackAction = new HbAction(Hb::BackNaviAction); - + mNavKeyBackAction->setObjectName(VIDEO_DETAILS_OBJECT_NAME_NAVKEY_BACK); + if (!mThumbnailManager) { mThumbnailManager = new ThumbnailManager(); @@ -212,7 +228,6 @@ } list->setEnabledAnimations(HbAbstractItemView::None); - } // --------------------------------------------------------------------------- @@ -484,19 +499,17 @@ list->clear(); } - //TODO: define maximum line count once >3 supported HbListViewItem *prototype = list->listItemPrototype(); - prototype->setSecondaryTextRowCount(1, 3); + prototype->setSecondaryTextRowCount(1, VIDEO_DETAILS_SECONDARY_TEXT_ROW_COUNT); for(int i = 0; i< detailCount; i++) { if (metadata.contains(VideoDetailLabelKeys[i])) { HbListWidgetItem* listWidgetItem = new HbListWidgetItem(); listWidgetItem->setEnabled(false); - - listWidgetItem->setText( hbTrId(VideoDetailLabels[i]) ); - listWidgetItem->setSecondaryText( metadata[VideoDetailLabelKeys[i]].toString() ); - list->addItem( listWidgetItem ); + listWidgetItem->setText( hbTrId(VideoDetailLabels[i])); + listWidgetItem->setSecondaryText(metadata[VideoDetailLabelKeys[i]].toString()); + list->addItem(listWidgetItem); } } @@ -578,8 +591,8 @@ HbMessageBox *messageBox = new HbMessageBox(text, HbMessageBox::MessageTypeQuestion); messageBox->setAttribute(Qt::WA_DeleteOnClose); + messageBox->setObjectName(VIDEO_DETAILS_OBJECT_NAME_DELETE_VIDEO); messageBox->open(this, SLOT(deleteVideoDialogFinished(HbAction *))); - } } } @@ -613,7 +626,6 @@ mModel->deleteItems(list); } - // --------------------------------------------------------------------------- // Slot: rowsRemovedSlot // --------------------------------------------------------------------------- @@ -643,7 +655,7 @@ QString msg(""); if(errorCode == VideoCollectionCommon::statusSingleDeleteFail) { - QString format = hbTrId("txt_videos_info_unable_to_delete_1_it_is_current"); + QString format = hbTrId("txt_videos_info_unable_to_delete_1_it_is_current"); if(additional.isValid()) { msg = format.arg(additional.toString()); @@ -652,7 +664,10 @@ if(msg.count() > 0) { // show msg box if there's something to show - HbMessageBox::warning(msg); + HbMessageBox *messageBox = new HbMessageBox(msg, HbMessageBox::MessageTypeWarning); + messageBox->setAttribute(Qt::WA_DeleteOnClose); + messageBox->setObjectName(VIDEO_DETAILS_OBJECT_NAME_MESSAGE_BOX_WARNING); + messageBox->show(); } } @@ -854,4 +869,4 @@ XQ_EXPORT_PLUGIN2( videofiledetailsview, VideoFileDetailsViewPlugin ); -// end of file +// End of file diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videofiledetailsview/tsrc/testplugin/src/testvideofiledetails.cpp --- a/videocollection/videofiledetailsview/tsrc/testplugin/src/testvideofiledetails.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videofiledetailsview/tsrc/testplugin/src/testvideofiledetails.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -47,7 +47,7 @@ #include "videofiledetailsviewplugin.h" #undef private -const char *TEST_VIDEO_DETAILS_GFX_DEFAULT = ":/gfx/pri_large_video.svg"; +const char *TEST_VIDEO_DETAILS_GFX_DEFAULT = "qtg_large_video"; const char *TEST_VIDEO_DETAILS_VIEW = "videofiledetailsview"; const char *TEST_VIDEO_DETAILS_WIDGET = "mContent"; const char *TEST_VIDEO_DETAILS_TITLE = "mLblTitle"; @@ -595,7 +595,7 @@ QVERIFY( deleteAction != 0 ); deleteAction->trigger(); - QCOMPARE( mDummyModel->dataAccessCount(), 0 ); + QCOMPARE( mDummyModel->dataAccessCount(), 0 ); mPlugin->mVideoId = (0,0); mDummyModel->setDataReturnInvalid(true); @@ -612,6 +612,8 @@ QCOMPARE( mDummyModel->dataAccessCount(), 2 ); QVERIFY( mDummyModel->lastIndex() == expected ); QCOMPARE( mDummyModel->deleteFileIndex(), -1 ); // verify that no file was deleted. + + HbMessageBox *msgBox = new HbMessageBox(); QStringList display; display.append("first row"); @@ -620,16 +622,15 @@ QString expectedText = hbTrId("txt_videos_info_do_you_want_to_delete_1").arg( display.first()); - - HbMessageBox::mQuestionReturnValue = true; deleteAction->trigger(); + msgBox->emitDialogFinished(mPlugin, SLOT(deleteVideoDialogFinished(HbAction *)), 0); // Yes selected QCOMPARE( mDummyModel->dataAccessCount(), 3 ); QVERIFY( mDummyModel->lastIndex() == expected ); QCOMPARE( mDummyModel->deleteFileIndex(), expected.row() ); QCOMPARE( HbMessageBox::mLatestTxt, expectedText ); - HbMessageBox::mQuestionReturnValue = false; deleteAction->trigger(); + msgBox->emitDialogFinished(mPlugin, SLOT(deleteVideoDialogFinished(HbAction *)), 1); // No selected QCOMPARE( mDummyModel->dataAccessCount(), 4 ); QVERIFY( mDummyModel->lastIndex() == expected ); QCOMPARE( mDummyModel->deleteFileIndex(), expected.row() ); @@ -637,13 +638,14 @@ mDummyModel->reset(); - HbMessageBox::mQuestionReturnValue = false; deleteAction->trigger(); + msgBox->emitDialogFinished(mPlugin, SLOT(deleteVideoDialogFinished(HbAction *)), 1); // No selected QCOMPARE( mDummyModel->dataAccessCount(), 1 ); QVERIFY( mDummyModel->lastIndex() == expected ); QCOMPARE( mDummyModel->deleteFileIndex(), -1 ); // verify that no file was deleted. QCOMPARE( HbMessageBox::mLatestTxt, expectedText ); + delete msgBox; cleanup(); } diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videofiledetailsview/tsrc/testplugin/stub/inc/hbmessagebox.h --- a/videocollection/videofiledetailsview/tsrc/testplugin/stub/inc/hbmessagebox.h Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videofiledetailsview/tsrc/testplugin/stub/inc/hbmessagebox.h Wed Jun 23 17:22:59 2010 +0100 @@ -19,23 +19,37 @@ #ifndef HBMESSAGEBOX_H #define HBMESSAGEBOX_H +#include #include +#include +#include + +class HbMessageBox : public QObject +{ + Q_OBJECT +public: -class HbMessageBox -{ - -public: + enum MessageBoxType { + MessageTypeInformation, + MessageTypeQuestion, + MessageTypeWarning + }; + + HbMessageBox(MessageBoxType type = MessageTypeInformation, QGraphicsItem *parent = 0); + HbMessageBox(const QString &text, MessageBoxType type = MessageTypeInformation, QGraphicsItem *parent = 0); + ~HbMessageBox(); + + void show(); /** - * saves provided text to mLatestTxt - * returns mQuestionReturnValue + * Create new HbMessageBox and call emitDialogFinished after this one to finish the sequence. */ - static bool question(QString text) - { - mLatestTxt = text; - return mQuestionReturnValue; - } + void open( QObject* receiver = 0, const char* member = 0 ); + + void emitDialogFinished( QObject* receiver, const char* member, int actionNum ); + + void setAttribute(int attribute); /** * saves provided text to mLatestTxt @@ -53,18 +67,26 @@ mLatestTxt = text; } - /** - * returned from question - */ - static bool mQuestionReturnValue; + QList actions() const + { + return mActions; + } /** * saved text */ static QString mLatestTxt; + static int mType; + static int mAttribute; + static int mOpenCallCount; + static int mShowCallCount; + + QList mActions; + +signals: + + void finished(HbAction *action); }; - - #endif // HBMESSAGEBOX_H diff -r 9b6761e5bd30 -r d3d3bd65fc7b videocollection/videofiledetailsview/tsrc/testplugin/stub/src/hbmessagebox.cpp --- a/videocollection/videofiledetailsview/tsrc/testplugin/stub/src/hbmessagebox.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videocollection/videofiledetailsview/tsrc/testplugin/stub/src/hbmessagebox.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -17,10 +17,65 @@ #include "hbmessagebox.h" -bool HbMessageBox::mQuestionReturnValue = false; +QString HbMessageBox::mLatestTxt = ""; +int HbMessageBox::mType = -1; +int HbMessageBox::mAttribute = -1; +int HbMessageBox::mOpenCallCount = 0; +int HbMessageBox::mShowCallCount = 0; -QString HbMessageBox::mLatestTxt = ""; +HbMessageBox::HbMessageBox(MessageBoxType type, QGraphicsItem *parent) +{ + Q_UNUSED(parent); + HbMessageBox::mType = type; + + HbAction *action = new HbAction(); + mActions.append(action); + action = new HbAction(); + mActions.append(action); +} + +HbMessageBox::HbMessageBox(const QString &text, MessageBoxType type, QGraphicsItem *parent) +{ + Q_UNUSED(parent); + HbMessageBox::mLatestTxt = text; + HbMessageBox::mType = type; + + HbAction *action = new HbAction(); + mActions.append(action); + action = new HbAction(); + mActions.append(action); +} +HbMessageBox::~HbMessageBox() +{ + while(!mActions.isEmpty()) + { + delete mActions.takeFirst(); + } +} +void HbMessageBox::show() +{ + HbMessageBox::mShowCallCount++; +} +void HbMessageBox::open( QObject* receiver, const char* member ) +{ + Q_UNUSED(receiver); + Q_UNUSED(member); + HbMessageBox::mOpenCallCount++; +} +void HbMessageBox::emitDialogFinished( QObject* receiver, const char* member, int actionNum ) +{ + if(connect(this, SIGNAL(finished(HbAction *)), receiver, member)) + { + emit finished(mActions.value(actionNum)); + disconnect(this, SIGNAL(finished(HbAction *)), receiver, member); + } +} + +void HbMessageBox::setAttribute(int attribute) +{ + HbMessageBox::mAttribute = attribute; +} diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackcontrol.hrh --- a/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackcontrol.hrh Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackcontrol.hrh Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 6 % +// Version : %version: 7 % #ifndef MPXVIDEOPLAYBACKCONTROL_HRH_ @@ -57,7 +57,6 @@ // // Bitmaps // - EMPXBlackBitmap, EMPXIndicatorBitmap, EMPXRealLogoBitmap, @@ -89,7 +88,8 @@ EMPXControlCmdSoftKeyPressed, EMPXControlCmdFullScreenViewOpened, EMPXControlCmdDetailsViewOpened, - EMPXControlCmdAudionOnlyViewOpened + EMPXControlCmdAudionOnlyViewOpened, + EMPXControlCmdRemoveRNLogo }; enum TMPXVideoSeekingType diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackfiledetailswidget.h --- a/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackfiledetailswidget.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackfiledetailswidget.h Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 10 % +// Version : %version: 11 % @@ -37,7 +37,6 @@ public: QMPXVideoPlaybackFileDetailsWidget( QMPXVideoPlaybackControlsController* controller ); virtual ~QMPXVideoPlaybackFileDetailsWidget(); - void initialize(); public: void updateWithFileDetails( QMPXVideoPlaybackViewFileDetails* details ); diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackprogressbar.h --- a/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackprogressbar.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackprogressbar.h Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: da1mmcf#11 % +// Version : %version: da1mmcf#12 % @@ -26,7 +26,6 @@ #include class QTimer; -class HbFrameItem; class HbProgressSlider; class QMPXVideoPlaybackViewFileDetails; class QMPXVideoPlaybackControlsController; @@ -59,7 +58,6 @@ private: QMPXVideoPlaybackControlsController *mController; HbProgressSlider *mProgressSlider; - HbFrameItem *mFrameItem; int mDuration; int mDraggingPosition; diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackstatuspanecontrol.h --- a/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackstatuspanecontrol.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackstatuspanecontrol.h Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 9 % +// Version : %version: 10 % @@ -28,7 +28,8 @@ class HbLabel; class HbAction; -class HbFrameItem; +class HbGroupBox; +class QGraphicsWidget; class QMPXVideoPlaybackViewFileDetails; class QMPXVideoPlaybackControlsController; @@ -73,7 +74,8 @@ bool mVisible; HbAction *mActionBack; HbLabel *mTitleLabel; - HbFrameItem *mFrameItem; + HbGroupBox *mTitleGroupBox; + QGraphicsWidget *mTitleLayout; }; #endif /*MPXVIDEOPLAYBACKSTATUSPANECONTROL_H_*/ diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybacktoolbar.h --- a/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybacktoolbar.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybacktoolbar.h Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 2 % +// Version : %version: 3 % @@ -114,7 +114,6 @@ TMPXSeekingState mSeekingState; bool mInitialized; - bool mNeverVisibled; int mPosition; int mDuration; int mAspectRatio; diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolconfiguration.cpp --- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolconfiguration.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolconfiguration.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: da1mmcf#19 % +// Version : %version: da1mmcf#20 % @@ -64,6 +64,8 @@ QMPXVideoPlaybackViewFileDetails* fileDetails = mControlsController->fileDetails(); + addControlToList( EMPXStatusPane ); + if ( fileDetails->mPlaybackMode == EMPXVideoStreaming || fileDetails->mPlaybackMode == EMPXVideoLiveStreaming ) { @@ -72,8 +74,10 @@ // addControlToList( EMPXBufferingAnimation ); } - - addControlToList( EMPXStatusPane ); + else if ( fileDetails->mRNFormat ) + { + addControlToList( EMPXRealLogoBitmap ); + } emit controlListUpdated(); } @@ -143,12 +147,12 @@ break; } - case EMPXControlCmdTvOutDisconnected: + case EMPXControlCmdRemoveRNLogo: { - break; - } - default: - { + MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::updateControlList() RN Logo removed")); + + deleteControlFromList( EMPXRealLogoBitmap ); + break; } } diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolpolicy.cpp --- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolpolicy.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolpolicy.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: da1mmcf#13 % +// Version : %version: da1mmcf#14 % @@ -127,6 +127,7 @@ } case EMPXFileDetailsWidget: case EMPXIndicatorBitmap: + case EMPXRealLogoBitmap: case EMPXDetailsViewPlaybackWindow: { // diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolscontroller.cpp --- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolscontroller.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolscontroller.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: da1mmcf#37 % +// Version : %version: da1mmcf#40 % @@ -26,18 +26,15 @@ #include #include -#include #include #include #include -#include -#include -#include #include #include #include #include +#include #include "mpxvideoviewwrapper.h" #include "hbvideobaseplaybackview.h" @@ -70,6 +67,7 @@ , mControlsPolicy( NULL ) , mControlsConfig( NULL ) , mControlsTimer( NULL ) + , mRNLogoTimer( NULL ) , mLoader( NULL ) , mVolumeControl( NULL ) , mThumbnailManager( NULL ) @@ -93,12 +91,22 @@ { MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::initializeController()")); + mOrientation = hbInstance->allMainWindows()[0]->orientation(); + bool ok = connect( hbInstance->allMainWindows()[0], SIGNAL( orientationChanged( Qt::Orientation ) ), + this, SLOT( handleOrientationChanged( Qt::Orientation ) ) ); + + MPX_DEBUG( + _L("QMPXVideoPlaybackControlsController::initializeController() orientation = %d, ok =%d"), + mOrientation, ok ); + setParent( mView ); + mView->hideItems( Hb::AllItems ); + // // Create layout loader // - bool ok = false; + ok = false; mLoader = new QMPXVideoPlaybackDocumentLoader( this ); mLoader->load( KMPXPLAYBACKVIEW_XML, &ok ); @@ -119,6 +127,8 @@ mLoader = NULL; } + mFileDetails->mRNFormat = realFormat( mFileDetails->mClipName ); + mControlsTimer = new QTimer( this ); mControlsTimer->setInterval( KMPXControlsTimeOut ); mControlsTimer->setSingleShot( false ); @@ -132,6 +142,9 @@ connect( mControlsConfig, SIGNAL( controlListUpdated() ), this, SLOT( controlsListUpdated() ) ); mControlsConfig->createControlList(); + // + // Create volume popup control + // mVolumeControl = new HbVolumeSliderPopup(); mVolumeControl->setVisible( false ); mVolumeControl->setTimeout( KMPXControlsTimeOut ); @@ -168,7 +181,6 @@ } } } - } // ------------------------------------------------------------------------------------------------- @@ -180,9 +192,10 @@ MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController()")); disconnect( mControlsConfig, SIGNAL( controlListUpdated() ), this, SLOT( controlsListUpdated() ) ); - disconnect( mView, SIGNAL( tappedOnScreen() ), this, SLOT( handleTappedOnScreen() ) ); disconnect( mControlsTimer, SIGNAL( timeout() ), this, SLOT( hideAllControls() ) ); + disconnect( hbInstance->allMainWindows()[0], SIGNAL( orientationChanged( Qt::Orientation ) ), + this, SLOT( handleOrientationChanged( Qt::Orientation ) ) ); mView->setWidget( NULL ); @@ -194,6 +207,14 @@ mControlsTimer = NULL; } + if ( mRNLogoTimer ) + { + disconnect( mRNLogoTimer, SIGNAL( timeout() ), this, SLOT( handleRNLogoTimeout() ) ); + + delete mRNLogoTimer; + mRNLogoTimer = NULL; + } + if ( mControlsPolicy ) { delete mControlsPolicy; @@ -241,7 +262,6 @@ mVideoServices->decreaseReferenceCount(); mVideoServices = 0; } - } // ------------------------------------------------------------------------------------------------- @@ -255,8 +275,6 @@ mFileDetails = details; - mFileDetails->mRNFormat = realFormat( mFileDetails->mClipName ); - mControlsConfig->updateControlsWithFileDetails(); // @@ -280,21 +298,6 @@ mVolumeControl->setValue( 0 ); mVolumeControl->setEnabled( false ); } - - // - // If title is not available, show clip name - // - QString title = mFileDetails->mTitle; - - if ( title.count() == 0 ) - { - QFileInfo fileInfo( mFileDetails->mClipName ); - title = fileInfo.baseName (); - } - - QGraphicsWidget *widget = mLoader->findWidget( QString( "title" ) ); - HbLabel *titleLabel = qobject_cast( widget ); - titleLabel->setPlainText( title ); } // ------------------------------------------------------------------------------------------------- @@ -487,7 +490,7 @@ // Control exists in new list. // myList.removeAt( index ); - i++; + i++; } } @@ -526,11 +529,27 @@ case EMPXBufferingAnimation: { // + // Load animation icons + // + QString animationName = ":/hbvideoplaybackview/animations/"; + + if ( mFileDetails->mRNFormat ) + { + animationName.append( "rn_preroll_anim.axml" ); + } + else + { + animationName.append( "generic_preroll_anim.axml" ); + } + + HbIconAnimationManager* manager = HbIconAnimationManager::global(); + bool ok = manager->addDefinitionFile( animationName ); + + MPX_DEBUG(_L(" EMPXBufferingAnimation add animation definition ok = %d"), ok); + + // // Buffering animation icon // - HbIconAnimationManager* manager = HbIconAnimationManager::global(); - manager->addDefinitionFile(":/hbvideoplaybackview/animation.axml"); - QGraphicsWidget *widget = mLoader->findWidget( QString( "bufferingIcon" ) ); HbLabel *bufferingAnim = qobject_cast( widget ); @@ -578,7 +597,6 @@ QGraphicsWidget *widget = mLoader->findWidget( QString( "fileDetailsLayout" ) ); QMPXVideoPlaybackFileDetailsWidget *fileDetails = qobject_cast( widget ); - fileDetails->initialize(); control = new QMPXVideoPlaybackFullScreenControl( this, controlIndex, @@ -602,6 +620,22 @@ break; } + case EMPXRealLogoBitmap: + { + QGraphicsWidget *widget = mLoader->findWidget( QString( "rnLogoBitmap" ) ); + HbWidget *bitmapWidget = qobject_cast( widget ); + + control = new QMPXVideoPlaybackFullScreenControl( this, + controlIndex, + bitmapWidget, + properties ); + mControls.append( control ); + + connect( bitmapWidget, SIGNAL( visibleChanged() ), + this, SLOT( handleRNLogoVisibleChanged() ) ); + + break; + } case EMPXDetailsViewPlaybackWindow: { QGraphicsWidget *widget = mLoader->findWidget( QString( "detailsPlaybackWindow" ) ); @@ -713,7 +747,7 @@ resetDisappearingTimers( EMPXTimerReset ); - if ( ! mViewTransitionIsGoingOn ) + if ( ! mViewTransitionIsGoingOn && mOrientation == Qt::Horizontal ) { for ( int i = 0 ; i < mControls.count() ; i++ ) { @@ -728,7 +762,7 @@ // bool QMPXVideoPlaybackControlsController::isVisible() { - bool visible = EFalse; + bool visible = false; for ( int i = 0 ; i < mControls.count() ; i++ ) { @@ -736,7 +770,7 @@ { if ( mControls[i]->isVisible() ) { - visible = ETrue; + visible = true; } break; @@ -877,7 +911,7 @@ // bool QMPXVideoPlaybackControlsController::realFormat( QString filename ) { - bool realFormat = EFalse; + bool realFormat = false; if ( !filename.isNull() && !filename.isEmpty() ) { @@ -904,7 +938,7 @@ // bool QMPXVideoPlaybackControlsController::realFormatForStreaming( const TDesC& des ) { - bool realFormat = EFalse; + bool realFormat = false; TParse filePath; _LIT(KMPXRMEXT, ".R" ); @@ -967,7 +1001,7 @@ // RealMedia Branding if ( ! buf.Compare( KMPXRMEXT ) ) { - realFormat = ETrue; + realFormat = true; } } @@ -992,7 +1026,7 @@ { realFormat = true; } - + MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::realFormatForLocal() [%d]"), realFormat); return realFormat; @@ -1046,9 +1080,9 @@ // QMPXVideoPlaybackControlsController::isSoftKeyVisible() // ------------------------------------------------------------------------------------------------- // -bool QMPXVideoPlaybackControlsController::isSoftKeyVisible( int /*value*/ ) +bool QMPXVideoPlaybackControlsController::isSoftKeyVisible() { - bool visible = EFalse; + bool visible = false; for ( int i = 0 ; i < mControls.count() ; i++ ) { @@ -1056,7 +1090,7 @@ { if ( mControls[i]->isVisible() ) { - visible = ETrue; + visible = true; } break; @@ -1345,18 +1379,6 @@ } // ------------------------------------------------------------------------------------------------- -// QMPXVideoPlaybackControlsController::isAttachOperation -// ------------------------------------------------------------------------------------------------- -// -bool QMPXVideoPlaybackControlsController::isAttachOperation() -{ - MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::isAttachOperation() ret %d"), - mIsAttachOperation ); - - return mIsAttachOperation; -} - -// ------------------------------------------------------------------------------------------------- // QMPXVideoPlaybackControlsController::attachVideo() // ------------------------------------------------------------------------------------------------- // @@ -1400,4 +1422,95 @@ dlg.send( fileList, true ); } +// ------------------------------------------------------------------------------------------------- +// QMPXVideoPlaybackControlsController::handleRNLogoVisibleChanged() +// ------------------------------------------------------------------------------------------------- +// +void QMPXVideoPlaybackControlsController::handleRNLogoVisibleChanged() +{ + MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::handleRNLogoVisibleChanged()")); + + QGraphicsWidget *widget = mLoader->findWidget( QString( "rnLogoBitmap" ) ); + + if ( widget->isVisible() ) + { + if ( mRNLogoTimer ) + { + delete mRNLogoTimer; + mRNLogoTimer = NULL; + } + + mRNLogoTimer = new QTimer( this ); + mRNLogoTimer->setInterval( KMPXRNLogoTimeOut ); + mRNLogoTimer->setSingleShot( true ); + connect( mRNLogoTimer, SIGNAL( timeout() ), this, SLOT( handleRNLogoTimeout() ) ); + + mRNLogoTimer->start(); + } +} + +// ------------------------------------------------------------------------------------------------- +// QMPXVideoPlaybackControlsController::handleRNLogoTimeout() +// ------------------------------------------------------------------------------------------------- +// +void QMPXVideoPlaybackControlsController::handleRNLogoTimeout() +{ + MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::handleRNLogoTimeout()")); + + if ( mRNLogoTimer->isActive() ) + { + mRNLogoTimer->stop(); + } + + // + // Remove RN logo from the controls list and issue play command if needed + // + mControlsConfig->updateControlList( EMPXControlCmdRemoveRNLogo ); + handleCommand( EMPXPbvCmdRealOneBitmapTimeout ); +} + +// ------------------------------------------------------------------------------------------------- +// QMPXVideoPlaybackControlsController::isRNLogoBitmapInControlList() +// ------------------------------------------------------------------------------------------------- +// +bool QMPXVideoPlaybackControlsController::isRNLogoBitmapInControlList() +{ + bool exist = false; + + // + // If we have a rn logo in the list, we are supposed to show the logo all the time + // unless we are in the middle of orientation transition + // + for ( int i = 0 ; i < mControls.count() ; i++ ) + { + if ( mControls[i]->controlIndex() == EMPXRealLogoBitmap ) + { + exist = true; + break; + } + } + + MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::isRNLogoBitmapInControlList() [%d]"), exist); + + return exist; +} + +// ------------------------------------------------------------------------------------------------- +// QMPXVideoPlaybackControlsController::handleOrientationChanged() +// ------------------------------------------------------------------------------------------------- +// +void QMPXVideoPlaybackControlsController::handleOrientationChanged( Qt::Orientation orientation ) +{ + MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::handleOrientationChanged()"), + _L("old orientation %d, new orientation = %d"), mOrientation, orientation ); + + Qt::Orientation oldOrientaiton = mOrientation; + mOrientation = orientation; + + if ( oldOrientaiton == Qt::Vertical && orientation == Qt::Horizontal ) + { + showControls(); + } +} + // End of File diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackfiledetailswidget.cpp --- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackfiledetailswidget.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackfiledetailswidget.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 23 % +// Version : %version: 25 % #include @@ -28,6 +28,7 @@ #include #include #include +#include #include "mpxvideo_debug.h" #include "mpxvideoplaybackdocumentloader.h" @@ -57,22 +58,6 @@ QMPXVideoPlaybackFileDetailsWidget::~QMPXVideoPlaybackFileDetailsWidget() { MPX_ENTER_EXIT(_L("QMPXVideoPlaybackFileDetailsWidget::~QMPXVideoPlaybackFileDetailsWidget()")); - - if ( mListWidget ) - { - delete mListWidget; - } -} - -// ------------------------------------------------------------------------------------------------- -// QMPXVideoPlaybackFileDetailsWidget::initialize -// ------------------------------------------------------------------------------------------------- -// -void QMPXVideoPlaybackFileDetailsWidget::initialize() -{ - MPX_ENTER_EXIT(_L("QMPXVideoPlaybackFileDetailsWidget::initialize")); - - updateWithFileDetails( mController->fileDetails() ); } // ------------------------------------------------------------------------------------------------- @@ -101,25 +86,24 @@ // HbListViewItem *prototype = mListWidget->listItemPrototype(); prototype->setSecondaryTextRowCount( 1, 30 ); - + + // + // Title + // + makeTitleItem( details ); + if ( ! mFileDetailsUpdated ) { HbExtendedLocale locale = HbExtendedLocale::system(); mFileDetailsUpdated = true; - - // - // Title - // - makeTitleItem( details ); - + // // Description // addItemToListWidget( hbTrId( "txt_videos_list_description" ), details->mDescription ); - // // Duration // @@ -132,11 +116,11 @@ value = value % 60; QString sec = locale.toString( value ); - addItemToListWidget( + addItemToListWidget( hbTrId( "txt_videos_list_duration" ), - hbTrId( "txt_videos_list_l1_l2_l3" ).arg( hour ).arg( min ).arg( sec ) ); + hbTrId( "txt_videos_list_l1l2l3" ).arg( hour ).arg( min ).arg( sec ) ); } - + // // Date/Time // @@ -146,27 +130,27 @@ // Location // addItemToListWidget( hbTrId( "txt_videos_list_location" ), details->mLocation ); - + // // Author // addItemToListWidget( hbTrId( "txt_videos_list_author" ), details->mArtist ); - + // // Copyright // addItemToListWidget( hbTrId( "txt_videos_list_copyright" ), details->mCopyright ); - + // // Language // addItemToListWidget( hbTrId( "txt_videos_list_language" ), details->mLanguage ); - + // // Keywords // addItemToListWidget( hbTrId( "txt_videos_list_keywords" ), details->mKeywords ); - + // // Size // @@ -182,17 +166,17 @@ .arg( locale.toString( details->mVideoHeight ) ); addItemToListWidget( hbTrId( "txt_videos_list_resolution" ), resolution ); } - + // // Format // addItemToListWidget( hbTrId( "txt_videos_list_format" ), details->mMimeType ); - + // // Bitrate // makeBitRateItem( details ); - + // // Folder // @@ -203,29 +187,44 @@ QString folder = fileInfo.dir().dirName(); addItemToListWidget( hbTrId( "txt_videos_list_collection_name" ), folder ); } - } // // Set the rect size dynamically based on the view mode // - QString sectionName; + QGraphicsWidget *content = loader->findWidget( QString( "content" ) ); + HbAnchorLayout *layout = static_cast( content->layout() ); - if ( mController->viewMode() == EDetailsView ) - { - sectionName = "detailsView"; - } - else if ( mController->viewMode() == EAudioOnlyView ) + if ( layout ) { - sectionName = "audioOnlyView"; - } + QGraphicsWidget *titleLayout = loader->findWidget( QString( "titleLayout" ) ); + QRectF titleRect = titleLayout->geometry(); + + switch ( mController->viewMode() ) + { + case EDetailsView: + { + layout->setAnchor( titleLayout, Hb::BottomEdge, this, Hb::TopEdge, 0 ); + layout->setAnchor( layout, Hb::BottomEdge, this, Hb::BottomEdge, 0 ); - bool ok = false; - loader->load( KMPXPLAYBACKVIEW_XML, sectionName, &ok ); + break; + } + case EAudioOnlyView: + { + QGraphicsWidget *controlLayout = loader->findWidget( QString( "controlBarLayout" ) ); + QRectF controlRect = controlLayout->geometry(); - if ( ! ok ) - { - MPX_DEBUG(_L("QMPXVideoPlaybackFileDetailsWidget failed to load section")); + layout->setAnchor( + this, Hb::TopEdge, titleLayout, + Hb::BottomEdge, titleRect.bottom() - titleRect.top() ); + + layout->setAnchor( + this, Hb::BottomEdge, + layout, Hb::BottomEdge, layout->geometry().height() - controlRect.top() ); + + break; + } + } } } } diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackprogressbar.cpp --- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackprogressbar.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackprogressbar.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: da1mmcf#21 % +// Version : %version: da1mmcf#23 % @@ -44,7 +44,6 @@ QMPXVideoPlaybackProgressBar::QMPXVideoPlaybackProgressBar( QMPXVideoPlaybackControlsController* controller ) : mController( controller ) - , mFrameItem( NULL ) , mDuration( -1 ) , mDraggingPosition( 0 ) , mSetPosition( -1 ) @@ -129,16 +128,14 @@ // positionChanged( 0 ); - // // Set framedrawer for semi transparent background // - mFrameItem = new HbFrameItem ( parentItem() ); - mFrameItem->setGeometry( boundingRect() ); - mFrameItem->frameDrawer().setFrameGraphicsName( "qtg_fr_multimedia_trans" ); - mFrameItem->frameDrawer().setFrameType( HbFrameDrawer::NinePieces ); - mFrameItem->frameDrawer().setFillWholeRect( true ); - mFrameItem->setVisible( false ); + HbFrameItem *frameItem = new HbFrameItem(); + frameItem->frameDrawer().setFrameGraphicsName( "qtg_fr_multimedia_trans" ); + frameItem->frameDrawer().setFrameType( HbFrameDrawer::NinePieces ); + frameItem->frameDrawer().setFillWholeRect( true ); + setBackgroundItem( frameItem ); } } @@ -366,8 +363,8 @@ { MPX_DEBUG(_L("QMPXVideoPlaybackProgressBar::updateControlsWithFileDetails()")); - if ( details->mPlaybackMode == EMPXVideoLiveStreaming ) - { + if ( ! details->mPausableStream || ! details->mSeekable ) + { mProgressSlider->setEnabled( false ); } else if ( ! mProgressSlider->isEnabled() ) @@ -375,7 +372,7 @@ mProgressSlider->setEnabled( true ); } - mFrameItem->setVisible( ( mController->viewMode() == EFullScreenView )? ETrue:EFalse ); + backgroundItem()->setVisible( ( mController->viewMode() == EFullScreenView )? ETrue:EFalse ); } // ------------------------------------------------------------------------------------------------- diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackstatuspanecontrol.cpp --- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackstatuspanecontrol.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackstatuspanecontrol.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,12 +15,16 @@ * */ -// Version : %version: 15 % +// Version : %version: 16 % + +#include + #include #include #include +#include #include #include #include @@ -45,10 +49,14 @@ TUint controlproperties ) : QMPXVideoPlaybackFullScreenControl( controller, index, widget, controlproperties ) , mActionBack( NULL ) - , mFrameItem( NULL ) + , mTitleLabel( NULL ) + , mTitleGroupBox( NULL ) + , mTitleLayout( NULL ) { MPX_ENTER_EXIT(_L("QMPXVideoPlaybackStatusPaneControl::QMPXVideoPlaybackStatusPaneControl()")); + Q_UNUSED( widget ); + mActionBack = new HbAction( Hb::BackNaviAction ); // @@ -59,9 +67,6 @@ connect( mController->view()->menu(), SIGNAL( aboutToShow() ), this, SLOT( handleAboutToShow() ) ); connect( mController->view()->menu(), SIGNAL( aboutToHide() ), this, SLOT( handleAboutToHide() ) ); - - QGraphicsWidget *widget1 = mController->layoutLoader()->findWidget( QString( "title" ) ); - mTitleLabel = qobject_cast( widget1 ); } // ------------------------------------------------------------------------------------------------- @@ -104,7 +109,7 @@ if ( mController->viewMode() == EFullScreenView || mController->viewMode() == EDetailsView ) { - mTitleLabel->setVisible( true ); + mTitleLayout->setVisible( true ); } } else @@ -113,7 +118,7 @@ mController->view()->setTitleBarVisible( false ); mController->view()->setStatusBarVisible( false ); - mTitleLabel->setVisible( false ); + mTitleLayout->setVisible( false ); } } @@ -164,6 +169,39 @@ { MPX_DEBUG(_L("QMPXVideoPlaybackStatusPaneControl::updateControlsWithFileDetails()")); + if ( ! mTitleLabel ) + { + // + // If title is not available, show clip name + // + QString title = mController->fileDetails()->mTitle; + + if ( title.count() == 0 ) + { + QFileInfo fileInfo( mController->fileDetails()->mClipName ); + title = fileInfo.baseName (); + } + + QGraphicsWidget *qWidget = mController->layoutLoader()->findWidget( QString( "title" ) ); + mTitleLabel = qobject_cast( qWidget ); + mTitleLabel->setPlainText( title ); + + qWidget = mController->layoutLoader()->findWidget( QString( "titleGroupBox" ) ); + mTitleGroupBox = qobject_cast( qWidget ); + mTitleGroupBox->setHeading( title ); + + mTitleLayout = mController->layoutLoader()->findWidget( QString( "titleLayout" ) ); + + // + // Set framedrawer for semi transparent background + // + HbFrameItem *frameItem = new HbFrameItem(); + frameItem->frameDrawer().setFrameGraphicsName( "qtg_fr_multimedia_trans" ); + frameItem->frameDrawer().setFrameType( HbFrameDrawer::NinePieces ); + frameItem->frameDrawer().setFillWholeRect( true ); + mTitleLabel->setBackgroundItem( frameItem ); + } + switch( mController->viewMode() ) { case EFullScreenView: @@ -176,6 +214,10 @@ mController->view()->setViewFlags( HbView::HbViewFlags( HbView::ViewTitleBarTransparent | HbView::ViewStatusBarTransparent ) ); + + mTitleLabel->setVisible( true ); + mTitleGroupBox->setVisible( false ); + break; } case EDetailsView: @@ -188,6 +230,9 @@ mController->view()->setViewFlags( HbView::ViewFlagNone ); + mTitleGroupBox->setVisible( true ); + mTitleLabel->setVisible( false ); + break; } case EAudioOnlyView: @@ -204,20 +249,6 @@ } setMenu( details ); - - // - // Set framedrawer for semi transparent background - // - if ( ! mFrameItem ) - { - mFrameItem = new HbFrameItem ( mTitleLabel ); - mFrameItem->frameDrawer().setFrameGraphicsName( "qtg_fr_multimedia_trans" ); - mFrameItem->frameDrawer().setFrameType( HbFrameDrawer::NinePieces ); - mFrameItem->frameDrawer().setFillWholeRect( true ); - } - - mFrameItem->setGeometry( mTitleLabel->boundingRect() ); - mFrameItem->setVisible( ( mController->viewMode() == EFullScreenView )? ETrue:EFalse ); } // ------------------------------------------------------------------------------------------------- diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybacktoolbar.cpp --- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybacktoolbar.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybacktoolbar.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 3 % +// Version : %version: 6 % @@ -51,7 +51,6 @@ , mRetrieveButtonTimer( NULL ) , mSeekingState( EMPXNotSeeking ) , mInitialized( false ) - , mNeverVisibled( true ) , mPosition( 0 ) , mDuration( 0 ) , mAspectRatio( EMPXPbvCmdNaturalAspectRatio ) @@ -206,7 +205,6 @@ TReal32 width = (TReal32) displayRect.Width(); TReal32 height = (TReal32) displayRect.Height(); mDisplayAspectRatio = (width > height)? (width / height) : (height / width); - } } @@ -408,7 +406,13 @@ mAspectRatio = aspectRatio; - if ( ! mController->isAttachOperation() ) + // + // If we are in attach service or audio only view, then don't update the icon. + // Aspect ratio icon slots are shared with attach and share icon. + // Just update the mAspectRatio + // and once we go back to full screen, we will show the correct aspect ratio icon + // + if ( ! mController->isAttachOperation() && mController->viewMode() == EFullScreenView ) { switch( mAspectRatio ) { @@ -500,7 +504,7 @@ if ( mButtons.count() ) { - disconnect( mButtons[EMPX1stButton], SIGNAL( released() ) ); + disconnect( mButtons[EMPX1stButton], SIGNAL( released() ), 0, 0 ); connect( mButtons[EMPX1stButton], SIGNAL( released() ), mController, SLOT( attachVideo() ) ); } @@ -539,7 +543,7 @@ if ( mButtons.count() ) { - disconnect( mButtons[EMPX1stButton], SIGNAL( released() ) ); + disconnect( mButtons[EMPX1stButton], SIGNAL( released() ), 0, 0 ); connect( mButtons[EMPX1stButton], SIGNAL( released() ), this, SLOT( changeAspectRatio() ) ); } @@ -569,7 +573,7 @@ if ( mButtons.count() ) { - disconnect( mButtons[EMPX1stButton], SIGNAL( released() ) ); + disconnect( mButtons[EMPX1stButton], SIGNAL( released() ), 0, 0 ); connect( mButtons[EMPX1stButton], SIGNAL( released() ), mController, SLOT( sendVideo() ) ); } @@ -590,25 +594,42 @@ mButtonActions[EMPX5thButton]->setEnabled( true ); } - if ( ! details->mSeekable ) - { - mButtonActions[EMPX2ndButton]->setEnabled( false ); - mButtonActions[EMPX4thButton]->setEnabled( false ); - } - else + if ( details->mSeekable && details->mPausableStream ) { mButtonActions[EMPX2ndButton]->setEnabled( true ); mButtonActions[EMPX4thButton]->setEnabled( true ); } + else + { + mButtonActions[EMPX2ndButton]->setEnabled( false ); + mButtonActions[EMPX4thButton]->setEnabled( false ); + } - if ( ! details->mPausableStream ) + if ( details->mPausableStream ) + { + mButtonActions[EMPX3rdButton]->setEnabled( true ); + } + else { mButtonActions[EMPX3rdButton]->setEnabled( false ); } - else + + // + // toolbar creates button once it gets visible, so we don't know exact timing when toolbar + // creates button, so start timer to get layout information once the toolbar gets visible. + // This is needed since we don't use toolbar in proper way. + // + if ( ! mRetrieveButtonTimer && ! mButtons.count() ) { - mButtonActions[EMPX3rdButton]->setEnabled( true ); - } + mRetrieveButtonTimer = new QTimer(); + mRetrieveButtonTimer->setSingleShot( false ); + mRetrieveButtonTimer->setInterval( KRetrieveButtonTimeOut ); + connect( mRetrieveButtonTimer, SIGNAL( timeout() ), this, SLOT( retrieveButtons() ) ); + + mRetrieveButtonTimer->start(); + } + + durationChanged( (qreal)mController->fileDetails()->mDuration / (qreal)KPbMilliMultiplier ); } // ------------------------------------------------------------------------------------------------- @@ -636,7 +657,6 @@ MPX_DEBUG(_L("QMPXVideoPlaybackToolBar::positionChanged position = %d"), position ); mPosition = position; - retrieveButtons(); } // ------------------------------------------------------------------------------------------------- @@ -661,24 +681,6 @@ if ( visible ) { mController->view()->showItems( Hb::ToolBarItem ); - - if ( mNeverVisibled ) - { - mNeverVisibled = false; - - - // - // toolbar creates button once it gets visible, so we don't know exact timing when toolbar - // creates button, so start timer to get layout information once the toolbar gets visible. - // This is needed since we don't use toolbar in proper way. - // - mRetrieveButtonTimer = new QTimer(); - mRetrieveButtonTimer->setSingleShot( false ); - mRetrieveButtonTimer->setInterval( KRetrieveButtonTimeOut ); - connect( mRetrieveButtonTimer, SIGNAL( timeout() ), this, SLOT( retrieveButtons() ) ); - - mRetrieveButtonTimer->start(); - } } else { @@ -700,10 +702,13 @@ if ( layout ) { - disconnect( mRetrieveButtonTimer, SIGNAL( timeout() ), this, SLOT( retrieveButtons() ) ); - if ( mRetrieveButtonTimer->isActive() ) + if ( mRetrieveButtonTimer ) { - mRetrieveButtonTimer->stop(); + disconnect( mRetrieveButtonTimer, SIGNAL( timeout() ), this, SLOT( retrieveButtons() ) ); + if ( mRetrieveButtonTimer->isActive() ) + { + mRetrieveButtonTimer->stop(); + } } for ( int i = 0 ; i < layout->count() ; i++ ) diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/inc/mpxvideoplaybackcontrolscontroller.h --- a/videoplayback/hbvideoplaybackview/inc/mpxvideoplaybackcontrolscontroller.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/inc/mpxvideoplaybackcontrolscontroller.h Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: da1mmcf#17 % +// Version : %version: da1mmcf#19 % @@ -73,6 +73,7 @@ }; const int KMPXControlsTimeOut = 4000; +const int KMPXRNLogoTimeOut = 600; const QString KMPXPLAYBACKVIEW_XML = ":/hbvideoplaybackview/hbvideoplaybackview.docml"; @@ -146,7 +147,9 @@ void changeViewMode( TPlaybackViewMode viewMode, bool transitionEffect = true ); - bool isAttachOperation(); + inline bool isAttachOperation(); + + bool isRNLogoBitmapInControlList(); private: /** @@ -230,9 +233,9 @@ void handleErrors(); /** - * Return ETrue if control is visible + * Return true if control is visible */ - bool isSoftKeyVisible( int value ); + bool isSoftKeyVisible(); /** * Handle tvout connected/disconnected event @@ -266,6 +269,9 @@ void controlsListUpdated(); void attachVideo(); void sendVideo(); + void handleRNLogoVisibleChanged(); + void handleRNLogoTimeout(); + void handleOrientationChanged( Qt::Orientation orientation ); private: HbVideoBasePlaybackView *mView; @@ -278,6 +284,7 @@ QMPXVideoPlaybackControlConfiguration *mControlsConfig; QTimer *mControlsTimer; + QTimer *mRNLogoTimer; QMPXVideoPlaybackDocumentLoader *mLoader; HbVolumeSliderPopup *mVolumeControl; @@ -292,6 +299,7 @@ TMPXPlaybackState mState; TPlaybackViewMode mViewMode; + Qt::Orientation mOrientation; }; // INLINE METHODS @@ -358,6 +366,19 @@ return mViewMode; } +// ------------------------------------------------------------------------------------------------- +// QMPXVideoPlaybackControlsController::isAttachOperation +// ------------------------------------------------------------------------------------------------- +// +inline +bool QMPXVideoPlaybackControlsController::isAttachOperation() +{ + MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::isAttachOperation() ret %d"), + mIsAttachOperation ); + + return mIsAttachOperation; +} + #endif /*MPXVIDEOPLAYBACKCONTROLSCONTROLLER_P_H_*/ // End of File diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/resources/animation.axml --- a/videoplayback/hbvideoplaybackview/resources/animation.axml Tue May 18 11:57:40 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ - - -qtg_anim_loading_1 -qtg_anim_loading_2 -qtg_anim_loading_3 -qtg_anim_loading_4 -qtg_anim_loading_5 -qtg_anim_loading_6 -qtg_anim_loading_7 -qtg_anim_loading_8 -qtg_anim_loading_9 -qtg_anim_loading_10 - - \ No newline at end of file diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/resources/animations/generic_preroll_anim.axml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videoplayback/hbvideoplaybackview/resources/animations/generic_preroll_anim.axml Wed Jun 23 17:22:59 2010 +0100 @@ -0,0 +1,14 @@ + + + qtg_anim_loading_1 + qtg_anim_loading_2 + qtg_anim_loading_3 + qtg_anim_loading_4 + qtg_anim_loading_5 + qtg_anim_loading_6 + qtg_anim_loading_7 + qtg_anim_loading_8 + qtg_anim_loading_9 + qtg_anim_loading_10 + + \ No newline at end of file diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/resources/animations/rn_preroll_anim.axml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videoplayback/hbvideoplaybackview/resources/animations/rn_preroll_anim.axml Wed Jun 23 17:22:59 2010 +0100 @@ -0,0 +1,13 @@ + + + qtg_anim_longtap_1 + qtg_anim_longtap_2 + qtg_anim_longtap_3 + qtg_anim_longtap_4 + qtg_anim_longtap_5 + qtg_anim_longtap_6 + qtg_anim_longtap_7 + qtg_anim_longtap_8 + qtg_anim_longtap_9 + + \ No newline at end of file diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/resources/hbvideoplaybackview.docml --- a/videoplayback/hbvideoplaybackview/resources/hbvideoplaybackview.docml Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/resources/hbvideoplaybackview.docml Wed Jun 23 17:22:59 2010 +0100 @@ -3,18 +3,70 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + - + @@ -39,7 +91,7 @@ - + @@ -62,7 +114,7 @@ - + @@ -83,60 +135,25 @@ - + - - + - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -145,22 +162,10 @@ - - - - - - - - - - - - - - - - + + + + @@ -169,34 +174,22 @@ + + + + + + + + + + + + + + -
- - - - - - - - - - - -
-
- - - - - - - - - - - -
diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/resources/hbvideoplaybackview.qrc --- a/videoplayback/hbvideoplaybackview/resources/hbvideoplaybackview.qrc Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/resources/hbvideoplaybackview.qrc Wed Jun 23 17:22:59 2010 +0100 @@ -1,7 +1,8 @@ - animation.axml + animations/rn_preroll_anim.axml + animations/generic_preroll_anim.axml hbvideoplaybackview.docml effects/controlbar_appear.fxml effects/controlbar_disappear.fxml diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testcontrolconfiguration/src/testcontrolconfiguration.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testcontrolconfiguration/src/testcontrolconfiguration.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testcontrolconfiguration/src/testcontrolconfiguration.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: % +// Version : %version: 4 % #include #include @@ -82,7 +82,6 @@ mControlsController = new QMPXVideoPlaybackControlsController( mFileDetails ); mControlConfig = new QMPXVideoPlaybackControlConfiguration( mControlsController ); - mControlConfig->createControlList(); } // --------------------------------------------------------------------------- @@ -121,11 +120,54 @@ MPX_ENTER_EXIT(_L("TestControlConfiguration::testControlList()")); setup(); - + + // + // Streaming case + // + mFileDetails->mPlaybackMode = EMPXVideoStreaming; + + mControlConfig->createControlList(); QList controlsList = mControlConfig->controlList(); - + + QVERIFY( controlsList.contains( EMPXStatusPane ) ); + QVERIFY( ! controlsList.contains( EMPXRealLogoBitmap ) ); + QVERIFY( controlsList.contains( EMPXBufferingAnimation ) ); + + cleanup(); + + // + // local + RN + // + setup(); + + mFileDetails->mPlaybackMode = EMPXVideoLocal; + mFileDetails->mRNFormat = true; + + mControlConfig->createControlList(); + controlsList = mControlConfig->controlList(); + QVERIFY( controlsList.contains( EMPXStatusPane ) ); - + QVERIFY( controlsList.contains( EMPXRealLogoBitmap ) ); + QVERIFY( ! controlsList.contains( EMPXBufferingAnimation ) ); + + cleanup(); + + // + // local + non RN + // + setup(); + + mFileDetails->mPlaybackMode = EMPXVideoLocal; + mFileDetails->mRNFormat = false; + + mControlConfig->createControlList(); + controlsList = mControlConfig->controlList(); + + QVERIFY( controlsList.contains( EMPXStatusPane ) ); + QVERIFY( ! controlsList.contains( EMPXRealLogoBitmap ) ); + QVERIFY( ! controlsList.contains( EMPXBufferingAnimation ) ); + + cleanup(); } // --------------------------------------------------------------------------- @@ -137,8 +179,11 @@ MPX_ENTER_EXIT(_L("TestControlConfiguration::testUpdateControlsWithFileDetails()")); setup(); - + mControlConfig->createControlList(); + + // // 1. test with mVideoEnabled = false + // mControlsController->mFileDetails->mVideoEnabled = false; mControlConfig->updateControlsWithFileDetails(); @@ -146,8 +191,10 @@ QList controlsList = mControlConfig->controlList(); QVERIFY( controlsList.contains( EMPXControlBar ) ); - + + // // 2. test with mVideoEnabled = true + // mControlsController->mFileDetails->mVideoEnabled = false; mControlConfig->updateControlsWithFileDetails(); @@ -158,6 +205,8 @@ mControlsController->layoutLoader()->findWidget( QString( "transparentWindow" ) ); QVERIFY( widget->isVisible() ); + + cleanup(); } // --------------------------------------------------------------------------- @@ -169,30 +218,48 @@ MPX_ENTER_EXIT(_L("TestControlConfiguration::testUpdateControlList()")); setup(); - + mControlConfig->createControlList(); + + // // 1. Test for Details View + // mControlConfig->updateControlList( EMPXControlCmdDetailsViewOpened ); - QList controlsList = mControlConfig->controlList(); QVERIFY( controlsList.contains( EMPXFileDetailsWidget ) ); + QVERIFY( controlsList.contains( EMPXDetailsViewPlaybackWindow ) ); + QVERIFY( ! controlsList.contains( EMPXIndicatorBitmap ) ); + // // 2. Test for Fullscreen View + // mControlConfig->updateControlList( EMPXControlCmdFullScreenViewOpened ); - controlsList = mControlConfig->controlList(); QVERIFY( ! controlsList.contains( EMPXFileDetailsWidget ) ); - - + QVERIFY( ! controlsList.contains( EMPXDetailsViewPlaybackWindow ) ); + QVERIFY( ! controlsList.contains( EMPXIndicatorBitmap ) ); + + // // 3. Test for Audio Only View + // mControlConfig->updateControlList( EMPXControlCmdAudionOnlyViewOpened ); - controlsList = mControlConfig->controlList(); QVERIFY( ! controlsList.contains( EMPXDetailsViewPlaybackWindow ) ); - QVERIFY( controlsList.contains( EMPXIndicatorBitmap ) ); + QVERIFY( controlsList.contains( EMPXIndicatorBitmap ) ); + QVERIFY( controlsList.contains( EMPXFileDetailsWidget ) ); + + // + // 4. RN log gets removed + // + mControlConfig->updateControlList( EMPXControlCmdAudionOnlyViewOpened ); + controlsList = mControlConfig->controlList(); + + QVERIFY( ! controlsList.contains( EMPXRealLogoBitmap ) ); + + cleanup(); } // End of file diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testcontrolconfiguration/stub/inc/mpxvideoplaybackviewfiledetails.h --- a/videoplayback/hbvideoplaybackview/tsrc/testcontrolconfiguration/stub/inc/mpxvideoplaybackviewfiledetails.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testcontrolconfiguration/stub/inc/mpxvideoplaybackviewfiledetails.h Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -70,7 +70,6 @@ bool mPartialPlayback; bool mRNFormat; bool mTvOutConnected; - bool mTvOutPlayAllowed; bool mDrmProtected; bool mMultiItemPlaylist; diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testcontrolconfiguration/stub/src/mpxvideoplaybackviewfiledetails.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testcontrolconfiguration/stub/src/mpxvideoplaybackviewfiledetails.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testcontrolconfiguration/stub/src/mpxvideoplaybackviewfiledetails.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -67,7 +67,6 @@ mDuration = 0; mTvOutConnected = false; - mTvOutPlayAllowed = true; mDrmProtected = false; mVideoHeight = 0; diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/stub/inc/mpxvideoplaybackviewfiledetails.h --- a/videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/stub/inc/mpxvideoplaybackviewfiledetails.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/stub/inc/mpxvideoplaybackviewfiledetails.h Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -70,7 +70,6 @@ bool mPartialPlayback; bool mRNFormat; bool mTvOutConnected; - bool mTvOutPlayAllowed; bool mDrmProtected; bool mMultiItemPlaylist; diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/stub/src/mpxvideoplaybackviewfiledetails.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/stub/src/mpxvideoplaybackviewfiledetails.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/stub/src/mpxvideoplaybackviewfiledetails.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -67,7 +67,6 @@ mDuration = 0; mTvOutConnected = false; - mTvOutPlayAllowed = true; mDrmProtected = false; mVideoHeight = 0; diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/stub/inc/mpxvideoplaybackviewfiledetails.h --- a/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/stub/inc/mpxvideoplaybackviewfiledetails.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/stub/inc/mpxvideoplaybackviewfiledetails.h Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -70,7 +70,6 @@ bool mPartialPlayback; bool mRNFormat; bool mTvOutConnected; - bool mTvOutPlayAllowed; bool mDrmProtected; bool mMultiItemPlaylist; diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/stub/src/mpxvideoplaybackfiledetailswidget.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/stub/src/mpxvideoplaybackfiledetailswidget.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/stub/src/mpxvideoplaybackfiledetailswidget.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -65,7 +65,7 @@ void QMPXVideoPlaybackFileDetailsWidget::updateWithFileDetails( QMPXVideoPlaybackViewFileDetails* details ) { - + Q_UNUSED( details ); } diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/stub/src/mpxvideoplaybackviewfiledetails.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/stub/src/mpxvideoplaybackviewfiledetails.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/stub/src/mpxvideoplaybackviewfiledetails.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -67,7 +67,6 @@ mDuration = 0; mTvOutConnected = false; - mTvOutPlayAllowed = true; mDrmProtected = false; mVideoHeight = 0; diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/inc/mpxvideoplaybackviewfiledetails.h --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/inc/mpxvideoplaybackviewfiledetails.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/inc/mpxvideoplaybackviewfiledetails.h Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -70,7 +70,6 @@ bool mPartialPlayback; bool mRNFormat; bool mTvOutConnected; - bool mTvOutPlayAllowed; bool mDrmProtected; bool mMultiItemPlaylist; diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/src/hbeffect.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/src/hbeffect.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/src/hbeffect.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 2 % +// Version : %version: 3 % @@ -100,6 +100,7 @@ MPX_DEBUG(_L("HbEffect::effectRunning")); Q_UNUSED( item ); + Q_UNUSED( effectEvent ); return false; } diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/src/mpxvideoplaybackviewfiledetails.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/src/mpxvideoplaybackviewfiledetails.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/src/mpxvideoplaybackviewfiledetails.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -67,7 +67,6 @@ mDuration = 0; mTvOutConnected = false; - mTvOutPlayAllowed = true; mDrmProtected = false; mVideoHeight = 0; diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolpolicy/stub/inc/mpxvideoplaybackviewfiledetails.h --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolpolicy/stub/inc/mpxvideoplaybackviewfiledetails.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolpolicy/stub/inc/mpxvideoplaybackviewfiledetails.h Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -70,7 +70,6 @@ bool mPartialPlayback; bool mRNFormat; bool mTvOutConnected; - bool mTvOutPlayAllowed; bool mDrmProtected; bool mMultiItemPlaylist; diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolpolicy/stub/src/mpxvideoplaybackviewfiledetails.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolpolicy/stub/src/mpxvideoplaybackviewfiledetails.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolpolicy/stub/src/mpxvideoplaybackviewfiledetails.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -67,7 +67,6 @@ mDuration = 0; mTvOutConnected = false; - mTvOutPlayAllowed = true; mDrmProtected = false; mVideoHeight = 0; diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdocumentloader/stub/src/mpxvideoplaybackcontrolscontroller.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdocumentloader/stub/src/mpxvideoplaybackcontrolscontroller.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdocumentloader/stub/src/mpxvideoplaybackcontrolscontroller.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -67,6 +67,7 @@ { MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::changeViewMode()")); + Q_UNUSED( transitionEffect ); mViewMode = viewMode; } diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/inc/mpxvideoplaybackviewfiledetails.h --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/inc/mpxvideoplaybackviewfiledetails.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/inc/mpxvideoplaybackviewfiledetails.h Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 2 % +// Version : %version: 3 % @@ -70,7 +70,6 @@ bool mPartialPlayback; bool mRNFormat; bool mTvOutConnected; - bool mTvOutPlayAllowed; bool mDrmProtected; bool mMultiItemPlaylist; diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/src/hbglobal.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/src/hbglobal.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/src/hbglobal.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 2 % +// Version : %version: 3 % @@ -89,7 +89,7 @@ { loc = "Bitrate"; } - else if ( string == "txt_videos_list_l1_l2_l3" ) + else if ( string == "txt_videos_list_l1l2l3" ) { loc = "%L1 hr %L2 min %L3 sec"; } diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/src/mpxvideoplaybackdocumentloader.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/src/mpxvideoplaybackdocumentloader.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/src/mpxvideoplaybackdocumentloader.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -88,6 +88,12 @@ object->setObjectName( name ); mWidgets.append( object ); } + else if ( name == "content" ) + { + object = new QGraphicsWidget(); + object->setObjectName( name ); + mWidgets.append( object ); + } return object; } diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/src/mpxvideoplaybackviewfiledetails.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/src/mpxvideoplaybackviewfiledetails.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/src/mpxvideoplaybackviewfiledetails.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 2 % +// Version : %version: 3 % @@ -67,7 +67,6 @@ mDuration = 0; mTvOutConnected = false; - mTvOutPlayAllowed = true; mDrmProtected = false; mVideoHeight = 0; diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybacktoolbar/src/testmpxvideoplaybacktoolbar.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybacktoolbar/src/testmpxvideoplaybacktoolbar.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybacktoolbar/src/testmpxvideoplaybacktoolbar.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 2 % +// Version : %version: 4 % #include @@ -33,9 +33,9 @@ #include "mpxvideoplaybacktoolbar.h" #undef private -// --------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // main -// --------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // int main(int argc, char *argv[]) { @@ -49,17 +49,16 @@ char *pass[3]; pass[0] = argv[0]; pass[1] = "-o"; - pass[2] = "c:\\data\\TestMPXVideoPlaybackToolBar.txt"; + pass[2] = "c:\\data\\testmpxvideoplaybacktoolbar.txt"; int res = QTest::qExec(&tv, 3, pass); return res; } - -// --------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // init -// --------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // void TestMPXVideoPlaybackToolBar::init( bool attachOperation ) { @@ -69,14 +68,15 @@ mVideoToolBar = new QMPXVideoPlaybackToolBar( mController ); mVideoToolBar->setVisible( true ); + connect( this, SIGNAL( commandSignal() ), mVideoToolBar, SLOT( retrieveButtons() ) ); emit commandSignal(); disconnect( this, SIGNAL( commandSignal() ), mVideoToolBar, SLOT( retrieveButtons() ) ); } -// --------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // cleanup -// --------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // void TestMPXVideoPlaybackToolBar::cleanup() { @@ -95,9 +95,9 @@ } } -// --------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // testPlay -// --------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // void TestMPXVideoPlaybackToolBar::testPlay() { @@ -113,9 +113,9 @@ cleanup(); } -// --------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // testLongTapOnFF -// --------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // void TestMPXVideoPlaybackToolBar::testLongTapOnFF() { @@ -148,9 +148,9 @@ cleanup(); } -// --------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // testLongTapOnRW -// --------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // void TestMPXVideoPlaybackToolBar::testLongTapOnRW() { @@ -183,9 +183,9 @@ cleanup(); } -// --------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // testShortTapOnFF -// --------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // void TestMPXVideoPlaybackToolBar::testShortTapOnFF() { @@ -217,9 +217,9 @@ cleanup(); } -// --------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // testShortTapOnRW -// --------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // void TestMPXVideoPlaybackToolBar::testShortTapOnRW() { @@ -250,9 +250,9 @@ cleanup(); } -// --------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // testPause -// --------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // void TestMPXVideoPlaybackToolBar::testPause() { @@ -268,9 +268,9 @@ cleanup(); } -// --------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // testChangeAspectRatio -// --------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // void TestMPXVideoPlaybackToolBar::testChangeAspectRatio() { @@ -308,9 +308,9 @@ cleanup(); } -// --------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // testUpdateState -// --------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // void TestMPXVideoPlaybackToolBar::testUpdateState() { @@ -345,9 +345,9 @@ cleanup(); } -// --------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // testAspectRatioChanged -// --------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // void TestMPXVideoPlaybackToolBar::testAspectRatioChanged() { @@ -379,9 +379,9 @@ cleanup(); } -// --------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // testHandleButtonPressed -// --------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // void TestMPXVideoPlaybackToolBar::testHandleButtonPressed() { @@ -396,9 +396,9 @@ cleanup(); } -// --------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // testUpdateWithFileDetails -// --------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // void TestMPXVideoPlaybackToolBar::testUpdateWithFileDetails() { @@ -418,7 +418,6 @@ details->mVideoHeight = 1; details->mVideoWidth = 1; details->mTvOutConnected = false; - details->mTvOutPlayAllowed = true; details->mSeekable = true; details->mPausableStream = true; mController->mViewMode = EFullScreenView; @@ -455,15 +454,14 @@ details->mVideoHeight = 0; details->mVideoWidth = 1; details->mTvOutConnected = true; - details->mTvOutPlayAllowed = true; details->mSeekable = false; - details->mPausableStream = false; + details->mPausableStream = true; mVideoToolBar->updateWithFileDetails( details ); QVERIFY( mVideoToolBar->mButtons[EMPX1stButton]->isEnabled() == false ); QVERIFY( mVideoToolBar->mButtons[EMPX2ndButton]->isEnabled() == false ); - QVERIFY( mVideoToolBar->mButtons[EMPX3rdButton]->isEnabled() == false ); + QVERIFY( mVideoToolBar->mButtons[EMPX3rdButton]->isEnabled() == true ); QVERIFY( mVideoToolBar->mButtons[EMPX4thButton]->isEnabled() == false ); QVERIFY( mVideoToolBar->mButtons[EMPX5thButton]->isEnabled() == false ); @@ -474,8 +472,7 @@ details->mVideoHeight = 0; details->mVideoWidth = 1; details->mTvOutConnected = true; - details->mTvOutPlayAllowed = true; - details->mSeekable = false; + details->mSeekable = true; details->mPausableStream = false; mController->mViewMode = EAudioOnlyView; @@ -493,6 +490,8 @@ details->mVideoEnabled = false; details->mPlaybackMode = EMPXVideoStreaming; mController->mViewMode = EAudioOnlyView; + details->mSeekable = false; + details->mPausableStream = false; mVideoToolBar->updateWithFileDetails( details ); @@ -516,7 +515,6 @@ details->mVideoHeight = 1; details->mVideoWidth = 1; details->mTvOutConnected = false; - details->mTvOutPlayAllowed = true; details->mSeekable = true; details->mPausableStream = true; @@ -531,9 +529,9 @@ cleanup(); } -// --------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // testOpenDetailsView -// --------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // void TestMPXVideoPlaybackToolBar::testOpenDetailsView() { @@ -558,9 +556,9 @@ cleanup(); } -// --------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // testAttach -// --------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // void TestMPXVideoPlaybackToolBar::testAttach() { @@ -608,9 +606,9 @@ } -// --------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // testSend -// --------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // void TestMPXVideoPlaybackToolBar::testSend() { diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybacktoolbar/stub/inc/mpxvideoplaybackviewfiledetails.h --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybacktoolbar/stub/inc/mpxvideoplaybackviewfiledetails.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybacktoolbar/stub/inc/mpxvideoplaybackviewfiledetails.h Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -70,7 +70,6 @@ bool mPartialPlayback; bool mRNFormat; bool mTvOutConnected; - bool mTvOutPlayAllowed; bool mDrmProtected; bool mMultiItemPlaylist; diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybacktoolbar/stub/src/mpxvideoplaybackviewfiledetails.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybacktoolbar/stub/src/mpxvideoplaybackviewfiledetails.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybacktoolbar/stub/src/mpxvideoplaybackviewfiledetails.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -67,7 +67,6 @@ mDuration = 0; mTvOutConnected = false; - mTvOutPlayAllowed = true; mDrmProtected = false; mVideoHeight = 0; diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/inc/testmpxvideoviewwrapper.h --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/inc/testmpxvideoviewwrapper.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/inc/testmpxvideoviewwrapper.h Wed Jun 23 17:22:59 2010 +0100 @@ -29,28 +29,23 @@ { Q_OBJECT -public: + public: - /** - * will be called before each testfunction is executed. - * - */ - void init(); + /** + * will be called before each testfunction is executed. + * + */ + void init(); - /** - * will be called after every testfunction. - * - */ - void cleanup(); + /** + * will be called after every testfunction. + * + */ + void cleanup(); - // test functions for the test framework - - -private slots: - + private slots: // the order in which these testXX methods are declared is important // changing this order will affect the test results - void testRequestMedia(); void testIsLive(); void testIsPlaylist(); @@ -62,7 +57,6 @@ void testRetrieveFileNameAndMode(); void testActivateClosePlayerActiveObject(); void testDoClosePlayer(); - void testIssuePlayCommand(); void testSetAspectRatio(); void testIsAppInFront(); void testClosePlaybackView(); @@ -75,26 +69,17 @@ void testUpdateVideoRectDone(); void testHandleBufferingState(); void testHandleVideoPlaybackMessage(); - void testCreateGeneralPlaybackCommand(); void testHandlePlaybackCommandComplete(); void testHandleMedia(); - - -signals: - - void commandSignal(int); + signals: + void commandSignal(int); -private: - CMPXVideoViewWrapper* mVideoViewWrapper; - HbVideoBasePlaybackView* mBaseVideoView; - + private: + CMPXVideoViewWrapper *mVideoViewWrapper; + HbVideoBasePlaybackView *mBaseVideoView; }; - #endif // __TESTMPXVIDEOVIEWWRAPPER_H__ // End of file - - - diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/src/testmpxvideoviewwrapper.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/src/testmpxvideoviewwrapper.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/src/testmpxvideoviewwrapper.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,6 +15,8 @@ * */ +// Version : %version: 7 % + #include #include @@ -34,12 +36,10 @@ #include "../stub/inc/hbvideobaseplaybackview.h" #include "../stub/inc/mpxvideoplaybackviewfiledetails.h" -#include "../stub/inc/mpxplaybackutilityimpl.h" #include "../stub/inc/mpxvideoplaybackdisplayhandler.h" #include "../stub/inc/mpxvideoplaybackcontrolscontroller.h" - #define protected public #include "mpxvideoviewwrapper.h" #undef protected @@ -59,23 +59,22 @@ char *pass[3]; pass[0] = argv[0]; pass[1] = "-o"; - pass[2] = "c:\\data\\TestMPXVideoViewWrapper.txt"; + pass[2] = "c:\\data\\testmpxvideoviewwrapper.txt"; int res = QTest::qExec(&tv, 3, pass); return res; } - // --------------------------------------------------------------------------- // init // --------------------------------------------------------------------------- // void TestMPXVideoViewWrapper::init() { - mBaseVideoView = new HbVideoBasePlaybackView(); - TRAPD( err, mVideoViewWrapper = CMPXVideoViewWrapper::NewL( mBaseVideoView ) ); - QVERIFY( err == KErrNone ); + mBaseVideoView = new HbVideoBasePlaybackView(); + TRAPD( err, mVideoViewWrapper = CMPXVideoViewWrapper::NewL( mBaseVideoView ) ); + QVERIFY( err == KErrNone ); } // --------------------------------------------------------------------------- @@ -84,14 +83,19 @@ // void TestMPXVideoViewWrapper::cleanup() { - delete mVideoViewWrapper; - mVideoViewWrapper = NULL; - - delete mBaseVideoView; - mBaseVideoView = NULL; + if ( mVideoViewWrapper ) + { + delete mVideoViewWrapper; + mVideoViewWrapper = NULL; + } + + if ( mBaseVideoView ) + { + delete mBaseVideoView; + mBaseVideoView = NULL; + } } - void TestMPXVideoViewWrapper::testRequestMedia() { init(); @@ -99,10 +103,9 @@ TRAPD(err, mVideoViewWrapper->RequestMediaL()); QVERIFY( err == KErrNone ); - QVERIFY( mVideoViewWrapper->iMediaRequested == true ); + QVERIFY( mVideoViewWrapper->iMediaRequestStatus == MediaRequested ); cleanup(); - } void TestMPXVideoViewWrapper::testIsLive() @@ -112,51 +115,202 @@ TRAPD(err, mVideoViewWrapper->RequestMediaL()); QVERIFY( err == KErrNone ); - mVideoViewWrapper->IsLive(); - - mVideoViewWrapper->iFileDetails->clearFileDetails(); - + mVideoViewWrapper->iFileDetails->mPlaybackMode = EMPXVideoLiveStreaming; + QVERIFY( mVideoViewWrapper->IsLive() ); + + mVideoViewWrapper->iFileDetails->mPlaybackMode = EMPXVideoLocal; QVERIFY( ! mVideoViewWrapper->IsLive() ); cleanup(); } - void TestMPXVideoViewWrapper::testIsPlaylist() { init(); - mVideoViewWrapper->IsPlaylist(); - - QVERIFY( mVideoViewWrapper->IsPlaylist() == false ); + mVideoViewWrapper->iPlaylistView = true; + QVERIFY( mVideoViewWrapper->IsPlaylist() == true ); - cleanup(); + mVideoViewWrapper->iPlaylistView = false; + QVERIFY( mVideoViewWrapper->IsPlaylist() == false ); + cleanup(); } - void TestMPXVideoViewWrapper::testHandleCommand() { init(); - TRAPD(errReqMedia, mVideoViewWrapper->RequestMediaL()); + TRAPD( errReqMedia, mVideoViewWrapper->RequestMediaL() ); QVERIFY( errReqMedia == KErrNone ); + + // + // Test 'Play' command + // + TRAPD( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdPlay ) ); + QVERIFY( errHdlCmd == KErrNone ); + QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdPlay ); - TRAPD(errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdPlay )); + // + // Test 'Pause' command + // + TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdPause ) ); QVERIFY( errHdlCmd == KErrNone ); + QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdPause ); + + // + // Test 'Close' command + // + TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdClose ) ); + QVERIFY( errHdlCmd == KErrNone ); + QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdClose ); + + // + // Test 'Seek Forward' command + // + TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdSeekForward ) ); + QVERIFY( errHdlCmd == KErrNone ); + QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdStartVideoSeekingForward ); - int state; - TRAPD(errState, state = mVideoViewWrapper->iPlaybackUtility->StateL()); - QVERIFY( errState == KErrNone ); + // + // Test 'Seek Backward' command + // + TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdSeekBackward ) ); + QVERIFY( errHdlCmd == KErrNone ); + QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdStartVideoSeekingBackward ); + + // + // Test 'End Seek' command + // + TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdEndSeek ) ); + QVERIFY( errHdlCmd == KErrNone ); + QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdStopVideoSeeking ); + + // + // Test 'PlayPause' command + // + TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdPlayPause ) ); + QVERIFY( errHdlCmd == KErrNone ); + QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdPlayPause ); + + // + // Test 'Stop' command + // + TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdStop ) ); + QVERIFY( errHdlCmd == KErrNone ); + QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdStop ); + + // + // Test 'Decrease Volume' command + // + TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdDecreaseVolume ) ); + QVERIFY( errHdlCmd == KErrNone ); + QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdHandleDecreaseVolume ); + + // + // Test 'Increase Volume' command + // + TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdIncreaseVolume ) ); + QVERIFY( errHdlCmd == KErrNone ); + QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdHandleIncreaseVolume ); + + // + // Test 'Natural Aspect Ratio' command + // + TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdNaturalAspectRatio ) ); + QVERIFY( errHdlCmd == KErrNone ); + QVERIFY( mVideoViewWrapper->iDisplayHandler->iCommand == EPbCmdNaturalAspectRatio ); + + // + // Test 'Zoom Aspect Ratio' command + // + TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdZoomAspectRatio ) ); + QVERIFY( errHdlCmd == KErrNone ); + QVERIFY( mVideoViewWrapper->iDisplayHandler->iCommand == EPbCmdZoomAspectRatio ); + + // + // Test 'Stretch Aspect Ratio' command + // + TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdStretchAspectRatio ) ); + QVERIFY( errHdlCmd == KErrNone ); + QVERIFY( mVideoViewWrapper->iDisplayHandler->iCommand == EPbCmdStretchAspectRatio ); - QVERIFY( state == EPbStatePlaying ); + // + // Test 'Mute' command + // + TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdMute ) ); + QVERIFY( errHdlCmd == KErrNone ); + QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdMuteVolume ); + + // + // Test 'Un-mute' command + // + TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdUnMute ) ); + QVERIFY( errHdlCmd == KErrNone ); + QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdUnMuteVolume ); + + // + // Test 'Short Press Backward' command + // + TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdShortPressBackward ) ); + QVERIFY( errHdlCmd == KErrNone ); + QVERIFY( mVideoViewWrapper->iPlaybackUtility->iProperty == EPbPropertyPosition ); + + // + // Test 'Reset Controls' command + // + TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdResetControls ) ); + QVERIFY( errHdlCmd == KErrNone ); + QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdInitView ); + + // + // Test 'Next List Item' command + // + mVideoViewWrapper->iPlaylistView = true; + mVideoViewWrapper->iFileDetails->mMultiItemPlaylist = true; + TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdNextListItem ) ); + QVERIFY( errHdlCmd == KErrNone ); + QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdNext ); + + // + // Test 'Previous List Item' command + // + TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdPreviousListItem ) ); + QVERIFY( errHdlCmd == KErrNone ); + QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdPrevious ); + + // + // Test 'End Of Clip' command + // + TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdEndOfClip ) ); + QVERIFY( errHdlCmd == KErrNone ); + QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdEndofClipReached ); + + // + // Test 'Custom Pause' command + // + TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdCustomPause ) ); + QVERIFY( errHdlCmd == KErrNone ); + QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdCustomPause ); + + // + // Test 'Custom Play' command + // + TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdCustomPlay ) ); + QVERIFY( errHdlCmd == KErrNone ); + QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdCustomPlay ); + + // + // Test 'RealOne Bitmap Timeout' command + // + mVideoViewWrapper->iMediaRequestStatus = MediaDelivered; + TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdRealOneBitmapTimeout ) ); + QVERIFY( errHdlCmd == KErrNone ); + QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdPlay ); cleanup(); - } - - void TestMPXVideoViewWrapper::testHandlePluginError() { init(); @@ -169,10 +323,8 @@ QVERIFY( mVideoViewWrapper->iView->mCurrentError == KErrNotSupported ); cleanup(); - } - void TestMPXVideoViewWrapper::testHandlePlaybackMessage() { init(); @@ -187,7 +339,6 @@ message->SetTObjectValueL ( KMPXMediaVideoPlaybackCommand, EPbCmdTvOutEvent ); message->SetTObjectValueL( KMPXMediaVideoTvOutConnected, ETrue ); - message->SetTObjectValueL( KMPXMediaVideoTvOutPlayAllowed, EFalse ); ); mVideoViewWrapper->HandlePlaybackMessage( message, KErrNone ); QVERIFY( mVideoViewWrapper->iFileDetails->mTvOutConnected ); @@ -197,8 +348,6 @@ message = NULL; } - - //*************************** // Test General Msg //*************************** @@ -216,8 +365,7 @@ delete message; message = NULL; } - - + //*************************** // Test Video Msg with err //*************************** @@ -233,276 +381,300 @@ cleanup(); } +void TestMPXVideoViewWrapper::testSetProperty() +{ + init(); -void TestMPXVideoViewWrapper::testSetProperty() + TRAPD( errReqMedia, mVideoViewWrapper->RequestMediaL()) ; + QVERIFY( errReqMedia == KErrNone ); + + TMPXPlaybackProperty property = EPbPropertyMute; + TInt propertyValue = 1; + + TRAPD( errSetProp, mVideoViewWrapper->SetPropertyL( property, propertyValue ) ); + QVERIFY( errSetProp == KErrNone ); + + QVERIFY( mVideoViewWrapper->iPlaybackUtility->iProperty == property ); + QVERIFY( mVideoViewWrapper->iPlaybackUtility->iPropertyValue == propertyValue ); + + cleanup(); +} + +void TestMPXVideoViewWrapper::testHandleProperty() { init(); TRAPD(errReqMedia, mVideoViewWrapper->RequestMediaL()); QVERIFY( errReqMedia == KErrNone ); - - TRAPD(errSetProp, mVideoViewWrapper->SetPropertyL( EPbPropertyMute, 1 ) ); // 0=>noraml 1=>muted - QVERIFY( errSetProp == KErrNone ); - - QVERIFY( ! mVideoViewWrapper->iFileDetails->mAudioEnabled ); - + + // + // Duration + // + int value = 5000; + TRAPD(errHdlProp, mVideoViewWrapper->HandlePropertyL( EPbPropertyDuration, value, KErrNone ) ); + QVERIFY( errHdlProp == KErrNone ); + + QVERIFY( mVideoViewWrapper->iControlsController->mReceivedEvent == EMPXControlCmdSetDuration ); + QVERIFY( mVideoViewWrapper->iControlsController->mValue == value ); + + // + // Position + // + value = 500; + + TRAP(errHdlProp, mVideoViewWrapper->HandlePropertyL( EPbPropertyPosition, value, KErrNone ) ); + QVERIFY( errHdlProp == KErrNone ); + + QVERIFY( mVideoViewWrapper->iControlsController->mReceivedEvent == EMPXControlCmdSetPosition ); + QVERIFY( mVideoViewWrapper->iControlsController->mValue == value ); + + // + // Volume + // + value = 10; + + TRAP(errHdlProp, mVideoViewWrapper->HandlePropertyL( EPbPropertyVolume, value, KErrNone ) ); + QVERIFY( errHdlProp == KErrNone ); + + QVERIFY( mVideoViewWrapper->iControlsController->mReceivedEvent == EMPXControlCmdSetVolume ); + QVERIFY( mVideoViewWrapper->iControlsController->mValue == value ); + + // + // Mute + // + value = 1; + + TRAP(errHdlProp, mVideoViewWrapper->HandlePropertyL( EPbPropertyMute, value, KErrNone ) ); + QVERIFY( errHdlProp == KErrNone ); + + QVERIFY( mVideoViewWrapper->iControlsController->mReceivedEvent == EMPXControlCmdSetVolume ); + QVERIFY( mVideoViewWrapper->iControlsController->mValue == 0 ); + cleanup(); } - -void TestMPXVideoViewWrapper::testHandleProperty() -{ - init(); - - TRAPD(errReqMedia, mVideoViewWrapper->RequestMediaL()); - QVERIFY( errReqMedia == KErrNone ); - - TRAPD(errHdlProp, mVideoViewWrapper->HandlePropertyL( EPbPropertyDuration, 5000, KErrNone )); - QVERIFY( errHdlProp == KErrNone ); - - QVERIFY( mVideoViewWrapper->iFileDetails->mDuration == 5000 ); - - cleanup(); -} - - void TestMPXVideoViewWrapper::testRetrieveFileNameAndMode() { init(); - + mVideoViewWrapper->iFileDetails->clearFileDetails(); - + CMPXCommand* cmd = NULL; TRAP_IGNORE( cmd = CMPXCommand::NewL() ); - TRAPD(errRetFileName, mVideoViewWrapper->RetrieveFileNameAndModeL( cmd ) ); - QVERIFY( errRetFileName == KErrNone ); - - int state; - TRAPD(errState, state = mVideoViewWrapper->iPlaybackUtility->StateL()); - QVERIFY( errState == KErrNone ); - - QVERIFY( state == EPbStateInitialised ); - - QCOMPARE( mVideoViewWrapper->iFileDetails->mClipName, QString("testClip.3gp")); - - delete cmd; - cmd = NULL; - + if ( cmd ) + { + TRAPD(errRetFileName, mVideoViewWrapper->RetrieveFileNameAndModeL( cmd ) ); + QVERIFY( errRetFileName == KErrNone ); + + QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdInitView ); + + QCOMPARE( mVideoViewWrapper->iFileDetails->mClipName, QString("testClip.3gp")); + + delete cmd; + cmd = NULL; + } + cleanup(); } - void TestMPXVideoViewWrapper::testActivateClosePlayerActiveObject() { init(); - + mVideoViewWrapper->ActivateClosePlayerActiveObject(); - + QVERIFY( mVideoViewWrapper->iCloseAO->IsActive() ); - + cleanup(); } - void TestMPXVideoViewWrapper::testDoClosePlayer() { init(); - + TRAPD(err, mVideoViewWrapper->DoClosePlayerL()); QVERIFY( err == KErrNone ); - + QVERIFY( ! mVideoViewWrapper->iView->mViewActive ); - + cleanup(); } - -void TestMPXVideoViewWrapper::testIssuePlayCommand() -{ - init(); - TRAPD(errReqMedia, mVideoViewWrapper->RequestMediaL()); - QVERIFY( errReqMedia == KErrNone ); - - TRAPD(errIssuePlay, mVideoViewWrapper->IssuePlayCommandL()); - QVERIFY( errIssuePlay == KErrNone ); - - - int state; - TRAPD(errState, state = mVideoViewWrapper->iPlaybackUtility->StateL()); - QVERIFY( errState == KErrNone ); - - QVERIFY( state == EPbStatePlaying ); - - cleanup(); -} - - void TestMPXVideoViewWrapper::testSetAspectRatio() { init(); - TRAPD(errReqMedia, mVideoViewWrapper->RequestMediaL()); + TRAPD( errReqMedia, mVideoViewWrapper->RequestMediaL() ); QVERIFY( errReqMedia == KErrNone ); - - TRAPD(errHdlCmd, mVideoViewWrapper->HandleCommandL(EMPXPbvCmdStretchAspectRatio)); + + TRAPD( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdStretchAspectRatio ) ); QVERIFY( errHdlCmd == KErrNone ); - - QVERIFY( mVideoViewWrapper->iDisplayHandler->iCurrentIndexForAspectRatio == 1 ); - + + QVERIFY( mVideoViewWrapper->iDisplayHandler->iAspectRatio == EMMFStretch ); + cleanup(); } - void TestMPXVideoViewWrapper::testIsAppInFront() { init(); - + TRAPD(errReqMedia, mVideoViewWrapper->RequestMediaL()); QVERIFY( errReqMedia == KErrNone ); - + bool front = false; - TRAPD(errIsAppInFrnt, front = mVideoViewWrapper->IsAppInFrontL()); - + TRAPD( errIsAppInFrnt, front = mVideoViewWrapper->IsAppInFrontL() ); + QVERIFY( errIsAppInFrnt == KErrNone ); - + cleanup(); } - void TestMPXVideoViewWrapper::testClosePlaybackView() { init(); - + TRAPD(err, mVideoViewWrapper->ClosePlaybackViewL()); QVERIFY( err == KErrNone ); - + QVERIFY( ! mVideoViewWrapper->iView->mViewActive ); - + cleanup(); } - void TestMPXVideoViewWrapper::testHandleVolumeCmd() { init(); - - TRAPD(errReqMedia, mVideoViewWrapper->RequestMediaL()); + + TRAPD( errReqMedia, mVideoViewWrapper->RequestMediaL() ); QVERIFY( errReqMedia == KErrNone ); - - TRAPD(errIssuePlay, mVideoViewWrapper->IssuePlayCommandL()); + + TRAPD( errIssuePlay, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdPlay ) ); + QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdPlay ); QVERIFY( errIssuePlay == KErrNone ); - - TRAPD(errHdlCmd, mVideoViewWrapper->HandleCommandL(EMPXPbvCmdDecreaseVolume)); + + TRAPD( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdDecreaseVolume ) ); + QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdHandleDecreaseVolume ); QVERIFY( errHdlCmd == KErrNone ); - + QVERIFY( mVideoViewWrapper->iFileDetails->mAudioEnabled ); - + cleanup(); } - void TestMPXVideoViewWrapper::testHandleShortPressBackward() { init(); - - TRAPD(errReqMedia, mVideoViewWrapper->RequestMediaL()); + + TRAPD( errReqMedia, mVideoViewWrapper->RequestMediaL() ); QVERIFY( errReqMedia == KErrNone ); - - TRAPD(errIssuePlay, mVideoViewWrapper->IssuePlayCommandL()); + + TRAPD( errIssuePlay, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdPlay ) ); + QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdPlay ); QVERIFY( errIssuePlay == KErrNone ); - - TRAPD(errHdlCmd, mVideoViewWrapper->HandleCommandL(EMPXPbvCmdShortPressBackward)); + + TRAPD( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdShortPressBackward ) ); + QVERIFY( mVideoViewWrapper->iPlaybackUtility->iProperty == EPbPropertyPosition ); + QVERIFY( mVideoViewWrapper->iPlaybackUtility->iPropertyValue == 0 ); + QVERIFY( errHdlCmd == KErrNone ); - + cleanup(); } - void TestMPXVideoViewWrapper::testIssueVideoAppForegroundCmd() { init(); - - TRAPD(errReqMedia, mVideoViewWrapper->RequestMediaL()); + + TRAPD( errReqMedia, mVideoViewWrapper->RequestMediaL() ); QVERIFY( errReqMedia == KErrNone ); - - TRAPD(errIssuePlay, mVideoViewWrapper->IssuePlayCommandL()); + + TRAPD( errIssuePlay, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdPlay ) ); + QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdPlay ); + QVERIFY( errIssuePlay == KErrNone ); - - TRAPD(errIssueVidAppFGCmd, mVideoViewWrapper->IssueVideoAppForegroundCmdL( ETrue )); + + // + // test foreground + // + TRAPD( errIssueVidAppFGCmd, mVideoViewWrapper->IssueVideoAppForegroundCmdL( ETrue ) ); + QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdHandleForeground ); QVERIFY( errIssueVidAppFGCmd == KErrNone ); - + + // + // test background + // + TRAP( errIssueVidAppFGCmd, mVideoViewWrapper->IssueVideoAppForegroundCmdL( EFalse ) ); + QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdHandleBackground ); + QVERIFY( errIssueVidAppFGCmd == KErrNone ); + cleanup(); } - void TestMPXVideoViewWrapper::testCreateControls() { init(); - + TRAPD(err, mVideoViewWrapper->CreateControlsL()); QVERIFY( err == KErrNone ); - + QVERIFY( mVideoViewWrapper->iControlsController ); - + cleanup(); } - void TestMPXVideoViewWrapper::testIsMultiItemPlaylist() { init(); - + TRAPD(errReqMedia, mVideoViewWrapper->RequestMediaL()); QVERIFY( errReqMedia == KErrNone ); - + QVERIFY( ! mVideoViewWrapper->IsMultiItemPlaylist() ); - + cleanup(); } - void TestMPXVideoViewWrapper::testUpdateVideoRect() { init(); - + TRAPD(errReqMedia, mVideoViewWrapper->RequestMediaL()); QVERIFY( errReqMedia == KErrNone ); - - mVideoViewWrapper->UpdateVideoRect(0,0,50,50,false); - - float brY = 50; - - QCOMPARE(mVideoViewWrapper->iDisplayHandler->iBrYDiff, brY); - + + TRect rect( 0, 0, 50, 50 ); + + mVideoViewWrapper->UpdateVideoRect( + rect.iTl.iX, rect.iTl.iY, rect.iBr.iX, rect.iBr.iY, false ); + + QVERIFY( rect == mVideoViewWrapper->iDisplayHandler->iRect ); + cleanup(); } void TestMPXVideoViewWrapper::testUpdateVideoRectDone() { init(); - + TRAPD(errReqMedia, mVideoViewWrapper->RequestMediaL()); QVERIFY( errReqMedia == KErrNone ); - + mVideoViewWrapper->UpdateVideoRectDone(); - + cleanup(); } - - void TestMPXVideoViewWrapper::testHandleBufferingState() { init(); - + TRAPD(err, mVideoViewWrapper->HandleBufferingStateL()); QVERIFY( err == KErrNone ); - + cleanup(); } - void TestMPXVideoViewWrapper::testHandleVideoPlaybackMessage() { init(); @@ -528,27 +700,11 @@ cleanup(); } - - - -void TestMPXVideoViewWrapper::testCreateGeneralPlaybackCommand() -{ - init(); - - TRAPD(err, mVideoViewWrapper->CreateGeneralPlaybackCommandL( EPbCmdDecreaseVolume )); - QVERIFY( err == KErrNone ); - - QVERIFY( ! mVideoViewWrapper->iFileDetails->mAudioEnabled ); - - cleanup(); -} - - void TestMPXVideoViewWrapper::testHandlePlaybackCommandComplete() { init(); - CMPXCommand* cmd = NULL; + CMPXCommand* cmd = NULL; TRAP_IGNORE( cmd = CMPXCommand::NewL() ); @@ -562,13 +718,15 @@ cleanup(); } - void TestMPXVideoViewWrapper::testHandleMedia() { init(); CMPXMedia* media = NULL; - + + // + // Error case + // TRAP_IGNORE( RArray suppIds; CleanupClosePushL( suppIds ); @@ -578,27 +736,92 @@ media = CMPXMedia::NewL( suppIds.Array() ); CleanupStack::PopAndDestroy( &suppIds ); - media->SetTObjectValueL( TMPXAttribute( KMPXMediaVideoError ), - KErrCancel ); + media->SetTObjectValueL( TMPXAttribute( KMPXMediaVideoError ), KErrCancel ); ); - TRAPD(err, mVideoViewWrapper->HandleMediaL( *media, KErrNone ) ); + TRAPD( err, mVideoViewWrapper->HandleMediaL( *media, KErrNone ) ); QVERIFY( err == KErrNone ); QCOMPARE( mVideoViewWrapper->iView->mCurrentError, KErrCancel ); + QVERIFY( ! mVideoViewWrapper->iControlsController->mFileDetailsAdded ); + QVERIFY( mVideoViewWrapper->iMediaRequestStatus == MediaNotRequested ); if ( media ) { delete media; media = NULL; } - - + + // + // working case - RN logo is not visible + // + TRAP_IGNORE( + RArray suppIds; + CleanupClosePushL( suppIds ); + suppIds.AppendL( KMPXMediaIdGeneral ); + suppIds.AppendL( KMPXMediaIdVideo ); + + media = CMPXMedia::NewL( suppIds.Array() ); + CleanupStack::PopAndDestroy( &suppIds ); + ); + + mVideoViewWrapper->iView->mCurrentError = KErrNone; + mVideoViewWrapper->iFileDetails->mVideoEnabled = true; + mVideoViewWrapper->iDisplayHandler->SetAspectRatioL( EPbCmdNaturalAspectRatio ); + mVideoViewWrapper->iControlsController->mRNLogoVisible = false; + + TRAP(err, mVideoViewWrapper->HandleMediaL( *media, KErrNone ) ); + + QVERIFY( err == KErrNone ); + QCOMPARE( mVideoViewWrapper->iView->mCurrentError, KErrNone ); + QVERIFY( mVideoViewWrapper->iControlsController->mFileDetailsAdded ); + QVERIFY( mVideoViewWrapper->iControlsController->mReceivedEvent == EMPXControlCmdSetAspectRatio ); + QVERIFY( mVideoViewWrapper->iControlsController->mValue == EMMFNatural ); + QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdPlay ); + QVERIFY( mVideoViewWrapper->iMediaRequestStatus == MediaDelivered ); + + if ( media ) + { + delete media; + media = NULL; + } + + // + // working case - RN logo is visible + // + TRAP_IGNORE( + RArray suppIds; + CleanupClosePushL( suppIds ); + suppIds.AppendL( KMPXMediaIdGeneral ); + suppIds.AppendL( KMPXMediaIdVideo ); + + media = CMPXMedia::NewL( suppIds.Array() ); + CleanupStack::PopAndDestroy( &suppIds ); + ); + + mVideoViewWrapper->iFileDetails->mVideoEnabled = false; + mVideoViewWrapper->iPlaybackUtility->iCommand = EPbCmdPause; + mVideoViewWrapper->iControlsController->mFileDetailsAdded = false; + mVideoViewWrapper->iDisplayHandler->SetAspectRatioL( EPbCmdZoomAspectRatio ); + mVideoViewWrapper->iControlsController->mRNLogoVisible = true; + + TRAP(err, mVideoViewWrapper->HandleMediaL( *media, KErrNone ) ); + + QVERIFY( err == KErrNone ); + QVERIFY( ! mVideoViewWrapper->iControlsController->mFileDetailsAdded ); + QVERIFY( mVideoViewWrapper->iControlsController->mReceivedEvent == EMPXControlCmdSetAspectRatio ); + QVERIFY( mVideoViewWrapper->iControlsController->mValue == EMMFNatural ); + QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdPause ); + QCOMPARE( mVideoViewWrapper->iView->mCurrentError, KErrNone ); + QVERIFY( mVideoViewWrapper->iMediaRequestStatus == MediaDelivered ); + + if ( media ) + { + delete media; + media = NULL; + } + cleanup(); } - // End of file - - - diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/hbvideobaseplaybackview.h --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/hbvideobaseplaybackview.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/hbvideobaseplaybackview.h Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 3 % +// Version : %version: 5 % @@ -76,6 +76,8 @@ virtual void doClosePlayer(); + void handleStoppedState(); + signals: void tappedOnScreen(); @@ -85,6 +87,7 @@ public: int mCurrentError; // default = KErrNone bool mViewActive; + bool mSyncClose; public: diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxplaybackutility.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxplaybackutility.h Wed Jun 23 17:22:59 2010 +0100 @@ -0,0 +1,111 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "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: Implementation of interface for playbackutility +* +*/ + +// Version : %version: 2 % + +#ifndef CMPXPLAYBACKUTILITY_H +#define CMPXPLAYBACKUTILITY_H + +#include +#include +#include +#include +#include + +class TMPXAttribute; +class MMPXPlaybackObserver; +class CMPXCollectionPlaylist; +class MMPXPlaybackCallback; +class CMPXPlaybackUtility; + +class MMPXSource +{ + public: + virtual CMPXCollectionPlaylist* PlaylistL() = 0; + + virtual void MediaL( const TArray& aAttrs, + MMPXPlaybackCallback& aCallback, + CMPXAttributeSpecs* aSpecs ) = 0; + +}; + +class MMPXPlaybackUtility : public CBase +{ + public: + static MMPXPlaybackUtility* UtilityL( const TMPXCategory aCategory, + const TUid& aModeId = KPbModeDefault ); + + virtual TMPXPlaybackState StateL() const = 0; + virtual void AddObserverL( MMPXPlaybackObserver& aObs ) = 0; + virtual void CommandL( CMPXCommand& aCmd, MMPXPlaybackCallback* aCallback=NULL ) = 0; + virtual void CommandL( TMPXPlaybackCommand aCmd ) = 0; + virtual MMPXSource* Source() = 0; + virtual void PropertyL( MMPXPlaybackCallback& aCallback, TMPXPlaybackProperty aProperty ) = 0; + virtual void RemoveObserverL( MMPXPlaybackObserver& aObs ) = 0; + virtual void Close() = 0; + virtual void SetPrimaryClientL() = 0; + virtual void SetL( TMPXPlaybackProperty aProperty,TInt aValue ) = 0; + + public: + TMPXPlaybackState iState; + TMPXPlaybackProperty iProperty; + TInt iPropertyValue; + TInt iCommand; +}; + +class CMPXPlaybackUtility : public MMPXPlaybackUtility, + public MMPXSource +{ + public: + + static CMPXPlaybackUtility* NewL(); + + ~CMPXPlaybackUtility(); + + private: + + CMPXPlaybackUtility(); + + void ConstructL(); + + void AddObserverL( MMPXPlaybackObserver& aObs ); + + void RemoveObserverL( MMPXPlaybackObserver& aObs ); + + void Close(); + + void CommandL( CMPXCommand& aCmd, MMPXPlaybackCallback* aCallback ); + void CommandL( TMPXPlaybackCommand aCmd ); + + TMPXPlaybackState StateL() const; + + MMPXSource* Source(); + + void SetL( TMPXPlaybackProperty aProperty,TInt aValue ); + + void PropertyL( MMPXPlaybackCallback& aCallback, TMPXPlaybackProperty aProperty ); + + CMPXCollectionPlaylist* PlaylistL(); + + void MediaL( const TArray& aAttrs, + MMPXPlaybackCallback& aCallback, + CMPXAttributeSpecs* aSpecs ); + + void SetPrimaryClientL(); +}; + +#endif // CMPXPLAYBACKUTILITY_H diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxplaybackutilityimpl.h --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxplaybackutilityimpl.h Tue May 18 11:57:40 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,655 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "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: Implementation of interface for playbackutility -* -*/ - - - -#ifndef CMPXPLAYBACKUTILITY_H -#define CMPXPLAYBACKUTILITY_H - -#include -#include -#include -#include -#include -#include -#include "mpxplaybackutility.h" - -class CMPXMessageMonitor; -class CMPXTaskQueue; - -NONSHARABLE_STRUCT( TMPXPlaybackUtilityStruct ) - { - // Default mode playback utility - MMPXPlaybackUtility* iDefaultPlaybackUtility; - }; - -/** -* Implementation of playback utility interface -* this interface: -*/ -NONSHARABLE_CLASS(CMPXPlaybackUtility) : public MMPXPlaybackUtility, - public MMPXSource - { -public: - /** - * Two-phased constructor - * - * @param aModeId playback mode id - * @param aObs observer - * @param aCategory category of client / engine - * @return object of constructed - */ - static CMPXPlaybackUtility* NewL(const TUid& aModeId, - MMPXPlaybackObserver* aObs, - const TMPXCategory aCategory); - - /** - * Gets the interface for the client, or creates a new one. - * This interface could be a singleton - */ - static MMPXPlaybackUtility* UtilityL( const TUid& aModeId, - const TMPXCategory aCategory); - -private: - /** - * Destructor - */ - ~CMPXPlaybackUtility(); - - /** - * C++ constructor - */ - CMPXPlaybackUtility(); - - /** - * Second phase constructor - * - * @param aModeId playback mode id - * @param aObs observer - * @param aCategory category of client / engine - */ - void ConstructL(const TUid& aModeId, MMPXPlaybackObserver* aObs, const TMPXCategory aCategory); - /** - * Second phase constructor - * - * @param aObs observer - */ - void ConstructL(MMPXPlaybackObserver* aObs); - - /** - * From MMPXPlaybackUtility - * Add a Observer. Clients only receive events from the engine corresponding - * to the specific mode the interface was created in - * - * @param aObs, observer to be added - */ - void AddObserverL(MMPXPlaybackObserver& aObs); - - /** - * From MMPXPlaybackUtility - * Remove a observer. - * - * @param aObs, observer to be removed - */ - void RemoveObserverL(MMPXPlaybackObserver& aObs); - - /** - * From MMPXPlaybackUtility - * Returns PIds of clients that are using the engine in the mode this - * interface was created in. For example, if a client was interested in all - * the clients' pids with an active engine, they would: - * - * MMPXPlaybackUtility* m=MMPXPlaybackUtility::NewL(EActivePlayer); - * RArray pids; - * m->GetClients(pids); - * ......... - * pids->Close(); - * m->Close(); - * - * @param aClients Array of Pids returned. - */ - void GetClientsL(RArray& aClients); - - /** - * From MMPXPlaybackUtility - * Initializes a track given by aCollectionPath - * - * @param aCollectionPath collection path - * @param aPlay Whether to initialize for playback, or - * else just to setup the engine first - */ - virtual void InitL(const CMPXCollectionPlaylist& aPlaylist, - TBool aPlay=ETrue); - - /** - * From MMPXPlaybackUtility - * Inititialises with a single item, may not be part of any collection - * - * @param aUri URI of the item - * @param aType the mime type of the item - */ - void InitL(const TDesC& aUri,const TDesC8* aType=NULL); - - /** - * From MMPXPlaybackUtility - * Inititialises with a single item, may not be part of any collection - * Before this function can be called, the file server session which owns - * this file handle must first be marked as shareable by calling - * RFs::ShareProtected(). - * - * @param aFile file handle - */ - void InitL(RFile& aShareableFile); - - /** - * From MMPXPlaybackUtility - * Frees up client side resources only; a player is freed when there are no - * clients using it, and all resources are freed when the last client closed - */ - void Close(); - - /** - * From MMPXPlaybackUtility - * Stops any async operations that are currently under way - */ - void CancelRequest(); - - /** - * From MMPXPlaybackUtility - * Issue player commands, with optional data. ECommandReceived and - * ECommandComplete events should follow - * - * @param aCmd the command - * @param aData optional data - */ - void CommandL(TMPXPlaybackCommand aCmd,TInt aData=0); - - /** - * From MMPXPlaybackUtility - * Send a command to the playback server - * - * @param aCmd, reference to command object - * @param aCallback, call back when command exection completed. - * Asynchronously command only - */ - void CommandL(CMPXCommand& aCmd, MMPXPlaybackCallback* aCallback=NULL); - - /** - * From MMPXPlaybackUtility - * Current state of player - * @return current state - */ - TMPXPlaybackState StateL() const; - - /** - * From MMPXPlaybackUtility - * Current source being played, NULL if none was supplied - * - * @return source object - */ - MMPXSource* Source(); - - /** - * From MMPXPlaybackUtility - * Player manager - * - * @return reference to player manager - */ - MMPXPlayerManager& PlayerManager(); - - /** - * From MMPXPlaybackUtility - * Set playback property, EPropertyChanged event when complete - * - * @param aProperty the property to be set - * @param aValue the the value of the property - */ - void SetL(TMPXPlaybackProperty aProperty,TInt aValue); - - /** - * From MMPXPlaybackUtility - * Get value of a playback property, Asyc - * - * @param aCallback playback callback - * @param aProperty the property - */ - void ValueL(MMPXPlaybackCallback& aCallback,TMPXPlaybackProperty aProperty); - - /** - * Get value of a playback property, Asyc - * Result will be called back in HandleProperty - * - * @param aCallback playback callback - * @param aProperty the property - */ - void PropertyL(MMPXPlaybackCallback& aCallback, - TMPXPlaybackProperty aProperty); - - /** - * From MMPXPlaybackUtility - * Return a list of mime types supported by playback framework - * - * @return an array of mime types - */ - virtual CDesCArray* SupportedMimeTypes(); - - /** - * From MMPXPlaybackUtility - * Return a list of file extensions supported by playback framework - * - * @return an array of extensions - */ - virtual CDesCArray* SupportedExtensions(); - - /** - * From MMPXPlaybackUtility - * Return a list of schemas supported by playback framework - * - * @return an array of schemas - */ - virtual CDesCArray* SupportedSchemas(); - - /** - * Sets the priority of the playback utility - * - * @param aPriority Priority to set - */ - virtual void SetPriority( TInt aPriority ); - - /** - * Adds a message subscription for this client. - * @param aSubscription subscription to be added - */ - void AddSubscriptionL(const CMPXSubscription& aSubscription); - - /** - * Removes a message subscription for this client. - * @param aSubscription subscription to be removed. - */ - void RemoveSubscriptionL(const CMPXSubscription& aSubscription); - - /** - * Removes all message subscriptions for this client. - */ - void ClearSubscriptionsL(); - - /** - * From MMPXPlayerManager - * Typically, a client will obtain the list of all the (non-duplicated) - * player 'types' in the system from GetPlayerTypesL and present localized - * type names (e.g. "Local","Home network", if possible, else if - * non-standard type,should use PlayerTypeDisplayNameL to get text from - * player). - * - * User should be given opportunity to choose IF there is more than one - * type available, or if there is one type but more than one sub players, - * the user could be presented with the sub player list. - * - * @param aTypes the list of player types - */ - void GetPlayerTypesL(RArray& aTypes); - - /** - * From MMPXPlayerManager - * Returns display name for custom types; standard types should be - * recognized by client and localized - calling this method would then not - * be required - * - * @param aType playback type - */ - HBufC* PlayerTypeDisplayNameL(TMPXPlaybackPlayerType aType); - - /** - * From MMPXPlayerManager - * Get the list of UIDs of all players - * - * @param aPlayers All the players' uids in the system - */ - void GetPlayerListL(RArray& aPlayers); - - /** - * From MMPXPlayerManager - * Get the list of UIDs of players with the specific type - * - * @param aPlayers All the players' uids with the same type - * @param aType the type of players - */ - void GetPlayerListL(RArray& aPlayers,TMPXPlaybackPlayerType aType); - - /** - * From MMPXPlayerManager - * Get the list of sub player names, Async - * - * @param aCallback sub players returned in call back interface - * @param aPlayer UID of the player - */ - void SubPlayerNamesL(MMPXPlaybackCallback& aCallback,TUid aPlayer); - - /** - * From MMPXPlayerManager - * Client selects all players with the type aType, the specific player used - * then being resolved on the basis of the content. - * - * @param aType the type of player - */ - void SelectPlayersL(TMPXPlaybackPlayerType aType); - - /** - * From MMPXPlayerManager - * Client selects specific player aPlayer and sub player aSubPlayerIndex - * from array returned by SubPlayerNamesL - * - * @param aPlayer the UID of player - * @param aSubPlayerIndex the index of the sub player - */ - void SelectSubPlayerL(TUid aPlayer,TInt aSubPlayerIndex); - - /** - * From MMPXPlayerManager - * Client selects a specific player - * - * @param aPlayer the UID of the player - */ - void SelectPlayerL(TUid aPlayer); - - /** - * From MMPXPlayerManager - * Clears all selection criteria. Essentially the same as - * SelectPlayersL(EPbLocal). - */ - void ClearSelectPlayersL(); - - /** - * From MMPXPlayerManager - * Retreives the current selection: KNullUid and KErrNotFound are possible - * return values for aPlayer and aSubPlayerIndex respectively if none are - * explicitly selected - * - * @param aType player type - * @param aPlayer the UID of player - * @param aSubPlayerIndex index of the subplayer - * @param aSubPlayerName friendly name of the subplayer - * Notes: Client owns the returned aSubPlayerName object. - */ - void GetSelectionL(TMPXPlaybackPlayerType& aType, - TUid& aPlayer, - TInt& aSubPlayerIndex, - HBufC*& aSubPlayerName); - - /** - * From MMPXPlayerManager - * The current player, may change with each item, NULL if none found - * - * @return object of current player - */ - MMPXPlayer* CurrentPlayer(); - - /** - * From MMPXPlayer - * The 'type' of the player. Built-in types are EPbLocal and EPbRemote, but - * the plug-ins could extend this if they desire to be a different type - * which can be selected by the user - * - * @return player type - */ - TMPXPlaybackPlayerType TypeL(); - - /** - * From MMPXPlayer - * If TypeL returns a value that is not known to the UI (and therefore - * can't localize it),then TypeNameL can be used for unlocalized display - * purposes. - * - * @return player name. - */ - HBufC* TypeNameL(); - - /** - * From MMPXPlayer - * If the player supports other 'players', else array count == 0. - * - * @param aCallback sub players returned in the callback - */ - void SubPlayerNamesL(MMPXPlaybackCallback& aCallback); - - /** - * From MMPXPlayer - * Selected sub player index, corresponding to sub player names array. - * - * @return sub player index. KErrNotFound if none - */ - TInt SubPlayerL() const; - - /** - * From MMPXPlayer - * The UID identifying this player - * - * @return UID of the player - */ - TUid UidL() const; - - /** - * From MMPXSource - * Path to the collection, or NULL if not in any collection - * Ownership transferred - * - * @return collection path - */ - CMPXCollectionPlaylist* PlaylistL(); - - /** - * From MMPXSource - * File passed in, or NULL if none passed in - * - * @return pointer to file handle - */ - RFile* FileL(); - - /** - * From MMPXSource - * URI of current item - * - * @return URI of the item - */ - HBufC* UriL(); - - /** - * From MMPXSource - * - * DEPRECATED - * - * Media request - * HandleMediaL of the callback - * - * @param aAttrs attributes requested - * @param aCallback playback callback - */ - void MediaL(const TArray& aAttrs, - MMPXPlaybackCallback& aCallback); - - /** - * From MMPXSource - * Media request - * HandleMediaL of the callback - * - * @param aAttrs attributes requested - * @param aCallback playback callback - * @param aSpecs, specifications for attributes - */ - void MediaL(const TArray& aAttrs, - MMPXPlaybackCallback& aCallback, - CMPXAttributeSpecs* aSpecs); - -#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API - /** - * From MMPXSource - * File passed in, or NULL if none passed in - * - * @return pointer to file handle - */ - RFile64* File64L(); -#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API - - /** - * From CActive - * Handles an active object's request completion event - */ - void RunL(); - - /** - * From CActive - * Implements cancellation of an outstanding request. - */ - void DoCancel(); - - /** - * From CActive - * Handles a leave occurring in the request completion event handler RunL() - * - * @param aError error code - */ - TInt RunError(TInt aError); - - /** - * From MMPXMessageObserver - * Message received - * @param aMsgData message data - * @param aError error code - */ - void MessageReceived(TInt aMsgData, TInt aError); - - /** - * Inititialises for streaming with URI and Access Point - * - * @since S60 9.2 - * @param aUri URI of the item - * @param aType the mime type of the item - * @param aAccessPoint the access point of the item - */ - virtual void InitStreamingL(const TDesC& aUri, const TDesC8* aType, const TInt aAccessPoint); - - /** - * Inititialises for streaming with URI and Access Point, the file may not be part of any collection - * Before this function can be called, the file server session which owns - * this file handle must first be marked as shareable by calling - * RFs::ShareProtected(). - * - * @since S60 9.2 - * @param aShareableFile shareable file handle - * @param aAccessPoint the access point of the item - */ - virtual void InitStreamingL(RFile& aShareableFile, const TInt aAccessPoint); - -#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API - /** - * Inititialises with a single item, may not be part of any collection - * Before this function can be called, the file server session which owns - * this file handle must first be marked as shareable by calling - * RFs::ShareProtected(). - * - * @since S60 9.2 - * @param aShareableFile shareable RFile64 file handle - */ - virtual void Init64L(RFile64& aShareableFile); - - /** - * Inititialises for streaming with URI and Access Point, the file may not be part of any collection - * Before this function can be called, the file server session which owns - * this file handle must first be marked as shareable by calling - * RFs::ShareProtected(). - * - * @since S60 9.2 - * @param aShareableFile shareable RFile64 file handle - * @param aAccessPoint the access point of the item - */ - virtual void InitStreaming64L(RFile64& aShareableFile, const TInt aAccessPoint); -#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API - -private: - - - /** - * Helper to return a descriptor buffer - * - * @param aSize size of the buffer - */ - HBufC* DesL(TInt aSize); - - /** - * Add a request - * - * @param aFunction function code - * @param aCallback callback - * @param aParamData data - * @param aBuf buffer data, ownership transferred - * @param aPtr, pointer to a object - * @param aAlivePtr1, object to keep alive for a task - * ownership transferred - * @leave leave with system error code when failed - */ - void AddRequestL(TMPXPlaybackServerOp aFunction, - MMPXPlaybackCallback* aCallback=NULL, - TInt aParamData=0, - CBufBase* aBuf=NULL, - TAny* aPtr=NULL, - CBase* aAlivePtr=NULL); - - /** - * Send next request to server - */ - void ExecuteNextRequest(); - - /** - * Handle message from message queue - * @param aMsgData message data - * @param aError error code - */ - void HandleMessageL(TInt aMsgData, TInt aError); - - /** - * Handles error in RunL - * - * @param aError error code - */ - void HandleRunErrorL(TInt aError); - - -public: - - TMPXPlaybackState iState; - - RArray iObservers; - CMPXMessageMonitor* iMsgMonitor; - CMPXTaskQueue* iTaskQueue; - RMPXSession iPbs; - CBufBase* iBuffer; - TPckgBuf iPropertyValuePckg; - TPckgBuf iCompletePckg; - TPckgBuf iResultSizePckg; - RFile iFile; - TBool iCallbackOngoing; // whether client is processing callback or not -#ifdef _ENABLE_GUARD_TIMER - CPeriodic* iGuardTimer; // guard timer for async request -#endif - CMPXMedia* iMediaOnError; // media object while handling error - TInt iRefCount; -#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API - RFile64 iFile64; -#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API - }; - -#endif // CMPXPLAYBACKUTILITY_H diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackcontrol.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackcontrol.hrh Wed Jun 23 17:22:59 2010 +0100 @@ -0,0 +1,117 @@ +/* +* 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 "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: header file of CMPXVideoPlaybackControl +* +*/ + +// Version : %version: 1 % + + +#ifndef MPXVIDEOPLAYBACKCONTROL_HRH_ +#define MPXVIDEOPLAYBACKCONTROL_HRH_ + +// DATA TYPES +const TInt KMPXVideoPlaybackVolumeMax = 10; + +enum TMPFXVideoPlaybackControlProperties +{ + EMPXShownWhenInitializing = 0x1, + EMPXShownWhenBuffering = 0x2, + EMPXShownWhenPlaying = 0x4, + EMPXShownWhenPaused = 0x8, + EMPXShownWhenSeeking = 0x10, + EMPXAllProperties = 0xffffffff +}; + +enum TMPXVideoPlaybackControls +{ + EMPXStatusPane, + EMPXControlBar, + + // Only for streaming case + // Can handle from NotInitilized state + // + EMPXBufferingAnimation, + + // + // For details view and audio only view + // + EMPXFileDetailsWidget, + + // + // For details view + // + EMPXDetailsViewPlaybackWindow, + + // + // Bitmaps + // + EMPXIndicatorBitmap, + EMPXRealLogoBitmap, + + EMPXDownloadPausedIcon, + + EMPXControlsCount // has to be last +}; + +/** Command ID's. */ +enum TMPXVideoPlaybackControlCommandIds +{ + EMPXControlCmdPluginInitialized, + EMPXControlCmdTvOutConnected, + EMPXControlCmdTvOutDisconnected, + EMPXControlCmdSetAspectRatio, + EMPXControlCmdSetVolume, + EMPXControlCmdSetDuration, + EMPXControlCmdSetPosition, + EMPXControlCmdStateChanged, + EMPXControlCmdDownloadUpdated, + EMPXControlCmdSetDownloadSize, + EMPXControlCmdDownloadComplete, + EMPXControlCmdSetDownloadPaused, + EMPXControlCmdClearDownloadPaused, + EMPXControlCmdHandleBackgroundEvent, + EMPXControlCmdHandleForegroundEvent, + EMPXControlCmdHandleErrors, + EMPXControlCmdShowVolumeControls, + EMPXControlCmdSoftKeyPressed, + EMPXControlCmdFullScreenViewOpened, + EMPXControlCmdDetailsViewOpened, + EMPXControlCmdAudionOnlyViewOpened, + EMPXControlCmdRemoveRNLogo +}; + +enum TMPXVideoSeekingType +{ + EMpxVideoSeekingForward, + EMpxVideoSeekingBackward, + EMpxVideoSeekingStop +}; + +enum TMPXVideoControlType +{ + EMpxVideoPlaybackContainer, + EMpxVideoPlaybackControl +}; + +enum TMPXVideoUserInputType +{ + EMpxVideoKeyboard, + EMpxVideoTouch, + EMpxVideoMediaKeys, + EMpxVideoSpecialHWKeys, + EMpxVideoNone +}; + +#endif /*MPXVIDEOPLAYBACKCONTROL_HRH_*/ diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackcontrolscontroller.h --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackcontrolscontroller.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackcontrolscontroller.h Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 6 % +// Version : %version: 7 % @@ -72,30 +72,17 @@ // void updateVideoRectDone(); - public: - - /** - * Initialize controller - */ - void initializeController(); - - /** - * Handle tvout connected/disconnected event - */ - void handleTvOutEvent( bool connected, - TMPXVideoPlaybackControlCommandIds event, - int value ); - - private slots: - - void handleTappedOnScreen(); + bool isRNLogoBitmapInControlList(); public: HbVideoBasePlaybackView *mView; CMPXVideoViewWrapper *mViewWrapper; QMPXVideoPlaybackViewFileDetails *mFileDetails; + TMPXVideoPlaybackControlCommandIds mReceivedEvent; - bool mViewTransitionIsGoingOn; + int mValue; + bool mRNLogoVisible; + bool mFileDetailsAdded; }; #endif /*MPXVIDEOPLAYBACKCONTROLSCONTROLLER_P_H_*/ diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackdisplayhandler.h --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackdisplayhandler.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackdisplayhandler.h Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 4 % +// Version : %version: 6 % #ifndef __CMPXVIDEOPLAYBACKDISPLAYHANDLER_H__ @@ -26,11 +26,7 @@ #include #include #include -#ifdef SYMBIAN_BUILD_GCE #include -#else -#include -#endif // @@ -45,20 +41,7 @@ * */ class CMPXVideoPlaybackDisplayHandler : public CBase -#ifndef SYMBIAN_BUILD_GCE - , public MDirectScreenAccess -#endif { - // - // To save user's preference for scaling type in video ratio + screen ratio - // - typedef struct - { - TReal32 videoRatio; - TReal32 screenRatio; - TMMFScalingType scalingType; - } TMPXAspectRatio ; - public: ~CMPXVideoPlaybackDisplayHandler(); @@ -80,7 +63,7 @@ TInt SetDefaultAspectRatioL( QMPXVideoPlaybackViewFileDetails* aFileDetails, TReal32 aDisplayAspectRatio ); - void UpdateVideoRectL( TRect aRect, TBool transitionEffect ); + void UpdateVideoRectL( TRect aRect, TBool transitionEffect ); private: @@ -88,86 +71,15 @@ CMPXVideoViewWrapper* aViewWrapper ); void ConstructL(); - - void LoadAspectRatioL(); - - void SaveAspectRatioL(); - - void SetVideoRectL( TRect aClipRect ); - - void CalculateVideoRectL(); - - static TInt UpdateVideoRectTimeOutL( TAny* aPtr ); - -#ifdef SYMBIAN_BUILD_GCE - - private: - void AddDisplayWindowL( CWsScreenDevice& aScreenDevice, - RWindowBase& aWindowBase, - RWindow* aWin ); - - void SurfaceCreatedL( CMPXMessage* aMessage ); - void SurfaceChangedL( CMPXMessage* aMessage ); - void SurfaceRemoved(); - TInt SetNgaAspectRatioL( TMPXVideoPlaybackCommand aCmd ); - -#else - - private: - // - // MDirectScreenAccess Implementation - // - void AbortNow( RDirectScreenAccess::TTerminationReasons aReason ); - void Restart( RDirectScreenAccess::TTerminationReasons aReason ); - - TInt CreateAspectRatioCommandL( TMPXVideoPlaybackCommand aCmd ); - - void SetDisplayWindowL( RWsSession& aWs, - CWsScreenDevice& aScreenDevice, - RWindowBase& aWin, - TRect aClipRect ); - void RestartDsaL(); - void CreateAbortDsaCmdL(); - -#endif public: MMPXPlaybackUtility* iPlaybackUtility; - - RArray iAspectRatioArray; - TInt iCurrentIndexForAspectRatio; - TReal iDisplayAspectRatio; - - TRect iWindowRect; - - TReal32 iTlXDiff; - TReal32 iTlYDiff; - TReal32 iBrXDiff; - TReal32 iBrYDiff; - - TInt iTransitionEffectCnt; - - CPeriodic* iResizingTimer; CMPXVideoViewWrapper* iViewWrapper; - -#ifdef SYMBIAN_BUILD_GCE CMediaClientVideoDisplay* iVideoDisplay; - RWindowBase* iWindowBase; - TBool iSurfaceCached; - TSurfaceId iSurfaceId; - TRect iCropRect; - TVideoAspectRatio iAspectRatio; - TReal32 iScaleWidth; - TReal32 iScaleHeight; - TInt iHorizontalPosition; - TInt iVerticalPosition; - TVideoRotation iRotation; - TAutoScaleType iAutoScale; -#else - CDirectScreenAccess* iDirectScreenAccess; -#endif - + TRect iRect; + TInt iAspectRatio; + TInt iCommand; }; #endif // __CMPXVIDEOPLAYBACKDISPLAYHANDLER_H__ diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackviewfiledetails.h --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackviewfiledetails.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackviewfiledetails.h Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 4 % +// Version : %version: 5 % @@ -70,7 +70,6 @@ bool mPartialPlayback; bool mRNFormat; bool mTvOutConnected; - bool mTvOutPlayAllowed; bool mDrmProtected; bool mMultiItemPlaylist; diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/hbvideobaseplaybackview.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/hbvideobaseplaybackview.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/hbvideobaseplaybackview.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 5 % +// Version : %version: 7 % @@ -38,6 +38,7 @@ { mCurrentError = KErrNone; mViewActive = false; + mSyncClose = false; } // ------------------------------------------------------------------------------------------------- @@ -198,4 +199,13 @@ { } +// ------------------------------------------------------------------------------------------------- +// HbVideoBasePlaybackView::handleStoppedState() +// ------------------------------------------------------------------------------------------------- +// +void HbVideoBasePlaybackView::handleStoppedState() +{ + +} + // EOF diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxplaybackutility.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxplaybackutility.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxplaybackutility.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,50 +15,198 @@ * */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include"mpxplaybackutilityimpl.h" +#include"mpxplaybackutility.h" -// ============================== MEMBER FUNCTIONS ============================ +// ============================== MEMBER FUNCTIONS ================================================= + +// ------------------------------------------------------------------------------------------------- +// Creates the playback utility object if not already created +// ------------------------------------------------------------------------------------------------- +// +MMPXPlaybackUtility* MMPXPlaybackUtility::UtilityL( const TMPXCategory /*aCategory*/, + const TUid& /*aModeId*/ ) +{ + return CMPXPlaybackUtility::NewL(); +} -// ---------------------------------------------------------------------------- -// Create the playback utility object -// ---------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- +// Two phases constructor +// ------------------------------------------------------------------------------------------------- +// +CMPXPlaybackUtility* CMPXPlaybackUtility::NewL() +{ + CMPXPlaybackUtility* p = new(ELeave)CMPXPlaybackUtility(); + CleanupStack::PushL(p); + p->ConstructL(); + CleanupStack::Pop(p); + return p; +} + +// ------------------------------------------------------------------------------------------------- +// Destructor +// ------------------------------------------------------------------------------------------------- +// +CMPXPlaybackUtility::~CMPXPlaybackUtility() +{ +} + +// ------------------------------------------------------------------------------------------------- +// C++ constructor +// Create a unique name out of thread ID and this pointer: no other instance of +// this object will have the same name; used to identify this object for +// recieving messages +// ------------------------------------------------------------------------------------------------- +// +CMPXPlaybackUtility::CMPXPlaybackUtility() +{ +} + +// ------------------------------------------------------------------------------------------------- +// 2nd construtor +// ------------------------------------------------------------------------------------------------- // -EXPORT_C MMPXPlaybackUtility* MMPXPlaybackUtility::NewL(const TUid& aModeId, - MMPXPlaybackObserver* aObs) - { - return CMPXPlaybackUtility::NewL(aModeId,aObs, EMPXCategoryMusic); - } +void CMPXPlaybackUtility::ConstructL() +{ + iState = EPbStateInitialised; +} + +// ------------------------------------------------------------------------------------------------- +// Add a observer +// ------------------------------------------------------------------------------------------------- +// +void CMPXPlaybackUtility::AddObserverL( MMPXPlaybackObserver& /*aObs*/ ) +{ +} + +// ------------------------------------------------------------------------------------------------- +// Remove a observer +// ------------------------------------------------------------------------------------------------- +// +void CMPXPlaybackUtility::RemoveObserverL( MMPXPlaybackObserver& /* aObs */ ) +{ +} -// ---------------------------------------------------------------------------- -// Create the playback utility object -// ---------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- +// Delete this +// ------------------------------------------------------------------------------------------------- +// +void CMPXPlaybackUtility::Close() +{ + delete this; +} + +// ------------------------------------------------------------------------------------------------- +// Issue player commands +// ------------------------------------------------------------------------------------------------- // +void CMPXPlaybackUtility::CommandL( TMPXPlaybackCommand aCmd ) +{ + iCommand = aCmd; +} -EXPORT_C MMPXPlaybackUtility* MMPXPlaybackUtility::NewL(const TMPXCategory aCategory, - const TUid& aModeId, - MMPXPlaybackObserver* aObs) +// ------------------------------------------------------------------------------------------------- +// Issue player commands +// ------------------------------------------------------------------------------------------------- +// +void CMPXPlaybackUtility::CommandL( CMPXCommand& aCmd, MMPXPlaybackCallback* /* aCallback */ ) +{ + TInt cmdType = aCmd.ValueTObjectL( KMPXCommandGeneralId ); + + if ( cmdType == KMPXCommandIdPlaybackGeneral ) { - return CMPXPlaybackUtility::NewL(aModeId,aObs,aCategory); + iCommand = aCmd.ValueTObjectL( KMPXCommandPlaybackGeneralType ); } - -// ---------------------------------------------------------------------------- -// Creates the playback utility object if not already created -// ---------------------------------------------------------------------------- -// -EXPORT_C MMPXPlaybackUtility* MMPXPlaybackUtility::UtilityL( const TUid& aModeId ) + else { - return CMPXPlaybackUtility::UtilityL( aModeId, EMPXCategoryMusic ); + iCommand = aCmd.ValueTObjectL( KMPXMediaVideoPlaybackCommand ); } - -// ---------------------------------------------------------------------------- -// Creates the playback utility object if not already created -// ---------------------------------------------------------------------------- +} + +// ------------------------------------------------------------------------------------------------- +// Current state of player +// ------------------------------------------------------------------------------------------------- // +TMPXPlaybackState CMPXPlaybackUtility::StateL() const +{ + return iState; +} + +// ------------------------------------------------------------------------------------------------- +// Determine whether there is a song by the state of the engine: if there is, +// its OK to return MMPXMedia, else NULL is returned +// ------------------------------------------------------------------------------------------------- +// +MMPXSource* CMPXPlaybackUtility::Source() +{ + return NULL; +} + +// ------------------------------------------------------------------------------------------------- +// Set playback property, EPropertyChanged event when complete +// ------------------------------------------------------------------------------------------------- +// +void CMPXPlaybackUtility::SetL( TMPXPlaybackProperty aProperty, TInt aValue ) +{ + iProperty = aProperty; + iPropertyValue = aValue; +} -EXPORT_C MMPXPlaybackUtility* MMPXPlaybackUtility::UtilityL(const TMPXCategory aCategory, - const TUid& aModeId ) - { - return CMPXPlaybackUtility::UtilityL( aModeId, aCategory ); - } +// ------------------------------------------------------------------------------------------------- +// Send property request +// Result will be called back in HandleProperty +// ------------------------------------------------------------------------------------------------- +// +void CMPXPlaybackUtility::PropertyL( + MMPXPlaybackCallback& /* aCallback */, + TMPXPlaybackProperty /* aProperty */) +{ +} + +// ------------------------------------------------------------------------------------------------- +// Path to the collection +// ------------------------------------------------------------------------------------------------- +// +CMPXCollectionPlaylist* CMPXPlaybackUtility::PlaylistL() +{ + CMPXCollectionPlaylist *p = NULL; + + return p; +} + +// ------------------------------------------------------------------------------------------------- +// Request for media properties. +// ------------------------------------------------------------------------------------------------- +// +void CMPXPlaybackUtility::MediaL( + const TArray& /* aAttrs */, + MMPXPlaybackCallback& /* aCallback */, + CMPXAttributeSpecs* /* aSpecs */) +{ +} + +// ------------------------------------------------------------------------------------------------- +// set primary client +// ------------------------------------------------------------------------------------------------- +// +void CMPXPlaybackUtility::SetPrimaryClientL() +{ +} + +// End of file + diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxplaybackutilityimpl.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxplaybackutilityimpl.cpp Tue May 18 11:57:40 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,721 +0,0 @@ -/* -* Copyright (c) 2006 - 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "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: Playback Utility implementation -* -*/ - -// Version : %version: % - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "mpxplaybackutilityimpl.h" - -// ============================== MEMBER FUNCTIONS ============================ - -// --------------------------------------------------------------------------- -// Retrieves playback utility from TLS. Creates if it's not there. -// --------------------------------------------------------------------------- -// -MMPXPlaybackUtility* CMPXPlaybackUtility::UtilityL( - const TUid& aModeId, - const TMPXCategory aCategory) - { - MMPXPlaybackUtility* utility( NULL ); - - utility = CMPXPlaybackUtility::NewL( aModeId, NULL, aCategory ); - - return utility; - } - -// ---------------------------------------------------------------------------- -// Two phases constructor -// ---------------------------------------------------------------------------- -// -CMPXPlaybackUtility* CMPXPlaybackUtility::NewL(const TUid& aModeId, - MMPXPlaybackObserver* aObs, - const TMPXCategory aCategory) - { - CMPXPlaybackUtility* p=new(ELeave)CMPXPlaybackUtility(); - CleanupStack::PushL(p); - p->ConstructL(aModeId,aObs,aCategory); - CleanupStack::Pop(p); - return p; - } - -// ---------------------------------------------------------------------------- -// Destructor -// ---------------------------------------------------------------------------- -// -CMPXPlaybackUtility::~CMPXPlaybackUtility() - { - iObservers.Close(); - } - -// ---------------------------------------------------------------------------- -// C++ constructor -// Create a unique name out of thread ID and this pointer: no other instance of -// this object will have the same name; used to identify this object for -// recieving messages -// ---------------------------------------------------------------------------- -// -CMPXPlaybackUtility::CMPXPlaybackUtility() - : iCallbackOngoing(EFalse) - { - } - -// ---------------------------------------------------------------------------- -// 2nd construtor -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::ConstructL(const TUid& /* aModeId */, - MMPXPlaybackObserver* /* aObs */, - const TMPXCategory /* aCategory */) - { - iState = EPbStateInitialised; - } - -// ---------------------------------------------------------------------------- -// Add a observer -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::AddObserverL(MMPXPlaybackObserver& aObs) - { - iObservers.AppendL(&aObs); - } - -// ---------------------------------------------------------------------------- -// Remove a observer -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::RemoveObserverL(MMPXPlaybackObserver& /* aObs */) - { - - } - -// ---------------------------------------------------------------------------- -// Returns PIds of clients that are using the engine in the mode -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::GetClientsL(RArray& /* aClients */) - { - - } - -// ---------------------------------------------------------------------------- -// Initializes a track given by aIndex in path aCollectionPath -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::InitL( - const CMPXCollectionPlaylist& /* aPlaylist */, - TBool /*aPlay */ ) - { - - } - -// ---------------------------------------------------------------------------- -// Inititialises with a single song, may not be part of any collection -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::InitL(const TDesC& /* aUri */, const TDesC8* /* aType */ ) - { - - } - -// ---------------------------------------------------------------------------- -// Inititialises with a single song, may not be part of any collection -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::InitL(RFile& /* aShareableFile */) - { - - } - -// ---------------------------------------------------------------------------- -// Inititialises with a URI -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::InitStreamingL(const TDesC& /* aUri */, const TDesC8* /* aType */, const TInt /* aAccessPoint */) -{ - -} - - -// ---------------------------------------------------------------------------- -// Inititialises with a file, may not be part of any collection -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::InitStreamingL(RFile& /* aShareableFile */, const TInt /* aAccessPoint */) -{ - -} - -// ---------------------------------------------------------------------------- -// Frees up client side resources only; a player is freed when there are no -// clients using it, and all resources are freed when the last client closed -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::Close() - { - - } - -// ---------------------------------------------------------------------------- -// Stops any async operations that are currently under way -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::CancelRequest() - { - - } - -// ---------------------------------------------------------------------------- -// Issue player commands, with optional data. -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::CommandL(TMPXPlaybackCommand /* aCmd */, TInt /* aData */) - { - - } - -// ---------------------------------------------------------------------------- -// Issue player commands -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::CommandL( - CMPXCommand& aCmd, - MMPXPlaybackCallback* /* aCallback */) - { - TMPXPlaybackCommand cmdType = static_cast( - aCmd.ValueTObjectL(KMPXCommandPlaybackGeneralType)); - - switch ( cmdType ) - { - case EPbCmdPlay: - { - iState = EPbStatePlaying; - break; - } - case EPbCmdDecreaseVolume: - { - CMPXMessage* message = CMPXMessage::NewL(); - message->SetTObjectValueL( KMPXMessageGeneralId, KMPXMessageGeneral ); - message->SetTObjectValueL( KMPXMessageGeneralEvent, TMPXPlaybackMessage::EPropertyChanged ); - message->SetTObjectValueL( KMPXMessageGeneralType, EPbPropertyVolume ); - message->SetTObjectValueL( KMPXMessageGeneralData, 0 ); - iObservers[0]->HandlePlaybackMessage( message, KErrNone ); - } - } - } - -// ---------------------------------------------------------------------------- -// Current state of player -// ---------------------------------------------------------------------------- -// -TMPXPlaybackState CMPXPlaybackUtility::StateL() const - { - return iState; - } - -// ---------------------------------------------------------------------------- -// Determine whether there is a song by the state of the engine: if there is, -// its OK to return MMPXMedia, else NULL is returned -// ---------------------------------------------------------------------------- -// -MMPXSource* CMPXPlaybackUtility::Source() - { - return this; - } - -// ---------------------------------------------------------------------------- -// Get player manager -// ---------------------------------------------------------------------------- -// -MMPXPlayerManager& CMPXPlaybackUtility::PlayerManager() - { - } - -// ---------------------------------------------------------------------------- -// Set playback property, EPropertyChanged event when complete -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::SetL(TMPXPlaybackProperty aProperty,TInt /* aValue */ ) - { - if ( aProperty == EPbPropertyMute ) - { - CMPXMessage* message = CMPXMessage::NewL(); - message->SetTObjectValueL( KMPXMessageGeneralId, KMPXMessageGeneral ); - message->SetTObjectValueL( KMPXMessageGeneralEvent, TMPXPlaybackMessage::EPropertyChanged ); - message->SetTObjectValueL( KMPXMessageGeneralType, 0 ); - message->SetTObjectValueL( KMPXMessageGeneralData, 0 ); - iObservers[0]->HandlePlaybackMessage( message, KErrNone ); - } - else if ( aProperty == EPbPropertyPosition ) - { - CMPXMessage* message = CMPXMessage::NewL(); - message->SetTObjectValueL( KMPXMessageGeneralId, KMPXMessageGeneral ); - message->SetTObjectValueL( KMPXMessageGeneralEvent, TMPXPlaybackMessage::EPropertyChanged ); - message->SetTObjectValueL( KMPXMessageGeneralType, EPbPropertyPosition ); - message->SetTObjectValueL( KMPXMessageGeneralData, 50 ); - iObservers[0]->HandlePlaybackMessage( message, KErrNone ); - } - } - -// ---------------------------------------------------------------------------- -// Send property request -// Result will be called back in HandleProperty -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::ValueL(MMPXPlaybackCallback& /* aCallback */, - TMPXPlaybackProperty /* aProperty */) - { - - } - -// ---------------------------------------------------------------------------- -// Send property request -// Result will be called back in HandleProperty -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::PropertyL( - MMPXPlaybackCallback& /* aCallback */, - TMPXPlaybackProperty /* aProperty */) - { - - } - -// ---------------------------------------------------------------------------- -// Return a list of mime types supported by playback framework -// ---------------------------------------------------------------------------- -// -CDesCArray* CMPXPlaybackUtility::SupportedMimeTypes() - { - CDesCArray* desArray = NULL; - - return desArray; - } - -// ---------------------------------------------------------------------------- -// Return a list of mime types supported by playback framework -// ---------------------------------------------------------------------------- -// -CDesCArray* CMPXPlaybackUtility::SupportedExtensions() - { - CDesCArray* desArray = NULL; - - return desArray; - } - -// ---------------------------------------------------------------------------- -// Return a list of mime types supported by playback framework -// ---------------------------------------------------------------------------- -// -CDesCArray* CMPXPlaybackUtility::SupportedSchemas() - { - CDesCArray* desArray = NULL; - - return desArray; - } - -// ---------------------------------------------------------------------------- -// Sets the priority of the playback utility -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::SetPriority( TInt /* aPriority */ ) - { - - } - - -// ---------------------------------------------------------------------------- -// CMPXPlaybackUtility::AddSubscriptionL -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::AddSubscriptionL( - const CMPXSubscription& /* aSubscription */) - { - - } - -// ---------------------------------------------------------------------------- -// CMPXPlaybackUtility::RemoveSubscriptionL -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::RemoveSubscriptionL( - const CMPXSubscription& /* aSubscription */ ) - { - - } - -// ---------------------------------------------------------------------------- -// CMPXPlaybackUtility::ClearSubscriptionsL -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::ClearSubscriptionsL() - { - - } -// ---------------------------------------------------------------------------- -// Get a list of player types -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::GetPlayerTypesL( - RArray& /* aTypes */ ) - { - - } - -// ---------------------------------------------------------------------------- -// Returns display name for custom types -// ---------------------------------------------------------------------------- -// -HBufC* CMPXPlaybackUtility::PlayerTypeDisplayNameL(TMPXPlaybackPlayerType /* aType */ ) - { - HBufC* buf=NULL; - return buf; - } - -// ---------------------------------------------------------------------------- -// Get the list of UIDs of all players -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::GetPlayerListL(RArray& /* aPlayers */) - { - - } - -// ---------------------------------------------------------------------------- -// Get the list of UIDs of players with the specific type -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::GetPlayerListL(RArray& /* aPlayers */, - TMPXPlaybackPlayerType /* aType */) - { - - } - -// ---------------------------------------------------------------------------- -// Asynchronous method: when server completes message, RunL() will be called -// and then the observer is notified of the results. Data required for the -// results that is not supplied by the server is stored; data supplied by the -// server is written back into packaged descriptors in this address space -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::SubPlayerNamesL(MMPXPlaybackCallback& /* aCallback */, - TUid /* aPlayer */) - { - - } - -// ---------------------------------------------------------------------------- -// Selects all players with the type -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::SelectPlayersL(TMPXPlaybackPlayerType /* aType */) - { - - } - -// ---------------------------------------------------------------------------- -// Selects a specific player -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::SelectPlayerL(TUid /* aPlayer */ ) - { - - } - -// ---------------------------------------------------------------------------- -// Selects a specific player and sub player -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::SelectSubPlayerL(TUid /* aPlayer */, TInt /* aSubPlayerIndex */) - { - - } - -// ---------------------------------------------------------------------------- -// Clears all selection criteria. -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::ClearSelectPlayersL() - { - - } - -// ---------------------------------------------------------------------------- -// Retreives the current selection -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::GetSelectionL(TMPXPlaybackPlayerType& /* aType */, - TUid& /* aPlayer */, - TInt& /* aSubPlayerIndex */, - HBufC*& /* aSubPlayerName */) - { - - } - -// ---------------------------------------------------------------------------- -// The current player -// ---------------------------------------------------------------------------- -// -MMPXPlayer* CMPXPlaybackUtility::CurrentPlayer() - { - return NULL; - } - -// ---------------------------------------------------------------------------- -// The 'type' of the player -// ---------------------------------------------------------------------------- -// -TMPXPlaybackPlayerType CMPXPlaybackUtility::TypeL() - { - MPX_FUNC_EX("CMPXPlaybackUtility::TypeL()"); - return EPbLocal; - } - -// ---------------------------------------------------------------------------- -// The name of player type -// ---------------------------------------------------------------------------- -// -HBufC* CMPXPlaybackUtility::TypeNameL() - { - HBufC* buf=NULL; - return buf; - } - -// ---------------------------------------------------------------------------- -// Get sub players -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::SubPlayerNamesL(MMPXPlaybackCallback& aCallback) - { - MPX_FUNC_EX("CMPXPlaybackUtility::SubPlayerNamesL()"); - SubPlayerNamesL(aCallback,UidL()); - } - -// ---------------------------------------------------------------------------- -// Selected sub player index -// ---------------------------------------------------------------------------- -// -TInt CMPXPlaybackUtility::SubPlayerL() const - { - return 0; - } - -// ---------------------------------------------------------------------------- -// The UID identifying this player -// ---------------------------------------------------------------------------- -// -TUid CMPXPlaybackUtility::UidL() const - { - } - -// ---------------------------------------------------------------------------- -// Path to the collection -// ---------------------------------------------------------------------------- -// -CMPXCollectionPlaylist* CMPXPlaybackUtility::PlaylistL() - { - MPX_FUNC_EX("CMPXPlaybackUtility::PlaylistL()"); - CMPXCollectionPlaylist *p = NULL; - - return p; - } - -// ---------------------------------------------------------------------------- -// Return file handle -// ---------------------------------------------------------------------------- -// -RFile* CMPXPlaybackUtility::FileL() - { - RFile* file(NULL); - return file; - } - -// ---------------------------------------------------------------------------- -// URI of current song -// ---------------------------------------------------------------------------- -// -HBufC* CMPXPlaybackUtility::UriL() - { - HBufC* buf=NULL; - return buf; - } - -// ---------------------------------------------------------------------------- -// Request for media properties. -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::MediaL( - const TArray& aAttrs, - MMPXPlaybackCallback& aCallback) - { - MediaL( aAttrs, aCallback, NULL ); - } - -// ---------------------------------------------------------------------------- -// Request for media properties. -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::MediaL( - const TArray& /* aAttrs */, - MMPXPlaybackCallback& /* aCallback */, - CMPXAttributeSpecs* /* aSpecs */) - { - - } - -// ---------------------------------------------------------------------------- -// Server has completed the message, and if there's no error, the results are -// available. The server completes with the function id (or error) so the correct -// callback is made -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::RunL() - { - - } - -// ---------------------------------------------------------------------------- -// Canceling by the server -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::DoCancel() - { - - } - -// ---------------------------------------------------------------------------- -// Sends error message to all observers - maybe it should only be to the -// client that calls the async method -// ---------------------------------------------------------------------------- -// -TInt CMPXPlaybackUtility::RunError(TInt /* aError */) - { - return KErrNone; - } - -// ---------------------------------------------------------------------------- -// Distributes messages to all observers -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::MessageReceived(TInt /* aMsgData */, TInt /* aError */) - { - - } - -// ---------------------------------------------------------------------------- -// Distributes messages to all observers -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::HandleMessageL(TInt /* aMsgData */, TInt /* aError */) - { - - } - -// ---------------------------------------------------------------------------- -// Handle error in RunL -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::HandleRunErrorL(TInt /* aError */) - { - - } - - -// ---------------------------------------------------------------------------- -// Read a buffer from server -// ---------------------------------------------------------------------------- -// -HBufC* CMPXPlaybackUtility::DesL(TInt /* aSize */) - { - HBufC* des=NULL; - - return des; - } - -// ---------------------------------------------------------------------------- -// Adds a sync request to the queue: if there is no outstanding request, -// it will be executed immediately -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::AddRequestL(TMPXPlaybackServerOp /*aFunction */, - MMPXPlaybackCallback* /* aCallback */, - TInt /* aParamData */, - CBufBase* /* aBuf */, - TAny* /* aPtr */, - CBase* /* aAlivePtr */) - { - - } - -// ---------------------------------------------------------------------------- -// Executes the next request in the queue. -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::ExecuteNextRequest() - { - - } - - - -#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API -// ---------------------------------------------------------------------------- -// Inititialises with a single song, may not be part of any collection -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::Init64L(RFile64& /* aShareableFile */) - { - - } - -// ---------------------------------------------------------------------------- -// Inititialises with a file, may not be part of any collection -// ---------------------------------------------------------------------------- -// -void CMPXPlaybackUtility::InitStreaming64L(RFile64& /* aShareableFile */, const TInt /* aAccessPoint */) - { - - } - -// ---------------------------------------------------------------------------- -// Return file handle -// ---------------------------------------------------------------------------- -// -RFile64* CMPXPlaybackUtility::File64L() - { - RFile64* file(NULL); - - return file; - } - -#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API - -// End of file diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxvideoplaybackcontrolscontroller.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxvideoplaybackcontrolscontroller.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxvideoplaybackcontrolscontroller.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 7 % +// Version : %version: 8 % @@ -39,18 +39,9 @@ QMPXVideoPlaybackViewFileDetails *details ) : mView( view ) , mViewWrapper( viewWrapper ) - , mFileDetails( details ) + , mFileDetails( details ) + , mFileDetailsAdded( false ) { - initializeController(); -} - -// ------------------------------------------------------------------------------------------------- -// QMPXVideoPlaybackControlsController::initializeController() -// ------------------------------------------------------------------------------------------------- -// -void QMPXVideoPlaybackControlsController::initializeController() -{ - connect( mView, SIGNAL( tappedOnScreen() ), this, SLOT( handleTappedOnScreen() ) ); } // ------------------------------------------------------------------------------------------------- @@ -61,6 +52,8 @@ QMPXVideoPlaybackViewFileDetails* details ) { Q_UNUSED( details ); + + mFileDetailsAdded = true; } // ------------------------------------------------------------------------------------------------- @@ -70,9 +63,6 @@ QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController() { MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController")); - - disconnect( mView, SIGNAL( tappedOnScreen() ), this, SLOT( handleTappedOnScreen() ) ); - } // ------------------------------------------------------------------------------------------------- @@ -82,51 +72,8 @@ void QMPXVideoPlaybackControlsController::handleEvent( TMPXVideoPlaybackControlCommandIds event, int value ) { - switch ( event ) - { - case EMPXControlCmdTvOutConnected: - { - handleTvOutEvent( true, event, value ); - break; - } - case EMPXControlCmdTvOutDisconnected: - { - handleTvOutEvent( false, event, value ); - break; - } - case EMPXControlCmdSetVolume: - { - mFileDetails->mAudioEnabled = false; - break; - } - case EMPXControlCmdSetDuration: - { - mFileDetails->mDuration = value; - break; - } - case EMPXControlCmdShowVolumeControls: - { - mFileDetails->mAudioEnabled = true; - break; - } - case EMPXControlCmdSetPosition: - { - mFileDetails->mSeekable = true; - break; - } - } -} - -// ------------------------------------------------------------------------------------------------- -// QMPXVideoPlaybackControlsController::handleTvOutEvent -// ------------------------------------------------------------------------------------------------- -// -void QMPXVideoPlaybackControlsController::handleTvOutEvent( - bool connected, TMPXVideoPlaybackControlCommandIds event, int value ) -{ - Q_UNUSED( event ); - Q_UNUSED( value ); - mFileDetails->mTvOutConnected = connected; + mReceivedEvent = event; + mValue = value; } // ------------------------------------------------------------------------------------------------- @@ -135,16 +82,15 @@ // void QMPXVideoPlaybackControlsController::updateVideoRectDone() { - mViewTransitionIsGoingOn = false; } // ------------------------------------------------------------------------------------------------- -// QMPXVideoPlaybackControlsController::handleTappedOnScreen() +// QMPXVideoPlaybackControlsController::isRNLogoBitmapVisible() // ------------------------------------------------------------------------------------------------- // -void QMPXVideoPlaybackControlsController::handleTappedOnScreen() - +bool QMPXVideoPlaybackControlsController::isRNLogoBitmapInControlList() { - MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::handleTappedOnScreen")); + return mRNLogoVisible; } + // End of File diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxvideoplaybackdisplayhandler.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxvideoplaybackdisplayhandler.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxvideoplaybackdisplayhandler.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 5 % +// Version : %version: 7 % #include #include @@ -29,11 +29,6 @@ #include "mpxvideoregion.h" #include "mpxvideoplaybackviewfiledetails.h" -const TInt KVIDEORESIZINGREPEATRATE = 50000; -const TReal32 KTRANSITIONEFFECTCNT = 8; - -_LIT( KAspectRatioFile, "c:\\private\\200159b2\\mpxvideoplayer_aspect_ratio.dat" ); - CMPXVideoPlaybackDisplayHandler::CMPXVideoPlaybackDisplayHandler( MMPXPlaybackUtility* aPlayUtil, CMPXVideoViewWrapper* aViewWrapper ) @@ -67,7 +62,6 @@ // void CMPXVideoPlaybackDisplayHandler::ConstructL() { - LoadAspectRatioL(); } // ------------------------------------------------------------------------------------------------- @@ -92,69 +86,51 @@ // void CMPXVideoPlaybackDisplayHandler::RemoveDisplayWindow() { -#ifdef SYMBIAN_BUILD_GCE if ( iVideoDisplay ) { delete iVideoDisplay; iVideoDisplay = NULL; } -#else - if ( iDirectScreenAccess ) - { - delete iDirectScreenAccess; - iDirectScreenAccess = NULL; - } -#endif } // ------------------------------------------------------------------------------------------------- // CMPXVideoPlaybackDisplayHandler::HandleVideoDisplayMessageL() // ------------------------------------------------------------------------------------------------- // -void CMPXVideoPlaybackDisplayHandler::HandleVideoDisplayMessageL( CMPXMessage* aMessage ) +void CMPXVideoPlaybackDisplayHandler::HandleVideoDisplayMessageL( CMPXMessage* /*aMessage*/ ) { - - TMPXVideoDisplayCommand message = - ( *(aMessage->Value(KMPXMediaVideoDisplayCommand)) ); - - switch ( message ) - { -#ifdef SYMBIAN_BUILD_GCE - case EPbMsgVideoSurfaceCreated: - { - SurfaceCreatedL( aMessage ); - break; - } - case EPbMsgVideoSurfaceChanged: - { - SurfaceChangedL( aMessage ); - break; - } - case EPbMsgVideoSurfaceRemoved: - { - SurfaceRemoved(); - break; - } -#endif - } } - // ------------------------------------------------------------------------------------------------- // CMPXVideoPlaybackDisplayHandler::SetAspectRatioL() // ------------------------------------------------------------------------------------------------- // TInt CMPXVideoPlaybackDisplayHandler::SetAspectRatioL( TMPXVideoPlaybackCommand aCmd ) { - Q_UNUSED( aCmd ); - TInt aspectRatio = 0; + iCommand = aCmd; + + switch ( aCmd ) + { + case EPbCmdNaturalAspectRatio: + { + iAspectRatio = EMMFNatural; + break; + } + case EPbCmdZoomAspectRatio: + { + iAspectRatio = EMMFZoom; + break; + } + case EPbCmdStretchAspectRatio: + { + iAspectRatio = EMMFStretch; + break; + } + } - iCurrentIndexForAspectRatio = 1; - - return aspectRatio; + return iAspectRatio; } - // ------------------------------------------------------------------------------------------------- // CMPXVideoPlaybackDisplayHandler::SetDefaultAspectRatioL // ------------------------------------------------------------------------------------------------- @@ -165,187 +141,21 @@ { Q_UNUSED( aFileDetails ); Q_UNUSED( aDisplayAspectRatio ); - TInt newAspectRatio = EMMFNatural; - return newAspectRatio; -} - -// ------------------------------------------------------------------------------------------------- -// CMPXVideoPlaybackDisplayHandler::SaveAspectRatioL -// ------------------------------------------------------------------------------------------------- -// -void CMPXVideoPlaybackDisplayHandler::SaveAspectRatioL() -{ - -} - -// ------------------------------------------------------------------------------------------------- -// CMPXVideoPlaybackDisplayHandler::LoadAspectRatioL -// ------------------------------------------------------------------------------------------------- -// -void CMPXVideoPlaybackDisplayHandler::LoadAspectRatioL() -{ + return iAspectRatio; } // ------------------------------------------------------------------------------------------------- // CMPXVideoPlaybackDisplayHandler::UpdateVideoRectL() // ------------------------------------------------------------------------------------------------- // -void CMPXVideoPlaybackDisplayHandler::UpdateVideoRectL( TRect aClipRect, TBool transitionEffect ) +void CMPXVideoPlaybackDisplayHandler::UpdateVideoRectL( TRect aClipRect, TBool transitionEffect ) { MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::UpdateVideoRectL()")); - Q_UNUSED( transitionEffect ); - - iTlXDiff = (TReal32)( aClipRect.iTl.iX ); - iTlYDiff = (TReal32)( aClipRect.iTl.iY ); - iBrXDiff = (TReal32)( aClipRect.iBr.iX ); - iBrYDiff = (TReal32)( aClipRect.iBr.iY ); - -} - -// ------------------------------------------------------------------------------------------------- -// CMPXVideoPlaybackDisplayHandler::UpdateVideoRectTimeOutL() -// ------------------------------------------------------------------------------------------------- -// -TInt CMPXVideoPlaybackDisplayHandler::UpdateVideoRectTimeOutL( TAny* aPtr ) -{ - Q_UNUSED( aPtr ); - return KErrNone; -} - -// ------------------------------------------------------------------------------------------------- -// CMPXVideoPlaybackDisplayHandler::CalculateVideoRectL() -// ------------------------------------------------------------------------------------------------- -// -void CMPXVideoPlaybackDisplayHandler::CalculateVideoRectL() -{ - -} -// ------------------------------------------------------------------------------------------------- -// CMPXVideoPlaybackDisplayHandler::SetVideoRectL() -// ------------------------------------------------------------------------------------------------- -// -void CMPXVideoPlaybackDisplayHandler::SetVideoRectL( TRect aRect ) -{ - Q_UNUSED( aRect ); -} - -#ifdef SYMBIAN_BUILD_GCE + Q_UNUSED( transitionEffect ); -// ------------------------------------------------------------------------------------------------- -// CMPXVideoPlaybackDisplayHandler::AddDisplayWindowL() -// ------------------------------------------------------------------------------------------------- -// -void CMPXVideoPlaybackDisplayHandler::AddDisplayWindowL( CWsScreenDevice& aScreenDevice, - RWindowBase& aWindowBase, - RWindow* aWin ) -{ - Q_UNUSED( aScreenDevice ); - Q_UNUSED( aWindowBase ); - Q_UNUSED( aWin ); -} - -// ------------------------------------------------------------------------------------------------- -// CMPXVideoPlaybackDisplayHandler::SurfaceCreatedL() -// ------------------------------------------------------------------------------------------------- -// -void CMPXVideoPlaybackDisplayHandler::SurfaceCreatedL( CMPXMessage* aMessage ) -{ - Q_UNUSED( aMessage ); -} - -// ------------------------------------------------------------------------------------------------- -// CMPXVideoPlaybackDisplayHandler::SurfaceChangedL() -// ------------------------------------------------------------------------------------------------- -// -void CMPXVideoPlaybackDisplayHandler::SurfaceChangedL( CMPXMessage* aMessage ) -{ - Q_UNUSED( aMessage ); + iRect = aClipRect; } -// ------------------------------------------------------------------------------------------------- -// CMPXVideoPlaybackDisplayHandler::SurfaceRemoved() -// ------------------------------------------------------------------------------------------------- -// -void CMPXVideoPlaybackDisplayHandler::SurfaceRemoved() -{ -} - -// ------------------------------------------------------------------------------------------------- -// CMPXVideoPlaybackDisplayHandler::SetNgaAspectRatioL() -// ------------------------------------------------------------------------------------------------- -// -TInt CMPXVideoPlaybackDisplayHandler::SetNgaAspectRatioL( TMPXVideoPlaybackCommand aCmd ) -{ - Q_UNUSED( aCmd ); - return KErrNone; -} - - -#else - -// ------------------------------------------------------------------------------------------------- -// CMPXVideoPlaybackDisplayHandler::SetDisplayWindowL() -// ------------------------------------------------------------------------------------------------- -// -void CMPXVideoPlaybackDisplayHandler::SetDisplayWindowL( RWsSession& aWs, - CWsScreenDevice& aScreenDevice, - RWindowBase& aWin, - TRect aClipRect ) -{ - Q_UNUSED( aWs ); - Q_UNUSED( aScreenDevice ); - Q_UNUSED( aWin ); - Q_UNUSED( aClipRect ); -} - -// ------------------------------------------------------------------------------------------------- -// CMPXVideoPlaybackDisplayHandler::Restart() -// ------------------------------------------------------------------------------------------------- -// -void CMPXVideoPlaybackDisplayHandler::Restart( RDirectScreenAccess::TTerminationReasons aReason ) -{ - Q_UNUSED( aReason ); -} - - -// ------------------------------------------------------------------------------------------------- -// CMPXVideoPlaybackDisplayHandler::RestartDsaL() -// ------------------------------------------------------------------------------------------------- -// -void CMPXVideoPlaybackDisplayHandler::RestartDsaL() -{ - -} - -// ------------------------------------------------------------------------------------------------- -// CMPXVideoPlaybackDisplayHandler::AbortNow() -// ------------------------------------------------------------------------------------------------- -// -void CMPXVideoPlaybackDisplayHandler::AbortNow( RDirectScreenAccess::TTerminationReasons aReason ) -{ - Q_UNUSED( aReason ); -} - -// ------------------------------------------------------------------------------------------------- -// CMPXVideoPlaybackDisplayHandler::CreateAbortDsaCmdL() -// ------------------------------------------------------------------------------------------------- -// -void CMPXVideoPlaybackDisplayHandler::CreateAbortDsaCmdL() -{ - -} - -// ------------------------------------------------------------------------------------------------- -// CMPXVideoPlaybackDisplayHandler::CreateAspectRatioCommandL() -// ------------------------------------------------------------------------------------------------- -// -TInt CMPXVideoPlaybackDisplayHandler::CreateAspectRatioCommandL( TMPXVideoPlaybackCommand aCmd ) -{ - Q_UNUSED( aCmd ); -} - -#endif - // End of File diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxvideoplaybackviewfiledetails.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxvideoplaybackviewfiledetails.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxvideoplaybackviewfiledetails.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 4 % +// Version : %version: 5 % @@ -64,7 +64,6 @@ mDuration = 0; mTvOutConnected = false; - mTvOutPlayAllowed = true; mDrmProtected = false; mMultiItemPlaylist = false; diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/testmpxvideoviewwrapper.pro --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/testmpxvideoviewwrapper.pro Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/testmpxvideoviewwrapper.pro Wed Jun 23 17:22:59 2010 +0100 @@ -14,7 +14,7 @@ # Description: Project file for building testmpxvideoviewwrapper # # -# Version : %version: 5 % +# Version : %version: 6 % TEMPLATE = app @@ -23,12 +23,11 @@ DEPENDPATH += inc src stub/src stub/inc -INCLUDEPATH += ../inc \ - ../../inc \ - ../../../inc \ - ../../../../inc \ - ../../controlinc \ - ../../viewinc \ +INCLUDEPATH += stub/inc \ + ../inc \ + ../../inc \ + ../../../inc \ + ../../../../inc \ $$MW_LAYER_SYSTEMINCLUDE LIBS += -lmpxcommon.dll \ @@ -43,7 +42,7 @@ mpxvideoplaybackuserinputhandler.h \ mpxvideoplaybackcontrolscontroller.h \ mpxvideoplaybackviewfiledetails.h \ - mpxplaybackutilityimpl.h \ + mpxplaybackutility.h \ ../../viewinc/mpxvideoviewwrapper.h SOURCES += testmpxvideoviewwrapper.cpp \ @@ -52,6 +51,5 @@ mpxvideoplaybackviewfiledetails.cpp \ mpxvideoplaybackcontrolscontroller.cpp \ mpxplaybackutility.cpp \ - mpxplaybackutilityimpl.cpp \ mpxvideoplaybackuserinputhandler.cpp \ ../../viewsrc/mpxvideoviewwrapper.cpp diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testprogressbar/src/testprogressbar.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/src/testprogressbar.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/src/testprogressbar.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 3 % +// Version : %version: 5 % #include @@ -252,21 +252,35 @@ setup(); - // test for tv-out - mController->mFileDetails->mPlaybackMode = EMPXVideoLocal; - mController->mFileDetails->mTvOutConnected = true; - mController->mFileDetails->mTvOutPlayAllowed = false; + // + // pausable + non seekable + // + mController->mFileDetails->mPausableStream = true; + mController->mFileDetails->mSeekable = false; mProgBar->updateWithFileDetails( mController->mFileDetails ); QVERIFY( ! mProgBar->mProgressSlider->isEnabled() ); - // live streaming - mController->mFileDetails->mPlaybackMode = EMPXVideoLiveStreaming; + // + // non pausable + seekable + // + mController->mFileDetails->mPausableStream = false; + mController->mFileDetails->mSeekable = true; mProgBar->updateWithFileDetails( mController->mFileDetails ); QVERIFY( ! mProgBar->mProgressSlider->isEnabled() ); + // + // non pausable + non seekable + // + mController->mFileDetails->mPausableStream = false; + mController->mFileDetails->mSeekable = false; + mProgBar->updateWithFileDetails( mController->mFileDetails ); + QVERIFY( ! mProgBar->mProgressSlider->isEnabled() ); + + // // other cases - mController->mFileDetails->mPlaybackMode = EMPXVideoLocal; - mController->mFileDetails->mTvOutConnected = false; + // + mController->mFileDetails->mPausableStream = true; + mController->mFileDetails->mSeekable = true; mProgBar->updateWithFileDetails( mController->mFileDetails ); QVERIFY( mProgBar->mProgressSlider->isEnabled() ); diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testprogressbar/stub/inc/mpxvideoplaybackviewfiledetails.h --- a/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/stub/inc/mpxvideoplaybackviewfiledetails.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/stub/inc/mpxvideoplaybackviewfiledetails.h Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -70,7 +70,6 @@ bool mPartialPlayback; bool mRNFormat; bool mTvOutConnected; - bool mTvOutPlayAllowed; bool mDrmProtected; bool mMultiItemPlaylist; diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testprogressbar/stub/src/mpxvideoplaybackviewfiledetails.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/stub/src/mpxvideoplaybackviewfiledetails.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/stub/src/mpxvideoplaybackviewfiledetails.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -67,7 +67,6 @@ mDuration = 100; mTvOutConnected = false; - mTvOutPlayAllowed = true; mDrmProtected = false; mVideoHeight = 0; diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/src/teststatuspanecontrol.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/src/teststatuspanecontrol.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/src/teststatuspanecontrol.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 5 % +// Version : %version: 6 % #include @@ -34,6 +34,7 @@ #include "hbvideobaseplaybackview.h" #include "mpxvideoplaybackdocumentloader.h" #include "hblabel.h" +#include "hbgroupbox.h" #define private public #define protected public @@ -88,12 +89,11 @@ mControlsController = new QMPXVideoPlaybackControlsController( mBaseVideoView, mFileDetails ); - + mStatusPane = new QMPXVideoPlaybackStatusPaneControl( mControlsController, EMPXStatusPane, NULL, - 0 ); - + 0 ); } // --------------------------------------------------------------------------- @@ -104,6 +104,12 @@ { MPX_ENTER_EXIT(_L("TestStatusPaneControl::cleanup()")); + if ( mStatusPane ) + { + delete mStatusPane; + mStatusPane = NULL; + } + if ( mBaseVideoView ) { delete mBaseVideoView; @@ -121,12 +127,6 @@ delete mControlsController; mControlsController = NULL; } - - if ( mStatusPane ) - { - delete mStatusPane; - mStatusPane = NULL; - } } // --------------------------------------------------------------------------- @@ -145,6 +145,8 @@ mStatusPane->setMenu( mFileDetails ); QVERIFY( mControlsController->view()->menu()->isEmpty() ); + + cleanup(); } // --------------------------------------------------------------------------- @@ -156,17 +158,22 @@ MPX_ENTER_EXIT(_L("TestStatusPaneControl::testSetVisible()")); setup(); - + mStatusPane->updateControlsWithFileDetails( mFileDetails ); + // 1. Set visible mStatusPane->setVisible( true ); - QVERIFY( mStatusPane->isVisible() ); - QVERIFY( mStatusPane->mTitleLabel->isVisible() ); - + QVERIFY( mControlsController->view()->mStatusBarVisible ); + QVERIFY( mControlsController->view()->mTitleBarVisible ); + QVERIFY( mStatusPane->mTitleLayout->isVisible() ); + // 2. Set invisible - mStatusPane->setVisible( false ); - QVERIFY( ! mStatusPane->isVisible() ); - QVERIFY( ! mStatusPane->mTitleLabel->isVisible() ); - + mStatusPane->setVisible( false ); + QVERIFY( mControlsController->view()->menu()->isEmpty() ); + QVERIFY( ! mControlsController->view()->mStatusBarVisible ); + QVERIFY( ! mControlsController->view()->mTitleBarVisible ); + QVERIFY( ! mStatusPane->mTitleLayout->isVisible() ); + + cleanup(); } // --------------------------------------------------------------------------- @@ -178,34 +185,36 @@ MPX_ENTER_EXIT(_L("TestStatusPaneControl::testUpdateControlsWithFileDetails()")); setup(); - + + QString title = "Title"; + // 1. test for full creen mode mControlsController->mViewMode = EFullScreenView; - - mFileDetails->mTvOutConnected = true; - + mControlsController->mFileDetails->mTitle = title; mStatusPane->updateControlsWithFileDetails( mFileDetails ); - + + QVERIFY( mStatusPane->mTitleLabel->mString == title ); + QVERIFY( mStatusPane->mTitleGroupBox->mString == title ); + QVERIFY( mStatusPane->mTitleLabel->isVisible() ); + QVERIFY( ! mStatusPane->mTitleGroupBox->isVisible() ); QVERIFY( mControlsController->view()->viewFlags() == HbView::HbViewFlags( HbView::ViewTitleBarTransparent | HbView::ViewStatusBarTransparent )); - + // 2. test for detial view mode - mControlsController->mViewMode = EDetailsView; - - mFileDetails->mTvOutConnected = true; - + mControlsController->mViewMode = EDetailsView; + mStatusPane->updateControlsWithFileDetails( mFileDetails ); + + QVERIFY( mControlsController->view()->viewFlags() == HbView::ViewFlagNone ); + QVERIFY( ! mStatusPane->mTitleLabel->isVisible() ); + QVERIFY( mStatusPane->mTitleGroupBox->isVisible() ); + + // 3. test for audio only mode + mControlsController->mViewMode = EAudioOnlyView; mStatusPane->updateControlsWithFileDetails( mFileDetails ); QVERIFY( mControlsController->view()->viewFlags() == HbView::ViewFlagNone ); - // 3. test for audio only mode - mControlsController->mViewMode = EAudioOnlyView; - - mFileDetails->mTvOutConnected = true; - - mStatusPane->updateControlsWithFileDetails( mFileDetails ); - - QVERIFY( mControlsController->view()->viewFlags() == HbView::ViewFlagNone ); + cleanup(); } // --------------------------------------------------------------------------- @@ -225,6 +234,8 @@ // 2. test for second block of cases: mStatusPane->setVisibility( EPbStateInitialising ); QVERIFY( mControlsController->view()->menu()->isEmpty() ); + + cleanup(); } // --------------------------------------------------------------------------- @@ -240,6 +251,8 @@ mStatusPane->controlListUpdated( mFileDetails ); QVERIFY( mControlsController->view()->menu()->isEmpty() ); + + cleanup(); } // --------------------------------------------------------------------------- @@ -259,6 +272,8 @@ QVERIFY( mControlsController->mTimerAction == EMPXTimerCancel ); disconnect( this, SIGNAL( commandSignal() ), mStatusPane, SLOT( handleAboutToShow() ) ); + + cleanup(); } // --------------------------------------------------------------------------- @@ -277,7 +292,9 @@ QVERIFY( mControlsController->mTimerAction == EMPXTimerReset ); - disconnect( this, SIGNAL( commandSignal() ), mStatusPane, SLOT( handleAboutToHide() ) ); + disconnect( this, SIGNAL( commandSignal() ), mStatusPane, SLOT( handleAboutToHide() ) ); + + cleanup(); } // --------------------------------------------------------------------------- @@ -297,6 +314,8 @@ QVERIFY( mControlsController->mViewMode == EFullScreenView ); disconnect( this, SIGNAL( commandSignal() ), mStatusPane, SLOT( openFullScreenView() ) ); + + cleanup(); } // End of file diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/inc/hbgroupbox.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/inc/hbgroupbox.h Wed Jun 23 17:22:59 2010 +0100 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "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: Stub Implementation of HbGroupBox +* +*/ + +// Version : %version: 1 % + + + +#ifndef HBGROUPBOX_H_ +#define HBGROUPBOX_H_ + +#include + + +class HbGroupBox : public HbWidget +{ + Q_OBJECT + + public: + HbGroupBox(); + virtual ~HbGroupBox(); + + public: + void setVisible( bool visible ); + bool isVisible(); + void setHeading( QString string ); + + public: + bool mVisible; + QString mString; +}; + +#endif /*HBGROUPBOX_H_*/ + diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/inc/hblabel.h --- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/inc/hblabel.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/inc/hblabel.h Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -34,13 +34,14 @@ virtual ~HbLabel(); public: - void setVisible( bool visible ); - + void setVisible( bool visible ); bool isVisible(); + void setPlainText( QString string ); public: bool mVisible; + QString mString; }; -#endif /*HBPUSHBUTTON_H*/ +#endif /*HBLABEL_H_*/ diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/inc/hbvideobaseplaybackview.h --- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/inc/hbvideobaseplaybackview.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/inc/hbvideobaseplaybackview.h Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 5 % +// Version : %version: 6 % @@ -25,16 +25,18 @@ #define __HBVIDEOBASEPLAYBACKVIEW_H__ // Include Files +#include #include - // Constants // Forward Declarations // Class Definitions +class HbAction; +class HbMenu; -class HbVideoBasePlaybackView : public HbView +class HbVideoBasePlaybackView : public HbWidget { Q_OBJECT @@ -55,14 +57,21 @@ void setViewFlags( HbView::HbViewFlags flags ); HbView::HbViewFlags viewFlags(); - protected slots: + void setTitleBarVisible( bool visible ); + void setStatusBarVisible( bool visible ); + void setNavigationAction(HbAction *action); + HbMenu *menu(); + public slots: virtual void closePlaybackView(); public: bool mViewActive; + bool mTitleBarVisible; + bool mStatusBarVisible; + + HbMenu *mMenu; HbView::HbViewFlags mFlag; - }; #endif // __HBVIDEOBASEPLAYBACKVIEW_H__ diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/inc/mpxvideoplaybackviewfiledetails.h --- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/inc/mpxvideoplaybackviewfiledetails.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/inc/mpxvideoplaybackviewfiledetails.h Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -70,7 +70,6 @@ bool mPartialPlayback; bool mRNFormat; bool mTvOutConnected; - bool mTvOutPlayAllowed; bool mDrmProtected; bool mMultiItemPlaylist; diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/hbgroupbox.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/hbgroupbox.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "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: Implementation of HbGroupBox +* +*/ + +// Version : %version: 1 % + + +#include "hbgroupbox.h" + +// ------------------------------------------------------------------------------------------------- +// HbGroupBox::HbGroupBox +// ------------------------------------------------------------------------------------------------- +// +HbGroupBox::HbGroupBox() +{ +} + +// ------------------------------------------------------------------------------------------------- +// HbGroupBox::~HbGroupBox +// ------------------------------------------------------------------------------------------------- +// +HbGroupBox::~HbGroupBox() +{ +} + +// ------------------------------------------------------------------------------------------------- +// HbGroupBox::setVisible +// ------------------------------------------------------------------------------------------------- +// +void HbGroupBox::setVisible( bool visible ) +{ + mVisible = visible; +} + +// ------------------------------------------------------------------------------------------------- +// HbGroupBox::isVisible +// ------------------------------------------------------------------------------------------------- +// +bool HbGroupBox::isVisible() +{ + return mVisible; +} + +// ------------------------------------------------------------------------------------------------- +// HbGroupBox::setHeading +// ------------------------------------------------------------------------------------------------- +// +void HbGroupBox::setHeading( QString string ) +{ + mString = string; +} + +// End of file diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/hblabel.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/hblabel.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/hblabel.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,13 +15,13 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % #include "hblabel.h" // ------------------------------------------------------------------------------------------------- -// HbPushButton::HbPushButton +// HbLabel::HbLabel // ------------------------------------------------------------------------------------------------- // HbLabel::HbLabel() @@ -54,5 +54,13 @@ return mVisible; } +// ------------------------------------------------------------------------------------------------- +// HbLabel::setPlainText +// ------------------------------------------------------------------------------------------------- +// +void HbLabel::setPlainText( QString string ) +{ + mString = string; +} // End of file diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/hbvideobaseplaybackview.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/hbvideobaseplaybackview.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/hbvideobaseplaybackview.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,12 +15,14 @@ * */ -// Version : %version: 4 % +// Version : %version: 5 % // Include Files #include +#include +#include #include "../inc/hbvideobaseplaybackview.h" @@ -33,6 +35,7 @@ // HbVideoBasePlaybackView::HbVideoBasePlaybackView() { + mMenu = new HbMenu(); mViewActive = false; } @@ -42,6 +45,11 @@ // HbVideoBasePlaybackView::~HbVideoBasePlaybackView() { + if ( mMenu ) + { + delete mMenu; + mMenu = NULL; + } } // ------------------------------------------------------------------------------------------------- @@ -116,4 +124,39 @@ return mFlag; } +// ------------------------------------------------------------------------------------------------- +// HbVideoBasePlaybackView::setTitleBarVisible() +// ------------------------------------------------------------------------------------------------- +// +void HbVideoBasePlaybackView::setTitleBarVisible( bool visible ) +{ + mTitleBarVisible = visible; +} + +// ------------------------------------------------------------------------------------------------- +// HbVideoBasePlaybackView::setStatusBarVisible() +// ------------------------------------------------------------------------------------------------- +// +void HbVideoBasePlaybackView::setStatusBarVisible( bool visible ) +{ + mStatusBarVisible = visible; +} + +// ------------------------------------------------------------------------------------------------- +// HbVideoBasePlaybackView::setNavigationAction() +// ------------------------------------------------------------------------------------------------- +// +void HbVideoBasePlaybackView::setNavigationAction( HbAction *action ) +{ +} + +// ------------------------------------------------------------------------------------------------- +// HbVideoBasePlaybackView::menu() +// ------------------------------------------------------------------------------------------------- +// +HbMenu* HbVideoBasePlaybackView::menu() +{ + return mMenu; +} + // EOF diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/mpxvideoplaybackdocumentloader.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/mpxvideoplaybackdocumentloader.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/mpxvideoplaybackdocumentloader.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,12 +15,13 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % -#include -#include -#include +#include + +#include "hblabel.h" +#include "hbgroupbox.h" #include "mpxvideo_debug.h" #include "mpxvideoplaybackdocumentloader.h" @@ -83,14 +84,11 @@ QGraphicsWidget *object = NULL; - if ( name == "transparentWindow" ) - { - MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::creating transparentWindow") ); - - object = new HbTransparentWindow(); + if ( name == "titleLayout" ) + { + object = new QGraphicsWidget(); object->setObjectName( name ); - MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::appending to object list") ); mWidgets.append( object ); } else if ( name == "title" ) @@ -99,6 +97,12 @@ object->setObjectName( name ); mWidgets.append( object ); } + else if ( name == "titleGroupBox" ) + { + object = new HbGroupBox(); + object->setObjectName( name ); + mWidgets.append( object ); + } return object; } diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/mpxvideoplaybackviewfiledetails.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/mpxvideoplaybackviewfiledetails.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/mpxvideoplaybackviewfiledetails.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -67,7 +67,6 @@ mDuration = 0; mTvOutConnected = false; - mTvOutPlayAllowed = true; mDrmProtected = false; mVideoHeight = 0; diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/teststatuspanecontrol.pro --- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/teststatuspanecontrol.pro Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/teststatuspanecontrol.pro Wed Jun 23 17:22:59 2010 +0100 @@ -14,7 +14,7 @@ # Description: Project file for building teststatuspanecontrol # # -# Version : %version: 2 % +# Version : %version: 3 % TEMPLATE = app @@ -41,7 +41,8 @@ hbvideobaseplaybackview.h \ mpxvideoplaybackdocumentloader.h \ mpxvideoplaybackfullscreencontrol.h \ - hblabel.h + hblabel.h \ + hbgroupbox.h SOURCES += ../../../controlsrc/mpxvideoplaybackstatuspanecontrol.cpp \ src/teststatuspanecontrol.cpp \ @@ -50,5 +51,6 @@ hbvideobaseplaybackview.cpp \ mpxvideoplaybackdocumentloader.cpp \ mpxvideoplaybackfullscreencontrol.cpp \ - hblabel.cpp + hblabel.cpp \ + hbgroupbox.cpp \ No newline at end of file diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/inc/mpxvideoplaybackviewfiledetails.h --- a/videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/inc/mpxvideoplaybackviewfiledetails.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/inc/mpxvideoplaybackviewfiledetails.h Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -65,7 +65,6 @@ bool mPartialPlayback; bool mRNFormat; bool mTvOutConnected; - bool mTvOutPlayAllowed; bool mDrmProtected; bool mMultiItemPlaylist; diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/src/centralrepository.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/src/centralrepository.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/src/centralrepository.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -25,7 +25,7 @@ #include "centralrepository.h" -CRepository* CRepository::NewLC( TUid aRepositoryUid ) +CRepository* CRepository::NewLC( TUid /* aRepositoryUid */ ) { CRepository* self = new (ELeave) CRepository(); @@ -35,9 +35,9 @@ } -TInt CRepository::Get(TUint32 aKey, TInt& aValue) +TInt CRepository::Get( TUint32 /* aKey */, TInt& aValue ) { - aValue = 10; + aValue = 10; return KErrNone; } diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/src/mpxvideoplaybackviewfiledetails.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/src/mpxvideoplaybackviewfiledetails.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/src/mpxvideoplaybackviewfiledetails.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -58,7 +58,6 @@ mDuration = 0; mTvOutConnected = false; - mTvOutPlayAllowed = true; mDrmProtected = false; mMultiItemPlaylist = false; diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/src/mpxvideoviewwrapper.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/src/mpxvideoviewwrapper.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/src/mpxvideoviewwrapper.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 2 % +// Version : %version: 3 % @@ -202,7 +202,6 @@ iFileDetails->mRNFormat = false; iFileDetails->mDuration = 100; iFileDetails->mTvOutConnected = false; - iFileDetails->mTvOutPlayAllowed = true; iFileDetails->mDrmProtected = false; iFileDetails->mMultiItemPlaylist = false; iFileDetails->mVideoHeight = 320; diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/stub/inc/mpxvideoplaybackviewfiledetails.h --- a/videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/stub/inc/mpxvideoplaybackviewfiledetails.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/stub/inc/mpxvideoplaybackviewfiledetails.h Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 2 % +// Version : %version: 3 % @@ -70,7 +70,6 @@ bool mPartialPlayback; bool mRNFormat; bool mTvOutConnected; - bool mTvOutPlayAllowed; bool mDrmProtected; bool mMultiItemPlaylist; diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/stub/src/mpxvideoplaybackviewfiledetails.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/stub/src/mpxvideoplaybackviewfiledetails.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/stub/src/mpxvideoplaybackviewfiledetails.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 2 % +// Version : %version: 3 % @@ -64,7 +64,6 @@ mDuration = 0; mTvOutConnected = false; - mTvOutPlayAllowed = true; mDrmProtected = false; mMultiItemPlaylist = false; diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/stub/src/mpxvideoviewwrapper.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/stub/src/mpxvideoviewwrapper.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/stub/src/mpxvideoviewwrapper.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 3 % +// Version : %version: 4 % @@ -228,7 +228,6 @@ iFileDetails->mRNFormat = false; iFileDetails->mDuration = 100; iFileDetails->mTvOutConnected = false; - iFileDetails->mTvOutPlayAllowed = true; iFileDetails->mDrmProtected = false; iFileDetails->mMultiItemPlaylist = false; iFileDetails->mVideoHeight = 320; diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/inc/testmpxvideoplaybackcontrolscontroller.h --- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/inc/testmpxvideoplaybackcontrolscontroller.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/inc/testmpxvideoplaybackcontrolscontroller.h Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 3 % +// Version : %version: 5 % #ifndef __TESTMPXVIDEOPLAYBACKCONTROLSCONTROLLER_H__ #define __TESTMPXVIDEOPLAYBACKCONTROLSCONTROLLER_H__ @@ -56,14 +56,7 @@ private slots: - // - // test addFileDetails() - // void testAddFileDetails(); - - // - // test handleEvent() - // void testHandleEventSetPosition(); void testHandleEventSetDuration(); void testHandleEventStateChanged(); @@ -117,11 +110,20 @@ // // test private slot attachVideo() // - void testslot_sendVideo(); + void testslot_sendVideo(); + + // + // test private slot handleOrientationChanged() + // + void testslot_handleOrientationChanged(); + + void testslot_handleRNLogoVisibleChanged(); + void testslot_handleRNLogoTimeout(); + void testIsRNLogoBitmapVisible(); signals: - void commandSignal(); + void commandSignal( Qt::Orientation ); private: @@ -136,6 +138,4 @@ #endif // __TESTMPXVIDEOPLAYBACKCONTROLSCONTROLLER_H__ // End of file - - diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/src/testmpxvideoplaybackcontrolscontroller.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/src/testmpxvideoplaybackcontrolscontroller.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/src/testmpxvideoplaybackcontrolscontroller.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 6 % +// Version : %version: 9 % #include #include @@ -55,7 +55,6 @@ { HbApplication app(argc, argv); HbMainWindow window; - TestMPXVideoPlaybackControlsController tv; char *pass[3]; @@ -68,7 +67,6 @@ return res; } - // --------------------------------------------------------------------------- // init // --------------------------------------------------------------------------- @@ -78,7 +76,11 @@ MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackControlsController::init()")); mBaseVideoView = new HbVideoBasePlaybackView(); - mFileDetails = new QMPXVideoPlaybackViewFileDetails(); + + if ( ! mFileDetails ) + { + mFileDetails = new QMPXVideoPlaybackViewFileDetails(); + } mViewWrapper = CMPXVideoViewWrapper::NewL( mBaseVideoView ); mController = new QMPXVideoPlaybackControlsController( mBaseVideoView, mViewWrapper, @@ -113,32 +115,40 @@ void TestMPXVideoPlaybackControlsController::testAddFileDetails() { MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testAddFileDetails()") ); - - init(); - + // // local real media with no video // - mFileDetails->mClipName = QString("testClip.rm"); - mFileDetails->mMimeType = QString("video/x-pn-realvideo"); - + mFileDetails = new QMPXVideoPlaybackViewFileDetails(); + mFileDetails->mClipName = QString( "testClip.rm" ); + mFileDetails->mMimeType = QString( "video/x-pn-realvideo" ); + + init(); + mController->addFileDetails( mFileDetails ); QVERIFY( mController->mFileDetails->mRNFormat == true ); QVERIFY( mController->mViewMode == EAudioOnlyView ); QVERIFY( mController->mControlsConfig->mUpdateControlsWithFileDetails == true ); QVERIFY( mController->mControlsConfig->mState == EMPXControlCmdTvOutConnected ); - + + cleanup(); + // // local 3GPP media with video-only - // + // + mFileDetails = new QMPXVideoPlaybackViewFileDetails(); + mFileDetails->mClipName = QString("testClip.3gp"); mFileDetails->mMimeType = QString("video/3gpp"); mFileDetails->mVideoEnabled = true; + mFileDetails->mTvOutConnected = true; + + init(); + mController->mViewMode = EFullScreenView; - mFileDetails->mTvOutConnected = true; QFileInfo videoOnlyFile( mFileDetails->mClipName ); - + mController->addFileDetails( mFileDetails ); QVERIFY( mController->mFileDetails->mRNFormat == false ); @@ -167,16 +177,21 @@ break; } } - + cleanup(); + // // non-local audio-video media, TvOut is not connected // + mFileDetails = new QMPXVideoPlaybackViewFileDetails(); + mFileDetails->mClipName = QString("rtsp:://www.youtube.com/testClip.rm"); mFileDetails->mPlaybackMode = EMPXVideoStreaming; mFileDetails->mTvOutConnected = false; mFileDetails->mAudioEnabled = true; mFileDetails->mTitle = QString("Clip Title"); - + + init(); + mController->addFileDetails( mFileDetails ); QVERIFY( mController->mFileDetails->mRNFormat == true ); @@ -210,11 +225,8 @@ int value = 20000; mController->handleEvent( EMPXControlCmdSetPosition, value ); - - for ( int i = 0 ; i < mController->mControls.count() ; i++ ) - { - QVERIFY( mController->mControls[i]->mPosition == ( value / KPbMilliMultiplier ) ); - } + + QVERIFY( mController->mControls[0]->mPosition == ( value / KPbMilliMultiplier ) ); cleanup(); } @@ -231,11 +243,8 @@ int value = 30000; mController->handleEvent( EMPXControlCmdSetDuration, value ); - - for ( int i = 0 ; i < mController->mControls.count() ; i++ ) - { - QVERIFY( mController->mControls[i]->mDuration == ( value / KPbMilliMultiplier ) ); - } + + QVERIFY( mController->mControls[0]->mDuration == ( value / KPbMilliMultiplier ) ); cleanup(); } @@ -250,7 +259,8 @@ init(); TMPXVideoPlaybackControlCommandIds event = EMPXControlCmdStateChanged; - + mController->mOrientation = Qt::Horizontal; + // // state change (EPbStateInitialising) // @@ -339,6 +349,8 @@ { MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::verifyHandleEventStateChangedResult()")); + mController->mOrientation = Qt::Horizontal; + if ( value == EPbStateInitialised && ( mController->mFileDetails->mPlaybackMode == EMPXVideoStreaming || mController->mFileDetails->mPlaybackMode == EMPXVideoLiveStreaming ) ) @@ -393,10 +405,7 @@ { mController->handleEvent( EMPXControlCmdSetAspectRatio, i ); - for ( int j = 0 ; j < mController->mControls.count() ; j++ ) - { - QVERIFY( mController->mControls[j]->mAspectRatio == i ); - } + QVERIFY( mController->mControls[0]->mAspectRatio == i ); } cleanup(); @@ -415,10 +424,7 @@ mController->handleEvent( EMPXControlCmdSetDownloadSize, value ); - for ( int i = 0 ; i < mController->mControls.count() ; i++ ) - { - QVERIFY( mController->mControls[i]->mDownloadSize == value ); - } + QVERIFY( mController->mControls[0]->mDownloadSize == value ); cleanup(); } @@ -435,11 +441,8 @@ int value = 55; mController->handleEvent( EMPXControlCmdDownloadUpdated, value ); - - for ( int i = 0 ; i < mController->mControls.count() ; i++ ) - { - QVERIFY( mController->mControls[i]->mDownloadPosition == value ); - } + + QVERIFY( mController->mControls[0]->mDownloadPosition == value ); cleanup(); } @@ -456,11 +459,8 @@ int value = 60; mController->handleEvent( EMPXControlCmdDownloadComplete, value ); - - for ( int i = 0 ; i < mController->mControls.count() ; i++ ) - { - QVERIFY( mController->mControls[i]->mDownloadPosition == value ); - } + + QVERIFY( mController->mControls[0]->mDownloadPosition == value ); cleanup(); } @@ -578,7 +578,6 @@ QVERIFY( ( mController->mFileDetails->mPlaybackMode == EMPXVideoLocal )? mController->mThumbNailState == EThumbNailRequsted : mController->mThumbNailState == EThumbNailNotAvailable ); - QVERIFY( mController->mFileDetails->mTvOutPlayAllowed == value ); QVERIFY( mController->mViewMode == EAudioOnlyView ); QVERIFY( mController->mControlsConfig->mState == EMPXControlCmdTvOutConnected ); QVERIFY( mController->mThumbnailManager->mThumbSize == ThumbnailManager::ThumbnailLarge ); @@ -588,13 +587,11 @@ else if ( mController->mFileDetails->mVideoEnabled ) { QVERIFY( mController->mViewTransitionIsGoingOn == true ); - QVERIFY( mController->mFileDetails->mTvOutPlayAllowed == true ); QVERIFY( mController->mViewMode == EFullScreenView ); } else if ( ! mController->mFileDetails->mVideoEnabled ) { QVERIFY( mController->mViewTransitionIsGoingOn == false ); - QVERIFY( mController->mFileDetails->mTvOutPlayAllowed == true ); QVERIFY( mController->mViewMode == EAudioOnlyView ); } @@ -782,7 +779,8 @@ MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleTappedOnScreen()") ); init(); - + mController->mOrientation = Qt::Horizontal; + // // preset variables // @@ -792,23 +790,23 @@ // // playing state // - mController->mState = EPbStatePlaying; - mBaseVideoView->mouseReleaseEvent(0); + mController->mState = EPbStatePlaying; + mBaseVideoView->mouseReleaseEvent(0); QVERIFY( mController->mControlsTimer->isActive() == true ); for ( int i = 0 ; i < mController->mControls.count() ; i++ ) { - QVERIFY( mController->mControls[i]->mVisibilityState == EPbStatePlaying ); + QVERIFY( mController->mControls[i]->mVisibilityState == mController->mState ); } // // pause state // mController->mState = EPbStatePaused; - mBaseVideoView->mouseReleaseEvent(0); + mBaseVideoView->mouseReleaseEvent(0); QVERIFY( mController->mControlsTimer->isActive() == false ); for ( int i = 0 ; i < mController->mControls.count() ; i++ ) { - QVERIFY( mController->mControls[i]->mVisibilityState == EPbStatePaused ); + QVERIFY( mController->mControls[i]->mVisibilityState == mController->mState ); } cleanup(); @@ -1049,8 +1047,162 @@ cleanup(); } +// ------------------------------------------------------------------------------------------------- +// TestMPXVideoPlaybackControlsController::testslot_handleOrientationChanged +// ------------------------------------------------------------------------------------------------- +// +void TestMPXVideoPlaybackControlsController::testslot_handleOrientationChanged() +{ + MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testslot_handleOrientationChanged()") ); + + // + // initialize controlscontroller + // + init(); + + // + // connect signal with controller handleOrientationChanged() slot + // + bool res = connect( this, SIGNAL( commandSignal( Qt::Orientation ) ), + mController, SLOT( handleOrientationChanged( Qt::Orientation ) ) ); + + // + // emit signal, this will in turns invoke mController handleOrientationChanged() slot + // + mController->mOrientation = Qt::Vertical; + mController->mState = EPbStatePlaying; + + emit commandSignal( Qt::Horizontal ); + + QVERIFY( mController->mOrientation == Qt::Horizontal ); + + for ( int i = 0 ; i < mController->mControls.count() ; i++ ) + { + QVERIFY( mController->mControls[i]->mVisibilityState == mController->mState ); + } + + // + // disconnect signal + // + disconnect( this, SIGNAL( commandSignal( Qt::Orientation ) ), + mController, SLOT( handleOrientationChanged( Qt::Orientation ) ) ); + + // + // clean up + // + cleanup(); +} + +// ------------------------------------------------------------------------------------------------- +// TestMPXVideoPlaybackControlsController::testslot_handleRNLogoVisibleChanged +// ------------------------------------------------------------------------------------------------- +// +void TestMPXVideoPlaybackControlsController::testslot_handleRNLogoVisibleChanged() +{ + MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testslot_handleRNLogoVisibleChanged()") ); + + // + // initialize controlscontroller + // + init(); + + // + // connect signal with controller handleRNLogoVisibleChanged() slot + // + bool res = connect( this, SIGNAL( commandSignal() ), + mController, SLOT( handleRNLogoVisibleChanged() ) ); + + // + // emit signal, this will in turns invoke mController handleRNLogoVisibleChanged() slot + // + emit commandSignal(); + + QVERIFY( mController->mRNLogoTimer->isActive() ); + QVERIFY( mController->mRNLogoTimer->interval() == KMPXRNLogoTimeOut ); + + // + // disconnect signal + // + disconnect( this, SIGNAL( commandSignal() ), + mController, SLOT( handleRNLogoVisibleChanged() ) ); + + // + // clean up + // + cleanup(); +} + +// ------------------------------------------------------------------------------------------------- +// TestMPXVideoPlaybackControlsController::testslot_handleRNLogoTimeout +// ------------------------------------------------------------------------------------------------- +// +void TestMPXVideoPlaybackControlsController::testslot_handleRNLogoTimeout() +{ + MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testslot_handleRNLogoTimeout()") ); + + // + // initialize controlscontroller + // + init(); + + if ( ! mController->mRNLogoTimer ) + { + mController->mRNLogoTimer = new QTimer( mController ); + } + + // + // connect signal with controller handleRNLogoTimeout() slot + // + bool res = connect( this, SIGNAL( commandSignal() ), + mController, SLOT( handleRNLogoTimeout() ) ); + + // + // emit signal, this will in turns invoke mController handleRNLogoTimeout() slot + // + emit commandSignal(); + + QVERIFY( ! mController->mRNLogoTimer->isActive() ); + QVERIFY( mController->mControlsConfig->mState == KControlListsUpdated ); + QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdRealOneBitmapTimeout ); + + // + // disconnect signal + // + disconnect( this, SIGNAL( commandSignal() ), + mController, SLOT( handleRNLogoTimeout() ) ); + + // + // clean up + // + cleanup(); +} + +// ------------------------------------------------------------------------------------------------- +// TestMPXVideoPlaybackControlsController::testIsRNLogoBitmapVisible +// ------------------------------------------------------------------------------------------------- +// +void TestMPXVideoPlaybackControlsController::testIsRNLogoBitmapVisible() +{ + MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testIsRNLogoBitmapVisible()")); + + init(); + + QVERIFY( mController->isRNLogoBitmapInControlList() ); + + // + // Remove RN logo from the list + // + for ( int i = 0 ; i < mController->mControls.count() ; i++ ) + { + if( mController->mControls[i]->mControlIndex == EMPXRealLogoBitmap ) + { + mController->mControls.removeAt( i ); + } + } + + QVERIFY( ! mController->isRNLogoBitmapInControlList() ); + + cleanup(); +} // End of file - - - diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/mpxvideoplaybackcontrol.hrh --- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/mpxvideoplaybackcontrol.hrh Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/mpxvideoplaybackcontrol.hrh Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: % +// Version : %version: 2 % #ifndef MPXVIDEOPLAYBACKCONTROL_HRH_ @@ -57,7 +57,6 @@ // // Bitmaps // - EMPXBlackBitmap, EMPXIndicatorBitmap, EMPXRealLogoBitmap, @@ -89,7 +88,8 @@ EMPXControlCmdSoftKeyPressed, EMPXControlCmdFullScreenViewOpened, EMPXControlCmdDetailsViewOpened, - EMPXControlCmdAudionOnlyViewOpened + EMPXControlCmdAudionOnlyViewOpened, + EMPXControlCmdRemoveRNLogo }; enum TMPXVideoSeekingType diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/mpxvideoplaybackfullscreencontrol.h --- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/mpxvideoplaybackfullscreencontrol.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/mpxvideoplaybackfullscreencontrol.h Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -114,7 +114,6 @@ TMPXPlaybackState mState; TMPXPlaybackState mVisibilityState; - protected: QMPXVideoPlaybackControlsController* mController; HbWidget *mControl; TMPXVideoPlaybackControls mControlIndex; diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/mpxvideoplaybackviewfiledetails.h --- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/mpxvideoplaybackviewfiledetails.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/mpxvideoplaybackviewfiledetails.h Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -70,7 +70,6 @@ bool mPartialPlayback; bool mRNFormat; bool mTvOutConnected; - bool mTvOutPlayAllowed; bool mDrmProtected; bool mMultiItemPlaylist; diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackcontrolconfiguration.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackcontrolconfiguration.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackcontrolconfiguration.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -41,7 +41,6 @@ QMPXVideoPlaybackControlsController* controller) : mControlsController( controller ) { - createControlList(); } // ------------------------------------------------------------------------------------------------- @@ -64,17 +63,11 @@ { MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::createControlList()")); - QMPXVideoPlaybackViewFileDetails* fileDetails = mControlsController->fileDetails(); + addControlToList( EMPXBufferingAnimation ); + addControlToList( EMPXStatusPane ); + addControlToList( EMPXRealLogoBitmap ); - if ( fileDetails->mPlaybackMode != EMPXVideoLocal ) - { - // - // if it's not local mode, add branding animation control to show while initializing - // - addControlToList( EMPXBufferingAnimation ); - } - - addControlToList( EMPXStatusPane ); + emit controlListUpdated(); } // ------------------------------------------------------------------------------------------------- @@ -112,8 +105,8 @@ { mState = KControlListUpdated; } - - + + emit controlListUpdated(); } // ------------------------------------------------------------------------------------------------- diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackdocumentloader.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackdocumentloader.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackdocumentloader.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 3 % +// Version : %version: 4 % @@ -178,6 +178,16 @@ MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::appending[HbRatingSlider] to object list") ); mWidgets.append( object ); } + else if ( name == "rnLogoBitmap" ) + { + MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::creating rnLogoBitmap") ); + + object = new HbWidget(); + object->setObjectName( name ); + + MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::appending[rnLogoBitmap] to object list") ); + mWidgets.append( object ); + } return object; } diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackfullscreencontrol.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackfullscreencontrol.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackfullscreencontrol.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 2 % +// Version : %version: 3 % @@ -62,7 +62,6 @@ // void QMPXVideoPlaybackFullScreenControl::setVisible( bool visible ) { - //mControl->setVisible( visible ); mVisible = visible; } @@ -72,7 +71,6 @@ // bool QMPXVideoPlaybackFullScreenControl::isVisible() { - //return mControl->isVisible(); return mVisible; } diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackviewfiledetails.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackviewfiledetails.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackviewfiledetails.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -67,7 +67,6 @@ mDuration = 0; mTvOutConnected = false; - mTvOutPlayAllowed = true; mDrmProtected = false; mVideoHeight = 0; diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/inc/testvideoplaybackview.h --- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/inc/testvideoplaybackview.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/inc/testvideoplaybackview.h Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: % +// Version : %version: 6 % #ifndef __TESTVIDEOPLAYBACKVIEW_H__ #define __TESTVIDEOPLAYBACKVIEW_H__ @@ -60,7 +60,7 @@ void testShowDialog(); void testGetWindow(); void testIssuePlayCommand(); - void testEvent(); + void testEventFilter(); void testClosePlaybackView(); void testMousePressEvent(); void testMouseReleaseEvent(); diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/src/testvideoplaybackview.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/src/testvideoplaybackview.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/src/testvideoplaybackview.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: % +// Version : %version: 9 % #include #include @@ -134,13 +134,11 @@ verifyHandlePluginError( KErrMMDRMNotAuthorized ); verifyHandlePluginError( KErrCANoRights ); verifyHandlePluginError( KErrCANoPermission ); - verifyHandlePluginError( KMPXVideoTvOutPlaybackNotAllowedClose ); // // playback view remains open after displaying these error notes // verifyHandlePluginError( KMPXVideoCallOngoingError, false ); - verifyHandlePluginError( KMPXVideoTvOutPlaybackNotAllowed, false ); verifyHandlePluginError( KMPXVideoPlayOver2GDuringVoiceCallError, false ); // @@ -211,7 +209,7 @@ cleanup(); } -void TestVideoPlaybackView::testEvent() +void TestVideoPlaybackView::testEventFilter() { setup(); @@ -223,14 +221,14 @@ // // declare foreground/background event // - QEvent* windowActivate = new QEvent( QEvent::WindowActivate ); - QEvent* windowDeactivate = new QEvent( QEvent::WindowDeactivate ); + QEvent* appActivate = new QEvent( QEvent::ApplicationActivate ); + QEvent* appDeactivate = new QEvent( QEvent::ApplicationDeactivate ); // // verify the returned value (consumed) of HbVideoBasePlaybackView::event() - // for QEvent::WindowActivate is false + // for QEvent::ApplicationActivate is false // - QVERIFY( ! mVideoView->event( windowActivate ) ); + QVERIFY( ! mVideoView->eventFilter( NULL, appActivate ) ); // // verify view is in foreground @@ -239,9 +237,9 @@ // // verify the returned value (consumed) of HbVideoBasePlaybackView::event() - // for QEvent::WindowDeactivate is false + // for QEvent::ApplicationDeactivate is false // - QVERIFY( ! mVideoView->event( windowDeactivate ) ); + QVERIFY( ! mVideoView->eventFilter( NULL, appDeactivate ) ); // // verify view is in background @@ -251,10 +249,18 @@ // // clean up // - delete windowActivate; - windowActivate = NULL; - delete windowDeactivate; - windowDeactivate = NULL; + if ( appActivate ) + { + delete appActivate; + appActivate = NULL; + } + + if ( appDeactivate ) + { + delete appDeactivate; + appDeactivate = NULL; + } + cleanup(); } diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/stub/src/mpxvideoviewwrapper.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/stub/src/mpxvideoviewwrapper.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/stub/src/mpxvideoviewwrapper.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 5 % +// Version : %version: 6 % @@ -228,7 +228,6 @@ iFileDetails->mRNFormat = false; iFileDetails->mDuration = 100; iFileDetails->mTvOutConnected = false; - iFileDetails->mTvOutPlayAllowed = true; iFileDetails->mDrmProtected = false; iFileDetails->mMultiItemPlaylist = false; iFileDetails->mVideoHeight = 320; diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/viewinc/mpxvideoviewwrapper.h --- a/videoplayback/hbvideoplaybackview/viewinc/mpxvideoviewwrapper.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/viewinc/mpxvideoviewwrapper.h Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: da1mmcf#12 % +// Version : %version: da1mmcf#14 % @@ -35,7 +35,12 @@ #include "mpxvideoplaybackcontrol.hrh" -// Constants +enum TMPXMediaRequestStatus +{ + MediaNotRequested, + MediaRequested, + MediaDelivered +}; // Forward Declarations class MMPXPlaybackUtility; @@ -167,7 +172,7 @@ void RequestMediaL(); - void CreateGeneralPlaybackCommandL( TMPXPlaybackCommand aCmd ); + void CreateGeneralPlaybackCommandL( TMPXPlaybackCommand aCmd, TBool aDoSync = ETrue ); TBool IsAppInFrontL(); @@ -191,9 +196,6 @@ void HandleBufferingStateL(); - void IssuePlayCommandL(); - - /* * Provides the static function for the callback to close the player * Called by CIdle iIdle @@ -252,6 +254,8 @@ void HandleShortPressBackwardL(); + void IssuePlayCommandL(); + protected: // data MMPXPlaybackUtility* iPlaybackUtility; MMPXCollectionUtility* iCollectionUtility; @@ -265,8 +269,8 @@ CMPXVideoPlaybackUserInputHandler* iUserInputHandler; QMPXVideoPlaybackControlsController* iControlsController; - TBool iMediaRequested; - TBool iPlaylistView; + TMPXMediaRequestStatus iMediaRequestStatus; + TBool iPlaylistView; }; #endif // __MPXVIDEOVIEWWRAPPER_H__ diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/viewsrc/hbvideobaseplaybackview.cpp --- a/videoplayback/hbvideoplaybackview/viewsrc/hbvideobaseplaybackview.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/viewsrc/hbvideobaseplaybackview.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: da1mmcf#38 % +// Version : %version: da1mmcf#40 % @@ -116,9 +116,11 @@ void HbVideoBasePlaybackView::handleActivateView() { MPX_ENTER_EXIT(_L("HbVideoBasePlaybackView::handleActivateView()")); - + TRAP_IGNORE( mVideoMpxWrapper = CMPXVideoViewWrapper::NewL( this ) ); - + + QCoreApplication::instance()->installEventFilter( this ); + // // Request the needed Media from the Playback Plugin // @@ -128,11 +130,12 @@ // // Landscape orientation - // - hbInstance->allMainWindows()[0]->setOrientation( Qt::Horizontal ); + // Workaround: Disable orientation transition effect + // since orbit couldn't emit the orientationChanged signal with transition effect + // + hbInstance->allMainWindows()[0]->setOrientation( Qt::Horizontal, false ); mActivated = true; - } // ------------------------------------------------------------------------------------------------- @@ -143,6 +146,8 @@ { MPX_ENTER_EXIT(_L("HbVideoBasePlaybackView::handleDeactivateView()")); + QCoreApplication::instance()->removeEventFilter( this ); + mActivated = false; // @@ -306,7 +311,11 @@ void HbVideoBasePlaybackView::issuePlayCommand() { MPX_ENTER_EXIT(_L("HbVideoBasePlaybackView::issuePlayCommand()")); - TRAPD(err, mVideoMpxWrapper->CreateGeneralPlaybackCommandL( EPbCmdPlay )); + + int err = KErrNone; + + TRAP( err, mVideoMpxWrapper->CreateGeneralPlaybackCommandL( EPbCmdPlay )); + MPX_DEBUG(_L("HbVideoBasePlaybackView::issuePlayCommand() error = %d"), err); } @@ -326,7 +335,6 @@ void HbVideoBasePlaybackView::handleBufferingState() { MPX_DEBUG(_L("HbVideoBasePlaybackView::handleBufferingState()")); - } // ------------------------------------------------------------------------------------------------- @@ -340,28 +348,37 @@ mTimerForClosingView->start( 0 ); } -// ------------------------------------------------------------------------------------------------- -// HbVideoBasePlaybackView::event() -// ------------------------------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// HbVideoBasePlaybackView::eventFilter +// --------------------------------------------------------------------------- // -bool HbVideoBasePlaybackView::event( QEvent *event ) +bool HbVideoBasePlaybackView::eventFilter( QObject *object, QEvent *event ) { - bool consumed = false; + Q_UNUSED( object ); - if ( event->type() == QEvent::WindowActivate && mActivated ) + switch ( event->type() ) { - TRAP_IGNORE( mVideoMpxWrapper->IssueVideoAppForegroundCmdL( true ) ); - } - else if ( event->type() == QEvent::WindowDeactivate && mActivated ) - { - TRAP_IGNORE( mVideoMpxWrapper->IssueVideoAppForegroundCmdL( false ) ); - } - else - { - consumed = QGraphicsWidget::event( event ); + case QEvent::ApplicationActivate: + { + if ( mActivated ) + { + MPX_DEBUG(_L("HbVideoBasePlaybackView::eventFilter foreground()") ); + TRAP_IGNORE( mVideoMpxWrapper->IssueVideoAppForegroundCmdL( true ) ); + } + break; + } + case QEvent::ApplicationDeactivate: + { + if ( mActivated ) + { + MPX_DEBUG(_L("HbVideoBasePlaybackView::eventFilter background()") ); + TRAP_IGNORE( mVideoMpxWrapper->IssueVideoAppForegroundCmdL( false ) ); + } + break; + } } - return consumed; + return QObject::eventFilter( object, event ); } // ------------------------------------------------------------------------------------------------- @@ -409,5 +426,4 @@ handleClosePlaybackView(); } - // EOF diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/viewsrc/hbvideoplaybackview.cpp --- a/videoplayback/hbvideoplaybackview/viewsrc/hbvideoplaybackview.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/viewsrc/hbvideoplaybackview.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: da1mmcf#10 % +// Version : %version: da1mmcf#11 % @@ -44,6 +44,7 @@ MPX_ENTER_EXIT(_L("HbVideoPlaybackView::HbVideoPlaybackView()")); initializeVideoPlaybackView(); + mSyncClose = false; } // ------------------------------------------------------------------------------------------------- diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/viewsrc/mpxvideoplaybackdisplayhandler.cpp --- a/videoplayback/hbvideoplaybackview/viewsrc/mpxvideoplaybackdisplayhandler.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/viewsrc/mpxvideoplaybackdisplayhandler.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 20 % +// Version : %version: 21 % #include #include @@ -132,7 +132,9 @@ MPX_DEBUG(_L("VideoWindow ordinal position is: %d"), videoWindow->OrdinalPosition()); MPX_DEBUG(_L("UiWindow ordinal position is: %d"), (&aWin)->OrdinalPosition()); - TRAPD + int status = KErrNone; + + TRAP ( status, { CAlfCompositionSource* me = CAlfCompositionSource::NewL( aWin ); diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/hbvideoplaybackview/viewsrc/mpxvideoviewwrapper.cpp --- a/videoplayback/hbvideoplaybackview/viewsrc/mpxvideoviewwrapper.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/hbvideoplaybackview/viewsrc/mpxvideoviewwrapper.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: da1mmcf#30 % +// Version : %version: da1mmcf#32 % @@ -60,7 +60,7 @@ CMPXVideoViewWrapper::CMPXVideoViewWrapper( HbVideoBasePlaybackView* aView ) : iView( aView ) , iControlsController( NULL ) - , iMediaRequested( false ) + , iMediaRequestStatus( MediaNotRequested ) , iPlaylistView( false ) { } @@ -176,7 +176,7 @@ // TBool CMPXVideoViewWrapper::IsLive() { - return (iFileDetails->mPlaybackMode == EMPXVideoLiveStreaming); + return ( iFileDetails->mPlaybackMode == EMPXVideoLiveStreaming ); } // ------------------------------------------------------------------------------------------------- @@ -192,19 +192,20 @@ // CMPXVideoViewWrapper::CreateGeneralPlaybackCommandL() // ------------------------------------------------------------------------------------------------- // -void CMPXVideoViewWrapper::CreateGeneralPlaybackCommandL( TMPXPlaybackCommand aCmd ) +void CMPXVideoViewWrapper::CreateGeneralPlaybackCommandL( TMPXPlaybackCommand aCmd, TBool aDoSync ) { - MPX_DEBUG(_L("CMPXVideoViewWrapper::CreateGeneralPlaybackCommandL(%d)"), aCmd ); - + MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::CreateGeneralPlaybackCommandL()"), + _L("aCmd = %d, aDoSync, = %d"), aCmd, aDoSync ); + CMPXCommand* cmd = CMPXCommand::NewL(); CleanupStack::PushL( cmd ); - cmd->SetTObjectValueL( KMPXCommandGeneralDoSync, ETrue ); + cmd->SetTObjectValueL( KMPXCommandGeneralDoSync, aDoSync ); cmd->SetTObjectValueL( KMPXCommandPlaybackGeneralNoBuffer, ETrue ); cmd->SetTObjectValueL( KMPXCommandGeneralId, KMPXCommandIdPlaybackGeneral ); cmd->SetTObjectValueL( KMPXCommandPlaybackGeneralType, aCmd ); - iPlaybackUtility->CommandL( *cmd ); + iPlaybackUtility->CommandL( *cmd, this ); CleanupStack::PopAndDestroy( cmd ); } @@ -223,7 +224,8 @@ { case EMPXPbvCmdPlay: { - IssuePlayCommandL(); + MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EPbCmdPlay")); + CreateGeneralPlaybackCommandL( EPbCmdPlay ); break; } case EMPXPbvCmdPause: @@ -236,7 +238,12 @@ { MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdClose")); - CreateGeneralPlaybackCommandL( EPbCmdClose ); + // + // closing playback view occurs: + // - synchronously (mSyncClose=true) for PDL case (when PDL is supported) + // - asynchronously (mSyncClose=false) for all other cases + // + CreateGeneralPlaybackCommandL( EPbCmdClose, iView->mSyncClose ); break; } case EMPXPbvCmdSeekForward: @@ -345,7 +352,7 @@ // the second cmd actually goes to the previous item in the list // iPlaybackUtility->CommandL( EPbCmdPrevious ); - iPlaybackUtility->CommandL( EPbCmdPrevious ); + iPlaybackUtility->CommandL( EPbCmdPrevious ); } break; } @@ -364,6 +371,12 @@ CreateVideoSpecificCmdL( EPbCmdCustomPlay ); break; } + case EMPXPbvCmdRealOneBitmapTimeout: + { + IssuePlayCommandL(); + + break; + } } } @@ -395,9 +408,10 @@ { MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::RequestMediaL()")); - if ( ! iMediaRequested && iPlaybackUtility->StateL() == EPbStateInitialised ) + if ( iMediaRequestStatus == MediaNotRequested && + iPlaybackUtility->StateL() == EPbStateInitialised ) { - iMediaRequested = ETrue; + iMediaRequestStatus = MediaRequested; // // Request the volume for the controls @@ -433,7 +447,7 @@ specs->SetTObjectValueL(KMPXMediaGeneralExtMediaRedirect, ETrue); - s->MediaL( attrs.Array(), *this, specs); + s->MediaL( attrs.Array(), *this, specs ); CleanupStack::PopAndDestroy( specs ); CleanupStack::PopAndDestroy( &attrs ); @@ -612,7 +626,7 @@ // if ( iPlaybackState != EPbStateNotInitialised ) { - iMediaRequested = EFalse; + iMediaRequestStatus = MediaNotRequested; HandleCommandL( EMPXPbvCmdResetControls ); if ( iFileDetails ) @@ -926,65 +940,30 @@ if ( aError == KErrNone ) { - if ( iFileDetails ) - { - iFileDetails->clearFileDetails(); - } - else + iMediaRequestStatus = MediaDelivered; + + if ( ! iFileDetails ) { iFileDetails = new QMPXVideoPlaybackViewFileDetails(); } - + // // Read in the media data // ParseMetaDataL( aMedia ); // - // Create controls since file details are available + // If RN logo is still visible, wait for timeout of rn logo timer + // If RN logo is not visible, issue play // - if ( iControlsController ) - { - iControlsController->addFileDetails( iFileDetails ); - } - - if ( iFileDetails->mVideoEnabled ) + if ( ! iControlsController->isRNLogoBitmapInControlList() ) { - // - // get window size - // - RWindow *window = iView->getWindow(); - TRect displayRect = TRect( TPoint( window->Position() ), TSize( window->Size() ) ); - - // - // get window aspect ratio - // if device is in landscape mode, width > height - // if device is in portrait mode, width < height - // - TReal32 width = (TReal32) displayRect.Width(); - TReal32 height = (TReal32) displayRect.Height(); - TReal32 displayAspectRatio = (width > height)? (width / height) : (height / width); - - // - // get new aspect ratio - TInt newAspectRatio = - iDisplayHandler->SetDefaultAspectRatioL( iFileDetails, displayAspectRatio ); - - // - // Setup the display window and issue play command - // - iDisplayHandler->CreateDisplayWindowL( CCoeEnv::Static()->WsSession(), - *(CCoeEnv::Static()->ScreenDevice()), - *window, - displayRect ); - - if ( iControlsController ) - { - iControlsController->handleEvent( EMPXControlCmdSetAspectRatio, newAspectRatio ); - } + IssuePlayCommandL(); } - - CreateGeneralPlaybackCommandL( EPbCmdPlay ); + } + else + { + iMediaRequestStatus = MediaNotRequested; } } @@ -997,13 +976,14 @@ void CMPXVideoViewWrapper::HandleMediaL( const CMPXMedia& aMedia, TInt aError) { MPX_ENTER_EXIT(_L( "CMPXVideoViewWrapper::HandleMediaL()" )); + if ( aMedia.IsSupported( KMPXMediaVideoError ) ) { TInt error = aMedia.ValueTObjectL( KMPXMediaVideoError ); // Reset the controls HandleCommandL( EMPXPbvCmdResetControls ); // Set the iMediaRequested flag to false - iMediaRequested = EFalse; + iMediaRequestStatus = MediaNotRequested; // Reset the playback state to stopped iPlaybackState = EPbStateStopped; // Handle the plugin error @@ -1031,9 +1011,8 @@ // CMPXVideoViewWrapper::HandlePropertyL() // ------------------------------------------------------------------------------------------------- // -void CMPXVideoViewWrapper::HandlePropertyL( TMPXPlaybackProperty aProperty, - TInt aValue, - TInt aError ) +void +CMPXVideoViewWrapper::HandlePropertyL( TMPXPlaybackProperty aProperty, TInt aValue, TInt aError ) { MPX_DEBUG(_L("CMPXVideoViewWrapper::HandlePropertyL - Error(%d)"), aError ); @@ -1152,16 +1131,6 @@ } // ------------------------------------------------------------------------------------------------- -// CMPXVideoViewWrapper::IssuePlayCommandL -// ------------------------------------------------------------------------------------------------- -// -void CMPXVideoViewWrapper::IssuePlayCommandL() -{ - MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::IssuePlayCommandL()")); - CreateGeneralPlaybackCommandL( EPbCmdPlay ); -} - -// ------------------------------------------------------------------------------------------------- // CMPXVideoViewWrapper::RetrievePdlInformationL // ------------------------------------------------------------------------------------------------- // @@ -1456,4 +1425,63 @@ iControlsController->updateVideoRectDone(); } +// ------------------------------------------------------------------------------------------------- +// CMPXVideoViewWrapper::IssuePlayCommandL() +// ------------------------------------------------------------------------------------------------- +// +void CMPXVideoViewWrapper::IssuePlayCommandL() +{ + MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::IssuePlayCommandL()"), + _L("iMediaRequestStatus = %d"), iMediaRequestStatus ); + + if ( iMediaRequestStatus == MediaDelivered ) + { + // + // Create controls since file details are available + // + if ( iControlsController ) + { + iControlsController->addFileDetails( iFileDetails ); + } + + if ( iFileDetails->mVideoEnabled ) + { + // + // get window size + // + RWindow *window = iView->getWindow(); + TRect displayRect = TRect( TPoint( window->Position() ), TSize( window->Size() ) ); + + // + // get window aspect ratio + // if device is in landscape mode, width > height + // if device is in portrait mode, width < height + // + TReal32 width = (TReal32) displayRect.Width(); + TReal32 height = (TReal32) displayRect.Height(); + TReal32 displayAspectRatio = (width > height)? (width / height) : (height / width); + + // + // get new aspect ratio + TInt newAspectRatio = + iDisplayHandler->SetDefaultAspectRatioL( iFileDetails, displayAspectRatio ); + + // + // Setup the display window and issue play command + // + iDisplayHandler->CreateDisplayWindowL( CCoeEnv::Static()->WsSession(), + *(CCoeEnv::Static()->ScreenDevice()), + *window, + displayRect ); + + if ( iControlsController ) + { + iControlsController->handleEvent( EMPXControlCmdSetAspectRatio, newAspectRatio ); + } + } + + CreateGeneralPlaybackCommandL( EPbCmdPlay ); + } +} + // EOF diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/inc/hbvideobaseplaybackview.h --- a/videoplayback/inc/hbvideobaseplaybackview.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/inc/hbvideobaseplaybackview.h Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: da1mmcf#14 % +// Version : %version: da1mmcf#16 % @@ -92,11 +92,11 @@ void showDialog( const QString& qString, bool closeView = true ); virtual void handleClosePlaybackView(); - - bool event( QEvent *event ); RWindow *getWindow(); + bool eventFilter( QObject *object, QEvent *event ); + protected: void mousePressEvent( QGraphicsSceneMouseEvent *event ); @@ -108,6 +108,7 @@ QTimer *mTimerForClosingView; bool mActivated; + bool mSyncClose; public: friend class CMPXVideoViewWrapper; diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/videohelix/conf/mpxvideopbplugins.confml Binary file videoplayback/videohelix/conf/mpxvideopbplugins.confml has changed diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/videohelix/group/mpxvideohelixplayback.mmp --- a/videoplayback/videohelix/group/mpxvideohelixplayback.mmp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/videohelix/group/mpxvideohelixplayback.mmp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: ou1cpsw#14 % +// Version : %version: 17 % @@ -39,10 +39,10 @@ SOURCE mpxvideoplaybackmode.cpp SOURCE mpxvideofiledetails.cpp SOURCE mpxvideoseeker.cpp -SOURCE mpxvideodlmgrif.cpp SOURCE mpxvideoaccessoryobserver.cpp SOURCE mpxvideoplayerutility.cpp SOURCE mpxvideodrmhelper.cpp +SOURCE mpxvideoposterframesetter.cpp START RESOURCE ../data/10282550.rss TARGET mpxvideohelixplayback.rsc @@ -66,7 +66,6 @@ LIBRARY estor.lib LIBRARY flogger.lib LIBRARY playbackhelper.lib -LIBRARY downloadmgr.lib LIBRARY platformenv.lib LIBRARY etel.lib LIBRARY etelmm.lib @@ -76,6 +75,8 @@ LIBRARY mmcommon.lib LIBRARY hwrmlightclient.lib // Lights control LIBRARY centralrepository.lib // For display backlight timeout value +LIBRARY fbscli.lib +LIBRARY thumbnailmanager.lib #ifdef __ACCESSORY_FW LIBRARY accclient.lib diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/videohelix/inc/mpxvideodlmgrif.h --- a/videoplayback/videohelix/inc/mpxvideodlmgrif.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/videohelix/inc/mpxvideodlmgrif.h Wed Jun 23 17:22:59 2010 +0100 @@ -15,13 +15,15 @@ * */ -// Version : %version: 10 % +// Version : %version: 12 % + +#ifdef USE_S60_DOWNLOAD_MANAGER #ifndef __MPXVIDEODLMGRIF_H__ #define __MPXVIDEODLMGRIF_H__ -#include +#include #include // @@ -135,6 +137,15 @@ */ TBool IsDownloadPaused(); + /* + * UpdateDownloadSizeL + * + * For DRM protected clips, the download size will be updated using the file handle + * + * @since S60 9.2 + */ + void UpdateDownloadSizeL(); + private: /* * CMPDownloadMgrInterface @@ -220,8 +231,6 @@ void ConvertDMgrStatetoMpxState( TInt32 dmgrState ); - void UpdateDownloadSizeL(); - // // Private Members // Not Owned Data @@ -251,4 +260,6 @@ #endif __MPXVIDEODLMGRIF_H__ +#endif // USE_S60_DOWNLOAD_MANAGER + // End of file diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/videohelix/inc/mpxvideoplaybackcontroller.h --- a/videoplayback/videohelix/inc/mpxvideoplaybackcontroller.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/videohelix/inc/mpxvideoplaybackcontroller.h Wed Jun 23 17:22:59 2010 +0100 @@ -16,7 +16,7 @@ */ -// Version : %version: 25 % +// Version : %version: 29 % #ifndef _CMPXVIDEOPLAYBACKCONTROLLER_H_ @@ -126,6 +126,8 @@ TBool IsVideoCall(); TBool IsVoiceCall(); + TBool IsViewActivated(); + void HandleTvOutEventL( TBool aConnected ); void HandleError(TInt error); @@ -133,6 +135,8 @@ void HandleVolumeL( TBool aIncrease ); void SendHideControlsEventL(); + + void HandleFrameReady(TInt aError); #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API @@ -220,7 +224,6 @@ TBool iAppInForeground; CMediaRecognizer::TMediaType iMediaType; TInt iAccessPointId; - TBool iForegroundPause; TBool iAllowAutoPlay; TBool iHelixLoadingStarted; TInt iPBPluginError; @@ -264,6 +267,7 @@ CHWRMLight* iLight; TInt iLightStatus; TInt iSavedPosition; + TBool iViewActivated; public: // Friend classes @@ -286,9 +290,12 @@ friend class CMPXProgressiveDLPlaybackMode; friend class CMPXVideoSeeker; +#ifdef USE_S60_DOWNLOAD_MANAGER friend class CMPXVideoDlMgrIf; +#endif // USE_S60_DOWNLOAD_MANAGER friend class CMPXVideoAccessoryObserver; friend class CMpxVideoPlayerUtility; + friend class CMPXVideoPosterFrameSetter; }; // INLINE METHODS diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/videohelix/inc/mpxvideoplaybackmode.h --- a/videoplayback/videohelix/inc/mpxvideoplaybackmode.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/videohelix/inc/mpxvideoplaybackmode.h Wed Jun 23 17:22:59 2010 +0100 @@ -16,7 +16,7 @@ */ -// Version : %version: 15 % +// Version : %version: 19 % #ifndef _CMPXVIDEOPLAYBACKMODE_H_ @@ -29,7 +29,9 @@ #include #include "mpxhelixplaybackplugindefs.h" +#ifdef USE_S60_DOWNLOAD_MANAGER #include "mpxvideodlmgrif.h" +#endif #include "mpxvideo_debug.h" // @@ -37,6 +39,7 @@ // class CMPXVideoPlaybackController; class CMPXVideoDlMgrIf; +class CMPXVideoPosterFrameSetter; // @@ -71,12 +74,13 @@ virtual TBool CanPlayNow(); virtual void OpenFileL( const TDesC& aMediaFile ); virtual void OpenFileL( const RFile& aMediaFile ); + virtual void HandleSetPosterFrame(); + virtual void HandleFrameReady(TInt aError); #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API virtual void OpenFile64L( const RFile64& aMediaFile ); #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API - protected: /* * C++ default constructor @@ -89,13 +93,12 @@ */ virtual void ConstructL( CMPXVideoPlaybackController* aVideoPlaybackCtlr ); - protected: // // Data // CMPXVideoPlaybackController* iVideoPlaybackCtlr; // not owned - + CMPXVideoPosterFrameSetter* iPosterFrameSetter; }; /*******************************************************/ @@ -113,6 +116,8 @@ // Methods where video plabkack behavior varies for local media inline virtual TInt GetMode(); + virtual void HandleSetPosterFrame(); + virtual void HandleFrameReady(TInt aError); }; @@ -163,21 +168,49 @@ static CMPXVideoPlaybackMode* NewL( CMPXVideoPlaybackController* aVideoPlaybackCtlr ); virtual ~CMPXProgressiveDLPlaybackMode(); +#ifdef USE_S60_DOWNLOAD_MANAGER + inline virtual TInt GetMode(); void ConnectToDownloadL( CMPXCommand& aCmd ); void HandleOpenComplete(); void GetPdlStatusL( CMPXCommand& aCmd ); void UpdateSeekPosition( TInt64& aPosition ); inline TBool IsDownloadPaused(); + void OpenFileL( const RFile& aMediaFile ); + +#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API + void OpenFile64L( const RFile64& aMediaFile ); +#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API + +#endif // USE_S60_DOWNLOAD_MANAGER private: - void ConstructL( CMPXVideoPlaybackController* aVideoPlaybackCtlr ); +#ifdef USE_S60_DOWNLOAD_MANAGER private: - CMPXVideoDlMgrIf* iDlMgrIf; // owned + CMPXVideoDlMgrIf* iDlMgrIf; // owned +#endif // USE_S60_DOWNLOAD_MANAGER + }; +#ifdef USE_S60_DOWNLOAD_MANAGER + +inline +TInt CMPXProgressiveDLPlaybackMode::GetMode() +{ + MPX_DEBUG(_L("CMPXProgressiveDLPlaybackMode::GetMode()")); + return EMPXVideoProgressiveDownload; +} + +inline +TBool CMPXProgressiveDLPlaybackMode::IsDownloadPaused() +{ + return iDlMgrIf->IsDownloadPaused(); +} + +#endif // USE_S60_DOWNLOAD_MANAGER + // INLINE METHODS inline @@ -210,22 +243,10 @@ } inline -TInt CMPXProgressiveDLPlaybackMode::GetMode() -{ - MPX_DEBUG(_L("CMPXProgressiveDLPlaybackMode::GetMode()")); - return EMPXVideoProgressiveDownload; -} - -inline TBool CMPXVideoPlaybackMode::IsDownloadPaused() { return EFalse; } -inline -TBool CMPXProgressiveDLPlaybackMode::IsDownloadPaused() -{ - return iDlMgrIf->IsDownloadPaused(); -} #endif //_CMPXVIDEOPLAYBACKMODE_H_ diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/videohelix/inc/mpxvideoplaybackstate.h --- a/videoplayback/videohelix/inc/mpxvideoplaybackstate.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/videohelix/inc/mpxvideoplaybackstate.h Wed Jun 23 17:22:59 2010 +0100 @@ -16,7 +16,7 @@ */ -// Version : %version: 18 % +// Version : %version: 19 % #ifndef _CMPXVIDEOPLAYBACKSTATE_H_ @@ -72,6 +72,7 @@ virtual void HandleStartSeekL( TBool aForward ); virtual void HandleStopSeekL(); virtual void HandleClose(); + virtual void HandleSetPosterFrame(); virtual void HandleForeground(); virtual void HandleBackground(); @@ -246,6 +247,7 @@ virtual void HandlePause(); virtual void HandleStop(); virtual void HandleStartSeekL( TBool aForward ); + virtual void HandleSetPosterFrame(); virtual void HandlePlayPause(); virtual void HandleBackground(); @@ -310,7 +312,8 @@ virtual void HandlePlay(); virtual void HandleStop(); virtual void HandleStartSeekL( TBool aForward ); - virtual void HandlePlayPause(); + virtual void HandlePlayPause(); + virtual void HandleSetPosterFrame(); virtual void HandleForeground(); virtual void HandleCustomPlay(); diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/videohelix/inc/mpxvideoplayerutility.h --- a/videoplayback/videohelix/inc/mpxvideoplayerutility.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/videohelix/inc/mpxvideoplayerutility.h Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 11 % +// Version : %version: 13 % #ifndef __MPXVIDEOPLAYERUTILITY__ @@ -25,6 +25,7 @@ // INCLUDES // #include +#include #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS #include @@ -42,12 +43,13 @@ // FORWARD DECLARATIONS // class CMPXVideoPlaybackController; +class CFbsBitmap; // // CLASS DECLARATION // -NONSHARABLE_CLASS( CMpxVideoPlayerUtility ) : public CBase, +NONSHARABLE_CLASS( CMpxVideoPlayerUtility ) : public CActive, public MMMFControllerEventMonitorObserver { public: @@ -101,11 +103,18 @@ void SetPlayVelocityL( TInt aVelocity ); void GetVideoLoadingProgressL( TInt& aPercentageProgress ); + + void GetFrameL(); // // MMMFControllerEventMonitorObserver Implementation // void HandleEvent( const TMMFEvent& aEvent ); + + CFbsBitmap& GetBitmap(); + + void RunL(); + void DoCancel(); #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API void OpenFile64L( const RFile64& aFile ); @@ -124,6 +133,8 @@ const TRect& aCropRect, TVideoAspectRatio aAspectRatio ); + void SendSurfaceCreatedCommand(); + #endif private: @@ -150,11 +161,15 @@ RMMFVideoPlaySurfaceSupportCustomCommands iVideoPlaySurfaceSupportCustomCommands; TSurfaceId iSurfaceId; + TRect iCropRect; + TVideoAspectRatio iAspectRatio; #endif CMMFControllerEventMonitor* iControllerEventMonitor; TBool iDirectScreenAccessAbort; + + CFbsBitmap* iPosterFrameBitmap; }; #endif /* __MPXVIDEOPLAYERUTILITY__ */ diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/videohelix/inc/mpxvideoposterframesetter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videoplayback/videohelix/inc/mpxvideoposterframesetter.h Wed Jun 23 17:22:59 2010 +0100 @@ -0,0 +1,89 @@ +/* +* 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 "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: Poster Frame Setter + * +*/ + +// Version : %version: ou1cpsw#2 % + + + +#ifndef _MPXVIDEOPOSTERFRAMESETTER_H +#define _MPXVIDEOPOSTERFRAMESETTER_H + +// INCLUDES +#include +#include +#include +#include + + +// FORWARD DECLARATIONS +class CMPXVideoPlaybackController; +class CThumbnailManager; + +// CLASS DECLARATION +NONSHARABLE_CLASS(CMPXVideoPosterFrameSetter) : public CBase, + public MThumbnailManagerObserver +{ + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CMPXVideoPosterFrameSetter* NewL( CMPXVideoPlaybackController* aVideoPlaybackCtlr ); + + /** + * Destructor. + */ + virtual ~CMPXVideoPosterFrameSetter(); + + public: + + void RequestPosterFrame(); + + void HandlePosterFrameReady(TInt aError); + + // from MThumbnailManagerObserver + void ThumbnailPreviewReady( MThumbnailData& aThumbnail, + TThumbnailRequestId aId ); + + // from MThumbnailManagerObserver + void ThumbnailReady( TInt aError, + MThumbnailData& aThumbnail, + TThumbnailRequestId aId ); + + + private: + + /** + * C++ default constructor. + */ + CMPXVideoPosterFrameSetter( CMPXVideoPlaybackController* aVideoPlaybackCtlr ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + private: // Data + + CMPXVideoPlaybackController* iVideoPlaybackCtlr; + TThumbnailRequestId iRequestId; + CThumbnailManager* iTNManager; +}; + +#endif // _MPXVIDEOPOSTERFRAMESETTER_H + +// End of File diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/videohelix/src/mpxvideodlmgrif.cpp --- a/videoplayback/videohelix/src/mpxvideodlmgrif.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/videohelix/src/mpxvideodlmgrif.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -16,7 +16,7 @@ */ -// Version : %version: 23 % +// Version : %version: 25 % #include @@ -95,7 +95,6 @@ } } - void CMPXVideoDlMgrIf::ConnectToDownloadL( CMPXCommand& aCmd ) { MPX_ENTER_EXIT(_L("CMPXVideoDlMgrIf::ConnectToDownloadL()")); @@ -120,13 +119,14 @@ // // A new download id has been sent. Reset member variables // - iMoveNeeded = EFalse; - iCurrentDl = NULL; - iDlId = downloadId; - iPlayerOpened = EFalse; - iDlTotalSize = 0; + iMoveNeeded = EFalse; + iCurrentDl = NULL; + iDownloadState = EPbDlStateDownloadCompleted; + iDlId = downloadId; + iPlayerOpened = EFalse; + iDlTotalSize = 0; iDownloadProgress = 0; - iCodDownload = EFalse; + iCodDownload = EFalse; if ( iDlMgrConnected ) { @@ -414,11 +414,6 @@ // error = HandleCustomCommand( EMMFROPControllerSetDownloadSize, iDownloadProgress ); } - - // - // Update download size for DRM protected clips - // - MPX_TRAPD( updateError, UpdateDownloadSizeL() ); } } } @@ -658,9 +653,19 @@ // TReal CMPXVideoDlMgrIf::GetDownloadRatio() { - TReal downloadRatio = (TReal)iDownloadProgress / (TReal)iDlTotalSize; + TReal downloadRatio = 0.0; + + if ( iDownloadState == EPbDlStateDownloadCompleted ) + { + downloadRatio = 100.0; + } + else + { + downloadRatio = (TReal)iDownloadProgress / (TReal)iDlTotalSize; + } + MPX_DEBUG(_L("CMPXVideoDlMgrIf::GetDownloadRatio(%f)"), downloadRatio); - + return downloadRatio; } @@ -671,9 +676,7 @@ TBool CMPXVideoDlMgrIf::IsDownloadPaused() { TBool paused = ( iDownloadState == EPbDlStateDownloadPaused ); - - MPX_DEBUG(_L("CMPXVideoDlMgrIf::GetDownloadRatio(%d)"), paused); - + MPX_DEBUG(_L("CMPXVideoDlMgrIf::IsDownloadPaused(%d)"), paused); return paused; } diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/videohelix/src/mpxvideoplaybackcontroller.cpp --- a/videoplayback/videohelix/src/mpxvideoplaybackcontroller.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/videohelix/src/mpxvideoplaybackcontroller.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -16,7 +16,7 @@ */ -// Version : %version: 58 % +// Version : %version: 62 % // @@ -168,6 +168,7 @@ iDrmHelper = CMpxVideoDrmHelper::NewL(); iSavedPosition = 0; + iViewActivated = EFalse; } // ---------------------------------------------------------------------------- @@ -264,7 +265,6 @@ // CMPXVideoPlaybackController::CMPXVideoPlaybackController() : iAppInForeground(ETrue) - , iForegroundPause(EFalse) , iAllowAutoPlay(ETrue) , iHelixLoadingStarted(EFalse) , iLightStatus(CHWRMLight::ELightStatusUnknown) @@ -371,6 +371,7 @@ #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API + iViewActivated = EFalse; } // ---------------------------------------------------------------------------- @@ -540,6 +541,11 @@ break; } + case EPbCmdSetPosterFrame: + { + iState->HandleSetPosterFrame(); + break; + } } } } @@ -879,26 +885,19 @@ volume = aVolume; } + // + // Volume needs to have n number of steps. + // For example, if we get 26, we need to save it as 25 in 20 volume steps + // For example, if we get 77, we need to save it as 70 in 10 volume steps + // + volume -= volume % iVolumeNormalizer; + MPX_DEBUG( _L("CMPXVideoPlaybackController::SetVolumeCenRepL(): Setting volume = %d"), volume ); - if ( volume > 0 ) - { - // - // Media player's CenRep volume range : 0 - number of volume steps - // MPX framework volume range : 0-100 - // - iVolumeWatcher->SetValueL( volume / iVolumeNormalizer ); - SetMuteCenRepL( EFalse ); - } - else - { - // - // save both mute and current volume values in CenRep - // - iVolumeWatcher->SetValueL( 0 ); - SetMuteCenRepL( ETrue ); - } + iVolumeWatcher->SetValueL( volume ); + + SetMuteCenRepL( volume > 0? EFalse: ETrue ); } else { @@ -939,7 +938,8 @@ TInt volume = iVolumeWatcher->CurrentValueL(); TBool mute = iMuteWatcher->CurrentValueL(); - MPX_DEBUG(_L("CMPXVideoPlaybackController::SetVolumeMMFL() volume = %d, mute = %d") + MPX_DEBUG( + _L("CMPXVideoPlaybackController::SetVolumeMMFL() volume = %d, mute = %d") , volume, mute ); TInt newVolume = 0; @@ -947,15 +947,14 @@ if ( ! mute ) { // - // If it was muted and previous volume level was 0, set the volume to 1 + // If it was muted and previous volume level was KPbPlaybackVolumeLevelMin, set the volume to next level // - if ( volume == 0 ) + if ( volume == KPbPlaybackVolumeLevelMin ) { - volume++; + volume = KPbPlaybackVolumeLevelMin + iVolumeNormalizer; } - newVolume = - volume * iVolumeNormalizer * iFileDetails->iMaxVolume / KPbPlaybackVolumeLevelMax; + newVolume = volume * iFileDetails->iMaxVolume / KPbPlaybackVolumeLevelMax; } MPX_DEBUG(_L("CMPXVideoPlaybackController::SetVolumeMMFL() new volume = %d"), newVolume ); @@ -1101,7 +1100,7 @@ if ( ! iMuteWatcher->CurrentValueL() ) { - volume = iVolumeWatcher->CurrentValueL() * iVolumeNormalizer; + volume = iVolumeWatcher->CurrentValueL(); } value = volume; @@ -1154,6 +1153,10 @@ TInt retError = KErrNone; + iViewActivated = ETrue; + + iPlayer->SendSurfaceCreatedCommand(); + RArray suppIds; CleanupClosePushL( suppIds ); @@ -2307,10 +2310,6 @@ // // MPX framework volume range : 0-100 - // Media player volume range : 0-10 - // MPX video player volume range : 0 - volume steps (defined in PlaybackHelper) - // For IAD, need to manipulate volume to save in cenrep - // MPX Framework volume / iVolumeNormalizer => CenRep // CDevSoundIf* devSoundIf = CDevSoundIf::NewL(); TInt volumeSteps = devSoundIf->GetNumberOfVolumeSteps(); @@ -2401,6 +2400,8 @@ iHelixLoadingStarted = EFalse; iSavedPosition = 0; + + iViewActivated = EFalse; } // ------------------------------------------------------------------------------------------------ @@ -2412,31 +2413,20 @@ MPX_ENTER_EXIT( _L("CMPXVideoPlaybackController::HandleVolumeL()"), _L("aIncrease = %d"), aIncrease ); - // - // Media player's CenRep volume range : 0 - number of volume steps - // MPX framework volume range : 0-100 - // TInt volume = iVolumeWatcher->CurrentValueL(); + TInt diff = iVolumeNormalizer; - if ( aIncrease ) + if ( ! aIncrease ) { - // - // increase the current volume - // - volume++; + diff *= -1; } - else if ( volume > 0 ) - { - // - // decrease the current volume - // - volume--; - } + + volume += diff; // // save the current volume level in CenRep // - SetVolumeCenRepL( volume * iVolumeNormalizer ); + SetVolumeCenRepL( volume ); } // ------------------------------------------------------------------------------------------------ @@ -2532,4 +2522,24 @@ #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API +// ------------------------------------------------------------------------------------------------ +// CMPXVideoPlaybackController::IsViewActivated() +// ------------------------------------------------------------------------------------------------ +// +TBool CMPXVideoPlaybackController::IsViewActivated() +{ + MPX_DEBUG(_L("CMPXVideoPlaybackController::IsViewActivated")); + return iViewActivated; +} + +// ------------------------------------------------------------------------------------------------ +// CMPXVideoPlaybackController::HandleFrameReady() +// ------------------------------------------------------------------------------------------------ +// +void CMPXVideoPlaybackController::HandleFrameReady(TInt aError) +{ + MPX_DEBUG(_L("CMPXVideoPlaybackController::HandleFrameReady")); + + iPlaybackMode->HandleFrameReady(aError); +} // End of file diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/videohelix/src/mpxvideoplaybackmode.cpp --- a/videoplayback/videohelix/src/mpxvideoplaybackmode.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/videohelix/src/mpxvideoplaybackmode.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -16,7 +16,7 @@ */ -// Version : %version: 25 % +// Version : %version: 32 % // @@ -35,6 +35,7 @@ #include "mpxvideofiledetails.h" #include #include "mpxvideodrmhelper.h" +#include "mpxvideoposterframesetter.h" // Constants const TUid KUidInterfaceMMFHelixController = {0x101F855D}; @@ -69,6 +70,12 @@ CMPXVideoPlaybackMode::~CMPXVideoPlaybackMode() { MPX_DEBUG(_L("CMPXVideoPlaybackMode::~CMPXVideoPlaybackMode()")); + + if ( iPosterFrameSetter ) + { + delete iPosterFrameSetter; + iPosterFrameSetter = NULL; + } } // ---------------------------------------------------------------------------- @@ -177,31 +184,26 @@ { MPX_DEBUG(_L("CMPXVideoPlaybackMode::HandleBackground()")); - // - // Pause in all cases to remove the different behavior based on the decoder - // - iVideoPlaybackCtlr->iState->HandlePause(); - if ( iVideoPlaybackCtlr->iAppInForeground ) { if ( iVideoPlaybackCtlr->IsAlarm() ) { - iVideoPlaybackCtlr->iForegroundPause = ETrue; + iVideoPlaybackCtlr->iState->HandlePause(); } else if ( iVideoPlaybackCtlr->IsKeyLocked() && iVideoPlaybackCtlr->iFileDetails->iVideoEnabled ) { - iVideoPlaybackCtlr->iForegroundPause = ETrue; - iVideoPlaybackCtlr->SendHideControlsEventL(); + iVideoPlaybackCtlr->iState->HandlePause(); + TRAP_IGNORE( iVideoPlaybackCtlr->SendHideControlsEventL() ); } else if ( iVideoPlaybackCtlr->IsPhoneCall() || iVideoPlaybackCtlr->IsVideoCall() ) { - iVideoPlaybackCtlr->iForegroundPause = EFalse; + iVideoPlaybackCtlr->iState->HandlePause(); } } else { - iVideoPlaybackCtlr->iForegroundPause = EFalse; + iVideoPlaybackCtlr->iState->HandlePause(); } } @@ -221,10 +223,11 @@ MPX_TRAPD( err, iVideoPlaybackCtlr->iState->SendErrorToViewL( KMPXVideoCallOngoingError ) ); } - else if ( iVideoPlaybackCtlr->IsKeyLocked() && + else if ( iVideoPlaybackCtlr->IsKeyLocked() && iVideoPlaybackCtlr->iFileDetails->iVideoEnabled ) { - iVideoPlaybackCtlr->iForegroundPause = ETrue; + // playback not allowed for the clip having video if keylock is true + // Let playAllowed remain false } else { @@ -276,6 +279,22 @@ return networkMode2g; } + +// ------------------------------------------------------------------------------------------------ +// CMPXVideoPlaybackMode::HandleSetPosterFrame() +// ------------------------------------------------------------------------------------------------ +void CMPXVideoPlaybackMode::HandleSetPosterFrame() +{ + MPX_DEBUG(_L("CMPXVideoPlaybackMode::HandleSetPosterFrame()")); +} + +// ------------------------------------------------------------------------------------------------ +// CMPXVideoPlaybackMode::HandleSetPosterFrame() +// ------------------------------------------------------------------------------------------------ +void CMPXVideoPlaybackMode::HandleFrameReady(TInt /*aError*/) +{ + MPX_DEBUG(_L("CMPXLocalPlaybackMode::HandleFrameReady()")); +} //************************************************************************************************// // CMPXLocalPlaybackMode //************************************************************************************************// @@ -295,6 +314,30 @@ MPX_DEBUG(_L("CMPXLocalPlaybackMode::~CMPXLocalPlaybackMode()")); } +void CMPXLocalPlaybackMode::HandleSetPosterFrame() +{ + MPX_DEBUG(_L("CMPXLocalPlaybackMode::HandleSetPosterFrame()")); + + // create poster frame setter if it does not already exist + if ( ! iPosterFrameSetter ) + { + TRAP_IGNORE(iPosterFrameSetter = CMPXVideoPosterFrameSetter::NewL( iVideoPlaybackCtlr )); + } + + if ( iPosterFrameSetter ) + { + iPosterFrameSetter->RequestPosterFrame(); + } +} + +void CMPXLocalPlaybackMode::HandleFrameReady(TInt aError) +{ + MPX_DEBUG(_L("CMPXLocalPlaybackMode::HandleFrameReady()")); + + iPosterFrameSetter->HandlePosterFrameReady(aError); +} + + //************************************************************************************************// // CMPXStreamingPlaybackMode //************************************************************************************************// @@ -386,9 +429,11 @@ MPX_TRAPD(err, iVideoPlaybackCtlr->iState->SendErrorToViewL( KMPXVideoCallOngoingError )); } - else if ( iVideoPlaybackCtlr->IsKeyLocked() && iVideoPlaybackCtlr->iFileDetails->iVideoEnabled ) + else if ( iVideoPlaybackCtlr->IsKeyLocked() && + iVideoPlaybackCtlr->iFileDetails->iVideoEnabled ) { - //exit for live streaming + // playback not allowed for the clip having video if keylock is true + // Let playAllowed remain false } else { @@ -489,10 +534,20 @@ { MPX_DEBUG(_L("CMPXLiveStreamingPlaybackMode::HandleBackground()")); - // - // Pause in all cases to remove the different behavior based on the decoder - // - iVideoPlaybackCtlr->iState->HandlePause(); + if ( iVideoPlaybackCtlr->iAppInForeground ) + { + if ( iVideoPlaybackCtlr->IsPhoneCall() || + iVideoPlaybackCtlr->IsVideoCall() || + ( iVideoPlaybackCtlr->IsKeyLocked() && + iVideoPlaybackCtlr->iFileDetails->iVideoEnabled ) ) + { + iVideoPlaybackCtlr->iState->HandlePause(); + } + } + else + { + iVideoPlaybackCtlr->iState->HandlePause(); + } } //************************************************************************************************// @@ -514,23 +569,31 @@ { iVideoPlaybackCtlr = aVideoPlaybackCtlr; +#ifdef USE_S60_DOWNLOAD_MANAGER // // Create the Download Mgr Interface // iDlMgrIf = CMPXVideoDlMgrIf::NewL( iVideoPlaybackCtlr ); +#endif // USE_S60_DOWNLOAD_MANAGER + } CMPXProgressiveDLPlaybackMode::~CMPXProgressiveDLPlaybackMode() { MPX_DEBUG(_L("CMPXProgressiveDLPlaybackMode::~CMPXProgressiveDLPlaybackMode()")); +#ifdef USE_S60_DOWNLOAD_MANAGER if ( iDlMgrIf ) { delete iDlMgrIf; iDlMgrIf = NULL; } +#endif // USE_S60_DOWNLOAD_MANAGER + } +#ifdef USE_S60_DOWNLOAD_MANAGER + // ------------------------------------------------------------------------------------------------ // CMPXProgressiveDLPlaybackMode::ConnectToDownloadL() // ------------------------------------------------------------------------------------------------ @@ -594,4 +657,30 @@ KErrNone ); } +// ------------------------------------------------------------------------------------------------ +// CMPXProgressiveDLPlaybackMode::OpenFileL() +// ------------------------------------------------------------------------------------------------ +void CMPXProgressiveDLPlaybackMode::OpenFileL( const RFile& aMediaFile ) +{ + MPX_ENTER_EXIT(_L("CMPXProgressiveDLPlaybackMode::OpenFileL()")); + + iDlMgrIf->UpdateDownloadSizeL(); + CMPXVideoPlaybackMode::OpenFileL( aMediaFile ); +} + +#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API +// ------------------------------------------------------------------------------------------------ +// CMPXProgressiveDLPlaybackMode::OpenFile64L() +// ------------------------------------------------------------------------------------------------ +void CMPXProgressiveDLPlaybackMode::OpenFile64L( const RFile64& aMediaFile ) +{ + MPX_ENTER_EXIT(_L("CMPXProgressiveDLPlaybackMode::OpenFile64L( RFile64 )")); + + iDlMgrIf->UpdateDownloadSizeL(); + CMPXVideoPlaybackMode::OpenFile64L( aMediaFile ); +} +#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API + +#endif // USE_S60_DOWNLOAD_MANAGER + // End of file diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/videohelix/src/mpxvideoplaybackstate.cpp --- a/videoplayback/videohelix/src/mpxvideoplaybackstate.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/videohelix/src/mpxvideoplaybackstate.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -16,7 +16,7 @@ */ -// Version : %version: 41 % +// Version : %version: 44 % // @@ -173,6 +173,14 @@ } // ------------------------------------------------------------------------------------------------ +// CMPXVideoPlaybackState::HandleSetPosterFrame() +// ------------------------------------------------------------------------------------------------ +void CMPXVideoPlaybackState::HandleSetPosterFrame() +{ + MPX_DEBUG(_L("CMPXVideoPlaybackState::HandleSetPosterFrame()")); +} + +// ------------------------------------------------------------------------------------------------ // CMPXVideoPlaybackState::HandleForeground() // ------------------------------------------------------------------------------------------------ void CMPXVideoPlaybackState::HandleForeground() @@ -1195,8 +1203,6 @@ if ( iVideoPlaybackCtlr->iPlaybackMode->CanPlayNow() ) { - iVideoPlaybackCtlr->iForegroundPause = EFalse; - IssuePlayCommand( EMPXVideoBuffering, MMPXPlaybackPluginObserver::EPBufferingStarted ); } else @@ -1365,6 +1371,18 @@ HandlePause(); } + +// ------------------------------------------------------------------------------------------------ +// CMPXPlayingState::HandleSetPosterFrame() +// ------------------------------------------------------------------------------------------------ +void CMPXPlayingState::HandleSetPosterFrame() +{ + MPX_DEBUG(_L("CMPXPlayingState::HandleSetPosterFrame()")); + + iVideoPlaybackCtlr->iPlaybackMode->HandleSetPosterFrame(); +} + + // ------------------------------------------------------------------------------------------------ // CMPXPlayingState::HandleStartSeekL() // ------------------------------------------------------------------------------------------------ @@ -1507,8 +1525,6 @@ if ( iVideoPlaybackCtlr->iPlaybackMode->CanPlayNow() ) { - iVideoPlaybackCtlr->iForegroundPause = EFalse; - IssuePlayCommand( EMPXVideoPlaying, MMPXPlaybackPluginObserver::EPPlaying ); } } @@ -1523,6 +1539,16 @@ } // ------------------------------------------------------------------------------------------------ +// CMPXPausedState::HandleSetPosterFrame() +// ------------------------------------------------------------------------------------------------ +void CMPXPausedState::HandleSetPosterFrame() +{ + MPX_DEBUG(_L("CMPXPausedState::HandleSetPosterFrame()")); + + iVideoPlaybackCtlr->iPlaybackMode->HandleSetPosterFrame(); +} + +// ------------------------------------------------------------------------------------------------ // CMPXPausedState::HandleSetPositionL() // ------------------------------------------------------------------------------------------------ void CMPXPausedState::HandleSetPositionL( TInt aPosition ) @@ -1595,17 +1621,9 @@ // ------------------------------------------------------------------------------------------------ void CMPXPausedState::HandleForeground() { - MPX_ENTER_EXIT(_L("CMPXPausedState::HandleForeground()"), - _L("foreground pause = %d"), iVideoPlaybackCtlr->iForegroundPause ); + MPX_ENTER_EXIT(_L("CMPXPausedState::HandleForeground()")); - if ( iVideoPlaybackCtlr->iForegroundPause ) - { - iVideoPlaybackCtlr->iState->HandlePlay(); - } - else - { - MPX_TRAPD( err, iVideoPlaybackCtlr->iPlayer->RefreshFrameL() ); - } + MPX_TRAPD( err, iVideoPlaybackCtlr->iPlayer->RefreshFrameL() ); } // ------------------------------------------------------------------------------------------------ @@ -1619,8 +1637,6 @@ if ( iVideoPlaybackCtlr->iPlaybackMode->CanPlayNow() ) { - iVideoPlaybackCtlr->iForegroundPause = EFalse; - IssuePlayCommand( EMPXVideoPlaying, MMPXPlaybackPluginObserver::EPPlaying, EFalse ); } } @@ -1779,7 +1795,7 @@ if ( aError == KErrNone ) { - if ( iVideoPlaybackCtlr->iAppInForeground && !iVideoPlaybackCtlr->iForegroundPause ) + if ( iVideoPlaybackCtlr->iPlaybackMode->CanPlayNow() ) { iVideoPlaybackCtlr->ChangeState( EMPXVideoPlaying ); diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/videohelix/src/mpxvideoplayerutility.cpp --- a/videoplayback/videohelix/src/mpxvideoplayerutility.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/videohelix/src/mpxvideoplayerutility.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -16,13 +16,14 @@ */ -// Version : %version: 20 % +// Version : %version: 22 % #include #include #include #include +#include #include "mpxvideoplayerutility.h" #include "mpxvideoplaybackcontroller.h" @@ -45,7 +46,8 @@ } CMpxVideoPlayerUtility::CMpxVideoPlayerUtility( CMPXVideoPlaybackController* aVideoPlaybackCtrl ) - : iVideoPlaybackController( aVideoPlaybackCtrl ) + : CActive( EPriorityStandard ) + , iVideoPlaybackController( aVideoPlaybackCtrl ) , iVideoControllerCustomCommands( iController ) , iVideoPlayControllerCustomCommands( iController ) , iAudioPlayDeviceCustomCommands( iController ) @@ -60,6 +62,8 @@ void CMpxVideoPlayerUtility::ConstructL() { OpenControllerL(); + + CActiveScheduler::Add( this ); } CMpxVideoPlayerUtility::~CMpxVideoPlayerUtility() @@ -84,6 +88,17 @@ iController.Close(); iDirectScreenAccessAbort = EFalse; + + if ( IsActive() ) + { + Cancel(); + + if ( iPosterFrameBitmap ) + { + delete iPosterFrameBitmap; + iPosterFrameBitmap = NULL; + } + } } void CMpxVideoPlayerUtility::Reset() @@ -308,6 +323,55 @@ MPX_DEBUG(_L("CMpxVideoPlayerUtility::GetVideoLoadingProgressL(%d)"), aPercentageProgress ); } +void CMpxVideoPlayerUtility::GetFrameL() +{ + MPX_DEBUG(_L("CMpxVideoPlayerUtility::GetFrameL")); + + // dont get another frame if a request is already pending + // + if ( ! IsActive() ) + { + iPosterFrameBitmap = new (ELeave) CFbsBitmap; + User::LeaveIfError(iPosterFrameBitmap->Create(TSize(0,0), EColor16MU)); + + iVideoPlayControllerCustomCommands.GetFrame( *iPosterFrameBitmap, iStatus ); + SetActive(); + } + +} + +void CMpxVideoPlayerUtility::RunL() +{ + MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::RunL()")); + + if ( iStatus.Int() == KErrNone ) + { + iVideoPlaybackController->HandleFrameReady( iStatus.Int() ); + } + else + { + // Bitmap ownership will NOT be transferred to thumbnail manager so delete it + delete iPosterFrameBitmap; + iPosterFrameBitmap = NULL; + } +} + +void CMpxVideoPlayerUtility::DoCancel() +{ + MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::DoCancel()")); + + // Bitmap ownership will NOT be transferred to thumbnail manager so delete it + delete iPosterFrameBitmap; + iPosterFrameBitmap = NULL; +} + +CFbsBitmap& CMpxVideoPlayerUtility::GetBitmap() +{ + MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::GetBitmap()")); + + return *iPosterFrameBitmap; +} + void CMpxVideoPlayerUtility::PlayL() { MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::PlayL()")); @@ -485,22 +549,23 @@ if ( iSurfaceId.IsNull() ) { TSurfaceId surfaceId; - TRect cropRect; - TVideoAspectRatio aspectRatio; error = iVideoPlaySurfaceSupportCustomCommands.GetSurfaceParameters( surfaceId, - cropRect, - aspectRatio ); + iCropRect, + iAspectRatio ); if ( error == KErrNone ) { - // - // Send data to the display handler to remove old surface and add new surface - // - MPX_TRAPD( err, SendSurfaceCommandL( EPbMsgVideoSurfaceCreated, - surfaceId, - cropRect, - aspectRatio ) ); + if ( iVideoPlaybackController->IsViewActivated() ) + { + // + // Send data to the display handler to remove old surface and add new surface + // + MPX_TRAPD( err, SendSurfaceCommandL( EPbMsgVideoSurfaceCreated, + surfaceId, + iCropRect, + iAspectRatio ) ); + } iSurfaceId = surfaceId; } @@ -634,6 +699,23 @@ } } +// ------------------------------------------------------------------------------------------------- +// CMpxVideoPlayerUtility::SendSurfaceCreatedCommand() +// ------------------------------------------------------------------------------------------------- +// +void CMpxVideoPlayerUtility::SendSurfaceCreatedCommand() +{ + MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::SendSurfaceCreatedCommand()")); + + if ( ! iSurfaceId.IsNull() ) + { + MPX_TRAPD( err, SendSurfaceCommandL( EPbMsgVideoSurfaceCreated, + iSurfaceId, + iCropRect, + iAspectRatio ) ); + } +} + #endif #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/videohelix/src/mpxvideoposterframesetter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videoplayback/videohelix/src/mpxvideoposterframesetter.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -0,0 +1,164 @@ +/* +* 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 "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: poster frame setter + * +*/ + +// Version : %version: ou1cpsw#2 % + + +// INCLUDE FILES +#include +#include + +#include "mpxvideoposterframesetter.h" +#include "mpxvideoplaybackcontroller.h" +#include "mpxvideo_debug.h" + +// ============================ MEMBER FUNCTIONS =================================================== + +// ------------------------------------------------------------------------------------------------- +// CMPXVideoPosterFrameSetter::CMPXVideoPosterFrameSetter +// C++ default constructor can NOT contain any code, that might leave. +// ------------------------------------------------------------------------------------------------- +// +CMPXVideoPosterFrameSetter::CMPXVideoPosterFrameSetter( CMPXVideoPlaybackController* aVideoPlaybackCtlr ) + : iVideoPlaybackCtlr( aVideoPlaybackCtlr ) +{ + MPX_ENTER_EXIT(_L("CMPXVideoPosterFrameSetter::CMPXVideoPosterFrameSetter()")); +} + +// ------------------------------------------------------------------------------------------------- +// CMPXVideoPosterFrameSetter::ConstructL +// Symbian 2nd phase constructor can leave. +// ------------------------------------------------------------------------------------------------- +// +void CMPXVideoPosterFrameSetter::ConstructL() +{ + MPX_ENTER_EXIT(_L("CMPXVideoPosterFrameSetter::ConstructL()")); + + iTNManager = CThumbnailManager::NewL( *this ); +} + +// ------------------------------------------------------------------------------------------------- +// CMPXVideoPosterFrameSetter::NewL +// Two-phased constructor. +// ------------------------------------------------------------------------------------------------- +// +CMPXVideoPosterFrameSetter* CMPXVideoPosterFrameSetter::NewL( CMPXVideoPlaybackController* aVideoPlaybackCtlr ) +{ + MPX_ENTER_EXIT(_L("CMPXVideoPosterFrameSetter::NewL()")); + + CMPXVideoPosterFrameSetter* self = new( ELeave ) CMPXVideoPosterFrameSetter( aVideoPlaybackCtlr ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; +} + +// ------------------------------------------------------------------------------------------------- +// CMPXVideoPosterFrameSetter::~CMPXVideoPosterFrameSetter +// Destructor +// ------------------------------------------------------------------------------------------------- +// +CMPXVideoPosterFrameSetter::~CMPXVideoPosterFrameSetter() +{ + MPX_ENTER_EXIT(_L("CMPXVideoPosterFrameSetter::~CMPXVideoPosterFrameSetter()")); + + if ( iTNManager ) + { + delete iTNManager; + iTNManager = NULL; + } +} + +// ------------------------------------------------------------------------------------------------- +// CMPXVideoPosterFrameSetter::RequestPosterFrameL +// ------------------------------------------------------------------------------------------------- +// +void CMPXVideoPosterFrameSetter::RequestPosterFrame() +{ + MPX_ENTER_EXIT(_L("CMPXVideoPosterFrameSetter::RequestPosterFrame()")); + + if ( ! iVideoPlaybackCtlr->iFileDetails->iDrmProtected ) + { + TRAP_IGNORE( iVideoPlaybackCtlr->iPlayer->GetFrameL() ); + } + else + { + MPX_TRAPD(err, + iVideoPlaybackCtlr->iState->SendErrorToViewL(KMPXVideoSetPosterFrameNotSupported)); + } +} + +// ------------------------------------------------------------------------------------------------- +// CMPXVideoPosterFrameSetter::HandlePosterFrameReady +// ------------------------------------------------------------------------------------------------- +// +void CMPXVideoPosterFrameSetter::HandlePosterFrameReady(TInt aError) +{ + MPX_ENTER_EXIT(_L("CMPXVideoPosterFrameSetter::HandlePosterFrameReady()")); + + if ( aError == KErrNone ) + { + CThumbnailObjectSource* tnSource( 0 ); + TRAP_IGNORE + ( + tnSource = CThumbnailObjectSource::NewL( &iVideoPlaybackCtlr->iPlayer->GetBitmap(), + iVideoPlaybackCtlr->iClipName->Des() ); + + CleanupStack::PushL( tnSource ); + iRequestId = iTNManager->SetThumbnailL( *tnSource ); + CleanupStack::PopAndDestroy( tnSource ); + ); + } +} + +// ------------------------------------------------------------------------------------------------- +// CMPXVideoPosterFrameSetter::ThumbnailPreviewReady +// +// callback method from MThumbnailManagerObserver +// ------------------------------------------------------------------------------------------------- +// +void CMPXVideoPosterFrameSetter::ThumbnailPreviewReady( MThumbnailData& /*aThumbnail*/, + TThumbnailRequestId /*aId*/ ) +{ + MPX_ENTER_EXIT(_L("CMPXVideoPosterFrameSetter::ThumbnailPreviewReady()")); +} + +// ------------------------------------------------------------------------------------------------- +// CMPXVideoPosterFrameSetter::ThumbnailReady +// +// callback method from MThumbnailManagerObserver +// ------------------------------------------------------------------------------------------------- +// +void CMPXVideoPosterFrameSetter::ThumbnailReady( TInt aError, + MThumbnailData& /*aThumbnail*/, + TThumbnailRequestId /*aId*/ ) +{ + MPX_DEBUG(_L("CMPXVideoPosterFrameSetter::ThumbnailReady() aError = %d"), aError ); + + if ( aError == KErrNone ) + { + MPX_TRAPD( err, + iVideoPlaybackCtlr->iState->SendErrorToViewL( KMPXVideoSetPosterFrameSuccess ) ); + } + else + { + MPX_TRAPD( err, + iVideoPlaybackCtlr->iState->SendErrorToViewL( KMPXVideoSetPosterFrameFailure ) ); + } +} + +// End of File diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/videohelix/tsrc/ut_videohelixtest/conf/videohelixtest.cfg --- a/videoplayback/videohelix/tsrc/ut_videohelixtest/conf/videohelixtest.cfg Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/conf/videohelixtest.cfg Wed Jun 23 17:22:59 2010 +0100 @@ -25,6 +25,7 @@ EPbCmdStretchAspectRatio 11 EPbCmdHandleIncreaseVolume 17 EPbCmdHandleDecreaseVolume 18 +EPbCmdSetPosterFrame 24 EMMFNatural 2 EMMFZoom 3 @@ -53,6 +54,7 @@ ERFile 1 ERFile64 0 +EMPXVideoLocal 0 [Enddefine] @@ -526,20 +528,7 @@ [Endtest] [Test] -title 33. Alarm: Auto resume -create videohelixtest test -test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone -waittestclass test -test IssueGeneralCommand EPbCmdPlay KErrNone ECallbackBuffering -waittestclass test -test AlarmAutoResume EPbCmdHandleBackground EPbCmdHandleForeground -waittestclass test -delete test -pause 1000 -[Endtest] - -[Test] -title 34. Incoming Phone Call: Rejected +title 33. Incoming Phone Call: Rejected create videohelixtest test test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone waittestclass test @@ -552,7 +541,7 @@ [Endtest] [Test] -title 35. Incoming Voice Call: Accepted +title 34. Incoming Voice Call: Accepted create videohelixtest test test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone waittestclass test @@ -566,7 +555,7 @@ [Endtest] [Test] -title 36. Incoming Video Call: Accepted +title 35. Incoming Video Call: Accepted create videohelixtest test test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone waittestclass test @@ -580,7 +569,7 @@ [Endtest] [Test] -title 37. Play During Video Call +title 36. Play During Video Call create videohelixtest test test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone waittestclass test @@ -594,7 +583,7 @@ [Endtest] [Test] -title 38. Play During voice Call +title 37. Play During voice Call create videohelixtest test test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone waittestclass test @@ -608,7 +597,7 @@ [Endtest] [Test] -title 39. Initialise with SDP file via 32-bit file handle +title 38. Initialise with SDP file via 32-bit file handle create videohelixtest test test InitializeHandle ERFile 60000 10 sdp_test.sdp KErrNone KErrNone KErrNone waittestclass test @@ -617,7 +606,7 @@ [Endtest] [Test] -title 40. Tv-Out before Initialization - Playback Allowed +title 39. Tv-Out before Initialization - Playback Allowed create videohelixtest test test SetTvOutConnected ETvOutPlaybackAllowed test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone @@ -630,7 +619,7 @@ [Endtest] [Test] -title 41. Tv-Out after Initialization - Playback Allowed +title 40. Tv-Out after Initialization - Playback Allowed create videohelixtest test test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone waittestclass test @@ -644,7 +633,7 @@ [Endtest] [Test] -title 42. Tv-Out before Initialization - DRM Playback Allowed +title 41. Tv-Out before Initialization - DRM Playback Allowed create videohelixtest test test SetTvOutConnected ETvOutPlaybackAllowed test Initialize 0 10 dcf.odf KErrNone KErrNone KErrNone @@ -657,7 +646,7 @@ [Endtest] [Test] -title 43. Tv-Out after Initialization - DRM Playback Allowed +title 42. Tv-Out after Initialization - DRM Playback Allowed create videohelixtest test test Initialize 0 10 dcf.odf KErrNone KErrNone KErrNone waittestclass test @@ -670,7 +659,7 @@ [Endtest] [Test] -title 44. DRM Protected file with Rights +title 43. DRM Protected file with Rights create videohelixtest test test SetDrmProtected 0 test Initialize 0 10 dcf.odf KErrNone KErrNone KErrNone @@ -682,7 +671,7 @@ [Endtest] [Test] -title 45. DRM Protected file without rights +title 44. DRM Protected file without rights create videohelixtest test test SetDrmProtected -17452 test Initialize 0 10 vhpp_test.3gp KErrNone KErrNone -17452 @@ -695,7 +684,7 @@ [Endtest] [Test] -title 46. EndOfClip Custom Commands +title 45. EndOfClip Custom Commands create videohelixtest test test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone waittestclass test @@ -705,7 +694,7 @@ [Endtest] [Test] -title 47. PDL - Not enough Data +title 46. PDL - Not enough Data create videohelixtest test test ConnectToDownload 2 vhpp_test.3gp waittestclass test @@ -719,7 +708,7 @@ [Endtest] [Test] -title 48. Handle volume increase (10-steps) +title 47. Handle volume increase (10-steps) create videohelixtest test test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone waittestclass test @@ -739,7 +728,7 @@ [Endtest] [Test] -title 49. Handle volume decrease (10-steps) +title 48. Handle volume decrease (10-steps) create videohelixtest test test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone waittestclass test @@ -759,7 +748,7 @@ [Endtest] [Test] -title 50. Handle volume increase (20-steps) +title 49. Handle volume increase (20-steps) create videohelixtest test test Initialize 60000 20 vhpp_test.3gp KErrNone KErrNone KErrNone waittestclass test @@ -779,7 +768,7 @@ [Endtest] [Test] -title 51. Handle volume decrease (20-steps) +title 50. Handle volume decrease (20-steps) create videohelixtest test test Initialize 60000 20 vhpp_test.3gp KErrNone KErrNone KErrNone waittestclass test @@ -799,7 +788,7 @@ [Endtest] [Test] -title 52. InitialiseL with 64-bit file handle +title 51. InitialiseL with 64-bit file handle create videohelixtest test test InitializeHandle ERFile64 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone waittestclass test @@ -808,7 +797,7 @@ [Endtest] [Test] -title 53. Initialise with SDP file via 64-bit file handle +title 52. Initialise with SDP file via 64-bit file handle create videohelixtest test test InitializeHandle ERFile64 60000 10 sdp_test.sdp KErrNone KErrNone KErrNone waittestclass test @@ -817,7 +806,7 @@ [Endtest] [Test] -title 54. InitialiseWithPositionL with file missing +title 53. InitialiseWithPositionL with file missing create videohelixtest test test InitializeWithPositionL 0 10 6575 vhpp_nofile.3gp KErrNotFound KErrNone KErrNone waittestclass test @@ -828,7 +817,7 @@ [Endtest] [Test] -title 55. InitialiseL with 32-bit file handle +title 54. InitialiseL with 32-bit file handle create videohelixtest test test InitializeHandleWithPositionL ERFile 60000 10 6575 vhpp_test.3gp KErrNone KErrNone KErrNone waittestclass test @@ -837,7 +826,7 @@ [Endtest] [Test] -title 56. Initialise with rtsp link & AP +title 55. Initialise with rtsp link & AP create videohelixtest test test InitializeLinkWithPositionL 0 10 6575 rtsp:\/\/link.3gp KErrNone KErrNone KErrNone waittestclass test @@ -846,7 +835,7 @@ [Endtest] [Test] -title 57. Play rtsp link (forces buffering state) +title 56. Play rtsp link (forces buffering state) create videohelixtest test test InitializeLinkWithPositionL 0 10 6575 rtsp:\/\/link.3gp KErrNone KErrNone KErrNone waittestclass test @@ -857,7 +846,7 @@ [Endtest] [Test] -title 58. Initialise with SDP file via 32-bit file handle +title 57. Initialise with SDP file via 32-bit file handle create videohelixtest test test InitializeHandleWithPositionL ERFile 60000 10 6575 sdp_test.sdp KErrNone KErrNone KErrNone waittestclass test @@ -866,7 +855,7 @@ [Endtest] [Test] -title 59. InitialiseL with 64-bit file handle +title 58. InitialiseL with 64-bit file handle create videohelixtest test test InitializeHandleWithPositionL ERFile64 60000 10 6575 vhpp_test.3gp KErrNone KErrNone KErrNone waittestclass test @@ -875,7 +864,7 @@ [Endtest] [Test] -title 60. Initialise with SDP file via 64-bit file handle +title 59. Initialise with SDP file via 64-bit file handle create videohelixtest test test InitializeHandleWithPositionL ERFile64 60000 10 6575 sdp_test.sdp KErrNone KErrNone KErrNone waittestclass test @@ -883,3 +872,44 @@ pause 1000 [Endtest] +[Test] +title 60. Set Poster Frame +create videohelixtest test +test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone +waittestclass test +pause 100 +test IssueGeneralCommand EPbCmdPlay KErrNone ECallbackBuffering +waittestclass test +test IssueVideoCommand EPbCmdSetPosterFrame +delete test +pause 1000 +[Endtest] + +[Test] +title 61. InitialiseL link via 32-bit file handle +create videohelixtest test +test InitializeStreamingWithSdpFileHandleL ERFile 60000 10 sdp_test.sdp KErrNone KErrNone KErrNone +waittestclass test +delete test +pause 1000 +[Endtest] + +[Test] +title 62. InitialiseL link via 64-bit file handle +create videohelixtest test +test InitializeStreamingWithSdpFileHandleL ERFile64 60000 10 sdp_test.sdp KErrNone KErrNone KErrNone +waittestclass test +delete test +pause 1000 +[Endtest] + +[Test] +title 63. Retrieve FileName and playback mode -- Custom Commands EPbCmdInitView +create videohelixtest test +test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone +waittestclass test +test RetrieveFileNameAndModeL vhpp_test.3gp EMPXVideoLocal +pause 1000 +delete test +pause 1000 +[Endtest] diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/videohelix/tsrc/ut_videohelixtest/group/videohelixtest.mmp --- a/videoplayback/videohelix/tsrc/ut_videohelixtest/group/videohelixtest.mmp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/group/videohelixtest.mmp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: ou1cpsw#8 % +// Version : %version: 11 % @@ -45,21 +45,21 @@ SOURCE videohelixtestbody.cpp SOURCE timeoutcontroller.cpp SOURCE mpxvideoplayerutility_stub.cpp -SOURCE dlmgr_stub.cpp SOURCE mpxvideoregion.cpp SOURCE stifutilities.cpp SOURCE mediarecognizer_stub.cpp SOURCE mpxvideoaccessoryobserver_stub.cpp SOURCE mpxvideodrmhelper_stub.cpp +SOURCE tnmgr_stub.cpp SOURCEPATH ../../../src -SOURCE mpxvideodlmgrif.cpp SOURCE mpxvideofiledetails.cpp SOURCE mpxvideohelixplayback.cpp SOURCE mpxvideoplaybackcontroller.cpp SOURCE mpxvideoplaybackmode.cpp SOURCE mpxvideoplaybackstate.cpp SOURCE mpxvideoseeker.cpp +SOURCE mpxvideoposterframesetter.cpp LIBRARY euser.lib @@ -89,5 +89,6 @@ LIBRARY flogger.lib LIBRARY playbackhelper.lib LIBRARY hwrmlightclient.lib // Lights control +LIBRARY fbscli.lib // End of File diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/videohelix/tsrc/ut_videohelixtest/inc/dlmgr_stub.h --- a/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/dlmgr_stub.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/dlmgr_stub.h Wed Jun 23 17:22:59 2010 +0100 @@ -15,8 +15,9 @@ * */ -// Version : %version: 4 % +// Version : %version: 5 % +#ifdef USE_S60_DOWNLOAD_MANAGER #ifndef __RHTTPDOWNLOADMGRAPIEXT_H__ #define __RHTTPDOWNLOADMGRAPIEXT_H__ @@ -188,3 +189,4 @@ #endif // __RHTTPDOWNLOADMGRAPIEXT_H__ +#endif // USE_S60_DOWNLOAD_MANAGER diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/videohelix/tsrc/ut_videohelixtest/inc/mpxvideoplayerutility_stub.h --- a/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/mpxvideoplayerutility_stub.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/mpxvideoplayerutility_stub.h Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 12 % +// Version : %version: 14 % #ifndef __MPXVIDEOPLAYERUTILITY__ @@ -42,6 +42,7 @@ // FORWARD DECLARATIONS // class CMPXVideoPlaybackController; +class CFbsBitmap; // // CLASS DECLARATION @@ -112,6 +113,9 @@ void SetVolumeSteps( TInt aVolumeSteps ); void SurfaceRemovedFromView(); + + void GetFrameL(); + CFbsBitmap& GetBitmap(); #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API void OpenFile64L( const RFile64& aFile ); @@ -122,6 +126,7 @@ TInt VideoSurfaceCreated(); TInt SurfaceParametersChanged(); TInt RemoveSurface(); + void SendSurfaceCreatedCommand(); #endif @@ -179,6 +184,8 @@ TTimeIntervalMicroSeconds iPosition; TTimeIntervalMicroSeconds iDuration; + + CFbsBitmap* iPosterFrameBitmap; }; #endif /* __MPXVIDEOPLAYERUTILITY__ */ diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/videohelix/tsrc/ut_videohelixtest/inc/tnmgr_stub.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/tnmgr_stub.h Wed Jun 23 17:22:59 2010 +0100 @@ -0,0 +1,68 @@ +/* +* 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 "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: Thumbnail Manager Stub + * +*/ + +// Version : %version: 1 % + +#ifndef TNMGR_STUB_H_ +#define TNMGR_STUB_H_ + +class CFbsBitmap; +class MThumbnailData; +//class MThumbnailManagerObserver; + +typedef TInt TThumbnailRequestId; + +class MThumbnailManagerObserver + { +public: + + virtual void ThumbnailPreviewReady( MThumbnailData& aThumbnail, + TThumbnailRequestId aId ) = 0; + + virtual void ThumbnailReady( TInt aError, MThumbnailData& aThumbnail, + TThumbnailRequestId aId ) = 0; +}; + + +class CThumbnailObjectSource : public CBase + { +public: + + CThumbnailObjectSource( CFbsBitmap* aBitmap, const TDesC& aUri ); + virtual ~CThumbnailObjectSource(); + static CThumbnailObjectSource* NewL( CFbsBitmap* aBitmap, const TDesC& aUri ); +}; + + + +class CThumbnailManager : public CBase +{ + +public: + + CThumbnailManager( MThumbnailManagerObserver& aObserver ); + virtual ~CThumbnailManager(); + static CThumbnailManager* NewL( MThumbnailManagerObserver& aObserver ); + + TThumbnailRequestId SetThumbnailL( CThumbnailObjectSource& source ); + +public: + MThumbnailManagerObserver& iObserver; +}; + + +#endif /* TNMGR_STUB_H_ */ diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/videohelix/tsrc/ut_videohelixtest/inc/videohelixtest.h --- a/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/videohelixtest.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/videohelixtest.h Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 13 % +// Version : %version: e003sa33#15 % #ifndef __VHPPTESTCASE_H__ @@ -155,7 +155,6 @@ virtual TInt ChangeAspectRatioL( CStifItemParser& aItem ); virtual TInt AlarmOn( CStifItemParser& aItem ); - virtual TInt AlarmAutoResume( CStifItemParser& aItem ); virtual TInt PhoneCallRejected( CStifItemParser& aItem ); virtual TInt VoiceCallAccepted( CStifItemParser& aItem ); @@ -173,6 +172,8 @@ virtual TInt InitializeWithPositionL( CStifItemParser& aItem ); virtual TInt InitializeLinkWithPositionL( CStifItemParser& aItem ); virtual TInt InitializeHandleWithPositionL( CStifItemParser& aItem ); + virtual TInt InitializeStreamingWithSdpFileHandleL( CStifItemParser& aItem ); + virtual TInt RetrieveFileNameAndModeL( CStifItemParser& aItem ); // --------------------------------------------------------------------- // Helper Functions diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/videohelix/tsrc/ut_videohelixtest/src/mpxvideoplayerutility_stub.cpp --- a/videoplayback/videohelix/tsrc/ut_videohelixtest/src/mpxvideoplayerutility_stub.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/src/mpxvideoplayerutility_stub.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 15 % +// Version : %version: 17 % #include #include @@ -425,6 +425,29 @@ TInt openError = ReadOpenError(); } +void CMpxVideoPlayerUtility::GetFrameL() +{ + MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::GetFrameL()")); + + if ( iStifObserver ) + { + TCallbackEvent* event = new TCallbackEvent; + event->iEvent = EPbCmdSetPosterFrame; + event->iData = 0; + event->iError = KErrNone; + iStifObserver->HandleUtilityEvent( event ); + } + + iVideoPlaybackController->HandleFrameReady( KErrGeneral ); +} + +CFbsBitmap& CMpxVideoPlayerUtility::GetBitmap() +{ + MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::GetBitmap()")); + + iPosterFrameBitmap = new (ELeave) CFbsBitmap; + return *iPosterFrameBitmap; +} TInt CMpxVideoPlayerUtility::ReadOpenError() { @@ -753,6 +776,11 @@ return KErrNone; } +void CMpxVideoPlayerUtility::SendSurfaceCreatedCommand() +{ + MPX_DEBUG(_L("CMpxVideoPlayerUtility::SendSurfaceCreatedCommand()")); +} + #endif #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/videohelix/tsrc/ut_videohelixtest/src/tnmgr_stub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/src/tnmgr_stub.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -0,0 +1,70 @@ +/* +* 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 "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: Thumbnail Manager stub impl +* +*/ + +// Version : %version: 2 % + +#include +#include "tnmgr_stub.h" +#include "mpxvideo_debug.h" + + +/**************************************************** + * CThumbnailManager stub implementation + ****************************************************/ +CThumbnailManager::~CThumbnailManager() +{ +} + +CThumbnailManager* CThumbnailManager::NewL( MThumbnailManagerObserver& aObserver ) +{ + MPX_ENTER_EXIT(_L("CThumbnailManager::NewL() - stub impl")); + CThumbnailManager* self = new( ELeave )CThumbnailManager( aObserver ); + return self; +} + +CThumbnailManager::CThumbnailManager( MThumbnailManagerObserver& aObserver ) +: iObserver( aObserver ) +{ + MPX_ENTER_EXIT(_L("CThumbnailManager::CThumbnailManager() - stub impl")); +} + +TThumbnailRequestId CThumbnailManager::SetThumbnailL( CThumbnailObjectSource& /* aObjectSource */ ) +{ + MPX_ENTER_EXIT(_L("CThumbnailManager::SetThumbnailL() - stub impl")); + return 0; +} + + +/**************************************************** + * CThumbnailObjectSource stub implementation + ****************************************************/ +CThumbnailObjectSource::~CThumbnailObjectSource() +{ +} + +CThumbnailObjectSource* CThumbnailObjectSource::NewL( CFbsBitmap* aBitmap, const TDesC& aUri ) +{ + MPX_ENTER_EXIT(_L("CThumbnailObjectSource::NewL() - stub impl")); + CThumbnailObjectSource* self = new( ELeave )CThumbnailObjectSource( aBitmap, aUri ); + return self; +} + +CThumbnailObjectSource::CThumbnailObjectSource( CFbsBitmap* /* aBitmap */ , const TDesC& /* aUri */ ) +{ +} + + diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/videohelix/tsrc/ut_videohelixtest/src/videohelixtest.cpp --- a/videoplayback/videohelix/tsrc/ut_videohelixtest/src/videohelixtest.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/src/videohelixtest.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 6 % +// Version : %version: 7 % // INCLUDE FILES @@ -129,10 +129,10 @@ // // CenRep volume range is 0 - number of steps (either 10 or 20). - // Set default CenRep values as volume(4), mute(0) + // Set default CenRep values as volume(40), mute(0) // CRepository* volCenRep = CRepository::NewL( KCRUidMPXVideoSettings ); - volCenRep->Set( KMPXVideoPlaybackVolume, 4 ); + volCenRep->Set( KMPXVideoPlaybackVolume, 40 ); volCenRep->Set( KMPXVideoPlaybackMute, 0 ); delete volCenRep; diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayback/videohelix/tsrc/ut_videohelixtest/src/videohelixtestbody.cpp --- a/videoplayback/videohelix/tsrc/ut_videohelixtest/src/videohelixtestbody.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/src/videohelixtestbody.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 21 % +// Version : %version: e003sa33#24.1.1 % // [INCLUDE FILES] - do not remove @@ -42,6 +42,7 @@ #include "mpxmediavideodefs.h" #include "mpxvideo_debug.h" #include "mpxvideoplayerutility_stub.h" +#include "mpxhelixplaybackplugindefs.h" #ifdef __WINSCW__ _LIT( KVideoTestPath, "c:\\data\\Videos\\" ); @@ -99,7 +100,6 @@ ENTRY( "ChangeAspectRatioL", CVHPPTestClass::ChangeAspectRatioL), ENTRY( "AlarmOn", CVHPPTestClass::AlarmOn), - ENTRY( "AlarmAutoResume", CVHPPTestClass::AlarmAutoResume), ENTRY( "PhoneCallRejected", CVHPPTestClass::PhoneCallRejected), ENTRY( "VoiceCallAccepted", CVHPPTestClass::VoiceCallAccepted), ENTRY( "VideoCallAccepted", CVHPPTestClass::VideoCallAccepted), @@ -119,7 +119,10 @@ ENTRY ("InitializeWithPositionL", CVHPPTestClass::InitializeWithPositionL), ENTRY ("InitializeLinkWithPositionL", CVHPPTestClass::InitializeLinkWithPositionL), - ENTRY ("InitializeHandleWithPositionL", CVHPPTestClass::InitializeHandleWithPositionL) + ENTRY ("InitializeHandleWithPositionL", CVHPPTestClass::InitializeHandleWithPositionL), + ENTRY ( "InitializeStreamingWithSdpFileHandleL", + CVHPPTestClass::InitializeStreamingWithSdpFileHandleL ), + ENTRY ( "RetrieveFileNameAndModeL", CVHPPTestClass::RetrieveFileNameAndModeL ) // // ADD NEW ENTRIES HERE @@ -1143,6 +1146,10 @@ MPX_ENTER_EXIT(_L("CVHPPTestClass::ConnectToDownloadL()")); iLog->Log(_L("CVHPPTestClass::ConnectToDownloadL()")); + TInt err = KErrNone; + +#ifdef USE_S60_DOWNLOAD_MANAGER + iDlMgrTester = CDlMgrTestClass::NewL(); iDlMgrTester->AddStifObserver( this ); @@ -1153,7 +1160,7 @@ // // Read in the download id and filename // - TInt err = aItem.GetNextInt( dlId ); + err = aItem.GetNextInt( dlId ); if ( err == KErrNone ) { @@ -1189,7 +1196,17 @@ CleanupStack::PopAndDestroy( cmd ); } } - + +#else // USE_S60_DOWNLOAD_MANAGER + + // suppress build warning + MPX_DEBUG(_L("CVHPPTestClass::ConnectToDownloadL() : parsing type = %d"), aItem.ParsingType()); + + // Signal TestScripter to continue from waittestclass + Signal(); + +#endif // USE_S60_DOWNLOAD_MANAGER + return err; } @@ -1203,6 +1220,8 @@ MPX_ENTER_EXIT(_L("CVHPPTestClass::SendPdlCustomCommandL"), _L("aCustomCmd = %d"), aCustomCmd ); +#ifdef USE_S60_DOWNLOAD_MANAGER + CMPXCommand* cmd = CMPXCommand::NewL(); CleanupStack::PushL( cmd ); @@ -1213,6 +1232,14 @@ iPlaybackPlugin->CommandL( *cmd ); CleanupStack::PopAndDestroy( cmd ); + +#else // USE_S60_DOWNLOAD_MANAGER + + // Signal TestScripter to continue from waittestclass + Signal(); + +#endif // USE_S60_DOWNLOAD_MANAGER + } // ----------------------------------------------------------------------------- @@ -1225,6 +1252,8 @@ MPX_ENTER_EXIT(_L("CVHPPTestClass::PauseDownloadL()")); iLog->Log(_L("CVHPPTestClass::PauseDownloadL()")); +#ifdef USE_S60_DOWNLOAD_MANAGER + TCallbackEvent* event = new TCallbackEvent; event->iEvent = EPDownloadStateChanged; @@ -1234,7 +1263,14 @@ AddExpectedEvent( event ); iDlMgrTester->PauseDownload(); - + +#else // USE_S60_DOWNLOAD_MANAGER + + // Signal TestScripter to continue from waittestclass + Signal(); + +#endif // USE_S60_DOWNLOAD_MANAGER + return KErrNone; } @@ -1248,9 +1284,13 @@ MPX_ENTER_EXIT(_L("CVHPPTestClass::ResumeDownloadL()")); iLog->Log(_L("CVHPPTestClass::ResumeDownloadL()")); + TInt err = KErrNone; + +#ifdef USE_S60_DOWNLOAD_MANAGER + TInt dlSize; - TInt err = aItem.GetNextInt( dlSize ); + err = aItem.GetNextInt( dlSize ); if ( err == KErrNone ) { @@ -1274,7 +1314,17 @@ iDlMgrTester->ResumeDownload(); } - + +#else // USE_S60_DOWNLOAD_MANAGER + + // suppress build warning + MPX_DEBUG(_L("CVHPPTestClass::ResumeDownloadL() : parsing type = %d"), aItem.ParsingType()); + + // Signal TestScripter to continue from waittestclass + Signal(); + +#endif // USE_S60_DOWNLOAD_MANAGER + return err; } @@ -1288,6 +1338,8 @@ MPX_ENTER_EXIT(_L("CVHPPTestClass::CancelDownloadL()")); iLog->Log(_L("CVHPPTestClass::CancelDownloadL()")); +#ifdef USE_S60_DOWNLOAD_MANAGER + TCallbackEvent* event = new TCallbackEvent; event->iEvent = EPDownloadStateChanged; @@ -1298,6 +1350,13 @@ iDlMgrTester->CancelDownload(); +#else // USE_S60_DOWNLOAD_MANAGER + + // Signal TestScripter to continue from waittestclass + Signal(); + +#endif // USE_S60_DOWNLOAD_MANAGER + return KErrNone; } @@ -1311,6 +1370,10 @@ MPX_ENTER_EXIT(_L("CVHPPTestClass::RetrievePdlStatusL()")); iLog->Log(_L("CVHPPTestClass::RetrievePdlStatusL()")); + TInt err = KErrNone; + +#ifdef USE_S60_DOWNLOAD_MANAGER + TInt pdlState; TInt expectedPdlState; TInt downloadedBytes; @@ -1321,7 +1384,7 @@ // // Read in the expected download data // - TInt err = aItem.GetNextInt( expectedPdlState ); + err = aItem.GetNextInt( expectedPdlState ); if ( err == KErrNone ) { @@ -1369,6 +1432,16 @@ CleanupStack::PopAndDestroy( cmd ); } +#else // USE_S60_DOWNLOAD_MANAGER + + // suppress build warning + MPX_DEBUG(_L("CVHPPTestClass::RetrievePdlStatusL() : parsing type = %d"), aItem.ParsingType()); + + // Signal TestScripter to continue from waittestclass + Signal(); + +#endif // USE_S60_DOWNLOAD_MANAGER + return err; } @@ -1549,6 +1622,8 @@ void CVHPPTestClass::ProcessEvent( TCallbackEvent* aCallback ) { + MPX_ENTER_EXIT(_L("CVHPPTestClass::ProcessEvent")); + if ( iExpectedCallbackArray->Count() > 0 ) { TCallbackEvent* expectedCallback = (*iExpectedCallbackArray)[0]; @@ -1724,51 +1799,6 @@ } // ----------------------------------------------------------------------------- -// CVHPPTestClass::AlarmOnAndOff -// ----------------------------------------------------------------------------- -// -TInt -CVHPPTestClass::AlarmAutoResume( CStifItemParser& aItem ) -{ - MPX_ENTER_EXIT(_L("CVHPPTestClass::AlarmOnAndOff()")); - iLog->Log(_L("CVHPPTestClass::AlarmOnAndOff()")); - - TInt backgroundCmd = 0; - TInt err = 0;//aItem.GetNextInt( backgroundCmd ); - - err = AlarmOn(aItem); - - if ( err == KErrNone ) - { - err = aItem.GetNextInt( backgroundCmd ); - - //reset alarm - RProperty::Set( KPSUidCoreApplicationUIs, KLightsAlarmLightActive, ELightsNotBlinking ); - - if ( err == KErrNone ) - { - TCallbackEvent* event = new TCallbackEvent; - event->iError = 0; - event->iData = 0; - event->iEvent = EPPlaying; - AddExpectedEvent( event ); - - //auto resume if alarm off - CMPXCommand* cmdPlay = CMPXCommand::NewL(); - CleanupStack::PushL( cmdPlay ); - cmdPlay->SetTObjectValueL( KMPXCommandGeneralDoSync, ETrue ); - cmdPlay->SetTObjectValueL( KMPXCommandGeneralId, KMPXMediaIdVideoPlayback ); - cmdPlay->SetTObjectValueL( KMPXMediaVideoPlaybackCommand, backgroundCmd ); - cmdPlay->SetTObjectValueL( KMPXMediaVideoAppForeground, ETrue ); - iPlaybackPlugin->CommandL( *cmdPlay ); - CleanupStack::PopAndDestroy( cmdPlay ); - } - } - - return err; -} - -// ----------------------------------------------------------------------------- // CVHPPTestClass::PhoneCallRejected // ----------------------------------------------------------------------------- // @@ -2398,4 +2428,164 @@ return err; } +TInt +CVHPPTestClass::InitializeStreamingWithSdpFileHandleL( CStifItemParser& aItem ) +{ + MPX_ENTER_EXIT(_L("CVHPPTestClass::InitializeStreamingWithSdpFileHandleL()")); + iLog->Log(_L("CVHPPTestClass::InitializeStreamingWithSdpFileHandleL()")); + + TInt duration; + TInt volumeSteps; + TInt fileHandle32; + + TInt err = aItem.GetNextInt( fileHandle32 ); + + if ( err == KErrNone ) + { + +#ifndef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API + // + // set RFile as default if the 64-bit flag is not defined + // + fileHandle32 = ETrue; +#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API + + err = aItem.GetNextInt( duration ); + + if ( err == KErrNone ) + { + // + // We will always get an Init Complete message out + // + TCallbackEvent* event = new TCallbackEvent; + + event->iEvent = EPInitialised; + event->iData = duration; + event->iError = KErrNone; + + AddExpectedEvent( event ); + + // + // read number of volume steps + // + err = aItem.GetNextInt( volumeSteps ); + + if ( err == KErrNone ) + { + // + // set volume steps + // + SetVolumeSteps( volumeSteps ); + + TBuf<120> fullPath; + err = ReadFileInitializationParameters( aItem, fullPath ); + + if ( err == KErrNone ) + { + PreparePluginL(); + + MPX_DEBUG( _L("Initialize the Plugin: link = %S"), &fullPath ); + iLog->Log( _L("Initialize the Plugin: link = %S"), &fullPath ); + + // + // Extract the streaming link from the ram file and + // Initalize the Plugin with the file handle and an access point + // + RFs fs; + TInt error = fs.Connect(); + + if ( fileHandle32 ) + { + RFile file; + error = file.Open( fs, fullPath, EFileRead | EFileShareAny ); + + MPX_DEBUG( _L("Initialize the Plugin: file open error = %d"), + error ); + + User::LeaveIfError( error ); + + iPlaybackPlugin->InitStreamingL( file, 11 ); + file.Close(); + } + #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API + else + { + RFile64 file64; + error = file64.Open( fs, fullPath, EFileRead | EFileShareAny ); + + MPX_DEBUG( _L("Initialize the Plugin: file open error = %d"), + error ); + + User::LeaveIfError( error ); + + iPlaybackPlugin->InitStreaming64L( file64, 11 ); + file64.Close(); + } +#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API + + fs.Close(); + } + } + } + } + return err; +} + +TInt +CVHPPTestClass::RetrieveFileNameAndModeL( CStifItemParser& aItem ) +{ + MPX_ENTER_EXIT( _L("CVHPPTestClass::RetrieveFileNameAndModeL()") ); + iLog->Log( _L("CVHPPTestClass::RetrieveFileNameAndModeL()") ); + + TBuf<120> fullPath; + TPtrC fileName; + TInt err; + + err = aItem.GetNextString( fileName ); + + if ( err == KErrNone ) + { + // + // Build the full path to the file + // + fullPath.Append( KVideoTestPath ); + fullPath.Append( fileName ); + + TInt mode; + err = aItem.GetNextInt( mode); + + if ( err == KErrNone ) + { + CMPXCommand* cmd = CMPXCommand::NewL(); + CleanupStack::PushL( cmd ); + + cmd->SetTObjectValueL( KMPXCommandGeneralDoSync, ETrue ); + cmd->SetTObjectValueL( KMPXCommandGeneralId, + KMPXMediaIdVideoPlayback ); + cmd->SetTObjectValueL( KMPXMediaVideoPlaybackCommand, EPbCmdInitView ); + + iPlaybackPlugin->CommandL( *cmd ); + + TPtrC clipName( cmd->ValueText( KMPXMediaVideoPlaybackFileName ) ); + TMPXVideoMode playbackMode = (TMPXVideoMode) cmd->ValueTObjectL( KMPXMediaVideoMode ); + + MPX_DEBUG( _L(" Expected Data: filename = %S, playbackmode= %d" ), + &fullPath, mode ); + + MPX_DEBUG( _L(" Retrieved Data: filename = %S, playbackmode= %d"), + &clipName, playbackMode ); + + if ( fullPath.Compare( clipName) != 0 || mode != playbackMode ) + { + err = KErrGeneral; + MPX_DEBUG( _L(" err = %d"), err ); + } + + CleanupStack::PopAndDestroy( cmd ); + } + } + + return err; +} + // EOF diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayerapp/bwins/videoplayerengineu.def --- a/videoplayerapp/bwins/videoplayerengineu.def Tue May 18 11:57:40 2010 +0100 +++ b/videoplayerapp/bwins/videoplayerengineu.def Wed Jun 23 17:22:59 2010 +0100 @@ -50,4 +50,7 @@ ?createPlayAndDetailsViews@QVideoPlayerEngine@@AAEXXZ @ 49 NONAME ; void QVideoPlayerEngine::createPlayAndDetailsViews(void) ?setCurrentView@QVideoPlayerEngine@@AAEXXZ @ 50 NONAME ; void QVideoPlayerEngine::setCurrentView(void) ?sortRole@VideoServices@@QBEHXZ @ 51 NONAME ; int VideoServices::sortRole(void) const + ?isPlayServiceInvoked@QVideoPlayerEngine@@AAE_NXZ @ 52 NONAME ; bool QVideoPlayerEngine::isPlayServiceInvoked(void) + ?shouldActivateCollectionView@QVideoPlayerEngine@@AAE_NXZ @ 53 NONAME ; bool QVideoPlayerEngine::shouldActivateCollectionView(void) + ?shouldExit@QVideoPlayerEngine@@AAE_NXZ @ 54 NONAME ; bool QVideoPlayerEngine::shouldExit(void) diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayerapp/eabi/videoplayerengineu.def --- a/videoplayerapp/eabi/videoplayerengineu.def Tue May 18 11:57:40 2010 +0100 +++ b/videoplayerapp/eabi/videoplayerengineu.def Wed Jun 23 17:22:59 2010 +0100 @@ -50,4 +50,7 @@ _ZN18QVideoPlayerEngine25createPlayAndDetailsViewsEv @ 49 NONAME _ZN18QVideoPlayerEngine14setCurrentViewEv @ 50 NONAME _ZNK13VideoServices8sortRoleEv @ 51 NONAME + _ZN18QVideoPlayerEngine20isPlayServiceInvokedEv @ 52 NONAME + _ZN18QVideoPlayerEngine10shouldExitEv @ 53 NONAME + _ZN18QVideoPlayerEngine28shouldActivateCollectionViewEv @ 54 NONAME diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayerapp/hbvideoplayer/hbvideoplayer.pro --- a/videoplayerapp/hbvideoplayer/hbvideoplayer.pro Tue May 18 11:57:40 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,78 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "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: Project file for building Videoplayer components -# -# -# Version : %version: da1mmcf#16 % - - -TARGET = videoplayer -CONFIG += hb service -TEMPLATE = app -TRANSLATIONS += videos.ts - -symbian: -{ - TARGET.CAPABILITY = ALL -DRM -TCB - TARGET.EPOCHEAPSIZE = 0x20000 0x1600000 - TARGET.UID3 = 0x200211FE - - BLD_INF_RULES.prj_exports += "rom/hbvideoplayer.iby CORE_APP_LAYER_IBY_EXPORT_PATH(hbvideoplayer.iby)" \ - "rom/hbvideoplayerresources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(hbvideoplayerresources.iby)" \ - "sis/videoplayer_stub.sis /epoc32/data/z/system/install/videoplayer_stub.sis" -} - -# Service provider specific configuration. -SERVICE.FILE = resources/service_conf.xml -SERVICE.OPTIONS = embeddable -# Service provider specific configuration ends - -INCLUDEPATH += . -INCLUDEPATH += ../inc \ - ../../inc \ - /epoc32/include/mw/hb/hbtools - -LIBS += -lvideoplayerengine.dll \ - -lxqservice.dll \ - -lxqserviceutil.dll - -VPATH += src - -SOURCES += main.cpp - -RSS_RULES += \ -" datatype_list = " \ -" { " \ -" DATATYPE { priority=EDataTypePrioritySystem; type=\"video/avi\"; }, " \ -" DATATYPE { priority=EDataTypePrioritySystem; type=\"video/msvideo\"; }, " \ -" DATATYPE { priority=EDataTypePrioritySystem; type=\"application/x-msvideo\"; }, " \ -" DATATYPE { priority=EDataTypePrioritySystem; type=\"video/x-pn-realvideo\"; }, " \ -" DATATYPE { priority=EDataTypePrioritySystem; type=\"audio/x-pn-realaudio\"; }, " \ -" DATATYPE { priority=EDataTypePrioritySystem; type=\"video/vnd.rn-realvideo\"; }, " \ -" DATATYPE { priority=EDataTypePrioritySystem; type=\"application/vnd.rn-realmedia\"; }, " \ -" DATATYPE { priority=EDataTypePrioritySystem; type=\"application/x-pn-realmedia\"; }, " \ -" DATATYPE { priority=EDataTypePrioritySystem; type=\"audio/x-pn-realaudio-plugin\"; }, " \ -" DATATYPE { priority=EDataTypePrioritySystem; type=\"video/x-matroska\"; }, " \ -" DATATYPE { priority=EDataTypePrioritySystem; type=\"audio/x-matroska\"; }, " \ -" DATATYPE { priority=EDataTypePriorityHigh; type=\"video/x-ms-wmv\"; }, " \ -" DATATYPE { priority=EDataTypePriorityHigh; type=\"video/x-ms-asf\"; }, " \ -" DATATYPE { priority=EDataTypePriorityHigh; type=\"video/3gp\"; }, " \ -" DATATYPE { priority=EDataTypePriorityHigh; type=\"video/3gpp2\"; }, " \ -" DATATYPE { priority=EDataTypePriorityHigh; type=\"video/3gpp\"; }, " \ -" DATATYPE { priority=EDataTypePriorityHigh; type=\"video/mp4\"; }, " \ -" DATATYPE { priority=EDataTypePriorityHigh; type=\"video/x-m4v\"; }, " \ -" DATATYPE { priority=EDataTypePriorityHigh; type=\"video/mpeg4\"; }, " \ -" DATATYPE { priority=EDataTypePriorityHigh; type=\"application/ram\"; }, " \ -" DATATYPE { priority=EDataTypePriorityHigh; type=\"application/sdp\"; } " \ -" }; " \ diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayerapp/hbvideoplayer/resources/service_conf.xml --- a/videoplayerapp/hbvideoplayer/resources/service_conf.xml Tue May 18 11:57:40 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ - - - com.nokia.Videos - No path - Video services - - IVideoFetch - 1.0 - Interface to fetch video URI - - - IVideoView - 1.0 - Interface to play a video - - - com.nokia.symbian.IFileView - 1.0 - Interface for playing video given a QFile - - - IVideoBrowse - 1.0 - Interface to browse categorized video content - - diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayerapp/hbvideoplayer/rom/hbvideoplayer.iby --- a/videoplayerapp/hbvideoplayer/rom/hbvideoplayer.iby Tue May 18 11:57:40 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "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: hbvideoplayer.iby -* -*/ - - -#ifndef __HBVIDEOPLAYER_IBY__ -#define __HBVIDEOPLAYER_IBY__ - -#include -#include - -S60_APP_EXE(videoplayer) -data=DATAZ_/PRIVATE/10003A3F/import/APPS/videoplayer_reg.rsc private/10003a3f/import/apps/videoplayer_reg.rsc -data=DATAZ_\install\videoplayer_stub.sis system\install\videoplayer_stub.sis - -#endif // __HBVIDEOPLAYER_IBY__ diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayerapp/hbvideoplayer/rom/hbvideoplayerresources.iby --- a/videoplayerapp/hbvideoplayer/rom/hbvideoplayerresources.iby Tue May 18 11:57:40 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "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: hbvideoplayerresources.iby -* -*/ - - -#ifndef __HBVIDEOPLAYERRESOURCES_IBY__ -#define __HBVIDEOPLAYERRESOURCES_IBY__ - -#include -#include - -S60_APP_RESOURCE(videoplayer) - -data=DATAZ_\QT_TRANSLATIONS_DIR\videos.qm QT_TRANSLATIONS_DIR\videos.qm - -#endif // __HBVIDEOPLAYERRESOURCES_IBY__ diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayerapp/hbvideoplayer/sis/create_videoplayer_udeb_sisx.bat --- a/videoplayerapp/hbvideoplayer/sis/create_videoplayer_udeb_sisx.bat Tue May 18 11:57:40 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -rem -rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -rem All rights reserved. -rem This component and the accompanying materials are made available -rem under the terms of "Eclipse Public License v1.0" -rem which accompanies this distribution, and is available -rem at the URL "http://www.eclipse.org/legal/epl-v10.html". -rem -rem Initial Contributors: -rem Nokia Corporation - initial contribution. -rem -rem Contributors: -rem -rem Description: -rem - -REM Make qt videoplayer udeb sisx file (contains hb -libraries) - -call makesis videoplayer_udeb.pkg videoplayer_udeb.sis -call signsis videoplayer_udeb.sis videoplayer_udeb.sisx Nokia_RnDCert_02.der Nokia_RnDCert_02.key -call del videoplayer_udeb.sis diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayerapp/hbvideoplayer/sis/create_videoplayer_urel_sisx.bat --- a/videoplayerapp/hbvideoplayer/sis/create_videoplayer_urel_sisx.bat Tue May 18 11:57:40 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -rem -rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -rem All rights reserved. -rem This component and the accompanying materials are made available -rem under the terms of "Eclipse Public License v1.0" -rem which accompanies this distribution, and is available -rem at the URL "http://www.eclipse.org/legal/epl-v10.html". -rem -rem Initial Contributors: -rem Nokia Corporation - initial contribution. -rem -rem Contributors: -rem -rem Description: -rem - -REM Make qt videoplayer urel sisx file (contains hb -libraries) - -call makesis videoplayer_urel.pkg videoplayer_urel.sis -call signsis videoplayer_urel.sis videoplayer_urel.sisx Nokia_RnDCert_02.der Nokia_RnDCert_02.key -call del videoplayer_urel.sis diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayerapp/hbvideoplayer/sis/videoplayer_stub.pkg --- a/videoplayerapp/hbvideoplayer/sis/videoplayer_stub.pkg Tue May 18 11:57:40 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -; -; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -; All rights reserved. -; This component and the accompanying materials are made available -; under the terms of "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: -; - -; Language -&EN - -; SIS header: name, uid, version -# {"videoplayer"}, (0x200211FE), 1, 0, 0, TYPE=SA - -; Localised Vendor name -%{"Nokia, Qt Software"} - -; Unique Vendor name -:"Nokia, Qt Software" - -; -; Collection Plugin -; -"" - "z:\sys\bin\vcxmyvideoscollectionplugin.dll" -"" - "z:\resource\plugins\vcxmyvideoscollectionplugin.r*" - -; -; Playback Plugin -; -"" - "z:\sys\bin\mpxvideohelixplayback.dll" -"" - "z:\resource\plugins\mpxvideohelixplayback.r*" - -; -; Video playback view -; -"" - "z:\sys\bin\hbvideoplaybackview.dll" -"" - "z:\sys\bin\hbvideoplaybackviewplugin.dll" -"" - "z:\resource\plugins\hbvideoplaybackviewplugin.r*" - -; -; Collection view and wrapper -; -"" - "z:\sys\bin\videocollectionview.dll" -"" - "z:\resource\plugins\videocollectionview.r*" -"" - "z:\sys\bin\videocollectionwrapper.dll" -"" - "z:\sys\bin\videofiledetailsview.dll" -"" - "z:\resource\plugins\videofiledetailsview.r*" - -; -; Executable and default resource files -; -"" - "z:\sys\bin\videoplayerengine.dll" -"" - "z:\sys\bin\videoplayer.exe" -"" - "z:\resource\apps\videoplayer.r*" -"" - "z:\private\10003a3f\import\apps\videoplayer_reg.r*" -"" - "z:\resource\qt\translations\videos.qm" - - diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayerapp/hbvideoplayer/sis/videoplayer_stub.sis Binary file videoplayerapp/hbvideoplayer/sis/videoplayer_stub.sis has changed diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayerapp/hbvideoplayer/sis/videoplayer_udeb.pkg --- a/videoplayerapp/hbvideoplayer/sis/videoplayer_udeb.pkg Tue May 18 11:57:40 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -; -; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -; All rights reserved. -; This component and the accompanying materials are made available -; under the terms of "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: -; - -; Language -&EN - -; SIS header: name, uid, version -#{"videoplayer"},(0x200211FE),1,0,0,TYPE=SA, RU - -; Localised Vendor name -%{"Nokia, Qt Software"} - -; Unique Vendor name -:"Nokia, Qt Software" - -; Dependencies -[0x101F7961],0,0,0,{"S60ProductID"} -[0x102032BE],0,0,0,{"S60ProductID"} -[0x102752AE],0,0,0,{"S60ProductID"} -[0x1028315F],0,0,0,{"S60ProductID"} -(0x2001E61C),4,6,0,{"QtLibs pre-release"} - -; -; Collection Plugin -; -"/epoc32/release/armv5/udeb/vcxmyvideoscollectionplugin.dll" - "!:/sys/bin/vcxmyvideoscollectionplugin.dll" -"/epoc32/data/z/resource/plugins/vcxmyvideoscollectionplugin.rsc" - "!:/resource/plugins/vcxmyvideoscollectionplugin.rsc" - -; -; Playback Plugin -; -"/epoc32/release/armv5/udeb/mpxvideohelixplayback.dll" - "!:/sys/bin/mpxvideohelixplayback.dll" -"/epoc32/data/z/resource/plugins/mpxvideohelixplayback.rsc" - "!:/resource/plugins/mpxvideohelixplayback.rsc" - -; Collection view and wrapper -"/epoc32/release/armv5/udeb/videocollectionview.dll" - "!:/sys/bin/videocollectionview.dll" -"/epoc32/data/z/resource/plugins/videocollectionview.rsc" - "!:/resource/plugins/videocollectionview.rsc" -"/epoc32/release/armv5/udeb/videocollectionwrapper.dll" - "!:/sys/bin/videocollectionwrapper.dll" -"/epoc32/data/z/resource/plugins/videofiledetailsview.rsc" - "!:/resource/plugins/videofiledetailsview.rsc" -"/epoc32/release/armv5/udeb/videofiledetailsview.dll" - "!:/sys/bin/videofiledetailsview.dll" - -; Executable and default resource files -"/epoc32/release/armv5/udeb/videoplayerengine.dll" - "!:/sys/bin/videoplayerengine.dll" -"/epoc32/release/armv5/udeb/videoplayer.exe" - "!:/sys/bin/videoplayer.exe" -"/epoc32/data/z/resource/apps/videoplayer.rsc" - "!:/resource/apps/videoplayer.rsc" -"/epoc32/data/z/private/10003a3f/import/apps/videoplayer_reg.rsc" - "!:/private/10003a3f/import/apps/videoplayer_reg.rsc" -"/epoc32/data/z/resource/qt/translations/videos_en.qm" - "!:/resource/qt/translations/videos.qm" - -"/epoc32/data/z/resource/plugins/hbvideoplaybackviewplugin.rsc" - "!:/resource/plugins/hbvideoplaybackviewplugin.rsc" -"/epoc32/release/armv5/udeb/hbvideoplaybackview.dll" - "!:/sys/bin/hbvideoplaybackview.dll" -"/epoc32/release/armv5/udeb/hbvideoplaybackviewplugin.dll" - "!:/sys/bin/hbvideoplaybackviewplugin.dll" diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayerapp/hbvideoplayer/sis/videoplayer_urel.pkg --- a/videoplayerapp/hbvideoplayer/sis/videoplayer_urel.pkg Tue May 18 11:57:40 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -; -; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -; All rights reserved. -; This component and the accompanying materials are made available -; under the terms of "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: -; - -; Language -&EN - -; SIS header: name, uid, version -#{"videoplayer"},(0x200211FE),1,0,0,TYPE=SA, RU - -; Localised Vendor name -%{"Nokia, Qt Software"} - -; Unique Vendor name -:"Nokia, Qt Software" - -; Dependencies -[0x101F7961],0,0,0,{"S60ProductID"} -[0x102032BE],0,0,0,{"S60ProductID"} -[0x102752AE],0,0,0,{"S60ProductID"} -[0x1028315F],0,0,0,{"S60ProductID"} -(0x2001E61C),4,6,0,{"QtLibs pre-release"} - -; -; Collection Plugin -; -"/epoc32/release/armv5/urel/vcxmyvideoscollectionplugin.dll" - "!:/sys/bin/vcxmyvideoscollectionplugin.dll" -"/epoc32/data/z/resource/plugins/vcxmyvideoscollectionplugin.rsc" - "!:/resource/plugins/vcxmyvideoscollectionplugin.rsc" - -; -; Playback Plugin -; -"/epoc32/release/armv5/urel/mpxvideohelixplayback.dll" - "!:/sys/bin/mpxvideohelixplayback.dll" -"/epoc32/data/z/resource/plugins/mpxvideohelixplayback.rsc" - "!:/resource/plugins/mpxvideohelixplayback.rsc" - -; Collection view and wrapper -"/epoc32/release/armv5/urel/videocollectionview.dll" - "!:/sys/bin/videocollectionview.dll" -"/epoc32/data/z/resource/plugins/videocollectionview.rsc" - "!:/resource/plugins/videocollectionview.rsc" -"/epoc32/release/armv5/urel/videocollectionwrapper.dll" - "!:/sys/bin/videocollectionwrapper.dll" -"/epoc32/data/z/resource/plugins/videofiledetailsview.rsc" - "!:/resource/plugins/videofiledetailsview.rsc" -"/epoc32/release/armv5/urel/videofiledetailsview.dll" - "!:/sys/bin/videofiledetailsview.dll" - -; Executable and default resource files -"/epoc32/release/armv5/urel/videoplayerengine.dll" - "!:/sys/bin/videoplayerengine.dll" -"/epoc32/release/armv5/urel/videoplayer.exe" - "!:/sys/bin/videoplayer.exe" -"/epoc32/data/z/resource/apps/videoplayer.rsc" - "!:/resource/apps/videoplayer.rsc" -"/epoc32/data/z/private/10003a3f/import/apps/videoplayer_reg.rsc" - "!:/private/10003a3f/import/apps/videoplayer_reg.rsc" -"/epoc32/data/z/resource/qt/translations/videos_en.qm" - "!:/resource/qt/translations/videos.qm" - -"/epoc32/data/z/resource/plugins/hbvideoplaybackviewplugin.rsc" - "!:/resource/plugins/hbvideoplaybackviewplugin.rsc" -"/epoc32/release/armv5/urel/hbvideoplaybackview.dll" - "!:/sys/bin/hbvideoplaybackview.dll" -"/epoc32/release/armv5/urel/hbvideoplaybackviewplugin.dll" - "!:/sys/bin/hbvideoplaybackviewplugin.dll" diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayerapp/hbvideoplayer/src/main.cpp --- a/videoplayerapp/hbvideoplayer/src/main.cpp Tue May 18 11:57:40 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "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: Implementation of main.cpp -* -*/ - -// Version : %version: 9 % - - -#include -#include -#include -#include -#include -#include - -#include "videoplayerengine.h" - -int main(int argc, char *argv[]) -{ - HbApplication app(argc, argv); - - // Load the translation file. - QString lang = QLocale::system().name(); - - QTranslator translator; - - bool loaded(false); - - loaded = translator.load( "videos_" + lang, QString("c:/resource/qt/translations") ); - - if (!loaded) - { - translator.load("videos_" + lang, QString("z:/resource/qt/translations") ); - } - - // Install the translator - app.installTranslator(&translator); - - // has the application been launched via XQ Service Framework - bool isService = XQServiceUtil::isService(); - - if (!isService) - { - app.setApplicationName(hbTrId("txt_videos_title_videos")); - } - - HbMainWindow mainWindow( 0, Hb::WindowFlagTransparent ); - mainWindow.setAttribute( Qt::WA_OpaquePaintEvent ); - - QVideoPlayerEngine *engine = new QVideoPlayerEngine(isService); - engine->initialize(); - mainWindow.show(); - return app.exec(); -} diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayerapp/inc/videoplayerengine.h --- a/videoplayerapp/inc/videoplayerengine.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayerapp/inc/videoplayerengine.h Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 12 % +// Version : %version: 14 % #ifndef VIDEOPLAYERENGINE_H #define VIDEOPLAYERENGINE_H @@ -80,11 +80,18 @@ void createPlayAndDetailsViews(); void setCurrentView(); + + bool isPlayServiceInvoked(); + + bool shouldExit(); + + bool shouldActivateCollectionView(); private: bool mIsService; bool mEmbedded; bool mDelayedLoadDone; + bool mIsPlayService; MpxViewPlugin* mCurrentViewPlugin; MpxViewPlugin* mPlaybackViewPlugin; diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayerapp/videoplayer/resources/service_conf.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videoplayerapp/videoplayer/resources/service_conf.xml Wed Jun 23 17:22:59 2010 +0100 @@ -0,0 +1,44 @@ + + + videoplayer + No path + Video services + + IVideoFetch + 1.0 + Interface to fetch video URI + Video Fetcher + + + com.nokia.symbian.IVideoFetch + 1.0 + Interface to fetch video URI + + + IVideoBrowse + 1.0 + Interface to browse categorized video content + Video Browse + + + com.nokia.symbian.IVideoBrowse + 1.0 + Interface to browse categorized video content + + + IVideoView + 1.0 + Interface to play a video + Video View + + + com.nokia.symbian.IVideoView + 1.0 + Interface to play a video + + + com.nokia.symbian.IFileView + 1.0 + Interface for playing video given a QFile + + \ No newline at end of file diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayerapp/videoplayer/rom/videoplayer.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videoplayerapp/videoplayer/rom/videoplayer.iby Wed Jun 23 17:22:59 2010 +0100 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "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: videoplayer.iby +* +*/ + + +#ifndef __VIDEOPLAYER_IBY__ +#define __VIDEOPLAYER_IBY__ + +#include +#include + +S60_APP_EXE(videoplayer) +data=DATAZ_/PRIVATE/10003A3F/import/APPS/videoplayer_reg.rsc private/10003a3f/import/apps/videoplayer_reg.rsc +data=DATAZ_\install\videoplayer_stub.sis system\install\videoplayer_stub.sis + +#endif // __VIDEOPLAYER_IBY__ diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayerapp/videoplayer/rom/videoplayerresources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videoplayerapp/videoplayer/rom/videoplayerresources.iby Wed Jun 23 17:22:59 2010 +0100 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "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: videoplayerresources.iby +* +*/ + + +#ifndef __VIDEOPLAYERRESOURCES_IBY__ +#define __VIDEOPLAYERRESOURCES_IBY__ + +#include +#include + +S60_APP_RESOURCE(videoplayer) + +data=DATAZ_\QT_TRANSLATIONS_DIR\videos.qm QT_TRANSLATIONS_DIR\videos.qm + +#endif // __VIDEOPLAYERRESOURCES_IBY__ diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayerapp/videoplayer/sis/create_videoplayer_udeb_sisx.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videoplayerapp/videoplayer/sis/create_videoplayer_udeb_sisx.bat Wed Jun 23 17:22:59 2010 +0100 @@ -0,0 +1,21 @@ +rem +rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of "Eclipse Public License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +rem Description: +rem + +REM Make qt videoplayer udeb sisx file (contains hb -libraries) + +call makesis videoplayer_udeb.pkg videoplayer_udeb.sis +call signsis videoplayer_udeb.sis videoplayer_udeb.sisx Nokia_RnDCert_02.der Nokia_RnDCert_02.key +call del videoplayer_udeb.sis diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayerapp/videoplayer/sis/create_videoplayer_urel_sisx.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videoplayerapp/videoplayer/sis/create_videoplayer_urel_sisx.bat Wed Jun 23 17:22:59 2010 +0100 @@ -0,0 +1,21 @@ +rem +rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of "Eclipse Public License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +rem Description: +rem + +REM Make qt videoplayer urel sisx file (contains hb -libraries) + +call makesis videoplayer_urel.pkg videoplayer_urel.sis +call signsis videoplayer_urel.sis videoplayer_urel.sisx Nokia_RnDCert_02.der Nokia_RnDCert_02.key +call del videoplayer_urel.sis diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayerapp/videoplayer/sis/videoplayer_stub.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videoplayerapp/videoplayer/sis/videoplayer_stub.pkg Wed Jun 23 17:22:59 2010 +0100 @@ -0,0 +1,66 @@ +; +; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "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: +; + +; Language +&EN + +; SIS header: name, uid, version +# {"videoplayer"}, (0x200211FE), 1, 0, 0, TYPE=SA + +; Localised Vendor name +%{"Nokia, Qt Software"} + +; Unique Vendor name +:"Nokia, Qt Software" + +; +; Collection Plugin +; +"" - "z:\sys\bin\vcxmyvideoscollectionplugin.dll" +"" - "z:\resource\plugins\vcxmyvideoscollectionplugin.r*" + +; +; Playback Plugin +; +"" - "z:\sys\bin\mpxvideohelixplayback.dll" +"" - "z:\resource\plugins\mpxvideohelixplayback.r*" + +; +; Video playback view +; +"" - "z:\sys\bin\hbvideoplaybackview.dll" +"" - "z:\sys\bin\hbvideoplaybackviewplugin.dll" +"" - "z:\resource\plugins\hbvideoplaybackviewplugin.r*" + +; +; Collection view and wrapper +; +"" - "z:\sys\bin\videocollectionview.dll" +"" - "z:\resource\plugins\videocollectionview.r*" +"" - "z:\sys\bin\videocollectionwrapper.dll" +"" - "z:\sys\bin\videofiledetailsview.dll" +"" - "z:\resource\plugins\videofiledetailsview.r*" + +; +; Executable and default resource files +; +"" - "z:\sys\bin\videoplayerengine.dll" +"" - "z:\sys\bin\videoplayer.exe" +"" - "z:\resource\apps\videoplayer.r*" +"" - "z:\private\10003a3f\import\apps\videoplayer_reg.r*" +"" - "z:\resource\qt\translations\videos.qm" + + diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayerapp/videoplayer/sis/videoplayer_stub.sis Binary file videoplayerapp/videoplayer/sis/videoplayer_stub.sis has changed diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayerapp/videoplayer/sis/videoplayer_udeb.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videoplayerapp/videoplayer/sis/videoplayer_udeb.pkg Wed Jun 23 17:22:59 2010 +0100 @@ -0,0 +1,64 @@ +; +; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "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: +; + +; Language +&EN + +; SIS header: name, uid, version +#{"videoplayer"},(0x200211FE),1,0,0,TYPE=SA, RU + +; Localised Vendor name +%{"Nokia, Qt Software"} + +; Unique Vendor name +:"Nokia, Qt Software" + +; Dependencies +[0x101F7961],0,0,0,{"S60ProductID"} +[0x102032BE],0,0,0,{"S60ProductID"} +[0x102752AE],0,0,0,{"S60ProductID"} +[0x1028315F],0,0,0,{"S60ProductID"} +(0x2001E61C),4,6,0,{"QtLibs pre-release"} + +; +; Collection Plugin +; +"/epoc32/release/armv5/udeb/vcxmyvideoscollectionplugin.dll" - "!:/sys/bin/vcxmyvideoscollectionplugin.dll" +"/epoc32/data/z/resource/plugins/vcxmyvideoscollectionplugin.rsc" - "!:/resource/plugins/vcxmyvideoscollectionplugin.rsc" + +; +; Playback Plugin +; +"/epoc32/release/armv5/udeb/mpxvideohelixplayback.dll" - "!:/sys/bin/mpxvideohelixplayback.dll" +"/epoc32/data/z/resource/plugins/mpxvideohelixplayback.rsc" - "!:/resource/plugins/mpxvideohelixplayback.rsc" + +; Collection view and wrapper +"/epoc32/release/armv5/udeb/videocollectionview.dll" - "!:/sys/bin/videocollectionview.dll" +"/epoc32/data/z/resource/plugins/videocollectionview.rsc" - "!:/resource/plugins/videocollectionview.rsc" +"/epoc32/release/armv5/udeb/videocollectionwrapper.dll" - "!:/sys/bin/videocollectionwrapper.dll" +"/epoc32/data/z/resource/plugins/videofiledetailsview.rsc" - "!:/resource/plugins/videofiledetailsview.rsc" +"/epoc32/release/armv5/udeb/videofiledetailsview.dll" - "!:/sys/bin/videofiledetailsview.dll" + +; Executable and default resource files +"/epoc32/release/armv5/udeb/videoplayerengine.dll" - "!:/sys/bin/videoplayerengine.dll" +"/epoc32/release/armv5/udeb/videoplayer.exe" - "!:/sys/bin/videoplayer.exe" +"/epoc32/data/z/resource/apps/videoplayer.rsc" - "!:/resource/apps/videoplayer.rsc" +"/epoc32/data/z/private/10003a3f/import/apps/videoplayer_reg.rsc" - "!:/private/10003a3f/import/apps/videoplayer_reg.rsc" +"/epoc32/data/z/resource/qt/translations/videos_en.qm" - "!:/resource/qt/translations/videos.qm" + +"/epoc32/data/z/resource/plugins/hbvideoplaybackviewplugin.rsc" - "!:/resource/plugins/hbvideoplaybackviewplugin.rsc" +"/epoc32/release/armv5/udeb/hbvideoplaybackview.dll" - "!:/sys/bin/hbvideoplaybackview.dll" +"/epoc32/release/armv5/udeb/hbvideoplaybackviewplugin.dll" - "!:/sys/bin/hbvideoplaybackviewplugin.dll" diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayerapp/videoplayer/sis/videoplayer_urel.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videoplayerapp/videoplayer/sis/videoplayer_urel.pkg Wed Jun 23 17:22:59 2010 +0100 @@ -0,0 +1,64 @@ +; +; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "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: +; + +; Language +&EN + +; SIS header: name, uid, version +#{"videoplayer"},(0x200211FE),1,0,0,TYPE=SA, RU + +; Localised Vendor name +%{"Nokia, Qt Software"} + +; Unique Vendor name +:"Nokia, Qt Software" + +; Dependencies +[0x101F7961],0,0,0,{"S60ProductID"} +[0x102032BE],0,0,0,{"S60ProductID"} +[0x102752AE],0,0,0,{"S60ProductID"} +[0x1028315F],0,0,0,{"S60ProductID"} +(0x2001E61C),4,6,0,{"QtLibs pre-release"} + +; +; Collection Plugin +; +"/epoc32/release/armv5/urel/vcxmyvideoscollectionplugin.dll" - "!:/sys/bin/vcxmyvideoscollectionplugin.dll" +"/epoc32/data/z/resource/plugins/vcxmyvideoscollectionplugin.rsc" - "!:/resource/plugins/vcxmyvideoscollectionplugin.rsc" + +; +; Playback Plugin +; +"/epoc32/release/armv5/urel/mpxvideohelixplayback.dll" - "!:/sys/bin/mpxvideohelixplayback.dll" +"/epoc32/data/z/resource/plugins/mpxvideohelixplayback.rsc" - "!:/resource/plugins/mpxvideohelixplayback.rsc" + +; Collection view and wrapper +"/epoc32/release/armv5/urel/videocollectionview.dll" - "!:/sys/bin/videocollectionview.dll" +"/epoc32/data/z/resource/plugins/videocollectionview.rsc" - "!:/resource/plugins/videocollectionview.rsc" +"/epoc32/release/armv5/urel/videocollectionwrapper.dll" - "!:/sys/bin/videocollectionwrapper.dll" +"/epoc32/data/z/resource/plugins/videofiledetailsview.rsc" - "!:/resource/plugins/videofiledetailsview.rsc" +"/epoc32/release/armv5/urel/videofiledetailsview.dll" - "!:/sys/bin/videofiledetailsview.dll" + +; Executable and default resource files +"/epoc32/release/armv5/urel/videoplayerengine.dll" - "!:/sys/bin/videoplayerengine.dll" +"/epoc32/release/armv5/urel/videoplayer.exe" - "!:/sys/bin/videoplayer.exe" +"/epoc32/data/z/resource/apps/videoplayer.rsc" - "!:/resource/apps/videoplayer.rsc" +"/epoc32/data/z/private/10003a3f/import/apps/videoplayer_reg.rsc" - "!:/private/10003a3f/import/apps/videoplayer_reg.rsc" +"/epoc32/data/z/resource/qt/translations/videos_en.qm" - "!:/resource/qt/translations/videos.qm" + +"/epoc32/data/z/resource/plugins/hbvideoplaybackviewplugin.rsc" - "!:/resource/plugins/hbvideoplaybackviewplugin.rsc" +"/epoc32/release/armv5/urel/hbvideoplaybackview.dll" - "!:/sys/bin/hbvideoplaybackview.dll" +"/epoc32/release/armv5/urel/hbvideoplaybackviewplugin.dll" - "!:/sys/bin/hbvideoplaybackviewplugin.dll" diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayerapp/videoplayer/src/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videoplayerapp/videoplayer/src/main.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -0,0 +1,80 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "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: Implementation of main.cpp +* +*/ + +// Version : %version: 1 % + + +#include +#include +#include +#include +#include +#include + +#include "videoplayerengine.h" + +int main(int argc, char *argv[]) +{ + HbApplication app(argc, argv); + + // Load the translation file. + QString lang = QLocale::system().name(); + + QTranslator translator; + + bool loaded(false); + + loaded = translator.load( "videos_" + lang, QString("c:/resource/qt/translations") ); + + if (!loaded) + { + translator.load("videos_" + lang, QString("z:/resource/qt/translations") ); + } + + // Install the translator + app.installTranslator(&translator); + + QTranslator translatorCommon; + + loaded = false; + + loaded = translatorCommon.load( "common_" + lang, QString("c:/resource/qt/translations") ); + + if (!loaded) + { + translatorCommon.load("common_" + lang, QString("z:/resource/qt/translations") ); + } + + // Install the common translator + app.installTranslator(&translatorCommon); + + // has the application been launched via XQ Service Framework + bool isService = XQServiceUtil::isService(); + + if (!isService) + { + app.setApplicationName(hbTrId("txt_videos_title_videos")); + } + + HbMainWindow mainWindow( 0, Hb::WindowFlagTransparent ); + mainWindow.setAttribute( Qt::WA_OpaquePaintEvent ); + + QVideoPlayerEngine *engine = new QVideoPlayerEngine(isService); + engine->initialize(); + mainWindow.show(); + return app.exec(); +} diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayerapp/videoplayer/videoplayer.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videoplayerapp/videoplayer/videoplayer.pro Wed Jun 23 17:22:59 2010 +0100 @@ -0,0 +1,78 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "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: Project file for building Videoplayer components +# +# +# Version : %version: 1 % + + +TARGET = videoplayer +CONFIG += hb service +TEMPLATE = app +TRANSLATIONS += videos.ts + +symbian: +{ + TARGET.CAPABILITY = ALL -DRM -TCB + TARGET.EPOCHEAPSIZE = 0x20000 0x1600000 + TARGET.UID3 = 0x200211FE + SKINICON = qtg_large_video_tv.svg + + BLD_INF_RULES.prj_exports += "rom/videoplayer.iby CORE_APP_LAYER_IBY_EXPORT_PATH(videoplayer.iby)" \ + "rom/videoplayerresources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(videoplayerresources.iby)" \ + "sis/videoplayer_stub.sis /epoc32/data/z/system/install/videoplayer_stub.sis" +} + +# Service provider specific configuration. +SERVICE.FILE = resources/service_conf.xml +SERVICE.OPTIONS = embeddable +# Service provider specific configuration ends + +INCLUDEPATH += . +INCLUDEPATH += ../inc \ + ../../inc \ + /epoc32/include/mw/hb/hbtools + +LIBS += -lvideoplayerengine.dll \ + -lxqservice.dll \ + -lxqserviceutil.dll + +VPATH += src + +SOURCES += main.cpp + +RSS_RULES += \ +" datatype_list = " \ +" { " \ +" DATATYPE { priority=EDataTypePrioritySystem; type=\"video/avi\"; }, " \ +" DATATYPE { priority=EDataTypePrioritySystem; type=\"video/msvideo\"; }, " \ +" DATATYPE { priority=EDataTypePrioritySystem; type=\"application/x-msvideo\"; }, " \ +" DATATYPE { priority=EDataTypePrioritySystem; type=\"video/x-pn-realvideo\"; }, " \ +" DATATYPE { priority=EDataTypePrioritySystem; type=\"audio/x-pn-realaudio\"; }, " \ +" DATATYPE { priority=EDataTypePrioritySystem; type=\"video/vnd.rn-realvideo\"; }, " \ +" DATATYPE { priority=EDataTypePrioritySystem; type=\"application/vnd.rn-realmedia\"; }, " \ +" DATATYPE { priority=EDataTypePrioritySystem; type=\"application/x-pn-realmedia\"; }, " \ +" DATATYPE { priority=EDataTypePrioritySystem; type=\"audio/x-pn-realaudio-plugin\"; }, " \ +" DATATYPE { priority=EDataTypePrioritySystem; type=\"video/x-matroska\"; }, " \ +" DATATYPE { priority=EDataTypePriorityHigh; type=\"video/x-ms-wmv\"; }, " \ +" DATATYPE { priority=EDataTypePriorityHigh; type=\"video/x-ms-asf\"; }, " \ +" DATATYPE { priority=EDataTypePriorityHigh; type=\"video/3gp\"; }, " \ +" DATATYPE { priority=EDataTypePriorityHigh; type=\"video/3gpp2\"; }, " \ +" DATATYPE { priority=EDataTypePriorityHigh; type=\"video/3gpp\"; }, " \ +" DATATYPE { priority=EDataTypePriorityHigh; type=\"video/mp4\"; }, " \ +" DATATYPE { priority=EDataTypePriorityHigh; type=\"video/x-m4v\"; }, " \ +" DATATYPE { priority=EDataTypePriorityHigh; type=\"video/mpeg4\"; }, " \ +" DATATYPE { priority=EDataTypePriorityHigh; type=\"application/ram\"; }, " \ +" DATATYPE { priority=EDataTypePriorityHigh; type=\"application/sdp\"; } " \ +" }; " \ diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayerapp/videoplayerapp.pro --- a/videoplayerapp/videoplayerapp.pro Tue May 18 11:57:40 2010 +0100 +++ b/videoplayerapp/videoplayerapp.pro Wed Jun 23 17:22:59 2010 +0100 @@ -14,10 +14,10 @@ # Description: Project file for building Videoplayer components # # -# Version : %version: 4 % +# Version : %version: 5 % TEMPLATE = subdirs CONFIG += ordered SUBDIRS += videoplayerengine \ - hbvideoplayer + videoplayer diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayerapp/videoplayerengine/inc/videoservicebrowse.h --- a/videoplayerapp/videoplayerengine/inc/videoservicebrowse.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayerapp/videoplayerengine/inc/videoservicebrowse.h Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 3 % +// Version : %version: 4 % #ifndef VIDEOSERVICEBROWSE_H #define VIDEOSERVICEBROWSE_H @@ -25,13 +25,14 @@ // FORWARD DECLARATIONS class VideoServices; +class QLatin1String; class VideoServiceBrowse : public XQServiceProvider { Q_OBJECT public: - VideoServiceBrowse( VideoServices *parent = 0 ); + VideoServiceBrowse( VideoServices *parent, QLatin1String service ); ~VideoServiceBrowse(); public: @@ -68,6 +69,14 @@ */ int sortRole() const; + /** + * Returns service active status + * + * @return bool true if active, false if not active + * + */ + bool isActive(); + public slots: /** @@ -80,6 +89,15 @@ */ void browseVideos(const QString &title, int category, int sortRole); + /** + * Browse video + * + * @param category, Category which type of videos are browsed + * @param sort, Sort type. + * @return None + */ + void browseVideos(int category, int sortRole); + private: /** request index of the service */ int mRequestIndex; diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayerapp/videoplayerengine/inc/videoserviceplay.h --- a/videoplayerapp/videoplayerengine/inc/videoserviceplay.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayerapp/videoplayerengine/inc/videoserviceplay.h Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: da1mmcf#2 % #ifndef __VIDEOSERVICEPLAY_H__ #define __VIDEOSERVICEPLAY_H__ @@ -26,6 +26,7 @@ // FORWARD DECLARATIONS class VideoServices; class QVideoPlayerEngine; +class QLatin1String; class VideoServicePlay : public XQServiceProvider { @@ -33,7 +34,7 @@ Q_OBJECT public: - VideoServicePlay( VideoServices* parent, QVideoPlayerEngine* engine ); + VideoServicePlay( VideoServices *parent, QVideoPlayerEngine* engine, QLatin1String service ); virtual ~VideoServicePlay(); void setEngine( QVideoPlayerEngine* engine ); diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayerapp/videoplayerengine/inc/videoserviceurifetch.h --- a/videoplayerapp/videoplayerengine/inc/videoserviceurifetch.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayerapp/videoplayerengine/inc/videoserviceurifetch.h Wed Jun 23 17:22:59 2010 +0100 @@ -24,6 +24,7 @@ // FORWARD DECLARATIONS class VideoServices; +class QLatin1String; class VideoServiceUriFetch : public XQServiceProvider { @@ -38,7 +39,7 @@ /** * contructor */ - VideoServiceUriFetch( VideoServices *parent = 0 ); + VideoServiceUriFetch( VideoServices *parent, QLatin1String service ); /** * destructor @@ -73,6 +74,12 @@ /* * Client can use this method launch video URI fetching * + */ + void fetch(); + + /* + * Client can use this method launch video URI fetching + * * @param title title to be set * */ diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayerapp/videoplayerengine/inc/videoserviceview.h --- a/videoplayerapp/videoplayerengine/inc/videoserviceview.h Tue May 18 11:57:40 2010 +0100 +++ b/videoplayerapp/videoplayerengine/inc/videoserviceview.h Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % #ifndef __VIDEOSERVICEVIEW_H__ #define __VIDEOSERVICEVIEW_H__ @@ -28,6 +28,7 @@ class VideoServices; class QVideoPlayerEngine; class QFile; +class QLatin1String; class VideoServiceView : public XQServiceProvider { @@ -35,7 +36,7 @@ Q_OBJECT public: - VideoServiceView( VideoServices* parent, QVideoPlayerEngine* engine ); + VideoServiceView( VideoServices *parent, QVideoPlayerEngine* engine, QLatin1String service ); virtual ~VideoServiceView(); void setEngine( QVideoPlayerEngine* engine ); diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayerapp/videoplayerengine/src/mpxvideoplaybackwrapper.cpp --- a/videoplayerapp/videoplayerengine/src/mpxvideoplaybackwrapper.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayerapp/videoplayerengine/src/mpxvideoplaybackwrapper.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 4 % +// Version : %version: ou1cpsw#5 % #include "mpxvideo_debug.h" @@ -59,6 +59,7 @@ TRAPD( err, mUiEngine = CMpxVideoPlayerAppUiEngine::NewL( this ) ); MPX_DEBUG(_L("QMpxVideoPlaybackWrapper::initializePlugins err = %d"), err); + Q_UNUSED(err); } // ------------------------------------------------------------------------------------------------- diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayerapp/videoplayerengine/src/videoplayerengine.cpp --- a/videoplayerapp/videoplayerengine/src/videoplayerengine.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayerapp/videoplayerengine/src/videoplayerengine.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 27 % +// Version : %version: da1mmcf#31 % #include @@ -39,6 +39,7 @@ : mIsService( isService ) , mEmbedded( false ) , mDelayedLoadDone( false ) + , mIsPlayService( false ) , mCurrentViewPlugin( 0 ) , mPlaybackViewPlugin( 0 ) , mCollectionViewPlugin( 0 ) @@ -120,25 +121,22 @@ QList impls; XQPluginLoader::listImplementations("org.nokia.mmdt.MpxViewPlugin/1.0", impls); - - // - // Pre-load collection plugin and create collection view - // - loadPluginAndCreateView( MpxHbVideoCommon::CollectionView ); - - // - // if app is opened via serviceFW create remaining views - // otherwise activate default view i.e. the collection view. - // - if ( mIsService ) + + if ( isPlayServiceInvoked() ) { createPlayAndDetailsViews(); } else - { - activateView( MpxHbVideoCommon::CollectionView ); + { + loadPluginAndCreateView( MpxHbVideoCommon::CollectionView ); + + if((mIsService && !(XQServiceUtil::interfaceName().contains("IVideoBrowse"))) || !mIsService) + { + //Browse service will activate view once the category to be opened is informed from highway + activateView( MpxHbVideoCommon::CollectionView ); + } } - + } // ------------------------------------------------------------------------------------------------- @@ -224,7 +222,9 @@ loadPluginAndCreateView( MpxHbVideoCommon::PlaybackView ); } - if ( ! mFileDetailsViewPlugin ) + // details view need not be created for playback via serviceFW + if ( ! mIsPlayService && + ! mFileDetailsViewPlugin ) { loadPluginAndCreateView( MpxHbVideoCommon::VideoDetailsView ); } @@ -249,57 +249,52 @@ mCurrentViewPlugin = NULL; } - if ( viewType == MpxHbVideoCommon::CollectionView && mCollectionViewPlugin ) + switch ( viewType ) { - if ( mIsService && - ( mVideoServices->currentService() == VideoServices::EPlayback || - mVideoServices->currentService() == VideoServices::EView || - mVideoServices->currentService() == VideoServices::EUriFetcher ) ) + case MpxHbVideoCommon::CollectionView: { - if ( mVideoServices->currentService() == VideoServices::EUriFetcher ) - { - if ( ! mVideoServices->mFetchSelected ) - { - // - // view is in 'fetch' service but 'attach' operation has not been selected, - // therefore, go back to collection view - // - mCurrentViewPlugin = mCollectionViewPlugin; - setCurrentView(); - } - } - else + if ( shouldExit() ) { qApp->quit(); - XQServiceUtil::toBackground( false ); + XQServiceUtil::toBackground( false ); } - } - else - { - mCurrentViewPlugin = mCollectionViewPlugin; - setCurrentView(); - } - } - else if ( viewType == MpxHbVideoCommon::PlaybackView ) - { - if ( ! mPlaybackViewPlugin ) - { - loadPluginAndCreateView( MpxHbVideoCommon::PlaybackView ); + else if ( shouldActivateCollectionView() ) + { + if ( ! mCollectionViewPlugin ) + { + loadPluginAndCreateView( MpxHbVideoCommon::CollectionView ); + } + mCurrentViewPlugin = mCollectionViewPlugin; + setCurrentView(); + } + + break; } - - mCurrentViewPlugin = mPlaybackViewPlugin; - setCurrentView(); - } - else if ( viewType == MpxHbVideoCommon::VideoDetailsView ) - { - if ( ! mFileDetailsViewPlugin ) - { - loadPluginAndCreateView( MpxHbVideoCommon::VideoDetailsView ); - } - - mCurrentViewPlugin = mFileDetailsViewPlugin; - setCurrentView(); - } + case MpxHbVideoCommon::PlaybackView: + { + if ( ! mPlaybackViewPlugin ) + { + loadPluginAndCreateView( MpxHbVideoCommon::PlaybackView ); + } + + mCurrentViewPlugin = mPlaybackViewPlugin; + setCurrentView(); + + break; + } + case MpxHbVideoCommon::VideoDetailsView: + { + if ( ! mFileDetailsViewPlugin ) + { + loadPluginAndCreateView( MpxHbVideoCommon::VideoDetailsView ); + } + + mCurrentViewPlugin = mFileDetailsViewPlugin; + setCurrentView(); + + break; + } + } } // ------------------------------------------------------------------------------------------------- @@ -492,5 +487,72 @@ } } +// ------------------------------------------------------------------------------------------------- +// isPlayServiceInvoked() +// ------------------------------------------------------------------------------------------------- +// +bool QVideoPlayerEngine::isPlayServiceInvoked() +{ + MPX_ENTER_EXIT(_L("QVideoPlayerEngine::isPlayServiceInvoked()")); + + bool result = false; + + if ( mIsService ) + { + QString intface = XQServiceUtil::interfaceName(); + + if ( intface.contains("IVideoView") || + intface.contains("IFileView") ) + { + result = true; + mIsPlayService = true; + } + } + + return result; +} + +// ------------------------------------------------------------------------------------------------- +// shouldExit() +// ------------------------------------------------------------------------------------------------- +// +bool QVideoPlayerEngine::shouldExit() +{ + bool result = false; + + if ( mIsPlayService ) // play or view service + { + result = true; + } + + MPX_DEBUG(_L("QVideoPlayerEngine::shouldExit() return %d"), result); + + return result; +} + + +// ------------------------------------------------------------------------------------------------- +// shouldActivateCollectionView() +// ------------------------------------------------------------------------------------------------- +// +bool QVideoPlayerEngine::shouldActivateCollectionView() +{ + bool result = true; + + // the only case where collection view should NOT be activated is ... + // if we are in service and that service is fetch and if fetch is selected + // in all other cases collection view should be activated + + if ( mIsService && + mVideoServices->currentService() == VideoServices::EUriFetcher && + mVideoServices->mFetchSelected ) + { + result = false; + } + + MPX_DEBUG(_L("QVideoPlayerEngine::shouldActivateCollectionView() return %d"), result); + + return result; +} // End of file diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayerapp/videoplayerengine/src/videoservicebrowse.cpp --- a/videoplayerapp/videoplayerengine/src/videoservicebrowse.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayerapp/videoplayerengine/src/videoservicebrowse.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 3 % +// Version : %version: 4 % #include @@ -23,13 +23,14 @@ #include "videoservicebrowse.h" #include "mpxhbvideocommondefs.h" #include "mpxvideo_debug.h" +#include // ------------------------------------------------------------------------------------------------- // VideoServiceBrowse() // ------------------------------------------------------------------------------------------------- // -VideoServiceBrowse::VideoServiceBrowse( VideoServices* parent ) - : XQServiceProvider( QLatin1String("com.nokia.Videos.IVideoBrowse"), parent ) +VideoServiceBrowse::VideoServiceBrowse(VideoServices* parent, QLatin1String service) + : XQServiceProvider( service, parent ) , mRequestIndex( 0 ) , mServiceApp( parent ) , mCategory( 0 ) @@ -128,14 +129,67 @@ mCategory = category; mSortRole = sortRole; + // store async request id + mRequestIndex = setCurrentRequestAsync(); + // start service mServiceApp->setCurrentService(VideoServices::EBrowse); emit mServiceApp->titleReady(appTitle); emit mServiceApp->activated(MpxHbVideoCommon::ActivateCollectionView); - // store async request id - mRequestIndex = setCurrentRequestAsync(); MPX_DEBUG(_L("VideoServiceBrowse::browseVideos() : mRequestIndex = %d"), mRequestIndex ); } +// ---------------------------------------------------------------------------- +// isActive() +// ---------------------------------------------------------------------------- +// +bool VideoServiceBrowse::isActive() +{ + MPX_DEBUG(_L("VideoServiceBrowse::isActive() ret %d"), mRequestIndex ); + + return (mRequestIndex > 0); +} + +// ------------------------------------------------------------------------------------------------- +// browseVideos() +// ------------------------------------------------------------------------------------------------- +// +void VideoServiceBrowse::browseVideos(int category, int sortRole) +{ + MPX_ENTER_EXIT(_L("VideoServiceBrowse::browseVideos()")); + + // set application title + XQRequestInfo info = requestInfo(); + + QVariant variant = info.info("WindowTitle"); + + QString appTitle; + + if(variant.isValid()) + { + appTitle = variant.toString(); + } + + if (appTitle.isEmpty()) + { + appTitle = hbTrId("txt_videos_title_videos"); + } + + mTitle = appTitle; + mCategory = category; + mSortRole = sortRole; + + // store async request id + mRequestIndex = setCurrentRequestAsync(); + + // start service + mServiceApp->setCurrentService(VideoServices::EBrowse); + emit mServiceApp->titleReady(appTitle); + emit mServiceApp->activated(MpxHbVideoCommon::ActivateCollectionView); + + MPX_DEBUG(_L("VideoServiceBrowse::browseVideos() : mRequestIndex = %d"), mRequestIndex ); +} + + // End of file diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayerapp/videoplayerengine/src/videoserviceplay.cpp --- a/videoplayerapp/videoplayerengine/src/videoserviceplay.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayerapp/videoplayerengine/src/videoserviceplay.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: % +// Version : %version: da1mmcf#5 % #include "videoservices.h" #include "videoserviceplay.h" @@ -27,8 +27,10 @@ // VideoServicePlay() // ------------------------------------------------------------------------------------------------- // -VideoServicePlay::VideoServicePlay( VideoServices* parent, QVideoPlayerEngine* engine ) - : XQServiceProvider( QLatin1String("com.nokia.Videos.IVideoView"), parent ) +VideoServicePlay::VideoServicePlay( VideoServices* parent, + QVideoPlayerEngine* engine, + QLatin1String service ) + : XQServiceProvider( service, parent ) , mEngine( engine ) , mServiceApp( parent ) { diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayerapp/videoplayerengine/src/videoservices.cpp --- a/videoplayerapp/videoplayerengine/src/videoservices.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayerapp/videoplayerengine/src/videoservices.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 6 % +// Version : %version: da1mmcf#8 % #include "videoplayerengine.h" #include "videoservices.h" @@ -24,6 +24,8 @@ #include "videoserviceview.h" #include "videoservicebrowse.h" #include "mpxvideo_debug.h" +#include +#include VideoServices *VideoServices::mInstance = 0; @@ -110,11 +112,23 @@ , mFetchSelected( false ) { MPX_ENTER_EXIT(_L("VideoServices::VideoServices()")); + + mServicePlay = new VideoServicePlay(this, engine, QLatin1String("videoplayer.com.nokia.symbian.IVideoView")); //New service, new interface + mServiceView = new VideoServiceView(this, engine, QLatin1String("videoplayer.com.nokia.symbian.IFileView")); //New service, new interface + mServiceUriFetch = new VideoServiceUriFetch(this, QLatin1String("videoplayer.com.nokia.symbian.IVideoFetch")); //New service, new interface + mServiceBrowse = new VideoServiceBrowse( this, QLatin1String("videoplayer.com.nokia.symbian.IVideoBrowse")); //New service, new interface + + mServicePlayDeprecatedNewService = new VideoServicePlay(this, engine, QLatin1String("videoplayer.IVideoView")); //New service, old interface + mServicePlayDeprecatedOldService = new VideoServicePlay(this, engine, QLatin1String("com.nokia.Videos.IVideoView")); //Old service, old interface - mServiceUriFetch = new VideoServiceUriFetch(this); - mServicePlay = new VideoServicePlay(this, engine); - mServiceView = new VideoServiceView(this, engine); - mServiceBrowse = new VideoServiceBrowse(this); + mServiceViewDeprecatedNewService = new VideoServiceView(this, engine, QLatin1String("videoplayer.IFileView")); //New service, old interface + mServiceViewDeprecatedOldService = new VideoServiceView(this, engine, QLatin1String("com.nokia.Videos.IFileView")); //Old service, old interface + + mServiceUriFetchDeprecatedNewService = new VideoServiceUriFetch(this, QLatin1String("videoplayer.IVideoFetch")); //New service, old interface + mServiceUriFetchDeprecatedOldService = new VideoServiceUriFetch(this, QLatin1String("com.nokia.Videos.IVideoFetch")); //Old service, old interface + + mServiceBrowseDeprecatedNewService = new VideoServiceBrowse(this, QLatin1String("videoplayer.IVideoBrowse")); //New service, old interface + mServiceBrowseDeprecatedOldService = new VideoServiceBrowse(this, QLatin1String("com.nokia.Videos.IVideoBrowse")); //Old service, old interface } // ---------------------------------------------------------------------------- @@ -129,6 +143,14 @@ delete mServicePlay; delete mServiceView; delete mServiceBrowse; + delete mServicePlayDeprecatedNewService; + delete mServicePlayDeprecatedOldService; + delete mServiceViewDeprecatedNewService; + delete mServiceViewDeprecatedOldService; + delete mServiceBrowseDeprecatedNewService; + delete mServiceUriFetchDeprecatedNewService; + delete mServiceBrowseDeprecatedOldService; + delete mServiceUriFetchDeprecatedOldService; } // ---------------------------------------------------------------------------- @@ -151,12 +173,23 @@ MPX_DEBUG(_L("VideoServices::getBrowseCategory()")); int category = 0; - - if ( mServiceBrowse ) + + if ( mServiceBrowse && (XQServiceUtil::interfaceName().contains("symbian"))) { category = mServiceBrowse->getBrowseCategory(); } - + else if ( mServiceBrowseDeprecatedNewService && mServiceBrowseDeprecatedOldService && !(XQServiceUtil::interfaceName().contains("symbian"))) + { + if (mServiceBrowseDeprecatedNewService->isActive()) + { + category = mServiceBrowseDeprecatedNewService->getBrowseCategory(); + } + else + { + category = mServiceBrowseDeprecatedOldService->getBrowseCategory(); + } + } + return category; } @@ -180,14 +213,42 @@ MPX_DEBUG(_L("VideoServices::contextTitle()") ); QString title; - - if (mCurrentService == VideoServices::EUriFetcher && mServiceUriFetch) + + if (mCurrentService == VideoServices::EUriFetcher) { - title = mServiceUriFetch->contextTitle(); + if(mServiceUriFetch && (XQServiceUtil::interfaceName().contains("symbian"))) + { + title = mServiceUriFetch->contextTitle(); + } + else if (mServiceUriFetchDeprecatedNewService && mServiceUriFetchDeprecatedOldService && !(XQServiceUtil::interfaceName().contains("symbian"))) + { + if(mServiceUriFetchDeprecatedNewService->isActive()) + { + title = mServiceUriFetchDeprecatedNewService->contextTitle(); + } + else + { + title = mServiceUriFetchDeprecatedOldService->contextTitle(); + } + } } - else if (mCurrentService == VideoServices::EBrowse && mServiceBrowse) + else if (mCurrentService == VideoServices::EBrowse) { - title = mServiceBrowse->contextTitle(); + if ( mServiceBrowse && (XQServiceUtil::interfaceName().contains("symbian"))) + { + title = mServiceBrowse->contextTitle(); + } + else if ( mServiceBrowseDeprecatedNewService && mServiceBrowseDeprecatedOldService && !(XQServiceUtil::interfaceName().contains("symbian"))) + { + if (mServiceBrowseDeprecatedNewService->isActive()) + { + title = mServiceBrowseDeprecatedNewService->contextTitle(); + } + else + { + title = mServiceBrowseDeprecatedOldService->contextTitle(); + } + } } return title; @@ -202,10 +263,24 @@ MPX_ENTER_EXIT(_L("VideoServices::sortType()")); int sortRole = 0; - - if (mCurrentService == EBrowse && mServiceBrowse) + + if (mCurrentService == EBrowse) { - sortRole = mServiceBrowse->sortRole(); + if ( mServiceBrowse && (XQServiceUtil::interfaceName().contains("symbian"))) + { + sortRole = mServiceBrowse->sortRole(); + } + else if ( mServiceBrowseDeprecatedNewService && mServiceBrowseDeprecatedOldService && !(XQServiceUtil::interfaceName().contains("symbian"))) + { + if (mServiceBrowseDeprecatedNewService->isActive()) + { + sortRole = mServiceBrowseDeprecatedNewService->sortRole(); + } + else + { + sortRole = mServiceBrowseDeprecatedOldService->sortRole(); + } + } } return sortRole; @@ -222,7 +297,22 @@ QStringList list; list.append( item ); - mServiceUriFetch->complete( list ); + + if(mServiceUriFetch && (XQServiceUtil::interfaceName().contains("symbian"))) + { + mServiceUriFetch->complete( list ); + } + else if (mServiceUriFetchDeprecatedNewService && mServiceUriFetchDeprecatedOldService) + { + if (mServiceUriFetchDeprecatedNewService->isActive()) + { + mServiceUriFetchDeprecatedNewService->complete( list ); + } + else + { + mServiceUriFetchDeprecatedOldService->complete( list ); + } + } mFetchSelected = true; } @@ -233,11 +323,22 @@ void VideoServices::browsingEnded() { MPX_ENTER_EXIT(_L("VideoServices::browsingEnded()")); - - if ( mServiceBrowse ) - { - mServiceBrowse->complete(); - } + + if ( mServiceBrowse && (XQServiceUtil::interfaceName().contains("symbian"))) + { + mServiceBrowse->complete(); + } + else if ( mServiceBrowseDeprecatedNewService && mServiceBrowseDeprecatedOldService && !(XQServiceUtil::interfaceName().contains("symbian"))) + { + if (mServiceBrowseDeprecatedNewService->isActive()) + { + mServiceBrowseDeprecatedNewService->complete(); + } + else + { + mServiceBrowseDeprecatedOldService->complete(); + } + } } // End of file diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayerapp/videoplayerengine/src/videoserviceurifetch.cpp --- a/videoplayerapp/videoplayerengine/src/videoserviceurifetch.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayerapp/videoplayerengine/src/videoserviceurifetch.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: % +// Version : %version: 5 % #include @@ -23,14 +23,15 @@ #include "videoserviceurifetch.h" #include "mpxhbvideocommondefs.h" #include "mpxvideo_debug.h" +#include // ---------------------------------------------------------------------------- // VideoServiceUriFetch() // ---------------------------------------------------------------------------- // -VideoServiceUriFetch::VideoServiceUriFetch(VideoServices* parent) - : XQServiceProvider( QLatin1String("com.nokia.Videos.IVideoFetch"), parent ) +VideoServiceUriFetch::VideoServiceUriFetch(VideoServices* parent, QLatin1String service) + : XQServiceProvider( service, parent ) , mRequestIndex( 0 ) , mServiceApp( parent ) { @@ -125,14 +126,52 @@ // fetch() // ---------------------------------------------------------------------------- // +void VideoServiceUriFetch::fetch() +{ + MPX_ENTER_EXIT(_L("VideoServiceUriFetch::fetch()")); + + emit mServiceApp->activated(MpxHbVideoCommon::ActivateCollectionView); + + XQRequestInfo info = requestInfo(); + + QVariant variant = info.info("WindowTitle"); + + if(variant.isValid()) + { + mTitle = variant.toString(); + } + + if (mTitle.isEmpty()) + { + mTitle = hbTrId("txt_videos_title_videos"); + } + + emit mServiceApp->titleReady(mTitle); + mServiceApp->setCurrentService(VideoServices::EUriFetcher); + + mRequestIndex = setCurrentRequestAsync(); + MPX_DEBUG(_L("VideoServiceUriFetch::fetch() : mRequestIndex(%d)"), mRequestIndex ); +} + +// ---------------------------------------------------------------------------- +// fetch() +// ---------------------------------------------------------------------------- +// void VideoServiceUriFetch::fetch(const QString& title) { - MPX_ENTER_EXIT(_L("VideoServiceUriFetch::fetch()"), + MPX_ENTER_EXIT(_L("VideoServiceUriFetch::fetch()"), _L("title = %s"), title.data() ); + emit mServiceApp->activated(MpxHbVideoCommon::ActivateCollectionView); + mTitle = title; - emit mServiceApp->activated(MpxHbVideoCommon::ActivateCollectionView); - emit mServiceApp->titleReady(title); + + if (mTitle.isEmpty()) + { + mTitle = hbTrId("txt_videos_title_videos"); + } + + emit mServiceApp->titleReady(mTitle); mServiceApp->setCurrentService(VideoServices::EUriFetcher); diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayerapp/videoplayerengine/src/videoserviceview.cpp --- a/videoplayerapp/videoplayerengine/src/videoserviceview.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayerapp/videoplayerengine/src/videoserviceview.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: 3 % +// Version : %version: 4 % #include "videoservices.h" #include "videoserviceview.h" @@ -26,8 +26,10 @@ // VideoServiceView() // ------------------------------------------------------------------------------------------------- // -VideoServiceView::VideoServiceView( VideoServices* parent, QVideoPlayerEngine* engine ) - : XQServiceProvider( QLatin1String("com.nokia.Videos.com.nokia.symbian.IFileView"), parent ) +VideoServiceView::VideoServiceView( VideoServices* parent, + QVideoPlayerEngine* engine, + QLatin1String service ) + : XQServiceProvider( service, parent ) , mEngine( engine ) , mServiceApp( parent ) { diff -r 9b6761e5bd30 -r d3d3bd65fc7b videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/src/testvideoplayerengine.cpp --- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/src/testvideoplayerengine.cpp Tue May 18 11:57:40 2010 +0100 +++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/src/testvideoplayerengine.cpp Wed Jun 23 17:22:59 2010 +0100 @@ -15,7 +15,7 @@ * */ -// Version : %version: % +// Version : %version: da1mmcf#13 % // INCLUDES #include @@ -97,6 +97,13 @@ mVideoServices = 0; mTestObject = new QVideoPlayerEngine(isService); + + if ( isService ) + { + mTestObject->mIsPlayService = true; + } + + } void TestVideoPlayerEngine::cleanup() @@ -216,15 +223,14 @@ QVERIFY(mTestObject->mCurrentViewPlugin == 0); QVERIFY(mTestObject->mPlaybackViewPlugin != 0); - QVERIFY(mTestObject->mCollectionViewPlugin != 0); - QVERIFY(mTestObject->mFileDetailsViewPlugin != 0); + QVERIFY(mTestObject->mCollectionViewPlugin == 0); + QVERIFY(mTestObject->mFileDetailsViewPlugin == 0); QVERIFY(mTestObject->mPlaybackWrapper != 0); QVERIFY(mTestObject->mVideoServices != 0); QVERIFY(mTestObject->mIsService == true); QVERIFY(VideoServices::mReferenceCount == 1); QVERIFY(mTestObject->mCollectionViewPlugin != mTestObject->mPlaybackViewPlugin); - QVERIFY(mTestObject->mCollectionViewPlugin != mTestObject->mFileDetailsViewPlugin); cleanup(); @@ -293,8 +299,8 @@ QVERIFY(mTestObject->mCurrentViewPlugin == 0); QVERIFY(mTestObject->mPlaybackViewPlugin != 0); - QVERIFY(mTestObject->mCollectionViewPlugin != 0); - QVERIFY(mTestObject->mFileDetailsViewPlugin != 0); + QVERIFY(mTestObject->mCollectionViewPlugin == 0); + QVERIFY(mTestObject->mFileDetailsViewPlugin == 0); QVERIFY(mTestObject->mVideoServices != 0); QVERIFY(mTestObject->mIsService == true); QVERIFY(VideoServices::mReferenceCount == 1);