--- a/inc/videoservices.h Fri Jul 02 17:14:33 2010 +0300
+++ b/inc/videoservices.h Thu Jul 08 13:05:19 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 5 %
+// Version : %version: 6 %
#ifndef __VIDEOSERVICES_H__
#define __VIDEOSERVICES_H__
@@ -28,221 +28,210 @@
class VideoServicePlay;
class VideoServiceView;
class VideoServiceBrowse;
-class QVideoPlayerEngine;
+class VideoPlayerEngine;
class VIDEOPLAYERAPP_DLL_EXPORT VideoServices : public QObject
{
Q_OBJECT
-public:
-
- /**
- * Returns singleton instance for this class.
- *
- * WARNING! Not safe to call this from destructor of another function scope static object!
- *
- * @return The singleton instance.
- */
- static VideoServices *instance(QVideoPlayerEngine* engine = 0);
-
- /**
- * Decreases the reference count, when count reaches zero cleanup is done.
- *
- */
- void decreaseReferenceCount();
-
- /**
- * Returns the context title set by service requestee
- *
- * @return QString the title
- *
- */
- QString contextTitle() const;
+ public:
+
+ /**
+ * Returns singleton instance for this class.
+ * WARNING! Not safe to call this from destructor of another function scope static object!
+ * @return The singleton instance.
+ */
+ static VideoServices *instance( VideoPlayerEngine* engine = 0 );
+
+ /**
+ * Decreases the reference count, when count reaches zero cleanup is done.
+ */
+ void decreaseReferenceCount();
+
+ /**
+ * Returns the context title set by service requestee
+ * @return QString the title
+ */
+ QString contextTitle() const;
+
+ /**
+ * Returns sort type defined by the service client.
+ * @param None.
+ * @return int.
+ */
+ int sortRole() const;
+
+ /*
+ * Enum reflecting the services provided
+ */
+ enum TVideoService
+ {
+ ENoService,
+ EUriFetcher,
+ EPlayback,
+ EView,
+ EBrowse
+ };
+
+ /**
+ * Returns service active status
+ * @return bool true if active, false if not active
+ */
+ VideoServices::TVideoService currentService();
+
+ /**
+ * Returns browsing category.
+ * @return see vcxmyvideosdef.h for default categories.
+ */
+ int getBrowseCategory() const;
+
+ public slots:
+ void itemSelected(const QString& item);
+ void browsingEnded();
+
+ signals:
+
+ /*
+ * Emitted when service user has set the title
+ */
+ void titleReady(const QString& title);
+
+ /*
+ * Emitted to acticate requested plugin
+ */
+ void activated(int command);
+
+ private:
+
+ /**
+ * Constructor
+ */
+ VideoServices();
+
+ /**
+ * Constructor
+ */
+ VideoServices( VideoPlayerEngine* engine );
+
+ /**
+ * Destructor.
+ */
+ virtual ~VideoServices();
+
+ void setEngine( VideoPlayerEngine* engine );
+
+ /**
+ * Sets the active service
+ *
+ * @param service
+ *
+ */
+ void setCurrentService(VideoServices::TVideoService service);
- /**
- * Returns sort type defined by the service client.
- *
- * @param None.
- * @return int.
- */
- int sortRole() const;
-
- /*
- * Enum reflecting the services provided
- */
- enum TVideoService
- {
- ENoService,
- EUriFetcher,
- EPlayback,
- EView,
- EBrowse
- };
-
- /**
- * Returns service active status
- *
- * @return bool true if active, false if not active
- *
- */
- VideoServices::TVideoService currentService();
-
- /**
- * Returns browsing category.
- *
- * @return see vcxmyvideosdef.h for default categories.
- */
- int getBrowseCategory() const;
-
-public slots:
- void itemSelected(const QString& item);
- void browsingEnded();
-
-signals:
- /*
- * Emitted when service user has set the title
- */
- void titleReady(const QString& title);
-
- /*
- * Emitted to acticate requested plugin
- */
- void activated(int command);
-
-private:
-
- /**
- * Constructor
- */
- VideoServices();
-
- /**
- * Constructor
- */
- VideoServices(QVideoPlayerEngine* engine);
-
- /**
- * Destructor.
- */
- virtual ~VideoServices();
-
- void setEngine(QVideoPlayerEngine* engine);
-
- /**
- * Sets the active service
- *
- * @param service
- *
- */
- void setCurrentService(VideoServices::TVideoService service);
-
- /**
- * Returns the current engine
- *
- * @return engine
- *
- */
- QVideoPlayerEngine* engine();
-
- Q_DISABLE_COPY(VideoServices)
-
-private:
-
- /**
- * Reference count.
- */
- int mReferenceCount;
-
- /**
- * Singleton instance.
- */
- static VideoServices* mInstance;
-
- /**
- * VideoServiceUriFetch service instance.
- */
- VideoServiceUriFetch* mServiceUriFetch;
-
- /**
- * Deprecated VideoServiceUriFetch service instance.
- */
- VideoServiceUriFetch* mServiceUriFetchDeprecatedNewService;
+ /**
+ * Returns the current engine
+ *
+ * @return engine
+ *
+ */
+ VideoPlayerEngine* engine();
+
+ Q_DISABLE_COPY( VideoServices )
+
+ private:
+
+ /**
+ * Reference count.
+ */
+ int mReferenceCount;
+
+ /**
+ * Singleton instance.
+ */
+ static VideoServices* mInstance;
+
+ /**
+ * VideoServiceUriFetch service instance.
+ */
+ VideoServiceUriFetch* mServiceUriFetch;
+
+ /**
+ * Deprecated VideoServiceUriFetch service instance.
+ */
+ VideoServiceUriFetch* mServiceUriFetchDeprecatedNewService;
+
+ /**
+ * Deprecated VideoServiceUriFetch service instance.
+ */
+ VideoServiceUriFetch* mServiceUriFetchDeprecatedOldService;
- /**
- * 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;
+ /**
+ * 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;
- /**
- * VideoServiceBrowse service instance.
- */
- VideoServiceBrowse *mServiceBrowse;
-
- /**
- * Deprecated VideoServiceBrowse service instance.
- */
- VideoServiceBrowse *mServiceBrowseDeprecatedNewService;
+ /**
+ * Deprecated VideoServiceBrowse service instance.
+ */
+ VideoServiceBrowse *mServiceBrowseDeprecatedNewService;
+
+ /**
+ * Deprecated VideoServiceBrowse service instance.
+ */
+ VideoServiceBrowse *mServiceBrowseDeprecatedOldService;
+
+ /**
+ * Pointer of VideoPlayerEngine.
+ */
+ VideoPlayerEngine* mEngine;
- /**
- * Deprecated VideoServiceBrowse service instance.
- */
- VideoServiceBrowse *mServiceBrowseDeprecatedOldService;
-
- /**
- * Pointer of QVideoPlayerEngine.
- */
- QVideoPlayerEngine* mEngine;
-
- /*
- * Current service
- */
- VideoServices::TVideoService mCurrentService;
-
- friend class VideoServiceUriFetch;
-
- friend class VideoServicePlay;
-
- friend class VideoServiceView;
+ /*
+ * Current service
+ */
+ VideoServices::TVideoService mCurrentService;
- friend class VideoServiceBrowse;
-
-public:
-
- /*
- * indicate fetch service and attach operation has been selected
- */
- bool mFetchSelected;
-
- };
+ friend class VideoServiceUriFetch;
+ friend class VideoServicePlay;
+ friend class VideoServiceView;
+ friend class VideoServiceBrowse;
+
+ public:
+
+ /*
+ * indicate fetch service and attach operation has been selected
+ */
+ bool mFetchSelected;
+
+};
#endif //__VIDEOSERVICES_H__
--- a/mediasettings/mediasettingsengine/group/MPSettROPModel.mmp Fri Jul 02 17:14:33 2010 +0300
+++ b/mediasettings/mediasettingsengine/group/MPSettROPModel.mmp Thu Jul 08 13:05:19 2010 +0300
@@ -16,7 +16,7 @@
-// Version : %version: 6 %
+// Version : %version: 7 %
@@ -53,6 +53,7 @@
SYSTEMINCLUDE /epoc32/include/mmf
SYSTEMINCLUDE /epoc32/include/mmf/common
+SMPSAFE
LIBRARY euser.lib
LIBRARY mmfcontrollerframework.lib
--- a/mediasettings/videosettingsplugin/videosettingsplugin.pro Fri Jul 02 17:14:33 2010 +0300
+++ b/mediasettings/videosettingsplugin/videosettingsplugin.pro Thu Jul 08 13:05:19 2010 +0300
@@ -15,10 +15,16 @@
#
TEMPLATE = lib
+CONFIG += hb plugin
TARGET = videosettingsplugin
-CONFIG += hb \
- plugin
+symbian: {
+ TARGET.EPOCALLOWDLLDATA = 1
+ TARGET.UID3 = 0x2002BC69
+ TARGET.CAPABILITY = CAP_GENERAL_DLL
+ BLD_INF_RULES.prj_exports += "rom/videosettingsplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(videosettingsplugin.iby)"
+ MMP_RULES += SMPSAFE
+}
LIBS += -lcpframework \
-lMPSettEngine.dll \
@@ -37,15 +43,6 @@
src/videosettingsgroup.cpp \
src/videosettingsaccesspointentry.cpp
-symbian: {
- TARGET.EPOCALLOWDLLDATA = 1
- TARGET.UID3 = 0x2002BC69
-
- BLD_INF_RULES.prj_exports += "rom/videosettingsplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(videosettingsplugin.iby)"
-}
-
-TARGET.CAPABILITY = CAP_GENERAL_DLL
-
deploy.path = C:
qtplugins.path = /resource/qt/plugins/controlpanel
qtplugins.sources += qmakepluginstubs/videosettingsplugin.qtplugin
--- a/videocollection/mpxmyvideoscollection/group/vcxmyvideoscollectionplugin.mmp Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/group/vcxmyvideoscollectionplugin.mmp Thu Jul 08 13:05:19 2010 +0300
@@ -59,6 +59,8 @@
APP_LAYER_SYSTEMINCLUDE
+SMPSAFE
+
LIBRARY euser.lib
LIBRARY ecom.lib
--- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideosalbums.h Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosalbums.h Thu Jul 08 13:05:19 2010 +0300
@@ -185,6 +185,12 @@
* @param aMdsId MDS ID of the changed video.
*/
void VideoTitleChangedL( TUint32 aMdsId );
+
+ /**
+ * Called when multiple videos are added or removed from cache. Adds changed
+ * album indexes to iChangedAlbums.
+ */
+ void VideosAddedOrRemovedFromCacheL( RArray<TUint32> aMdsIds );
/**
* Called when video is added or removed from cache. Adds changed
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosalbums.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosalbums.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -779,6 +779,29 @@
}
// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::VideosAddedOrRemovedFromCacheL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::VideosAddedOrRemovedFromCacheL( RArray<TUint32> aMdsIds )
+ {
+ TInt albumCount = iAlbums.Count();
+ TInt videoCount = aMdsIds.Count();
+ for ( TInt i = 0; i < albumCount; i++ )
+ {
+ for ( TInt j = 0; j < videoCount; j++ )
+ {
+ if ( iAlbums[i]->BelongsToAlbum( aMdsIds[j] ) )
+ {
+ if ( iChangedAlbums.Find( i ) == KErrNotFound )
+ {
+ iChangedAlbums.AppendL( i );
+ }
+ }
+ }
+ }
+ }
+
+// ----------------------------------------------------------------------------
// CVcxMyVideosAlbums::VideoAddedOrRemovedFromCacheL
// ----------------------------------------------------------------------------
//
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionplugin.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionplugin.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -442,7 +442,11 @@
CategoriesL().UpdateCategoriesL( *iCache->iVideoList, 0 );
CategoriesL().UpdateCategoriesNewVideoNamesL();
-#ifdef VCX_ALBUMS
+#ifdef VCX_ALBUMS
+ // Adds changed album indexes to Albums().iChangedAlbums.
+ // AlbumsL().UpdateChangedAlbumsL() will update the changed ones and add events.
+ AlbumsL().VideosAddedOrRemovedFromCacheL( aId );
+
AlbumsL().RemoveAlbumsL( aId );
#endif
}
@@ -470,9 +474,18 @@
iCache->AddVideosFromMdsL( aId, videoListFetchingWasCancelled,
&nonVideoIds, EFalse /* dont update categories*/ );
- CategoriesL().ResetVideoCountersL();
- CategoriesL().UpdateCategoriesL( *iCache->iVideoList, 0 );
- CategoriesL().UpdateCategoriesNewVideoNamesL();
+ if ( aId.Count() )
+ {
+ CategoriesL().ResetVideoCountersL();
+ CategoriesL().UpdateCategoriesL( *iCache->iVideoList, 0 );
+ CategoriesL().UpdateCategoriesNewVideoNamesL();
+
+#ifdef VCX_ALBUMS
+ // Adds changed album indexes to Albums().iChangedAlbums.
+ // AlbumsL().UpdateChangedAlbumsL() will update the changed ones and add events.
+ AlbumsL().VideosAddedOrRemovedFromCacheL( aId );
+#endif
+ }
#ifdef VCX_ALBUMS
#if 0 //TODO: do this if we want to support albums which are being added by someone else than My Videos Collection
@@ -480,6 +493,8 @@
//After the call nonVideoIds will contain only items which were actually added
//to albums.
AlbumsL().AddAlbumsFromMdsL( nonVideoIds );
+#else
+ nonVideoIds.Reset();
#endif
#endif
@@ -566,7 +581,7 @@
TMPXItemId( nonVideoIds[i], KVcxMvcMediaTypeAlbum ), aEvent ) );
}
- iAlbums->UpdateChangedAlbumsL();
+ AlbumsL().UpdateChangedAlbumsL();
#endif
CleanupStack::PopAndDestroy( &nonVideoIds );
--- a/videocollection/tsrc/stubs/inc/hbeffect.h Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/hbeffect.h Thu Jul 08 13:05:19 2010 +0300
@@ -22,6 +22,7 @@
#include <qgraphicsitem.h>
#include <qvariant.h>
#include <qrect.h>
+#include <qvariant.h>
class HbEffect : public QObject
{
--- a/videocollection/tsrc/stubs/inc/hblistview.h Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/hblistview.h Thu Jul 08 13:05:19 2010 +0300
@@ -281,6 +281,26 @@
Q_UNUSED(name);
}
+ /**
+ * dummy method
+ */
+ void rowsInserted(const QModelIndex &parent, int start, int end)
+ {
+ Q_UNUSED(parent);
+ Q_UNUSED(start);
+ Q_UNUSED(end);
+ }
+
+ /**
+ * dummy method
+ */
+ void rowsRemoved(const QModelIndex &parent, int start, int end)
+ {
+ Q_UNUSED(parent);
+ Q_UNUSED(start);
+ Q_UNUSED(end);
+ }
+
public:
/**
--- a/videocollection/tsrc/stubs/inc/hbmessagebox.h Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/hbmessagebox.h Thu Jul 08 13:05:19 2010 +0300
@@ -37,6 +37,25 @@
MessageTypeQuestion,
MessageTypeWarning
};
+
+ enum StandardButton {
+ NoButton = 0x00000000,
+ Ok = 0x00000400,
+ Save = 0x00000800,
+ Open = 0x00001000,
+ Yes = 0x00002000,
+ Continue = 0x00004000,
+ Delete = 0x00008000,
+ No = 0x00010000,
+ Retry = 0x00020000,
+ Close = 0x00040000,
+ Cancel = 0x00080000,
+ Help = 0x00100000,
+ Apply = 0x00200000,
+ Reset = 0x00400000
+ };
+
+ Q_DECLARE_FLAGS(StandardButtons, StandardButton)
HbMessageBox(MessageBoxType type = MessageTypeInformation, QGraphicsItem *parent = 0);
HbMessageBox(const QString &text, MessageBoxType type = MessageTypeInformation, QGraphicsItem *parent = 0);
@@ -75,6 +94,8 @@
QGraphicsScene *scene = 0,
QGraphicsItem *parent = 0 );
+ static void setStandardButtons(StandardButtons buttons);
+
QList<HbAction*> actions() const
{
return mActions;
@@ -82,7 +103,7 @@
signals:
- void finished(HbAction *action);
+ void finished(int action);
public:
--- a/videocollection/tsrc/stubs/inc/hbtoolbar.h Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/hbtoolbar.h Thu Jul 08 13:05:19 2010 +0300
@@ -19,22 +19,26 @@
#define HBTOOLBAR_H
#include <hbwidget.h>
+#include "hbtoolbarextension.h"
+#include <hbaction.h>
class HbToolBar : public HbWidget
{
Q_OBJECT
public:
- HbToolBar( QGraphicsItem *parent = 0 ) : HbWidget(parent) {};
- virtual ~HbToolBar() {};
+ HbToolBar( QGraphicsItem *parent = 0 );
+ virtual ~HbToolBar();
using HbWidget::addAction;
+
/* HbAction *addAction( const QString &text );
HbAction *addAction( const HbIcon &icon, const QString &text );
HbAction *addAction( const QString &text, const QObject *receiver, const char *member );
HbAction *addAction( const HbIcon &icon, const QString &text, const QObject *receiver, const char *member );
-
+*/
HbAction *addExtension( HbToolBarExtension *extension );
+ /*
HbAction *insertExtension( HbAction *before, HbToolBarExtension *extension );
Qt::Orientation orientation() const;
@@ -65,6 +69,10 @@
Q_PRIVATE_SLOT(d_func(), void _q_delayedHide(HbEffect::EffectStatus status))
//Q_PRIVATE_SLOT(d_func(), void _q_delayedShow(HbEffect::EffectStatus status))
#endif // HB_EFFECTS*/
+
+ static int mAddExtensionCallCount;
+
+ HbAction *mToolBarExtensionAction;
};
#endif // HBTOOLBAR_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/stubs/inc/hbtoolbarextension.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,47 @@
+/*
+* 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: hbinputdialog stub
+*
+*/
+
+
+#ifndef HBTOOLBAREXTENSION_H
+#define HBTOOLBAREXTENSION_H
+
+#include "hbwidget.h"
+#include "hbaction.h"
+#include <qvariant.h>
+#include <qgraphicsitem.h>
+#include "hbicon.h"
+#include <qlist.h>
+
+class HbToolBarExtension : public HbWidget
+{
+ Q_OBJECT
+
+public:
+ HbToolBarExtension(QGraphicsItem *parent = 0);
+ ~HbToolBarExtension();
+
+ HbAction *addAction ( const HbIcon &icon, const QString &text,
+ const QObject *receiver, const char *member );
+
+public:
+
+ QList<QAction *> mActions;
+
+ static int mAddActionCallCount;
+};
+
+#endif //HBTOOLBAREXTENSION_H
--- a/videocollection/tsrc/stubs/inc/videocollectionviewutilsdata.h Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/videocollectionviewutilsdata.h Thu Jul 08 13:05:19 2010 +0300
@@ -29,7 +29,6 @@
{
mLastError = 0;
mLoadSortingValuesFails = false;
- mGetServiceIconStringsFails = false;
mVideoSortRole = -1;
mCollectionSortRole = -1;
mVideoSortOrder = Qt::AscendingOrder;
@@ -40,12 +39,13 @@
mWidgetLevel = VideoCollectionCommon::ELevelVideos;
mActivityCollectionId = TMPXItemId::InvalidId();
mActivityCollectionName = "";
+ mCenRepStringValues.clear();
+ mCenRepIntValues.clear();
}
public: // data
static int mLastError;
static bool mLoadSortingValuesFails;
- static bool mGetServiceIconStringsFails;
static int mVideoSortRole;
static int mCollectionSortRole;
static Qt::SortOrder mVideoSortOrder;
@@ -56,6 +56,8 @@
static VideoCollectionCommon::TCollectionLevels mWidgetLevel;
static TMPXItemId mActivityCollectionId;
static QString mActivityCollectionName;
+ static QList<QString> mCenRepStringValues;
+ static QList<int> mCenRepIntValues;
};
#endif /* VIDEOCOLLECTIONVIEWUTILSDATA_H */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/stubs/inc/videooperatorservicedata.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,55 @@
+/*
+* 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 videooperatorservicedata
+*
+*/
+
+#ifndef VIDEOOPERATORSERVICEDATA_H
+#define VIDEOOPERATORSERVICEDATA_H
+
+#include <qlist.h>
+#include <qstring.h>
+
+class VideoOperatorServiceData
+{
+public: // methods
+ static void reset()
+ {
+ mTitles.clear();
+ mIcons.clear();
+ mUris.clear();
+ mUids.clear();
+
+ mTitleCallCount = 0;
+ mIconResourceCallCount = 0;
+ mLaunchServiceCallCount = 0;
+ mLaunchApplicationLCallCount = 0;
+ }
+
+public: // data
+ static QList<QString> mTitles;
+ static QList<QString> mIcons;
+ static QList<QString> mUris;
+ static QList<int> mUids;
+
+ static bool loadReturnValue;
+
+ static int mLoadCallCount;
+ static int mTitleCallCount;
+ static int mIconResourceCallCount;
+ static int mLaunchServiceCallCount;
+ static int mLaunchApplicationLCallCount;
+};
+
+#endif /* VIDEOOPERATORSERVICEDATA_H */
--- a/videocollection/tsrc/stubs/inc/videoservices.h Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/videoservices.h Thu Jul 08 13:05:19 2010 +0300
@@ -15,6 +15,8 @@
*
*/
+// Version : %version: %
+
#ifndef __VIDEOSERVICES_H__
#define __VIDEOSERVICES_H__
@@ -31,173 +33,159 @@
class VideoServicePlay;
class VideoServiceView;
class VideoServiceBrowse;
-class QVideoPlayerEngine;
+class VideoPlayerEngine;
class VideoServices : public QObject
{
Q_OBJECT
-public:
-
- /**
- * Returns singleton instance for this class.
- *
- * WARNING! Not safe to call this from destructor of another function scope static object!
- *
- * @return The singleton instance.
- */
- static VideoServices *instance(QVideoPlayerEngine* engine = 0);
-
- /**
- * Decreases the reference count, when count reaches zero cleanup is done.
- *
- */
- void decreaseReferenceCount();
-
- /**
- * Returns the context title set by service requestee
- *
- * @return QString the title
- *
- */
- QString contextTitle() const;
-
- /**
- * Returns sort type defined by the service client.
- *
- * @param None.
- * @return int.
- */
- int sortRole() const;
-
- /*
- * Enum reflecting the services provided
- */
- enum TVideoService
- {
- ENoService,
- EUriFetcher,
- EPlayback,
- EView,
- EBrowse
- };
-
- /**
- * Returns service active status
- *
- * @return bool true if active, false if not active
- *
- */
- VideoServices::TVideoService currentService();
-
- /**
- * Returns browsing category.
- *
- * @return see vcxmyvideosdef.h for default categories.
- */
- int getBrowseCategory() const;
-
-public slots:
- void itemSelected(const QString& item);
- void browsingEnded();
-
-signals:
- /*
- * Emitted when service user has set the title
- */
- void titleReady(const QString& title);
-
- /*
- * Emitted to acticate requested plugin
- */
- void activated(int command);
-
-private:
+ public:
- /**
- * Constructor
- */
- VideoServices();
-
- /**
- * Constructor
- */
- VideoServices(QVideoPlayerEngine* engine);
-
- /**
- * Destructor.
- */
- virtual ~VideoServices();
-
- void setEngine(QVideoPlayerEngine* engine);
-
- /**
- * Sets the active service
- *
- * @param service
- *
- */
- void setCurrentService(VideoServices::TVideoService service);
-
- /**
- * Returns the current engine
- *
- * @return engine
- *
- */
- QVideoPlayerEngine* engine();
-
- Q_DISABLE_COPY(VideoServices)
-
-private:
-
- /**
- * Reference count.
- */
- int mReferenceCount;
-
- /**
- * VideoServiceUriFetch service instance.
- */
- VideoServiceUriFetch* mServiceUriFetch;
-
- /**
- * VideoServicePlay service instance.
- */
- VideoServicePlay* mServicePlay;
+ /**
+ * Returns singleton instance for this class.
+ * WARNING! Not safe to call this from destructor of another function scope static object!
+ * @return The singleton instance.
+ */
+ static VideoServices *instance( VideoPlayerEngine* engine = 0 );
+
+ /**
+ * Decreases the reference count, when count reaches zero cleanup is done.
+ *
+ */
+ void decreaseReferenceCount();
+
+ /**
+ * Returns the context title set by service requestee
+ * @return QString the title
+ */
+ QString contextTitle() const;
+
+ /**
+ * Returns sort type defined by the service client.
+ * @param None.
+ * @return int.
+ */
+ int sortRole() const;
+
+ /*
+ * Enum reflecting the services provided
+ */
+ enum TVideoService
+ {
+ ENoService,
+ EUriFetcher,
+ EPlayback,
+ EView,
+ EBrowse
+ };
+
+ /**
+ * Returns service active status
+ * @return bool true if active, false if not active
+ */
+ VideoServices::TVideoService currentService();
+
+ /**
+ * Returns browsing category.
+ * @return see vcxmyvideosdef.h for default categories.
+ */
+ int getBrowseCategory() const;
+
+ public slots:
+ void itemSelected( const QString& item );
+ void browsingEnded();
+
+ signals:
+ /*
+ * Emitted when service user has set the title
+ */
+ void titleReady( const QString& title );
+
+ /*
+ * Emitted to acticate requested plugin
+ */
+ void activated( int command );
+
+ private:
+
+ /**
+ * Constructor
+ */
+ VideoServices();
- /**
- * VideoServiceView service instance.
- */
- VideoServiceView* mServiceView;
+ /**
+ * Constructor
+ */
+ VideoServices( VideoPlayerEngine* engine );
+
+ /**
+ * Destructor.
+ */
+ virtual ~VideoServices();
+
+ void setEngine( VideoPlayerEngine* engine );
+
+ /**
+ * Sets the active service
+ * @param service
+ */
+ void setCurrentService( VideoServices::TVideoService service );
+
+ /**
+ * Returns the current engine
+ * @return engine
+ */
+ VideoPlayerEngine* engine();
+
+ Q_DISABLE_COPY( VideoServices )
+
+ private:
+
+ /**
+ * Reference count.
+ */
+ int mReferenceCount;
- /**
- * VideoServiceBrowse service instance.
- */
- VideoServiceBrowse *mServiceBrowse;
-
- /**
- * Pointer of QVideoPlayerEngine.
- */
- QVideoPlayerEngine* mEngine;
-
- /*
- * Current service
- */
- VideoServices::TVideoService mCurrentService;
+ /**
+ * VideoServiceUriFetch service instance.
+ */
+ VideoServiceUriFetch* mServiceUriFetch;
+
+ /**
+ * VideoServicePlay service instance.
+ */
+ VideoServicePlay* mServicePlay;
+
+ /**
+ * VideoServiceView service instance.
+ */
+ VideoServiceView* mServiceView;
+
+ /**
+ * VideoServiceBrowse service instance.
+ */
+ VideoServiceBrowse *mServiceBrowse;
- /**
- * Sort role.
- */
- int mSortRole;
-
- friend class VideoServiceUriFetch;
-
- friend class VideoServicePlay;
-
- friend class VideoServiceView;
+ /**
+ * Pointer of VideoPlayerEngine.
+ */
+ VideoPlayerEngine* mEngine;
- friend class VideoServiceBrowse;
- };
+ /*
+ * Current service
+ */
+ VideoServices::TVideoService mCurrentService;
+
+ /**
+ * Sort role.
+ */
+ int mSortRole;
+
+ friend class VideoServiceUriFetch;
+ friend class VideoServicePlay;
+ friend class VideoServiceView;
+ friend class VideoServiceBrowse;
+
+};
#endif //__VIDEOSERVICES_H__
--- a/videocollection/tsrc/stubs/inc/videothumbnailtestdata.h Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/videothumbnailtestdata.h Thu Jul 08 13:05:19 2010 +0300
@@ -27,6 +27,7 @@
mFreeThumbnailDataCallCount = 0;
mBackgroundThumbnailFetchingEnabled = 0;
mStartBackgroundFetchingCallCount = 0;
+ mFetchIndex = -1;
}
public: // data
@@ -34,6 +35,7 @@
static int mFreeThumbnailDataCallCount;
static int mBackgroundThumbnailFetchingEnabled;
static int mStartBackgroundFetchingCallCount;
+ static int mFetchIndex;
};
#endif /* VIDEOTHUMBNAILTESTDATA_H */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/stubs/inc/xqsettingsmanagerstub.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,58 @@
+/*
+* 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: XQSettingsManager class stub.
+*
+*/
+
+#ifndef XQSETTINGSMANAGER_H
+#define XQSETTINGSMANAGER_H
+
+#include <QObject>
+#include <QVariant>
+
+class XQCentralRepositorySettingsKey : public QObject
+{
+
+public:
+
+ XQCentralRepositorySettingsKey(int uid, int key)
+ {
+ Q_UNUSED(uid);
+ Q_UNUSED(key);
+ }
+};
+
+class XQSettingsManager
+{
+
+ enum Type
+ {
+ TypeVariant = 0,
+ TypeInt,
+ TypeDouble,
+ TypeString,
+ TypeByteArray
+ };
+
+public:
+ QVariant readItemValue(XQCentralRepositorySettingsKey &key, int type)
+ {
+ Q_UNUSED(key);
+ Q_UNUSED(type);
+ return QVariant();
+ }
+
+};
+
+#endif // XQSETTINGSMANAGER_H
--- a/videocollection/tsrc/stubs/src/hbaction.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/tsrc/stubs/src/hbaction.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -19,4 +19,3 @@
int HbAction::initializeCount = 0;
Hb::NavigationAction HbAction::mNavAction = Hb::QuitNaviAction;
-
--- a/videocollection/tsrc/stubs/src/hbdocumentloader.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/tsrc/stubs/src/hbdocumentloader.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -273,10 +273,6 @@
{
obj = new HbPushButton();
}
- else if(name == DOCML_NAME_HINT_LABEL)
- {
- obj = new HbLabel();
- }
else if(name == DOCML_NAME_NO_VIDEOS_LABEL)
{
obj = new HbLabel();
--- a/videocollection/tsrc/stubs/src/hbmessagebox.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/tsrc/stubs/src/hbmessagebox.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -79,13 +79,19 @@
void HbMessageBox::emitDialogFinished( QObject* receiver, const char* member, int actionNum )
{
- if(connect(this, SIGNAL(finished(HbAction *)), receiver, member))
+ if(connect(this, SIGNAL(finished(int)), receiver, member))
{
- emit finished(mActions.value(actionNum));
- disconnect(this, SIGNAL(finished(HbAction *)), receiver, member);
+ emit finished(actionNum);
+ disconnect(this, SIGNAL(finished(int)), receiver, member);
}
}
+void HbMessageBox::setStandardButtons(StandardButtons buttons)
+{
+ Q_UNUSED(buttons);
+ //NOP
+}
+
void HbMessageBox::information(const QString &informationText,
QGraphicsWidget *headWidget,
QGraphicsScene *scene,
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/stubs/src/hbtoolbar.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,46 @@
+/*
+* 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 "hbtoolbar.h"
+
+int HbToolBar::mAddExtensionCallCount = 0;
+
+HbToolBar::HbToolBar( QGraphicsItem *parent)
+ : HbWidget(parent), mToolBarExtensionAction( 0 )
+{
+
+}
+
+HbToolBar::~HbToolBar()
+{
+
+}
+
+HbAction *HbToolBar::addExtension( HbToolBarExtension *extension )
+{
+ Q_UNUSED(extension);
+ mAddExtensionCallCount++;
+
+ if(mToolBarExtensionAction)
+ {
+ delete mToolBarExtensionAction;
+ }
+ mToolBarExtensionAction = new HbAction();
+
+ return mToolBarExtensionAction;
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/stubs/src/hbtoolbarextension.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,49 @@
+/*
+* 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 "hbtoolbarextension.h"
+
+int HbToolBarExtension::mAddActionCallCount = 0;
+
+HbToolBarExtension::HbToolBarExtension(QGraphicsItem *parent)
+: HbWidget(parent)
+{
+
+}
+
+HbToolBarExtension::~HbToolBarExtension()
+{
+ for(int i = 0; i < mActions.count(); i++)
+ {
+ delete mActions[i];
+ }
+ mActions.clear();
+}
+
+HbAction *HbToolBarExtension::addAction ( const HbIcon &icon, const QString &text,
+ const QObject *receiver, const char *member )
+{
+ Q_UNUSED(icon);
+ Q_UNUSED(text);
+ Q_UNUSED(receiver);
+ Q_UNUSED(member);
+ HbAction *action = new HbAction();
+ mActions.append(action);
+ mAddActionCallCount++;
+ return action;
+}
+
--- a/videocollection/tsrc/stubs/src/hbwidget.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/tsrc/stubs/src/hbwidget.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -18,7 +18,3 @@
#include "hbwidget.h"
int HbWidget::initializeCount = 0;
-
-
-
-
--- a/videocollection/tsrc/stubs/src/videocollectionviewutils.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/tsrc/stubs/src/videocollectionviewutils.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -20,7 +20,6 @@
int VideoCollectionViewUtilsData::mLastError = 0;
bool VideoCollectionViewUtilsData::mLoadSortingValuesFails = false;
-bool VideoCollectionViewUtilsData::mGetServiceIconStringsFails = false;
int VideoCollectionViewUtilsData::mVideoSortRole = -1;
int VideoCollectionViewUtilsData::mCollectionSortRole = -1;
Qt::SortOrder VideoCollectionViewUtilsData::mVideoSortOrder = Qt::AscendingOrder;
@@ -31,6 +30,8 @@
VideoCollectionCommon::TCollectionLevels VideoCollectionViewUtilsData::mWidgetLevel = VideoCollectionCommon::ELevelVideos;
TMPXItemId VideoCollectionViewUtilsData::mActivityCollectionId = TMPXItemId::InvalidId();
QString VideoCollectionViewUtilsData::mActivityCollectionName = "";
+QList<QString> VideoCollectionViewUtilsData::mCenRepStringValues;
+QList<int> VideoCollectionViewUtilsData::mCenRepIntValues;
VideoCollectionViewUtils& VideoCollectionViewUtils::instance()
{
@@ -101,24 +102,24 @@
return 0;
}
-int VideoCollectionViewUtils::getServiceIconStrings(QString& icon,
- QString& iconPressed)
+QString VideoCollectionViewUtils::getCenRepStringValue(int key)
{
- if (VideoCollectionViewUtilsData::mGetServiceIconStringsFails)
+ Q_UNUSED(key);
+ if(VideoCollectionViewUtilsData::mCenRepStringValues.count() > 0)
{
- return -1;
+ return VideoCollectionViewUtilsData::mCenRepStringValues.takeFirst();;
}
-
- icon = VideoCollectionViewUtilsData::mIconString;
- iconPressed = VideoCollectionViewUtilsData::mPressedString;
-
- return 0;
+ return -1;
}
-QString VideoCollectionViewUtils::getServiceUriString()
+int VideoCollectionViewUtils::getCenRepIntValue(int key)
{
- // not stubbed
- return QString();
+ Q_UNUSED(key);
+ if(VideoCollectionViewUtilsData::mCenRepIntValues.count() > 0)
+ {
+ return VideoCollectionViewUtilsData::mCenRepIntValues.takeFirst();;
+ }
+ return -1;
}
void VideoCollectionViewUtils::initListView(HbListView *view)
--- a/videocollection/tsrc/stubs/src/videohintwidget.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/tsrc/stubs/src/videohintwidget.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -25,8 +25,6 @@
QGraphicsItem *parent):
HbWidget(parent),
mUiLoader(uiLoader),
- mServiceIcon(0),
- mAddVideosIcon(0),
mCurrentLevel(AllVideos)
{
// NOP
@@ -37,10 +35,10 @@
// nop
}
-int VideoHintWidget::initialize()
+void VideoHintWidget::initialize()
{
// not stubbed
- return 0;
+ return;
}
void VideoHintWidget::setLevel(HintLevel level)
--- a/videocollection/tsrc/stubs/src/videolistview.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/tsrc/stubs/src/videolistview.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -36,7 +36,9 @@
mVideoServices(0),
mCurrentList(0),
mToolbarViewsActionGroup(0),
-mToolbarCollectionActionGroup(0)
+mToolbarCollectionActionGroup(0),
+mToolbarServiceExtension(0)
+
{
// not stubbed
}
@@ -100,6 +102,20 @@
return 0;
}
+void VideoListView::createOperatorServicesToolbar()
+{
+ // not stubbed
+}
+
+void VideoListView::loadOperatorService(int titleKey, int iconKey, int uriKey, int uidKey)
+{
+ // not stubbed
+ Q_UNUSED(titleKey);
+ Q_UNUSED(iconKey);
+ Q_UNUSED(uriKey);
+ Q_UNUSED(uidKey);
+}
+
HbAction* VideoListView::createAction(QString icon,
QActionGroup* actionGroup,
const char *slot)
@@ -145,7 +161,7 @@
// not stubbed
}
-void VideoListView::openServicesViewSlot()
+void VideoListView::openOperatorServiceSlot()
{
// not stubbed
}
--- a/videocollection/tsrc/stubs/src/videolistwidget.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/tsrc/stubs/src/videolistwidget.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -219,16 +219,31 @@
// not stubbed
}
-void VideoListWidget::deleteItemDialogFinished(HbAction *action)
+void VideoListWidget::deleteItemDialogFinished(int action)
+{
+ Q_UNUSED(action);
+ // not stubbed
+}
+
+void VideoListWidget::removeCollectionDialogFinished(int action)
{
Q_UNUSED(action);
// not stubbed
}
-void VideoListWidget::removeCollectionDialogFinished(HbAction *action)
+void VideoListWidget::rowsInserted(const QModelIndex &parent, int start, int end)
{
- Q_UNUSED(action);
+ Q_UNUSED(parent);
+ Q_UNUSED(start);
+ Q_UNUSED(end);
// not stubbed
}
+void VideoListWidget::rowsRemoved(const QModelIndex &parent, int start, int end)
+{
+ Q_UNUSED(parent);
+ Q_UNUSED(start);
+ Q_UNUSED(end);
+ // not stubbed
+}
// end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/stubs/src/videooperatorservice.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,129 @@
+/*
+* 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: VideoOperatorService class implementation.
+*
+*/
+
+// Version :
+
+// INCLUDE FILES
+
+#include "videooperatorservice.h"
+#include "videooperatorservicedata.h"
+#include "videocollectionviewutils.h"
+#include "videocollectioncenrepdefs.h"
+
+QList<QString> VideoOperatorServiceData::mTitles;
+QList<QString> VideoOperatorServiceData::mIcons;
+QList<QString> VideoOperatorServiceData::mUris;
+QList<int> VideoOperatorServiceData::mUids;
+
+int VideoOperatorServiceData::mLoadCallCount = 0;
+int VideoOperatorServiceData::mTitleCallCount = 0;
+int VideoOperatorServiceData::mIconResourceCallCount = 0;
+int VideoOperatorServiceData::mLaunchServiceCallCount = 0;
+int VideoOperatorServiceData::mLaunchApplicationLCallCount = 0;
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+VideoOperatorService::VideoOperatorService(QObject *parent) :
+ QObject(parent)
+{
+ // not stubbed
+}
+
+// ---------------------------------------------------------------------------
+// load
+// ---------------------------------------------------------------------------
+//
+bool VideoOperatorService::load(int titleKey, int iconKey, int serviceUriKey, int appUidKey)
+{
+ // not stubbed
+ Q_UNUSED(titleKey);
+ Q_UNUSED(iconKey);
+ Q_UNUSED(serviceUriKey);
+ Q_UNUSED(appUidKey);
+
+ VideoOperatorServiceData::mLoadCallCount++;
+
+ if(VideoOperatorServiceData::mTitles.count() > 0)
+ {
+ mTitle = VideoOperatorServiceData::mTitles.takeFirst();
+ }
+ if(VideoOperatorServiceData::mIcons.count() > 0)
+ {
+ mIconResource = VideoOperatorServiceData::mIcons.takeFirst();
+ }
+ if(VideoOperatorServiceData::mUris.count() > 0)
+ {
+ mServiceUri = VideoOperatorServiceData::mUris.takeFirst();
+ }
+ if(VideoOperatorServiceData::mUids.count() > 0)
+ {
+ mApplicationUid = VideoOperatorServiceData::mUids.takeFirst();
+ }
+
+ // Icon is required, either service uri or application uid is required.
+ if(mIconResource.isEmpty() && (mServiceUri.isEmpty() || mApplicationUid > 0))
+ {
+ return false;
+ }
+ return true;
+}
+
+// ---------------------------------------------------------------------------
+// title
+// ---------------------------------------------------------------------------
+//
+const QString VideoOperatorService::title() const
+{
+ VideoOperatorServiceData::mTitleCallCount++;
+ return mTitle;
+}
+
+// ---------------------------------------------------------------------------
+// iconResource
+// ---------------------------------------------------------------------------
+//
+const QString VideoOperatorService::iconResource() const
+{
+ VideoOperatorServiceData::mIconResourceCallCount++;
+ return mIconResource;
+}
+
+// ---------------------------------------------------------------------------
+// launchService
+// ---------------------------------------------------------------------------
+//
+void VideoOperatorService::launchService()
+{
+ VideoOperatorServiceData::mLaunchServiceCallCount++;
+ // not stubbed
+}
+
+// ---------------------------------------------------------------------------
+// launchApplicationL
+// ---------------------------------------------------------------------------
+//
+void VideoOperatorService::launchApplicationL(const TUid uid, TInt viewId)
+{
+ Q_UNUSED(uid);
+ Q_UNUSED(viewId);
+ VideoOperatorServiceData::mLaunchApplicationLCallCount++;
+ // not stubbed
+}
+
+// End of file.
--- a/videocollection/tsrc/stubs/src/videoservices.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/tsrc/stubs/src/videoservices.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -15,6 +15,8 @@
*
*/
+// Version : %version: %
+
#include <qobject.h>
#include "videoplayerappexport.h"
#include "videoservices.h"
@@ -24,27 +26,29 @@
VideoServices* g_Instance = 0;
-VideoServices* VideoServices::instance(QVideoPlayerEngine* engine)
+VideoServices* VideoServices::instance( VideoPlayerEngine* engine )
{
static VideoServices* g_Instance = 0;
- if(!g_Instance)
+ if ( ! g_Instance )
{
- g_Instance = new VideoServices(engine);
+ g_Instance = new VideoServices( engine );
}
- else if(engine && !g_Instance->engine())
+ else if ( engine && !g_Instance->engine() )
{
- g_Instance->setEngine(engine);
+ g_Instance->setEngine( engine );
}
+
g_Instance->mReferenceCount++;
+
return g_Instance;
}
void VideoServices::decreaseReferenceCount()
{
- if(g_Instance)
+ if ( g_Instance )
{
- if(--g_Instance->mReferenceCount == 0)
+ if ( --g_Instance->mReferenceCount == 0 )
{
delete g_Instance;
g_Instance = NULL;
@@ -52,26 +56,26 @@
}
}
-void VideoServices::setEngine(QVideoPlayerEngine* engine)
+void VideoServices::setEngine( VideoPlayerEngine* engine )
{
Q_UNUSED(engine);
// not stubbed
}
-QVideoPlayerEngine* VideoServices::engine()
+VideoPlayerEngine* VideoServices::engine()
{
// not stubbed
return 0;
}
-VideoServices::VideoServices(QVideoPlayerEngine* engine):
- mReferenceCount(0),
- mEngine(engine),
- mCurrentService(VideoServices::ENoService),
- mSortRole(0)
+VideoServices::VideoServices( VideoPlayerEngine* engine )
+ : mReferenceCount( 0 )
+ , mEngine( engine )
+ , mCurrentService( VideoServices::ENoService )
+ , mSortRole( 0 )
{
- mServiceUriFetch = new VideoServiceUriFetch(this, QLatin1String("TestListView"));
- mServiceBrowse = new VideoServiceBrowse(this, QLatin1String("TestListView"));
+ mServiceUriFetch = new VideoServiceUriFetch( this, QLatin1String("TestListView") );
+ mServiceBrowse = new VideoServiceBrowse( this, QLatin1String("TestListView") );
}
VideoServices::~VideoServices()
@@ -89,7 +93,7 @@
{
int category = 0;
- if (mServiceBrowse)
+ if ( mServiceBrowse )
{
category = mServiceBrowse->getBrowseCategory();
}
@@ -97,7 +101,7 @@
return category;
}
-void VideoServices::setCurrentService(VideoServices::TVideoService service)
+void VideoServices::setCurrentService( VideoServices::TVideoService service )
{
mCurrentService = service;
}
@@ -114,7 +118,7 @@
return mSortRole;
}
-void VideoServices::itemSelected(const QString& item)
+void VideoServices::itemSelected( const QString& item )
{
Q_UNUSED(item);
// not stubbed
--- a/videocollection/tsrc/stubs/src/videothumbnaildata.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/tsrc/stubs/src/videothumbnaildata.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -23,6 +23,7 @@
int VideoThumbnailTestData::mFreeThumbnailDataCallCount = 0;
int VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled = 0;
int VideoThumbnailTestData::mStartBackgroundFetchingCallCount = 0;
+int VideoThumbnailTestData::mFetchIndex = -1;
VideoThumbnailData &VideoThumbnailData::instance()
{
@@ -62,9 +63,8 @@
void VideoThumbnailData::startBackgroundFetching(VideoSortFilterProxyModel *model, int fetchIndex)
{
Q_UNUSED(model);
- Q_UNUSED(fetchIndex);
-
VideoThumbnailTestData::mStartBackgroundFetchingCallCount++;
+ VideoThumbnailTestData::mFetchIndex = fetchIndex;
}
void VideoThumbnailData::enableBackgroundFetching(bool enable)
--- a/videocollection/tsrc/stubs/stubs.pro Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/tsrc/stubs/stubs.pro Thu Jul 08 13:05:19 2010 +0300
@@ -34,6 +34,7 @@
inc/videoservicebrowse.h \
inc/xqserviceutilstub.h \
inc/xqserviceproviderstub.h \
+ inc/xqsettingsmanagerstub.h \
inc/testobjectstore.h \
inc/hbabstractitemview.h \
inc/hbdocumentloader.h \
@@ -61,6 +62,7 @@
inc/hbstackedwidget.h \
inc/hbstyleloader.h \
inc/hbtoolbar.h \
+ inc/hbtoolbarextension.h \
inc/hbwidget.h \
inc/hbview.h \
inc/hbeffect.h \
@@ -78,6 +80,7 @@
inc/videothumbnailtestdata.h \
inc/videoactivitystate.h \
inc/xqserviceutilxtra.h \
+ inc/videooperatorservicedata.h \
# We need stub for this because it has static data and HW compilation of moc file fails because of that.
inc/videoservices.h \
../../videocollectionview/inc/videocollectionuiloader.h \
@@ -89,7 +92,8 @@
../../videocollectionwrapper/inc/videolistdatamodel.h \
../../videocollectionwrapper/inc/videocollectionwrapper.h \
../../videocollectionwrapper/inc/videosortfilterproxymodel.h \
- ../../videocollectionwrapper/inc/videothumbnaildata.h
+ ../../videocollectionwrapper/inc/videothumbnaildata.h \
+ ../../videocollectionview/inc/videooperatorservice.h
SOURCES_TEMP = \
src/xqserviceprovider.cpp \
@@ -110,6 +114,8 @@
src/hbscrollbar.cpp \
src/hbstackedwidget.cpp \
src/hbstyleloader.cpp \
+ src/hbtoolbar.cpp \
+ src/hbtoolbarextension.cpp \
src/hbwidget.cpp \
src/hbview.cpp \
src/hbeffect.cpp \
@@ -128,7 +134,8 @@
src/videoservices.cpp \
src/videoserviceurifetch.cpp \
src/videoservicebrowse.cpp \
- src/videoactivitystate.cpp
+ src/videoactivitystate.cpp \
+ src/videooperatorservice.cpp
HEADERS += $$find(HEADERS_TEMP, ^(?!.*$$TESTEDCLASS).*$)
SOURCES += $$find(SOURCES_TEMP, ^(?!.*$$TESTEDCLASS).*$)
Binary file videocollection/videocollectionview/conf/videolistview_2002BC63.crml has changed
Binary file videocollection/videocollectionview/conf/videoplayerservicelist.confml has changed
--- a/videocollection/videocollectionview/data/collectionview.docml Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/videocollectionview/data/collectionview.docml Thu Jul 08 13:05:19 2010 +0300
@@ -76,19 +76,11 @@
<bool name="visible" value="FALSE"/>
<string locid="txt_videos_info_no_videos" name="plainText" value="(No videos)"/>
</widget>
- <widget name="vc:mHintTextLabel" type="HbLabel">
- <enums name="textWrapping" value="TextWordWrap"/>
- <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
- <sizehint height="6un" type="PREFERRED"/>
- <sizehint height="6un" type="MAXIMUM" width="2504062.01158un"/>
- <bool name="visible" value="FALSE"/>
- <string locid="txt_videos_info_to_get_videos_visit_ovi_store" name="plainText" value="To get videos, visit OVI store"/>
- </widget>
<widget name="vc:mHintButtonLayout" type="HbWidget">
<widget name="vc:mHintButton" type="HbPushButton">
<real name="z" value="1"/>
- <sizehint type="PREFERRED" width="12un"/>
- <sizehint height="6un" type="MAXIMUM" width="12un"/>
+ <sizehint type="PREFERRED"/>
+ <sizehint height="6un" type="MAXIMUM" width="2504062.01158un"/>
<bool name="visible" value="FALSE"/>
<string name="state" value="normal"/>
</widget>
@@ -106,7 +98,6 @@
<layout orientation="Vertical" type="linear">
<stretchitem stretchfactor="1"/>
<linearitem itemname="vc:mNoVideosLabel"/>
- <linearitem itemname="vc:mHintTextLabel"/>
<linearitem itemname="vc:mHintButtonLayout"/>
<stretchitem stretchfactor="1"/>
</layout>
--- a/videocollection/videocollectionview/data/videocollectionview.qrc Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/videocollectionview/data/videocollectionview.qrc Thu Jul 08 13:05:19 2010 +0300
@@ -1,6 +1,6 @@
<RCC>
<qresource prefix="/layout" >
- <file alias="collectionview.docml">collectionview.docml</file>
+ <file alias="collectionview.docml">collectionview.docml.bin</file>
<file alias="videolistselectiondialog.docml">videolistselectiondialog.docml</file>
</qresource>
<qresource prefix="/style" >
--- a/videocollection/videocollectionview/inc/videocollectionuiloaderdef.h Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/videocollectionview/inc/videocollectionuiloaderdef.h Thu Jul 08 13:05:19 2010 +0300
@@ -46,7 +46,6 @@
// Videocollection hint widget
static const char* DOCML_NAME_HINT_BUTTON = "vc:mHintButton";
-static const char* DOCML_NAME_HINT_LABEL = "vc:mHintTextLabel";
static const char* DOCML_NAME_NO_VIDEOS_LABEL = "vc:mNoVideosLabel";
// video multiselection dialog
--- a/videocollection/videocollectionview/inc/videocollectionviewutils.h Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/videocollectionview/inc/videocollectionviewutils.h Thu Jul 08 13:05:19 2010 +0300
@@ -19,6 +19,7 @@
#define __VIDEOCOLLECTIONVIEWUTILS_H__
#include <qobject.h>
+#include <qvariant.h>
#include "videocollectioncommon.h"
class HbListView;
@@ -57,21 +58,22 @@
int loadSortingValues(int& role, Qt::SortOrder& order, VideoCollectionCommon::TCollectionLevels target);
/**
- * Get service icon resource strings from cenrep.
+ * Get string value for a key from central repository.
*
- * @param icon On return contains the resource string for icon image.
- * @param iconPressed On return contains the resource string for pressed icon image.
- * @return Zero if operation succeeded, less than zero in error cases.
+ * @param key Video collection central repository key.
+ * @return String stored in central repository. Empty string in error cases.
*/
- int getServiceIconStrings(QString& icon, QString& iconPressed);
+ QString getCenRepStringValue(int key);
/**
- * Get service URI string.
+ * Get int value for a key from central repository.
*
- * @return Service URI string. Invalid string in error cases.
+ * @param key Video collection central repository key.
+ * @param value Contains the read integer from cenrep at return.
+ * @return Application UID if operation succeeded, less than zero in error cases.
*/
- QString getServiceUriString();
-
+ int getCenRepIntValue(int key);
+
public:
/**
* Initializes list view for collection and selection dialog with common
--- a/videocollection/videocollectionview/inc/videohintwidget.h Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/videocollectionview/inc/videohintwidget.h Thu Jul 08 13:05:19 2010 +0300
@@ -59,9 +59,8 @@
* Method creates colleciton wrapper, grid and list views,
* layout and activates correct view based on the current orientation
*
- * @return int 0 initialization ok, < 0 if fails.
*/
- int initialize();
+ void initialize();
/**
* Sets the level where the hint is correctly. Hint displays differently in
@@ -108,21 +107,6 @@
* Pointer to the XML UI (DocML) loader, not owned
*/
VideoCollectionUiLoader *mUiLoader;
-
- /**
- * Service icon resource string.
- */
- QString mServiceIconString;
-
- /**
- * Service icon pressed resource string.
- */
- QString mServiceIconPressedString;
-
- /**
- * Service icon.
- */
- HbIcon *mServiceIcon;
/**
* Current hint level.
@@ -138,7 +122,11 @@
* true if widget has been activated.
*/
bool mActivated;
-
+
+ /**
+ * Localized text for the service button.
+ */
+ QString mHintText;
};
#endif // VIDEOHINTWIDGET_H
--- a/videocollection/videocollectionview/inc/videolistview.h Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/videocollectionview/inc/videolistview.h Thu Jul 08 13:05:19 2010 +0300
@@ -39,6 +39,8 @@
class HbMenu;
class VideoServices;
class TMPXItemId;
+class HbToolBarExtension;
+class VideoOperatorService;
/**
* Class acts as an container for widgets that are used to display different
@@ -163,13 +165,12 @@
void openCollectionViewSlot();
/**
- * Slot is connected into toolbar's Service tab's
- * triggered signal.
+ * Slot is connected into hint widget's button's clicked signal.
*
- * Activates Service widget by calling changeWidget.
+ * Activates first operator service.
*
*/
- void openServicesViewSlot();
+ void openOperatorServiceSlot();
/**
* Slot is connected into main menus sort -items
@@ -285,6 +286,21 @@
int createToolbar();
/**
+ * Loads video services from central respository and creates toolbar buttons for them.
+ */
+ void createOperatorServicesToolbar();
+
+ /**
+ * Loads video service from Central Repository and stores it into member array.
+ *
+ * @param titleKey CenRep key for service title.
+ * @param iconKey CenRep key for icon resource.
+ * @param uriKey CenRep key for service URI.
+ * @param uidKey CenRep key for service application UID.
+ */
+ void loadOperatorService(int titleKey, int iconKey, int uriKey, int uidKey);
+
+ /**
* Creates action with given parameters. createActionGroup() must be called successfully
* before using this method.
*
@@ -339,7 +355,7 @@
private:
/**
- * actions ids used in main menu and tool bar
+ * Actions ids used in main menu and tool bar
*/
enum TViewActionIds
{
@@ -351,12 +367,12 @@
};
/**
- * reference to video collection view utils
+ * Reference to video collection view utils
*/
VideoCollectionViewUtils &mUiUtils;
/**
- * pointer to videocollectionwrapper
+ * Reference to videocollectionwrapper
*/
VideoCollectionWrapper &mWrapper;
@@ -381,7 +397,7 @@
VideoHintWidget::HintLevel mHintLevel;
/**
- * pointer to videoservices instance
+ * Pointer to videoservices instance
* if exists, app has started as service
*/
VideoServices* mVideoServices;
@@ -402,12 +418,12 @@
QActionGroup* mToolbarCollectionActionGroup;
/**
- * map containing toolbar actions
+ * Map containing toolbar actions
*/
QMap<TViewActionIds, HbAction*> mToolbarActions;
/**
- * Soring roles mapped to appropriate actions.
+ * Sorting roles mapped to appropriate actions.
*/
QMap<HbAction*, int> mSortingRoles;
@@ -415,7 +431,17 @@
* String containing the name of the currently open collection
*/
QString mCollectionName;
+
+ /**
+ * Toolbar extension for operator services when there's more than
+ * one of them.
+ */
+ HbToolBarExtension *mToolbarServiceExtension;
+
+ /**
+ * List of operator services.
+ */
+ QList<VideoOperatorService *> mVideoOperatorServices;
};
#endif // VIDEOLISTVIEW_H
-
--- a/videocollection/videocollectionview/inc/videolistwidget.h Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/videocollectionview/inc/videolistwidget.h Thu Jul 08 13:05:19 2010 +0300
@@ -131,6 +131,26 @@
* @param mode
*/
void setSelectionMode(int mode);
+
+protected:
+
+ /**
+ * Derived from HbListView. Starts fetching thumbnails when rows are inserted.
+ *
+ * @param parent
+ * @param start
+ * @param end
+ */
+ void rowsInserted(const QModelIndex &parent, int start, int end);
+
+ /**
+ * Derived from HbListView. Starts fetching thumbnails when rows are removed.
+ *
+ * @param parent
+ * @param start
+ * @param end
+ */
+ void rowsRemoved(const QModelIndex &parent, int start, int end);
signals:
@@ -165,12 +185,12 @@
/**
* Signaled by HbMessageBox when it's closed.
*/
- void deleteItemDialogFinished(HbAction *action);
+ void deleteItemDialogFinished(int action);
/**
* Signaled by HbMessageBox when it's closed.
*/
- void removeCollectionDialogFinished(HbAction *action);
+ void removeCollectionDialogFinished(int action);
/**
* called or signaled when delayed initialization is reauired for the widget
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/videocollectionview/inc/videooperatorservice.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,106 @@
+/*
+* 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: VideoOperatorService class declaration.
+*
+*/
+
+
+#ifndef VIDEOOPERATORSERVICE_H
+#define VIDEOOPERATORSERVICE_H
+
+#include <qobject.h>
+
+class HbPushButton;
+
+/**
+ * Loading and launching functionality for operator customisable services.
+ */
+class VideoOperatorService : public QObject
+{
+ Q_OBJECT
+
+public:
+
+ /**
+ * Contructor.
+ *
+ * @param parent parent of this widget
+ */
+ VideoOperatorService(QObject *parent = 0);
+
+ /**
+ * Loads the service.
+ *
+ * @titleKey Central Repository key id for the service's title.
+ * @iconKey Central Repository key id for the service's icon resource.
+ * @uriKey Central Repository key id for the service's URI.
+ * @uidKey Central Repository key id for the service's UID.
+ *
+ * @return True if service was loaded succesfully.
+ */
+ bool load(int titleKey, int iconKey, int uriKey, int uidKey);
+
+ /**
+ * Returns name for the service.
+ *
+ * @return name of the service.
+ */
+ const QString title() const;
+
+ /**
+ * Returns the icon resource for the service.
+ *
+ * @return path or resource id to the icon.
+ */
+ const QString iconResource() const;
+
+private:
+
+ void launchApplicationL(const TUid uid, TInt viewId);
+
+public slots:
+
+ /**
+ * Launches the service.
+ */
+ void launchService();
+
+private:
+
+ Q_DISABLE_COPY(VideoOperatorService)
+
+ /**
+ * Title for the service.
+ */
+ QString mTitle;
+
+ /**
+ * Icon for the service.
+ */
+ QString mIconResource;
+
+ /**
+ * Service URL if service should launch an URL.
+ */
+ QString mServiceUri;
+
+ /**
+ * Application UID if service should launch an external application.
+ */
+ int mApplicationUid;
+};
+
+#endif // VIDEOOPERATORSERVICE_H
+
+// End of file.
--- a/videocollection/videocollectionview/src/videocollectionviewutils.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/videocollectionview/src/videocollectionviewutils.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 43 %
+// Version : %version: 45 %
// INCLUDE FILES
#include <hbglobal.h>
@@ -25,6 +25,8 @@
#include <hbdialog.h>
#include <hbmessagebox.h>
#include <hbnotificationdialog.h>
+#include <hbparameterlengthlimiter.h>
+#include <xqsettingsmanager.h>
#include <centralrepository.h>
#include <vcxmyvideosdefs.h>
@@ -196,59 +198,34 @@
}
// ---------------------------------------------------------------------------
-// getServiceIconStrings
+// getCenrepStringValue
// ---------------------------------------------------------------------------
//
-int VideoCollectionViewUtils::getServiceIconStrings(QString& icon,
- QString& iconPressed)
+QString VideoCollectionViewUtils::getCenRepStringValue(int key)
{
- FUNC_LOG;
- int status = -1;
- CRepository *cenRep = 0;
- TRAP_IGNORE(cenRep = CRepository::NewL(TUid::Uid(KVideoCollectionViewCenrepUid)));
- if(cenRep)
- {
- TBuf<255> iconValue;
- TBuf<255> pressedValue;
- status = cenRep->Get(KVideoCollectionViewCenrepServiceItem1IconPath, iconValue);
- if(status == KErrNone)
- {
- status = cenRep->Get(KVideoCollectionViewCenrepServiceItem1PressedIconPath, pressedValue);
- if(status == KErrNone)
- {
- QString iconTemp((QChar*)iconValue.Ptr(),iconValue.Length());
- QString pressedTemp((QChar*)pressedValue.Ptr(),pressedValue.Length());
-
- icon = iconTemp;
- iconPressed = pressedTemp;
- }
- }
- delete cenRep;
- }
- return status;
+ FUNC_LOG;
+ XQCentralRepositorySettingsKey crKey(KVideoCollectionViewCenrepUid, key);
+ XQSettingsManager mgr;
+ QVariant value = mgr.readItemValue(crKey, XQSettingsManager::TypeString);
+ return value.toString();
}
// ---------------------------------------------------------------------------
-// getServiceUriString
+// getCenRepIntValue
// ---------------------------------------------------------------------------
//
-QString VideoCollectionViewUtils::getServiceUriString()
+int VideoCollectionViewUtils::getCenRepIntValue(int key)
{
- FUNC_LOG;
- QString uri;
- CRepository *cenRep = 0;
- TRAP_IGNORE(cenRep = CRepository::NewL(TUid::Uid(KVideoCollectionViewCenrepUid)));
- if(cenRep)
+ FUNC_LOG;
+ XQCentralRepositorySettingsKey crKey(KVideoCollectionViewCenrepUid, key);
+ XQSettingsManager mgr;
+ QVariant value = mgr.readItemValue(crKey, XQSettingsManager::TypeInt);
+ int uid = -1;
+ if(value.isValid())
{
- TBuf<255> uriValue;
- if(cenRep->Get(KVideoCollectionViewCenrepServiceItem1Url, uriValue) == KErrNone)
- {
- QString uriTemp((QChar*)uriValue.Ptr(),uriValue.Length());
- uri = uriTemp;
- }
- delete cenRep;
+ uid = value.toInt();
}
- return uri;
+ return uid;
}
// ---------------------------------------------------------------------------
@@ -421,7 +398,7 @@
format = hbTrId("txt_videos_info_unable_to_delete_1_it_is_current");
if(additional.isValid())
{
- msg = format.arg(additional.toString());
+ msg = HbParameterLengthLimiter(format).arg(additional.toString());
}
break;
case VideoCollectionCommon::statusMultipleDeleteFail:
--- a/videocollection/videocollectionview/src/videohintwidget.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/videocollectionview/src/videohintwidget.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 14 %
+// Version : %version: 15 %
// INCLUDE FILES
#include <hbpushbutton.h>
@@ -26,6 +26,7 @@
#include "videohintwidget.h"
#include "videocollectionuiloader.h"
#include "videocollectionviewutils.h"
+#include "videocollectioncenrepdefs.h"
#include "videocollectiontrace.h"
// ---------------------------------------------------------------------------
@@ -35,7 +36,6 @@
VideoHintWidget::VideoHintWidget( VideoCollectionUiLoader *uiLoader, QGraphicsItem *parent )
: HbWidget( parent )
, mUiLoader( uiLoader )
- , mServiceIcon( 0 )
, mCurrentLevel( AllVideos )
, mButtonShown( false )
, mActivated( false )
@@ -51,18 +51,22 @@
VideoHintWidget::~VideoHintWidget()
{
FUNC_LOG;
- delete mServiceIcon;
}
// ---------------------------------------------------------------------------
// initialize
// ---------------------------------------------------------------------------
//
-int VideoHintWidget::initialize()
+void VideoHintWidget::initialize()
{
FUNC_LOG;
VideoCollectionViewUtils& utils = VideoCollectionViewUtils::instance();
- return utils.getServiceIconStrings(mServiceIconString, mServiceIconPressedString);
+
+ QString textId = utils.getCenRepStringValue(KVideoCollectionViewCenrepServiceItem1Text);
+ if(!textId.isEmpty())
+ {
+ mHintText = hbTrId(textId.toLatin1().constData());
+ }
}
// ---------------------------------------------------------------------------
@@ -118,15 +122,6 @@
mainWnd, SIGNAL(orientationChanged(Qt::Orientation)),
this, SLOT(orientationChangedSlot(Qt::Orientation)));
- if(!mServiceIconString.isEmpty())
- {
- mServiceIcon = new HbIcon(mServiceIconString);
- }
- if(mServiceIcon && !mServiceIconPressedString.isEmpty())
- {
- mServiceIcon->setIconName(mServiceIconPressedString, QIcon::Normal, QIcon::On);
- }
-
updateUiComponents();
setVisible(true);
@@ -152,17 +147,6 @@
disconnect(
mainWnd, SIGNAL(orientationChanged(Qt::Orientation)),
this, SLOT(orientationChangedSlot(Qt::Orientation)));
-
- HbPushButton *serviceButton =
- mUiLoader->findWidget<HbPushButton>(
- DOCML_NAME_HINT_BUTTON);
- if (serviceButton)
- {
- serviceButton->setIcon(HbIcon());
- }
-
- delete mServiceIcon;
- mServiceIcon = 0;
}
}
@@ -176,28 +160,24 @@
HbMainWindow *mainWnd = hbInstance->allMainWindows().value(0);
if (mainWnd)
{
- HbPushButton *serviceButton =
+ HbPushButton *hintButton =
mUiLoader->findWidget<HbPushButton>(
DOCML_NAME_HINT_BUTTON);
- HbLabel *hintLabel =
- mUiLoader->findWidget<HbLabel>(
- DOCML_NAME_HINT_LABEL);
HbLabel *noVideosLabel =
mUiLoader->findWidget<HbLabel>(
DOCML_NAME_NO_VIDEOS_LABEL);
- if (serviceButton && hintLabel && noVideosLabel)
+ if (hintButton && noVideosLabel)
{
noVideosLabel->setVisible(true);
- if (mServiceIcon && mCurrentLevel == AllVideos)
+
+ if (mCurrentLevel == AllVideos && !mHintText.isEmpty())
{
- hintLabel->setVisible(true);
- serviceButton->setIcon(*mServiceIcon);
- serviceButton->setVisible(mButtonShown);
+ hintButton->setText(mHintText);
+ hintButton->setVisible(mButtonShown);
}
else
{
- hintLabel->setVisible(false);
- serviceButton->setVisible(false);
+ hintButton->setVisible(false);
}
}
}
--- a/videocollection/videocollectionview/src/videolistview.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/videocollectionview/src/videolistview.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 113 %
+// Version : %version: 113.1.1 %
// INCLUDE FILES
#include <xqserviceutil.h>
@@ -32,6 +32,8 @@
#include <hbgroupbox.h>
#include <hbpushbutton.h>
#include <hbinputdialog.h>
+#include <hbparameterlengthlimiter.h>
+#include <hbtoolbarextension.h>
#include <vcxmyvideosdefs.h>
#include "videoservices.h"
@@ -45,10 +47,13 @@
#include "videosortfilterproxymodel.h"
#include "videocollectionuiloader.h"
#include "mpxhbvideocommondefs.h"
+#include "videooperatorservice.h"
+#include "videocollectioncenrepdefs.h"
#include "videocollectiontrace.h"
// Object names.
const char* const LIST_VIEW_OBJECT_NAME_OPTIONS_MENU = "vc::ListViewOptionsMenu";
+const char* const LIST_VIEW_OBJECT_NAME_TOOLBAR_EXTENSION = "vc::ListViewToolbarExtension";
// ---------------------------------------------------------------------------
// Constructor
@@ -66,6 +71,7 @@
, mCurrentList( 0 )
, mToolbarViewsActionGroup( 0 )
, mToolbarCollectionActionGroup( 0 )
+ , mToolbarServiceExtension( 0 )
{
FUNC_LOG;
}
@@ -83,11 +89,22 @@
mToolbarActions.clear();
mSortingRoles.clear();
+ delete mToolbarServiceExtension;
+ mToolbarServiceExtension = 0;
+
if(mVideoServices)
{
mVideoServices->decreaseReferenceCount();
mVideoServices = 0;
}
+
+ QList<VideoOperatorService *>::const_iterator iter = mVideoOperatorServices.constBegin();
+ while(iter != mVideoOperatorServices.constEnd())
+ {
+ delete *iter;
+ iter++;
+ }
+ mVideoOperatorServices.clear();
}
// ---------------------------------------------------------------------------
@@ -500,9 +517,10 @@
if (!mVideoServices)
{
- // Services tab
- mToolbarActions[ETBActionServices] = createAction("qtg_mono_ovistore",
- mToolbarViewsActionGroup, SLOT(openServicesViewSlot()));
+ // Create services button or toolbar extension depending how many operator
+ // services are configured.
+ createOperatorServicesToolbar();
+
// Add Videos tab
mToolbarActions[ETBActionAddVideos] =
createAction("qtg_mono_add_to_video_collection",
@@ -519,14 +537,12 @@
if( !bar
|| !mToolbarActions[ETBActionAllVideos]
|| !mToolbarActions[ETBActionCollections]
- || ( !mVideoServices && (!mToolbarActions[ETBActionServices]
- || !mToolbarActions[ETBActionAddVideos]
- || !mToolbarActions[ETBActionRemoveVideos])))
+ || ( !mVideoServices && (!mToolbarActions[ETBActionAddVideos]
+ || !mToolbarActions[ETBActionRemoveVideos])))
{
ERROR(-1, "VideoListView::createToolbar() failed to create all actions or the toolbar.");
delete mToolbarActions[ETBActionAllVideos];
delete mToolbarActions[ETBActionCollections];
- delete mToolbarActions[ETBActionServices];
delete mToolbarActions[ETBActionAddVideos];
delete mToolbarActions[ETBActionRemoveVideos];
return -1;
@@ -536,7 +552,7 @@
mToolbarActions[ETBActionAllVideos]->setCheckable(true);
mToolbarActions[ETBActionCollections]->setCheckable(true);
- if (!mVideoServices)
+ if(!mVideoServices && mToolbarActions[ETBActionServices])
{
mToolbarActions[ETBActionServices]->setCheckable(false);
}
@@ -559,13 +575,98 @@
{
bar->addActions(mToolbarCollectionActionGroup->actions());
}
-
+
+ if(mToolbarServiceExtension && (level == VideoCollectionCommon::ELevelCategory
+ || level == VideoCollectionCommon::ELevelVideos))
+ {
+ HbAction *action = bar->addExtension(mToolbarServiceExtension);
+ HbIcon icon("qtg_mono_video_services");
+ action->setIcon(icon);
+ }
}
return 0;
}
// ---------------------------------------------------------------------------
+// createOperatorServicesToolbar()
+// ---------------------------------------------------------------------------
+//
+void VideoListView::createOperatorServicesToolbar()
+{
+ FUNC_LOG;
+ if(mVideoOperatorServices.count() > 0)
+ {
+ return;
+ }
+
+ // Load services.
+
+ loadOperatorService(KVideoCollectionViewCenrepServiceItem1Title, KVideoCollectionViewCenrepServiceItem1ToolbarIconPath,
+ KVideoCollectionViewCenrepServiceItem1Url, KVideoCollectionViewCenrepServiceItem1Uid);
+
+ loadOperatorService(KVideoCollectionViewCenrepServiceItem2Title, KVideoCollectionViewCenrepServiceItem2ToolbarIconPath,
+ KVideoCollectionViewCenrepServiceItem2Url, KVideoCollectionViewCenrepServiceItem2Uid);
+
+ loadOperatorService(KVideoCollectionViewCenrepServiceItem3Title, KVideoCollectionViewCenrepServiceItem3ToolbarIconPath,
+ KVideoCollectionViewCenrepServiceItem3Url, KVideoCollectionViewCenrepServiceItem3Uid);
+
+ loadOperatorService(KVideoCollectionViewCenrepServiceItem4Title, KVideoCollectionViewCenrepServiceItem4ToolbarIconPath,
+ KVideoCollectionViewCenrepServiceItem4Url, KVideoCollectionViewCenrepServiceItem4Uid);
+
+ loadOperatorService(KVideoCollectionViewCenrepServiceItem5Title, KVideoCollectionViewCenrepServiceItem5ToolbarIconPath,
+ KVideoCollectionViewCenrepServiceItem5Url, KVideoCollectionViewCenrepServiceItem5Uid);
+
+ loadOperatorService(KVideoCollectionViewCenrepServiceItem6Title, KVideoCollectionViewCenrepServiceItem6ToolbarIconPath,
+ KVideoCollectionViewCenrepServiceItem6Url, KVideoCollectionViewCenrepServiceItem6Uid);
+
+ // Create toolbar extension when there's multiple services.
+ if(mVideoOperatorServices.count() > 1 && !mToolbarServiceExtension)
+ {
+ mToolbarServiceExtension = new HbToolBarExtension();
+ mToolbarServiceExtension->setObjectName(LIST_VIEW_OBJECT_NAME_TOOLBAR_EXTENSION);
+
+ QList<VideoOperatorService *>::const_iterator iter = mVideoOperatorServices.constBegin();
+ while(iter != mVideoOperatorServices.constEnd())
+ {
+ HbIcon icon((*iter)->iconResource());
+ HbAction *action = mToolbarServiceExtension->addAction(icon, (*iter)->title(),
+ (*iter), SLOT(launchService()));
+ action->setObjectName((*iter)->title());
+ iter++;
+ }
+ }
+
+ // Add toolbar button when there's only one service.
+ if(mVideoOperatorServices.count() == 1)
+ {
+ VideoOperatorService *service = mVideoOperatorServices[0];
+ mToolbarActions[ETBActionServices] = createAction(service->iconResource(),
+ mToolbarViewsActionGroup, 0 /*do not connect to any slot*/);
+ connect(mToolbarActions[ETBActionServices], SIGNAL(triggered()), service, SLOT(launchService()));
+ }
+}
+
+// ---------------------------------------------------------------------------
+// loadOperatorService()
+// ---------------------------------------------------------------------------
+//
+void VideoListView::loadOperatorService(int titleKey, int iconKey, int uriKey, int uidKey)
+{
+ FUNC_LOG;
+ VideoOperatorService *service = new VideoOperatorService();
+ if(service->load(titleKey, iconKey, uriKey, uidKey))
+ {
+ mVideoOperatorServices.append(service);
+ }
+ else
+ {
+ // Load failed, delete service data.
+ delete service;
+ }
+}
+
+// ---------------------------------------------------------------------------
// createAction()
// ---------------------------------------------------------------------------
//
@@ -578,13 +679,16 @@
HbIcon hbIcon(icon);
action->setIcon(hbIcon);
- if(!connect(action, SIGNAL(triggered()), this, slot)) {
- // actiongroup deletion deletes this also.
- // return 0 tells that there was a problem in creation to caller.
- delete action;
- return 0;
+ if(slot)
+ {
+ if(!connect(action, SIGNAL(triggered()), this, slot)) {
+ // actiongroup deletion deletes this also.
+ // return 0 tells that there was a problem in creation to caller.
+ delete action;
+ return 0;
+ }
}
-
+
return action;
}
@@ -712,7 +816,8 @@
}
else
{
- subLabel->setHeading(hbTrId("txt_videos_subtitle_1_l2").arg(mCollectionName).arg(itemCount));
+ QString text = HbParameterLengthLimiter(hbTrId("txt_videos_subtitle_1_l2")).arg(mCollectionName).arg(itemCount);
+ subLabel->setHeading(text);
}
}
}
@@ -904,13 +1009,17 @@
}
// ---------------------------------------------------------------------------
-// openservicesViewSlot()
+// openOperatorServiceSlot()
// ---------------------------------------------------------------------------
//
-void VideoListView::openServicesViewSlot()
+void VideoListView::openOperatorServiceSlot()
{
FUNC_LOG;
- debugNotImplementedYet();
+
+ if(mVideoOperatorServices.count() > 0)
+ {
+ mVideoOperatorServices[0]->launchService();
+ }
}
// ---------------------------------------------------------------------------
@@ -1394,6 +1503,13 @@
{
toolBar()->addActions(mToolbarViewsActionGroup->actions());
mToolbarActions[ETBActionCollections]->setChecked(true);
+
+ if(mToolbarServiceExtension)
+ {
+ HbAction *action = toolBar()->addExtension(mToolbarServiceExtension);
+ HbIcon icon("qtg_mono_video_services");
+ action->setIcon(icon);
+ }
}
}
// restore animations for collection content widget
@@ -1454,7 +1570,7 @@
}
else if (name.compare(DOCML_NAME_HINT_BUTTON) == 0)
{
- connect(object, SIGNAL(clicked(bool)), this, SLOT(openServicesViewSlot()));
+ connect(object, SIGNAL(clicked(bool)), this, SLOT(openOperatorServiceSlot()));
}
else if (name.compare(DOCML_NAME_SORT_BY_DATE) == 0)
{
--- a/videocollection/videocollectionview/src/videolistwidget.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/videocollectionview/src/videolistwidget.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -30,6 +30,7 @@
#include <hblistviewitem.h>
#include <hbmessagebox.h>
#include <hbinputdialog.h>
+#include <hbparameterlengthlimiter.h>
#include <vcxmyvideosdefs.h>
#include "videocollectionviewutils.h"
@@ -200,7 +201,7 @@
// Enable thumbnail background fetching.
VideoThumbnailData &thumbnailData = VideoThumbnailData::instance();
thumbnailData.enableBackgroundFetching(true);
- thumbnailData.startBackgroundFetching(mModel, 0);
+ fetchThumbnailsForVisibleItems();
return 0;
}
@@ -380,13 +381,14 @@
if (variant.isValid())
{
- QString text = hbTrId("txt_videos_info_do_you_want_to_delete_1").arg(
- variant.toString());
+ QString text = HbParameterLengthLimiter(
+ hbTrId("txt_videos_info_do_you_want_to_delete_1")).arg(variant.toString());
HbMessageBox *messageBox = new HbMessageBox(text, HbMessageBox::MessageTypeQuestion);
+ messageBox->setStandardButtons(HbMessageBox::Yes | HbMessageBox::No);
messageBox->setAttribute(Qt::WA_DeleteOnClose);
messageBox->setObjectName(LIST_WIDGET_OBJECT_NAME_DELETE_VIDEO);
- messageBox->open(this, SLOT(deleteItemDialogFinished(HbAction *)));
+ messageBox->open(this, SLOT(deleteItemDialogFinished(int)));
}
}
@@ -394,10 +396,9 @@
// deleteItemDialogFinished
// ---------------------------------------------------------------------------
//
-void VideoListWidget::deleteItemDialogFinished(HbAction *action)
+void VideoListWidget::deleteItemDialogFinished(int action)
{
- HbMessageBox *dlg = static_cast<HbMessageBox*>(sender());
- if(action == dlg->actions().at(0))
+ if(action == HbMessageBox::Yes)
{
QModelIndex index = currentIndex();
if(index.isValid())
@@ -897,12 +898,14 @@
if (variant.isValid())
{
- QString text = hbTrId("txt_videos_info_do_you_want_to_remove_collection").arg(
- variant.toString());
+ QString text = HbParameterLengthLimiter(
+ hbTrId("txt_videos_info_do_you_want_to_remove_collection")).arg(variant.toString());
+
HbMessageBox *messageBox = new HbMessageBox(text, HbMessageBox::MessageTypeQuestion);
+ messageBox->setStandardButtons(HbMessageBox::Yes | HbMessageBox::No);
messageBox->setAttribute(Qt::WA_DeleteOnClose);
- messageBox->setObjectName(LIST_WIDGET_OBJECT_NAME_REMOVE_COLLECTION);
- messageBox->open(this, SLOT(removeCollectionDialogFinished(HbAction *)));
+ messageBox->setObjectName(LIST_WIDGET_OBJECT_NAME_REMOVE_COLLECTION);
+ messageBox->open(this, SLOT(removeCollectionDialogFinished(int)));
}
}
@@ -910,10 +913,9 @@
// removeCollectionDialogFinished
// ---------------------------------------------------------------------------
//
-void VideoListWidget::removeCollectionDialogFinished(HbAction *action)
+void VideoListWidget::removeCollectionDialogFinished(int action)
{
- HbMessageBox *dlg = static_cast<HbMessageBox*>(sender());
- if(action == dlg->actions().at(0))
+ if(action == HbMessageBox::Yes)
{
QModelIndex index = currentIndex();
if(index.isValid())
@@ -1014,6 +1016,39 @@
int row = itemsVisible.value(0)->modelIndex().row();
VideoThumbnailData::instance().startBackgroundFetching(mModel, row);
}
+ else
+ {
+ // Nothing visible yet, start from first index.
+ VideoThumbnailData::instance().startBackgroundFetching(mModel, 0);
+ }
+}
+
+// ---------------------------------------------------------------------------
+// rowsInserted
+// ---------------------------------------------------------------------------
+//
+void VideoListWidget::rowsInserted(const QModelIndex &parent, int start, int end)
+{
+ FUNC_LOG_ADDR(this);
+ Q_UNUSED(parent);
+ Q_UNUSED(start);
+ Q_UNUSED(end);
+ fetchThumbnailsForVisibleItems();
+ HbListView::rowsInserted(parent, start, end);
+}
+
+// ---------------------------------------------------------------------------
+// rowsRemoved
+// ---------------------------------------------------------------------------
+//
+void VideoListWidget::rowsRemoved(const QModelIndex &parent, int start, int end)
+{
+ FUNC_LOG_ADDR(this);
+ Q_UNUSED(parent);
+ Q_UNUSED(start);
+ Q_UNUSED(end);
+ fetchThumbnailsForVisibleItems();
+ HbListView::rowsRemoved(parent, start, end);
}
// end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/videocollectionview/src/videooperatorservice.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,158 @@
+/*
+* 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: VideoOperatorService class implementation.
+*
+*/
+
+// Version :
+
+// INCLUDE FILES
+
+#include <qdesktopservices.h>
+#include <qurl.h>
+
+#include <e32base.h>
+#include <eikenv.h>
+#include <eikappui.h>
+#include <apgcli.h>
+
+#include "videooperatorservice.h"
+#include "videocollectionviewutils.h"
+#include "videocollectioncenrepdefs.h"
+#include "videocollectiontrace.h"
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+VideoOperatorService::VideoOperatorService(QObject *parent) :
+ QObject(parent)
+{
+ FUNC_LOG;
+}
+
+// ---------------------------------------------------------------------------
+// load
+// ---------------------------------------------------------------------------
+//
+bool VideoOperatorService::load(int titleKey, int iconKey, int serviceUriKey, int appUidKey)
+{
+ FUNC_LOG;
+ VideoCollectionViewUtils& utils = VideoCollectionViewUtils::instance();
+
+ mTitle = utils.getCenRepStringValue(titleKey);
+ mIconResource = utils.getCenRepStringValue(iconKey);
+ mServiceUri = utils.getCenRepStringValue(serviceUriKey);
+ mApplicationUid = utils.getCenRepIntValue(appUidKey);
+
+ // Icon is required, either service uri or application uid is required.
+ if(mIconResource.isEmpty() && (mServiceUri.isEmpty() || mApplicationUid > 0))
+ {
+ return false;
+ }
+
+ return true;
+}
+
+// ---------------------------------------------------------------------------
+// title
+// ---------------------------------------------------------------------------
+//
+const QString VideoOperatorService::title() const
+{
+ return mTitle;
+}
+
+// ---------------------------------------------------------------------------
+// iconResource
+// ---------------------------------------------------------------------------
+//
+const QString VideoOperatorService::iconResource() const
+{
+ return mIconResource;
+}
+
+// ---------------------------------------------------------------------------
+// launchService
+// ---------------------------------------------------------------------------
+//
+void VideoOperatorService::launchService()
+{
+ FUNC_LOG;
+
+ if(!mServiceUri.isEmpty())
+ {
+ INFO_1("VideoOperatorService::launchService() starting url: %S", mServiceUri);
+ QDesktopServices::openUrl(QUrl(mServiceUri));
+ }
+ else
+ {
+ INFO_1("VideoOperatorService::launchService() starting application 0x%x", mApplicationUid);
+ TRAP_IGNORE(launchApplicationL(TUid::Uid(mApplicationUid), 0));
+ }
+}
+
+// ---------------------------------------------------------------------------
+// launchApplicationL
+// ---------------------------------------------------------------------------
+//
+void VideoOperatorService::launchApplicationL(const TUid uid, TInt viewId)
+{
+ CEikonEnv *eikEnv = CEikonEnv::Static();
+
+ if (viewId > 0 && eikEnv) {
+ TVwsViewId view(uid, TUid::Uid(viewId));
+ eikEnv->EikAppUi()->ActivateViewL(view);
+ } else
+ {
+ RWsSession wsSession;
+ User::LeaveIfError(wsSession.Connect());
+ CleanupClosePushL<RWsSession>(wsSession);
+
+ // TApaAppInfo size is greater then 1024 bytes
+ // so its instances should not be created on the stack.
+ TApaAppInfo* appInfo = new (ELeave) TApaAppInfo;
+ CleanupStack::PushL(appInfo);
+ TApaAppCapabilityBuf capabilityBuf;
+ RApaLsSession appArcSession;
+ User::LeaveIfError(appArcSession.Connect());
+ CleanupClosePushL<RApaLsSession>(appArcSession);
+
+ User::LeaveIfError(appArcSession.GetAppInfo(*appInfo, uid));
+ User::LeaveIfError(appArcSession.GetAppCapability(
+ capabilityBuf, uid));
+
+ TApaAppCapability &caps = capabilityBuf();
+ CApaCommandLine *cmdLine = CApaCommandLine::NewLC();
+ cmdLine->SetExecutableNameL(appInfo->iFullName);
+
+ if (caps.iLaunchInBackground) {
+ cmdLine->SetCommandL(EApaCommandBackground);
+ } else {
+ cmdLine->SetCommandL(EApaCommandRun);
+ }
+
+ cmdLine->SetTailEndL(KNullDesC8);
+
+ User::LeaveIfError(appArcSession.StartApp(*cmdLine));
+
+ CleanupStack::PopAndDestroy(cmdLine);
+ CleanupStack::PopAndDestroy(&appArcSession);
+ CleanupStack::PopAndDestroy(appInfo);
+
+ CleanupStack::PopAndDestroy(&wsSession);
+ }
+}
+
+// End of file.
--- a/videocollection/videocollectionview/tsrc/testhintwidget/src/testhintwidget.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testhintwidget/src/testhintwidget.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -105,9 +105,12 @@
mTestObject = new VideoHintWidget(mUiLoader);
}
+ mTestObject->mHintText = "Go get some!";
+
if (callInitialize)
{
- QVERIFY(mTestObject->initialize() == 0);
+ mTestObject->mHintText = "";
+ mTestObject->initialize();
}
}
@@ -135,34 +138,26 @@
VideoCollectionViewUtilsData::reset();
VideoCollectionUiLoaderData::reset();
}
-
+
// ---------------------------------------------------------------------------
// testInitialize
// ---------------------------------------------------------------------------
//
void TestHintWidget::testInitialize()
{
- // getServiceIconStrings fails and returns -1;
init(false);
- VideoCollectionViewUtilsData::mGetServiceIconStringsFails = true;
- QCOMPARE(mTestObject->initialize(), -1);
- cleanup();
+
+ // Fail
+ mTestObject->mHintText = "";
+ VideoCollectionViewUtilsData::mCenRepStringValues.append("");
+ mTestObject->initialize();
+ QVERIFY(mTestObject->mHintText.isEmpty());
+
+ // Succeed
+ VideoCollectionViewUtilsData::mCenRepStringValues.append("test");
+ mTestObject->initialize();
+ QVERIFY(!mTestObject->mHintText.isEmpty());
- // succeed
- init(false);
- VideoCollectionViewUtilsData::mGetServiceIconStringsFails = false;
- VideoCollectionViewUtilsData::mIconString = "test";
- VideoCollectionViewUtilsData::mPressedString = "test2";
- QCOMPARE(mTestObject->initialize(), 0);
- QCOMPARE(mTestObject->mServiceIconString, VideoCollectionViewUtilsData::mIconString);
- QCOMPARE(mTestObject->mServiceIconPressedString, VideoCollectionViewUtilsData::mPressedString);
-
- // second call to initialize.
- VideoCollectionViewUtilsData::mIconString = "test3";
- VideoCollectionViewUtilsData::mPressedString = "test4";
- QCOMPARE(mTestObject->initialize(), 0);
- QCOMPARE(mTestObject->mServiceIconString, VideoCollectionViewUtilsData::mIconString);
- QCOMPARE(mTestObject->mServiceIconPressedString, VideoCollectionViewUtilsData::mPressedString);
cleanup();
}
@@ -172,7 +167,7 @@
//
void TestHintWidget::testSetLevel()
{
- init(true);
+ init(false);
mTestObject->setVisible(false);
mTestObject->setLevel(VideoHintWidget::Collection);
@@ -195,29 +190,12 @@
//
void TestHintWidget::testActivate()
{
- init(true);
+ init(false);
mTestObject->setVisible(false);
- // mServiceIconString empty.
- mTestObject->mServiceIconString = QString();
- mTestObject->activate();
- QVERIFY(mTestObject->mServiceIcon == 0);
- QVERIFY(mTestObject->isVisible() == true);
- QVERIFY(mTestObject->mActivated == true);
-
- // mServiceIconPressedString empty.
- mTestObject->mServiceIconString = "test";
- mTestObject->mServiceIconPressedString = QString();
- mTestObject->activate();
- QVERIFY(mTestObject->mServiceIcon == 0);
- QVERIFY(mTestObject->isVisible() == true);
- QVERIFY(mTestObject->mActivated == true);
-
// successful case.
mTestObject->mActivated = false;
- mTestObject->mServiceIconString = "qtg_mono_ovistore";
- mTestObject->mServiceIconPressedString = "qtg_mono_ovistore";
HbLabel *noVideosLabel = mUiLoader->findWidget<HbLabel>(DOCML_NAME_NO_VIDEOS_LABEL);
QVERIFY(noVideosLabel);
@@ -225,13 +203,16 @@
mTestObject->activate();
QVERIFY(mTestObject->isVisible());
- QVERIFY(mTestObject->mServiceIcon != 0);
- QCOMPARE(mTestObject->mServiceIcon->iconName(), mTestObject->mServiceIconString);
- QCOMPARE(mTestObject->mServiceIcon->iconName(QIcon::Normal, QIcon::On),
- mTestObject->mServiceIconPressedString);
QVERIFY(noVideosLabel->isVisible()); // checks that updateUiComponents() has been called.
QVERIFY(mTestObject->mActivated == true);
+ // second call
+ noVideosLabel->setVisible(false);
+ mTestObject->activate();
+ QVERIFY(mTestObject->isVisible());
+ QVERIFY(!noVideosLabel->isVisible()); // shouldn't call updateUiComponents() again.
+ QVERIFY(mTestObject->mActivated == true);
+
cleanup();
}
@@ -241,42 +222,30 @@
//
void TestHintWidget::testDeactivate()
{
- init(true);
+ init(false);
mTestObject->setVisible(true);
mTestObject->mActivated = true;
// when serviceButton does not exist
- mTestObject->mServiceIcon = 0;
HbDocumentLoader::mFindWidgetFails = true;
mTestObject->deactivate();
QVERIFY(mTestObject->mActivated == false);
QVERIFY(mTestObject->isVisible() == false);
- // when icons are null, but servicebutton has non-null icon.
+ // service button exists
+ mTestObject->setVisible(true);
mTestObject->mActivated = true;
- mTestObject->setVisible(true);
HbDocumentLoader::mFindWidgetFails = false;
- HbPushButton *serviceButton = mUiLoader->findWidget<HbPushButton>(DOCML_NAME_HINT_BUTTON);
- QVERIFY(serviceButton);
- serviceButton->setIcon(HbIcon(QIcon(QPixmap(QSize(100,100)))));
- QVERIFY(serviceButton->icon().isNull() == false); // make sure test is valid.
mTestObject->deactivate();
- QVERIFY(serviceButton->icon().isNull());
+ QVERIFY(mTestObject->mActivated == false);
QVERIFY(mTestObject->isVisible() == false);
- // when icons are non-null, but widget is not activated.
+ // second call. widget is not active.
mTestObject->setVisible(true);
- mTestObject->mServiceIcon = new HbIcon;
mTestObject->deactivate();
- QVERIFY(mTestObject->mServiceIcon != 0);
- QVERIFY(mTestObject->isVisible() == true);
-
- // when icons are non-null and widget is activated.
- mTestObject->mActivated = true;
- mTestObject->deactivate();
- QVERIFY(mTestObject->mServiceIcon == 0);
- QVERIFY(mTestObject->isVisible() == false);
+ QVERIFY(mTestObject->mActivated == false);
+ QVERIFY(mTestObject->isVisible());
cleanup();
}
@@ -288,40 +257,39 @@
void TestHintWidget::testUpdateUiComponents()
{
HbMainWindow *mainWnd = hbInstance->allMainWindows()[0];
- mainWnd->setOrientation(Qt::Horizontal);
- init(true);
+ init(false);
- mTestObject->mServiceIcon = new HbIcon(QIcon(QPixmap(QSize(100,100))));
+ // when a widget cannot be found.
mTestObject->mActivated = true;
-
+ mTestObject->mButtonShown = true;
HbDocumentLoader::mFindWidgetFails = true;
- // when a widget cannot be found.
mTestObject->setLevel(VideoHintWidget::AllVideos);
- // no verification possible except that it doesn't crash?
+ // no verification possible except that it doesn't crash
HbDocumentLoader::mFindWidgetFails = false;
- HbLabel *hintLabel = mUiLoader->findWidget<HbLabel>(DOCML_NAME_HINT_LABEL);
+ HbLabel *hintLabel = mUiLoader->findWidget<HbLabel>(DOCML_NAME_NO_VIDEOS_LABEL);
QVERIFY(hintLabel);
HbPushButton *serviceButton = mUiLoader->findWidget<HbPushButton>(DOCML_NAME_HINT_BUTTON);
QVERIFY(serviceButton);
- mainWnd->setOrientation(Qt::Vertical);
+ // current level is all videos
+ serviceButton->setVisible(false);
mTestObject->setLevel(VideoHintWidget::AllVideos);
- QVERIFY(serviceButton->isVisible() == false);
- QVERIFY(serviceButton->icon().isNull() == false);
- QVERIFY(serviceButton->icon().qicon().cacheKey() == mTestObject->mServiceIcon->qicon().cacheKey());
QVERIFY(hintLabel->isVisible());
+ QVERIFY(serviceButton->isVisible());
- mainWnd->setOrientation(Qt::Horizontal);
- mTestObject->mButtonShown = true;
+ // current level is not all videos
+ serviceButton->setVisible(true);
mTestObject->setLevel(VideoHintWidget::Collection);
- QVERIFY(!serviceButton->isVisible());
- QVERIFY(serviceButton->icon().isNull() == false);
- QVERIFY(hintLabel->isVisible() == false);
-
- mTestObject->mButtonShown = false;
- mTestObject->setLevel(VideoHintWidget::Collection);
+ QVERIFY(hintLabel->isVisible());
+ QVERIFY(serviceButton->isVisible() == false);
+
+ // no hint text
+ serviceButton->setVisible(true);
+ mTestObject->mHintText = "";
+ mTestObject->setLevel(VideoHintWidget::AllVideos);
+ QVERIFY(hintLabel->isVisible());
QVERIFY(serviceButton->isVisible() == false);
cleanup();
@@ -340,14 +308,11 @@
mainWnd->setOrientation(Qt::Horizontal);
connect(this, SIGNAL(testSignal(Qt::Orientation)), mainWnd, SIGNAL(orientationChanged(Qt::Orientation)));
- init(true);
+ init(false);
HbLabel *noVideosLabel = mUiLoader->findWidget<HbLabel>(DOCML_NAME_NO_VIDEOS_LABEL);
QVERIFY(noVideosLabel);
- mTestObject->mServiceIconString = "dummy";
- mTestObject->mServiceIconPressedString = "dummy2";
-
// test that updateUiComponents is not called when only initialize has been called,
// ie that no activate calls have been made yet.
// mTestObject->setVisible is needed because othervise childs cannot be set visible, ie the
--- a/videocollection/videocollectionview/tsrc/testlistview/inc/testlistview.h Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testlistview/inc/testlistview.h Thu Jul 08 13:05:19 2010 +0300
@@ -129,9 +129,9 @@
void testOpenCollectionViewSlot();
/**
- * Tests openServicesViewSlot.
+ * Tests openOperatorServiceSlot.
*/
- void testOpenServicesViewSlot();
+ void testOpenOperatorServiceSlot();
/**
* Tests startSortingSlot.
--- a/videocollection/videocollectionview/tsrc/testlistview/src/testlistview.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testlistview/src/testlistview.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -63,6 +63,7 @@
#include "videocollectionuiloaderdata.h"
#include "videolistdatamodeldata.h"
#include "xqserviceutilxtra.h"
+#include "videooperatorservicedata.h"
// ---------------------------------------------------------------------------
// main
@@ -97,7 +98,7 @@
// init
// ---------------------------------------------------------------------------
//
-void TestListView::init(bool initTestView )
+void TestListView::init(bool initTestView)
{
XQServiceUtilXtra::service = false;
mUiLoader = new VideoCollectionUiLoader();
@@ -114,6 +115,8 @@
QVERIFY(mTestView);
if(initTestView)
{
+ VideoOperatorServiceData::mIcons.append("qtg_mono_ovistore");
+ VideoOperatorServiceData::mUris.append("testuri");
QVERIFY(mTestView->initializeView() == 0);
}
@@ -293,6 +296,7 @@
void TestListView::testMenus()
{
init();
+
TMPXItemId tmpId = TMPXItemId::InvalidId();
mTestView->activateView(tmpId);
@@ -300,7 +304,7 @@
QList<QAction*> tbActions = mTestView->toolBar()->actions();
QList<QAction*> tbGroupActions;
QList<QAction*> tbGroupActions2;
-
+
// All videos is open for default, verify.
QVERIFY( mTestView->mToolbarViewsActionGroup != 0 );
QVERIFY( mTestView->mToolbarCollectionActionGroup != 0 );
@@ -311,6 +315,7 @@
QCOMPARE( tbGroupActions.count(), 3 );
QCOMPARE( tbGroupActions2.count(), 2 );
QVERIFY( tbGroupActions.at(0)->isChecked() ); // First is checked.
+ QCOMPARE( VideoOperatorServiceData::mLoadCallCount, 6);
// Verify checkable and visible toolbar actions.
HbAction* allVideosAction = mTestView->mToolbarActions[VideoListView::ETBActionAllVideos];
@@ -788,12 +793,28 @@
cleanup();
}
// ---------------------------------------------------------------------------
-// Slot: test open services view slot
+// Slot: test open operator service slot
// ---------------------------------------------------------------------------
//
-void TestListView::testOpenServicesViewSlot()
+void TestListView::testOpenOperatorServiceSlot()
{
- QFAIL("Feature not yet implemented!");
+ init();
+
+ TMPXItemId tmpId = TMPXItemId::InvalidId();
+ mTestView->activateView(tmpId);
+
+ VideoOperatorServiceData::mLaunchServiceCallCount = 0;
+ connect(this, SIGNAL(testSignal2()), mTestView, SLOT(openOperatorServiceSlot()));
+ emit testSignal2();
+ QCOMPARE(VideoOperatorServiceData::mLaunchServiceCallCount, 1);
+ cleanup();
+
+ init();
+ VideoOperatorServiceData::mLaunchServiceCallCount = 0;
+ connect(this, SIGNAL(testSignal2()), mTestView, SLOT(openOperatorServiceSlot()));
+ emit testSignal2();
+ QCOMPARE(VideoOperatorServiceData::mLaunchServiceCallCount, 0);
+ cleanup();
}
// ---------------------------------------------------------------------------
--- a/videocollection/videocollectionview/tsrc/testlistwidget/inc/testlistwidget.h Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testlistwidget/inc/testlistwidget.h Thu Jul 08 13:05:19 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 26 %
+// Version : %version: 27 %
#ifndef __TESTLISTWIDGET_H__
#define __TESTLISTWIDGET_H__
@@ -179,6 +179,16 @@
* verifies scrollPositionTimerSlot()
*/
void testScrollPositionTimerSlot();
+
+ /**
+ * verifies testRowsInsertedSlot()
+ */
+ void testRowsInsertedSlot();
+
+ /**
+ * verifies testRowsRemovedSlot()
+ */
+ void testRowsRemovedSlot();
signals:
--- a/videocollection/videocollectionview/tsrc/testlistwidget/src/testlistwidget.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testlistwidget/src/testlistwidget.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 56 %
+// Version : %version: 58 %
#include <qmap.h>
#include <vcxmyvideosdefs.h>
@@ -86,6 +86,17 @@
{
VideoListWidget::longPressedSlot(item, point);
}
+
+ void callRowsInserted(const QModelIndex &parent, int start, int end)
+ {
+ VideoListWidget::rowsInserted(parent, start, end);
+ }
+
+
+ void callRowsRemoved(const QModelIndex &parent, int start, int end)
+ {
+ VideoListWidget::rowsRemoved(parent, start, end);
+ }
};
// ---------------------------------------------------------------------------
@@ -966,7 +977,7 @@
// messagebox question returns false
HbMessageBoxData::mQuestionReturnValue = false;
emit testSignal();
- box->emitDialogFinished(mTestWidget, SLOT(deleteItemDialogFinished(HbAction *)), 1);
+ box->emitDialogFinished(mTestWidget, SLOT(deleteItemDialogFinished(int)), HbMessageBox::No);
QVERIFY(VideoListDataModelData::dataAccessCount() == 1);
QVERIFY(!HbMessageBoxData::mLatestTxt.isEmpty());
QVERIFY(!VideoSortFilterProxyModelData::mLastIndex.isValid());
@@ -980,7 +991,7 @@
VideoSortFilterProxyModelData::mDeleteItemsFails = false;
HbMessageBoxData::mQuestionReturnValue = true;
emit testSignal();
- box->emitDialogFinished(mTestWidget, SLOT(deleteItemDialogFinished(HbAction *)), 0);
+ box->emitDialogFinished(mTestWidget, SLOT(deleteItemDialogFinished(int)), HbMessageBox::Yes);
QVERIFY(VideoListDataModelData::dataAccessCount() == 1);
QVERIFY(!HbMessageBoxData::mLatestTxt.isEmpty());
QVERIFY(VideoSortFilterProxyModelData::mLastIndex.row() == 0);
@@ -1314,7 +1325,7 @@
// valid data
VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, "test");
emit testSignal();
- box->emitDialogFinished(mTestWidget, SLOT(removeCollectionDialogFinished(HbAction *)), 0);
+ box->emitDialogFinished(mTestWidget, SLOT(removeCollectionDialogFinished(int)), HbMessageBox::Yes);
QVERIFY(VideoSortFilterProxyModelData::mLastIndex.isValid());
QVERIFY(VideoSortFilterProxyModelData::mLastIndex.row() == 1);
QVERIFY(!HbMessageBoxData::mLatestTxt.isEmpty());
@@ -1324,7 +1335,7 @@
HbMessageBoxData::mLatestTxt = "";
HbMessageBoxData::mQuestionReturnValue = false;
emit testSignal();
- box->emitDialogFinished(mTestWidget, SLOT(removeCollectionDialogFinished(HbAction *)), 1);
+ box->emitDialogFinished(mTestWidget, SLOT(removeCollectionDialogFinished(int)), HbMessageBox::No);
QVERIFY(!VideoSortFilterProxyModelData::mLastIndex.isValid());
QVERIFY(!HbMessageBoxData::mLatestTxt.isEmpty());
@@ -1434,7 +1445,8 @@
// no visible items
HbListView::mVisibleItems.clear();
emit testSignal();
- QVERIFY(VideoThumbnailTestData::mStartBackgroundFetchingCallCount == 0);
+ QVERIFY(VideoThumbnailTestData::mStartBackgroundFetchingCallCount == 1);
+ QVERIFY(VideoThumbnailTestData::mFetchIndex == 0);
QVERIFY(!mTestWidget->mScrollPositionTimer->isActive());
// setup few "visible" items and make sure item count match at thumbnail data
@@ -1450,7 +1462,7 @@
// Test
emit testSignal();
- QVERIFY(VideoThumbnailTestData::mStartBackgroundFetchingCallCount == 1);
+ QVERIFY(VideoThumbnailTestData::mStartBackgroundFetchingCallCount == 2);
QVERIFY(!mTestWidget->mScrollPositionTimer->isActive());
// Test again when timer is null.
@@ -1501,7 +1513,56 @@
connect(this, SIGNAL(testSignal()), mTestWidget, SLOT(scrollPositionTimerSlot()));
emit testSignal();
disconnect(this, SIGNAL(testSignal()), mTestWidget, SLOT(scrollPositionTimerSlot()));
-
+}
+
+void TestListWidget::testRowsInsertedSlot()
+{
+ VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
+ VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
+
+ mTestWidget->initialize(*model);
+
+ // setup few "visible" items to trigger the fetch
+ int count = 10;
+ setRowCount(count);
+ HbAbstractViewItem *item = 0;
+ for(int i = 0; i < count; ++i)
+ {
+ item = new HbAbstractViewItem();
+ item->mModelIndex = model->index(i, 0, QModelIndex());
+ HbListView::mVisibleItems.append(item);
+ }
+
+ // Test
+ QModelIndex parent;
+ mTestWidget->callRowsInserted(parent, 0, 0);
+ QVERIFY(VideoThumbnailTestData::mStartBackgroundFetchingCallCount == 1);
+ QVERIFY(!mTestWidget->mScrollPositionTimer->isActive());
+}
+
+void TestListWidget::testRowsRemovedSlot()
+{
+ VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
+ VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
+
+ mTestWidget->initialize(*model);
+
+ // setup few "visible" items to trigger the fetch
+ int count = 10;
+ setRowCount(count);
+ HbAbstractViewItem *item = 0;
+ for(int i = 0; i < count; ++i)
+ {
+ item = new HbAbstractViewItem();
+ item->mModelIndex = model->index(i, 0, QModelIndex());
+ HbListView::mVisibleItems.append(item);
+ }
+
+ // Test
+ QModelIndex parent;
+ mTestWidget->callRowsRemoved(parent, 0, 0);
+ QVERIFY(VideoThumbnailTestData::mStartBackgroundFetchingCallCount == 1);
+ QVERIFY(!mTestWidget->mScrollPositionTimer->isActive());
}
// end of file
--- a/videocollection/videocollectionview/tsrc/testvideocollectionuiloader/src/testvideocollectionuiloader.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testvideocollectionuiloader/src/testvideocollectionuiloader.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -684,12 +684,6 @@
true,
VideoCollectionUiLoaderParam::LoadPhasePrimary));
params.append(VideoCollectionUiLoaderParam(
- DOCML_NAME_HINT_LABEL,
- DOCML_VIDEOCOLLECTIONVIEW_FILE,
- DOCML_VIDEOCOLLECTIONVIEW_SECTION_HINT,
- true,
- VideoCollectionUiLoaderParam::LoadPhasePrimary));
- params.append(VideoCollectionUiLoaderParam(
DOCML_NAME_NO_VIDEOS_LABEL,
DOCML_VIDEOCOLLECTIONVIEW_FILE,
DOCML_VIDEOCOLLECTIONVIEW_SECTION_HINT,
--- a/videocollection/videocollectionview/tsrc/testvideocollectionviewutils/inc/testvideocollectionviewutils.h Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testvideocollectionviewutils/inc/testvideocollectionviewutils.h Thu Jul 08 13:05:19 2010 +0300
@@ -61,15 +61,15 @@
void testLoadSortingValues();
/**
- * verifies getServiceIconStrings
+ * verifies getCenRepStringValue
*/
- void testGetServiceIconStrings();
-
+ void testGetCenRepStringValue();
+
/**
- * verifies getServiceUriString
+ * verifies getCenRepIntValue
*/
- void testGetServiceUriString();
-
+ void testGetCenRepIntValue();
+
/**
* Verifies initListView
*/
--- a/videocollection/videocollectionview/tsrc/testvideocollectionviewutils/src/testvideocollectionviewutils.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testvideocollectionviewutils/src/testvideocollectionviewutils.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -16,6 +16,7 @@
*/
#include <qapplication.h>
+#include "xqsettingsmanagerstub.h"
#include <vcxmyvideosdefs.h>
#include "centralrepository.h"
#include "testvideocollectionviewutils.h"
@@ -518,60 +519,21 @@
}
// -----------------------------------------------------------------------------
-// testGetServiceIconStrings
+// testGetCenRepStringValue
// -----------------------------------------------------------------------------
//
-void TestVideoVideoCollectionViewUtils::testGetServiceIconStrings()
-{
- VideoCollectionViewUtils &testObject(VideoCollectionViewUtils::instance());
- CRepository::setNewLLeave(true);
- _LIT(KExpectedTDesValue, "expected");
- CRepository::setTDesValue(KExpectedTDesValue());
- QString expected((QChar*)KExpectedTDesValue().Ptr(),KExpectedTDesValue().Length());
-
- QString icon;
- QString pressed;
- QVERIFY(testObject.getServiceIconStrings(icon, pressed) < 0);
- QVERIFY(icon.isNull());
- QVERIFY(pressed.isNull());
+void TestVideoVideoCollectionViewUtils::testGetCenRepStringValue()
+{
- CRepository::setNewLLeave(false);
- CRepository::setGetFail(0);
- QVERIFY(testObject.getServiceIconStrings(icon, pressed) < 0);
- QVERIFY(icon.isNull());
- QVERIFY(pressed.isNull());
-
- CRepository::setGetFail(1);
- QVERIFY(testObject.getServiceIconStrings(icon, pressed) < 0);
- QVERIFY(icon.isNull());
- QVERIFY(pressed.isNull());
-
- CRepository::setGetFail(255);
- QVERIFY(testObject.getServiceIconStrings(icon, pressed) == 0);
- QCOMPARE(icon, expected);
- QCOMPARE(pressed, expected);
}
// -----------------------------------------------------------------------------
-// testGetServiceIconStrings
+// testGetCenRepIntValue
// -----------------------------------------------------------------------------
//
-void TestVideoVideoCollectionViewUtils::testGetServiceUriString()
-{
- VideoCollectionViewUtils &testObject(VideoCollectionViewUtils::instance());
- CRepository::setNewLLeave(true);
- _LIT(KExpectedTDesValue, "expected");
- CRepository::setTDesValue(KExpectedTDesValue());
- QString expected((QChar*)KExpectedTDesValue().Ptr(),KExpectedTDesValue().Length());
+void TestVideoVideoCollectionViewUtils::testGetCenRepIntValue()
+{
- QVERIFY(testObject.getServiceUriString().isNull());
-
- CRepository::setNewLLeave(false);
- CRepository::setGetFail(0);
- QVERIFY(testObject.getServiceUriString().isNull());
-
- CRepository::setGetFail(255);
- QCOMPARE(testObject.getServiceUriString(), expected);
}
// -----------------------------------------------------------------------------
--- a/videocollection/videocollectionview/videocollectionview.pro Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/videocollectionview/videocollectionview.pro Thu Jul 08 13:05:19 2010 +0300
@@ -15,11 +15,9 @@
#
TEMPLATE = lib
-CONFIG += hb \
- qt \
- ecomplugin
+CONFIG += hb qt ecomplugin mobility
+TARGET =
-TARGET =
symbian: {
TARGET.UID2 = 0x10009D8D
TARGET.UID3 = 0x200211FB
@@ -62,7 +60,8 @@
inc/videocollectionviewutils.h \
inc/videocollectionuiloader.h \
inc/videolistselectiondialog.h \
- inc/videocollectioncenrepdefs.h
+ inc/videocollectioncenrepdefs.h \
+ inc/videooperatorservice.h
SOURCES += src/videocollectionviewplugin.cpp \
src/videolistview.cpp \
@@ -70,8 +69,11 @@
src/videohintwidget.cpp \
src/videocollectionviewutils.cpp \
src/videocollectionuiloader.cpp \
- src/videolistselectiondialog.cpp
-
+ src/videolistselectiondialog.cpp \
+ src/videooperatorservice.cpp
+
+DOCML += data/collectionview.docml
+
RESOURCES += data/videocollectionview.qrc
LIBS += -lmpxviewframeworkqt.dll \
@@ -79,10 +81,17 @@
-lcentralrepository.dll \
-lxqserviceutil.dll \
-lvideoplayerengine.dll \
- -lflogger.dll
-
-# Seems to be no way to get these on top of file
-mmpBlock = "$${LITERAL_HASH}include <platform_paths.hrh>" \
- "$${LITERAL_HASH}include <data_caging_paths.hrh>" \
- "$${LITERAL_HASH}include <bldvariant.hrh>"
-MMP_RULES += mmpBlock
+ -lflogger.dll \
+ -lxqsettingsmanager.dll \
+ -lws32 \
+ -lapparc \
+ -lapgrfx \
+ -lcone
+
+symbian: {
+ # Seems to be no way to get these on top of file
+ mmpBlock = "$${LITERAL_HASH}include <platform_paths.hrh>" \
+ "$${LITERAL_HASH}include <data_caging_paths.hrh>" \
+ "$${LITERAL_HASH}include <bldvariant.hrh>"
+ MMP_RULES += mmpBlock SMPSAFE
+}
--- a/videocollection/videocollectionwrapper/inc/videothumbnaildata_p.h Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/videocollectionwrapper/inc/videothumbnaildata_p.h Thu Jul 08 13:05:19 2010 +0300
@@ -220,12 +220,6 @@
void thumbnailReadySlot(QPixmap tnData, const TMPXItemId &mediaId, int error);
/**
- * VideoListDataModel signals this slot when the model has been changed.
- *
- */
- void modelChangedSlot();
-
- /**
* Fetches thumbnails around of mCurrentFetchIndex in batches of THUMBNAIL_BACKGROUND_FETCH_AMOUNT.
* The fetch index is set by startFetchingThumbnails which also resets
* mCurrentBackgroundFetchCount. Maximum of THUMBNAIL_MAX_BACKGROUND_FETCH thumbnails are
--- a/videocollection/videocollectionwrapper/src/videothumbnaildata_p.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/videocollectionwrapper/src/videothumbnaildata_p.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 24 %
+// Version : %version: 24.1.1 %
// INCLUDE FILES
#include <qapplication.h>
@@ -163,13 +163,6 @@
FUNC_LOG;
if(mSignalsConnected)
{
- VideoSortFilterProxyModel *model =
- VideoCollectionWrapper::instance().getModel(VideoCollectionCommon::EModelTypeAllVideos);
- if(model)
- {
- disconnect(model->sourceModel(), SIGNAL(modelReady()), this, SLOT(modelChangedSlot()));
- disconnect(model->sourceModel(), SIGNAL(modelChanged()), this, SLOT(modelChangedSlot()));
- }
disconnect(mThumbnailFetcher, SIGNAL(thumbnailReady(QPixmap , const TMPXItemId &, int )),
this, SLOT(thumbnailReadySlot(QPixmap , const TMPXItemId &, int )));
disconnect(mThumbnailFetcher, SIGNAL(allThumbnailsFetched()),
@@ -197,8 +190,6 @@
this, SLOT(thumbnailReadySlot( QPixmap , const TMPXItemId &, int))) ||
!connect(mThumbnailFetcher, SIGNAL(allThumbnailsFetched()),
this, SLOT(allThumbnailsFetchedSlot())) ||
- !connect(model->sourceModel(), SIGNAL(modelReady()), this, SLOT(modelChangedSlot())) ||
- !connect(model->sourceModel(), SIGNAL(modelChanged()), this, SLOT(modelChangedSlot())) ||
!connect(mBgFetchTimer, SIGNAL(timeout()), this, SLOT(doBackgroundFetching())) ||
!connect(mTbnReportTimer, SIGNAL(timeout()), this, SLOT(reportThumbnailsReadySlot())))
{
@@ -299,11 +290,13 @@
void VideoThumbnailDataPrivate::doBackgroundFetching()
{
FUNC_LOG;
+ INFO_1("VideoThumbnailDataPrivate::doBackgroundFetching() bg fetch count: %d", mCurrentBackgroundFetchCount);
+
if(!mCurrentModel || !mThumbnailFetcher)
{
return;
}
-
+
if(mCurrentBackgroundFetchCount >= THUMBNAIL_CACHE_SIZE)
{
return;
@@ -351,6 +344,8 @@
void VideoThumbnailDataPrivate::getModelIndexes(QList<QModelIndex> &indexes, int startIndex, int endIndex)
{
FUNC_LOG;
+ INFO_2("VideoThumbnailDataPrivate::getModelIndexes() from %d to %d", startIndex, endIndex);
+
QModelIndex index;
for(int i = startIndex; i < endIndex; i++)
{
@@ -410,16 +405,6 @@
}
// -----------------------------------------------------------------------------
-// VideoThumbnailDataPrivate::modelChangedSlot()
-// -----------------------------------------------------------------------------
-//
-void VideoThumbnailDataPrivate::modelChangedSlot()
-{
- FUNC_LOG;
- startBackgroundFetching(mCurrentModel, mCurrentFetchIndex);
-}
-
-// -----------------------------------------------------------------------------
// VideoThumbnailDataPrivate::defaultThumbnail()
// -----------------------------------------------------------------------------
//
@@ -622,7 +607,12 @@
INFO("VideoThumbnailDataPrivate::startBackgroundFetching() fetching is disabled.");
return;
}
-
+
+ if(mBgFetchTimer)
+ {
+ mBgFetchTimer->stop();
+ }
+
doBackgroundFetching();
}
--- a/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata_p/inc/testvideothumbnaildata_p.h Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata_p/inc/testvideothumbnaildata_p.h Thu Jul 08 13:05:19 2010 +0300
@@ -49,7 +49,6 @@
void testThumbnailReadySlot();
void testDefaultThumbnail();
void testRemoveThumbnail();
- void testModelChangedSlot();
void testStartBackgroundFetching();
void testEnableBackgroundFetching();
void testFreeThumbnailData();
--- a/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata_p/src/testvideothumbnaildata_p.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata_p/src/testvideothumbnaildata_p.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -788,35 +788,6 @@
}
// ---------------------------------------------------------------------------
-// testModelChangedSlot
-// ---------------------------------------------------------------------------
-//
-void TestVideoThumbnailData_p::testModelChangedSlot()
-{
- // Empty list.
- init();
- mTestObject->emitModelChanged();
- QVERIFY(mTestObject->mCurrentFetchIndex == 0);
- QCOMPARE(VideoThumbnailFetcher::mRequests.count(), 0);
- QVERIFY(mTestObject->mCurrentBackgroundFetchCount == 0);
- QVERIFY(mTestObject->mBgFetchTimer->isActive() == false);
- cleanup();
-
- // THUMBNAIL_BACKGROUND_FETCH_AMOUNT items in model and fetch index at 0
- init();
- for(int i = 0; i < THUMBNAIL_BACKGROUND_FETCH_AMOUNT; i++)
- {
- mTestObject->mCurrentModel->appendData(QString("file") + QString::number(i));
- }
- mTestObject->emitModelChanged();
- QVERIFY(mTestObject->mCurrentFetchIndex == 0);
- QCOMPARE(VideoThumbnailFetcher::mRequests.count(), THUMBNAIL_BACKGROUND_FETCH_AMOUNT/2);
- QVERIFY(mTestObject->mCurrentBackgroundFetchCount == THUMBNAIL_BACKGROUND_FETCH_AMOUNT);
- QVERIFY(mTestObject->mBgFetchTimer->isActive() == false);
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
// testStartBackgroundFetching
// ---------------------------------------------------------------------------
//
--- a/videocollection/videocollectionwrapper/videocollectionwrapper.pro Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/videocollectionwrapper/videocollectionwrapper.pro Thu Jul 08 13:05:19 2010 +0300
@@ -15,7 +15,10 @@
#
TEMPLATE = lib
+CONFIG += hb qt dll
TARGET =
+DEFINES += BUILD_VIDEOCOLLECTION_DLL
+
symbian: {
TARGET.UID2 = 0x1000008D
TARGET.UID3 = 0x200211FD
@@ -28,10 +31,8 @@
"$${LITERAL_HASH}else" \
"DEFFILE ../bwins/videocollectionwrapper.def" \
"$${LITERAL_HASH}endif"
- MMP_RULES += defBlock
+ MMP_RULES += defBlock SMPSAFE
}
-CONFIG += hb qt dll
-DEFINES += BUILD_VIDEOCOLLECTION_DLL
DEPENDPATH += . inc src
--- a/videocollection/videofiledetailsview/data/videofiledetails.qrc Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/videofiledetailsview/data/videofiledetails.qrc Thu Jul 08 13:05:19 2010 +0300
@@ -1,5 +1,5 @@
<RCC>
<qresource prefix="/xml" >
- <file alias="videofiledetails.docml">videofiledetails.docml</file>
+ <file alias="videofiledetails.docml">videofiledetails.docml.bin</file>
</qresource>
</RCC>
--- a/videocollection/videofiledetailsview/inc/videofiledetailsviewplugin.h Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/videofiledetailsview/inc/videofiledetailsviewplugin.h Thu Jul 08 13:05:19 2010 +0300
@@ -121,7 +121,7 @@
/**
* Signaled by HbMessageBox when it's closed.
*/
- void deleteVideoDialogFinished(HbAction *action);
+ void deleteVideoDialogFinished(int action);
private slots:
--- a/videocollection/videofiledetailsview/src/videofiledetailsviewplugin.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/videofiledetailsview/src/videofiledetailsviewplugin.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 76.1.1 %
+// Version : %version: 76.1.5 %
// INCLUDE FILES
#include <qcoreapplication.h>
@@ -32,6 +32,7 @@
#include <hblistwidget.h>
#include <hblistwidgetitem.h>
#include <hblistviewitem.h>
+#include <hbparameterlengthlimiter.h>
#include <cmath>
#include <thumbnailmanager_qt.h>
#include <shareui.h>
@@ -113,10 +114,10 @@
mActivated = false;
bool ok = false;
-
+
//Load the details view docml first
mLoader.load(VIDEO_DETAILS_DOCML, &ok);
-
+
if(!ok)
{
ERROR(-1, "VideoFileDetailsViewPlugin::createView() failed to load docml.");
@@ -125,7 +126,7 @@
//Load portrait section by default as only vertical orientation is currently supported by videoplayer
mLoader.load(VIDEO_DETAILS_DOCML, VIDEO_DETAILS_PORTRAIT, &ok);
-
+
if(!ok)
{
ERROR(-1, "VideoFileDetailsViewPlugin::createView() failed to load portrait view.");
@@ -176,7 +177,7 @@
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);
@@ -211,7 +212,7 @@
// Create navigation keys.
mNavKeyBackAction = new HbAction(Hb::BackNaviAction);
mNavKeyBackAction->setObjectName(VIDEO_DETAILS_OBJECT_NAME_NAVKEY_BACK);
-
+
if (!mThumbnailManager)
{
mThumbnailManager = new ThumbnailManager();
@@ -219,14 +220,14 @@
connect(mThumbnailManager, SIGNAL(thumbnailReady(QPixmap,void*,int,int)),
this, SLOT(thumbnailReadySlot(QPixmap,void*,int,int)));
-
+
HbListWidget* list = findWidget<HbListWidget>(VIDEO_DETAILS_LISTWIDGET);
if(!list)
{
ERROR(-1, "VideoFileDetailsViewPlugin::activateView() failed to load details list widget.");
return;
}
-
+
list->setEnabledAnimations(HbAbstractItemView::None);
}
@@ -250,10 +251,10 @@
delete mNavKeyBackAction;
mNavKeyBackAction = 0;
-
+
delete mThumbnailManager;
mThumbnailManager = 0;
-
+
disconnect();
mLoader.reset();
}
@@ -314,7 +315,7 @@
if (mIsService && mVideoServices)
{
service = mVideoServices->currentService();
-
+
HbMainWindow *mainWnd = hbInstance->allMainWindows().value(0);
mainWnd->currentView()->setTitle(mVideoServices->contextTitle());
}
@@ -325,18 +326,19 @@
ERROR(-1, "VideoFileDetailsViewPlugin::activateView() failed to load details button.");
return;
}
-
+
// Fix the size of the thumbnail, as that needs to be in 16:9
qreal width = button->size().width();
qreal height = width * 9 / 16;
-
+
HbStackedWidget* thumbWidget = findWidget<HbStackedWidget>(VIDEO_DETAILS_THUMBNAIL);
thumbWidget->setPreferredWidth(width);
thumbWidget->setPreferredHeight(height);
-
+
if (service == VideoServices::EUriFetcher)
{
- button->setText(hbTrId("txt_videos_button_attach"));
+ HbIcon icon = HbIcon("qtg_mono_attach");
+ button->setIcon(icon);
connect(button, SIGNAL(clicked(bool)), this, SLOT(getFileUri()));
connect(this, SIGNAL(fileUri(const QString&)), mVideoServices, SLOT(itemSelected(const QString&)));
@@ -344,7 +346,9 @@
else
{
connect(button, SIGNAL(clicked(bool)), this, SLOT(sendVideoSlot()));
- button->setText(hbTrId("txt_videos_opt_share"));
+
+ HbIcon icon = HbIcon("qtg_mono_share");
+ button->setIcon(icon);
}
connect(mainWnd,
@@ -494,14 +498,14 @@
int detailCount = sizeof(VideoDetailLabelKeys) / sizeof(int);
QMap<QString, QVariant> metadata = variant.toMap();
-
+
HbListWidget* list = findWidget<HbListWidget>(VIDEO_DETAILS_LISTWIDGET);
if(!list)
{
ERROR(-1, "VideoFileDetailsViewPlugin::activateView() failed to load details list widget.");
return;
}
-
+
if(list->count())
{
list->clear();
@@ -565,7 +569,7 @@
{
FUNC_LOG;
// HbMessageBox::information(tr("Not implemented yet"));
-
+
if(mVideoId != TMPXItemId::InvalidId())
{
ShareUi dialog;
@@ -594,13 +598,14 @@
if (variant.isValid())
{
- QString text = hbTrId("txt_videos_info_do_you_want_to_delete_1").arg(
- variant.toString());
+ QString text = HbParameterLengthLimiter(hbTrId("txt_videos_info_do_you_want_to_delete_1")).
+ arg(variant.toString());
HbMessageBox *messageBox = new HbMessageBox(text, HbMessageBox::MessageTypeQuestion);
messageBox->setAttribute(Qt::WA_DeleteOnClose);
+ messageBox->setStandardButtons(HbMessageBox::Yes | HbMessageBox::No);
messageBox->setObjectName(VIDEO_DETAILS_OBJECT_NAME_DELETE_VIDEO);
- messageBox->open(this, SLOT(deleteVideoDialogFinished(HbAction *)));
+ messageBox->open(this, SLOT(deleteVideoDialogFinished(int)));
}
}
}
@@ -609,12 +614,11 @@
// deleteVideoDialogFinished
// ---------------------------------------------------------------------------
//
-void VideoFileDetailsViewPlugin::deleteVideoDialogFinished(HbAction *action)
+void VideoFileDetailsViewPlugin::deleteVideoDialogFinished(int action)
{
FUNC_LOG;
- HbMessageBox *dlg = static_cast<HbMessageBox*>(sender());
QModelIndex modelIndex = mModel->indexOfId(mVideoId);
- if(action == dlg->actions().at(0) && modelIndex.isValid())
+ if(action == HbMessageBox::Yes && modelIndex.isValid())
{
deleteItem(modelIndex);
}
@@ -666,7 +670,7 @@
QString format = hbTrId("txt_videos_info_unable_to_delete_1_it_is_current");
if(additional.isValid())
{
- msg = format.arg(additional.toString());
+ msg = HbParameterLengthLimiter(format).arg(additional.toString());
}
}
if(msg.count() > 0)
@@ -690,7 +694,14 @@
Q_UNUSED(clientData);
Q_UNUSED(id);
- QSize size(mThumbLabel->size().toSize());
+ HbStackedWidget* thumbWidget = findWidget<HbStackedWidget>(VIDEO_DETAILS_THUMBNAIL);
+ if(!thumbWidget)
+ {
+ ERROR(-1, "VideoFileDetailsViewPlugin::thumbnailReadySlot() failed to load thumbnail widget.");
+ return;
+ }
+
+ QSize size(thumbWidget->size().toSize());
if (!errorCode)
{
@@ -709,7 +720,7 @@
}
int difference(0);
- QRect rect = mThumbLabel->rect().toRect();
+ QRect rect = thumbWidget->rect().toRect();
if(sourceImage.width() > size.width())
{
@@ -787,7 +798,7 @@
{
return mPlayIcon;
}
-
+
// Compose the icon.
HbIcon play = HbIcon("qtg_mono_play");
HbIcon topLeft = HbIcon("qtg_fr_popup_trans_tl");
@@ -802,54 +813,54 @@
int width = topLeft.width() + top.width() + topRight.width();
int height = topLeft.height() + center.height() + bottomLeft.height();
-
+
mPlayIcon = QPixmap(width, height);
-
+
QPainter painter(&mPlayIcon);
painter.fillRect(mPlayIcon.rect(), Qt::white);
-
+
painter.setCompositionMode(QPainter::CompositionMode_SourceOver);
-
+
int x = 0;
int y = 0;
// Draw top
painter.drawPixmap(QPoint(x, y), topLeft.pixmap());
x += left.width();
-
+
painter.drawPixmap(QPoint(x, y), top.pixmap());
x += top.width();
painter.drawPixmap(QPoint(x, y), topRight.pixmap());
y += top.height();
-
+
// Draw center
x = 0;
painter.drawPixmap(QPoint(x, y), left.pixmap());
x += left.width();
-
+
painter.drawPixmap(QPoint(x, y), center.pixmap());
x += center.width();
painter.drawPixmap(QPoint(x, y), right.pixmap());
y += center.height();
-
+
// Draw bottom
x = 0;
painter.drawPixmap(QPoint(x, y), bottomLeft.pixmap());
x += left.width();
-
+
painter.drawPixmap(QPoint(x, y), bottom.pixmap());
x += top.width();
-
+
painter.drawPixmap(QPoint(x, y), bottomRight.pixmap());
-
+
// Draw play icon
play.setSize(mPlayIcon.size());
play.setColor(Qt::white);
painter.drawPixmap(mPlayIcon.rect(), play.pixmap());
painter.end();
-
+
return mPlayIcon;
}
--- a/videocollection/videofiledetailsview/tsrc/testplugin/src/testvideofiledetails.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/videofiledetailsview/tsrc/testplugin/src/testvideofiledetails.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -31,6 +31,7 @@
#include <hbapplication.h>
#include <hbmarqueeitem.h>
#include <hbstackedwidget.h>
+#include <hbparameterlengthlimiter.h>
#include "videodetailslabel.h"
#include "hbmessagebox.h"
@@ -623,14 +624,14 @@
QString expectedText = hbTrId("txt_videos_info_do_you_want_to_delete_1").arg(
display.first());
deleteAction->trigger();
- msgBox->emitDialogFinished(mPlugin, SLOT(deleteVideoDialogFinished(HbAction *)), 0); // Yes selected
+ msgBox->emitDialogFinished(mPlugin, SLOT(deleteVideoDialogFinished(int)), HbMessageBox::Yes); // Yes selected
QCOMPARE( mDummyModel->dataAccessCount(), 3 );
QVERIFY( mDummyModel->lastIndex() == expected );
QCOMPARE( mDummyModel->deleteFileIndex(), expected.row() );
QCOMPARE( HbMessageBox::mLatestTxt, expectedText );
deleteAction->trigger();
- msgBox->emitDialogFinished(mPlugin, SLOT(deleteVideoDialogFinished(HbAction *)), 1); // No selected
+ msgBox->emitDialogFinished(mPlugin, SLOT(deleteVideoDialogFinished(int)), HbMessageBox::No); // No selected
QCOMPARE( mDummyModel->dataAccessCount(), 4 );
QVERIFY( mDummyModel->lastIndex() == expected );
QCOMPARE( mDummyModel->deleteFileIndex(), expected.row() );
@@ -639,7 +640,7 @@
mDummyModel->reset();
deleteAction->trigger();
- msgBox->emitDialogFinished(mPlugin, SLOT(deleteVideoDialogFinished(HbAction *)), 1); // No selected
+ msgBox->emitDialogFinished(mPlugin, SLOT(deleteVideoDialogFinished(int)), HbMessageBox::No); // No selected
QCOMPARE( mDummyModel->dataAccessCount(), 1 );
QVERIFY( mDummyModel->lastIndex() == expected );
QCOMPARE( mDummyModel->deleteFileIndex(), -1 ); // verify that no file was deleted.
@@ -720,7 +721,8 @@
QString txt = "testdata";
additional = txt;
emit testErrorSignal( VideoCollectionCommon::statusSingleDeleteFail , additional);
- QCOMPARE(HbMessageBox::mLatestTxt, hbTrId("txt_videos_info_unable_to_delete_1_it_is_current").arg(txt));
+ QString expected = HbParameterLengthLimiter(hbTrId("txt_videos_info_unable_to_delete_1_it_is_current")).arg(txt);
+ QCOMPARE(HbMessageBox::mLatestTxt, expected);
HbMessageBox::mLatestTxt = "";
// VideoCollectionCommon::statusMultipleDeleteFail
@@ -732,7 +734,6 @@
cleanup();
}
-
// ---------------------------------------------------------------------------
// Slot: test for the testThumbnailReadySlot
// ---------------------------------------------------------------------------
--- a/videocollection/videofiledetailsview/tsrc/testplugin/stub/inc/hbmessagebox.h Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/videofiledetailsview/tsrc/testplugin/stub/inc/hbmessagebox.h Thu Jul 08 13:05:19 2010 +0300
@@ -35,7 +35,26 @@
MessageTypeQuestion,
MessageTypeWarning
};
-
+
+ enum StandardButton {
+ NoButton = 0x00000000,
+ Ok = 0x00000400,
+ Save = 0x00000800,
+ Open = 0x00001000,
+ Yes = 0x00002000,
+ Continue = 0x00004000,
+ Delete = 0x00008000,
+ No = 0x00010000,
+ Retry = 0x00020000,
+ Close = 0x00040000,
+ Cancel = 0x00080000,
+ Help = 0x00100000,
+ Apply = 0x00200000,
+ Reset = 0x00400000
+ };
+
+ Q_DECLARE_FLAGS(StandardButtons, StandardButton)
+
HbMessageBox(MessageBoxType type = MessageTypeInformation, QGraphicsItem *parent = 0);
HbMessageBox(const QString &text, MessageBoxType type = MessageTypeInformation, QGraphicsItem *parent = 0);
~HbMessageBox();
@@ -67,6 +86,8 @@
mLatestTxt = text;
}
+ static void setStandardButtons(StandardButtons buttons);
+
QList<HbAction*> actions() const
{
return mActions;
@@ -86,7 +107,7 @@
signals:
- void finished(HbAction *action);
+ void finished(int);
};
#endif // HBMESSAGEBOX_H
--- a/videocollection/videofiledetailsview/tsrc/testplugin/stub/src/hbmessagebox.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/videofiledetailsview/tsrc/testplugin/stub/src/hbmessagebox.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -54,6 +54,11 @@
}
}
+void HbMessageBox::setStandardButtons(StandardButtons buttons)
+{
+ //NOP
+}
+
void HbMessageBox::show()
{
HbMessageBox::mShowCallCount++;
@@ -68,10 +73,10 @@
void HbMessageBox::emitDialogFinished( QObject* receiver, const char* member, int actionNum )
{
- if(connect(this, SIGNAL(finished(HbAction *)), receiver, member))
+ if(connect(this, SIGNAL(finished(int)), receiver, member))
{
- emit finished(mActions.value(actionNum));
- disconnect(this, SIGNAL(finished(HbAction *)), receiver, member);
+ emit finished(actionNum);
+ disconnect(this, SIGNAL(finished(int)), receiver, member);
}
}
--- a/videocollection/videofiledetailsview/videofiledetailsview.pro Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/videofiledetailsview/videofiledetailsview.pro Thu Jul 08 13:05:19 2010 +0300
@@ -15,20 +15,15 @@
#
TEMPLATE = lib
-CONFIG += hb \
- qt \
- ecomplugin
+CONFIG += hb qt ecomplugin
-
-symbian: {
+symbian: {
TARGET.UID2 = 0x10009D8D
TARGET.UID3 = 0x200211FF
-
BLD_INF_RULES.prj_exports += "rom/videofiledetailsview.iby CORE_APP_LAYER_IBY_EXPORT_PATH(videofiledetailsview.iby)"
-
TARGET.CAPABILITY = ALL -TCB -DRM
-
TARGET.EPOCALLOWDLLDATA = 1
+ MMP_RULES += SMPSAFE
}
# mpx view plugin definitions:
@@ -58,7 +53,11 @@
SOURCES += src/videofiledetailsviewplugin.cpp \
src/videodetailslabel.cpp
+
+DOCML += data/videofiledetails.docml
+RESOURCES += data/videofiledetails.qrc
+
LIBS += -lmpxviewframeworkqt.dll \
-lvideocollectionwrapper.dll \
-lthumbnailmanagerqt.dll \
@@ -68,4 +67,3 @@
-lshareui.dll \
-lflogger.dll
-RESOURCES += data/videofiledetails.qrc
--- a/videoplayback/bwins/hbvideoplaybackviewu.def Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-EXPORTS
- ?handlePdlStateChange@HbVideoPlaybackView@@EAEXH@Z @ 1 NONAME ; void HbVideoPlaybackView::handlePdlStateChange(int)
- ?handleDeactivateView@HbVideoPlaybackView@@UAEXXZ @ 2 NONAME ; void HbVideoPlaybackView::handleDeactivateView(void)
- ??0HbVideoPlaybackView@@QAE@XZ @ 3 NONAME ; HbVideoPlaybackView::HbVideoPlaybackView(void)
- ?staticMetaObject@HbVideoPlaybackView@@2UQMetaObject@@B @ 4 NONAME ; struct QMetaObject const HbVideoPlaybackView::staticMetaObject
- ?metaObject@HbVideoPlaybackView@@UBEPBUQMetaObject@@XZ @ 5 NONAME ; struct QMetaObject const * HbVideoPlaybackView::metaObject(void) const
- ?handleBack@HbVideoPlaybackView@@QAEXXZ @ 6 NONAME ; void HbVideoPlaybackView::handleBack(void)
- ?handleActivateView@HbVideoPlaybackView@@UAEXXZ @ 7 NONAME ; void HbVideoPlaybackView::handleActivateView(void)
- ?trUtf8@HbVideoPlaybackView@@SA?AVQString@@PBD0@Z @ 8 NONAME ; class QString HbVideoPlaybackView::trUtf8(char const *, char const *)
- ?trUtf8@HbVideoPlaybackView@@SA?AVQString@@PBD0H@Z @ 9 NONAME ; class QString HbVideoPlaybackView::trUtf8(char const *, char const *, int)
- ?tr@HbVideoPlaybackView@@SA?AVQString@@PBD0H@Z @ 10 NONAME ; class QString HbVideoPlaybackView::tr(char const *, char const *, int)
- ??1HbVideoPlaybackView@@UAE@XZ @ 11 NONAME ; HbVideoPlaybackView::~HbVideoPlaybackView(void)
- ?handlePluginError@HbVideoPlaybackView@@EAEXH@Z @ 12 NONAME ; void HbVideoPlaybackView::handlePluginError(int)
- ?tr@HbVideoPlaybackView@@SA?AVQString@@PBD0@Z @ 13 NONAME ; class QString HbVideoPlaybackView::tr(char const *, char const *)
- ?getStaticMetaObject@HbVideoPlaybackView@@SAABUQMetaObject@@XZ @ 14 NONAME ; struct QMetaObject const & HbVideoPlaybackView::getStaticMetaObject(void)
- ?handleSoftkeyBack@HbVideoPlaybackView@@EAEXXZ @ 15 NONAME ; void HbVideoPlaybackView::handleSoftkeyBack(void)
- ?qt_metacall@HbVideoPlaybackView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 16 NONAME ; int HbVideoPlaybackView::qt_metacall(enum QMetaObject::Call, int, void * *)
- ??_EHbVideoPlaybackView@@UAE@I@Z @ 17 NONAME ; HbVideoPlaybackView::~HbVideoPlaybackView(unsigned int)
- ?qt_metacast@HbVideoPlaybackView@@UAEPAXPBD@Z @ 18 NONAME ; void * HbVideoPlaybackView::qt_metacast(char const *)
- ?handleStoppedState@HbVideoPlaybackView@@EAEXXZ @ 19 NONAME ; void HbVideoPlaybackView::handleStoppedState(void)
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/bwins/videoplaybackviewu.def Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,21 @@
+EXPORTS
+ ?handleBack@VideoPlaybackView@@QAEXXZ @ 1 NONAME ; void VideoPlaybackView::handleBack(void)
+ ?handlePdlStateChange@VideoPlaybackView@@EAEXH@Z @ 2 NONAME ; void VideoPlaybackView::handlePdlStateChange(int)
+ ?handleSoftkeyBack@VideoPlaybackView@@EAEXXZ @ 3 NONAME ; void VideoPlaybackView::handleSoftkeyBack(void)
+ ?staticMetaObject@VideoPlaybackView@@2UQMetaObject@@B @ 4 NONAME ; struct QMetaObject const VideoPlaybackView::staticMetaObject
+ ?metaObject@VideoPlaybackView@@UBEPBUQMetaObject@@XZ @ 5 NONAME ; struct QMetaObject const * VideoPlaybackView::metaObject(void) const
+ ??1VideoPlaybackView@@UAE@XZ @ 6 NONAME ; VideoPlaybackView::~VideoPlaybackView(void)
+ ?qt_metacast@VideoPlaybackView@@UAEPAXPBD@Z @ 7 NONAME ; void * VideoPlaybackView::qt_metacast(char const *)
+ ?tr@VideoPlaybackView@@SA?AVQString@@PBD0@Z @ 8 NONAME ; class QString VideoPlaybackView::tr(char const *, char const *)
+ ?handleDeactivateView@VideoPlaybackView@@UAEXXZ @ 9 NONAME ; void VideoPlaybackView::handleDeactivateView(void)
+ ?getStaticMetaObject@VideoPlaybackView@@SAABUQMetaObject@@XZ @ 10 NONAME ; struct QMetaObject const & VideoPlaybackView::getStaticMetaObject(void)
+ ?handleActivateView@VideoPlaybackView@@UAEXXZ @ 11 NONAME ; void VideoPlaybackView::handleActivateView(void)
+ ?trUtf8@VideoPlaybackView@@SA?AVQString@@PBD0H@Z @ 12 NONAME ; class QString VideoPlaybackView::trUtf8(char const *, char const *, int)
+ ?handlePluginError@VideoPlaybackView@@EAEXH@Z @ 13 NONAME ; void VideoPlaybackView::handlePluginError(int)
+ ??0VideoPlaybackView@@QAE@XZ @ 14 NONAME ; VideoPlaybackView::VideoPlaybackView(void)
+ ?handleStoppedState@VideoPlaybackView@@EAEXXZ @ 15 NONAME ; void VideoPlaybackView::handleStoppedState(void)
+ ?qt_metacall@VideoPlaybackView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 16 NONAME ; int VideoPlaybackView::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ??_EVideoPlaybackView@@UAE@I@Z @ 17 NONAME ; VideoPlaybackView::~VideoPlaybackView(unsigned int)
+ ?trUtf8@VideoPlaybackView@@SA?AVQString@@PBD0@Z @ 18 NONAME ; class QString VideoPlaybackView::trUtf8(char const *, char const *)
+ ?tr@VideoPlaybackView@@SA?AVQString@@PBD0H@Z @ 19 NONAME ; class QString VideoPlaybackView::tr(char const *, char const *, int)
+
--- a/videoplayback/eabi/hbvideoplaybackviewu.def Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-EXPORTS
- _ZN19HbVideoPlaybackView10handleBackEv @ 1 NONAME
- _ZN19HbVideoPlaybackView11qt_metacallEN11QMetaObject4CallEiPPv @ 2 NONAME
- _ZN19HbVideoPlaybackView11qt_metacastEPKc @ 3 NONAME
- _ZN19HbVideoPlaybackView16staticMetaObjectE @ 4 NONAME DATA 16
- _ZN19HbVideoPlaybackView17handlePluginErrorEi @ 5 NONAME
- _ZN19HbVideoPlaybackView17handleSoftkeyBackEv @ 6 NONAME
- _ZN19HbVideoPlaybackView18handleActivateViewEv @ 7 NONAME
- _ZN19HbVideoPlaybackView18handleStoppedStateEv @ 8 NONAME
- _ZN19HbVideoPlaybackView19getStaticMetaObjectEv @ 9 NONAME
- _ZN19HbVideoPlaybackView20handleDeactivateViewEv @ 10 NONAME
- _ZN19HbVideoPlaybackView20handlePdlStateChangeEi @ 11 NONAME
- _ZN19HbVideoPlaybackViewC1Ev @ 12 NONAME
- _ZN19HbVideoPlaybackViewC2Ev @ 13 NONAME
- _ZN19HbVideoPlaybackViewD0Ev @ 14 NONAME
- _ZN19HbVideoPlaybackViewD1Ev @ 15 NONAME
- _ZN19HbVideoPlaybackViewD2Ev @ 16 NONAME
- _ZNK19HbVideoPlaybackView10metaObjectEv @ 17 NONAME
- _ZTI19HbVideoPlaybackView @ 18 NONAME
- _ZTV19HbVideoPlaybackView @ 19 NONAME
- _ZThn16_N19HbVideoPlaybackViewD0Ev @ 20 NONAME
- _ZThn16_N19HbVideoPlaybackViewD1Ev @ 21 NONAME
- _ZThn8_N19HbVideoPlaybackViewD0Ev @ 22 NONAME
- _ZThn8_N19HbVideoPlaybackViewD1Ev @ 23 NONAME
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/eabi/videoplaybackviewu.def Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,25 @@
+EXPORTS
+ _ZN17VideoPlaybackView10handleBackEv @ 1 NONAME
+ _ZN17VideoPlaybackView11qt_metacallEN11QMetaObject4CallEiPPv @ 2 NONAME
+ _ZN17VideoPlaybackView11qt_metacastEPKc @ 3 NONAME
+ _ZN17VideoPlaybackView16staticMetaObjectE @ 4 NONAME DATA 16
+ _ZN17VideoPlaybackView17handlePluginErrorEi @ 5 NONAME
+ _ZN17VideoPlaybackView17handleSoftkeyBackEv @ 6 NONAME
+ _ZN17VideoPlaybackView18handleActivateViewEv @ 7 NONAME
+ _ZN17VideoPlaybackView18handleStoppedStateEv @ 8 NONAME
+ _ZN17VideoPlaybackView19getStaticMetaObjectEv @ 9 NONAME
+ _ZN17VideoPlaybackView20handleDeactivateViewEv @ 10 NONAME
+ _ZN17VideoPlaybackView20handlePdlStateChangeEi @ 11 NONAME
+ _ZN17VideoPlaybackViewC1Ev @ 12 NONAME
+ _ZN17VideoPlaybackViewC2Ev @ 13 NONAME
+ _ZN17VideoPlaybackViewD0Ev @ 14 NONAME
+ _ZN17VideoPlaybackViewD1Ev @ 15 NONAME
+ _ZN17VideoPlaybackViewD2Ev @ 16 NONAME
+ _ZNK17VideoPlaybackView10metaObjectEv @ 17 NONAME
+ _ZTI17VideoPlaybackView @ 18 NONAME
+ _ZTV17VideoPlaybackView @ 19 NONAME
+ _ZThn16_N17VideoPlaybackViewD0Ev @ 20 NONAME
+ _ZThn16_N17VideoPlaybackViewD1Ev @ 21 NONAME
+ _ZThn8_N17VideoPlaybackViewD0Ev @ 22 NONAME
+ _ZThn8_N17VideoPlaybackViewD1Ev @ 23 NONAME
+
--- a/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackcontrol.hrh Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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: 7 %
-
-
-#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_*/
--- a/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackcontrolbar.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackControlBar
-*
-*/
-
-// Version : %version: 3 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKCONTROLBAR_H_
-#define MPXVIDEOPLAYBACKCONTROLBAR_H_
-
-
-#include <hbwidget.h>
-#include <mpxplaybackframeworkdefs.h>
-
-class QMPXVideoPlaybackToolBar;
-class QMPXVideoPlaybackProgressBar;
-class QMPXVideoPlaybackViewFileDetails;
-class QMPXVideoPlaybackControlsController;
-
-class QMPXVideoPlaybackControlBar : public HbWidget
-{
- Q_OBJECT
-
- public:
- QMPXVideoPlaybackControlBar( QMPXVideoPlaybackControlsController* controller );
- virtual ~QMPXVideoPlaybackControlBar();
- void updateState( TMPXPlaybackState state );
- void aspectRatioChanged( int aspectRatio );
- void initialize();
- void updateWithFileDetails( QMPXVideoPlaybackViewFileDetails* details );
- void setVisibleToControlBar( bool visible );
- void durationChanged( int duration );
- void positionChanged( int position );
-
- private:
- QMPXVideoPlaybackControlsController *mController;
- QMPXVideoPlaybackToolBar *mToolBar;
- QMPXVideoPlaybackProgressBar *mProgressBar;
-};
-
-#endif /*MPXVIDEOPLAYBACKCONTROLBAR_H_*/
--- a/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackcontrolconfiguration.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +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 CMPXVideoPlaybackControlConfiguration
-*
-*/
-
-// Version : %version: da1mmcf#7 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKCONTROLCONFIGURATION_H_
-#define MPXVIDEOPLAYBACKCONTROLCONFIGURATION_H_
-
-// INCLUDES
-#include <QObject>
-
-#include "mpxvideoplaybackcontrol.hrh"
-#include "mpxhelixplaybackplugindefs.h"
-
-// FORWARD DECLARATIONS
-class QMPXVideoPlaybackControlsController;
-
-// DATA TYPES
-
-// CLASS DECLARATION
-class QMPXVideoPlaybackControlConfiguration : public QObject
-{
- Q_OBJECT
-
- public:
-
- /**
- * constructor.
- */
- QMPXVideoPlaybackControlConfiguration( QMPXVideoPlaybackControlsController* controller );
-
- /**
- * Destructor.
- */
- virtual ~QMPXVideoPlaybackControlConfiguration();
-
- public:
- /**
- * Update control list
- */
- void updateControlList( TMPXVideoPlaybackControlCommandIds event );
-
- /**
- * Return control list
- */
- QList<TMPXVideoPlaybackControls>& controlList();
-
- void updateControlsWithFileDetails();
-
- /**
- * Create control list
- */
- void createControlList();
-
- private:
-
- /**
- * Delete controls from list
- */
- void deleteControlFromList( TMPXVideoPlaybackControls control );
-
- /**
- * Add controls to list
- */
- void addControlToList( TMPXVideoPlaybackControls control );
-
- signals:
- void controlListUpdated();
-
- private:
- QMPXVideoPlaybackControlsController *mControlsController;
- QList<TMPXVideoPlaybackControls> mControlsList;
-};
-
-#endif /*MPXVIDEOPLAYBACKCONTROLCONFIGURATION_H_*/
-
-// End of File
--- a/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackcontrolpolicy.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +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 MPXVideoPlaybackControlPolicy
-*
-*/
-
-// Version : %version: da1mmcf#5 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKCONTROLPOLICY_H_
-#define MPXVIDEOPLAYBACKCONTROLPOLICY_H_
-
-// INCLUDES
-#include <QObject>
-
-#include "mpxvideoplaybackcontrol.hrh"
-#include "mpxvideoplaybackcontrolscontroller.h"
-
-// FORWARD DECLARATIONS
-class QMPXVideoPlaybackViewFileDetails;
-
-// DATA TYPES
-
-// CLASS DECLARATION
-class QMPXVideoPlaybackControlPolicy : public QObject
-{
- Q_OBJECT
-
- public:
-
- /**
- * Two-phased constructor.
- */
- QMPXVideoPlaybackControlPolicy();
-
- /**
- * Destructor.
- */
- virtual ~QMPXVideoPlaybackControlPolicy();
-
- public:
- /**
- * Sets the control properties per policy
- */
- void setControlProperties( TMPXVideoPlaybackControls controlIndex,
- TUint& properties,
- QMPXVideoPlaybackViewFileDetails *details,
- TPlaybackViewMode viewMode );
-};
-
-#endif /*MPXVIDEOPLAYBACKCONTROLPOLICY_H_*/
-
-// End of File
--- a/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackdetailsplaybackwindow.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +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 QMPXVideoPlaybackDetailsPlaybackWindow
-*
-*/
-
-// Version : %version: 7 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKDETAILSPLAYBACKWINDOW_H_
-#define MPXVIDEOPLAYBACKDETAILSPLAYBACKWINDOW_H_
-
-#include <hbwidget.h>
-#include <mpxplaybackframeworkdefs.h>
-
-class HbPushButton;
-class QMPXVideoPlaybackControlsController;
-
-class QMPXVideoPlaybackDetailsPlaybackWindow : public HbWidget
-{
- Q_OBJECT
-
- public:
- QMPXVideoPlaybackDetailsPlaybackWindow( QMPXVideoPlaybackControlsController* controller );
- virtual ~QMPXVideoPlaybackDetailsPlaybackWindow();
- void initialize();
- void updateState( TMPXPlaybackState state );
-
- private slots:
- void playPause();
-
- private:
- QMPXVideoPlaybackControlsController *mController;
- HbPushButton *mPlayButton;
-
- bool mInitialized;
-};
-
-#endif /*MPXVIDEOPLAYBACKDETAILSPLAYBACKWINDOW_H_*/
-
--- a/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackdocumentloader.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +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 QMPXVideoPlaybackDocumentLoader
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKDOCUMENTHANDLER_H_
-#define MPXVIDEOPLAYBACKDOCUMENTHANDLER_H_
-
-#include <hbdocumentloader.h>
-
-class QMPXVideoPlaybackControlsController;
-
-class QMPXVideoPlaybackDocumentLoader : public HbDocumentLoader
-{
- public:
- QMPXVideoPlaybackDocumentLoader( QMPXVideoPlaybackControlsController *controller );
-
- virtual ~QMPXVideoPlaybackDocumentLoader();
-
- public:
- virtual QObject *createObject( const QString& type, const QString &name ) ;
-
- private:
- QMPXVideoPlaybackControlsController *mController;
-};
-
-#endif /*MPXVIDEOPLAYBACKDOCUMENTHANDLER_H_*/
-
--- a/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackfiledetailswidget.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +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 QMPXVideoPlaybackFileDetailsWidget
-*
-*/
-
-// Version : %version: 11 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKFILEDETAILSWIDGET_H_
-#define MPXVIDEOPLAYBACKFILEDETAILSWIDGET_H_
-
-#include <QObject>
-
-#include <hbwidget.h>
-
-class QMPXVideoPlaybackViewFileDetails;
-class QMPXVideoPlaybackControlsController;
-class HbListWidget;
-
-class QMPXVideoPlaybackFileDetailsWidget : public HbWidget
-{
- Q_OBJECT
-
- public:
- QMPXVideoPlaybackFileDetailsWidget( QMPXVideoPlaybackControlsController* controller );
- virtual ~QMPXVideoPlaybackFileDetailsWidget();
-
- public:
- void updateWithFileDetails( QMPXVideoPlaybackViewFileDetails* details );
-
- private:
- void makeTitleItem( QMPXVideoPlaybackViewFileDetails* details );
- void makeSizeItem( QMPXVideoPlaybackViewFileDetails* details );
- void makeBitRateItem( QMPXVideoPlaybackViewFileDetails* details );
- void makeDateTimeItem( QMPXVideoPlaybackViewFileDetails* details );
- void addItemToListWidget( QString item, QString text );
-
- private:
- QMPXVideoPlaybackControlsController *mController;
- HbListWidget *mListWidget;
- bool mFileDetailsUpdated;
-};
-
-#endif /*MPXVIDEOPLAYBACKFILEDETAILSWIDGET_H_*/
-
--- a/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackfullscreencontrol.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +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 QMPXVideoPlaybackFullScreenControl
-*
-*/
-
-// Version : %version: da1mmcf#8 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKFULLSCREENCONTROL_H_
-#define MPXVIDEOPLAYBACKFULLSCREENCONTROL_H_
-
-#include <QObject>
-
-#include <mpxvideoplaybackcontrol.hrh>
-#include <mpxplaybackframeworkdefs.h>
-
-class HbWidget;
-class QMPXVideoPlaybackViewFileDetails;
-class QMPXVideoPlaybackControlsController;
-
-class QMPXVideoPlaybackFullScreenControl : public QObject
-{
- Q_OBJECT
-
- public:
- QMPXVideoPlaybackFullScreenControl( QMPXVideoPlaybackControlsController* controller,
- TMPXVideoPlaybackControls index,
- HbWidget* widget,
- TUint controlproperties );
-
- virtual ~QMPXVideoPlaybackFullScreenControl();
-
- public:
-
- /**
- * Set visibility of each control
- */
- virtual void setVisibility( TMPXPlaybackState aState );
-
- /**
- * return control index
- */
- TMPXVideoPlaybackControls controlIndex();
-
- /**
- * set changed duration
- */
- bool durationChanged( int duration );
-
- /**
- * set changed volume
- */
- bool positionChanged( int position );
-
- /**
- * Set changed position
- */
- bool aspectRatioChanged( int aspectRatio );
-
- /**
- * set changed volume
- */
- bool setDownloadSize( int size );
-
- /**
- * set changed state
- */
- void updateState( TMPXPlaybackState state );
-
- /*
- * UpdateDownloadPosition
- * updates the download ratio on the progress bar
- */
- bool updateDownloadPosition( int size );
-
- /*
- * Update the controls with the file details
- */
- virtual void updateControlsWithFileDetails( QMPXVideoPlaybackViewFileDetails *details );
-
- virtual void setVisible( bool visible );
-
- virtual bool isVisible();
-
- virtual void updateControlProperties( TUint properties );
-
- protected:
- QMPXVideoPlaybackControlsController* mController;
- HbWidget *mControl;
- TMPXVideoPlaybackControls mControlIndex;
- TUint mProperties;
-};
-
-#endif /*MPXVIDEOPLAYBACKFULLSCREENCONTROL_H_*/
-
--- a/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackprogressbar.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +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 QMPXVideoPlaybackProgressBar
-*
-*/
-
-// Version : %version: da1mmcf#13 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKPROGRESSBAR_H_
-#define MPXVIDEOPLAYBACKPROGRESSBAR_H_
-
-#include <QObject>
-#include <mpxplaybackframeworkdefs.h>
-
-class QTimer;
-class HbProgressSlider;
-class QMPXVideoPlaybackViewFileDetails;
-class QMPXVideoPlaybackControlsController;
-
-class QMPXVideoPlaybackProgressBar : public QObject
-{
- Q_OBJECT
-
- public:
- QMPXVideoPlaybackProgressBar( QMPXVideoPlaybackControlsController* controller );
- virtual ~QMPXVideoPlaybackProgressBar();
- void initialize();
- void updateWithFileDetails( QMPXVideoPlaybackViewFileDetails* details );
- void updateState( TMPXPlaybackState state );
-
- public:
- void durationChanged( int duration );
- void positionChanged( int position );
-
- private slots:
- void handleSliderPressed();
- void handleSliderMoved( int value );
- void handleSliderReleased();
- void handleSeekingTimeout();
-
- private:
- QString valueToReadableFormat( int value );
- void updatePostion( int position );
-
- private:
- QMPXVideoPlaybackControlsController *mController;
- HbProgressSlider *mProgressSlider;
-
- int mDuration;
- int mDraggingPosition;
- int mSetPosition;
-
- bool mNeedToResumeAfterSetPosition;
- bool mInitialized;
- bool mSliderDragging;
- bool mLongTimeFormat;
- bool mLiveStreaming;
-
- QTimer *mSeekingTimer;
-};
-
-#endif /*MPXVIDEOPLAYBACKPROGRESSBAR_H_*/
-
--- a/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackstatuspanecontrol.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +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 QMPXVideoPlaybackStatusPaneControl
-*
-*/
-
-// Version : %version: 10 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKSTATUSPANECONTROL_H_
-#define MPXVIDEOPLAYBACKSTATUSPANECONTROL_H_
-
-
-#include "mpxvideoplaybackfullscreencontrol.h"
-
-
-class HbLabel;
-class HbAction;
-class HbGroupBox;
-class QGraphicsWidget;
-class QMPXVideoPlaybackViewFileDetails;
-class QMPXVideoPlaybackControlsController;
-
-class QMPXVideoPlaybackStatusPaneControl : public QMPXVideoPlaybackFullScreenControl
-{
- Q_OBJECT
-
- public:
- QMPXVideoPlaybackStatusPaneControl( QMPXVideoPlaybackControlsController* controller,
- TMPXVideoPlaybackControls index,
- HbWidget* widget,
- TUint controlproperties );
-
- virtual ~QMPXVideoPlaybackStatusPaneControl();
-
- public:
-
- /**
- * Set visibility of each control
- */
- void setVisibility( TMPXPlaybackState aState );
-
- /*
- * Update the controls with the file details
- */
- void updateControlsWithFileDetails( QMPXVideoPlaybackViewFileDetails *details );
-
- void setVisible( bool visible );
-
- bool isVisible();
-
- void setMenu( QMPXVideoPlaybackViewFileDetails* details );
-
- void controlListUpdated( QMPXVideoPlaybackViewFileDetails* details );
-
- private slots:
- void handleAboutToShow();
- void handleAboutToHide();
- void openFullScreenView();
-
- private:
- bool mVisible;
- HbAction *mActionBack;
- HbLabel *mTitleLabel;
- HbGroupBox *mTitleGroupBox;
- QGraphicsWidget *mTitleLayout;
-};
-
-#endif /*MPXVIDEOPLAYBACKSTATUSPANECONTROL_H_*/
-
--- a/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybacktoolbar.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,123 +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 QMPXVideoPlaybackToolBar
-*
-*/
-
-// Version : %version: 3 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKTOOLBAR_H_
-#define MPXVIDEOPLAYBACKTOOLBAR_H_
-
-#include <QObject>
-
-#include <MMFScalingCustomCommandConstants.h>
-#include <mpxplaybackframeworkdefs.h>
-
-
-class QTimer;
-class HbIcon;
-class HbAction;
-class HbToolBar;
-class HbToolButton;
-class QMPXVideoPlaybackViewFileDetails;
-class QMPXVideoPlaybackControlsController;
-
-// DATA TYPES
-
-enum TMPXButton
-{
- EMPX1stButton,
- EMPX2ndButton,
- EMPX3rdButton,
- EMPX4thButton,
- EMPX5thButton,
- EMPXButtonCount // Should always be the last value
-};
-
-enum TMPXButtonIcon
-{
- EMPXRWIcon,
- EMPXPlayIcon,
- EMPXPauseIcon,
- EMPXFFIcon,
- EMPXNaturalIcon,
- EMPXStretchIcon,
- EMPXZoomIcon,
- EMPXDetailsIcon,
- EMPXAttachIcon,
- EMPXShareIcon,
- EMPXIconCount // Should always be the last value
-};
-
-enum TMPXSeekingState
-{
- EMPXNotSeeking,
- EMPXFastForwarding,
- EMPXRewinding
-};
-
-const int KMPXFastForward = 30;
-const int KMPXRewind = -10;
-
-class QMPXVideoPlaybackToolBar : public QObject
-{
- Q_OBJECT
-
- public:
- QMPXVideoPlaybackToolBar( QMPXVideoPlaybackControlsController* controller );
- virtual ~QMPXVideoPlaybackToolBar();
- void updateState( TMPXPlaybackState state );
- void aspectRatioChanged( int aspectRatio );
- void initialize();
- void updateWithFileDetails( QMPXVideoPlaybackViewFileDetails* details );
- void positionChanged( int position );
- void durationChanged( int duration );
- void setVisible( bool visible );
-
- private slots:
- void playPause();
- void changeAspectRatio();
- void handleButtonPressed();
- void handleRWButtonPressed();
- void handleFFButtonPressed();
- void ffPressing();
- void rwPressing();
- void ffReleased();
- void rwReleased();
- void openDetailsView();
- void retrieveButtons();
-
- private:
- QMPXVideoPlaybackControlsController *mController;
- HbToolBar *mToolBar;
- QTimer *mSeekStartTimer;
- QTimer *mRetrieveButtonTimer;
-
- QList<HbIcon*> mButtonIcons;
- QList<HbAction*> mButtonActions;
- QList<HbToolButton*> mButtons;
-
- TMPXSeekingState mSeekingState;
-
- bool mInitialized;
- int mPosition;
- int mDuration;
- int mAspectRatio;
- TReal32 mDisplayAspectRatio;
-};
-
-#endif /*MPXVIDEOPLAYBACKTOOLBAR_H_*/
--- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolbar.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,194 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackControlBar
-*
-*/
-
-// Version : %version: 7 %
-
-
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybacktoolbar.h"
-#include "mpxvideoplaybackcontrolbar.h"
-#include "mpxvideoplaybackprogressbar.h"
-#include "mpxcommonvideoplaybackview.hrh"
-#include "mpxvideoplaybackcontrolscontroller.h"
-
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlBar::QMPXVideoPlaybackControlBar()
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackControlBar::QMPXVideoPlaybackControlBar(
- QMPXVideoPlaybackControlsController* controller )
- : mController( controller )
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlBar::QMPXVideoPlaybackControlBar"));
-
- //
- // create toolbar handler
- //
- mToolBar = new QMPXVideoPlaybackToolBar( mController );
-
- //
- // create progressbar handler
- //
- mProgressBar = new QMPXVideoPlaybackProgressBar( mController );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlBar::~QMPXVideoPlaybackControlBar()
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackControlBar::~QMPXVideoPlaybackControlBar()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlBar::~QMPXVideoPlaybackControlBar()"));
-
- if ( mProgressBar )
- {
- delete mProgressBar;
- mProgressBar = NULL;
- }
-
- if ( mToolBar )
- {
- delete mToolBar;
- mToolBar = NULL;
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlBar::initialize()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlBar::initialize()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlBar::initialize()"));
-
- if ( mProgressBar )
- {
- mProgressBar->initialize();
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlBar::updateState()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlBar::updateState( TMPXPlaybackState state )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlBar::updateState() state = %d"), state );
-
- if ( mToolBar )
- {
- mToolBar->updateState( state );
- }
-
- if ( mProgressBar )
- {
- mProgressBar->updateState( state );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlBar::aspectRatioChanged()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlBar::aspectRatioChanged( int aspectRatio )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlBar::aspectRatioChanged() aspectRatio = %d"), aspectRatio );
-
- if ( mToolBar )
- {
- mToolBar->aspectRatioChanged( aspectRatio );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlBar::updateWithFileDetails()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlBar::updateWithFileDetails(
- QMPXVideoPlaybackViewFileDetails* details )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlBar::updateWithFileDetails()"));
-
- if ( mToolBar )
- {
- mToolBar->updateWithFileDetails( details );
- }
-
- if ( mProgressBar )
- {
- mProgressBar->updateWithFileDetails( details );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlBar::setVisibleToControlBar()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlBar::setVisibleToControlBar( bool visible )
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlBar::setVisibleToControlBar()"),
- _L("visible = %d, current visibility = %d"), visible, isVisible() );
-
- if ( visible != isVisible() )
- {
- setVisible( visible );
- mToolBar->setVisible( visible );
- }
-}
-
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlBar::durationChanged()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlBar::durationChanged( int duration )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlBar::durationChanged()"));
-
- if ( mProgressBar )
- {
- mProgressBar->durationChanged( duration );
- }
-
- if ( mToolBar )
- {
- mToolBar->durationChanged( duration );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlBar::positionChanged()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlBar::positionChanged( int position )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlBar::positionChanged()"));
-
- if ( mProgressBar )
- {
- mProgressBar->positionChanged( position );
- }
-
- if ( mToolBar )
- {
- mToolBar->positionChanged( position );
- }
-}
-
-//End of file
--- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolconfiguration.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,212 +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 QMPXVideoPlaybackControlConfiguration
-*
-*/
-
-// Version : %version: da1mmcf#20 %
-
-
-
-// INCLUDE FILES
-
-#include <QGraphicsWidget>
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackdocumentloader.h"
-#include "mpxvideoplaybackviewfiledetails.h"
-#include "mpxvideoplaybackcontrolconfiguration.h"
-#include "mpxvideoplaybackcontrolscontroller.h"
-
-
-// ================= MEMBER FUNCTIONS ==============================================================
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackControlConfiguration::CMPXVideoPlaybackControlConfiguration()
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackControlConfiguration::QMPXVideoPlaybackControlConfiguration(
- QMPXVideoPlaybackControlsController* controller)
- : mControlsController( controller )
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlConfiguration::~QMPXVideoPlaybackControlConfiguration()
-// Destructor.
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackControlConfiguration::~QMPXVideoPlaybackControlConfiguration()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::~QMPXVideoPlaybackControlConfiguration"));
-
- mControlsList.clear();
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlConfiguration::createControlList()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlConfiguration::createControlList()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::createControlList()"));
-
- QMPXVideoPlaybackViewFileDetails* fileDetails = mControlsController->fileDetails();
-
- addControlToList( EMPXStatusPane );
-
- if ( fileDetails->mPlaybackMode == EMPXVideoStreaming ||
- fileDetails->mPlaybackMode == EMPXVideoLiveStreaming )
- {
- //
- // streaming, add branding animation control to show while initializing
- //
- addControlToList( EMPXBufferingAnimation );
- }
- else if ( fileDetails->mRNFormat )
- {
- addControlToList( EMPXRealLogoBitmap );
- }
-
- emit controlListUpdated();
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlConfiguration::controlList
-// -------------------------------------------------------------------------------------------------
-//
-QList<TMPXVideoPlaybackControls>& QMPXVideoPlaybackControlConfiguration::controlList()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::controlList()"));
-
- return mControlsList;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlConfiguration::updateControlList
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlConfiguration::updateControlList(
- TMPXVideoPlaybackControlCommandIds event )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::updateControlList(%d)"), event);
-
- QGraphicsWidget *widget =
- mControlsController->layoutLoader()->findWidget( QString( "transparentWindow" ) );
-
- switch ( event )
- {
- case EMPXControlCmdFullScreenViewOpened:
- {
- MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::updateControlList() full screen view"));
-
- widget->setVisible( true );
-
- deleteControlFromList( EMPXDetailsViewPlaybackWindow );
- deleteControlFromList( EMPXFileDetailsWidget );
- deleteControlFromList( EMPXIndicatorBitmap );
-
- break;
- }
- case EMPXControlCmdDetailsViewOpened:
- {
- MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::updateControlList() details view"));
-
- widget->setVisible( false );
-
- deleteControlFromList( EMPXIndicatorBitmap );
-
- addControlToList( EMPXDetailsViewPlaybackWindow );
-
- addControlToList( EMPXFileDetailsWidget );
-
- break;
- }
- case EMPXControlCmdTvOutConnected:
- case EMPXControlCmdAudionOnlyViewOpened:
- {
- MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::updateControlList() audio only view"));
-
- widget->setVisible( false );
-
- deleteControlFromList( EMPXDetailsViewPlaybackWindow );
-
- addControlToList( EMPXIndicatorBitmap );
- addControlToList( EMPXFileDetailsWidget );
-
- break;
- }
- case EMPXControlCmdRemoveRNLogo:
- {
- MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::updateControlList() RN Logo removed"));
-
- deleteControlFromList( EMPXRealLogoBitmap );
-
- break;
- }
- }
-
- emit controlListUpdated();
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlConfiguration::deleteControlFromList
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlConfiguration::deleteControlFromList(
- TMPXVideoPlaybackControls control )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::deleteControlFromList(%d)"), control);
-
- mControlsList.removeAll( control );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlConfiguration::addControlToList
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlConfiguration::addControlToList(
- TMPXVideoPlaybackControls control )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::addControlToList(%d)"), control);
-
- if ( ! mControlsList.contains( control ) )
- {
- mControlsList.append( control );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlConfiguration::updateControlsWithFileDetails
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlConfiguration::updateControlsWithFileDetails()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::updateControlsWithFileDetails()"));
-
- addControlToList( EMPXControlBar );
-
- if ( mControlsController->fileDetails()->mVideoEnabled )
- {
- MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::updateControlsWithFileDetails() video enabled"));
-
- QGraphicsWidget *widget =
- mControlsController->layoutLoader()->findWidget( QString( "transparentWindow" ) );
- widget->setVisible( true );
- }
-
- emit controlListUpdated();
-}
-
-// End of File
--- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolpolicy.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,143 +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 MPXVideoPlaybackControlPolicy
-*
-*/
-
-// Version : %version: da1mmcf#14 %
-
-
-
-// INCLUDE FILES
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackcontrolpolicy.h"
-#include "mpxvideoplaybackviewfiledetails.h"
-
-// ================= MEMBER FUNCTIONS ==============================================================
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackControlPolicy::CMPXVideoPlaybackControlPolicy()
-// C++ default constructor can NOT contain any code, that might leave.
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackControlPolicy::QMPXVideoPlaybackControlPolicy()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlPolicy::QMPXVideoPlaybackControlPolicy()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlPolicy::~QMPXVideoPlaybackControlPolicy()
-// Destructor.
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackControlPolicy::~QMPXVideoPlaybackControlPolicy()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlPolicy::~QMPXVideoPlaybackControlPolicy()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlPolicy::setControlProperties()
-// -------------------------------------------------------------------------------------------------
-//
-void
-QMPXVideoPlaybackControlPolicy::setControlProperties( TMPXVideoPlaybackControls controlIndex,
- TUint& properties,
- QMPXVideoPlaybackViewFileDetails *details,
- TPlaybackViewMode viewMode )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlPolicy::setControlProperties()"));
-
- properties = 0;
-
- switch ( controlIndex )
- {
- case EMPXBufferingAnimation:
- {
- properties = EMPXShownWhenInitializing |
- EMPXShownWhenBuffering;
- break;
- }
- case EMPXStatusPane:
- {
- //
- // If it is local playback & full screen view, show the controls while buffering
- // If not, won't show
- //
- if ( details->mPlaybackMode == EMPXVideoLocal && viewMode == EFullScreenView )
- {
- properties = EMPXShownWhenPlaying |
- EMPXShownWhenPaused |
- EMPXShownWhenSeeking |
- EMPXShownWhenBuffering;
- }
- else
- {
- properties = EMPXAllProperties;
- }
- break;
- }
- case EMPXControlBar:
- {
- //
- // We don't delete Tool Bar and Progress Bar from the controlsList
- // to update information all the time though it's not visible or activated
- // So just hide these if it is details view
- //
- if ( viewMode == EDetailsView )
- {
- properties = 0;
- }
- else if ( viewMode == EAudioOnlyView )
- {
- properties = EMPXAllProperties;
- }
- else
- {
- //
- // If it is local playback, show the controls while buffering
- // If not, won't show
- //
- if ( details->mPlaybackMode == EMPXVideoLocal )
- {
- properties = EMPXShownWhenPlaying |
- EMPXShownWhenPaused |
- EMPXShownWhenSeeking |
- EMPXShownWhenBuffering;
- }
- else
- {
- properties = EMPXShownWhenPlaying |
- EMPXShownWhenPaused |
- EMPXShownWhenSeeking;
- }
- }
- break;
- }
- case EMPXFileDetailsWidget:
- case EMPXIndicatorBitmap:
- case EMPXRealLogoBitmap:
- case EMPXDetailsViewPlaybackWindow:
- {
- //
- // Add all these controls when it is details view or audio only view
- // Once it's added to controlsList, these are visible always
- //
- properties = EMPXAllProperties;
- break;
- }
- }
-}
-
-// End of File
--- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolscontroller.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1561 +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 MPXVideoPlaybackControlsController
-*
-*/
-
-// Version : %version: da1mmcf#41 %
-
-
-
-// INCLUDE FILES
-#include <coecntrl.h>
-#include <bautils.h>
-#include <barsread.h>
-#include <f32file.h>
-
-#include <QTimer>
-#include <thumbnailmanager_qt.h>
-#include <xqserviceutil.h>
-
-#include <hblabel.h>
-#include <hbvolumesliderpopup.h>
-#include <hbtransparentwindow.h>
-#include <hbiconanimationmanager.h>
-#include <shareui.h>
-#include <hbinstance.h>
-#include <hbtapgesture.h>
-#include <hbpangesture.h>
-
-#include "mpxvideoviewwrapper.h"
-#include "hbvideobaseplaybackview.h"
-#include "mpxvideoplaybackcontrolbar.h"
-#include "mpxvideoplaybackcontrolpolicy.h"
-#include "mpxvideoplaybackdocumentloader.h"
-#include "mpxvideoplaybackviewfiledetails.h"
-#include "mpxvideoplaybackstatuspanecontrol.h"
-#include "mpxvideoplaybackfiledetailswidget.h"
-#include "mpxvideoplaybackfullscreencontrol.h"
-#include "mpxvideoplaybackcontrolscontroller.h"
-#include "mpxvideoplaybackcontrolconfiguration.h"
-#include "mpxvideoplaybackdetailsplaybackwindow.h"
-#include "videoservices.h"
-
-
-// ================= MEMBER FUNCTIONS ==============================================================
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController()
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController(
- HbVideoBasePlaybackView *view,
- CMPXVideoViewWrapper *viewWrapper,
- QMPXVideoPlaybackViewFileDetails *details )
- : mView( view )
- , mViewWrapper( viewWrapper )
- , mFileDetails( details )
- , mControlsPolicy( NULL )
- , mControlsConfig( NULL )
- , mControlsTimer( NULL )
- , mRNLogoTimer( NULL )
- , mLoader( NULL )
- , mVolumeControl( NULL )
- , mThumbnailManager( NULL )
- , mVideoServices( 0 )
- , mViewTransitionIsGoingOn( false )
- , mIsAttachOperation( false )
- , mThumbNailState( EThumbNailEmpty )
- , mState( EPbStateNotInitialised )
- , mViewMode( EFullScreenView )
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController()"));
-
- initializeController();
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::initializeController()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::initializeController()
-{
- 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
- //
- ok = false;
- mLoader = new QMPXVideoPlaybackDocumentLoader( this );
- mLoader->load( KMPXPLAYBACKVIEW_XML, &ok );
-
- if ( ok )
- {
- QGraphicsWidget *widget = mLoader->findWidget( QString( "content" ) );
- mView->setWidget( widget );
- }
- else
- {
- MPX_DEBUG(
- _L("QMPXVideoPlaybackControlsController::initializeController()- can't find xml"));
-
- //
- // Can't find xml for layout. Delete mLoader
- //
- delete mLoader;
- mLoader = NULL;
- }
-
- mFileDetails->mRNFormat = realFormat( mFileDetails->mClipName );
-
- //
- // Controls dismissing timer
- //
- mControlsTimer = new QTimer( this );
- mControlsTimer->setInterval( KMPXControlsTimeOut );
- mControlsTimer->setSingleShot( false );
- connect( mControlsTimer, SIGNAL( timeout() ), this, SLOT( hideAllControls() ) );
-
- mControlsPolicy = new QMPXVideoPlaybackControlPolicy();
-
- mControlsConfig = new QMPXVideoPlaybackControlConfiguration( this );
- connect( mControlsConfig, SIGNAL( controlListUpdated() ), this, SLOT( controlsListUpdated() ) );
- mControlsConfig->createControlList();
-
- //
- // Create volume popup control
- //
- mVolumeControl = new HbVolumeSliderPopup();
- mVolumeControl->setVisible( false );
- mVolumeControl->setTimeout( KMPXControlsTimeOut );
- mVolumeControl->setTickPosition( Hb::NoSliderTicks );
- mVolumeControl->setRange( KPbPlaybackVolumeLevelMin, KPbPlaybackVolumeLevelMax );
-
- //
- // grab tap gesture
- //
- mView->grabGesture( Qt::TapGesture );
- connect( mView, SIGNAL( tappedOnScreen() ), this, SLOT( handleTappedOnScreen() ) );
-
- //
- // grab pan gesture for playlist
- //
- if ( mFileDetails->mMultiItemPlaylist )
- {
- mView->grabGesture( Qt::PanGesture );
- connect( mView, SIGNAL( pannedToRight() ), this, SLOT( skipToPreviousVideoItem() ) );
- connect( mView, SIGNAL( pannedToLeft() ), this, SLOT( skipToNextVideoItem() ) );
- }
-
- //
- // if videoplayback is in service mode, create a videoservices instance
- //
- if ( XQServiceUtil::isService() && ! mVideoServices )
- {
- //
- // obtain VideoServices instance
- //
- mVideoServices = VideoServices::instance();
-
- //
- // allow 'attach' operation only for non-streaming media clips
- //
- if ( mVideoServices && mFileDetails->mPlaybackMode == EMPXVideoLocal )
- {
- //
- // determine if this is 'attach' operation
- //
- mIsAttachOperation = ( mVideoServices->currentService() == VideoServices::EUriFetcher );
-
- if ( mIsAttachOperation )
- {
- //
- // connect signal filePath() to videoservices slot itemSelected()
- //
- connect( this, SIGNAL( attachVideoPath( const QString& ) ),
- mVideoServices, SLOT( itemSelected( const QString& ) ) );
- }
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController()"));
-
- mView->ungrabGesture( Qt::TapGesture );
- disconnect( mView, SIGNAL( tappedOnScreen() ), this, SLOT( handleTappedOnScreen() ) );
-
- if ( mFileDetails->mMultiItemPlaylist )
- {
- mView->ungrabGesture( Qt::PanGesture );
-
- disconnect( mView, SIGNAL( pannedToRight() ), this, SLOT( skipToNextVideoItem() ) );
- disconnect( mView, SIGNAL( pannedToLeft() ), this, SLOT( skipToPreviousVideoItem() ) );
- }
-
- disconnect( mControlsConfig, SIGNAL( controlListUpdated() ), this, SLOT( controlsListUpdated() ) );
- disconnect( mControlsTimer, SIGNAL( timeout() ), this, SLOT( hideAllControls() ) );
- disconnect( hbInstance->allMainWindows()[0], SIGNAL( orientationChanged( Qt::Orientation ) ),
- this, SLOT( handleOrientationChanged( Qt::Orientation ) ) );
-
- mView->setWidget( NULL );
-
- mControls.clear();
-
- if ( mControlsTimer )
- {
- delete mControlsTimer;
- mControlsTimer = NULL;
- }
-
- if ( mRNLogoTimer )
- {
- disconnect( mRNLogoTimer, SIGNAL( timeout() ), this, SLOT( handleRNLogoTimeout() ) );
-
- delete mRNLogoTimer;
- mRNLogoTimer = NULL;
- }
-
- if ( mControlsPolicy )
- {
- delete mControlsPolicy;
- mControlsPolicy = NULL;
- }
-
- if ( mControlsConfig )
- {
- delete mControlsConfig;
- mControlsConfig = NULL;
- }
-
- if ( mLoader )
- {
- delete mLoader;
- mLoader = NULL;
- }
-
- if ( mThumbnailManager )
- {
- delete mThumbnailManager;
- mThumbnailManager = NULL;
- }
-
- if ( mVolumeControl )
- {
- delete mVolumeControl;
- mVolumeControl = NULL;
- }
-
- if ( mIsAttachOperation )
- {
- //
- // disable connection for 'attach' operation
- //
- disconnect( this, SIGNAL( attachVideoPath( const QString& ) ),
- mVideoServices, SLOT( itemSelected( const QString& ) ) );
- }
-
- if ( mVideoServices )
- {
- //
- // decrease videoservices instance count
- //
- mVideoServices->decreaseReferenceCount();
- mVideoServices = 0;
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::addFileDetails()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::addFileDetails(
- QMPXVideoPlaybackViewFileDetails* details )
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::addFileDetails"));
-
- mFileDetails = details;
-
- mFileDetails->mRNFormat = realFormat( mFileDetails->mClipName );
-
- mControlsConfig->updateControlsWithFileDetails();
-
- //
- // for audio-only clips and tv-out, default view is flip view
- //
- if ( ! details->mVideoEnabled )
- {
- changeViewMode( EAudioOnlyView, false );
- }
-
- if ( details->mTvOutConnected )
- {
- handleEvent( EMPXControlCmdTvOutConnected );
- }
-
- //
- // Dimmed the volume control if it is video only
- //
- if ( ! mFileDetails->mAudioEnabled )
- {
- mVolumeControl->setValue( 0 );
- mVolumeControl->setEnabled( false );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::handleEvent
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::handleEvent(
- TMPXVideoPlaybackControlCommandIds event, int value )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::handleEvent(%d)"), event);
-
- switch ( event )
- {
- case EMPXControlCmdSetPosition:
- {
- MPX_DEBUG(_L(" [EMPXControlCmdSetPosition [%d]]"), value );
-
- positionChanged( (qreal)value / (qreal)KPbMilliMultiplier);
- break;
- }
- case EMPXControlCmdSetDuration:
- {
- MPX_DEBUG(_L(" [EMPXControlCmdSetDuration [%d]]"), value );
-
- durationChanged( (qreal)value / (qreal)KPbMilliMultiplier );
- break;
- }
- case EMPXControlCmdStateChanged:
- {
- MPX_DEBUG(_L(" [EMPXControlCmdStateChanged]"));
-
- handleStateChange( (TMPXPlaybackState)value );
- break;
- }
- case EMPXControlCmdSetVolume:
- {
- MPX_DEBUG(_L(" [EMPXControlCmdSetVolume [%d]]"), value );
-
- volumeChanged( value );
- break;
- }
- case EMPXControlCmdSetAspectRatio:
- {
- MPX_DEBUG(_L(" [EMPXControlCmdSetAspectRatio %d]"), value );
-
- aspectRatioChanged( value );
-
- break;
- }
- case EMPXControlCmdSetDownloadSize:
- {
- MPX_DEBUG(_L(" [EMPXControlCmdSetDownloadSize [%d]]"), value );
- setDownloadSize( value );
- break;
- }
- case EMPXControlCmdDownloadUpdated:
- {
- MPX_DEBUG(_L(" [EMPXControlCmdDownloadUpdated [%d]]"), value );
- updateDownloadPosition( value );
- break;
- }
- case EMPXControlCmdDownloadComplete:
- {
- MPX_DEBUG(_L(" [EMPXControlCmdDownloadComplete [%d]]"), value);
- updateDownloadPosition( value );
- break;
- }
- case EMPXControlCmdSetDownloadPaused:
- case EMPXControlCmdClearDownloadPaused:
- {
- mControlsConfig->updateControlList( event );
- break;
- }
- case EMPXControlCmdTvOutConnected:
- {
- MPX_DEBUG(_L(" [EMPXControlCmdTvOutConnected]"));
-
- handleTvOutEvent( true, event );
- break;
- }
- case EMPXControlCmdTvOutDisconnected:
- {
- MPX_DEBUG(_L(" [EMPXControlCmdTvOutDisConnected]"));
-
- handleTvOutEvent( false, event );
- break;
- }
- case EMPXControlCmdHandleErrors:
- {
- MPX_DEBUG(_L(" [EMPXControlCmdHandleErrors]"));
-
- handleErrors();
-
- break;
- }
- case EMPXControlCmdShowVolumeControls:
- {
- MPX_DEBUG(_L(" [EMPXControlCmdShowVolumeControls]"));
-
- showVolumeControls();
- break;
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::handleStateChange
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::handleStateChange( TMPXPlaybackState newState )
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::handleStateChange()"),
- _L("new state = %d"), newState );
-
- //
- // Somehow EPbStatePlaying, EPbStatePaused gets called twice continously
- //
- if ( newState != mState )
- {
- mState = newState;
-
- switch ( newState )
- {
- case EPbStatePlaying:
- case EPbStateInitialising:
- case EPbStateBuffering:
- case EPbStatePaused:
- case EPbStateNotInitialised:
- {
- //
- // Show all the controls
- //
- showControls();
-
- updateState();
-
- break;
- }
- default:
- {
- break;
- }
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::controlsListUpdated()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::controlsListUpdated()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::controlsListUpdated()"));
-
- hideAllControls();
-
- QList<TMPXVideoPlaybackControls>& updatedList = mControlsConfig->controlList();
-
- QList<TMPXVideoPlaybackControls> myList = updatedList;
-
- int controlCount = mControls.count();
-
- int i = 0 ;
- int index = KErrNotFound;
-
-
- for ( int iCnt = 0 ; iCnt < controlCount ; iCnt++ )
- {
- index = myList.indexOf( mControls[i]->controlIndex() );
-
- if ( index == KErrNotFound )
- {
- //
- // Delete control since it doesn't exist in new list
- //
- mControls.removeAt( i );
- }
- else
- {
- //
- // Control exists in new list.
- // Update the policy property based on file details and view mode to the controls
- //
- TUint properties = 0;
- mControlsPolicy->setControlProperties(
- mControls[i]->controlIndex(), properties, mFileDetails, mViewMode );
- mControls[i]->updateControlProperties( properties );
-
- //
- // Control exists in new list.
- //
- myList.removeAt( index );
- i++;
- }
- }
-
- //
- // The updated list will contain added controls only
- //
- for ( int j = 0 ; j < myList.count() ; j++ )
- {
- appendControl( myList[j] );
- }
-
- for ( int i = 0 ; i < mControls.count() ; i++ )
- {
- mControls[i]->updateControlsWithFileDetails( mFileDetails );
- }
-
- showControls();
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::appendControl()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::appendControl( TMPXVideoPlaybackControls controlIndex )
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::appendControl()"),
- _L("control index = %d"), controlIndex );
-
- TUint properties = 0;
-
- mControlsPolicy->setControlProperties( controlIndex, properties, mFileDetails, mViewMode );
- QMPXVideoPlaybackFullScreenControl* control;
-
- switch ( controlIndex )
- {
- 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
- //
- QGraphicsWidget *widget = mLoader->findWidget( QString( "bufferingIcon" ) );
- HbLabel *bufferingAnim = qobject_cast<HbLabel*>( widget );
-
- control = new QMPXVideoPlaybackFullScreenControl( this,
- controlIndex,
- bufferingAnim,
- properties );
- mControls.append( control );
-
- break;
- }
- case EMPXStatusPane:
- {
- //
- // Status key (signal + title + back key)
- //
- control = new QMPXVideoPlaybackStatusPaneControl( this,
- controlIndex,
- NULL,
- properties );
- mControls.append( control );
-
- break;
- }
- case EMPXControlBar:
- {
- //
- // Button bar
- //
- QGraphicsWidget *widget = mLoader->findWidget( QString( "controlBarLayout" ) );
- QMPXVideoPlaybackControlBar *controlBar =
- qobject_cast<QMPXVideoPlaybackControlBar*>( widget );
- controlBar->initialize();
-
- control = new QMPXVideoPlaybackFullScreenControl( this,
- controlIndex,
- controlBar,
- properties );
- mControls.append( control );
-
- break;
- }
- case EMPXFileDetailsWidget:
- {
- QGraphicsWidget *widget = mLoader->findWidget( QString( "fileDetailsLayout" ) );
- QMPXVideoPlaybackFileDetailsWidget *fileDetails =
- qobject_cast<QMPXVideoPlaybackFileDetailsWidget*>( widget );
-
- control = new QMPXVideoPlaybackFullScreenControl( this,
- controlIndex,
- fileDetails,
- properties );
-
- mControls.append( control );
- break;
- }
- case EMPXIndicatorBitmap:
- {
- QGraphicsWidget *widget = mLoader->findWidget( QString( "bitmapLayout" ) );
- HbWidget *bitmapWidget = qobject_cast<HbWidget*>( widget );
-
- setDefaultBitmap();
- control = new QMPXVideoPlaybackFullScreenControl( this,
- controlIndex,
- bitmapWidget,
- properties );
- mControls.append( control );
-
- break;
- }
- case EMPXRealLogoBitmap:
- {
- QGraphicsWidget *widget = mLoader->findWidget( QString( "rnLogoBitmap" ) );
- HbWidget *bitmapWidget = qobject_cast<HbWidget*>( 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" ) );
- QMPXVideoPlaybackDetailsPlaybackWindow *detailsPlaybackWindow =
- qobject_cast<QMPXVideoPlaybackDetailsPlaybackWindow*>( widget );
- detailsPlaybackWindow->initialize();
-
- control = new QMPXVideoPlaybackFullScreenControl( this,
- controlIndex,
- detailsPlaybackWindow,
- properties );
- mControls.append( control );
-
- break;
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::handleTappedOnScreen()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::handleTappedOnScreen()
-
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::handleTappedOnScreen()"));
-
- //
- // If we are in full screen view, toggle the visibility when playing and paused
- // If we are in details view, issue playpause
- // If we are in audio only view, ignore
- //
- switch( mViewMode )
- {
- case EFullScreenView:
- {
- if ( mState == EPbStatePlaying || mState == EPbStatePaused )
- {
- if ( isVisible() )
- {
- //
- // If the volume control is visible, hide it
- //
- if ( mVolumeControl->isVisible() )
- {
- mVolumeControl->setVisible( false );
- }
-
- hideAllControls();
- }
- else
- {
- showControls();
- }
- }
-
- break;
- }
- case EDetailsView:
- {
- handleCommand( EMPXPbvCmdPlayPause );
-
- break;
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::resetDisappearingTimers()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::resetDisappearingTimers( TMPXTimerAction timerAction )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::resetDisappearingTimers()"));
-
- if ( mControlsTimer->isActive() )
- {
- mControlsTimer->stop();
- }
-
- //
- // Do not start the time for DetailsView and AudioOnlyView
- //
- if ( timerAction == EMPXTimerReset &&
- mState == EPbStatePlaying &&
- mViewMode == EFullScreenView )
- {
- MPX_DEBUG(_L(" Starting Controls Timer"));
-
- mControlsTimer->start();
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::hideAllControls()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::hideAllControls()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::hideControls()"));
-
- resetDisappearingTimers( EMPXTimerCancel );
-
- for ( int i = 0 ; i < mControls.count() ; i++ )
- {
- mControls[i]->setVisible( false );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::showControls()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::showControls()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::showControls()"));
-
- resetDisappearingTimers( EMPXTimerReset );
-
- if ( ! mViewTransitionIsGoingOn && mOrientation == Qt::Horizontal )
- {
- for ( int i = 0 ; i < mControls.count() ; i++ )
- {
- mControls[i]->setVisibility( mState );
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::isVisible()
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackControlsController::isVisible()
-{
- bool visible = false;
-
- for ( int i = 0 ; i < mControls.count() ; i++ )
- {
- if ( mControls[i]->controlIndex() == EMPXControlBar )
- {
- if ( mControls[i]->isVisible() )
- {
- visible = true;
- }
-
- break;
- }
- }
-
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::isVisible() [%d]"), visible);
-
- return visible;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::handleCommand()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::handleCommand(
- TMPXVideoPlaybackViewCommandIds command, int value )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::handleCommand(%d)"), command);
-
- switch( command )
- {
- case EMPXPbvCmdSetPosition:
- {
- TRAP_IGNORE( mViewWrapper->SetPropertyL( EPbPropertyPosition,
- value * KPbMilliMultiplier ) );
- break;
- }
- case EMPXPbvCmdSetVolume:
- {
- TRAP_IGNORE( mViewWrapper->SetPropertyL( EPbPropertyVolume, value ) );
- break;
- }
- default:
- {
- TRAP_IGNORE( mViewWrapper->HandleCommandL( command ) );
- break;
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::volumeChanged()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::volumeChanged( int volume )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::volumeChanged() [%d]"), volume);
-
- if ( mVolumeControl )
- {
- mVolumeControl->setValue( volume );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::showVolumeControls()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::showVolumeControls()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::showVolumeControls()"));
-
- if ( mVolumeControl )
- {
- mVolumeControl->setVisible( true );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::durationChanged()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::durationChanged( int duration )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::durationChanged() [%d]"), duration);
-
- for ( int i = 0 ; i < mControls.count() ; i++ )
- {
- if ( mControls[i]->durationChanged( duration ) )
- {
- break;
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::positionChanged()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::positionChanged( int position )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::positionChanged() [%d]"), position);
-
- for ( int i = 0 ; i < mControls.count() ; i++ )
- {
- if ( mControls[i]->positionChanged( position ) )
- {
- break;
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::aspectRatioChanged()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::aspectRatioChanged( int aspectRatio )
-{
- MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::aspectRatioChanged() [%d]"), aspectRatio);
-
- for ( int i = 0 ; i < mControls.count() ; i++ )
- {
- if ( mControls[i]->aspectRatioChanged( aspectRatio ) )
- {
- break;
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::updateState()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::updateState()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::updateState() [%d]"), mState);
-
- for ( int i = 0 ; i < mControls.count() ; i++ )
- {
- mControls[i]->updateState( mState );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::realFormat()
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackControlsController::realFormat( QString filename )
-{
- bool realFormat = false;
-
- if ( !filename.isNull() && !filename.isEmpty() )
- {
- if ( mFileDetails->mPlaybackMode == EMPXVideoStreaming ||
- mFileDetails->mPlaybackMode == EMPXVideoLiveStreaming )
- {
- TBufC<255> file(filename.utf16());
- realFormat = realFormatForStreaming( file );
- }
- else
- {
- realFormat = realFormatForLocal();
- }
- }
-
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::realFormat() [%d]"), realFormat);
-
- return realFormat;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::realFormatForStreaming()
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackControlsController::realFormatForStreaming( const TDesC& des )
-{
- bool realFormat = false;
- TParse filePath;
-
- _LIT(KMPXRMEXT, ".R" );
-
- int err = filePath.Set( des, NULL, NULL );
-
- //
- // It is valid to have a "\" character in a url, but parsing fails,
- // switch these characters to "/" for the local string and try parsing again.
- //
- if ( err == KErrBadName )
- {
- int backsashPos = des.LocateF('\\');
-
- if( backsashPos != KErrNotFound )
- {
- HBufC* fileName = NULL;
-
- TRAP( err, fileName = des.AllocL() );
-
- if ( err == KErrNone )
- {
- int count( fileName->Des().Length() );
-
- for ( int j = backsashPos ; j < count; ++j )
- {
- if ( fileName->Des()[j]== '\\' )
- {
- fileName->Des()[j]='/';
- }
- }
- err = filePath.Set( fileName->Des(), NULL, NULL );
- }
-
- if ( fileName )
- {
- delete fileName;
- fileName = NULL;
- }
- }
- }
-
- if ( err == KErrNone )
- {
- //
- // The requirement to support arguments with the extension in streaming links
- // for-ex: /video.3gp?start=10&end=40 will have to supported
- // as well. So just by doing p.Ext() would retrieve all the string
- // after "." so by doing a Left(2) would retrieve only
- // .3g or .rm and so on. This would help better
- // interpret the extension and decide the branding accordingly
- //
- filePath.Set( filePath.NameAndExt(), NULL, NULL );
- TPtrC extension = filePath.Ext().Left( 2 );
-
- TBuf<2> buf;
- buf.Format( extension );
- buf.UpperCase();
-
- // RealMedia Branding
- if ( ! buf.Compare( KMPXRMEXT ) )
- {
- realFormat = true;
- }
- }
-
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::realFormatForStreaming()[%d]"), realFormat);
-
- return realFormat;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::realFormatForLocal()
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackControlsController::realFormatForLocal()
-{
- bool realFormat = false;
-
- QString real( "real" );
- QString rn( "rn" );
-
- if ( mFileDetails->mMimeType.contains( real, Qt::CaseInsensitive ) ||
- mFileDetails->mMimeType.contains( rn, Qt::CaseInsensitive ) )
- {
- realFormat = true;
- }
-
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::realFormatForLocal() [%d]"), realFormat);
-
- return realFormat;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::setDownloadSize()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::setDownloadSize( int size )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::setDownloadSize() [%d]"), size);
-
- for ( int i = 0 ; i < mControls.count() ; i++ )
- {
- if ( mControls[i]->setDownloadSize( size ) )
- {
- break;
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::updateDownloadPosition()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::updateDownloadPosition( int size )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::updateDownloadPosition() [%d]"), size);
-
- for ( int i = 0 ; i < mControls.count() ; i++ )
- {
- if ( mControls[i]->updateDownloadPosition( size ) )
- {
- break;
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::handleErrors
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::handleErrors()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::handleErrors()"),
- _L("mState = %d"), mState );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::isSoftKeyVisible()
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackControlsController::isSoftKeyVisible()
-{
- bool visible = false;
-
- for ( int i = 0 ; i < mControls.count() ; i++ )
- {
- if ( mControls[i]->controlIndex() == EMPXStatusPane )
- {
- if ( mControls[i]->isVisible() )
- {
- visible = true;
- }
-
- break;
- }
- }
-
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::isSoftKeyVisible() [%d]"), visible);
-
- return visible;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::handleTvOutEvent
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::handleTvOutEvent(
- bool connected, TMPXVideoPlaybackControlCommandIds event )
-{
- Q_UNUSED( event );
-
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::handleTvOutEvent()"));
-
- mFileDetails->mTvOutConnected = connected;
-
- setDefaultBitmap();
-
- if ( mFileDetails->mTvOutConnected )
- {
- generateThumbNail();
- }
-
- //
- // Change the view.
- // If Tv-out is connected, go to AudioOnlyView.
- // If not, go back to default view.
- //
- TPlaybackViewMode viewMode = EFullScreenView;
-
- if ( mFileDetails->mTvOutConnected || ! mFileDetails->mVideoEnabled )
- {
- viewMode = EAudioOnlyView;
- }
-
- changeViewMode( viewMode, false );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::changeViewMode
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::changeViewMode(
- TPlaybackViewMode viewMode, bool transitionEffect )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::changeViewMode( %d, %d )"),
- viewMode, transitionEffect );
-
- if ( viewMode != mViewMode )
- {
- switch ( viewMode )
- {
- case EFullScreenView:
- case EDetailsView:
- {
- if ( mFileDetails->mVideoEnabled && ! mFileDetails->mTvOutConnected )
- {
- mViewMode = viewMode;
-
- //
- // Hack to clean up the screen before transition. We may not need it in NGA env
- //
- hideAllControls();
-
- updateVideoRect( transitionEffect );
- }
-
- break;
- }
- case EAudioOnlyView:
- {
- if ( ! mFileDetails->mVideoEnabled || mFileDetails->mTvOutConnected )
- {
- mViewMode = viewMode;
-
- mControlsConfig->updateControlList( EMPXControlCmdAudionOnlyViewOpened );
- }
-
- break;
- }
- default:
- {
- break;
- }
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::updateVideoRectDone
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::updateVideoRectDone()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::updateVideoRectDone()"));
-
- mViewTransitionIsGoingOn = false;
-
- TMPXVideoPlaybackControlCommandIds event = EMPXControlCmdFullScreenViewOpened;
-
- if ( mViewMode == EDetailsView )
- {
- event = EMPXControlCmdDetailsViewOpened;
- }
-
- mControlsConfig->updateControlList( event );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::skipToPreviousVideoItem
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::skipToPreviousVideoItem()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::skipToPreviousVideoItem()"));
-
- if ( mViewMode == EFullScreenView )
- {
- handleCommand( EMPXPbvCmdPreviousListItem );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::skipToNextVideoItem
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::skipToNextVideoItem()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::skipToNextVideoItem()"));
-
- if ( mViewMode == EFullScreenView )
- {
- handleCommand( EMPXPbvCmdNextListItem );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::updateVideoRect()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::updateVideoRect( bool transitionEffect )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::updateVideoRect( %d )"),
- transitionEffect );
-
- if ( mFileDetails->mVideoEnabled && ! mFileDetails->mTvOutConnected )
- {
- mViewTransitionIsGoingOn = true;
-
- QRectF rect;
-
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::updateVideoRect() : mViewMode = %d )"),
- mViewMode );
-
- if ( mViewMode == EDetailsView )
- {
- QGraphicsWidget *parent = mLoader->findWidget( QString( "detailsPlaybackWindow" ) );
- QGraphicsWidget *child = mLoader->findWidget( QString( "small_transparentWindow" ) );
-
- rect = parent->mapRectToScene( child->geometry() );
- }
- else if ( mViewMode == EFullScreenView )
- {
- QGraphicsWidget *widget = mLoader->findWidget( QString( "content" ) );
- rect = widget->geometry();
- }
-
- mViewWrapper->UpdateVideoRect(
- rect.x(), rect.y(), rect.width(), rect.height(), transitionEffect );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::setDefaultBitmap()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::setDefaultBitmap()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::setDefaultBitmap()"));
-
- //
- // set specific bitmaps for audio only and tv out cases
- // If we already requested a thumbnail, we will set the thumbnail after we receive the thumbnail
- //
- if ( mLoader && mThumbNailState != EThumbNailRequsted )
- {
- QGraphicsWidget *tvOutBitmap = mLoader->findWidget( "tvOutBitmap" );
- tvOutBitmap->setVisible( false );
-
- QGraphicsWidget *realAudioOnlyBitmap = mLoader->findWidget( "realAudioOnlyBitmap" );
- realAudioOnlyBitmap->setVisible( false );
-
- QGraphicsWidget *partialAudioOnlyBitmap = mLoader->findWidget( "partialAudioOnlyBitmap" );
- partialAudioOnlyBitmap->setVisible( false );
-
- QGraphicsWidget *audioOnlyBitmap = mLoader->findWidget( "audioOnlyBitmap" );
- audioOnlyBitmap->setVisible( false );
-
- if ( mFileDetails->mTvOutConnected )
- {
- tvOutBitmap->setVisible( true );
- }
- else if ( mFileDetails->mRNFormat )
- {
- realAudioOnlyBitmap->setVisible( true );
- }
- else if ( mFileDetails->mPartialPlayback )
- {
- partialAudioOnlyBitmap->setVisible( true );
- }
- else
- {
- audioOnlyBitmap->setVisible( true );
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::generateThumbNail()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::generateThumbNail()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::generateThumbNail()"));
-
- //
- // Generate thumbnail if it is local playback
- //
- if ( mFileDetails->mPlaybackMode == EMPXVideoLocal )
- {
- if ( mThumbNailState == EThumbNailEmpty )
- {
- mThumbnailManager = new ThumbnailManager(); ;
-
- mThumbnailManager->setThumbnailSize( ThumbnailManager::ThumbnailLarge );
- mThumbnailManager->setQualityPreference( ThumbnailManager::OptimizeForPerformance );
-
- if ( connect( mThumbnailManager, SIGNAL( thumbnailReady( QPixmap , void * , int , int ) ),
- this, SLOT( handleThumbnailReady( QPixmap , void * , int , int ) ) ) )
- {
- mThumbnailManager->getThumbnail( mFileDetails->mClipName );
- mThumbNailState = EThumbNailRequsted;
- }
- }
- }
- else
- {
- mThumbNailState = EThumbNailNotAvailable;
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::handleThumbnailReady()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::handleThumbnailReady(
- QPixmap tnData, void *internal , int id, int error )
-{
- Q_UNUSED( internal );
- Q_UNUSED( id );
-
- if( ! error && mLoader )
- {
- QGraphicsWidget *tvOutBitmap = mLoader->findWidget( "tvOutBitmap" );
- HbLabel *tvOutLabel = qobject_cast<HbLabel*>( tvOutBitmap );
-
- QIcon *qicon = new QIcon( tnData );
-
- HbIcon *hbIcon = new HbIcon( *qicon );
- hbIcon->setSize( tvOutBitmap->size() );
- tvOutLabel->setIcon( *hbIcon );
-
- mThumbNailState = EThumbNailSet;
- }
- else
- {
- mThumbNailState = EThumbNailNotAvailable;
- }
-
- setDefaultBitmap();
-
- disconnect( mThumbnailManager, SIGNAL( thumbnailReady( QPixmap , void * , int , int ) ),
- this, SLOT( handleThumbnailReady( QPixmap , void * , int , int ) ) );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::attachVideo()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::attachVideo()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::attachVideo()"),
- _L("file = %s"), mFileDetails->mClipName.data() );
-
- //
- // close playback view
- //
- mView->closePlaybackView();
-
- //
- // emit signal to launch videoservices itemSelected() slot
- //
- emit( attachVideoPath( mFileDetails->mClipName ) );
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::sendVideo()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::sendVideo()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::sendVideo()"),
- _L("file = %s"), mFileDetails->mClipName.data() );
-
- //
- // pause playback
- //
- handleCommand( EMPXPbvCmdPause );
-
- //
- // send video to shareUI
- //
- ShareUi dlg;
- QStringList fileList;
- fileList.append( mFileDetails->mClipName );
- 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
--- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackdetailsplaybackwindow.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,170 +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 QMPXVideoPlaybackDetailsPlaybackWindow
-*
-*/
-
-// Version : %version: 18 %
-
-
-
-#include <QGraphicsSceneMouseEvent>
-
-#include <hbframeitem.h>
-#include <hbpushbutton.h>
-#include <hbframedrawer.h>
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackdocumentloader.h"
-#include "mpxvideoplaybackcontrolscontroller.h"
-#include "mpxvideoplaybackdetailsplaybackwindow.h"
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDetailsPlaybackWindow::QMPXVideoPlaybackDetailsPlaybackWindow
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackDetailsPlaybackWindow::QMPXVideoPlaybackDetailsPlaybackWindow(
- QMPXVideoPlaybackControlsController* controller )
- : mController( controller )
- , mInitialized( false )
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackDetailsPlaybackWindow::QMPXVideoPlaybackDetailsPlaybackWindow()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDetailsPlaybackWindow::~QMPXVideoPlaybackDetailsPlaybackWindow
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackDetailsPlaybackWindow::~QMPXVideoPlaybackDetailsPlaybackWindow()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackDetailsPlaybackWindow::~QMPXVideoPlaybackDetailsPlaybackWindow()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDetailsPlaybackWindow::initialize
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackDetailsPlaybackWindow::initialize()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackDetailsPlaybackWindow::initialize()"));
-
- QMPXVideoPlaybackDocumentLoader *loader = mController->layoutLoader();
-
- //
- // Don't need to initialize buttons once it gets initialized
- //
- if ( loader && ! mInitialized )
- {
- mInitialized = true;
-
- QMPXVideoPlaybackViewFileDetails *details = mController->fileDetails();
-
- //
- // Connect signal and slot for play button
- //
- QGraphicsWidget *widget = loader->findWidget( QString( "detailsViewPlayButton" ) );
- mPlayButton = qobject_cast<HbPushButton*>( widget );
- mPlayButton->setFlag( QGraphicsItem::ItemIsFocusable, false );
-
- connect( mPlayButton, SIGNAL( released() ), this, SLOT( playPause() ) );
-
- //
- // Set framedrawer for semi transparent background
- //
- HbFrameDrawer *drawer = mPlayButton->frameBackground();
-
- if( drawer == NULL )
- {
- drawer = new HbFrameDrawer();
- }
-
- drawer->setFillWholeRect( true );
- drawer->setFrameType( HbFrameDrawer::NinePieces );
- drawer->setFrameGraphicsName( "qtg_fr_multimedia_trans" );
- mPlayButton->setFrameBackground( drawer );
-
- //
- // create 'attach' button and connect corresponding signal/slot
- //
- QGraphicsWidget *detailsAttachWidget = loader->findWidget( QString( "detailsAttachButton" ) );
- HbPushButton *attachButton = qobject_cast<HbPushButton*>( detailsAttachWidget );
- connect( attachButton, SIGNAL( released() ), mController, SLOT( attachVideo() ) );
-
- //
- // create 'share' button and connect corresponding signal/slot
- //
- QGraphicsWidget *detailsShareWidget = loader->findWidget( QString( "detailsShareButton" ) );
- HbPushButton *shareButton = qobject_cast<HbPushButton*>( detailsShareWidget );
- connect( shareButton, SIGNAL( released() ), mController, SLOT( sendVideo() ) );
-
- //
- // by default in xml layout, attachButton is not visible while shareButton is visible.
- // if it's an 'attach' operation, reverse the visibility order
- //
- if ( mController->isAttachOperation() )
- {
- attachButton->setVisible( true );
- shareButton->setVisible( false );
- }
- else
- {
- //
- // dim "share" button for streaming
- //
- if ( details->mPlaybackMode == EMPXVideoStreaming ||
- details->mPlaybackMode == EMPXVideoLiveStreaming )
- {
- shareButton->setEnabled( false );
- }
- }
- }
-
- updateState( mController->state() );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDetailsPlaybackWindow::updateState()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackDetailsPlaybackWindow::updateState( TMPXPlaybackState state )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackDetailsPlaybackWindow::updateState() state = %d"), state );
-
- switch ( state )
- {
- case EPbStatePaused:
- {
- mPlayButton->setVisible( true );
- break;
- }
- default:
- {
- mPlayButton->setVisible( false );
- break;
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDetailsPlaybackWindow::playPause()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackDetailsPlaybackWindow::playPause()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackDetailsPlaybackWindow::playPause"));
-
- mController->handleCommand( EMPXPbvCmdPlayPause );
-}
-
-//End of file
--- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackdocumentloader.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +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 QMPXVideoPlaybackDocumentLoader
-*
-*/
-
-// Version : %version: 14 %
-
-
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackcontrolbar.h"
-#include "mpxvideoplaybackdocumentloader.h"
-#include "mpxvideoplaybackfiledetailswidget.h"
-#include "mpxvideoplaybackcontrolscontroller.h"
-#include "mpxvideoplaybackcontrolconfiguration.h"
-#include "mpxvideoplaybackdetailsplaybackwindow.h"
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::QMPXVideoPlaybackDocumentLoader
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackDocumentLoader::QMPXVideoPlaybackDocumentLoader(
- QMPXVideoPlaybackControlsController *controller )
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackDocumentLoader::QMPXVideoPlaybackDocumentLoader()"));
-
- mController = controller;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::~QMPXVideoPlaybackDocumentLoader
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackDocumentLoader::~QMPXVideoPlaybackDocumentLoader()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::~QMPXVideoPlaybackDocumentLoader") );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::createObject()
-// -------------------------------------------------------------------------------------------------
-//
-QObject *QMPXVideoPlaybackDocumentLoader::createObject( const QString& type, const QString &name )
-{
- MPX_ENTER_EXIT(
- _L("QMPXVideoPlaybackDocumentLoader::createObject()"),
- _L("type = %s, name = %s"), type.data(), name.data() );
-
- QObject *object = NULL;
-
- if ( name == "controlBarLayout" )
- {
- object = new QMPXVideoPlaybackControlBar( mController );
- object->setObjectName( name );
- }
- else if ( name == "fileDetailsLayout" )
- {
- object = new QMPXVideoPlaybackFileDetailsWidget( mController );
- object->setObjectName( name );
- }
- else if ( name == "detailsPlaybackWindow" )
- {
- object = new QMPXVideoPlaybackDetailsPlaybackWindow( mController );
- object->setObjectName( name );
- }
- else
- {
- object = HbDocumentLoader::createObject( type, name );
- }
-
- return object;
-}
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackfiledetailswidget.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,454 +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 QMPXVideoPlaybackFileDetailsWidget
-*
-*/
-
-// Version : %version: 26 %
-
-
-#include <QDir>
-#include <QDateTime>
-#include <QFileInfo>
-
-#include <hbglobal.h>
-#include <hblistwidgetitem.h>
-#include <hbratingslider.h>
-#include <hblistwidget.h>
-#include <hblistviewitem.h>
-#include <hbextendedlocale.h>
-#include <hbanchorlayout.h>
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackdocumentloader.h"
-#include "mpxvideoplaybackfiledetailswidget.h"
-#include "mpxvideoplaybackdocumentloader.h"
-#include "mpxvideoplaybackcontrolscontroller.h"
-
-const float KILOBYTE = 1024 ;
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFileDetailsWidget::QMPXVideoPlaybackFileDetailsWidget
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackFileDetailsWidget::QMPXVideoPlaybackFileDetailsWidget(
- QMPXVideoPlaybackControlsController* controller )
- : mController( controller )
- , mListWidget( 0 )
- , mFileDetailsUpdated( false )
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackFileDetailsWidget::QMPXVideoPlaybackFileDetailsWidget()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFileDetailsWidget::~QMPXVideoPlaybackFileDetailsWidget
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackFileDetailsWidget::~QMPXVideoPlaybackFileDetailsWidget()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackFileDetailsWidget::~QMPXVideoPlaybackFileDetailsWidget()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFileDetailsWidget::updateWithFileDetails
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackFileDetailsWidget::updateWithFileDetails(
- QMPXVideoPlaybackViewFileDetails* details )
-{
- QMPXVideoPlaybackDocumentLoader *loader = mController->layoutLoader();
-
- if ( loader )
- {
- //
- // load fileDetails widget
- //
- QGraphicsWidget *widget = loader->findWidget( QString( "fileDetails" ) );
-
- //
- // cast fileDetails widget to HbListWidget
- //
- mListWidget = qobject_cast<HbListWidget*>( widget );
-
- //
- // set the min/max number of lines in the second row
- //
- HbListViewItem *prototype = mListWidget->listItemPrototype();
- prototype->setSecondaryTextRowCount( 1, 30 );
-
- //
- // Title
- //
- makeTitleItem( details );
-
- if ( ! mFileDetailsUpdated )
- {
- HbExtendedLocale locale = HbExtendedLocale::system();
-
- mFileDetailsUpdated = true;
-
- //
- // Description
- //
- addItemToListWidget(
- hbTrId( "txt_videos_list_description" ), details->mDescription );
-
- //
- // Duration
- //
- if ( details->mPlaybackMode != EMPXVideoLiveStreaming && details->mDuration > 0 )
- {
- int value = (qreal)details->mDuration / (qreal)KPbMilliMultiplier;
- QString hour = locale.toString( value / 3600 );
- value = value % 3600;
- QString min = locale.toString( value / 60 );
- value = value % 60;
- QString sec = locale.toString( value );
-
- addItemToListWidget(
- hbTrId( "txt_videos_list_duration" ),
- hbTrId( "txt_videos_list_l1l2l3" ).arg( hour ).arg( min ).arg( sec ) );
- }
-
- //
- // Date/Time
- //
- makeDateTimeItem( details );
-
- //
- // 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
- //
- makeSizeItem( details );
-
- //
- // Resolution
- //
- if ( details->mVideoEnabled )
- {
- QString resolution = hbTrId( "txt_videos_list_l1l2" )
- .arg( locale.toString( details->mVideoWidth ) )
- .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
- //
- if ( details->mPlaybackMode == EMPXVideoLocal ||
- details->mPlaybackMode == EMPXVideoProgressiveDownload)
- {
- QFileInfo fileInfo( details->mClipName );
- QString folder = fileInfo.dir().dirName();
- addItemToListWidget( hbTrId( "txt_videos_list_collection_name" ), folder );
- }
- }
-
- //
- // Set the rect size dynamically based on the view mode
- //
- QGraphicsWidget *content = loader->findWidget( QString( "content" ) );
- HbAnchorLayout *layout = static_cast<HbAnchorLayout*>( content->layout() );
-
- if ( layout )
- {
- 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 );
-
- break;
- }
- case EAudioOnlyView:
- {
- QGraphicsWidget *controlLayout = loader->findWidget( QString( "controlBarLayout" ) );
- QRectF controlRect = controlLayout->geometry();
-
- 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;
- }
- }
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFileDetailsWidget::makeTitleItem
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackFileDetailsWidget::makeTitleItem( QMPXVideoPlaybackViewFileDetails* details )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackFileDetailsWidget::makeTitleItem()"));
-
- //
- // Title should be the first item in file details list
- //
- if ( mController->viewMode() == EAudioOnlyView )
- {
- //
- // show the title for audio-only view
- //
- if ( mListWidget->count() == 0 || ! mListWidget->item( 0 )->text().contains( "Title", Qt::CaseInsensitive ) )
- {
- QString title = details->mTitle;
-
- if ( title.count() == 0 )
- {
- //
- // If title is not available, show clip name
- //
- QFileInfo fileInfo( details->mClipName );
- title = fileInfo.completeBaseName();
- }
-
- //
- // populate Title and its associated text
- //
- HbListWidgetItem* listWidgetItem = new HbListWidgetItem();
- listWidgetItem->setText( hbTrId( "txt_videos_list_title" ) );
- listWidgetItem->setSecondaryText( title );
- mListWidget->insertItem( 0, listWidgetItem );
- }
- }
- else if ( mListWidget->count() &&
- mListWidget->item( 0 )->text().contains( "Title", Qt::CaseInsensitive ) )
- {
- //
- // title is displayed under the status pane for video clips,
- // so hide the title for this details view
- //
- delete mListWidget->takeItem ( 0 );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFileDetailsWidget::makeSizeItem
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackFileDetailsWidget::makeSizeItem( QMPXVideoPlaybackViewFileDetails* details )
-{
- if ( details->mPlaybackMode == EMPXVideoLocal ||
- details->mPlaybackMode == EMPXVideoProgressiveDownload )
- {
- QFileInfo fileInfo( details->mClipName );
-
- //
- // to prevent overflow, get an unsigned value of file size
- //
- ulong fileSize = fileInfo.size();
-
- //
- // convert file size to KB, MB, GB accordingly
- //
- if ( fileSize > 0 )
- {
- HbExtendedLocale locale = HbExtendedLocale::system();
-
- QString scale;
-
- //
- // cast for later conversion with floating point
- //
- float size = (float) fileSize;
-
- if ( size > KILOBYTE )
- {
- size /= KILOBYTE;
- scale = hbTrId( "txt_videos_list_l1_kb" );
- }
-
- if ( size > KILOBYTE )
- {
- size /= KILOBYTE;
- scale = hbTrId( "txt_videos_list_l1_mb" );
- }
-
- if ( size > KILOBYTE )
- {
- size /= KILOBYTE;
- scale = hbTrId( "txt_videos_list_l1_gb" );
- }
-
- int temp = size * 10;
- size = (float)temp / 10;
-
- addItemToListWidget(
- hbTrId( "txt_videos_list_file_size" ), scale.arg( locale.toString( size ) ) );
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFileDetailsWidget::makeBitRateItem
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackFileDetailsWidget::makeBitRateItem( QMPXVideoPlaybackViewFileDetails* details )
-{
- if ( details->mBitRate > 0 )
- {
- HbExtendedLocale locale = HbExtendedLocale::system();
-
- float bitrate = details->mBitRate;
-
- QString scale = hbTrId( "txt_videos_list_l1_kbps" );
-
- if ( bitrate > KILOBYTE )
- {
- bitrate /= KILOBYTE;
- }
-
- if ( bitrate > KILOBYTE )
- {
- bitrate /= KILOBYTE;
- scale = hbTrId( "txt_videos_list_l1_mbps" );
- }
-
- int temp = bitrate * 10;
- bitrate = (float)temp / 10;
-
- addItemToListWidget(
- hbTrId( "txt_videos_list_bitrate" ), scale.arg( locale.toString( bitrate ) ) );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFileDetailsWidget::addItemToListWidget
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackFileDetailsWidget::addItemToListWidget( QString item, QString text )
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackFileDetailsWidget::addItemToListWidget"));
-
- if ( text.count() > 0 )
- {
- MPX_DEBUG(_L("QMPXVideoPlaybackFileDetailsWidget::addItemToListWidget( %s %s )"),
- item.data(), text.data() );
-
- HbListWidgetItem* listWidgetItem = new HbListWidgetItem();
- listWidgetItem->setText( item );
- listWidgetItem->setSecondaryText( text );
-
- mListWidget->addItem( listWidgetItem );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFileDetailsWidget::makeDateTimeItem
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackFileDetailsWidget::makeDateTimeItem( QMPXVideoPlaybackViewFileDetails* details )
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackFileDetailsWidget::makeDateTimeItem"));
-
- //
- // attempt to get 'created' and 'last modified' date/time from metadata first,
- // if it's not available, then get it from the file system
- //
-
- if ( details->mPlaybackMode == EMPXVideoLocal ||
- details->mPlaybackMode == EMPXVideoProgressiveDownload )
- {
- QDateTime dateTime;
- QFileInfo fileInfo( details->mClipName );
- HbExtendedLocale locale = HbExtendedLocale::system();
-
- //
- // Date created
- //
- if ( details->mCreationTime > 0 )
- {
- dateTime.setTime_t( details->mCreationTime );
- }
- else
- {
- dateTime = fileInfo.created();
- }
-
- //
- // convert 'created' date/time to proper string format
- // according to its current locale
- //
- QString date = locale.format( dateTime.date(), r_qtn_date_usual );
- QString time = locale.format( dateTime.time(), r_qtn_time_long_with_zero );
- addItemToListWidget( hbTrId( "txt_videos_list_date" ), date + " " + time );
-
- //
- // Date modified
- //
- if ( details->mModificationTime > 0 )
- {
- dateTime.setTime_t( details->mModificationTime );
- }
- else
- {
- dateTime = fileInfo.lastModified();
- }
-
- //
- // convert 'last modified' date/time to proper string format
- // according to its current locale
- //
- date = locale.format( dateTime.date(), r_qtn_date_usual );
- time = locale.format( dateTime.time(), r_qtn_time_long_with_zero );
- addItemToListWidget( hbTrId( "txt_videos_list_modified" ), date + " " + time );
- }
-}
-
-//End of file
--- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackfullscreencontrol.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,312 +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 QMPXVideoPlaybackFullScreenControl
-*
-*/
-
-// Version : %version: da1mmcf#9 %
-
-
-
-#include <w32std.h>
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackcontrolbar.h"
-#include "mpxvideoplaybackfullscreencontrol.h"
-#include "mpxvideoplaybackfiledetailswidget.h"
-#include "mpxvideoplaybackcontrolscontroller.h"
-#include "mpxvideoplaybackdetailsplaybackwindow.h"
-
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFullScreenControl::QMPXVideoPlaybackFullScreenControl()
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackFullScreenControl::QMPXVideoPlaybackFullScreenControl(
- QMPXVideoPlaybackControlsController* controller,
- TMPXVideoPlaybackControls index,
- HbWidget* widget,
- TUint controlproperties )
- : mController( controller )
- , mControl( widget )
- , mControlIndex( index )
- , mProperties( controlproperties )
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackFullScreenControl::QMPXVideoPlaybackFullScreenControl()"));
-
- setParent( mController );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFullScreenControl::~QMPXVideoPlaybackFullScreenControl()
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackFullScreenControl::~QMPXVideoPlaybackFullScreenControl()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackFullScreenControl"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFullScreenControl::setVisible()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackFullScreenControl::setVisible( bool visible )
-{
- switch ( mControlIndex )
- {
- case EMPXControlBar:
- {
- static_cast<QMPXVideoPlaybackControlBar*>(mControl)->setVisibleToControlBar( visible );
- break;
- }
- default:
- {
- mControl->setVisible( visible );
- break;
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFullScreenControl::isVisible()
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackFullScreenControl::isVisible()
-{
- return mControl->isVisible();
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFullScreenControl::setVisibility()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackFullScreenControl::setVisibility( TMPXPlaybackState state )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackFullScreenControl::setVisibility()"));
-
- bool visible = false;
-
- switch( state )
- {
- case EPbStatePlaying:
- {
- if ( mProperties & EMPXShownWhenPlaying )
- {
- visible = true;
- }
- break;
- }
- case EPbStatePaused:
- {
- if ( mProperties & EMPXShownWhenPaused )
- {
- visible = true;
- }
- break;
- }
- case EPbStatePluginSeeking:
- {
- if ( mProperties & EMPXShownWhenSeeking )
- {
- visible = true;
- }
- break;
- }
- case EPbStateBuffering:
- {
- if ( mProperties & EMPXShownWhenBuffering )
- {
- visible = true;
- }
- break;
- }
- case EPbStateNotInitialised:
- case EPbStateInitialising:
- {
- if ( mProperties & EMPXShownWhenInitializing )
- {
- visible = true;
- }
- break;
- }
- }
-
- setVisible( visible );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFullScreenControl::controlIndex()
-// -------------------------------------------------------------------------------------------------
-//
-TMPXVideoPlaybackControls QMPXVideoPlaybackFullScreenControl::controlIndex()
-{
- return mControlIndex;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFullScreenControl::durationChanged()
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackFullScreenControl::durationChanged( int duration )
-{
- bool changed = EFalse;
-
- if ( mControlIndex == EMPXControlBar )
- {
- MPX_DEBUG(_L("QMPXVideoPlaybackFullScreenControl::DurationChanged() [%d]"), duration);
-
- static_cast<QMPXVideoPlaybackControlBar*>(mControl)->durationChanged( duration );
-
- changed = ETrue;
- }
-
- return changed;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFullScreenControl::positionChanged()
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackFullScreenControl::positionChanged( int position )
-{
- bool changed = EFalse;
-
- if ( mControlIndex == EMPXControlBar )
- {
- MPX_DEBUG(_L("QMPXVideoPlaybackFullScreenControl::positionChanged() [%d]"), position);
-
- static_cast<QMPXVideoPlaybackControlBar*>(mControl)->positionChanged( position );
-
- changed = ETrue;
- }
-
- return changed;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFullScreenControl::aspectRatioChanged()
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackFullScreenControl::aspectRatioChanged( int aspectRatio )
-{
- bool changed = EFalse;
-
- if ( mControlIndex == EMPXControlBar )
- {
- MPX_DEBUG(
- _L("QMPXVideoPlaybackFullScreenControl::aspectRatioChanged() [%d]"), aspectRatio);
-
- static_cast<QMPXVideoPlaybackControlBar*>(mControl)->aspectRatioChanged( aspectRatio );
-
- changed = ETrue;
- }
-
- return changed;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFullScreenControl::setDownloadSize()
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackFullScreenControl::setDownloadSize( int /*size*/ )
-{
- bool changed = EFalse;
-
- /*
- if ( mControlIndex == EMPXProgressBar )
- {
- MPX_DEBUG(_L("QMPXVideoPlaybackFullScreenControl::SetDownloadSize() [%d]"), size);
-
- //static_cast<CMPXVideoPlaybackProgressBar*>(mControl)->SetDownloadSize( size );
-
- changed = ETrue;
- }
-*/
- return changed;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFullScreenControl::updateDownloadPosition()
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackFullScreenControl::updateDownloadPosition( int /*size*/ )
-{
- bool changed = EFalse;
-
- /*
- if ( mControlIndex == EMPXProgressBar )
- {
- MPX_DEBUG(_L("QMPXVideoPlaybackFullScreenControl::UpdateDownloadPosition() [%d]"), size);
-
- //static_cast<CMPXVideoPlaybackProgressBar*>(mControl)->updateDownloadPosition( size );
-
- changed = ETrue;
- }*/
-
- return changed;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFullScreenControl::updateState()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackFullScreenControl::updateState( TMPXPlaybackState state )
-{
- switch ( mControlIndex )
- {
- case EMPXControlBar:
- {
- static_cast<QMPXVideoPlaybackControlBar*>(mControl)->updateState( state );
- break;
- }
- case EMPXDetailsViewPlaybackWindow:
- {
- static_cast<QMPXVideoPlaybackDetailsPlaybackWindow*>(mControl)->updateState( state );
- break;
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFullScreenControl::updateControlsWithFileDetails()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackFullScreenControl::updateControlsWithFileDetails(
- QMPXVideoPlaybackViewFileDetails* details )
-{
- switch ( mControlIndex )
- {
- case EMPXControlBar:
- {
- static_cast<QMPXVideoPlaybackControlBar*>(mControl)->updateWithFileDetails( details );
- break;
- }
- case EMPXFileDetailsWidget:
- {
- static_cast<QMPXVideoPlaybackFileDetailsWidget*>(mControl)->updateWithFileDetails( details );
- break;
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFullScreenControl::updateControlProperties()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackFullScreenControl::updateControlProperties( TUint properties )
-{
- mProperties = properties;
-}
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackprogressbar.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,435 +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 QMPXVideoPlaybackProgressBar
-*
-*/
-
-// Version : %version: da1mmcf#24 %
-
-
-
-
-#include <QTime>
-#include <QTimer>
-#include <QGraphicsSceneMouseEvent>
-
-#include <hblabel.h>
-#include <hbframeitem.h>
-#include <hbframedrawer.h>
-#include <hbprogressslider.h>
-#include <hbextendedlocale.h>
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackprogressbar.h"
-#include "mpxvideoplaybackdocumentloader.h"
-#include "mpxvideoplaybackcontrolscontroller.h"
-
-const int KSeekingTimeOut = 250;
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackProgressBar::QMPXVideoPlaybackProgressBar
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackProgressBar::QMPXVideoPlaybackProgressBar(
- QMPXVideoPlaybackControlsController* controller )
- : mController( controller )
- , mDraggingPosition( 0 )
- , mSetPosition( -1 )
- , mNeedToResumeAfterSetPosition( false )
- , mInitialized( false )
- , mSliderDragging( false )
- , mLongTimeFormat( false )
- , mLiveStreaming( false )
- , mSeekingTimer( NULL )
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackProgressBar::QMPXVideoPlaybackProgressBar()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackProgressBar::~QMPXVideoPlaybackProgressBar
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackProgressBar::~QMPXVideoPlaybackProgressBar()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackProgressBar::~QMPXVideoPlaybackProgressBar()"));
-
- if ( mSeekingTimer )
- {
- disconnect( mSeekingTimer, SIGNAL( timeout() ), this, SLOT( handleSeekingTimeout() ) );
-
- if ( mSeekingTimer->isActive() )
- {
- mSeekingTimer->stop();
- }
-
- delete mSeekingTimer;
- mSeekingTimer = NULL;
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackProgressBar::initialize
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackProgressBar::initialize()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackProgressBar::initialize()"));
-
- QMPXVideoPlaybackDocumentLoader *loader = mController->layoutLoader();
-
- //
- // Don't need to initialize buttons once it gets initialized
- //
- if ( loader && ! mInitialized )
- {
- mInitialized = true;
- mLiveStreaming =
- ( mController->fileDetails()->mPlaybackMode == EMPXVideoLiveStreaming )? true:false;
-
- //
- // Create a timer for seeking.
- // We will issue SetPosition every KSeekingTimeOut msec to show the current frame to user
- //
- mSeekingTimer = new QTimer();
- mSeekingTimer->setSingleShot( false );
- mSeekingTimer->setInterval( KSeekingTimeOut );
- connect( mSeekingTimer, SIGNAL( timeout() ), this, SLOT( handleSeekingTimeout() ) );
-
- //
- // progress slider
- //
- QGraphicsWidget *widget = loader->findWidget( QString( "progressSlider" ) );
- mProgressSlider = qobject_cast<HbProgressSlider*>( widget );
-
- connect( mProgressSlider, SIGNAL( sliderPressed() ), this, SLOT( handleSliderPressed() ) );
- connect( mProgressSlider, SIGNAL( sliderReleased() ), this, SLOT( handleSliderReleased() ) );
- connect( mProgressSlider, SIGNAL( sliderMoved( int ) ), this, SLOT( handleSliderMoved( int ) ) );
-
- //
- // If we init the progress bar after pp sends the duration informatin
- // we need to set the duration manually
- //
- durationChanged( (qreal)mController->fileDetails()->mDuration / (qreal)KPbMilliMultiplier );
-
- //
- // Set the position to 0 until we get position information
- //
- positionChanged( 0 );
-
- //
- // 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 );
- mProgressSlider->setBackgroundItem( frameItem );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackProgressBar::durationChanged
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackProgressBar::durationChanged( int duration )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::durationChanged duration = %d"), duration );
-
- if ( mLiveStreaming )
- {
- mDuration = 0;
- mProgressSlider->setMaxText( "Live" );
- }
- else
- {
- mDuration = duration;
-
- if ( ( mDuration / 3600 ) > 0 )
- {
- mLongTimeFormat = true;
- }
- else
- {
- mLongTimeFormat = false;
- }
-
- mProgressSlider->setMaxText( valueToReadableFormat( mDuration ) );
- }
-
- mProgressSlider->setRange( 0, mDuration );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackProgressBar::positionChanged
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackProgressBar::positionChanged( int position )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::positionChanged position = %d"), position );
-
- //
- // While dragging event, don't update old position information from mpx framework
- //
- if ( ! mSliderDragging )
- {
- updatePostion( position );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackProgressBar::updatePostion
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackProgressBar::updatePostion( int position )
-{
- if ( position < 0 )
- {
- position = 0;
- }
- else if ( position > mDuration && ! mLiveStreaming )
- {
- position = mDuration;
- }
-
- MPX_DEBUG(_L("QMPXVideoPlaybackProgressBar::updatePostion position = %d"), position );
-
- mProgressSlider->setMinText( valueToReadableFormat( position ) );
-
- //
- // Don't need to set the slider for live streaming
- //
- if ( ! mLiveStreaming )
- {
- mProgressSlider->setSliderValue( position );
- mProgressSlider->setProgressValue( position );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackProgressBar::valueToReadableFormat
-// -------------------------------------------------------------------------------------------------
-//
-QString QMPXVideoPlaybackProgressBar::valueToReadableFormat( int value )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::valueToReadableFormat value = %d"), value);
-
- int hour = value / 3600;
- value = value % 3600;
- int minutes = value / 60;
- value = value % 60;
- int second = value;
-
- QTime time( hour ,minutes ,second );
- QString str;
-
- HbExtendedLocale locale = HbExtendedLocale::system();
-
- if ( mLongTimeFormat )
- {
- str = locale.format( time, r_qtn_time_durat_long );
- }
- else
- {
- str = locale.format( time, r_qtn_time_durat_min_sec );
- }
-
- return str;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackProgressBar::handleSliderPressed
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackProgressBar::handleSliderPressed()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackProgressBar::handleSliderPressed()"));
-
- mSliderDragging = true;
-
- mController->resetDisappearingTimers( EMPXTimerCancel );
-
- //
- // Pause the playback if it's playing
- //
- if( mController->state() == EPbStatePlaying )
- {
- mNeedToResumeAfterSetPosition = true;
- mController->handleCommand( EMPXPbvCmdCustomPause );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackProgressBar::handleSliderMoved
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackProgressBar::handleSliderMoved( int value )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackProgressBar::handleSliderMoved() position = %d"), value);
-
- updatePostion( value );
-
- //
- // If the slider is dragging, start the timer and seek every KSeekingTimeOut msec
- //
- if ( mSliderDragging )
- {
- mDraggingPosition = value;
- MPX_DEBUG(_L("QMPXVideoPlaybackProgressBar::handleSliderMoved() mDraggingPosition = %d"), mDraggingPosition);
-
- if ( mSeekingTimer && ! mSeekingTimer->isActive() )
- {
- mSeekingTimer->start();
- }
- }
- else
- {
- if ( value >= mDuration )
- {
- MPX_DEBUG(_L("QMPXVideoPlaybackProgressBar::setPosition() reached end of the clip"));
-
- mController->handleCommand( EMPXPbvCmdEndOfClip );
- }
- else
- {
- value = mProgressSlider->sliderValue();
-
- MPX_DEBUG(_L("QMPXVideoPlaybackProgressBar::setPosition() position = %d"), value);
- mController->handleCommand( EMPXPbvCmdSetPosition, value );
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackProgressBar::handleSliderReleased
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackProgressBar::handleSliderReleased()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackProgressBar::handleSliderReleased()"));
-
- mSliderDragging = false;
-
- if ( mSeekingTimer && mSeekingTimer->isActive() )
- {
- mSeekingTimer->stop();
- }
-
- mController->resetDisappearingTimers( EMPXTimerReset );
- int value = mProgressSlider->sliderValue();
-
- if ( value >= mDuration )
- {
- MPX_DEBUG(_L("QMPXVideoPlaybackProgressBar::setPosition() reached end of the clip"));
- mController->handleCommand( EMPXPbvCmdEndOfClip );
- }
- else
- {
- if ( value < 0 )
- {
- value = 0;
- }
-
- MPX_DEBUG(_L("QMPXVideoPlaybackProgressBar::setPosition() position = %d"), value);
- mController->handleCommand( EMPXPbvCmdSetPosition, value );
-
- //
- // Resume if it was playing
- //
- if( mNeedToResumeAfterSetPosition )
- {
- mNeedToResumeAfterSetPosition = false;
- mController->handleCommand( EMPXPbvCmdCustomPlay );
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackProgressBar::updateWithFileDetails()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackProgressBar::updateWithFileDetails(
- QMPXVideoPlaybackViewFileDetails* details )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackProgressBar::updateControlsWithFileDetails()"));
-
- if ( ! details->mPausableStream || ! details->mSeekable )
- {
- mProgressSlider->setEnabled( false );
- }
- else if ( ! mProgressSlider->isEnabled() )
- {
- mProgressSlider->setEnabled( true );
- }
-
- mProgressSlider->backgroundItem()->setVisible(
- ( mController->viewMode() == EFullScreenView )? ETrue:EFalse );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackProgressBar::updateState()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackProgressBar::updateState( TMPXPlaybackState state )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackProgressBar::updateState() state = %d"), state );
-
- switch ( state )
- {
- case EPbStatePlaying:
- case EPbStatePaused:
- {
- if ( ! mProgressSlider->isEnabled() )
- {
- mProgressSlider->setEnabled( true );
- }
-
- break;
- }
- default:
- {
- if ( mProgressSlider->isEnabled() )
- {
- mProgressSlider->setEnabled( false );
- }
- break;
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackProgressBar::handleSeekingTimeout()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackProgressBar::handleSeekingTimeout()
-{
- if ( mDraggingPosition >= mDuration )
- {
- mDraggingPosition = mDuration;
- }
- else if( mDraggingPosition < 0 )
- {
- mDraggingPosition = 0;
- }
-
- MPX_DEBUG(_L("QMPXVideoPlaybackProgressBar::handleSeekingTimeout() Dragging pos = %d, Set pos = %d")
- , mDraggingPosition, mSetPosition );
-
- if ( mSetPosition != mDraggingPosition )
- {
- mSetPosition = mDraggingPosition;
- mController->handleCommand( EMPXPbvCmdSetPosition, mSetPosition );
- }
-}
-
-//End of file
--- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackstatuspanecontrol.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,314 +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 QMPXVideoPlaybackStatusPaneControl
-*
-*/
-
-// Version : %version: 19 %
-
-
-
-#include <QFileInfo>
-
-#include <hbmenu.h>
-#include <hblabel.h>
-#include <hbaction.h>
-#include <hbgroupbox.h>
-#include <hbinstance.h>
-#include <hbframeitem.h>
-#include <hbframedrawer.h>
-
-#include <w32std.h>
-
-#include "mpxvideo_debug.h"
-#include "hbvideobaseplaybackview.h"
-#include "mpxvideoplaybackdocumentloader.h"
-#include "mpxvideoplaybackstatuspanecontrol.h"
-#include "mpxvideoplaybackcontrolscontroller.h"
-
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackStatusPaneControl::QMPXVideoPlaybackStatusPaneControl()
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackStatusPaneControl::QMPXVideoPlaybackStatusPaneControl(
- QMPXVideoPlaybackControlsController* controller,
- TMPXVideoPlaybackControls index,
- HbWidget* widget,
- TUint controlproperties )
- : QMPXVideoPlaybackFullScreenControl( controller, index, widget, controlproperties )
- , mActionBack( NULL )
- , mTitleLabel( NULL )
- , mTitleGroupBox( NULL )
- , mTitleLayout( NULL )
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackStatusPaneControl::QMPXVideoPlaybackStatusPaneControl()"));
-
- Q_UNUSED( widget );
-
- mActionBack = new HbAction( Hb::BackNaviAction );
-
- //
- // Press "back" key means going back to previous view if it's avaiable
- //
- connect( mActionBack, SIGNAL( triggered() ), mController->view(), SLOT( closePlaybackView() ) );
- mController->view()->setNavigationAction( mActionBack );
-
- connect( mController->view()->menu(), SIGNAL( aboutToShow() ), this, SLOT( handleAboutToShow() ) );
- connect( mController->view()->menu(), SIGNAL( aboutToHide() ), this, SLOT( handleAboutToHide() ) );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackStatusPaneControl::~QMPXVideoPlaybackStatusPaneControl()
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackStatusPaneControl::~QMPXVideoPlaybackStatusPaneControl()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackStatusPaneControl::~QMPXVideoPlaybackStatusPaneControl"));
-
- disconnect( mActionBack, SIGNAL( triggered() ), mController->view(), SLOT( closePlaybackView() ) );
- disconnect( mActionBack, SIGNAL( triggered() ), this, SLOT( openFullScreenView() ) );
- mController->view()->setNavigationAction( 0 );
-
- disconnect( mController->view()->menu(), SIGNAL( aboutToShow() ), this, SLOT( handleAboutToShow() ) );
- disconnect( mController->view()->menu(), SIGNAL( aboutToHide() ), this, SLOT( handleAboutToHide() ) );
-
- mController->view()->menu()->close();
-
- if ( mActionBack )
- {
- delete mActionBack;
- mActionBack = NULL;
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackStatusPaneControl::setVisible()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackStatusPaneControl::setVisible( bool visible )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackStatusPaneControl::setVisible visible = %d"), visible);
-
- mVisible = visible;
-
- if ( mVisible )
- {
- mController->view()->setTitleBarVisible( true );
- mController->view()->setStatusBarVisible( true );
-
- if ( mController->viewMode() == EFullScreenView ||
- mController->viewMode() == EDetailsView )
- {
- mTitleLayout->setVisible( true );
- }
- }
- else
- {
- mController->view()->menu()->close();
- mController->view()->setTitleBarVisible( false );
- mController->view()->setStatusBarVisible( false );
-
- mTitleLayout->setVisible( false );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackStatusPaneControl::isVisible()
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackStatusPaneControl::isVisible()
-{
- return mVisible;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackStatusPaneControl::setVisibility()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackStatusPaneControl::setVisibility( TMPXPlaybackState state )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackStatusPaneControl::setVisibility()"));
-
- switch( state )
- {
- case EPbStatePlaying:
- case EPbStatePaused:
- {
- setMenu( mController->fileDetails() );
- break;
- }
- case EPbStatePluginSeeking:
- case EPbStateBuffering:
- case EPbStateNotInitialised:
- case EPbStateInitialising:
- {
- mController->view()->menu()->clearActions();
- break;
- }
- }
-
- QMPXVideoPlaybackFullScreenControl::setVisibility( state );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackStatusPaneControl::updateControlsWithFileDetails()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackStatusPaneControl::updateControlsWithFileDetails(
- QMPXVideoPlaybackViewFileDetails* details )
-{
- 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.completeBaseName();
- }
-
- QGraphicsWidget *qWidget = mController->layoutLoader()->findWidget( QString( "title" ) );
- mTitleLabel = qobject_cast<HbLabel*>( qWidget );
- mTitleLabel->setPlainText( title );
-
- qWidget = mController->layoutLoader()->findWidget( QString( "titleGroupBox" ) );
- mTitleGroupBox = qobject_cast<HbGroupBox*>( 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:
- {
- //
- // Set TitleBar transparent and go back to preview view with back key
- //
- disconnect( mActionBack, SIGNAL( triggered() ), this, SLOT( openFullScreenView() ) );
- connect( mActionBack, SIGNAL( triggered() ), mController->view(), SLOT( closePlaybackView() ) );
-
- mController->view()->setViewFlags( mController->view()->viewFlags() |
- HbView::ViewTitleBarTransparent |
- HbView::ViewStatusBarTransparent );
-
- mTitleLabel->setVisible( true );
- mTitleGroupBox->setVisible( false );
-
- break;
- }
- case EDetailsView:
- {
- //
- // Set TitleBar opaque and go back to full screen view with back key
- //
- disconnect( mActionBack, SIGNAL( triggered() ), mController->view(), SLOT( closePlaybackView() ) );
- connect( mActionBack, SIGNAL( triggered() ), this, SLOT( openFullScreenView() ) );
-
- mController->view()->setViewFlags( HbView::ViewFlagNone );
-
- mTitleGroupBox->setVisible( true );
- mTitleLabel->setVisible( false );
-
- break;
- }
- case EAudioOnlyView:
- {
- //
- // Set TitleBar opaque and go back to preview view with back key
- //
- disconnect( mActionBack, SIGNAL( triggered() ), this, SLOT( openFullScreenView() ) );
- connect( mActionBack, SIGNAL( triggered() ), mController->view(), SLOT( closePlaybackView() ) );
-
- mController->view()->setViewFlags( HbView::ViewFlagNone );
- break;
- }
- }
-
- setMenu( details );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackStatusPaneControl::setMenu()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackStatusPaneControl::setMenu( QMPXVideoPlaybackViewFileDetails* details )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackStatusPaneControl::setMenu()"));
-
- //
- // No available menu for now
- //
- Q_UNUSED( details );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackStatusPaneControl::handleAboutToShow()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackStatusPaneControl::handleAboutToShow()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackStatusPaneControl::handleAboutToShow()"));
-
- mController->resetDisappearingTimers( EMPXTimerCancel );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackStatusPaneControl::handleAboutToHide()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackStatusPaneControl::handleAboutToHide()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackStatusPaneControl::handleAboutToHide()"));
-
- mController->resetDisappearingTimers( EMPXTimerReset );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackStatusPaneControl::controlListUpdated()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackStatusPaneControl::controlListUpdated(
- QMPXVideoPlaybackViewFileDetails* details )
-{
- setMenu( details );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackStatusPaneControl::openFullScreenView()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackStatusPaneControl::openFullScreenView()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackStatusPaneControl::openFullScreenView()"));
-
- mController->changeViewMode( EFullScreenView );
-}
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybacktoolbar.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,755 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackToolBar
-*
-*/
-
-// Version : %version: 7 %
-
-
-
-#include <QTimer>
-#include <QGraphicsLayout>
-
-#include <hbaction.h>
-#include <hbtoolbar.h>
-#include <hbinstance.h>
-#include <hbtoolbutton.h>
-#include <w32std.h>
-
-#include "mpxvideo_debug.h"
-#include "hbvideobaseplaybackview.h"
-#include "mpxvideoplaybacktoolbar.h"
-#include "mpxcommonvideoplaybackview.hrh"
-#include "mpxvideoplaybackdocumentloader.h"
-#include "mpxvideoplaybackviewfiledetails.h"
-#include "mpxvideoplaybackcontrolscontroller.h"
-
-const int KSeekStartTimeOut = 700;
-const int KRetrieveButtonTimeOut = 1000;
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackToolBar::QMPXVideoPlaybackToolBar()
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackToolBar::QMPXVideoPlaybackToolBar(
- QMPXVideoPlaybackControlsController* controller )
- : mController( controller )
- , mSeekStartTimer( NULL )
- , mRetrieveButtonTimer( NULL )
- , mSeekingState( EMPXNotSeeking )
- , mInitialized( false )
- , mPosition( 0 )
- , mDuration( 0 )
- , mAspectRatio( EMPXPbvCmdNaturalAspectRatio )
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackToolBar::QMPXVideoPlaybackToolBar"));
-
- mToolBar = mController->view()->toolBar();
- mToolBar->setOrientation( Qt::Horizontal );
-
- mController->view()->hideItems( Hb::ToolBarItem );
-
- initialize();
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackToolBar::~QMPXVideoPlaybackToolBar()
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackToolBar::~QMPXVideoPlaybackToolBar()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackToolBar::~QMPXVideoPlaybackToolBar()"));
-
- mToolBar->clearActions();
-
- for ( int i = 0 ; i < mButtonIcons.count() ; i++ )
- {
- if ( mButtonIcons[i] )
- {
- delete mButtonIcons[i];
- }
- }
- mButtonIcons.clear();
-
- if ( mSeekStartTimer )
- {
- if ( mSeekStartTimer->isActive() )
- {
- mSeekStartTimer->stop();
- }
-
- delete mSeekStartTimer;
- mSeekStartTimer = NULL;
- }
-
- if ( mRetrieveButtonTimer )
- {
- if ( mRetrieveButtonTimer->isActive() )
- {
- mRetrieveButtonTimer->stop();
- }
-
- delete mRetrieveButtonTimer;
- mRetrieveButtonTimer = NULL;
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackToolBar::initialize()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackToolBar::initialize()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackToolBar::initialize()"));
-
- //
- // Don't need to initialize buttons once it gets initialized
- //
- if ( ! mInitialized )
- {
- mInitialized = true;
-
- QActionGroup *actionsGroup = new QActionGroup( mToolBar );
-
- for ( int i = 0 ; i < EMPXButtonCount ; i++ )
- {
- mButtonActions.append( new HbAction( actionsGroup ) );
- }
-
- for ( int i = 0 ; i < EMPXIconCount ; i++ )
- {
- mButtonIcons.append( new HbIcon() );
- }
-
- //
- // RW button
- //
- mButtonIcons[EMPXRWIcon]->setIconName( "qtg_mono_previous" );
- mButtonActions[EMPX2ndButton]->setIcon( *mButtonIcons[EMPXRWIcon] );
-
- //
- // Play/Pause button
- //
- mButtonIcons[EMPXPlayIcon]->setIconName( "qtg_mono_play" );
- mButtonIcons[EMPXPauseIcon]->setIconName( "qtg_mono_pause" );
- mButtonActions[EMPX3rdButton]->setIcon( *mButtonIcons[EMPXPlayIcon] );
-
- //
- // FF button
- //
- mButtonIcons[EMPXFFIcon]->setIconName( "qtg_mono_next" );
- mButtonActions[EMPX4thButton]->setIcon( *mButtonIcons[EMPXFFIcon] );
-
- //
- // Details button
- //
- mButtonIcons[EMPXDetailsIcon]->setIconName( "qtg_mono_info" );
- mButtonActions[EMPX5thButton]->setIcon( *mButtonIcons[EMPXDetailsIcon] );
-
- //
- // Aspect ratio buttons
- //
- mButtonIcons[EMPXNaturalIcon]->setIconName( "qtg_mono_aspect_ratio_natural" );
- mButtonIcons[EMPXStretchIcon]->setIconName( "qtg_mono_aspect_ratio_stretched" );
- mButtonIcons[EMPXZoomIcon]->setIconName( "qtg_mono_aspect_ratio_zoom" );
- mButtonActions[EMPX1stButton]->setIcon( *mButtonIcons[EMPXNaturalIcon] );
-
- //
- // Attach/Share button
- //
- mButtonIcons[EMPXAttachIcon]->setIconName( "qtg_mono_attach" );
- mButtonIcons[EMPXShareIcon]->setIconName( "qtg_mono_share" );
-
- for ( int i = 0 ; i < EMPXButtonCount ; i++ )
- {
- mButtonActions[i]->setCheckable( false );
- mToolBar->addAction( mButtonActions[i] );
- }
-
- mDuration = (qreal)mController->fileDetails()->mDuration / (qreal)KPbMilliMultiplier;
-
- //
- // Create a timer for seeking.
- // We will issue SetPosition every KSeekingTimeOut msec to show the current frame to user
- //
- mSeekStartTimer = new QTimer();
- mSeekStartTimer->setSingleShot( true );
- mSeekStartTimer->setInterval( KSeekStartTimeOut );
-
- //
- // get window size
- //
- RWindow *window = mController->view()->getWindow();
- TRect displayRect = TRect( TPoint( window->Position() ), TSize( window->Size() ) );
-
- //
- // get window aspect ratio
- // if device is in portrait mode, width > height
- // if device is in landscape mode, width < height
- //
- TReal32 width = (TReal32) displayRect.Width();
- TReal32 height = (TReal32) displayRect.Height();
- mDisplayAspectRatio = (width > height)? (width / height) : (height / width);
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackToolBar::playPause()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackToolBar::playPause()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackToolBar::playPause()"));
-
- mController->resetDisappearingTimers( EMPXTimerReset );
- mController->handleCommand( EMPXPbvCmdPlayPause );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackToolBar::ffPressing()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackToolBar::ffPressing()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackToolBar::ffPressing()"),
- _L("mSeekingState = %d"), mSeekingState );
-
- if ( mSeekingState == EMPXNotSeeking )
- {
- mSeekingState = EMPXFastForwarding;
-
- mController->handleCommand( EMPXPbvCmdSeekForward );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackToolBar::rwPressing()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackToolBar::rwPressing()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackToolBar::rwPressing()"),
- _L("mSeekingState = %d"), mSeekingState );
-
- if ( mSeekingState == EMPXNotSeeking )
- {
- mSeekingState = EMPXRewinding;
-
- mController->handleCommand( EMPXPbvCmdSeekBackward );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackToolBar::ffReleased()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackToolBar::ffReleased()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackToolBar::ffReleased()"),
- _L("mSeekingState = %d"), mSeekingState );
-
- disconnect( mSeekStartTimer, SIGNAL( timeout() ), this, SLOT( ffPressing() ) );
-
- if ( mSeekStartTimer->isActive() )
- {
- mSeekStartTimer->stop();
- }
-
- if ( mSeekingState == EMPXFastForwarding )
- {
- mController->handleCommand( EMPXPbvCmdEndSeek );
- }
- else
- {
- int temp = mPosition + KMPXFastForward;
- MPX_DEBUG(_L("QMPXVideoPlaybackToolBar::ffReleased() temp position = %d"), temp);
-
- //
- // If it has the playing time which is less than KMPXFastForward, ignore
- //
- if ( temp < mDuration )
- {
- mController->handleCommand( EMPXPbvCmdSetPosition, temp );
- }
- }
-
- mSeekingState = EMPXNotSeeking;
- mController->resetDisappearingTimers( EMPXTimerReset );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackToolBar::rwReleased()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackToolBar::rwReleased()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackToolBar::rwReleased()"),
- _L("mSeekingState = %d"), mSeekingState );
-
- disconnect( mSeekStartTimer, SIGNAL( timeout() ), this, SLOT( rwPressing() ) );
-
- if ( mSeekStartTimer->isActive() )
- {
- mSeekStartTimer->stop();
- }
-
- if ( mSeekingState == EMPXRewinding )
- {
- mController->handleCommand( EMPXPbvCmdEndSeek );
- }
- else
- {
- int temp = mPosition + KMPXRewind;
- MPX_DEBUG(_L("QMPXVideoPlaybackToolBar::rwReleased() temp position = %d"), temp);
-
- //
- // If it played less than KMPXRewind, jump to 0
- //
- if ( temp < 0 )
- {
- temp = 0;
- }
-
- mController->handleCommand( EMPXPbvCmdSetPosition, temp );
- }
-
- mSeekingState = EMPXNotSeeking;
- mController->resetDisappearingTimers( EMPXTimerReset );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackToolBar::changeAspectRatio()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackToolBar::changeAspectRatio()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackToolBar::changeAspectRatio()"));
-
- mController->resetDisappearingTimers( EMPXTimerReset );
-
- TMPXVideoPlaybackViewCommandIds cmd = EMPXPbvCmdStretchAspectRatio;
-
- switch( mAspectRatio )
- {
- case EMMFZoom:
- {
- cmd = EMPXPbvCmdNaturalAspectRatio;
- break;
- }
- case EMMFStretch:
- {
- cmd = EMPXPbvCmdZoomAspectRatio;
- break;
- }
- }
-
- mController->handleCommand( cmd );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackToolBar::updateState()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackToolBar::updateState( TMPXPlaybackState state )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackToolBar::updateState() state = %d"), state );
-
- switch ( state )
- {
- case EPbStatePlaying:
- {
- mToolBar->setEnabled( true );
-
- mButtonActions[EMPX3rdButton]->setIcon( *mButtonIcons[EMPXPauseIcon] );
-
- break;
- }
- case EPbStatePaused:
- {
- mToolBar->setEnabled( true );
-
- mButtonActions[EMPX3rdButton]->setIcon( *mButtonIcons[EMPXPlayIcon] );
-
- break;
- }
- default:
- {
- mToolBar->setEnabled( false );
-
- break;
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackToolBar::aspectRatioChanged()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackToolBar::aspectRatioChanged( int aspectRatio )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackToolBar::aspectRatioChanged() aspectRatio = %d"), aspectRatio );
-
- mAspectRatio = aspectRatio;
-
- //
- // 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 )
- {
- case EMMFNatural:
- {
- mButtonActions[EMPX1stButton]->setIcon( *mButtonIcons[EMPXStretchIcon] );
- break;
- }
- case EMMFStretch:
- {
- mButtonActions[EMPX1stButton]->setIcon( *mButtonIcons[EMPXZoomIcon] );
- break;
- }
- default:
- {
- mButtonActions[EMPX1stButton]->setIcon( *mButtonIcons[EMPXNaturalIcon] );
- break;
- }
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackToolBar::handleButtonPressed()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackToolBar::handleButtonPressed()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackToolBar::handleButtonPressed()"));
-
- mController->resetDisappearingTimers( EMPXTimerCancel );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackToolBar::handleRWButtonPressed()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackToolBar::handleRWButtonPressed()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackToolBar::handleRWButtonPressed()"));
-
- mController->resetDisappearingTimers( EMPXTimerCancel );
-
- connect( mSeekStartTimer, SIGNAL( timeout() ), this, SLOT( rwPressing() ) );
-
- if ( mSeekStartTimer->isActive() )
- {
- mSeekStartTimer->stop();
- }
-
- mSeekStartTimer->start();
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackToolBar::handleFFButtonPressed()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackToolBar::handleFFButtonPressed()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackToolBar::handleButtonPressed()"));
-
- mController->resetDisappearingTimers( EMPXTimerCancel );
-
- connect( mSeekStartTimer, SIGNAL( timeout() ), this, SLOT( ffPressing() ) );
-
- if ( mSeekStartTimer->isActive() )
- {
- mSeekStartTimer->stop();
- }
-
- mSeekStartTimer->start();
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackToolBar::updateWithFileDetails()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackToolBar::updateWithFileDetails(
- QMPXVideoPlaybackViewFileDetails* details )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackToolBar::updateWithFileDetails()"));
-
- if ( mController->isAttachOperation() )
- {
- //
- // Show attach button
- //
- mButtonActions[EMPX1stButton]->setIcon( *mButtonIcons[EMPXAttachIcon] );
-
- if ( mButtons.count() )
- {
- disconnect( mButtons[EMPX1stButton], SIGNAL( released() ), 0, 0 );
- connect( mButtons[EMPX1stButton], SIGNAL( released() ),
- mController, SLOT( attachVideo() ) );
- }
- }
- else
- {
- if ( mController->viewMode() == EFullScreenView )
- {
- //
- // Show aspect ratio button
- //
- aspectRatioChanged( mAspectRatio );
-
- if ( ! details->mVideoEnabled ||
- details->mVideoHeight <= 0 ||
- details->mVideoWidth <= 0 ||
- details->mTvOutConnected )
- {
- //
- // dim 'aspect ratio' buttons
- //
- mButtonActions[EMPX1stButton]->setEnabled( false );
- }
- else
- {
- //
- // check if video clip has same aspect ratio as display window
- //
- TReal32 videoAspectRatio = (TReal32) details->mVideoWidth / (TReal32) details->mVideoHeight;
- bool enabled = ( mDisplayAspectRatio == videoAspectRatio )? false : true;
-
- //
- // enable or dim 'aspect ratio' buttons accordingly
- //
- mButtonActions[EMPX1stButton]->setEnabled( enabled );
-
- if ( mButtons.count() )
- {
- disconnect( mButtons[EMPX1stButton], SIGNAL( released() ), 0, 0 );
- connect( mButtons[EMPX1stButton], SIGNAL( released() ),
- this, SLOT( changeAspectRatio() ) );
- }
- }
- }
- else if ( mController->viewMode() == EAudioOnlyView )
- {
- //
- // Show share button
- //
- mButtonActions[EMPX1stButton]->setIcon( *mButtonIcons[EMPXShareIcon] );
-
- if ( mController->fileDetails()->mPlaybackMode == EMPXVideoStreaming ||
- mController->fileDetails()->mPlaybackMode == EMPXVideoLiveStreaming )
- {
- //
- // dim 'share' button for streaming
- //
- mButtonActions[EMPX1stButton]->setEnabled( false );
- }
- else
- {
- //
- // enable 'share' button
- //
- mButtonActions[EMPX1stButton]->setEnabled( true );
-
- if ( mButtons.count() )
- {
- disconnect( mButtons[EMPX1stButton], SIGNAL( released() ), 0, 0 );
- connect( mButtons[EMPX1stButton], SIGNAL( released() ),
- mController, SLOT( sendVideo() ) );
- }
- }
- }
- }
-
- //
- // for audio-only clips and tv-out, default view is audionOnlyView
- // therefore, dim details button
- //
- if ( ! details->mVideoEnabled || details->mTvOutConnected )
- {
- mButtonActions[EMPX5thButton]->setEnabled( false );
- }
- else
- {
- mButtonActions[EMPX5thButton]->setEnabled( true );
- }
-
- 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 )
- {
- mButtonActions[EMPX3rdButton]->setEnabled( true );
- }
- else
- {
- mButtonActions[EMPX3rdButton]->setEnabled( 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.
- //
- if ( ! mRetrieveButtonTimer && ! mButtons.count() )
- {
- 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 );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackToolBar::openDetailsView()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackToolBar::openDetailsView()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackToolBar::openDetailsView()"));
-
- TPlaybackViewMode viewMode = mController->viewMode();
-
- if ( viewMode == EFullScreenView )
- {
- mController->changeViewMode( EDetailsView );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackToolBar::positionChanged
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackToolBar::positionChanged( int position )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackToolBar::positionChanged position = %d"), position );
-
- mPosition = position;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackToolBar::durationChanged
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackToolBar::durationChanged( int duration )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackToolBar::durationChanged duration = %d"), duration );
-
- mDuration = duration;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackToolBar::setVisible
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackToolBar::setVisible( bool visible )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackToolBar::setVisible visible = %d"), visible );
-
- if ( visible )
- {
- mController->view()->showItems( Hb::ToolBarItem );
- }
- else
- {
- mController->view()->hideItems( Hb::ToolBarItem );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackToolBar::retrieveButtons()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackToolBar::retrieveButtons()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackToolBar::retrieveButtons()"));
-
- if ( mButtons.count() == 0 )
- {
- QGraphicsLayout *layout = mToolBar->layout();
-
- if ( layout )
- {
- if ( mRetrieveButtonTimer )
- {
- disconnect( mRetrieveButtonTimer, SIGNAL( timeout() ), this, SLOT( retrieveButtons() ) );
- if ( mRetrieveButtonTimer->isActive() )
- {
- mRetrieveButtonTimer->stop();
- }
- }
-
- for ( int i = 0 ; i < layout->count() ; i++ )
- {
- mButtons.append( dynamic_cast<HbToolButton*>( layout->itemAt( i ) ) );
- }
-
- //
- // Connect signal and slots
- //
- connect( mButtons[EMPX1stButton], SIGNAL( pressed() ), this, SLOT( handleButtonPressed() ) );
-
- connect( mButtons[EMPX2ndButton], SIGNAL( pressed() ), this, SLOT( handleRWButtonPressed() ) );
- connect( mButtons[EMPX2ndButton], SIGNAL( released() ), this, SLOT( rwReleased() ) );
-
- connect( mButtons[EMPX3rdButton], SIGNAL( pressed() ), this, SLOT( handleButtonPressed() ) );
- connect( mButtons[EMPX3rdButton], SIGNAL( released() ), this, SLOT( playPause() ) );
-
- connect( mButtons[EMPX4thButton], SIGNAL( pressed() ), this, SLOT( handleFFButtonPressed() ) );
- connect( mButtons[EMPX4thButton], SIGNAL( released() ), this, SLOT( ffReleased() ) );
-
- connect( mButtons[EMPX5thButton], SIGNAL( pressed() ), this, SLOT( handleButtonPressed() ) );
- connect( mButtons[EMPX5thButton], SIGNAL( released() ), this, SLOT( openDetailsView() ) );
-
- if ( mController->isAttachOperation() )
- {
- connect( mButtons[EMPX1stButton], SIGNAL( released() ),
- mController, SLOT( attachVideo() ) );
- }
- else
- {
- if ( mController->viewMode() == EFullScreenView )
- {
- connect( mButtons[EMPX1stButton], SIGNAL( released() ),
- this, SLOT( changeAspectRatio() ) );
- }
- else if ( mController->viewMode() == EAudioOnlyView )
- {
- connect( mButtons[EMPX1stButton], SIGNAL( released() ),
- mController, SLOT( sendVideo() ) );
- }
- }
- }
- }
-}
-
-//End of file
--- a/videoplayback/hbvideoplaybackview/hbvideoplaybackview.pro Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +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: 25 %
-
-
-TEMPLATE = lib
-CONFIG += hb qt dll
-TARGET = hbvideoplaybackview
-DEFINES += BUILD_VIDEOPLAYBACK_DLL
-
-symbian:
-{
- TARGET.CAPABILITY = ALL -TCB -DRM
- TARGET.EPOCALLOWDLLDATA = 1
- TARGET.UID3 = 0x20024334
- INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE \
- $$APP_LAYER_SYSTEMINCLUDE SYSTEMINCLUDE
- BLD_INF_RULES.prj_exports += "rom/hbvideoplaybackview.iby CORE_APP_LAYER_IBY_EXPORT_PATH(hbvideoplaybackview.iby)"
- defBlock = \
- "$${LITERAL_HASH}if defined(EABI)" \
- "DEFFILE ../eabi/hbvideoplaybackview.def" \
- "$${LITERAL_HASH}else" \
- "DEFFILE ../bwins/hbvideoplaybackview.def" \
- "$${LITERAL_HASH}endif"
- MMP_RULES += defBlock
-}
-
-INCLUDEPATH += ../../inc
-
-LIBS += -lmpxplaybackutility.dll \
- -lmpxcommon.dll \
- -lestor.dll \
- -lcommonengine.dll \
- -lflogger.dll \
- -lsysutil.dll \
- -lmpxcollectionutility.dll \
- -lremconcoreapi.dll \
- -lremconInterfacebase.dll \
- -lcentralrepository.dll \
- -lthumbnailmanagerqt.dll \
- -lmediaclientvideodisplay.dll \
- -lxqserviceutil.dll \
- -lvideoplayerengine.dll \
- -lcone.dll \
- -lefsrv.dll \
- -lws32.dll \
- -lhal.dll \
- -lgdi.dll \
- -lshareui.dll
-
-DEPENDPATH += ../inc inc viewinc controlinc
-VPATH += viewsrc controlsrc
-
-HEADERS += hbvideobaseplaybackview.h \
- hbvideoplaybackview.h \
- mpxvideoplaybackviewfiledetails.h \
- mpxvideoviewwrapper.h \
- mpxvideoregion.h \
- mpxvideoplaybackdisplayhandler.h \
- mpxvideoplaybackfullscreencontrol.h \
- mpxvideoplaybackstatuspanecontrol.h \
- mpxvideoplaybackprogressbar.h \
- mpxvideoplaybacktoolbar.h \
- mpxvideoplaybackcontrolbar.h \
- mpxvideoplaybackcontrolpolicy.h \
- mpxvideoplaybackcontrolconfiguration.h \
- mpxvideoplaybackcontrolscontroller.h \
- mpxvideoplaybackdocumentloader.h \
- mpxvideoplaybackfiledetailswidget.h \
- mpxvideoplaybackuserinputhandler.h \
- mpxvideoplaybackdetailsplaybackwindow.h \
- mpxvideocontainer.h
-
-SOURCES += hbvideobaseplaybackview.cpp \
- hbvideoplaybackview.cpp \
- mpxvideoplaybackviewfiledetails.cpp \
- mpxvideoviewwrapper.cpp \
- mpxvideoplaybackdisplayhandler.cpp \
- mpxvideoplaybackfullscreencontrol.cpp \
- mpxvideoplaybackstatuspanecontrol.cpp \
- mpxvideoplaybackprogressbar.cpp \
- mpxvideoplaybacktoolbar.cpp \
- mpxvideoplaybackcontrolbar.cpp \
- mpxvideoplaybackcontrolscontroller.cpp \
- mpxvideoplaybackcontrolpolicy.cpp \
- mpxvideoplaybackcontrolconfiguration.cpp \
- mpxvideoplaybackdocumentloader.cpp \
- mpxvideoplaybackfiledetailswidget.cpp \
- mpxvideoplaybackuserinputhandler.cpp \
- mpxvideoplaybackdetailsplaybackwindow.cpp \
- mpxvideocontainer.cpp
-
-RESOURCES += resources/hbvideoplaybackview.qrc
--- a/videoplayback/hbvideoplaybackview/inc/mpxhelixplaybackplugindefs.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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: Externalizable container for DSA region
-*
-*/
-
-// Version : %version: da1mmcf#2 %
-
-
-
-#ifndef MPXHELIXPLAYBACKPLUGINDEFS_H_
-#define MPXHELIXPLAYBACKPLUGINDEFS_H_
-
-enum TMPXVideoPlaybackState
-{
- EMPXVideoNotInitialized,
- EMPXVideoInitializing,
- EMPXVideoInitialized,
- EMPXVideoBuffering,
- EMPXVideoPlaying,
- EMPXVideoPaused,
- EMPXVideoStopped,
- EMPXVideoSeeking,
- EMPXNumberOfStates
-};
-
-
-enum TMPXVideoMode
-{
- EMPXVideoLocal,
- EMPXVideoStreaming,
- EMPXVideoLiveStreaming,
- EMPXVideoProgressiveDownload,
- EMPXNumberOfModes
-};
-
-
-
-#endif /*MPXHELIXPLAYBACKPLUGINDEFS_H_*/
--- a/videoplayback/hbvideoplaybackview/inc/mpxvideoplaybackcontrolscontroller.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,384 +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 MPXVideoPlaybackControlsController
-*
-*/
-
-// Version : %version: da1mmcf#19 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_
-#define MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_
-
-// INCLUDES
-#include <QObject>
-#include <QPixmap>
-
-#include <mpxplaybackframeworkdefs.h>
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackcontrol.hrh"
-#include "mpxcommonvideoplaybackview.hrh"
-#include "mpxvideoplaybackviewfiledetails.h"
-
-// FORWARD DECLARATIONS
-class QTimer;
-class QString;
-class HbAction;
-class ThumbnailManager;
-class HbVolumeSliderPopup ;
-class CMPXVideoViewWrapper;
-class HbVideoBasePlaybackView;
-class QMPXVideoPlaybackControlPolicy;
-class QMPXVideoPlaybackDocumentLoader;
-class QMPXVideoPlaybackFullScreenControl;
-class QMPXVideoPlaybackControlsController;
-class QMPXVideoPlaybackControlConfiguration;
-class VideoServices;
-
-
-// DATA TYPES
-
-enum TMPXTimerAction
-{
- EMPXTimerCancel,
- EMPXTimerReset
-};
-
-enum TThumbNailState
-{
- EThumbNailEmpty,
- EThumbNailNotAvailable,
- EThumbNailRequsted,
- EThumbNailSet
-};
-
-enum TPlaybackViewMode
-{
- EFullScreenView,
- EDetailsView,
- EAudioOnlyView
-};
-
-const int KMPXControlsTimeOut = 4000;
-const int KMPXRNLogoTimeOut = 600;
-
-const QString KMPXPLAYBACKVIEW_XML = ":/hbvideoplaybackview/hbvideoplaybackview.docml";
-
-
-// CLASS DECLARATION
-
-class QMPXVideoPlaybackControlsController : public QObject
-{
- Q_OBJECT
-
- public:
-
- /**
- * constructor.
- */
- QMPXVideoPlaybackControlsController(
- HbVideoBasePlaybackView *view,
- CMPXVideoViewWrapper *viewWrapper,
- QMPXVideoPlaybackViewFileDetails *details );
-
- /**
- * Destructor.
- */
- virtual ~QMPXVideoPlaybackControlsController();
-
- public:
-
- /**
- * Handle event from container
- */
- void handleEvent( TMPXVideoPlaybackControlCommandIds event, int value = 0 );
-
- /**
- * Command handling function.
- * Call HandleCommandL() of container
- */
- void handleCommand( TMPXVideoPlaybackViewCommandIds command, int value = 0 );
-
- /*
- * Return ETrue if TV-out cable gets connected
- */
- inline bool isTvOutConnected();
-
- /**
- * Reset or cancel timers for the controls
- */
- void resetDisappearingTimers( TMPXTimerAction timerAction );
-
- /**
- * Return state
- */
- inline TMPXPlaybackState state();
-
- /**
- * Return file details
- */
- inline QMPXVideoPlaybackViewFileDetails* fileDetails();
-
- //
- // Add the file details to the controls controller when available
- //
- void addFileDetails( QMPXVideoPlaybackViewFileDetails* details );
-
- inline QMPXVideoPlaybackDocumentLoader* layoutLoader();
-
- inline HbVideoBasePlaybackView* view();
-
- void updateVideoRectDone();
-
- TPlaybackViewMode viewMode();
-
- void changeViewMode( TPlaybackViewMode viewMode, bool transitionEffect = true );
-
- inline bool isAttachOperation();
-
- bool isRNLogoBitmapInControlList();
-
- private:
- /**
- * Initialize controller
- */
- void initializeController();
-
- /**
- * Update controls
- */
- void handleStateChange( TMPXPlaybackState newState );
-
- /**
- * Show Controls and reset the timers
- */
- void showControls();
-
- /**
- * Return ETrue if any control is visible
- */
- bool isVisible();
-
- /**
- * Append a control based on control index
- */
- void appendControl( TMPXVideoPlaybackControls controlIndex );
-
- /**
- * Set changed volume
- */
- void volumeChanged( int volume );
-
- /**
- * Set changed duration
- */
- void durationChanged( int duration);
-
- /**
- * Set changed position
- */
- void positionChanged( int position );
-
- /**
- * Set changed position
- */
- void aspectRatioChanged( int aspectRatio );
-
- /*
- * Sets the download size on the progress bar
- */
- void setDownloadSize( int size );
-
- /*
- * Updates the download ratio on the progress bar
- */
- void updateDownloadPosition( int newSize );
-
- /**
- * Set changed state on the controls
- */
- void updateState();
-
- /**
- * Check whether this clip is real format or not
- */
- bool realFormat( QString filename );
-
- /**
- * Check whether this clip is real format or not for streaming/live streaming
- */
- bool realFormatForStreaming( const TDesC& des );
-
- /**
- * Check whether this clip is real format or not for local/progressive donwload
- */
- bool realFormatForLocal();
-
- /**
- * Handle errors
- */
- void handleErrors();
-
- /**
- * Return true if control is visible
- */
- bool isSoftKeyVisible();
-
- /**
- * Handle tvout connected/disconnected event
- */
- void handleTvOutEvent( bool connected,
- TMPXVideoPlaybackControlCommandIds event );
-
- void updateVideoRect( bool transitionEffect = true );
-
- void showVolumeControls();
-
- void setDefaultBitmap();
-
- void generateThumbNail();
-
- signals:
-
- /**
- * Signals the file path of the current video to VideoServices
- *
- * @param filePath of the video
- */
- void attachVideoPath( const QString& );
-
- private slots:
- void hideAllControls();
- void skipToNextVideoItem();
- void skipToPreviousVideoItem();
- void handleTappedOnScreen();
- void handleThumbnailReady( QPixmap tnData, void *internal , int id, int error );
- void controlsListUpdated();
- void attachVideo();
- void sendVideo();
- void handleRNLogoVisibleChanged();
- void handleRNLogoTimeout();
- void handleOrientationChanged( Qt::Orientation orientation );
-
- private:
- HbVideoBasePlaybackView *mView;
- CMPXVideoViewWrapper *mViewWrapper;
- QMPXVideoPlaybackViewFileDetails *mFileDetails;
-
- QList<QMPXVideoPlaybackFullScreenControl*> mControls;
-
- QMPXVideoPlaybackControlPolicy *mControlsPolicy;
- QMPXVideoPlaybackControlConfiguration *mControlsConfig;
-
- QTimer *mControlsTimer;
- QTimer *mRNLogoTimer;
-
- QMPXVideoPlaybackDocumentLoader *mLoader;
- HbVolumeSliderPopup *mVolumeControl;
-
- ThumbnailManager *mThumbnailManager;
- VideoServices *mVideoServices;
-
- bool mViewTransitionIsGoingOn;
- bool mIsAttachOperation;
-
- TThumbNailState mThumbNailState;
-
- TMPXPlaybackState mState;
- TPlaybackViewMode mViewMode;
- Qt::Orientation mOrientation;
-};
-
-// INLINE METHODS
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::state
-// -------------------------------------------------------------------------------------------------
-//
-inline
-TMPXPlaybackState QMPXVideoPlaybackControlsController::state()
-{
- return mState;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::fileDetails
-// -------------------------------------------------------------------------------------------------
-//
-inline
-QMPXVideoPlaybackViewFileDetails* QMPXVideoPlaybackControlsController::fileDetails()
-{
- return mFileDetails;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::isTvOutConnected
-// -------------------------------------------------------------------------------------------------
-//
-inline
-bool QMPXVideoPlaybackControlsController::isTvOutConnected()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::isTvOutConnected(%d)"),
- mFileDetails->mTvOutConnected);
-
- return mFileDetails->mTvOutConnected;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::layoutLoader
-// -------------------------------------------------------------------------------------------------
-//
-inline
-QMPXVideoPlaybackDocumentLoader* QMPXVideoPlaybackControlsController::layoutLoader()
-{
- return mLoader;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::view
-// -------------------------------------------------------------------------------------------------
-//
-inline
-HbVideoBasePlaybackView* QMPXVideoPlaybackControlsController::view()
-{
- return mView;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::viewMode
-// -------------------------------------------------------------------------------------------------
-//
-inline
-TPlaybackViewMode QMPXVideoPlaybackControlsController::viewMode()
-{
- 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
--- a/videoplayback/hbvideoplaybackview/inc/mpxvideoplaybackviewfiledetails.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +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: MPX Video File Details (QT)
-*
-*/
-
-// Version : %version: 5 %
-
-
-
-
-#ifndef __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-#define __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-
-#include <qobject.h>
-#include "mpxhelixplaybackplugindefs.h"
-
-
-//
-// CLASS DECLARATION
-//
-class QMPXVideoPlaybackViewFileDetails : public QObject
-{
- public:
- //
- // Constructor
- //
- QMPXVideoPlaybackViewFileDetails();
-
- //
- // Destructor.
- //
- virtual ~QMPXVideoPlaybackViewFileDetails();
-
- //
- // Clear all file details
- //
- void clearFileDetails();
-
- public:
- //
- // Data
- //
- QString mClipName;
- QString mTitle;
- QString mArtist;
- QString mMimeType;
- QString mDescription;
- QString mLocation;
- QString mCopyright;
- QString mLanguage;
- QString mKeywords;
-
- TMPXVideoMode mPlaybackMode;
- bool mSeekable;
- bool mPausableStream;
- bool mAudioEnabled;
- bool mVideoEnabled;
- bool mPartialPlayback;
- bool mRNFormat;
- bool mTvOutConnected;
- bool mDrmProtected;
- bool mMultiItemPlaylist;
-
- int mVideoHeight;
- int mVideoWidth;
- int mBitRate;
- int mDuration;
- int mCreationTime;
- int mModificationTime;
-};
-
-#endif // __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/resources/animations/generic_preroll_anim.axml Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<animations>
- <icon name="preroll_anim" frame_duration="100" playmode="loop">
- <frame>qtg_anim_loading_1</frame>
- <frame>qtg_anim_loading_2</frame>
- <frame>qtg_anim_loading_3</frame>
- <frame>qtg_anim_loading_4</frame>
- <frame>qtg_anim_loading_5</frame>
- <frame>qtg_anim_loading_6</frame>
- <frame>qtg_anim_loading_7</frame>
- <frame>qtg_anim_loading_8</frame>
- <frame>qtg_anim_loading_9</frame>
- <frame>qtg_anim_loading_10</frame>
- </icon>
-</animations>
\ No newline at end of file
--- a/videoplayback/hbvideoplaybackview/resources/animations/rn_preroll_anim.axml Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-<animations>
- <icon name="preroll_anim" frame_duration="100" playmode="loop">
- <frame>qtg_anim_longtap_1</frame>
- <frame>qtg_anim_longtap_2</frame>
- <frame>qtg_anim_longtap_3</frame>
- <frame>qtg_anim_longtap_4</frame>
- <frame>qtg_anim_longtap_5</frame>
- <frame>qtg_anim_longtap_6</frame>
- <frame>qtg_anim_longtap_7</frame>
- <frame>qtg_anim_longtap_8</frame>
- <frame>qtg_anim_longtap_9</frame>
- </icon>
-</animations>
\ No newline at end of file
--- a/videoplayback/hbvideoplaybackview/resources/effects/controlbar_appear.fxml Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-<layers>
- <visual>
- <param name="translation_y" type="anim">
- <duration>0.4</duration>
- <style>outquad</style>
- <keyframe at="0.0">0.0</keyframe>
- <keyframe at="1.0">1.0</keyframe>
- <start ref="visual.bottom">1.0</start>
- <end ref="visual.top">1.0</end>
- </param>
- </visual>
-</layers>
--- a/videoplayback/hbvideoplaybackview/resources/effects/controlbar_disappear.fxml Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-<layers>
- <visual>
- <param name="translation_y" type="anim">
- <duration>0.4</duration>
- <style>outquad</style>
- <keyframe at="0.0">0.0</keyframe>
- <keyframe at="1.0">1.0</keyframe>
- <start ref="visual.top">-1.0</start>
- <end ref="visual.bottom">1.0</end>
- </param>
- </visual>
-</layers>
--- a/videoplayback/hbvideoplaybackview/resources/hbvideoplaybackview.docml Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,191 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<hbdocument version="1.1">
- <widget name="content" type="HbWidget">
- <widget name="bufferingIcon" type="HbLabel">
- <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
- <icon iconName="preroll_anim" name="icon"/>
- <real name="z" value="6"/>
- <sizehint height="10.44776un" type="PREFERRED" width="10.44776un"/>
- <bool name="visible" value="FALSE"/>
- </widget>
- <widget name="titleLayout" type="HbWidget">
- <widget name="title" type="HbLabel">
- <enums name="alignment" value="AlignLeft|AlignVCenter|AlignLeading"/>
- <real name="z" value="0"/>
- <string name="plainText"/>
- </widget>
- <widget name="titleGroupBox" type="HbGroupBox">
- <real name="z" value="1"/>
- <bool name="collapsable" value="FALSE"/>
- <string name="heading" value="Group Box"/>
- </widget>
- <real name="z" value="2"/>
- <sizehint height="4.92537un" type="PREFERRED" width="95.52239un"/>
- <bool name="visible" value="FALSE"/>
- <layout type="stacked">
- <stackitem itemname="title"/>
- <stackitem itemname="titleGroupBox"/>
- </layout>
- </widget>
- <widget name="transparentWindow" type="HbTransparentWindow">
- <real name="z" value="0"/>
- <bool name="visible" value="FALSE"/>
- <layout type="anchor"/>
- </widget>
- <widget name="controlBarLayout" type="HbWidget">
- <widget name="progressSlider" type="HbProgressSlider">
- <integer name="progressValue" value="70"/>
- <bool name="minMaxTextVisible" value="TRUE"/>
- <enums name="minMaxTextAlignment" value="AlignVCenter|AlignHCenter"/>
- <string name="minText"/>
- <real name="z" value="1"/>
- <enums name="orientation" value="Horizontal"/>
- <integer name="sliderValue" value="30"/>
- <string name="maxText"/>
- <string name="textAlignment" value="AlignBottom"/>
- <bool name="textVisible" value="FALSE"/>
- <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="1"/>
- <sizehint height="5.97015un" type="PREFERRED" width="95.52239un"/>
- </widget>
- <real name="z" value="1"/>
- <sizehint height="23.8806un" type="PREFERRED" width="95.52239un"/>
- <bool name="visible" value="FALSE"/>
- <layout orientation="Vertical" spacing="0un" type="linear">
- <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
- <linearitem itemname="progressSlider"/>
- </layout>
- </widget>
- <widget name="fileDetailsLayout" type="HbWidget">
- <widget name="fileDetails" type="HbListWidget"/>
- <real name="z" value="3"/>
- <bool name="visible" value="FALSE"/>
- <layout orientation="Vertical" type="linear">
- <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
- <linearitem itemname="fileDetails" spacing="0px"/>
- </layout>
- </widget>
- <widget name="bitmapLayout" type="HbWidget">
- <widget name="audioOnlyBitmap" type="HbLabel">
- <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
- <icon iconName="qtg_large_just_audio" name="icon"/>
- <bool name="visible" value="FALSE"/>
- </widget>
- <widget name="partialAudioOnlyBitmap" type="HbLabel">
- <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
- <icon iconName="qtg_large_corrupted" name="icon"/>
- <bool name="visible" value="FALSE"/>
- </widget>
- <widget name="realAudioOnlyBitmap" type="HbLabel">
- <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
- <icon iconName="qtg_large_realplayer" name="icon"/>
- <bool name="visible" value="FALSE"/>
- </widget>
- <widget name="tvOutBitmap" type="HbLabel">
- <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
- <icon iconName="qtg_large_tv_out" name="icon"/>
- <bool name="visible" value="FALSE"/>
- </widget>
- <real name="z" value="5"/>
- <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
- <sizehint height="28.80597un" type="PREFERRED" width="47.7612un"/>
- <sizehint height="2.68657un" type="MINIMUM" width="2.68657un"/>
- <sizehint height="2307732.46823un" type="MAXIMUM" width="2307732.46823un"/>
- <bool name="visible" value="FALSE"/>
- <layout type="stacked">
- <stackitem itemname="audioOnlyBitmap"/>
- <stackitem itemname="partialAudioOnlyBitmap"/>
- <stackitem itemname="realAudioOnlyBitmap"/>
- <stackitem itemname="tvOutBitmap"/>
- </layout>
- </widget>
- <widget name="detailsPlaybackWindow" type="HbWidget">
- <widget name="small_transparentWindow" type="HbTransparentWindow">
- <widget name="detailsViewPlayButton" type="HbPushButton">
- <icon iconName="qtg_mono_play" name="icon"/>
- <real name="z" value="2"/>
- <sizehint height="8.95522un" type="PREFERRED" width="8.95522un"/>
- <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
- <string name="state" value="normal"/>
- </widget>
- <real name="z" value="0"/>
- <sizehint height="32.83582un" type="PREFERRED" width="53.73134un"/>
- <layout type="anchor">
- <anchoritem dst="detailsViewPlayButton" dstEdge="CENTERH" spacing="0un" src="" srcEdge="CENTERH"/>
- <anchoritem dst="detailsViewPlayButton" dstEdge="CENTERV" spacing="0un" src="" srcEdge="CENTERV"/>
- </layout>
- </widget>
- <widget name="attachShareButton" type="HbWidget">
- <widget name="detailsAttachButton" type="HbPushButton">
- <icon iconName="qtg_mono_attach" name="icon"/>
- <sizehint height="5.97015un" type="PREFERRED" width="47.7612un"/>
- <bool name="visible" value="FALSE"/>
- <string name="state" value="normal"/>
- </widget>
- <widget name="detailsShareButton" type="HbPushButton">
- <icon iconName="qtg_mono_share" name="icon"/>
- <real name="z" value="1"/>
- <sizehint height="5.97015un" type="PREFERRED" width="47.7612un"/>
- <bool name="visible" value="TRUE"/>
- <string name="state" value="normal"/>
- </widget>
- <real name="z" value="0"/>
- <sizehint height="7.46269un" type="PREFERRED" width="47.7612un"/>
- <layout type="stacked">
- <stackitem itemname="detailsAttachButton"/>
- <stackitem itemname="detailsShareButton"/>
- </layout>
- </widget>
- <real name="z" value="4"/>
- <bool name="visible" value="FALSE"/>
- <layout orientation="Vertical" spacing="0un" type="linear">
- <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
- <linearitem itemname="small_transparentWindow"/>
- <linearitem itemname="attachShareButton"/>
- </layout>
- </widget>
- <widget name="rnLogoBitmap" type="HbLabel">
- <icon iconName="qtg_large_realplayer" name="icon"/>
- <real name="z" value="7"/>
- <sizehint height="29.85075un" type="PREFERRED" width="29.85075un"/>
- <bool name="visible" value="FALSE"/>
- </widget>
- <size height="var(hb-param-screen-short-edge)" name="size" width="var(hb-param-screen-long-edge)"/>
- <real name="z" value="1"/>
- <rect height="var(hb-param-screen-short-edge)" name="geometry" width="var(hb-param-screen-long-edge)" x="0un" y="0un"/>
- <sizehint height="78251.79327un" type="MAXIMUM" width="78251.79327un"/>
- <layout type="anchor">
- <anchoritem dst="bufferingIcon" dstEdge="CENTERH" spacing="0un" src="" srcEdge="CENTERH"/>
- <anchoritem dst="bufferingIcon" dstEdge="CENTERV" spacing="0un" src="" srcEdge="CENTERV"/>
- <anchoritem dst="titleLayout" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
- <anchoritem dst="titleLayout" dstEdge="TOP" spacing="9.40299un" src="" srcEdge="TOP"/>
- <anchoritem dst="titleLayout" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
- <anchoritem dst="titleLayout" dstEdge="BOTTOM" spacing="14.32836un" src="" srcEdge="TOP"/>
- <anchoritem dst="transparentWindow" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
- <anchoritem dst="transparentWindow" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
- <anchoritem dst="transparentWindow" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
- <anchoritem dst="transparentWindow" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
- <anchoritem dst="controlBarLayout" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
- <anchoritem dst="controlBarLayout" dstEdge="TOP" spacing="-14.92537un" src="" srcEdge="BOTTOM"/>
- <anchoritem dst="controlBarLayout" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
- <anchoritem dst="controlBarLayout" dstEdge="BOTTOM" spacing="-8.95522un" src="" srcEdge="BOTTOM"/>
- <anchoritem dst="detailsPlaybackWindow" dstEdge="TOP" spacing="0un" src="titleLayout" srcEdge="BOTTOM"/>
- <anchoritem dst="detailsPlaybackWindow" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
- <anchoritem dst="detailsPlaybackWindow" dstEdge="RIGHT" spacing="0un" src="" srcEdge="CENTERH"/>
- <anchoritem dst="detailsPlaybackWindow" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
- <anchoritem dst="bitmapLayout" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
- <anchoritem dst="bitmapLayout" dstEdge="TOP" spacing="0un" src="titleLayout" srcEdge="TOP"/>
- <anchoritem dst="bitmapLayout" dstEdge="RIGHT" spacing="0un" src="" srcEdge="CENTERH"/>
- <anchoritem dst="bitmapLayout" dstEdge="BOTTOM" spacing="0un" src="controlBarLayout" srcEdge="TOP"/>
- <anchoritem dst="fileDetailsLayout" dstEdge="LEFT" spacing="0un" src="" srcEdge="CENTERH"/>
- <anchoritem dst="fileDetailsLayout" dstEdge="TOP" spacing="0un" src="titleLayout" srcEdge="BOTTOM"/>
- <anchoritem dst="fileDetailsLayout" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
- <anchoritem dst="fileDetailsLayout" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
- <anchoritem dst="rnLogoBitmap" dstEdge="CENTERH" spacing="0un" src="" srcEdge="CENTERH"/>
- <anchoritem dst="rnLogoBitmap" dstEdge="CENTERV" spacing="0un" src="" srcEdge="CENTERV"/>
- </layout>
- </widget>
- <metadata activeUIState="Common ui state" display="NHD-3.2-inch_landscape" unit="un">
- <resource location="hbvideoplaybackview.qrc"/>
- <uistate name="Common ui state" sections="#common"/>
- </metadata>
-</hbdocument>
--- a/videoplayback/hbvideoplaybackview/resources/hbvideoplaybackview.qrc Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<RCC>
- <qresource prefix="hbvideoplaybackview">
- <file>animations/rn_preroll_anim.axml</file>
- <file>animations/generic_preroll_anim.axml</file>
- <file>hbvideoplaybackview.docml</file>
- <file>effects/controlbar_appear.fxml</file>
- <file>effects/controlbar_disappear.fxml</file>
- </qresource>
-</RCC>
--- a/videoplayback/hbvideoplaybackview/rom/hbvideoplaybackview.iby Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +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: hbvideoplaybackview.iby
-*
-*/
-
-
-
-#ifndef __HBVIDEOPLAYBACKVIEW_IBY__
-#define __HBVIDEOPLAYBACKVIEW_IBY__
-#include <data_caging_paths_for_iby.hrh>
-
-file=ABI_DIR\BUILD_DIR\hbvideoplaybackview.dll \sys\bin\hbvideoplaybackview.dll
-
-#endif // __HBVIDEOPLAYBACKVIEW_IBY__
--- a/videoplayback/hbvideoplaybackview/tsrc/testcontrolconfiguration/inc/testcontrolconfiguration.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-/**
-* 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: test module for QMPXVideoPlaybackControlConfiguration
-*
-*/
-
-// Version : %version: 1 %
-
-
-#ifndef __TESTCONTROLCONFIGURATION_H__
-#define __TESTCONTROLCONFIGURATION_H__
-
-
-// INCLUDES
-#include <QtTest/QtTest>
-
-class HbVideoBasePlaybackView;
-class CMPXVideoViewWrapper;
-class QMPXVideoPlaybackViewFileDetails;
-class QMPXVideoPlaybackControlsController;
-class QMPXVideoPlaybackControlConfiguration;
-
-
-
-class TestControlConfiguration : public QObject
-{
- Q_OBJECT
-
-public:
-
- /**
- * will be called before each testfunction is executed.
- *
- */
- void init();
-
- /**
- * will be called after every testfunction.
- *
- */
- void cleanup();
-
- // test functions for the test framework
-
-
- void setup();
-
-private slots:
- void testControlList();
- void testUpdateControlsWithFileDetails();
- void testUpdateControlList();
-
-
-signals:
-
- void commandSignal(int);
-
-private:
- HbVideoBasePlaybackView* mBaseVideoView;
- CMPXVideoViewWrapper* mVideoViewWrapper;
- QMPXVideoPlaybackViewFileDetails* mFileDetails;
- QMPXVideoPlaybackControlsController* mControlsController;
- QMPXVideoPlaybackControlConfiguration* mControlConfig;
-
-};
-
-
-#endif // __TESTCONTROLCONFIGURATION_H__
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testcontrolconfiguration/src/testcontrolconfiguration.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,265 +0,0 @@
-/**
-* 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: tester for methods in VideoSortFilterProxyModel
-*
-*/
-
-// Version : %version: 4 %
-
-#include <hbapplication.h>
-#include <hbinstance.h>
-#include <qdebug>
-#include <qgraphicswidget>
-
-#include "mpxvideoplaybackcontrol.hrh"
-#include "mpxhelixplaybackplugindefs.h"
-
-#include "testcontrolconfiguration.h"
-
-#include "mpxvideoplaybackviewfiledetails.h"
-#include "mpxvideoplaybackcontrolscontroller.h"
-#include "mpxvideoplaybackdocumentloader.h"
-
-
-#define private public
-#include "mpxvideoplaybackcontrolconfiguration.h"
-#undef private
-
-
-// ---------------------------------------------------------------------------
-// main
-// ---------------------------------------------------------------------------
-//
-int main(int argc, char *argv[])
-{
- MPX_ENTER_EXIT(_L("TestControlConfiguration::Main()"));
-
- HbApplication app(argc, argv);
- HbMainWindow window;
-
- TestControlConfiguration tv;
-
- char *pass[3];
- pass[0] = argv[0];
- pass[1] = "-o";
- pass[2] = "c:\\data\\TestControlConfiguration.txt";
-
- int res = QTest::qExec(&tv, 3, pass);
-
- return res;
-}
-
-// ---------------------------------------------------------------------------
-// init
-// ---------------------------------------------------------------------------
-//
-void TestControlConfiguration::init()
-{
- MPX_ENTER_EXIT(_L("TestControlConfiguration::init()"));
-}
-
-// ---------------------------------------------------------------------------
-// init
-// ---------------------------------------------------------------------------
-//
-void TestControlConfiguration::setup()
-{
- MPX_ENTER_EXIT(_L("TestControlConfiguration::setup()"));
-
- mFileDetails = new QMPXVideoPlaybackViewFileDetails();
-
- mControlsController = new QMPXVideoPlaybackControlsController( mFileDetails );
-
- mControlConfig = new QMPXVideoPlaybackControlConfiguration( mControlsController );
-}
-
-// ---------------------------------------------------------------------------
-// cleanup
-// ---------------------------------------------------------------------------
-//
-void TestControlConfiguration::cleanup()
-{
- MPX_ENTER_EXIT(_L("TestControlConfiguration::cleanup()"));
-
- if ( mFileDetails )
- {
- delete mFileDetails;
- mFileDetails = NULL;
- }
-
- if ( mControlsController )
- {
- delete mControlsController;
- mControlsController = NULL;
- }
-
- if ( mControlConfig )
- {
- delete mControlConfig;
- mControlConfig = NULL;
- }
-}
-
-// ---------------------------------------------------------------------------
-// testControlList
-// ---------------------------------------------------------------------------
-//
-void TestControlConfiguration::testControlList()
-{
- MPX_ENTER_EXIT(_L("TestControlConfiguration::testControlList()"));
-
- setup();
-
- //
- // Streaming case
- //
- mFileDetails->mPlaybackMode = EMPXVideoStreaming;
-
- mControlConfig->createControlList();
- QList<TMPXVideoPlaybackControls> 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();
-}
-
-// ---------------------------------------------------------------------------
-// testUpdateControlsWithFileDetails
-// ---------------------------------------------------------------------------
-//
-void TestControlConfiguration::testUpdateControlsWithFileDetails()
-{
- MPX_ENTER_EXIT(_L("TestControlConfiguration::testUpdateControlsWithFileDetails()"));
-
- setup();
- mControlConfig->createControlList();
-
- //
- // 1. test with mVideoEnabled = false
- //
- mControlsController->mFileDetails->mVideoEnabled = false;
-
- mControlConfig->updateControlsWithFileDetails();
-
- QList<TMPXVideoPlaybackControls> controlsList = mControlConfig->controlList();
-
- QVERIFY( controlsList.contains( EMPXControlBar ) );
-
- //
- // 2. test with mVideoEnabled = true
- //
- mControlsController->mFileDetails->mVideoEnabled = false;
-
- mControlConfig->updateControlsWithFileDetails();
-
- QVERIFY( controlsList.contains( EMPXControlBar ) );
-
- QGraphicsWidget *widget =
- mControlsController->layoutLoader()->findWidget( QString( "transparentWindow" ) );
-
- QVERIFY( widget->isVisible() );
-
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
-// testUpdateControlList
-// ---------------------------------------------------------------------------
-//
-void TestControlConfiguration::testUpdateControlList()
-{
- MPX_ENTER_EXIT(_L("TestControlConfiguration::testUpdateControlList()"));
-
- setup();
- mControlConfig->createControlList();
-
- //
- // 1. Test for Details View
- //
- mControlConfig->updateControlList( EMPXControlCmdDetailsViewOpened );
- QList<TMPXVideoPlaybackControls> 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( EMPXFileDetailsWidget ) );
-
- //
- // 4. RN log gets removed
- //
- mControlConfig->updateControlList( EMPXControlCmdAudionOnlyViewOpened );
- controlsList = mControlConfig->controlList();
-
- QVERIFY( ! controlsList.contains( EMPXRealLogoBitmap ) );
-
- cleanup();
-}
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testcontrolconfiguration/stub/inc/mpxvideoplaybackcontrolscontroller.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +0,0 @@
-/*
-* 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 MPXVideoPlaybackControlsController
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_
-#define MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_
-
-// INCLUDES
-#include <qobject>
-
-#include <mpxplaybackframeworkdefs.h>
-
-#include "mpxvideo_debug.h"
-#include "mpxcommonvideoplaybackview.hrh"
-#include "mpxvideoplaybackviewfiledetails.h"
-
-// FORWARD DECLARATIONS
-class QMPXVideoPlaybackDocumentLoader;
-class QMPXVideoPlaybackControlsController;
-class QMPXVideoPlaybackControlConfiguration;
-
-
-
-// CLASS DECLARATION
-
-class QMPXVideoPlaybackControlsController : public QObject
-{
- Q_OBJECT
-
- public:
-
- /**
- * constructor.
- */
- QMPXVideoPlaybackControlsController( QMPXVideoPlaybackViewFileDetails *details );
-
- /**
- * Destructor.
- */
- virtual ~QMPXVideoPlaybackControlsController();
-
- public:
- /**
- * Return file details
- */
- inline QMPXVideoPlaybackViewFileDetails* fileDetails();
-
- QMPXVideoPlaybackDocumentLoader* layoutLoader();
-
- public:
- /**
- * Initialize controller
- */
- void initializeController();
-
- public:
- QMPXVideoPlaybackViewFileDetails *mFileDetails;
-
- QMPXVideoPlaybackControlConfiguration *mControlsConfig;
-
- QMPXVideoPlaybackDocumentLoader *mLoader;
-};
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::fileDetails
-// -------------------------------------------------------------------------------------------------
-//
-inline
-QMPXVideoPlaybackViewFileDetails* QMPXVideoPlaybackControlsController::fileDetails()
-{
- return mFileDetails;
-}
-
-#endif /*MPXVIDEOPLAYBACKCONTROLSCONTROLLER_P_H_*/
-
-// End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/testcontrolconfiguration/stub/inc/mpxvideoplaybackdocumentloader.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackDocumentLoader
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKDOCUMENTHANDLER_H_
-#define MPXVIDEOPLAYBACKDOCUMENTHANDLER_H_
-
-
-#include <qobject>
-
-class QList;
-class QGraphicsWidget;
-class QMPXVideoPlaybackControlsController;
-
-class QMPXVideoPlaybackDocumentLoader : public QObject
-{
- public:
- QMPXVideoPlaybackDocumentLoader();
-
- virtual ~QMPXVideoPlaybackDocumentLoader();
-
- public:
- QGraphicsWidget* findWidget( const QString &name );
-
- private:
- QGraphicsWidget* createWidget( const QString &name );
- int exist( const QString &name );
-
- private:
- QList<QGraphicsWidget*> mWidgets;
-};
-
-#endif /*MPXVIDEOPLAYBACKDOCUMENTHANDLER_H_*/
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testcontrolconfiguration/stub/inc/mpxvideoplaybackviewfiledetails.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
-* 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: MPX Video File Details (QT)
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-
-#ifndef __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-#define __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-
-#include <qobject.h>
-#include "mpxhelixplaybackplugindefs.h"
-
-
-//
-// CLASS DECLARATION
-//
-class QMPXVideoPlaybackViewFileDetails : public QObject
-{
- public:
- //
- // Constructor
- //
- QMPXVideoPlaybackViewFileDetails();
-
- //
- // Destructor.
- //
- virtual ~QMPXVideoPlaybackViewFileDetails();
-
- //
- // Clear all file details
- //
- void clearFileDetails();
-
- public:
- //
- // Data
- //
- QString mClipName;
- QString mTitle;
- QString mArtist;
- QString mMimeType;
- QString mDescription;
- QString mLocation;
- QString mCopyright;
- QString mLanguage;
- QString mKeywords;
-
- TMPXVideoMode mPlaybackMode;
- bool mSeekable;
- bool mPausableStream;
- bool mAudioEnabled;
- bool mVideoEnabled;
- bool mPartialPlayback;
- bool mRNFormat;
- bool mTvOutConnected;
- bool mDrmProtected;
- bool mMultiItemPlaylist;
-
- int mVideoHeight;
- int mVideoWidth;
- int mBitRate;
- int mDuration;
-};
-
-#endif // __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testcontrolconfiguration/stub/src/mpxvideoplaybackcontrolscontroller.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
-* 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 MPXVideoPlaybackControlsController
-*
-*/
-
-// Version : %version: 3 %
-
-
-
-// INCLUDE FILES
-
-#include "../inc/mpxvideoplaybackdocumentloader.h"
-#include "../inc/mpxvideoplaybackviewfiledetails.h"
-#include "../inc/mpxvideoplaybackcontrolscontroller.h"
-
-#include "mpxvideoplaybackcontrolconfiguration.h"
-
-
-// ================= MEMBER FUNCTIONS ==============================================================
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController()
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController(
- QMPXVideoPlaybackViewFileDetails *details )
- : mFileDetails( details )
-{
- initializeController();
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::initializeController()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::initializeController()
-{
- mLoader = new QMPXVideoPlaybackDocumentLoader();
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController"));
-
- if ( mLoader )
- {
- delete mLoader;
- mLoader = NULL;
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::layoutLoader
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackDocumentLoader* QMPXVideoPlaybackControlsController::layoutLoader()
-{
- return mLoader;
-}
-
-// End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/testcontrolconfiguration/stub/src/mpxvideoplaybackdocumentloader.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackDocumentLoader
-*
-*/
-
-// Version : %version: 1 %
-
-
-#include <hbwidget.h>
-#include <hbtransparentwindow.h>
-#include <hblabel.h>
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackdocumentloader.h"
-
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::QMPXVideoPlaybackDocumentLoader
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackDocumentLoader::QMPXVideoPlaybackDocumentLoader()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackDocumentLoader::QMPXVideoPlaybackDocumentLoader()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::~QMPXVideoPlaybackDocumentLoader
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackDocumentLoader::~QMPXVideoPlaybackDocumentLoader()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::QMPXVideoPlaybackDocumentLoader") );
-
- for ( int i = 0 ; i < mWidgets.count() ; i++ )
- {
- mWidgets.removeAt( 0 );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::findWidget()
-// -------------------------------------------------------------------------------------------------
-//
-QGraphicsWidget *QMPXVideoPlaybackDocumentLoader::findWidget( const QString &name )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::findWidget") );
-
- QGraphicsWidget *object = NULL;
-
- int index = exist( name );
-
- if ( index == -1 )
- {
- object = createWidget( name );
- }
- else
- {
- object = mWidgets[ index ];
- }
-
- return object;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::createWidget()
-// -------------------------------------------------------------------------------------------------
-//
-QGraphicsWidget *QMPXVideoPlaybackDocumentLoader::createWidget( const QString &name )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::createWidget") );
-
- QGraphicsWidget *object = NULL;
-
- if ( name == "transparentWindow" )
- {
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::creating transparentWindow") );
-
- object = new HbTransparentWindow();
- object->setObjectName( name );
-
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::appending to object list") );
- mWidgets.append( object );
- }
- else if ( name == "title" )
- {
- object = new HbLabel();
- object->setObjectName( name );
- mWidgets.append( object );
- }
-
- return object;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::exist()
-// -------------------------------------------------------------------------------------------------
-//
-int QMPXVideoPlaybackDocumentLoader::exist( const QString &name )
-{
- int i = 0;
-
- for ( ; i < mWidgets.count() ; i++ )
- {
- if( mWidgets[i]->objectName() == name )
- {
- break;
- }
- }
-
- if ( i == mWidgets.count() )
- {
- i = -1;
- }
-
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::exist %d"), i );
-
- return i;
-}
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testcontrolconfiguration/stub/src/mpxvideoplaybackviewfiledetails.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
-* 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: class for MPX Video File Details (Qt)
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-//
-// INCLUDE FILES
-//
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackviewfiledetails.h"
-
-
-// ============================ MEMBER FUNCTIONS ===================================================
-
-QMPXVideoPlaybackViewFileDetails::QMPXVideoPlaybackViewFileDetails()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::QMPXVideoPlaybackViewFileDetails()"));
-
- clearFileDetails();
-}
-
-QMPXVideoPlaybackViewFileDetails::~QMPXVideoPlaybackViewFileDetails()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::~QMPXVideoPlaybackViewFileDetails()"));
-
- clearFileDetails();
-}
-
-void
-QMPXVideoPlaybackViewFileDetails::clearFileDetails()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::ClearFileDetails()"));
-
- mMimeType = tr("");
- mTitle = tr("");
- mArtist = tr("");
- mClipName = tr("");
- mDescription = tr("");
- mLocation = tr("");
- mCopyright = tr("");
- mLanguage = tr("");
- mKeywords = tr("");
-
- mPlaybackMode = EMPXVideoLocal;
- mSeekable = false;
- mPausableStream = false;
- mAudioEnabled = false;
- mVideoEnabled = false;
- mPartialPlayback = false;
- mRNFormat = false;
-
- mDuration = 0;
- mTvOutConnected = false;
- mDrmProtected = false;
-
- mVideoHeight = 0;
- mVideoWidth = 0;
- mBitRate = 0;
-}
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testcontrolconfiguration/testcontrolconfiguration.pro Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-#
-# 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: Project file for building testcontrolconfiguration
-#
-#
-# Version : %version: 2 %
-
-
-TEMPLATE = app
-TARGET = testcontrolconfiguration
-CONFIG += qtestlib hb qt
-
-DEPENDPATH += . \
- inc \
- src
-
-INCLUDEPATH += stub/inc \
- ../inc \
- ../../inc \
- ../../../inc \
- ../../../../inc \
-
-DEPENDPATH += stub/inc stub/src inc src
-
-# Input
-HEADERS += ../../../controlinc/mpxvideoplaybackcontrolconfiguration.h \
- mpxvideoplaybackdocumentloader.h \
- testcontrolconfiguration.h \
- mpxvideoplaybackcontrolscontroller.h \
- mpxvideoplaybackviewfiledetails.h
-
-SOURCES += ../../../controlsrc/mpxvideoplaybackcontrolconfiguration.cpp \
- mpxvideoplaybackdocumentloader.cpp \
- testcontrolconfiguration.cpp \
- mpxvideoplaybackviewfiledetails.cpp \
- mpxvideoplaybackcontrolscontroller.cpp
--- a/videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/inc/testdetailsplaybackwindow.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/**
-* 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: tester for methods in TestDetailsPlaybackWindow
-*
-*/
-
-// Version : %version: 5 %
-
-
-#ifndef __TESTDETAILSPLAYBACKWINDOW_H__
-#define __TESTDETAILSPLAYBACKWINDOW_H__
-
-
-// INCLUDES
-#include <QtTest/QtTest>
-
-class QEvent;
-class QMPXVideoPlaybackDetailsPlaybackWindow;
-class QMPXVideoPlaybackControlsController;
-
-class TestDetailsPlaybackWindow : public QObject
-{
- Q_OBJECT
-
-public:
-
- /**
- * will be called before each testfunction is executed.
- *
- */
- void init( bool attachOperation = false );
-
- /**
- * will be called after every testfunction.
- *
- */
- void cleanup();
-
- // test functions for the test framework
-private slots:
-
- // the order in which these testXX methods are declared is important
- // changing this order will affect the test results
- void testUpdateState();
- void testPlayPause();
- void testAttach();
- void testSend();
-
-signals:
- void commandSignal();
-
-private:
- QMPXVideoPlaybackDetailsPlaybackWindow* mWindow;
- QMPXVideoPlaybackControlsController* mController;
-};
-
-
-#endif // __TESTDETAILSPLAYBACKWINDOW_H__
-
-// End of file
-
-
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/src/testdetailsplaybackwindow.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,217 +0,0 @@
-/**
-* 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: tester for methods in TestDetailsPlaybackWindow
-*
-*/
-
-// Version : %version: 7 %
-
-
-#include <qdebug>
-#include <qgraphicsscenemouseevent>
-
-#include <hbmainwindow.h>
-#include <hbapplication.h>
-
-#include "hbpushbutton.h"
-#include "mpxvideoplaybackviewfiledetails.h"
-#include "mpxvideoplaybackcontrolscontroller.h"
-#include "testdetailsplaybackwindow.h"
-
-
-#define private public
-#include "mpxvideoplaybackdetailsplaybackwindow.h"
-#undef private
-
-// ---------------------------------------------------------------------------
-// main
-// ---------------------------------------------------------------------------
-//
-int main(int argc, char *argv[])
-{
- MPX_ENTER_EXIT(_L("TestDetailsPlaybackWindow::Main()"));
-
- HbApplication app(argc, argv);
- HbMainWindow window;
-
- TestDetailsPlaybackWindow tv;
-
- char *pass[3];
- pass[0] = argv[0];
- pass[1] = "-o";
- pass[2] = "c:\\data\\testdetailsplaybackwindow.txt";
-
- int res = QTest::qExec(&tv, 3, pass);
-
- return res;
-}
-
-// ---------------------------------------------------------------------------
-// init
-// ---------------------------------------------------------------------------
-//
-void TestDetailsPlaybackWindow::init( bool attachOperation )
-{
- MPX_ENTER_EXIT(_L("TestDetailsPlaybackWindow::init()"));
-
- mController = new QMPXVideoPlaybackControlsController( attachOperation );
- mWindow = new QMPXVideoPlaybackDetailsPlaybackWindow( mController );
-
- mWindow->initialize();
-}
-
-// ---------------------------------------------------------------------------
-// cleanup
-// ---------------------------------------------------------------------------
-//
-void TestDetailsPlaybackWindow::cleanup()
-{
- MPX_ENTER_EXIT(_L("TestDetailsPlaybackWindow::cleanup()"));
-
- if ( mController )
- {
- delete mController;
- mController = NULL;
- }
-
- if ( mWindow )
- {
- delete mWindow;
- mWindow = NULL;
- }
-}
-
-// ---------------------------------------------------------------------------
-// testUpdateState
-// ---------------------------------------------------------------------------
-//
-void TestDetailsPlaybackWindow::testUpdateState()
-{
- MPX_ENTER_EXIT(
- _L("TestDetailsPlaybackWindow::testUpdateState()"));
-
- init();
-
- TMPXPlaybackState state = EPbStatePlaying;
- mWindow->updateState( state );
- QVERIFY( mWindow->mPlayButton->isVisible() == false );
-
- state = EPbStatePaused;
- mWindow->updateState( state );
- QVERIFY( mWindow->mPlayButton->isVisible() == true );
-
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
-// testPlayPause
-// ---------------------------------------------------------------------------
-//
-void TestDetailsPlaybackWindow::testPlayPause()
-{
- MPX_ENTER_EXIT(
- _L("TestDetailsPlaybackWindow::testPlayPause()"));
-
- init();
-
- mWindow->mPlayButton->release();
- QVERIFY( mController->mCommand == EMPXPbvCmdPlayPause );
-
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
-// testAttach
-// ---------------------------------------------------------------------------
-//
-void TestDetailsPlaybackWindow::testAttach()
-{
- MPX_ENTER_EXIT(
- _L("TestDetailsPlaybackWindow::testAttach()"));
-
- //
- // test when 'attach' operation is enabled
- //
- init( true );
-
- //
- // connect signal/slot
- //
- connect( this, SIGNAL( commandSignal() ), mController, SLOT( attachVideo() ) );
-
- //
- // emit signal
- //
- emit commandSignal();
-
- //
- // verify the controller attachVideo() slot has been called
- //
- QVERIFY( mController->mAttachVideoDone == true );
-
- //
- // disconnect signal/slot
- //
- disconnect( this, SIGNAL( commandSignal() ), mController, SLOT( attachVideo() ) );
-
- //
- // clean up
- //
- cleanup();
-
-}
-
-// ---------------------------------------------------------------------------
-// testSend
-// ---------------------------------------------------------------------------
-//
-void TestDetailsPlaybackWindow::testSend()
-{
- MPX_ENTER_EXIT(
- _L("TestDetailsPlaybackWindow::testSend()"));
-
- //
- // test when 'share' operation is enabled
- //
- init( false );
-
- //
- // connect signal/slot
- //
- connect( this, SIGNAL( commandSignal() ), mController, SLOT( sendVideo() ) );
-
- //
- // emit signal
- //
- emit commandSignal();
-
- //
- // verify the controller sendVideo() slot has been called
- //
- QVERIFY( mController->mCommand == EMPXPbvCmdPause );
- QVERIFY( mController->mSendVideoDone == true );
-
- //
- // disconnect signal/slot
- //
- disconnect( this, SIGNAL( commandSignal() ), mController, SLOT( sendVideo() ) );
-
- //
- // clean up
- //
- cleanup();
-
-}
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/stub/inc/hbpushbutton.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
-* 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 HbPushButton
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-#ifndef HBPUSHBUTTON_H_
-#define HBPUSHBUTTON_H
-
-#include <hbwidget.h>
-#include <hbstyle.h>
-
-class QGraphicsItem;
-class HbFrameDrawer;
-
-class HbPushButton : public HbWidget
-{
- Q_OBJECT
-
- public:
- HbPushButton();
- virtual ~HbPushButton();
-
- public:
- void setEnabled( bool enabled );
- void setVisible( bool visible );
- void setSelected( bool selected );
- bool isEnabled();
- bool isVisible();
- bool isSelected();
- QGraphicsItem* primitive( HbStyle::Primitive primitive ) const;
- void press();
- void release();
- HbFrameDrawer* frameBackground();
- void setFrameBackground( HbFrameDrawer *drawer );
-
- signals:
- void pressed();
- void released();
-
- public:
- bool mVisible;
- bool mEnabled;
- bool mSelected;
-
- QGraphicsItem *mBackground;
- HbFrameDrawer *mFrameDrawer;
-};
-
-#endif /*HBPUSHBUTTON_H*/
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/stub/inc/mpxvideoplaybackcontrolscontroller.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,162 +0,0 @@
-/*
-* 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 MPXVideoPlaybackControlsController
-*
-*/
-
-// Version : %version: 3 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_
-#define MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_
-
-// INCLUDES
-#include <qobject>
-#include <mpxplaybackframeworkdefs.h>
-
-#include "mpxvideo_debug.h"
-#include "mpxcommonvideoplaybackview.hrh"
-#include "mpxvideoplaybackviewfiledetails.h"
-
-// FORWARD DECLARATIONS
-class QMPXVideoPlaybackDocumentLoader;
-
-
-// DATA TYPES
-
-enum TMPXTimerAction
-{
- EMPXTimerCancel,
- EMPXTimerReset
-};
-
-enum TPlaybackViewMode
-{
- EFullScreenView,
- EDetailsView,
- EAudioOnlyView
-};
-
-// CLASS DECLARATION
-
-class QMPXVideoPlaybackControlsController : public QObject
-{
- Q_OBJECT
-
- public:
-
- /**
- * constructor.
- */
- QMPXVideoPlaybackControlsController( bool attachOperation );
-
- /**
- * Destructor.
- */
- virtual ~QMPXVideoPlaybackControlsController();
-
- public:
-
- /**
- * Command handling function.
- * Call HandleCommandL() of container
- */
- void handleCommand( TMPXVideoPlaybackViewCommandIds command, int value = 0 );
-
- /**
- * Reset or cancel timers for the controls
- */
- void resetDisappearingTimers( TMPXTimerAction timerAction );
-
- /**
- * Return state
- */
- inline TMPXPlaybackState state();
-
- /**
- * Return file details
- */
- inline QMPXVideoPlaybackViewFileDetails* fileDetails();
-
- inline QMPXVideoPlaybackDocumentLoader* layoutLoader();
-
- TPlaybackViewMode viewMode();
-
- void changeViewMode( TPlaybackViewMode viewMode, bool transitionEffect = true );
-
- bool isAttachOperation();
-
- private slots:
- void attachVideo();
- void sendVideo();
-
- public:
- QMPXVideoPlaybackViewFileDetails *mFileDetails;
- QMPXVideoPlaybackDocumentLoader *mLoader;
-
- TMPXPlaybackState mState;
- TPlaybackViewMode mViewMode;
- TMPXTimerAction mTimerAction;
- TMPXVideoPlaybackViewCommandIds mCommand;
- int mCommandValue;
- bool mIsAttachOperation;
- bool mAttachVideoDone;
- bool mSendVideoDone;
-};
-
-// INLINE METHODS
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::state
-// -------------------------------------------------------------------------------------------------
-//
-inline
-TMPXPlaybackState QMPXVideoPlaybackControlsController::state()
-{
- return mState;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::fileDetails
-// -------------------------------------------------------------------------------------------------
-//
-inline
-QMPXVideoPlaybackViewFileDetails* QMPXVideoPlaybackControlsController::fileDetails()
-{
- return mFileDetails;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::layoutLoader
-// -------------------------------------------------------------------------------------------------
-//
-inline
-QMPXVideoPlaybackDocumentLoader* QMPXVideoPlaybackControlsController::layoutLoader()
-{
- return mLoader;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::viewMode
-// -------------------------------------------------------------------------------------------------
-//
-inline
-TPlaybackViewMode QMPXVideoPlaybackControlsController::viewMode()
-{
- return mViewMode;
-}
-
-#endif /*MPXVIDEOPLAYBACKCONTROLSCONTROLLER_P_H_*/
-
-// End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/stub/inc/mpxvideoplaybackdocumentloader.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackDocumentLoader
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKDOCUMENTHANDLER_H_
-#define MPXVIDEOPLAYBACKDOCUMENTHANDLER_H_
-
-
-#include <qobject>
-#include <qlist>
-
-class QGraphicsWidget;
-class QMPXVideoPlaybackControlsController;
-
-class QMPXVideoPlaybackDocumentLoader : public QObject
-{
- public:
- QMPXVideoPlaybackDocumentLoader();
- virtual ~QMPXVideoPlaybackDocumentLoader();
-
- public:
- QGraphicsWidget* findWidget( const QString &name );
-
- private:
- QGraphicsWidget* createWidget( const QString &name );
- int exist( const QString &name );
-
- private:
- QList<QGraphicsWidget*> mWidgets;
-};
-
-#endif /*MPXVIDEOPLAYBACKDOCUMENTHANDLER_H_*/
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/stub/inc/mpxvideoplaybackviewfiledetails.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
-* 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: MPX Video File Details (QT)
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-
-#ifndef __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-#define __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-
-#include <qobject.h>
-#include "mpxhelixplaybackplugindefs.h"
-
-
-//
-// CLASS DECLARATION
-//
-class QMPXVideoPlaybackViewFileDetails : public QObject
-{
- public:
- //
- // Constructor
- //
- QMPXVideoPlaybackViewFileDetails();
-
- //
- // Destructor.
- //
- virtual ~QMPXVideoPlaybackViewFileDetails();
-
- //
- // Clear all file details
- //
- void clearFileDetails();
-
- public:
- //
- // Data
- //
- QString mClipName;
- QString mTitle;
- QString mArtist;
- QString mMimeType;
- QString mDescription;
- QString mLocation;
- QString mCopyright;
- QString mLanguage;
- QString mKeywords;
-
- TMPXVideoMode mPlaybackMode;
- bool mSeekable;
- bool mPausableStream;
- bool mAudioEnabled;
- bool mVideoEnabled;
- bool mPartialPlayback;
- bool mRNFormat;
- bool mTvOutConnected;
- bool mDrmProtected;
- bool mMultiItemPlaylist;
-
- int mVideoHeight;
- int mVideoWidth;
- int mBitRate;
- int mDuration;
-};
-
-#endif // __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/stub/src/hbpushbutton.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,181 +0,0 @@
-/*
-* 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 HbPushButton
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-#include <qgraphicswidget>
-
-#include <hbframedrawer.h>
-
-#include "mpxvideo_debug.h"
-#include "hbpushbutton.h"
-
-// -------------------------------------------------------------------------------------------------
-// HbPushButton::HbPushButton
-// -------------------------------------------------------------------------------------------------
-//
-HbPushButton::HbPushButton()
- : mVisible( false )
- , mEnabled( false )
- , mSelected( false )
- , mFrameDrawer( NULL )
-{
- MPX_ENTER_EXIT(_L("HbPushButton::HbPushButton()"));
-
- mBackground = new QGraphicsWidget();
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbPushButton::~HbPushButton
-// -------------------------------------------------------------------------------------------------
-//
-HbPushButton::~HbPushButton()
-{
- MPX_DEBUG(_L("HbPushButton::HbPushButton") );
-
- if ( mBackground )
- {
- delete mBackground;
- mBackground = NULL;
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbPushButton::setEnabled
-// -------------------------------------------------------------------------------------------------
-//
-void HbPushButton::setEnabled( bool enabled )
-{
- MPX_DEBUG(_L("HbPushButton::setEnabled %d"), enabled );
-
- mEnabled = enabled;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbPushButton::isEnabled
-// -------------------------------------------------------------------------------------------------
-//
-bool HbPushButton::isEnabled()
-{
- MPX_DEBUG(_L("HbPushButton::isEnabled %d"), mEnabled );
-
- return mEnabled;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbPushButton::setVisible
-// -------------------------------------------------------------------------------------------------
-//
-void HbPushButton::setVisible( bool visible )
-{
- MPX_DEBUG(_L("HbPushButton::setVisible %d"), visible );
-
- mVisible = visible;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbPushButton::isVisible
-// -------------------------------------------------------------------------------------------------
-//
-bool HbPushButton::isVisible()
-{
- MPX_DEBUG(_L("HbPushButton::isVisible %d"), mVisible );
-
- return mVisible;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbPushButton::setSelected
-// -------------------------------------------------------------------------------------------------
-//
-void HbPushButton::setSelected( bool selected )
-{
- MPX_DEBUG(_L("HbPushButton::setSelected %d"), selected );
-
- mSelected = selected;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbPushButton::isSelected
-// -------------------------------------------------------------------------------------------------
-//
-bool HbPushButton::isSelected()
-{
- MPX_DEBUG(_L("HbPushButton::isSelected %d"), mSelected );
-
- return mSelected;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbPushButton::primitive
-// -------------------------------------------------------------------------------------------------
-//
-QGraphicsItem* HbPushButton::primitive( HbStyle::Primitive primitive ) const
-{
- MPX_DEBUG(_L("HbPushButton::primitive") );
-
- Q_UNUSED( primitive );
- return mBackground;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbPushButton::press
-// -------------------------------------------------------------------------------------------------
-//
-void HbPushButton::press()
-{
- MPX_DEBUG(_L("HbPushButton::press") );
-
- emit pressed();
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbPushButton::release
-// -------------------------------------------------------------------------------------------------
-//
-void HbPushButton::release()
-{
- MPX_DEBUG(_L("HbPushButton::release") );
-
- emit released();
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbPushButton::frameBackground
-// -------------------------------------------------------------------------------------------------
-//
-HbFrameDrawer* HbPushButton::frameBackground()
-{
- MPX_DEBUG(_L("HbPushButton::frameBackground") );
-
- return mFrameDrawer;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbPushButton::setFrameBackground
-// -------------------------------------------------------------------------------------------------
-//
-void HbPushButton::setFrameBackground( HbFrameDrawer *drawer )
-{
- MPX_DEBUG(_L("HbPushButton::setFrameBackground") );
-
- mFrameDrawer = drawer;
-}
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/stub/src/mpxvideoplaybackcontrolscontroller.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,127 +0,0 @@
-/*
-* 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 MPXVideoPlaybackControlsController
-*
-*/
-
-// Version : %version: 5 %
-
-
-
-// INCLUDE FILES
-
-
-#include "mpxvideoplaybackdocumentloader.h"
-#include "mpxvideoplaybackcontrolscontroller.h"
-
-// ================= MEMBER FUNCTIONS ==============================================================
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController()
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController( bool attachOperation )
- : mViewMode( EFullScreenView )
- , mIsAttachOperation( attachOperation )
- , mAttachVideoDone( false )
- , mSendVideoDone( false )
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController()"));
-
- mLoader = new QMPXVideoPlaybackDocumentLoader();
- mFileDetails = new QMPXVideoPlaybackViewFileDetails();
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::handleCommand()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::handleCommand(
- TMPXVideoPlaybackViewCommandIds command, int value )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::handleCommand(%d)"), command);
-
- mCommand = command;
- mCommandValue = value;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::changeViewMode
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::changeViewMode(
- TPlaybackViewMode viewMode, bool transitionEffect )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::changeViewMode()"));
-
- Q_UNUSED( transitionEffect );
- mViewMode = viewMode;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::resetDisappearingTimers()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::resetDisappearingTimers( TMPXTimerAction timerAction )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::resetDisappearingTimers()"));
-
- mTimerAction = timerAction;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::isAttachOperation()
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackControlsController::isAttachOperation()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::isAttachOperation() ret %d"),
- mIsAttachOperation);
-
- return mIsAttachOperation;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::attachVideo()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::attachVideo()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::attachVideo()"));
-
- mAttachVideoDone = true;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::sendVideo()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::sendVideo()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::sendVideo()"));
-
- handleCommand( EMPXPbvCmdPause );
- mSendVideoDone = true;
-}
-
-// End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/stub/src/mpxvideoplaybackdocumentloader.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,123 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackDocumentLoader
-*
-*/
-
-// Version : %version: 4 %
-
-
-
-#include "hbpushbutton.h"
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackdocumentloader.h"
-
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::QMPXVideoPlaybackDocumentLoader
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackDocumentLoader::QMPXVideoPlaybackDocumentLoader()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackDocumentLoader::QMPXVideoPlaybackDocumentLoader()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::~QMPXVideoPlaybackDocumentLoader
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackDocumentLoader::~QMPXVideoPlaybackDocumentLoader()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::QMPXVideoPlaybackDocumentLoader") );
-
- for ( int i = 0 ; i < mWidgets.count() ; i++ )
- {
- mWidgets.removeAt( 0 );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::findWidget()
-// -------------------------------------------------------------------------------------------------
-//
-QGraphicsWidget *QMPXVideoPlaybackDocumentLoader::findWidget( const QString &name )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::findWidget( %s )"), name.data() );
-
- QGraphicsWidget *object = NULL;
-
- int index = exist( name );
-
- if ( index == -1 )
- {
- object = createWidget( name );
- }
- else
- {
- object = mWidgets[ index ];
- }
-
- return object;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::createWidget()
-// -------------------------------------------------------------------------------------------------
-//
-QGraphicsWidget *QMPXVideoPlaybackDocumentLoader::createWidget( const QString &name )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::createWidget( %s )"), name.data() );
-
- QGraphicsWidget *object = NULL;
-
- if ( name == "detailsViewPlayButton" ||
- name == "detailsAttachButton" ||
- name == "detailsShareButton" )
- {
- object = new HbPushButton();
- object->setObjectName( name );
- mWidgets.append( object );
- }
-
- return object;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::exist()
-// -------------------------------------------------------------------------------------------------
-//
-int QMPXVideoPlaybackDocumentLoader::exist( const QString &name )
-{
- int i = 0;
-
- for ( ; i < mWidgets.count() ; i++ )
- {
- if( mWidgets[i]->objectName() == name )
- {
- break;
- }
- }
-
- if ( i == mWidgets.count() )
- {
- i = -1;
- }
-
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::exist( %s ) ret %d"), name.data(), i );
-
- return i;
-}
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/stub/src/mpxvideoplaybackviewfiledetails.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
-* 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: class for MPX Video File Details (Qt)
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-//
-// INCLUDE FILES
-//
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackviewfiledetails.h"
-
-
-// ============================ MEMBER FUNCTIONS ===================================================
-
-QMPXVideoPlaybackViewFileDetails::QMPXVideoPlaybackViewFileDetails()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::QMPXVideoPlaybackViewFileDetails()"));
-
- clearFileDetails();
-}
-
-QMPXVideoPlaybackViewFileDetails::~QMPXVideoPlaybackViewFileDetails()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::~QMPXVideoPlaybackViewFileDetails()"));
-
- clearFileDetails();
-}
-
-void
-QMPXVideoPlaybackViewFileDetails::clearFileDetails()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::ClearFileDetails()"));
-
- mMimeType = tr("");
- mTitle = tr("");
- mArtist = tr("");
- mClipName = tr("");
- mDescription = tr("");
- mLocation = tr("");
- mCopyright = tr("");
- mLanguage = tr("");
- mKeywords = tr("");
-
- mPlaybackMode = EMPXVideoLocal;
- mSeekable = false;
- mPausableStream = false;
- mAudioEnabled = false;
- mVideoEnabled = false;
- mPartialPlayback = false;
- mRNFormat = false;
-
- mDuration = 0;
- mTvOutConnected = false;
- mDrmProtected = false;
-
- mVideoHeight = 0;
- mVideoWidth = 0;
- mBitRate = 0;
-}
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/testdetailsplaybackwindow.pro Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-#
-# 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: Project file for building testdetailsplaybackwindow
-#
-#
-# Version : %version: 3 %
-
-TEMPLATE = app
-TARGET = testdetailsplaybackwindow
-CONFIG += qtestlib qt hb
-
-INCLUDEPATH += stub/inc \
- ../../../../inc \
- ../../../inc
-
-
-DEPENDPATH += inc src stub/inc stub/src
-
-# Input
-HEADERS += testdetailsplaybackwindow.h \
- mpxvideoplaybackcontrolscontroller.h \
- mpxvideoplaybackdocumentloader.h \
- mpxvideoplaybackviewfiledetails.h \
- hbpushbutton.h \
- ../../controlinc/mpxvideoplaybackdetailsplaybackwindow.h
-
-SOURCES += testdetailsplaybackwindow.cpp \
- mpxvideoplaybackcontrolscontroller.cpp \
- mpxvideoplaybackdocumentloader.cpp \
- mpxvideoplaybackviewfiledetails.cpp \
- hbpushbutton.cpp \
- ../../controlsrc/mpxvideoplaybackdetailsplaybackwindow.cpp
--- a/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/inc/testfullscreencontrol.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-/**
-* 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: test module for QMPXVideoPlaybackFullScreenControl
-*
-*/
-
-#ifndef __TESTFULLSCREENCONTROL_H__
-#define __TESTFULLSCREENCONTROL_H__
-
-
-// INCLUDES
-#include <QtTest/QtTest>
-
-#include "mpxvideoplaybackcontrol.hrh"
-
-
-class QMPXVideoPlaybackControlsController;
-class QMPXVideoPlaybackFullScreenControl;
-
-
-
-class TestFullScreenControl : public QObject
-{
- Q_OBJECT
-
-public:
-
- /**
- * will be called before each testfunction is executed.
- *
- */
- void init();
-
- /**
- * will be called after every testfunction.
- *
- */
- void cleanup();
-
- // test functions for the test framework
-
-
- void setup(TMPXVideoPlaybackControls control);
-
- void createControl(TMPXVideoPlaybackControls control);
-
-private slots:
-
- void testControlIndex();
-
- void testDurationChanged();
-
- void testPositionChanged();
-
- void testAspectRatioChanged();
-
- void testUpdateState();
-
- void testUpdateControlsWithFileDetails();
-
- void testUpdateControlProperties();
-
-signals:
-
- void commandSignal(int);
-
-private:
- QMPXVideoPlaybackControlsController* mControlsController;
- QMPXVideoPlaybackFullScreenControl* mFullScreenControl;
-
-};
-
-
-#endif // __TESTFULLSCREENCONTROL_H__
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/src/testfullscreencontrol.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,282 +0,0 @@
-/**
-* 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: tester for methods in QMPXVideoPlaybackFullScreenControl
-*
-*/
-
-// Version : %version: 3 %
-
-
-#include <hbapplication.h>
-#include <hbinstance.h>
-#include <qdebug>
-
-#include "mpxhelixplaybackplugindefs.h"
-
-#include "testfullscreencontrol.h"
-
-#include "mpxvideoplaybackviewfiledetails.h"
-#include "mpxvideoplaybackcontrolscontroller.h"
-#include "mpxvideoplaybackcontrolbar.h"
-
-
-#define private public
-#define protected public
-#include "mpxvideoplaybackfullscreencontrol.h"
-#undef protected
-#undef private
-
-
-// ---------------------------------------------------------------------------
-// main
-// ---------------------------------------------------------------------------
-//
-int main(int argc, char *argv[])
-{
- MPX_ENTER_EXIT(_L("TestFullScreenControl::Main()"));
-
- HbApplication app(argc, argv);
- HbMainWindow window;
-
- TestFullScreenControl tv;
-
- char *pass[3];
- pass[0] = argv[0];
- pass[1] = "-o";
- pass[2] = "c:\\data\\TestFullScreenControl.txt";
-
- int res = QTest::qExec(&tv, 3, pass);
-
- return res;
-}
-
-// ---------------------------------------------------------------------------
-// init
-// ---------------------------------------------------------------------------
-//
-void TestFullScreenControl::init()
-{
- MPX_ENTER_EXIT(_L("TestFullScreenControl::init()"));
-}
-
-// ---------------------------------------------------------------------------
-// setup
-// ---------------------------------------------------------------------------
-//
-void TestFullScreenControl::setup(TMPXVideoPlaybackControls control)
-{
- MPX_ENTER_EXIT(_L("TestFullScreenControl::setup()"));
-
-
- mControlsController = new QMPXVideoPlaybackControlsController();
-
- createControl( control );
-}
-
-// ---------------------------------------------------------------------------
-// createControl
-// ---------------------------------------------------------------------------
-//
-void TestFullScreenControl::createControl(TMPXVideoPlaybackControls control)
-{
- MPX_ENTER_EXIT(_L("TestFullScreenControl::createControl()"));
-
- switch ( control )
- {
- case EMPXStatusPane:
- {
- mFullScreenControl = new QMPXVideoPlaybackFullScreenControl( mControlsController,
- control,
- NULL,
- 0 );
- break;
- }
- case EMPXControlBar:
- {
- QMPXVideoPlaybackControlBar *controlBar =
- new QMPXVideoPlaybackControlBar( mControlsController );
-
- mFullScreenControl = new QMPXVideoPlaybackFullScreenControl( mControlsController,
- control,
- controlBar,
- 0 );
-
- break;
- }
- case EMPXDetailsViewPlaybackWindow:
- {
- break;
- }
- }
-}
-
-// ---------------------------------------------------------------------------
-// cleanup
-// ---------------------------------------------------------------------------
-//
-void TestFullScreenControl::cleanup()
-{
- MPX_ENTER_EXIT(_L("TestFullScreenControl::cleanup()"));
-
- if ( mControlsController )
- {
- delete mControlsController;
- mControlsController = NULL;
- }
-
- if ( mFullScreenControl )
- {
- delete mFullScreenControl;
- mFullScreenControl = NULL;
- }
-}
-
-// ---------------------------------------------------------------------------
-// testControlIndex
-// ---------------------------------------------------------------------------
-//
-void TestFullScreenControl::testControlIndex()
-{
- MPX_ENTER_EXIT(_L("TestFullScreenControl::testControlIndex()"));
-
- setup( EMPXStatusPane );
-
- QVERIFY( mFullScreenControl->controlIndex() == EMPXStatusPane );
-}
-
-// ---------------------------------------------------------------------------
-// testDurationChanged
-// ---------------------------------------------------------------------------
-//
-void TestFullScreenControl::testDurationChanged()
-{
- MPX_ENTER_EXIT(_L("TestFullScreenControl::testDurationChanged()"));
-
- // test for progress bar
- delete mFullScreenControl;
- mFullScreenControl = NULL;
- setup( EMPXControlBar );
- QVERIFY( mFullScreenControl->durationChanged( 100 ) );
- QVERIFY( static_cast<QMPXVideoPlaybackControlBar*>(mFullScreenControl->mControl)->mDuration == 100 );
-
- // test for something other than progress bar
- delete mFullScreenControl;
- mFullScreenControl = NULL;
- setup( EMPXStatusPane );
- QVERIFY( ! mFullScreenControl->durationChanged( 100 ) );
-
-}
-
-// ---------------------------------------------------------------------------
-// testPositionChanged
-// ---------------------------------------------------------------------------
-//
-void TestFullScreenControl::testPositionChanged()
-{
- MPX_ENTER_EXIT(_L("TestFullScreenControl::testPositionChanged()"));
-
- // test for progress bar
- delete mFullScreenControl;
- mFullScreenControl = NULL;
- setup( EMPXControlBar );
- QVERIFY( mFullScreenControl->positionChanged( 100 ) );
- QVERIFY( static_cast<QMPXVideoPlaybackControlBar*>(mFullScreenControl->mControl)->mPosition == 100 );
-
- // test for something other than progress bar
- delete mFullScreenControl;
- mFullScreenControl = NULL;
- setup( EMPXStatusPane );
- QVERIFY( ! mFullScreenControl->positionChanged( 100 ) );
-}
-
-// ---------------------------------------------------------------------------
-// testAspectRatioChanged
-// ---------------------------------------------------------------------------
-//
-void TestFullScreenControl::testAspectRatioChanged()
-{
- MPX_ENTER_EXIT(_L("TestFullScreenControl::testAspectRatioChanged()"));
-
- // test for button bar
- delete mFullScreenControl;
- mFullScreenControl = NULL;
- setup( EMPXControlBar );
- QVERIFY( mFullScreenControl->aspectRatioChanged( 3 ) ); // EMMFNatural
- QVERIFY( static_cast<QMPXVideoPlaybackControlBar*>(mFullScreenControl->mControl)->mAspectRatio == 3 );
-
- // test for something other than button bar
- delete mFullScreenControl;
- mFullScreenControl = NULL;
- setup( EMPXStatusPane );
- QVERIFY( ! mFullScreenControl->aspectRatioChanged( 3 ) ); // EMMFNatural
-}
-
-// ---------------------------------------------------------------------------
-// testUpdateState
-// ---------------------------------------------------------------------------
-//
-void TestFullScreenControl::testUpdateState()
-{
- MPX_ENTER_EXIT(_L("TestFullScreenControl::testUpdateState()"));
-
- delete mFullScreenControl;
- mFullScreenControl = NULL;
- setup( EMPXControlBar );
- mFullScreenControl->updateState( EPbStatePaused );
- QVERIFY( static_cast<QMPXVideoPlaybackControlBar*>(mFullScreenControl->mControl)->mState == EPbStatePaused );
-}
-
-// ---------------------------------------------------------------------------
-// testUpdateControlsWithFileDetails
-// ---------------------------------------------------------------------------
-//
-void TestFullScreenControl::testUpdateControlsWithFileDetails()
-{
- MPX_ENTER_EXIT(_L("TestFullScreenControl::testUpdateControlsWithFileDetails()"));
-
- QMPXVideoPlaybackViewFileDetails *fileDetails = new QMPXVideoPlaybackViewFileDetails();
-
- setup( EMPXControlBar );
-
- fileDetails->mPausableStream = true;
-
- mFullScreenControl->updateControlsWithFileDetails( fileDetails );
-
- QVERIFY( static_cast<QMPXVideoPlaybackControlBar*>(mFullScreenControl->mControl)->mFileDetails->mPausableStream );
-
- if ( fileDetails )
- {
- delete fileDetails;
- fileDetails = NULL;
- }
-}
-
-// ---------------------------------------------------------------------------
-// testUpdateControlProperties
-// ---------------------------------------------------------------------------
-//
-void TestFullScreenControl::testUpdateControlProperties()
-{
- MPX_ENTER_EXIT(_L("TestFullScreenControl::testUpdateControlProperties()"));
-
- setup(EMPXStatusPane);
-
- mFullScreenControl->updateControlProperties( 1 );
-
- QVERIFY( mFullScreenControl != NULL );
-
- QVERIFY( mFullScreenControl->mProperties == 1 );
-}
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/stub/inc/mpxvideoplaybackcontrolbar.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackControlBar
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKCONTROLBAR_H_
-#define MPXVIDEOPLAYBACKCONTROLBAR_H_
-
-
-
-#include <hbwidget.h>
-#include <mpxplaybackframeworkdefs.h>
-
-class QMPXVideoPlaybackViewFileDetails;
-class QMPXVideoPlaybackControlsController;
-
-class QMPXVideoPlaybackControlBar : public HbWidget
-{
- Q_OBJECT
-
- public:
- QMPXVideoPlaybackControlBar( QMPXVideoPlaybackControlsController* controller );
- virtual ~QMPXVideoPlaybackControlBar();
- void updateState( TMPXPlaybackState state );
- void aspectRatioChanged( int aspectRatio );
- void updateWithFileDetails( QMPXVideoPlaybackViewFileDetails* details );
- void setVisibleToControlBar( bool visible );
- void durationChanged( int duration );
- void positionChanged( int position );
-
- public:
- QMPXVideoPlaybackControlsController *mController;
- int mPosition;
- int mDuration;
- int mAspectRatio;
- bool mVisibility;
- TMPXPlaybackState mState;
- QMPXVideoPlaybackViewFileDetails *mFileDetails;
-};
-
-#endif /*MPXVIDEOPLAYBACKCONTROLBAR_H_*/
--- a/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/stub/inc/mpxvideoplaybackcontrolscontroller.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
-* 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 MPXVideoPlaybackControlsController
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_
-#define MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_
-
-// INCLUDES
-#include <qobject>
-
-
-#include "mpxvideo_debug.h"
-#include "mpxcommonvideoplaybackview.hrh"
-
-// CLASS DECLARATION
-
-class QMPXVideoPlaybackControlsController : public QObject
-{
- Q_OBJECT
-
- public:
-
- /**
- * constructor.
- */
- QMPXVideoPlaybackControlsController();
-
- /**
- * Destructor.
- */
- virtual ~QMPXVideoPlaybackControlsController();
-
- public:
-
- /**
- * Command handling function.
- * Call HandleCommandL() of container
- */
- void handleCommand( TMPXVideoPlaybackViewCommandIds command, int value = 0 );\
-};
-
-
-#endif /*MPXVIDEOPLAYBACKCONTROLSCONTROLLER_P_H_*/
-
-// End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/stub/inc/mpxvideoplaybackdetailsplaybackwindow.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackDetailsPlaybackWindow
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKDETAILSPLAYBACKWINDOW_H_
-#define MPXVIDEOPLAYBACKDETAILSPLAYBACKWINDOW_H_
-
-#include <hbwidget.h>
-#include <mpxplaybackframeworkdefs.h>
-
-
-class QMPXVideoPlaybackControlsController;
-
-class QMPXVideoPlaybackDetailsPlaybackWindow : public HbWidget
-{
- Q_OBJECT
-
- public:
- QMPXVideoPlaybackDetailsPlaybackWindow( QMPXVideoPlaybackControlsController* controller );
- virtual ~QMPXVideoPlaybackDetailsPlaybackWindow();
- void updateState( TMPXPlaybackState state );
-
- private:
- QMPXVideoPlaybackControlsController *mController;
-
- bool mInitialized;
-};
-
-#endif /*MPXVIDEOPLAYBACKDETAILSPLAYBACKWINDOW_H_*/
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/stub/inc/mpxvideoplaybackfiledetailswidget.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackFileDetailsWidget
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKFILEDETAILSWIDGET_H_
-#define MPXVIDEOPLAYBACKFILEDETAILSWIDGET_H_
-
-#include <hbwidget.h>
-#include <hbstyleloader.h>
-
-class QMPXVideoPlaybackViewFileDetails;
-class QMPXVideoPlaybackControlsController;
-class HbListWidget;
-
-class QMPXVideoPlaybackFileDetailsWidget : public HbWidget
-{
- Q_OBJECT
-
- public:
- QMPXVideoPlaybackFileDetailsWidget( QMPXVideoPlaybackControlsController* controller );
- virtual ~QMPXVideoPlaybackFileDetailsWidget();
-
- void updateWithFileDetails( QMPXVideoPlaybackViewFileDetails* details );
-
- private:
- QMPXVideoPlaybackControlsController *mController;
- HbListWidget *mListWidget;
- bool mFileDetailsUpdated;
-
-};
-
-#endif /*MPXVIDEOPLAYBACKFILEDETAILSWIDGET_H_*/
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/stub/inc/mpxvideoplaybackviewfiledetails.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
-* 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: MPX Video File Details (QT)
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-
-#ifndef __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-#define __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-
-#include <qobject.h>
-#include "mpxhelixplaybackplugindefs.h"
-
-
-//
-// CLASS DECLARATION
-//
-class QMPXVideoPlaybackViewFileDetails : public QObject
-{
- public:
- //
- // Constructor
- //
- QMPXVideoPlaybackViewFileDetails();
-
- //
- // Destructor.
- //
- virtual ~QMPXVideoPlaybackViewFileDetails();
-
- //
- // Clear all file details
- //
- void clearFileDetails();
-
- public:
- //
- // Data
- //
- QString mClipName;
- QString mTitle;
- QString mArtist;
- QString mMimeType;
- QString mDescription;
- QString mLocation;
- QString mCopyright;
- QString mLanguage;
- QString mKeywords;
-
- TMPXVideoMode mPlaybackMode;
- bool mSeekable;
- bool mPausableStream;
- bool mAudioEnabled;
- bool mVideoEnabled;
- bool mPartialPlayback;
- bool mRNFormat;
- bool mTvOutConnected;
- bool mDrmProtected;
- bool mMultiItemPlaylist;
-
- int mVideoHeight;
- int mVideoWidth;
- int mBitRate;
- int mDuration;
-};
-
-#endif // __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/stub/src/hblabel.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
-* 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 HbLabel
-*
-*/
-
-// Version : %version: 1 %
-
-
-#include "hblabel.h"
-
-// -------------------------------------------------------------------------------------------------
-// HbPushButton::HbPushButton
-// -------------------------------------------------------------------------------------------------
-//
-HbLabel::HbLabel()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbLabel::~HbLabel
-// -------------------------------------------------------------------------------------------------
-//
-HbLabel::~HbLabel()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbLabel::setVisible
-// -------------------------------------------------------------------------------------------------
-//
-void HbLabel::setVisible( bool visible )
-{
- mVisible = visible;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbLabel::isVisible
-// -------------------------------------------------------------------------------------------------
-//
-bool HbLabel::isVisible()
-{
- return mVisible;
-}
-
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/stub/src/mpxvideoplaybackcontrolbar.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackControlBar
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-#include <hbframeitem.h>
-#include <hbframedrawer.h>
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackcontrolbar.h"
-#include "mpxcommonvideoplaybackview.hrh"
-#include "mpxvideoplaybackcontrolscontroller.h"
-
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlBar::QMPXVideoPlaybackControlBar()
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackControlBar::QMPXVideoPlaybackControlBar(
- QMPXVideoPlaybackControlsController* controller )
- : mController( controller )
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlBar::QMPXVideoPlaybackControlBar"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlBar::~QMPXVideoPlaybackControlBar()
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackControlBar::~QMPXVideoPlaybackControlBar()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlBar::~QMPXVideoPlaybackControlBar()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlBar::updateState()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlBar::updateState( TMPXPlaybackState state )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlBar::updateState() state = %d"), state );
-
- mState = state;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlBar::aspectRatioChanged()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlBar::aspectRatioChanged( int aspectRatio )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlBar::aspectRatioChanged() aspectRatio = %d"), aspectRatio );
-
- mAspectRatio = aspectRatio;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlBar::updateWithFileDetails()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlBar::updateWithFileDetails(
- QMPXVideoPlaybackViewFileDetails* details )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlBar::updateWithFileDetails()"));
-
- mFileDetails = details;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlBar::setVisibleToControlBar()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlBar::setVisibleToControlBar( bool visible )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlBar::setVisibleToControlBar()"));
-
- mVisibility = visible;
-}
-
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlBar::durationChanged()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlBar::durationChanged( int duration )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlBar::durationChanged()"));
-
- mDuration = duration;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlBar::positionChanged()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlBar::positionChanged( int position )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlBar::positionChanged()"));
-
- mPosition = position;
-}
-
-//End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/stub/src/mpxvideoplaybackcontrolscontroller.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
-* 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 MPXVideoPlaybackControlsController
-*
-*/
-
-// Version : %version: 4 %
-
-
-
-// INCLUDE FILES
-#include <coecntrl.h>
-#include <bautils.h>
-#include <barsread.h>
-#include <f32file.h>
-
-#include <hblabel.h>
-#include <hbaction.h>
-#include <hbiconanimator.h>
-
-#include "../inc/mpxvideoplaybackviewfiledetails.h"
-#include "../inc/mpxvideoplaybackcontrolscontroller.h"
-
-#include "mpxvideoplaybackcontrolconfiguration.h"
-
-
-// ================= MEMBER FUNCTIONS ==============================================================
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController()
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::handleCommand()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::handleCommand(
- TMPXVideoPlaybackViewCommandIds command, int value )
-{
- Q_UNUSED( command );
- Q_UNUSED( value );
-}
-
-// End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/stub/src/mpxvideoplaybackdetailsplaybackwindow.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackProgressBar
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#include <qfileinfo>
-#include <qgraphicsscenemouseevent>
-
-#include <hblabel.h>
-#include <hbpushbutton.h>
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackcontrolscontroller.h"
-#include "mpxvideoplaybackdetailsplaybackwindow.h"
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDetailsPlaybackWindow::QMPXVideoPlaybackDetailsPlaybackWindow
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackDetailsPlaybackWindow::QMPXVideoPlaybackDetailsPlaybackWindow(
- QMPXVideoPlaybackControlsController* controller )
- : mController( controller )
- , mInitialized( false )
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackDetailsPlaybackWindow::QMPXVideoPlaybackDetailsPlaybackWindow()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDetailsPlaybackWindow::~QMPXVideoPlaybackDetailsPlaybackWindow
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackDetailsPlaybackWindow::~QMPXVideoPlaybackDetailsPlaybackWindow()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackDetailsPlaybackWindow::~QMPXVideoPlaybackDetailsPlaybackWindow()"));
-}
-
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDetailsPlaybackWindow::updateState()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackDetailsPlaybackWindow::updateState( TMPXPlaybackState state )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackDetailsPlaybackWindow::updateState() state = %d"), state );
-}
-
-//End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/stub/src/mpxvideoplaybackfiledetailswidget.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackFileDetailsWidget
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-#include <qfileinfo>
-#include <qgraphicslinearlayout>
-#include <qdatetime>
-#include <qdir>
-
-#include <hblistwidgetitem.h>
-#include <hbratingslider.h>
-#include <hblistwidget.h>
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackfiledetailswidget.h"
-#include "mpxvideoplaybackcontrolscontroller.h"
-
-const float KILOBYTE = 1024 ;
-const QString KDATETIMEFORMAT = "d/M/yyyy hh:mm:ss ap";
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFileDetailsWidget::QMPXVideoPlaybackFileDetailsWidget
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackFileDetailsWidget::QMPXVideoPlaybackFileDetailsWidget(
- QMPXVideoPlaybackControlsController* controller )
- : mController( controller )
- , mListWidget( 0 )
- , mFileDetailsUpdated( false )
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackFileDetailsWidget::QMPXVideoPlaybackFileDetailsWidget()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFileDetailsWidget::~QMPXVideoPlaybackFileDetailsWidget
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackFileDetailsWidget::~QMPXVideoPlaybackFileDetailsWidget()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackFileDetailsWidget::~QMPXVideoPlaybackFileDetailsWidget()"));
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFileDetailsWidget::updateControlsWithFileDetails
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackFileDetailsWidget::updateWithFileDetails(
- QMPXVideoPlaybackViewFileDetails* details )
-{
- Q_UNUSED( details );
-}
-
-
-//End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/stub/src/mpxvideoplaybackviewfiledetails.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
-* 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: class for MPX Video File Details (Qt)
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-//
-// INCLUDE FILES
-//
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackviewfiledetails.h"
-
-
-// ============================ MEMBER FUNCTIONS ===================================================
-
-QMPXVideoPlaybackViewFileDetails::QMPXVideoPlaybackViewFileDetails()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::QMPXVideoPlaybackViewFileDetails()"));
-
- clearFileDetails();
-}
-
-QMPXVideoPlaybackViewFileDetails::~QMPXVideoPlaybackViewFileDetails()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::~QMPXVideoPlaybackViewFileDetails()"));
-
- clearFileDetails();
-}
-
-void
-QMPXVideoPlaybackViewFileDetails::clearFileDetails()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::ClearFileDetails()"));
-
- mMimeType = tr("");
- mTitle = tr("");
- mArtist = tr("");
- mClipName = tr("");
- mDescription = tr("");
- mLocation = tr("");
- mCopyright = tr("");
- mLanguage = tr("");
- mKeywords = tr("");
-
- mPlaybackMode = EMPXVideoLocal;
- mSeekable = false;
- mPausableStream = false;
- mAudioEnabled = false;
- mVideoEnabled = false;
- mPartialPlayback = false;
- mRNFormat = false;
-
- mDuration = 0;
- mTvOutConnected = false;
- mDrmProtected = false;
-
- mVideoHeight = 0;
- mVideoWidth = 0;
- mBitRate = 0;
-}
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/testfullscreencontrol.pro Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-#
-# 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: Project file for building testfullscreencontrol
-#
-#
-# Version : %version: 3 %
-
-
-TEMPLATE = app
-TARGET = testfullscreencontrol
-CONFIG += qtestlib hb qt
-
-DEPENDPATH += . \
- inc \
- src
-
-INCLUDEPATH += stub/inc \
- ../inc \
- ../../inc \
- ../../../inc \
- ../../../../inc \
-
-DEPENDPATH += stub/inc stub/src inc src
-
-# Input
-HEADERS += ../../../controlinc/mpxvideoplaybackfullscreencontrol.h \
- inc/testfullscreencontrol.h \
- mpxvideoplaybackcontrolscontroller.h \
- mpxvideoplaybackviewfiledetails.h \
- mpxvideoplaybackcontrolbar.h \
- mpxvideoplaybackfiledetailswidget.h \
- mpxvideoplaybackdetailsplaybackwindow.h
-
-
-SOURCES += ../../../controlsrc/mpxvideoplaybackfullscreencontrol.cpp \
- src/testfullscreencontrol.cpp \
- mpxvideoplaybackcontrolscontroller.cpp \
- mpxvideoplaybackviewfiledetails.cpp \
- mpxvideoplaybackcontrolbar.cpp \
- mpxvideoplaybackfiledetailswidget.cpp \
- mpxvideoplaybackdetailsplaybackwindow.cpp
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/inc/testmpxvideoplaybackcontrolbar.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/**
-* 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: tester for methods in TestMPXVideoPlaybackControlBar
-*
-*/
-
-// Version : %version: 1 %
-
-#ifndef __TESTMPXVIDEOPLAYBACKCONTROLBAR_H__
-#define __TESTMPXVIDEOPLAYBACKCONTROLBAR_H__
-
-
-// INCLUDES
-#include <QtTest/QtTest>
-
-class QMPXVideoPlaybackControlBar;
-class QMPXVideoPlaybackControlsController;
-
-class TestMPXVideoPlaybackControlBar : public QObject
-{
- Q_OBJECT
-
-public:
-
- /**
- * will be called before each testfunction is executed.
- *
- */
- void init();
-
- /**
- * will be called after every testfunction.
- *
- */
- void cleanup();
-
- // test functions for the test framework
-private slots:
-
- // the order in which these testXX methods are declared is important
- // changing this order will affect the test results
- void testupdateState();
- void testaspectRatioChanged();
- void testUpdateWithFileDetails();
- void testSetVisibleToControlBar();
- void testDurationChanged();
- void testPositionChanged();
-
-signals:
- void commandSignal(int);
-
-private:
- QMPXVideoPlaybackControlBar *mControlBar;
- QMPXVideoPlaybackControlsController *mController;
-};
-
-
-#endif // __TESTMPXVIDEOPLAYBACKCONTROLBAR_H__
-
-// End of file
-
-
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/src/testmpxvideoplaybackcontrolbar.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,215 +0,0 @@
-/**
-* 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: tester for methods in TestMPXVideoPlaybackControlBar
-*
-*/
-
-// Version : %version: 2 %
-
-
-#include <qdebug>
-#include <hbmainwindow.h>
-#include <hbapplication.h>
-
-#include "mpxvideoplaybacktoolbar.h"
-#include "mpxvideoplaybackprogressbar.h"
-#include "testmpxvideoplaybackcontrolbar.h"
-#include "mpxvideoplaybackviewfiledetails.h"
-#include "mpxvideoplaybackcontrolscontroller.h"
-
-#define private public
-#include "mpxvideoplaybackcontrolbar.h"
-#undef private
-
-// ---------------------------------------------------------------------------
-// main
-// ---------------------------------------------------------------------------
-//
-int main(int argc, char *argv[])
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackControlBar::Main()"));
-
- HbApplication app(argc, argv);
- HbMainWindow window;
-
- TestMPXVideoPlaybackControlBar tv;
-
- char *pass[3];
- pass[0] = argv[0];
- pass[1] = "-o";
- pass[2] = "c:\\data\\testmpxvideoplaybackcontrolbar.txt";
-
- int res = QTest::qExec(&tv, 3, pass);
-
- return res;
-}
-
-
-// ---------------------------------------------------------------------------
-// init
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlBar::init()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackControlBar::init()"));
-
- mController = new QMPXVideoPlaybackControlsController();
- mControlBar = new QMPXVideoPlaybackControlBar( mController );
-
- mControlBar->initialize();
-}
-
-// ---------------------------------------------------------------------------
-// cleanup
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlBar::cleanup()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackControlBar::cleanup()"));
-
- if ( mController )
- {
- delete mController;
- mController = NULL;
- }
-
- if ( mControlBar )
- {
- delete mControlBar;
- mControlBar = NULL;
- }
-}
-
-// ---------------------------------------------------------------------------
-// testupdateState
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlBar::testupdateState()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackControlBar::testupdateState()"));
-
- init();
-
- TMPXPlaybackState state = EPbStatePlaying;
- mControlBar->updateState( state );
- QVERIFY( mControlBar->mToolBar->mState == EPbStatePlaying );
-
- state = EPbStatePaused;
- mControlBar->updateState( state );
- QVERIFY( mControlBar->mToolBar->mState == EPbStatePaused );
-
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
-// testaspectRatioChanged
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlBar::testaspectRatioChanged()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackControlBar::testaspectRatioChanged()"));
-
- init();
-
- int aspectRatio = 1;
- mControlBar->aspectRatioChanged( aspectRatio );
- QVERIFY( mControlBar->mToolBar->mAspectRatio == aspectRatio );
-
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
-// testUpdateWithFileDetails
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlBar::testUpdateWithFileDetails()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackControlBar::testUpdateWithFileDetails()"));
-
- init();
-
- QMPXVideoPlaybackViewFileDetails *details = mController->fileDetails();
- details->mSeekable = false;
- details->mVideoEnabled = true;
-
- mControlBar->updateWithFileDetails( details );
-
- QVERIFY( mControlBar->mToolBar->mFileDetails->mSeekable == details->mSeekable );
- QVERIFY( mControlBar->mProgressBar->mFileDetails->mVideoEnabled == details->mVideoEnabled );
-
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
-// testSetVisibleToControlBar
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlBar::testSetVisibleToControlBar()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackControlBar::testSetVisibleToControlBar()"));
-
- init();
-
- //
- // Make visible
- //
- mControlBar->setVisible( false );
- mControlBar->setVisibleToControlBar( true );
- QVERIFY( mControlBar->isVisible() == true );
-
- //
- // Make invisible
- //
- mControlBar->setVisible( true );
- mControlBar->setVisibleToControlBar( false );
- QVERIFY( mControlBar->isVisible() == false );
-
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
-// testDurationChanged
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlBar::testDurationChanged()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackControlBar::testDurationChanged()"));
-
- init();
-
- int duration = 12345;
- mControlBar->durationChanged( duration );
- QVERIFY( mControlBar->mProgressBar->mDuration == duration );
-
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
-// testPositionChanged
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlBar::testPositionChanged()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackControlBar::testPositionChanged()"));
-
- init();
-
- int position = 54321;
- mControlBar->positionChanged( position );
- QVERIFY( mControlBar->mProgressBar->mPosition == position );
-
- cleanup();
-}
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/inc/mpxvideoplaybackcontrolscontroller.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,139 +0,0 @@
-/*
-* 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 MPXVideoPlaybackControlsController
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_
-#define MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_
-
-// INCLUDES
-#include <qobject>
-#include <mpxplaybackframeworkdefs.h>
-
-#include "mpxvideo_debug.h"
-#include "mpxcommonvideoplaybackview.hrh"
-#include "mpxvideoplaybackviewfiledetails.h"
-
-// FORWARD DECLARATIONS
-class QMPXVideoPlaybackControlsController ;
-
-// DATA TYPES
-
-enum TMPXTimerAction
-{
- EMPXTimerCancel,
- EMPXTimerReset
-};
-
-enum TPlaybackViewMode
-{
- EFullScreenView,
- EDetailsView,
- EAudioOnlyView
-};
-
-// CLASS DECLARATION
-
-class QMPXVideoPlaybackControlsController : public QObject
-{
- Q_OBJECT
-
- public:
-
- /**
- * constructor.
- */
- QMPXVideoPlaybackControlsController();
-
- /**
- * Destructor.
- */
- virtual ~QMPXVideoPlaybackControlsController();
-
- public:
-
- /**
- * Command handling function.
- * Call HandleCommandL() of container
- */
- void handleCommand( TMPXVideoPlaybackViewCommandIds command, int value = 0 );
-
- /**
- * Reset or cancel timers for the controls
- */
- void resetDisappearingTimers( TMPXTimerAction timerAction );
-
- /**
- * Return state
- */
- inline TMPXPlaybackState state();
-
- /**
- * Return file details
- */
- inline QMPXVideoPlaybackViewFileDetails* fileDetails();
-
- TPlaybackViewMode viewMode();
-
- void changeViewMode( TPlaybackViewMode viewMode, bool transitionEffect = true );
-
- public:
- QMPXVideoPlaybackViewFileDetails *mFileDetails;
-
- TMPXPlaybackState mState;
- TPlaybackViewMode mViewMode;
- TMPXTimerAction mTimerAction;
- TMPXVideoPlaybackViewCommandIds mCommand;
- int mCommandValue;
-};
-
-// INLINE METHODS
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::state
-// -------------------------------------------------------------------------------------------------
-//
-inline
-TMPXPlaybackState QMPXVideoPlaybackControlsController::state()
-{
- return mState;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::fileDetails
-// -------------------------------------------------------------------------------------------------
-//
-inline
-QMPXVideoPlaybackViewFileDetails* QMPXVideoPlaybackControlsController::fileDetails()
-{
- return mFileDetails;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::viewMode
-// -------------------------------------------------------------------------------------------------
-//
-inline
-TPlaybackViewMode QMPXVideoPlaybackControlsController::viewMode()
-{
- return mViewMode;
-}
-
-#endif /*MPXVIDEOPLAYBACKCONTROLSCONTROLLER_P_H_*/
-
-// End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/inc/mpxvideoplaybackprogressbar.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackProgressBar
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKPROGRESSBAR_H_
-#define MPXVIDEOPLAYBACKPROGRESSBAR_H_
-
-#include <hbwidget.h>
-#include <mpxplaybackframeworkdefs.h>
-
-class QMPXVideoPlaybackViewFileDetails;
-class QMPXVideoPlaybackControlsController;
-
-class QMPXVideoPlaybackProgressBar : public HbWidget
-{
- Q_OBJECT
-
- public:
- QMPXVideoPlaybackProgressBar( QMPXVideoPlaybackControlsController* controller );
- virtual ~QMPXVideoPlaybackProgressBar();
- void initialize();
- void updateWithFileDetails( QMPXVideoPlaybackViewFileDetails* details );
- void updateState( TMPXPlaybackState state );
-
- public:
- void durationChanged( int duration );
- void positionChanged( int position );
-
- public:
- QMPXVideoPlaybackControlsController *mController;
- QMPXVideoPlaybackViewFileDetails *mFileDetails;
- TMPXPlaybackState mState;
- int mDuration;
- int mPosition;
-};
-
-#endif /*MPXVIDEOPLAYBACKPROGRESSBAR_H_*/
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/inc/mpxvideoplaybacktoolbar.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackToolBar
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKTOOLBAR_H_
-#define MPXVIDEOPLAYBACKTOOLBAR_H_
-
-#include <QWidget>
-#include <mpxplaybackframeworkdefs.h>
-
-
-
-class QMPXVideoPlaybackViewFileDetails;
-class QMPXVideoPlaybackControlsController;
-
-
-class QMPXVideoPlaybackToolBar : public QWidget
-{
- Q_OBJECT
-
- public:
- QMPXVideoPlaybackToolBar( QMPXVideoPlaybackControlsController* controller );
- virtual ~QMPXVideoPlaybackToolBar();
- void updateState( TMPXPlaybackState state );
- void aspectRatioChanged( int aspectRatio );
- void initialize();
- void updateWithFileDetails( QMPXVideoPlaybackViewFileDetails* details );
- void durationChanged( int duration );
- void positionChanged( int position );
- void setVisible( bool visible );
-
- public:
- QMPXVideoPlaybackControlsController *mController;
- QMPXVideoPlaybackViewFileDetails *mFileDetails;
- int mAspectRatio;
- int mPosition;
- int mDuration;
- bool mVisible;
- TMPXPlaybackState mState;
-};
-
-#endif /*MPXVIDEOPLAYBACKTOOLBAR_H_*/
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/inc/mpxvideoplaybackviewfiledetails.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
-* 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: MPX Video File Details (QT)
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-
-#ifndef __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-#define __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-
-#include <qobject.h>
-#include "mpxhelixplaybackplugindefs.h"
-
-
-//
-// CLASS DECLARATION
-//
-class QMPXVideoPlaybackViewFileDetails : public QObject
-{
- public:
- //
- // Constructor
- //
- QMPXVideoPlaybackViewFileDetails();
-
- //
- // Destructor.
- //
- virtual ~QMPXVideoPlaybackViewFileDetails();
-
- //
- // Clear all file details
- //
- void clearFileDetails();
-
- public:
- //
- // Data
- //
- QString mClipName;
- QString mTitle;
- QString mArtist;
- QString mMimeType;
- QString mDescription;
- QString mLocation;
- QString mCopyright;
- QString mLanguage;
- QString mKeywords;
-
- TMPXVideoMode mPlaybackMode;
- bool mSeekable;
- bool mPausableStream;
- bool mAudioEnabled;
- bool mVideoEnabled;
- bool mPartialPlayback;
- bool mRNFormat;
- bool mTvOutConnected;
- bool mDrmProtected;
- bool mMultiItemPlaylist;
-
- int mVideoHeight;
- int mVideoWidth;
- int mBitRate;
- int mDuration;
-};
-
-#endif // __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/src/mpxvideoplaybackcontrolscontroller.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-/*
-* 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 MPXVideoPlaybackControlsController
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-// INCLUDE FILES
-
-
-#include "mpxvideoplaybackcontrolscontroller.h"
-
-// ================= MEMBER FUNCTIONS ==============================================================
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController()
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController()
- : mViewMode( EFullScreenView )
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController()"));
-
- mFileDetails = new QMPXVideoPlaybackViewFileDetails();
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::handleCommand()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::handleCommand(
- TMPXVideoPlaybackViewCommandIds command, int value )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::handleCommand(%d)"), command);
-
- mCommand = command;
- mCommandValue = value;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::changeViewMode
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::changeViewMode(
- TPlaybackViewMode viewMode, bool transitionEffect )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::changeViewMode()"));
-
- Q_UNUSED( transitionEffect );
- mViewMode = viewMode;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::resetDisappearingTimers()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::resetDisappearingTimers( TMPXTimerAction timerAction )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::resetDisappearingTimers()"));
-
- mTimerAction = timerAction;
-}
-
-// End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/src/mpxvideoplaybackprogressbar.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackProgressBar
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackprogressbar.h"
-#include "mpxvideoplaybackcontrolscontroller.h"
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackProgressBar::QMPXVideoPlaybackProgressBar
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackProgressBar::QMPXVideoPlaybackProgressBar(
- QMPXVideoPlaybackControlsController* controller )
- : mController( controller )
- , mDuration( -1 )
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackProgressBar::QMPXVideoPlaybackProgressBar()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackProgressBar::~QMPXVideoPlaybackProgressBar
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackProgressBar::~QMPXVideoPlaybackProgressBar()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackProgressBar::~QMPXVideoPlaybackProgressBar()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackProgressBar::initialize
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackProgressBar::initialize()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackProgressBar::initialize()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackProgressBar::durationChanged
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackProgressBar::durationChanged( int duration )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::durationChanged duration = %d"), duration );
-
- mDuration = duration;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackProgressBar::positionChanged
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackProgressBar::positionChanged( int position )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::positionChanged position = %d"), position );
-
- mPosition = position;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackProgressBar::updateWithFileDetails()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackProgressBar::updateWithFileDetails(
- QMPXVideoPlaybackViewFileDetails* details )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackProgressBar::updateControlsWithFileDetails()"));
-
- mFileDetails = details;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackProgressBar::updateState()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackProgressBar::updateState( TMPXPlaybackState state )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackProgressBar::updateState() state = %d"), state );
-
- mState = state;
-}
-
-//End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/src/mpxvideoplaybacktoolbar.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,126 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackToolBar
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#include <hbpushbutton.h>
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybacktoolbar.h"
-#include "mpxvideoplaybackviewfiledetails.h"
-#include "mpxcommonvideoplaybackview.hrh"
-
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackToolBar::QMPXVideoPlaybackToolBar()
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackToolBar::QMPXVideoPlaybackToolBar(
- QMPXVideoPlaybackControlsController* controller )
- : mController( controller )
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackToolBar::QMPXVideoPlaybackToolBar"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackToolBar::~QMPXVideoPlaybackToolBar()
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackToolBar::~QMPXVideoPlaybackToolBar()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackToolBar::~QMPXVideoPlaybackToolBar()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackToolBar::initialize()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackToolBar::initialize()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackToolBar::initialize()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackToolBar::updateState()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackToolBar::updateState( TMPXPlaybackState state )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackToolBar::updateState() state = %d"), state );
-
- mState = state;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackToolBar::aspectRatioChanged()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackToolBar::aspectRatioChanged( int aspectRatio )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackToolBar::aspectRatioChanged() aspectRatio = %d"), aspectRatio );
-
- mAspectRatio = aspectRatio;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackToolBar::updateWithFileDetails()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackToolBar::updateWithFileDetails(
- QMPXVideoPlaybackViewFileDetails* details )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackToolBar::updateWithFileDetails()"));
-
- mFileDetails = details;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackToolBar::durationChanged
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackToolBar::durationChanged( int duration )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackToolBar::durationChanged duration = %d"), duration );
-
- mDuration = duration;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackToolBar::positionChanged
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackToolBar::positionChanged( int position )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackToolBar::positionChanged position = %d"), position );
-
- mPosition = position;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackToolBar::setVisible
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackToolBar::setVisible( bool visible )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackToolBar::setVisible position = %d"), visible );
-
- mVisible = visible;
-}
-
-//End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/src/mpxvideoplaybackviewfiledetails.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
-* 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: class for MPX Video File Details (Qt)
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-//
-// INCLUDE FILES
-//
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackviewfiledetails.h"
-
-
-// ============================ MEMBER FUNCTIONS ===================================================
-
-QMPXVideoPlaybackViewFileDetails::QMPXVideoPlaybackViewFileDetails()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::QMPXVideoPlaybackViewFileDetails()"));
-
- clearFileDetails();
-}
-
-QMPXVideoPlaybackViewFileDetails::~QMPXVideoPlaybackViewFileDetails()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::~QMPXVideoPlaybackViewFileDetails()"));
-
- clearFileDetails();
-}
-
-void
-QMPXVideoPlaybackViewFileDetails::clearFileDetails()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::ClearFileDetails()"));
-
- mMimeType = tr("");
- mTitle = tr("");
- mArtist = tr("");
- mClipName = tr("");
- mDescription = tr("");
- mLocation = tr("");
- mCopyright = tr("");
- mLanguage = tr("");
- mKeywords = tr("");
-
- mPlaybackMode = EMPXVideoLocal;
- mSeekable = false;
- mPausableStream = false;
- mAudioEnabled = false;
- mVideoEnabled = false;
- mPartialPlayback = false;
- mRNFormat = false;
-
- mDuration = 0;
- mTvOutConnected = false;
- mDrmProtected = false;
-
- mVideoHeight = 0;
- mVideoWidth = 0;
- mBitRate = 0;
-}
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/testmpxvideoplaybackcontrolbar.pro Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-#
-# 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: Project file for building testmpxvideoplaybackcontrolbar
-#
-#
-# Version : %version: 4 %
-
-TEMPLATE = app
-TARGET = testmpxvideoplaybackcontrolbar
-CONFIG += qtestlib qt hb
-
-INCLUDEPATH += stub/inc \
- ../../../../inc \
- ../../../inc
-
-
-DEPENDPATH += inc src stub/inc stub/src
-
-# Input
-HEADERS += testmpxvideoplaybackcontrolbar.h \
- mpxvideoplaybackcontrolscontroller.h \
- mpxvideoplaybackviewfiledetails.h \
- mpxvideoplaybackprogressbar.h \
- mpxvideoplaybacktoolbar.h \
- ../../controlinc/mpxvideoplaybackcontrolbar.h
-
-SOURCES += testmpxvideoplaybackcontrolbar.cpp \
- mpxvideoplaybackcontrolscontroller.cpp \
- mpxvideoplaybackviewfiledetails.cpp \
- mpxvideoplaybackprogressbar.cpp \
- mpxvideoplaybacktoolbar.cpp \
- ../../controlsrc/mpxvideoplaybackcontrolbar.cpp
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolpolicy/inc/testmpxvideoplaybackcontrolpolicy.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-/**
-* 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: tester for methods in TestMPXVideoPlaybackControlPolicy
-*
-*/
-
-// Version : %version: 1 %
-
-#ifndef __TESTMPXVIDEOPLAYBACKCONTROLPOLICY_H__
-#define __TESTMPXVIDEOPLAYBACKCONTROLPOLICY_H__
-
-
-// INCLUDES
-#include <QtTest/QtTest>
-
-class QMPXVideoPlaybackControlPolicy;
-class QMPXVideoPlaybackViewFileDetails;
-
-class TestMPXVideoPlaybackControlPolicy : public QObject
-{
- Q_OBJECT
-
-public:
-
- /**
- * will be called before each testfunction is executed.
- *
- */
- void init();
-
- /**
- * will be called after every testfunction.
- *
- */
- void cleanup();
-
- // test functions for the test framework
-private slots:
-
- // the order in which these testXX methods are declared is important
- // changing this order will affect the test results
- void testBufferingAnimationPolicy();
- void testStatusPanePolicy();
- void testControlBarPolicy();
- void testDetailsWidgetPolicy();
-
-signals:
- void commandSignal();
-
-private:
- QMPXVideoPlaybackControlPolicy* mPolicy;
- QMPXVideoPlaybackViewFileDetails* mDetails;
-};
-
-
-#endif // __TESTMPXVIDEOPLAYBACKCONTROLPOLICY_H__
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolpolicy/src/testmpxvideoplaybackcontrolpolicy.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,183 +0,0 @@
-/**
-* 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: tester for methods in TestMPXVideoPlaybackControlPolicy
-*
-*/
-
-// Version : %version: 4 %
-
-
-#include <qdebug>
-
-#include <hbmainwindow.h>
-#include <hbapplication.h>
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackviewfiledetails.h"
-#include "testmpxvideoplaybackcontrolpolicy.h"
-
-#define private public
-#include "mpxvideoplaybackcontrolpolicy.h"
-#undef private
-
-// ---------------------------------------------------------------------------
-// main
-// ---------------------------------------------------------------------------
-//
-int main(int argc, char *argv[])
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackControlPolicy::Main()"));
-
- HbApplication app(argc, argv);
- HbMainWindow window;
-
- TestMPXVideoPlaybackControlPolicy tv;
-
- char *pass[3];
- pass[0] = argv[0];
- pass[1] = "-o";
- pass[2] = "c:\\data\\testmpxvideoplaybackcontrolpolicy.txt";
-
- int res = QTest::qExec(&tv, 3, pass);
-
- return res;
-}
-
-
-// ---------------------------------------------------------------------------
-// init
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlPolicy::init()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackControlPolicy::init()"));
-
- mPolicy = new QMPXVideoPlaybackControlPolicy();
- mDetails = new QMPXVideoPlaybackViewFileDetails();
-}
-
-// ---------------------------------------------------------------------------
-// cleanup
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlPolicy::cleanup()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackControlPolicy::cleanup()"));
-
- if ( mPolicy )
- {
- delete mPolicy;
- mPolicy = NULL;
- }
-
- if ( mDetails )
- {
- delete mDetails;
- mDetails = NULL;
- }
-}
-
-// ---------------------------------------------------------------------------
-// testBufferingAnimationPolicy
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlPolicy::testBufferingAnimationPolicy()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackControlPolicy::testBufferingAnimationPolicy()"));
-
- init();
-
- TUint properties = 0;
-
- mPolicy->setControlProperties( EMPXBufferingAnimation, properties, mDetails, EFullScreenView );
-
- QVERIFY( properties == ( EMPXShownWhenInitializing | EMPXShownWhenBuffering ) );
-
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
-// testStatusPanePolicy
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlPolicy::testStatusPanePolicy()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackControlPolicy::testStatusPanePolicy()"));
-
- init();
-
- TUint properties = 0;
-
- mDetails->mPlaybackMode = EMPXVideoStreaming;
- mPolicy->setControlProperties( EMPXStatusPane, properties, mDetails, EDetailsView );
- QVERIFY( properties == EMPXAllProperties );
-
- mDetails->mPlaybackMode = EMPXVideoLocal;
- mPolicy->setControlProperties( EMPXStatusPane, properties, mDetails, EFullScreenView );
- QVERIFY( properties ==
- ( EMPXShownWhenPlaying | EMPXShownWhenPaused | EMPXShownWhenSeeking | EMPXShownWhenBuffering) );
-
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
-// testControlBarPolicy
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlPolicy::testControlBarPolicy()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackControlPolicy::testControlBarPolicy()"));
-
- init();
-
- TUint properties = 0;
-
- mPolicy->setControlProperties( EMPXControlBar, properties, mDetails, EDetailsView );
- QVERIFY( properties == 0 );
-
- mPolicy->setControlProperties( EMPXControlBar, properties, mDetails, EAudioOnlyView );
- QVERIFY( properties == EMPXAllProperties );
-
- mDetails->mPlaybackMode = EMPXVideoLocal;
- mPolicy->setControlProperties( EMPXControlBar, properties, mDetails, EFullScreenView );
- QVERIFY( properties ==
- ( EMPXShownWhenPlaying | EMPXShownWhenPaused | EMPXShownWhenSeeking | EMPXShownWhenBuffering ) );
-
- mDetails->mPlaybackMode = EMPXVideoStreaming;
- mPolicy->setControlProperties( EMPXControlBar, properties, mDetails, EFullScreenView );
- QVERIFY( properties ==
- ( EMPXShownWhenPlaying | EMPXShownWhenPaused | EMPXShownWhenSeeking ) );
-
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
-// testDetailsWidgetPolicy
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlPolicy::testDetailsWidgetPolicy()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackControlPolicy::testDetailsWidgetPolicy()"));
-
- init();
-
- TUint properties = 0;
-
- mPolicy->setControlProperties( EMPXFileDetailsWidget, properties, mDetails, EAudioOnlyView );
- QVERIFY( properties == EMPXAllProperties );
-
- cleanup();
-}
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolpolicy/stub/inc/mpxvideoplaybackcontrolscontroller.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,124 +0,0 @@
-/*
-* 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 MPXVideoPlaybackControlsController
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_
-#define MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_
-
-// INCLUDES
-#include <qobject>
-#include <mpxplaybackframeworkdefs.h>
-
-#include "mpxvideo_debug.h"
-#include "mpxcommonvideoplaybackview.hrh"
-
-
-// FORWARD DECLARATIONS
-
-
-// DATA TYPES
-
-enum TMPXTimerAction
-{
- EMPXTimerCancel,
- EMPXTimerReset
-};
-
-enum TPlaybackViewMode
-{
- EFullScreenView,
- EDetailsView,
- EAudioOnlyView
-};
-
-const int KMPXControlsTimeOut = 4000;
-
-// CLASS DECLARATION
-
-class QMPXVideoPlaybackControlsController : public QObject
-{
- Q_OBJECT
-
- public:
-
- /**
- * constructor.
- */
- QMPXVideoPlaybackControlsController();
-
- /**
- * Destructor.
- */
- virtual ~QMPXVideoPlaybackControlsController();
-
- public:
-
- /**
- * Command handling function.
- * Call HandleCommandL() of container
- */
- void handleCommand( TMPXVideoPlaybackViewCommandIds command, int value = 0 );
-
- /**
- * Reset or cancel timers for the controls
- */
- void resetDisappearingTimers( TMPXTimerAction timerAction );
-
- /**
- * Return state
- */
- inline TMPXPlaybackState state();
-
- TPlaybackViewMode viewMode();
-
- void changeViewMode( TPlaybackViewMode viewMode, bool transitionEffect = true );
-
- public:
- TMPXPlaybackState mState;
- TPlaybackViewMode mViewMode;
- TMPXTimerAction mTimerAction;
- TMPXVideoPlaybackViewCommandIds mCommand;
- int mCommandValue;
-};
-
-// INLINE METHODS
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::state
-// -------------------------------------------------------------------------------------------------
-//
-inline
-TMPXPlaybackState QMPXVideoPlaybackControlsController::state()
-{
- return mState;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::viewMode
-// -------------------------------------------------------------------------------------------------
-//
-inline
-TPlaybackViewMode QMPXVideoPlaybackControlsController::viewMode()
-{
- return mViewMode;
-}
-
-#endif /*MPXVIDEOPLAYBACKCONTROLSCONTROLLER_P_H_*/
-
-// End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolpolicy/stub/inc/mpxvideoplaybackviewfiledetails.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
-* 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: MPX Video File Details (QT)
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-
-#ifndef __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-#define __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-
-#include <qobject.h>
-#include "mpxhelixplaybackplugindefs.h"
-
-
-//
-// CLASS DECLARATION
-//
-class QMPXVideoPlaybackViewFileDetails : public QObject
-{
- public:
- //
- // Constructor
- //
- QMPXVideoPlaybackViewFileDetails();
-
- //
- // Destructor.
- //
- virtual ~QMPXVideoPlaybackViewFileDetails();
-
- //
- // Clear all file details
- //
- void clearFileDetails();
-
- public:
- //
- // Data
- //
- QString mClipName;
- QString mTitle;
- QString mArtist;
- QString mMimeType;
- QString mDescription;
- QString mLocation;
- QString mCopyright;
- QString mLanguage;
- QString mKeywords;
-
- TMPXVideoMode mPlaybackMode;
- bool mSeekable;
- bool mPausableStream;
- bool mAudioEnabled;
- bool mVideoEnabled;
- bool mPartialPlayback;
- bool mRNFormat;
- bool mTvOutConnected;
- bool mDrmProtected;
- bool mMultiItemPlaylist;
-
- int mVideoHeight;
- int mVideoWidth;
- int mBitRate;
- int mDuration;
-};
-
-#endif // __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolpolicy/stub/src/mpxvideoplaybackviewfiledetails.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
-* 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: class for MPX Video File Details (Qt)
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-//
-// INCLUDE FILES
-//
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackviewfiledetails.h"
-
-
-// ============================ MEMBER FUNCTIONS ===================================================
-
-QMPXVideoPlaybackViewFileDetails::QMPXVideoPlaybackViewFileDetails()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::QMPXVideoPlaybackViewFileDetails()"));
-
- clearFileDetails();
-}
-
-QMPXVideoPlaybackViewFileDetails::~QMPXVideoPlaybackViewFileDetails()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::~QMPXVideoPlaybackViewFileDetails()"));
-
- clearFileDetails();
-}
-
-void
-QMPXVideoPlaybackViewFileDetails::clearFileDetails()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::ClearFileDetails()"));
-
- mMimeType = tr("");
- mTitle = tr("");
- mArtist = tr("");
- mClipName = tr("");
- mDescription = tr("");
- mLocation = tr("");
- mCopyright = tr("");
- mLanguage = tr("");
- mKeywords = tr("");
-
- mPlaybackMode = EMPXVideoLocal;
- mSeekable = false;
- mPausableStream = false;
- mAudioEnabled = false;
- mVideoEnabled = false;
- mPartialPlayback = false;
- mRNFormat = false;
-
- mDuration = 0;
- mTvOutConnected = false;
- mDrmProtected = false;
-
- mVideoHeight = 0;
- mVideoWidth = 0;
- mBitRate = 0;
-}
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolpolicy/testmpxvideoplaybackcontrolpolicy.pro Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-#
-# 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: Project file for building testmpxvideoplaybackcontrolpolicy
-#
-#
-# Version : %version: 1 %
-
-TEMPLATE = app
-TARGET = testmpxvideoplaybackcontrolpolicy
-CONFIG += qtestlib qt hb
-
-INCLUDEPATH += stub/inc \
- ../../../../inc \
- ../../../inc
-
-
-DEPENDPATH += inc src stub/inc stub/src
-
-# Input
-HEADERS += testmpxvideoplaybackcontrolpolicy.h \
- mpxvideoplaybackviewfiledetails.h \
- ../../controlinc/mpxvideoplaybackcontrolpolicy.h
-
-SOURCES += testmpxvideoplaybackcontrolpolicy.cpp \
- mpxvideoplaybackviewfiledetails.cpp \
- ../../controlsrc/mpxvideoplaybackcontrolpolicy.cpp
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdocumentloader/inc/testmpxvideoplaybackdocumentloader.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/**
-* 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: tester for methods in TestMPXVideoPlaybackDocumentLoader
-*
-*/
-
-// Version : %version: 1 %
-
-#ifndef __TESTMPXVIDEOPLAYBACKDOCUMENTLOADER_H__
-#define __TESTMPXVIDEOPLAYBACKDOCUMENTLOADER_H__
-
-
-// INCLUDES
-#include <QtTest/QtTest>
-
-class QMPXVideoPlaybackDocumentLoader;
-class QMPXVideoPlaybackControlsController;
-
-class TestMPXVideoPlaybackDocumentLoader : public QObject
-{
- Q_OBJECT
-
-public:
-
- /**
- * will be called before each testfunction is executed.
- *
- */
- void init();
-
- /**
- * will be called after every testfunction.
- *
- */
- void cleanup();
-
- // test functions for the test framework
-private slots:
-
- // the order in which these testXX methods are declared is important
- // changing this order will affect the test results
- void testCreateObject();
-
-signals:
- void commandSignal();
-
-private:
- QMPXVideoPlaybackDocumentLoader* mLoader;
- QMPXVideoPlaybackControlsController* mController;
-};
-
-
-#endif // __TESTMPXVIDEOPLAYBACKDOCUMENTLOADER_H__
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdocumentloader/src/testmpxvideoplaybackdocumentloader.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +0,0 @@
-/**
-* 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: tester for methods in TestMPXVideoPlaybackDocumentLoader
-*
-*/
-
-// Version : %version: 6 %
-
-
-#include <qdebug>
-#include <qobject>
-
-#include <hbmainwindow.h>
-#include <hbapplication.h>
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackcontrolscontroller.h"
-#include "testmpxvideoplaybackdocumentloader.h"
-
-#define private public
-#include "mpxvideoplaybackdocumentloader.h"
-#undef private
-
-// ---------------------------------------------------------------------------
-// main
-// ---------------------------------------------------------------------------
-//
-int main(int argc, char *argv[])
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackDocumentLoader::Main()"));
-
- HbApplication app(argc, argv);
- HbMainWindow window;
-
- TestMPXVideoPlaybackDocumentLoader tv;
-
- char *pass[3];
- pass[0] = argv[0];
- pass[1] = "-o";
- pass[2] = "c:\\data\\testmpxvideoplaybackdocumentloader.txt";
-
- int res = QTest::qExec(&tv, 3, pass);
-
- return res;
-}
-
-
-// ---------------------------------------------------------------------------
-// init
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackDocumentLoader::init()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackDocumentLoader::init()"));
-
- mController = new QMPXVideoPlaybackControlsController();
- mLoader = new QMPXVideoPlaybackDocumentLoader( mController );
-}
-
-// ---------------------------------------------------------------------------
-// cleanup
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackDocumentLoader::cleanup()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackDocumentLoader::cleanup()"));
-
- if ( mLoader )
- {
- delete mLoader;
- mLoader = NULL;
- }
-
- if ( mController )
- {
- delete mController;
- mController = NULL;
- }
-}
-
-// ---------------------------------------------------------------------------
-// testCreateObject
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackDocumentLoader::testCreateObject()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackDocumentLoader::testCreateObject()"));
-
- init();
-
- QObject *object = mLoader->createObject( "", "controlBarLayout" );
- QVERIFY( object->objectName() == "controlBarLayout" );
-
- object = mLoader->createObject( "", "fileDetailsLayout" );
- QVERIFY( object->objectName() == "fileDetailsLayout" );
-
- object = mLoader->createObject( "", "detailsPlaybackWindow" );
- QVERIFY( object->objectName() == "detailsPlaybackWindow" );
-
- cleanup();
-}
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdocumentloader/stub/inc/mpxvideoplaybackcontrolbar.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackControlBar
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKCONTROLBAR_H_
-#define MPXVIDEOPLAYBACKCONTROLBAR_H_
-
-
-
-#include <hbwidget.h>
-#include <mpxplaybackframeworkdefs.h>
-
-class QMPXVideoPlaybackViewFileDetails;
-class QMPXVideoPlaybackControlsController;
-
-class QMPXVideoPlaybackControlBar : public HbWidget
-{
- Q_OBJECT
-
- public:
- QMPXVideoPlaybackControlBar( QMPXVideoPlaybackControlsController* controller );
- virtual ~QMPXVideoPlaybackControlBar();
- void updateState( TMPXPlaybackState state );
- void aspectRatioChanged( int aspectRatio );
- void updateWithFileDetails( QMPXVideoPlaybackViewFileDetails* details );
- void setVisibility( bool visible );
- void durationChanged( int duration );
- void positionChanged( int position );
-
- public:
- QMPXVideoPlaybackControlsController *mController;
- int mPosition;
- int mDuration;
- int mAspectRatio;
- bool mVisibility;
- TMPXPlaybackState mState;
- QMPXVideoPlaybackViewFileDetails *mFileDetails;
-};
-
-#endif /*MPXVIDEOPLAYBACKCONTROLBAR_H_*/
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdocumentloader/stub/inc/mpxvideoplaybackcontrolscontroller.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,124 +0,0 @@
-/*
-* 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 MPXVideoPlaybackControlsController
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_
-#define MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_
-
-// INCLUDES
-#include <qobject>
-#include <mpxplaybackframeworkdefs.h>
-
-#include "mpxvideo_debug.h"
-#include "mpxhelixplaybackplugindefs.h"
-#include "mpxcommonvideoplaybackview.hrh"
-
-// FORWARD DECLARATIONS
-
-// DATA TYPES
-
-enum TMPXTimerAction
-{
- EMPXTimerCancel,
- EMPXTimerReset
-};
-
-enum TPlaybackViewMode
-{
- EFullScreenView,
- EDetailsView,
- EAudioOnlyView
-};
-
-const QString KMPXPLAYBACKVIEW_XML = ":/hbvideoplaybackview/hbvideoplaybackview.docml";
-
-// CLASS DECLARATION
-
-class QMPXVideoPlaybackControlsController : public QObject
-{
- Q_OBJECT
-
- public:
-
- /**
- * constructor.
- */
- QMPXVideoPlaybackControlsController();
-
- /**
- * Destructor.
- */
- virtual ~QMPXVideoPlaybackControlsController();
-
- public:
-
- /**
- * Command handling function.
- * Call HandleCommandL() of container
- */
- void handleCommand( TMPXVideoPlaybackViewCommandIds command, int value = 0 );
-
- /**
- * Reset or cancel timers for the controls
- */
- void resetDisappearingTimers( TMPXTimerAction timerAction );
-
- /**
- * Return state
- */
- inline TMPXPlaybackState state();
-
- TPlaybackViewMode viewMode();
-
- void changeViewMode( TPlaybackViewMode viewMode, bool transitionEffect = true );
-
- public:
-
- TMPXPlaybackState mState;
- TPlaybackViewMode mViewMode;
- TMPXTimerAction mTimerAction;
- TMPXVideoPlaybackViewCommandIds mCommand;
- int mCommandValue;
-};
-
-// INLINE METHODS
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::state
-// -------------------------------------------------------------------------------------------------
-//
-inline
-TMPXPlaybackState QMPXVideoPlaybackControlsController::state()
-{
- return mState;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::viewMode
-// -------------------------------------------------------------------------------------------------
-//
-inline
-TPlaybackViewMode QMPXVideoPlaybackControlsController::viewMode()
-{
- return mViewMode;
-}
-
-#endif /*MPXVIDEOPLAYBACKCONTROLSCONTROLLER_P_H_*/
-
-// End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdocumentloader/stub/inc/mpxvideoplaybackdetailsplaybackwindow.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackDetailsPlaybackWindow
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKDETAILSPLAYBACKWINDOW_H_
-#define MPXVIDEOPLAYBACKDETAILSPLAYBACKWINDOW_H_
-
-#include <qobject>
-
-class QMPXVideoPlaybackControlsController;
-
-class QMPXVideoPlaybackDetailsPlaybackWindow : public QObject
-{
- Q_OBJECT
-
- public:
- QMPXVideoPlaybackDetailsPlaybackWindow( QMPXVideoPlaybackControlsController* controller );
- virtual ~QMPXVideoPlaybackDetailsPlaybackWindow();
-
- private:
- QMPXVideoPlaybackControlsController *mController;
-};
-
-#endif /*MPXVIDEOPLAYBACKDETAILSPLAYBACKWINDOW_H_*/
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdocumentloader/stub/inc/mpxvideoplaybackfiledetailswidget.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackFileDetailsWidget
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKFILEDETAILSWIDGET_H_
-#define MPXVIDEOPLAYBACKFILEDETAILSWIDGET_H_
-
-#include <qobject>
-
-class QMPXVideoPlaybackControlsController;
-
-
-class QMPXVideoPlaybackFileDetailsWidget : public QObject
-{
- Q_OBJECT
-
- public:
- QMPXVideoPlaybackFileDetailsWidget( QMPXVideoPlaybackControlsController* controller );
- virtual ~QMPXVideoPlaybackFileDetailsWidget();
-
- private:
- QMPXVideoPlaybackControlsController *mController;
-};
-
-#endif /*MPXVIDEOPLAYBACKFILEDETAILSWIDGET_H_*/
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdocumentloader/stub/src/mpxvideoplaybackcontrolbar.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackControlBar
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#include <hbframeitem.h>
-#include <hbframedrawer.h>
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackcontrolbar.h"
-#include "mpxcommonvideoplaybackview.hrh"
-#include "mpxvideoplaybackcontrolscontroller.h"
-
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlBar::QMPXVideoPlaybackControlBar()
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackControlBar::QMPXVideoPlaybackControlBar(
- QMPXVideoPlaybackControlsController* controller )
- : mController( controller )
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlBar::QMPXVideoPlaybackControlBar"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlBar::~QMPXVideoPlaybackControlBar()
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackControlBar::~QMPXVideoPlaybackControlBar()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlBar::~QMPXVideoPlaybackControlBar()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlBar::updateState()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlBar::updateState( TMPXPlaybackState state )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlBar::updateState() state = %d"), state );
-
- mState = state;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlBar::aspectRatioChanged()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlBar::aspectRatioChanged( int aspectRatio )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlBar::aspectRatioChanged() aspectRatio = %d"), aspectRatio );
-
- mAspectRatio = aspectRatio;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlBar::updateWithFileDetails()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlBar::updateWithFileDetails(
- QMPXVideoPlaybackViewFileDetails* details )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlBar::updateWithFileDetails()"));
-
- mFileDetails = details;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlBar::setVisibility()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlBar::setVisibility( bool visible )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlBar::setVisibility()"));
-
- mVisibility = visible;
-}
-
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlBar::durationChanged()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlBar::durationChanged( int duration )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlBar::durationChanged()"));
-
- mDuration = duration;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlBar::positionChanged()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlBar::positionChanged( int position )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlBar::positionChanged()"));
-
- mPosition = position;
-}
-
-//End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdocumentloader/stub/src/mpxvideoplaybackcontrolscontroller.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-/*
-* 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 MPXVideoPlaybackControlsController
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-// INCLUDE FILES
-
-
-#include "mpxvideoplaybackcontrolscontroller.h"
-
-// ================= MEMBER FUNCTIONS ==============================================================
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController()
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController()
- : mViewMode( EFullScreenView )
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::handleCommand()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::handleCommand(
- TMPXVideoPlaybackViewCommandIds command, int value )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::handleCommand(%d)"), command);
-
- mCommand = command;
- mCommandValue = value;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::changeViewMode
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::changeViewMode(
- TPlaybackViewMode viewMode, bool transitionEffect )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::changeViewMode()"));
-
- Q_UNUSED( transitionEffect );
- mViewMode = viewMode;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::resetDisappearingTimers()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::resetDisappearingTimers( TMPXTimerAction timerAction )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::resetDisappearingTimers()"));
-
- mTimerAction = timerAction;
-}
-
-// End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdocumentloader/stub/src/mpxvideoplaybackdetailsplaybackwindow.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackProgressBar
-*
-*/
-
-// Version : %version: 1 %
-
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackcontrolscontroller.h"
-#include "mpxvideoplaybackdetailsplaybackwindow.h"
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDetailsPlaybackWindow::QMPXVideoPlaybackDetailsPlaybackWindow
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackDetailsPlaybackWindow::QMPXVideoPlaybackDetailsPlaybackWindow(
- QMPXVideoPlaybackControlsController* controller )
- : mController( controller )
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackDetailsPlaybackWindow::QMPXVideoPlaybackDetailsPlaybackWindow()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDetailsPlaybackWindow::~QMPXVideoPlaybackDetailsPlaybackWindow
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackDetailsPlaybackWindow::~QMPXVideoPlaybackDetailsPlaybackWindow()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackDetailsPlaybackWindow::~QMPXVideoPlaybackDetailsPlaybackWindow()"));
-}
-
-//End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdocumentloader/stub/src/mpxvideoplaybackfiledetailswidget.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackFileDetailsWidget
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackfiledetailswidget.h"
-#include "mpxvideoplaybackcontrolscontroller.h"
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFileDetailsWidget::QMPXVideoPlaybackFileDetailsWidget
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackFileDetailsWidget::QMPXVideoPlaybackFileDetailsWidget(
- QMPXVideoPlaybackControlsController* controller )
- : mController( controller )
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackFileDetailsWidget::QMPXVideoPlaybackFileDetailsWidget()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFileDetailsWidget::~QMPXVideoPlaybackFileDetailsWidget
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackFileDetailsWidget::~QMPXVideoPlaybackFileDetailsWidget()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackFileDetailsWidget::~QMPXVideoPlaybackFileDetailsWidget()"));
-
-}
-
-//End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdocumentloader/testmpxvideoplaybackdocumentloader.pro Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-#
-# 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: Project file for building testmpxvideoplaybackdocumentloader
-#
-#
-# Version : %version: 6 %
-
-TEMPLATE = app
-TARGET = testmpxvideoplaybackdocumentloader
-CONFIG += qtestlib qt hb
-
-INCLUDEPATH += stub/inc \
- ../../../../inc \
- ../../../inc
-
-
-DEPENDPATH += inc src stub/inc stub/src
-
-# Input
-HEADERS += testmpxvideoplaybackdocumentloader.h \
- mpxvideoplaybackcontrolscontroller.h \
- mpxvideoplaybackfiledetailswidget.h \
- mpxvideoplaybackdetailsplaybackwindow.h \
- mpxvideoplaybackcontrolbar.h \
- ../../controlinc/mpxvideoplaybackdocumentloader.h
-
-SOURCES += testmpxvideoplaybackdocumentloader.cpp \
- mpxvideoplaybackcontrolscontroller.cpp \
- mpxvideoplaybackfiledetailswidget.cpp \
- mpxvideoplaybackdetailsplaybackwindow.cpp \
- mpxvideoplaybackcontrolbar.cpp \
- ../../controlsrc/mpxvideoplaybackdocumentloader.cpp
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/inc/testmpxvideoplaybackfiledetailswidget.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-/**
-* 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: tester for methods in TestMPXVideoPlaybackFileDetailsWidget
-*
-*/
-
-// Version : %version: 2 %
-
-#ifndef __TESTMPXVIDEOPLAYBACKFILEDETAILSWIDGET_H__
-#define __TESTMPXVIDEOPLAYBACKFILEDETAILSWIDGET_H__
-
-
-// INCLUDES
-#include <QtTest/QtTest>
-
-class QMPXVideoPlaybackFileDetailsWidget;
-class QMPXVideoPlaybackControlsController;
-class QDateTime;
-
-class TestMPXVideoPlaybackFileDetailsWidget : public QObject
-{
- Q_OBJECT
-
-public:
-
- /**
- * will be called before each testfunction is executed.
- *
- */
- void init();
-
- /**
- * will be called after every testfunction.
- *
- */
- void cleanup();
-
- // test functions for the test framework
-private slots:
-
- // the order in which these testXX methods are declared is important
- // changing this order will affect the test results
- void testTitle();
- void testDescription();
- void testDuration();
- void testDate();
- void testLocation();
- void testAuthor();
- void testCopyright();
- void testLanguage();
- void testKeywords();
- void testSize();
- void testResolution();
- void testFormat();
- void testBitrate();
- void testFolder();
-
-private:
- void verifyResult( QString primaryText,
- bool exist,
- QString expectedSecondaryText = "",
- bool needToBeCompared = true );
-
- QString dateTimeStringFormat( QDateTime dateTime );
-
-signals:
- void commandSignal(int);
-
-private:
- QMPXVideoPlaybackFileDetailsWidget* mWidget;
- QMPXVideoPlaybackControlsController* mController;
-};
-
-
-#endif // __TESTMPXVIDEOPLAYBACKFILEDETAILSWIDGET_H__
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/src/testmpxvideoplaybackfiledetailswidget.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,611 +0,0 @@
-/**
-* 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: tester for methods in TestMPXVideoPlaybackFileDetailsWidget
-*
-*/
-
-// Version : %version: 4 %
-
-
-#include <QDateTime>
-#include <QFileInfo>
-
-#include <hbmainwindow.h>
-#include <hbapplication.h>
-#include <hblistwidget.h>
-#include <hblistwidgetitem.h>
-#include <hbextendedlocale.h>
-
-#include "mpxvideoplaybackviewfiledetails.h"
-#include "mpxvideoplaybackcontrolscontroller.h"
-#include "testmpxvideoplaybackfiledetailswidget.h"
-
-#define private public
-#include "mpxvideoplaybackfiledetailswidget.h"
-#undef private
-
-const QString KFILEPATH = "C:\\sample1.wav";
-
-
-// ---------------------------------------------------------------------------
-// main
-// ---------------------------------------------------------------------------
-//
-int main(int argc, char *argv[])
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackFileDetailsWidget::Main()"));
-
- HbApplication app(argc, argv);
- HbMainWindow window;
-
- TestMPXVideoPlaybackFileDetailsWidget tv;
-
- char *pass[3];
- pass[0] = argv[0];
- pass[1] = "-o";
- pass[2] = "c:\\data\\testmpxvideoplaybackfiledetailswidget.txt";
-
- int res = QTest::qExec(&tv, 3, pass);
-
- return res;
-}
-
-
-// ---------------------------------------------------------------------------
-// init
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackFileDetailsWidget::init()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackFileDetailsWidget::init()"));
-
- mController = new QMPXVideoPlaybackControlsController();
- mWidget = new QMPXVideoPlaybackFileDetailsWidget( mController );
-}
-
-// ---------------------------------------------------------------------------
-// cleanup
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackFileDetailsWidget::cleanup()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackFileDetailsWidget::cleanup()"));
-
- if ( mController )
- {
- delete mController;
- mController = NULL;
- }
-
- if ( mWidget )
- {
- delete mWidget;
- mWidget = NULL;
- }
-}
-
-// ---------------------------------------------------------------------------
-// testTitle
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackFileDetailsWidget::testTitle()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackFileDetailsWidget::testTitle()"));
-
- init();
-
- QMPXVideoPlaybackViewFileDetails *details = mController->fileDetails();
-
- //
- // For Audio only view
- //
- mController->mViewMode = EAudioOnlyView;
-
- // If title information is available
- details->mTitle = "Title for Test clip";
- mWidget->updateWithFileDetails( details );
- verifyResult( "Title", true, details->mTitle );
-
- mWidget->mListWidget->clear();
- mWidget->mFileDetailsUpdated = false;
-
- // If title informatio is not available
- details->mTitle = "";
- details->mClipName = KFILEPATH;
-
- mWidget->updateWithFileDetails( details );
- verifyResult( "Title", true, "sample1" );
-
- mWidget->mListWidget->clear();
- mWidget->mFileDetailsUpdated = false;
-
- //
- // For Details view
- //
- mController->mViewMode = EFullScreenView;
-
- mWidget->updateWithFileDetails( details );
-
- verifyResult( "Title", false );
-
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
-// testDescription
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackFileDetailsWidget::testDescription()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackFileDetailsWidget::testDescription()"));
-
- init();
-
- QMPXVideoPlaybackViewFileDetails *details = mController->fileDetails();
- details->mDescription = "This is for unit test";
-
- mWidget->updateWithFileDetails( details );
-
- verifyResult( "Description", true, details->mDescription );
-
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
-// testDate
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackFileDetailsWidget::testDuration()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackFileDetailsWidget::testDuration()"));
-
- init();
-
- QMPXVideoPlaybackViewFileDetails *details = mController->fileDetails();
-
- //
- // If it's local mode, need to show the duration
- //
- details->mPlaybackMode = EMPXVideoLocal;
- details->mDuration = 3700000;
-
- mWidget->updateWithFileDetails( details );
-
- verifyResult( "Duration", true, "1 hr 1 min 40 sec" );
-
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
-// testDate
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackFileDetailsWidget::testDate()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackFileDetailsWidget::testDate()"));
-
- init();
-
- QMPXVideoPlaybackViewFileDetails *details = mController->fileDetails();
-
- QDateTime dateTime;
- QString created("");
- QString modified("");
- details->mClipName = KFILEPATH;
- QFileInfo fileInfo( details->mClipName );
-
- //
- // If it is streaming case, we don't show size information
- //
- details->mPlaybackMode = EMPXVideoStreaming;
- mWidget->updateWithFileDetails( details );
-
- //
- // verify results for streaming clip
- //
- verifyResult( "Date", false );
- verifyResult( "Modified", false );
-
- //
- // clear the widget list
- //
- mWidget->mListWidget->clear();
- mWidget->mFileDetailsUpdated = false;
-
- //
- // local clip, with no date/time metadata
- //
- details->mPlaybackMode = EMPXVideoLocal;
- mWidget->updateWithFileDetails( details );
-
- //
- // compare and verify 'Date' for non-metadata local clip
- //
- dateTime = fileInfo.created();
- created = dateTimeStringFormat( dateTime );
- verifyResult( "Date", true, created, true );
-
- //
- // compare and verify 'Modified' for non-metadata local clip
- //
- dateTime = fileInfo.lastModified();
- modified = dateTimeStringFormat( dateTime );
- verifyResult( "Modified", true, modified, true );
-
- //
- // clear the widget list
- //
- mWidget->mListWidget->clear();
- mWidget->mFileDetailsUpdated = false;
-
- //
- // local clip, with date/time metadata
- //
- details->mPlaybackMode = EMPXVideoLocal;
- details->mCreationTime = 1242367251; // POSIX creation time
- details->mModificationTime = 1270773249; // POSIX modification time
- mWidget->updateWithFileDetails( details );
-
- //
- // compare and verify 'Date' for metadata local clip
- //
- dateTime.setTime_t( details->mCreationTime );
- created = dateTimeStringFormat( dateTime );
- verifyResult( "Date", true, created, true );
-
- //
- // compare and verify 'Modified' for metadata local clip
- //
- dateTime.setTime_t( details->mModificationTime );
- modified = dateTimeStringFormat( dateTime );
- verifyResult( "Modified", true, modified, true );
-
- //
- // clean up
- //
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
-// testLocation
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackFileDetailsWidget::testLocation()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackFileDetailsWidget::testLocation()"));
-
- init();
-
- QMPXVideoPlaybackViewFileDetails *details = mController->fileDetails();
- details->mLocation = "C:\\data\\Videos\\";
-
- mWidget->updateWithFileDetails( details );
-
- verifyResult( "Location", true, details->mLocation );
-
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
-// testAuthor
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackFileDetailsWidget::testAuthor()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackFileDetailsWidget::testAuthor()"));
-
- init();
-
- QMPXVideoPlaybackViewFileDetails *details = mController->fileDetails();
- details->mArtist = "Fusion";
-
- mWidget->updateWithFileDetails( details );
-
- verifyResult( "Author", true, details->mArtist );
-
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
-// testCopyright
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackFileDetailsWidget::testCopyright()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackFileDetailsWidget::testCopyright()"));
-
- init();
-
- QMPXVideoPlaybackViewFileDetails *details = mController->fileDetails();
- details->mCopyright = "Fusion team";
-
- mWidget->updateWithFileDetails( details );
-
- verifyResult( "Copyright", true, details->mCopyright );
-
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
-// testLanguage
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackFileDetailsWidget::testLanguage()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackFileDetailsWidget::testLanguage()"));
-
- init();
-
- QMPXVideoPlaybackViewFileDetails *details = mController->fileDetails();
- details->mLanguage = "English";
-
- mWidget->updateWithFileDetails( details );
-
- verifyResult( "Language", true, details->mLanguage );
-
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
-// testKeywords
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackFileDetailsWidget::testKeywords()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackFileDetailsWidget::testKeywords()"));
-
- init();
-
- QMPXVideoPlaybackViewFileDetails *details = mController->fileDetails();
- details->mKeywords = "QTest";
-
- mWidget->updateWithFileDetails( details );
-
- verifyResult( "Keywords", true, details->mKeywords );
-
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
-// testSize
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackFileDetailsWidget::testSize()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackFileDetailsWidget::testSize()"));
-
- init();
-
- QMPXVideoPlaybackViewFileDetails *details = mController->fileDetails();
-
- //
- // If it is streaming case, we don't show size information
- //
- details->mPlaybackMode = EMPXVideoStreaming;
- details->mClipName = KFILEPATH;
-
- mWidget->updateWithFileDetails( details );
-
- verifyResult( "Size", false );
-
- mWidget->mListWidget->clear();
- mWidget->mFileDetailsUpdated = false;
-
- //
- // If it is local, we show size information
- //
- details->mPlaybackMode = EMPXVideoLocal;
- mWidget->updateWithFileDetails( details );
-
- verifyResult( "Size", true, "", false );
-
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
-// testResolution
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackFileDetailsWidget::testResolution()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackFileDetailsWidget::testResolution()"));
-
- init();
-
- QMPXVideoPlaybackViewFileDetails *details = mController->fileDetails();
-
- //
- // If it is audio only clip, don't need to show resolution
- //
- details->mVideoEnabled = false;
-
- mWidget->updateWithFileDetails( details );
-
- verifyResult( "Resolution", false );
-
- mWidget->mListWidget->clear();
- mWidget->mFileDetailsUpdated = false;
-
- //
- // If it has video track
- //
- details->mVideoEnabled = true;
- details->mVideoWidth = 640;
- details->mVideoHeight = 360;
-
- mWidget->updateWithFileDetails( details );
-
- QString resolution = QString("%1x%2")
- .arg( details->mVideoWidth ).arg( details->mVideoHeight );
-
- verifyResult( "Resolution", true, resolution );
-
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
-// testFormat
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackFileDetailsWidget::testFormat()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackFileDetailsWidget::testFormat()"));
-
- init();
-
- QMPXVideoPlaybackViewFileDetails *details = mController->fileDetails();
- details->mMimeType = "Nothing";
-
- mWidget->updateWithFileDetails( details );
-
- verifyResult( "Format", true, details->mMimeType );
-
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
-// testBitrate
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackFileDetailsWidget::testBitrate()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackFileDetailsWidget::testBitrate()"));
-
-
- init();
-
- QMPXVideoPlaybackViewFileDetails *details = mController->fileDetails();
- details->mBitRate = 512;
-
- mWidget->updateWithFileDetails( details );
-
- verifyResult( "Bitrate", true, "512 kbps" );
-
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
-// testFolder
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackFileDetailsWidget::testFolder()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackFileDetailsWidget::testFolder()"));
-
- init();
-
- QMPXVideoPlaybackViewFileDetails *details = mController->fileDetails();
-
- //
- // If it is streaming case, we don't show folder information
- //
- details->mPlaybackMode = EMPXVideoStreaming;
- details->mClipName = KFILEPATH;
-
- mWidget->updateWithFileDetails( details );
-
- verifyResult( "Collection", false );
-
- mWidget->mListWidget->clear();
- mWidget->mFileDetailsUpdated = false;
-
- //
- // If it is local case, we show folder information
- //
- details->mPlaybackMode = EMPXVideoLocal;
-
- mWidget->updateWithFileDetails( details );
-
- verifyResult( "Collection", false );
-
- cleanup();
-
-}
-
-// ---------------------------------------------------------------------------
-// verifyResult
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackFileDetailsWidget::verifyResult(
- QString primaryText, bool exist, QString expectedSecondaryText, bool needToBeCompared )
-{
- MPX_DEBUG(_L("TestMPXVideoPlaybackFileDetailsWidget::verifyResult(%s, %d, %s, %d)"),
- primaryText.data(), exist, expectedSecondaryText.data(), needToBeCompared );
-
- QString secondaryText = "";
- int i = 0;
-
- for( ; i < mWidget->mListWidget->count() ; i++ )
- {
- HbListWidgetItem *item = mWidget->mListWidget->item( i );
-
- if ( item->text() == primaryText )
- {
- secondaryText = item->secondaryText();
- break;
- }
- }
-
- //
- // If the item needs to be existed in HbListWidget, check the result
- //
- if ( exist )
- {
- if ( needToBeCompared )
- {
- MPX_DEBUG(_L("TestMPXVideoPlaybackFileDetailsWidget::verifyResult() : secondaryText(%s)"),
- secondaryText.data() );
-
- QVERIFY( expectedSecondaryText == secondaryText );
- }
- else
- {
- MPX_DEBUG(_L("TestMPXVideoPlaybackFileDetailsWidget::verifyResult() : i(%d) count(%d)"),
- i, mWidget->mListWidget->count() );
-
- //
- // Doens't need to compare the secondary text. Just make sure it's in the list
- //
- QVERIFY( i < mWidget->mListWidget->count() );
- }
-
- }
- //
- // If not, just make sure that item is not in the list
- //
- else
- {
- QVERIFY( i == mWidget->mListWidget->count() );
- }
-}
-
-
-// -------------------------------------------------------------------------------------------------
-// dateTimeStringFormat
-// -------------------------------------------------------------------------------------------------
-//
-QString TestMPXVideoPlaybackFileDetailsWidget::dateTimeStringFormat( QDateTime dateTime )
-{
- HbExtendedLocale locale = HbExtendedLocale::system();
- QString date = locale.format( dateTime.date(), r_qtn_date_usual );
- QString time = locale.format( dateTime.time(), r_qtn_time_long_with_zero );
- QString dateTimeString( date + " " + time );
-
- MPX_DEBUG(_L("TestMPXVideoPlaybackFileDetailsWidget::dateTimeStringFormat() ret '%s'"),
- dateTimeString.data() );
-
- return dateTimeString;
-}
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/inc/hbglobal.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
-* 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: class for HbGlobal
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#ifndef HBGLOBAL_H
-#define HBGLOBAL_H
-
-#include <QtGlobal>
-
-#ifdef BUILD_HB_CORE
-# define HB_CORE_EXPORT Q_DECL_EXPORT
-# define HB_CORE_PRIVATE_EXPORT Q_DECL_EXPORT
-#else
-# define HB_CORE_EXPORT Q_DECL_IMPORT
-# define HB_CORE_PRIVATE_EXPORT Q_DECL_IMPORT
-#endif // BUILD_HB_CORE
-
-#ifdef BUILD_HB_WIDGETS
-# define HB_WIDGETS_EXPORT Q_DECL_EXPORT
-# define HB_WIDGETS_PRIVATE_EXPORT Q_DECL_EXPORT
-#else
-# define HB_WIDGETS_EXPORT Q_DECL_IMPORT
-# define HB_WIDGETS_PRIVATE_EXPORT Q_DECL_IMPORT
-#endif // BUILD_HB_WIDGETS
-
-
-QString hbTrId( QString string, int n = -1 );
-
-
-#endif // HBGLOBAL_H
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/inc/mpxvideoplaybackcontrolscontroller.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,156 +0,0 @@
-/*
-* 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 MPXVideoPlaybackControlsController
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_
-#define MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_
-
-// INCLUDES
-#include <qobject>
-#include <mpxplaybackframeworkdefs.h>
-
-#include "mpxvideo_debug.h"
-#include "mpxhelixplaybackplugindefs.h"
-#include "mpxcommonvideoplaybackview.hrh"
-#include "mpxvideoplaybackviewfiledetails.h"
-
-// FORWARD DECLARATIONS
-class QMPXVideoPlaybackDocumentLoader;
-
-
-// DATA TYPES
-
-enum TMPXTimerAction
-{
- EMPXTimerCancel,
- EMPXTimerReset
-};
-
-enum TPlaybackViewMode
-{
- EFullScreenView,
- EDetailsView,
- EAudioOnlyView
-};
-
-const QString KMPXPLAYBACKVIEW_XML = ":/hbvideoplaybackview/hbvideoplaybackview.docml";
-
-// CLASS DECLARATION
-
-class QMPXVideoPlaybackControlsController : public QObject
-{
- Q_OBJECT
-
- public:
-
- /**
- * constructor.
- */
- QMPXVideoPlaybackControlsController();
-
- /**
- * Destructor.
- */
- virtual ~QMPXVideoPlaybackControlsController();
-
- public:
-
- /**
- * Command handling function.
- * Call HandleCommandL() of container
- */
- void handleCommand( TMPXVideoPlaybackViewCommandIds command, int value = 0 );
-
- /**
- * Reset or cancel timers for the controls
- */
- void resetDisappearingTimers( TMPXTimerAction timerAction );
-
- /**
- * Return state
- */
- inline TMPXPlaybackState state();
-
- /**
- * Return file details
- */
- inline QMPXVideoPlaybackViewFileDetails* fileDetails();
-
- inline QMPXVideoPlaybackDocumentLoader* layoutLoader();
-
- TPlaybackViewMode viewMode();
-
- void changeViewMode( TPlaybackViewMode viewMode, bool transitionEffect = true );
-
- public:
- QMPXVideoPlaybackViewFileDetails *mFileDetails;
- QMPXVideoPlaybackDocumentLoader *mLoader;
-
- TMPXPlaybackState mState;
- TPlaybackViewMode mViewMode;
- TMPXTimerAction mTimerAction;
- TMPXVideoPlaybackViewCommandIds mCommand;
- int mCommandValue;
-};
-
-// INLINE METHODS
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::state
-// -------------------------------------------------------------------------------------------------
-//
-inline
-TMPXPlaybackState QMPXVideoPlaybackControlsController::state()
-{
- return mState;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::fileDetails
-// -------------------------------------------------------------------------------------------------
-//
-inline
-QMPXVideoPlaybackViewFileDetails* QMPXVideoPlaybackControlsController::fileDetails()
-{
- return mFileDetails;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::layoutLoader
-// -------------------------------------------------------------------------------------------------
-//
-inline
-QMPXVideoPlaybackDocumentLoader* QMPXVideoPlaybackControlsController::layoutLoader()
-{
- return mLoader;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::viewMode
-// -------------------------------------------------------------------------------------------------
-//
-inline
-TPlaybackViewMode QMPXVideoPlaybackControlsController::viewMode()
-{
- return mViewMode;
-}
-
-#endif /*MPXVIDEOPLAYBACKCONTROLSCONTROLLER_P_H_*/
-
-// End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/inc/mpxvideoplaybackdocumentloader.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackDocumentLoader
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKDOCUMENTHANDLER_H_
-#define MPXVIDEOPLAYBACKDOCUMENTHANDLER_H_
-
-
-#include <qobject>
-
-class QList;
-class QGraphicsWidget;
-class QMPXVideoPlaybackControlsController;
-
-class QMPXVideoPlaybackDocumentLoader : public QObject
-{
- public:
- QMPXVideoPlaybackDocumentLoader();
-
- virtual ~QMPXVideoPlaybackDocumentLoader();
-
- public:
- QGraphicsWidget* findWidget( const QString &name );
- void load( const QString &fileName, const QString §ion , bool *ok );
-
- private:
- QGraphicsWidget* createWidget( const QString &name );
- int exist( const QString &name );
-
- private:
- QList<QGraphicsWidget*> mWidgets;
-};
-
-#endif /*MPXVIDEOPLAYBACKDOCUMENTHANDLER_H_*/
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/inc/mpxvideoplaybackviewfiledetails.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/*
-* 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: MPX Video File Details (QT)
-*
-*/
-
-// Version : %version: 3 %
-
-
-
-
-#ifndef __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-#define __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-
-#include <qobject.h>
-#include "mpxhelixplaybackplugindefs.h"
-
-
-//
-// CLASS DECLARATION
-//
-class QMPXVideoPlaybackViewFileDetails : public QObject
-{
- public:
- //
- // Constructor
- //
- QMPXVideoPlaybackViewFileDetails();
-
- //
- // Destructor.
- //
- virtual ~QMPXVideoPlaybackViewFileDetails();
-
- //
- // Clear all file details
- //
- void clearFileDetails();
-
- public:
- //
- // Data
- //
- QString mClipName;
- QString mTitle;
- QString mArtist;
- QString mMimeType;
- QString mDescription;
- QString mLocation;
- QString mCopyright;
- QString mLanguage;
- QString mKeywords;
-
- TMPXVideoMode mPlaybackMode;
- bool mSeekable;
- bool mPausableStream;
- bool mAudioEnabled;
- bool mVideoEnabled;
- bool mPartialPlayback;
- bool mRNFormat;
- bool mTvOutConnected;
- bool mDrmProtected;
- bool mMultiItemPlaylist;
-
- int mVideoHeight;
- int mVideoWidth;
- int mBitRate;
- int mDuration;
- int mCreationTime;
- int mModificationTime;
-};
-
-#endif // __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/src/hbglobal.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,124 +0,0 @@
-/*
-* 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: class for HbGlobal
-*
-*/
-
-// Version : %version: 3 %
-
-
-
-#include "hbglobal.h"
-#include <qstring>
-
-
-QString hbTrId( QString string, int n )
-{
- Q_UNUSED( n );
-
- QString loc = "";
-
- if ( string == "txt_videos_list_description" )
- {
- loc = "Description";
- }
- else if ( string == "txt_videos_list_duration" )
- {
- loc = "Duration";
- }
- else if ( string == "txt_videos_list_date" )
- {
- loc = "Date";
- }
- else if ( string == "txt_videos_list_modified" )
- {
- loc = "Modified";
- }
- else if ( string == "txt_videos_list_location" )
- {
- loc = "Location";
- }
- else if ( string == "txt_videos_list_author" )
- {
- loc = "Author";
- }
- else if ( string == "txt_videos_list_copyright" )
- {
- loc = "Copyright";
- }
- else if ( string == "txt_videos_list_language" )
- {
- loc = "Language";
- }
- else if ( string == "txt_videos_list_keywords" )
- {
- loc = "Keywords";
- }
- else if ( string == "txt_videos_list_resolution" )
- {
- loc = "Resolution";
- }
- else if ( string == "txt_videos_list_format" )
- {
- loc = "Format";
- }
- else if ( string == "txt_videos_list_collection_name" )
- {
- loc = "Collection";
- }
- else if ( string == "txt_videos_list_title" )
- {
- loc = "Title";
- }
- else if ( string == "txt_videos_list_file_size" )
- {
- loc = "Size";
- }
- else if ( string == "txt_videos_list_bitrate" )
- {
- loc = "Bitrate";
- }
- else if ( string == "txt_videos_list_l1l2l3" )
- {
- loc = "%L1 hr %L2 min %L3 sec";
- }
- else if ( string == "txt_videos_list_l1_kb" )
- {
- loc = "%L1 kB";
- }
- else if ( string == "txt_videos_list_l1_mb" )
- {
- loc = "%L1 MB";
- }
- else if ( string == "txt_videos_list_l1_gb" )
- {
- loc = "%L1 GB";
- }
- else if ( string == "txt_videos_list_l1_kbps" )
- {
- loc = "%L1 kbps";
- }
- else if ( string == "txt_videos_list_l1_mbps" )
- {
- loc = "%L1 Mbps";
- }
- else if ( string == "txt_videos_list_l1l2" )
- {
- loc = "%L1x%L2";
- }
-
- return loc;
-}
-
-//End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/src/mpxvideoplaybackcontrolscontroller.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-/*
-* 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 MPXVideoPlaybackControlsController
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-// INCLUDE FILES
-
-
-#include "mpxvideoplaybackdocumentloader.h"
-#include "mpxvideoplaybackcontrolscontroller.h"
-
-// ================= MEMBER FUNCTIONS ==============================================================
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController()
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController()
- : mViewMode( EFullScreenView )
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController()"));
-
- mLoader = new QMPXVideoPlaybackDocumentLoader();
- mFileDetails = new QMPXVideoPlaybackViewFileDetails();
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::handleCommand()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::handleCommand(
- TMPXVideoPlaybackViewCommandIds command, int value )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::handleCommand(%d)"), command);
-
- mCommand = command;
- mCommandValue = value;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::changeViewMode
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::changeViewMode(
- TPlaybackViewMode viewMode, bool transitionEffect )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::changeViewMode()"));
-
- Q_UNUSED( transitionEffect );
- mViewMode = viewMode;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::resetDisappearingTimers()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::resetDisappearingTimers( TMPXTimerAction timerAction )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::resetDisappearingTimers()"));
-
- mTimerAction = timerAction;
-}
-
-// End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/src/mpxvideoplaybackdocumentloader.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,139 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackDocumentLoader
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-#include <hblistwidget.h>
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackdocumentloader.h"
-
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::QMPXVideoPlaybackDocumentLoader
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackDocumentLoader::QMPXVideoPlaybackDocumentLoader()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackDocumentLoader::QMPXVideoPlaybackDocumentLoader()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::~QMPXVideoPlaybackDocumentLoader
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackDocumentLoader::~QMPXVideoPlaybackDocumentLoader()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::QMPXVideoPlaybackDocumentLoader") );
-
- for ( int i = 0 ; i < mWidgets.count() ; i++ )
- {
- mWidgets.removeAt( 0 );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::findWidget()
-// -------------------------------------------------------------------------------------------------
-//
-QGraphicsWidget *QMPXVideoPlaybackDocumentLoader::findWidget( const QString &name )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::findWidget") );
-
- QGraphicsWidget *object = NULL;
-
- int index = exist( name );
-
- if ( index == -1 )
- {
- object = createWidget( name );
- }
- else
- {
- object = mWidgets[ index ];
- }
-
- return object;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::createWidget()
-// -------------------------------------------------------------------------------------------------
-//
-QGraphicsWidget *QMPXVideoPlaybackDocumentLoader::createWidget( const QString &name )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::createWidget") );
-
- QGraphicsWidget *object = NULL;
-
- if ( name == "fileDetails" )
- {
- object = new HbListWidget();
- object->setObjectName( name );
- mWidgets.append( object );
- }
- else if ( name == "content" )
- {
- object = new QGraphicsWidget();
- object->setObjectName( name );
- mWidgets.append( object );
- }
-
- return object;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::exist()
-// -------------------------------------------------------------------------------------------------
-//
-int QMPXVideoPlaybackDocumentLoader::exist( const QString &name )
-{
- int i = 0;
-
- for ( ; i < mWidgets.count() ; i++ )
- {
- if( mWidgets[i]->objectName() == name )
- {
- break;
- }
- }
-
- if ( i == mWidgets.count() )
- {
- i = -1;
- }
-
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::exist %d"), i );
-
- return i;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::load()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackDocumentLoader::load(
- const QString &fileName, const QString §ion , bool *ok )
-{
- Q_UNUSED( fileName );
- Q_UNUSED( section );
- Q_UNUSED( ok );
-}
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/src/mpxvideoplaybackviewfiledetails.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
-* 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: class for MPX Video File Details (Qt)
-*
-*/
-
-// Version : %version: 3 %
-
-
-
-//
-// INCLUDE FILES
-//
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackviewfiledetails.h"
-
-
-// ============================ MEMBER FUNCTIONS ===================================================
-
-QMPXVideoPlaybackViewFileDetails::QMPXVideoPlaybackViewFileDetails()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::QMPXVideoPlaybackViewFileDetails()"));
-
- clearFileDetails();
-}
-
-QMPXVideoPlaybackViewFileDetails::~QMPXVideoPlaybackViewFileDetails()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::~QMPXVideoPlaybackViewFileDetails()"));
-
- clearFileDetails();
-}
-
-void
-QMPXVideoPlaybackViewFileDetails::clearFileDetails()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::ClearFileDetails()"));
-
- mMimeType = tr("");
- mTitle = tr("");
- mArtist = tr("");
- mClipName = tr("");
- mDescription = tr("");
- mLocation = tr("");
- mCopyright = tr("");
- mLanguage = tr("");
- mKeywords = tr("");
-
- mPlaybackMode = EMPXVideoLocal;
- mSeekable = false;
- mPausableStream = false;
- mAudioEnabled = false;
- mVideoEnabled = false;
- mPartialPlayback = false;
- mRNFormat = false;
-
- mDuration = 0;
- mTvOutConnected = false;
- mDrmProtected = false;
-
- mVideoHeight = 0;
- mVideoWidth = 0;
- mBitRate = 0;
- mCreationTime = 0;
- mModificationTime = 0;
-}
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/testmpxvideoplaybackfiledetailswidget.pro Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-#
-# 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: Project file for building testmpxvideoplaybackfiledetailswidget
-#
-#
-# Version : %version: 2 %
-
-TEMPLATE = app
-TARGET = testmpxvideoplaybackfiledetailswidget
-CONFIG += qtestlib qt hb
-
-INCLUDEPATH += stub/inc \
- ../../../../inc \
- ../../../inc
-
-DEPENDPATH += inc src stub/inc stub/src
-
-# Input
-HEADERS += testmpxvideoplaybackfiledetailswidget.h \
- mpxvideoplaybackcontrolscontroller.h \
- mpxvideoplaybackdocumentloader.h \
- mpxvideoplaybackviewfiledetails.h \
- hbglobal.h \
- ../../controlinc/mpxvideoplaybackfiledetailswidget.h
-
-SOURCES += testmpxvideoplaybackfiledetailswidget.cpp \
- mpxvideoplaybackcontrolscontroller.cpp \
- mpxvideoplaybackdocumentloader.cpp \
- mpxvideoplaybackviewfiledetails.cpp \
- hbglobal.cpp \
- ../../controlsrc/mpxvideoplaybackfiledetailswidget.cpp
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybacktoolbar/inc/testmpxvideoplaybacktoolbar.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-/**
-* 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: tester for methods in TestMPXVideoPlaybackToolBar
-*
-*/
-
-// Version : %version: 1 %
-
-#ifndef __TESTMPXVIDEOPLAYBACKTOOLBAR_H__
-#define __TESTMPXVIDEOPLAYBACKTOOLBAR_H__
-
-
-// INCLUDES
-#include <QtTest/QtTest>
-
-class QMPXVideoPlaybackToolBar;
-class QMPXVideoPlaybackControlsController;
-
-class TestMPXVideoPlaybackToolBar : public QObject
-{
- Q_OBJECT
-
-public:
-
- /**
- * will be called before each testfunction is executed.
- *
- */
- void init( bool attachOperation = false );
-
- /**
- * will be called after every testfunction.
- *
- */
- void cleanup();
-
- // test functions for the test framework
-private slots:
-
- // the order in which these testXX methods are declared is important
- // changing this order will affect the test results
- void testPlay();
- void testLongTapOnFF();
- void testLongTapOnRW();
- void testShortTapOnFF();
- void testShortTapOnRW();
- void testPause();
- void testChangeAspectRatio();
- void testUpdateState();
- void testAspectRatioChanged();
- void testHandleButtonPressed();
- void testUpdateWithFileDetails();
- void testOpenDetailsView();
- void testAttach();
- void testSend();
-
-signals:
- void commandSignal();
-
-private:
- QMPXVideoPlaybackToolBar* mVideoToolBar;
- QMPXVideoPlaybackControlsController* mController;
-};
-
-
-#endif // __TESTMPXVIDEOPLAYBACKTOOLBAR_H__
-
-// End of file
-
-
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybacktoolbar/src/testmpxvideoplaybacktoolbar.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,644 +0,0 @@
-/**
-* 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: tester for methods in TestMPXVideoPlaybackToolBar
-*
-*/
-
-// Version : %version: 4 %
-
-
-#include <qdebug>
-#include <hbmainwindow.h>
-#include <hbapplication.h>
-
-#include "hbtoolbar.h"
-#include "hbtoolbutton.h"
-#include "testmpxvideoplaybacktoolbar.h"
-#include "mpxvideoplaybackviewfiledetails.h"
-#include "mpxvideoplaybackcontrolscontroller.h"
-#include "mpxvideoplaybackdocumentloader.h"
-
-#define private public
-#include "mpxvideoplaybacktoolbar.h"
-#undef private
-
-// -------------------------------------------------------------------------------------------------
-// main
-// -------------------------------------------------------------------------------------------------
-//
-int main(int argc, char *argv[])
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackToolBar::Main()"));
-
- HbApplication app(argc, argv);
- HbMainWindow window;
-
- TestMPXVideoPlaybackToolBar tv;
-
- char *pass[3];
- pass[0] = argv[0];
- pass[1] = "-o";
- pass[2] = "c:\\data\\testmpxvideoplaybacktoolbar.txt";
-
- int res = QTest::qExec(&tv, 3, pass);
-
- return res;
-}
-
-// -------------------------------------------------------------------------------------------------
-// init
-// -------------------------------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackToolBar::init( bool attachOperation )
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackToolBar::init()"));
-
- mController = new QMPXVideoPlaybackControlsController( attachOperation );
- 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()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackToolBar::cleanup()"));
-
- if ( mController )
- {
- delete mController;
- mController = NULL;
- }
-
- if ( mVideoToolBar )
- {
- delete mVideoToolBar;
- mVideoToolBar = NULL;
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// testPlay
-// -------------------------------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackToolBar::testPlay()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackToolBar::testPlay()"));
-
- init();
-
- mVideoToolBar->mButtons[EMPX3rdButton]->release();
-
- QVERIFY( mController->mTimerAction == EMPXTimerReset );
- QVERIFY( mController->mCommand == EMPXPbvCmdPlayPause );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// testLongTapOnFF
-// -------------------------------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackToolBar::testLongTapOnFF()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackToolBar::testLongTapOnFF()"));
-
- init();
-
- //
- // Start seeking
- //
- mVideoToolBar->mButtons[EMPX4thButton]->press();
- QVERIFY( mController->mTimerAction == EMPXTimerCancel );
-
- connect( this, SIGNAL( commandSignal() ), mVideoToolBar, SLOT( ffPressing() ) );
- emit commandSignal();
- disconnect( this, SIGNAL( commandSignal() ), mVideoToolBar, SLOT( ffPressing() ) );
-
- QVERIFY( mVideoToolBar->mSeekingState == EMPXFastForwarding );
- QVERIFY( mController->mCommand == EMPXPbvCmdSeekForward );
-
- //
- // End seeking
- //
- mVideoToolBar->mButtons[EMPX4thButton]->release();
-
- QVERIFY( mVideoToolBar->mSeekingState == EMPXNotSeeking );
- QVERIFY( mController->mTimerAction == EMPXTimerReset );
- QVERIFY( mController->mCommand == EMPXPbvCmdEndSeek );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// testLongTapOnRW
-// -------------------------------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackToolBar::testLongTapOnRW()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackToolBar::testLongTapOnRW()"));
-
- init();
-
- //
- // Start seeking
- //
- mVideoToolBar->mButtons[EMPX2ndButton]->press();
- QVERIFY( mController->mTimerAction == EMPXTimerCancel );
-
- connect( this, SIGNAL( commandSignal() ), mVideoToolBar, SLOT( rwPressing() ) );
- emit commandSignal();
- disconnect( this, SIGNAL( commandSignal() ), mVideoToolBar, SLOT( rwPressing() ) );
-
- QVERIFY( mVideoToolBar->mSeekingState == EMPXRewinding );
- QVERIFY( mController->mCommand == EMPXPbvCmdSeekBackward );
-
- //
- // End seeking
- //
- mVideoToolBar->mButtons[EMPX2ndButton]->release();
-
- QVERIFY( mVideoToolBar->mSeekingState == EMPXNotSeeking );
- QVERIFY( mController->mTimerAction == EMPXTimerReset );
- QVERIFY( mController->mCommand == EMPXPbvCmdEndSeek );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// testShortTapOnFF
-// -------------------------------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackToolBar::testShortTapOnFF()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackToolBar::testShortTapOnFF()"));
-
- init();
-
- //
- // If mPostion + KMPXFastForward < mDuration
- //
- mVideoToolBar->mPosition = 30;
- mVideoToolBar->mDuration = 70;
- mVideoToolBar->mButtons[EMPX4thButton]->release();
-
- QVERIFY( mController->mTimerAction == EMPXTimerReset );
- QVERIFY( mController->mCommand == EMPXPbvCmdSetPosition );
- QVERIFY( mController->mCommandValue == mVideoToolBar->mPosition + KMPXFastForward );
-
- //
- // If mPostion + KMPXFastForward < mDuration
- //
- mVideoToolBar->mDuration = 50;
- mController->mCommand = EMPXPbvCmdPlay;
-
- mVideoToolBar->mButtons[EMPX4thButton]->release();
- QVERIFY( mController->mTimerAction == EMPXTimerReset );
- QVERIFY( mController->mCommand == EMPXPbvCmdPlay );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// testShortTapOnRW
-// -------------------------------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackToolBar::testShortTapOnRW()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackToolBar::testShortTapOnRW()"));
-
- init();
-
- //
- // If mPostion + KMPXRewind > 0
- //
- mVideoToolBar->mPosition = 30;
- mVideoToolBar->mButtons[EMPX2ndButton]->release();
-
- QVERIFY( mController->mTimerAction == EMPXTimerReset );
- QVERIFY( mController->mCommand == EMPXPbvCmdSetPosition );
- QVERIFY( mController->mCommandValue == mVideoToolBar->mPosition + KMPXRewind );
-
- //
- // If mPostion + KMPXRewind < 0
- //
- mVideoToolBar->mPosition = 4;
- mVideoToolBar->mButtons[EMPX2ndButton]->release();
-
- QVERIFY( mController->mTimerAction == EMPXTimerReset );
- QVERIFY( mController->mCommand == EMPXPbvCmdSetPosition );
- QVERIFY( mController->mCommandValue == 0 );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// testPause
-// -------------------------------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackToolBar::testPause()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackToolBar::testPause()"));
-
- init();
-
- mVideoToolBar->mButtons[EMPX3rdButton]->release();
-
- QVERIFY( mController->mTimerAction == EMPXTimerReset );
- QVERIFY( mController->mCommand == EMPXPbvCmdPlayPause );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// testChangeAspectRatio
-// -------------------------------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackToolBar::testChangeAspectRatio()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackToolBar::testChangeAspectRatio()"));
-
- init();
-
- //
- // Test natural
- //
- mVideoToolBar->mAspectRatio = EMMFZoom;
- mVideoToolBar->mButtons[EMPX1stButton]->release();
-
- QVERIFY( mController->mTimerAction == EMPXTimerReset );
- QVERIFY( mController->mCommand == EMPXPbvCmdNaturalAspectRatio );
-
- //
- // Test stretch
- //
- mVideoToolBar->mAspectRatio = EMMFStretch;
- mVideoToolBar->mButtons[EMPX1stButton]->release();
-
- QVERIFY( mController->mTimerAction == EMPXTimerReset );
- QVERIFY( mController->mCommand == EMPXPbvCmdZoomAspectRatio );
-
- //
- // Test stretch
- //
- mVideoToolBar->mAspectRatio = EMMFNatural;
- mVideoToolBar->mButtons[EMPX1stButton]->release();
-
- QVERIFY( mController->mTimerAction == EMPXTimerReset );
- QVERIFY( mController->mCommand == EMPXPbvCmdStretchAspectRatio );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// testUpdateState
-// -------------------------------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackToolBar::testUpdateState()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackToolBar::testUpdateState()"));
-
- init();
-
- //
- // Playing
- //
- TMPXPlaybackState state = EPbStatePlaying;
- mVideoToolBar->updateState( state );
-
- QVERIFY( mVideoToolBar->mToolBar->mEnabled == true );
-
- //
- // Paused
- //
- state = EPbStatePaused;
- mVideoToolBar->updateState( state );
-
- QVERIFY( mVideoToolBar->mToolBar->mEnabled == true );
-
- //
- // Not initialized
- //
- state = EPbStateNotInitialised;
- mVideoToolBar->updateState( state );
-
- QVERIFY( mVideoToolBar->mToolBar->mEnabled == false );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// testAspectRatioChanged
-// -------------------------------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackToolBar::testAspectRatioChanged()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackToolBar::testAspectRatioChanged()"));
-
- init();
-
- //
- // Natural
- //
- int aspectRatio = EMMFNatural;
- mVideoToolBar->aspectRatioChanged( aspectRatio );
- QVERIFY( mVideoToolBar->mAspectRatio == EMMFNatural );
-
- //
- // Stretch
- //
- aspectRatio = EMMFStretch;
- mVideoToolBar->aspectRatioChanged( aspectRatio );
- QVERIFY( mVideoToolBar->mAspectRatio == EMMFStretch );
-
- //
- // Zoom
- //
- aspectRatio = EMMFZoom;
- mVideoToolBar->aspectRatioChanged( aspectRatio );
- QVERIFY( mVideoToolBar->mAspectRatio == EMMFZoom );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// testHandleButtonPressed
-// -------------------------------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackToolBar::testHandleButtonPressed()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackToolBar::testHandleButtonPressed()"));
-
- init();
-
- mVideoToolBar->mButtons[EMPX1stButton]->press();
-
- QVERIFY( mController->mTimerAction == EMPXTimerCancel );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// testUpdateWithFileDetails
-// -------------------------------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackToolBar::testUpdateWithFileDetails()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackToolBar::testUpdateWithFileDetails()"));
-
- //
- // 'non-attach' mode
- //
- init();
-
- QMPXVideoPlaybackViewFileDetails *details = mController->fileDetails();
-
- //
- // video clip, view mode is full-screen
- //
- details->mVideoEnabled = true;
- details->mVideoHeight = 1;
- details->mVideoWidth = 1;
- details->mTvOutConnected = false;
- details->mSeekable = true;
- details->mPausableStream = true;
- mController->mViewMode = EFullScreenView;
-
- mVideoToolBar->updateWithFileDetails( details );
-
- QVERIFY( mVideoToolBar->mButtons[EMPX1stButton]->isEnabled() == true );
- QVERIFY( mVideoToolBar->mButtons[EMPX2ndButton]->isEnabled() == true );
- QVERIFY( mVideoToolBar->mButtons[EMPX3rdButton]->isEnabled() == true );
- QVERIFY( mVideoToolBar->mButtons[EMPX4thButton]->isEnabled() == true );
- QVERIFY( mVideoToolBar->mButtons[EMPX5thButton]->isEnabled() == true );
-
- //
- // video clip has same aspect ratio as display window
- //
- details->mVideoEnabled = true;
- details->mVideoHeight = 360;
- details->mVideoWidth = 640;
- details->mTvOutConnected = false;
- mController->mViewMode = EFullScreenView;
-
- mVideoToolBar->updateWithFileDetails( details );
-
- QVERIFY( mVideoToolBar->mButtons[EMPX1stButton]->isEnabled() == false );
- QVERIFY( mVideoToolBar->mButtons[EMPX2ndButton]->isEnabled() == true );
- QVERIFY( mVideoToolBar->mButtons[EMPX3rdButton]->isEnabled() == true );
- QVERIFY( mVideoToolBar->mButtons[EMPX4thButton]->isEnabled() == true );
- QVERIFY( mVideoToolBar->mButtons[EMPX5thButton]->isEnabled() == true );
-
- //
- // audio-only clip, view mode is full-screen
- //
- details->mVideoEnabled = false;
- details->mVideoHeight = 0;
- details->mVideoWidth = 1;
- details->mTvOutConnected = true;
- details->mSeekable = false;
- details->mPausableStream = true;
-
- mVideoToolBar->updateWithFileDetails( details );
-
- QVERIFY( mVideoToolBar->mButtons[EMPX1stButton]->isEnabled() == false );
- QVERIFY( mVideoToolBar->mButtons[EMPX2ndButton]->isEnabled() == false );
- QVERIFY( mVideoToolBar->mButtons[EMPX3rdButton]->isEnabled() == true );
- QVERIFY( mVideoToolBar->mButtons[EMPX4thButton]->isEnabled() == false );
- QVERIFY( mVideoToolBar->mButtons[EMPX5thButton]->isEnabled() == false );
-
- //
- // local audio-only clip, view mode is audio-only
- //
- details->mVideoEnabled = false;
- details->mVideoHeight = 0;
- details->mVideoWidth = 1;
- details->mTvOutConnected = true;
- details->mSeekable = true;
- details->mPausableStream = false;
- mController->mViewMode = EAudioOnlyView;
-
- mVideoToolBar->updateWithFileDetails( details );
-
- QVERIFY( mVideoToolBar->mButtons[EMPX1stButton]->isEnabled() == true );
- QVERIFY( mVideoToolBar->mButtons[EMPX2ndButton]->isEnabled() == false );
- QVERIFY( mVideoToolBar->mButtons[EMPX3rdButton]->isEnabled() == false );
- QVERIFY( mVideoToolBar->mButtons[EMPX4thButton]->isEnabled() == false );
- QVERIFY( mVideoToolBar->mButtons[EMPX5thButton]->isEnabled() == false );
-
- //
- // streaming audio-only clip, view mode is audio-only
- //
- details->mVideoEnabled = false;
- details->mPlaybackMode = EMPXVideoStreaming;
- mController->mViewMode = EAudioOnlyView;
- details->mSeekable = false;
- details->mPausableStream = false;
-
- mVideoToolBar->updateWithFileDetails( details );
-
- QVERIFY( mVideoToolBar->mButtons[EMPX1stButton]->isEnabled() == false );
- QVERIFY( mVideoToolBar->mButtons[EMPX2ndButton]->isEnabled() == false );
- QVERIFY( mVideoToolBar->mButtons[EMPX3rdButton]->isEnabled() == false );
- QVERIFY( mVideoToolBar->mButtons[EMPX4thButton]->isEnabled() == false );
- QVERIFY( mVideoToolBar->mButtons[EMPX5thButton]->isEnabled() == false );
-
- cleanup();
-
- //
- // 'attach' mode
- //
- init( true );
-
- //
- // video clip, view mode is full-screen
- //
- details->mVideoEnabled = true;
- details->mVideoHeight = 1;
- details->mVideoWidth = 1;
- details->mTvOutConnected = false;
- details->mSeekable = true;
- details->mPausableStream = true;
-
- mVideoToolBar->updateWithFileDetails( details );
-
- QVERIFY( mVideoToolBar->mButtons[EMPX1stButton]->isEnabled() == true );
- QVERIFY( mVideoToolBar->mButtons[EMPX2ndButton]->isEnabled() == true );
- QVERIFY( mVideoToolBar->mButtons[EMPX3rdButton]->isEnabled() == true );
- QVERIFY( mVideoToolBar->mButtons[EMPX4thButton]->isEnabled() == true );
- QVERIFY( mVideoToolBar->mButtons[EMPX5thButton]->isEnabled() == true );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// testOpenDetailsView
-// -------------------------------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackToolBar::testOpenDetailsView()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackToolBar::testOpenDetailsView()"));
-
- init();
-
- QSignalSpy spy( mVideoToolBar, SIGNAL( openDetailsView() ) );
-
- mController->mViewMode = EFullScreenView;
- mVideoToolBar->mButtons[EMPX5thButton]->release();
- QVERIFY( mController->mViewMode == EDetailsView );
-
- mController->mViewMode = EDetailsView;
- mVideoToolBar->mButtons[EMPX5thButton]->release();
- QVERIFY( mController->mViewMode == EDetailsView );
-
- mController->mViewMode = EAudioOnlyView;
- mVideoToolBar->mButtons[EMPX5thButton]->release();
- QVERIFY( mController->mViewMode == EAudioOnlyView );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// testAttach
-// -------------------------------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackToolBar::testAttach()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackToolBar::testAttach()"));
-
- //
- // test when 'attach' operation is enabled
- //
- init( true );
-
- QMPXVideoPlaybackViewFileDetails *details = mController->fileDetails();
- details->mVideoEnabled = false;
- mVideoToolBar->updateWithFileDetails( details );
-
- //
- // release 'attach' button
- //
- mVideoToolBar->mButtons[EMPX1stButton]->release();
-
- //
- // verify the controller attachVideo() slot has been called
- //
- QVERIFY( mController->mCommand == EMPXPbvCmdClose );
- QVERIFY( mController->mAttachVideoDone == true );
-
- //
- // clean up
- //
- cleanup();
-
- //
- // test when 'attach' operation is disabled
- //
- init();
-
- //
- // verify the controller attachVideo() slot is not called
- //
- QVERIFY( mController->mAttachVideoDone == false );
-
- //
- // clean up
- //
- cleanup();
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// testSend
-// -------------------------------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackToolBar::testSend()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackToolBar::testSend()"));
-
- //
- // test when 'share' operation is enabled
- //
- init( false );
-
- QMPXVideoPlaybackViewFileDetails *details = mController->fileDetails();
- details->mVideoEnabled = false;
- mController->mViewMode = EAudioOnlyView;
- mVideoToolBar->updateWithFileDetails( details );
-
- //
- // release 'share' button
- //
- mVideoToolBar->mButtons[EMPX1stButton]->release();
-
- //
- // verify the controller sendVideo() slot has been called
- //
- QVERIFY( mController->mCommand == EMPXPbvCmdPause );
- QVERIFY( mController->mSendVideoDone == true );
-
- //
- // clean up
- //
- cleanup();
-}
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybacktoolbar/stub/inc/hbtoolbar.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
-* 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 HbToolBar
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#ifndef HBTOOLBAR_H_
-#define HBTOOLBAR_H_
-
-#include <hbwidget.h>
-
-class HbAction;
-class QGraphicsLayout;
-class QGraphicsLinearLayout;
-
-class HbToolBar : public HbWidget
-{
- Q_OBJECT
-
- public:
- HbToolBar();
- virtual ~HbToolBar();
-
- public:
- void setVisible( bool visible );
- void setEnabled( bool enabled );
- void setOrientation( int orientation );
- void clearActions();
- void addAction( HbAction *action );
- QGraphicsLayout* layout();
-
- public:
- bool mVisible;
- bool mEnabled;
- QGraphicsLinearLayout *mLayout;
-};
-
-#endif /*HBTOOLBAR_H_*/
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybacktoolbar/stub/inc/hbtoolbutton.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
-* 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 HbToolButton
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#ifndef HbTOOLBUTTON_H_
-#define HbTOOLBUTTON_H_
-
-#include <hbwidget.h>
-
-class HbAction;
-
-class HbToolButton : public HbWidget
-{
- Q_OBJECT
-
- public:
- HbToolButton( HbAction *action );
- virtual ~HbToolButton();
-
- public:
- void press();
- void release();
- bool isEnabled();
-
- signals:
- void pressed();
- void released();
-
- private:
- bool mEnabled;
- HbAction *mAction;
-};
-
-#endif /*HbTOOLBUTTON_H_*/
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybacktoolbar/stub/inc/hbvideobaseplaybackview.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
-* 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: HB Video playback view
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-// This file defines the API for .dll
-
-#ifndef __HBVIDEOBASEPLAYBACKVIEW_H__
-#define __HBVIDEOBASEPLAYBACKVIEW_H__
-
-// Include Files
-#include <QWidget>
-
-
-// Constants
-
-// Forward Declarations
-
-// Class Definitions
-class HbToolBar;
-class RWindow;
-
-class HbVideoBasePlaybackView : public QWidget
-{
- Q_OBJECT
-
- public:
- HbVideoBasePlaybackView();
- virtual ~HbVideoBasePlaybackView();
-
- void hideItems( int item );
- void showItems( int item );
- HbToolBar *toolBar();
- RWindow *getWindow();
-
- public:
- HbToolBar *mToolBar;
-};
-
-#endif // __HBVIDEOBASEPLAYBACKVIEW_H__
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybacktoolbar/stub/inc/mpxvideoplaybackcontrolscontroller.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,162 +0,0 @@
-/*
-* 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 MPXVideoPlaybackControlsController
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_
-#define MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_
-
-// INCLUDES
-#include <qobject>
-#include <mpxplaybackframeworkdefs.h>
-
-#include "mpxvideo_debug.h"
-#include "mpxcommonvideoplaybackview.hrh"
-#include "mpxvideoplaybackviewfiledetails.h"
-
-// FORWARD DECLARATIONS
-
-
-// DATA TYPES
-
-enum TMPXTimerAction
-{
- EMPXTimerCancel,
- EMPXTimerReset
-};
-
-enum TPlaybackViewMode
-{
- EFullScreenView,
- EDetailsView,
- EAudioOnlyView
-};
-
-// CLASS DECLARATION
-class HbVideoBasePlaybackView;
-
-class QMPXVideoPlaybackControlsController : public QObject
-{
- Q_OBJECT
-
- public:
-
- /**
- * constructor.
- */
- QMPXVideoPlaybackControlsController( bool attachOperation );
-
- /**
- * Destructor.
- */
- virtual ~QMPXVideoPlaybackControlsController();
-
- public:
-
- /**
- * Command handling function.
- * Call HandleCommandL() of container
- */
- void handleCommand( TMPXVideoPlaybackViewCommandIds command, int value = 0 );
-
- /**
- * Reset or cancel timers for the controls
- */
- void resetDisappearingTimers( TMPXTimerAction timerAction );
-
- /**
- * Return state
- */
- inline TMPXPlaybackState state();
-
- inline HbVideoBasePlaybackView* view();
-
- /**
- * Return file details
- */
- inline QMPXVideoPlaybackViewFileDetails* fileDetails();
-
- TPlaybackViewMode viewMode();
-
- void changeViewMode( TPlaybackViewMode viewMode, bool transitionEffect = true );
-
- bool isAttachOperation();
-
- private slots:
- void attachVideo();
- void sendVideo();
-
- public:
- QMPXVideoPlaybackViewFileDetails *mFileDetails;
- HbVideoBasePlaybackView *mView;
-
- TMPXPlaybackState mState;
- TPlaybackViewMode mViewMode;
- TMPXTimerAction mTimerAction;
- TMPXVideoPlaybackViewCommandIds mCommand;
- int mCommandValue;
- bool mIsAttachOperation;
- bool mAttachVideoDone;
- bool mSendVideoDone;
-};
-
-// INLINE METHODS
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::state
-// -------------------------------------------------------------------------------------------------
-//
-inline
-TMPXPlaybackState QMPXVideoPlaybackControlsController::state()
-{
- return mState;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::fileDetails
-// -------------------------------------------------------------------------------------------------
-//
-inline
-QMPXVideoPlaybackViewFileDetails* QMPXVideoPlaybackControlsController::fileDetails()
-{
- return mFileDetails;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::viewMode
-// -------------------------------------------------------------------------------------------------
-//
-inline
-TPlaybackViewMode QMPXVideoPlaybackControlsController::viewMode()
-{
- return mViewMode;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::view
-// -------------------------------------------------------------------------------------------------
-//
-inline
-HbVideoBasePlaybackView* QMPXVideoPlaybackControlsController::view()
-{
- return mView;
-}
-
-#endif /*MPXVIDEOPLAYBACKCONTROLSCONTROLLER_P_H_*/
-
-// End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybacktoolbar/stub/inc/mpxvideoplaybackviewfiledetails.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
-* 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: MPX Video File Details (QT)
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-
-#ifndef __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-#define __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-
-#include <qobject.h>
-#include "mpxhelixplaybackplugindefs.h"
-
-
-//
-// CLASS DECLARATION
-//
-class QMPXVideoPlaybackViewFileDetails : public QObject
-{
- public:
- //
- // Constructor
- //
- QMPXVideoPlaybackViewFileDetails();
-
- //
- // Destructor.
- //
- virtual ~QMPXVideoPlaybackViewFileDetails();
-
- //
- // Clear all file details
- //
- void clearFileDetails();
-
- public:
- //
- // Data
- //
- QString mClipName;
- QString mTitle;
- QString mArtist;
- QString mMimeType;
- QString mDescription;
- QString mLocation;
- QString mCopyright;
- QString mLanguage;
- QString mKeywords;
-
- TMPXVideoMode mPlaybackMode;
- bool mSeekable;
- bool mPausableStream;
- bool mAudioEnabled;
- bool mVideoEnabled;
- bool mPartialPlayback;
- bool mRNFormat;
- bool mTvOutConnected;
- bool mDrmProtected;
- bool mMultiItemPlaylist;
-
- int mVideoHeight;
- int mVideoWidth;
- int mBitRate;
- int mDuration;
-};
-
-#endif // __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybacktoolbar/stub/src/hbtoolbar.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,115 +0,0 @@
-/*
-* 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 HbToolBar
-*
-*/
-
-// Version : %version: 1 %
-
-
-#include <QGraphicsLinearLayout>
-
-#include "mpxvideo_debug.h"
-#include "hbtoolbar.h"
-#include "hbtoolbutton.h"
-
-// -------------------------------------------------------------------------------------------------
-// HbToolBar::HbToolBar
-// -------------------------------------------------------------------------------------------------
-//
-HbToolBar::HbToolBar()
- : mVisible( false )
- , mEnabled( false )
-{
- MPX_ENTER_EXIT(_L("HbToolBar::HbToolBar()"));
-
- mLayout = new QGraphicsLinearLayout();
- setLayout( mLayout );
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbToolBar::~HbToolBar
-// -------------------------------------------------------------------------------------------------
-//
-HbToolBar::~HbToolBar()
-{
- MPX_DEBUG(_L("HbToolBar::HbToolBar") );
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbToolBar::setEnabled
-// -------------------------------------------------------------------------------------------------
-//
-void HbToolBar::setEnabled( bool enabled )
-{
- MPX_DEBUG(_L("HbToolBar::setEnabled %d"), enabled );
-
- mEnabled = enabled;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbToolBar::setVisible
-// -------------------------------------------------------------------------------------------------
-//
-void HbToolBar::setVisible( bool visible )
-{
- MPX_DEBUG(_L("HbToolBar::setVisible %d"), visible );
-
- mVisible = visible;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbToolBar::setOrientation
-// -------------------------------------------------------------------------------------------------
-//
-void HbToolBar::setOrientation( int orientation )
-{
- MPX_DEBUG(_L("HbToolBar::setOrientation") );
- Q_UNUSED( orientation );
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbToolBar::clearActions
-// -------------------------------------------------------------------------------------------------
-//
-void HbToolBar::clearActions()
-{
- MPX_DEBUG(_L("HbToolBar::clearActions") );
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbToolBar::addAction
-// -------------------------------------------------------------------------------------------------
-//
-void HbToolBar::addAction( HbAction *action )
-{
- MPX_DEBUG(_L("HbToolBar::addAction") );
- Q_UNUSED( action );
-
- HbToolButton *button = new HbToolButton( action );
- mLayout->addItem( button );
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbToolBar::addAction
-// -------------------------------------------------------------------------------------------------
-//
-QGraphicsLayout* HbToolBar::layout()
-{
- MPX_DEBUG(_L("HbToolBar::layout") );
-
- return mLayout;
-}
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybacktoolbar/stub/src/hbtoolbutton.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-/*
-* 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 HbToolButton
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#include <qgraphicswidget>
-
-#include <hbaction.h>
-#include <hbframedrawer.h>
-
-#include "mpxvideo_debug.h"
-#include "hbtoolbutton.h"
-
-// -------------------------------------------------------------------------------------------------
-// HbToolButton::HbToolButton
-// -------------------------------------------------------------------------------------------------
-//
-HbToolButton::HbToolButton( HbAction *action )
-{
- MPX_ENTER_EXIT(_L("HbToolButton::HbToolButton()"));
-
- mAction = action;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbToolButton::~HbToolButton
-// -------------------------------------------------------------------------------------------------
-//
-HbToolButton::~HbToolButton()
-{
- MPX_DEBUG(_L("HbToolButton::HbToolButton") );
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbToolButton::isEnabled
-// -------------------------------------------------------------------------------------------------
-//
-bool HbToolButton::isEnabled()
-{
- MPX_DEBUG(_L("HbToolButton::isEnabled") );
-
- return mAction->isEnabled();
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbToolButton::press
-// -------------------------------------------------------------------------------------------------
-//
-void HbToolButton::press()
-{
- MPX_DEBUG(_L("HbToolButton::press") );
-
- emit pressed();
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbToolButton::release
-// -------------------------------------------------------------------------------------------------
-//
-void HbToolButton::release()
-{
- MPX_DEBUG(_L("HbToolButton::release") );
-
- emit released();
-}
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybacktoolbar/stub/src/hbvideobaseplaybackview.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-/*
-* 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 Video playback view
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-// Include Files
-
-#include <hbinstance.h>
-#include <coecntrl.h>
-
-#include "hbtoolbar.h"
-#include "hbvideobaseplaybackview.h"
-
-// Member Functions
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoPlaybackView::HbVideoPlaybackView()
-// -------------------------------------------------------------------------------------------------
-//
-HbVideoBasePlaybackView::HbVideoBasePlaybackView()
-{
- mToolBar = new HbToolBar();
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoPlaybackView::~HbVideoPlaybackView()
-// -------------------------------------------------------------------------------------------------
-//
-HbVideoBasePlaybackView::~HbVideoBasePlaybackView()
-{
- if ( mToolBar )
- {
- delete mToolBar;
- mToolBar = NULL;
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::toolBar()
-// -------------------------------------------------------------------------------------------------
-//
-HbToolBar* HbVideoBasePlaybackView::toolBar()
-{
- return mToolBar;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::hideItems()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::hideItems( int item )
-{
- Q_UNUSED( item );
- mToolBar->setVisible( false );
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::hideItems()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::showItems( int item )
-{
- Q_UNUSED( item );
- mToolBar->setVisible( true );
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::getWindow()
-// -------------------------------------------------------------------------------------------------
-//
-RWindow *HbVideoBasePlaybackView::getWindow()
-{
- return static_cast<RWindow*>( hbInstance->allMainWindows()[0]->effectiveWinId()->DrawableWindow() );
-}
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybacktoolbar/stub/src/mpxvideoplaybackcontrolscontroller.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,139 +0,0 @@
-/*
-* 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 MPXVideoPlaybackControlsController
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-// INCLUDE FILES
-
-#include "hbvideobaseplaybackview.h"
-#include "mpxvideoplaybackcontrolscontroller.h"
-
-// ================= MEMBER FUNCTIONS ==============================================================
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController()
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController( bool attachOperation )
- : mViewMode( EFullScreenView )
- , mIsAttachOperation( attachOperation )
- , mAttachVideoDone( false )
- , mSendVideoDone( false )
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController()"));
-
- mFileDetails = new QMPXVideoPlaybackViewFileDetails();
- mView = new HbVideoBasePlaybackView();
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController"));
-
- if ( mFileDetails )
- {
- delete mFileDetails;
- mFileDetails = NULL;
- }
-
- if ( mView )
- {
- delete mView;
- mView = NULL;
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::handleCommand()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::handleCommand(
- TMPXVideoPlaybackViewCommandIds command, int value )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::handleCommand(%d)"), command);
-
- mCommand = command;
- mCommandValue = value;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::changeViewMode
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::changeViewMode(
- TPlaybackViewMode viewMode, bool transitionEffect )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::changeViewMode()"));
-
- Q_UNUSED( transitionEffect );
- mViewMode = viewMode;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::resetDisappearingTimers()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::resetDisappearingTimers( TMPXTimerAction timerAction )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::resetDisappearingTimers()"));
-
- mTimerAction = timerAction;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::isAttachOperation()
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackControlsController::isAttachOperation()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::isAttachOperation() ret %d"),
- mIsAttachOperation);
-
- return mIsAttachOperation;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::attachVideo()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::attachVideo()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::attachVideo()"));
-
- handleCommand( EMPXPbvCmdClose );
- mAttachVideoDone = true;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::sendVideo()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::sendVideo()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::sendVideo()"));
-
- handleCommand( EMPXPbvCmdPause );
- mSendVideoDone = true;
-}
-
-// End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybacktoolbar/stub/src/mpxvideoplaybackviewfiledetails.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
-* 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: class for MPX Video File Details (Qt)
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-//
-// INCLUDE FILES
-//
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackviewfiledetails.h"
-
-
-// ============================ MEMBER FUNCTIONS ===================================================
-
-QMPXVideoPlaybackViewFileDetails::QMPXVideoPlaybackViewFileDetails()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::QMPXVideoPlaybackViewFileDetails()"));
-
- clearFileDetails();
-}
-
-QMPXVideoPlaybackViewFileDetails::~QMPXVideoPlaybackViewFileDetails()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::~QMPXVideoPlaybackViewFileDetails()"));
-
- clearFileDetails();
-}
-
-void
-QMPXVideoPlaybackViewFileDetails::clearFileDetails()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::ClearFileDetails()"));
-
- mMimeType = tr("");
- mTitle = tr("");
- mArtist = tr("");
- mClipName = tr("");
- mDescription = tr("");
- mLocation = tr("");
- mCopyright = tr("");
- mLanguage = tr("");
- mKeywords = tr("");
-
- mPlaybackMode = EMPXVideoLocal;
- mSeekable = false;
- mPausableStream = false;
- mAudioEnabled = false;
- mVideoEnabled = false;
- mPartialPlayback = false;
- mRNFormat = false;
-
- mDuration = 0;
- mTvOutConnected = false;
- mDrmProtected = false;
-
- mVideoHeight = 0;
- mVideoWidth = 0;
- mBitRate = 0;
-}
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybacktoolbar/testmpxvideoplaybacktoolbar.pro Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-#
-# 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: Project file for building testmpxvideoplaybacktoolbar
-#
-#
-# Version : %version: 1 %
-
-TEMPLATE = app
-TARGET = testmpxvideoplaybacktoolbar
-CONFIG += qtestlib qt hb
-
-INCLUDEPATH += stub/inc \
- ../../../../inc \
- ../../../inc
-
-
-DEPENDPATH += inc src stub/inc stub/src
-
-# Input
-HEADERS += testmpxvideoplaybacktoolbar.h \
- mpxvideoplaybackcontrolscontroller.h \
- mpxvideoplaybackviewfiledetails.h \
- hbvideobaseplaybackview.h \
- hbtoolbar.h \
- hbtoolbutton.h \
- ../../controlinc/mpxvideoplaybacktoolbar.h
-
-SOURCES += testmpxvideoplaybacktoolbar.cpp \
- mpxvideoplaybackcontrolscontroller.cpp \
- mpxvideoplaybackviewfiledetails.cpp \
- hbvideobaseplaybackview.cpp \
- hbtoolbar.cpp \
- hbtoolbutton.cpp \
- ../../controlsrc/mpxvideoplaybacktoolbar.cpp
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/inc/testmpxvideoviewwrapper.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +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: tester for methods in Video Playback View Plugin
-*
-*/
-
-#ifndef __TESTMPXVIDEOVIEWWRAPPER_H__
-#define __TESTMPXVIDEOVIEWWRAPPER_H__
-
-
-// INCLUDES
-#include <QtTest/QtTest>
-
-class CMPXVideoViewWrapper;
-class HbVideoBasePlaybackView;
-
-class TestMPXVideoViewWrapper : public QObject
-{
- Q_OBJECT
-
- public:
-
- /**
- * will be called before each testfunction is executed.
- *
- */
- void init();
-
- /**
- * will be called after every testfunction.
- *
- */
- void cleanup();
-
- 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();
- void testHandleCommand();
- void testHandlePluginError();
- void testHandlePlaybackMessage();
- void testSetProperty();
- void testHandleProperty();
- void testRetrieveFileNameAndMode();
- void testActivateClosePlayerActiveObject();
- void testDoClosePlayer();
- void testSetAspectRatio();
- void testIsAppInFront();
- void testClosePlaybackView();
- void testHandleVolumeCmd();
- void testHandleShortPressBackward();
- void testIssueVideoAppForegroundCmd();
- void testCreateControls();
- void testIsMultiItemPlaylist();
- void testUpdateVideoRect();
- void testUpdateVideoRectDone();
- void testHandleBufferingState();
- void testHandleVideoPlaybackMessage();
- void testHandlePlaybackCommandComplete();
- void testHandleMedia();
-
- signals:
- void commandSignal(int);
-
- private:
- CMPXVideoViewWrapper *mVideoViewWrapper;
- HbVideoBasePlaybackView *mBaseVideoView;
-};
-
-#endif // __TESTMPXVIDEOVIEWWRAPPER_H__
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/src/testmpxvideoviewwrapper.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,833 +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: tester for methods in VideoSortFilterProxyModel
-*
-*/
-
-// Version : %version: 9 %
-
-#include <e32err.h>
-#include <w32std.h>
-
-#include <hbapplication.h>
-#include <hbinstance.h>
-#include <QDebug>
-
-#include <mpxplaybackframeworkdefs.h>
-#include <mpxplaybackutility.h>
-#include <mpxcommonvideoplaybackview.hrh>
-#include <mpxmessagegeneraldefs.h>
-#include <mpxplaybackmessage.h>
-#include <mpxmediageneraldefs.h>
-#include <mpxmediavideodefs.h>
-
-#include "testmpxvideoviewwrapper.h"
-
-#include "../stub/inc/hbvideobaseplaybackview.h"
-#include "../stub/inc/mpxvideoplaybackviewfiledetails.h"
-#include "../stub/inc/mpxvideoplaybackdisplayhandler.h"
-#include "../stub/inc/mpxvideoplaybackcontrolscontroller.h"
-
-
-#define protected public
-#include "mpxvideoviewwrapper.h"
-#undef protected
-
-
-// ---------------------------------------------------------------------------
-// main
-// ---------------------------------------------------------------------------
-//
-int main(int argc, char *argv[])
-{
- HbApplication app(argc, argv);
- HbMainWindow window;
-
- TestMPXVideoViewWrapper tv;
-
- char *pass[3];
- pass[0] = argv[0];
- pass[1] = "-o";
- 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 );
-}
-
-// ---------------------------------------------------------------------------
-// cleanup
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoViewWrapper::cleanup()
-{
- if ( mVideoViewWrapper )
- {
- delete mVideoViewWrapper;
- mVideoViewWrapper = NULL;
- }
-
- if ( mBaseVideoView )
- {
- delete mBaseVideoView;
- mBaseVideoView = NULL;
- }
-}
-
-void TestMPXVideoViewWrapper::testRequestMedia()
-{
- init();
-
- TRAPD(err, mVideoViewWrapper->RequestMediaL());
- QVERIFY( err == KErrNone );
-
- QVERIFY( mVideoViewWrapper->iMediaRequestStatus == MediaRequested );
-
- cleanup();
-}
-
-void TestMPXVideoViewWrapper::testIsLive()
-{
- init();
-
- TRAPD(err, mVideoViewWrapper->RequestMediaL());
- QVERIFY( err == KErrNone );
-
- mVideoViewWrapper->iFileDetails->mPlaybackMode = EMPXVideoLiveStreaming;
- QVERIFY( mVideoViewWrapper->IsLive() );
-
- mVideoViewWrapper->iFileDetails->mPlaybackMode = EMPXVideoLocal;
- QVERIFY( ! mVideoViewWrapper->IsLive() );
-
- cleanup();
-}
-
-void TestMPXVideoViewWrapper::testIsPlaylist()
-{
- init();
-
- mVideoViewWrapper->iPlaylistView = true;
- QVERIFY( mVideoViewWrapper->IsPlaylist() == true );
-
- mVideoViewWrapper->iPlaylistView = false;
- QVERIFY( mVideoViewWrapper->IsPlaylist() == false );
-
- cleanup();
-}
-
-void TestMPXVideoViewWrapper::testHandleCommand()
-{
- init();
-
- TRAPD( errReqMedia, mVideoViewWrapper->RequestMediaL() );
- QVERIFY( errReqMedia == KErrNone );
-
- //
- // Test 'Play' command
- //
- TRAPD( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdPlay ) );
- QVERIFY( errHdlCmd == KErrNone );
- QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdPlay );
-
- //
- // 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 );
-
- //
- // 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
- //
- mVideoViewWrapper->iPlaybackState = EPbStatePlaying;
- TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdPlayPause ) );
- QVERIFY( errHdlCmd == KErrNone );
- QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdPause );
-
- mVideoViewWrapper->iPlaybackState = EPbStatePaused;
- TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdPlayPause ) );
- QVERIFY( errHdlCmd == KErrNone );
- QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdPlay );
-
- //
- // 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 );
-
- //
- // 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();
-
- TRAPD(errReqMedia, mVideoViewWrapper->RequestMediaL());
- QVERIFY( errReqMedia == KErrNone );
-
- mVideoViewWrapper->HandlePluginError( KErrNotSupported );
-
- QVERIFY( mVideoViewWrapper->iView->mCurrentError == KErrNotSupported );
-
- cleanup();
-}
-
-void TestMPXVideoViewWrapper::testHandlePlaybackMessage()
-{
- init();
-
- //***************************
- // Test Video Msg
- //***************************
- CMPXMessage* message = NULL;
- TRAP_IGNORE(
- message = CMPXMessage::NewL();
- message->SetTObjectValueL<TMPXMessageId>( KMPXMessageGeneralId, KMPXMediaIdVideoPlayback );
- message->SetTObjectValueL<TMPXVideoPlaybackCommand>
- ( KMPXMediaVideoPlaybackCommand, EPbCmdTvOutEvent );
- message->SetTObjectValueL<TInt>( KMPXMediaVideoTvOutConnected, ETrue );
- );
- mVideoViewWrapper->HandlePlaybackMessage( message, KErrNone );
- QVERIFY( mVideoViewWrapper->iFileDetails->mTvOutConnected );
- if ( message )
- {
- delete message;
- message = NULL;
- }
-
- //***************************
- // Test General Msg
- //***************************
- TRAP_IGNORE(
- message = CMPXMessage::NewL();
- message->SetTObjectValueL<TMPXMessageId>( KMPXMessageGeneralId, KMPXMessageGeneral );
- message->SetTObjectValueL<TInt>( KMPXMessageGeneralEvent, 28 ); // EReachedEndOfPlaylist = 28
- message->SetTObjectValueL<TInt>( KMPXMessageGeneralType, 0 );
- message->SetTObjectValueL<TInt>( KMPXMessageGeneralData, 0 );
- );
- mVideoViewWrapper->HandlePlaybackMessage( message, KErrNone );
- QVERIFY( ! mVideoViewWrapper->iView->mViewActive );
- if ( message )
- {
- delete message;
- message = NULL;
- }
-
- //***************************
- // Test Video Msg with err
- //***************************
- TRAP_IGNORE( message = CMPXMessage::NewL() );
- mVideoViewWrapper->HandlePlaybackMessage( message, KErrNotFound );
- QVERIFY( mVideoViewWrapper->iView->mCurrentError == KErrNotFound );
- if ( message )
- {
- delete message;
- message = NULL;
- }
-
- cleanup();
-}
-
-void TestMPXVideoViewWrapper::testSetProperty()
-{
- init();
-
- 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 );
-
- //
- // 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::testRetrieveFileNameAndMode()
-{
- init();
-
- mVideoViewWrapper->iFileDetails->clearFileDetails();
-
- CMPXCommand* cmd = NULL;
-
- TRAP_IGNORE( cmd = CMPXCommand::NewL() );
-
- 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->DoClosePlayer());
- QVERIFY( err == KErrNone );
-
- QVERIFY( ! mVideoViewWrapper->iView->mViewActive );
-
- cleanup();
-}
-
-void TestMPXVideoViewWrapper::testSetAspectRatio()
-{
- init();
- TRAPD( errReqMedia, mVideoViewWrapper->RequestMediaL() );
- QVERIFY( errReqMedia == KErrNone );
-
- TRAPD( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdStretchAspectRatio ) );
- QVERIFY( errHdlCmd == KErrNone );
-
- 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() );
-
- 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() );
- QVERIFY( errReqMedia == KErrNone );
-
- TRAPD( errIssuePlay, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdPlay ) );
- QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdPlay );
- QVERIFY( errIssuePlay == KErrNone );
-
- 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() );
- QVERIFY( errReqMedia == KErrNone );
-
- TRAPD( errIssuePlay, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdPlay ) );
- QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdPlay );
- QVERIFY( errIssuePlay == KErrNone );
-
- 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() );
- QVERIFY( errReqMedia == KErrNone );
-
- TRAPD( errIssuePlay, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdPlay ) );
- QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdPlay );
-
- QVERIFY( errIssuePlay == KErrNone );
-
- //
- // 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 );
-
- 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();
-
- CMPXMessage* message = NULL;
- TRAP_IGNORE(
- message = CMPXMessage::NewL();
- message->SetTObjectValueL<TMPXMessageId>( KMPXMessageGeneralId, KMPXMediaIdVideoPlayback );
- message->SetTObjectValueL<TMPXVideoPlaybackCommand>
- ( KMPXMediaVideoPlaybackCommand, EPbCmdPluginError );
- message->SetTObjectValueL<TInt>( KMPXMediaVideoError, KErrNotSupported );
- );
-
- mVideoViewWrapper->HandleVideoPlaybackMessage( message );
-
- QCOMPARE( mVideoViewWrapper->iView->mCurrentError, KErrNotSupported );
- if ( message )
- {
- delete message;
- message = NULL;
- }
-
- cleanup();
-}
-
-void TestMPXVideoViewWrapper::testHandlePlaybackCommandComplete()
-{
- init();
-
- CMPXCommand* cmd = NULL;
-
- TRAP_IGNORE( cmd = CMPXCommand::NewL() );
-
- mVideoViewWrapper->HandlePlaybackCommandComplete( cmd, KErrNone );
-
- QVERIFY( mVideoViewWrapper );
-
- delete cmd;
- cmd = NULL;
-
- cleanup();
-}
-
-void TestMPXVideoViewWrapper::testHandleMedia()
-{
- init();
-
- CMPXMedia* media = NULL;
-
- //
- // Error case
- //
- TRAP_IGNORE(
- RArray<TInt> suppIds;
- CleanupClosePushL( suppIds );
- suppIds.AppendL( KMPXMediaIdGeneral );
- suppIds.AppendL( KMPXMediaIdVideo );
-
- media = CMPXMedia::NewL( suppIds.Array() );
- CleanupStack::PopAndDestroy( &suppIds );
-
- media->SetTObjectValueL<TInt>( TMPXAttribute( KMPXMediaVideoError ), KErrCancel );
- );
-
- 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<TInt> 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<TInt> 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
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/hbvideobaseplaybackview.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +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: HB Video playback view
-*
-*/
-
-// Version : %version: 5 %
-
-
-
-// This file defines the API for .dll
-
-#ifndef __HBVIDEOBASEPLAYBACKVIEW_H__
-#define __HBVIDEOBASEPLAYBACKVIEW_H__
-
-// Include Files
-#include <hbview.h>
-
-class CMPXVideoViewWrapper;
-class RWindow;
-
-// Constants
-
-// Forward Declarations
-
-// Class Definitions
-
-class HbVideoBasePlaybackView : public HbView
-{
- Q_OBJECT
-
- public:
- HbVideoBasePlaybackView();
- virtual ~HbVideoBasePlaybackView();
-
- void handleActivateView();
-
- void handleDeactivateView();
-
- void mousePressEvent( QGraphicsSceneMouseEvent *event );
-
- QVariant itemChange( GraphicsItemChange change, const QVariant &value );
-
- void paint( QPainter *painter,
- const QStyleOptionGraphicsItem *option,
- QWidget *widget );
-
- bool event( QEvent *event );
-
- virtual void handleClosePlaybackView();
-
- virtual void handleBufferingState();
-
- virtual void issuePlayCommand();
-
- virtual void handlePluginError( int aError );
-
- virtual void retrievePdlInformation();
-
- virtual void closePlaybackView();
-
- void startClosingPlaybackView();
-
- RWindow *getWindow();
-
- virtual void doClosePlayer();
-
- void handleStoppedState();
-
- signals:
- void tappedOnScreen();
-
- public slots:
- void handleClosePopupDialog();
-
- public:
- int mCurrentError; // default = KErrNone
- bool mViewActive;
- bool mSyncClose;
-
-
- public:
- friend class CMPXVideoViewWrapper;
-
-};
-
-#endif // __HBVIDEOBASEPLAYBACKVIEW_H__
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxplaybackutility.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,111 +0,0 @@
-/*
-* 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 <e32base.h>
-#include <mpxcommand.h>
-#include <mpxattributespecs.h>
-#include <mpxplaybackcommanddefs.h>
-#include <mpxplaybackframeworkdefs.h>
-
-class TMPXAttribute;
-class MMPXPlaybackObserver;
-class CMPXCollectionPlaylist;
-class MMPXPlaybackCallback;
-class CMPXPlaybackUtility;
-
-class MMPXSource
-{
- public:
- virtual CMPXCollectionPlaylist* PlaylistL() = 0;
-
- virtual void MediaL( const TArray<TMPXAttribute>& 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<TMPXAttribute>& aAttrs,
- MMPXPlaybackCallback& aCallback,
- CMPXAttributeSpecs* aSpecs );
-
- void SetPrimaryClientL();
-};
-
-#endif // CMPXPLAYBACKUTILITY_H
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackcontrol.hrh Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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_*/
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackcontrolscontroller.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +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 MPXVideoPlaybackControlsController
-*
-*/
-
-// Version : %version: 7 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_
-#define MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_
-
-// INCLUDES
-#include <qobject>
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackcontrol.hrh"
-
-// FORWARD DECLARATIONS
-class CMPXVideoViewWrapper;
-class HbVideoBasePlaybackView;
-class QMPXVideoPlaybackControlsController;
-class QMPXVideoPlaybackViewFileDetails;
-
-// CLASS DECLARATION
-
-class QMPXVideoPlaybackControlsController : public QObject
-{
- Q_OBJECT
-
- public:
-
- /**
- * constructor.
- */
- QMPXVideoPlaybackControlsController(
- HbVideoBasePlaybackView *view,
- CMPXVideoViewWrapper *viewWrapper,
- QMPXVideoPlaybackViewFileDetails *details );
-
- /**
- * Destructor.
- */
- virtual ~QMPXVideoPlaybackControlsController();
-
- public:
-
- //
- // Handle event from container
- //
- void handleEvent( TMPXVideoPlaybackControlCommandIds event, int value = 0 );
-
- //
- // Add the file details to the controls controller when available
- //
- void addFileDetails( QMPXVideoPlaybackViewFileDetails* details );
-
- //
- // updateVideoRectDone
- //
- void updateVideoRectDone();
-
- bool isRNLogoBitmapInControlList();
-
- public:
- HbVideoBasePlaybackView *mView;
- CMPXVideoViewWrapper *mViewWrapper;
- QMPXVideoPlaybackViewFileDetails *mFileDetails;
- TMPXVideoPlaybackControlCommandIds mReceivedEvent;
-
- int mValue;
- bool mRNLogoVisible;
- bool mFileDetailsAdded;
-};
-
-#endif /*MPXVIDEOPLAYBACKCONTROLSCONTROLLER_P_H_*/
-
-// End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackdisplayhandler.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +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 video playback display handler
-*
-*/
-
-// Version : %version: 6 %
-
-
-#ifndef __CMPXVIDEOPLAYBACKDISPLAYHANDLER_H__
-#define __CMPXVIDEOPLAYBACKDISPLAYHANDLER_H__
-
-// INCLUDES
-
-#include <mpxmessage2.h>
-#include <mmfscalingcustomcommandconstants.h>
-#include <mpxvideoplaybackdefs.h>
-#include <mediaclientvideodisplay.h>
-
-
-//
-// CLASS DECLARATION
-//
-class MMPXPlaybackUtility;
-class CMPXVideoViewWrapper;
-class QMPXVideoPlaybackViewFileDetails;
-
-/*
- * CMPXVideoPlaybackDisplayHandler
- *
- */
-class CMPXVideoPlaybackDisplayHandler : public CBase
-{
- public:
-
- ~CMPXVideoPlaybackDisplayHandler();
-
- static CMPXVideoPlaybackDisplayHandler* NewL( MMPXPlaybackUtility* aPlayUtil,
- CMPXVideoViewWrapper* aViewWrapper );
-
- void CreateDisplayWindowL( RWsSession& aWs,
- CWsScreenDevice& aScreenDevice,
- RWindow& aWin,
- TRect aDisplayRect );
-
- void RemoveDisplayWindow();
-
- void HandleVideoDisplayMessageL( CMPXMessage* aMessage );
-
- TInt SetAspectRatioL( TMPXVideoPlaybackCommand aCmd );
-
- TInt SetDefaultAspectRatioL( QMPXVideoPlaybackViewFileDetails* aFileDetails,
- TReal32 aDisplayAspectRatio );
-
- void UpdateVideoRectL( TRect aRect, TBool transitionEffect );
-
- private:
-
- CMPXVideoPlaybackDisplayHandler( MMPXPlaybackUtility* aPlayUtil,
- CMPXVideoViewWrapper* aViewWrapper );
-
- void ConstructL();
-
- public:
- MMPXPlaybackUtility* iPlaybackUtility;
- CMPXVideoViewWrapper* iViewWrapper;
- CMediaClientVideoDisplay* iVideoDisplay;
-
- TRect iRect;
- TInt iAspectRatio;
- TInt iCommand;
-};
-
-#endif // __CMPXVIDEOPLAYBACKDISPLAYHANDLER_H__
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackuserinputhandler.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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 MPXVideoPlaybackUserInputHandler
-*
-*/
-
-// Version : %version: 4 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKUSERINPUTHANDLER_H_
-#define MPXVIDEOPLAYBACKUSERINPUTHANDLER_H_
-
-// INCLUDES
-
-
-// FORWARD DECLARATIONS
-class CMPXVideoViewWrapper;
-
-// CLASS DECLARATION
-
-class CMPXVideoPlaybackUserInputHandler : public CBase
-{
- public: // Constructors and destructor
-
- /**
- * Two-phased constructor.
- */
- IMPORT_C static CMPXVideoPlaybackUserInputHandler* NewL(
- CMPXVideoViewWrapper* aWrapper, TBool aTvOutConnected );
-
- /**
- * Destructor.
- */
- IMPORT_C virtual ~CMPXVideoPlaybackUserInputHandler();
-
- private:
-
- /**
- * C++ default constructor.
- */
- CMPXVideoPlaybackUserInputHandler( CMPXVideoViewWrapper* aWrapper );
-
- /**
- * Symbian 2nd phase constructor.
- */
- void ConstructL( TBool aTvOutConnected );
-
- public:
- void ProcessKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
-
- void SetForeground( TBool aForeground );
-
- void HandleTVOutEventL(TBool aTVOutConnected);
-
- private:
- TBool iTVOutConnected; // Flag to indicate if TV is connected
- TBool iForeground;
- CMPXVideoViewWrapper* iViewWrapper;
-};
-
-
-#endif /*MPXVIDEOPLAYBACKUSERINPUTHANDLER_H_*/
-
-// End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackviewfiledetails.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +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: MPX Video File Details (QT)
-*
-*/
-
-// Version : %version: 5 %
-
-
-
-
-#ifndef __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-#define __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-
-#include <qobject.h>
-#include "mpxhelixplaybackplugindefs.h"
-
-
-//
-// CLASS DECLARATION
-//
-class QMPXVideoPlaybackViewFileDetails : public QObject
-{
- public:
- //
- // Constructor
- //
- QMPXVideoPlaybackViewFileDetails();
-
- //
- // Destructor.
- //
- virtual ~QMPXVideoPlaybackViewFileDetails();
-
- //
- // Clear all file details
- //
- void clearFileDetails();
-
- public:
- //
- // Data
- //
- QString mClipName;
- QString mTitle;
- QString mArtist;
- QString mMimeType;
- QString mDescription;
- QString mLocation;
- QString mCopyright;
- QString mLanguage;
- QString mKeywords;
-
- TMPXVideoMode mPlaybackMode;
- bool mSeekable;
- bool mPausableStream;
- bool mAudioEnabled;
- bool mVideoEnabled;
- bool mPartialPlayback;
- bool mRNFormat;
- bool mTvOutConnected;
- bool mDrmProtected;
- bool mMultiItemPlaylist;
-
- int mVideoHeight;
- int mVideoWidth;
- int mBitRate;
- int mDuration;
- int mCreationTime;
- int mModificationTime;
-};
-
-#endif // __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/hbvideobaseplaybackview.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,211 +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 Video playback view
-*
-*/
-
-// Version : %version: 7 %
-
-
-
-// Include Files
-#include <aknappui.h>
-#include <qgraphicssceneevent>
-#include <hbinstance.h>
-#include <mmf/common/mmferrors.h>
-
-#include "../inc/hbvideobaseplaybackview.h"
-
-
-// Member Functions
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoPlaybackView::HbVideoPlaybackView()
-// -------------------------------------------------------------------------------------------------
-//
-HbVideoBasePlaybackView::HbVideoBasePlaybackView()
-{
- mCurrentError = KErrNone;
- mViewActive = false;
- mSyncClose = false;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoPlaybackView::~HbVideoPlaybackView()
-// -------------------------------------------------------------------------------------------------
-//
-HbVideoBasePlaybackView::~HbVideoBasePlaybackView()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::handleActivateView()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::handleActivateView()
-{
- mViewActive = true;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::handleDeactivateView()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::handleDeactivateView()
-{
- mViewActive = false;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::mousePress
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::mousePressEvent( QGraphicsSceneMouseEvent *event )
-{
- Q_UNUSED( event );
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::itemChange
-// -------------------------------------------------------------------------------------------------
-//
-QVariant HbVideoBasePlaybackView::itemChange( GraphicsItemChange change, const QVariant &value )
-{
- return QGraphicsWidget::itemChange( change, value );
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::closePlaybackView()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::paint( QPainter *painter,
- const QStyleOptionGraphicsItem *option,
- QWidget *widget )
-{
- Q_UNUSED( painter );
- Q_UNUSED( option );
- Q_UNUSED( widget );
-}
-
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::event()
-// -------------------------------------------------------------------------------------------------
-//
-bool HbVideoBasePlaybackView::event( QEvent *event )
-{
- Q_UNUSED( event );
- bool consumed = false;
-
- return consumed;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::handleClosePlaybackView()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::handleClosePlaybackView()
-{
- mViewActive = false;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::issuePlayCommand
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::issuePlayCommand()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::handleBufferingState
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::handleBufferingState()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::handlePluginError()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::handlePluginError( int aError )
-{
- mCurrentError = aError;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::doClosePlayer
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::doClosePlayer()
-{
- mViewActive = false;
-}
-
-
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::retrievePdlInformation
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::retrievePdlInformation()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::closePlaybackView()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::closePlaybackView()
-{
- mViewActive = false;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::startClosingPlaybackView()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::startClosingPlaybackView()
-{
- mViewActive = false;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::getWindow()
-// -------------------------------------------------------------------------------------------------
-//
-RWindow *HbVideoBasePlaybackView::getWindow()
-{
- return static_cast<RWindow*>( hbInstance->allMainWindows()[0]->effectiveWinId()->DrawableWindow() );
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::handleClosePopupDialog()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::handleClosePopupDialog()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::handleStoppedState()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::handleStoppedState()
-{
-
-}
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxplaybackutility.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,212 +0,0 @@
-/*
-* 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: Factory method to create playback utility object
-*
-*/
-
-#include <bamdesca.h>
-#include <s32mem.h>
-#include <e32math.h>
-#include <mpxcmn.h>
-#include <mpxplaybackobserver.h>
-#include <mpxcollectionplaylist.h>
-#include <mpxmedia.h>
-#include <mpxmessagemonitor.h>
-#include <mpxtaskqueue.h>
-#include <mpxuser.h>
-#include <mpxmessagegeneraldefs.h>
-#include <mpxcommandgeneraldefs.h>
-#include <mpxcollectionpath.h>
-#include <mpxvideoplaybackdefs.h>
-
-#include"mpxplaybackutility.h"
-
-
-// ============================== MEMBER FUNCTIONS =================================================
-
-// -------------------------------------------------------------------------------------------------
-// Creates the playback utility object if not already created
-// -------------------------------------------------------------------------------------------------
-//
-MMPXPlaybackUtility* MMPXPlaybackUtility::UtilityL( const TMPXCategory /*aCategory*/,
- const TUid& /*aModeId*/ )
-{
- return CMPXPlaybackUtility::NewL();
-}
-
-// -------------------------------------------------------------------------------------------------
-// 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
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::ConstructL()
-{
- iState = EPbStateInitialised;
-}
-
-// -------------------------------------------------------------------------------------------------
-// Add a observer
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::AddObserverL( MMPXPlaybackObserver& /*aObs*/ )
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// Remove a observer
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::RemoveObserverL( MMPXPlaybackObserver& /* aObs */ )
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// Delete this
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::Close()
-{
- delete this;
-}
-
-// -------------------------------------------------------------------------------------------------
-// Issue player commands
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::CommandL( TMPXPlaybackCommand aCmd )
-{
- iCommand = aCmd;
-}
-
-// -------------------------------------------------------------------------------------------------
-// Issue player commands
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::CommandL( CMPXCommand& aCmd, MMPXPlaybackCallback* /* aCallback */ )
-{
- TInt cmdType = aCmd.ValueTObjectL<TInt>( KMPXCommandGeneralId );
-
- if ( cmdType == KMPXCommandIdPlaybackGeneral )
- {
- iCommand = aCmd.ValueTObjectL<TInt>( KMPXCommandPlaybackGeneralType );
- }
- else
- {
- iCommand = aCmd.ValueTObjectL<TInt>( KMPXMediaVideoPlaybackCommand );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// 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;
-}
-
-// -------------------------------------------------------------------------------------------------
-// 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<TMPXAttribute>& /* aAttrs */,
- MMPXPlaybackCallback& /* aCallback */,
- CMPXAttributeSpecs* /* aSpecs */)
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// set primary client
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::SetPrimaryClientL()
-{
-}
-
-// End of file
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxvideoplaybackcontrolscontroller.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +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 MPXVideoPlaybackControlsController
-*
-*/
-
-// Version : %version: 8 %
-
-
-
-// INCLUDE FILES
-
-#include "mpxvideoviewwrapper.h"
-#include "hbvideobaseplaybackview.h"
-#include "mpxvideoplaybackviewfiledetails.h"
-#include "../inc/mpxvideoplaybackcontrolscontroller.h"
-
-
-// ================= MEMBER FUNCTIONS ==============================================================
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController()
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController(
- HbVideoBasePlaybackView *view,
- CMPXVideoViewWrapper *viewWrapper,
- QMPXVideoPlaybackViewFileDetails *details )
- : mView( view )
- , mViewWrapper( viewWrapper )
- , mFileDetails( details )
- , mFileDetailsAdded( false )
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::addFileDetails()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::addFileDetails(
- QMPXVideoPlaybackViewFileDetails* details )
-{
- Q_UNUSED( details );
-
- mFileDetailsAdded = true;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::handleEvent
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::handleEvent(
- TMPXVideoPlaybackControlCommandIds event, int value )
-{
- mReceivedEvent = event;
- mValue = value;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::updateVideoRectDone
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::updateVideoRectDone()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::isRNLogoBitmapVisible()
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackControlsController::isRNLogoBitmapInControlList()
-{
- return mRNLogoVisible;
-}
-
-// End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxvideoplaybackdisplayhandler.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,161 +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 video playback display handler
-*
-*/
-
-// Version : %version: 7 %
-
-#include <sysutil.h>
-#include <s32file.h>
-#include <mpxcommand.h>
-#include <mpxcommandgeneraldefs.h>
-#include <mpxplaybackutility.h>
-#include <mpxvideoplaybackdefs.h>
-
-#include "mpxvideoviewwrapper.h"
-#include "mpxvideoplaybackdisplayhandler.h"
-#include "mpxvideoregion.h"
-#include "mpxvideoplaybackviewfiledetails.h"
-
-
-CMPXVideoPlaybackDisplayHandler::CMPXVideoPlaybackDisplayHandler( MMPXPlaybackUtility* aPlayUtil,
- CMPXVideoViewWrapper* aViewWrapper )
- : iPlaybackUtility( aPlayUtil )
- , iViewWrapper( aViewWrapper )
-{
-}
-
-CMPXVideoPlaybackDisplayHandler::~CMPXVideoPlaybackDisplayHandler()
-{
-}
-
-CMPXVideoPlaybackDisplayHandler*
-CMPXVideoPlaybackDisplayHandler::NewL( MMPXPlaybackUtility* aPlayUtil,
- CMPXVideoViewWrapper* aViewWrapper )
-{
- MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::NewL()"));
-
- CMPXVideoPlaybackDisplayHandler* self =
- new(ELeave) CMPXVideoPlaybackDisplayHandler( aPlayUtil, aViewWrapper );
-
- CleanupStack::PushL( self );
- self->ConstructL();
- CleanupStack::Pop();
- return self;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackDisplayHandler::ConstructL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::ConstructL()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackDisplayHandler::CreateDisplayWindowL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::CreateDisplayWindowL(
- RWsSession& aWs,
- CWsScreenDevice& aScreenDevice,
- RWindow& aWin,
- TRect aDisplayRect )
-{
- Q_UNUSED( aWs );
- Q_UNUSED( aScreenDevice );
- Q_UNUSED( aWin );
- Q_UNUSED( aDisplayRect );
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackDisplayHandler::RemoveDisplayWindow()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::RemoveDisplayWindow()
-{
- if ( iVideoDisplay )
- {
- delete iVideoDisplay;
- iVideoDisplay = NULL;
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackDisplayHandler::HandleVideoDisplayMessageL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::HandleVideoDisplayMessageL( CMPXMessage* /*aMessage*/ )
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackDisplayHandler::SetAspectRatioL()
-// -------------------------------------------------------------------------------------------------
-//
-TInt CMPXVideoPlaybackDisplayHandler::SetAspectRatioL( TMPXVideoPlaybackCommand aCmd )
-{
- iCommand = aCmd;
-
- switch ( aCmd )
- {
- case EPbCmdNaturalAspectRatio:
- {
- iAspectRatio = EMMFNatural;
- break;
- }
- case EPbCmdZoomAspectRatio:
- {
- iAspectRatio = EMMFZoom;
- break;
- }
- case EPbCmdStretchAspectRatio:
- {
- iAspectRatio = EMMFStretch;
- break;
- }
- }
-
- return iAspectRatio;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackDisplayHandler::SetDefaultAspectRatioL
-// -------------------------------------------------------------------------------------------------
-//
-TInt CMPXVideoPlaybackDisplayHandler::SetDefaultAspectRatioL(
- QMPXVideoPlaybackViewFileDetails* aFileDetails,
- TReal32 aDisplayAspectRatio )
-{
- Q_UNUSED( aFileDetails );
- Q_UNUSED( aDisplayAspectRatio );
-
- return iAspectRatio;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackDisplayHandler::UpdateVideoRectL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::UpdateVideoRectL( TRect aClipRect, TBool transitionEffect )
-{
- MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::UpdateVideoRectL()"));
-
- Q_UNUSED( transitionEffect );
-
- iRect = aClipRect;
-}
-
-// End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxvideoplaybackuserinputhandler.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,118 +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 playback view's input handler
-*
-*/
-
-// Version : %version: 6 %
-
-
-// INCLUDE FILES
-#include <qobject>
-#include <e32std.h>
-#include <w32std.h> // RWindowBase
-#include <e32base.h>
-#include <eikclbd.h>
-#include <aknconsts.h>
-#include <mpxplaybackframeworkdefs.h>
-#include <hwrmlightdomaincrkeys.h>
-#include <mpxvideoplaybackdefs.h>
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoviewwrapper.h"
-#include "mpxcommonvideoplaybackview.hrh"
-#include "../inc/mpxvideoplaybackuserinputhandler.h"
-
-
-// CONSTANTS
-const TInt KMPXMicroSecondsInASecond = 1000000;
-
-
-// ======== MEMBER FUNCTIONS =======================================================================
-
-// -------------------------------------------------------------------------------------------------
-// MPXVideoPlaybackUserInputHandler::CMPXVideoPlaybackUserInputHandler()
-// -------------------------------------------------------------------------------------------------
-//
-CMPXVideoPlaybackUserInputHandler::CMPXVideoPlaybackUserInputHandler( CMPXVideoViewWrapper* aWrapper )
- : iViewWrapper( aWrapper )
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::NewL()
-// -------------------------------------------------------------------------------------------------
-//
-CMPXVideoPlaybackUserInputHandler* CMPXVideoPlaybackUserInputHandler::NewL(
- CMPXVideoViewWrapper* aWrapper, TBool aTvOutConnected )
-{
- MPX_DEBUG(_L("CMPXVideoPlaybackUserInputHandler::NewL()"));
-
- CMPXVideoPlaybackUserInputHandler* self =
- new (ELeave) CMPXVideoPlaybackUserInputHandler( aWrapper );
- CleanupStack::PushL( self );
- self->ConstructL( aTvOutConnected );
- CleanupStack::Pop();
- return self;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::ConstructL
-// Symbian 2nd phase constructor can leave.
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackUserInputHandler::ConstructL( TBool aTvOutConnected )
-{
- Q_UNUSED( aTvOutConnected );
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::~CMPXVideoPlaybackUserInputHandler()
-// -------------------------------------------------------------------------------------------------
-//
-CMPXVideoPlaybackUserInputHandler::~CMPXVideoPlaybackUserInputHandler()
-{
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::ProcessKeyEvent()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackUserInputHandler::ProcessKeyEventL( const TKeyEvent& aKeyEvent,
- TEventCode aType )
-{
- Q_UNUSED( aKeyEvent );
- Q_UNUSED( aType );
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::SetForeground()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackUserInputHandler::SetForeground(TBool aForeground)
-{
- Q_UNUSED( aForeground );
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::HandleTVOutEvent()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackUserInputHandler::HandleTVOutEventL( TBool aTVOutConnected )
-{
- Q_UNUSED( aTVOutConnected );
-}
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxvideoplaybackviewfiledetails.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +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: class for MPX Video File Details (Qt)
-*
-*/
-
-// Version : %version: 5 %
-
-
-
-//
-// INCLUDE FILES
-//
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackviewfiledetails.h"
-
-
-// ============================ MEMBER FUNCTIONS ===================================================
-
-QMPXVideoPlaybackViewFileDetails::QMPXVideoPlaybackViewFileDetails()
-{
- clearFileDetails();
-}
-
-QMPXVideoPlaybackViewFileDetails::~QMPXVideoPlaybackViewFileDetails()
-{
- clearFileDetails();
-}
-
-void
-QMPXVideoPlaybackViewFileDetails::clearFileDetails()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::ClearFileDetails()"));
-
- mMimeType = tr("");
- mTitle = tr("");
- mArtist = tr("");
- mDescription = tr("");
- mLocation = tr("");
- mCopyright = tr("");
- mLanguage = tr("");
- mKeywords = tr("");
-
- mClipName = QString("testClip.3gp");
-
- mPlaybackMode = EMPXVideoLocal;
- mSeekable = false;
- mPausableStream = false;
- mAudioEnabled = true;
- mVideoEnabled = false;
- mPartialPlayback = false;
- mRNFormat = false;
-
- mDuration = 0;
- mTvOutConnected = false;
- mDrmProtected = false;
- mMultiItemPlaylist = false;
-
- mVideoHeight = 0;
- mVideoWidth = 0;
- mBitRate = 0;
- mCreationTime = 0;
- mModificationTime = 0;
-}
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/testmpxvideoviewwrapper.pro Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +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 testmpxvideoviewwrapper
-#
-#
-# Version : %version: 6 %
-
-
-TEMPLATE = app
-TARGET = testmpxvideoviewwrapper
-CONFIG += qtestlib hb qt
-
-DEPENDPATH += inc src stub/src stub/inc
-
-INCLUDEPATH += stub/inc \
- ../inc \
- ../../inc \
- ../../../inc \
- ../../../../inc \
- $$MW_LAYER_SYSTEMINCLUDE
-
-LIBS += -lmpxcommon.dll \
- -lflogger.dll \
- -lmpxcollectionutility.dll \
- -lcone.dll \
- -lws32.dll
-
-# Input
-HEADERS += testmpxvideoviewwrapper.h \
- stub/inc/hbvideobaseplaybackview.h \
- mpxvideoplaybackuserinputhandler.h \
- mpxvideoplaybackcontrolscontroller.h \
- mpxvideoplaybackviewfiledetails.h \
- mpxplaybackutility.h \
- ../../viewinc/mpxvideoviewwrapper.h
-
-SOURCES += testmpxvideoviewwrapper.cpp \
- stub/src/hbvideobaseplaybackview.cpp \
- mpxvideoplaybackdisplayhandler.cpp \
- mpxvideoplaybackviewfiledetails.cpp \
- mpxvideoplaybackcontrolscontroller.cpp \
- mpxplaybackutility.cpp \
- mpxvideoplaybackuserinputhandler.cpp \
- ../../viewsrc/mpxvideoviewwrapper.cpp
--- a/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/inc/testprogressbar.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-/**
-* 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: tester for methods in TestMPXVideoPlaybackButtonBar
-*
-*/
-
-// Version : %version: 2 %
-
-#ifndef __TESTPROGRESSBAR_H__
-#define __TESTPROGRESSBAR_H__
-
-
-// INCLUDES
-#include <QtTest/QtTest>
-
-class QMPXVideoPlaybackProgressBar;
-class QMPXVideoPlaybackControlsController;
-
-class TestProgressBar : public QObject
-{
- Q_OBJECT
-
-public:
-
- /**
- * will be called before each testfunction is executed.
- *
- */
- void init();
-
- /**
- * will be called after every testfunction.
- *
- */
- void cleanup();
-
- void setup();
-
- // test functions for the test framework
-private slots:
- void testHandleSliderPressed();
- void testHandleSliderMoved();
- void testHandleSliderReleased();
- void testUpdateWithFileDetails();
- void testUpdateState();
- void testDurationChanged();
- void testPositionChanged();
- void testHandleSeekingTimeout();
-
-signals:
- void commandSignal();
-
-private:
- QMPXVideoPlaybackProgressBar* mProgBar;
- QMPXVideoPlaybackControlsController* mController;
-};
-
-
-#endif // __TESTPROGRESSBAR_H__
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/src/testprogressbar.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,415 +0,0 @@
-/**
-* 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: tester for methods in TestMPXVideoPlaybackButtonBar
-*
-*/
-
-// Version : %version: 6 %
-
-
-#include <qdebug>
-#include <hbmainwindow.h>
-#include <hbapplication.h>
-#include <qgraphicssceneevent>
-#include <hbprogressslider.h>
-
-
-#include "testprogressbar.h"
-#include "mpxvideoplaybackviewfiledetails.h"
-#include "mpxvideoplaybackcontrolscontroller.h"
-
-#define private public
-#include "mpxvideoplaybackprogressbar.h"
-#undef private
-
-// -------------------------------------------------------------------------------------------------
-// main
-// -------------------------------------------------------------------------------------------------
-//
-int main(int argc, char *argv[])
-{
- MPX_ENTER_EXIT(_L("TestProgressBar::Main()"));
-
- HbApplication app(argc, argv);
- HbMainWindow window;
-
- TestProgressBar tv;
-
- char *pass[3];
- pass[0] = argv[0];
- pass[1] = "-o";
- pass[2] = "c:\\data\\testprogressbar.txt";
-
- int res = QTest::qExec(&tv, 3, pass);
-
- return res;
-}
-
-
-// -------------------------------------------------------------------------------------------------
-// init
-// -------------------------------------------------------------------------------------------------
-//
-void TestProgressBar::init()
-{
- MPX_ENTER_EXIT(_L("TestProgressBar::init()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// setup
-// -------------------------------------------------------------------------------------------------
-//
-void TestProgressBar::setup()
-{
- MPX_ENTER_EXIT(_L("TestProgressBar::setup()"));
-
- mController = new QMPXVideoPlaybackControlsController();
- mProgBar = new QMPXVideoPlaybackProgressBar( mController );
-
- mProgBar->initialize();
-}
-
-// -------------------------------------------------------------------------------------------------
-// cleanup
-// -------------------------------------------------------------------------------------------------
-//
-void TestProgressBar::cleanup()
-{
- MPX_ENTER_EXIT(_L("TestProgressBar::cleanup()"));
-
- if ( mController )
- {
- delete mController;
- mController = NULL;
- }
-
- if ( mProgBar )
- {
- delete mProgBar;
- mProgBar = NULL;
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// testHandleSliderPressed
-// -------------------------------------------------------------------------------------------------
-//
-void TestProgressBar::testHandleSliderPressed()
-{
- MPX_ENTER_EXIT(_L("TestProgressBar::testHandleSliderPressed()"));
-
- setup();
-
- //
- // If it is playing state
- //
- mController->mState = EPbStatePlaying;
-
- emit mProgBar->mProgressSlider->press();
-
- QVERIFY( mController->mTimerAction == EMPXTimerCancel );
- QVERIFY( mController->mCommand == EMPXPbvCmdCustomPause );
- QVERIFY( mProgBar->mSliderDragging );
- QVERIFY( mProgBar->mNeedToResumeAfterSetPosition );
-
- //
- // If it is pause state
- //
- mController->mState = EPbStatePaused;
- mController->mCommand = EMPXPbvCmdStop;
-
- emit mProgBar->mProgressSlider->press();
-
- QVERIFY( mController->mTimerAction == EMPXTimerCancel );
- QVERIFY( mController->mCommand == EMPXPbvCmdStop );
- QVERIFY( mProgBar->mSliderDragging );
- QVERIFY( mProgBar->mNeedToResumeAfterSetPosition );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// testHandleSliderReleased
-// -------------------------------------------------------------------------------------------------
-//
-void TestProgressBar::testHandleSliderReleased()
-{
- MPX_ENTER_EXIT(_L("TestProgressBar::testHandleSliderReleased()"));
-
- setup();
-
- //
- // Moved position >= duration
- //
- mProgBar->mDuration = 120;
- mProgBar->mProgressSlider->mSliderValue = 130;
- mController->mTimerAction = EMPXTimerCancel;
- mController->mCommand = EMPXPbvCmdStop;
-
- emit mProgBar->mProgressSlider->release();
- QVERIFY( mController->mTimerAction == EMPXTimerReset );
- QVERIFY( ! mProgBar->mSliderDragging );
- QVERIFY( mController->mCommand == EMPXPbvCmdEndOfClip );
-
- //
- // Moved position < 0
- //
- mProgBar->mProgressSlider->mSliderValue = -1;
- mController->mTimerAction = EMPXTimerCancel;
- mController->mCommand = EMPXPbvCmdStop;
- mController->mValue = 100;
-
- emit mProgBar->mProgressSlider->release();
- QVERIFY( mController->mTimerAction == EMPXTimerReset );
- QVERIFY( ! mProgBar->mSliderDragging );
- QVERIFY( mController->mCommand == EMPXPbvCmdSetPosition );
- QVERIFY( mController->mValue == 0 );
-
- //
- // 0 <= moved position < duration
- //
- mProgBar->mProgressSlider->mSliderValue = 60;
- mController->mTimerAction = EMPXTimerCancel;
- mController->mCommand = EMPXPbvCmdStop;
-
- emit mProgBar->mProgressSlider->release();
- QVERIFY( mController->mTimerAction == EMPXTimerReset );
- QVERIFY( ! mProgBar->mSliderDragging );
- QVERIFY( mController->mCommand == EMPXPbvCmdSetPosition );
- QVERIFY( mController->mValue == mProgBar->mProgressSlider->mSliderValue );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// testHandleSliderMoved
-// -------------------------------------------------------------------------------------------------
-//
-void TestProgressBar::testHandleSliderMoved()
-{
- MPX_ENTER_EXIT(_L("TestProgressBar::testHandleSliderMoved()"));
-
- setup();
-
- //
- // If user is dragging the slider
- //
- int movedPositoin = 5;
- mProgBar->mDuration = 20;
- mProgBar->mSliderDragging = true;
- emit mProgBar->mProgressSlider->move( movedPositoin );
-
- QVERIFY( mProgBar->mDraggingPosition == movedPositoin );
- QVERIFY( mProgBar->mProgressSlider->progressValue() == movedPositoin );
- QVERIFY( mProgBar->mProgressSlider->sliderValue() == movedPositoin );
-
- //
- // If user isnot dragging the slider and movedPosition > mDuration
- //
- movedPositoin = 30;
- mProgBar->mSliderDragging = false;
-
- emit mProgBar->mProgressSlider->move( movedPositoin );
-
- QVERIFY( mProgBar->mProgressSlider->progressValue() == mProgBar->mDuration );
- QVERIFY( mProgBar->mProgressSlider->sliderValue() == mProgBar->mDuration );
- QVERIFY( mController->mCommand == EMPXPbvCmdEndOfClip );
-
- //
- // If user isnot dragging the slider and movedPosition < mDuration
- //
- movedPositoin = 10;
-
- emit mProgBar->mProgressSlider->move( movedPositoin );
-
- QVERIFY( mProgBar->mProgressSlider->progressValue() == movedPositoin );
- QVERIFY( mProgBar->mProgressSlider->sliderValue() == movedPositoin );
-
- QVERIFY( mController->mCommand == EMPXPbvCmdSetPosition );
- QVERIFY( mController->mValue == movedPositoin );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// testUpdateWithFileDetails
-// -------------------------------------------------------------------------------------------------
-//
-void TestProgressBar::testUpdateWithFileDetails()
-{
- MPX_ENTER_EXIT(_L("TestProgressBar::testUpdateWithFileDetails()"));
-
- setup();
-
- //
- // pausable + non seekable
- //
- mController->mFileDetails->mPausableStream = true;
- mController->mFileDetails->mSeekable = false;
- mProgBar->updateWithFileDetails( mController->mFileDetails );
- QVERIFY( ! mProgBar->mProgressSlider->isEnabled() );
-
- //
- // 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->mPausableStream = true;
- mController->mFileDetails->mSeekable = true;
- mProgBar->updateWithFileDetails( mController->mFileDetails );
- QVERIFY( mProgBar->mProgressSlider->isEnabled() );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// testUpdateState
-// -------------------------------------------------------------------------------------------------
-//
-void TestProgressBar::testUpdateState()
-{
- MPX_ENTER_EXIT(_L("TestProgressBar::testUpdateState()"));
-
- setup();
-
- // test for 1st block of cases
- mProgBar->updateState( EPbStatePlaying );
- QVERIFY( mProgBar->mProgressSlider->isEnabled() );
-
- // test for 2nd block of cases
- mProgBar->updateState( EPbStateBuffering );
- QVERIFY( ! mProgBar->mProgressSlider->isEnabled() );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// testDurationChanged
-// -------------------------------------------------------------------------------------------------
-//
-void TestProgressBar::testDurationChanged()
-{
- MPX_ENTER_EXIT(_L("TestProgressBar::testDurationChanged()"));
-
- setup();
-
- int duration = 120;
- mProgBar->durationChanged( duration );
-
- QVERIFY( mProgBar->mDuration == duration );
- QVERIFY( mProgBar->mProgressSlider->maximum() == duration );
- QVERIFY( mProgBar->mProgressSlider->maxText() == "2:00" );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// testPositionChanged
-// -------------------------------------------------------------------------------------------------
-//
-void TestProgressBar::testPositionChanged()
-{
- MPX_ENTER_EXIT(_L("TestProgressBar::testPositionChanged()"));
-
- setup();
-
- //
- // position < duration
- //
- int position = 60;
- int duration = 120;
- mProgBar->durationChanged( duration );
-
- mProgBar->mSliderDragging = false;
- mProgBar->positionChanged( position );
-
- QVERIFY( mProgBar->mProgressSlider->minText() == "1:00" );
- QVERIFY( mProgBar->mProgressSlider->sliderValue() == position );
- QVERIFY( mProgBar->mProgressSlider->progressValue() == position );
-
- //
- // position > duration
- //
- position = 130;
-
- mProgBar->positionChanged( position );
-
- QVERIFY( mProgBar->mProgressSlider->minText() == "2:00" );
- QVERIFY( mProgBar->mProgressSlider->sliderValue() == duration );
- QVERIFY( mProgBar->mProgressSlider->progressValue() == duration );
-
- //
- // position < 0
- //
- position = -1;
-
- mProgBar->positionChanged( position );
-
- QVERIFY( mProgBar->mProgressSlider->minText() == "0:00" );
- QVERIFY( mProgBar->mProgressSlider->sliderValue() == 0 );
- QVERIFY( mProgBar->mProgressSlider->progressValue() == 0 );
-
- //
- // duration >= 1 hour
- //
- duration = 3600;
- mProgBar->durationChanged( duration );
-
- position = 5;
- mProgBar->positionChanged( position );
-
- QVERIFY( mProgBar->mProgressSlider->minText() == "0:00:05" );
- QVERIFY( mProgBar->mProgressSlider->sliderValue() == position );
- QVERIFY( mProgBar->mProgressSlider->progressValue() == position );
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// testHandleSeekingTimeout
-// -------------------------------------------------------------------------------------------------
-//
-void TestProgressBar::testHandleSeekingTimeout()
-{
- MPX_ENTER_EXIT(_L("TestProgressBar::testHandleSeekingTimeout()"));
-
- setup();
-
- mProgBar->mDraggingPosition = 10;
- mProgBar->mDuration = 30;
- mProgBar->mSetPosition = 0;
-
- connect( this, SIGNAL( commandSignal() ), mProgBar, SLOT( handleSeekingTimeout() ) );
- emit commandSignal();
-
- QVERIFY( mController->mCommand == EMPXPbvCmdSetPosition );
- QVERIFY( mController->mValue == mProgBar->mDraggingPosition );
-
- cleanup();
-}
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/stub/inc/hbprogressslider.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-/*
-* 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 HbProgressSlider
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#ifndef HBPROGRESSSLIDER_H_
-#define HBPROGRESSSLIDER_H_
-
-#include <hbwidget.h>
-#include <hbstyle.h>
-
-class QGraphicsItem;
-
-class HbProgressSlider : public HbWidget
-{
- Q_OBJECT
-
- public:
- HbProgressSlider();
- virtual ~HbProgressSlider();
-
- public:
- void setRange( int minimum, int maximum );
-
- void setMaxText( const QString &text );
- QString maxText();
-
- void setMinText( const QString &text );
- QString minText();
-
- void setProgressValue( int value );
- void setSliderValue( int value );
-
- int sliderValue();
- int progressValue();
-
- int maximum();
-
- public:
- void press();
- void release();
- void move( int value );
-
- signals:
- void sliderPressed();
- void sliderReleased();
- void sliderMoved( int value );
-
- public:
- int mSliderValue;
- int mProgressValue;
- int mMax;
- int mMin;
-
- QString mMaxText;
- QString mMinText;
-};
-
-#endif /*HBPROGRESSSLIDER_H_*/
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/stub/inc/mpxvideoplaybackcontrolscontroller.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,138 +0,0 @@
-/*
-* 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 MPXVideoPlaybackControlsController
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_
-#define MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_
-
-// INCLUDES
-#include <qobject>
-
-#include <mpxplaybackframeworkdefs.h>
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackcontrol.hrh"
-#include "mpxcommonvideoplaybackview.hrh"
-#include "mpxvideoplaybackviewfiledetails.h"
-
-// FORWARD DECLARATIONS
-class QMPXVideoPlaybackDocumentLoader;
-class QMPXVideoPlaybackControlsController;
-
-
-// DATA TYPES
-
-enum TMPXTimerAction
-{
- EMPXTimerCancel,
- EMPXTimerReset
-};
-
-enum TPlaybackViewMode
-{
- EFullScreenView,
- EDetailsView,
- EAudioOnlyView
-};
-
-
-// CLASS DECLARATION
-
-class QMPXVideoPlaybackControlsController : public QObject
-{
- Q_OBJECT
-
- public:
-
- /**
- * constructor.
- */
- QMPXVideoPlaybackControlsController();
-
- /**
- * Destructor.
- */
- virtual ~QMPXVideoPlaybackControlsController();
-
- public:
- /**
- * Initialize controller
- */
- void initializeController();
-
- /**
- * Command handling function.
- * Call HandleCommandL() of container
- */
- void handleCommand( TMPXVideoPlaybackViewCommandIds command, int value = 0 );
-
- /**
- * Reset or cancel timers for the controls
- */
- void resetDisappearingTimers( TMPXTimerAction timerAction );
-
- /**
- * Return state
- */
- inline TMPXPlaybackState state();
-
- /**
- * Return file details
- */
- inline QMPXVideoPlaybackViewFileDetails* fileDetails();
-
- QMPXVideoPlaybackDocumentLoader* layoutLoader();
-
- TPlaybackViewMode viewMode();
-
- public:
- QMPXVideoPlaybackViewFileDetails *mFileDetails;
- QMPXVideoPlaybackDocumentLoader *mLoader;
- TMPXPlaybackState mState;
- TPlaybackViewMode mViewMode;
- TMPXTimerAction mTimerAction;
- TMPXVideoPlaybackViewCommandIds mCommand;
- int mValue;
-};
-
-// INLINE METHODS
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::state
-// -------------------------------------------------------------------------------------------------
-//
-inline
-TMPXPlaybackState QMPXVideoPlaybackControlsController::state()
-{
- return mState;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::fileDetails
-// -------------------------------------------------------------------------------------------------
-//
-inline
-QMPXVideoPlaybackViewFileDetails* QMPXVideoPlaybackControlsController::fileDetails()
-{
- return mFileDetails;
-}
-
-#endif /*MPXVIDEOPLAYBACKCONTROLSCONTROLLER_P_H_*/
-
-// End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/stub/inc/mpxvideoplaybackdocumentloader.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackDocumentLoader
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKDOCUMENTHANDLER_H_
-#define MPXVIDEOPLAYBACKDOCUMENTHANDLER_H_
-
-
-#include <qobject>
-
-class QList;
-class QGraphicsWidget;
-class QMPXVideoPlaybackControlsController;
-
-class QMPXVideoPlaybackDocumentLoader : public QObject
-{
- public:
- QMPXVideoPlaybackDocumentLoader();
-
- virtual ~QMPXVideoPlaybackDocumentLoader();
-
- public:
- QGraphicsWidget* findWidget( const QString &name );
-
- private:
- QGraphicsWidget* createWidget( const QString &name );
- int exist( const QString &name );
-
- private:
- QList<QGraphicsWidget*> mWidgets;
-};
-
-#endif /*MPXVIDEOPLAYBACKDOCUMENTHANDLER_H_*/
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/stub/inc/mpxvideoplaybackviewfiledetails.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
-* 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: MPX Video File Details (QT)
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-
-#ifndef __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-#define __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-
-#include <qobject.h>
-#include "mpxhelixplaybackplugindefs.h"
-
-
-//
-// CLASS DECLARATION
-//
-class QMPXVideoPlaybackViewFileDetails : public QObject
-{
- public:
- //
- // Constructor
- //
- QMPXVideoPlaybackViewFileDetails();
-
- //
- // Destructor.
- //
- virtual ~QMPXVideoPlaybackViewFileDetails();
-
- //
- // Clear all file details
- //
- void clearFileDetails();
-
- public:
- //
- // Data
- //
- QString mClipName;
- QString mTitle;
- QString mArtist;
- QString mMimeType;
- QString mDescription;
- QString mLocation;
- QString mCopyright;
- QString mLanguage;
- QString mKeywords;
-
- TMPXVideoMode mPlaybackMode;
- bool mSeekable;
- bool mPausableStream;
- bool mAudioEnabled;
- bool mVideoEnabled;
- bool mPartialPlayback;
- bool mRNFormat;
- bool mTvOutConnected;
- bool mDrmProtected;
- bool mMultiItemPlaylist;
-
- int mVideoHeight;
- int mVideoWidth;
- int mBitRate;
- int mDuration;
-};
-
-#endif // __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/stub/src/hbprogressslider.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,187 +0,0 @@
-/*
-* 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 HbProgressSlider
-*
-*/
-
-// Version : %version: 1 %
-
-#include <qgraphicswidget>
-
-#include "mpxvideo_debug.h"
-#include "hbprogressslider.h"
-
-// -------------------------------------------------------------------------------------------------
-// HbProgressSlider::HbProgressSlider
-// -------------------------------------------------------------------------------------------------
-//
-HbProgressSlider::HbProgressSlider()
-{
- MPX_ENTER_EXIT(_L("HbProgressSlider::HbProgressSlider()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbProgressSlider::~HbProgressSlider
-// -------------------------------------------------------------------------------------------------
-//
-HbProgressSlider::~HbProgressSlider()
-{
- MPX_DEBUG(_L("HbProgressSlider::HbProgressSlider") );
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbProgressSlider::setRange
-// -------------------------------------------------------------------------------------------------
-//
-void HbProgressSlider::setRange( int minimum, int maximum )
-{
- MPX_DEBUG(_L("HbProgressSlider::setRange"));
-
- mMax = maximum;
- mMin = minimum;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbProgressSlider::setMaxText
-// -------------------------------------------------------------------------------------------------
-//
-void HbProgressSlider::setMaxText( const QString &text )
-{
- MPX_DEBUG(_L("HbProgressSlider::setMaxText") );
-
- mMaxText = text;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbProgressSlider::maxText
-// -------------------------------------------------------------------------------------------------
-//
-QString HbProgressSlider::maxText()
-{
- MPX_DEBUG(_L("HbProgressSlider::maxText") );
-
- return mMaxText;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbProgressSlider::setMinText
-// -------------------------------------------------------------------------------------------------
-//
-void HbProgressSlider::setMinText( const QString &text )
-{
- MPX_DEBUG(_L("HbProgressSlider::setMinText") );
-
- mMinText = text;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbProgressSlider::minText
-// -------------------------------------------------------------------------------------------------
-//
-QString HbProgressSlider::minText()
-{
- MPX_DEBUG(_L("HbProgressSlider::minText") );
-
- return mMinText;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbProgressSlider::setProgressValue
-// -------------------------------------------------------------------------------------------------
-//
-void HbProgressSlider::setProgressValue( int value )
-{
- MPX_DEBUG(_L("HbProgressSlider::setProgressValue") );
-
- mProgressValue = value;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbProgressSlider::setSliderValue
-// -------------------------------------------------------------------------------------------------
-//
-void HbProgressSlider::setSliderValue( int value )
-{
- MPX_DEBUG(_L("HbProgressSlider::setSliderValue") );
-
- mSliderValue = value;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbProgressSlider::sliderValue
-// -------------------------------------------------------------------------------------------------
-//
-int HbProgressSlider::sliderValue()
-{
- MPX_DEBUG(_L("HbProgressSlider::sliderValue") );
-
- return mSliderValue;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbProgressSlider::progressValue
-// -------------------------------------------------------------------------------------------------
-//
-int HbProgressSlider::progressValue()
-{
- MPX_DEBUG(_L("HbProgressSlider::progressValue") );
-
- return mProgressValue;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbProgressSlider::maximum
-// -------------------------------------------------------------------------------------------------
-//
-int HbProgressSlider::maximum()
-{
- MPX_DEBUG(_L("HbProgressSlider::maximum") );
-
- return mMax;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbProgressSlider::press
-// -------------------------------------------------------------------------------------------------
-//
-void HbProgressSlider::press()
-{
- MPX_DEBUG(_L("HbProgressSlider::press") );
-
- emit sliderPressed();
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbProgressSlider::release
-// -------------------------------------------------------------------------------------------------
-//
-void HbProgressSlider::release()
-{
- MPX_DEBUG(_L("HbProgressSlider::release") );
-
- emit sliderReleased();
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbProgressSlider::move
-// -------------------------------------------------------------------------------------------------
-//
-void HbProgressSlider::move( int value )
-{
- MPX_DEBUG(_L("HbProgressSlider::move") );
-
- emit sliderMoved( value );
-}
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/stub/src/mpxvideoplaybackcontrolscontroller.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,124 +0,0 @@
-/*
-* Copyright (c) 20010 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 MPXVideoPlaybackControlsController
-*
-*/
-
-// Version : %version:3 %
-
-
-
-// INCLUDE FILES
-
-
-#include "mpxvideoplaybackdocumentloader.h"
-#include "mpxvideoplaybackviewfiledetails.h"
-#include "mpxvideoplaybackcontrolscontroller.h"
-
-#include "mpxvideoplaybackcontrolconfiguration.h"
-
-
-// ================= MEMBER FUNCTIONS ==============================================================
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController()
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController") );
-
- initializeController();
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::initializeController()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::initializeController()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::initializeController") );
-
- mLoader = new QMPXVideoPlaybackDocumentLoader();
- mFileDetails = new QMPXVideoPlaybackViewFileDetails();
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController"));
-
- if ( mLoader )
- {
- delete mLoader;
- mLoader = NULL;
- }
-
- if ( mFileDetails )
- {
- delete mFileDetails;
- mFileDetails = NULL;
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::resetDisappearingTimers()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::resetDisappearingTimers( TMPXTimerAction timerAction )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::resetDisappearingTimers") );
-
- mTimerAction = timerAction;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::handleCommand()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::handleCommand(
- TMPXVideoPlaybackViewCommandIds command, int value )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::handleCommand") );
-
- mCommand = command;
- mValue = value;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::layoutLoader
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackDocumentLoader* QMPXVideoPlaybackControlsController::layoutLoader()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::layoutLoader") );
-
- return mLoader;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::viewMode
-// -------------------------------------------------------------------------------------------------
-//
-TPlaybackViewMode QMPXVideoPlaybackControlsController::viewMode()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::viewMode") );
-
- return mViewMode;
-}
-
-// End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/stub/src/mpxvideoplaybackdocumentloader.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,123 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackDocumentLoader
-*
-*/
-
-// Version : %version: 2 %
-
-
-#include <hbwidget.h>
-#include <hbtransparentwindow.h>
-#include <hbprogressslider.h>
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackdocumentloader.h"
-#include "hblabel.h"
-
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::QMPXVideoPlaybackDocumentLoader
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackDocumentLoader::QMPXVideoPlaybackDocumentLoader()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackDocumentLoader::QMPXVideoPlaybackDocumentLoader()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::~QMPXVideoPlaybackDocumentLoader
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackDocumentLoader::~QMPXVideoPlaybackDocumentLoader()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::QMPXVideoPlaybackDocumentLoader") );
-
- for ( int i = 0 ; i < mWidgets.count() ; i++ )
- {
- mWidgets.removeAt( 0 );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::findWidget()
-// -------------------------------------------------------------------------------------------------
-//
-QGraphicsWidget *QMPXVideoPlaybackDocumentLoader::findWidget( const QString &name )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::findWidget") );
-
- QGraphicsWidget *object = NULL;
-
- int index = exist( name );
-
- if ( index == -1 )
- {
- object = createWidget( name );
- }
- else
- {
- object = mWidgets[ index ];
- }
-
- return object;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::createWidget()
-// -------------------------------------------------------------------------------------------------
-//
-QGraphicsWidget *QMPXVideoPlaybackDocumentLoader::createWidget( const QString &name )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::createWidget") );
-
- QGraphicsWidget *object = NULL;
-
- if ( name == "progressSlider" )
- {
- object = new HbProgressSlider();
- object->setObjectName( name );
- mWidgets.append( object );
- }
-
- return object;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::exist()
-// -------------------------------------------------------------------------------------------------
-//
-int QMPXVideoPlaybackDocumentLoader::exist( const QString &name )
-{
- int i = 0;
-
- for ( ; i < mWidgets.count() ; i++ )
- {
- if( mWidgets[i]->objectName() == name )
- {
- break;
- }
- }
-
- if ( i == mWidgets.count() )
- {
- i = -1;
- }
-
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::exist %d"), i );
-
- return i;
-}
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/stub/src/mpxvideoplaybackviewfiledetails.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
-* 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: class for MPX Video File Details (Qt)
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-//
-// INCLUDE FILES
-//
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackviewfiledetails.h"
-
-
-// ============================ MEMBER FUNCTIONS ===================================================
-
-QMPXVideoPlaybackViewFileDetails::QMPXVideoPlaybackViewFileDetails()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::QMPXVideoPlaybackViewFileDetails()"));
-
- clearFileDetails();
-}
-
-QMPXVideoPlaybackViewFileDetails::~QMPXVideoPlaybackViewFileDetails()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::~QMPXVideoPlaybackViewFileDetails()"));
-
- clearFileDetails();
-}
-
-void
-QMPXVideoPlaybackViewFileDetails::clearFileDetails()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::ClearFileDetails()"));
-
- mMimeType = tr("");
- mTitle = tr("");
- mArtist = tr("");
- mClipName = tr("");
- mDescription = tr("");
- mLocation = tr("");
- mCopyright = tr("");
- mLanguage = tr("");
- mKeywords = tr("");
-
- mPlaybackMode = EMPXVideoLocal;
- mSeekable = false;
- mPausableStream = false;
- mAudioEnabled = false;
- mVideoEnabled = false;
- mPartialPlayback = false;
- mRNFormat = false;
-
- mDuration = 100;
- mTvOutConnected = false;
- mDrmProtected = false;
-
- mVideoHeight = 0;
- mVideoWidth = 0;
- mBitRate = 0;
-}
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/testprogressbar.pro Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-#
-# 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: Project file for building testprogressbar
-#
-#
-# Version : %version: 2 %
-
-TEMPLATE = app
-TARGET = testprogressbar
-CONFIG += qtestlib qt hb
-
-INCLUDEPATH += stub/inc \
- ../../../../inc \
- ../../../inc
-
-
-DEPENDPATH += stub/inc stub/src inc src
-
-# Input
-HEADERS += testprogressbar.h \
- mpxvideoplaybackcontrolscontroller.h \
- mpxvideoplaybackdocumentloader.h \
- mpxvideoplaybackviewfiledetails.h \
- hbprogressslider.h \
- ../../controlinc/mpxvideoplaybackprogressbar.h
-
-SOURCES += testprogressbar.cpp \
- mpxvideoplaybackcontrolscontroller.cpp \
- mpxvideoplaybackdocumentloader.cpp \
- mpxvideoplaybackviewfiledetails.cpp \
- hbprogressslider.cpp \
- ../../controlsrc/mpxvideoplaybackprogressbar.cpp
--- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/inc/teststatuspanecontrol.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-/**
-* 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: test module for QMPXVideoPlaybackStatusPaneControl
-*
-*/
-
-// Version : %version: 1 %
-
-
-#ifndef __TESTSTATUSPANECONTROL_H__
-#define __TESTSTATUSPANECONTROL_H__
-
-
-// INCLUDES
-#include <QtTest/QtTest>
-
-class HbVideoBasePlaybackView;
-class QMPXVideoPlaybackViewFileDetails;
-class QMPXVideoPlaybackControlsController;
-class QMPXVideoPlaybackStatusPaneControl;
-
-
-
-class TestStatusPaneControl : public QObject
-{
- Q_OBJECT
-
-public:
-
- /**
- * will be called before each testfunction is executed.
- *
- */
- void init();
-
- /**
- * will be called after every testfunction.
- *
- */
- void cleanup();
-
- // test functions for the test framework
-
-
- void setup();
-
-private slots:
- void testSetVisible();
- void testSetMenu();
- void testUpdateControlsWithFileDetails();
- void testSetVisibility();
- void testControlListUpdated();
- void testSlot_handleAboutToShow();
- void testSlot_handleAboutToHide();
- void testSlot_openFullScreenView();
-
-signals:
- void commandSignal();
-
-private:
- HbVideoBasePlaybackView* mBaseVideoView;
- QMPXVideoPlaybackViewFileDetails* mFileDetails;
- QMPXVideoPlaybackControlsController* mControlsController;
- QMPXVideoPlaybackStatusPaneControl* mStatusPane;
-};
-
-
-#endif // __TESTSTATUSPANECONTROL_H__
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/src/teststatuspanecontrol.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,321 +0,0 @@
-/**
-* 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: tester for methods in status pane control
-*
-*/
-
-// Version : %version: 6 %
-
-
-#include <hbapplication.h>
-#include <hbinstance.h>
-#include <hbmenu.h>
-#include <QDebug>
-
-
-#include "mpxvideoplaybackcontrol.hrh"
-#include "mpxhelixplaybackplugindefs.h"
-
-#include "teststatuspanecontrol.h"
-
-#include "mpxvideoplaybackviewfiledetails.h"
-#include "mpxvideoplaybackcontrolscontroller.h"
-#include "hbvideobaseplaybackview.h"
-#include "mpxvideoplaybackdocumentloader.h"
-#include "hblabel.h"
-#include "hbgroupbox.h"
-
-#define private public
-#define protected public
-#include "mpxvideoplaybackstatuspanecontrol.h"
-#undef protected
-#undef private
-
-
-// ---------------------------------------------------------------------------
-// main
-// ---------------------------------------------------------------------------
-//
-int main(int argc, char *argv[])
-{
- MPX_ENTER_EXIT(_L("TestStatusPaneControl::Main()"));
-
- HbApplication app(argc, argv);
- HbMainWindow window;
-
- TestStatusPaneControl tv;
-
- char *pass[3];
- pass[0] = argv[0];
- pass[1] = "-o";
- pass[2] = "c:\\data\\TestStatusPaneControl.txt";
-
- int res = QTest::qExec(&tv, 3, pass);
-
- return res;
-}
-
-// ---------------------------------------------------------------------------
-// init
-// ---------------------------------------------------------------------------
-//
-void TestStatusPaneControl::init()
-{
- MPX_ENTER_EXIT(_L("TestStatusPaneControl::init()"));
-}
-
-// ---------------------------------------------------------------------------
-// main
-// ---------------------------------------------------------------------------
-//
-void TestStatusPaneControl::setup()
-{
- MPX_ENTER_EXIT(_L("TestStatusPaneControl::setup()"));
-
- mBaseVideoView = new HbVideoBasePlaybackView();
-
- mFileDetails = new QMPXVideoPlaybackViewFileDetails();
-
- mControlsController = new QMPXVideoPlaybackControlsController( mBaseVideoView,
- mFileDetails );
-
- mStatusPane = new QMPXVideoPlaybackStatusPaneControl( mControlsController,
- EMPXStatusPane,
- NULL,
- 0 );
-}
-
-// ---------------------------------------------------------------------------
-// cleanup
-// ---------------------------------------------------------------------------
-//
-void TestStatusPaneControl::cleanup()
-{
- MPX_ENTER_EXIT(_L("TestStatusPaneControl::cleanup()"));
-
- if ( mStatusPane )
- {
- delete mStatusPane;
- mStatusPane = NULL;
- }
-
- if ( mBaseVideoView )
- {
- delete mBaseVideoView;
- mBaseVideoView = NULL;
- }
-
- if ( mFileDetails )
- {
- delete mFileDetails;
- mFileDetails = NULL;
- }
-
- if ( mControlsController )
- {
- delete mControlsController;
- mControlsController = NULL;
- }
-}
-
-// ---------------------------------------------------------------------------
-// testSetMenu
-// ---------------------------------------------------------------------------
-//
-void TestStatusPaneControl::testSetMenu()
-{
- MPX_ENTER_EXIT(_L("TestStatusPaneControl::testSetMenu()"));
-
- setup();
-
- mFileDetails->mTvOutConnected = false;
- mFileDetails->mVideoEnabled = true;
-
- mStatusPane->setMenu( mFileDetails );
-
- QVERIFY( mControlsController->view()->menu()->isEmpty() );
-
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
-// testSetVisible
-// ---------------------------------------------------------------------------
-//
-void TestStatusPaneControl::testSetVisible()
-{
- MPX_ENTER_EXIT(_L("TestStatusPaneControl::testSetVisible()"));
-
- setup();
- mStatusPane->updateControlsWithFileDetails( mFileDetails );
-
- // 1. Set visible
- mStatusPane->setVisible( true );
- QVERIFY( mControlsController->view()->mStatusBarVisible );
- QVERIFY( mControlsController->view()->mTitleBarVisible );
- QVERIFY( mStatusPane->mTitleLayout->isVisible() );
-
- // 2. Set invisible
- mStatusPane->setVisible( false );
- QVERIFY( mControlsController->view()->menu()->isEmpty() );
- QVERIFY( ! mControlsController->view()->mStatusBarVisible );
- QVERIFY( ! mControlsController->view()->mTitleBarVisible );
- QVERIFY( ! mStatusPane->mTitleLayout->isVisible() );
-
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
-// testUpdateControlsWithFileDetails
-// ---------------------------------------------------------------------------
-//
-void TestStatusPaneControl::testUpdateControlsWithFileDetails()
-{
- MPX_ENTER_EXIT(_L("TestStatusPaneControl::testUpdateControlsWithFileDetails()"));
-
- setup();
-
- QString title = "Title";
-
- // 1. test for full creen mode
- mControlsController->mViewMode = EFullScreenView;
- 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;
- 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 );
-
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
-// testSetVisibility
-// ---------------------------------------------------------------------------
-//
-void TestStatusPaneControl::testSetVisibility()
-{
- MPX_ENTER_EXIT(_L("TestStatusPaneControl::testSetVisibility()"));
-
- setup();
-
- // 1. test for first block of cases:
- mStatusPane->setVisibility( EPbStatePaused );
- QVERIFY( mControlsController->view()->menu()->isEmpty() );
-
- // 2. test for second block of cases:
- mStatusPane->setVisibility( EPbStateInitialising );
- QVERIFY( mControlsController->view()->menu()->isEmpty() );
-
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
-// testControlListUpdated
-// ---------------------------------------------------------------------------
-//
-void TestStatusPaneControl::testControlListUpdated()
-{
- MPX_ENTER_EXIT(_L("TestStatusPaneControl::testControlListUpdated()"));
-
- setup();
-
- mStatusPane->controlListUpdated( mFileDetails );
-
- QVERIFY( mControlsController->view()->menu()->isEmpty() );
-
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
-// testSlot_handleAboutToShow
-// ---------------------------------------------------------------------------
-//
-void TestStatusPaneControl::testSlot_handleAboutToShow()
-{
- MPX_ENTER_EXIT(_L("TestStatusPaneControl::testSlot_handleAboutToShow()"));
-
- setup();
-
- connect( this, SIGNAL( commandSignal() ), mStatusPane, SLOT( handleAboutToShow() ) );
-
- emit commandSignal();
-
- QVERIFY( mControlsController->mTimerAction == EMPXTimerCancel );
-
- disconnect( this, SIGNAL( commandSignal() ), mStatusPane, SLOT( handleAboutToShow() ) );
-
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
-// testSlot_handleAboutToHide
-// ---------------------------------------------------------------------------
-//
-void TestStatusPaneControl::testSlot_handleAboutToHide()
-{
- MPX_ENTER_EXIT(_L("TestStatusPaneControl::testSlot_handleAboutToHide()"));
-
- setup();
-
- connect( this, SIGNAL( commandSignal() ), mStatusPane, SLOT( handleAboutToHide() ) );
-
- emit commandSignal();
-
- QVERIFY( mControlsController->mTimerAction == EMPXTimerReset );
-
- disconnect( this, SIGNAL( commandSignal() ), mStatusPane, SLOT( handleAboutToHide() ) );
-
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
-// testSlot_openFullScreenView
-// ---------------------------------------------------------------------------
-//
-void TestStatusPaneControl::testSlot_openFullScreenView()
-{
- MPX_ENTER_EXIT(_L("TestStatusPaneControl::testSlot_openFullScreenView()"));
-
- setup();
-
- connect( this, SIGNAL( commandSignal() ), mStatusPane, SLOT( openFullScreenView() ) );
-
- emit commandSignal();
-
- QVERIFY( mControlsController->mViewMode == EFullScreenView );
-
- disconnect( this, SIGNAL( commandSignal() ), mStatusPane, SLOT( openFullScreenView() ) );
-
- cleanup();
-}
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/inc/hbgroupbox.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
-* 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 <hbwidget.h>
-
-
-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_*/
-
--- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/inc/hblabel.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
-* 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 HbLabel
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-#ifndef HBLABEL_H_
-#define HBLABEL_H_
-
-#include <hbwidget.h>
-
-
-class HbLabel : public HbWidget
-{
- Q_OBJECT
-
- public:
- HbLabel();
- virtual ~HbLabel();
-
- public:
- void setVisible( bool visible );
- bool isVisible();
- void setPlainText( QString string );
-
- public:
- bool mVisible;
- QString mString;
-};
-
-#endif /*HBLABEL_H_*/
-
--- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/inc/hbvideobaseplaybackview.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
-* 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: HB Video playback view
-*
-*/
-
-// Version : %version: 6 %
-
-
-
-// This file defines the API for .dll
-
-#ifndef __HBVIDEOBASEPLAYBACKVIEW_H__
-#define __HBVIDEOBASEPLAYBACKVIEW_H__
-
-// Include Files
-#include <hbwidget.h>
-#include <hbview.h>
-
-// Constants
-
-// Forward Declarations
-
-// Class Definitions
-class HbAction;
-class HbMenu;
-
-class HbVideoBasePlaybackView : public HbWidget
-{
- Q_OBJECT
-
- public:
- HbVideoBasePlaybackView();
- virtual ~HbVideoBasePlaybackView();
-
- void handleActivateView();
-
- void handleDeactivateView();
-
- virtual void handleClosePlaybackView();
-
- void startClosingPlaybackView();
-
- virtual void doClosePlayer();
-
- void setViewFlags( HbView::HbViewFlags flags );
- HbView::HbViewFlags viewFlags();
-
- 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__
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/inc/mpxvideoplaybackcontrolscontroller.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,170 +0,0 @@
-/*
-* 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 MPXVideoPlaybackControlsController
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_
-#define MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_
-
-// INCLUDES
-#include <qobject>
-
-#include <mpxplaybackframeworkdefs.h>
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackcontrol.hrh"
-#include "mpxcommonvideoplaybackview.hrh"
-#include "mpxvideoplaybackviewfiledetails.h"
-
-// FORWARD DECLARATIONS
-class HbVideoBasePlaybackView;
-class QMPXVideoPlaybackDocumentLoader;
-class QMPXVideoPlaybackFullScreenControl;
-class QMPXVideoPlaybackControlsController;
-
-
-// DATA TYPES
-
-enum TMPXTimerAction
-{
- EMPXTimerCancel,
- EMPXTimerReset
-};
-
-enum TPlaybackViewMode
-{
- EFullScreenView,
- EDetailsView,
- EAudioOnlyView
-};
-
-
-// CLASS DECLARATION
-
-class QMPXVideoPlaybackControlsController : public QObject
-{
- Q_OBJECT
-
- public:
-
- /**
- * constructor.
- */
- QMPXVideoPlaybackControlsController(
- HbVideoBasePlaybackView *view,
- QMPXVideoPlaybackViewFileDetails *details );
-
- /**
- * Destructor.
- */
- virtual ~QMPXVideoPlaybackControlsController();
-
- public:
- /**
- * Reset or cancel timers for the controls
- */
- void resetDisappearingTimers( TMPXTimerAction timerAction );
-
- /*
- * Return state
- */
- inline TMPXPlaybackState state();
-
- /**
- * Return file details
- */
- inline QMPXVideoPlaybackViewFileDetails* fileDetails();
-
- QMPXVideoPlaybackDocumentLoader* layoutLoader();
-
- inline HbVideoBasePlaybackView* view();
-
- void changeViewMode( TPlaybackViewMode viewMode, bool transitionEffect = true );
-
- TPlaybackViewMode viewMode();
-
- public:
- /**
- * Initialize controller
- */
- void initializeController();
-
- /**
- * Create controls
- */
- void createControls();
-
- /**
- * Update controls
- */
- void handleStateChange( TMPXPlaybackState newState );
-
- /**
- * Update Control's visibility
- */
- void updateControlsVisibility();
-
- public:
- HbVideoBasePlaybackView *mView;
- QMPXVideoPlaybackViewFileDetails *mFileDetails;
-
- QList<QMPXVideoPlaybackFullScreenControl*> mControls;
-
- QMPXVideoPlaybackDocumentLoader *mLoader;
-
- TMPXPlaybackState mState;
- TPlaybackViewMode mViewMode;
- TMPXTimerAction mTimerAction;
-
-};
-
-// INLINE METHODS
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::state
-// -------------------------------------------------------------------------------------------------
-//
-inline
-TMPXPlaybackState QMPXVideoPlaybackControlsController::state()
-{
- return mState;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::fileDetails
-// -------------------------------------------------------------------------------------------------
-//
-inline
-QMPXVideoPlaybackViewFileDetails* QMPXVideoPlaybackControlsController::fileDetails()
-{
- return mFileDetails;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::view
-// -------------------------------------------------------------------------------------------------
-//
-inline
-HbVideoBasePlaybackView* QMPXVideoPlaybackControlsController::view()
-{
- return mView;
-}
-
-#endif /*MPXVIDEOPLAYBACKCONTROLSCONTROLLER_P_H_*/
-
-// End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/inc/mpxvideoplaybackdocumentloader.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackDocumentLoader
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKDOCUMENTHANDLER_H_
-#define MPXVIDEOPLAYBACKDOCUMENTHANDLER_H_
-
-
-#include <qobject>
-
-class QList;
-class QGraphicsWidget;
-class QMPXVideoPlaybackControlsController;
-
-class QMPXVideoPlaybackDocumentLoader : public QObject
-{
- public:
- QMPXVideoPlaybackDocumentLoader();
-
- virtual ~QMPXVideoPlaybackDocumentLoader();
-
- public:
- QGraphicsWidget* findWidget( const QString &name );
-
- private:
- QGraphicsWidget* createWidget( const QString &name );
- int exist( const QString &name );
-
- private:
- QList<QGraphicsWidget*> mWidgets;
-};
-
-#endif /*MPXVIDEOPLAYBACKDOCUMENTHANDLER_H_*/
-
--- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/inc/mpxvideoplaybackfullscreencontrol.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackFullScreenControl
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKFULLSCREENCONTROL_H_
-#define MPXVIDEOPLAYBACKFULLSCREENCONTROL_H_
-
-#include <qobject>
-
-#include <mpxvideoplaybackcontrol.hrh>
-#include <mpxplaybackframeworkdefs.h>
-
-class HbWidget;
-class QMPXVideoPlaybackViewFileDetails;
-class QMPXVideoPlaybackControlsController;
-
-class QMPXVideoPlaybackFullScreenControl : public QObject
-{
- Q_OBJECT
-
- public:
- QMPXVideoPlaybackFullScreenControl( QMPXVideoPlaybackControlsController* controller,
- TMPXVideoPlaybackControls index,
- HbWidget* widget,
- TUint controlproperties );
-
- virtual ~QMPXVideoPlaybackFullScreenControl();
-
- public:
-
- /**
- * Set visibility of each control
- */
- virtual void setVisibility( TMPXPlaybackState aState );
-
- /**
- * return control index
- */
- TMPXVideoPlaybackControls controlIndex();
-
- /**
- * set changed state
- */
- void updateState( TMPXPlaybackState state );
-
- /*
- * Update the controls with the file details
- */
- virtual void updateControlsWithFileDetails( QMPXVideoPlaybackViewFileDetails *details );
-
- virtual void setVisible( bool visible );
-
- virtual bool isVisible();
-
- virtual void updateControlProperties( TUint properties );
-
- protected:
- QMPXVideoPlaybackControlsController* mController;
- HbWidget *mControl;
- TMPXVideoPlaybackControls mControlIndex;
- TUint mProperties;
- bool mVisible;
-};
-
-#endif /*MPXVIDEOPLAYBACKFULLSCREENCONTROL_H_*/
-
--- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/inc/mpxvideoplaybackviewfiledetails.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
-* 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: MPX Video File Details (QT)
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-
-#ifndef __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-#define __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-
-#include <qobject.h>
-#include "mpxhelixplaybackplugindefs.h"
-
-
-//
-// CLASS DECLARATION
-//
-class QMPXVideoPlaybackViewFileDetails : public QObject
-{
- public:
- //
- // Constructor
- //
- QMPXVideoPlaybackViewFileDetails();
-
- //
- // Destructor.
- //
- virtual ~QMPXVideoPlaybackViewFileDetails();
-
- //
- // Clear all file details
- //
- void clearFileDetails();
-
- public:
- //
- // Data
- //
- QString mClipName;
- QString mTitle;
- QString mArtist;
- QString mMimeType;
- QString mDescription;
- QString mLocation;
- QString mCopyright;
- QString mLanguage;
- QString mKeywords;
-
- TMPXVideoMode mPlaybackMode;
- bool mSeekable;
- bool mPausableStream;
- bool mAudioEnabled;
- bool mVideoEnabled;
- bool mPartialPlayback;
- bool mRNFormat;
- bool mTvOutConnected;
- bool mDrmProtected;
- bool mMultiItemPlaylist;
-
- int mVideoHeight;
- int mVideoWidth;
- int mBitRate;
- int mDuration;
-};
-
-#endif // __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/hbgroupbox.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
-* 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
--- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/hblabel.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
-* 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 HbLabel
-*
-*/
-
-// Version : %version: 2 %
-
-
-#include "hblabel.h"
-
-// -------------------------------------------------------------------------------------------------
-// HbLabel::HbLabel
-// -------------------------------------------------------------------------------------------------
-//
-HbLabel::HbLabel()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbLabel::~HbLabel
-// -------------------------------------------------------------------------------------------------
-//
-HbLabel::~HbLabel()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbLabel::setVisible
-// -------------------------------------------------------------------------------------------------
-//
-void HbLabel::setVisible( bool visible )
-{
- mVisible = visible;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbLabel::isVisible
-// -------------------------------------------------------------------------------------------------
-//
-bool HbLabel::isVisible()
-{
- return mVisible;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbLabel::setPlainText
-// -------------------------------------------------------------------------------------------------
-//
-void HbLabel::setPlainText( QString string )
-{
- mString = string;
-}
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/hbvideobaseplaybackview.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,162 +0,0 @@
-/*
-* 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 Video playback view
-*
-*/
-
-// Version : %version: 5 %
-
-
-
-// Include Files
-#include <hbinstance.h>
-#include <HbAction.h>
-#include <HbMenu.h>
-
-#include "../inc/hbvideobaseplaybackview.h"
-
-
-// Member Functions
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoPlaybackView::HbVideoPlaybackView()
-// -------------------------------------------------------------------------------------------------
-//
-HbVideoBasePlaybackView::HbVideoBasePlaybackView()
-{
- mMenu = new HbMenu();
- mViewActive = false;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoPlaybackView::~HbVideoPlaybackView()
-// -------------------------------------------------------------------------------------------------
-//
-HbVideoBasePlaybackView::~HbVideoBasePlaybackView()
-{
- if ( mMenu )
- {
- delete mMenu;
- mMenu = NULL;
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::handleActivateView()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::handleActivateView()
-{
- mViewActive = true;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::handleDeactivateView()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::handleDeactivateView()
-{
- mViewActive = false;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::handleClosePlaybackView()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::handleClosePlaybackView()
-{
- mViewActive = false;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::doClosePlayer
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::doClosePlayer()
-{
- mViewActive = false;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::closePlaybackView()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::closePlaybackView()
-{
- mViewActive = false;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::startClosingPlaybackView()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::startClosingPlaybackView()
-{
- mViewActive = false;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::setTitleBarFlags()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::setViewFlags( HbView::HbViewFlags flags )
-{
- mFlag = flags;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::viewFlags()
-// -------------------------------------------------------------------------------------------------
-//
-HbView::HbViewFlags HbVideoBasePlaybackView::viewFlags()
-{
- 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
--- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/mpxvideoplaybackcontrolscontroller.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,115 +0,0 @@
-/*
-* 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 MPXVideoPlaybackControlsController
-*
-*/
-
-// Version : %version: 3 %
-
-
-
-// INCLUDE FILES
-#include <coecntrl.h>
-#include <bautils.h>
-#include <barsread.h>
-#include <f32file.h>
-
-#include "../inc/hbvideobaseplaybackview.h"
-#include "../inc/mpxvideoplaybackviewfiledetails.h"
-#include "../inc/mpxvideoplaybackcontrolscontroller.h"
-#include "../inc/mpxvideoplaybackdocumentloader.h"
-
-
-
-// ================= MEMBER FUNCTIONS ==============================================================
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController()
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController(
- HbVideoBasePlaybackView *view,
- QMPXVideoPlaybackViewFileDetails *details )
- : mView( view )
- , mFileDetails( details )
-{
- initializeController();
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::initializeController()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::initializeController()
-{
- mLoader = new QMPXVideoPlaybackDocumentLoader();
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController"));
-
- if ( mLoader )
- {
- delete mLoader;
- mLoader = NULL;
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::resetDisappearingTimers()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::resetDisappearingTimers( TMPXTimerAction timerAction )
-{
- mTimerAction = timerAction;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::changeViewMode
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::changeViewMode(
- TPlaybackViewMode viewMode, bool transitionEffect )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::changeViewMode()"));
-
- Q_UNUSED( transitionEffect );
- mViewMode = viewMode;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::layoutLoader
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackDocumentLoader* QMPXVideoPlaybackControlsController::layoutLoader()
-{
- return mLoader;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::viewMode
-// -------------------------------------------------------------------------------------------------
-//
-TPlaybackViewMode QMPXVideoPlaybackControlsController::viewMode()
-{
- return mViewMode;
-}
-
-
-// End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/mpxvideoplaybackdocumentloader.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,136 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackDocumentLoader
-*
-*/
-
-// Version : %version: 2 %
-
-
-#include <QGraphicsWidget>
-
-#include "hblabel.h"
-#include "hbgroupbox.h"
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackdocumentloader.h"
-
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::QMPXVideoPlaybackDocumentLoader
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackDocumentLoader::QMPXVideoPlaybackDocumentLoader()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackDocumentLoader::QMPXVideoPlaybackDocumentLoader()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::~QMPXVideoPlaybackDocumentLoader
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackDocumentLoader::~QMPXVideoPlaybackDocumentLoader()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::QMPXVideoPlaybackDocumentLoader") );
-
- for ( int i = 0 ; i < mWidgets.count() ; i++ )
- {
- mWidgets.removeAt( 0 );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::findWidget()
-// -------------------------------------------------------------------------------------------------
-//
-QGraphicsWidget *QMPXVideoPlaybackDocumentLoader::findWidget( const QString &name )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::findWidget") );
-
- QGraphicsWidget *object = NULL;
-
- int index = exist( name );
-
- if ( index == -1 )
- {
- object = createWidget( name );
- }
- else
- {
- object = mWidgets[ index ];
- }
-
- return object;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::createWidget()
-// -------------------------------------------------------------------------------------------------
-//
-QGraphicsWidget *QMPXVideoPlaybackDocumentLoader::createWidget( const QString &name )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::createWidget") );
-
- QGraphicsWidget *object = NULL;
-
- if ( name == "titleLayout" )
- {
- object = new QGraphicsWidget();
- object->setObjectName( name );
-
- mWidgets.append( object );
- }
- else if ( name == "title" )
- {
- object = new HbLabel();
- object->setObjectName( name );
- mWidgets.append( object );
- }
- else if ( name == "titleGroupBox" )
- {
- object = new HbGroupBox();
- object->setObjectName( name );
- mWidgets.append( object );
- }
-
- return object;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::exist()
-// -------------------------------------------------------------------------------------------------
-//
-int QMPXVideoPlaybackDocumentLoader::exist( const QString &name )
-{
- int i = 0;
-
- for ( ; i < mWidgets.count() ; i++ )
- {
- if( mWidgets[i]->objectName() == name )
- {
- break;
- }
- }
-
- if ( i == mWidgets.count() )
- {
- i = -1;
- }
-
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::exist %d"), i );
-
- return i;
-}
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/mpxvideoplaybackfullscreencontrol.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,124 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackFullScreenControl
-*
-*/
-
-// Version : %version: 3 %
-
-
-
-#include <w32std.h>
-#include <hbwidget.h>
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackfullscreencontrol.h"
-#include "mpxvideoplaybackcontrolscontroller.h"
-
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFullScreenControl::QMPXVideoPlaybackFullScreenControl()
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackFullScreenControl::QMPXVideoPlaybackFullScreenControl(
- QMPXVideoPlaybackControlsController* controller,
- TMPXVideoPlaybackControls index,
- HbWidget* widget,
- TUint controlproperties )
- : mController( controller )
- , mControl( widget )
- , mControlIndex( index )
- , mProperties( controlproperties )
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackFullScreenControl::QMPXVideoPlaybackFullScreenControl()"));
-
- setParent( mController );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFullScreenControl::~QMPXVideoPlaybackFullScreenControl()
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackFullScreenControl::~QMPXVideoPlaybackFullScreenControl()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackFullScreenControl"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFullScreenControl::setVisible()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackFullScreenControl::setVisible( bool visible )
-{
- mControl->setVisible( visible );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFullScreenControl::isVisible()
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackFullScreenControl::isVisible()
-{
- return mVisible;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFullScreenControl::setVisibility()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackFullScreenControl::setVisibility( TMPXPlaybackState /*state*/ )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackFullScreenControl::setVisibility()"));
-
- mVisible = true;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFullScreenControl::controlIndex()
-// -------------------------------------------------------------------------------------------------
-//
-TMPXVideoPlaybackControls QMPXVideoPlaybackFullScreenControl::controlIndex()
-{
- return mControlIndex;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFullScreenControl::updateState()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackFullScreenControl::updateState( TMPXPlaybackState state )
-{
- Q_UNUSED( state );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFullScreenControl::updateControlsWithFileDetails()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackFullScreenControl::updateControlsWithFileDetails(
- QMPXVideoPlaybackViewFileDetails* details )
-{
- Q_UNUSED( details );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFullScreenControl::updateControlProperties()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackFullScreenControl::updateControlProperties( TUint properties )
-{
- mProperties = properties;
-}
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/mpxvideoplaybackviewfiledetails.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
-* 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: class for MPX Video File Details (Qt)
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-//
-// INCLUDE FILES
-//
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackviewfiledetails.h"
-
-
-// ============================ MEMBER FUNCTIONS ===================================================
-
-QMPXVideoPlaybackViewFileDetails::QMPXVideoPlaybackViewFileDetails()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::QMPXVideoPlaybackViewFileDetails()"));
-
- clearFileDetails();
-}
-
-QMPXVideoPlaybackViewFileDetails::~QMPXVideoPlaybackViewFileDetails()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::~QMPXVideoPlaybackViewFileDetails()"));
-
- clearFileDetails();
-}
-
-void
-QMPXVideoPlaybackViewFileDetails::clearFileDetails()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::ClearFileDetails()"));
-
- mMimeType = tr("");
- mTitle = tr("");
- mArtist = tr("");
- mClipName = tr("");
- mDescription = tr("");
- mLocation = tr("");
- mCopyright = tr("");
- mLanguage = tr("");
- mKeywords = tr("");
-
- mPlaybackMode = EMPXVideoLocal;
- mSeekable = false;
- mPausableStream = false;
- mAudioEnabled = false;
- mVideoEnabled = false;
- mPartialPlayback = false;
- mRNFormat = false;
-
- mDuration = 0;
- mTvOutConnected = false;
- mDrmProtected = false;
-
- mVideoHeight = 0;
- mVideoWidth = 0;
- mBitRate = 0;
-}
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/teststatuspanecontrol.pro Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-#
-# 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: Project file for building teststatuspanecontrol
-#
-#
-# Version : %version: 3 %
-
-
-TEMPLATE = app
-TARGET = teststatuspanecontrol
-CONFIG += qtestlib hb qt
-
-DEPENDPATH += . \
- inc \
- src
-
-INCLUDEPATH += stub/inc \
- ../inc \
- ../../inc \
- ../../../inc \
- ../../../../inc \
-
-DEPENDPATH += stub/inc stub/src inc src
-
-# Input
-HEADERS += ../../../controlinc/mpxvideoplaybackstatuspanecontrol.h \
- inc/teststatuspanecontrol.h \
- mpxvideoplaybackcontrolscontroller.h \
- mpxvideoplaybackviewfiledetails.h \
- hbvideobaseplaybackview.h \
- mpxvideoplaybackdocumentloader.h \
- mpxvideoplaybackfullscreencontrol.h \
- hblabel.h \
- hbgroupbox.h
-
-SOURCES += ../../../controlsrc/mpxvideoplaybackstatuspanecontrol.cpp \
- src/teststatuspanecontrol.cpp \
- mpxvideoplaybackcontrolscontroller.cpp \
- mpxvideoplaybackviewfiledetails.cpp \
- hbvideobaseplaybackview.cpp \
- mpxvideoplaybackdocumentloader.cpp \
- mpxvideoplaybackfullscreencontrol.cpp \
- hblabel.cpp \
- hbgroupbox.cpp
-
\ No newline at end of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/inc/testuserinputhandler.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +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: tester for methods in User Input Handler
-*
-*/
-
-#ifndef __TESTUSERINPUTHANDLER_H__
-#define __TESTUSERINPUTHANDLER_H__
-
-
-// INCLUDES
-#include <QtTest/QtTest>
-
-
-
-// forward declaration
-class CMPXVideoViewWrapper;
-class CMPXVideoPlaybackUserInputHandler;
-class HbVideoBasePlaybackView;
-
-
-class TestUserInputHandler : public QObject
-{
- Q_OBJECT
-
-public:
-
- void init();
-
- void cleanup();
-
- void setup();
-
-
- // test functions for the test framework
-private slots:
-
- void testProcessMediaKeyPlay();
-
- void testProcessMediaKeyPause();
-
- void testProcessMediaKeyPlayPause();
-
- void testProcessMediaKeyStop();
-
- void testProcessMediaKeyForward();
-
- void testProcessMediaKeyRewind();
-
- void testProcessMediaKeyVolumeUp();
-
- void testProcessMediaKeyVolumeDown();
-
- void testHandleTVOutEventL();
-
-
-signals:
-
-private:
- CMPXVideoPlaybackUserInputHandler* mUserInputHdlr;
- HbVideoBasePlaybackView* mBaseVideoView;
- CMPXVideoViewWrapper* mVideoViewWrapper;
-
-};
-
-
-#endif // __TESTUSERINPUTHANDLER_H__
-
-// End of file
-
-
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/src/testuserinputhandler.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,323 +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: tester for methods in User Input Handler
-*
-*/
-
-#include <e32err.h>
-#include <w32std.h>
-#include <eikenv.h>
-
-#include <hbapplication.h>
-#include <hbinstance.h>
-#include <QDebug>
-
-#include "testuserinputhandler.h"
-#include "../stub/inc/mpxvideoviewwrapper.h"
-#include "../stub/inc/hbvideobaseplaybackview.h"
-
-#define private public
-#include "mpxvideoplaybackuserinputhandler.h"
-#undef private
-
-
-// ---------------------------------------------------------------------------
-// main
-// ---------------------------------------------------------------------------
-//
-int main(int argc, char *argv[])
-{
- HbApplication app(argc, argv);
- HbMainWindow window;
-
- TestUserInputHandler tv;
-
- char *pass[3];
- pass[0] = argv[0];
- pass[1] = "-o";
- pass[2] = "c:\\data\\TestUserInputHandler.txt";
-
- int res = QTest::qExec(&tv, 3, pass);
-
- return res;
-}
-
-
-// ---------------------------------------------------------------------------
-// init
-// ---------------------------------------------------------------------------
-//
-void TestUserInputHandler::init()
-{
- mBaseVideoView = new HbVideoBasePlaybackView();
- mVideoViewWrapper = CMPXVideoViewWrapper::NewL( mBaseVideoView );
-
- mUserInputHdlr = CMPXVideoPlaybackUserInputHandler::NewL(mVideoViewWrapper, false);
-}
-
-// ---------------------------------------------------------------------------
-// cleanup
-// ---------------------------------------------------------------------------
-//
-void TestUserInputHandler::cleanup()
-{
- delete mUserInputHdlr;
- mUserInputHdlr = NULL;
-
- delete mVideoViewWrapper;
- mVideoViewWrapper = NULL;
-
- delete mBaseVideoView;
- mBaseVideoView = NULL;
-}
-
-// ---------------------------------------------------------------------------
-// setup
-// ---------------------------------------------------------------------------
-//
-void TestUserInputHandler::setup()
-{
-}
-
-void TestUserInputHandler::testProcessMediaKeyPlay()
-{
- init();
-
- mUserInputHdlr->iProcessingInputType = EMpxVideoNone;
-
- mUserInputHdlr->ProcessMediaKey(ERemConCoreApiPlay, ERemConCoreApiButtonPress);
- QVERIFY( mUserInputHdlr->iProcessingInputType == EMpxVideoMediaKeys );
-
- // this event should be ignored as the 1st event is still being processed
- mUserInputHdlr->ProcessMediaKey(ERemConCoreApiPause, ERemConCoreApiButtonPress);
-
- // verify that "Play" is still being processed and not "Pause"
- QVERIFY( mUserInputHdlr->iLastMediaKeyPressed == ERemConCoreApiPlay );
-
- // send the release event for "Play"
- mUserInputHdlr->ProcessMediaKey(ERemConCoreApiPlay, ERemConCoreApiButtonRelease);
-
- // verify that no input is now being processed
- QVERIFY( mUserInputHdlr->iProcessingInputType == EMpxVideoNone );
-
- cleanup();
-}
-
-void TestUserInputHandler::testProcessMediaKeyPause()
-{
- init();
-
- mUserInputHdlr->iProcessingInputType = EMpxVideoNone;
-
- // Issue Play
- mUserInputHdlr->ProcessMediaKey(ERemConCoreApiPlay, ERemConCoreApiButtonPress);
- mUserInputHdlr->ProcessMediaKey(ERemConCoreApiPlay, ERemConCoreApiButtonRelease);
- QVERIFY( mUserInputHdlr->iProcessingInputType == EMpxVideoNone );
-
- // Initiate Pause
- mUserInputHdlr->ProcessMediaKey(ERemConCoreApiPause, ERemConCoreApiButtonPress);
- QVERIFY( mUserInputHdlr->iProcessingInputType == EMpxVideoMediaKeys );
- QVERIFY( mUserInputHdlr->iLastMediaKeyPressed == ERemConCoreApiPause );
-
- mUserInputHdlr->ProcessMediaKey(ERemConCoreApiPause, ERemConCoreApiButtonRelease);
- QVERIFY( mUserInputHdlr->iProcessingInputType == EMpxVideoNone );
-
- cleanup();
-
-}
-
-void TestUserInputHandler::testProcessMediaKeyPlayPause()
-{
- init();
-
- mUserInputHdlr->iProcessingInputType = EMpxVideoNone;
-
- mUserInputHdlr->ProcessMediaKey(ERemConCoreApiPausePlayFunction, ERemConCoreApiButtonClick);
- QVERIFY( mUserInputHdlr->iProcessingInputType == EMpxVideoNone );
-
- // set to background
- mUserInputHdlr->iForeground = false;
-
- mUserInputHdlr->iLastMediaKeyPressed = ENop;
- // this event should be ignored as iForeground is false
- mUserInputHdlr->ProcessMediaKey(ERemConCoreApiPausePlayFunction, ERemConCoreApiButtonPress);
- QVERIFY( mUserInputHdlr->iLastMediaKeyPressed == ENop );
- QVERIFY( mUserInputHdlr->iProcessingInputType == EMpxVideoNone );
-
- cleanup();
-}
-
-void TestUserInputHandler::testProcessMediaKeyStop()
-{
- init();
-
- mUserInputHdlr->iProcessingInputType = EMpxVideoNone;
-
- // Issue Play
- mUserInputHdlr->ProcessMediaKey(ERemConCoreApiPlay, ERemConCoreApiButtonPress);
- mUserInputHdlr->ProcessMediaKey(ERemConCoreApiPlay, ERemConCoreApiButtonRelease);
- QVERIFY( mUserInputHdlr->iProcessingInputType == EMpxVideoNone );
-
- // Stop
- mUserInputHdlr->ProcessMediaKey(ERemConCoreApiStop, ERemConCoreApiButtonPress);
- QVERIFY( mUserInputHdlr->iProcessingInputType == EMpxVideoMediaKeys );
- QVERIFY( mUserInputHdlr->iLastMediaKeyPressed == ERemConCoreApiStop );
-
- mUserInputHdlr->ProcessMediaKey(ERemConCoreApiStop, ERemConCoreApiButtonRelease);
- QVERIFY( mUserInputHdlr->iProcessingInputType == EMpxVideoNone );
-
- cleanup();
-}
-
-void TestUserInputHandler::testProcessMediaKeyForward()
-{
- init();
-
- mUserInputHdlr->iProcessingInputType = EMpxVideoNone;
-
- // Issue Play
- mUserInputHdlr->ProcessMediaKey(ERemConCoreApiPlay, ERemConCoreApiButtonPress);
- mUserInputHdlr->ProcessMediaKey(ERemConCoreApiPlay, ERemConCoreApiButtonRelease);
- QVERIFY( mUserInputHdlr->iProcessingInputType == EMpxVideoNone );
-
- // Forward
- mUserInputHdlr->ProcessMediaKey(ERemConCoreApiFastForward, ERemConCoreApiButtonPress);
- QVERIFY( mUserInputHdlr->iProcessingInputType == EMpxVideoMediaKeys );
- QVERIFY( mUserInputHdlr->iLastMediaKeyPressed == ERemConCoreApiFastForward );
-
- mUserInputHdlr->ProcessMediaKey(ERemConCoreApiFastForward, ERemConCoreApiButtonRelease);
- QVERIFY( mUserInputHdlr->iProcessingInputType == EMpxVideoNone );
-
- cleanup();
-}
-
-void TestUserInputHandler::testProcessMediaKeyRewind()
-{
- init();
-
- mUserInputHdlr->iProcessingInputType = EMpxVideoNone;
-
- // Issue Play
- mUserInputHdlr->ProcessMediaKey(ERemConCoreApiPlay, ERemConCoreApiButtonPress);
- mUserInputHdlr->ProcessMediaKey(ERemConCoreApiPlay, ERemConCoreApiButtonRelease);
- QVERIFY( mUserInputHdlr->iProcessingInputType == EMpxVideoNone );
-
- // Forward
- mUserInputHdlr->ProcessMediaKey(ERemConCoreApiFastForward, ERemConCoreApiButtonPress);
- QVERIFY( mUserInputHdlr->iProcessingInputType == EMpxVideoMediaKeys );
- QVERIFY( mUserInputHdlr->iLastMediaKeyPressed == ERemConCoreApiFastForward );
-
- mUserInputHdlr->ProcessMediaKey(ERemConCoreApiFastForward, ERemConCoreApiButtonRelease);
- QVERIFY( mUserInputHdlr->iProcessingInputType == EMpxVideoNone );
-
- // Rewind
- mUserInputHdlr->ProcessMediaKey(ERemConCoreApiRewind, ERemConCoreApiButtonPress);
- QVERIFY( mUserInputHdlr->iProcessingInputType == EMpxVideoMediaKeys );
- QVERIFY( mUserInputHdlr->iLastMediaKeyPressed == ERemConCoreApiRewind );
-
- mUserInputHdlr->ProcessMediaKey(ERemConCoreApiRewind, ERemConCoreApiButtonRelease);
- QVERIFY( mUserInputHdlr->iProcessingInputType == EMpxVideoNone );
-
- cleanup();
-}
-
-void TestUserInputHandler::testProcessMediaKeyVolumeUp()
-{
- init();
-
- mUserInputHdlr->iProcessingInputType = EMpxVideoNone;
-
- // Issue Play
- mUserInputHdlr->ProcessMediaKey(ERemConCoreApiPlay, ERemConCoreApiButtonPress);
- mUserInputHdlr->ProcessMediaKey(ERemConCoreApiPlay, ERemConCoreApiButtonRelease);
- QVERIFY( mUserInputHdlr->iProcessingInputType == EMpxVideoNone );
-
- // Volume Up
- mUserInputHdlr->ProcessMediaKey(ERemConCoreApiVolumeUp, ERemConCoreApiButtonPress);
- QVERIFY( mUserInputHdlr->iProcessingInputType == EMpxVideoMediaKeys );
- QVERIFY( mUserInputHdlr->iLastMediaKeyPressed == ERemConCoreApiVolumeUp );
- QVERIFY( mUserInputHdlr->iVolumeRepeatTimer->IsActive() );
- QVERIFY( mUserInputHdlr->iVolumeRepeatUp );
-
- mUserInputHdlr->ProcessMediaKey(ERemConCoreApiVolumeUp, ERemConCoreApiButtonRelease);
- QVERIFY( mUserInputHdlr->iProcessingInputType == EMpxVideoNone );
- QVERIFY( ! mUserInputHdlr->iVolumeRepeatTimer->IsActive() );
-
- cleanup();
-}
-
-void TestUserInputHandler::testProcessMediaKeyVolumeDown()
-{
- init();
-
- mUserInputHdlr->iProcessingInputType = EMpxVideoNone;
-
- // Issue Play
- mUserInputHdlr->ProcessMediaKey(ERemConCoreApiPlay, ERemConCoreApiButtonPress);
- mUserInputHdlr->ProcessMediaKey(ERemConCoreApiPlay, ERemConCoreApiButtonRelease);
- QVERIFY( mUserInputHdlr->iProcessingInputType == EMpxVideoNone );
-
- // Volume Down
- mUserInputHdlr->ProcessMediaKey(ERemConCoreApiVolumeDown, ERemConCoreApiButtonPress);
- QVERIFY( mUserInputHdlr->iProcessingInputType == EMpxVideoMediaKeys );
- QVERIFY( mUserInputHdlr->iLastMediaKeyPressed == ERemConCoreApiVolumeDown );
- QVERIFY( mUserInputHdlr->iVolumeRepeatTimer->IsActive() );
- QVERIFY( ! mUserInputHdlr->iVolumeRepeatUp );
-
- mUserInputHdlr->ProcessMediaKey(ERemConCoreApiVolumeDown, ERemConCoreApiButtonRelease);
- QVERIFY( mUserInputHdlr->iProcessingInputType == EMpxVideoNone );
- QVERIFY( ! mUserInputHdlr->iVolumeRepeatTimer->IsActive() );
-
- cleanup();
-}
-
-void TestUserInputHandler::testHandleTVOutEventL()
-{
-
- ///////////////////////////////
- // 1. HandleTVOutEventL(true)
- ///////////////////////////////
- init();
-
- mUserInputHdlr->iDisplayTimeOut = 0;
-
- mUserInputHdlr->HandleTVOutEventL(true);
-
- QVERIFY( mUserInputHdlr->iDisplayTimeOut != 0 );
- QVERIFY( mUserInputHdlr->iDisplayTimer->IsActive() );
-
- cleanup();
-
-
- ///////////////////////////////
- // 2. HandleTVOutEventL(false)
- ///////////////////////////////
- init();
-
- mUserInputHdlr->iDisplayTimeOut = 0;
-
- mUserInputHdlr->HandleTVOutEventL(false);
- QVERIFY( ! mUserInputHdlr->iDisplayTimer->IsActive() );
-
- cleanup();
-
-}
-
-
-
-
-// End of file
-
-
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/inc/centralrepository.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-// Copyright (c) 2004-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 declaration for central repository
-//
-
-#ifndef __CENTRALREPOSITORY_H__
-#define __CENTRALREPOSITORY_H__
-
-#include <e32base.h>
-
-
-class CRepository : public CBase
- {
-public:
-
- static CRepository* NewLC(TUid aRepositoryUid);
-
- virtual ~CRepository();
-
- TInt Get(TUint32 aKey, TInt& aValue);
-
- };
-
-#endif // __CENTRALREPOSITORY_H__
--- a/videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/inc/hal.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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 declaration for HAL
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#ifndef __HAL_H__
-#define __HAL_H__
-
-#include <e32base.h>
-#include <e32std.h>
-
-class HAL : public CBase
- {
-
-public:
-
- static TInt Get(TAttribute aAttribute, TInt& aValue);
-
-
- static TInt Set(TAttribute aAttribute, TInt aValue);
-
-
- };
-
-
-#endif
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/inc/hbvideobaseplaybackview.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +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: HB Video playback view
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-// This file defines the API for .dll
-
-#ifndef __HBVIDEOBASEPLAYBACKVIEW_H__
-#define __HBVIDEOBASEPLAYBACKVIEW_H__
-
-// Include Files
-#include <hbview.h>
-
-class CMPXVideoViewWrapper;
-class RWindow;
-
-// Constants
-
-// Forward Declarations
-
-// Class Definitions
-
-class HbVideoBasePlaybackView : public HbView
-{
- Q_OBJECT
-
- public:
- HbVideoBasePlaybackView();
- virtual ~HbVideoBasePlaybackView();
-
- void handleActivateView();
-
- void handleDeactivateView();
-
- void mousePressEvent( QGraphicsSceneMouseEvent *event );
-
- QVariant itemChange( GraphicsItemChange change, const QVariant &value );
-
- void paint( QPainter *painter,
- const QStyleOptionGraphicsItem *option,
- QWidget *widget );
-
- bool event( QEvent *event );
-
- virtual void handleClosePlaybackView();
-
- virtual void handleBufferingState();
-
- virtual void issuePlayCommand();
-
- virtual void handlePluginError( int aError );
-
- virtual void retrievePdlInformation();
-
- virtual void closePlaybackView();
-
- void startClosingPlaybackView();
-
- RWindow *getWindow();
-
- virtual void doClosePlayer();
-
- public:
- int mCurrentError; // default = KErrNone
- bool mViewActive;
-
-
- public:
- friend class CMPXVideoViewWrapper;
-
-};
-
-#endif // __HBVIDEOBASEPLAYBACKVIEW_H__
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/inc/mpxvideoplaybackviewfiledetails.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +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: MPX Video File Details (QT)
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-
-#ifndef __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-#define __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-
-#include <qobject.h>
-#include "mpxhelixplaybackplugindefs.h"
-
-
-//
-// CLASS DECLARATION
-//
-class QMPXVideoPlaybackViewFileDetails : public QObject
-{
- public:
- //
- // Constructor
- //
- QMPXVideoPlaybackViewFileDetails();
-
- //
- // Destructor.
- //
- virtual ~QMPXVideoPlaybackViewFileDetails();
-
- //
- // Clear all file details
- //
- void clearFileDetails();
-
- public:
- //
- // Data
- //
- QString mClipName;
- QString mTitle;
- QString mArtist;
- QString mMimeType;
-
- TMPXVideoMode mPlaybackMode;
- bool mSeekable;
- bool mPausableStream;
- bool mAudioEnabled;
- bool mVideoEnabled;
- bool mPartialPlayback;
- bool mRNFormat;
- bool mTvOutConnected;
- bool mDrmProtected;
- bool mMultiItemPlaylist;
-
- int mVideoHeight;
- int mVideoWidth;
- int mBitRate;
- int mDuration;
-};
-
-#endif // __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/inc/mpxvideoviewwrapper.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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: MPX Video base playback view
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-// This file defines the API for .dll
-
-#ifndef __MPXVIDEOVIEWWRAPPER_H__
-#define __MPXVIDEOVIEWWRAPPER_H__
-
-// Include Files
-
-#include <e32base.h> // CBase
-#include <e32std.h> // TBuf
-
-
-#include "mpxvideoplaybackcontrol.hrh"
-
-// Constants
-
-// Forward Declarations
-class HbVideoBasePlaybackView;
-class QMPXVideoPlaybackViewFileDetails;
-
-
-// Class Definitions
-
-class CMPXVideoViewWrapper : public CBase
-{
- public:
- static CMPXVideoViewWrapper* NewL( HbVideoBasePlaybackView* aView );
- virtual ~CMPXVideoViewWrapper();
-
- private:
- CMPXVideoViewWrapper( HbVideoBasePlaybackView* aView );
- void ConstructL();
-
- void SetFileDetails(TBool aDefault);
-
- public:
- void HandleCommandL( TInt aCommand );
-
- TBool IsLive();
-
- TBool IsPlaylist();
-
- TBool IsMultiItemPlaylist();
-
- void RequestMediaL();
-
- void CreateGeneralPlaybackCommandL( int aCmd );
-
- void ActivateClosePlayerActiveObject();
-
- void IssueVideoAppForegroundCmdL( TBool aForeground );
-
- void UpdateVideoRectDone();
-
-
- public: // data
-
- HbVideoBasePlaybackView* iView;
- TBool iMediaRequested;
- QMPXVideoPlaybackViewFileDetails* iFileDetails;
- TBool iClosePlayerAO;
- TBool iForeground;
-
-};
-
-#endif // __MPXVIDEOVIEWWRAPPER_H__
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/src/centralrepository.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +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: Stub implementation for central repository
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-//
-// INCLUDE FILES
-//
-#include "centralrepository.h"
-
-
-CRepository* CRepository::NewLC( TUid /* aRepositoryUid */ )
-{
- CRepository* self = new (ELeave) CRepository();
-
- CleanupStack::PushL( self );
-
- return self;
-}
-
-
-TInt CRepository::Get( TUint32 /* aKey */, TInt& aValue )
-{
- aValue = 10;
- return KErrNone;
-}
-
-CRepository::~CRepository()
-{
-}
-
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/src/hal.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +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: Stub implementation for HAL
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-//
-// INCLUDE FILES
-//
-#include "hal.h"
-
-
-TInt HAL::Get(TAttribute /*aAttribute*/, TInt& aValue)
-{
- aValue = 5;
- return KErrNone;
-}
-
-TInt HAL::Set(TAttribute /*aAttribute*/, TInt /*aValue*/)
-{
- return KErrNone;
-}
-
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/src/hbvideobaseplaybackview.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,194 +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 Video playback view
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-// Include Files
-#include <aknappui.h>
-#include <qgraphicssceneevent>
-#include <hbinstance.h>
-#include <mmf/common/mmferrors.h>
-
-#include "../inc/hbvideobaseplaybackview.h"
-
-
-// Member Functions
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoPlaybackView::HbVideoPlaybackView()
-// -------------------------------------------------------------------------------------------------
-//
-HbVideoBasePlaybackView::HbVideoBasePlaybackView()
-{
- mCurrentError = KErrNone;
- mViewActive = false;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoPlaybackView::~HbVideoPlaybackView()
-// -------------------------------------------------------------------------------------------------
-//
-HbVideoBasePlaybackView::~HbVideoBasePlaybackView()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::handleActivateView()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::handleActivateView()
-{
- mViewActive = true;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::handleDeactivateView()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::handleDeactivateView()
-{
- mViewActive = false;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::mousePress
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::mousePressEvent( QGraphicsSceneMouseEvent *event )
-{
- Q_UNUSED( event );
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::itemChange
-// -------------------------------------------------------------------------------------------------
-//
-QVariant HbVideoBasePlaybackView::itemChange( GraphicsItemChange change, const QVariant &value )
-{
- return QGraphicsWidget::itemChange( change, value );
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::closePlaybackView()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::paint( QPainter *painter,
- const QStyleOptionGraphicsItem *option,
- QWidget *widget )
-{
- Q_UNUSED( painter );
- Q_UNUSED( option );
- Q_UNUSED( widget );
-}
-
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::event()
-// -------------------------------------------------------------------------------------------------
-//
-bool HbVideoBasePlaybackView::event( QEvent *event )
-{
- Q_UNUSED( event );
- bool consumed = false;
-
- return consumed;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::handleClosePlaybackView()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::handleClosePlaybackView()
-{
- mViewActive = false;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::issuePlayCommand
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::issuePlayCommand()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::handleBufferingState
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::handleBufferingState()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::handlePluginError()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::handlePluginError( int aError )
-{
- mCurrentError = aError;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::doClosePlayer
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::doClosePlayer()
-{
- mViewActive = false;
-}
-
-
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::retrievePdlInformation
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::retrievePdlInformation()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::closePlaybackView()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::closePlaybackView()
-{
- mViewActive = false;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::startClosingPlaybackView()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::startClosingPlaybackView()
-{
- mViewActive = false;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::getWindow()
-// -------------------------------------------------------------------------------------------------
-//
-RWindow *HbVideoBasePlaybackView::getWindow()
-{
- return static_cast<RWindow*>( hbInstance->allMainWindows()[0]->effectiveWinId()->DrawableWindow() );
-}
-
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/src/mpxvideoplaybackviewfiledetails.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +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: class for MPX Video File Details (Qt)
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-//
-// INCLUDE FILES
-//
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackviewfiledetails.h"
-
-
-// ============================ MEMBER FUNCTIONS ===================================================
-
-QMPXVideoPlaybackViewFileDetails::QMPXVideoPlaybackViewFileDetails()
-{
- clearFileDetails();
-}
-
-QMPXVideoPlaybackViewFileDetails::~QMPXVideoPlaybackViewFileDetails()
-{
- clearFileDetails();
-}
-
-void
-QMPXVideoPlaybackViewFileDetails::clearFileDetails()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::ClearFileDetails()"));
-
- mMimeType = tr("");
- mTitle = tr("");
- mArtist = tr("");
- mClipName = QString("testClip.3gp");
-
- mPlaybackMode = EMPXVideoLocal;
- mSeekable = false;
- mPausableStream = false;
- mAudioEnabled = true;
- mVideoEnabled = false;
- mPartialPlayback = false;
- mRNFormat = false;
-
- mDuration = 0;
- mTvOutConnected = false;
- mDrmProtected = false;
- mMultiItemPlaylist = false;
-
- mVideoHeight = 0;
- mVideoWidth = 0;
- mBitRate = 0;
-}
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/src/mpxvideoviewwrapper.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,229 +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 Video base playback view
-*
-*/
-
-// Version : %version: 3 %
-
-
-
-// Include Files
-
-#include "mpxvideoviewwrapper.h"
-#include "hbvideobaseplaybackview.h"
-#include "mpxvideoplaybackviewfiledetails.h"
-#include "mpxcommonvideoplaybackview.hrh"
-
-// Member Functions
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::CMPXVideoViewWrapper()
-// -------------------------------------------------------------------------------------------------
-//
-CMPXVideoViewWrapper::CMPXVideoViewWrapper( HbVideoBasePlaybackView* aView )
- : iView( aView )
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::NewL()
-// -------------------------------------------------------------------------------------------------
-//
-CMPXVideoViewWrapper* CMPXVideoViewWrapper::NewL( HbVideoBasePlaybackView* aView )
-{
- CMPXVideoViewWrapper* self = new (ELeave) CMPXVideoViewWrapper( aView );
-
- CleanupStack::PushL( self );
- self->ConstructL();
- CleanupStack::Pop();
-
- return self;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::ConstructL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::ConstructL()
-{
- iMediaRequested = EFalse;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::~CMPXVideoViewWrapper()
-// -------------------------------------------------------------------------------------------------
-//
-CMPXVideoViewWrapper::~CMPXVideoViewWrapper()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::IsLive()
-// -------------------------------------------------------------------------------------------------
-//
-TBool CMPXVideoViewWrapper::IsLive()
-{
- return EFalse;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::IsPlaylist()
-// -------------------------------------------------------------------------------------------------
-//
-TBool CMPXVideoViewWrapper::IsPlaylist()
-{
- return EFalse;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::CreateGeneralPlaybackCommandL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::CreateGeneralPlaybackCommandL( int aCmd )
-{
- Q_UNUSED( aCmd );
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::HandleCommandL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::HandleCommandL( TInt aCommand )
-{
- switch ( aCommand )
- {
- case EMPXPbvCmdNextListItem:
- {
- SetFileDetails( EFalse );
- break;
- }
-
- case EMPXPbvCmdPreviousListItem:
- {
- SetFileDetails( ETrue );
- break;
- }
- }
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// Request for the media object
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::RequestMediaL()
-{
- iMediaRequested = ETrue;
-
- SetFileDetails( ETrue );
-
-}
-
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::ActivateClosePlayerActiveObject
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::ActivateClosePlayerActiveObject()
-{
- iClosePlayerAO = ETrue;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::IsMultiItemPlaylist()
-// -------------------------------------------------------------------------------------------------
-//
-TBool CMPXVideoViewWrapper::IsMultiItemPlaylist()
-{
- return iFileDetails->mMultiItemPlaylist;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::SetFileDetails()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::SetFileDetails(TBool aDefault)
-{
- if ( iFileDetails )
- {
- delete iFileDetails;
- iFileDetails = NULL;
- }
-
- iFileDetails = new QMPXVideoPlaybackViewFileDetails();
-
-
- _LIT(KTestMimeType, "video/3gp");
- const QString qMimeType( (QChar*)KTestMimeType().Ptr(), KTestMimeType().Length() );
- iFileDetails->mMimeType = qMimeType;
-
-
- _LIT(KTestTitle, "Test Video Title");
- const QString qTitle( (QChar*)KTestTitle().Ptr(), KTestTitle().Length() );
- iFileDetails->mTitle = qTitle;
-
-
- _LIT(KTestArtist, "TestArtist");
- const QString qArtist( (QChar*)KTestArtist().Ptr(), KTestArtist().Length() );
- iFileDetails->mArtist = qArtist;
-
- if ( aDefault )
- {
- _LIT(KTestClipName, "testClip.3gp");
- const QString qClipname( (QChar*)KTestClipName().Ptr(), KTestClipName().Length() );
- iFileDetails->mClipName = qClipname;
- }
- else
- {
- _LIT(KTestClipName, "nextClip.3gp");
- const QString qClipname( (QChar*)KTestClipName().Ptr(), KTestClipName().Length() );
- iFileDetails->mClipName = qClipname;
- }
-
-
- iFileDetails->mPlaybackMode = EMPXVideoLocal;
- iFileDetails->mSeekable = true;
- iFileDetails->mPausableStream = true;
- iFileDetails->mAudioEnabled = true;
- iFileDetails->mVideoEnabled = true;
- iFileDetails->mPartialPlayback = false;
- iFileDetails->mRNFormat = false;
- iFileDetails->mDuration = 100;
- iFileDetails->mTvOutConnected = false;
- iFileDetails->mDrmProtected = false;
- iFileDetails->mMultiItemPlaylist = false;
- iFileDetails->mVideoHeight = 320;
- iFileDetails->mVideoWidth = 240;
- iFileDetails->mBitRate = 16000;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::IssueVideoAppForegroundCmd()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::IssueVideoAppForegroundCmdL( TBool aForeground )
-{
- iForeground = aForeground;
-}
-
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::UpdateVideoRectDone()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::UpdateVideoRectDone()
-{
-}
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/testuserinputhandler.pro Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +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 testuserinputhandler
-#
-#
-# Version : %version: 1 %
-
-TEMPLATE = app
-TARGET = testuserinputhandler
-CONFIG += qtestlib hb qt
-DEFINES += BUILD_VIDEOPLAYBACK_DLL
-
-DEPENDPATH += . \
- inc \
- src
-
-INCLUDEPATH += ../../../inc \
- ../../../../inc \
- ../../controlinc \
-
-
-LIBS += -lremconcoreapi.dll \
- -lremconInterfacebase.dll
-
-
-# Input
-HEADERS += stub/inc/mpxvideoviewwrapper.h \
- stub/inc/hbvideobaseplaybackview.h \
- stub/inc/mpxvideoplaybackviewfiledetails.h \
- stub/inc/hal.h \
- stub/inc/centralrepository.h \
- inc/testuserinputhandler.h \
- ../../viewinc/mpxvideoplaybackuserinputhandler.h
-
-SOURCES += stub/src/mpxvideoviewwrapper.cpp \
- stub/src/hbvideobaseplaybackview.cpp \
- stub/src/mpxvideoplaybackviewfiledetails.cpp \
- stub/src/hal.cpp \
- stub/src/centralrepository.cpp \
- src/testuserinputhandler.cpp \
- ../../viewsrc/mpxvideoplaybackuserinputhandler.cpp
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/inc/testvideodisplayhandler.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +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: tester for methods in Video Display Handler
-*
-*/
-
-#ifndef __TESTVIDEODISPLAYHANDLER_H__
-#define __TESTVIDEODISPLAYHANDLER_H__
-
-
-// INCLUDES
-#include <QtTest/QtTest>
-
-// forward declaration
-class CMPXVideoPlaybackDisplayHandler;
-class MMPXPlaybackUtility;
-class HbVideoBasePlaybackView;
-class CMPXVideoViewWrapper;
-class QMPXVideoPlaybackViewFileDetails;
-
-
-class TestVideoDisplayHandler : public QObject
-{
- Q_OBJECT
-
-public:
-
- /**
- * will be called before each testfunction is executed.
- *
- */
- void init();
-
- /**
- * will be called after every testfunction.
- *
- */
- void cleanup();
-
- void setup();
-
- // test functions for the test framework
-private slots:
-
- // the order in which these testXX methods are declared is important
- // changing this order will affect the test results
- void testCreateDisplayWindowL();
- void testRemoveDisplayWindow();
- void testHandleSurfaceCreatedMessageL();
- void testHandleSurfaceChangedMessageL();
- void testHandleVideoRemovedMessageL();
- void testSetAspectRatioL();
- void testSetDefaultAspectRatioL();
- void testUpdateVideoRectL();
-
-
-signals:
-
-private:
- CMPXVideoPlaybackDisplayHandler* mDispHdlr;
- MMPXPlaybackUtility* mPlaybackUtility;
- HbVideoBasePlaybackView* mBaseVideoView;
- CMPXVideoViewWrapper* mVideoViewWrapper;
- QMPXVideoPlaybackViewFileDetails* mFileDetails;
-
-};
-
-
-#endif // __TESTVIDEODISPLAYHANDLER_H__
-
-// End of file
-
-
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/src/testvideodisplayhandler.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,277 +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: tester for methods in Video Display Handler
-*
-*/
-
-#include <e32err.h>
-#include <w32std.h>
-#include <eikenv.h>
-
-#include <hbapplication.h>
-#include <hbinstance.h>
-#include <QDebug>
-
-#include <mpxplaybackutility.h>
-
-#include "testvideodisplayhandler.h"
-#include "../stub/inc/hbvideobaseplaybackview.h"
-#include "../stub/inc/mpxvideoplaybackviewfiledetails.h"
-#include "mpxvideoviewwrapper.h"
-
-#define private public
-#include "mpxvideoplaybackdisplayhandler.h"
-#undef private
-
-
-// ---------------------------------------------------------------------------
-// main
-// ---------------------------------------------------------------------------
-//
-int main(int argc, char *argv[])
-{
- HbApplication app(argc, argv);
- HbMainWindow window;
-
- TestVideoDisplayHandler tv;
-
- char *pass[3];
- pass[0] = argv[0];
- pass[1] = "-o";
- pass[2] = "c:\\data\\TestVideoDisplayHandler.txt";
-
- int res = QTest::qExec(&tv, 3, pass);
-
- return res;
-}
-
-
-// ---------------------------------------------------------------------------
-// init
-// ---------------------------------------------------------------------------
-//
-void TestVideoDisplayHandler::init()
-{
- mPlaybackUtility = MMPXPlaybackUtility::UtilityL( KPbModeDefault );
-
- mBaseVideoView = new HbVideoBasePlaybackView();
- mVideoViewWrapper = CMPXVideoViewWrapper::NewL( mBaseVideoView );
-
- mDispHdlr = CMPXVideoPlaybackDisplayHandler::NewL(mPlaybackUtility, mVideoViewWrapper);
-}
-
-// ---------------------------------------------------------------------------
-// cleanup
-// ---------------------------------------------------------------------------
-//
-void TestVideoDisplayHandler::cleanup()
-{
- if ( mPlaybackUtility )
- {
- mPlaybackUtility->Close();
- mPlaybackUtility = NULL;
- }
-
- delete mDispHdlr;
- mDispHdlr = NULL;
-
- delete mVideoViewWrapper;
- mVideoViewWrapper = NULL;
-
- delete mBaseVideoView;
- mBaseVideoView = NULL;
-}
-
-// ---------------------------------------------------------------------------
-// setup
-// ---------------------------------------------------------------------------
-//
-void TestVideoDisplayHandler::setup()
-{
- init();
-
- RWindow *window = mBaseVideoView->getWindow();
-
- TRect displayRect = TRect( window->Position().iX,
- window->Position().iY,
- window->Position().iX + window->Size().iWidth,
- window->Position().iY + window->Size().iHeight );
-
- mDispHdlr->CreateDisplayWindowL( CCoeEnv::Static()->WsSession(),
- *(CCoeEnv::Static()->ScreenDevice()),
- *window,
- displayRect);
-
- QCOMPARE( mDispHdlr->iWindowRect, displayRect);
-
-}
-
-
-void TestVideoDisplayHandler::testCreateDisplayWindowL()
-{
- setup();
-
- cleanup();
-}
-
-void TestVideoDisplayHandler::testRemoveDisplayWindow()
-{
- setup();
-
- mDispHdlr->RemoveDisplayWindow();
-
- QVERIFY( mDispHdlr->iVideoContainer == NULL );
-
- cleanup();
-}
-
-void TestVideoDisplayHandler::testHandleSurfaceCreatedMessageL()
-{
- setup();
-
- CMPXMessage* message = NULL;
- TRAP_IGNORE
- (
- message = CMPXMessage::NewL();
- message->SetTObjectValueL<TMPXVideoDisplayCommand>
- ( KMPXMediaVideoDisplayCommand, EPbMsgVideoSurfaceCreated );
- );
-
- mDispHdlr->HandleVideoDisplayMessageL( message );
-
- QVERIFY( ! mDispHdlr->iSurfaceId.IsNull() );
-
- mDispHdlr->RemoveDisplayWindow();
- cleanup();
-}
-
-void TestVideoDisplayHandler::testHandleSurfaceChangedMessageL()
-{
- setup();
-
- CMPXMessage* message = NULL;
- TRAP_IGNORE
- (
- message = CMPXMessage::NewL();
- message->SetTObjectValueL<TMPXVideoDisplayCommand>
- ( KMPXMediaVideoDisplayCommand, EPbMsgVideoSurfaceChanged );
- );
-
- mDispHdlr->HandleVideoDisplayMessageL( message );
-
- QVERIFY( ! mDispHdlr->iSurfaceId.IsNull() );
-
- mDispHdlr->RemoveDisplayWindow();
- cleanup();
-}
-
-void TestVideoDisplayHandler::testHandleVideoRemovedMessageL()
-{
- setup();
-
- CMPXMessage* message = NULL;
- TRAP_IGNORE
- (
- message = CMPXMessage::NewL();
- message->SetTObjectValueL<TMPXVideoDisplayCommand>
- ( KMPXMediaVideoDisplayCommand, EPbMsgVideoSurfaceRemoved );
- );
-
- mDispHdlr->HandleVideoDisplayMessageL( message );
-
- QVERIFY( mDispHdlr->iSurfaceId.IsNull() );
-
- mDispHdlr->RemoveDisplayWindow();
- cleanup();
-}
-
-void TestVideoDisplayHandler::testSetAspectRatioL()
-{
- setup();
-
- int aspectRatio = mDispHdlr->SetAspectRatioL( EPbCmdNaturalAspectRatio );
-
- QVERIFY( aspectRatio == EMMFNatural );
-
- mDispHdlr->RemoveDisplayWindow();
- cleanup();
-}
-
-void TestVideoDisplayHandler::testSetDefaultAspectRatioL()
-{
- setup();
-
- //
- // get window size
- //
- RWindow *window = mBaseVideoView->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);
-
- //
- // aspect ratio zoom
- //
- mFileDetails = new QMPXVideoPlaybackViewFileDetails();
- mFileDetails->mVideoHeight = 280;
- mFileDetails->mVideoWidth = 600;
-
- int aspectRatio = mDispHdlr->SetDefaultAspectRatioL( mFileDetails, displayAspectRatio );
-
- QVERIFY( aspectRatio == EMMFZoom );
-
- //
- // aspect ratio stretch
- //
- mFileDetails->mVideoHeight = 144;
- mFileDetails->mVideoWidth = 220;
-
- aspectRatio = mDispHdlr->SetDefaultAspectRatioL( mFileDetails, displayAspectRatio );
-
- QVERIFY( aspectRatio == EMMFStretch );
-
- mDispHdlr->RemoveDisplayWindow();
-
- cleanup();
-}
-
-void TestVideoDisplayHandler::testUpdateVideoRectL()
-{
- setup();
-
- RWindow *window = mBaseVideoView->getWindow();
-
- TRect displayRect = TRect( 0, 0, 200, 300 );
-
- mDispHdlr->UpdateVideoRectL( displayRect, false );
-
- QCOMPARE( mDispHdlr->iWindowRect, displayRect);
-
- mDispHdlr->RemoveDisplayWindow();
- cleanup();
-}
-
-
-
-// End of file
-
-
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/stub/inc/alfcompositionutility.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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 declaration for CAlfCompositionSource
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-// This file defines the API for .dll
-
-#ifndef __ALFCOMPOSITIONUTILITY_H__
-#define __ALFCOMPOSITIONUTILITY_H__
-
-// Include Files
-
-#include <e32base.h> // CBase
-#include <e32std.h> // TBuf
-
-
-class RWindow;
-
-
-// Class Definitions
-
-class CAlfCompositionSource : public CBase
- {
-
-public:
-
- static CAlfCompositionSource* NewL( RWindow& aClientWindow );
-
- ~CAlfCompositionSource();
-
- /**
- * Enables / disables alpha on composition target
- **/
- TInt EnableAlpha( TBool aEnable = ETrue );
-
- };
-
-#endif // #define __ALFCOMPOSITIONUTILITY_H__
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/stub/inc/hbvideobaseplaybackview.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +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: HB Video playback view
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-// This file defines the API for .dll
-
-#ifndef __HBVIDEOBASEPLAYBACKVIEW_H__
-#define __HBVIDEOBASEPLAYBACKVIEW_H__
-
-// Include Files
-#include <hbview.h>
-
-class CMPXVideoViewWrapper;
-class RWindow;
-
-// Constants
-
-// Forward Declarations
-
-// Class Definitions
-
-class HbVideoBasePlaybackView : public HbView
-{
- Q_OBJECT
-
- public:
- HbVideoBasePlaybackView();
- virtual ~HbVideoBasePlaybackView();
-
- void handleActivateView();
-
- void handleDeactivateView();
-
- void mousePressEvent( QGraphicsSceneMouseEvent *event );
-
- QVariant itemChange( GraphicsItemChange change, const QVariant &value );
-
- void paint( QPainter *painter,
- const QStyleOptionGraphicsItem *option,
- QWidget *widget );
-
- bool event( QEvent *event );
-
- virtual void handleClosePlaybackView();
-
- virtual void handleBufferingState();
-
- virtual void issuePlayCommand();
-
- virtual void handlePluginError( int aError );
-
- virtual void retrievePdlInformation();
-
- virtual void closePlaybackView();
-
- void startClosingPlaybackView();
-
- RWindow *getWindow();
-
- virtual void doClosePlayer();
-
- public:
- int mCurrentError; // default = KErrNone
- bool mViewActive;
-
-
- public:
- friend class CMPXVideoViewWrapper;
-
-};
-
-#endif // __HBVIDEOBASEPLAYBACKVIEW_H__
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/stub/inc/mediaclientvideodisplay.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +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: Stub declaration for CMediaClientVideoDisplay
-//
-
-
-#ifndef MEDIACLIENTVIDEODISPLAY_H
-#define MEDIACLIENTVIDEODISPLAY_H
-
-#include <w32std.h>
-#include <mmf/common/mmfvideosurfacecustomcommands.h>
-
-CMediaClientVideoDisplay : public CBase
- {
-public:
-
- static CMediaClientVideoDisplay* NewL(TInt aDisplayId);
-
- ~CMediaClientVideoDisplay();
-
- CMediaClientVideoDisplay();
-
- void AddDisplayWindowL(const RWindowBase* aWindow, const TRect& aClipRect, const TRect& aCropRegion,
- const TRect& aVideoExtent, TReal32 aScaleWidth, TReal32 aScaleHeight,
- TVideoRotation aRotation, TAutoScaleType aAutoScaleType,
- TInt aHorizPos, TInt aVertPos, RWindow* aWindow2);
-
-
- void RemoveSurface();
-
- TInt SurfaceCreated(const TSurfaceId& aSurfaceId, const TRect& aCropRect, TVideoAspectRatio aAspectRatio, const TRect& aCropRegion);
-
- TInt SurfaceParametersChanged(const TSurfaceId& aSurfaceId, const TRect& aCropRect, TVideoAspectRatio aAspectRatio);
-
- TInt RedrawWindows(const TRect& aCropRegion);
-
- void SetVideoExtentL(const RWindowBase& aWindow, const TRect& aVideoExtent, const TRect& aCropRegion);
-
- void SetAutoScaleL(TAutoScaleType aScaleType, TInt aHorizPos, TInt aVertPos, const TRect& aCropRegion);
-
- };
-
-#endif // MEDIACLIENTVIDEODISPLAY_H
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/stub/inc/mpxvideocontainer.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +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:
-*
-*/
-
-// Version : %version: 1 %
-
-
-#ifndef CMPXVIDEOCONTAINER_H
-#define CMPXVIDEOCONTAINER_H
-
-#include <coecntrl.h>
-
-
-class CMPXVideoContainer : public CCoeControl
-{
-
- public:
- CMPXVideoContainer();
- virtual ~CMPXVideoContainer();
-
- void ConstructL();
-
- protected:
- void Draw(const TRect& aRect) const;
-};
-
-#endif // CMPXVIDEOCONTAINER_H
-
-// End of file
\ No newline at end of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/stub/inc/mpxvideoplaybackviewfiledetails.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +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: MPX Video File Details (QT)
-*
-*/
-
-// Version : %version: 3 %
-
-
-
-
-#ifndef __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-#define __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-
-#include <qobject.h>
-#include "mpxhelixplaybackplugindefs.h"
-
-
-//
-// CLASS DECLARATION
-//
-class QMPXVideoPlaybackViewFileDetails : public QObject
-{
- public:
- //
- // Constructor
- //
- QMPXVideoPlaybackViewFileDetails();
-
- //
- // Destructor.
- //
- virtual ~QMPXVideoPlaybackViewFileDetails();
-
- //
- // Clear all file details
- //
- void clearFileDetails();
-
- public:
- //
- // Data
- //
- QString mClipName;
- QString mTitle;
- QString mArtist;
- QString mMimeType;
- QString mDescription;
- QString mLocation;
- QString mCopyright;
- QString mLanguage;
- QString mKeywords;
-
- TMPXVideoMode mPlaybackMode;
- bool mSeekable;
- bool mPausableStream;
- bool mAudioEnabled;
- bool mVideoEnabled;
- bool mPartialPlayback;
- bool mRNFormat;
- bool mTvOutConnected;
- bool mDrmProtected;
- bool mMultiItemPlaylist;
-
- int mVideoHeight;
- int mVideoWidth;
- int mBitRate;
- int mDuration;
-};
-
-#endif // __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/stub/inc/mpxvideoviewwrapper.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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: MPX Video base playback view
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-// This file defines the API for .dll
-
-#ifndef __MPXVIDEOVIEWWRAPPER_H__
-#define __MPXVIDEOVIEWWRAPPER_H__
-
-// Include Files
-
-#include <e32base.h> // CBase
-#include <e32std.h> // TBuf
-
-
-#include "mpxvideoplaybackcontrol.hrh"
-
-// Constants
-
-// Forward Declarations
-class HbVideoBasePlaybackView;
-class QMPXVideoPlaybackViewFileDetails;
-
-
-// Class Definitions
-
-class CMPXVideoViewWrapper : public CBase
-{
- public:
- static CMPXVideoViewWrapper* NewL( HbVideoBasePlaybackView* aView );
- virtual ~CMPXVideoViewWrapper();
-
- private:
- CMPXVideoViewWrapper( HbVideoBasePlaybackView* aView );
- void ConstructL();
-
- void SetFileDetails(TBool aDefault);
-
- public:
- void HandleCommandL( TInt aCommand );
-
- TBool IsLive();
-
- TBool IsPlaylist();
-
- TBool IsMultiItemPlaylist();
-
- void RequestMediaL();
-
- void CreateGeneralPlaybackCommandL( int aCmd );
-
- void ActivateClosePlayerActiveObject();
-
- void IssueVideoAppForegroundCmdL( TBool aForeground );
-
- void UpdateVideoRectDone();
-
-
- public: // data
-
- HbVideoBasePlaybackView* iView;
- TBool iMediaRequested;
- QMPXVideoPlaybackViewFileDetails* iFileDetails;
- TBool iClosePlayerAO;
- TBool iForeground;
-
-};
-
-#endif // __MPXVIDEOVIEWWRAPPER_H__
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/stub/src/alfcompositionutility.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +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: Stub implementation for CAlfCompositionSource
-*
-*/
-
-// Version : %version: 1 %
-
-// Include Files
-
-#include "alfcompositionutility.h"
-
-
-// -------------------------------------------------------------------------------------------------
-// CAlfCompositionSource::NewL()
-// -------------------------------------------------------------------------------------------------
-//
-CAlfCompositionSource* CAlfCompositionSource::NewL( RWindow& /*aClientWindow*/ )
-{
- CAlfCompositionSource* self = new (ELeave) CAlfCompositionSource();
-
- return self;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CAlfCompositionSource::~CAlfCompositionSource()
-// -------------------------------------------------------------------------------------------------
-//
-CAlfCompositionSource::~CAlfCompositionSource()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// CAlfCompositionSource::EnableAlpha()
-// -------------------------------------------------------------------------------------------------
-//
-TInt CAlfCompositionSource::EnableAlpha(TBool /*aEnable*/)
-{
- return KErrNone;
-}
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/stub/src/hbvideobaseplaybackview.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,194 +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 Video playback view
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-// Include Files
-#include <aknappui.h>
-#include <qgraphicssceneevent>
-#include <hbinstance.h>
-#include <mmf/common/mmferrors.h>
-
-#include "../inc/hbvideobaseplaybackview.h"
-
-
-// Member Functions
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoPlaybackView::HbVideoPlaybackView()
-// -------------------------------------------------------------------------------------------------
-//
-HbVideoBasePlaybackView::HbVideoBasePlaybackView()
-{
- mCurrentError = KErrNone;
- mViewActive = false;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoPlaybackView::~HbVideoPlaybackView()
-// -------------------------------------------------------------------------------------------------
-//
-HbVideoBasePlaybackView::~HbVideoBasePlaybackView()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::handleActivateView()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::handleActivateView()
-{
- mViewActive = true;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::handleDeactivateView()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::handleDeactivateView()
-{
- mViewActive = false;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::mousePress
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::mousePressEvent( QGraphicsSceneMouseEvent *event )
-{
- Q_UNUSED( event );
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::itemChange
-// -------------------------------------------------------------------------------------------------
-//
-QVariant HbVideoBasePlaybackView::itemChange( GraphicsItemChange change, const QVariant &value )
-{
- return QGraphicsWidget::itemChange( change, value );
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::closePlaybackView()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::paint( QPainter *painter,
- const QStyleOptionGraphicsItem *option,
- QWidget *widget )
-{
- Q_UNUSED( painter );
- Q_UNUSED( option );
- Q_UNUSED( widget );
-}
-
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::event()
-// -------------------------------------------------------------------------------------------------
-//
-bool HbVideoBasePlaybackView::event( QEvent *event )
-{
- Q_UNUSED( event );
- bool consumed = false;
-
- return consumed;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::handleClosePlaybackView()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::handleClosePlaybackView()
-{
- mViewActive = false;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::issuePlayCommand
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::issuePlayCommand()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::handleBufferingState
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::handleBufferingState()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::handlePluginError()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::handlePluginError( int aError )
-{
- mCurrentError = aError;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::doClosePlayer
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::doClosePlayer()
-{
- mViewActive = false;
-}
-
-
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::retrievePdlInformation
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::retrievePdlInformation()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::closePlaybackView()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::closePlaybackView()
-{
- mViewActive = false;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::startClosingPlaybackView()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::startClosingPlaybackView()
-{
- mViewActive = false;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::getWindow()
-// -------------------------------------------------------------------------------------------------
-//
-RWindow *HbVideoBasePlaybackView::getWindow()
-{
- return static_cast<RWindow*>( hbInstance->allMainWindows()[0]->effectiveWinId()->DrawableWindow() );
-}
-
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/stub/src/mediaclientvideodisplay.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,136 +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: Stub implementation for CMediaClientVideoDisplay
-*
-*/
-
-// Version : %version: 1 %
-
-// Include Files
-
-#include "mediaclientvideodisplay.h"
-
-
-// -------------------------------------------------------------------------------------------------
-// CAlfCompositionSource::NewL()
-// -------------------------------------------------------------------------------------------------
-//
-CMediaClientVideoDisplay* CMediaClientVideoDisplay::NewL( TInt /*aDisplayId*/ )
-{
- CMediaClientVideoDisplay* self = new (ELeave) CMediaClientVideoDisplay();
-
- return self;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMediaClientVideoDisplay::~CMediaClientVideoDisplay()
-// -------------------------------------------------------------------------------------------------
-//
-CMediaClientVideoDisplay::~CMediaClientVideoDisplay()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMediaClientVideoDisplay::CMediaClientVideoDisplay()
-// -------------------------------------------------------------------------------------------------
-//
-CMediaClientVideoDisplay::CMediaClientVideoDisplay()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMediaClientVideoDisplay::RemoveSurface()
-// -------------------------------------------------------------------------------------------------
-//
-void CMediaClientVideoDisplay::RemoveSurface()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMediaClientVideoDisplay::RemoveSurface()
-// -------------------------------------------------------------------------------------------------
-//
-void CMediaClientVideoDisplay::AddDisplayWindowL(const RWindowBase* /*aWindow*/,
- const TRect& /*aClipRect*/,
- const TRect& /*aCropRegion*/,
- const TRect& /*aVideoExtent*/,
- TReal32 /*aScaleWidth*/,
- TReal32 /*aScaleHeight*/,
- TVideoRotation /*aRotation*/,
- TAutoScaleType /*aAutoScaleType*/,
- TInt /*aHorizPos*/,
- TInt /*aVertPos*/,
- RWindow* /*aWindow2*/)
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMediaClientVideoDisplay::RemoveSurface()
-// -------------------------------------------------------------------------------------------------
-//
-TInt CMediaClientVideoDisplay::SurfaceCreated(const TSurfaceId& /*aSurfaceId*/,
- const TRect& /*aCropRect*/,
- TVideoAspectRatio /*aAspectRatio*/,
- const TRect& /*aCropRegion*/)
-{
- return KErrNone;
-}
-
-
-// -------------------------------------------------------------------------------------------------
-// CMediaClientVideoDisplay::RemoveSurface()
-// -------------------------------------------------------------------------------------------------
-//
-TInt CMediaClientVideoDisplay::SurfaceParametersChanged(const TSurfaceId& /*aSurfaceId*/,
- const TRect& /*aCropRect*/,
- TVideoAspectRatio /*aAspectRatio*/)
-{
- return KErrNone;
-}
-
-
-// -------------------------------------------------------------------------------------------------
-// CMediaClientVideoDisplay::RemoveSurface()
-// -------------------------------------------------------------------------------------------------
-//
-TInt CMediaClientVideoDisplay::RedrawWindows(const TRect& /*aCropRegion*/)
-{
- return KErrNone;
-}
-
-
-// -------------------------------------------------------------------------------------------------
-// CMediaClientVideoDisplay::RemoveSurface()
-// -------------------------------------------------------------------------------------------------
-//
-void CMediaClientVideoDisplay::SetVideoExtentL(const RWindowBase& /*aWindow*/,
- const TRect& /*aVideoExtent*/,
- const TRect& /*aCropRegion*/)
-{
-}
-
-
-// -------------------------------------------------------------------------------------------------
-// CMediaClientVideoDisplay::RemoveSurface()
-// -------------------------------------------------------------------------------------------------
-//
-void CMediaClientVideoDisplay::SetAutoScaleL(TAutoScaleType /*aScaleType*/,
- TInt /*aHorizPos*/,
- TInt /*aVertPos*/,
- const TRect& /*aCropRegion*/)
-{
-}
-
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/stub/src/mpxvideocontainer.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +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:
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#include "mpxvideocontainer.h"
-
-
-CMPXVideoContainer::CMPXVideoContainer()
-{
-}
-
-CMPXVideoContainer::~CMPXVideoContainer()
-{
- CloseWindow();
-}
-
-void CMPXVideoContainer::ConstructL()
-{
- CreateWindowL();
- ActivateL();
-}
-
-void CMPXVideoContainer::Draw( const TRect& /*aRect*/ ) const
-{
- CWindowGc& gc = SystemGc();
- gc.SetPenStyle( CGraphicsContext::ENullPen );
- gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
- gc.SetBrushColor( TRgb::Color16MA( 0 ) );
- gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
- gc.DrawRect( Rect() );
-}
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/stub/src/mpxvideoplaybackviewfiledetails.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +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: class for MPX Video File Details (Qt)
-*
-*/
-
-// Version : %version: 3 %
-
-
-
-//
-// INCLUDE FILES
-//
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackviewfiledetails.h"
-
-
-// ============================ MEMBER FUNCTIONS ===================================================
-
-QMPXVideoPlaybackViewFileDetails::QMPXVideoPlaybackViewFileDetails()
-{
- clearFileDetails();
-}
-
-QMPXVideoPlaybackViewFileDetails::~QMPXVideoPlaybackViewFileDetails()
-{
- clearFileDetails();
-}
-
-void
-QMPXVideoPlaybackViewFileDetails::clearFileDetails()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::ClearFileDetails()"));
-
- mMimeType = tr("");
- mTitle = tr("");
- mArtist = tr("");
- mDescription = tr("");
- mLocation = tr("");
- mCopyright = tr("");
- mLanguage = tr("");
- mKeywords = tr("");
-
- mClipName = QString("testClip.3gp");
-
- mPlaybackMode = EMPXVideoLocal;
- mSeekable = false;
- mPausableStream = false;
- mAudioEnabled = true;
- mVideoEnabled = false;
- mPartialPlayback = false;
- mRNFormat = false;
-
- mDuration = 0;
- mTvOutConnected = false;
- mDrmProtected = false;
- mMultiItemPlaylist = false;
-
- mVideoHeight = 0;
- mVideoWidth = 0;
- mBitRate = 0;
-}
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/stub/src/mpxvideoviewwrapper.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,255 +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 Video base playback view
-*
-*/
-
-// Version : %version: 4 %
-
-
-
-// Include Files
-
-#include "mpxvideoviewwrapper.h"
-#include "hbvideobaseplaybackview.h"
-#include "mpxvideoplaybackviewfiledetails.h"
-#include "mpxcommonvideoplaybackview.hrh"
-
-// Member Functions
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::CMPXVideoViewWrapper()
-// -------------------------------------------------------------------------------------------------
-//
-CMPXVideoViewWrapper::CMPXVideoViewWrapper( HbVideoBasePlaybackView* aView )
- : iView( aView )
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::NewL()
-// -------------------------------------------------------------------------------------------------
-//
-CMPXVideoViewWrapper* CMPXVideoViewWrapper::NewL( HbVideoBasePlaybackView* aView )
-{
- CMPXVideoViewWrapper* self = new (ELeave) CMPXVideoViewWrapper( aView );
-
- CleanupStack::PushL( self );
- self->ConstructL();
- CleanupStack::Pop();
-
- return self;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::ConstructL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::ConstructL()
-{
- iMediaRequested = EFalse;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::~CMPXVideoViewWrapper()
-// -------------------------------------------------------------------------------------------------
-//
-CMPXVideoViewWrapper::~CMPXVideoViewWrapper()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::IsLive()
-// -------------------------------------------------------------------------------------------------
-//
-TBool CMPXVideoViewWrapper::IsLive()
-{
- return EFalse;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::IsPlaylist()
-// -------------------------------------------------------------------------------------------------
-//
-TBool CMPXVideoViewWrapper::IsPlaylist()
-{
- return EFalse;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::CreateGeneralPlaybackCommandL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::CreateGeneralPlaybackCommandL( int aCmd )
-{
- Q_UNUSED( aCmd );
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::HandleCommandL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::HandleCommandL( TInt aCommand )
-{
- switch ( aCommand )
- {
- case EMPXPbvCmdNextListItem:
- {
- SetFileDetails( EFalse );
- break;
- }
-
- case EMPXPbvCmdPreviousListItem:
- {
- SetFileDetails( ETrue );
- break;
- }
- }
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// Request for the media object
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::RequestMediaL()
-{
- iMediaRequested = ETrue;
-
- SetFileDetails( ETrue );
-
-}
-
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::ActivateClosePlayerActiveObject
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::ActivateClosePlayerActiveObject()
-{
- iClosePlayerAO = ETrue;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::IsMultiItemPlaylist()
-// -------------------------------------------------------------------------------------------------
-//
-TBool CMPXVideoViewWrapper::IsMultiItemPlaylist()
-{
- return iFileDetails->mMultiItemPlaylist;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::SetFileDetails()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::SetFileDetails(TBool aDefault)
-{
- if ( iFileDetails )
- {
- delete iFileDetails;
- iFileDetails = NULL;
- }
-
- iFileDetails = new QMPXVideoPlaybackViewFileDetails();
-
-
- _LIT(KTestMimeType, "video/3gp");
- const QString qMimeType( (QChar*)KTestMimeType().Ptr(), KTestMimeType().Length() );
- iFileDetails->mMimeType = qMimeType;
-
-
- _LIT(KTestTitle, "Test Video Title");
- const QString qTitle( (QChar*)KTestTitle().Ptr(), KTestTitle().Length() );
- iFileDetails->mTitle = qTitle;
-
-
- _LIT(KTestArtist, "TestArtist");
- const QString qArtist( (QChar*)KTestArtist().Ptr(), KTestArtist().Length() );
- iFileDetails->mArtist = qArtist;
-
-
- _LIT(KTestDescription, "Test Description");
- const QString qDescription( (QChar*)KTestDescription().Ptr(), KTestDescription().Length() );
- iFileDetails->mDescription = qDescription;
-
-
- _LIT(KTestLocation, "Test Location");
- const QString qLocation( (QChar*)KTestLocation().Ptr(), KTestLocation().Length() );
- iFileDetails->mLocation = qLocation;
-
-
- _LIT(KTestCopyright, "Test Copyright");
- const QString qCopyright( (QChar*)KTestCopyright().Ptr(), KTestCopyright().Length() );
- iFileDetails->mCopyright = qCopyright;
-
-
- _LIT(KTestLanguage, "Test Language");
- const QString qLanguage( (QChar*)KTestLanguage().Ptr(), KTestLanguage().Length() );
- iFileDetails->mLanguage = qLanguage;
-
-
- _LIT(KTestKeywords, "Test Keywords");
- const QString qKeywords( (QChar*)KTestKeywords().Ptr(), KTestKeywords().Length() );
- iFileDetails->mKeywords = qKeywords;
-
-
- if ( aDefault )
- {
- _LIT(KTestClipName, "testClip.3gp");
- const QString qClipname( (QChar*)KTestClipName().Ptr(), KTestClipName().Length() );
- iFileDetails->mClipName = qClipname;
- }
- else
- {
- _LIT(KTestClipName, "nextClip.3gp");
- const QString qClipname( (QChar*)KTestClipName().Ptr(), KTestClipName().Length() );
- iFileDetails->mClipName = qClipname;
- }
-
-
- iFileDetails->mPlaybackMode = EMPXVideoLocal;
- iFileDetails->mSeekable = true;
- iFileDetails->mPausableStream = true;
- iFileDetails->mAudioEnabled = true;
- iFileDetails->mVideoEnabled = true;
- iFileDetails->mPartialPlayback = false;
- iFileDetails->mRNFormat = false;
- iFileDetails->mDuration = 100;
- iFileDetails->mTvOutConnected = false;
- iFileDetails->mDrmProtected = false;
- iFileDetails->mMultiItemPlaylist = false;
- iFileDetails->mVideoHeight = 320;
- iFileDetails->mVideoWidth = 240;
- iFileDetails->mBitRate = 16000;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::IssueVideoAppForegroundCmd()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::IssueVideoAppForegroundCmdL( TBool aForeground )
-{
- iForeground = aForeground;
-}
-
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::UpdateVideoRectDone()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::UpdateVideoRectDone()
-{
-}
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/testvideodisplayhandler.pro Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +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: 2 %
-
-TEMPLATE = app
-TARGET = testvideodisplayhandler
-CONFIG += qtestlib hb qt
-DEFINES += BUILD_VIDEOPLAYBACK_DLL
-
-DEPENDPATH += inc src stub/inc stub/src
-
-INCLUDEPATH += ../../../inc \
- ../../../../inc \
- ../../controlinc \
- $$MW_LAYER_SYSTEMINCLUDE
-
-LIBS += -lmpxplaybackutility.dll \
- -lmpxcommon.dll \
- -lestor.dll \
- -lsysutil.dll \
- -lcone.dll \
- -lefsrv.dll \
- -lws32.dll \
- -lgdi.dll
-
-# Input
-HEADERS += mpxvideoviewwrapper.h \
- hbvideobaseplaybackview.h \
- mpxvideoplaybackviewfiledetails.h \
- mpxvideocontainer.h \
- alfcompositionutility.h \
- mediaclientvideodisplay.h \
- testvideodisplayhandler.h \
- ../../viewinc/mpxvideoplaybackdisplayhandler.h
-
-SOURCES += mpxvideoviewwrapper.cpp \
- hbvideobaseplaybackview.cpp \
- mpxvideoplaybackviewfiledetails.cpp \
- mpxvideocontainer.cpp \
- alfcompositionutility.cpp \
- mediaclientvideodisplay.cpp \
- testvideodisplayhandler.cpp \
- ../../viewsrc/mpxvideoplaybackdisplayhandler.cpp
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/inc/testmpxvideoplaybackcontrolscontroller.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,141 +0,0 @@
-/**
-* 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: tester for methods in Video Playback Controls Controller
-*
-*/
-
-// Version : %version: 6 %
-
-#ifndef __TESTMPXVIDEOPLAYBACKCONTROLSCONTROLLER_H__
-#define __TESTMPXVIDEOPLAYBACKCONTROLSCONTROLLER_H__
-
-
-// INCLUDES
-#include <QtTest/QtTest>
-#include "mpxvideoplaybackcontrol.hrh"
-
-// FORWARD DECLARATIONS
-class HbVideoBasePlaybackView;
-class CMPXVideoViewWrapper;
-class QMPXVideoPlaybackControlsController;
-class QMPXVideoPlaybackViewFileDetails;
-
-class TestMPXVideoPlaybackControlsController : public QObject
-{
- Q_OBJECT
-
-public:
-
- /**
- * will be called before each testfunction is executed.
- *
- */
- void init();
-
- /**
- * will be called after every testfunction.
- *
- */
- void cleanup();
-
-private:
-
- void verifyHandleEventStateChangedResult( int value );
- void verifyHandleEventTvOutResult( bool tvOutConnected, bool value );
-
-private slots:
-
- void testAddFileDetails();
- void testHandleEventSetPosition();
- void testHandleEventSetDuration();
- void testHandleEventStateChanged();
- void testHandleEventSetVolume();
- void testHandleEventSetAspectRatio();
- void testHandleEventSetDownloadSize();
- void testHandleEventDownloadUpdated();
- void testHandleEventDownloadComplete();
- void testHandleEventSetDownloadPaused();
- void testHandleEventClearDownloadPaused();
- void testHandleEventTvOutConnected();
- void testHandleEventTvOutDisconnected();
- void testHandleEventHandleErrors();
- void testHandleEventShowVolumeControls();
-
- //
- // test handleCommand()
- //
- void testHandleCommand();
-
- //
- // test handleTappedOnScreen()
- //
- void testHandleTappedOnScreen();
-
- //
- // test updateVideoRectDone()
- //
- void testUpdateVideoRectDone();
-
- //
- // test isAttachOperation()
- //
- void testIsAttachOperation();
-
- //
- // test private slot skipToNextVideoItem()
- //
- void testslot_skipToNextVideoItem();
-
- //
- // test private slot skipToPreviousVideoItem()
- //
- void testslot_skipToPreviousVideoItem();
-
- //
- // test private slot attachVideo()
- //
- void testslot_attachVideo();
-
- //
- // test private slot attachVideo()
- //
- 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:
-
- HbVideoBasePlaybackView* mBaseVideoView;
- CMPXVideoViewWrapper* mViewWrapper;
- QMPXVideoPlaybackControlsController* mController;
- QMPXVideoPlaybackViewFileDetails* mFileDetails;
-
-};
-
-
-#endif // __TESTMPXVIDEOPLAYBACKCONTROLSCONTROLLER_H__
-
-// End of file
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/src/testmpxvideoplaybackcontrolscontroller.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1249 +0,0 @@
-/**
-* 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: tester for methods in Video Playback Controls Controller
-*
-*/
-
-// Version : %version: 10 %
-
-#include <e32err.h>
-#include <w32std.h>
-#include <qobject>
-
-#include <hbapplication.h>
-#include <hbinstance.h>
-#include <hblabel.h>
-#include <MMFScalingCustomCommandConstants.h>
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackcontrol.hrh"
-#include "mpxcommonvideoplaybackview.hrh"
-#include "testmpxvideoplaybackcontrolscontroller.h"
-#include "hbvideobaseplaybackview.h"
-#include "mpxvideoplaybackviewfiledetails.h"
-#include "mpxvideoviewwrapper.h"
-#include "mpxvideoplaybackfullscreencontrol.h"
-#include "mpxvideoplaybackcontrolconfiguration.h"
-#include "thumbnailmanager_qt.h"
-#include "mpxvideoplaybackdocumentloader.h"
-#include "hbvolumesliderpopup.h"
-#include "videoservices.h"
-#include "xqserviceutilxtra.h"
-
-#define private public
-#include "mpxvideoplaybackcontrolscontroller.h"
-#undef private
-
-const TInt KControlListsUpdated = 12; // additional extension of TMPXPlaybackState
-
-// ---------------------------------------------------------------------------
-// main
-// ---------------------------------------------------------------------------
-//
-int main(int argc, char *argv[])
-{
- HbApplication app(argc, argv);
- HbMainWindow window;
- TestMPXVideoPlaybackControlsController tv;
-
- char *pass[3];
- pass[0] = argv[0];
- pass[1] = "-o";
- pass[2] = "c:\\data\\TestMPXVideoPlaybackControlsController.txt";
-
- int res = QTest::qExec(&tv, 3, pass);
-
- return res;
-}
-
-// ---------------------------------------------------------------------------
-// init
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlsController::init()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackControlsController::init()"));
-
- mBaseVideoView = new HbVideoBasePlaybackView();
-
- if ( ! mFileDetails )
- {
- mFileDetails = new QMPXVideoPlaybackViewFileDetails();
- }
- mViewWrapper = CMPXVideoViewWrapper::NewL( mBaseVideoView );
- mController = new QMPXVideoPlaybackControlsController( mBaseVideoView,
- mViewWrapper,
- mFileDetails );
-}
-
-// ---------------------------------------------------------------------------
-// cleanup
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlsController::cleanup()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackControlsController::cleanup()"));
-
- delete mController;
- mController = NULL;
-
- delete mFileDetails;
- mFileDetails = NULL;
-
- delete mViewWrapper;
- mViewWrapper = NULL;
-
- delete mBaseVideoView;
- mBaseVideoView = NULL;
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestMPXVideoPlaybackControlsController::testAddFileDetails
-// -------------------------------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlsController::testAddFileDetails()
-{
- MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testAddFileDetails()") );
-
- //
- // local real media with no video
- //
- 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;
- QFileInfo videoOnlyFile( mFileDetails->mClipName );
-
- mController->addFileDetails( mFileDetails );
-
- QVERIFY( mController->mFileDetails->mRNFormat == false );
- QVERIFY( mController->mControlsConfig->mUpdateControlsWithFileDetails == true );
-
- //
- // validate 'TvOutConnected'
- //
- verifyHandleEventTvOutResult(true, true);
-
- //
- // video-only, validate volume control is dimmed
- //
- QVERIFY( mController->mVolumeControl->mValue == 0 );
- QVERIFY( mController->mVolumeControl->isEnabled() == false );
-
- //
- // verify 'title' (via mClipName) is set properly
- //
- for ( int i=0 ; i < mController->mLoader->mWidgets.count() ; i++ )
- {
- if( mController->mLoader->mWidgets[i]->objectName() == QString( "title" ) )
- {
- HbLabel *titleLabel = qobject_cast<HbLabel*>( mController->mLoader->mWidgets[i] );
- QVERIFY( titleLabel->plainText() == videoOnlyFile.baseName() );
- 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 );
- QVERIFY( mController->mControlsConfig->mUpdateControlsWithFileDetails == true );
-
- //
- // verify 'title' (via mTitle) is set properly
- //
- for ( int i=0 ; i < mController->mLoader->mWidgets.count() ; i++ )
- {
- if( mController->mLoader->mWidgets[i]->objectName() == QString( "title" ) )
- {
- HbLabel *titleLabel = qobject_cast<HbLabel*>( mController->mLoader->mWidgets[i] );
- QVERIFY( titleLabel->plainText() == mFileDetails->mTitle );
- break;
- }
- }
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestMPXVideoPlaybackControlsController::testHandleEventSetPosition
-// -------------------------------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlsController::testHandleEventSetPosition()
-{
- MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventSetPosition()"));
-
- init();
- int value = 20000;
-
- mController->handleEvent( EMPXControlCmdSetPosition, value );
-
- QVERIFY( mController->mControls[0]->mPosition == ( value / KPbMilliMultiplier ) );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestMPXVideoPlaybackControlsController::testHandleEventSetDuration
-// -------------------------------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlsController::testHandleEventSetDuration()
-{
- MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventSetDuration()"));
-
- init();
- int value = 30000;
-
- mController->handleEvent( EMPXControlCmdSetDuration, value );
-
- QVERIFY( mController->mControls[0]->mDuration == ( value / KPbMilliMultiplier ) );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestMPXVideoPlaybackControlsController::testHandleEventStateChanged
-// -------------------------------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlsController::testHandleEventStateChanged()
-{
- MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventStateChanged()"));
-
- init();
- TMPXVideoPlaybackControlCommandIds event = EMPXControlCmdStateChanged;
- mController->mOrientation = Qt::Horizontal;
-
- //
- // state change (EPbStateInitialising)
- //
- int value = EPbStateInitialising;
- mController->handleEvent( event, value );
- verifyHandleEventStateChangedResult( value );
-
- //
- // state change (EPbStateBuffering)
- //
- value = EPbStateBuffering;
- mController->handleEvent( event, value );
- verifyHandleEventStateChangedResult( value );
-
- //
- // state change (EPbStatePlaying)
- //
- value = EPbStatePlaying;
- mController->handleEvent( event, value );
- verifyHandleEventStateChangedResult( value );
-
- //
- // state change (EPbStatePaused)
- //
- value = EPbStatePaused;
- mController->handleEvent( event, value );
- verifyHandleEventStateChangedResult( value );
-
- //
- // state change (EPbStateNotInitialised)
- //
- value = EPbStateNotInitialised;
- mController->handleEvent( event, value );
- verifyHandleEventStateChangedResult( value );
-
- //
- // state change (EPbStateStopped)
- //
- value = EPbStateStopped;
- mController->handleEvent( event, value );
- verifyHandleEventStateChangedResult( value );
-
- //
- // state change (EPbStateSeekingForward)
- //
- value = EPbStateSeekingForward;
- mController->handleEvent( event, value );
- verifyHandleEventStateChangedResult( value );
-
- //
- // state change (EPbStateSeekingBackward)
- //
- value = EPbStateSeekingBackward;
- mController->handleEvent( event, value );
- verifyHandleEventStateChangedResult( value );
-
- //
- // state change (EPbStateShuttingDown)
- //
- value = EPbStateShuttingDown;
- mController->handleEvent( event, value );
- verifyHandleEventStateChangedResult( value );
-
- //
- // state change (EPbStateDownloading)
- //
- value = EPbStateDownloading;
- mController->handleEvent( event, value );
- verifyHandleEventStateChangedResult( value );
-
- //
- // state change (EPbStatePluginSeeking)
- //
- value = EPbStatePluginSeeking;
- mController->handleEvent( event, value );
- verifyHandleEventStateChangedResult( value );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestMPXVideoPlaybackControlsController::verifyHandleEventStateChangedResult
-// -------------------------------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlsController::verifyHandleEventStateChangedResult( int value )
-{
- MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::verifyHandleEventStateChangedResult()"));
-
- mController->mOrientation = Qt::Horizontal;
-
- if ( value == EPbStateInitialised &&
- ( mController->mFileDetails->mPlaybackMode == EMPXVideoStreaming ||
- mController->mFileDetails->mPlaybackMode == EMPXVideoLiveStreaming ) )
- {
- QVERIFY( mController->mControlsConfig->mState == EMPXControlCmdPluginInitialized );
- }
- else if ( value == EPbStatePlaying || value == EPbStateInitialising ||
- value == EPbStateBuffering || value == EPbStatePaused ||
- value == EPbStateNotInitialised )
- {
- for ( int i = 0 ; i < mController->mControls.count() ; i++ )
- {
- QVERIFY( mController->mControls[i]->mState == value );
- QVERIFY( mController->mControls[i]->mVisibilityState == value );
- }
- }
- else
- {
- QVERIFY( mController->mState == value );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestMPXVideoPlaybackControlsController::testHandleEventSetVolume
-// -------------------------------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlsController::testHandleEventSetVolume()
-{
- MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventSetVolume()"));
-
- init();
- int value = 40;
-
- mController->handleEvent( EMPXControlCmdSetVolume, value );
- QVERIFY( mController->mVolumeControl->mValue == value );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestMPXVideoPlaybackControlsController::testHandleEventSetAspectRatio
-// -------------------------------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlsController::testHandleEventSetAspectRatio()
-{
- MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventSetAspectRatio()"));
-
- init();
- int numScalingType = 5;
-
- for ( int i = 0; i < numScalingType; i++ )
- {
- mController->handleEvent( EMPXControlCmdSetAspectRatio, i );
-
- QVERIFY( mController->mControls[0]->mAspectRatio == i );
- }
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestMPXVideoPlaybackControlsController::testHandleEventSetDownloadSize
-// -------------------------------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlsController::testHandleEventSetDownloadSize()
-{
- MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventSetDownloadSize()") );
-
- init();
- int value = 50;
-
- mController->handleEvent( EMPXControlCmdSetDownloadSize, value );
-
- QVERIFY( mController->mControls[0]->mDownloadSize == value );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestMPXVideoPlaybackControlsController::testHandleEventDownloadUpdated
-// -------------------------------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlsController::testHandleEventDownloadUpdated()
-{
- MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventDownloadUpdated()") );
-
- init();
- int value = 55;
-
- mController->handleEvent( EMPXControlCmdDownloadUpdated, value );
-
- QVERIFY( mController->mControls[0]->mDownloadPosition == value );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestMPXVideoPlaybackControlsController::testHandleEventDownloadComplete
-// -------------------------------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlsController::testHandleEventDownloadComplete()
-{
- MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventDownloadComplete()") );
-
- init();
- int value = 60;
-
- mController->handleEvent( EMPXControlCmdDownloadComplete, value );
-
- QVERIFY( mController->mControls[0]->mDownloadPosition == value );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestMPXVideoPlaybackControlsController::testHandleEventSetDownloadPaused
-// -------------------------------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlsController::testHandleEventSetDownloadPaused()
-{
- MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventSetDownloadPaused()") );
-
- init();
- int value = 0;
-
- mController->handleEvent( EMPXControlCmdSetDownloadPaused, value );
-
- QVERIFY( mController->mControlsConfig->mState == KControlListsUpdated );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestMPXVideoPlaybackControlsController::testHandleEventClearDownloadPaused
-// -------------------------------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlsController::testHandleEventClearDownloadPaused()
-{
- MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventClearDownloadPaused()") );
-
- init();
- int value = 0;
-
- mController->handleEvent( EMPXControlCmdClearDownloadPaused, value );
-
- QVERIFY( mController->mControlsConfig->mState == KControlListsUpdated );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestMPXVideoPlaybackControlsController::testHandleEventTvOutConnected
-// -------------------------------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlsController::testHandleEventTvOutConnected()
-{
- MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventTvOutConnected()") );
-
- init();
-
- //
- // TV-Out Connected, value = true, EMPXVideoLocal
- //
- mController->handleEvent( EMPXControlCmdTvOutConnected, true );
- verifyHandleEventTvOutResult( true, true );
-
- //
- // TV-Out Connected, value = false, EMPXVideoLocal
- //
- mController->handleEvent( EMPXControlCmdTvOutConnected, false );
- verifyHandleEventTvOutResult( true, false );
-
- //
- // TV-Out Connected, value = false, non-EMPXVideoLocal
- //
- mController->mFileDetails->mPlaybackMode = EMPXVideoStreaming;
- mController->handleEvent( EMPXControlCmdTvOutConnected, false );
- verifyHandleEventTvOutResult( true, false );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestMPXVideoPlaybackControlsController::verifyHandleEventTvOutResult
-// -------------------------------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlsController::verifyHandleEventTvOutResult( bool tvOutConnected,
- bool value )
-{
- MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::verifyHandleEventTvOutResult(%d,%d)"),
- tvOutConnected, value );
-
- QVERIFY( mController->mFileDetails->mTvOutConnected == tvOutConnected );
-
- //
- // validate setDefaultBitmap()
- //
- for ( int i=0 ; i < mController->mLoader->mWidgets.count() ; i++ )
- {
- bool val = mController->mLoader->isVisible(i);
-
- if( mController->mLoader->mWidgets[i]->objectName() == QString( "tvOutBitmap" ) )
- {
- QVERIFY( tvOutConnected? val == true : val == false );
- }
- else if( mController->mLoader->mWidgets[i]->objectName() == QString( "realAudioOnlyBitmap" ) )
- {
- QVERIFY( mFileDetails->mRNFormat? val == true : val == false );
- }
- else if( mController->mLoader->mWidgets[i]->objectName() == QString( "partialAudioOnlyBitmap" ) )
- {
- QVERIFY( mFileDetails->mPartialPlayback? val == true : val == false );
- }
- else if( mController->mLoader->mWidgets[i]->objectName() == QString( "audioOnlyBitmap" ) )
- {
- QVERIFY( tvOutConnected? val == false : val == true );
- }
- }
-
- //
- // validate generateThumbNail()
- //
- if ( tvOutConnected )
- {
- QVERIFY( ( mController->mFileDetails->mPlaybackMode == EMPXVideoLocal )?
- mController->mThumbNailState == EThumbNailRequsted :
- mController->mThumbNailState == EThumbNailNotAvailable );
- QVERIFY( mController->mViewMode == EAudioOnlyView );
- QVERIFY( mController->mControlsConfig->mState == EMPXControlCmdTvOutConnected );
- QVERIFY( mController->mThumbnailManager->mThumbSize == ThumbnailManager::ThumbnailLarge );
- QVERIFY( mController->mThumbnailManager->mQuality == ThumbnailManager::OptimizeForPerformance );
- QVERIFY( mController->mViewTransitionIsGoingOn == false );
- }
- else if ( mController->mFileDetails->mVideoEnabled )
- {
- QVERIFY( mController->mViewTransitionIsGoingOn == true );
- QVERIFY( mController->mViewMode == EFullScreenView );
- }
- else if ( ! mController->mFileDetails->mVideoEnabled )
- {
- QVERIFY( mController->mViewTransitionIsGoingOn == false );
- QVERIFY( mController->mViewMode == EAudioOnlyView );
- }
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestMPXVideoPlaybackControlsController::testHandleEventTvOutDisconnected
-// -------------------------------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlsController::testHandleEventTvOutDisconnected()
-{
- MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventTvOutDisconnected()") );
-
- init();
-
- //
- // TV-Out Disconnected, value = true
- //
- mController->handleEvent( EMPXControlCmdTvOutDisconnected, true );
- verifyHandleEventTvOutResult( false, true );
-
- //
- // TV-Out Disconnected, value = false
- //
- mController->handleEvent( EMPXControlCmdTvOutDisconnected, false );
- verifyHandleEventTvOutResult( false, false );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestMPXVideoPlaybackControlsController::testHandleEventHandleErrors
-// -------------------------------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlsController::testHandleEventHandleErrors()
-{
- MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventHandleErrors()") );
-
- init();
-
- //
- // handle error
- //
- mController->handleEvent( EMPXControlCmdHandleErrors, 0 );
-
- QVERIFY( mController->mThumbNailState == EThumbNailEmpty );
- QVERIFY( mController->mState == EPbStateNotInitialised );
- QVERIFY( mController->mViewMode == EFullScreenView );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestMPXVideoPlaybackControlsController::testHandleEventShowVolumeControls
-// -------------------------------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlsController::testHandleEventShowVolumeControls()
-{
- MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventShowVolumeControls()") );
-
- init();
-
- mController->handleEvent( EMPXControlCmdShowVolumeControls, 0 );
-
- QVERIFY( mController->mVolumeControl->mVisible == true );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestMPXVideoPlaybackControlsController::testHandleCommand
-// -------------------------------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlsController::testHandleCommand()
-{
- MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleCommand()") );
-
- init();
-
- mController->handleCommand( EMPXPbvCmdSetPosition, 0 );
- QVERIFY( mViewWrapper->mProperty == EPbPropertyPosition );
-
- mController->handleCommand( EMPXPbvCmdSetVolume, 0 );
- QVERIFY( mViewWrapper->mProperty == EPbPropertyVolume );
-
- mController->handleCommand( EMPXPbvCmdPlay, 0 );
- QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdPlay );
-
- mController->handleCommand( EMPXPbvCmdPause, 0 );
- QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdPause );
-
- mController->handleCommand( EMPXPbvCmdPlayPause, 0 );
- QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdPlayPause );
-
- mController->handleCommand( EMPXPbvCmdStop, 0 );
- QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdStop );
-
- mController->handleCommand( EMPXPbvCmdClose, 0 );
- QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdClose );
-
- mController->handleCommand( EMPXPbvCmdMute, 0 );
- QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdMute );
-
- mController->handleCommand( EMPXPbvCmdUnMute, 0 );
- QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdUnMute );
-
- mController->handleCommand( EMPXPbvCmdChangeAspectRatio, 0 );
- QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdChangeAspectRatio );
-
- mController->handleCommand( EMPXPbvCmdNaturalAspectRatio, 0 );
- QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdNaturalAspectRatio );
-
- mController->handleCommand( EMPXPbvCmdZoomAspectRatio, 0 );
- QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdZoomAspectRatio );
-
- mController->handleCommand( EMPXPbvCmdStretchAspectRatio, 0 );
- QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdStretchAspectRatio );
-
- mController->handleCommand( EMPXPbvCmdSeekForward, 0 );
- QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdSeekForward );
-
- mController->handleCommand( EMPXPbvCmdSeekBackward, 0 );
- QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdSeekBackward );
-
- mController->handleCommand( EMPXPbvCmdEndSeek, 0 );
- QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdEndSeek );
-
- mController->handleCommand( EMPXPbvCmdNextListItem, 0 );
- QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdNextListItem );
-
- mController->handleCommand( EMPXPbvCmdPreviousListItem, 0 );
- QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdPreviousListItem );
-
- mController->handleCommand( EMPXPbvCmdDecreaseVolume, 0 );
- QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdDecreaseVolume );
-
- mController->handleCommand( EMPXPbvCmdIncreaseVolume, 0 );
- QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdIncreaseVolume );
-
- mController->handleCommand( EMPXPbvCmdPosition, 0 );
- QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdPosition );
-
- mController->handleCommand( EMPXPbvCmdSave, 0 );
- QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdSave );
-
- mController->handleCommand( EMPXPbvCmdResetControls, 0 );
- QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdResetControls );
-
- mController->handleCommand( EMPXPbvCmdShortPressForward, 0 );
- QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdShortPressForward );
-
- mController->handleCommand( EMPXPbvCmdShortPressBackward, 0 );
- QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdShortPressBackward );
-
- mController->handleCommand( EMPXPbvCmdShowFileDetails, 0 );
- QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdShowFileDetails );
-
- mController->handleCommand( EMPXPbvCmdEndOfClip, 0 );
- QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdEndOfClip );
-
- mController->handleCommand( EMPXPbvCmdCustomPause, 0 );
- QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdCustomPause );
-
- mController->handleCommand( EMPXPbvCmdCustomPlay, 0 );
- QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdCustomPlay );
-
- mController->handleCommand( EMPXPbvCmdExit, 0 );
- QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdExit );
-
- mController->handleCommand( EMPXPbvLaunchDRMDetails, 0 );
- QVERIFY( mViewWrapper->mCommandId == EMPXPbvLaunchDRMDetails );
-
- mController->handleCommand( EMPXPbvSurfaceCreated, 0 );
- QVERIFY( mViewWrapper->mCommandId == EMPXPbvSurfaceCreated );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestMPXVideoPlaybackControlsController::testHandleTappedOnScreen
-// -------------------------------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlsController::testHandleTappedOnScreen()
-{
- MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleTappedOnScreen()") );
-
- init();
- mController->mOrientation = Qt::Horizontal;
- connect( this, SIGNAL( commandSignal() ), mController, SLOT( handleTappedOnScreen() ) );
-
- //
- // 1. Test full screen view
- //
- mController->mViewMode = EFullScreenView;
-
- //
- // playing state
- //
- mController->mState = EPbStatePlaying;
- emit commandSignal();
-
- QVERIFY( mController->mControlsTimer->isActive() == true );
- for ( int i = 0 ; i < mController->mControls.count() ; i++ )
- {
- QVERIFY( mController->mControls[i]->mVisibilityState == mController->mState );
- }
-
- //
- // pause state
- //
- mController->mState = EPbStatePaused;
- emit commandSignal();
-
- QVERIFY( mController->mControlsTimer->isActive() == false );
- for ( int i = 0 ; i < mController->mControls.count() ; i++ )
- {
- QVERIFY( mController->mControls[i]->mVisibilityState == mController->mState );
- }
-
-
- //
- // 2. Test details screen view
- //
- mController->mViewMode = EDetailsView;
-
- emit commandSignal();
- QVERIFY( mController->mViewWrapper->mCommandId == EMPXPbvCmdPlayPause );
-
- disconnect( this, SIGNAL( commandSignal() ), mController, SLOT( handleTappedOnScreen() ) );
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestMPXVideoPlaybackControlsController::testUpdateVideoRectDone
-// -------------------------------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlsController::testUpdateVideoRectDone()
-{
- MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testUpdateVideoRectDone()") );
-
- init();
-
- mController->updateVideoRectDone();
-
- //
- // default is full-screen
- //
- QVERIFY( mController->mControlsConfig->mState == EMPXControlCmdFullScreenViewOpened );
-
- //
- // validate Details view
- //
- mController->mViewMode = EDetailsView;
-
- mController->updateVideoRectDone();
-
- QVERIFY( mController->mControlsConfig->mState == EMPXControlCmdDetailsViewOpened );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestMPXVideoPlaybackControlsController::testIsAttachOperation
-// -------------------------------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlsController::testIsAttachOperation()
-{
- MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testIsAttachOperation()") );
-
- //
- // get access to XQServiceUtilXtra stub
- //
- XQServiceUtilXtra* extraUtil = XQServiceUtilXtra::instance();
-
- //
- // set service enable
- //
- extraUtil->setCurrentService( true );
-
- //
- // initialize controlscontroller
- //
- init();
-
- //
- // verify 'mIsAttachOperation' flag is enabled
- //
- QVERIFY( mController->mIsAttachOperation == true );
-
- //
- // clean up
- //
- cleanup();
-
- //
- // set service disable
- //
- extraUtil->setCurrentService( false );
-
- //
- // initialize controlscontroller
- //
- init();
-
- //
- // verify 'mIsAttachOperation' flag is disabled
- //
- QVERIFY( mController->mIsAttachOperation == false );
-
- //
- // clean up
- //
- cleanup();
-
- //
- // dereference extraUtil count
- //
- extraUtil->decreaseReferenceCount();
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestMPXVideoPlaybackControlsController::testslot_skipToNextVideoItem
-// -------------------------------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlsController::testslot_skipToNextVideoItem()
-{
- MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testslot_skipToNextVideoItem()") );
-
- init();
-
- connect( this, SIGNAL( commandSignal() ), mController, SLOT( skipToNextVideoItem() ) );
-
- //
- // If we are not in full screen view, ignore
- //
- mViewWrapper->mCommandId = EMPXPbvCmdPosition;
- mController->mViewMode = EDetailsView;
-
- emit commandSignal();
-
- QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdPosition );
-
- //
- // If we are in full screen view, issue EMPXPbvCmdNextListItem;
- //
- mController->mViewMode = EFullScreenView;
-
- emit commandSignal();
-
- QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdNextListItem );
-
- disconnect( this, SIGNAL( commandSignal() ), mController, SLOT( skipToNextVideoItem() ) );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestMPXVideoPlaybackControlsController::testslot_skipToPreviousVideoItem
-// -------------------------------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlsController::testslot_skipToPreviousVideoItem()
-{
- MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testslot_skipToPreviousVideoItem()") );
-
- init();
-
- connect( this, SIGNAL( commandSignal() ), mController, SLOT( skipToPreviousVideoItem() ) );
-
- //
- // If we are not in full screen view, ignore
- //
- mViewWrapper->mCommandId = EMPXPbvCmdPosition;
- mController->mViewMode = EDetailsView;
-
- emit commandSignal();
-
- QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdPosition );
-
- //
- // If we are in full screen view, issue EMPXPbvCmdPreviousListItem
- //
- mController->mViewMode = EFullScreenView;
-
- emit commandSignal();
-
- QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdPreviousListItem );
-
- disconnect( this, SIGNAL( commandSignal() ), mController, SLOT( skipToPreviousVideoItem() ) );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestMPXVideoPlaybackControlsController::testslot_attachVideo
-// -------------------------------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlsController::testslot_attachVideo()
-{
- MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testslot_attachVideo()") );
-
- //
- // get access to XQServiceUtilXtra stub to enable XQServiceUtil::isService() method
- //
- XQServiceUtilXtra* extraUtil = XQServiceUtilXtra::instance();
-
- //
- // set service enable
- //
- extraUtil->setCurrentService( true );
-
- //
- // initialize controlscontroller
- //
- init();
-
- //
- // verify view closePlaybackView() slot is not yet called
- //
- QVERIFY( mController->mView->mViewClosed == false );
-
- //
- // connect signal with controller attachVideo() slot
- //
- bool res = connect( this, SIGNAL( commandSignal() ), mController, SLOT( attachVideo() ) );
-
- //
- // emit signal, this will in turns invoke videoservices itemSelected() slot
- //
- emit commandSignal();
-
- //
- // verify view closePlaybackView() slot is called
- //
- QVERIFY( mController->mView->mViewClosed == true );
-
- //
- // verify videoservices itemSelected() slot is called
- //
- QVERIFY( mController->mVideoServices->mItemSelected == true );
-
- //
- // disconnect signal
- //
- disconnect( this, SIGNAL( commandSignal() ), mController, SLOT( attachVideo() ) );
-
- //
- // clean up
- //
- cleanup();
-
- //
- // dereference extraUtil count
- //
- extraUtil->decreaseReferenceCount();
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestMPXVideoPlaybackControlsController::testslot_sendVideo
-// -------------------------------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackControlsController::testslot_sendVideo()
-{
- MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testslot_sendVideo()") );
-
- //
- // initialize controlscontroller
- //
- init();
-
- //
- // connect signal with controller sendVideoo() slot
- //
- bool res = connect( this, SIGNAL( commandSignal() ), mController, SLOT( sendVideo() ) );
-
- //
- // emit signal, this will in turns invoke mController sendVideo() slot
- //
- emit commandSignal();
-
- //
- // verify command EMPXPbvCmdClose has been issued
- //
- QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdPause );
-
- //
- // disconnect signal
- //
- disconnect( this, SIGNAL( commandSignal() ), mController, SLOT( sendVideo() ) );
-
- //
- // clean up
- //
- 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
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/hbvideobaseplaybackview.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
-* 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: HB Video playback view
-*
-*/
-
-// Version : %version: 3 %
-
-
-
-// This file defines the API for .dll
-
-#ifndef __HBVIDEOBASEPLAYBACKVIEW_H__
-#define __HBVIDEOBASEPLAYBACKVIEW_H__
-
-// Include Files
-#include <hbview.h>
-
-class CMPXVideoViewWrapper;
-class RWindow;
-
-// Constants
-
-// Forward Declarations
-
-// Class Definitions
-
-class HbVideoBasePlaybackView : public HbView
-{
- Q_OBJECT
-
- public:
- HbVideoBasePlaybackView();
- virtual ~HbVideoBasePlaybackView();
-
- signals:
- void tappedOnScreen();
-
- public slots:
- void closePlaybackView();
-
- public:
- bool mViewClosed;
-
-};
-
-#endif // __HBVIDEOBASEPLAYBACKVIEW_H__
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/hbvolumesliderpopup.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
-* 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 HbVolumeSliderPopup
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-#ifndef HBVOLUMESLIDERPOPUP_H
-#define HBVOLUMESLIDERPOPUP_H
-
-#include <hbwidget.h>
-
-
-class HbVolumeSliderPopup : public HbWidget
-{
- Q_OBJECT
-
- public:
- HbVolumeSliderPopup();
- virtual ~HbVolumeSliderPopup();
-
- public:
- void setEnabled( bool enabled );
- void setVisible( bool visible );
- bool isEnabled();
- bool isVisible();
- void setValue( int value );
- void setTimeout( int timeout );
- void setTickPosition( Hb::SliderTickPositions position );
- void setRange( int min, int max );
-
- public:
- bool mVisible;
- bool mEnabled;
- int mValue;
- int mTimeOut;
- int mMin;
- int mMax;
- Hb::SliderTickPositions mPosition;
-};
-
-#endif /*HBVOLUMESLIDERPOPUP_H*/
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/mpxvideoplaybackcontrol.hrh Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +0,0 @@
-/*
-* 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: header file of CMPXVideoPlaybackControl
-*
-*/
-
-// Version : %version: 2 %
-
-
-#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_*/
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/mpxvideoplaybackcontrolbar.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackControlBar
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKCONTROLBAR_H_
-#define MPXVIDEOPLAYBACKCONTROLBAR_H_
-
-
-
-#include <hbwidget.h>
-#include <mpxplaybackframeworkdefs.h>
-
-class QMPXVideoPlaybackViewFileDetails;
-class QMPXVideoPlaybackControlsController;
-
-class QMPXVideoPlaybackControlBar : public HbWidget
-{
- Q_OBJECT
-
- public:
- QMPXVideoPlaybackControlBar( QMPXVideoPlaybackControlsController* controller );
- virtual ~QMPXVideoPlaybackControlBar();
- void initialize();
-
- public:
- QMPXVideoPlaybackControlsController *mController;
-};
-
-#endif /*MPXVIDEOPLAYBACKCONTROLBAR_H_*/
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/mpxvideoplaybackcontrolconfiguration.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +0,0 @@
-/*
-* Copyright (c) 20101 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 CMPXVideoPlaybackControlConfiguration
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKCONTROLCONFIGURATION_H_
-#define MPXVIDEOPLAYBACKCONTROLCONFIGURATION_H_
-
-// INCLUDES
-#include <qobject>
-
-#include <mpxplaybackframeworkdefs.h>
-#include "mpxvideoplaybackcontrol.hrh"
-#include "mpxhelixplaybackplugindefs.h"
-
-// FORWARD DECLARATIONS
-class QMPXVideoPlaybackControlsController;
-
-// DATA TYPES
-
-// CLASS DECLARATION
-class QMPXVideoPlaybackControlConfiguration : public QObject
-{
- Q_OBJECT
-
- public:
-
- /**
- * constructor.
- */
- QMPXVideoPlaybackControlConfiguration( QMPXVideoPlaybackControlsController* controller );
-
- /**
- * Destructor.
- */
- virtual ~QMPXVideoPlaybackControlConfiguration();
-
- public:
- /**
- * Update control list
- */
- void updateControlList( TMPXVideoPlaybackControlCommandIds event );
-
- /**
- * Return control list
- */
- QList<TMPXVideoPlaybackControls>& controlList();
-
- void updateControlsWithFileDetails();
-
- /**
- * Create control list
- */
- void createControlList();
-
- private:
-
- /**
- * Delete controls from list
- */
- void deleteControlFromList( TMPXVideoPlaybackControls control );
-
- /**
- * Add controls to list
- */
- void addControlToList( TMPXVideoPlaybackControls control );
-
- signals:
- void controlListUpdated();
-
- public:
-
- TInt mState;
- bool mUpdateControlsWithFileDetails;
-
- private:
- QMPXVideoPlaybackControlsController *mControlsController;
- QList<TMPXVideoPlaybackControls> mControlsList;
-};
-
-#endif /*MPXVIDEOPLAYBACKCONTROLCONFIGURATION_H_*/
-
-// End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/mpxvideoplaybackcontrolpolicy.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
-* 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 MPXVideoPlaybackControlPolicy
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKCONTROLPOLICY_H_
-#define MPXVIDEOPLAYBACKCONTROLPOLICY_H_
-
-// INCLUDES
-#include <qobject>
-
-#include "mpxvideoplaybackcontrol.hrh"
-#include "mpxvideoplaybackcontrolscontroller.h"
-
-// FORWARD DECLARATIONS
-class QMPXVideoPlaybackViewFileDetails;
-
-// DATA TYPES
-
-// CLASS DECLARATION
-class QMPXVideoPlaybackControlPolicy : public QObject
-{
- Q_OBJECT
-
- public:
-
- /**
- * Two-phased constructor.
- */
- QMPXVideoPlaybackControlPolicy();
-
- /**
- * Destructor.
- */
- virtual ~QMPXVideoPlaybackControlPolicy();
-
- public:
- /**
- * Sets the control properties per policy
- */
- void setControlProperties( TMPXVideoPlaybackControls controlIndex,
- TUint& properties,
- QMPXVideoPlaybackViewFileDetails *details,
- TPlaybackViewMode viewMode );
-};
-
-#endif /*MPXVIDEOPLAYBACKCONTROLPOLICY_H_*/
-
-// End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/mpxvideoplaybackdetailsplaybackwindow.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackDetailsPlaybackWindow
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKDETAILSPLAYBACKWINDOW_H_
-#define MPXVIDEOPLAYBACKDETAILSPLAYBACKWINDOW_H_
-
-#include <hbwidget.h>
-
-
-class QMPXVideoPlaybackControlsController;
-
-class QMPXVideoPlaybackDetailsPlaybackWindow : public HbWidget
-{
- Q_OBJECT
-
- public:
- QMPXVideoPlaybackDetailsPlaybackWindow( QMPXVideoPlaybackControlsController* controller );
- virtual ~QMPXVideoPlaybackDetailsPlaybackWindow();
- void initialize();
-
- private:
- QMPXVideoPlaybackControlsController *mController;
-
- bool mInitialized;
-};
-
-#endif /*MPXVIDEOPLAYBACKDETAILSPLAYBACKWINDOW_H_*/
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/mpxvideoplaybackdisplayhandler.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,173 +0,0 @@
-/*
-* 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 video playback display handler
-*
-*/
-
-// Version : %version: 1 %
-
-
-#ifndef __CMPXVIDEOPLAYBACKDISPLAYHANDLER_H__
-#define __CMPXVIDEOPLAYBACKDISPLAYHANDLER_H__
-
-// INCLUDES
-
-#include <mpxmessage2.h>
-#include <mmfscalingcustomcommandconstants.h>
-#include <mpxvideoplaybackdefs.h>
-#ifdef SYMBIAN_BUILD_GCE
-#include <mediaclientvideodisplay.h>
-#else
-#include <w32std.h>
-#endif
-
-
-//
-// CLASS DECLARATION
-//
-class MMPXPlaybackUtility;
-class CMPXVideoViewWrapper;
-class QMPXVideoPlaybackViewFileDetails;
-
-/*
- * CMPXVideoPlaybackDisplayHandler
- *
- */
-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();
-
- static CMPXVideoPlaybackDisplayHandler* NewL( MMPXPlaybackUtility* aPlayUtil,
- CMPXVideoViewWrapper* aViewWrapper );
-
- void CreateDisplayWindowL( RWsSession& aWs,
- CWsScreenDevice& aScreenDevice,
- RWindow& aWin,
- TRect aDisplayRect );
-
- void RemoveDisplayWindow();
-
- void HandleVideoDisplayMessageL( CMPXMessage* aMessage );
-
- TInt SetAspectRatioL( TMPXVideoPlaybackCommand aCmd );
-
- TInt SetDefaultAspectRatioL( QMPXVideoPlaybackViewFileDetails* aFileDetails,
- TReal aDisplayAspectRatio );
-
- void UpdateVideoRectL( TRect aRect, TBool transitionEffect );
-
- private:
-
- CMPXVideoPlaybackDisplayHandler( MMPXPlaybackUtility* aPlayUtil,
- 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<TMPXAspectRatio> 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
-
-};
-
-#endif // __CMPXVIDEOPLAYBACKDISPLAYHANDLER_H__
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/mpxvideoplaybackdocumentloader.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackDocumentLoader
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKDOCUMENTHANDLER_H_
-#define MPXVIDEOPLAYBACKDOCUMENTHANDLER_H_
-
-
-#include <qobject>
-#include <hbdocumentloader.h>
-
-class QList;
-class QGraphicsWidget;
-class QMPXVideoPlaybackControlsController;
-
-class QMPXVideoPlaybackDocumentLoader : public QObject
-{
- public:
- QMPXVideoPlaybackDocumentLoader( QMPXVideoPlaybackControlsController *controller );
-
- virtual ~QMPXVideoPlaybackDocumentLoader();
-
- public:
-
- QGraphicsWidget* findWidget( const QString &name );
- void load( const QString &fileName, const QString §ion , bool *ok );
- void load( const QString &fileName, bool *ok );
- bool isVisible( int index );
-
- private:
- QGraphicsWidget* createWidget( const QString &name );
- int exist( const QString &name );
-
- public:
- QList<QGraphicsWidget*> mWidgets;
-
- private:
-
- QMPXVideoPlaybackControlsController* mController;
- int mIndex;
-};
-
-#endif /*MPXVIDEOPLAYBACKDOCUMENTHANDLER_H_*/
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/mpxvideoplaybackfiledetailswidget.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackFileDetailsWidget
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKFILEDETAILSWIDGET_H_
-#define MPXVIDEOPLAYBACKFILEDETAILSWIDGET_H_
-
-#include <hbwidget.h>
-
-class QMPXVideoPlaybackControlsController;
-
-
-class QMPXVideoPlaybackFileDetailsWidget : public HbWidget
-{
- Q_OBJECT
-
- public:
- QMPXVideoPlaybackFileDetailsWidget( QMPXVideoPlaybackControlsController* controller );
- virtual ~QMPXVideoPlaybackFileDetailsWidget();
- void initialize();
-
- private:
- QMPXVideoPlaybackControlsController *mController;
-};
-
-#endif /*MPXVIDEOPLAYBACKFILEDETAILSWIDGET_H_*/
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/mpxvideoplaybackfullscreencontrol.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,124 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackFullScreenControl
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKFULLSCREENCONTROL_H_
-#define MPXVIDEOPLAYBACKFULLSCREENCONTROL_H_
-
-#include <qobject>
-
-#include <mpxvideoplaybackcontrol.hrh>
-#include <mpxplaybackframeworkdefs.h>
-
-class HbWidget;
-class QMPXVideoPlaybackViewFileDetails;
-class QMPXVideoPlaybackControlsController;
-
-class QMPXVideoPlaybackFullScreenControl : public QObject
-{
- Q_OBJECT
-
- public:
- QMPXVideoPlaybackFullScreenControl( QMPXVideoPlaybackControlsController* controller,
- TMPXVideoPlaybackControls index,
- HbWidget* widget,
- TUint controlproperties );
-
- virtual ~QMPXVideoPlaybackFullScreenControl();
-
- public:
-
- /**
- * Set visibility of each control
- */
- virtual void setVisibility( TMPXPlaybackState aState );
-
- /**
- * return control index
- */
- TMPXVideoPlaybackControls controlIndex();
-
- /**
- * set changed volume
- */
- bool volumeChanged( int aVolume );
-
- /**
- * set changed duration
- */
- bool durationChanged( int duration );
-
- /**
- * set changed volume
- */
- bool positionChanged( int position );
-
- /**
- * Set changed position
- */
- bool aspectRatioChanged( int aspectRatio );
-
- /**
- * set changed volume
- */
- bool setDownloadSize( int size );
-
- /**
- * set changed state
- */
- void updateState( TMPXPlaybackState state );
-
- /*
- * UpdateDownloadPosition
- * updates the download ratio on the progress bar
- */
- bool updateDownloadPosition( int size );
-
- /*
- * Update the controls with the file details
- */
- virtual void updateControlsWithFileDetails( QMPXVideoPlaybackViewFileDetails *details );
-
- virtual void setVisible( bool visible );
-
- virtual bool isVisible();
-
- virtual void updateControlProperties( TUint properties );
-
- public:
- int mPosition;
- int mDuration;
- int mAspectRatio;
- int mDownloadSize;
- int mDownloadPosition;
- int mVolume;
-
- bool mVisible;
- TMPXPlaybackState mState;
- TMPXPlaybackState mVisibilityState;
-
- QMPXVideoPlaybackControlsController* mController;
- HbWidget *mControl;
- TMPXVideoPlaybackControls mControlIndex;
- TUint mProperties;
-};
-
-#endif /*MPXVIDEOPLAYBACKFULLSCREENCONTROL_H_*/
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/mpxvideoplaybackstatuspanecontrol.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackStatusPaneControl
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKSTATUSPANECONTROL_H_
-#define MPXVIDEOPLAYBACKSTATUSPANECONTROL_H_
-
-
-#include "mpxvideoplaybackfullscreencontrol.h"
-
-
-class QMPXVideoPlaybackControlsController;
-
-class QMPXVideoPlaybackStatusPaneControl : public QMPXVideoPlaybackFullScreenControl
-{
- Q_OBJECT
-
- public:
- QMPXVideoPlaybackStatusPaneControl( QMPXVideoPlaybackControlsController* controller,
- TMPXVideoPlaybackControls index,
- HbWidget* widget,
- TUint controlproperties );
-
- virtual ~QMPXVideoPlaybackStatusPaneControl();
-
-};
-
-#endif /*MPXVIDEOPLAYBACKSTATUSPANECONTROL_H_*/
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/mpxvideoplaybackviewfiledetails.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
-* 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: MPX Video File Details (QT)
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-
-#ifndef __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-#define __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-
-#include <qobject.h>
-#include "mpxhelixplaybackplugindefs.h"
-
-
-//
-// CLASS DECLARATION
-//
-class QMPXVideoPlaybackViewFileDetails : public QObject
-{
- public:
- //
- // Constructor
- //
- QMPXVideoPlaybackViewFileDetails();
-
- //
- // Destructor.
- //
- virtual ~QMPXVideoPlaybackViewFileDetails();
-
- //
- // Clear all file details
- //
- void clearFileDetails();
-
- public:
- //
- // Data
- //
- QString mClipName;
- QString mTitle;
- QString mArtist;
- QString mMimeType;
- QString mDescription;
- QString mLocation;
- QString mCopyright;
- QString mLanguage;
- QString mKeywords;
-
- TMPXVideoMode mPlaybackMode;
- bool mSeekable;
- bool mPausableStream;
- bool mAudioEnabled;
- bool mVideoEnabled;
- bool mPartialPlayback;
- bool mRNFormat;
- bool mTvOutConnected;
- bool mDrmProtected;
- bool mMultiItemPlaylist;
-
- int mVideoHeight;
- int mVideoWidth;
- int mBitRate;
- int mDuration;
-};
-
-#endif // __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/mpxvideoviewwrapper.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/*
-* 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 MPX Video Wrapper
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-// This file defines the API for .dll
-
-#ifndef __MPXVIDEOVIEWWRAPPER_H__
-#define __MPXVIDEOVIEWWRAPPER_H__
-
-// Include Files
-
-#include <e32base.h> // CBase
-#include <e32std.h> // TBuf
-#include <mpxplaybackframeworkdefs.h>
-
-#include "mpxvideoplaybackcontrol.hrh"
-
-// Constants
-
-// Forward Declarations
-class HbVideoBasePlaybackView;
-class QMPXVideoPlaybackViewFileDetails;
-
-
-// Class Definitions
-
-class CMPXVideoViewWrapper : public CBase
-{
- public:
- static CMPXVideoViewWrapper* NewL( HbVideoBasePlaybackView* aView );
- virtual ~CMPXVideoViewWrapper();
-
- CMPXVideoViewWrapper( HbVideoBasePlaybackView* aView );
- void ConstructL();
-
- public:
- void HandleCommandL( TInt aCommand );
-
- void SetPropertyL( TMPXPlaybackProperty aProperty, TInt aValue );
-
- void UpdateVideoRect( TInt aX, TInt aY, TInt aWidth, TInt aHeight, TBool transitionEffect );
-
-
- public: // data
-
- HbVideoBasePlaybackView* mView;
- TBool mMediaRequested;
- QMPXVideoPlaybackViewFileDetails* mFileDetails;
- TBool mClosePlayerAO;
- TBool mForeground;
- int mProperty;
- int mCommandId;
-};
-
-#endif // __MPXVIDEOVIEWWRAPPER_H__
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/shareui.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/**
-* 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: ShareUI STUB class definition
-*
-*/
-
-// Version : %version: 1 %
-
-#ifndef SHAREUI_H_
-#define SHAREUI_H_
-
-class ShareUi
-{
-
- public:
-
- ShareUi();
- ~ShareUi();
-
- bool send( QStringList& fileList, bool embedded );
-
-};
-
-#endif
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/thumbnailmanager_qt.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,382 +0,0 @@
-/*
-* 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 tn manager object
- *
-*/
-
-// Version : %version: 1 %
-
-
-#ifndef THUMBNAILMANAGER_QT_H
-#define THUMBNAILMANAGER_QT_H
-
-#include <qobject>
-#include <QPixmap.h>
-#include <qmap.h>
-
-class QString;
-class QSize;
-
-class ThumbnailManager : public QObject
- {
- Q_OBJECT
-
-public:
- /** Thumbnail size. */
- enum ThumbnailSize
- {
- /**
- * Small thumbnail (64x64 ?)
- */
- ThumbnailSmall = 0,
- /**
- * Medium thumbnail (128x128 ?)
- */
- ThumbnailMedium,
- /**
- * Large thumbnail (256x256 ?)
- */
- ThumbnailLarge
- };
-
- /** Mode of thumbnail creation. */
- enum ThumbnailMode
- {
- /**
- * Default mode. This means that:
- * - Thumbnail must be as large as requested (unless the actual object is smaller).
- * - Smaller thumbnails may be up scaled to desired resolution.
- * - Aspect ratio is maintained and thumbnails are not cropped. The
- * resulting thumbnail may smaller in either width or height if
- * the aspect ratio of the object does not match the aspect ratio
- * of the requested size.
- */
- Default = 0,
-
- /**
- * Allow thumbnails which are smaller than requested are. Thumbnail
- * bitmaps are never up scaled if this flag is set.
- */
- AllowAnySize = 1,
-
- /**
- * New thumbnail images are not created if this flag is set. Only
- * existing thumbnails may be returned. If a requested thumbnail does
- * not exist null pixmap will be returned.
- */
- DoNotCreate = 2,
-
- /**
- * Thumbnail images are cropped to match requested aspect ratio. If
- * this mode is set, the size of the resulting thumbnail always
- * matches the requested size.
- */
- CropToAspectRatio = 4
- };
-
- /** Priority of the request. */
- enum Priority
- {
- PriorityIdle=-100,
- PriorityLow=-20,
- PriorityStandard=0,
- PriorityUserInput=10,
- PriorityHigh=20,
- };
-
- /** Quality versus speed preference setting */
- enum QualityPreference
- {
- /**
- * Prefer thumbnails in the highest quality possible disregarding
- * any negative impact on performance.
- */
- OptimizeForQuality,
-
- /**
- * Get thumbnails as fast as possible, even if
- * it means lower quality.
- */
- OptimizeForPerformance
- };
-
- /** Display modes. */
- enum DisplayMode
- {
- /** No display mode */
- None,
-
- /** Monochrome display mode (1 bpp) */
- Gray2,
-
- /** Four grayscales display mode (2 bpp) */
- Gray4,
-
- /** 16 grayscales display mode (4 bpp) */
- Gray16,
-
- /** 256 grayscales display mode (8 bpp) */
- Gray256,
-
- /** Low colour GA 16 colour display mode (4 bpp) */
- Color16,
-
- /** 256 colour display mode (8 bpp) */
- Color256,
-
- /** 64,000 colour display mode (16 bpp) */
- Color64K,
-
- /** True colour display mode (24 bpp) */
- Color16M,
-
- /** (Not an actual display mode used for moving buffers containing bitmaps) */
- Rgb,
-
- /** 4096 colour display (12 bpp). */
- Color4K,
-
- /** True colour display mode (32 bpp, but top byte is unused and unspecified) */
- Color16MU,
-
- /** Display mode with alpha (24bpp colour plus 8bpp alpha) */
- Color16MA,
-
- /** Pre-multiplied Alpha display mode
- * (24bpp color multiplied with the alpha channel value, plus 8bpp alpha) */
- Color16MAP
- };
-
- struct TnRequest {
- QString name;
- void *id;
- int priority;
- bool cancelled;
-
- TnRequest(QString name, void *id, int priority, bool cancelled) {
- this->name = name;
- this->id = id;
- this->priority = priority;
- this->cancelled = cancelled;
- }
-
- TnRequest() {
- name = QString("");
- id = 0;
- priority = PriorityIdle;
- cancelled = false;
- }
- };
-
- /**
- * Constructor
- *
- * @param parentPtr parent
- */
- ThumbnailManager( QObject* parentPtr = NULL );
-
- /**
- * Destructor
- */
- virtual ~ThumbnailManager();
-
- /**
- * Get quality versus performance preference.
- *
- * @return quality versus performance preference
- */
- QualityPreference qualityPreference() const;
-
- /**
- * Set quality versus performance preference.
- *
- * @param qualityPreference New quality versus performance preference
- * value.
- * @return true on success
- */
- bool setQualityPreference( QualityPreference qualityPreference );
-
- /**
- * Get the current display mode for thumbnail bitmaps.
- *
- * @return current display mode for thumbnail bitmaps
- */
- DisplayMode displayMode() const;
-
- /**
- * Set new display mode for thumbnail bitmaps.
- *
- * @param displayMode new display mode for thumbnail bitmaps.
- * @return true on success
- */
- bool setDisplayMode( DisplayMode displayMode );
-
- /**
- * Get the current desired size for thumbnail bitmaps.
- *
- * @return Current desired size for thumbnail bitmaps (in pixels).
- */
- QSize thumbnailSize() const;
-
- /**
- * Set desired size for thumbnail bitmaps.
- *
- * @param thumbnailSize New desired thumbnail size.
- * @return true on success
- */
- bool setThumbnailSize( const QSize& thumbnailSize );
-
- /**
- * Set desired size for thumbnail bitmaps.
- *
- * @param thumbnailSize New desired thumbnail size.
- * @return true on success
- */
- bool setThumbnailSize( ThumbnailSize thumbnailSize );
-
- /**
- * Get current mode for thumbnail generation.
- *
- * @return Current mode.
- */
- ThumbnailMode mode() const;
-
- /**
- * Set mode for thumbnail generation.
- *
- * @param mode New flags.
- * @return true on success
- */
- bool setMode( ThumbnailMode mode );
-
- /**
- * Get a thumbnail for an object file. If a thumbnail already exists, it
- * is loaded and if a thumbnail does not exist, it is created
- * transparently. If thumbnail loadinf fails thumbnailReady signal is emited
- * with null pixmap and error code.
- *
- * @param fileName Source object or file
- * @param clientData Pointer to arbitrary client data.
- * This pointer is not used by the API for
- * anything other than returning it in the
- * ThumbnailReady signal.
- * @param priority Priority for this operation
- * @return Thumbnail request ID or -1 if request failed. This can be used to
- * cancel the request or change priority.
- * The ID is specific to this tnm
- * instance and may not be shared with other
- * instances.
- */
- int getThumbnail( const QString& fileName, void * clientData = NULL,
- int priority = PriorityIdle );
-
- /**
- * Get a persistent thumbnail for an object file. If a thumbnail already
- * exists, it is loaded and if a thumbnail does not exist, it is created
- * transparently. If thumbnail loading fails thumbnailReady signal is emited
- * with null pixmap and error code.
- *
- * @param thumbnailId Thumbnail ID
- * @param clientData Pointer to arbitrary client data.
- * This pointer is not used by the API for
- * anything other than returning it in the
- * ThumbnailReady signal.
- * @param priority Priority for this operation
- * @return Thumbnail request ID or -1 if request failed. This can be used to
- * cancel the request or change priority.
- * The ID is specific to this tnm
- * instance and may not be shared with other
- * instances.
- */
- int getThumbnail( unsigned long int thumbnailId, void * clientData = NULL,
- int priority = PriorityIdle );
-
- /**
- * Set a thumbnail for an object file generated from pixmap delivered.
- * thumbnailReady() signal will be emited when the operation is complete.
- *
- * @param source Pixmap from which the thumbnail will be created
- * @param fileName file name
- * @param clientData Pointer to arbitrary client data.
- * This pointer is not used by the API for
- * anything other than returning it in the
- * ThumbnailReady callback.
- * @param priority Priority for this operation
- * @return Thumbnail request ID or -1 if request failed. This can be used to
- * cancel the request or change priority.
- *
- */
- int setThumbnail( const QPixmap& source, const QString& fileName,
- void * clientData = NULL, Priority priority = PriorityIdle );
-
- /**
- * Delete all thumbnails for a given object. This is an asynchronous
- * operation, which always returns immediately.
- *
- * @param fileName Source file
- */
- void deleteThumbnails( const QString& fileName );
-
- /**
- * Delete all thumbnails for a given object. This is an asynchronous
- * operation, which always returns immediately.
- *
- * @param thumbnailId thumbnail id
- */
- void deleteThumbnails( unsigned long int thumbnailId );
-
- /**
- * Cancel a thumbnail operation.
- *
- * @param id Request ID for the operation to be cancelled.
- * @return true if cancelling was successful.
- */
- bool cancelRequest( int id );
-
- /**
- * Change the priority of a queued thumbnail operation.
- *
- * @param id Request ID for the request which to assign a new
- * priority.
- * @param newPriority New priority value
- * @return true if change was successful.
- */
- bool changePriority( int id, Priority newPriority );
-
-
- void emitThumbnailReady(int tnId );
-
-signals:
- /**
- * Final thumbnail bitmap generation or loading is complete.
- *
- * @param pixmap An object representing the resulting thumbnail.
- * @param clientData Client data
- * @param id Request ID for the operation
- * @param errorCode error code
- */
- void thumbnailReady( QPixmap , void * , int , int );
-
-public:
-
- static QMap<int, TnRequest> mRequests;
-
- ThumbnailSize mThumbSize;
- QualityPreference mQuality;
- bool mGetThumbFails;
- int mThumbnailReadyError;
-
-};
-
-#endif // QTNMWRAPPER_H
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/videoservices.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
-* 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: VideoServices STUB class definition
-*
-*/
-
-// Version : %version: 1 %
-
-#ifndef __VIDEOSERVICES_H__
-#define __VIDEOSERVICES_H__
-
-#include <QStringList>
-
-#include "videoserviceurifetch.h"
-
-class VideoServiceUriFetch;
-
-class VideoServices : public QObject
-{
- Q_OBJECT
-
- public:
-
- enum TVideoService
- {
- ENoService,
- EUriFetcher,
- EPlayback,
- EView
- };
-
- static VideoServices *instance();
- void decreaseReferenceCount();
- QString contextTitle() { return QString(""); }
- VideoServices::TVideoService currentService();
-
- public slots:
-
- void itemSelected( const QString& item );
-
- private:
-
- VideoServices();
- virtual ~VideoServices();
- void setCurrentService( VideoServices::TVideoService service );
-
- Q_DISABLE_COPY( VideoServices )
-
- private:
-
- static VideoServices* mInstance;
- VideoServiceUriFetch* mServiceUriFetch;
- VideoServices::TVideoService mCurrentService;
-
- private:
-
- friend class VideoServiceUriFetch;
-
- public:
-
- static int mReferenceCount;
- bool mItemSelected;
-
-};
-
-#endif //__VIDEOSERVICES_H__
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/videoserviceurifetch.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-/*
-* 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: VideoServiceUriFetch STUB class definition
-*
-*/
-
-// Version : %version: 1 %
-
-#ifndef __VIDEOSERVICESURIFETCH_H__
-#define __VIDEOSERVICESURIFETCH_H__
-
-#include <qobject>
-
-class VideoServices;
-
-class VideoServiceUriFetch : public QObject
-{
- Q_OBJECT
-
- public:
-
- VideoServiceUriFetch( VideoServices *parent = 0 );
- ~VideoServiceUriFetch();
-
-};
-
-#endif //__VIDEOSERVICESURIFETCH_H__
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/xqserviceutil.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/**
-* 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: XQServiceUtil STUB class definition
-*
-*/
-
-// Version : %version: 1 %
-
-#ifndef XQSERVICEUTIL_H
-#define XQSERVICEUTIL_H
-
-#include <QObject>
-
-namespace XQServiceUtil
-{
- static void toBackground( bool value );
- static bool isEmbedded();
- static bool isService();
-}
-
-
-#endif
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/xqserviceutilxtra.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/**
-* 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: XQServiceUtilXtra STUB class definition
-*
-*/
-
-// Version : %version: 1 %
-
-#ifndef XQSERVICEUTILXTRA_H_
-#define XQSERVICEUTILXTRA_H_
-
-#include <QObject>
-
-class XQServiceUtilXtra : public QObject
-{
- Q_OBJECT
-
- public:
-
- static XQServiceUtilXtra *instance();
- void decreaseReferenceCount();
- bool currentService();
- void setCurrentService( bool service );
-
- private:
-
- XQServiceUtilXtra();
- static XQServiceUtilXtra* mInstance;
- virtual ~XQServiceUtilXtra();
-
- Q_DISABLE_COPY( XQServiceUtilXtra )
-
- public:
-
- static int mReferenceCount;
- static bool service;
-
-};
-#endif
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/hbvideobaseplaybackview.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
-* 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 Video playback view
-*
-*/
-
-// Version : %version: 3 %
-
-
-
-// Include Files
-#include <aknappui.h>
-#include <qgraphicssceneevent>
-#include <hbinstance.h>
-#include <mmf/common/mmferrors.h>
-
-#include "../inc/hbvideobaseplaybackview.h"
-#include "mpxvideo_debug.h"
-
-
-// Member Functions
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoPlaybackView::HbVideoPlaybackView()
-// -------------------------------------------------------------------------------------------------
-//
-HbVideoBasePlaybackView::HbVideoBasePlaybackView()
- : mViewClosed( false )
-{
- MPX_DEBUG(_L("HbVideoBasePlaybackView::HbVideoBasePlaybackView()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoPlaybackView::~HbVideoPlaybackView()
-// -------------------------------------------------------------------------------------------------
-//
-HbVideoBasePlaybackView::~HbVideoBasePlaybackView()
-{
- MPX_DEBUG(_L("HbVideoBasePlaybackView::~HbVideoBasePlaybackView()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::closePlaybackView()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::closePlaybackView()
-{
- MPX_DEBUG(_L("HbVideoBasePlaybackView::closePlaybackView()"));
- mViewClosed = true;
-}
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/hbvolumesliderpopup.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-/*
-* 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 HbVolumeSliderPopup
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-#include "mpxvideo_debug.h"
-#include "hbvolumesliderpopup.h"
-
-// -------------------------------------------------------------------------------------------------
-// HbVolumeSliderPopup::HbVolumeSliderPopup
-// -------------------------------------------------------------------------------------------------
-//
-HbVolumeSliderPopup::HbVolumeSliderPopup()
-{
- MPX_ENTER_EXIT(_L("HbVolumeSliderPopup::HbVolumeSliderPopup()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVolumeSliderPopup::~HbVolumeSliderPopup
-// -------------------------------------------------------------------------------------------------
-//
-HbVolumeSliderPopup::~HbVolumeSliderPopup()
-{
- MPX_DEBUG(_L("HbVolumeSliderPopup::HbVolumeSliderPopup") );
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVolumeSliderPopup::setEnabled
-// -------------------------------------------------------------------------------------------------
-//
-void HbVolumeSliderPopup::setEnabled( bool enabled )
-{
- MPX_DEBUG(_L("HbVolumeSliderPopup::setEnabled %d"), enabled );
-
- mEnabled = enabled;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVolumeSliderPopup::isEnabled
-// -------------------------------------------------------------------------------------------------
-//
-bool HbVolumeSliderPopup::isEnabled()
-{
- MPX_DEBUG(_L("HbVolumeSliderPopup::isEnabled %d"), mEnabled );
-
- return mEnabled;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVolumeSliderPopup::setVisible
-// -------------------------------------------------------------------------------------------------
-//
-void HbVolumeSliderPopup::setVisible( bool visible )
-{
- MPX_DEBUG(_L("HbVolumeSliderPopup::setVisible %d"), visible );
-
- mVisible = visible;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVolumeSliderPopup::isVisible
-// -------------------------------------------------------------------------------------------------
-//
-bool HbVolumeSliderPopup::isVisible()
-{
- MPX_DEBUG(_L("HbVolumeSliderPopup::isVisible %d"), mVisible );
-
- return mVisible;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVolumeSliderPopup::setValue
-// -------------------------------------------------------------------------------------------------
-//
-void HbVolumeSliderPopup::setValue( int value )
-{
- MPX_DEBUG(_L("HbVolumeSliderPopup::setValue %d"), value );
-
- mValue = value;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVolumeSliderPopup::setTimeout
-// -------------------------------------------------------------------------------------------------
-//
-void HbVolumeSliderPopup::setTimeout( int timeout )
-{
- MPX_DEBUG(_L("HbVolumeSliderPopup::setTimeout %d"), timeout );
-
- mTimeOut = timeout;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVolumeSliderPopup::setTickPosition
-// -------------------------------------------------------------------------------------------------
-//
-void HbVolumeSliderPopup::setTickPosition( Hb::SliderTickPositions position )
-{
- MPX_DEBUG(_L("HbVolumeSliderPopup::setTickPosition"));
-
- mPosition = position;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVolumeSliderPopup::setRange
-// -------------------------------------------------------------------------------------------------
-//
-void HbVolumeSliderPopup::setRange( int min, int max )
-{
- MPX_DEBUG(_L("HbVolumeSliderPopup::setRange"));
-
- mMin = min;
- mMax = max;
-}
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackcontrolbar.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackControlBar
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#include <hbframeitem.h>
-#include <hbframedrawer.h>
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackcontrolbar.h"
-#include "mpxcommonvideoplaybackview.hrh"
-#include "mpxvideoplaybackcontrolscontroller.h"
-
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlBar::QMPXVideoPlaybackControlBar()
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackControlBar::QMPXVideoPlaybackControlBar(
- QMPXVideoPlaybackControlsController* controller )
- : mController( controller )
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlBar::QMPXVideoPlaybackControlBar"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlBar::~QMPXVideoPlaybackControlBar()
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackControlBar::~QMPXVideoPlaybackControlBar()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlBar::~QMPXVideoPlaybackControlBar()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlBar::initialize()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlBar::initialize()
-{
-}
-
-
-
-//End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackcontrolconfiguration.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,150 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackControlConfiguration
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-// INCLUDE FILES
-
-#include <qgraphicswidget>
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackdocumentloader.h"
-#include "mpxvideoplaybackviewfiledetails.h"
-#include "mpxvideoplaybackcontrolconfiguration.h"
-#include "mpxvideoplaybackcontrolscontroller.h"
-
-const TInt KControlListUpdated = 12; // additional extension of TMPXPlaybackState
-
-// ================= MEMBER FUNCTIONS ==============================================================
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackControlConfiguration::CMPXVideoPlaybackControlConfiguration()
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackControlConfiguration::QMPXVideoPlaybackControlConfiguration(
- QMPXVideoPlaybackControlsController* controller)
- : mControlsController( controller )
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlConfiguration::~QMPXVideoPlaybackControlConfiguration()
-// Destructor.
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackControlConfiguration::~QMPXVideoPlaybackControlConfiguration()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::~QMPXVideoPlaybackControlConfiguration"));
-
- mControlsList.clear();
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlConfiguration::createControlList()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlConfiguration::createControlList()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::createControlList()"));
-
- addControlToList( EMPXBufferingAnimation );
- addControlToList( EMPXStatusPane );
- addControlToList( EMPXRealLogoBitmap );
-
- emit controlListUpdated();
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlConfiguration::controlList
-// -------------------------------------------------------------------------------------------------
-//
-QList<TMPXVideoPlaybackControls>& QMPXVideoPlaybackControlConfiguration::controlList()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::controlList()"));
-
- return mControlsList;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlConfiguration::updateControlList
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlConfiguration::updateControlList(
- TMPXVideoPlaybackControlCommandIds event )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::updateControlList(%d)"), event);
-
- if ( event == EMPXControlCmdFullScreenViewOpened ||
- event == EMPXControlCmdDetailsViewOpened ||
- event == EMPXControlCmdPluginInitialized )
- {
- mState = event;
- }
- else if ( event == EMPXControlCmdTvOutConnected ||
- event == EMPXControlCmdAudionOnlyViewOpened )
- {
- mState = EMPXControlCmdTvOutConnected;
- }
- else
- {
- mState = KControlListUpdated;
- }
-
- emit controlListUpdated();
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlConfiguration::deleteControlFromList
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlConfiguration::deleteControlFromList(
- TMPXVideoPlaybackControls control )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::deleteControlFromList(%d)"), control);
-
- mControlsList.removeAll( control );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlConfiguration::addControlToList
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlConfiguration::addControlToList(
- TMPXVideoPlaybackControls control )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::addControlToList(%d)"), control);
-
- if ( ! mControlsList.contains( control ) )
- {
- mControlsList.append( control );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlConfiguration::updateControlsWithFileDetails
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlConfiguration::updateControlsWithFileDetails()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::updateControlsWithFileDetails()"));
-
- mUpdateControlsWithFileDetails = true;
-}
-
-// End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackcontrolpolicy.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,125 +0,0 @@
-/*
-* 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 MPXVideoPlaybackControlPolicy
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-// INCLUDE FILES
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackcontrolpolicy.h"
-#include "mpxvideoplaybackviewfiledetails.h"
-
-// ================= MEMBER FUNCTIONS ==============================================================
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackControlPolicy::CMPXVideoPlaybackControlPolicy()
-// C++ default constructor can NOT contain any code, that might leave.
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackControlPolicy::QMPXVideoPlaybackControlPolicy()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlPolicy::QMPXVideoPlaybackControlPolicy()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlPolicy::~QMPXVideoPlaybackControlPolicy()
-// Destructor.
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackControlPolicy::~QMPXVideoPlaybackControlPolicy()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlPolicy::~QMPXVideoPlaybackControlPolicy()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlPolicy::setControlProperties()
-// -------------------------------------------------------------------------------------------------
-//
-void
-QMPXVideoPlaybackControlPolicy::setControlProperties( TMPXVideoPlaybackControls controlIndex,
- TUint& properties,
- QMPXVideoPlaybackViewFileDetails *details,
- TPlaybackViewMode viewMode )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlPolicy::setControlProperties()"));
-
- properties = 0;
-
- switch ( controlIndex )
- {
- case EMPXBufferingAnimation:
- {
- properties = EMPXShownWhenInitializing |
- EMPXShownWhenBuffering;
- break;
- }
- case EMPXStatusPane:
- {
- if ( details->mPlaybackMode != EMPXVideoLocal ||
- viewMode == EAudioOnlyView ||
- viewMode == EDetailsView )
- {
- properties = EMPXAllProperties;
- }
- else
- {
- properties = EMPXShownWhenPlaying |
- EMPXShownWhenPaused |
- EMPXShownWhenSeeking;
- }
- break;
- }
- case EMPXControlBar:
- {
- //
- // We don't delete ButtonBar and Progress Bar from the controlsList
- // to update information all the time though it's not visible or activated
- // So just hide these if it is details view
- //
- if ( viewMode == EDetailsView )
- {
- properties = 0;
- }
- else if ( viewMode == EAudioOnlyView )
- {
- properties = EMPXAllProperties;
- }
- else
- {
- properties = EMPXShownWhenPlaying |
- EMPXShownWhenPaused |
- EMPXShownWhenSeeking;
- }
- break;
- }
- case EMPXFileDetailsWidget:
- case EMPXIndicatorBitmap:
- case EMPXDetailsViewPlaybackWindow:
- {
- //
- // Add all these controls when it is details view or audio only view
- // Once it's added to controlsList, these are visible always
- //
- properties = EMPXAllProperties;
- break;
- }
- }
-}
-
-// End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackdetailsplaybackwindow.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackProgressBar
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackcontrolscontroller.h"
-#include "mpxvideoplaybackdetailsplaybackwindow.h"
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDetailsPlaybackWindow::QMPXVideoPlaybackDetailsPlaybackWindow
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackDetailsPlaybackWindow::QMPXVideoPlaybackDetailsPlaybackWindow(
- QMPXVideoPlaybackControlsController* controller )
- : mController( controller )
- , mInitialized( false )
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackDetailsPlaybackWindow::QMPXVideoPlaybackDetailsPlaybackWindow()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDetailsPlaybackWindow::~QMPXVideoPlaybackDetailsPlaybackWindow
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackDetailsPlaybackWindow::~QMPXVideoPlaybackDetailsPlaybackWindow()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackDetailsPlaybackWindow::~QMPXVideoPlaybackDetailsPlaybackWindow()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDetailsPlaybackWindow::initialize
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackDetailsPlaybackWindow::initialize()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackDetailsPlaybackWindow::initialize()"));
-
-}
-
-
-//End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackdocumentloader.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,260 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackDocumentLoader
-*
-*/
-
-// Version : %version: 4 %
-
-
-
-#include <hblistwidget.h>
-#include <hblabel.h>
-#include <hbtransparentwindow.h>
-#include <hbratingslider.h>
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackdocumentloader.h"
-#include "mpxvideoplaybackcontrolscontroller.h"
-
-#include "mpxvideoplaybackcontrolbar.h"
-#include "mpxvideoplaybackfiledetailswidget.h"
-#include "mpxvideoplaybackcontrolconfiguration.h"
-#include "mpxvideoplaybackdetailsplaybackwindow.h"
-
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::QMPXVideoPlaybackDocumentLoader
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackDocumentLoader::QMPXVideoPlaybackDocumentLoader(
- QMPXVideoPlaybackControlsController *controller )
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackDocumentLoader::QMPXVideoPlaybackDocumentLoader()"));
- mController = controller;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::~QMPXVideoPlaybackDocumentLoader
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackDocumentLoader::~QMPXVideoPlaybackDocumentLoader()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::QMPXVideoPlaybackDocumentLoader : mWidgets.count(%d)"),
- mWidgets.count() );
-
- for ( int i = 0 ; i < mWidgets.count() ; i++ )
- {
- mWidgets.removeAt( 0 );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::findWidget()
-// -------------------------------------------------------------------------------------------------
-//
-QGraphicsWidget *QMPXVideoPlaybackDocumentLoader::findWidget( const QString &name )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::findWidget(%s)"), name.data() );
-
- QGraphicsWidget *object = NULL;
-
- //int index = exist( name );
- mIndex = exist( name );
-
- if ( mIndex == -1 )
- {
- object = createWidget( name );
- }
- else
- {
- object = mWidgets[ mIndex ];
- }
-
- return object;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::createWidget()
-// -------------------------------------------------------------------------------------------------
-//
-QGraphicsWidget *QMPXVideoPlaybackDocumentLoader::createWidget( const QString &name )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::createWidget(%s)"), name.data() );
-
- QGraphicsWidget *object = NULL;
-
- if ( name == "transparentWindow" ||
- name == "small_transparentWindow" )
- {
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::creating transparentWindow") );
-
- object = new HbTransparentWindow();
- object->setObjectName( name );
-
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::appending[transparentWindow] to object list") );
- mWidgets.append( object );
- }
- else if ( name == "content" || name == "bitmapLayout" )
- {
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::creating HbWidget") );
-
- object = new HbWidget();
- object->setObjectName( name );
-
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::appending[HbWidget] to object list") );
- mWidgets.append( object );
- }
- else if ( name == "title" || name == "bufferingIcon" ||
- name == "tvOutBitmap" || name == "realAudioOnlyBitmap" ||
- name == "partialAudioOnlyBitmap" || name == "audioOnlyBitmap" )
- {
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::creating HbLabel") );
-
- object = new HbLabel();
- object->setObjectName( name );
-
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::appending[HbLabel] to object list") );
- mWidgets.append( object );
- }
- else if ( name == "controlBarLayout" )
- {
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::creating controlBarLayout") );
-
- object = new QMPXVideoPlaybackControlBar( mController );
- object->setObjectName( name );
-
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::appending[controlBarLayout] to object list") );
- mWidgets.append( object );
- }
- else if ( name == "fileDetailsLayout" )
- {
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::creating fileDetailsLayout") );
-
- object = new QMPXVideoPlaybackFileDetailsWidget( mController );
- object->setObjectName( name );
-
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::appending[fileDetailsLayout] to object list") );
- mWidgets.append( object );
- }
- else if ( name == "detailsPlaybackWindow" )
- {
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::creating detailsPlaybackWindow") );
-
- object = new QMPXVideoPlaybackDetailsPlaybackWindow( mController );
- object->setObjectName( name );
-
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::appending[detailsPlaybackWindow] to object list") );
- mWidgets.append( object );
- }
- else if ( name == "fileDetails" )
- {
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::creating HbListWidget") );
-
- object = new HbListWidget();
- object->setObjectName( name );
-
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::appending[HbListWidget] to object list") );
- mWidgets.append( object );
- }
- else if ( name == "nonLocalPlayback" )
- {
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::creating HbRatingSlider") );
-
- object = new HbRatingSlider();
- object->setObjectName( name );
-
- 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;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::exist()
-// -------------------------------------------------------------------------------------------------
-//
-int QMPXVideoPlaybackDocumentLoader::exist( const QString &name )
-{
- int i = 0;
-
- for ( ; i < mWidgets.count() ; i++ )
- {
- if( mWidgets[i]->objectName() == name )
- {
- break;
- }
- }
-
- if ( i == mWidgets.count() )
- {
- i = -1;
- }
-
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::exist(%s) returns %d"),
- name.data(), i );
-
- return i;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::load()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackDocumentLoader::load(
- const QString &fileName, const QString §ion , bool *ok )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::load(fileName=%s, section=%s)"),
- fileName.data(), section.data() );
-
- Q_UNUSED( fileName );
- Q_UNUSED( section );
- *ok = true;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::load()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackDocumentLoader::load(
- const QString &fileName, bool *ok )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::load(fileName=%s)"), fileName.data() );
- Q_UNUSED( fileName );
- *ok = true;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::isVisible()
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackDocumentLoader::isVisible( int index )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::isVisible(%d)"), index );
-
- return mWidgets[ index ]->isVisible();
-}
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackfiledetailswidget.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackFileDetailsWidget
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackfiledetailswidget.h"
-#include "mpxvideoplaybackcontrolscontroller.h"
-
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFileDetailsWidget::QMPXVideoPlaybackFileDetailsWidget
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackFileDetailsWidget::QMPXVideoPlaybackFileDetailsWidget(
- QMPXVideoPlaybackControlsController* controller )
- : mController( controller )
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackFileDetailsWidget::QMPXVideoPlaybackFileDetailsWidget()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFileDetailsWidget::~QMPXVideoPlaybackFileDetailsWidget
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackFileDetailsWidget::~QMPXVideoPlaybackFileDetailsWidget()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackFileDetailsWidget::~QMPXVideoPlaybackFileDetailsWidget()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFileDetailsWidget::initialize
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackFileDetailsWidget::initialize()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackFileDetailsWidget::initialize"));
-}
-
-
-//End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackfullscreencontrol.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,193 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackFullScreenControl
-*
-*/
-
-// Version : %version: 3 %
-
-
-
-#include <w32std.h>
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackfullscreencontrol.h"
-#include "mpxvideoplaybackfiledetailswidget.h"
-#include "mpxvideoplaybackcontrolscontroller.h"
-#include "mpxvideoplaybackdetailsplaybackwindow.h"
-
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFullScreenControl::QMPXVideoPlaybackFullScreenControl()
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackFullScreenControl::QMPXVideoPlaybackFullScreenControl(
- QMPXVideoPlaybackControlsController* controller,
- TMPXVideoPlaybackControls index,
- HbWidget* widget,
- TUint controlproperties )
- : mController( controller )
- , mControl( widget )
- , mControlIndex( index )
- , mProperties( controlproperties )
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackFullScreenControl::QMPXVideoPlaybackFullScreenControl()"));
-
- setParent( mController );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFullScreenControl::~QMPXVideoPlaybackFullScreenControl()
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackFullScreenControl::~QMPXVideoPlaybackFullScreenControl()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackFullScreenControl"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFullScreenControl::setVisible()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackFullScreenControl::setVisible( bool visible )
-{
- mVisible = visible;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFullScreenControl::isVisible()
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackFullScreenControl::isVisible()
-{
- return mVisible;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFullScreenControl::setVisibility()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackFullScreenControl::setVisibility( TMPXPlaybackState state )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackFullScreenControl::setVisibility(%d)"), state);
-
- mVisibilityState = state;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFullScreenControl::controlIndex()
-// -------------------------------------------------------------------------------------------------
-//
-TMPXVideoPlaybackControls QMPXVideoPlaybackFullScreenControl::controlIndex()
-{
- return mControlIndex;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFullScreenControl::volumeChanged()
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackFullScreenControl::volumeChanged( int volume )
-{
- mVolume = volume;
- return true;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFullScreenControl::durationChanged()
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackFullScreenControl::durationChanged( int duration )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackFullScreenControl::durationChanged() [%d]"), duration );
- mDuration = duration;
- return true;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFullScreenControl::positionChanged()
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackFullScreenControl::positionChanged( int position )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackFullScreenControl::positionChanged() [%d]"), position );
- mPosition = position;
- return true;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFullScreenControl::aspectRatioChanged()
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackFullScreenControl::aspectRatioChanged( int aspectRatio )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackFullScreenControl::aspectRatioChanged() [%d]"), aspectRatio );
- mAspectRatio = aspectRatio;
- return true;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFullScreenControl::setDownloadSize()
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackFullScreenControl::setDownloadSize( int size )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackFullScreenControl::setDownloadSize() [%d]"), size );
- mDownloadSize = size;
- return true;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFullScreenControl::updateDownloadPosition()
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackFullScreenControl::updateDownloadPosition( int size )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackFullScreenControl::updateDownloadPosition() [%d]"), size );
- mDownloadPosition = size;
- return true;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFullScreenControl::updateState()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackFullScreenControl::updateState( TMPXPlaybackState state )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackFullScreenControl::updateState() [%d]"), state );
- mState = state;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFullScreenControl::updateControlsWithFileDetails()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackFullScreenControl::updateControlsWithFileDetails(
- QMPXVideoPlaybackViewFileDetails* details )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackFullScreenControl::updateControlsWithFileDetails()") );
- Q_UNUSED( details );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFullScreenControl::updateControlProperties()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackFullScreenControl::updateControlProperties( TUint properties )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackFullScreenControl::updateControlProperties()") );
- mProperties = properties;
-}
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackstatuspanecontrol.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
-* 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 QMPXVideoPlaybackStatusPaneControl
-*
-*/
-
-// Version : %version: 1 %
-
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackstatuspanecontrol.h"
-#include "mpxvideoplaybackcontrolscontroller.h"
-
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackStatusPaneControl::QMPXVideoPlaybackStatusPaneControl()
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackStatusPaneControl::QMPXVideoPlaybackStatusPaneControl(
- QMPXVideoPlaybackControlsController* controller,
- TMPXVideoPlaybackControls index,
- HbWidget* widget,
- TUint controlproperties )
- : QMPXVideoPlaybackFullScreenControl( controller, index, widget, controlproperties )
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackStatusPaneControl::QMPXVideoPlaybackStatusPaneControl()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackStatusPaneControl::~QMPXVideoPlaybackStatusPaneControl()
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackStatusPaneControl::~QMPXVideoPlaybackStatusPaneControl()
-{
-}
-
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackviewfiledetails.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
-* 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: class for MPX Video File Details (Qt)
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-//
-// INCLUDE FILES
-//
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackviewfiledetails.h"
-
-
-// ============================ MEMBER FUNCTIONS ===================================================
-
-QMPXVideoPlaybackViewFileDetails::QMPXVideoPlaybackViewFileDetails()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::QMPXVideoPlaybackViewFileDetails()"));
-
- clearFileDetails();
-}
-
-QMPXVideoPlaybackViewFileDetails::~QMPXVideoPlaybackViewFileDetails()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::~QMPXVideoPlaybackViewFileDetails()"));
-
- clearFileDetails();
-}
-
-void
-QMPXVideoPlaybackViewFileDetails::clearFileDetails()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::ClearFileDetails()"));
-
- mMimeType = tr("");
- mTitle = tr("");
- mArtist = tr("");
- mClipName = tr("");
- mDescription = tr("");
- mLocation = tr("");
- mCopyright = tr("");
- mLanguage = tr("");
- mKeywords = tr("");
-
- mPlaybackMode = EMPXVideoLocal;
- mSeekable = false;
- mPausableStream = false;
- mAudioEnabled = false;
- mVideoEnabled = false;
- mPartialPlayback = false;
- mRNFormat = false;
-
- mDuration = 0;
- mTvOutConnected = false;
- mDrmProtected = false;
-
- mVideoHeight = 0;
- mVideoWidth = 0;
- mBitRate = 0;
-}
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoviewwrapper.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-/*
-* 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 Video wrapper
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-// Include Files
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoviewwrapper.h"
-#include "hbvideobaseplaybackview.h"
-#include "mpxvideoplaybackviewfiledetails.h"
-#include "mpxcommonvideoplaybackview.hrh"
-
-// Member Functions
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::CMPXVideoViewWrapper()
-// -------------------------------------------------------------------------------------------------
-//
-CMPXVideoViewWrapper::CMPXVideoViewWrapper( HbVideoBasePlaybackView* aView )
- : mView( aView )
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::NewL()
-// -------------------------------------------------------------------------------------------------
-//
-CMPXVideoViewWrapper* CMPXVideoViewWrapper::NewL( HbVideoBasePlaybackView* aView )
-{
- MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::CMPXVideoViewWrapper()"));
- CMPXVideoViewWrapper* self = new (ELeave) CMPXVideoViewWrapper( aView );
-
- CleanupStack::PushL( self );
- self->ConstructL();
- CleanupStack::Pop();
-
- return self;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::ConstructL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::ConstructL()
-{
- mMediaRequested = EFalse;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::~CMPXVideoViewWrapper()
-// -------------------------------------------------------------------------------------------------
-//
-CMPXVideoViewWrapper::~CMPXVideoViewWrapper()
-{
- MPX_DEBUG(_L("CMPXVideoViewWrapper::~CMPXVideoViewWrapper"));
-}
-
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::HandleCommandL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::HandleCommandL( TInt aCommand )
-{
- mCommandId = aCommand;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::SetPropertyL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::SetPropertyL( TMPXPlaybackProperty aProperty, TInt aValue )
-{
- mProperty = aProperty;
- Q_UNUSED( aValue );
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::UpdateVideoRect()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::UpdateVideoRect(
- TInt aX, TInt aY, TInt aWidth, TInt aHeight, TBool transitionEffect )
-{
- Q_UNUSED( aX );
- Q_UNUSED( aY );
- Q_UNUSED( aWidth );
- Q_UNUSED( aHeight );
- Q_UNUSED( transitionEffect );
-}
-
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/shareui.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
-* 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 ShareUI STUB
-*
-*/
-
-// Version : %version: %
-
-#include <qobject>
-
-#include "shareui.h"
-#include "mpxvideo_debug.h"
-
-
-// ----------------------------------------------------------------------------
-// ShareUi()
-// ----------------------------------------------------------------------------
-//
-ShareUi::ShareUi()
-{
- MPX_DEBUG(_L("ShareUi::ShareUi()"));
-}
-
-// ----------------------------------------------------------------------------
-// ~ShareUi()
-// ----------------------------------------------------------------------------
-//
-ShareUi::~ShareUi()
-{
- MPX_DEBUG(_L("ShareUi::~ShareUi()"));
-}
-
-// ----------------------------------------------------------------------------
-// send()
-// ----------------------------------------------------------------------------
-//
-bool ShareUi::send( QStringList& fileList, bool embedded )
-{
- MPX_DEBUG(_L("ShareUi::send()"));
-
- Q_UNUSED( fileList );
- Q_UNUSED( embedded );
-
- return true;
-}
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/thumbnailmanager_qt.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,154 +0,0 @@
-/*
-* 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 tn manager
- *
-*/
-
-// Version : %version: 1 %
-
-#include <qsize.h>
-#include "thumbnailmanager_qt.h"
-
-QMap<int, ThumbnailManager::TnRequest> ThumbnailManager::mRequests = QMap<int, ThumbnailManager::TnRequest>();
-
-ThumbnailManager::ThumbnailManager( QObject* parentPtr ) :
-QObject( parentPtr ),
-mGetThumbFails(false),
-mThumbnailReadyError(0)
-{
-}
-
-ThumbnailManager::~ThumbnailManager()
-{
-}
-
-ThumbnailManager::QualityPreference ThumbnailManager::qualityPreference() const
-{
- return mQuality;
-}
-
-bool ThumbnailManager::setQualityPreference( QualityPreference
- qualityPreference )
-{
- mQuality = qualityPreference;
- return true;
-}
-
-ThumbnailManager::DisplayMode ThumbnailManager::displayMode() const
-{
- return Color16MAP;
-}
-
-bool ThumbnailManager::setDisplayMode( ThumbnailManager::DisplayMode displayMode )
-{
- Q_UNUSED(displayMode);
- return true;
-}
-
-QSize ThumbnailManager::thumbnailSize() const
-{
- return QSize(128, 128); // ThumbnailMedium?
-}
-
-bool ThumbnailManager::setThumbnailSize( const QSize& thumbnailSize )
-{
- Q_UNUSED(thumbnailSize);
- return true;
-}
-
-bool ThumbnailManager::setThumbnailSize( ThumbnailSize thumbnailSize )
-{
- mThumbSize = thumbnailSize;
- return true;
-}
-
-ThumbnailManager::ThumbnailMode ThumbnailManager::mode() const
-{
- return Default;
-}
-
-bool ThumbnailManager::setMode( ThumbnailMode mode )
-{
- Q_UNUSED(mode);
- return true;
-}
-
-int ThumbnailManager::getThumbnail( const QString& fileName, void * clientData,
- int priority )
-{
- Q_UNUSED(fileName);
- Q_UNUSED(clientData);
- Q_UNUSED(priority);
- return 0;
-}
-
-int ThumbnailManager::getThumbnail( unsigned long int thumbnailId, void * clientData,
- int priority )
-{
- Q_UNUSED(thumbnailId);
- Q_UNUSED(clientData);
- Q_UNUSED(priority);
- return 0;
-}
-
-int ThumbnailManager::setThumbnail( const QPixmap& source, const QString& filename,
- void * clientData , Priority priority )
-{
- Q_UNUSED(source);
- Q_UNUSED(filename);
- Q_UNUSED(clientData);
- Q_UNUSED(priority);
- return 0;
-}
-
-void ThumbnailManager::deleteThumbnails( const QString& fileName )
-{
- Q_UNUSED(fileName);
-}
-
-void ThumbnailManager::deleteThumbnails( unsigned long int thumbnailId )
-{
- Q_UNUSED(thumbnailId);
-}
-
-bool ThumbnailManager::cancelRequest( int id )
-{
- if(mRequests.contains(id)) {
- mRequests[id].cancelled = true;
- }
- return true;
-}
-
-bool ThumbnailManager::changePriority( int id, Priority newPriority )
-{
- if(mRequests.contains(id)) {
- mRequests[id].priority = newPriority;
- }
- return true;
-}
-
-void ThumbnailManager::emitThumbnailReady(int tnId )
-{
- QPixmap pixmap(100,100);
- pixmap.fill(Qt::white);
- void* internal = 0;
-
- if(mRequests.contains(tnId)) {
- internal = mRequests[tnId].id;
- mRequests.remove(tnId);
- }
-
- emit thumbnailReady(pixmap, internal, tnId, mThumbnailReadyError);
-}
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/videoservices.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,124 +0,0 @@
-/*
-* 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 VideoServices STUB
-*
-*/
-
-// Version : %version: 1 %
-
-#include "videoservices.h"
-#include "videoserviceurifetch.h"
-#include "mpxvideo_debug.h"
-
-
-VideoServices *VideoServices::mInstance = 0;
-int VideoServices::mReferenceCount = 0;
-
-// -----------------------------------------------------------------------------
-// VideoServices::instance()
-// -----------------------------------------------------------------------------
-//
-VideoServices* VideoServices::instance()
-{
- MPX_DEBUG(_L("VideoServices::instance()"));
-
- if ( !mInstance )
- {
- mInstance = new VideoServices();
- }
-
- mInstance->mReferenceCount++;
-
- return mInstance;
-}
-
-// -----------------------------------------------------------------------------
-// VideoServices::decreaseReferenceCount()
-// -----------------------------------------------------------------------------
-//
-void VideoServices::decreaseReferenceCount()
-{
- MPX_DEBUG(_L("VideoServices::decreaseReferenceCount()"));
-
- if ( mInstance )
- {
- if ( --mInstance->mReferenceCount == 0 )
- {
- delete mInstance;
- mInstance = NULL;
- }
- }
-}
-
-
-// ----------------------------------------------------------------------------
-// VideoServices()
-// ----------------------------------------------------------------------------
-//
-VideoServices::VideoServices()
- : mCurrentService( VideoServices::ENoService )
- , mItemSelected( false )
-{
- MPX_DEBUG(_L("VideoServices::VideoServices()"));
-
- mServiceUriFetch = new VideoServiceUriFetch( this );
-}
-
-// ----------------------------------------------------------------------------
-// ~VideoServices()
-// ----------------------------------------------------------------------------
-//
-VideoServices::~VideoServices()
-{
- MPX_DEBUG(_L("VideoServices::~VideoServices()"));
-
- delete mServiceUriFetch;
-}
-
-
-// ----------------------------------------------------------------------------
-// currentService()
-// ----------------------------------------------------------------------------
-//
-VideoServices::TVideoService VideoServices::currentService()
-{
- MPX_DEBUG(_L("VideoServices::currentService() ret %d"), mCurrentService);
-
- return mCurrentService;
-}
-
-
-// ----------------------------------------------------------------------------
-// setCurrentService()
-// ----------------------------------------------------------------------------
-//
-void VideoServices::setCurrentService( VideoServices::TVideoService service )
-{
- MPX_DEBUG(_L("VideoServices::setCurrentService(%d)"), service);
-
- mCurrentService = service;
-}
-
-// ----------------------------------------------------------------------------
-// itemSelected()
-// ----------------------------------------------------------------------------
-//
-void VideoServices::itemSelected( const QString& item )
-{
- MPX_DEBUG(_L("VideoServices::itemSelected()") );
-
- Q_UNUSED( item );
-
- mItemSelected = true;
-}
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/videoserviceurifetch.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
-* 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 VideoServiceUriFetch STUB
-*
-*/
-
-#include "videoservices.h"
-#include "videoserviceurifetch.h"
-#include "mpxvideo_debug.h"
-
-
-// ----------------------------------------------------------------------------
-// VideoServiceUriFetch()
-// ----------------------------------------------------------------------------
-//
-VideoServiceUriFetch::VideoServiceUriFetch( VideoServices* parent )
-{
- MPX_DEBUG(_L("VideoServiceUriFetch::VideoServiceUriFetch()"));
-
- if ( parent )
- {
- parent->setCurrentService( VideoServices::EUriFetcher );
- }
-}
-
-// ----------------------------------------------------------------------------
-// ~VideoServiceUriFetch()
-// ----------------------------------------------------------------------------
-//
-VideoServiceUriFetch::~VideoServiceUriFetch()
-{
- MPX_DEBUG(_L("VideoServiceUriFetch::~VideoServiceUriFetch()"));
-}
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/xqserviceutil.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +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: ?Description
-*
-*/
-
-#include "xqserviceutil.h"
-#include "xqserviceutilxtra.h"
-#include "mpxvideo_debug.h"
-
-
-// ----------------------------------------------------------------------------
-// XQServiceUtil::toBackground()
-// ----------------------------------------------------------------------------
-//
-void XQServiceUtil::toBackground( bool value )
-{
- MPX_DEBUG(_L("XQServiceUtil::toBackground( %d )"), value );
-}
-
-// ----------------------------------------------------------------------------
-// XQServiceUtil::isEmbedded()
-// ----------------------------------------------------------------------------
-//
-bool XQServiceUtil::isEmbedded()
-{
- MPX_DEBUG(_L("XQServiceUtil::isEmbedded()"));
-
- return false;
-}
-
-// ----------------------------------------------------------------------------
-// XQServiceUtil::isService()
-// ----------------------------------------------------------------------------
-//
-bool XQServiceUtil::isService()
-{
- bool service;
- XQServiceUtilXtra* ptr = XQServiceUtilXtra::instance();
- service = ptr->currentService();
- ptr->decreaseReferenceCount();
-
- MPX_DEBUG(_L("XQServiceUtil::isEmbedded() ret %d"), service);
- return service;
-}
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/xqserviceutilxtra.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +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:
-*
-*/
-
-#include "xqserviceutilxtra.h"
-#include "mpxvideo_debug.h"
-
-XQServiceUtilXtra* XQServiceUtilXtra::mInstance = 0;
-int XQServiceUtilXtra::mReferenceCount = 0;
-bool XQServiceUtilXtra::service = false;
-
-// -----------------------------------------------------------------------------
-// XQServiceUtilXtra::instance()
-// -----------------------------------------------------------------------------
-//
-XQServiceUtilXtra* XQServiceUtilXtra::instance()
-{
- MPX_DEBUG(_L("XQServiceUtilXtra::instance()"));
-
- if ( !mInstance )
- {
- mInstance = new XQServiceUtilXtra();
- }
- mInstance->mReferenceCount++;
-
- return mInstance;
-}
-
-// -----------------------------------------------------------------------------
-// XQServiceUtilXtra::decreaseReferenceCount()
-// -----------------------------------------------------------------------------
-//
-void XQServiceUtilXtra::decreaseReferenceCount()
-{
- MPX_DEBUG(_L("XQServiceUtilXtra::decreaseReferenceCount()"));
-
- if ( mInstance )
- {
- if (--mInstance->mReferenceCount == 0 )
- {
- delete mInstance;
- mInstance = NULL;
- }
- }
-}
-
-
-// ----------------------------------------------------------------------------
-// XQServiceUtilXtra()
-// ----------------------------------------------------------------------------
-//
-XQServiceUtilXtra::XQServiceUtilXtra()
-{
- MPX_DEBUG(_L("XQServiceUtilXtra::XQServiceUtilXtra()"));
-}
-
-// ----------------------------------------------------------------------------
-// ~XQServiceUtilXtra()
-// ----------------------------------------------------------------------------
-//
-XQServiceUtilXtra::~XQServiceUtilXtra()
-{
- MPX_DEBUG(_L("XQServiceUtilXtra::~XQServiceUtilXtra()"));
-}
-
-
-// ----------------------------------------------------------------------------
-// currentService()
-// ----------------------------------------------------------------------------
-//
-bool XQServiceUtilXtra::currentService()
-{
- MPX_DEBUG(_L("XQServiceUtilXtra::currentService() ret %d"), mInstance->service);
-
- return mInstance->service;
-}
-
-
-// ----------------------------------------------------------------------------
-// setCurrentService()
-// ----------------------------------------------------------------------------
-//
-void XQServiceUtilXtra::setCurrentService( bool service )
-{
- MPX_DEBUG(_L("XQServiceUtilXtra::setCurrentService( %d )"), service);
-
- mInstance->service = service;
-}
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/testmpxvideoplaybackcontrolscontroller.pro Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-#
-# 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: Project file for building testmpxvideoplaybackcontrolscontroller
-#
-#
-# Version : %version: 6 %
-
-
-TEMPLATE = app
-TARGET = testmpxvideoplaybackcontrolscontroller
-CONFIG += qtestlib hb qt
-
-LIBS += -lxqserviceutil.dll \
- -lefsrv.dll
-
-INCLUDEPATH += stub/inc \
- ../inc \
- ../../inc \
- ../../../inc \
- ../../../../inc
-
-DEPENDPATH += stub/inc stub/src inc src
-
-# Input
-HEADERS += hbvideobaseplaybackview.h \
- mpxvideoplaybackcontrolbar.h \
- mpxvideoplaybackcontrolpolicy.h \
- mpxvideoplaybackcontrolconfiguration.h \
- mpxvideoplaybackdetailsplaybackwindow.h \
- mpxvideoplaybackdocumentloader.h \
- mpxvideoplaybackfiledetailswidget.h \
- mpxvideoplaybackfullscreencontrol.h \
- mpxvideoplaybackstatuspanecontrol.h \
- mpxvideoplaybackviewfiledetails.h \
- mpxvideoviewwrapper.h \
- thumbnailmanager_qt.h \
- testmpxvideoplaybackcontrolscontroller.h \
- hbvolumesliderpopup.h \
- xqserviceutilxtra.h \
- xqserviceutil.h \
- videoservices.h \
- videoserviceurifetch.h \
- shareui.h \
- ../../inc/mpxvideoplaybackcontrolscontroller.h
-
-
-SOURCES += hbvideobaseplaybackview.cpp \
- mpxvideoplaybackcontrolbar.cpp \
- mpxvideoplaybackcontrolpolicy.cpp \
- mpxvideoplaybackcontrolconfiguration.cpp \
- mpxvideoplaybackdetailsplaybackwindow.cpp \
- mpxvideoplaybackdocumentloader.cpp \
- mpxvideoplaybackfiledetailswidget.cpp \
- mpxvideoplaybackfullscreencontrol.cpp \
- mpxvideoplaybackstatuspanecontrol.cpp \
- mpxvideoplaybackviewfiledetails.cpp \
- mpxvideoviewwrapper.cpp \
- thumbnailmanager_qt.cpp \
- testmpxvideoplaybackcontrolscontroller.cpp \
- hbvolumesliderpopup.cpp \
- xqserviceutilxtra.cpp \
- xqserviceutil.cpp \
- videoservices.cpp \
- videoserviceurifetch.cpp \
- shareui.cpp \
- ../../controlsrc/mpxvideoplaybackcontrolscontroller.cpp
-
-
\ No newline at end of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/inc/testvideoplaybackview.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +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: tester for methods in Video Playback View Plugin
-*
-*/
-
-// Version : %version: 7 %
-
-#ifndef __TESTVIDEOPLAYBACKVIEW_H__
-#define __TESTVIDEOPLAYBACKVIEW_H__
-
-
-// INCLUDES
-#include <QtTest/QtTest>
-
-
-class HbVideoPlaybackView;
-
-class TestVideoPlaybackView : public QObject
-{
- Q_OBJECT
-
-public:
-
- /**
- * will be called before each testfunction is executed.
- *
- */
- void init();
-
- /**
- * will be called after every testfunction.
- *
- */
- void cleanup();
-
- void setup();
-
-private:
-
- void verifyHandlePluginError( TInt error, bool closeView = true );
-
- // test functions for the test framework
-private slots:
-
- // the order in which these testXX methods are declared is important
- // changing this order will affect the test results
- void testHandleActivateView();
- void testShowDialog();
- void testGetWindow();
- void testIssuePlayCommand();
- void testEventFilter();
- void testClosePlaybackView();
- void testHandlePdlStateChange();
- void testHandlePluginError();
- void testHandleStoppedStatePrevView();
- void testHandleStoppedStateNoPrevView();
- void testHandleBackPrevView();
- void testHandleBackNoPrevView();
- void testHandleSoftkeyback();
- void testHandleDeactivateView();
- void testDoClosePlayer();
- void testGestureEvent();
-
-signals:
- void commandSignal();
-
-private:
- HbVideoPlaybackView* mVideoView;
-
-};
-
-#endif // __TESTVIDEOPLAYBACKVIEW_H__
-
-// End of file
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/src/testvideoplaybackview.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,642 +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: tester for methods in VideoSortFilterProxyModel
-*
-*/
-
-// Version : %version: 10 %
-
-#include <e32err.h>
-#include <w32std.h>
-
-#include <mmf/common/mmferrors.h>
-#include <caf/caferr.h>
-
-#include <mpxvideoplaybackdefs.h>
-
-#include <hbapplication.h>
-#include <hbinstance.h>
-#include <qgraphicssceneevent>
-#include <QDebug>
-
-#include "mpxvideoplaybackviewfiledetails.h"
-#include "mpxcommonvideoplaybackview.hrh"
-
-#include "testvideoplaybackview.h"
-#include "mpxvideoviewwrapper.h"
-#include "hbtapgesture.h"
-#include "hbpangesture.h"
-
-#define private public
-#define protected public
-#include "hbvideoplaybackview.h"
-#include "hbvideobaseplaybackview.h"
-#undef protected
-#undef private
-
-
-// ---------------------------------------------------------------------------
-// main
-// ---------------------------------------------------------------------------
-//
-int main(int argc, char *argv[])
-{
- HbApplication app(argc, argv);
- HbMainWindow window;
-
- TestVideoPlaybackView tv;
-
- char *pass[3];
- pass[0] = argv[0];
- pass[1] = "-o";
- pass[2] = "c:\\data\\TestVideoPlaybackView.txt";
-
- int res = QTest::qExec(&tv, 3, pass);
-
- return res;
-}
-
-// ---------------------------------------------------------------------------
-// init
-// ---------------------------------------------------------------------------
-//
-void TestVideoPlaybackView::init()
-{
- mVideoView = new HbVideoPlaybackView();
-}
-
-// ---------------------------------------------------------------------------
-// cleanup
-// ---------------------------------------------------------------------------
-//
-void TestVideoPlaybackView::cleanup()
-{
- delete mVideoView;
- mVideoView = NULL;
-}
-
-// ---------------------------------------------------------------------------
-// setup
-// ---------------------------------------------------------------------------
-//
-void TestVideoPlaybackView::setup()
-{
- init();
- mVideoView->handleActivateView();
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestVideoPlaybackView::testHandleActivateView()
-// -------------------------------------------------------------------------------------------------
-//
-void TestVideoPlaybackView::testHandleActivateView()
-{
- init();
- mVideoView->handleActivateView();
-
- QVERIFY( mVideoView->mVideoMpxWrapper->iMediaRequested == true );
- QCOMPARE( mVideoView->mVideoMpxWrapper->iFileDetails->mBitRate, 16000 );
- QCOMPARE( mVideoView->mVideoMpxWrapper->iFileDetails->mTitle, QString("Test Video Title") );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestVideoPlaybackView::testHandlePluginError()
-// -------------------------------------------------------------------------------------------------
-//
-void TestVideoPlaybackView::testHandlePluginError()
-{
- //
- // playback view is closed after displaying these error notes
- //
- verifyHandlePluginError( KErrNotSupported );
- verifyHandlePluginError( KErrUnknown );
- verifyHandlePluginError( KErrMMDecoder );
- verifyHandlePluginError( KErrCorrupt );
- verifyHandlePluginError( KErrTooBig );
- verifyHandlePluginError( KErrMMInvalidProtocol );
- verifyHandlePluginError( KErrMMInvalidURL );
- verifyHandlePluginError( KErrArgument );
- verifyHandlePluginError( KErrSessionClosed );
- verifyHandlePluginError( KErrTimedOut );
- verifyHandlePluginError( KErrNotFound );
- verifyHandlePluginError( KErrMMNotEnoughBandwidth );
- verifyHandlePluginError( KErrDisconnected );
- verifyHandlePluginError( KErrMMProxyServer );
- verifyHandlePluginError( KErrCouldNotConnect );
- verifyHandlePluginError( KErrAbort );
- verifyHandlePluginError( KErrCancel );
- verifyHandlePluginError( KErrMMDRMNotAuthorized );
- verifyHandlePluginError( KErrCANoRights );
- verifyHandlePluginError( KErrCANoPermission );
-
- //
- // playback view remains open after displaying these error notes
- //
- verifyHandlePluginError( KMPXVideoCallOngoingError, false );
- verifyHandlePluginError( KMPXVideoPlayOver2GDuringVoiceCallError, false );
-
- //
- // default error case, playback view is closed after displaying error note
- //
- verifyHandlePluginError( KErrGeneral );
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestVideoPlaybackView::testShowDialog()
-// -------------------------------------------------------------------------------------------------
-//
-void TestVideoPlaybackView::testShowDialog()
-{
- //
- // construct and activate playback view
- //
- setup();
-
- //
- // ensure that playback view is currently activated
- //
- QVERIFY( ! mVideoView->mTimerForClosingView->isActive() );
-
- //
- // test showDialog() method
- //
- mVideoView->showDialog( "test error msg" );
-
- //
- // connect and emit signal for handleClosePopupDialog() slot
- //
- connect( this, SIGNAL( commandSignal() ), mVideoView, SLOT( handleClosePopupDialog() ) );
- emit commandSignal();
-
- //
- // verify that playback view is properly closed
- //
- QVERIFY( mVideoView->mTimerForClosingView->isActive() );
-
- //
- // disconnect signal for handleClosePopupDialog() slot
- //
- disconnect( this, SIGNAL( commandSignal() ), mVideoView, SLOT( handleClosePopupDialog() ) );
-
- //
- // destruct playback view
- //
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestVideoPlaybackView::testGetWindow()
-// -------------------------------------------------------------------------------------------------
-//
-void TestVideoPlaybackView::testGetWindow()
-{
- setup();
-
- QVERIFY( mVideoView->getWindow() != NULL );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestVideoPlaybackView::testIssuePlayCommand()
-// -------------------------------------------------------------------------------------------------
-//
-void TestVideoPlaybackView::testIssuePlayCommand()
-{
- setup();
-
- mVideoView->issuePlayCommand();
-
- //JAM remove
- QVERIFY( mVideoView->isEnabled() );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestVideoPlaybackView::testEventFilter()
-// -------------------------------------------------------------------------------------------------
-//
-void TestVideoPlaybackView::testEventFilter()
-{
- setup();
-
- //
- // ensure default foreground is false
- //
- QCOMPARE( mVideoView->mVideoMpxWrapper->iForeground, 0 );
-
- //
- // declare foreground/background event
- //
- QEvent* appActivate = new QEvent( QEvent::ApplicationActivate );
- QEvent* appDeactivate = new QEvent( QEvent::ApplicationDeactivate );
-
- //
- // verify the returned value (consumed) of HbVideoBasePlaybackView::event()
- // for QEvent::ApplicationActivate is false
- //
- QVERIFY( ! mVideoView->eventFilter( NULL, appActivate ) );
-
- //
- // verify view is in foreground
- //
- QCOMPARE( mVideoView->mVideoMpxWrapper->iForeground, 1 );
-
- //
- // verify the returned value (consumed) of HbVideoBasePlaybackView::event()
- // for QEvent::ApplicationDeactivate is false
- //
- QVERIFY( ! mVideoView->eventFilter( NULL, appDeactivate ) );
-
- //
- // verify view is in background
- //
- QCOMPARE( mVideoView->mVideoMpxWrapper->iForeground, 0 );
-
- //
- // clean up
- //
- if ( appActivate )
- {
- delete appActivate;
- appActivate = NULL;
- }
-
- if ( appDeactivate )
- {
- delete appDeactivate;
- appDeactivate = NULL;
- }
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestVideoPlaybackView::testClosePlaybackView()
-// -------------------------------------------------------------------------------------------------
-//
-void TestVideoPlaybackView::testClosePlaybackView()
-{
- setup();
-
- QVERIFY( ! mVideoView->mTimerForClosingView->isActive() );
-
- mVideoView->closePlaybackView();
-
- QVERIFY( mVideoView->mTimerForClosingView->isActive() );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestVideoPlaybackView::testHandlePdlStateChange()
-// -------------------------------------------------------------------------------------------------
-//
-void TestVideoPlaybackView::testHandlePdlStateChange()
-{
- setup();
-
- QCOMPARE( mVideoView->mVideoMpxWrapper->iFileDetails->mClipName, QString("testClip.3gp") );
-
- mVideoView->handlePdlStateChange( 0 );
-
- QCOMPARE( mVideoView->mVideoMpxWrapper->iFileDetails->mClipName, QString("testClip.3gp") );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestVideoPlaybackView::testHandleStoppedStateNoPrevView()
-// -------------------------------------------------------------------------------------------------
-//
-void TestVideoPlaybackView::testHandleStoppedStateNoPrevView()
-{
- setup();
-
- QVERIFY( ! mVideoView->mTimerForClosingView->isActive() );
- mVideoView->handleStoppedState();
-
- QVERIFY( mVideoView->mTimerForClosingView->isActive() );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestVideoPlaybackView::testHandleStoppedStatePrevView()
-// -------------------------------------------------------------------------------------------------
-//
-void TestVideoPlaybackView::testHandleStoppedStatePrevView()
-{
- setup();
-
- mVideoView->handleStoppedState();
-
- QVERIFY( mVideoView->mTimerForClosingView->isActive() );
-
- cleanup();
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestVideoPlaybackView::testHandleBackNoPrevView()
-// -------------------------------------------------------------------------------------------------
-//
-void TestVideoPlaybackView::testHandleBackNoPrevView()
-{
- setup();
-
- QVERIFY( ! mVideoView->mTimerForClosingView->isActive() );
- mVideoView->handleBack();
-
- QVERIFY( mVideoView->mTimerForClosingView->isActive() );
-
- cleanup();
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestVideoPlaybackView::testHandleBackPrevView()
-// -------------------------------------------------------------------------------------------------
-//
-void TestVideoPlaybackView::testHandleBackPrevView()
-{
- setup();
-
- mVideoView->handleBack();
-
- QVERIFY( mVideoView->mTimerForClosingView->isActive() );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestVideoPlaybackView::testHandleSoftkeyback()
-// -------------------------------------------------------------------------------------------------
-//
-void TestVideoPlaybackView::testHandleSoftkeyback()
-{
- setup();
-
- mVideoView->handleSoftkeyBack();
-
- QVERIFY( mVideoView->mTimerForClosingView->isActive() );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestVideoPlaybackView::testDoClosePlayer()
-// -------------------------------------------------------------------------------------------------
-//
-void TestVideoPlaybackView::testDoClosePlayer()
-{
- // quits app - which can be problematic for the qvptestrunner app
-
-// setup();
-//
-// mVideoView->handleActivateView();
-//
-// mVideoView->doClosePlayer();
-//
-// cleanup();
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestVideoPlaybackView::testHandleDeactivateView()
-// -------------------------------------------------------------------------------------------------
-//
-void TestVideoPlaybackView::testHandleDeactivateView()
-{
- setup();
-
- mVideoView->handleDeactivateView();
-
- QVERIFY( mVideoView->mVideoMpxWrapper == NULL );
-
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestVideoPlaybackView::verifyHandlePluginError()
-// -------------------------------------------------------------------------------------------------
-//
-void TestVideoPlaybackView::verifyHandlePluginError( TInt error, bool closeView )
-{
- //
- // construct and activate playback view
- //
- setup();
-
- //
- // ensure that playback view is currently open
- //
- QVERIFY( ! mVideoView->mTimerForClosingView->isActive() );
-
- //
- // test handlePluginError() method
- //
- mVideoView->handlePluginError( error );
-
- //
- // close playback view after error note has been launched
- //
- if ( closeView )
- {
- //
- // connect and emit signal for handleClosePopupDialog() slot
- //
- connect( this, SIGNAL( commandSignal() ), mVideoView, SLOT( handleClosePopupDialog() ) );
- emit commandSignal();
-
- //
- // verify that playback view is properly closed
- //
- QVERIFY( mVideoView->mTimerForClosingView->isActive() );
-
- //
- // disconnect signal for handleClosePopupDialog() slot
- //
- disconnect( this, SIGNAL( commandSignal() ), mVideoView, SLOT( handleClosePopupDialog() ) );
- }
- else
- {
- //
- // verify that playback view is still open after error note has been launched
- //
- QVERIFY( ! mVideoView->mTimerForClosingView->isActive() );
- }
-
- //
- // destruct playback view
- //
- cleanup();
-}
-
-// -------------------------------------------------------------------------------------------------
-// TestVideoPlaybackView::testGestureEvent()
-// -------------------------------------------------------------------------------------------------
-//
-void TestVideoPlaybackView::testGestureEvent()
-{
- setup();
-
- //
- // 1. Test tap gesture
- //
- QList<QGesture *> list;
- HbTapGesture *tapGesture = new HbTapGesture();
- list.append( tapGesture );
- QGestureEvent* event = new QGestureEvent( list );
-
- //
- // connect to tappedOnScreen() signal and record its emission
- //
- QSignalSpy spy( mVideoView, SIGNAL( tappedOnScreen() ) );
-
- //
- // ensure signal has not been emitted yet
- //
- QCOMPARE( spy.count(), 0 );
-
- //
- // With GestureStarted
- //
- tapGesture->mState = Qt::GestureStarted;
- mVideoView->gestureEvent( event );
-
- //
- // ensure signal hasn't been emitted and its emission count is not incremented
- //
- QCOMPARE( spy.count(), 0 );
-
- //
- // With GestureFinished
- //
- tapGesture->mState = Qt::GestureFinished;
- mVideoView->gestureEvent( event );
-
- //
- // ensure signal has been emitted and its emission count is incremented
- //
- QCOMPARE( spy.count(), 1 );
-
- //
- // clean up
- //
- spy.clear();
-
- list.clear();
-
- if ( tapGesture )
- {
- delete tapGesture;
- tapGesture = NULL;
- }
-
- if ( event )
- {
- delete event;
- event = NULL;
- }
-
- //
- // 2. Test pan gesture
- //
- HbPanGesture *panGesture = new HbPanGesture();
- list.append( panGesture );
- event = new QGestureEvent( list );
-
- //
- // connect to pannedToRight() signal and record its emission
- //
- QSignalSpy spy1( mVideoView, SIGNAL( pannedToRight() ) );
-
- //
- // ensure signal has not been emitted yet
- //
- QCOMPARE( spy1.count(), 0 );
-
- //
- // Test pan gesture With GestureStarted
- //
- panGesture->mState = Qt::GestureStarted;
- mVideoView->gestureEvent( event );
-
- //
- // ensure signal has not been emitted yet
- //
- QCOMPARE( spy1.count(), 0 );
-
- //
- // Test pan gesture with GestureFinished
- //
- panGesture->mState = Qt::GestureFinished;
- panGesture->mSceneDelta = QPointF( 5, 0 );
- mVideoView->gestureEvent( event );
-
- //
- // ensure signal has been emitted
- //
- QCOMPARE( spy1.count(), 1 );
- spy1.clear();
-
- //
- // Test pan gesture with GestureFinished
- //
-
- //
- // connect to pannedToRight() signal and record its emission
- //
- QSignalSpy spy2( mVideoView, SIGNAL( pannedToLeft() ) );
-
- //
- // ensure signal has not been emitted yet
- //
- QCOMPARE( spy2.count(), 0 );
-
- panGesture->mState = Qt::GestureFinished;
- panGesture->mSceneDelta = QPointF( -5, 0 );
- mVideoView->gestureEvent( event );
-
- //
- // ensure signal has not been emitted yet
- //
- QCOMPARE( spy2.count(), 1 );
-
- //
- // clean up
- //
- spy2.clear();
- list.clear();
-
- if ( panGesture )
- {
- delete panGesture;
- panGesture = NULL;
- }
-
- if ( event )
- {
- delete event;
- event = NULL;
- }
-
- cleanup();
-}
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/stub/inc/hbpangesture.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
-* 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 HbPanGesture
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#ifndef HBPANGESTURE_H_
-#define HBPANGESTURE_H_
-
-#include <QPanGesture>
-
-class HbPanGesture : public QPanGesture
-{
- Q_OBJECT
-
- public:
- HbPanGesture();
- virtual ~HbPanGesture();
- Qt::GestureState state(){ return mState; }
- QPointF sceneDelta();
-
- public:
- Qt::GestureState mState;
- QPointF mSceneDelta;
-};
-
-#endif /*HBPANGESTURE_H_*/
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/stub/inc/hbtapgesture.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/*
-* 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 HbTapGesture
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#ifndef HbTAPGESTURE_H_
-#define HbTAPGESTURE_H_
-
-#include <QTapGesture>
-
-class HbTapGesture : public QTapGesture
-{
- Q_OBJECT
-
- public:
- HbTapGesture();
- virtual ~HbTapGesture();
- Qt::GestureState state(){ return mState; }
-
- public:
- Qt::GestureState mState;
-};
-
-#endif /*HbTAPGESTURE_H_*/
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/stub/inc/mpxvideoviewwrapper.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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: MPX Video base playback view
-*
-*/
-
-// Version : %version: 4 %
-
-
-
-// This file defines the API for .dll
-
-#ifndef __MPXVIDEOVIEWWRAPPER_H__
-#define __MPXVIDEOVIEWWRAPPER_H__
-
-// Include Files
-
-#include <e32base.h> // CBase
-#include <e32std.h> // TBuf
-
-
-#include "mpxvideoplaybackcontrol.hrh"
-
-// Constants
-
-// Forward Declarations
-class HbVideoBasePlaybackView;
-class QMPXVideoPlaybackViewFileDetails;
-
-
-// Class Definitions
-
-class CMPXVideoViewWrapper : public CBase
-{
- public:
- static CMPXVideoViewWrapper* NewL( HbVideoBasePlaybackView* aView );
- virtual ~CMPXVideoViewWrapper();
-
- private:
- CMPXVideoViewWrapper( HbVideoBasePlaybackView* aView );
- void ConstructL();
-
- void SetFileDetails(TBool aDefault);
-
- public:
- void HandleCommandL( TInt aCommand );
-
- TBool IsLive();
-
- TBool IsPlaylist();
-
- TBool IsMultiItemPlaylist();
-
- void RequestMediaL();
-
- void CreateGeneralPlaybackCommandL( int aCmd );
-
- void ActivateClosePlayerActiveObject();
-
- void IssueVideoAppForegroundCmdL( TBool aForeground );
-
-
- public: // data
-
- HbVideoBasePlaybackView* iView;
- TBool iMediaRequested;
- QMPXVideoPlaybackViewFileDetails* iFileDetails;
- TBool iClosePlayerAO;
- TBool iForeground;
- TInt iCommand;
-};
-
-#endif // __MPXVIDEOVIEWWRAPPER_H__
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/stub/src/hbpangesture.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
-* 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 HbPanGesture
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-
-#include "mpxvideo_debug.h"
-#include "hbpangesture.h"
-
-// -------------------------------------------------------------------------------------------------
-// HbPanGesture::HbPanGesture
-// -------------------------------------------------------------------------------------------------
-//
-HbPanGesture::HbPanGesture()
-{
- MPX_ENTER_EXIT(_L("HbPanGesture::HbPanGesture()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbPanGesture::~HbPanGesture
-// -------------------------------------------------------------------------------------------------
-//
-HbPanGesture::~HbPanGesture()
-{
- MPX_DEBUG(_L("HbPanGesture::HbPanGesture") );
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbPanGesture::sceneDelta
-// -------------------------------------------------------------------------------------------------
-//
-QPointF HbPanGesture::sceneDelta()
-{
- MPX_DEBUG(_L("HbPanGesture::sceneDelta") );
-
- return mSceneDelta;
-}
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/stub/src/hbtapgesture.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
-* 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 HbTapGesture
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-
-#include "mpxvideo_debug.h"
-#include "hbtapgesture.h"
-
-// -------------------------------------------------------------------------------------------------
-// HbTapGesture::HbTapGesture
-// -------------------------------------------------------------------------------------------------
-//
-HbTapGesture::HbTapGesture()
-{
- MPX_ENTER_EXIT(_L("HbTapGesture::HbTapGesture()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbTapGesture::~HbTapGesture
-// -------------------------------------------------------------------------------------------------
-//
-HbTapGesture::~HbTapGesture()
-{
- MPX_DEBUG(_L("HbTapGesture::HbTapGesture") );
-}
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/stub/src/mpxvideoviewwrapper.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,222 +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 Video base playback view
-*
-*/
-
-// Version : %version: 7 %
-
-
-
-// Include Files
-
-#include "mpxvideoviewwrapper.h"
-#include "hbvideobaseplaybackview.h"
-#include "mpxvideoplaybackviewfiledetails.h"
-#include "mpxcommonvideoplaybackview.hrh"
-
-// Member Functions
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::CMPXVideoViewWrapper()
-// -------------------------------------------------------------------------------------------------
-//
-CMPXVideoViewWrapper::CMPXVideoViewWrapper( HbVideoBasePlaybackView* aView )
- : iView( aView )
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::NewL()
-// -------------------------------------------------------------------------------------------------
-//
-CMPXVideoViewWrapper* CMPXVideoViewWrapper::NewL( HbVideoBasePlaybackView* aView )
-{
- CMPXVideoViewWrapper* self = new (ELeave) CMPXVideoViewWrapper( aView );
-
- CleanupStack::PushL( self );
- self->ConstructL();
- CleanupStack::Pop();
-
- return self;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::ConstructL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::ConstructL()
-{
- iMediaRequested = EFalse;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::~CMPXVideoViewWrapper()
-// -------------------------------------------------------------------------------------------------
-//
-CMPXVideoViewWrapper::~CMPXVideoViewWrapper()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::IsLive()
-// -------------------------------------------------------------------------------------------------
-//
-TBool CMPXVideoViewWrapper::IsLive()
-{
- return EFalse;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::IsPlaylist()
-// -------------------------------------------------------------------------------------------------
-//
-TBool CMPXVideoViewWrapper::IsPlaylist()
-{
- return EFalse;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::CreateGeneralPlaybackCommandL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::CreateGeneralPlaybackCommandL( int aCmd )
-{
- Q_UNUSED( aCmd );
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::HandleCommandL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::HandleCommandL( TInt aCommand )
-{
- iCommand = aCommand;
-}
-
-// -------------------------------------------------------------------------------------------------
-// Request for the media object
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::RequestMediaL()
-{
- iMediaRequested = ETrue;
-
- SetFileDetails( ETrue );
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::ActivateClosePlayerActiveObject
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::ActivateClosePlayerActiveObject()
-{
- iClosePlayerAO = ETrue;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::IsMultiItemPlaylist()
-// -------------------------------------------------------------------------------------------------
-//
-TBool CMPXVideoViewWrapper::IsMultiItemPlaylist()
-{
- return iFileDetails->mMultiItemPlaylist;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::SetFileDetails()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::SetFileDetails(TBool aDefault)
-{
- if ( iFileDetails )
- {
- delete iFileDetails;
- iFileDetails = NULL;
- }
-
- iFileDetails = new QMPXVideoPlaybackViewFileDetails();
-
- _LIT(KTestMimeType, "video/3gp");
- const QString qMimeType( (QChar*)KTestMimeType().Ptr(), KTestMimeType().Length() );
- iFileDetails->mMimeType = qMimeType;
-
- _LIT(KTestTitle, "Test Video Title");
- const QString qTitle( (QChar*)KTestTitle().Ptr(), KTestTitle().Length() );
- iFileDetails->mTitle = qTitle;
-
- _LIT(KTestArtist, "TestArtist");
- const QString qArtist( (QChar*)KTestArtist().Ptr(), KTestArtist().Length() );
- iFileDetails->mArtist = qArtist;
-
- _LIT(KTestDescription, "Test Description");
- const QString qDescription( (QChar*)KTestDescription().Ptr(), KTestDescription().Length() );
- iFileDetails->mDescription = qDescription;
-
- _LIT(KTestLocation, "Test Location");
- const QString qLocation( (QChar*)KTestLocation().Ptr(), KTestLocation().Length() );
- iFileDetails->mLocation = qLocation;
-
- _LIT(KTestCopyright, "Test Copyright");
- const QString qCopyright( (QChar*)KTestCopyright().Ptr(), KTestCopyright().Length() );
- iFileDetails->mCopyright = qCopyright;
-
- _LIT(KTestLanguage, "Test Language");
- const QString qLanguage( (QChar*)KTestLanguage().Ptr(), KTestLanguage().Length() );
- iFileDetails->mLanguage = qLanguage;
-
- _LIT(KTestKeywords, "Test Keywords");
- const QString qKeywords( (QChar*)KTestKeywords().Ptr(), KTestKeywords().Length() );
- iFileDetails->mKeywords = qKeywords;
-
- if ( aDefault )
- {
- _LIT(KTestClipName, "testClip.3gp");
- const QString qClipname( (QChar*)KTestClipName().Ptr(), KTestClipName().Length() );
- iFileDetails->mClipName = qClipname;
- }
- else
- {
- _LIT(KTestClipName, "nextClip.3gp");
- const QString qClipname( (QChar*)KTestClipName().Ptr(), KTestClipName().Length() );
- iFileDetails->mClipName = qClipname;
- }
-
- iFileDetails->mPlaybackMode = EMPXVideoLocal;
- iFileDetails->mSeekable = true;
- iFileDetails->mPausableStream = true;
- iFileDetails->mAudioEnabled = true;
- iFileDetails->mVideoEnabled = true;
- iFileDetails->mPartialPlayback = false;
- iFileDetails->mRNFormat = false;
- iFileDetails->mDuration = 100;
- iFileDetails->mTvOutConnected = false;
- iFileDetails->mDrmProtected = false;
- iFileDetails->mMultiItemPlaylist = false;
- iFileDetails->mVideoHeight = 320;
- iFileDetails->mVideoWidth = 240;
- iFileDetails->mBitRate = 16000;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::IssueVideoAppForegroundCmd()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::IssueVideoAppForegroundCmdL( TBool aForeground )
-{
- iForeground = aForeground;
-}
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/testvideoplaybackview.pro Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +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: 8 %
-
-TEMPLATE = app
-TARGET = testvideoplaybackview
-CONFIG += qtestlib hb qt
-DEFINES += BUILD_VIDEOPLAYBACK_DLL
-
-DEPENDPATH += . inc src stub/src stub/inc
-
-INCLUDEPATH += stub/inc \
- ../../inc \
- ../../../../inc \
- ../../controlinc \
-
-LIBS += -lcone.dll \
- -lcommonengine.dll \
- -lflogger.dll
-
-# Input
-HEADERS += mpxvideoviewwrapper.h \
- testvideoplaybackview.h \
- ../../../inc/hbvideobaseplaybackview.h \
- ../../../inc/hbvideoplaybackview.h \
- mpxvideoplaybackviewfiledetails.h \
- hbtapgesture.h \
- hbpangesture.h
-
-SOURCES += mpxvideoviewwrapper.cpp \
- testvideoplaybackview.cpp \
- ../../viewsrc/hbvideobaseplaybackview.cpp \
- ../../viewsrc/hbvideoplaybackview.cpp \
- ../../viewsrc/mpxvideoplaybackviewfiledetails.cpp \
- hbtapgesture.cpp \
- hbpangesture.cpp
--- a/videoplayback/hbvideoplaybackview/viewinc/mpxhelixplaybackplugindefs.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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: Externalizable container for DSA region
-*
-*/
-
-// Version : %version: da1mmcf#2 %
-
-
-
-#ifndef MPXHELIXPLAYBACKPLUGINDEFS_H_
-#define MPXHELIXPLAYBACKPLUGINDEFS_H_
-
-enum TMPXVideoPlaybackState
-{
- EMPXVideoNotInitialized,
- EMPXVideoInitializing,
- EMPXVideoInitialized,
- EMPXVideoBuffering,
- EMPXVideoPlaying,
- EMPXVideoPaused,
- EMPXVideoStopped,
- EMPXVideoSeeking,
- EMPXNumberOfStates
-};
-
-
-enum TMPXVideoMode
-{
- EMPXVideoLocal,
- EMPXVideoStreaming,
- EMPXVideoLiveStreaming,
- EMPXVideoProgressiveDownload,
- EMPXNumberOfModes
-};
-
-
-
-#endif /*MPXHELIXPLAYBACKPLUGINDEFS_H_*/
--- a/videoplayback/hbvideoplaybackview/viewinc/mpxvideocontainer.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +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: CCoeControl to provide RWindow for videoplayback
-*
-*/
-
-// Version : %version: 2 %
-
-
-#ifndef CMPXVIDEOCONTAINER_H
-#define CMPXVIDEOCONTAINER_H
-
-#include <coecntrl.h>
-
-
-class CMPXVideoContainer : public CCoeControl
-{
-
- public:
- CMPXVideoContainer();
- virtual ~CMPXVideoContainer();
-
- void ConstructL();
-};
-
-#endif // CMPXVIDEOCONTAINER_H
-
-// End of file
\ No newline at end of file
--- a/videoplayback/hbvideoplaybackview/viewinc/mpxvideoplaybackdisplayhandler.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,141 +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 video playback display handler
-*
-*/
-
-// Version : %version: 9 %
-
-
-#ifndef __CMPXVIDEOPLAYBACKDISPLAYHANDLER_H__
-#define __CMPXVIDEOPLAYBACKDISPLAYHANDLER_H__
-
-// INCLUDES
-
-#include <mpxmessage2.h>
-#include <MMFScalingCustomCommandConstants.h>
-#include <mpxvideoplaybackdefs.h>
-#include <mediaclientvideodisplay.h>
-
-
-//
-// CLASS DECLARATION
-//
-class CMPXVideoContainer;
-class MMPXPlaybackUtility;
-class CMPXVideoViewWrapper;
-class QMPXVideoPlaybackViewFileDetails;
-
-/*
- * CMPXVideoPlaybackDisplayHandler
- *
- */
-class CMPXVideoPlaybackDisplayHandler : public CBase
-{
- //
- // To save user's preference for scaling type in video ratio + screen ratio
- //
- typedef struct
- {
- TReal32 videoRatio;
- TReal32 screenRatio;
- TMMFScalingType scalingType;
- } TMPXAspectRatio ;
-
- public:
-
- ~CMPXVideoPlaybackDisplayHandler();
-
- static CMPXVideoPlaybackDisplayHandler* NewL( MMPXPlaybackUtility* aPlayUtil,
- CMPXVideoViewWrapper* aViewWrapper );
-
- void CreateDisplayWindowL( RWsSession& aWs,
- CWsScreenDevice& aScreenDevice,
- RWindow& aWin,
- TRect aDisplayRect );
-
- void RemoveDisplayWindow();
-
- void HandleVideoDisplayMessageL( CMPXMessage* aMessage );
-
- TInt SetAspectRatioL( TMPXVideoPlaybackCommand aCmd );
-
- TInt SetDefaultAspectRatioL( QMPXVideoPlaybackViewFileDetails* aFileDetails,
- TReal32 aDisplayAspectRatio );
-
- void UpdateVideoRectL( TRect aRect, TBool transitionEffect );
-
- private:
-
- CMPXVideoPlaybackDisplayHandler( MMPXPlaybackUtility* aPlayUtil,
- CMPXVideoViewWrapper* aViewWrapper );
-
- void ConstructL();
-
- void LoadAspectRatioL();
-
- void SaveAspectRatioL();
-
- void SetVideoRectL( TRect aClipRect );
-
- void CalculateVideoRectL();
-
- static TInt UpdateVideoRectTimeOutL( TAny* aPtr );
-
- private:
- void AddDisplayWindowL( CWsScreenDevice& aScreenDevice,
- RWindowBase& aWindowBase,
- RWindow* aWin );
-
- void SurfaceCreatedL( CMPXMessage* aMessage );
- void SurfaceChangedL( CMPXMessage* aMessage );
- void SurfaceRemoved();
- TInt SetNgaAspectRatioL( TMPXVideoPlaybackCommand aCmd );
-
- private:
- MMPXPlaybackUtility* iPlaybackUtility;
-
- RArray<TMPXAspectRatio> iAspectRatioArray;
- TInt iCurrentIndexForAspectRatio;
- TReal iDisplayAspectRatio;
-
- TRect iWindowRect;
-
- TReal32 iTlXDiff;
- TReal32 iTlYDiff;
- TReal32 iBrXDiff;
- TReal32 iBrYDiff;
-
- TInt iTransitionEffectCnt;
-
- CPeriodic* iResizingTimer;
- CMPXVideoViewWrapper* iViewWrapper;
-
- CMediaClientVideoDisplay* iVideoDisplay;
-
- RWindowBase* iWindowBase;
- TBool iSurfaceCached;
- TSurfaceId iSurfaceId;
- TRect iCropRect;
- TVideoAspectRatio iAspectRatio;
- TReal32 iScaleWidth;
- TReal32 iScaleHeight;
- TInt iHorizontalPosition;
- TInt iVerticalPosition;
- TVideoRotation iRotation;
- TAutoScaleType iAutoScale;
- CMPXVideoContainer* iVideoContainer;
-};
-
-#endif // __CMPXVIDEOPLAYBACKDISPLAYHANDLER_H__
--- a/videoplayback/hbvideoplaybackview/viewinc/mpxvideoplaybackuids.hrh Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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: Resource headers for video UIDs
- *
-*/
-
-// Version : %version: da1mmcf#2 %
-
-
-
-
-#ifndef __MPXPLAYBACKUIDS_HRH__
-#define __MPXPLAYBACKUIDS_HRH__
-
-// CONSTANTS
-
-#define KMPXVIDEOPLAYBACKVIEWPLUGINUID 0x200159AC
-#define KMPXVIDEOPLAYBACKVIEWPLUGINIMPLEMENTATIONUID 0x200159AD
-
-#define KMPXVIDEOPDLPLAYBACKVIEWPLUGINUID 0x2001E5A7
-#define KMPXVIDEOPDLPLAYBACKVIEWPLUGINIMPLEMENTATIONUID 0x2001E5A8
-
-#define KMPXVIDEOPLAYBACKPLUGINIMPLEMENTATIONUID 0x10282551
-
-#define KMPXVIDEOPLAYBACKVIEWUID 0x200159B4
-#define KMPXVIDEOPDLPLAYBACKVIEWUID 0x2001E5A9
-
-#define KBROWSERUID 0x10008D39
-
-#endif // __MPXPLAYBACKUIDS_HRH__
--- a/videoplayback/hbvideoplaybackview/viewinc/mpxvideoplaybackuserinputhandler.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,152 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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 MPXVideoPlaybackUserInputHandler
-*
-*/
-
-// Version : %version: 5 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKUSERINPUTHANDLER_H_
-#define MPXVIDEOPLAYBACKUSERINPUTHANDLER_H_
-
-// INCLUDES
-#include <remconcoreapitargetobserver.h> // Side volume key
-
-
-// FORWARD DECLARATIONS
-class CRemConInterfaceSelector; // Side volume key
-class CRemConCoreApiTarget;
-class CMPXVideoViewWrapper;
-
-// CLASS DECLARATION
-
-class CMPXVideoPlaybackUserInputHandler : public CBase,
- public MRemConCoreApiTargetObserver
-{
- public: // Constructors and destructor
-
- /**
- * Two-phased constructor.
- */
- static CMPXVideoPlaybackUserInputHandler* NewL(
- CMPXVideoViewWrapper* aWrapper, TBool aTvOutConnected );
-
- /**
- * Destructor.
- */
- virtual ~CMPXVideoPlaybackUserInputHandler();
-
- private:
-
- /**
- * C++ default constructor.
- */
- CMPXVideoPlaybackUserInputHandler( CMPXVideoViewWrapper* aWrapper );
-
- /**
- * Symbian 2nd phase constructor.
- */
- void ConstructL( TBool aTvOutConnected );
-
- public:
- void ProcessKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
-
- void ProcessMediaKey( TRemConCoreApiOperationId aOperationId,
- TRemConCoreApiButtonAction aButtonAct );
-
- void DoHandleMediaKey( TRemConCoreApiOperationId aOperationId,
- TRemConCoreApiButtonAction aButtonAct );
-
- // From MRemConCoreApiTargetObserver
- /**
- * Side volume key API from MRemConCoreApiTargetObserver
- * @since 3.2
- * @see MRemConCoreApiTargetObserver
- */
- virtual void MrccatoPlay(
- TRemConCoreApiPlaybackSpeed aSpeed,
- TRemConCoreApiButtonAction aButtonAct );
-
- virtual void MrccatoCommand(
- TRemConCoreApiOperationId aOperationId,
- TRemConCoreApiButtonAction aButtonAct );
-
- /**
- * Setter method for iForeground
- * @param aForeground - the value to be set
- * @return void
- */
- void SetForeground( TBool aForeground );
-
- void HandleTVOutEventL( TBool aTVOutConnected );
-
- private:
- /**
- * Handles volume repeat timer timout
- * @return TInt
- */
- static TInt HandleVolumeRepeatTimeoutL( TAny* aPtr );
-
- /**
- * Adjust volume(+1/-1) for media key
- * @return void
- */
- void HandleVolumeRepeatL();
-
- void HandleFastForward( TRemConCoreApiButtonAction aButtonAct );
-
- void HandleRewind( TRemConCoreApiButtonAction aButtonAct );
-
- void HandleVolumeUp( TRemConCoreApiButtonAction aButtonAct );
-
- void HandleVolumeDown( TRemConCoreApiButtonAction aButtonAct );
-
- // Handles the Display light timer timeout
- static TInt HandleDisplayTimeout( TAny* aPtr );
-
- // Disable the display backlight
- void DisableBacklight();
-
- // Enable the display backlight
- void EnableBacklight();
-
- // Restarts the timer for display light time-out
- void RestartDisplayTimer();
-
- private:
-
- TMPXVideoUserInputType iProcessingInputType; // the type of input being processed
- TUint iLastPressedKeyCode; // keycode of last key that sent EEventKeyDown
- TInt iLastPressedKeyScanCode; // scancode of last key that sent EEventKeyDown
- TRemConCoreApiOperationId iLastMediaKeyPressed; // Id of last mediakey thats sent a button-press
-
- CRemConInterfaceSelector* iInterfaceSelector; // Side volume key, owned
- CRemConCoreApiTarget* iCoreTarget; // Owned by CRemConInterfaceSelector
-
- CPeriodic* iVolumeRepeatTimer; // owned
- TBool iVolumeRepeatUp;
- TBool iTVOutConnected; // Flag to indicate if TV is connected
- CPeriodic* iDisplayTimer; // Timer to timeout the lights time-out
- TInt iDisplayTimeOut; // Value of the lights time-out
-
- TBool iForeground;
- CMPXVideoViewWrapper* iViewWrapper;
-};
-
-
-#endif /*MPXVIDEOPLAYBACKUSERINPUTHANDLER_H_*/
-
-// End of File
--- a/videoplayback/hbvideoplaybackview/viewinc/mpxvideoviewwrapper.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,282 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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: MPX Video base playback view
-*
-*/
-
-// Version : %version: da1mmcf#16 %
-
-
-
-// This file defines the API for .dll
-
-#ifndef __MPXVIDEOVIEWWRAPPER_H__
-#define __MPXVIDEOVIEWWRAPPER_H__
-
-// Include Files
-
-#include <e32base.h> // CBase
-#include <e32std.h> // TBuf
-#include <mpxplaybackobserver.h>
-#include <mpxvideoplaybackdefs.h>
-#include <mpxviewactivationobserver.h>
-#include <mpxcollectionobserver.h>
-
-#include "mpxvideoplaybackcontrol.hrh"
-
-enum TMPXMediaRequestStatus
-{
- MediaNotRequested,
- MediaRequested,
- MediaDelivered
-};
-
-// Forward Declarations
-class MMPXPlaybackUtility;
-class MMPXCollectionUtility;
-class HbVideoBasePlaybackView;
-class CMPXVideoPlaybackDisplayHandler;
-class QMPXVideoPlaybackViewFileDetails;
-class CMPXVideoPlaybackUserInputHandler;
-class QMPXVideoPlaybackControlsController;
-
-// Class Definitions
-
-class CMPXVideoViewWrapper : public CBase,
- public MMPXPlaybackObserver,
- public MMPXViewActivationObserver,
- public MMPXPlaybackCallback,
- public MMPXCollectionObserver
-{
- public:
- static CMPXVideoViewWrapper* NewL( HbVideoBasePlaybackView* aView );
- virtual ~CMPXVideoViewWrapper();
-
- private:
- CMPXVideoViewWrapper( HbVideoBasePlaybackView* aView );
- void ConstructL();
-
- public:
- virtual void HandleCommandL( TInt aCommand );
-
- void RetrieveFileNameAndModeL( CMPXCommand* aCmd );
-
- /*
- * From MMPXViewActivationObserver
- * Handle view activation.
- *
- * @param aCurrentViewType Current view type Uid.
- * @param aPreviousViewType Previous view type Uid.
- */
- inline void HandleViewActivation( const TUid& /*aCurrentViewType*/,
- const TUid& /*aPreviousViewType*/ ) {}
-
- /**
- * From MMPXPlaybackObserver
- * Handle playback message
- *
- * @param aMessage Playback Message
- * @param aErr system error code.
- */
- virtual void HandlePlaybackMessage( CMPXMessage* aMessage, TInt aError );
-
- /**
- * From MMPXPlaybackCallback
- * Handle playback property
- *
- * @param aProperty the property
- * @param aValue the value of the property
- * @param aError error code
- */
- void HandlePropertyL( TMPXPlaybackProperty aProperty,
- TInt aValue,
- TInt aError );
-
- /**
- * Method is called continously until aComplete=ETrue, signifying that
- * it is done and there will be no more callbacks
- * Only new items are passed each time
- *
- * @param aPlayer UID of the subplayer
- * @param aSubPlayers a list of sub players
- * @param aComplete ETrue no more sub players. EFalse more subplayer
- * expected
- * @param aError error code
- */
- inline void HandleSubPlayerNamesL( TUid /*aPlayer*/,
- const MDesCArray* /*aSubPlayers*/,
- TBool /*aComplete*/,
- TInt /*aError*/ )
- {}
-
- /**
- * Call back of media request
- *
- * @param aMedia media
- * @param aError error code
- */
- void HandleMediaL( const CMPXMedia& aProperties, TInt aError );
-
-
- /**
- * Handle completion of a asynchronous command
- * @param aCommandResult result of the command, NULL if error
- * @param aError error code
- */
- void HandlePlaybackCommandComplete( CMPXCommand* /*aCommandResult*/,
- TInt /*aError*/);
- /*
- * From base class MMPXCollectionMediaObserver
- * (via MMPXCollectionObserver)
- * Handle extended media properties
- *
- * @param aMedia media
- * @param aError error code
- */
- inline void HandleCollectionMediaL( const CMPXMedia& /*aMedia*/, TInt /*aError*/ ) {}
-
- /*
- * From base class MMPXCollectionObserver
- */
- inline void HandleCollectionMessage( CMPXMessage* /*aMsg*/, TInt /*aErr*/ ) {}
-
- inline void HandleOpenL( const CMPXMedia& /*aEntries*/,
- TInt /*aIndex*/,
- TBool /*aComplete*/,
- TInt /*aError*/ ) {}
-
- inline void HandleOpenL( const CMPXCollectionPlaylist& /*aPlaylist*/, TInt /*aError*/ ) {}
-
- /**
- * Set property
- */
- void SetPropertyL( TMPXPlaybackProperty aProperty, TInt aValue );
- virtual void RetrievePdlInformationL();
-
- TBool IsLive();
-
- TBool IsPlaylist();
-
- void IssueVideoAppForegroundCmdL(TBool aForeground);
-
- void RequestMediaL();
-
- void CreateGeneralPlaybackCommandL( TMPXPlaybackCommand aCmd, TBool aDoSync = ETrue );
-
- TBool IsAppInFrontL();
-
- /*
- * Activates an active object to close the player
- * @since 5.0
- */
- void ActivateClosePlayerActiveObject();
-
- void CreateControlsL();
-
- TBool IsMultiItemPlaylist();
-
- void UpdateVideoRect( TInt aX, TInt aY, TInt aWidth, TInt aHeight, TBool transitionEffect );
-
- void UpdateVideoRectDone();
-
- void HandlePluginError( TInt aError );
-
- void ClosePlaybackViewL();
-
- void HandleBufferingStateL();
-
- /*
- * Provides the static function for the callback to close the player
- * Called by CIdle iIdle
- * @since 3.2
- * @param aPtr Pointer to callback class
- * @return KErrNone
- */
- static TInt ClosePlayer( TAny* aPtr );
-
- /*
- * Called to stop and exit the player
- * @since 3.2
- * @return void
- */
- void DoClosePlayer();
-
- void HandleVideoPlaybackMessage( CMPXMessage* aMessage );
-
- private:
-
- /**
- * Handle playback message
- *
- * @param aMsg playback message
- */
- virtual void DoHandlePlaybackMessageL( CMPXMessage* aMessage );
-
- /**
- * Handle playback error message
- *
- * @param aErr system error code.
- */
- void DoHandleErrorPlaybackMessageL( TInt aError );
-
- void DisplayFileDetailsDialogL();
-
- /**
- * Handle media properties.
- *
- * @param aMedia media properties
- * @param aError error code
- */
- virtual void DoHandleMediaL( const CMPXMedia& aMedia, TInt aError );
-
- void CreateVideoSpecificCmdL( TMPXVideoPlaybackCommand aCmd );
-
- void ParseMetaDataL( const CMPXMedia& aMedia );
-
- void DoHandleStateChangeL( TInt aNewState );
-
- void HandleGeneralPlaybackMessageL( CMPXMessage* aMessage );
-
- void SetAspectRatioL( TMPXVideoPlaybackCommand aCmd );
-
- void HandleVolumeCmdL( TMPXPlaybackCommand aCmd );
-
- void HandleShortPressBackwardL();
-
- void IssuePlayCommandL();
-
- protected: // data
- MMPXPlaybackUtility* iPlaybackUtility;
- MMPXCollectionUtility* iCollectionUtility;
- TMPXPlaybackState iPlaybackState;
-
- QMPXVideoPlaybackViewFileDetails* iFileDetails;
- CIdle* iCloseAO;
-
- HbVideoBasePlaybackView* iView;
- CMPXVideoPlaybackDisplayHandler* iDisplayHandler;
- CMPXVideoPlaybackUserInputHandler* iUserInputHandler;
- QMPXVideoPlaybackControlsController* iControlsController;
-
- TMPXMediaRequestStatus iMediaRequestStatus;
- TBool iPlaylistView;
- int iPlayPosition;
-
- public:
- friend class HbVideoBasePlaybackView;
-};
-
-#endif // __MPXVIDEOVIEWWRAPPER_H__
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/viewsrc/hbvideobaseplaybackview.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,484 +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 Video base playback view
-*
-*/
-
-// Version : %version: da1mmcf#43 %
-
-
-
-// Include Files
-
-
-
-#include <QTimer>
-#include <QGraphicsSceneEvent>
-
-#include <hbmenu.h>
-#include <hbaction.h>
-#include <hbinstance.h>
-#include <hbnotificationdialog.h>
-#include <hblabel.h>
-#include <hbtapgesture.h>
-#include <hbpangesture.h>
-
-#include <textresolver.h>
-#include <mmf/common/mmferrors.h>
-#include <DRMHelper.h>
-
-#include <mpxvideoplaybackdefs.h>
-#include <mpxplaybackcommanddefs.h>
-#include <mpxhbvideocommondefs.h>
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoviewwrapper.h"
-#include "mpxvideoplaybackuids.hrh"
-#include "hbvideobaseplaybackview.h"
-#include "videoactivitystate.h"
-#include "mpxvideoplaybackviewfiledetails.h"
-#include "mpxcommonvideoplaybackview.hrh"
-
-
-// Member Functions
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::HbVideoBasePlaybackView()
-// -------------------------------------------------------------------------------------------------
-//
-HbVideoBasePlaybackView::HbVideoBasePlaybackView()
- : mVideoMpxWrapper( NULL )
- , mTimerForClosingView( NULL )
- , mActivated( false )
- , mStayPaused ( false )
-{
- MPX_ENTER_EXIT(_L("HbVideoBasePlaybackView::HbVideoBasePlaybackView()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::initializeVideoPlaybackView()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::initializeVideoPlaybackView()
-{
- MPX_ENTER_EXIT(_L("HbVideoBasePlaybackView::initializeVideoPlaybackView()"));
-
- //
- // Need to set to control full screen including status pane area
- //
- setContentFullScreen();
-
- mTimerForClosingView = new QTimer();
- mTimerForClosingView->setSingleShot( true );
- mTimerForClosingView->setInterval( 10 );
- connect( mTimerForClosingView, SIGNAL( timeout() ), this, SIGNAL( activatePreviousView() ) );
-
- //
- // Read activity data ...
- // If last playback was forced to terminate due to low memory (GOOM, etc.)
- // then the clip needs to be restored to the last played position
- // and the state needs to be paused, since forced termination can only occur for
- // background apps - so if this happened Video Player must have been in background
- // which implies paused state
- //
- int lastViewType = VideoActivityState::instance().getActivityData(KEY_VIEWPLUGIN_TYPE).toInt();
- if ( lastViewType == MpxHbVideoCommon::PlaybackView )
- {
- QVariant data = VideoActivityState::instance().getActivityData(KEY_LAST_PLAY_POSITION_ID);
- mLastPlayPosition = data.toInt();
-
- mStayPaused = true;
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::~HbVideoBasePlaybackView()
-// -------------------------------------------------------------------------------------------------
-//
-HbVideoBasePlaybackView::~HbVideoBasePlaybackView()
-{
- MPX_DEBUG(_L("HbVideoBasePlaybackView::~HbVideoBasePlaybackView()"));
-
- if ( mTimerForClosingView )
- {
- disconnect( mTimerForClosingView, SIGNAL( timeout() ), this, SIGNAL( activatePreviousView() ) );
-
- if ( mTimerForClosingView->isActive() )
- {
- mTimerForClosingView->stop();
- }
-
- delete mTimerForClosingView;
- mTimerForClosingView = NULL;
- }
-
- if ( mVideoMpxWrapper )
- {
- delete mVideoMpxWrapper;
- mVideoMpxWrapper = NULL;
- }
-
- setParentItem( 0 );
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::handleActivateView()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::handleActivateView()
-{
- MPX_ENTER_EXIT(_L("HbVideoBasePlaybackView::handleActivateView()"));
-
- MPX_TRAPD( err, mVideoMpxWrapper = CMPXVideoViewWrapper::NewL( this ) );
-
- QCoreApplication::instance()->installEventFilter( this );
-
- //
- // Request the needed Media from the Playback Plugin
- //
- MPX_TRAP( err, mVideoMpxWrapper->RequestMediaL() );
-
- menu()->close();
-
- //
- // Landscape orientation
- // 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;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::handleDeactivateView()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::handleDeactivateView()
-{
- MPX_ENTER_EXIT(_L("HbVideoBasePlaybackView::handleDeactivateView()"));
-
- saveActivityData();
-
- mActivated = false;
-
- QCoreApplication::instance()->removeEventFilter( this );
-
- //
- // Close the playback plugin to release all references to previous clip
- //
- MPX_TRAPD( err, mVideoMpxWrapper->HandleCommandL( EMPXPbvCmdClose ) );
-
- if ( mVideoMpxWrapper )
- {
- delete mVideoMpxWrapper;
- mVideoMpxWrapper = NULL;
- }
-
- //
- // go back to device orientation
- //
- //hbInstance->allMainWindows()[0]->unsetOrientation();
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::saveActivityData()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::saveActivityData()
-{
- MPX_DEBUG( _L("HbVideoBasePlaybackView::saveActivityData()") );
-
- // save the activity data
- QVariant data = QString( mVideoMpxWrapper->iFileDetails->mClipName );
- VideoActivityState::instance().setActivityData(data, KEY_LAST_PLAYED_CLIP);
-
- data = int( mVideoMpxWrapper->iPlayPosition );
- VideoActivityState::instance().setActivityData(data, KEY_LAST_PLAY_POSITION_ID);
-
- data = bool( mVideoMpxWrapper->iFileDetails->mPlaybackMode == EMPXVideoLocal );
- VideoActivityState::instance().setActivityData(data, KEY_LAST_LOCAL_PLAYBACK);
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::handleClosePlaybackView()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::handleClosePlaybackView()
-{
- MPX_DEBUG(
- _L("HbVideoBasePlaybackView::handleClosePlaybackView()") );
-
- if ( mVideoMpxWrapper && mVideoMpxWrapper->IsMultiItemPlaylist() )
- {
- TRAP_IGNORE( mVideoMpxWrapper->HandleCommandL( EMPXPbvCmdNextListItem ) );
- }
- else
- {
- closePlaybackView();
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::handlePluginError()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::handlePluginError( int aError )
-{
- MPX_DEBUG(
- _L("HbVideoBasePlaybackView::handlePluginError() aError = %d"), aError );
-
- switch ( aError )
- {
- case KErrCancel:
- {
- handleClosePlaybackView();
- break;
- }
- case KErrMMDRMNotAuthorized:
- case KErrCANoRights:
- case KErrCANoPermission:
- {
- showDialog( hbTrId( "txt_videos_info_license_has_expired_or_it_is_missi" ) );
- break;
- }
- case KMPXVideoCallOngoingError:
- {
- showDialog( hbTrId( "txt_videos_info_video_playback_is_not_allowed_duri" ), false );
- break;
- }
- default:
- {
- TRAP_IGNORE(
-
- //
- // TextResolver instance for error resolving.
- //
- CTextResolver* textresolver = CTextResolver::NewLC();
-
- //
- // Resolve the error text
- //
- TPtrC text;
- text.Set( textresolver->ResolveErrorString( aError ) );
-
- //
- // convert to QString
- //
- const QString qString( (QChar*)text.Ptr(), text.Length() );
-
- //
- // clean up textresolver
- //
- CleanupStack::PopAndDestroy( textresolver );
-
- //
- // display error and close playback view
- //
- showDialog( qString );
- );
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::showDialog
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::showDialog( const QString& qString, bool closeView )
-{
- MPX_DEBUG(_L("HbVideoBasePlaybackView::showDialog( %s, %d )"), qString.data(), closeView );
-
- //
- // create pop-up dialog for error notes,
- // set its position to the middle of the screen
- // and make sure pop-up dialog gets deleted on close.
- //
- QRectF screenRect = hbInstance->allMainWindows()[0]->rect();
- HbNotificationDialog* dlg = new HbNotificationDialog();
- dlg->setAttribute( Qt::WA_DeleteOnClose );
- dlg->setMinimumSize( QSizeF(200, 100) );
- dlg->setPreferredPos( QPointF( screenRect.height()/2, screenRect.width()/2 ),
- HbPopup::Center );
-
- if ( closeView )
- {
- //
- // connect aboutToClose() signal to handleClosePopupDialog() slot so that
- // when pop-up dialog is closed, playback view is closed also
- //
- connect( dlg, SIGNAL( aboutToClose() ), this, SLOT( handleClosePopupDialog() ) );
- }
-
- //
- // convert string to label so text alignment can be set
- //
- HbLabel *label = new HbLabel( qString );
- label->setAlignment( Qt::AlignCenter );
-
- //
- // set label as content widget and show pop-up dialog
- //
- dlg->setContentWidget( label );
- dlg->show();
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::doClosePlayer
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::doClosePlayer()
-{
- MPX_DEBUG(_L("HbVideoBasePlaybackView::doClosePlayer()"));
-
- handleDeactivateView();
-
- qApp->quit();
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::issuePlayCommand
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::issuePlayCommand()
-{
- MPX_ENTER_EXIT(_L("HbVideoBasePlaybackView::issuePlayCommand()"));
-
- int err = KErrNone;
-
- TRAP( err, mVideoMpxWrapper->CreateGeneralPlaybackCommandL( EPbCmdPlay ));
-
- MPX_DEBUG(_L("HbVideoBasePlaybackView::issuePlayCommand() error = %d"), err);
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::retrievePdlInformation
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::retrievePdlInformation()
-{
- MPX_DEBUG(_L("HbVideoBasePlaybackView::retrievePdlInformation()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::handleBufferingState
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::handleBufferingState()
-{
- MPX_DEBUG(_L("HbVideoBasePlaybackView::handleBufferingState()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::closePlaybackView()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::closePlaybackView()
-{
- MPX_ENTER_EXIT(_L("HbVideoBasePlaybackView::closePlaybackView()"));
-
- mTimerForClosingView->start( 0 );
-}
-
-// ---------------------------------------------------------------------------
-// HbVideoBasePlaybackView::eventFilter
-// ---------------------------------------------------------------------------
-//
-bool HbVideoBasePlaybackView::eventFilter( QObject *object, QEvent *event )
-{
- Q_UNUSED( object );
-
- switch ( event->type() )
- {
- 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 QObject::eventFilter( object, event );
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::getWindow()
-// -------------------------------------------------------------------------------------------------
-//
-RWindow *HbVideoBasePlaybackView::getWindow()
-{
- return static_cast<RWindow*>( hbInstance->allMainWindows()[0]->effectiveWinId()->DrawableWindow() );
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::handleClosePopupDialog()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::handleClosePopupDialog()
-{
- MPX_DEBUG(_L("HbVideoBasePlaybackView::handleClosePopupDialog()") );
-
- handleClosePlaybackView();
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::gestureEvent()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::gestureEvent( QGestureEvent* event )
-{
- if ( HbTapGesture * gesture = static_cast<HbTapGesture *>( event->gesture( Qt::TapGesture ) ) )
- {
- if ( gesture->state() == Qt::GestureFinished && mActivated )
- {
- MPX_DEBUG(_L("HbVideoBasePlaybackView::gestureEvent() tapGesture finished") );
-
- emit tappedOnScreen();
- }
- }
- else if ( HbPanGesture* gesture = static_cast<HbPanGesture*>( event->gesture( Qt::PanGesture ) ) )
- {
- if ( gesture->state() == Qt::GestureFinished && mActivated )
- {
- QPointF delta( gesture->sceneDelta() );
-
- if ( delta.x() > 0 )
- {
- MPX_DEBUG(_L("HbVideoBasePlaybackView::gestureEvent() right") );
-
- emit pannedToRight();
- }
- else
- {
- MPX_DEBUG(_L("HbVideoBasePlaybackView::gestureEvent() left") );
-
- emit pannedToLeft();
- }
- }
- }
-}
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/viewsrc/hbvideoplaybackview.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,203 +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 Video playback view
-*
-*/
-
-// Version : %version: da1mmcf#11 %
-
-
-
-// Include Files
-#include <hbinstance.h>
-
-#include <mmf/common/mmferrors.h>
-#include <mpxvideoplaybackdefs.h>
-
-#include "mpxvideo_debug.h"
-#include "hbvideoplaybackview.h"
-#include "mpxvideoviewwrapper.h"
-#include "mpxvideoplaybackuids.hrh"
-#include "mpxvideoplaybackviewfiledetails.h"
-#include "mpxcommonvideoplaybackview.hrh"
-
-
-// Member Functions
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoPlaybackView::HbVideoPlaybackView()
-// -------------------------------------------------------------------------------------------------
-//
-HbVideoPlaybackView::HbVideoPlaybackView()
-{
- MPX_ENTER_EXIT(_L("HbVideoPlaybackView::HbVideoPlaybackView()"));
-
- initializeVideoPlaybackView();
- mSyncClose = false;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoPlaybackView::~HbVideoPlaybackView()
-// -------------------------------------------------------------------------------------------------
-//
-HbVideoPlaybackView::~HbVideoPlaybackView()
-{
- MPX_DEBUG(_L("HbVideoPlaybackView::~HbVideoPlaybackView()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoPlaybackView::handleActivateView()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoPlaybackView::handleActivateView()
-{
- MPX_ENTER_EXIT(_L("HbVideoPlaybackView::handleActivateView()"));
-
- HbVideoBasePlaybackView::handleActivateView();
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoPlaybackView::handleDeactivateView()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoPlaybackView::handleDeactivateView()
-{
- MPX_ENTER_EXIT(_L("HbVideoPlaybackView::handleDeactivateView()"));
-
- HbVideoBasePlaybackView::handleDeactivateView();
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoPlaybackView::handleBack()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoPlaybackView::handleBack()
-{
- MPX_ENTER_EXIT(_L("HbVideoPlaybackView::handleBack()"));
-
- closePlaybackView();
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoPlaybackView::handleSoftkeyBack()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoPlaybackView::handleSoftkeyBack()
-{
- MPX_ENTER_EXIT(_L("HbVideoPlaybackView::handleSoftkeyBack()"));
-
- closePlaybackView();
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoPlaybackView::handlePluginError()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoPlaybackView::handlePluginError( int aError )
-{
- MPX_DEBUG(_L("HbVideoPlaybackView::handlePluginError() aError = %d"), aError );
-
- switch( aError )
- {
- case KErrNotSupported:
- case KErrUnknown:
- case KErrMMDecoder:
- case KErrCorrupt:
- case KErrTooBig:
- {
- showDialog( hbTrId( "txt_videos_info_invalid_clip_operation_canceled" ) );
- break;
- }
-
- case KErrMMInvalidProtocol:
- case KErrMMInvalidURL:
- case KErrArgument:
- {
- showDialog( hbTrId( "txt_videos_info_unable_to_connect_invalid_url" ) );
- break;
- }
-
- case KErrSessionClosed:
- {
- if ( ! mVideoMpxWrapper->IsLive() )
- {
- showDialog( hbTrId( "txt_videos_info_resource_lost" ) );
- }
- else
- {
- handleClosePlaybackView();
- }
- break;
- }
- case KErrTimedOut:
- {
- showDialog( hbTrId( "txt_videos_info_unable_to_connect_connection_time" ) );
- break;
- }
- case KErrNotFound:
- {
- showDialog( hbTrId( "txt_videos_info_unable_to_connect_file_not_found" ) );
- break;
- }
- case KErrMMNotEnoughBandwidth:
- {
- showDialog( hbTrId( "txt_videos_info_unable_to_connect_not_enough_band" ) );
- break;
- }
- case KErrDisconnected:
- case KErrMMProxyServer:
- case KErrCouldNotConnect:
- case KErrAbort:
- {
- showDialog( hbTrId( "txt_videos_info_unable_to_connect" ) );
- break;
- }
- case KMPXVideoPlayOver2GDuringVoiceCallError:
- {
- showDialog( hbTrId( "txt_videos_info_video_play_not_allowed_during_voic" ), false );
- break;
- }
- default:
- {
- HbVideoBasePlaybackView::handlePluginError( aError );
-
- break;
- }
- }
-}
-
-// -----------------------------------------------------------------------------
-// HbVideoPlaybackView::handlePdlStateChange
-// -----------------------------------------------------------------------------
-//
-void HbVideoPlaybackView::handlePdlStateChange( int /*aState*/ )
-{
- MPX_DEBUG(_L("HbVideoPlaybackView::handlePdlStateChange()"));
-}
-
-// -----------------------------------------------------------------------------
-// HbVideoPlaybackView::handleStoppedState
-// -----------------------------------------------------------------------------
-//
-void HbVideoPlaybackView::handleStoppedState()
-{
- MPX_DEBUG(_L("HbVideoPlaybackView::HandleStoppedState()"));
-
- if ( ! mVideoMpxWrapper->IsPlaylist() )
- {
- handleBack();
- }
-}
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/viewsrc/mpxvideocontainer.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +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: CCoeControl to provide RWindow for videoplayback
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-#include "mpxvideocontainer.h"
-#include "mpxvideo_debug.h"
-
-CMPXVideoContainer::CMPXVideoContainer()
-{
- MPX_ENTER_EXIT( _L("CMPXVideoContainer::CMPXVideoContainer()") );
-}
-
-CMPXVideoContainer::~CMPXVideoContainer()
-{
- MPX_ENTER_EXIT( _L("CMPXVideoContainer::~CMPXVideoContainer()") );
-
- CloseWindow();
-}
-
-void CMPXVideoContainer::ConstructL()
-{
- MPX_ENTER_EXIT( _L("CMPXVideoContainer::ConstructL()") );
-
- CreateWindowL();
- ActivateL();
-}
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/viewsrc/mpxvideoplaybackdisplayhandler.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,684 +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 video playback display handler
-*
-*/
-
-// Version : %version: ou1cpsw#26 %
-
-#include <sysutil.h>
-#include <s32file.h>
-#include <mpxcommand.h>
-#include <mpxcommandgeneraldefs.h>
-#include <mpxplaybackutility.h>
-#include <mpxvideoplaybackdefs.h>
-
-#include "mpxvideocontainer.h"
-#include "mpxvideoviewwrapper.h"
-#include "mpxvideoplaybackdisplayhandler.h"
-#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 )
- : iPlaybackUtility( aPlayUtil )
- , iTransitionEffectCnt( 0 )
- , iViewWrapper( aViewWrapper )
- , iScaleWidth( 100.0f )
- , iScaleHeight( 100.0f )
- , iHorizontalPosition( EHorizontalAlignCenter )
- , iVerticalPosition( EVerticalAlignCenter )
- , iRotation( EVideoRotationNone )
- , iAutoScale( EAutoScaleBestFit )
-{
-}
-
-CMPXVideoPlaybackDisplayHandler::~CMPXVideoPlaybackDisplayHandler()
-{
- MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::~CMPXVideoPlaybackDisplayHandler()"));
-
- MPX_TRAPD( error, SaveAspectRatioL() );
-
- if ( iResizingTimer )
- {
- iResizingTimer->Cancel();
- delete iResizingTimer;
- iResizingTimer = NULL;
- }
-
- iAspectRatioArray.Close();
-
- if ( iVideoDisplay )
- {
- SurfaceRemoved();
-
- delete iVideoDisplay;
- iVideoDisplay = NULL;
- }
-
- if ( iVideoContainer )
- {
- delete iVideoContainer;
- iVideoContainer = NULL;
- }
-}
-
-CMPXVideoPlaybackDisplayHandler*
-CMPXVideoPlaybackDisplayHandler::NewL( MMPXPlaybackUtility* aPlayUtil,
- CMPXVideoViewWrapper* aViewWrapper )
-{
- MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::NewL()"));
-
- CMPXVideoPlaybackDisplayHandler* self =
- new(ELeave) CMPXVideoPlaybackDisplayHandler( aPlayUtil, aViewWrapper );
-
- CleanupStack::PushL( self );
- self->ConstructL();
- CleanupStack::Pop();
- return self;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackDisplayHandler::ConstructL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::ConstructL()
-{
- iResizingTimer = CPeriodic::NewL( CActive::EPriorityStandard );
- LoadAspectRatioL();
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackDisplayHandler::CreateDisplayWindowL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::CreateDisplayWindowL(
- RWsSession& /*aWs*/,
- CWsScreenDevice& aScreenDevice,
- RWindow& aWin,
- TRect aDisplayRect )
-{
- MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::CreateDisplayWindowL()"));
-
- if ( ! iVideoContainer )
- {
- iVideoContainer = new ( ELeave ) CMPXVideoContainer();
- iVideoContainer->ConstructL();
- iVideoContainer->SetRect( aDisplayRect );
- }
-
- aWin.SetSurfaceTransparency( ETrue );
-
- RWindowBase *videoWindow = iVideoContainer->DrawableWindow();
- videoWindow->SetOrdinalPosition( -1 );
- (&aWin)->SetOrdinalPosition( 0 );
-
- MPX_DEBUG(_L("VideoWindow ordinal position is: %d"), videoWindow->OrdinalPosition());
- MPX_DEBUG(_L("UiWindow ordinal position is: %d"), (&aWin)->OrdinalPosition());
-
- AddDisplayWindowL( aScreenDevice, *videoWindow, (RWindow*)videoWindow );
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackDisplayHandler::RemoveDisplayWindow()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::RemoveDisplayWindow()
-{
- MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::RemoveDisplayWindow()"));
-
- if ( iVideoDisplay )
- {
- SurfaceRemoved();
- delete iVideoDisplay;
- iVideoDisplay = NULL;
- }
-
- if ( iVideoContainer )
- {
- delete iVideoContainer;
- iVideoContainer = NULL;
- }
-
- iSurfaceId = TSurfaceId::CreateNullId();
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackDisplayHandler::HandleVideoDisplayMessageL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::HandleVideoDisplayMessageL( CMPXMessage* aMessage )
-{
- MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::HandleVideoDisplayMessage()"));
-
- TMPXVideoDisplayCommand message =
- ( *(aMessage->Value<TMPXVideoDisplayCommand>(KMPXMediaVideoDisplayCommand)) );
-
- MPX_DEBUG(
- _L("CMPXVideoPlaybackDisplayHandler::HandleVideoDisplayMessageL() message = %d"), message );
-
- switch ( message )
- {
- case EPbMsgVideoSurfaceCreated:
- {
- SurfaceCreatedL( aMessage );
- break;
- }
- case EPbMsgVideoSurfaceChanged:
- {
- SurfaceChangedL( aMessage );
- break;
- }
- case EPbMsgVideoSurfaceRemoved:
- {
- SurfaceRemoved();
- break;
- }
- }
-}
-
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackDisplayHandler::SetAspectRatioL()
-// -------------------------------------------------------------------------------------------------
-//
-TInt CMPXVideoPlaybackDisplayHandler::SetAspectRatioL( TMPXVideoPlaybackCommand aCmd )
-{
- MPX_DEBUG(_L("CMPXVideoPlaybackDisplayHandler::SetAspectRatioL()"));
-
- TInt aspectRatio;
-
- aspectRatio = SetNgaAspectRatioL( aCmd );
-
- //
- // Update the aspect ratio in the array
- //
- TInt count = iAspectRatioArray.Count();
-
- if ( count > 0 && count > iCurrentIndexForAspectRatio )
- {
- iAspectRatioArray[iCurrentIndexForAspectRatio].scalingType = (TMMFScalingType)aspectRatio;
- }
-
- return aspectRatio;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackDisplayHandler::SetDefaultAspectRatioL
-// -------------------------------------------------------------------------------------------------
-//
-TInt CMPXVideoPlaybackDisplayHandler::SetDefaultAspectRatioL(
- QMPXVideoPlaybackViewFileDetails* aFileDetails, TReal32 aDisplayAspectRatio )
-{
- MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::SetDefaultAspectRatioL()"));
-
- TInt newAspectRatio = EMMFNatural;
-
- if ( aFileDetails->mVideoHeight > 0 && aFileDetails->mVideoWidth > 0 )
- {
- TMMFScalingType scalingType = EMMFNatural;
-
- TReal32 videoAspectRatio = (TReal32)aFileDetails->mVideoWidth /
- (TReal32)aFileDetails->mVideoHeight;
-
- TInt cnt = iAspectRatioArray.Count();
- TInt i = 0;
-
- //
- // check whether dat file has the information about (videoRatio + screenRatio)
- //
- for ( ; i < cnt ; i++ )
- {
- if ( iAspectRatioArray[i].videoRatio == videoAspectRatio &&
- iAspectRatioArray[i].screenRatio == aDisplayAspectRatio &&
- ( scalingType = iAspectRatioArray[i].scalingType ) > 0 )
- {
- break;
- }
- }
-
- //
- // if can't find out match aspect ratio in dat file,
- // choose the scaling type through the rule
- // aspectRatioDiff = videoAspectRatio - aDisplayAspectRatio
- // aspectRatioDiff == 0 ==> natural
- // aspectRatioDiff > 0.1 ==> zoom
- // aspectRatioDiff < - 0.3 ==> natural
- // aspectRatioDiff >= - 0.3 and <= 0.1 ==> stretch
- //
-
- if ( i == cnt )
- {
- if ( videoAspectRatio - aDisplayAspectRatio > 0.1 )
- {
- scalingType = EMMFZoom;
- }
- else if ( ( videoAspectRatio != aDisplayAspectRatio ) &&
- ( videoAspectRatio - aDisplayAspectRatio > (- 0.3) ) )
- {
- scalingType = EMMFStretch;
- }
-
- TMPXAspectRatio ratio;
-
- ratio.videoRatio = videoAspectRatio;
- ratio.screenRatio = aDisplayAspectRatio;
- ratio.scalingType = scalingType;
-
- iAspectRatioArray.Append( ratio );
- }
-
- iCurrentIndexForAspectRatio = i;
-
- TMPXVideoPlaybackCommand aspectRatioCmd = EPbCmdNaturalAspectRatio;
-
- if ( scalingType == EMMFZoom )
- {
- aspectRatioCmd = EPbCmdZoomAspectRatio;
- }
- else if ( scalingType == EMMFStretch )
- {
- aspectRatioCmd = EPbCmdStretchAspectRatio;
- }
-
- newAspectRatio = SetAspectRatioL( aspectRatioCmd );
- }
-
- return newAspectRatio;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackDisplayHandler::SaveAspectRatioL
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::SaveAspectRatioL()
-{
- MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::SaveAspectRatioL"));
-
- RFs fs;
- TInt err = fs.Connect();
- CleanupClosePushL<RFs>( fs );
-
- TBool canSave = EFalse;
-
- TRAP_IGNORE( canSave = ! SysUtil::FFSSpaceBelowCriticalLevelL(
- &fs, sizeof(TMPXAspectRatio) * iAspectRatioArray.Count()) );
-
- if ( canSave )
- {
- // save list to disk
- RFileWriteStream out;
-
- TInt err( out.Replace( fs, KAspectRatioFile, EFileWrite ) );
-
- if ( err == KErrPathNotFound )
- {
- fs.MkDirAll( KAspectRatioFile );
- err = out.Create( fs, KAspectRatioFile, EFileWrite );
- }
-
- if ( ! err )
- {
- TInt cnt = iAspectRatioArray.Count();
-
- MPX_TRAP( err,
- {
- for ( TInt i = 0 ; i < cnt ; i++ )
- {
- //Save (videoRatio + screenRatio + scalingType)
- out.WriteReal32L( iAspectRatioArray[i].videoRatio );
- out.WriteReal32L( iAspectRatioArray[i].screenRatio );
- out.WriteInt8L( iAspectRatioArray[i].scalingType );
- }
- } );
-
- out.Close();
- }
- }
-
- CleanupStack::PopAndDestroy();
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackDisplayHandler::LoadAspectRatioL
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::LoadAspectRatioL()
-{
- MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::LoadAspectRatioL()"));
-
- RFs fs;
- RFileReadStream in;
-
- TInt err = fs.Connect();
- CleanupClosePushL<RFs>( fs );
-
- if ( ! err && in.Open( fs, KAspectRatioFile, EFileRead ) == KErrNone )
- {
- TMPXAspectRatio ratio;
-
- MPX_TRAP( err,
- {
- for ( err = KErrNone ; err == KErrNone ; )
- {
- //
- // Read (videoRatio + screenRatio + scalingType)
- //
- ratio.videoRatio = in.ReadReal32L();
- ratio.screenRatio = in.ReadReal32L();
- ratio.scalingType = (TMMFScalingType)in.ReadInt8L();
-
- iAspectRatioArray.Append( ratio );
- }
- } );
-
- in.Close();
- }
-
- CleanupStack::PopAndDestroy();
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackDisplayHandler::UpdateVideoRectL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::UpdateVideoRectL( TRect aClipRect, TBool transitionEffect )
-{
- MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::UpdateVideoRectL()"));
-
- if ( transitionEffect )
- {
- iTlXDiff = (TReal32)( iWindowRect.iTl.iX - aClipRect.iTl.iX ) / KTRANSITIONEFFECTCNT;
- iTlYDiff = (TReal32)( iWindowRect.iTl.iY - aClipRect.iTl.iY ) / KTRANSITIONEFFECTCNT;
- iBrXDiff = (TReal32)( iWindowRect.iBr.iX - aClipRect.iBr.iX ) / KTRANSITIONEFFECTCNT;
- iBrYDiff = (TReal32)( iWindowRect.iBr.iY - aClipRect.iBr.iY ) / KTRANSITIONEFFECTCNT;
-
- if ( iResizingTimer->IsActive() )
- {
- iResizingTimer->Cancel();
- }
-
- iResizingTimer->Start(
- 0,
- KVIDEORESIZINGREPEATRATE,
- TCallBack( CMPXVideoPlaybackDisplayHandler::UpdateVideoRectTimeOutL, this ) );
- }
- else
- {
- SetVideoRectL( aClipRect );
-
- iWindowRect = aClipRect;
-
- iViewWrapper->UpdateVideoRectDone();
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackDisplayHandler::UpdateVideoRectTimeOutL()
-// -------------------------------------------------------------------------------------------------
-//
-TInt CMPXVideoPlaybackDisplayHandler::UpdateVideoRectTimeOutL( TAny* aPtr )
-{
- MPX_DEBUG(_L("CMPXVideoPlaybackDisplayHandler::UpdateVideoRectTimeOutL()"));
-
- static_cast<CMPXVideoPlaybackDisplayHandler*>(aPtr)->CalculateVideoRectL();
-
- return KErrNone;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackDisplayHandler::CalculateVideoRectL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::CalculateVideoRectL()
-{
- iTransitionEffectCnt++;
-
- TRect windowRect( (TInt)( (TReal32)iWindowRect.iTl.iX - iTlXDiff * (TReal32)iTransitionEffectCnt ),
- (TInt)( (TReal32)iWindowRect.iTl.iY - iTlYDiff * (TReal32)iTransitionEffectCnt ),
- (TInt)( (TReal32)iWindowRect.iBr.iX - iBrXDiff * (TReal32)iTransitionEffectCnt ),
- (TInt)( (TReal32)iWindowRect.iBr.iY - iBrYDiff * (TReal32)iTransitionEffectCnt ) );
-
- MPX_DEBUG(_L("CMPXVideoPlaybackDisplayHandler::CalculateVideoRectL() %d %d %d %d"),
- windowRect.iTl.iX, windowRect.iTl.iY, windowRect.iBr.iX, windowRect.iBr.iY );
-
- SetVideoRectL( windowRect );
-
- if ( iTransitionEffectCnt >= KTRANSITIONEFFECTCNT )
- {
- iTransitionEffectCnt = 0;
- iWindowRect = windowRect;
-
- if ( iResizingTimer->IsActive() )
- {
- iResizingTimer->Cancel();
- }
-
- MPX_DEBUG(_L("CMPXVideoPlaybackDisplayHandler::CalculateVideoRectL() Done"));
-
- iViewWrapper->UpdateVideoRectDone();
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackDisplayHandler::SetVideoRectL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::SetVideoRectL( TRect aRect )
-{
- MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::SetVideoRectL()"));
-
- if ( iVideoDisplay )
- {
- iVideoDisplay->SetVideoExtentL( *iWindowBase, aRect, TRect( iWindowBase->Size() ) );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackDisplayHandler::AddDisplayWindowL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::AddDisplayWindowL( CWsScreenDevice& aScreenDevice,
- RWindowBase& aWindowBase,
- RWindow* aWin )
-{
- MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::AddDisplayWindowL()"));
-
- iWindowBase = &aWindowBase;
-
- TInt displayId = aScreenDevice.GetScreenNumber();
-
- MPX_DEBUG(_L("CMPXVideoPlaybackDisplayHandler::AddDisplayWindowL() displayId %d"), displayId);
-
- CMediaClientVideoDisplay* tempDisplay = iVideoDisplay;
-
- iVideoDisplay = CMediaClientVideoDisplay::NewL( displayId );
-
- delete tempDisplay;
-
- TRect cropRect = TRect( aWin->Size() );
-
- //
- // If RWindow is still in potrait, rotate surface to play a video in landscape
- //
- if ( cropRect.Width() < cropRect.Height() )
- {
- iRotation = EVideoRotationClockwise90;
- }
-
- iWindowRect = cropRect;
-
- MPX_DEBUG(_L("CMPXVideoPlaybackDisplayHandler::AddDisplayWindowL() cropRect (%d, %d), (%d, %d)"),
- cropRect.iTl.iX, cropRect.iTl.iY, cropRect.iBr.iX, cropRect.iBr.iY);
-
- MPX_TRAPD( dispError,
- iVideoDisplay->AddDisplayWindowL( iWindowBase,
- cropRect,
- cropRect,
- cropRect,
- iScaleWidth,
- iScaleHeight,
- iRotation,
- iAutoScale,
- iHorizontalPosition,
- iVerticalPosition,
- aWin );
- );
-
- MPX_DEBUG(_L("CMPXVideoPlaybackDisplayHandler::AddDisplayWindowL() Display Added"));
- //
- // Check if surface was created before window was ready
- //
- if ( iSurfaceCached )
- {
- iVideoDisplay->SurfaceCreated( iSurfaceId, iCropRect, iAspectRatio, iCropRect );
-
- iSurfaceCached = EFalse;
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackDisplayHandler::SurfaceCreatedL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::SurfaceCreatedL( CMPXMessage* aMessage )
-{
- MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::SurfaceCreatedL()"));
-
- TSurfaceId oldSurfaceId = iSurfaceId;
-
- //
- // Extract the surface parameters from the message
- //
- iSurfaceId = aMessage->ValueTObjectL<TSurfaceId>( KMPXMediaVideoDisplayTSurfaceId );
- iCropRect = aMessage->ValueTObjectL<TRect>( KMPXMediaVideoDisplayCropRect );
- iAspectRatio = aMessage->ValueTObjectL<TVideoAspectRatio>( KMPXMediaVideoDisplayAspectRatio );
-
- if ( iVideoDisplay )
- {
- //
- // Remove old surface if one exists
- //
- if ( ! oldSurfaceId.IsNull() )
- {
- iVideoDisplay->RemoveSurface();
- }
-
- //
- // Add new surface
- //
- iVideoDisplay->SurfaceCreated( iSurfaceId, iCropRect, iAspectRatio, iCropRect );
- }
- else
- {
- //
- // Video display has not been created yet, save surface information to create
- // the surface when the display is created
- //
- iSurfaceCached = ETrue;
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackDisplayHandler::SurfaceChangedL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::SurfaceChangedL( CMPXMessage* aMessage )
-{
- MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::SurfaceChangedL()"));
-
- //
- // Extract the surface parameters from the message
- //
- iSurfaceId = aMessage->ValueTObjectL<TSurfaceId>( KMPXMediaVideoDisplayTSurfaceId );
- iCropRect = aMessage->ValueTObjectL<TRect>( KMPXMediaVideoDisplayCropRect );
- iAspectRatio = aMessage->ValueTObjectL<TVideoAspectRatio>( KMPXMediaVideoDisplayAspectRatio );
-
- if ( iVideoDisplay )
- {
- //
- // Add new surface
- //
- iVideoDisplay->SurfaceParametersChanged( iSurfaceId, iCropRect, iAspectRatio );
-
- iVideoDisplay->RedrawWindows( iCropRect );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackDisplayHandler::SurfaceRemoved()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::SurfaceRemoved()
-{
- MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::SurfaceRemoved()"));
-
- if ( iVideoDisplay )
- {
- iVideoDisplay->RemoveSurface();
- }
-
- iSurfaceId = TSurfaceId::CreateNullId();
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackDisplayHandler::SetNgaAspectRatioL()
-// -------------------------------------------------------------------------------------------------
-//
-TInt CMPXVideoPlaybackDisplayHandler::SetNgaAspectRatioL( TMPXVideoPlaybackCommand aCmd )
-{
- MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::SetNgaAspectRatioL()"));
-
- TInt aspectRatio = EMMFNatural;
-
- switch ( aCmd )
- {
- case EPbCmdNaturalAspectRatio:
- {
- iAutoScale = EAutoScaleBestFit;
- aspectRatio = EMMFNatural;
- break;
- }
- case EPbCmdZoomAspectRatio:
- {
- iAutoScale = EAutoScaleClip;
- aspectRatio = EMMFZoom;
- break;
- }
- case EPbCmdStretchAspectRatio:
- {
- iAutoScale = EAutoScaleStretch;
- aspectRatio = EMMFStretch;
- break;
- }
- }
-
- if ( iVideoDisplay && ! iSurfaceId.IsNull() )
- {
- iVideoDisplay->SetAutoScaleL( iAutoScale,
- iHorizontalPosition,
- iVerticalPosition,
- iCropRect );
- }
-
- return aspectRatio;
-}
-
-// End of File
--- a/videoplayback/hbvideoplaybackview/viewsrc/mpxvideoplaybackuserinputhandler.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,618 +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 playback view's input handler
-*
-*/
-
-// Version : %version: 7 %
-
-
-// INCLUDE FILES
-#include <e32std.h>
-#include <w32std.h> // RWindowBase
-#include <e32base.h>
-#include <eikclbd.h>
-#include <aknconsts.h>
-#include <remconcoreapi.h>
-#include <remconcoreapitarget.h>
-#include <remconinterfaceselector.h> // Side volume key
-#include <mpxplaybackframeworkdefs.h>
-#include <centralrepository.h> // for peripheral display timeout setting
-#include <settingsinternalcrkeys.h> // display timeout setting keys
-#include <hwrmlightdomaincrkeys.h>
-#include <mpxvideoplaybackdefs.h>
-
-#include <hal.h>
-#include <hal_data.h>
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoviewwrapper.h"
-#include "mpxcommonvideoplaybackview.hrh"
-#include "mpxvideoplaybackuserinputhandler.h"
-
-
-// CONSTANTS
-const TInt KMPXMicroSecondsInASecond = 1000000;
-
-
-// ======== MEMBER FUNCTIONS =======================================================================
-
-// -------------------------------------------------------------------------------------------------
-// MPXVideoPlaybackUserInputHandler::CMPXVideoPlaybackUserInputHandler()
-// -------------------------------------------------------------------------------------------------
-//
-CMPXVideoPlaybackUserInputHandler::CMPXVideoPlaybackUserInputHandler( CMPXVideoViewWrapper* aWrapper )
- : iViewWrapper( aWrapper )
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::NewL()
-// -------------------------------------------------------------------------------------------------
-//
-CMPXVideoPlaybackUserInputHandler* CMPXVideoPlaybackUserInputHandler::NewL(
- CMPXVideoViewWrapper* aWrapper, TBool aTvOutConnected )
-{
- MPX_DEBUG(_L("CMPXVideoPlaybackUserInputHandler::NewL()"));
-
- CMPXVideoPlaybackUserInputHandler* self =
- new (ELeave) CMPXVideoPlaybackUserInputHandler( aWrapper );
- CleanupStack::PushL( self );
- self->ConstructL( aTvOutConnected );
- CleanupStack::Pop();
- return self;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::ConstructL
-// Symbian 2nd phase constructor can leave.
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackUserInputHandler::ConstructL( TBool aTvOutConnected )
-{
- MPX_ENTER_EXIT(_L("CMPXVideoPlaybackUserInputHandler::ConstructL()"));
-
- iVolumeRepeatTimer = CPeriodic::NewL( CActive::EPriorityStandard );
- iDisplayTimer = CPeriodic::NewL( CPeriodic::EPriorityStandard );
- iInterfaceSelector = CRemConInterfaceSelector::NewL();
- iCoreTarget = CRemConCoreApiTarget::NewL( *iInterfaceSelector, *this );
-
- iTVOutConnected = aTvOutConnected;
-
- // Start the timer if TV out is connected
- if ( iTVOutConnected )
- {
- // Get the display light time-out value from CenRep
- CRepository* repository = CRepository::NewLC( KCRUidLightSettings );
-
- // What's the timeout value (in seconds ) for the display light?
- repository->Get( KDisplayLightsTimeout, iDisplayTimeOut );
- MPX_DEBUG(_L("CMPXVideoPlaybackUserInputHandler::ConstructL Display Timeout( %d )"), iDisplayTimeOut);
-
- CleanupStack::PopAndDestroy( repository );
-
- // Convert the timeout value to microseconds
- iDisplayTimeOut *= KMPXMicroSecondsInASecond;
-
- RestartDisplayTimer();
- }
-
- // not detrimental if Media Keys dont work - so ignore any errors here
- TRAP_IGNORE( iInterfaceSelector->OpenTargetL() );
-
- iProcessingInputType = EMpxVideoNone;
- iForeground = ETrue;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::~CMPXVideoPlaybackUserInputHandler()
-// -------------------------------------------------------------------------------------------------
-//
-CMPXVideoPlaybackUserInputHandler::~CMPXVideoPlaybackUserInputHandler()
-{
- if ( iVolumeRepeatTimer )
- {
- iVolumeRepeatTimer->Cancel();
- delete iVolumeRepeatTimer;
- }
-
- if ( iDisplayTimer )
- {
- iDisplayTimer->Cancel();
- delete iDisplayTimer;
- }
-
- if ( iInterfaceSelector )
- {
- delete iInterfaceSelector;
- iCoreTarget = NULL;
- iInterfaceSelector = NULL;
- }
-
- // make sure that backlight enabled when
- // the view updates or deactivates
- EnableBacklight();
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::MrccatoPlay()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackUserInputHandler::MrccatoPlay( TRemConCoreApiPlaybackSpeed /*aSpeed*/,
- TRemConCoreApiButtonAction aButtonAct )
-{
- MPX_ENTER_EXIT(
- _L("CMPXVideoPlaybackUserInputHandler::MrccatoPlay"),
- _L("aButtonAct = %d"), aButtonAct );
-
- ProcessMediaKey(ERemConCoreApiPlay, aButtonAct);
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::MrccatoCommand()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackUserInputHandler::MrccatoCommand(TRemConCoreApiOperationId aOperationId,
- TRemConCoreApiButtonAction aButtonAct )
-{
- MPX_ENTER_EXIT(
- _L("CMPXVideoPlaybackUserInputHandler::MrccatoCommand"),
- _L("aButtonAct = %d"), aButtonAct );
-
- ProcessMediaKey(aOperationId, aButtonAct);
-}
-
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::DoHandleMediaKey()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackUserInputHandler::DoHandleMediaKey( TRemConCoreApiOperationId aOperationId,
- TRemConCoreApiButtonAction aButtonAct )
-{
- MPX_ENTER_EXIT(_L("CMPXVideoPlaybackUserInputHandler::DoHandleMediaKey()"));
-
- switch ( aOperationId )
- {
- case ERemConCoreApiStop:
- {
- if ( aButtonAct == ERemConCoreApiButtonClick )
- {
- TRAP_IGNORE(iViewWrapper->HandleCommandL( EMPXPbvCmdStop ));
- }
- break;
- }
- case ERemConCoreApiRewind:
- {
- HandleRewind(aButtonAct);
- break;
- }
- case ERemConCoreApiFastForward:
- {
- HandleFastForward(aButtonAct);
- break;
- }
- case ERemConCoreApiVolumeUp:
- {
- HandleVolumeUp(aButtonAct);
- break;
- }
- case ERemConCoreApiVolumeDown:
- {
- HandleVolumeDown(aButtonAct);
- break;
- }
- case ERemConCoreApiPausePlayFunction:
- {
- if ( aButtonAct == ERemConCoreApiButtonClick )
- {
- TRAP_IGNORE(iViewWrapper->HandleCommandL(EMPXPbvCmdPlayPause));
- }
- break;
- }
- case ERemConCoreApiPause:
- {
- TRAP_IGNORE(iViewWrapper->HandleCommandL(EMPXPbvCmdPause));
- break;
- }
- case ERemConCoreApiPlay:
- {
- if ( aButtonAct == ERemConCoreApiButtonClick )
- {
- TRAP_IGNORE(iViewWrapper->HandleCommandL(EMPXPbvCmdPlay));
- }
- break;
- }
- default:
- break;
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::HandleFastForward()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackUserInputHandler::HandleFastForward(TRemConCoreApiButtonAction aButtonAct)
-{
- if (aButtonAct == ERemConCoreApiButtonPress)
- {
- TRAP_IGNORE(iViewWrapper->HandleCommandL(EMPXPbvCmdSeekForward));
- }
- else if (aButtonAct == ERemConCoreApiButtonRelease)
- {
- TRAP_IGNORE(iViewWrapper->HandleCommandL(EMPXPbvCmdEndSeek));
- }
-}
-
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::HandleRewind()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackUserInputHandler::HandleRewind(TRemConCoreApiButtonAction aButtonAct)
-{
- if (aButtonAct == ERemConCoreApiButtonPress)
- {
- TRAP_IGNORE(iViewWrapper->HandleCommandL(EMPXPbvCmdSeekBackward));
- }
- else if (aButtonAct == ERemConCoreApiButtonRelease)
- {
- TRAP_IGNORE(iViewWrapper->HandleCommandL(EMPXPbvCmdEndSeek));
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::HandleVolumeUp()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackUserInputHandler::HandleVolumeUp(TRemConCoreApiButtonAction aButtonAct)
-{
- switch ( aButtonAct )
- {
- case ERemConCoreApiButtonPress:
- {
- // Volume Up - Pressed
- if ( iVolumeRepeatTimer->IsActive() )
- {
- iVolumeRepeatTimer->Cancel();
- }
-
- iVolumeRepeatUp = ETrue;
- iVolumeRepeatTimer->Start(
- KAknStandardKeyboardRepeatRate,
- KAknStandardKeyboardRepeatRate,
- TCallBack(
- CMPXVideoPlaybackUserInputHandler::HandleVolumeRepeatTimeoutL,
- this ) );
-
- break;
- }
- case ERemConCoreApiButtonRelease:
- {
- // Volume Up - Released
- iVolumeRepeatTimer->Cancel();
- break;
- }
- case ERemConCoreApiButtonClick:
- {
- // Volume Up - Clicked
- TRAP_IGNORE( iViewWrapper->HandleCommandL( EMPXPbvCmdIncreaseVolume ) );
- break;
- }
- }
-}
-
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::HandleVolumeDown()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackUserInputHandler::HandleVolumeDown(TRemConCoreApiButtonAction aButtonAct)
-{
- switch ( aButtonAct )
- {
- case ERemConCoreApiButtonPress:
- {
- // Volume Up - Pressed
- if ( iVolumeRepeatTimer->IsActive() )
- {
- iVolumeRepeatTimer->Cancel();
- }
-
- iVolumeRepeatUp = EFalse;
- iVolumeRepeatTimer->Start(
- KAknStandardKeyboardRepeatRate,
- KAknStandardKeyboardRepeatRate,
- TCallBack(
- CMPXVideoPlaybackUserInputHandler::HandleVolumeRepeatTimeoutL,
- this ) );
-
- break;
- }
- case ERemConCoreApiButtonRelease:
- {
- // Volume Up - Released
- iVolumeRepeatTimer->Cancel();
- break;
- }
- case ERemConCoreApiButtonClick:
- {
- // Volume Down - Clicked
- TRAP_IGNORE( iViewWrapper->HandleCommandL( EMPXPbvCmdDecreaseVolume ) );
- break;
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::ProcessKeyEvent()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackUserInputHandler::ProcessKeyEventL( const TKeyEvent& /*aKeyEvent*/,
- TEventCode /*aType*/ )
-{
- MPX_DEBUG(_L("MPXVideoPlaybackUserInputHandler::ProcessKeyEvent"));
-
- /*
- switch (iProcessingInputType)
- {
- case EMpxVideoNone:
- {
- if (aType == EEventKeyDown && iForeground)
- {
- iProcessingInputType = EMpxVideoKeyboard;
- iLastPressedKeyCode = aKeyEvent.iCode;
- iLastPressedKeyScanCode = aKeyEvent.iScanCode;
- if ( iTVOutConnected )
- {
- RestartDisplayTimer();
- }
- iViewWrapper->DoHandleKeyEventL( aKeyEvent, aType );
- }
- break;
- }
- case EMpxVideoKeyboard:
- {
- if (aType == EEventKeyUp)
- {
- // only handle up event for the key being handled
- // ignore spurious key presses
- if (aKeyEvent.iCode == iLastPressedKeyCode &&
- aKeyEvent.iScanCode == iLastPressedKeyScanCode)
- {
- iViewWrapper->DoHandleKeyEventL( aKeyEvent, aType );
-
- // reset the value only on key up event
- iProcessingInputType = EMpxVideoNone;
- }
- }
- break;
- }
- default:
- {
- // user input is disallowed
- break;
- }
- } // switch*/
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::ProcessMediaKey()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackUserInputHandler::ProcessMediaKey(TRemConCoreApiOperationId aOperationId,
- TRemConCoreApiButtonAction aButtonAct)
-{
- MPX_DEBUG(_L("CMPXVideoPlaybackUserInputHandler::ProcessMediaKey"));
-
- switch (iProcessingInputType)
- {
- case EMpxVideoNone:
- {
- if (aButtonAct == ERemConCoreApiButtonPress && iForeground)
- {
- iProcessingInputType = EMpxVideoMediaKeys;
- iLastMediaKeyPressed = aOperationId;
- DoHandleMediaKey(aOperationId, aButtonAct);
- if ( iTVOutConnected )
- {
- RestartDisplayTimer();
- }
- }
- else if (aButtonAct == ERemConCoreApiButtonClick && iForeground)
- {
- DoHandleMediaKey(aOperationId, aButtonAct);
- if ( iTVOutConnected )
- {
- RestartDisplayTimer();
- }
- // reset on click AND/OR release
- iProcessingInputType = EMpxVideoNone;
- }
- break;
- }
- case EMpxVideoMediaKeys:
- {
- if (aButtonAct == ERemConCoreApiButtonRelease)
- {
- // handle only if this release is for media-key being currently handled
- // ignore spurious media key presses
- if (iLastMediaKeyPressed == aOperationId)
- {
- DoHandleMediaKey(aOperationId, aButtonAct);
- // reset on click AND/OR release
- iProcessingInputType = EMpxVideoNone;
- }
- }
- break;
- }
- default:
- {
- // user input is disallowed
- break;
- }
- } // switch
-}
-
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::HandleVolumeRepeatTimeoutL()
-// -------------------------------------------------------------------------------------------------
-//
-TInt CMPXVideoPlaybackUserInputHandler::HandleVolumeRepeatTimeoutL( TAny* aPtr )
-{
- MPX_DEBUG(_L("CMPXVideoPlaybackUserInputHandler::HandleVolumeRepeatTimeoutL()"));
-
- static_cast<CMPXVideoPlaybackUserInputHandler*>(aPtr)->HandleVolumeRepeatL();
-
- return KErrNone;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::HandleVolumeRepeatL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackUserInputHandler::HandleVolumeRepeatL()
-{
- MPX_DEBUG(_L("CMPXVideoPlaybackUserInputHandler::HandleVolumeRepeatL()"));
-
- TMPXVideoPlaybackViewCommandIds command = EMPXPbvCmdDecreaseVolume;
-
- if ( iVolumeRepeatUp )
- {
- command = EMPXPbvCmdIncreaseVolume;
- }
-
- iViewWrapper->HandleCommandL( command );
-}
-
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::SetForeground()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackUserInputHandler::SetForeground(TBool aForeground)
-{
- iForeground = aForeground;
-
- if ( !iForeground )
- {
- // we are in background so reset iProcessingInputType value
- iProcessingInputType = EMpxVideoNone;
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::DisableBacklight()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackUserInputHandler::DisableBacklight()
-{
- MPX_ENTER_EXIT(_L("CMPXVideoPlaybackUserInputHandler::DisableBacklight"));
-
- // cancel the timer
- iDisplayTimer->Cancel();
-
- // disable the backlight
- HAL::Set( HALData::EBacklightState, 0 );
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::EnableBacklight()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackUserInputHandler::EnableBacklight()
-{
- MPX_ENTER_EXIT(_L("CMPXVideoPlaybackUserInputHandler::EnableBacklight"));
-
- // enable the backlight
- HAL::Set( HALData::EBacklightState, 1 );
-}
-
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::HandleTVOutEvent()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackUserInputHandler::HandleTVOutEventL(TBool aTVOutConnected)
-{
- MPX_ENTER_EXIT(_L("CMPXVideoPlaybackUserInputHandler::HandleTVOutEvent"));
-
- iTVOutConnected = aTVOutConnected;
-
- if ( iTVOutConnected )
- {
- // Get the display light time-out value from CenRep
- CRepository* repository = CRepository::NewLC( KCRUidLightSettings );
-
- // What's the timeout value (in seconds ) for the display light?
- repository->Get( KDisplayLightsTimeout, iDisplayTimeOut );
- MPX_DEBUG(_L("CMPXVideoPlaybackUserInputHandler::ConstructL Display Timeout( %d )"), iDisplayTimeOut);
-
- CleanupStack::PopAndDestroy( repository );
-
- // Convert the timeout value to microseconds
- iDisplayTimeOut *= KMPXMicroSecondsInASecond;
-
- RestartDisplayTimer();
- }
- else
- {
- iDisplayTimer->Cancel();
- EnableBacklight();
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::HandleDisplayTimeout
-// -------------------------------------------------------------------------------------------------
-//
-TInt CMPXVideoPlaybackUserInputHandler::HandleDisplayTimeout( TAny* aPtr )
-{
- MPX_ENTER_EXIT(_L("CMPXVideoPlaybackUserInputHandler::HandleDisplayTimeout"));
-
- static_cast<CMPXVideoPlaybackUserInputHandler*>(aPtr)->DisableBacklight();
-
- return KErrNone;
-}
-
-// -----------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::RestartDisplayTimer
-// -----------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackUserInputHandler::RestartDisplayTimer()
-{
- MPX_ENTER_EXIT(_L("CMPXVideoPlaybackUserInputHandler::RestartDisplayTimer"));
-
- // check if the display timer is running if so cancelit
- if ( iDisplayTimer->IsActive() )
- {
- iDisplayTimer->Cancel();
- }
- else
- {
- // timeout has happened and the backlight is disabled
- // enable the backlight
- HAL::Set( HALData::EBacklightState, 1 );
- }
-
- TBool backlightState;
- TInt ret = HAL::Get( HALData::EBacklightState, backlightState );
-
- // Re start the display backlight timer
- iDisplayTimer->Start( iDisplayTimeOut, iDisplayTimeOut,
- TCallBack( CMPXVideoPlaybackUserInputHandler::HandleDisplayTimeout, this ) );
-}
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/viewsrc/mpxvideoplaybackviewfiledetails.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +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: class for MPX Video File Details (Qt)
-*
-*/
-
-// Version : %version: da1mmcf#10 %
-
-
-
-//
-// INCLUDE FILES
-//
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackviewfiledetails.h"
-
-
-// ============================ MEMBER FUNCTIONS ===================================================
-
-QMPXVideoPlaybackViewFileDetails::QMPXVideoPlaybackViewFileDetails()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::QMPXVideoPlaybackViewFileDetails()"));
-
- clearFileDetails();
-}
-
-QMPXVideoPlaybackViewFileDetails::~QMPXVideoPlaybackViewFileDetails()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::~QMPXVideoPlaybackViewFileDetails()"));
-
- clearFileDetails();
-}
-
-void
-QMPXVideoPlaybackViewFileDetails::clearFileDetails()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::ClearFileDetails()"));
-
- mMimeType = tr("");
- mTitle = tr("");
- mArtist = tr("");
- mClipName = tr("");
- mDescription = tr("");
- mLocation = tr("");
- mCopyright = tr("");
- mLanguage = tr("");
- mKeywords = tr("");
-
- mPlaybackMode = EMPXVideoLocal;
- mSeekable = false;
- mPausableStream = false;
- mAudioEnabled = false;
- mVideoEnabled = false;
- mPartialPlayback = false;
- mRNFormat = false;
-
- mDuration = 0;
- mTvOutConnected = false;
- mDrmProtected = false;
-
- mVideoHeight = 0;
- mVideoWidth = 0;
- mBitRate = 0;
-}
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/viewsrc/mpxvideoviewwrapper.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1528 +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 Video base playback view
-*
-*/
-
-// Version : %version: da1mmcf#37 %
-
-
-
-// Include Files
-
-#include <w32std.h>
-#include <eikenv.h>
-
-#include <mpxplaybackcommanddefs.h>
-#include <mpxvideoplaybackdefs.h>
-#include <mpxcommandgeneraldefs.h>
-#include <mpxcommand.h>
-#include <mpxmessagegeneraldefs.h>
-#include <mpxplaybackmessage.h>
-#include <mpxmediageneraldefs.h>
-#include <mpxmediavideodefs.h>
-#include <mpxplaybackutility.h>
-#include <mmf/common/mmferrors.h>
-#include <mpxcollectionutility.h>
-#include <mpxcollectionplaylist.h>
-#include <mpxmediageneralextdefs.h>
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoregion.h"
-#include "mpxvideoviewwrapper.h"
-#include "mpxvideoplaybackuids.hrh"
-#include "mpxhbvideocommondefs.h"
-#include "hbvideobaseplaybackview.h"
-#include "mpxvideoplaybackcontrol.hrh"
-#include "mpxvideoplaybackviewfiledetails.h"
-#include "mpxvideoplaybackdisplayhandler.h"
-#include "mpxcommonvideoplaybackview.hrh"
-#include "mpxvideoplaybackcontrolscontroller.h"
-#include "mpxvideoplaybackuserinputhandler.h"
-
-// Member Functions
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::CMPXVideoViewWrapper()
-// -------------------------------------------------------------------------------------------------
-//
-CMPXVideoViewWrapper::CMPXVideoViewWrapper( HbVideoBasePlaybackView* aView )
- : iView( aView )
- , iControlsController( NULL )
- , iMediaRequestStatus( MediaNotRequested )
- , iPlaylistView( false )
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::NewL()
-// -------------------------------------------------------------------------------------------------
-//
-CMPXVideoViewWrapper* CMPXVideoViewWrapper::NewL( HbVideoBasePlaybackView* aView )
-{
- MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::NewL()"));
-
- CMPXVideoViewWrapper* self = new (ELeave) CMPXVideoViewWrapper( aView );
-
- CleanupStack::PushL( self );
- self->ConstructL();
- CleanupStack::Pop();
-
- return self;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::ConstructL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::ConstructL()
-{
- MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::ConstructL()"));
-
- iPlaybackUtility =
- MMPXPlaybackUtility::UtilityL( EMPXCategoryVideo, KPbModeDefault );
- iPlaybackUtility->AddObserverL( *this );
- iPlaybackUtility->SetPrimaryClientL();
-
- //
- // Create Active Object for closing player
- //
- iCloseAO = CIdle::NewL( CActive::EPriorityStandard );
-
- //
- // Create Video Playback Display Handler
- //
- iDisplayHandler = CMPXVideoPlaybackDisplayHandler::NewL( iPlaybackUtility, this );
-
- //
- // Create control's controller
- //
- CreateControlsL();
-
- //
- // Create user input handler
- //
- iUserInputHandler = CMPXVideoPlaybackUserInputHandler::NewL( this, iFileDetails->mTvOutConnected );
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::~CMPXVideoViewWrapper()
-// -------------------------------------------------------------------------------------------------
-//
-CMPXVideoViewWrapper::~CMPXVideoViewWrapper()
-{
- MPX_DEBUG(_L("CMPXVideoViewWrapper::~CMPXVideoViewWrapper()"));
-
- //
- // Delete the display handler when the view is deactivated
- //
- if ( iDisplayHandler )
- {
- delete iDisplayHandler;
- iDisplayHandler = NULL;
- }
-
- if ( iUserInputHandler )
- {
- delete iUserInputHandler;
- iUserInputHandler = NULL;
- }
-
- if ( iControlsController )
- {
- delete iControlsController;
- iControlsController = NULL;
- }
-
- if ( iCloseAO )
- {
- delete iCloseAO;
- iCloseAO = NULL;
- }
-
- if ( iFileDetails )
- {
- delete iFileDetails;
- iFileDetails = NULL;
- }
-
- if ( iPlaybackUtility )
- {
- TRAP_IGNORE( iPlaybackUtility->RemoveObserverL( *this ) );
- iPlaybackUtility->Close();
- iPlaybackUtility = NULL;
- }
-
- if ( iCollectionUtility )
- {
- iCollectionUtility->Close();
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::IsLive()
-// -------------------------------------------------------------------------------------------------
-//
-TBool CMPXVideoViewWrapper::IsLive()
-{
- return ( iFileDetails->mPlaybackMode == EMPXVideoLiveStreaming );
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::IsPlaylist()
-// -------------------------------------------------------------------------------------------------
-//
-TBool CMPXVideoViewWrapper::IsPlaylist()
-{
- return iPlaylistView;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::CreateGeneralPlaybackCommandL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::CreateGeneralPlaybackCommandL( TMPXPlaybackCommand aCmd, TBool aDoSync )
-{
- MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::CreateGeneralPlaybackCommandL()"),
- _L("aCmd = %d, aDoSync, = %d"), aCmd, aDoSync );
-
- CMPXCommand* cmd = CMPXCommand::NewL();
- CleanupStack::PushL( cmd );
-
- cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, aDoSync );
- cmd->SetTObjectValueL<TBool>( KMPXCommandPlaybackGeneralNoBuffer, ETrue );
- cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId, KMPXCommandIdPlaybackGeneral );
- cmd->SetTObjectValueL<TInt>( KMPXCommandPlaybackGeneralType, aCmd );
-
- iPlaybackUtility->CommandL( *cmd, this );
-
- CleanupStack::PopAndDestroy( cmd );
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::HandleCommandL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::HandleCommandL( TInt aCommand )
-{
- MPX_ENTER_EXIT(
- _L("CMPXVideoViewWrapper::HandleCommandL()"),
- _L("aCommand = %d"), aCommand );
-
- switch ( aCommand )
- {
- case EMPXPbvCmdPlay:
- {
- MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EPbCmdPlay"));
- CreateGeneralPlaybackCommandL( EPbCmdPlay );
- break;
- }
- case EMPXPbvCmdPause:
- {
- MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdPause"));
- CreateGeneralPlaybackCommandL( EPbCmdPause );
- break;
- }
- case EMPXPbvCmdClose:
- {
- MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdClose"));
-
- //
- // 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:
- {
- MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdSeekForward"));
- CreateVideoSpecificCmdL( EPbCmdStartVideoSeekingForward );
- break;
- }
- case EMPXPbvCmdSeekBackward:
- {
- MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdSeekBackward"));
- CreateVideoSpecificCmdL( EPbCmdStartVideoSeekingBackward );
- break;
- }
- case EMPXPbvCmdEndSeek:
- {
- MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdEndSeek"));
- CreateVideoSpecificCmdL( EPbCmdStopVideoSeeking );
- break;
- }
- case EMPXPbvCmdPlayPause:
- {
- MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdPlayPause"));
-
- if ( iPlaybackState == EPbStatePlaying )
- {
- CreateGeneralPlaybackCommandL( EPbCmdPause );
- }
- else if ( iPlaybackState == EPbStatePaused )
- {
- CreateGeneralPlaybackCommandL( EPbCmdPlay );
- }
-
- break;
- }
- case EMPXPbvCmdStop:
- {
- MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdStop"));
- CreateGeneralPlaybackCommandL( EPbCmdStop );
- break;
- }
- case EMPXPbvCmdDecreaseVolume:
- {
- MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdDecreaseVolume"));
- HandleVolumeCmdL( EPbCmdDecreaseVolume );
- break;
- }
- case EMPXPbvCmdIncreaseVolume:
- {
- MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdIncreaseVolume"));
- HandleVolumeCmdL( EPbCmdIncreaseVolume );
- break;
- }
- case EMPXPbvCmdNaturalAspectRatio:
- {
- MPX_DEBUG(
- _L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdNaturalAspectRatio"));
- SetAspectRatioL( EPbCmdNaturalAspectRatio );
- break;
- }
- case EMPXPbvCmdZoomAspectRatio:
- {
- MPX_DEBUG(
- _L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdZoomAspectRatio"));
- SetAspectRatioL( EPbCmdZoomAspectRatio );
- break;
- }
- case EMPXPbvCmdStretchAspectRatio:
- {
- MPX_DEBUG(
- _L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdStretchAspectRatio"));
- SetAspectRatioL( EPbCmdStretchAspectRatio );
- break;
- }
- case EMPXPbvCmdMute:
- {
- MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdMute"));
- HandleVolumeCmdL( EPbCmdMuteVolume );
- break;
- }
- case EMPXPbvCmdUnMute:
- {
- MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdUnMute"));
- HandleVolumeCmdL( EPbCmdUnMuteVolume );
- break;
- }
- case EMPXPbvCmdShortPressBackward:
- {
- MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdShortPressBackward"));
-
- HandleShortPressBackwardL();
- break;
- }
- case EMPXPbvCmdResetControls:
- {
- MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdResetControls"));
-
- CreateControlsL();
- iView->retrievePdlInformation();
- break;
- }
- case EMPXPbvCmdNextListItem:
- {
- MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdNextListItem"));
-
- if ( iPlaylistView && iFileDetails->mMultiItemPlaylist )
- {
- CreateGeneralPlaybackCommandL( EPbCmdNext );
- }
- else
- {
- MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() ignore EMPXPbvCmdNextListItem"));
- }
-
- break;
- }
- case EMPXPbvCmdPreviousListItem:
- {
- MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdPreviousListItem"));
-
- if ( iPlaylistView && iFileDetails->mMultiItemPlaylist )
- {
- //
- // Need to send sync message to go back to a previous clip
- // regardless of current positoin
- //
- CreateGeneralPlaybackCommandL( EPbCmdPrevious );
- }
- else
- {
- MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() ignore EMPXPbvCmdNextListItem"));
- }
-
- break;
- }
- case EMPXPbvCmdEndOfClip:
- {
- CreateVideoSpecificCmdL( EPbCmdEndofClipReached );
- break;
- }
- case EMPXPbvCmdCustomPause:
- {
- CreateVideoSpecificCmdL( EPbCmdCustomPause );
- break;
- }
- case EMPXPbvCmdCustomPlay:
- {
- CreateVideoSpecificCmdL( EPbCmdCustomPlay );
- break;
- }
- case EMPXPbvCmdRealOneBitmapTimeout:
- {
- IssuePlayCommandL();
-
- break;
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// From MMPXPlaybackObserver
-// Handle playback message.
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::HandlePlaybackMessage( CMPXMessage* aMessage, TInt aError )
-{
- MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::HandlePlaybackMessage()"),
- _L("aError = %d"), aError );
-
- if ( aError )
- {
- MPX_TRAPD( err, DoHandleErrorPlaybackMessageL( aError ) );
- }
- else if ( aMessage )
- {
- MPX_TRAPD( err, DoHandlePlaybackMessageL( aMessage ) );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// Request for the media object
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::RequestMediaL()
-{
- MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::RequestMediaL()"));
-
- if ( iMediaRequestStatus == MediaNotRequested &&
- iPlaybackUtility->StateL() == EPbStateInitialised )
- {
- iMediaRequestStatus = MediaRequested;
-
- //
- // Request the volume for the controls
- //
- iPlaybackUtility->PropertyL( *this, EPbPropertyVolume );
-
- //
- // Request the clip's meta data
- //
- MMPXSource* s = iPlaybackUtility->Source();
-
- if ( s )
- {
- RArray<TMPXAttribute> attrs;
- CleanupClosePushL(attrs);
-
- //
- // General Media Attributes
- //
- attrs.Append( KMPXMediaGeneralUri |
- KMPXMediaGeneralDuration |
- KMPXMediaGeneralTitle |
- KMPXMediaGeneralMimeType );
-
- //
- // Video specific Attributes
- //
- attrs.Append( KMPXMediaVideoAll );
-
- // Set the attribute to always route the media call to playback plugin
- CMPXAttributeSpecs* specs = CMPXAttributeSpecs::NewL();
- CleanupStack::PushL( specs );
-
- specs->SetTObjectValueL<TBool>(KMPXMediaGeneralExtMediaRedirect, ETrue);
-
- s->MediaL( attrs.Array(), *this, specs );
-
- CleanupStack::PopAndDestroy( specs );
- CleanupStack::PopAndDestroy( &attrs );
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::DoHandlePlaybackMessageL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::DoHandlePlaybackMessageL( CMPXMessage* aMessage )
-{
- TMPXMessageId id( *(aMessage->Value<TMPXMessageId>(KMPXMessageGeneralId)) );
-
- MPX_ENTER_EXIT(
- _L("CMPXVideoViewWrapper::DoHandlePlaybackMessageL()"),
- _L("id = 0x%08x"), id );
-
- if ( KMPXMessageGeneral == id )
- {
- HandleGeneralPlaybackMessageL( aMessage );
- }
- else if ( KMPXMediaIdVideoPlayback == id )
- {
- HandleVideoPlaybackMessage( aMessage );
- }
- else if ( KMPXMediaIdVideoDisplayMessage == id )
- {
- if ( iDisplayHandler )
- {
- iDisplayHandler->HandleVideoDisplayMessageL( aMessage );
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::HandleGeneralPlaybackMessageL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::HandleGeneralPlaybackMessageL( CMPXMessage* aMessage )
-{
- TInt event( *aMessage->Value<TInt>( KMPXMessageGeneralEvent ) );
- TInt type( *aMessage->Value<TInt>( KMPXMessageGeneralType ) );
- TInt data( *aMessage->Value<TInt>( KMPXMessageGeneralData ) );
-
- MPX_DEBUG(
- _L("CMPXVideoViewWrapper::HandleGeneralPlaybackMessageL() event = %d type = %d value = %d"),
- event, type, data );
-
- switch ( event )
- {
- case TMPXPlaybackMessage::EStateChanged:
- {
- DoHandleStateChangeL( type );
-
- break;
- }
- case TMPXPlaybackMessage::EPropertyChanged:
- {
- TMPXPlaybackProperty property(
- static_cast<TMPXPlaybackProperty>( type ) );
-
- HandlePropertyL( property, data, KErrNone );
- break;
- }
- case TMPXPlaybackMessage::EDownloadPositionChanged:
- {
- if ( iControlsController )
- {
- iControlsController->handleEvent( EMPXControlCmdDownloadUpdated, data );
- }
-
- break;
- }
- case TMPXPlaybackMessage::EDownloadStateChanged:
- {
- break;
- }
- case TMPXPlaybackMessage::ECommandReceived:
- {
- break;
- }
- case TMPXPlaybackMessage::EReachedEndOfPlaylist:
- {
- iView->closePlaybackView();
- break;
- }
- case TMPXPlaybackMessage::ESongChanged:
- {
- break;
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::HandleVideoPlaybackMessage()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::HandleVideoPlaybackMessage( CMPXMessage* aMessage )
-{
- TMPXVideoPlaybackCommand message =
- ( *(aMessage->Value<TMPXVideoPlaybackCommand>(KMPXMediaVideoPlaybackCommand)) );
-
- MPX_DEBUG(
- _L("CMPXVideoViewWrapper::HandleVideoPlaybackMessage() message = %d"), message );
-
- switch ( message )
- {
- case EPbCmdPluginError:
- {
- TInt error( *aMessage->Value<TInt>( KMPXMediaVideoError ) );
-
- iView->handlePluginError( error );
- break;
- }
- case EPbCmdTvOutEvent:
- {
- TMPXVideoPlaybackControlCommandIds cmdId = EMPXControlCmdTvOutDisconnected;
-
- TBool tvOutConnected( *aMessage->Value<TInt>( KMPXMediaVideoTvOutConnected ) );
-
- if ( tvOutConnected )
- {
- cmdId = EMPXControlCmdTvOutConnected;
- }
-
- if ( iUserInputHandler )
- {
- TRAP_IGNORE(iUserInputHandler->HandleTVOutEventL( tvOutConnected ));
- }
-
- if ( iControlsController )
- {
- iControlsController->handleEvent( cmdId );
- }
- break;
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::HandlePluginError()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::HandlePluginError( int aError )
-{
- MPX_DEBUG(
- _L("CMPXVideoViewWrapper::HandlePluginError() aError = %d"), aError );
-
- iView->handlePluginError( aError );
-}
-
-// -------------------------------------------------------------------------------------------------
-// Handle playback state changes
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::DoHandleStateChangeL( TInt aNewState )
-{
- MPX_ENTER_EXIT(
- _L("CMPXVideoViewWrapper::DoHandleStateChangeL()"),
- _L("aNewState = %d"), aNewState );
-
- if ( aNewState != iPlaybackState )
- {
- switch ( aNewState )
- {
- case EPbStateInitialising:
- {
- if ( iControlsController )
- {
- //
- // If transitioning from Not Initialized to Initialising there is
- // no need to update the playback information that was gathered
- // when the container was created
- //
- if ( iPlaybackState != EPbStateNotInitialised )
- {
- iMediaRequestStatus = MediaNotRequested;
- HandleCommandL( EMPXPbvCmdResetControls );
-
- if ( iFileDetails )
- {
- iFileDetails->clearFileDetails();
- }
- }
- }
- break;
- }
- case EPbStateBuffering:
- {
- HandleBufferingStateL();
-
- break;
- }
- case EPbStatePluginSeeking:
- {
- // no-op
- break;
- }
- case EPbStateStopped:
- {
- if ( iFileDetails->mMultiItemPlaylist )
- {
- iView->handleStoppedState();
- }
- else
- {
- iView->closePlaybackView();
- }
-
- break;
- }
- case EPbStateInitialised:
- {
- RequestMediaL();
- break;
- }
- default:
- {
- break;
- }
- }
-
- iPlaybackState = (TMPXPlaybackState)aNewState;
-
- if ( iControlsController )
- {
- iControlsController->handleEvent( EMPXControlCmdStateChanged, aNewState );
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::HandleBufferingStateL
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::HandleBufferingStateL()
-{
- MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleBufferingStateL()"));
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// Handle playback error message.
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::DoHandleErrorPlaybackMessageL( TInt aError )
-{
- MPX_ENTER_EXIT( _L("CMPXVideoViewWrapper::DoHandleErrorPlaybackMessageL()"),
- _L("aError = %d"), aError );
-
- HandleCommandL( EMPXPbvCmdResetControls );
- iView->handlePluginError(aError);
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::HandlePlaybackCommandComplete()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::HandlePlaybackCommandComplete( CMPXCommand* /*aCommandResult*/,
- TInt /*aError*/ )
-{
- MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::HandlePlaybackCommandComplete()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::ParseMetaDataL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::ParseMetaDataL( const CMPXMessage& aMedia )
-{
- MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::ParseMetaDataL()"));
-
- //
- // Clip Name
- //
- if ( aMedia.IsSupported( KMPXMediaGeneralUri ) )
- {
- TPtrC uri( aMedia.ValueText( KMPXMediaGeneralUri ) );
- const QString qClipname( (QChar*)uri.Ptr(), uri.Length() );
- iFileDetails->mClipName = qClipname;
- }
-
- //
- // Title
- //
- if ( aMedia.IsSupported( KMPXMediaGeneralTitle ) )
- {
- TPtrC title( aMedia.ValueText( KMPXMediaGeneralTitle ) );
- const QString qTitle( (QChar*)title.Ptr(), title.Length() );
- iFileDetails->mTitle = qTitle;
- }
-
- //
- // Artist
- //
- if ( aMedia.IsSupported( KMPXMediaVideoArtist ) )
- {
- TPtrC artist( aMedia.ValueText( KMPXMediaVideoArtist ) );
- const QString qArtist( (QChar*)artist.Ptr(), artist.Length() );
- iFileDetails->mArtist = qArtist;
- }
-
- //
- // Mime Type
- //
- if ( aMedia.IsSupported( KMPXMediaGeneralMimeType ) )
- {
- TPtrC mimeType( aMedia.ValueText( KMPXMediaGeneralMimeType ) );
- const QString qMimeType( (QChar*)mimeType.Ptr(), mimeType.Length() );
- iFileDetails->mMimeType = qMimeType;
- }
-
- //
- // Duration
- //
- if ( aMedia.IsSupported( KMPXMediaGeneralDuration ) )
- {
- iFileDetails->mDuration = aMedia.ValueTObjectL<TInt>( KMPXMediaGeneralDuration );
- }
-
- //
- // Audio Enabled
- //
- if ( aMedia.IsSupported( KMPXMediaVideoAudioEnabled ) )
- {
- iFileDetails->mAudioEnabled = aMedia.ValueTObjectL<TInt>( KMPXMediaVideoAudioEnabled );
- }
-
- //
- // Video Enabled
- //
- if ( aMedia.IsSupported( KMPXMediaVideoVideoEnabled ) )
- {
- iFileDetails->mVideoEnabled = aMedia.ValueTObjectL<TInt>( KMPXMediaVideoVideoEnabled );
- }
-
- //
- // Partial Playback
- //
- if ( aMedia.IsSupported( KMPXMediaVideoPartialPlayback ) )
- {
- iFileDetails->mPartialPlayback =
- aMedia.ValueTObjectL<TInt>( KMPXMediaVideoPartialPlayback );
- }
-
- //
- // Playback Mode
- //
- if ( aMedia.IsSupported( KMPXMediaVideoPlaybackMode ) )
- {
- iFileDetails->mPlaybackMode =
- (TMPXVideoMode)aMedia.ValueTObjectL<TInt>( KMPXMediaVideoPlaybackMode );
- }
-
- //
- // Seekable
- //
- if ( aMedia.IsSupported( KMPXMediaVideoSeekable ) )
- {
- iFileDetails->mSeekable = aMedia.ValueTObjectL<TInt>( KMPXMediaVideoSeekable );
- }
-
- //
- // Pausable
- //
- if ( aMedia.IsSupported( KMPXMediaVideoPausableStream ) )
- {
- iFileDetails->mPausableStream = aMedia.ValueTObjectL<TBool>( KMPXMediaVideoPausableStream );
- }
-
- //
- // Video Height
- //
- if ( aMedia.IsSupported( KMPXMediaVideoHeight ) )
- {
- iFileDetails->mVideoHeight = aMedia.ValueTObjectL<TInt>( KMPXMediaVideoHeight );
- }
-
- //
- // Video Width
- //
- if ( aMedia.IsSupported( KMPXMediaVideoWidth ) )
- {
- iFileDetails->mVideoWidth = aMedia.ValueTObjectL<TInt>( KMPXMediaVideoWidth );
- }
-
- //
- // TV-Out Connected
- //
- if ( aMedia.IsSupported( KMPXMediaVideoTvOutConnected ) )
- {
- iFileDetails->mTvOutConnected = aMedia.ValueTObjectL<TInt>( KMPXMediaVideoTvOutConnected );
- }
-
- //
- // BitRate
- //
- if ( aMedia.IsSupported( KMPXMediaVideoBitRate ) )
- {
- iFileDetails->mBitRate = aMedia.ValueTObjectL<TInt>( KMPXMediaVideoBitRate );
- }
-
- //
- // Drm Protected
- //
- if ( aMedia.IsSupported( KMPXMediaVideoDrmProtected ) )
- {
- iFileDetails->mDrmProtected = aMedia.ValueTObjectL<TInt>( KMPXMediaVideoDrmProtected );
- }
-
- //
- // Description
- //
- if ( aMedia.IsSupported( KMPXMediaVideoDescription ) )
- {
- TPtrC description( aMedia.ValueText( KMPXMediaVideoDescription ) );
- const QString qDescription( (QChar*)description.Ptr(), description.Length() );
- iFileDetails->mDescription = qDescription;
- }
-
- //
- // Location
- //
- if ( aMedia.IsSupported( KMPXMediaVideoLocation ) )
- {
- TPtrC location( aMedia.ValueText( KMPXMediaVideoLocation ) );
- const QString qLocation( (QChar*)location.Ptr(), location.Length() );
- iFileDetails->mLocation = qLocation;
- }
-
- //
- // Copyright
- //
- if ( aMedia.IsSupported( KMPXMediaVideoCopyright ) )
- {
- TPtrC copyright( aMedia.ValueText( KMPXMediaVideoCopyright ) );
- const QString qCopyright( (QChar*)copyright.Ptr(), copyright.Length() );
- iFileDetails->mCopyright = qCopyright;
- }
-
- //
- // Language
- //
- if ( aMedia.IsSupported( KMPXMediaVideoLanguage ) )
- {
- TPtrC language( aMedia.ValueText( KMPXMediaVideoLanguage ) );
- const QString qLanguage( (QChar*)language.Ptr(), language.Length() );
- iFileDetails->mLanguage = qLanguage;
- }
-
- //
- // Keywords
- //
- if ( aMedia.IsSupported( KMPXMediaVideoKeywords ) )
- {
- TPtrC keywords( aMedia.ValueText( KMPXMediaVideoKeywords ) );
- const QString qKeywords( (QChar*)keywords.Ptr(), keywords.Length() );
- iFileDetails->mKeywords = qKeywords;
- }
-
- //
- // Creation date/time
- //
- if ( aMedia.IsSupported( KMPXMediaVideoCreated ) )
- {
- iFileDetails->mCreationTime = aMedia.ValueTObjectL<TInt>( KMPXMediaVideoCreated );
- }
-
- //
- // Last Modified date/time
- //
- if ( aMedia.IsSupported( KMPXMediaVideoLastModified ) )
- {
- iFileDetails->mModificationTime = aMedia.ValueTObjectL<TInt>( KMPXMediaVideoLastModified );
- }
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// Handle media properties.
-// Notes: The client is responsible for delete the object of aProperties.
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::DoHandleMediaL( const CMPXMessage& aMedia, TInt aError )
-{
- MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::DoHandleMediaL()"),
- _L("aError = %d"), aError );
-
- if ( aError == KErrNone )
- {
- iMediaRequestStatus = MediaDelivered;
-
- if ( ! iFileDetails )
- {
- iFileDetails = new QMPXVideoPlaybackViewFileDetails();
- }
-
- //
- // Read in the media data
- //
- ParseMetaDataL( aMedia );
-
- //
- // If RN logo is still visible, wait for timeout of rn logo timer
- // If RN logo is not visible, issue play
- //
- if ( ! iControlsController->isRNLogoBitmapInControlList() )
- {
- IssuePlayCommandL();
- }
- }
- else
- {
- iMediaRequestStatus = MediaNotRequested;
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// From MMPXPlaybackCallback
-// Handle media event.
-// Notes: The client is responsible for delete the object of aProperties.
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::HandleMediaL( const CMPXMedia& aMedia, TInt aError)
-{
- MPX_ENTER_EXIT(_L( "CMPXVideoViewWrapper::HandleMediaL()" ));
-
- if ( aMedia.IsSupported( KMPXMediaVideoError ) )
- {
- TInt error = aMedia.ValueTObjectL<TInt>( KMPXMediaVideoError );
- // Reset the controls
- HandleCommandL( EMPXPbvCmdResetControls );
- // Set the iMediaRequested flag to false
- iMediaRequestStatus = MediaNotRequested;
- // Reset the playback state to stopped
- iPlaybackState = EPbStateStopped;
- // Handle the plugin error
- iView->handlePluginError( error );
- }
- else
- {
- DoHandleMediaL( aMedia, aError );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::SetPropertyL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::SetPropertyL( TMPXPlaybackProperty aProperty, TInt aValue )
-{
- MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::SetPropertyL"),
- _L("aProperty = %d, aValue = %d"), aProperty, aValue );
-
- iPlaybackUtility->SetL( aProperty, aValue );
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::HandlePropertyL()
-// -------------------------------------------------------------------------------------------------
-//
-void
-CMPXVideoViewWrapper::HandlePropertyL( TMPXPlaybackProperty aProperty, TInt aValue, TInt aError )
-{
- MPX_DEBUG(_L("CMPXVideoViewWrapper::HandlePropertyL - Error(%d)"), aError );
-
- if ( aError == KErrNone )
- {
- switch ( aProperty )
- {
- case EPbPropertyPosition:
- {
- MPX_DEBUG(_L("CMPXVideoViewWrapper::DoHandlePropertyL position(%d)"), aValue );
-
- if ( iControlsController )
- {
- iControlsController->handleEvent( EMPXControlCmdSetPosition, aValue );
- }
-
- iPlayPosition = aValue;
-
- break;
- }
- case EPbPropertyDuration:
- {
- MPX_DEBUG(_L("CMPXVideoViewWrapper::DoHandlePropertyL duration(%d)"), aValue );
-
- if ( iControlsController )
- {
- iControlsController->handleEvent( EMPXControlCmdSetDuration, aValue );
- }
-
- break;
- }
- case EPbPropertyMaxVolume:
- {
- MPX_DEBUG(_L("CMPXVideoViewWrapper::DoHandlePropertyL max volume(%d)"), aValue );
-
- break;
- }
- case EPbPropertyVolume:
- {
- MPX_DEBUG(_L("CMPXVideoViewWrapper::DoHandlePropertyL volume(%d)"), aValue );
-
- if ( iControlsController )
- {
- iControlsController->handleEvent( EMPXControlCmdSetVolume, aValue );
- }
-
- break;
- }
- case EPbPropertyMute:
- {
- MPX_DEBUG(_L("CMPXVideoViewWrapper::DoHandlePropertyL mute(%d)"), aValue );
-
- if ( iControlsController && aValue )
- {
- iControlsController->handleEvent( EMPXControlCmdSetVolume, 0 );
- }
-
- break;
- }
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::RetrieveFileNameAndModeL
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::RetrieveFileNameAndModeL( CMPXCommand* aCmd )
-{
- MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::RetrieveFileNameAndModeL()"));
-
- //
- // set attributes on the command
- //
- aCmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
-
- aCmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId, KMPXMediaIdVideoPlayback );
-
- aCmd->SetTObjectValueL<TMPXVideoPlaybackCommand>( KMPXMediaVideoPlaybackCommand,
- EPbCmdInitView );
-
- iPlaybackUtility->CommandL( *aCmd );
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::ActivateClosePlayerActiveObject
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::ActivateClosePlayerActiveObject()
-{
- MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::ActivateClosePlayerActiveObject()"));
-
- if ( ! iCloseAO->IsActive() )
- {
- iCloseAO->Start( TCallBack( CMPXVideoViewWrapper::ClosePlayer, this ) );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::ClosePlayer
-// -------------------------------------------------------------------------------------------------
-//
-TInt CMPXVideoViewWrapper::ClosePlayer( TAny* aPtr )
-{
- MPX_DEBUG(_L("CMPXVideoViewWrapper::ClosePlayer()"));
-
- static_cast<CMPXVideoViewWrapper*>(aPtr)->DoClosePlayer();
- return KErrNone;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::DoClosePlayer
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::DoClosePlayer()
-{
- MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::DoClosePlayer()"));
-
- iView->doClosePlayer();
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::RetrievePdlInformationL
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::RetrievePdlInformationL()
-{
- MPX_DEBUG(_L("CMPXVideoViewWrapper::RetrievePdlInformationL()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::CreateVideoSpecificCmdL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::CreateVideoSpecificCmdL( TMPXVideoPlaybackCommand aCmd )
-{
- //
- // create command to pass to playback plugin
- //
- CMPXCommand* cmd = CMPXCommand::NewL();
- CleanupStack::PushL( cmd );
-
- cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
-
- cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId, KMPXMediaIdVideoPlayback );
-
- cmd->SetTObjectValueL<TMPXVideoPlaybackCommand>( KMPXMediaVideoPlaybackCommand, aCmd );
-
- iPlaybackUtility->CommandL( *cmd );
-
- CleanupStack::PopAndDestroy( cmd );
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::SetAspectRatioL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::SetAspectRatioL( TMPXVideoPlaybackCommand aCmd )
-{
- MPX_DEBUG(_L("CMPXVideoViewWrapper::SetAspectRatioL()"));
-
- TInt newAspectRatio = iDisplayHandler->SetAspectRatioL( aCmd );
-
- if ( iControlsController )
- {
- iControlsController->handleEvent( EMPXControlCmdSetAspectRatio, newAspectRatio );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::IsAppInFrontL()
-// Returns true if app is foreground. Uses windowgroup id
-// -------------------------------------------------------------------------------------------------
-//
-TBool CMPXVideoViewWrapper::IsAppInFrontL()
-{
- TBool ret = EFalse;
- RWsSession wsSession;
-
- User::LeaveIfError( wsSession.Connect() );
-
- if( wsSession.Handle() )
- {
- CArrayFixFlat<TInt>* wgList =
- new (ELeave) CArrayFixFlat<TInt>( wsSession.NumWindowGroups() );
-
- // check if our window is front or not
- if ( wsSession.WindowGroupList( 0, wgList ) == KErrNone )
- {
- ret = ( CEikonEnv::Static()->RootWin().Identifier() == wgList->At(0) );
- }
- else
- {
- ret = EFalse;
- }
-
- delete wgList;
- }
-
- wsSession.Close();
-
- MPX_DEBUG(_L("CMPXVideoViewWrapper::IsAppInFrontL (%d)" ), ret);
-
- return ret;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::ClosePlaybackViewL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::ClosePlaybackViewL()
-{
- MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::closePlaybackView()"));
-
- iView->closePlaybackView();
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::HandleVolumeCmdL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::HandleVolumeCmdL( TMPXPlaybackCommand aCmd )
-{
- MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::HandleVolumeCmdL()"));
-
- //
- // In case user try to change the volume via media key, rocker key or etc
- // We need to show the controls though the volume level doesn't get changed
- // For examples : - try to change the volume with a clip without audio track
- // - try to reduce the volume with volume level 0
- // - try to increase the volume with max volume level
- //
- iControlsController->handleEvent( EMPXControlCmdShowVolumeControls );
-
- switch( aCmd )
- {
- case EPbCmdDecreaseVolume:
- {
- CreateVideoSpecificCmdL( EPbCmdHandleDecreaseVolume );
- break;
- }
- case EPbCmdIncreaseVolume:
- {
- CreateVideoSpecificCmdL( EPbCmdHandleIncreaseVolume );
- break;
- }
- default:
- {
- iPlaybackUtility->CommandL( aCmd );
- break;
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::HandleShortPressBackwardL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::HandleShortPressBackwardL()
-{
- MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleShortPressBackwardL()"));
-
- if( !iPlaylistView )
- {
- SetPropertyL( EPbPropertyPosition, 0 );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::IssueVideoAppForegroundCmd()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::IssueVideoAppForegroundCmdL( TBool aForeground )
-{
- MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::IssueVideoAppForegroundCmdL()"),
- _L("aForeground = %d"), aForeground );
-
- TMPXVideoPlaybackCommand videoCmd = EPbCmdHandleBackground;
-
- if ( aForeground )
- {
- videoCmd = EPbCmdHandleForeground;
- }
-
- //
- // create command to pass to playback plugin
- //
- CMPXCommand* cmd = CMPXCommand::NewL();
- CleanupStack::PushL( cmd );
-
- cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
- cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId, KMPXMediaIdVideoPlayback );
- cmd->SetTObjectValueL<TMPXVideoPlaybackCommand>( KMPXMediaVideoPlaybackCommand, videoCmd );
- cmd->SetTObjectValueL<TBool>( KMPXMediaVideoAppForeground, IsAppInFrontL() );
-
- iPlaybackUtility->CommandL( *cmd );
- CleanupStack::PopAndDestroy( cmd );
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::CreateControlsL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::CreateControlsL()
-{
- MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::CreateControlsL()"));
-
- //
- // Query playback plugin for filename and mode
- //
- CMPXCommand* cmd = CMPXCommand::NewL();
- CleanupStack::PushL( cmd );
-
- RetrieveFileNameAndModeL( cmd );
-
- //
- // Create a temporary file details that is populated with the
- // file name and playback mode. This will be delete when
- // plugin initialization is complete
- //
- if ( iFileDetails )
- {
- delete iFileDetails;
- iFileDetails = NULL;
- }
-
- iFileDetails = new QMPXVideoPlaybackViewFileDetails();
-
- TPtrC fileName( cmd->ValueText( KMPXMediaVideoPlaybackFileName ) );
- const QString qFilename( (QChar*)fileName.Ptr(), fileName.Length() );
- iFileDetails->mClipName = qFilename;
-
- iFileDetails->mPlaybackMode = (TMPXVideoMode) cmd->ValueTObjectL<TInt>( KMPXMediaVideoMode );
-
- iFileDetails->mTvOutConnected = cmd->ValueTObjectL<TInt>( KMPXMediaVideoTvOutConnected );
-
- TPtrC mimeType( cmd->ValueText( KMPXMediaVideoRecognizedMimeType ) );
- const QString qMimeType( (QChar*)mimeType.Ptr(), mimeType.Length() );
- iFileDetails->mMimeType = qMimeType;
-
- //
- // get playlist information and set mMultiItemPlaylist flag
- //
- TInt numItems = 1;
- MMPXSource* s = iPlaybackUtility->Source();
-
- if ( s )
- {
- CMPXCollectionPlaylist* playlist = NULL;
-
- MPX_TRAPD( err, playlist = s->PlaylistL() );
-
- if ( err == KErrNone && playlist )
- {
- iPlaylistView = ETrue;
- numItems = playlist->Count();
- delete playlist;
- }
- }
-
- iFileDetails->mMultiItemPlaylist = ( numItems > 1 );
-
- CleanupStack::PopAndDestroy( cmd );
-
- if ( iControlsController )
- {
- delete iControlsController;
- iControlsController = NULL;
- }
-
- iControlsController = new QMPXVideoPlaybackControlsController( iView, this, iFileDetails );
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::IsMultiItemPlaylist()
-// -------------------------------------------------------------------------------------------------
-//
-TBool CMPXVideoViewWrapper::IsMultiItemPlaylist()
-{
-
- bool multiLinks( false );
-
- if ( iFileDetails )
- {
- multiLinks = iFileDetails->mMultiItemPlaylist;
- }
-
- MPX_DEBUG(_L("CMPXVideoViewWrapper::IsMultiItemPlaylist() ret %d"), multiLinks );
-
- return multiLinks;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::UpdateVideoRect()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::UpdateVideoRect(
- TInt aX, TInt aY, TInt aWidth, TInt aHeight, TBool transitionEffect )
-{
- MPX_DEBUG(_L("CMPXVideoViewWrapper::UpdateVideoRect()"));
-
- TRect rect( TPoint( aX, aY ), TSize( aWidth, aHeight ) );
- TRAP_IGNORE( iDisplayHandler->UpdateVideoRectL( rect, transitionEffect ) );
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::UpdateVideoRectDone()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::UpdateVideoRectDone()
-{
- MPX_DEBUG(_L("CMPXVideoViewWrapper::UpdateVideoRectDone()"));
-
- 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 );
- }
- }
-
- // if coming back after a forced termination, the playback position must
- // be restored and state be set to paused, as forced termination can only
- // happen when app is on background, in which case Video Player is paused
- // by default
- if ( iView->mStayPaused )
- {
- CreateGeneralPlaybackCommandL( EPbCmdPause );
- SetPropertyL( EPbPropertyPosition, iView->mLastPlayPosition );
- iView->mStayPaused = false;
- }
- else
- {
- CreateGeneralPlaybackCommandL( EPbCmdPlay );
- }
-
- }
-}
-
-// EOF
--- a/videoplayback/hbvideoplaybackviewplugin/hbvideoplaybackviewplugin.pro Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +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 %
-
-
-TEMPLATE = lib
-CONFIG += hb qt ecomplugin
-TARGET = hbvideoplaybackviewplugin
-
-symbian:
-{
- TARGET.CAPABILITY = ALL -TCB -DRM
- TARGET.EPOCALLOWDLLDATA = 1
- TARGET.UID3 = 0x20024335
- INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE \
- $$APP_LAYER_SYSTEMINCLUDE SYSTEMINCLUDE
- BLD_INF_RULES.prj_exports += "rom/hbvideoplaybackviewplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(hbvideoplaybackviewplugin.iby)"
-}
-
-SERVICE.INTERFACE_NAME = org.nokia.mmdt.QViewPlugin/1.0
-SERVICE.CONFIGURATION = "<t>0x20024338</t><p></p><i>EMPXViewPluginPriorityNormal</i><f>0x00000002</f>"
-
-
-INCLUDEPATH += ../../inc ../inc
-
-LIBS += -lmpxviewframeworkqt.dll \
- -lhbvideoplaybackview.dll \
- -lflogger.dll
-
-DEPENDPATH += inc
-VPATH += src
-
-HEADERS += mpxhbvideoplaybackviewplugin.h
-
-SOURCES += mpxhbvideoplaybackviewplugin.cpp
-
--- a/videoplayback/hbvideoplaybackviewplugin/inc/mpxhbvideoplaybackviewplugin.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +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: QMpxHbVideoPlaybackViewPlugin
-*
-*/
-
-// Version : %version: 6 %
-
-
-#ifndef QMPXHBVIDEOPLAYBACKVIEWPLUGIN_H
-#define QMPXHBVIDEOPLAYBACKVIEWPLUGIN_H
-
-#include <QObject>
-#include <mpxviewpluginqt.h>
-
-
-// FORWARD DECLARATION
-class HbVideoPlaybackView;
-
-/**
- * MPX playback view plugin definition.
- *
- */
-class QMpxHbVideoPlaybackViewPlugin : public MpxViewPlugin
-{
- Q_OBJECT
-
-public:
-
- /**
- * C++ default constructor.
- */
- QMpxHbVideoPlaybackViewPlugin();
-
- /**
- * Destructor.
- *
- */
- virtual ~QMpxHbVideoPlaybackViewPlugin();
-
- // from QViewPlugin
-
- void createView();
-
- void destroyView();
-
- void activateView();
-
- void deactivateView();
-
- QGraphicsWidget* getView();
-
-signals:
- void command( int aCommand );
-
-public slots:
- void orientationChange(Qt::Orientation orientation);
-
- void back();
-
-public:
- HbVideoPlaybackView* mView;
- bool mViewActivated;
-
-};
-
-
-#endif //QMPXHBVIDEOPLAYBACKVIEWPLUGIN_H
--- a/videoplayback/hbvideoplaybackviewplugin/rom/hbvideoplaybackviewplugin.iby Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +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: hbvideoplaybackviewplugin.iby
-*
-*/
-
-
-#ifndef HBVIDEOPLAYBACKVIEWPLUGIN_IBY
-#define HBVIDEOPLAYBACKVIEWPLUGIN_IBY
-
-#include <data_caging_paths_for_iby.hrh>
-
-ECOM_PLUGIN( hbvideoplaybackviewplugin.dll, hbvideoplaybackviewplugin.rsc )
-
-#endif // HBVIDEOPLAYBACKVIEWPLUGIN_IBY
\ No newline at end of file
--- a/videoplayback/hbvideoplaybackviewplugin/src/mpxhbvideoplaybackviewplugin.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,147 +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: QMpxHbVideoPlaybackViewPlugin
-*
-*/
-
-// Version : %version: 7 %
-
-
-
-#include <QtGui>
-#include <hbview.h>
-#include <xqplugin.h>
-#include <hbinstance.h>
-
-#include "mpxvideo_debug.h"
-#include "hbvideoplaybackview.h"
-#include "mpxhbvideocommondefs.h"
-#include "mpxhbvideoplaybackviewplugin.h"
-
-
-// ---------------------------------------------------------------------------
-// Constructor
-// ---------------------------------------------------------------------------
-//
-QMpxHbVideoPlaybackViewPlugin::QMpxHbVideoPlaybackViewPlugin()
- : mView( NULL )
- , mViewActivated ( false )
-{
- MPX_ENTER_EXIT(_L("QMpxHbVideoPlaybackViewPlugin::QMpxHbVideoPlaybackViewPlugin()"));
-}
-
-// ---------------------------------------------------------------------------
-// Destructor
-// ---------------------------------------------------------------------------
-//
-QMpxHbVideoPlaybackViewPlugin::~QMpxHbVideoPlaybackViewPlugin()
-{
- MPX_ENTER_EXIT(_L("QMpxHbVideoPlaybackViewPlugin::~QMpxHbVideoPlaybackViewPlugin()"));
- destroyView();
-}
-
-// ---------------------------------------------------------------------------
-// Create view
-// ---------------------------------------------------------------------------
-//
-void QMpxHbVideoPlaybackViewPlugin::createView()
-{
- MPX_ENTER_EXIT(_L("QMpxHbVideoPlaybackViewPlugin::createView()"));
-
- if ( ! mView )
- {
- mView = new HbVideoPlaybackView();
- connect( mView, SIGNAL( activatePreviousView() ), this, SLOT( back() ) );
- }
-}
-
-// ---------------------------------------------------------------------------
-// Destroy view
-// ---------------------------------------------------------------------------
-//
-void QMpxHbVideoPlaybackViewPlugin::destroyView()
-{
- MPX_ENTER_EXIT(_L("QMpxHbVideoPlaybackViewPlugin::destroyView()"));
-
- if ( mView )
- {
- disconnect( mView, SIGNAL( activatePreviousView() ), this, SLOT( back() ) );
-
- delete mView;
- mView = NULL;
- }
-}
-
-// ---------------------------------------------------------------------------
-// Activate view
-// ---------------------------------------------------------------------------
-//
-void QMpxHbVideoPlaybackViewPlugin::activateView()
-{
- MPX_ENTER_EXIT(_L("QMpxHbVideoPlaybackViewPlugin::activateView()"));
-
- if ( mView && !mViewActivated )
- {
- mView->handleActivateView();
- mViewActivated = true;
- }
-}
-
-// ---------------------------------------------------------------------------
-// Deactivate view
-// ---------------------------------------------------------------------------
-//
-void QMpxHbVideoPlaybackViewPlugin::deactivateView()
-{
- MPX_ENTER_EXIT(_L("QMpxHbVideoPlaybackViewPlugin::deactivateView()"));
-
- if ( mView && mViewActivated )
- {
- mView->handleDeactivateView();
- mViewActivated = false;
- }
-}
-
-// ---------------------------------------------------------------------------
-// Get view
-// ---------------------------------------------------------------------------
-//
-QGraphicsWidget* QMpxHbVideoPlaybackViewPlugin::getView()
-{
- return mView;
-}
-
-// ---------------------------------------------------------------------------
-// QMpxHbVideoPlaybackViewPlugin::orientationChange
-// ---------------------------------------------------------------------------
-//
-void QMpxHbVideoPlaybackViewPlugin::orientationChange( Qt::Orientation orientation )
-{
- Q_UNUSED( orientation );
-}
-
-// ---------------------------------------------------------------------------
-// QMpxHbVideoPlaybackViewPlugin::back
-// ---------------------------------------------------------------------------
-//
-void QMpxHbVideoPlaybackViewPlugin::back()
-{
- MPX_ENTER_EXIT(_L("QMpxHbVideoPlaybackViewPlugin::back()"));
-
- emit command( MpxHbVideoCommon::CollectionView );
-}
-
-XQ_EXPORT_PLUGIN2( hbvideoplaybackviewplugin, QMpxHbVideoPlaybackViewPlugin );
-
-// End of File
--- a/videoplayback/hbvideoplaybackviewplugin/tsrc/testvideoplaybackviewplugin/inc/testvideoplaybackviewplugin.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +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: tester for methods in Video Playback View Plugin
-*
-*/
-
-#ifndef __TESTVIDEOPLAYBACKVIEWPLUGIN_H__
-#define __TESTVIDEOPLAYBACKVIEWPLUGIN_H__
-
-
-// INCLUDES
-#include <QtTest/QtTest>
-
-class QMpxHbVideoPlaybackViewPlugin;
-class MpxViewPlugin;
-
-
-class TestVideoPlaybackViewPlugin : public QObject
-{
- Q_OBJECT
-
-public:
-
- /**
- * will be called before each testfunction is executed.
- *
- */
- void init();
-
- /**
- * will be called after every testfunction.
- *
- */
- void cleanup();
-
- // test functions for the test framework
-private slots:
-
- // the order in which these testXX methods are declared is important
- // changing this order will affect the test results
- void testCreateView();
- void testActivateView();
- void testGetView();
- void testDeactivateView();
- void testDestroyView();
-
-signals:
-
- void commandSignal(int);
-
-private:
-
- MpxViewPlugin* mVidPBPlugin;
-};
-
-
-#endif // __TESTVIDEOPLAYBACKVIEWPLUGIN_H__
-
-// End of file
-
-
-
--- a/videoplayback/hbvideoplaybackviewplugin/tsrc/testvideoplaybackviewplugin/src/testvideoplaybackviewplugin.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,155 +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: tester for methods in VideoSortFilterProxyModel
-*
-*/
-
-#include <hbapplication.h>
-#include <hbinstance.h>
-#include <xqpluginloader.h>
-#include <mpxviewpluginqt.h>
-#include <xqplugininfo.h>
-
-
-#include "testvideoplaybackviewplugin.h"
-#include "hbvideoplaybackview.h"
-
-#include "mpxhbvideoplaybackviewplugin.h"
-#include "mpxhbvideocommondefs.h"
-
-// ---------------------------------------------------------------------------
-// main
-// ---------------------------------------------------------------------------
-//
-int main(int argc, char *argv[])
-{
- HbApplication app(argc, argv);
- HbMainWindow window;
-
- TestVideoPlaybackViewPlugin tv;
-
- char *pass[3];
- pass[0] = argv[0];
- pass[1] = "-o";
- pass[2] = "c:\\data\\TestVideoPlaybackViewPlugin.txt";
-
- int res = QTest::qExec(&tv, 3, pass);
-
- return res;
-}
-
-
-// ---------------------------------------------------------------------------
-// init
-// ---------------------------------------------------------------------------
-//
-void TestVideoPlaybackViewPlugin::init()
-{
- QList<XQPluginInfo> impls;
- XQPluginLoader::listImplementations("org.nokia.mmdt.MpxViewPlugin/1.0", impls);
-
- XQPluginLoader pluginLoader( MpxHbVideoCommon::KMpxVideoPluginDllPlaybackUid );
- QObject* instance = pluginLoader.instance();
-
- mVidPBPlugin = qobject_cast<MpxViewPlugin*>( instance )->viewPlugin(); ;
-}
-
-// ---------------------------------------------------------------------------
-// cleanup
-// ---------------------------------------------------------------------------
-//
-void TestVideoPlaybackViewPlugin::cleanup()
-{
- delete mVidPBPlugin;
- mVidPBPlugin = 0;
-}
-
-// ---------------------------------------------------------------------------
-// Slot: test create view
-// ---------------------------------------------------------------------------
-//
-void TestVideoPlaybackViewPlugin::testCreateView()
-{
- qDebug("===> testCreateView()");
-
- init();
-
- QVERIFY(mVidPBPlugin != NULL );
-
- QVERIFY(reinterpret_cast<QMpxHbVideoPlaybackViewPlugin*>( mVidPBPlugin )->mView == NULL );
-
- mVidPBPlugin->createView();
-
- QVERIFY(reinterpret_cast<QMpxHbVideoPlaybackViewPlugin*>( mVidPBPlugin )->mView != NULL );
-
-}
-
-// ---------------------------------------------------------------------------
-// Slot: test activate view
-// ---------------------------------------------------------------------------
-//
-void TestVideoPlaybackViewPlugin::testActivateView()
-{
- QVERIFY(reinterpret_cast<QMpxHbVideoPlaybackViewPlugin*>( mVidPBPlugin )->mView != NULL );
-
- mVidPBPlugin->activateView();
-
- QVERIFY(reinterpret_cast<QMpxHbVideoPlaybackViewPlugin*>( mVidPBPlugin )->mViewActivated == true );
-}
-
-// ---------------------------------------------------------------------------
-// Slot: test deactivate view
-// ---------------------------------------------------------------------------
-//
-void TestVideoPlaybackViewPlugin::testDeactivateView()
-{
- QVERIFY(reinterpret_cast<QMpxHbVideoPlaybackViewPlugin*>( mVidPBPlugin )->mView != NULL );
- QVERIFY(reinterpret_cast<QMpxHbVideoPlaybackViewPlugin*>( mVidPBPlugin )->mViewActivated == true );
-
- mVidPBPlugin->deactivateView();
-
- QVERIFY(reinterpret_cast<QMpxHbVideoPlaybackViewPlugin*>( mVidPBPlugin )->mViewActivated == false );
-}
-
-// ---------------------------------------------------------------------------
-// Slot: test destroy view
-// ---------------------------------------------------------------------------
-//
-void TestVideoPlaybackViewPlugin::testDestroyView()
-{
- QVERIFY(reinterpret_cast<QMpxHbVideoPlaybackViewPlugin*>( mVidPBPlugin )->mView != NULL );
-
- mVidPBPlugin->destroyView();
-
- QVERIFY(reinterpret_cast<QMpxHbVideoPlaybackViewPlugin*>( mVidPBPlugin )->mView == NULL );
-
-}
-
-// ---------------------------------------------------------------------------
-// Slot: test get view
-// ---------------------------------------------------------------------------
-//
-void TestVideoPlaybackViewPlugin::testGetView()
-{
- QVERIFY( mVidPBPlugin->getView() != NULL );
- QVERIFY(reinterpret_cast<QMpxHbVideoPlaybackViewPlugin*>( mVidPBPlugin )->mView ==
- reinterpret_cast<QMpxHbVideoPlaybackViewPlugin*>( mVidPBPlugin )->getView() );
-}
-
-
-
-// End of file
-
-
-
--- a/videoplayback/hbvideoplaybackviewplugin/tsrc/testvideoplaybackviewplugin/stub/inc/hbvideoplaybackview.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +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: HB Video playback view
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-// This file defines the API for .dll
-
-#ifndef __HBVIDEOPLAYBACKVIEW_H__
-#define __HBVIDEOPLAYBACKVIEW_H__
-
-// Include Files
-#include <hbview.h>
-//#include <qgraphicswidget.h>
-
-// Constants
-
-// Forward Declarations
-
-// Class Definitions
-
-class HbVideoPlaybackView : public HbView
-{
- Q_OBJECT
-
- public:
- IMPORT_C HbVideoPlaybackView();
- IMPORT_C virtual ~HbVideoPlaybackView();
-
- IMPORT_C void handleActivateView();
-
- IMPORT_C void handleDeactivateView();
-
- IMPORT_C void handleBack();
-
- void handleSoftkeyBack();
-
- void handlePluginError( int aError );
-
- void handlePdlStateChange( int aState );
-
- void handleStoppedState();
-
-};
-
-#endif // __HBVIDEOPLAYBACKVIEW_H__
-
-// EOF
--- a/videoplayback/hbvideoplaybackviewplugin/tsrc/testvideoplaybackviewplugin/stub/src/hbvideoplaybackview.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +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 Video playback view
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-// Include Files
-#include <hbinstance.h>
-#include "hbvideoplaybackview.h"
-
-
-// Member Functions
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoPlaybackView::HbVideoPlaybackView()
-// -------------------------------------------------------------------------------------------------
-//
-EXPORT_C HbVideoPlaybackView::HbVideoPlaybackView()
-{
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoPlaybackView::~HbVideoPlaybackView()
-// -------------------------------------------------------------------------------------------------
-//
-EXPORT_C HbVideoPlaybackView::~HbVideoPlaybackView()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoPlaybackView::handleActivateView()
-// -------------------------------------------------------------------------------------------------
-//
-EXPORT_C void HbVideoPlaybackView::handleActivateView()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoPlaybackView::handleDeactivateView()
-// -------------------------------------------------------------------------------------------------
-//
-EXPORT_C void HbVideoPlaybackView::handleDeactivateView()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoPlaybackView::handleBack()
-// -------------------------------------------------------------------------------------------------
-//
-EXPORT_C void HbVideoPlaybackView::handleBack()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoPlaybackView::handleSoftkeyBack()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoPlaybackView::handleSoftkeyBack()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoPlaybackView::handlePluginError()
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoPlaybackView::handlePluginError( int aError )
-{
-}
-
-// -----------------------------------------------------------------------------
-// HbVideoPlaybackView::handlePdlStateChange
-// -----------------------------------------------------------------------------
-//
-void HbVideoPlaybackView::handlePdlStateChange( int /*aState*/ )
-{
-}
-
-// -----------------------------------------------------------------------------
-// HbVideoPlaybackView::handleStoppedState
-// -----------------------------------------------------------------------------
-//
-void HbVideoPlaybackView::handleStoppedState()
-{
-}
-
-// EOF
--- a/videoplayback/hbvideoplaybackviewplugin/tsrc/testvideoplaybackviewplugin/testvideoplaybackviewplugin.pro Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +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: 4 %
-
-
-TEMPLATE = app
-TARGET =
-CONFIG += qtestlib hb
-
-DEPENDPATH += . \
- inc \
- src
-
-INCLUDEPATH +=
-
-LIBS += -lestor.dll \
- -lmpxviewframeworkqt.dll \
- -lxqplugins.dll
-
-# Input
-HEADERS += inc/testvideoplaybackviewplugin.h \
- stub/inc/hbvideoplaybackview.h \
- ../../inc/mpxhbvideoplaybackviewplugin.h \
- ../../../../inc/mpxhbvideocommondefs.h
-
-SOURCES += stub/src/hbvideoplaybackview.cpp \
- src/testvideoplaybackviewplugin.cpp \
- ../../src/mpxhbvideoplaybackviewplugin.cpp
--- a/videoplayback/inc/hbvideobaseplaybackview.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,124 +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: MPX Video base playback view
-*
-*/
-
-// Version : %version: da1mmcf#18 %
-
-
-
-// This file defines the API for .dll
-
-#ifndef __HBVIDEOBASEPLAYBACKVIEW_H__
-#define __HBVIDEOBASEPLAYBACKVIEW_H__
-
-// Include Files
-#include <hbview.h>
-
-// Constants
-
-// Forward Declarations
-class QTimer;
-class RWindow;
-class CMPXVideoViewWrapper;
-
-
-// Class Definitions
-
-class HbVideoBasePlaybackView : public HbView
-{
- Q_OBJECT
-
- public:
- HbVideoBasePlaybackView();
- virtual ~HbVideoBasePlaybackView();
-
- signals:
- void activatePreviousView();
- void tappedOnScreen();
- void pannedToRight();
- void pannedToLeft();
-
- public slots:
- virtual void closePlaybackView();
-
- protected slots:
- void handleClosePopupDialog();
-
- public:
-
- virtual void retrievePdlInformation();
-
- virtual void handleActivateView();
-
- virtual void handleDeactivateView();
-
- virtual void handlePluginError( int aError );
-
- /*
- * Handle transition to the stopped state
- */
- virtual void handleStoppedState() = 0;
-
- virtual void doClosePlayer();
-
- //
- // Function the derived classes must implement
- //
- virtual void handleSoftkeyBack() = 0;
-
- /*
- * Handle Download State Change
- * @param aState new state of the download
- */
- virtual void handlePdlStateChange( int aState ) = 0;
-
- virtual void handleBufferingState();
-
- virtual void issuePlayCommand();
-
- void initializeVideoPlaybackView();
-
- void showDialog( const QString& qString, bool closeView = true );
-
- virtual void handleClosePlaybackView();
-
- RWindow *getWindow();
-
- bool eventFilter( QObject *object, QEvent *event );
-
- void gestureEvent( QGestureEvent* event );
-
- private:
-
- void saveActivityData();
-
- protected: // data
- CMPXVideoViewWrapper *mVideoMpxWrapper;
-
- QTimer *mTimerForClosingView;
-
- bool mActivated;
- bool mSyncClose;
- int mLastPlayPosition;
- bool mStayPaused;
-
- public:
- friend class CMPXVideoViewWrapper;
-};
-
-#endif // __HBVIDEOBASEPLAYBACKVIEW_H__
-
-// EOF
--- a/videoplayback/inc/hbvideoplaybackview.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +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: hb videoplaybackview
-*
-*/
-
-// Version : %version: da1mmcf#4 %
-
-
-
-#ifndef __HBVIDEOPLAYBACKVIEW_H__
-#define __HBVIDEOPLAYBACKVIEW_H__
-
-// Include Files
-#include "hbvideobaseplaybackview.h"
-#include "videoplaybackexport.h"
-
-
-/**
- * HbVideoPlaybackView
- *
- */
-class VIDEOPLAYBACK_DLL_EXPORT HbVideoPlaybackView : public HbVideoBasePlaybackView
-{
- Q_OBJECT
-
- public:
- HbVideoPlaybackView();
- virtual ~HbVideoPlaybackView();
-
- void handleActivateView();
-
- void handleDeactivateView();
-
- void handleBack();
-
- private:
-
- virtual void handleSoftkeyBack();
-
- virtual void handlePluginError( int aError );
-
- /*
- * Handle Download State Change
- * @param aState new state of the download
- */
- virtual void handlePdlStateChange( int aState );
-
- /*
- * Handle transition to the stopped state
- */
- virtual void handleStoppedState();
-};
-
-#endif // __HBVIDEOPLAYBACKVIEW_H__
-
-// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/inc/videobaseplaybackview.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,124 @@
+/*
+* 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: MPX Video base playback view
+*
+*/
+
+// Version : %version: da1mmcf#19 %
+
+
+
+// This file defines the API for .dll
+
+#ifndef __VIDEOBASEPLAYBACKVIEW_H__
+#define __VIDEOBASEPLAYBACKVIEW_H__
+
+// Include Files
+#include <hbview.h>
+
+// Constants
+
+// Forward Declarations
+class QTimer;
+class RWindow;
+class CMPXVideoViewWrapper;
+
+
+// Class Definitions
+
+class VideoBasePlaybackView : public HbView
+{
+ Q_OBJECT
+
+ public:
+ VideoBasePlaybackView();
+ virtual ~VideoBasePlaybackView();
+
+ signals:
+ void activatePreviousView();
+ void tappedOnScreen();
+ void pannedToRight();
+ void pannedToLeft();
+
+ public slots:
+ virtual void closePlaybackView();
+
+ protected slots:
+ void handleClosePopupDialog();
+
+ public:
+
+ virtual void retrievePdlInformation();
+
+ virtual void handleActivateView();
+
+ virtual void handleDeactivateView();
+
+ virtual void handlePluginError( int aError );
+
+ /*
+ * Handle transition to the stopped state
+ */
+ virtual void handleStoppedState() = 0;
+
+ virtual void doClosePlayer();
+
+ //
+ // Function the derived classes must implement
+ //
+ virtual void handleSoftkeyBack() = 0;
+
+ /*
+ * Handle Download State Change
+ * @param aState new state of the download
+ */
+ virtual void handlePdlStateChange( int aState ) = 0;
+
+ virtual void handleBufferingState();
+
+ virtual void issuePlayCommand();
+
+ void initializeVideoPlaybackView();
+
+ void showDialog( const QString& qString, bool closeView = true );
+
+ virtual void handleClosePlaybackView();
+
+ RWindow *getWindow();
+
+ bool eventFilter( QObject *object, QEvent *event );
+
+ void gestureEvent( QGestureEvent* event );
+
+ private:
+
+ void saveActivityData();
+
+ protected: // data
+ CMPXVideoViewWrapper *mVideoMpxWrapper;
+
+ QTimer *mTimerForClosingView;
+
+ bool mActivated;
+ bool mSyncClose;
+ int mLastPlayPosition;
+ bool mStayPaused;
+
+ public:
+ friend class CMPXVideoViewWrapper;
+};
+
+#endif // __VIDEOBASEPLAYBACKVIEW_H__
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/inc/videoplaybackview.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,68 @@
+/*
+* 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: videoplaybackview
+*
+*/
+
+// Version : %version: da1mmcf#5 %
+
+
+
+#ifndef __VIDEOPLAYBACKVIEW_H__
+#define __VIDEOPLAYBACKVIEW_H__
+
+// Include Files
+#include "videobaseplaybackview.h"
+#include "videoplaybackexport.h"
+
+
+/**
+ * VideoPlaybackView
+ *
+ */
+class VIDEOPLAYBACK_DLL_EXPORT VideoPlaybackView : public VideoBasePlaybackView
+{
+ Q_OBJECT
+
+ public:
+ VideoPlaybackView();
+ virtual ~VideoPlaybackView();
+
+ void handleActivateView();
+
+ void handleDeactivateView();
+
+ void handleBack();
+
+ private:
+
+ virtual void handleSoftkeyBack();
+
+ virtual void handlePluginError( int aError );
+
+ /*
+ * Handle Download State Change
+ * @param aState new state of the download
+ */
+ virtual void handlePdlStateChange( int aState );
+
+ /*
+ * Handle transition to the stopped state
+ */
+ virtual void handleStoppedState();
+};
+
+#endif // __VIDEOPLAYBACKVIEW_H__
+
+// EOF
--- a/videoplayback/videohelix/group/mpxvideohelixplayback.mmp Fri Jul 02 17:14:33 2010 +0300
+++ b/videoplayback/videohelix/group/mpxvideohelixplayback.mmp Thu Jul 08 13:05:19 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 17 %
+// Version : %version: ou1cpsw#18 %
@@ -55,6 +55,8 @@
APP_LAYER_SYSTEMINCLUDE
SYSTEMINCLUDE /epoc32/include/ecom
+SMPSAFE
+
LIBRARY apgrfx.lib
LIBRARY apmime.lib
LIBRARY ecom.lib
--- a/videoplayback/videohelix/src/mpxvideoplaybackstate.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videoplayback/videohelix/src/mpxvideoplaybackstate.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -16,7 +16,7 @@
*/
-// Version : %version: 47 %
+// Version : %version: 48 %
//
@@ -177,7 +177,7 @@
// ------------------------------------------------------------------------------------------------
void CMPXVideoPlaybackState::HandleSetPosterFrame()
{
- MPX_DEBUG(_L("CMPXVideoPlaybackState::HandleSetPosterFrame()"));
+ MPX_DEBUG(_L("CMPXVideoPlaybackState::HandleSetPosterFrame()"));
}
// ------------------------------------------------------------------------------------------------
@@ -239,10 +239,10 @@
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackState::HandlePlaybackComplete()"),
_L("error = %d"), aError );
+ iVideoPlaybackCtlr->ChangeState( EMPXVideoStopped );
+
if ( aError == KErrNone )
{
- iVideoPlaybackCtlr->ChangeState( EMPXVideoStopped );
-
iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent(
MMPXPlaybackPluginObserver::EPPlayComplete,
0,
@@ -1387,8 +1387,8 @@
void CMPXPlayingState::HandleSetPosterFrame()
{
MPX_DEBUG(_L("CMPXPlayingState::HandleSetPosterFrame()"));
-
- iVideoPlaybackCtlr->iPlaybackMode->HandleSetPosterFrame();
+
+ iVideoPlaybackCtlr->iPlaybackMode->HandleSetPosterFrame();
}
@@ -1552,8 +1552,8 @@
// ------------------------------------------------------------------------------------------------
void CMPXPausedState::HandleSetPosterFrame()
{
- MPX_DEBUG(_L("CMPXPausedState::HandleSetPosterFrame()"));
-
+ MPX_DEBUG(_L("CMPXPausedState::HandleSetPosterFrame()"));
+
iVideoPlaybackCtlr->iPlaybackMode->HandleSetPosterFrame();
}
@@ -1650,8 +1650,8 @@
}
else
{
- // As the custom play command could not resume the playback. Send a pause event to
- // the view though the MPX FW to get the view state in sync playback plugin.
+ // As the custom play command could not resume the playback. Send a pause event to
+ // the view though the MPX FW to get the view state in sync playback plugin.
iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPPaused,
0,
KErrNone );
--- a/videoplayback/videohelix/tsrc/ut_videohelixtest/src/videohelixtestbody.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/src/videohelixtestbody.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: e003sa33#24.1.1 %
+// Version : %version: 26 %
// [INCLUDE FILES] - do not remove
@@ -120,9 +120,8 @@
ENTRY ("InitializeWithPositionL", CVHPPTestClass::InitializeWithPositionL),
ENTRY ("InitializeLinkWithPositionL", CVHPPTestClass::InitializeLinkWithPositionL),
ENTRY ("InitializeHandleWithPositionL", CVHPPTestClass::InitializeHandleWithPositionL),
- ENTRY ( "InitializeStreamingWithSdpFileHandleL",
- CVHPPTestClass::InitializeStreamingWithSdpFileHandleL ),
- ENTRY ( "RetrieveFileNameAndModeL", CVHPPTestClass::RetrieveFileNameAndModeL )
+ ENTRY ( "InitializeStreamingWithSdpFileHandleL", CVHPPTestClass::InitializeStreamingWithSdpFileHandleL ),
+ ENTRY ( "RetrieveFileNameAndModeL", CVHPPTestClass::RetrieveFileNameAndModeL )
//
// ADD NEW ENTRIES HERE
@@ -290,7 +289,7 @@
TInt duration;
TInt volumeSteps;
-
+
TInt err = aItem.GetNextInt( duration );
if ( err == KErrNone )
@@ -306,32 +305,32 @@
AddExpectedEvent( event );
- //
+ //
// read number of volume steps
//
err = aItem.GetNextInt( volumeSteps );
-
+
if ( err == KErrNone )
- {
+ {
//
// set volume steps
//
SetVolumeSteps( volumeSteps );
-
- TBuf<120> fullPath;
+
+ TBuf<120> fullPath;
err = ReadFileInitializationParameters( aItem, fullPath );
-
+
if ( err == KErrNone )
{
PreparePluginL();
-
+
//
// Initalize the Plugin with a file name
//
MPX_DEBUG(_L("Initialize the Plugin: filename = %S"), &fullPath);
iLog->Log(_L("Initialize the Plugin: filename = %S"), &fullPath);
-
+
iPlaybackPlugin->InitialiseL( fullPath );
}
}
@@ -368,40 +367,40 @@
AddExpectedEvent( event );
- //
+ //
// read number of volume steps
//
err = aItem.GetNextInt( volumeSteps );
-
+
if ( err == KErrNone )
- {
+ {
//
// set volume steps
//
SetVolumeSteps( volumeSteps );
-
+
TPtrC link;
-
+
//
// Read in the link from the config file
//
TInt err = aItem.GetNextString( link );
-
+
if ( err == KErrNone )
{
TInt err = ReadInitializationErrors( aItem );
-
+
if ( err == KErrNone )
{
PreparePluginL();
-
+
//
// Extract the streaming link from the ram file and
// Initalize the Plugin with the link and an access point
//
MPX_DEBUG(_L("Initialize the Plugin: link = %S"), &link);
iLog->Log(_L("Initialize the Plugin: link = %S"), &link);
-
+
iPlaybackPlugin->InitStreamingL( link, KNullDesC8, 11 );
}
}
@@ -463,57 +462,57 @@
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();
-
+
RFs fs;
TInt error = fs.Connect();
-
+
//
// Open a file handle to the clip
//
@@ -533,18 +532,18 @@
file64.Close();
}
#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
-
+
//
// Initalize the Plugin with a file name
//
MPX_DEBUG(_L("Initialize the Plugin with File Handle: filename = %S"), &fullPath);
iLog->Log(_L("Initialize the Plugin with File Handle: filename = %S"), &fullPath);
-
+
fs.Close();
}
- }
- }
- }
+ }
+ }
+ }
return err;
}
@@ -891,14 +890,14 @@
event->iError = KErrNone;
AddExpectedEvent( event );
}
- else
- {
- event->iEvent = EPSetComplete;
- event->iData = property;
- event->iError = KErrNone;
- AddExpectedEvent( event );
- }
-
+ else
+ {
+ event->iEvent = EPSetComplete;
+ event->iData = property;
+ event->iError = KErrNone;
+ AddExpectedEvent( event );
+ }
+
}
TRAP( err, iPlaybackPlugin->SetL( (TMPXPlaybackProperty)property, value ) );
@@ -1147,9 +1146,9 @@
iLog->Log(_L("CVHPPTestClass::ConnectToDownloadL()"));
TInt err = KErrNone;
-
-#ifdef USE_S60_DOWNLOAD_MANAGER
-
+
+#ifdef USE_S60_DOWNLOAD_MANAGER
+
iDlMgrTester = CDlMgrTestClass::NewL();
iDlMgrTester->AddStifObserver( this );
@@ -1196,17 +1195,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
+
+#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;
}
@@ -1220,7 +1219,7 @@
MPX_ENTER_EXIT(_L("CVHPPTestClass::SendPdlCustomCommandL"),
_L("aCustomCmd = %d"), aCustomCmd );
-#ifdef USE_S60_DOWNLOAD_MANAGER
+#ifdef USE_S60_DOWNLOAD_MANAGER
CMPXCommand* cmd = CMPXCommand::NewL();
CleanupStack::PushL( cmd );
@@ -1232,12 +1231,12 @@
iPlaybackPlugin->CommandL( *cmd );
CleanupStack::PopAndDestroy( cmd );
-
-#else // USE_S60_DOWNLOAD_MANAGER
-
- // Signal TestScripter to continue from waittestclass
+
+#else // USE_S60_DOWNLOAD_MANAGER
+
+ // Signal TestScripter to continue from waittestclass
Signal();
-
+
#endif // USE_S60_DOWNLOAD_MANAGER
}
@@ -1252,8 +1251,8 @@
MPX_ENTER_EXIT(_L("CVHPPTestClass::PauseDownloadL()"));
iLog->Log(_L("CVHPPTestClass::PauseDownloadL()"));
-#ifdef USE_S60_DOWNLOAD_MANAGER
-
+#ifdef USE_S60_DOWNLOAD_MANAGER
+
TCallbackEvent* event = new TCallbackEvent;
event->iEvent = EPDownloadStateChanged;
@@ -1263,14 +1262,14 @@
AddExpectedEvent( event );
iDlMgrTester->PauseDownload();
-
-#else // USE_S60_DOWNLOAD_MANAGER
-
- // Signal TestScripter to continue from waittestclass
+
+#else // USE_S60_DOWNLOAD_MANAGER
+
+ // Signal TestScripter to continue from waittestclass
Signal();
-
-#endif // USE_S60_DOWNLOAD_MANAGER
-
+
+#endif // USE_S60_DOWNLOAD_MANAGER
+
return KErrNone;
}
@@ -1285,9 +1284,9 @@
iLog->Log(_L("CVHPPTestClass::ResumeDownloadL()"));
TInt err = KErrNone;
-
-#ifdef USE_S60_DOWNLOAD_MANAGER
-
+
+#ifdef USE_S60_DOWNLOAD_MANAGER
+
TInt dlSize;
err = aItem.GetNextInt( dlSize );
@@ -1314,17 +1313,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
+
+#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
-
+
+#endif // USE_S60_DOWNLOAD_MANAGER
+
return err;
}
@@ -1338,8 +1337,8 @@
MPX_ENTER_EXIT(_L("CVHPPTestClass::CancelDownloadL()"));
iLog->Log(_L("CVHPPTestClass::CancelDownloadL()"));
-#ifdef USE_S60_DOWNLOAD_MANAGER
-
+#ifdef USE_S60_DOWNLOAD_MANAGER
+
TCallbackEvent* event = new TCallbackEvent;
event->iEvent = EPDownloadStateChanged;
@@ -1350,13 +1349,13 @@
iDlMgrTester->CancelDownload();
-#else // USE_S60_DOWNLOAD_MANAGER
-
- // Signal TestScripter to continue from waittestclass
+#else // USE_S60_DOWNLOAD_MANAGER
+
+ // Signal TestScripter to continue from waittestclass
Signal();
-
-#endif // USE_S60_DOWNLOAD_MANAGER
-
+
+#endif // USE_S60_DOWNLOAD_MANAGER
+
return KErrNone;
}
@@ -1371,9 +1370,9 @@
iLog->Log(_L("CVHPPTestClass::RetrievePdlStatusL()"));
TInt err = KErrNone;
-
-#ifdef USE_S60_DOWNLOAD_MANAGER
-
+
+#ifdef USE_S60_DOWNLOAD_MANAGER
+
TInt pdlState;
TInt expectedPdlState;
TInt downloadedBytes;
@@ -1432,16 +1431,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
+#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
-
+
+#endif // USE_S60_DOWNLOAD_MANAGER
+
return err;
}
@@ -1623,7 +1622,7 @@
CVHPPTestClass::ProcessEvent( TCallbackEvent* aCallback )
{
MPX_ENTER_EXIT(_L("CVHPPTestClass::ProcessEvent"));
-
+
if ( iExpectedCallbackArray->Count() > 0 )
{
TCallbackEvent* expectedCallback = (*iExpectedCallbackArray)[0];
@@ -2027,7 +2026,14 @@
event->iError = KErrNone;
AddExpectedEvent( event );
-
+
+ event = new TCallbackEvent;
+ event->iEvent = EPPaused;
+ event->iData = 0;
+ event->iError = KErrNone;
+
+ AddExpectedEvent( event );
+
iAccObserver->UpdateTvOutStatusL( EFalse );
return KErrNone;
@@ -2121,69 +2127,69 @@
return err;
}
-// -----------------------------------------------------------------------------
-// CVHPPTestClass::SetVolumeSteps
-// -----------------------------------------------------------------------------
-//
-TInt
-CVHPPTestClass::SetVolumeSteps( TInt aVolumeSteps )
-{
- MPX_ENTER_EXIT(_L("CVHPPTestClass::SetVolumeSteps()"));
- iLog->Log(_L("CVHPPTestClass::SetVolumeSteps()"));
-
+// -----------------------------------------------------------------------------
+// CVHPPTestClass::SetVolumeSteps
+// -----------------------------------------------------------------------------
+//
+TInt
+CVHPPTestClass::SetVolumeSteps( TInt aVolumeSteps )
+{
+ MPX_ENTER_EXIT(_L("CVHPPTestClass::SetVolumeSteps()"));
+ iLog->Log(_L("CVHPPTestClass::SetVolumeSteps()"));
+
iPlayerUtility->SetVolumeSteps( aVolumeSteps );
-
- return KErrNone;
-}
-
-// -----------------------------------------------------------------------------
-// CVHPPTestClass::HandleVolumeL
-// -----------------------------------------------------------------------------
-//
-TInt
-CVHPPTestClass::HandleVolumeL( CStifItemParser& aItem )
-{
- MPX_ENTER_EXIT(_L("CVHPPTestClass::HandleVolumeL()"));
- iLog->Log(_L("CVHPPTestClass::HandleVolumeL()"));
-
- TInt command;
- TInt value;
-
+
+ return KErrNone;
+}
+
+// -----------------------------------------------------------------------------
+// CVHPPTestClass::HandleVolumeL
+// -----------------------------------------------------------------------------
+//
+TInt
+CVHPPTestClass::HandleVolumeL( CStifItemParser& aItem )
+{
+ MPX_ENTER_EXIT(_L("CVHPPTestClass::HandleVolumeL()"));
+ iLog->Log(_L("CVHPPTestClass::HandleVolumeL()"));
+
+ TInt command;
+ TInt value;
+
TInt err = aItem.GetNextInt( command );
if ( err == KErrNone )
{
err = aItem.GetNextInt( value );
- if ( err == KErrNone )
- {
- //
- // assign callback event values
- //
- TCallbackEvent* event = new TCallbackEvent;
- event->iEvent = EPVolumeChanged;
- event->iData = value;
- event->iError = KErrNone;
-
- //
- // save expected result to be compared later
- //
- AddExpectedEvent( event );
-
+ if ( err == KErrNone )
+ {
+ //
+ // assign callback event values
+ //
+ TCallbackEvent* event = new TCallbackEvent;
+ event->iEvent = EPVolumeChanged;
+ event->iData = value;
+ event->iError = KErrNone;
+
+ //
+ // save expected result to be compared later
+ //
+ AddExpectedEvent( event );
+
//
// send command to playback plugin
//
- CreateVideoPlaybackCommandL( aItem, (TMPXVideoPlaybackCommand)command );
- }
+ CreateVideoPlaybackCommandL( aItem, (TMPXVideoPlaybackCommand)command );
+ }
}
-
+
if ( err == KErrNone )
{
MPX_DEBUG(_L("CVHPPTestClass::HandleVolumeL() leaves with proper error"));
}
-
- return err;
-}
+
+ return err;
+}
TInt
@@ -2195,7 +2201,7 @@
TInt duration;
TInt volumeSteps;
TInt position;
-
+
TInt err = aItem.GetNextInt( duration );
if ( err == KErrNone )
@@ -2211,36 +2217,36 @@
AddExpectedEvent( event );
- //
+ //
// read number of volume steps
//
err = aItem.GetNextInt( volumeSteps );
-
+
if ( err == KErrNone )
- {
+ {
//
// set volume steps
//
SetVolumeSteps( volumeSteps );
-
+
err = aItem.GetNextInt( position );
-
+
if (err == KErrNone )
{
- TBuf<120> fullPath;
+ TBuf<120> fullPath;
err = ReadFileInitializationParameters( aItem, fullPath );
-
+
if ( err == KErrNone )
{
PreparePluginL();
-
+
//
// Initalize the Plugin with a file name
//
MPX_DEBUG(_L("Initialize the Plugin: filename = %S, position = %d"), &fullPath, position);
iLog->Log(_L("Initialize the Plugin: filename = %S, position = %d"), &fullPath, position);
-
+
iPlaybackPlugin->InitialiseWithPositionL( fullPath, position );
}
@@ -2261,7 +2267,7 @@
TInt duration;
TInt volumeSteps;
TInt position;
-
+
TInt err = aItem.GetNextInt( duration );
if ( err == KErrNone )
@@ -2277,44 +2283,44 @@
AddExpectedEvent( event );
- //
+ //
// read number of volume steps
//
err = aItem.GetNextInt( volumeSteps );
-
+
if ( err == KErrNone )
- {
+ {
//
// set volume steps
//
SetVolumeSteps( volumeSteps );
-
+
err = aItem.GetNextInt( position );
-
+
if ( err == KErrNone )
{
TPtrC link;
-
+
//
// Read in the link from the config file
//
TInt err = aItem.GetNextString( link );
-
+
if ( err == KErrNone )
{
TInt err = ReadInitializationErrors( aItem );
-
+
if ( err == KErrNone )
{
PreparePluginL();
-
+
//
// Extract the streaming link from the ram file and
// Initalize the Plugin with the link and an access point
//
MPX_DEBUG(_L("Initialize the Plugin: link = %S, position = %d"), &link, position);
iLog->Log(_L("Initialize the Plugin: link = %S, position = %d"), &link, position);
-
+
iPlaybackPlugin->InitStreamingL( link, KNullDesC8, 11, position );
}
}
@@ -2336,41 +2342,41 @@
TInt volumeSteps;
TInt position;
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
//
@@ -2381,16 +2387,16 @@
if (err == KErrNone )
{
TBuf<120> fullPath;
-
+
err = ReadFileInitializationParameters( aItem, fullPath );
-
+
if ( err == KErrNone )
{
PreparePluginL();
-
+
RFs fs;
TInt error = fs.Connect();
-
+
//
// Open a file handle to the clip
//
@@ -2410,20 +2416,20 @@
file64.Close();
}
#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
-
+
//
// Initalize the Plugin with a file name
//
MPX_DEBUG(_L("Initialize the Plugin with File Handle: filename = %S, position = %d"), &fullPath, position);
iLog->Log(_L("Initialize the Plugin with File Handle: filename = %S, position = %d"), &fullPath, position);
-
+
fs.Close();
}
- }
-
- }
- }
- }
+ }
+
+ }
+ }
+ }
return err;
}
@@ -2437,97 +2443,97 @@
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();
- }
+ 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();
- }
+ 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();
+
+ fs.Close();
}
- }
- }
- }
+ }
+ }
+ }
return err;
}
@@ -2537,10 +2543,10 @@
MPX_ENTER_EXIT( _L("CVHPPTestClass::RetrieveFileNameAndModeL()") );
iLog->Log( _L("CVHPPTestClass::RetrieveFileNameAndModeL()") );
- TBuf<120> fullPath;
- TPtrC fileName;
- TInt err;
-
+ TBuf<120> fullPath;
+ TPtrC fileName;
+ TInt err;
+
err = aItem.GetNextString( fileName );
if ( err == KErrNone )
@@ -2550,38 +2556,38 @@
//
fullPath.Append( KVideoTestPath );
fullPath.Append( fileName );
-
+
TInt mode;
err = aItem.GetNextInt( mode);
-
+
if ( err == KErrNone )
{
- CMPXCommand* cmd = CMPXCommand::NewL();
- CleanupStack::PushL( cmd );
-
- cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
- cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId,
- KMPXMediaIdVideoPlayback );
- cmd->SetTObjectValueL<TInt>( KMPXMediaVideoPlaybackCommand, EPbCmdInitView );
-
- iPlaybackPlugin->CommandL( *cmd );
-
- TPtrC clipName( cmd->ValueText( KMPXMediaVideoPlaybackFileName ) );
- TMPXVideoMode playbackMode = (TMPXVideoMode) cmd->ValueTObjectL<TInt>( 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 );
+ CMPXCommand* cmd = CMPXCommand::NewL();
+ CleanupStack::PushL( cmd );
+
+ cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
+ cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId,
+ KMPXMediaIdVideoPlayback );
+ cmd->SetTObjectValueL<TInt>( KMPXMediaVideoPlaybackCommand, EPbCmdInitView );
+
+ iPlaybackPlugin->CommandL( *cmd );
+
+ TPtrC clipName( cmd->ValueText( KMPXMediaVideoPlaybackFileName ) );
+ TMPXVideoMode playbackMode = (TMPXVideoMode) cmd->ValueTObjectL<TInt>( 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 );
}
}
--- a/videoplayback/videoplayback.pro Fri Jul 02 17:14:33 2010 +0300
+++ b/videoplayback/videoplayback.pro Thu Jul 08 13:05:19 2010 +0300
@@ -14,11 +14,11 @@
# Description: Project file for building Videoplayer components
#
#
-# Version : %version: da1mmcf#4 %
+# Version : %version: da1mmcf#5 %
TEMPLATE = subdirs
CONFIG += ordered
-SUBDIRS += hbvideoplaybackview \
- hbvideoplaybackviewplugin
+SUBDIRS += videoplaybackview \
+ videoplaybackviewplugin
BLD_INF_RULES.prj_mmpfiles += $$LITERAL_HASH"include \"videohelix/group/bld.inf\""
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/controlinc/videoplaybackcontrol.hrh Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,103 @@
+/*
+* 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 VideoPlaybackControl
+*
+*/
+
+// Version : %version: 8 %
+
+
+#ifndef VIDEOPLAYBACKCONTROL_HRH_
+#define VIDEOPLAYBACKCONTROL_HRH_
+
+// DATA TYPES
+
+enum TVideoPlaybackControlProperties
+{
+ EShownWhenInitializing = 0x1,
+ EShownWhenBuffering = 0x2,
+ EShownWhenPlaying = 0x4,
+ EShownWhenPaused = 0x8,
+ EShownWhenSeeking = 0x10,
+ EAllProperties = 0xffffffff
+};
+
+enum TVideoPlaybackControls
+{
+ EStatusPane,
+ EControlBar,
+
+ // Only for streaming case
+ // Can handle from NotInitilized state
+ //
+ EBufferingAnimation,
+
+ //
+ // For details view and audio only view
+ //
+ EFileDetailsWidget,
+
+ //
+ // For details view
+ //
+ EDetailsViewPlaybackWindow,
+
+ //
+ // Bitmaps
+ //
+ EIndicatorBitmap,
+ ERealLogoBitmap,
+
+ EDownloadPausedIcon,
+
+ EControlsCount // has to be last
+};
+
+/** Command ID's. */
+enum TVideoPlaybackControlCommandIds
+{
+ EControlCmdPluginInitialized,
+ EControlCmdTvOutConnected,
+ EControlCmdTvOutDisconnected,
+ EControlCmdSetAspectRatio,
+ EControlCmdSetVolume,
+ EControlCmdSetDuration,
+ EControlCmdSetPosition,
+ EControlCmdStateChanged,
+ EControlCmdDownloadUpdated,
+ EControlCmdSetDownloadSize,
+ EControlCmdDownloadComplete,
+ EControlCmdSetDownloadPaused,
+ EControlCmdClearDownloadPaused,
+ EControlCmdHandleBackgroundEvent,
+ EControlCmdHandleForegroundEvent,
+ EControlCmdHandleErrors,
+ EControlCmdShowVolumeControls,
+ EControlCmdSoftKeyPressed,
+ EControlCmdFullScreenViewOpened,
+ EControlCmdDetailsViewOpened,
+ EControlCmdAudionOnlyViewOpened,
+ EControlCmdRemoveRNLogo
+};
+
+enum TVideoUserInputType
+{
+ EVideoKeyboard,
+ EVideoTouch,
+ EVideoMediaKeys,
+ EVideoSpecialHWKeys,
+ EVideoNone
+};
+
+#endif /*VIDEOPLAYBACKCONTROL_HRH_*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/controlinc/videoplaybackcontrolbar.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,55 @@
+/*
+* 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 VideoPlaybackControlBar
+*
+*/
+
+// Version : %version: 4 %
+
+
+
+#ifndef VIDEOPLAYBACKCONTROLBAR_H_
+#define VIDEOPLAYBACKCONTROLBAR_H_
+
+
+#include <hbwidget.h>
+#include <mpxplaybackframeworkdefs.h>
+
+class VideoPlaybackToolBar;
+class VideoPlaybackProgressBar;
+class VideoPlaybackViewFileDetails;
+class VideoPlaybackControlsController;
+
+class VideoPlaybackControlBar : public HbWidget
+{
+ Q_OBJECT
+
+ public:
+ VideoPlaybackControlBar( VideoPlaybackControlsController* controller );
+ virtual ~VideoPlaybackControlBar();
+ void updateState( TMPXPlaybackState state );
+ void aspectRatioChanged( int aspectRatio );
+ void initialize();
+ void updateWithFileDetails( VideoPlaybackViewFileDetails* details );
+ void setVisibleToControlBar( bool visible );
+ void durationChanged( int duration );
+ void positionChanged( int position );
+
+ private:
+ VideoPlaybackControlsController *mController;
+ VideoPlaybackToolBar *mToolBar;
+ VideoPlaybackProgressBar *mProgressBar;
+};
+
+#endif /*VIDEOPLAYBACKCONTROLBAR_H_*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/controlinc/videoplaybackcontrolconfiguration.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,93 @@
+/*
+* 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 VideoPlaybackControlConfiguration
+*
+*/
+
+// Version : %version: da1mmcf#8 %
+
+
+
+#ifndef VIDEOPLAYBACKCONTROLCONFIGURATION_H_
+#define VIDEOPLAYBACKCONTROLCONFIGURATION_H_
+
+// INCLUDES
+#include <QObject>
+
+#include "videoplaybackcontrol.hrh"
+#include "mpxhelixplaybackplugindefs.h"
+
+// FORWARD DECLARATIONS
+class VideoPlaybackControlsController;
+
+// DATA TYPES
+
+// CLASS DECLARATION
+class VideoPlaybackControlConfiguration : public QObject
+{
+ Q_OBJECT
+
+ public:
+
+ /**
+ * constructor.
+ */
+ VideoPlaybackControlConfiguration( VideoPlaybackControlsController* controller );
+
+ /**
+ * Destructor.
+ */
+ virtual ~VideoPlaybackControlConfiguration();
+
+ public:
+ /**
+ * Update control list
+ */
+ void updateControlList( TVideoPlaybackControlCommandIds event );
+
+ /**
+ * Return control list
+ */
+ QList<TVideoPlaybackControls>& controlList();
+
+ void updateControlsWithFileDetails();
+
+ /**
+ * Create control list
+ */
+ void createControlList();
+
+ private:
+
+ /**
+ * Delete controls from list
+ */
+ void deleteControlFromList( TVideoPlaybackControls control );
+
+ /**
+ * Add controls to list
+ */
+ void addControlToList( TVideoPlaybackControls control );
+
+ signals:
+ void controlListUpdated();
+
+ private:
+ VideoPlaybackControlsController *mControlsController;
+ QList<TVideoPlaybackControls> mControlsList;
+};
+
+#endif /*VIDEOPLAYBACKCONTROLCONFIGURATION_H_*/
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/controlinc/videoplaybackcontrolpolicy.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,65 @@
+/*
+* 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 VideoPlaybackControlPolicy
+*
+*/
+
+// Version : %version: da1mmcf#6 %
+
+
+
+#ifndef VIDEOPLAYBACKCONTROLPOLICY_H_
+#define VIDEOPLAYBACKCONTROLPOLICY_H_
+
+// INCLUDES
+#include <QObject>
+
+#include "videoplaybackcontrol.hrh"
+#include "videoplaybackcontrolscontroller.h"
+
+// FORWARD DECLARATIONS
+class VideoPlaybackViewFileDetails;
+
+// DATA TYPES
+
+// CLASS DECLARATION
+class VideoPlaybackControlPolicy : public QObject
+{
+ Q_OBJECT
+
+ public:
+
+ /**
+ * Two-phased constructor.
+ */
+ VideoPlaybackControlPolicy();
+
+ /**
+ * Destructor.
+ */
+ virtual ~VideoPlaybackControlPolicy();
+
+ public:
+ /**
+ * Sets the control properties per policy
+ */
+ void setControlProperties( TVideoPlaybackControls controlIndex,
+ TUint& properties,
+ VideoPlaybackViewFileDetails *details,
+ TPlaybackViewMode viewMode );
+};
+
+#endif /*VIDEOPLAYBACKCONTROLPOLICY_H_*/
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/controlinc/videoplaybackdetailsplaybackwindow.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,52 @@
+/*
+* 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 VideoPlaybackDetailsPlaybackWindow
+*
+*/
+
+// Version : %version: 9 %
+
+
+
+#ifndef VIDEOPLAYBACKDETAILSPLAYBACKWINDOW_H_
+#define VIDEOPLAYBACKDETAILSPLAYBACKWINDOW_H_
+
+#include <hbwidget.h>
+#include <mpxplaybackframeworkdefs.h>
+
+class HbPushButton;
+class VideoPlaybackControlsController;
+
+class VideoPlaybackDetailsPlaybackWindow : public HbWidget
+{
+ Q_OBJECT
+
+ public:
+ VideoPlaybackDetailsPlaybackWindow( VideoPlaybackControlsController* controller );
+ virtual ~VideoPlaybackDetailsPlaybackWindow();
+ void initialize();
+ void updateState( TMPXPlaybackState state );
+
+ private slots:
+ void play();
+
+ private:
+ VideoPlaybackControlsController *mController;
+ HbPushButton *mPlayButton;
+
+ bool mInitialized;
+};
+
+#endif /*VIDEOPLAYBACKDETAILSPLAYBACKWINDOW_H_*/
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/controlinc/videoplaybackdocumentloader.h Thu Jul 08 13:05:19 2010 +0300
@@ -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: Implementation of VideoPlaybackDocumentLoader
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+#ifndef VIDEOPLAYBACKDOCUMENTHANDLER_H_
+#define VIDEOPLAYBACKDOCUMENTHANDLER_H_
+
+#include <hbdocumentloader.h>
+
+class VideoPlaybackControlsController;
+
+class VideoPlaybackDocumentLoader : public HbDocumentLoader
+{
+ public:
+ VideoPlaybackDocumentLoader( VideoPlaybackControlsController *controller );
+
+ virtual ~VideoPlaybackDocumentLoader();
+
+ public:
+ virtual QObject *createObject( const QString& type, const QString &name ) ;
+
+ private:
+ VideoPlaybackControlsController *mController;
+};
+
+#endif /*VIDEOPLAYBACKDOCUMENTHANDLER_H_*/
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/controlinc/videoplaybackfiledetailswidget.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,58 @@
+/*
+* 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 VideoPlaybackFileDetailsWidget
+*
+*/
+
+// Version : %version: 12 %
+
+
+
+#ifndef VIDEOPLAYBACKFILEDETAILSWIDGET_H_
+#define VIDEOPLAYBACKFILEDETAILSWIDGET_H_
+
+#include <QObject>
+
+#include <hbwidget.h>
+
+class VideoPlaybackViewFileDetails;
+class VideoPlaybackControlsController;
+class HbListWidget;
+
+class VideoPlaybackFileDetailsWidget : public HbWidget
+{
+ Q_OBJECT
+
+ public:
+ VideoPlaybackFileDetailsWidget( VideoPlaybackControlsController* controller );
+ virtual ~VideoPlaybackFileDetailsWidget();
+
+ public:
+ void updateWithFileDetails( VideoPlaybackViewFileDetails* details );
+
+ private:
+ void makeTitleItem( VideoPlaybackViewFileDetails* details );
+ void makeSizeItem( VideoPlaybackViewFileDetails* details );
+ void makeBitRateItem( VideoPlaybackViewFileDetails* details );
+ void makeDateTimeItem( VideoPlaybackViewFileDetails* details );
+ void addItemToListWidget( QString item, QString text );
+
+ private:
+ VideoPlaybackControlsController *mController;
+ HbListWidget *mListWidget;
+ bool mFileDetailsUpdated;
+};
+
+#endif /*VIDEOPLAYBACKFILEDETAILSWIDGET_H_*/
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/controlinc/videoplaybackfullscreencontrol.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,108 @@
+/*
+* 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 VideoPlaybackFullScreenControl
+*
+*/
+
+// Version : %version: da1mmcf#9 %
+
+
+
+#ifndef VIDEOPLAYBACKFULLSCREENCONTROL_H_
+#define VIDEOPLAYBACKFULLSCREENCONTROL_H_
+
+#include <QObject>
+
+#include <videoplaybackcontrol.hrh>
+#include <mpxplaybackframeworkdefs.h>
+
+class HbWidget;
+class VideoPlaybackViewFileDetails;
+class VideoPlaybackControlsController;
+
+class VideoPlaybackFullScreenControl : public QObject
+{
+ Q_OBJECT
+
+ public:
+ VideoPlaybackFullScreenControl( VideoPlaybackControlsController* controller,
+ TVideoPlaybackControls index,
+ HbWidget* widget,
+ TUint controlproperties );
+
+ virtual ~VideoPlaybackFullScreenControl();
+
+ public:
+
+ /**
+ * Set visibility of each control
+ */
+ virtual void setVisibility( TMPXPlaybackState aState );
+
+ /**
+ * return control index
+ */
+ TVideoPlaybackControls controlIndex();
+
+ /**
+ * set changed duration
+ */
+ bool durationChanged( int duration );
+
+ /**
+ * set changed volume
+ */
+ bool positionChanged( int position );
+
+ /**
+ * Set changed position
+ */
+ bool aspectRatioChanged( int aspectRatio );
+
+ /**
+ * set changed volume
+ */
+ bool setDownloadSize( int size );
+
+ /**
+ * set changed state
+ */
+ void updateState( TMPXPlaybackState state );
+
+ /*
+ * UpdateDownloadPosition
+ * updates the download ratio on the progress bar
+ */
+ bool updateDownloadPosition( int size );
+
+ /*
+ * Update the controls with the file details
+ */
+ virtual void updateControlsWithFileDetails( VideoPlaybackViewFileDetails *details );
+
+ virtual void setVisible( bool visible );
+
+ virtual bool isVisible();
+
+ virtual void updateControlProperties( TUint properties );
+
+ protected:
+ VideoPlaybackControlsController* mController;
+ HbWidget *mControl;
+ TVideoPlaybackControls mControlIndex;
+ TUint mProperties;
+};
+
+#endif /*VIDEOPLAYBACKFULLSCREENCONTROL_H_*/
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/controlinc/videoplaybackprogressbar.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,77 @@
+/*
+* 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 VideoPlaybackProgressBar
+*
+*/
+
+// Version : %version: da1mmcf#15 %
+
+
+
+#ifndef VIDEOPLAYBACKPROGRESSBAR_H_
+#define VIDEOPLAYBACKPROGRESSBAR_H_
+
+#include <QObject>
+#include <mpxplaybackframeworkdefs.h>
+
+class QTimer;
+class HbProgressSlider;
+class VideoPlaybackViewFileDetails;
+class VideoPlaybackControlsController;
+
+class VideoPlaybackProgressBar : public QObject
+{
+ Q_OBJECT
+
+ public:
+ VideoPlaybackProgressBar( VideoPlaybackControlsController* controller );
+ virtual ~VideoPlaybackProgressBar();
+ void initialize();
+ void updateWithFileDetails( VideoPlaybackViewFileDetails* details );
+ void updateState( TMPXPlaybackState state );
+
+ public:
+ void durationChanged( int duration );
+ void positionChanged( int position );
+
+ private slots:
+ void handleSliderPressed();
+ void handleSliderMoved( int value );
+ void handleSliderReleased();
+ void handleSeekingTimeout();
+
+ private:
+ QString valueToReadableFormat( int value );
+ void updatePostion( int position );
+ void setEnableProgressSlider( bool enable );
+
+ private:
+ VideoPlaybackControlsController *mController;
+ HbProgressSlider *mProgressSlider;
+
+ int mDuration;
+ int mDraggingPosition;
+ int mSetPosition;
+
+ bool mNeedToResumeAfterSetPosition;
+ bool mInitialized;
+ bool mSliderDragging;
+ bool mLongTimeFormat;
+ bool mLiveStreaming;
+
+ QTimer *mSeekingTimer;
+};
+
+#endif /*VIDEOPLAYBACKPROGRESSBAR_H_*/
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/controlinc/videoplaybackstatuspanecontrol.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,82 @@
+/*
+* 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 VideoPlaybackStatusPaneControl
+*
+*/
+
+// Version : %version: 11 %
+
+
+
+#ifndef VIDEOPLAYBACKSTATUSPANECONTROL_H_
+#define VIDEOPLAYBACKSTATUSPANECONTROL_H_
+
+
+#include "videoplaybackfullscreencontrol.h"
+
+
+class HbLabel;
+class HbAction;
+class HbGroupBox;
+class QGraphicsWidget;
+class VideoPlaybackViewFileDetails;
+class VideoPlaybackControlsController;
+
+class VideoPlaybackStatusPaneControl : public VideoPlaybackFullScreenControl
+{
+ Q_OBJECT
+
+ public:
+ VideoPlaybackStatusPaneControl( VideoPlaybackControlsController* controller,
+ TVideoPlaybackControls index,
+ HbWidget* widget,
+ TUint controlproperties );
+
+ virtual ~VideoPlaybackStatusPaneControl();
+
+ public:
+
+ /**
+ * Set visibility of each control
+ */
+ void setVisibility( TMPXPlaybackState aState );
+
+ /*
+ * Update the controls with the file details
+ */
+ void updateControlsWithFileDetails( VideoPlaybackViewFileDetails *details );
+
+ void setVisible( bool visible );
+
+ bool isVisible();
+
+ void setMenu( VideoPlaybackViewFileDetails* details );
+
+ void controlListUpdated( VideoPlaybackViewFileDetails* details );
+
+ private slots:
+ void handleAboutToShow();
+ void handleAboutToHide();
+ void openFullScreenView();
+
+ private:
+ bool mVisible;
+ HbAction *mActionBack;
+ HbLabel *mTitleLabel;
+ HbGroupBox *mTitleGroupBox;
+ QGraphicsWidget *mTitleLayout;
+};
+
+#endif /*VIDEOPLAYBACKSTATUSPANECONTROL_H_*/
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/controlinc/videoplaybacktoolbar.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,123 @@
+/*
+* 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 VideoPlaybackToolBar
+*
+*/
+
+// Version : %version: 4 %
+
+
+
+#ifndef VIDEOPLAYBACKTOOLBAR_H_
+#define VIDEOPLAYBACKTOOLBAR_H_
+
+#include <QObject>
+
+#include <MMFScalingCustomCommandConstants.h>
+#include <mpxplaybackframeworkdefs.h>
+
+
+class QTimer;
+class HbIcon;
+class HbAction;
+class HbToolBar;
+class HbToolButton;
+class VideoPlaybackViewFileDetails;
+class VideoPlaybackControlsController;
+
+// DATA TYPES
+
+enum TButton
+{
+ E1stButton,
+ E2ndButton,
+ E3rdButton,
+ E4thButton,
+ E5thButton,
+ EButtonCount // Should always be the last value
+};
+
+enum TButtonIcon
+{
+ ERWIcon,
+ EPlayIcon,
+ EPauseIcon,
+ EFFIcon,
+ ENaturalIcon,
+ EStretchIcon,
+ EZoomIcon,
+ EDetailsIcon,
+ EAttachIcon,
+ EShareIcon,
+ EIconCount // Should always be the last value
+};
+
+enum TSeekingState
+{
+ ENotSeeking,
+ EFastForwarding,
+ ERewinding
+};
+
+const int KMPXFastForward = 30;
+const int KMPXRewind = -10;
+
+class VideoPlaybackToolBar : public QObject
+{
+ Q_OBJECT
+
+ public:
+ VideoPlaybackToolBar( VideoPlaybackControlsController* controller );
+ virtual ~VideoPlaybackToolBar();
+ void updateState( TMPXPlaybackState state );
+ void aspectRatioChanged( int aspectRatio );
+ void initialize();
+ void updateWithFileDetails( VideoPlaybackViewFileDetails* details );
+ void positionChanged( int position );
+ void durationChanged( int duration );
+ void setVisible( bool visible );
+
+ private slots:
+ void playPause();
+ void changeAspectRatio();
+ void handleButtonPressed();
+ void handleRWButtonPressed();
+ void handleFFButtonPressed();
+ void ffPressing();
+ void rwPressing();
+ void ffReleased();
+ void rwReleased();
+ void openDetailsView();
+ void retrieveButtons();
+
+ private:
+ VideoPlaybackControlsController *mController;
+ HbToolBar *mToolBar;
+ QTimer *mSeekStartTimer;
+ QTimer *mRetrieveButtonTimer;
+
+ QList<HbIcon*> mButtonIcons;
+ QList<HbAction*> mButtonActions;
+ QList<HbToolButton*> mButtons;
+
+ TSeekingState mSeekingState;
+
+ bool mInitialized;
+ int mPosition;
+ int mDuration;
+ int mAspectRatio;
+ TReal32 mDisplayAspectRatio;
+};
+
+#endif /*VIDEOPLAYBACKTOOLBAR_H_*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/controlsrc/videoplaybackcontrolbar.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,194 @@
+/*
+* 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 VideoPlaybackControlBar
+*
+*/
+
+// Version : %version: 8 %
+
+
+
+#include "mpxvideo_debug.h"
+#include "videoplaybacktoolbar.h"
+#include "videoplaybackcontrolbar.h"
+#include "videoplaybackprogressbar.h"
+#include "mpxcommonvideoplaybackview.hrh"
+#include "videoplaybackcontrolscontroller.h"
+
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlBar::VideoPlaybackControlBar()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackControlBar::VideoPlaybackControlBar(
+ VideoPlaybackControlsController* controller )
+ : mController( controller )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackControlBar::VideoPlaybackControlBar"));
+
+ //
+ // create toolbar handler
+ //
+ mToolBar = new VideoPlaybackToolBar( mController );
+
+ //
+ // create progressbar handler
+ //
+ mProgressBar = new VideoPlaybackProgressBar( mController );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlBar::~VideoPlaybackControlBar()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackControlBar::~VideoPlaybackControlBar()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlBar::~VideoPlaybackControlBar()"));
+
+ if ( mProgressBar )
+ {
+ delete mProgressBar;
+ mProgressBar = NULL;
+ }
+
+ if ( mToolBar )
+ {
+ delete mToolBar;
+ mToolBar = NULL;
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlBar::initialize()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlBar::initialize()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackControlBar::initialize()"));
+
+ if ( mProgressBar )
+ {
+ mProgressBar->initialize();
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlBar::updateState()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlBar::updateState( TMPXPlaybackState state )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlBar::updateState() state = %d"), state );
+
+ if ( mToolBar )
+ {
+ mToolBar->updateState( state );
+ }
+
+ if ( mProgressBar )
+ {
+ mProgressBar->updateState( state );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlBar::aspectRatioChanged()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlBar::aspectRatioChanged( int aspectRatio )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlBar::aspectRatioChanged() aspectRatio = %d"), aspectRatio );
+
+ if ( mToolBar )
+ {
+ mToolBar->aspectRatioChanged( aspectRatio );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlBar::updateWithFileDetails()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlBar::updateWithFileDetails(
+ VideoPlaybackViewFileDetails* details )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlBar::updateWithFileDetails()"));
+
+ if ( mToolBar )
+ {
+ mToolBar->updateWithFileDetails( details );
+ }
+
+ if ( mProgressBar )
+ {
+ mProgressBar->updateWithFileDetails( details );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlBar::setVisibleToControlBar()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlBar::setVisibleToControlBar( bool visible )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackControlBar::setVisibleToControlBar()"),
+ _L("visible = %d, current visibility = %d"), visible, isVisible() );
+
+ if ( visible != isVisible() )
+ {
+ setVisible( visible );
+ mToolBar->setVisible( visible );
+ }
+}
+
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlBar::durationChanged()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlBar::durationChanged( int duration )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlBar::durationChanged()"));
+
+ if ( mProgressBar )
+ {
+ mProgressBar->durationChanged( duration );
+ }
+
+ if ( mToolBar )
+ {
+ mToolBar->durationChanged( duration );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlBar::positionChanged()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlBar::positionChanged( int position )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlBar::positionChanged()"));
+
+ if ( mProgressBar )
+ {
+ mProgressBar->positionChanged( position );
+ }
+
+ if ( mToolBar )
+ {
+ mToolBar->positionChanged( position );
+ }
+}
+
+//End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/controlsrc/videoplaybackcontrolconfiguration.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,215 @@
+/*
+* 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 VideoPlaybackControlConfiguration
+*
+*/
+
+// Version : %version: da1mmcf#23 %
+
+
+
+// INCLUDE FILES
+
+#include <QGraphicsWidget>
+
+#include "mpxvideo_debug.h"
+#include "videoplaybackdocumentloader.h"
+#include "videoplaybackviewfiledetails.h"
+#include "videoplaybackcontrolconfiguration.h"
+#include "videoplaybackcontrolscontroller.h"
+
+
+// ================= MEMBER FUNCTIONS ==============================================================
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlConfiguration::VideoPlaybackControlConfiguration()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackControlConfiguration::VideoPlaybackControlConfiguration(
+ VideoPlaybackControlsController* controller)
+ : mControlsController( controller )
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlConfiguration::~VideoPlaybackControlConfiguration()
+// Destructor.
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackControlConfiguration::~VideoPlaybackControlConfiguration()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlConfiguration::~VideoPlaybackControlConfiguration"));
+
+ mControlsList.clear();
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlConfiguration::createControlList()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlConfiguration::createControlList()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlConfiguration::createControlList()"));
+
+ VideoPlaybackViewFileDetails* fileDetails = mControlsController->fileDetails();
+
+ addControlToList( EStatusPane );
+
+ if ( fileDetails->mPlaybackMode == EMPXVideoStreaming ||
+ fileDetails->mPlaybackMode == EMPXVideoLiveStreaming )
+ {
+ //
+ // streaming, add branding animation control to show while initializing
+ //
+ addControlToList( EBufferingAnimation );
+ }
+ else if ( mControlsController->shouldShowRNLogo() )
+ {
+ addControlToList( ERealLogoBitmap );
+ }
+
+ emit controlListUpdated();
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlConfiguration::controlList
+// -------------------------------------------------------------------------------------------------
+//
+QList<TVideoPlaybackControls>& VideoPlaybackControlConfiguration::controlList()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlConfiguration::controlList()"));
+
+ return mControlsList;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlConfiguration::updateControlList
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlConfiguration::updateControlList(
+ TVideoPlaybackControlCommandIds event )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlConfiguration::updateControlList(%d)"), event);
+
+ QGraphicsWidget *widget =
+ mControlsController->layoutLoader()->findWidget( QString( "transparentWindow" ) );
+
+ switch ( event )
+ {
+ case EControlCmdFullScreenViewOpened:
+ {
+ MPX_DEBUG(_L("VideoPlaybackControlConfiguration::updateControlList() full screen view"));
+
+ widget->setVisible( true );
+
+ deleteControlFromList( EDetailsViewPlaybackWindow );
+ deleteControlFromList( EFileDetailsWidget );
+ deleteControlFromList( EIndicatorBitmap );
+
+ break;
+ }
+ case EControlCmdDetailsViewOpened:
+ {
+ MPX_DEBUG(_L("VideoPlaybackControlConfiguration::updateControlList() details view"));
+
+ widget->setVisible( false );
+
+ deleteControlFromList( EIndicatorBitmap );
+
+ addControlToList( EDetailsViewPlaybackWindow );
+
+ addControlToList( EFileDetailsWidget );
+
+ break;
+ }
+ case EControlCmdTvOutConnected:
+ case EControlCmdAudionOnlyViewOpened:
+ {
+ MPX_DEBUG(_L("VideoPlaybackControlConfiguration::updateControlList() audio only view"));
+
+ widget->setVisible( false );
+
+ deleteControlFromList( EDetailsViewPlaybackWindow );
+
+ addControlToList( EIndicatorBitmap );
+ addControlToList( EFileDetailsWidget );
+
+ break;
+ }
+ case EControlCmdRemoveRNLogo:
+ {
+ MPX_DEBUG(_L("VideoPlaybackControlConfiguration::updateControlList() RN Logo removed"));
+
+ deleteControlFromList( ERealLogoBitmap );
+
+ break;
+ }
+ default:
+ {
+ break;
+ }
+ }
+
+ emit controlListUpdated();
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlConfiguration::deleteControlFromList
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlConfiguration::deleteControlFromList( TVideoPlaybackControls control )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlConfiguration::deleteControlFromList(%d)"), control);
+
+ mControlsList.removeAll( control );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlConfiguration::addControlToList
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlConfiguration::addControlToList(
+ TVideoPlaybackControls control )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlConfiguration::addControlToList(%d)"), control);
+
+ if ( ! mControlsList.contains( control ) )
+ {
+ mControlsList.append( control );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlConfiguration::updateControlsWithFileDetails
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlConfiguration::updateControlsWithFileDetails()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlConfiguration::updateControlsWithFileDetails()"));
+
+ addControlToList( EControlBar );
+
+ if ( mControlsController->fileDetails()->mVideoEnabled )
+ {
+ MPX_DEBUG(_L("VideoPlaybackControlConfiguration::updateControlsWithFileDetails() video enabled"));
+
+ QGraphicsWidget *widget =
+ mControlsController->layoutLoader()->findWidget( QString( "transparentWindow" ) );
+ widget->setVisible( true );
+ }
+
+ emit controlListUpdated();
+}
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/controlsrc/videoplaybackcontrolpolicy.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,143 @@
+/*
+* 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 VideoPlaybackControlPolicy
+*
+*/
+
+// Version : %version: da1mmcf#15 %
+
+
+
+// INCLUDE FILES
+
+#include "mpxvideo_debug.h"
+#include "videoplaybackcontrolpolicy.h"
+#include "videoplaybackviewfiledetails.h"
+
+// ================= MEMBER FUNCTIONS ==============================================================
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlPolicy::CMPXVideoPlaybackControlPolicy()
+// C++ default constructor can NOT contain any code, that might leave.
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackControlPolicy::VideoPlaybackControlPolicy()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlPolicy::VideoPlaybackControlPolicy()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlPolicy::~VideoPlaybackControlPolicy()
+// Destructor.
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackControlPolicy::~VideoPlaybackControlPolicy()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlPolicy::~VideoPlaybackControlPolicy()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlPolicy::setControlProperties()
+// -------------------------------------------------------------------------------------------------
+//
+void
+VideoPlaybackControlPolicy::setControlProperties( TVideoPlaybackControls controlIndex,
+ TUint& properties,
+ VideoPlaybackViewFileDetails *details,
+ TPlaybackViewMode viewMode )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlPolicy::setControlProperties()"));
+
+ properties = 0;
+
+ switch ( controlIndex )
+ {
+ case EBufferingAnimation:
+ {
+ properties = EShownWhenInitializing |
+ EShownWhenBuffering;
+ break;
+ }
+ case EStatusPane:
+ {
+ //
+ // If it is local playback & full screen view, show the controls while buffering
+ // If not, won't show
+ //
+ if ( details->mPlaybackMode == EMPXVideoLocal && viewMode == EFullScreenView )
+ {
+ properties = EShownWhenPlaying |
+ EShownWhenPaused |
+ EShownWhenSeeking |
+ EShownWhenBuffering;
+ }
+ else
+ {
+ properties = EAllProperties;
+ }
+ break;
+ }
+ case EControlBar:
+ {
+ //
+ // We don't delete Tool Bar and Progress Bar from the controlsList
+ // to update information all the time though it's not visible or activated
+ // So just hide these if it is details view
+ //
+ if ( viewMode == EDetailsView )
+ {
+ properties = 0;
+ }
+ else if ( viewMode == EAudioOnlyView )
+ {
+ properties = EAllProperties;
+ }
+ else
+ {
+ //
+ // If it is local playback, show the controls while buffering
+ // If not, won't show
+ //
+ if ( details->mPlaybackMode == EMPXVideoLocal )
+ {
+ properties = EShownWhenPlaying |
+ EShownWhenPaused |
+ EShownWhenSeeking |
+ EShownWhenBuffering;
+ }
+ else
+ {
+ properties = EShownWhenPlaying |
+ EShownWhenPaused |
+ EShownWhenSeeking;
+ }
+ }
+ break;
+ }
+ case EFileDetailsWidget:
+ case EIndicatorBitmap:
+ case ERealLogoBitmap:
+ case EDetailsViewPlaybackWindow:
+ {
+ //
+ // Add all these controls when it is details view or audio only view
+ // Once it's added to controlsList, these are visible always
+ //
+ properties = EAllProperties;
+ break;
+ }
+ }
+}
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/controlsrc/videoplaybackcontrolscontroller.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,1586 @@
+/*
+* 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 VideoPlaybackControlsController
+*
+*/
+
+// Version : %version: da1mmcf#46 %
+
+
+
+// INCLUDE FILES
+#include <coecntrl.h>
+#include <bautils.h>
+#include <barsread.h>
+#include <f32file.h>
+
+#include <QTimer>
+#include <thumbnailmanager_qt.h>
+#include <xqserviceutil.h>
+
+#include <hblabel.h>
+#include <hbvolumesliderpopup.h>
+#include <hbtransparentwindow.h>
+#include <hbiconanimationmanager.h>
+#include <shareui.h>
+#include <hbinstance.h>
+#include <hbtapgesture.h>
+#include <hbpangesture.h>
+
+#include "mpxvideoviewwrapper.h"
+#include "videobaseplaybackview.h"
+#include "videoplaybackcontrolbar.h"
+#include "videoplaybackcontrolpolicy.h"
+#include "videoplaybackdocumentloader.h"
+#include "videoplaybackviewfiledetails.h"
+#include "videoplaybackstatuspanecontrol.h"
+#include "videoplaybackfiledetailswidget.h"
+#include "videoplaybackfullscreencontrol.h"
+#include "videoplaybackcontrolscontroller.h"
+#include "videoplaybackcontrolconfiguration.h"
+#include "videoplaybackdetailsplaybackwindow.h"
+#include "videoservices.h"
+
+
+// ================= MEMBER FUNCTIONS ==============================================================
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::VideoPlaybackControlsController()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackControlsController::VideoPlaybackControlsController(
+ VideoBasePlaybackView *view,
+ CMPXVideoViewWrapper *viewWrapper,
+ VideoPlaybackViewFileDetails *details )
+ : mView( view )
+ , mViewWrapper( viewWrapper )
+ , mFileDetails( details )
+ , mControlsPolicy( NULL )
+ , mControlsConfig( NULL )
+ , mControlsTimer( NULL )
+ , mRNLogoTimer( NULL )
+ , mLoader( NULL )
+ , mVolumeControl( NULL )
+ , mThumbnailManager( NULL )
+ , mVideoServices( 0 )
+ , mViewTransitionIsGoingOn( false )
+ , mIsAttachOperation( false )
+ , mThumbNailState( EThumbNailEmpty )
+ , mState( EPbStateNotInitialised )
+ , mViewMode( EFullScreenView )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackControlsController::VideoPlaybackControlsController()"));
+
+ initializeController();
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::initializeController()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::initializeController()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackControlsController::initializeController()"));
+
+ mOrientation = hbInstance->allMainWindows()[0]->orientation();
+ bool ok = connect( hbInstance->allMainWindows()[0], SIGNAL( orientationChanged( Qt::Orientation ) ),
+ this, SLOT( handleOrientationChanged( Qt::Orientation ) ) );
+
+ MPX_DEBUG(
+ _L("VideoPlaybackControlsController::initializeController() orientation = %d, ok =%d"),
+ mOrientation, ok );
+
+ setParent( mView );
+
+ mView->hideItems( Hb::AllItems );
+
+ //
+ // Create layout loader
+ //
+ ok = false;
+ mLoader = new VideoPlaybackDocumentLoader( this );
+ mLoader->load( KPLAYBACKVIEW_DOCML, &ok );
+
+ if ( ok )
+ {
+ QGraphicsWidget *widget = mLoader->findWidget( QString( "content" ) );
+ mView->setWidget( widget );
+ }
+ else
+ {
+ MPX_DEBUG(
+ _L("VideoPlaybackControlsController::initializeController()- can't find xml"));
+
+ //
+ // Can't find xml for layout. Delete mLoader
+ //
+ delete mLoader;
+ mLoader = NULL;
+ }
+
+ mFileDetails->mRNFormat = realFormat( mFileDetails->mClipName );
+
+ //
+ // Controls dismissing timer
+ //
+ mControlsTimer = new QTimer( this );
+ mControlsTimer->setInterval( KControlsTimeOut );
+ mControlsTimer->setSingleShot( false );
+ connect( mControlsTimer, SIGNAL( timeout() ), this, SLOT( hideAllControls() ) );
+
+ mControlsPolicy = new VideoPlaybackControlPolicy();
+
+ mControlsConfig = new VideoPlaybackControlConfiguration( this );
+ connect( mControlsConfig, SIGNAL( controlListUpdated() ), this, SLOT( controlsListUpdated() ) );
+ mControlsConfig->createControlList();
+
+ //
+ // Create volume popup control
+ //
+ mVolumeControl = new HbVolumeSliderPopup();
+ mVolumeControl->setVisible( false );
+ mVolumeControl->setTimeout( KControlsTimeOut );
+ mVolumeControl->setTickPosition( Hb::NoSliderTicks );
+ mVolumeControl->setRange( KPbPlaybackVolumeLevelMin, KPbPlaybackVolumeLevelMax );
+
+ //
+ // grab tap gesture
+ //
+ mView->grabGesture( Qt::TapGesture );
+ connect( mView, SIGNAL( tappedOnScreen() ), this, SLOT( handleTappedOnScreen() ) );
+
+ //
+ // if videoplayback is in service mode, create a videoservices instance
+ //
+ if ( XQServiceUtil::isService() && ! mVideoServices )
+ {
+ //
+ // obtain VideoServices instance
+ //
+ mVideoServices = VideoServices::instance();
+
+ //
+ // allow 'attach' operation only for non-streaming media clips
+ //
+ if ( mVideoServices && mFileDetails->mPlaybackMode == EMPXVideoLocal )
+ {
+ //
+ // determine if this is 'attach' operation
+ //
+ mIsAttachOperation = ( mVideoServices->currentService() == VideoServices::EUriFetcher );
+
+ if ( mIsAttachOperation )
+ {
+ //
+ // connect signal filePath() to videoservices slot itemSelected()
+ //
+ connect( this, SIGNAL( attachVideoPath( const QString& ) ),
+ mVideoServices, SLOT( itemSelected( const QString& ) ) );
+ }
+ }
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::~VideoPlaybackControlsController
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackControlsController::~VideoPlaybackControlsController()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackControlsController::~VideoPlaybackControlsController()"));
+
+ mView->ungrabGesture( Qt::TapGesture );
+ disconnect( mView, SIGNAL( tappedOnScreen() ), this, SLOT( handleTappedOnScreen() ) );
+
+ if ( mFileDetails->mMultiItemPlaylist && mFileDetails->mSeekable )
+ {
+ mView->ungrabGesture( Qt::PanGesture );
+
+ disconnect( mView, SIGNAL( pannedToRight() ), this, SLOT( skipToNextVideoItem() ) );
+ disconnect( mView, SIGNAL( pannedToLeft() ), this, SLOT( skipToPreviousVideoItem() ) );
+ }
+
+ disconnect( mControlsConfig, SIGNAL( controlListUpdated() ), this, SLOT( controlsListUpdated() ) );
+ disconnect( mControlsTimer, SIGNAL( timeout() ), this, SLOT( hideAllControls() ) );
+ disconnect( hbInstance->allMainWindows()[0], SIGNAL( orientationChanged( Qt::Orientation ) ),
+ this, SLOT( handleOrientationChanged( Qt::Orientation ) ) );
+
+ mView->setWidget( NULL );
+
+ mControls.clear();
+
+ if ( mControlsTimer )
+ {
+ delete mControlsTimer;
+ mControlsTimer = NULL;
+ }
+
+ if ( mRNLogoTimer )
+ {
+ disconnect( mRNLogoTimer, SIGNAL( timeout() ), this, SLOT( handleRNLogoTimeout() ) );
+
+ delete mRNLogoTimer;
+ mRNLogoTimer = NULL;
+ }
+
+ if ( mControlsPolicy )
+ {
+ delete mControlsPolicy;
+ mControlsPolicy = NULL;
+ }
+
+ if ( mControlsConfig )
+ {
+ delete mControlsConfig;
+ mControlsConfig = NULL;
+ }
+
+ if ( mLoader )
+ {
+ delete mLoader;
+ mLoader = NULL;
+ }
+
+ if ( mThumbnailManager )
+ {
+ delete mThumbnailManager;
+ mThumbnailManager = NULL;
+ }
+
+ if ( mVolumeControl )
+ {
+ delete mVolumeControl;
+ mVolumeControl = NULL;
+ }
+
+ if ( mIsAttachOperation )
+ {
+ //
+ // disable connection for 'attach' operation
+ //
+ disconnect( this, SIGNAL( attachVideoPath( const QString& ) ),
+ mVideoServices, SLOT( itemSelected( const QString& ) ) );
+ }
+
+ if ( mVideoServices )
+ {
+ //
+ // decrease videoservices instance count
+ //
+ mVideoServices->decreaseReferenceCount();
+ mVideoServices = 0;
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::addFileDetails()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::addFileDetails(
+ VideoPlaybackViewFileDetails* details )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackControlsController::addFileDetails"));
+
+ mFileDetails = details;
+
+ mFileDetails->mRNFormat = realFormat( mFileDetails->mClipName );
+
+ mControlsConfig->updateControlsWithFileDetails();
+
+ //
+ // for audio-only clips and tv-out, default view is flip view
+ //
+ if ( ! details->mVideoEnabled )
+ {
+ changeViewMode( EAudioOnlyView, false );
+ }
+
+ if ( details->mTvOutConnected )
+ {
+ handleEvent( EControlCmdTvOutConnected );
+ }
+
+ //
+ // Dimmed the volume control if it is video only
+ //
+ if ( ! mFileDetails->mAudioEnabled )
+ {
+ mVolumeControl->setValue( 0 );
+ mVolumeControl->setEnabled( false );
+ }
+
+ //
+ // grab pan gesture for playlist and seekable(skippable) clip
+ //
+ if ( mFileDetails->mMultiItemPlaylist && mFileDetails->mSeekable )
+ {
+ mView->grabGesture( Qt::PanGesture );
+ connect( mView, SIGNAL( pannedToRight() ), this, SLOT( skipToPreviousVideoItem() ) );
+ connect( mView, SIGNAL( pannedToLeft() ), this, SLOT( skipToNextVideoItem() ) );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::handleEvent
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::handleEvent(
+ TVideoPlaybackControlCommandIds event, int value )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::handleEvent(%d)"), event);
+
+ switch ( event )
+ {
+ case EControlCmdSetPosition:
+ {
+ MPX_DEBUG(_L(" [EControlCmdSetPosition [%d]]"), value );
+
+ positionChanged( (qreal)value / (qreal)KPbMilliMultiplier);
+ break;
+ }
+ case EControlCmdSetDuration:
+ {
+ MPX_DEBUG(_L(" [EControlCmdSetDuration [%d]]"), value );
+
+ durationChanged( (qreal)value / (qreal)KPbMilliMultiplier );
+ break;
+ }
+ case EControlCmdStateChanged:
+ {
+ MPX_DEBUG(_L(" [EControlCmdStateChanged]"));
+
+ handleStateChange( (TMPXPlaybackState)value );
+ break;
+ }
+ case EControlCmdSetVolume:
+ {
+ MPX_DEBUG(_L(" [EControlCmdSetVolume [%d]]"), value );
+
+ volumeChanged( value );
+ break;
+ }
+ case EControlCmdSetAspectRatio:
+ {
+ MPX_DEBUG(_L(" [EControlCmdSetAspectRatio %d]"), value );
+
+ aspectRatioChanged( value );
+
+ break;
+ }
+ case EControlCmdSetDownloadSize:
+ {
+ MPX_DEBUG(_L(" [EControlCmdSetDownloadSize [%d]]"), value );
+ setDownloadSize( value );
+ break;
+ }
+ case EControlCmdDownloadUpdated:
+ {
+ MPX_DEBUG(_L(" [EControlCmdDownloadUpdated [%d]]"), value );
+ updateDownloadPosition( value );
+ break;
+ }
+ case EControlCmdDownloadComplete:
+ {
+ MPX_DEBUG(_L(" [EControlCmdDownloadComplete [%d]]"), value);
+ updateDownloadPosition( value );
+ break;
+ }
+ case EControlCmdSetDownloadPaused:
+ case EControlCmdClearDownloadPaused:
+ {
+ mControlsConfig->updateControlList( event );
+ break;
+ }
+ case EControlCmdTvOutConnected:
+ {
+ MPX_DEBUG(_L(" [EControlCmdTvOutConnected]"));
+
+ handleTvOutEvent( true, event );
+ break;
+ }
+ case EControlCmdTvOutDisconnected:
+ {
+ MPX_DEBUG(_L(" [EControlCmdTvOutDisConnected]"));
+
+ handleTvOutEvent( false, event );
+ break;
+ }
+ case EControlCmdHandleErrors:
+ {
+ MPX_DEBUG(_L(" [EControlCmdHandleErrors]"));
+
+ handleErrors();
+
+ break;
+ }
+ case EControlCmdShowVolumeControls:
+ {
+ MPX_DEBUG(_L(" [EControlCmdShowVolumeControls]"));
+
+ showVolumeControls();
+ break;
+ }
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::handleStateChange
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::handleStateChange( TMPXPlaybackState newState )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackControlsController::handleStateChange()"),
+ _L("new state = %d"), newState );
+
+ //
+ // Somehow EPbStatePlaying, EPbStatePaused gets called twice continously
+ //
+ if ( newState != mState )
+ {
+ mState = newState;
+
+ switch ( newState )
+ {
+ case EPbStatePlaying:
+ case EPbStateInitialising:
+ case EPbStateBuffering:
+ case EPbStatePaused:
+ case EPbStateNotInitialised:
+ {
+ //
+ // Show all the controls
+ //
+ showControls();
+
+ updateState();
+
+ break;
+ }
+ default:
+ {
+ break;
+ }
+ }
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::controlsListUpdated()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::controlsListUpdated()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackControlsController::controlsListUpdated()"));
+
+ hideAllControls();
+
+ QList<TVideoPlaybackControls>& updatedList = mControlsConfig->controlList();
+
+ QList<TVideoPlaybackControls> myList = updatedList;
+
+ int controlCount = mControls.count();
+
+ int i = 0 ;
+ int index = KErrNotFound;
+
+
+ for ( int iCnt = 0 ; iCnt < controlCount ; iCnt++ )
+ {
+ index = myList.indexOf( mControls[i]->controlIndex() );
+
+ if ( index == KErrNotFound )
+ {
+ //
+ // Delete control since it doesn't exist in new list
+ //
+ mControls.removeAt( i );
+ }
+ else
+ {
+ //
+ // Control exists in new list.
+ // Update the policy property based on file details and view mode to the controls
+ //
+ TUint properties = 0;
+ mControlsPolicy->setControlProperties(
+ mControls[i]->controlIndex(), properties, mFileDetails, mViewMode );
+ mControls[i]->updateControlProperties( properties );
+
+ //
+ // Control exists in new list.
+ //
+ myList.removeAt( index );
+ i++;
+ }
+ }
+
+ //
+ // The updated list will contain added controls only
+ //
+ for ( int j = 0 ; j < myList.count() ; j++ )
+ {
+ appendControl( myList[j] );
+ }
+
+ for ( int i = 0 ; i < mControls.count() ; i++ )
+ {
+ mControls[i]->updateControlsWithFileDetails( mFileDetails );
+ }
+
+ showControls();
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::appendControl()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::appendControl( TVideoPlaybackControls controlIndex )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackControlsController::appendControl()"),
+ _L("control index = %d"), controlIndex );
+
+ TUint properties = 0;
+
+ mControlsPolicy->setControlProperties( controlIndex, properties, mFileDetails, mViewMode );
+ VideoPlaybackFullScreenControl* control;
+
+ switch ( controlIndex )
+ {
+ case EBufferingAnimation:
+ {
+ //
+ // Load animation icons
+ //
+ QString animationName = ":/videoplaybackview/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(" EBufferingAnimation add animation definition ok = %d"), ok);
+
+ //
+ // Buffering animation icon
+ //
+ QGraphicsWidget *widget = mLoader->findWidget( QString( "bufferingIcon" ) );
+ HbLabel *bufferingAnim = qobject_cast<HbLabel*>( widget );
+
+ control = new VideoPlaybackFullScreenControl( this,
+ controlIndex,
+ bufferingAnim,
+ properties );
+ mControls.append( control );
+
+ break;
+ }
+ case EStatusPane:
+ {
+ //
+ // Status key (signal + title + back key)
+ //
+ control = new VideoPlaybackStatusPaneControl( this,
+ controlIndex,
+ NULL,
+ properties );
+ mControls.append( control );
+
+ break;
+ }
+ case EControlBar:
+ {
+ //
+ // Button bar
+ //
+ QGraphicsWidget *widget = mLoader->findWidget( QString( "controlBarLayout" ) );
+ VideoPlaybackControlBar *controlBar =
+ qobject_cast<VideoPlaybackControlBar*>( widget );
+ controlBar->initialize();
+
+ control = new VideoPlaybackFullScreenControl( this,
+ controlIndex,
+ controlBar,
+ properties );
+ mControls.append( control );
+
+ break;
+ }
+ case EFileDetailsWidget:
+ {
+ QGraphicsWidget *widget = mLoader->findWidget( QString( "fileDetailsLayout" ) );
+ VideoPlaybackFileDetailsWidget *fileDetails =
+ qobject_cast<VideoPlaybackFileDetailsWidget*>( widget );
+
+ control = new VideoPlaybackFullScreenControl( this,
+ controlIndex,
+ fileDetails,
+ properties );
+
+ mControls.append( control );
+ break;
+ }
+ case EIndicatorBitmap:
+ {
+ QGraphicsWidget *widget = mLoader->findWidget( QString( "bitmapLayout" ) );
+ HbWidget *bitmapWidget = qobject_cast<HbWidget*>( widget );
+
+ setDefaultBitmap();
+ control = new VideoPlaybackFullScreenControl( this,
+ controlIndex,
+ bitmapWidget,
+ properties );
+ mControls.append( control );
+
+ break;
+ }
+ case ERealLogoBitmap:
+ {
+ QGraphicsWidget *widget = mLoader->findWidget( QString( "rnLogoBitmap" ) );
+ HbWidget *bitmapWidget = qobject_cast<HbWidget*>( widget );
+
+ control = new VideoPlaybackFullScreenControl( this,
+ controlIndex,
+ bitmapWidget,
+ properties );
+ mControls.append( control );
+
+ connect( bitmapWidget, SIGNAL( visibleChanged() ),
+ this, SLOT( handleRNLogoVisibleChanged() ) );
+
+ break;
+ }
+ case EDetailsViewPlaybackWindow:
+ {
+ QGraphicsWidget *widget = mLoader->findWidget( QString( "detailsPlaybackWindow" ) );
+ VideoPlaybackDetailsPlaybackWindow *detailsPlaybackWindow =
+ qobject_cast<VideoPlaybackDetailsPlaybackWindow*>( widget );
+ detailsPlaybackWindow->initialize();
+
+ control = new VideoPlaybackFullScreenControl( this,
+ controlIndex,
+ detailsPlaybackWindow,
+ properties );
+ mControls.append( control );
+
+ break;
+ }
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::handleTappedOnScreen()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::handleTappedOnScreen()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackControlsController::handleTappedOnScreen()"));
+
+ //
+ // If we are in full screen view, toggle the visibility when playing and paused
+ // If we are in details view, issue playpause
+ // If we are in audio only view, ignore
+ //
+ switch( mViewMode )
+ {
+ case EFullScreenView:
+ {
+ if ( mState == EPbStatePlaying || mState == EPbStatePaused )
+ {
+ if ( isVisible() )
+ {
+ //
+ // If the volume control is visible, hide it
+ //
+ if ( mVolumeControl->isVisible() )
+ {
+ mVolumeControl->setVisible( false );
+ }
+
+ hideAllControls();
+ }
+ else
+ {
+ showControls();
+ }
+ }
+
+ break;
+ }
+ case EDetailsView:
+ {
+ //
+ // ignore the tap for 'Pause' action for non-pausable stream in
+ // 'Details' view during 'Playing' state
+ //
+ if ( mState != EPbStatePlaying || mFileDetails->mPausableStream )
+ {
+ handleCommand( EMPXPbvCmdPlayPause );
+ }
+
+ break;
+ }
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::resetDisappearingTimers()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::resetDisappearingTimers( TTimerAction timerAction )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::resetDisappearingTimers()"));
+
+ if ( mControlsTimer->isActive() )
+ {
+ mControlsTimer->stop();
+ }
+
+ //
+ // Do not start the time for DetailsView and AudioOnlyView
+ //
+ if ( timerAction == ETimerReset &&
+ mState == EPbStatePlaying &&
+ mViewMode == EFullScreenView )
+ {
+ MPX_DEBUG(_L(" Starting Controls Timer"));
+
+ mControlsTimer->start();
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::hideAllControls()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::hideAllControls()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::hideControls()"));
+
+ resetDisappearingTimers( ETimerCancel );
+
+ for ( int i = 0 ; i < mControls.count() ; i++ )
+ {
+ mControls[i]->setVisible( false );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::showControls()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::showControls()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::showControls()"));
+
+ resetDisappearingTimers( ETimerReset );
+
+ if ( ! mViewTransitionIsGoingOn && mOrientation == Qt::Horizontal )
+ {
+ for ( int i = 0 ; i < mControls.count() ; i++ )
+ {
+ mControls[i]->setVisibility( mState );
+ }
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::isVisible()
+// -------------------------------------------------------------------------------------------------
+//
+bool VideoPlaybackControlsController::isVisible()
+{
+ bool visible = false;
+
+ for ( int i = 0 ; i < mControls.count() ; i++ )
+ {
+ if ( mControls[i]->controlIndex() == EControlBar )
+ {
+ if ( mControls[i]->isVisible() )
+ {
+ visible = true;
+ }
+
+ break;
+ }
+ }
+
+ MPX_DEBUG(_L("VideoPlaybackControlsController::isVisible() [%d]"), visible);
+
+ return visible;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::handleCommand()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::handleCommand(
+ TMPXVideoPlaybackViewCommandIds command, int value )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::handleCommand(%d)"), command);
+
+ switch( command )
+ {
+ case EMPXPbvCmdSetPosition:
+ {
+ TRAP_IGNORE( mViewWrapper->SetPropertyL( EPbPropertyPosition,
+ value * KPbMilliMultiplier ) );
+ break;
+ }
+ case EMPXPbvCmdSetVolume:
+ {
+ TRAP_IGNORE( mViewWrapper->SetPropertyL( EPbPropertyVolume, value ) );
+ break;
+ }
+ default:
+ {
+ TRAP_IGNORE( mViewWrapper->HandleCommandL( command ) );
+ break;
+ }
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::volumeChanged()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::volumeChanged( int volume )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::volumeChanged() [%d]"), volume);
+
+ if ( mVolumeControl )
+ {
+ mVolumeControl->setValue( volume );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::showVolumeControls()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::showVolumeControls()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::showVolumeControls()"));
+
+ if ( mVolumeControl )
+ {
+ mVolumeControl->setVisible( true );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::durationChanged()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::durationChanged( int duration )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::durationChanged() [%d]"), duration);
+
+ for ( int i = 0 ; i < mControls.count() ; i++ )
+ {
+ if ( mControls[i]->durationChanged( duration ) )
+ {
+ break;
+ }
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::positionChanged()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::positionChanged( int position )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::positionChanged() [%d]"), position);
+
+ for ( int i = 0 ; i < mControls.count() ; i++ )
+ {
+ if ( mControls[i]->positionChanged( position ) )
+ {
+ break;
+ }
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::aspectRatioChanged()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::aspectRatioChanged( int aspectRatio )
+{
+ MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::aspectRatioChanged() [%d]"), aspectRatio);
+
+ for ( int i = 0 ; i < mControls.count() ; i++ )
+ {
+ if ( mControls[i]->aspectRatioChanged( aspectRatio ) )
+ {
+ break;
+ }
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::updateState()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::updateState()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::updateState() [%d]"), mState);
+
+ for ( int i = 0 ; i < mControls.count() ; i++ )
+ {
+ mControls[i]->updateState( mState );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::realFormat()
+// -------------------------------------------------------------------------------------------------
+//
+bool VideoPlaybackControlsController::realFormat( QString filename )
+{
+ bool realFormat = false;
+
+ if ( !filename.isNull() && !filename.isEmpty() )
+ {
+ if ( mFileDetails->mPlaybackMode == EMPXVideoStreaming ||
+ mFileDetails->mPlaybackMode == EMPXVideoLiveStreaming )
+ {
+ TBufC<255> file(filename.utf16());
+ realFormat = realFormatForStreaming( file );
+ }
+ else
+ {
+ realFormat = realFormatForLocal();
+ }
+ }
+
+ MPX_DEBUG(_L("VideoPlaybackControlsController::realFormat() [%d]"), realFormat);
+
+ return realFormat;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::realFormatForStreaming()
+// -------------------------------------------------------------------------------------------------
+//
+bool VideoPlaybackControlsController::realFormatForStreaming( const TDesC& des )
+{
+ bool realFormat = false;
+ TParse filePath;
+
+ _LIT(KMPXRMEXT, ".R" );
+
+ int err = filePath.Set( des, NULL, NULL );
+
+ //
+ // It is valid to have a "\" character in a url, but parsing fails,
+ // switch these characters to "/" for the local string and try parsing again.
+ //
+ if ( err == KErrBadName )
+ {
+ int backsashPos = des.LocateF('\\');
+
+ if( backsashPos != KErrNotFound )
+ {
+ HBufC* fileName = NULL;
+
+ TRAP( err, fileName = des.AllocL() );
+
+ if ( err == KErrNone )
+ {
+ int count( fileName->Des().Length() );
+
+ for ( int j = backsashPos ; j < count; ++j )
+ {
+ if ( fileName->Des()[j]== '\\' )
+ {
+ fileName->Des()[j]='/';
+ }
+ }
+ err = filePath.Set( fileName->Des(), NULL, NULL );
+ }
+
+ if ( fileName )
+ {
+ delete fileName;
+ fileName = NULL;
+ }
+ }
+ }
+
+ if ( err == KErrNone )
+ {
+ //
+ // The requirement to support arguments with the extension in streaming links
+ // for-ex: /video.3gp?start=10&end=40 will have to supported
+ // as well. So just by doing p.Ext() would retrieve all the string
+ // after "." so by doing a Left(2) would retrieve only
+ // .3g or .rm and so on. This would help better
+ // interpret the extension and decide the branding accordingly
+ //
+ filePath.Set( filePath.NameAndExt(), NULL, NULL );
+ TPtrC extension = filePath.Ext().Left( 2 );
+
+ TBuf<2> buf;
+ buf.Format( extension );
+ buf.UpperCase();
+
+ // RealMedia Branding
+ if ( ! buf.Compare( KMPXRMEXT ) )
+ {
+ realFormat = true;
+ }
+ }
+
+ MPX_DEBUG(_L("VideoPlaybackControlsController::realFormatForStreaming()[%d]"), realFormat);
+
+ return realFormat;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::realFormatForLocal()
+// -------------------------------------------------------------------------------------------------
+//
+bool VideoPlaybackControlsController::realFormatForLocal()
+{
+ bool realFormat = false;
+
+ QString real( "real" );
+ QString rn( "rn" );
+
+ if ( mFileDetails->mMimeType.contains( real, Qt::CaseInsensitive ) ||
+ mFileDetails->mMimeType.contains( rn, Qt::CaseInsensitive ) )
+ {
+ realFormat = true;
+ }
+
+ MPX_DEBUG(_L("VideoPlaybackControlsController::realFormatForLocal() [%d]"), realFormat);
+
+ return realFormat;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::setDownloadSize()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::setDownloadSize( int size )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::setDownloadSize() [%d]"), size);
+
+ for ( int i = 0 ; i < mControls.count() ; i++ )
+ {
+ if ( mControls[i]->setDownloadSize( size ) )
+ {
+ break;
+ }
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::updateDownloadPosition()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::updateDownloadPosition( int size )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::updateDownloadPosition() [%d]"), size);
+
+ for ( int i = 0 ; i < mControls.count() ; i++ )
+ {
+ if ( mControls[i]->updateDownloadPosition( size ) )
+ {
+ break;
+ }
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::handleErrors
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::handleErrors()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackControlsController::handleErrors()"),
+ _L("mState = %d"), mState );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::isSoftKeyVisible()
+// -------------------------------------------------------------------------------------------------
+//
+bool VideoPlaybackControlsController::isSoftKeyVisible()
+{
+ bool visible = false;
+
+ for ( int i = 0 ; i < mControls.count() ; i++ )
+ {
+ if ( mControls[i]->controlIndex() == EStatusPane )
+ {
+ if ( mControls[i]->isVisible() )
+ {
+ visible = true;
+ }
+
+ break;
+ }
+ }
+
+ MPX_DEBUG(_L("VideoPlaybackControlsController::isSoftKeyVisible() [%d]"), visible);
+
+ return visible;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::handleTvOutEvent
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::handleTvOutEvent(
+ bool connected, TVideoPlaybackControlCommandIds event )
+{
+ Q_UNUSED( event );
+
+ MPX_DEBUG(_L("VideoPlaybackControlsController::handleTvOutEvent()"));
+
+ mFileDetails->mTvOutConnected = connected;
+
+ setDefaultBitmap();
+
+ if ( mFileDetails->mTvOutConnected )
+ {
+ generateThumbNail();
+ }
+
+ //
+ // Change the view.
+ // If Tv-out is connected, go to AudioOnlyView.
+ // If not, go back to default view.
+ //
+ TPlaybackViewMode viewMode = EFullScreenView;
+
+ if ( mFileDetails->mTvOutConnected || ! mFileDetails->mVideoEnabled )
+ {
+ viewMode = EAudioOnlyView;
+ }
+
+ changeViewMode( viewMode, false );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::changeViewMode
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::changeViewMode(
+ TPlaybackViewMode viewMode, bool transitionEffect )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::changeViewMode( %d, %d )"),
+ viewMode, transitionEffect );
+
+ if ( viewMode != mViewMode )
+ {
+ switch ( viewMode )
+ {
+ case EFullScreenView:
+ case EDetailsView:
+ {
+ if ( mFileDetails->mVideoEnabled && ! mFileDetails->mTvOutConnected )
+ {
+ mViewMode = viewMode;
+
+ //
+ // Hack to clean up the screen before transition. We may not need it in NGA env
+ //
+ hideAllControls();
+
+ updateVideoRect( transitionEffect );
+ }
+
+ break;
+ }
+ case EAudioOnlyView:
+ {
+ if ( ! mFileDetails->mVideoEnabled || mFileDetails->mTvOutConnected )
+ {
+ mViewMode = viewMode;
+
+ mControlsConfig->updateControlList( EControlCmdAudionOnlyViewOpened );
+ }
+
+ break;
+ }
+ default:
+ {
+ break;
+ }
+ }
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::updateVideoRectDone
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::updateVideoRectDone()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::updateVideoRectDone()"));
+
+ mViewTransitionIsGoingOn = false;
+
+ TVideoPlaybackControlCommandIds event = EControlCmdFullScreenViewOpened;
+
+ if ( mViewMode == EDetailsView )
+ {
+ event = EControlCmdDetailsViewOpened;
+ }
+
+ mControlsConfig->updateControlList( event );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::skipToPreviousVideoItem
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::skipToPreviousVideoItem()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::skipToPreviousVideoItem()"));
+
+ if ( mViewMode == EFullScreenView )
+ {
+ handleCommand( EMPXPbvCmdPreviousListItem );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::skipToNextVideoItem
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::skipToNextVideoItem()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::skipToNextVideoItem()"));
+
+ if ( mViewMode == EFullScreenView )
+ {
+ handleCommand( EMPXPbvCmdNextListItem );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::updateVideoRect()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::updateVideoRect( bool transitionEffect )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::updateVideoRect( %d )"),
+ transitionEffect );
+
+ if ( mFileDetails->mVideoEnabled && ! mFileDetails->mTvOutConnected )
+ {
+ mViewTransitionIsGoingOn = true;
+
+ QRectF rect;
+
+ MPX_DEBUG(_L("VideoPlaybackControlsController::updateVideoRect() : mViewMode = %d )"),
+ mViewMode );
+
+ if ( mViewMode == EDetailsView )
+ {
+ QGraphicsWidget *parent = mLoader->findWidget( QString( "detailsPlaybackWindow" ) );
+ QGraphicsWidget *child = mLoader->findWidget( QString( "small_transparentWindow" ) );
+
+ rect = parent->mapRectToScene( child->geometry() );
+ }
+ else if ( mViewMode == EFullScreenView )
+ {
+ QGraphicsWidget *widget = mLoader->findWidget( QString( "content" ) );
+ rect = widget->geometry();
+ }
+
+ mViewWrapper->UpdateVideoRect(
+ rect.x(), rect.y(), rect.width(), rect.height(), transitionEffect );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::setDefaultBitmap()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::setDefaultBitmap()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::setDefaultBitmap()"));
+
+ //
+ // set specific bitmaps for audio only and tv out cases
+ // If we already requested a thumbnail, we will set the thumbnail after we receive the thumbnail
+ //
+ if ( mLoader && mThumbNailState != EThumbNailRequsted )
+ {
+ QGraphicsWidget *tvOutBitmap = mLoader->findWidget( "tvOutBitmap" );
+ tvOutBitmap->setVisible( false );
+
+ QGraphicsWidget *realAudioOnlyBitmap = mLoader->findWidget( "realAudioOnlyBitmap" );
+ realAudioOnlyBitmap->setVisible( false );
+
+ QGraphicsWidget *partialAudioOnlyBitmap = mLoader->findWidget( "partialAudioOnlyBitmap" );
+ partialAudioOnlyBitmap->setVisible( false );
+
+ QGraphicsWidget *audioOnlyBitmap = mLoader->findWidget( "audioOnlyBitmap" );
+ audioOnlyBitmap->setVisible( false );
+
+ if ( mFileDetails->mTvOutConnected )
+ {
+ tvOutBitmap->setVisible( true );
+ }
+ else if ( mFileDetails->mRNFormat )
+ {
+ realAudioOnlyBitmap->setVisible( true );
+ }
+ else if ( mFileDetails->mPartialPlayback )
+ {
+ partialAudioOnlyBitmap->setVisible( true );
+ }
+ else
+ {
+ audioOnlyBitmap->setVisible( true );
+ }
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::generateThumbNail()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::generateThumbNail()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::generateThumbNail()"));
+
+ //
+ // Generate thumbnail if it is local playback
+ //
+ if ( mFileDetails->mPlaybackMode == EMPXVideoLocal )
+ {
+ if ( mThumbNailState == EThumbNailEmpty )
+ {
+ mThumbnailManager = new ThumbnailManager(); ;
+
+ mThumbnailManager->setThumbnailSize( ThumbnailManager::ThumbnailLarge );
+ mThumbnailManager->setQualityPreference( ThumbnailManager::OptimizeForPerformance );
+
+ if ( connect( mThumbnailManager, SIGNAL( thumbnailReady( QPixmap , void * , int , int ) ),
+ this, SLOT( handleThumbnailReady( QPixmap , void * , int , int ) ) ) )
+ {
+ mThumbnailManager->getThumbnail( mFileDetails->mClipName );
+ mThumbNailState = EThumbNailRequsted;
+ }
+ }
+ }
+ else
+ {
+ mThumbNailState = EThumbNailNotAvailable;
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::handleThumbnailReady()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::handleThumbnailReady(
+ QPixmap tnData, void *internal , int id, int error )
+{
+ Q_UNUSED( internal );
+ Q_UNUSED( id );
+
+ if( ! error && mLoader )
+ {
+ QGraphicsWidget *tvOutBitmap = mLoader->findWidget( "tvOutBitmap" );
+ HbLabel *tvOutLabel = qobject_cast<HbLabel*>( tvOutBitmap );
+
+ QIcon *qicon = new QIcon( tnData );
+
+ HbIcon *hbIcon = new HbIcon( *qicon );
+ hbIcon->setSize( tvOutBitmap->size() );
+ tvOutLabel->setIcon( *hbIcon );
+
+ mThumbNailState = EThumbNailSet;
+ }
+ else
+ {
+ mThumbNailState = EThumbNailNotAvailable;
+ }
+
+ setDefaultBitmap();
+
+ disconnect( mThumbnailManager, SIGNAL( thumbnailReady( QPixmap , void * , int , int ) ),
+ this, SLOT( handleThumbnailReady( QPixmap , void * , int , int ) ) );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::attachVideo()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::attachVideo()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackControlsController::attachVideo()"),
+ _L("file = %s"), mFileDetails->mClipName.data() );
+
+ //
+ // close playback view
+ //
+ mView->closePlaybackView();
+
+ //
+ // emit signal to launch videoservices itemSelected() slot
+ //
+ emit( attachVideoPath( mFileDetails->mClipName ) );
+
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::sendVideo()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::sendVideo()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackControlsController::sendVideo()"),
+ _L("file = %s"), mFileDetails->mClipName.data() );
+
+ //
+ // pause playback
+ //
+ handleCommand( EMPXPbvCmdPause );
+
+ //
+ // send video to shareUI
+ //
+ ShareUi dlg;
+ QStringList fileList;
+ fileList.append( mFileDetails->mClipName );
+ dlg.send( fileList, true );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::handleRNLogoVisibleChanged()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::handleRNLogoVisibleChanged()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackControlsController::handleRNLogoVisibleChanged()"));
+
+ QGraphicsWidget *widget = mLoader->findWidget( QString( "rnLogoBitmap" ) );
+
+ if ( widget->isVisible() )
+ {
+ if ( mRNLogoTimer )
+ {
+ delete mRNLogoTimer;
+ mRNLogoTimer = NULL;
+ }
+
+ mRNLogoTimer = new QTimer( this );
+ mRNLogoTimer->setInterval( KRNLogoTimeOut );
+ mRNLogoTimer->setSingleShot( true );
+ connect( mRNLogoTimer, SIGNAL( timeout() ), this, SLOT( handleRNLogoTimeout() ) );
+
+ mRNLogoTimer->start();
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::handleRNLogoTimeout()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::handleRNLogoTimeout()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::handleRNLogoTimeout()"));
+
+ if ( mRNLogoTimer->isActive() )
+ {
+ mRNLogoTimer->stop();
+ }
+
+ //
+ // Remove RN logo from the controls list and issue play command if needed
+ //
+ mControlsConfig->updateControlList( EControlCmdRemoveRNLogo );
+ handleCommand( EMPXPbvCmdRealOneBitmapTimeout );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::isRNLogoBitmapInControlList()
+// -------------------------------------------------------------------------------------------------
+//
+bool VideoPlaybackControlsController::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() == ERealLogoBitmap )
+ {
+ exist = true;
+ break;
+ }
+ }
+
+ MPX_DEBUG(_L("VideoPlaybackControlsController::isRNLogoBitmapInControlList() [%d]"), exist);
+
+ return exist;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::handleOrientationChanged()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::handleOrientationChanged( Qt::Orientation orientation )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackControlsController::handleOrientationChanged()"),
+ _L("old orientation %d, new orientation = %d"), mOrientation, orientation );
+
+ Qt::Orientation oldOrientaiton = mOrientation;
+ mOrientation = orientation;
+
+ if ( oldOrientaiton == Qt::Vertical && orientation == Qt::Horizontal )
+ {
+ showControls();
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::shouldShowRNLogo()
+// -------------------------------------------------------------------------------------------------
+//
+bool VideoPlaybackControlsController::shouldShowRNLogo()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackControlsController::shouldShowRNLogo()"));
+
+ bool showRNLogo = false;
+
+ if ( mFileDetails->mRNFormat &&
+ !mViewWrapper->IsResumingPlaybackAfterTermination() )
+ {
+ showRNLogo = true;
+ }
+
+ return showRNLogo;
+}
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/controlsrc/videoplaybackdetailsplaybackwindow.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,176 @@
+/*
+* 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 VideoPlaybackDetailsPlaybackWindow
+*
+*/
+
+// Version : %version: 20 %
+
+
+
+#include <QGraphicsSceneMouseEvent>
+
+#include <hbframeitem.h>
+#include <hbpushbutton.h>
+#include <hbframedrawer.h>
+
+#include "mpxvideo_debug.h"
+#include "videoplaybackdocumentloader.h"
+#include "videoplaybackcontrolscontroller.h"
+#include "videoplaybackdetailsplaybackwindow.h"
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDetailsPlaybackWindow::VideoPlaybackDetailsPlaybackWindow
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackDetailsPlaybackWindow::VideoPlaybackDetailsPlaybackWindow(
+ VideoPlaybackControlsController* controller )
+ : mController( controller )
+ , mInitialized( false )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackDetailsPlaybackWindow::VideoPlaybackDetailsPlaybackWindow()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDetailsPlaybackWindow::~VideoPlaybackDetailsPlaybackWindow
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackDetailsPlaybackWindow::~VideoPlaybackDetailsPlaybackWindow()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackDetailsPlaybackWindow::~VideoPlaybackDetailsPlaybackWindow()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDetailsPlaybackWindow::initialize
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackDetailsPlaybackWindow::initialize()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackDetailsPlaybackWindow::initialize()"));
+
+ VideoPlaybackDocumentLoader *loader = mController->layoutLoader();
+
+ //
+ // Don't need to initialize buttons once it gets initialized
+ //
+ if ( loader && ! mInitialized )
+ {
+ mInitialized = true;
+
+ VideoPlaybackViewFileDetails *details = mController->fileDetails();
+
+ //
+ // Connect signal and slot for play button
+ //
+ QGraphicsWidget *widget = loader->findWidget( QString( "detailsViewPlayButton" ) );
+ mPlayButton = qobject_cast<HbPushButton*>( widget );
+ mPlayButton->setFlag( QGraphicsItem::ItemIsFocusable, false );
+
+ connect( mPlayButton, SIGNAL( released() ), this, SLOT( play() ) );
+
+ //
+ // Set framedrawer for semi transparent background
+ //
+ HbFrameDrawer *drawer = mPlayButton->frameBackground();
+
+ if( drawer == NULL )
+ {
+ drawer = new HbFrameDrawer();
+ }
+
+ drawer->setFillWholeRect( true );
+ drawer->setFrameType( HbFrameDrawer::NinePieces );
+ drawer->setFrameGraphicsName( "qtg_fr_multimedia_trans" );
+ mPlayButton->setFrameBackground( drawer );
+
+ //
+ // create 'attach' button and connect corresponding signal/slot
+ //
+ QGraphicsWidget *detailsAttachWidget = loader->findWidget( QString( "detailsAttachButton" ) );
+ HbPushButton *attachButton = qobject_cast<HbPushButton*>( detailsAttachWidget );
+ connect( attachButton, SIGNAL( released() ), mController, SLOT( attachVideo() ) );
+
+ //
+ // create 'share' button and connect corresponding signal/slot
+ //
+ QGraphicsWidget *detailsShareWidget = loader->findWidget( QString( "detailsShareButton" ) );
+ HbPushButton *shareButton = qobject_cast<HbPushButton*>( detailsShareWidget );
+ connect( shareButton, SIGNAL( released() ), mController, SLOT( sendVideo() ) );
+
+ //
+ // by default in xml layout, attachButton is not visible while shareButton is visible.
+ // if it's an 'attach' operation, reverse the visibility order
+ //
+ if ( mController->isAttachOperation() )
+ {
+ attachButton->setVisible( true );
+ shareButton->setVisible( false );
+ }
+ else
+ {
+ //
+ // dim "share" button for streaming
+ //
+ if ( details->mPlaybackMode == EMPXVideoStreaming ||
+ details->mPlaybackMode == EMPXVideoLiveStreaming )
+ {
+ shareButton->setEnabled( false );
+ }
+ }
+ }
+
+ updateState( mController->state() );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDetailsPlaybackWindow::updateState()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackDetailsPlaybackWindow::updateState( TMPXPlaybackState state )
+{
+ MPX_DEBUG(_L("VideoPlaybackDetailsPlaybackWindow::updateState() state = %d"), state );
+
+ switch ( state )
+ {
+ case EPbStatePaused:
+ {
+ mPlayButton->setVisible( true );
+ break;
+ }
+ default:
+ {
+ mPlayButton->setVisible( false );
+ break;
+ }
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDetailsPlaybackWindow::play()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackDetailsPlaybackWindow::play()
+{
+ MPX_DEBUG(_L("VideoPlaybackDetailsPlaybackWindow::play()"));
+
+ //
+ // Only 'Play' button is created in this Details Playback Window,
+ // hence when user touches on the 'Play' button, 'Play' command will be issued here.
+ // On the other hand, when user touches anywhere in the Details Playback Window,
+ // the 'PlayPause' command will be handled via handleTappedOnScreen() method in the controller
+ //
+ mController->handleCommand( EMPXPbvCmdPlay );
+}
+
+//End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/controlsrc/videoplaybackdocumentloader.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,86 @@
+/*
+* 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 VideoPlaybackDocumentLoader
+*
+*/
+
+// Version : %version: 15 %
+
+
+
+#include "mpxvideo_debug.h"
+#include "videoplaybackcontrolbar.h"
+#include "videoplaybackdocumentloader.h"
+#include "videoplaybackfiledetailswidget.h"
+#include "videoplaybackcontrolscontroller.h"
+#include "videoplaybackcontrolconfiguration.h"
+#include "videoplaybackdetailsplaybackwindow.h"
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDocumentLoader::VideoPlaybackDocumentLoader
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackDocumentLoader::VideoPlaybackDocumentLoader(
+ VideoPlaybackControlsController *controller )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackDocumentLoader::VideoPlaybackDocumentLoader()"));
+
+ mController = controller;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDocumentLoader::~VideoPlaybackDocumentLoader
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackDocumentLoader::~VideoPlaybackDocumentLoader()
+{
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::~VideoPlaybackDocumentLoader") );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDocumentLoader::createObject()
+// -------------------------------------------------------------------------------------------------
+//
+QObject *VideoPlaybackDocumentLoader::createObject( const QString& type, const QString &name )
+{
+ MPX_ENTER_EXIT(
+ _L("VideoPlaybackDocumentLoader::createObject()"),
+ _L("type = %s, name = %s"), type.data(), name.data() );
+
+ QObject *object = NULL;
+
+ if ( name == "controlBarLayout" )
+ {
+ object = new VideoPlaybackControlBar( mController );
+ object->setObjectName( name );
+ }
+ else if ( name == "fileDetailsLayout" )
+ {
+ object = new VideoPlaybackFileDetailsWidget( mController );
+ object->setObjectName( name );
+ }
+ else if ( name == "detailsPlaybackWindow" )
+ {
+ object = new VideoPlaybackDetailsPlaybackWindow( mController );
+ object->setObjectName( name );
+ }
+ else
+ {
+ object = HbDocumentLoader::createObject( type, name );
+ }
+
+ return object;
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/controlsrc/videoplaybackfiledetailswidget.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,454 @@
+/*
+* 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 VideoPlaybackFileDetailsWidget
+*
+*/
+
+// Version : %version: 27 %
+
+
+#include <QDir>
+#include <QDateTime>
+#include <QFileInfo>
+
+#include <hbglobal.h>
+#include <hblistwidgetitem.h>
+#include <hbratingslider.h>
+#include <hblistwidget.h>
+#include <hblistviewitem.h>
+#include <hbextendedlocale.h>
+#include <hbanchorlayout.h>
+
+#include "mpxvideo_debug.h"
+#include "videoplaybackdocumentloader.h"
+#include "videoplaybackfiledetailswidget.h"
+#include "videoplaybackdocumentloader.h"
+#include "videoplaybackcontrolscontroller.h"
+
+const float KILOBYTE = 1024 ;
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFileDetailsWidget::VideoPlaybackFileDetailsWidget
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackFileDetailsWidget::VideoPlaybackFileDetailsWidget(
+ VideoPlaybackControlsController* controller )
+ : mController( controller )
+ , mListWidget( 0 )
+ , mFileDetailsUpdated( false )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackFileDetailsWidget::VideoPlaybackFileDetailsWidget()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFileDetailsWidget::~VideoPlaybackFileDetailsWidget
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackFileDetailsWidget::~VideoPlaybackFileDetailsWidget()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackFileDetailsWidget::~VideoPlaybackFileDetailsWidget()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFileDetailsWidget::updateWithFileDetails
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackFileDetailsWidget::updateWithFileDetails(
+ VideoPlaybackViewFileDetails* details )
+{
+ VideoPlaybackDocumentLoader *loader = mController->layoutLoader();
+
+ if ( loader )
+ {
+ //
+ // load fileDetails widget
+ //
+ QGraphicsWidget *widget = loader->findWidget( QString( "fileDetails" ) );
+
+ //
+ // cast fileDetails widget to HbListWidget
+ //
+ mListWidget = qobject_cast<HbListWidget*>( widget );
+
+ //
+ // set the min/max number of lines in the second row
+ //
+ HbListViewItem *prototype = mListWidget->listItemPrototype();
+ prototype->setSecondaryTextRowCount( 1, 30 );
+
+ //
+ // Title
+ //
+ makeTitleItem( details );
+
+ if ( ! mFileDetailsUpdated )
+ {
+ HbExtendedLocale locale = HbExtendedLocale::system();
+
+ mFileDetailsUpdated = true;
+
+ //
+ // Description
+ //
+ addItemToListWidget(
+ hbTrId( "txt_videos_list_description" ), details->mDescription );
+
+ //
+ // Duration
+ //
+ if ( details->mPlaybackMode != EMPXVideoLiveStreaming && details->mDuration > 0 )
+ {
+ int value = (qreal)details->mDuration / (qreal)KPbMilliMultiplier;
+ QString hour = locale.toString( value / 3600 );
+ value = value % 3600;
+ QString min = locale.toString( value / 60 );
+ value = value % 60;
+ QString sec = locale.toString( value );
+
+ addItemToListWidget(
+ hbTrId( "txt_videos_list_duration" ),
+ hbTrId( "txt_videos_list_l1l2l3" ).arg( hour ).arg( min ).arg( sec ) );
+ }
+
+ //
+ // Date/Time
+ //
+ makeDateTimeItem( details );
+
+ //
+ // 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
+ //
+ makeSizeItem( details );
+
+ //
+ // Resolution
+ //
+ if ( details->mVideoEnabled )
+ {
+ QString resolution = hbTrId( "txt_videos_list_l1l2" )
+ .arg( locale.toString( details->mVideoWidth ) )
+ .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
+ //
+ if ( details->mPlaybackMode == EMPXVideoLocal ||
+ details->mPlaybackMode == EMPXVideoProgressiveDownload)
+ {
+ QFileInfo fileInfo( details->mClipName );
+ QString folder = fileInfo.dir().dirName();
+ addItemToListWidget( hbTrId( "txt_videos_list_collection_name" ), folder );
+ }
+ }
+
+ //
+ // Set the rect size dynamically based on the view mode
+ //
+ QGraphicsWidget *content = loader->findWidget( QString( "content" ) );
+ HbAnchorLayout *layout = static_cast<HbAnchorLayout*>( content->layout() );
+
+ if ( layout )
+ {
+ 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 );
+
+ break;
+ }
+ case EAudioOnlyView:
+ {
+ QGraphicsWidget *controlLayout = loader->findWidget( QString( "controlBarLayout" ) );
+ QRectF controlRect = controlLayout->geometry();
+
+ 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;
+ }
+ }
+ }
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFileDetailsWidget::makeTitleItem
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackFileDetailsWidget::makeTitleItem( VideoPlaybackViewFileDetails* details )
+{
+ MPX_DEBUG(_L("VideoPlaybackFileDetailsWidget::makeTitleItem()"));
+
+ //
+ // Title should be the first item in file details list
+ //
+ if ( mController->viewMode() == EAudioOnlyView )
+ {
+ //
+ // show the title for audio-only view
+ //
+ if ( mListWidget->count() == 0 || ! mListWidget->item( 0 )->text().contains( "Title", Qt::CaseInsensitive ) )
+ {
+ QString title = details->mTitle;
+
+ if ( title.count() == 0 )
+ {
+ //
+ // If title is not available, show clip name
+ //
+ QFileInfo fileInfo( details->mClipName );
+ title = fileInfo.completeBaseName();
+ }
+
+ //
+ // populate Title and its associated text
+ //
+ HbListWidgetItem* listWidgetItem = new HbListWidgetItem();
+ listWidgetItem->setText( hbTrId( "txt_videos_list_title" ) );
+ listWidgetItem->setSecondaryText( title );
+ mListWidget->insertItem( 0, listWidgetItem );
+ }
+ }
+ else if ( mListWidget->count() &&
+ mListWidget->item( 0 )->text().contains( "Title", Qt::CaseInsensitive ) )
+ {
+ //
+ // title is displayed under the status pane for video clips,
+ // so hide the title for this details view
+ //
+ delete mListWidget->takeItem ( 0 );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFileDetailsWidget::makeSizeItem
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackFileDetailsWidget::makeSizeItem( VideoPlaybackViewFileDetails* details )
+{
+ if ( details->mPlaybackMode == EMPXVideoLocal ||
+ details->mPlaybackMode == EMPXVideoProgressiveDownload )
+ {
+ QFileInfo fileInfo( details->mClipName );
+
+ //
+ // to prevent overflow, get an unsigned value of file size
+ //
+ ulong fileSize = fileInfo.size();
+
+ //
+ // convert file size to KB, MB, GB accordingly
+ //
+ if ( fileSize > 0 )
+ {
+ HbExtendedLocale locale = HbExtendedLocale::system();
+
+ QString scale;
+
+ //
+ // cast for later conversion with floating point
+ //
+ float size = (float) fileSize;
+
+ if ( size > KILOBYTE )
+ {
+ size /= KILOBYTE;
+ scale = hbTrId( "txt_videos_list_l1_kb" );
+ }
+
+ if ( size > KILOBYTE )
+ {
+ size /= KILOBYTE;
+ scale = hbTrId( "txt_videos_list_l1_mb" );
+ }
+
+ if ( size > KILOBYTE )
+ {
+ size /= KILOBYTE;
+ scale = hbTrId( "txt_videos_list_l1_gb" );
+ }
+
+ int temp = size * 10;
+ size = (float)temp / 10;
+
+ addItemToListWidget(
+ hbTrId( "txt_videos_list_file_size" ), scale.arg( locale.toString( size ) ) );
+ }
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFileDetailsWidget::makeBitRateItem
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackFileDetailsWidget::makeBitRateItem( VideoPlaybackViewFileDetails* details )
+{
+ if ( details->mBitRate > 0 )
+ {
+ HbExtendedLocale locale = HbExtendedLocale::system();
+
+ float bitrate = details->mBitRate;
+
+ QString scale = hbTrId( "txt_videos_list_l1_kbps" );
+
+ if ( bitrate > KILOBYTE )
+ {
+ bitrate /= KILOBYTE;
+ }
+
+ if ( bitrate > KILOBYTE )
+ {
+ bitrate /= KILOBYTE;
+ scale = hbTrId( "txt_videos_list_l1_mbps" );
+ }
+
+ int temp = bitrate * 10;
+ bitrate = (float)temp / 10;
+
+ addItemToListWidget(
+ hbTrId( "txt_videos_list_bitrate" ), scale.arg( locale.toString( bitrate ) ) );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFileDetailsWidget::addItemToListWidget
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackFileDetailsWidget::addItemToListWidget( QString item, QString text )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackFileDetailsWidget::addItemToListWidget"));
+
+ if ( text.count() > 0 )
+ {
+ MPX_DEBUG(_L("VideoPlaybackFileDetailsWidget::addItemToListWidget( %s %s )"),
+ item.data(), text.data() );
+
+ HbListWidgetItem* listWidgetItem = new HbListWidgetItem();
+ listWidgetItem->setText( item );
+ listWidgetItem->setSecondaryText( text );
+
+ mListWidget->addItem( listWidgetItem );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFileDetailsWidget::makeDateTimeItem
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackFileDetailsWidget::makeDateTimeItem( VideoPlaybackViewFileDetails* details )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackFileDetailsWidget::makeDateTimeItem"));
+
+ //
+ // attempt to get 'created' and 'last modified' date/time from metadata first,
+ // if it's not available, then get it from the file system
+ //
+
+ if ( details->mPlaybackMode == EMPXVideoLocal ||
+ details->mPlaybackMode == EMPXVideoProgressiveDownload )
+ {
+ QDateTime dateTime;
+ QFileInfo fileInfo( details->mClipName );
+ HbExtendedLocale locale = HbExtendedLocale::system();
+
+ //
+ // Date created
+ //
+ if ( details->mCreationTime > 0 )
+ {
+ dateTime.setTime_t( details->mCreationTime );
+ }
+ else
+ {
+ dateTime = fileInfo.created();
+ }
+
+ //
+ // convert 'created' date/time to proper string format
+ // according to its current locale
+ //
+ QString date = locale.format( dateTime.date(), r_qtn_date_usual );
+ QString time = locale.format( dateTime.time(), r_qtn_time_long_with_zero );
+ addItemToListWidget( hbTrId( "txt_videos_list_date" ), date + " " + time );
+
+ //
+ // Date modified
+ //
+ if ( details->mModificationTime > 0 )
+ {
+ dateTime.setTime_t( details->mModificationTime );
+ }
+ else
+ {
+ dateTime = fileInfo.lastModified();
+ }
+
+ //
+ // convert 'last modified' date/time to proper string format
+ // according to its current locale
+ //
+ date = locale.format( dateTime.date(), r_qtn_date_usual );
+ time = locale.format( dateTime.time(), r_qtn_time_long_with_zero );
+ addItemToListWidget( hbTrId( "txt_videos_list_modified" ), date + " " + time );
+ }
+}
+
+//End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/controlsrc/videoplaybackfullscreencontrol.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,312 @@
+/*
+* 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 VideoPlaybackFullScreenControl
+*
+*/
+
+// Version : %version: da1mmcf#10 %
+
+
+
+#include <w32std.h>
+
+#include "mpxvideo_debug.h"
+#include "videoplaybackcontrolbar.h"
+#include "videoplaybackfullscreencontrol.h"
+#include "videoplaybackfiledetailswidget.h"
+#include "videoplaybackcontrolscontroller.h"
+#include "videoplaybackdetailsplaybackwindow.h"
+
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFullScreenControl::VideoPlaybackFullScreenControl()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackFullScreenControl::VideoPlaybackFullScreenControl(
+ VideoPlaybackControlsController* controller,
+ TVideoPlaybackControls index,
+ HbWidget* widget,
+ TUint controlproperties )
+ : mController( controller )
+ , mControl( widget )
+ , mControlIndex( index )
+ , mProperties( controlproperties )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackFullScreenControl::VideoPlaybackFullScreenControl()"));
+
+ setParent( mController );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFullScreenControl::~VideoPlaybackFullScreenControl()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackFullScreenControl::~VideoPlaybackFullScreenControl()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::~VideoPlaybackFullScreenControl"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFullScreenControl::setVisible()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackFullScreenControl::setVisible( bool visible )
+{
+ switch ( mControlIndex )
+ {
+ case EControlBar:
+ {
+ static_cast<VideoPlaybackControlBar*>(mControl)->setVisibleToControlBar( visible );
+ break;
+ }
+ default:
+ {
+ mControl->setVisible( visible );
+ break;
+ }
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFullScreenControl::isVisible()
+// -------------------------------------------------------------------------------------------------
+//
+bool VideoPlaybackFullScreenControl::isVisible()
+{
+ return mControl->isVisible();
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFullScreenControl::setVisibility()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackFullScreenControl::setVisibility( TMPXPlaybackState state )
+{
+ MPX_DEBUG(_L("VideoPlaybackFullScreenControl::setVisibility()"));
+
+ bool visible = false;
+
+ switch( state )
+ {
+ case EPbStatePlaying:
+ {
+ if ( mProperties & EShownWhenPlaying )
+ {
+ visible = true;
+ }
+ break;
+ }
+ case EPbStatePaused:
+ {
+ if ( mProperties & EShownWhenPaused )
+ {
+ visible = true;
+ }
+ break;
+ }
+ case EPbStatePluginSeeking:
+ {
+ if ( mProperties & EShownWhenSeeking )
+ {
+ visible = true;
+ }
+ break;
+ }
+ case EPbStateBuffering:
+ {
+ if ( mProperties & EShownWhenBuffering )
+ {
+ visible = true;
+ }
+ break;
+ }
+ case EPbStateNotInitialised:
+ case EPbStateInitialising:
+ {
+ if ( mProperties & EShownWhenInitializing )
+ {
+ visible = true;
+ }
+ break;
+ }
+ }
+
+ setVisible( visible );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFullScreenControl::controlIndex()
+// -------------------------------------------------------------------------------------------------
+//
+TVideoPlaybackControls VideoPlaybackFullScreenControl::controlIndex()
+{
+ return mControlIndex;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFullScreenControl::durationChanged()
+// -------------------------------------------------------------------------------------------------
+//
+bool VideoPlaybackFullScreenControl::durationChanged( int duration )
+{
+ bool changed = EFalse;
+
+ if ( mControlIndex == EControlBar )
+ {
+ MPX_DEBUG(_L("VideoPlaybackFullScreenControl::DurationChanged() [%d]"), duration);
+
+ static_cast<VideoPlaybackControlBar*>(mControl)->durationChanged( duration );
+
+ changed = ETrue;
+ }
+
+ return changed;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFullScreenControl::positionChanged()
+// -------------------------------------------------------------------------------------------------
+//
+bool VideoPlaybackFullScreenControl::positionChanged( int position )
+{
+ bool changed = EFalse;
+
+ if ( mControlIndex == EControlBar )
+ {
+ MPX_DEBUG(_L("VideoPlaybackFullScreenControl::positionChanged() [%d]"), position);
+
+ static_cast<VideoPlaybackControlBar*>(mControl)->positionChanged( position );
+
+ changed = ETrue;
+ }
+
+ return changed;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFullScreenControl::aspectRatioChanged()
+// -------------------------------------------------------------------------------------------------
+//
+bool VideoPlaybackFullScreenControl::aspectRatioChanged( int aspectRatio )
+{
+ bool changed = EFalse;
+
+ if ( mControlIndex == EControlBar )
+ {
+ MPX_DEBUG(
+ _L("VideoPlaybackFullScreenControl::aspectRatioChanged() [%d]"), aspectRatio);
+
+ static_cast<VideoPlaybackControlBar*>(mControl)->aspectRatioChanged( aspectRatio );
+
+ changed = ETrue;
+ }
+
+ return changed;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFullScreenControl::setDownloadSize()
+// -------------------------------------------------------------------------------------------------
+//
+bool VideoPlaybackFullScreenControl::setDownloadSize( int /*size*/ )
+{
+ bool changed = EFalse;
+
+ /*
+ if ( mControlIndex == EMPXProgressBar )
+ {
+ MPX_DEBUG(_L("VideoPlaybackFullScreenControl::SetDownloadSize() [%d]"), size);
+
+ //static_cast<VideoPlaybackProgressBar*>(mControl)->SetDownloadSize( size );
+
+ changed = ETrue;
+ }
+*/
+ return changed;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFullScreenControl::updateDownloadPosition()
+// -------------------------------------------------------------------------------------------------
+//
+bool VideoPlaybackFullScreenControl::updateDownloadPosition( int /*size*/ )
+{
+ bool changed = EFalse;
+
+ /*
+ if ( mControlIndex == EMPXProgressBar )
+ {
+ MPX_DEBUG(_L("VideoPlaybackFullScreenControl::UpdateDownloadPosition() [%d]"), size);
+
+ //static_cast<VideoPlaybackProgressBar*>(mControl)->updateDownloadPosition( size );
+
+ changed = ETrue;
+ }*/
+
+ return changed;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFullScreenControl::updateState()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackFullScreenControl::updateState( TMPXPlaybackState state )
+{
+ switch ( mControlIndex )
+ {
+ case EControlBar:
+ {
+ static_cast<VideoPlaybackControlBar*>(mControl)->updateState( state );
+ break;
+ }
+ case EDetailsViewPlaybackWindow:
+ {
+ static_cast<VideoPlaybackDetailsPlaybackWindow*>(mControl)->updateState( state );
+ break;
+ }
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFullScreenControl::updateControlsWithFileDetails()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackFullScreenControl::updateControlsWithFileDetails(
+ VideoPlaybackViewFileDetails* details )
+{
+ switch ( mControlIndex )
+ {
+ case EControlBar:
+ {
+ static_cast<VideoPlaybackControlBar*>(mControl)->updateWithFileDetails( details );
+ break;
+ }
+ case EFileDetailsWidget:
+ {
+ static_cast<VideoPlaybackFileDetailsWidget*>(mControl)->updateWithFileDetails( details );
+ break;
+ }
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFullScreenControl::updateControlProperties()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackFullScreenControl::updateControlProperties( TUint properties )
+{
+ mProperties = properties;
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/controlsrc/videoplaybackprogressbar.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,448 @@
+/*
+* 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 VideoPlaybackProgressBar
+*
+*/
+
+// Version : %version: da1mmcf#28 %
+
+
+
+
+#include <QTime>
+#include <QTimer>
+#include <QGraphicsSceneMouseEvent>
+
+#include <hblabel.h>
+#include <hbframeitem.h>
+#include <hbframedrawer.h>
+#include <hbprogressslider.h>
+#include <hbextendedlocale.h>
+
+#include "mpxvideo_debug.h"
+#include "videoplaybackprogressbar.h"
+#include "videoplaybackdocumentloader.h"
+#include "videoplaybackcontrolscontroller.h"
+
+const int KSeekingTimeOut = 250;
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackProgressBar::VideoPlaybackProgressBar
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackProgressBar::VideoPlaybackProgressBar(
+ VideoPlaybackControlsController* controller )
+ : mController( controller )
+ , mDraggingPosition( 0 )
+ , mSetPosition( -1 )
+ , mNeedToResumeAfterSetPosition( false )
+ , mInitialized( false )
+ , mSliderDragging( false )
+ , mLongTimeFormat( false )
+ , mLiveStreaming( false )
+ , mSeekingTimer( NULL )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackProgressBar::VideoPlaybackProgressBar()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackProgressBar::~VideoPlaybackProgressBar
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackProgressBar::~VideoPlaybackProgressBar()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackProgressBar::~VideoPlaybackProgressBar()"));
+
+ if ( mSeekingTimer )
+ {
+ disconnect( mSeekingTimer, SIGNAL( timeout() ), this, SLOT( handleSeekingTimeout() ) );
+
+ if ( mSeekingTimer->isActive() )
+ {
+ mSeekingTimer->stop();
+ }
+
+ delete mSeekingTimer;
+ mSeekingTimer = NULL;
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackProgressBar::initialize
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackProgressBar::initialize()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackProgressBar::initialize()"));
+
+ VideoPlaybackDocumentLoader *loader = mController->layoutLoader();
+
+ //
+ // Don't need to initialize buttons once it gets initialized
+ //
+ if ( loader && ! mInitialized )
+ {
+ mInitialized = true;
+ mLiveStreaming =
+ ( mController->fileDetails()->mPlaybackMode == EMPXVideoLiveStreaming )? true:false;
+
+ //
+ // Create a timer for seeking.
+ // We will issue SetPosition every KSeekingTimeOut msec to show the current frame to user
+ //
+ mSeekingTimer = new QTimer();
+ mSeekingTimer->setSingleShot( false );
+ mSeekingTimer->setInterval( KSeekingTimeOut );
+ connect( mSeekingTimer, SIGNAL( timeout() ), this, SLOT( handleSeekingTimeout() ) );
+
+ //
+ // progress slider
+ //
+ QGraphicsWidget *widget = loader->findWidget( QString( "progressSlider" ) );
+ mProgressSlider = qobject_cast<HbProgressSlider*>( widget );
+
+ connect( mProgressSlider, SIGNAL( sliderPressed() ), this, SLOT( handleSliderPressed() ) );
+ connect( mProgressSlider, SIGNAL( sliderReleased() ), this, SLOT( handleSliderReleased() ) );
+ connect( mProgressSlider, SIGNAL( sliderMoved( int ) ), this, SLOT( handleSliderMoved( int ) ) );
+
+ //
+ // If we init the progress bar after pp sends the duration informatin
+ // we need to set the duration manually
+ //
+ durationChanged( (qreal)mController->fileDetails()->mDuration / (qreal)KPbMilliMultiplier );
+
+ //
+ // Set the position to 0 until we get position information
+ //
+ positionChanged( 0 );
+
+ //
+ // 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 );
+ mProgressSlider->setBackgroundItem( frameItem );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackProgressBar::durationChanged
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackProgressBar::durationChanged( int duration )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::durationChanged duration = %d"), duration );
+
+ if ( mLiveStreaming )
+ {
+ mDuration = 0;
+ mProgressSlider->setMaxText( hbTrId( "txt_videos_slidervalue_live" ) );
+ }
+ else
+ {
+ mDuration = duration;
+
+ if ( ( mDuration / 3600 ) > 0 )
+ {
+ mLongTimeFormat = true;
+ }
+ else
+ {
+ mLongTimeFormat = false;
+ }
+
+ mProgressSlider->setMaxText( valueToReadableFormat( mDuration ) );
+ }
+
+ mProgressSlider->setRange( 0, mDuration );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackProgressBar::positionChanged
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackProgressBar::positionChanged( int position )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::positionChanged position = %d"), position );
+
+ //
+ // While dragging event, don't update old position information from mpx framework
+ //
+ if ( ! mSliderDragging )
+ {
+ updatePostion( position );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackProgressBar::updatePostion
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackProgressBar::updatePostion( int position )
+{
+ if ( position < 0 )
+ {
+ position = 0;
+ }
+ else if ( position > mDuration && ! mLiveStreaming )
+ {
+ position = mDuration;
+ }
+
+ MPX_DEBUG(_L("VideoPlaybackProgressBar::updatePostion position = %d"), position );
+
+ mProgressSlider->setMinText( valueToReadableFormat( position ) );
+
+ //
+ // Don't need to set the slider for live streaming
+ //
+ if ( ! mLiveStreaming )
+ {
+ mProgressSlider->setSliderValue( position );
+ mProgressSlider->setProgressValue( position );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackProgressBar::valueToReadableFormat
+// -------------------------------------------------------------------------------------------------
+//
+QString VideoPlaybackProgressBar::valueToReadableFormat( int value )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::valueToReadableFormat value = %d"), value);
+
+ int hour = value / 3600;
+ value = value % 3600;
+ int minutes = value / 60;
+ value = value % 60;
+ int second = value;
+
+ QTime time( hour ,minutes ,second );
+ QString str;
+
+ HbExtendedLocale locale = HbExtendedLocale::system();
+
+ if ( mLongTimeFormat )
+ {
+ str = locale.format( time, r_qtn_time_durat_long );
+ }
+ else
+ {
+ str = locale.format( time, r_qtn_time_durat_min_sec );
+ }
+
+ return str;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackProgressBar::handleSliderPressed
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackProgressBar::handleSliderPressed()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackProgressBar::handleSliderPressed()"));
+
+ mSliderDragging = true;
+
+ mController->resetDisappearingTimers( ETimerCancel );
+
+ //
+ // Pause the playback if it's playing
+ //
+ if( mController->state() == EPbStatePlaying )
+ {
+ mNeedToResumeAfterSetPosition = true;
+ mController->handleCommand( EMPXPbvCmdCustomPause );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackProgressBar::handleSliderMoved
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackProgressBar::handleSliderMoved( int value )
+{
+ MPX_DEBUG(_L("VideoPlaybackProgressBar::handleSliderMoved() position = %d"), value);
+
+ updatePostion( value );
+
+ //
+ // If the slider is dragging, start the timer and seek every KSeekingTimeOut msec
+ //
+ if ( mSliderDragging )
+ {
+ mDraggingPosition = value;
+ MPX_DEBUG(_L("VideoPlaybackProgressBar::handleSliderMoved() mDraggingPosition = %d"), mDraggingPosition);
+
+ if ( mSeekingTimer && ! mSeekingTimer->isActive() )
+ {
+ mSeekingTimer->start();
+ }
+ }
+ else
+ {
+ if ( value >= mDuration )
+ {
+ MPX_DEBUG(_L("VideoPlaybackProgressBar::setPosition() reached end of the clip"));
+
+ mController->handleCommand( EMPXPbvCmdEndOfClip );
+ }
+ else
+ {
+ value = mProgressSlider->sliderValue();
+
+ MPX_DEBUG(_L("VideoPlaybackProgressBar::setPosition() position = %d"), value);
+ mController->handleCommand( EMPXPbvCmdSetPosition, value );
+ }
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackProgressBar::handleSliderReleased
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackProgressBar::handleSliderReleased()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackProgressBar::handleSliderReleased()"));
+
+ mSliderDragging = false;
+
+ if ( mSeekingTimer && mSeekingTimer->isActive() )
+ {
+ mSeekingTimer->stop();
+ }
+
+ mController->resetDisappearingTimers( ETimerReset );
+ int value = mProgressSlider->sliderValue();
+
+ if ( value >= mDuration )
+ {
+ MPX_DEBUG(_L("VideoPlaybackProgressBar::setPosition() reached end of the clip"));
+ mController->handleCommand( EMPXPbvCmdEndOfClip );
+ }
+ else
+ {
+ if ( value < 0 )
+ {
+ value = 0;
+ }
+
+ MPX_DEBUG(_L("VideoPlaybackProgressBar::setPosition() position = %d"), value);
+ mController->handleCommand( EMPXPbvCmdSetPosition, value );
+
+ //
+ // Resume if it was playing
+ //
+ if( mNeedToResumeAfterSetPosition )
+ {
+ mNeedToResumeAfterSetPosition = false;
+ mController->handleCommand( EMPXPbvCmdCustomPlay );
+ }
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackProgressBar::updateWithFileDetails()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackProgressBar::updateWithFileDetails(
+ VideoPlaybackViewFileDetails* details )
+{
+ Q_UNUSED( details );
+
+ MPX_DEBUG(_L("VideoPlaybackProgressBar::updateControlsWithFileDetails()"));
+
+ setEnableProgressSlider( true );
+
+ mProgressSlider->backgroundItem()->setVisible(
+ ( mController->viewMode() == EFullScreenView )? ETrue:EFalse );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackProgressBar::updateState()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackProgressBar::updateState( TMPXPlaybackState state )
+{
+ MPX_DEBUG(_L("VideoPlaybackProgressBar::updateState() state = %d"), state );
+
+ switch ( state )
+ {
+ case EPbStatePlaying:
+ case EPbStatePaused:
+ {
+ setEnableProgressSlider( true );
+
+ break;
+ }
+ default:
+ {
+ setEnableProgressSlider( false );
+
+ break;
+ }
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackProgressBar::handleSeekingTimeout()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackProgressBar::handleSeekingTimeout()
+{
+ if ( mDraggingPosition >= mDuration )
+ {
+ mDraggingPosition = mDuration;
+ }
+ else if( mDraggingPosition < 0 )
+ {
+ mDraggingPosition = 0;
+ }
+
+ MPX_DEBUG(_L("VideoPlaybackProgressBar::handleSeekingTimeout() Dragging pos = %d, Set pos = %d")
+ , mDraggingPosition, mSetPosition );
+
+ if ( mSetPosition != mDraggingPosition )
+ {
+ mSetPosition = mDraggingPosition;
+ mController->handleCommand( EMPXPbvCmdSetPosition, mSetPosition );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackProgressBar::setEnableProgressSlider()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackProgressBar::setEnableProgressSlider( bool enable )
+{
+ MPX_DEBUG(_L("VideoPlaybackProgressBar::setEnableProgressSlider() enable = %d"), enable);
+
+ if ( ! enable ||
+ ! mController->fileDetails()->mPausableStream ||
+ ! mController->fileDetails()->mSeekable )
+ {
+ if ( mProgressSlider->isEnabled() )
+ {
+ mProgressSlider->setEnabled( false );
+ }
+ }
+ else if ( ! mProgressSlider->isEnabled() )
+ {
+ mProgressSlider->setEnabled( true );
+ }
+}
+
+//End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/controlsrc/videoplaybackstatuspanecontrol.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,314 @@
+/*
+* 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 VideoPlaybackStatusPaneControl
+*
+*/
+
+// Version : %version: 21 %
+
+
+
+#include <QFileInfo>
+
+#include <hbmenu.h>
+#include <hblabel.h>
+#include <hbaction.h>
+#include <hbgroupbox.h>
+#include <hbinstance.h>
+#include <hbframeitem.h>
+#include <hbframedrawer.h>
+
+#include <w32std.h>
+
+#include "mpxvideo_debug.h"
+#include "videobaseplaybackview.h"
+#include "videoplaybackdocumentloader.h"
+#include "videoplaybackstatuspanecontrol.h"
+#include "videoplaybackcontrolscontroller.h"
+
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackStatusPaneControl::VideoPlaybackStatusPaneControl()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackStatusPaneControl::VideoPlaybackStatusPaneControl(
+ VideoPlaybackControlsController* controller,
+ TVideoPlaybackControls index,
+ HbWidget* widget,
+ TUint controlproperties )
+ : VideoPlaybackFullScreenControl( controller, index, widget, controlproperties )
+ , mActionBack( NULL )
+ , mTitleLabel( NULL )
+ , mTitleGroupBox( NULL )
+ , mTitleLayout( NULL )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackStatusPaneControl::VideoPlaybackStatusPaneControl()"));
+
+ Q_UNUSED( widget );
+
+ mActionBack = new HbAction( Hb::BackNaviAction );
+
+ //
+ // Press "back" key means going back to previous view if it's avaiable
+ //
+ connect( mActionBack, SIGNAL( triggered() ), mController->view(), SLOT( closePlaybackView() ) );
+ mController->view()->setNavigationAction( mActionBack );
+
+ connect( mController->view()->menu(), SIGNAL( aboutToShow() ), this, SLOT( handleAboutToShow() ) );
+ connect( mController->view()->menu(), SIGNAL( aboutToHide() ), this, SLOT( handleAboutToHide() ) );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackStatusPaneControl::~VideoPlaybackStatusPaneControl()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackStatusPaneControl::~VideoPlaybackStatusPaneControl()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackStatusPaneControl::~VideoPlaybackStatusPaneControl"));
+
+ disconnect( mActionBack, SIGNAL( triggered() ), mController->view(), SLOT( closePlaybackView() ) );
+ disconnect( mActionBack, SIGNAL( triggered() ), this, SLOT( openFullScreenView() ) );
+ mController->view()->setNavigationAction( 0 );
+
+ disconnect( mController->view()->menu(), SIGNAL( aboutToShow() ), this, SLOT( handleAboutToShow() ) );
+ disconnect( mController->view()->menu(), SIGNAL( aboutToHide() ), this, SLOT( handleAboutToHide() ) );
+
+ mController->view()->menu()->close();
+
+ if ( mActionBack )
+ {
+ delete mActionBack;
+ mActionBack = NULL;
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackStatusPaneControl::setVisible()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackStatusPaneControl::setVisible( bool visible )
+{
+ MPX_DEBUG(_L("VideoPlaybackStatusPaneControl::setVisible visible = %d"), visible);
+
+ mVisible = visible;
+
+ if ( mVisible )
+ {
+ mController->view()->setTitleBarVisible( true );
+ mController->view()->setStatusBarVisible( true );
+
+ if ( mController->viewMode() == EFullScreenView ||
+ mController->viewMode() == EDetailsView )
+ {
+ mTitleLayout->setVisible( true );
+ }
+ }
+ else
+ {
+ mController->view()->menu()->close();
+ mController->view()->setTitleBarVisible( false );
+ mController->view()->setStatusBarVisible( false );
+
+ mTitleLayout->setVisible( false );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackStatusPaneControl::isVisible()
+// -------------------------------------------------------------------------------------------------
+//
+bool VideoPlaybackStatusPaneControl::isVisible()
+{
+ return mVisible;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackStatusPaneControl::setVisibility()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackStatusPaneControl::setVisibility( TMPXPlaybackState state )
+{
+ MPX_DEBUG(_L("VideoPlaybackStatusPaneControl::setVisibility()"));
+
+ switch( state )
+ {
+ case EPbStatePlaying:
+ case EPbStatePaused:
+ {
+ setMenu( mController->fileDetails() );
+ break;
+ }
+ case EPbStatePluginSeeking:
+ case EPbStateBuffering:
+ case EPbStateNotInitialised:
+ case EPbStateInitialising:
+ {
+ mController->view()->menu()->clearActions();
+ break;
+ }
+ }
+
+ VideoPlaybackFullScreenControl::setVisibility( state );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackStatusPaneControl::updateControlsWithFileDetails()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackStatusPaneControl::updateControlsWithFileDetails(
+ VideoPlaybackViewFileDetails* details )
+{
+ MPX_DEBUG(_L("VideoPlaybackStatusPaneControl::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.completeBaseName();
+ }
+
+ QGraphicsWidget *qWidget = mController->layoutLoader()->findWidget( QString( "title" ) );
+ mTitleLabel = qobject_cast<HbLabel*>( qWidget );
+ mTitleLabel->setPlainText( title );
+
+ qWidget = mController->layoutLoader()->findWidget( QString( "titleGroupBox" ) );
+ mTitleGroupBox = qobject_cast<HbGroupBox*>( 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:
+ {
+ //
+ // Set TitleBar transparent and go back to preview view with back key
+ //
+ disconnect( mActionBack, SIGNAL( triggered() ), this, SLOT( openFullScreenView() ) );
+ connect( mActionBack, SIGNAL( triggered() ), mController->view(), SLOT( closePlaybackView() ) );
+
+ mController->view()->setViewFlags( mController->view()->viewFlags() |
+ HbView::ViewTitleBarTransparent |
+ HbView::ViewStatusBarTransparent );
+
+ mTitleLabel->setVisible( true );
+ mTitleGroupBox->setVisible( false );
+
+ break;
+ }
+ case EDetailsView:
+ {
+ //
+ // Set TitleBar opaque and go back to full screen view with back key
+ //
+ disconnect( mActionBack, SIGNAL( triggered() ), mController->view(), SLOT( closePlaybackView() ) );
+ connect( mActionBack, SIGNAL( triggered() ), this, SLOT( openFullScreenView() ) );
+
+ mController->view()->setViewFlags( HbView::ViewFlagNone );
+
+ mTitleGroupBox->setVisible( true );
+ mTitleLabel->setVisible( false );
+
+ break;
+ }
+ case EAudioOnlyView:
+ {
+ //
+ // Set TitleBar opaque and go back to preview view with back key
+ //
+ disconnect( mActionBack, SIGNAL( triggered() ), this, SLOT( openFullScreenView() ) );
+ connect( mActionBack, SIGNAL( triggered() ), mController->view(), SLOT( closePlaybackView() ) );
+
+ mController->view()->setViewFlags( HbView::ViewFlagNone );
+ break;
+ }
+ }
+
+ setMenu( details );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackStatusPaneControl::setMenu()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackStatusPaneControl::setMenu( VideoPlaybackViewFileDetails* details )
+{
+ MPX_DEBUG(_L("VideoPlaybackStatusPaneControl::setMenu()"));
+
+ //
+ // No available menu for now
+ //
+ Q_UNUSED( details );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackStatusPaneControl::handleAboutToShow()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackStatusPaneControl::handleAboutToShow()
+{
+ MPX_DEBUG(_L("VideoPlaybackStatusPaneControl::handleAboutToShow()"));
+
+ mController->resetDisappearingTimers( ETimerCancel );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackStatusPaneControl::handleAboutToHide()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackStatusPaneControl::handleAboutToHide()
+{
+ MPX_DEBUG(_L("VideoPlaybackStatusPaneControl::handleAboutToHide()"));
+
+ mController->resetDisappearingTimers( ETimerReset );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackStatusPaneControl::controlListUpdated()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackStatusPaneControl::controlListUpdated(
+ VideoPlaybackViewFileDetails* details )
+{
+ setMenu( details );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackStatusPaneControl::openFullScreenView()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackStatusPaneControl::openFullScreenView()
+{
+ MPX_DEBUG(_L("VideoPlaybackStatusPaneControl::openFullScreenView()"));
+
+ mController->changeViewMode( EFullScreenView );
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/controlsrc/videoplaybacktoolbar.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,768 @@
+/*
+* 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 VideoPlaybackToolBar
+*
+*/
+
+// Version : %version: 10 %
+
+
+
+#include <QTimer>
+#include <QGraphicsLayout>
+
+#include <hbaction.h>
+#include <hbtoolbar.h>
+#include <hbinstance.h>
+#include <hbtoolbutton.h>
+#include <w32std.h>
+
+#include "mpxvideo_debug.h"
+#include "videobaseplaybackview.h"
+#include "videoplaybacktoolbar.h"
+#include "mpxcommonvideoplaybackview.hrh"
+#include "videoplaybackdocumentloader.h"
+#include "videoplaybackviewfiledetails.h"
+#include "videoplaybackcontrolscontroller.h"
+
+const int KSeekStartTimeOut = 700;
+const int KRetrieveButtonTimeOut = 1000;
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackToolBar::VideoPlaybackToolBar()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackToolBar::VideoPlaybackToolBar(
+ VideoPlaybackControlsController* controller )
+ : mController( controller )
+ , mSeekStartTimer( NULL )
+ , mRetrieveButtonTimer( NULL )
+ , mSeekingState( ENotSeeking )
+ , mInitialized( false )
+ , mPosition( 0 )
+ , mDuration( 0 )
+ , mAspectRatio( EMPXPbvCmdNaturalAspectRatio )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackToolBar::VideoPlaybackToolBar"));
+
+ mToolBar = mController->view()->toolBar();
+ mToolBar->setOrientation( Qt::Horizontal );
+
+ mController->view()->hideItems( Hb::ToolBarItem );
+
+ initialize();
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackToolBar::~VideoPlaybackToolBar()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackToolBar::~VideoPlaybackToolBar()
+{
+ MPX_DEBUG(_L("VideoPlaybackToolBar::~VideoPlaybackToolBar()"));
+
+ mToolBar->clearActions();
+
+ for ( int i = 0 ; i < mButtonIcons.count() ; i++ )
+ {
+ if ( mButtonIcons[i] )
+ {
+ delete mButtonIcons[i];
+ }
+ }
+ mButtonIcons.clear();
+
+ if ( mSeekStartTimer )
+ {
+ if ( mSeekStartTimer->isActive() )
+ {
+ mSeekStartTimer->stop();
+ }
+
+ delete mSeekStartTimer;
+ mSeekStartTimer = NULL;
+ }
+
+ if ( mRetrieveButtonTimer )
+ {
+ if ( mRetrieveButtonTimer->isActive() )
+ {
+ mRetrieveButtonTimer->stop();
+ }
+
+ delete mRetrieveButtonTimer;
+ mRetrieveButtonTimer = NULL;
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackToolBar::initialize()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackToolBar::initialize()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackToolBar::initialize()"));
+
+ //
+ // Don't need to initialize buttons once it gets initialized
+ //
+ if ( ! mInitialized )
+ {
+ mInitialized = true;
+
+ QActionGroup *actionsGroup = new QActionGroup( mToolBar );
+
+ for ( int i = 0 ; i < EButtonCount ; i++ )
+ {
+ mButtonActions.append( new HbAction( actionsGroup ) );
+ }
+
+ for ( int i = 0 ; i < EIconCount ; i++ )
+ {
+ mButtonIcons.append( new HbIcon() );
+ }
+
+ //
+ // RW button
+ //
+ mButtonIcons[ERWIcon]->setIconName( "qtg_mono_previous" );
+ mButtonActions[E2ndButton]->setIcon( *mButtonIcons[ERWIcon] );
+
+ //
+ // Play/Pause button
+ //
+ mButtonIcons[EPlayIcon]->setIconName( "qtg_mono_play" );
+ mButtonIcons[EPauseIcon]->setIconName( "qtg_mono_pause" );
+ mButtonActions[E3rdButton]->setIcon( *mButtonIcons[EPlayIcon] );
+
+ //
+ // FF button
+ //
+ mButtonIcons[EFFIcon]->setIconName( "qtg_mono_next" );
+ mButtonActions[E4thButton]->setIcon( *mButtonIcons[EFFIcon] );
+
+ //
+ // Details button
+ //
+ mButtonIcons[EDetailsIcon]->setIconName( "qtg_mono_info" );
+ mButtonActions[E5thButton]->setIcon( *mButtonIcons[EDetailsIcon] );
+
+ //
+ // Aspect ratio buttons
+ //
+ mButtonIcons[ENaturalIcon]->setIconName( "qtg_mono_aspect_ratio_natural" );
+ mButtonIcons[EStretchIcon]->setIconName( "qtg_mono_aspect_ratio_stretched" );
+ mButtonIcons[EZoomIcon]->setIconName( "qtg_mono_aspect_ratio_zoom" );
+ mButtonActions[E1stButton]->setIcon( *mButtonIcons[ENaturalIcon] );
+
+ //
+ // Attach/Share button
+ //
+ mButtonIcons[EAttachIcon]->setIconName( "qtg_mono_attach" );
+ mButtonIcons[EShareIcon]->setIconName( "qtg_mono_share" );
+
+ for ( int i = 0 ; i < EButtonCount ; i++ )
+ {
+ mButtonActions[i]->setCheckable( false );
+ mToolBar->addAction( mButtonActions[i] );
+ }
+
+ mDuration = (qreal)mController->fileDetails()->mDuration / (qreal)KPbMilliMultiplier;
+
+ //
+ // Create a timer for seeking.
+ // We will issue SetPosition every KSeekingTimeOut msec to show the current frame to user
+ //
+ mSeekStartTimer = new QTimer();
+ mSeekStartTimer->setSingleShot( true );
+ mSeekStartTimer->setInterval( KSeekStartTimeOut );
+
+ //
+ // get window size
+ //
+ RWindow *window = mController->view()->getWindow();
+ TRect displayRect = TRect( TPoint( window->Position() ), TSize( window->Size() ) );
+
+ //
+ // get window aspect ratio
+ // if device is in portrait mode, width > height
+ // if device is in landscape mode, width < height
+ //
+ TReal32 width = (TReal32) displayRect.Width();
+ TReal32 height = (TReal32) displayRect.Height();
+ mDisplayAspectRatio = (width > height)? (width / height) : (height / width);
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackToolBar::playPause()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackToolBar::playPause()
+{
+ MPX_DEBUG(_L("VideoPlaybackToolBar::playPause()"));
+
+ mController->resetDisappearingTimers( ETimerReset );
+ mController->handleCommand( EMPXPbvCmdPlayPause );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackToolBar::ffPressing()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackToolBar::ffPressing()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackToolBar::ffPressing()"),
+ _L("mSeekingState = %d"), mSeekingState );
+
+ if ( mSeekingState == ENotSeeking )
+ {
+ mSeekingState = EFastForwarding;
+
+ mController->handleCommand( EMPXPbvCmdSeekForward );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackToolBar::rwPressing()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackToolBar::rwPressing()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackToolBar::rwPressing()"),
+ _L("mSeekingState = %d"), mSeekingState );
+
+ if ( mSeekingState == ENotSeeking )
+ {
+ mSeekingState = ERewinding;
+
+ mController->handleCommand( EMPXPbvCmdSeekBackward );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackToolBar::ffReleased()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackToolBar::ffReleased()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackToolBar::ffReleased()"),
+ _L("mSeekingState = %d"), mSeekingState );
+
+ disconnect( mSeekStartTimer, SIGNAL( timeout() ), this, SLOT( ffPressing() ) );
+
+ if ( mSeekStartTimer->isActive() )
+ {
+ mSeekStartTimer->stop();
+ }
+
+ if ( mSeekingState == EFastForwarding )
+ {
+ mController->handleCommand( EMPXPbvCmdEndSeek );
+ }
+ else
+ {
+ int temp = mPosition + KMPXFastForward;
+ MPX_DEBUG(_L("VideoPlaybackToolBar::ffReleased() temp position = %d"), temp);
+
+ //
+ // If it has the playing time which is less than KMPXFastForward, ignore
+ //
+ if ( temp < mDuration )
+ {
+ mController->handleCommand( EMPXPbvCmdSetPosition, temp );
+ }
+ }
+
+ mSeekingState = ENotSeeking;
+ mController->resetDisappearingTimers( ETimerReset );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackToolBar::rwReleased()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackToolBar::rwReleased()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackToolBar::rwReleased()"),
+ _L("mSeekingState = %d"), mSeekingState );
+
+ disconnect( mSeekStartTimer, SIGNAL( timeout() ), this, SLOT( rwPressing() ) );
+
+ if ( mSeekStartTimer->isActive() )
+ {
+ mSeekStartTimer->stop();
+ }
+
+ if ( mSeekingState == ERewinding )
+ {
+ mController->handleCommand( EMPXPbvCmdEndSeek );
+ }
+ else
+ {
+ int temp = mPosition + KMPXRewind;
+ MPX_DEBUG(_L("VideoPlaybackToolBar::rwReleased() temp position = %d"), temp);
+
+ //
+ // If it played less than KMPXRewind, jump to 0
+ //
+ if ( temp < 0 )
+ {
+ temp = 0;
+ }
+
+ mController->handleCommand( EMPXPbvCmdSetPosition, temp );
+ }
+
+ mSeekingState = ENotSeeking;
+ mController->resetDisappearingTimers( ETimerReset );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackToolBar::changeAspectRatio()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackToolBar::changeAspectRatio()
+{
+ MPX_DEBUG(_L("VideoPlaybackToolBar::changeAspectRatio()"));
+
+ mController->resetDisappearingTimers( ETimerReset );
+
+ TMPXVideoPlaybackViewCommandIds cmd = EMPXPbvCmdStretchAspectRatio;
+
+ switch( mAspectRatio )
+ {
+ case EMMFZoom:
+ {
+ cmd = EMPXPbvCmdNaturalAspectRatio;
+ break;
+ }
+ case EMMFStretch:
+ {
+ cmd = EMPXPbvCmdZoomAspectRatio;
+ break;
+ }
+ }
+
+ mController->handleCommand( cmd );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackToolBar::updateState()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackToolBar::updateState( TMPXPlaybackState state )
+{
+ MPX_DEBUG(_L("VideoPlaybackToolBar::updateState() state = %d"), state );
+
+ switch ( state )
+ {
+ case EPbStatePlaying:
+ {
+ mToolBar->setEnabled( true );
+
+ mButtonActions[E3rdButton]->setIcon( *mButtonIcons[EPauseIcon] );
+
+ if ( ! mController->fileDetails()->mPausableStream )
+ {
+ //
+ // non-pausable stream, disable 'E3rdButton' action (for 'Pause' button)
+ //
+ mButtonActions[E3rdButton]->setEnabled( false );
+ }
+
+ break;
+ }
+ case EPbStatePaused:
+ {
+ mToolBar->setEnabled( true );
+
+ mButtonActions[E3rdButton]->setIcon( *mButtonIcons[EPlayIcon] );
+
+ if ( ! mButtonActions[E3rdButton]->isEnabled() )
+ {
+ //
+ // enable 'E3rdButton' action (for 'Play' button) in 'Paused' state
+ //
+ mButtonActions[E3rdButton]->setEnabled( true );
+ }
+
+ break;
+ }
+ default:
+ {
+ mToolBar->setEnabled( false );
+
+ break;
+ }
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackToolBar::aspectRatioChanged()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackToolBar::aspectRatioChanged( int aspectRatio )
+{
+ MPX_DEBUG(_L("VideoPlaybackToolBar::aspectRatioChanged() aspectRatio = %d"), aspectRatio );
+
+ mAspectRatio = aspectRatio;
+
+ //
+ // 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 )
+ {
+ case EMMFNatural:
+ {
+ mButtonActions[E1stButton]->setIcon( *mButtonIcons[EStretchIcon] );
+ break;
+ }
+ case EMMFStretch:
+ {
+ mButtonActions[E1stButton]->setIcon( *mButtonIcons[EZoomIcon] );
+ break;
+ }
+ default:
+ {
+ mButtonActions[E1stButton]->setIcon( *mButtonIcons[ENaturalIcon] );
+ break;
+ }
+ }
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackToolBar::handleButtonPressed()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackToolBar::handleButtonPressed()
+{
+ MPX_DEBUG(_L("VideoPlaybackToolBar::handleButtonPressed()"));
+
+ mController->resetDisappearingTimers( ETimerCancel );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackToolBar::handleRWButtonPressed()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackToolBar::handleRWButtonPressed()
+{
+ MPX_DEBUG(_L("VideoPlaybackToolBar::handleRWButtonPressed()"));
+
+ mController->resetDisappearingTimers( ETimerCancel );
+
+ connect( mSeekStartTimer, SIGNAL( timeout() ), this, SLOT( rwPressing() ) );
+
+ if ( mSeekStartTimer->isActive() )
+ {
+ mSeekStartTimer->stop();
+ }
+
+ mSeekStartTimer->start();
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackToolBar::handleFFButtonPressed()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackToolBar::handleFFButtonPressed()
+{
+ MPX_DEBUG(_L("VideoPlaybackToolBar::handleButtonPressed()"));
+
+ mController->resetDisappearingTimers( ETimerCancel );
+
+ connect( mSeekStartTimer, SIGNAL( timeout() ), this, SLOT( ffPressing() ) );
+
+ if ( mSeekStartTimer->isActive() )
+ {
+ mSeekStartTimer->stop();
+ }
+
+ mSeekStartTimer->start();
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackToolBar::updateWithFileDetails()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackToolBar::updateWithFileDetails(
+ VideoPlaybackViewFileDetails* details )
+{
+ MPX_DEBUG(_L("VideoPlaybackToolBar::updateWithFileDetails()"));
+
+ if ( mController->isAttachOperation() )
+ {
+ //
+ // Show attach button
+ //
+ mButtonActions[E1stButton]->setIcon( *mButtonIcons[EAttachIcon] );
+
+ if ( mButtons.count() )
+ {
+ disconnect( mButtons[E1stButton], SIGNAL( released() ), 0, 0 );
+ connect( mButtons[E1stButton], SIGNAL( released() ),
+ mController, SLOT( attachVideo() ) );
+ }
+ }
+ else
+ {
+ if ( mController->viewMode() == EFullScreenView )
+ {
+ //
+ // Show aspect ratio button
+ //
+ aspectRatioChanged( mAspectRatio );
+
+ if ( ! details->mVideoEnabled ||
+ details->mVideoHeight <= 0 ||
+ details->mVideoWidth <= 0 ||
+ details->mTvOutConnected )
+ {
+ //
+ // dim 'aspect ratio' buttons
+ //
+ mButtonActions[E1stButton]->setEnabled( false );
+ }
+ else
+ {
+ //
+ // check if video clip has same aspect ratio as display window
+ //
+ TReal32 videoAspectRatio = (TReal32) details->mVideoWidth / (TReal32) details->mVideoHeight;
+ bool enabled = ( mDisplayAspectRatio == videoAspectRatio )? false : true;
+
+ //
+ // enable or dim 'aspect ratio' buttons accordingly
+ //
+ mButtonActions[E1stButton]->setEnabled( enabled );
+
+ if ( mButtons.count() )
+ {
+ disconnect( mButtons[E1stButton], SIGNAL( released() ), 0, 0 );
+ connect( mButtons[E1stButton], SIGNAL( released() ),
+ this, SLOT( changeAspectRatio() ) );
+ }
+ }
+ }
+ else if ( mController->viewMode() == EAudioOnlyView )
+ {
+ //
+ // Show share button
+ //
+ mButtonActions[E1stButton]->setIcon( *mButtonIcons[EShareIcon] );
+
+ if ( mController->fileDetails()->mPlaybackMode == EMPXVideoStreaming ||
+ mController->fileDetails()->mPlaybackMode == EMPXVideoLiveStreaming )
+ {
+ //
+ // dim 'share' button for streaming
+ //
+ mButtonActions[E1stButton]->setEnabled( false );
+ }
+ else
+ {
+ //
+ // enable 'share' button
+ //
+ mButtonActions[E1stButton]->setEnabled( true );
+
+ if ( mButtons.count() )
+ {
+ disconnect( mButtons[E1stButton], SIGNAL( released() ), 0, 0 );
+ connect( mButtons[E1stButton], SIGNAL( released() ),
+ mController, SLOT( sendVideo() ) );
+ }
+ }
+ }
+ }
+
+ //
+ // for audio-only clips and tv-out, default view is audionOnlyView
+ // therefore, dim details button
+ //
+ if ( ! details->mVideoEnabled || details->mTvOutConnected )
+ {
+ mButtonActions[E5thButton]->setEnabled( false );
+ }
+ else
+ {
+ mButtonActions[E5thButton]->setEnabled( true );
+ }
+
+ if ( details->mSeekable && details->mPausableStream )
+ {
+ mButtonActions[E2ndButton]->setEnabled( true );
+ mButtonActions[E4thButton]->setEnabled( true );
+ }
+ else
+ {
+ mButtonActions[E2ndButton]->setEnabled( false );
+ mButtonActions[E4thButton]->setEnabled( false );
+ }
+
+ //
+ // The buttons 'Play' and 'Pause' are shared by the same 'E3rdButton' action.
+ // The logic to enable or disable 'E3rdButton' will depend on the current playback state.
+ //
+ updateState( mController->state() );
+
+ //
+ // 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() )
+ {
+ 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 );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackToolBar::openDetailsView()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackToolBar::openDetailsView()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackToolBar::openDetailsView()"));
+
+ TPlaybackViewMode viewMode = mController->viewMode();
+
+ if ( viewMode == EFullScreenView )
+ {
+ mController->changeViewMode( EDetailsView );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackToolBar::positionChanged
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackToolBar::positionChanged( int position )
+{
+ MPX_DEBUG(_L("VideoPlaybackToolBar::positionChanged position = %d"), position );
+
+ mPosition = position;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackToolBar::durationChanged
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackToolBar::durationChanged( int duration )
+{
+ MPX_DEBUG(_L("VideoPlaybackToolBar::durationChanged duration = %d"), duration );
+
+ mDuration = duration;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackToolBar::setVisible
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackToolBar::setVisible( bool visible )
+{
+ MPX_DEBUG(_L("VideoPlaybackToolBar::setVisible visible = %d"), visible );
+
+ if ( visible )
+ {
+ mController->view()->showItems( Hb::ToolBarItem );
+ }
+ else
+ {
+ mController->view()->hideItems( Hb::ToolBarItem );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackToolBar::retrieveButtons()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackToolBar::retrieveButtons()
+{
+ MPX_DEBUG(_L("VideoPlaybackToolBar::retrieveButtons()"));
+
+ if ( mButtons.count() == 0 )
+ {
+ QGraphicsLayout *layout = mToolBar->layout();
+
+ if ( layout )
+ {
+ if ( mRetrieveButtonTimer )
+ {
+ disconnect( mRetrieveButtonTimer, SIGNAL( timeout() ), this, SLOT( retrieveButtons() ) );
+ if ( mRetrieveButtonTimer->isActive() )
+ {
+ mRetrieveButtonTimer->stop();
+ }
+ }
+
+ for ( int i = 0 ; i < layout->count() ; i++ )
+ {
+ mButtons.append( dynamic_cast<HbToolButton*>( layout->itemAt( i ) ) );
+ }
+
+ //
+ // Connect signal and slots
+ //
+ connect( mButtons[E1stButton], SIGNAL( pressed() ), this, SLOT( handleButtonPressed() ) );
+
+ connect( mButtons[E2ndButton], SIGNAL( pressed() ), this, SLOT( handleRWButtonPressed() ) );
+ connect( mButtons[E2ndButton], SIGNAL( released() ), this, SLOT( rwReleased() ) );
+
+ connect( mButtons[E3rdButton], SIGNAL( pressed() ), this, SLOT( handleButtonPressed() ) );
+ connect( mButtons[E3rdButton], SIGNAL( released() ), this, SLOT( playPause() ) );
+
+ connect( mButtons[E4thButton], SIGNAL( pressed() ), this, SLOT( handleFFButtonPressed() ) );
+ connect( mButtons[E4thButton], SIGNAL( released() ), this, SLOT( ffReleased() ) );
+
+ connect( mButtons[E5thButton], SIGNAL( pressed() ), this, SLOT( handleButtonPressed() ) );
+ connect( mButtons[E5thButton], SIGNAL( released() ), this, SLOT( openDetailsView() ) );
+
+ if ( mController->isAttachOperation() )
+ {
+ connect( mButtons[E1stButton], SIGNAL( released() ),
+ mController, SLOT( attachVideo() ) );
+ }
+ else
+ {
+ if ( mController->viewMode() == EFullScreenView )
+ {
+ connect( mButtons[E1stButton], SIGNAL( released() ),
+ this, SLOT( changeAspectRatio() ) );
+ }
+ else if ( mController->viewMode() == EAudioOnlyView )
+ {
+ connect( mButtons[E1stButton], SIGNAL( released() ),
+ mController, SLOT( sendVideo() ) );
+ }
+ }
+ }
+ }
+}
+
+//End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/inc/mpxhelixplaybackplugindefs.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,50 @@
+/*
+* 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: Externalizable container for DSA region
+*
+*/
+
+// Version : %version: da1mmcf#2 %
+
+
+
+#ifndef MPXHELIXPLAYBACKPLUGINDEFS_H_
+#define MPXHELIXPLAYBACKPLUGINDEFS_H_
+
+enum TMPXVideoPlaybackState
+{
+ EMPXVideoNotInitialized,
+ EMPXVideoInitializing,
+ EMPXVideoInitialized,
+ EMPXVideoBuffering,
+ EMPXVideoPlaying,
+ EMPXVideoPaused,
+ EMPXVideoStopped,
+ EMPXVideoSeeking,
+ EMPXNumberOfStates
+};
+
+
+enum TMPXVideoMode
+{
+ EMPXVideoLocal,
+ EMPXVideoStreaming,
+ EMPXVideoLiveStreaming,
+ EMPXVideoProgressiveDownload,
+ EMPXNumberOfModes
+};
+
+
+
+#endif /*MPXHELIXPLAYBACKPLUGINDEFS_H_*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/inc/videoplaybackcontrolscontroller.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,386 @@
+/*
+* 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 VideoPlaybackControlsController
+*
+*/
+
+// Version : %version: da1mmcf#23 %
+
+
+
+#ifndef VIDEOPLAYBACKCONTROLSCONTROLLER_H_
+#define VIDEOPLAYBACKCONTROLSCONTROLLER_H_
+
+// INCLUDES
+#include <QObject>
+#include <QPixmap>
+
+#include <mpxplaybackframeworkdefs.h>
+
+#include "mpxvideo_debug.h"
+#include "videoplaybackcontrol.hrh"
+#include "mpxcommonvideoplaybackview.hrh"
+#include "videoplaybackviewfiledetails.h"
+
+// FORWARD DECLARATIONS
+class QTimer;
+class QString;
+class HbAction;
+class ThumbnailManager;
+class HbVolumeSliderPopup ;
+class CMPXVideoViewWrapper;
+class VideoBasePlaybackView;
+class VideoPlaybackControlPolicy;
+class VideoPlaybackDocumentLoader;
+class VideoPlaybackFullScreenControl;
+class VideoPlaybackControlsController;
+class VideoPlaybackControlConfiguration;
+class VideoServices;
+
+
+// DATA TYPES
+
+enum TTimerAction
+{
+ ETimerCancel,
+ ETimerReset
+};
+
+enum TThumbNailState
+{
+ EThumbNailEmpty,
+ EThumbNailNotAvailable,
+ EThumbNailRequsted,
+ EThumbNailSet
+};
+
+enum TPlaybackViewMode
+{
+ EFullScreenView,
+ EDetailsView,
+ EAudioOnlyView
+};
+
+const int KControlsTimeOut = 4000;
+const int KRNLogoTimeOut = 600;
+
+const QString KPLAYBACKVIEW_DOCML = ":/videoplaybackview/videoplaybackview.docml";
+
+
+// CLASS DECLARATION
+
+class VideoPlaybackControlsController : public QObject
+{
+ Q_OBJECT
+
+ public:
+
+ /**
+ * constructor.
+ */
+ VideoPlaybackControlsController(
+ VideoBasePlaybackView *view,
+ CMPXVideoViewWrapper *viewWrapper,
+ VideoPlaybackViewFileDetails *details );
+
+ /**
+ * Destructor.
+ */
+ virtual ~VideoPlaybackControlsController();
+
+ public:
+
+ /**
+ * Handle event from container
+ */
+ void handleEvent( TVideoPlaybackControlCommandIds event, int value = 0 );
+
+ /**
+ * Command handling function.
+ * Call HandleCommandL() of container
+ */
+ void handleCommand( TMPXVideoPlaybackViewCommandIds command, int value = 0 );
+
+ /*
+ * Return ETrue if TV-out cable gets connected
+ */
+ inline bool isTvOutConnected();
+
+ /**
+ * Reset or cancel timers for the controls
+ */
+ void resetDisappearingTimers( TTimerAction timerAction );
+
+ /**
+ * Return state
+ */
+ inline TMPXPlaybackState state();
+
+ /**
+ * Return file details
+ */
+ inline VideoPlaybackViewFileDetails* fileDetails();
+
+ //
+ // Add the file details to the controls controller when available
+ //
+ void addFileDetails( VideoPlaybackViewFileDetails* details );
+
+ inline VideoPlaybackDocumentLoader* layoutLoader();
+
+ inline VideoBasePlaybackView* view();
+
+ void updateVideoRectDone();
+
+ inline TPlaybackViewMode viewMode();
+
+ void changeViewMode( TPlaybackViewMode viewMode, bool transitionEffect = true );
+
+ inline bool isAttachOperation();
+
+ bool isRNLogoBitmapInControlList();
+
+ bool shouldShowRNLogo();
+
+ private:
+ /**
+ * Initialize controller
+ */
+ void initializeController();
+
+ /**
+ * Update controls
+ */
+ void handleStateChange( TMPXPlaybackState newState );
+
+ /**
+ * Show Controls and reset the timers
+ */
+ void showControls();
+
+ /**
+ * Return ETrue if any control is visible
+ */
+ bool isVisible();
+
+ /**
+ * Append a control based on control index
+ */
+ void appendControl( TVideoPlaybackControls controlIndex );
+
+ /**
+ * Set changed volume
+ */
+ void volumeChanged( int volume );
+
+ /**
+ * Set changed duration
+ */
+ void durationChanged( int duration);
+
+ /**
+ * Set changed position
+ */
+ void positionChanged( int position );
+
+ /**
+ * Set changed position
+ */
+ void aspectRatioChanged( int aspectRatio );
+
+ /*
+ * Sets the download size on the progress bar
+ */
+ void setDownloadSize( int size );
+
+ /*
+ * Updates the download ratio on the progress bar
+ */
+ void updateDownloadPosition( int newSize );
+
+ /**
+ * Set changed state on the controls
+ */
+ void updateState();
+
+ /**
+ * Check whether this clip is real format or not
+ */
+ bool realFormat( QString filename );
+
+ /**
+ * Check whether this clip is real format or not for streaming/live streaming
+ */
+ bool realFormatForStreaming( const TDesC& des );
+
+ /**
+ * Check whether this clip is real format or not for local/progressive donwload
+ */
+ bool realFormatForLocal();
+
+ /**
+ * Handle errors
+ */
+ void handleErrors();
+
+ /**
+ * Return true if control is visible
+ */
+ bool isSoftKeyVisible();
+
+ /**
+ * Handle tvout connected/disconnected event
+ */
+ void handleTvOutEvent( bool connected,
+ TVideoPlaybackControlCommandIds event );
+
+ void updateVideoRect( bool transitionEffect = true );
+
+ void showVolumeControls();
+
+ void setDefaultBitmap();
+
+ void generateThumbNail();
+
+ signals:
+
+ /**
+ * Signals the file path of the current video to VideoServices
+ *
+ * @param filePath of the video
+ */
+ void attachVideoPath( const QString& );
+
+ private slots:
+ void hideAllControls();
+ void skipToNextVideoItem();
+ void skipToPreviousVideoItem();
+ void handleTappedOnScreen();
+ void handleThumbnailReady( QPixmap tnData, void *internal , int id, int error );
+ void controlsListUpdated();
+ void attachVideo();
+ void sendVideo();
+ void handleRNLogoVisibleChanged();
+ void handleRNLogoTimeout();
+ void handleOrientationChanged( Qt::Orientation orientation );
+
+ private:
+ VideoBasePlaybackView *mView;
+ CMPXVideoViewWrapper *mViewWrapper;
+ VideoPlaybackViewFileDetails *mFileDetails;
+
+ QList<VideoPlaybackFullScreenControl*> mControls;
+
+ VideoPlaybackControlPolicy *mControlsPolicy;
+ VideoPlaybackControlConfiguration *mControlsConfig;
+
+ QTimer *mControlsTimer;
+ QTimer *mRNLogoTimer;
+
+ VideoPlaybackDocumentLoader *mLoader;
+ HbVolumeSliderPopup *mVolumeControl;
+
+ ThumbnailManager *mThumbnailManager;
+ VideoServices *mVideoServices;
+
+ bool mViewTransitionIsGoingOn;
+ bool mIsAttachOperation;
+
+ TThumbNailState mThumbNailState;
+
+ TMPXPlaybackState mState;
+ TPlaybackViewMode mViewMode;
+ Qt::Orientation mOrientation;
+};
+
+// INLINE METHODS
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::state
+// -------------------------------------------------------------------------------------------------
+//
+inline
+TMPXPlaybackState VideoPlaybackControlsController::state()
+{
+ return mState;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::fileDetails
+// -------------------------------------------------------------------------------------------------
+//
+inline
+VideoPlaybackViewFileDetails* VideoPlaybackControlsController::fileDetails()
+{
+ return mFileDetails;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::isTvOutConnected
+// -------------------------------------------------------------------------------------------------
+//
+inline
+bool VideoPlaybackControlsController::isTvOutConnected()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::isTvOutConnected(%d)"),
+ mFileDetails->mTvOutConnected);
+
+ return mFileDetails->mTvOutConnected;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::layoutLoader
+// -------------------------------------------------------------------------------------------------
+//
+inline
+VideoPlaybackDocumentLoader* VideoPlaybackControlsController::layoutLoader()
+{
+ return mLoader;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::view
+// -------------------------------------------------------------------------------------------------
+//
+inline
+VideoBasePlaybackView* VideoPlaybackControlsController::view()
+{
+ return mView;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::viewMode
+// -------------------------------------------------------------------------------------------------
+//
+inline
+TPlaybackViewMode VideoPlaybackControlsController::viewMode()
+{
+ return mViewMode;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::isAttachOperation
+// -------------------------------------------------------------------------------------------------
+//
+inline
+bool VideoPlaybackControlsController::isAttachOperation()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::isAttachOperation() ret %d"),
+ mIsAttachOperation );
+
+ return mIsAttachOperation;
+}
+
+#endif /*MPXVIDEOPLAYBACKCONTROLSCONTROLLER_P_H_*/
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/inc/videoplaybackviewfiledetails.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,86 @@
+/*
+* 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: Video File Details (QT)
+*
+*/
+
+// Version : %version: 6 %
+
+
+
+
+#ifndef __VIDEOPLAYBACKVIEWFILEDETAILS__
+#define __VIDEOPLAYBACKVIEWFILEDETAILS__
+
+#include <qobject.h>
+#include "mpxhelixplaybackplugindefs.h"
+
+
+//
+// CLASS DECLARATION
+//
+class VideoPlaybackViewFileDetails : public QObject
+{
+ public:
+ //
+ // Constructor
+ //
+ VideoPlaybackViewFileDetails();
+
+ //
+ // Destructor.
+ //
+ virtual ~VideoPlaybackViewFileDetails();
+
+ //
+ // Clear all file details
+ //
+ void clearFileDetails();
+
+ public:
+ //
+ // Data
+ //
+ QString mClipName;
+ QString mTitle;
+ QString mArtist;
+ QString mMimeType;
+ QString mDescription;
+ QString mLocation;
+ QString mCopyright;
+ QString mLanguage;
+ QString mKeywords;
+
+ TMPXVideoMode mPlaybackMode;
+ bool mSeekable;
+ bool mPausableStream;
+ bool mAudioEnabled;
+ bool mVideoEnabled;
+ bool mPartialPlayback;
+ bool mRNFormat;
+ bool mTvOutConnected;
+ bool mDrmProtected;
+ bool mMultiItemPlaylist;
+
+ int mVideoHeight;
+ int mVideoWidth;
+ int mBitRate;
+ int mDuration;
+ int mCreationTime;
+ int mModificationTime;
+};
+
+#endif // __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/resources/animations/generic_preroll_anim.axml Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,14 @@
+<animations>
+ <icon name="preroll_anim" frame_duration="100" playmode="loop">
+ <frame>qtg_anim_loading_1</frame>
+ <frame>qtg_anim_loading_2</frame>
+ <frame>qtg_anim_loading_3</frame>
+ <frame>qtg_anim_loading_4</frame>
+ <frame>qtg_anim_loading_5</frame>
+ <frame>qtg_anim_loading_6</frame>
+ <frame>qtg_anim_loading_7</frame>
+ <frame>qtg_anim_loading_8</frame>
+ <frame>qtg_anim_loading_9</frame>
+ <frame>qtg_anim_loading_10</frame>
+ </icon>
+</animations>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/resources/animations/rn_preroll_anim.axml Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,13 @@
+<animations>
+ <icon name="preroll_anim" frame_duration="100" playmode="loop">
+ <frame>qtg_anim_longtap_1</frame>
+ <frame>qtg_anim_longtap_2</frame>
+ <frame>qtg_anim_longtap_3</frame>
+ <frame>qtg_anim_longtap_4</frame>
+ <frame>qtg_anim_longtap_5</frame>
+ <frame>qtg_anim_longtap_6</frame>
+ <frame>qtg_anim_longtap_7</frame>
+ <frame>qtg_anim_longtap_8</frame>
+ <frame>qtg_anim_longtap_9</frame>
+ </icon>
+</animations>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/resources/effects/controlbar_appear.fxml Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,12 @@
+<layers>
+ <visual>
+ <param name="translation_y" type="anim">
+ <duration>0.4</duration>
+ <style>outquad</style>
+ <keyframe at="0.0">0.0</keyframe>
+ <keyframe at="1.0">1.0</keyframe>
+ <start ref="visual.bottom">1.0</start>
+ <end ref="visual.top">1.0</end>
+ </param>
+ </visual>
+</layers>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/resources/effects/controlbar_disappear.fxml Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,12 @@
+<layers>
+ <visual>
+ <param name="translation_y" type="anim">
+ <duration>0.4</duration>
+ <style>outquad</style>
+ <keyframe at="0.0">0.0</keyframe>
+ <keyframe at="1.0">1.0</keyframe>
+ <start ref="visual.top">-1.0</start>
+ <end ref="visual.bottom">1.0</end>
+ </param>
+ </visual>
+</layers>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/resources/videoplaybackview.docml Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,191 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="1.1">
+ <widget name="content" type="HbWidget">
+ <widget name="bufferingIcon" type="HbLabel">
+ <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+ <icon iconName="preroll_anim" name="icon"/>
+ <real name="z" value="6"/>
+ <sizehint height="10.44776un" type="PREFERRED" width="10.44776un"/>
+ <bool name="visible" value="FALSE"/>
+ </widget>
+ <widget name="titleLayout" type="HbWidget">
+ <widget name="title" type="HbLabel">
+ <enums name="alignment" value="AlignLeft|AlignVCenter|AlignLeading"/>
+ <real name="z" value="0"/>
+ <string name="plainText"/>
+ </widget>
+ <widget name="titleGroupBox" type="HbGroupBox">
+ <real name="z" value="1"/>
+ <bool name="collapsable" value="FALSE"/>
+ <string name="heading" value="Group Box"/>
+ </widget>
+ <real name="z" value="2"/>
+ <sizehint height="4.92537un" type="PREFERRED" width="95.52239un"/>
+ <bool name="visible" value="FALSE"/>
+ <layout type="stacked">
+ <stackitem itemname="title"/>
+ <stackitem itemname="titleGroupBox"/>
+ </layout>
+ </widget>
+ <widget name="transparentWindow" type="HbTransparentWindow">
+ <real name="z" value="0"/>
+ <bool name="visible" value="FALSE"/>
+ <layout type="anchor"/>
+ </widget>
+ <widget name="controlBarLayout" type="HbWidget">
+ <widget name="progressSlider" type="HbProgressSlider">
+ <integer name="progressValue" value="70"/>
+ <bool name="minMaxTextVisible" value="TRUE"/>
+ <enums name="minMaxTextAlignment" value="AlignVCenter|AlignHCenter"/>
+ <string name="minText"/>
+ <real name="z" value="1"/>
+ <enums name="orientation" value="Horizontal"/>
+ <integer name="sliderValue" value="30"/>
+ <string name="maxText"/>
+ <string name="textAlignment" value="AlignBottom"/>
+ <bool name="textVisible" value="FALSE"/>
+ <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="1"/>
+ <sizehint height="5.97015un" type="PREFERRED" width="95.52239un"/>
+ </widget>
+ <real name="z" value="1"/>
+ <sizehint height="23.8806un" type="PREFERRED" width="95.52239un"/>
+ <bool name="visible" value="FALSE"/>
+ <layout orientation="Vertical" spacing="0un" type="linear">
+ <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+ <linearitem itemname="progressSlider"/>
+ </layout>
+ </widget>
+ <widget name="fileDetailsLayout" type="HbWidget">
+ <widget name="fileDetails" type="HbListWidget"/>
+ <real name="z" value="3"/>
+ <bool name="visible" value="FALSE"/>
+ <layout orientation="Vertical" type="linear">
+ <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+ <linearitem itemname="fileDetails" spacing="0px"/>
+ </layout>
+ </widget>
+ <widget name="bitmapLayout" type="HbWidget">
+ <widget name="audioOnlyBitmap" type="HbLabel">
+ <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+ <icon iconName="qtg_large_just_audio" name="icon"/>
+ <bool name="visible" value="FALSE"/>
+ </widget>
+ <widget name="partialAudioOnlyBitmap" type="HbLabel">
+ <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+ <icon iconName="qtg_large_corrupted" name="icon"/>
+ <bool name="visible" value="FALSE"/>
+ </widget>
+ <widget name="realAudioOnlyBitmap" type="HbLabel">
+ <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+ <icon iconName="qtg_large_realplayer" name="icon"/>
+ <bool name="visible" value="FALSE"/>
+ </widget>
+ <widget name="tvOutBitmap" type="HbLabel">
+ <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+ <icon iconName="qtg_large_tv_out" name="icon"/>
+ <bool name="visible" value="FALSE"/>
+ </widget>
+ <real name="z" value="5"/>
+ <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
+ <sizehint height="28.80597un" type="PREFERRED" width="47.7612un"/>
+ <sizehint height="2.68657un" type="MINIMUM" width="2.68657un"/>
+ <sizehint height="2307732.46823un" type="MAXIMUM" width="2307732.46823un"/>
+ <bool name="visible" value="FALSE"/>
+ <layout type="stacked">
+ <stackitem itemname="audioOnlyBitmap"/>
+ <stackitem itemname="partialAudioOnlyBitmap"/>
+ <stackitem itemname="realAudioOnlyBitmap"/>
+ <stackitem itemname="tvOutBitmap"/>
+ </layout>
+ </widget>
+ <widget name="detailsPlaybackWindow" type="HbWidget">
+ <widget name="small_transparentWindow" type="HbTransparentWindow">
+ <widget name="detailsViewPlayButton" type="HbPushButton">
+ <icon iconName="qtg_mono_play" name="icon"/>
+ <real name="z" value="2"/>
+ <sizehint height="8.95522un" type="PREFERRED" width="8.95522un"/>
+ <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+ <string name="state" value="normal"/>
+ </widget>
+ <real name="z" value="0"/>
+ <sizehint height="32.83582un" type="PREFERRED" width="53.73134un"/>
+ <layout type="anchor">
+ <anchoritem dst="detailsViewPlayButton" dstEdge="CENTERH" spacing="0un" src="" srcEdge="CENTERH"/>
+ <anchoritem dst="detailsViewPlayButton" dstEdge="CENTERV" spacing="0un" src="" srcEdge="CENTERV"/>
+ </layout>
+ </widget>
+ <widget name="attachShareButton" type="HbWidget">
+ <widget name="detailsAttachButton" type="HbPushButton">
+ <icon iconName="qtg_mono_attach" name="icon"/>
+ <sizehint height="5.97015un" type="PREFERRED" width="47.7612un"/>
+ <bool name="visible" value="FALSE"/>
+ <string name="state" value="normal"/>
+ </widget>
+ <widget name="detailsShareButton" type="HbPushButton">
+ <icon iconName="qtg_mono_share" name="icon"/>
+ <real name="z" value="1"/>
+ <sizehint height="5.97015un" type="PREFERRED" width="47.7612un"/>
+ <bool name="visible" value="TRUE"/>
+ <string name="state" value="normal"/>
+ </widget>
+ <real name="z" value="0"/>
+ <sizehint height="7.46269un" type="PREFERRED" width="47.7612un"/>
+ <layout type="stacked">
+ <stackitem itemname="detailsAttachButton"/>
+ <stackitem itemname="detailsShareButton"/>
+ </layout>
+ </widget>
+ <real name="z" value="4"/>
+ <bool name="visible" value="FALSE"/>
+ <layout orientation="Vertical" spacing="0un" type="linear">
+ <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+ <linearitem itemname="small_transparentWindow"/>
+ <linearitem itemname="attachShareButton"/>
+ </layout>
+ </widget>
+ <widget name="rnLogoBitmap" type="HbLabel">
+ <icon iconName="qtg_large_realplayer" name="icon"/>
+ <real name="z" value="7"/>
+ <sizehint height="29.85075un" type="PREFERRED" width="29.85075un"/>
+ <bool name="visible" value="FALSE"/>
+ </widget>
+ <size height="var(hb-param-screen-short-edge)" name="size" width="var(hb-param-screen-long-edge)"/>
+ <real name="z" value="1"/>
+ <rect height="var(hb-param-screen-short-edge)" name="geometry" width="var(hb-param-screen-long-edge)" x="0un" y="0un"/>
+ <sizehint height="78251.79327un" type="MAXIMUM" width="78251.79327un"/>
+ <layout type="anchor">
+ <anchoritem dst="bufferingIcon" dstEdge="CENTERH" spacing="0un" src="" srcEdge="CENTERH"/>
+ <anchoritem dst="bufferingIcon" dstEdge="CENTERV" spacing="0un" src="" srcEdge="CENTERV"/>
+ <anchoritem dst="titleLayout" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+ <anchoritem dst="titleLayout" dstEdge="TOP" spacing="9.40299un" src="" srcEdge="TOP"/>
+ <anchoritem dst="titleLayout" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+ <anchoritem dst="titleLayout" dstEdge="BOTTOM" spacing="14.32836un" src="" srcEdge="TOP"/>
+ <anchoritem dst="transparentWindow" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+ <anchoritem dst="transparentWindow" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
+ <anchoritem dst="transparentWindow" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+ <anchoritem dst="transparentWindow" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
+ <anchoritem dst="controlBarLayout" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+ <anchoritem dst="controlBarLayout" dstEdge="TOP" spacing="-14.92537un" src="" srcEdge="BOTTOM"/>
+ <anchoritem dst="controlBarLayout" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+ <anchoritem dst="controlBarLayout" dstEdge="BOTTOM" spacing="-8.95522un" src="" srcEdge="BOTTOM"/>
+ <anchoritem dst="detailsPlaybackWindow" dstEdge="TOP" spacing="0un" src="titleLayout" srcEdge="BOTTOM"/>
+ <anchoritem dst="detailsPlaybackWindow" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+ <anchoritem dst="detailsPlaybackWindow" dstEdge="RIGHT" spacing="0un" src="" srcEdge="CENTERH"/>
+ <anchoritem dst="detailsPlaybackWindow" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
+ <anchoritem dst="bitmapLayout" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+ <anchoritem dst="bitmapLayout" dstEdge="TOP" spacing="0un" src="titleLayout" srcEdge="TOP"/>
+ <anchoritem dst="bitmapLayout" dstEdge="RIGHT" spacing="0un" src="" srcEdge="CENTERH"/>
+ <anchoritem dst="bitmapLayout" dstEdge="BOTTOM" spacing="0un" src="controlBarLayout" srcEdge="TOP"/>
+ <anchoritem dst="fileDetailsLayout" dstEdge="LEFT" spacing="0un" src="" srcEdge="CENTERH"/>
+ <anchoritem dst="fileDetailsLayout" dstEdge="TOP" spacing="0un" src="titleLayout" srcEdge="BOTTOM"/>
+ <anchoritem dst="fileDetailsLayout" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+ <anchoritem dst="fileDetailsLayout" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
+ <anchoritem dst="rnLogoBitmap" dstEdge="CENTERH" spacing="0un" src="" srcEdge="CENTERH"/>
+ <anchoritem dst="rnLogoBitmap" dstEdge="CENTERV" spacing="0un" src="" srcEdge="CENTERV"/>
+ </layout>
+ </widget>
+ <metadata activeUIState="Common ui state" display="NHD-3.2-inch_landscape" unit="un">
+ <resource location="videoplaybackview.qrc"/>
+ <uistate name="Common ui state" sections="#common"/>
+ </metadata>
+</hbdocument>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/resources/videoplaybackview.qrc Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<RCC>
+ <qresource prefix="videoplaybackview">
+ <file>animations/rn_preroll_anim.axml</file>
+ <file>animations/generic_preroll_anim.axml</file>
+ <file>videoplaybackview.docml</file>
+ <file>effects/controlbar_appear.fxml</file>
+ <file>effects/controlbar_disappear.fxml</file>
+ </qresource>
+</RCC>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/rom/videoplaybackview.iby Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,26 @@
+/*
+* 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: videoplaybackview.iby
+*
+*/
+
+
+
+#ifndef __VIDEOPLAYBACKVIEW_IBY__
+#define __VIDEOPLAYBACKVIEW_IBY__
+#include <data_caging_paths_for_iby.hrh>
+
+file=ABI_DIR\BUILD_DIR\videoplaybackview.dll \sys\bin\videoplaybackview.dll
+
+#endif // __VIDEOPLAYBACKVIEW_IBY__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolbar/inc/testcontrolbar.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,71 @@
+/**
+* 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: tester for methods in TestControlBar
+*
+*/
+
+// Version : %version: 2 %
+
+#ifndef __TESTCONTROLBAR_H__
+#define __TESTCONTROLBAR_H__
+
+
+// INCLUDES
+#include <QtTest/QtTest>
+
+class VideoPlaybackControlBar;
+class VideoPlaybackControlsController;
+
+class TestControlBar : public QObject
+{
+ Q_OBJECT
+
+ public:
+
+ /**
+ * will be called before each testfunction is executed.
+ *
+ */
+ void init();
+
+ /**
+ * will be called after every testfunction.
+ *
+ */
+ void cleanup();
+
+ // test functions for the test framework
+
+ private slots:
+
+ // the order in which these testXX methods are declared is important
+ // changing this order will affect the test results
+ void testupdateState();
+ void testaspectRatioChanged();
+ void testUpdateWithFileDetails();
+ void testSetVisibleToControlBar();
+ void testDurationChanged();
+ void testPositionChanged();
+
+ signals:
+ void commandSignal(int);
+
+ private:
+ VideoPlaybackControlBar *mControlBar;
+ VideoPlaybackControlsController *mController;
+};
+
+#endif // __TESTCONTROLBAR_H__
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolbar/src/testcontrolbar.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,215 @@
+/**
+* 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: tester for methods in TestVideoPlaybackControlBar
+*
+*/
+
+// Version : %version: 3 %
+
+
+#include <qdebug>
+#include <hbmainwindow.h>
+#include <hbapplication.h>
+
+#include "testcontrolbar.h"
+#include "videoplaybacktoolbar.h"
+#include "videoplaybackprogressbar.h"
+#include "videoplaybackviewfiledetails.h"
+#include "videoplaybackcontrolscontroller.h"
+
+#define private public
+#include "videoplaybackcontrolbar.h"
+#undef private
+
+// ---------------------------------------------------------------------------
+// main
+// ---------------------------------------------------------------------------
+//
+int main(int argc, char *argv[])
+{
+ MPX_ENTER_EXIT(_L("TestControlBar::Main()"));
+
+ HbApplication app(argc, argv);
+ HbMainWindow window;
+
+ TestControlBar tv;
+
+ char *pass[3];
+ pass[0] = argv[0];
+ pass[1] = "-o";
+ pass[2] = "c:\\data\\testcontrolbar.txt";
+
+ int res = QTest::qExec(&tv, 3, pass);
+
+ return res;
+}
+
+
+// ---------------------------------------------------------------------------
+// init
+// ---------------------------------------------------------------------------
+//
+void TestControlBar::init()
+{
+ MPX_ENTER_EXIT(_L("TestControlBar::init()"));
+
+ mController = new VideoPlaybackControlsController();
+ mControlBar = new VideoPlaybackControlBar( mController );
+
+ mControlBar->initialize();
+}
+
+// ---------------------------------------------------------------------------
+// cleanup
+// ---------------------------------------------------------------------------
+//
+void TestControlBar::cleanup()
+{
+ MPX_ENTER_EXIT(_L("TestControlBar::cleanup()"));
+
+ if ( mController )
+ {
+ delete mController;
+ mController = NULL;
+ }
+
+ if ( mControlBar )
+ {
+ delete mControlBar;
+ mControlBar = NULL;
+ }
+}
+
+// ---------------------------------------------------------------------------
+// testupdateState
+// ---------------------------------------------------------------------------
+//
+void TestControlBar::testupdateState()
+{
+ MPX_ENTER_EXIT(_L("TestControlBar::testupdateState()"));
+
+ init();
+
+ TMPXPlaybackState state = EPbStatePlaying;
+ mControlBar->updateState( state );
+ QVERIFY( mControlBar->mToolBar->mState == EPbStatePlaying );
+
+ state = EPbStatePaused;
+ mControlBar->updateState( state );
+ QVERIFY( mControlBar->mToolBar->mState == EPbStatePaused );
+
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testaspectRatioChanged
+// ---------------------------------------------------------------------------
+//
+void TestControlBar::testaspectRatioChanged()
+{
+ MPX_ENTER_EXIT(_L("TestControlBar::testaspectRatioChanged()"));
+
+ init();
+
+ int aspectRatio = 1;
+ mControlBar->aspectRatioChanged( aspectRatio );
+ QVERIFY( mControlBar->mToolBar->mAspectRatio == aspectRatio );
+
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testUpdateWithFileDetails
+// ---------------------------------------------------------------------------
+//
+void TestControlBar::testUpdateWithFileDetails()
+{
+ MPX_ENTER_EXIT(_L("TestControlBar::testUpdateWithFileDetails()"));
+
+ init();
+
+ VideoPlaybackViewFileDetails *details = mController->fileDetails();
+ details->mSeekable = false;
+ details->mVideoEnabled = true;
+
+ mControlBar->updateWithFileDetails( details );
+
+ QVERIFY( mControlBar->mToolBar->mFileDetails->mSeekable == details->mSeekable );
+ QVERIFY( mControlBar->mProgressBar->mFileDetails->mVideoEnabled == details->mVideoEnabled );
+
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testSetVisibleToControlBar
+// ---------------------------------------------------------------------------
+//
+void TestControlBar::testSetVisibleToControlBar()
+{
+ MPX_ENTER_EXIT(_L("TestControlBar::testSetVisibleToControlBar()"));
+
+ init();
+
+ //
+ // Make visible
+ //
+ mControlBar->setVisible( false );
+ mControlBar->setVisibleToControlBar( true );
+ QVERIFY( mControlBar->isVisible() == true );
+
+ //
+ // Make invisible
+ //
+ mControlBar->setVisible( true );
+ mControlBar->setVisibleToControlBar( false );
+ QVERIFY( mControlBar->isVisible() == false );
+
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testDurationChanged
+// ---------------------------------------------------------------------------
+//
+void TestControlBar::testDurationChanged()
+{
+ MPX_ENTER_EXIT(_L("TestControlBar::testDurationChanged()"));
+
+ init();
+
+ int duration = 12345;
+ mControlBar->durationChanged( duration );
+ QVERIFY( mControlBar->mProgressBar->mDuration == duration );
+
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testPositionChanged
+// ---------------------------------------------------------------------------
+//
+void TestControlBar::testPositionChanged()
+{
+ MPX_ENTER_EXIT(_L("TestControlBar::testPositionChanged()"));
+
+ init();
+
+ int position = 54321;
+ mControlBar->positionChanged( position );
+ QVERIFY( mControlBar->mProgressBar->mPosition == position );
+
+ cleanup();
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolbar/stub/inc/videoplaybackcontrolscontroller.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,139 @@
+/*
+* 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 MPXVideoPlaybackControlsController
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+#ifndef MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_
+#define MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_
+
+// INCLUDES
+#include <qobject>
+#include <mpxplaybackframeworkdefs.h>
+
+#include "mpxvideo_debug.h"
+#include "mpxcommonvideoplaybackview.hrh"
+#include "videoplaybackviewfiledetails.h"
+
+// FORWARD DECLARATIONS
+class VideoPlaybackControlsController ;
+
+// DATA TYPES
+
+enum TTimerAction
+{
+ ETimerCancel,
+ ETimerReset
+};
+
+enum TPlaybackViewMode
+{
+ EFullScreenView,
+ EDetailsView,
+ EAudioOnlyView
+};
+
+// CLASS DECLARATION
+
+class VideoPlaybackControlsController : public QObject
+{
+ Q_OBJECT
+
+ public:
+
+ /**
+ * constructor.
+ */
+ VideoPlaybackControlsController();
+
+ /**
+ * Destructor.
+ */
+ virtual ~VideoPlaybackControlsController();
+
+ public:
+
+ /**
+ * Command handling function.
+ * Call HandleCommandL() of container
+ */
+ void handleCommand( TMPXVideoPlaybackViewCommandIds command, int value = 0 );
+
+ /**
+ * Reset or cancel timers for the controls
+ */
+ void resetDisappearingTimers( TTimerAction timerAction );
+
+ /**
+ * Return state
+ */
+ inline TMPXPlaybackState state();
+
+ /**
+ * Return file details
+ */
+ inline VideoPlaybackViewFileDetails* fileDetails();
+
+ TPlaybackViewMode viewMode();
+
+ void changeViewMode( TPlaybackViewMode viewMode, bool transitionEffect = true );
+
+ public:
+ VideoPlaybackViewFileDetails *mFileDetails;
+
+ TMPXPlaybackState mState;
+ TPlaybackViewMode mViewMode;
+ TTimerAction mTimerAction;
+ TMPXVideoPlaybackViewCommandIds mCommand;
+ int mCommandValue;
+};
+
+// INLINE METHODS
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::state
+// -------------------------------------------------------------------------------------------------
+//
+inline
+TMPXPlaybackState VideoPlaybackControlsController::state()
+{
+ return mState;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::fileDetails
+// -------------------------------------------------------------------------------------------------
+//
+inline
+VideoPlaybackViewFileDetails* VideoPlaybackControlsController::fileDetails()
+{
+ return mFileDetails;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::viewMode
+// -------------------------------------------------------------------------------------------------
+//
+inline
+TPlaybackViewMode VideoPlaybackControlsController::viewMode()
+{
+ return mViewMode;
+}
+
+#endif /*MPXVIDEOPLAYBACKCONTROLSCONTROLLER_P_H_*/
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolbar/stub/inc/videoplaybackprogressbar.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,55 @@
+/*
+* 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 VideoPlaybackProgressBar
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+#ifndef VIDEOPLAYBACKPROGRESSBAR_H_
+#define VIDEOPLAYBACKPROGRESSBAR_H_
+
+#include <hbwidget.h>
+#include <mpxplaybackframeworkdefs.h>
+
+class VideoPlaybackViewFileDetails;
+class VideoPlaybackControlsController;
+
+class VideoPlaybackProgressBar : public HbWidget
+{
+ Q_OBJECT
+
+ public:
+ VideoPlaybackProgressBar( VideoPlaybackControlsController* controller );
+ virtual ~VideoPlaybackProgressBar();
+ void initialize();
+ void updateWithFileDetails( VideoPlaybackViewFileDetails* details );
+ void updateState( TMPXPlaybackState state );
+
+ public:
+ void durationChanged( int duration );
+ void positionChanged( int position );
+
+ public:
+ VideoPlaybackControlsController *mController;
+ VideoPlaybackViewFileDetails *mFileDetails;
+ TMPXPlaybackState mState;
+ int mDuration;
+ int mPosition;
+};
+
+#endif /*VIDEOPLAYBACKPROGRESSBAR_H_*/
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolbar/stub/inc/videoplaybacktoolbar.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,59 @@
+/*
+* 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 VideoPlaybackToolBar
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+#ifndef VIDEOPLAYBACKTOOLBAR_H_
+#define VIDEOPLAYBACKTOOLBAR_H_
+
+#include <QWidget>
+#include <mpxplaybackframeworkdefs.h>
+
+
+
+class VideoPlaybackViewFileDetails;
+class VideoPlaybackControlsController;
+
+
+class VideoPlaybackToolBar : public QWidget
+{
+ Q_OBJECT
+
+ public:
+ VideoPlaybackToolBar( VideoPlaybackControlsController* controller );
+ virtual ~VideoPlaybackToolBar();
+ void updateState( TMPXPlaybackState state );
+ void aspectRatioChanged( int aspectRatio );
+ void initialize();
+ void updateWithFileDetails( VideoPlaybackViewFileDetails* details );
+ void durationChanged( int duration );
+ void positionChanged( int position );
+ void setVisible( bool visible );
+
+ public:
+ VideoPlaybackControlsController *mController;
+ VideoPlaybackViewFileDetails *mFileDetails;
+ int mAspectRatio;
+ int mPosition;
+ int mDuration;
+ bool mVisible;
+ TMPXPlaybackState mState;
+};
+
+#endif /*VIDEOPLAYBACKTOOLBAR_H_*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolbar/stub/inc/videoplaybackviewfiledetails.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,84 @@
+/*
+* 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: Video File Details (QT)
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+
+#ifndef __VIDEOPLAYBACKVIEWFILEDETAILS__
+#define __VIDEOPLAYBACKVIEWFILEDETAILS__
+
+#include <qobject.h>
+#include "mpxhelixplaybackplugindefs.h"
+
+
+//
+// CLASS DECLARATION
+//
+class VideoPlaybackViewFileDetails : public QObject
+{
+ public:
+ //
+ // Constructor
+ //
+ VideoPlaybackViewFileDetails();
+
+ //
+ // Destructor.
+ //
+ virtual ~VideoPlaybackViewFileDetails();
+
+ //
+ // Clear all file details
+ //
+ void clearFileDetails();
+
+ public:
+ //
+ // Data
+ //
+ QString mClipName;
+ QString mTitle;
+ QString mArtist;
+ QString mMimeType;
+ QString mDescription;
+ QString mLocation;
+ QString mCopyright;
+ QString mLanguage;
+ QString mKeywords;
+
+ TMPXVideoMode mPlaybackMode;
+ bool mSeekable;
+ bool mPausableStream;
+ bool mAudioEnabled;
+ bool mVideoEnabled;
+ bool mPartialPlayback;
+ bool mRNFormat;
+ bool mTvOutConnected;
+ bool mDrmProtected;
+ bool mMultiItemPlaylist;
+
+ int mVideoHeight;
+ int mVideoWidth;
+ int mBitRate;
+ int mDuration;
+};
+
+#endif // __VIDEOPLAYBACKVIEWFILEDETAILS__
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolbar/stub/src/videoplaybackcontrolscontroller.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,87 @@
+/*
+* 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 VideoPlaybackControlsController
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+// INCLUDE FILES
+
+
+#include "videoplaybackcontrolscontroller.h"
+
+// ================= MEMBER FUNCTIONS ==============================================================
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::VideoPlaybackControlsController()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackControlsController::VideoPlaybackControlsController()
+ : mViewMode( EFullScreenView )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackControlsController::VideoPlaybackControlsController()"));
+
+ mFileDetails = new VideoPlaybackViewFileDetails();
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::~VideoPlaybackControlsController
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackControlsController::~VideoPlaybackControlsController()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::~VideoPlaybackControlsController"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::handleCommand()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::handleCommand(
+ TMPXVideoPlaybackViewCommandIds command, int value )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::handleCommand(%d)"), command);
+
+ mCommand = command;
+ mCommandValue = value;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::changeViewMode
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::changeViewMode(
+ TPlaybackViewMode viewMode, bool transitionEffect )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::changeViewMode()"));
+
+ Q_UNUSED( transitionEffect );
+ mViewMode = viewMode;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::resetDisappearingTimers()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::resetDisappearingTimers( TTimerAction timerAction )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::resetDisappearingTimers()"));
+
+ mTimerAction = timerAction;
+}
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolbar/stub/src/videoplaybackprogressbar.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,102 @@
+/*
+* 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 VideoPlaybackProgressBar
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+
+#include "mpxvideo_debug.h"
+#include "videoplaybackprogressbar.h"
+#include "videoplaybackcontrolscontroller.h"
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackProgressBar::VideoPlaybackProgressBar
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackProgressBar::VideoPlaybackProgressBar(
+ VideoPlaybackControlsController* controller )
+ : mController( controller )
+ , mDuration( -1 )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackProgressBar::VideoPlaybackProgressBar()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackProgressBar::~VideoPlaybackProgressBar
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackProgressBar::~VideoPlaybackProgressBar()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackProgressBar::~VideoPlaybackProgressBar()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackProgressBar::initialize
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackProgressBar::initialize()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackProgressBar::initialize()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackProgressBar::durationChanged
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackProgressBar::durationChanged( int duration )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::durationChanged duration = %d"), duration );
+
+ mDuration = duration;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackProgressBar::positionChanged
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackProgressBar::positionChanged( int position )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::positionChanged position = %d"), position );
+
+ mPosition = position;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackProgressBar::updateWithFileDetails()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackProgressBar::updateWithFileDetails(
+ VideoPlaybackViewFileDetails* details )
+{
+ MPX_DEBUG(_L("VideoPlaybackProgressBar::updateControlsWithFileDetails()"));
+
+ mFileDetails = details;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackProgressBar::updateState()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackProgressBar::updateState( TMPXPlaybackState state )
+{
+ MPX_DEBUG(_L("VideoPlaybackProgressBar::updateState() state = %d"), state );
+
+ mState = state;
+}
+
+//End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolbar/stub/src/videoplaybacktoolbar.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,126 @@
+/*
+* 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 VideoPlaybackToolBar
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+#include <hbpushbutton.h>
+
+#include "mpxvideo_debug.h"
+#include "videoplaybacktoolbar.h"
+#include "videoplaybackviewfiledetails.h"
+#include "mpxcommonvideoplaybackview.hrh"
+
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackToolBar::VideoPlaybackToolBar()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackToolBar::VideoPlaybackToolBar(
+ VideoPlaybackControlsController* controller )
+ : mController( controller )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackToolBar::VideoPlaybackToolBar"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackToolBar::~VideoPlaybackToolBar()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackToolBar::~VideoPlaybackToolBar()
+{
+ MPX_DEBUG(_L("VideoPlaybackToolBar::~VideoPlaybackToolBar()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackToolBar::initialize()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackToolBar::initialize()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackToolBar::initialize()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackToolBar::updateState()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackToolBar::updateState( TMPXPlaybackState state )
+{
+ MPX_DEBUG(_L("VideoPlaybackToolBar::updateState() state = %d"), state );
+
+ mState = state;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackToolBar::aspectRatioChanged()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackToolBar::aspectRatioChanged( int aspectRatio )
+{
+ MPX_DEBUG(_L("VideoPlaybackToolBar::aspectRatioChanged() aspectRatio = %d"), aspectRatio );
+
+ mAspectRatio = aspectRatio;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackToolBar::updateWithFileDetails()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackToolBar::updateWithFileDetails(
+ VideoPlaybackViewFileDetails* details )
+{
+ MPX_DEBUG(_L("VideoPlaybackToolBar::updateWithFileDetails()"));
+
+ mFileDetails = details;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackToolBar::durationChanged
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackToolBar::durationChanged( int duration )
+{
+ MPX_DEBUG(_L("VideoPlaybackToolBar::durationChanged duration = %d"), duration );
+
+ mDuration = duration;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackToolBar::positionChanged
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackToolBar::positionChanged( int position )
+{
+ MPX_DEBUG(_L("VideoPlaybackToolBar::positionChanged position = %d"), position );
+
+ mPosition = position;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackToolBar::setVisible
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackToolBar::setVisible( bool visible )
+{
+ MPX_DEBUG(_L("VideoPlaybackToolBar::setVisible position = %d"), visible );
+
+ mVisible = visible;
+}
+
+//End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolbar/stub/src/videoplaybackviewfiledetails.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,77 @@
+/*
+* 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: class for Video File Details (Qt)
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+//
+// INCLUDE FILES
+//
+#include "mpxvideo_debug.h"
+#include "videoplaybackviewfiledetails.h"
+
+
+// ============================ MEMBER FUNCTIONS ===================================================
+
+VideoPlaybackViewFileDetails::VideoPlaybackViewFileDetails()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewFileDetails::VideoPlaybackViewFileDetails()"));
+
+ clearFileDetails();
+}
+
+VideoPlaybackViewFileDetails::~VideoPlaybackViewFileDetails()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewFileDetails::~VideoPlaybackViewFileDetails()"));
+
+ clearFileDetails();
+}
+
+void
+VideoPlaybackViewFileDetails::clearFileDetails()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewFileDetails::ClearFileDetails()"));
+
+ mMimeType = tr("");
+ mTitle = tr("");
+ mArtist = tr("");
+ mClipName = tr("");
+ mDescription = tr("");
+ mLocation = tr("");
+ mCopyright = tr("");
+ mLanguage = tr("");
+ mKeywords = tr("");
+
+ mPlaybackMode = EMPXVideoLocal;
+ mSeekable = false;
+ mPausableStream = false;
+ mAudioEnabled = false;
+ mVideoEnabled = false;
+ mPartialPlayback = false;
+ mRNFormat = false;
+
+ mDuration = 0;
+ mTvOutConnected = false;
+ mDrmProtected = false;
+
+ mVideoHeight = 0;
+ mVideoWidth = 0;
+ mBitRate = 0;
+}
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolbar/testcontrolbar.pro Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,43 @@
+#
+# 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: Project file for building testcontrolbar
+#
+#
+# Version : %version: 5 %
+
+TEMPLATE = app
+TARGET = testcontrolbar
+CONFIG += qtestlib qt hb
+
+INCLUDEPATH += stub/inc \
+ ../../../../inc \
+ ../../../inc
+
+
+DEPENDPATH += inc src stub/inc stub/src
+
+# Input
+HEADERS += testcontrolbar.h \
+ videoplaybackcontrolscontroller.h \
+ videoplaybackviewfiledetails.h \
+ videoplaybackprogressbar.h \
+ videoplaybacktoolbar.h \
+ ../../controlinc/videoplaybackcontrolbar.h
+
+SOURCES += testcontrolbar.cpp \
+ videoplaybackcontrolscontroller.cpp \
+ videoplaybackviewfiledetails.cpp \
+ videoplaybackprogressbar.cpp \
+ videoplaybacktoolbar.cpp \
+ ../../controlsrc/videoplaybackcontrolbar.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolconfiguration/inc/testcontrolconfiguration.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,76 @@
+/**
+* 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: test for ControlConfiguration
+*
+*/
+
+// Version : %version: 3 %
+
+
+#ifndef __TESTCONTROLCONFIGURATION_H__
+#define __TESTCONTROLCONFIGURATION_H__
+
+
+// INCLUDES
+#include <QtTest/QtTest>
+
+class VideoBasePlaybackView;
+class CMPXVideoViewWrapper;
+class VideoPlaybackViewFileDetails;
+class VideoPlaybackControlsController;
+class VideoPlaybackControlConfiguration;
+
+
+class TestControlConfiguration : public QObject
+{
+ Q_OBJECT
+
+ public:
+
+ /**
+ * will be called before each testfunction is executed.
+ *
+ */
+ void init();
+
+ /**
+ * will be called after every testfunction.
+ *
+ */
+ void cleanup();
+
+ // test functions for the test framework
+
+ void setup();
+
+ private slots:
+ void testControlList();
+ void testUpdateControlsWithFileDetails();
+ void testUpdateControlList();
+
+ signals:
+ void commandSignal(int);
+
+ private:
+ VideoBasePlaybackView* mBaseVideoView;
+ CMPXVideoViewWrapper* mVideoViewWrapper;
+ VideoPlaybackViewFileDetails* mFileDetails;
+ VideoPlaybackControlsController* mControlsController;
+ VideoPlaybackControlConfiguration* mControlConfig;
+};
+
+
+#endif // __TESTCONTROLCONFIGURATION_H__
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolconfiguration/src/testcontrolconfiguration.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,265 @@
+/**
+* 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: tester for methods in videoplaybackcontrolconfiguration
+*
+*/
+
+// Version : %version: 5 %
+
+#include <hbapplication.h>
+#include <hbinstance.h>
+#include <qdebug>
+#include <qgraphicswidget>
+
+#include "videoplaybackcontrol.hrh"
+#include "mpxhelixplaybackplugindefs.h"
+
+#include "testcontrolconfiguration.h"
+
+#include "videoplaybackviewfiledetails.h"
+#include "videoplaybackcontrolscontroller.h"
+#include "videoplaybackdocumentloader.h"
+
+
+#define private public
+#include "videoplaybackcontrolconfiguration.h"
+#undef private
+
+
+// ---------------------------------------------------------------------------
+// main
+// ---------------------------------------------------------------------------
+//
+int main(int argc, char *argv[])
+{
+ MPX_ENTER_EXIT(_L("TestControlConfiguration::Main()"));
+
+ HbApplication app(argc, argv);
+ HbMainWindow window;
+
+ TestControlConfiguration tv;
+
+ char *pass[3];
+ pass[0] = argv[0];
+ pass[1] = "-o";
+ pass[2] = "c:\\data\\testcontrolconfiguration.txt";
+
+ int res = QTest::qExec(&tv, 3, pass);
+
+ return res;
+}
+
+// ---------------------------------------------------------------------------
+// init
+// ---------------------------------------------------------------------------
+//
+void TestControlConfiguration::init()
+{
+ MPX_ENTER_EXIT(_L("TestControlConfiguration::init()"));
+}
+
+// ---------------------------------------------------------------------------
+// init
+// ---------------------------------------------------------------------------
+//
+void TestControlConfiguration::setup()
+{
+ MPX_ENTER_EXIT(_L("TestControlConfiguration::setup()"));
+
+ mFileDetails = new VideoPlaybackViewFileDetails();
+
+ mControlsController = new VideoPlaybackControlsController( mFileDetails );
+
+ mControlConfig = new VideoPlaybackControlConfiguration( mControlsController );
+}
+
+// ---------------------------------------------------------------------------
+// cleanup
+// ---------------------------------------------------------------------------
+//
+void TestControlConfiguration::cleanup()
+{
+ MPX_ENTER_EXIT(_L("TestControlConfiguration::cleanup()"));
+
+ if ( mFileDetails )
+ {
+ delete mFileDetails;
+ mFileDetails = NULL;
+ }
+
+ if ( mControlsController )
+ {
+ delete mControlsController;
+ mControlsController = NULL;
+ }
+
+ if ( mControlConfig )
+ {
+ delete mControlConfig;
+ mControlConfig = NULL;
+ }
+}
+
+// ---------------------------------------------------------------------------
+// testControlList
+// ---------------------------------------------------------------------------
+//
+void TestControlConfiguration::testControlList()
+{
+ MPX_ENTER_EXIT(_L("TestControlConfiguration::testControlList()"));
+
+ setup();
+
+ //
+ // Streaming case
+ //
+ mFileDetails->mPlaybackMode = EMPXVideoStreaming;
+
+ mControlConfig->createControlList();
+ QList<TVideoPlaybackControls> controlsList = mControlConfig->controlList();
+
+ QVERIFY( controlsList.contains( EStatusPane ) );
+ QVERIFY( ! controlsList.contains( ERealLogoBitmap ) );
+ QVERIFY( controlsList.contains( EBufferingAnimation ) );
+
+ cleanup();
+
+ //
+ // local + RN
+ //
+ setup();
+
+ mFileDetails->mPlaybackMode = EMPXVideoLocal;
+ mFileDetails->mRNFormat = true;
+
+ mControlConfig->createControlList();
+ controlsList = mControlConfig->controlList();
+
+ QVERIFY( controlsList.contains( EStatusPane ) );
+ QVERIFY( controlsList.contains( ERealLogoBitmap ) );
+ QVERIFY( ! controlsList.contains( EBufferingAnimation ) );
+
+ cleanup();
+
+ //
+ // local + non RN
+ //
+ setup();
+
+ mFileDetails->mPlaybackMode = EMPXVideoLocal;
+ mFileDetails->mRNFormat = false;
+
+ mControlConfig->createControlList();
+ controlsList = mControlConfig->controlList();
+
+ QVERIFY( controlsList.contains( EStatusPane ) );
+ QVERIFY( ! controlsList.contains( ERealLogoBitmap ) );
+ QVERIFY( ! controlsList.contains( EBufferingAnimation ) );
+
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testUpdateControlsWithFileDetails
+// ---------------------------------------------------------------------------
+//
+void TestControlConfiguration::testUpdateControlsWithFileDetails()
+{
+ MPX_ENTER_EXIT(_L("TestControlConfiguration::testUpdateControlsWithFileDetails()"));
+
+ setup();
+ mControlConfig->createControlList();
+
+ //
+ // 1. test with mVideoEnabled = false
+ //
+ mControlsController->mFileDetails->mVideoEnabled = false;
+
+ mControlConfig->updateControlsWithFileDetails();
+
+ QList<TVideoPlaybackControls> controlsList = mControlConfig->controlList();
+
+ QVERIFY( controlsList.contains( EControlBar ) );
+
+ //
+ // 2. test with mVideoEnabled = true
+ //
+ mControlsController->mFileDetails->mVideoEnabled = false;
+
+ mControlConfig->updateControlsWithFileDetails();
+
+ QVERIFY( controlsList.contains( EControlBar ) );
+
+ QGraphicsWidget *widget =
+ mControlsController->layoutLoader()->findWidget( QString( "transparentWindow" ) );
+
+ QVERIFY( widget->isVisible() );
+
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testUpdateControlList
+// ---------------------------------------------------------------------------
+//
+void TestControlConfiguration::testUpdateControlList()
+{
+ MPX_ENTER_EXIT(_L("TestControlConfiguration::testUpdateControlList()"));
+
+ setup();
+ mControlConfig->createControlList();
+
+ //
+ // 1. Test for Details View
+ //
+ mControlConfig->updateControlList( EControlCmdDetailsViewOpened );
+ QList<TVideoPlaybackControls> controlsList = mControlConfig->controlList();
+
+ QVERIFY( controlsList.contains( EFileDetailsWidget ) );
+ QVERIFY( controlsList.contains( EDetailsViewPlaybackWindow ) );
+ QVERIFY( ! controlsList.contains( EIndicatorBitmap ) );
+
+
+ //
+ // 2. Test for Fullscreen View
+ //
+ mControlConfig->updateControlList( EControlCmdFullScreenViewOpened );
+ controlsList = mControlConfig->controlList();
+
+ QVERIFY( ! controlsList.contains( EFileDetailsWidget ) );
+ QVERIFY( ! controlsList.contains( EDetailsViewPlaybackWindow ) );
+ QVERIFY( ! controlsList.contains( EIndicatorBitmap ) );
+
+ //
+ // 3. Test for Audio Only View
+ //
+ mControlConfig->updateControlList( EControlCmdAudionOnlyViewOpened );
+ controlsList = mControlConfig->controlList();
+
+ QVERIFY( ! controlsList.contains( EDetailsViewPlaybackWindow ) );
+ QVERIFY( controlsList.contains( EIndicatorBitmap ) );
+ QVERIFY( controlsList.contains( EFileDetailsWidget ) );
+
+ //
+ // 4. RN log gets removed
+ //
+ mControlConfig->updateControlList( EControlCmdAudionOnlyViewOpened );
+ controlsList = mControlConfig->controlList();
+
+ QVERIFY( ! controlsList.contains( ERealLogoBitmap ) );
+
+ cleanup();
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolconfiguration/stub/inc/videoplaybackcontrolscontroller.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,95 @@
+/*
+* 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 MPXVideoPlaybackControlsController
+*
+*/
+
+// Version : %version: 4 %
+
+
+
+#ifndef MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_
+#define MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_
+
+// INCLUDES
+#include <qobject>
+
+#include <mpxplaybackframeworkdefs.h>
+
+#include "mpxvideo_debug.h"
+#include "mpxcommonvideoplaybackview.hrh"
+#include "videoplaybackviewfiledetails.h"
+
+// FORWARD DECLARATIONS
+class VideoPlaybackDocumentLoader;
+class VideoPlaybackControlsController;
+class VideoPlaybackControlConfiguration;
+
+
+
+// CLASS DECLARATION
+
+class VideoPlaybackControlsController : public QObject
+{
+ Q_OBJECT
+
+ public:
+
+ /**
+ * constructor.
+ */
+ VideoPlaybackControlsController( VideoPlaybackViewFileDetails *details );
+
+ /**
+ * Destructor.
+ */
+ virtual ~VideoPlaybackControlsController();
+
+ public:
+ /**
+ * Return file details
+ */
+ inline VideoPlaybackViewFileDetails* fileDetails();
+
+ VideoPlaybackDocumentLoader* layoutLoader();
+
+ public:
+ /**
+ * Initialize controller
+ */
+ void initializeController();
+
+ bool shouldShowRNLogo();
+
+ public:
+ VideoPlaybackViewFileDetails *mFileDetails;
+
+ VideoPlaybackControlConfiguration *mControlsConfig;
+
+ VideoPlaybackDocumentLoader *mLoader;
+};
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::fileDetails
+// -------------------------------------------------------------------------------------------------
+//
+inline
+VideoPlaybackViewFileDetails* VideoPlaybackControlsController::fileDetails()
+{
+ return mFileDetails;
+}
+
+#endif /*MPXVIDEOPLAYBACKCONTROLSCONTROLLER_P_H_*/
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolconfiguration/stub/inc/videoplaybackdocumentloader.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,51 @@
+/*
+* 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 VideoPlaybackDocumentLoader
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+#ifndef VIDEOPLAYBACKDOCUMENTHANDLER_H_
+#define VIDEOPLAYBACKDOCUMENTHANDLER_H_
+
+
+#include <qobject>
+
+class QList;
+class QGraphicsWidget;
+class VideoPlaybackControlsController;
+
+class VideoPlaybackDocumentLoader : public QObject
+{
+ public:
+ VideoPlaybackDocumentLoader();
+
+ virtual ~VideoPlaybackDocumentLoader();
+
+ public:
+ QGraphicsWidget* findWidget( const QString &name );
+
+ private:
+ QGraphicsWidget* createWidget( const QString &name );
+ int exist( const QString &name );
+
+ private:
+ QList<QGraphicsWidget*> mWidgets;
+};
+
+#endif /*VIDEOPLAYBACKDOCUMENTHANDLER_H_*/
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolconfiguration/stub/inc/videoplaybackviewfiledetails.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,84 @@
+/*
+* 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: Video File Details (QT)
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+
+#ifndef __VIDEOPLAYBACKVIEWFILEDETAILS__
+#define __VIDEOPLAYBACKVIEWFILEDETAILS__
+
+#include <qobject.h>
+#include "mpxhelixplaybackplugindefs.h"
+
+
+//
+// CLASS DECLARATION
+//
+class VideoPlaybackViewFileDetails : public QObject
+{
+ public:
+ //
+ // Constructor
+ //
+ VideoPlaybackViewFileDetails();
+
+ //
+ // Destructor.
+ //
+ virtual ~VideoPlaybackViewFileDetails();
+
+ //
+ // Clear all file details
+ //
+ void clearFileDetails();
+
+ public:
+ //
+ // Data
+ //
+ QString mClipName;
+ QString mTitle;
+ QString mArtist;
+ QString mMimeType;
+ QString mDescription;
+ QString mLocation;
+ QString mCopyright;
+ QString mLanguage;
+ QString mKeywords;
+
+ TMPXVideoMode mPlaybackMode;
+ bool mSeekable;
+ bool mPausableStream;
+ bool mAudioEnabled;
+ bool mVideoEnabled;
+ bool mPartialPlayback;
+ bool mRNFormat;
+ bool mTvOutConnected;
+ bool mDrmProtected;
+ bool mMultiItemPlaylist;
+
+ int mVideoHeight;
+ int mVideoWidth;
+ int mBitRate;
+ int mDuration;
+};
+
+#endif // __VIDEOPLAYBACKVIEWFILEDETAILS__
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolconfiguration/stub/src/videoplaybackcontrolscontroller.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,86 @@
+/*
+* 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 MPXVideoPlaybackControlsController
+*
+*/
+
+// Version : %version: 5 %
+
+
+
+// INCLUDE FILES
+
+#include "../inc/videoplaybackdocumentloader.h"
+#include "../inc/videoplaybackviewfiledetails.h"
+#include "../inc/videoplaybackcontrolscontroller.h"
+
+#include "videoplaybackcontrolconfiguration.h"
+
+
+// ================= MEMBER FUNCTIONS ==============================================================
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::VideoPlaybackControlsController()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackControlsController::VideoPlaybackControlsController(
+ VideoPlaybackViewFileDetails *details )
+ : mFileDetails( details )
+{
+ initializeController();
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::initializeController()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::initializeController()
+{
+ mLoader = new VideoPlaybackDocumentLoader();
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::~VideoPlaybackControlsController
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackControlsController::~VideoPlaybackControlsController()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::~VideoPlaybackControlsController"));
+
+ if ( mLoader )
+ {
+ delete mLoader;
+ mLoader = NULL;
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::layoutLoader
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackDocumentLoader* VideoPlaybackControlsController::layoutLoader()
+{
+ return mLoader;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::shouldShowRNLogo
+// -------------------------------------------------------------------------------------------------
+//
+bool VideoPlaybackControlsController::shouldShowRNLogo()
+{
+ return mFileDetails->mRNFormat ;
+}
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolconfiguration/stub/src/videoplaybackdocumentloader.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,132 @@
+/*
+* 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 VideoPlaybackDocumentLoader
+*
+*/
+
+// Version : %version: 2 %
+
+
+#include <hbwidget.h>
+#include <hbtransparentwindow.h>
+#include <hblabel.h>
+
+#include "mpxvideo_debug.h"
+#include "videoplaybackdocumentloader.h"
+
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDocumentLoader::VideoPlaybackDocumentLoader
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackDocumentLoader::VideoPlaybackDocumentLoader()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackDocumentLoader::VideoPlaybackDocumentLoader()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDocumentLoader::~VideoPlaybackDocumentLoader
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackDocumentLoader::~VideoPlaybackDocumentLoader()
+{
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::VideoPlaybackDocumentLoader") );
+
+ for ( int i = 0 ; i < mWidgets.count() ; i++ )
+ {
+ mWidgets.removeAt( 0 );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDocumentLoader::findWidget()
+// -------------------------------------------------------------------------------------------------
+//
+QGraphicsWidget *VideoPlaybackDocumentLoader::findWidget( const QString &name )
+{
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::findWidget") );
+
+ QGraphicsWidget *object = NULL;
+
+ int index = exist( name );
+
+ if ( index == -1 )
+ {
+ object = createWidget( name );
+ }
+ else
+ {
+ object = mWidgets[ index ];
+ }
+
+ return object;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDocumentLoader::createWidget()
+// -------------------------------------------------------------------------------------------------
+//
+QGraphicsWidget *VideoPlaybackDocumentLoader::createWidget( const QString &name )
+{
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::createWidget") );
+
+ QGraphicsWidget *object = NULL;
+
+ if ( name == "transparentWindow" )
+ {
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::creating transparentWindow") );
+
+ object = new HbTransparentWindow();
+ object->setObjectName( name );
+
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::appending to object list") );
+ mWidgets.append( object );
+ }
+ else if ( name == "title" )
+ {
+ object = new HbLabel();
+ object->setObjectName( name );
+ mWidgets.append( object );
+ }
+
+ return object;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDocumentLoader::exist()
+// -------------------------------------------------------------------------------------------------
+//
+int VideoPlaybackDocumentLoader::exist( const QString &name )
+{
+ int i = 0;
+
+ for ( ; i < mWidgets.count() ; i++ )
+ {
+ if( mWidgets[i]->objectName() == name )
+ {
+ break;
+ }
+ }
+
+ if ( i == mWidgets.count() )
+ {
+ i = -1;
+ }
+
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::exist %d"), i );
+
+ return i;
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolconfiguration/stub/src/videoplaybackviewfiledetails.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,77 @@
+/*
+* 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: class for Video File Details (Qt)
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+//
+// INCLUDE FILES
+//
+#include "mpxvideo_debug.h"
+#include "videoplaybackviewfiledetails.h"
+
+
+// ============================ MEMBER FUNCTIONS ===================================================
+
+VideoPlaybackViewFileDetails::VideoPlaybackViewFileDetails()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewFileDetails::VideoPlaybackViewFileDetails()"));
+
+ clearFileDetails();
+}
+
+VideoPlaybackViewFileDetails::~VideoPlaybackViewFileDetails()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewFileDetails::~VideoPlaybackViewFileDetails()"));
+
+ clearFileDetails();
+}
+
+void
+VideoPlaybackViewFileDetails::clearFileDetails()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewFileDetails::ClearFileDetails()"));
+
+ mMimeType = tr("");
+ mTitle = tr("");
+ mArtist = tr("");
+ mClipName = tr("");
+ mDescription = tr("");
+ mLocation = tr("");
+ mCopyright = tr("");
+ mLanguage = tr("");
+ mKeywords = tr("");
+
+ mPlaybackMode = EMPXVideoLocal;
+ mSeekable = false;
+ mPausableStream = false;
+ mAudioEnabled = false;
+ mVideoEnabled = false;
+ mPartialPlayback = false;
+ mRNFormat = false;
+
+ mDuration = 0;
+ mTvOutConnected = false;
+ mDrmProtected = false;
+
+ mVideoHeight = 0;
+ mVideoWidth = 0;
+ mBitRate = 0;
+}
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolconfiguration/testcontrolconfiguration.pro Thu Jul 08 13:05:19 2010 +0300
@@ -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: Project file for building testcontrolconfiguration
+#
+#
+# Version : %version: 3 %
+
+
+TEMPLATE = app
+TARGET = testcontrolconfiguration
+CONFIG += qtestlib hb qt
+
+DEPENDPATH += . \
+ inc \
+ src
+
+INCLUDEPATH += stub/inc \
+ ../inc \
+ ../../inc \
+ ../../../inc \
+ ../../../../inc \
+
+DEPENDPATH += stub/inc stub/src inc src
+
+# Input
+HEADERS += ../../../controlinc/videoplaybackcontrolconfiguration.h \
+ videoplaybackdocumentloader.h \
+ testcontrolconfiguration.h \
+ videoplaybackcontrolscontroller.h \
+ videoplaybackviewfiledetails.h
+
+SOURCES += ../../../controlsrc/videoplaybackcontrolconfiguration.cpp \
+ videoplaybackdocumentloader.cpp \
+ testcontrolconfiguration.cpp \
+ videoplaybackviewfiledetails.cpp \
+ videoplaybackcontrolscontroller.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolpolicy/inc/testcontrolpolicy.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,68 @@
+/**
+* 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: tester for methods in TestControlPolicy
+*
+*/
+
+// Version : %version: 2 %
+
+#ifndef __TESTCONTROLPOLICY_H__
+#define __TESTCONTROLPOLICY_H__
+
+
+// INCLUDES
+#include <QtTest/QtTest>
+
+class VideoPlaybackControlPolicy;
+class VideoPlaybackViewFileDetails;
+
+class TestControlPolicy : public QObject
+{
+ Q_OBJECT
+
+public:
+
+ /**
+ * will be called before each testfunction is executed.
+ *
+ */
+ void init();
+
+ /**
+ * will be called after every testfunction.
+ *
+ */
+ void cleanup();
+
+ // test functions for the test framework
+private slots:
+
+ // the order in which these testXX methods are declared is important
+ // changing this order will affect the test results
+ void testBufferingAnimationPolicy();
+ void testStatusPanePolicy();
+ void testControlBarPolicy();
+ void testDetailsWidgetPolicy();
+
+signals:
+ void commandSignal();
+
+private:
+ VideoPlaybackControlPolicy* mPolicy;
+ VideoPlaybackViewFileDetails* mDetails;
+};
+
+#endif // __TESTCONTROLPOLICY_H__
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolpolicy/src/testcontrolpolicy.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,183 @@
+/**
+* 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: tester for methods in TestControlPolicy
+*
+*/
+
+// Version : %version: 5 %
+
+
+#include <qdebug>
+
+#include <hbmainwindow.h>
+#include <hbapplication.h>
+
+#include "mpxvideo_debug.h"
+#include "videoplaybackviewfiledetails.h"
+#include "testcontrolpolicy.h"
+
+#define private public
+#include "videoplaybackcontrolpolicy.h"
+#undef private
+
+// ---------------------------------------------------------------------------
+// main
+// ---------------------------------------------------------------------------
+//
+int main(int argc, char *argv[])
+{
+ MPX_ENTER_EXIT(_L("TestControlPolicy::Main()"));
+
+ HbApplication app(argc, argv);
+ HbMainWindow window;
+
+ TestControlPolicy tv;
+
+ char *pass[3];
+ pass[0] = argv[0];
+ pass[1] = "-o";
+ pass[2] = "c:\\data\\testcontrolpolicy.txt";
+
+ int res = QTest::qExec(&tv, 3, pass);
+
+ return res;
+}
+
+
+// ---------------------------------------------------------------------------
+// init
+// ---------------------------------------------------------------------------
+//
+void TestControlPolicy::init()
+{
+ MPX_ENTER_EXIT(_L("TestControlPolicy::init()"));
+
+ mPolicy = new VideoPlaybackControlPolicy();
+ mDetails = new VideoPlaybackViewFileDetails();
+}
+
+// ---------------------------------------------------------------------------
+// cleanup
+// ---------------------------------------------------------------------------
+//
+void TestControlPolicy::cleanup()
+{
+ MPX_ENTER_EXIT(_L("TestControlPolicy::cleanup()"));
+
+ if ( mPolicy )
+ {
+ delete mPolicy;
+ mPolicy = NULL;
+ }
+
+ if ( mDetails )
+ {
+ delete mDetails;
+ mDetails = NULL;
+ }
+}
+
+// ---------------------------------------------------------------------------
+// testBufferingAnimationPolicy
+// ---------------------------------------------------------------------------
+//
+void TestControlPolicy::testBufferingAnimationPolicy()
+{
+ MPX_ENTER_EXIT(_L("TestControlPolicy::testBufferingAnimationPolicy()"));
+
+ init();
+
+ TUint properties = 0;
+
+ mPolicy->setControlProperties( EBufferingAnimation, properties, mDetails, EFullScreenView );
+
+ QVERIFY( properties == ( EShownWhenInitializing | EShownWhenBuffering ) );
+
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testStatusPanePolicy
+// ---------------------------------------------------------------------------
+//
+void TestControlPolicy::testStatusPanePolicy()
+{
+ MPX_ENTER_EXIT(_L("TestControlPolicy::testStatusPanePolicy()"));
+
+ init();
+
+ TUint properties = 0;
+
+ mDetails->mPlaybackMode = EMPXVideoStreaming;
+ mPolicy->setControlProperties( EStatusPane, properties, mDetails, EDetailsView );
+ QVERIFY( properties == EAllProperties );
+
+ mDetails->mPlaybackMode = EMPXVideoLocal;
+ mPolicy->setControlProperties( EStatusPane, properties, mDetails, EFullScreenView );
+ QVERIFY( properties ==
+ ( EShownWhenPlaying | EShownWhenPaused | EShownWhenSeeking | EShownWhenBuffering) );
+
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testControlBarPolicy
+// ---------------------------------------------------------------------------
+//
+void TestControlPolicy::testControlBarPolicy()
+{
+ MPX_ENTER_EXIT(_L("TestControlPolicy::testControlBarPolicy()"));
+
+ init();
+
+ TUint properties = 0;
+
+ mPolicy->setControlProperties( EControlBar, properties, mDetails, EDetailsView );
+ QVERIFY( properties == 0 );
+
+ mPolicy->setControlProperties( EControlBar, properties, mDetails, EAudioOnlyView );
+ QVERIFY( properties == EAllProperties );
+
+ mDetails->mPlaybackMode = EMPXVideoLocal;
+ mPolicy->setControlProperties( EControlBar, properties, mDetails, EFullScreenView );
+ QVERIFY( properties ==
+ ( EShownWhenPlaying | EShownWhenPaused | EShownWhenSeeking | EShownWhenBuffering ) );
+
+ mDetails->mPlaybackMode = EMPXVideoStreaming;
+ mPolicy->setControlProperties( EControlBar, properties, mDetails, EFullScreenView );
+ QVERIFY( properties ==
+ ( EShownWhenPlaying | EShownWhenPaused | EShownWhenSeeking ) );
+
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testDetailsWidgetPolicy
+// ---------------------------------------------------------------------------
+//
+void TestControlPolicy::testDetailsWidgetPolicy()
+{
+ MPX_ENTER_EXIT(_L("TestControlPolicy::testDetailsWidgetPolicy()"));
+
+ init();
+
+ TUint properties = 0;
+
+ mPolicy->setControlProperties( EFileDetailsWidget, properties, mDetails, EAudioOnlyView );
+ QVERIFY( properties == EAllProperties );
+
+ cleanup();
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolpolicy/stub/inc/videoplaybackcontrolscontroller.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,124 @@
+/*
+* 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 VideoPlaybackControlsController
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+#ifndef VIDEOPLAYBACKCONTROLSCONTROLLER_H_
+#define VIDEOPLAYBACKCONTROLSCONTROLLER_H_
+
+// INCLUDES
+#include <qobject>
+#include <mpxplaybackframeworkdefs.h>
+
+#include "mpxvideo_debug.h"
+#include "mpxcommonvideoplaybackview.hrh"
+
+
+// FORWARD DECLARATIONS
+
+
+// DATA TYPES
+
+enum TTimerAction
+{
+ ETimerCancel,
+ ETimerReset
+};
+
+enum TPlaybackViewMode
+{
+ EFullScreenView,
+ EDetailsView,
+ EAudioOnlyView
+};
+
+const int KControlsTimeOut = 4000;
+
+// CLASS DECLARATION
+
+class VideoPlaybackControlsController : public QObject
+{
+ Q_OBJECT
+
+ public:
+
+ /**
+ * constructor.
+ */
+ VideoPlaybackControlsController();
+
+ /**
+ * Destructor.
+ */
+ virtual ~VideoPlaybackControlsController();
+
+ public:
+
+ /**
+ * Command handling function.
+ * Call HandleCommandL() of container
+ */
+ void handleCommand( TMPXVideoPlaybackViewCommandIds command, int value = 0 );
+
+ /**
+ * Reset or cancel timers for the controls
+ */
+ void resetDisappearingTimers( TTimerAction timerAction );
+
+ /**
+ * Return state
+ */
+ inline TMPXPlaybackState state();
+
+ TPlaybackViewMode viewMode();
+
+ void changeViewMode( TPlaybackViewMode viewMode, bool transitionEffect = true );
+
+ public:
+ TMPXPlaybackState mState;
+ TPlaybackViewMode mViewMode;
+ TTimerAction mTimerAction;
+ TMPXVideoPlaybackViewCommandIds mCommand;
+ int mCommandValue;
+};
+
+// INLINE METHODS
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::state
+// -------------------------------------------------------------------------------------------------
+//
+inline
+TMPXPlaybackState VideoPlaybackControlsController::state()
+{
+ return mState;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::viewMode
+// -------------------------------------------------------------------------------------------------
+//
+inline
+TPlaybackViewMode VideoPlaybackControlsController::viewMode()
+{
+ return mViewMode;
+}
+
+#endif /*VIDEOPLAYBACKCONTROLSCONTROLLER_P_H_*/
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolpolicy/stub/inc/videoplaybackviewfiledetails.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,84 @@
+/*
+* 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: Video File Details (QT)
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+
+#ifndef __VIDEOPLAYBACKVIEWFILEDETAILS__
+#define __VIDEOPLAYBACKVIEWFILEDETAILS__
+
+#include <qobject.h>
+#include "mpxhelixplaybackplugindefs.h"
+
+
+//
+// CLASS DECLARATION
+//
+class VideoPlaybackViewFileDetails : public QObject
+{
+ public:
+ //
+ // Constructor
+ //
+ VideoPlaybackViewFileDetails();
+
+ //
+ // Destructor.
+ //
+ virtual ~VideoPlaybackViewFileDetails();
+
+ //
+ // Clear all file details
+ //
+ void clearFileDetails();
+
+ public:
+ //
+ // Data
+ //
+ QString mClipName;
+ QString mTitle;
+ QString mArtist;
+ QString mMimeType;
+ QString mDescription;
+ QString mLocation;
+ QString mCopyright;
+ QString mLanguage;
+ QString mKeywords;
+
+ TMPXVideoMode mPlaybackMode;
+ bool mSeekable;
+ bool mPausableStream;
+ bool mAudioEnabled;
+ bool mVideoEnabled;
+ bool mPartialPlayback;
+ bool mRNFormat;
+ bool mTvOutConnected;
+ bool mDrmProtected;
+ bool mMultiItemPlaylist;
+
+ int mVideoHeight;
+ int mVideoWidth;
+ int mBitRate;
+ int mDuration;
+};
+
+#endif // __VIDEOPLAYBACKVIEWFILEDETAILS__
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolpolicy/stub/src/videoplaybackviewfiledetails.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,77 @@
+/*
+* 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: class for Video File Details (Qt)
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+//
+// INCLUDE FILES
+//
+#include "mpxvideo_debug.h"
+#include "videoplaybackviewfiledetails.h"
+
+
+// ============================ MEMBER FUNCTIONS ===================================================
+
+VideoPlaybackViewFileDetails::VideoPlaybackViewFileDetails()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewFileDetails::VideoPlaybackViewFileDetails()"));
+
+ clearFileDetails();
+}
+
+VideoPlaybackViewFileDetails::~VideoPlaybackViewFileDetails()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewFileDetails::~VideoPlaybackViewFileDetails()"));
+
+ clearFileDetails();
+}
+
+void
+VideoPlaybackViewFileDetails::clearFileDetails()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewFileDetails::ClearFileDetails()"));
+
+ mMimeType = tr("");
+ mTitle = tr("");
+ mArtist = tr("");
+ mClipName = tr("");
+ mDescription = tr("");
+ mLocation = tr("");
+ mCopyright = tr("");
+ mLanguage = tr("");
+ mKeywords = tr("");
+
+ mPlaybackMode = EMPXVideoLocal;
+ mSeekable = false;
+ mPausableStream = false;
+ mAudioEnabled = false;
+ mVideoEnabled = false;
+ mPartialPlayback = false;
+ mRNFormat = false;
+
+ mDuration = 0;
+ mTvOutConnected = false;
+ mDrmProtected = false;
+
+ mVideoHeight = 0;
+ mVideoWidth = 0;
+ mBitRate = 0;
+}
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolpolicy/testcontrolpolicy.pro Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,37 @@
+#
+# 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: Project file for building testcontrolpolicy
+#
+#
+# Version : %version: 2 %
+
+TEMPLATE = app
+TARGET = testcontrolpolicy
+CONFIG += qtestlib qt hb
+
+INCLUDEPATH += stub/inc \
+ ../../../../inc \
+ ../../../inc
+
+
+DEPENDPATH += inc src stub/inc stub/src
+
+# Input
+HEADERS += testcontrolpolicy.h \
+ videoplaybackviewfiledetails.h \
+ ../../controlinc/videoplaybackcontrolpolicy.h
+
+SOURCES += testcontrolpolicy.cpp \
+ videoplaybackviewfiledetails.cpp \
+ ../../controlsrc/videoplaybackcontrolpolicy.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/inc/testcontrolscontroller.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,139 @@
+/**
+* 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: tester for methods in Video Playback Controls Controller
+*
+*/
+
+// Version : %version: 8 %
+
+#ifndef __TESTCONTROLSCONTROLLER_H__
+#define __TESTCONTROLSCONTROLLER_H__
+
+
+// INCLUDES
+#include <QtTest/QtTest>
+#include "videoplaybackcontrol.hrh"
+
+// FORWARD DECLARATIONS
+class VideoBasePlaybackView;
+class CMPXVideoViewWrapper;
+class VideoPlaybackControlsController;
+class VideoPlaybackViewFileDetails;
+
+class TestControlsController : public QObject
+{
+ Q_OBJECT
+
+public:
+
+ /**
+ * will be called before each testfunction is executed.
+ *
+ */
+ void init();
+
+ /**
+ * will be called after every testfunction.
+ *
+ */
+ void cleanup();
+
+private:
+
+ void verifyHandleEventStateChangedResult( int value );
+ void verifyHandleEventTvOutResult( bool tvOutConnected, bool value );
+
+private slots:
+
+ void testAddFileDetails();
+ void testHandleEventSetPosition();
+ void testHandleEventSetDuration();
+ void testHandleEventStateChanged();
+ void testHandleEventSetVolume();
+ void testHandleEventSetAspectRatio();
+ void testHandleEventSetDownloadSize();
+ void testHandleEventDownloadUpdated();
+ void testHandleEventDownloadComplete();
+ void testHandleEventSetDownloadPaused();
+ void testHandleEventClearDownloadPaused();
+ void testHandleEventTvOutConnected();
+ void testHandleEventTvOutDisconnected();
+ void testHandleEventHandleErrors();
+ void testHandleEventShowVolumeControls();
+
+ //
+ // test handleCommand()
+ //
+ void testHandleCommand();
+
+ //
+ // test handleTappedOnScreen()
+ //
+ void testHandleTappedOnScreen();
+
+ //
+ // test updateVideoRectDone()
+ //
+ void testUpdateVideoRectDone();
+
+ //
+ // test isAttachOperation()
+ //
+ void testIsAttachOperation();
+
+ //
+ // test private slot skipToNextVideoItem()
+ //
+ void testslot_skipToNextVideoItem();
+
+ //
+ // test private slot skipToPreviousVideoItem()
+ //
+ void testslot_skipToPreviousVideoItem();
+
+ //
+ // test private slot attachVideo()
+ //
+ void testslot_attachVideo();
+
+ //
+ // test private slot attachVideo()
+ //
+ 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:
+
+ VideoBasePlaybackView* mBaseVideoView;
+ CMPXVideoViewWrapper* mViewWrapper;
+ VideoPlaybackControlsController* mController;
+ VideoPlaybackViewFileDetails* mFileDetails;
+
+};
+
+#endif // __TESTCONTROLSCONTROLLER_H__
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/src/testcontrolscontroller.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,1290 @@
+/**
+* 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: tester for methods in Video Playback Controls Controller
+*
+*/
+
+// Version : %version: 13 %
+
+#include <e32err.h>
+#include <w32std.h>
+#include <qobject>
+
+#include <hbapplication.h>
+#include <hbinstance.h>
+#include <hblabel.h>
+#include <MMFScalingCustomCommandConstants.h>
+
+#include "mpxvideo_debug.h"
+#include "videoplaybackcontrol.hrh"
+#include "mpxcommonvideoplaybackview.hrh"
+#include "testcontrolscontroller.h"
+#include "videobaseplaybackview.h"
+#include "videoplaybackviewfiledetails.h"
+#include "mpxvideoviewwrapper.h"
+#include "videoplaybackfullscreencontrol.h"
+#include "videoplaybackcontrolconfiguration.h"
+#include "thumbnailmanager_qt.h"
+#include "videoplaybackdocumentloader.h"
+#include "hbvolumesliderpopup.h"
+#include "videoservices.h"
+#include "xqserviceutilxtra.h"
+
+#define private public
+#include "videoplaybackcontrolscontroller.h"
+#undef private
+
+const TInt KControlListsUpdated = 12; // additional extension of TMPXPlaybackState
+
+// ---------------------------------------------------------------------------
+// main
+// ---------------------------------------------------------------------------
+//
+int main(int argc, char *argv[])
+{
+ HbApplication app(argc, argv);
+ HbMainWindow window;
+ TestControlsController tv;
+
+ char *pass[3];
+ pass[0] = argv[0];
+ pass[1] = "-o";
+ pass[2] = "c:\\data\\testcontrolscontroller.txt";
+
+ int res = QTest::qExec(&tv, 3, pass);
+
+ return res;
+}
+
+// ---------------------------------------------------------------------------
+// init
+// ---------------------------------------------------------------------------
+//
+void TestControlsController::init()
+{
+ MPX_ENTER_EXIT(_L("TestControlsController::init()"));
+
+ mBaseVideoView = new VideoBasePlaybackView();
+
+ if ( ! mFileDetails )
+ {
+ mFileDetails = new VideoPlaybackViewFileDetails();
+ }
+
+ mViewWrapper = CMPXVideoViewWrapper::NewL( mBaseVideoView );
+ mController = new VideoPlaybackControlsController( mBaseVideoView,
+ mViewWrapper,
+ mFileDetails );
+}
+
+// ---------------------------------------------------------------------------
+// cleanup
+// ---------------------------------------------------------------------------
+//
+void TestControlsController::cleanup()
+{
+ MPX_ENTER_EXIT(_L("TestControlsController::cleanup()"));
+
+ delete mController;
+ mController = NULL;
+
+ delete mFileDetails;
+ mFileDetails = NULL;
+
+ delete mViewWrapper;
+ mViewWrapper = NULL;
+
+ delete mBaseVideoView;
+ mBaseVideoView = NULL;
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestControlsController::testAddFileDetails
+// -------------------------------------------------------------------------------------------------
+//
+void TestControlsController::testAddFileDetails()
+{
+ MPX_DEBUG(_L("TestControlsController::testAddFileDetails()") );
+
+ //
+ // local real media with no video
+ //
+ mFileDetails = new VideoPlaybackViewFileDetails();
+ 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 == EControlCmdTvOutConnected );
+
+ cleanup();
+
+ //
+ // local 3GPP media with video-only
+ //
+ mFileDetails = new VideoPlaybackViewFileDetails();
+
+ mFileDetails->mClipName = QString("testClip.3gp");
+ mFileDetails->mMimeType = QString("video/3gpp");
+ mFileDetails->mVideoEnabled = true;
+ mFileDetails->mTvOutConnected = true;
+
+ init();
+
+ mController->mViewMode = EFullScreenView;
+ QFileInfo videoOnlyFile( mFileDetails->mClipName );
+
+ mController->addFileDetails( mFileDetails );
+
+ QVERIFY( mController->mFileDetails->mRNFormat == false );
+ QVERIFY( mController->mControlsConfig->mUpdateControlsWithFileDetails == true );
+
+ //
+ // validate 'TvOutConnected'
+ //
+ verifyHandleEventTvOutResult(true, true);
+
+ //
+ // video-only, validate volume control is dimmed
+ //
+ QVERIFY( mController->mVolumeControl->mValue == 0 );
+ QVERIFY( mController->mVolumeControl->isEnabled() == false );
+
+ //
+ // verify 'title' (via mClipName) is set properly
+ //
+ for ( int i=0 ; i < mController->mLoader->mWidgets.count() ; i++ )
+ {
+ if( mController->mLoader->mWidgets[i]->objectName() == QString( "title" ) )
+ {
+ HbLabel *titleLabel = qobject_cast<HbLabel*>( mController->mLoader->mWidgets[i] );
+ QVERIFY( titleLabel->plainText() == videoOnlyFile.baseName() );
+ break;
+ }
+ }
+ cleanup();
+
+ //
+ // non-local audio-video media, TvOut is not connected
+ //
+ mFileDetails = new VideoPlaybackViewFileDetails();
+
+ 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 );
+ QVERIFY( mController->mControlsConfig->mUpdateControlsWithFileDetails == true );
+
+ //
+ // verify 'title' (via mTitle) is set properly
+ //
+ for ( int i=0 ; i < mController->mLoader->mWidgets.count() ; i++ )
+ {
+ if( mController->mLoader->mWidgets[i]->objectName() == QString( "title" ) )
+ {
+ HbLabel *titleLabel = qobject_cast<HbLabel*>( mController->mLoader->mWidgets[i] );
+ QVERIFY( titleLabel->plainText() == mFileDetails->mTitle );
+ break;
+ }
+ }
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestControlsController::testHandleEventSetPosition
+// -------------------------------------------------------------------------------------------------
+//
+void TestControlsController::testHandleEventSetPosition()
+{
+ MPX_DEBUG(_L("TestControlsController::testHandleEventSetPosition()"));
+
+ init();
+ int value = 20000;
+
+ mController->handleEvent( EControlCmdSetPosition, value );
+
+ QVERIFY( mController->mControls[0]->mPosition == ( value / KPbMilliMultiplier ) );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestControlsController::testHandleEventSetDuration
+// -------------------------------------------------------------------------------------------------
+//
+void TestControlsController::testHandleEventSetDuration()
+{
+ MPX_DEBUG(_L("TestControlsController::testHandleEventSetDuration()"));
+
+ init();
+ int value = 30000;
+
+ mController->handleEvent( EControlCmdSetDuration, value );
+
+ QVERIFY( mController->mControls[0]->mDuration == ( value / KPbMilliMultiplier ) );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestControlsController::testHandleEventStateChanged
+// -------------------------------------------------------------------------------------------------
+//
+void TestControlsController::testHandleEventStateChanged()
+{
+ MPX_DEBUG(_L("TestControlsController::testHandleEventStateChanged()"));
+
+ init();
+ TVideoPlaybackControlCommandIds event = EControlCmdStateChanged;
+ mController->mOrientation = Qt::Horizontal;
+
+ //
+ // state change (EPbStateInitialising)
+ //
+ int value = EPbStateInitialising;
+ mController->handleEvent( event, value );
+ verifyHandleEventStateChangedResult( value );
+
+ //
+ // state change (EPbStateBuffering)
+ //
+ value = EPbStateBuffering;
+ mController->handleEvent( event, value );
+ verifyHandleEventStateChangedResult( value );
+
+ //
+ // state change (EPbStatePlaying)
+ //
+ value = EPbStatePlaying;
+ mController->handleEvent( event, value );
+ verifyHandleEventStateChangedResult( value );
+
+ //
+ // state change (EPbStatePaused)
+ //
+ value = EPbStatePaused;
+ mController->handleEvent( event, value );
+ verifyHandleEventStateChangedResult( value );
+
+ //
+ // state change (EPbStateNotInitialised)
+ //
+ value = EPbStateNotInitialised;
+ mController->handleEvent( event, value );
+ verifyHandleEventStateChangedResult( value );
+
+ //
+ // state change (EPbStateStopped)
+ //
+ value = EPbStateStopped;
+ mController->handleEvent( event, value );
+ verifyHandleEventStateChangedResult( value );
+
+ //
+ // state change (EPbStateSeekingForward)
+ //
+ value = EPbStateSeekingForward;
+ mController->handleEvent( event, value );
+ verifyHandleEventStateChangedResult( value );
+
+ //
+ // state change (EPbStateSeekingBackward)
+ //
+ value = EPbStateSeekingBackward;
+ mController->handleEvent( event, value );
+ verifyHandleEventStateChangedResult( value );
+
+ //
+ // state change (EPbStateShuttingDown)
+ //
+ value = EPbStateShuttingDown;
+ mController->handleEvent( event, value );
+ verifyHandleEventStateChangedResult( value );
+
+ //
+ // state change (EPbStateDownloading)
+ //
+ value = EPbStateDownloading;
+ mController->handleEvent( event, value );
+ verifyHandleEventStateChangedResult( value );
+
+ //
+ // state change (EPbStatePluginSeeking)
+ //
+ value = EPbStatePluginSeeking;
+ mController->handleEvent( event, value );
+ verifyHandleEventStateChangedResult( value );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestControlsController::verifyHandleEventStateChangedResult
+// -------------------------------------------------------------------------------------------------
+//
+void TestControlsController::verifyHandleEventStateChangedResult( int value )
+{
+ MPX_DEBUG(_L("TestControlsController::verifyHandleEventStateChangedResult()"));
+
+ mController->mOrientation = Qt::Horizontal;
+
+ if ( value == EPbStateInitialised &&
+ ( mController->mFileDetails->mPlaybackMode == EMPXVideoStreaming ||
+ mController->mFileDetails->mPlaybackMode == EMPXVideoLiveStreaming ) )
+ {
+ QVERIFY( mController->mControlsConfig->mState == EControlCmdPluginInitialized );
+ }
+ else if ( value == EPbStatePlaying || value == EPbStateInitialising ||
+ value == EPbStateBuffering || value == EPbStatePaused ||
+ value == EPbStateNotInitialised )
+ {
+ for ( int i = 0 ; i < mController->mControls.count() ; i++ )
+ {
+ QVERIFY( mController->mControls[i]->mState == value );
+ QVERIFY( mController->mControls[i]->mVisibilityState == value );
+ }
+ }
+ else
+ {
+ QVERIFY( mController->mState == value );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestControlsController::testHandleEventSetVolume
+// -------------------------------------------------------------------------------------------------
+//
+void TestControlsController::testHandleEventSetVolume()
+{
+ MPX_DEBUG(_L("TestControlsController::testHandleEventSetVolume()"));
+
+ init();
+ int value = 40;
+
+ mController->handleEvent( EControlCmdSetVolume, value );
+ QVERIFY( mController->mVolumeControl->mValue == value );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestControlsController::testHandleEventSetAspectRatio
+// -------------------------------------------------------------------------------------------------
+//
+void TestControlsController::testHandleEventSetAspectRatio()
+{
+ MPX_DEBUG(_L("TestControlsController::testHandleEventSetAspectRatio()"));
+
+ init();
+ int numScalingType = 5;
+
+ for ( int i = 0; i < numScalingType; i++ )
+ {
+ mController->handleEvent( EControlCmdSetAspectRatio, i );
+
+ QVERIFY( mController->mControls[0]->mAspectRatio == i );
+ }
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestControlsController::testHandleEventSetDownloadSize
+// -------------------------------------------------------------------------------------------------
+//
+void TestControlsController::testHandleEventSetDownloadSize()
+{
+ MPX_DEBUG(_L("TestControlsController::testHandleEventSetDownloadSize()") );
+
+ init();
+ int value = 50;
+
+ mController->handleEvent( EControlCmdSetDownloadSize, value );
+
+ QVERIFY( mController->mControls[0]->mDownloadSize == value );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestControlsController::testHandleEventDownloadUpdated
+// -------------------------------------------------------------------------------------------------
+//
+void TestControlsController::testHandleEventDownloadUpdated()
+{
+ MPX_DEBUG(_L("TestControlsController::testHandleEventDownloadUpdated()") );
+
+ init();
+ int value = 55;
+
+ mController->handleEvent( EControlCmdDownloadUpdated, value );
+
+ QVERIFY( mController->mControls[0]->mDownloadPosition == value );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestControlsController::testHandleEventDownloadComplete
+// -------------------------------------------------------------------------------------------------
+//
+void TestControlsController::testHandleEventDownloadComplete()
+{
+ MPX_DEBUG(_L("TestControlsController::testHandleEventDownloadComplete()") );
+
+ init();
+ int value = 60;
+
+ mController->handleEvent( EControlCmdDownloadComplete, value );
+
+ QVERIFY( mController->mControls[0]->mDownloadPosition == value );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestControlsController::testHandleEventSetDownloadPaused
+// -------------------------------------------------------------------------------------------------
+//
+void TestControlsController::testHandleEventSetDownloadPaused()
+{
+ MPX_DEBUG(_L("TestControlsController::testHandleEventSetDownloadPaused()") );
+
+ init();
+ int value = 0;
+
+ mController->handleEvent( EControlCmdSetDownloadPaused, value );
+
+ QVERIFY( mController->mControlsConfig->mState == KControlListsUpdated );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestControlsController::testHandleEventClearDownloadPaused
+// -------------------------------------------------------------------------------------------------
+//
+void TestControlsController::testHandleEventClearDownloadPaused()
+{
+ MPX_DEBUG(_L("TestControlsController::testHandleEventClearDownloadPaused()") );
+
+ init();
+ int value = 0;
+
+ mController->handleEvent( EControlCmdClearDownloadPaused, value );
+
+ QVERIFY( mController->mControlsConfig->mState == KControlListsUpdated );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestControlsController::testHandleEventTvOutConnected
+// -------------------------------------------------------------------------------------------------
+//
+void TestControlsController::testHandleEventTvOutConnected()
+{
+ MPX_DEBUG(_L("TestControlsController::testHandleEventTvOutConnected()") );
+
+ init();
+
+ //
+ // TV-Out Connected, value = true, EMPXVideoLocal
+ //
+ mController->handleEvent( EControlCmdTvOutConnected, true );
+ verifyHandleEventTvOutResult( true, true );
+
+ //
+ // TV-Out Connected, value = false, EMPXVideoLocal
+ //
+ mController->handleEvent( EControlCmdTvOutConnected, false );
+ verifyHandleEventTvOutResult( true, false );
+
+ //
+ // TV-Out Connected, value = false, non-EMPXVideoLocal
+ //
+ mController->mFileDetails->mPlaybackMode = EMPXVideoStreaming;
+ mController->handleEvent( EControlCmdTvOutConnected, false );
+ verifyHandleEventTvOutResult( true, false );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestControlsController::verifyHandleEventTvOutResult
+// -------------------------------------------------------------------------------------------------
+//
+void TestControlsController::verifyHandleEventTvOutResult( bool tvOutConnected,
+ bool value )
+{
+ MPX_DEBUG(_L("TestControlsController::verifyHandleEventTvOutResult(%d,%d)"),
+ tvOutConnected, value );
+
+ QVERIFY( mController->mFileDetails->mTvOutConnected == tvOutConnected );
+
+ //
+ // validate setDefaultBitmap()
+ //
+ for ( int i=0 ; i < mController->mLoader->mWidgets.count() ; i++ )
+ {
+ bool val = mController->mLoader->isVisible(i);
+
+ if( mController->mLoader->mWidgets[i]->objectName() == QString( "tvOutBitmap" ) )
+ {
+ QVERIFY( tvOutConnected? val == true : val == false );
+ }
+ else if( mController->mLoader->mWidgets[i]->objectName() == QString( "realAudioOnlyBitmap" ) )
+ {
+ QVERIFY( mFileDetails->mRNFormat? val == true : val == false );
+ }
+ else if( mController->mLoader->mWidgets[i]->objectName() == QString( "partialAudioOnlyBitmap" ) )
+ {
+ QVERIFY( mFileDetails->mPartialPlayback? val == true : val == false );
+ }
+ else if( mController->mLoader->mWidgets[i]->objectName() == QString( "audioOnlyBitmap" ) )
+ {
+ QVERIFY( tvOutConnected? val == false : val == true );
+ }
+ }
+
+ //
+ // validate generateThumbNail()
+ //
+ if ( tvOutConnected )
+ {
+ QVERIFY( ( mController->mFileDetails->mPlaybackMode == EMPXVideoLocal )?
+ mController->mThumbNailState == EThumbNailRequsted :
+ mController->mThumbNailState == EThumbNailNotAvailable );
+ QVERIFY( mController->mViewMode == EAudioOnlyView );
+ QVERIFY( mController->mControlsConfig->mState == EControlCmdTvOutConnected );
+ QVERIFY( mController->mThumbnailManager->mThumbSize == ThumbnailManager::ThumbnailLarge );
+ QVERIFY( mController->mThumbnailManager->mQuality == ThumbnailManager::OptimizeForPerformance );
+ QVERIFY( mController->mViewTransitionIsGoingOn == false );
+ }
+ else if ( mController->mFileDetails->mVideoEnabled )
+ {
+ QVERIFY( mController->mViewTransitionIsGoingOn == true );
+ QVERIFY( mController->mViewMode == EFullScreenView );
+ }
+ else if ( ! mController->mFileDetails->mVideoEnabled )
+ {
+ QVERIFY( mController->mViewTransitionIsGoingOn == false );
+ QVERIFY( mController->mViewMode == EAudioOnlyView );
+ }
+
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestControlsController::testHandleEventTvOutDisconnected
+// -------------------------------------------------------------------------------------------------
+//
+void TestControlsController::testHandleEventTvOutDisconnected()
+{
+ MPX_DEBUG(_L("TestControlsController::testHandleEventTvOutDisconnected()") );
+
+ init();
+
+ //
+ // TV-Out Disconnected, value = true
+ //
+ mController->handleEvent( EControlCmdTvOutDisconnected, true );
+ verifyHandleEventTvOutResult( false, true );
+
+ //
+ // TV-Out Disconnected, value = false
+ //
+ mController->handleEvent( EControlCmdTvOutDisconnected, false );
+ verifyHandleEventTvOutResult( false, false );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestControlsController::testHandleEventHandleErrors
+// -------------------------------------------------------------------------------------------------
+//
+void TestControlsController::testHandleEventHandleErrors()
+{
+ MPX_DEBUG(_L("TestControlsController::testHandleEventHandleErrors()") );
+
+ init();
+
+ //
+ // handle error
+ //
+ mController->handleEvent( EControlCmdHandleErrors, 0 );
+
+ QVERIFY( mController->mThumbNailState == EThumbNailEmpty );
+ QVERIFY( mController->mState == EPbStateNotInitialised );
+ QVERIFY( mController->mViewMode == EFullScreenView );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestControlsController::testHandleEventShowVolumeControls
+// -------------------------------------------------------------------------------------------------
+//
+void TestControlsController::testHandleEventShowVolumeControls()
+{
+ MPX_DEBUG(_L("TestControlsController::testHandleEventShowVolumeControls()") );
+
+ init();
+
+ mController->handleEvent( EControlCmdShowVolumeControls, 0 );
+
+ QVERIFY( mController->mVolumeControl->mVisible == true );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestControlsController::testHandleCommand
+// -------------------------------------------------------------------------------------------------
+//
+void TestControlsController::testHandleCommand()
+{
+ MPX_DEBUG(_L("TestControlsController::testHandleCommand()") );
+
+ init();
+
+ mController->handleCommand( EMPXPbvCmdSetPosition, 0 );
+ QVERIFY( mViewWrapper->mProperty == EPbPropertyPosition );
+
+ mController->handleCommand( EMPXPbvCmdSetVolume, 0 );
+ QVERIFY( mViewWrapper->mProperty == EPbPropertyVolume );
+
+ mController->handleCommand( EMPXPbvCmdPlay, 0 );
+ QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdPlay );
+
+ mController->handleCommand( EMPXPbvCmdPause, 0 );
+ QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdPause );
+
+ mController->handleCommand( EMPXPbvCmdPlayPause, 0 );
+ QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdPlayPause );
+
+ mController->handleCommand( EMPXPbvCmdStop, 0 );
+ QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdStop );
+
+ mController->handleCommand( EMPXPbvCmdClose, 0 );
+ QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdClose );
+
+ mController->handleCommand( EMPXPbvCmdMute, 0 );
+ QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdMute );
+
+ mController->handleCommand( EMPXPbvCmdUnMute, 0 );
+ QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdUnMute );
+
+ mController->handleCommand( EMPXPbvCmdChangeAspectRatio, 0 );
+ QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdChangeAspectRatio );
+
+ mController->handleCommand( EMPXPbvCmdNaturalAspectRatio, 0 );
+ QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdNaturalAspectRatio );
+
+ mController->handleCommand( EMPXPbvCmdZoomAspectRatio, 0 );
+ QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdZoomAspectRatio );
+
+ mController->handleCommand( EMPXPbvCmdStretchAspectRatio, 0 );
+ QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdStretchAspectRatio );
+
+ mController->handleCommand( EMPXPbvCmdSeekForward, 0 );
+ QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdSeekForward );
+
+ mController->handleCommand( EMPXPbvCmdSeekBackward, 0 );
+ QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdSeekBackward );
+
+ mController->handleCommand( EMPXPbvCmdEndSeek, 0 );
+ QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdEndSeek );
+
+ mController->handleCommand( EMPXPbvCmdNextListItem, 0 );
+ QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdNextListItem );
+
+ mController->handleCommand( EMPXPbvCmdPreviousListItem, 0 );
+ QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdPreviousListItem );
+
+ mController->handleCommand( EMPXPbvCmdDecreaseVolume, 0 );
+ QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdDecreaseVolume );
+
+ mController->handleCommand( EMPXPbvCmdIncreaseVolume, 0 );
+ QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdIncreaseVolume );
+
+ mController->handleCommand( EMPXPbvCmdPosition, 0 );
+ QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdPosition );
+
+ mController->handleCommand( EMPXPbvCmdSave, 0 );
+ QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdSave );
+
+ mController->handleCommand( EMPXPbvCmdResetControls, 0 );
+ QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdResetControls );
+
+ mController->handleCommand( EMPXPbvCmdShortPressForward, 0 );
+ QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdShortPressForward );
+
+ mController->handleCommand( EMPXPbvCmdShortPressBackward, 0 );
+ QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdShortPressBackward );
+
+ mController->handleCommand( EMPXPbvCmdShowFileDetails, 0 );
+ QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdShowFileDetails );
+
+ mController->handleCommand( EMPXPbvCmdEndOfClip, 0 );
+ QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdEndOfClip );
+
+ mController->handleCommand( EMPXPbvCmdCustomPause, 0 );
+ QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdCustomPause );
+
+ mController->handleCommand( EMPXPbvCmdCustomPlay, 0 );
+ QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdCustomPlay );
+
+ mController->handleCommand( EMPXPbvCmdExit, 0 );
+ QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdExit );
+
+ mController->handleCommand( EMPXPbvLaunchDRMDetails, 0 );
+ QVERIFY( mViewWrapper->mCommandId == EMPXPbvLaunchDRMDetails );
+
+ mController->handleCommand( EMPXPbvSurfaceCreated, 0 );
+ QVERIFY( mViewWrapper->mCommandId == EMPXPbvSurfaceCreated );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestControlsController::testHandleTappedOnScreen
+// -------------------------------------------------------------------------------------------------
+//
+void TestControlsController::testHandleTappedOnScreen()
+{
+ MPX_DEBUG(_L("TestControlsController::testHandleTappedOnScreen()") );
+
+ init();
+ mController->mOrientation = Qt::Horizontal;
+ connect( this, SIGNAL( commandSignal() ), mController, SLOT( handleTappedOnScreen() ) );
+
+ //
+ // 1. Test full screen view
+ //
+ mController->mViewMode = EFullScreenView;
+
+ //
+ // (1a) playing state
+ //
+ mController->mState = EPbStatePlaying;
+ emit commandSignal();
+
+ QVERIFY( mController->mControlsTimer->isActive() == true );
+ for ( int i = 0 ; i < mController->mControls.count() ; i++ )
+ {
+ QVERIFY( mController->mControls[i]->mVisibilityState == mController->mState );
+ }
+
+ //
+ // (1b) pause state
+ //
+ mController->mState = EPbStatePaused;
+ emit commandSignal();
+
+ QVERIFY( mController->mControlsTimer->isActive() == false );
+ for ( int i = 0 ; i < mController->mControls.count() ; i++ )
+ {
+ QVERIFY( mController->mControls[i]->mVisibilityState == mController->mState );
+ }
+
+
+ //
+ // 2. Test details screen view
+ //
+ mController->mViewMode = EDetailsView;
+
+ //
+ // (2a) non-pausable stream, currently in 'playing' state
+ //
+ mController->mFileDetails->mPausableStream = false;
+ mController->mViewWrapper->HandleCommandL( EMPXPbvCmdSetVolume ); // set a random cmd
+ mController->mState = EPbStatePlaying;
+
+ emit commandSignal();
+ QVERIFY( mController->mViewWrapper->mCommandId == EMPXPbvCmdSetVolume );
+
+ //
+ // (2b) pausable stream, currently in 'playing' state
+ //
+ mController->mFileDetails->mPausableStream = true;
+ mController->mViewWrapper->HandleCommandL( EMPXPbvCmdChangeAspectRatio ); // set a random cmd
+ mController->mState = EPbStatePlaying;
+
+ emit commandSignal();
+ QVERIFY( mController->mViewWrapper->mCommandId == EMPXPbvCmdPlayPause );
+
+ //
+ // (2c) non-pausable stream, currently in 'paused' state
+ //
+ mController->mFileDetails->mPausableStream = false;
+ mController->mViewWrapper->HandleCommandL( EMPXPbvCmdEndSeek ); // set a random cmd
+ mController->mState = EPbStatePaused;
+
+ emit commandSignal();
+ QVERIFY( mController->mViewWrapper->mCommandId == EMPXPbvCmdPlayPause );
+
+ //
+ // (2d) pausable stream, currently in 'paused' state
+ //
+ mController->mFileDetails->mPausableStream = true;
+ mController->mViewWrapper->HandleCommandL( EMPXPbvCmdSave ); // set a random cmd
+ mController->mState = EPbStatePaused;
+
+ emit commandSignal();
+ QVERIFY( mController->mViewWrapper->mCommandId == EMPXPbvCmdPlayPause );
+
+ //
+ // disconnect signal and clean up
+ //
+ disconnect( this, SIGNAL( commandSignal() ), mController, SLOT( handleTappedOnScreen() ) );
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestControlsController::testUpdateVideoRectDone
+// -------------------------------------------------------------------------------------------------
+//
+void TestControlsController::testUpdateVideoRectDone()
+{
+ MPX_DEBUG(_L("TestControlsController::testUpdateVideoRectDone()") );
+
+ init();
+
+ mController->updateVideoRectDone();
+
+ //
+ // default is full-screen
+ //
+ QVERIFY( mController->mControlsConfig->mState == EControlCmdFullScreenViewOpened );
+
+ //
+ // validate Details view
+ //
+ mController->mViewMode = EDetailsView;
+
+ mController->updateVideoRectDone();
+
+ QVERIFY( mController->mControlsConfig->mState == EControlCmdDetailsViewOpened );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestControlsController::testIsAttachOperation
+// -------------------------------------------------------------------------------------------------
+//
+void TestControlsController::testIsAttachOperation()
+{
+ MPX_DEBUG(_L("TestControlsController::testIsAttachOperation()") );
+
+ //
+ // get access to XQServiceUtilXtra stub
+ //
+ XQServiceUtilXtra* extraUtil = XQServiceUtilXtra::instance();
+
+ //
+ // set service enable
+ //
+ extraUtil->setCurrentService( true );
+
+ //
+ // initialize controlscontroller
+ //
+ init();
+
+ //
+ // verify 'mIsAttachOperation' flag is enabled
+ //
+ QVERIFY( mController->mIsAttachOperation == true );
+
+ //
+ // clean up
+ //
+ cleanup();
+
+ //
+ // set service disable
+ //
+ extraUtil->setCurrentService( false );
+
+ //
+ // initialize controlscontroller
+ //
+ init();
+
+ //
+ // verify 'mIsAttachOperation' flag is disabled
+ //
+ QVERIFY( mController->mIsAttachOperation == false );
+
+ //
+ // clean up
+ //
+ cleanup();
+
+ //
+ // dereference extraUtil count
+ //
+ extraUtil->decreaseReferenceCount();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestControlsController::testslot_skipToNextVideoItem
+// -------------------------------------------------------------------------------------------------
+//
+void TestControlsController::testslot_skipToNextVideoItem()
+{
+ MPX_DEBUG(_L("TestControlsController::testslot_skipToNextVideoItem()") );
+
+ init();
+
+ connect( this, SIGNAL( commandSignal() ), mController, SLOT( skipToNextVideoItem() ) );
+
+ //
+ // If we are not in full screen view, ignore
+ //
+ mViewWrapper->mCommandId = EMPXPbvCmdPosition;
+ mController->mViewMode = EDetailsView;
+
+ emit commandSignal();
+
+ QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdPosition );
+
+ //
+ // If we are in full screen view, issue EMPXPbvCmdNextListItem;
+ //
+ mController->mViewMode = EFullScreenView;
+
+ emit commandSignal();
+
+ QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdNextListItem );
+
+ disconnect( this, SIGNAL( commandSignal() ), mController, SLOT( skipToNextVideoItem() ) );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestControlsController::testslot_skipToPreviousVideoItem
+// -------------------------------------------------------------------------------------------------
+//
+void TestControlsController::testslot_skipToPreviousVideoItem()
+{
+ MPX_DEBUG(_L("TestControlsController::testslot_skipToPreviousVideoItem()") );
+
+ init();
+
+ connect( this, SIGNAL( commandSignal() ), mController, SLOT( skipToPreviousVideoItem() ) );
+
+ //
+ // If we are not in full screen view, ignore
+ //
+ mViewWrapper->mCommandId = EMPXPbvCmdPosition;
+ mController->mViewMode = EDetailsView;
+
+ emit commandSignal();
+
+ QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdPosition );
+
+ //
+ // If we are in full screen view, issue EMPXPbvCmdPreviousListItem
+ //
+ mController->mViewMode = EFullScreenView;
+
+ emit commandSignal();
+
+ QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdPreviousListItem );
+
+ disconnect( this, SIGNAL( commandSignal() ), mController, SLOT( skipToPreviousVideoItem() ) );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestControlsController::testslot_attachVideo
+// -------------------------------------------------------------------------------------------------
+//
+void TestControlsController::testslot_attachVideo()
+{
+ MPX_DEBUG(_L("TestControlsController::testslot_attachVideo()") );
+
+ //
+ // get access to XQServiceUtilXtra stub to enable XQServiceUtil::isService() method
+ //
+ XQServiceUtilXtra* extraUtil = XQServiceUtilXtra::instance();
+
+ //
+ // set service enable
+ //
+ extraUtil->setCurrentService( true );
+
+ //
+ // initialize controlscontroller
+ //
+ init();
+
+ //
+ // verify view closePlaybackView() slot is not yet called
+ //
+ QVERIFY( mController->mView->mViewClosed == false );
+
+ //
+ // connect signal with controller attachVideo() slot
+ //
+ bool res = connect( this, SIGNAL( commandSignal() ), mController, SLOT( attachVideo() ) );
+
+ //
+ // emit signal, this will in turns invoke videoservices itemSelected() slot
+ //
+ emit commandSignal();
+
+ //
+ // verify view closePlaybackView() slot is called
+ //
+ QVERIFY( mController->mView->mViewClosed == true );
+
+ //
+ // verify videoservices itemSelected() slot is called
+ //
+ QVERIFY( mController->mVideoServices->mItemSelected == true );
+
+ //
+ // disconnect signal
+ //
+ disconnect( this, SIGNAL( commandSignal() ), mController, SLOT( attachVideo() ) );
+
+ //
+ // clean up
+ //
+ cleanup();
+
+ //
+ // dereference extraUtil count
+ //
+ extraUtil->decreaseReferenceCount();
+
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestControlsController::testslot_sendVideo
+// -------------------------------------------------------------------------------------------------
+//
+void TestControlsController::testslot_sendVideo()
+{
+ MPX_DEBUG(_L("TestControlsController::testslot_sendVideo()") );
+
+ //
+ // initialize controlscontroller
+ //
+ init();
+
+ //
+ // connect signal with controller sendVideoo() slot
+ //
+ bool res = connect( this, SIGNAL( commandSignal() ), mController, SLOT( sendVideo() ) );
+
+ //
+ // emit signal, this will in turns invoke mController sendVideo() slot
+ //
+ emit commandSignal();
+
+ //
+ // verify command EMPXPbvCmdClose has been issued
+ //
+ QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdPause );
+
+ //
+ // disconnect signal
+ //
+ disconnect( this, SIGNAL( commandSignal() ), mController, SLOT( sendVideo() ) );
+
+ //
+ // clean up
+ //
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestControlsController::testslot_handleOrientationChanged
+// -------------------------------------------------------------------------------------------------
+//
+void TestControlsController::testslot_handleOrientationChanged()
+{
+ MPX_DEBUG(_L("TestControlsController::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();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestControlsController::testslot_handleRNLogoVisibleChanged
+// -------------------------------------------------------------------------------------------------
+//
+void TestControlsController::testslot_handleRNLogoVisibleChanged()
+{
+ MPX_DEBUG(_L("TestControlsController::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() == KRNLogoTimeOut );
+
+ //
+ // disconnect signal
+ //
+ disconnect( this, SIGNAL( commandSignal() ),
+ mController, SLOT( handleRNLogoVisibleChanged() ) );
+
+ //
+ // clean up
+ //
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestControlsController::testslot_handleRNLogoTimeout
+// -------------------------------------------------------------------------------------------------
+//
+void TestControlsController::testslot_handleRNLogoTimeout()
+{
+ MPX_DEBUG(_L("TestControlsController::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();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestControlsController::testIsRNLogoBitmapVisible
+// -------------------------------------------------------------------------------------------------
+//
+void TestControlsController::testIsRNLogoBitmapVisible()
+{
+ MPX_DEBUG(_L("TestControlsController::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 == ERealLogoBitmap )
+ {
+ mController->mControls.removeAt( i );
+ }
+ }
+
+ QVERIFY( ! mController->isRNLogoBitmapInControlList() );
+
+ cleanup();
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/inc/hbvolumesliderpopup.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,57 @@
+/*
+* 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 HbVolumeSliderPopup
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+#ifndef HBVOLUMESLIDERPOPUP_H
+#define HBVOLUMESLIDERPOPUP_H
+
+#include <hbwidget.h>
+
+
+class HbVolumeSliderPopup : public HbWidget
+{
+ Q_OBJECT
+
+ public:
+ HbVolumeSliderPopup();
+ virtual ~HbVolumeSliderPopup();
+
+ public:
+ void setEnabled( bool enabled );
+ void setVisible( bool visible );
+ bool isEnabled();
+ bool isVisible();
+ void setValue( int value );
+ void setTimeout( int timeout );
+ void setTickPosition( Hb::SliderTickPositions position );
+ void setRange( int min, int max );
+
+ public:
+ bool mVisible;
+ bool mEnabled;
+ int mValue;
+ int mTimeOut;
+ int mMin;
+ int mMax;
+ Hb::SliderTickPositions mPosition;
+};
+
+#endif /*HBVOLUMESLIDERPOPUP_H*/
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/inc/mpxvideoplaybackdisplayhandler.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,173 @@
+/*
+* 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 video playback display handler
+*
+*/
+
+// Version : %version: 2 %
+
+
+#ifndef __CMPXVIDEOPLAYBACKDISPLAYHANDLER_H__
+#define __CMPXVIDEOPLAYBACKDISPLAYHANDLER_H__
+
+// INCLUDES
+
+#include <mpxmessage2.h>
+#include <mmfscalingcustomcommandconstants.h>
+#include <mpxvideoplaybackdefs.h>
+#ifdef SYMBIAN_BUILD_GCE
+#include <mediaclientvideodisplay.h>
+#else
+#include <w32std.h>
+#endif
+
+
+//
+// CLASS DECLARATION
+//
+class MMPXPlaybackUtility;
+class CMPXVideoViewWrapper;
+class VideoPlaybackViewFileDetails;
+
+/*
+ * CMPXVideoPlaybackDisplayHandler
+ *
+ */
+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();
+
+ static CMPXVideoPlaybackDisplayHandler* NewL( MMPXPlaybackUtility* aPlayUtil,
+ CMPXVideoViewWrapper* aViewWrapper );
+
+ void CreateDisplayWindowL( RWsSession& aWs,
+ CWsScreenDevice& aScreenDevice,
+ RWindow& aWin,
+ TRect aDisplayRect );
+
+ void RemoveDisplayWindow();
+
+ void HandleVideoDisplayMessageL( CMPXMessage* aMessage );
+
+ TInt SetAspectRatioL( TMPXVideoPlaybackCommand aCmd );
+
+ TInt SetDefaultAspectRatioL( VideoPlaybackViewFileDetails* aFileDetails,
+ TReal aDisplayAspectRatio );
+
+ void UpdateVideoRectL( TRect aRect, TBool transitionEffect );
+
+ private:
+
+ CMPXVideoPlaybackDisplayHandler( MMPXPlaybackUtility* aPlayUtil,
+ 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<TMPXAspectRatio> 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
+
+};
+
+#endif // __CMPXVIDEOPLAYBACKDISPLAYHANDLER_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/inc/mpxvideoviewwrapper.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,76 @@
+/*
+* 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 MPX Video Wrapper
+*
+*/
+
+// Version : %version: 4 %
+
+
+
+// This file defines the API for .dll
+
+#ifndef __MPXVIDEOVIEWWRAPPER_H__
+#define __MPXVIDEOVIEWWRAPPER_H__
+
+// Include Files
+
+#include <e32base.h> // CBase
+#include <e32std.h> // TBuf
+#include <mpxplaybackframeworkdefs.h>
+
+#include "videoplaybackcontrol.hrh"
+
+// Constants
+
+// Forward Declarations
+class VideoBasePlaybackView;
+class VideoPlaybackViewFileDetails;
+
+
+// Class Definitions
+
+class CMPXVideoViewWrapper : public CBase
+{
+ public:
+ static CMPXVideoViewWrapper* NewL( VideoBasePlaybackView* aView );
+ virtual ~CMPXVideoViewWrapper();
+
+ CMPXVideoViewWrapper( VideoBasePlaybackView* aView );
+ void ConstructL();
+
+ public:
+ void HandleCommandL( TInt aCommand );
+
+ void SetPropertyL( TMPXPlaybackProperty aProperty, TInt aValue );
+
+ void UpdateVideoRect( TInt aX, TInt aY, TInt aWidth, TInt aHeight, TBool transitionEffect );
+
+ TBool IsResumingPlaybackAfterTermination();
+
+
+ public: // data
+
+ VideoBasePlaybackView* mView;
+ TBool mMediaRequested;
+ VideoPlaybackViewFileDetails* mFileDetails;
+ TBool mClosePlayerAO;
+ TBool mForeground;
+ int mProperty;
+ int mCommandId;
+};
+
+#endif // __MPXVIDEOVIEWWRAPPER_H__
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/inc/shareui.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,35 @@
+/**
+* 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: ShareUI STUB class definition
+*
+*/
+
+// Version : %version: 1 %
+
+#ifndef SHAREUI_H_
+#define SHAREUI_H_
+
+class ShareUi
+{
+
+ public:
+
+ ShareUi();
+ ~ShareUi();
+
+ bool send( QStringList& fileList, bool embedded );
+
+};
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/inc/thumbnailmanager_qt.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,382 @@
+/*
+* 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 tn manager object
+ *
+*/
+
+// Version : %version: 1 %
+
+
+#ifndef THUMBNAILMANAGER_QT_H
+#define THUMBNAILMANAGER_QT_H
+
+#include <qobject>
+#include <QPixmap.h>
+#include <qmap.h>
+
+class QString;
+class QSize;
+
+class ThumbnailManager : public QObject
+ {
+ Q_OBJECT
+
+public:
+ /** Thumbnail size. */
+ enum ThumbnailSize
+ {
+ /**
+ * Small thumbnail (64x64 ?)
+ */
+ ThumbnailSmall = 0,
+ /**
+ * Medium thumbnail (128x128 ?)
+ */
+ ThumbnailMedium,
+ /**
+ * Large thumbnail (256x256 ?)
+ */
+ ThumbnailLarge
+ };
+
+ /** Mode of thumbnail creation. */
+ enum ThumbnailMode
+ {
+ /**
+ * Default mode. This means that:
+ * - Thumbnail must be as large as requested (unless the actual object is smaller).
+ * - Smaller thumbnails may be up scaled to desired resolution.
+ * - Aspect ratio is maintained and thumbnails are not cropped. The
+ * resulting thumbnail may smaller in either width or height if
+ * the aspect ratio of the object does not match the aspect ratio
+ * of the requested size.
+ */
+ Default = 0,
+
+ /**
+ * Allow thumbnails which are smaller than requested are. Thumbnail
+ * bitmaps are never up scaled if this flag is set.
+ */
+ AllowAnySize = 1,
+
+ /**
+ * New thumbnail images are not created if this flag is set. Only
+ * existing thumbnails may be returned. If a requested thumbnail does
+ * not exist null pixmap will be returned.
+ */
+ DoNotCreate = 2,
+
+ /**
+ * Thumbnail images are cropped to match requested aspect ratio. If
+ * this mode is set, the size of the resulting thumbnail always
+ * matches the requested size.
+ */
+ CropToAspectRatio = 4
+ };
+
+ /** Priority of the request. */
+ enum Priority
+ {
+ PriorityIdle=-100,
+ PriorityLow=-20,
+ PriorityStandard=0,
+ PriorityUserInput=10,
+ PriorityHigh=20,
+ };
+
+ /** Quality versus speed preference setting */
+ enum QualityPreference
+ {
+ /**
+ * Prefer thumbnails in the highest quality possible disregarding
+ * any negative impact on performance.
+ */
+ OptimizeForQuality,
+
+ /**
+ * Get thumbnails as fast as possible, even if
+ * it means lower quality.
+ */
+ OptimizeForPerformance
+ };
+
+ /** Display modes. */
+ enum DisplayMode
+ {
+ /** No display mode */
+ None,
+
+ /** Monochrome display mode (1 bpp) */
+ Gray2,
+
+ /** Four grayscales display mode (2 bpp) */
+ Gray4,
+
+ /** 16 grayscales display mode (4 bpp) */
+ Gray16,
+
+ /** 256 grayscales display mode (8 bpp) */
+ Gray256,
+
+ /** Low colour GA 16 colour display mode (4 bpp) */
+ Color16,
+
+ /** 256 colour display mode (8 bpp) */
+ Color256,
+
+ /** 64,000 colour display mode (16 bpp) */
+ Color64K,
+
+ /** True colour display mode (24 bpp) */
+ Color16M,
+
+ /** (Not an actual display mode used for moving buffers containing bitmaps) */
+ Rgb,
+
+ /** 4096 colour display (12 bpp). */
+ Color4K,
+
+ /** True colour display mode (32 bpp, but top byte is unused and unspecified) */
+ Color16MU,
+
+ /** Display mode with alpha (24bpp colour plus 8bpp alpha) */
+ Color16MA,
+
+ /** Pre-multiplied Alpha display mode
+ * (24bpp color multiplied with the alpha channel value, plus 8bpp alpha) */
+ Color16MAP
+ };
+
+ struct TnRequest {
+ QString name;
+ void *id;
+ int priority;
+ bool cancelled;
+
+ TnRequest(QString name, void *id, int priority, bool cancelled) {
+ this->name = name;
+ this->id = id;
+ this->priority = priority;
+ this->cancelled = cancelled;
+ }
+
+ TnRequest() {
+ name = QString("");
+ id = 0;
+ priority = PriorityIdle;
+ cancelled = false;
+ }
+ };
+
+ /**
+ * Constructor
+ *
+ * @param parentPtr parent
+ */
+ ThumbnailManager( QObject* parentPtr = NULL );
+
+ /**
+ * Destructor
+ */
+ virtual ~ThumbnailManager();
+
+ /**
+ * Get quality versus performance preference.
+ *
+ * @return quality versus performance preference
+ */
+ QualityPreference qualityPreference() const;
+
+ /**
+ * Set quality versus performance preference.
+ *
+ * @param qualityPreference New quality versus performance preference
+ * value.
+ * @return true on success
+ */
+ bool setQualityPreference( QualityPreference qualityPreference );
+
+ /**
+ * Get the current display mode for thumbnail bitmaps.
+ *
+ * @return current display mode for thumbnail bitmaps
+ */
+ DisplayMode displayMode() const;
+
+ /**
+ * Set new display mode for thumbnail bitmaps.
+ *
+ * @param displayMode new display mode for thumbnail bitmaps.
+ * @return true on success
+ */
+ bool setDisplayMode( DisplayMode displayMode );
+
+ /**
+ * Get the current desired size for thumbnail bitmaps.
+ *
+ * @return Current desired size for thumbnail bitmaps (in pixels).
+ */
+ QSize thumbnailSize() const;
+
+ /**
+ * Set desired size for thumbnail bitmaps.
+ *
+ * @param thumbnailSize New desired thumbnail size.
+ * @return true on success
+ */
+ bool setThumbnailSize( const QSize& thumbnailSize );
+
+ /**
+ * Set desired size for thumbnail bitmaps.
+ *
+ * @param thumbnailSize New desired thumbnail size.
+ * @return true on success
+ */
+ bool setThumbnailSize( ThumbnailSize thumbnailSize );
+
+ /**
+ * Get current mode for thumbnail generation.
+ *
+ * @return Current mode.
+ */
+ ThumbnailMode mode() const;
+
+ /**
+ * Set mode for thumbnail generation.
+ *
+ * @param mode New flags.
+ * @return true on success
+ */
+ bool setMode( ThumbnailMode mode );
+
+ /**
+ * Get a thumbnail for an object file. If a thumbnail already exists, it
+ * is loaded and if a thumbnail does not exist, it is created
+ * transparently. If thumbnail loadinf fails thumbnailReady signal is emited
+ * with null pixmap and error code.
+ *
+ * @param fileName Source object or file
+ * @param clientData Pointer to arbitrary client data.
+ * This pointer is not used by the API for
+ * anything other than returning it in the
+ * ThumbnailReady signal.
+ * @param priority Priority for this operation
+ * @return Thumbnail request ID or -1 if request failed. This can be used to
+ * cancel the request or change priority.
+ * The ID is specific to this tnm
+ * instance and may not be shared with other
+ * instances.
+ */
+ int getThumbnail( const QString& fileName, void * clientData = NULL,
+ int priority = PriorityIdle );
+
+ /**
+ * Get a persistent thumbnail for an object file. If a thumbnail already
+ * exists, it is loaded and if a thumbnail does not exist, it is created
+ * transparently. If thumbnail loading fails thumbnailReady signal is emited
+ * with null pixmap and error code.
+ *
+ * @param thumbnailId Thumbnail ID
+ * @param clientData Pointer to arbitrary client data.
+ * This pointer is not used by the API for
+ * anything other than returning it in the
+ * ThumbnailReady signal.
+ * @param priority Priority for this operation
+ * @return Thumbnail request ID or -1 if request failed. This can be used to
+ * cancel the request or change priority.
+ * The ID is specific to this tnm
+ * instance and may not be shared with other
+ * instances.
+ */
+ int getThumbnail( unsigned long int thumbnailId, void * clientData = NULL,
+ int priority = PriorityIdle );
+
+ /**
+ * Set a thumbnail for an object file generated from pixmap delivered.
+ * thumbnailReady() signal will be emited when the operation is complete.
+ *
+ * @param source Pixmap from which the thumbnail will be created
+ * @param fileName file name
+ * @param clientData Pointer to arbitrary client data.
+ * This pointer is not used by the API for
+ * anything other than returning it in the
+ * ThumbnailReady callback.
+ * @param priority Priority for this operation
+ * @return Thumbnail request ID or -1 if request failed. This can be used to
+ * cancel the request or change priority.
+ *
+ */
+ int setThumbnail( const QPixmap& source, const QString& fileName,
+ void * clientData = NULL, Priority priority = PriorityIdle );
+
+ /**
+ * Delete all thumbnails for a given object. This is an asynchronous
+ * operation, which always returns immediately.
+ *
+ * @param fileName Source file
+ */
+ void deleteThumbnails( const QString& fileName );
+
+ /**
+ * Delete all thumbnails for a given object. This is an asynchronous
+ * operation, which always returns immediately.
+ *
+ * @param thumbnailId thumbnail id
+ */
+ void deleteThumbnails( unsigned long int thumbnailId );
+
+ /**
+ * Cancel a thumbnail operation.
+ *
+ * @param id Request ID for the operation to be cancelled.
+ * @return true if cancelling was successful.
+ */
+ bool cancelRequest( int id );
+
+ /**
+ * Change the priority of a queued thumbnail operation.
+ *
+ * @param id Request ID for the request which to assign a new
+ * priority.
+ * @param newPriority New priority value
+ * @return true if change was successful.
+ */
+ bool changePriority( int id, Priority newPriority );
+
+
+ void emitThumbnailReady(int tnId );
+
+signals:
+ /**
+ * Final thumbnail bitmap generation or loading is complete.
+ *
+ * @param pixmap An object representing the resulting thumbnail.
+ * @param clientData Client data
+ * @param id Request ID for the operation
+ * @param errorCode error code
+ */
+ void thumbnailReady( QPixmap , void * , int , int );
+
+public:
+
+ static QMap<int, TnRequest> mRequests;
+
+ ThumbnailSize mThumbSize;
+ QualityPreference mQuality;
+ bool mGetThumbFails;
+ int mThumbnailReadyError;
+
+};
+
+#endif // QTNMWRAPPER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/inc/videobaseplaybackview.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,62 @@
+/*
+* 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: Video playback view
+*
+*/
+
+// Version : %version: 5 %
+
+
+
+// This file defines the API for .dll
+
+#ifndef __VIDEOBASEPLAYBACKVIEW_H__
+#define __VIDEOBASEPLAYBACKVIEW_H__
+
+// Include Files
+#include <hbview.h>
+
+class CMPXVideoViewWrapper;
+class RWindow;
+
+// Constants
+
+// Forward Declarations
+
+// Class Definitions
+
+class VideoBasePlaybackView : public HbView
+{
+ Q_OBJECT
+
+ public:
+ VideoBasePlaybackView();
+ virtual ~VideoBasePlaybackView();
+
+ signals:
+ void tappedOnScreen();
+ void pannedToRight();
+ void pannedToLeft();
+
+ public slots:
+ void closePlaybackView();
+
+ public:
+ bool mViewClosed;
+
+};
+
+#endif // __VIDEOBASEPLAYBACKVIEW_H__
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/inc/videoplaybackcontrol.hrh Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,101 @@
+/*
+* 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: header file of VideoPlaybackControl
+*
+*/
+
+// Version : %version: 3 %
+
+
+#ifndef VIDEOPLAYBACKCONTROL_HRH_
+#define VIDEOPLAYBACKCONTROL_HRH_
+
+// DATA TYPES
+
+enum TVideoPlaybackControlProperties
+{
+ EShownWhenInitializing = 0x1,
+ EShownWhenBuffering = 0x2,
+ EShownWhenPlaying = 0x4,
+ EShownWhenPaused = 0x8,
+ EShownWhenSeeking = 0x10,
+ EAllProperties = 0xffffffff
+};
+
+enum TVideoPlaybackControls
+{
+ EStatusPane,
+ EControlBar,
+
+ // Only for streaming case
+ // Can handle from NotInitilized state
+ //
+ EBufferingAnimation,
+
+ //
+ // For details view and audio only view
+ //
+ EFileDetailsWidget,
+
+ //
+ // For details view
+ //
+ EDetailsViewPlaybackWindow,
+
+ //
+ // Bitmaps
+ //
+ EIndicatorBitmap,
+ ERealLogoBitmap,
+
+ EDownloadPausedIcon,
+
+ EControlsCount // has to be last
+};
+
+/** Command ID's. */
+enum TVideoPlaybackControlCommandIds
+{
+ EControlCmdPluginInitialized,
+ EControlCmdTvOutConnected,
+ EControlCmdTvOutDisconnected,
+ EControlCmdSetAspectRatio,
+ EControlCmdSetVolume,
+ EControlCmdSetDuration,
+ EControlCmdSetPosition,
+ EControlCmdStateChanged,
+ EControlCmdDownloadUpdated,
+ EControlCmdSetDownloadSize,
+ EControlCmdDownloadComplete,
+ EControlCmdSetDownloadPaused,
+ EControlCmdClearDownloadPaused,
+ EControlCmdHandleBackgroundEvent,
+ EControlCmdHandleForegroundEvent,
+ EControlCmdHandleErrors,
+ EControlCmdShowVolumeControls,
+ EControlCmdSoftKeyPressed,
+ EControlCmdFullScreenViewOpened,
+ EControlCmdDetailsViewOpened,
+ EControlCmdAudionOnlyViewOpened,
+ EControlCmdRemoveRNLogo
+};
+
+enum TVideoSeekingType
+{
+ EVideoSeekingForward,
+ EVideoSeekingBackward,
+ EVideoSeekingStop
+};
+
+#endif /*VIDEOPLAYBACKCONTROL_HRH_*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/inc/videoplaybackcontrolbar.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,46 @@
+/*
+* 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 VideoPlaybackControlBar
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+#ifndef VIDEOPLAYBACKCONTROLBAR_H_
+#define VIDEOPLAYBACKCONTROLBAR_H_
+
+
+
+#include <hbwidget.h>
+#include <mpxplaybackframeworkdefs.h>
+
+class VideoPlaybackViewFileDetails;
+class VideoPlaybackControlsController;
+
+class VideoPlaybackControlBar : public HbWidget
+{
+ Q_OBJECT
+
+ public:
+ VideoPlaybackControlBar( VideoPlaybackControlsController* controller );
+ virtual ~VideoPlaybackControlBar();
+ void initialize();
+
+ public:
+ VideoPlaybackControlsController *mController;
+};
+
+#endif /*VIDEOPLAYBACKCONTROLBAR_H_*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/inc/videoplaybackcontrolconfiguration.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,99 @@
+/*
+* Copyright (c) 20101 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 VideoPlaybackControlConfiguration
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+#ifndef VIDEOPLAYBACKCONTROLCONFIGURATION_H_
+#define VIDEOPLAYBACKCONTROLCONFIGURATION_H_
+
+// INCLUDES
+#include <qobject>
+
+#include <mpxplaybackframeworkdefs.h>
+#include "videoplaybackcontrol.hrh"
+#include "mpxhelixplaybackplugindefs.h"
+
+// FORWARD DECLARATIONS
+class VideoPlaybackControlsController;
+
+// DATA TYPES
+
+// CLASS DECLARATION
+class VideoPlaybackControlConfiguration : public QObject
+{
+ Q_OBJECT
+
+ public:
+
+ /**
+ * constructor.
+ */
+ VideoPlaybackControlConfiguration( VideoPlaybackControlsController* controller );
+
+ /**
+ * Destructor.
+ */
+ virtual ~VideoPlaybackControlConfiguration();
+
+ public:
+ /**
+ * Update control list
+ */
+ void updateControlList( TVideoPlaybackControlCommandIds event );
+
+ /**
+ * Return control list
+ */
+ QList<TVideoPlaybackControls>& controlList();
+
+ void updateControlsWithFileDetails();
+
+ /**
+ * Create control list
+ */
+ void createControlList();
+
+ private:
+
+ /**
+ * Delete controls from list
+ */
+ void deleteControlFromList( TVideoPlaybackControls control );
+
+ /**
+ * Add controls to list
+ */
+ void addControlToList( TVideoPlaybackControls control );
+
+ signals:
+ void controlListUpdated();
+
+ public:
+
+ TInt mState;
+ bool mUpdateControlsWithFileDetails;
+
+ private:
+ VideoPlaybackControlsController *mControlsController;
+ QList<TVideoPlaybackControls> mControlsList;
+};
+
+#endif /*VIDEOPLAYBACKCONTROLCONFIGURATION_H_*/
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/inc/videoplaybackcontrolpolicy.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,65 @@
+/*
+* 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 VideoPlaybackControlPolicy
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+#ifndef VIDEOPLAYBACKCONTROLPOLICY_H_
+#define VIDEOPLAYBACKCONTROLPOLICY_H_
+
+// INCLUDES
+#include <qobject>
+
+#include "videoplaybackcontrol.hrh"
+#include "videoplaybackcontrolscontroller.h"
+
+// FORWARD DECLARATIONS
+class VideoPlaybackViewFileDetails;
+
+// DATA TYPES
+
+// CLASS DECLARATION
+class VideoPlaybackControlPolicy : public QObject
+{
+ Q_OBJECT
+
+ public:
+
+ /**
+ * Two-phased constructor.
+ */
+ VideoPlaybackControlPolicy();
+
+ /**
+ * Destructor.
+ */
+ virtual ~VideoPlaybackControlPolicy();
+
+ public:
+ /**
+ * Sets the control properties per policy
+ */
+ void setControlProperties( TVideoPlaybackControls controlIndex,
+ TUint& properties,
+ VideoPlaybackViewFileDetails *details,
+ TPlaybackViewMode viewMode );
+};
+
+#endif /*MPXVIDEOPLAYBACKCONTROLPOLICY_H_*/
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/inc/videoplaybackdetailsplaybackwindow.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,45 @@
+/*
+* 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 VideoPlaybackDetailsPlaybackWindow
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+#ifndef VIDEOPLAYBACKDETAILSPLAYBACKWINDOW_H_
+#define VIDEOPLAYBACKDETAILSPLAYBACKWINDOW_H_
+
+#include <hbwidget.h>
+
+
+class VideoPlaybackControlsController;
+
+class VideoPlaybackDetailsPlaybackWindow : public HbWidget
+{
+ Q_OBJECT
+
+ public:
+ VideoPlaybackDetailsPlaybackWindow( VideoPlaybackControlsController* controller );
+ virtual ~VideoPlaybackDetailsPlaybackWindow();
+ void initialize();
+
+ private:
+ VideoPlaybackControlsController *mController;
+
+ bool mInitialized;
+};
+
+#endif /*VIDEOPLAYBACKDETAILSPLAYBACKWINDOW_H_*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/inc/videoplaybackdocumentloader.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,61 @@
+/*
+* 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 VideoPlaybackDocumentLoader
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+#ifndef VIDEOPLAYBACKDOCUMENTHANDLER_H_
+#define VIDEOPLAYBACKDOCUMENTHANDLER_H_
+
+
+#include <qobject>
+#include <hbdocumentloader.h>
+
+class QList;
+class QGraphicsWidget;
+class VideoPlaybackControlsController;
+
+class VideoPlaybackDocumentLoader : public QObject
+{
+ public:
+ VideoPlaybackDocumentLoader( VideoPlaybackControlsController *controller );
+
+ virtual ~VideoPlaybackDocumentLoader();
+
+ public:
+
+ QGraphicsWidget* findWidget( const QString &name );
+ void load( const QString &fileName, const QString §ion , bool *ok );
+ void load( const QString &fileName, bool *ok );
+ bool isVisible( int index );
+
+ private:
+ QGraphicsWidget* createWidget( const QString &name );
+ int exist( const QString &name );
+
+ public:
+ QList<QGraphicsWidget*> mWidgets;
+
+ private:
+
+ VideoPlaybackControlsController* mController;
+ int mIndex;
+};
+
+#endif /*VIDEOPLAYBACKDOCUMENTHANDLER_H_*/
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/inc/videoplaybackfiledetailswidget.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,44 @@
+/*
+* 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 VideoPlaybackFileDetailsWidget
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+#ifndef VIDEOPLAYBACKFILEDETAILSWIDGET_H_
+#define VIDEOPLAYBACKFILEDETAILSWIDGET_H_
+
+#include <hbwidget.h>
+
+class VideoPlaybackControlsController;
+
+
+class VideoPlaybackFileDetailsWidget : public HbWidget
+{
+ Q_OBJECT
+
+ public:
+ VideoPlaybackFileDetailsWidget( VideoPlaybackControlsController* controller );
+ virtual ~VideoPlaybackFileDetailsWidget();
+ void initialize();
+
+ private:
+ VideoPlaybackControlsController *mController;
+};
+
+#endif /*VIDEOPLAYBACKFILEDETAILSWIDGET_H_*/
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/inc/videoplaybackfullscreencontrol.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,124 @@
+/*
+* 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 VideoPlaybackFullScreenControl
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+#ifndef VIDEOPLAYBACKFULLSCREENCONTROL_H_
+#define VIDEOPLAYBACKFULLSCREENCONTROL_H_
+
+#include <qobject>
+
+#include <videoplaybackcontrol.hrh>
+#include <mpxplaybackframeworkdefs.h>
+
+class HbWidget;
+class VideoPlaybackViewFileDetails;
+class VideoPlaybackControlsController;
+
+class VideoPlaybackFullScreenControl : public QObject
+{
+ Q_OBJECT
+
+ public:
+ VideoPlaybackFullScreenControl( VideoPlaybackControlsController* controller,
+ TVideoPlaybackControls index,
+ HbWidget* widget,
+ TUint controlproperties );
+
+ virtual ~VideoPlaybackFullScreenControl();
+
+ public:
+
+ /**
+ * Set visibility of each control
+ */
+ virtual void setVisibility( TMPXPlaybackState aState );
+
+ /**
+ * return control index
+ */
+ TVideoPlaybackControls controlIndex();
+
+ /**
+ * set changed volume
+ */
+ bool volumeChanged( int aVolume );
+
+ /**
+ * set changed duration
+ */
+ bool durationChanged( int duration );
+
+ /**
+ * set changed volume
+ */
+ bool positionChanged( int position );
+
+ /**
+ * Set changed position
+ */
+ bool aspectRatioChanged( int aspectRatio );
+
+ /**
+ * set changed volume
+ */
+ bool setDownloadSize( int size );
+
+ /**
+ * set changed state
+ */
+ void updateState( TMPXPlaybackState state );
+
+ /*
+ * UpdateDownloadPosition
+ * updates the download ratio on the progress bar
+ */
+ bool updateDownloadPosition( int size );
+
+ /*
+ * Update the controls with the file details
+ */
+ virtual void updateControlsWithFileDetails( VideoPlaybackViewFileDetails *details );
+
+ virtual void setVisible( bool visible );
+
+ virtual bool isVisible();
+
+ virtual void updateControlProperties( TUint properties );
+
+ public:
+ int mPosition;
+ int mDuration;
+ int mAspectRatio;
+ int mDownloadSize;
+ int mDownloadPosition;
+ int mVolume;
+
+ bool mVisible;
+ TMPXPlaybackState mState;
+ TMPXPlaybackState mVisibilityState;
+
+ VideoPlaybackControlsController* mController;
+ HbWidget *mControl;
+ TVideoPlaybackControls mControlIndex;
+ TUint mProperties;
+};
+
+#endif /*VIDEOPLAYBACKFULLSCREENCONTROL_H_*/
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/inc/videoplaybackstatuspanecontrol.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,46 @@
+/*
+* 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 VideoPlaybackStatusPaneControl
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+#ifndef VIDEOPLAYBACKSTATUSPANECONTROL_H_
+#define VIDEOPLAYBACKSTATUSPANECONTROL_H_
+
+
+#include "videoplaybackfullscreencontrol.h"
+
+
+class VideoPlaybackControlsController;
+
+class VideoPlaybackStatusPaneControl : public VideoPlaybackFullScreenControl
+{
+ Q_OBJECT
+
+ public:
+ VideoPlaybackStatusPaneControl( VideoPlaybackControlsController* controller,
+ TVideoPlaybackControls index,
+ HbWidget* widget,
+ TUint controlproperties );
+
+ virtual ~VideoPlaybackStatusPaneControl();
+
+};
+
+#endif /*VIDEOPLAYBACKSTATUSPANECONTROL_H_*/
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/inc/videoplaybackviewfiledetails.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,84 @@
+/*
+* 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: Video File Details (QT)
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+
+#ifndef __VIDEOPLAYBACKVIEWFILEDETAILS__
+#define __VIDEOPLAYBACKVIEWFILEDETAILS__
+
+#include <qobject.h>
+#include "mpxhelixplaybackplugindefs.h"
+
+
+//
+// CLASS DECLARATION
+//
+class VideoPlaybackViewFileDetails : public QObject
+{
+ public:
+ //
+ // Constructor
+ //
+ VideoPlaybackViewFileDetails();
+
+ //
+ // Destructor.
+ //
+ virtual ~VideoPlaybackViewFileDetails();
+
+ //
+ // Clear all file details
+ //
+ void clearFileDetails();
+
+ public:
+ //
+ // Data
+ //
+ QString mClipName;
+ QString mTitle;
+ QString mArtist;
+ QString mMimeType;
+ QString mDescription;
+ QString mLocation;
+ QString mCopyright;
+ QString mLanguage;
+ QString mKeywords;
+
+ TMPXVideoMode mPlaybackMode;
+ bool mSeekable;
+ bool mPausableStream;
+ bool mAudioEnabled;
+ bool mVideoEnabled;
+ bool mPartialPlayback;
+ bool mRNFormat;
+ bool mTvOutConnected;
+ bool mDrmProtected;
+ bool mMultiItemPlaylist;
+
+ int mVideoHeight;
+ int mVideoWidth;
+ int mBitRate;
+ int mDuration;
+};
+
+#endif // __VIDEOPLAYBACKVIEWFILEDETAILS__
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/inc/videoservices.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,77 @@
+/*
+* 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: VideoServices STUB class definition
+*
+*/
+
+// Version : %version: 1 %
+
+#ifndef __VIDEOSERVICES_H__
+#define __VIDEOSERVICES_H__
+
+#include <QStringList>
+
+#include "videoserviceurifetch.h"
+
+class VideoServiceUriFetch;
+
+class VideoServices : public QObject
+{
+ Q_OBJECT
+
+ public:
+
+ enum TVideoService
+ {
+ ENoService,
+ EUriFetcher,
+ EPlayback,
+ EView
+ };
+
+ static VideoServices *instance();
+ void decreaseReferenceCount();
+ QString contextTitle() { return QString(""); }
+ VideoServices::TVideoService currentService();
+
+ public slots:
+
+ void itemSelected( const QString& item );
+
+ private:
+
+ VideoServices();
+ virtual ~VideoServices();
+ void setCurrentService( VideoServices::TVideoService service );
+
+ Q_DISABLE_COPY( VideoServices )
+
+ private:
+
+ static VideoServices* mInstance;
+ VideoServiceUriFetch* mServiceUriFetch;
+ VideoServices::TVideoService mCurrentService;
+
+ private:
+
+ friend class VideoServiceUriFetch;
+
+ public:
+
+ static int mReferenceCount;
+ bool mItemSelected;
+
+};
+
+#endif //__VIDEOSERVICES_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/inc/videoserviceurifetch.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,38 @@
+/*
+* 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: VideoServiceUriFetch STUB class definition
+*
+*/
+
+// Version : %version: 1 %
+
+#ifndef __VIDEOSERVICESURIFETCH_H__
+#define __VIDEOSERVICESURIFETCH_H__
+
+#include <qobject>
+
+class VideoServices;
+
+class VideoServiceUriFetch : public QObject
+{
+ Q_OBJECT
+
+ public:
+
+ VideoServiceUriFetch( VideoServices *parent = 0 );
+ ~VideoServiceUriFetch();
+
+};
+
+#endif //__VIDEOSERVICESURIFETCH_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/inc/xqserviceutil.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,33 @@
+/**
+* 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: XQServiceUtil STUB class definition
+*
+*/
+
+// Version : %version: 1 %
+
+#ifndef XQSERVICEUTIL_H
+#define XQSERVICEUTIL_H
+
+#include <QObject>
+
+namespace XQServiceUtil
+{
+ static void toBackground( bool value );
+ static bool isEmbedded();
+ static bool isService();
+}
+
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/inc/xqserviceutilxtra.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,50 @@
+/**
+* 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: XQServiceUtilXtra STUB class definition
+*
+*/
+
+// Version : %version: 1 %
+
+#ifndef XQSERVICEUTILXTRA_H_
+#define XQSERVICEUTILXTRA_H_
+
+#include <QObject>
+
+class XQServiceUtilXtra : public QObject
+{
+ Q_OBJECT
+
+ public:
+
+ static XQServiceUtilXtra *instance();
+ void decreaseReferenceCount();
+ bool currentService();
+ void setCurrentService( bool service );
+
+ private:
+
+ XQServiceUtilXtra();
+ static XQServiceUtilXtra* mInstance;
+ virtual ~XQServiceUtilXtra();
+
+ Q_DISABLE_COPY( XQServiceUtilXtra )
+
+ public:
+
+ static int mReferenceCount;
+ static bool service;
+
+};
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/src/hbvolumesliderpopup.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,132 @@
+/*
+* 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 HbVolumeSliderPopup
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+#include "mpxvideo_debug.h"
+#include "hbvolumesliderpopup.h"
+
+// -------------------------------------------------------------------------------------------------
+// HbVolumeSliderPopup::HbVolumeSliderPopup
+// -------------------------------------------------------------------------------------------------
+//
+HbVolumeSliderPopup::HbVolumeSliderPopup()
+{
+ MPX_ENTER_EXIT(_L("HbVolumeSliderPopup::HbVolumeSliderPopup()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbVolumeSliderPopup::~HbVolumeSliderPopup
+// -------------------------------------------------------------------------------------------------
+//
+HbVolumeSliderPopup::~HbVolumeSliderPopup()
+{
+ MPX_DEBUG(_L("HbVolumeSliderPopup::HbVolumeSliderPopup") );
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbVolumeSliderPopup::setEnabled
+// -------------------------------------------------------------------------------------------------
+//
+void HbVolumeSliderPopup::setEnabled( bool enabled )
+{
+ MPX_DEBUG(_L("HbVolumeSliderPopup::setEnabled %d"), enabled );
+
+ mEnabled = enabled;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbVolumeSliderPopup::isEnabled
+// -------------------------------------------------------------------------------------------------
+//
+bool HbVolumeSliderPopup::isEnabled()
+{
+ MPX_DEBUG(_L("HbVolumeSliderPopup::isEnabled %d"), mEnabled );
+
+ return mEnabled;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbVolumeSliderPopup::setVisible
+// -------------------------------------------------------------------------------------------------
+//
+void HbVolumeSliderPopup::setVisible( bool visible )
+{
+ MPX_DEBUG(_L("HbVolumeSliderPopup::setVisible %d"), visible );
+
+ mVisible = visible;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbVolumeSliderPopup::isVisible
+// -------------------------------------------------------------------------------------------------
+//
+bool HbVolumeSliderPopup::isVisible()
+{
+ MPX_DEBUG(_L("HbVolumeSliderPopup::isVisible %d"), mVisible );
+
+ return mVisible;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbVolumeSliderPopup::setValue
+// -------------------------------------------------------------------------------------------------
+//
+void HbVolumeSliderPopup::setValue( int value )
+{
+ MPX_DEBUG(_L("HbVolumeSliderPopup::setValue %d"), value );
+
+ mValue = value;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbVolumeSliderPopup::setTimeout
+// -------------------------------------------------------------------------------------------------
+//
+void HbVolumeSliderPopup::setTimeout( int timeout )
+{
+ MPX_DEBUG(_L("HbVolumeSliderPopup::setTimeout %d"), timeout );
+
+ mTimeOut = timeout;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbVolumeSliderPopup::setTickPosition
+// -------------------------------------------------------------------------------------------------
+//
+void HbVolumeSliderPopup::setTickPosition( Hb::SliderTickPositions position )
+{
+ MPX_DEBUG(_L("HbVolumeSliderPopup::setTickPosition"));
+
+ mPosition = position;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbVolumeSliderPopup::setRange
+// -------------------------------------------------------------------------------------------------
+//
+void HbVolumeSliderPopup::setRange( int min, int max )
+{
+ MPX_DEBUG(_L("HbVolumeSliderPopup::setRange"));
+
+ mMin = min;
+ mMax = max;
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/src/mpxvideoviewwrapper.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -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: Implementation of Video wrapper
+*
+*/
+
+// Version : %version: 4 %
+
+
+
+// Include Files
+
+#include "mpxvideo_debug.h"
+#include "mpxvideoviewwrapper.h"
+#include "videobaseplaybackview.h"
+#include "videoplaybackviewfiledetails.h"
+#include "mpxcommonvideoplaybackview.hrh"
+
+// Member Functions
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::CMPXVideoViewWrapper()
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoViewWrapper::CMPXVideoViewWrapper( VideoBasePlaybackView* aView )
+ : mView( aView )
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::NewL()
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoViewWrapper* CMPXVideoViewWrapper::NewL( VideoBasePlaybackView* aView )
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::CMPXVideoViewWrapper()"));
+ CMPXVideoViewWrapper* self = new (ELeave) CMPXVideoViewWrapper( aView );
+
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ CleanupStack::Pop();
+
+ return self;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::ConstructL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::ConstructL()
+{
+ mMediaRequested = EFalse;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::~CMPXVideoViewWrapper()
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoViewWrapper::~CMPXVideoViewWrapper()
+{
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::~CMPXVideoViewWrapper"));
+}
+
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::HandleCommandL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::HandleCommandL( TInt aCommand )
+{
+ mCommandId = aCommand;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::SetPropertyL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::SetPropertyL( TMPXPlaybackProperty aProperty, TInt aValue )
+{
+ mProperty = aProperty;
+ Q_UNUSED( aValue );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::UpdateVideoRect()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::UpdateVideoRect(
+ TInt aX, TInt aY, TInt aWidth, TInt aHeight, TBool transitionEffect )
+{
+ Q_UNUSED( aX );
+ Q_UNUSED( aY );
+ Q_UNUSED( aWidth );
+ Q_UNUSED( aHeight );
+ Q_UNUSED( transitionEffect );
+}
+
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::IsResumingPlaybackAfterTermination()
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoViewWrapper::IsResumingPlaybackAfterTermination()
+{
+ return false;
+}
+
+
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/src/shareui.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,56 @@
+/*
+* 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 ShareUI STUB
+*
+*/
+
+// Version : %version: %
+
+#include <qobject>
+
+#include "shareui.h"
+#include "mpxvideo_debug.h"
+
+
+// ----------------------------------------------------------------------------
+// ShareUi()
+// ----------------------------------------------------------------------------
+//
+ShareUi::ShareUi()
+{
+ MPX_DEBUG(_L("ShareUi::ShareUi()"));
+}
+
+// ----------------------------------------------------------------------------
+// ~ShareUi()
+// ----------------------------------------------------------------------------
+//
+ShareUi::~ShareUi()
+{
+ MPX_DEBUG(_L("ShareUi::~ShareUi()"));
+}
+
+// ----------------------------------------------------------------------------
+// send()
+// ----------------------------------------------------------------------------
+//
+bool ShareUi::send( QStringList& fileList, bool embedded )
+{
+ MPX_DEBUG(_L("ShareUi::send()"));
+
+ Q_UNUSED( fileList );
+ Q_UNUSED( embedded );
+
+ return true;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/src/thumbnailmanager_qt.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,154 @@
+/*
+* 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 tn manager
+ *
+*/
+
+// Version : %version: 1 %
+
+#include <qsize.h>
+#include "thumbnailmanager_qt.h"
+
+QMap<int, ThumbnailManager::TnRequest> ThumbnailManager::mRequests = QMap<int, ThumbnailManager::TnRequest>();
+
+ThumbnailManager::ThumbnailManager( QObject* parentPtr ) :
+QObject( parentPtr ),
+mGetThumbFails(false),
+mThumbnailReadyError(0)
+{
+}
+
+ThumbnailManager::~ThumbnailManager()
+{
+}
+
+ThumbnailManager::QualityPreference ThumbnailManager::qualityPreference() const
+{
+ return mQuality;
+}
+
+bool ThumbnailManager::setQualityPreference( QualityPreference
+ qualityPreference )
+{
+ mQuality = qualityPreference;
+ return true;
+}
+
+ThumbnailManager::DisplayMode ThumbnailManager::displayMode() const
+{
+ return Color16MAP;
+}
+
+bool ThumbnailManager::setDisplayMode( ThumbnailManager::DisplayMode displayMode )
+{
+ Q_UNUSED(displayMode);
+ return true;
+}
+
+QSize ThumbnailManager::thumbnailSize() const
+{
+ return QSize(128, 128); // ThumbnailMedium?
+}
+
+bool ThumbnailManager::setThumbnailSize( const QSize& thumbnailSize )
+{
+ Q_UNUSED(thumbnailSize);
+ return true;
+}
+
+bool ThumbnailManager::setThumbnailSize( ThumbnailSize thumbnailSize )
+{
+ mThumbSize = thumbnailSize;
+ return true;
+}
+
+ThumbnailManager::ThumbnailMode ThumbnailManager::mode() const
+{
+ return Default;
+}
+
+bool ThumbnailManager::setMode( ThumbnailMode mode )
+{
+ Q_UNUSED(mode);
+ return true;
+}
+
+int ThumbnailManager::getThumbnail( const QString& fileName, void * clientData,
+ int priority )
+{
+ Q_UNUSED(fileName);
+ Q_UNUSED(clientData);
+ Q_UNUSED(priority);
+ return 0;
+}
+
+int ThumbnailManager::getThumbnail( unsigned long int thumbnailId, void * clientData,
+ int priority )
+{
+ Q_UNUSED(thumbnailId);
+ Q_UNUSED(clientData);
+ Q_UNUSED(priority);
+ return 0;
+}
+
+int ThumbnailManager::setThumbnail( const QPixmap& source, const QString& filename,
+ void * clientData , Priority priority )
+{
+ Q_UNUSED(source);
+ Q_UNUSED(filename);
+ Q_UNUSED(clientData);
+ Q_UNUSED(priority);
+ return 0;
+}
+
+void ThumbnailManager::deleteThumbnails( const QString& fileName )
+{
+ Q_UNUSED(fileName);
+}
+
+void ThumbnailManager::deleteThumbnails( unsigned long int thumbnailId )
+{
+ Q_UNUSED(thumbnailId);
+}
+
+bool ThumbnailManager::cancelRequest( int id )
+{
+ if(mRequests.contains(id)) {
+ mRequests[id].cancelled = true;
+ }
+ return true;
+}
+
+bool ThumbnailManager::changePriority( int id, Priority newPriority )
+{
+ if(mRequests.contains(id)) {
+ mRequests[id].priority = newPriority;
+ }
+ return true;
+}
+
+void ThumbnailManager::emitThumbnailReady(int tnId )
+{
+ QPixmap pixmap(100,100);
+ pixmap.fill(Qt::white);
+ void* internal = 0;
+
+ if(mRequests.contains(tnId)) {
+ internal = mRequests[tnId].id;
+ mRequests.remove(tnId);
+ }
+
+ emit thumbnailReady(pixmap, internal, tnId, mThumbnailReadyError);
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/src/videobaseplaybackview.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,63 @@
+/*
+* 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 Video playback view
+*
+*/
+
+// Version : %version: 4 %
+
+
+
+// Include Files
+#include <aknappui.h>
+#include <qgraphicssceneevent>
+#include <hbinstance.h>
+#include <mmf/common/mmferrors.h>
+
+#include "../inc/videobaseplaybackview.h"
+#include "mpxvideo_debug.h"
+
+
+// Member Functions
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::VideoBasePlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+VideoBasePlaybackView::VideoBasePlaybackView()
+ : mViewClosed( false )
+{
+ MPX_DEBUG(_L("VideoBasePlaybackView::VideoBasePlaybackView()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::~VideoBasePlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+VideoBasePlaybackView::~VideoBasePlaybackView()
+{
+ MPX_DEBUG(_L("VideoBasePlaybackView::~VideoBasePlaybackView()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::closePlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::closePlaybackView()
+{
+ MPX_DEBUG(_L("VideoBasePlaybackView::closePlaybackView()"));
+ mViewClosed = true;
+}
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/src/videoplaybackcontrolbar.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,59 @@
+/*
+* 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 VideoPlaybackControlBar
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+#include <hbframeitem.h>
+#include <hbframedrawer.h>
+
+#include "mpxvideo_debug.h"
+#include "videoplaybackcontrolbar.h"
+#include "mpxcommonvideoplaybackview.hrh"
+#include "videoplaybackcontrolscontroller.h"
+
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlBar::VideoPlaybackControlBar()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackControlBar::VideoPlaybackControlBar(
+ VideoPlaybackControlsController* controller )
+ : mController( controller )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackControlBar::VideoPlaybackControlBar"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlBar::~VideoPlaybackControlBar()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackControlBar::~VideoPlaybackControlBar()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlBar::~VideoPlaybackControlBar()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlBar::initialize()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlBar::initialize()
+{
+}
+
+//End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/src/videoplaybackcontrolconfiguration.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,150 @@
+/*
+* 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 VideoPlaybackControlConfiguration
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+// INCLUDE FILES
+
+#include <qgraphicswidget>
+
+#include "mpxvideo_debug.h"
+#include "videoplaybackdocumentloader.h"
+#include "videoplaybackviewfiledetails.h"
+#include "videoplaybackcontrolconfiguration.h"
+#include "videoplaybackcontrolscontroller.h"
+
+const TInt KControlListUpdated = 12; // additional extension of TMPXPlaybackState
+
+// ================= MEMBER FUNCTIONS ==============================================================
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackControlConfiguration::CMPXVideoPlaybackControlConfiguration()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackControlConfiguration::VideoPlaybackControlConfiguration(
+ VideoPlaybackControlsController* controller)
+ : mControlsController( controller )
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlConfiguration::~VideoPlaybackControlConfiguration()
+// Destructor.
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackControlConfiguration::~VideoPlaybackControlConfiguration()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlConfiguration::~VideoPlaybackControlConfiguration"));
+
+ mControlsList.clear();
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlConfiguration::createControlList()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlConfiguration::createControlList()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlConfiguration::createControlList()"));
+
+ addControlToList( EBufferingAnimation );
+ addControlToList( EStatusPane );
+ addControlToList( ERealLogoBitmap );
+
+ emit controlListUpdated();
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlConfiguration::controlList
+// -------------------------------------------------------------------------------------------------
+//
+QList<TVideoPlaybackControls>& VideoPlaybackControlConfiguration::controlList()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlConfiguration::controlList()"));
+
+ return mControlsList;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlConfiguration::updateControlList
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlConfiguration::updateControlList(
+ TVideoPlaybackControlCommandIds event )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlConfiguration::updateControlList(%d)"), event);
+
+ if ( event == EControlCmdFullScreenViewOpened ||
+ event == EControlCmdDetailsViewOpened ||
+ event == EControlCmdPluginInitialized )
+ {
+ mState = event;
+ }
+ else if ( event == EControlCmdTvOutConnected ||
+ event == EControlCmdAudionOnlyViewOpened )
+ {
+ mState = EControlCmdTvOutConnected;
+ }
+ else
+ {
+ mState = KControlListUpdated;
+ }
+
+ emit controlListUpdated();
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlConfiguration::deleteControlFromList
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlConfiguration::deleteControlFromList(
+ TVideoPlaybackControls control )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlConfiguration::deleteControlFromList(%d)"), control);
+
+ mControlsList.removeAll( control );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlConfiguration::addControlToList
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlConfiguration::addControlToList(
+ TVideoPlaybackControls control )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlConfiguration::addControlToList(%d)"), control);
+
+ if ( ! mControlsList.contains( control ) )
+ {
+ mControlsList.append( control );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlConfiguration::updateControlsWithFileDetails
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlConfiguration::updateControlsWithFileDetails()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlConfiguration::updateControlsWithFileDetails()"));
+
+ mUpdateControlsWithFileDetails = true;
+}
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/src/videoplaybackcontrolpolicy.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,125 @@
+/*
+* 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 VideoPlaybackControlPolicy
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+// INCLUDE FILES
+
+#include "mpxvideo_debug.h"
+#include "videoplaybackcontrolpolicy.h"
+#include "videoplaybackviewfiledetails.h"
+
+// ================= MEMBER FUNCTIONS ==============================================================
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlPolicy::VideoPlaybackControlPolicy()
+// C++ default constructor can NOT contain any code, that might leave.
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackControlPolicy::VideoPlaybackControlPolicy()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlPolicy::VideoPlaybackControlPolicy()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlPolicy::~VideoPlaybackControlPolicy()
+// Destructor.
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackControlPolicy::~VideoPlaybackControlPolicy()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlPolicy::~VideoPlaybackControlPolicy()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlPolicy::setControlProperties()
+// -------------------------------------------------------------------------------------------------
+//
+void
+VideoPlaybackControlPolicy::setControlProperties( TVideoPlaybackControls controlIndex,
+ TUint& properties,
+ VideoPlaybackViewFileDetails *details,
+ TPlaybackViewMode viewMode )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlPolicy::setControlProperties()"));
+
+ properties = 0;
+
+ switch ( controlIndex )
+ {
+ case EBufferingAnimation:
+ {
+ properties = EShownWhenInitializing |
+ EShownWhenBuffering;
+ break;
+ }
+ case EStatusPane:
+ {
+ if ( details->mPlaybackMode != EMPXVideoLocal ||
+ viewMode == EAudioOnlyView ||
+ viewMode == EDetailsView )
+ {
+ properties = EAllProperties;
+ }
+ else
+ {
+ properties = EShownWhenPlaying |
+ EShownWhenPaused |
+ EShownWhenSeeking;
+ }
+ break;
+ }
+ case EControlBar:
+ {
+ //
+ // We don't delete ButtonBar and Progress Bar from the controlsList
+ // to update information all the time though it's not visible or activated
+ // So just hide these if it is details view
+ //
+ if ( viewMode == EDetailsView )
+ {
+ properties = 0;
+ }
+ else if ( viewMode == EAudioOnlyView )
+ {
+ properties = EAllProperties;
+ }
+ else
+ {
+ properties = EShownWhenPlaying |
+ EShownWhenPaused |
+ EShownWhenSeeking;
+ }
+ break;
+ }
+ case EFileDetailsWidget:
+ case EIndicatorBitmap:
+ case EDetailsViewPlaybackWindow:
+ {
+ //
+ // Add all these controls when it is details view or audio only view
+ // Once it's added to controlsList, these are visible always
+ //
+ properties = EAllProperties;
+ break;
+ }
+ }
+}
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/src/videoplaybackdetailsplaybackwindow.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,58 @@
+/*
+* 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 VideoPlaybackProgressBar
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+
+#include "mpxvideo_debug.h"
+#include "videoplaybackcontrolscontroller.h"
+#include "videoplaybackdetailsplaybackwindow.h"
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDetailsPlaybackWindow::VideoPlaybackDetailsPlaybackWindow
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackDetailsPlaybackWindow::VideoPlaybackDetailsPlaybackWindow(
+ VideoPlaybackControlsController* controller )
+ : mController( controller )
+ , mInitialized( false )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackDetailsPlaybackWindow::VideoPlaybackDetailsPlaybackWindow()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDetailsPlaybackWindow::~VideoPlaybackDetailsPlaybackWindow
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackDetailsPlaybackWindow::~VideoPlaybackDetailsPlaybackWindow()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackDetailsPlaybackWindow::~VideoPlaybackDetailsPlaybackWindow()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDetailsPlaybackWindow::initialize
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackDetailsPlaybackWindow::initialize()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackDetailsPlaybackWindow::initialize()"));
+
+}
+
+//End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/src/videoplaybackdocumentloader.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,260 @@
+/*
+* 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 VideoPlaybackDocumentLoader
+*
+*/
+
+// Version : %version: 5 %
+
+
+
+#include <hblistwidget.h>
+#include <hblabel.h>
+#include <hbtransparentwindow.h>
+#include <hbratingslider.h>
+
+#include "mpxvideo_debug.h"
+#include "videoplaybackdocumentloader.h"
+#include "videoplaybackcontrolscontroller.h"
+
+#include "videoplaybackcontrolbar.h"
+#include "videoplaybackfiledetailswidget.h"
+#include "videoplaybackcontrolconfiguration.h"
+#include "videoplaybackdetailsplaybackwindow.h"
+
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDocumentLoader::VideoPlaybackDocumentLoader
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackDocumentLoader::VideoPlaybackDocumentLoader(
+ VideoPlaybackControlsController *controller )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackDocumentLoader::VideoPlaybackDocumentLoader()"));
+ mController = controller;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDocumentLoader::~VideoPlaybackDocumentLoader
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackDocumentLoader::~VideoPlaybackDocumentLoader()
+{
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::VideoPlaybackDocumentLoader : mWidgets.count(%d)"),
+ mWidgets.count() );
+
+ for ( int i = 0 ; i < mWidgets.count() ; i++ )
+ {
+ mWidgets.removeAt( 0 );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDocumentLoader::findWidget()
+// -------------------------------------------------------------------------------------------------
+//
+QGraphicsWidget *VideoPlaybackDocumentLoader::findWidget( const QString &name )
+{
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::findWidget(%s)"), name.data() );
+
+ QGraphicsWidget *object = NULL;
+
+ //int index = exist( name );
+ mIndex = exist( name );
+
+ if ( mIndex == -1 )
+ {
+ object = createWidget( name );
+ }
+ else
+ {
+ object = mWidgets[ mIndex ];
+ }
+
+ return object;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDocumentLoader::createWidget()
+// -------------------------------------------------------------------------------------------------
+//
+QGraphicsWidget *VideoPlaybackDocumentLoader::createWidget( const QString &name )
+{
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::createWidget(%s)"), name.data() );
+
+ QGraphicsWidget *object = NULL;
+
+ if ( name == "transparentWindow" ||
+ name == "small_transparentWindow" )
+ {
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::creating transparentWindow") );
+
+ object = new HbTransparentWindow();
+ object->setObjectName( name );
+
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::appending[transparentWindow] to object list") );
+ mWidgets.append( object );
+ }
+ else if ( name == "content" || name == "bitmapLayout" )
+ {
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::creating HbWidget") );
+
+ object = new HbWidget();
+ object->setObjectName( name );
+
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::appending[HbWidget] to object list") );
+ mWidgets.append( object );
+ }
+ else if ( name == "title" || name == "bufferingIcon" ||
+ name == "tvOutBitmap" || name == "realAudioOnlyBitmap" ||
+ name == "partialAudioOnlyBitmap" || name == "audioOnlyBitmap" )
+ {
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::creating HbLabel") );
+
+ object = new HbLabel();
+ object->setObjectName( name );
+
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::appending[HbLabel] to object list") );
+ mWidgets.append( object );
+ }
+ else if ( name == "controlBarLayout" )
+ {
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::creating controlBarLayout") );
+
+ object = new VideoPlaybackControlBar( mController );
+ object->setObjectName( name );
+
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::appending[controlBarLayout] to object list") );
+ mWidgets.append( object );
+ }
+ else if ( name == "fileDetailsLayout" )
+ {
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::creating fileDetailsLayout") );
+
+ object = new VideoPlaybackFileDetailsWidget( mController );
+ object->setObjectName( name );
+
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::appending[fileDetailsLayout] to object list") );
+ mWidgets.append( object );
+ }
+ else if ( name == "detailsPlaybackWindow" )
+ {
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::creating detailsPlaybackWindow") );
+
+ object = new VideoPlaybackDetailsPlaybackWindow( mController );
+ object->setObjectName( name );
+
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::appending[detailsPlaybackWindow] to object list") );
+ mWidgets.append( object );
+ }
+ else if ( name == "fileDetails" )
+ {
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::creating HbListWidget") );
+
+ object = new HbListWidget();
+ object->setObjectName( name );
+
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::appending[HbListWidget] to object list") );
+ mWidgets.append( object );
+ }
+ else if ( name == "nonLocalPlayback" )
+ {
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::creating HbRatingSlider") );
+
+ object = new HbRatingSlider();
+ object->setObjectName( name );
+
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::appending[HbRatingSlider] to object list") );
+ mWidgets.append( object );
+ }
+ else if ( name == "rnLogoBitmap" )
+ {
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::creating rnLogoBitmap") );
+
+ object = new HbWidget();
+ object->setObjectName( name );
+
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::appending[rnLogoBitmap] to object list") );
+ mWidgets.append( object );
+ }
+
+ return object;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDocumentLoader::exist()
+// -------------------------------------------------------------------------------------------------
+//
+int VideoPlaybackDocumentLoader::exist( const QString &name )
+{
+ int i = 0;
+
+ for ( ; i < mWidgets.count() ; i++ )
+ {
+ if( mWidgets[i]->objectName() == name )
+ {
+ break;
+ }
+ }
+
+ if ( i == mWidgets.count() )
+ {
+ i = -1;
+ }
+
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::exist(%s) returns %d"),
+ name.data(), i );
+
+ return i;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDocumentLoader::load()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackDocumentLoader::load(
+ const QString &fileName, const QString §ion , bool *ok )
+{
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::load(fileName=%s, section=%s)"),
+ fileName.data(), section.data() );
+
+ Q_UNUSED( fileName );
+ Q_UNUSED( section );
+ *ok = true;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDocumentLoader::load()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackDocumentLoader::load(
+ const QString &fileName, bool *ok )
+{
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::load(fileName=%s)"), fileName.data() );
+ Q_UNUSED( fileName );
+ *ok = true;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDocumentLoader::isVisible()
+// -------------------------------------------------------------------------------------------------
+//
+bool VideoPlaybackDocumentLoader::isVisible( int index )
+{
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::isVisible(%d)"), index );
+
+ return mWidgets[ index ]->isVisible();
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/src/videoplaybackfiledetailswidget.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,57 @@
+/*
+* 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 VideoPlaybackFileDetailsWidget
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+
+#include "mpxvideo_debug.h"
+#include "videoplaybackfiledetailswidget.h"
+#include "videoplaybackcontrolscontroller.h"
+
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFileDetailsWidget::VideoPlaybackFileDetailsWidget
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackFileDetailsWidget::VideoPlaybackFileDetailsWidget(
+ VideoPlaybackControlsController* controller )
+ : mController( controller )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackFileDetailsWidget::VideoPlaybackFileDetailsWidget()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFileDetailsWidget::~VideoPlaybackFileDetailsWidget
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackFileDetailsWidget::~VideoPlaybackFileDetailsWidget()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackFileDetailsWidget::~VideoPlaybackFileDetailsWidget()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFileDetailsWidget::initialize
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackFileDetailsWidget::initialize()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackFileDetailsWidget::initialize"));
+}
+
+//End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/src/videoplaybackfullscreencontrol.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,193 @@
+/*
+* 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 VideoPlaybackFullScreenControl
+*
+*/
+
+// Version : %version: 4 %
+
+
+
+#include <w32std.h>
+
+#include "mpxvideo_debug.h"
+#include "videoplaybackfullscreencontrol.h"
+#include "videoplaybackfiledetailswidget.h"
+#include "videoplaybackcontrolscontroller.h"
+#include "videoplaybackdetailsplaybackwindow.h"
+
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFullScreenControl::VideoPlaybackFullScreenControl()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackFullScreenControl::VideoPlaybackFullScreenControl(
+ VideoPlaybackControlsController* controller,
+ TVideoPlaybackControls index,
+ HbWidget* widget,
+ TUint controlproperties )
+ : mController( controller )
+ , mControl( widget )
+ , mControlIndex( index )
+ , mProperties( controlproperties )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackFullScreenControl::VideoPlaybackFullScreenControl()"));
+
+ setParent( mController );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFullScreenControl::~VideoPlaybackFullScreenControl()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackFullScreenControl::~VideoPlaybackFullScreenControl()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::~VideoPlaybackFullScreenControl"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFullScreenControl::setVisible()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackFullScreenControl::setVisible( bool visible )
+{
+ mVisible = visible;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFullScreenControl::isVisible()
+// -------------------------------------------------------------------------------------------------
+//
+bool VideoPlaybackFullScreenControl::isVisible()
+{
+ return mVisible;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFullScreenControl::setVisibility()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackFullScreenControl::setVisibility( TMPXPlaybackState state )
+{
+ MPX_DEBUG(_L("VideoPlaybackFullScreenControl::setVisibility(%d)"), state);
+
+ mVisibilityState = state;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFullScreenControl::controlIndex()
+// -------------------------------------------------------------------------------------------------
+//
+TVideoPlaybackControls VideoPlaybackFullScreenControl::controlIndex()
+{
+ return mControlIndex;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFullScreenControl::volumeChanged()
+// -------------------------------------------------------------------------------------------------
+//
+bool VideoPlaybackFullScreenControl::volumeChanged( int volume )
+{
+ mVolume = volume;
+ return true;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFullScreenControl::durationChanged()
+// -------------------------------------------------------------------------------------------------
+//
+bool VideoPlaybackFullScreenControl::durationChanged( int duration )
+{
+ MPX_DEBUG(_L("VideoPlaybackFullScreenControl::durationChanged() [%d]"), duration );
+ mDuration = duration;
+ return true;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFullScreenControl::positionChanged()
+// -------------------------------------------------------------------------------------------------
+//
+bool VideoPlaybackFullScreenControl::positionChanged( int position )
+{
+ MPX_DEBUG(_L("VideoPlaybackFullScreenControl::positionChanged() [%d]"), position );
+ mPosition = position;
+ return true;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFullScreenControl::aspectRatioChanged()
+// -------------------------------------------------------------------------------------------------
+//
+bool VideoPlaybackFullScreenControl::aspectRatioChanged( int aspectRatio )
+{
+ MPX_DEBUG(_L("VideoPlaybackFullScreenControl::aspectRatioChanged() [%d]"), aspectRatio );
+ mAspectRatio = aspectRatio;
+ return true;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFullScreenControl::setDownloadSize()
+// -------------------------------------------------------------------------------------------------
+//
+bool VideoPlaybackFullScreenControl::setDownloadSize( int size )
+{
+ MPX_DEBUG(_L("VideoPlaybackFullScreenControl::setDownloadSize() [%d]"), size );
+ mDownloadSize = size;
+ return true;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFullScreenControl::updateDownloadPosition()
+// -------------------------------------------------------------------------------------------------
+//
+bool VideoPlaybackFullScreenControl::updateDownloadPosition( int size )
+{
+ MPX_DEBUG(_L("VideoPlaybackFullScreenControl::updateDownloadPosition() [%d]"), size );
+ mDownloadPosition = size;
+ return true;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFullScreenControl::updateState()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackFullScreenControl::updateState( TMPXPlaybackState state )
+{
+ MPX_DEBUG(_L("VideoPlaybackFullScreenControl::updateState() [%d]"), state );
+ mState = state;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFullScreenControl::updateControlsWithFileDetails()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackFullScreenControl::updateControlsWithFileDetails(
+ VideoPlaybackViewFileDetails* details )
+{
+ MPX_DEBUG(_L("VideoPlaybackFullScreenControl::updateControlsWithFileDetails()") );
+ Q_UNUSED( details );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFullScreenControl::updateControlProperties()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackFullScreenControl::updateControlProperties( TUint properties )
+{
+ MPX_DEBUG(_L("VideoPlaybackFullScreenControl::updateControlProperties()") );
+ mProperties = properties;
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/src/videoplaybackstatuspanecontrol.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,48 @@
+/*
+* 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 VideoPlaybackStatusPaneControl
+*
+*/
+
+// Version : %version: 2 %
+
+
+#include "mpxvideo_debug.h"
+#include "videoplaybackstatuspanecontrol.h"
+#include "videoplaybackcontrolscontroller.h"
+
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackStatusPaneControl::VideoPlaybackStatusPaneControl()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackStatusPaneControl::VideoPlaybackStatusPaneControl(
+ VideoPlaybackControlsController* controller,
+ TVideoPlaybackControls index,
+ HbWidget* widget,
+ TUint controlproperties )
+ : VideoPlaybackFullScreenControl( controller, index, widget, controlproperties )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackStatusPaneControl::VideoPlaybackStatusPaneControl()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackStatusPaneControl::~VideoPlaybackStatusPaneControl()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackStatusPaneControl::~VideoPlaybackStatusPaneControl()
+{
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/src/videoplaybackviewfiledetails.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,77 @@
+/*
+* 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: class for Video File Details (Qt)
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+//
+// INCLUDE FILES
+//
+#include "mpxvideo_debug.h"
+#include "videoplaybackviewfiledetails.h"
+
+
+// ============================ MEMBER FUNCTIONS ===================================================
+
+VideoPlaybackViewFileDetails::VideoPlaybackViewFileDetails()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewFileDetails::VideoPlaybackViewFileDetails()"));
+
+ clearFileDetails();
+}
+
+VideoPlaybackViewFileDetails::~VideoPlaybackViewFileDetails()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewFileDetails::~VideoPlaybackViewFileDetails()"));
+
+ clearFileDetails();
+}
+
+void
+VideoPlaybackViewFileDetails::clearFileDetails()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewFileDetails::ClearFileDetails()"));
+
+ mMimeType = tr("");
+ mTitle = tr("");
+ mArtist = tr("");
+ mClipName = tr("");
+ mDescription = tr("");
+ mLocation = tr("");
+ mCopyright = tr("");
+ mLanguage = tr("");
+ mKeywords = tr("");
+
+ mPlaybackMode = EMPXVideoLocal;
+ mSeekable = false;
+ mPausableStream = false;
+ mAudioEnabled = false;
+ mVideoEnabled = false;
+ mPartialPlayback = false;
+ mRNFormat = false;
+
+ mDuration = 0;
+ mTvOutConnected = false;
+ mDrmProtected = false;
+
+ mVideoHeight = 0;
+ mVideoWidth = 0;
+ mBitRate = 0;
+}
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/src/videoservices.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,124 @@
+/*
+* 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 VideoServices STUB
+*
+*/
+
+// Version : %version: 1 %
+
+#include "videoservices.h"
+#include "videoserviceurifetch.h"
+#include "mpxvideo_debug.h"
+
+
+VideoServices *VideoServices::mInstance = 0;
+int VideoServices::mReferenceCount = 0;
+
+// -----------------------------------------------------------------------------
+// VideoServices::instance()
+// -----------------------------------------------------------------------------
+//
+VideoServices* VideoServices::instance()
+{
+ MPX_DEBUG(_L("VideoServices::instance()"));
+
+ if ( !mInstance )
+ {
+ mInstance = new VideoServices();
+ }
+
+ mInstance->mReferenceCount++;
+
+ return mInstance;
+}
+
+// -----------------------------------------------------------------------------
+// VideoServices::decreaseReferenceCount()
+// -----------------------------------------------------------------------------
+//
+void VideoServices::decreaseReferenceCount()
+{
+ MPX_DEBUG(_L("VideoServices::decreaseReferenceCount()"));
+
+ if ( mInstance )
+ {
+ if ( --mInstance->mReferenceCount == 0 )
+ {
+ delete mInstance;
+ mInstance = NULL;
+ }
+ }
+}
+
+
+// ----------------------------------------------------------------------------
+// VideoServices()
+// ----------------------------------------------------------------------------
+//
+VideoServices::VideoServices()
+ : mCurrentService( VideoServices::ENoService )
+ , mItemSelected( false )
+{
+ MPX_DEBUG(_L("VideoServices::VideoServices()"));
+
+ mServiceUriFetch = new VideoServiceUriFetch( this );
+}
+
+// ----------------------------------------------------------------------------
+// ~VideoServices()
+// ----------------------------------------------------------------------------
+//
+VideoServices::~VideoServices()
+{
+ MPX_DEBUG(_L("VideoServices::~VideoServices()"));
+
+ delete mServiceUriFetch;
+}
+
+
+// ----------------------------------------------------------------------------
+// currentService()
+// ----------------------------------------------------------------------------
+//
+VideoServices::TVideoService VideoServices::currentService()
+{
+ MPX_DEBUG(_L("VideoServices::currentService() ret %d"), mCurrentService);
+
+ return mCurrentService;
+}
+
+
+// ----------------------------------------------------------------------------
+// setCurrentService()
+// ----------------------------------------------------------------------------
+//
+void VideoServices::setCurrentService( VideoServices::TVideoService service )
+{
+ MPX_DEBUG(_L("VideoServices::setCurrentService(%d)"), service);
+
+ mCurrentService = service;
+}
+
+// ----------------------------------------------------------------------------
+// itemSelected()
+// ----------------------------------------------------------------------------
+//
+void VideoServices::itemSelected( const QString& item )
+{
+ MPX_DEBUG(_L("VideoServices::itemSelected()") );
+
+ Q_UNUSED( item );
+
+ mItemSelected = true;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/src/videoserviceurifetch.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,44 @@
+/*
+* 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 VideoServiceUriFetch STUB
+*
+*/
+
+#include "videoservices.h"
+#include "videoserviceurifetch.h"
+#include "mpxvideo_debug.h"
+
+
+// ----------------------------------------------------------------------------
+// VideoServiceUriFetch()
+// ----------------------------------------------------------------------------
+//
+VideoServiceUriFetch::VideoServiceUriFetch( VideoServices* parent )
+{
+ MPX_DEBUG(_L("VideoServiceUriFetch::VideoServiceUriFetch()"));
+
+ if ( parent )
+ {
+ parent->setCurrentService( VideoServices::EUriFetcher );
+ }
+}
+
+// ----------------------------------------------------------------------------
+// ~VideoServiceUriFetch()
+// ----------------------------------------------------------------------------
+//
+VideoServiceUriFetch::~VideoServiceUriFetch()
+{
+ MPX_DEBUG(_L("VideoServiceUriFetch::~VideoServiceUriFetch()"));
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/src/xqserviceutil.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,57 @@
+/*
+* 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: ?Description
+*
+*/
+
+#include "xqserviceutil.h"
+#include "xqserviceutilxtra.h"
+#include "mpxvideo_debug.h"
+
+
+// ----------------------------------------------------------------------------
+// XQServiceUtil::toBackground()
+// ----------------------------------------------------------------------------
+//
+void XQServiceUtil::toBackground( bool value )
+{
+ MPX_DEBUG(_L("XQServiceUtil::toBackground( %d )"), value );
+}
+
+// ----------------------------------------------------------------------------
+// XQServiceUtil::isEmbedded()
+// ----------------------------------------------------------------------------
+//
+bool XQServiceUtil::isEmbedded()
+{
+ MPX_DEBUG(_L("XQServiceUtil::isEmbedded()"));
+
+ return false;
+}
+
+// ----------------------------------------------------------------------------
+// XQServiceUtil::isService()
+// ----------------------------------------------------------------------------
+//
+bool XQServiceUtil::isService()
+{
+ bool service;
+ XQServiceUtilXtra* ptr = XQServiceUtilXtra::instance();
+ service = ptr->currentService();
+ ptr->decreaseReferenceCount();
+
+ MPX_DEBUG(_L("XQServiceUtil::isEmbedded() ret %d"), service);
+ return service;
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/src/xqserviceutilxtra.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,102 @@
+/**
+* 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 "xqserviceutilxtra.h"
+#include "mpxvideo_debug.h"
+
+XQServiceUtilXtra* XQServiceUtilXtra::mInstance = 0;
+int XQServiceUtilXtra::mReferenceCount = 0;
+bool XQServiceUtilXtra::service = false;
+
+// -----------------------------------------------------------------------------
+// XQServiceUtilXtra::instance()
+// -----------------------------------------------------------------------------
+//
+XQServiceUtilXtra* XQServiceUtilXtra::instance()
+{
+ MPX_DEBUG(_L("XQServiceUtilXtra::instance()"));
+
+ if ( !mInstance )
+ {
+ mInstance = new XQServiceUtilXtra();
+ }
+ mInstance->mReferenceCount++;
+
+ return mInstance;
+}
+
+// -----------------------------------------------------------------------------
+// XQServiceUtilXtra::decreaseReferenceCount()
+// -----------------------------------------------------------------------------
+//
+void XQServiceUtilXtra::decreaseReferenceCount()
+{
+ MPX_DEBUG(_L("XQServiceUtilXtra::decreaseReferenceCount()"));
+
+ if ( mInstance )
+ {
+ if (--mInstance->mReferenceCount == 0 )
+ {
+ delete mInstance;
+ mInstance = NULL;
+ }
+ }
+}
+
+
+// ----------------------------------------------------------------------------
+// XQServiceUtilXtra()
+// ----------------------------------------------------------------------------
+//
+XQServiceUtilXtra::XQServiceUtilXtra()
+{
+ MPX_DEBUG(_L("XQServiceUtilXtra::XQServiceUtilXtra()"));
+}
+
+// ----------------------------------------------------------------------------
+// ~XQServiceUtilXtra()
+// ----------------------------------------------------------------------------
+//
+XQServiceUtilXtra::~XQServiceUtilXtra()
+{
+ MPX_DEBUG(_L("XQServiceUtilXtra::~XQServiceUtilXtra()"));
+}
+
+
+// ----------------------------------------------------------------------------
+// currentService()
+// ----------------------------------------------------------------------------
+//
+bool XQServiceUtilXtra::currentService()
+{
+ MPX_DEBUG(_L("XQServiceUtilXtra::currentService() ret %d"), mInstance->service);
+
+ return mInstance->service;
+}
+
+
+// ----------------------------------------------------------------------------
+// setCurrentService()
+// ----------------------------------------------------------------------------
+//
+void XQServiceUtilXtra::setCurrentService( bool service )
+{
+ MPX_DEBUG(_L("XQServiceUtilXtra::setCurrentService( %d )"), service);
+
+ mInstance->service = service;
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/testcontrolscontroller.pro Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,79 @@
+#
+# 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: Project file for building testcontrolscontroller
+#
+#
+# Version : %version: 8 %
+
+
+TEMPLATE = app
+TARGET = testcontrolscontroller
+CONFIG += qtestlib hb qt
+
+LIBS += -lxqserviceutil.dll \
+ -lefsrv.dll
+
+INCLUDEPATH += stub/inc \
+ ../inc \
+ ../../inc \
+ ../../../inc \
+ ../../../../inc
+
+DEPENDPATH += stub/inc stub/src inc src
+
+# Input
+HEADERS += videobaseplaybackview.h \
+ videoplaybackcontrolbar.h \
+ videoplaybackcontrolpolicy.h \
+ videoplaybackcontrolconfiguration.h \
+ videoplaybackdetailsplaybackwindow.h \
+ videoplaybackdocumentloader.h \
+ videoplaybackfiledetailswidget.h \
+ videoplaybackfullscreencontrol.h \
+ videoplaybackstatuspanecontrol.h \
+ videoplaybackviewfiledetails.h \
+ mpxvideoviewwrapper.h \
+ thumbnailmanager_qt.h \
+ testcontrolscontroller.h \
+ hbvolumesliderpopup.h \
+ xqserviceutilxtra.h \
+ xqserviceutil.h \
+ videoservices.h \
+ videoserviceurifetch.h \
+ shareui.h \
+ ../../inc/videoplaybackcontrolscontroller.h
+
+
+SOURCES += videobaseplaybackview.cpp \
+ videoplaybackcontrolbar.cpp \
+ videoplaybackcontrolpolicy.cpp \
+ videoplaybackcontrolconfiguration.cpp \
+ videoplaybackdetailsplaybackwindow.cpp \
+ videoplaybackdocumentloader.cpp \
+ videoplaybackfiledetailswidget.cpp \
+ videoplaybackfullscreencontrol.cpp \
+ videoplaybackstatuspanecontrol.cpp \
+ videoplaybackviewfiledetails.cpp \
+ mpxvideoviewwrapper.cpp \
+ thumbnailmanager_qt.cpp \
+ testcontrolscontroller.cpp \
+ hbvolumesliderpopup.cpp \
+ xqserviceutilxtra.cpp \
+ xqserviceutil.cpp \
+ videoservices.cpp \
+ videoserviceurifetch.cpp \
+ shareui.cpp \
+ ../../controlsrc/videoplaybackcontrolscontroller.cpp
+
+
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testdetailsplaybackwindow/inc/testdetailsplaybackwindow.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,71 @@
+/**
+* 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: tester for methods in TestDetailsPlaybackWindow
+*
+*/
+
+// Version : %version: 7 %
+
+
+#ifndef __TESTDETAILSPLAYBACKWINDOW_H__
+#define __TESTDETAILSPLAYBACKWINDOW_H__
+
+
+// INCLUDES
+#include <QtTest/QtTest>
+
+class QEvent;
+class VideoPlaybackDetailsPlaybackWindow;
+class VideoPlaybackControlsController;
+
+class TestDetailsPlaybackWindow : public QObject
+{
+ Q_OBJECT
+
+public:
+
+ /**
+ * will be called before each testfunction is executed.
+ *
+ */
+ void init( bool attachOperation = false );
+
+ /**
+ * will be called after every testfunction.
+ *
+ */
+ void cleanup();
+
+ // test functions for the test framework
+private slots:
+
+ // the order in which these testXX methods are declared is important
+ // changing this order will affect the test results
+ void testUpdateState();
+ void testPlay();
+ void testAttach();
+ void testSend();
+
+signals:
+ void commandSignal();
+
+private:
+ VideoPlaybackDetailsPlaybackWindow* mWindow;
+ VideoPlaybackControlsController* mController;
+};
+
+
+#endif // __TESTDETAILSPLAYBACKWINDOW_H__
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testdetailsplaybackwindow/src/testdetailsplaybackwindow.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,217 @@
+/**
+* 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: tester for methods in TestDetailsPlaybackWindow
+*
+*/
+
+// Version : %version: 9 %
+
+
+#include <qdebug>
+#include <qgraphicsscenemouseevent>
+
+#include <hbmainwindow.h>
+#include <hbapplication.h>
+
+#include "hbpushbutton.h"
+#include "videoplaybackviewfiledetails.h"
+#include "videoplaybackcontrolscontroller.h"
+#include "testdetailsplaybackwindow.h"
+
+
+#define private public
+#include "videoplaybackdetailsplaybackwindow.h"
+#undef private
+
+// ---------------------------------------------------------------------------
+// main
+// ---------------------------------------------------------------------------
+//
+int main(int argc, char *argv[])
+{
+ MPX_ENTER_EXIT(_L("TestDetailsPlaybackWindow::Main()"));
+
+ HbApplication app(argc, argv);
+ HbMainWindow window;
+
+ TestDetailsPlaybackWindow tv;
+
+ char *pass[3];
+ pass[0] = argv[0];
+ pass[1] = "-o";
+ pass[2] = "c:\\data\\testdetailsplaybackwindow.txt";
+
+ int res = QTest::qExec(&tv, 3, pass);
+
+ return res;
+}
+
+// ---------------------------------------------------------------------------
+// init
+// ---------------------------------------------------------------------------
+//
+void TestDetailsPlaybackWindow::init( bool attachOperation )
+{
+ MPX_ENTER_EXIT(_L("TestDetailsPlaybackWindow::init()"));
+
+ mController = new VideoPlaybackControlsController( attachOperation );
+ mWindow = new VideoPlaybackDetailsPlaybackWindow( mController );
+
+ mWindow->initialize();
+}
+
+// ---------------------------------------------------------------------------
+// cleanup
+// ---------------------------------------------------------------------------
+//
+void TestDetailsPlaybackWindow::cleanup()
+{
+ MPX_ENTER_EXIT(_L("TestDetailsPlaybackWindow::cleanup()"));
+
+ if ( mController )
+ {
+ delete mController;
+ mController = NULL;
+ }
+
+ if ( mWindow )
+ {
+ delete mWindow;
+ mWindow = NULL;
+ }
+}
+
+// ---------------------------------------------------------------------------
+// testUpdateState
+// ---------------------------------------------------------------------------
+//
+void TestDetailsPlaybackWindow::testUpdateState()
+{
+ MPX_ENTER_EXIT(
+ _L("TestDetailsPlaybackWindow::testUpdateState()"));
+
+ init();
+
+ TMPXPlaybackState state = EPbStatePlaying;
+ mWindow->updateState( state );
+ QVERIFY( mWindow->mPlayButton->isVisible() == false );
+
+ state = EPbStatePaused;
+ mWindow->updateState( state );
+ QVERIFY( mWindow->mPlayButton->isVisible() == true );
+
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testPlay
+// ---------------------------------------------------------------------------
+//
+void TestDetailsPlaybackWindow::testPlay()
+{
+ MPX_ENTER_EXIT(
+ _L("TestDetailsPlaybackWindow::testPlay()"));
+
+ init();
+
+ mWindow->mPlayButton->release();
+ QVERIFY( mController->mCommand == EMPXPbvCmdPlay );
+
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testAttach
+// ---------------------------------------------------------------------------
+//
+void TestDetailsPlaybackWindow::testAttach()
+{
+ MPX_ENTER_EXIT(
+ _L("TestDetailsPlaybackWindow::testAttach()"));
+
+ //
+ // test when 'attach' operation is enabled
+ //
+ init( true );
+
+ //
+ // connect signal/slot
+ //
+ connect( this, SIGNAL( commandSignal() ), mController, SLOT( attachVideo() ) );
+
+ //
+ // emit signal
+ //
+ emit commandSignal();
+
+ //
+ // verify the controller attachVideo() slot has been called
+ //
+ QVERIFY( mController->mAttachVideoDone == true );
+
+ //
+ // disconnect signal/slot
+ //
+ disconnect( this, SIGNAL( commandSignal() ), mController, SLOT( attachVideo() ) );
+
+ //
+ // clean up
+ //
+ cleanup();
+
+}
+
+// ---------------------------------------------------------------------------
+// testSend
+// ---------------------------------------------------------------------------
+//
+void TestDetailsPlaybackWindow::testSend()
+{
+ MPX_ENTER_EXIT(
+ _L("TestDetailsPlaybackWindow::testSend()"));
+
+ //
+ // test when 'share' operation is enabled
+ //
+ init( false );
+
+ //
+ // connect signal/slot
+ //
+ connect( this, SIGNAL( commandSignal() ), mController, SLOT( sendVideo() ) );
+
+ //
+ // emit signal
+ //
+ emit commandSignal();
+
+ //
+ // verify the controller sendVideo() slot has been called
+ //
+ QVERIFY( mController->mCommand == EMPXPbvCmdPause );
+ QVERIFY( mController->mSendVideoDone == true );
+
+ //
+ // disconnect signal/slot
+ //
+ disconnect( this, SIGNAL( commandSignal() ), mController, SLOT( sendVideo() ) );
+
+ //
+ // clean up
+ //
+ cleanup();
+
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testdetailsplaybackwindow/stub/inc/hbpushbutton.h Thu Jul 08 13:05:19 2010 +0300
@@ -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 HbPushButton
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+#ifndef HBPUSHBUTTON_H_
+#define HBPUSHBUTTON_H
+
+#include <hbwidget.h>
+#include <hbstyle.h>
+
+class QGraphicsItem;
+class HbFrameDrawer;
+
+class HbPushButton : public HbWidget
+{
+ Q_OBJECT
+
+ public:
+ HbPushButton();
+ virtual ~HbPushButton();
+
+ public:
+ void setEnabled( bool enabled );
+ void setVisible( bool visible );
+ void setSelected( bool selected );
+ bool isEnabled();
+ bool isVisible();
+ bool isSelected();
+ QGraphicsItem* primitive( HbStyle::Primitive primitive ) const;
+ void press();
+ void release();
+ HbFrameDrawer* frameBackground();
+ void setFrameBackground( HbFrameDrawer *drawer );
+
+ signals:
+ void pressed();
+ void released();
+
+ public:
+ bool mVisible;
+ bool mEnabled;
+ bool mSelected;
+
+ QGraphicsItem *mBackground;
+ HbFrameDrawer *mFrameDrawer;
+};
+
+#endif /*HBPUSHBUTTON_H*/
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testdetailsplaybackwindow/stub/inc/videoplaybackcontrolscontroller.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,162 @@
+/*
+* 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 VideoPlaybackControlsController
+*
+*/
+
+// Version : %version: 4 %
+
+
+
+#ifndef VIDEOPLAYBACKCONTROLSCONTROLLER_H_
+#define VIDEOPLAYBACKCONTROLSCONTROLLER_H_
+
+// INCLUDES
+#include <qobject>
+#include <mpxplaybackframeworkdefs.h>
+
+#include "mpxvideo_debug.h"
+#include "mpxcommonvideoplaybackview.hrh"
+#include "videoplaybackviewfiledetails.h"
+
+// FORWARD DECLARATIONS
+class VideoPlaybackDocumentLoader;
+
+
+// DATA TYPES
+
+enum TTimerAction
+{
+ ETimerCancel,
+ ETimerReset
+};
+
+enum TPlaybackViewMode
+{
+ EFullScreenView,
+ EDetailsView,
+ EAudioOnlyView
+};
+
+// CLASS DECLARATION
+
+class VideoPlaybackControlsController : public QObject
+{
+ Q_OBJECT
+
+ public:
+
+ /**
+ * constructor.
+ */
+ VideoPlaybackControlsController( bool attachOperation );
+
+ /**
+ * Destructor.
+ */
+ virtual ~VideoPlaybackControlsController();
+
+ public:
+
+ /**
+ * Command handling function.
+ * Call HandleCommandL() of container
+ */
+ void handleCommand( TMPXVideoPlaybackViewCommandIds command, int value = 0 );
+
+ /**
+ * Reset or cancel timers for the controls
+ */
+ void resetDisappearingTimers( TTimerAction timerAction );
+
+ /**
+ * Return state
+ */
+ inline TMPXPlaybackState state();
+
+ /**
+ * Return file details
+ */
+ inline VideoPlaybackViewFileDetails* fileDetails();
+
+ inline VideoPlaybackDocumentLoader* layoutLoader();
+
+ TPlaybackViewMode viewMode();
+
+ void changeViewMode( TPlaybackViewMode viewMode, bool transitionEffect = true );
+
+ bool isAttachOperation();
+
+ private slots:
+ void attachVideo();
+ void sendVideo();
+
+ public:
+ VideoPlaybackViewFileDetails *mFileDetails;
+ VideoPlaybackDocumentLoader *mLoader;
+
+ TMPXPlaybackState mState;
+ TPlaybackViewMode mViewMode;
+ TTimerAction mTimerAction;
+ TMPXVideoPlaybackViewCommandIds mCommand;
+ int mCommandValue;
+ bool mIsAttachOperation;
+ bool mAttachVideoDone;
+ bool mSendVideoDone;
+};
+
+// INLINE METHODS
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::state
+// -------------------------------------------------------------------------------------------------
+//
+inline
+TMPXPlaybackState VideoPlaybackControlsController::state()
+{
+ return mState;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::fileDetails
+// -------------------------------------------------------------------------------------------------
+//
+inline
+VideoPlaybackViewFileDetails* VideoPlaybackControlsController::fileDetails()
+{
+ return mFileDetails;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::layoutLoader
+// -------------------------------------------------------------------------------------------------
+//
+inline
+VideoPlaybackDocumentLoader* VideoPlaybackControlsController::layoutLoader()
+{
+ return mLoader;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::viewMode
+// -------------------------------------------------------------------------------------------------
+//
+inline
+TPlaybackViewMode VideoPlaybackControlsController::viewMode()
+{
+ return mViewMode;
+}
+
+#endif /*VIDEOPLAYBACKCONTROLSCONTROLLER_P_H_*/
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testdetailsplaybackwindow/stub/inc/videoplaybackdocumentloader.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,50 @@
+/*
+* 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 VideoPlaybackDocumentLoader
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+#ifndef VIDEOPLAYBACKDOCUMENTHANDLER_H_
+#define VIDEOPLAYBACKDOCUMENTHANDLER_H_
+
+
+#include <qobject>
+#include <qlist>
+
+class QGraphicsWidget;
+class VideoPlaybackControlsController;
+
+class VideoPlaybackDocumentLoader : public QObject
+{
+ public:
+ VideoPlaybackDocumentLoader();
+ virtual ~VideoPlaybackDocumentLoader();
+
+ public:
+ QGraphicsWidget* findWidget( const QString &name );
+
+ private:
+ QGraphicsWidget* createWidget( const QString &name );
+ int exist( const QString &name );
+
+ private:
+ QList<QGraphicsWidget*> mWidgets;
+};
+
+#endif /*VIDEOPLAYBACKDOCUMENTHANDLER_H_*/
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testdetailsplaybackwindow/stub/inc/videoplaybackviewfiledetails.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,84 @@
+/*
+* 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: Video File Details (QT)
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+
+#ifndef __VIDEOPLAYBACKVIEWFILEDETAILS__
+#define __VIDEOPLAYBACKVIEWFILEDETAILS__
+
+#include <qobject.h>
+#include "mpxhelixplaybackplugindefs.h"
+
+
+//
+// CLASS DECLARATION
+//
+class VideoPlaybackViewFileDetails : public QObject
+{
+ public:
+ //
+ // Constructor
+ //
+ VideoPlaybackViewFileDetails();
+
+ //
+ // Destructor.
+ //
+ virtual ~VideoPlaybackViewFileDetails();
+
+ //
+ // Clear all file details
+ //
+ void clearFileDetails();
+
+ public:
+ //
+ // Data
+ //
+ QString mClipName;
+ QString mTitle;
+ QString mArtist;
+ QString mMimeType;
+ QString mDescription;
+ QString mLocation;
+ QString mCopyright;
+ QString mLanguage;
+ QString mKeywords;
+
+ TMPXVideoMode mPlaybackMode;
+ bool mSeekable;
+ bool mPausableStream;
+ bool mAudioEnabled;
+ bool mVideoEnabled;
+ bool mPartialPlayback;
+ bool mRNFormat;
+ bool mTvOutConnected;
+ bool mDrmProtected;
+ bool mMultiItemPlaylist;
+
+ int mVideoHeight;
+ int mVideoWidth;
+ int mBitRate;
+ int mDuration;
+};
+
+#endif // __VIDEOPLAYBACKVIEWFILEDETAILS__
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testdetailsplaybackwindow/stub/src/hbpushbutton.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,181 @@
+/*
+* 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 HbPushButton
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+#include <qgraphicswidget>
+
+#include <hbframedrawer.h>
+
+#include "mpxvideo_debug.h"
+#include "hbpushbutton.h"
+
+// -------------------------------------------------------------------------------------------------
+// HbPushButton::HbPushButton
+// -------------------------------------------------------------------------------------------------
+//
+HbPushButton::HbPushButton()
+ : mVisible( false )
+ , mEnabled( false )
+ , mSelected( false )
+ , mFrameDrawer( NULL )
+{
+ MPX_ENTER_EXIT(_L("HbPushButton::HbPushButton()"));
+
+ mBackground = new QGraphicsWidget();
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbPushButton::~HbPushButton
+// -------------------------------------------------------------------------------------------------
+//
+HbPushButton::~HbPushButton()
+{
+ MPX_DEBUG(_L("HbPushButton::HbPushButton") );
+
+ if ( mBackground )
+ {
+ delete mBackground;
+ mBackground = NULL;
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbPushButton::setEnabled
+// -------------------------------------------------------------------------------------------------
+//
+void HbPushButton::setEnabled( bool enabled )
+{
+ MPX_DEBUG(_L("HbPushButton::setEnabled %d"), enabled );
+
+ mEnabled = enabled;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbPushButton::isEnabled
+// -------------------------------------------------------------------------------------------------
+//
+bool HbPushButton::isEnabled()
+{
+ MPX_DEBUG(_L("HbPushButton::isEnabled %d"), mEnabled );
+
+ return mEnabled;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbPushButton::setVisible
+// -------------------------------------------------------------------------------------------------
+//
+void HbPushButton::setVisible( bool visible )
+{
+ MPX_DEBUG(_L("HbPushButton::setVisible %d"), visible );
+
+ mVisible = visible;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbPushButton::isVisible
+// -------------------------------------------------------------------------------------------------
+//
+bool HbPushButton::isVisible()
+{
+ MPX_DEBUG(_L("HbPushButton::isVisible %d"), mVisible );
+
+ return mVisible;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbPushButton::setSelected
+// -------------------------------------------------------------------------------------------------
+//
+void HbPushButton::setSelected( bool selected )
+{
+ MPX_DEBUG(_L("HbPushButton::setSelected %d"), selected );
+
+ mSelected = selected;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbPushButton::isSelected
+// -------------------------------------------------------------------------------------------------
+//
+bool HbPushButton::isSelected()
+{
+ MPX_DEBUG(_L("HbPushButton::isSelected %d"), mSelected );
+
+ return mSelected;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbPushButton::primitive
+// -------------------------------------------------------------------------------------------------
+//
+QGraphicsItem* HbPushButton::primitive( HbStyle::Primitive primitive ) const
+{
+ MPX_DEBUG(_L("HbPushButton::primitive") );
+
+ Q_UNUSED( primitive );
+ return mBackground;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbPushButton::press
+// -------------------------------------------------------------------------------------------------
+//
+void HbPushButton::press()
+{
+ MPX_DEBUG(_L("HbPushButton::press") );
+
+ emit pressed();
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbPushButton::release
+// -------------------------------------------------------------------------------------------------
+//
+void HbPushButton::release()
+{
+ MPX_DEBUG(_L("HbPushButton::release") );
+
+ emit released();
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbPushButton::frameBackground
+// -------------------------------------------------------------------------------------------------
+//
+HbFrameDrawer* HbPushButton::frameBackground()
+{
+ MPX_DEBUG(_L("HbPushButton::frameBackground") );
+
+ return mFrameDrawer;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbPushButton::setFrameBackground
+// -------------------------------------------------------------------------------------------------
+//
+void HbPushButton::setFrameBackground( HbFrameDrawer *drawer )
+{
+ MPX_DEBUG(_L("HbPushButton::setFrameBackground") );
+
+ mFrameDrawer = drawer;
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testdetailsplaybackwindow/stub/src/videoplaybackcontrolscontroller.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,127 @@
+/*
+* 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 VideoPlaybackControlsController
+*
+*/
+
+// Version : %version: 6 %
+
+
+
+// INCLUDE FILES
+
+
+#include "videoplaybackdocumentloader.h"
+#include "videoplaybackcontrolscontroller.h"
+
+// ================= MEMBER FUNCTIONS ==============================================================
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::VideoPlaybackControlsController()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackControlsController::VideoPlaybackControlsController( bool attachOperation )
+ : mViewMode( EFullScreenView )
+ , mIsAttachOperation( attachOperation )
+ , mAttachVideoDone( false )
+ , mSendVideoDone( false )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackControlsController::VideoPlaybackControlsController()"));
+
+ mLoader = new VideoPlaybackDocumentLoader();
+ mFileDetails = new VideoPlaybackViewFileDetails();
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::~VideoPlaybackControlsController
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackControlsController::~VideoPlaybackControlsController()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::~VideoPlaybackControlsController"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::handleCommand()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::handleCommand(
+ TMPXVideoPlaybackViewCommandIds command, int value )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::handleCommand(%d)"), command);
+
+ mCommand = command;
+ mCommandValue = value;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::changeViewMode
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::changeViewMode(
+ TPlaybackViewMode viewMode, bool transitionEffect )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::changeViewMode()"));
+
+ Q_UNUSED( transitionEffect );
+ mViewMode = viewMode;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::resetDisappearingTimers()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::resetDisappearingTimers( TTimerAction timerAction )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::resetDisappearingTimers()"));
+
+ mTimerAction = timerAction;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::isAttachOperation()
+// -------------------------------------------------------------------------------------------------
+//
+bool VideoPlaybackControlsController::isAttachOperation()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::isAttachOperation() ret %d"),
+ mIsAttachOperation);
+
+ return mIsAttachOperation;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::attachVideo()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::attachVideo()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackControlsController::attachVideo()"));
+
+ mAttachVideoDone = true;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::sendVideo()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::sendVideo()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackControlsController::sendVideo()"));
+
+ handleCommand( EMPXPbvCmdPause );
+ mSendVideoDone = true;
+}
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testdetailsplaybackwindow/stub/src/videoplaybackdocumentloader.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,123 @@
+/*
+* 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 VideoPlaybackDocumentLoader
+*
+*/
+
+// Version : %version: 5 %
+
+
+
+#include "hbpushbutton.h"
+
+#include "mpxvideo_debug.h"
+#include "videoplaybackdocumentloader.h"
+
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDocumentLoader::VideoPlaybackDocumentLoader
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackDocumentLoader::VideoPlaybackDocumentLoader()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackDocumentLoader::VideoPlaybackDocumentLoader()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDocumentLoader::~VideoPlaybackDocumentLoader
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackDocumentLoader::~VideoPlaybackDocumentLoader()
+{
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::VideoPlaybackDocumentLoader") );
+
+ for ( int i = 0 ; i < mWidgets.count() ; i++ )
+ {
+ mWidgets.removeAt( 0 );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDocumentLoader::findWidget()
+// -------------------------------------------------------------------------------------------------
+//
+QGraphicsWidget *VideoPlaybackDocumentLoader::findWidget( const QString &name )
+{
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::findWidget( %s )"), name.data() );
+
+ QGraphicsWidget *object = NULL;
+
+ int index = exist( name );
+
+ if ( index == -1 )
+ {
+ object = createWidget( name );
+ }
+ else
+ {
+ object = mWidgets[ index ];
+ }
+
+ return object;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDocumentLoader::createWidget()
+// -------------------------------------------------------------------------------------------------
+//
+QGraphicsWidget *VideoPlaybackDocumentLoader::createWidget( const QString &name )
+{
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::createWidget( %s )"), name.data() );
+
+ QGraphicsWidget *object = NULL;
+
+ if ( name == "detailsViewPlayButton" ||
+ name == "detailsAttachButton" ||
+ name == "detailsShareButton" )
+ {
+ object = new HbPushButton();
+ object->setObjectName( name );
+ mWidgets.append( object );
+ }
+
+ return object;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDocumentLoader::exist()
+// -------------------------------------------------------------------------------------------------
+//
+int VideoPlaybackDocumentLoader::exist( const QString &name )
+{
+ int i = 0;
+
+ for ( ; i < mWidgets.count() ; i++ )
+ {
+ if( mWidgets[i]->objectName() == name )
+ {
+ break;
+ }
+ }
+
+ if ( i == mWidgets.count() )
+ {
+ i = -1;
+ }
+
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::exist( %s ) ret %d"), name.data(), i );
+
+ return i;
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testdetailsplaybackwindow/stub/src/videoplaybackviewfiledetails.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,77 @@
+/*
+* 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: class for Video File Details (Qt)
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+//
+// INCLUDE FILES
+//
+#include "mpxvideo_debug.h"
+#include "videoplaybackviewfiledetails.h"
+
+
+// ============================ MEMBER FUNCTIONS ===================================================
+
+VideoPlaybackViewFileDetails::VideoPlaybackViewFileDetails()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewFileDetails::VideoPlaybackViewFileDetails()"));
+
+ clearFileDetails();
+}
+
+VideoPlaybackViewFileDetails::~VideoPlaybackViewFileDetails()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewFileDetails::~VideoPlaybackViewFileDetails()"));
+
+ clearFileDetails();
+}
+
+void
+VideoPlaybackViewFileDetails::clearFileDetails()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewFileDetails::ClearFileDetails()"));
+
+ mMimeType = tr("");
+ mTitle = tr("");
+ mArtist = tr("");
+ mClipName = tr("");
+ mDescription = tr("");
+ mLocation = tr("");
+ mCopyright = tr("");
+ mLanguage = tr("");
+ mKeywords = tr("");
+
+ mPlaybackMode = EMPXVideoLocal;
+ mSeekable = false;
+ mPausableStream = false;
+ mAudioEnabled = false;
+ mVideoEnabled = false;
+ mPartialPlayback = false;
+ mRNFormat = false;
+
+ mDuration = 0;
+ mTvOutConnected = false;
+ mDrmProtected = false;
+
+ mVideoHeight = 0;
+ mVideoWidth = 0;
+ mBitRate = 0;
+}
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testdetailsplaybackwindow/testdetailsplaybackwindow.pro Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,43 @@
+#
+# 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: Project file for building testdetailsplaybackwindow
+#
+#
+# Version : %version: 4 %
+
+TEMPLATE = app
+TARGET = testdetailsplaybackwindow
+CONFIG += qtestlib qt hb
+
+INCLUDEPATH += stub/inc \
+ ../../../../inc \
+ ../../../inc
+
+
+DEPENDPATH += inc src stub/inc stub/src
+
+# Input
+HEADERS += testdetailsplaybackwindow.h \
+ videoplaybackcontrolscontroller.h \
+ videoplaybackdocumentloader.h \
+ videoplaybackviewfiledetails.h \
+ hbpushbutton.h \
+ ../../controlinc/videoplaybackdetailsplaybackwindow.h
+
+SOURCES += testdetailsplaybackwindow.cpp \
+ videoplaybackcontrolscontroller.cpp \
+ videoplaybackdocumentloader.cpp \
+ videoplaybackviewfiledetails.cpp \
+ hbpushbutton.cpp \
+ ../../controlsrc/videoplaybackdetailsplaybackwindow.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testdocumentloader/inc/testdocumentloader.h Thu Jul 08 13:05:19 2010 +0300
@@ -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: tester for methods in TestDocumentLoader
+*
+*/
+
+// Version : %version: 2 %
+
+#ifndef __TESTDOCUMENTLOADER_H__
+#define __TESTDOCUMENTLOADER_H__
+
+
+// INCLUDES
+#include <QtTest/QtTest>
+
+class VideoPlaybackDocumentLoader;
+class VideoPlaybackControlsController;
+
+class TestDocumentLoader : public QObject
+{
+ Q_OBJECT
+
+public:
+
+ /**
+ * will be called before each testfunction is executed.
+ *
+ */
+ void init();
+
+ /**
+ * will be called after every testfunction.
+ *
+ */
+ void cleanup();
+
+ // test functions for the test framework
+private slots:
+
+ // the order in which these testXX methods are declared is important
+ // changing this order will affect the test results
+ void testCreateObject();
+
+signals:
+ void commandSignal();
+
+private:
+ VideoPlaybackDocumentLoader* mLoader;
+ VideoPlaybackControlsController* mController;
+};
+
+
+#endif // __TESTDOCUMENTLOADER_H__
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testdocumentloader/src/testdocumentloader.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,114 @@
+/**
+* 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: tester for methods in TestVideoPlaybackDocumentLoader
+*
+*/
+
+// Version : %version: 7 %
+
+
+#include <qdebug>
+#include <qobject>
+
+#include <hbmainwindow.h>
+#include <hbapplication.h>
+
+#include "mpxvideo_debug.h"
+#include "videoplaybackcontrolscontroller.h"
+#include "testdocumentloader.h"
+
+#define private public
+#include "videoplaybackdocumentloader.h"
+#undef private
+
+// ---------------------------------------------------------------------------
+// main
+// ---------------------------------------------------------------------------
+//
+int main(int argc, char *argv[])
+{
+ MPX_ENTER_EXIT(_L("TestDocumentLoader::Main()"));
+
+ HbApplication app(argc, argv);
+ HbMainWindow window;
+
+ TestDocumentLoader tv;
+
+ char *pass[3];
+ pass[0] = argv[0];
+ pass[1] = "-o";
+ pass[2] = "c:\\data\\testdocumentloader.txt";
+
+ int res = QTest::qExec(&tv, 3, pass);
+
+ return res;
+}
+
+
+// ---------------------------------------------------------------------------
+// init
+// ---------------------------------------------------------------------------
+//
+void TestDocumentLoader::init()
+{
+ MPX_ENTER_EXIT(_L("TestDocumentLoader::init()"));
+
+ mController = new VideoPlaybackControlsController();
+ mLoader = new VideoPlaybackDocumentLoader( mController );
+}
+
+// ---------------------------------------------------------------------------
+// cleanup
+// ---------------------------------------------------------------------------
+//
+void TestDocumentLoader::cleanup()
+{
+ MPX_ENTER_EXIT(_L("TestDocumentLoader::cleanup()"));
+
+ if ( mLoader )
+ {
+ delete mLoader;
+ mLoader = NULL;
+ }
+
+ if ( mController )
+ {
+ delete mController;
+ mController = NULL;
+ }
+}
+
+// ---------------------------------------------------------------------------
+// testCreateObject
+// ---------------------------------------------------------------------------
+//
+void TestDocumentLoader::testCreateObject()
+{
+ MPX_ENTER_EXIT(_L("TestDocumentLoader::testCreateObject()"));
+
+ init();
+
+ QObject *object = mLoader->createObject( "", "controlBarLayout" );
+ QVERIFY( object->objectName() == "controlBarLayout" );
+
+ object = mLoader->createObject( "", "fileDetailsLayout" );
+ QVERIFY( object->objectName() == "fileDetailsLayout" );
+
+ object = mLoader->createObject( "", "detailsPlaybackWindow" );
+ QVERIFY( object->objectName() == "detailsPlaybackWindow" );
+
+ cleanup();
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testdocumentloader/stub/inc/videoplaybackcontrolbar.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,57 @@
+/*
+* 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 VideoPlaybackControlBar
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+#ifndef VIDEOPLAYBACKCONTROLBAR_H_
+#define VIDEOPLAYBACKCONTROLBAR_H_
+
+
+
+#include <hbwidget.h>
+#include <mpxplaybackframeworkdefs.h>
+
+class VideoPlaybackViewFileDetails;
+class VideoPlaybackControlsController;
+
+class VideoPlaybackControlBar : public HbWidget
+{
+ Q_OBJECT
+
+ public:
+ VideoPlaybackControlBar( VideoPlaybackControlsController* controller );
+ virtual ~VideoPlaybackControlBar();
+ void updateState( TMPXPlaybackState state );
+ void aspectRatioChanged( int aspectRatio );
+ void updateWithFileDetails( VideoPlaybackViewFileDetails* details );
+ void setVisibility( bool visible );
+ void durationChanged( int duration );
+ void positionChanged( int position );
+
+ public:
+ VideoPlaybackControlsController *mController;
+ int mPosition;
+ int mDuration;
+ int mAspectRatio;
+ bool mVisibility;
+ TMPXPlaybackState mState;
+ VideoPlaybackViewFileDetails *mFileDetails;
+};
+
+#endif /*VIDEOPLAYBACKCONTROLBAR_H_*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testdocumentloader/stub/inc/videoplaybackcontrolscontroller.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,124 @@
+/*
+* 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 VideoPlaybackControlsController
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+#ifndef VIDEOPLAYBACKCONTROLSCONTROLLER_H_
+#define VIDEOPLAYBACKCONTROLSCONTROLLER_H_
+
+// INCLUDES
+#include <qobject>
+#include <mpxplaybackframeworkdefs.h>
+
+#include "mpxvideo_debug.h"
+#include "mpxhelixplaybackplugindefs.h"
+#include "mpxcommonvideoplaybackview.hrh"
+
+// FORWARD DECLARATIONS
+
+// DATA TYPES
+
+enum TTimerAction
+{
+ ETimerCancel,
+ ETimerReset
+};
+
+enum TPlaybackViewMode
+{
+ EFullScreenView,
+ EDetailsView,
+ EAudioOnlyView
+};
+
+const QString KPLAYBACKVIEW_DOCML = ":/videoplaybackview/videoplaybackview.docml";
+
+// CLASS DECLARATION
+
+class VideoPlaybackControlsController : public QObject
+{
+ Q_OBJECT
+
+ public:
+
+ /**
+ * constructor.
+ */
+ VideoPlaybackControlsController();
+
+ /**
+ * Destructor.
+ */
+ virtual ~VideoPlaybackControlsController();
+
+ public:
+
+ /**
+ * Command handling function.
+ * Call HandleCommandL() of container
+ */
+ void handleCommand( TMPXVideoPlaybackViewCommandIds command, int value = 0 );
+
+ /**
+ * Reset or cancel timers for the controls
+ */
+ void resetDisappearingTimers( TTimerAction timerAction );
+
+ /**
+ * Return state
+ */
+ inline TMPXPlaybackState state();
+
+ TPlaybackViewMode viewMode();
+
+ void changeViewMode( TPlaybackViewMode viewMode, bool transitionEffect = true );
+
+ public:
+
+ TMPXPlaybackState mState;
+ TPlaybackViewMode mViewMode;
+ TTimerAction mTimerAction;
+ TMPXVideoPlaybackViewCommandIds mCommand;
+ int mCommandValue;
+};
+
+// INLINE METHODS
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::state
+// -------------------------------------------------------------------------------------------------
+//
+inline
+TMPXPlaybackState VideoPlaybackControlsController::state()
+{
+ return mState;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::viewMode
+// -------------------------------------------------------------------------------------------------
+//
+inline
+TPlaybackViewMode VideoPlaybackControlsController::viewMode()
+{
+ return mViewMode;
+}
+
+#endif /*VIDEOPLAYBACKCONTROLSCONTROLLER_H_*/
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testdocumentloader/stub/inc/videoplaybackdetailsplaybackwindow.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,42 @@
+/*
+* 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 VideoPlaybackDetailsPlaybackWindow
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+#ifndef VIDEOPLAYBACKDETAILSPLAYBACKWINDOW_H_
+#define VIDEOPLAYBACKDETAILSPLAYBACKWINDOW_H_
+
+#include <qobject>
+
+class VideoPlaybackControlsController;
+
+class VideoPlaybackDetailsPlaybackWindow : public QObject
+{
+ Q_OBJECT
+
+ public:
+ VideoPlaybackDetailsPlaybackWindow( VideoPlaybackControlsController* controller );
+ virtual ~VideoPlaybackDetailsPlaybackWindow();
+
+ private:
+ VideoPlaybackControlsController *mController;
+};
+
+#endif /*VIDEOPLAYBACKDETAILSPLAYBACKWINDOW_H_*/
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testdocumentloader/stub/inc/videoplaybackfiledetailswidget.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,43 @@
+/*
+* 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 VideoPlaybackFileDetailsWidget
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+#ifndef VIDEOPLAYBACKFILEDETAILSWIDGET_H_
+#define VIDEOPLAYBACKFILEDETAILSWIDGET_H_
+
+#include <qobject>
+
+class VideoPlaybackControlsController;
+
+
+class VideoPlaybackFileDetailsWidget : public QObject
+{
+ Q_OBJECT
+
+ public:
+ VideoPlaybackFileDetailsWidget( VideoPlaybackControlsController* controller );
+ virtual ~VideoPlaybackFileDetailsWidget();
+
+ private:
+ VideoPlaybackControlsController *mController;
+};
+
+#endif /*VIDEOPLAYBACKFILEDETAILSWIDGET_H_*/
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testdocumentloader/stub/src/videoplaybackcontrolbar.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,119 @@
+/*
+* 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 VideoPlaybackControlBar
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+#include <hbframeitem.h>
+#include <hbframedrawer.h>
+
+#include "mpxvideo_debug.h"
+#include "videoplaybackcontrolbar.h"
+#include "mpxcommonvideoplaybackview.hrh"
+#include "videoplaybackcontrolscontroller.h"
+
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlBar::VideoPlaybackControlBar()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackControlBar::VideoPlaybackControlBar(
+ VideoPlaybackControlsController* controller )
+ : mController( controller )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackControlBar::VideoPlaybackControlBar"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlBar::~VideoPlaybackControlBar()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackControlBar::~VideoPlaybackControlBar()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlBar::~VideoPlaybackControlBar()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlBar::updateState()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlBar::updateState( TMPXPlaybackState state )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlBar::updateState() state = %d"), state );
+
+ mState = state;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlBar::aspectRatioChanged()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlBar::aspectRatioChanged( int aspectRatio )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlBar::aspectRatioChanged() aspectRatio = %d"), aspectRatio );
+
+ mAspectRatio = aspectRatio;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlBar::updateWithFileDetails()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlBar::updateWithFileDetails(
+ VideoPlaybackViewFileDetails* details )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlBar::updateWithFileDetails()"));
+
+ mFileDetails = details;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlBar::setVisibility()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlBar::setVisibility( bool visible )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlBar::setVisibility()"));
+
+ mVisibility = visible;
+}
+
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlBar::durationChanged()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlBar::durationChanged( int duration )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlBar::durationChanged()"));
+
+ mDuration = duration;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlBar::positionChanged()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlBar::positionChanged( int position )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlBar::positionChanged()"));
+
+ mPosition = position;
+}
+
+//End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testdocumentloader/stub/src/videoplaybackcontrolscontroller.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,85 @@
+/*
+* 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 VideoPlaybackControlsController
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+// INCLUDE FILES
+
+
+#include "videoplaybackcontrolscontroller.h"
+
+// ================= MEMBER FUNCTIONS ==============================================================
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::VideoPlaybackControlsController()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackControlsController::VideoPlaybackControlsController()
+ : mViewMode( EFullScreenView )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackControlsController::VideoPlaybackControlsController()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::~VideoPlaybackControlsController
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackControlsController::~VideoPlaybackControlsController()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::~VideoPlaybackControlsController"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::handleCommand()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::handleCommand(
+ TMPXVideoPlaybackViewCommandIds command, int value )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::handleCommand(%d)"), command);
+
+ mCommand = command;
+ mCommandValue = value;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::changeViewMode
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::changeViewMode(
+ TPlaybackViewMode viewMode, bool transitionEffect )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::changeViewMode()"));
+
+ Q_UNUSED( transitionEffect );
+ mViewMode = viewMode;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::resetDisappearingTimers()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::resetDisappearingTimers( TTimerAction timerAction )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::resetDisappearingTimers()"));
+
+ mTimerAction = timerAction;
+}
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testdocumentloader/stub/src/videoplaybackdetailsplaybackwindow.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,45 @@
+/*
+* 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 VideoPlaybackProgressBar
+*
+*/
+
+// Version : %version: 2 %
+
+
+#include "mpxvideo_debug.h"
+#include "videoplaybackcontrolscontroller.h"
+#include "videoplaybackdetailsplaybackwindow.h"
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDetailsPlaybackWindow::VideoPlaybackDetailsPlaybackWindow
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackDetailsPlaybackWindow::VideoPlaybackDetailsPlaybackWindow(
+ VideoPlaybackControlsController* controller )
+ : mController( controller )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackDetailsPlaybackWindow::VideoPlaybackDetailsPlaybackWindow()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDetailsPlaybackWindow::~VideoPlaybackDetailsPlaybackWindow
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackDetailsPlaybackWindow::~VideoPlaybackDetailsPlaybackWindow()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackDetailsPlaybackWindow::~VideoPlaybackDetailsPlaybackWindow()"));
+}
+
+//End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testdocumentloader/stub/src/videoplaybackfiledetailswidget.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -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: Implementation of VideoPlaybackFileDetailsWidget
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+#include "mpxvideo_debug.h"
+#include "videoplaybackfiledetailswidget.h"
+#include "videoplaybackcontrolscontroller.h"
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFileDetailsWidget::VideoPlaybackFileDetailsWidget
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackFileDetailsWidget::VideoPlaybackFileDetailsWidget(
+ VideoPlaybackControlsController* controller )
+ : mController( controller )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackFileDetailsWidget::VideoPlaybackFileDetailsWidget()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFileDetailsWidget::~VideoPlaybackFileDetailsWidget
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackFileDetailsWidget::~VideoPlaybackFileDetailsWidget()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackFileDetailsWidget::~VideoPlaybackFileDetailsWidget()"));
+
+}
+
+//End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testdocumentloader/testdocumentloader.pro Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,43 @@
+#
+# 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: Project file for building testdocumentloader
+#
+#
+# Version : %version: 7 %
+
+TEMPLATE = app
+TARGET = testdocumentloader
+CONFIG += qtestlib qt hb
+
+INCLUDEPATH += stub/inc \
+ ../../../../inc \
+ ../../../inc
+
+
+DEPENDPATH += inc src stub/inc stub/src
+
+# Input
+HEADERS += testdocumentloader.h \
+ videoplaybackcontrolscontroller.h \
+ videoplaybackfiledetailswidget.h \
+ videoplaybackdetailsplaybackwindow.h \
+ videoplaybackcontrolbar.h \
+ ../../controlinc/videoplaybackdocumentloader.h
+
+SOURCES += testdocumentloader.cpp \
+ videoplaybackcontrolscontroller.cpp \
+ videoplaybackfiledetailswidget.cpp \
+ videoplaybackdetailsplaybackwindow.cpp \
+ videoplaybackcontrolbar.cpp \
+ ../../controlsrc/videoplaybackdocumentloader.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testfiledetailswidget/inc/testfiledetailswidget.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,88 @@
+/**
+* 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: tester for methods in TestFileDetailsWidget
+*
+*/
+
+// Version : %version: 3 %
+
+#ifndef __TESTFILEDETAILSWIDGET_H__
+#define __TESTFILEDETAILSWIDGET_H__
+
+
+// INCLUDES
+#include <QtTest/QtTest>
+
+class VideoPlaybackFileDetailsWidget;
+class VideoPlaybackControlsController;
+class QDateTime;
+
+class TestFileDetailsWidget : public QObject
+{
+ Q_OBJECT
+
+ public:
+
+ /**
+ * will be called before each testfunction is executed.
+ *
+ */
+ void init();
+
+ /**
+ * will be called after every testfunction.
+ *
+ */
+ void cleanup();
+
+ // test functions for the test framework
+ private slots:
+
+ // the order in which these testXX methods are declared is important
+ // changing this order will affect the test results
+ void testTitle();
+ void testDescription();
+ void testDuration();
+ void testDate();
+ void testLocation();
+ void testAuthor();
+ void testCopyright();
+ void testLanguage();
+ void testKeywords();
+ void testSize();
+ void testResolution();
+ void testFormat();
+ void testBitrate();
+ void testFolder();
+
+ private:
+ void verifyResult( QString primaryText,
+ bool exist,
+ QString expectedSecondaryText = "",
+ bool needToBeCompared = true );
+
+ QString dateTimeStringFormat( QDateTime dateTime );
+
+ signals:
+ void commandSignal(int);
+
+ private:
+ VideoPlaybackFileDetailsWidget* mWidget;
+ VideoPlaybackControlsController* mController;
+};
+
+
+#endif // __TESTVIDEOPLAYBACKFILEDETAILSWIDGET_H__
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testfiledetailswidget/src/testfiledetailswidget.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,611 @@
+/**
+* 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: tester for methods in TestFileDetailsWidget
+*
+*/
+
+// Version : %version: 5 %
+
+
+#include <QDateTime>
+#include <QFileInfo>
+
+#include <hbmainwindow.h>
+#include <hbapplication.h>
+#include <hblistwidget.h>
+#include <hblistwidgetitem.h>
+#include <hbextendedlocale.h>
+
+#include "videoplaybackviewfiledetails.h"
+#include "videoplaybackcontrolscontroller.h"
+#include "testfiledetailswidget.h"
+
+#define private public
+#include "videoplaybackfiledetailswidget.h"
+#undef private
+
+const QString KFILEPATH = "C:\\sample1.wav";
+
+
+// ---------------------------------------------------------------------------
+// main
+// ---------------------------------------------------------------------------
+//
+int main(int argc, char *argv[])
+{
+ MPX_ENTER_EXIT(_L("TestFileDetailsWidget::Main()"));
+
+ HbApplication app(argc, argv);
+ HbMainWindow window;
+
+ TestFileDetailsWidget tv;
+
+ char *pass[3];
+ pass[0] = argv[0];
+ pass[1] = "-o";
+ pass[2] = "c:\\data\\testfiledetailswidget.txt";
+
+ int res = QTest::qExec(&tv, 3, pass);
+
+ return res;
+}
+
+
+// ---------------------------------------------------------------------------
+// init
+// ---------------------------------------------------------------------------
+//
+void TestFileDetailsWidget::init()
+{
+ MPX_ENTER_EXIT(_L("TestFileDetailsWidget::init()"));
+
+ mController = new VideoPlaybackControlsController();
+ mWidget = new VideoPlaybackFileDetailsWidget( mController );
+}
+
+// ---------------------------------------------------------------------------
+// cleanup
+// ---------------------------------------------------------------------------
+//
+void TestFileDetailsWidget::cleanup()
+{
+ MPX_ENTER_EXIT(_L("TestFileDetailsWidget::cleanup()"));
+
+ if ( mController )
+ {
+ delete mController;
+ mController = NULL;
+ }
+
+ if ( mWidget )
+ {
+ delete mWidget;
+ mWidget = NULL;
+ }
+}
+
+// ---------------------------------------------------------------------------
+// testTitle
+// ---------------------------------------------------------------------------
+//
+void TestFileDetailsWidget::testTitle()
+{
+ MPX_ENTER_EXIT(_L("TestFileDetailsWidget::testTitle()"));
+
+ init();
+
+ VideoPlaybackViewFileDetails *details = mController->fileDetails();
+
+ //
+ // For Audio only view
+ //
+ mController->mViewMode = EAudioOnlyView;
+
+ // If title information is available
+ details->mTitle = "Title for Test clip";
+ mWidget->updateWithFileDetails( details );
+ verifyResult( "Title", true, details->mTitle );
+
+ mWidget->mListWidget->clear();
+ mWidget->mFileDetailsUpdated = false;
+
+ // If title informatio is not available
+ details->mTitle = "";
+ details->mClipName = KFILEPATH;
+
+ mWidget->updateWithFileDetails( details );
+ verifyResult( "Title", true, "sample1" );
+
+ mWidget->mListWidget->clear();
+ mWidget->mFileDetailsUpdated = false;
+
+ //
+ // For Details view
+ //
+ mController->mViewMode = EFullScreenView;
+
+ mWidget->updateWithFileDetails( details );
+
+ verifyResult( "Title", false );
+
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testDescription
+// ---------------------------------------------------------------------------
+//
+void TestFileDetailsWidget::testDescription()
+{
+ MPX_ENTER_EXIT(_L("TestFileDetailsWidget::testDescription()"));
+
+ init();
+
+ VideoPlaybackViewFileDetails *details = mController->fileDetails();
+ details->mDescription = "This is for unit test";
+
+ mWidget->updateWithFileDetails( details );
+
+ verifyResult( "Description", true, details->mDescription );
+
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testDate
+// ---------------------------------------------------------------------------
+//
+void TestFileDetailsWidget::testDuration()
+{
+ MPX_ENTER_EXIT(_L("TestFileDetailsWidget::testDuration()"));
+
+ init();
+
+ VideoPlaybackViewFileDetails *details = mController->fileDetails();
+
+ //
+ // If it's local mode, need to show the duration
+ //
+ details->mPlaybackMode = EMPXVideoLocal;
+ details->mDuration = 3700000;
+
+ mWidget->updateWithFileDetails( details );
+
+ verifyResult( "Duration", true, "1 hr 1 min 40 sec" );
+
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testDate
+// ---------------------------------------------------------------------------
+//
+void TestFileDetailsWidget::testDate()
+{
+ MPX_ENTER_EXIT(_L("TestFileDetailsWidget::testDate()"));
+
+ init();
+
+ VideoPlaybackViewFileDetails *details = mController->fileDetails();
+
+ QDateTime dateTime;
+ QString created("");
+ QString modified("");
+ details->mClipName = KFILEPATH;
+ QFileInfo fileInfo( details->mClipName );
+
+ //
+ // If it is streaming case, we don't show size information
+ //
+ details->mPlaybackMode = EMPXVideoStreaming;
+ mWidget->updateWithFileDetails( details );
+
+ //
+ // verify results for streaming clip
+ //
+ verifyResult( "Date", false );
+ verifyResult( "Modified", false );
+
+ //
+ // clear the widget list
+ //
+ mWidget->mListWidget->clear();
+ mWidget->mFileDetailsUpdated = false;
+
+ //
+ // local clip, with no date/time metadata
+ //
+ details->mPlaybackMode = EMPXVideoLocal;
+ mWidget->updateWithFileDetails( details );
+
+ //
+ // compare and verify 'Date' for non-metadata local clip
+ //
+ dateTime = fileInfo.created();
+ created = dateTimeStringFormat( dateTime );
+ verifyResult( "Date", true, created, true );
+
+ //
+ // compare and verify 'Modified' for non-metadata local clip
+ //
+ dateTime = fileInfo.lastModified();
+ modified = dateTimeStringFormat( dateTime );
+ verifyResult( "Modified", true, modified, true );
+
+ //
+ // clear the widget list
+ //
+ mWidget->mListWidget->clear();
+ mWidget->mFileDetailsUpdated = false;
+
+ //
+ // local clip, with date/time metadata
+ //
+ details->mPlaybackMode = EMPXVideoLocal;
+ details->mCreationTime = 1242367251; // POSIX creation time
+ details->mModificationTime = 1270773249; // POSIX modification time
+ mWidget->updateWithFileDetails( details );
+
+ //
+ // compare and verify 'Date' for metadata local clip
+ //
+ dateTime.setTime_t( details->mCreationTime );
+ created = dateTimeStringFormat( dateTime );
+ verifyResult( "Date", true, created, true );
+
+ //
+ // compare and verify 'Modified' for metadata local clip
+ //
+ dateTime.setTime_t( details->mModificationTime );
+ modified = dateTimeStringFormat( dateTime );
+ verifyResult( "Modified", true, modified, true );
+
+ //
+ // clean up
+ //
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testLocation
+// ---------------------------------------------------------------------------
+//
+void TestFileDetailsWidget::testLocation()
+{
+ MPX_ENTER_EXIT(_L("TestFileDetailsWidget::testLocation()"));
+
+ init();
+
+ VideoPlaybackViewFileDetails *details = mController->fileDetails();
+ details->mLocation = "C:\\data\\Videos\\";
+
+ mWidget->updateWithFileDetails( details );
+
+ verifyResult( "Location", true, details->mLocation );
+
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testAuthor
+// ---------------------------------------------------------------------------
+//
+void TestFileDetailsWidget::testAuthor()
+{
+ MPX_ENTER_EXIT(_L("TestFileDetailsWidget::testAuthor()"));
+
+ init();
+
+ VideoPlaybackViewFileDetails *details = mController->fileDetails();
+ details->mArtist = "Fusion";
+
+ mWidget->updateWithFileDetails( details );
+
+ verifyResult( "Author", true, details->mArtist );
+
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testCopyright
+// ---------------------------------------------------------------------------
+//
+void TestFileDetailsWidget::testCopyright()
+{
+ MPX_ENTER_EXIT(_L("TestFileDetailsWidget::testCopyright()"));
+
+ init();
+
+ VideoPlaybackViewFileDetails *details = mController->fileDetails();
+ details->mCopyright = "Fusion team";
+
+ mWidget->updateWithFileDetails( details );
+
+ verifyResult( "Copyright", true, details->mCopyright );
+
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testLanguage
+// ---------------------------------------------------------------------------
+//
+void TestFileDetailsWidget::testLanguage()
+{
+ MPX_ENTER_EXIT(_L("TestFileDetailsWidget::testLanguage()"));
+
+ init();
+
+ VideoPlaybackViewFileDetails *details = mController->fileDetails();
+ details->mLanguage = "English";
+
+ mWidget->updateWithFileDetails( details );
+
+ verifyResult( "Language", true, details->mLanguage );
+
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testKeywords
+// ---------------------------------------------------------------------------
+//
+void TestFileDetailsWidget::testKeywords()
+{
+ MPX_ENTER_EXIT(_L("TestFileDetailsWidget::testKeywords()"));
+
+ init();
+
+ VideoPlaybackViewFileDetails *details = mController->fileDetails();
+ details->mKeywords = "QTest";
+
+ mWidget->updateWithFileDetails( details );
+
+ verifyResult( "Keywords", true, details->mKeywords );
+
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testSize
+// ---------------------------------------------------------------------------
+//
+void TestFileDetailsWidget::testSize()
+{
+ MPX_ENTER_EXIT(_L("TestFileDetailsWidget::testSize()"));
+
+ init();
+
+ VideoPlaybackViewFileDetails *details = mController->fileDetails();
+
+ //
+ // If it is streaming case, we don't show size information
+ //
+ details->mPlaybackMode = EMPXVideoStreaming;
+ details->mClipName = KFILEPATH;
+
+ mWidget->updateWithFileDetails( details );
+
+ verifyResult( "Size", false );
+
+ mWidget->mListWidget->clear();
+ mWidget->mFileDetailsUpdated = false;
+
+ //
+ // If it is local, we show size information
+ //
+ details->mPlaybackMode = EMPXVideoLocal;
+ mWidget->updateWithFileDetails( details );
+
+ verifyResult( "Size", true, "", false );
+
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testResolution
+// ---------------------------------------------------------------------------
+//
+void TestFileDetailsWidget::testResolution()
+{
+ MPX_ENTER_EXIT(_L("TestFileDetailsWidget::testResolution()"));
+
+ init();
+
+ VideoPlaybackViewFileDetails *details = mController->fileDetails();
+
+ //
+ // If it is audio only clip, don't need to show resolution
+ //
+ details->mVideoEnabled = false;
+
+ mWidget->updateWithFileDetails( details );
+
+ verifyResult( "Resolution", false );
+
+ mWidget->mListWidget->clear();
+ mWidget->mFileDetailsUpdated = false;
+
+ //
+ // If it has video track
+ //
+ details->mVideoEnabled = true;
+ details->mVideoWidth = 640;
+ details->mVideoHeight = 360;
+
+ mWidget->updateWithFileDetails( details );
+
+ QString resolution = QString("%1x%2")
+ .arg( details->mVideoWidth ).arg( details->mVideoHeight );
+
+ verifyResult( "Resolution", true, resolution );
+
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testFormat
+// ---------------------------------------------------------------------------
+//
+void TestFileDetailsWidget::testFormat()
+{
+ MPX_ENTER_EXIT(_L("TestFileDetailsWidget::testFormat()"));
+
+ init();
+
+ VideoPlaybackViewFileDetails *details = mController->fileDetails();
+ details->mMimeType = "Nothing";
+
+ mWidget->updateWithFileDetails( details );
+
+ verifyResult( "Format", true, details->mMimeType );
+
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testBitrate
+// ---------------------------------------------------------------------------
+//
+void TestFileDetailsWidget::testBitrate()
+{
+ MPX_ENTER_EXIT(_L("TestFileDetailsWidget::testBitrate()"));
+
+
+ init();
+
+ VideoPlaybackViewFileDetails *details = mController->fileDetails();
+ details->mBitRate = 512;
+
+ mWidget->updateWithFileDetails( details );
+
+ verifyResult( "Bitrate", true, "512 kbps" );
+
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testFolder
+// ---------------------------------------------------------------------------
+//
+void TestFileDetailsWidget::testFolder()
+{
+ MPX_ENTER_EXIT(_L("TestFileDetailsWidget::testFolder()"));
+
+ init();
+
+ VideoPlaybackViewFileDetails *details = mController->fileDetails();
+
+ //
+ // If it is streaming case, we don't show folder information
+ //
+ details->mPlaybackMode = EMPXVideoStreaming;
+ details->mClipName = KFILEPATH;
+
+ mWidget->updateWithFileDetails( details );
+
+ verifyResult( "Collection", false );
+
+ mWidget->mListWidget->clear();
+ mWidget->mFileDetailsUpdated = false;
+
+ //
+ // If it is local case, we show folder information
+ //
+ details->mPlaybackMode = EMPXVideoLocal;
+
+ mWidget->updateWithFileDetails( details );
+
+ verifyResult( "Collection", false );
+
+ cleanup();
+
+}
+
+// ---------------------------------------------------------------------------
+// verifyResult
+// ---------------------------------------------------------------------------
+//
+void TestFileDetailsWidget::verifyResult(
+ QString primaryText, bool exist, QString expectedSecondaryText, bool needToBeCompared )
+{
+ MPX_DEBUG(_L("TestFileDetailsWidget::verifyResult(%s, %d, %s, %d)"),
+ primaryText.data(), exist, expectedSecondaryText.data(), needToBeCompared );
+
+ QString secondaryText = "";
+ int i = 0;
+
+ for( ; i < mWidget->mListWidget->count() ; i++ )
+ {
+ HbListWidgetItem *item = mWidget->mListWidget->item( i );
+
+ if ( item->text() == primaryText )
+ {
+ secondaryText = item->secondaryText();
+ break;
+ }
+ }
+
+ //
+ // If the item needs to be existed in HbListWidget, check the result
+ //
+ if ( exist )
+ {
+ if ( needToBeCompared )
+ {
+ MPX_DEBUG(_L("TestFileDetailsWidget::verifyResult() : secondaryText(%s)"),
+ secondaryText.data() );
+
+ QVERIFY( expectedSecondaryText == secondaryText );
+ }
+ else
+ {
+ MPX_DEBUG(_L("TestFileDetailsWidget::verifyResult() : i(%d) count(%d)"),
+ i, mWidget->mListWidget->count() );
+
+ //
+ // Doens't need to compare the secondary text. Just make sure it's in the list
+ //
+ QVERIFY( i < mWidget->mListWidget->count() );
+ }
+
+ }
+ //
+ // If not, just make sure that item is not in the list
+ //
+ else
+ {
+ QVERIFY( i == mWidget->mListWidget->count() );
+ }
+}
+
+
+// -------------------------------------------------------------------------------------------------
+// dateTimeStringFormat
+// -------------------------------------------------------------------------------------------------
+//
+QString TestFileDetailsWidget::dateTimeStringFormat( QDateTime dateTime )
+{
+ HbExtendedLocale locale = HbExtendedLocale::system();
+ QString date = locale.format( dateTime.date(), r_qtn_date_usual );
+ QString time = locale.format( dateTime.time(), r_qtn_time_long_with_zero );
+ QString dateTimeString( date + " " + time );
+
+ MPX_DEBUG(_L("TestFileDetailsWidget::dateTimeStringFormat() ret '%s'"),
+ dateTimeString.data() );
+
+ return dateTimeString;
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testfiledetailswidget/stub/inc/hbglobal.h Thu Jul 08 13:05:19 2010 +0300
@@ -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: class for HbGlobal
+*
+*/
+
+// Version : %version: 1 %
+
+
+
+#ifndef HBGLOBAL_H
+#define HBGLOBAL_H
+
+#include <QtGlobal>
+
+#ifdef BUILD_HB_CORE
+# define HB_CORE_EXPORT Q_DECL_EXPORT
+# define HB_CORE_PRIVATE_EXPORT Q_DECL_EXPORT
+#else
+# define HB_CORE_EXPORT Q_DECL_IMPORT
+# define HB_CORE_PRIVATE_EXPORT Q_DECL_IMPORT
+#endif // BUILD_HB_CORE
+
+#ifdef BUILD_HB_WIDGETS
+# define HB_WIDGETS_EXPORT Q_DECL_EXPORT
+# define HB_WIDGETS_PRIVATE_EXPORT Q_DECL_EXPORT
+#else
+# define HB_WIDGETS_EXPORT Q_DECL_IMPORT
+# define HB_WIDGETS_PRIVATE_EXPORT Q_DECL_IMPORT
+#endif // BUILD_HB_WIDGETS
+
+
+QString hbTrId( QString string, int n = -1 );
+
+
+#endif // HBGLOBAL_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testfiledetailswidget/stub/inc/videoplaybackcontrolscontroller.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,156 @@
+/*
+* 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 VideoPlaybackControlsController
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+#ifndef VIDEOPLAYBACKCONTROLSCONTROLLER_H_
+#define VIDEOPLAYBACKCONTROLSCONTROLLER_H_
+
+// INCLUDES
+#include <qobject>
+#include <mpxplaybackframeworkdefs.h>
+
+#include "mpxvideo_debug.h"
+#include "mpxhelixplaybackplugindefs.h"
+#include "mpxcommonvideoplaybackview.hrh"
+#include "videoplaybackviewfiledetails.h"
+
+// FORWARD DECLARATIONS
+class VideoPlaybackDocumentLoader;
+
+
+// DATA TYPES
+
+enum TTimerAction
+{
+ ETimerCancel,
+ ETimerReset
+};
+
+enum TPlaybackViewMode
+{
+ EFullScreenView,
+ EDetailsView,
+ EAudioOnlyView
+};
+
+const QString KPLAYBACKVIEW_DOCML = ":/videoplaybackview/videoplaybackview.docml";
+
+// CLASS DECLARATION
+
+class VideoPlaybackControlsController : public QObject
+{
+ Q_OBJECT
+
+ public:
+
+ /**
+ * constructor.
+ */
+ VideoPlaybackControlsController();
+
+ /**
+ * Destructor.
+ */
+ virtual ~VideoPlaybackControlsController();
+
+ public:
+
+ /**
+ * Command handling function.
+ * Call HandleCommandL() of container
+ */
+ void handleCommand( TMPXVideoPlaybackViewCommandIds command, int value = 0 );
+
+ /**
+ * Reset or cancel timers for the controls
+ */
+ void resetDisappearingTimers( TTimerAction timerAction );
+
+ /**
+ * Return state
+ */
+ inline TMPXPlaybackState state();
+
+ /**
+ * Return file details
+ */
+ inline VideoPlaybackViewFileDetails* fileDetails();
+
+ inline VideoPlaybackDocumentLoader* layoutLoader();
+
+ TPlaybackViewMode viewMode();
+
+ void changeViewMode( TPlaybackViewMode viewMode, bool transitionEffect = true );
+
+ public:
+ VideoPlaybackViewFileDetails *mFileDetails;
+ VideoPlaybackDocumentLoader *mLoader;
+
+ TMPXPlaybackState mState;
+ TPlaybackViewMode mViewMode;
+ TTimerAction mTimerAction;
+ TMPXVideoPlaybackViewCommandIds mCommand;
+ int mCommandValue;
+};
+
+// INLINE METHODS
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::state
+// -------------------------------------------------------------------------------------------------
+//
+inline
+TMPXPlaybackState VideoPlaybackControlsController::state()
+{
+ return mState;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::fileDetails
+// -------------------------------------------------------------------------------------------------
+//
+inline
+VideoPlaybackViewFileDetails* VideoPlaybackControlsController::fileDetails()
+{
+ return mFileDetails;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::layoutLoader
+// -------------------------------------------------------------------------------------------------
+//
+inline
+VideoPlaybackDocumentLoader* VideoPlaybackControlsController::layoutLoader()
+{
+ return mLoader;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::viewMode
+// -------------------------------------------------------------------------------------------------
+//
+inline
+TPlaybackViewMode VideoPlaybackControlsController::viewMode()
+{
+ return mViewMode;
+}
+
+#endif /*VIDEOPLAYBACKCONTROLSCONTROLLER_P_H_*/
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testfiledetailswidget/stub/inc/videoplaybackdocumentloader.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,52 @@
+/*
+* 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 VideoPlaybackDocumentLoader
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+#ifndef VIDEOPLAYBACKDOCUMENTHANDLER_H_
+#define VIDEOPLAYBACKDOCUMENTHANDLER_H_
+
+
+#include <qobject>
+
+class QList;
+class QGraphicsWidget;
+class VideoPlaybackControlsController;
+
+class VideoPlaybackDocumentLoader : public QObject
+{
+ public:
+ VideoPlaybackDocumentLoader();
+
+ virtual ~VideoPlaybackDocumentLoader();
+
+ public:
+ QGraphicsWidget* findWidget( const QString &name );
+ void load( const QString &fileName, const QString §ion , bool *ok );
+
+ private:
+ QGraphicsWidget* createWidget( const QString &name );
+ int exist( const QString &name );
+
+ private:
+ QList<QGraphicsWidget*> mWidgets;
+};
+
+#endif /*VIDEOPLAYBACKDOCUMENTHANDLER_H_*/
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testfiledetailswidget/stub/inc/videoplaybackviewfiledetails.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,86 @@
+/*
+* 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: Video File Details (QT)
+*
+*/
+
+// Version : %version: 4 %
+
+
+
+
+#ifndef __VIDEOPLAYBACKVIEWFILEDETAILS__
+#define __VIDEOPLAYBACKVIEWFILEDETAILS__
+
+#include <qobject.h>
+#include "mpxhelixplaybackplugindefs.h"
+
+
+//
+// CLASS DECLARATION
+//
+class VideoPlaybackViewFileDetails : public QObject
+{
+ public:
+ //
+ // Constructor
+ //
+ VideoPlaybackViewFileDetails();
+
+ //
+ // Destructor.
+ //
+ virtual ~VideoPlaybackViewFileDetails();
+
+ //
+ // Clear all file details
+ //
+ void clearFileDetails();
+
+ public:
+ //
+ // Data
+ //
+ QString mClipName;
+ QString mTitle;
+ QString mArtist;
+ QString mMimeType;
+ QString mDescription;
+ QString mLocation;
+ QString mCopyright;
+ QString mLanguage;
+ QString mKeywords;
+
+ TMPXVideoMode mPlaybackMode;
+ bool mSeekable;
+ bool mPausableStream;
+ bool mAudioEnabled;
+ bool mVideoEnabled;
+ bool mPartialPlayback;
+ bool mRNFormat;
+ bool mTvOutConnected;
+ bool mDrmProtected;
+ bool mMultiItemPlaylist;
+
+ int mVideoHeight;
+ int mVideoWidth;
+ int mBitRate;
+ int mDuration;
+ int mCreationTime;
+ int mModificationTime;
+};
+
+#endif // __VIDEOPLAYBACKVIEWFILEDETAILS__
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testfiledetailswidget/stub/src/hbglobal.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,124 @@
+/*
+* 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: class for HbGlobal
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+#include "hbglobal.h"
+#include <qstring>
+
+
+QString hbTrId( QString string, int n )
+{
+ Q_UNUSED( n );
+
+ QString loc = "";
+
+ if ( string == "txt_videos_list_description" )
+ {
+ loc = "Description";
+ }
+ else if ( string == "txt_videos_list_duration" )
+ {
+ loc = "Duration";
+ }
+ else if ( string == "txt_videos_list_date" )
+ {
+ loc = "Date";
+ }
+ else if ( string == "txt_videos_list_modified" )
+ {
+ loc = "Modified";
+ }
+ else if ( string == "txt_videos_list_location" )
+ {
+ loc = "Location";
+ }
+ else if ( string == "txt_videos_list_author" )
+ {
+ loc = "Author";
+ }
+ else if ( string == "txt_videos_list_copyright" )
+ {
+ loc = "Copyright";
+ }
+ else if ( string == "txt_videos_list_language" )
+ {
+ loc = "Language";
+ }
+ else if ( string == "txt_videos_list_keywords" )
+ {
+ loc = "Keywords";
+ }
+ else if ( string == "txt_videos_list_resolution" )
+ {
+ loc = "Resolution";
+ }
+ else if ( string == "txt_videos_list_format" )
+ {
+ loc = "Format";
+ }
+ else if ( string == "txt_videos_list_collection_name" )
+ {
+ loc = "Collection";
+ }
+ else if ( string == "txt_videos_list_title" )
+ {
+ loc = "Title";
+ }
+ else if ( string == "txt_videos_list_file_size" )
+ {
+ loc = "Size";
+ }
+ else if ( string == "txt_videos_list_bitrate" )
+ {
+ loc = "Bitrate";
+ }
+ else if ( string == "txt_videos_list_l1l2l3" )
+ {
+ loc = "%L1 hr %L2 min %L3 sec";
+ }
+ else if ( string == "txt_videos_list_l1_kb" )
+ {
+ loc = "%L1 kB";
+ }
+ else if ( string == "txt_videos_list_l1_mb" )
+ {
+ loc = "%L1 MB";
+ }
+ else if ( string == "txt_videos_list_l1_gb" )
+ {
+ loc = "%L1 GB";
+ }
+ else if ( string == "txt_videos_list_l1_kbps" )
+ {
+ loc = "%L1 kbps";
+ }
+ else if ( string == "txt_videos_list_l1_mbps" )
+ {
+ loc = "%L1 Mbps";
+ }
+ else if ( string == "txt_videos_list_l1l2" )
+ {
+ loc = "%L1x%L2";
+ }
+
+ return loc;
+}
+
+//End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testfiledetailswidget/stub/src/videoplaybackcontrolscontroller.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,89 @@
+/*
+* 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 VideoPlaybackControlsController
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+// INCLUDE FILES
+
+
+#include "videoplaybackdocumentloader.h"
+#include "videoplaybackcontrolscontroller.h"
+
+// ================= MEMBER FUNCTIONS ==============================================================
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::VideoPlaybackControlsController()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackControlsController::VideoPlaybackControlsController()
+ : mViewMode( EFullScreenView )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackControlsController::VideoPlaybackControlsController()"));
+
+ mLoader = new VideoPlaybackDocumentLoader();
+ mFileDetails = new VideoPlaybackViewFileDetails();
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::~VideoPlaybackControlsController
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackControlsController::~VideoPlaybackControlsController()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::~VideoPlaybackControlsController"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::handleCommand()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::handleCommand(
+ TMPXVideoPlaybackViewCommandIds command, int value )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::handleCommand(%d)"), command);
+
+ mCommand = command;
+ mCommandValue = value;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::changeViewMode
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::changeViewMode(
+ TPlaybackViewMode viewMode, bool transitionEffect )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::changeViewMode()"));
+
+ Q_UNUSED( transitionEffect );
+ mViewMode = viewMode;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::resetDisappearingTimers()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::resetDisappearingTimers( TTimerAction timerAction )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::resetDisappearingTimers()"));
+
+ mTimerAction = timerAction;
+}
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testfiledetailswidget/stub/src/videoplaybackdocumentloader.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,139 @@
+/*
+* 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 VideoPlaybackDocumentLoader
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+#include <hblistwidget.h>
+
+#include "mpxvideo_debug.h"
+#include "videoplaybackdocumentloader.h"
+
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDocumentLoader::VideoPlaybackDocumentLoader
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackDocumentLoader::VideoPlaybackDocumentLoader()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackDocumentLoader::VideoPlaybackDocumentLoader()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDocumentLoader::~VideoPlaybackDocumentLoader
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackDocumentLoader::~VideoPlaybackDocumentLoader()
+{
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::VideoPlaybackDocumentLoader") );
+
+ for ( int i = 0 ; i < mWidgets.count() ; i++ )
+ {
+ mWidgets.removeAt( 0 );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDocumentLoader::findWidget()
+// -------------------------------------------------------------------------------------------------
+//
+QGraphicsWidget *VideoPlaybackDocumentLoader::findWidget( const QString &name )
+{
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::findWidget") );
+
+ QGraphicsWidget *object = NULL;
+
+ int index = exist( name );
+
+ if ( index == -1 )
+ {
+ object = createWidget( name );
+ }
+ else
+ {
+ object = mWidgets[ index ];
+ }
+
+ return object;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDocumentLoader::createWidget()
+// -------------------------------------------------------------------------------------------------
+//
+QGraphicsWidget *VideoPlaybackDocumentLoader::createWidget( const QString &name )
+{
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::createWidget") );
+
+ QGraphicsWidget *object = NULL;
+
+ if ( name == "fileDetails" )
+ {
+ object = new HbListWidget();
+ object->setObjectName( name );
+ mWidgets.append( object );
+ }
+ else if ( name == "content" )
+ {
+ object = new QGraphicsWidget();
+ object->setObjectName( name );
+ mWidgets.append( object );
+ }
+
+ return object;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDocumentLoader::exist()
+// -------------------------------------------------------------------------------------------------
+//
+int VideoPlaybackDocumentLoader::exist( const QString &name )
+{
+ int i = 0;
+
+ for ( ; i < mWidgets.count() ; i++ )
+ {
+ if( mWidgets[i]->objectName() == name )
+ {
+ break;
+ }
+ }
+
+ if ( i == mWidgets.count() )
+ {
+ i = -1;
+ }
+
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::exist %d"), i );
+
+ return i;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDocumentLoader::load()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackDocumentLoader::load(
+ const QString &fileName, const QString §ion , bool *ok )
+{
+ Q_UNUSED( fileName );
+ Q_UNUSED( section );
+ Q_UNUSED( ok );
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testfiledetailswidget/stub/src/videoplaybackviewfiledetails.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,79 @@
+/*
+* 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: class for Video File Details (Qt)
+*
+*/
+
+// Version : %version: 4 %
+
+
+
+//
+// INCLUDE FILES
+//
+#include "mpxvideo_debug.h"
+#include "videoplaybackviewfiledetails.h"
+
+
+// ============================ MEMBER FUNCTIONS ===================================================
+
+VideoPlaybackViewFileDetails::VideoPlaybackViewFileDetails()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewFileDetails::VideoPlaybackViewFileDetails()"));
+
+ clearFileDetails();
+}
+
+VideoPlaybackViewFileDetails::~VideoPlaybackViewFileDetails()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewFileDetails::~VideoPlaybackViewFileDetails()"));
+
+ clearFileDetails();
+}
+
+void
+VideoPlaybackViewFileDetails::clearFileDetails()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewFileDetails::ClearFileDetails()"));
+
+ mMimeType = tr("");
+ mTitle = tr("");
+ mArtist = tr("");
+ mClipName = tr("");
+ mDescription = tr("");
+ mLocation = tr("");
+ mCopyright = tr("");
+ mLanguage = tr("");
+ mKeywords = tr("");
+
+ mPlaybackMode = EMPXVideoLocal;
+ mSeekable = false;
+ mPausableStream = false;
+ mAudioEnabled = false;
+ mVideoEnabled = false;
+ mPartialPlayback = false;
+ mRNFormat = false;
+
+ mDuration = 0;
+ mTvOutConnected = false;
+ mDrmProtected = false;
+
+ mVideoHeight = 0;
+ mVideoWidth = 0;
+ mBitRate = 0;
+ mCreationTime = 0;
+ mModificationTime = 0;
+}
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testfiledetailswidget/testfiledetailswidget.pro Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,42 @@
+#
+# 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: Project file for building testfiledetailswidget
+#
+#
+# Version : %version: 3 %
+
+TEMPLATE = app
+TARGET = testfiledetailswidget
+CONFIG += qtestlib qt hb
+
+INCLUDEPATH += stub/inc \
+ ../../../../inc \
+ ../../../inc
+
+DEPENDPATH += inc src stub/inc stub/src
+
+# Input
+HEADERS += testfiledetailswidget.h \
+ videoplaybackcontrolscontroller.h \
+ videoplaybackdocumentloader.h \
+ videoplaybackviewfiledetails.h \
+ hbglobal.h \
+ ../../controlinc/videoplaybackfiledetailswidget.h
+
+SOURCES += testfiledetailswidget.cpp \
+ videoplaybackcontrolscontroller.cpp \
+ videoplaybackdocumentloader.cpp \
+ videoplaybackviewfiledetails.cpp \
+ hbglobal.cpp \
+ ../../controlsrc/videoplaybackfiledetailswidget.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testfullscreencontrol/inc/testfullscreencontrol.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,82 @@
+/**
+* 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: test module for VideoPlaybackFullScreenControl
+*
+*/
+
+#ifndef __TESTFULLSCREENCONTROL_H__
+#define __TESTFULLSCREENCONTROL_H__
+
+
+// INCLUDES
+#include <QtTest/QtTest>
+
+#include "videoplaybackcontrol.hrh"
+
+
+class VideoPlaybackControlsController;
+class VideoPlaybackFullScreenControl;
+
+
+
+class TestFullScreenControl : public QObject
+{
+ Q_OBJECT
+
+ public:
+
+ /**
+ * will be called before each testfunction is executed.
+ *
+ */
+ void init();
+
+ /**
+ * will be called after every testfunction.
+ *
+ */
+ void cleanup();
+
+ // test functions for the test framework
+ void setup( TVideoPlaybackControls control );
+
+ void createControl( TVideoPlaybackControls control );
+
+ private slots:
+
+ void testControlIndex();
+
+ void testDurationChanged();
+
+ void testPositionChanged();
+
+ void testAspectRatioChanged();
+
+ void testUpdateState();
+
+ void testUpdateControlsWithFileDetails();
+
+ void testUpdateControlProperties();
+
+ signals:
+ void commandSignal(int);
+
+ private:
+ VideoPlaybackControlsController* mControlsController;
+ VideoPlaybackFullScreenControl* mFullScreenControl;
+};
+
+#endif // __TESTFULLSCREENCONTROL_H__
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testfullscreencontrol/src/testfullscreencontrol.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,282 @@
+/**
+* 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: tester for methods in VideoPlaybackFullScreenControl
+*
+*/
+
+// Version : %version: 4 %
+
+
+#include <hbapplication.h>
+#include <hbinstance.h>
+#include <qdebug>
+
+#include "mpxhelixplaybackplugindefs.h"
+
+#include "testfullscreencontrol.h"
+
+#include "videoplaybackviewfiledetails.h"
+#include "videoplaybackcontrolscontroller.h"
+#include "videoplaybackcontrolbar.h"
+
+
+#define private public
+#define protected public
+#include "videoplaybackfullscreencontrol.h"
+#undef protected
+#undef private
+
+
+// ---------------------------------------------------------------------------
+// main
+// ---------------------------------------------------------------------------
+//
+int main(int argc, char *argv[])
+{
+ MPX_ENTER_EXIT(_L("TestFullScreenControl::Main()"));
+
+ HbApplication app(argc, argv);
+ HbMainWindow window;
+
+ TestFullScreenControl tv;
+
+ char *pass[3];
+ pass[0] = argv[0];
+ pass[1] = "-o";
+ pass[2] = "c:\\data\\testfullscreencontrol.txt";
+
+ int res = QTest::qExec(&tv, 3, pass);
+
+ return res;
+}
+
+// ---------------------------------------------------------------------------
+// init
+// ---------------------------------------------------------------------------
+//
+void TestFullScreenControl::init()
+{
+ MPX_ENTER_EXIT(_L("TestFullScreenControl::init()"));
+}
+
+// ---------------------------------------------------------------------------
+// setup
+// ---------------------------------------------------------------------------
+//
+void TestFullScreenControl::setup( TVideoPlaybackControls control )
+{
+ MPX_ENTER_EXIT(_L("TestFullScreenControl::setup()"));
+
+
+ mControlsController = new VideoPlaybackControlsController();
+
+ createControl( control );
+}
+
+// ---------------------------------------------------------------------------
+// createControl
+// ---------------------------------------------------------------------------
+//
+void TestFullScreenControl::createControl( TVideoPlaybackControls control )
+{
+ MPX_ENTER_EXIT(_L("TestFullScreenControl::createControl()"));
+
+ switch ( control )
+ {
+ case EStatusPane:
+ {
+ mFullScreenControl = new VideoPlaybackFullScreenControl( mControlsController,
+ control,
+ NULL,
+ 0 );
+ break;
+ }
+ case EControlBar:
+ {
+ VideoPlaybackControlBar *controlBar =
+ new VideoPlaybackControlBar( mControlsController );
+
+ mFullScreenControl = new VideoPlaybackFullScreenControl( mControlsController,
+ control,
+ controlBar,
+ 0 );
+
+ break;
+ }
+ case EDetailsViewPlaybackWindow:
+ {
+ break;
+ }
+ }
+}
+
+// ---------------------------------------------------------------------------
+// cleanup
+// ---------------------------------------------------------------------------
+//
+void TestFullScreenControl::cleanup()
+{
+ MPX_ENTER_EXIT(_L("TestFullScreenControl::cleanup()"));
+
+ if ( mControlsController )
+ {
+ delete mControlsController;
+ mControlsController = NULL;
+ }
+
+ if ( mFullScreenControl )
+ {
+ delete mFullScreenControl;
+ mFullScreenControl = NULL;
+ }
+}
+
+// ---------------------------------------------------------------------------
+// testControlIndex
+// ---------------------------------------------------------------------------
+//
+void TestFullScreenControl::testControlIndex()
+{
+ MPX_ENTER_EXIT(_L("TestFullScreenControl::testControlIndex()"));
+
+ setup( EStatusPane );
+
+ QVERIFY( mFullScreenControl->controlIndex() == EStatusPane );
+}
+
+// ---------------------------------------------------------------------------
+// testDurationChanged
+// ---------------------------------------------------------------------------
+//
+void TestFullScreenControl::testDurationChanged()
+{
+ MPX_ENTER_EXIT(_L("TestFullScreenControl::testDurationChanged()"));
+
+ // test for progress bar
+ delete mFullScreenControl;
+ mFullScreenControl = NULL;
+ setup( EControlBar );
+ QVERIFY( mFullScreenControl->durationChanged( 100 ) );
+ QVERIFY( static_cast<VideoPlaybackControlBar*>(mFullScreenControl->mControl)->mDuration == 100 );
+
+ // test for something other than progress bar
+ delete mFullScreenControl;
+ mFullScreenControl = NULL;
+ setup( EStatusPane );
+ QVERIFY( ! mFullScreenControl->durationChanged( 100 ) );
+
+}
+
+// ---------------------------------------------------------------------------
+// testPositionChanged
+// ---------------------------------------------------------------------------
+//
+void TestFullScreenControl::testPositionChanged()
+{
+ MPX_ENTER_EXIT(_L("TestFullScreenControl::testPositionChanged()"));
+
+ // test for progress bar
+ delete mFullScreenControl;
+ mFullScreenControl = NULL;
+ setup( EControlBar );
+ QVERIFY( mFullScreenControl->positionChanged( 100 ) );
+ QVERIFY( static_cast<VideoPlaybackControlBar*>(mFullScreenControl->mControl)->mPosition == 100 );
+
+ // test for something other than progress bar
+ delete mFullScreenControl;
+ mFullScreenControl = NULL;
+ setup( EStatusPane );
+ QVERIFY( ! mFullScreenControl->positionChanged( 100 ) );
+}
+
+// ---------------------------------------------------------------------------
+// testAspectRatioChanged
+// ---------------------------------------------------------------------------
+//
+void TestFullScreenControl::testAspectRatioChanged()
+{
+ MPX_ENTER_EXIT(_L("TestFullScreenControl::testAspectRatioChanged()"));
+
+ // test for button bar
+ delete mFullScreenControl;
+ mFullScreenControl = NULL;
+ setup( EControlBar );
+ QVERIFY( mFullScreenControl->aspectRatioChanged( 3 ) ); // EMMFNatural
+ QVERIFY( static_cast<VideoPlaybackControlBar*>(mFullScreenControl->mControl)->mAspectRatio == 3 );
+
+ // test for something other than button bar
+ delete mFullScreenControl;
+ mFullScreenControl = NULL;
+ setup( EStatusPane );
+ QVERIFY( ! mFullScreenControl->aspectRatioChanged( 3 ) ); // EMMFNatural
+}
+
+// ---------------------------------------------------------------------------
+// testUpdateState
+// ---------------------------------------------------------------------------
+//
+void TestFullScreenControl::testUpdateState()
+{
+ MPX_ENTER_EXIT(_L("TestFullScreenControl::testUpdateState()"));
+
+ delete mFullScreenControl;
+ mFullScreenControl = NULL;
+ setup( EControlBar );
+ mFullScreenControl->updateState( EPbStatePaused );
+ QVERIFY( static_cast<VideoPlaybackControlBar*>(mFullScreenControl->mControl)->mState == EPbStatePaused );
+}
+
+// ---------------------------------------------------------------------------
+// testUpdateControlsWithFileDetails
+// ---------------------------------------------------------------------------
+//
+void TestFullScreenControl::testUpdateControlsWithFileDetails()
+{
+ MPX_ENTER_EXIT(_L("TestFullScreenControl::testUpdateControlsWithFileDetails()"));
+
+ VideoPlaybackViewFileDetails *fileDetails = new VideoPlaybackViewFileDetails();
+
+ setup( EControlBar );
+
+ fileDetails->mPausableStream = true;
+
+ mFullScreenControl->updateControlsWithFileDetails( fileDetails );
+
+ QVERIFY( static_cast<VideoPlaybackControlBar*>(mFullScreenControl->mControl)->mFileDetails->mPausableStream );
+
+ if ( fileDetails )
+ {
+ delete fileDetails;
+ fileDetails = NULL;
+ }
+}
+
+// ---------------------------------------------------------------------------
+// testUpdateControlProperties
+// ---------------------------------------------------------------------------
+//
+void TestFullScreenControl::testUpdateControlProperties()
+{
+ MPX_ENTER_EXIT(_L("TestFullScreenControl::testUpdateControlProperties()"));
+
+ setup( EStatusPane );
+
+ mFullScreenControl->updateControlProperties( 1 );
+
+ QVERIFY( mFullScreenControl != NULL );
+
+ QVERIFY( mFullScreenControl->mProperties == 1 );
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testfullscreencontrol/stub/inc/videoplaybackcontrolbar.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,57 @@
+/*
+* 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 VideoPlaybackControlBar
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+#ifndef VIDEOPLAYBACKCONTROLBAR_H_
+#define VIDEOPLAYBACKCONTROLBAR_H_
+
+
+
+#include <hbwidget.h>
+#include <mpxplaybackframeworkdefs.h>
+
+class VideoPlaybackViewFileDetails;
+class VideoPlaybackControlsController;
+
+class VideoPlaybackControlBar : public HbWidget
+{
+ Q_OBJECT
+
+ public:
+ VideoPlaybackControlBar( VideoPlaybackControlsController* controller );
+ virtual ~VideoPlaybackControlBar();
+ void updateState( TMPXPlaybackState state );
+ void aspectRatioChanged( int aspectRatio );
+ void updateWithFileDetails( VideoPlaybackViewFileDetails* details );
+ void setVisibleToControlBar( bool visible );
+ void durationChanged( int duration );
+ void positionChanged( int position );
+
+ public:
+ VideoPlaybackControlsController *mController;
+ int mPosition;
+ int mDuration;
+ int mAspectRatio;
+ bool mVisibility;
+ TMPXPlaybackState mState;
+ VideoPlaybackViewFileDetails *mFileDetails;
+};
+
+#endif /*VIDEOPLAYBACKCONTROLBAR_H_*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testfullscreencontrol/stub/inc/videoplaybackcontrolscontroller.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,62 @@
+/*
+* 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 VideoPlaybackControlsController
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+#ifndef VIDEOPLAYBACKCONTROLSCONTROLLER_H_
+#define VIDEOPLAYBACKCONTROLSCONTROLLER_H_
+
+// INCLUDES
+#include <qobject>
+
+
+#include "mpxvideo_debug.h"
+#include "mpxcommonvideoplaybackview.hrh"
+
+// CLASS DECLARATION
+
+class VideoPlaybackControlsController : public QObject
+{
+ Q_OBJECT
+
+ public:
+
+ /**
+ * constructor.
+ */
+ VideoPlaybackControlsController();
+
+ /**
+ * Destructor.
+ */
+ virtual ~VideoPlaybackControlsController();
+
+ public:
+
+ /**
+ * Command handling function.
+ * Call HandleCommandL() of container
+ */
+ void handleCommand( TMPXVideoPlaybackViewCommandIds command, int value = 0 );
+};
+
+
+#endif /*VIDEOPLAYBACKCONTROLSCONTROLLER_P_H_*/
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testfullscreencontrol/stub/inc/videoplaybackdetailsplaybackwindow.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,46 @@
+/*
+* 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 VideoPlaybackDetailsPlaybackWindow
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+#ifndef VIDEOPLAYBACKDETAILSPLAYBACKWINDOW_H_
+#define VIDEOPLAYBACKDETAILSPLAYBACKWINDOW_H_
+
+#include <hbwidget.h>
+#include <mpxplaybackframeworkdefs.h>
+
+
+class VideoPlaybackControlsController;
+
+class VideoPlaybackDetailsPlaybackWindow : public HbWidget
+{
+ Q_OBJECT
+
+ public:
+ VideoPlaybackDetailsPlaybackWindow( VideoPlaybackControlsController* controller );
+ virtual ~VideoPlaybackDetailsPlaybackWindow();
+ void updateState( TMPXPlaybackState state );
+
+ private:
+ VideoPlaybackControlsController *mController;
+ bool mInitialized;
+};
+
+#endif /*VIDEOPLAYBACKDETAILSPLAYBACKWINDOW_H_*/
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testfullscreencontrol/stub/inc/videoplaybackfiledetailswidget.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,50 @@
+/*
+* 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 VideoPlaybackFileDetailsWidget
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+#ifndef VIDEOPLAYBACKFILEDETAILSWIDGET_H_
+#define VIDEOPLAYBACKFILEDETAILSWIDGET_H_
+
+#include <hbwidget.h>
+#include <hbstyleloader.h>
+
+class VideoPlaybackViewFileDetails;
+class VideoPlaybackControlsController;
+class HbListWidget;
+
+class VideoPlaybackFileDetailsWidget : public HbWidget
+{
+ Q_OBJECT
+
+ public:
+ VideoPlaybackFileDetailsWidget( VideoPlaybackControlsController* controller );
+ virtual ~VideoPlaybackFileDetailsWidget();
+
+ void updateWithFileDetails( VideoPlaybackViewFileDetails* details );
+
+ private:
+ VideoPlaybackControlsController *mController;
+ HbListWidget *mListWidget;
+ bool mFileDetailsUpdated;
+
+};
+
+#endif /*VIDEOPLAYBACKFILEDETAILSWIDGET_H_*/
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testfullscreencontrol/stub/inc/videoplaybackviewfiledetails.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,84 @@
+/*
+* 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: Video File Details (QT)
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+
+#ifndef __VIDEOPLAYBACKVIEWFILEDETAILS__
+#define __VIDEOPLAYBACKVIEWFILEDETAILS__
+
+#include <qobject.h>
+#include "mpxhelixplaybackplugindefs.h"
+
+
+//
+// CLASS DECLARATION
+//
+class VideoPlaybackViewFileDetails : public QObject
+{
+ public:
+ //
+ // Constructor
+ //
+ VideoPlaybackViewFileDetails();
+
+ //
+ // Destructor.
+ //
+ virtual ~VideoPlaybackViewFileDetails();
+
+ //
+ // Clear all file details
+ //
+ void clearFileDetails();
+
+ public:
+ //
+ // Data
+ //
+ QString mClipName;
+ QString mTitle;
+ QString mArtist;
+ QString mMimeType;
+ QString mDescription;
+ QString mLocation;
+ QString mCopyright;
+ QString mLanguage;
+ QString mKeywords;
+
+ TMPXVideoMode mPlaybackMode;
+ bool mSeekable;
+ bool mPausableStream;
+ bool mAudioEnabled;
+ bool mVideoEnabled;
+ bool mPartialPlayback;
+ bool mRNFormat;
+ bool mTvOutConnected;
+ bool mDrmProtected;
+ bool mMultiItemPlaylist;
+
+ int mVideoHeight;
+ int mVideoWidth;
+ int mBitRate;
+ int mDuration;
+};
+
+#endif // __VIDEOPLAYBACKVIEWFILEDETAILS__
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testfullscreencontrol/stub/src/hblabel.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,58 @@
+/*
+* 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 HbLabel
+*
+*/
+
+// Version : %version: 1 %
+
+
+#include "hblabel.h"
+
+// -------------------------------------------------------------------------------------------------
+// HbPushButton::HbPushButton
+// -------------------------------------------------------------------------------------------------
+//
+HbLabel::HbLabel()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbLabel::~HbLabel
+// -------------------------------------------------------------------------------------------------
+//
+HbLabel::~HbLabel()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbLabel::setVisible
+// -------------------------------------------------------------------------------------------------
+//
+void HbLabel::setVisible( bool visible )
+{
+ mVisible = visible;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbLabel::isVisible
+// -------------------------------------------------------------------------------------------------
+//
+bool HbLabel::isVisible()
+{
+ return mVisible;
+}
+
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testfullscreencontrol/stub/src/videoplaybackcontrolbar.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,119 @@
+/*
+* 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 VideoPlaybackControlBar
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+#include <hbframeitem.h>
+#include <hbframedrawer.h>
+
+#include "mpxvideo_debug.h"
+#include "videoplaybackcontrolbar.h"
+#include "mpxcommonvideoplaybackview.hrh"
+#include "videoplaybackcontrolscontroller.h"
+
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlBar::VideoPlaybackControlBar()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackControlBar::VideoPlaybackControlBar(
+ VideoPlaybackControlsController* controller )
+ : mController( controller )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackControlBar::VideoPlaybackControlBar"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlBar::~VideoPlaybackControlBar()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackControlBar::~VideoPlaybackControlBar()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlBar::~VideoPlaybackControlBar()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlBar::updateState()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlBar::updateState( TMPXPlaybackState state )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlBar::updateState() state = %d"), state );
+
+ mState = state;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlBar::aspectRatioChanged()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlBar::aspectRatioChanged( int aspectRatio )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlBar::aspectRatioChanged() aspectRatio = %d"), aspectRatio );
+
+ mAspectRatio = aspectRatio;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlBar::updateWithFileDetails()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlBar::updateWithFileDetails(
+ VideoPlaybackViewFileDetails* details )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlBar::updateWithFileDetails()"));
+
+ mFileDetails = details;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlBar::setVisibleToControlBar()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlBar::setVisibleToControlBar( bool visible )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlBar::setVisibleToControlBar()"));
+
+ mVisibility = visible;
+}
+
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlBar::durationChanged()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlBar::durationChanged( int duration )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlBar::durationChanged()"));
+
+ mDuration = duration;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlBar::positionChanged()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlBar::positionChanged( int position )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlBar::positionChanged()"));
+
+ mPosition = position;
+}
+
+//End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testfullscreencontrol/stub/src/videoplaybackcontrolscontroller.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,68 @@
+/*
+* 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 VideoPlaybackControlsController
+*
+*/
+
+// Version : %version: 5 %
+
+
+
+// INCLUDE FILES
+#include <coecntrl.h>
+#include <bautils.h>
+#include <barsread.h>
+#include <f32file.h>
+
+#include <hblabel.h>
+#include <hbaction.h>
+#include <hbiconanimator.h>
+
+#include "../inc/videoplaybackviewfiledetails.h"
+#include "../inc/videoplaybackcontrolscontroller.h"
+
+#include "videoplaybackcontrolconfiguration.h"
+
+
+// ================= MEMBER FUNCTIONS ==============================================================
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::VideoPlaybackControlsController()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackControlsController::VideoPlaybackControlsController()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::~VideoPlaybackControlsController
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackControlsController::~VideoPlaybackControlsController()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::~VideoPlaybackControlsController"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::handleCommand()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::handleCommand(
+ TMPXVideoPlaybackViewCommandIds command, int value )
+{
+ Q_UNUSED( command );
+ Q_UNUSED( value );
+}
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testfullscreencontrol/stub/src/videoplaybackdetailsplaybackwindow.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,63 @@
+/*
+* 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 VideoPlaybackProgressBar
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+#include <qfileinfo>
+#include <qgraphicsscenemouseevent>
+
+#include <hblabel.h>
+#include <hbpushbutton.h>
+
+#include "mpxvideo_debug.h"
+#include "videoplaybackcontrolscontroller.h"
+#include "videoplaybackdetailsplaybackwindow.h"
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDetailsPlaybackWindow::VideoPlaybackDetailsPlaybackWindow
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackDetailsPlaybackWindow::VideoPlaybackDetailsPlaybackWindow(
+ VideoPlaybackControlsController* controller )
+ : mController( controller )
+ , mInitialized( false )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackDetailsPlaybackWindow::VideoPlaybackDetailsPlaybackWindow()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDetailsPlaybackWindow::~VideoPlaybackDetailsPlaybackWindow
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackDetailsPlaybackWindow::~VideoPlaybackDetailsPlaybackWindow()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackDetailsPlaybackWindow::~VideoPlaybackDetailsPlaybackWindow()"));
+}
+
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDetailsPlaybackWindow::updateState()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackDetailsPlaybackWindow::updateState( TMPXPlaybackState state )
+{
+ MPX_DEBUG(_L("VideoPlaybackDetailsPlaybackWindow::updateState() state = %d"), state );
+}
+
+//End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testfullscreencontrol/stub/src/videoplaybackfiledetailswidget.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,71 @@
+/*
+* 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 VideoPlaybackFileDetailsWidget
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+#include <qfileinfo>
+#include <qgraphicslinearlayout>
+#include <qdatetime>
+#include <qdir>
+
+#include <hblistwidgetitem.h>
+#include <hbratingslider.h>
+#include <hblistwidget.h>
+
+#include "mpxvideo_debug.h"
+#include "videoplaybackfiledetailswidget.h"
+#include "videoplaybackcontrolscontroller.h"
+
+const float KILOBYTE = 1024 ;
+const QString KDATETIMEFORMAT = "d/M/yyyy hh:mm:ss ap";
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFileDetailsWidget::VideoPlaybackFileDetailsWidget
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackFileDetailsWidget::VideoPlaybackFileDetailsWidget(
+ VideoPlaybackControlsController* controller )
+ : mController( controller )
+ , mListWidget( 0 )
+ , mFileDetailsUpdated( false )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackFileDetailsWidget::VideoPlaybackFileDetailsWidget()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFileDetailsWidget::~VideoPlaybackFileDetailsWidget
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackFileDetailsWidget::~VideoPlaybackFileDetailsWidget()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackFileDetailsWidget::~VideoPlaybackFileDetailsWidget()"));
+
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFileDetailsWidget::updateControlsWithFileDetails
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackFileDetailsWidget::updateWithFileDetails(
+ VideoPlaybackViewFileDetails* details )
+{
+ Q_UNUSED( details );
+}
+
+//End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testfullscreencontrol/stub/src/videoplaybackviewfiledetails.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,77 @@
+/*
+* 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: class for Video File Details (Qt)
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+//
+// INCLUDE FILES
+//
+#include "mpxvideo_debug.h"
+#include "videoplaybackviewfiledetails.h"
+
+
+// ============================ MEMBER FUNCTIONS ===================================================
+
+VideoPlaybackViewFileDetails::VideoPlaybackViewFileDetails()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewFileDetails::VideoPlaybackViewFileDetails()"));
+
+ clearFileDetails();
+}
+
+VideoPlaybackViewFileDetails::~VideoPlaybackViewFileDetails()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewFileDetails::~VideoPlaybackViewFileDetails()"));
+
+ clearFileDetails();
+}
+
+void
+VideoPlaybackViewFileDetails::clearFileDetails()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewFileDetails::ClearFileDetails()"));
+
+ mMimeType = tr("");
+ mTitle = tr("");
+ mArtist = tr("");
+ mClipName = tr("");
+ mDescription = tr("");
+ mLocation = tr("");
+ mCopyright = tr("");
+ mLanguage = tr("");
+ mKeywords = tr("");
+
+ mPlaybackMode = EMPXVideoLocal;
+ mSeekable = false;
+ mPausableStream = false;
+ mAudioEnabled = false;
+ mVideoEnabled = false;
+ mPartialPlayback = false;
+ mRNFormat = false;
+
+ mDuration = 0;
+ mTvOutConnected = false;
+ mDrmProtected = false;
+
+ mVideoHeight = 0;
+ mVideoWidth = 0;
+ mBitRate = 0;
+}
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testfullscreencontrol/testfullscreencontrol.pro Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,52 @@
+#
+# 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: Project file for building testfullscreencontrol
+#
+#
+# Version : %version: 4 %
+
+
+TEMPLATE = app
+TARGET = testfullscreencontrol
+CONFIG += qtestlib hb qt
+
+DEPENDPATH += . \
+ inc \
+ src
+
+INCLUDEPATH += stub/inc \
+ ../inc \
+ ../../inc \
+ ../../../inc \
+ ../../../../inc \
+
+DEPENDPATH += stub/inc stub/src inc src
+
+# Input
+HEADERS += ../../../controlinc/videoplaybackfullscreencontrol.h \
+ inc/testfullscreencontrol.h \
+ videoplaybackcontrolscontroller.h \
+ videoplaybackviewfiledetails.h \
+ videoplaybackcontrolbar.h \
+ videoplaybackfiledetailswidget.h \
+ videoplaybackdetailsplaybackwindow.h
+
+
+SOURCES += ../../../controlsrc/videoplaybackfullscreencontrol.cpp \
+ src/testfullscreencontrol.cpp \
+ videoplaybackcontrolscontroller.cpp \
+ videoplaybackviewfiledetails.cpp \
+ videoplaybackcontrolbar.cpp \
+ videoplaybackfiledetailswidget.cpp \
+ videoplaybackdetailsplaybackwindow.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testmpxvideoviewwrapper/inc/testmpxvideoviewwrapper.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,85 @@
+/**
+* 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: tester for methods in Video Playback View Plugin
+*
+*/
+
+#ifndef __TESTMPXVIDEOVIEWWRAPPER_H__
+#define __TESTMPXVIDEOVIEWWRAPPER_H__
+
+
+// INCLUDES
+#include <QtTest/QtTest>
+
+class CMPXVideoViewWrapper;
+class VideoBasePlaybackView;
+
+class TestMPXVideoViewWrapper : public QObject
+{
+ Q_OBJECT
+
+ public:
+
+ /**
+ * will be called before each testfunction is executed.
+ *
+ */
+ void init();
+
+ /**
+ * will be called after every testfunction.
+ *
+ */
+ void cleanup();
+
+ 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();
+ void testHandleCommand();
+ void testHandlePluginError();
+ void testHandlePlaybackMessage();
+ void testSetProperty();
+ void testHandleProperty();
+ void testRetrieveFileNameAndMode();
+ void testActivateClosePlayerActiveObject();
+ void testDoClosePlayer();
+ void testSetAspectRatio();
+ void testIsAppInFront();
+ void testClosePlaybackView();
+ void testHandleVolumeCmd();
+ void testHandleShortPressBackward();
+ void testIssueVideoAppForegroundCmd();
+ void testCreateControls();
+ void testIsMultiItemPlaylist();
+ void testUpdateVideoRect();
+ void testUpdateVideoRectDone();
+ void testHandleBufferingState();
+ void testHandleVideoPlaybackMessage();
+ void testHandlePlaybackCommandComplete();
+ void testHandleMedia();
+
+ signals:
+ void commandSignal(int);
+
+ private:
+ CMPXVideoViewWrapper *mVideoViewWrapper;
+ VideoBasePlaybackView *mBaseVideoView;
+};
+
+#endif // __TESTMPXVIDEOVIEWWRAPPER_H__
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testmpxvideoviewwrapper/src/testmpxvideoviewwrapper.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,962 @@
+/**
+* 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: tester for methods in VideoSortFilterProxyModel
+*
+*/
+
+// Version : %version: 13 %
+
+#include <e32err.h>
+#include <w32std.h>
+
+#include <hbapplication.h>
+#include <hbinstance.h>
+#include <QDebug>
+
+#include <mpxplaybackframeworkdefs.h>
+#include <mpxplaybackutility.h>
+#include <mpxcommonvideoplaybackview.hrh>
+#include <mpxmessagegeneraldefs.h>
+#include <mpxplaybackmessage.h>
+#include <mpxmediageneraldefs.h>
+#include <mpxmediavideodefs.h>
+#include <vcxmyvideosuids.h>
+#include <mpxmediageneralextdefs.h>
+
+#include "mpxcollectionutility.h"
+#include "mpxcollectionplaylist.h"
+#include "testmpxvideoviewwrapper.h"
+
+#include "../stub/inc/videobaseplaybackview.h"
+#include "../stub/inc/videoplaybackviewfiledetails.h"
+#include "../stub/inc/mpxvideoplaybackdisplayhandler.h"
+#include "../stub/inc/videoplaybackcontrolscontroller.h"
+
+
+#define protected public
+#include "mpxvideoviewwrapper.h"
+#undef protected
+
+
+// ---------------------------------------------------------------------------
+// main
+// ---------------------------------------------------------------------------
+//
+int main(int argc, char *argv[])
+{
+ HbApplication app(argc, argv);
+ HbMainWindow window;
+
+ TestMPXVideoViewWrapper tv;
+
+ char *pass[3];
+ pass[0] = argv[0];
+ pass[1] = "-o";
+ pass[2] = "c:\\data\\testmpxvideoviewwrapper.txt";
+
+ int res = QTest::qExec(&tv, 3, pass);
+
+ return res;
+}
+
+// ---------------------------------------------------------------------------
+// init
+// ---------------------------------------------------------------------------
+//
+void TestMPXVideoViewWrapper::init()
+{
+ mBaseVideoView = new VideoBasePlaybackView();
+ TRAPD( err, mVideoViewWrapper = CMPXVideoViewWrapper::NewL( mBaseVideoView ) );
+ QVERIFY( err == KErrNone );
+}
+
+// ---------------------------------------------------------------------------
+// cleanup
+// ---------------------------------------------------------------------------
+//
+void TestMPXVideoViewWrapper::cleanup()
+{
+ if ( mVideoViewWrapper )
+ {
+ delete mVideoViewWrapper;
+ mVideoViewWrapper = NULL;
+ }
+
+ if ( mBaseVideoView )
+ {
+ delete mBaseVideoView;
+ mBaseVideoView = NULL;
+ }
+}
+
+void TestMPXVideoViewWrapper::testRequestMedia()
+{
+ init();
+
+ //
+ // If iMediaRequestStatus is not MediaNotRequested, doesn't request media
+ //
+ mVideoViewWrapper->iMediaRequestStatus = MediaDelivered;
+ TRAPD(err, mVideoViewWrapper->RequestMediaL());
+ QVERIFY( err == KErrNone );
+ QVERIFY( mVideoViewWrapper->iMediaRequestStatus == MediaDelivered );
+
+ //
+ // If iState is not EPbStateInitialised, doesn't request media
+ //
+ mVideoViewWrapper->iMediaRequestStatus = MediaNotRequested;
+ mVideoViewWrapper->iPlaybackUtility->iState = EPbStatePluginSeeking;
+
+ TRAP(err, mVideoViewWrapper->RequestMediaL());
+ QVERIFY( err == KErrNone );
+ QVERIFY( mVideoViewWrapper->iMediaRequestStatus == MediaNotRequested );
+
+ //
+ // If it is not playlist case, request playback media
+ //
+ mVideoViewWrapper->iPlaylistView = false;
+ mVideoViewWrapper->iMediaRequestStatus = MediaNotRequested;
+ mVideoViewWrapper->iPlaybackUtility->iState = EPbStateInitialised;
+
+ TRAP(err, mVideoViewWrapper->RequestMediaL());
+ QVERIFY( err == KErrNone );
+ QVERIFY( mVideoViewWrapper->iMediaRequestStatus == MediaRequested );
+ QVERIFY( ! mVideoViewWrapper->iCollectionMediaRequested );
+
+ //
+ // If it is playlist case && there isn't in memory plugin, request playback media
+ //
+ mVideoViewWrapper->iPlaylistView = true;
+ mVideoViewWrapper->iMediaRequestStatus = MediaNotRequested;
+ mVideoViewWrapper->iPlaybackUtility->iState = EPbStateInitialised;
+ mVideoViewWrapper->iCollectionUtility->Collection().iUid = TUid::Uid( KVcxUidMyVideosMpxCollection );
+
+ TRAP(err, mVideoViewWrapper->RequestMediaL());
+ QVERIFY( err == KErrNone );
+ QVERIFY( mVideoViewWrapper->iMediaRequestStatus == MediaRequested );
+ QVERIFY( ! mVideoViewWrapper->iCollectionMediaRequested );
+
+ //
+ // If it is playlist case && there is in memory plugin, request collection media
+ //
+ mVideoViewWrapper->iPlaylistView = true;
+ mVideoViewWrapper->iMediaRequestStatus = MediaNotRequested;
+ mVideoViewWrapper->iPlaybackUtility->iState = EPbStateInitialised;
+ mVideoViewWrapper->iCollectionUtility->Collection().iUid = TUid::Uid( KMpxInMemoryPluginUid );
+
+ TRAP(err, mVideoViewWrapper->RequestMediaL());
+ QVERIFY( err == KErrNone );
+ QVERIFY( mVideoViewWrapper->iMediaRequestStatus == MediaRequested );
+ QVERIFY( mVideoViewWrapper->iCollectionMediaRequested );
+
+ cleanup();
+}
+
+void TestMPXVideoViewWrapper::testIsLive()
+{
+ init();
+
+ TRAPD(err, mVideoViewWrapper->RequestMediaL());
+ QVERIFY( err == KErrNone );
+
+ mVideoViewWrapper->iFileDetails->mPlaybackMode = EMPXVideoLiveStreaming;
+ QVERIFY( mVideoViewWrapper->IsLive() );
+
+ mVideoViewWrapper->iFileDetails->mPlaybackMode = EMPXVideoLocal;
+ QVERIFY( ! mVideoViewWrapper->IsLive() );
+
+ cleanup();
+}
+
+void TestMPXVideoViewWrapper::testIsPlaylist()
+{
+ init();
+
+ mVideoViewWrapper->iPlaylistView = true;
+ QVERIFY( mVideoViewWrapper->IsPlaylist() == true );
+
+ mVideoViewWrapper->iPlaylistView = false;
+ QVERIFY( mVideoViewWrapper->IsPlaylist() == false );
+
+ cleanup();
+}
+
+void TestMPXVideoViewWrapper::testHandleCommand()
+{
+ init();
+
+ TRAPD( errReqMedia, mVideoViewWrapper->RequestMediaL() );
+ QVERIFY( errReqMedia == KErrNone );
+
+ //
+ // Test 'Play' command
+ //
+ TRAPD( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdPlay ) );
+ QVERIFY( errHdlCmd == KErrNone );
+ QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdPlay );
+
+ //
+ // 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 );
+
+ //
+ // 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
+ //
+ mVideoViewWrapper->iPlaybackState = EPbStatePlaying;
+ TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdPlayPause ) );
+ QVERIFY( errHdlCmd == KErrNone );
+ QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdPause );
+
+ mVideoViewWrapper->iPlaybackState = EPbStatePaused;
+ TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdPlayPause ) );
+ QVERIFY( errHdlCmd == KErrNone );
+ QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdPlay );
+
+ //
+ // 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 );
+
+ //
+ // 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
+ //
+ mVideoViewWrapper->iPlaylistView = false;
+ 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;
+ mVideoViewWrapper->iView->mStayPaused = false;
+ TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdRealOneBitmapTimeout ) );
+ QVERIFY( errHdlCmd == KErrNone );
+ QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdPlay );
+
+ cleanup();
+}
+
+void TestMPXVideoViewWrapper::testHandlePluginError()
+{
+ init();
+
+ TRAPD(errReqMedia, mVideoViewWrapper->RequestMediaL());
+ QVERIFY( errReqMedia == KErrNone );
+
+ mVideoViewWrapper->HandlePluginError( KErrNotSupported );
+
+ QVERIFY( mVideoViewWrapper->iView->mCurrentError == KErrNotSupported );
+
+ cleanup();
+}
+
+void TestMPXVideoViewWrapper::testHandlePlaybackMessage()
+{
+ init();
+
+ //***************************
+ // Test Video Msg
+ //***************************
+ CMPXMessage* message = NULL;
+ TRAP_IGNORE(
+ message = CMPXMessage::NewL();
+ message->SetTObjectValueL<TMPXMessageId>( KMPXMessageGeneralId, KMPXMediaIdVideoPlayback );
+ message->SetTObjectValueL<TMPXVideoPlaybackCommand>
+ ( KMPXMediaVideoPlaybackCommand, EPbCmdTvOutEvent );
+ message->SetTObjectValueL<TInt>( KMPXMediaVideoTvOutConnected, ETrue );
+ );
+ mVideoViewWrapper->HandlePlaybackMessage( message, KErrNone );
+ QVERIFY( mVideoViewWrapper->iFileDetails->mTvOutConnected );
+ if ( message )
+ {
+ delete message;
+ message = NULL;
+ }
+
+ //***************************
+ // Test General Msg
+ //***************************
+ TRAP_IGNORE(
+ message = CMPXMessage::NewL();
+ message->SetTObjectValueL<TMPXMessageId>( KMPXMessageGeneralId, KMPXMessageGeneral );
+ message->SetTObjectValueL<TInt>( KMPXMessageGeneralEvent, 28 ); // EReachedEndOfPlaylist = 28
+ message->SetTObjectValueL<TInt>( KMPXMessageGeneralType, 0 );
+ message->SetTObjectValueL<TInt>( KMPXMessageGeneralData, 0 );
+ );
+ mVideoViewWrapper->HandlePlaybackMessage( message, KErrNone );
+ QVERIFY( ! mVideoViewWrapper->iView->mViewActive );
+ if ( message )
+ {
+ delete message;
+ message = NULL;
+ }
+
+ //***************************
+ // Test Video Msg with err
+ //***************************
+ TRAP_IGNORE( message = CMPXMessage::NewL() );
+ mVideoViewWrapper->HandlePlaybackMessage( message, KErrNotFound );
+ QVERIFY( mVideoViewWrapper->iView->mCurrentError == KErrNotFound );
+ if ( message )
+ {
+ delete message;
+ message = NULL;
+ }
+
+ cleanup();
+}
+
+void TestMPXVideoViewWrapper::testSetProperty()
+{
+ init();
+
+ 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 );
+
+ //
+ // Duration
+ //
+ int value = 5000;
+ TRAPD(errHdlProp, mVideoViewWrapper->HandlePropertyL( EPbPropertyDuration, value, KErrNone ) );
+ QVERIFY( errHdlProp == KErrNone );
+
+ QVERIFY( mVideoViewWrapper->iControlsController->mReceivedEvent == EControlCmdSetDuration );
+ QVERIFY( mVideoViewWrapper->iControlsController->mValue == value );
+
+ //
+ // Position
+ //
+ value = 500;
+
+ TRAP(errHdlProp, mVideoViewWrapper->HandlePropertyL( EPbPropertyPosition, value, KErrNone ) );
+ QVERIFY( errHdlProp == KErrNone );
+
+ QVERIFY( mVideoViewWrapper->iControlsController->mReceivedEvent == EControlCmdSetPosition );
+ QVERIFY( mVideoViewWrapper->iControlsController->mValue == value );
+
+ //
+ // Volume
+ //
+ value = 10;
+
+ TRAP(errHdlProp, mVideoViewWrapper->HandlePropertyL( EPbPropertyVolume, value, KErrNone ) );
+ QVERIFY( errHdlProp == KErrNone );
+
+ QVERIFY( mVideoViewWrapper->iControlsController->mReceivedEvent == EControlCmdSetVolume );
+ QVERIFY( mVideoViewWrapper->iControlsController->mValue == value );
+
+ //
+ // Mute
+ //
+ value = 1;
+
+ TRAP(errHdlProp, mVideoViewWrapper->HandlePropertyL( EPbPropertyMute, value, KErrNone ) );
+ QVERIFY( errHdlProp == KErrNone );
+
+ QVERIFY( mVideoViewWrapper->iControlsController->mReceivedEvent == EControlCmdSetVolume );
+ QVERIFY( mVideoViewWrapper->iControlsController->mValue == 0 );
+
+ cleanup();
+}
+
+void TestMPXVideoViewWrapper::testRetrieveFileNameAndMode()
+{
+ init();
+
+ mVideoViewWrapper->iFileDetails->clearFileDetails();
+
+ CMPXCommand* cmd = NULL;
+
+ TRAP_IGNORE( cmd = CMPXCommand::NewL() );
+
+ 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->DoClosePlayer());
+ QVERIFY( err == KErrNone );
+
+ QVERIFY( ! mVideoViewWrapper->iView->mViewActive );
+
+ cleanup();
+}
+
+void TestMPXVideoViewWrapper::testSetAspectRatio()
+{
+ init();
+ TRAPD( errReqMedia, mVideoViewWrapper->RequestMediaL() );
+ QVERIFY( errReqMedia == KErrNone );
+
+ TRAPD( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdStretchAspectRatio ) );
+ QVERIFY( errHdlCmd == KErrNone );
+
+ 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() );
+
+ 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() );
+ QVERIFY( errReqMedia == KErrNone );
+
+ TRAPD( errIssuePlay, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdPlay ) );
+ QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdPlay );
+ QVERIFY( errIssuePlay == KErrNone );
+
+ 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() );
+ QVERIFY( errReqMedia == KErrNone );
+
+ TRAPD( errIssuePlay, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdPlay ) );
+ QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdPlay );
+ QVERIFY( errIssuePlay == KErrNone );
+
+ mVideoViewWrapper->iPlaylistView = false;
+
+ 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() );
+ QVERIFY( errReqMedia == KErrNone );
+
+ TRAPD( errIssuePlay, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdPlay ) );
+ QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdPlay );
+
+ QVERIFY( errIssuePlay == KErrNone );
+
+ //
+ // 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 );
+
+ mVideoViewWrapper->iFileDetails->mMultiItemPlaylist = false;
+ QVERIFY( ! mVideoViewWrapper->IsMultiItemPlaylist() );
+
+ mVideoViewWrapper->iFileDetails->mMultiItemPlaylist = true;
+ QVERIFY( mVideoViewWrapper->IsMultiItemPlaylist() );
+
+ cleanup();
+}
+
+void TestMPXVideoViewWrapper::testUpdateVideoRect()
+{
+ init();
+
+ TRAPD(errReqMedia, mVideoViewWrapper->RequestMediaL());
+ QVERIFY( errReqMedia == KErrNone );
+
+ 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();
+
+ CMPXMessage* message = NULL;
+ TRAP_IGNORE(
+ message = CMPXMessage::NewL();
+ message->SetTObjectValueL<TMPXMessageId>( KMPXMessageGeneralId, KMPXMediaIdVideoPlayback );
+ message->SetTObjectValueL<TMPXVideoPlaybackCommand>
+ ( KMPXMediaVideoPlaybackCommand, EPbCmdPluginError );
+ message->SetTObjectValueL<TInt>( KMPXMediaVideoError, KErrNotSupported );
+ );
+
+ mVideoViewWrapper->HandleVideoPlaybackMessage( message );
+
+ QCOMPARE( mVideoViewWrapper->iView->mCurrentError, KErrNotSupported );
+ if ( message )
+ {
+ delete message;
+ message = NULL;
+ }
+
+ cleanup();
+}
+
+void TestMPXVideoViewWrapper::testHandlePlaybackCommandComplete()
+{
+ init();
+
+ CMPXCommand* cmd = NULL;
+
+ TRAP_IGNORE( cmd = CMPXCommand::NewL() );
+
+ mVideoViewWrapper->HandlePlaybackCommandComplete( cmd, KErrNone );
+
+ QVERIFY( mVideoViewWrapper );
+
+ delete cmd;
+ cmd = NULL;
+
+ cleanup();
+}
+
+void TestMPXVideoViewWrapper::testHandleMedia()
+{
+ init();
+
+ CMPXMedia* media = NULL;
+ mVideoViewWrapper->iCollectionMediaRequested = false;
+
+ //
+ // Handle playback media - Error case
+ //
+ TRAP_IGNORE(
+ RArray<TInt> suppIds;
+ CleanupClosePushL( suppIds );
+ suppIds.AppendL( KMPXMediaIdGeneral );
+ suppIds.AppendL( KMPXMediaIdVideo );
+
+ media = CMPXMedia::NewL( suppIds.Array() );
+ CleanupStack::PopAndDestroy( &suppIds );
+
+ media->SetTObjectValueL<TInt>( TMPXAttribute( KMPXMediaVideoError ), KErrCancel );
+ );
+
+ 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;
+ }
+
+ //
+ // Handle playback media - working case - RN logo is not visible
+ //
+ TRAP_IGNORE(
+ RArray<TInt> 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;
+ mVideoViewWrapper->iView->mStayPaused = false;
+
+ TRAP(err, mVideoViewWrapper->HandleMediaL( *media, KErrNone ) );
+
+ QVERIFY( err == KErrNone );
+ QCOMPARE( mVideoViewWrapper->iView->mCurrentError, KErrNone );
+ QVERIFY( mVideoViewWrapper->iControlsController->mFileDetailsAdded );
+ QVERIFY( mVideoViewWrapper->iControlsController->mReceivedEvent == EControlCmdSetAspectRatio );
+ QVERIFY( mVideoViewWrapper->iControlsController->mValue == EMMFNatural );
+ QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdPlay );
+ QVERIFY( mVideoViewWrapper->iMediaRequestStatus == MediaDelivered );
+
+ if ( media )
+ {
+ delete media;
+ media = NULL;
+ }
+
+ //
+ // working case - re-play after previous termination
+ //
+ TRAP_IGNORE(
+ RArray<TInt> 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;
+ mVideoViewWrapper->iView->mStayPaused = true;
+
+ TRAP(err, mVideoViewWrapper->HandleMediaL( *media, KErrNone ) );
+
+ QVERIFY( err == KErrNone );
+ QCOMPARE( mVideoViewWrapper->iView->mCurrentError, KErrNone );
+ QVERIFY( mVideoViewWrapper->iControlsController->mFileDetailsAdded );
+ QVERIFY( mVideoViewWrapper->iControlsController->mReceivedEvent == EControlCmdSetAspectRatio );
+ QVERIFY( mVideoViewWrapper->iControlsController->mValue == EMMFNatural );
+ QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdPause );
+ QVERIFY( mVideoViewWrapper->iMediaRequestStatus == MediaDelivered );
+
+ if ( media )
+ {
+ delete media;
+ media = NULL;
+ }
+
+ //
+ // Handle playback media - working case - RN logo is visible
+ //
+ TRAP_IGNORE(
+ RArray<TInt> 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 == EControlCmdSetAspectRatio );
+ 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;
+ }
+
+ //
+ // Handle collection media
+ //
+ mVideoViewWrapper->iCollectionMediaRequested = true;
+ bool seekable = true;
+
+ TRAP_IGNORE(
+ RArray<TInt> suppIds;
+ CleanupClosePushL( suppIds );
+ suppIds.AppendL( KMPXMediaIdGeneralExt );
+
+ media = CMPXMedia::NewL( suppIds.Array() );
+ CleanupStack::PopAndDestroy( &suppIds );
+
+ media->SetTObjectValueL<TInt>( TMPXAttribute( KMPXMediaGeneralExtVideoSeekable ), seekable );
+ );
+
+ TRAP(err, mVideoViewWrapper->HandleMediaL( *media, KErrNone ) );
+
+ QVERIFY( err == KErrNone );
+ QVERIFY( ! mVideoViewWrapper->iCollectionMediaRequested );
+ QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdUpdateSeekable );
+
+ if ( media )
+ {
+ delete media;
+ media = NULL;
+ }
+
+ cleanup();
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxcollectionplaylist.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,44 @@
+/*
+* 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: Encapsulates a 'playlist' from a collection
+*
+*/
+
+
+#ifndef CMPXCOLLECTIONPLAYLIST_H
+#define CMPXCOLLECTIONPLAYLIST_H
+
+#include <s32strm.h>
+
+
+class CMPXCollectionPlaylist
+{
+ public:
+ static CMPXCollectionPlaylist* NewL();
+
+ virtual ~CMPXCollectionPlaylist();
+
+ public:
+ TInt Count() const;
+
+ private:
+ CMPXCollectionPlaylist();
+
+ void ConstructL();
+
+ public:
+ TInt iCount;
+};
+
+#endif // CMPXCOLLECTIONPLAYLIST_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxcollectionutility.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,68 @@
+/*
+* 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: Interface to collections
+*
+*/
+
+
+#ifndef MMPXCOLLECTIONUTILITY_H
+#define MMPXCOLLECTIONUTILITY_H
+
+#include <e32cmn.h>
+
+class MMPXCollectionObserver;
+
+class MMPXCollection
+{
+ public:
+ virtual TUid UidL() const = 0;
+
+ public:
+ TUid iUid;
+};
+
+class MMPXCollectionUtility
+{
+ public:
+ static MMPXCollectionUtility* NewL( MMPXCollectionObserver* aObs );
+
+ virtual MMPXCollection& Collection() = 0;
+
+ virtual void Close() = 0;
+};
+
+class CMPXCollectionUtility : public MMPXCollectionUtility,
+ public MMPXCollection
+{
+ public:
+ static CMPXCollectionUtility* NewL( MMPXCollectionObserver* aObs );
+
+ ~CMPXCollectionUtility();
+
+ private:
+ CMPXCollectionUtility( MMPXCollectionObserver* aObs );
+
+ void ConstructL();
+
+ public:
+ MMPXCollection& Collection();
+
+ void Close();
+
+ TUid UidL() const;
+};
+
+#endif //MMPXCOLLECTIONUTILITY_H
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxplaybackutility.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,116 @@
+/*
+* 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: 3 %
+
+#ifndef CMPXPLAYBACKUTILITY_H
+#define CMPXPLAYBACKUTILITY_H
+
+#include <e32base.h>
+#include <mpxcommand.h>
+#include <mpxattributespecs.h>
+#include <mpxplaybackcommanddefs.h>
+#include <mpxplaybackframeworkdefs.h>
+
+class TMPXAttribute;
+class MMPXPlaybackObserver;
+class CMPXCollectionPlaylist;
+class MMPXPlaybackCallback;
+class CMPXPlaybackUtility;
+
+class MMPXSource
+{
+ public:
+ virtual CMPXCollectionPlaylist* PlaylistL() = 0;
+
+ virtual void MediaL( const TArray<TMPXAttribute>& aAttrs,
+ MMPXPlaybackCallback& aCallback,
+ CMPXAttributeSpecs* aSpecs ) = 0;
+
+ virtual void MediaL( const TArray<TMPXAttribute>& aAttrs,
+ MMPXPlaybackCallback& aCallback ) = 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<TMPXAttribute>& aAttrs,
+ MMPXPlaybackCallback& aCallback,
+ CMPXAttributeSpecs* aSpecs );
+
+ void MediaL( const TArray<TMPXAttribute>& aAttrs,
+ MMPXPlaybackCallback& aCallback );
+
+ void SetPrimaryClientL();
+};
+
+#endif // CMPXPLAYBACKUTILITY_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackdisplayhandler.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,85 @@
+/*
+* 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 video playback display handler
+*
+*/
+
+// Version : %version: 7 %
+
+
+#ifndef __CMPXVIDEOPLAYBACKDISPLAYHANDLER_H__
+#define __CMPXVIDEOPLAYBACKDISPLAYHANDLER_H__
+
+// INCLUDES
+
+#include <mpxmessage2.h>
+#include <mmfscalingcustomcommandconstants.h>
+#include <mpxvideoplaybackdefs.h>
+#include <mediaclientvideodisplay.h>
+
+
+//
+// CLASS DECLARATION
+//
+class MMPXPlaybackUtility;
+class CMPXVideoViewWrapper;
+class VideoPlaybackViewFileDetails;
+
+/*
+ * CMPXVideoPlaybackDisplayHandler
+ *
+ */
+class CMPXVideoPlaybackDisplayHandler : public CBase
+{
+ public:
+
+ ~CMPXVideoPlaybackDisplayHandler();
+
+ static CMPXVideoPlaybackDisplayHandler* NewL( MMPXPlaybackUtility* aPlayUtil,
+ CMPXVideoViewWrapper* aViewWrapper );
+
+ void CreateDisplayWindowL( RWsSession& aWs,
+ CWsScreenDevice& aScreenDevice,
+ RWindow& aWin,
+ TRect aDisplayRect );
+
+ void RemoveDisplayWindow();
+
+ void HandleVideoDisplayMessageL( CMPXMessage* aMessage );
+
+ TInt SetAspectRatioL( TMPXVideoPlaybackCommand aCmd );
+
+ TInt SetDefaultAspectRatioL( VideoPlaybackViewFileDetails* aFileDetails,
+ TReal32 aDisplayAspectRatio );
+
+ void UpdateVideoRectL( TRect aRect, TBool transitionEffect );
+
+ private:
+
+ CMPXVideoPlaybackDisplayHandler( MMPXPlaybackUtility* aPlayUtil,
+ CMPXVideoViewWrapper* aViewWrapper );
+
+ void ConstructL();
+
+ public:
+ MMPXPlaybackUtility* iPlaybackUtility;
+ CMPXVideoViewWrapper* iViewWrapper;
+ CMediaClientVideoDisplay* iVideoDisplay;
+
+ TRect iRect;
+ TInt iAspectRatio;
+ TInt iCommand;
+};
+
+#endif // __CMPXVIDEOPLAYBACKDISPLAYHANDLER_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackuserinputhandler.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,76 @@
+/*
+* 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: Implementation of MPXVideoPlaybackUserInputHandler
+*
+*/
+
+// Version : %version: 4 %
+
+
+
+#ifndef MPXVIDEOPLAYBACKUSERINPUTHANDLER_H_
+#define MPXVIDEOPLAYBACKUSERINPUTHANDLER_H_
+
+// INCLUDES
+
+
+// FORWARD DECLARATIONS
+class CMPXVideoViewWrapper;
+
+// CLASS DECLARATION
+
+class CMPXVideoPlaybackUserInputHandler : public CBase
+{
+ public: // Constructors and destructor
+
+ /**
+ * Two-phased constructor.
+ */
+ IMPORT_C static CMPXVideoPlaybackUserInputHandler* NewL(
+ CMPXVideoViewWrapper* aWrapper, TBool aTvOutConnected );
+
+ /**
+ * Destructor.
+ */
+ IMPORT_C virtual ~CMPXVideoPlaybackUserInputHandler();
+
+ private:
+
+ /**
+ * C++ default constructor.
+ */
+ CMPXVideoPlaybackUserInputHandler( CMPXVideoViewWrapper* aWrapper );
+
+ /**
+ * Symbian 2nd phase constructor.
+ */
+ void ConstructL( TBool aTvOutConnected );
+
+ public:
+ void ProcessKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
+
+ void SetForeground( TBool aForeground );
+
+ void HandleTVOutEventL(TBool aTVOutConnected);
+
+ private:
+ TBool iTVOutConnected; // Flag to indicate if TV is connected
+ TBool iForeground;
+ CMPXVideoViewWrapper* iViewWrapper;
+};
+
+
+#endif /*MPXVIDEOPLAYBACKUSERINPUTHANDLER_H_*/
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/videobaseplaybackview.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,102 @@
+/*
+* 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: Video playback view
+*
+*/
+
+// Version : %version: 7 %
+
+
+
+// This file defines the API for .dll
+
+#ifndef __VIDEOBASEPLAYBACKVIEW_H__
+#define __VIDEOBASEPLAYBACKVIEW_H__
+
+// Include Files
+#include <hbview.h>
+
+class CMPXVideoViewWrapper;
+class RWindow;
+
+// Constants
+
+// Forward Declarations
+
+// Class Definitions
+
+class VideoBasePlaybackView : public HbView
+{
+ Q_OBJECT
+
+ public:
+ VideoBasePlaybackView();
+ virtual ~VideoBasePlaybackView();
+
+ void handleActivateView();
+
+ void handleDeactivateView();
+
+ void mousePressEvent( QGraphicsSceneMouseEvent *event );
+
+ QVariant itemChange( GraphicsItemChange change, const QVariant &value );
+
+ void paint( QPainter *painter,
+ const QStyleOptionGraphicsItem *option,
+ QWidget *widget );
+
+ bool event( QEvent *event );
+
+ virtual void handleClosePlaybackView();
+
+ virtual void handleBufferingState();
+
+ virtual void issuePlayCommand();
+
+ virtual void handlePluginError( int aError );
+
+ virtual void retrievePdlInformation();
+
+ virtual void closePlaybackView();
+
+ void startClosingPlaybackView();
+
+ RWindow *getWindow();
+
+ virtual void doClosePlayer();
+
+ void handleStoppedState();
+
+ signals:
+ void tappedOnScreen();
+
+ public slots:
+ void handleClosePopupDialog();
+
+ public:
+ int mCurrentError; // default = KErrNone
+ bool mViewActive;
+ bool mSyncClose;
+ int mLastPlayPosition;
+ bool mStayPaused;
+
+
+ public:
+ friend class CMPXVideoViewWrapper;
+
+};
+
+#endif // __VIDEOBASEPLAYBACKVIEW_H__
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/videoplaybackcontrol.hrh Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,94 @@
+/*
+* 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 CVideoPlaybackControl
+*
+*/
+
+// Version : %version: 2 %
+
+
+#ifndef VIDEOPLAYBACKCONTROL_HRH_
+#define VIDEOPLAYBACKCONTROL_HRH_
+
+// DATA TYPES
+
+enum TVideoPlaybackControlProperties
+{
+ EShownWhenInitializing = 0x1,
+ EShownWhenBuffering = 0x2,
+ EShownWhenPlaying = 0x4,
+ EShownWhenPaused = 0x8,
+ EShownWhenSeeking = 0x10,
+ EAllProperties = 0xffffffff
+};
+
+enum TVideoPlaybackControls
+{
+ EStatusPane,
+ EControlBar,
+
+ // Only for streaming case
+ // Can handle from NotInitilized state
+ //
+ EBufferingAnimation,
+
+ //
+ // For details view and audio only view
+ //
+ EFileDetailsWidget,
+
+ //
+ // For details view
+ //
+ EDetailsViewPlaybackWindow,
+
+ //
+ // Bitmaps
+ //
+ EIndicatorBitmap,
+ ERealLogoBitmap,
+
+ EDownloadPausedIcon,
+
+ EControlsCount // has to be last
+};
+
+/** Command ID's. */
+enum TVideoPlaybackControlCommandIds
+{
+ EControlCmdPluginInitialized,
+ EControlCmdTvOutConnected,
+ EControlCmdTvOutDisconnected,
+ EControlCmdSetAspectRatio,
+ EControlCmdSetVolume,
+ EControlCmdSetDuration,
+ EControlCmdSetPosition,
+ EControlCmdStateChanged,
+ EControlCmdDownloadUpdated,
+ EControlCmdSetDownloadSize,
+ EControlCmdDownloadComplete,
+ EControlCmdSetDownloadPaused,
+ EControlCmdClearDownloadPaused,
+ EControlCmdHandleBackgroundEvent,
+ EControlCmdHandleForegroundEvent,
+ EControlCmdHandleErrors,
+ EControlCmdShowVolumeControls,
+ EControlCmdSoftKeyPressed,
+ EControlCmdFullScreenViewOpened,
+ EControlCmdDetailsViewOpened,
+ EControlCmdAudionOnlyViewOpened,
+ EControlCmdRemoveRNLogo
+};
+
+#endif /*VIDEOPLAYBACKCONTROL_HRH_*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/videoplaybackcontrolscontroller.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,90 @@
+/*
+* 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 VideoPlaybackControlsController
+*
+*/
+
+// Version : %version: 9 %
+
+
+
+#ifndef VIDEOPLAYBACKCONTROLSCONTROLLER_H_
+#define VIDEOPLAYBACKCONTROLSCONTROLLER_H_
+
+// INCLUDES
+#include <qobject>
+
+#include "mpxvideo_debug.h"
+#include "videoplaybackcontrol.hrh"
+
+// FORWARD DECLARATIONS
+class CMPXVideoViewWrapper;
+class VideoBasePlaybackView;
+class VideoPlaybackControlsController;
+class VideoPlaybackViewFileDetails;
+
+// CLASS DECLARATION
+
+class VideoPlaybackControlsController : public QObject
+{
+ Q_OBJECT
+
+ public:
+
+ /**
+ * constructor.
+ */
+ VideoPlaybackControlsController(
+ VideoBasePlaybackView *view,
+ CMPXVideoViewWrapper *viewWrapper,
+ VideoPlaybackViewFileDetails *details );
+
+ /**
+ * Destructor.
+ */
+ virtual ~VideoPlaybackControlsController();
+
+ public:
+
+ //
+ // Handle event from container
+ //
+ void handleEvent( TVideoPlaybackControlCommandIds event, int value = 0 );
+
+ //
+ // Add the file details to the controls controller when available
+ //
+ void addFileDetails( VideoPlaybackViewFileDetails* details );
+
+ //
+ // updateVideoRectDone
+ //
+ void updateVideoRectDone();
+
+ bool isRNLogoBitmapInControlList();
+
+ public:
+ VideoBasePlaybackView *mView;
+ CMPXVideoViewWrapper *mViewWrapper;
+ VideoPlaybackViewFileDetails *mFileDetails;
+ TVideoPlaybackControlCommandIds mReceivedEvent;
+
+ int mValue;
+ bool mRNLogoVisible;
+ bool mFileDetailsAdded;
+};
+
+#endif /*VIDEOPLAYBACKCONTROLSCONTROLLER_P_H_*/
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/videoplaybackviewfiledetails.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,86 @@
+/*
+* 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: Video File Details (QT)
+*
+*/
+
+// Version : %version: 6 %
+
+
+
+
+#ifndef __VIDEOPLAYBACKVIEWFILEDETAILS__
+#define __VIDEOPLAYBACKVIEWFILEDETAILS__
+
+#include <qobject.h>
+#include "mpxhelixplaybackplugindefs.h"
+
+
+//
+// CLASS DECLARATION
+//
+class VideoPlaybackViewFileDetails : public QObject
+{
+ public:
+ //
+ // Constructor
+ //
+ VideoPlaybackViewFileDetails();
+
+ //
+ // Destructor.
+ //
+ virtual ~VideoPlaybackViewFileDetails();
+
+ //
+ // Clear all file details
+ //
+ void clearFileDetails();
+
+ public:
+ //
+ // Data
+ //
+ QString mClipName;
+ QString mTitle;
+ QString mArtist;
+ QString mMimeType;
+ QString mDescription;
+ QString mLocation;
+ QString mCopyright;
+ QString mLanguage;
+ QString mKeywords;
+
+ TMPXVideoMode mPlaybackMode;
+ bool mSeekable;
+ bool mPausableStream;
+ bool mAudioEnabled;
+ bool mVideoEnabled;
+ bool mPartialPlayback;
+ bool mRNFormat;
+ bool mTvOutConnected;
+ bool mDrmProtected;
+ bool mMultiItemPlaylist;
+
+ int mVideoHeight;
+ int mVideoWidth;
+ int mBitRate;
+ int mDuration;
+ int mCreationTime;
+ int mModificationTime;
+};
+
+#endif // __VIDEOPLAYBACKVIEWFILEDETAILS__
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxcollectionplaylist.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,67 @@
+/*
+* 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 collection playlist
+*
+*/
+
+#include "mpxcollectionplaylist.h"
+
+
+// -------------------------------------------------------------------------------------------------
+// Two-phased constructor.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXCollectionPlaylist* CMPXCollectionPlaylist::NewL()
+{
+ CMPXCollectionPlaylist* p = new ( ELeave ) CMPXCollectionPlaylist();
+ CleanupStack::PushL( p );
+ p->ConstructL();
+ CleanupStack::Pop( p );
+ return p;
+}
+
+// -------------------------------------------------------------------------------------------------
+// Default constructor
+// -------------------------------------------------------------------------------------------------
+//
+CMPXCollectionPlaylist::CMPXCollectionPlaylist()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// 2nd phase constructor.
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXCollectionPlaylist::ConstructL()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// Destructor
+// -------------------------------------------------------------------------------------------------
+//
+CMPXCollectionPlaylist::~CMPXCollectionPlaylist()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// Returns the number of items in the same container
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXCollectionPlaylist::Count() const
+{
+ return iCount;
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxcollectionutility.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,97 @@
+/*
+* 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: Factory method to create collection utility object
+*
+*/
+
+#include <e32base.h>
+
+#include "mpxcollectionutility.h"
+
+// ============================== MEMBER FUNCTIONS =================================================
+
+// -------------------------------------------------------------------------------------------------
+// Create the collection utility object by mode
+// -------------------------------------------------------------------------------------------------
+//
+MMPXCollectionUtility* MMPXCollectionUtility::NewL( MMPXCollectionObserver* aObs )
+{
+ return CMPXCollectionUtility::NewL( aObs );
+}
+
+// -------------------------------------------------------------------------------------------------
+// Two phase constructor
+// -------------------------------------------------------------------------------------------------
+//
+CMPXCollectionUtility* CMPXCollectionUtility::NewL( MMPXCollectionObserver* aObs )
+{
+ CMPXCollectionUtility* p = new ( ELeave ) CMPXCollectionUtility( aObs );
+ CleanupStack::PushL( p );
+ p->ConstructL();
+ CleanupStack::Pop( p );
+ return p;
+}
+
+// -------------------------------------------------------------------------------------------------
+// Destructor
+// -------------------------------------------------------------------------------------------------
+//
+CMPXCollectionUtility::~CMPXCollectionUtility()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// C++ constructor
+// -------------------------------------------------------------------------------------------------
+//
+CMPXCollectionUtility::CMPXCollectionUtility( MMPXCollectionObserver* /*aObs*/ )
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// 2nd phase constructor
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXCollectionUtility::ConstructL()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// Return reference to collection
+// -------------------------------------------------------------------------------------------------
+//
+MMPXCollection& CMPXCollectionUtility::Collection()
+{
+ return *this;
+}
+
+// -------------------------------------------------------------------------------------------------
+// Destroy this object
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXCollectionUtility::Close()
+{
+ delete this;
+}
+
+// -------------------------------------------------------------------------------------------------
+// The UID identifying this collection
+// -------------------------------------------------------------------------------------------------
+//
+TUid CMPXCollectionUtility::UidL() const
+{
+ return iUid;
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxplaybackutility.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,221 @@
+/*
+* 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: Factory method to create playback utility object
+*
+*/
+
+#include <bamdesca.h>
+#include <s32mem.h>
+#include <e32math.h>
+#include <mpxcmn.h>
+#include <mpxplaybackobserver.h>
+#include <mpxcollectionplaylist.h>
+#include <mpxmedia.h>
+#include <mpxmessagemonitor.h>
+#include <mpxtaskqueue.h>
+#include <mpxuser.h>
+#include <mpxmessagegeneraldefs.h>
+#include <mpxcommandgeneraldefs.h>
+#include <mpxcollectionpath.h>
+#include <mpxvideoplaybackdefs.h>
+
+#include"mpxplaybackutility.h"
+
+
+// ============================== MEMBER FUNCTIONS =================================================
+
+// -------------------------------------------------------------------------------------------------
+// Creates the playback utility object if not already created
+// -------------------------------------------------------------------------------------------------
+//
+MMPXPlaybackUtility* MMPXPlaybackUtility::UtilityL( const TMPXCategory /*aCategory*/,
+ const TUid& /*aModeId*/ )
+{
+ return CMPXPlaybackUtility::NewL();
+}
+
+// -------------------------------------------------------------------------------------------------
+// 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
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXPlaybackUtility::ConstructL()
+{
+ iState = EPbStateInitialised;
+}
+
+// -------------------------------------------------------------------------------------------------
+// Add a observer
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXPlaybackUtility::AddObserverL( MMPXPlaybackObserver& /*aObs*/ )
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// Remove a observer
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXPlaybackUtility::RemoveObserverL( MMPXPlaybackObserver& /* aObs */ )
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// Delete this
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXPlaybackUtility::Close()
+{
+ delete this;
+}
+
+// -------------------------------------------------------------------------------------------------
+// Issue player commands
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXPlaybackUtility::CommandL( TMPXPlaybackCommand aCmd )
+{
+ iCommand = aCmd;
+}
+
+// -------------------------------------------------------------------------------------------------
+// Issue player commands
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXPlaybackUtility::CommandL( CMPXCommand& aCmd, MMPXPlaybackCallback* /* aCallback */ )
+{
+ TInt cmdType = aCmd.ValueTObjectL<TInt>( KMPXCommandGeneralId );
+
+ if ( cmdType == KMPXCommandIdPlaybackGeneral )
+ {
+ iCommand = aCmd.ValueTObjectL<TInt>( KMPXCommandPlaybackGeneralType );
+ }
+ else
+ {
+ iCommand = aCmd.ValueTObjectL<TInt>( KMPXMediaVideoPlaybackCommand );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// 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;
+}
+
+// -------------------------------------------------------------------------------------------------
+// Set playback property, EPropertyChanged event when complete
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXPlaybackUtility::SetL( TMPXPlaybackProperty aProperty, TInt aValue )
+{
+ iProperty = aProperty;
+ iPropertyValue = aValue;
+}
+
+// -------------------------------------------------------------------------------------------------
+// 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 *playList = CMPXCollectionPlaylist::NewL();
+
+ return playList;
+}
+
+// -------------------------------------------------------------------------------------------------
+// Request for media properties.
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXPlaybackUtility::MediaL(
+ const TArray<TMPXAttribute>& /* aAttrs */,
+ MMPXPlaybackCallback& /* aCallback */,
+ CMPXAttributeSpecs* /* aSpecs */)
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// Request for media properties.
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXPlaybackUtility::MediaL(
+ const TArray<TMPXAttribute>& /* aAttrs */, MMPXPlaybackCallback& /* aCallback */ )
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// set primary client
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXPlaybackUtility::SetPrimaryClientL()
+{
+}
+
+// End of file
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxvideoplaybackdisplayhandler.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,161 @@
+/*
+* 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 video playback display handler
+*
+*/
+
+// Version : %version: 8 %
+
+#include <sysutil.h>
+#include <s32file.h>
+#include <mpxcommand.h>
+#include <mpxcommandgeneraldefs.h>
+#include <mpxplaybackutility.h>
+#include <mpxvideoplaybackdefs.h>
+
+#include "mpxvideoviewwrapper.h"
+#include "mpxvideoplaybackdisplayhandler.h"
+#include "mpxvideoregion.h"
+#include "videoplaybackviewfiledetails.h"
+
+
+CMPXVideoPlaybackDisplayHandler::CMPXVideoPlaybackDisplayHandler( MMPXPlaybackUtility* aPlayUtil,
+ CMPXVideoViewWrapper* aViewWrapper )
+ : iPlaybackUtility( aPlayUtil )
+ , iViewWrapper( aViewWrapper )
+{
+}
+
+CMPXVideoPlaybackDisplayHandler::~CMPXVideoPlaybackDisplayHandler()
+{
+}
+
+CMPXVideoPlaybackDisplayHandler*
+CMPXVideoPlaybackDisplayHandler::NewL( MMPXPlaybackUtility* aPlayUtil,
+ CMPXVideoViewWrapper* aViewWrapper )
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::NewL()"));
+
+ CMPXVideoPlaybackDisplayHandler* self =
+ new(ELeave) CMPXVideoPlaybackDisplayHandler( aPlayUtil, aViewWrapper );
+
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ CleanupStack::Pop();
+ return self;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackDisplayHandler::ConstructL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackDisplayHandler::ConstructL()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackDisplayHandler::CreateDisplayWindowL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackDisplayHandler::CreateDisplayWindowL(
+ RWsSession& aWs,
+ CWsScreenDevice& aScreenDevice,
+ RWindow& aWin,
+ TRect aDisplayRect )
+{
+ Q_UNUSED( aWs );
+ Q_UNUSED( aScreenDevice );
+ Q_UNUSED( aWin );
+ Q_UNUSED( aDisplayRect );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackDisplayHandler::RemoveDisplayWindow()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackDisplayHandler::RemoveDisplayWindow()
+{
+ if ( iVideoDisplay )
+ {
+ delete iVideoDisplay;
+ iVideoDisplay = NULL;
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackDisplayHandler::HandleVideoDisplayMessageL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackDisplayHandler::HandleVideoDisplayMessageL( CMPXMessage* /*aMessage*/ )
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackDisplayHandler::SetAspectRatioL()
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoPlaybackDisplayHandler::SetAspectRatioL( TMPXVideoPlaybackCommand aCmd )
+{
+ iCommand = aCmd;
+
+ switch ( aCmd )
+ {
+ case EPbCmdNaturalAspectRatio:
+ {
+ iAspectRatio = EMMFNatural;
+ break;
+ }
+ case EPbCmdZoomAspectRatio:
+ {
+ iAspectRatio = EMMFZoom;
+ break;
+ }
+ case EPbCmdStretchAspectRatio:
+ {
+ iAspectRatio = EMMFStretch;
+ break;
+ }
+ }
+
+ return iAspectRatio;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackDisplayHandler::SetDefaultAspectRatioL
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoPlaybackDisplayHandler::SetDefaultAspectRatioL(
+ VideoPlaybackViewFileDetails* aFileDetails,
+ TReal32 aDisplayAspectRatio )
+{
+ Q_UNUSED( aFileDetails );
+ Q_UNUSED( aDisplayAspectRatio );
+
+ return iAspectRatio;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackDisplayHandler::UpdateVideoRectL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackDisplayHandler::UpdateVideoRectL( TRect aClipRect, TBool transitionEffect )
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::UpdateVideoRectL()"));
+
+ Q_UNUSED( transitionEffect );
+
+ iRect = aClipRect;
+}
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxvideoplaybackuserinputhandler.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,118 @@
+/*
+* 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 playback view's input handler
+*
+*/
+
+// Version : %version: 6 %
+
+
+// INCLUDE FILES
+#include <qobject>
+#include <e32std.h>
+#include <w32std.h> // RWindowBase
+#include <e32base.h>
+#include <eikclbd.h>
+#include <aknconsts.h>
+#include <mpxplaybackframeworkdefs.h>
+#include <hwrmlightdomaincrkeys.h>
+#include <mpxvideoplaybackdefs.h>
+
+#include "mpxvideo_debug.h"
+#include "mpxvideoviewwrapper.h"
+#include "mpxcommonvideoplaybackview.hrh"
+#include "../inc/mpxvideoplaybackuserinputhandler.h"
+
+
+// CONSTANTS
+const TInt KMPXMicroSecondsInASecond = 1000000;
+
+
+// ======== MEMBER FUNCTIONS =======================================================================
+
+// -------------------------------------------------------------------------------------------------
+// MPXVideoPlaybackUserInputHandler::CMPXVideoPlaybackUserInputHandler()
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackUserInputHandler::CMPXVideoPlaybackUserInputHandler( CMPXVideoViewWrapper* aWrapper )
+ : iViewWrapper( aWrapper )
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::NewL()
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackUserInputHandler* CMPXVideoPlaybackUserInputHandler::NewL(
+ CMPXVideoViewWrapper* aWrapper, TBool aTvOutConnected )
+{
+ MPX_DEBUG(_L("CMPXVideoPlaybackUserInputHandler::NewL()"));
+
+ CMPXVideoPlaybackUserInputHandler* self =
+ new (ELeave) CMPXVideoPlaybackUserInputHandler( aWrapper );
+ CleanupStack::PushL( self );
+ self->ConstructL( aTvOutConnected );
+ CleanupStack::Pop();
+ return self;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackUserInputHandler::ConstructL( TBool aTvOutConnected )
+{
+ Q_UNUSED( aTvOutConnected );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::~CMPXVideoPlaybackUserInputHandler()
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackUserInputHandler::~CMPXVideoPlaybackUserInputHandler()
+{
+
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::ProcessKeyEvent()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackUserInputHandler::ProcessKeyEventL( const TKeyEvent& aKeyEvent,
+ TEventCode aType )
+{
+ Q_UNUSED( aKeyEvent );
+ Q_UNUSED( aType );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::SetForeground()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackUserInputHandler::SetForeground(TBool aForeground)
+{
+ Q_UNUSED( aForeground );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::HandleTVOutEvent()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackUserInputHandler::HandleTVOutEventL( TBool aTVOutConnected )
+{
+ Q_UNUSED( aTVOutConnected );
+}
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/videobaseplaybackview.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,211 @@
+/*
+* 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 Video playback view
+*
+*/
+
+// Version : %version: 8 %
+
+
+
+// Include Files
+#include <aknappui.h>
+#include <qgraphicssceneevent>
+#include <hbinstance.h>
+#include <mmf/common/mmferrors.h>
+
+#include "../inc/videobaseplaybackview.h"
+
+
+// Member Functions
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::VideoBasePlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+VideoBasePlaybackView::VideoBasePlaybackView()
+{
+ mCurrentError = KErrNone;
+ mViewActive = false;
+ mSyncClose = false;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::~VideoBasePlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+VideoBasePlaybackView::~VideoBasePlaybackView()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::handleActivateView()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::handleActivateView()
+{
+ mViewActive = true;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::handleDeactivateView()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::handleDeactivateView()
+{
+ mViewActive = false;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::mousePress
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::mousePressEvent( QGraphicsSceneMouseEvent *event )
+{
+ Q_UNUSED( event );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::itemChange
+// -------------------------------------------------------------------------------------------------
+//
+QVariant VideoBasePlaybackView::itemChange( GraphicsItemChange change, const QVariant &value )
+{
+ return QGraphicsWidget::itemChange( change, value );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::closePlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::paint( QPainter *painter,
+ const QStyleOptionGraphicsItem *option,
+ QWidget *widget )
+{
+ Q_UNUSED( painter );
+ Q_UNUSED( option );
+ Q_UNUSED( widget );
+}
+
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::event()
+// -------------------------------------------------------------------------------------------------
+//
+bool VideoBasePlaybackView::event( QEvent *event )
+{
+ Q_UNUSED( event );
+ bool consumed = false;
+
+ return consumed;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::handleClosePlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::handleClosePlaybackView()
+{
+ mViewActive = false;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::issuePlayCommand
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::issuePlayCommand()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::handleBufferingState
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::handleBufferingState()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::handlePluginError()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::handlePluginError( int aError )
+{
+ mCurrentError = aError;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::doClosePlayer
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::doClosePlayer()
+{
+ mViewActive = false;
+}
+
+
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::retrievePdlInformation
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::retrievePdlInformation()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::closePlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::closePlaybackView()
+{
+ mViewActive = false;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::startClosingPlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::startClosingPlaybackView()
+{
+ mViewActive = false;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::getWindow()
+// -------------------------------------------------------------------------------------------------
+//
+RWindow *VideoBasePlaybackView::getWindow()
+{
+ return static_cast<RWindow*>( hbInstance->allMainWindows()[0]->effectiveWinId()->DrawableWindow() );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::handleClosePopupDialog()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::handleClosePopupDialog()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::handleStoppedState()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::handleStoppedState()
+{
+
+}
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/videoplaybackcontrolscontroller.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,96 @@
+/*
+* 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 VideoPlaybackControlsController
+*
+*/
+
+// Version : %version: 10 %
+
+
+
+// INCLUDE FILES
+
+#include "mpxvideoviewwrapper.h"
+#include "videobaseplaybackview.h"
+#include "videoplaybackviewfiledetails.h"
+#include "../inc/videoplaybackcontrolscontroller.h"
+
+
+// ================= MEMBER FUNCTIONS ==============================================================
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::VideoPlaybackControlsController()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackControlsController::VideoPlaybackControlsController(
+ VideoBasePlaybackView *view,
+ CMPXVideoViewWrapper *viewWrapper,
+ VideoPlaybackViewFileDetails *details )
+ : mView( view )
+ , mViewWrapper( viewWrapper )
+ , mFileDetails( details )
+ , mFileDetailsAdded( false )
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::addFileDetails()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::addFileDetails(
+ VideoPlaybackViewFileDetails* details )
+{
+ Q_UNUSED( details );
+
+ mFileDetailsAdded = true;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::~VideoPlaybackControlsController
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackControlsController::~VideoPlaybackControlsController()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::~VideoPlaybackControlsController"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::handleEvent
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::handleEvent(
+ TVideoPlaybackControlCommandIds event, int value )
+{
+ mReceivedEvent = event;
+ mValue = value;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::updateVideoRectDone
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::updateVideoRectDone()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::isRNLogoBitmapVisible()
+// -------------------------------------------------------------------------------------------------
+//
+bool VideoPlaybackControlsController::isRNLogoBitmapInControlList()
+{
+ return mRNLogoVisible;
+}
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/videoplaybackviewfiledetails.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,77 @@
+/*
+* 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: class for Video File Details (Qt)
+*
+*/
+
+// Version : %version: 6 %
+
+
+
+//
+// INCLUDE FILES
+//
+#include "mpxvideo_debug.h"
+#include "videoplaybackviewfiledetails.h"
+
+
+// ============================ MEMBER FUNCTIONS ===================================================
+
+VideoPlaybackViewFileDetails::VideoPlaybackViewFileDetails()
+{
+ clearFileDetails();
+}
+
+VideoPlaybackViewFileDetails::~VideoPlaybackViewFileDetails()
+{
+ clearFileDetails();
+}
+
+void
+VideoPlaybackViewFileDetails::clearFileDetails()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewFileDetails::ClearFileDetails()"));
+
+ mMimeType = tr("");
+ mTitle = tr("");
+ mArtist = tr("");
+ mDescription = tr("");
+ mLocation = tr("");
+ mCopyright = tr("");
+ mLanguage = tr("");
+ mKeywords = tr("");
+
+ mClipName = QString("testClip.3gp");
+
+ mPlaybackMode = EMPXVideoLocal;
+ mSeekable = false;
+ mPausableStream = false;
+ mAudioEnabled = true;
+ mVideoEnabled = false;
+ mPartialPlayback = false;
+ mRNFormat = false;
+
+ mDuration = 0;
+ mTvOutConnected = false;
+ mDrmProtected = false;
+ mMultiItemPlaylist = false;
+
+ mVideoHeight = 0;
+ mVideoWidth = 0;
+ mBitRate = 0;
+ mCreationTime = 0;
+ mModificationTime = 0;
+}
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testmpxvideoviewwrapper/testmpxvideoviewwrapper.pro Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,57 @@
+#
+# 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 testmpxvideoviewwrapper
+#
+#
+# Version : %version: 9 %
+
+
+TEMPLATE = app
+TARGET = testmpxvideoviewwrapper
+CONFIG += qtestlib hb qt
+
+DEPENDPATH += inc src stub/src stub/inc
+
+INCLUDEPATH += stub/inc \
+ ../inc \
+ ../../inc \
+ ../../../inc \
+ ../../../../inc
+
+LIBS += -lmpxcommon.dll \
+ -lflogger.dll \
+ -lcone.dll \
+ -lws32.dll
+
+# Input
+HEADERS += testmpxvideoviewwrapper.h \
+ stub/inc/videobaseplaybackview.h \
+ mpxvideoplaybackuserinputhandler.h \
+ videoplaybackcontrolscontroller.h \
+ videoplaybackviewfiledetails.h \
+ mpxplaybackutility.h \
+ mpxcollectionutility.h \
+ mpxcollectionplaylist.h \
+ ../../viewinc/mpxvideoviewwrapper.h
+
+SOURCES += testmpxvideoviewwrapper.cpp \
+ stub/src/videobaseplaybackview.cpp \
+ mpxvideoplaybackdisplayhandler.cpp \
+ videoplaybackviewfiledetails.cpp \
+ videoplaybackcontrolscontroller.cpp \
+ mpxplaybackutility.cpp \
+ mpxcollectionutility.cpp \
+ mpxcollectionplaylist.cpp \
+ mpxvideoplaybackuserinputhandler.cpp \
+ ../../viewsrc/mpxvideoviewwrapper.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testprogressbar/inc/testprogressbar.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,72 @@
+/**
+* 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: tester for methods in TestProgressBar
+*
+*/
+
+// Version : %version: 3 %
+
+#ifndef __TESTPROGRESSBAR_H__
+#define __TESTPROGRESSBAR_H__
+
+
+// INCLUDES
+#include <QtTest/QtTest>
+
+class VideoPlaybackProgressBar;
+class VideoPlaybackControlsController;
+
+class TestProgressBar : public QObject
+{
+ Q_OBJECT
+
+ public:
+
+ /**
+ * will be called before each testfunction is executed.
+ *
+ */
+ void init();
+
+ /**
+ * will be called after every testfunction.
+ *
+ */
+ void cleanup();
+
+ void setup();
+
+ // test functions for the test framework
+ private slots:
+ void testHandleSliderPressed();
+ void testHandleSliderMoved();
+ void testHandleSliderReleased();
+ void testUpdateWithFileDetails();
+ void testUpdateState();
+ void testDurationChanged();
+ void testPositionChanged();
+ void testHandleSeekingTimeout();
+
+ signals:
+ void commandSignal();
+
+ private:
+ VideoPlaybackProgressBar* mProgBar;
+ VideoPlaybackControlsController* mController;
+};
+
+
+#endif // __TESTPROGRESSBAR_H__
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testprogressbar/src/testprogressbar.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,426 @@
+/**
+* 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: tester for methods in TestProgressBar
+*
+*/
+
+// Version : %version: 8 %
+
+
+#include <qdebug>
+#include <hbmainwindow.h>
+#include <hbapplication.h>
+#include <qgraphicssceneevent>
+#include <hbprogressslider.h>
+
+
+#include "testprogressbar.h"
+#include "videoplaybackviewfiledetails.h"
+#include "videoplaybackcontrolscontroller.h"
+
+#define private public
+#include "videoplaybackprogressbar.h"
+#undef private
+
+// -------------------------------------------------------------------------------------------------
+// main
+// -------------------------------------------------------------------------------------------------
+//
+int main(int argc, char *argv[])
+{
+ MPX_ENTER_EXIT(_L("TestProgressBar::Main()"));
+
+ HbApplication app(argc, argv);
+ HbMainWindow window;
+
+ TestProgressBar tv;
+
+ char *pass[3];
+ pass[0] = argv[0];
+ pass[1] = "-o";
+ pass[2] = "c:\\data\\testprogressbar.txt";
+
+ int res = QTest::qExec(&tv, 3, pass);
+
+ return res;
+}
+
+
+// -------------------------------------------------------------------------------------------------
+// init
+// -------------------------------------------------------------------------------------------------
+//
+void TestProgressBar::init()
+{
+ MPX_ENTER_EXIT(_L("TestProgressBar::init()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// setup
+// -------------------------------------------------------------------------------------------------
+//
+void TestProgressBar::setup()
+{
+ MPX_ENTER_EXIT(_L("TestProgressBar::setup()"));
+
+ mController = new VideoPlaybackControlsController();
+ mProgBar = new VideoPlaybackProgressBar( mController );
+
+ mProgBar->initialize();
+}
+
+// -------------------------------------------------------------------------------------------------
+// cleanup
+// -------------------------------------------------------------------------------------------------
+//
+void TestProgressBar::cleanup()
+{
+ MPX_ENTER_EXIT(_L("TestProgressBar::cleanup()"));
+
+ if ( mController )
+ {
+ delete mController;
+ mController = NULL;
+ }
+
+ if ( mProgBar )
+ {
+ delete mProgBar;
+ mProgBar = NULL;
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// testHandleSliderPressed
+// -------------------------------------------------------------------------------------------------
+//
+void TestProgressBar::testHandleSliderPressed()
+{
+ MPX_ENTER_EXIT(_L("TestProgressBar::testHandleSliderPressed()"));
+
+ setup();
+
+ //
+ // If it is playing state
+ //
+ mController->mState = EPbStatePlaying;
+
+ emit mProgBar->mProgressSlider->press();
+
+ QVERIFY( mController->mTimerAction == ETimerCancel );
+ QVERIFY( mController->mCommand == EMPXPbvCmdCustomPause );
+ QVERIFY( mProgBar->mSliderDragging );
+ QVERIFY( mProgBar->mNeedToResumeAfterSetPosition );
+
+ //
+ // If it is pause state
+ //
+ mController->mState = EPbStatePaused;
+ mController->mCommand = EMPXPbvCmdStop;
+
+ emit mProgBar->mProgressSlider->press();
+
+ QVERIFY( mController->mTimerAction == ETimerCancel );
+ QVERIFY( mController->mCommand == EMPXPbvCmdStop );
+ QVERIFY( mProgBar->mSliderDragging );
+ QVERIFY( mProgBar->mNeedToResumeAfterSetPosition );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// testHandleSliderReleased
+// -------------------------------------------------------------------------------------------------
+//
+void TestProgressBar::testHandleSliderReleased()
+{
+ MPX_ENTER_EXIT(_L("TestProgressBar::testHandleSliderReleased()"));
+
+ setup();
+
+ //
+ // Moved position >= duration
+ //
+ mProgBar->mDuration = 120;
+ mProgBar->mProgressSlider->mSliderValue = 130;
+ mController->mTimerAction = ETimerCancel;
+ mController->mCommand = EMPXPbvCmdStop;
+
+ emit mProgBar->mProgressSlider->release();
+ QVERIFY( mController->mTimerAction == ETimerReset );
+ QVERIFY( ! mProgBar->mSliderDragging );
+ QVERIFY( mController->mCommand == EMPXPbvCmdEndOfClip );
+
+ //
+ // Moved position < 0
+ //
+ mProgBar->mProgressSlider->mSliderValue = -1;
+ mController->mTimerAction = ETimerCancel;
+ mController->mCommand = EMPXPbvCmdStop;
+ mController->mValue = 100;
+
+ emit mProgBar->mProgressSlider->release();
+ QVERIFY( mController->mTimerAction == ETimerReset );
+ QVERIFY( ! mProgBar->mSliderDragging );
+ QVERIFY( mController->mCommand == EMPXPbvCmdSetPosition );
+ QVERIFY( mController->mValue == 0 );
+
+ //
+ // 0 <= moved position < duration
+ //
+ mProgBar->mProgressSlider->mSliderValue = 60;
+ mController->mTimerAction = ETimerCancel;
+ mController->mCommand = EMPXPbvCmdStop;
+
+ emit mProgBar->mProgressSlider->release();
+ QVERIFY( mController->mTimerAction == ETimerReset );
+ QVERIFY( ! mProgBar->mSliderDragging );
+ QVERIFY( mController->mCommand == EMPXPbvCmdSetPosition );
+ QVERIFY( mController->mValue == mProgBar->mProgressSlider->mSliderValue );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// testHandleSliderMoved
+// -------------------------------------------------------------------------------------------------
+//
+void TestProgressBar::testHandleSliderMoved()
+{
+ MPX_ENTER_EXIT(_L("TestProgressBar::testHandleSliderMoved()"));
+
+ setup();
+
+ //
+ // If user is dragging the slider
+ //
+ int movedPositoin = 5;
+ mProgBar->mDuration = 20;
+ mProgBar->mSliderDragging = true;
+ emit mProgBar->mProgressSlider->move( movedPositoin );
+
+ QVERIFY( mProgBar->mDraggingPosition == movedPositoin );
+ QVERIFY( mProgBar->mProgressSlider->progressValue() == movedPositoin );
+ QVERIFY( mProgBar->mProgressSlider->sliderValue() == movedPositoin );
+
+ //
+ // If user isnot dragging the slider and movedPosition > mDuration
+ //
+ movedPositoin = 30;
+ mProgBar->mSliderDragging = false;
+
+ emit mProgBar->mProgressSlider->move( movedPositoin );
+
+ QVERIFY( mProgBar->mProgressSlider->progressValue() == mProgBar->mDuration );
+ QVERIFY( mProgBar->mProgressSlider->sliderValue() == mProgBar->mDuration );
+ QVERIFY( mController->mCommand == EMPXPbvCmdEndOfClip );
+
+ //
+ // If user isnot dragging the slider and movedPosition < mDuration
+ //
+ movedPositoin = 10;
+
+ emit mProgBar->mProgressSlider->move( movedPositoin );
+
+ QVERIFY( mProgBar->mProgressSlider->progressValue() == movedPositoin );
+ QVERIFY( mProgBar->mProgressSlider->sliderValue() == movedPositoin );
+
+ QVERIFY( mController->mCommand == EMPXPbvCmdSetPosition );
+ QVERIFY( mController->mValue == movedPositoin );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// testUpdateWithFileDetails
+// -------------------------------------------------------------------------------------------------
+//
+void TestProgressBar::testUpdateWithFileDetails()
+{
+ MPX_ENTER_EXIT(_L("TestProgressBar::testUpdateWithFileDetails()"));
+
+ setup();
+
+ //
+ // pausable + non seekable
+ //
+ mController->mFileDetails->mPausableStream = true;
+ mController->mFileDetails->mSeekable = false;
+ mProgBar->updateWithFileDetails( mController->mFileDetails );
+ QVERIFY( ! mProgBar->mProgressSlider->isEnabled() );
+
+ //
+ // 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->mPausableStream = true;
+ mController->mFileDetails->mSeekable = true;
+ mProgBar->updateWithFileDetails( mController->mFileDetails );
+ QVERIFY( mProgBar->mProgressSlider->isEnabled() );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// testUpdateState
+// -------------------------------------------------------------------------------------------------
+//
+void TestProgressBar::testUpdateState()
+{
+ MPX_ENTER_EXIT(_L("TestProgressBar::testUpdateState()"));
+
+ setup();
+
+ //
+ // test for 1st block of cases
+ //
+ mController->mFileDetails->mPausableStream = true;
+ mController->mFileDetails->mSeekable = false;
+ mProgBar->updateState( EPbStatePlaying );
+ QVERIFY( ! mProgBar->mProgressSlider->isEnabled() );
+
+ mController->mFileDetails->mPausableStream = true;
+ mController->mFileDetails->mSeekable = true;
+ mProgBar->updateState( EPbStatePaused );
+ QVERIFY( mProgBar->mProgressSlider->isEnabled() );
+
+ //
+ // test for 2nd block of cases
+ //
+ mProgBar->updateState( EPbStateBuffering );
+ QVERIFY( ! mProgBar->mProgressSlider->isEnabled() );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// testDurationChanged
+// -------------------------------------------------------------------------------------------------
+//
+void TestProgressBar::testDurationChanged()
+{
+ MPX_ENTER_EXIT(_L("TestProgressBar::testDurationChanged()"));
+
+ setup();
+
+ int duration = 120;
+ mProgBar->durationChanged( duration );
+
+ QVERIFY( mProgBar->mDuration == duration );
+ QVERIFY( mProgBar->mProgressSlider->maximum() == duration );
+ QVERIFY( mProgBar->mProgressSlider->maxText() == "2:00" );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// testPositionChanged
+// -------------------------------------------------------------------------------------------------
+//
+void TestProgressBar::testPositionChanged()
+{
+ MPX_ENTER_EXIT(_L("TestProgressBar::testPositionChanged()"));
+
+ setup();
+
+ //
+ // position < duration
+ //
+ int position = 60;
+ int duration = 120;
+ mProgBar->durationChanged( duration );
+
+ mProgBar->mSliderDragging = false;
+ mProgBar->positionChanged( position );
+
+ QVERIFY( mProgBar->mProgressSlider->minText() == "1:00" );
+ QVERIFY( mProgBar->mProgressSlider->sliderValue() == position );
+ QVERIFY( mProgBar->mProgressSlider->progressValue() == position );
+
+ //
+ // position > duration
+ //
+ position = 130;
+
+ mProgBar->positionChanged( position );
+
+ QVERIFY( mProgBar->mProgressSlider->minText() == "2:00" );
+ QVERIFY( mProgBar->mProgressSlider->sliderValue() == duration );
+ QVERIFY( mProgBar->mProgressSlider->progressValue() == duration );
+
+ //
+ // position < 0
+ //
+ position = -1;
+
+ mProgBar->positionChanged( position );
+
+ QVERIFY( mProgBar->mProgressSlider->minText() == "0:00" );
+ QVERIFY( mProgBar->mProgressSlider->sliderValue() == 0 );
+ QVERIFY( mProgBar->mProgressSlider->progressValue() == 0 );
+
+ //
+ // duration >= 1 hour
+ //
+ duration = 3600;
+ mProgBar->durationChanged( duration );
+
+ position = 5;
+ mProgBar->positionChanged( position );
+
+ QVERIFY( mProgBar->mProgressSlider->minText() == "0:00:05" );
+ QVERIFY( mProgBar->mProgressSlider->sliderValue() == position );
+ QVERIFY( mProgBar->mProgressSlider->progressValue() == position );
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// testHandleSeekingTimeout
+// -------------------------------------------------------------------------------------------------
+//
+void TestProgressBar::testHandleSeekingTimeout()
+{
+ MPX_ENTER_EXIT(_L("TestProgressBar::testHandleSeekingTimeout()"));
+
+ setup();
+
+ mProgBar->mDraggingPosition = 10;
+ mProgBar->mDuration = 30;
+ mProgBar->mSetPosition = 0;
+
+ connect( this, SIGNAL( commandSignal() ), mProgBar, SLOT( handleSeekingTimeout() ) );
+ emit commandSignal();
+
+ QVERIFY( mController->mCommand == EMPXPbvCmdSetPosition );
+ QVERIFY( mController->mValue == mProgBar->mDraggingPosition );
+
+ cleanup();
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testprogressbar/stub/inc/hbprogressslider.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,76 @@
+/*
+* 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 HbProgressSlider
+*
+*/
+
+// Version : %version: 1 %
+
+
+
+#ifndef HBPROGRESSSLIDER_H_
+#define HBPROGRESSSLIDER_H_
+
+#include <hbwidget.h>
+#include <hbstyle.h>
+
+class QGraphicsItem;
+
+class HbProgressSlider : public HbWidget
+{
+ Q_OBJECT
+
+ public:
+ HbProgressSlider();
+ virtual ~HbProgressSlider();
+
+ public:
+ void setRange( int minimum, int maximum );
+
+ void setMaxText( const QString &text );
+ QString maxText();
+
+ void setMinText( const QString &text );
+ QString minText();
+
+ void setProgressValue( int value );
+ void setSliderValue( int value );
+
+ int sliderValue();
+ int progressValue();
+
+ int maximum();
+
+ public:
+ void press();
+ void release();
+ void move( int value );
+
+ signals:
+ void sliderPressed();
+ void sliderReleased();
+ void sliderMoved( int value );
+
+ public:
+ int mSliderValue;
+ int mProgressValue;
+ int mMax;
+ int mMin;
+
+ QString mMaxText;
+ QString mMinText;
+};
+
+#endif /*HBPROGRESSSLIDER_H_*/
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testprogressbar/stub/inc/videoplaybackcontrolscontroller.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,138 @@
+/*
+* 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 VideoPlaybackControlsController
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+#ifndef VIDEOPLAYBACKCONTROLSCONTROLLER_H_
+#define VIDEOPLAYBACKCONTROLSCONTROLLER_H_
+
+// INCLUDES
+#include <qobject>
+
+#include <mpxplaybackframeworkdefs.h>
+
+#include "mpxvideo_debug.h"
+#include "videoplaybackcontrol.hrh"
+#include "mpxcommonvideoplaybackview.hrh"
+#include "videoplaybackviewfiledetails.h"
+
+// FORWARD DECLARATIONS
+class VideoPlaybackDocumentLoader;
+class VideoPlaybackControlsController;
+
+
+// DATA TYPES
+
+enum TTimerAction
+{
+ ETimerCancel,
+ ETimerReset
+};
+
+enum TPlaybackViewMode
+{
+ EFullScreenView,
+ EDetailsView,
+ EAudioOnlyView
+};
+
+
+// CLASS DECLARATION
+
+class VideoPlaybackControlsController : public QObject
+{
+ Q_OBJECT
+
+ public:
+
+ /**
+ * constructor.
+ */
+ VideoPlaybackControlsController();
+
+ /**
+ * Destructor.
+ */
+ virtual ~VideoPlaybackControlsController();
+
+ public:
+ /**
+ * Initialize controller
+ */
+ void initializeController();
+
+ /**
+ * Command handling function.
+ * Call HandleCommandL() of container
+ */
+ void handleCommand( TMPXVideoPlaybackViewCommandIds command, int value = 0 );
+
+ /**
+ * Reset or cancel timers for the controls
+ */
+ void resetDisappearingTimers( TTimerAction timerAction );
+
+ /**
+ * Return state
+ */
+ inline TMPXPlaybackState state();
+
+ /**
+ * Return file details
+ */
+ inline VideoPlaybackViewFileDetails* fileDetails();
+
+ VideoPlaybackDocumentLoader* layoutLoader();
+
+ TPlaybackViewMode viewMode();
+
+ public:
+ VideoPlaybackViewFileDetails *mFileDetails;
+ VideoPlaybackDocumentLoader *mLoader;
+ TMPXPlaybackState mState;
+ TPlaybackViewMode mViewMode;
+ TTimerAction mTimerAction;
+ TMPXVideoPlaybackViewCommandIds mCommand;
+ int mValue;
+};
+
+// INLINE METHODS
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::state
+// -------------------------------------------------------------------------------------------------
+//
+inline
+TMPXPlaybackState VideoPlaybackControlsController::state()
+{
+ return mState;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::fileDetails
+// -------------------------------------------------------------------------------------------------
+//
+inline
+VideoPlaybackViewFileDetails* VideoPlaybackControlsController::fileDetails()
+{
+ return mFileDetails;
+}
+
+#endif /*VIDEOPLAYBACKCONTROLSCONTROLLER_P_H_*/
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testprogressbar/stub/inc/videoplaybackdocumentloader.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,51 @@
+/*
+* 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 VideoPlaybackDocumentLoader
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+#ifndef VIDEOPLAYBACKDOCUMENTHANDLER_H_
+#define VIDEOPLAYBACKDOCUMENTHANDLER_H_
+
+
+#include <qobject>
+
+class QList;
+class QGraphicsWidget;
+class VideoPlaybackControlsController;
+
+class VideoPlaybackDocumentLoader : public QObject
+{
+ public:
+ VideoPlaybackDocumentLoader();
+
+ virtual ~VideoPlaybackDocumentLoader();
+
+ public:
+ QGraphicsWidget* findWidget( const QString &name );
+
+ private:
+ QGraphicsWidget* createWidget( const QString &name );
+ int exist( const QString &name );
+
+ private:
+ QList<QGraphicsWidget*> mWidgets;
+};
+
+#endif /*VIDEOPLAYBACKDOCUMENTHANDLER_H_*/
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testprogressbar/stub/inc/videoplaybackviewfiledetails.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,84 @@
+/*
+* 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: Video File Details (QT)
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+
+#ifndef __VIDEOPLAYBACKVIEWFILEDETAILS__
+#define __VIDEOPLAYBACKVIEWFILEDETAILS__
+
+#include <qobject.h>
+#include "mpxhelixplaybackplugindefs.h"
+
+
+//
+// CLASS DECLARATION
+//
+class VideoPlaybackViewFileDetails : public QObject
+{
+ public:
+ //
+ // Constructor
+ //
+ VideoPlaybackViewFileDetails();
+
+ //
+ // Destructor.
+ //
+ virtual ~VideoPlaybackViewFileDetails();
+
+ //
+ // Clear all file details
+ //
+ void clearFileDetails();
+
+ public:
+ //
+ // Data
+ //
+ QString mClipName;
+ QString mTitle;
+ QString mArtist;
+ QString mMimeType;
+ QString mDescription;
+ QString mLocation;
+ QString mCopyright;
+ QString mLanguage;
+ QString mKeywords;
+
+ TMPXVideoMode mPlaybackMode;
+ bool mSeekable;
+ bool mPausableStream;
+ bool mAudioEnabled;
+ bool mVideoEnabled;
+ bool mPartialPlayback;
+ bool mRNFormat;
+ bool mTvOutConnected;
+ bool mDrmProtected;
+ bool mMultiItemPlaylist;
+
+ int mVideoHeight;
+ int mVideoWidth;
+ int mBitRate;
+ int mDuration;
+};
+
+#endif // __VIDEOPLAYBACKVIEWFILEDETAILS__
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testprogressbar/stub/src/hbprogressslider.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,187 @@
+/*
+* 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 HbProgressSlider
+*
+*/
+
+// Version : %version: 1 %
+
+#include <qgraphicswidget>
+
+#include "mpxvideo_debug.h"
+#include "hbprogressslider.h"
+
+// -------------------------------------------------------------------------------------------------
+// HbProgressSlider::HbProgressSlider
+// -------------------------------------------------------------------------------------------------
+//
+HbProgressSlider::HbProgressSlider()
+{
+ MPX_ENTER_EXIT(_L("HbProgressSlider::HbProgressSlider()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbProgressSlider::~HbProgressSlider
+// -------------------------------------------------------------------------------------------------
+//
+HbProgressSlider::~HbProgressSlider()
+{
+ MPX_DEBUG(_L("HbProgressSlider::HbProgressSlider") );
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbProgressSlider::setRange
+// -------------------------------------------------------------------------------------------------
+//
+void HbProgressSlider::setRange( int minimum, int maximum )
+{
+ MPX_DEBUG(_L("HbProgressSlider::setRange"));
+
+ mMax = maximum;
+ mMin = minimum;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbProgressSlider::setMaxText
+// -------------------------------------------------------------------------------------------------
+//
+void HbProgressSlider::setMaxText( const QString &text )
+{
+ MPX_DEBUG(_L("HbProgressSlider::setMaxText") );
+
+ mMaxText = text;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbProgressSlider::maxText
+// -------------------------------------------------------------------------------------------------
+//
+QString HbProgressSlider::maxText()
+{
+ MPX_DEBUG(_L("HbProgressSlider::maxText") );
+
+ return mMaxText;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbProgressSlider::setMinText
+// -------------------------------------------------------------------------------------------------
+//
+void HbProgressSlider::setMinText( const QString &text )
+{
+ MPX_DEBUG(_L("HbProgressSlider::setMinText") );
+
+ mMinText = text;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbProgressSlider::minText
+// -------------------------------------------------------------------------------------------------
+//
+QString HbProgressSlider::minText()
+{
+ MPX_DEBUG(_L("HbProgressSlider::minText") );
+
+ return mMinText;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbProgressSlider::setProgressValue
+// -------------------------------------------------------------------------------------------------
+//
+void HbProgressSlider::setProgressValue( int value )
+{
+ MPX_DEBUG(_L("HbProgressSlider::setProgressValue") );
+
+ mProgressValue = value;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbProgressSlider::setSliderValue
+// -------------------------------------------------------------------------------------------------
+//
+void HbProgressSlider::setSliderValue( int value )
+{
+ MPX_DEBUG(_L("HbProgressSlider::setSliderValue") );
+
+ mSliderValue = value;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbProgressSlider::sliderValue
+// -------------------------------------------------------------------------------------------------
+//
+int HbProgressSlider::sliderValue()
+{
+ MPX_DEBUG(_L("HbProgressSlider::sliderValue") );
+
+ return mSliderValue;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbProgressSlider::progressValue
+// -------------------------------------------------------------------------------------------------
+//
+int HbProgressSlider::progressValue()
+{
+ MPX_DEBUG(_L("HbProgressSlider::progressValue") );
+
+ return mProgressValue;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbProgressSlider::maximum
+// -------------------------------------------------------------------------------------------------
+//
+int HbProgressSlider::maximum()
+{
+ MPX_DEBUG(_L("HbProgressSlider::maximum") );
+
+ return mMax;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbProgressSlider::press
+// -------------------------------------------------------------------------------------------------
+//
+void HbProgressSlider::press()
+{
+ MPX_DEBUG(_L("HbProgressSlider::press") );
+
+ emit sliderPressed();
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbProgressSlider::release
+// -------------------------------------------------------------------------------------------------
+//
+void HbProgressSlider::release()
+{
+ MPX_DEBUG(_L("HbProgressSlider::release") );
+
+ emit sliderReleased();
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbProgressSlider::move
+// -------------------------------------------------------------------------------------------------
+//
+void HbProgressSlider::move( int value )
+{
+ MPX_DEBUG(_L("HbProgressSlider::move") );
+
+ emit sliderMoved( value );
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testprogressbar/stub/src/videoplaybackcontrolscontroller.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,123 @@
+/*
+* Copyright (c) 20010 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 VideoPlaybackControlsController
+*
+*/
+
+// Version : %version:4 %
+
+
+
+// INCLUDE FILES
+
+
+#include "videoplaybackdocumentloader.h"
+#include "videoplaybackviewfiledetails.h"
+#include "videoplaybackcontrolscontroller.h"
+#include "videoplaybackcontrolconfiguration.h"
+
+
+// ================= MEMBER FUNCTIONS ==============================================================
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::VideoPlaybackControlsController()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackControlsController::VideoPlaybackControlsController()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::VideoPlaybackControlsController") );
+
+ initializeController();
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::initializeController()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::initializeController()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::initializeController") );
+
+ mLoader = new VideoPlaybackDocumentLoader();
+ mFileDetails = new VideoPlaybackViewFileDetails();
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::~VideoPlaybackControlsController
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackControlsController::~VideoPlaybackControlsController()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::~VideoPlaybackControlsController"));
+
+ if ( mLoader )
+ {
+ delete mLoader;
+ mLoader = NULL;
+ }
+
+ if ( mFileDetails )
+ {
+ delete mFileDetails;
+ mFileDetails = NULL;
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::resetDisappearingTimers()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::resetDisappearingTimers( TTimerAction timerAction )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::resetDisappearingTimers") );
+
+ mTimerAction = timerAction;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::handleCommand()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::handleCommand(
+ TMPXVideoPlaybackViewCommandIds command, int value )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::handleCommand") );
+
+ mCommand = command;
+ mValue = value;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::layoutLoader
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackDocumentLoader* VideoPlaybackControlsController::layoutLoader()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::layoutLoader") );
+
+ return mLoader;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::viewMode
+// -------------------------------------------------------------------------------------------------
+//
+TPlaybackViewMode VideoPlaybackControlsController::viewMode()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::viewMode") );
+
+ return mViewMode;
+}
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testprogressbar/stub/src/videoplaybackdocumentloader.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,123 @@
+/*
+* 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 VideoPlaybackDocumentLoader
+*
+*/
+
+// Version : %version: 3 %
+
+
+#include <hbwidget.h>
+#include <hbtransparentwindow.h>
+#include <hbprogressslider.h>
+
+#include "mpxvideo_debug.h"
+#include "videoplaybackdocumentloader.h"
+#include "hblabel.h"
+
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDocumentLoader::VideoPlaybackDocumentLoader
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackDocumentLoader::VideoPlaybackDocumentLoader()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackDocumentLoader::VideoPlaybackDocumentLoader()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDocumentLoader::~VideoPlaybackDocumentLoader
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackDocumentLoader::~VideoPlaybackDocumentLoader()
+{
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::VideoPlaybackDocumentLoader") );
+
+ for ( int i = 0 ; i < mWidgets.count() ; i++ )
+ {
+ mWidgets.removeAt( 0 );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDocumentLoader::findWidget()
+// -------------------------------------------------------------------------------------------------
+//
+QGraphicsWidget *VideoPlaybackDocumentLoader::findWidget( const QString &name )
+{
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::findWidget") );
+
+ QGraphicsWidget *object = NULL;
+
+ int index = exist( name );
+
+ if ( index == -1 )
+ {
+ object = createWidget( name );
+ }
+ else
+ {
+ object = mWidgets[ index ];
+ }
+
+ return object;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDocumentLoader::createWidget()
+// -------------------------------------------------------------------------------------------------
+//
+QGraphicsWidget *VideoPlaybackDocumentLoader::createWidget( const QString &name )
+{
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::createWidget") );
+
+ QGraphicsWidget *object = NULL;
+
+ if ( name == "progressSlider" )
+ {
+ object = new HbProgressSlider();
+ object->setObjectName( name );
+ mWidgets.append( object );
+ }
+
+ return object;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDocumentLoader::exist()
+// -------------------------------------------------------------------------------------------------
+//
+int VideoPlaybackDocumentLoader::exist( const QString &name )
+{
+ int i = 0;
+
+ for ( ; i < mWidgets.count() ; i++ )
+ {
+ if( mWidgets[i]->objectName() == name )
+ {
+ break;
+ }
+ }
+
+ if ( i == mWidgets.count() )
+ {
+ i = -1;
+ }
+
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::exist %d"), i );
+
+ return i;
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testprogressbar/stub/src/videoplaybackviewfiledetails.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,77 @@
+/*
+* 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: class for Video File Details (Qt)
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+//
+// INCLUDE FILES
+//
+#include "mpxvideo_debug.h"
+#include "videoplaybackviewfiledetails.h"
+
+
+// ============================ MEMBER FUNCTIONS ===================================================
+
+VideoPlaybackViewFileDetails::VideoPlaybackViewFileDetails()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewFileDetails::VideoPlaybackViewFileDetails()"));
+
+ clearFileDetails();
+}
+
+VideoPlaybackViewFileDetails::~VideoPlaybackViewFileDetails()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewFileDetails::~VideoPlaybackViewFileDetails()"));
+
+ clearFileDetails();
+}
+
+void
+VideoPlaybackViewFileDetails::clearFileDetails()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewFileDetails::ClearFileDetails()"));
+
+ mMimeType = tr("");
+ mTitle = tr("");
+ mArtist = tr("");
+ mClipName = tr("");
+ mDescription = tr("");
+ mLocation = tr("");
+ mCopyright = tr("");
+ mLanguage = tr("");
+ mKeywords = tr("");
+
+ mPlaybackMode = EMPXVideoLocal;
+ mSeekable = false;
+ mPausableStream = false;
+ mAudioEnabled = false;
+ mVideoEnabled = false;
+ mPartialPlayback = false;
+ mRNFormat = false;
+
+ mDuration = 100;
+ mTvOutConnected = false;
+ mDrmProtected = false;
+
+ mVideoHeight = 0;
+ mVideoWidth = 0;
+ mBitRate = 0;
+}
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testprogressbar/testprogressbar.pro Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,43 @@
+#
+# 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: Project file for building testprogressbar
+#
+#
+# Version : %version: 3 %
+
+TEMPLATE = app
+TARGET = testprogressbar
+CONFIG += qtestlib qt hb
+
+INCLUDEPATH += stub/inc \
+ ../../../../inc \
+ ../../../inc
+
+
+DEPENDPATH += stub/inc stub/src inc src
+
+# Input
+HEADERS += testprogressbar.h \
+ videoplaybackcontrolscontroller.h \
+ videoplaybackdocumentloader.h \
+ videoplaybackviewfiledetails.h \
+ hbprogressslider.h \
+ ../../controlinc/videoplaybackprogressbar.h
+
+SOURCES += testprogressbar.cpp \
+ videoplaybackcontrolscontroller.cpp \
+ videoplaybackdocumentloader.cpp \
+ videoplaybackviewfiledetails.cpp \
+ hbprogressslider.cpp \
+ ../../controlsrc/videoplaybackprogressbar.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/teststatuspanecontrol/inc/teststatuspanecontrol.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,79 @@
+/**
+* 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: test module for VideoPlaybackStatusPaneControl
+*
+*/
+
+// Version : %version: 4 %
+
+
+#ifndef __TESTSTATUSPANECONTROL_H__
+#define __TESTSTATUSPANECONTROL_H__
+
+
+// INCLUDES
+#include <QtTest/QtTest>
+
+class VideoBasePlaybackView;
+class VideoPlaybackViewFileDetails;
+class VideoPlaybackControlsController;
+class VideoPlaybackStatusPaneControl;
+
+
+
+class TestStatusPaneControl : public QObject
+{
+ Q_OBJECT
+
+ public:
+
+ /**
+ * will be called before each testfunction is executed.
+ *
+ */
+ void init();
+
+ /**
+ * will be called after every testfunction.
+ *
+ */
+ void cleanup();
+
+ // test functions for the test framework
+ void setup();
+
+ private slots:
+ void testSetVisible();
+ void testSetMenu();
+ void testUpdateControlsWithFileDetails();
+ void testSetVisibility();
+ void testControlListUpdated();
+ void testSlot_handleAboutToShow();
+ void testSlot_handleAboutToHide();
+ void testSlot_openFullScreenView();
+
+ signals:
+ void commandSignal();
+
+ private:
+ VideoBasePlaybackView* mBaseVideoView;
+ VideoPlaybackViewFileDetails* mFileDetails;
+ VideoPlaybackControlsController* mControlsController;
+ VideoPlaybackStatusPaneControl* mStatusPane;
+};
+
+
+#endif // __TESTSTATUSPANECONTROL_H__
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/teststatuspanecontrol/src/teststatuspanecontrol.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,321 @@
+/**
+* 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: tester for methods in status pane control
+*
+*/
+
+// Version : %version: 8 %
+
+
+#include <hbapplication.h>
+#include <hbinstance.h>
+#include <hbmenu.h>
+#include <QDebug>
+
+
+#include "videoplaybackcontrol.hrh"
+#include "mpxhelixplaybackplugindefs.h"
+
+#include "teststatuspanecontrol.h"
+
+#include "videoplaybackviewfiledetails.h"
+#include "videoplaybackcontrolscontroller.h"
+#include "videobaseplaybackview.h"
+#include "videoplaybackdocumentloader.h"
+#include "hblabel.h"
+#include "hbgroupbox.h"
+
+#define private public
+#define protected public
+#include "videoplaybackstatuspanecontrol.h"
+#undef protected
+#undef private
+
+
+// ---------------------------------------------------------------------------
+// main
+// ---------------------------------------------------------------------------
+//
+int main(int argc, char *argv[])
+{
+ MPX_ENTER_EXIT(_L("TestStatusPaneControl::Main()"));
+
+ HbApplication app(argc, argv);
+ HbMainWindow window;
+
+ TestStatusPaneControl tv;
+
+ char *pass[3];
+ pass[0] = argv[0];
+ pass[1] = "-o";
+ pass[2] = "c:\\data\\teststatuspanecontrol.txt";
+
+ int res = QTest::qExec(&tv, 3, pass);
+
+ return res;
+}
+
+// ---------------------------------------------------------------------------
+// init
+// ---------------------------------------------------------------------------
+//
+void TestStatusPaneControl::init()
+{
+ MPX_ENTER_EXIT(_L("TestStatusPaneControl::init()"));
+}
+
+// ---------------------------------------------------------------------------
+// main
+// ---------------------------------------------------------------------------
+//
+void TestStatusPaneControl::setup()
+{
+ MPX_ENTER_EXIT(_L("TestStatusPaneControl::setup()"));
+
+ mBaseVideoView = new VideoBasePlaybackView();
+
+ mFileDetails = new VideoPlaybackViewFileDetails();
+
+ mControlsController = new VideoPlaybackControlsController( mBaseVideoView,
+ mFileDetails );
+
+ mStatusPane = new VideoPlaybackStatusPaneControl( mControlsController,
+ EStatusPane,
+ NULL,
+ 0 );
+}
+
+// ---------------------------------------------------------------------------
+// cleanup
+// ---------------------------------------------------------------------------
+//
+void TestStatusPaneControl::cleanup()
+{
+ MPX_ENTER_EXIT(_L("TestStatusPaneControl::cleanup()"));
+
+ if ( mStatusPane )
+ {
+ delete mStatusPane;
+ mStatusPane = NULL;
+ }
+
+ if ( mBaseVideoView )
+ {
+ delete mBaseVideoView;
+ mBaseVideoView = NULL;
+ }
+
+ if ( mFileDetails )
+ {
+ delete mFileDetails;
+ mFileDetails = NULL;
+ }
+
+ if ( mControlsController )
+ {
+ delete mControlsController;
+ mControlsController = NULL;
+ }
+}
+
+// ---------------------------------------------------------------------------
+// testSetMenu
+// ---------------------------------------------------------------------------
+//
+void TestStatusPaneControl::testSetMenu()
+{
+ MPX_ENTER_EXIT(_L("TestStatusPaneControl::testSetMenu()"));
+
+ setup();
+
+ mFileDetails->mTvOutConnected = false;
+ mFileDetails->mVideoEnabled = true;
+
+ mStatusPane->setMenu( mFileDetails );
+
+ QVERIFY( mControlsController->view()->menu()->isEmpty() );
+
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testSetVisible
+// ---------------------------------------------------------------------------
+//
+void TestStatusPaneControl::testSetVisible()
+{
+ MPX_ENTER_EXIT(_L("TestStatusPaneControl::testSetVisible()"));
+
+ setup();
+ mStatusPane->updateControlsWithFileDetails( mFileDetails );
+
+ // 1. Set visible
+ mStatusPane->setVisible( true );
+ QVERIFY( mControlsController->view()->mStatusBarVisible );
+ QVERIFY( mControlsController->view()->mTitleBarVisible );
+ QVERIFY( mStatusPane->mTitleLayout->isVisible() );
+
+ // 2. Set invisible
+ mStatusPane->setVisible( false );
+ QVERIFY( mControlsController->view()->menu()->isEmpty() );
+ QVERIFY( ! mControlsController->view()->mStatusBarVisible );
+ QVERIFY( ! mControlsController->view()->mTitleBarVisible );
+ QVERIFY( ! mStatusPane->mTitleLayout->isVisible() );
+
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testUpdateControlsWithFileDetails
+// ---------------------------------------------------------------------------
+//
+void TestStatusPaneControl::testUpdateControlsWithFileDetails()
+{
+ MPX_ENTER_EXIT(_L("TestStatusPaneControl::testUpdateControlsWithFileDetails()"));
+
+ setup();
+
+ QString title = "Title";
+
+ // 1. test for full creen mode
+ mControlsController->mViewMode = EFullScreenView;
+ 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;
+ 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 );
+
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testSetVisibility
+// ---------------------------------------------------------------------------
+//
+void TestStatusPaneControl::testSetVisibility()
+{
+ MPX_ENTER_EXIT(_L("TestStatusPaneControl::testSetVisibility()"));
+
+ setup();
+
+ // 1. test for first block of cases:
+ mStatusPane->setVisibility( EPbStatePaused );
+ QVERIFY( mControlsController->view()->menu()->isEmpty() );
+
+ // 2. test for second block of cases:
+ mStatusPane->setVisibility( EPbStateInitialising );
+ QVERIFY( mControlsController->view()->menu()->isEmpty() );
+
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testControlListUpdated
+// ---------------------------------------------------------------------------
+//
+void TestStatusPaneControl::testControlListUpdated()
+{
+ MPX_ENTER_EXIT(_L("TestStatusPaneControl::testControlListUpdated()"));
+
+ setup();
+
+ mStatusPane->controlListUpdated( mFileDetails );
+
+ QVERIFY( mControlsController->view()->menu()->isEmpty() );
+
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testSlot_handleAboutToShow
+// ---------------------------------------------------------------------------
+//
+void TestStatusPaneControl::testSlot_handleAboutToShow()
+{
+ MPX_ENTER_EXIT(_L("TestStatusPaneControl::testSlot_handleAboutToShow()"));
+
+ setup();
+
+ connect( this, SIGNAL( commandSignal() ), mStatusPane, SLOT( handleAboutToShow() ) );
+
+ emit commandSignal();
+
+ QVERIFY( mControlsController->mTimerAction == ETimerCancel );
+
+ disconnect( this, SIGNAL( commandSignal() ), mStatusPane, SLOT( handleAboutToShow() ) );
+
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testSlot_handleAboutToHide
+// ---------------------------------------------------------------------------
+//
+void TestStatusPaneControl::testSlot_handleAboutToHide()
+{
+ MPX_ENTER_EXIT(_L("TestStatusPaneControl::testSlot_handleAboutToHide()"));
+
+ setup();
+
+ connect( this, SIGNAL( commandSignal() ), mStatusPane, SLOT( handleAboutToHide() ) );
+
+ emit commandSignal();
+
+ QVERIFY( mControlsController->mTimerAction == ETimerReset );
+
+ disconnect( this, SIGNAL( commandSignal() ), mStatusPane, SLOT( handleAboutToHide() ) );
+
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testSlot_openFullScreenView
+// ---------------------------------------------------------------------------
+//
+void TestStatusPaneControl::testSlot_openFullScreenView()
+{
+ MPX_ENTER_EXIT(_L("TestStatusPaneControl::testSlot_openFullScreenView()"));
+
+ setup();
+
+ connect( this, SIGNAL( commandSignal() ), mStatusPane, SLOT( openFullScreenView() ) );
+
+ emit commandSignal();
+
+ QVERIFY( mControlsController->mViewMode == EFullScreenView );
+
+ disconnect( this, SIGNAL( commandSignal() ), mStatusPane, SLOT( openFullScreenView() ) );
+
+ cleanup();
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/teststatuspanecontrol/stub/inc/hbgroupbox.h Thu Jul 08 13:05:19 2010 +0300
@@ -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 <hbwidget.h>
+
+
+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_*/
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/teststatuspanecontrol/stub/inc/hblabel.h Thu Jul 08 13:05:19 2010 +0300
@@ -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 HbLabel
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+#ifndef HBLABEL_H_
+#define HBLABEL_H_
+
+#include <hbwidget.h>
+
+
+class HbLabel : public HbWidget
+{
+ Q_OBJECT
+
+ public:
+ HbLabel();
+ virtual ~HbLabel();
+
+ public:
+ void setVisible( bool visible );
+ bool isVisible();
+ void setPlainText( QString string );
+
+ public:
+ bool mVisible;
+ QString mString;
+};
+
+#endif /*HBLABEL_H_*/
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/teststatuspanecontrol/stub/inc/videobaseplaybackview.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,79 @@
+/*
+* 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: Video playback view
+*
+*/
+
+// Version : %version: 7 %
+
+
+
+// This file defines the API for .dll
+
+#ifndef __VIDEOBASEPLAYBACKVIEW_H__
+#define __VIDEOBASEPLAYBACKVIEW_H__
+
+// Include Files
+#include <hbwidget.h>
+#include <hbview.h>
+
+// Constants
+
+// Forward Declarations
+
+// Class Definitions
+class HbAction;
+class HbMenu;
+
+class VideoBasePlaybackView : public HbWidget
+{
+ Q_OBJECT
+
+ public:
+ VideoBasePlaybackView();
+ virtual ~VideoBasePlaybackView();
+
+ void handleActivateView();
+
+ void handleDeactivateView();
+
+ virtual void handleClosePlaybackView();
+
+ void startClosingPlaybackView();
+
+ virtual void doClosePlayer();
+
+ void setViewFlags( HbView::HbViewFlags flags );
+ HbView::HbViewFlags viewFlags();
+
+ 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 // __VIDEOBASEPLAYBACKVIEW_H__
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/teststatuspanecontrol/stub/inc/videoplaybackcontrolscontroller.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,170 @@
+/*
+* 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 VideoPlaybackControlsController
+*
+*/
+
+// Version : %version: 4 %
+
+
+
+#ifndef VIDEOPLAYBACKCONTROLSCONTROLLER_H_
+#define VIDEOPLAYBACKCONTROLSCONTROLLER_H_
+
+// INCLUDES
+#include <qobject>
+
+#include <mpxplaybackframeworkdefs.h>
+
+#include "mpxvideo_debug.h"
+#include "videoplaybackcontrol.hrh"
+#include "mpxcommonvideoplaybackview.hrh"
+#include "videoplaybackviewfiledetails.h"
+
+// FORWARD DECLARATIONS
+class VideoBasePlaybackView;
+class VideoPlaybackDocumentLoader;
+class VideoPlaybackFullScreenControl;
+class VideoPlaybackControlsController;
+
+
+// DATA TYPES
+
+enum TTimerAction
+{
+ ETimerCancel,
+ ETimerReset
+};
+
+enum TPlaybackViewMode
+{
+ EFullScreenView,
+ EDetailsView,
+ EAudioOnlyView
+};
+
+
+// CLASS DECLARATION
+
+class VideoPlaybackControlsController : public QObject
+{
+ Q_OBJECT
+
+ public:
+
+ /**
+ * constructor.
+ */
+ VideoPlaybackControlsController(
+ VideoBasePlaybackView *view,
+ VideoPlaybackViewFileDetails *details );
+
+ /**
+ * Destructor.
+ */
+ virtual ~VideoPlaybackControlsController();
+
+ public:
+ /**
+ * Reset or cancel timers for the controls
+ */
+ void resetDisappearingTimers( TTimerAction timerAction );
+
+ /*
+ * Return state
+ */
+ inline TMPXPlaybackState state();
+
+ /**
+ * Return file details
+ */
+ inline VideoPlaybackViewFileDetails* fileDetails();
+
+ VideoPlaybackDocumentLoader* layoutLoader();
+
+ inline VideoBasePlaybackView* view();
+
+ void changeViewMode( TPlaybackViewMode viewMode, bool transitionEffect = true );
+
+ TPlaybackViewMode viewMode();
+
+ public:
+ /**
+ * Initialize controller
+ */
+ void initializeController();
+
+ /**
+ * Create controls
+ */
+ void createControls();
+
+ /**
+ * Update controls
+ */
+ void handleStateChange( TMPXPlaybackState newState );
+
+ /**
+ * Update Control's visibility
+ */
+ void updateControlsVisibility();
+
+ public:
+ VideoBasePlaybackView *mView;
+ VideoPlaybackViewFileDetails *mFileDetails;
+
+ QList<VideoPlaybackFullScreenControl*> mControls;
+
+ VideoPlaybackDocumentLoader *mLoader;
+
+ TMPXPlaybackState mState;
+ TPlaybackViewMode mViewMode;
+ TTimerAction mTimerAction;
+
+};
+
+// INLINE METHODS
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::state
+// -------------------------------------------------------------------------------------------------
+//
+inline
+TMPXPlaybackState VideoPlaybackControlsController::state()
+{
+ return mState;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::fileDetails
+// -------------------------------------------------------------------------------------------------
+//
+inline
+VideoPlaybackViewFileDetails* VideoPlaybackControlsController::fileDetails()
+{
+ return mFileDetails;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::view
+// -------------------------------------------------------------------------------------------------
+//
+inline
+VideoBasePlaybackView* VideoPlaybackControlsController::view()
+{
+ return mView;
+}
+
+#endif /*VIDEOPLAYBACKCONTROLSCONTROLLER_P_H_*/
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/teststatuspanecontrol/stub/inc/videoplaybackdocumentloader.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,51 @@
+/*
+* 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 VideoPlaybackDocumentLoader
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+#ifndef VIDEOPLAYBACKDOCUMENTHANDLER_H_
+#define VIDEOPLAYBACKDOCUMENTHANDLER_H_
+
+
+#include <qobject>
+
+class QList;
+class QGraphicsWidget;
+class VideoPlaybackControlsController;
+
+class VideoPlaybackDocumentLoader : public QObject
+{
+ public:
+ VideoPlaybackDocumentLoader();
+
+ virtual ~VideoPlaybackDocumentLoader();
+
+ public:
+ QGraphicsWidget* findWidget( const QString &name );
+
+ private:
+ QGraphicsWidget* createWidget( const QString &name );
+ int exist( const QString &name );
+
+ private:
+ QList<QGraphicsWidget*> mWidgets;
+};
+
+#endif /*VIDEOPLAYBACKDOCUMENTHANDLER_H_*/
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/teststatuspanecontrol/stub/inc/videoplaybackfullscreencontrol.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,83 @@
+/*
+* 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 VideoPlaybackFullScreenControl
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+#ifndef VIDEOPLAYBACKFULLSCREENCONTROL_H_
+#define VIDEOPLAYBACKFULLSCREENCONTROL_H_
+
+#include <qobject>
+
+#include <videoplaybackcontrol.hrh>
+#include <mpxplaybackframeworkdefs.h>
+
+class HbWidget;
+class VideoPlaybackViewFileDetails;
+class VideoPlaybackControlsController;
+
+class VideoPlaybackFullScreenControl : public QObject
+{
+ Q_OBJECT
+
+ public:
+ VideoPlaybackFullScreenControl( VideoPlaybackControlsController* controller,
+ TVideoPlaybackControls index,
+ HbWidget* widget,
+ TUint controlproperties );
+
+ virtual ~VideoPlaybackFullScreenControl();
+
+ public:
+
+ /**
+ * Set visibility of each control
+ */
+ virtual void setVisibility( TMPXPlaybackState aState );
+
+ /**
+ * return control index
+ */
+ TVideoPlaybackControls controlIndex();
+
+ /**
+ * set changed state
+ */
+ void updateState( TMPXPlaybackState state );
+
+ /*
+ * Update the controls with the file details
+ */
+ virtual void updateControlsWithFileDetails( VideoPlaybackViewFileDetails *details );
+
+ virtual void setVisible( bool visible );
+
+ virtual bool isVisible();
+
+ virtual void updateControlProperties( TUint properties );
+
+ protected:
+ VideoPlaybackControlsController* mController;
+ HbWidget * mControl;
+ TVideoPlaybackControls mControlIndex;
+ TUint mProperties;
+ bool mVisible;
+};
+
+#endif /*VIDEOPLAYBACKFULLSCREENCONTROL_H_*/
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/teststatuspanecontrol/stub/inc/videoplaybackviewfiledetails.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,84 @@
+/*
+* 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: Video File Details (QT)
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+
+#ifndef __VIDEOPLAYBACKVIEWFILEDETAILS__
+#define __VIDEOPLAYBACKVIEWFILEDETAILS__
+
+#include <qobject.h>
+#include "mpxhelixplaybackplugindefs.h"
+
+
+//
+// CLASS DECLARATION
+//
+class VideoPlaybackViewFileDetails : public QObject
+{
+ public:
+ //
+ // Constructor
+ //
+ VideoPlaybackViewFileDetails();
+
+ //
+ // Destructor.
+ //
+ virtual ~VideoPlaybackViewFileDetails();
+
+ //
+ // Clear all file details
+ //
+ void clearFileDetails();
+
+ public:
+ //
+ // Data
+ //
+ QString mClipName;
+ QString mTitle;
+ QString mArtist;
+ QString mMimeType;
+ QString mDescription;
+ QString mLocation;
+ QString mCopyright;
+ QString mLanguage;
+ QString mKeywords;
+
+ TMPXVideoMode mPlaybackMode;
+ bool mSeekable;
+ bool mPausableStream;
+ bool mAudioEnabled;
+ bool mVideoEnabled;
+ bool mPartialPlayback;
+ bool mRNFormat;
+ bool mTvOutConnected;
+ bool mDrmProtected;
+ bool mMultiItemPlaylist;
+
+ int mVideoHeight;
+ int mVideoWidth;
+ int mBitRate;
+ int mDuration;
+};
+
+#endif // __VIDEOPLAYBACKVIEWFILEDETAILS__
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/teststatuspanecontrol/stub/src/hbgroupbox.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/teststatuspanecontrol/stub/src/hblabel.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -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 HbLabel
+*
+*/
+
+// Version : %version: 2 %
+
+
+#include "hblabel.h"
+
+// -------------------------------------------------------------------------------------------------
+// HbLabel::HbLabel
+// -------------------------------------------------------------------------------------------------
+//
+HbLabel::HbLabel()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbLabel::~HbLabel
+// -------------------------------------------------------------------------------------------------
+//
+HbLabel::~HbLabel()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbLabel::setVisible
+// -------------------------------------------------------------------------------------------------
+//
+void HbLabel::setVisible( bool visible )
+{
+ mVisible = visible;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbLabel::isVisible
+// -------------------------------------------------------------------------------------------------
+//
+bool HbLabel::isVisible()
+{
+ return mVisible;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbLabel::setPlainText
+// -------------------------------------------------------------------------------------------------
+//
+void HbLabel::setPlainText( QString string )
+{
+ mString = string;
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/teststatuspanecontrol/stub/src/videobaseplaybackview.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,162 @@
+/*
+* 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 Video playback view
+*
+*/
+
+// Version : %version: 6 %
+
+
+
+// Include Files
+#include <hbinstance.h>
+#include <HbAction.h>
+#include <HbMenu.h>
+
+#include "../inc/videobaseplaybackview.h"
+
+
+// Member Functions
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::VideoBasePlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+VideoBasePlaybackView::VideoBasePlaybackView()
+{
+ mMenu = new HbMenu();
+ mViewActive = false;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::~VideoBasePlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+VideoBasePlaybackView::~VideoBasePlaybackView()
+{
+ if ( mMenu )
+ {
+ delete mMenu;
+ mMenu = NULL;
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::handleActivateView()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::handleActivateView()
+{
+ mViewActive = true;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::handleDeactivateView()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::handleDeactivateView()
+{
+ mViewActive = false;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::handleClosePlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::handleClosePlaybackView()
+{
+ mViewActive = false;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::doClosePlayer
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::doClosePlayer()
+{
+ mViewActive = false;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::closePlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::closePlaybackView()
+{
+ mViewActive = false;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::startClosingPlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::startClosingPlaybackView()
+{
+ mViewActive = false;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::setTitleBarFlags()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::setViewFlags( HbView::HbViewFlags flags )
+{
+ mFlag = flags;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::viewFlags()
+// -------------------------------------------------------------------------------------------------
+//
+HbView::HbViewFlags VideoBasePlaybackView::viewFlags()
+{
+ return mFlag;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::setTitleBarVisible()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::setTitleBarVisible( bool visible )
+{
+ mTitleBarVisible = visible;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::setStatusBarVisible()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::setStatusBarVisible( bool visible )
+{
+ mStatusBarVisible = visible;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::setNavigationAction()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::setNavigationAction( HbAction *action )
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::menu()
+// -------------------------------------------------------------------------------------------------
+//
+HbMenu* VideoBasePlaybackView::menu()
+{
+ return mMenu;
+}
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/teststatuspanecontrol/stub/src/videoplaybackcontrolscontroller.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,114 @@
+/*
+* 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 VideoPlaybackControlsController
+*
+*/
+
+// Version : %version: 5 %
+
+
+
+// INCLUDE FILES
+#include <coecntrl.h>
+#include <bautils.h>
+#include <barsread.h>
+#include <f32file.h>
+
+#include "../inc/videobaseplaybackview.h"
+#include "../inc/videoplaybackviewfiledetails.h"
+#include "../inc/videoplaybackcontrolscontroller.h"
+#include "../inc/videoplaybackdocumentloader.h"
+
+
+
+// ================= MEMBER FUNCTIONS ==============================================================
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::VideoPlaybackControlsController()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackControlsController::VideoPlaybackControlsController(
+ VideoBasePlaybackView *view,
+ VideoPlaybackViewFileDetails *details )
+ : mView( view )
+ , mFileDetails( details )
+{
+ initializeController();
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::initializeController()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::initializeController()
+{
+ mLoader = new VideoPlaybackDocumentLoader();
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::~VideoPlaybackControlsController
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackControlsController::~VideoPlaybackControlsController()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::~VideoPlaybackControlsController"));
+
+ if ( mLoader )
+ {
+ delete mLoader;
+ mLoader = NULL;
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::resetDisappearingTimers()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::resetDisappearingTimers( TTimerAction timerAction )
+{
+ mTimerAction = timerAction;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::changeViewMode
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::changeViewMode(
+ TPlaybackViewMode viewMode, bool transitionEffect )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::changeViewMode()"));
+
+ Q_UNUSED( transitionEffect );
+ mViewMode = viewMode;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::layoutLoader
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackDocumentLoader* VideoPlaybackControlsController::layoutLoader()
+{
+ return mLoader;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::viewMode
+// -------------------------------------------------------------------------------------------------
+//
+TPlaybackViewMode VideoPlaybackControlsController::viewMode()
+{
+ return mViewMode;
+}
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/teststatuspanecontrol/stub/src/videoplaybackdocumentloader.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,136 @@
+/*
+* 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 VideoPlaybackDocumentLoader
+*
+*/
+
+// Version : %version: 3 %
+
+
+#include <QGraphicsWidget>
+
+#include "hblabel.h"
+#include "hbgroupbox.h"
+
+#include "mpxvideo_debug.h"
+#include "videoplaybackdocumentloader.h"
+
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDocumentLoader::VideoPlaybackDocumentLoader
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackDocumentLoader::VideoPlaybackDocumentLoader()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackDocumentLoader::VideoPlaybackDocumentLoader()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDocumentLoader::~VideoPlaybackDocumentLoader
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackDocumentLoader::~VideoPlaybackDocumentLoader()
+{
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::VideoPlaybackDocumentLoader") );
+
+ for ( int i = 0 ; i < mWidgets.count() ; i++ )
+ {
+ mWidgets.removeAt( 0 );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDocumentLoader::findWidget()
+// -------------------------------------------------------------------------------------------------
+//
+QGraphicsWidget *VideoPlaybackDocumentLoader::findWidget( const QString &name )
+{
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::findWidget") );
+
+ QGraphicsWidget *object = NULL;
+
+ int index = exist( name );
+
+ if ( index == -1 )
+ {
+ object = createWidget( name );
+ }
+ else
+ {
+ object = mWidgets[ index ];
+ }
+
+ return object;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDocumentLoader::createWidget()
+// -------------------------------------------------------------------------------------------------
+//
+QGraphicsWidget *VideoPlaybackDocumentLoader::createWidget( const QString &name )
+{
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::createWidget") );
+
+ QGraphicsWidget *object = NULL;
+
+ if ( name == "titleLayout" )
+ {
+ object = new QGraphicsWidget();
+ object->setObjectName( name );
+
+ mWidgets.append( object );
+ }
+ else if ( name == "title" )
+ {
+ object = new HbLabel();
+ object->setObjectName( name );
+ mWidgets.append( object );
+ }
+ else if ( name == "titleGroupBox" )
+ {
+ object = new HbGroupBox();
+ object->setObjectName( name );
+ mWidgets.append( object );
+ }
+
+ return object;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackDocumentLoader::exist()
+// -------------------------------------------------------------------------------------------------
+//
+int VideoPlaybackDocumentLoader::exist( const QString &name )
+{
+ int i = 0;
+
+ for ( ; i < mWidgets.count() ; i++ )
+ {
+ if( mWidgets[i]->objectName() == name )
+ {
+ break;
+ }
+ }
+
+ if ( i == mWidgets.count() )
+ {
+ i = -1;
+ }
+
+ MPX_DEBUG(_L("VideoPlaybackDocumentLoader::exist %d"), i );
+
+ return i;
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/teststatuspanecontrol/stub/src/videoplaybackfullscreencontrol.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,124 @@
+/*
+* 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 VideoPlaybackFullScreenControl
+*
+*/
+
+// Version : %version: 4 %
+
+
+
+#include <w32std.h>
+#include <hbwidget.h>
+
+#include "mpxvideo_debug.h"
+#include "videoplaybackfullscreencontrol.h"
+#include "videoplaybackcontrolscontroller.h"
+
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFullScreenControl::VideoPlaybackFullScreenControl()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackFullScreenControl::VideoPlaybackFullScreenControl(
+ VideoPlaybackControlsController* controller,
+ TVideoPlaybackControls index,
+ HbWidget* widget,
+ TUint controlproperties )
+ : mController( controller )
+ , mControl( widget )
+ , mControlIndex( index )
+ , mProperties( controlproperties )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackFullScreenControl::VideoPlaybackFullScreenControl()"));
+
+ setParent( mController );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFullScreenControl::~VideoPlaybackFullScreenControl()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackFullScreenControl::~VideoPlaybackFullScreenControl()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::~VideoPlaybackFullScreenControl"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFullScreenControl::setVisible()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackFullScreenControl::setVisible( bool visible )
+{
+ mControl->setVisible( visible );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFullScreenControl::isVisible()
+// -------------------------------------------------------------------------------------------------
+//
+bool VideoPlaybackFullScreenControl::isVisible()
+{
+ return mVisible;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFullScreenControl::setVisibility()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackFullScreenControl::setVisibility( TMPXPlaybackState /*state*/ )
+{
+ MPX_DEBUG(_L("VideoPlaybackFullScreenControl::setVisibility()"));
+
+ mVisible = true;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFullScreenControl::controlIndex()
+// -------------------------------------------------------------------------------------------------
+//
+TVideoPlaybackControls VideoPlaybackFullScreenControl::controlIndex()
+{
+ return mControlIndex;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFullScreenControl::updateState()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackFullScreenControl::updateState( TMPXPlaybackState state )
+{
+ Q_UNUSED( state );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFullScreenControl::updateControlsWithFileDetails()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackFullScreenControl::updateControlsWithFileDetails(
+ VideoPlaybackViewFileDetails* details )
+{
+ Q_UNUSED( details );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFullScreenControl::updateControlProperties()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackFullScreenControl::updateControlProperties( TUint properties )
+{
+ mProperties = properties;
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/teststatuspanecontrol/stub/src/videoplaybackviewfiledetails.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,77 @@
+/*
+* 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: class for Video File Details (Qt)
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+//
+// INCLUDE FILES
+//
+#include "mpxvideo_debug.h"
+#include "videoplaybackviewfiledetails.h"
+
+
+// ============================ MEMBER FUNCTIONS ===================================================
+
+VideoPlaybackViewFileDetails::VideoPlaybackViewFileDetails()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewFileDetails::VideoPlaybackViewFileDetails()"));
+
+ clearFileDetails();
+}
+
+VideoPlaybackViewFileDetails::~VideoPlaybackViewFileDetails()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewFileDetails::~VideoPlaybackViewFileDetails()"));
+
+ clearFileDetails();
+}
+
+void
+VideoPlaybackViewFileDetails::clearFileDetails()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewFileDetails::ClearFileDetails()"));
+
+ mMimeType = tr("");
+ mTitle = tr("");
+ mArtist = tr("");
+ mClipName = tr("");
+ mDescription = tr("");
+ mLocation = tr("");
+ mCopyright = tr("");
+ mLanguage = tr("");
+ mKeywords = tr("");
+
+ mPlaybackMode = EMPXVideoLocal;
+ mSeekable = false;
+ mPausableStream = false;
+ mAudioEnabled = false;
+ mVideoEnabled = false;
+ mPartialPlayback = false;
+ mRNFormat = false;
+
+ mDuration = 0;
+ mTvOutConnected = false;
+ mDrmProtected = false;
+
+ mVideoHeight = 0;
+ mVideoWidth = 0;
+ mBitRate = 0;
+}
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/teststatuspanecontrol/teststatuspanecontrol.pro Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,56 @@
+#
+# 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: Project file for building teststatuspanecontrol
+#
+#
+# Version : %version: 5 %
+
+
+TEMPLATE = app
+TARGET = teststatuspanecontrol
+CONFIG += qtestlib hb qt
+
+DEPENDPATH += . \
+ inc \
+ src
+
+INCLUDEPATH += stub/inc \
+ ../inc \
+ ../../inc \
+ ../../../inc \
+ ../../../../inc \
+
+DEPENDPATH += stub/inc stub/src inc src
+
+# Input
+HEADERS += ../../../controlinc/videoplaybackstatuspanecontrol.h \
+ inc/teststatuspanecontrol.h \
+ videoplaybackcontrolscontroller.h \
+ videoplaybackviewfiledetails.h \
+ videobaseplaybackview.h \
+ videoplaybackdocumentloader.h \
+ videoplaybackfullscreencontrol.h \
+ hblabel.h \
+ hbgroupbox.h
+
+SOURCES += ../../../controlsrc/videoplaybackstatuspanecontrol.cpp \
+ src/teststatuspanecontrol.cpp \
+ videoplaybackcontrolscontroller.cpp \
+ videoplaybackviewfiledetails.cpp \
+ videobaseplaybackview.cpp \
+ videoplaybackdocumentloader.cpp \
+ videoplaybackfullscreencontrol.cpp \
+ hblabel.cpp \
+ hbgroupbox.cpp
+
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testtoolbar/inc/testtoolbar.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,79 @@
+/**
+* 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: tester for methods in TestToolBar
+*
+*/
+
+// Version : %version: 2 %
+
+#ifndef __TESTTOOLBAR_H__
+#define __TESTTOOLBAR_H__
+
+
+// INCLUDES
+#include <QtTest/QtTest>
+
+class VideoPlaybackToolBar;
+class VideoPlaybackControlsController;
+
+class TestToolBar : public QObject
+{
+ Q_OBJECT
+
+ public:
+
+ /**
+ * will be called before each testfunction is executed.
+ *
+ */
+ void init( bool attachOperation = false );
+
+ /**
+ * will be called after every testfunction.
+ *
+ */
+ void cleanup();
+
+ // test functions for the test framework
+ private slots:
+
+ // the order in which these testXX methods are declared is important
+ // changing this order will affect the test results
+ void testPlay();
+ void testLongTapOnFF();
+ void testLongTapOnRW();
+ void testShortTapOnFF();
+ void testShortTapOnRW();
+ void testPause();
+ void testChangeAspectRatio();
+ void testUpdateState();
+ void testAspectRatioChanged();
+ void testHandleButtonPressed();
+ void testUpdateWithFileDetails();
+ void testOpenDetailsView();
+ void testAttach();
+ void testSend();
+
+ signals:
+ void commandSignal();
+
+ private:
+ VideoPlaybackToolBar* mVideoToolBar;
+ VideoPlaybackControlsController* mController;
+};
+
+
+#endif // __TESTTOOLBAR_H__
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testtoolbar/src/testtoolbar.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,669 @@
+/**
+* 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: tester for methods in TestToolBar
+*
+*/
+
+// Version : %version: 6 %
+
+
+#include <qdebug>
+#include <hbmainwindow.h>
+#include <hbapplication.h>
+
+#include "hbtoolbar.h"
+#include "hbtoolbutton.h"
+#include "testtoolbar.h"
+#include "videoplaybackviewfiledetails.h"
+#include "videoplaybackcontrolscontroller.h"
+#include "videoplaybackdocumentloader.h"
+
+#define private public
+#include "videoplaybacktoolbar.h"
+#undef private
+
+// -------------------------------------------------------------------------------------------------
+// main
+// -------------------------------------------------------------------------------------------------
+//
+int main(int argc, char *argv[])
+{
+ MPX_ENTER_EXIT(_L("TestToolBar::Main()"));
+
+ HbApplication app(argc, argv);
+ HbMainWindow window;
+
+ TestToolBar tv;
+
+ char *pass[3];
+ pass[0] = argv[0];
+ pass[1] = "-o";
+ pass[2] = "c:\\data\\testtoolbar.txt";
+
+ int res = QTest::qExec(&tv, 3, pass);
+
+ return res;
+}
+
+// -------------------------------------------------------------------------------------------------
+// init
+// -------------------------------------------------------------------------------------------------
+//
+void TestToolBar::init( bool attachOperation )
+{
+ MPX_ENTER_EXIT(_L("TestToolBar::init()"));
+
+ mController = new VideoPlaybackControlsController( attachOperation );
+ mVideoToolBar = new VideoPlaybackToolBar( mController );
+
+ mVideoToolBar->setVisible( true );
+
+ connect( this, SIGNAL( commandSignal() ), mVideoToolBar, SLOT( retrieveButtons() ) );
+ emit commandSignal();
+ disconnect( this, SIGNAL( commandSignal() ), mVideoToolBar, SLOT( retrieveButtons() ) );
+}
+
+// -------------------------------------------------------------------------------------------------
+// cleanup
+// -------------------------------------------------------------------------------------------------
+//
+void TestToolBar::cleanup()
+{
+ MPX_ENTER_EXIT(_L("TestToolBar::cleanup()"));
+
+ if ( mController )
+ {
+ delete mController;
+ mController = NULL;
+ }
+
+ if ( mVideoToolBar )
+ {
+ delete mVideoToolBar;
+ mVideoToolBar = NULL;
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// testPlay
+// -------------------------------------------------------------------------------------------------
+//
+void TestToolBar::testPlay()
+{
+ MPX_ENTER_EXIT(_L("TestToolBar::testPlay()"));
+
+ init();
+
+ mVideoToolBar->mButtons[E3rdButton]->release();
+
+ QVERIFY( mController->mTimerAction == ETimerReset );
+ QVERIFY( mController->mCommand == EMPXPbvCmdPlayPause );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// testLongTapOnFF
+// -------------------------------------------------------------------------------------------------
+//
+void TestToolBar::testLongTapOnFF()
+{
+ MPX_ENTER_EXIT(_L("TestToolBar::testLongTapOnFF()"));
+
+ init();
+
+ //
+ // Start seeking
+ //
+ mVideoToolBar->mButtons[E4thButton]->press();
+ QVERIFY( mController->mTimerAction == ETimerCancel );
+
+ connect( this, SIGNAL( commandSignal() ), mVideoToolBar, SLOT( ffPressing() ) );
+ emit commandSignal();
+ disconnect( this, SIGNAL( commandSignal() ), mVideoToolBar, SLOT( ffPressing() ) );
+
+ QVERIFY( mVideoToolBar->mSeekingState == EFastForwarding );
+ QVERIFY( mController->mCommand == EMPXPbvCmdSeekForward );
+
+ //
+ // End seeking
+ //
+ mVideoToolBar->mButtons[E4thButton]->release();
+
+ QVERIFY( mVideoToolBar->mSeekingState == ENotSeeking );
+ QVERIFY( mController->mTimerAction == ETimerReset );
+ QVERIFY( mController->mCommand == EMPXPbvCmdEndSeek );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// testLongTapOnRW
+// -------------------------------------------------------------------------------------------------
+//
+void TestToolBar::testLongTapOnRW()
+{
+ MPX_ENTER_EXIT(_L("TestToolBar::testLongTapOnRW()"));
+
+ init();
+
+ //
+ // Start seeking
+ //
+ mVideoToolBar->mButtons[E2ndButton]->press();
+ QVERIFY( mController->mTimerAction == ETimerCancel );
+
+ connect( this, SIGNAL( commandSignal() ), mVideoToolBar, SLOT( rwPressing() ) );
+ emit commandSignal();
+ disconnect( this, SIGNAL( commandSignal() ), mVideoToolBar, SLOT( rwPressing() ) );
+
+ QVERIFY( mVideoToolBar->mSeekingState == ERewinding );
+ QVERIFY( mController->mCommand == EMPXPbvCmdSeekBackward );
+
+ //
+ // End seeking
+ //
+ mVideoToolBar->mButtons[E2ndButton]->release();
+
+ QVERIFY( mVideoToolBar->mSeekingState == ENotSeeking );
+ QVERIFY( mController->mTimerAction == ETimerReset );
+ QVERIFY( mController->mCommand == EMPXPbvCmdEndSeek );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// testShortTapOnFF
+// -------------------------------------------------------------------------------------------------
+//
+void TestToolBar::testShortTapOnFF()
+{
+ MPX_ENTER_EXIT(_L("TestToolBar::testShortTapOnFF()"));
+
+ init();
+
+ //
+ // If mPostion + KMPXFastForward < mDuration
+ //
+ mVideoToolBar->mPosition = 30;
+ mVideoToolBar->mDuration = 70;
+ mVideoToolBar->mButtons[E4thButton]->release();
+
+ QVERIFY( mController->mTimerAction == ETimerReset );
+ QVERIFY( mController->mCommand == EMPXPbvCmdSetPosition );
+ QVERIFY( mController->mCommandValue == mVideoToolBar->mPosition + KMPXFastForward );
+
+ //
+ // If mPostion + KMPXFastForward < mDuration
+ //
+ mVideoToolBar->mDuration = 50;
+ mController->mCommand = EMPXPbvCmdPlay;
+
+ mVideoToolBar->mButtons[E4thButton]->release();
+ QVERIFY( mController->mTimerAction == ETimerReset );
+ QVERIFY( mController->mCommand == EMPXPbvCmdPlay );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// testShortTapOnRW
+// -------------------------------------------------------------------------------------------------
+//
+void TestToolBar::testShortTapOnRW()
+{
+ MPX_ENTER_EXIT(_L("TestToolBar::testShortTapOnRW()"));
+
+ init();
+
+ //
+ // If mPostion + KMPXRewind > 0
+ //
+ mVideoToolBar->mPosition = 30;
+ mVideoToolBar->mButtons[E2ndButton]->release();
+
+ QVERIFY( mController->mTimerAction == ETimerReset );
+ QVERIFY( mController->mCommand == EMPXPbvCmdSetPosition );
+ QVERIFY( mController->mCommandValue == mVideoToolBar->mPosition + KMPXRewind );
+
+ //
+ // If mPostion + KMPXRewind < 0
+ //
+ mVideoToolBar->mPosition = 4;
+ mVideoToolBar->mButtons[E2ndButton]->release();
+
+ QVERIFY( mController->mTimerAction == ETimerReset );
+ QVERIFY( mController->mCommand == EMPXPbvCmdSetPosition );
+ QVERIFY( mController->mCommandValue == 0 );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// testPause
+// -------------------------------------------------------------------------------------------------
+//
+void TestToolBar::testPause()
+{
+ MPX_ENTER_EXIT(_L("TestToolBar::testPause()"));
+
+ init();
+
+ mVideoToolBar->mButtons[E3rdButton]->release();
+
+ QVERIFY( mController->mTimerAction == ETimerReset );
+ QVERIFY( mController->mCommand == EMPXPbvCmdPlayPause );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// testChangeAspectRatio
+// -------------------------------------------------------------------------------------------------
+//
+void TestToolBar::testChangeAspectRatio()
+{
+ MPX_ENTER_EXIT(_L("TestToolBar::testChangeAspectRatio()"));
+
+ init();
+
+ //
+ // Test natural
+ //
+ mVideoToolBar->mAspectRatio = EMMFZoom;
+ mVideoToolBar->mButtons[E1stButton]->release();
+
+ QVERIFY( mController->mTimerAction == ETimerReset );
+ QVERIFY( mController->mCommand == EMPXPbvCmdNaturalAspectRatio );
+
+ //
+ // Test stretch
+ //
+ mVideoToolBar->mAspectRatio = EMMFStretch;
+ mVideoToolBar->mButtons[E1stButton]->release();
+
+ QVERIFY( mController->mTimerAction == ETimerReset );
+ QVERIFY( mController->mCommand == EMPXPbvCmdZoomAspectRatio );
+
+ //
+ // Test stretch
+ //
+ mVideoToolBar->mAspectRatio = EMMFNatural;
+ mVideoToolBar->mButtons[E1stButton]->release();
+
+ QVERIFY( mController->mTimerAction == ETimerReset );
+ QVERIFY( mController->mCommand == EMPXPbvCmdStretchAspectRatio );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// testUpdateState
+// -------------------------------------------------------------------------------------------------
+//
+void TestToolBar::testUpdateState()
+{
+ MPX_ENTER_EXIT(_L("TestToolBar::testUpdateState()"));
+
+ init();
+
+ VideoPlaybackViewFileDetails *details = mController->fileDetails();
+
+ //
+ // Playing
+ //
+ TMPXPlaybackState state = EPbStatePlaying;
+ details->mPausableStream = false;
+ mVideoToolBar->updateState( state );
+
+ QVERIFY( mVideoToolBar->mToolBar->mEnabled == true );
+ QVERIFY( mVideoToolBar->mButtons[E3rdButton]->isEnabled() == false );
+
+ //
+ // Paused
+ //
+ state = EPbStatePaused;
+ mVideoToolBar->updateState( state );
+
+ QVERIFY( mVideoToolBar->mToolBar->mEnabled == true );
+ QVERIFY( mVideoToolBar->mButtons[E3rdButton]->isEnabled() == true );
+
+ //
+ // Not initialized
+ //
+ state = EPbStateNotInitialised;
+ mVideoToolBar->updateState( state );
+
+ QVERIFY( mVideoToolBar->mToolBar->mEnabled == false );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// testAspectRatioChanged
+// -------------------------------------------------------------------------------------------------
+//
+void TestToolBar::testAspectRatioChanged()
+{
+ MPX_ENTER_EXIT(_L("TestToolBar::testAspectRatioChanged()"));
+
+ init();
+
+ //
+ // Natural
+ //
+ int aspectRatio = EMMFNatural;
+ mVideoToolBar->aspectRatioChanged( aspectRatio );
+ QVERIFY( mVideoToolBar->mAspectRatio == EMMFNatural );
+
+ //
+ // Stretch
+ //
+ aspectRatio = EMMFStretch;
+ mVideoToolBar->aspectRatioChanged( aspectRatio );
+ QVERIFY( mVideoToolBar->mAspectRatio == EMMFStretch );
+
+ //
+ // Zoom
+ //
+ aspectRatio = EMMFZoom;
+ mVideoToolBar->aspectRatioChanged( aspectRatio );
+ QVERIFY( mVideoToolBar->mAspectRatio == EMMFZoom );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// testHandleButtonPressed
+// -------------------------------------------------------------------------------------------------
+//
+void TestToolBar::testHandleButtonPressed()
+{
+ MPX_ENTER_EXIT(_L("TestToolBar::testHandleButtonPressed()"));
+
+ init();
+
+ mVideoToolBar->mButtons[E1stButton]->press();
+
+ QVERIFY( mController->mTimerAction == ETimerCancel );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// testUpdateWithFileDetails
+// -------------------------------------------------------------------------------------------------
+//
+void TestToolBar::testUpdateWithFileDetails()
+{
+ MPX_ENTER_EXIT(_L("TestToolBar::testUpdateWithFileDetails()"));
+
+ //
+ // 'non-attach' mode
+ //
+ init();
+
+ VideoPlaybackViewFileDetails *details = mController->fileDetails();
+
+ //
+ // video clip, view mode is full-screen
+ //
+ details->mVideoEnabled = true;
+ details->mVideoHeight = 1;
+ details->mVideoWidth = 1;
+ details->mTvOutConnected = false;
+ details->mSeekable = true;
+ details->mPausableStream = true;
+ mController->mViewMode = EFullScreenView;
+
+ mVideoToolBar->updateWithFileDetails( details );
+
+ QVERIFY( mVideoToolBar->mButtons[E1stButton]->isEnabled() == true );
+ QVERIFY( mVideoToolBar->mButtons[E2ndButton]->isEnabled() == true );
+ QVERIFY( mVideoToolBar->mButtons[E3rdButton]->isEnabled() == true );
+ QVERIFY( mVideoToolBar->mButtons[E4thButton]->isEnabled() == true );
+ QVERIFY( mVideoToolBar->mButtons[E5thButton]->isEnabled() == true );
+
+ //
+ // video clip has same aspect ratio as display window
+ //
+ details->mVideoEnabled = true;
+ details->mVideoHeight = 360;
+ details->mVideoWidth = 640;
+ details->mTvOutConnected = false;
+ mController->mViewMode = EFullScreenView;
+
+ mVideoToolBar->updateWithFileDetails( details );
+
+ QVERIFY( mVideoToolBar->mButtons[E1stButton]->isEnabled() == false );
+ QVERIFY( mVideoToolBar->mButtons[E2ndButton]->isEnabled() == true );
+ QVERIFY( mVideoToolBar->mButtons[E3rdButton]->isEnabled() == true );
+ QVERIFY( mVideoToolBar->mButtons[E4thButton]->isEnabled() == true );
+ QVERIFY( mVideoToolBar->mButtons[E5thButton]->isEnabled() == true );
+
+ //
+ // audio-only clip, view mode is full-screen
+ //
+ details->mVideoEnabled = false;
+ details->mVideoHeight = 0;
+ details->mVideoWidth = 1;
+ details->mTvOutConnected = true;
+ details->mSeekable = false;
+ details->mPausableStream = true;
+
+ mVideoToolBar->updateWithFileDetails( details );
+
+ QVERIFY( mVideoToolBar->mButtons[E1stButton]->isEnabled() == false );
+ QVERIFY( mVideoToolBar->mButtons[E2ndButton]->isEnabled() == false );
+ QVERIFY( mVideoToolBar->mButtons[E3rdButton]->isEnabled() == true );
+ QVERIFY( mVideoToolBar->mButtons[E4thButton]->isEnabled() == false );
+ QVERIFY( mVideoToolBar->mButtons[E5thButton]->isEnabled() == false );
+
+ //
+ // local audio-only clip, view mode is audio-only
+ //
+ details->mVideoEnabled = false;
+ details->mVideoHeight = 0;
+ details->mVideoWidth = 1;
+ details->mTvOutConnected = true;
+ details->mSeekable = true;
+ details->mPausableStream = false;
+ mController->mState = EPbStatePlaying;
+ mController->mViewMode = EAudioOnlyView;
+
+ mVideoToolBar->updateWithFileDetails( details );
+
+ QVERIFY( mVideoToolBar->mButtons[E1stButton]->isEnabled() == true );
+ QVERIFY( mVideoToolBar->mButtons[E2ndButton]->isEnabled() == false );
+ QVERIFY( mVideoToolBar->mButtons[E3rdButton]->isEnabled() == false );
+ QVERIFY( mVideoToolBar->mButtons[E4thButton]->isEnabled() == false );
+ QVERIFY( mVideoToolBar->mButtons[E5thButton]->isEnabled() == false );
+
+ //
+ // streaming audio-only clip, view mode is audio-only, non-pausable stream in 'playing' state
+ //
+ details->mVideoEnabled = false;
+ details->mPlaybackMode = EMPXVideoStreaming;
+ mController->mViewMode = EAudioOnlyView;
+ details->mSeekable = false;
+ details->mPausableStream = false;
+ mController->mState = EPbStatePlaying;
+
+ mVideoToolBar->updateWithFileDetails( details );
+
+ QVERIFY( mVideoToolBar->mButtons[E1stButton]->isEnabled() == false );
+ QVERIFY( mVideoToolBar->mButtons[E2ndButton]->isEnabled() == false );
+ QVERIFY( mVideoToolBar->mButtons[E3rdButton]->isEnabled() == false );
+ QVERIFY( mVideoToolBar->mButtons[E4thButton]->isEnabled() == false );
+ QVERIFY( mVideoToolBar->mButtons[E5thButton]->isEnabled() == false );
+
+ //
+ // streaming audio-only clip, view mode is audio-only, non-pausable stream in 'paused' state
+ //
+ details->mVideoEnabled = false;
+ details->mPlaybackMode = EMPXVideoStreaming;
+ mController->mViewMode = EAudioOnlyView;
+ details->mSeekable = false;
+ details->mPausableStream = false;
+ mController->mState = EPbStatePaused;
+
+ mVideoToolBar->updateWithFileDetails( details );
+
+ QVERIFY( mVideoToolBar->mButtons[E1stButton]->isEnabled() == false );
+ QVERIFY( mVideoToolBar->mButtons[E2ndButton]->isEnabled() == false );
+ QVERIFY( mVideoToolBar->mButtons[E3rdButton]->isEnabled() == true );
+ QVERIFY( mVideoToolBar->mButtons[E4thButton]->isEnabled() == false );
+ QVERIFY( mVideoToolBar->mButtons[E5thButton]->isEnabled() == false );
+
+ cleanup();
+
+ //
+ // 'attach' mode
+ //
+ init( true );
+
+ //
+ // video clip, view mode is full-screen
+ //
+ details->mVideoEnabled = true;
+ details->mVideoHeight = 1;
+ details->mVideoWidth = 1;
+ details->mTvOutConnected = false;
+ details->mSeekable = true;
+ details->mPausableStream = true;
+
+ mVideoToolBar->updateWithFileDetails( details );
+
+ QVERIFY( mVideoToolBar->mButtons[E1stButton]->isEnabled() == true );
+ QVERIFY( mVideoToolBar->mButtons[E2ndButton]->isEnabled() == true );
+ QVERIFY( mVideoToolBar->mButtons[E3rdButton]->isEnabled() == true );
+ QVERIFY( mVideoToolBar->mButtons[E4thButton]->isEnabled() == true );
+ QVERIFY( mVideoToolBar->mButtons[E5thButton]->isEnabled() == true );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// testOpenDetailsView
+// -------------------------------------------------------------------------------------------------
+//
+void TestToolBar::testOpenDetailsView()
+{
+ MPX_ENTER_EXIT(_L("TestToolBar::testOpenDetailsView()"));
+
+ init();
+
+ QSignalSpy spy( mVideoToolBar, SIGNAL( openDetailsView() ) );
+
+ mController->mViewMode = EFullScreenView;
+ mVideoToolBar->mButtons[E5thButton]->release();
+ QVERIFY( mController->mViewMode == EDetailsView );
+
+ mController->mViewMode = EDetailsView;
+ mVideoToolBar->mButtons[E5thButton]->release();
+ QVERIFY( mController->mViewMode == EDetailsView );
+
+ mController->mViewMode = EAudioOnlyView;
+ mVideoToolBar->mButtons[E5thButton]->release();
+ QVERIFY( mController->mViewMode == EAudioOnlyView );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// testAttach
+// -------------------------------------------------------------------------------------------------
+//
+void TestToolBar::testAttach()
+{
+ MPX_ENTER_EXIT(_L("TestToolBar::testAttach()"));
+
+ //
+ // test when 'attach' operation is enabled
+ //
+ init( true );
+
+ VideoPlaybackViewFileDetails *details = mController->fileDetails();
+ details->mVideoEnabled = false;
+ mVideoToolBar->updateWithFileDetails( details );
+
+ //
+ // release 'attach' button
+ //
+ mVideoToolBar->mButtons[E1stButton]->release();
+
+ //
+ // verify the controller attachVideo() slot has been called
+ //
+ QVERIFY( mController->mCommand == EMPXPbvCmdClose );
+ QVERIFY( mController->mAttachVideoDone == true );
+
+ //
+ // clean up
+ //
+ cleanup();
+
+ //
+ // test when 'attach' operation is disabled
+ //
+ init();
+
+ //
+ // verify the controller attachVideo() slot is not called
+ //
+ QVERIFY( mController->mAttachVideoDone == false );
+
+ //
+ // clean up
+ //
+ cleanup();
+
+}
+
+// -------------------------------------------------------------------------------------------------
+// testSend
+// -------------------------------------------------------------------------------------------------
+//
+void TestToolBar::testSend()
+{
+ MPX_ENTER_EXIT(_L("TestToolBar::testSend()"));
+
+ //
+ // test when 'share' operation is enabled
+ //
+ init( false );
+
+ VideoPlaybackViewFileDetails *details = mController->fileDetails();
+ details->mVideoEnabled = false;
+ mController->mViewMode = EAudioOnlyView;
+ mVideoToolBar->updateWithFileDetails( details );
+
+ //
+ // release 'share' button
+ //
+ mVideoToolBar->mButtons[E1stButton]->release();
+
+ //
+ // verify the controller sendVideo() slot has been called
+ //
+ QVERIFY( mController->mCommand == EMPXPbvCmdPause );
+ QVERIFY( mController->mSendVideoDone == true );
+
+ //
+ // clean up
+ //
+ cleanup();
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testtoolbar/stub/inc/hbtoolbar.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,54 @@
+/*
+* 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 HbToolBar
+*
+*/
+
+// Version : %version: 1 %
+
+
+
+#ifndef HBTOOLBAR_H_
+#define HBTOOLBAR_H_
+
+#include <hbwidget.h>
+
+class HbAction;
+class QGraphicsLayout;
+class QGraphicsLinearLayout;
+
+class HbToolBar : public HbWidget
+{
+ Q_OBJECT
+
+ public:
+ HbToolBar();
+ virtual ~HbToolBar();
+
+ public:
+ void setVisible( bool visible );
+ void setEnabled( bool enabled );
+ void setOrientation( int orientation );
+ void clearActions();
+ void addAction( HbAction *action );
+ QGraphicsLayout* layout();
+
+ public:
+ bool mVisible;
+ bool mEnabled;
+ QGraphicsLinearLayout *mLayout;
+};
+
+#endif /*HBTOOLBAR_H_*/
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testtoolbar/stub/inc/hbtoolbutton.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,52 @@
+/*
+* 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 HbToolButton
+*
+*/
+
+// Version : %version: 1 %
+
+
+
+#ifndef HbTOOLBUTTON_H_
+#define HbTOOLBUTTON_H_
+
+#include <hbwidget.h>
+
+class HbAction;
+
+class HbToolButton : public HbWidget
+{
+ Q_OBJECT
+
+ public:
+ HbToolButton( HbAction *action );
+ virtual ~HbToolButton();
+
+ public:
+ void press();
+ void release();
+ bool isEnabled();
+
+ signals:
+ void pressed();
+ void released();
+
+ private:
+ bool mEnabled;
+ HbAction *mAction;
+};
+
+#endif /*HbTOOLBUTTON_H_*/
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testtoolbar/stub/inc/videobaseplaybackview.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,58 @@
+/*
+* 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: Video playback view
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+// This file defines the API for .dll
+
+#ifndef __VIDEOBASEPLAYBACKVIEW_H__
+#define __VIDEOBASEPLAYBACKVIEW_H__
+
+// Include Files
+#include <QWidget>
+
+
+// Constants
+
+// Forward Declarations
+
+// Class Definitions
+class HbToolBar;
+class RWindow;
+
+class VideoBasePlaybackView : public QWidget
+{
+ Q_OBJECT
+
+ public:
+ VideoBasePlaybackView();
+ virtual ~VideoBasePlaybackView();
+
+ void hideItems( int item );
+ void showItems( int item );
+ HbToolBar *toolBar();
+ RWindow *getWindow();
+
+ public:
+ HbToolBar *mToolBar;
+};
+
+#endif // __VIDEOBASEPLAYBACKVIEW_H__
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testtoolbar/stub/inc/videoplaybackcontrolscontroller.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,162 @@
+/*
+* 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 VideoPlaybackControlsController
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+#ifndef VIDEOPLAYBACKCONTROLSCONTROLLER_H_
+#define VIDEOPLAYBACKCONTROLSCONTROLLER_H_
+
+// INCLUDES
+#include <qobject>
+#include <mpxplaybackframeworkdefs.h>
+
+#include "mpxvideo_debug.h"
+#include "mpxcommonvideoplaybackview.hrh"
+#include "videoplaybackviewfiledetails.h"
+
+// FORWARD DECLARATIONS
+
+
+// DATA TYPES
+
+enum TTimerAction
+{
+ ETimerCancel,
+ ETimerReset
+};
+
+enum TPlaybackViewMode
+{
+ EFullScreenView,
+ EDetailsView,
+ EAudioOnlyView
+};
+
+// CLASS DECLARATION
+class VideoBasePlaybackView;
+
+class VideoPlaybackControlsController : public QObject
+{
+ Q_OBJECT
+
+ public:
+
+ /**
+ * constructor.
+ */
+ VideoPlaybackControlsController( bool attachOperation );
+
+ /**
+ * Destructor.
+ */
+ virtual ~VideoPlaybackControlsController();
+
+ public:
+
+ /**
+ * Command handling function.
+ * Call HandleCommandL() of container
+ */
+ void handleCommand( TMPXVideoPlaybackViewCommandIds command, int value = 0 );
+
+ /**
+ * Reset or cancel timers for the controls
+ */
+ void resetDisappearingTimers( TTimerAction timerAction );
+
+ /**
+ * Return state
+ */
+ inline TMPXPlaybackState state();
+
+ inline VideoBasePlaybackView* view();
+
+ /**
+ * Return file details
+ */
+ inline VideoPlaybackViewFileDetails* fileDetails();
+
+ TPlaybackViewMode viewMode();
+
+ void changeViewMode( TPlaybackViewMode viewMode, bool transitionEffect = true );
+
+ bool isAttachOperation();
+
+ private slots:
+ void attachVideo();
+ void sendVideo();
+
+ public:
+ VideoPlaybackViewFileDetails *mFileDetails;
+ VideoBasePlaybackView *mView;
+
+ TMPXPlaybackState mState;
+ TPlaybackViewMode mViewMode;
+ TTimerAction mTimerAction;
+ TMPXVideoPlaybackViewCommandIds mCommand;
+ int mCommandValue;
+ bool mIsAttachOperation;
+ bool mAttachVideoDone;
+ bool mSendVideoDone;
+};
+
+// INLINE METHODS
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::state
+// -------------------------------------------------------------------------------------------------
+//
+inline
+TMPXPlaybackState VideoPlaybackControlsController::state()
+{
+ return mState;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::fileDetails
+// -------------------------------------------------------------------------------------------------
+//
+inline
+VideoPlaybackViewFileDetails* VideoPlaybackControlsController::fileDetails()
+{
+ return mFileDetails;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::viewMode
+// -------------------------------------------------------------------------------------------------
+//
+inline
+TPlaybackViewMode VideoPlaybackControlsController::viewMode()
+{
+ return mViewMode;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::view
+// -------------------------------------------------------------------------------------------------
+//
+inline
+VideoBasePlaybackView* VideoPlaybackControlsController::view()
+{
+ return mView;
+}
+
+#endif /*VIDEOPLAYBACKCONTROLSCONTROLLER_P_H_*/
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testtoolbar/stub/inc/videoplaybackviewfiledetails.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,84 @@
+/*
+* 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: Video File Details (QT)
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+
+#ifndef __VIDEOPLAYBACKVIEWFILEDETAILS__
+#define __VIDEOPLAYBACKVIEWFILEDETAILS__
+
+#include <qobject.h>
+#include "mpxhelixplaybackplugindefs.h"
+
+
+//
+// CLASS DECLARATION
+//
+class VideoPlaybackViewFileDetails : public QObject
+{
+ public:
+ //
+ // Constructor
+ //
+ VideoPlaybackViewFileDetails();
+
+ //
+ // Destructor.
+ //
+ virtual ~VideoPlaybackViewFileDetails();
+
+ //
+ // Clear all file details
+ //
+ void clearFileDetails();
+
+ public:
+ //
+ // Data
+ //
+ QString mClipName;
+ QString mTitle;
+ QString mArtist;
+ QString mMimeType;
+ QString mDescription;
+ QString mLocation;
+ QString mCopyright;
+ QString mLanguage;
+ QString mKeywords;
+
+ TMPXVideoMode mPlaybackMode;
+ bool mSeekable;
+ bool mPausableStream;
+ bool mAudioEnabled;
+ bool mVideoEnabled;
+ bool mPartialPlayback;
+ bool mRNFormat;
+ bool mTvOutConnected;
+ bool mDrmProtected;
+ bool mMultiItemPlaylist;
+
+ int mVideoHeight;
+ int mVideoWidth;
+ int mBitRate;
+ int mDuration;
+};
+
+#endif // __VIDEOPLAYBACKVIEWFILEDETAILS__
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testtoolbar/stub/src/hbtoolbar.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,115 @@
+/*
+* 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 HbToolBar
+*
+*/
+
+// Version : %version: 1 %
+
+
+#include <QGraphicsLinearLayout>
+
+#include "mpxvideo_debug.h"
+#include "hbtoolbar.h"
+#include "hbtoolbutton.h"
+
+// -------------------------------------------------------------------------------------------------
+// HbToolBar::HbToolBar
+// -------------------------------------------------------------------------------------------------
+//
+HbToolBar::HbToolBar()
+ : mVisible( false )
+ , mEnabled( false )
+{
+ MPX_ENTER_EXIT(_L("HbToolBar::HbToolBar()"));
+
+ mLayout = new QGraphicsLinearLayout();
+ setLayout( mLayout );
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbToolBar::~HbToolBar
+// -------------------------------------------------------------------------------------------------
+//
+HbToolBar::~HbToolBar()
+{
+ MPX_DEBUG(_L("HbToolBar::HbToolBar") );
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbToolBar::setEnabled
+// -------------------------------------------------------------------------------------------------
+//
+void HbToolBar::setEnabled( bool enabled )
+{
+ MPX_DEBUG(_L("HbToolBar::setEnabled %d"), enabled );
+
+ mEnabled = enabled;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbToolBar::setVisible
+// -------------------------------------------------------------------------------------------------
+//
+void HbToolBar::setVisible( bool visible )
+{
+ MPX_DEBUG(_L("HbToolBar::setVisible %d"), visible );
+
+ mVisible = visible;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbToolBar::setOrientation
+// -------------------------------------------------------------------------------------------------
+//
+void HbToolBar::setOrientation( int orientation )
+{
+ MPX_DEBUG(_L("HbToolBar::setOrientation") );
+ Q_UNUSED( orientation );
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbToolBar::clearActions
+// -------------------------------------------------------------------------------------------------
+//
+void HbToolBar::clearActions()
+{
+ MPX_DEBUG(_L("HbToolBar::clearActions") );
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbToolBar::addAction
+// -------------------------------------------------------------------------------------------------
+//
+void HbToolBar::addAction( HbAction *action )
+{
+ MPX_DEBUG(_L("HbToolBar::addAction") );
+ Q_UNUSED( action );
+
+ HbToolButton *button = new HbToolButton( action );
+ mLayout->addItem( button );
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbToolBar::addAction
+// -------------------------------------------------------------------------------------------------
+//
+QGraphicsLayout* HbToolBar::layout()
+{
+ MPX_DEBUG(_L("HbToolBar::layout") );
+
+ return mLayout;
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testtoolbar/stub/src/hbtoolbutton.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,83 @@
+/*
+* 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 HbToolButton
+*
+*/
+
+// Version : %version: 1 %
+
+
+
+#include <qgraphicswidget>
+
+#include <hbaction.h>
+#include <hbframedrawer.h>
+
+#include "mpxvideo_debug.h"
+#include "hbtoolbutton.h"
+
+// -------------------------------------------------------------------------------------------------
+// HbToolButton::HbToolButton
+// -------------------------------------------------------------------------------------------------
+//
+HbToolButton::HbToolButton( HbAction *action )
+{
+ MPX_ENTER_EXIT(_L("HbToolButton::HbToolButton()"));
+
+ mAction = action;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbToolButton::~HbToolButton
+// -------------------------------------------------------------------------------------------------
+//
+HbToolButton::~HbToolButton()
+{
+ MPX_DEBUG(_L("HbToolButton::HbToolButton") );
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbToolButton::isEnabled
+// -------------------------------------------------------------------------------------------------
+//
+bool HbToolButton::isEnabled()
+{
+ MPX_DEBUG(_L("HbToolButton::isEnabled") );
+
+ return mAction->isEnabled();
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbToolButton::press
+// -------------------------------------------------------------------------------------------------
+//
+void HbToolButton::press()
+{
+ MPX_DEBUG(_L("HbToolButton::press") );
+
+ emit pressed();
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbToolButton::release
+// -------------------------------------------------------------------------------------------------
+//
+void HbToolButton::release()
+{
+ MPX_DEBUG(_L("HbToolButton::release") );
+
+ emit released();
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testtoolbar/stub/src/videobaseplaybackview.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,92 @@
+/*
+* 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 Video playback view
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+// Include Files
+
+#include <hbinstance.h>
+#include <coecntrl.h>
+
+#include "hbtoolbar.h"
+#include "videobaseplaybackview.h"
+
+// Member Functions
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::VideoBasePlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+VideoBasePlaybackView::VideoBasePlaybackView()
+{
+ mToolBar = new HbToolBar();
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::~VideoBasePlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+VideoBasePlaybackView::~VideoBasePlaybackView()
+{
+ if ( mToolBar )
+ {
+ delete mToolBar;
+ mToolBar = NULL;
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::toolBar()
+// -------------------------------------------------------------------------------------------------
+//
+HbToolBar* VideoBasePlaybackView::toolBar()
+{
+ return mToolBar;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::hideItems()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::hideItems( int item )
+{
+ Q_UNUSED( item );
+ mToolBar->setVisible( false );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::hideItems()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::showItems( int item )
+{
+ Q_UNUSED( item );
+ mToolBar->setVisible( true );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::getWindow()
+// -------------------------------------------------------------------------------------------------
+//
+RWindow *VideoBasePlaybackView::getWindow()
+{
+ return static_cast<RWindow*>( hbInstance->allMainWindows()[0]->effectiveWinId()->DrawableWindow() );
+}
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testtoolbar/stub/src/videoplaybackcontrolscontroller.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,139 @@
+/*
+* 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 VideoPlaybackControlsController
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+// INCLUDE FILES
+
+#include "videobaseplaybackview.h"
+#include "videoplaybackcontrolscontroller.h"
+
+// ================= MEMBER FUNCTIONS ==============================================================
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::VideoPlaybackControlsController()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackControlsController::VideoPlaybackControlsController( bool attachOperation )
+ : mViewMode( EFullScreenView )
+ , mIsAttachOperation( attachOperation )
+ , mAttachVideoDone( false )
+ , mSendVideoDone( false )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackControlsController::VideoPlaybackControlsController()"));
+
+ mFileDetails = new VideoPlaybackViewFileDetails();
+ mView = new VideoBasePlaybackView();
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::~VideoPlaybackControlsController
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackControlsController::~VideoPlaybackControlsController()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::~VideoPlaybackControlsController"));
+
+ if ( mFileDetails )
+ {
+ delete mFileDetails;
+ mFileDetails = NULL;
+ }
+
+ if ( mView )
+ {
+ delete mView;
+ mView = NULL;
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::handleCommand()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::handleCommand(
+ TMPXVideoPlaybackViewCommandIds command, int value )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::handleCommand(%d)"), command);
+
+ mCommand = command;
+ mCommandValue = value;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::changeViewMode
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::changeViewMode(
+ TPlaybackViewMode viewMode, bool transitionEffect )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::changeViewMode()"));
+
+ Q_UNUSED( transitionEffect );
+ mViewMode = viewMode;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::resetDisappearingTimers()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::resetDisappearingTimers( TTimerAction timerAction )
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::resetDisappearingTimers()"));
+
+ mTimerAction = timerAction;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::isAttachOperation()
+// -------------------------------------------------------------------------------------------------
+//
+bool VideoPlaybackControlsController::isAttachOperation()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::isAttachOperation() ret %d"),
+ mIsAttachOperation);
+
+ return mIsAttachOperation;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::attachVideo()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::attachVideo()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackControlsController::attachVideo()"));
+
+ handleCommand( EMPXPbvCmdClose );
+ mAttachVideoDone = true;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::sendVideo()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlsController::sendVideo()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackControlsController::sendVideo()"));
+
+ handleCommand( EMPXPbvCmdPause );
+ mSendVideoDone = true;
+}
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testtoolbar/stub/src/videoplaybackviewfiledetails.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,77 @@
+/*
+* 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: class for Video File Details (Qt)
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+//
+// INCLUDE FILES
+//
+#include "mpxvideo_debug.h"
+#include "videoplaybackviewfiledetails.h"
+
+
+// ============================ MEMBER FUNCTIONS ===================================================
+
+VideoPlaybackViewFileDetails::VideoPlaybackViewFileDetails()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewFileDetails::VideoPlaybackViewFileDetails()"));
+
+ clearFileDetails();
+}
+
+VideoPlaybackViewFileDetails::~VideoPlaybackViewFileDetails()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewFileDetails::~VideoPlaybackViewFileDetails()"));
+
+ clearFileDetails();
+}
+
+void
+VideoPlaybackViewFileDetails::clearFileDetails()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewFileDetails::ClearFileDetails()"));
+
+ mMimeType = tr("");
+ mTitle = tr("");
+ mArtist = tr("");
+ mClipName = tr("");
+ mDescription = tr("");
+ mLocation = tr("");
+ mCopyright = tr("");
+ mLanguage = tr("");
+ mKeywords = tr("");
+
+ mPlaybackMode = EMPXVideoLocal;
+ mSeekable = false;
+ mPausableStream = false;
+ mAudioEnabled = false;
+ mVideoEnabled = false;
+ mPartialPlayback = false;
+ mRNFormat = false;
+
+ mDuration = 0;
+ mTvOutConnected = false;
+ mDrmProtected = false;
+
+ mVideoHeight = 0;
+ mVideoWidth = 0;
+ mBitRate = 0;
+}
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testtoolbar/testtoolbar.pro Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,49 @@
+#
+# 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: Project file for building testtoolbar
+#
+#
+# Version : %version: 3 %
+
+TEMPLATE = app
+TARGET = testtoolbar
+CONFIG += qtestlib qt hb
+
+INCLUDEPATH += stub/inc \
+ ../../../../inc \
+ ../../../inc
+
+
+DEPENDPATH += inc src stub/inc stub/src
+
+LIBS += -lws32.dll \
+ -lcone.dll
+
+
+# Input
+HEADERS += testtoolbar.h \
+ videoplaybackcontrolscontroller.h \
+ videoplaybackviewfiledetails.h \
+ videobaseplaybackview.h \
+ hbtoolbar.h \
+ hbtoolbutton.h \
+ ../../controlinc/videoplaybacktoolbar.h
+
+SOURCES += testtoolbar.cpp \
+ videoplaybackcontrolscontroller.cpp \
+ videoplaybackviewfiledetails.cpp \
+ videobaseplaybackview.cpp \
+ hbtoolbar.cpp \
+ hbtoolbutton.cpp \
+ ../../controlsrc/videoplaybacktoolbar.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testuserinputhandler/inc/testuserinputhandler.h Thu Jul 08 13:05:19 2010 +0300
@@ -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: tester for methods in User Input Handler
+*
+*/
+
+#ifndef __TESTUSERINPUTHANDLER_H__
+#define __TESTUSERINPUTHANDLER_H__
+
+
+// INCLUDES
+#include <QtTest/QtTest>
+
+
+
+// forward declaration
+class CMPXVideoViewWrapper;
+class CMPXVideoPlaybackUserInputHandler;
+class VideoBasePlaybackView;
+
+
+class TestUserInputHandler : public QObject
+{
+ Q_OBJECT
+
+public:
+
+ void init();
+
+ void cleanup();
+
+ void setup();
+
+
+ // test functions for the test framework
+private slots:
+
+ void testProcessMediaKeyPlay();
+
+ void testProcessMediaKeyPause();
+
+ void testProcessMediaKeyPlayPause();
+
+ void testProcessMediaKeyStop();
+
+ void testProcessMediaKeyForward();
+
+ void testProcessMediaKeyRewind();
+
+ void testProcessMediaKeyVolumeUp();
+
+ void testProcessMediaKeyVolumeDown();
+
+ void testHandleTVOutEventL();
+
+
+signals:
+
+private:
+ CMPXVideoPlaybackUserInputHandler* mUserInputHdlr;
+ VideoBasePlaybackView* mBaseVideoView;
+ CMPXVideoViewWrapper* mVideoViewWrapper;
+
+};
+
+
+#endif // __TESTUSERINPUTHANDLER_H__
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testuserinputhandler/src/testuserinputhandler.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,323 @@
+/**
+* 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: tester for methods in User Input Handler
+*
+*/
+
+#include <e32err.h>
+#include <w32std.h>
+#include <eikenv.h>
+
+#include <hbapplication.h>
+#include <hbinstance.h>
+#include <QDebug>
+
+#include "testuserinputhandler.h"
+#include "../stub/inc/mpxvideoviewwrapper.h"
+#include "../stub/inc/videobaseplaybackview.h"
+
+#define private public
+#include "mpxvideoplaybackuserinputhandler.h"
+#undef private
+
+
+// ---------------------------------------------------------------------------
+// main
+// ---------------------------------------------------------------------------
+//
+int main(int argc, char *argv[])
+{
+ HbApplication app(argc, argv);
+ HbMainWindow window;
+
+ TestUserInputHandler tv;
+
+ char *pass[3];
+ pass[0] = argv[0];
+ pass[1] = "-o";
+ pass[2] = "c:\\data\\testuserinputhandler.txt";
+
+ int res = QTest::qExec(&tv, 3, pass);
+
+ return res;
+}
+
+
+// ---------------------------------------------------------------------------
+// init
+// ---------------------------------------------------------------------------
+//
+void TestUserInputHandler::init()
+{
+ mBaseVideoView = new VideoBasePlaybackView();
+ mVideoViewWrapper = CMPXVideoViewWrapper::NewL( mBaseVideoView );
+
+ mUserInputHdlr = CMPXVideoPlaybackUserInputHandler::NewL(mVideoViewWrapper, false);
+}
+
+// ---------------------------------------------------------------------------
+// cleanup
+// ---------------------------------------------------------------------------
+//
+void TestUserInputHandler::cleanup()
+{
+ delete mUserInputHdlr;
+ mUserInputHdlr = NULL;
+
+ delete mVideoViewWrapper;
+ mVideoViewWrapper = NULL;
+
+ delete mBaseVideoView;
+ mBaseVideoView = NULL;
+}
+
+// ---------------------------------------------------------------------------
+// setup
+// ---------------------------------------------------------------------------
+//
+void TestUserInputHandler::setup()
+{
+}
+
+void TestUserInputHandler::testProcessMediaKeyPlay()
+{
+ init();
+
+ mUserInputHdlr->iProcessingInputType = EVideoNone;
+
+ mUserInputHdlr->ProcessMediaKey(ERemConCoreApiPlay, ERemConCoreApiButtonPress);
+ QVERIFY( mUserInputHdlr->iProcessingInputType == EVideoMediaKeys );
+
+ // this event should be ignored as the 1st event is still being processed
+ mUserInputHdlr->ProcessMediaKey(ERemConCoreApiPause, ERemConCoreApiButtonPress);
+
+ // verify that "Play" is still being processed and not "Pause"
+ QVERIFY( mUserInputHdlr->iLastMediaKeyPressed == ERemConCoreApiPlay );
+
+ // send the release event for "Play"
+ mUserInputHdlr->ProcessMediaKey(ERemConCoreApiPlay, ERemConCoreApiButtonRelease);
+
+ // verify that no input is now being processed
+ QVERIFY( mUserInputHdlr->iProcessingInputType == EVideoNone );
+
+ cleanup();
+}
+
+void TestUserInputHandler::testProcessMediaKeyPause()
+{
+ init();
+
+ mUserInputHdlr->iProcessingInputType = EVideoNone;
+
+ // Issue Play
+ mUserInputHdlr->ProcessMediaKey(ERemConCoreApiPlay, ERemConCoreApiButtonPress);
+ mUserInputHdlr->ProcessMediaKey(ERemConCoreApiPlay, ERemConCoreApiButtonRelease);
+ QVERIFY( mUserInputHdlr->iProcessingInputType == EVideoNone );
+
+ // Initiate Pause
+ mUserInputHdlr->ProcessMediaKey(ERemConCoreApiPause, ERemConCoreApiButtonPress);
+ QVERIFY( mUserInputHdlr->iProcessingInputType == EVideoMediaKeys );
+ QVERIFY( mUserInputHdlr->iLastMediaKeyPressed == ERemConCoreApiPause );
+
+ mUserInputHdlr->ProcessMediaKey(ERemConCoreApiPause, ERemConCoreApiButtonRelease);
+ QVERIFY( mUserInputHdlr->iProcessingInputType == EVideoNone );
+
+ cleanup();
+
+}
+
+void TestUserInputHandler::testProcessMediaKeyPlayPause()
+{
+ init();
+
+ mUserInputHdlr->iProcessingInputType = EVideoNone;
+
+ mUserInputHdlr->ProcessMediaKey(ERemConCoreApiPausePlayFunction, ERemConCoreApiButtonClick);
+ QVERIFY( mUserInputHdlr->iProcessingInputType == EVideoNone );
+
+ // set to background
+ mUserInputHdlr->iForeground = false;
+
+ mUserInputHdlr->iLastMediaKeyPressed = ENop;
+ // this event should be ignored as iForeground is false
+ mUserInputHdlr->ProcessMediaKey(ERemConCoreApiPausePlayFunction, ERemConCoreApiButtonPress);
+ QVERIFY( mUserInputHdlr->iLastMediaKeyPressed == ENop );
+ QVERIFY( mUserInputHdlr->iProcessingInputType == EVideoNone );
+
+ cleanup();
+}
+
+void TestUserInputHandler::testProcessMediaKeyStop()
+{
+ init();
+
+ mUserInputHdlr->iProcessingInputType = EVideoNone;
+
+ // Issue Play
+ mUserInputHdlr->ProcessMediaKey(ERemConCoreApiPlay, ERemConCoreApiButtonPress);
+ mUserInputHdlr->ProcessMediaKey(ERemConCoreApiPlay, ERemConCoreApiButtonRelease);
+ QVERIFY( mUserInputHdlr->iProcessingInputType == EVideoNone );
+
+ // Stop
+ mUserInputHdlr->ProcessMediaKey(ERemConCoreApiStop, ERemConCoreApiButtonPress);
+ QVERIFY( mUserInputHdlr->iProcessingInputType == EVideoMediaKeys );
+ QVERIFY( mUserInputHdlr->iLastMediaKeyPressed == ERemConCoreApiStop );
+
+ mUserInputHdlr->ProcessMediaKey(ERemConCoreApiStop, ERemConCoreApiButtonRelease);
+ QVERIFY( mUserInputHdlr->iProcessingInputType == EVideoNone );
+
+ cleanup();
+}
+
+void TestUserInputHandler::testProcessMediaKeyForward()
+{
+ init();
+
+ mUserInputHdlr->iProcessingInputType = EVideoNone;
+
+ // Issue Play
+ mUserInputHdlr->ProcessMediaKey(ERemConCoreApiPlay, ERemConCoreApiButtonPress);
+ mUserInputHdlr->ProcessMediaKey(ERemConCoreApiPlay, ERemConCoreApiButtonRelease);
+ QVERIFY( mUserInputHdlr->iProcessingInputType == EVideoNone );
+
+ // Forward
+ mUserInputHdlr->ProcessMediaKey(ERemConCoreApiFastForward, ERemConCoreApiButtonPress);
+ QVERIFY( mUserInputHdlr->iProcessingInputType == EVideoMediaKeys );
+ QVERIFY( mUserInputHdlr->iLastMediaKeyPressed == ERemConCoreApiFastForward );
+
+ mUserInputHdlr->ProcessMediaKey(ERemConCoreApiFastForward, ERemConCoreApiButtonRelease);
+ QVERIFY( mUserInputHdlr->iProcessingInputType == EVideoNone );
+
+ cleanup();
+}
+
+void TestUserInputHandler::testProcessMediaKeyRewind()
+{
+ init();
+
+ mUserInputHdlr->iProcessingInputType = EVideoNone;
+
+ // Issue Play
+ mUserInputHdlr->ProcessMediaKey(ERemConCoreApiPlay, ERemConCoreApiButtonPress);
+ mUserInputHdlr->ProcessMediaKey(ERemConCoreApiPlay, ERemConCoreApiButtonRelease);
+ QVERIFY( mUserInputHdlr->iProcessingInputType == EVideoNone );
+
+ // Forward
+ mUserInputHdlr->ProcessMediaKey(ERemConCoreApiFastForward, ERemConCoreApiButtonPress);
+ QVERIFY( mUserInputHdlr->iProcessingInputType == EVideoMediaKeys );
+ QVERIFY( mUserInputHdlr->iLastMediaKeyPressed == ERemConCoreApiFastForward );
+
+ mUserInputHdlr->ProcessMediaKey(ERemConCoreApiFastForward, ERemConCoreApiButtonRelease);
+ QVERIFY( mUserInputHdlr->iProcessingInputType == EVideoNone );
+
+ // Rewind
+ mUserInputHdlr->ProcessMediaKey(ERemConCoreApiRewind, ERemConCoreApiButtonPress);
+ QVERIFY( mUserInputHdlr->iProcessingInputType == EVideoMediaKeys );
+ QVERIFY( mUserInputHdlr->iLastMediaKeyPressed == ERemConCoreApiRewind );
+
+ mUserInputHdlr->ProcessMediaKey(ERemConCoreApiRewind, ERemConCoreApiButtonRelease);
+ QVERIFY( mUserInputHdlr->iProcessingInputType == EVideoNone );
+
+ cleanup();
+}
+
+void TestUserInputHandler::testProcessMediaKeyVolumeUp()
+{
+ init();
+
+ mUserInputHdlr->iProcessingInputType = EVideoNone;
+
+ // Issue Play
+ mUserInputHdlr->ProcessMediaKey(ERemConCoreApiPlay, ERemConCoreApiButtonPress);
+ mUserInputHdlr->ProcessMediaKey(ERemConCoreApiPlay, ERemConCoreApiButtonRelease);
+ QVERIFY( mUserInputHdlr->iProcessingInputType == EVideoNone );
+
+ // Volume Up
+ mUserInputHdlr->ProcessMediaKey(ERemConCoreApiVolumeUp, ERemConCoreApiButtonPress);
+ QVERIFY( mUserInputHdlr->iProcessingInputType == EVideoMediaKeys );
+ QVERIFY( mUserInputHdlr->iLastMediaKeyPressed == ERemConCoreApiVolumeUp );
+ QVERIFY( mUserInputHdlr->iVolumeRepeatTimer->IsActive() );
+ QVERIFY( mUserInputHdlr->iVolumeRepeatUp );
+
+ mUserInputHdlr->ProcessMediaKey(ERemConCoreApiVolumeUp, ERemConCoreApiButtonRelease);
+ QVERIFY( mUserInputHdlr->iProcessingInputType == EVideoNone );
+ QVERIFY( ! mUserInputHdlr->iVolumeRepeatTimer->IsActive() );
+
+ cleanup();
+}
+
+void TestUserInputHandler::testProcessMediaKeyVolumeDown()
+{
+ init();
+
+ mUserInputHdlr->iProcessingInputType = EVideoNone;
+
+ // Issue Play
+ mUserInputHdlr->ProcessMediaKey(ERemConCoreApiPlay, ERemConCoreApiButtonPress);
+ mUserInputHdlr->ProcessMediaKey(ERemConCoreApiPlay, ERemConCoreApiButtonRelease);
+ QVERIFY( mUserInputHdlr->iProcessingInputType == EVideoNone );
+
+ // Volume Down
+ mUserInputHdlr->ProcessMediaKey(ERemConCoreApiVolumeDown, ERemConCoreApiButtonPress);
+ QVERIFY( mUserInputHdlr->iProcessingInputType == EVideoMediaKeys );
+ QVERIFY( mUserInputHdlr->iLastMediaKeyPressed == ERemConCoreApiVolumeDown );
+ QVERIFY( mUserInputHdlr->iVolumeRepeatTimer->IsActive() );
+ QVERIFY( ! mUserInputHdlr->iVolumeRepeatUp );
+
+ mUserInputHdlr->ProcessMediaKey(ERemConCoreApiVolumeDown, ERemConCoreApiButtonRelease);
+ QVERIFY( mUserInputHdlr->iProcessingInputType == EVideoNone );
+ QVERIFY( ! mUserInputHdlr->iVolumeRepeatTimer->IsActive() );
+
+ cleanup();
+}
+
+void TestUserInputHandler::testHandleTVOutEventL()
+{
+
+ ///////////////////////////////
+ // 1. HandleTVOutEventL(true)
+ ///////////////////////////////
+ init();
+
+ mUserInputHdlr->iDisplayTimeOut = 0;
+
+ mUserInputHdlr->HandleTVOutEventL(true);
+
+ QVERIFY( mUserInputHdlr->iDisplayTimeOut != 0 );
+ QVERIFY( mUserInputHdlr->iDisplayTimer->IsActive() );
+
+ cleanup();
+
+
+ ///////////////////////////////
+ // 2. HandleTVOutEventL(false)
+ ///////////////////////////////
+ init();
+
+ mUserInputHdlr->iDisplayTimeOut = 0;
+
+ mUserInputHdlr->HandleTVOutEventL(false);
+ QVERIFY( ! mUserInputHdlr->iDisplayTimer->IsActive() );
+
+ cleanup();
+
+}
+
+
+
+
+// End of file
+
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testuserinputhandler/stub/inc/centralrepository.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,34 @@
+// Copyright (c) 2004-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 declaration for central repository
+//
+
+#ifndef __CENTRALREPOSITORY_H__
+#define __CENTRALREPOSITORY_H__
+
+#include <e32base.h>
+
+
+class CRepository : public CBase
+ {
+public:
+
+ static CRepository* NewLC(TUid aRepositoryUid);
+
+ virtual ~CRepository();
+
+ TInt Get(TUint32 aKey, TInt& aValue);
+
+ };
+
+#endif // __CENTRALREPOSITORY_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testuserinputhandler/stub/inc/hal.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,43 @@
+/*
+* 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: Stub declaration for HAL
+*
+*/
+
+// Version : %version: 1 %
+
+
+
+#ifndef __HAL_H__
+#define __HAL_H__
+
+#include <e32base.h>
+#include <e32std.h>
+
+class HAL : public CBase
+ {
+
+public:
+
+ static TInt Get(TAttribute aAttribute, TInt& aValue);
+
+
+ static TInt Set(TAttribute aAttribute, TInt aValue);
+
+
+ };
+
+
+#endif
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testuserinputhandler/stub/inc/mpxvideoviewwrapper.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,88 @@
+/*
+* 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: MPX Video base playback view
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+// This file defines the API for .dll
+
+#ifndef __MPXVIDEOVIEWWRAPPER_H__
+#define __MPXVIDEOVIEWWRAPPER_H__
+
+// Include Files
+
+#include <e32base.h> // CBase
+#include <e32std.h> // TBuf
+
+
+#include "videoplaybackcontrol.hrh"
+
+// Constants
+
+// Forward Declarations
+class VideoBasePlaybackView;
+class VideoPlaybackViewFileDetails;
+
+
+// Class Definitions
+
+class CMPXVideoViewWrapper : public CBase
+{
+ public:
+ static CMPXVideoViewWrapper* NewL( VideoBasePlaybackView* aView );
+ virtual ~CMPXVideoViewWrapper();
+
+ private:
+ CMPXVideoViewWrapper( VideoBasePlaybackView* aView );
+ void ConstructL();
+
+ void SetFileDetails(TBool aDefault);
+
+ public:
+ void HandleCommandL( TInt aCommand );
+
+ TBool IsLive();
+
+ TBool IsPlaylist();
+
+ TBool IsMultiItemPlaylist();
+
+ void RequestMediaL();
+
+ void CreateGeneralPlaybackCommandL( int aCmd );
+
+ void ActivateClosePlayerActiveObject();
+
+ void IssueVideoAppForegroundCmdL( TBool aForeground );
+
+ void UpdateVideoRectDone();
+
+
+ public: // data
+
+ VideoBasePlaybackView* iView;
+ TBool iMediaRequested;
+ VideoPlaybackViewFileDetails* iFileDetails;
+ TBool iClosePlayerAO;
+ TBool iForeground;
+
+};
+
+#endif // __MPXVIDEOVIEWWRAPPER_H__
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testuserinputhandler/stub/inc/videobaseplaybackview.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,91 @@
+/*
+* 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: Video playback view
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+// This file defines the API for .dll
+
+#ifndef __VIDEOBASEPLAYBACKVIEW_H__
+#define __VIDEOBASEPLAYBACKVIEW_H__
+
+// Include Files
+#include <hbview.h>
+
+class CMPXVideoViewWrapper;
+class RWindow;
+
+// Constants
+
+// Forward Declarations
+
+// Class Definitions
+
+class VideoBasePlaybackView : public HbView
+{
+ Q_OBJECT
+
+ public:
+ VideoBasePlaybackView();
+ virtual ~VideoBasePlaybackView();
+
+ void handleActivateView();
+
+ void handleDeactivateView();
+
+ void mousePressEvent( QGraphicsSceneMouseEvent *event );
+
+ QVariant itemChange( GraphicsItemChange change, const QVariant &value );
+
+ void paint( QPainter *painter,
+ const QStyleOptionGraphicsItem *option,
+ QWidget *widget );
+
+ bool event( QEvent *event );
+
+ virtual void handleClosePlaybackView();
+
+ virtual void handleBufferingState();
+
+ virtual void issuePlayCommand();
+
+ virtual void handlePluginError( int aError );
+
+ virtual void retrievePdlInformation();
+
+ virtual void closePlaybackView();
+
+ void startClosingPlaybackView();
+
+ RWindow *getWindow();
+
+ virtual void doClosePlayer();
+
+ public:
+ int mCurrentError; // default = KErrNone
+ bool mViewActive;
+
+
+ public:
+ friend class CMPXVideoViewWrapper;
+
+};
+
+#endif // __VIDEOBASEPLAYBACKVIEW_H__
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testuserinputhandler/stub/inc/videoplaybackviewfiledetails.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,79 @@
+/*
+* 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: Video File Details (QT)
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+
+#ifndef __VIDEOPLAYBACKVIEWFILEDETAILS__
+#define __VIDEOPLAYBACKVIEWFILEDETAILS__
+
+#include <qobject.h>
+#include "mpxhelixplaybackplugindefs.h"
+
+
+//
+// CLASS DECLARATION
+//
+class VideoPlaybackViewFileDetails : public QObject
+{
+ public:
+ //
+ // Constructor
+ //
+ VideoPlaybackViewFileDetails();
+
+ //
+ // Destructor.
+ //
+ virtual ~VideoPlaybackViewFileDetails();
+
+ //
+ // Clear all file details
+ //
+ void clearFileDetails();
+
+ public:
+ //
+ // Data
+ //
+ QString mClipName;
+ QString mTitle;
+ QString mArtist;
+ QString mMimeType;
+
+ TMPXVideoMode mPlaybackMode;
+ bool mSeekable;
+ bool mPausableStream;
+ bool mAudioEnabled;
+ bool mVideoEnabled;
+ bool mPartialPlayback;
+ bool mRNFormat;
+ bool mTvOutConnected;
+ bool mDrmProtected;
+ bool mMultiItemPlaylist;
+
+ int mVideoHeight;
+ int mVideoWidth;
+ int mBitRate;
+ int mDuration;
+};
+
+#endif // __VIDEOPLAYBACKVIEWFILEDETAILS__
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testuserinputhandler/stub/src/centralrepository.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,49 @@
+/*
+* 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 implementation for central repository
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+//
+// INCLUDE FILES
+//
+#include "centralrepository.h"
+
+
+CRepository* CRepository::NewLC( TUid /* aRepositoryUid */ )
+{
+ CRepository* self = new (ELeave) CRepository();
+
+ CleanupStack::PushL( self );
+
+ return self;
+}
+
+
+TInt CRepository::Get( TUint32 /* aKey */, TInt& aValue )
+{
+ aValue = 10;
+ return KErrNone;
+}
+
+CRepository::~CRepository()
+{
+}
+
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testuserinputhandler/stub/src/hal.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,40 @@
+/*
+* 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 implementation for HAL
+*
+*/
+
+// Version : %version: 1 %
+
+
+
+//
+// INCLUDE FILES
+//
+#include "hal.h"
+
+
+TInt HAL::Get(TAttribute /*aAttribute*/, TInt& aValue)
+{
+ aValue = 5;
+ return KErrNone;
+}
+
+TInt HAL::Set(TAttribute /*aAttribute*/, TInt /*aValue*/)
+{
+ return KErrNone;
+}
+
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testuserinputhandler/stub/src/mpxvideoviewwrapper.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,229 @@
+/*
+* 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 Video base playback view
+*
+*/
+
+// Version : %version: 5 %
+
+
+
+// Include Files
+
+#include "mpxvideoviewwrapper.h"
+#include "videobaseplaybackview.h"
+#include "videoplaybackviewfiledetails.h"
+#include "mpxcommonvideoplaybackview.hrh"
+
+// Member Functions
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::CMPXVideoViewWrapper()
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoViewWrapper::CMPXVideoViewWrapper( VideoBasePlaybackView* aView )
+ : iView( aView )
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::NewL()
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoViewWrapper* CMPXVideoViewWrapper::NewL( VideoBasePlaybackView* aView )
+{
+ CMPXVideoViewWrapper* self = new (ELeave) CMPXVideoViewWrapper( aView );
+
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ CleanupStack::Pop();
+
+ return self;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::ConstructL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::ConstructL()
+{
+ iMediaRequested = EFalse;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::~CMPXVideoViewWrapper()
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoViewWrapper::~CMPXVideoViewWrapper()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::IsLive()
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoViewWrapper::IsLive()
+{
+ return EFalse;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::IsPlaylist()
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoViewWrapper::IsPlaylist()
+{
+ return EFalse;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::CreateGeneralPlaybackCommandL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::CreateGeneralPlaybackCommandL( int aCmd )
+{
+ Q_UNUSED( aCmd );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::HandleCommandL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::HandleCommandL( TInt aCommand )
+{
+ switch ( aCommand )
+ {
+ case EMPXPbvCmdNextListItem:
+ {
+ SetFileDetails( EFalse );
+ break;
+ }
+
+ case EMPXPbvCmdPreviousListItem:
+ {
+ SetFileDetails( ETrue );
+ break;
+ }
+ }
+
+}
+
+// -------------------------------------------------------------------------------------------------
+// Request for the media object
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::RequestMediaL()
+{
+ iMediaRequested = ETrue;
+
+ SetFileDetails( ETrue );
+
+}
+
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::ActivateClosePlayerActiveObject
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::ActivateClosePlayerActiveObject()
+{
+ iClosePlayerAO = ETrue;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::IsMultiItemPlaylist()
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoViewWrapper::IsMultiItemPlaylist()
+{
+ return iFileDetails->mMultiItemPlaylist;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::SetFileDetails()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::SetFileDetails(TBool aDefault)
+{
+ if ( iFileDetails )
+ {
+ delete iFileDetails;
+ iFileDetails = NULL;
+ }
+
+ iFileDetails = new VideoPlaybackViewFileDetails();
+
+
+ _LIT(KTestMimeType, "video/3gp");
+ const QString qMimeType( (QChar*)KTestMimeType().Ptr(), KTestMimeType().Length() );
+ iFileDetails->mMimeType = qMimeType;
+
+
+ _LIT(KTestTitle, "Test Video Title");
+ const QString qTitle( (QChar*)KTestTitle().Ptr(), KTestTitle().Length() );
+ iFileDetails->mTitle = qTitle;
+
+
+ _LIT(KTestArtist, "TestArtist");
+ const QString qArtist( (QChar*)KTestArtist().Ptr(), KTestArtist().Length() );
+ iFileDetails->mArtist = qArtist;
+
+ if ( aDefault )
+ {
+ _LIT(KTestClipName, "testClip.3gp");
+ const QString qClipname( (QChar*)KTestClipName().Ptr(), KTestClipName().Length() );
+ iFileDetails->mClipName = qClipname;
+ }
+ else
+ {
+ _LIT(KTestClipName, "nextClip.3gp");
+ const QString qClipname( (QChar*)KTestClipName().Ptr(), KTestClipName().Length() );
+ iFileDetails->mClipName = qClipname;
+ }
+
+
+ iFileDetails->mPlaybackMode = EMPXVideoLocal;
+ iFileDetails->mSeekable = true;
+ iFileDetails->mPausableStream = true;
+ iFileDetails->mAudioEnabled = true;
+ iFileDetails->mVideoEnabled = true;
+ iFileDetails->mPartialPlayback = false;
+ iFileDetails->mRNFormat = false;
+ iFileDetails->mDuration = 100;
+ iFileDetails->mTvOutConnected = false;
+ iFileDetails->mDrmProtected = false;
+ iFileDetails->mMultiItemPlaylist = false;
+ iFileDetails->mVideoHeight = 320;
+ iFileDetails->mVideoWidth = 240;
+ iFileDetails->mBitRate = 16000;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::IssueVideoAppForegroundCmd()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::IssueVideoAppForegroundCmdL( TBool aForeground )
+{
+ iForeground = aForeground;
+}
+
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::UpdateVideoRectDone()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::UpdateVideoRectDone()
+{
+}
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testuserinputhandler/stub/src/videobaseplaybackview.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,194 @@
+/*
+* 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 Video playback view
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+// Include Files
+#include <aknappui.h>
+#include <qgraphicssceneevent>
+#include <hbinstance.h>
+#include <mmf/common/mmferrors.h>
+
+#include "../inc/videobaseplaybackview.h"
+
+
+// Member Functions
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::VideoBasePlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+VideoBasePlaybackView::VideoBasePlaybackView()
+{
+ mCurrentError = KErrNone;
+ mViewActive = false;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::~VideoBasePlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+VideoBasePlaybackView::~VideoBasePlaybackView()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::handleActivateView()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::handleActivateView()
+{
+ mViewActive = true;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::handleDeactivateView()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::handleDeactivateView()
+{
+ mViewActive = false;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::mousePress
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::mousePressEvent( QGraphicsSceneMouseEvent *event )
+{
+ Q_UNUSED( event );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::itemChange
+// -------------------------------------------------------------------------------------------------
+//
+QVariant VideoBasePlaybackView::itemChange( GraphicsItemChange change, const QVariant &value )
+{
+ return QGraphicsWidget::itemChange( change, value );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::closePlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::paint( QPainter *painter,
+ const QStyleOptionGraphicsItem *option,
+ QWidget *widget )
+{
+ Q_UNUSED( painter );
+ Q_UNUSED( option );
+ Q_UNUSED( widget );
+}
+
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::event()
+// -------------------------------------------------------------------------------------------------
+//
+bool VideoBasePlaybackView::event( QEvent *event )
+{
+ Q_UNUSED( event );
+ bool consumed = false;
+
+ return consumed;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::handleClosePlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::handleClosePlaybackView()
+{
+ mViewActive = false;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::issuePlayCommand
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::issuePlayCommand()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::handleBufferingState
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::handleBufferingState()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::handlePluginError()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::handlePluginError( int aError )
+{
+ mCurrentError = aError;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::doClosePlayer
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::doClosePlayer()
+{
+ mViewActive = false;
+}
+
+
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::retrievePdlInformation
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::retrievePdlInformation()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::closePlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::closePlaybackView()
+{
+ mViewActive = false;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::startClosingPlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::startClosingPlaybackView()
+{
+ mViewActive = false;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::getWindow()
+// -------------------------------------------------------------------------------------------------
+//
+RWindow *VideoBasePlaybackView::getWindow()
+{
+ return static_cast<RWindow*>( hbInstance->allMainWindows()[0]->effectiveWinId()->DrawableWindow() );
+}
+
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testuserinputhandler/stub/src/videoplaybackviewfiledetails.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,69 @@
+/*
+* 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: class for Video File Details (Qt)
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+//
+// INCLUDE FILES
+//
+#include "mpxvideo_debug.h"
+#include "videoplaybackviewfiledetails.h"
+
+
+// ============================ MEMBER FUNCTIONS ===================================================
+
+VideoPlaybackViewFileDetails::VideoPlaybackViewFileDetails()
+{
+ clearFileDetails();
+}
+
+VideoPlaybackViewFileDetails::~VideoPlaybackViewFileDetails()
+{
+ clearFileDetails();
+}
+
+void
+VideoPlaybackViewFileDetails::clearFileDetails()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewFileDetails::ClearFileDetails()"));
+
+ mMimeType = tr("");
+ mTitle = tr("");
+ mArtist = tr("");
+ mClipName = QString("testClip.3gp");
+
+ mPlaybackMode = EMPXVideoLocal;
+ mSeekable = false;
+ mPausableStream = false;
+ mAudioEnabled = true;
+ mVideoEnabled = false;
+ mPartialPlayback = false;
+ mRNFormat = false;
+
+ mDuration = 0;
+ mTvOutConnected = false;
+ mDrmProtected = false;
+ mMultiItemPlaylist = false;
+
+ mVideoHeight = 0;
+ mVideoWidth = 0;
+ mBitRate = 0;
+}
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testuserinputhandler/testuserinputhandler.pro Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,52 @@
+#
+# 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 testuserinputhandler
+#
+#
+# Version : %version: 3 %
+
+TEMPLATE = app
+TARGET = testuserinputhandler
+CONFIG += qtestlib hb qt
+DEFINES += BUILD_VIDEOPLAYBACK_DLL
+
+DEPENDPATH += . \
+ inc \
+ src
+
+INCLUDEPATH += ../../../inc \
+ ../../../../inc \
+ ../../controlinc \
+
+
+LIBS += -lremconcoreapi.dll \
+ -lremconInterfacebase.dll
+
+
+# Input
+HEADERS += stub/inc/mpxvideoviewwrapper.h \
+ stub/inc/videobaseplaybackview.h \
+ stub/inc/videoplaybackviewfiledetails.h \
+ stub/inc/hal.h \
+ stub/inc/centralrepository.h \
+ inc/testuserinputhandler.h \
+ ../../viewinc/mpxvideoplaybackuserinputhandler.h
+
+SOURCES += stub/src/mpxvideoviewwrapper.cpp \
+ stub/src/videobaseplaybackview.cpp \
+ stub/src/videoplaybackviewfiledetails.cpp \
+ stub/src/hal.cpp \
+ stub/src/centralrepository.cpp \
+ src/testuserinputhandler.cpp \
+ ../../viewsrc/mpxvideoplaybackuserinputhandler.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testvideodisplayhandler/inc/testvideodisplayhandler.h Thu Jul 08 13:05:19 2010 +0300
@@ -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: tester for methods in Video Display Handler
+*
+*/
+
+#ifndef __TESTVIDEODISPLAYHANDLER_H__
+#define __TESTVIDEODISPLAYHANDLER_H__
+
+
+// INCLUDES
+#include <QtTest/QtTest>
+
+// forward declaration
+class CMPXVideoPlaybackDisplayHandler;
+class MMPXPlaybackUtility;
+class VideoBasePlaybackView;
+class CMPXVideoViewWrapper;
+class VideoPlaybackViewFileDetails;
+
+
+class TestVideoDisplayHandler : public QObject
+{
+ Q_OBJECT
+
+ public:
+
+ /**
+ * will be called before each testfunction is executed.
+ *
+ */
+ void init();
+
+ /**
+ * will be called after every testfunction.
+ *
+ */
+ void cleanup();
+
+ void setup();
+
+ // test functions for the test framework
+ private slots:
+ // the order in which these testXX methods are declared is important
+ // changing this order will affect the test results
+ void testCreateDisplayWindowL();
+ void testRemoveDisplayWindow();
+ void testHandleSurfaceCreatedMessageL();
+ void testHandleSurfaceChangedMessageL();
+ void testHandleVideoRemovedMessageL();
+ void testSetAspectRatioL();
+ void testSetDefaultAspectRatioL();
+ void testUpdateVideoRectL();
+
+
+ private:
+ CMPXVideoPlaybackDisplayHandler* mDispHdlr;
+ MMPXPlaybackUtility* mPlaybackUtility;
+ VideoBasePlaybackView* mBaseVideoView;
+ CMPXVideoViewWrapper* mVideoViewWrapper;
+ VideoPlaybackViewFileDetails* mFileDetails;
+};
+
+#endif // __TESTVIDEODISPLAYHANDLER_H__
+
+// End of file
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testvideodisplayhandler/src/testvideodisplayhandler.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,273 @@
+/**
+* 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: tester for methods in Video Display Handler
+*
+*/
+
+#include <e32err.h>
+#include <w32std.h>
+#include <eikenv.h>
+
+#include <hbapplication.h>
+#include <hbinstance.h>
+#include <QDebug>
+
+#include <mpxplaybackutility.h>
+
+#include "testvideodisplayhandler.h"
+#include "../stub/inc/videobaseplaybackview.h"
+#include "../stub/inc/videoplaybackviewfiledetails.h"
+#include "mpxvideoviewwrapper.h"
+
+#define private public
+#include "mpxvideoplaybackdisplayhandler.h"
+#undef private
+
+
+// ---------------------------------------------------------------------------
+// main
+// ---------------------------------------------------------------------------
+//
+int main(int argc, char *argv[])
+{
+ HbApplication app(argc, argv);
+ HbMainWindow window;
+
+ TestVideoDisplayHandler tv;
+
+ char *pass[3];
+ pass[0] = argv[0];
+ pass[1] = "-o";
+ pass[2] = "c:\\data\\testvideodisplayhandler.txt";
+
+ int res = QTest::qExec(&tv, 3, pass);
+
+ return res;
+}
+
+
+// ---------------------------------------------------------------------------
+// init
+// ---------------------------------------------------------------------------
+//
+void TestVideoDisplayHandler::init()
+{
+ mPlaybackUtility = MMPXPlaybackUtility::UtilityL( KPbModeDefault );
+
+ mBaseVideoView = new VideoBasePlaybackView();
+ mVideoViewWrapper = CMPXVideoViewWrapper::NewL( mBaseVideoView );
+
+ mDispHdlr = CMPXVideoPlaybackDisplayHandler::NewL(mPlaybackUtility, mVideoViewWrapper);
+}
+
+// ---------------------------------------------------------------------------
+// cleanup
+// ---------------------------------------------------------------------------
+//
+void TestVideoDisplayHandler::cleanup()
+{
+ if ( mPlaybackUtility )
+ {
+ mPlaybackUtility->Close();
+ mPlaybackUtility = NULL;
+ }
+
+ delete mDispHdlr;
+ mDispHdlr = NULL;
+
+ delete mVideoViewWrapper;
+ mVideoViewWrapper = NULL;
+
+ delete mBaseVideoView;
+ mBaseVideoView = NULL;
+}
+
+// ---------------------------------------------------------------------------
+// setup
+// ---------------------------------------------------------------------------
+//
+void TestVideoDisplayHandler::setup()
+{
+ init();
+
+ RWindow *window = mBaseVideoView->getWindow();
+
+ TRect displayRect = TRect( window->Position().iX,
+ window->Position().iY,
+ window->Position().iX + window->Size().iWidth,
+ window->Position().iY + window->Size().iHeight );
+
+ mDispHdlr->CreateDisplayWindowL( CCoeEnv::Static()->WsSession(),
+ *(CCoeEnv::Static()->ScreenDevice()),
+ *window,
+ displayRect);
+
+ QCOMPARE( mDispHdlr->iWindowRect, displayRect);
+
+}
+
+
+void TestVideoDisplayHandler::testCreateDisplayWindowL()
+{
+ setup();
+
+ cleanup();
+}
+
+void TestVideoDisplayHandler::testRemoveDisplayWindow()
+{
+ setup();
+
+ mDispHdlr->RemoveDisplayWindow();
+
+ QVERIFY( mDispHdlr->iVideoContainer == NULL );
+
+ cleanup();
+}
+
+void TestVideoDisplayHandler::testHandleSurfaceCreatedMessageL()
+{
+ setup();
+
+ CMPXMessage* message = NULL;
+ TRAP_IGNORE
+ (
+ message = CMPXMessage::NewL();
+ message->SetTObjectValueL<TMPXVideoDisplayCommand>
+ ( KMPXMediaVideoDisplayCommand, EPbMsgVideoSurfaceCreated );
+ );
+
+ mDispHdlr->HandleVideoDisplayMessageL( message );
+
+ QVERIFY( ! mDispHdlr->iSurfaceId.IsNull() );
+
+ mDispHdlr->RemoveDisplayWindow();
+ cleanup();
+}
+
+void TestVideoDisplayHandler::testHandleSurfaceChangedMessageL()
+{
+ setup();
+
+ CMPXMessage* message = NULL;
+ TRAP_IGNORE
+ (
+ message = CMPXMessage::NewL();
+ message->SetTObjectValueL<TMPXVideoDisplayCommand>
+ ( KMPXMediaVideoDisplayCommand, EPbMsgVideoSurfaceChanged );
+ );
+
+ mDispHdlr->HandleVideoDisplayMessageL( message );
+
+ QVERIFY( ! mDispHdlr->iSurfaceId.IsNull() );
+
+ mDispHdlr->RemoveDisplayWindow();
+ cleanup();
+}
+
+void TestVideoDisplayHandler::testHandleVideoRemovedMessageL()
+{
+ setup();
+
+ CMPXMessage* message = NULL;
+ TRAP_IGNORE
+ (
+ message = CMPXMessage::NewL();
+ message->SetTObjectValueL<TMPXVideoDisplayCommand>
+ ( KMPXMediaVideoDisplayCommand, EPbMsgVideoSurfaceRemoved );
+ );
+
+ mDispHdlr->HandleVideoDisplayMessageL( message );
+
+ QVERIFY( mDispHdlr->iSurfaceId.IsNull() );
+
+ mDispHdlr->RemoveDisplayWindow();
+ cleanup();
+}
+
+void TestVideoDisplayHandler::testSetAspectRatioL()
+{
+ setup();
+
+ int aspectRatio = mDispHdlr->SetAspectRatioL( EPbCmdNaturalAspectRatio );
+
+ QVERIFY( aspectRatio == EMMFNatural );
+
+ mDispHdlr->RemoveDisplayWindow();
+ cleanup();
+}
+
+void TestVideoDisplayHandler::testSetDefaultAspectRatioL()
+{
+ setup();
+
+ //
+ // get window size
+ //
+ RWindow *window = mBaseVideoView->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);
+
+ //
+ // aspect ratio zoom
+ //
+ mFileDetails = new VideoPlaybackViewFileDetails();
+ mFileDetails->mVideoHeight = 280;
+ mFileDetails->mVideoWidth = 600;
+
+ int aspectRatio = mDispHdlr->SetDefaultAspectRatioL( mFileDetails, displayAspectRatio );
+
+ QVERIFY( aspectRatio == EMMFZoom );
+
+ //
+ // aspect ratio stretch
+ //
+ mFileDetails->mVideoHeight = 144;
+ mFileDetails->mVideoWidth = 220;
+
+ aspectRatio = mDispHdlr->SetDefaultAspectRatioL( mFileDetails, displayAspectRatio );
+
+ QVERIFY( aspectRatio == EMMFStretch );
+
+ mDispHdlr->RemoveDisplayWindow();
+
+ cleanup();
+}
+
+void TestVideoDisplayHandler::testUpdateVideoRectL()
+{
+ setup();
+
+ RWindow *window = mBaseVideoView->getWindow();
+
+ TRect displayRect = TRect( 0, 0, 200, 300 );
+
+ mDispHdlr->UpdateVideoRectL( displayRect, false );
+
+ QCOMPARE( mDispHdlr->iWindowRect, displayRect);
+
+ mDispHdlr->RemoveDisplayWindow();
+ cleanup();
+}
+
+// End of file
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testvideodisplayhandler/stub/inc/alfcompositionutility.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,56 @@
+/*
+* 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: Stub declaration for CAlfCompositionSource
+*
+*/
+
+// Version : %version: 1 %
+
+
+
+// This file defines the API for .dll
+
+#ifndef __ALFCOMPOSITIONUTILITY_H__
+#define __ALFCOMPOSITIONUTILITY_H__
+
+// Include Files
+
+#include <e32base.h> // CBase
+#include <e32std.h> // TBuf
+
+
+class RWindow;
+
+
+// Class Definitions
+
+class CAlfCompositionSource : public CBase
+ {
+
+public:
+
+ static CAlfCompositionSource* NewL( RWindow& aClientWindow );
+
+ ~CAlfCompositionSource();
+
+ /**
+ * Enables / disables alpha on composition target
+ **/
+ TInt EnableAlpha( TBool aEnable = ETrue );
+
+ };
+
+#endif // #define __ALFCOMPOSITIONUTILITY_H__
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testvideodisplayhandler/stub/inc/mediaclientvideodisplay.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,54 @@
+// 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 declaration for CMediaClientVideoDisplay
+//
+
+
+#ifndef MEDIACLIENTVIDEODISPLAY_H
+#define MEDIACLIENTVIDEODISPLAY_H
+
+#include <w32std.h>
+#include <mmf/common/mmfvideosurfacecustomcommands.h>
+
+CMediaClientVideoDisplay : public CBase
+ {
+public:
+
+ static CMediaClientVideoDisplay* NewL(TInt aDisplayId);
+
+ ~CMediaClientVideoDisplay();
+
+ CMediaClientVideoDisplay();
+
+ void AddDisplayWindowL(const RWindowBase* aWindow, const TRect& aClipRect, const TRect& aCropRegion,
+ const TRect& aVideoExtent, TReal32 aScaleWidth, TReal32 aScaleHeight,
+ TVideoRotation aRotation, TAutoScaleType aAutoScaleType,
+ TInt aHorizPos, TInt aVertPos, RWindow* aWindow2);
+
+
+ void RemoveSurface();
+
+ TInt SurfaceCreated(const TSurfaceId& aSurfaceId, const TRect& aCropRect, TVideoAspectRatio aAspectRatio, const TRect& aCropRegion);
+
+ TInt SurfaceParametersChanged(const TSurfaceId& aSurfaceId, const TRect& aCropRect, TVideoAspectRatio aAspectRatio);
+
+ TInt RedrawWindows(const TRect& aCropRegion);
+
+ void SetVideoExtentL(const RWindowBase& aWindow, const TRect& aVideoExtent, const TRect& aCropRegion);
+
+ void SetAutoScaleL(TAutoScaleType aScaleType, TInt aHorizPos, TInt aVertPos, const TRect& aCropRegion);
+
+ };
+
+#endif // MEDIACLIENTVIDEODISPLAY_H
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testvideodisplayhandler/stub/inc/mpxvideocontainer.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,42 @@
+/*
+* 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:
+*
+*/
+
+// Version : %version: 1 %
+
+
+#ifndef CMPXVIDEOCONTAINER_H
+#define CMPXVIDEOCONTAINER_H
+
+#include <coecntrl.h>
+
+
+class CMPXVideoContainer : public CCoeControl
+{
+
+ public:
+ CMPXVideoContainer();
+ virtual ~CMPXVideoContainer();
+
+ void ConstructL();
+
+ protected:
+ void Draw(const TRect& aRect) const;
+};
+
+#endif // CMPXVIDEOCONTAINER_H
+
+// End of file
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testvideodisplayhandler/stub/inc/mpxvideoviewwrapper.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,88 @@
+/*
+* 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: MPX Video base playback view
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+// This file defines the API for .dll
+
+#ifndef __MPXVIDEOVIEWWRAPPER_H__
+#define __MPXVIDEOVIEWWRAPPER_H__
+
+// Include Files
+
+#include <e32base.h> // CBase
+#include <e32std.h> // TBuf
+
+
+#include "videoplaybackcontrol.hrh"
+
+// Constants
+
+// Forward Declarations
+class VideoBasePlaybackView;
+class VideoPlaybackViewFileDetails;
+
+
+// Class Definitions
+
+class CMPXVideoViewWrapper : public CBase
+{
+ public:
+ static CMPXVideoViewWrapper* NewL( VideoBasePlaybackView* aView );
+ virtual ~CMPXVideoViewWrapper();
+
+ private:
+ CMPXVideoViewWrapper( VideoBasePlaybackView* aView );
+ void ConstructL();
+
+ void SetFileDetails(TBool aDefault);
+
+ public:
+ void HandleCommandL( TInt aCommand );
+
+ TBool IsLive();
+
+ TBool IsPlaylist();
+
+ TBool IsMultiItemPlaylist();
+
+ void RequestMediaL();
+
+ void CreateGeneralPlaybackCommandL( int aCmd );
+
+ void ActivateClosePlayerActiveObject();
+
+ void IssueVideoAppForegroundCmdL( TBool aForeground );
+
+ void UpdateVideoRectDone();
+
+
+ public: // data
+
+ VideoBasePlaybackView* iView;
+ TBool iMediaRequested;
+ VideoPlaybackViewFileDetails* iFileDetails;
+ TBool iClosePlayerAO;
+ TBool iForeground;
+
+};
+
+#endif // __MPXVIDEOVIEWWRAPPER_H__
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testvideodisplayhandler/stub/inc/videobaseplaybackview.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,91 @@
+/*
+* 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: Video playback view
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+// This file defines the API for .dll
+
+#ifndef __VIDEOBASEPLAYBACKVIEW_H__
+#define __VIDEOBASEPLAYBACKVIEW_H__
+
+// Include Files
+#include <hbview.h>
+
+class CMPXVideoViewWrapper;
+class RWindow;
+
+// Constants
+
+// Forward Declarations
+
+// Class Definitions
+
+class VideoBasePlaybackView : public HbView
+{
+ Q_OBJECT
+
+ public:
+ VideoBasePlaybackView();
+ virtual ~VideoBasePlaybackView();
+
+ void handleActivateView();
+
+ void handleDeactivateView();
+
+ void mousePressEvent( QGraphicsSceneMouseEvent *event );
+
+ QVariant itemChange( GraphicsItemChange change, const QVariant &value );
+
+ void paint( QPainter *painter,
+ const QStyleOptionGraphicsItem *option,
+ QWidget *widget );
+
+ bool event( QEvent *event );
+
+ virtual void handleClosePlaybackView();
+
+ virtual void handleBufferingState();
+
+ virtual void issuePlayCommand();
+
+ virtual void handlePluginError( int aError );
+
+ virtual void retrievePdlInformation();
+
+ virtual void closePlaybackView();
+
+ void startClosingPlaybackView();
+
+ RWindow *getWindow();
+
+ virtual void doClosePlayer();
+
+ public:
+ int mCurrentError; // default = KErrNone
+ bool mViewActive;
+
+
+ public:
+ friend class CMPXVideoViewWrapper;
+
+};
+
+#endif // __VIDEOBASEPLAYBACKVIEW_H__
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testvideodisplayhandler/stub/inc/videoplaybackviewfiledetails.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,84 @@
+/*
+* 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: Video File Details (QT)
+*
+*/
+
+// Version : %version: 4 %
+
+
+
+
+#ifndef __VIDEOPLAYBACKVIEWFILEDETAILS__
+#define __VIDEOPLAYBACKVIEWFILEDETAILS__
+
+#include <qobject.h>
+#include "mpxhelixplaybackplugindefs.h"
+
+
+//
+// CLASS DECLARATION
+//
+class VideoPlaybackViewFileDetails : public QObject
+{
+ public:
+ //
+ // Constructor
+ //
+ VideoPlaybackViewFileDetails();
+
+ //
+ // Destructor.
+ //
+ virtual ~VideoPlaybackViewFileDetails();
+
+ //
+ // Clear all file details
+ //
+ void clearFileDetails();
+
+ public:
+ //
+ // Data
+ //
+ QString mClipName;
+ QString mTitle;
+ QString mArtist;
+ QString mMimeType;
+ QString mDescription;
+ QString mLocation;
+ QString mCopyright;
+ QString mLanguage;
+ QString mKeywords;
+
+ TMPXVideoMode mPlaybackMode;
+ bool mSeekable;
+ bool mPausableStream;
+ bool mAudioEnabled;
+ bool mVideoEnabled;
+ bool mPartialPlayback;
+ bool mRNFormat;
+ bool mTvOutConnected;
+ bool mDrmProtected;
+ bool mMultiItemPlaylist;
+
+ int mVideoHeight;
+ int mVideoWidth;
+ int mBitRate;
+ int mDuration;
+};
+
+#endif // __VIDEOPLAYBACKVIEWFILEDETAILS__
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testvideodisplayhandler/stub/src/alfcompositionutility.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,52 @@
+/*
+* 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 implementation for CAlfCompositionSource
+*
+*/
+
+// Version : %version: 1 %
+
+// Include Files
+
+#include "alfcompositionutility.h"
+
+
+// -------------------------------------------------------------------------------------------------
+// CAlfCompositionSource::NewL()
+// -------------------------------------------------------------------------------------------------
+//
+CAlfCompositionSource* CAlfCompositionSource::NewL( RWindow& /*aClientWindow*/ )
+{
+ CAlfCompositionSource* self = new (ELeave) CAlfCompositionSource();
+
+ return self;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CAlfCompositionSource::~CAlfCompositionSource()
+// -------------------------------------------------------------------------------------------------
+//
+CAlfCompositionSource::~CAlfCompositionSource()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CAlfCompositionSource::EnableAlpha()
+// -------------------------------------------------------------------------------------------------
+//
+TInt CAlfCompositionSource::EnableAlpha(TBool /*aEnable*/)
+{
+ return KErrNone;
+}
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testvideodisplayhandler/stub/src/mediaclientvideodisplay.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,136 @@
+/*
+* 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 implementation for CMediaClientVideoDisplay
+*
+*/
+
+// Version : %version: 1 %
+
+// Include Files
+
+#include "mediaclientvideodisplay.h"
+
+
+// -------------------------------------------------------------------------------------------------
+// CAlfCompositionSource::NewL()
+// -------------------------------------------------------------------------------------------------
+//
+CMediaClientVideoDisplay* CMediaClientVideoDisplay::NewL( TInt /*aDisplayId*/ )
+{
+ CMediaClientVideoDisplay* self = new (ELeave) CMediaClientVideoDisplay();
+
+ return self;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMediaClientVideoDisplay::~CMediaClientVideoDisplay()
+// -------------------------------------------------------------------------------------------------
+//
+CMediaClientVideoDisplay::~CMediaClientVideoDisplay()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMediaClientVideoDisplay::CMediaClientVideoDisplay()
+// -------------------------------------------------------------------------------------------------
+//
+CMediaClientVideoDisplay::CMediaClientVideoDisplay()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMediaClientVideoDisplay::RemoveSurface()
+// -------------------------------------------------------------------------------------------------
+//
+void CMediaClientVideoDisplay::RemoveSurface()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMediaClientVideoDisplay::RemoveSurface()
+// -------------------------------------------------------------------------------------------------
+//
+void CMediaClientVideoDisplay::AddDisplayWindowL(const RWindowBase* /*aWindow*/,
+ const TRect& /*aClipRect*/,
+ const TRect& /*aCropRegion*/,
+ const TRect& /*aVideoExtent*/,
+ TReal32 /*aScaleWidth*/,
+ TReal32 /*aScaleHeight*/,
+ TVideoRotation /*aRotation*/,
+ TAutoScaleType /*aAutoScaleType*/,
+ TInt /*aHorizPos*/,
+ TInt /*aVertPos*/,
+ RWindow* /*aWindow2*/)
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMediaClientVideoDisplay::RemoveSurface()
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMediaClientVideoDisplay::SurfaceCreated(const TSurfaceId& /*aSurfaceId*/,
+ const TRect& /*aCropRect*/,
+ TVideoAspectRatio /*aAspectRatio*/,
+ const TRect& /*aCropRegion*/)
+{
+ return KErrNone;
+}
+
+
+// -------------------------------------------------------------------------------------------------
+// CMediaClientVideoDisplay::RemoveSurface()
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMediaClientVideoDisplay::SurfaceParametersChanged(const TSurfaceId& /*aSurfaceId*/,
+ const TRect& /*aCropRect*/,
+ TVideoAspectRatio /*aAspectRatio*/)
+{
+ return KErrNone;
+}
+
+
+// -------------------------------------------------------------------------------------------------
+// CMediaClientVideoDisplay::RemoveSurface()
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMediaClientVideoDisplay::RedrawWindows(const TRect& /*aCropRegion*/)
+{
+ return KErrNone;
+}
+
+
+// -------------------------------------------------------------------------------------------------
+// CMediaClientVideoDisplay::RemoveSurface()
+// -------------------------------------------------------------------------------------------------
+//
+void CMediaClientVideoDisplay::SetVideoExtentL(const RWindowBase& /*aWindow*/,
+ const TRect& /*aVideoExtent*/,
+ const TRect& /*aCropRegion*/)
+{
+}
+
+
+// -------------------------------------------------------------------------------------------------
+// CMediaClientVideoDisplay::RemoveSurface()
+// -------------------------------------------------------------------------------------------------
+//
+void CMediaClientVideoDisplay::SetAutoScaleL(TAutoScaleType /*aScaleType*/,
+ TInt /*aHorizPos*/,
+ TInt /*aVertPos*/,
+ const TRect& /*aCropRegion*/)
+{
+}
+
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testvideodisplayhandler/stub/src/mpxvideocontainer.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,50 @@
+/*
+* 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:
+*
+*/
+
+// Version : %version: 1 %
+
+
+
+#include "mpxvideocontainer.h"
+
+
+CMPXVideoContainer::CMPXVideoContainer()
+{
+}
+
+CMPXVideoContainer::~CMPXVideoContainer()
+{
+ CloseWindow();
+}
+
+void CMPXVideoContainer::ConstructL()
+{
+ CreateWindowL();
+ ActivateL();
+}
+
+void CMPXVideoContainer::Draw( const TRect& /*aRect*/ ) const
+{
+ CWindowGc& gc = SystemGc();
+ gc.SetPenStyle( CGraphicsContext::ENullPen );
+ gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
+ gc.SetBrushColor( TRgb::Color16MA( 0 ) );
+ gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
+ gc.DrawRect( Rect() );
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testvideodisplayhandler/stub/src/mpxvideoviewwrapper.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,246 @@
+/*
+* 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 Video base playback view
+*
+*/
+
+// Version : %version: 6 %
+
+
+
+// Include Files
+
+#include "mpxvideoviewwrapper.h"
+#include "videobaseplaybackview.h"
+#include "videoplaybackviewfiledetails.h"
+#include "mpxcommonvideoplaybackview.hrh"
+
+// Member Functions
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::CMPXVideoViewWrapper()
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoViewWrapper::CMPXVideoViewWrapper( VideoBasePlaybackView* aView )
+ : iView( aView )
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::NewL()
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoViewWrapper* CMPXVideoViewWrapper::NewL( VideoBasePlaybackView* aView )
+{
+ CMPXVideoViewWrapper* self = new (ELeave) CMPXVideoViewWrapper( aView );
+
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ CleanupStack::Pop();
+
+ return self;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::ConstructL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::ConstructL()
+{
+ iMediaRequested = EFalse;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::~CMPXVideoViewWrapper()
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoViewWrapper::~CMPXVideoViewWrapper()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::IsLive()
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoViewWrapper::IsLive()
+{
+ return EFalse;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::IsPlaylist()
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoViewWrapper::IsPlaylist()
+{
+ return EFalse;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::CreateGeneralPlaybackCommandL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::CreateGeneralPlaybackCommandL( int aCmd )
+{
+ Q_UNUSED( aCmd );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::HandleCommandL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::HandleCommandL( TInt aCommand )
+{
+ switch ( aCommand )
+ {
+ case EMPXPbvCmdNextListItem:
+ {
+ SetFileDetails( EFalse );
+ break;
+ }
+
+ case EMPXPbvCmdPreviousListItem:
+ {
+ SetFileDetails( ETrue );
+ break;
+ }
+ }
+
+}
+
+// -------------------------------------------------------------------------------------------------
+// Request for the media object
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::RequestMediaL()
+{
+ iMediaRequested = ETrue;
+
+ SetFileDetails( ETrue );
+
+}
+
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::ActivateClosePlayerActiveObject
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::ActivateClosePlayerActiveObject()
+{
+ iClosePlayerAO = ETrue;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::IsMultiItemPlaylist()
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoViewWrapper::IsMultiItemPlaylist()
+{
+ return iFileDetails->mMultiItemPlaylist;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::SetFileDetails()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::SetFileDetails(TBool aDefault)
+{
+ if ( iFileDetails )
+ {
+ delete iFileDetails;
+ iFileDetails = NULL;
+ }
+
+ iFileDetails = new VideoPlaybackViewFileDetails();
+
+ _LIT(KTestMimeType, "video/3gp");
+ const QString qMimeType( (QChar*)KTestMimeType().Ptr(), KTestMimeType().Length() );
+ iFileDetails->mMimeType = qMimeType;
+
+ _LIT(KTestTitle, "Test Video Title");
+ const QString qTitle( (QChar*)KTestTitle().Ptr(), KTestTitle().Length() );
+ iFileDetails->mTitle = qTitle;
+
+ _LIT(KTestArtist, "TestArtist");
+ const QString qArtist( (QChar*)KTestArtist().Ptr(), KTestArtist().Length() );
+ iFileDetails->mArtist = qArtist;
+
+ _LIT(KTestDescription, "Test Description");
+ const QString qDescription( (QChar*)KTestDescription().Ptr(), KTestDescription().Length() );
+ iFileDetails->mDescription = qDescription;
+
+ _LIT(KTestLocation, "Test Location");
+ const QString qLocation( (QChar*)KTestLocation().Ptr(), KTestLocation().Length() );
+ iFileDetails->mLocation = qLocation;
+
+ _LIT(KTestCopyright, "Test Copyright");
+ const QString qCopyright( (QChar*)KTestCopyright().Ptr(), KTestCopyright().Length() );
+ iFileDetails->mCopyright = qCopyright;
+
+ _LIT(KTestLanguage, "Test Language");
+ const QString qLanguage( (QChar*)KTestLanguage().Ptr(), KTestLanguage().Length() );
+ iFileDetails->mLanguage = qLanguage;
+
+ _LIT(KTestKeywords, "Test Keywords");
+ const QString qKeywords( (QChar*)KTestKeywords().Ptr(), KTestKeywords().Length() );
+ iFileDetails->mKeywords = qKeywords;
+
+ if ( aDefault )
+ {
+ _LIT(KTestClipName, "testClip.3gp");
+ const QString qClipname( (QChar*)KTestClipName().Ptr(), KTestClipName().Length() );
+ iFileDetails->mClipName = qClipname;
+ }
+ else
+ {
+ _LIT(KTestClipName, "nextClip.3gp");
+ const QString qClipname( (QChar*)KTestClipName().Ptr(), KTestClipName().Length() );
+ iFileDetails->mClipName = qClipname;
+ }
+
+
+ iFileDetails->mPlaybackMode = EMPXVideoLocal;
+ iFileDetails->mSeekable = true;
+ iFileDetails->mPausableStream = true;
+ iFileDetails->mAudioEnabled = true;
+ iFileDetails->mVideoEnabled = true;
+ iFileDetails->mPartialPlayback = false;
+ iFileDetails->mRNFormat = false;
+ iFileDetails->mDuration = 100;
+ iFileDetails->mTvOutConnected = false;
+ iFileDetails->mDrmProtected = false;
+ iFileDetails->mMultiItemPlaylist = false;
+ iFileDetails->mVideoHeight = 320;
+ iFileDetails->mVideoWidth = 240;
+ iFileDetails->mBitRate = 16000;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::IssueVideoAppForegroundCmd()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::IssueVideoAppForegroundCmdL( TBool aForeground )
+{
+ iForeground = aForeground;
+}
+
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::UpdateVideoRectDone()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::UpdateVideoRectDone()
+{
+}
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testvideodisplayhandler/stub/src/videobaseplaybackview.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,193 @@
+/*
+* 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 Video playback view
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+// Include Files
+#include <aknappui.h>
+#include <qgraphicssceneevent>
+#include <hbinstance.h>
+#include <mmf/common/mmferrors.h>
+
+#include "../inc/videobaseplaybackview.h"
+
+
+// Member Functions
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::VideoBasePlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+VideoBasePlaybackView::VideoBasePlaybackView()
+{
+ mCurrentError = KErrNone;
+ mViewActive = false;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::~VideoBasePlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+VideoBasePlaybackView::~VideoBasePlaybackView()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::handleActivateView()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::handleActivateView()
+{
+ mViewActive = true;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::handleDeactivateView()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::handleDeactivateView()
+{
+ mViewActive = false;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::mousePress
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::mousePressEvent( QGraphicsSceneMouseEvent *event )
+{
+ Q_UNUSED( event );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::itemChange
+// -------------------------------------------------------------------------------------------------
+//
+QVariant VideoBasePlaybackView::itemChange( GraphicsItemChange change, const QVariant &value )
+{
+ return QGraphicsWidget::itemChange( change, value );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::closePlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::paint( QPainter *painter,
+ const QStyleOptionGraphicsItem *option,
+ QWidget *widget )
+{
+ Q_UNUSED( painter );
+ Q_UNUSED( option );
+ Q_UNUSED( widget );
+}
+
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::event()
+// -------------------------------------------------------------------------------------------------
+//
+bool VideoBasePlaybackView::event( QEvent *event )
+{
+ Q_UNUSED( event );
+ bool consumed = false;
+
+ return consumed;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::handleClosePlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::handleClosePlaybackView()
+{
+ mViewActive = false;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::issuePlayCommand
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::issuePlayCommand()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::handleBufferingState
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::handleBufferingState()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::handlePluginError()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::handlePluginError( int aError )
+{
+ mCurrentError = aError;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::doClosePlayer
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::doClosePlayer()
+{
+ mViewActive = false;
+}
+
+
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::retrievePdlInformation
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::retrievePdlInformation()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::closePlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::closePlaybackView()
+{
+ mViewActive = false;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::startClosingPlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::startClosingPlaybackView()
+{
+ mViewActive = false;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::getWindow()
+// -------------------------------------------------------------------------------------------------
+//
+RWindow *VideoBasePlaybackView::getWindow()
+{
+ return static_cast<RWindow*>( hbInstance->allMainWindows()[0]->effectiveWinId()->DrawableWindow() );
+}
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testvideodisplayhandler/stub/src/videoplaybackviewfiledetails.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,75 @@
+/*
+* 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: class for Video File Details (Qt)
+*
+*/
+
+// Version : %version: 4 %
+
+
+
+//
+// INCLUDE FILES
+//
+#include "mpxvideo_debug.h"
+#include "videoplaybackviewfiledetails.h"
+
+
+// ============================ MEMBER FUNCTIONS ===================================================
+
+VideoPlaybackViewFileDetails::VideoPlaybackViewFileDetails()
+{
+ clearFileDetails();
+}
+
+VideoPlaybackViewFileDetails::~VideoPlaybackViewFileDetails()
+{
+ clearFileDetails();
+}
+
+void
+VideoPlaybackViewFileDetails::clearFileDetails()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewFileDetails::ClearFileDetails()"));
+
+ mMimeType = tr("");
+ mTitle = tr("");
+ mArtist = tr("");
+ mDescription = tr("");
+ mLocation = tr("");
+ mCopyright = tr("");
+ mLanguage = tr("");
+ mKeywords = tr("");
+
+ mClipName = QString("testClip.3gp");
+
+ mPlaybackMode = EMPXVideoLocal;
+ mSeekable = false;
+ mPausableStream = false;
+ mAudioEnabled = true;
+ mVideoEnabled = false;
+ mPartialPlayback = false;
+ mRNFormat = false;
+
+ mDuration = 0;
+ mTvOutConnected = false;
+ mDrmProtected = false;
+ mMultiItemPlaylist = false;
+
+ mVideoHeight = 0;
+ mVideoWidth = 0;
+ mBitRate = 0;
+}
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testvideodisplayhandler/testvideodisplayhandler.pro Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,57 @@
+#
+# 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: 4 %
+
+TEMPLATE = app
+TARGET = testvideodisplayhandler
+CONFIG += qtestlib hb qt
+DEFINES += BUILD_VIDEOPLAYBACK_DLL
+
+DEPENDPATH += inc src stub/inc stub/src
+
+INCLUDEPATH += ../../../inc \
+ ../../../../inc \
+ ../../controlinc \
+ $$MW_LAYER_SYSTEMINCLUDE
+
+LIBS += -lmpxplaybackutility.dll \
+ -lmpxcommon.dll \
+ -lestor.dll \
+ -lsysutil.dll \
+ -lcone.dll \
+ -lefsrv.dll \
+ -lws32.dll \
+ -lgdi.dll
+
+# Input
+HEADERS += mpxvideoviewwrapper.h \
+ videobaseplaybackview.h \
+ videoplaybackviewfiledetails.h \
+ mpxvideocontainer.h \
+ alfcompositionutility.h \
+ mediaclientvideodisplay.h \
+ testvideodisplayhandler.h \
+ ../../viewinc/mpxvideoplaybackdisplayhandler.h
+
+SOURCES += mpxvideoviewwrapper.cpp \
+ videobaseplaybackview.cpp \
+ videoplaybackviewfiledetails.cpp \
+ mpxvideocontainer.cpp \
+ alfcompositionutility.cpp \
+ mediaclientvideodisplay.cpp \
+ testvideodisplayhandler.cpp \
+ ../../viewsrc/mpxvideoplaybackdisplayhandler.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testvideoplaybackview/inc/testvideoplaybackview.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,88 @@
+/**
+* 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: tester for methods in Video Playback View Plugin
+*
+*/
+
+// Version : %version: 9 %
+
+#ifndef __TESTVIDEOPLAYBACKVIEW_H__
+#define __TESTVIDEOPLAYBACKVIEW_H__
+
+
+// INCLUDES
+#include <QtTest/QtTest>
+
+
+class VideoPlaybackView;
+
+class TestVideoPlaybackView : public QObject
+{
+ Q_OBJECT
+
+public:
+
+ /**
+ * will be called before each testfunction is executed.
+ *
+ */
+ void init();
+
+ /**
+ * will be called after every testfunction.
+ *
+ */
+ void cleanup();
+
+ void setup();
+
+private:
+
+ void verifyHandlePluginError( TInt error, bool closeView = true );
+
+ // test functions for the test framework
+private slots:
+
+ // the order in which these testXX methods are declared is important
+ // changing this order will affect the test results
+ void testHandleActivateView();
+ void testShowDialog();
+ void testGetWindow();
+ void testIssuePlayCommand();
+ void testEventFilter();
+ void testClosePlaybackView();
+ void testHandlePdlStateChange();
+ void testHandlePluginError();
+ void testHandleStoppedStatePrevView();
+ void testHandleStoppedStateNoPrevView();
+ void testHandleBackPrevView();
+ void testHandleBackNoPrevView();
+ void testHandleSoftkeyback();
+ void testHandleDeactivateView();
+ void testDoClosePlayer();
+ void testGestureEvent();
+ void testReactivationAfterPriorTermination();
+
+signals:
+ void commandSignal();
+
+private:
+ VideoPlaybackView* mVideoView;
+
+};
+
+#endif // __TESTVIDEOPLAYBACKVIEW_H__
+
+// End of file
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testvideoplaybackview/src/testvideoplaybackview.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,668 @@
+/**
+* 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: tester for methods in VideoSortFilterProxyModel
+*
+*/
+
+// Version : %version: 13 %
+
+#include <e32err.h>
+#include <w32std.h>
+
+#include <mmf/common/mmferrors.h>
+#include <caf/caferr.h>
+
+#include <mpxvideoplaybackdefs.h>
+#include <mpxhbvideocommondefs.h>
+
+#include <hbapplication.h>
+#include <hbinstance.h>
+#include <qgraphicssceneevent>
+#include <QDebug>
+
+#include "videoplaybackviewfiledetails.h"
+#include "mpxcommonvideoplaybackview.hrh"
+
+#include "testvideoplaybackview.h"
+#include "mpxvideoviewwrapper.h"
+#include "hbtapgesture.h"
+#include "hbpangesture.h"
+#include "videoactivitystate.h"
+
+#define private public
+#define protected public
+#include "videoplaybackview.h"
+#include "videobaseplaybackview.h"
+#undef protected
+#undef private
+
+
+// ---------------------------------------------------------------------------
+// main
+// ---------------------------------------------------------------------------
+//
+int main(int argc, char *argv[])
+{
+ HbApplication app(argc, argv);
+ HbMainWindow window;
+
+ TestVideoPlaybackView tv;
+
+ char *pass[3];
+ pass[0] = argv[0];
+ pass[1] = "-o";
+ pass[2] = "c:\\data\\testvideoplaybackview.txt";
+
+ int res = QTest::qExec(&tv, 3, pass);
+
+ return res;
+}
+
+// ---------------------------------------------------------------------------
+// init
+// ---------------------------------------------------------------------------
+//
+void TestVideoPlaybackView::init()
+{
+ mVideoView = new VideoPlaybackView();
+}
+
+// ---------------------------------------------------------------------------
+// cleanup
+// ---------------------------------------------------------------------------
+//
+void TestVideoPlaybackView::cleanup()
+{
+ delete mVideoView;
+ mVideoView = NULL;
+}
+
+// ---------------------------------------------------------------------------
+// setup
+// ---------------------------------------------------------------------------
+//
+void TestVideoPlaybackView::setup()
+{
+ init();
+ mVideoView->handleActivateView();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestVideoPlaybackView::testHandleActivateView()
+// -------------------------------------------------------------------------------------------------
+//
+void TestVideoPlaybackView::testHandleActivateView()
+{
+ init();
+ mVideoView->handleActivateView();
+
+ QVERIFY( mVideoView->mVideoMpxWrapper->iMediaRequested == true );
+ QCOMPARE( mVideoView->mVideoMpxWrapper->iFileDetails->mBitRate, 16000 );
+ QCOMPARE( mVideoView->mVideoMpxWrapper->iFileDetails->mTitle, QString("Test Video Title") );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestVideoPlaybackView::testHandlePluginError()
+// -------------------------------------------------------------------------------------------------
+//
+void TestVideoPlaybackView::testHandlePluginError()
+{
+ //
+ // playback view is closed after displaying these error notes
+ //
+ verifyHandlePluginError( KErrNotSupported );
+ verifyHandlePluginError( KErrUnknown );
+ verifyHandlePluginError( KErrMMDecoder );
+ verifyHandlePluginError( KErrCorrupt );
+ verifyHandlePluginError( KErrTooBig );
+ verifyHandlePluginError( KErrMMInvalidProtocol );
+ verifyHandlePluginError( KErrMMInvalidURL );
+ verifyHandlePluginError( KErrArgument );
+ verifyHandlePluginError( KErrSessionClosed );
+ verifyHandlePluginError( KErrTimedOut );
+ verifyHandlePluginError( KErrNotFound );
+ verifyHandlePluginError( KErrMMNotEnoughBandwidth );
+ verifyHandlePluginError( KErrDisconnected );
+ verifyHandlePluginError( KErrMMProxyServer );
+ verifyHandlePluginError( KErrCouldNotConnect );
+ verifyHandlePluginError( KErrAbort );
+ verifyHandlePluginError( KErrCancel );
+ verifyHandlePluginError( KErrMMDRMNotAuthorized );
+ verifyHandlePluginError( KErrCANoRights );
+ verifyHandlePluginError( KErrCANoPermission );
+
+ //
+ // playback view remains open after displaying these error notes
+ //
+ verifyHandlePluginError( KMPXVideoCallOngoingError, false );
+ verifyHandlePluginError( KMPXVideoPlayOver2GDuringVoiceCallError, false );
+
+ //
+ // default error case, playback view is closed after displaying error note
+ //
+ verifyHandlePluginError( KErrGeneral );
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestVideoPlaybackView::testShowDialog()
+// -------------------------------------------------------------------------------------------------
+//
+void TestVideoPlaybackView::testShowDialog()
+{
+ //
+ // construct and activate playback view
+ //
+ setup();
+
+ //
+ // ensure that playback view is currently activated
+ //
+ QVERIFY( ! mVideoView->mTimerForClosingView->isActive() );
+
+ //
+ // test showDialog() method
+ //
+ mVideoView->showDialog( "test error msg" );
+
+ //
+ // connect and emit signal for handleClosePopupDialog() slot
+ //
+ connect( this, SIGNAL( commandSignal() ), mVideoView, SLOT( handleClosePopupDialog() ) );
+ emit commandSignal();
+
+ //
+ // verify that playback view is properly closed
+ //
+ QVERIFY( mVideoView->mTimerForClosingView->isActive() );
+
+ //
+ // disconnect signal for handleClosePopupDialog() slot
+ //
+ disconnect( this, SIGNAL( commandSignal() ), mVideoView, SLOT( handleClosePopupDialog() ) );
+
+ //
+ // destruct playback view
+ //
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestVideoPlaybackView::testGetWindow()
+// -------------------------------------------------------------------------------------------------
+//
+void TestVideoPlaybackView::testGetWindow()
+{
+ setup();
+
+ QVERIFY( mVideoView->getWindow() != NULL );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestVideoPlaybackView::testIssuePlayCommand()
+// -------------------------------------------------------------------------------------------------
+//
+void TestVideoPlaybackView::testIssuePlayCommand()
+{
+ setup();
+
+ mVideoView->issuePlayCommand();
+
+ //JAM remove
+ QVERIFY( mVideoView->isEnabled() );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestVideoPlaybackView::testEventFilter()
+// -------------------------------------------------------------------------------------------------
+//
+void TestVideoPlaybackView::testEventFilter()
+{
+ setup();
+
+ //
+ // ensure default foreground is false
+ //
+ QCOMPARE( mVideoView->mVideoMpxWrapper->iForeground, 0 );
+
+ //
+ // declare foreground/background event
+ //
+ QEvent* appActivate = new QEvent( QEvent::ApplicationActivate );
+ QEvent* appDeactivate = new QEvent( QEvent::ApplicationDeactivate );
+
+ //
+ // verify the returned value (consumed) of VideoBasePlaybackView::event()
+ // for QEvent::ApplicationActivate is false
+ //
+ QVERIFY( ! mVideoView->eventFilter( NULL, appActivate ) );
+
+ //
+ // verify view is in foreground
+ //
+ QCOMPARE( mVideoView->mVideoMpxWrapper->iForeground, 1 );
+
+ //
+ // verify the returned value (consumed) of VideoBasePlaybackView::event()
+ // for QEvent::ApplicationDeactivate is false
+ //
+ QVERIFY( ! mVideoView->eventFilter( NULL, appDeactivate ) );
+
+ //
+ // verify view is in background
+ //
+ QCOMPARE( mVideoView->mVideoMpxWrapper->iForeground, 0 );
+
+ //
+ // clean up
+ //
+ if ( appActivate )
+ {
+ delete appActivate;
+ appActivate = NULL;
+ }
+
+ if ( appDeactivate )
+ {
+ delete appDeactivate;
+ appDeactivate = NULL;
+ }
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestVideoPlaybackView::testClosePlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+void TestVideoPlaybackView::testClosePlaybackView()
+{
+ setup();
+
+ QVERIFY( ! mVideoView->mTimerForClosingView->isActive() );
+
+ mVideoView->closePlaybackView();
+
+ QVERIFY( mVideoView->mTimerForClosingView->isActive() );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestVideoPlaybackView::testHandlePdlStateChange()
+// -------------------------------------------------------------------------------------------------
+//
+void TestVideoPlaybackView::testHandlePdlStateChange()
+{
+ setup();
+
+ QCOMPARE( mVideoView->mVideoMpxWrapper->iFileDetails->mClipName, QString("testClip.3gp") );
+
+ mVideoView->handlePdlStateChange( 0 );
+
+ QCOMPARE( mVideoView->mVideoMpxWrapper->iFileDetails->mClipName, QString("testClip.3gp") );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestVideoPlaybackView::testHandleStoppedStateNoPrevView()
+// -------------------------------------------------------------------------------------------------
+//
+void TestVideoPlaybackView::testHandleStoppedStateNoPrevView()
+{
+ setup();
+
+ QVERIFY( ! mVideoView->mTimerForClosingView->isActive() );
+ mVideoView->handleStoppedState();
+
+ QVERIFY( mVideoView->mTimerForClosingView->isActive() );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestVideoPlaybackView::testHandleStoppedStatePrevView()
+// -------------------------------------------------------------------------------------------------
+//
+void TestVideoPlaybackView::testHandleStoppedStatePrevView()
+{
+ setup();
+
+ mVideoView->handleStoppedState();
+
+ QVERIFY( mVideoView->mTimerForClosingView->isActive() );
+
+ cleanup();
+
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestVideoPlaybackView::testHandleBackNoPrevView()
+// -------------------------------------------------------------------------------------------------
+//
+void TestVideoPlaybackView::testHandleBackNoPrevView()
+{
+ setup();
+
+ QVERIFY( ! mVideoView->mTimerForClosingView->isActive() );
+ mVideoView->handleBack();
+
+ QVERIFY( mVideoView->mTimerForClosingView->isActive() );
+
+ cleanup();
+
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestVideoPlaybackView::testHandleBackPrevView()
+// -------------------------------------------------------------------------------------------------
+//
+void TestVideoPlaybackView::testHandleBackPrevView()
+{
+ setup();
+
+ mVideoView->handleBack();
+
+ QVERIFY( mVideoView->mTimerForClosingView->isActive() );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestVideoPlaybackView::testHandleSoftkeyback()
+// -------------------------------------------------------------------------------------------------
+//
+void TestVideoPlaybackView::testHandleSoftkeyback()
+{
+ setup();
+
+ mVideoView->handleSoftkeyBack();
+
+ QVERIFY( mVideoView->mTimerForClosingView->isActive() );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestVideoPlaybackView::testDoClosePlayer()
+// -------------------------------------------------------------------------------------------------
+//
+void TestVideoPlaybackView::testDoClosePlayer()
+{
+ // quits app - which can be problematic for the qvptestrunner app
+
+// setup();
+//
+// mVideoView->handleActivateView();
+//
+// mVideoView->doClosePlayer();
+//
+// cleanup();
+
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestVideoPlaybackView::testHandleDeactivateView()
+// -------------------------------------------------------------------------------------------------
+//
+void TestVideoPlaybackView::testHandleDeactivateView()
+{
+ setup();
+
+ mVideoView->handleDeactivateView();
+
+ QVERIFY( mVideoView->mVideoMpxWrapper == NULL );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestVideoPlaybackView::verifyHandlePluginError()
+// -------------------------------------------------------------------------------------------------
+//
+void TestVideoPlaybackView::verifyHandlePluginError( TInt error, bool closeView )
+{
+ //
+ // construct and activate playback view
+ //
+ setup();
+
+ //
+ // ensure that playback view is currently open
+ //
+ QVERIFY( ! mVideoView->mTimerForClosingView->isActive() );
+
+ //
+ // test handlePluginError() method
+ //
+ mVideoView->handlePluginError( error );
+
+ //
+ // close playback view after error note has been launched
+ //
+ if ( closeView )
+ {
+ //
+ // connect and emit signal for handleClosePopupDialog() slot
+ //
+ connect( this, SIGNAL( commandSignal() ), mVideoView, SLOT( handleClosePopupDialog() ) );
+ emit commandSignal();
+
+ //
+ // verify that playback view is properly closed
+ //
+ QVERIFY( mVideoView->mTimerForClosingView->isActive() );
+
+ //
+ // disconnect signal for handleClosePopupDialog() slot
+ //
+ disconnect( this, SIGNAL( commandSignal() ), mVideoView, SLOT( handleClosePopupDialog() ) );
+ }
+ else
+ {
+ //
+ // verify that playback view is still open after error note has been launched
+ //
+ QVERIFY( ! mVideoView->mTimerForClosingView->isActive() );
+ }
+
+ //
+ // destruct playback view
+ //
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestVideoPlaybackView::testGestureEvent()
+// -------------------------------------------------------------------------------------------------
+//
+void TestVideoPlaybackView::testGestureEvent()
+{
+ setup();
+
+ //
+ // 1. Test tap gesture
+ //
+ QList<QGesture *> list;
+ HbTapGesture *tapGesture = new HbTapGesture();
+ list.append( tapGesture );
+ QGestureEvent* event = new QGestureEvent( list );
+
+ //
+ // connect to tappedOnScreen() signal and record its emission
+ //
+ QSignalSpy spy( mVideoView, SIGNAL( tappedOnScreen() ) );
+
+ //
+ // ensure signal has not been emitted yet
+ //
+ QCOMPARE( spy.count(), 0 );
+
+ //
+ // With GestureStarted
+ //
+ tapGesture->mState = Qt::GestureStarted;
+ mVideoView->gestureEvent( event );
+
+ //
+ // ensure signal hasn't been emitted and its emission count is not incremented
+ //
+ QCOMPARE( spy.count(), 0 );
+
+ //
+ // With GestureFinished
+ //
+ tapGesture->mState = Qt::GestureFinished;
+ mVideoView->gestureEvent( event );
+
+ //
+ // ensure signal has been emitted and its emission count is incremented
+ //
+ QCOMPARE( spy.count(), 1 );
+
+ //
+ // clean up
+ //
+ spy.clear();
+
+ list.clear();
+
+ if ( tapGesture )
+ {
+ delete tapGesture;
+ tapGesture = NULL;
+ }
+
+ if ( event )
+ {
+ delete event;
+ event = NULL;
+ }
+
+ //
+ // 2. Test pan gesture
+ //
+ HbPanGesture *panGesture = new HbPanGesture();
+ list.append( panGesture );
+ event = new QGestureEvent( list );
+
+ //
+ // connect to pannedToRight() signal and record its emission
+ //
+ QSignalSpy spy1( mVideoView, SIGNAL( pannedToRight() ) );
+
+ //
+ // ensure signal has not been emitted yet
+ //
+ QCOMPARE( spy1.count(), 0 );
+
+ //
+ // Test pan gesture With GestureStarted
+ //
+ panGesture->mState = Qt::GestureStarted;
+ mVideoView->gestureEvent( event );
+
+ //
+ // ensure signal has not been emitted yet
+ //
+ QCOMPARE( spy1.count(), 0 );
+
+ //
+ // Test pan gesture with GestureFinished
+ //
+ panGesture->mState = Qt::GestureFinished;
+ panGesture->mSceneDelta = QPointF( 5, 0 );
+ mVideoView->gestureEvent( event );
+
+ //
+ // ensure signal has been emitted
+ //
+ QCOMPARE( spy1.count(), 1 );
+ spy1.clear();
+
+ //
+ // Test pan gesture with GestureFinished
+ //
+
+ //
+ // connect to pannedToRight() signal and record its emission
+ //
+ QSignalSpy spy2( mVideoView, SIGNAL( pannedToLeft() ) );
+
+ //
+ // ensure signal has not been emitted yet
+ //
+ QCOMPARE( spy2.count(), 0 );
+
+ panGesture->mState = Qt::GestureFinished;
+ panGesture->mSceneDelta = QPointF( -5, 0 );
+ mVideoView->gestureEvent( event );
+
+ //
+ // ensure signal has not been emitted yet
+ //
+ QCOMPARE( spy2.count(), 1 );
+
+ //
+ // clean up
+ //
+ spy2.clear();
+ list.clear();
+
+ if ( panGesture )
+ {
+ delete panGesture;
+ panGesture = NULL;
+ }
+
+ if ( event )
+ {
+ delete event;
+ event = NULL;
+ }
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestVideoPlaybackView::testReactivationAfterPriorTermination()
+// -------------------------------------------------------------------------------------------------
+//
+void TestVideoPlaybackView::testReactivationAfterPriorTermination()
+{
+ QVariant data = int( 10 );
+ VideoActivityState::instance().setActivityData(data, KEY_LAST_PLAY_POSITION_ID);
+
+ data = int ( MpxHbVideoCommon::PlaybackView );
+ VideoActivityState::instance().setActivityData(data, KEY_VIEWPLUGIN_TYPE);
+
+ init();
+ mVideoView->handleActivateView();
+
+ QVERIFY( mVideoView->mVideoMpxWrapper->iMediaRequested == true );
+ QCOMPARE( mVideoView->mVideoMpxWrapper->iFileDetails->mBitRate, 16000 );
+ QCOMPARE( mVideoView->mVideoMpxWrapper->iFileDetails->mTitle, QString("Test Video Title") );
+
+ QCOMPARE( mVideoView->mLastPlayPosition, 10);
+
+ cleanup();
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testvideoplaybackview/stub/inc/hbpangesture.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,43 @@
+/*
+* 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 HbPanGesture
+*
+*/
+
+// Version : %version: 1 %
+
+
+
+#ifndef HBPANGESTURE_H_
+#define HBPANGESTURE_H_
+
+#include <QPanGesture>
+
+class HbPanGesture : public QPanGesture
+{
+ Q_OBJECT
+
+ public:
+ HbPanGesture();
+ virtual ~HbPanGesture();
+ Qt::GestureState state(){ return mState; }
+ QPointF sceneDelta();
+
+ public:
+ Qt::GestureState mState;
+ QPointF mSceneDelta;
+};
+
+#endif /*HBPANGESTURE_H_*/
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testvideoplaybackview/stub/inc/hbtapgesture.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,41 @@
+/*
+* 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 HbTapGesture
+*
+*/
+
+// Version : %version: 1 %
+
+
+
+#ifndef HbTAPGESTURE_H_
+#define HbTAPGESTURE_H_
+
+#include <QTapGesture>
+
+class HbTapGesture : public QTapGesture
+{
+ Q_OBJECT
+
+ public:
+ HbTapGesture();
+ virtual ~HbTapGesture();
+ Qt::GestureState state(){ return mState; }
+
+ public:
+ Qt::GestureState mState;
+};
+
+#endif /*HbTAPGESTURE_H_*/
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testvideoplaybackview/stub/inc/mpxvideoviewwrapper.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,87 @@
+/*
+* 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: MPX Video base playback view
+*
+*/
+
+// Version : %version: 7 %
+
+
+
+// This file defines the API for .dll
+
+#ifndef __MPXVIDEOVIEWWRAPPER_H__
+#define __MPXVIDEOVIEWWRAPPER_H__
+
+// Include Files
+
+#include <e32base.h> // CBase
+#include <e32std.h> // TBuf
+
+
+#include "videoplaybackcontrol.hrh"
+
+// Constants
+
+// Forward Declarations
+class VideoBasePlaybackView;
+class VideoPlaybackViewFileDetails;
+
+
+// Class Definitions
+
+class CMPXVideoViewWrapper : public CBase
+{
+ public:
+ static CMPXVideoViewWrapper* NewL( VideoBasePlaybackView* aView );
+ virtual ~CMPXVideoViewWrapper();
+
+ private:
+ CMPXVideoViewWrapper( VideoBasePlaybackView* aView );
+ void ConstructL();
+
+ void SetFileDetails(TBool aDefault);
+
+ public:
+ void HandleCommandL( TInt aCommand );
+
+ TBool IsLive();
+
+ TBool IsPlaylist();
+
+ TBool IsMultiItemPlaylist();
+
+ void RequestMediaL();
+
+ void CreateGeneralPlaybackCommandL( int aCmd );
+
+ void ActivateClosePlayerActiveObject();
+
+ void IssueVideoAppForegroundCmdL( TBool aForeground );
+
+
+ public: // data
+
+ VideoBasePlaybackView* iView;
+ TBool iMediaRequested;
+ VideoPlaybackViewFileDetails* iFileDetails;
+ TBool iClosePlayerAO;
+ TBool iForeground;
+ TInt iCommand;
+ TInt iPlayPosition;
+};
+
+#endif // __MPXVIDEOVIEWWRAPPER_H__
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testvideoplaybackview/stub/inc/videoactivitystate.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,112 @@
+/*
+* 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 VideoActivityState class definition for collection view unite tests
+*
+*/
+
+// Version : %version: 1 %
+
+#ifndef __VIDEOACTIVITYSTATE_H__
+#define __VIDEOACTIVITYSTATE_H__
+
+#include <qhash.h>
+#include <qvariant.h>
+
+
+// videoplayer activity id
+static const QString ACTIVITY_VIDEOPLAYER_MAINVIEW = "VideosMainView";
+
+// last position of the last played media clip (int)
+static const QString KEY_LAST_PLAY_POSITION_ID = "_VideoActivity_last_play_position_id_";
+
+// name of the media clip last played (QString)
+static const QString KEY_LAST_PLAYED_CLIP = "_VideoActivity_last_played_clip_";
+
+// Key for plugin type in activity manager
+static const QString KEY_VIEWPLUGIN_TYPE = "_VideoActivity_viewplugin_type_";
+
+// was the last played media clip a local clip (not streaming or prog. download)
+static const QString KEY_LAST_LOCAL_PLAYBACK = "_VideoActivity_last_local_playback_";
+
+
+
+namespace VideoActivityData
+{
+ // type of collectionview plugin's widget level(int):
+ // all videos, collections or collection video list
+ static const QString KEY_WIDGET_LEVEL = "_VideoActivity_widget_level_";
+
+ // id of the collection whose videolist is to be shown (int).
+ static const QString KEY_WIDGET_ID = "_VideoActivity_view_item_id_";
+}
+
+
+class VideoActivityState
+{
+
+public:
+
+ /**
+ * method returns a static instance of this class
+ */
+ static VideoActivityState &instance();
+
+ /**
+ * Sets activity data. If dataKey is not defined, all activity data
+ * will be overwritten by a provided data.
+ *
+ * @param data Data to save
+ * @param dataKey Key indicating dataitem. If empty, all data will be overwritten by provided data
+ */
+ void setActivityData(const QVariant& data, const QString& dataKey = QString(""));
+
+ /**
+ * Get activity data. If dataKey is not defined, all activity data
+ * will be returned. If item corresponding provided dataKey is not found,
+ * method returns empty QVariant.
+ *
+ * @param dataKey Key indicating dataitem client wants. If empty, all data will be returned
+ *
+ * @return QVariant
+ */
+ const QVariant getActivityData(const QString& dataKey = QString(""));
+
+private:
+
+ /**
+ * private default contructor
+ */
+ VideoActivityState();
+
+ /**
+ * copy contructor definition
+ */
+ VideoActivityState(const VideoActivityState& other);
+
+ /**
+ * Private destructor.
+ *
+ */
+ virtual ~VideoActivityState();
+
+private:
+
+ /**
+ * locally saved activity data
+ */
+ QHash<QString, QVariant> mActivityData;
+
+};
+
+#endif //__VIDEOACTIVITYSTATE_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testvideoplaybackview/stub/src/hbpangesture.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,55 @@
+/*
+* 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 HbPanGesture
+*
+*/
+
+// Version : %version: 1 %
+
+
+
+
+#include "mpxvideo_debug.h"
+#include "hbpangesture.h"
+
+// -------------------------------------------------------------------------------------------------
+// HbPanGesture::HbPanGesture
+// -------------------------------------------------------------------------------------------------
+//
+HbPanGesture::HbPanGesture()
+{
+ MPX_ENTER_EXIT(_L("HbPanGesture::HbPanGesture()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbPanGesture::~HbPanGesture
+// -------------------------------------------------------------------------------------------------
+//
+HbPanGesture::~HbPanGesture()
+{
+ MPX_DEBUG(_L("HbPanGesture::HbPanGesture") );
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbPanGesture::sceneDelta
+// -------------------------------------------------------------------------------------------------
+//
+QPointF HbPanGesture::sceneDelta()
+{
+ MPX_DEBUG(_L("HbPanGesture::sceneDelta") );
+
+ return mSceneDelta;
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testvideoplaybackview/stub/src/hbtapgesture.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,44 @@
+/*
+* 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 HbTapGesture
+*
+*/
+
+// Version : %version: 1 %
+
+
+
+
+#include "mpxvideo_debug.h"
+#include "hbtapgesture.h"
+
+// -------------------------------------------------------------------------------------------------
+// HbTapGesture::HbTapGesture
+// -------------------------------------------------------------------------------------------------
+//
+HbTapGesture::HbTapGesture()
+{
+ MPX_ENTER_EXIT(_L("HbTapGesture::HbTapGesture()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbTapGesture::~HbTapGesture
+// -------------------------------------------------------------------------------------------------
+//
+HbTapGesture::~HbTapGesture()
+{
+ MPX_DEBUG(_L("HbTapGesture::HbTapGesture") );
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testvideoplaybackview/stub/src/mpxvideoviewwrapper.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,222 @@
+/*
+* 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 Video base playback view
+*
+*/
+
+// Version : %version: 9 %
+
+
+
+// Include Files
+
+#include "mpxvideoviewwrapper.h"
+#include "videobaseplaybackview.h"
+#include "videoplaybackviewfiledetails.h"
+#include "mpxcommonvideoplaybackview.hrh"
+
+// Member Functions
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::CMPXVideoViewWrapper()
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoViewWrapper::CMPXVideoViewWrapper( VideoBasePlaybackView* aView )
+ : iView( aView )
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::NewL()
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoViewWrapper* CMPXVideoViewWrapper::NewL( VideoBasePlaybackView* aView )
+{
+ CMPXVideoViewWrapper* self = new (ELeave) CMPXVideoViewWrapper( aView );
+
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ CleanupStack::Pop();
+
+ return self;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::ConstructL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::ConstructL()
+{
+ iMediaRequested = EFalse;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::~CMPXVideoViewWrapper()
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoViewWrapper::~CMPXVideoViewWrapper()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::IsLive()
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoViewWrapper::IsLive()
+{
+ return EFalse;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::IsPlaylist()
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoViewWrapper::IsPlaylist()
+{
+ return EFalse;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::CreateGeneralPlaybackCommandL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::CreateGeneralPlaybackCommandL( int aCmd )
+{
+ Q_UNUSED( aCmd );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::HandleCommandL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::HandleCommandL( TInt aCommand )
+{
+ iCommand = aCommand;
+}
+
+// -------------------------------------------------------------------------------------------------
+// Request for the media object
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::RequestMediaL()
+{
+ iMediaRequested = ETrue;
+
+ SetFileDetails( ETrue );
+
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::ActivateClosePlayerActiveObject
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::ActivateClosePlayerActiveObject()
+{
+ iClosePlayerAO = ETrue;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::IsMultiItemPlaylist()
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoViewWrapper::IsMultiItemPlaylist()
+{
+ return iFileDetails->mMultiItemPlaylist;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::SetFileDetails()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::SetFileDetails(TBool aDefault)
+{
+ if ( iFileDetails )
+ {
+ delete iFileDetails;
+ iFileDetails = NULL;
+ }
+
+ iFileDetails = new VideoPlaybackViewFileDetails();
+
+ _LIT(KTestMimeType, "video/3gp");
+ const QString qMimeType( (QChar*)KTestMimeType().Ptr(), KTestMimeType().Length() );
+ iFileDetails->mMimeType = qMimeType;
+
+ _LIT(KTestTitle, "Test Video Title");
+ const QString qTitle( (QChar*)KTestTitle().Ptr(), KTestTitle().Length() );
+ iFileDetails->mTitle = qTitle;
+
+ _LIT(KTestArtist, "TestArtist");
+ const QString qArtist( (QChar*)KTestArtist().Ptr(), KTestArtist().Length() );
+ iFileDetails->mArtist = qArtist;
+
+ _LIT(KTestDescription, "Test Description");
+ const QString qDescription( (QChar*)KTestDescription().Ptr(), KTestDescription().Length() );
+ iFileDetails->mDescription = qDescription;
+
+ _LIT(KTestLocation, "Test Location");
+ const QString qLocation( (QChar*)KTestLocation().Ptr(), KTestLocation().Length() );
+ iFileDetails->mLocation = qLocation;
+
+ _LIT(KTestCopyright, "Test Copyright");
+ const QString qCopyright( (QChar*)KTestCopyright().Ptr(), KTestCopyright().Length() );
+ iFileDetails->mCopyright = qCopyright;
+
+ _LIT(KTestLanguage, "Test Language");
+ const QString qLanguage( (QChar*)KTestLanguage().Ptr(), KTestLanguage().Length() );
+ iFileDetails->mLanguage = qLanguage;
+
+ _LIT(KTestKeywords, "Test Keywords");
+ const QString qKeywords( (QChar*)KTestKeywords().Ptr(), KTestKeywords().Length() );
+ iFileDetails->mKeywords = qKeywords;
+
+ if ( aDefault )
+ {
+ _LIT(KTestClipName, "testClip.3gp");
+ const QString qClipname( (QChar*)KTestClipName().Ptr(), KTestClipName().Length() );
+ iFileDetails->mClipName = qClipname;
+ }
+ else
+ {
+ _LIT(KTestClipName, "nextClip.3gp");
+ const QString qClipname( (QChar*)KTestClipName().Ptr(), KTestClipName().Length() );
+ iFileDetails->mClipName = qClipname;
+ }
+
+ iFileDetails->mPlaybackMode = EMPXVideoLocal;
+ iFileDetails->mSeekable = true;
+ iFileDetails->mPausableStream = true;
+ iFileDetails->mAudioEnabled = true;
+ iFileDetails->mVideoEnabled = true;
+ iFileDetails->mPartialPlayback = false;
+ iFileDetails->mRNFormat = false;
+ iFileDetails->mDuration = 100;
+ iFileDetails->mTvOutConnected = false;
+ iFileDetails->mDrmProtected = false;
+ iFileDetails->mMultiItemPlaylist = false;
+ iFileDetails->mVideoHeight = 320;
+ iFileDetails->mVideoWidth = 240;
+ iFileDetails->mBitRate = 16000;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::IssueVideoAppForegroundCmd()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::IssueVideoAppForegroundCmdL( TBool aForeground )
+{
+ iForeground = aForeground;
+}
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testvideoplaybackview/stub/src/videoactivitystate.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,91 @@
+/*
+* 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 implementation of VideoActivityState
+*
+*/
+
+// Version : %version: 1 %
+
+#include "videoactivitystate.h"
+#include "mpxvideo_debug.h"
+
+// -------------------------------------------------------------------------------------------------
+// instance()
+// -------------------------------------------------------------------------------------------------
+//
+VideoActivityState& VideoActivityState::instance()
+{
+ MPX_ENTER_EXIT(_L("VideoActivityState::instance()"));
+
+ static VideoActivityState _staticWrapper;
+ return _staticWrapper;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoActivityState()
+// -------------------------------------------------------------------------------------------------
+//
+VideoActivityState::VideoActivityState()
+{
+ // NOP
+}
+
+// -------------------------------------------------------------------------------------------------
+// ~VideoActivityState()
+// -------------------------------------------------------------------------------------------------
+//
+VideoActivityState::~VideoActivityState()
+{
+ MPX_ENTER_EXIT(_L("VideoActivityState::~VideoActivityState()"));
+ mActivityData.clear();
+
+}
+
+// -------------------------------------------------------------------------------------------------
+// setActivityData()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoActivityState::setActivityData(const QVariant& data, const QString& dataKey)
+{
+ MPX_ENTER_EXIT(_L("VideoActivityState::setActivityData()"));
+ if(dataKey.length())
+ {
+ // setting particular dataitem
+ mActivityData[dataKey] = data;
+ }
+ else
+ {
+ // overwriting all data
+ mActivityData.clear();
+ mActivityData = data.toHash();
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// getActivityData()
+// -------------------------------------------------------------------------------------------------
+//
+const QVariant VideoActivityState::getActivityData(const QString& dataKey)
+{
+ MPX_ENTER_EXIT(_L("VideoActivityState::getData()"));
+ if(dataKey.length())
+ {
+ return mActivityData[dataKey];
+ }
+ else
+ {
+ return QVariant::fromValue(mActivityData);
+ }
+}
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testvideoplaybackview/testvideoplaybackview.pro Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,52 @@
+#
+# 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: 11 %
+
+TEMPLATE = app
+TARGET = testvideoplaybackview
+CONFIG += qtestlib hb qt
+DEFINES += BUILD_VIDEOPLAYBACK_DLL
+
+DEPENDPATH += . inc src stub/src stub/inc
+
+INCLUDEPATH += stub/inc \
+ ../../inc \
+ ../../../../inc \
+ ../../controlinc \
+
+LIBS += -lcone.dll \
+ -lcommonengine.dll \
+ -lflogger.dll
+
+# Input
+HEADERS += mpxvideoviewwrapper.h \
+ testvideoplaybackview.h \
+ ../../../inc/videobaseplaybackview.h \
+ ../../../inc/videoplaybackview.h \
+ videoplaybackviewfiledetails.h \
+ hbtapgesture.h \
+ hbpangesture.h \
+ videoactivitystate.h
+
+SOURCES += mpxvideoviewwrapper.cpp \
+ testvideoplaybackview.cpp \
+ ../../viewsrc/videobaseplaybackview.cpp \
+ ../../viewsrc/videoplaybackview.cpp \
+ ../../viewsrc/videoplaybackviewfiledetails.cpp \
+ hbtapgesture.cpp \
+ hbpangesture.cpp \
+ videoactivitystate.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/videoplaybackview.pro Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,107 @@
+#
+# 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#29 %
+
+
+TEMPLATE = lib
+CONFIG += hb qt dll
+TARGET = videoplaybackview
+DEFINES += BUILD_VIDEOPLAYBACK_DLL
+
+symbian:
+{
+ TARGET.CAPABILITY = ALL -TCB -DRM
+ TARGET.EPOCALLOWDLLDATA = 1
+ TARGET.UID3 = 0x20024334
+ INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE \
+ $$APP_LAYER_SYSTEMINCLUDE SYSTEMINCLUDE
+ BLD_INF_RULES.prj_exports += "rom/videoplaybackview.iby CORE_APP_LAYER_IBY_EXPORT_PATH(videoplaybackview.iby)"
+ defBlock = \
+ "$${LITERAL_HASH}if defined(EABI)" \
+ "DEFFILE ../eabi/videoplaybackview.def" \
+ "$${LITERAL_HASH}else" \
+ "DEFFILE ../bwins/videoplaybackview.def" \
+ "$${LITERAL_HASH}endif"
+ MMP_RULES += defBlock SMPSAFE
+}
+
+INCLUDEPATH += ../../inc
+
+LIBS += -lmpxplaybackutility.dll \
+ -lmpxcommon.dll \
+ -lestor.dll \
+ -lcommonengine.dll \
+ -lflogger.dll \
+ -lsysutil.dll \
+ -lmpxcollectionutility.dll \
+ -lremconcoreapi.dll \
+ -lremconInterfacebase.dll \
+ -lcentralrepository.dll \
+ -lthumbnailmanagerqt.dll \
+ -lmediaclientvideodisplay.dll \
+ -lxqserviceutil.dll \
+ -lvideoplayerengine.dll \
+ -lcone.dll \
+ -lefsrv.dll \
+ -lws32.dll \
+ -lhal.dll \
+ -lgdi.dll \
+ -lshareui.dll
+
+DEPENDPATH += ../inc inc viewinc controlinc
+VPATH += viewsrc controlsrc
+
+HEADERS += videobaseplaybackview.h \
+ videoplaybackview.h \
+ videoplaybackviewfiledetails.h \
+ mpxvideoviewwrapper.h \
+ mpxvideoregion.h \
+ mpxvideoplaybackdisplayhandler.h \
+ videoplaybackfullscreencontrol.h \
+ videoplaybackstatuspanecontrol.h \
+ videoplaybackprogressbar.h \
+ videoplaybacktoolbar.h \
+ videoplaybackcontrolbar.h \
+ videoplaybackcontrolpolicy.h \
+ videoplaybackcontrolconfiguration.h \
+ videoplaybackcontrolscontroller.h \
+ videoplaybackdocumentloader.h \
+ videoplaybackfiledetailswidget.h \
+ mpxvideoplaybackuserinputhandler.h \
+ videoplaybackdetailsplaybackwindow.h \
+ mpxvideocontainer.h
+
+SOURCES += videobaseplaybackview.cpp \
+ videoplaybackview.cpp \
+ videoplaybackviewfiledetails.cpp \
+ mpxvideoviewwrapper.cpp \
+ mpxvideoplaybackdisplayhandler.cpp \
+ videoplaybackfullscreencontrol.cpp \
+ videoplaybackstatuspanecontrol.cpp \
+ videoplaybackprogressbar.cpp \
+ videoplaybacktoolbar.cpp \
+ videoplaybackcontrolbar.cpp \
+ videoplaybackcontrolscontroller.cpp \
+ videoplaybackcontrolpolicy.cpp \
+ videoplaybackcontrolconfiguration.cpp \
+ videoplaybackdocumentloader.cpp \
+ videoplaybackfiledetailswidget.cpp \
+ mpxvideoplaybackuserinputhandler.cpp \
+ videoplaybackdetailsplaybackwindow.cpp \
+ mpxvideocontainer.cpp
+
+RESOURCES += resources/videoplaybackview.qrc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/viewinc/mpxhelixplaybackplugindefs.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,50 @@
+/*
+* 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: Externalizable container for DSA region
+*
+*/
+
+// Version : %version: da1mmcf#2 %
+
+
+
+#ifndef MPXHELIXPLAYBACKPLUGINDEFS_H_
+#define MPXHELIXPLAYBACKPLUGINDEFS_H_
+
+enum TMPXVideoPlaybackState
+{
+ EMPXVideoNotInitialized,
+ EMPXVideoInitializing,
+ EMPXVideoInitialized,
+ EMPXVideoBuffering,
+ EMPXVideoPlaying,
+ EMPXVideoPaused,
+ EMPXVideoStopped,
+ EMPXVideoSeeking,
+ EMPXNumberOfStates
+};
+
+
+enum TMPXVideoMode
+{
+ EMPXVideoLocal,
+ EMPXVideoStreaming,
+ EMPXVideoLiveStreaming,
+ EMPXVideoProgressiveDownload,
+ EMPXNumberOfModes
+};
+
+
+
+#endif /*MPXHELIXPLAYBACKPLUGINDEFS_H_*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/viewinc/mpxvideocontainer.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,39 @@
+/*
+* 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: CCoeControl to provide RWindow for videoplayback
+*
+*/
+
+// Version : %version: 2 %
+
+
+#ifndef CMPXVIDEOCONTAINER_H
+#define CMPXVIDEOCONTAINER_H
+
+#include <coecntrl.h>
+
+
+class CMPXVideoContainer : public CCoeControl
+{
+
+ public:
+ CMPXVideoContainer();
+ virtual ~CMPXVideoContainer();
+
+ void ConstructL();
+};
+
+#endif // CMPXVIDEOCONTAINER_H
+
+// End of file
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/viewinc/mpxvideoplaybackdisplayhandler.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,141 @@
+/*
+* 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 video playback display handler
+*
+*/
+
+// Version : %version: 10 %
+
+
+#ifndef __VIDEOPLAYBACKDISPLAYHANDLER_H__
+#define __VIDEOPLAYBACKDISPLAYHANDLER_H__
+
+// INCLUDES
+
+#include <mpxmessage2.h>
+#include <MMFScalingCustomCommandConstants.h>
+#include <mpxvideoplaybackdefs.h>
+#include <mediaclientvideodisplay.h>
+
+
+//
+// CLASS DECLARATION
+//
+class CMPXVideoContainer;
+class MMPXPlaybackUtility;
+class CMPXVideoViewWrapper;
+class VideoPlaybackViewFileDetails;
+
+/*
+ * CMPXVideoPlaybackDisplayHandler
+ *
+ */
+class CMPXVideoPlaybackDisplayHandler : public CBase
+{
+ //
+ // To save user's preference for scaling type in video ratio + screen ratio
+ //
+ typedef struct
+ {
+ TReal32 videoRatio;
+ TReal32 screenRatio;
+ TMMFScalingType scalingType;
+ } TMPXAspectRatio ;
+
+ public:
+
+ ~CMPXVideoPlaybackDisplayHandler();
+
+ static CMPXVideoPlaybackDisplayHandler* NewL( MMPXPlaybackUtility* aPlayUtil,
+ CMPXVideoViewWrapper* aViewWrapper );
+
+ void CreateDisplayWindowL( RWsSession& aWs,
+ CWsScreenDevice& aScreenDevice,
+ RWindow& aWin,
+ TRect aDisplayRect );
+
+ void RemoveDisplayWindow();
+
+ void HandleVideoDisplayMessageL( CMPXMessage* aMessage );
+
+ TInt SetAspectRatioL( TMPXVideoPlaybackCommand aCmd );
+
+ TInt SetDefaultAspectRatioL( VideoPlaybackViewFileDetails* aFileDetails,
+ TReal32 aDisplayAspectRatio );
+
+ void UpdateVideoRectL( TRect aRect, TBool transitionEffect );
+
+ private:
+
+ CMPXVideoPlaybackDisplayHandler( MMPXPlaybackUtility* aPlayUtil,
+ CMPXVideoViewWrapper* aViewWrapper );
+
+ void ConstructL();
+
+ void LoadAspectRatioL();
+
+ void SaveAspectRatioL();
+
+ void SetVideoRectL( TRect aClipRect );
+
+ void CalculateVideoRectL();
+
+ static TInt UpdateVideoRectTimeOutL( TAny* aPtr );
+
+ private:
+ void AddDisplayWindowL( CWsScreenDevice& aScreenDevice,
+ RWindowBase& aWindowBase,
+ RWindow* aWin );
+
+ void SurfaceCreatedL( CMPXMessage* aMessage );
+ void SurfaceChangedL( CMPXMessage* aMessage );
+ void SurfaceRemoved();
+ TInt SetNgaAspectRatioL( TMPXVideoPlaybackCommand aCmd );
+
+ private:
+ MMPXPlaybackUtility* iPlaybackUtility;
+
+ RArray<TMPXAspectRatio> iAspectRatioArray;
+ TInt iCurrentIndexForAspectRatio;
+ TReal iDisplayAspectRatio;
+
+ TRect iWindowRect;
+
+ TReal32 iTlXDiff;
+ TReal32 iTlYDiff;
+ TReal32 iBrXDiff;
+ TReal32 iBrYDiff;
+
+ TInt iTransitionEffectCnt;
+
+ CPeriodic* iResizingTimer;
+ CMPXVideoViewWrapper* iViewWrapper;
+
+ CMediaClientVideoDisplay* iVideoDisplay;
+
+ RWindowBase* iWindowBase;
+ TBool iSurfaceCached;
+ TSurfaceId iSurfaceId;
+ TRect iCropRect;
+ TVideoAspectRatio iAspectRatio;
+ TReal32 iScaleWidth;
+ TReal32 iScaleHeight;
+ TInt iHorizontalPosition;
+ TInt iVerticalPosition;
+ TVideoRotation iRotation;
+ TAutoScaleType iAutoScale;
+ CMPXVideoContainer* iVideoContainer;
+};
+
+#endif // __VIDEOPLAYBACKDISPLAYHANDLER_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/viewinc/mpxvideoplaybackuids.hrh Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,41 @@
+/*
+* 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: Resource headers for video UIDs
+ *
+*/
+
+// Version : %version: da1mmcf#2 %
+
+
+
+
+#ifndef __MPXPLAYBACKUIDS_HRH__
+#define __MPXPLAYBACKUIDS_HRH__
+
+// CONSTANTS
+
+#define KMPXVIDEOPLAYBACKVIEWPLUGINUID 0x200159AC
+#define KMPXVIDEOPLAYBACKVIEWPLUGINIMPLEMENTATIONUID 0x200159AD
+
+#define KMPXVIDEOPDLPLAYBACKVIEWPLUGINUID 0x2001E5A7
+#define KMPXVIDEOPDLPLAYBACKVIEWPLUGINIMPLEMENTATIONUID 0x2001E5A8
+
+#define KMPXVIDEOPLAYBACKPLUGINIMPLEMENTATIONUID 0x10282551
+
+#define KMPXVIDEOPLAYBACKVIEWUID 0x200159B4
+#define KMPXVIDEOPDLPLAYBACKVIEWUID 0x2001E5A9
+
+#define KBROWSERUID 0x10008D39
+
+#endif // __MPXPLAYBACKUIDS_HRH__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/viewinc/mpxvideoplaybackuserinputhandler.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,152 @@
+/*
+* 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: Implementation of MPXVideoPlaybackUserInputHandler
+*
+*/
+
+// Version : %version: 6 %
+
+
+
+#ifndef MPXVIDEOPLAYBACKUSERINPUTHANDLER_H_
+#define MPXVIDEOPLAYBACKUSERINPUTHANDLER_H_
+
+// INCLUDES
+#include <remconcoreapitargetobserver.h> // Side volume key
+
+
+// FORWARD DECLARATIONS
+class CRemConInterfaceSelector; // Side volume key
+class CRemConCoreApiTarget;
+class CMPXVideoViewWrapper;
+
+// CLASS DECLARATION
+
+class CMPXVideoPlaybackUserInputHandler : public CBase,
+ public MRemConCoreApiTargetObserver
+{
+ public: // Constructors and destructor
+
+ /**
+ * Two-phased constructor.
+ */
+ static CMPXVideoPlaybackUserInputHandler* NewL(
+ CMPXVideoViewWrapper* aWrapper, TBool aTvOutConnected );
+
+ /**
+ * Destructor.
+ */
+ virtual ~CMPXVideoPlaybackUserInputHandler();
+
+ private:
+
+ /**
+ * C++ default constructor.
+ */
+ CMPXVideoPlaybackUserInputHandler( CMPXVideoViewWrapper* aWrapper );
+
+ /**
+ * Symbian 2nd phase constructor.
+ */
+ void ConstructL( TBool aTvOutConnected );
+
+ public:
+ void ProcessKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
+
+ void ProcessMediaKey( TRemConCoreApiOperationId aOperationId,
+ TRemConCoreApiButtonAction aButtonAct );
+
+ void DoHandleMediaKey( TRemConCoreApiOperationId aOperationId,
+ TRemConCoreApiButtonAction aButtonAct );
+
+ // From MRemConCoreApiTargetObserver
+ /**
+ * Side volume key API from MRemConCoreApiTargetObserver
+ * @since 3.2
+ * @see MRemConCoreApiTargetObserver
+ */
+ virtual void MrccatoPlay(
+ TRemConCoreApiPlaybackSpeed aSpeed,
+ TRemConCoreApiButtonAction aButtonAct );
+
+ virtual void MrccatoCommand(
+ TRemConCoreApiOperationId aOperationId,
+ TRemConCoreApiButtonAction aButtonAct );
+
+ /**
+ * Setter method for iForeground
+ * @param aForeground - the value to be set
+ * @return void
+ */
+ void SetForeground( TBool aForeground );
+
+ void HandleTVOutEventL( TBool aTVOutConnected );
+
+ private:
+ /**
+ * Handles volume repeat timer timout
+ * @return TInt
+ */
+ static TInt HandleVolumeRepeatTimeoutL( TAny* aPtr );
+
+ /**
+ * Adjust volume(+1/-1) for media key
+ * @return void
+ */
+ void HandleVolumeRepeatL();
+
+ void HandleFastForward( TRemConCoreApiButtonAction aButtonAct );
+
+ void HandleRewind( TRemConCoreApiButtonAction aButtonAct );
+
+ void HandleVolumeUp( TRemConCoreApiButtonAction aButtonAct );
+
+ void HandleVolumeDown( TRemConCoreApiButtonAction aButtonAct );
+
+ // Handles the Display light timer timeout
+ static TInt HandleDisplayTimeout( TAny* aPtr );
+
+ // Disable the display backlight
+ void DisableBacklight();
+
+ // Enable the display backlight
+ void EnableBacklight();
+
+ // Restarts the timer for display light time-out
+ void RestartDisplayTimer();
+
+ private:
+
+ TVideoUserInputType iProcessingInputType; // the type of input being processed
+ TUint iLastPressedKeyCode; // keycode of last key that sent EEventKeyDown
+ TInt iLastPressedKeyScanCode; // scancode of last key that sent EEventKeyDown
+ TRemConCoreApiOperationId iLastMediaKeyPressed; // Id of last mediakey thats sent a button-press
+
+ CRemConInterfaceSelector* iInterfaceSelector; // Side volume key, owned
+ CRemConCoreApiTarget* iCoreTarget; // Owned by CRemConInterfaceSelector
+
+ CPeriodic* iVolumeRepeatTimer; // owned
+ TBool iVolumeRepeatUp;
+ TBool iTVOutConnected; // Flag to indicate if TV is connected
+ CPeriodic* iDisplayTimer; // Timer to timeout the lights time-out
+ TInt iDisplayTimeOut; // Value of the lights time-out
+
+ TBool iForeground;
+ CMPXVideoViewWrapper* iViewWrapper;
+};
+
+
+#endif /*MPXVIDEOPLAYBACKUSERINPUTHANDLER_H_*/
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/viewinc/mpxvideoviewwrapper.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,293 @@
+/*
+* 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: MPX Video base playback view
+*
+*/
+
+// Version : %version: da1mmcf#20 %
+
+
+
+// This file defines the API for .dll
+
+#ifndef __MPXVIDEOVIEWWRAPPER_H__
+#define __MPXVIDEOVIEWWRAPPER_H__
+
+// Include Files
+
+#include <e32base.h> // CBase
+#include <e32std.h> // TBuf
+#include <mpxplaybackobserver.h>
+#include <mpxvideoplaybackdefs.h>
+#include <mpxviewactivationobserver.h>
+#include <mpxcollectionobserver.h>
+
+#include "videoplaybackcontrol.hrh"
+
+enum TMPXMediaRequestStatus
+{
+ MediaNotRequested,
+ MediaRequested,
+ MediaDelivered
+};
+
+// Forward Declarations
+class MMPXPlaybackUtility;
+class MMPXCollectionUtility;
+class VideoBasePlaybackView;
+class CMPXVideoPlaybackDisplayHandler;
+class VideoPlaybackViewFileDetails;
+class CMPXVideoPlaybackUserInputHandler;
+class VideoPlaybackControlsController;
+
+// Class Definitions
+
+class CMPXVideoViewWrapper : public CBase,
+ public MMPXPlaybackObserver,
+ public MMPXViewActivationObserver,
+ public MMPXPlaybackCallback,
+ public MMPXCollectionObserver
+{
+ public:
+ static CMPXVideoViewWrapper* NewL( VideoBasePlaybackView* aView );
+ virtual ~CMPXVideoViewWrapper();
+
+ private:
+ CMPXVideoViewWrapper( VideoBasePlaybackView* aView );
+ void ConstructL();
+
+ public:
+ virtual void HandleCommandL( TInt aCommand );
+
+ void RetrieveFileNameAndModeL( CMPXCommand* aCmd );
+
+ /*
+ * From MMPXViewActivationObserver
+ * Handle view activation.
+ *
+ * @param aCurrentViewType Current view type Uid.
+ * @param aPreviousViewType Previous view type Uid.
+ */
+ inline void HandleViewActivation( const TUid& /*aCurrentViewType*/,
+ const TUid& /*aPreviousViewType*/ ) {}
+
+ /**
+ * From MMPXPlaybackObserver
+ * Handle playback message
+ *
+ * @param aMessage Playback Message
+ * @param aErr system error code.
+ */
+ virtual void HandlePlaybackMessage( CMPXMessage* aMessage, TInt aError );
+
+ /**
+ * From MMPXPlaybackCallback
+ * Handle playback property
+ *
+ * @param aProperty the property
+ * @param aValue the value of the property
+ * @param aError error code
+ */
+ void HandlePropertyL( TMPXPlaybackProperty aProperty,
+ TInt aValue,
+ TInt aError );
+
+ /**
+ * Method is called continously until aComplete=ETrue, signifying that
+ * it is done and there will be no more callbacks
+ * Only new items are passed each time
+ *
+ * @param aPlayer UID of the subplayer
+ * @param aSubPlayers a list of sub players
+ * @param aComplete ETrue no more sub players. EFalse more subplayer
+ * expected
+ * @param aError error code
+ */
+ inline void HandleSubPlayerNamesL( TUid /*aPlayer*/,
+ const MDesCArray* /*aSubPlayers*/,
+ TBool /*aComplete*/,
+ TInt /*aError*/ )
+ {}
+
+ /**
+ * Call back of media request
+ *
+ * @param aMedia media
+ * @param aError error code
+ */
+ void HandleMediaL( const CMPXMedia& aProperties, TInt aError );
+
+
+ /**
+ * Handle completion of a asynchronous command
+ * @param aCommandResult result of the command, NULL if error
+ * @param aError error code
+ */
+ void HandlePlaybackCommandComplete( CMPXCommand* /*aCommandResult*/,
+ TInt /*aError*/);
+ /*
+ * From base class MMPXCollectionMediaObserver
+ * (via MMPXCollectionObserver)
+ * Handle extended media properties
+ *
+ * @param aMedia media
+ * @param aError error code
+ */
+ inline void HandleCollectionMediaL( const CMPXMedia& /*aMedia*/, TInt /*aError*/ ) {}
+
+ /*
+ * From base class MMPXCollectionObserver
+ */
+ inline void HandleCollectionMessage( CMPXMessage* /*aMsg*/, TInt /*aErr*/ ) {}
+
+ inline void HandleOpenL( const CMPXMedia& /*aEntries*/,
+ TInt /*aIndex*/,
+ TBool /*aComplete*/,
+ TInt /*aError*/ ) {}
+
+ inline void HandleOpenL( const CMPXCollectionPlaylist& /*aPlaylist*/, TInt /*aError*/ ) {}
+
+ /**
+ * Set property
+ */
+ void SetPropertyL( TMPXPlaybackProperty aProperty, TInt aValue );
+ virtual void RetrievePdlInformationL();
+
+ TBool IsLive();
+
+ TBool IsPlaylist();
+
+ void IssueVideoAppForegroundCmdL(TBool aForeground);
+
+ void RequestMediaL();
+
+ void CreateGeneralPlaybackCommandL( TMPXPlaybackCommand aCmd, TBool aDoSync = ETrue );
+
+ TBool IsAppInFrontL();
+
+ /*
+ * Activates an active object to close the player
+ * @since 5.0
+ */
+ void ActivateClosePlayerActiveObject();
+
+ void CreateControlsL();
+
+ TBool IsMultiItemPlaylist();
+
+ void UpdateVideoRect( TInt aX, TInt aY, TInt aWidth, TInt aHeight, TBool transitionEffect );
+
+ void UpdateVideoRectDone();
+
+ void HandlePluginError( TInt aError );
+
+ void ClosePlaybackViewL();
+
+ void HandleBufferingStateL();
+
+ /*
+ * Provides the static function for the callback to close the player
+ * Called by CIdle iIdle
+ * @since 3.2
+ * @param aPtr Pointer to callback class
+ * @return KErrNone
+ */
+ static TInt ClosePlayer( TAny* aPtr );
+
+ /*
+ * Called to stop and exit the player
+ * @since 3.2
+ * @return void
+ */
+ void DoClosePlayer();
+
+ void HandleVideoPlaybackMessage( CMPXMessage* aMessage );
+
+ TBool IsResumingPlaybackAfterTermination();
+
+ private:
+
+ /**
+ * Handle playback message
+ *
+ * @param aMsg playback message
+ */
+ virtual void DoHandlePlaybackMessageL( CMPXMessage* aMessage );
+
+ /**
+ * Handle playback error message
+ *
+ * @param aErr system error code.
+ */
+ void DoHandleErrorPlaybackMessageL( TInt aError );
+
+ void DisplayFileDetailsDialogL();
+
+ /**
+ * Handle media properties.
+ *
+ * @param aMedia media properties
+ * @param aError error code
+ */
+ virtual void DoHandleMediaL( const CMPXMedia& aMedia, TInt aError );
+
+ void CreateVideoSpecificCmdL( TMPXVideoPlaybackCommand aCmd );
+
+ void ParseMetaDataL( const CMPXMedia& aMedia );
+
+ void DoHandleStateChangeL( TInt aNewState );
+
+ void HandleGeneralPlaybackMessageL( CMPXMessage* aMessage );
+
+ void SetAspectRatioL( TMPXVideoPlaybackCommand aCmd );
+
+ void HandleVolumeCmdL( TMPXPlaybackCommand aCmd );
+
+ void HandleShortPressBackwardL();
+
+ void IssuePlayCommandL();
+
+ void RequestPlaybackMediaL();
+
+ void RequestCollectionMediaL();
+
+ TBool IsInMemoryPlugin();
+
+ void UpdatePbPluginMediaL( TBool aSeek );
+
+ protected: // data
+ MMPXPlaybackUtility* iPlaybackUtility;
+ MMPXCollectionUtility* iCollectionUtility;
+ TMPXPlaybackState iPlaybackState;
+
+ VideoPlaybackViewFileDetails* iFileDetails;
+ CIdle* iCloseAO;
+
+ VideoBasePlaybackView* iView;
+ CMPXVideoPlaybackDisplayHandler* iDisplayHandler;
+ CMPXVideoPlaybackUserInputHandler* iUserInputHandler;
+ VideoPlaybackControlsController* iControlsController;
+
+ TMPXMediaRequestStatus iMediaRequestStatus;
+ TBool iCollectionMediaRequested;
+ TBool iPlaylistView;
+ int iPlayPosition;
+
+ public:
+ friend class VideoBasePlaybackView;
+};
+
+#endif // __MPXVIDEOVIEWWRAPPER_H__
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/viewsrc/mpxvideocontainer.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,45 @@
+/*
+* 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: CCoeControl to provide RWindow for videoplayback
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+#include "mpxvideocontainer.h"
+#include "mpxvideo_debug.h"
+
+CMPXVideoContainer::CMPXVideoContainer()
+{
+ MPX_ENTER_EXIT( _L("CMPXVideoContainer::CMPXVideoContainer()") );
+}
+
+CMPXVideoContainer::~CMPXVideoContainer()
+{
+ MPX_ENTER_EXIT( _L("CMPXVideoContainer::~CMPXVideoContainer()") );
+
+ CloseWindow();
+}
+
+void CMPXVideoContainer::ConstructL()
+{
+ MPX_ENTER_EXIT( _L("CMPXVideoContainer::ConstructL()") );
+
+ CreateWindowL();
+ ActivateL();
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/viewsrc/mpxvideoplaybackdisplayhandler.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,684 @@
+/*
+* 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 video playback display handler
+*
+*/
+
+// Version : %version: ou1cpsw#27 %
+
+#include <sysutil.h>
+#include <s32file.h>
+#include <mpxcommand.h>
+#include <mpxcommandgeneraldefs.h>
+#include <mpxplaybackutility.h>
+#include <mpxvideoplaybackdefs.h>
+
+#include "mpxvideocontainer.h"
+#include "mpxvideoviewwrapper.h"
+#include "mpxvideoplaybackdisplayhandler.h"
+#include "mpxvideoregion.h"
+#include "videoplaybackviewfiledetails.h"
+
+const TInt KVIDEORESIZINGREPEATRATE = 50000;
+const TReal32 KTRANSITIONEFFECTCNT = 8;
+
+_LIT( KAspectRatioFile, "c:\\private\\200159b2\\mpxvideoplayer_aspect_ratio.dat" );
+
+
+CMPXVideoPlaybackDisplayHandler::CMPXVideoPlaybackDisplayHandler( MMPXPlaybackUtility* aPlayUtil,
+ CMPXVideoViewWrapper* aViewWrapper )
+ : iPlaybackUtility( aPlayUtil )
+ , iTransitionEffectCnt( 0 )
+ , iViewWrapper( aViewWrapper )
+ , iScaleWidth( 100.0f )
+ , iScaleHeight( 100.0f )
+ , iHorizontalPosition( EHorizontalAlignCenter )
+ , iVerticalPosition( EVerticalAlignCenter )
+ , iRotation( EVideoRotationNone )
+ , iAutoScale( EAutoScaleBestFit )
+{
+}
+
+CMPXVideoPlaybackDisplayHandler::~CMPXVideoPlaybackDisplayHandler()
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::~CMPXVideoPlaybackDisplayHandler()"));
+
+ MPX_TRAPD( error, SaveAspectRatioL() );
+
+ if ( iResizingTimer )
+ {
+ iResizingTimer->Cancel();
+ delete iResizingTimer;
+ iResizingTimer = NULL;
+ }
+
+ iAspectRatioArray.Close();
+
+ if ( iVideoDisplay )
+ {
+ SurfaceRemoved();
+
+ delete iVideoDisplay;
+ iVideoDisplay = NULL;
+ }
+
+ if ( iVideoContainer )
+ {
+ delete iVideoContainer;
+ iVideoContainer = NULL;
+ }
+}
+
+CMPXVideoPlaybackDisplayHandler*
+CMPXVideoPlaybackDisplayHandler::NewL( MMPXPlaybackUtility* aPlayUtil,
+ CMPXVideoViewWrapper* aViewWrapper )
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::NewL()"));
+
+ CMPXVideoPlaybackDisplayHandler* self =
+ new(ELeave) CMPXVideoPlaybackDisplayHandler( aPlayUtil, aViewWrapper );
+
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ CleanupStack::Pop();
+ return self;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackDisplayHandler::ConstructL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackDisplayHandler::ConstructL()
+{
+ iResizingTimer = CPeriodic::NewL( CActive::EPriorityStandard );
+ LoadAspectRatioL();
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackDisplayHandler::CreateDisplayWindowL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackDisplayHandler::CreateDisplayWindowL(
+ RWsSession& /*aWs*/,
+ CWsScreenDevice& aScreenDevice,
+ RWindow& aWin,
+ TRect aDisplayRect )
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::CreateDisplayWindowL()"));
+
+ if ( ! iVideoContainer )
+ {
+ iVideoContainer = new ( ELeave ) CMPXVideoContainer();
+ iVideoContainer->ConstructL();
+ iVideoContainer->SetRect( aDisplayRect );
+ }
+
+ aWin.SetSurfaceTransparency( ETrue );
+
+ RWindowBase *videoWindow = iVideoContainer->DrawableWindow();
+ videoWindow->SetOrdinalPosition( -1 );
+ (&aWin)->SetOrdinalPosition( 0 );
+
+ MPX_DEBUG(_L("VideoWindow ordinal position is: %d"), videoWindow->OrdinalPosition());
+ MPX_DEBUG(_L("UiWindow ordinal position is: %d"), (&aWin)->OrdinalPosition());
+
+ AddDisplayWindowL( aScreenDevice, *videoWindow, (RWindow*)videoWindow );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackDisplayHandler::RemoveDisplayWindow()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackDisplayHandler::RemoveDisplayWindow()
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::RemoveDisplayWindow()"));
+
+ if ( iVideoDisplay )
+ {
+ SurfaceRemoved();
+ delete iVideoDisplay;
+ iVideoDisplay = NULL;
+ }
+
+ if ( iVideoContainer )
+ {
+ delete iVideoContainer;
+ iVideoContainer = NULL;
+ }
+
+ iSurfaceId = TSurfaceId::CreateNullId();
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackDisplayHandler::HandleVideoDisplayMessageL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackDisplayHandler::HandleVideoDisplayMessageL( CMPXMessage* aMessage )
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::HandleVideoDisplayMessage()"));
+
+ TMPXVideoDisplayCommand message =
+ ( *(aMessage->Value<TMPXVideoDisplayCommand>(KMPXMediaVideoDisplayCommand)) );
+
+ MPX_DEBUG(
+ _L("CMPXVideoPlaybackDisplayHandler::HandleVideoDisplayMessageL() message = %d"), message );
+
+ switch ( message )
+ {
+ case EPbMsgVideoSurfaceCreated:
+ {
+ SurfaceCreatedL( aMessage );
+ break;
+ }
+ case EPbMsgVideoSurfaceChanged:
+ {
+ SurfaceChangedL( aMessage );
+ break;
+ }
+ case EPbMsgVideoSurfaceRemoved:
+ {
+ SurfaceRemoved();
+ break;
+ }
+ }
+}
+
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackDisplayHandler::SetAspectRatioL()
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoPlaybackDisplayHandler::SetAspectRatioL( TMPXVideoPlaybackCommand aCmd )
+{
+ MPX_DEBUG(_L("CMPXVideoPlaybackDisplayHandler::SetAspectRatioL()"));
+
+ TInt aspectRatio;
+
+ aspectRatio = SetNgaAspectRatioL( aCmd );
+
+ //
+ // Update the aspect ratio in the array
+ //
+ TInt count = iAspectRatioArray.Count();
+
+ if ( count > 0 && count > iCurrentIndexForAspectRatio )
+ {
+ iAspectRatioArray[iCurrentIndexForAspectRatio].scalingType = (TMMFScalingType)aspectRatio;
+ }
+
+ return aspectRatio;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackDisplayHandler::SetDefaultAspectRatioL
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoPlaybackDisplayHandler::SetDefaultAspectRatioL(
+ VideoPlaybackViewFileDetails* aFileDetails, TReal32 aDisplayAspectRatio )
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::SetDefaultAspectRatioL()"));
+
+ TInt newAspectRatio = EMMFNatural;
+
+ if ( aFileDetails->mVideoHeight > 0 && aFileDetails->mVideoWidth > 0 )
+ {
+ TMMFScalingType scalingType = EMMFNatural;
+
+ TReal32 videoAspectRatio = (TReal32)aFileDetails->mVideoWidth /
+ (TReal32)aFileDetails->mVideoHeight;
+
+ TInt cnt = iAspectRatioArray.Count();
+ TInt i = 0;
+
+ //
+ // check whether dat file has the information about (videoRatio + screenRatio)
+ //
+ for ( ; i < cnt ; i++ )
+ {
+ if ( iAspectRatioArray[i].videoRatio == videoAspectRatio &&
+ iAspectRatioArray[i].screenRatio == aDisplayAspectRatio &&
+ ( scalingType = iAspectRatioArray[i].scalingType ) > 0 )
+ {
+ break;
+ }
+ }
+
+ //
+ // if can't find out match aspect ratio in dat file,
+ // choose the scaling type through the rule
+ // aspectRatioDiff = videoAspectRatio - aDisplayAspectRatio
+ // aspectRatioDiff == 0 ==> natural
+ // aspectRatioDiff > 0.1 ==> zoom
+ // aspectRatioDiff < - 0.3 ==> natural
+ // aspectRatioDiff >= - 0.3 and <= 0.1 ==> stretch
+ //
+
+ if ( i == cnt )
+ {
+ if ( videoAspectRatio - aDisplayAspectRatio > 0.1 )
+ {
+ scalingType = EMMFZoom;
+ }
+ else if ( ( videoAspectRatio != aDisplayAspectRatio ) &&
+ ( videoAspectRatio - aDisplayAspectRatio > (- 0.3) ) )
+ {
+ scalingType = EMMFStretch;
+ }
+
+ TMPXAspectRatio ratio;
+
+ ratio.videoRatio = videoAspectRatio;
+ ratio.screenRatio = aDisplayAspectRatio;
+ ratio.scalingType = scalingType;
+
+ iAspectRatioArray.Append( ratio );
+ }
+
+ iCurrentIndexForAspectRatio = i;
+
+ TMPXVideoPlaybackCommand aspectRatioCmd = EPbCmdNaturalAspectRatio;
+
+ if ( scalingType == EMMFZoom )
+ {
+ aspectRatioCmd = EPbCmdZoomAspectRatio;
+ }
+ else if ( scalingType == EMMFStretch )
+ {
+ aspectRatioCmd = EPbCmdStretchAspectRatio;
+ }
+
+ newAspectRatio = SetAspectRatioL( aspectRatioCmd );
+ }
+
+ return newAspectRatio;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackDisplayHandler::SaveAspectRatioL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackDisplayHandler::SaveAspectRatioL()
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::SaveAspectRatioL"));
+
+ RFs fs;
+ TInt err = fs.Connect();
+ CleanupClosePushL<RFs>( fs );
+
+ TBool canSave = EFalse;
+
+ TRAP_IGNORE( canSave = ! SysUtil::FFSSpaceBelowCriticalLevelL(
+ &fs, sizeof(TMPXAspectRatio) * iAspectRatioArray.Count()) );
+
+ if ( canSave )
+ {
+ // save list to disk
+ RFileWriteStream out;
+
+ TInt err( out.Replace( fs, KAspectRatioFile, EFileWrite ) );
+
+ if ( err == KErrPathNotFound )
+ {
+ fs.MkDirAll( KAspectRatioFile );
+ err = out.Create( fs, KAspectRatioFile, EFileWrite );
+ }
+
+ if ( ! err )
+ {
+ TInt cnt = iAspectRatioArray.Count();
+
+ MPX_TRAP( err,
+ {
+ for ( TInt i = 0 ; i < cnt ; i++ )
+ {
+ //Save (videoRatio + screenRatio + scalingType)
+ out.WriteReal32L( iAspectRatioArray[i].videoRatio );
+ out.WriteReal32L( iAspectRatioArray[i].screenRatio );
+ out.WriteInt8L( iAspectRatioArray[i].scalingType );
+ }
+ } );
+
+ out.Close();
+ }
+ }
+
+ CleanupStack::PopAndDestroy();
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackDisplayHandler::LoadAspectRatioL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackDisplayHandler::LoadAspectRatioL()
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::LoadAspectRatioL()"));
+
+ RFs fs;
+ RFileReadStream in;
+
+ TInt err = fs.Connect();
+ CleanupClosePushL<RFs>( fs );
+
+ if ( ! err && in.Open( fs, KAspectRatioFile, EFileRead ) == KErrNone )
+ {
+ TMPXAspectRatio ratio;
+
+ MPX_TRAP( err,
+ {
+ for ( err = KErrNone ; err == KErrNone ; )
+ {
+ //
+ // Read (videoRatio + screenRatio + scalingType)
+ //
+ ratio.videoRatio = in.ReadReal32L();
+ ratio.screenRatio = in.ReadReal32L();
+ ratio.scalingType = (TMMFScalingType)in.ReadInt8L();
+
+ iAspectRatioArray.Append( ratio );
+ }
+ } );
+
+ in.Close();
+ }
+
+ CleanupStack::PopAndDestroy();
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackDisplayHandler::UpdateVideoRectL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackDisplayHandler::UpdateVideoRectL( TRect aClipRect, TBool transitionEffect )
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::UpdateVideoRectL()"));
+
+ if ( transitionEffect )
+ {
+ iTlXDiff = (TReal32)( iWindowRect.iTl.iX - aClipRect.iTl.iX ) / KTRANSITIONEFFECTCNT;
+ iTlYDiff = (TReal32)( iWindowRect.iTl.iY - aClipRect.iTl.iY ) / KTRANSITIONEFFECTCNT;
+ iBrXDiff = (TReal32)( iWindowRect.iBr.iX - aClipRect.iBr.iX ) / KTRANSITIONEFFECTCNT;
+ iBrYDiff = (TReal32)( iWindowRect.iBr.iY - aClipRect.iBr.iY ) / KTRANSITIONEFFECTCNT;
+
+ if ( iResizingTimer->IsActive() )
+ {
+ iResizingTimer->Cancel();
+ }
+
+ iResizingTimer->Start(
+ 0,
+ KVIDEORESIZINGREPEATRATE,
+ TCallBack( CMPXVideoPlaybackDisplayHandler::UpdateVideoRectTimeOutL, this ) );
+ }
+ else
+ {
+ SetVideoRectL( aClipRect );
+
+ iWindowRect = aClipRect;
+
+ iViewWrapper->UpdateVideoRectDone();
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackDisplayHandler::UpdateVideoRectTimeOutL()
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoPlaybackDisplayHandler::UpdateVideoRectTimeOutL( TAny* aPtr )
+{
+ MPX_DEBUG(_L("CMPXVideoPlaybackDisplayHandler::UpdateVideoRectTimeOutL()"));
+
+ static_cast<CMPXVideoPlaybackDisplayHandler*>(aPtr)->CalculateVideoRectL();
+
+ return KErrNone;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackDisplayHandler::CalculateVideoRectL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackDisplayHandler::CalculateVideoRectL()
+{
+ iTransitionEffectCnt++;
+
+ TRect windowRect( (TInt)( (TReal32)iWindowRect.iTl.iX - iTlXDiff * (TReal32)iTransitionEffectCnt ),
+ (TInt)( (TReal32)iWindowRect.iTl.iY - iTlYDiff * (TReal32)iTransitionEffectCnt ),
+ (TInt)( (TReal32)iWindowRect.iBr.iX - iBrXDiff * (TReal32)iTransitionEffectCnt ),
+ (TInt)( (TReal32)iWindowRect.iBr.iY - iBrYDiff * (TReal32)iTransitionEffectCnt ) );
+
+ MPX_DEBUG(_L("CMPXVideoPlaybackDisplayHandler::CalculateVideoRectL() %d %d %d %d"),
+ windowRect.iTl.iX, windowRect.iTl.iY, windowRect.iBr.iX, windowRect.iBr.iY );
+
+ SetVideoRectL( windowRect );
+
+ if ( iTransitionEffectCnt >= KTRANSITIONEFFECTCNT )
+ {
+ iTransitionEffectCnt = 0;
+ iWindowRect = windowRect;
+
+ if ( iResizingTimer->IsActive() )
+ {
+ iResizingTimer->Cancel();
+ }
+
+ MPX_DEBUG(_L("CMPXVideoPlaybackDisplayHandler::CalculateVideoRectL() Done"));
+
+ iViewWrapper->UpdateVideoRectDone();
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackDisplayHandler::SetVideoRectL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackDisplayHandler::SetVideoRectL( TRect aRect )
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::SetVideoRectL()"));
+
+ if ( iVideoDisplay )
+ {
+ iVideoDisplay->SetVideoExtentL( *iWindowBase, aRect, TRect( iWindowBase->Size() ) );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackDisplayHandler::AddDisplayWindowL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackDisplayHandler::AddDisplayWindowL( CWsScreenDevice& aScreenDevice,
+ RWindowBase& aWindowBase,
+ RWindow* aWin )
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::AddDisplayWindowL()"));
+
+ iWindowBase = &aWindowBase;
+
+ TInt displayId = aScreenDevice.GetScreenNumber();
+
+ MPX_DEBUG(_L("CMPXVideoPlaybackDisplayHandler::AddDisplayWindowL() displayId %d"), displayId);
+
+ CMediaClientVideoDisplay* tempDisplay = iVideoDisplay;
+
+ iVideoDisplay = CMediaClientVideoDisplay::NewL( displayId );
+
+ delete tempDisplay;
+
+ TRect cropRect = TRect( aWin->Size() );
+
+ //
+ // If RWindow is still in potrait, rotate surface to play a video in landscape
+ //
+ if ( cropRect.Width() < cropRect.Height() )
+ {
+ iRotation = EVideoRotationClockwise90;
+ }
+
+ iWindowRect = cropRect;
+
+ MPX_DEBUG(_L("CMPXVideoPlaybackDisplayHandler::AddDisplayWindowL() cropRect (%d, %d), (%d, %d)"),
+ cropRect.iTl.iX, cropRect.iTl.iY, cropRect.iBr.iX, cropRect.iBr.iY);
+
+ MPX_TRAPD( dispError,
+ iVideoDisplay->AddDisplayWindowL( iWindowBase,
+ cropRect,
+ cropRect,
+ cropRect,
+ iScaleWidth,
+ iScaleHeight,
+ iRotation,
+ iAutoScale,
+ iHorizontalPosition,
+ iVerticalPosition,
+ aWin );
+ );
+
+ MPX_DEBUG(_L("CMPXVideoPlaybackDisplayHandler::AddDisplayWindowL() Display Added"));
+ //
+ // Check if surface was created before window was ready
+ //
+ if ( iSurfaceCached )
+ {
+ iVideoDisplay->SurfaceCreated( iSurfaceId, iCropRect, iAspectRatio, iCropRect );
+
+ iSurfaceCached = EFalse;
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackDisplayHandler::SurfaceCreatedL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackDisplayHandler::SurfaceCreatedL( CMPXMessage* aMessage )
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::SurfaceCreatedL()"));
+
+ TSurfaceId oldSurfaceId = iSurfaceId;
+
+ //
+ // Extract the surface parameters from the message
+ //
+ iSurfaceId = aMessage->ValueTObjectL<TSurfaceId>( KMPXMediaVideoDisplayTSurfaceId );
+ iCropRect = aMessage->ValueTObjectL<TRect>( KMPXMediaVideoDisplayCropRect );
+ iAspectRatio = aMessage->ValueTObjectL<TVideoAspectRatio>( KMPXMediaVideoDisplayAspectRatio );
+
+ if ( iVideoDisplay )
+ {
+ //
+ // Remove old surface if one exists
+ //
+ if ( ! oldSurfaceId.IsNull() )
+ {
+ iVideoDisplay->RemoveSurface();
+ }
+
+ //
+ // Add new surface
+ //
+ iVideoDisplay->SurfaceCreated( iSurfaceId, iCropRect, iAspectRatio, iCropRect );
+ }
+ else
+ {
+ //
+ // Video display has not been created yet, save surface information to create
+ // the surface when the display is created
+ //
+ iSurfaceCached = ETrue;
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackDisplayHandler::SurfaceChangedL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackDisplayHandler::SurfaceChangedL( CMPXMessage* aMessage )
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::SurfaceChangedL()"));
+
+ //
+ // Extract the surface parameters from the message
+ //
+ iSurfaceId = aMessage->ValueTObjectL<TSurfaceId>( KMPXMediaVideoDisplayTSurfaceId );
+ iCropRect = aMessage->ValueTObjectL<TRect>( KMPXMediaVideoDisplayCropRect );
+ iAspectRatio = aMessage->ValueTObjectL<TVideoAspectRatio>( KMPXMediaVideoDisplayAspectRatio );
+
+ if ( iVideoDisplay )
+ {
+ //
+ // Add new surface
+ //
+ iVideoDisplay->SurfaceParametersChanged( iSurfaceId, iCropRect, iAspectRatio );
+
+ iVideoDisplay->RedrawWindows( iCropRect );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackDisplayHandler::SurfaceRemoved()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackDisplayHandler::SurfaceRemoved()
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::SurfaceRemoved()"));
+
+ if ( iVideoDisplay )
+ {
+ iVideoDisplay->RemoveSurface();
+ }
+
+ iSurfaceId = TSurfaceId::CreateNullId();
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackDisplayHandler::SetNgaAspectRatioL()
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoPlaybackDisplayHandler::SetNgaAspectRatioL( TMPXVideoPlaybackCommand aCmd )
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::SetNgaAspectRatioL()"));
+
+ TInt aspectRatio = EMMFNatural;
+
+ switch ( aCmd )
+ {
+ case EPbCmdNaturalAspectRatio:
+ {
+ iAutoScale = EAutoScaleBestFit;
+ aspectRatio = EMMFNatural;
+ break;
+ }
+ case EPbCmdZoomAspectRatio:
+ {
+ iAutoScale = EAutoScaleClip;
+ aspectRatio = EMMFZoom;
+ break;
+ }
+ case EPbCmdStretchAspectRatio:
+ {
+ iAutoScale = EAutoScaleStretch;
+ aspectRatio = EMMFStretch;
+ break;
+ }
+ }
+
+ if ( iVideoDisplay && ! iSurfaceId.IsNull() )
+ {
+ iVideoDisplay->SetAutoScaleL( iAutoScale,
+ iHorizontalPosition,
+ iVerticalPosition,
+ iCropRect );
+ }
+
+ return aspectRatio;
+}
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/viewsrc/mpxvideoplaybackuserinputhandler.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,618 @@
+/*
+* 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 playback view's input handler
+*
+*/
+
+// Version : %version: 8 %
+
+
+// INCLUDE FILES
+#include <e32std.h>
+#include <w32std.h> // RWindowBase
+#include <e32base.h>
+#include <eikclbd.h>
+#include <aknconsts.h>
+#include <remconcoreapi.h>
+#include <remconcoreapitarget.h>
+#include <remconinterfaceselector.h> // Side volume key
+#include <mpxplaybackframeworkdefs.h>
+#include <centralrepository.h> // for peripheral display timeout setting
+#include <settingsinternalcrkeys.h> // display timeout setting keys
+#include <hwrmlightdomaincrkeys.h>
+#include <mpxvideoplaybackdefs.h>
+
+#include <hal.h>
+#include <hal_data.h>
+
+#include "mpxvideo_debug.h"
+#include "mpxvideoviewwrapper.h"
+#include "mpxcommonvideoplaybackview.hrh"
+#include "mpxvideoplaybackuserinputhandler.h"
+
+
+// CONSTANTS
+const TInt KMPXMicroSecondsInASecond = 1000000;
+
+
+// ======== MEMBER FUNCTIONS =======================================================================
+
+// -------------------------------------------------------------------------------------------------
+// MPXVideoPlaybackUserInputHandler::CMPXVideoPlaybackUserInputHandler()
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackUserInputHandler::CMPXVideoPlaybackUserInputHandler( CMPXVideoViewWrapper* aWrapper )
+ : iViewWrapper( aWrapper )
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::NewL()
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackUserInputHandler* CMPXVideoPlaybackUserInputHandler::NewL(
+ CMPXVideoViewWrapper* aWrapper, TBool aTvOutConnected )
+{
+ MPX_DEBUG(_L("CMPXVideoPlaybackUserInputHandler::NewL()"));
+
+ CMPXVideoPlaybackUserInputHandler* self =
+ new (ELeave) CMPXVideoPlaybackUserInputHandler( aWrapper );
+ CleanupStack::PushL( self );
+ self->ConstructL( aTvOutConnected );
+ CleanupStack::Pop();
+ return self;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackUserInputHandler::ConstructL( TBool aTvOutConnected )
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoPlaybackUserInputHandler::ConstructL()"));
+
+ iVolumeRepeatTimer = CPeriodic::NewL( CActive::EPriorityStandard );
+ iDisplayTimer = CPeriodic::NewL( CPeriodic::EPriorityStandard );
+ iInterfaceSelector = CRemConInterfaceSelector::NewL();
+ iCoreTarget = CRemConCoreApiTarget::NewL( *iInterfaceSelector, *this );
+
+ iTVOutConnected = aTvOutConnected;
+
+ // Start the timer if TV out is connected
+ if ( iTVOutConnected )
+ {
+ // Get the display light time-out value from CenRep
+ CRepository* repository = CRepository::NewLC( KCRUidLightSettings );
+
+ // What's the timeout value (in seconds ) for the display light?
+ repository->Get( KDisplayLightsTimeout, iDisplayTimeOut );
+ MPX_DEBUG(_L("CMPXVideoPlaybackUserInputHandler::ConstructL Display Timeout( %d )"), iDisplayTimeOut);
+
+ CleanupStack::PopAndDestroy( repository );
+
+ // Convert the timeout value to microseconds
+ iDisplayTimeOut *= KMPXMicroSecondsInASecond;
+
+ RestartDisplayTimer();
+ }
+
+ // not detrimental if Media Keys dont work - so ignore any errors here
+ TRAP_IGNORE( iInterfaceSelector->OpenTargetL() );
+
+ iProcessingInputType = EVideoNone;
+ iForeground = ETrue;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::~CMPXVideoPlaybackUserInputHandler()
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPlaybackUserInputHandler::~CMPXVideoPlaybackUserInputHandler()
+{
+ if ( iVolumeRepeatTimer )
+ {
+ iVolumeRepeatTimer->Cancel();
+ delete iVolumeRepeatTimer;
+ }
+
+ if ( iDisplayTimer )
+ {
+ iDisplayTimer->Cancel();
+ delete iDisplayTimer;
+ }
+
+ if ( iInterfaceSelector )
+ {
+ delete iInterfaceSelector;
+ iCoreTarget = NULL;
+ iInterfaceSelector = NULL;
+ }
+
+ // make sure that backlight enabled when
+ // the view updates or deactivates
+ EnableBacklight();
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::MrccatoPlay()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackUserInputHandler::MrccatoPlay( TRemConCoreApiPlaybackSpeed /*aSpeed*/,
+ TRemConCoreApiButtonAction aButtonAct )
+{
+ MPX_ENTER_EXIT(
+ _L("CMPXVideoPlaybackUserInputHandler::MrccatoPlay"),
+ _L("aButtonAct = %d"), aButtonAct );
+
+ ProcessMediaKey(ERemConCoreApiPlay, aButtonAct);
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::MrccatoCommand()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackUserInputHandler::MrccatoCommand(TRemConCoreApiOperationId aOperationId,
+ TRemConCoreApiButtonAction aButtonAct )
+{
+ MPX_ENTER_EXIT(
+ _L("CMPXVideoPlaybackUserInputHandler::MrccatoCommand"),
+ _L("aButtonAct = %d"), aButtonAct );
+
+ ProcessMediaKey(aOperationId, aButtonAct);
+}
+
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::DoHandleMediaKey()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackUserInputHandler::DoHandleMediaKey( TRemConCoreApiOperationId aOperationId,
+ TRemConCoreApiButtonAction aButtonAct )
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoPlaybackUserInputHandler::DoHandleMediaKey()"));
+
+ switch ( aOperationId )
+ {
+ case ERemConCoreApiStop:
+ {
+ if ( aButtonAct == ERemConCoreApiButtonClick )
+ {
+ TRAP_IGNORE(iViewWrapper->HandleCommandL( EMPXPbvCmdStop ));
+ }
+ break;
+ }
+ case ERemConCoreApiRewind:
+ {
+ HandleRewind(aButtonAct);
+ break;
+ }
+ case ERemConCoreApiFastForward:
+ {
+ HandleFastForward(aButtonAct);
+ break;
+ }
+ case ERemConCoreApiVolumeUp:
+ {
+ HandleVolumeUp(aButtonAct);
+ break;
+ }
+ case ERemConCoreApiVolumeDown:
+ {
+ HandleVolumeDown(aButtonAct);
+ break;
+ }
+ case ERemConCoreApiPausePlayFunction:
+ {
+ if ( aButtonAct == ERemConCoreApiButtonClick )
+ {
+ TRAP_IGNORE(iViewWrapper->HandleCommandL(EMPXPbvCmdPlayPause));
+ }
+ break;
+ }
+ case ERemConCoreApiPause:
+ {
+ TRAP_IGNORE(iViewWrapper->HandleCommandL(EMPXPbvCmdPause));
+ break;
+ }
+ case ERemConCoreApiPlay:
+ {
+ if ( aButtonAct == ERemConCoreApiButtonClick )
+ {
+ TRAP_IGNORE(iViewWrapper->HandleCommandL(EMPXPbvCmdPlay));
+ }
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::HandleFastForward()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackUserInputHandler::HandleFastForward(TRemConCoreApiButtonAction aButtonAct)
+{
+ if (aButtonAct == ERemConCoreApiButtonPress)
+ {
+ TRAP_IGNORE(iViewWrapper->HandleCommandL(EMPXPbvCmdSeekForward));
+ }
+ else if (aButtonAct == ERemConCoreApiButtonRelease)
+ {
+ TRAP_IGNORE(iViewWrapper->HandleCommandL(EMPXPbvCmdEndSeek));
+ }
+}
+
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::HandleRewind()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackUserInputHandler::HandleRewind(TRemConCoreApiButtonAction aButtonAct)
+{
+ if (aButtonAct == ERemConCoreApiButtonPress)
+ {
+ TRAP_IGNORE(iViewWrapper->HandleCommandL(EMPXPbvCmdSeekBackward));
+ }
+ else if (aButtonAct == ERemConCoreApiButtonRelease)
+ {
+ TRAP_IGNORE(iViewWrapper->HandleCommandL(EMPXPbvCmdEndSeek));
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::HandleVolumeUp()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackUserInputHandler::HandleVolumeUp(TRemConCoreApiButtonAction aButtonAct)
+{
+ switch ( aButtonAct )
+ {
+ case ERemConCoreApiButtonPress:
+ {
+ // Volume Up - Pressed
+ if ( iVolumeRepeatTimer->IsActive() )
+ {
+ iVolumeRepeatTimer->Cancel();
+ }
+
+ iVolumeRepeatUp = ETrue;
+ iVolumeRepeatTimer->Start(
+ KAknStandardKeyboardRepeatRate,
+ KAknStandardKeyboardRepeatRate,
+ TCallBack(
+ CMPXVideoPlaybackUserInputHandler::HandleVolumeRepeatTimeoutL,
+ this ) );
+
+ break;
+ }
+ case ERemConCoreApiButtonRelease:
+ {
+ // Volume Up - Released
+ iVolumeRepeatTimer->Cancel();
+ break;
+ }
+ case ERemConCoreApiButtonClick:
+ {
+ // Volume Up - Clicked
+ TRAP_IGNORE( iViewWrapper->HandleCommandL( EMPXPbvCmdIncreaseVolume ) );
+ break;
+ }
+ }
+}
+
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::HandleVolumeDown()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackUserInputHandler::HandleVolumeDown(TRemConCoreApiButtonAction aButtonAct)
+{
+ switch ( aButtonAct )
+ {
+ case ERemConCoreApiButtonPress:
+ {
+ // Volume Up - Pressed
+ if ( iVolumeRepeatTimer->IsActive() )
+ {
+ iVolumeRepeatTimer->Cancel();
+ }
+
+ iVolumeRepeatUp = EFalse;
+ iVolumeRepeatTimer->Start(
+ KAknStandardKeyboardRepeatRate,
+ KAknStandardKeyboardRepeatRate,
+ TCallBack(
+ CMPXVideoPlaybackUserInputHandler::HandleVolumeRepeatTimeoutL,
+ this ) );
+
+ break;
+ }
+ case ERemConCoreApiButtonRelease:
+ {
+ // Volume Up - Released
+ iVolumeRepeatTimer->Cancel();
+ break;
+ }
+ case ERemConCoreApiButtonClick:
+ {
+ // Volume Down - Clicked
+ TRAP_IGNORE( iViewWrapper->HandleCommandL( EMPXPbvCmdDecreaseVolume ) );
+ break;
+ }
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::ProcessKeyEvent()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackUserInputHandler::ProcessKeyEventL( const TKeyEvent& /*aKeyEvent*/,
+ TEventCode /*aType*/ )
+{
+ MPX_DEBUG(_L("MPXVideoPlaybackUserInputHandler::ProcessKeyEvent"));
+
+ /*
+ switch (iProcessingInputType)
+ {
+ case EVideoNone:
+ {
+ if (aType == EEventKeyDown && iForeground)
+ {
+ iProcessingInputType = EVideoKeyboard;
+ iLastPressedKeyCode = aKeyEvent.iCode;
+ iLastPressedKeyScanCode = aKeyEvent.iScanCode;
+ if ( iTVOutConnected )
+ {
+ RestartDisplayTimer();
+ }
+ iViewWrapper->DoHandleKeyEventL( aKeyEvent, aType );
+ }
+ break;
+ }
+ case EVideoKeyboard:
+ {
+ if (aType == EEventKeyUp)
+ {
+ // only handle up event for the key being handled
+ // ignore spurious key presses
+ if (aKeyEvent.iCode == iLastPressedKeyCode &&
+ aKeyEvent.iScanCode == iLastPressedKeyScanCode)
+ {
+ iViewWrapper->DoHandleKeyEventL( aKeyEvent, aType );
+
+ // reset the value only on key up event
+ iProcessingInputType = EVideoNone;
+ }
+ }
+ break;
+ }
+ default:
+ {
+ // user input is disallowed
+ break;
+ }
+ } // switch*/
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::ProcessMediaKey()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackUserInputHandler::ProcessMediaKey(TRemConCoreApiOperationId aOperationId,
+ TRemConCoreApiButtonAction aButtonAct)
+{
+ MPX_DEBUG(_L("CMPXVideoPlaybackUserInputHandler::ProcessMediaKey"));
+
+ switch (iProcessingInputType)
+ {
+ case EVideoNone:
+ {
+ if (aButtonAct == ERemConCoreApiButtonPress && iForeground)
+ {
+ iProcessingInputType = EVideoMediaKeys;
+ iLastMediaKeyPressed = aOperationId;
+ DoHandleMediaKey(aOperationId, aButtonAct);
+ if ( iTVOutConnected )
+ {
+ RestartDisplayTimer();
+ }
+ }
+ else if (aButtonAct == ERemConCoreApiButtonClick && iForeground)
+ {
+ DoHandleMediaKey(aOperationId, aButtonAct);
+ if ( iTVOutConnected )
+ {
+ RestartDisplayTimer();
+ }
+ // reset on click AND/OR release
+ iProcessingInputType = EVideoNone;
+ }
+ break;
+ }
+ case EVideoMediaKeys:
+ {
+ if (aButtonAct == ERemConCoreApiButtonRelease)
+ {
+ // handle only if this release is for media-key being currently handled
+ // ignore spurious media key presses
+ if (iLastMediaKeyPressed == aOperationId)
+ {
+ DoHandleMediaKey(aOperationId, aButtonAct);
+ // reset on click AND/OR release
+ iProcessingInputType = EVideoNone;
+ }
+ }
+ break;
+ }
+ default:
+ {
+ // user input is disallowed
+ break;
+ }
+ } // switch
+}
+
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::HandleVolumeRepeatTimeoutL()
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoPlaybackUserInputHandler::HandleVolumeRepeatTimeoutL( TAny* aPtr )
+{
+ MPX_DEBUG(_L("CMPXVideoPlaybackUserInputHandler::HandleVolumeRepeatTimeoutL()"));
+
+ static_cast<CMPXVideoPlaybackUserInputHandler*>(aPtr)->HandleVolumeRepeatL();
+
+ return KErrNone;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::HandleVolumeRepeatL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackUserInputHandler::HandleVolumeRepeatL()
+{
+ MPX_DEBUG(_L("CMPXVideoPlaybackUserInputHandler::HandleVolumeRepeatL()"));
+
+ TMPXVideoPlaybackViewCommandIds command = EMPXPbvCmdDecreaseVolume;
+
+ if ( iVolumeRepeatUp )
+ {
+ command = EMPXPbvCmdIncreaseVolume;
+ }
+
+ iViewWrapper->HandleCommandL( command );
+}
+
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::SetForeground()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackUserInputHandler::SetForeground(TBool aForeground)
+{
+ iForeground = aForeground;
+
+ if ( !iForeground )
+ {
+ // we are in background so reset iProcessingInputType value
+ iProcessingInputType = EVideoNone;
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::DisableBacklight()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackUserInputHandler::DisableBacklight()
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoPlaybackUserInputHandler::DisableBacklight"));
+
+ // cancel the timer
+ iDisplayTimer->Cancel();
+
+ // disable the backlight
+ HAL::Set( HALData::EBacklightState, 0 );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::EnableBacklight()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackUserInputHandler::EnableBacklight()
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoPlaybackUserInputHandler::EnableBacklight"));
+
+ // enable the backlight
+ HAL::Set( HALData::EBacklightState, 1 );
+}
+
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::HandleTVOutEvent()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackUserInputHandler::HandleTVOutEventL(TBool aTVOutConnected)
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoPlaybackUserInputHandler::HandleTVOutEvent"));
+
+ iTVOutConnected = aTVOutConnected;
+
+ if ( iTVOutConnected )
+ {
+ // Get the display light time-out value from CenRep
+ CRepository* repository = CRepository::NewLC( KCRUidLightSettings );
+
+ // What's the timeout value (in seconds ) for the display light?
+ repository->Get( KDisplayLightsTimeout, iDisplayTimeOut );
+ MPX_DEBUG(_L("CMPXVideoPlaybackUserInputHandler::ConstructL Display Timeout( %d )"), iDisplayTimeOut);
+
+ CleanupStack::PopAndDestroy( repository );
+
+ // Convert the timeout value to microseconds
+ iDisplayTimeOut *= KMPXMicroSecondsInASecond;
+
+ RestartDisplayTimer();
+ }
+ else
+ {
+ iDisplayTimer->Cancel();
+ EnableBacklight();
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::HandleDisplayTimeout
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoPlaybackUserInputHandler::HandleDisplayTimeout( TAny* aPtr )
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoPlaybackUserInputHandler::HandleDisplayTimeout"));
+
+ static_cast<CMPXVideoPlaybackUserInputHandler*>(aPtr)->DisableBacklight();
+
+ return KErrNone;
+}
+
+// -----------------------------------------------------------------------------
+// CMPXVideoPlaybackUserInputHandler::RestartDisplayTimer
+// -----------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackUserInputHandler::RestartDisplayTimer()
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoPlaybackUserInputHandler::RestartDisplayTimer"));
+
+ // check if the display timer is running if so cancelit
+ if ( iDisplayTimer->IsActive() )
+ {
+ iDisplayTimer->Cancel();
+ }
+ else
+ {
+ // timeout has happened and the backlight is disabled
+ // enable the backlight
+ HAL::Set( HALData::EBacklightState, 1 );
+ }
+
+ TBool backlightState;
+ TInt ret = HAL::Get( HALData::EBacklightState, backlightState );
+
+ // Re start the display backlight timer
+ iDisplayTimer->Start( iDisplayTimeOut, iDisplayTimeOut,
+ TCallBack( CMPXVideoPlaybackUserInputHandler::HandleDisplayTimeout, this ) );
+}
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/viewsrc/mpxvideoviewwrapper.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,1668 @@
+/*
+* 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 Video base playback view
+*
+*/
+
+// Version : %version: da1mmcf#41 %
+
+
+
+// Include Files
+
+#include <w32std.h>
+#include <eikenv.h>
+
+#include <mpxplaybackcommanddefs.h>
+#include <mpxvideoplaybackdefs.h>
+#include <mpxcommandgeneraldefs.h>
+#include <mpxcommand.h>
+#include <mpxmessagegeneraldefs.h>
+#include <mpxplaybackmessage.h>
+#include <mpxmediageneraldefs.h>
+#include <mpxmediavideodefs.h>
+#include <mpxplaybackutility.h>
+#include <mmf/common/mmferrors.h>
+#include <mpxcollectionutility.h>
+#include <mpxcollectionplaylist.h>
+#include <mpxmediageneralextdefs.h>
+#include <vcxmyvideosuids.h>
+
+#include "mpxvideo_debug.h"
+#include "mpxvideoregion.h"
+#include "mpxvideoviewwrapper.h"
+#include "mpxvideoplaybackuids.hrh"
+#include "mpxhbvideocommondefs.h"
+#include "videobaseplaybackview.h"
+#include "videoplaybackcontrol.hrh"
+#include "videoplaybackviewfiledetails.h"
+#include "mpxvideoplaybackdisplayhandler.h"
+#include "mpxcommonvideoplaybackview.hrh"
+#include "videoplaybackcontrolscontroller.h"
+#include "mpxvideoplaybackuserinputhandler.h"
+
+// Member Functions
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::CMPXVideoViewWrapper()
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoViewWrapper::CMPXVideoViewWrapper( VideoBasePlaybackView* aView )
+ : iView( aView )
+ , iControlsController( NULL )
+ , iMediaRequestStatus( MediaNotRequested )
+ , iPlaylistView( false )
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::NewL()
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoViewWrapper* CMPXVideoViewWrapper::NewL( VideoBasePlaybackView* aView )
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::NewL()"));
+
+ CMPXVideoViewWrapper* self = new (ELeave) CMPXVideoViewWrapper( aView );
+
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ CleanupStack::Pop();
+
+ return self;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::ConstructL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::ConstructL()
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::ConstructL()"));
+
+
+ //
+ // Get the playback utility instance from playback utility
+ //
+ iPlaybackUtility =
+ MMPXPlaybackUtility::UtilityL( EMPXCategoryVideo, KPbModeDefault );
+ iPlaybackUtility->AddObserverL( *this );
+ iPlaybackUtility->SetPrimaryClientL();
+
+ //
+ // Get an instance of collection utility
+ // Used for the Collection Observer to get the MediaL callbacks
+ //
+ iCollectionUtility = MMPXCollectionUtility::NewL( this );
+
+ //
+ // Create Active Object for closing player
+ //
+ iCloseAO = CIdle::NewL( CActive::EPriorityStandard );
+
+ //
+ // Create Video Playback Display Handler
+ //
+ iDisplayHandler = CMPXVideoPlaybackDisplayHandler::NewL( iPlaybackUtility, this );
+
+ //
+ // Create control's controller
+ //
+ CreateControlsL();
+
+ //
+ // Create user input handler
+ //
+ iUserInputHandler = CMPXVideoPlaybackUserInputHandler::NewL( this, iFileDetails->mTvOutConnected );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::~CMPXVideoViewWrapper()
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoViewWrapper::~CMPXVideoViewWrapper()
+{
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::~CMPXVideoViewWrapper()"));
+
+ //
+ // Delete the display handler when the view is deactivated
+ //
+ if ( iDisplayHandler )
+ {
+ delete iDisplayHandler;
+ iDisplayHandler = NULL;
+ }
+
+ if ( iUserInputHandler )
+ {
+ delete iUserInputHandler;
+ iUserInputHandler = NULL;
+ }
+
+ if ( iControlsController )
+ {
+ delete iControlsController;
+ iControlsController = NULL;
+ }
+
+ if ( iCloseAO )
+ {
+ delete iCloseAO;
+ iCloseAO = NULL;
+ }
+
+ if ( iFileDetails )
+ {
+ delete iFileDetails;
+ iFileDetails = NULL;
+ }
+
+ if ( iPlaybackUtility )
+ {
+ TRAP_IGNORE( iPlaybackUtility->RemoveObserverL( *this ) );
+ iPlaybackUtility->Close();
+ iPlaybackUtility = NULL;
+ }
+
+ if ( iCollectionUtility )
+ {
+ iCollectionUtility->Close();
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::IsLive()
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoViewWrapper::IsLive()
+{
+ return ( iFileDetails->mPlaybackMode == EMPXVideoLiveStreaming );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::IsPlaylist()
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoViewWrapper::IsPlaylist()
+{
+ return iPlaylistView;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::CreateGeneralPlaybackCommandL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::CreateGeneralPlaybackCommandL( TMPXPlaybackCommand aCmd, TBool aDoSync )
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::CreateGeneralPlaybackCommandL()"),
+ _L("aCmd = %d, aDoSync, = %d"), aCmd, aDoSync );
+
+ CMPXCommand* cmd = CMPXCommand::NewL();
+ CleanupStack::PushL( cmd );
+
+ cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, aDoSync );
+ cmd->SetTObjectValueL<TBool>( KMPXCommandPlaybackGeneralNoBuffer, ETrue );
+ cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId, KMPXCommandIdPlaybackGeneral );
+ cmd->SetTObjectValueL<TInt>( KMPXCommandPlaybackGeneralType, aCmd );
+
+ iPlaybackUtility->CommandL( *cmd, this );
+
+ CleanupStack::PopAndDestroy( cmd );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::HandleCommandL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::HandleCommandL( TInt aCommand )
+{
+ MPX_ENTER_EXIT(
+ _L("CMPXVideoViewWrapper::HandleCommandL()"),
+ _L("aCommand = %d"), aCommand );
+
+ switch ( aCommand )
+ {
+ case EMPXPbvCmdPlay:
+ {
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EPbCmdPlay"));
+ CreateGeneralPlaybackCommandL( EPbCmdPlay );
+ break;
+ }
+ case EMPXPbvCmdPause:
+ {
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdPause"));
+ CreateGeneralPlaybackCommandL( EPbCmdPause );
+ break;
+ }
+ case EMPXPbvCmdClose:
+ {
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdClose"));
+
+ //
+ // 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:
+ {
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdSeekForward"));
+ CreateVideoSpecificCmdL( EPbCmdStartVideoSeekingForward );
+ break;
+ }
+ case EMPXPbvCmdSeekBackward:
+ {
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdSeekBackward"));
+ CreateVideoSpecificCmdL( EPbCmdStartVideoSeekingBackward );
+ break;
+ }
+ case EMPXPbvCmdEndSeek:
+ {
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdEndSeek"));
+ CreateVideoSpecificCmdL( EPbCmdStopVideoSeeking );
+ break;
+ }
+ case EMPXPbvCmdPlayPause:
+ {
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdPlayPause"));
+
+ if ( iPlaybackState == EPbStatePlaying )
+ {
+ CreateGeneralPlaybackCommandL( EPbCmdPause );
+ }
+ else if ( iPlaybackState == EPbStatePaused )
+ {
+ CreateGeneralPlaybackCommandL( EPbCmdPlay );
+ }
+
+ break;
+ }
+ case EMPXPbvCmdStop:
+ {
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdStop"));
+ CreateGeneralPlaybackCommandL( EPbCmdStop );
+ break;
+ }
+ case EMPXPbvCmdDecreaseVolume:
+ {
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdDecreaseVolume"));
+ HandleVolumeCmdL( EPbCmdDecreaseVolume );
+ break;
+ }
+ case EMPXPbvCmdIncreaseVolume:
+ {
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdIncreaseVolume"));
+ HandleVolumeCmdL( EPbCmdIncreaseVolume );
+ break;
+ }
+ case EMPXPbvCmdNaturalAspectRatio:
+ {
+ MPX_DEBUG(
+ _L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdNaturalAspectRatio"));
+ SetAspectRatioL( EPbCmdNaturalAspectRatio );
+ break;
+ }
+ case EMPXPbvCmdZoomAspectRatio:
+ {
+ MPX_DEBUG(
+ _L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdZoomAspectRatio"));
+ SetAspectRatioL( EPbCmdZoomAspectRatio );
+ break;
+ }
+ case EMPXPbvCmdStretchAspectRatio:
+ {
+ MPX_DEBUG(
+ _L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdStretchAspectRatio"));
+ SetAspectRatioL( EPbCmdStretchAspectRatio );
+ break;
+ }
+ case EMPXPbvCmdMute:
+ {
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdMute"));
+ HandleVolumeCmdL( EPbCmdMuteVolume );
+ break;
+ }
+ case EMPXPbvCmdUnMute:
+ {
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdUnMute"));
+ HandleVolumeCmdL( EPbCmdUnMuteVolume );
+ break;
+ }
+ case EMPXPbvCmdShortPressBackward:
+ {
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdShortPressBackward"));
+
+ HandleShortPressBackwardL();
+ break;
+ }
+ case EMPXPbvCmdResetControls:
+ {
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdResetControls"));
+
+ CreateControlsL();
+ iView->retrievePdlInformation();
+ break;
+ }
+ case EMPXPbvCmdNextListItem:
+ {
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdNextListItem"));
+
+ if ( iPlaylistView && iFileDetails->mMultiItemPlaylist )
+ {
+ CreateGeneralPlaybackCommandL( EPbCmdNext );
+ }
+ else
+ {
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() ignore EMPXPbvCmdNextListItem"));
+ }
+
+ break;
+ }
+ case EMPXPbvCmdPreviousListItem:
+ {
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdPreviousListItem"));
+
+ if ( iPlaylistView && iFileDetails->mMultiItemPlaylist )
+ {
+ //
+ // Need to send sync message to go back to a previous clip
+ // regardless of current positoin
+ //
+ CreateGeneralPlaybackCommandL( EPbCmdPrevious );
+ }
+ else
+ {
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() ignore EMPXPbvCmdNextListItem"));
+ }
+
+ break;
+ }
+ case EMPXPbvCmdEndOfClip:
+ {
+ CreateVideoSpecificCmdL( EPbCmdEndofClipReached );
+ break;
+ }
+ case EMPXPbvCmdCustomPause:
+ {
+ CreateVideoSpecificCmdL( EPbCmdCustomPause );
+ break;
+ }
+ case EMPXPbvCmdCustomPlay:
+ {
+ CreateVideoSpecificCmdL( EPbCmdCustomPlay );
+ break;
+ }
+ case EMPXPbvCmdRealOneBitmapTimeout:
+ {
+ IssuePlayCommandL();
+
+ break;
+ }
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// From MMPXPlaybackObserver
+// Handle playback message.
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::HandlePlaybackMessage( CMPXMessage* aMessage, TInt aError )
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::HandlePlaybackMessage()"),
+ _L("aError = %d"), aError );
+
+ if ( aError )
+ {
+ MPX_TRAPD( err, DoHandleErrorPlaybackMessageL( aError ) );
+ }
+ else if ( aMessage )
+ {
+ MPX_TRAPD( err, DoHandlePlaybackMessageL( aMessage ) );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// Request for the media object
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::RequestMediaL()
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::RequestMediaL()"));
+
+ if ( iMediaRequestStatus == MediaNotRequested &&
+ iPlaybackUtility->StateL() == EPbStateInitialised )
+ {
+ iMediaRequestStatus = MediaRequested;
+
+ if ( iPlaylistView && IsInMemoryPlugin() )
+ {
+ // Get the media attributes from the collection plugin
+ RequestCollectionMediaL();
+ }
+ else
+ {
+ // Get the file details from playback plugin
+ RequestPlaybackMediaL();
+ }
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::DoHandlePlaybackMessageL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::DoHandlePlaybackMessageL( CMPXMessage* aMessage )
+{
+ TMPXMessageId id( *(aMessage->Value<TMPXMessageId>(KMPXMessageGeneralId)) );
+
+ MPX_ENTER_EXIT(
+ _L("CMPXVideoViewWrapper::DoHandlePlaybackMessageL()"),
+ _L("id = 0x%08x"), id );
+
+ if ( KMPXMessageGeneral == id )
+ {
+ HandleGeneralPlaybackMessageL( aMessage );
+ }
+ else if ( KMPXMediaIdVideoPlayback == id )
+ {
+ HandleVideoPlaybackMessage( aMessage );
+ }
+ else if ( KMPXMediaIdVideoDisplayMessage == id )
+ {
+ if ( iDisplayHandler )
+ {
+ iDisplayHandler->HandleVideoDisplayMessageL( aMessage );
+ }
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::HandleGeneralPlaybackMessageL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::HandleGeneralPlaybackMessageL( CMPXMessage* aMessage )
+{
+ TInt event( *aMessage->Value<TInt>( KMPXMessageGeneralEvent ) );
+ TInt type( *aMessage->Value<TInt>( KMPXMessageGeneralType ) );
+ TInt data( *aMessage->Value<TInt>( KMPXMessageGeneralData ) );
+
+ MPX_DEBUG(
+ _L("CMPXVideoViewWrapper::HandleGeneralPlaybackMessageL() event = %d type = %d value = %d"),
+ event, type, data );
+
+ switch ( event )
+ {
+ case TMPXPlaybackMessage::EStateChanged:
+ {
+ DoHandleStateChangeL( type );
+
+ break;
+ }
+ case TMPXPlaybackMessage::EPropertyChanged:
+ {
+ TMPXPlaybackProperty property(
+ static_cast<TMPXPlaybackProperty>( type ) );
+
+ HandlePropertyL( property, data, KErrNone );
+ break;
+ }
+ case TMPXPlaybackMessage::EDownloadPositionChanged:
+ {
+ if ( iControlsController )
+ {
+ iControlsController->handleEvent( EControlCmdDownloadUpdated, data );
+ }
+
+ break;
+ }
+ case TMPXPlaybackMessage::EDownloadStateChanged:
+ {
+ break;
+ }
+ case TMPXPlaybackMessage::ECommandReceived:
+ {
+ break;
+ }
+ case TMPXPlaybackMessage::EReachedEndOfPlaylist:
+ {
+ iView->closePlaybackView();
+ break;
+ }
+ case TMPXPlaybackMessage::ESongChanged:
+ {
+ break;
+ }
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::HandleVideoPlaybackMessage()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::HandleVideoPlaybackMessage( CMPXMessage* aMessage )
+{
+ TMPXVideoPlaybackCommand message =
+ ( *(aMessage->Value<TMPXVideoPlaybackCommand>(KMPXMediaVideoPlaybackCommand)) );
+
+ MPX_DEBUG(
+ _L("CMPXVideoViewWrapper::HandleVideoPlaybackMessage() message = %d"), message );
+
+ switch ( message )
+ {
+ case EPbCmdPluginError:
+ {
+ TInt error( *aMessage->Value<TInt>( KMPXMediaVideoError ) );
+
+ iView->handlePluginError( error );
+ break;
+ }
+ case EPbCmdTvOutEvent:
+ {
+ TVideoPlaybackControlCommandIds cmdId = EControlCmdTvOutDisconnected;
+
+ TBool tvOutConnected( *aMessage->Value<TInt>( KMPXMediaVideoTvOutConnected ) );
+
+ if ( tvOutConnected )
+ {
+ cmdId = EControlCmdTvOutConnected;
+ }
+
+ if ( iUserInputHandler )
+ {
+ TRAP_IGNORE(iUserInputHandler->HandleTVOutEventL( tvOutConnected ));
+ }
+
+ if ( iControlsController )
+ {
+ iControlsController->handleEvent( cmdId );
+ }
+ break;
+ }
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::HandlePluginError()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::HandlePluginError( int aError )
+{
+ MPX_DEBUG(
+ _L("CMPXVideoViewWrapper::HandlePluginError() aError = %d"), aError );
+
+ iView->handlePluginError( aError );
+}
+
+// -------------------------------------------------------------------------------------------------
+// Handle playback state changes
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::DoHandleStateChangeL( TInt aNewState )
+{
+ MPX_ENTER_EXIT(
+ _L("CMPXVideoViewWrapper::DoHandleStateChangeL()"),
+ _L("aNewState = %d"), aNewState );
+
+ if ( aNewState != iPlaybackState )
+ {
+ switch ( aNewState )
+ {
+ case EPbStateInitialising:
+ {
+ if ( iControlsController )
+ {
+ //
+ // If transitioning from Not Initialized to Initialising there is
+ // no need to update the playback information that was gathered
+ // when the container was created
+ //
+ if ( iPlaybackState != EPbStateNotInitialised )
+ {
+ iMediaRequestStatus = MediaNotRequested;
+ HandleCommandL( EMPXPbvCmdResetControls );
+
+ if ( iFileDetails )
+ {
+ iFileDetails->clearFileDetails();
+ }
+ }
+ }
+ break;
+ }
+ case EPbStateBuffering:
+ {
+ HandleBufferingStateL();
+
+ break;
+ }
+ case EPbStatePluginSeeking:
+ {
+ // no-op
+ break;
+ }
+ case EPbStateStopped:
+ {
+ if ( iFileDetails->mMultiItemPlaylist )
+ {
+ iView->handleStoppedState();
+ }
+ else
+ {
+ iView->closePlaybackView();
+ }
+
+ break;
+ }
+ case EPbStateInitialised:
+ {
+ RequestMediaL();
+ break;
+ }
+ default:
+ {
+ break;
+ }
+ }
+
+ iPlaybackState = (TMPXPlaybackState)aNewState;
+
+ if ( iControlsController )
+ {
+ iControlsController->handleEvent( EControlCmdStateChanged, aNewState );
+ }
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::HandleBufferingStateL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::HandleBufferingStateL()
+{
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleBufferingStateL()"));
+
+}
+
+// -------------------------------------------------------------------------------------------------
+// Handle playback error message.
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::DoHandleErrorPlaybackMessageL( TInt aError )
+{
+ MPX_ENTER_EXIT( _L("CMPXVideoViewWrapper::DoHandleErrorPlaybackMessageL()"),
+ _L("aError = %d"), aError );
+
+ HandleCommandL( EMPXPbvCmdResetControls );
+ iView->handlePluginError(aError);
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::HandlePlaybackCommandComplete()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::HandlePlaybackCommandComplete( CMPXCommand* /*aCommandResult*/,
+ TInt /*aError*/ )
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::HandlePlaybackCommandComplete()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::ParseMetaDataL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::ParseMetaDataL( const CMPXMessage& aMedia )
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::ParseMetaDataL()"));
+
+ //
+ // Clip Name
+ //
+ if ( aMedia.IsSupported( KMPXMediaGeneralUri ) )
+ {
+ TPtrC uri( aMedia.ValueText( KMPXMediaGeneralUri ) );
+ const QString qClipname( (QChar*)uri.Ptr(), uri.Length() );
+ iFileDetails->mClipName = qClipname;
+ }
+
+ //
+ // Title
+ //
+ if ( aMedia.IsSupported( KMPXMediaGeneralTitle ) )
+ {
+ TPtrC title( aMedia.ValueText( KMPXMediaGeneralTitle ) );
+ const QString qTitle( (QChar*)title.Ptr(), title.Length() );
+ iFileDetails->mTitle = qTitle;
+ }
+
+ //
+ // Artist
+ //
+ if ( aMedia.IsSupported( KMPXMediaVideoArtist ) )
+ {
+ TPtrC artist( aMedia.ValueText( KMPXMediaVideoArtist ) );
+ const QString qArtist( (QChar*)artist.Ptr(), artist.Length() );
+ iFileDetails->mArtist = qArtist;
+ }
+
+ //
+ // Mime Type
+ //
+ if ( aMedia.IsSupported( KMPXMediaGeneralMimeType ) )
+ {
+ TPtrC mimeType( aMedia.ValueText( KMPXMediaGeneralMimeType ) );
+ const QString qMimeType( (QChar*)mimeType.Ptr(), mimeType.Length() );
+ iFileDetails->mMimeType = qMimeType;
+ }
+
+ //
+ // Duration
+ //
+ if ( aMedia.IsSupported( KMPXMediaGeneralDuration ) )
+ {
+ iFileDetails->mDuration = aMedia.ValueTObjectL<TInt>( KMPXMediaGeneralDuration );
+ }
+
+ //
+ // Audio Enabled
+ //
+ if ( aMedia.IsSupported( KMPXMediaVideoAudioEnabled ) )
+ {
+ iFileDetails->mAudioEnabled = aMedia.ValueTObjectL<TInt>( KMPXMediaVideoAudioEnabled );
+ }
+
+ //
+ // Video Enabled
+ //
+ if ( aMedia.IsSupported( KMPXMediaVideoVideoEnabled ) )
+ {
+ iFileDetails->mVideoEnabled = aMedia.ValueTObjectL<TInt>( KMPXMediaVideoVideoEnabled );
+ }
+
+ //
+ // Partial Playback
+ //
+ if ( aMedia.IsSupported( KMPXMediaVideoPartialPlayback ) )
+ {
+ iFileDetails->mPartialPlayback =
+ aMedia.ValueTObjectL<TInt>( KMPXMediaVideoPartialPlayback );
+ }
+
+ //
+ // Playback Mode
+ //
+ if ( aMedia.IsSupported( KMPXMediaVideoPlaybackMode ) )
+ {
+ iFileDetails->mPlaybackMode =
+ (TMPXVideoMode)aMedia.ValueTObjectL<TInt>( KMPXMediaVideoPlaybackMode );
+ }
+
+ //
+ // Seekable
+ //
+ if ( aMedia.IsSupported( KMPXMediaVideoSeekable ) )
+ {
+ iFileDetails->mSeekable = aMedia.ValueTObjectL<TInt>( KMPXMediaVideoSeekable );
+ }
+
+ //
+ // Pausable
+ //
+ if ( aMedia.IsSupported( KMPXMediaVideoPausableStream ) )
+ {
+ iFileDetails->mPausableStream = aMedia.ValueTObjectL<TBool>( KMPXMediaVideoPausableStream );
+ }
+
+ //
+ // Video Height
+ //
+ if ( aMedia.IsSupported( KMPXMediaVideoHeight ) )
+ {
+ iFileDetails->mVideoHeight = aMedia.ValueTObjectL<TInt>( KMPXMediaVideoHeight );
+ }
+
+ //
+ // Video Width
+ //
+ if ( aMedia.IsSupported( KMPXMediaVideoWidth ) )
+ {
+ iFileDetails->mVideoWidth = aMedia.ValueTObjectL<TInt>( KMPXMediaVideoWidth );
+ }
+
+ //
+ // TV-Out Connected
+ //
+ if ( aMedia.IsSupported( KMPXMediaVideoTvOutConnected ) )
+ {
+ iFileDetails->mTvOutConnected = aMedia.ValueTObjectL<TInt>( KMPXMediaVideoTvOutConnected );
+ }
+
+ //
+ // BitRate
+ //
+ if ( aMedia.IsSupported( KMPXMediaVideoBitRate ) )
+ {
+ iFileDetails->mBitRate = aMedia.ValueTObjectL<TInt>( KMPXMediaVideoBitRate );
+ }
+
+ //
+ // Drm Protected
+ //
+ if ( aMedia.IsSupported( KMPXMediaVideoDrmProtected ) )
+ {
+ iFileDetails->mDrmProtected = aMedia.ValueTObjectL<TInt>( KMPXMediaVideoDrmProtected );
+ }
+
+ //
+ // Description
+ //
+ if ( aMedia.IsSupported( KMPXMediaVideoDescription ) )
+ {
+ TPtrC description( aMedia.ValueText( KMPXMediaVideoDescription ) );
+ const QString qDescription( (QChar*)description.Ptr(), description.Length() );
+ iFileDetails->mDescription = qDescription;
+ }
+
+ //
+ // Location
+ //
+ if ( aMedia.IsSupported( KMPXMediaVideoLocation ) )
+ {
+ TPtrC location( aMedia.ValueText( KMPXMediaVideoLocation ) );
+ const QString qLocation( (QChar*)location.Ptr(), location.Length() );
+ iFileDetails->mLocation = qLocation;
+ }
+
+ //
+ // Copyright
+ //
+ if ( aMedia.IsSupported( KMPXMediaVideoCopyright ) )
+ {
+ TPtrC copyright( aMedia.ValueText( KMPXMediaVideoCopyright ) );
+ const QString qCopyright( (QChar*)copyright.Ptr(), copyright.Length() );
+ iFileDetails->mCopyright = qCopyright;
+ }
+
+ //
+ // Language
+ //
+ if ( aMedia.IsSupported( KMPXMediaVideoLanguage ) )
+ {
+ TPtrC language( aMedia.ValueText( KMPXMediaVideoLanguage ) );
+ const QString qLanguage( (QChar*)language.Ptr(), language.Length() );
+ iFileDetails->mLanguage = qLanguage;
+ }
+
+ //
+ // Keywords
+ //
+ if ( aMedia.IsSupported( KMPXMediaVideoKeywords ) )
+ {
+ TPtrC keywords( aMedia.ValueText( KMPXMediaVideoKeywords ) );
+ const QString qKeywords( (QChar*)keywords.Ptr(), keywords.Length() );
+ iFileDetails->mKeywords = qKeywords;
+ }
+
+ //
+ // Creation date/time
+ //
+ if ( aMedia.IsSupported( KMPXMediaVideoCreated ) )
+ {
+ iFileDetails->mCreationTime = aMedia.ValueTObjectL<TInt>( KMPXMediaVideoCreated );
+ }
+
+ //
+ // Last Modified date/time
+ //
+ if ( aMedia.IsSupported( KMPXMediaVideoLastModified ) )
+ {
+ iFileDetails->mModificationTime = aMedia.ValueTObjectL<TInt>( KMPXMediaVideoLastModified );
+ }
+
+}
+
+// -------------------------------------------------------------------------------------------------
+// Handle media properties.
+// Notes: The client is responsible for delete the object of aProperties.
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::DoHandleMediaL( const CMPXMessage& aMedia, TInt aError )
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::DoHandleMediaL()"),
+ _L("aError = %d"), aError );
+
+ if ( aError == KErrNone )
+ {
+ iMediaRequestStatus = MediaDelivered;
+
+ if ( ! iFileDetails )
+ {
+ iFileDetails = new VideoPlaybackViewFileDetails();
+ }
+
+ //
+ // Read in the media data
+ //
+ ParseMetaDataL( aMedia );
+
+ //
+ // If RN logo is still visible, wait for timeout of rn logo timer
+ // If RN logo is not visible, issue play
+ //
+ if ( ! iControlsController->isRNLogoBitmapInControlList() )
+ {
+ IssuePlayCommandL();
+ }
+ }
+ else
+ {
+ iMediaRequestStatus = MediaNotRequested;
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// From MMPXPlaybackCallback
+// Handle media event.
+// Notes: The client is responsible for delete the object of aProperties.
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::HandleMediaL( const CMPXMedia& aMedia, TInt aError)
+{
+ MPX_ENTER_EXIT(_L( "CMPXVideoViewWrapper::HandleMediaL()" ));
+
+ if ( iCollectionMediaRequested )
+ {
+ TBool seek;
+ iCollectionMediaRequested = EFalse;
+
+ if ( aMedia.IsSupported( KMPXMediaGeneralExtVideoSeekable ) )
+ {
+ seek = aMedia.ValueTObjectL<TBool>( KMPXMediaGeneralExtVideoSeekable );
+ UpdatePbPluginMediaL( seek );
+ }
+
+ // request for media from playbackplugin
+ RequestPlaybackMediaL();
+ }
+ else
+ {
+ if ( aMedia.IsSupported( KMPXMediaVideoError ) )
+ {
+ TInt error = aMedia.ValueTObjectL<TInt>( KMPXMediaVideoError );
+
+ iMediaRequestStatus = MediaNotRequested;
+ iView->handlePluginError( error );
+ }
+ else
+ {
+ DoHandleMediaL( aMedia, aError );
+ }
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::SetPropertyL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::SetPropertyL( TMPXPlaybackProperty aProperty, TInt aValue )
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::SetPropertyL"),
+ _L("aProperty = %d, aValue = %d"), aProperty, aValue );
+
+ iPlaybackUtility->SetL( aProperty, aValue );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::HandlePropertyL()
+// -------------------------------------------------------------------------------------------------
+//
+void
+CMPXVideoViewWrapper::HandlePropertyL( TMPXPlaybackProperty aProperty, TInt aValue, TInt aError )
+{
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::HandlePropertyL - Error(%d)"), aError );
+
+ if ( aError == KErrNone )
+ {
+ switch ( aProperty )
+ {
+ case EPbPropertyPosition:
+ {
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::DoHandlePropertyL position(%d)"), aValue );
+
+ if ( iControlsController )
+ {
+ iControlsController->handleEvent( EControlCmdSetPosition, aValue );
+ }
+
+ iPlayPosition = aValue;
+
+ break;
+ }
+ case EPbPropertyDuration:
+ {
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::DoHandlePropertyL duration(%d)"), aValue );
+
+ if ( iControlsController )
+ {
+ iControlsController->handleEvent( EControlCmdSetDuration, aValue );
+ }
+
+ break;
+ }
+ case EPbPropertyMaxVolume:
+ {
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::DoHandlePropertyL max volume(%d)"), aValue );
+
+ break;
+ }
+ case EPbPropertyVolume:
+ {
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::DoHandlePropertyL volume(%d)"), aValue );
+
+ if ( iControlsController )
+ {
+ iControlsController->handleEvent( EControlCmdSetVolume, aValue );
+ }
+
+ break;
+ }
+ case EPbPropertyMute:
+ {
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::DoHandlePropertyL mute(%d)"), aValue );
+
+ if ( iControlsController && aValue )
+ {
+ iControlsController->handleEvent( EControlCmdSetVolume, 0 );
+ }
+
+ break;
+ }
+ }
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::RetrieveFileNameAndModeL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::RetrieveFileNameAndModeL( CMPXCommand* aCmd )
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::RetrieveFileNameAndModeL()"));
+
+ //
+ // set attributes on the command
+ //
+ aCmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
+
+ aCmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId, KMPXMediaIdVideoPlayback );
+
+ aCmd->SetTObjectValueL<TMPXVideoPlaybackCommand>( KMPXMediaVideoPlaybackCommand,
+ EPbCmdInitView );
+
+ iPlaybackUtility->CommandL( *aCmd );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::ActivateClosePlayerActiveObject
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::ActivateClosePlayerActiveObject()
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::ActivateClosePlayerActiveObject()"));
+
+ if ( ! iCloseAO->IsActive() )
+ {
+ iCloseAO->Start( TCallBack( CMPXVideoViewWrapper::ClosePlayer, this ) );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::ClosePlayer
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoViewWrapper::ClosePlayer( TAny* aPtr )
+{
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::ClosePlayer()"));
+
+ static_cast<CMPXVideoViewWrapper*>(aPtr)->DoClosePlayer();
+ return KErrNone;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::DoClosePlayer
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::DoClosePlayer()
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::DoClosePlayer()"));
+
+ iView->doClosePlayer();
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::RetrievePdlInformationL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::RetrievePdlInformationL()
+{
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::RetrievePdlInformationL()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::CreateVideoSpecificCmdL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::CreateVideoSpecificCmdL( TMPXVideoPlaybackCommand aCmd )
+{
+ //
+ // create command to pass to playback plugin
+ //
+ CMPXCommand* cmd = CMPXCommand::NewL();
+ CleanupStack::PushL( cmd );
+
+ cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
+
+ cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId, KMPXMediaIdVideoPlayback );
+
+ cmd->SetTObjectValueL<TMPXVideoPlaybackCommand>( KMPXMediaVideoPlaybackCommand, aCmd );
+
+ iPlaybackUtility->CommandL( *cmd );
+
+ CleanupStack::PopAndDestroy( cmd );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::SetAspectRatioL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::SetAspectRatioL( TMPXVideoPlaybackCommand aCmd )
+{
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::SetAspectRatioL()"));
+
+ TInt newAspectRatio = iDisplayHandler->SetAspectRatioL( aCmd );
+
+ if ( iControlsController )
+ {
+ iControlsController->handleEvent( EControlCmdSetAspectRatio, newAspectRatio );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::IsAppInFrontL()
+// Returns true if app is foreground. Uses windowgroup id
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoViewWrapper::IsAppInFrontL()
+{
+ TBool ret = EFalse;
+ RWsSession wsSession;
+
+ User::LeaveIfError( wsSession.Connect() );
+
+ if( wsSession.Handle() )
+ {
+ CArrayFixFlat<TInt>* wgList =
+ new (ELeave) CArrayFixFlat<TInt>( wsSession.NumWindowGroups() );
+
+ // check if our window is front or not
+ if ( wsSession.WindowGroupList( 0, wgList ) == KErrNone )
+ {
+ ret = ( CEikonEnv::Static()->RootWin().Identifier() == wgList->At(0) );
+ }
+ else
+ {
+ ret = EFalse;
+ }
+
+ delete wgList;
+ }
+
+ wsSession.Close();
+
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::IsAppInFrontL (%d)" ), ret);
+
+ return ret;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::ClosePlaybackViewL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::ClosePlaybackViewL()
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::closePlaybackView()"));
+
+ iView->closePlaybackView();
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::HandleVolumeCmdL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::HandleVolumeCmdL( TMPXPlaybackCommand aCmd )
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::HandleVolumeCmdL()"));
+
+ //
+ // In case user try to change the volume via media key, rocker key or etc
+ // We need to show the controls though the volume level doesn't get changed
+ // For examples : - try to change the volume with a clip without audio track
+ // - try to reduce the volume with volume level 0
+ // - try to increase the volume with max volume level
+ //
+ iControlsController->handleEvent( EControlCmdShowVolumeControls );
+
+ switch( aCmd )
+ {
+ case EPbCmdDecreaseVolume:
+ {
+ CreateVideoSpecificCmdL( EPbCmdHandleDecreaseVolume );
+ break;
+ }
+ case EPbCmdIncreaseVolume:
+ {
+ CreateVideoSpecificCmdL( EPbCmdHandleIncreaseVolume );
+ break;
+ }
+ default:
+ {
+ iPlaybackUtility->CommandL( aCmd );
+ break;
+ }
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::HandleShortPressBackwardL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::HandleShortPressBackwardL()
+{
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleShortPressBackwardL()"));
+
+ if( !iPlaylistView )
+ {
+ SetPropertyL( EPbPropertyPosition, 0 );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::IssueVideoAppForegroundCmd()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::IssueVideoAppForegroundCmdL( TBool aForeground )
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::IssueVideoAppForegroundCmdL()"),
+ _L("aForeground = %d"), aForeground );
+
+ TMPXVideoPlaybackCommand videoCmd = EPbCmdHandleBackground;
+
+ if ( aForeground )
+ {
+ videoCmd = EPbCmdHandleForeground;
+ }
+
+ //
+ // create command to pass to playback plugin
+ //
+ CMPXCommand* cmd = CMPXCommand::NewL();
+ CleanupStack::PushL( cmd );
+
+ cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
+ cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId, KMPXMediaIdVideoPlayback );
+ cmd->SetTObjectValueL<TMPXVideoPlaybackCommand>( KMPXMediaVideoPlaybackCommand, videoCmd );
+ cmd->SetTObjectValueL<TBool>( KMPXMediaVideoAppForeground, IsAppInFrontL() );
+
+ iPlaybackUtility->CommandL( *cmd );
+ CleanupStack::PopAndDestroy( cmd );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::CreateControlsL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::CreateControlsL()
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::CreateControlsL()"));
+
+ //
+ // Query playback plugin for filename and mode
+ //
+ CMPXCommand* cmd = CMPXCommand::NewL();
+ CleanupStack::PushL( cmd );
+
+ RetrieveFileNameAndModeL( cmd );
+
+ //
+ // Create a temporary file details that is populated with the
+ // file name and playback mode. This will be delete when
+ // plugin initialization is complete
+ //
+ if ( iFileDetails )
+ {
+ delete iFileDetails;
+ iFileDetails = NULL;
+ }
+
+ iFileDetails = new VideoPlaybackViewFileDetails();
+
+ TPtrC fileName( cmd->ValueText( KMPXMediaVideoPlaybackFileName ) );
+ const QString qFilename( (QChar*)fileName.Ptr(), fileName.Length() );
+ iFileDetails->mClipName = qFilename;
+
+ iFileDetails->mPlaybackMode = (TMPXVideoMode) cmd->ValueTObjectL<TInt>( KMPXMediaVideoMode );
+
+ iFileDetails->mTvOutConnected = cmd->ValueTObjectL<TInt>( KMPXMediaVideoTvOutConnected );
+
+ TPtrC mimeType( cmd->ValueText( KMPXMediaVideoRecognizedMimeType ) );
+ const QString qMimeType( (QChar*)mimeType.Ptr(), mimeType.Length() );
+ iFileDetails->mMimeType = qMimeType;
+
+ //
+ // get playlist information and set mMultiItemPlaylist flag
+ //
+ TInt numItems = 1;
+ MMPXSource* s = iPlaybackUtility->Source();
+
+ if ( s )
+ {
+ CMPXCollectionPlaylist* playlist = NULL;
+
+ MPX_TRAPD( err, playlist = s->PlaylistL() );
+
+ if ( err == KErrNone && playlist )
+ {
+ iPlaylistView = ETrue;
+ numItems = playlist->Count();
+ delete playlist;
+ }
+ }
+
+ iFileDetails->mMultiItemPlaylist = ( numItems > 1 );
+
+ CleanupStack::PopAndDestroy( cmd );
+
+ if ( iControlsController )
+ {
+ delete iControlsController;
+ iControlsController = NULL;
+ }
+
+ iControlsController = new VideoPlaybackControlsController( iView, this, iFileDetails );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::IsMultiItemPlaylist()
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoViewWrapper::IsMultiItemPlaylist()
+{
+
+ bool multiLinks( false );
+
+ if ( iFileDetails )
+ {
+ multiLinks = iFileDetails->mMultiItemPlaylist;
+ }
+
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::IsMultiItemPlaylist() ret %d"), multiLinks );
+
+ return multiLinks;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::UpdateVideoRect()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::UpdateVideoRect(
+ TInt aX, TInt aY, TInt aWidth, TInt aHeight, TBool transitionEffect )
+{
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::UpdateVideoRect()"));
+
+ TRect rect( TPoint( aX, aY ), TSize( aWidth, aHeight ) );
+ TRAP_IGNORE( iDisplayHandler->UpdateVideoRectL( rect, transitionEffect ) );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::UpdateVideoRectDone()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::UpdateVideoRectDone()
+{
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::UpdateVideoRectDone()"));
+
+ 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( EControlCmdSetAspectRatio, newAspectRatio );
+ }
+ }
+
+ // if coming back after a forced termination, the playback position must
+ // be restored and state be set to paused, as forced termination can only
+ // happen when app is on background, in which case Video Player is paused
+ // by default
+ if ( IsResumingPlaybackAfterTermination() )
+ {
+ CreateGeneralPlaybackCommandL( EPbCmdPause );
+ SetPropertyL( EPbPropertyPosition, iView->mLastPlayPosition );
+ iView->mStayPaused = false;
+ }
+ else
+ {
+ CreateGeneralPlaybackCommandL( EPbCmdPlay );
+ }
+
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// Request for the media object
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::RequestPlaybackMediaL()
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::RequestPlaybackMediaL()"));
+
+ //
+ // Request the volume for the controls
+ //
+ iPlaybackUtility->PropertyL( *this, EPbPropertyVolume );
+
+ //
+ // Request the clip's meta data
+ //
+ MMPXSource* s = iPlaybackUtility->Source();
+
+ if ( s )
+ {
+ RArray<TMPXAttribute> attrs;
+ CleanupClosePushL(attrs);
+
+ //
+ // General Media Attributes
+ //
+ attrs.Append( KMPXMediaGeneralUri |
+ KMPXMediaGeneralDuration |
+ KMPXMediaGeneralTitle |
+ KMPXMediaGeneralMimeType );
+
+ //
+ // Video specific Attributes
+ //
+ attrs.Append( KMPXMediaVideoAll );
+
+ // Set the attribute to always route the media call to playback plugin
+ CMPXAttributeSpecs* specs = CMPXAttributeSpecs::NewL();
+ CleanupStack::PushL( specs );
+
+ specs->SetTObjectValueL<TBool>(KMPXMediaGeneralExtMediaRedirect, ETrue);
+
+ s->MediaL( attrs.Array(), *this, specs );
+
+ CleanupStack::PopAndDestroy( specs );
+ CleanupStack::PopAndDestroy( &attrs );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// Request for the media object
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::RequestCollectionMediaL()
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::RequestCollectionMediaL()"));
+
+ // Request the clip's meta data
+ MMPXSource* s = iPlaybackUtility->Source();
+
+ if ( s )
+ {
+ RArray<TMPXAttribute> attrs;
+ CleanupClosePushL(attrs);
+
+ // General Media Attributes
+ attrs.Append( KMPXMediaGeneralExtVideoSeekable );
+
+ s->MediaL( attrs.Array(), *this );
+
+ // Set the falg to indicate that media was reuqested from collection FW
+ iCollectionMediaRequested = ETrue;
+
+ CleanupStack::PopAndDestroy( &attrs );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::IsInMemoryPlugin
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoViewWrapper::IsInMemoryPlugin()
+{
+ TBool retVal( EFalse );
+
+ MMPXCollection& collectionPlugin = iCollectionUtility->Collection();
+
+ TUid collectionUid;
+ TUid inMemoryPluginUid = TUid::Uid( KMpxInMemoryPluginUid );
+
+ MPX_TRAPD( error, collectionUid = collectionPlugin.UidL() );
+
+ if ( ! error )
+ {
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::IsInMemoryPlugin() collectionUid = 0x%08x"),
+ collectionUid.iUid );
+
+ if ( collectionUid == inMemoryPluginUid )
+ {
+ retVal = ETrue;
+ }
+ }
+
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::IsInMemoryPlugin(%d)"), retVal );
+
+ return retVal;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::UpdatePbPluginMedia()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::UpdatePbPluginMediaL( TBool aSeek )
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::UpdatePbPluginMediaL()"),
+ _L("aSeek = %d"), aSeek );
+
+ CMPXCommand* cmd = CMPXCommand::NewL();
+ CleanupStack::PushL( cmd );
+
+ cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
+
+ cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId, KMPXMediaIdVideoPlayback );
+
+ cmd->SetTObjectValueL<TMPXVideoPlaybackCommand>( KMPXMediaVideoPlaybackCommand,
+ EPbCmdUpdateSeekable );
+
+ cmd->SetTObjectValueL<TBool>( KMPXMediaGeneralExtVideoSeekable, aSeek );
+
+ iPlaybackUtility->CommandL( *cmd );
+
+ CleanupStack::PopAndDestroy( cmd );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::IsResumingPlaybackAfterTermination()
+// -------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoViewWrapper::IsResumingPlaybackAfterTermination()
+{
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::IsResumingPlaybackAfterTermination()"));
+
+ return iView->mStayPaused;
+}
+
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/viewsrc/videobaseplaybackview.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,484 @@
+/*
+* 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 Video base playback view
+*
+*/
+
+// Version : %version: da1mmcf#45 %
+
+
+
+// Include Files
+
+
+
+#include <QTimer>
+#include <QGraphicsSceneEvent>
+
+#include <hbmenu.h>
+#include <hbaction.h>
+#include <hbinstance.h>
+#include <hbnotificationdialog.h>
+#include <hblabel.h>
+#include <hbtapgesture.h>
+#include <hbpangesture.h>
+
+#include <textresolver.h>
+#include <mmf/common/mmferrors.h>
+#include <DRMHelper.h>
+
+#include <mpxvideoplaybackdefs.h>
+#include <mpxplaybackcommanddefs.h>
+#include <mpxhbvideocommondefs.h>
+
+#include "mpxvideo_debug.h"
+#include "mpxvideoviewwrapper.h"
+#include "mpxvideoplaybackuids.hrh"
+#include "videobaseplaybackview.h"
+#include "videoactivitystate.h"
+#include "videoplaybackviewfiledetails.h"
+#include "mpxcommonvideoplaybackview.hrh"
+
+
+// Member Functions
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::VideoBasePlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+VideoBasePlaybackView::VideoBasePlaybackView()
+ : mVideoMpxWrapper( NULL )
+ , mTimerForClosingView( NULL )
+ , mActivated( false )
+ , mStayPaused ( false )
+{
+ MPX_ENTER_EXIT(_L("VideoBasePlaybackView::VideoBasePlaybackView()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::initializeVideoPlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::initializeVideoPlaybackView()
+{
+ MPX_ENTER_EXIT(_L("VideoBasePlaybackView::initializeVideoPlaybackView()"));
+
+ //
+ // Need to set to control full screen including status pane area
+ //
+ setContentFullScreen();
+
+ mTimerForClosingView = new QTimer();
+ mTimerForClosingView->setSingleShot( true );
+ mTimerForClosingView->setInterval( 10 );
+ connect( mTimerForClosingView, SIGNAL( timeout() ), this, SIGNAL( activatePreviousView() ) );
+
+ //
+ // Read activity data ...
+ // If last playback was forced to terminate due to low memory (GOOM, etc.)
+ // then the clip needs to be restored to the last played position
+ // and the state needs to be paused, since forced termination can only occur for
+ // background apps - so if this happened Video Player must have been in background
+ // which implies paused state
+ //
+ int lastViewType = VideoActivityState::instance().getActivityData(KEY_VIEWPLUGIN_TYPE).toInt();
+ if ( lastViewType == MpxHbVideoCommon::PlaybackView )
+ {
+ QVariant data = VideoActivityState::instance().getActivityData(KEY_LAST_PLAY_POSITION_ID);
+ mLastPlayPosition = data.toInt();
+
+ mStayPaused = true;
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::~VideoBasePlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+VideoBasePlaybackView::~VideoBasePlaybackView()
+{
+ MPX_DEBUG(_L("VideoBasePlaybackView::~VideoBasePlaybackView()"));
+
+ if ( mTimerForClosingView )
+ {
+ disconnect( mTimerForClosingView, SIGNAL( timeout() ), this, SIGNAL( activatePreviousView() ) );
+
+ if ( mTimerForClosingView->isActive() )
+ {
+ mTimerForClosingView->stop();
+ }
+
+ delete mTimerForClosingView;
+ mTimerForClosingView = NULL;
+ }
+
+ if ( mVideoMpxWrapper )
+ {
+ delete mVideoMpxWrapper;
+ mVideoMpxWrapper = NULL;
+ }
+
+ setParentItem( 0 );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::handleActivateView()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::handleActivateView()
+{
+ MPX_ENTER_EXIT(_L("VideoBasePlaybackView::handleActivateView()"));
+
+ MPX_TRAPD( err, mVideoMpxWrapper = CMPXVideoViewWrapper::NewL( this ) );
+
+ QCoreApplication::instance()->installEventFilter( this );
+
+ //
+ // Request the needed Media from the Playback Plugin
+ //
+ MPX_TRAP( err, mVideoMpxWrapper->RequestMediaL() );
+
+ menu()->close();
+
+ //
+ // Landscape orientation
+ // 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;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::handleDeactivateView()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::handleDeactivateView()
+{
+ MPX_ENTER_EXIT(_L("VideoBasePlaybackView::handleDeactivateView()"));
+
+ saveActivityData();
+
+ mActivated = false;
+
+ QCoreApplication::instance()->removeEventFilter( this );
+
+ //
+ // Close the playback plugin to release all references to previous clip
+ //
+ MPX_TRAPD( err, mVideoMpxWrapper->HandleCommandL( EMPXPbvCmdClose ) );
+
+ if ( mVideoMpxWrapper )
+ {
+ delete mVideoMpxWrapper;
+ mVideoMpxWrapper = NULL;
+ }
+
+ //
+ // go back to device orientation
+ //
+ //hbInstance->allMainWindows()[0]->unsetOrientation();
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::saveActivityData()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::saveActivityData()
+{
+ MPX_DEBUG( _L("VideoBasePlaybackView::saveActivityData()") );
+
+ // save the activity data
+ QVariant data = QString( mVideoMpxWrapper->iFileDetails->mClipName );
+ VideoActivityState::instance().setActivityData(data, KEY_LAST_PLAYED_CLIP);
+
+ data = int( mVideoMpxWrapper->iPlayPosition );
+ VideoActivityState::instance().setActivityData(data, KEY_LAST_PLAY_POSITION_ID);
+
+ data = bool( mVideoMpxWrapper->iFileDetails->mPlaybackMode == EMPXVideoLocal );
+ VideoActivityState::instance().setActivityData(data, KEY_LAST_LOCAL_PLAYBACK);
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::handleClosePlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::handleClosePlaybackView()
+{
+ MPX_DEBUG(
+ _L("VideoBasePlaybackView::handleClosePlaybackView()") );
+
+ if ( mVideoMpxWrapper && mVideoMpxWrapper->IsMultiItemPlaylist() )
+ {
+ TRAP_IGNORE( mVideoMpxWrapper->HandleCommandL( EMPXPbvCmdNextListItem ) );
+ }
+ else
+ {
+ closePlaybackView();
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::handlePluginError()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::handlePluginError( int aError )
+{
+ MPX_DEBUG(
+ _L("VideoBasePlaybackView::handlePluginError() aError = %d"), aError );
+
+ switch ( aError )
+ {
+ case KErrCancel:
+ {
+ handleClosePlaybackView();
+ break;
+ }
+ case KErrMMDRMNotAuthorized:
+ case KErrCANoRights:
+ case KErrCANoPermission:
+ {
+ showDialog( hbTrId( "txt_videos_info_license_has_expired_or_it_is_missi" ) );
+ break;
+ }
+ case KMPXVideoCallOngoingError:
+ {
+ showDialog( hbTrId( "txt_videos_info_video_playback_is_not_allowed_duri" ), false );
+ break;
+ }
+ default:
+ {
+ TRAP_IGNORE(
+
+ //
+ // TextResolver instance for error resolving.
+ //
+ CTextResolver* textresolver = CTextResolver::NewLC();
+
+ //
+ // Resolve the error text
+ //
+ TPtrC text;
+ text.Set( textresolver->ResolveErrorString( aError ) );
+
+ //
+ // convert to QString
+ //
+ const QString qString( (QChar*)text.Ptr(), text.Length() );
+
+ //
+ // clean up textresolver
+ //
+ CleanupStack::PopAndDestroy( textresolver );
+
+ //
+ // display error and close playback view
+ //
+ showDialog( qString );
+ );
+ }
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::showDialog
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::showDialog( const QString& qString, bool closeView )
+{
+ MPX_DEBUG(_L("VideoBasePlaybackView::showDialog( %s, %d )"), qString.data(), closeView );
+
+ //
+ // create pop-up dialog for error notes,
+ // set its position to the middle of the screen
+ // and make sure pop-up dialog gets deleted on close.
+ //
+ QRectF screenRect = hbInstance->allMainWindows()[0]->rect();
+ HbNotificationDialog* dlg = new HbNotificationDialog();
+ dlg->setAttribute( Qt::WA_DeleteOnClose );
+ dlg->setMinimumSize( QSizeF(200, 100) );
+ dlg->setPreferredPos( QPointF( screenRect.height()/2, screenRect.width()/2 ),
+ HbPopup::Center );
+
+ if ( closeView )
+ {
+ //
+ // connect aboutToClose() signal to handleClosePopupDialog() slot so that
+ // when pop-up dialog is closed, playback view is closed also
+ //
+ connect( dlg, SIGNAL( aboutToClose() ), this, SLOT( handleClosePopupDialog() ) );
+ }
+
+ //
+ // convert string to label so text alignment can be set
+ //
+ HbLabel *label = new HbLabel( qString );
+ label->setAlignment( Qt::AlignCenter );
+
+ //
+ // set label as content widget and show pop-up dialog
+ //
+ dlg->setContentWidget( label );
+ dlg->show();
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::doClosePlayer
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::doClosePlayer()
+{
+ MPX_DEBUG(_L("VideoBasePlaybackView::doClosePlayer()"));
+
+ handleDeactivateView();
+
+ qApp->quit();
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::issuePlayCommand
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::issuePlayCommand()
+{
+ MPX_ENTER_EXIT(_L("VideoBasePlaybackView::issuePlayCommand()"));
+
+ int err = KErrNone;
+
+ TRAP( err, mVideoMpxWrapper->CreateGeneralPlaybackCommandL( EPbCmdPlay ));
+
+ MPX_DEBUG(_L("VideoBasePlaybackView::issuePlayCommand() error = %d"), err);
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::retrievePdlInformation
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::retrievePdlInformation()
+{
+ MPX_DEBUG(_L("VideoBasePlaybackView::retrievePdlInformation()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::handleBufferingState
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::handleBufferingState()
+{
+ MPX_DEBUG(_L("VideoBasePlaybackView::handleBufferingState()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::closePlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::closePlaybackView()
+{
+ MPX_ENTER_EXIT(_L("VideoBasePlaybackView::closePlaybackView()"));
+
+ mTimerForClosingView->start( 0 );
+}
+
+// ---------------------------------------------------------------------------
+// VideoBasePlaybackView::eventFilter
+// ---------------------------------------------------------------------------
+//
+bool VideoBasePlaybackView::eventFilter( QObject *object, QEvent *event )
+{
+ Q_UNUSED( object );
+
+ switch ( event->type() )
+ {
+ case QEvent::ApplicationActivate:
+ {
+ if ( mActivated )
+ {
+ MPX_DEBUG(_L("VideoBasePlaybackView::eventFilter foreground()") );
+ TRAP_IGNORE( mVideoMpxWrapper->IssueVideoAppForegroundCmdL( true ) );
+ }
+ break;
+ }
+ case QEvent::ApplicationDeactivate:
+ {
+ if ( mActivated )
+ {
+ MPX_DEBUG(_L("VideoBasePlaybackView::eventFilter background()") );
+ TRAP_IGNORE( mVideoMpxWrapper->IssueVideoAppForegroundCmdL( false ) );
+ }
+ break;
+ }
+ }
+
+ return QObject::eventFilter( object, event );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::getWindow()
+// -------------------------------------------------------------------------------------------------
+//
+RWindow *VideoBasePlaybackView::getWindow()
+{
+ return static_cast<RWindow*>( hbInstance->allMainWindows()[0]->effectiveWinId()->DrawableWindow() );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::handleClosePopupDialog()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::handleClosePopupDialog()
+{
+ MPX_DEBUG(_L("VideoBasePlaybackView::handleClosePopupDialog()") );
+
+ handleClosePlaybackView();
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::gestureEvent()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::gestureEvent( QGestureEvent* event )
+{
+ if ( HbTapGesture * gesture = static_cast<HbTapGesture *>( event->gesture( Qt::TapGesture ) ) )
+ {
+ if ( gesture->state() == Qt::GestureFinished && mActivated )
+ {
+ MPX_DEBUG(_L("VideoBasePlaybackView::gestureEvent() tapGesture finished") );
+
+ emit tappedOnScreen();
+ }
+ }
+ else if ( HbPanGesture* gesture = static_cast<HbPanGesture*>( event->gesture( Qt::PanGesture ) ) )
+ {
+ if ( gesture->state() == Qt::GestureFinished && mActivated )
+ {
+ QPointF delta( gesture->sceneDelta() );
+
+ if ( delta.x() > 0 )
+ {
+ MPX_DEBUG(_L("VideoBasePlaybackView::gestureEvent() right") );
+
+ emit pannedToRight();
+ }
+ else
+ {
+ MPX_DEBUG(_L("VideoBasePlaybackView::gestureEvent() left") );
+
+ emit pannedToLeft();
+ }
+ }
+ }
+}
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/viewsrc/videoplaybackview.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,196 @@
+/*
+* 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 Video playback view
+*
+*/
+
+// Version : %version: da1mmcf#15 %
+
+
+
+// Include Files
+#include <hbinstance.h>
+
+#include <mmf/common/mmferrors.h>
+#include <mpxvideoplaybackdefs.h>
+
+#include "mpxvideo_debug.h"
+#include "videoplaybackview.h"
+#include "mpxvideoviewwrapper.h"
+#include "mpxvideoplaybackuids.hrh"
+#include "videoplaybackviewfiledetails.h"
+#include "mpxcommonvideoplaybackview.hrh"
+
+
+// Member Functions
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackView::VideoPlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackView::VideoPlaybackView()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackView::VideoPlaybackView()"));
+
+ initializeVideoPlaybackView();
+ mSyncClose = false;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackView::~VideoPlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackView::~VideoPlaybackView()
+{
+ MPX_DEBUG(_L("VideoPlaybackView::~VideoPlaybackView()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackView::handleActivateView()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackView::handleActivateView()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackView::handleActivateView()"));
+
+ VideoBasePlaybackView::handleActivateView();
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackView::handleDeactivateView()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackView::handleDeactivateView()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackView::handleDeactivateView()"));
+
+ VideoBasePlaybackView::handleDeactivateView();
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackView::handleBack()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackView::handleBack()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackView::handleBack()"));
+
+ closePlaybackView();
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackView::handleSoftkeyBack()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackView::handleSoftkeyBack()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackView::handleSoftkeyBack()"));
+
+ closePlaybackView();
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackView::handlePluginError()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackView::handlePluginError( int aError )
+{
+ MPX_DEBUG(_L("VideoPlaybackView::handlePluginError() aError = %d"), aError );
+
+ switch( aError )
+ {
+ case KErrNotSupported:
+ case KErrUnknown:
+ case KErrMMDecoder:
+ case KErrCorrupt:
+ case KErrTooBig:
+ {
+ showDialog( hbTrId( "txt_videos_info_invalid_clip_operation_canceled" ) );
+ break;
+ }
+
+ case KErrMMInvalidProtocol:
+ case KErrMMInvalidURL:
+ case KErrArgument:
+ {
+ showDialog( hbTrId( "txt_videos_info_unable_to_connect_invalid_url" ) );
+ break;
+ }
+
+ case KErrSessionClosed:
+ {
+ showDialog( hbTrId( "txt_videos_info_resource_lost" ) );
+ break;
+ }
+ case KErrTimedOut:
+ {
+ showDialog( hbTrId( "txt_videos_info_unable_to_connect_connection_time" ) );
+ break;
+ }
+ case KErrNotFound:
+ {
+ showDialog( hbTrId( "txt_videos_info_file_not_found" ) );
+ break;
+ }
+ case KErrMMNotEnoughBandwidth:
+ {
+ showDialog( hbTrId( "txt_videos_info_unable_to_connect_not_enough_band" ) );
+ break;
+ }
+ case KErrDisconnected:
+ case KErrMMProxyServer:
+ case KErrCouldNotConnect:
+ case KErrAbort:
+ {
+ showDialog( hbTrId( "txt_videos_info_unable_to_connect" ) );
+ break;
+ }
+ case KMPXVideoPlayOver2GDuringVoiceCallError:
+ {
+ showDialog( hbTrId( "txt_videos_info_video_play_not_allowed_during_voic" ), false );
+ break;
+ }
+ default:
+ {
+ VideoBasePlaybackView::handlePluginError( aError );
+
+ break;
+ }
+ }
+}
+
+// -----------------------------------------------------------------------------
+// VideoPlaybackView::handlePdlStateChange
+// -----------------------------------------------------------------------------
+//
+void VideoPlaybackView::handlePdlStateChange( int /*aState*/ )
+{
+ MPX_DEBUG(_L("VideoPlaybackView::handlePdlStateChange()"));
+}
+
+// -----------------------------------------------------------------------------
+// VideoPlaybackView::handleStoppedState
+// -----------------------------------------------------------------------------
+//
+void VideoPlaybackView::handleStoppedState()
+{
+ MPX_DEBUG(_L("VideoPlaybackView::HandleStoppedState()"));
+
+ if ( ! mVideoMpxWrapper->IsPlaylist() )
+ {
+ handleBack();
+ }
+}
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/viewsrc/videoplaybackviewfiledetails.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,77 @@
+/*
+* 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: class for Video File Details (Qt)
+*
+*/
+
+// Version : %version: da1mmcf#11 %
+
+
+
+//
+// INCLUDE FILES
+//
+#include "mpxvideo_debug.h"
+#include "videoplaybackviewfiledetails.h"
+
+
+// ============================ MEMBER FUNCTIONS ===================================================
+
+VideoPlaybackViewFileDetails::VideoPlaybackViewFileDetails()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewFileDetails::VideoPlaybackViewFileDetails()"));
+
+ clearFileDetails();
+}
+
+VideoPlaybackViewFileDetails::~VideoPlaybackViewFileDetails()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewFileDetails::~VideoPlaybackViewFileDetails()"));
+
+ clearFileDetails();
+}
+
+void
+VideoPlaybackViewFileDetails::clearFileDetails()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewFileDetails::ClearFileDetails()"));
+
+ mMimeType = tr("");
+ mTitle = tr("");
+ mArtist = tr("");
+ mClipName = tr("");
+ mDescription = tr("");
+ mLocation = tr("");
+ mCopyright = tr("");
+ mLanguage = tr("");
+ mKeywords = tr("");
+
+ mPlaybackMode = EMPXVideoLocal;
+ mSeekable = false;
+ mPausableStream = false;
+ mAudioEnabled = false;
+ mVideoEnabled = false;
+ mPartialPlayback = false;
+ mRNFormat = false;
+
+ mDuration = 0;
+ mTvOutConnected = false;
+ mDrmProtected = false;
+
+ mVideoHeight = 0;
+ mVideoWidth = 0;
+ mBitRate = 0;
+}
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviewplugin/inc/videoplaybackviewplugin.h Thu Jul 08 13:05:19 2010 +0300
@@ -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: VideoPlaybackViewPlugin
+*
+*/
+
+// Version : %version: 7 %
+
+
+#ifndef VIDEOPLAYBACKVIEWPLUGIN_H
+#define VIDEOPLAYBACKVIEWPLUGIN_H
+
+#include <QObject>
+#include <mpxviewpluginqt.h>
+
+
+// FORWARD DECLARATION
+class VideoPlaybackView;
+
+/**
+ * MPX playback view plugin definition.
+ *
+ */
+class VideoPlaybackViewPlugin : public MpxViewPlugin
+{
+ Q_OBJECT
+
+ public:
+
+ /**
+ * C++ default constructor.
+ */
+ VideoPlaybackViewPlugin();
+
+ /**
+ * Destructor.
+ *
+ */
+ virtual ~VideoPlaybackViewPlugin();
+
+ // from QViewPlugin
+ void createView();
+
+ void destroyView();
+
+ void activateView();
+
+ void deactivateView();
+
+ QGraphicsWidget* getView();
+
+ signals:
+ void command( int aCommand );
+
+ public slots:
+ void orientationChange(Qt::Orientation orientation);
+ void back();
+
+ public:
+ VideoPlaybackView* mView;
+ bool mViewActivated;
+};
+
+#endif //VIDEOPLAYBACKVIEWPLUGIN_H
+
+// End of file
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviewplugin/rom/videoplaybackviewplugin.iby Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,26 @@
+/*
+* 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: videoplaybackviewplugin.iby
+*
+*/
+
+
+#ifndef VIDEOPLAYBACKVIEWPLUGIN_IBY
+#define VIDEOPLAYBACKVIEWPLUGIN_IBY
+
+#include <data_caging_paths_for_iby.hrh>
+
+ECOM_PLUGIN( videoplaybackviewplugin.dll, videoplaybackviewplugin.rsc )
+
+#endif // VIDEOPLAYBACKVIEWPLUGIN_IBY
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviewplugin/src/videoplaybackviewplugin.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,147 @@
+/*
+* 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: VideoPlaybackViewPlugin
+*
+*/
+
+// Version : %version: 8 %
+
+
+
+#include <QtGui>
+#include <hbview.h>
+#include <xqplugin.h>
+#include <hbinstance.h>
+
+#include "mpxvideo_debug.h"
+#include "videoplaybackview.h"
+#include "mpxhbvideocommondefs.h"
+#include "videoplaybackviewplugin.h"
+
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+VideoPlaybackViewPlugin::VideoPlaybackViewPlugin()
+ : mView( NULL )
+ , mViewActivated ( false )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewPlugin::VideoPlaybackViewPlugin()"));
+}
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+VideoPlaybackViewPlugin::~VideoPlaybackViewPlugin()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewPlugin::~VideoPlaybackViewPlugin()"));
+ destroyView();
+}
+
+// ---------------------------------------------------------------------------
+// Create view
+// ---------------------------------------------------------------------------
+//
+void VideoPlaybackViewPlugin::createView()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewPlugin::createView()"));
+
+ if ( ! mView )
+ {
+ mView = new VideoPlaybackView();
+ connect( mView, SIGNAL( activatePreviousView() ), this, SLOT( back() ) );
+ }
+}
+
+// ---------------------------------------------------------------------------
+// Destroy view
+// ---------------------------------------------------------------------------
+//
+void VideoPlaybackViewPlugin::destroyView()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewPlugin::destroyView()"));
+
+ if ( mView )
+ {
+ disconnect( mView, SIGNAL( activatePreviousView() ), this, SLOT( back() ) );
+
+ delete mView;
+ mView = NULL;
+ }
+}
+
+// ---------------------------------------------------------------------------
+// Activate view
+// ---------------------------------------------------------------------------
+//
+void VideoPlaybackViewPlugin::activateView()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewPlugin::activateView()"));
+
+ if ( mView && !mViewActivated )
+ {
+ mView->handleActivateView();
+ mViewActivated = true;
+ }
+}
+
+// ---------------------------------------------------------------------------
+// Deactivate view
+// ---------------------------------------------------------------------------
+//
+void VideoPlaybackViewPlugin::deactivateView()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewPlugin::deactivateView()"));
+
+ if ( mView && mViewActivated )
+ {
+ mView->handleDeactivateView();
+ mViewActivated = false;
+ }
+}
+
+// ---------------------------------------------------------------------------
+// Get view
+// ---------------------------------------------------------------------------
+//
+QGraphicsWidget* VideoPlaybackViewPlugin::getView()
+{
+ return mView;
+}
+
+// ---------------------------------------------------------------------------
+// VideoPlaybackViewPlugin::orientationChange
+// ---------------------------------------------------------------------------
+//
+void VideoPlaybackViewPlugin::orientationChange( Qt::Orientation orientation )
+{
+ Q_UNUSED( orientation );
+}
+
+// ---------------------------------------------------------------------------
+// VideoPlaybackViewPlugin::back
+// ---------------------------------------------------------------------------
+//
+void VideoPlaybackViewPlugin::back()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackViewPlugin::back()"));
+
+ emit command( MpxHbVideoCommon::CollectionView );
+}
+
+XQ_EXPORT_PLUGIN2( videoplaybackviewplugin, VideoPlaybackViewPlugin );
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviewplugin/tsrc/testvideoplaybackviewplugin/inc/testvideoplaybackviewplugin.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,68 @@
+/**
+* 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: tester for methods in Video Playback View Plugin
+*
+*/
+
+#ifndef __TESTVIDEOPLAYBACKVIEWPLUGIN_H__
+#define __TESTVIDEOPLAYBACKVIEWPLUGIN_H__
+
+
+// INCLUDES
+#include <QtTest/QtTest>
+
+class VideoPlaybackViewPlugin;
+class MpxViewPlugin;
+
+
+class TestVideoPlaybackViewPlugin : public QObject
+{
+ Q_OBJECT
+
+ public:
+
+ /**
+ * will be called before each testfunction is executed.
+ *
+ */
+ void init();
+
+ /**
+ * will be called after every testfunction.
+ *
+ */
+ void cleanup();
+
+ // test functions for the test framework
+ private slots:
+
+ // the order in which these testXX methods are declared is important
+ // changing this order will affect the test results
+ void testCreateView();
+ void testActivateView();
+ void testGetView();
+ void testDeactivateView();
+ void testDestroyView();
+
+ signals:
+ void commandSignal(int);
+
+ private:
+ MpxViewPlugin* mVidPBPlugin;
+};
+
+
+#endif // __TESTVIDEOPLAYBACKVIEWPLUGIN_H__
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviewplugin/tsrc/testvideoplaybackviewplugin/src/testvideoplaybackviewplugin.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,147 @@
+/**
+* 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: tester for methods in VideoSortFilterProxyModel
+*
+*/
+
+#include <hbapplication.h>
+#include <hbinstance.h>
+#include <xqpluginloader.h>
+#include <mpxviewpluginqt.h>
+#include <xqplugininfo.h>
+
+
+#include "testvideoplaybackviewplugin.h"
+#include "videoplaybackview.h"
+
+#include "videoplaybackviewplugin.h"
+#include "mpxhbvideocommondefs.h"
+
+// ---------------------------------------------------------------------------
+// main
+// ---------------------------------------------------------------------------
+//
+int main(int argc, char *argv[])
+{
+ HbApplication app(argc, argv);
+ HbMainWindow window;
+
+ TestVideoPlaybackViewPlugin tv;
+
+ char *pass[3];
+ pass[0] = argv[0];
+ pass[1] = "-o";
+ pass[2] = "c:\\data\\testvideoplaybackviewplugin.txt";
+
+ int res = QTest::qExec(&tv, 3, pass);
+
+ return res;
+}
+
+
+// ---------------------------------------------------------------------------
+// init
+// ---------------------------------------------------------------------------
+//
+void TestVideoPlaybackViewPlugin::init()
+{
+ QList<XQPluginInfo> impls;
+ XQPluginLoader::listImplementations("org.nokia.mmdt.MpxViewPlugin/1.0", impls);
+
+ XQPluginLoader pluginLoader( MpxHbVideoCommon::KMpxVideoPluginDllPlaybackUid );
+ QObject* instance = pluginLoader.instance();
+
+ mVidPBPlugin = qobject_cast<MpxViewPlugin*>( instance )->viewPlugin(); ;
+}
+
+// ---------------------------------------------------------------------------
+// cleanup
+// ---------------------------------------------------------------------------
+//
+void TestVideoPlaybackViewPlugin::cleanup()
+{
+ delete mVidPBPlugin;
+ mVidPBPlugin = 0;
+}
+
+// ---------------------------------------------------------------------------
+// Slot: test create view
+// ---------------------------------------------------------------------------
+//
+void TestVideoPlaybackViewPlugin::testCreateView()
+{
+ qDebug("===> testCreateView()");
+
+ init();
+
+ QVERIFY(mVidPBPlugin != NULL );
+
+ QVERIFY(reinterpret_cast<VideoPlaybackViewPlugin*>( mVidPBPlugin )->mView == NULL );
+
+ mVidPBPlugin->createView();
+
+ QVERIFY(reinterpret_cast<VideoPlaybackViewPlugin*>( mVidPBPlugin )->mView != NULL );
+}
+
+// ---------------------------------------------------------------------------
+// Slot: test activate view
+// ---------------------------------------------------------------------------
+//
+void TestVideoPlaybackViewPlugin::testActivateView()
+{
+ QVERIFY(reinterpret_cast<VideoPlaybackViewPlugin*>( mVidPBPlugin )->mView != NU
+ mVidPBPlugin->activateView();
+
+ QVERIFY(reinterpret_cast<VideoPlaybackViewPlugin*>( mVidPBPlugin )->mViewActivated == true );
+}
+
+// ---------------------------------------------------------------------------
+// Slot: test deactivate view
+// ---------------------------------------------------------------------------
+//
+void TestVideoPlaybackViewPlugin::testDeactivateView()
+{
+ QVERIFY(reinterpret_cast<VideoPlaybackViewPlugin*>( mVidPBPlugin )->mView != NULL );
+ QVERIFY(reinterpret_cast<VideoPlaybackViewPlugin*>( mVidPBPlugin )->mViewActivated == true );
+
+ mVidPBPlugin->deactivateView();
+
+ QVERIFY(reinterpret_cast<VideoPlaybackViewPlugin*>( mVidPBPlugin )->mViewActivated == false );
+}
+
+// ---------------------------------------------------------------------------
+// Slot: test destroy view
+// ---------------------------------------------------------------------------
+//
+void TestVideoPlaybackViewPlugin::testDestroyView()
+{
+ QVERIFY(reinterpret_cast<VideoPlaybackViewPlugin*>( mVidPBPlugin )->mView != NULL );
+
+ mVidPBPlugin->destroyView();
+
+ QVERIFY(reinterpret_cast<VideoPlaybackViewPlugin*>( mVidPBPlugin )->mView == NULL );
+}
+
+// ---------------------------------------------------------------------------
+// Slot: test get view
+// ---------------------------------------------------------------------------
+//
+void TestVideoPlaybackViewPlugin::testGetView()
+{
+ QVERIFY( mVidPBPlugin->getView() != NULL );
+ QVERIFY(reinterpret_cast<VideoPlaybackViewPlugin*>( mVidPBPlugin )->mView ==
+ reinterpret_cast<VideoPlaybackViewPlugin*>( mVidPBPlugin )->getView() );
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviewplugin/tsrc/testvideoplaybackviewplugin/stub/inc/videoplaybackview.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,59 @@
+/*
+* 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: Video playback view
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+// This file defines the API for .dll
+
+#ifndef __VIDEOPLAYBACKVIEW_H__
+#define __VIDEOPLAYBACKVIEW_H__
+
+// Include Files
+#include <hbview.h>
+
+
+// Class Definitions
+
+class VideoPlaybackView : public HbView
+{
+ Q_OBJECT
+
+ public:
+ VideoPlaybackView();
+ virtual ~VideoPlaybackView();
+
+ void handleActivateView();
+
+ void handleDeactivateView();
+
+ void handleBack();
+
+ void handleSoftkeyBack();
+
+ void handlePluginError( int aError );
+
+ void handlePdlStateChange( int aState );
+
+ void handleStoppedState();
+
+};
+
+#endif // __VIDEOPLAYBACKVIEW_H__
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviewplugin/tsrc/testvideoplaybackviewplugin/stub/src/videoplaybackview.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,102 @@
+/*
+* 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 Video playback view
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+// Include Files
+#include <hbinstance.h>
+#include "videoplaybackview.h"
+
+
+// Member Functions
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackView::VideoPlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackView::VideoPlaybackView()
+{
+
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackView::~VideoPlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackView::~VideoPlaybackView()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackView::handleActivateView()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackView::handleActivateView()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackView::handleDeactivateView()
+// -------------------------------------------------------------------------------------------------
+//
+EXPORT_C void VideoPlaybackView::handleDeactivateView()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackView::handleBack()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackView::handleBack()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackView::handleSoftkeyBack()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackView::handleSoftkeyBack()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackView::handlePluginError()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackView::handlePluginError( int aError )
+{
+}
+
+// -----------------------------------------------------------------------------
+// VideoPlaybackView::handlePdlStateChange
+// -----------------------------------------------------------------------------
+//
+void VideoPlaybackView::handlePdlStateChange( int /*aState*/ )
+{
+}
+
+// -----------------------------------------------------------------------------
+// VideoPlaybackView::handleStoppedState
+// -----------------------------------------------------------------------------
+//
+void VideoPlaybackView::handleStoppedState()
+{
+}
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviewplugin/tsrc/testvideoplaybackviewplugin/testvideoplaybackviewplugin.pro Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,42 @@
+#
+# 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: 5 %
+
+
+TEMPLATE = app
+TARGET =
+CONFIG += qtestlib hb
+
+DEPENDPATH += . \
+ inc \
+ src
+
+INCLUDEPATH +=
+
+LIBS += -lestor.dll \
+ -lmpxviewframeworkqt.dll \
+ -lxqplugins.dll
+
+# Input
+HEADERS += inc/testvideoplaybackviewplugin.h \
+ stub/inc/videoplaybackview.h \
+ ../../inc/videoplaybackviewplugin.h \
+ ../../../../inc/mpxhbvideocommondefs.h
+
+SOURCES += stub/src/videoplaybackview.cpp \
+ src/testvideoplaybackviewplugin.cpp \
+ ../../src/videoplaybackviewplugin.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackviewplugin/videoplaybackviewplugin.pro Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,50 @@
+#
+# 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#18 %
+
+
+TEMPLATE = lib
+CONFIG += hb qt ecomplugin
+TARGET = videoplaybackviewplugin
+
+symbian:
+{
+ TARGET.CAPABILITY = ALL -TCB -DRM
+ TARGET.EPOCALLOWDLLDATA = 1
+ TARGET.UID3 = 0x20024335
+ INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE \
+ $$APP_LAYER_SYSTEMINCLUDE SYSTEMINCLUDE
+ BLD_INF_RULES.prj_exports += "rom/videoplaybackviewplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(videoplaybackviewplugin.iby)"
+ MMP_RULES += SMPSAFE
+}
+
+SERVICE.INTERFACE_NAME = org.nokia.mmdt.QViewPlugin/1.0
+SERVICE.CONFIGURATION = "<t>0x20024338</t><p></p><i>EMPXViewPluginPriorityNormal</i><f>0x00000002</f>"
+
+INCLUDEPATH += ../../inc ../inc
+
+LIBS += -lmpxviewframeworkqt.dll \
+ -lvideoplaybackview.dll \
+ -lflogger.dll
+
+DEPENDPATH += inc
+VPATH += src
+
+HEADERS += videoplaybackviewplugin.h
+
+SOURCES += videoplaybackviewplugin.cpp
+
--- a/videoplayerapp/bwins/videoplayerengineu.def Fri Jul 02 17:14:33 2010 +0300
+++ b/videoplayerapp/bwins/videoplayerengineu.def Thu Jul 08 13:05:19 2010 +0300
@@ -1,63 +1,63 @@
EXPORTS
- ?qt_metacall@QVideoPlayerEngine@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1 NONAME ; int QVideoPlayerEngine::qt_metacall(enum QMetaObject::Call, int, void * *)
- ?metaObject@QVideoPlayerEngine@@UBEPBUQMetaObject@@XZ @ 2 NONAME ; struct QMetaObject const * QVideoPlayerEngine::metaObject(void) const
+ ?qt_metacall@VideoPlayerEngine@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1 NONAME ; int VideoPlayerEngine::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ?metaObject@VideoPlayerEngine@@UBEPBUQMetaObject@@XZ @ 2 NONAME ; struct QMetaObject const * VideoPlayerEngine::metaObject(void) const
?instance@VideoActivityState@@SAAAV1@XZ @ 3 NONAME ; class VideoActivityState & VideoActivityState::instance(void)
- ?tr@QVideoPlayerEngine@@SA?AVQString@@PBD0H@Z @ 4 NONAME ; class QString QVideoPlayerEngine::tr(char const *, char const *, int)
+ ?tr@VideoPlayerEngine@@SA?AVQString@@PBD0H@Z @ 4 NONAME ; class QString VideoPlayerEngine::tr(char const *, char const *, int)
?qt_metacast@VideoServices@@UAEPAXPBD@Z @ 5 NONAME ; void * VideoServices::qt_metacast(char const *)
?getBrowseCategory@VideoServices@@QBEHXZ @ 6 NONAME ; int VideoServices::getBrowseCategory(void) const
- ?setCurrentView@QVideoPlayerEngine@@AAEXXZ @ 7 NONAME ; void QVideoPlayerEngine::setCurrentView(void)
+ ?setCurrentView@VideoPlayerEngine@@AAEXXZ @ 7 NONAME ; void VideoPlayerEngine::setCurrentView(void)
?trUtf8@VideoServices@@SA?AVQString@@PBD0@Z @ 8 NONAME ; class QString VideoServices::trUtf8(char const *, char const *)
- ?isPlayServiceInvoked@QVideoPlayerEngine@@AAE_NXZ @ 9 NONAME ; bool QVideoPlayerEngine::isPlayServiceInvoked(void)
+ ?isPlayServiceInvoked@VideoPlayerEngine@@AAE_NXZ @ 9 NONAME ; bool VideoPlayerEngine::isPlayServiceInvoked(void)
?itemSelected@VideoServices@@QAEXABVQString@@@Z @ 10 NONAME ; void VideoServices::itemSelected(class QString const &)
- ?doDelayedLoad@QVideoPlayerEngine@@AAEXXZ @ 11 NONAME ; void QVideoPlayerEngine::doDelayedLoad(void)
- ?handleCommand@QVideoPlayerEngine@@QAEXH@Z @ 12 NONAME ; void QVideoPlayerEngine::handleCommand(int)
+ ?doDelayedLoad@VideoPlayerEngine@@AAEXXZ @ 11 NONAME ; void VideoPlayerEngine::doDelayedLoad(void)
+ ?handleCommand@VideoPlayerEngine@@QAEXH@Z @ 12 NONAME ; void VideoPlayerEngine::handleCommand(int)
??1VideoServices@@EAE@XZ @ 13 NONAME ; VideoServices::~VideoServices(void)
?titleReady@VideoServices@@IAEXABVQString@@@Z @ 14 NONAME ; void VideoServices::titleReady(class QString const &)
- ?staticMetaObject@QVideoPlayerEngine@@2UQMetaObject@@B @ 15 NONAME ; struct QMetaObject const QVideoPlayerEngine::staticMetaObject
+ ?staticMetaObject@VideoPlayerEngine@@2UQMetaObject@@B @ 15 NONAME ; struct QMetaObject const VideoPlayerEngine::staticMetaObject
?setActivityData@VideoActivityState@@QAEXABVQVariant@@ABVQString@@@Z @ 16 NONAME ; void VideoActivityState::setActivityData(class QVariant const &, class QString const &)
??0VideoActivityState@@AAE@XZ @ 17 NONAME ; VideoActivityState::VideoActivityState(void)
?activated@VideoServices@@IAEXH@Z @ 18 NONAME ; void VideoServices::activated(int)
?metaObject@VideoServices@@UBEPBUQMetaObject@@XZ @ 19 NONAME ; struct QMetaObject const * VideoServices::metaObject(void) const
- ?disconnectView@QVideoPlayerEngine@@AAEXXZ @ 20 NONAME ; void QVideoPlayerEngine::disconnectView(void)
+ ?disconnectView@VideoPlayerEngine@@AAEXXZ @ 20 NONAME ; void VideoPlayerEngine::disconnectView(void)
??_EVideoActivityState@@UAE@I@Z @ 21 NONAME ; VideoActivityState::~VideoActivityState(unsigned int)
??_EVideoServices@@UAE@I@Z @ 22 NONAME ; VideoServices::~VideoServices(unsigned int)
- ?setEngine@VideoServices@@AAEXPAVQVideoPlayerEngine@@@Z @ 23 NONAME ; void VideoServices::setEngine(class QVideoPlayerEngine *)
+ ?setEngine@VideoServices@@AAEXPAVVideoPlayerEngine@@@Z @ 23 NONAME ; void VideoServices::setEngine(class VideoPlayerEngine *)
?browsingEnded@VideoServices@@QAEXXZ @ 24 NONAME ; void VideoServices::browsingEnded(void)
- ?playMedia@QVideoPlayerEngine@@QAEXVRFile@@@Z @ 25 NONAME ; void QVideoPlayerEngine::playMedia(class RFile)
+ ?playMedia@VideoPlayerEngine@@QAEXVRFile@@@Z @ 25 NONAME ; void VideoPlayerEngine::playMedia(class RFile)
?getStaticMetaObject@VideoServices@@SAABUQMetaObject@@XZ @ 26 NONAME ; struct QMetaObject const & VideoServices::getStaticMetaObject(void)
?decreaseReferenceCount@VideoServices@@QAEXXZ @ 27 NONAME ; void VideoServices::decreaseReferenceCount(void)
- ?setEmbedded@QVideoPlayerEngine@@QAEXXZ @ 28 NONAME ; void QVideoPlayerEngine::setEmbedded(void)
+ ?setEmbedded@VideoPlayerEngine@@QAEXXZ @ 28 NONAME ; void VideoPlayerEngine::setEmbedded(void)
?setCurrentService@VideoServices@@AAEXW4TVideoService@1@@Z @ 29 NONAME ; void VideoServices::setCurrentService(enum VideoServices::TVideoService)
- ?trUtf8@QVideoPlayerEngine@@SA?AVQString@@PBD0H@Z @ 30 NONAME ; class QString QVideoPlayerEngine::trUtf8(char const *, char const *, int)
- ??0VideoServices@@AAE@PAVQVideoPlayerEngine@@@Z @ 31 NONAME ; VideoServices::VideoServices(class QVideoPlayerEngine *)
- ?tr@QVideoPlayerEngine@@SA?AVQString@@PBD0@Z @ 32 NONAME ; class QString QVideoPlayerEngine::tr(char const *, char const *)
- ?getStaticMetaObject@QVideoPlayerEngine@@SAABUQMetaObject@@XZ @ 33 NONAME ; struct QMetaObject const & QVideoPlayerEngine::getStaticMetaObject(void)
+ ?trUtf8@VideoPlayerEngine@@SA?AVQString@@PBD0H@Z @ 30 NONAME ; class QString VideoPlayerEngine::trUtf8(char const *, char const *, int)
+ ??0VideoServices@@AAE@PAVVideoPlayerEngine@@@Z @ 31 NONAME ; VideoServices::VideoServices(class VideoPlayerEngine *)
+ ?tr@VideoPlayerEngine@@SA?AVQString@@PBD0@Z @ 32 NONAME ; class QString VideoPlayerEngine::tr(char const *, char const *)
+ ?getStaticMetaObject@VideoPlayerEngine@@SAABUQMetaObject@@XZ @ 33 NONAME ; struct QMetaObject const & VideoPlayerEngine::getStaticMetaObject(void)
?trUtf8@VideoServices@@SA?AVQString@@PBD0H@Z @ 34 NONAME ; class QString VideoServices::trUtf8(char const *, char const *, int)
??1VideoActivityState@@EAE@XZ @ 35 NONAME ; VideoActivityState::~VideoActivityState(void)
- ?createMissingViews@QVideoPlayerEngine@@AAEXXZ @ 36 NONAME ; void QVideoPlayerEngine::createMissingViews(void)
- ?handleQuit@QVideoPlayerEngine@@AAEXXZ @ 37 NONAME ; void QVideoPlayerEngine::handleQuit(void)
- ?createPlaybackView@QVideoPlayerEngine@@AAEXXZ @ 38 NONAME ; void QVideoPlayerEngine::createPlaybackView(void)
+ ?createMissingViews@VideoPlayerEngine@@AAEXXZ @ 36 NONAME ; void VideoPlayerEngine::createMissingViews(void)
+ ?handleQuit@VideoPlayerEngine@@AAEXXZ @ 37 NONAME ; void VideoPlayerEngine::handleQuit(void)
+ ?createPlaybackView@VideoPlayerEngine@@AAEXXZ @ 38 NONAME ; void VideoPlayerEngine::createPlaybackView(void)
?sortRole@VideoServices@@QBEHXZ @ 39 NONAME ; int VideoServices::sortRole(void) const
?staticMetaObject@VideoServices@@2UQMetaObject@@B @ 40 NONAME ; struct QMetaObject const VideoServices::staticMetaObject
- ??1QVideoPlayerEngine@@UAE@XZ @ 41 NONAME ; QVideoPlayerEngine::~QVideoPlayerEngine(void)
- ?loadPluginAndCreateView@QVideoPlayerEngine@@AAEXW4MpxHbVideoViewType@MpxHbVideoCommon@@@Z @ 42 NONAME ; void QVideoPlayerEngine::loadPluginAndCreateView(enum MpxHbVideoCommon::MpxHbVideoViewType)
+ ??1VideoPlayerEngine@@UAE@XZ @ 41 NONAME ; VideoPlayerEngine::~VideoPlayerEngine(void)
+ ?loadPluginAndCreateView@VideoPlayerEngine@@AAEXW4MpxHbVideoViewType@MpxHbVideoCommon@@@Z @ 42 NONAME ; void VideoPlayerEngine::loadPluginAndCreateView(enum MpxHbVideoCommon::MpxHbVideoViewType)
?tr@VideoServices@@SA?AVQString@@PBD0H@Z @ 43 NONAME ; class QString VideoServices::tr(char const *, char const *, int)
- ?qt_metacast@QVideoPlayerEngine@@UAEPAXPBD@Z @ 44 NONAME ; void * QVideoPlayerEngine::qt_metacast(char const *)
- ?playMedia@QVideoPlayerEngine@@QAEXVQString@@@Z @ 45 NONAME ; void QVideoPlayerEngine::playMedia(class QString)
- ?activateView@QVideoPlayerEngine@@AAEXW4MpxHbVideoViewType@MpxHbVideoCommon@@@Z @ 46 NONAME ; void QVideoPlayerEngine::activateView(enum MpxHbVideoCommon::MpxHbVideoViewType)
- ??0QVideoPlayerEngine@@QAE@_N@Z @ 47 NONAME ; QVideoPlayerEngine::QVideoPlayerEngine(bool)
+ ?qt_metacast@VideoPlayerEngine@@UAEPAXPBD@Z @ 44 NONAME ; void * VideoPlayerEngine::qt_metacast(char const *)
+ ?playMedia@VideoPlayerEngine@@QAEXVQString@@@Z @ 45 NONAME ; void VideoPlayerEngine::playMedia(class QString)
+ ?activateView@VideoPlayerEngine@@AAEXW4MpxHbVideoViewType@MpxHbVideoCommon@@@Z @ 46 NONAME ; void VideoPlayerEngine::activateView(enum MpxHbVideoCommon::MpxHbVideoViewType)
+ ??0VideoPlayerEngine@@QAE@_N@Z @ 47 NONAME ; VideoPlayerEngine::VideoPlayerEngine(bool)
?getActivityData@VideoActivityState@@QAE?BVQVariant@@ABVQString@@@Z @ 48 NONAME ; class QVariant const VideoActivityState::getActivityData(class QString const &)
?contextTitle@VideoServices@@QBE?AVQString@@XZ @ 49 NONAME ; class QString VideoServices::contextTitle(void) const
- ?shouldActivateCollectionView@QVideoPlayerEngine@@AAE_NXZ @ 50 NONAME ; bool QVideoPlayerEngine::shouldActivateCollectionView(void)
- ?initialize@QVideoPlayerEngine@@QAEXXZ @ 51 NONAME ; void QVideoPlayerEngine::initialize(void)
- ?trUtf8@QVideoPlayerEngine@@SA?AVQString@@PBD0@Z @ 52 NONAME ; class QString QVideoPlayerEngine::trUtf8(char const *, char const *)
+ ?shouldActivateCollectionView@VideoPlayerEngine@@AAE_NXZ @ 50 NONAME ; bool VideoPlayerEngine::shouldActivateCollectionView(void)
+ ?initialize@VideoPlayerEngine@@QAEXXZ @ 51 NONAME ; void VideoPlayerEngine::initialize(void)
+ ?trUtf8@VideoPlayerEngine@@SA?AVQString@@PBD0@Z @ 52 NONAME ; class QString VideoPlayerEngine::trUtf8(char const *, char const *)
?qt_metacall@VideoServices@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 53 NONAME ; int VideoServices::qt_metacall(enum QMetaObject::Call, int, void * *)
?currentService@VideoServices@@QAE?AW4TVideoService@1@XZ @ 54 NONAME ; enum VideoServices::TVideoService VideoServices::currentService(void)
?mInstance@VideoServices@@0PAV1@A @ 55 NONAME ; class VideoServices * VideoServices::mInstance
?tr@VideoServices@@SA?AVQString@@PBD0@Z @ 56 NONAME ; class QString VideoServices::tr(char const *, char const *)
- ?engine@VideoServices@@AAEPAVQVideoPlayerEngine@@XZ @ 57 NONAME ; class QVideoPlayerEngine * VideoServices::engine(void)
- ?connectView@QVideoPlayerEngine@@AAEXXZ @ 58 NONAME ; void QVideoPlayerEngine::connectView(void)
- ?shouldExit@QVideoPlayerEngine@@AAE_NXZ @ 59 NONAME ; bool QVideoPlayerEngine::shouldExit(void)
- ?instance@VideoServices@@SAPAV1@PAVQVideoPlayerEngine@@@Z @ 60 NONAME ; class VideoServices * VideoServices::instance(class QVideoPlayerEngine *)
- ??_EQVideoPlayerEngine@@UAE@I@Z @ 61 NONAME ; QVideoPlayerEngine::~QVideoPlayerEngine(unsigned int)
+ ?engine@VideoServices@@AAEPAVVideoPlayerEngine@@XZ @ 57 NONAME ; class VideoPlayerEngine * VideoServices::engine(void)
+ ?connectView@VideoPlayerEngine@@AAEXXZ @ 58 NONAME ; void VideoPlayerEngine::connectView(void)
+ ?shouldExit@VideoPlayerEngine@@AAE_NXZ @ 59 NONAME ; bool VideoPlayerEngine::shouldExit(void)
+ ?instance@VideoServices@@SAPAV1@PAVVideoPlayerEngine@@@Z @ 60 NONAME ; class VideoServices * VideoServices::instance(class VideoPlayerEngine *)
+ ??_EVideoPlayerEngine@@UAE@I@Z @ 61 NONAME ; VideoPlayerEngine::~VideoPlayerEngine(unsigned int)
--- a/videoplayerapp/eabi/videoplayerengineu.def Fri Jul 02 17:14:33 2010 +0300
+++ b/videoplayerapp/eabi/videoplayerengineu.def Thu Jul 08 13:05:19 2010 +0300
@@ -10,41 +10,41 @@
_ZN13VideoServices19getStaticMetaObjectEv @ 9 NONAME
_ZN13VideoServices22decreaseReferenceCountEv @ 10 NONAME
_ZN13VideoServices6engineEv @ 11 NONAME
- _ZN13VideoServices8instanceEP18QVideoPlayerEngine @ 12 NONAME
+ _ZN13VideoServices8instanceEP17VideoPlayerEngine @ 12 NONAME
_ZN13VideoServices9activatedEi @ 13 NONAME
_ZN13VideoServices9mInstanceE @ 14 NONAME DATA 4
- _ZN13VideoServices9setEngineEP18QVideoPlayerEngine @ 15 NONAME
- _ZN13VideoServicesC1EP18QVideoPlayerEngine @ 16 NONAME
- _ZN13VideoServicesC2EP18QVideoPlayerEngine @ 17 NONAME
+ _ZN13VideoServices9setEngineEP17VideoPlayerEngine @ 15 NONAME
+ _ZN13VideoServicesC1EP17VideoPlayerEngine @ 16 NONAME
+ _ZN13VideoServicesC2EP17VideoPlayerEngine @ 17 NONAME
_ZN13VideoServicesD0Ev @ 18 NONAME
_ZN13VideoServicesD1Ev @ 19 NONAME
_ZN13VideoServicesD2Ev @ 20 NONAME
- _ZN18QVideoPlayerEngine10handleQuitEv @ 21 NONAME
- _ZN18QVideoPlayerEngine10initializeEv @ 22 NONAME
- _ZN18QVideoPlayerEngine10shouldExitEv @ 23 NONAME
- _ZN18QVideoPlayerEngine11connectViewEv @ 24 NONAME
- _ZN18QVideoPlayerEngine11qt_metacallEN11QMetaObject4CallEiPPv @ 25 NONAME
- _ZN18QVideoPlayerEngine11qt_metacastEPKc @ 26 NONAME
- _ZN18QVideoPlayerEngine11setEmbeddedEv @ 27 NONAME
- _ZN18QVideoPlayerEngine12activateViewEN16MpxHbVideoCommon18MpxHbVideoViewTypeE @ 28 NONAME
- _ZN18QVideoPlayerEngine13doDelayedLoadEv @ 29 NONAME
- _ZN18QVideoPlayerEngine13handleCommandEi @ 30 NONAME
- _ZN18QVideoPlayerEngine14disconnectViewEv @ 31 NONAME
- _ZN18QVideoPlayerEngine14setCurrentViewEv @ 32 NONAME
- _ZN18QVideoPlayerEngine16staticMetaObjectE @ 33 NONAME DATA 16
- _ZN18QVideoPlayerEngine18createMissingViewsEv @ 34 NONAME
- _ZN18QVideoPlayerEngine18createPlaybackViewEv @ 35 NONAME
- _ZN18QVideoPlayerEngine19getStaticMetaObjectEv @ 36 NONAME
- _ZN18QVideoPlayerEngine20isPlayServiceInvokedEv @ 37 NONAME
- _ZN18QVideoPlayerEngine23loadPluginAndCreateViewEN16MpxHbVideoCommon18MpxHbVideoViewTypeE @ 38 NONAME
- _ZN18QVideoPlayerEngine28shouldActivateCollectionViewEv @ 39 NONAME
- _ZN18QVideoPlayerEngine9playMediaE5RFile @ 40 NONAME
- _ZN18QVideoPlayerEngine9playMediaE7QString @ 41 NONAME
- _ZN18QVideoPlayerEngineC1Eb @ 42 NONAME
- _ZN18QVideoPlayerEngineC2Eb @ 43 NONAME
- _ZN18QVideoPlayerEngineD0Ev @ 44 NONAME
- _ZN18QVideoPlayerEngineD1Ev @ 45 NONAME
- _ZN18QVideoPlayerEngineD2Ev @ 46 NONAME
+ _ZN17VideoPlayerEngine10handleQuitEv @ 21 NONAME
+ _ZN17VideoPlayerEngine10initializeEv @ 22 NONAME
+ _ZN17VideoPlayerEngine10shouldExitEv @ 23 NONAME
+ _ZN17VideoPlayerEngine11connectViewEv @ 24 NONAME
+ _ZN17VideoPlayerEngine11qt_metacallEN11QMetaObject4CallEiPPv @ 25 NONAME
+ _ZN17VideoPlayerEngine11qt_metacastEPKc @ 26 NONAME
+ _ZN17VideoPlayerEngine11setEmbeddedEv @ 27 NONAME
+ _ZN17VideoPlayerEngine12activateViewEN16MpxHbVideoCommon18MpxHbVideoViewTypeE @ 28 NONAME
+ _ZN17VideoPlayerEngine13doDelayedLoadEv @ 29 NONAME
+ _ZN17VideoPlayerEngine13handleCommandEi @ 30 NONAME
+ _ZN17VideoPlayerEngine14disconnectViewEv @ 31 NONAME
+ _ZN17VideoPlayerEngine14setCurrentViewEv @ 32 NONAME
+ _ZN17VideoPlayerEngine16staticMetaObjectE @ 33 NONAME DATA 16
+ _ZN17VideoPlayerEngine18createMissingViewsEv @ 34 NONAME
+ _ZN17VideoPlayerEngine18createPlaybackViewEv @ 35 NONAME
+ _ZN17VideoPlayerEngine19getStaticMetaObjectEv @ 36 NONAME
+ _ZN17VideoPlayerEngine20isPlayServiceInvokedEv @ 37 NONAME
+ _ZN17VideoPlayerEngine23loadPluginAndCreateViewEN16MpxHbVideoCommon18MpxHbVideoViewTypeE @ 38 NONAME
+ _ZN17VideoPlayerEngine28shouldActivateCollectionViewEv @ 39 NONAME
+ _ZN17VideoPlayerEngine9playMediaE5RFile @ 40 NONAME
+ _ZN17VideoPlayerEngine9playMediaE7QString @ 41 NONAME
+ _ZN17VideoPlayerEngineC1Eb @ 42 NONAME
+ _ZN17VideoPlayerEngineC2Eb @ 43 NONAME
+ _ZN17VideoPlayerEngineD0Ev @ 44 NONAME
+ _ZN17VideoPlayerEngineD1Ev @ 45 NONAME
+ _ZN17VideoPlayerEngineD2Ev @ 46 NONAME
_ZN18VideoActivityState15getActivityDataERK7QString @ 47 NONAME
_ZN18VideoActivityState15setActivityDataERK8QVariantRK7QString @ 48 NONAME
_ZN18VideoActivityState8instanceEv @ 49 NONAME
@@ -57,11 +57,11 @@
_ZNK13VideoServices12contextTitleEv @ 56 NONAME
_ZNK13VideoServices17getBrowseCategoryEv @ 57 NONAME
_ZNK13VideoServices8sortRoleEv @ 58 NONAME
- _ZNK18QVideoPlayerEngine10metaObjectEv @ 59 NONAME
+ _ZNK17VideoPlayerEngine10metaObjectEv @ 59 NONAME
_ZTI13VideoServices @ 60 NONAME
- _ZTI18QVideoPlayerEngine @ 61 NONAME
+ _ZTI17VideoPlayerEngine @ 61 NONAME
_ZTI18VideoActivityState @ 62 NONAME
_ZTV13VideoServices @ 63 NONAME
- _ZTV18QVideoPlayerEngine @ 64 NONAME
+ _ZTV17VideoPlayerEngine @ 64 NONAME
_ZTV18VideoActivityState @ 65 NONAME
--- a/videoplayerapp/inc/videoplayerengine.h Fri Jul 02 17:14:33 2010 +0300
+++ b/videoplayerapp/inc/videoplayerengine.h Thu Jul 08 13:05:19 2010 +0300
@@ -11,11 +11,11 @@
*
* Contributors:
*
-* Description: Implementation of QVideoPlayerEngine
+* Description: Implementation of VideoPlayerEngine
*
*/
-// Version : %version: ou1cpsw#15 %
+// Version : %version: 16 %
#ifndef VIDEOPLAYERENGINE_H
#define VIDEOPLAYERENGINE_H
@@ -32,13 +32,13 @@
class MpxViewPlugin;
class VideoServices;
-class QMpxVideoPlaybackWrapper;
+class VideoPlaybackWrapper;
/**
- * QVideoPlayerEngine
+ * VideoPlayerEngine
*
*/
-class VIDEOPLAYERAPP_DLL_EXPORT QVideoPlayerEngine: public QObject
+class VIDEOPLAYERAPP_DLL_EXPORT VideoPlayerEngine : public QObject
{
Q_OBJECT
@@ -46,12 +46,12 @@
/**
* Constructor
*/
- QVideoPlayerEngine(bool isService = false);
+ VideoPlayerEngine( bool isService = false );
/**
* Destructor.
*/
- virtual ~QVideoPlayerEngine();
+ virtual ~VideoPlayerEngine();
public:
void initialize();
@@ -92,7 +92,7 @@
private:
bool mIsService;
bool mEmbedded;
- bool mDelayedLoadDone;
+ bool mDelayedLoadDone;
bool mIsPlayService;
MpxViewPlugin* mCurrentViewPlugin;
@@ -101,7 +101,7 @@
MpxViewPlugin* mFileDetailsViewPlugin;
- QMpxVideoPlaybackWrapper *mPlaybackWrapper;
+ VideoPlaybackWrapper *mPlaybackWrapper;
VideoServices* mVideoServices;
--- a/videoplayerapp/videoplayer/src/main.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videoplayerapp/videoplayer/src/main.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -15,72 +15,48 @@
*
*/
-// Version : %version: 3.2 %
+// Version : %version: 10 %
#include <QObject>
-#include <QTranslator>
-#include <QLocale>
#include <hbapplication.h>
#include <hbmainwindow.h>
#include <xqserviceutil.h>
#include <hbactivitymanager.h>
+#include <hbtranslator.h>
#include "videoplayerengine.h"
#include "videoactivitystate.h"
int main(int argc, char *argv[])
{
- HbApplication app(argc, argv, Hb::SplashFixedVertical);
-
- // 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);
+ HbApplication app( argc, argv, Hb::SplashFixedVertical );
- QTranslator translatorCommon;
-
- loaded = false;
-
- loaded = translatorCommon.load( "common_" + lang, QString("c:/resource/qt/translations") );
-
- if (!loaded)
+ //
+ // automatically loads & installs corresponding translation file
+ //
+ HbTranslator translator("videos");
+ translator.loadCommon();
+
+ //
+ // has the application been launched via XQ Service Framework
+ //
+ bool isService = XQServiceUtil::isService();
+
+ if ( ! isService )
{
- 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"));
+ app.setApplicationName( hbTrId("txt_videos_title_videos") );
HbActivityManager *actManager = app.activityManager();
// save activity data locally
- VideoActivityState::instance().setActivityData(actManager->activityData(ACTIVITY_VIDEOPLAYER_MAINVIEW));
+ VideoActivityState::instance().setActivityData( actManager->activityData( ACTIVITY_VIDEOPLAYER_MAINVIEW ) );
// remove from activitymanager
- actManager->removeActivity(ACTIVITY_VIDEOPLAYER_MAINVIEW);
- }
+ actManager->removeActivity( ACTIVITY_VIDEOPLAYER_MAINVIEW );
+ }
HbMainWindow mainWindow( 0, Hb::WindowFlagTransparent );
- QVideoPlayerEngine *engine = new QVideoPlayerEngine(isService);
+ VideoPlayerEngine *engine = new VideoPlayerEngine( isService );
engine->initialize();
mainWindow.show();
return app.exec();
--- a/videoplayerapp/videoplayer/videoplayer.pro Fri Jul 02 17:14:33 2010 +0300
+++ b/videoplayerapp/videoplayer/videoplayer.pro Thu Jul 08 13:05:19 2010 +0300
@@ -14,12 +14,12 @@
# Description: Project file for building Videoplayer components
#
#
-# Version : %version: 2 %
+# Version : %version: 3 %
-TARGET = videoplayer
+TEMPLATE = app
CONFIG += hb service
-TEMPLATE = app
+TARGET = videoplayer
TRANSLATIONS += videos.ts
symbian:
@@ -35,7 +35,8 @@
"resources/videos.docml /epoc32/release/winscw/udeb/z/resource/hb/splashml/videos.docml" \
"resources/videos.splashml /epoc32/release/winscw/udeb/z/resource/hb/splashml/videos.splashml" \
"resources/videos.docml /epoc32/data/z/resource/hb/splashml/videos.docml" \
- "resources/videos.splashml /epoc32/data/z/resource/hb/splashml/videos.splashml" \
+ "resources/videos.splashml /epoc32/data/z/resource/hb/splashml/videos.splashml"
+ MMP_RULES += SMPSAFE
}
# Service provider specific configuration.
@@ -59,7 +60,7 @@
RSS_RULES += \
" datatype_list = " \
" { " \
-" DATATYPE { priority=EDataTypePrioritySystem; type=\"video/avi\"; }, " \
+" 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\"; }, " \
@@ -69,14 +70,14 @@
" 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\"; } " \
-" }; " \
+" 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\"; } " \
+" }; "
--- a/videoplayerapp/videoplayerengine/inc/mpxvideoplaybackwrapper.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +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 QMpxVideoPlaybackWrapper
-*
-*/
-
-// Version : %version: 5 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKWRAPPER_H_
-#define MPXVIDEOPLAYBACKWRAPPER_H_
-
-#include <QObject>
-#include <QString>
-#include <QFile>
-#include <f32file.h>
-#include "mpxhbvideocommondefs.h"
-
-class CMpxVideoPlayerAppUiEngine;
-
-class QMpxVideoPlaybackWrapper : public QObject
-{
- Q_OBJECT
-
- public:
- QMpxVideoPlaybackWrapper();
- virtual ~QMpxVideoPlaybackWrapper();
-
- int playMedia( QString aFileName );
- int playMedia( RFile aFile );
- void openPlaybackView() ;
- void lateInit();
-
- private:
- void initializePlugins();
- int openFileWithNativePath(const TDesC& aFileName);
-
- signals:
- void handlePlaybackView( int viewId );
-
- private: //data
- CMpxVideoPlayerAppUiEngine *mUiEngine;
-};
-
-#endif /* MPXVIDEOPLAYBACKWRAPPER_H_ */
--- a/videoplayerapp/videoplayerengine/inc/mpxvideoplayerappuiengine.h Fri Jul 02 17:14:33 2010 +0300
+++ b/videoplayerapp/videoplayerengine/inc/mpxvideoplayerappuiengine.h Thu Jul 08 13:05:19 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 5 %
+// Version : %version: 6 %
@@ -37,7 +37,7 @@
class CMPXCommonUiHelper;
class MMPXCollectionUiHelper;
class CVideoPlaylistUtility;
-class QMpxVideoPlaybackWrapper;
+class VideoPlaybackWrapper;
/**
* Application UI class.
@@ -52,7 +52,7 @@
public MMPXCHelperEmbeddedOpenObserver
{
public: // Constructors and destructor
- static CMpxVideoPlayerAppUiEngine* NewL( QMpxVideoPlaybackWrapper* aWrapper );
+ static CMpxVideoPlayerAppUiEngine* NewL( VideoPlaybackWrapper* aWrapper );
/**
* Destructor.
@@ -205,7 +205,7 @@
/**
* Constructor
*/
- CMpxVideoPlayerAppUiEngine( QMpxVideoPlaybackWrapper* aWrapper );
+ CMpxVideoPlayerAppUiEngine( VideoPlaybackWrapper* aWrapper );
/**
* By default Symbian 2nd phase constructor is private.
@@ -257,16 +257,16 @@
MMPXCollectionUtility* iCollectionUtility;
MMPXCollectionUiHelper* iCollectionUiHelper; // own
- TUid iVideoCollectionId;
+ TUid iVideoCollectionId;
- CMediaRecognizer* iRecognizer; // own
+ CMediaRecognizer* iRecognizer; // own
TInt iAccessPointId;
TBool iMultilinkPlaylist;
TBool iSeekable;
TBool iUpdateSeekInfo;
- QMpxVideoPlaybackWrapper* iPlaybackWrapper;
+ VideoPlaybackWrapper* iPlaybackWrapper;
};
//
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/inc/videoplaybackwrapper.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,57 @@
+/*
+* 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 VideoPlaybackWrapper
+*
+*/
+
+// Version : %version: 6 %
+
+
+
+#ifndef VIDEOPLAYBACKWRAPPER_H_
+#define VIDEOPLAYBACKWRAPPER_H_
+
+#include <QObject>
+#include <QString>
+#include <QFile>
+#include <f32file.h>
+#include "mpxhbvideocommondefs.h"
+
+class CMpxVideoPlayerAppUiEngine;
+
+class VideoPlaybackWrapper : public QObject
+{
+ Q_OBJECT
+
+ public:
+ VideoPlaybackWrapper();
+ virtual ~VideoPlaybackWrapper();
+
+ int playMedia( QString aFileName );
+ int playMedia( RFile aFile );
+ void openPlaybackView() ;
+ void lateInit();
+
+ private:
+ void initializePlugins();
+ int openFileWithNativePath(const TDesC& aFileName);
+
+ signals:
+ void handlePlaybackView( int viewId );
+
+ private: //data
+ CMpxVideoPlayerAppUiEngine *mUiEngine;
+};
+
+#endif /* VIDEOPLAYBACKWRAPPER_H_ */
--- a/videoplayerapp/videoplayerengine/inc/videoserviceplay.h Fri Jul 02 17:14:33 2010 +0300
+++ b/videoplayerapp/videoplayerengine/inc/videoserviceplay.h Thu Jul 08 13:05:19 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#2 %
+// Version : %version: da1mmcf#3 %
#ifndef __VIDEOSERVICEPLAY_H__
#define __VIDEOSERVICEPLAY_H__
@@ -25,19 +25,22 @@
// FORWARD DECLARATIONS
class VideoServices;
-class QVideoPlayerEngine;
+class VideoPlayerEngine;
class QLatin1String;
class VideoServicePlay : public XQServiceProvider
- {
-
+{
Q_OBJECT
public:
- VideoServicePlay( VideoServices *parent, QVideoPlayerEngine* engine, QLatin1String service );
+
+ VideoServicePlay( VideoServices *parent,
+ VideoPlayerEngine* engine,
+ QLatin1String service );
+
virtual ~VideoServicePlay();
- void setEngine( QVideoPlayerEngine* engine );
+ void setEngine( VideoPlayerEngine* engine );
public slots:
void playMedia( QString filePath );
@@ -45,10 +48,9 @@
void closePlayer();
private:
- QVideoPlayerEngine* mEngine;
+ VideoPlayerEngine* mEngine;
VideoServices* mServiceApp;
+};
- };
-
- #endif //__VIDEOSERVICEPLAY_H__
+#endif //__VIDEOSERVICEPLAY_H__
--- a/videoplayerapp/videoplayerengine/inc/videoserviceview.h Fri Jul 02 17:14:33 2010 +0300
+++ b/videoplayerapp/videoplayerengine/inc/videoserviceview.h Thu Jul 08 13:05:19 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 2 %
+// Version : %version: 3 %
#ifndef __VIDEOSERVICEVIEW_H__
#define __VIDEOSERVICEVIEW_H__
@@ -26,31 +26,33 @@
// FORWARD DECLARATIONS
class VideoServices;
-class QVideoPlayerEngine;
+class VideoPlayerEngine;
class QFile;
class QLatin1String;
class VideoServiceView : public XQServiceProvider
- {
-
+{
Q_OBJECT
public:
- VideoServiceView( VideoServices *parent, QVideoPlayerEngine* engine, QLatin1String service );
+
+ VideoServiceView( VideoServices *parent,
+ VideoPlayerEngine* engine,
+ QLatin1String service );
+
virtual ~VideoServiceView();
- void setEngine( QVideoPlayerEngine* engine );
+ void setEngine( VideoPlayerEngine* engine );
public slots:
bool view( QString file );
bool view (XQSharableFile file);
private:
- QVideoPlayerEngine* mEngine;
+ VideoPlayerEngine* mEngine;
VideoServices* mServiceApp;
-
-
- };
+
+};
#endif //__VIDEOSERVICEVIEW_H__
--- a/videoplayerapp/videoplayerengine/src/mpxvideoplaybackwrapper.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,170 +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: Implimentation of QMpxVideoPlaybackWrapper
-*
-*/
-
-// Version : %version: ou1cpsw#5 %
-
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackwrapper.h"
-#include "mpxvideoplayerappuiengine.h"
-
-
-// -------------------------------------------------------------------------------------------------
-// QMpxVideoPlaybackWrapper::QMpxVideoPlaybackWrapper()
-// -------------------------------------------------------------------------------------------------
-//
-QMpxVideoPlaybackWrapper::QMpxVideoPlaybackWrapper()
-{
- MPX_ENTER_EXIT(_L("QMpxVideoPlaybackWrapper::QMpxVideoPlaybackWrapper()"));
-
- initializePlugins();
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMpxVideoPlaybackWrapper::~QMpxVideoPlaybackWrapper()
-// -------------------------------------------------------------------------------------------------
-//
-QMpxVideoPlaybackWrapper::~QMpxVideoPlaybackWrapper()
-{
- MPX_ENTER_EXIT(_L("QMpxVideoPlaybackWrapper::~QMpxVideoPlaybackWrapper()"));
-
- if ( mUiEngine )
- {
- delete mUiEngine;
- mUiEngine = NULL;
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMpxVideoPlaybackWrapper::initializePlugins()
-// -------------------------------------------------------------------------------------------------
-//
-void QMpxVideoPlaybackWrapper::initializePlugins()
-{
- MPX_ENTER_EXIT(_L("QMpxVideoPlaybackWrapper::initializePlugins()"));
-
- TRAPD( err, mUiEngine = CMpxVideoPlayerAppUiEngine::NewL( this ) );
- MPX_DEBUG(_L("QMpxVideoPlaybackWrapper::initializePlugins err = %d"), err);
- Q_UNUSED(err);
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMpxVideoPlaybackWrapper::playMedia()
-// -------------------------------------------------------------------------------------------------
-//
-int QMpxVideoPlaybackWrapper::playMedia( QString aFileName )
-{
- MPX_ENTER_EXIT(_L("QMpxVideoPlaybackWrapper::playMedia"));
-
- TBuf<KMaxFileName> filename( aFileName.utf16() );
- int error = openFileWithNativePath( filename );
-
- MPX_DEBUG(_L("QMpxVideoPlaybackWrapper::playMedia err = %d"), error);
-
- return error;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMpxVideoPlaybackWrapper::playMedia()
-// -------------------------------------------------------------------------------------------------
-//
-int QMpxVideoPlaybackWrapper::playMedia( RFile aFile )
-{
- MPX_ENTER_EXIT(_L("QMpxVideoPlaybackWrapper::playMedia"));
-
- TRAPD( error, mUiEngine->OpenFileL( aFile ) );
-
- MPX_DEBUG(_L("QMpxVideoPlaybackWrapper::playMedia err = %d"), error);
-
- return error;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMpxVideoPlaybackWrapper::openPlaybackView()
-// -------------------------------------------------------------------------------------------------
-//
-void QMpxVideoPlaybackWrapper::openPlaybackView()
-{
- MPX_ENTER_EXIT(_L("QMpxVideoPlaybackWrapper::openPlaybackView()"));
-
- emit handlePlaybackView( MpxHbVideoCommon::ActivatePlaybackView );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMpxVideoPlaybackWrapper::postInit()
-// -------------------------------------------------------------------------------------------------
-//
-void QMpxVideoPlaybackWrapper::lateInit()
-{
- MPX_ENTER_EXIT(_L("QMpxVideoPlaybackWrapper::postInit()"));
-
- TRAP_IGNORE( mUiEngine->LateInitL() );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMpxVideoPlaybackWrapper::openFileWithNativePath()
-// -------------------------------------------------------------------------------------------------
-//
-int QMpxVideoPlaybackWrapper::openFileWithNativePath(const TDesC& aFileName)
-{
- MPX_DEBUG(_L("QMpxVideoPlaybackWrapper::openFileWithNativePath()"));
-
- int err = KErrNone;
-
- int fwdSlashPos = aFileName.LocateF('/');
-
- if( fwdSlashPos == KErrNotFound )
- {
- // no fwd slashes found => filepath is already in
- // preferred format eg. c:\\data\\videos\\test.3gp
- //
- TRAP( err, mUiEngine->OpenFileL( aFileName ) );
- }
- else
- {
- HBufC* fileName = NULL;
-
- TRAP( err, fileName = aFileName.AllocL() );
-
- if ( err == KErrNone )
- {
- int count( fileName->Des().Length() );
-
- for ( int j = fwdSlashPos ; j < count; ++j )
- {
- if ( fileName->Des()[j]== '/' )
- {
- fileName->Des()[j]='\\';
- }
- }
-
- }
-
- TRAP( err, mUiEngine->OpenFileL( fileName->Des() ) );
-
- if ( fileName )
- {
- delete fileName;
- fileName = NULL;
- }
- }
-
- return err;
-}
-
-
-// End of File
--- a/videoplayerapp/videoplayerengine/src/mpxvideoplayerappuiengine.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videoplayerapp/videoplayerengine/src/mpxvideoplayerappuiengine.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 9 %
+// Version : %version: 10 %
@@ -42,7 +42,7 @@
#include "mpxvideoplayerappuiengine.h"
#include "mpxvideoplayerconstants.h"
-#include "mpxvideoplaybackwrapper.h"
+#include "videoplaybackwrapper.h"
#include "mpxhbvideocommondefs.h"
#include "mpxvideo_debug.h"
@@ -51,7 +51,7 @@
// CMpxVideoPlayerAppUiEngine::CMpxVideoPlayerAppUiEngine
// -------------------------------------------------------------------------------------------------
//
-CMpxVideoPlayerAppUiEngine::CMpxVideoPlayerAppUiEngine( QMpxVideoPlaybackWrapper* aWrapper )
+CMpxVideoPlayerAppUiEngine::CMpxVideoPlayerAppUiEngine( VideoPlaybackWrapper* aWrapper )
: iPlaybackUtility( NULL ),
iCollectionUtility( NULL ),
iRecognizer( NULL ),
@@ -67,7 +67,7 @@
// CMpxVideoPlayerAppUiEngine::NewL
// -------------------------------------------------------------------------------------------------
//
-CMpxVideoPlayerAppUiEngine* CMpxVideoPlayerAppUiEngine::NewL( QMpxVideoPlaybackWrapper* aWrapper )
+CMpxVideoPlayerAppUiEngine* CMpxVideoPlayerAppUiEngine::NewL( VideoPlaybackWrapper* aWrapper )
{
MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::NewL()"));
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/src/videoplaybackwrapper.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,170 @@
+/*
+* 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 VideoPlaybackWrapper
+*
+*/
+
+// Version : %version: 6 %
+
+
+#include "mpxvideo_debug.h"
+#include "videoplaybackwrapper.h"
+#include "mpxvideoplayerappuiengine.h"
+
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackWrapper::VideoPlaybackWrapper()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackWrapper::VideoPlaybackWrapper()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackWrapper::VideoPlaybackWrapper()"));
+
+ initializePlugins();
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackWrapper::~VideoPlaybackWrapper()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackWrapper::~VideoPlaybackWrapper()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackWrapper::~VideoPlaybackWrapper()"));
+
+ if ( mUiEngine )
+ {
+ delete mUiEngine;
+ mUiEngine = NULL;
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackWrapper::initializePlugins()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackWrapper::initializePlugins()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackWrapper::initializePlugins()"));
+
+ TRAPD( err, mUiEngine = CMpxVideoPlayerAppUiEngine::NewL( this ) );
+ MPX_DEBUG(_L("VideoPlaybackWrapper::initializePlugins err = %d"), err);
+ Q_UNUSED(err);
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackWrapper::playMedia()
+// -------------------------------------------------------------------------------------------------
+//
+int VideoPlaybackWrapper::playMedia( QString aFileName )
+{
+ MPX_DEBUG(_L("VideoPlaybackWrapper::playMedia( %s )"), aFileName.data() );
+
+ TBuf<KMaxFileName> filename( aFileName.utf16() );
+ int error = openFileWithNativePath( filename );
+
+ MPX_DEBUG(_L("VideoPlaybackWrapper::playMedia err = %d"), error);
+
+ return error;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackWrapper::playMedia()
+// -------------------------------------------------------------------------------------------------
+//
+int VideoPlaybackWrapper::playMedia( RFile aFile )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackWrapper::playMedia( aFile )"));
+
+ TRAPD( error, mUiEngine->OpenFileL( aFile ) );
+
+ MPX_DEBUG(_L("VideoPlaybackWrapper::playMedia err = %d"), error);
+
+ return error;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackWrapper::openPlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackWrapper::openPlaybackView()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackWrapper::openPlaybackView()"));
+
+ emit handlePlaybackView( MpxHbVideoCommon::ActivatePlaybackView );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackWrapper::postInit()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackWrapper::lateInit()
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackWrapper::lateInit()"));
+
+ TRAP_IGNORE( mUiEngine->LateInitL() );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackWrapper::openFileWithNativePath()
+// -------------------------------------------------------------------------------------------------
+//
+int VideoPlaybackWrapper::openFileWithNativePath(const TDesC& aFileName)
+{
+ MPX_DEBUG(_L("VideoPlaybackWrapper::openFileWithNativePath()"));
+
+ int err = KErrNone;
+
+ int fwdSlashPos = aFileName.LocateF('/');
+
+ if( fwdSlashPos == KErrNotFound )
+ {
+ // no fwd slashes found => filepath is already in
+ // preferred format eg. c:\\data\\videos\\test.3gp
+ //
+ TRAP( err, mUiEngine->OpenFileL( aFileName ) );
+ }
+ else
+ {
+ HBufC* fileName = NULL;
+
+ TRAP( err, fileName = aFileName.AllocL() );
+
+ if ( err == KErrNone )
+ {
+ int count( fileName->Des().Length() );
+
+ for ( int j = fwdSlashPos ; j < count; ++j )
+ {
+ if ( fileName->Des()[j]== '/' )
+ {
+ fileName->Des()[j]='\\';
+ }
+ }
+
+ }
+
+ TRAP( err, mUiEngine->OpenFileL( fileName->Des() ) );
+
+ if ( fileName )
+ {
+ delete fileName;
+ fileName = NULL;
+ }
+ }
+
+ return err;
+}
+
+
+// End of File
--- a/videoplayerapp/videoplayerengine/src/videoplayerengine.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videoplayerapp/videoplayerengine/src/videoplayerengine.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#37 %
+// Version : %version: da1mmcf#38 %
#include <QApplication>
@@ -30,15 +30,15 @@
#include "videoplayerengine.h"
#include "videoactivitystate.h"
-#include "mpxvideoplaybackwrapper.h"
+#include "videoplaybackwrapper.h"
#include "videoservices.h"
#include "mpxvideo_debug.h"
// -------------------------------------------------------------------------------------------------
-// QVideoPlayerEngine()
+// VideoPlayerEngine()
// -------------------------------------------------------------------------------------------------
//
-QVideoPlayerEngine::QVideoPlayerEngine( bool isService )
+VideoPlayerEngine::VideoPlayerEngine( bool isService )
: mIsService( isService )
, mEmbedded( false )
, mDelayedLoadDone( false )
@@ -50,47 +50,47 @@
, mPlaybackWrapper( 0 )
, mVideoServices( 0 )
{
- MPX_DEBUG(_L("QVideoPlayerEngine::QVideoPlayerEngine()"));
+ MPX_DEBUG(_L("VideoPlayerEngine::VideoPlayerEngine()"));
}
// -------------------------------------------------------------------------------------------------
-// ~QVideoPlayerEngine()
+// ~VideoPlayerEngine()
// -------------------------------------------------------------------------------------------------
//
-QVideoPlayerEngine::~QVideoPlayerEngine()
+VideoPlayerEngine::~VideoPlayerEngine()
{
- MPX_ENTER_EXIT(_L("QVideoPlayerEngine::~QVideoPlayerEngine()"));
-
+ MPX_ENTER_EXIT(_L("VideoPlayerEngine::~VideoPlayerEngine()"));
+
if ( mVideoServices )
{
mVideoServices->decreaseReferenceCount();
mVideoServices = 0;
}
- if ( mCollectionViewPlugin )
+ if ( mCollectionViewPlugin )
{
mCollectionViewPlugin->destroyView();
- delete mCollectionViewPlugin;
- mCollectionViewPlugin = 0;
+ delete mCollectionViewPlugin;
+ mCollectionViewPlugin = 0;
}
- if ( mPlaybackViewPlugin )
+ if ( mPlaybackViewPlugin )
{
mPlaybackViewPlugin->destroyView();
- delete mPlaybackViewPlugin;
- mPlaybackViewPlugin = 0;
+ delete mPlaybackViewPlugin;
+ mPlaybackViewPlugin = 0;
}
- if ( mFileDetailsViewPlugin )
+ if ( mFileDetailsViewPlugin )
{
mFileDetailsViewPlugin->destroyView();
- delete mFileDetailsViewPlugin;
- mFileDetailsViewPlugin = 0;
+ delete mFileDetailsViewPlugin;
+ mFileDetailsViewPlugin = 0;
}
delete mPlaybackWrapper;
- // disconnect all signals
+ // disconnect all signals
disconnect();
}
@@ -98,21 +98,21 @@
// initialize()
// -------------------------------------------------------------------------------------------------
//
-void QVideoPlayerEngine::initialize()
+void VideoPlayerEngine::initialize()
{
- MPX_ENTER_EXIT(_L("QVideoPlayerEngine::initialize()"));
-
+ MPX_ENTER_EXIT(_L("VideoPlayerEngine::initialize()"));
+
//
- // Clean up QVideoPlayerEngine when qApp try to quit
+ // Clean up VideoPlayerEngine when qApp try to quit
//
connect( qApp, SIGNAL( aboutToQuit() ), this, SLOT( handleQuit() ) );
//
// Create playback wrapper
//
- if ( !mPlaybackWrapper )
+ if ( ! mPlaybackWrapper )
{
- mPlaybackWrapper = new QMpxVideoPlaybackWrapper();
+ mPlaybackWrapper = new VideoPlaybackWrapper();
connect( mPlaybackWrapper,
SIGNAL( handlePlaybackView( int ) ),
this,
@@ -121,67 +121,73 @@
QList<XQPluginInfo> impls;
XQPluginLoader::listImplementations("org.nokia.mmdt.MpxViewPlugin/1.0", impls);
-
+
if ( mIsService )
{
- if(!mVideoServices)
+ if ( ! mVideoServices )
{
mVideoServices = VideoServices::instance(this);
connect( mVideoServices, SIGNAL(activated(int)), this, SLOT(handleCommand(int)));
}
+
if ( isPlayServiceInvoked() )
{
- createPlaybackView();
+ createPlaybackView();
}
else
{
- loadPluginAndCreateView( MpxHbVideoCommon::CollectionView );
-
+ loadPluginAndCreateView( MpxHbVideoCommon::CollectionView );
+
+ //
// Browse service will activate view once the category to be opened is informed from highway
// since the category is not known at this point, we do not activate view for it here
- if(!(XQServiceUtil::interfaceName().contains("IVideoBrowse")))
+ //
+ if ( ! (XQServiceUtil::interfaceName().contains("IVideoBrowse") ) )
{
- activateView( MpxHbVideoCommon::CollectionView );
+ activateView( MpxHbVideoCommon::CollectionView );
}
}
}
else
{
- // check latest plugin type from activity manager data and create + activate it
+ //
+ // check latest plugin type from activity manager data and create + activate it
// CollectionView (default) and playbackview are the ones that are accepted
+ //
MpxHbVideoCommon::MpxHbVideoViewType viewType = MpxHbVideoCommon::CollectionView;
- int typeGotten = VideoActivityState::instance().getActivityData(KEY_VIEWPLUGIN_TYPE).toInt();
-
- if ( typeGotten == MpxHbVideoCommon::PlaybackView )
+ int typeGotten = VideoActivityState::instance().getActivityData( KEY_VIEWPLUGIN_TYPE ).toInt();
+
+ if ( typeGotten == MpxHbVideoCommon::PlaybackView )
{
- createPlaybackView();
+ createPlaybackView();
viewType = MpxHbVideoCommon::MpxHbVideoViewType(typeGotten);
- QVariant data = VideoActivityState::instance().getActivityData(KEY_LAST_PLAYED_CLIP);
+ QVariant data = VideoActivityState::instance().getActivityData( KEY_LAST_PLAYED_CLIP );
playMedia( data.toString() );
}
else
{
- loadPluginAndCreateView( viewType );
- activateView( viewType );
+ loadPluginAndCreateView( viewType );
+ activateView( viewType );
}
}
+
}
// -------------------------------------------------------------------------------------------------
// handleCommand()
// -------------------------------------------------------------------------------------------------
//
-void QVideoPlayerEngine::handleCommand( int commandCode )
+void VideoPlayerEngine::handleCommand( int commandCode )
{
- MPX_ENTER_EXIT(_L("QVideoPlayerEngine::handleCommand()"),
+ MPX_ENTER_EXIT(_L("VideoPlayerEngine::handleCommand()"),
_L("commandCode = %d"), commandCode );
-
+
switch ( commandCode )
{
case MpxHbVideoCommon::ActivateCollectionView:
{
if ( mCurrentViewPlugin != mCollectionViewPlugin )
- {
+ {
activateView( MpxHbVideoCommon::CollectionView );
}
break;
@@ -189,8 +195,8 @@
case MpxHbVideoCommon::ActivatePlaybackView:
{
if ( mCurrentViewPlugin != mPlaybackViewPlugin )
- {
- activateView( MpxHbVideoCommon::PlaybackView );
+ {
+ activateView( MpxHbVideoCommon::PlaybackView );
}
break;
}
@@ -198,7 +204,7 @@
{
if ( mCurrentViewPlugin != mFileDetailsViewPlugin )
{
- activateView( MpxHbVideoCommon::VideoDetailsView );
+ activateView( MpxHbVideoCommon::VideoDetailsView );
}
break;
}
@@ -210,24 +216,24 @@
}
break;
}
-
+
default:
{
break;
}
- }
+ }
}
// -------------------------------------------------------------------------------------------------
// doDelayedLoad()
// -------------------------------------------------------------------------------------------------
//
-void QVideoPlayerEngine::doDelayedLoad()
+void VideoPlayerEngine::doDelayedLoad()
{
- MPX_ENTER_EXIT(_L("QVideoPlayerEngine::doDelayedLoad()"));
-
+ MPX_ENTER_EXIT(_L("VideoPlayerEngine::doDelayedLoad()"));
+
createMissingViews();
-
+
mDelayedLoadDone = true;
}
@@ -235,12 +241,10 @@
// createPlaybackView()
// -------------------------------------------------------------------------------------------------
//
-void QVideoPlayerEngine::createPlaybackView()
+void VideoPlayerEngine::createPlaybackView()
{
- MPX_ENTER_EXIT(_L("QVideoPlayerEngine::createPlaybackView()"));
-
mPlaybackWrapper->lateInit();
-
+
if ( ! mPlaybackViewPlugin )
{
loadPluginAndCreateView( MpxHbVideoCommon::PlaybackView );
@@ -251,21 +255,22 @@
// createMissingViews()
// -------------------------------------------------------------------------------------------------
//
-void QVideoPlayerEngine::createMissingViews()
+void VideoPlayerEngine::createMissingViews()
{
- MPX_ENTER_EXIT(_L("QVideoPlayerEngine::createMissingViews()"));
-
+ MPX_ENTER_EXIT(_L("VideoPlayerEngine::createMissingViews()"));
+
//
// delayed initialization of some uiengine member variables
// to help application startup time & improve playback start time
//
createPlaybackView();
- if(!mFileDetailsViewPlugin)
+ if ( ! mFileDetailsViewPlugin )
{
loadPluginAndCreateView( MpxHbVideoCommon::VideoDetailsView );
}
- if(!mCollectionViewPlugin)
+
+ if ( ! mCollectionViewPlugin )
{
loadPluginAndCreateView( MpxHbVideoCommon::CollectionView );
}
@@ -277,13 +282,13 @@
// activate view based on view type.
// -------------------------------------------------------------------------------------------------
//
-void QVideoPlayerEngine::activateView( MpxHbVideoCommon::MpxHbVideoViewType viewType )
+void VideoPlayerEngine::activateView( MpxHbVideoCommon::MpxHbVideoViewType viewType )
{
- MPX_ENTER_EXIT(_L("QVideoPlayerEngine::activateView() "),
+ MPX_ENTER_EXIT(_L("VideoPlayerEngine::activateView() "),
_L("viewType = %d"), viewType );
-
+
disconnectView();
-
+
if ( mCurrentViewPlugin )
{
mCurrentViewPlugin->deactivateView();
@@ -297,19 +302,19 @@
if ( shouldExit() )
{
qApp->quit();
- XQServiceUtil::toBackground( false );
+ XQServiceUtil::toBackground( false );
}
else if ( shouldActivateCollectionView() )
{
if ( ! mCollectionViewPlugin )
{
loadPluginAndCreateView( MpxHbVideoCommon::CollectionView );
- }
+ }
mCurrentViewPlugin = mCollectionViewPlugin;
- setCurrentView();
+ setCurrentView();
}
-
- break;
+
+ break;
}
case MpxHbVideoCommon::PlaybackView:
{
@@ -317,43 +322,43 @@
{
loadPluginAndCreateView( MpxHbVideoCommon::PlaybackView );
}
-
+
mCurrentViewPlugin = mPlaybackViewPlugin;
- setCurrentView();
-
- break;
+ setCurrentView();
+
+ break;
}
case MpxHbVideoCommon::VideoDetailsView:
{
if ( ! mFileDetailsViewPlugin )
{
- loadPluginAndCreateView( MpxHbVideoCommon::VideoDetailsView );
+ loadPluginAndCreateView( MpxHbVideoCommon::VideoDetailsView );
}
-
+
mCurrentViewPlugin = mFileDetailsViewPlugin;
- setCurrentView();
-
- break;
- }
- }
+ setCurrentView();
+
+ break;
+ }
+ }
}
// -------------------------------------------------------------------------------------------------
// loadPluginAndCreateView()
// -------------------------------------------------------------------------------------------------
//
-void QVideoPlayerEngine::loadPluginAndCreateView( MpxHbVideoCommon::MpxHbVideoViewType viewType )
+void VideoPlayerEngine::loadPluginAndCreateView( MpxHbVideoCommon::MpxHbVideoViewType viewType )
{
- MPX_ENTER_EXIT(_L("QVideoPlayerEngine::loadPluginAndCreateView() "),
+ MPX_ENTER_EXIT(_L("VideoPlayerEngine::loadPluginAndCreateView() "),
_L("viewType = %d"), viewType );
-
+
int viewTypeUid( 0 );
- if ( viewType == MpxHbVideoCommon::CollectionView )
+ if ( viewType == MpxHbVideoCommon::CollectionView )
{
viewTypeUid = MpxHbVideoCommon::KMpxVideoPluginDllCollectionUid;
}
- else if ( viewType == MpxHbVideoCommon::PlaybackView )
+ else if ( viewType == MpxHbVideoCommon::PlaybackView )
{
viewTypeUid = MpxHbVideoCommon::KMpxVideoPluginDllPlaybackUid;
}
@@ -364,7 +369,7 @@
if ( viewTypeUid )
{
- //
+ //
// load corresponding plug-in
//
XQPluginLoader pluginLoader( viewTypeUid );
@@ -374,7 +379,7 @@
{
MpxViewPlugin *currentViewPlugin = NULL;
- if ( viewType == MpxHbVideoCommon::CollectionView )
+ if ( viewType == MpxHbVideoCommon::CollectionView )
{
mCollectionViewPlugin = qobject_cast<MpxViewPlugin*>( instance )->viewPlugin();
currentViewPlugin = mCollectionViewPlugin;
@@ -391,32 +396,32 @@
}
else
{
- MPX_DEBUG(_L("QVideoPlayerEngine::loadPluginAndCreateView() : plugin not FOUND ! "));
+ MPX_DEBUG(_L("VideoPlayerEngine::loadPluginAndCreateView() : plugin not FOUND ! "));
}
-
+
//
// create corresponding view
//
- if ( currentViewPlugin )
+ if ( currentViewPlugin )
{
QGraphicsWidget *view = currentViewPlugin->getView();
-
+
if ( ! view )
{
- MPX_DEBUG(_L("QVideoPlayerEngine::loadPluginAndCreateView() : create view "));
-
+ MPX_DEBUG(_L("VideoPlayerEngine::loadPluginAndCreateView() : create view "));
+
currentViewPlugin->createView();
hbInstance->allMainWindows().value(0)->addView( currentViewPlugin->getView() );
}
else
{
- MPX_DEBUG(_L("QVideoPlayerEngine::loadPluginAndCreateView() : view has already been created! "));
+ MPX_DEBUG(_L("VideoPlayerEngine::loadPluginAndCreateView() : view has already been created! "));
}
}
else
{
- MPX_DEBUG(_L("QVideoPlayerEngine::loadPluginAndCreateView() : currentViewPlugin is NULL ! "));
- }
+ MPX_DEBUG(_L("VideoPlayerEngine::loadPluginAndCreateView() : currentViewPlugin is NULL! "));
+ }
}
}
}
@@ -426,10 +431,10 @@
// connect application to view by setting up the signals and slots.
// -------------------------------------------------------------------------------------------------
//
-void QVideoPlayerEngine::connectView()
+void VideoPlayerEngine::connectView()
{
- MPX_ENTER_EXIT(_L("QVideoPlayerEngine::connectView()"));
-
+ MPX_ENTER_EXIT(_L("VideoPlayerEngine::connectView()"));
+
connect( mCurrentViewPlugin,
SIGNAL( command( int ) ),
this,
@@ -441,16 +446,16 @@
// connect application to view by setting up the signals and slots.
// -------------------------------------------------------------------------------------------------
//
-void QVideoPlayerEngine::disconnectView()
+void VideoPlayerEngine::disconnectView()
{
- MPX_ENTER_EXIT(_L("QVideoPlayerEngine::disconnectView()"));
-
+ MPX_ENTER_EXIT(_L("VideoPlayerEngine::disconnectView()"));
+
if ( mCurrentViewPlugin )
{
disconnect( mCurrentViewPlugin,
SIGNAL( command( int ) ),
this,
- SLOT( handleCommand( int ) ) );
+ SLOT( handleCommand( int ) ) );
}
}
@@ -458,50 +463,52 @@
// handleQuit()
// -------------------------------------------------------------------------------------------------
//
-void QVideoPlayerEngine::handleQuit()
+void VideoPlayerEngine::handleQuit()
{
- MPX_ENTER_EXIT(_L("QVideoPlayerEngine::handleQuit()"));
-
- if(!mIsService)
+ MPX_ENTER_EXIT(_L("VideoPlayerEngine::handleQuit()"));
+
+ if ( ! mIsService )
{
VideoActivityState &localActivity(VideoActivityState::instance());
-
+
QVariant data = QVariant();
HbActivityManager *actManager = qobject_cast<HbApplication*>(qApp)->activityManager();
-
+
//
- // deactivate is the final point for current plugin to save it's activity data into
+ // deactivate is the final point for current plugin to save it's activity data into
// VideoActivityState before they are saved to to activity manager
//
- mCurrentViewPlugin->deactivateView();
-
+ mCurrentViewPlugin->deactivateView();
+
//
// get and save recent view type: either playback or collection view plugins are currently used.
// activity will not be saved from the details plugin
//
int viewType = MpxHbVideoCommon::CollectionView;
- if(mCurrentViewPlugin == mPlaybackViewPlugin)
+
+ if ( mCurrentViewPlugin == mPlaybackViewPlugin )
{
// for playback view, the state preservation and restoration should only be done
// for loacl clips (non-streaming) - so set KEY_VIEWPLUGIN_TYPE to PlaybackView only
// for local clips. Otherwise the default value CollectionView should be set.
//
- QVariant playdata = VideoActivityState::instance().getActivityData(KEY_LAST_LOCAL_PLAYBACK);
+ QVariant playdata = VideoActivityState::instance().getActivityData( KEY_LAST_LOCAL_PLAYBACK );
+
if ( playdata.toBool() )
{
viewType = MpxHbVideoCommon::PlaybackView;
- }
+ }
}
-
+
data = viewType;
- localActivity.setActivityData(data, KEY_VIEWPLUGIN_TYPE);
-
+ localActivity.setActivityData( data, KEY_VIEWPLUGIN_TYPE );
+
// save data to activity manager
- actManager->addActivity(ACTIVITY_VIDEOPLAYER_MAINVIEW,
- localActivity.getActivityData(),
- QVariantHash());
+ actManager->addActivity( ACTIVITY_VIDEOPLAYER_MAINVIEW,
+ localActivity.getActivityData(),
+ QVariantHash() );
}
-
+
delete this;
}
@@ -510,11 +517,11 @@
// playMedia()
// -------------------------------------------------------------------------------------------------
//
-void QVideoPlayerEngine::playMedia( QString filePath )
+void VideoPlayerEngine::playMedia( QString filePath )
{
- MPX_ENTER_EXIT(_L("QVideoPlayerEngine::playMedia()"),
- _L("filePath = %s"), filePath.data() );
-
+ MPX_ENTER_EXIT(_L("VideoPlayerEngine::playMedia()"),
+ _L("filePath = %s"), filePath.data() );
+
mPlaybackWrapper->playMedia( filePath );
}
@@ -522,21 +529,21 @@
// playMedia()
// -------------------------------------------------------------------------------------------------
//
-void QVideoPlayerEngine::playMedia( RFile file )
+void VideoPlayerEngine::playMedia( RFile file )
{
- MPX_ENTER_EXIT(_L("QVideoPlayerEngine::playMedia( RFile )"));
-
- mPlaybackWrapper->playMedia( file );
+ MPX_ENTER_EXIT(_L("VideoPlayerEngine::playMedia( RFile )"));
+
+ mPlaybackWrapper->playMedia( file );
}
// -------------------------------------------------------------------------------------------------
// setEmbedded()
// -------------------------------------------------------------------------------------------------
//
-void QVideoPlayerEngine::setEmbedded()
+void VideoPlayerEngine::setEmbedded()
{
- MPX_ENTER_EXIT(_L("QVideoPlayerEngine::setEmbedded()"));
-
+ MPX_ENTER_EXIT(_L("VideoPlayerEngine::setEmbedded()"));
+
mEmbedded = true;
}
@@ -544,16 +551,16 @@
// setCurrentView()
// -------------------------------------------------------------------------------------------------
//
-void QVideoPlayerEngine::setCurrentView()
+void VideoPlayerEngine::setCurrentView()
{
- MPX_ENTER_EXIT(_L("QVideoPlayerEngine::setCurrentView()"));
-
+ MPX_ENTER_EXIT(_L("VideoPlayerEngine::setCurrentView()"));
+
if ( mCurrentViewPlugin )
{
//
// set current view
//
- hbInstance->allMainWindows().value(0)->setCurrentView(
+ hbInstance->allMainWindows().value(0)->setCurrentView(
qobject_cast<HbView*>( mCurrentViewPlugin->getView() ), false );
//
@@ -561,7 +568,7 @@
//
connectView();
- //
+ //
// activate view
//
mCurrentViewPlugin->activateView();
@@ -572,16 +579,17 @@
// isPlayServiceInvoked()
// -------------------------------------------------------------------------------------------------
//
-bool QVideoPlayerEngine::isPlayServiceInvoked()
+bool VideoPlayerEngine::isPlayServiceInvoked()
{
- MPX_ENTER_EXIT(_L("QVideoPlayerEngine::isPlayServiceInvoked()"));
-
- bool result = false;
-
+ MPX_ENTER_EXIT(_L("VideoPlayerEngine::isPlayServiceInvoked()"));
+
+ bool result = false;
+
if ( mIsService )
{
QString intface = XQServiceUtil::interfaceName();
-
+ MPX_DEBUG(_L("VideoPlayerEngine::isPlayServiceInvoked() : interfaceName(%s)"), intface.data() );
+
if ( intface.contains("IVideoView") ||
intface.contains("IFileView") )
{
@@ -589,7 +597,8 @@
mIsPlayService = true;
}
}
-
+
+ MPX_DEBUG(_L("VideoPlayerEngine::isPlayServiceInvoked() return %d"), result);
return result;
}
@@ -597,17 +606,17 @@
// shouldExit()
// -------------------------------------------------------------------------------------------------
//
-bool QVideoPlayerEngine::shouldExit()
-{
+bool VideoPlayerEngine::shouldExit()
+{
bool result = false;
-
+
if ( mIsPlayService ) // play or view service
{
- result = true;
+ result = true;
}
-
- MPX_DEBUG(_L("QVideoPlayerEngine::shouldExit() return %d"), result);
-
+
+ MPX_DEBUG(_L("VideoPlayerEngine::shouldExit() return %d"), result);
+
return result;
}
@@ -616,23 +625,24 @@
// shouldActivateCollectionView()
// -------------------------------------------------------------------------------------------------
//
-bool QVideoPlayerEngine::shouldActivateCollectionView()
-{
- bool result = true;
-
+bool VideoPlayerEngine::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
+ // 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);
-
+ result = false;
+ }
+
+ MPX_DEBUG(_L("VideoPlayerEngine::shouldActivateCollectionView() return %d"), result);
+
return result;
}
--- a/videoplayerapp/videoplayerengine/src/videoserviceplay.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videoplayerapp/videoplayerengine/src/videoserviceplay.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#5 %
+// Version : %version: da1mmcf#6 %
#include "videoservices.h"
#include "videoserviceplay.h"
@@ -28,7 +28,7 @@
// -------------------------------------------------------------------------------------------------
//
VideoServicePlay::VideoServicePlay( VideoServices* parent,
- QVideoPlayerEngine* engine,
+ VideoPlayerEngine* engine,
QLatin1String service )
: XQServiceProvider( service, parent )
, mEngine( engine )
@@ -51,7 +51,7 @@
// setEngine()
// -------------------------------------------------------------------------------------------------
//
-void VideoServicePlay::setEngine( QVideoPlayerEngine* engine )
+void VideoServicePlay::setEngine( VideoPlayerEngine* engine )
{
MPX_DEBUG(_L("VideoServicePlay::setEngine()"));
mEngine = engine;
--- a/videoplayerapp/videoplayerengine/src/videoservices.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videoplayerapp/videoplayerengine/src/videoservices.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#8 %
+// Version : %version: da1mmcf#9 %
#include "videoplayerengine.h"
#include "videoservices.h"
@@ -29,11 +29,11 @@
VideoServices *VideoServices::mInstance = 0;
-// -----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// VideoServices::instance()
-// -----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
-VideoServices* VideoServices::instance(QVideoPlayerEngine* engine)
+VideoServices* VideoServices::instance( VideoPlayerEngine* engine )
{
MPX_ENTER_EXIT(_L("VideoServices::instance()"));
@@ -50,9 +50,9 @@
return mInstance;
}
-// -----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// VideoServices::decreaseReferenceCount()
-// -----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
void VideoServices::decreaseReferenceCount()
{
@@ -60,7 +60,7 @@
if ( mInstance )
{
- if( --mInstance->mReferenceCount == 0 )
+ if ( --mInstance->mReferenceCount == 0 )
{
delete mInstance;
mInstance = NULL;
@@ -68,11 +68,11 @@
}
}
-// ----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// setEngine()
-// ----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
-void VideoServices::setEngine(QVideoPlayerEngine* engine)
+void VideoServices::setEngine( VideoPlayerEngine* engine )
{
MPX_ENTER_EXIT(_L("VideoServices::setEngine()"));
@@ -90,22 +90,22 @@
}
-// ----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// engine()
-// ----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
-QVideoPlayerEngine* VideoServices::engine()
+VideoPlayerEngine* VideoServices::engine()
{
MPX_DEBUG(_L("VideoServices::engine"));
return mEngine;
}
-// ----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// VideoServices()
-// ----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
-VideoServices::VideoServices( QVideoPlayerEngine* engine )
+VideoServices::VideoServices( VideoPlayerEngine* engine )
: mReferenceCount( 0 )
, mEngine( engine )
, mCurrentService( VideoServices::ENoService )
@@ -113,27 +113,58 @@
{
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
+ // New service, new interface
+ 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") );
- 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
+ // New service, new interface
+ mServiceBrowse = new VideoServiceBrowse( this,
+ QLatin1String("videoplayer.com.nokia.symbian.IVideoBrowse") );
+
+ // New service, old interface
+ mServicePlayDeprecatedNewService = new VideoServicePlay( this, engine,
+ QLatin1String("videoplayer.IVideoView") );
+
+ // Old service, old interface
+ mServicePlayDeprecatedOldService = new VideoServicePlay( this, engine,
+ QLatin1String("com.nokia.Videos.IVideoView") );
- 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
+ // New service, old interface
+ mServiceViewDeprecatedNewService = new VideoServiceView( this, engine,
+ QLatin1String("videoplayer.IFileView") );
+
+ // Old service, old interface
+ mServiceViewDeprecatedOldService = new VideoServiceView( this, engine,
+ QLatin1String("com.nokia.Videos.IFileView") );
- mServiceUriFetchDeprecatedNewService = new VideoServiceUriFetch(this, QLatin1String("videoplayer.IVideoFetch")); //New service, old interface
- mServiceUriFetchDeprecatedOldService = new VideoServiceUriFetch(this, QLatin1String("com.nokia.Videos.IVideoFetch")); //Old service, old interface
+ // New service, old interface
+ mServiceUriFetchDeprecatedNewService = new VideoServiceUriFetch( this,
+ QLatin1String("videoplayer.IVideoFetch") );
+
+ // Old service, old interface
+ mServiceUriFetchDeprecatedOldService = new VideoServiceUriFetch( this,
+ QLatin1String("com.nokia.Videos.IVideoFetch") );
- mServiceBrowseDeprecatedNewService = new VideoServiceBrowse(this, QLatin1String("videoplayer.IVideoBrowse")); //New service, old interface
- mServiceBrowseDeprecatedOldService = new VideoServiceBrowse(this, QLatin1String("com.nokia.Videos.IVideoBrowse")); //Old service, old interface
+ // New service, old interface
+ mServiceBrowseDeprecatedNewService = new VideoServiceBrowse( this,
+ QLatin1String("videoplayer.IVideoBrowse")) ;
+
+ // Old service, old interface
+ mServiceBrowseDeprecatedOldService = new VideoServiceBrowse( this,
+ QLatin1String("com.nokia.Videos.IVideoBrowse") );
}
-// ----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// ~VideoServices()
-// ----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
VideoServices::~VideoServices()
{
@@ -153,9 +184,9 @@
delete mServiceUriFetchDeprecatedOldService;
}
-// ----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// currentService()
-// ----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
VideoServices::TVideoService VideoServices::currentService()
{
@@ -164,9 +195,9 @@
return mCurrentService;
}
-// ----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// getBrowseCategory()
-// ----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
int VideoServices::getBrowseCategory() const
{
@@ -174,28 +205,30 @@
int category = 0;
- if ( mServiceBrowse && (XQServiceUtil::interfaceName().contains("symbian")))
+ if ( mServiceBrowse && ( XQServiceUtil::interfaceName().contains("symbian") ) )
{
category = mServiceBrowse->getBrowseCategory();
}
- else if ( mServiceBrowseDeprecatedNewService && mServiceBrowseDeprecatedOldService && !(XQServiceUtil::interfaceName().contains("symbian")))
+ else if ( mServiceBrowseDeprecatedNewService &&
+ mServiceBrowseDeprecatedOldService &&
+ ! ( XQServiceUtil::interfaceName().contains("symbian") ) )
{
- if (mServiceBrowseDeprecatedNewService->isActive())
+ if ( mServiceBrowseDeprecatedNewService->isActive() )
{
- category = mServiceBrowseDeprecatedNewService->getBrowseCategory();
+ category = mServiceBrowseDeprecatedNewService->getBrowseCategory();
}
else
{
- category = mServiceBrowseDeprecatedOldService->getBrowseCategory();
+ category = mServiceBrowseDeprecatedOldService->getBrowseCategory();
}
}
return category;
}
-// ----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// setCurrentService()
-// ----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
void VideoServices::setCurrentService(VideoServices::TVideoService service)
{
@@ -204,9 +237,9 @@
mCurrentService = service;
}
-// ----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// contextTitle()
-// ----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
QString VideoServices::contextTitle() const
{
@@ -214,49 +247,54 @@
QString title;
- if (mCurrentService == VideoServices::EUriFetcher)
+ if ( mCurrentService == VideoServices::EUriFetcher )
{
- if(mServiceUriFetch && (XQServiceUtil::interfaceName().contains("symbian")))
+ if ( mServiceUriFetch && ( XQServiceUtil::interfaceName().contains("symbian") ) )
{
- title = mServiceUriFetch->contextTitle();
+ title = mServiceUriFetch->contextTitle();
}
- else if (mServiceUriFetchDeprecatedNewService && mServiceUriFetchDeprecatedOldService && !(XQServiceUtil::interfaceName().contains("symbian")))
+ else if ( mServiceUriFetchDeprecatedNewService &&
+ mServiceUriFetchDeprecatedOldService &&
+ ! ( XQServiceUtil::interfaceName().contains("symbian") ) )
{
- if(mServiceUriFetchDeprecatedNewService->isActive())
- {
- title = mServiceUriFetchDeprecatedNewService->contextTitle();
- }
- else
- {
- title = mServiceUriFetchDeprecatedOldService->contextTitle();
- }
+
+ if ( mServiceUriFetchDeprecatedNewService->isActive() )
+ {
+ title = mServiceUriFetchDeprecatedNewService->contextTitle();
+ }
+ else
+ {
+ title = mServiceUriFetchDeprecatedOldService->contextTitle();
+ }
}
}
- else if (mCurrentService == VideoServices::EBrowse)
+ else if ( mCurrentService == VideoServices::EBrowse )
{
- 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();
- }
- }
+ 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;
}
-// ----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// sortRole()
-// ----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
int VideoServices::sortRole() const
{
@@ -264,31 +302,33 @@
int sortRole = 0;
- if (mCurrentService == EBrowse)
+ if ( mCurrentService == EBrowse )
{
- 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();
- }
- }
+ 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;
}
-// ----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// itemSelected()
-// ----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
void VideoServices::itemSelected(const QString& item)
{
@@ -298,47 +338,50 @@
QStringList list;
list.append( item );
- if(mServiceUriFetch && (XQServiceUtil::interfaceName().contains("symbian")))
+ if( mServiceUriFetch && ( XQServiceUtil::interfaceName().contains("symbian") ) )
{
mServiceUriFetch->complete( list );
}
- else if (mServiceUriFetchDeprecatedNewService && mServiceUriFetchDeprecatedOldService)
+ else if ( mServiceUriFetchDeprecatedNewService && mServiceUriFetchDeprecatedOldService )
{
- if (mServiceUriFetchDeprecatedNewService->isActive())
+ if ( mServiceUriFetchDeprecatedNewService->isActive() )
{
- mServiceUriFetchDeprecatedNewService->complete( list );
+ mServiceUriFetchDeprecatedNewService->complete( list );
}
else
{
- mServiceUriFetchDeprecatedOldService->complete( list );
+ mServiceUriFetchDeprecatedOldService->complete( list );
}
}
+
mFetchSelected = true;
}
-// ----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// browsingEnded()
-// ----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
void VideoServices::browsingEnded()
{
MPX_ENTER_EXIT(_L("VideoServices::browsingEnded()"));
- if ( mServiceBrowse && (XQServiceUtil::interfaceName().contains("symbian")))
- {
- mServiceBrowse->complete();
- }
- else if ( mServiceBrowseDeprecatedNewService && mServiceBrowseDeprecatedOldService && !(XQServiceUtil::interfaceName().contains("symbian")))
- {
- if (mServiceBrowseDeprecatedNewService->isActive())
+ if ( mServiceBrowse && ( XQServiceUtil::interfaceName().contains("symbian") ) )
+ {
+ mServiceBrowse->complete();
+ }
+ else if ( mServiceBrowseDeprecatedNewService &&
+ mServiceBrowseDeprecatedOldService &&
+ ! ( XQServiceUtil::interfaceName().contains("symbian") ) )
+ {
+ if ( mServiceBrowseDeprecatedNewService->isActive() )
{
- mServiceBrowseDeprecatedNewService->complete();
+ mServiceBrowseDeprecatedNewService->complete();
}
else
{
- mServiceBrowseDeprecatedOldService->complete();
+ mServiceBrowseDeprecatedOldService->complete();
}
- }
+ }
}
// End of file
--- a/videoplayerapp/videoplayerengine/src/videoserviceview.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videoplayerapp/videoplayerengine/src/videoserviceview.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 4 %
+// Version : %version: 5 %
#include "videoservices.h"
#include "videoserviceview.h"
@@ -27,7 +27,7 @@
// -------------------------------------------------------------------------------------------------
//
VideoServiceView::VideoServiceView( VideoServices* parent,
- QVideoPlayerEngine* engine,
+ VideoPlayerEngine* engine,
QLatin1String service )
: XQServiceProvider( service, parent )
, mEngine( engine )
@@ -50,10 +50,10 @@
// setEngine()
// -------------------------------------------------------------------------------------------------
//
-void VideoServiceView::setEngine( QVideoPlayerEngine* engine )
+void VideoServiceView::setEngine( VideoPlayerEngine* engine )
{
MPX_ENTER_EXIT(_L("VideoServiceView::setEngine()"));
- mEngine = engine;
+ mEngine = engine;
}
// -------------------------------------------------------------------------------------------------
@@ -65,9 +65,9 @@
MPX_ENTER_EXIT(_L("VideoServiceView::view( QString ) "),
_L("file = %s"), file.data() );
- if(mEngine)
+ if ( mEngine )
{
- mServiceApp->setCurrentService(VideoServices::EView);
+ mServiceApp->setCurrentService( VideoServices::EView );
mEngine->playMedia( file );
}
@@ -85,7 +85,7 @@
RFile rFile;
bool handleOK = file.getHandle( rFile );
- mServiceApp->setCurrentService(VideoServices::EView);
+ mServiceApp->setCurrentService( VideoServices::EView );
if ( mEngine)
{
@@ -99,7 +99,7 @@
}
}
- return true;
+ return true;
}
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoappuiengine/inc/testvideoappuiengine.h Fri Jul 02 17:14:33 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoappuiengine/inc/testvideoappuiengine.h Thu Jul 08 13:05:19 2010 +0300
@@ -22,6 +22,7 @@
// missing test functions:
// - how to setup construction to fail for testing purposes
+// Version : %version: %
#ifndef __TESTVIDEOAPPUIENGINE_H__
#define __TESTVIDEOAPPUIENGINE_H__
@@ -33,13 +34,6 @@
#include <e32def.h>
#include <mpxmessage2.h>
-//typedef struct
-//{
-// TInt iEvent;
-// TInt iData;
-// TInt iError;
-//} TCallbackEvent;
-
enum TActivationCommands
{
EProcessTail,
@@ -102,81 +96,76 @@
class MAppUiEngineUnitTestObserver
{
public:
- virtual void HandleUtilityEvent( TCallbackEvent* aEvent ) = 0;
+ virtual void HandleUtilityEvent( TCallbackEvent* aEvent ) = 0;
};
-class QMpxVideoPlaybackWrapper;
+class VideoPlaybackWrapper;
class CMpxVideoPlayerAppUiEngine;
class MMPXPlaybackUtility;
class CMPXCollectionUtility;
class TestVideoAppUiEngine : public QObject,
public MAppUiEngineUnitTestObserver
- {
+{
Q_OBJECT
-public: // Constructor / destructor
+ public:
- /**
- * Contructor.
- *
- */
- TestVideoAppUiEngine();
+ //
+ // Constructor
+ //
+ TestVideoAppUiEngine();
- /**
- * Destructor.
- *
- */
- virtual ~TestVideoAppUiEngine();
+ //
+ // Destructor
+ //
+ virtual ~TestVideoAppUiEngine();
- //
- // MAppUiEngineStifTestObserver Implementation
- //
- void HandleUtilityEvent( TCallbackEvent* aEvent );
+ //
+ // MAppUiEngineStifTestObserver Implementation
+ //
+ void HandleUtilityEvent( TCallbackEvent* aEvent );
- CMPXMessage* CreateMpxMessageLC( int aEvent, int aType, int aData );
+ //
+ // CreateMpxMessageLC Implementation
+ //
+ CMPXMessage* CreateMpxMessageLC( int aEvent, int aType, int aData );
-private slots:
+ private slots:
- void init();
- void cleanup();
+ void init();
+ void cleanup();
- void testPlaybackUtility();
- void testOpenFile();
- void testOpenMedia();
- void testDoHandlePlaybackMessage();
- void testPrepareCloseMpx();
- void testDoHandleCollectionMedia();
- void testHandlePlaybackMessage();
- void testHandleCollectionMessage();
- void testHandleCollectionMedia();
-
- // called after last test case executed
- void cleanupTestCase();
+ void testPlaybackUtility();
+ void testOpenFile();
+ void testOpenMedia();
+ void testDoHandlePlaybackMessage();
+ void testPrepareCloseMpx();
+ void testDoHandleCollectionMedia();
+ void testHandlePlaybackMessage();
+ void testHandleCollectionMessage();
+ void testHandleCollectionMedia();
-signals:
+ // called after last test case executed
+ void cleanupTestCase();
- void aboutToQuit();
+ signals:
-private:
+ void aboutToQuit();
+
+ private:
- CMpxVideoPlayerAppUiEngine* mTestObject;
-
- QMpxVideoPlaybackWrapper* mPlaybackWrapper;
-
- //CCallbackEventArray* mExpectedEventArray;
-
- int mError;
-
- TCallbackEvent* mExpectedEvent;
-
- bool mTestResult;
-
- MMPXPlaybackUtility* mPlaybackUtility;
- CMPXCollectionUtility* mCollectionUtility;
+ CMpxVideoPlayerAppUiEngine* mTestObject;
+ VideoPlaybackWrapper* mPlaybackWrapper;
+ MMPXPlaybackUtility* mPlaybackUtility;
+ CMPXCollectionUtility* mCollectionUtility;
+
+ int mError;
+ TCallbackEvent* mExpectedEvent;
+ bool mTestResult;
};
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoappuiengine/src/testvideoappuiengine.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoappuiengine/src/testvideoappuiengine.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -11,11 +11,11 @@
*
* Contributors:
*
-* Description: Videoplayerengine test class implementation.
+* Description: VideoAppUiEngine test class implementation.
*
*/
-// Version : %version: %
+// Version : %version: 3 %
// INCLUDES
#include <QtTest/QtTest>
@@ -35,7 +35,7 @@
#include "stub/inc/hbinstance.h"
#include "mpxhbvideocommondefs.h"
#include "testvideoappuiengine.h"
-#include "../stub/inc/mpxvideoplaybackwrapper.h"
+#include "../stub/inc/videoplaybackwrapper.h"
#define private public
#include "mpxvideoplayerappuiengine.h"
#undef private
@@ -64,7 +64,7 @@
TestVideoAppUiEngine::TestVideoAppUiEngine()
- : mTestObject(0)
+ : mTestObject( 0 )
{
MPX_DEBUG(_L("TestVideoAppUiEngine::TestVideoAppUiEngine()"));
}
@@ -77,8 +77,7 @@
mTestObject = 0;
delete mPlaybackWrapper;
- mPlaybackWrapper = 0;
-
+ mPlaybackWrapper = 0;
TestUtilities* utility = reinterpret_cast<TestUtilities*>( UserSvr::DllTls(12345678) );
utility->iPlaybackUtility->RemoveTestObserverL();
@@ -92,17 +91,17 @@
mTestResult = false;
- mPlaybackWrapper = new QMpxVideoPlaybackWrapper();
+ mPlaybackWrapper = new VideoPlaybackWrapper();
TRAPD( createErr, mTestObject = CMpxVideoPlayerAppUiEngine::NewL( mPlaybackWrapper ) );
- QVERIFY( !createErr );
+ QVERIFY( ! createErr );
QVERIFY( mTestObject->iCollectionUtility );
TRAPD( initErr, mTestObject->LateInitL() );
- QVERIFY( !initErr );
+ QVERIFY( ! initErr );
TestUtilities* utility = reinterpret_cast<TestUtilities*>( UserSvr::DllTls(12345678) );
@@ -120,6 +119,7 @@
mPlaybackWrapper = 0;
TestUtilities* utility = reinterpret_cast<TestUtilities*>( UserSvr::DllTls(12345678) );
+
if ( utility )
{
utility->iPlaybackUtility->RemoveTestObserverL();
@@ -152,21 +152,21 @@
mExpectedEvent = new (ELeave) TCallbackEvent;
mExpectedEvent->iEvent = EPlaybackUtilityInitFileName;
TRAPD( openFileErr, mTestObject->OpenFileL( KTestLocalFilename ) );
- QVERIFY( !openFileErr );
+ QVERIFY( ! openFileErr );
QVERIFY( mTestResult );
// Test for streaming link
mExpectedEvent = new (ELeave) TCallbackEvent;
mExpectedEvent->iEvent = EPlaybackUtilityInitStreamingUrl;
TRAPD( openRamFileErr, mTestObject->OpenFileL( KTestRamFilename ) );
- QVERIFY( !openRamFileErr );
+ QVERIFY( ! openRamFileErr );
QVERIFY( mTestResult );
// Test for a url
mExpectedEvent = new (ELeave) TCallbackEvent;
mExpectedEvent->iEvent = EPlaybackUtilityInitStreamingUrl;
TRAPD( openUrlErr, mTestObject->OpenFileL( KTestRtspUrl ) );
- QVERIFY( !openUrlErr );
+ QVERIFY( ! openUrlErr );
QVERIFY( mTestResult );
}
@@ -186,7 +186,7 @@
mExpectedEvent->iEvent = EPlaybackUtilityInitPlaylist;
TRAPD( err, mTestObject->OpenMediaL( *media ) );
- QVERIFY( !err );
+ QVERIFY( ! err );
QVERIFY( mTestResult );
}
@@ -198,13 +198,13 @@
init();
QSignalSpy spy( mPlaybackWrapper, SIGNAL(handlePlaybackView(int)) );
- QCOMPARE(spy.count(), 0);
+ QCOMPARE( spy.count(), 0 );
CMPXMessage* msg = CreateMpxMessageLC(TMPXPlaybackMessage::EPlayerChanged, 0, 0);
- TRAPD(err, mTestObject->DoHandlePlaybackMessageL( *msg ));
- QVERIFY( !err );
+ TRAPD( err, mTestObject->DoHandlePlaybackMessageL( *msg ));
+ QVERIFY( ! err );
- QCOMPARE(spy.count(), 1);
+ QCOMPARE( spy.count(), 1 );
spy.clear();
}
@@ -217,7 +217,7 @@
TRAPD( err, mTestObject->PrepareCloseMpxL() );
- QVERIFY( !err );
+ QVERIFY( ! err );
}
@@ -236,7 +236,7 @@
mExpectedEvent->iEvent = EPlaybackUtilityInitPlaylist;
TRAPD( err, mTestObject->DoHandelCollectionMediaL( *media ) );
- QVERIFY( !err );
+ QVERIFY( ! err );
QVERIFY( mTestResult );
}
@@ -248,14 +248,14 @@
init();
QSignalSpy spy( mPlaybackWrapper, SIGNAL(handlePlaybackView(int)) );
- QCOMPARE(spy.count(), 0);
+ QCOMPARE( spy.count(), 0 );
mTestObject->iUpdateSeekInfo = ETrue;
CMPXMessage* msg = CreateMpxMessageLC(TMPXPlaybackMessage::EPlayerChanged, 0, 0);
mTestObject->HandlePlaybackMessage( msg, KErrNone );
- QCOMPARE(spy.count(), 1);
+ QCOMPARE( spy.count(), 1 );
spy.clear();
QVERIFY( ! mTestObject->iUpdateSeekInfo );
@@ -282,7 +282,7 @@
delete msg;
msg = NULL;
- msg = CreateMpxMessageLC(4, EMcPathChangedByOpen, EMcContainerOpened);
+ msg = CreateMpxMessageLC( 4, EMcPathChangedByOpen, EMcContainerOpened );
mTestObject->HandleCollectionMessage( msg, KErrNone );
QVERIFY( mTestResult );
@@ -304,7 +304,7 @@
mExpectedEvent->iEvent = EPlaybackUtilityInitPlaylist;
TRAPD( err, mTestObject->HandleCollectionMediaL( *media, KErrNone ) );
- QVERIFY( !err );
+ QVERIFY( ! err );
QVERIFY( mTestResult );
}
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoappuiengine/stub/inc/mpxvideoplaybackwrapper.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +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: Stub implementation of QMpxVideoPlaybackWrapper
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKWRAPPER_H_
-#define MPXVIDEOPLAYBACKWRAPPER_H_
-
-#include <qobject>
-#include <qstring>
-#include <qfile>
-
-#include <mpxhbvideocommondefs.h>
-
-class QMpxVideoPlaybackWrapper : public QObject
-{
- Q_OBJECT
-
- public:
- QMpxVideoPlaybackWrapper();
- virtual ~QMpxVideoPlaybackWrapper();
- int playMedia( QString aFileName );
-
- public:
- void openPlaybackView() ;
- static int GetInstanceCount();
- void lateInit();
-
- signals:
- void handlePlaybackView( int viewId );
-
- private:
- static void Increment();
- static void Decrement();
-};
-
-#endif /* STUBMPXVIDEOPLAYBACKWRAPPER_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoappuiengine/stub/inc/videoplaybackwrapper.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,53 @@
+/*
+* 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 implementation of VideoPlaybackWrapper
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+#ifndef VIDEOPLAYBACKWRAPPER_H_
+#define VIDEOPLAYBACKWRAPPER_H_
+
+#include <qobject>
+#include <qstring>
+#include <qfile>
+
+#include <mpxhbvideocommondefs.h>
+
+class VideoPlaybackWrapper : public QObject
+{
+ Q_OBJECT
+
+ public:
+ VideoPlaybackWrapper();
+ virtual ~VideoPlaybackWrapper();
+ int playMedia( QString aFileName );
+
+ public:
+ void openPlaybackView() ;
+ static int GetInstanceCount();
+ void lateInit();
+
+ signals:
+ void handlePlaybackView( int viewId );
+
+ private:
+ static void Increment();
+ static void Decrement();
+};
+
+#endif /* VIDEOPLAYBACKWRAPPER_H_ */
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoappuiengine/stub/src/hbinstance.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoappuiengine/stub/src/hbinstance.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -15,51 +15,101 @@
*
*/
+// Version : %version: %
+
+#include <hbmainwindow.h>
+
#include "stub/inc/hbinstance.h"
-#include <hbmainwindow.h>
+#include "mpxvideo_debug.h"
bool initialised = false;
HbInstance* mInstance = 0;
QList<HbInstance *> mInstances;
+// -------------------------------------------------------------------------------------------------
+// HbInstance::HbInstancer()
+// -------------------------------------------------------------------------------------------------
+//
HbInstance::HbInstance()
{
+ MPX_DEBUG(_L("HbInstance::HbInstance()"));
}
+// -------------------------------------------------------------------------------------------------
+// HbInstance::~HbInstance()
+// -------------------------------------------------------------------------------------------------
+//
HbInstance::~HbInstance()
{
+ MPX_DEBUG(_L("HbInstance::~HbInstance()"));
}
+// -------------------------------------------------------------------------------------------------
+// HbInstance::instance()
+// -------------------------------------------------------------------------------------------------
+//
HbInstance* HbInstance::instance()
{
- if (!initialised)
+ MPX_DEBUG(_L("HbInstance::instance()"));
+
+ if ( ! initialised )
{
mInstance = new HbInstance();
initialised = true;
mInstances.append(mInstance);
}
+
+ return mInstance;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbInstance::primaryWindow()
+// -------------------------------------------------------------------------------------------------
+//
+HbInstance* HbInstance::primaryWindow() const
+{
+ MPX_DEBUG(_L("HbInstance::primaryWindow()"));
+
return mInstance;
}
-HbInstance* HbInstance::primaryWindow() const
+// -------------------------------------------------------------------------------------------------
+// HbInstance::allMainWindows()
+// -------------------------------------------------------------------------------------------------
+//
+QList<HbInstance *> HbInstance::allMainWindows() const
{
- return mInstance;
+ MPX_DEBUG(_L("HbInstance::allMainWindows()"));
+
+ return mInstances;
}
-QList<HbInstance *> HbInstance::allMainWindows() const
+// -------------------------------------------------------------------------------------------------
+// HbInstance::removeView()
+// -------------------------------------------------------------------------------------------------
+//
+void HbInstance::removeView( QGraphicsWidget* )
{
- return mInstances;
+ MPX_DEBUG(_L("HbInstance::removeView()"));
}
-void HbInstance::removeView( QGraphicsWidget* )
-{
-}
-
+// -------------------------------------------------------------------------------------------------
+// HbInstance::addView()
+// -------------------------------------------------------------------------------------------------
+//
void HbInstance::addView( QGraphicsWidget* )
{
+ MPX_DEBUG(_L("HbInstance::addView()"));
}
+// -------------------------------------------------------------------------------------------------
+// HbInstance::setCurrentView()
+// -------------------------------------------------------------------------------------------------
+//
void HbInstance::setCurrentView( HbView*, bool animation )
{
+ MPX_DEBUG(_L("HbInstance::setCurrentView()"));
+
+ Q_UNUSED( animation );
}
\ No newline at end of file
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoappuiengine/stub/src/mpxvideoplaybackwrapper.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +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: Stub-implementation of QMpxVideoPlaybackWrapper
-*
-*/
-
-// Version : %version: 1 %
-
-
-#include "mpxvideoplaybackwrapper.h"
-
-int mCount = 0;
-
-QMpxVideoPlaybackWrapper::QMpxVideoPlaybackWrapper()
-{
- QMpxVideoPlaybackWrapper::Increment();
-}
-
-QMpxVideoPlaybackWrapper::~QMpxVideoPlaybackWrapper()
-{
- QMpxVideoPlaybackWrapper::Decrement();
-}
-
-void QMpxVideoPlaybackWrapper::openPlaybackView()
-{
- emit handlePlaybackView( MpxHbVideoCommon::ActivatePlaybackView );
-}
-
-void QMpxVideoPlaybackWrapper::Increment()
-{
- ++mCount;
-}
-
-void QMpxVideoPlaybackWrapper::Decrement()
-{
- if(mCount > 0)
- {
- --mCount;
- }
-}
-
-int QMpxVideoPlaybackWrapper::GetInstanceCount()
-{
- return mCount;
-}
-
-int QMpxVideoPlaybackWrapper::playMedia( QString aFileName )
-{
- return 0;
-}
-
-void QMpxVideoPlaybackWrapper::lateInit()
-{
-}
-
-// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoappuiengine/stub/src/videoplaybackwrapper.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,116 @@
+/*
+* 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-implementation of VideoPlaybackWrapper
+*
+*/
+
+// Version : %version: 2 %
+
+
+#include "videoplaybackwrapper.h"
+#include "mpxvideo_debug.h"
+
+int mCount = 0;
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackWrapper::VideoPlaybackWrapper()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackWrapper::VideoPlaybackWrapper()
+{
+ MPX_DEBUG(_L("VideoPlaybackWrapper::VideoPlaybackWrapper()"));
+
+ VideoPlaybackWrapper::Increment();
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackWrapper::~VideoPlaybackWrapper()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackWrapper::~VideoPlaybackWrapper()
+{
+ MPX_DEBUG(_L("VideoPlaybackWrapper::~VideoPlaybackWrapper()"));
+
+ VideoPlaybackWrapper::Decrement();
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackWrapper::openPlaybackView()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackWrapper::openPlaybackView()
+{
+ MPX_DEBUG(_L("VideoPlaybackWrapper::openPlaybackView()"));
+
+ emit handlePlaybackView( MpxHbVideoCommon::ActivatePlaybackView );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackWrapper::Increment()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackWrapper::Increment()
+{
+ MPX_DEBUG(_L("VideoPlaybackWrapper::Increment()"));
+
+ ++mCount;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackWrapper::Decrement()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackWrapper::Decrement()
+{
+ MPX_DEBUG(_L("VideoPlaybackWrapper::Decrement()"));
+
+ if ( mCount > 0 )
+ {
+ --mCount;
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackWrapper::GetInstanceCount()
+// -------------------------------------------------------------------------------------------------
+//
+int VideoPlaybackWrapper::GetInstanceCount()
+{
+ MPX_DEBUG(_L("VideoPlaybackWrapper::GetInstanceCount()"));
+
+ return mCount;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackWrapper::playMedia()
+// -------------------------------------------------------------------------------------------------
+//
+int VideoPlaybackWrapper::playMedia( QString aFileName )
+{
+ MPX_DEBUG(_L("VideoPlaybackWrapper::playMedia()"));
+
+ Q_UNUSED( aFileName );
+ return 0;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackWrapper::lateInit()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackWrapper::lateInit()
+{
+ MPX_DEBUG(_L("VideoPlaybackWrapper::lateInit()"));
+}
+
+// End of File
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoappuiengine/testvideoappuiengine.pro Fri Jul 02 17:14:33 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoappuiengine/testvideoappuiengine.pro Thu Jul 08 13:05:19 2010 +0300
@@ -14,7 +14,7 @@
# Description: Project file for building Videoplayer components
#
#
-# Version : %version: 2 %
+# Version : %version: 3 %
TEMPLATE = app
@@ -35,7 +35,7 @@
-lcharconv.dll
# Input
-HEADERS += mpxvideoplaybackwrapper.h \
+HEADERS += videoplaybackwrapper.h \
testvideoappuiengine.h \
mpxcollectionutilityimp_stub.h \
mpxplaybackutilityimp_stub.h \
@@ -46,7 +46,7 @@
videoplaylistutility.h \
../../inc/mpxvideoplayerappuiengine.h
-SOURCES += mpxvideoplaybackwrapper.cpp \
+SOURCES += videoplaybackwrapper.cpp \
coneutils_stub.cpp \
mpxcollectionutility_stub.cpp \
mpxcollectionutilityimp_stub.cpp \
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/inc/testvideoplayerengine.h Fri Jul 02 17:14:33 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/inc/testvideoplayerengine.h Thu Jul 08 13:05:19 2010 +0300
@@ -23,7 +23,7 @@
// - how to setup construction to fail for testing purposes
-// Version : %version: 8 %
+// Version : %version: da1mmcf#9 %
#ifndef __TESTVIDEOPLAYERENGINE_H__
#define __TESTVIDEOPLAYERENGINE_H__
@@ -34,77 +34,77 @@
#include <qpointer.h>
class MpxViewPlugin;
-class QMpxVideoPlaybackWrapper;
-class QVideoPlayerEngine;
+class VideoPlaybackWrapper;
+class VideoPlayerEngine;
class VideoServices;
class TestVideoPlayerEngine : public QObject
- {
+{
Q_OBJECT
-public: // Constructor / destructor
+ public:
- /**
- * Contructor.
- *
- */
- TestVideoPlayerEngine();
+ /**
+ * Contructor.
+ *
+ */
+ TestVideoPlayerEngine();
- /**
- * Destructor.
- *
- */
- virtual ~TestVideoPlayerEngine();
+ /**
+ * Destructor.
+ *
+ */
+ virtual ~TestVideoPlayerEngine();
-private slots:
+ private slots:
- void init(bool isService = false);
- void cleanup();
+ void init(bool isService = false);
+ void cleanup();
- void testCreateDelete();
- void testCreateDeleteService();
+ void testCreateDelete();
+ void testCreateDeleteService();
- void testInitialize();
- void testInitializeService();
+ void testInitialize();
+ void testInitializeService();
- void testMultipleInitialize();
- void testMultipleInitializeService();
+ void testMultipleInitialize();
+ void testMultipleInitializeService();
- void testHandleCommandPreInit();
- void testHandleCommandPostInit();
- void testHandleCommandPreAndPostInit();
+ void testHandleCommandPreInit();
+ void testHandleCommandPostInit();
+ void testHandleCommandPreAndPostInit();
- void testHandleCommandPluginFail();
- void testHandleCommandPluginFail1();
- void testHandleCommandPluginFail2();
+ void testHandleCommandPluginFail();
+ void testHandleCommandPluginFail1();
+ void testHandleCommandPluginFail2();
- void testPlayMedia();
- void testSetEmbedded();
+ void testPlayMedia();
+ void testSetEmbedded();
- void testInitWithActivityData();
- void testHandleQuitWihtActivityData();
+ void testInitWithActivityData();
+ void testHandleQuitWihtActivityData();
- // called after last test case executed
- void cleanupTestCase();
+ // called after last test case executed
+ void cleanupTestCase();
-signals:
+ signals:
- void aboutToQuit();
- void command( int );
+ void aboutToQuit();
+ void command( int );
-private:
+ private:
- QPointer<QVideoPlayerEngine> mTestObject;
+ QPointer<VideoPlayerEngine> mTestObject;
- MpxViewPlugin* mCurrentViewPlugin;
- MpxViewPlugin* mPlaybackViewPlugin;
- MpxViewPlugin* mCollectionViewPlugin;
- MpxViewPlugin* mFileDetailsViewPlugin;
+ MpxViewPlugin* mCurrentViewPlugin;
+ MpxViewPlugin* mPlaybackViewPlugin;
+ MpxViewPlugin* mCollectionViewPlugin;
+ MpxViewPlugin* mFileDetailsViewPlugin;
- VideoServices* mVideoServices;
+ VideoServices* mVideoServices;
- QMpxVideoPlaybackWrapper *mPlaybackWrapper;
+ VideoPlaybackWrapper *mPlaybackWrapper;
};
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/src/testvideoplayerengine.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/src/testvideoplayerengine.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 14 %
+// Version : %version: da1mmcf#15 %
// INCLUDES
#include <QtTest/QtTest>
@@ -37,7 +37,7 @@
#include "stub/inc/videoservices.h"
#include "stub/inc/xqpluginloader.h"
#include "stub/inc/videoactivitystate.h"
-#include "../stub/inc/mpxvideoplaybackwrapper.h"
+#include "../stub/inc/videoplaybackwrapper.h"
#include "mpxvideo_debug.h"
#define private public
@@ -64,12 +64,12 @@
TestVideoPlayerEngine::TestVideoPlayerEngine()
- : mTestObject(0)
- , mVideoServices(0)
- , mCurrentViewPlugin(0)
- , mPlaybackViewPlugin(0)
- , mCollectionViewPlugin(0)
- , mFileDetailsViewPlugin(0)
+ : mTestObject( 0 )
+ , mVideoServices( 0 )
+ , mCurrentViewPlugin( 0 )
+ , mPlaybackViewPlugin( 0 )
+ , mCollectionViewPlugin( 0 )
+ , mFileDetailsViewPlugin( 0 )
{
MPX_DEBUG(_L("TestVideoPlayerEngine::TestVideoPlayerEngine()"));
}
@@ -80,7 +80,7 @@
XQPluginLoader::cleanup();
- if(!mTestObject.isNull())
+ if ( ! mTestObject.isNull() )
{
delete mTestObject;
}
@@ -89,7 +89,8 @@
void TestVideoPlayerEngine::init( bool isService )
{
- MPX_ENTER_EXIT(_L("TestVideoPlayerEngine::init()"));
+ MPX_ENTER_EXIT(_L("TestVideoPlayerEngine::init() "),
+ _L("isService = %d"), isService );
XQPluginLoader::mFailToLoadPluginUid = -1;
@@ -99,7 +100,7 @@
mFileDetailsViewPlugin = 0;
mVideoServices = 0;
- mTestObject = new QVideoPlayerEngine(isService);
+ mTestObject = new VideoPlayerEngine( isService );
if ( isService )
{
@@ -119,7 +120,7 @@
mFileDetailsViewPlugin = 0;
mVideoServices = 0;
- if(!mTestObject.isNull())
+ if ( ! mTestObject.isNull() )
{
delete mTestObject;
}
@@ -128,144 +129,144 @@
void TestVideoPlayerEngine::testCreateDelete()
{
- MPX_DEBUG(_L("TestVideoServices::testCreateDelete()"));
+ MPX_ENTER_EXIT(_L("TestVideoPlayerEngine::testCreateDelete()"));
//Test object creation and deletion
- init();
+ init();
- QVERIFY(!mTestObject.isNull());
+ QVERIFY( ! mTestObject.isNull() );
- QVERIFY(mTestObject->mCurrentViewPlugin == 0);
- QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
- QVERIFY(mTestObject->mCollectionViewPlugin == 0);
- QVERIFY(mTestObject->mFileDetailsViewPlugin == 0);
- QVERIFY(mTestObject->mPlaybackWrapper == 0);
- QVERIFY(mTestObject->mVideoServices == 0);
- QVERIFY(mTestObject->mIsService == false);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin == 0 );
+ QVERIFY( mTestObject->mPlaybackViewPlugin == 0 );
+ QVERIFY( mTestObject->mCollectionViewPlugin == 0 );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin == 0 );
+ QVERIFY( mTestObject->mPlaybackWrapper == 0 );
+ QVERIFY( mTestObject->mVideoServices == 0 );
+ QVERIFY( mTestObject->mIsService == false );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
cleanup();
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( VideoServices::mReferenceCount == 0 );
}
void TestVideoPlayerEngine::testCreateDeleteService()
{
- MPX_DEBUG(_L("TestVideoServices::testCreateDeleteService()"));
+ MPX_ENTER_EXIT(_L("TestVideoPlayerEngine::testCreateDeleteService()"));
//Test object creation and deletion
- init(true);
+ init( true );
- QVERIFY(!mTestObject.isNull());
+ QVERIFY( ! mTestObject.isNull() );
- QVERIFY(mTestObject->mCurrentViewPlugin == 0);
- QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
- QVERIFY(mTestObject->mCollectionViewPlugin == 0);
- QVERIFY(mTestObject->mFileDetailsViewPlugin == 0);
- QVERIFY(mTestObject->mPlaybackWrapper == 0);
- QVERIFY(mTestObject->mVideoServices == 0);
- QVERIFY(mTestObject->mIsService == true);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin == 0 );
+ QVERIFY( mTestObject->mPlaybackViewPlugin == 0 );
+ QVERIFY( mTestObject->mCollectionViewPlugin == 0 );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin == 0 );
+ QVERIFY( mTestObject->mPlaybackWrapper == 0 );
+ QVERIFY( mTestObject->mVideoServices == 0 );
+ QVERIFY( mTestObject->mIsService == true );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
cleanup();
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( VideoServices::mReferenceCount == 0 );
}
void TestVideoPlayerEngine::testInitialize()
{
- MPX_DEBUG(_L("TestVideoServices::testInitialize()"));
+ MPX_ENTER_EXIT(_L("TestVideoServices::testInitialize()"));
init();
- QVERIFY(!mTestObject.isNull());
- QVERIFY(mTestObject->mCurrentViewPlugin == 0);
- QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
- QVERIFY(mTestObject->mCollectionViewPlugin == 0);
- QVERIFY(mTestObject->mFileDetailsViewPlugin == 0);
- QVERIFY(mTestObject->mPlaybackWrapper == 0);
- QVERIFY(mTestObject->mVideoServices == 0);
- QVERIFY(mTestObject->mIsService == false);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( ! mTestObject.isNull() );
+ QVERIFY( mTestObject->mCurrentViewPlugin == 0 );
+ QVERIFY( mTestObject->mPlaybackViewPlugin == 0 );
+ QVERIFY( mTestObject->mCollectionViewPlugin == 0 );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin == 0 );
+ QVERIFY( mTestObject->mPlaybackWrapper == 0 );
+ QVERIFY( mTestObject->mVideoServices == 0 );
+ QVERIFY( mTestObject->mIsService == false );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
mTestObject->initialize();
- QVERIFY(mTestObject->mCurrentViewPlugin != 0);
- QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
- QVERIFY(mTestObject->mCollectionViewPlugin != 0);
- QVERIFY(mTestObject->mFileDetailsViewPlugin == 0);
- QVERIFY(mTestObject->mPlaybackWrapper != 0);
- QVERIFY(mTestObject->mVideoServices == 0);
- QVERIFY(mTestObject->mIsService == false);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin != 0 );
+ QVERIFY( mTestObject->mPlaybackViewPlugin == 0 );
+ QVERIFY( mTestObject->mCollectionViewPlugin != 0 );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin == 0 );
+ QVERIFY( mTestObject->mPlaybackWrapper != 0 );
+ QVERIFY( mTestObject->mVideoServices == 0 );
+ QVERIFY( mTestObject->mIsService == false );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
- QVERIFY(mTestObject->mCollectionViewPlugin != mTestObject->mPlaybackViewPlugin);
- QVERIFY(mTestObject->mCollectionViewPlugin != mTestObject->mFileDetailsViewPlugin);
+ QVERIFY( mTestObject->mCollectionViewPlugin != mTestObject->mPlaybackViewPlugin );
+ QVERIFY( mTestObject->mCollectionViewPlugin != mTestObject->mFileDetailsViewPlugin );
cleanup();
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( VideoServices::mReferenceCount == 0 );
}
void TestVideoPlayerEngine::testInitializeService()
{
- MPX_DEBUG(_L("TestVideoServices::testInitializeService()"));
+ MPX_ENTER_EXIT(_L("TestVideoPlayerEngine::testInitializeService()"));
- init(true);
+ init( true );
- QVERIFY(!mTestObject.isNull());
- QVERIFY(mTestObject->mCurrentViewPlugin == 0);
- QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
- QVERIFY(mTestObject->mCollectionViewPlugin == 0);
- QVERIFY(mTestObject->mFileDetailsViewPlugin == 0);
- QVERIFY(mTestObject->mPlaybackWrapper == 0);
- QVERIFY(mTestObject->mVideoServices == 0);
- QVERIFY(mTestObject->mIsService == true);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( ! mTestObject.isNull() );
+ QVERIFY( mTestObject->mCurrentViewPlugin == 0 );
+ QVERIFY( mTestObject->mPlaybackViewPlugin == 0 );
+ QVERIFY( mTestObject->mCollectionViewPlugin == 0 );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin == 0 );
+ QVERIFY( mTestObject->mPlaybackWrapper == 0 );
+ QVERIFY( mTestObject->mVideoServices == 0 );
+ QVERIFY( mTestObject->mIsService == true );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
mTestObject->initialize();
- QVERIFY(mTestObject->mCurrentViewPlugin == 0);
- QVERIFY(mTestObject->mPlaybackViewPlugin != 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->mCurrentViewPlugin == 0 );
+ QVERIFY( mTestObject->mPlaybackViewPlugin != 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->mPlaybackViewPlugin );
cleanup();
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( VideoServices::mReferenceCount == 0 );
}
void TestVideoPlayerEngine::testMultipleInitialize()
{
- MPX_DEBUG(_L("TestVideoServices::testMultipleInitialize()"));
+ MPX_ENTER_EXIT(_L("TestVideoPlayerEngine::testMultipleInitialize()"));
- init();
+ init();
- QVERIFY(!mTestObject.isNull());
- QVERIFY(mTestObject->mCurrentViewPlugin == 0);
- QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
- QVERIFY(mTestObject->mCollectionViewPlugin == 0);
- QVERIFY(mTestObject->mFileDetailsViewPlugin == 0);
- QVERIFY(mTestObject->mVideoServices == 0);
- QVERIFY(mTestObject->mIsService == false);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( ! mTestObject.isNull() );
+ QVERIFY( mTestObject->mCurrentViewPlugin == 0 );
+ QVERIFY( mTestObject->mPlaybackViewPlugin == 0 );
+ QVERIFY( mTestObject->mCollectionViewPlugin == 0 );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin == 0 );
+ QVERIFY( mTestObject->mVideoServices == 0 );
+ QVERIFY( mTestObject->mIsService == false );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
mTestObject->initialize();
- QVERIFY(mTestObject->mCurrentViewPlugin != 0);
- QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
- QVERIFY(mTestObject->mCollectionViewPlugin != 0);
- QVERIFY(mTestObject->mFileDetailsViewPlugin == 0);
- QVERIFY(mTestObject->mVideoServices == 0);
- QVERIFY(mTestObject->mIsService == false);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin != 0 );
+ QVERIFY( mTestObject->mPlaybackViewPlugin == 0 );
+ QVERIFY( mTestObject->mCollectionViewPlugin != 0 );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin == 0 );
+ QVERIFY( mTestObject->mVideoServices == 0 );
+ QVERIFY( mTestObject->mIsService == false );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
mCurrentViewPlugin = mTestObject->mCurrentViewPlugin;
mPlaybackViewPlugin = mTestObject->mPlaybackViewPlugin;
@@ -274,41 +275,42 @@
mTestObject->initialize();
- QVERIFY(mCurrentViewPlugin == mTestObject->mCurrentViewPlugin);
- QVERIFY(mPlaybackViewPlugin == mTestObject->mPlaybackViewPlugin);
- QVERIFY(mCollectionViewPlugin == mTestObject->mCollectionViewPlugin);
- QVERIFY(mFileDetailsViewPlugin == mTestObject->mFileDetailsViewPlugin);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( mCurrentViewPlugin == mTestObject->mCurrentViewPlugin );
+ QVERIFY( mPlaybackViewPlugin == mTestObject->mPlaybackViewPlugin );
+ QVERIFY( mCollectionViewPlugin == mTestObject->mCollectionViewPlugin );
+ QVERIFY( mFileDetailsViewPlugin == mTestObject->mFileDetailsViewPlugin );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
cleanup();
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( VideoServices::mReferenceCount == 0 );
}
+
void TestVideoPlayerEngine::testMultipleInitializeService()
{
- MPX_DEBUG(_L("TestVideoServices::testMultipleInitializeService()"));
+ MPX_ENTER_EXIT(_L("TestVideoPlayerEngine::testMultipleInitializeService()"));
- init(true);
+ init(true);
- QVERIFY(!mTestObject.isNull());
- QVERIFY(mTestObject->mCurrentViewPlugin == 0);
- QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
- QVERIFY(mTestObject->mCollectionViewPlugin == 0);
- QVERIFY(mTestObject->mFileDetailsViewPlugin == 0);
- QVERIFY(mTestObject->mVideoServices == 0);
- QVERIFY(mTestObject->mIsService == true);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( ! mTestObject.isNull() );
+ QVERIFY( mTestObject->mCurrentViewPlugin == 0 );
+ QVERIFY( mTestObject->mPlaybackViewPlugin == 0 );
+ QVERIFY( mTestObject->mCollectionViewPlugin == 0 );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin == 0 );
+ QVERIFY( mTestObject->mVideoServices == 0 );
+ QVERIFY( mTestObject->mIsService == true );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
mTestObject->initialize();
- QVERIFY(mTestObject->mCurrentViewPlugin == 0);
- QVERIFY(mTestObject->mPlaybackViewPlugin != 0);
- QVERIFY(mTestObject->mCollectionViewPlugin == 0);
- QVERIFY(mTestObject->mFileDetailsViewPlugin == 0);
- QVERIFY(mTestObject->mVideoServices != 0);
- QVERIFY(mTestObject->mIsService == true);
- QVERIFY(VideoServices::mReferenceCount == 1);
+ QVERIFY( mTestObject->mCurrentViewPlugin == 0 );
+ QVERIFY( mTestObject->mPlaybackViewPlugin != 0 );
+ QVERIFY( mTestObject->mCollectionViewPlugin == 0 );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin == 0 );
+ QVERIFY( mTestObject->mVideoServices != 0);
+ QVERIFY( mTestObject->mIsService == true );
+ QVERIFY( VideoServices::mReferenceCount == 1 );
mCurrentViewPlugin = mTestObject->mCurrentViewPlugin;
mPlaybackViewPlugin = mTestObject->mPlaybackViewPlugin;
@@ -318,523 +320,524 @@
mTestObject->initialize();
- QVERIFY(mCurrentViewPlugin == mTestObject->mCurrentViewPlugin);
- QVERIFY(mPlaybackViewPlugin == mTestObject->mPlaybackViewPlugin);
- QVERIFY(mCollectionViewPlugin == mTestObject->mCollectionViewPlugin);
- QVERIFY(mFileDetailsViewPlugin == mTestObject->mFileDetailsViewPlugin);
- QVERIFY(mVideoServices == mTestObject->mVideoServices);
- QVERIFY(VideoServices::mReferenceCount == 1);
+ QVERIFY( mCurrentViewPlugin == mTestObject->mCurrentViewPlugin );
+ QVERIFY( mPlaybackViewPlugin == mTestObject->mPlaybackViewPlugin );
+ QVERIFY( mCollectionViewPlugin == mTestObject->mCollectionViewPlugin );
+ QVERIFY( mFileDetailsViewPlugin == mTestObject->mFileDetailsViewPlugin );
+ QVERIFY( mVideoServices == mTestObject->mVideoServices );
+ QVERIFY( VideoServices::mReferenceCount == 1 );
cleanup();
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( VideoServices::mReferenceCount == 0 );
}
void TestVideoPlayerEngine::testHandleCommandPreInit()
{
- MPX_DEBUG(_L("TestVideoServices::testHandleCommandPreInit()"));
+ MPX_ENTER_EXIT(_L("TestVideoPlayerEngine::testHandleCommandPreInit()"));
- init();
+ init();
- QVERIFY(!mTestObject.isNull());
+ QVERIFY( ! mTestObject.isNull() );
- QVERIFY(mTestObject->mCurrentViewPlugin == 0);
- QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
- QVERIFY(mTestObject->mCollectionViewPlugin == 0);
- QVERIFY(mTestObject->mFileDetailsViewPlugin == 0);
- QVERIFY(mTestObject->mIsService == false);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin == 0 );
+ QVERIFY( mTestObject->mPlaybackViewPlugin == 0 );
+ QVERIFY( mTestObject->mCollectionViewPlugin == 0 );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin == 0 );
+ QVERIFY( mTestObject->mIsService == false );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
- mTestObject->handleCommand(MpxHbVideoCommon::ActivateCollectionView);
- mTestObject->handleCommand(MpxHbVideoCommon::ActivatePlaybackView);
- mTestObject->handleCommand(MpxHbVideoCommon::ActivateVideoDetailsView);
+ mTestObject->handleCommand( MpxHbVideoCommon::ActivateCollectionView );
+ mTestObject->handleCommand( MpxHbVideoCommon::ActivatePlaybackView );
+ mTestObject->handleCommand( MpxHbVideoCommon::ActivateVideoDetailsView );
- QVERIFY(mTestObject->mCurrentViewPlugin == mTestObject->mFileDetailsViewPlugin);
- QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
- QVERIFY(mTestObject->mCollectionViewPlugin == 0);
- QVERIFY(mTestObject->mFileDetailsViewPlugin == 0);
- QVERIFY(mTestObject->mIsService == false);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin == mTestObject->mFileDetailsViewPlugin );
+ QVERIFY( mTestObject->mPlaybackViewPlugin == 0 );
+ QVERIFY( mTestObject->mCollectionViewPlugin == 0 );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin == 0 );
+ QVERIFY( mTestObject->mIsService == false );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
cleanup();
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( VideoServices::mReferenceCount == 0 );
}
void TestVideoPlayerEngine::testHandleCommandPostInit()
{
- MPX_DEBUG(_L("TestVideoServices::testHandleCommandPostInit()"));
+ MPX_ENTER_EXIT(_L("TestVideoPlayerEngine::testHandleCommandPostInit()"));
init();
- QVERIFY(!mTestObject.isNull());
+ QVERIFY( ! mTestObject.isNull() );
- QVERIFY(mTestObject->mCurrentViewPlugin == 0);
- QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
- QVERIFY(mTestObject->mCollectionViewPlugin == 0);
- QVERIFY(mTestObject->mFileDetailsViewPlugin == 0);
- QVERIFY(mTestObject->mIsService == false);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin == 0 );
+ QVERIFY( mTestObject->mPlaybackViewPlugin == 0 );
+ QVERIFY( mTestObject->mCollectionViewPlugin == 0 );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin == 0 );
+ QVERIFY( mTestObject->mIsService == false );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
mTestObject->initialize();
- QVERIFY(mTestObject->mCurrentViewPlugin != 0);
- QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
- QVERIFY(mTestObject->mCollectionViewPlugin != 0);
- QVERIFY(mTestObject->mFileDetailsViewPlugin == 0);
- QVERIFY(mTestObject->mIsService == false);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin != 0 );
+ QVERIFY( mTestObject->mPlaybackViewPlugin == 0 );
+ QVERIFY( mTestObject->mCollectionViewPlugin != 0 );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin == 0 );
+ QVERIFY( mTestObject->mIsService == false );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
- QVERIFY(mTestObject->mCurrentViewPlugin == mTestObject->mCollectionViewPlugin);
- mTestObject->handleCommand(MpxHbVideoCommon::DoDelayedLoad);
+ QVERIFY( mTestObject->mCurrentViewPlugin == mTestObject->mCollectionViewPlugin );
+ mTestObject->handleCommand( MpxHbVideoCommon::DoDelayedLoad );
- QVERIFY(mTestObject->mCurrentViewPlugin != 0);
- QVERIFY(mTestObject->mPlaybackViewPlugin != 0);
- QVERIFY(mTestObject->mCollectionViewPlugin != 0);
- QVERIFY(mTestObject->mFileDetailsViewPlugin != 0);
- QVERIFY(mTestObject->mIsService == false);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin != 0 );
+ QVERIFY( mTestObject->mPlaybackViewPlugin != 0 );
+ QVERIFY( mTestObject->mCollectionViewPlugin != 0 );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin != 0 );
+ QVERIFY( mTestObject->mIsService == false );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
- QVERIFY(mTestObject->mCurrentViewPlugin == mTestObject->mCollectionViewPlugin);
+ QVERIFY( mTestObject->mCurrentViewPlugin == mTestObject->mCollectionViewPlugin );
- QVERIFY(mTestObject->mCurrentViewPlugin->activated());
- QVERIFY(mTestObject->mPlaybackViewPlugin->activated() == false);
- QVERIFY(mTestObject->mCollectionViewPlugin->activated());
- QVERIFY(mTestObject->mFileDetailsViewPlugin->activated() == false);
+ QVERIFY( mTestObject->mCurrentViewPlugin->activated() );
+ QVERIFY( mTestObject->mPlaybackViewPlugin->activated() == false );
+ QVERIFY( mTestObject->mCollectionViewPlugin->activated() );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin->activated() == false );
- mTestObject->handleCommand(MpxHbVideoCommon::ActivatePlaybackView);
+ mTestObject->handleCommand(MpxHbVideoCommon::ActivatePlaybackView );
- QVERIFY(mTestObject->mCurrentViewPlugin == mTestObject->mPlaybackViewPlugin);
+ QVERIFY( mTestObject->mCurrentViewPlugin == mTestObject->mPlaybackViewPlugin );
- QVERIFY(mTestObject->mCurrentViewPlugin->activated());
- QVERIFY(mTestObject->mPlaybackViewPlugin->activated());
- QVERIFY(mTestObject->mCollectionViewPlugin->activated() == false);
- QVERIFY(mTestObject->mFileDetailsViewPlugin->activated() == false);
- QVERIFY(mTestObject->mIsService == false);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin->activated() );
+ QVERIFY( mTestObject->mPlaybackViewPlugin->activated() );
+ QVERIFY( mTestObject->mCollectionViewPlugin->activated() == false );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin->activated() == false );
+ QVERIFY( mTestObject->mIsService == false );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
- mTestObject->handleCommand(MpxHbVideoCommon::ActivateVideoDetailsView);
+ mTestObject->handleCommand( MpxHbVideoCommon::ActivateVideoDetailsView );
- QVERIFY(mTestObject->mFileDetailsViewPlugin != 0);
- QVERIFY(mTestObject->mCurrentViewPlugin == mTestObject->mFileDetailsViewPlugin);
+ QVERIFY( mTestObject->mFileDetailsViewPlugin != 0 );
+ QVERIFY( mTestObject->mCurrentViewPlugin == mTestObject->mFileDetailsViewPlugin );
- QVERIFY(mTestObject->mCurrentViewPlugin->activated());
- QVERIFY(mTestObject->mPlaybackViewPlugin->activated() == false);
- QVERIFY(mTestObject->mCollectionViewPlugin->activated() == false);
- QVERIFY(mTestObject->mFileDetailsViewPlugin->activated());
- QVERIFY(mTestObject->mIsService == false);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin->activated() );
+ QVERIFY( mTestObject->mPlaybackViewPlugin->activated() == false );
+ QVERIFY( mTestObject->mCollectionViewPlugin->activated() == false );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin->activated() );
+ QVERIFY( mTestObject->mIsService == false );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
- mTestObject->handleCommand(MpxHbVideoCommon::ActivateCollectionView);
+ mTestObject->handleCommand( MpxHbVideoCommon::ActivateCollectionView );
- QVERIFY(mTestObject->mCurrentViewPlugin == mTestObject->mCollectionViewPlugin);
+ QVERIFY( mTestObject->mCurrentViewPlugin == mTestObject->mCollectionViewPlugin );
- QVERIFY(mTestObject->mCurrentViewPlugin->activated());
- QVERIFY(mTestObject->mPlaybackViewPlugin->activated() == false);
- QVERIFY(mTestObject->mCollectionViewPlugin->activated());
- QVERIFY(mTestObject->mFileDetailsViewPlugin->activated() == false);
- QVERIFY(mTestObject->mIsService == false);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin->activated() );
+ QVERIFY( mTestObject->mPlaybackViewPlugin->activated() == false );
+ QVERIFY( mTestObject->mCollectionViewPlugin->activated() );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin->activated() == false );
+ QVERIFY( mTestObject->mIsService == false );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
mTestObject->handleCommand(MpxHbVideoCommon::ActivateCollectionView-1111);
cleanup();
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( VideoServices::mReferenceCount == 0 );
}
void TestVideoPlayerEngine::testHandleCommandPreAndPostInit()
{
- MPX_DEBUG(_L("TestVideoServices::testHandleCommandPreAndPostInit()"));
+ MPX_ENTER_EXIT(_L("TestVideoPlayerEngine::testHandleCommandPreAndPostInit()"));
init();
- QVERIFY(!mTestObject.isNull());
+ QVERIFY( ! mTestObject.isNull() );
- QVERIFY(mTestObject->mCurrentViewPlugin == 0);
- QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
- QVERIFY(mTestObject->mCollectionViewPlugin == 0);
- QVERIFY(mTestObject->mFileDetailsViewPlugin == 0);
- QVERIFY(mTestObject->mIsService == false);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin == 0 );
+ QVERIFY( mTestObject->mPlaybackViewPlugin == 0 );
+ QVERIFY( mTestObject->mCollectionViewPlugin == 0 );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin == 0 );
+ QVERIFY( mTestObject->mIsService == false );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
- mTestObject->handleCommand(MpxHbVideoCommon::ActivateCollectionView);
- mTestObject->handleCommand(MpxHbVideoCommon::ActivatePlaybackView);
- mTestObject->handleCommand(MpxHbVideoCommon::ActivateVideoDetailsView);
+ mTestObject->handleCommand( MpxHbVideoCommon::ActivateCollectionView );
+ mTestObject->handleCommand( MpxHbVideoCommon::ActivatePlaybackView );
+ mTestObject->handleCommand( MpxHbVideoCommon::ActivateVideoDetailsView );
- QVERIFY(mTestObject->mCurrentViewPlugin == mTestObject->mFileDetailsViewPlugin);
- QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
- QVERIFY(mTestObject->mCollectionViewPlugin == 0);
- QVERIFY(mTestObject->mFileDetailsViewPlugin == 0);
- QVERIFY(mTestObject->mIsService == false);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin == mTestObject->mFileDetailsViewPlugin );
+ QVERIFY( mTestObject->mPlaybackViewPlugin == 0 );
+ QVERIFY( mTestObject->mCollectionViewPlugin == 0 );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin == 0 );
+ QVERIFY( mTestObject->mIsService == false );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
mTestObject->initialize();
- QVERIFY(mTestObject->mCurrentViewPlugin != 0);
- QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
- QVERIFY(mTestObject->mCollectionViewPlugin != 0);
- QVERIFY(mTestObject->mFileDetailsViewPlugin == 0);
- QVERIFY(mTestObject->mIsService == false);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin != 0 );
+ QVERIFY( mTestObject->mPlaybackViewPlugin == 0 );
+ QVERIFY( mTestObject->mCollectionViewPlugin != 0 );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin == 0 );
+ QVERIFY( mTestObject->mIsService == false );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
- QVERIFY(mTestObject->mCurrentViewPlugin == mTestObject->mCollectionViewPlugin);
- mTestObject->handleCommand(MpxHbVideoCommon::DoDelayedLoad);
+ QVERIFY( mTestObject->mCurrentViewPlugin == mTestObject->mCollectionViewPlugin );
+ mTestObject->handleCommand( MpxHbVideoCommon::DoDelayedLoad );
- QVERIFY(mTestObject->mCurrentViewPlugin != 0);
- QVERIFY(mTestObject->mPlaybackViewPlugin != 0);
- QVERIFY(mTestObject->mCollectionViewPlugin != 0);
- QVERIFY(mTestObject->mFileDetailsViewPlugin != 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin != 0 );
+ QVERIFY( mTestObject->mPlaybackViewPlugin != 0 );
+ QVERIFY( mTestObject->mCollectionViewPlugin != 0 );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin != 0 );
- QVERIFY(mTestObject->mCurrentViewPlugin == mTestObject->mCollectionViewPlugin);
+ QVERIFY( mTestObject->mCurrentViewPlugin == mTestObject->mCollectionViewPlugin );
- QVERIFY(mTestObject->mCurrentViewPlugin->activated());
- QVERIFY(mTestObject->mPlaybackViewPlugin->activated() == false);
- QVERIFY(mTestObject->mCollectionViewPlugin->activated());
- QVERIFY(mTestObject->mFileDetailsViewPlugin->activated() == false);
- QVERIFY(mTestObject->mIsService == false);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin->activated() );
+ QVERIFY( mTestObject->mPlaybackViewPlugin->activated() == false );
+ QVERIFY( mTestObject->mCollectionViewPlugin->activated() );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin->activated() == false );
+ QVERIFY( mTestObject->mIsService == false );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
- mTestObject->handleCommand(MpxHbVideoCommon::ActivatePlaybackView);
+ mTestObject->handleCommand(MpxHbVideoCommon::ActivatePlaybackView );
- QVERIFY(mTestObject->mCurrentViewPlugin == mTestObject->mPlaybackViewPlugin);
+ QVERIFY( mTestObject->mCurrentViewPlugin == mTestObject->mPlaybackViewPlugin );
- QVERIFY(mTestObject->mCurrentViewPlugin->activated());
- QVERIFY(mTestObject->mPlaybackViewPlugin->activated());
- QVERIFY(mTestObject->mCollectionViewPlugin->activated() == false);
- QVERIFY(mTestObject->mFileDetailsViewPlugin->activated() == false);
- QVERIFY(mTestObject->mIsService == false);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin->activated() );
+ QVERIFY( mTestObject->mPlaybackViewPlugin->activated() );
+ QVERIFY( mTestObject->mCollectionViewPlugin->activated() == false );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin->activated() == false );
+ QVERIFY( mTestObject->mIsService == false );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
- mTestObject->handleCommand(MpxHbVideoCommon::ActivateVideoDetailsView);
+ mTestObject->handleCommand( MpxHbVideoCommon::ActivateVideoDetailsView );
- QVERIFY(mTestObject->mFileDetailsViewPlugin != 0);
- QVERIFY(mTestObject->mCurrentViewPlugin == mTestObject->mFileDetailsViewPlugin);
+ QVERIFY( mTestObject->mFileDetailsViewPlugin != 0 );
+ QVERIFY( mTestObject->mCurrentViewPlugin == mTestObject->mFileDetailsViewPlugin );
- QVERIFY(mTestObject->mCurrentViewPlugin->activated());
- QVERIFY(mTestObject->mPlaybackViewPlugin->activated() == false);
- QVERIFY(mTestObject->mCollectionViewPlugin->activated() == false);
- QVERIFY(mTestObject->mFileDetailsViewPlugin->activated());
- QVERIFY(mTestObject->mIsService == false);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin->activated() );
+ QVERIFY( mTestObject->mPlaybackViewPlugin->activated() == false );
+ QVERIFY( mTestObject->mCollectionViewPlugin->activated() == false );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin->activated() );
+ QVERIFY( mTestObject->mIsService == false );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
- mTestObject->handleCommand(MpxHbVideoCommon::ActivateCollectionView);
+ mTestObject->handleCommand(MpxHbVideoCommon::ActivateCollectionView );
- QVERIFY(mTestObject->mCurrentViewPlugin == mTestObject->mCollectionViewPlugin);
+ QVERIFY( mTestObject->mCurrentViewPlugin == mTestObject->mCollectionViewPlugin );
- QVERIFY(mTestObject->mCurrentViewPlugin->activated());
- QVERIFY(mTestObject->mPlaybackViewPlugin->activated() == false);
- QVERIFY(mTestObject->mCollectionViewPlugin->activated());
- QVERIFY(mTestObject->mFileDetailsViewPlugin->activated() == false);
- QVERIFY(mTestObject->mIsService == false);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin->activated() );
+ QVERIFY( mTestObject->mPlaybackViewPlugin->activated() == false );
+ QVERIFY( mTestObject->mCollectionViewPlugin->activated() );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin->activated() == false );
+ QVERIFY( mTestObject->mIsService == false );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
cleanup();
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( VideoServices::mReferenceCount == 0 );
}
void TestVideoPlayerEngine::testHandleCommandPluginFail()
{
- MPX_DEBUG(_L("TestVideoServices::testHandleCommandPluginFail()"));
+ MPX_ENTER_EXIT(_L("TestVideoPlayerEngine::testHandleCommandPluginFail()"));
init();
- QVERIFY(!mTestObject.isNull());
+ QVERIFY( !mTestObject.isNull() );
- QVERIFY(mTestObject->mCurrentViewPlugin == 0);
- QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
- QVERIFY(mTestObject->mCollectionViewPlugin == 0);
- QVERIFY(mTestObject->mFileDetailsViewPlugin == 0);
- QVERIFY(mTestObject->mIsService == false);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin == 0 );
+ QVERIFY( mTestObject->mPlaybackViewPlugin == 0 );
+ QVERIFY( mTestObject->mCollectionViewPlugin == 0 );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin == 0 );
+ QVERIFY( mTestObject->mIsService == false );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
XQPluginLoader::mFailToLoadPluginUid = MpxHbVideoCommon::KMpxVideoPluginDllFileDetailsUid;
mTestObject->initialize();
- QVERIFY(mTestObject->mCurrentViewPlugin != 0);
- QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
- QVERIFY(mTestObject->mCollectionViewPlugin != 0);
- QVERIFY(mTestObject->mFileDetailsViewPlugin == 0);
- QVERIFY(mTestObject->mIsService == false);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin != 0 );
+ QVERIFY( mTestObject->mPlaybackViewPlugin == 0 );
+ QVERIFY( mTestObject->mCollectionViewPlugin != 0 );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin == 0 );
+ QVERIFY( mTestObject->mIsService == false );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
- QVERIFY(mTestObject->mCurrentViewPlugin == mTestObject->mCollectionViewPlugin);
- mTestObject->handleCommand(MpxHbVideoCommon::DoDelayedLoad);
+ QVERIFY( mTestObject->mCurrentViewPlugin == mTestObject->mCollectionViewPlugin );
+ mTestObject->handleCommand( MpxHbVideoCommon::DoDelayedLoad );
- QVERIFY(mTestObject->mCurrentViewPlugin != 0);
- QVERIFY(mTestObject->mPlaybackViewPlugin != 0);
- QVERIFY(mTestObject->mCollectionViewPlugin != 0);
- QVERIFY(mTestObject->mFileDetailsViewPlugin == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin != 0 );
+ QVERIFY( mTestObject->mPlaybackViewPlugin != 0 );
+ QVERIFY( mTestObject->mCollectionViewPlugin != 0 );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin == 0 );
- QVERIFY(mTestObject->mCurrentViewPlugin == mTestObject->mCollectionViewPlugin);
+ QVERIFY( mTestObject->mCurrentViewPlugin == mTestObject->mCollectionViewPlugin );
- QVERIFY(mTestObject->mCurrentViewPlugin->activated());
- QVERIFY(mTestObject->mCollectionViewPlugin->activated());
- QVERIFY(mTestObject->mPlaybackViewPlugin->activated() == false);
- QVERIFY(mTestObject->mIsService == false);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin->activated() );
+ QVERIFY( mTestObject->mCollectionViewPlugin->activated() );
+ QVERIFY( mTestObject->mPlaybackViewPlugin->activated() == false );
+ QVERIFY( mTestObject->mIsService == false );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
- mTestObject->handleCommand(MpxHbVideoCommon::ActivatePlaybackView);
+ mTestObject->handleCommand( MpxHbVideoCommon::ActivatePlaybackView );
- QVERIFY(mTestObject->mCurrentViewPlugin == mTestObject->mPlaybackViewPlugin);
+ QVERIFY( mTestObject->mCurrentViewPlugin == mTestObject->mPlaybackViewPlugin );
- QVERIFY(mTestObject->mCurrentViewPlugin->activated());
- QVERIFY(mTestObject->mPlaybackViewPlugin->activated());
- QVERIFY(mTestObject->mCollectionViewPlugin->activated() == false);
+ QVERIFY( mTestObject->mCurrentViewPlugin->activated() );
+ QVERIFY( mTestObject->mPlaybackViewPlugin->activated() );
+ QVERIFY( mTestObject->mCollectionViewPlugin->activated() == false );
- QVERIFY(mTestObject->mCurrentViewPlugin != 0);
- QVERIFY(mTestObject->mPlaybackViewPlugin != 0);
- QVERIFY(mTestObject->mCollectionViewPlugin != 0);
- QVERIFY(mTestObject->mFileDetailsViewPlugin == 0);
- QVERIFY(mTestObject->mIsService == false);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin != 0);
+ QVERIFY( mTestObject->mPlaybackViewPlugin != 0);
+ QVERIFY( mTestObject->mCollectionViewPlugin != 0);
+ QVERIFY( mTestObject->mFileDetailsViewPlugin == 0);
+ QVERIFY( mTestObject->mIsService == false);
+ QVERIFY( VideoServices::mReferenceCount == 0);
mTestObject->handleCommand(MpxHbVideoCommon::ActivateVideoDetailsView);
- QVERIFY(mTestObject->mCurrentViewPlugin == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin == 0);
- QVERIFY(mTestObject->mCollectionViewPlugin->activated() == false);
- QVERIFY(mTestObject->mPlaybackViewPlugin->activated() == false);
+ QVERIFY( mTestObject->mCollectionViewPlugin->activated() == false);
+ QVERIFY( mTestObject->mPlaybackViewPlugin->activated() == false);
- QVERIFY(mTestObject->mCurrentViewPlugin == 0);
- QVERIFY(mTestObject->mPlaybackViewPlugin != 0);
- QVERIFY(mTestObject->mCollectionViewPlugin != 0);
- QVERIFY(mTestObject->mFileDetailsViewPlugin == 0);
- QVERIFY(mTestObject->mIsService == false);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin == 0 );
+ QVERIFY( mTestObject->mPlaybackViewPlugin != 0 );
+ QVERIFY( mTestObject->mCollectionViewPlugin != 0 );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin == 0 );
+ QVERIFY( mTestObject->mIsService == false );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
- mTestObject->handleCommand(MpxHbVideoCommon::ActivateCollectionView);
+ mTestObject->handleCommand(MpxHbVideoCommon::ActivateCollectionView );
- QVERIFY(mTestObject->mCurrentViewPlugin == mTestObject->mCollectionViewPlugin);
+ QVERIFY( mTestObject->mCurrentViewPlugin == mTestObject->mCollectionViewPlugin );
- QVERIFY(mTestObject->mCurrentViewPlugin->activated());
- QVERIFY(mTestObject->mCollectionViewPlugin->activated());
- QVERIFY(mTestObject->mPlaybackViewPlugin->activated() == false);
+ QVERIFY( mTestObject->mCurrentViewPlugin->activated() );
+ QVERIFY( mTestObject->mCollectionViewPlugin->activated() );
+ QVERIFY( mTestObject->mPlaybackViewPlugin->activated() == false );
- QVERIFY(mTestObject->mCurrentViewPlugin != 0);
- QVERIFY(mTestObject->mPlaybackViewPlugin != 0);
- QVERIFY(mTestObject->mCollectionViewPlugin != 0);
- QVERIFY(mTestObject->mFileDetailsViewPlugin == 0);
- QVERIFY(mTestObject->mIsService == false);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin != 0 );
+ QVERIFY( mTestObject->mPlaybackViewPlugin != 0);
+ QVERIFY( mTestObject->mCollectionViewPlugin != 0 );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin == 0 );
+ QVERIFY( mTestObject->mIsService == false );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
cleanup();
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( VideoServices::mReferenceCount == 0 );
}
void TestVideoPlayerEngine::testHandleCommandPluginFail1()
{
- MPX_DEBUG(_L("TestVideoServices::testHandleCommandPluginFail1()"));
+ MPX_ENTER_EXIT(_L("TestVideoPlayerEngine::testHandleCommandPluginFail1()"));
init();
- QVERIFY(!mTestObject.isNull());
+ QVERIFY( ! mTestObject.isNull() );
- QVERIFY(mTestObject->mCurrentViewPlugin == 0);
- QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
- QVERIFY(mTestObject->mCollectionViewPlugin == 0);
- QVERIFY(mTestObject->mFileDetailsViewPlugin == 0);
- QVERIFY(mTestObject->mIsService == false);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin == 0 );
+ QVERIFY( mTestObject->mPlaybackViewPlugin == 0 );
+ QVERIFY( mTestObject->mCollectionViewPlugin == 0 );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin == 0 );
+ QVERIFY( mTestObject->mIsService == false );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
XQPluginLoader::mFailToLoadPluginUid = MpxHbVideoCommon::KMpxVideoPluginDllCollectionUid;
mTestObject->initialize();
- QVERIFY(mTestObject->mCurrentViewPlugin == 0);
- QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
- QVERIFY(mTestObject->mCollectionViewPlugin == 0);
- QVERIFY(mTestObject->mFileDetailsViewPlugin == 0);
- QVERIFY(mTestObject->mIsService == false);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin == 0 );
+ QVERIFY( mTestObject->mPlaybackViewPlugin == 0 );
+ QVERIFY( mTestObject->mCollectionViewPlugin == 0 );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin == 0 );
+ QVERIFY( mTestObject->mIsService == false );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
- QVERIFY(mTestObject->mCurrentViewPlugin == mTestObject->mCollectionViewPlugin);
- mTestObject->handleCommand(MpxHbVideoCommon::DoDelayedLoad);
+ QVERIFY( mTestObject->mCurrentViewPlugin == mTestObject->mCollectionViewPlugin );
+ mTestObject->handleCommand( MpxHbVideoCommon::DoDelayedLoad );
- QVERIFY(mTestObject->mCurrentViewPlugin == 0);
- QVERIFY(mTestObject->mPlaybackViewPlugin != 0);
- QVERIFY(mTestObject->mCollectionViewPlugin == 0);
- QVERIFY(mTestObject->mFileDetailsViewPlugin != 0);
- QVERIFY(mTestObject->mIsService == false);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin == 0 );
+ QVERIFY( mTestObject->mPlaybackViewPlugin != 0 );
+ QVERIFY( mTestObject->mCollectionViewPlugin == 0 );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin != 0 );
+ QVERIFY( mTestObject->mIsService == false );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
- QVERIFY(mTestObject->mPlaybackViewPlugin->activated() == false);
- QVERIFY(mTestObject->mFileDetailsViewPlugin->activated() == false);
+ QVERIFY( mTestObject->mPlaybackViewPlugin->activated() == false );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin->activated() == false );
- mTestObject->handleCommand(MpxHbVideoCommon::ActivatePlaybackView);
+ mTestObject->handleCommand( MpxHbVideoCommon::ActivatePlaybackView );
- QVERIFY(mTestObject->mCurrentViewPlugin == mTestObject->mPlaybackViewPlugin);
+ QVERIFY( mTestObject->mCurrentViewPlugin == mTestObject->mPlaybackViewPlugin );
- QVERIFY(mTestObject->mCurrentViewPlugin->activated());
- QVERIFY(mTestObject->mPlaybackViewPlugin->activated());
- QVERIFY(mTestObject->mFileDetailsViewPlugin->activated() == false);
- QVERIFY(mTestObject->mIsService == false);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin->activated() );
+ QVERIFY( mTestObject->mPlaybackViewPlugin->activated() );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin->activated() == false );
+ QVERIFY( mTestObject->mIsService == false );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
- QVERIFY(mTestObject->mCurrentViewPlugin != 0);
- QVERIFY(mTestObject->mPlaybackViewPlugin != 0);
- QVERIFY(mTestObject->mCollectionViewPlugin == 0);
- QVERIFY(mTestObject->mFileDetailsViewPlugin != 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin != 0 );
+ QVERIFY( mTestObject->mPlaybackViewPlugin != 0 );
+ QVERIFY( mTestObject->mCollectionViewPlugin == 0 );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin != 0 );
- mTestObject->handleCommand(MpxHbVideoCommon::ActivateCollectionView);
+ mTestObject->handleCommand(MpxHbVideoCommon::ActivateCollectionView );
- QVERIFY(mTestObject->mPlaybackViewPlugin->activated() == false);
- QVERIFY(mTestObject->mFileDetailsViewPlugin->activated() == false);
+ QVERIFY( mTestObject->mPlaybackViewPlugin->activated() == false );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin->activated() == false );
- QVERIFY(mTestObject->mCurrentViewPlugin == 0);
- QVERIFY(mTestObject->mPlaybackViewPlugin != 0);
- QVERIFY(mTestObject->mCollectionViewPlugin == 0);
- QVERIFY(mTestObject->mFileDetailsViewPlugin != 0);
- QVERIFY(mTestObject->mIsService == false);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin == 0 );
+ QVERIFY( mTestObject->mPlaybackViewPlugin != 0 );
+ QVERIFY( mTestObject->mCollectionViewPlugin == 0 );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin != 0 );
+ QVERIFY( mTestObject->mIsService == false );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
- mTestObject->handleCommand(MpxHbVideoCommon::ActivateVideoDetailsView);
+ mTestObject->handleCommand( MpxHbVideoCommon::ActivateVideoDetailsView );
- QVERIFY(mTestObject->mFileDetailsViewPlugin != 0);
- QVERIFY(mTestObject->mCurrentViewPlugin == mTestObject->mFileDetailsViewPlugin);
+ QVERIFY( mTestObject->mFileDetailsViewPlugin != 0 );
+ QVERIFY( mTestObject->mCurrentViewPlugin == mTestObject->mFileDetailsViewPlugin );
- QVERIFY(mTestObject->mCurrentViewPlugin->activated());
- QVERIFY(mTestObject->mPlaybackViewPlugin->activated() == false);
- QVERIFY(mTestObject->mFileDetailsViewPlugin->activated());
+ QVERIFY( mTestObject->mCurrentViewPlugin->activated() );
+ QVERIFY( mTestObject->mPlaybackViewPlugin->activated() == false );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin->activated() );
- QVERIFY(mTestObject->mCurrentViewPlugin != 0);
- QVERIFY(mTestObject->mPlaybackViewPlugin != 0);
- QVERIFY(mTestObject->mCollectionViewPlugin == 0);
- QVERIFY(mTestObject->mIsService == false);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin != 0 );
+ QVERIFY( mTestObject->mPlaybackViewPlugin != 0 );
+ QVERIFY( mTestObject->mCollectionViewPlugin == 0 );
+ QVERIFY( mTestObject->mIsService == false );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
- mTestObject->handleCommand(MpxHbVideoCommon::ActivateCollectionView);
+ mTestObject->handleCommand( MpxHbVideoCommon::ActivateCollectionView );
- QVERIFY(mTestObject->mPlaybackViewPlugin->activated() == false);
- QVERIFY(mTestObject->mFileDetailsViewPlugin->activated() == false);
+ QVERIFY( mTestObject->mPlaybackViewPlugin->activated() == false );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin->activated() == false );
- QVERIFY(mTestObject->mCurrentViewPlugin == 0);
- QVERIFY(mTestObject->mPlaybackViewPlugin != 0);
- QVERIFY(mTestObject->mCollectionViewPlugin == 0);
- QVERIFY(mTestObject->mFileDetailsViewPlugin != 0);
- QVERIFY(mTestObject->mIsService == false);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin == 0 );
+ QVERIFY( mTestObject->mPlaybackViewPlugin != 0 );
+ QVERIFY( mTestObject->mCollectionViewPlugin == 0 );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin != 0 );
+ QVERIFY( mTestObject->mIsService == false );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
cleanup();
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( VideoServices::mReferenceCount == 0);
}
void TestVideoPlayerEngine::testHandleCommandPluginFail2()
{
- MPX_DEBUG(_L("TestVideoServices::testHandleCommandPluginFail2()"));
+ MPX_ENTER_EXIT(_L("TestVideoPlayerEngine::testHandleCommandPluginFail2()"));
init();
- QVERIFY(!mTestObject.isNull());
+ QVERIFY( ! mTestObject.isNull() );
- QVERIFY(mTestObject->mCurrentViewPlugin == 0);
- QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
- QVERIFY(mTestObject->mCollectionViewPlugin == 0);
- QVERIFY(mTestObject->mFileDetailsViewPlugin == 0);
- QVERIFY(mTestObject->mIsService == false);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin == 0 );
+ QVERIFY( mTestObject->mPlaybackViewPlugin == 0 );
+ QVERIFY( mTestObject->mCollectionViewPlugin == 0 );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin == 0 );
+ QVERIFY( mTestObject->mIsService == false );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
XQPluginLoader::mFailToLoadPluginUid = MpxHbVideoCommon::KMpxVideoPluginDllPlaybackUid;
- mTestObject->initialize();
+ mTestObject->initialize();
- QVERIFY(mTestObject->mCurrentViewPlugin != 0);
- QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
- QVERIFY(mTestObject->mCollectionViewPlugin != 0);
- QVERIFY(mTestObject->mFileDetailsViewPlugin == 0);
- QVERIFY(mTestObject->mIsService == false);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin != 0 );
+ QVERIFY( mTestObject->mPlaybackViewPlugin == 0 );
+ QVERIFY( mTestObject->mCollectionViewPlugin != 0 );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin == 0 );
+ QVERIFY( mTestObject->mIsService == false );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
- QVERIFY(mTestObject->mCurrentViewPlugin == mTestObject->mCollectionViewPlugin);
- mTestObject->handleCommand(MpxHbVideoCommon::DoDelayedLoad);
+ QVERIFY( mTestObject->mCurrentViewPlugin == mTestObject->mCollectionViewPlugin );
+ mTestObject->handleCommand( MpxHbVideoCommon::DoDelayedLoad );
- QVERIFY(mTestObject->mCurrentViewPlugin != 0);
- QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
- QVERIFY(mTestObject->mCollectionViewPlugin != 0);
- QVERIFY(mTestObject->mFileDetailsViewPlugin != 0);
- QVERIFY(mTestObject->mIsService == false);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin != 0 );
+ QVERIFY( mTestObject->mPlaybackViewPlugin == 0 );
+ QVERIFY( mTestObject->mCollectionViewPlugin != 0 );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin != 0 );
+ QVERIFY( mTestObject->mIsService == false );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
- QVERIFY(mTestObject->mCurrentViewPlugin == mTestObject->mCollectionViewPlugin);
+ QVERIFY( mTestObject->mCurrentViewPlugin == mTestObject->mCollectionViewPlugin );
- QVERIFY(mTestObject->mCurrentViewPlugin->activated());
- QVERIFY(mTestObject->mCollectionViewPlugin->activated());
- QVERIFY(mTestObject->mFileDetailsViewPlugin->activated() == false);
+ QVERIFY( mTestObject->mCurrentViewPlugin->activated() );
+ QVERIFY( mTestObject->mCollectionViewPlugin->activated() );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin->activated() == false );
- mTestObject->handleCommand(MpxHbVideoCommon::ActivatePlaybackView);
+ mTestObject->handleCommand(MpxHbVideoCommon::ActivatePlaybackView );
- QVERIFY(mTestObject->mCurrentViewPlugin == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin == 0 );
- QVERIFY(mTestObject->mCollectionViewPlugin->activated() == false);
- QVERIFY(mTestObject->mFileDetailsViewPlugin->activated() == false);
+ QVERIFY( mTestObject->mCollectionViewPlugin->activated() == false );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin->activated() == false );
- QVERIFY(mTestObject->mCurrentViewPlugin == 0);
- QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
- QVERIFY(mTestObject->mCollectionViewPlugin != 0);
- QVERIFY(mTestObject->mFileDetailsViewPlugin != 0);
- QVERIFY(mTestObject->mIsService == false);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin == 0 );
+ QVERIFY( mTestObject->mPlaybackViewPlugin == 0 );
+ QVERIFY( mTestObject->mCollectionViewPlugin != 0 );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin != 0 );
+ QVERIFY( mTestObject->mIsService == false );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
- mTestObject->handleCommand(MpxHbVideoCommon::ActivateCollectionView);
+ mTestObject->handleCommand(MpxHbVideoCommon::ActivateCollectionView );
- QVERIFY(mTestObject->mCurrentViewPlugin == mTestObject->mCollectionViewPlugin);
+ QVERIFY( mTestObject->mCurrentViewPlugin == mTestObject->mCollectionViewPlugin );
- QVERIFY(mTestObject->mCurrentViewPlugin->activated());
- QVERIFY(mTestObject->mCollectionViewPlugin->activated());
- QVERIFY(mTestObject->mFileDetailsViewPlugin->activated() == false);
+ QVERIFY( mTestObject->mCurrentViewPlugin->activated() );
+ QVERIFY( mTestObject->mCollectionViewPlugin->activated() );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin->activated() == false );
- QVERIFY(mTestObject->mCurrentViewPlugin != 0);
- QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
- QVERIFY(mTestObject->mCollectionViewPlugin != 0);
- QVERIFY(mTestObject->mFileDetailsViewPlugin != 0);
- QVERIFY(mTestObject->mIsService == false);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin != 0 );
+ QVERIFY( mTestObject->mPlaybackViewPlugin == 0 );
+ QVERIFY( mTestObject->mCollectionViewPlugin != 0 );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin != 0 );
+ QVERIFY( mTestObject->mIsService == false );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
- mTestObject->handleCommand(MpxHbVideoCommon::ActivateVideoDetailsView);
+ mTestObject->handleCommand( MpxHbVideoCommon::ActivateVideoDetailsView );
- QVERIFY(mTestObject->mFileDetailsViewPlugin != 0);
- QVERIFY(mTestObject->mCurrentViewPlugin == mTestObject->mFileDetailsViewPlugin);
+ QVERIFY( mTestObject->mFileDetailsViewPlugin != 0 );
+ QVERIFY( mTestObject->mCurrentViewPlugin == mTestObject->mFileDetailsViewPlugin );
- QVERIFY(mTestObject->mFileDetailsViewPlugin != 0);
- QVERIFY(mTestObject->mCurrentViewPlugin->activated());
- QVERIFY(mTestObject->mCollectionViewPlugin->activated() == false);
- QVERIFY(mTestObject->mFileDetailsViewPlugin->activated());
+ QVERIFY( mTestObject->mFileDetailsViewPlugin != 0 );
+ QVERIFY( mTestObject->mCurrentViewPlugin->activated() );
+ QVERIFY( mTestObject->mCollectionViewPlugin->activated() == false );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin->activated() );
- QVERIFY(mTestObject->mCurrentViewPlugin != 0);
- QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
- QVERIFY(mTestObject->mCollectionViewPlugin != 0);
- QVERIFY(mTestObject->mFileDetailsViewPlugin != 0);
- QVERIFY(mTestObject->mIsService == false);
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( mTestObject->mCurrentViewPlugin != 0 );
+ QVERIFY( mTestObject->mPlaybackViewPlugin == 0 );
+ QVERIFY( mTestObject->mCollectionViewPlugin != 0 );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin != 0 );
+ QVERIFY( mTestObject->mIsService == false );
+ QVERIFY( VideoServices::mReferenceCount == 0 );
cleanup();
- QVERIFY(VideoServices::mReferenceCount == 0);
+ QVERIFY( VideoServices::mReferenceCount == 0 );
}
void TestVideoPlayerEngine::testPlayMedia()
{
- MPX_DEBUG(_L("TestVideoServices::testPlayMedia()"));
+ MPX_ENTER_EXIT(_L("TestVideoPlayerEngine::testPlayMedia()"));
- // 1. test with a string
+ // 1. test with a string
init();
- QVERIFY(!mTestObject.isNull());
+ QVERIFY( ! mTestObject.isNull() );
- mTestObject->playMedia( QString("c:\\data\\videos\\test.3gp"));
- QVERIFY(mTestObject);
+ mTestObject->playMedia( QString("c:\\data\\videos\\test.3gp") );
+ QVERIFY( mTestObject );
cleanup();
// 2. test with a file handle
init();
- QVERIFY(!mTestObject.isNull());
+ QVERIFY( !mTestObject.isNull() );
XQSharableFile sf;
+
if ( sf.open("C:\\data\\videos\\test.3gp") )
{
RFile rFile;
@@ -844,29 +847,30 @@
mTestObject->playMedia( rFile );
}
- QVERIFY(mTestObject);
+ QVERIFY( mTestObject);
sf.close();
}
+
cleanup();
// 3. test with a filename
init();
- QVERIFY(!mTestObject.isNull());
+ QVERIFY( ! mTestObject.isNull() );
QFile qfile("C:\\data\\videos\\test.3gp");
mTestObject->playMedia( qfile.fileName() );
- QVERIFY(mTestObject);
+ QVERIFY( mTestObject );
cleanup();
}
void TestVideoPlayerEngine::testSetEmbedded()
{
- MPX_DEBUG(_L("TestVideoServices::testSetEmbedded()"));
+ MPX_ENTER_EXIT(_L("TestVideoPlayerEngine::testSetEmbedded()"));
init();
- QVERIFY(!mTestObject.isNull());
+ QVERIFY( !mTestObject.isNull() );
mTestObject->setEmbedded();
QVERIFY( mTestObject->mEmbedded == true );
cleanup();
@@ -874,57 +878,57 @@
void TestVideoPlayerEngine::testInitWithActivityData()
{
- MPX_DEBUG(_L("TestVideoServices::testInitialize()"));
+ MPX_ENTER_EXIT(_L("TestVideoPlayerEngine::testInitialize()"));
init();
- QVERIFY(!mTestObject.isNull());
+ QVERIFY( !mTestObject.isNull() );
mTestObject->initialize();
// by default, colleciton view plugin is activated
- QVERIFY(mTestObject);
- QVERIFY(mTestObject->mCurrentViewPlugin);
- QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
- QVERIFY(mTestObject->mCollectionViewPlugin);
- QVERIFY(mTestObject->mFileDetailsViewPlugin == 0);
- QVERIFY(mTestObject->mPlaybackWrapper);
- QVERIFY(mTestObject->mCurrentViewPlugin->activated());
- QVERIFY(mTestObject->mCollectionViewPlugin->activated());
+ QVERIFY( mTestObject );
+ QVERIFY( mTestObject->mCurrentViewPlugin );
+ QVERIFY( mTestObject->mPlaybackViewPlugin == 0 );
+ QVERIFY( mTestObject->mCollectionViewPlugin );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin == 0 );
+ QVERIFY( mTestObject->mPlaybackWrapper );
+ QVERIFY( mTestObject->mCurrentViewPlugin->activated() );
+ QVERIFY( mTestObject->mCollectionViewPlugin->activated() );
cleanup();
init();
- QVERIFY(!mTestObject.isNull());
+ QVERIFY( !mTestObject.isNull() );
- QVariant data = int(MpxHbVideoCommon::PlaybackView);
+ QVariant data = int( MpxHbVideoCommon::PlaybackView );
// playback plugin
- VideoActivityState::instance().setActivityData(data, VideoActivityData::KEY_VIEWPLUGIN_TYPE);
+ VideoActivityState::instance().setActivityData( data, KEY_VIEWPLUGIN_TYPE );
mTestObject->initialize();
- QVERIFY(mTestObject);
- QVERIFY(mTestObject->mCurrentViewPlugin);
- QVERIFY(mTestObject->mPlaybackViewPlugin);
- QVERIFY(mTestObject->mCollectionViewPlugin == 0);
- QVERIFY(mTestObject->mFileDetailsViewPlugin == 0);
- QVERIFY(mTestObject->mPlaybackWrapper);
- QVERIFY(mTestObject->mCurrentViewPlugin->activated());
- QVERIFY(mTestObject->mPlaybackViewPlugin->activated());
+ QVERIFY( mTestObject );
+ QVERIFY( mTestObject->mCurrentViewPlugin );
+ QVERIFY( mTestObject->mPlaybackViewPlugin );
+ QVERIFY( mTestObject->mCollectionViewPlugin == 0 );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin == 0 );
+ QVERIFY( mTestObject->mPlaybackWrapper );
+ QVERIFY( mTestObject->mCurrentViewPlugin->activated() );
+ QVERIFY( mTestObject->mPlaybackViewPlugin->activated() );
cleanup();
init();
- QVERIFY(!mTestObject.isNull());
+ QVERIFY( !mTestObject.isNull() );
// only collection view and playback view are accepted, so all other cases
// ends up into default: collectionview
- data = int(MpxHbVideoCommon::VideoDetailsView);
- VideoActivityState::instance().setActivityData(data, VideoActivityData::KEY_VIEWPLUGIN_TYPE);
+ data = int( MpxHbVideoCommon::VideoDetailsView );
+ VideoActivityState::instance().setActivityData( data, KEY_VIEWPLUGIN_TYPE );
mTestObject->initialize();
- QVERIFY(mTestObject);
- QVERIFY(mTestObject->mCurrentViewPlugin);
- QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
- QVERIFY(mTestObject->mCollectionViewPlugin);
- QVERIFY(mTestObject->mFileDetailsViewPlugin == 0);
- QVERIFY(mTestObject->mPlaybackWrapper);
- QVERIFY(mTestObject->mCurrentViewPlugin->activated());
- QVERIFY(mTestObject->mCollectionViewPlugin->activated());
+ QVERIFY( mTestObject );
+ QVERIFY( mTestObject->mCurrentViewPlugin );
+ QVERIFY( mTestObject->mPlaybackViewPlugin == 0 );
+ QVERIFY( mTestObject->mCollectionViewPlugin );
+ QVERIFY( mTestObject->mFileDetailsViewPlugin == 0 );
+ QVERIFY( mTestObject->mPlaybackWrapper );
+ QVERIFY( mTestObject->mCurrentViewPlugin->activated() );
+ QVERIFY( mTestObject->mCollectionViewPlugin->activated() );
cleanup();
@@ -932,13 +936,15 @@
void TestVideoPlayerEngine::testHandleQuitWihtActivityData()
{
+ MPX_ENTER_EXIT(_L("TestVideoPlayerEngine::testHandleQuitWihtActivityData()"));
+
// we make sure that engine saves correct plugin type before exit
// using VideoActivityState since value is saved there before actually
// being save to activitymanager
init();
- QVERIFY(!mTestObject.isNull());
- connect(this, SIGNAL(aboutToQuit()), mTestObject, SLOT(handleQuit()));
+ QVERIFY( !mTestObject.isNull() );
+ connect( this, SIGNAL(aboutToQuit()), mTestObject, SLOT(handleQuit()) );
mTestObject->initialize();
VideoActivityState::mAllDataGetCount = 0;
@@ -946,46 +952,46 @@
emit aboutToQuit();
QVariant data = QVariant();
- data = VideoActivityState::instance().getActivityData(VideoActivityData::KEY_VIEWPLUGIN_TYPE);
- QVERIFY(data.isValid());
- QVERIFY(data.toInt() == MpxHbVideoCommon::CollectionView);
- QVERIFY(VideoActivityState::mAllDataGetCount == 1);
+ data = VideoActivityState::instance().getActivityData( KEY_VIEWPLUGIN_TYPE );
+ QVERIFY( data.isValid() );
+ QVERIFY( data.toInt() == MpxHbVideoCommon::CollectionView );
+ QVERIFY( VideoActivityState::mAllDataGetCount == 1 );
cleanup();
init();
- QVERIFY(!mTestObject.isNull());
- connect(this, SIGNAL(aboutToQuit()), mTestObject, SLOT(handleQuit()));
+ QVERIFY( ! mTestObject.isNull() );
+ connect( this, SIGNAL(aboutToQuit()), mTestObject, SLOT(handleQuit()) );
data = int(MpxHbVideoCommon::PlaybackView);
- VideoActivityState::instance().setActivityData(data, VideoActivityData::KEY_VIEWPLUGIN_TYPE);
+ VideoActivityState::instance().setActivityData( data, KEY_VIEWPLUGIN_TYPE );
mTestObject->initialize();
VideoActivityState::mAllDataGetCount = 0;
emit aboutToQuit();
data = QVariant();
- data = VideoActivityState::instance().getActivityData(VideoActivityData::KEY_VIEWPLUGIN_TYPE);
- QVERIFY(data.isValid());
- QVERIFY(data.toInt() == MpxHbVideoCommon::PlaybackView);
- QVERIFY(VideoActivityState::mAllDataGetCount == 1);
+ data = VideoActivityState::instance().getActivityData( KEY_VIEWPLUGIN_TYPE );
+ QVERIFY( data.isValid() );
+ QVERIFY( data.toInt() == MpxHbVideoCommon::PlaybackView );
+ QVERIFY( VideoActivityState::mAllDataGetCount == 1 );
cleanup();
init();
- QVERIFY(!mTestObject.isNull());
- connect(this, SIGNAL(aboutToQuit()), mTestObject, SLOT(handleQuit()));
+ QVERIFY( ! mTestObject.isNull() );
+ connect( this, SIGNAL(aboutToQuit()), mTestObject, SLOT(handleQuit()) );
- data = int(MpxHbVideoCommon::VideoDetailsView);
- VideoActivityState::instance().setActivityData(data, VideoActivityData::KEY_VIEWPLUGIN_TYPE);
+ data = int( MpxHbVideoCommon::VideoDetailsView );
+ VideoActivityState::instance().setActivityData( data, KEY_VIEWPLUGIN_TYPE );
mTestObject->initialize();
VideoActivityState::mAllDataGetCount = 0;
emit aboutToQuit();
data = QVariant();
- data = VideoActivityState::instance().getActivityData(VideoActivityData::KEY_VIEWPLUGIN_TYPE);
- QVERIFY(data.isValid());
- QVERIFY(data.toInt() == MpxHbVideoCommon::CollectionView);
- QVERIFY(VideoActivityState::mAllDataGetCount == 1);
+ data = VideoActivityState::instance().getActivityData( KEY_VIEWPLUGIN_TYPE );
+ QVERIFY( data.isValid() );
+ QVERIFY( data.toInt() == MpxHbVideoCommon::CollectionView );
+ QVERIFY( VideoActivityState::mAllDataGetCount == 1 );
cleanup();
}
@@ -993,7 +999,7 @@
void TestVideoPlayerEngine::cleanupTestCase()
{
- MPX_DEBUG(_L("TestVideoServices::cleanupTestCase()"));
+ MPX_DEBUG(_L("TestVideoPlayerEngine::cleanupTestCase()"));
// all common cleanup here
}
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/inc/hbinstance.h Fri Jul 02 17:14:33 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/inc/hbinstance.h Thu Jul 08 13:05:19 2010 +0300
@@ -15,6 +15,8 @@
*
*/
+// Version : %version: %
+
#ifndef _HBINSTANCE_H
#define _HBINSTANCE_H
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/inc/mpxvideoplaybackwrapper.h Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +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: Stub implementation of QMpxVideoPlaybackWrapper
-*
-*/
-
-// Version : %version: da1mmcf#5 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKWRAPPER_H_
-#define MPXVIDEOPLAYBACKWRAPPER_H_
-
-#include <qobject>
-#include <qstring>
-#include <qfile>
-#include <f32file.h>
-
-#include <mpxhbvideocommondefs.h>
-
-class QMpxVideoPlaybackWrapper : public QObject
-{
- Q_OBJECT
-
- public:
- QMpxVideoPlaybackWrapper();
- virtual ~QMpxVideoPlaybackWrapper();
- int playMedia( QString aFileName );
- int playMedia( RFile aFile );
-
- public:
- void openPlaybackView() ;
- static int GetInstanceCount();
- void lateInit();
-
- signals:
- void handlePlaybackView( int viewId );
-
- private:
- static void Increment();
- static void Decrement();
-};
-
-#endif /* STUBMPXVIDEOPLAYBACKWRAPPER_H_ */
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/inc/videoactivitystate.h Fri Jul 02 17:14:33 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/inc/videoactivitystate.h Thu Jul 08 13:05:19 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: da1mmcf#2 %
#ifndef __VIDEOACTIVITYSTATE_H__
#define __VIDEOACTIVITYSTATE_H__
@@ -27,14 +27,17 @@
// videoplayer activity id
static const QString ACTIVITY_VIDEOPLAYER_MAINVIEW = "VideosMainView";
+// last position of the last played media clip (int)
+static const QString KEY_LAST_PLAY_POSITION_ID = "_VideoActivity_last_play_position_id_";
-namespace VideoActivityData
-{
- // consts to be used as key values
- // plugin type (int): collectionplugin or videoplaybackplugin
- static const QString KEY_VIEWPLUGIN_TYPE = "_VideoActivity_viewplugin_type_";
-
-}
+// name of the media clip last played (QString)
+static const QString KEY_LAST_PLAYED_CLIP = "_VideoActivity_last_played_clip_";
+
+// Key for plugin type in activity manager
+static const QString KEY_VIEWPLUGIN_TYPE = "_VideoActivity_viewplugin_type_";
+
+// was the last played media clip a local clip (not streaming or prog. download)
+static const QString KEY_LAST_LOCAL_PLAYBACK = "_VideoActivity_last_local_playback_";
/**
* Class is used as a stub for testing activity saving from videoplayerengine
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/inc/videoplaybackwrapper.h Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,55 @@
+/*
+* 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 implementation of VideoPlaybackWrapper
+*
+*/
+
+// Version : %version: da1mmcf#6 %
+
+
+
+#ifndef VIDEOPLAYBACKWRAPPER_H_
+#define VIDEOPLAYBACKWRAPPER_H_
+
+#include <qobject>
+#include <qstring>
+#include <qfile>
+#include <f32file.h>
+
+#include <mpxhbvideocommondefs.h>
+
+class VideoPlaybackWrapper : public QObject
+{
+ Q_OBJECT
+
+ public:
+ VideoPlaybackWrapper();
+ virtual ~VideoPlaybackWrapper();
+ int playMedia( QString aFileName );
+ int playMedia( RFile aFile );
+
+ public:
+ void openPlaybackView() ;
+ static int GetInstanceCount();
+ void lateInit();
+
+ signals:
+ void handlePlaybackView( int viewId );
+
+ private:
+ static void Increment();
+ static void Decrement();
+};
+
+#endif /* VIDEOPLAYBACKWRAPPER_H_ */
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/inc/videoserviceplay.h Fri Jul 02 17:14:33 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/inc/videoserviceplay.h Thu Jul 08 13:05:19 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: da1mmcf#2 %
#ifndef VIDEOSERVICEPLAY_H
#define VIDEOSERVICEPLAY_H
@@ -28,20 +28,20 @@
class VideoServices;
class VideoServicePlay : public QObject
- {
+{
Q_OBJECT
public:
- VideoServicePlay( VideoServices* parent, QVideoPlayerEngine* engine );
+ VideoServicePlay( VideoServices* parent, VideoPlayerEngine* engine );
virtual ~VideoServicePlay();
public slots:
void playMedia( QString filePath );
private:
- QVideoPlayerEngine* mEngine;
+ VideoPlayerEngine* mEngine;
VideoServices* mServiceApp;
- };
+};
- #endif
+#endif
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/inc/videoservices.h Fri Jul 02 17:14:33 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/inc/videoservices.h Thu Jul 08 13:05:19 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#4 %
+// Version : %version: da1mmcf#5 %
#ifndef __VIDEOSERVICES_H__
#define __VIDEOSERVICES_H__
@@ -27,101 +27,92 @@
class VideoServiceUriFetch;
class VideoServicePlay;
class VideoServiceView;
-class QVideoPlayerEngine;
+class VideoPlayerEngine;
class VideoServices : public QObject
{
Q_OBJECT
-public:
+ public:
- /**
- * Returns singleton instance for this class.
- *
- * WARNING! Not safe to call this from destructor of another function scope static object!
- *
- * @return The singleton instance.
- */
- static VideoServices *instance(QVideoPlayerEngine* engine = 0);
+ /**
+ * Returns singleton instance for this class.
+ * WARNING! Not safe to call this from destructor of another function scope static object!
+ * @return The singleton instance.
+ */
+ static VideoServices *instance( VideoPlayerEngine* engine = 0 );
- /**
- * Decreases the reference count, when count reaches zero cleanup is done.
- *
- */
- void decreaseReferenceCount();
+ /**
+ * Decreases the reference count, when count reaches zero cleanup is done.
+ *
+ */
+ void decreaseReferenceCount();
- enum TVideoService
- {
- ENoService,
- EUriFetcher,
- EPlayback,
- EView
- };
+ enum TVideoService
+ {
+ ENoService,
+ EUriFetcher,
+ EPlayback,
+ EView
+ };
- /**
- * Returns service active status
- *
- * @return bool true if active, false if not active
- *
- */
- VideoServices::TVideoService currentService();
+ /**
+ * Returns service active status
+ * @return bool true if active, false if not active
+ */
+ VideoServices::TVideoService currentService();
-private:
-
- /**
- * Constructor
- */
- VideoServices();
+ private:
+
+ /**
+ * Constructor
+ */
+ VideoServices();
- /**
- * Constructor
- */
- VideoServices(QVideoPlayerEngine* engine);
+ /**
+ * Constructor
+ */
+ VideoServices( VideoPlayerEngine* engine );
- /**
- * Destructor.
- */
- virtual ~VideoServices();
+ /**
+ * Destructor.
+ */
+ virtual ~VideoServices();
- void setCurrentService(VideoServices::TVideoService service);
+ void setCurrentService( VideoServices::TVideoService service );
- Q_DISABLE_COPY(VideoServices)
+ Q_DISABLE_COPY( VideoServices )
-signals:
+ signals:
void activated( int command );
-private:
-
- /**
- * Singleton instance.
- */
- static VideoServices* mInstance;
+ private:
- VideoServiceUriFetch* mServiceUriFetch;
+ /**
+ * Singleton instance.
+ */
+ static VideoServices* mInstance;
- VideoServicePlay* mServicePlay;
-
- VideoServiceView* mServiceView;
-
- VideoServices::TVideoService mCurrentService;
+ VideoServiceUriFetch* mServiceUriFetch;
+ VideoServicePlay* mServicePlay;
+ VideoServiceView* mServiceView;
+ VideoServices::TVideoService mCurrentService;
- friend class VideoServiceUriFetch;
+ friend class VideoServiceUriFetch;
+ friend class VideoServicePlay;
+ friend class VideoServiceView;
- friend class VideoServicePlay;
-
- friend class VideoServiceView;
-
-public:
+ public:
- /**
- * Reference count.
- */
- static int mReferenceCount;
+ /**
+ * Reference count.
+ */
+ static int mReferenceCount;
- /*
- * indicate fetch service and attach operation has been selected
- */
- bool mFetchSelected;
+ /*
+ * indicate fetch service and attach operation has been selected
+ */
+ bool mFetchSelected;
};
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/inc/videoserviceview.h Fri Jul 02 17:14:33 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/inc/videoserviceview.h Thu Jul 08 13:05:19 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
#ifndef VIDEOSERVICEVIEW_H
#define VIDEOSERVICEVIEW_H
@@ -28,20 +28,20 @@
class VideoServices;
class VideoServiceView : public QObject
- {
+{
Q_OBJECT
public:
- VideoServiceView( VideoServices* parent, QVideoPlayerEngine* engine );
+ VideoServiceView( VideoServices* parent, VideoPlayerEngine* engine );
virtual ~VideoServiceView();
public slots:
void view( QString filePath );
private:
- QVideoPlayerEngine* mEngine;
- VideoServices* mServiceApp;
- };
+ VideoPlayerEngine* mEngine;
+ VideoServices* mServiceApp;
+};
- #endif
+#endif
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/hbinstance.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/hbinstance.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: %
+// Version : %version: da1mmcf#7 %
#include <hbmainwindow.h>
@@ -26,53 +26,87 @@
HbInstance* mInstance = 0;
QList<HbInstance *> mInstances;
+// -------------------------------------------------------------------------------------------------
+// HbInstance::HbInstance()
+// -------------------------------------------------------------------------------------------------
+//
HbInstance::HbInstance()
{
MPX_DEBUG(_L("HbInstance::HbInstance()"));
}
+// -------------------------------------------------------------------------------------------------
+// HbInstance::~HbInstance()
+// -------------------------------------------------------------------------------------------------
+//
HbInstance::~HbInstance()
{
MPX_DEBUG(_L("HbInstance::~HbInstance()"));
}
+// -------------------------------------------------------------------------------------------------
+// HbInstance::instance()
+// -------------------------------------------------------------------------------------------------
+//
HbInstance* HbInstance::instance()
{
MPX_ENTER_EXIT(_L("TestVideoServices::instance()"));
- if (!initialised)
+ if ( ! initialised )
{
mInstance = new HbInstance();
initialised = true;
mInstances.append(mInstance);
}
+
return mInstance;
}
+// -------------------------------------------------------------------------------------------------
+// HbInstance::primaryWindow()
+// -------------------------------------------------------------------------------------------------
+//
HbInstance* HbInstance::primaryWindow() const
{
MPX_DEBUG(_L("HbInstance::primaryWindow()"));
return mInstance;
}
+// -------------------------------------------------------------------------------------------------
+// HbInstance::allMainWindows()
+// -------------------------------------------------------------------------------------------------
+//
QList<HbInstance *> HbInstance::allMainWindows() const
{
MPX_DEBUG(_L("HbInstance::allMainWindows()"));
return mInstances;
}
+// -------------------------------------------------------------------------------------------------
+// HbInstance::removeView()
+// -------------------------------------------------------------------------------------------------
+//
void HbInstance::removeView( QGraphicsWidget* )
{
MPX_DEBUG(_L("HbInstance::removeView()"));
}
+// -------------------------------------------------------------------------------------------------
+// HbInstance::addView()
+// -------------------------------------------------------------------------------------------------
+//
void HbInstance::addView( QGraphicsWidget* )
{
MPX_DEBUG(_L("HbInstance::addView()"));
}
+// -------------------------------------------------------------------------------------------------
+// HbInstance::setCurrentView()
+// -------------------------------------------------------------------------------------------------
+//
void HbInstance::setCurrentView( HbView*, bool animation )
{
MPX_DEBUG(_L("HbInstance::setCurrentView()"));
+ Q_UNUSED( animation );
}
-
\ No newline at end of file
+
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/mpxvideoplaybackwrapper.cpp Fri Jul 02 17:14:33 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +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: Stub-implementation of QMpxVideoPlaybackWrapper
-*
-*/
-
-// Version : %version: da1mmcf#6 %
-
-
-#include "mpxvideoplaybackwrapper.h"
-#include "mpxvideo_debug.h"
-
-int mCount = 0;
-
-QMpxVideoPlaybackWrapper::QMpxVideoPlaybackWrapper()
-{
- MPX_DEBUG(_L("QMpxVideoPlaybackWrapper::QMpxVideoPlaybackWrapper()"));
- QMpxVideoPlaybackWrapper::Increment();
-}
-
-QMpxVideoPlaybackWrapper::~QMpxVideoPlaybackWrapper()
-{
- MPX_DEBUG(_L("QMpxVideoPlaybackWrapper::~QMpxVideoPlaybackWrapper()"));
- QMpxVideoPlaybackWrapper::Decrement();
-}
-
-void QMpxVideoPlaybackWrapper::openPlaybackView()
-{
- MPX_DEBUG(_L("QMpxVideoPlaybackWrapper::openPlaybackView()"));
- emit handlePlaybackView( MpxHbVideoCommon::ActivatePlaybackView );
-}
-
-void QMpxVideoPlaybackWrapper::Increment()
-{
- MPX_DEBUG(_L("QMpxVideoPlaybackWrapper::Increment()"));
- ++mCount;
-}
-
-void QMpxVideoPlaybackWrapper::Decrement()
-{
- MPX_DEBUG(_L("QMpxVideoPlaybackWrapper::Decrement()"));
-
- if ( mCount > 0 )
- {
- --mCount;
- }
-}
-
-int QMpxVideoPlaybackWrapper::GetInstanceCount()
-{
- MPX_DEBUG(_L("QMpxVideoPlaybackWrapper::GetInstanceCount()"));
- return mCount;
-}
-
-int QMpxVideoPlaybackWrapper::playMedia( QString aFileName )
-{
- MPX_DEBUG(_L("QMpxVideoPlaybackWrapper::playMedia( aFileName )"));
-
- Q_UNUSED( aFileName );
- return 0;
-}
-
-int QMpxVideoPlaybackWrapper::playMedia( RFile aFile )
-{
- MPX_DEBUG(_L("QMpxVideoPlaybackWrapper::playMedia( aFile )"));
-
- Q_UNUSED( aFile );
- return 0;
-}
-
-void QMpxVideoPlaybackWrapper::lateInit()
-{
- MPX_DEBUG(_L("QMpxVideoPlaybackWrapper::lateInit()"));
-}
-
-// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/videoplaybackwrapper.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -0,0 +1,87 @@
+/*
+* 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-implementation of VideoPlaybackWrapper
+*
+*/
+
+// Version : %version: da1mmcf#7 %
+
+
+#include "videoplaybackwrapper.h"
+#include "mpxvideo_debug.h"
+
+int mCount = 0;
+
+VideoPlaybackWrapper::VideoPlaybackWrapper()
+{
+ MPX_DEBUG(_L("VideoPlaybackWrapper::VideoPlaybackWrapper()"));
+ VideoPlaybackWrapper::Increment();
+}
+
+VideoPlaybackWrapper::~VideoPlaybackWrapper()
+{
+ MPX_DEBUG(_L("VideoPlaybackWrapper::~VideoPlaybackWrapper()"));
+ VideoPlaybackWrapper::Decrement();
+}
+
+void VideoPlaybackWrapper::openPlaybackView()
+{
+ MPX_DEBUG(_L("VideoPlaybackWrapper::openPlaybackView()"));
+ emit handlePlaybackView( MpxHbVideoCommon::ActivatePlaybackView );
+}
+
+void VideoPlaybackWrapper::Increment()
+{
+ MPX_DEBUG(_L("VideoPlaybackWrapper::Increment()"));
+ ++mCount;
+}
+
+void VideoPlaybackWrapper::Decrement()
+{
+ MPX_DEBUG(_L("VideoPlaybackWrapper::Decrement()"));
+
+ if ( mCount > 0 )
+ {
+ --mCount;
+ }
+}
+
+int VideoPlaybackWrapper::GetInstanceCount()
+{
+ MPX_DEBUG(_L("VideoPlaybackWrapper::GetInstanceCount()"));
+ return mCount;
+}
+
+int VideoPlaybackWrapper::playMedia( QString aFileName )
+{
+ MPX_DEBUG(_L("VideoPlaybackWrapper::playMedia( aFileName )"));
+
+ Q_UNUSED( aFileName );
+ return 0;
+}
+
+int VideoPlaybackWrapper::playMedia( RFile aFile )
+{
+ MPX_DEBUG(_L("VideoPlaybackWrapper::playMedia( aFile )"));
+
+ Q_UNUSED( aFile );
+ return 0;
+}
+
+void VideoPlaybackWrapper::lateInit()
+{
+ MPX_DEBUG(_L("VideoPlaybackWrapper::lateInit()"));
+}
+
+// End of File
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/videoserviceplay.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/videoserviceplay.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#2 %
+// Version : %version: da1mmcf#3 %
#include "videoservices.h"
@@ -24,7 +24,7 @@
#include "mpxvideo_debug.h"
-VideoServicePlay::VideoServicePlay( VideoServices* parent, QVideoPlayerEngine* engine )
+VideoServicePlay::VideoServicePlay( VideoServices* parent, VideoPlayerEngine* engine )
{
MPX_DEBUG(_L("VideoServicePlay::VideoServicePlay()"));
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/videoservices.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/videoservices.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#4 %
+// Version : %version: da1mmcf#5 %
#include "videoplayerengine.h"
#include "videoservices.h"
@@ -32,7 +32,7 @@
// VideoServices::instance()
// -----------------------------------------------------------------------------
//
-VideoServices* VideoServices::instance(QVideoPlayerEngine* engine)
+VideoServices* VideoServices::instance( VideoPlayerEngine* engine )
{
MPX_ENTER_EXIT(_L("VideoServices::instance()"));
@@ -67,15 +67,15 @@
// VideoServices()
// ----------------------------------------------------------------------------
//
-VideoServices::VideoServices(QVideoPlayerEngine* engine)
+VideoServices::VideoServices( VideoPlayerEngine* engine )
: mCurrentService(VideoServices::ENoService)
, mFetchSelected( false )
{
MPX_ENTER_EXIT(_L("VideoServices::VideoServices()"));
- mServiceUriFetch = new VideoServiceUriFetch(this);
- mServicePlay = new VideoServicePlay(this, engine);
- mServiceView = new VideoServiceView(this, engine);
+ mServiceUriFetch = new VideoServiceUriFetch( this );
+ mServicePlay = new VideoServicePlay( this, engine );
+ mServiceView = new VideoServiceView( this, engine );
}
// ----------------------------------------------------------------------------
@@ -86,9 +86,9 @@
{
MPX_ENTER_EXIT(_L("VideoServices::~VideoServices()"));
- delete mServiceUriFetch;
- delete mServicePlay;
- delete mServiceView;
+ delete mServiceUriFetch;
+ delete mServicePlay;
+ delete mServiceView;
}
@@ -99,7 +99,7 @@
VideoServices::TVideoService VideoServices::currentService()
{
MPX_DEBUG(_L("VideoServices::currentService() ret %d"), mCurrentService);
- return mCurrentService;
+ return mCurrentService;
}
@@ -110,6 +110,6 @@
void VideoServices::setCurrentService( VideoServices::TVideoService service )
{
MPX_DEBUG(_L("VideoServices::setCurrentService(%d)"), service);
- mCurrentService = service;
+ mCurrentService = service;
}
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/videoserviceview.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/videoserviceview.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 2 %
+// Version : %version: 3 %
#include "videoservices.h"
@@ -24,12 +24,12 @@
#include "mpxvideo_debug.h"
-VideoServiceView::VideoServiceView( VideoServices* parent, QVideoPlayerEngine* engine )
+VideoServiceView::VideoServiceView( VideoServices* parent, VideoPlayerEngine* engine )
{
MPX_DEBUG(_L("VideoServiceView::VideoServiceView()"));
Q_UNUSED( engine );
- mServiceApp = parent;
+ mServiceApp = parent;
}
VideoServiceView::~VideoServiceView()
@@ -42,5 +42,5 @@
MPX_DEBUG(_L("VideoServiceView::view()"));
Q_UNUSED( filePath );
- mServiceApp->setCurrentService( VideoServices::EView );
+ mServiceApp->setCurrentService( VideoServices::EView );
}
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/xqpluginloader.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/xqpluginloader.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -15,6 +15,8 @@
*
*/
+// Version : %version: %
+
#include "stub/inc/xqpluginloader.h"
#include "stub/inc/xqplugininfo.h"
#include "testviewplugin.h"
@@ -23,26 +25,47 @@
QHash<int, MpxViewPlugin*> XQPluginLoader::mPluginList;
int XQPluginLoader::mFailToLoadPluginUid = -1;
+// -------------------------------------------------------------------------------------------------
+// XQPluginLoader::XQPluginLoader()
+// -------------------------------------------------------------------------------------------------
+//
XQPluginLoader::XQPluginLoader( int uid, QObject* parent )
{
MPX_DEBUG(_L("XQPluginLoader::XQPluginLoader()"));
Q_UNUSED( parent );
+
mUid = uid;
}
+// -------------------------------------------------------------------------------------------------
+// XQPluginLoader::~XQPluginLoader()
+// -------------------------------------------------------------------------------------------------
+//
XQPluginLoader::~XQPluginLoader()
{
MPX_DEBUG(_L("XQPluginLoader::~XQPluginLoader()"));
}
+// -------------------------------------------------------------------------------------------------
+// XQPluginLoader::listImplementations()
+// -------------------------------------------------------------------------------------------------
+//
bool XQPluginLoader::listImplementations( const QString &interfaceName,
QList<XQPluginInfo > &impls )
{
MPX_DEBUG(_L("XQPluginLoader::listImplementations()"));
+
+ Q_UNUSED( interfaceName );
+ Q_UNUSED( impls );
+
return true;
}
+// -------------------------------------------------------------------------------------------------
+// XQPluginLoader::instance()
+// -------------------------------------------------------------------------------------------------
+//
QObject* XQPluginLoader::instance()
{
MPX_ENTER_EXIT(_L("XQPluginLoader::instance()"));
@@ -60,6 +83,10 @@
return mPluginList[mUid];
}
+// -------------------------------------------------------------------------------------------------
+// XQPluginLoader::cleanup()
+// -------------------------------------------------------------------------------------------------
+//
void XQPluginLoader::cleanup()
{
MPX_ENTER_EXIT(_L("XQPluginLoader::cleanup()"));
@@ -75,11 +102,13 @@
}
}
-/**
- * Sets plugin load to fail.
- */
+// -------------------------------------------------------------------------------------------------
+// XQPluginLoader::setPluginLoadFailure()
+// -------------------------------------------------------------------------------------------------
+//
void XQPluginLoader::setPluginLoadFailure( int uid )
{
MPX_DEBUG(_L("XQPluginLoader::setPluginLoadFailure()"));
+
mFailToLoadPluginUid = uid;
}
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/testvideoplayerengine.pro Fri Jul 02 17:14:33 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/testvideoplayerengine.pro Thu Jul 08 13:05:19 2010 +0300
@@ -14,7 +14,7 @@
# Description: Project file for building Videoplayer components
#
#
-# Version : %version: da1mmcf#13 %
+# Version : %version: da1mmcf#14 %
TEMPLATE = app
@@ -32,7 +32,7 @@
# Input
-HEADERS += mpxvideoplaybackwrapper.h \
+HEADERS += videoplaybackwrapper.h \
xqserviceutil.h \
mpxviewpluginqt.h \
testviewplugin.h \
@@ -48,7 +48,7 @@
videoactivitystate.h \
../../../../inc/videoplayerengine.h
-SOURCES += mpxvideoplaybackwrapper.cpp \
+SOURCES += videoplaybackwrapper.cpp \
xqserviceutil.cpp \
testviewplugin.cpp \
xqpluginloader.cpp \
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoservices/inc/testvideoservices.h Fri Jul 02 17:14:33 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoservices/inc/testvideoservices.h Thu Jul 08 13:05:19 2010 +0300
@@ -22,6 +22,7 @@
// missing test functions:
// - how to setup construction to fail for testing purposes
+// Version : %version: %
#ifndef __TESTVIDEOSERVICES_H__
#define __TESTVIDEOSERVICES_H__
@@ -31,67 +32,68 @@
#include <QtTest/QtTest>
class VideoServices;
-class QVideoPlayerEngine;
+class VideoPlayerEngine;
class TestVideoServices : public QObject
- {
+{
Q_OBJECT
-public: // Constructor / destructor
+ public:
- /**
- * Contructor.
- *
- */
- TestVideoServices();
+ /**
+ * Contructor.
+ *
+ */
+ TestVideoServices();
- /**
- * Destructor.
- *
- */
- virtual ~TestVideoServices();
+ /**
+ * Destructor.
+ *
+ */
+ virtual ~TestVideoServices();
-private slots:
+ private slots:
- void init();
- void cleanup();
+ void init();
+ void cleanup();
- void testCreateDelete();
+ void testCreateDelete();
- void testCreateDeleteEngine();
+ void testCreateDeleteEngine();
- void testCurrentService();
+ void testCurrentService();
#if 0
- void testInitialize();
- void testInitializeService();
+ void testInitialize();
+ void testInitializeService();
- void testMultipleInitialize();
- void testMultipleInitializeService();
+ void testMultipleInitialize();
+ void testMultipleInitializeService();
- void testHandleCommandPreInit();
- void testHandleCommandPostInit();
- void testHandleCommandPreAndPostInit();
+ void testHandleCommandPreInit();
+ void testHandleCommandPostInit();
+ void testHandleCommandPreAndPostInit();
- void testHandleCommandPluginFail();
- void testHandleCommandPluginFail1();
- void testHandleCommandPluginFail2();
+ void testHandleCommandPluginFail();
+ void testHandleCommandPluginFail1();
+ void testHandleCommandPluginFail2();
- void testPlayMedia();
- void testSetEmbedded();
+ void testPlayMedia();
+ void testSetEmbedded();
#endif
- // called after last test case executed
- void cleanupTestCase();
+
+ // called after last test case executed
+ void cleanupTestCase();
-signals:
+ signals:
- void aboutToQuit();
+ void aboutToQuit();
-private:
+ private:
- VideoServices* mTestObject;
- QVideoPlayerEngine* mEngine;
+ VideoServices* mTestObject;
+ VideoPlayerEngine* mEngine;
};
#endif // __TESTVIDEOSERVICES_H__
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoservices/src/testvideoservices.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoservices/src/testvideoservices.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: %
+// Version : %version: da1mmcf#4 %
// INCLUDES
#include <QtTest/QtTest>
@@ -54,7 +54,7 @@
TestVideoServices::TestVideoServices()
: mTestObject( 0 )
- , mEngine( 0 )
+ , mEngine( 0 )
{
MPX_DEBUG(_L("TestVideoServices::TestVideoServices()"));
}
@@ -80,41 +80,43 @@
delete mEngine;
mEngine = 0;
- QCOMPARE(mTestObject->mReferenceCount, 1);
- if(mTestObject)
- {
- mTestObject->decreaseReferenceCount();
- }
- mTestObject = 0;
+ QCOMPARE( mTestObject->mReferenceCount, 1 );
+
+ if ( mTestObject)
+ {
+ mTestObject->decreaseReferenceCount();
+ }
+
+ mTestObject = 0;
}
void TestVideoServices::testCreateDelete()
{
MPX_DEBUG(_L("TestVideoServices::testCreateDelete()"));
- mTestObject = VideoServices::instance();
+ mTestObject = VideoServices::instance();
- QVERIFY(mTestObject);
- QVERIFY(mTestObject->mServicePlay);
- QVERIFY(mTestObject->mServiceUriFetch);
- QVERIFY(mTestObject->mServiceView);
- QVERIFY(mTestObject->mEngine == 0);
- QVERIFY(mTestObject->mCurrentService == VideoServices::ENoService);
+ QVERIFY( mTestObject );
+ QVERIFY( mTestObject->mServicePlay );
+ QVERIFY( mTestObject->mServiceUriFetch );
+ QVERIFY( mTestObject->mServiceView );
+ QVERIFY( mTestObject->mEngine == 0 );
+ QVERIFY( mTestObject->mCurrentService == VideoServices::ENoService );
}
void TestVideoServices::testCreateDeleteEngine()
{
MPX_DEBUG(_L("TestVideoServices::testCreateDeleteEngine()"));
- mEngine = new QVideoPlayerEngine();
- mTestObject = VideoServices::instance(mEngine);
+ mEngine = new VideoPlayerEngine();
+ mTestObject = VideoServices::instance(mEngine);
- QVERIFY(mTestObject);
- QVERIFY(mTestObject->mServicePlay);
- QVERIFY(mTestObject->mServiceUriFetch);
- QVERIFY(mTestObject->mServiceView);
- QVERIFY(mTestObject->mEngine == mEngine);
- QVERIFY(mTestObject->mCurrentService == VideoServices::ENoService);
+ QVERIFY( mTestObject );
+ QVERIFY( mTestObject->mServicePlay );
+ QVERIFY( mTestObject->mServiceUriFetch );
+ QVERIFY( mTestObject->mServiceView );
+ QVERIFY( mTestObject->mEngine == mEngine );
+ QVERIFY( mTestObject->mCurrentService == VideoServices::ENoService );
}
@@ -122,41 +124,41 @@
{
MPX_DEBUG(_L("TestVideoServices::testCurrentService()"));
- mTestObject = VideoServices::instance();
+ mTestObject = VideoServices::instance();
- QVERIFY(mTestObject);
- QVERIFY(mTestObject->mServicePlay);
- QVERIFY(mTestObject->mServiceUriFetch);
- QVERIFY(mTestObject->mServiceView);
- QVERIFY(mTestObject->mEngine == 0);
- QVERIFY(mTestObject->mCurrentService == VideoServices::ENoService);
+ QVERIFY( mTestObject );
+ QVERIFY( mTestObject->mServicePlay );
+ QVERIFY( mTestObject->mServiceUriFetch );
+ QVERIFY( mTestObject->mServiceView );
+ QVERIFY( mTestObject->mEngine == 0 );
+ QVERIFY( mTestObject->mCurrentService == VideoServices::ENoService );
- mTestObject->mServicePlay->playMedia(QString());
- QVERIFY(mTestObject->mCurrentService == VideoServices::ENoService);
+ mTestObject->mServicePlay->playMedia( QString() );
+ QVERIFY( mTestObject->mCurrentService == VideoServices::ENoService );
- mTestObject->mServiceUriFetch->fetch(QString());
- QVERIFY(mTestObject->mCurrentService == VideoServices::EUriFetcher);
+ mTestObject->mServiceUriFetch->fetch( QString() );
+ QVERIFY( mTestObject->mCurrentService == VideoServices::EUriFetcher );
- mTestObject->mServicePlay->playMedia(QString());
- QVERIFY(mTestObject->mCurrentService == VideoServices::EUriFetcher);
+ mTestObject->mServicePlay->playMedia( QString() );
+ QVERIFY( mTestObject->mCurrentService == VideoServices::EUriFetcher );
- cleanup();
+ cleanup();
- mEngine = new QVideoPlayerEngine();
- mTestObject = VideoServices::instance(mEngine);
+ mEngine = new VideoPlayerEngine();
+ mTestObject = VideoServices::instance(mEngine);
- QVERIFY(mTestObject);
- QVERIFY(mTestObject->mServicePlay);
- QVERIFY(mTestObject->mServiceUriFetch);
- QVERIFY(mTestObject->mServiceView);
- QVERIFY(mTestObject->mEngine == mEngine);
- QVERIFY(mTestObject->mCurrentService == VideoServices::ENoService);
+ QVERIFY( mTestObject );
+ QVERIFY( mTestObject->mServicePlay );
+ QVERIFY( mTestObject->mServiceUriFetch );
+ QVERIFY( mTestObject->mServiceView );
+ QVERIFY( mTestObject->mEngine == mEngine );
+ QVERIFY( mTestObject->mCurrentService == VideoServices::ENoService );
- mTestObject->mServiceUriFetch->fetch(QString());
- QVERIFY(mTestObject->mCurrentService == VideoServices::EUriFetcher);
+ mTestObject->mServiceUriFetch->fetch( QString() );
+ QVERIFY( mTestObject->mCurrentService == VideoServices::EUriFetcher );
- mTestObject->mServicePlay->playMedia(QString());
- QVERIFY(mTestObject->mCurrentService == VideoServices::EPlayback);
+ mTestObject->mServicePlay->playMedia( QString() );
+ QVERIFY( mTestObject->mCurrentService == VideoServices::EPlayback );
}
void TestVideoServices::cleanupTestCase()
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoservices/stub/inc/videoplayerengine.h Fri Jul 02 17:14:33 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoservices/stub/inc/videoplayerengine.h Thu Jul 08 13:05:19 2010 +0300
@@ -11,11 +11,11 @@
*
* Contributors:
*
-* Description: Implementation of QVideoPlayerEngine
+* Description: Implementation of VideoPlayerEngine
*
*/
-// Version : %version: da1mmcf#2 %
+// Version : %version: da1mmcf#3 %
#ifndef VIDEOPLAYERENGINE_H
#define VIDEOPLAYERENGINE_H
@@ -26,25 +26,25 @@
//FORWARD CLASS DECLARATION
/**
- * QVideoPlayerEngine
+ * VideoPlayerEngine
*
*/
-class QVideoPlayerEngine: public QObject
+class VideoPlayerEngine: public QObject
{
Q_OBJECT
public:
+
/**
* Constructor
*/
- QVideoPlayerEngine(bool isService = false);
+ VideoPlayerEngine( bool isService = false );
/**
* Destructor.
*/
- virtual ~QVideoPlayerEngine();
+ virtual ~VideoPlayerEngine();
- public:
void initialize();
void playMedia( QString filePath );
void playMedia( RFile file );
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoservices/stub/src/videoplayerengine.cpp Fri Jul 02 17:14:33 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoservices/stub/src/videoplayerengine.cpp Thu Jul 08 13:05:19 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#3 %
+// Version : %version: da1mmcf#4 %
#include <qapplication>
@@ -26,45 +26,45 @@
#include <xqserviceutil.h>
#include "videoplayerengine.h"
-#include "mpxvideoplaybackwrapper.h"
+#include "videoplaybackwrapper.h"
#include "mpxvideo_debug.h"
// -------------------------------------------------------------------------------------------------
-// QVideoPlayerEngine()
+// VideoPlayerEngine()
// -------------------------------------------------------------------------------------------------
//
-QVideoPlayerEngine::QVideoPlayerEngine(bool isService)
+VideoPlayerEngine::VideoPlayerEngine( bool isService )
: mIsService( isService )
, mEmbedded( false )
{
- MPX_DEBUG(_L("QVideoPlayerEngine::QVideoPlayerEngine()"));
+ MPX_DEBUG(_L("VideoPlayerEngine::VideoPlayerEngine()"));
}
// -------------------------------------------------------------------------------------------------
-// ~QVideoPlayerEngine()
+// ~VideoPlayerEngine()
// -------------------------------------------------------------------------------------------------
//
-QVideoPlayerEngine::~QVideoPlayerEngine()
+VideoPlayerEngine::~VideoPlayerEngine()
{
- MPX_DEBUG(_L("QVideoPlayerEngine::~QVideoPlayerEngine()"));
+ MPX_DEBUG(_L("VideoPlayerEngine::~VideoPlayerEngine()"));
}
// -------------------------------------------------------------------------------------------------
// initialize()
// -------------------------------------------------------------------------------------------------
//
-void QVideoPlayerEngine::initialize()
+void VideoPlayerEngine::initialize()
{
- MPX_DEBUG(_L("QVideoPlayerEngine::initialize()"));
+ MPX_DEBUG(_L("VideoPlayerEngine::initialize()"));
}
// -------------------------------------------------------------------------------------------------
// handleCommand()
// -------------------------------------------------------------------------------------------------
//
-void QVideoPlayerEngine::handleCommand( int commandCode )
+void VideoPlayerEngine::handleCommand( int commandCode )
{
- MPX_DEBUG(_L("QVideoPlayerEngine::initialize()"));
+ MPX_DEBUG(_L("VideoPlayerEngine::initialize()"));
Q_UNUSED( commandCode );
}
@@ -73,9 +73,9 @@
// handleQuit()
// -------------------------------------------------------------------------------------------------
//
-void QVideoPlayerEngine::handleQuit()
+void VideoPlayerEngine::handleQuit()
{
- MPX_DEBUG(_L("QVideoPlayerEngine::handleQuit()"));
+ MPX_DEBUG(_L("VideoPlayerEngine::handleQuit()"));
delete this;
}
@@ -84,9 +84,9 @@
// playMedia()
// -------------------------------------------------------------------------------------------------
//
-void QVideoPlayerEngine::playMedia( QString filePath )
+void VideoPlayerEngine::playMedia( QString filePath )
{
- MPX_DEBUG(_L("QVideoPlayerEngine::playMedia()"));
+ MPX_DEBUG(_L("VideoPlayerEngine::playMedia()"));
Q_UNUSED( filePath );
}
@@ -94,9 +94,9 @@
// setEmbedded()
// -------------------------------------------------------------------------------------------------
//
-void QVideoPlayerEngine::setEmbedded()
+void VideoPlayerEngine::setEmbedded()
{
- MPX_DEBUG(_L("QVideoPlayerEngine::setEmbedded()"));
+ MPX_DEBUG(_L("VideoPlayerEngine::setEmbedded()"));
mEmbedded = true;
}
@@ -104,9 +104,9 @@
// playMedia()
// -------------------------------------------------------------------------------------------------
//
-void QVideoPlayerEngine::playMedia( RFile file )
+void VideoPlayerEngine::playMedia( RFile file )
{
- MPX_DEBUG(_L("QVideoPlayerEngine::playMedia( file )"));
+ MPX_DEBUG(_L("VideoPlayerEngine::playMedia( file )"));
Q_UNUSED( file );
}
--- a/videoplayerapp/videoplayerengine/videoplayerengine.pro Fri Jul 02 17:14:33 2010 +0300
+++ b/videoplayerapp/videoplayerengine/videoplayerengine.pro Thu Jul 08 13:05:19 2010 +0300
@@ -14,12 +14,12 @@
# Description: Project file for building Videoplayer components
#
#
-# Version : %version: 27 %
+# Version : %version: 29 %
TEMPLATE = lib
+CONFIG += hb qt dll
TARGET = videoplayerengine
-CONFIG += hb qt dll
DEFINES += BUILD_VIDEOPLAYERAPP_DLL
symbian:
@@ -37,7 +37,7 @@
"$${LITERAL_HASH}else" \
"DEFFILE ../bwins/videoplayerengine.def" \
"$${LITERAL_HASH}endif"
- MMP_RULES += defBlock
+ MMP_RULES += defBlock SMPSAFE
}
INCLUDEPATH += ../../inc \
@@ -61,17 +61,17 @@
VPATH += src
HEADERS += videoplayerengine.h \
- mpxvideoplaybackwrapper.h \
- mpxvideoplayerappuiengine.h \
- videoservices.h \
- videoserviceplay.h \
- videoserviceurifetch.h \
- videoserviceview.h \
- videoservicebrowse.h \
- videoactivitystate.h
+ videoplaybackwrapper.h \
+ mpxvideoplayerappuiengine.h \
+ videoservices.h \
+ videoserviceplay.h \
+ videoserviceurifetch.h \
+ videoserviceview.h \
+ videoservicebrowse.h \
+ videoactivitystate.h
SOURCES += videoplayerengine.cpp \
- mpxvideoplaybackwrapper.cpp \
+ videoplaybackwrapper.cpp \
mpxvideoplayerappuiengine.cpp \
videoservices.cpp \
videoserviceplay.cpp \