--- a/inc/videoactivitystate.h Tue Jul 06 14:17:50 2010 +0300
+++ b/inc/videoactivitystate.h Wed Aug 18 09:50:14 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#3 %
+// Version : %version: da1mmcf#4 %
#ifndef __VIDEOACTIVITYSTATE_H__
#define __VIDEOACTIVITYSTATE_H__
@@ -30,6 +30,9 @@
// last position of the last played media clip (int)
static const QString KEY_LAST_PLAY_POSITION_ID = "_VideoActivity_last_play_position_id_";
+// TMPXId of the last played media file
+static const QString KEY_LAST_PLAYED_MEDIA_ID = "_VideoActivity_last_played_media_id_";
+
// name of the media clip last played (QString)
static const QString KEY_LAST_PLAYED_CLIP = "_VideoActivity_last_played_clip_";
--- a/inc/videoservices.h Tue Jul 06 14:17:50 2010 +0300
+++ b/inc/videoservices.h Wed Aug 18 09:50:14 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 5 %
+// Version : %version: 7 %
#ifndef __VIDEOSERVICES_H__
#define __VIDEOSERVICES_H__
@@ -28,221 +28,218 @@
class VideoServicePlay;
class VideoServiceView;
class VideoServiceBrowse;
-class QVideoPlayerEngine;
+class VideoPlayerEngine;
+class VideoServiceUri;
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,
+ EUriView,
+ 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 the current engine
+ *
+ * @return engine
+ *
+ */
+ VideoPlayerEngine* engine();
- /**
- * 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;
+ 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;
+
+ /**
+ * VideoServiceUri service instance.
+ */
+ VideoServiceUri *mServiceUriView;
+
+ /**
+ * 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;
+ friend class VideoServiceUri;
+
+ public:
+
+ /*
+ * indicate fetch service and attach operation has been selected
+ */
+ bool mFetchSelected;
+
+};
#endif //__VIDEOSERVICES_H__
--- a/mediasettings/mediasettingsengine/group/MPSettROPModel.mmp Tue Jul 06 14:17:50 2010 +0300
+++ b/mediasettings/mediasettingsengine/group/MPSettROPModel.mmp Wed Aug 18 09:50:14 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/src/videosettingsgroup.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/mediasettings/videosettingsplugin/src/videosettingsgroup.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -100,45 +100,39 @@
// Access point in use
mAccessPointItem = new VideoSettingsAccessPointEntry(itemDataHelper,
hbTrId("txt_videos_dblist_access_point"), this);
- this->appendChild(mAccessPointItem);
// Lowest UDP port
mLowestUDPPortItem = new CpSettingFormItemData(HbDataFormModelItem::TextItem,
- hbTrId("txt_videos_dblist_min_udp_port"));
+ hbTrId("txt_videos_dblist_min_udp_port"), this);
mLowestUDPPortItem->setContentWidgetData(QString("maxRows"), 1);
mItemDataHelper.addConnection(mLowestUDPPortItem, SIGNAL(editingFinished()),
this, SLOT(lowestUdpPortEditingFinished()));
- this->appendChild(mLowestUDPPortItem);
// Highest UDP port
mHighestUDPPortItem = new CpSettingFormItemData(HbDataFormModelItem::TextItem,
- hbTrId("txt_videos_dblist_max_udp_port"));
+ hbTrId("txt_videos_dblist_max_udp_port"), this);
mHighestUDPPortItem->setContentWidgetData(QString("maxRows"), 1);
mItemDataHelper.addConnection(mHighestUDPPortItem, SIGNAL(editingFinished()),
this, SLOT(highestUdpPortEditingFinished()));
- this->appendChild(mHighestUDPPortItem);
// Use proxy
- mUseProxyItem = new CpSettingFormItemData(HbDataFormModelItem::CheckBoxItem, QString());
+ mUseProxyItem = new CpSettingFormItemData(HbDataFormModelItem::CheckBoxItem, QString(), this);
mUseProxyItem->setContentWidgetData(QString("text"), hbTrId("txt_videos_formlabel_proxy_in_use"));
- this->appendChild(mUseProxyItem);
// Proxy server address
mProxyServerItem = new CpSettingFormItemData(HbDataFormModelItem::TextItem,
- hbTrId("txt_videos_dblist_proxy_host_name"));
+ hbTrId("txt_videos_dblist_proxy_host_name"), this);
mProxyServerItem->setContentWidgetData(QString("maxRows"), 1);
mProxyServerItem->setContentWidgetData(QString("placeholderText"), hbTrId("txt_videos_dblist_none"));
mItemDataHelper.addConnection(mProxyServerItem, SIGNAL(editingFinished()),
this, SLOT(proxyServerEditingFinished()));
- this->appendChild(mProxyServerItem);
// Proxy port number
mProxyPortItem = new CpSettingFormItemData(HbDataFormModelItem::TextItem,
- hbTrId("txt_videos_dblist_proxy_port"));
+ hbTrId("txt_videos_dblist_proxy_port"), this);
mProxyPortItem->setContentWidgetData(QString("maxRows"), 1);
mItemDataHelper.addConnection(mProxyPortItem, SIGNAL(editingFinished()),
this, SLOT(proxyPortEditingFinished()));
- this->appendChild(mProxyPortItem);
loadSettings();
}
--- a/mediasettings/videosettingsplugin/tsrc/testgroup/src/testvideosettingsgroup.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/mediasettings/videosettingsplugin/tsrc/testgroup/src/testvideosettingsgroup.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -26,7 +26,7 @@
#include "testvideosettingsgroup.h"
#include "videosettingsaccesspointentry.h"
-#include "mpsettingsmodel.h"
+#include "stub/inc/mpsettingsmodel.h"
#include "hbdataformmodel.h"
#include "cpitemdatahelper.h"
#include "hbvalidator.h"
--- a/mediasettings/videosettingsplugin/tsrc/testgroup/stub/inc/mpsettingsmodel.h Tue Jul 06 14:17:50 2010 +0300
+++ b/mediasettings/videosettingsplugin/tsrc/testgroup/stub/inc/mpsettingsmodel.h Wed Aug 18 09:50:14 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 2 %
+// Version : %version: 3 %
@@ -85,13 +85,13 @@
* EConfigDefault: Load default values
* EConfigUser: Load user values
*/
- void LoadSettingsL(TInt aConfigVersion);
+ virtual void LoadSettingsL(TInt aConfigVersion);
/**
* Writes settings to MMF controller.
* @since 2.0
*/
- void StoreSettingsL();
+ virtual void StoreSettingsL();
/**
* Sets proxy mode..
@@ -99,7 +99,7 @@
* @param aMode Proxy mode.
* @return Error value.
*/
- TInt SetProxyMode(TInt aMode);
+ virtual TInt SetProxyMode(TInt aMode);
/**
* Returns proxy mode.
@@ -109,7 +109,7 @@
* 1: Enabled
* @return Error value.
*/
- TInt GetProxyMode(TInt& aMode);
+ virtual TInt GetProxyMode(TInt& aMode);
/**
* Sets Proxy host name.
@@ -117,7 +117,7 @@
* @param aHostName Proxy host name.
* @return Error value.
*/
- TInt SetProxyHostNameL(const TDesC& aHostName);
+ virtual TInt SetProxyHostNameL(const TDesC& aHostName);
/**
* Returns proxy host name.
@@ -125,7 +125,7 @@
* @param aHostName Proxy host name.
* @return Error value.
*/
- TInt GetProxyHostName(TDes& aHostName);
+ virtual TInt GetProxyHostName(TDes& aHostName);
/**
* Sets proxy port number.
@@ -133,7 +133,7 @@
* @param aPort Proxy port number.
* @return Error value.
*/
- TInt SetProxyPort(TInt aPort);
+ virtual TInt SetProxyPort(TInt aPort);
/**
* Returns proxy port number..
@@ -141,7 +141,7 @@
* @return Integer: Proxy port number.
* @return Error value.
*/
- TInt GetProxyPort(TInt& aPort);
+ virtual TInt GetProxyPort(TInt& aPort);
/**
* Sets default access point.
@@ -149,7 +149,7 @@
* @param aApId Access point ID.
* @return Error value.
*/
- TInt SetDefaultAp(TUint32 aApId);
+ virtual TInt SetDefaultAp(TUint32 aApId);
/**
* Returns default access point ID.
@@ -157,7 +157,7 @@
* @param aApId Access point ID.
* @return Error value.
*/
- TInt GetDefaultAp(TUint32& aApId);
+ virtual TInt GetDefaultAp(TUint32& aApId);
/**
* Sets minimum UDP port number.
@@ -165,7 +165,7 @@
* @param aPort minimum port number.
* @return Error value.
*/
- TInt SetMinUDPPort(TInt aPort);
+ virtual TInt SetMinUDPPort(TInt aPort);
/**
* Returns minimum UDP port number.
@@ -173,7 +173,7 @@
* @param aPort minimum UDP port number in minutes.
* @return Error value.
*/
- TInt GetMinUDPPort(TInt& aPort);
+ virtual TInt GetMinUDPPort(TInt& aPort);
/**
* Sets maximum UDP port number.
@@ -181,7 +181,7 @@
* @param aPort maximum port number.
* @return Error value.
*/
- TInt SetMaxUDPPort(TInt aPort);
+ virtual TInt SetMaxUDPPort(TInt aPort);
/**
* Returns maximum UDP port number.
@@ -189,7 +189,7 @@
* @param aPort maximum UDP port number in minutes.
* @return Error value.
*/
- TInt GetMaxUDPPort(TInt& aPort);
+ virtual TInt GetMaxUDPPort(TInt& aPort);
public:
static TUid mImplUid;
--- a/mediasettings/videosettingsplugin/tsrc/testgroup/stub/src/mpsettingsmodel.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/mediasettings/videosettingsplugin/tsrc/testgroup/stub/src/mpsettingsmodel.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -16,7 +16,7 @@
*/
// INCLUDE FILES
-#include "mpsettingsmodel.h"
+#include "stub/inc/mpsettingsmodel.h"
#include <qglobal.h>
#include <xqconversions.h>
--- a/mediasettings/videosettingsplugin/tsrc/testgroup/stub/src/videosettingsaccesspointentry.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/mediasettings/videosettingsplugin/tsrc/testgroup/stub/src/videosettingsaccesspointentry.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -16,6 +16,7 @@
*/
#include "videosettingsaccesspointentry.h"
+#include "videosettingsgroup.h"
#include <cpitemdatahelper.h>
// ---------------------------------------------------------------------------
@@ -30,6 +31,7 @@
mText(text),
mParent(parent)
{
+ mParent->appendChild(this);
Q_UNUSED(itemDataHelper);
}
--- a/mediasettings/videosettingsplugin/tsrc/testgroup/testvideosettingsgroup.pro Tue Jul 06 14:17:50 2010 +0300
+++ b/mediasettings/videosettingsplugin/tsrc/testgroup/testvideosettingsgroup.pro Wed Aug 18 09:50:14 2010 +0300
@@ -21,11 +21,24 @@
inc \
src
-INCLUDEPATH += inc \
- stub/inc \
- ../../inc \
- ../../../mediasettingsengine/inc \
- ../../../../inc \
+INCLUDEPATH = inc \
+ stub/inc \
+ ../../inc \
+ ../../../mediasettingsengine/inc \
+ ../../../../inc \
+ /epoc32/include \
+ /epoc32/include/stdapis \
+ /epoc32/include/stdapis/sys \
+ /epoc32/include/platform/mw \
+ /epoc32/include/platform \
+ /epoc32/include/platform/loc \
+ /epoc32/include/platform/mw/loc \
+ /epoc32/include/platform/loc/sc \
+ /epoc32/include/platform/mw/loc/sc \
+ /epoc32/include/mw/hb/hbcore \
+ /epoc32/include/mw/hb/hbwidgets \
+ /epoc32/include/mw/hb/hbutils \
+ /epoc32/include/stdapis/stlportv5 \
CONFIG += qtestlib \
Hb \
--- a/mediasettings/videosettingsplugin/videosettingsplugin.pro Tue Jul 06 14:17:50 2010 +0300
+++ b/mediasettings/videosettingsplugin/videosettingsplugin.pro Wed Aug 18 09:50:14 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/bwins/videocollectionwrapperu.def Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/bwins/videocollectionwrapperu.def Wed Aug 18 09:50:14 2010 +0300
@@ -1,78 +1,78 @@
EXPORTS
- ?getThumbnail@VideoThumbnailData@@QAEPBVQIcon@@VTMPXItemId@@@Z @ 1 NONAME ; class QIcon const * VideoThumbnailData::getThumbnail(class TMPXItemId)
- ?sendAsyncStatus@VideoCollectionWrapper@@QAEXHAAVQVariant@@@Z @ 2 NONAME ; void VideoCollectionWrapper::sendAsyncStatus(int, class QVariant &)
- ??1VideoSortFilterProxyModel@@UAE@XZ @ 3 NONAME ; VideoSortFilterProxyModel::~VideoSortFilterProxyModel(void)
- ?removeThumbnail@VideoThumbnailData@@QAE_NVTMPXItemId@@@Z @ 4 NONAME ; bool VideoThumbnailData::removeThumbnail(class TMPXItemId)
- ?open@VideoSortFilterProxyModel@@QAEHW4TCollectionLevels@VideoCollectionCommon@@@Z @ 5 NONAME ; int VideoSortFilterProxyModel::open(enum VideoCollectionCommon::TCollectionLevels)
- ?deleteItems@VideoSortFilterProxyModel@@QAEHABV?$QList@VQModelIndex@@@@@Z @ 6 NONAME ; int VideoSortFilterProxyModel::deleteItems(class QList<class QModelIndex> const &)
- ?trUtf8@VideoThumbnailData@@SA?AVQString@@PBD0@Z @ 7 NONAME ; class QString VideoThumbnailData::trUtf8(char const *, char const *)
- ?removeItemsFromAlbum@VideoSortFilterProxyModel@@QAEHAAVTMPXItemId@@ABV?$QList@VTMPXItemId@@@@@Z @ 8 NONAME ; int VideoSortFilterProxyModel::removeItemsFromAlbum(class TMPXItemId &, class QList<class TMPXItemId> const &)
- ?instance@VideoCollectionWrapper@@SAAAV1@XZ @ 9 NONAME ; class VideoCollectionWrapper & VideoCollectionWrapper::instance(void)
- ?back@VideoSortFilterProxyModel@@QAEHXZ @ 10 NONAME ; int VideoSortFilterProxyModel::back(void)
- ?modelReady@VideoSortFilterProxyModel@@IAEXXZ @ 11 NONAME ; void VideoSortFilterProxyModel::modelReady(void)
- ?albumChangedSlot@VideoSortFilterProxyModel@@AAEXXZ @ 12 NONAME ; void VideoSortFilterProxyModel::albumChangedSlot(void)
- ?qt_metacall@VideoThumbnailData@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 13 NONAME ; int VideoThumbnailData::qt_metacall(enum QMetaObject::Call, int, void * *)
- ??1VideoThumbnailData@@EAE@XZ @ 14 NONAME ; VideoThumbnailData::~VideoThumbnailData(void)
- ??_EVideoThumbnailData@@UAE@I@Z @ 15 NONAME ; VideoThumbnailData::~VideoThumbnailData(unsigned int)
- ?getMediaFilePathForId@VideoSortFilterProxyModel@@QAE?AVQString@@VTMPXItemId@@@Z @ 16 NONAME ; class QString VideoSortFilterProxyModel::getMediaFilePathForId(class TMPXItemId)
- ?setAlbumInUse@VideoSortFilterProxyModel@@QAEXVTMPXItemId@@@Z @ 17 NONAME ; void VideoSortFilterProxyModel::setAlbumInUse(class TMPXItemId)
- ?qt_metacast@VideoCollectionWrapper@@UAEPAXPBD@Z @ 18 NONAME ; void * VideoCollectionWrapper::qt_metacast(char const *)
- ?addItemsInAlbum@VideoSortFilterProxyModel@@QAEHAAVTMPXItemId@@ABV?$QList@VTMPXItemId@@@@@Z @ 19 NONAME ; int VideoSortFilterProxyModel::addItemsInAlbum(class TMPXItemId &, class QList<class TMPXItemId> const &)
- ?tr@VideoSortFilterProxyModel@@SA?AVQString@@PBD0H@Z @ 20 NONAME ; class QString VideoSortFilterProxyModel::tr(char const *, char const *, int)
- ?removeAlbums@VideoSortFilterProxyModel@@QAEHABV?$QList@VQModelIndex@@@@@Z @ 21 NONAME ; int VideoSortFilterProxyModel::removeAlbums(class QList<class QModelIndex> const &)
- ?instance@VideoThumbnailData@@SAAAV1@XZ @ 22 NONAME ; class VideoThumbnailData & VideoThumbnailData::instance(void)
- ?getType@VideoSortFilterProxyModel@@QAE?AW4TModelType@VideoCollectionCommon@@XZ @ 23 NONAME ; enum VideoCollectionCommon::TModelType VideoSortFilterProxyModel::getType(void)
- ?fetchItemDetails@VideoSortFilterProxyModel@@QAEHABVQModelIndex@@@Z @ 24 NONAME ; int VideoSortFilterProxyModel::fetchItemDetails(class QModelIndex const &)
- ??0VideoCollectionWrapper@@AAE@XZ @ 25 NONAME ; VideoCollectionWrapper::VideoCollectionWrapper(void)
- ?metaObject@VideoSortFilterProxyModel@@UBEPBUQMetaObject@@XZ @ 26 NONAME ; struct QMetaObject const * VideoSortFilterProxyModel::metaObject(void) const
- ?metaObject@VideoCollectionWrapper@@UBEPBUQMetaObject@@XZ @ 27 NONAME ; struct QMetaObject const * VideoCollectionWrapper::metaObject(void) const
- ?lessThan@VideoSortFilterProxyModel@@MBE_NABVQModelIndex@@0@Z @ 28 NONAME ; bool VideoSortFilterProxyModel::lessThan(class QModelIndex const &, class QModelIndex const &) const
- ?getStaticMetaObject@VideoCollectionWrapper@@SAABUQMetaObject@@XZ @ 29 NONAME ; struct QMetaObject const & VideoCollectionWrapper::getStaticMetaObject(void)
- ?indexOfId@VideoSortFilterProxyModel@@QAE?AVQModelIndex@@VTMPXItemId@@@Z @ 30 NONAME ; class QModelIndex VideoSortFilterProxyModel::indexOfId(class TMPXItemId)
- ?getStaticMetaObject@VideoSortFilterProxyModel@@SAABUQMetaObject@@XZ @ 31 NONAME ; struct QMetaObject const & VideoSortFilterProxyModel::getStaticMetaObject(void)
- ?trUtf8@VideoSortFilterProxyModel@@SA?AVQString@@PBD0@Z @ 32 NONAME ; class QString VideoSortFilterProxyModel::trUtf8(char const *, char const *)
- ?doSorting@VideoSortFilterProxyModel@@QAEXHW4SortOrder@Qt@@_N@Z @ 33 NONAME ; void VideoSortFilterProxyModel::doSorting(int, enum Qt::SortOrder, bool)
- ?getOpenItem@VideoSortFilterProxyModel@@QBE?AVTMPXItemId@@XZ @ 34 NONAME ; class TMPXItemId VideoSortFilterProxyModel::getOpenItem(void) const
- ?startBackgroundFetching@VideoThumbnailData@@QAEXPAVVideoSortFilterProxyModel@@H@Z @ 35 NONAME ; void VideoThumbnailData::startBackgroundFetching(class VideoSortFilterProxyModel *, int)
- ??_EVideoCollectionWrapper@@UAE@I@Z @ 36 NONAME ; VideoCollectionWrapper::~VideoCollectionWrapper(unsigned int)
- ?resolveAlbumName@VideoSortFilterProxyModel@@QBE?AVQString@@ABV2@@Z @ 37 NONAME ; class QString VideoSortFilterProxyModel::resolveAlbumName(class QString const &) const
- ?setGenericIdFilter@VideoSortFilterProxyModel@@QAEXVTMPXItemId@@_N@Z @ 38 NONAME ; void VideoSortFilterProxyModel::setGenericIdFilter(class TMPXItemId, bool)
- ?getStaticMetaObject@VideoThumbnailData@@SAABUQMetaObject@@XZ @ 39 NONAME ; struct QMetaObject const & VideoThumbnailData::getStaticMetaObject(void)
- ?qt_metacall@VideoCollectionWrapper@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 40 NONAME ; int VideoCollectionWrapper::qt_metacall(enum QMetaObject::Call, int, void * *)
- ?trUtf8@VideoThumbnailData@@SA?AVQString@@PBD0H@Z @ 41 NONAME ; class QString VideoThumbnailData::trUtf8(char const *, char const *, int)
- ?enableBackgroundFetching@VideoThumbnailData@@QAEX_N@Z @ 42 NONAME ; void VideoThumbnailData::enableBackgroundFetching(bool)
- ?getMediaIdAtIndex@VideoSortFilterProxyModel@@QBE?AVTMPXItemId@@ABVQModelIndex@@@Z @ 43 NONAME ; class TMPXItemId VideoSortFilterProxyModel::getMediaIdAtIndex(class QModelIndex const &) const
- ?renameAlbum@VideoSortFilterProxyModel@@QAEHABVTMPXItemId@@ABVQString@@@Z @ 44 NONAME ; int VideoSortFilterProxyModel::renameAlbum(class TMPXItemId const &, class QString const &)
- ?connectSignals@VideoSortFilterProxyModel@@AAE_NXZ @ 45 NONAME ; bool VideoSortFilterProxyModel::connectSignals(void)
- ?getModel@VideoCollectionWrapper@@QAEPAVVideoSortFilterProxyModel@@W4TModelType@VideoCollectionCommon@@@Z @ 46 NONAME ; class VideoSortFilterProxyModel * VideoCollectionWrapper::getModel(enum VideoCollectionCommon::TModelType)
- ?tr@VideoCollectionWrapper@@SA?AVQString@@PBD0H@Z @ 47 NONAME ; class QString VideoCollectionWrapper::tr(char const *, char const *, int)
- ?staticMetaObject@VideoSortFilterProxyModel@@2UQMetaObject@@B @ 48 NONAME ; struct QMetaObject const VideoSortFilterProxyModel::staticMetaObject
- ?tr@VideoSortFilterProxyModel@@SA?AVQString@@PBD0@Z @ 49 NONAME ; class QString VideoSortFilterProxyModel::tr(char const *, char const *)
- ?asyncStatus@VideoCollectionWrapper@@IAEXHAAVQVariant@@@Z @ 50 NONAME ; void VideoCollectionWrapper::asyncStatus(int, class QVariant &)
- ?initialize@VideoSortFilterProxyModel@@QAEHPAVVideoListDataModel@@@Z @ 51 NONAME ; int VideoSortFilterProxyModel::initialize(class VideoListDataModel *)
- ?modelChanged@VideoSortFilterProxyModel@@IAEXXZ @ 52 NONAME ; void VideoSortFilterProxyModel::modelChanged(void)
- ?itemModifiedSlot@VideoSortFilterProxyModel@@AAEXABVTMPXItemId@@@Z @ 53 NONAME ; void VideoSortFilterProxyModel::itemModifiedSlot(class TMPXItemId const &)
- ?thumbnailsFetched@VideoThumbnailData@@IAEXV?$QList@VTMPXItemId@@@@@Z @ 54 NONAME ; void VideoThumbnailData::thumbnailsFetched(class QList<class TMPXItemId>)
- ?trUtf8@VideoCollectionWrapper@@SA?AVQString@@PBD0@Z @ 55 NONAME ; class QString VideoCollectionWrapper::trUtf8(char const *, char const *)
- ?processSorting@VideoSortFilterProxyModel@@AAEXXZ @ 56 NONAME ; void VideoSortFilterProxyModel::processSorting(void)
- ?getSorting@VideoSortFilterProxyModel@@QAEXAAHAAW4SortOrder@Qt@@@Z @ 57 NONAME ; void VideoSortFilterProxyModel::getSorting(int &, enum Qt::SortOrder &)
- ?filterAcceptsRow@VideoSortFilterProxyModel@@MBE_NHABVQModelIndex@@@Z @ 58 NONAME ; bool VideoSortFilterProxyModel::filterAcceptsRow(int, class QModelIndex const &) const
- ?metaObject@VideoThumbnailData@@UBEPBUQMetaObject@@XZ @ 59 NONAME ; struct QMetaObject const * VideoThumbnailData::metaObject(void) const
- ?tr@VideoThumbnailData@@SA?AVQString@@PBD0H@Z @ 60 NONAME ; class QString VideoThumbnailData::tr(char const *, char const *, int)
- ?disconnectSignals@VideoSortFilterProxyModel@@AAEXXZ @ 61 NONAME ; void VideoSortFilterProxyModel::disconnectSignals(void)
- ?trUtf8@VideoSortFilterProxyModel@@SA?AVQString@@PBD0H@Z @ 62 NONAME ; class QString VideoSortFilterProxyModel::trUtf8(char const *, char const *, int)
- ?openItem@VideoSortFilterProxyModel@@QAEHVTMPXItemId@@@Z @ 63 NONAME ; int VideoSortFilterProxyModel::openItem(class TMPXItemId)
- ?qt_metacast@VideoThumbnailData@@UAEPAXPBD@Z @ 64 NONAME ; void * VideoThumbnailData::qt_metacast(char const *)
- ?tr@VideoCollectionWrapper@@SA?AVQString@@PBD0@Z @ 65 NONAME ; class QString VideoCollectionWrapper::tr(char const *, char const *)
- ??_EVideoSortFilterProxyModel@@UAE@I@Z @ 66 NONAME ; VideoSortFilterProxyModel::~VideoSortFilterProxyModel(unsigned int)
- ??0VideoSortFilterProxyModel@@QAE@W4TModelType@VideoCollectionCommon@@PAVQObject@@@Z @ 67 NONAME ; VideoSortFilterProxyModel::VideoSortFilterProxyModel(enum VideoCollectionCommon::TModelType, class QObject *)
- ?addNewAlbum@VideoSortFilterProxyModel@@QAE?AVTMPXItemId@@ABVQString@@@Z @ 68 NONAME ; class TMPXItemId VideoSortFilterProxyModel::addNewAlbum(class QString const &)
- ?enableThumbnailCreation@VideoThumbnailData@@QAEX_N@Z @ 69 NONAME ; void VideoThumbnailData::enableThumbnailCreation(bool)
- ?qt_metacall@VideoSortFilterProxyModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 70 NONAME ; int VideoSortFilterProxyModel::qt_metacall(enum QMetaObject::Call, int, void * *)
- ?freeThumbnailData@VideoThumbnailData@@QAEXXZ @ 71 NONAME ; void VideoThumbnailData::freeThumbnailData(void)
- ?shortDetailsReady@VideoSortFilterProxyModel@@IAEXVTMPXItemId@@@Z @ 72 NONAME ; void VideoSortFilterProxyModel::shortDetailsReady(class TMPXItemId)
- ?qt_metacast@VideoSortFilterProxyModel@@UAEPAXPBD@Z @ 73 NONAME ; void * VideoSortFilterProxyModel::qt_metacast(char const *)
- ?staticMetaObject@VideoCollectionWrapper@@2UQMetaObject@@B @ 74 NONAME ; struct QMetaObject const VideoCollectionWrapper::staticMetaObject
+ ?sendAsyncStatus@VideoCollectionWrapper@@QAEXHAAVQVariant@@@Z @ 1 NONAME ; void VideoCollectionWrapper::sendAsyncStatus(int, class QVariant &)
+ ??1VideoSortFilterProxyModel@@UAE@XZ @ 2 NONAME ; VideoSortFilterProxyModel::~VideoSortFilterProxyModel(void)
+ ?open@VideoSortFilterProxyModel@@QAEHW4TCollectionLevels@VideoCollectionCommon@@@Z @ 3 NONAME ; int VideoSortFilterProxyModel::open(enum VideoCollectionCommon::TCollectionLevels)
+ ?deleteItems@VideoSortFilterProxyModel@@QAEHABV?$QList@VQModelIndex@@@@@Z @ 4 NONAME ; int VideoSortFilterProxyModel::deleteItems(class QList<class QModelIndex> const &)
+ ?trUtf8@VideoThumbnailData@@SA?AVQString@@PBD0@Z @ 5 NONAME ; class QString VideoThumbnailData::trUtf8(char const *, char const *)
+ ?removeItemsFromAlbum@VideoSortFilterProxyModel@@QAEHAAVTMPXItemId@@ABV?$QList@VTMPXItemId@@@@@Z @ 6 NONAME ; int VideoSortFilterProxyModel::removeItemsFromAlbum(class TMPXItemId &, class QList<class TMPXItemId> const &)
+ ?instance@VideoCollectionWrapper@@SAAAV1@XZ @ 7 NONAME ; class VideoCollectionWrapper & VideoCollectionWrapper::instance(void)
+ ?back@VideoSortFilterProxyModel@@QAEHXZ @ 8 NONAME ; int VideoSortFilterProxyModel::back(void)
+ ?modelReady@VideoSortFilterProxyModel@@IAEXXZ @ 9 NONAME ; void VideoSortFilterProxyModel::modelReady(void)
+ ?albumChangedSlot@VideoSortFilterProxyModel@@AAEXXZ @ 10 NONAME ; void VideoSortFilterProxyModel::albumChangedSlot(void)
+ ?qt_metacall@VideoThumbnailData@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 11 NONAME ; int VideoThumbnailData::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ?backgroundFetchingEnabled@VideoThumbnailData@@QAE_NXZ @ 12 NONAME ; bool VideoThumbnailData::backgroundFetchingEnabled(void)
+ ??1VideoThumbnailData@@EAE@XZ @ 13 NONAME ; VideoThumbnailData::~VideoThumbnailData(void)
+ ??_EVideoThumbnailData@@UAE@I@Z @ 14 NONAME ; VideoThumbnailData::~VideoThumbnailData(unsigned int)
+ ?qt_metacast@VideoCollectionWrapper@@UAEPAXPBD@Z @ 15 NONAME ; void * VideoCollectionWrapper::qt_metacast(char const *)
+ ?addItemsInAlbum@VideoSortFilterProxyModel@@QAEHAAVTMPXItemId@@ABV?$QList@VTMPXItemId@@@@@Z @ 16 NONAME ; int VideoSortFilterProxyModel::addItemsInAlbum(class TMPXItemId &, class QList<class TMPXItemId> const &)
+ ?tr@VideoSortFilterProxyModel@@SA?AVQString@@PBD0H@Z @ 17 NONAME ; class QString VideoSortFilterProxyModel::tr(char const *, char const *, int)
+ ?getMediaIdAtIndex@VideoSortFilterProxyModel@@QBEABVTMPXItemId@@ABVQModelIndex@@@Z @ 18 NONAME ; class TMPXItemId const & VideoSortFilterProxyModel::getMediaIdAtIndex(class QModelIndex const &) const
+ ?removeAlbums@VideoSortFilterProxyModel@@QAEHABV?$QList@VQModelIndex@@@@@Z @ 19 NONAME ; int VideoSortFilterProxyModel::removeAlbums(class QList<class QModelIndex> const &)
+ ?instance@VideoThumbnailData@@SAAAV1@XZ @ 20 NONAME ; class VideoThumbnailData & VideoThumbnailData::instance(void)
+ ?getType@VideoSortFilterProxyModel@@QAE?AW4TModelType@VideoCollectionCommon@@XZ @ 21 NONAME ; enum VideoCollectionCommon::TModelType VideoSortFilterProxyModel::getType(void)
+ ?fetchItemDetails@VideoSortFilterProxyModel@@QAEHABVQModelIndex@@@Z @ 22 NONAME ; int VideoSortFilterProxyModel::fetchItemDetails(class QModelIndex const &)
+ ??0VideoCollectionWrapper@@AAE@XZ @ 23 NONAME ; VideoCollectionWrapper::VideoCollectionWrapper(void)
+ ?metaObject@VideoSortFilterProxyModel@@UBEPBUQMetaObject@@XZ @ 24 NONAME ; struct QMetaObject const * VideoSortFilterProxyModel::metaObject(void) const
+ ?metaObject@VideoCollectionWrapper@@UBEPBUQMetaObject@@XZ @ 25 NONAME ; struct QMetaObject const * VideoCollectionWrapper::metaObject(void) const
+ ?lessThan@VideoSortFilterProxyModel@@MBE_NABVQModelIndex@@0@Z @ 26 NONAME ; bool VideoSortFilterProxyModel::lessThan(class QModelIndex const &, class QModelIndex const &) const
+ ?getStaticMetaObject@VideoCollectionWrapper@@SAABUQMetaObject@@XZ @ 27 NONAME ; struct QMetaObject const & VideoCollectionWrapper::getStaticMetaObject(void)
+ ?getStaticMetaObject@VideoSortFilterProxyModel@@SAABUQMetaObject@@XZ @ 28 NONAME ; struct QMetaObject const & VideoSortFilterProxyModel::getStaticMetaObject(void)
+ ?trUtf8@VideoSortFilterProxyModel@@SA?AVQString@@PBD0@Z @ 29 NONAME ; class QString VideoSortFilterProxyModel::trUtf8(char const *, char const *)
+ ?doSorting@VideoSortFilterProxyModel@@QAEXHW4SortOrder@Qt@@_N@Z @ 30 NONAME ; void VideoSortFilterProxyModel::doSorting(int, enum Qt::SortOrder, bool)
+ ?getOpenItem@VideoSortFilterProxyModel@@QBE?AVTMPXItemId@@XZ @ 31 NONAME ; class TMPXItemId VideoSortFilterProxyModel::getOpenItem(void) const
+ ?startBackgroundFetching@VideoThumbnailData@@QAEXPAVVideoSortFilterProxyModel@@H@Z @ 32 NONAME ; void VideoThumbnailData::startBackgroundFetching(class VideoSortFilterProxyModel *, int)
+ ??_EVideoCollectionWrapper@@UAE@I@Z @ 33 NONAME ; VideoCollectionWrapper::~VideoCollectionWrapper(unsigned int)
+ ?resolveAlbumName@VideoSortFilterProxyModel@@QBE?AVQString@@ABV2@@Z @ 34 NONAME ; class QString VideoSortFilterProxyModel::resolveAlbumName(class QString const &) const
+ ?getThumbnail@VideoThumbnailData@@QAEPBVQIcon@@ABVTMPXItemId@@@Z @ 35 NONAME ; class QIcon const * VideoThumbnailData::getThumbnail(class TMPXItemId const &)
+ ?getStaticMetaObject@VideoThumbnailData@@SAABUQMetaObject@@XZ @ 36 NONAME ; struct QMetaObject const & VideoThumbnailData::getStaticMetaObject(void)
+ ?qt_metacall@VideoCollectionWrapper@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 37 NONAME ; int VideoCollectionWrapper::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ?trUtf8@VideoThumbnailData@@SA?AVQString@@PBD0H@Z @ 38 NONAME ; class QString VideoThumbnailData::trUtf8(char const *, char const *, int)
+ ?enableBackgroundFetching@VideoThumbnailData@@QAEX_N@Z @ 39 NONAME ; void VideoThumbnailData::enableBackgroundFetching(bool)
+ ?getMediaFilePathForId@VideoSortFilterProxyModel@@QAE?AVQString@@ABVTMPXItemId@@@Z @ 40 NONAME ; class QString VideoSortFilterProxyModel::getMediaFilePathForId(class TMPXItemId const &)
+ ?connectSignals@VideoSortFilterProxyModel@@AAE_NXZ @ 41 NONAME ; bool VideoSortFilterProxyModel::connectSignals(void)
+ ?getModel@VideoCollectionWrapper@@QAEPAVVideoSortFilterProxyModel@@W4TModelType@VideoCollectionCommon@@@Z @ 42 NONAME ; class VideoSortFilterProxyModel * VideoCollectionWrapper::getModel(enum VideoCollectionCommon::TModelType)
+ ?tr@VideoCollectionWrapper@@SA?AVQString@@PBD0H@Z @ 43 NONAME ; class QString VideoCollectionWrapper::tr(char const *, char const *, int)
+ ?staticMetaObject@VideoSortFilterProxyModel@@2UQMetaObject@@B @ 44 NONAME ; struct QMetaObject const VideoSortFilterProxyModel::staticMetaObject
+ ?tr@VideoSortFilterProxyModel@@SA?AVQString@@PBD0@Z @ 45 NONAME ; class QString VideoSortFilterProxyModel::tr(char const *, char const *)
+ ?asyncStatus@VideoCollectionWrapper@@IAEXHAAVQVariant@@@Z @ 46 NONAME ; void VideoCollectionWrapper::asyncStatus(int, class QVariant &)
+ ?initialize@VideoSortFilterProxyModel@@QAEHPAVVideoListDataModel@@@Z @ 47 NONAME ; int VideoSortFilterProxyModel::initialize(class VideoListDataModel *)
+ ?modelChanged@VideoSortFilterProxyModel@@IAEXXZ @ 48 NONAME ; void VideoSortFilterProxyModel::modelChanged(void)
+ ?removeThumbnail@VideoThumbnailData@@QAE_NABVTMPXItemId@@@Z @ 49 NONAME ; bool VideoThumbnailData::removeThumbnail(class TMPXItemId const &)
+ ?indexOfId@VideoSortFilterProxyModel@@QAE?AVQModelIndex@@ABVTMPXItemId@@@Z @ 50 NONAME ; class QModelIndex VideoSortFilterProxyModel::indexOfId(class TMPXItemId const &)
+ ?setGenericIdFilter@VideoSortFilterProxyModel@@QAEXABVTMPXItemId@@_N@Z @ 51 NONAME ; void VideoSortFilterProxyModel::setGenericIdFilter(class TMPXItemId const &, bool)
+ ?trUtf8@VideoCollectionWrapper@@SA?AVQString@@PBD0@Z @ 52 NONAME ; class QString VideoCollectionWrapper::trUtf8(char const *, char const *)
+ ?thumbnailsFetched@VideoThumbnailData@@IAEXAAV?$QList@VTMPXItemId@@@@@Z @ 53 NONAME ; void VideoThumbnailData::thumbnailsFetched(class QList<class TMPXItemId> &)
+ ?processSorting@VideoSortFilterProxyModel@@AAEXXZ @ 54 NONAME ; void VideoSortFilterProxyModel::processSorting(void)
+ ?getSorting@VideoSortFilterProxyModel@@QAEXAAHAAW4SortOrder@Qt@@@Z @ 55 NONAME ; void VideoSortFilterProxyModel::getSorting(int &, enum Qt::SortOrder &)
+ ?filterAcceptsRow@VideoSortFilterProxyModel@@MBE_NHABVQModelIndex@@@Z @ 56 NONAME ; bool VideoSortFilterProxyModel::filterAcceptsRow(int, class QModelIndex const &) const
+ ?metaObject@VideoThumbnailData@@UBEPBUQMetaObject@@XZ @ 57 NONAME ; struct QMetaObject const * VideoThumbnailData::metaObject(void) const
+ ?tr@VideoThumbnailData@@SA?AVQString@@PBD0H@Z @ 58 NONAME ; class QString VideoThumbnailData::tr(char const *, char const *, int)
+ ?disconnectSignals@VideoSortFilterProxyModel@@AAEXXZ @ 59 NONAME ; void VideoSortFilterProxyModel::disconnectSignals(void)
+ ?trUtf8@VideoSortFilterProxyModel@@SA?AVQString@@PBD0H@Z @ 60 NONAME ; class QString VideoSortFilterProxyModel::trUtf8(char const *, char const *, int)
+ ?openItem@VideoSortFilterProxyModel@@QAEHVTMPXItemId@@@Z @ 61 NONAME ; int VideoSortFilterProxyModel::openItem(class TMPXItemId)
+ ?qt_metacast@VideoThumbnailData@@UAEPAXPBD@Z @ 62 NONAME ; void * VideoThumbnailData::qt_metacast(char const *)
+ ?tr@VideoCollectionWrapper@@SA?AVQString@@PBD0@Z @ 63 NONAME ; class QString VideoCollectionWrapper::tr(char const *, char const *)
+ ??_EVideoSortFilterProxyModel@@UAE@I@Z @ 64 NONAME ; VideoSortFilterProxyModel::~VideoSortFilterProxyModel(unsigned int)
+ ??0VideoSortFilterProxyModel@@QAE@W4TModelType@VideoCollectionCommon@@PAVQObject@@@Z @ 65 NONAME ; VideoSortFilterProxyModel::VideoSortFilterProxyModel(enum VideoCollectionCommon::TModelType, class QObject *)
+ ?addNewAlbum@VideoSortFilterProxyModel@@QAE?AVTMPXItemId@@ABVQString@@@Z @ 66 NONAME ; class TMPXItemId VideoSortFilterProxyModel::addNewAlbum(class QString const &)
+ ?renameItem@VideoSortFilterProxyModel@@QAEHABVTMPXItemId@@ABVQString@@@Z @ 67 NONAME ; int VideoSortFilterProxyModel::renameItem(class TMPXItemId const &, class QString const &)
+ ?enableThumbnailCreation@VideoThumbnailData@@QAEX_N@Z @ 68 NONAME ; void VideoThumbnailData::enableThumbnailCreation(bool)
+ ?qt_metacall@VideoSortFilterProxyModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 69 NONAME ; int VideoSortFilterProxyModel::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ?freeThumbnailData@VideoThumbnailData@@QAEXXZ @ 70 NONAME ; void VideoThumbnailData::freeThumbnailData(void)
+ ?shortDetailsReady@VideoSortFilterProxyModel@@IAEXVTMPXItemId@@@Z @ 71 NONAME ; void VideoSortFilterProxyModel::shortDetailsReady(class TMPXItemId)
+ ?qt_metacast@VideoSortFilterProxyModel@@UAEPAXPBD@Z @ 72 NONAME ; void * VideoSortFilterProxyModel::qt_metacast(char const *)
+ ?staticMetaObject@VideoCollectionWrapper@@2UQMetaObject@@B @ 73 NONAME ; struct QMetaObject const VideoCollectionWrapper::staticMetaObject
+ ?setAlbumInUse@VideoSortFilterProxyModel@@QAEXABVTMPXItemId@@@Z @ 74 NONAME ; void VideoSortFilterProxyModel::setAlbumInUse(class TMPXItemId const &)
?tr@VideoThumbnailData@@SA?AVQString@@PBD0@Z @ 75 NONAME ; class QString VideoThumbnailData::tr(char const *, char const *)
??1VideoCollectionWrapper@@EAE@XZ @ 76 NONAME ; VideoCollectionWrapper::~VideoCollectionWrapper(void)
?trUtf8@VideoCollectionWrapper@@SA?AVQString@@PBD0H@Z @ 77 NONAME ; class QString VideoCollectionWrapper::trUtf8(char const *, char const *, int)
--- a/videocollection/eabi/videocollectionwrapperu.def Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/eabi/videocollectionwrapperu.def Wed Aug 18 09:50:14 2010 +0300
@@ -1,64 +1,64 @@
EXPORTS
_ZN18VideoThumbnailData11qt_metacallEN11QMetaObject4CallEiPPv @ 1 NONAME
_ZN18VideoThumbnailData11qt_metacastEPKc @ 2 NONAME
- _ZN18VideoThumbnailData12getThumbnailE10TMPXItemId @ 3 NONAME
- _ZN18VideoThumbnailData15removeThumbnailE10TMPXItemId @ 4 NONAME
+ _ZN18VideoThumbnailData12getThumbnailERK10TMPXItemId @ 3 NONAME
+ _ZN18VideoThumbnailData15removeThumbnailERK10TMPXItemId @ 4 NONAME
_ZN18VideoThumbnailData16staticMetaObjectE @ 5 NONAME DATA 16
_ZN18VideoThumbnailData17freeThumbnailDataEv @ 6 NONAME
- _ZN18VideoThumbnailData17thumbnailsFetchedE5QListI10TMPXItemIdE @ 7 NONAME
+ _ZN18VideoThumbnailData17thumbnailsFetchedER5QListI10TMPXItemIdE @ 7 NONAME
_ZN18VideoThumbnailData19getStaticMetaObjectEv @ 8 NONAME
_ZN18VideoThumbnailData23enableThumbnailCreationEb @ 9 NONAME
_ZN18VideoThumbnailData23startBackgroundFetchingEP25VideoSortFilterProxyModeli @ 10 NONAME
_ZN18VideoThumbnailData24enableBackgroundFetchingEb @ 11 NONAME
- _ZN18VideoThumbnailData8instanceEv @ 12 NONAME
- _ZN18VideoThumbnailDataC1Ev @ 13 NONAME
- _ZN18VideoThumbnailDataC2Ev @ 14 NONAME
- _ZN18VideoThumbnailDataD0Ev @ 15 NONAME
- _ZN18VideoThumbnailDataD1Ev @ 16 NONAME
- _ZN18VideoThumbnailDataD2Ev @ 17 NONAME
- _ZN22VideoCollectionWrapper11asyncStatusEiR8QVariant @ 18 NONAME
- _ZN22VideoCollectionWrapper11qt_metacallEN11QMetaObject4CallEiPPv @ 19 NONAME
- _ZN22VideoCollectionWrapper11qt_metacastEPKc @ 20 NONAME
- _ZN22VideoCollectionWrapper15sendAsyncStatusEiR8QVariant @ 21 NONAME
- _ZN22VideoCollectionWrapper16staticMetaObjectE @ 22 NONAME DATA 16
- _ZN22VideoCollectionWrapper19getStaticMetaObjectEv @ 23 NONAME
- _ZN22VideoCollectionWrapper8getModelEN21VideoCollectionCommon10TModelTypeE @ 24 NONAME
- _ZN22VideoCollectionWrapper8instanceEv @ 25 NONAME
- _ZN22VideoCollectionWrapperC1Ev @ 26 NONAME
- _ZN22VideoCollectionWrapperC2Ev @ 27 NONAME
- _ZN22VideoCollectionWrapperD0Ev @ 28 NONAME
- _ZN22VideoCollectionWrapperD1Ev @ 29 NONAME
- _ZN22VideoCollectionWrapperD2Ev @ 30 NONAME
- _ZN25VideoSortFilterProxyModel10getSortingERiRN2Qt9SortOrderE @ 31 NONAME
- _ZN25VideoSortFilterProxyModel10initializeEP18VideoListDataModel @ 32 NONAME
- _ZN25VideoSortFilterProxyModel10modelReadyEv @ 33 NONAME
- _ZN25VideoSortFilterProxyModel11addNewAlbumERK7QString @ 34 NONAME
- _ZN25VideoSortFilterProxyModel11deleteItemsERK5QListI11QModelIndexE @ 35 NONAME
- _ZN25VideoSortFilterProxyModel11qt_metacallEN11QMetaObject4CallEiPPv @ 36 NONAME
- _ZN25VideoSortFilterProxyModel11qt_metacastEPKc @ 37 NONAME
- _ZN25VideoSortFilterProxyModel11renameAlbumERK10TMPXItemIdRK7QString @ 38 NONAME
- _ZN25VideoSortFilterProxyModel12modelChangedEv @ 39 NONAME
- _ZN25VideoSortFilterProxyModel12removeAlbumsERK5QListI11QModelIndexE @ 40 NONAME
- _ZN25VideoSortFilterProxyModel13setAlbumInUseE10TMPXItemId @ 41 NONAME
- _ZN25VideoSortFilterProxyModel14connectSignalsEv @ 42 NONAME
- _ZN25VideoSortFilterProxyModel14processSortingEv @ 43 NONAME
- _ZN25VideoSortFilterProxyModel15addItemsInAlbumER10TMPXItemIdRK5QListIS0_E @ 44 NONAME
- _ZN25VideoSortFilterProxyModel16albumChangedSlotEv @ 45 NONAME
- _ZN25VideoSortFilterProxyModel16fetchItemDetailsERK11QModelIndex @ 46 NONAME
- _ZN25VideoSortFilterProxyModel16itemModifiedSlotERK10TMPXItemId @ 47 NONAME
+ _ZN18VideoThumbnailData25backgroundFetchingEnabledEv @ 12 NONAME
+ _ZN18VideoThumbnailData8instanceEv @ 13 NONAME
+ _ZN18VideoThumbnailDataC1Ev @ 14 NONAME
+ _ZN18VideoThumbnailDataC2Ev @ 15 NONAME
+ _ZN18VideoThumbnailDataD0Ev @ 16 NONAME
+ _ZN18VideoThumbnailDataD1Ev @ 17 NONAME
+ _ZN18VideoThumbnailDataD2Ev @ 18 NONAME
+ _ZN22VideoCollectionWrapper11asyncStatusEiR8QVariant @ 19 NONAME
+ _ZN22VideoCollectionWrapper11qt_metacallEN11QMetaObject4CallEiPPv @ 20 NONAME
+ _ZN22VideoCollectionWrapper11qt_metacastEPKc @ 21 NONAME
+ _ZN22VideoCollectionWrapper15sendAsyncStatusEiR8QVariant @ 22 NONAME
+ _ZN22VideoCollectionWrapper16staticMetaObjectE @ 23 NONAME DATA 16
+ _ZN22VideoCollectionWrapper19getStaticMetaObjectEv @ 24 NONAME
+ _ZN22VideoCollectionWrapper8getModelEN21VideoCollectionCommon10TModelTypeE @ 25 NONAME
+ _ZN22VideoCollectionWrapper8instanceEv @ 26 NONAME
+ _ZN22VideoCollectionWrapperC1Ev @ 27 NONAME
+ _ZN22VideoCollectionWrapperC2Ev @ 28 NONAME
+ _ZN22VideoCollectionWrapperD0Ev @ 29 NONAME
+ _ZN22VideoCollectionWrapperD1Ev @ 30 NONAME
+ _ZN22VideoCollectionWrapperD2Ev @ 31 NONAME
+ _ZN25VideoSortFilterProxyModel10getSortingERiRN2Qt9SortOrderE @ 32 NONAME
+ _ZN25VideoSortFilterProxyModel10initializeEP18VideoListDataModel @ 33 NONAME
+ _ZN25VideoSortFilterProxyModel10modelReadyEv @ 34 NONAME
+ _ZN25VideoSortFilterProxyModel10renameItemERK10TMPXItemIdRK7QString @ 35 NONAME
+ _ZN25VideoSortFilterProxyModel11addNewAlbumERK7QString @ 36 NONAME
+ _ZN25VideoSortFilterProxyModel11deleteItemsERK5QListI11QModelIndexE @ 37 NONAME
+ _ZN25VideoSortFilterProxyModel11qt_metacallEN11QMetaObject4CallEiPPv @ 38 NONAME
+ _ZN25VideoSortFilterProxyModel11qt_metacastEPKc @ 39 NONAME
+ _ZN25VideoSortFilterProxyModel12modelChangedEv @ 40 NONAME
+ _ZN25VideoSortFilterProxyModel12removeAlbumsERK5QListI11QModelIndexE @ 41 NONAME
+ _ZN25VideoSortFilterProxyModel13setAlbumInUseERK10TMPXItemId @ 42 NONAME
+ _ZN25VideoSortFilterProxyModel14connectSignalsEv @ 43 NONAME
+ _ZN25VideoSortFilterProxyModel14processSortingEv @ 44 NONAME
+ _ZN25VideoSortFilterProxyModel15addItemsInAlbumER10TMPXItemIdRK5QListIS0_E @ 45 NONAME
+ _ZN25VideoSortFilterProxyModel16albumChangedSlotEv @ 46 NONAME
+ _ZN25VideoSortFilterProxyModel16fetchItemDetailsERK11QModelIndex @ 47 NONAME
_ZN25VideoSortFilterProxyModel16staticMetaObjectE @ 48 NONAME DATA 16
_ZN25VideoSortFilterProxyModel17disconnectSignalsEv @ 49 NONAME
_ZN25VideoSortFilterProxyModel17shortDetailsReadyE10TMPXItemId @ 50 NONAME
- _ZN25VideoSortFilterProxyModel18setGenericIdFilterE10TMPXItemIdb @ 51 NONAME
+ _ZN25VideoSortFilterProxyModel18setGenericIdFilterERK10TMPXItemIdb @ 51 NONAME
_ZN25VideoSortFilterProxyModel19getStaticMetaObjectEv @ 52 NONAME
_ZN25VideoSortFilterProxyModel20removeItemsFromAlbumER10TMPXItemIdRK5QListIS0_E @ 53 NONAME
- _ZN25VideoSortFilterProxyModel21getMediaFilePathForIdE10TMPXItemId @ 54 NONAME
+ _ZN25VideoSortFilterProxyModel21getMediaFilePathForIdERK10TMPXItemId @ 54 NONAME
_ZN25VideoSortFilterProxyModel4backEv @ 55 NONAME
_ZN25VideoSortFilterProxyModel4openEN21VideoCollectionCommon17TCollectionLevelsE @ 56 NONAME
_ZN25VideoSortFilterProxyModel7getTypeEv @ 57 NONAME
_ZN25VideoSortFilterProxyModel8openItemE10TMPXItemId @ 58 NONAME
_ZN25VideoSortFilterProxyModel9doSortingEiN2Qt9SortOrderEb @ 59 NONAME
- _ZN25VideoSortFilterProxyModel9indexOfIdE10TMPXItemId @ 60 NONAME
+ _ZN25VideoSortFilterProxyModel9indexOfIdERK10TMPXItemId @ 60 NONAME
_ZN25VideoSortFilterProxyModelC1EN21VideoCollectionCommon10TModelTypeEP7QObject @ 61 NONAME
_ZN25VideoSortFilterProxyModelC2EN21VideoCollectionCommon10TModelTypeEP7QObject @ 62 NONAME
_ZN25VideoSortFilterProxyModelD0Ev @ 63 NONAME
--- a/videocollection/inc/videocollectioncommon.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/inc/videocollectioncommon.h Wed Aug 18 09:50:14 2010 +0300
@@ -62,6 +62,9 @@
const char* const MetaKeyVideoResolutionString = "MetaKeyVideoResolutionString";
const char* const MetaKeyBitRate = "MetaKeyBitRate";
const char* const MetaKeyFormat = "MetaKeyFormat";
+ const char* const MetaKeyFileName = "MetaKeyFileName";
+ const char* const MetaKeyFilePath = "MetaKeyFilePath";
+ const char* const MetaKeyVideoTitle = "MetaKeyVideoTitle";
enum VideoItemStatus
{
@@ -74,6 +77,9 @@
* order than the VideoDetailLabelKeys.
*/
const char * const VideoDetailLabels[] = {
+ QT_TR_NOOP("txt_videos_list_title"),
+ QT_TR_NOOP("txt_videos_list_filename"),
+ QT_TR_NOOP("txt_videos_list_file_path"),
QT_TR_NOOP("txt_videos_list_drm"),
QT_TR_NOOP("txt_videos_list_service"),
QT_TR_NOOP("txt_videos_list_description"),
@@ -89,13 +95,16 @@
QT_TR_NOOP("txt_videos_list_file_size"),
QT_TR_NOOP("txt_videos_list_resolution"),
QT_TR_NOOP("txt_videos_list_format"),
- QT_TR_NOOP("txt_videos_list_bitrate")
+ QT_TR_NOOP("txt_videos_list_bitrate")
};
/**
* Order of keys in the labels const array.
*/
const char * const VideoDetailLabelKeys[] = {
+ MetaKeyVideoTitle,
+ MetaKeyFileName,
+ MetaKeyFilePath,
MetaKeyDRMInfo,
MetaKeyServiceURL,
MetaKeyDescription,
@@ -111,7 +120,7 @@
MetaKeySizeString,
MetaKeyVideoResolutionString,
MetaKeyFormat,
- MetaKeyBitRate
+ MetaKeyBitRate
};
/**
--- a/videocollection/mpxmyvideoscollection/group/vcxmyvideoscollectionplugin.mmp Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/group/vcxmyvideoscollectionplugin.mmp Wed Aug 18 09:50:14 2010 +0300
@@ -59,6 +59,8 @@
APP_LAYER_SYSTEMINCLUDE
+SMPSAFE
+
LIBRARY euser.lib
LIBRARY ecom.lib
--- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideosalbums.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosalbums.h Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosalbums.cpp Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionplugin.cpp Wed Aug 18 09:50:14 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 );
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/simplevideoplayback/inc/svpbdocumentloader.h Wed Aug 18 09:50:14 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: Document loader of the SimpleVideoPlayback MPX view plugin.
+*
+*/
+
+#ifndef SVPBDOCUMENTLOADER_H_
+#define SVPBDOCUMENTLOADER_H_
+
+#include <hbdocumentloader.h>
+
+class SvpbDocumentLoader : public HbDocumentLoader
+{
+public:
+ SvpbDocumentLoader();
+
+private: // from HbDocumentLoader
+ QObject *createObject(const QString& type, const QString &name);
+
+};
+
+#endif /* SVPBDOCUMENTLOADER_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/simplevideoplayback/inc/svpbengine.h Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,65 @@
+#ifndef SVPBENGINE_H
+#define SVPBENGINE_H
+
+#include <qobject>
+#include <mpxplaybackobserver.h>
+#include "svpbsurfacecontainer.h"
+
+class MMPXPlaybackUtility;
+
+enum SvpbEngineState
+{
+ Disconnected = 0,
+ Connected, // == Stopped
+ Initializing,
+ MediaRequested,
+ PlayRequested,
+ Playing,
+ PauseRequested,
+ Paused,
+ StopRequested
+};
+
+class SvpbEngine : public QObject,
+ public MMPXPlaybackObserver,
+ public MMPXPlaybackCallback
+{
+ Q_OBJECT
+
+public:
+ SvpbEngine(QObject *parent=0);
+ virtual ~SvpbEngine();
+
+ void connectMPX();
+ void disconnectMPX();
+
+ void setSurfaceContainer(SvpbSurfaceContainer *surfaceContainer);
+
+signals:
+ void finished();
+
+public slots:
+ void togglePause();
+ void stop();
+
+private: // From MMPXPlaybackObserver
+ void HandlePlaybackMessage(CMPXMessage* aMessage, TInt aErr);
+
+private: // from MMPXPlaybackCallback
+ void HandlePropertyL(TMPXPlaybackProperty aProperty, TInt aValue, TInt aError);
+ void HandleSubPlayerNamesL(TUid aPlayer, const MDesCArray* aSubPlayers,
+ TBool aComplete, TInt aError);
+ void HandleMediaL(const CMPXMedia& aProperties, TInt aError);
+
+private:
+ void mpxPbStateChanged(TMPXPlaybackState type, int err);
+ void requestMedia();
+
+private: // data
+ SvpbSurfaceContainer *mSurfaceContainer;
+ SvpbEngineState mState;
+ MMPXPlaybackUtility *mPlaybackUtility;
+ TMPXPlaybackState mMpxPbState;
+};
+
+#endif // SVPBENGINE_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/simplevideoplayback/inc/svpbnativewindow.h Wed Aug 18 09:50:14 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: CCoeControl to provide RWindow for videoplayback.
+* QGraphicsView derived class can not be used for this purpose,
+* because the Qt OpenVG context may interfere with the one being
+* used by the renderer.
+*
+*/
+
+#ifndef SVPBNATIVEWINDOW_H
+#define SVPBNATIVEWINDOW_H
+
+#include <coecntrl.h>
+#include "svpbsurfacecontainer.h"
+
+class CMediaClientVideoDisplay;
+
+class CSvpbNativeWindow : public CCoeControl, public SvpbSurfaceContainer
+{
+public:
+ static CSvpbNativeWindow* NewL(const TRect& displayRect);
+ virtual ~CSvpbNativeWindow();
+
+public: // From SvpbSurfaceContainer
+ int attachSurface(const TSurfaceId &surfaceId, const TRect &cropRect, const TVideoAspectRatio &aspectRatio);
+ void detachSurface();
+
+private:
+ CSvpbNativeWindow();
+ void ConstructL(const TRect& displayRect);
+ int setupSurface(const TRect &cropRect, const TVideoAspectRatio &aspectRatio);
+
+private:
+ TSurfaceId mSurfaceId;
+ CMediaClientVideoDisplay *mDisplay;
+};
+
+#endif // SVPBNATIVEWINDOW_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/simplevideoplayback/inc/svpbplugin.h Wed Aug 18 09:50:14 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: Simple Video Playback MXP view plugin
+*
+*/
+
+#ifndef SVPBPLUGIN_H
+#define SVPBPLUGIN_H
+
+#include <mpxviewpluginqt.h>
+
+class SvpbEngine;
+class SvpbView;
+
+class SvpbPlugin : public MpxViewPlugin
+{
+Q_OBJECT
+
+public:
+ SvpbPlugin();
+ virtual ~SvpbPlugin();
+
+public: // from MpxViewPlugin
+ void createView();
+ void destroyView();
+ void activateView();
+ void deactivateView();
+ QGraphicsWidget* getView();
+
+public slots: // from MpxViewPlugin
+ void orientationChange(Qt::Orientation orientation);
+ void back();
+
+private:
+ SvpbView *mView;
+ SvpbEngine *mEngine;
+};
+
+#endif //SVPBPLUGIN_H
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/simplevideoplayback/inc/svpbsurfacecontainer.h Wed Aug 18 09:50:14 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: Surface container interface for the SimpleVideoPlayback MPX
+* view plugin.
+*
+*/
+
+#ifndef SVPBSURFACECONTAINER_H_
+#define SVPBSURFACECONTAINER_H_
+
+#include <mmf/common/mmfvideo.h>
+#include <graphics/surface.h>
+
+class SvpbSurfaceContainer
+{
+public:
+ virtual int attachSurface(
+ const TSurfaceId &surfaceId,
+ const TRect &cropRect,
+ const TVideoAspectRatio &aspectRatio) = 0;
+ virtual void detachSurface() = 0;
+};
+
+#endif /* SVPBSURFACECONTAINER_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/simplevideoplayback/inc/svpbview.h Wed Aug 18 09:50:14 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: Main view of the SimpleVideoPlayback MPX view plugin.
+*
+*/
+
+#ifndef SVPBVIEW_H_
+#define SVPBVIEW_H_
+
+#include <hbview.h>
+
+class CSvpbNativeWindow;
+class SvpbSurfaceContainer;
+
+class SvpbView : public HbView
+{
+ Q_OBJECT
+
+public:
+ SvpbView(QGraphicsItem *parent=0);
+ virtual ~SvpbView();
+
+public:
+ void activate();
+ void deactivate();
+
+ SvpbSurfaceContainer *surfaceContainer() const;
+
+signals:
+ void finished();
+ void tapped();
+ void longTapped();
+
+private:
+ void mousePressEvent(QGraphicsSceneMouseEvent *event);
+ void gestureEvent(QGestureEvent *event);
+ bool handleTap(Qt::GestureState state);
+ bool handleLongTap(Qt::GestureState state);
+
+private:
+ CSvpbNativeWindow *mNativeWindow;
+};
+
+#endif /* SVPBVIEW_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/simplevideoplayback/inc/trace.h Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,146 @@
+/*
+* 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: Tracing macros, 2nd generation
+*
+*/
+
+#ifndef TRACE_H
+#define TRACE_H
+
+#include <QDebug>
+
+//-----------------------------------------------------------------------------
+// Trace definitions
+//-----------------------------------------------------------------------------
+//
+
+/**
+* Error trace enabled
+*/
+#ifdef _DEBUG
+ #define ERROR_TRACE
+ #define INFO_TRACE
+ #define TIMESTAMP_TRACE
+ #define FUNC_TRACE
+#else
+ #define ERROR_TRACE
+ #define INFO_TRACE
+ #define TIMESTAMP_TRACE
+ #define FUNC_TRACE
+#endif
+
+//-----------------------------------------------------------------------------
+// Constants
+//-----------------------------------------------------------------------------
+//
+
+/**
+* Trace prefixes for macros with component name.
+*/
+#define _TRACE_PREFIX "[SVPB]:"
+
+/**
+* Prefix error trace
+*/
+#define _ERROR_PREFIX _TRACE_PREFIX " [ERROR]:"
+
+/**
+* Prefix info trace.
+*/
+#define _INFO_PREFIX _TRACE_PREFIX " [INFO]:"
+
+/**
+* Prefix timestamp trace.
+*/
+#define _TIMESTAMP_PREFIX _TRACE_PREFIX " [TIMESTAMP]:"
+
+//-----------------------------------------------------------------------------
+// Error trace macros
+// Usage: wrap traces in ERROR() macro to allow disabling them in release builds.
+// Use normal stream object operations.
+// Examples:
+// ERROR( "xxx failed" );
+// ERROR( "Test trace arg =" << 999 << "arg2 =" << title() );
+//-----------------------------------------------------------------------------
+//
+#ifdef ERROR_TRACE
+ #define ERROR(trace) {qDebug() << _ERROR_PREFIX << trace;}
+ #define ERROR_PARAM(param) param
+ #define HANDLE_ERROR(trace) {ERROR(trace); __BREAKPOINT();}
+ #define HANDLE_ERROR_BOOL(x) {if (!x) {ERROR(#x << "is false"); __BREAKPOINT();}}
+ #define HANDLE_ERROR_NULL(x) {if (!x) {ERROR(#x << "is NULL"); __BREAKPOINT();}}
+ #define HANDLE_ERROR_NEG(x) {if (x < 0) {ERROR(#x << "=" << x << "File:" << __FILE__ << ", line:" << __LINE__); __BREAKPOINT();}}
+ #define CHECK_ERROR(err, trace) {if (err < 0) ERROR(trace << err);}
+#else //ERROR_TRACE not defined
+ #define ERROR(trace)
+ #define ERROR_PARAM(param)
+ #define HANDLE_ERROR(trace)
+ #define HANDLE_ERROR_BOOL(x)
+ #define HANDLE_ERROR_NULL(x)
+ #define HANDLE_ERROR_NEG(x)
+ #define CHECK_ERROR(err,trace)
+#endif //ERROR_TRACE
+
+//-----------------------------------------------------------------------------
+// Info trace macros
+// Usage: wrap traces in INFO() macro to allow disabling them in release builds.
+// Use normal stream object operations.
+// Examples:
+// INFO( "Test trace" );
+// INFO( "Test trace arg =" << 999 << "arg2 =" << title() );
+//-----------------------------------------------------------------------------
+//
+#ifdef INFO_TRACE
+ #define INFO(trace) {qDebug() << _INFO_PREFIX << trace;}
+ #define INFO_PARAM(param) param
+#else //INFO_TRACE not defined
+ #define INFO(trace)
+ #define INFO_PARAM(param)
+#endif //INFO_TRACE
+
+//-----------------------------------------------------------------------------
+// Function trace macros
+//-----------------------------------------------------------------------------
+//
+#ifdef FUNC_TRACE
+
+ class FuncLog
+ {
+ public:
+ inline FuncLog( const char* func ) : m_func( func )
+ { qDebug() << _TRACE_PREFIX << m_func << "-START"; }
+ inline ~FuncLog() { qDebug() << _TRACE_PREFIX << m_func << "-END"; }
+ private: // Data
+ QString m_func;
+ };
+
+ #define FUNC_LOG FuncLog _fl( __PRETTY_FUNCTION__ );
+#else //FUNC_TRACE not defined
+ #define FUNC_LOG
+#endif //FUNC_TRACE
+
+//-----------------------------------------------------------------------------
+// Timestamp trace macros
+//-----------------------------------------------------------------------------
+//
+#ifdef TIMESTAMP_TRACE
+ #include <QTime>
+ #define TIMESTAMP(trace)\
+ {qDebug() << _TIMESTAMP_PREFIX << "(" << \
+ QTime::currentTime().toString("HH:mm:ss:zzz") << ")" << trace;}
+#else //TIMESTAMP_TRACE not defined
+ #define TIMESTAMP(trace)
+#endif //TIMESTAMP_TRACE
+
+#endif // TRACE_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/simplevideoplayback/resources/simplevideoplayback.docml Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="1.1">
+ <widget name="view" type="SvpbView">
+ <widget name="transparentWindow" type="HbTransparentWindow">
+ <real name="z" value="1"/>
+ <sizepolicy horizontalPolicy="Ignored" horizontalStretch="0" verticalPolicy="Ignored" verticalStretch="0"/>
+ <layout type="anchor"/>
+ </widget>
+ <layout type="anchor">
+ <anchoritem dst="transparentWindow" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
+ <anchoritem dst="transparentWindow" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
+ <anchoritem dst="transparentWindow" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+ <anchoritem dst="transparentWindow" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+ </layout>
+ </widget>
+ <metadata activeUIState="Common ui state" display="NHD-3.2-inch_portrait" unit="un">
+ <uistate name="Common ui state" sections="#common"/>
+ </metadata>
+</hbdocument>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/simplevideoplayback/rom/simplevideoplayback.iby Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: simplevideoplayback.iby
+*
+*/
+
+#ifndef SIMPLEVIDEOPLAYBACK_IBY
+#define SIMPLEVIDEOPLAYBACK_IBY
+
+#include <data_caging_paths_for_iby.hrh>
+
+ECOM_PLUGIN(simplevideoplayback.dll, simplevideoplayback.rsc)
+
+#endif // SIMPLEVIDEOPLAYBACK_IBY
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/simplevideoplayback/simplevideoplayback.pro Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,64 @@
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+TEMPLATE = lib
+CONFIG += hb qt ecomplugin
+TARGET = simplevideoplayback
+
+# MPX view plugin interface name
+SERVICE.INTERFACE_NAME = org.nokia.mmdt.QViewPlugin/1.0
+
+# Opaque data for resolving the correct plugin
+SERVICE.CONFIGURATION = "<t>0x20024338</t><p></p><i>EMPXViewPluginPriorityNormal</i><f>0x00000002</f>"
+
+INCLUDEPATH += inc \
+ ../../../inc
+DEPENDPATH += inc
+VPATH += src
+
+HEADERS += svpbdocumentloader.h \
+ svpbengine.h \
+ svpbnativewindow.h \
+ svpbplugin.h \
+ svpbsurfacecontainer.h \
+ svpbview.h \
+ trace.h
+
+SOURCES += svpbdocumentloader.cpp \
+ svpbengine.cpp \
+ svpbnativewindow.cpp \
+ svpbplugin.cpp \
+ svpbview.cpp
+
+RESOURCES = simplevideoplayback.qrc
+
+LIBS += -lcone \
+ -lmediaclientvideodisplay \
+ -lmpxcommon \
+ -lmpxplaybackutility \
+ -lmpxviewframeworkqt \
+ -lws32
+
+symbian:
+{
+ TARGETTYPE_OVERRIDE = PLUGIN
+ # KMpxVideoPluginDllPlaybackUid
+ TARGET.UID3 = 0x20024335
+ TARGET.CAPABILITY = ALL -TCB -DRM
+ TARGET.EPOCALLOWDLLDATA = 1
+ INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+ BLD_INF_RULES.prj_exports += "rom/simplevideoplayback.iby CORE_APP_LAYER_IBY_EXPORT_PATH(simplevideoplayback.iby)"
+ MMP_RULES += SMPSAFE
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/simplevideoplayback/simplevideoplayback.qrc Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/" >
+ <file>resources/simplevideoplayback.docml</file>
+ </qresource>
+</RCC>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/simplevideoplayback/src/svpbdocumentloader.cpp Wed Aug 18 09:50:14 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: Document loader of the SimpleVideoPlayback MPX view plugin.
+*
+*/
+
+#include "svpbdocumentloader.h"
+#include "svpbview.h"
+#include "trace.h"
+
+SvpbDocumentLoader::SvpbDocumentLoader()
+{
+}
+
+QObject *SvpbDocumentLoader::createObject(const QString& type, const QString &name)
+{
+ FUNC_LOG;
+ INFO("Create object" << type << name);
+
+ QObject *object = 0;
+
+ if (type == SvpbView::staticMetaObject.className()) {
+ object = new SvpbView;
+ }
+
+ if (object) {
+ object->setObjectName(name);
+ return object;
+ }
+
+ return HbDocumentLoader::createObject(type, name);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/simplevideoplayback/src/svpbengine.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,236 @@
+#include <mpxplaybackutility.h> // MMPXPlaybackUtility
+#include <mpxmessagegeneraldefs.h>
+#include <mpxplaybackmessage.h>
+#include <mpxcommandgeneraldefs.h>
+#include <mpxvideoplaybackdefs.h>
+#include <mpxmediageneraldefs.h>
+#include <mpxmediageneralextdefs.h>
+#include <mpxmediavideodefs.h>
+
+#include "svpbengine.h"
+#include "trace.h"
+
+const TUid KVideoHelixPlaybackPluginUid = { 0x10282551 };
+
+SvpbEngine::SvpbEngine(QObject *parent) :
+ QObject(parent),
+ mSurfaceContainer(0),
+ mState(Disconnected),
+ mPlaybackUtility(0),
+ mMpxPbState(EPbStateNotInitialised)
+{
+ FUNC_LOG;
+}
+
+SvpbEngine::~SvpbEngine()
+{
+ FUNC_LOG;
+
+ disconnectMPX();
+}
+
+void SvpbEngine::connectMPX()
+{
+ FUNC_LOG;
+
+ if (mState == Disconnected && !mPlaybackUtility) {
+ QT_TRAP_THROWING(mPlaybackUtility =
+ MMPXPlaybackUtility::UtilityL(EMPXCategoryVideo, KPbModeDefault));
+ MMPXPlayerManager &manager = mPlaybackUtility->PlayerManager();
+ QT_TRAP_THROWING(manager.SelectPlayerL(KVideoHelixPlaybackPluginUid));
+ QT_TRAP_THROWING(mPlaybackUtility->AddObserverL(*this));
+ mState = Connected;
+ INFO("Connected");
+ }
+}
+
+void SvpbEngine::disconnectMPX()
+{
+ FUNC_LOG;
+
+ if (mState != Disconnected && mPlaybackUtility)
+ {
+ mPlaybackUtility->RemoveObserverL(*this);
+ mPlaybackUtility->Close();
+ mPlaybackUtility = 0;
+ mState = Disconnected;
+ INFO("Disconnected");
+ }
+}
+
+/** Ownership is not transferred. */
+void SvpbEngine::setSurfaceContainer(SvpbSurfaceContainer *surfaceContainer)
+{
+ FUNC_LOG;
+
+ mSurfaceContainer = surfaceContainer;
+}
+
+void SvpbEngine::togglePause()
+{
+ FUNC_LOG;
+
+ if (mState == PlayRequested || mState == Playing) {
+ QT_TRAP_THROWING(mPlaybackUtility->CommandL(EPbCmdPause, 0));
+ mState = PauseRequested;
+ INFO("Pause requested");
+ }
+ else if (mState == PauseRequested || mState == Paused) {
+ QT_TRAP_THROWING(mPlaybackUtility->CommandL(EPbCmdPlay, 0));
+ mState = PlayRequested;
+ INFO("Play requested");
+ }
+}
+
+void SvpbEngine::stop()
+{
+ FUNC_LOG;
+
+ if (mState == PlayRequested || mState == Playing) {
+ QT_TRAP_THROWING(mPlaybackUtility->CommandL(EPbCmdStop, 0));
+ mState = StopRequested;
+ INFO("Stop requested");
+ }
+}
+
+void SvpbEngine::HandlePlaybackMessage(CMPXMessage *aMessage, TInt aErr)
+{
+ FUNC_LOG;
+
+ if (aMessage) {
+ TMPXMessageId id(aMessage->ValueTObjectL<TMPXMessageId>(KMPXMessageGeneralId));
+
+ if (id == KMPXMessageGeneral) {
+ TInt msg(0), type(0);
+ QT_TRAP_THROWING(msg = aMessage->ValueTObjectL<TInt>(KMPXMessageGeneralEvent));
+ QT_TRAP_THROWING(type = aMessage->ValueTObjectL<TInt>(KMPXMessageGeneralType));
+ INFO("KMPXMessageGeneral" << msg << type);
+
+ switch(msg)
+ {
+ case TMPXPlaybackMessage::EInitializeComplete:
+ INFO("Initialize complete");
+ break;
+ case TMPXPlaybackMessage::EStateChanged:
+ mpxPbStateChanged(static_cast<TMPXPlaybackState>(type), aErr);
+ break;
+ default:
+ break;
+ }
+ }
+ else if (id == KMPXMediaIdVideoDisplayMessage) {
+ TMPXVideoDisplayCommand msg =
+ ( *(aMessage->Value<TMPXVideoDisplayCommand>(KMPXMediaVideoDisplayCommand)));
+ INFO("KMPXMediaIdVideoDisplayMessage" << msg);
+
+ switch (msg)
+ {
+ case EPbMsgVideoSurfaceCreated:
+ case EPbMsgVideoSurfaceChanged:
+ if (mSurfaceContainer) {
+ TSurfaceId surfaceId;
+ TRect cropRect;
+ TVideoAspectRatio aspectRatio;
+ QT_TRAP_THROWING(surfaceId = aMessage->ValueTObjectL<TSurfaceId>(KMPXMediaVideoDisplayTSurfaceId));
+ QT_TRAP_THROWING(cropRect = aMessage->ValueTObjectL<TRect>(KMPXMediaVideoDisplayCropRect));
+ QT_TRAP_THROWING(aspectRatio = aMessage->ValueTObjectL<TVideoAspectRatio>(KMPXMediaVideoDisplayAspectRatio));
+ mSurfaceContainer->attachSurface(surfaceId, cropRect, aspectRatio);
+ }
+ break;
+ case EPbMsgVideoSurfaceRemoved:
+ if (mSurfaceContainer) {
+ mSurfaceContainer->detachSurface();
+ }
+ break;
+ }
+ }
+ }
+}
+
+void SvpbEngine::HandlePropertyL(TMPXPlaybackProperty aProperty, TInt aValue, TInt aError)
+{
+ Q_UNUSED(aProperty);
+ Q_UNUSED(aValue);
+ Q_UNUSED(aError);
+ FUNC_LOG;
+}
+
+void SvpbEngine::HandleSubPlayerNamesL(TUid /*aPlayer*/,
+ const MDesCArray* /*aSubPlayers*/,
+ TBool /*aComplete*/,
+ TInt /*aError*/)
+{
+ FUNC_LOG;
+}
+
+void SvpbEngine::HandleMediaL(const CMPXMedia& /*aProperties*/, TInt /*aError*/)
+{
+ FUNC_LOG;
+
+ QT_TRAP_THROWING(mPlaybackUtility->CommandL(EPbCmdPlay, 0));
+ mState = PlayRequested;
+ INFO("Play requested");
+}
+
+void SvpbEngine::mpxPbStateChanged(TMPXPlaybackState type, int err)
+{
+ FUNC_LOG;
+ INFO("MPX PB state:" << type << "error" << err);
+
+ if (err == 0) {
+ switch(type) {
+ case EPbStateInitialised:
+ requestMedia(); // VideoHelixPlugin uses media request to signal view activation
+ mState = MediaRequested;
+ INFO("Media requested");
+ break;
+ case EPbStatePlaying:
+ mState = Playing;
+ INFO("Playing");
+ break;
+ case EPbStatePaused:
+ mState = Paused;
+ INFO("Paused");
+ break;
+ case EPbStateStopped:
+ mState = Connected;
+ INFO("Connected");
+ emit finished();
+ break;
+ default:
+ break;
+ };
+ }
+}
+
+void SvpbEngine::requestMedia()
+{
+ FUNC_LOG;
+
+ MMPXSource *source = mPlaybackUtility->Source();
+ HANDLE_ERROR_NULL(source);
+ if (source) {
+ RArray<TMPXAttribute> attrs;
+ attrs.Append(KMPXMediaGeneralUri|
+ KMPXMediaGeneralDuration|
+ KMPXMediaGeneralTitle|
+ KMPXMediaGeneralMimeType);
+ attrs.Append(KMPXMediaVideoAll);
+
+ CMPXAttributeSpecs *specs = 0;
+ TRAPD(err, specs = CMPXAttributeSpecs::NewL());
+ HANDLE_ERROR_NEG(err);
+ if (specs) {
+ // Set the attribute to always route the media call to playback plugin
+ TRAP(err, specs->SetTObjectValueL<TBool>(KMPXMediaGeneralExtMediaRedirect, ETrue));
+ HANDLE_ERROR_NEG(err);
+ if (err == KErrNone) {
+ TRAP(err, source->MediaL(attrs.Array(), *this, specs));
+ HANDLE_ERROR_NEG(err);
+ }
+ }
+
+ delete specs;
+ attrs.Close();
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/simplevideoplayback/src/svpbnativewindow.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,133 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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.
+* QGraphicsView derived class can not be used for this purpose,
+* because the Qt OpenVG context may interfere with the one being
+* used by the renderer.
+*
+*/
+
+#include <QGraphicsWidget>
+#include <graphics/surfaceconfiguration.h>
+#include <mediaclientvideodisplay.h>
+#include "svpbnativewindow.h"
+#include "trace.h"
+
+CSvpbNativeWindow* CSvpbNativeWindow::NewL(const TRect& displayRect)
+{
+ FUNC_LOG;
+
+ CSvpbNativeWindow* self = new (ELeave) CSvpbNativeWindow;
+ CleanupStack::PushL(self);
+ self->ConstructL(displayRect);
+ CleanupStack::Pop();
+ return self;
+}
+
+CSvpbNativeWindow::~CSvpbNativeWindow()
+{
+ FUNC_LOG;
+
+ detachSurface();
+ CloseWindow();
+}
+
+int CSvpbNativeWindow::attachSurface(
+ const TSurfaceId &surfaceId,
+ const TRect &cropRect,
+ const TVideoAspectRatio &aspectRatio)
+{
+ FUNC_LOG;
+
+ INFO("Surface id:" << surfaceId.iInternal[0]
+ << surfaceId.iInternal[1]
+ << surfaceId.iInternal[2]
+ << surfaceId.iInternal[3]);
+
+ if (mSurfaceId.IsNull()) {
+ mSurfaceId = surfaceId;
+ return setupSurface(cropRect, aspectRatio);
+ }
+ else if (mSurfaceId == surfaceId) {
+ detachSurface();
+ return setupSurface(cropRect, aspectRatio);
+ }
+ else {
+ detachSurface();
+ }
+
+ return 0;
+}
+
+void CSvpbNativeWindow::detachSurface()
+{
+ FUNC_LOG;
+
+ if (mDisplay) {
+ mDisplay->RemoveSurface();
+ mDisplay->RemoveDisplayWindow( *(DrawableWindow()));
+ delete mDisplay;
+ mDisplay = 0;
+ }
+
+ mSurfaceId = TSurfaceId::CreateNullId();
+}
+
+CSvpbNativeWindow::CSvpbNativeWindow() :
+ mSurfaceId(TSurfaceId::CreateNullId()),
+ mDisplay(0)
+{
+ FUNC_LOG;
+}
+
+void CSvpbNativeWindow::ConstructL(const TRect& displayRect)
+{
+ FUNC_LOG;
+
+ CreateWindowL();
+ SetRect(displayRect);
+ DrawableWindow()->SetOrdinalPosition(-1); // Send to background
+ ActivateL();
+}
+
+int CSvpbNativeWindow::setupSurface(
+ const TRect &cropRect, const TVideoAspectRatio &aspectRatio)
+{
+ FUNC_LOG;
+
+ TInt displayId = CCoeEnv::Static()->ScreenDevice()->GetScreenNumber();
+ INFO("Display id:" << displayId);
+ QT_TRAP_THROWING(mDisplay = CMediaClientVideoDisplay::NewL(displayId));
+
+ RWindowBase *videoWindow = DrawableWindow();
+ TRect displayRect = Rect();
+ TRAPD(err, mDisplay->AddDisplayWindowL(videoWindow,
+ displayRect, // Window clipping rectangle, relative to the window
+ cropRect, // The dimensions of the crop region, relative to the video image
+ displayRect, // Video extent on the screen
+ 100.0f,
+ 100.0f,
+ displayRect.Width() < displayRect.Height() ? EVideoRotationClockwise90 : EVideoRotationNone,
+ EAutoScaleStretch,
+ EHorizontalAlignCenter,
+ EVerticalAlignCenter,
+ (RWindow*)videoWindow));
+ HANDLE_ERROR_NEG(err);
+
+ if (err == 0) {
+ QT_TRAP_THROWING(mDisplay->SurfaceCreated(mSurfaceId, cropRect, aspectRatio, cropRect));
+ }
+
+ return err;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/simplevideoplayback/src/svpbplugin.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,122 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Simple Video Playback MXP view plugin
+*
+*/
+
+#include <xqplugin.h>
+
+#include "svpbdocumentloader.h"
+#include "svpbengine.h"
+#include "svpbplugin.h"
+#include "svpbview.h"
+#include "mpxhbvideocommondefs.h"
+#include "trace.h"
+
+static const QString NAME_DOCML = ":/resources/simplevideoplayback.docml";
+static const QString NAME_VIEW = "view";
+
+SvpbPlugin::SvpbPlugin() : mView(0), mEngine(0)
+{
+ FUNC_LOG;
+}
+
+SvpbPlugin::~SvpbPlugin()
+{
+ FUNC_LOG;
+ destroyView();
+}
+
+void SvpbPlugin::createView()
+{
+ FUNC_LOG;
+
+ if (!mView) {
+ SvpbDocumentLoader loader;
+ bool ok;
+ loader.load(NAME_DOCML, &ok);
+
+ if (ok) {
+ mView = qobject_cast<SvpbView *>(loader.findWidget(NAME_VIEW));
+ HANDLE_ERROR_NULL(mView);
+ connect(mView, SIGNAL(finished()), SLOT(back()), Qt::QueuedConnection);
+
+ mEngine = new SvpbEngine;
+ HANDLE_ERROR_NULL(mEngine);
+ connect(mEngine, SIGNAL(finished()), SLOT(back()), Qt::QueuedConnection);
+
+ connect(mView, SIGNAL(tapped()), mEngine, SLOT(togglePause()));
+ connect(mView, SIGNAL(longTapped()), mEngine, SLOT(stop()));
+ }
+ else {
+ ERROR(QString("Unable to read ").append(NAME_DOCML));
+ }
+ }
+}
+
+void SvpbPlugin::destroyView()
+{
+ FUNC_LOG;
+
+ deactivateView();
+
+ delete mEngine; // disconnects any signals
+ mEngine = 0;
+
+ delete mView; // disconnects any signals
+ mView = 0;
+}
+
+void SvpbPlugin::activateView()
+{
+ FUNC_LOG;
+
+ if (mEngine && mView) {
+ mEngine->connectMPX();
+ mView->activate();
+ mEngine->setSurfaceContainer(mView->surfaceContainer());
+ }
+}
+
+void SvpbPlugin::deactivateView()
+{
+ FUNC_LOG;
+
+ if (mEngine && mView) {
+ mView->deactivate();
+ mEngine->disconnectMPX();
+ }
+}
+
+QGraphicsWidget* SvpbPlugin::getView()
+{
+ FUNC_LOG;
+
+ return mView;
+}
+
+void SvpbPlugin::orientationChange(Qt::Orientation orientation)
+{
+ FUNC_LOG;
+ Q_UNUSED( orientation );
+}
+
+void SvpbPlugin::back()
+{
+ FUNC_LOG;
+
+ emit command(MpxHbVideoCommon::CollectionView);
+}
+
+XQ_EXPORT_PLUGIN2(simplevideoplayback, SvpbPlugin);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/simplevideoplayback/src/svpbview.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,122 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Main view of the SimpleVideoPlayback MPX view plugin.
+*
+*/
+
+#include <hbmainwindow.h>
+#include <hbtapgesture.h>
+#include "svpbnativewindow.h"
+#include "svpbview.h"
+#include "trace.h"
+
+SvpbView::SvpbView(QGraphicsItem *parent) :
+ HbView(parent),
+ mNativeWindow(0)
+{
+ FUNC_LOG;
+
+ grabGesture(Qt::TapGesture);
+}
+
+SvpbView::~SvpbView()
+{
+ FUNC_LOG;
+
+ delete mNativeWindow;
+}
+
+void SvpbView::activate()
+{
+ FUNC_LOG;
+ HANDLE_ERROR_BOOL(mNativeWindow == 0);
+
+ setContentFullScreen();
+ setItemVisible(Hb::AllItems, false);
+ mainWindow()->setOrientation(Qt::Horizontal, false);
+
+ RWindowBase *rootWindow = mainWindow()->winId()->DrawableWindow();
+ TRect displayRect(rootWindow->Position(), rootWindow->Size());
+
+ QT_TRAP_THROWING(mNativeWindow = CSvpbNativeWindow::NewL(displayRect));
+
+ mainWindow()->winId()->DrawableWindow()->SetSurfaceTransparency(ETrue); // This is required fow HW
+}
+
+void SvpbView::deactivate()
+{
+ FUNC_LOG;
+
+// If this is called, surface transparency can not be enabled again
+// mainWindow()->winId()->DrawableWindow()->SetSurfaceTransparency(EFalse);
+
+ delete mNativeWindow;
+ mNativeWindow = 0;
+}
+
+SvpbSurfaceContainer *SvpbView::surfaceContainer() const
+{
+ FUNC_LOG;
+
+ return mNativeWindow;
+}
+
+// this needs to be implemented for gesture framework to work
+void SvpbView::mousePressEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_UNUSED(event);
+}
+
+void SvpbView::gestureEvent(QGestureEvent *event)
+{
+ FUNC_LOG;
+
+ bool eventHandled(false);
+ HbTapGesture *tap = 0;
+ if (QGesture *gesture = event->gesture(Qt::TapGesture)) {
+ tap = static_cast<HbTapGesture *>(event->gesture(Qt::TapGesture));
+ if (tap->tapStyleHint() == HbTapGesture::TapAndHold) {
+ eventHandled = handleLongTap(tap->state());
+
+ } else {
+ eventHandled = handleTap(tap->state());
+ }
+ }
+
+ eventHandled ? event->accept() : event->ignore();
+}
+
+bool SvpbView::handleTap(Qt::GestureState state)
+{
+ FUNC_LOG;
+
+ if (state == Qt::GestureFinished) {
+ emit tapped();
+ return true;
+ }
+
+ return false;
+}
+
+bool SvpbView::handleLongTap(Qt::GestureState state)
+{
+ FUNC_LOG;
+
+ if (state == Qt::GestureFinished) {
+ emit longTapped();
+ return true;
+ }
+
+ return false;
+}
--- a/videocollection/tsrc/stubs/inc/hbeffect.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/hbeffect.h Wed Aug 18 09:50:14 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/hbglobal.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/hbglobal.h Wed Aug 18 09:50:14 2010 +0300
@@ -18,6 +18,9 @@
#ifndef HBGLOBAL_H
#define HBGLOBAL_H
+// need this here for forced include
+#include "xqsettingsmanagerstub.h"
+
#include <QtGlobal>
#ifdef BUILD_HB_CORE
--- a/videocollection/tsrc/stubs/inc/hblistview.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/hblistview.h Wed Aug 18 09:50:14 2010 +0300
@@ -281,6 +281,34 @@
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);
+ }
+
+ /**
+ * Dummy method
+ */
+ void setItemPixmapCacheEnabled(bool enabled)
+ {
+ Q_UNUSED(enabled);
+ }
+
public:
/**
--- a/videocollection/tsrc/stubs/inc/hbmessagebox.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/hbmessagebox.h Wed Aug 18 09:50:14 2010 +0300
@@ -30,14 +30,37 @@
class HbMessageBox : public QObject
{
Q_OBJECT
+
+ Q_FLAGS(StandardButton StandardButtons)
+ Q_ENUMS(MessageBoxType StandardButton)
public:
+
enum MessageBoxType {
MessageTypeInformation,
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();
@@ -75,6 +98,8 @@
QGraphicsScene *scene = 0,
QGraphicsItem *parent = 0 );
+ static void setStandardButtons(StandardButtons buttons);
+
QList<HbAction*> actions() const
{
return mActions;
@@ -82,7 +107,7 @@
signals:
- void finished(HbAction *action);
+ void finished(int action);
public:
@@ -90,4 +115,6 @@
};
+Q_DECLARE_OPERATORS_FOR_FLAGS(HbMessageBox::StandardButtons)
+
#endif // HBMESSAGEBOX_H
--- a/videocollection/tsrc/stubs/inc/hbtoolbar.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/hbtoolbar.h Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/videocollectionviewutilsdata.h Wed Aug 18 09:50:14 2010 +0300
@@ -22,6 +22,9 @@
#include <qvariant.h>
#include "videocollectioncommon.h"
+#define CENREP_NO_STRING "nostring"
+#define CENREP_NO_INT 1010100512
+
class VideoCollectionViewUtilsData
{
public: // methods
@@ -29,7 +32,6 @@
{
mLastError = 0;
mLoadSortingValuesFails = false;
- mGetServiceIconStringsFails = false;
mVideoSortRole = -1;
mCollectionSortRole = -1;
mVideoSortOrder = Qt::AscendingOrder;
@@ -40,12 +42,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 +59,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 Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/videoservices.h Wed Aug 18 09:50:14 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/videosortfilterproxymodeldata.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/videosortfilterproxymodeldata.h Wed Aug 18 09:50:14 2010 +0300
@@ -43,8 +43,8 @@
mGenericFilterId = TMPXItemId::InvalidId();
mGenericFilterValue = false;
mNewAlbumId = TMPXItemId::InvalidId();
- mLastAlbumNameInRename = "";
- mRenameAlbumReturnValue= 0;
+ mLastItemNameInRename = "";
+ mRenameItemReturnValue= 0;
mLastAddedAlbumName = "";
}
@@ -66,8 +66,8 @@
static TMPXItemId mGenericFilterId;
static bool mGenericFilterValue;
static TMPXItemId mNewAlbumId;
- static QString mLastAlbumNameInRename;
- static int mRenameAlbumReturnValue;
+ static QString mLastItemNameInRename;
+ static int mRenameItemReturnValue;
static QString mLastAddedAlbumName;
};
--- a/videocollection/tsrc/stubs/inc/videothumbnailtestdata.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/videothumbnailtestdata.h Wed Aug 18 09:50:14 2010 +0300
@@ -25,15 +25,17 @@
{
mInstanceCallCount = 0;
mFreeThumbnailDataCallCount = 0;
- mBackgroundThumbnailFetchingEnabled = 0;
+ mBackgroundThumbnailFetchingEnabled = false;
mStartBackgroundFetchingCallCount = 0;
+ mFetchIndex = -1;
}
public: // data
static int mInstanceCallCount;
static int mFreeThumbnailDataCallCount;
- static int mBackgroundThumbnailFetchingEnabled;
+ static bool 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 Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,60 @@
+/*
+* 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
+{
+ Q_OBJECT
+
+public:
+
+ XQCentralRepositorySettingsKey(int uid, int key)
+ {
+ Q_UNUSED(uid);
+ Q_UNUSED(key);
+ }
+};
+
+class XQSettingsManager : QObject
+{
+ Q_OBJECT
+
+public:
+ XQSettingsManager();
+ ~XQSettingsManager();
+
+ enum Type
+ {
+ TypeVariant = 0,
+ TypeInt,
+ TypeDouble,
+ TypeString,
+ TypeByteArray
+ };
+
+public:
+ QVariant readItemValue(XQCentralRepositorySettingsKey &key, int type);
+
+ static QVariant mReadItemValueReturnValue;
+};
+
+#endif // XQSETTINGSMANAGER_H
--- a/videocollection/tsrc/stubs/src/hbaction.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/tsrc/stubs/src/hbaction.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -19,4 +19,3 @@
int HbAction::initializeCount = 0;
Hb::NavigationAction HbAction::mNavAction = Hb::QuitNaviAction;
-
--- a/videocollection/tsrc/stubs/src/hbdocumentloader.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/tsrc/stubs/src/hbdocumentloader.cpp Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/tsrc/stubs/src/hbmessagebox.cpp Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/tsrc/stubs/src/hbwidget.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -18,7 +18,3 @@
#include "hbwidget.h"
int HbWidget::initializeCount = 0;
-
-
-
-
--- a/videocollection/tsrc/stubs/src/videocollectionviewutils.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/tsrc/stubs/src/videocollectionviewutils.cpp Wed Aug 18 09:50:14 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,32 @@
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;
+ QString str = VideoCollectionViewUtilsData::mCenRepStringValues.takeFirst();
+ if(str != CENREP_NO_STRING)
+ {
+ return str;
+ }
}
-
- icon = VideoCollectionViewUtilsData::mIconString;
- iconPressed = VideoCollectionViewUtilsData::mPressedString;
-
- return 0;
+ return QString();
}
-QString VideoCollectionViewUtils::getServiceUriString()
+int VideoCollectionViewUtils::getCenRepIntValue(int key)
{
- // not stubbed
- return QString();
+ Q_UNUSED(key);
+ if(VideoCollectionViewUtilsData::mCenRepIntValues.count() > 0)
+ {
+ int value = VideoCollectionViewUtilsData::mCenRepIntValues.takeFirst();;
+ if(value != CENREP_NO_INT)
+ {
+ return value;
+ }
+ }
+ return -1;
}
void VideoCollectionViewUtils::initListView(HbListView *view)
--- a/videocollection/tsrc/stubs/src/videohintwidget.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/tsrc/stubs/src/videohintwidget.cpp Wed Aug 18 09:50:14 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/videolistdatamodel.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/tsrc/stubs/src/videolistdatamodel.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -75,10 +75,9 @@
return 0;
}
-int VideoListDataModel::connectSignals()
+void VideoListDataModel::connectSignals()
{
// not stubbed
- return 0;
}
void VideoListDataModel::disconnectSignals()
--- a/videocollection/tsrc/stubs/src/videolistselectiondialog.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/tsrc/stubs/src/videolistselectiondialog.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -41,6 +41,8 @@
mListContainer(0),
mForcedCheck(false),
mModel(0),
+ mModelReady(false),
+ mAlbumListReady(false),
mListWidget(0),
mPrimaryAction(0),
mSecondaryAction(0)
@@ -124,6 +126,11 @@
// not stubbed
}
+void VideoListSelectionDialog::albumListReadySlot()
+{
+ // not stubbed
+}
+
void VideoListSelectionDialog::updateCounterSlot()
{
// not stubbed
--- a/videocollection/tsrc/stubs/src/videolistview.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/tsrc/stubs/src/videolistview.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -36,7 +36,9 @@
mVideoServices(0),
mCurrentList(0),
mToolbarViewsActionGroup(0),
-mToolbarCollectionActionGroup(0)
+mToolbarCollectionActionGroup(0),
+mToolbarServiceExtension(0)
+
{
// not stubbed
}
@@ -74,6 +76,11 @@
// not stubbed
}
+void VideoListView::albumListReadySlot()
+{
+ // not stubbed
+}
+
void VideoListView::layoutChangedSlot()
{
// not stubbed
@@ -89,6 +96,11 @@
VideoListViewData::mBackCount++;
}
+void VideoListView::modelReady()
+{
+ // not stubbed
+}
+
void VideoListView::cleanup()
{
// not stubbed
@@ -100,6 +112,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 +171,7 @@
// not stubbed
}
-void VideoListView::openServicesViewSlot()
+void VideoListView::openOperatorServiceSlot()
{
// not stubbed
}
--- a/videocollection/tsrc/stubs/src/videolistwidget.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/tsrc/stubs/src/videolistwidget.cpp Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,124 @@
+/*
+* 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)
+{
+ mTitle = "";
+ mIconResource = "";
+ mServiceUri = "";
+ mApplicationUid = 0;
+}
+
+// ---------------------------------------------------------------------------
+// load
+// ---------------------------------------------------------------------------
+//
+bool VideoOperatorService::load(int titleKey, int iconKey, int serviceUriKey, int 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++;
+}
+
+// ---------------------------------------------------------------------------
+// launchApplicationL
+// ---------------------------------------------------------------------------
+//
+void VideoOperatorService::launchApplicationL(const TUid uid, TInt viewId)
+{
+ Q_UNUSED(uid);
+ Q_UNUSED(viewId);
+ VideoOperatorServiceData::mLaunchApplicationLCallCount++;
+}
+
+// End of file.
--- a/videocollection/tsrc/stubs/src/videoservices.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/tsrc/stubs/src/videoservices.cpp Wed Aug 18 09:50:14 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/videosortfilterproxymodel.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/tsrc/stubs/src/videosortfilterproxymodel.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -39,8 +39,8 @@
TMPXItemId VideoSortFilterProxyModelData::mGenericFilterId = TMPXItemId::InvalidId();
bool VideoSortFilterProxyModelData::mGenericFilterValue = false;
TMPXItemId VideoSortFilterProxyModelData::mNewAlbumId = TMPXItemId::InvalidId();
-QString VideoSortFilterProxyModelData::mLastAlbumNameInRename;
-int VideoSortFilterProxyModelData::mRenameAlbumReturnValue = 0;
+QString VideoSortFilterProxyModelData::mLastItemNameInRename = "";
+int VideoSortFilterProxyModelData::mRenameItemReturnValue = 0;
QString VideoSortFilterProxyModelData::mLastAddedAlbumName = "";
VideoSortFilterProxyModel::VideoSortFilterProxyModel(VideoCollectionCommon::TModelType type, QObject *parent):
@@ -159,12 +159,6 @@
// not stubbed
}
-void VideoSortFilterProxyModel::itemModifiedSlot(const TMPXItemId &itemId)
-{
- Q_UNUSED(itemId);
- // not stubbed
-}
-
bool VideoSortFilterProxyModel::lessThan(const QModelIndex &left,
const QModelIndex &right) const
{
@@ -281,15 +275,15 @@
VideoSortFilterProxyModelData::mLastItemId = albumId;
}
-int VideoSortFilterProxyModel::renameAlbum(const TMPXItemId &albumId, const QString &newTitle)
+int VideoSortFilterProxyModel::renameItem(const TMPXItemId &itemId, const QString &newTitle)
{
if(VideoSortFilterProxyModelData::mRemoveItemsFromAlbumReturnValue >= 0)
{
- VideoSortFilterProxyModelData::mLastItemId = albumId;
- VideoSortFilterProxyModelData::mLastAlbumNameInRename = newTitle;
+ VideoSortFilterProxyModelData::mLastItemId = itemId;
+ VideoSortFilterProxyModelData::mLastItemNameInRename = newTitle;
}
- return VideoSortFilterProxyModelData::mRenameAlbumReturnValue;
+ return VideoSortFilterProxyModelData::mRenameItemReturnValue;
}
TMPXItemId VideoSortFilterProxyModel::getOpenItem() const
--- a/videocollection/tsrc/stubs/src/videothumbnaildata.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/tsrc/stubs/src/videothumbnaildata.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -21,8 +21,9 @@
int VideoThumbnailTestData::mInstanceCallCount = 0;
int VideoThumbnailTestData::mFreeThumbnailDataCallCount = 0;
-int VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled = 0;
+bool VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled = false;
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)
@@ -72,6 +72,11 @@
VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled = enable;
}
+bool VideoThumbnailData::backgroundFetchingEnabled()
+{
+ return VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled;
+}
+
void VideoThumbnailData::enableThumbnailCreation(bool enable)
{
Q_UNUSED(enable);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/stubs/src/xqsettingsmanagerstub.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,37 @@
+/**
+* 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 "xqsettingsmanagerstub.h"
+
+QVariant XQSettingsManager::mReadItemValueReturnValue = QVariant();
+
+QVariant XQSettingsManager::readItemValue(XQCentralRepositorySettingsKey &key, int type)
+{
+ Q_UNUSED(key);
+ Q_UNUSED(type);
+ return mReadItemValueReturnValue;
+}
+
+XQSettingsManager::XQSettingsManager()
+{
+
+}
+
+XQSettingsManager::~XQSettingsManager()
+{
+
+}
--- a/videocollection/tsrc/stubs/stubs.pro Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/tsrc/stubs/stubs.pro Wed Aug 18 09:50:14 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,9 @@
src/videoservices.cpp \
src/videoserviceurifetch.cpp \
src/videoservicebrowse.cpp \
- src/videoactivitystate.cpp
+ src/videoactivitystate.cpp \
+ src/videooperatorservice.cpp \
+ src/xqsettingsmanagerstub.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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionview/data/collectionview.docml Wed Aug 18 09:50:14 2010 +0300
@@ -36,15 +36,20 @@
</widget>
<widget name="content" role="HbView:widget" type="HbWidget">
<widget name="vc:mStackedLayout" type="HbWidget">
- <widget name="vc:mListWidget" type="VideoListWidget">
+ <widget name="vc:mListStacked" type="HbWidget">
<sizehint height="72un" type="PREFERRED" width="53.6un"/>
+ <bool name="visible" value="TRUE"/>
+ </widget>
+ <widget name="vc:mHintWidget" type="VideoHintWidget">
+ <sizehint height="23.8806un" type="PREFERRED" width="23.8806un"/>
<bool name="visible" value="FALSE"/>
- </widget>
+ </widget>
<real name="z" value="0"/>
<sizehint height="72un" type="PREFERRED" width="53.6un"/>
<bool name="visible" value="TRUE"/>
<layout type="stacked">
- <stackitem itemname="vc:mListWidget"/>
+ <stackitem itemname="vc:mListStacked"/>
+ <stackitem itemname="vc:mHintWidget"/>
</layout>
</widget>
<widget name="vc:mBanner" type="HbGroupBox">
@@ -65,92 +70,63 @@
</widget>
</widget>
<section name="hintSection">
- <widget name="view" type="VideoListView">
- <widget name="content" role="HbView:widget" type="HbWidget">
- <widget name="vc:mStackedLayout" type="HbWidget">
- <widget name="vc:mHintWidget" type="VideoHintWidget">
- <widget name="vc:mNoVideosLabel" type="HbLabel">
- <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_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"/>
- <bool name="visible" value="FALSE"/>
- <string name="state" value="normal"/>
- </widget>
- <real name="z" value="0"/>
- <sizehint height="11.9403un" type="PREFERRED" width="23.8806un"/>
- <layout orientation="Horizontal" type="linear">
- <stretchitem stretchfactor="1"/>
- <linearitem itemname="vc:mHintButton"/>
- <stretchitem stretchfactor="1"/>
- </layout>
- </widget>
- <real name="z" value="0"/>
- <sizehint height="23.8806un" type="PREFERRED" width="23.8806un"/>
- <bool name="visible" value="FALSE"/>
- <layout orientation="Vertical" type="linear">
- <stretchitem stretchfactor="1"/>
- <linearitem itemname="vc:mNoVideosLabel"/>
- <linearitem itemname="vc:mHintTextLabel"/>
- <linearitem itemname="vc:mHintButtonLayout"/>
- <stretchitem stretchfactor="1"/>
- </layout>
- </widget>
- <real name="z" value="0"/>
- <layout type="stacked">
- <stackitem itemname="vc:mListWidget"/>
- <stackitem itemname="vc:mHintWidget"/>
- </layout>
+ <widget name="vc:mHintWidget" type="VideoHintWidget">
+ <widget name="vc:mNoVideosLabel" type="HbLabel">
+ <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_no_videos" name="plainText" value="(No videos)"/>
+ <fontspec name="fontSpec" role="Primary" textheight="26.8"/>
+ </widget>
+ <widget name="vc:mHintButtonLayout" type="HbWidget">
+ <widget name="vc:mHintButton" type="HbPushButton">
+ <real name="z" value="1"/>
+ <sizehint type="PREFERRED"/>
+ <sizehint height="6un" type="MAXIMUM" width="2504062.01158un"/>
+ <bool name="visible" value="FALSE"/>
+ <string name="state" value="normal"/>
</widget>
+ <real name="z" value="0"/>
+ <sizehint height="11.9403un" type="PREFERRED" width="23.8806un"/>
+ <layout orientation="Horizontal" type="linear">
+ <stretchitem stretchfactor="1"/>
+ <linearitem itemname="vc:mHintButton"/>
+ <stretchitem stretchfactor="1"/>
+ </layout>
</widget>
- </widget>
+ <real name="z" value="0"/>
+ <sizehint height="23.8806un" type="PREFERRED" width="23.8806un"/>
+ <bool name="visible" value="FALSE"/>
+ <layout orientation="Vertical" type="linear">
+ <stretchitem stretchfactor="1"/>
+ <linearitem itemname="vc:mNoVideosLabel"/>
+ <linearitem itemname="vc:mHintButtonLayout"/>
+ <stretchitem stretchfactor="1"/>
+ </layout>
+ </widget>
</section>
<section name="listsSection">
- <widget name="view" type="VideoListView">
- <widget name="content" role="HbView:widget" type="HbWidget">
- <widget name="vc:mStackedLayout" type="HbWidget">
- <widget name="vc:mCollectionWidget" type="VideoListWidget">
- <sizehint height="72un" type="PREFERRED" width="53.6un"/>
- <bool name="visible" value="FALSE"/>
- </widget>
- <widget name="vc:mCollectionContentWidget" type="VideoListWidget">
- <sizehint height="72un" type="PREFERRED" width="53.6un"/>
- <bool name="visible" value="FALSE"/>
- </widget>
- <real name="z" value="0"/>
- <layout type="stacked">
- <stackitem itemname="vc:mListWidget"/>
- <stackitem itemname="vc:mCollectionWidget"/>
- <stackitem itemname="vc:mCollectionContentWidget"/>
- </layout>
- </widget>
- <real name="z" value="0"/>
- <layout type="anchor">
- <anchoritem dst="vc:mBanner" dstEdge="LEFT" spacing="var(hb-param-margin-view-right)" src="" srcEdge="LEFT"/>
- <anchoritem dst="vc:mBanner" dstEdge="TOP" spacing="var(hb-param-margin-view-top)" src="" srcEdge="TOP"/>
- <anchoritem dst="vc:mBanner" dstEdge="RIGHT" spacing="var(hb-param-margin-view-left)" src="" srcEdge="RIGHT"/>
- <anchoritem dst="vc:mStackedLayout" dstEdge="LEFT" spacing="var(hb-param-margin-view-left)" src="" srcEdge="LEFT"/>
- <anchoritem dst="vc:mStackedLayout" dstEdge="RIGHT" spacing="var(hb-param-margin-view-right)" src="" srcEdge="RIGHT"/>
- <anchoritem dst="vc:mStackedLayout" dstEdge="TOP" spacing="var(hb-param-margin-view-top)" src="vc:mBanner" srcEdge="BOTTOM"/>
- <anchoritem dst="vc:mStackedLayout" dstEdge="BOTTOM" spacing="var(hb-param-margin-view-bottom)" src="" srcEdge="BOTTOM"/>
- </layout>
+ <widget name="vc:mListStacked" type="HbWidget">
+ <widget name="vc:mListWidget" type="VideoListWidget">
+ <sizehint height="72un" type="PREFERRED" width="53.6un"/>
+ <bool name="visible" value="FALSE"/>
+ </widget>
+ <widget name="vc:mCollectionWidget" type="VideoListWidget">
+ <sizehint height="72un" type="PREFERRED" width="53.6un"/>
+ <bool name="visible" value="FALSE"/>
</widget>
- </widget>
+ <widget name="vc:mCollectionContentWidget" type="VideoListWidget">
+ <sizehint height="72un" type="PREFERRED" width="53.6un"/>
+ <bool name="visible" value="FALSE"/>
+ </widget>
+ <real name="z" value="0"/>
+ <layout type="stacked">
+ <stackitem itemname="vc:mListWidget"/>
+ <stackitem itemname="vc:mCollectionWidget"/>
+ <stackitem itemname="vc:mCollectionContentWidget"/>
+ </layout>
+ </widget>
</section>
<metadata activeUIState="Common ui state" display="NHD portrait" unit="un">
<uistate name="Common ui state" sections="#common"/>
--- a/videocollection/videocollectionview/data/videocollectionview.qrc Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionview/data/videocollectionview.qrc Wed Aug 18 09:50:14 2010 +0300
@@ -1,7 +1,7 @@
<RCC>
<qresource prefix="/layout" >
- <file alias="collectionview.docml">collectionview.docml</file>
- <file alias="videolistselectiondialog.docml">videolistselectiondialog.docml</file>
+ <file alias="collectionview.docml">collectionview.docml.bin</file>
+ <file alias="videolistselectiondialog.docml">videolistselectiondialog.docml.bin</file>
</qresource>
<qresource prefix="/style" >
<file>hbdialog.css</file>
--- a/videocollection/videocollectionview/data/videolistselectiondialog.docml Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionview/data/videolistselectiondialog.docml Wed Aug 18 09:50:14 2010 +0300
@@ -1,7 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hbdocument version="1.0">
+<hbdocument version="1.1">
<widget name="mMultiSelectionDialog" type="VideoListSelectionDialog">
- <widget name="mHeadingWidget" role="HbDialog:headingWidget" type="HbWidget">
+ <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Expanding" verticalStretch="0"/>
+ <sizehint height="var(hb-param-screen-height)" type="PREFERRED" width="var(hb-param-screen-width)"/>
+ <widget name="contentContainer" role="HbDialog:contentWidget" type="HbWidget">
+ <widget name="mListContainer" type="HbStackedWidget">
+ <sizehint height="23.8806un" type="PREFERRED" width="23.8806un"/>
+ </widget>
<widget name="mHeadingLabel" type="HbLabel">
<sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
<sizehint height="3.9un" type="PREFERRED" width="47.04478un"/>
@@ -15,7 +20,7 @@
<sizehint height="4un" type="MINIMUM"/>
</widget>
<widget name="mCheckBoxText" type="HbLabel">
- <enums name="alignment" value="AlignLeft|AlignLeading"/>
+ <enums name="alignment" value="AlignAbsolute|AlignLeft|AlignVCenter|AlignLeading"/>
<sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
<sizehint height="3.9un" type="PREFERRED" width="25.22703un"/>
<string locid="txt_videos_setlabel_mark_all" name="plainText" value="Mark All"/>
@@ -43,23 +48,14 @@
<anchoritem dst="mCheckMarkAll" dstEdge="LEFT" spacing="-1.19403un" src="" srcEdge="LEFT"/>
</layout>
</widget>
- <real name="z" value="0"/>
- <contentsmargins bottom="1un" left="0un" right="0un" top="1un"/>
- <layout type="anchor">
- <anchoritem dst="mCheckBoxContainer" dstEdge="LEFT" spacing="1un" src="" srcEdge="LEFT"/>
- <anchoritem dst="mCheckBoxContainer" dstEdge="TOP" spacing="0.5un" src="mHeadingLabel" srcEdge="BOTTOM"/>
- <anchoritem dst="mCheckBoxContainer" dstEdge="RIGHT" spacing="-1un" src="" srcEdge="RIGHT"/>
- <anchoritem dst="mCheckBoxContainer" dstEdge="BOTTOM" spacing="0.5un" src="" srcEdge="BOTTOM"/>
- <anchoritem dst="mHeadingLabel" dstEdge="LEFT" spacing="1un" src="" srcEdge="LEFT"/>
- <anchoritem dst="mHeadingLabel" dstEdge="TOP" spacing="0.5un" src="" srcEdge="TOP"/>
- <anchoritem dst="mHeadingLabel" dstEdge="RIGHT" spacing="-1un" src="" srcEdge="RIGHT"/>
+ <layout orientation="Vertical" type="linear">
+ <linearitem itemname="mHeadingLabel"/>
+ <linearitem itemname="mCheckBoxContainer"/>
+ <linearitem itemname="mListContainer"/>
</layout>
</widget>
- <widget name="mListContainer" role="HbDialog:contentWidget" type="HbStackedWidget"/>
- <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Expanding" verticalStretch="0"/>
- <sizehint height="var(hb-param-screen-height)" type="PREFERRED" width="var(hb-param-screen-width)"/>
</widget>
- <metadata activeUIState="Common ui state" display="NHD portrait" unit="un">
+ <metadata activeUIState="Common ui state" display="NHD-3.2-inch_portrait" unit="un">
<uistate name="Common ui state" sections="#common"/>
</metadata>
</hbdocument>
--- a/videocollection/videocollectionview/inc/videocollectionuiloaderdef.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionview/inc/videocollectionuiloaderdef.h Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionview/inc/videocollectionviewutils.h Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionview/inc/videohintwidget.h Wed Aug 18 09:50:14 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/videolistselectiondialog.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionview/inc/videolistselectiondialog.h Wed Aug 18 09:50:14 2010 +0300
@@ -128,15 +128,16 @@
void singleItemSelectedSlot(const QModelIndex &index);
/**
- * handles model ready signal from model.
- * In case dialog type is ESelectCollection and there are no data
- * in model, opens up a selection dialog for user to input new album name
- * In case type is something else than ESelectCollection, calls
- * updateCounterSlot()
+ * Handles model ready signal from model.
*/
void modelReadySlot();
/**
+ * Handles album list ready signal from model.
+ */
+ void albumListReadySlot();
+
+ /**
* Changes the counter value. Sets the checkbutton state based on selection count.
*
*/
@@ -266,6 +267,16 @@
*/
VideoSortFilterProxyModel *mModel;
+ /**
+ * Boolean to know if the model is ready or not.
+ */
+ bool mModelReady;
+
+ /**
+ * Boolean to know if album list is ready or not.
+ */
+ bool mAlbumListReady;
+
/**
* List widget to show in selection
*/
--- a/videocollection/videocollectionview/inc/videolistview.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionview/inc/videolistview.h Wed Aug 18 09:50:14 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
@@ -125,7 +127,12 @@
* slot is connected to model's modelReady -signal
*/
void modelReadySlot();
-
+
+ /**
+ * slot is connected to model's albumListReady -signal
+ */
+ void albumListReadySlot();
+
/**
* slot is connected to plugin's doDelayeds -signal
*
@@ -163,13 +170,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
@@ -271,6 +277,11 @@
private:
/**
+ * Convenience method that modelReadySlot and albumListReadySlot calls.
+ */
+ void modelReady();
+
+ /**
* Cleans all possibly created objects from this. In some cases there are no quarantees
* that they were created correctly, and thus is better to start again from clean slate.
*/
@@ -285,6 +296,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 +365,7 @@
private:
/**
- * actions ids used in main menu and tool bar
+ * Actions ids used in main menu and tool bar
*/
enum TViewActionIds
{
@@ -351,12 +377,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 +407,7 @@
VideoHintWidget::HintLevel mHintLevel;
/**
- * pointer to videoservices instance
+ * Pointer to videoservices instance
* if exists, app has started as service
*/
VideoServices* mVideoServices;
@@ -402,12 +428,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 +441,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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionview/inc/videolistwidget.h Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionview/src/videocollectionviewutils.cpp Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionview/src/videohintwidget.cpp Wed Aug 18 09:50:14 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/videolistselectiondialog.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionview/src/videolistselectiondialog.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 30 %
+// Version : %version: 30.1.2 %
// INCLUDE FILES
#include <qgraphicsitem.h>
@@ -86,6 +86,8 @@
, mListContainer( 0 )
, mForcedCheck( false )
, mModel( 0 )
+ , mModelReady( false )
+ , mAlbumListReady( false )
, mListWidget( 0 )
, mPrimaryAction( 0 )
, mSecondaryAction( 0 )
@@ -303,6 +305,9 @@
}
mPrimaryAction->setText(primaryTxt);
+
+ mModelReady = false;
+ mAlbumListReady = false;
if(mTypeOfSelection == ESelectCollection)
{
@@ -346,10 +351,10 @@
// scroll list back to top
mListWidget->scrollTo(mModel->index(0, 0));
+ connectSignals();
+
if(mModel->rowCount())
{
- connectSignals();
-
if(mTypeOfSelection == ECreateCollection)
{
// note this does not leak memory as the dialog will destroy itself upon close.
@@ -362,7 +367,8 @@
HbDialog::open();
}
}
- else
+ else if((mModelReady && mTypeOfSelection != ESelectCollection) ||
+ (mAlbumListReady && mTypeOfSelection == ESelectCollection))
{
INFO("VideoListSelectionDialog::exec(): nothing to show, finishing.")
// no items, finish right away
@@ -389,6 +395,8 @@
mTypeOfSelection = EAddToCollection;
if(mSelectedAlbumId == TMPXItemId::InvalidId())
{
+ close(); // closes selection dialog if it's open.
+
// note this does not leak memory as the dialog will destroy itself upon close.
HbInputDialog *dialog = gCreateNewAlbumNameDialog(SELECTION_DIALOG_OBJECT_NAME_NEW_COLLECTION);
dialog->open(this, SLOT(newAlbumNameDialogFinished(HbAction *)));
@@ -420,7 +428,7 @@
if(dialog->actions().first() == action && variant.isValid())
{
QString text = mModel->resolveAlbumName(variant.toString());
- if(text.length())
+ if(!text.isEmpty())
{
if(mSelectedVideos.count() == 0)
{
@@ -434,6 +442,16 @@
finalize(text);
}
}
+ else
+ {
+ // new album name empty, effectively cancel, so disconnect signals.
+ disconnectSignals();
+ }
+ }
+ else
+ {
+ // new album dialog cancelled, disconnect signals.
+ disconnectSignals();
}
}
@@ -586,18 +604,68 @@
void VideoListSelectionDialog::modelReadySlot()
{
FUNC_LOG;
+ mModelReady = true;
+
+ if(mTypeOfSelection != ESelectCollection)
+ {
+ if(!mModel->rowCount())
+ {
+ // no items, finish right away
+ INFO("VideoListSelectionDialog::modelReadySlot(): nothing to show, finishing.");
+
+ if(mTypeOfSelection == EAddToCollection ||
+ mTypeOfSelection == ERemoveFromCollection)
+ {
+ primaryActionTriggeredSlot();
+ }
+ else
+ {
+ finishedSlot(mPrimaryAction);
+ }
+
+ return;
+ }
+
+ // if dialog is not yet visible, bring it visible.
+ if(!isVisible() && mTypeOfSelection != ECreateCollection)
+ {
+ // scroll list back to top
+ mListWidget->scrollTo(mModel->index(0, 0));
+
+ HbDialog::open();
+ }
+
+ updateCounterSlot();
+ }
+}
+
+// ---------------------------------------------------------------------------
+// albumListReadySlot
+// ---------------------------------------------------------------------------
+//
+void VideoListSelectionDialog::albumListReadySlot()
+{
+ mAlbumListReady = true;
+
if(mTypeOfSelection == ESelectCollection)
{
if(!mModel->rowCount())
{
- // in case there are no user defined albums,
- // start input dialog right away by accepting dialog
- INFO("VideoListSelectionDialog::selectionChangedSlot(): no albums, starting album creation.")
- mPrimaryAction->trigger();
+ finishedSlot(mPrimaryAction);
return;
}
+
+ // if dialog is not yet visible, bring it visible.
+ if(!isVisible())
+ {
+ // scroll list back to top
+ mListWidget->scrollTo(mModel->index(0, 0));
+
+ HbDialog::open();
+ }
+
+ updateCounterSlot();
}
- updateCounterSlot();
}
// ---------------------------------------------------------------------------
@@ -639,11 +707,12 @@
connect(mPrimaryAction, SIGNAL(triggered()), this, SLOT(close()));
// update video items selection here before content changes.
- int count = mSelection.indexes().count();
+ QModelIndexList indexes = mSelection.indexes();
+ int count = indexes.count();
TMPXItemId id = TMPXItemId::InvalidId();
for(int i = 0; i < count; ++i)
{
- id = mModel->getMediaIdAtIndex(mSelection.indexes().at(i));
+ id = mModel->getMediaIdAtIndex(indexes.at(i));
if(id.iId2 == KVcxMvcMediaTypeVideo)
{
mSelectedVideos.insert(id);
@@ -685,8 +754,9 @@
this, SLOT(selectionChangedSlot(const QItemSelection&, const QItemSelection &)));
// model changes signals
- connect(mModel->sourceModel(), SIGNAL(modelReady()), this, SLOT(modelReadySlot()));
- connect(mModel->sourceModel(), SIGNAL(modelChanged()), this, SLOT(updateCounterSlot()));
+ connect(mModel->sourceModel(), SIGNAL(modelReady()), this, SLOT(modelReadySlot()));
+ connect(mModel->sourceModel(), SIGNAL(albumListReady()), this, SLOT(albumListReadySlot()));
+ connect(mModel->sourceModel(), SIGNAL(modelChanged()), this, SLOT(updateCounterSlot()));
// mark all state changes
connect(mCheckBox, SIGNAL(stateChanged(int)), this, SLOT(markAllStateChangedSlot(int)));
@@ -709,6 +779,7 @@
// model changes signals
disconnect(mModel->sourceModel(), SIGNAL(modelReady()), this, SLOT(modelReadySlot()));
+ disconnect(mModel->sourceModel(), SIGNAL(albumListReady()), this, SLOT(albumListReadySlot()));
disconnect(mModel->sourceModel(), SIGNAL(modelChanged()), this, SLOT(updateCounterSlot()));
// mark all state changes
--- a/videocollection/videocollectionview/src/videolistview.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionview/src/videolistview.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 113 %
+// Version : %version: 113.1.5 %
// 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();
}
// ---------------------------------------------------------------------------
@@ -147,6 +164,7 @@
params.append(VideoCollectionUiLoaderParam(
DOCML_NAME_VC_VIDEOLISTWIDGET,
DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ DOCML_VIDEOCOLLECTIONVIEW_SECTION_LIST,
true,
videoListPhase));
@@ -257,8 +275,6 @@
DOCML_NAME_VC_COLLECTIONWIDGET );
}
-
-
return 0;
}
@@ -334,7 +350,10 @@
this, SLOT(layoutChangedSlot())) ||
!connect(
mCurrentList->getModel()->sourceModel(), SIGNAL(modelReady()),
- this, SLOT(modelReadySlot())))
+ this, SLOT(modelReadySlot())) ||
+ !connect(
+ mCurrentList->getModel()->sourceModel(), SIGNAL(albumListReady()),
+ this, SLOT(albumListReadySlot())))
{
ERROR(-1, "VideoListView::activateView() failed to connect signals.");
// deactivate view so we get rid of dangling connections.
@@ -372,20 +391,28 @@
{
FUNC_LOG;
- // if mModelReady is false, then it means that this is the first time modelReady
- // signal fires. Signaling that view is ready.
- if(!mViewReady)
+ // check that current list is all videos or collection content.
+ VideoCollectionCommon::TCollectionLevels level = mCurrentList->getLevel();
+ if(level != VideoCollectionCommon::ELevelCategory)
{
- mViewReady = true;
- emit viewReady();
+ modelReady();
}
-
- mModelReady = true;
+}
+
+// ---------------------------------------------------------------------------
+// albumListReadySlot
+// ---------------------------------------------------------------------------
+//
+void VideoListView::albumListReadySlot()
+{
+ FUNC_LOG;
- // since the reset signal arrives after
- // layout changed, need to make sure that
- // view is updated in case needed
- layoutChangedSlot();
+ // check that current list is category list.
+ VideoCollectionCommon::TCollectionLevels level = mCurrentList->getLevel();
+ if(level == VideoCollectionCommon::ELevelCategory)
+ {
+ modelReady();
+ }
}
// ---------------------------------------------------------------------------
@@ -457,6 +484,30 @@
}
// ---------------------------------------------------------------------------
+// modelReady()
+// ---------------------------------------------------------------------------
+//
+void VideoListView::modelReady()
+{
+ FUNC_LOG;
+
+ // if mViewReady is false, then it means that this is the first time
+ // modelReady or albumListReady signal fires. Signaling that view is ready.
+ if(!mViewReady)
+ {
+ mViewReady = true;
+ emit viewReady();
+ }
+
+ mModelReady = true;
+
+ // since the reset signal arrives after
+ // layout changed, need to make sure that
+ // view is updated in case needed
+ layoutChangedSlot();
+}
+
+// ---------------------------------------------------------------------------
// cleanup()
// ---------------------------------------------------------------------------
//
@@ -500,9 +551,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 +571,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 +586,7 @@
mToolbarActions[ETBActionAllVideos]->setCheckable(true);
mToolbarActions[ETBActionCollections]->setCheckable(true);
- if (!mVideoServices)
+ if(!mVideoServices && mToolbarActions[ETBActionServices])
{
mToolbarActions[ETBActionServices]->setCheckable(false);
}
@@ -559,13 +609,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 +713,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 +850,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 +1043,17 @@
}
// ---------------------------------------------------------------------------
-// openservicesViewSlot()
+// openOperatorServiceSlot()
// ---------------------------------------------------------------------------
//
-void VideoListView::openServicesViewSlot()
+void VideoListView::openOperatorServiceSlot()
{
FUNC_LOG;
- debugNotImplementedYet();
+
+ if(mVideoOperatorServices.count() > 0)
+ {
+ mVideoOperatorServices[0]->launchService();
+ }
}
// ---------------------------------------------------------------------------
@@ -1302,32 +1445,20 @@
const TMPXItemId &collectionId)
{
FUNC_LOG;
-
- // clear toolbar actions.
- toolBar()->clearActions();
+
+ // update / clear collection name
+ mCollectionName = collection;
- VideoListWidget *collectionContentWidget =
- mUiLoader->findWidget<VideoListWidget>(
- DOCML_NAME_VC_COLLECTIONCONTENTWIDGET);
-
- if(!collectionContentWidget)
- {
- return;
- }
- // update collection specific information
- mCollectionName = collection;
-
- // disable collection content animations during widget change
- HbAbstractItemView::ItemAnimations animationState = collectionContentWidget->enabledAnimations();
- collectionContentWidget->setEnabledAnimations(HbAbstractItemView::None);
-
if(openingCollection)
{
- // open album view
- if (collectionId == TMPXItemId::InvalidId() || mCurrentList == collectionContentWidget)
+ VideoListWidget *collectionContentWidget =
+ mUiLoader->findWidget<VideoListWidget>(
+ DOCML_NAME_VC_COLLECTIONCONTENTWIDGET);
+ // open album view, mCurrentList might be NULL at this point
+ if (!collectionContentWidget || mCurrentList == collectionContentWidget)
{
- // no currentlist or currentlist is already collection content -list
- collectionContentWidget->setEnabledAnimations(animationState);
+ // collection widget cannot be loaded or
+ // currentlist is already collection content -list
return;
}
@@ -1344,18 +1475,21 @@
}
else
{
- collectionContentWidget->setEnabledAnimations(animationState);
return;
}
-
- // Start fetching content before changing.
+
VideoSortFilterProxyModel *model = collectionContentWidget->getModel();
if(!model)
{
// no model for content widget, cannot activate
- collectionContentWidget->setEnabledAnimations(animationState);
return;
}
+
+ // disable collection content animations during widget change
+ HbAbstractItemView::ItemAnimations animationState = collectionContentWidget->enabledAnimations();
+ collectionContentWidget->setEnabledAnimations(HbAbstractItemView::None);
+
+ // Start fetching content before changing list widget
model->openItem(collectionId);
// deactivat current widget.
@@ -1369,35 +1503,49 @@
mCurrentList->activate(level);
updateSubLabel();
-
- model->invalidate();
// update hint widget for correct content
mModelReady = model->rowCount() > 0;
setHintLevel(VideoHintWidget::Collection);
- // update toolbar for albums, default categories don't have one.
- if(level == VideoCollectionCommon::ELevelAlbum &&
+ // update toolbar for albums, default categories don't have one. Neither does services.
+ toolBar()->clearActions();
+ if(!mVideoServices && level == VideoCollectionCommon::ELevelAlbum &&
mToolbarCollectionActionGroup && mToolbarActions.contains(ETBActionCollections))
{
mToolbarActions[ETBActionCollections]->setChecked(false);
toolBar()->addActions(mToolbarCollectionActionGroup->actions());
+ setItemVisible(Hb::ToolBarItem, true);
}
+ else
+ {
+ setItemVisible(Hb::ToolBarItem, false);
+ }
+ // restore animations for collection content widget
+ collectionContentWidget->setEnabledAnimations(animationState);
}
else
{
+ // clear actions to make sure there is no wrong toolbar in case main
+ // toolbar actiongroup actiongroup is missing
+ toolBar()->clearActions();
// open collection view
- openCollectionViewSlot();
-
+ openCollectionViewSlot();
// update toolbar
if(mToolbarViewsActionGroup && mToolbarActions.contains(ETBActionCollections))
- {
+ {
toolBar()->addActions(mToolbarViewsActionGroup->actions());
mToolbarActions[ETBActionCollections]->setChecked(true);
+ setItemVisible(Hb::ToolBarItem, true);
+
+ if(mToolbarServiceExtension)
+ {
+ HbAction *action = toolBar()->addExtension(mToolbarServiceExtension);
+ HbIcon icon("qtg_mono_video_services");
+ action->setIcon(icon);
+ }
}
- }
- // restore animations for collection content widget
- collectionContentWidget->setEnabledAnimations(animationState);
+ }
if(!mVideoServices)
{
// save / clear collection related activity data
@@ -1454,7 +1602,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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionview/src/videolistwidget.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -30,6 +30,7 @@
#include <hblistviewitem.h>
#include <hbmessagebox.h>
#include <hbinputdialog.h>
+#include <hbparameterlengthlimiter.h>
#include <vcxmyvideosdefs.h>
#include "videocollectionviewutils.h"
@@ -150,6 +151,7 @@
connect(this, SIGNAL(fileUri(const QString&)), mVideoServices, SLOT(itemSelected(const QString&)));
}
+ setItemPixmapCacheEnabled(true);
setModel(mModel);
return 0;
@@ -200,7 +202,7 @@
// Enable thumbnail background fetching.
VideoThumbnailData &thumbnailData = VideoThumbnailData::instance();
thumbnailData.enableBackgroundFetching(true);
- thumbnailData.startBackgroundFetching(mModel, 0);
+ fetchThumbnailsForVisibleItems();
return 0;
}
@@ -380,13 +382,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 +397,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())
@@ -543,6 +545,7 @@
mContextMenuActions[EActionDelete]->setVisible(true);
mContextMenuActions[EActionPlay]->setVisible(true);
mContextMenuActions[EActionDetails]->setVisible(true);
+ mContextMenuActions[EActionRename]->setVisible(true);
}
else if(mCurrentLevel == VideoCollectionCommon::ELevelCategory)
{
@@ -560,6 +563,7 @@
mContextMenuActions[EActionDelete]->setVisible(true);
mContextMenuActions[EActionPlay]->setVisible(true);
mContextMenuActions[EActionDetails]->setVisible(true);
+ mContextMenuActions[EActionRename]->setVisible(true);
}
}
@@ -789,9 +793,8 @@
QModelIndex index = currentIndex();
QVariant variant = mModel->data(index, VideoCollectionCommon::KeyTitle);
- TMPXItemId itemId = mModel->getMediaIdAtIndex(index);
-
- if(variant.isValid() && itemId.iId2 == KVcxMvcMediaTypeAlbum)
+
+ if(variant.isValid())
{
QString label(hbTrId("txt_videos_title_enter_name"));
QString albumName = variant.toString();
@@ -814,26 +817,34 @@
Q_UNUSED(action);
HbInputDialog *dialog = static_cast<HbInputDialog*>(sender());
-
+ if(dialog->actions().first() != action)
+ {
+ return;
+ }
QModelIndex index = currentIndex();
TMPXItemId itemId = mModel->getMediaIdAtIndex(index);
QVariant newNameVariant = dialog->value();
QVariant oldNameVariant = mModel->data(index, VideoCollectionCommon::KeyTitle);
-
- if(dialog->actions().first() == action &&
- oldNameVariant.isValid() && newNameVariant.isValid() && itemId.iId2 == KVcxMvcMediaTypeAlbum)
+ if(!newNameVariant.isValid() || !oldNameVariant.isValid())
+ {
+ // invalid data at index
+ return;
+ }
+ QString newAlbumName = newNameVariant.toString().trimmed();
+ QString oldAlbumName = oldNameVariant.toString();
+ if(!newAlbumName.length() || newAlbumName == oldAlbumName)
{
- QString newAlbumName = newNameVariant.toString();
- QString oldAlbumName = oldNameVariant.toString();
-
- if(newAlbumName.length() && newAlbumName.trimmed() != oldAlbumName)
- {
- // Resolve collection true name and rename the album
- newAlbumName = mModel->resolveAlbumName(newAlbumName);
- mModel->renameAlbum(itemId, newAlbumName);
- }
+ // no new name provided or name has not changed
+ return;
}
+ if(itemId.iId2 == KVcxMvcMediaTypeAlbum)
+ {
+ // for album, we need to make sure name is unique
+ newAlbumName = mModel->resolveAlbumName(newAlbumName);
+ }
+ mModel->renameItem(itemId, newAlbumName);
}
+
// ---------------------------------------------------------------------------
// addToCollectionSlot
// ---------------------------------------------------------------------------
@@ -897,12 +908,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 +923,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())
@@ -1007,13 +1019,53 @@
void VideoListWidget::fetchThumbnailsForVisibleItems()
{
FUNC_LOG_ADDR(this);
+
+ // No need to do anything if thumbnail fetching is not enabled.
+ if(!VideoThumbnailData::instance().backgroundFetchingEnabled())
+ {
+ return;
+ }
+
const QList<HbAbstractViewItem *> itemsVisible = visibleItems();
-
+
if(itemsVisible.count() > 0)
{
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 Wed Aug 18 09:50:14 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())
+ {
+ INFOQSTR_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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testhintwidget/src/testhintwidget.cpp Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testlistview/inc/testlistview.h Wed Aug 18 09:50:14 2010 +0300
@@ -21,6 +21,7 @@
// INCLUDES
#include <QtTest/QtTest>
+#include <mpxitemid.h>
#include "hbmessagebox.h"
#include "hbeffect.h"
@@ -129,9 +130,9 @@
void testOpenCollectionViewSlot();
/**
- * Tests openServicesViewSlot.
+ * Tests openOperatorServiceSlot.
*/
- void testOpenServicesViewSlot();
+ void testOpenOperatorServiceSlot();
/**
* Tests startSortingSlot.
@@ -193,6 +194,11 @@
*/
void testRemoveVideosFromCollectionSlot();
+ /**
+ * Tests createOperatorServicesToolbar
+ */
+ void testCreateOperatorServicesToolbar();
+
signals:
// Signals needed in tests.
@@ -206,7 +212,7 @@
void testLayoutChangedSignal();
- void testCollectionOpenedSignal(bool, const QString&, const QModelIndex&);
+ void testCollectionOpenedSignal(bool, const QString&, const TMPXItemId&);
void testStatusSignal(int, QVariant&);
--- a/videocollection/videocollectionview/tsrc/testlistview/src/testlistview.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testlistview/src/testlistview.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 48 %
+// Version : %version: 51 %
#define private public
#include "videoservices.h"
@@ -63,6 +63,8 @@
#include "videocollectionuiloaderdata.h"
#include "videolistdatamodeldata.h"
#include "xqserviceutilxtra.h"
+#include "videooperatorservicedata.h"
+#include "videooperatorservice.h"
// ---------------------------------------------------------------------------
// main
@@ -97,7 +99,7 @@
// init
// ---------------------------------------------------------------------------
//
-void TestListView::init(bool initTestView )
+void TestListView::init(bool initTestView)
{
XQServiceUtilXtra::service = false;
mUiLoader = new VideoCollectionUiLoader();
@@ -114,6 +116,8 @@
QVERIFY(mTestView);
if(initTestView)
{
+ VideoOperatorServiceData::mIcons.append("qtg_mono_ovistore");
+ VideoOperatorServiceData::mUris.append("testuri");
QVERIFY(mTestView->initializeView() == 0);
}
@@ -293,6 +297,7 @@
void TestListView::testMenus()
{
init();
+
TMPXItemId tmpId = TMPXItemId::InvalidId();
mTestView->activateView(tmpId);
@@ -300,7 +305,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 +316,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 +794,26 @@
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();
}
// ---------------------------------------------------------------------------
@@ -1177,71 +1197,119 @@
//
void TestListView::testCollectionOpenedSlot()
{
- QString testString;
-
- // View is not initialized.
+ QString testString("");
+ TMPXItemId itemId = TMPXItemId::InvalidId();
+ int listWidgetActivateCount = 0;
+
init(false);
- connect(this, SIGNAL(testCollectionOpenedSignal(bool, const QString&, const QModelIndex&)),
- mTestView, SLOT(collectionOpenedSlot(bool, const QString&, const QModelIndex&)));
- emit testCollectionOpenedSignal(false, testString, QModelIndex());
- cleanup();
-
- // No toolbar actions.
- init(true);
- mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_COLLECTIONWIDGET); // load model
- QModelIndex index = VideoCollectionWrapperData::mCollectionsModel->index(0, 0);
- // Clear actions.
- QMap<VideoListView::TViewActionIds, HbAction*> backupActions =
- QMap<VideoListView::TViewActionIds, HbAction*>(mTestView->mToolbarActions);
- mTestView->mToolbarActions.clear();
- connect(this, SIGNAL(testCollectionOpenedSignal(bool, const QString&, const QModelIndex&)),
- mTestView, SLOT(collectionOpenedSlot(bool, const QString&, const QModelIndex&)));
- emit testCollectionOpenedSignal(true, testString, index);
- mTestView->mToolbarActions.unite(backupActions);
- cleanup();
-
- // index is invalid
- init();
- emit testCollectionOpenedSignal(true, testString, QModelIndex());
+ // collection content widget does not exist
+ VideoCollectionUiLoaderData::mFindFailure = true;
+ connect(this, SIGNAL(testCollectionOpenedSignal(bool, const QString&, const TMPXItemId &)),
+ mTestView, SLOT(collectionOpenedSlot(bool, const QString&, const TMPXItemId &)));
+ emit testCollectionOpenedSignal(true, testString, itemId);
+ VideoCollectionUiLoaderData::mFindFailure = false;
+ QVERIFY(!mTestView->mCurrentList);
cleanup();
- // current list is null
- init();
- VideoListWidget *tmpList = mTestView->mCurrentList;
- emit testCollectionOpenedSignal(true, testString, index);
- mTestView->mCurrentList = tmpList;
- cleanup();
+ init(true);
+ connect(this, SIGNAL(testCollectionOpenedSignal(bool, const QString&, const TMPXItemId &)),
+ mTestView, SLOT(collectionOpenedSlot(bool, const QString&, const TMPXItemId &)));
+ QVERIFY(mTestView->mCurrentList->getLevel() < VideoCollectionCommon::ELevelDefaultColl );
+ VideoListWidget *listWidget = mTestView->mCurrentList;
+ listWidgetActivateCount = VideoListWidgetData::mActivateCount;
+
+ // id is invalid
+ emit testCollectionOpenedSignal(true, testString, itemId);
+ QVERIFY(mTestView->mCurrentList == listWidget);
+ QVERIFY(mTestView->mCurrentList->getLevel() < VideoCollectionCommon::ELevelDefaultColl );
+ QVERIFY(listWidgetActivateCount == VideoListWidgetData::mActivateCount);
+ itemId = TMPXItemId(1,1);
+ listWidget->activate();
+ listWidget->getModel()->open(VideoCollectionCommon::ELevelDefaultColl);
+
+ VideoListWidget *collectionContent = mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_COLLECTIONCONTENTWIDGET);
- // current list is collectioncontentwidget
- init();
- cleanup();
+ // current list is collection content
+ VideoListWidget *tmpList = mTestView->mCurrentList;
+ mTestView->mCurrentList = collectionContent;
+ listWidgetActivateCount = VideoListWidgetData::mActivateCount;
+ emit testCollectionOpenedSignal(true, testString, itemId);
+ QVERIFY(listWidgetActivateCount == VideoListWidgetData::mActivateCount);
+ mTestView->mCurrentList = tmpList;
- // index is for video item and not for collection.
- init();
+ // collection list widget has no model
+ VideoSortFilterProxyModel *nullModel = 0;
+ VideoSortFilterProxyModel *tempModel = collectionContent->getModel();
+ collectionContent->initialize(*nullModel, false, VideoCollectionCommon::ELevelDefaultColl);
+ listWidget = mTestView->mCurrentList;
+ listWidgetActivateCount = VideoListWidgetData::mActivateCount;
+ emit testCollectionOpenedSignal(true, testString, itemId);
+ QVERIFY(listWidgetActivateCount == VideoListWidgetData::mActivateCount);
+ QVERIFY(mTestView->mCurrentList == listWidget);
+ QVERIFY(mTestView->mCurrentList->getLevel() < VideoCollectionCommon::ELevelDefaultColl );
cleanup();
-
- // non-error cases:
- testString = "Test text string";
-
+ init(true);
+ itemId = TMPXItemId::InvalidId();
+ VideoCollectionViewUtilsData::mWidgetLevel = VideoCollectionCommon::ELevelCategory;
+ mTestView->activateView(itemId);
+ connect(this, SIGNAL(testCollectionOpenedSignal(bool, const QString&, const TMPXItemId &)),
+ mTestView, SLOT(collectionOpenedSlot(bool, const QString&, const TMPXItemId &)));
+
+ collectionContent = mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_COLLECTIONCONTENTWIDGET);
// Collection opened with default collection.
- init();
- mTestView->mCurrentList = mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_COLLECTIONWIDGET);
- index = VideoCollectionWrapperData::mCollectionsModel->index(0, 0);
- connect(this, SIGNAL(testCollectionOpenedSignal(bool, const QString&, const QModelIndex&)),
- mTestView, SLOT(collectionOpenedSlot(bool, const QString&, const QModelIndex&)));
- emit testCollectionOpenedSignal(true, testString, index);
- // Verify checkable and visible toolbar actions.
- cleanup();
-
- // Collection opened with userdefined album.
- init();
- cleanup();
-
- // Collection closed.
- init();
- connect(this, SIGNAL(testCollectionOpenedSignal(bool, const QString&, const QModelIndex&)),
- mTestView, SLOT(collectionOpenedSlot(bool, const QString&, const QModelIndex&)));
- emit testCollectionOpenedSignal(false, testString, QModelIndex());
+ itemId = TMPXItemId(1,1);
+ listWidgetActivateCount = VideoListWidgetData::mActivateCount;
+ emit testCollectionOpenedSignal(true, testString, itemId);
+ QVERIFY(VideoListWidgetData::mActivateCount == listWidgetActivateCount + 1);
+ QVERIFY(mTestView->mCurrentList == collectionContent);
+ QVERIFY(mTestView->mCurrentList->getLevel() == VideoCollectionCommon::ELevelDefaultColl );
+ QVERIFY(!HbView::mSetItemVisibleLast);
+
+ // returning collection widget
+ emit testCollectionOpenedSignal(false, testString, itemId);
+ QVERIFY(mTestView->mCurrentList != collectionContent);
+ QVERIFY(mTestView->mCurrentList->getLevel() == VideoCollectionCommon::ELevelCategory );
+ QVERIFY(HbView::mSetItemVisibleLast);
+
+ // Collection opened with album.
+ itemId = TMPXItemId(1,2);
+ listWidgetActivateCount = VideoListWidgetData::mActivateCount;
+ emit testCollectionOpenedSignal(true, testString, itemId);
+ QVERIFY(VideoListWidgetData::mActivateCount == listWidgetActivateCount + 1);
+ QVERIFY(mTestView->mCurrentList == collectionContent);
+ QVERIFY(mTestView->mCurrentList->getLevel() == VideoCollectionCommon::ELevelAlbum );
+ QVERIFY(HbView::mSetItemVisibleLast);
+
+ // returning collection widget (no mToolbarViewsActionGroup for coverage)
+ HbView::mSetItemVisibleLast = false;
+ QActionGroup *tmpActionGroup = mTestView->mToolbarViewsActionGroup;
+ mTestView->mToolbarViewsActionGroup = 0;
+ emit testCollectionOpenedSignal(false, testString, itemId);
+ QVERIFY(mTestView->mCurrentList != collectionContent);
+ QVERIFY(mTestView->mCurrentList->getLevel() == VideoCollectionCommon::ELevelCategory );
+ QVERIFY(!HbView::mSetItemVisibleLast);
+ mTestView->mToolbarViewsActionGroup = tmpActionGroup;
+
+ // service
+ VideoServices *tmpService = VideoServices::instance();
+ mTestView->mVideoServices = tmpService;
+ itemId = TMPXItemId(1,1);
+ listWidgetActivateCount = VideoListWidgetData::mActivateCount;
+ emit testCollectionOpenedSignal(true, testString, itemId);
+ QVERIFY(VideoListWidgetData::mActivateCount == listWidgetActivateCount + 1);
+ QVERIFY(mTestView->mCurrentList == collectionContent);
+ QVERIFY(mTestView->mCurrentList->getLevel() == VideoCollectionCommon::ELevelDefaultColl );
+ QVERIFY(!HbView::mSetItemVisibleLast);
+
+ // returning collection widget (no mToolbarServiceExtension for coverage)
+ HbToolBarExtension *tmpExtension = mTestView->mToolbarServiceExtension;
+ mTestView->mToolbarServiceExtension = 0;
+ emit testCollectionOpenedSignal(false, testString, itemId);
+ QVERIFY(mTestView->mCurrentList != collectionContent);
+ QVERIFY(mTestView->mCurrentList->getLevel() == VideoCollectionCommon::ELevelCategory );
+ QVERIFY(HbView::mSetItemVisibleLast);
+ mTestView->mToolbarServiceExtension = tmpExtension;
+
cleanup();
}
@@ -1255,8 +1323,6 @@
setRowCount(1);
mTestView->mModelReady = true;
connect(this, SIGNAL(testLayoutChangedSignal()), mTestView, SLOT(layoutChangedSlot()));
- connect(this, SIGNAL(testCollectionOpenedSignal(bool, const QString&, const QModelIndex&)),
- mTestView, SLOT(collectionOpenedSlot(bool, const QString&, const QModelIndex&)));
VideoListWidget *videoListWidget = mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_VIDEOLISTWIDGET);
VideoListWidget *collectionWidget = mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_COLLECTIONWIDGET);
@@ -1685,4 +1751,61 @@
cleanup();
}
+// ---------------------------------------------------------------------------
+// testCreateOperatorServicesToolbar
+// ---------------------------------------------------------------------------
+//
+void TestListView::testCreateOperatorServicesToolbar()
+{
+ // Only one service.
+ init();
+ HbToolBarExtension::mAddActionCallCount = 0;
+ VideoOperatorServiceData::mIcons.clear();
+ VideoOperatorServiceData::mUris.clear();
+ VideoOperatorServiceData::mIcons.append("qtg_mono_ovistore");
+ VideoOperatorServiceData::mUris.append("testuri");
+ QCOMPARE(mTestView->mVideoOperatorServices.count(), 0);
+ TMPXItemId tmpId = TMPXItemId::InvalidId();
+ mTestView->activateView(tmpId);
+ QCOMPARE(mTestView->mVideoOperatorServices.count(), 1);
+ QVERIFY(mTestView->mToolbarActions[VideoListView::ETBActionServices] != 0);
+ QVERIFY(mTestView->mToolbarServiceExtension == 0);
+ QCOMPARE(HbToolBarExtension::mAddActionCallCount, 0);
+ cleanup();
+
+ // Multiple, 3, services
+ init();
+ HbToolBarExtension::mAddActionCallCount = 0;
+ VideoOperatorServiceData::mIcons.clear();
+ VideoOperatorServiceData::mUris.clear();
+ VideoOperatorServiceData::mIcons.append("qtg_mono_ovistore");
+ VideoOperatorServiceData::mUris.append("testuri");
+ VideoOperatorServiceData::mIcons.append("qtg_mono_ovistore2");
+ VideoOperatorServiceData::mUris.append("testuri2");
+ VideoOperatorServiceData::mIcons.append("qtg_mono_ovistore3");
+ VideoOperatorServiceData::mUris.append("testuri3");
+ QCOMPARE(mTestView->mVideoOperatorServices.count(), 0);
+ tmpId = TMPXItemId::InvalidId();
+ mTestView->activateView(tmpId);
+ QCOMPARE(mTestView->mVideoOperatorServices.count(), 3);
+ QVERIFY(mTestView->mToolbarActions[VideoListView::ETBActionServices] == 0);
+ QVERIFY(mTestView->mToolbarServiceExtension != 0);
+ QCOMPARE(HbToolBarExtension::mAddActionCallCount, 3);
+ cleanup();
+
+ // Services already loaded.
+ init();
+ VideoOperatorServiceData::mIcons.clear();
+ VideoOperatorServiceData::mUris.clear();
+ VideoOperatorServiceData::mIcons.append("qtg_mono_ovistore");
+ VideoOperatorServiceData::mUris.append("testuri");
+ mTestView->mVideoOperatorServices.append(new VideoOperatorService());
+ mTestView->activateView(tmpId);
+ QCOMPARE(mTestView->mVideoOperatorServices.count(), 1);
+ QVERIFY(mTestView->mToolbarActions[VideoListView::ETBActionServices] == 0);
+ QVERIFY(mTestView->mToolbarServiceExtension == 0);
+ cleanup();
+
+}
+
// End of file
--- a/videocollection/videocollectionview/tsrc/testlistwidget/inc/testlistwidget.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testlistwidget/inc/testlistwidget.h Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testlistwidget/src/testlistwidget.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 56 %
+// Version : %version: 60 %
#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);
+ }
};
// ---------------------------------------------------------------------------
@@ -760,7 +771,7 @@
}
++iter;
}
- QVERIFY(visibleCount == 4);
+ QVERIFY(visibleCount == 5);
// invalid amount of actions -> invalid items gets removed
HbAction *nullAction = 0;
@@ -842,7 +853,7 @@
}
++iter;
}
- QVERIFY(visibleCount == 4);
+ QVERIFY(visibleCount == 5);
// service does exists
// object needs to be resetted for the service use
@@ -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);
@@ -1006,7 +1017,7 @@
mTestWidget->initialize(*model);
// Good case
- VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
+ VideoSortFilterProxyModelData::mLastItemNameInRename = "";
HbInputDialog::mValueReturnValue = "renamedVideo";
HbInputDialog::mValueCallCount = 0;
HbInputDialog::mOpenCallCount = 0;
@@ -1017,21 +1028,21 @@
mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex());
emit testSignal();
dialog->emitDialogFinished(mTestWidget, SLOT(renameDialogFinished(HbAction *)), 0);
- QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "renamedVideo");
+
QCOMPARE(HbInputDialog::mOpenCallCount, 1);
QVERIFY(HbInputDialog::mValueCallCount == 1);
-
- // New name is same as previous
- HbInputDialog::mValueReturnValue = "";
+
+ // New name is same as previous
+ HbInputDialog::mValueReturnValue = "albumName";
HbInputDialog::mValueCallCount = 0;
HbInputDialog::mOpenCallCount = 0;
- VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
+ VideoSortFilterProxyModelData::mLastItemNameInRename = "";
data = QString("albumName");
VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data);
mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex());
emit testSignal();
dialog->emitDialogFinished(mTestWidget, SLOT(renameDialogFinished(HbAction *)), 0);
- QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "");
+ QVERIFY(VideoSortFilterProxyModelData::mLastItemNameInRename == "");
QCOMPARE(HbInputDialog::mOpenCallCount, 1);
QVERIFY(HbInputDialog::mValueCallCount == 1);
@@ -1039,18 +1050,18 @@
HbInputDialog::mValueReturnValue = "";
HbInputDialog::mValueCallCount = 0;
HbInputDialog::mOpenCallCount = 0;
- VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
+ VideoSortFilterProxyModelData::mLastItemNameInRename = "";
data = QString("albumName");
VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data);
mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex());
emit testSignal();
dialog->emitDialogFinished(mTestWidget, SLOT(renameDialogFinished(HbAction *)), 1);
- QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "");
+ QVERIFY(VideoSortFilterProxyModelData::mLastItemNameInRename == "");
QCOMPARE(HbInputDialog::mOpenCallCount, 1);
- QVERIFY(HbInputDialog::mValueCallCount == 1);
+ QVERIFY(HbInputDialog::mValueCallCount == 0);
// New name is empty.
- VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
+ VideoSortFilterProxyModelData::mLastItemNameInRename = "";
HbInputDialog::mValueReturnValue = "";
HbInputDialog::mValueCallCount = 0;
HbInputDialog::mOpenCallCount = 0;
@@ -1059,28 +1070,29 @@
mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex());
emit testSignal();
dialog->emitDialogFinished(mTestWidget, SLOT(renameDialogFinished(HbAction *)), 0);
- QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "");
+ QVERIFY(VideoSortFilterProxyModelData::mLastItemNameInRename == "");
QCOMPARE(HbInputDialog::mOpenCallCount, 1);
QVERIFY(HbInputDialog::mValueCallCount == 1);
// Item is video
VideoSortFilterProxyModelData::mItemIds.clear();
VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(0, KVcxMvcMediaTypeVideo));
- VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
- HbInputDialog::mValueReturnValue = "";
+ VideoSortFilterProxyModelData::mLastItemNameInRename = "";
+ HbInputDialog::mValueReturnValue = "renamedVideo";
HbInputDialog::mValueCallCount = 0;
HbInputDialog::mOpenCallCount = 0;
- data = QString("albumName");
+ data = QString("oldVideoNama");
VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data);
mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex());
emit testSignal();
- QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "");
- QCOMPARE(HbInputDialog::mOpenCallCount, 0);
- QVERIFY(HbInputDialog::mValueCallCount == 0);
+ dialog->emitDialogFinished(mTestWidget, SLOT(renameDialogFinished(HbAction *)), 0);
+ QCOMPARE(HbInputDialog::mOpenCallCount, 1);
+ QVERIFY(HbInputDialog::mValueCallCount == 1);
+ QVERIFY(VideoSortFilterProxyModelData::mLastItemNameInRename == "renamedVideo");
// No model
- VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
- HbInputDialog::mValueReturnValue = "renamedVideo";
+ VideoSortFilterProxyModelData::mLastItemNameInRename = "";
+ HbInputDialog::mValueReturnValue = "";
HbInputDialog::mValueCallCount = 0;
HbInputDialog::mOpenCallCount = 0;
VideoSortFilterProxyModelData::mItemIds.clear();
@@ -1092,11 +1104,11 @@
mTestWidget->mModel = 0;
emit testSignal();
mTestWidget->mModel = tmp;
- QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "");
+ QVERIFY(VideoSortFilterProxyModelData::mLastItemNameInRename == "");
QCOMPARE(HbInputDialog::mOpenCallCount, 0);
// Variant data is invalid
- VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
+ VideoSortFilterProxyModelData::mLastItemNameInRename = "";
HbInputDialog::mValueReturnValue = "renamedVideo";
HbInputDialog::mValueCallCount = 0;
HbInputDialog::mOpenCallCount = 0;
@@ -1106,7 +1118,7 @@
VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data);
mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex());
emit testSignal();
- QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "");
+ QVERIFY(VideoSortFilterProxyModelData::mLastItemNameInRename == "");
QCOMPARE(HbInputDialog::mOpenCallCount, 0);
disconnect(this, SIGNAL(testSignal()), mTestWidget, SLOT(renameSlot()));
@@ -1314,7 +1326,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 +1336,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());
@@ -1406,7 +1418,7 @@
}
// ---------------------------------------------------------------------------
-// testScrollingEndedSlot
+// testScrollingStartedSlot
// ---------------------------------------------------------------------------
//
void TestListWidget::testScrollingStartedSlot()
@@ -1415,7 +1427,6 @@
emit testSignal();
-
disconnect(this, SIGNAL(testSignal()), mTestWidget, SLOT(scrollingStartedSlot()));
}
@@ -1425,6 +1436,7 @@
//
void TestListWidget::testScrollingEndedSlot()
{
+ VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled = true;
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
@@ -1434,7 +1446,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 +1463,7 @@
// Test
emit testSignal();
- QVERIFY(VideoThumbnailTestData::mStartBackgroundFetchingCallCount == 1);
+ QVERIFY(VideoThumbnailTestData::mStartBackgroundFetchingCallCount == 2);
QVERIFY(!mTestWidget->mScrollPositionTimer->isActive());
// Test again when timer is null.
@@ -1499,9 +1512,70 @@
void TestListWidget::testScrollPositionTimerSlot()
{
connect(this, SIGNAL(testSignal()), mTestWidget, SLOT(scrollPositionTimerSlot()));
+
+ VideoThumbnailTestData::mStartBackgroundFetchingCallCount = 0;
+ VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled = true;
emit testSignal();
+ QCOMPARE(VideoThumbnailTestData::mStartBackgroundFetchingCallCount, 1);
+
+ VideoThumbnailTestData::mStartBackgroundFetchingCallCount = 0;
+ VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled = false;
+ emit testSignal();
+ QCOMPARE(VideoThumbnailTestData::mStartBackgroundFetchingCallCount, 0);
+
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
+ VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled = true;
+ 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
+ VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled = true;
+ 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testvideocollectionuiloader/src/testvideocollectionuiloader.cpp Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testvideocollectionviewutils/inc/testvideocollectionviewutils.h Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testvideocollectionviewutils/src/testvideocollectionviewutils.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -15,7 +15,9 @@
*
*/
+#include <qdebug.h>
#include <qapplication.h>
+#include "xqsettingsmanagerstub.h"
#include <vcxmyvideosdefs.h>
#include "centralrepository.h"
#include "testvideocollectionviewutils.h"
@@ -31,6 +33,7 @@
#include "hblistview.h"
#include <hbactivitymanager.h>
#include <hbapplication.h>
+#include <xqsettingsmanagerstub.h>
#define private public
#include "videocollectionviewutils.h"
@@ -375,7 +378,9 @@
// -----------------------------------------------------------------------------
//
void TestVideoVideoCollectionViewUtils::testLoadSortingValues()
-{
+{
+ CRepository::setSetFail(255);
+
CRepository::mSortValues[KVideoSortingRoleKey] = VideoCollectionCommon::KeyDateTime;
CRepository::mSortValues[KVideoSortingOrderKey] = Qt::DescendingOrder;
CRepository::mSortValues[KCollectionsSortingRoleKey] = VideoCollectionCommon::KeyTitle;
@@ -518,60 +523,37 @@
}
// -----------------------------------------------------------------------------
-// testGetServiceIconStrings
+// testGetCenRepStringValue
// -----------------------------------------------------------------------------
//
-void TestVideoVideoCollectionViewUtils::testGetServiceIconStrings()
-{
+void TestVideoVideoCollectionViewUtils::testGetCenRepStringValue()
+{
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());
+
+ // Invalid
+ XQSettingsManager::mReadItemValueReturnValue = QVariant();
+ QVERIFY(testObject.getCenRepStringValue(0) == "");
- 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);
+ // Ok
+ XQSettingsManager::mReadItemValueReturnValue = QVariant("test");
+ QVERIFY(testObject.getCenRepStringValue(0) == "test");
}
// -----------------------------------------------------------------------------
-// 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()
+{
+ VideoCollectionViewUtils &testObject(VideoCollectionViewUtils::instance());
+
+ // Invalid
+ XQSettingsManager::mReadItemValueReturnValue = QVariant();
+ QVERIFY(testObject.getCenRepIntValue(0) == -1);
- QVERIFY(testObject.getServiceUriString().isNull());
-
- CRepository::setNewLLeave(false);
- CRepository::setGetFail(0);
- QVERIFY(testObject.getServiceUriString().isNull());
-
- CRepository::setGetFail(255);
- QCOMPARE(testObject.getServiceUriString(), expected);
+ // Ok
+ XQSettingsManager::mReadItemValueReturnValue = QVariant(13);
+ QVERIFY(testObject.getCenRepIntValue(0) == 13);
}
// -----------------------------------------------------------------------------
@@ -641,6 +623,8 @@
//
void TestVideoVideoCollectionViewUtils::testSortModel()
{
+ CRepository::setGetFail(255);
+
VideoCollectionViewUtils &testObject(VideoCollectionViewUtils::instance());
testObject.mVideosSortRole = -1;
testObject.mVideosSortOrder = Qt::AscendingOrder;
@@ -797,6 +781,3 @@
}
// End of file
-
-
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/videocollectionview/tsrc/testvideooperatorservice/inc/testvideooperatorservice.h Wed Aug 18 09:50:14 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: tests for VideoOperatorService
+*
+*/
+
+#ifndef TESTVIDEOOPERATORSERVICE_H
+#define TESTVIDEOCOLLECTIONUILOADER_H
+
+// INCLUDES
+#include <qttest/qttest>
+
+// FORWARD DECLARATIONS
+class VideoOperatorService;
+
+class TestVideoOperatorService : public QObject
+{
+ Q_OBJECT
+
+public:
+ TestVideoOperatorService();
+ virtual ~TestVideoOperatorService();
+
+private slots: // test functions for the test framework
+ void init();
+
+ void cleanup();
+
+private slots:
+
+ void testLoad();
+ void testTitle();
+ void testIconResource();
+ void testLaunchService();
+
+signals:
+
+private:
+ /** class under test */
+ VideoOperatorService *mTestObject;
+
+
+};
+
+#endif//TESTVIDEOCOLLECTIONUILOADER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/videocollectionview/tsrc/testvideooperatorservice/src/testvideooperatorservice.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,167 @@
+/**
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: tests for VideoOperatorService
+*
+*/
+
+#include <hbapplication.h>
+#include <hbmainwindow.h>
+#include <hbinstance.h>
+#include <qdebug.h>
+
+#include "testvideooperatorservice.h"
+#include "videocollectionviewutilsdata.h"
+
+#define private public
+#include "videooperatorservice.h"
+#include "videooperatorservicedata.h"
+#undef private
+
+int main(int argc, char *argv[])
+{
+ HbApplication app(argc, argv);
+ HbMainWindow window;
+ TestVideoOperatorService tv;
+ int res;
+ if (argc > 1)
+ {
+ res = QTest::qExec(&tv, argc, argv);
+ }
+ else
+ {
+ char *pass[3];
+ pass[0] = argv[0];
+ pass[1] = "-o";
+ pass[2] = "c:\\data\\testvideooperatorservice.txt";
+ res = QTest::qExec(&tv, 3, pass);
+ }
+
+ return res;
+}
+
+TestVideoOperatorService::TestVideoOperatorService():
+ mTestObject(0)
+{
+
+}
+
+TestVideoOperatorService::~TestVideoOperatorService()
+{
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// init
+// ---------------------------------------------------------------------------
+//
+void TestVideoOperatorService::init()
+{
+ // create test object
+ if (!mTestObject)
+ {
+ mTestObject = new VideoOperatorService;
+ }
+}
+
+// ---------------------------------------------------------------------------
+// cleanup
+// ---------------------------------------------------------------------------
+//
+void TestVideoOperatorService::cleanup()
+{
+ // delete test object
+ delete mTestObject;
+ mTestObject = 0;
+}
+
+// TEST CASES START ----------------------------------------------------------
+
+// ---------------------------------------------------------------------------
+// testLoad
+// ---------------------------------------------------------------------------
+//
+void TestVideoOperatorService::testLoad()
+{
+ // Good case
+ VideoCollectionViewUtilsData::mCenRepStringValues.append("test title");
+ VideoCollectionViewUtilsData::mCenRepStringValues.append("test icon");
+ VideoCollectionViewUtilsData::mCenRepStringValues.append("test uri");
+ VideoCollectionViewUtilsData::mCenRepIntValues.append(5050);
+ QVERIFY(mTestObject->load(0, 0, 0, 0) == true);
+ QVERIFY(mTestObject->mTitle == "test title");
+ QVERIFY(mTestObject->mIconResource == "test icon");
+ QVERIFY(mTestObject->mServiceUri == "test uri");
+ QCOMPARE(mTestObject->mApplicationUid, 5050);
+
+ // Only icon is defined for service.
+ VideoCollectionViewUtilsData::mCenRepStringValues.append(CENREP_NO_STRING);
+ VideoCollectionViewUtilsData::mCenRepStringValues.append("test icon");
+ QVERIFY(mTestObject->load(0, 0, 0, 0) == false);
+ QVERIFY(mTestObject->mTitle == "");
+ QVERIFY(mTestObject->mIconResource == "test icon");
+ QVERIFY(mTestObject->mServiceUri == "");
+ QCOMPARE(mTestObject->mApplicationUid, -1);
+
+ // Only icon and uri are defined for service.
+ VideoCollectionViewUtilsData::mCenRepStringValues.append(CENREP_NO_STRING);
+ VideoCollectionViewUtilsData::mCenRepStringValues.append("test icon");
+ VideoCollectionViewUtilsData::mCenRepStringValues.append("test uri");
+ QVERIFY(mTestObject->load(0, 0, 0, 0) == true);
+ QVERIFY(mTestObject->mTitle == "");
+ QVERIFY(mTestObject->mIconResource == "test icon");
+ QVERIFY(mTestObject->mServiceUri == "test uri");
+ QCOMPARE(mTestObject->mApplicationUid, -1);
+
+ // Only icon and app uid are defined for service.
+ VideoCollectionViewUtilsData::mCenRepStringValues.append(CENREP_NO_STRING);
+ VideoCollectionViewUtilsData::mCenRepStringValues.append("test icon");
+ VideoCollectionViewUtilsData::mCenRepIntValues.append(5050);
+ QVERIFY(mTestObject->load(0, 0, 0, 0) == true);
+ QVERIFY(mTestObject->mTitle == "");
+ QVERIFY(mTestObject->mIconResource == "test icon");
+ QVERIFY(mTestObject->mServiceUri == "");
+ QCOMPARE(mTestObject->mApplicationUid, 5050);
+}
+
+// ---------------------------------------------------------------------------
+// testTitle
+// ---------------------------------------------------------------------------
+//
+void TestVideoOperatorService::testTitle()
+{
+ mTestObject->mTitle = "test title";
+ QVERIFY(mTestObject->title() == "test title");
+}
+
+// ---------------------------------------------------------------------------
+// testIconResource
+// ---------------------------------------------------------------------------
+//
+void TestVideoOperatorService::testIconResource()
+{
+ mTestObject->mIconResource = "test icon";
+ QVERIFY(mTestObject->iconResource() == "test icon");
+}
+
+// ---------------------------------------------------------------------------
+// test
+// ---------------------------------------------------------------------------
+//
+void TestVideoOperatorService::testLaunchService()
+{
+ mTestObject->mApplicationUid = 0;
+ mTestObject->launchService();
+}
+
+// end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/videocollectionview/tsrc/testvideooperatorservice/testvideooperatorservice.pro Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,60 @@
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+TEMPLATE = app
+
+TARGET =
+
+DEPENDPATH += . \
+ inc \
+ src \
+ ../../../tsrc/stubs
+
+INCLUDEPATH += . \
+ inc \
+ ../../../tsrc/stubs/inc \
+ \ # keep these at bottom so that stub headers are taken first
+ ../../../inc \
+ ../../../videocollectionview/inc \
+ ../../../videocollectionwrapper/inc \
+ ../../../../inc \
+ ../../../../videoplayerapp/inc \
+ ../../../../videoplayerapp/videoplayerengine/inc
+
+CONFIG += qtestlib \
+ hb
+
+LIBS += -lestor.dll \
+ -lfbscli.dll \
+ -lbitgdi.dll \
+ -lgdi.dll \
+ -lcentralrepository.dll \
+ -lxqservice.dll \
+ -lxqserviceutil.dll \
+ -lapparc \
+ -lapgrfx \
+ -lws32 \
+ -lcone
+
+HEADERS += inc/testvideooperatorservice.h \
+ ../../../videocollectionview/inc/videooperatorservice.h
+
+SOURCES += src/testvideooperatorservice.cpp \
+ \ # sources needed in test
+ ../../../videocollectionview/src/videooperatorservice.cpp
+
+TESTEDCLASS = videooperatorservice
+include(../../../tsrc/stubs/stubs.pro)
--- a/videocollection/videocollectionview/videocollectionview.pro Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionview/videocollectionview.pro Wed Aug 18 09:50:14 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,12 @@
src/videohintwidget.cpp \
src/videocollectionviewutils.cpp \
src/videocollectionuiloader.cpp \
- src/videolistselectiondialog.cpp
-
+ src/videolistselectiondialog.cpp \
+ src/videooperatorservice.cpp
+
+DOCML += data/collectionview.docml \
+ data/videolistselectiondialog.docml
+
RESOURCES += data/videocollectionview.qrc
LIBS += -lmpxviewframeworkqt.dll \
@@ -79,10 +82,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/videocollectionclient.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/inc/videocollectionclient.h Wed Aug 18 09:50:14 2010 +0300
@@ -140,7 +140,7 @@
* @param aMediaId id of the item
* @return KErrNone if ok
*/
- int openItem(TMPXItemId &mediaId);
+ int openItem(const TMPXItemId &mediaId);
/**
* calls collection to go back to collection level
@@ -157,7 +157,7 @@
*
* @return 0 media fetchingstarted ok
*/
- int fetchMpxMediaByMpxId(TMPXItemId &aMpxId);
+ int fetchMpxMediaByMpxId(const TMPXItemId &aMpxId);
/**
* Gets all details for the selected MPX Media object.
@@ -167,7 +167,7 @@
*
* @return 0 if detail fetching started ok
*/
- int getVideoDetails(TMPXItemId& aMediaId);
+ int getVideoDetails(const TMPXItemId& aMediaId);
/**
* Add a new album.
@@ -192,7 +192,7 @@
* @param mediaIds, Items which to add.
* @return 0 if no errors.
*/
- int addItemsInAlbum(TMPXItemId &albumId, const QList<TMPXItemId> &mediaIds);
+ int addItemsInAlbum(const TMPXItemId &albumId, const QList<TMPXItemId> &mediaIds);
/**
* Removes items from existing album.
@@ -201,16 +201,16 @@
* @param mediaIds, Items which to remove.
* @return 0 if no errors.
*/
- int removeItemsFromAlbum(TMPXItemId &albumId, const QList<TMPXItemId> &mediaIds);
+ int removeItemsFromAlbum(const TMPXItemId &albumId, const QList<TMPXItemId> &mediaIds);
/**
- * Renames an album.
+ * Renames a video or user defined collection item.
*
- * @param albumId, Album to be renamed.
+ * @param itemId, id of item to be renamed.
* @param newTitle, New title for the album.
* @return 0 if no errors.
*/
- int renameAlbum(const TMPXItemId &albumId, const QString &newTitle);
+ int renameItem(const TMPXItemId &itemId, const QString &newTitle);
private:
@@ -232,14 +232,14 @@
*
* @param videoId id of the video to open
*/
- void openVideoL(TMPXItemId &videoId);
+ void openVideoL(const TMPXItemId &videoId);
/**
* Private implementation to handle leaving code of collection opening.
*
* @param id id of the collection to open
*/
- void openCategoryL(TMPXItemId &id);
+ void openCategoryL(const TMPXItemId &id);
/**
* Private implementation to handle leaving code of collection back stepping.
@@ -253,7 +253,7 @@
*
* @param videoId id of the video to get details from
*/
- void getVideoDetailsL(TMPXItemId &videoId);
+ void getVideoDetailsL(const TMPXItemId &videoId);
/**
* Removes user created albums.
@@ -268,7 +268,7 @@
*
* @param mpxId mpxif for the video object to fetch from collection
*/
- void fetchMpxMediaByMpxIdL(TMPXItemId &mpxId);
+ void fetchMpxMediaByMpxIdL(const TMPXItemId &mpxId);
/**
* Create a new album.
@@ -285,7 +285,7 @@
* @param mediaIds, Items to add in the album.
* @return None.
*/
- void addItemsInAlbumL(TMPXItemId &albumId, const QList<TMPXItemId> &mediaIds);
+ void addItemsInAlbumL(const TMPXItemId &albumId, const QList<TMPXItemId> &mediaIds);
/**
* Removes items from an album.
@@ -294,16 +294,16 @@
* @param mediaIds, Items to remove from album.
* @return None.
*/
- void removeItemsFromAlbumL(TMPXItemId &albumId, const QList<TMPXItemId> &mediaIds);
+ void removeItemsFromAlbumL(const TMPXItemId &albumId, const QList<TMPXItemId> &mediaIds);
/**
- * Renames an album.
+ * Renames a media item.
*
- * @param albumId, Album to be renamed.
+ * @param itemId, Album to be renamed.
* @param newTitle, New title for the album.
* @return None.
*/
- void renameAlbumL(const TMPXItemId &albumId, const QString newTitle);
+ void renameL(const TMPXItemId &itemId, const QString newTitle);
private:
--- a/videocollection/videocollectionwrapper/inc/videodatacontainer.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/inc/videodatacontainer.h Wed Aug 18 09:50:14 2010 +0300
@@ -72,7 +72,7 @@
* object is not found from wanted index
*
*/
- CMPXMedia* fromIndex(int index) const;
+ CMPXMedia* fromIndex(const int &index) const;
/**
* Returns an index of id.
@@ -81,7 +81,7 @@
*
* @return int index of item or -1 if item with provided id is not found
*/
- int indexOfId(const TMPXItemId &id) const;
+ const int& indexOfId(const TMPXItemId &id) const;
/**
* Returns id of item from provided index
@@ -90,7 +90,7 @@
*
* @return id of item or invalid TMPXItemId if item is not found from provided index
*/
- TMPXItemId idFromIndex(int index) const;
+ const TMPXItemId& idFromIndex(const int &index) const;
/**
* returns count of items
@@ -111,7 +111,7 @@
* @param inteIndex index of item
* @return TMPXItemId id of the item marked as removed
*/
- TMPXItemId markItemRemoved(const int &itemIndex);
+ const TMPXItemId markItemRemoved(const int &itemIndex);
/**
* Method removes provided items from mRemovedMedia
@@ -136,7 +136,7 @@
*
* @param itemId id of item to be returned
*/
- CMPXMedia* getRemovedMedia(TMPXItemId itemId);
+ CMPXMedia* getRemovedMedia(TMPXItemId &itemId);
private:
@@ -148,7 +148,7 @@
*
* @param fromindex - index from where to start decreasing
*/
- void decIndexesAfter(int fromIndex);
+ void decIndexesAfter(const int &fromIndex);
private: // data
--- a/videocollection/videocollectionwrapper/inc/videodatasignalreceiver.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/inc/videodatasignalreceiver.h Wed Aug 18 09:50:14 2010 +0300
@@ -73,7 +73,7 @@
*
* @param itemId item id
*/
- virtual void itemDeletedSlot( TMPXItemId itemId ) = 0;
+ virtual void itemDeletedSlot( TMPXItemId &itemId ) = 0;
/**
* Signaled when multiple video deletion command is completed.
@@ -103,7 +103,7 @@
* @param albumId, Album which items are received.
* @param albumItems, Items belonging to the current album.
*/
- virtual void albumListAvailableSlot(TMPXItemId albumId,
+ virtual void albumListAvailableSlot(TMPXItemId &albumId,
CMPXMediaArray *albumItems) = 0;
/**
@@ -114,9 +114,14 @@
virtual void itemModifiedSlot(const TMPXItemId &itemId) = 0;
/**
- * Signalled when list is complete.
+ * Signalled when video list is complete.
*/
- virtual void listCompleteSlot() = 0;
+ virtual void videoListCompleteSlot() = 0;
+
+ /**
+ * Signalled when album list is complete.
+ */
+ virtual void albumListCompleteSlot() = 0;
};
#endif // __VIDEOMODELOBSERVER_H
--- a/videocollection/videocollectionwrapper/inc/videodeleteworker.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/inc/videodeleteworker.h Wed Aug 18 09:50:14 2010 +0300
@@ -134,9 +134,9 @@
/**
* Emitted if some delete startup fails.
*
- * @param list of item ids whose edletion does not start
+ * @param list of item ids whose deletion does not start
*/
- void deleteStartupFailed(QList<TMPXItemId>);
+ void deleteStartupFailed(QList<TMPXItemId>&);
private:
--- a/videocollection/videocollectionwrapper/inc/videolistdatamodel.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/inc/videolistdatamodel.h Wed Aug 18 09:50:14 2010 +0300
@@ -86,7 +86,7 @@
* @param index index of the item to be opened
* @return TMPXItemId item id or TMPXItemId::Invalid() if no valid item.
*/
- TMPXItemId mediaIdAtIndex(int index) const;
+ const TMPXItemId& mediaIdAtIndex(const int &index) const;
/**
* returns model index of id provided
@@ -94,7 +94,7 @@
* @param id of the item
* @return modelIndex
*/
- QModelIndex indexOfId(TMPXItemId id);
+ QModelIndex indexOfId(const TMPXItemId &id);
/**
* Method calls video list data to check if there are valid media object
@@ -103,7 +103,7 @@
* @param mediaId id of the item to be opened
* @return QString file path of the media at index, empty string if not valid item.
*/
- QString mediaFilePathForId(TMPXItemId mediaId) const;
+ QString mediaFilePathForId(const TMPXItemId &mediaId) const;
/**
* Called by the client when removal of videos are requested.
@@ -131,14 +131,14 @@
* @param albumId, Album to set in use.
* @return None.
*/
- void setAlbumInUse(TMPXItemId albumId);
+ void setAlbumInUse(const TMPXItemId &albumId);
/**
* returns album id currently in use
*
* @return TMPXItemId
*/
- TMPXItemId albumInUse();
+ const TMPXItemId& albumInUse() const;
/**
* removes provided items from provided album id and calls
@@ -149,7 +149,7 @@
*
* @return count of items removed or -1 if failed
*/
- int removeItemsFromAlbum(TMPXItemId &albumId, const QList<TMPXItemId> &items);
+ int removeItemsFromAlbum(const TMPXItemId &albumId, const QList<TMPXItemId> &items);
public: // from QAbstractItemModel
@@ -214,12 +214,17 @@
* @param id of the video item
*/
void shortDetailsReady(TMPXItemId id);
-
+
/**
* Signals that the model is ready, ie. loaded all data from
* myvideocollection.
*/
void modelReady();
+
+ /**
+ * Signals that all albums have been loaded from myvideoscollection.
+ */
+ void albumListReady();
/**
* Signal to be emitted when something has happened in the
@@ -231,11 +236,6 @@
* Signals that album content has been updated.
*/
void albumChanged();
-
- /**
- * Signals that item data has changed.
- */
- void itemModified(const TMPXItemId &itemId);
private slots:
@@ -244,14 +244,14 @@
*
* @param ids list of ids whose deletion fails
*/
- void deleteStartingFailsSlot(QList<TMPXItemId> ids);
+ void deleteStartingFailsSlot(QList<TMPXItemId>& ids);
private:
/**
- * Method connects signals emitted from or throught this object
+ * Method connects signals used for delete worker
*/
- int connectSignals();
+ void connectSignals();
/**
* method disconnects signals
@@ -269,7 +269,7 @@
*
* @return QString detail string
*/
- QString prepareDetailRow(int index) const;
+ QString prepareDetailRow(int &index) const;
/**
* Formats a detail row string for the video item
@@ -283,7 +283,7 @@
*
* @return QString detail string
*/
- QString doDetailRow(int index) const;
+ QString doDetailRow(int &index) const;
/**
* Generates a video count string for category or album at given index.
@@ -296,7 +296,7 @@
*
* @return QString video count string
*/
- QString prepareVideoCountString(int index) const;
+ QString prepareVideoCountString(int &index) const;
/**
* Generates a video size string from video item at given index
@@ -308,7 +308,7 @@
*
* @return QString size string
*/
- QString prepareSizeString(int index) const;
+ QString prepareSizeString(int &index) const;
/**
* Called when there are status changes in some async operation
--- a/videocollection/videocollectionwrapper/inc/videolistdatamodel_p.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/inc/videolistdatamodel_p.h Wed Aug 18 09:50:14 2010 +0300
@@ -76,24 +76,6 @@
*/
int initialize();
-signals:
-
- /**
- * This signal is emitted, when data to some video item changes.
- * Like for example new thumbnail is fetched.
- *
- * @param startIndex
- * @param endIndex
- *
- */
- void dataChanged(const QModelIndex &startIndex, const QModelIndex &endIndex);
-
- /**
- * This signal is emitted, collection notifies details for item has been
- * fetched and provides a QMap of the details'.
- */
- void videoDetailsReady(QVariant &);
-
private slots:
/**
@@ -105,7 +87,7 @@
* @param mediaIds: media ids of the items
*
*/
- void thumbnailsFetchedSlot(QList<TMPXItemId> mediaIds);
+ void thumbnailsFetchedSlot(QList<TMPXItemId> &mediaIds);
private slots: //slots from VideoDataSignalReceiver
@@ -143,7 +125,7 @@
*
* @param itemId id of the removed item
*/
- void itemDeletedSlot(TMPXItemId itemId);
+ void itemDeletedSlot(TMPXItemId &itemId);
/**
* Signaled by the collection client video deletion request
@@ -175,7 +157,7 @@
* @param albumId, Album which items are received.
* @param albumItems, Items belonging to the current album.
*/
- void albumListAvailableSlot(TMPXItemId albumId, CMPXMediaArray *albumItems);
+ void albumListAvailableSlot(TMPXItemId &albumId, CMPXMediaArray *albumItems);
/**
* Signalled when item has been mofidied.
@@ -185,9 +167,14 @@
void itemModifiedSlot(const TMPXItemId &itemId);
/**
- * Signalled when list is complete.
+ * Signalled when video list is complete.
*/
- void listCompleteSlot();
+ void videoListCompleteSlot();
+
+ /**
+ * Signalled when album list is complete.
+ */
+ void albumListCompleteSlot();
public: // services
@@ -206,7 +193,7 @@
*
* @return TMPXItemId item id or invalid TMPXItemId if id not found at that index
*/
- TMPXItemId getMediaIdFromIndex(int index) const;
+ const TMPXItemId& getMediaIdFromIndex(const int &index) const;
/**
* Returns name of the video from the given index.
@@ -216,7 +203,7 @@
*
* @return QString name of the item
*/
- const QString getVideoNameFromIndex(int index) const;
+ const QString getVideoNameFromIndex(const int &index) const;
/**
* Returns the thumbnail of the item from given index.
@@ -227,7 +214,7 @@
*
* @return QIcon thumbnail of the item
*/
- const QIcon* getVideoThumbnailFromIndex(int index) const;
+ const QIcon* getVideoThumbnailFromIndex(const int &index) const;
/**
* Returns the value for item count attribute from given index.
@@ -237,7 +224,7 @@
*
* @return guint32 size in bytes
*/
- quint32 getCategoryVideoCountFromIndex( int index ) const;
+ quint32 getCategoryVideoCountFromIndex(const int &index ) const;
/**
* Returns the size of the video from given index.
@@ -247,7 +234,7 @@
*
* @return guint32 size in bytes
*/
- quint32 getVideoSizeFromIndex(int index) const;
+ quint32 getVideoSizeFromIndex(const int &index) const;
/**
* Returns the age profile of the video from given index
@@ -257,7 +244,7 @@
*
* @return quint32 age profile in bytes
*/
- quint32 getVideoAgeProfileFromIndex(int index) const;
+ quint32 getVideoAgeProfileFromIndex(const int &index) const;
/**
* Returns the duration of the video from given index.
@@ -267,7 +254,7 @@
*
* @return guint32 duration
*/
- quint32 getVideodurationFromIndex(int index) const;
+ quint32 getVideodurationFromIndex(const int &index) const;
/**
* Returns the duration of the video from given media.
@@ -285,7 +272,7 @@
*
* @return QDate date
*/
- QDateTime getVideoDateFromIndex(int index) const;
+ QDateTime getVideoDateFromIndex(const int &index) const;
/**
* Returns the creation/download date of the video
@@ -302,7 +289,7 @@
* @return TMPXItemId: id of the item marked
*
*/
- TMPXItemId markVideoRemoved(const QModelIndex &itemIndex);
+ const TMPXItemId markVideoRemoved(const QModelIndex &itemIndex);
/**
* Removes provided ids from the remove -list
@@ -317,14 +304,14 @@
*
* @param index: item position where client wants the file path from.
*/
- const QString getFilePathFromIndex(int index) const;
+ const QString getFilePathFromIndex(const int &index) const;
/**
* Returns the file path of the video.
*
* @param mediaId: id for the item
*/
- const QString getFilePathForId(TMPXItemId mediaId) const;
+ const QString getFilePathForId(const TMPXItemId &mediaId);
/**
* Checks if the specified item belongs to currently open album.
@@ -341,7 +328,7 @@
* @param albumId, Album to set in use.
* @return None.
*/
- void setAlbumInUse(TMPXItemId albumId);
+ void setAlbumInUse(const TMPXItemId &albumId);
/**
* removes provided items from album provided
@@ -351,7 +338,7 @@
*
* @return count of item removed;
*/
- int removeItemsFromAlbum(TMPXItemId &albumId, const QList<TMPXItemId> &items);
+ int removeItemsFromAlbum(const TMPXItemId &albumId, const QList<TMPXItemId> &items);
private: // private methods
@@ -403,21 +390,21 @@
* @param albumId id of album
* @param videoarray array of videos in album
*/
- void albumDataChangedL(TMPXItemId albumId, CMPXMediaArray *videoArray);
+ void albumDataChangedL(TMPXItemId &albumId, CMPXMediaArray *videoArray);
/**
* Called when an album has been removed.
*
* @param albumId, Album which items are received.
*/
- void albumRemoved(TMPXItemId albumId);
+ void albumRemoved(TMPXItemId &albumId);
/**
* Called when a video has been removed.
*
* @param videoId id of the removed video
*/
- void videoDeleted(TMPXItemId videoId);
+ void videoDeleted(TMPXItemId &videoId);
private:
--- a/videocollection/videocollectionwrapper/inc/videosortfilterproxymodel.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/inc/videosortfilterproxymodel.h Wed Aug 18 09:50:14 2010 +0300
@@ -132,7 +132,7 @@
* @return TMPXItemId mpx id if succeeds TMPXItemId::InvalidId() in case of error
*
*/
- TMPXItemId getMediaIdAtIndex(const QModelIndex &index) const;
+ const TMPXItemId& getMediaIdAtIndex(const QModelIndex &index) const;
/**
* returns qmodelindex of item id provided.
@@ -140,7 +140,7 @@
* @param item id
* @return QModelIndex;
*/
- QModelIndex indexOfId(TMPXItemId id);
+ QModelIndex indexOfId(const TMPXItemId &id);
/**
* Method checks that model exists and asks for file path from
@@ -150,7 +150,7 @@
* @return QString file path if succeeds, empty string in case of error.
*
*/
- QString getMediaFilePathForId(TMPXItemId mediaId);
+ QString getMediaFilePathForId(const TMPXItemId &mediaId);
/**
* Add a new album.
@@ -188,13 +188,13 @@
int removeItemsFromAlbum(TMPXItemId &albumId, const QList<TMPXItemId> &mediaIds);
/**
- * Renames an album.
+ * Renames a video or user defined colletion.
*
- * @param itemId, Album to be renamed.
- * @param newTitle, New title for the album.
+ * @param itemId, id of item to be renamed.
+ * @param newTitle, New title for the item.
* @return 0 if no errors.
*/
- int renameAlbum(const TMPXItemId &albumId, const QString &newTitle);
+ int renameItem(const TMPXItemId &itemId, const QString &newTitle);
/**
* Resolves duplicate album names and returns the resolved name.
@@ -217,14 +217,14 @@
* @param filterValue item id used as filter
* @param filterValue
*/
- void setGenericIdFilter(TMPXItemId itemId, bool filterValue);
+ void setGenericIdFilter(const TMPXItemId &itemId, bool filterValue);
/**
* Set album in use and invalidates filtering.
*
* @param albumId album id
*/
- void setAlbumInUse(TMPXItemId albumId);
+ void setAlbumInUse(const TMPXItemId &albumId);
/**
* Gets the currently opened item.
@@ -297,12 +297,6 @@
* refiltering is required
*/
void albumChangedSlot();
-
- /**
- * signaled when data for item has changed and
- * invalidate is required.
- */
- void itemModifiedSlot(const TMPXItemId &itemId);
private:
--- a/videocollection/videocollectionwrapper/inc/videothumbnaildata.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/inc/videothumbnaildata.h Wed Aug 18 09:50:14 2010 +0300
@@ -71,7 +71,7 @@
* @return bool: true if item removed correctly, false if not.
*
*/
- bool removeThumbnail(TMPXItemId mediaId);
+ bool removeThumbnail(const TMPXItemId &mediaId);
/**
* Method returns a pointer to video's thumbnail.
@@ -85,7 +85,7 @@
* @return QIcon* thumbnail pointer
*
*/
- const QIcon* getThumbnail(TMPXItemId mediaId);
+ const QIcon* getThumbnail(const TMPXItemId &mediaId);
/**
* Starts background thumbnail fetching, the model used for the background fetching
@@ -113,6 +113,13 @@
void enableThumbnailCreation(bool enable);
/**
+ * Returns background fetching enabled status.
+ *
+ * @return bool: true if background fetching is enabled, otherwise false.
+ */
+ bool backgroundFetchingEnabled();
+
+ /**
* Frees allocated data for thumbnails and cancels ongoing fetches.
*
*/
@@ -126,7 +133,7 @@
* @param mediaIds: media ids of the videos whose thumbnail is ready.
*
*/
- void thumbnailsFetched(QList<TMPXItemId> mediaIds);
+ void thumbnailsFetched(QList<TMPXItemId>& mediaIds);
private:
--- a/videocollection/videocollectionwrapper/inc/videothumbnaildata_p.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/inc/videothumbnaildata_p.h Wed Aug 18 09:50:14 2010 +0300
@@ -68,7 +68,7 @@
* @return QIcon* thumbnail pointer
*
*/
- const QIcon* getThumbnail(TMPXItemId mediaId);
+ const QIcon* getThumbnail(const TMPXItemId &mediaId);
/**
* Method removes thumbnail data from the icon cache.
@@ -78,7 +78,7 @@
* @return bool: true if item removed correctly, false if not.
*
*/
- bool removeThumbnail(TMPXItemId mediaId);
+ bool removeThumbnail(const TMPXItemId &mediaId);
/**
* Starts background thumbnail fetching from the given fetch index.
@@ -104,6 +104,13 @@
void enableThumbnailCreation(bool enable);
/**
+ * Returns if background fetching is enabled.
+ *
+ * @return bool: true if background fetching is enabled, otherwise false.
+ */
+ bool backgroundFetchingEnabled();
+
+ /**
* Frees allocated data for thumbnails and cancels ongoing fetches.
*/
void freeThumbnailData();
@@ -159,7 +166,7 @@
* @return int: thumbnail id or -1 if fetch starting fails.
*
*/
- int startFetchingThumbnail(TMPXItemId mediaId, int priority);
+ int startFetchingThumbnail(const TMPXItemId &mediaId, int priority);
/**
* Appends indexes in the source model to the list between start and end.
@@ -168,7 +175,7 @@
* @param startIndex start index
* @param endIndex end index
*/
- void getModelIndexes(QList<QModelIndex> &indexes, int startIndex, int endIndex);
+ void getModelIndexes(QList<QModelIndex> &indexes, int &startIndex, int &endIndex);
/**
* Method returns default thumbnail data.
@@ -178,7 +185,7 @@
* @return QIcon: reference to default thumbnail data
*
*/
- const QIcon* defaultThumbnail(TMPXItemId mediaId);
+ const QIcon* defaultThumbnail(const TMPXItemId &mediaId);
/**
* Loads icon from file or resource, the icon is scaled to size of the
@@ -204,7 +211,7 @@
* @param mediaIds: media ids of the videos whose thumbnail is ready.
*
*/
- void thumbnailsFetched(QList<TMPXItemId> mediaIds);
+ void thumbnailsFetched(QList<TMPXItemId>& mediaIds);
private slots:
@@ -220,12 +227,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/videocollectionclient.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/src/videocollectionclient.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 39 %
+// Version : %version: 41 %
// INCLUDE FILES
#include <qobject.h>
@@ -208,7 +208,7 @@
// openItem
// -----------------------------------------------------------------------------
//
-int VideoCollectionClient::openItem(TMPXItemId &mediaId)
+int VideoCollectionClient::openItem(const TMPXItemId &mediaId)
{
FUNC_LOG;
if(!mCollectionUtility)
@@ -247,7 +247,7 @@
// fetchMpxMediaByMpxId
// -----------------------------------------------------------------------------
//
-int VideoCollectionClient::fetchMpxMediaByMpxId(TMPXItemId &mpxId)
+int VideoCollectionClient::fetchMpxMediaByMpxId(const TMPXItemId &mpxId)
{
FUNC_LOG;
if(!mCollectionUtility)
@@ -263,7 +263,7 @@
// getVideoDetails
// -----------------------------------------------------------------------------
//
-int VideoCollectionClient::getVideoDetails(TMPXItemId &mediaId)
+int VideoCollectionClient::getVideoDetails(const TMPXItemId &mediaId)
{
FUNC_LOG;
if(!mCollectionUtility)
@@ -319,7 +319,7 @@
// addItemsInAlbum
// -----------------------------------------------------------------------------
//
-int VideoCollectionClient::addItemsInAlbum(TMPXItemId &albumId,
+int VideoCollectionClient::addItemsInAlbum(const TMPXItemId &albumId,
const QList<TMPXItemId> &mediaIds)
{
FUNC_LOG;
@@ -338,7 +338,7 @@
// removeItemsFromAlbum
// -----------------------------------------------------------------------------
//
-int VideoCollectionClient::removeItemsFromAlbum(TMPXItemId &albumId,
+int VideoCollectionClient::removeItemsFromAlbum(const TMPXItemId &albumId,
const QList<TMPXItemId> &mediaIds)
{
FUNC_LOG;
@@ -354,19 +354,20 @@
}
// -----------------------------------------------------------------------------
-// renameAlbum
+// renameItem
// -----------------------------------------------------------------------------
//
-int VideoCollectionClient::renameAlbum(const TMPXItemId &albumId,
+int VideoCollectionClient::renameItem(const TMPXItemId &itemId,
const QString &newTitle)
{
FUNC_LOG;
int err(-1);
- if(mCollectionUtility && albumId.iId2 == KVcxMvcMediaTypeAlbum &&
- !newTitle.isEmpty())
+ if(mCollectionUtility && !newTitle.isEmpty() &&
+ (itemId.iId2 == KVcxMvcMediaTypeAlbum ||
+ itemId.iId2 == KVcxMvcMediaTypeVideo ) )
{
- TRAP(err, renameAlbumL(albumId, newTitle));
+ TRAP(err, renameL(itemId, newTitle));
}
return err;
@@ -453,7 +454,7 @@
// openVideoL
// -----------------------------------------------------------------------------
//
-void VideoCollectionClient::openVideoL(TMPXItemId &videoId)
+void VideoCollectionClient::openVideoL(const TMPXItemId &videoId)
{
FUNC_LOG;
if(!mCollectionUtility)
@@ -475,7 +476,7 @@
// openCategoryL
// -----------------------------------------------------------------------------
//
-void VideoCollectionClient::openCategoryL(TMPXItemId &id)
+void VideoCollectionClient::openCategoryL(const TMPXItemId &id)
{
FUNC_LOG;
if(!mCollectionUtility)
@@ -522,7 +523,7 @@
// getVideoDetailsL
// -----------------------------------------------------------------------------
//
-void VideoCollectionClient::getVideoDetailsL(TMPXItemId &videoId)
+void VideoCollectionClient::getVideoDetailsL(const TMPXItemId &videoId)
{
FUNC_LOG;
if(!mCollectionUtility)
@@ -628,7 +629,7 @@
// addItemsInAlbumL
// -----------------------------------------------------------------------------
//
-void VideoCollectionClient::addItemsInAlbumL(TMPXItemId &albumId,
+void VideoCollectionClient::addItemsInAlbumL(const TMPXItemId &albumId,
const QList<TMPXItemId> &mediaIds)
{
FUNC_LOG;
@@ -674,7 +675,7 @@
// removeItemsFromAlbumL
// -----------------------------------------------------------------------------
//
-void VideoCollectionClient::removeItemsFromAlbumL(TMPXItemId &albumId,
+void VideoCollectionClient::removeItemsFromAlbumL(const TMPXItemId &albumId,
const QList<TMPXItemId> &mediaIds)
{
FUNC_LOG;
@@ -716,16 +717,16 @@
}
// -----------------------------------------------------------------------------
-// renameAlbumL
+// renameL
// -----------------------------------------------------------------------------
//
-void VideoCollectionClient::renameAlbumL(const TMPXItemId &albumId, const QString newTitle)
+void VideoCollectionClient::renameL(const TMPXItemId &itemId, const QString newTitle)
{
FUNC_LOG;
CMPXMedia *media = CMPXMedia::NewL();
CleanupStack::PushL(media);
TPtrC titlePtrC(newTitle.utf16());
- media->SetTObjectValueL<TMPXItemId>(KMPXMediaGeneralId, albumId);
+ media->SetTObjectValueL<TMPXItemId>(KMPXMediaGeneralId, itemId);
media->SetTextValueL(KMPXMediaGeneralTitle, titlePtrC);
CMPXCommand* cmd = CMPXMedia::NewL();
@@ -747,7 +748,7 @@
// fetchMpxMediaByMpxIdL
// -----------------------------------------------------------------------------
//
-void VideoCollectionClient::fetchMpxMediaByMpxIdL(TMPXItemId &aMpxId)
+void VideoCollectionClient::fetchMpxMediaByMpxIdL(const TMPXItemId &aMpxId)
{
FUNC_LOG;
if(!mCollectionUtility)
--- a/videocollection/videocollectionwrapper/src/videocollectionlistener.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/src/videocollectionlistener.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 33 %
+// Version : %version: 34 %
// INCLUDE FILES
#include <mpxmediageneraldefs.h>
@@ -131,11 +131,23 @@
}
int listCompleted(-1);
- if(mVideoUtils.mediaValue<int>(&aEntries, KVcxMediaMyVideosInt32Value, listCompleted))
+
+ if(path->Levels() == VideoCollectionCommon::PathLevelCategories)
+ {
+ bool listIsPartial(false);
+ if(mVideoUtils.mediaValue<bool>(&aEntries, KVcxMediaMyVideosVideoListIsPartial, listIsPartial))
+ {
+ if(!listIsPartial)
+ {
+ mSignalReceiver.albumListCompleteSlot();
+ }
+ }
+ }
+ else if(mVideoUtils.mediaValue<int>(&aEntries, KVcxMediaMyVideosInt32Value, listCompleted))
{
if(listCompleted == EVcxMyVideosVideoListComplete)
{
- mSignalReceiver.listCompleteSlot();
+ mSignalReceiver.videoListCompleteSlot();
}
}
}
--- a/videocollection/videocollectionwrapper/src/videodatacontainer.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/src/videodatacontainer.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -14,7 +14,7 @@
* Description: VideoDataContainer class declaration*
*/
-// Version : %version: 14 %
+// Version : %version: 15 %
// INCLUDE FILES
#include <mpxmediageneraldefs.h>
@@ -25,6 +25,10 @@
#include "videocollectionutils.h"
#include "videocollectiontrace.h"
+const int INVALID_INDEX = -1;
+const TMPXItemId INVALID_ID = TMPXItemId::InvalidId();
+
+
/**
* global qHash function required fo creating hash values for TMPXItemId -keys
*/
@@ -131,7 +135,7 @@
// fromIndex
// -----------------------------------------------------------------------------
//
-CMPXMedia* VideoDataContainer::fromIndex(int index) const
+CMPXMedia* VideoDataContainer::fromIndex(const int &index) const
{
if(index >= 0 && index < mMediaIds.count() && mMediaData.contains(mMediaIds[index]))
{
@@ -144,27 +148,27 @@
// indexOfId
// -----------------------------------------------------------------------------
//
-int VideoDataContainer::indexOfId(const TMPXItemId &id) const
+const int& VideoDataContainer::indexOfId(const TMPXItemId &id) const
{
QHash<TMPXItemId, QPair<int, CMPXMedia*> >::const_iterator iter = mMediaData.find(id);
if( iter != mMediaData.constEnd())
{
return iter->first;
}
- return -1;
+ return INVALID_INDEX;
}
// -----------------------------------------------------------------------------
// idFromIndex
// -----------------------------------------------------------------------------
//
-TMPXItemId VideoDataContainer::idFromIndex(int index) const
-{
+const TMPXItemId& VideoDataContainer::idFromIndex(const int &index) const
+{
if(index >= 0 && index < mMediaIds.count())
{
- return mMediaIds[index];
+ return mMediaIds.at(index);
}
- return TMPXItemId::InvalidId();
+ return INVALID_ID;
}
// -----------------------------------------------------------------------------
@@ -180,7 +184,7 @@
// decIndexesAfter
// -----------------------------------------------------------------------------
//
-void VideoDataContainer::decIndexesAfter(int fromIndex)
+void VideoDataContainer::decIndexesAfter(const int &fromIndex)
{
int count = mMediaIds.count();
QMultiHash<TMPXItemId, QPair<int, CMPXMedia*> >::iterator hashIter;
@@ -198,7 +202,7 @@
// markItemsRemoved
// -----------------------------------------------------------------------------
//
-TMPXItemId VideoDataContainer::markItemRemoved(const int &itemIndex)
+const TMPXItemId VideoDataContainer::markItemRemoved(const int &itemIndex)
{
// for all provided indexes:
// - get item address from mMediaData
@@ -207,9 +211,9 @@
// - remove item's id from mMediaIds -list
// - append item into mRemovedMedia
// - append item's id into returned id -list
- TMPXItemId id = TMPXItemId::InvalidId();
CMPXMedia *media = 0;
- id = idFromIndex(itemIndex);
+ // get copy of id of item to be removed
+ const TMPXItemId id = idFromIndex(itemIndex);
media = fromIndex(itemIndex);
if(id == TMPXItemId::InvalidId() || !media)
{
@@ -303,7 +307,7 @@
// getRemovedMedia
// -----------------------------------------------------------------------------
//
-CMPXMedia* VideoDataContainer::getRemovedMedia(TMPXItemId itemId)
+CMPXMedia* VideoDataContainer::getRemovedMedia(TMPXItemId &itemId)
{
QHash<TMPXItemId, CMPXMedia*>::const_iterator itemIter =
mRemovedMedia.constFind(itemId);
--- a/videocollection/videocollectionwrapper/src/videolistdatamodel.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/src/videolistdatamodel.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 52 %
+// Version : %version: 52.1.2 %
// INCLUDE FILES
#include <hbglobal.h>
@@ -99,13 +99,6 @@
return -1;
}
- if(connectSignals() == -1)
- {
- ERROR(-1, "VideoListDataModel::initialize() failed to connect signals.");
- disconnectSignals();
- return -1;
- }
-
mInitialized = true;
return 0;
}
@@ -124,34 +117,16 @@
// connectSignals()
// -----------------------------------------------------------------------------
//
-int VideoListDataModel::connectSignals()
+void VideoListDataModel::connectSignals()
{
FUNC_LOG;
- if(!connect(d_ptr, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)),
- this, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&))))
- {
- return -1;
- }
- if(!connect(d_ptr, SIGNAL(videoDetailsReady(QVariant&)),
- this, SIGNAL(fullVideoDetailsReady(QVariant&))))
- {
- return -1;
- }
- if(!connect(this, SIGNAL(modelChanged()), mDeleteWorker, SLOT(continueSlot())))
- {
- return -1;
- }
- if(!connect(this, SIGNAL(modelReady()), mDeleteWorker, SLOT(continueSlot())))
- {
- return -1;
- }
- if(!connect(mDeleteWorker, SIGNAL(deleteStartupFailed(QList<TMPXItemId>)),
- this, SLOT(deleteStartingFailsSlot(QList<TMPXItemId>))))
- {
- return -1;
- }
-
- return 0;
+
+ connect(this, SIGNAL(modelChanged()), mDeleteWorker, SLOT(continueSlot()), Qt::UniqueConnection);
+
+ connect(this, SIGNAL(modelReady()), mDeleteWorker, SLOT(continueSlot()), Qt::UniqueConnection);
+
+ connect(mDeleteWorker, SIGNAL(deleteStartupFailed(QList<TMPXItemId>&)),
+ this, SLOT(deleteStartingFailsSlot(QList<TMPXItemId>&)), Qt::UniqueConnection);
}
// -----------------------------------------------------------------------------
@@ -161,37 +136,26 @@
void VideoListDataModel::disconnectSignals()
{
FUNC_LOG;
- disconnect(d_ptr, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)),
- this, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)));
- disconnect(d_ptr, SIGNAL(videoDetailsReady(QVariant&)),
- this, SIGNAL(fullVideoDetailsReady(QVariant&)));
disconnect(this, SIGNAL(modelChanged()), mDeleteWorker, SLOT(continueSlot()));
disconnect(this, SIGNAL(modelReady()), mDeleteWorker, SLOT(continueSlot()));
- disconnect(mDeleteWorker, SIGNAL(deleteStartupFailed(QList<TMPXItemId>)),
- this, SLOT(deleteStartingFailsSlot(QList<TMPXItemId>)));
+ disconnect(mDeleteWorker, SIGNAL(deleteStartupFailed(QList<TMPXItemId>&)),
+ this, SLOT(deleteStartingFailsSlot(QList<TMPXItemId>&)));
}
// -----------------------------------------------------------------------------
// mediaIdAtIndex()
// -----------------------------------------------------------------------------
//
-TMPXItemId VideoListDataModel::mediaIdAtIndex(int index) const
+const TMPXItemId& VideoListDataModel::mediaIdAtIndex(const int &index) const
{
- TMPXItemId mpxId =TMPXItemId::InvalidId();
-
- if(index >= 0 && index < d_ptr->getVideoCount())
- {
- mpxId = d_ptr->getMediaIdFromIndex(index);
- }
-
- return mpxId;
+ return d_ptr->getMediaIdFromIndex(index);
}
// -----------------------------------------------------------------------------
// indexOfId()
// -----------------------------------------------------------------------------
//
-QModelIndex VideoListDataModel::indexOfId(TMPXItemId id)
+QModelIndex VideoListDataModel::indexOfId(const TMPXItemId &id)
{
int rowIndex = d_ptr->mMediaData.indexOfId(id);
return index(rowIndex, 0, QModelIndex());
@@ -201,12 +165,9 @@
// mediaFilePathForId()
// -----------------------------------------------------------------------------
//
-QString VideoListDataModel::mediaFilePathForId(TMPXItemId mediaId) const
+QString VideoListDataModel::mediaFilePathForId(const TMPXItemId &mediaId) const
{
- QString filePath;
- filePath = d_ptr->getFilePathForId(mediaId);
-
- return filePath;
+ return d_ptr->getFilePathForId(mediaId);;
}
// -----------------------------------------------------------------------------
@@ -248,7 +209,7 @@
// prepareDetailRow()
// -----------------------------------------------------------------------------
//
-QString VideoListDataModel::prepareDetailRow(int index) const
+QString VideoListDataModel::prepareDetailRow(int &index) const
{
// TODO: download -status?
@@ -271,7 +232,7 @@
// prepareVideoCountString()
// -----------------------------------------------------------------------------
//
-QString VideoListDataModel::prepareVideoCountString(int index) const
+QString VideoListDataModel::prepareVideoCountString(int &index) const
{
QString videoCountString("");
@@ -292,7 +253,7 @@
// prepareSizeString()
// -----------------------------------------------------------------------------
//
-QString VideoListDataModel::prepareSizeString(int index) const
+QString VideoListDataModel::prepareSizeString(int &index) const
{
QString sizeStr("");
@@ -306,7 +267,7 @@
// VideoListDataModel::doDetailRow()
// -----------------------------------------------------------------------------
//
-QString VideoListDataModel::doDetailRow(int index) const
+QString VideoListDataModel::doDetailRow(int &index) const
{
QString detailStr("");
@@ -512,7 +473,8 @@
}
emit modelChanged();
if(removedIds.count() > 0 )
- {
+ {
+ connectSignals();
mDeleteWorker->requestDelete(removedIds);
return true;
}
@@ -533,7 +495,7 @@
// setAlbumInUse()
// -----------------------------------------------------------------------------
//
-void VideoListDataModel::setAlbumInUse(TMPXItemId albumId)
+void VideoListDataModel::setAlbumInUse(const TMPXItemId &albumId)
{
FUNC_LOG;
d_ptr->setAlbumInUse(albumId);
@@ -543,7 +505,7 @@
// albumInUse()
// -----------------------------------------------------------------------------
//
-TMPXItemId VideoListDataModel::albumInUse()
+const TMPXItemId& VideoListDataModel::albumInUse() const
{
FUNC_LOG;
return d_ptr->mCurrentAlbum;
@@ -553,7 +515,7 @@
// removeItemsFromAlbum()
// -----------------------------------------------------------------------------
//
-int VideoListDataModel::removeItemsFromAlbum(TMPXItemId &albumId, const QList<TMPXItemId> &items)
+int VideoListDataModel::removeItemsFromAlbum(const TMPXItemId &albumId, const QList<TMPXItemId> &items)
{
FUNC_LOG;
int removeCount = d_ptr->removeItemsFromAlbum(albumId, items);
@@ -573,7 +535,7 @@
// deleteStartingFailsSlot()
// -----------------------------------------------------------------------------
//
-void VideoListDataModel::deleteStartingFailsSlot(QList<TMPXItemId> ids)
+void VideoListDataModel::deleteStartingFailsSlot(QList<TMPXItemId>& ids)
{
FUNC_LOG;
if(ids.count())
@@ -610,6 +572,7 @@
report = true;
// delete procedure ends, reset statuses
mDeleteWorker->clearStatus();
+ disconnectSignals();
}
}
if(report)
--- a/videocollection/videocollectionwrapper/src/videolistdatamodel_p.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/src/videolistdatamodel_p.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 38.1.1 %
+// Version : %version: 38.1.6 %
// INCLUDE FILES
#include <hbglobal.h>
@@ -26,6 +26,7 @@
#include <mpxmedia.h>
#include <qvariant.h>
#include <hbextendedlocale.h>
+#include <qfileinfo.h>
#include "videolistdatamodel.h"
#include "videocollectionclient.h"
@@ -91,8 +92,8 @@
return 0;
}
mVideoThumbnailData = &(VideoThumbnailData::instance());
- if(!connect( mVideoThumbnailData, SIGNAL(thumbnailsFetched( QList<TMPXItemId> )),
- this, SLOT(thumbnailsFetchedSlot( QList<TMPXItemId> ))))
+ if(!connect( mVideoThumbnailData, SIGNAL(thumbnailsFetched( QList<TMPXItemId>& )),
+ this, SLOT(thumbnailsFetchedSlot( QList<TMPXItemId>& ))))
{
return -1;
}
@@ -114,7 +115,7 @@
// getMediaIdFromIndex
// -----------------------------------------------------------------------------
//
-TMPXItemId VideoListDataModelPrivate::getMediaIdFromIndex( int index ) const
+const TMPXItemId& VideoListDataModelPrivate::getMediaIdFromIndex(const int &index ) const
{
return mMediaData.idFromIndex(index);
}
@@ -123,7 +124,7 @@
// getVideoNameFromIndex
// -----------------------------------------------------------------------------
//
-const QString VideoListDataModelPrivate::getVideoNameFromIndex( int index ) const
+const QString VideoListDataModelPrivate::getVideoNameFromIndex(const int &index ) const
{
QString txt;
CMPXMedia* media = mMediaData.fromIndex(index);
@@ -135,7 +136,7 @@
// getVideoThumbnailFromIndex
// -----------------------------------------------------------------------------
//
-const QIcon* VideoListDataModelPrivate::getVideoThumbnailFromIndex( int index ) const
+const QIcon* VideoListDataModelPrivate::getVideoThumbnailFromIndex(const int &index ) const
{
if(mVideoThumbnailData)
{
@@ -148,7 +149,7 @@
// getCategoryVideoCountFromIndex
// -----------------------------------------------------------------------------
//
-quint32 VideoListDataModelPrivate::getCategoryVideoCountFromIndex( int index ) const
+quint32 VideoListDataModelPrivate::getCategoryVideoCountFromIndex(const int &index ) const
{
quint32 count(0);
CMPXMedia *media = mMediaData.fromIndex(index);
@@ -160,7 +161,7 @@
// getVideoSizeFromIndex
// -----------------------------------------------------------------------------
//
-quint32 VideoListDataModelPrivate::getVideoSizeFromIndex( int index ) const
+quint32 VideoListDataModelPrivate::getVideoSizeFromIndex(const int &index ) const
{
quint32 size(0);
CMPXMedia *media = mMediaData.fromIndex(index);
@@ -172,7 +173,7 @@
// getVideoAgeProfileFromIndex
// ---------------------------------------------------------------------------
//
-quint32 VideoListDataModelPrivate::getVideoAgeProfileFromIndex( int index ) const
+quint32 VideoListDataModelPrivate::getVideoAgeProfileFromIndex(const int &index ) const
{
quint32 ageProfile(0);
CMPXMedia *media = mMediaData.fromIndex(index);
@@ -184,7 +185,7 @@
// getVideodurationFromIndex
// -----------------------------------------------------------------------------
//
-quint32 VideoListDataModelPrivate::getVideodurationFromIndex( int index ) const
+quint32 VideoListDataModelPrivate::getVideodurationFromIndex(const int &index ) const
{
CMPXMedia *media = mMediaData.fromIndex(index);
return getVideoDuration(media);
@@ -207,7 +208,7 @@
// getVideoDateFromIndex
// -----------------------------------------------------------------------------
//
-QDateTime VideoListDataModelPrivate::getVideoDateFromIndex( int index ) const
+QDateTime VideoListDataModelPrivate::getVideoDateFromIndex(const int &index ) const
{
return getVideoDate(mMediaData.fromIndex(index));
}
@@ -234,7 +235,7 @@
// markVideosRemoved
// -----------------------------------------------------------------------------
//
-TMPXItemId VideoListDataModelPrivate::markVideoRemoved(const QModelIndex &itemIndex)
+const TMPXItemId VideoListDataModelPrivate::markVideoRemoved(const QModelIndex &itemIndex)
{
return mMediaData.markItemRemoved(itemIndex.row());
}
@@ -259,7 +260,7 @@
// getFilePathFromIndex
// -----------------------------------------------------------------------------
//
-const QString VideoListDataModelPrivate::getFilePathFromIndex(int index) const
+const QString VideoListDataModelPrivate::getFilePathFromIndex(const int &index) const
{
QString filePath;
VideoCollectionUtils::instance().mediaValue<QString>(mMediaData.fromIndex(index),
@@ -271,7 +272,7 @@
// getFilePathForId
// -----------------------------------------------------------------------------
//
-const QString VideoListDataModelPrivate::getFilePathForId(TMPXItemId mediaId) const
+const QString VideoListDataModelPrivate::getFilePathForId(const TMPXItemId &mediaId)
{
QString filePath;
int index = mMediaData.indexOfId(mediaId);
@@ -308,7 +309,7 @@
// setAlbumInUse
// -----------------------------------------------------------------------------
//
-void VideoListDataModelPrivate::setAlbumInUse(TMPXItemId albumId)
+void VideoListDataModelPrivate::setAlbumInUse(const TMPXItemId &albumId)
{
FUNC_LOG;
mCurrentAlbum = albumId;
@@ -318,7 +319,7 @@
// removeItemsFromAlbum
// -----------------------------------------------------------------------------
//
-int VideoListDataModelPrivate::removeItemsFromAlbum(TMPXItemId &albumId,
+int VideoListDataModelPrivate::removeItemsFromAlbum(const TMPXItemId &albumId,
const QList<TMPXItemId> &items)
{
FUNC_LOG;
@@ -422,7 +423,7 @@
// albumDataChangedL
// -----------------------------------------------------------------------------
//
-void VideoListDataModelPrivate::albumDataChangedL(TMPXItemId albumId,
+void VideoListDataModelPrivate::albumDataChangedL(TMPXItemId &albumId,
CMPXMediaArray *videoArray)
{
FUNC_LOG;
@@ -431,7 +432,9 @@
return;
}
QSet<TMPXItemId> items;
-
+
+ int oldCount = mAlbumData[albumId].count();
+
// remove existing
mAlbumData.remove(albumId);
@@ -450,11 +453,14 @@
mAlbumData[albumId] = items;
- // signal that album has been updated
- emit q_ptr->albumChanged();
+ if(oldCount != items.count())
+ {
+ // signal that album has been updated
+ emit q_ptr->albumChanged();
- // signal that model has changed.
- emit q_ptr->modelChanged();
+ // signal that model has changed.
+ emit q_ptr->modelChanged();
+ }
}
@@ -462,7 +468,7 @@
// thumbnailsFetchedSlot
// -----------------------------------------------------------------------------
//
-void VideoListDataModelPrivate::thumbnailsFetchedSlot(QList<TMPXItemId> mediaIds)
+void VideoListDataModelPrivate::thumbnailsFetchedSlot(QList<TMPXItemId> &mediaIds)
{
TMPXItemId id;
QModelIndex rowIndex;
@@ -473,7 +479,7 @@
rowIndex = q_ptr->index(mMediaData.indexOfId(id), 0);
if(rowIndex.isValid())
{
- emit dataChanged( rowIndex, rowIndex);
+ emit q_ptr->dataChanged( rowIndex, rowIndex);
}
}
}
@@ -573,7 +579,7 @@
// itemDeletedSlot
// -----------------------------------------------------------------------------
//
-void VideoListDataModelPrivate::itemDeletedSlot(TMPXItemId itemId)
+void VideoListDataModelPrivate::itemDeletedSlot(TMPXItemId &itemId)
{
FUNC_LOG;
if(itemId == TMPXItemId::InvalidId())
@@ -595,7 +601,7 @@
// albumRemoved
// -----------------------------------------------------------------------------
//
-void VideoListDataModelPrivate::albumRemoved(TMPXItemId albumId)
+void VideoListDataModelPrivate::albumRemoved(TMPXItemId &albumId)
{
FUNC_LOG;
if (albumId == TMPXItemId::InvalidId() || albumId.iId2 != KVcxMvcMediaTypeAlbum)
@@ -639,7 +645,7 @@
// videoDeleted
// -----------------------------------------------------------------------------
//
-void VideoListDataModelPrivate::videoDeleted(TMPXItemId videoId)
+void VideoListDataModelPrivate::videoDeleted(TMPXItemId &videoId)
{
FUNC_LOG;
if(videoId == TMPXItemId::InvalidId())
@@ -688,7 +694,7 @@
if(failedMediaIds->count() > 0)
{
QString nameOfFirstFailed("");
- CMPXMedia *media = mMediaData.getRemovedMedia( TMPXItemId(failedMediaIds->at(0)));
+ CMPXMedia *media = mMediaData.getRemovedMedia(failedMediaIds->first());
VideoCollectionUtils::instance().mediaValue<QString>(media, KMPXMediaGeneralTitle, nameOfFirstFailed );
if(failedMediaIds->count() == 1)
{
@@ -722,7 +728,7 @@
if(failedMediaIds->count() > 0)
{
QString nameOfFirstFailed("");
- CMPXMedia *media = mMediaData.getRemovedMedia( TMPXItemId(failedMediaIds->at(0)));
+ CMPXMedia *media = mMediaData.getRemovedMedia(failedMediaIds->first());
VideoCollectionUtils::instance().mediaValue<QString>(media, KMPXMediaGeneralTitle, nameOfFirstFailed );
if(failedMediaIds->count() == 1)
{
@@ -856,15 +862,34 @@
map[MetaKeyFormat] = format;
}
+ // MetaKeyFileName and MetaKeyFilePath
+ QString fileName;
+ if(VideoCollectionUtils::instance().mediaValue<QString>(media, KMPXMediaGeneralUri, fileName)) {
+
+ QFileInfo fInfo(fileName);
+ if(fInfo.isFile())
+ {
+ map[MetaKeyFileName] = fInfo.fileName();
+ map[MetaKeyFilePath] = fInfo.absolutePath();
+ }
+ }
+
+ // Metakey video title
+ QString videoTitle;
+ if(VideoCollectionUtils::instance().mediaValue<QString>(media, KMPXMediaGeneralTitle, videoTitle)) {
+ map[MetaKeyVideoTitle] = videoTitle;
+ }
+
+
QVariant variant = QVariant(map);
- emit videoDetailsReady(variant);
+ emit q_ptr->fullVideoDetailsReady(variant);
}
// -----------------------------------------------------------------------------
// albumListAvailableSlot
// -----------------------------------------------------------------------------
//
-void VideoListDataModelPrivate::albumListAvailableSlot(TMPXItemId albumId,
+void VideoListDataModelPrivate::albumListAvailableSlot(TMPXItemId &albumId,
CMPXMediaArray *albumItems)
{
FUNC_LOG;
@@ -884,20 +909,29 @@
{
QModelIndex rowIndex = q_ptr->index(index, 0);
if(rowIndex.isValid())
- {
- emit dataChanged(rowIndex, rowIndex);
- emit q_ptr->itemModified(itemId);
+ {
+ emit q_ptr->dataChanged(rowIndex, rowIndex);
+ emit q_ptr->modelChanged();
}
}
}
// -----------------------------------------------------------------------------
-// listCompleteSlot
+// videoListCompleteSlot
// -----------------------------------------------------------------------------
//
-void VideoListDataModelPrivate::listCompleteSlot()
+void VideoListDataModelPrivate::videoListCompleteSlot()
{
emit q_ptr->modelReady();
}
+// -----------------------------------------------------------------------------
+// albumListCompleteSlot
+// -----------------------------------------------------------------------------
+//
+void VideoListDataModelPrivate::albumListCompleteSlot()
+{
+ emit q_ptr->albumListReady();
+}
+
// End of file
--- a/videocollection/videocollectionwrapper/src/videosortfilterproxymodel.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/src/videosortfilterproxymodel.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 66 %
+// Version : %version: 66.1.8 %
// INCLUDE FILES
#include <qstringlist.h>
@@ -32,6 +32,8 @@
#include "videocollectionwrapper.h"
#include "videocollectiontrace.h"
+const TMPXItemId INVALID_ID = TMPXItemId::InvalidId();
+
// -----------------------------------------------------------------------------
// VideoSortFilterProxyModel::VideoSortFilterProxyModel
// -----------------------------------------------------------------------------
@@ -96,13 +98,9 @@
bool VideoSortFilterProxyModel::connectSignals()
{
FUNC_LOG_ADDR(this);
- if(!connect(mModel, SIGNAL(modelReady()),
- this, SIGNAL(modelReady())))
- {
- return false;
- }
+
if(!connect(mModel, SIGNAL(modelChanged()),
- this, SIGNAL(modelChanged())))
+ this, SLOT(invalidate())))
{
return false;
}
@@ -114,14 +112,7 @@
return false;
}
}
- if(mType == VideoCollectionCommon::EModelTypeCollections)
- {
- if(!connect(mModel, SIGNAL(itemModified(const TMPXItemId &)),
- this, SLOT(itemModifiedSlot(const TMPXItemId &))))
- {
- return false;
- }
- }
+
return true;
}
@@ -132,8 +123,7 @@
void VideoSortFilterProxyModel::disconnectSignals()
{
FUNC_LOG_ADDR(this);
- disconnect(mModel, SIGNAL(modelReady()), this, SIGNAL(modelReady()));
- disconnect(mModel, SIGNAL(modelChanged()), this, SIGNAL(modelChanged()));
+ disconnect(mModel, SIGNAL(modelChanged()), this, SLOT(invalidate()));
if(mType == VideoCollectionCommon::EModelTypeCollectionContent)
{
disconnect(mModel, SIGNAL(albumChanged()), this, SLOT(albumChangedSlot()));
@@ -158,12 +148,16 @@
{
return -1;
}
-
+
if(mLevel != level)
{
- INFO_1("VideoSortFilterProxyModel::open() [0x%x] opening different level, invalidating.", this);
- mLevel = level;
- invalidateFilter();
+ INFO_1("VideoSortFilterProxyModel::open() [0x%x] opening different level, invalidating.", this);
+ mLevel = level;
+ invalidateFilter();
+ // sorting call required here to setup correct sort order in cases where source model allready
+ // contains items but proxy is not yet updated. (invalidate -call does not work since it updates proxy and
+ // calls sort in different order for us to use)
+ sort(0, mWantedSortOrder);
}
// need to call open every time to make sure all items are
// inserted to UI ( recent open might have been cancelled)
@@ -241,6 +235,10 @@
int VideoSortFilterProxyModel::deleteItems(const QModelIndexList &indexList)
{
FUNC_LOG_ADDR(this);
+
+ // Disable thumbnail fetching while items are removed from the model.
+ VideoThumbnailData::instance().enableBackgroundFetching(false);
+
if(mModel)
{
QModelIndexList mappedList;
@@ -252,10 +250,13 @@
if(mModel->removeRows(mappedList))
{
// Start fetching thumbnails at start of the model.
+ VideoThumbnailData::instance().enableBackgroundFetching(true);
VideoThumbnailData::instance().startBackgroundFetching(0, 0);
return 0;
}
}
+
+ VideoThumbnailData::instance().enableBackgroundFetching(true);
return -1;
}
@@ -276,6 +277,10 @@
mModel->setAlbumInUse(mediaId);
INFO_1("VideoSortFilterProxyModel::open() [0x%x] opening album or category, invalidating.", this);
invalidateFilter();
+ // sorting call required here to setup correct sort order in cases where source model allready
+ // contains items but proxy is not yet updated. (invalidate -call does not work since it updates proxy and
+ // calls sort in different order for us to use)
+ sort(0, mWantedSortOrder);
}
return 0;
}
@@ -371,8 +376,10 @@
{
return false;
}
- TMPXItemId leftId = mModel->mediaIdAtIndex(left.row());
- TMPXItemId rightId = mModel->mediaIdAtIndex(right.row());
+ int index = left.row();
+ TMPXItemId leftId = mModel->mediaIdAtIndex(index);
+ index = right.row();
+ TMPXItemId rightId = mModel->mediaIdAtIndex(index);
// Default categories are always first in the following order:
// Recently played (missing currently)
@@ -523,25 +530,24 @@
// VideoSortFilterProxyModel::getMediaIdAtIndex()
// -----------------------------------------------------------------------------
//
-TMPXItemId VideoSortFilterProxyModel::getMediaIdAtIndex(const QModelIndex &index) const
+const TMPXItemId& VideoSortFilterProxyModel::getMediaIdAtIndex(const QModelIndex &index) const
{
- TMPXItemId mpxId = TMPXItemId::InvalidId();
if(index.isValid())
{
- QModelIndex sourceIndex = mapToSource(index);
- if(mModel && sourceIndex.isValid())
+ int rowIndex = mapToSource(index).row();
+ if(mModel)
{
- mpxId = mModel->mediaIdAtIndex(sourceIndex.row());
+ return mModel->mediaIdAtIndex(rowIndex);
}
}
- return mpxId;
+ return INVALID_ID;
}
// -----------------------------------------------------------------------------
// VideoSortFilterProxyModel::indexOfId()
// -----------------------------------------------------------------------------
//
-QModelIndex VideoSortFilterProxyModel::indexOfId(TMPXItemId id)
+QModelIndex VideoSortFilterProxyModel::indexOfId(const TMPXItemId &id)
{
QModelIndex sourceIndex;
if(!mModel || id == TMPXItemId::InvalidId())
@@ -556,7 +562,7 @@
// VideoSortFilterProxyModel::getMediaFilePathForId()
// -----------------------------------------------------------------------------
//
-QString VideoSortFilterProxyModel::getMediaFilePathForId(TMPXItemId mediaId)
+QString VideoSortFilterProxyModel::getMediaFilePathForId(const TMPXItemId &mediaId)
{
QString filePath;
if(mModel)
@@ -692,9 +698,12 @@
{
FUNC_LOG_ADDR(this);
int err(-1);
-
+
+ // Disable thumbnail fetching while items are removed from the model.
+ VideoThumbnailData::instance().enableBackgroundFetching(false);
+
if (mModel)
- {
+ {
// remove items in album
err = mModel->removeItemsFromAlbum(albumId, mediaIds);
if(err > 0)
@@ -705,21 +714,23 @@
err = 0;
}
}
+
+ VideoThumbnailData::instance().enableBackgroundFetching(true);
return err;
}
// -----------------------------------------------------------------------------
-// VideoSortFilterProxyModel::renameAlbum()
+// VideoSortFilterProxyModel::renameItem()
// -----------------------------------------------------------------------------
//
-int VideoSortFilterProxyModel::renameAlbum(const TMPXItemId &albumId, const QString &newTitle)
+int VideoSortFilterProxyModel::renameItem(const TMPXItemId &itemId, const QString &newTitle)
{
FUNC_LOG_ADDR(this);
int err(-1);
if(mCollectionClient)
{
- return mCollectionClient->renameAlbum(albumId, newTitle);
+ return mCollectionClient->renameItem(itemId, newTitle);
}
return err;
}
@@ -755,7 +766,7 @@
// VideoSortFilterProxyModel::setGenericIdFilter()
// -----------------------------------------------------------------------------
//
-void VideoSortFilterProxyModel::setGenericIdFilter(TMPXItemId itemId, bool filterValue)
+void VideoSortFilterProxyModel::setGenericIdFilter(const TMPXItemId &itemId, bool filterValue)
{
FUNC_LOG_ADDR(this);
if(mType == VideoCollectionCommon::EModelTypeGeneric)
@@ -772,7 +783,7 @@
// VideoSortFilterProxyModel::setAlbumInUse()
// -----------------------------------------------------------------------------
//
-void VideoSortFilterProxyModel::setAlbumInUse(TMPXItemId albumId)
+void VideoSortFilterProxyModel::setAlbumInUse(const TMPXItemId &albumId)
{
FUNC_LOG_ADDR(this);
if(mModel)
@@ -794,29 +805,14 @@
if (mType == VideoCollectionCommon::EModelTypeCollectionContent)
{
INFO_1("VideoSortFilterProxyModel::albumChangedSlot() [0x%x] invalidating.", this);
- // sort and invalidate filtering, otherwise newle created album content won't sort
+ // sort and invalidate filtering, otherwise newly created album content won't sort
invalidateFilter();
- setSortRole(mWantedSortRole);
+ setSortRole(mWantedSortRole);
sort(0, mWantedSortOrder);
}
}
// -----------------------------------------------------------------------------
-// VideoSortFilterProxyModel::itemModifiedSlot()
-// -----------------------------------------------------------------------------
-//
-void VideoSortFilterProxyModel::itemModifiedSlot(const TMPXItemId &itemId)
-{
- FUNC_LOG_ADDR(this);
- if(mType == VideoCollectionCommon::EModelTypeCollections &&
- (itemId.iId2 == KVcxMvcMediaTypeAlbum || itemId.iId2 == KVcxMvcMediaTypeCategory))
- {
- INFO_1("VideoSortFilterProxyModel::itemModifiedSlot() [0x%x] invalidating.", this);
- invalidate();
- }
-}
-
-// -----------------------------------------------------------------------------
// VideoSortFilterProxyModel::getType()
// -----------------------------------------------------------------------------
//
--- a/videocollection/videocollectionwrapper/src/videothumbnaildata.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/src/videothumbnaildata.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 26 %
+// Version : %version: 26.1.2 %
// INCLUDE FILES
#include "videocollectiontrace.h"
@@ -44,8 +44,8 @@
d_ptr(new VideoThumbnailDataPrivate())
{
FUNC_LOG;
- connect(d_ptr, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)),
- this, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ connect(d_ptr, SIGNAL(thumbnailsFetched(QList<TMPXItemId>&)),
+ this, SIGNAL(thumbnailsFetched(QList<TMPXItemId>&)));
}
// -----------------------------------------------------------------------------
@@ -55,8 +55,8 @@
VideoThumbnailData::~VideoThumbnailData()
{
FUNC_LOG;
- disconnect(d_ptr, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)),
- this, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ disconnect(d_ptr, SIGNAL(thumbnailsFetched(QList<TMPXItemId>&)),
+ this, SIGNAL(thumbnailsFetched(QList<TMPXItemId>&)));
delete d_ptr;
}
@@ -64,7 +64,7 @@
// VideoThumbnailData::removeThumbnail()
// -----------------------------------------------------------------------------
//
-bool VideoThumbnailData::removeThumbnail(TMPXItemId mediaId)
+bool VideoThumbnailData::removeThumbnail(const TMPXItemId &mediaId)
{
INFO_2("VideoThumbnailData::removeThumbnail() mediaId (%d, %d)", mediaId.iId1, mediaId.iId2);
return d_ptr->removeThumbnail(mediaId);
@@ -74,7 +74,7 @@
// VideoThumbnailData::getThumbnail()
// -----------------------------------------------------------------------------
//
-const QIcon* VideoThumbnailData::getThumbnail(TMPXItemId mediaId)
+const QIcon* VideoThumbnailData::getThumbnail(const TMPXItemId &mediaId)
{
INFO_2("VideoThumbnailData::getThumbnail() mediaId (%d, %d)", mediaId.iId1, mediaId.iId2);
return d_ptr->getThumbnail(mediaId);
@@ -111,6 +111,15 @@
}
// -----------------------------------------------------------------------------
+// VideoThumbnailData::backgroundFetchingEnabled()
+// -----------------------------------------------------------------------------
+//
+bool VideoThumbnailData::backgroundFetchingEnabled()
+{
+ return d_ptr->backgroundFetchingEnabled();
+}
+
+// -----------------------------------------------------------------------------
// VideoThumbnailData::freeThumbnailData()
// -----------------------------------------------------------------------------
//
--- a/videocollection/videocollectionwrapper/src/videothumbnaildata_p.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/src/videothumbnaildata_p.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 24 %
+// Version : %version: 24.1.3 %
// 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())))
{
@@ -220,7 +211,7 @@
// VideoThumbnailDataPrivate::getThumbnail()
// -----------------------------------------------------------------------------
//
-const QIcon* VideoThumbnailDataPrivate::getThumbnail(TMPXItemId mediaId)
+const QIcon* VideoThumbnailDataPrivate::getThumbnail( const TMPXItemId &mediaId)
{
const QIcon *thumbnail = mThumbnailData[mediaId];
if(!thumbnail)
@@ -268,7 +259,7 @@
// VideoThumbnailDataPrivate::startFetchingThumbnail()
// -----------------------------------------------------------------------------
//
-int VideoThumbnailDataPrivate::startFetchingThumbnail(TMPXItemId mediaId, int priority)
+int VideoThumbnailDataPrivate::startFetchingThumbnail(const TMPXItemId &mediaId, int priority)
{
if(!mCurrentModel || !mThumbnailFetcher)
{
@@ -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;
@@ -348,9 +341,11 @@
// VideoThumbnailDataPrivate::getModelIndexes()
// -----------------------------------------------------------------------------
//
-void VideoThumbnailDataPrivate::getModelIndexes(QList<QModelIndex> &indexes, int startIndex, int endIndex)
+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,20 +405,10 @@
}
// -----------------------------------------------------------------------------
-// VideoThumbnailDataPrivate::modelChangedSlot()
-// -----------------------------------------------------------------------------
-//
-void VideoThumbnailDataPrivate::modelChangedSlot()
-{
- FUNC_LOG;
- startBackgroundFetching(mCurrentModel, mCurrentFetchIndex);
-}
-
-// -----------------------------------------------------------------------------
// VideoThumbnailDataPrivate::defaultThumbnail()
// -----------------------------------------------------------------------------
//
-const QIcon* VideoThumbnailDataPrivate::defaultThumbnail(TMPXItemId mediaId)
+const QIcon* VideoThumbnailDataPrivate::defaultThumbnail(const TMPXItemId &mediaId)
{
const TMPXItemId defaultIdVideo(KMaxTUint32-1, KVcxMvcMediaTypeVideo);
const TMPXItemId defaultIdAlbum(KMaxTUint32-1, KVcxMvcMediaTypeAlbum);
@@ -538,7 +523,7 @@
// VideoThumbnailDataPrivate::removeThumbnail()
// -----------------------------------------------------------------------------
//
-bool VideoThumbnailDataPrivate::removeThumbnail(TMPXItemId mediaId)
+bool VideoThumbnailDataPrivate::removeThumbnail(const TMPXItemId &mediaId)
{
FUNC_LOG;
return mThumbnailData.remove(mediaId);
@@ -571,6 +556,15 @@
}
// -----------------------------------------------------------------------------
+// VideoThumbnailDataPrivate::backgroundFetchingEnabled()
+// -----------------------------------------------------------------------------
+//
+bool VideoThumbnailDataPrivate::backgroundFetchingEnabled()
+{
+ return mBackgroundFetchingEnabled;
+}
+
+// -----------------------------------------------------------------------------
// VideoThumbnailDataPrivate::freeThumbnailData()
// -----------------------------------------------------------------------------
//
@@ -622,7 +616,12 @@
INFO("VideoThumbnailDataPrivate::startBackgroundFetching() fetching is disabled.");
return;
}
-
+
+ if(mBgFetchTimer)
+ {
+ mBgFetchTimer->stop();
+ }
+
doBackgroundFetching();
}
--- a/videocollection/videocollectionwrapper/tsrc/testvideocollectionclient/inc/testvideocollectionclient.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideocollectionclient/inc/testvideocollectionclient.h Wed Aug 18 09:50:14 2010 +0300
@@ -168,9 +168,9 @@
void testRemoveItemsFromAlbum();
/**
- * verifies renameAlbum
+ * verifies testRenameItem
*/
- void testRenameAlbum();
+ void testRenameItem();
/**
* verifies back -call
--- a/videocollection/videocollectionwrapper/tsrc/testvideocollectionclient/src/testvideocollectionclient.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideocollectionclient/src/testvideocollectionclient.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -597,46 +597,46 @@
}
// -----------------------------------------------------------------------------
-// testRenameAlbum
+// testRenameItem
// -----------------------------------------------------------------------------
//
-void TestVideoCollectionClient::testRenameAlbum()
+void TestVideoCollectionClient::testRenameItem()
{
MMPXCollection::setCommandLLeave(false);
QString title = "test";
- TMPXItemId albumId = TMPXItemId(1, 2);
+ TMPXItemId itemId = TMPXItemId(1, 2);
// no collectionutility
- QVERIFY(mTestObject->renameAlbum(albumId, title) < 0);
+ QVERIFY(mTestObject->renameItem(itemId, title) < 0);
mTestObject->initialize(mSignalReceiver);
// invalid album id
- albumId = TMPXItemId::InvalidId();
- QVERIFY(mTestObject->renameAlbum(albumId, title) < 0);
+ itemId = TMPXItemId::InvalidId();
+ QVERIFY(mTestObject->renameItem(itemId, title) < 0);
// empty title
title = "";
- QVERIFY(mTestObject->renameAlbum(albumId, title) < 0);
+ QVERIFY(mTestObject->renameItem(itemId, title) < 0);
// video id
title = "test";
- albumId = TMPXItemId(0, 0);
- QVERIFY(mTestObject->renameAlbum(albumId, title) < 0);
+ itemId = TMPXItemId(0, 0);
+ QVERIFY(mTestObject->renameItem(itemId, title) == 0);
// category id
- albumId = TMPXItemId(0, 1);
- QVERIFY(mTestObject->renameAlbum(albumId, title) < 0);
+ itemId = TMPXItemId(0, 1);
+ QVERIFY(mTestObject->renameItem(itemId, title) < 0);
// good case
- albumId = TMPXItemId(0, 2);
- QVERIFY(mTestObject->renameAlbum(albumId, title) == 0);
+ itemId = TMPXItemId(0, 2);
+ QVERIFY(mTestObject->renameItem(itemId, title) == 0);
// command leaves
- albumId = TMPXItemId(1, 2);
+ itemId = TMPXItemId(1, 2);
MMPXCollection::setCommandLLeave(true);
- QVERIFY(mTestObject->renameAlbum(albumId, title) < 0);
+ QVERIFY(mTestObject->renameItem(itemId, title) < 0);
MMPXCollection::setCommandLLeave(false);
}
--- a/videocollection/videocollectionwrapper/tsrc/testvideocollectionclient/stub/inc/stubcollectionsignalreceiver.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideocollectionclient/stub/inc/stubcollectionsignalreceiver.h Wed Aug 18 09:50:14 2010 +0300
@@ -73,7 +73,7 @@
/**
* No implementation needed for these tests
*/
- void itemDeletedSlot(TMPXItemId id)
+ void itemDeletedSlot(TMPXItemId &id)
{
Q_UNUSED(id);
}
@@ -89,7 +89,7 @@
/**
* No implementation needed for these tests
*/
- void videoDeletedSlot(TMPXItemId id)
+ void videoDeletedSlot(TMPXItemId &id)
{
Q_UNUSED(id);
}
@@ -114,7 +114,7 @@
/**
* No implementation needed for these tests
*/
- void albumListAvailableSlot(TMPXItemId albumId, CMPXMediaArray *albumItems)
+ void albumListAvailableSlot(TMPXItemId &albumId, CMPXMediaArray *albumItems)
{
Q_UNUSED(albumId);
Q_UNUSED(albumItems);
@@ -131,7 +131,14 @@
/**
* No implementation needed for these tests
*/
- void listCompleteSlot()
+ void videoListCompleteSlot()
+ {
+
+ }
+ /**
+ * No implementation needed for these tests
+ */
+ void albumListCompleteSlot()
{
}
--- a/videocollection/videocollectionwrapper/tsrc/testvideodatacontainer/src/testvideodatacontainer.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideodatacontainer/src/testvideodatacontainer.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -582,12 +582,15 @@
QVERIFY(mTestObject->mRemovedMedia.count() == 3);
CMPXMedia *media = 0;
- media = mTestObject->getRemovedMedia(TMPXItemId(1,0));
+ TMPXItemId testId = TMPXItemId(1,0);
+ media = mTestObject->getRemovedMedia(testId);
QVERIFY(!media);
- media = mTestObject->getRemovedMedia(TMPXItemId(0,0));
+ testId = TMPXItemId(0,0);
+ media = mTestObject->getRemovedMedia(testId);
QVERIFY(media);
media = 0;
- media = mTestObject->getRemovedMedia(TMPXItemId(MEDIA_COUNT - 1,0));
+ testId = TMPXItemId(MEDIA_COUNT - 1,0);
+ media = mTestObject->getRemovedMedia(testId);
QVERIFY(media);
}
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel/src/testvideolistdatamodel.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel/src/testvideolistdatamodel.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -201,32 +201,20 @@
//
void TestVideoListDataModel::testMediaIdAtIndex()
{
- mMediaFactory->removeArray();
+ // test is just for coverity, because there only 1
+ // function call at mediaIdAtIndex -method
- mMediaFactory->createMediaItems(MEDIA_COUNT);
-
- // ownership of media-array transferred
- mTestObjectInitialized->d_ptr->newVideoListSlot(mMediaFactory->mediaArray());
-
- // invalid index: below bounds
- QVERIFY(mTestObjectInitialized->mediaIdAtIndex(-1) == TMPXItemId::InvalidId());
+ mTestObjectInitialized->d_ptr->mItemIdToReturn = TMPXItemId::InvalidId();
- //invalid index: above bounds
- QVERIFY(mTestObjectInitialized->mediaIdAtIndex(MEDIA_COUNT) == TMPXItemId::InvalidId());
+ QVERIFY(mTestObjectInitialized->mediaIdAtIndex(0) == TMPXItemId::InvalidId());
- // first
- QVERIFY(mTestObjectInitialized->mediaIdAtIndex(0).iId1 == 0);
+ mTestObjectInitialized->d_ptr->mItemIdToReturn = TMPXItemId(0,0);
- // middle
- QVERIFY(mTestObjectInitialized->mediaIdAtIndex(MEDIA_COUNT / 2).iId1 == (MEDIA_COUNT / 2));
+ QVERIFY(mTestObjectInitialized->mediaIdAtIndex(0) == TMPXItemId(0,0));
- // last
- QVERIFY(mTestObjectInitialized->mediaIdAtIndex(MEDIA_COUNT - 1).iId1 == (MEDIA_COUNT - 1));
-
- // no items
- mMediaFactory->removeArray();
- mTestObjectInitialized->d_ptr->newVideoListSlot(0);
- QVERIFY( mTestObjectInitialized->mediaIdAtIndex(MEDIA_COUNT / 2) == TMPXItemId::InvalidId());
+ mTestObjectInitialized->d_ptr->mItemIdToReturn = TMPXItemId(1,2);
+
+ QVERIFY(mTestObjectInitialized->mediaIdAtIndex(0) == TMPXItemId(1,2));
}
// -----------------------------------------------------------------------------
@@ -816,13 +804,26 @@
}
+// -----------------------------------------------------------------------------
+// testDeleteStartingFailsSlot
+// -----------------------------------------------------------------------------
+//
void TestVideoListDataModel::testDeleteStartingFailsSlot()
-{
- QSignalSpy spysignal(mTestObjectInitialized, SIGNAL(modelChanged()));
+{
mTestObjectInitialized->mDeleteWorker->mIsDeleting = false;
VideoCollectionWrapper::mLatestStatusCode = -1;
VideoCollectionWrapper::mLatestAdditional = QVariant();
+ // "start deletion to get signals connected
+ QModelIndexList indexList;
+ mMediaFactory->createMediaItems(MEDIA_COUNT);
+ mTestObjectInitialized->d_ptr->newVideoListSlot(mMediaFactory->mediaArray());
+ indexList.append(mTestObjectInitialized->index(0,0));
+ indexList.append(mTestObjectInitialized->index(1,0));
+ mTestObjectInitialized->removeRows(indexList);
+
+ QSignalSpy spysignal(mTestObjectInitialized, SIGNAL(modelChanged()));
+
QList<TMPXItemId> idList;
// empty list
emit mTestObjectInitialized->mDeleteWorker->deleteStartupFailed(idList);
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/inc/videocollectionclient.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/inc/videocollectionclient.h Wed Aug 18 09:50:14 2010 +0300
@@ -58,7 +58,7 @@
/**
* returns mRemoveItemsReturn
*/
- int removeItemsFromAlbum(TMPXItemId &albumId, const QList<TMPXItemId> &items);
+ int removeItemsFromAlbum(const TMPXItemId &albumId, const QList<TMPXItemId> &items);
/**
* if true, initializate fails
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/inc/videodeleteworker.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/inc/videodeleteworker.h Wed Aug 18 09:50:14 2010 +0300
@@ -97,7 +97,7 @@
/**
* dummy signal
*/
- void deleteStartupFailed(QList<TMPXItemId>);
+ void deleteStartupFailed(QList<TMPXItemId>&);
public slots:
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/inc/videolistdatamodel_p.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/inc/videolistdatamodel_p.h Wed Aug 18 09:50:14 2010 +0300
@@ -114,7 +114,7 @@
* @param index
* @return int
*/
- TMPXItemId getMediaIdFromIndex(int index) const;
+ TMPXItemId& getMediaIdFromIndex(const int &index) const;
/**
* return video path of the item with given media id
@@ -122,7 +122,7 @@
* @param mediaId
* @return int
*/
- const QString getFilePathForId(TMPXItemId mediaId) const;
+ const QString getFilePathForId(const TMPXItemId &mediaId) const;
/**
* return name of the item at given index
@@ -130,7 +130,7 @@
* @param index
* @return QString
*/
- const QString getVideoNameFromIndex( int index ) const;
+ const QString getVideoNameFromIndex(const int &index ) const;
/**
* return default tn always
@@ -138,7 +138,7 @@
* @param index
* @return QIcon
*/
- const QIcon* getVideoThumbnailFromIndex( int index ) const;
+ const QIcon* getVideoThumbnailFromIndex(const int &index ) const;
/**
* return video count of the item at given index
@@ -146,7 +146,7 @@
* @param index
* @return quint32
*/
- quint32 VideoListDataModelPrivate::getCategoryVideoCountFromIndex( int index ) const;
+ quint32 getCategoryVideoCountFromIndex(const int &index ) const;
/**
* return video size of the item at given index
@@ -154,7 +154,7 @@
* @param index
* @return quint32
*/
- quint32 getVideoSizeFromIndex( int index ) const;
+ quint32 getVideoSizeFromIndex(const int &index ) const;
/**
* return video age profile of the item at given index
@@ -162,7 +162,7 @@
* @param index
* @return quint32
*/
- quint32 getVideoAgeProfileFromIndex( int index ) const;
+ quint32 getVideoAgeProfileFromIndex(const int &index ) const;
/**
* return video duration of the item at given index
@@ -170,7 +170,7 @@
* @param index
* @return quint32
*/
- quint32 getVideodurationFromIndex( int index ) const;
+ quint32 getVideodurationFromIndex(const int &index ) const;
/**
* return video creation datetime of the item at given index
@@ -178,7 +178,7 @@
* @param index
* @return QDateTime
*/
- QDateTime getVideoDateFromIndex( int index ) const;
+ QDateTime getVideoDateFromIndex(const int &index ) const;
/**
* Returns video status
@@ -187,7 +187,7 @@
*
* @return int status code
*/
- int getVideoStatusFromIndex(int index) const;
+ int getVideoStatusFromIndex(const int &index) const;
/**
* marks videos to be removed: it's id and index are saved to
@@ -211,22 +211,22 @@
*
* @param index: item position where client wants the file path from.
*/
- const QString getFilePathFromIndex(int index) const;
+ const QString getFilePathFromIndex(const int &index) const;
/**
* returns mBelongsToAlbum;
*/
- bool belongsToAlbum(TMPXItemId itemId, TMPXItemId albumId);
+ bool belongsToAlbum(const TMPXItemId &itemId, TMPXItemId albumId);
/**
* returns mBelongsToAlbum;
*/
- void setAlbumInUse(TMPXItemId albumId);
+ void setAlbumInUse(const TMPXItemId &albumId);
/**
* returns mRemoveFrAlbumReturn
*/
- int removeItemsFromAlbum(TMPXItemId &albumId, const QList<TMPXItemId> &ids);
+ int removeItemsFromAlbum(const TMPXItemId &albumId, const QList<TMPXItemId> &ids);
private: // private methods
@@ -245,7 +245,7 @@
* @param index
* @return CMPXMedia
*/
- CMPXMedia* getMediaFromIndex( int index ) const;
+ CMPXMedia* getMediaFromIndex(const int &index) const;
/**
* return index of item of given id
@@ -253,7 +253,7 @@
* @param mediaId
* @return int
*/
- int indexOfMediaId(TMPXItemId mediaId) const;
+ int indexOfMediaId(const TMPXItemId &mediaId) const;
public slots:
@@ -277,13 +277,7 @@
*
*/
void newVideoAvailableSlot(CMPXMedia* aVideo);
-
- /**
- * not used in stub
- *
- */
- void videoDeletedSlot(TMPXItemId videoId);
-
+
/**
* used to clear mItemsUnderDeletion for this stub
*
@@ -299,7 +293,7 @@
/**
* not used in stub
*/
- void albumListAvailableSlot(TMPXItemId albumId, CMPXMediaArray *albumItems);
+ void albumListAvailableSlot(TMPXItemId &albumId, CMPXMediaArray *albumItems);
/**
* not used in stub
@@ -314,12 +308,17 @@
/**
* not used in stub
*/
- void itemDeletedSlot(TMPXItemId id);
+ void itemDeletedSlot(TMPXItemId &id);
/**
* not used in stub
*/
- void listCompleteSlot();
+ void videoListCompleteSlot();
+
+ /**
+ * not used in stub
+ */
+ void albumListCompleteSlot();
public:
@@ -409,6 +408,11 @@
*/
static int mRemoveFrAlbumReturn;
+ /**
+ * value returned from getMediaIdFromIndex
+ */
+ static TMPXItemId mItemIdToReturn;
+
};
/**
@@ -427,7 +431,7 @@
for(int i = 0; i < mObj->getVideoCount(); ++i)
{
- if(id == mObj->getMediaIdFromIndex(i))
+ if(id == mObj->getMediaId(mObj->getMediaFromIndex(i)))
{
return i;
}
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/src/videocollectionclient.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/src/videocollectionclient.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -67,7 +67,7 @@
// removeItemsFromAlbum
// -----------------------------------------------------------------------------
//
-int VideoCollectionClient::removeItemsFromAlbum(TMPXItemId &albumId, const QList<TMPXItemId> &items)
+int VideoCollectionClient::removeItemsFromAlbum(const TMPXItemId &albumId, const QList<TMPXItemId> &items)
{
Q_UNUSED(albumId);
Q_UNUSED(items);
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/src/videolistdatamodel_p.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/src/videolistdatamodel_p.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -28,6 +28,8 @@
#include "vcxmyvideosdefs.h"
#include "videocollectioncommon.h"
+const TMPXItemId INVALID_ID = TMPXItemId::InvalidId();
+
inline uint qHash(TMPXItemId key)
{
QPair<uint, uint> keyPair(key.iId1, key.iId2);
@@ -79,6 +81,8 @@
int VideoListDataModelPrivate::mRemoveFrAlbumReturn = -1;
+TMPXItemId VideoListDataModelPrivate::mItemIdToReturn = TMPXItemId::InvalidId();
+
// -----------------------------------------------------------------------------
// CVideoListData
// -----------------------------------------------------------------------------
@@ -156,7 +160,7 @@
// getVideoNameFromIndex
// -----------------------------------------------------------------------------
//
-const QString VideoListDataModelPrivate::getVideoNameFromIndex( int index ) const
+const QString VideoListDataModelPrivate::getVideoNameFromIndex(const int &index ) const
{
QString txt = "";
CMPXMedia* media = getMediaFromIndex(index);
@@ -169,7 +173,7 @@
// getVideoThumbnailFromIndex
// -----------------------------------------------------------------------------
//
-const QIcon* VideoListDataModelPrivate::getVideoThumbnailFromIndex( int index ) const
+const QIcon* VideoListDataModelPrivate::getVideoThumbnailFromIndex(const int &index ) const
{
Q_UNUSED(index);
@@ -180,7 +184,7 @@
// getVideoThumbnailFromIndex
// -----------------------------------------------------------------------------
//
-quint32 VideoListDataModelPrivate::getCategoryVideoCountFromIndex( int index ) const
+quint32 VideoListDataModelPrivate::getCategoryVideoCountFromIndex(const int &index ) const
{
if(mOverrideVideoCount)
{
@@ -200,7 +204,7 @@
// getVideoSizeFromIndex
// -----------------------------------------------------------------------------
//
-quint32 VideoListDataModelPrivate::getVideoSizeFromIndex( int index ) const
+quint32 VideoListDataModelPrivate::getVideoSizeFromIndex(const int &index ) const
{
if(mOverrideSize)
{
@@ -219,7 +223,7 @@
// getVideodurationFromIndex
// -----------------------------------------------------------------------------
//
-quint32 VideoListDataModelPrivate::getVideodurationFromIndex( int index ) const
+quint32 VideoListDataModelPrivate::getVideodurationFromIndex(const int &index ) const
{
if(mOverrideDuration)
{
@@ -240,7 +244,7 @@
// getVideoDateFromIndex
// -----------------------------------------------------------------------------
//
-QDateTime VideoListDataModelPrivate::getVideoDateFromIndex( int index ) const
+QDateTime VideoListDataModelPrivate::getVideoDateFromIndex(const int &index ) const
{
QDateTime date;
CMPXMedia *media = getMediaFromIndex(index);
@@ -258,16 +262,17 @@
// getMediaIdFromIndex
// -----------------------------------------------------------------------------
//
-TMPXItemId VideoListDataModelPrivate::getMediaIdFromIndex( int index ) const
+TMPXItemId& VideoListDataModelPrivate::getMediaIdFromIndex(const int &index ) const
{
- return getMediaId( getMediaFromIndex(index) );
+ Q_UNUSED(index);
+ return mItemIdToReturn;
}
// -----------------------------------------------------------------------------
// getFilePathForId
// -----------------------------------------------------------------------------
//
-const QString VideoListDataModelPrivate::getFilePathForId( TMPXItemId mediaId ) const
+const QString VideoListDataModelPrivate::getFilePathForId(const TMPXItemId &mediaId ) const
{
return getFilePathFromIndex( indexOfMediaId(mediaId) );
}
@@ -276,7 +281,7 @@
// getFilePathForId
// -----------------------------------------------------------------------------
//
-bool VideoListDataModelPrivate::belongsToAlbum(TMPXItemId itemId, TMPXItemId albumId)
+bool VideoListDataModelPrivate::belongsToAlbum(const TMPXItemId &itemId, TMPXItemId albumId)
{
Q_UNUSED(itemId);
Q_UNUSED(albumId);
@@ -287,7 +292,7 @@
// setAlbumInUse
// -----------------------------------------------------------------------------
//
-void VideoListDataModelPrivate::setAlbumInUse(TMPXItemId albumId)
+void VideoListDataModelPrivate::setAlbumInUse(const TMPXItemId &albumId)
{
mCurrentAlbum = albumId;
}
@@ -296,7 +301,7 @@
// removeItemsFromAlbum
// -----------------------------------------------------------------------------
//
-int VideoListDataModelPrivate::removeItemsFromAlbum(TMPXItemId &albumId, const QList<TMPXItemId> &ids)
+int VideoListDataModelPrivate::removeItemsFromAlbum(const TMPXItemId &albumId, const QList<TMPXItemId> &ids)
{
Q_UNUSED(albumId);
Q_UNUSED(ids);
@@ -307,7 +312,7 @@
// getVideoStatusFromIndex
// -----------------------------------------------------------------------------
//
-int VideoListDataModelPrivate::getVideoStatusFromIndex(int index) const
+int VideoListDataModelPrivate::getVideoStatusFromIndex(const int &index) const
{
int status = 0;
if(mItemsUnderDeletion.contains(getMediaIdFromIndex(index)))
@@ -354,7 +359,7 @@
// getFilePathFromIndex
// -----------------------------------------------------------------------------
//
-const QString VideoListDataModelPrivate::getFilePathFromIndex(int index) const
+const QString VideoListDataModelPrivate::getFilePathFromIndex(const int &index) const
{
QString filePath;
VideoCollectionUtils::instance().mediaValue<QString>(getMediaFromIndex(index),
@@ -366,7 +371,7 @@
// getMediaFromIndex
// -----------------------------------------------------------------------------
//
-CMPXMedia* VideoListDataModelPrivate::getMediaFromIndex( int index ) const
+CMPXMedia* VideoListDataModelPrivate::getMediaFromIndex(const int &index) const
{
CMPXMedia *media = NULL;
if( mMediaArray && index >= 0 && index < mMediaArray->Count() )
@@ -394,7 +399,7 @@
// indexOfMediaId
// -----------------------------------------------------------------------------
//
-int VideoListDataModelPrivate::indexOfMediaId(TMPXItemId mediaId) const
+int VideoListDataModelPrivate::indexOfMediaId(const TMPXItemId &mediaId) const
{
int index = -1;
if( !mMediaArray )
@@ -449,15 +454,6 @@
}
// -----------------------------------------------------------------------------
-// videoDeleted
-// -----------------------------------------------------------------------------
-//
-void VideoListDataModelPrivate::videoDeletedSlot(TMPXItemId videoId)
-{
- Q_UNUSED(videoId);
-}
-
-// -----------------------------------------------------------------------------
// videoDeleteCompleted
// -----------------------------------------------------------------------------
//
@@ -481,7 +477,7 @@
// albumListAvailableSlot
// -----------------------------------------------------------------------------
//
-void VideoListDataModelPrivate::albumListAvailableSlot(TMPXItemId albumId,
+void VideoListDataModelPrivate::albumListAvailableSlot(TMPXItemId &albumId,
CMPXMediaArray *albumItems)
{
Q_UNUSED(albumId);
@@ -510,16 +506,24 @@
// itemDeletedSlot
// -----------------------------------------------------------------------------
//
-void VideoListDataModelPrivate::itemDeletedSlot(TMPXItemId id)
+void VideoListDataModelPrivate::itemDeletedSlot(TMPXItemId &id)
{
Q_UNUSED(id);
}
// -----------------------------------------------------------------------------
-// listCompleteSlot
+// videoListCompleteSlot
// -----------------------------------------------------------------------------
//
-void VideoListDataModelPrivate::listCompleteSlot()
+void VideoListDataModelPrivate::videoListCompleteSlot()
+{
+}
+
+// -----------------------------------------------------------------------------
+// albumListCompleteSlot
+// -----------------------------------------------------------------------------
+//
+void VideoListDataModelPrivate::albumListCompleteSlot()
{
}
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/inc/mediaobjectfactory.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/inc/mediaobjectfactory.h Wed Aug 18 09:50:14 2010 +0300
@@ -19,6 +19,8 @@
#define __TESTVIDEOLISTMEDIAFACTORY_H__
+#include <qtemporaryfile.h>
+
class CMPXMediaArray;
class CMPXMedia;
@@ -52,7 +54,7 @@
_LIT( KMediaTestNamePrefix, "MEDIATESTNAME_%d" );
const QString gQTMediaNamePrefix = "MEDIATESTNAME_";
-_LIT( KMediaTestPathPrefix, "MEDIATESTPATH_%d" );
+_LIT( KMediaTestPathPrefix, "c:\\MEDIATESTPATH_%d\\" );
const QString gQTMediaPathPrefix = "MEDIATESTPATH_";
_LIT( KMediaTestDescPrefix, "MEDIATESTDESC_%d" );
@@ -144,6 +146,11 @@
* array of medias
*/
CMPXMediaArray *mArray;
+
+ /**
+ * list of temp files
+ */
+ QList<QTemporaryFile*> mTmpFiles;
};
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/inc/testvideomodel_p.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/inc/testvideomodel_p.h Wed Aug 18 09:50:14 2010 +0300
@@ -39,7 +39,7 @@
/**
* emitted to test thumbnailFetchedSlot
*/
- void signalThumbnailsFetched(QList<TMPXItemId>);
+ void signalThumbnailsFetched(QList<TMPXItemId>&);
/**
* emitted to pass new media-array into testable object and
@@ -56,7 +56,7 @@
/**
* emitted to verify albumListAvailableSlot
*/
- void signalAlbumListAvailable(TMPXItemId, CMPXMediaArray*);
+ void signalAlbumListAvailable(TMPXItemId&, CMPXMediaArray*);
/**
* emitted to verify itemModifiedSlot
@@ -71,7 +71,7 @@
/**
* emitted to get deleteItemSlot to be called.
*/
- void signalDeleteItem(TMPXItemId);
+ void signalDeleteItem(TMPXItemId&);
/**
* emitted to get videoDeleteCompletedSlot to be called.
@@ -255,9 +255,14 @@
void testGetCollectionIdFromIndex();
/**
- * verifies listCompleteSlot
+ * verifies videoListCompleteSlot
*/
void testListCompleteSlot();
+
+ /**
+ * verifies albumListCompleteSlot;
+ */
+ void testalbumListCompleteSlot();
private:
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/src/mediaobjectfactory.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/src/mediaobjectfactory.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -22,6 +22,7 @@
#include <mpxmediaarray.h>
#include <mpxmedia.h>
#include <qdatetime.h>
+#include <xqconversions.h>
#include "vcxmyvideosdefs.h"
#include "mediaobjectfactory.h"
@@ -320,8 +321,13 @@
// set "filepath"
if(dataSelectionFlags & MediaDataFilePath)
{
- videoname.Format(KMediaTestPathPrefix, index);
- TRAPD(error, media->SetTextValueL( KMPXMediaGeneralUri, videoname));
+ mTmpFiles.append(new QTemporaryFile());
+ mTmpFiles.last()->open();
+
+ HBufC *fileName = XQConversions::qStringToS60Desc(mTmpFiles.last()->fileName());
+
+ TRAPD(error, media->SetTextValueL( KMPXMediaGeneralUri, *fileName));
+ delete fileName;
if(error != KErrNone)
{
delete media;
@@ -462,6 +468,13 @@
//
void MediaObjectFactory::removeArray()
{
+ while(!mTmpFiles.isEmpty())
+ {
+ mTmpFiles.first()->close();
+ delete mTmpFiles.first();
+ mTmpFiles.removeFirst();
+ }
+
delete mArray;
mArray = 0;
}
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/src/testvideomodel_p.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/src/testvideomodel_p.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -542,7 +542,7 @@
QVERIFY(path.isNull());
path = mTestObject->getFilePathFromIndex(0);
- QCOMPARE(path, gQTMediaPathPrefix + "0");
+ QVERIFY(!path.isEmpty());
// data does not exist
mTestObject->mMediaData.clear();
@@ -576,7 +576,7 @@
QVERIFY(path.isNull());
path = mTestObject->getFilePathForId(TMPXItemId(0,0));
- QCOMPARE(path, gQTMediaPathPrefix + "0");
+ QVERIFY(!path.isEmpty());
// data does not exist
mTestObject->mMediaData.clear();
@@ -649,9 +649,9 @@
//
void TestVideoModel_p::testThumbnailsFetchedSlot()
{
- QVERIFY(connect(this, SIGNAL(signalThumbnailsFetched(QList<TMPXItemId>)), mTestObject, SLOT(thumbnailsFetchedSlot(QList<TMPXItemId>))));
+ QVERIFY(connect(this, SIGNAL(signalThumbnailsFetched(QList<TMPXItemId>&)), mTestObject, SLOT(thumbnailsFetchedSlot(QList<TMPXItemId>&))));
- QSignalSpy spysignal(mTestObject, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)));
+ QSignalSpy spysignal(mStubModel, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)));
mMediaFactory->removeArray();
QList<TMPXItemId> mediaIds;
@@ -699,7 +699,7 @@
QVERIFY(spysignal.count() == 1);
disconnect(this, SIGNAL(signalNewVideoList(CMPXMediaArray*)), mTestObject, SLOT(newVideoListSlot(CMPXMediaArray*)));
- disconnect(this, SIGNAL(signalThumbnailsFetched(QList<TMPXItemId>)), mTestObject, SLOT(thumbnailsFetchedSlot(QList<TMPXItemId>)));
+ disconnect(this, SIGNAL(signalThumbnailsFetched(QList<TMPXItemId>&)), mTestObject, SLOT(thumbnailsFetchedSlot(QList<TMPXItemId>&)));
}
// -----------------------------------------------------------------------------
@@ -894,8 +894,8 @@
QVERIFY(mTestObject->initialize() == 0);
- QVERIFY(connect(this, SIGNAL(signalAlbumListAvailable(TMPXItemId, CMPXMediaArray*)),
- mTestObject, SLOT(albumListAvailableSlot(TMPXItemId, CMPXMediaArray*))));
+ QVERIFY(connect(this, SIGNAL(signalAlbumListAvailable(TMPXItemId&, CMPXMediaArray*)),
+ mTestObject, SLOT(albumListAvailableSlot(TMPXItemId&, CMPXMediaArray*))));
TMPXItemId albumId(1,2);
@@ -932,8 +932,8 @@
TMPXItemId itemToCheck(1,0);
QVERIFY(mTestObject->belongsToAlbum(itemToCheck, albumId));
- disconnect(this, SIGNAL(signalAlbumListAvailable(TMPXItemId, CMPXMediaArray*)),
- mTestObject, SLOT(albumListAvailableSlot(TMPXItemId, CMPXMediaArray*)));
+ disconnect(this, SIGNAL(signalAlbumListAvailable(TMPXItemId&, CMPXMediaArray*)),
+ mTestObject, SLOT(albumListAvailableSlot(TMPXItemId&, CMPXMediaArray*)));
}
// -----------------------------------------------------------------------------
@@ -946,7 +946,7 @@
QVERIFY(connect(this, SIGNAL(signalItemModified(const TMPXItemId &)), mTestObject, SLOT(itemModifiedSlot(const TMPXItemId &))));
- QSignalSpy spysignal(mTestObject, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)));
+ QSignalSpy spysignal(mStubModel, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)));
// invalid item id, no items
TMPXItemId id = TMPXItemId::InvalidId();
@@ -1077,16 +1077,19 @@
QSignalSpy spyModelChanged(mStubModel, SIGNAL(modelChanged()));
QVERIFY(connect(this, SIGNAL(signalNewVideoList(CMPXMediaArray*)), mTestObject, SLOT(newVideoListSlot(CMPXMediaArray*))));
- QVERIFY(connect(this, SIGNAL(signalDeleteItem(TMPXItemId)), mTestObject, SLOT(itemDeletedSlot(TMPXItemId))));
+ QVERIFY(connect(this, SIGNAL(signalDeleteItem(TMPXItemId&)), mTestObject, SLOT(itemDeletedSlot(TMPXItemId&))));
+
+ TMPXItemId idForSignal = TMPXItemId(0,0);
// no videos
- emit signalDeleteItem(TMPXItemId(0,0));
+ emit signalDeleteItem(idForSignal);
QVERIFY(VideoListDataModel::mFirstRemoved == -1);
QVERIFY(VideoListDataModel::mFirstRemoved == -1);
QVERIFY(spyModelChanged.count() == 0);
+ idForSignal = TMPXItemId::InvalidId();
// invalid id
- emit signalDeleteItem(TMPXItemId::InvalidId());
+ emit signalDeleteItem(idForSignal);
QVERIFY(VideoListDataModel::mFirstRemoved == -1);
QVERIFY(VideoListDataModel::mFirstRemoved == -1);
QVERIFY(spyModelChanged.count() == 0);
@@ -1097,9 +1100,10 @@
VideoListDataModel::mFirstRemoved = -1;
VideoListDataModel::mLastRemoved = -1;
spyModelChanged.clear();
-
+
// not marked as removed
- emit signalDeleteItem(TMPXItemId(MEDIA_COUNT / 2,0));
+ idForSignal = TMPXItemId(MEDIA_COUNT / 2,0);
+ emit signalDeleteItem(idForSignal);
QVERIFY(VideoListDataModel::mFirstRemoved == MEDIA_COUNT / 2);
QVERIFY(VideoListDataModel::mFirstRemoved == MEDIA_COUNT / 2);
QVERIFY(spyModelChanged.count() == 1);
@@ -1154,7 +1158,8 @@
mTestObject->mAlbumData[album2] = items;
// not existing album
- emit signalDeleteItem(TMPXItemId(1,2));
+ idForSignal = TMPXItemId(1,2);
+ emit signalDeleteItem(idForSignal);
QVERIFY(VideoListDataModel::mFirstRemoved == -1);
QVERIFY(spyModelChanged.count() == 0);
QVERIFY( mTestObject->mAlbumData.count() == 2);
@@ -1177,7 +1182,7 @@
QVERIFY( mTestObject->mAlbumData.count() == 0);
mTestObject->mVideoThumbnailData = pTmp;
- disconnect(this, SIGNAL(signalDeleteItem(TMPXItemId)), mTestObject, SLOT(itemDeletedSlot(TMPXItemId)));
+ disconnect(this, SIGNAL(signalDeleteItem(TMPXItemId&)), mTestObject, SLOT(itemDeletedSlot(TMPXItemId&)));
disconnect(this, SIGNAL(signalNewVideoList(CMPXMediaArray*)), mTestObject, SLOT(newVideoListSlot(CMPXMediaArray*)));
}
@@ -1294,12 +1299,12 @@
using namespace VideoCollectionCommon;
mMediaFactory->removeArray();
-// QVERIFY(connect(this, SIGNAL(signalNewVideoList(CMPXMediaArray*)), mTestObject, SLOT(newVideoListSlot(CMPXMediaArray*))));
+
QVERIFY(connect(this, SIGNAL(signalVideoDetailsCompleted(CMPXMedia*)), mTestObject, SLOT(videoDetailsCompletedSlot(CMPXMedia*))));
HbExtendedLocale locale = HbExtendedLocale::system();
- MetaDataSignalSpy spysignal(mTestObject, SIGNAL(videoDetailsReady(QVariant&)));
+ MetaDataSignalSpy spysignal(mStubModel, SIGNAL(fullVideoDetailsReady(QVariant&)));
// check with NULL media.
emit signalVideoDetailsCompleted(0);
@@ -1326,6 +1331,9 @@
QVERIFY(map.contains(MetaKeyFormat));
QVERIFY(map.contains(MetaKeyVideoResolutionString));
QVERIFY(map.contains(MetaKeyBitRate));
+ QVERIFY(map.contains(MetaKeyFileName));
+ QVERIFY(map.contains(MetaKeyFilePath));
+ QVERIFY(map.contains(MetaKeyVideoTitle));
// one or several of these will fail, when rest of the metadata is implemented.
QVERIFY(map.contains(MetaKeyDRMInfo) == false);
@@ -1346,7 +1354,9 @@
QCOMPARE(map[MetaKeyFormat].toString(), gQTMediaFormatPrefix + "0");
QCOMPARE(map[MetaKeyVideoResolutionString].toString(), hbTrId("txt_videos_list_l1l2").arg(1).arg(2));
QCOMPARE(map[MetaKeyBitRate].toString(), hbTrId("txt_videos_list_l1_kbps", 800));
-
+ QVERIFY(!map[MetaKeyFileName].toString().isEmpty());
+ QVERIFY(!map[MetaKeyFilePath].toString().isEmpty());
+ QVERIFY(!map[MetaKeyVideoTitle].toString().isEmpty());
// Mbps case
media = mMediaFactory->mediaArray()->operator [](1);
emit signalVideoDetailsCompleted(media);
@@ -1369,7 +1379,7 @@
QVERIFY(map.contains(MetaKeySizeString));
disconnect(this, SIGNAL(signalNewVideoList(CMPXMediaArray*)), mTestObject, SLOT(newVideoListSlot(CMPXMediaArray*)));
- disconnect(this, SIGNAL(signalVideoDetailsCompleted(TMPXItemId)), mTestObject, SLOT(videoDetailsCompletedSlot(TMPXItemId)));
+ disconnect(this, SIGNAL(signalVideoDetailsCompleted(CMPXMedia*)), mTestObject, SLOT(videoDetailsCompletedSlot(CMPXMedia*)));
}
// -----------------------------------------------------------------------------
@@ -1420,12 +1430,24 @@
//
void TestVideoModel_p::testListCompleteSlot()
{
- QVERIFY(connect(this, SIGNAL(signalListCompleteSlot()), mTestObject, SLOT(listCompleteSlot())));
+ QVERIFY(connect(this, SIGNAL(signalListCompleteSlot()), mTestObject, SLOT(videoListCompleteSlot())));
QSignalSpy spy(mStubModel, SIGNAL(modelReady()));
emit signalListCompleteSlot();
QCOMPARE(spy.count(), 1);
}
+// -----------------------------------------------------------------------------
+// testalbumListCompleteSlot
+// -----------------------------------------------------------------------------
+//
+void TestVideoModel_p::testalbumListCompleteSlot()
+{
+ QVERIFY(connect(this, SIGNAL(signalListCompleteSlot()), mTestObject, SLOT(albumListCompleteSlot())));
+ QSignalSpy spy(mStubModel, SIGNAL(albumListReady()));
+ emit signalListCompleteSlot();
+ QCOMPARE(spy.count(), 1);
+}
+
// End of file
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/stub/inc/videodatacontainer.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/stub/inc/videodatacontainer.h Wed Aug 18 09:50:14 2010 +0300
@@ -74,7 +74,7 @@
* object is not found from wanted index
*
*/
- CMPXMedia* fromIndex(int index) const;
+ CMPXMedia* fromIndex(const int &index) const;
/**
* Returns an index of id.
@@ -83,7 +83,7 @@
*
* @return int index of item or -1 if item with provided id is not found
*/
- int indexOfId(const TMPXItemId &id) const;
+ const int& indexOfId(const TMPXItemId &id) const;
/**
* Returns id of item from provided index
@@ -92,7 +92,7 @@
*
* @return id of item or invalid TMPXItemId if item is not found from provided index
*/
- TMPXItemId idFromIndex(int index) const;
+ const TMPXItemId& idFromIndex(const int &index) const;
/**
* returns count of items
@@ -108,7 +108,7 @@
* @param inteIndex index of item
* @return TMPXItemId id of the item marked as removed
*/
- TMPXItemId markItemRemoved(const int &itemIndex);
+ const TMPXItemId markItemRemoved(const int &itemIndex);
/**
* Method removes provided items from mRemovedMedia
@@ -133,12 +133,12 @@
*
* @param itemId id of item to be returned
*/
- CMPXMedia* getRemovedMedia(TMPXItemId itemId);
+ CMPXMedia* getRemovedMedia(TMPXItemId &itemId);
/**
* decrements indexes of items after provided index by one.
*/
- void decHashIndexesAfter(int fromIndex);
+ void decHashIndexesAfter(const int &fromIndex);
public: // data
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/stub/inc/videolistdatamodel.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/stub/inc/videolistdatamodel.h Wed Aug 18 09:50:14 2010 +0300
@@ -54,12 +54,22 @@
/**
* dummy signal
*/
+ void albumListReady();
+
+ /**
+ * dummy signal
+ */
void modelChanged();
/**
* dummy signal
*/
void albumChanged();
+
+ /**
+ * dummy signal
+ */
+ void fullVideoDetailsReady(QVariant &);
public: // from QAbstractItemModel
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/stub/inc/videothumbnaildata.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/stub/inc/videothumbnaildata.h Wed Aug 18 09:50:14 2010 +0300
@@ -153,7 +153,7 @@
* @param mediaId: id of the video whose thumbnail is ready.
*
*/
- void thumbnailsFetched( QList<TMPXItemId> mediaId );
+ void thumbnailsFetched( QList<TMPXItemId>& mediaId );
private:
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/stub/src/videodatacontainer.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/stub/src/videodatacontainer.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -19,6 +19,9 @@
#include "videodatacontainer.h"
#include "videocollectionutils.h"
+const TMPXItemId INVALID_ID = TMPXItemId::InvalidId();
+const int INVALID_INDEX = -1;
+
/**
* global qHash function required fo creating hash values for TMPXItemId -keys
*/
@@ -87,7 +90,7 @@
mMediaData.erase(removeIter);
}
-void VideoDataContainer::decHashIndexesAfter(int fromIndex)
+void VideoDataContainer::decHashIndexesAfter(const int &fromIndex)
{
int count = mMediaIds.count();
QMultiHash<TMPXItemId, QPair<int, CMPXMedia*> >::iterator hashIter;
@@ -129,7 +132,7 @@
// fromIndex
// -----------------------------------------------------------------------------
//
-CMPXMedia* VideoDataContainer::fromIndex(int index) const
+CMPXMedia* VideoDataContainer::fromIndex(const int &index) const
{
if(index >= 0 && index < mMediaIds.count() && mMediaData.contains(mMediaIds[index]))
{
@@ -143,27 +146,27 @@
// indexOfId
// -----------------------------------------------------------------------------
//
-int VideoDataContainer::indexOfId(const TMPXItemId &id) const
+const int& VideoDataContainer::indexOfId(const TMPXItemId &id) const
{
QMultiHash<TMPXItemId, QPair<int, CMPXMedia*> >::const_iterator iter = mMediaData.find(id);
if(iter != mMediaData.constEnd())
{
return iter->first;
}
- return -1;
+ return INVALID_INDEX;
}
// -----------------------------------------------------------------------------
// idFromIndex
// -----------------------------------------------------------------------------
//
-TMPXItemId VideoDataContainer::idFromIndex(int index) const
+TMPXItemId& VideoDataContainer::idFromIndex(const int &index) const
{
if(index >= 0 && index < mMediaIds.count())
{
return mMediaIds[index];
}
- return TMPXItemId::InvalidId();
+ return INVALID_ID;
}
// -----------------------------------------------------------------------------
@@ -179,7 +182,7 @@
// markItemsRemoved
// -----------------------------------------------------------------------------
//
-TMPXItemId VideoDataContainer::markItemRemoved(const int &itemIndex)
+const TMPXItemId VideoDataContainer::markItemRemoved(const int &itemIndex)
{
// for all provided indexes:
// - get item address from mMediaData
@@ -283,7 +286,7 @@
// getRemovedMedia
// -----------------------------------------------------------------------------
//
-CMPXMedia* VideoDataContainer::getRemovedMedia(TMPXItemId itemId)
+CMPXMedia* VideoDataContainer::getRemovedMedia(TMPXItemId &itemId)
{
QHash<TMPXItemId, CMPXMedia*>::const_iterator itemIter =
mRemovedMedia.constFind(itemId);
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/testvideomodel_p.pro Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/testvideomodel_p.pro Wed Aug 18 09:50:14 2010 +0300
@@ -22,7 +22,7 @@
symbian_test
LIBS += -lmpxcommon.dll -lflogger.dll -lestor.dll \
- -lfbscli.dll -lbitgdi.dll -lgdi.dll
+ -lfbscli.dll -lbitgdi.dll -lgdi.dll -lxqutils.dll
# Input
HEADERS += stub/inc/metadatasignalspy.h \
--- a/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/inc/testvideosortfilterproxymodel.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/inc/testvideosortfilterproxymodel.h Wed Aug 18 09:50:14 2010 +0300
@@ -252,15 +252,11 @@
void testSetAlbumInUse();
/**
- * tests renameAlbum
+ * tests renameItem
*/
- void testRenameAlbum();
+ void testRenameItem();
- /**
- * tests itemModifiedSlot
- */
- void testItemModifiedSlot();
-
+
private:
/**
--- a/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/src/testvideosortfilterproxymodel.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/src/testvideosortfilterproxymodel.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -165,6 +165,7 @@
//
void TestVideoSortFilterProxyModel::testDeleteItems()
{
+ VideoThumbnailData::mEnableBackgroundThumbnailFetchingCallCount = 0;
VideoCollectionClient::mFailStartOpen = false;
QVERIFY(mTestObject->initialize(mStubModel) == 0);
QVERIFY(mTestObject->open(VideoCollectionCommon::ELevelVideos) == 0);
@@ -198,7 +199,11 @@
QModelIndexList emptyList;
VideoThumbnailData::mStartBackgroundFetchingCallCount = 0;
QVERIFY(mTestObject->deleteItems(emptyList) == 0);
+ QCOMPARE(VideoThumbnailData::mEnableBackgroundThumbnailFetchingCallCount, 2);
+ QVERIFY(VideoThumbnailData::mBackgroundThumbnailFetchingEnabled == true);
QVERIFY(mTestObject->deleteItems(list) == 0);
+ QCOMPARE(VideoThumbnailData::mEnableBackgroundThumbnailFetchingCallCount, 4);
+ QVERIFY(VideoThumbnailData::mBackgroundThumbnailFetchingEnabled == true);
QVERIFY(mStubModel->mLastDeletedIndexRow == 0);
QVERIFY(VideoThumbnailData::mStartBackgroundFetchingCallCount == 2);
}
@@ -851,8 +856,8 @@
// need to wait for awhile to make sure zero-counter gets
// processing time.
QTest::qWait(500);
- QCOMPARE(spyAboutToChange.count(), 2); // 2 times because also the setSortRole causes this signal.
- QCOMPARE(spyChanged.count(), 2); // 2 times because also the setSortRole causes this signal.
+ QCOMPARE(spyAboutToChange.count(), 1);
+ QCOMPARE(spyChanged.count(), 1);
QCOMPARE(mTestObject->sortRole(), (int)VideoCollectionCommon::KeyTitle);
QCOMPARE(mTestObject->sortOrder(), Qt::AscendingOrder);
QVERIFY(VideoThumbnailData::mStartBackgroundFetchingCallCount == 1);
@@ -1274,18 +1279,25 @@
TMPXItemId albumId(1,2);
QList<TMPXItemId> items;
items.append(TMPXItemId(1,0));
-
+ VideoThumbnailData::mEnableBackgroundThumbnailFetchingCallCount = 0;
// no model
+
QVERIFY(mTestObject->removeItemsFromAlbum(albumId, items) == -1);
+ QCOMPARE(VideoThumbnailData::mEnableBackgroundThumbnailFetchingCallCount, 2);
+ QVERIFY(VideoThumbnailData::mBackgroundThumbnailFetchingEnabled == true);
mTestObject->initialize(mStubModel);
// model returns < 0
VideoListDataModel::mRemoveFrAlbumReturn = -1;
QVERIFY(mTestObject->removeItemsFromAlbum(albumId, items) == -1);
+ QCOMPARE(VideoThumbnailData::mEnableBackgroundThumbnailFetchingCallCount, 4);
+ QVERIFY(VideoThumbnailData::mBackgroundThumbnailFetchingEnabled == true);
VideoListDataModel::mRemoveFrAlbumReturn = 11;
// "succeed"
QVERIFY(mTestObject->removeItemsFromAlbum(albumId, items) == 0);
+ QCOMPARE(VideoThumbnailData::mEnableBackgroundThumbnailFetchingCallCount, 6);
+ QVERIFY(VideoThumbnailData::mBackgroundThumbnailFetchingEnabled == true);
}
// ---------------------------------------------------------------------------
@@ -1486,10 +1498,10 @@
}
// ---------------------------------------------------------------------------
-// testRenameAlbum
+// testRenameItem
// ---------------------------------------------------------------------------
//
-void TestVideoSortFilterProxyModel::testRenameAlbum()
+void TestVideoSortFilterProxyModel::testRenameItem()
{
delete mTestObject;
mTestObject = new FilterProxyTester(VideoCollectionCommon::EModelTypeAllVideos);
@@ -1497,42 +1509,11 @@
// Not initialized.
TMPXItemId id = TMPXItemId::InvalidId();
QString name = "";
- QVERIFY(mTestObject->renameAlbum(id, name) == -1);
+ QVERIFY(mTestObject->renameItem(id, name) == -1);
// Initialized.
mTestObject->initialize(mStubModel);
- QVERIFY(mTestObject->renameAlbum(id, name) == 0);
-}
-
-// ---------------------------------------------------------------------------
-// testItemModifiedSlot
-// ---------------------------------------------------------------------------
-//
-void TestVideoSortFilterProxyModel::testItemModifiedSlot()
-{
- connect(this, SIGNAL(testSignalMpxId(const TMPXItemId &)), mTestObject, SLOT(itemModifiedSlot(const TMPXItemId &)));
-
- TMPXItemId id = TMPXItemId::InvalidId();
- mTestObject->initialize(mStubModel);
-
- // mType wrong
- mTestObject->mType = VideoCollectionCommon::EModelTypeAllVideos;
- emit testSignalMpxId(id);
-
- // invalid id
- mTestObject->mType = VideoCollectionCommon::EModelTypeCollections;
-
- emit testSignalMpxId(id);
-
- // item is album
- id = TMPXItemId(0, KVcxMvcMediaTypeAlbum);
- emit testSignalMpxId(id);
-
- // item is category
- id = TMPXItemId(0, KVcxMvcMediaTypeCategory);
- emit testSignalMpxId(id);
-
- disconnect(this, SIGNAL(testSignalMpxId(const TMPXItemId &)), mTestObject, SLOT(itemModifiedSlot(const TMPXItemId &)));
+ QVERIFY(mTestObject->renameItem(id, name) == 0);
}
// End of file
--- a/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/stub/inc/videocollectionclient.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/stub/inc/videocollectionclient.h Wed Aug 18 09:50:14 2010 +0300
@@ -110,9 +110,9 @@
int back();
/**
- * returns mRenameAlbumReturnValue
+ * returns mRenameItemReturnValue
*/
- int renameAlbum(const TMPXItemId &albumId, const QString &newTitle);
+ int renameItem(const TMPXItemId &itemId, const QString &newTitle);
public:
static bool mFailInit;
@@ -127,7 +127,7 @@
static QString mAddNewCollectionName;
static QString mAddNewCollectionThumb;
static QList<TMPXItemId> mAddNewCollectionIds;
- static int mRenameAlbumReturnValue;
+ static int mRenameItemReturnValue;
static int mBackReturnValue;
private:
--- a/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/stub/inc/videothumbnaildata.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/stub/inc/videothumbnaildata.h Wed Aug 18 09:50:14 2010 +0300
@@ -93,6 +93,7 @@
~VideoThumbnailData();
public:
+ static int mEnableBackgroundThumbnailFetchingCallCount;
static int mStartFetchingThumbnailsCallCount;
static int mStartFetchingThumbnailsThumbnailCount;
static int mInstanceCallCount;
--- a/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/stub/src/videocollectionclient.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/stub/src/videocollectionclient.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -34,7 +34,7 @@
QString VideoCollectionClient::mAddNewCollectionName = QString();
QString VideoCollectionClient::mAddNewCollectionThumb = QString();
QList<TMPXItemId> VideoCollectionClient::mAddNewCollectionIds = QList<TMPXItemId>();
-int VideoCollectionClient::mRenameAlbumReturnValue = 0;
+int VideoCollectionClient::mRenameItemReturnValue = 0;
int VideoCollectionClient::mBackReturnValue = 0;
// -----------------------------------------------------------------------------
@@ -158,12 +158,12 @@
}
// -----------------------------------------------------------------------------
-// renameAlbum
+// renameItem
// -----------------------------------------------------------------------------
//
-int VideoCollectionClient::renameAlbum(const TMPXItemId &albumId, const QString &newTitle)
+int VideoCollectionClient::renameItem(const TMPXItemId &itemId, const QString &newTitle)
{
- Q_UNUSED(albumId);
+ Q_UNUSED(itemId);
Q_UNUSED(newTitle);
- return mRenameAlbumReturnValue;
+ return mRenameItemReturnValue;
}
--- a/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/stub/src/videothumbnaildata.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/stub/src/videothumbnaildata.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -24,6 +24,7 @@
#include "videothumbnaildata.h"
+int VideoThumbnailData::mEnableBackgroundThumbnailFetchingCallCount = 0;
int VideoThumbnailData::mStartFetchingThumbnailsCallCount = 0;
int VideoThumbnailData::mStartFetchingThumbnailsThumbnailCount = 0;
int VideoThumbnailData::mInstanceCallCount = 0;
@@ -78,6 +79,7 @@
void VideoThumbnailData::enableBackgroundFetching(bool enable)
{
mBackgroundThumbnailFetchingEnabled = enable;
+ mEnableBackgroundThumbnailFetchingCallCount++;
}
// -----------------------------------------------------------------------------
--- a/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata/inc/testvideothumbnaildata.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata/inc/testvideothumbnaildata.h Wed Aug 18 09:50:14 2010 +0300
@@ -42,6 +42,7 @@
void testFreeThumbnailData();
void testStartBackgroundFetching();
void testEnableThumbnailCreation();
+ void testBackgroundFetchingEnabled();
signals:
--- a/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata/src/testvideothumbnaildata.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata/src/testvideothumbnaildata.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -163,4 +163,20 @@
QCOMPARE(VideoThumbnailDataPrivate::mEnableThumbnailCreationCallCount, 1);
}
+// ---------------------------------------------------------------------------
+// testEnableThumbnailCreation
+// ---------------------------------------------------------------------------
+//
+void TestVideoThumbnailData::testBackgroundFetchingEnabled()
+{
+ VideoThumbnailData &instance = VideoThumbnailData::instance();
+ QCOMPARE(VideoThumbnailDataPrivate::mConstructCallCount, 1);
+
+ VideoThumbnailDataPrivate::mBackgroundThumbnailFetchingEnabled = true;
+ QVERIFY(instance.backgroundFetchingEnabled() == VideoThumbnailDataPrivate::mBackgroundThumbnailFetchingEnabled);
+
+ VideoThumbnailDataPrivate::mBackgroundThumbnailFetchingEnabled = false;
+ QVERIFY(instance.backgroundFetchingEnabled() == VideoThumbnailDataPrivate::mBackgroundThumbnailFetchingEnabled);
+}
+
// End of file
--- a/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata/stub/inc/videothumbnaildata_p.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata/stub/inc/videothumbnaildata_p.h Wed Aug 18 09:50:14 2010 +0300
@@ -136,6 +136,13 @@
*/
void enableThumbnailCreation(bool enable);
+ /**
+ * Returns background fetching enabled status.
+ *
+ * @return bool: true if background fetching is enabled, otherwise false.
+ */
+ bool backgroundFetchingEnabled();
+
signals:
/**
@@ -144,7 +151,7 @@
* @param mediaIds: media ids of the videos whose thumbnail is ready.
*
*/
- void thumbnailsFetched(QList<TMPXItemId> mediaIds);
+ void thumbnailsFetched(QList<TMPXItemId>& mediaIds);
public: // Data
@@ -155,7 +162,7 @@
static int mGetThumbnailCallCount;
static int mRemoveThumbnailCallCount;
static int mFreeThumbnailDataCallCount;
- static int mBackgroundThumbnailFetchingEnabled;
+ static bool mBackgroundThumbnailFetchingEnabled;
static int mStartBackgroundFetchingCallCount;
static int mEnableThumbnailCreationCallCount;
};
--- a/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata/stub/src/videothumbnaildata_p.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata/stub/src/videothumbnaildata_p.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -29,7 +29,7 @@
int VideoThumbnailDataPrivate::mStartFetchingThumbnailCallCount = 0;
int VideoThumbnailDataPrivate::mGetThumbnailCallCount = 0;
int VideoThumbnailDataPrivate::mRemoveThumbnailCallCount = 0;
-int VideoThumbnailDataPrivate::mBackgroundThumbnailFetchingEnabled = true;
+bool VideoThumbnailDataPrivate::mBackgroundThumbnailFetchingEnabled = true;
int VideoThumbnailDataPrivate::mFreeThumbnailDataCallCount = 0;
int VideoThumbnailDataPrivate::mStartBackgroundFetchingCallCount = 0;
int VideoThumbnailDataPrivate::mEnableThumbnailCreationCallCount = 0;
@@ -130,4 +130,14 @@
{
mEnableThumbnailCreationCallCount++;
}
+
+// -----------------------------------------------------------------------------
+// VideoThumbnailData::enableThumbnailCreation()
+// -----------------------------------------------------------------------------
+//
+bool VideoThumbnailDataPrivate::backgroundFetchingEnabled()
+{
+ return mBackgroundThumbnailFetchingEnabled;
+}
+
// End of file
--- a/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata_p/inc/testvideothumbnaildata_p.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata_p/inc/testvideothumbnaildata_p.h Wed Aug 18 09:50:14 2010 +0300
@@ -49,9 +49,9 @@
void testThumbnailReadySlot();
void testDefaultThumbnail();
void testRemoveThumbnail();
- void testModelChangedSlot();
void testStartBackgroundFetching();
void testEnableBackgroundFetching();
+ void testBackgroundFetchingEnabled();
void testFreeThumbnailData();
void testAllThumbnailsFetchedSlot();
void testEnableThumbnailCreation();
--- a/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata_p/inc/videothumbnaildatatester.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata_p/inc/videothumbnaildatatester.h Wed Aug 18 09:50:14 2010 +0300
@@ -55,11 +55,6 @@
void emitReportThumbnailsReady();
/**
- * Emits modelChanged signal to itself.
- */
- void emitModelChanged();
-
- /**
* Emits aboutToQuit signal to itself.
*/
void emitAboutToQuit();
--- a/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata_p/src/testvideothumbnaildata_p.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata_p/src/testvideothumbnaildata_p.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -123,7 +123,8 @@
VideoSortFilterProxyModel::mReturnInvalidIndexes = false;
VideoSortFilterProxyModel::mRowCountCallCount = 0;
- qRegisterMetaType<QList<TMPXItemId> >("QList<TMPXItemId>");
+
+ qRegisterMetaType<QList<TMPXItemId> >("QList<TMPXItemId>& ");
}
// ---------------------------------------------------------------------------
@@ -249,7 +250,7 @@
init();
VideoSortFilterProxyModel* backupProxyModel = mTestObject->mCurrentModel;
mTestObject->mCurrentModel = NULL;
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId> &)));
QCOMPARE(mTestObject->startFetchingThumbnail(TMPXItemId(0, 0), TB_PRIORITY), -1);
QVERIFY(checkThumbnailReadyCount(spy, 0));
delete spy;
@@ -261,7 +262,7 @@
init();
VideoThumbnailFetcher* backup = mTestObject->mThumbnailFetcher;
mTestObject->mThumbnailFetcher = NULL;
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId> &)));
QCOMPARE(mTestObject->startFetchingThumbnail(TMPXItemId(0, 0), TB_PRIORITY), -1);
QVERIFY(checkThumbnailReadyCount(spy, 0));
delete spy;
@@ -271,7 +272,7 @@
// Thumbnail has been already fetched.
init();
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId> &)));
mTestObject->mThumbnailData.insert(TMPXItemId(10, 0), 0);
QCOMPARE(mTestObject->startFetchingThumbnail(TMPXItemId(10, 0), TB_PRIORITY), 0);
QVERIFY(checkThumbnailReadyCount(spy, 0));
@@ -283,7 +284,7 @@
init();
VideoThumbnailFetcher::mAddFetchFails = true;
mTestObject->mCurrentModel->appendData("testfile");
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId> &)));
QCOMPARE(mTestObject->startFetchingThumbnail(TMPXItemId(0, 0), TB_PRIORITY), 0);
QVERIFY(checkThumbnailReadyCount(spy, 0));
QCOMPARE(VideoThumbnailFetcher::mRequests.count(), 0);
@@ -293,7 +294,7 @@
// Filename is empty.
init();
mTestObject->mCurrentModel->appendData("");
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId> &)));
QCOMPARE(mTestObject->startFetchingThumbnail(TMPXItemId(0, 0), TB_PRIORITY), 0);
QVERIFY(checkThumbnailReadyCount(spy, 0));
QCOMPARE(VideoThumbnailFetcher::mRequests.count(), 0);
@@ -303,7 +304,7 @@
// Filename is null.
init();
mTestObject->mCurrentModel->appendData(QString());
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId> &)));
QCOMPARE(mTestObject->startFetchingThumbnail(TMPXItemId(0, 0), TB_PRIORITY), 0);
QVERIFY(checkThumbnailReadyCount(spy, 0));
QCOMPARE(VideoThumbnailFetcher::mRequests.count(), 0);
@@ -316,7 +317,7 @@
init();
QString fileName("video.mp4");
mTestObject->mCurrentModel->appendData(fileName);
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId> &)));
QCOMPARE(mTestObject->startFetchingThumbnail(TMPXItemId(0, 0), TB_PRIORITY), 0);
QVERIFY(checkThumbnailReadyCount(spy, 0));
QCOMPARE(VideoThumbnailFetcher::mRequests.count(), 1);
@@ -330,7 +331,7 @@
init();
mTestObject->mCurrentModel->appendData(fileName);
VideoThumbnailFetcher::mRequests.insert(1, VideoThumbnailFetcher::TnRequest("test1", 0, -1, false));
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId> &)));
QCOMPARE(mTestObject->startFetchingThumbnail(TMPXItemId(0, 0), TB_PRIORITY), 0);
QVERIFY(checkThumbnailReadyCount(spy, 0));
QCOMPARE(VideoThumbnailFetcher::mRequests.count(), 1);
@@ -360,7 +361,7 @@
VideoSortFilterProxyModel* backupProxyModel = mTestObject->mCurrentModel;
mTestObject->mCurrentModel = NULL;
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId> &)));
QCOMPARE(mTestObject->startFetchingThumbnails(indexes,
BACKGROUND_FETCH_PRIORITY), -1);
QVERIFY(checkThumbnailReadyCount(spy, 0));
@@ -378,7 +379,7 @@
indexes.append(mTestObject->mCurrentModel->index(0, 0, QModelIndex()));
indexes.append(mTestObject->mCurrentModel->index(10, 0, QModelIndex()));
indexes.append(mTestObject->mCurrentModel->index(20, 0, QModelIndex()));
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId> &)));
QCOMPARE(mTestObject->startFetchingThumbnails(indexes,
BACKGROUND_FETCH_PRIORITY), -1);
QVERIFY(checkThumbnailReadyCount(spy, 0));
@@ -391,7 +392,7 @@
// Tests when parameter array indexes is empty.
init();
indexes.clear();
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId> &)));
QCOMPARE(mTestObject->startFetchingThumbnails(indexes,
BACKGROUND_FETCH_PRIORITY), 0);
QVERIFY(checkThumbnailReadyCount(spy, 0));
@@ -409,7 +410,7 @@
VideoThumbnailFetcher::mRequests[40] = VideoThumbnailFetcher::TnRequest("test2", 0, -1, false);
VideoThumbnailFetcher::mRequests[30] = VideoThumbnailFetcher::TnRequest("test3", 0, -1, false);
indexes.append(mTestObject->mCurrentModel->index(0, 0, QModelIndex()));
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId> &)));
QCOMPARE(mTestObject->startFetchingThumbnails(indexes,
BACKGROUND_FETCH_PRIORITY), 1);
QVERIFY(checkThumbnailReadyCount(spy, 0));
@@ -448,7 +449,7 @@
indexes.append(mTestObject->mCurrentModel->index(2, 0, QModelIndex()));
indexes.append(mTestObject->mCurrentModel->index(3, 0, QModelIndex()));
indexes.append(mTestObject->mCurrentModel->index(4, 0, QModelIndex()));
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId> &)));
QCOMPARE(mTestObject->startFetchingThumbnails(indexes,
BACKGROUND_FETCH_PRIORITY), 3);
QVERIFY(checkThumbnailReadyCount(spy, 0));
@@ -482,7 +483,7 @@
init();
VideoSortFilterProxyModel* backupProxyModel = mTestObject->mCurrentModel;
mTestObject->mCurrentModel = NULL;
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId> &)));
mTestObject->emitDoBackgroundFetching();
QVERIFY(checkThumbnailReadyCount(spy, 0));
delete spy;
@@ -496,7 +497,7 @@
init();
VideoThumbnailFetcher* backup = mTestObject->mThumbnailFetcher;
mTestObject->mThumbnailFetcher = NULL;
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId> &)));
mTestObject->emitDoBackgroundFetching();
QVERIFY(checkThumbnailReadyCount(spy, 0));
delete spy;
@@ -511,7 +512,7 @@
{
mTestObject->mCurrentModel->appendData(QString("file") + QString::number(i));
}
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId> &)));
mTestObject->emitDoBackgroundFetching();
QVERIFY(checkThumbnailReadyCount(spy, 0));
QCOMPARE(VideoThumbnailFetcher::mRequests.count(), THUMBNAIL_BACKGROUND_FETCH_AMOUNT/2);
@@ -559,7 +560,7 @@
{
mTestObject->mCurrentModel->appendData(QString("file") + QString::number(i));
}
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId> &)));
mTestObject->mCurrentFetchIndex = THUMBNAIL_BACKGROUND_FETCH_AMOUNT/2*-1;
mTestObject->emitDoBackgroundFetching();
QVERIFY(checkThumbnailReadyCount(spy, 0));
@@ -575,7 +576,7 @@
{
mTestObject->mCurrentModel->appendData(QString("file") + QString::number(i));
}
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId> &)));
mTestObject->mCurrentFetchIndex = THUMBNAIL_BACKGROUND_FETCH_AMOUNT*2;
mTestObject->emitDoBackgroundFetching();
QVERIFY(checkThumbnailReadyCount(spy, 0));
@@ -591,7 +592,7 @@
{
mTestObject->mCurrentModel->appendData(QString("file") + QString::number(i));
}
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId> &)));
mTestObject->mCurrentFetchIndex = THUMBNAIL_BACKGROUND_FETCH_AMOUNT + THUMBNAIL_BACKGROUND_FETCH_AMOUNT/2;
mTestObject->emitDoBackgroundFetching();
QVERIFY(checkThumbnailReadyCount(spy, 0));
@@ -603,7 +604,7 @@
// no items and fetch index -5
init();
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId> &)));
mTestObject->mCurrentFetchIndex = -5;
mTestObject->emitDoBackgroundFetching();
QVERIFY(checkThumbnailReadyCount(spy, 0));
@@ -619,7 +620,7 @@
{
mTestObject->mCurrentModel->appendData(QString("file") + QString::number(i));
}
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>&)));
VideoSortFilterProxyModel::mReturnInvalidIndexes = true;
mTestObject->mCurrentFetchIndex = THUMBNAIL_BACKGROUND_FETCH_AMOUNT/2;
mTestObject->emitDoBackgroundFetching();
@@ -788,35 +789,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
// ---------------------------------------------------------------------------
//
@@ -884,6 +856,22 @@
}
// ---------------------------------------------------------------------------
+// testBackgroundFetchingEnabled
+// ---------------------------------------------------------------------------
+//
+void TestVideoThumbnailData_p::testBackgroundFetchingEnabled()
+{
+ init();
+
+ mTestObject->enableBackgroundFetching(true);
+ QVERIFY(mTestObject->backgroundFetchingEnabled() == true);
+
+ mTestObject->enableBackgroundFetching(false);
+ QVERIFY(mTestObject->backgroundFetchingEnabled() == false);
+
+ cleanup();
+}
+// ---------------------------------------------------------------------------
// testFreeThumbnailData
// ---------------------------------------------------------------------------
//
--- a/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata_p/src/videothumbnaildatatester.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata_p/src/videothumbnaildatatester.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -29,7 +29,6 @@
VideoThumbnailDataTester::VideoThumbnailDataTester()
{
connect(this, SIGNAL(doBackgroundFetchingSignal()), this, SLOT(doBackgroundFetching()));
- connect(this, SIGNAL(modelChangedSignal()), this, SLOT(modelChangedSlot()));
connect(this, SIGNAL(reportThumbnailsReadySignal()), this, SLOT(reportThumbnailsReadySlot()));
connect(this, SIGNAL(aboutToQuitSignal()), this, SLOT(aboutToQuitSlot()));
}
@@ -41,7 +40,6 @@
VideoThumbnailDataTester::~VideoThumbnailDataTester()
{
disconnect(this, SIGNAL(doBackgroundFetchingSignal()), this, SLOT(doBackgroundFetching()));
- disconnect(this, SIGNAL(modelChangedSignal()), this, SLOT(modelChangedSlot()));
disconnect(this, SIGNAL(reportThumbnailsReadySignal()), this, SLOT(reportThumbnailsReadySlot()));
disconnect(this, SIGNAL(aboutToQuitSignal()), this, SLOT(aboutToQuitSlot()));
}
@@ -65,15 +63,6 @@
}
// -----------------------------------------------------------------------------
-// VideoThumbnailDataTester::emitModelChanged()
-// -----------------------------------------------------------------------------
-//
-void VideoThumbnailDataTester::emitModelChanged()
-{
- emit modelChangedSignal();
-}
-
-// -----------------------------------------------------------------------------
// VideoThumbnailDataTester::emitAboutToQuit()
// -----------------------------------------------------------------------------
//
--- a/videocollection/videocollectionwrapper/videocollectionwrapper.pro Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videocollectionwrapper/videocollectionwrapper.pro Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videofiledetailsview/data/videofiledetails.qrc Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videofiledetailsview/inc/videofiledetailsviewplugin.h Wed Aug 18 09:50:14 2010 +0300
@@ -34,6 +34,7 @@
class VideoServices;
class VideoCollectionWrapper;
class VideoDetailsLabel;
+class ShareUi;
class VideoFileDetailsViewPlugin : public MpxViewPlugin
{
@@ -121,7 +122,7 @@
/**
* Signaled by HbMessageBox when it's closed.
*/
- void deleteVideoDialogFinished(HbAction *action);
+ void deleteVideoDialogFinished(int action);
private slots:
@@ -297,6 +298,11 @@
* Play icon with transparent background.
*/
QPixmap mPlayIcon;
+
+ /**
+ * Share ui object for handling of sharing videos
+ */
+ ShareUi *mShareUi;
};
#endif // VIDEOFILEDETAILSPLUGIN_H
--- a/videocollection/videofiledetailsview/src/videofiledetailsviewplugin.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videofiledetailsview/src/videofiledetailsviewplugin.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 76.1.1 %
+// Version : %version: 76.1.7 %
// INCLUDE FILES
#include <qcoreapplication.h>
@@ -32,6 +32,8 @@
#include <hblistwidget.h>
#include <hblistwidgetitem.h>
#include <hblistviewitem.h>
+#include <hbparameterlengthlimiter.h>
+#include <hbtextitem.h>
#include <cmath>
#include <thumbnailmanager_qt.h>
#include <shareui.h>
@@ -87,6 +89,7 @@
, mThumbLabel( 0 )
, mThumbnailManager( 0 )
, mCollectionWrapper( VideoCollectionWrapper::instance() )
+ , mShareUi(0)
{
FUNC_LOG;
}
@@ -113,10 +116,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 +128,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 +179,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 +214,7 @@
// Create navigation keys.
mNavKeyBackAction = new HbAction(Hb::BackNaviAction);
mNavKeyBackAction->setObjectName(VIDEO_DETAILS_OBJECT_NAME_NAVKEY_BACK);
-
+
if (!mThumbnailManager)
{
mThumbnailManager = new ThumbnailManager();
@@ -219,14 +222,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 +253,10 @@
delete mNavKeyBackAction;
mNavKeyBackAction = 0;
-
+
delete mThumbnailManager;
mThumbnailManager = 0;
-
+
disconnect();
mLoader.reset();
}
@@ -272,7 +275,7 @@
HbView *currentView = mainWnd->currentView();
if(currentView && mNavKeyBackAction)
{
- if (connect(mNavKeyBackAction, SIGNAL(triggered()), this, SLOT(back())))
+ if (connect(mNavKeyBackAction, SIGNAL(triggered()), this, SLOT(back())), Qt::UniqueConnection)
{
currentView->setNavigationAction(mNavKeyBackAction);
}
@@ -314,7 +317,7 @@
if (mIsService && mVideoServices)
{
service = mVideoServices->currentService();
-
+
HbMainWindow *mainWnd = hbInstance->allMainWindows().value(0);
mainWnd->currentView()->setTitle(mVideoServices->contextTitle());
}
@@ -325,35 +328,40 @@
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&)));
+ connect(button, SIGNAL(clicked(bool)), this, SLOT(getFileUri()), Qt::UniqueConnection);
+ connect(this, SIGNAL(fileUri(const QString&)), mVideoServices, SLOT(itemSelected(const QString&)), Qt::UniqueConnection);
}
else
{
- connect(button, SIGNAL(clicked(bool)), this, SLOT(sendVideoSlot()));
- button->setText(hbTrId("txt_videos_opt_share"));
+ connect(button, SIGNAL(clicked(bool)), this, SLOT(sendVideoSlot()), Qt::UniqueConnection);
+
+ HbIcon icon = HbIcon("qtg_mono_share");
+ button->setIcon(icon);
}
connect(mainWnd,
SIGNAL(orientationChanged(Qt::Orientation)),
- this, SLOT(orientationChange(Qt::Orientation)));
+ this, SLOT(orientationChange(Qt::Orientation)),
+ Qt::UniqueConnection);
connect(&mCollectionWrapper,
SIGNAL(asyncStatus(int, QVariant&)),
- this, SLOT(handleErrorSlot(int, QVariant&)));
+ this, SLOT(handleErrorSlot(int, QVariant&)),
+ Qt::UniqueConnection);
// setup title size in order for animation to be enabled if needed
mTitleAnim->setMinimumWidth(hbInstance->allMainWindows().value(0)->width()-50);
@@ -414,6 +422,8 @@
disconnect(button, SIGNAL(clicked(bool)), this, SLOT(sendVideoSlot()));
}
}
+ delete mShareUi;
+ mShareUi = 0;
}
// ---------------------------------------------------------------------------
@@ -494,14 +504,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();
@@ -514,10 +524,20 @@
if (metadata.contains(VideoDetailLabelKeys[i]))
{
HbListWidgetItem* listWidgetItem = new HbListWidgetItem();
- listWidgetItem->setEnabled(false);
listWidgetItem->setText( hbTrId(VideoDetailLabels[i]));
listWidgetItem->setSecondaryText(metadata[VideoDetailLabelKeys[i]].toString());
list->addItem(listWidgetItem);
+
+ // following is required to change wrapping-mode for the second row
+ HbListViewItem *viewItem = static_cast<HbListViewItem*>(list->viewItem(list->row(listWidgetItem)));
+ if(viewItem)
+ {
+ HbTextItem *secondLine = static_cast<HbTextItem*>(viewItem->primitive("text-2"));
+ if(secondLine)
+ {
+ secondLine->setTextWrapping(Hb::TextWrapAnywhere);
+ }
+ }
}
}
@@ -564,18 +584,20 @@
void VideoFileDetailsViewPlugin::sendVideoSlot()
{
FUNC_LOG;
-// HbMessageBox::information(tr("Not implemented yet"));
-
+
if(mVideoId != TMPXItemId::InvalidId())
{
- ShareUi dialog;
+ if(!mShareUi)
+ {
+ mShareUi = new ShareUi();
+ }
QModelIndex modelIndex = mModel->indexOfId(mVideoId);
QVariant variant = mModel->data(modelIndex, VideoCollectionCommon::KeyFilePath);
if(variant.isValid())
{
QStringList fileList;
fileList.append(variant.toString());
- dialog.send(fileList, true);
+ mShareUi->send(fileList, true);
}
}
}
@@ -594,13 +616,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 +632,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 +688,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 +712,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 +738,7 @@
}
int difference(0);
- QRect rect = mThumbLabel->rect().toRect();
+ QRect rect = thumbWidget->rect().toRect();
if(sourceImage.width() > size.width())
{
@@ -787,7 +816,7 @@
{
return mPlayIcon;
}
-
+
// Compose the icon.
HbIcon play = HbIcon("qtg_mono_play");
HbIcon topLeft = HbIcon("qtg_fr_popup_trans_tl");
@@ -802,54 +831,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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videofiledetailsview/tsrc/testplugin/src/testvideofiledetails.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -31,6 +31,7 @@
#include <hbapplication.h>
#include <hbmarqueeitem.h>
#include <hbstackedwidget.h>
+#include <hbparameterlengthlimiter.h>
#include "videodetailslabel.h"
#include "hbmessagebox.h"
@@ -83,7 +84,7 @@
//
void TestVideoFileDetails::cleanupTestCase()
{
- disconnect(this, SIGNAL(shortDetailsReady(int)), mDummyModel, SIGNAL(shortDetailsReady(int)));
+ disconnect(this, SIGNAL(shortDetailsReady(TMPXItemId)), mDummyModel, SIGNAL(shortDetailsReady(TMPXItemId)));
disconnect(this, SIGNAL(fullDetailsReady(QVariant&)),mDummyModel, SIGNAL(fullVideoDetailsReady(QVariant&)));
disconnect(this, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)),
mDummyModel, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)));
@@ -483,24 +484,6 @@
QVERIFY( detail->text().contains(expected) );
}
- // for coverity sake, retest without star-rating
- variant = QVariant(createDummyMetadata());
- emit fullDetailsReady(variant);
-
- int ii = 0;
- for(int i = 0; i<detailCount; i++)
- {
- if(VideoCollectionCommon::VideoDetailLabelKeys[i] != VideoCollectionCommon::MetaKeyStarRating)
- {
- QString expected = tr(VideoCollectionCommon::VideoDetailLabels[i]).arg(
- VideoCollectionCommon::VideoDetailLabelKeys[i]);
- HbListWidgetItem* detail = list->item(ii);
- QVERIFY( detail != 0 );
- QVERIFY( detail->text().contains(expected) );
- }
- ++ii;
- }
-
cleanup();
}
@@ -548,7 +531,6 @@
//
void TestVideoFileDetails::testSendVideoSlot()
{
-// QFAIL("Feature not yet implemented!");
mDummyModel->reset();
init();
@@ -579,6 +561,10 @@
QCOMPARE( ShareUi::mFileList.count(), 1 );
QCOMPARE( ShareUi::mFileList.at(0), filePath );
+ mPlugin->deactivateView();
+
+ QVERIFY(!mPlugin->mShareUi);
+
cleanup();
}
@@ -623,14 +609,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 +625,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 +706,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 +719,6 @@
cleanup();
}
-
// ---------------------------------------------------------------------------
// Slot: test for the testThumbnailReadySlot
// ---------------------------------------------------------------------------
--- a/videocollection/videofiledetailsview/tsrc/testplugin/stub/inc/hbmessagebox.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videofiledetailsview/tsrc/testplugin/stub/inc/hbmessagebox.h Wed Aug 18 09:50:14 2010 +0300
@@ -28,6 +28,7 @@
class HbMessageBox : public QObject
{
Q_OBJECT
+
public:
enum MessageBoxType {
@@ -35,7 +36,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 +87,8 @@
mLatestTxt = text;
}
+ static void setStandardButtons(StandardButtons buttons);
+
QList<HbAction*> actions() const
{
return mActions;
@@ -86,7 +108,9 @@
signals:
- void finished(HbAction *action);
+ void finished(int);
};
+Q_DECLARE_OPERATORS_FOR_FLAGS(HbMessageBox::StandardButtons)
+
#endif // HBMESSAGEBOX_H
--- a/videocollection/videofiledetailsview/tsrc/testplugin/stub/inc/videocollectionwrapper.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videofiledetailsview/tsrc/testplugin/stub/inc/videocollectionwrapper.h Wed Aug 18 09:50:14 2010 +0300
@@ -76,7 +76,7 @@
signals:
- void error(int errorCode, QVariant &additional);
+ void asyncStatus(int errorCode, QVariant &additional);
private:
--- a/videocollection/videofiledetailsview/tsrc/testplugin/stub/src/hbmessagebox.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videofiledetailsview/tsrc/testplugin/stub/src/hbmessagebox.cpp Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videocollection/videofiledetailsview/videofiledetailsview.pro Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 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 Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 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 Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 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 Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,126 @@
+/*
+* 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#21 %
+
+
+
+// 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();
+ void handleAppBackground();
+ void handleAppForeground();
+
+ 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& string, 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 Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayback/videohelix/group/mpxvideohelixplayback.mmp Wed Aug 18 09:50:14 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/inc/mpxvideoplayerutility.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayback/videohelix/inc/mpxvideoplayerutility.h Wed Aug 18 09:50:14 2010 +0300
@@ -15,7 +15,8 @@
*
*/
-// Version : %version: 13 %
+
+// Version : %version: 14 %
#ifndef __MPXVIDEOPLAYERUTILITY__
@@ -103,16 +104,16 @@
void SetPlayVelocityL( TInt aVelocity );
void GetVideoLoadingProgressL( TInt& aPercentageProgress );
-
+
void GetFrameL();
//
// MMMFControllerEventMonitorObserver Implementation
//
void HandleEvent( const TMMFEvent& aEvent );
-
+
CFbsBitmap& GetBitmap();
-
+
void RunL();
void DoCancel();
@@ -124,7 +125,8 @@
TInt VideoSurfaceCreated();
TInt SurfaceParametersChanged();
- TInt RemoveSurface();
+ void RemoveSurface();
+ TInt RemoveSurfaceFromHelix( TSurfaceId aSurfaceId );
void SendSurfaceCommandL( TInt aCmd );
@@ -168,7 +170,7 @@
CMMFControllerEventMonitor* iControllerEventMonitor;
TBool iDirectScreenAccessAbort;
-
+
CFbsBitmap* iPosterFrameBitmap;
};
--- a/videoplayback/videohelix/src/mpxvideoplaybackcontroller.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayback/videohelix/src/mpxvideoplaybackcontroller.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -16,7 +16,7 @@
*/
-// Version : %version: 62 %
+// Version : %version: 65 %
//
@@ -544,7 +544,21 @@
case EPbCmdSetPosterFrame:
{
iState->HandleSetPosterFrame();
- break;
+ break;
+ }
+ case EPbCmdSurfaceRemovedFromWindow:
+ {
+ TSurfaceId surfaceId =
+ aCmd.ValueTObjectL<TSurfaceId>( KMPXMediaVideoDisplayTSurfaceId );
+
+ TInt error = iPlayer->RemoveSurfaceFromHelix( surfaceId );
+
+ if ( error != KErrNone )
+ {
+ MPX_TRAPD( err, iState->SendErrorToViewL( error ) );
+ }
+
+ break;
}
}
}
@@ -770,12 +784,7 @@
}
else if ( aEvent.iEventType == KMMFEventCategoryVideoRemoveSurface )
{
- TInt error = iPlayer->RemoveSurface();
-
- if ( error != KErrNone )
- {
- MPX_TRAPD( err, iState->SendErrorToViewL( error ) );
- }
+ iPlayer->RemoveSurface();
}
#endif // SYMBIAN_BUILD_GCE
else if ( aEvent.iEventType == KMMFEventCategoryVideoPlayerGeneralError )
@@ -868,7 +877,7 @@
_L("CMPXVideoPlaybackController::SetVolumeCenRepL()"),
_L("aVolume = %d"), aVolume );
- if ( iFileDetails && iFileDetails->iAudioEnabled )
+ if ( iFileDetails && iFileDetails->iAudioEnabled && !iAccessoryMonitor->IsTvOutConnected() )
{
TInt volume( 0 );
@@ -891,7 +900,7 @@
// For example, if we get 77, we need to save it as 70 in 10 volume steps
//
volume -= volume % iVolumeNormalizer;
-
+
MPX_DEBUG(
_L("CMPXVideoPlaybackController::SetVolumeCenRepL(): Setting volume = %d"), volume );
@@ -2522,15 +2531,15 @@
#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
-// ------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackController::IsViewActivated()
-// ------------------------------------------------------------------------------------------------
-//
-TBool CMPXVideoPlaybackController::IsViewActivated()
-{
- MPX_DEBUG(_L("CMPXVideoPlaybackController::IsViewActivated"));
- return iViewActivated;
-}
+// ------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackController::IsViewActivated()
+// ------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoPlaybackController::IsViewActivated()
+{
+ MPX_DEBUG(_L("CMPXVideoPlaybackController::IsViewActivated(%d)"), iViewActivated);
+ return iViewActivated;
+}
// ------------------------------------------------------------------------------------------------
// CMPXVideoPlaybackController::HandleFrameReady()
@@ -2539,7 +2548,7 @@
void CMPXVideoPlaybackController::HandleFrameReady(TInt aError)
{
MPX_DEBUG(_L("CMPXVideoPlaybackController::HandleFrameReady"));
-
+
iPlaybackMode->HandleFrameReady(aError);
}
// End of file
--- a/videoplayback/videohelix/src/mpxvideoplaybackmode.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayback/videohelix/src/mpxvideoplaybackmode.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -16,7 +16,7 @@
*/
-// Version : %version: 33 %
+// Version : %version: 34 %
//
@@ -301,7 +301,7 @@
// ------------------------------------------------------------------------------------------------
// CMPXVideoPlaybackMode::SendErrorToView()
// ------------------------------------------------------------------------------------------------
-TBool CMPXVideoPlaybackMode::SendErrorToView( TInt aError )
+TBool CMPXVideoPlaybackMode::SendErrorToView( TInt /*aError*/ )
{
MPX_DEBUG(_L("CMPXLocalPlaybackMode::SendErrorToView(%d)"), ETrue);
--- a/videoplayback/videohelix/src/mpxvideoplaybackstate.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayback/videohelix/src/mpxvideoplaybackstate.cpp Wed Aug 18 09:50:14 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/src/mpxvideoplayerutility.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayback/videohelix/src/mpxvideoplayerutility.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -16,7 +16,7 @@
*/
-// Version : %version: 22 %
+// Version : %version: 23 %
#include <AudioPreference.h>
@@ -62,7 +62,7 @@
void CMpxVideoPlayerUtility::ConstructL()
{
OpenControllerL();
-
+
CActiveScheduler::Add( this );
}
@@ -88,17 +88,17 @@
iController.Close();
iDirectScreenAccessAbort = EFalse;
-
+
if ( IsActive() )
{
Cancel();
-
+
if ( iPosterFrameBitmap )
{
delete iPosterFrameBitmap;
- iPosterFrameBitmap = NULL;
+ iPosterFrameBitmap = NULL;
}
- }
+ }
}
void CMpxVideoPlayerUtility::Reset()
@@ -324,18 +324,18 @@
}
void CMpxVideoPlayerUtility::GetFrameL()
-{
+{
MPX_DEBUG(_L("CMpxVideoPlayerUtility::GetFrameL"));
-
+
// dont get another frame if a request is already pending
//
if ( ! IsActive() )
{
iPosterFrameBitmap = new (ELeave) CFbsBitmap;
- User::LeaveIfError(iPosterFrameBitmap->Create(TSize(0,0), EColor16MU));
-
- iVideoPlayControllerCustomCommands.GetFrame( *iPosterFrameBitmap, iStatus );
- SetActive();
+ User::LeaveIfError(iPosterFrameBitmap->Create(TSize(0,0), EColor16MU));
+
+ iVideoPlayControllerCustomCommands.GetFrame( *iPosterFrameBitmap, iStatus );
+ SetActive();
}
}
@@ -343,32 +343,32 @@
void CMpxVideoPlayerUtility::RunL()
{
MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::RunL()"));
-
+
if ( iStatus.Int() == KErrNone )
- {
- iVideoPlaybackController->HandleFrameReady( iStatus.Int() );
- }
+ {
+ iVideoPlaybackController->HandleFrameReady( iStatus.Int() );
+ }
else
{
- // Bitmap ownership will NOT be transferred to thumbnail manager so delete it
+ // Bitmap ownership will NOT be transferred to thumbnail manager so delete it
delete iPosterFrameBitmap;
- iPosterFrameBitmap = NULL;
- }
+ iPosterFrameBitmap = NULL;
+ }
}
void CMpxVideoPlayerUtility::DoCancel()
{
MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::DoCancel()"));
-
- // Bitmap ownership will NOT be transferred to thumbnail manager so delete it
+
+ // Bitmap ownership will NOT be transferred to thumbnail manager so delete it
delete iPosterFrameBitmap;
- iPosterFrameBitmap = NULL;
+ iPosterFrameBitmap = NULL;
}
CFbsBitmap& CMpxVideoPlayerUtility::GetBitmap()
{
MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::GetBitmap()"));
-
+
return *iPosterFrameBitmap;
}
@@ -628,21 +628,32 @@
// CMpxVideoPlayerUtility::RemoveSurface()
// -------------------------------------------------------------------------------------------------
//
-TInt CMpxVideoPlayerUtility::RemoveSurface()
+void CMpxVideoPlayerUtility::RemoveSurface()
{
- TInt error = KErrNone;
+ MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::RemoveSurface()"));
- if ( !iSurfaceId.IsNull() )
+ if ( ! iSurfaceId.IsNull() )
{
//
// Send command to view to remove the surface
//
MPX_TRAPD( err, SendSurfaceCommandL( EPbMsgVideoSurfaceRemoved ) );
- error = iVideoPlaySurfaceSupportCustomCommands.SurfaceRemoved( iSurfaceId );
-
iSurfaceId = TSurfaceId::CreateNullId();
}
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMpxVideoPlayerUtility::RemoveSurfaceFromHelix()
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMpxVideoPlayerUtility::RemoveSurfaceFromHelix( TSurfaceId aSurfaceId )
+{
+ MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::RemoveSurfaceFromHelix()"));
+
+ TInt error = KErrNone;
+
+ error = iVideoPlaySurfaceSupportCustomCommands.SurfaceRemoved( aSurfaceId );
return error;
}
--- a/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/mpxvideoplayerutility_stub.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/mpxvideoplayerutility_stub.h Wed Aug 18 09:50:14 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 14 %
+// Version : %version: 15 %
#ifndef __MPXVIDEOPLAYERUTILITY__
@@ -25,6 +25,7 @@
// INCLUDES
//
#include <mmf/common/mmfcontroller.h>
+#include <e32base.h>
#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
#include <mmf/common/mmfstandardcustomcommandsimpl.h>
@@ -34,6 +35,10 @@
#include <mmf/common/mmfdrmcustomcommands.h>
+#ifdef SYMBIAN_BUILD_GCE
+#include <mmf/common/mmfvideosurfacecustomcommands.h>
+#endif
+
#include "videohelixtest.h"
typedef CArrayPtrFlat<TMMFEvent> CMmfCallbackArray;
@@ -113,7 +118,7 @@
void SetVolumeSteps( TInt aVolumeSteps );
void SurfaceRemovedFromView();
-
+
void GetFrameL();
CFbsBitmap& GetBitmap();
@@ -125,7 +130,8 @@
TInt VideoSurfaceCreated();
TInt SurfaceParametersChanged();
- TInt RemoveSurface();
+ void RemoveSurface();
+ TInt RemoveSurfaceFromHelix( TSurfaceId aSurfaceId );;
void SendSurfaceCreatedCommand();
#endif
@@ -184,7 +190,7 @@
TTimeIntervalMicroSeconds iPosition;
TTimeIntervalMicroSeconds iDuration;
-
+
CFbsBitmap* iPosterFrameBitmap;
};
--- a/videoplayback/videohelix/tsrc/ut_videohelixtest/src/mpxvideoplayerutility_stub.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/src/mpxvideoplayerutility_stub.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 17 %
+// Version : %version: 18 %
#include <audiopreference.h>
#include <mmf/server/mmffile.h>
@@ -427,8 +427,8 @@
void CMpxVideoPlayerUtility::GetFrameL()
{
- MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::GetFrameL()"));
-
+ MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::GetFrameL()"));
+
if ( iStifObserver )
{
TCallbackEvent* event = new TCallbackEvent;
@@ -436,16 +436,16 @@
event->iData = 0;
event->iError = KErrNone;
iStifObserver->HandleUtilityEvent( event );
- }
-
- iVideoPlaybackController->HandleFrameReady( KErrGeneral );
+ }
+
+ iVideoPlaybackController->HandleFrameReady( KErrGeneral );
}
-
+
CFbsBitmap& CMpxVideoPlayerUtility::GetBitmap()
{
MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::GetBitmap()"));
-
- iPosterFrameBitmap = new (ELeave) CFbsBitmap;
+
+ iPosterFrameBitmap = new (ELeave) CFbsBitmap;
return *iPosterFrameBitmap;
}
@@ -681,7 +681,7 @@
iTitle = value.AllocL();
}
else if ( ! aItem.Compare(_L8("Description")) ||
- ! aItem.Compare(_L8("Abstract")) )
+ ! aItem.Compare(_L8("Abstract")) )
{
if ( ! iDescription )
{
@@ -771,14 +771,18 @@
return KErrNone;
}
-TInt CMpxVideoPlayerUtility::RemoveSurface()
+void CMpxVideoPlayerUtility::RemoveSurface()
+{
+}
+
+TInt CMpxVideoPlayerUtility::RemoveSurfaceFromHelix( TSurfaceId aSurfaceId )
{
return KErrNone;
}
-void CMpxVideoPlayerUtility::SendSurfaceCreatedCommand()
-{
- MPX_DEBUG(_L("CMpxVideoPlayerUtility::SendSurfaceCreatedCommand()"));
+void CMpxVideoPlayerUtility::SendSurfaceCreatedCommand()
+{
+ MPX_DEBUG(_L("CMpxVideoPlayerUtility::SendSurfaceCreatedCommand()"));
}
#endif
--- a/videoplayback/videohelix/tsrc/ut_videohelixtest/src/videohelixtestbody.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/src/videohelixtestbody.cpp Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayback/videoplayback.pro Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,105 @@
+/*
+* 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: 9 %
+
+
+#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,
+ EControlCmdSurfaceAttached,
+ EControlCmdSurfaceDetached
+};
+
+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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,94 @@
+/*
+* 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#9 %
+
+
+
+#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;
+ bool mSurfaceAttached;
+};
+
+#endif /*VIDEOPLAYBACKCONTROLCONFIGURATION_H_*/
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/controlinc/videoplaybackcontrolpolicy.h Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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: Implementation of VideoPlaybackFileDetailsWidget
+*
+*/
+
+// Version : %version: 13 %
+
+
+
+#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 );
+ void makeDurationItem( 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/controlinc/videoplaybackfullscreencontrol.h Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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: Implementation of VideoPlaybackProgressBar
+*
+*/
+
+// Version : %version: da1mmcf#16 %
+
+
+
+#ifndef VIDEOPLAYBACKPROGRESSBAR_H_
+#define VIDEOPLAYBACKPROGRESSBAR_H_
+
+#include <QObject>
+#include <hbextendedlocale.h>
+#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;
+ HbExtendedLocale mLocale;
+};
+
+#endif /*VIDEOPLAYBACKPROGRESSBAR_H_*/
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/controlinc/videoplaybackstatuspanecontrol.h Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,230 @@
+/*
+* 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#24 %
+
+
+
+// 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 )
+ , mSurfaceAttached( false )
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// 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"));
+
+ if ( mSurfaceAttached )
+ {
+ 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;
+ }
+ case EControlCmdSurfaceAttached:
+ {
+ MPX_DEBUG(_L("VideoPlaybackControlConfiguration::updateControlList() surface added"));
+
+ mSurfaceAttached = true;
+
+ widget->setVisible( true );
+
+ break;
+ }
+ case EControlCmdSurfaceDetached:
+ {
+ MPX_DEBUG(_L("VideoPlaybackControlConfiguration::updateControlList() surface removed"));
+
+ mSurfaceAttached = false;
+
+ widget->setVisible( false );
+
+ 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 );
+
+ emit controlListUpdated();
+}
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/controlsrc/videoplaybackcontrolpolicy.cpp Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,1587 @@
+/*
+* 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#50 %
+
+
+
+// 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 )
+ , mFileDetailsAdded( 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"));
+
+ mFileDetailsAdded = true;
+
+ 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 EControlCmdSurfaceAttached:
+ case EControlCmdSurfaceDetached:
+ 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:
+ case EPbStatePluginSeeking:
+ {
+ //
+ // 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( tnData );
+
+ HbIcon 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() );
+
+ //
+ // 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,487 @@
+/*
+* 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: 28 %
+
+
+#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
+ //
+ makeDurationItem( details );
+
+ //
+ // 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 );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFileDetailsWidget::makeDurationItem
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackFileDetailsWidget::makeDurationItem( VideoPlaybackViewFileDetails* details )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackFileDetailsWidget::makeDurationItem"));
+
+ if ( details->mPlaybackMode != EMPXVideoLiveStreaming && details->mDuration > 0 )
+ {
+ HbExtendedLocale locale = HbExtendedLocale::system();
+ QString hourString, minString, secString;
+
+ int value = (qreal)details->mDuration / (qreal)KPbMilliMultiplier;
+
+ int hours = value / 3600;
+ value = value % 3600;
+ int mins = value / 60;
+ value = value % 60;
+ int secs = value;
+
+ //
+ // Put "0" if it is less than 10 (0:00:03)
+ //
+ hourString = locale.toString( hours );
+
+ if ( mins < 10 )
+ {
+ minString = locale.toString( 0 );
+ }
+ minString.append( locale.toString( mins ) );
+
+ if ( secs < 10 )
+ {
+ secString = locale.toString( 0 );
+ }
+ secString.append( locale.toString( secs ) );
+
+ addItemToListWidget(
+ hbTrId( "txt_videos_list_duration" ),
+ hbTrId( "txt_videos_list_l1l2l3" )
+ .arg( hourString ).arg( minString ).arg( secString ) );
+ }
+}
+
+//End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/controlsrc/videoplaybackfullscreencontrol.cpp Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,470 @@
+/*
+* 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#31 %
+
+
+
+
+#include <QTimer>
+
+#include <hbframeitem.h>
+#include <hbframedrawer.h>
+#include <hbprogressslider.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()"));
+
+ HbExtendedLocale mLocale = HbExtendedLocale::system();
+ 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 ) ) );
+ connect( mProgressSlider, SIGNAL( trackPressed() ), this ,SLOT( handleSliderPressed() ) );
+ connect( mProgressSlider, SIGNAL( trackReleased() ), this ,SLOT( handleSliderReleased() ) );
+
+ //
+ // 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);
+
+ QString str, hourString, minString, secString;
+
+ int hours = value / 3600;
+ value = value % 3600;
+ int mins = value / 60;
+ value = value % 60;
+ int secs = value;
+
+ //
+ // show like this
+ // 0:03, 10:03, 0:05:03, 12:12:12
+ //
+ if ( mins < 10 && mLongTimeFormat )
+ {
+ minString = mLocale.toString( 0 );
+ }
+ minString.append( mLocale.toString( mins ) );
+
+ if ( secs < 10 )
+ {
+ secString = mLocale.toString( 0 );
+ }
+ secString.append( mLocale.toString( secs ) );
+
+ //
+ // Formatting
+ //
+ if ( mLongTimeFormat )
+ {
+ hourString = mLocale.toString( hours );
+
+ str = hbTrId( "txt_videos_slidervalue_l1l2l3_2" )
+ .arg( hourString ).arg( minString ).arg( secString );
+ }
+ else
+ {
+ str = hbTrId( "txt_videos_slidervalue_l1l2" ).arg( minString ).arg( secString );
+ }
+
+ 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;
+ }
+ case EPbStatePluginSeeking:
+ {
+ 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 Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,326 @@
+/*
+* 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: 22 %
+
+
+
+#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 )
+ {
+ if ( mTitleLayout )
+ {
+ mTitleLayout->setVisible( true );
+ }
+ }
+ }
+ else
+ {
+ mController->view()->menu()->close();
+ mController->view()->setTitleBarVisible( false );
+ mController->view()->setStatusBarVisible( false );
+
+ if ( mTitleLayout )
+ {
+ 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 ( mController->isFileDetailsAdded() && ! 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 );
+
+ if ( mTitleLayout )
+ {
+ 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 );
+
+ if ( mTitleLayout )
+ {
+ mTitleLabel->setVisible( false );
+ mTitleGroupBox->setVisible( true );
+ }
+
+ 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 Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,772 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, 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: 11 %
+
+
+
+#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;
+ }
+ case EPbStatePluginSeeking:
+ {
+ 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,402 @@
+/*
+* 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#24 %
+
+
+
+#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();
+
+ inline bool isFileDetailsAdded();
+
+ 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;
+ bool mFileDetailsAdded;
+
+ 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;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::viewMode
+// -------------------------------------------------------------------------------------------------
+//
+inline
+bool VideoPlaybackControlsController::isFileDetailsAdded()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::isFileDetailsAdded() ret %d"),
+ mFileDetailsAdded );
+
+ return mFileDetailsAdded;
+}
+
+#endif /*MPXVIDEOPLAYBACKCONTROLSCONTROLLER_P_H_*/
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/inc/videoplaybackviewfiledetails.h Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,297 @@
+/**
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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: 6 %
+
+#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();
+
+ QGraphicsWidget *widget =
+ mControlConfig->mControlsController->layoutLoader()->findWidget( QString( "transparentWindow" ) );
+ //
+ // 1. Test for Details View
+ //
+ mControlConfig->updateControlList( EControlCmdDetailsViewOpened );
+ QList<TVideoPlaybackControls> controlsList = mControlConfig->controlList();
+
+ QVERIFY( ! widget->isVisible() );
+ QVERIFY( controlsList.contains( EFileDetailsWidget ) );
+ QVERIFY( controlsList.contains( EDetailsViewPlaybackWindow ) );
+ QVERIFY( ! controlsList.contains( EIndicatorBitmap ) );
+
+ //
+ // 2-1. Test for Fullscreen View
+ //
+ mControlConfig->mSurfaceAttached = false;
+ mControlConfig->updateControlList( EControlCmdFullScreenViewOpened );
+ controlsList = mControlConfig->controlList();
+
+ QVERIFY( ! widget->isVisible() );
+ QVERIFY( ! controlsList.contains( EFileDetailsWidget ) );
+ QVERIFY( ! controlsList.contains( EDetailsViewPlaybackWindow ) );
+ QVERIFY( ! controlsList.contains( EIndicatorBitmap ) );
+
+ //
+ // 2-2. Test for Fullscreen View
+ //
+ mControlConfig->mSurfaceAttached = true;
+ mControlConfig->updateControlList( EControlCmdFullScreenViewOpened );
+ controlsList = mControlConfig->controlList();
+
+ QVERIFY( widget->isVisible() );
+ 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( ! widget->isVisible() );
+ 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 ) );
+
+ //
+ // 5. Surface attached
+ //
+ mControlConfig->updateControlList( EControlCmdSurfaceAttached );
+ controlsList = mControlConfig->controlList();
+
+ QVERIFY( widget->isVisible() );
+
+ //
+ // 6. Surface detached
+ //
+ mControlConfig->updateControlList( EControlCmdSurfaceDetached );
+ controlsList = mControlConfig->controlList();
+
+ QVERIFY( ! widget->isVisible() );
+ cleanup();
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolconfiguration/stub/inc/videoplaybackcontrolscontroller.h Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,140 @@
+/**
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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: 9 %
+
+#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();
+ void testIsFileDetailsAdded();
+
+ //
+ // 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 Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,1308 @@
+/**
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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: 14 %
+
+#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();
+
+ //
+ // 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();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestControlsController::testIsFileDetailsAdded
+// -------------------------------------------------------------------------------------------------
+//
+void TestControlsController::testIsFileDetailsAdded()
+{
+ MPX_DEBUG(_L("TestControlsController::testIsFileDetailsAdded()"));
+
+ init();
+
+ QVERIFY( ! mController->isFileDetailsAdded() );
+
+ mFileDetails = new VideoPlaybackViewFileDetails();
+ mFileDetails->mClipName = QString( "testClip.rm" );
+ mFileDetails->mMimeType = QString( "video/x-pn-realvideo" );
+
+ mController->addFileDetails( mFileDetails );
+
+ QVERIFY( mController->isFileDetailsAdded() );
+
+ cleanup();
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/inc/hbvolumesliderpopup.h Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,103 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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: 4 %
+
+
+#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,
+ EControlCmdSurfaceAttached,
+ EControlCmdSurfaceDetached
+};
+
+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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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: 6 %
+
+
+#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:01:40" );
+
+ 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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: 4 %
+
+
+
+#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:%L2:%L3";
+ }
+ 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 testClosePlaybackView();
+ void testHandleVolumeCmd();
+ void testHandleShortPressBackward();
+ void testIssueVideoAppForegroundCmd();
+ void testCreateControls();
+ void testIsMultiItemPlaylist();
+ void testUpdateVideoRect();
+ void testUpdateVideoRectDone();
+ void testHandleBufferingState();
+ void testHandleVideoPlaybackMessage();
+ void testHandlePlaybackCommandComplete();
+ void testHandleMedia();
+ void testSurfacedAttached();
+
+ 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 Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,963 @@
+/**
+* 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: 15 %
+
+#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::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, ETrue ) );
+ QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdHandleForeground );
+ QVERIFY( errIssueVidAppFGCmd == KErrNone );
+
+ //
+ // test background
+ //
+ TRAP( errIssueVidAppFGCmd, mVideoViewWrapper->IssueVideoAppForegroundCmdL( EFalse, 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();
+}
+
+void TestMPXVideoViewWrapper::testSurfacedAttached()
+{
+ init();
+
+ TRAPD(err, mVideoViewWrapper->CreateControlsL());
+ QVERIFY( err == KErrNone );
+
+ mVideoViewWrapper->SurfacedAttached( ETrue );
+ QVERIFY( mVideoViewWrapper->iControlsController->mReceivedEvent == EControlCmdSurfaceAttached );
+
+ mVideoViewWrapper->SurfacedAttached( EFalse );
+ QVERIFY( mVideoViewWrapper->iControlsController->mReceivedEvent == EControlCmdSurfaceDetached );
+
+ cleanup();
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxcollectionplaylist.h Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,73 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 CMPXCollectionPath;
+class MMPXCollectionObserver;
+
+class MMPXCollection
+{
+ public:
+ virtual TUid UidL() const = 0;
+
+ virtual CMPXCollectionPath* PathL() = 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;
+
+ CMPXCollectionPath* PathL();
+};
+
+#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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,96 @@
+/*
+* 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: 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,
+ EControlCmdSurfaceAttached,
+ EControlCmdSurfaceDetached
+};
+
+#endif /*VIDEOPLAYBACKCONTROL_HRH_*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/videoplaybackcontrolscontroller.h Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,107 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <mpxcollectionpath.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;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXCollectionUtility::PathL
+// -------------------------------------------------------------------------------------------------
+//
+CMPXCollectionPath* CMPXCollectionUtility::PathL()
+{
+ return NULL;
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxplaybackutility.cpp Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,453 @@
+/**
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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: 10 %
+
+
+#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( EPbStatePluginSeeking );
+ QVERIFY( mProgBar->mProgressSlider->isEnabled() );
+
+ //
+ // test for 3rd block of cases
+ //
+ mProgBar->updateState( EPbStateBuffering );
+ QVERIFY( ! mProgBar->mProgressSlider->isEnabled() );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// testDurationChanged
+// -------------------------------------------------------------------------------------------------
+//
+void TestProgressBar::testDurationChanged()
+{
+ MPX_ENTER_EXIT(_L("TestProgressBar::testDurationChanged()"));
+
+ setup();
+
+ int duration = 121;
+ mProgBar->durationChanged( duration );
+
+ QVERIFY( mProgBar->mDuration == duration );
+ QVERIFY( mProgBar->mProgressSlider->maximum() == duration );
+ QVERIFY( mProgBar->mProgressSlider->maxText() == "2:01" );
+
+ duration = 730;
+ mProgBar->durationChanged( duration );
+
+ QVERIFY( mProgBar->mDuration == duration );
+ QVERIFY( mProgBar->mProgressSlider->maximum() == duration );
+ QVERIFY( mProgBar->mProgressSlider->maxText() == "12:10" );
+
+ duration = 7413;
+ mProgBar->durationChanged( duration );
+
+ QVERIFY( mProgBar->mDuration == duration );
+ QVERIFY( mProgBar->mProgressSlider->maximum() == duration );
+ QVERIFY( mProgBar->mProgressSlider->maxText() == "2:03:33" );
+
+ duration = 37803;
+ mProgBar->durationChanged( duration );
+
+ QVERIFY( mProgBar->mDuration == duration );
+ QVERIFY( mProgBar->mProgressSlider->maximum() == duration );
+ QVERIFY( mProgBar->mProgressSlider->maxText() == "10:30:03" );
+
+ 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/hbglobal.h Wed Aug 18 09:50:14 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/testprogressbar/stub/inc/hbprogressslider.h Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,78 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, 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: 2 %
+
+
+
+#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 );
+ void trackPressed();
+ void trackReleased();
+
+ 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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/hbglobal.cpp Wed Aug 18 09:50:14 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: class for HbGlobal
+*
+*/
+
+// Version : %version: 1 %
+
+
+
+#include "hbglobal.h"
+#include <qstring>
+
+
+QString hbTrId( QString string, int n )
+{
+ Q_UNUSED( n );
+
+ QString loc = "";
+
+
+ if ( string == "txt_videos_slidervalue_l1l2l3_2" )
+ {
+ loc = "%L1:%L2:%L3";
+ }
+ else if ( string == "txt_videos_slidervalue_l1l2" )
+ {
+ loc = "%L1:%L2";
+ }
+ return loc;
+}
+
+//End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testprogressbar/stub/src/hbprogressslider.cpp Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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: Project file for building testprogressbar
+#
+#
+# Version : %version: 4 %
+
+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 \
+ hbglobal.h \
+ ../../controlinc/videoplaybackprogressbar.h
+
+SOURCES += testprogressbar.cpp \
+ videoplaybackcontrolscontroller.cpp \
+ videoplaybackdocumentloader.cpp \
+ videoplaybackviewfiledetails.cpp \
+ hbprogressslider.cpp \
+ hbglobal.cpp \
+ ../../controlsrc/videoplaybackprogressbar.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/teststatuspanecontrol/inc/teststatuspanecontrol.h Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,349 @@
+/**
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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: 9 %
+
+
+#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->mController->mFileDetailsAdded = true;
+ 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-1. test for full screen mode + file details hasn't arrived
+ //
+ mStatusPane->mController->mFileDetailsAdded = false;
+
+ mControlsController->mViewMode = EFullScreenView;
+ mControlsController->mFileDetails->mTitle = title;
+ mStatusPane->updateControlsWithFileDetails( mFileDetails );
+
+ QVERIFY( mStatusPane->mTitleLabel == NULL );
+ QVERIFY( mStatusPane->mTitleGroupBox == NULL );
+ QVERIFY( mControlsController->view()->viewFlags() ==
+ HbView::HbViewFlags( HbView::ViewTitleBarTransparent | HbView::ViewStatusBarTransparent ));
+
+ //
+ // 1-2. test for full screen mode + file details has arrived
+ //
+ mStatusPane->mController->mFileDetailsAdded = true;
+
+ 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,182 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, 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 %
+
+
+
+#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();
+
+ inline bool isFileDetailsAdded();
+
+ 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;
+ bool mFileDetailsAdded;
+};
+
+// 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;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::view
+// -------------------------------------------------------------------------------------------------
+//
+inline
+bool VideoPlaybackControlsController::isFileDetailsAdded()
+{
+ return mFileDetailsAdded;
+}
+
+#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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,678 @@
+/**
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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: 7 %
+
+
+#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 );
+
+ //
+ // Seeking
+ //
+ state = EPbStatePluginSeeking;
+ 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,275 @@
+/**
+* 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() );
+ QVERIFY( mDispHdlr->iViewWrapper->iAttatched );
+
+ 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() );
+ QVERIFY( ! mDispHdlr->iViewWrapper->iAttatched );
+
+ 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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/mpxvideoviewwrapper.h Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,89 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 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 "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();
+
+ void SurfacedAttached( TBool aAttached );
+
+ public: // data
+
+ VideoBasePlaybackView* iView;
+ VideoPlaybackViewFileDetails* iFileDetails;
+ TBool iMediaRequested;
+ TBool iClosePlayerAO;
+ TBool iForeground;
+ TBool iAttatched;
+};
+
+#endif // __MPXVIDEOVIEWWRAPPER_H__
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testvideodisplayhandler/stub/inc/videobaseplaybackview.h Wed Aug 18 09:50:14 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/videocontainer.h Wed Aug 18 09:50:14 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:
+*
+*/
+
+// Version : %version: 2 %
+
+
+#ifndef CVIDEOCONTAINER_H
+#define CVIDEOCONTAINER_H
+
+#include <coecntrl.h>
+
+
+class CVideoContainer : public CCoeControl
+{
+
+ public:
+ CVideoContainer();
+ virtual ~CVideoContainer();
+
+ void ConstructL();
+};
+
+#endif // CVIDEOCONTAINER_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/videoplaybackviewfiledetails.h Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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/mpxvideoviewwrapper.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,256 @@
+/*
+* 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 "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()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::SurfacedAttached()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::SurfacedAttached( TBool aAttached )
+{
+ iAttatched = aAttached;
+}
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testvideodisplayhandler/stub/src/videobaseplaybackview.cpp Wed Aug 18 09:50:14 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/videocontainer.cpp Wed Aug 18 09:50:14 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:
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+#include "videocontainer.h"
+
+
+CVideoContainer::CVideoContainer()
+{
+}
+
+CVideoContainer::~CVideoContainer()
+{
+ CloseWindow();
+}
+
+void CVideoContainer::ConstructL()
+{
+ CreateWindowL();
+ ActivateL();
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testvideodisplayhandler/stub/src/videoplaybackviewfiledetails.cpp Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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: 5 %
+
+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 \
+ videocontainer.h \
+ alfcompositionutility.h \
+ mediaclientvideodisplay.h \
+ testvideodisplayhandler.h \
+ ../../viewinc/mpxvideoplaybackdisplayhandler.h
+
+SOURCES += mpxvideoviewwrapper.cpp \
+ videobaseplaybackview.cpp \
+ videoplaybackviewfiledetails.cpp \
+ videocontainer.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 Wed Aug 18 09:50:14 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: tester for methods in Video Playback View Plugin
+*
+*/
+
+// Version : %version: 10 %
+
+#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();
+ void testHandleAppBackground();
+ void testHandleAppForeground();
+
+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 Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,708 @@
+/**
+* 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: 14 %
+
+#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->iViewForeground, 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->iViewForeground, 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->iViewForeground, 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();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestVideoPlaybackView::testHandleAppBackground()
+// -------------------------------------------------------------------------------------------------
+//
+void TestVideoPlaybackView::testHandleAppBackground()
+{
+ setup();
+
+ mVideoView->mActivated = true;
+
+ connect( this, SIGNAL( commandSignal() ), mVideoView, SLOT( handleAppBackground() ) );
+ emit commandSignal();
+
+ QVERIFY( ! mVideoView->mVideoMpxWrapper->iViewForeground );
+ QVERIFY( ! mVideoView->mVideoMpxWrapper->iAppForeground );
+
+ disconnect( this, SIGNAL( commandSignal() ), mVideoView, SLOT( handleAppBackground() ) );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestVideoPlaybackView::testHandleAppForeground()
+// -------------------------------------------------------------------------------------------------
+//
+void TestVideoPlaybackView::testHandleAppForeground()
+{
+ setup();
+
+ connect( this, SIGNAL( commandSignal() ), mVideoView, SLOT( handleAppForeground() ) );
+ emit commandSignal();
+
+ QVERIFY( mVideoView->mVideoMpxWrapper->iViewForeground );
+ QVERIFY( mVideoView->mVideoMpxWrapper->iAppForeground );
+
+ disconnect( this, SIGNAL( commandSignal() ), mVideoView, SLOT( handleAppForeground() ) );
+
+ cleanup();
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testvideoplaybackview/stub/inc/hbpangesture.h Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,89 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: MPX Video base playback view
+*
+*/
+
+// Version : %version: 9 %
+
+
+
+// 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 aViewForeground, TBool aAppForeground );
+
+ TInt GetMediaId();
+
+ public: // data
+
+ VideoBasePlaybackView* iView;
+ TBool iMediaRequested;
+ VideoPlaybackViewFileDetails* iFileDetails;
+ TBool iClosePlayerAO;
+ TBool iAppForeground;
+ TBool iViewForeground;
+ 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 Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,115 @@
+/*
+* 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: 2 %
+
+#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_";
+
+// TMPXId of the last played media file
+static const QString KEY_LAST_PLAYED_MEDIA_ID = "_VideoActivity_last_played_media_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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,232 @@
+/*
+* 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: 11 %
+
+
+
+// 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 aViewForeground, TBool aAppForeground )
+{
+ iViewForeground = aViewForeground;
+ iAppForeground = aAppForeground;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::GetMediaId()
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoViewWrapper::GetMediaId()
+{
+ return 0;
+}
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testvideoplaybackview/stub/src/videoactivitystate.cpp Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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#30 %
+
+
+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 \
+ videocontainer.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 \
+ videocontainer.cpp
+
+RESOURCES += resources/videoplaybackview.qrc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/viewinc/mpxhelixplaybackplugindefs.h Wed Aug 18 09:50:14 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/mpxvideoplaybackdisplayhandler.h Wed Aug 18 09:50:14 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: 11 %
+
+
+#ifndef __VIDEOPLAYBACKDISPLAYHANDLER_H__
+#define __VIDEOPLAYBACKDISPLAYHANDLER_H__
+
+// INCLUDES
+
+#include <mpxmessage2.h>
+#include <MMFScalingCustomCommandConstants.h>
+#include <mpxvideoplaybackdefs.h>
+#include <mediaclientvideodisplay.h>
+
+
+//
+// CLASS DECLARATION
+//
+class CVideoContainer;
+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;
+ CVideoContainer* iVideoContainer;
+};
+
+#endif // __VIDEOPLAYBACKDISPLAYHANDLER_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/viewinc/mpxvideoplaybackuids.hrh Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,291 @@
+/*
+* 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#23 %
+
+
+
+// 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 aViewForeground, TBool aAppForegournd );
+
+ void RequestMediaL();
+
+ void CreateGeneralPlaybackCommandL( TMPXPlaybackCommand aCmd, TBool aDoSync = ETrue );
+
+ 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();
+
+ void SurfacedAttached( TBool aAttached );
+
+ 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 );
+
+ TInt GetMediaId();
+
+ 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/viewinc/videocontainer.h Wed Aug 18 09:50:14 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: 3 %
+
+
+#ifndef CVIDEOCONTAINER_H
+#define CVIDEOCONTAINER_H
+
+#include <coecntrl.h>
+
+
+class CVideoContainer : public CCoeControl
+{
+
+ public:
+ CVideoContainer();
+ virtual ~CVideoContainer();
+
+ void ConstructL();
+};
+
+#endif // CVIDEOCONTAINER_H
+
+// End of file
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/viewsrc/mpxvideoplaybackdisplayhandler.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,697 @@
+/*
+* 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: 28 %
+
+#include <sysutil.h>
+#include <s32file.h>
+#include <mpxcommand.h>
+#include <mpxcommandgeneraldefs.h>
+#include <mpxplaybackutility.h>
+#include <mpxvideoplaybackdefs.h>
+
+#include "videocontainer.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 ) CVideoContainer();
+ iVideoContainer->ConstructL();
+ iVideoContainer->SetRect( aDisplayRect );
+ }
+
+ 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;
+
+ //
+ // Let ControlsController know that we get the surface.
+ //
+ iViewWrapper->SurfacedAttached( true );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// 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 );
+
+ //
+ // Let ControlsController know that we get the surface.
+ //
+ iViewWrapper->SurfacedAttached( true );
+ }
+ 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()"));
+
+ //
+ // Let ControlsController know that we get the surface.
+ //
+ iViewWrapper->SurfacedAttached( false );
+
+ 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,1663 @@
+/*
+* 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#44 %
+
+
+
+// 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 <mpxcollectionpath.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::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 aViewForeground, TBool aAppForegournd )
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::IssueVideoAppForegroundCmdL()"),
+ _L("aViewForeground = %d, aAppForegournd = %d"), aViewForeground, aAppForegournd );
+
+ TMPXVideoPlaybackCommand videoCmd = EPbCmdHandleBackground;
+
+ if ( aViewForeground )
+ {
+ 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, aAppForegournd );
+
+ 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;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::GetItemId()
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoViewWrapper::GetMediaId()
+{
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::GetItemId()"));
+
+ CMPXCollectionPath* path = iCollectionUtility->Collection().PathL();
+ TInt itemId = path->Id().iId1;
+
+ return itemId;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::SurfacedAttached()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::SurfacedAttached( TBool aAttached )
+{
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::SurfacedAttached() attached = %d"), aAttached);
+
+ TVideoPlaybackControlCommandIds event = EControlCmdSurfaceDetached;
+
+ if ( aAttached )
+ {
+ event = EControlCmdSurfaceAttached;
+ }
+
+ iControlsController->handleEvent( event );
+}
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/viewsrc/videobaseplaybackview.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,511 @@
+/*
+* 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#48 %
+
+
+
+// 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 ) );
+
+ connect( hbInstance->allMainWindows()[0], SIGNAL( obscured() ), this, SLOT( handleAppBackground() ) );
+ connect( hbInstance->allMainWindows()[0], SIGNAL( revealed() ), this, SLOT( handleAppForeground() ) );
+
+ 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 );
+
+ disconnect( hbInstance->allMainWindows()[0], SIGNAL( obscured() ), this, SLOT( handleAppBackground() ) );
+ disconnect( hbInstance->allMainWindows()[0], SIGNAL( revealed() ), this, SLOT( handleAppForeground() ) );
+
+ //
+ // 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);
+
+ data = uint ( mVideoMpxWrapper->GetMediaId() );
+ VideoActivityState::instance().setActivityData(data, KEY_LAST_PLAYED_MEDIA_ID);
+}
+
+// -------------------------------------------------------------------------------------------------
+// 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& string, bool closeView )
+{
+ MPX_DEBUG(_L("VideoBasePlaybackView::showDialog( %s, %d )"), string.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 );
+
+ 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() ) );
+ }
+
+ dlg->setTitle( string );
+ 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, ! hbInstance->allMainWindows()[0]->isObscured() ) );
+ }
+ break;
+ }
+ case QEvent::ApplicationDeactivate:
+ {
+ if ( mActivated )
+ {
+ MPX_DEBUG(_L("VideoBasePlaybackView::eventFilter background()") );
+ TRAP_IGNORE( mVideoMpxWrapper->IssueVideoAppForegroundCmdL(
+ false, ! hbInstance->allMainWindows()[0]->isObscured() ) );
+ }
+ 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();
+ }
+ }
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::handleAppBackground()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::handleAppBackground()
+{
+ MPX_ENTER_EXIT(_L("VideoBasePlaybackView::handleAppBackground()") );
+
+ if ( mActivated )
+ {
+ TRAP_IGNORE( mVideoMpxWrapper->IssueVideoAppForegroundCmdL( false, false ) );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::handleAppForeground()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::handleAppForeground()
+{
+ MPX_ENTER_EXIT(_L("VideoBasePlaybackView::handleAppForeground()") );
+
+ if ( mActivated )
+ {
+ TRAP_IGNORE( mVideoMpxWrapper->IssueVideoAppForegroundCmdL( true, true ) );
+ }
+}
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/viewsrc/videocontainer.cpp Wed Aug 18 09:50:14 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: 3 %
+
+
+
+#include "videocontainer.h"
+#include "mpxvideo_debug.h"
+
+CVideoContainer::CVideoContainer()
+{
+ MPX_ENTER_EXIT( _L("CVideoContainer::CVideoContainer()") );
+}
+
+CVideoContainer::~CVideoContainer()
+{
+ MPX_ENTER_EXIT( _L("CVideoContainer::~CVideoContainer()") );
+
+ CloseWindow();
+}
+
+void CVideoContainer::ConstructL()
+{
+ MPX_ENTER_EXIT( _L("CVideoContainer::ConstructL()") );
+
+ CreateWindowL();
+ ActivateL();
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/viewsrc/videoplaybackview.cpp Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayerapp/bwins/videoplayerengineu.def Wed Aug 18 09:50:14 2010 +0300
@@ -1,63 +1,67 @@
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)
+ ?applicationReady@VideoPlayerEngine@@IAEXXZ @ 62 NONAME ; void VideoPlayerEngine::applicationReady(void)
+ ?viewReadySlot@VideoPlayerEngine@@QAEXXZ @ 63 NONAME ; void VideoPlayerEngine::viewReadySlot(void)
+ ?handlePlaybackFailure@VideoPlayerEngine@@AAEXH@Z @ 64 NONAME ; void VideoPlayerEngine::handlePlaybackFailure(int)
+ ?playURI@VideoPlayerEngine@@QAEXVQString@@@Z @ 65 NONAME ; void VideoPlayerEngine::playURI(class QString)
--- a/videoplayerapp/eabi/videoplayerengineu.def Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayerapp/eabi/videoplayerengineu.def Wed Aug 18 09:50:14 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,15 @@
_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
+ _ZN17VideoPlayerEngine13viewReadySlotEv @ 66 NONAME
+ _ZN17VideoPlayerEngine16applicationReadyEv @ 67 NONAME
+ _ZN17VideoPlayerEngine21handlePlaybackFailureEi @ 68 NONAME
+ _ZN17VideoPlayerEngine7playURIE7QString @ 69 NONAME
--- a/videoplayerapp/inc/videoplayerengine.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayerapp/inc/videoplayerengine.h Wed Aug 18 09:50:14 2010 +0300
@@ -11,11 +11,11 @@
*
* Contributors:
*
-* Description: Implementation of QVideoPlayerEngine
+* Description: Implementation of VideoPlayerEngine
*
*/
-// Version : %version: ou1cpsw#15 %
+// Version : %version: 19 %
#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,21 +46,25 @@
/**
* Constructor
*/
- QVideoPlayerEngine(bool isService = false);
+ VideoPlayerEngine( bool isService = false );
/**
* Destructor.
*/
- virtual ~QVideoPlayerEngine();
+ virtual ~VideoPlayerEngine();
public:
void initialize();
void playMedia( QString filePath );
+ void playURI( QString uri );
void playMedia( RFile file );
void setEmbedded();
-
+ signals:
+ void applicationReady();
+
public slots:
void handleCommand( int commandCode );
+ void viewReadySlot();
private slots:
void handleQuit();
@@ -88,11 +92,13 @@
bool shouldExit();
bool shouldActivateCollectionView();
+
+ void handlePlaybackFailure(int errorCode);
private:
bool mIsService;
bool mEmbedded;
- bool mDelayedLoadDone;
+ bool mDelayedLoadDone;
bool mIsPlayService;
MpxViewPlugin* mCurrentViewPlugin;
@@ -101,7 +107,7 @@
MpxViewPlugin* mFileDetailsViewPlugin;
- QMpxVideoPlaybackWrapper *mPlaybackWrapper;
+ VideoPlaybackWrapper *mPlaybackWrapper;
VideoServices* mVideoServices;
--- a/videoplayerapp/videoplayer/resources/service_conf.xml Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayerapp/videoplayer/resources/service_conf.xml Wed Aug 18 09:50:14 2010 +0300
@@ -40,5 +40,11 @@
<name>com.nokia.symbian.IFileView</name>
<version>1.0</version>
<description>Interface for playing video given a QFile</description>
- </interface>
+ </interface>
+ <interface>
+ <name>com.nokia.symbian.IUriView</name>
+ <version>1.0</version>
+ <description>Interface for playing RSTP and MMS</description>
+ <customproperty key="schemes">rtsp, rtspt, rtspu, mms, mmst</customproperty>
+ </interface>
</service>
\ No newline at end of file
--- a/videoplayerapp/videoplayer/sis/videoplayer_stub.pkg Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayerapp/videoplayer/sis/videoplayer_stub.pkg Wed Aug 18 09:50:14 2010 +0300
@@ -41,9 +41,9 @@
;
; Video playback view
;
-"" - "z:\sys\bin\hbvideoplaybackview.dll"
-"" - "z:\sys\bin\hbvideoplaybackviewplugin.dll"
-"" - "z:\resource\plugins\hbvideoplaybackviewplugin.r*"
+"" - "z:\sys\bin\videoplaybackview.dll"
+"" - "z:\sys\bin\videoplaybackviewplugin.dll"
+"" - "z:\resource\plugins\videoplaybackviewplugin.r*"
;
; Collection view and wrapper
--- a/videoplayerapp/videoplayer/sis/videoplayer_udeb.pkg Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayerapp/videoplayer/sis/videoplayer_udeb.pkg Wed Aug 18 09:50:14 2010 +0300
@@ -59,6 +59,6 @@
"/epoc32/data/z/private/10003a3f/import/apps/videoplayer_reg.rsc" - "!:/private/10003a3f/import/apps/videoplayer_reg.rsc"
"/epoc32/data/z/resource/qt/translations/videos_en.qm" - "!:/resource/qt/translations/videos.qm"
-"/epoc32/data/z/resource/plugins/hbvideoplaybackviewplugin.rsc" - "!:/resource/plugins/hbvideoplaybackviewplugin.rsc"
-"/epoc32/release/armv5/udeb/hbvideoplaybackview.dll" - "!:/sys/bin/hbvideoplaybackview.dll"
-"/epoc32/release/armv5/udeb/hbvideoplaybackviewplugin.dll" - "!:/sys/bin/hbvideoplaybackviewplugin.dll"
+"/epoc32/data/z/resource/plugins/videoplaybackviewplugin.rsc" - "!:/resource/plugins/videoplaybackviewplugin.rsc"
+"/epoc32/release/armv5/udeb/videoplaybackview.dll" - "!:/sys/bin/videoplaybackview.dll"
+"/epoc32/release/armv5/udeb/videoplaybackviewplugin.dll" - "!:/sys/bin/videoplaybackviewplugin.dll"
--- a/videoplayerapp/videoplayer/sis/videoplayer_urel.pkg Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayerapp/videoplayer/sis/videoplayer_urel.pkg Wed Aug 18 09:50:14 2010 +0300
@@ -59,6 +59,6 @@
"/epoc32/data/z/private/10003a3f/import/apps/videoplayer_reg.rsc" - "!:/private/10003a3f/import/apps/videoplayer_reg.rsc"
"/epoc32/data/z/resource/qt/translations/videos_en.qm" - "!:/resource/qt/translations/videos.qm"
-"/epoc32/data/z/resource/plugins/hbvideoplaybackviewplugin.rsc" - "!:/resource/plugins/hbvideoplaybackviewplugin.rsc"
-"/epoc32/release/armv5/urel/hbvideoplaybackview.dll" - "!:/sys/bin/hbvideoplaybackview.dll"
-"/epoc32/release/armv5/urel/hbvideoplaybackviewplugin.dll" - "!:/sys/bin/hbvideoplaybackviewplugin.dll"
+"/epoc32/data/z/resource/plugins/videoplaybackviewplugin.rsc" - "!:/resource/plugins/videoplaybackviewplugin.rsc"
+"/epoc32/release/armv5/urel/videoplaybackview.dll" - "!:/sys/bin/videoplaybackview.dll"
+"/epoc32/release/armv5/urel/videoplaybackviewplugin.dll" - "!:/sys/bin/videoplaybackviewplugin.dll"
--- a/videoplayerapp/videoplayer/src/main.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayerapp/videoplayer/src/main.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -15,72 +15,49 @@
*
*/
-// 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 );
+ QObject::connect(&mainWindow, SIGNAL(viewReady()), engine, SLOT(viewReadySlot()));
engine->initialize();
mainWindow.show();
return app.exec();
--- a/videoplayerapp/videoplayer/videoplayer.pro Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayerapp/videoplayer/videoplayer.pro Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayerapp/videoplayerengine/inc/mpxvideoplayerappuiengine.h Wed Aug 18 09:50:14 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 5 %
+// Version : %version: 8 %
@@ -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.
@@ -200,12 +200,21 @@
* @since 10.1
*/
void LateInitL();
+
+ TInt ReplayAfterPriorTermination(const TDesC& aFileName);
+
+ /*
+ * converts provided error code to a string
+ * @since 10.1
+ * @param aErrorCode error code to be converted
+ */
+ const TDesC& ResolveErrorStringL(TInt aErrorCode);
private:
/**
* Constructor
*/
- CMpxVideoPlayerAppUiEngine( QMpxVideoPlaybackWrapper* aWrapper );
+ CMpxVideoPlayerAppUiEngine( VideoPlaybackWrapper* aWrapper );
/**
* By default Symbian 2nd phase constructor is private.
@@ -247,6 +256,8 @@
void UpdatePbPluginMediaL();
void ActivateVideoPlaybackView();
+
+ void ReadActivityData();
private: // data
@@ -257,16 +268,17 @@
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;
+ TUint32 iLastPlayedItemId;
};
//
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/inc/videoplaybackwrapper.h Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,61 @@
+/*
+* 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: 9 %
+
+
+
+#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 playURI( QString aUri );
+ int playMedia( RFile aFile );
+ void openPlaybackView() ;
+ void lateInit();
+ int replayMedia( QString aFilename );
+ const QString resloveErrorString( int errorCode );
+
+ private:
+ void initializePlugins();
+ int openFileWithNativePath(const TDesC& aFileName);
+ int openURI(const TDesC& aUri);
+
+ signals:
+ void handlePlaybackView( int viewId );
+
+ private: //data
+ CMpxVideoPlayerAppUiEngine *mUiEngine;
+};
+
+#endif /* VIDEOPLAYBACKWRAPPER_H_ */
--- a/videoplayerapp/videoplayerengine/inc/videoserviceplay.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayerapp/videoplayerengine/inc/videoserviceplay.h Wed Aug 18 09:50:14 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__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/inc/videoserviceuri.h Wed Aug 18 09:50:14 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: Declaration of VideoServiceUri and VideoServiceUriMms
+*
+*/
+
+// Version : %version: 1 %
+
+#ifndef __VIDEOSERVICEURI_H__
+#define __VIDEOSERVICEURI_H__
+
+#include <xqserviceprovider.h>
+#include <QObject>
+
+// FORWARD DECLARATIONS
+class VideoServices;
+class VideoPlayerEngine;
+class QLatin1String;
+
+class VideoServiceUri : public XQServiceProvider
+ {
+ Q_OBJECT
+
+ public:
+ VideoServiceUri( VideoServices *parent, VideoPlayerEngine* engine, QLatin1String service );
+ virtual ~VideoServiceUri();
+
+ void setEngine( VideoPlayerEngine* engine );
+
+ public slots:
+ bool view( QString uri );
+
+ private:
+ VideoPlayerEngine* mEngine;
+ VideoServices* mServiceApp;
+ };
+
+#endif //__VIDEOSERVICEURI_H__
--- a/videoplayerapp/videoplayerengine/inc/videoserviceview.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayerapp/videoplayerengine/inc/videoserviceview.h Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayerapp/videoplayerengine/src/mpxvideoplayerappuiengine.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 9 %
+// Version : %version: 12 %
@@ -37,13 +37,17 @@
#include <mmf/common/mmfcontrollerframeworkbase.h>
#include <coeutils.h>
+#include <textresolver.h>
#include <videoplaylistutility.h>
#include <mpxvideoplaybackdefs.h>
+#include <mpxmediacontainerdefs.h>
+#include <mpxmediaarray.h>
#include "mpxvideoplayerappuiengine.h"
#include "mpxvideoplayerconstants.h"
-#include "mpxvideoplaybackwrapper.h"
+#include "videoplaybackwrapper.h"
#include "mpxhbvideocommondefs.h"
+#include "videoactivitystate.h"
#include "mpxvideo_debug.h"
@@ -51,7 +55,7 @@
// CMpxVideoPlayerAppUiEngine::CMpxVideoPlayerAppUiEngine
// -------------------------------------------------------------------------------------------------
//
-CMpxVideoPlayerAppUiEngine::CMpxVideoPlayerAppUiEngine( QMpxVideoPlaybackWrapper* aWrapper )
+CMpxVideoPlayerAppUiEngine::CMpxVideoPlayerAppUiEngine( VideoPlaybackWrapper* aWrapper )
: iPlaybackUtility( NULL ),
iCollectionUtility( NULL ),
iRecognizer( NULL ),
@@ -67,7 +71,7 @@
// CMpxVideoPlayerAppUiEngine::NewL
// -------------------------------------------------------------------------------------------------
//
-CMpxVideoPlayerAppUiEngine* CMpxVideoPlayerAppUiEngine::NewL( QMpxVideoPlaybackWrapper* aWrapper )
+CMpxVideoPlayerAppUiEngine* CMpxVideoPlayerAppUiEngine::NewL( VideoPlaybackWrapper* aWrapper )
{
MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::NewL()"));
@@ -739,5 +743,67 @@
CleanupStack::PopAndDestroy( cmd );
}
+
+// -------------------------------------------------------------------------------------------------
+// CMpxVideoPlayerAppUiEngine::ReplayAfterPriorTermination()
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMpxVideoPlayerAppUiEngine::ReplayAfterPriorTermination(const TDesC& aFileName)
+{
+ MPX_DEBUG(_L("CMpxVideoPlayerAppUiEngine::ReplayAfterPriorTermination()"));
+
+ ReadActivityData();
+ TMPXItemId mpxItemId(iLastPlayedItemId);
+
+ TInt error = KErrNone;
+
+ MPX_TRAP( error,
+ CMPXMedia* media = CMPXMedia::NewL();
+ CleanupStack::PushL(media);
+
+ media->SetTObjectValueL<TMPXGeneralType>(KMPXMediaGeneralType, EMPXItem );
+ media->SetTObjectValueL<TMPXItemId>( KMPXMediaGeneralId, mpxItemId );
+ media->SetTextValueL( KMPXMediaGeneralTitle, aFileName );
+ media->SetTextValueL( KMPXMediaGeneralUri, aFileName );
+
+ OpenMediaL( *media );
+
+ CleanupStack::PopAndDestroy( media );
+ );
+
+ return error;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMpxVideoPlayerAppUiEngine::ReadActivityData()
+// -------------------------------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUiEngine::ReadActivityData()
+{
+ MPX_DEBUG(_L("CMpxVideoPlayerAppUiEngine::ReadActivityData()"));
+
+ iLastPlayedItemId =
+ VideoActivityState::instance().getActivityData(KEY_LAST_PLAYED_MEDIA_ID).toUInt();
+
+}
+
+
+// -------------------------------------------------------------------------------------------------
+// CMpxVideoPlayerAppUiEngine::ResolveErrorStringL()
+// -------------------------------------------------------------------------------------------------
+//
+const TDesC& CMpxVideoPlayerAppUiEngine::ResolveErrorStringL(TInt aErrorCode)
+{
+ MPX_DEBUG(_L("CMpxVideoPlayerAppUiEngine::ResolveErrorStringL()"));
+
+ CTextResolver* textresolver = CTextResolver::NewL();
+
+ const TDesC& text = textresolver->ResolveErrorString( aErrorCode );
+
+ delete textresolver;
+
+ return text;
+}
+
// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/src/videoplaybackwrapper.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,230 @@
+/*
+* 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: 9 %
+
+
+#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::replayMedia()
+// -------------------------------------------------------------------------------------------------
+//
+int VideoPlaybackWrapper::replayMedia( QString aFileName )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackWrapper::replayMedia"));
+
+ TBuf<KMaxFileName> name( aFileName.utf16() );
+
+ int error = mUiEngine->ReplayAfterPriorTermination( name );
+
+ return error;
+}
+
+// -------------------------------------------------------------------------------------------------
+// QMpxVideoPlaybackWrapper::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;
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackWrapper::resloveErrorString()
+// -------------------------------------------------------------------------------------------------
+//
+const QString VideoPlaybackWrapper::resloveErrorString( int errorCode )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackWrapper::resloveErrorString()"));
+
+ TPtrC text;
+ TRAP_IGNORE( text.Set(mUiEngine->ResolveErrorStringL(errorCode)) );
+
+ const QString qString( (QChar*)text.Ptr(), text.Length() );
+
+ return qString;
+}
+
+// -------------------------------------------------------------------------------------------------
+// QMpxVideoPlaybackWrapper::playMedia()
+// -------------------------------------------------------------------------------------------------
+//
+int VideoPlaybackWrapper::playURI( QString aUri )
+{
+ MPX_ENTER_EXIT(_L("QMpxVideoPlaybackWrapper::playURI"));
+
+ TBuf<KMaxFileName> uri( aUri.utf16() );
+ int error = openURI( uri );
+
+ MPX_DEBUG(_L("QMpxVideoPlaybackWrapper::playURI err = %d"), error);
+
+ return error;
+}
+
+// -------------------------------------------------------------------------------------------------
+// QMpxVideoPlaybackWrapper::openURI()
+// -------------------------------------------------------------------------------------------------
+//
+int VideoPlaybackWrapper::openURI(const TDesC& aUri)
+{
+ MPX_DEBUG(_L("QMpxVideoPlaybackWrapper::openURI()"));
+
+ int err = KErrNone;
+
+ TRAP( err, mUiEngine->OpenFileL( aUri ) );
+
+ return err;
+}
+// End of File
--- a/videoplayerapp/videoplayerengine/src/videoplayerengine.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayerapp/videoplayerengine/src/videoplayerengine.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#37 %
+// Version : %version: da1mmcf#42 %
#include <QApplication>
@@ -27,18 +27,19 @@
#include <hbview.h>
#include <hbapplication.h>
#include <hbactivitymanager.h>
+#include <hbdevicenotificationdialog.h>
#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 +51,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 +99,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 +122,80 @@
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);
- playMedia( data.toString() );
+ QVariant data = VideoActivityState::instance().getActivityData( KEY_LAST_PLAYED_CLIP );
+ int error = mPlaybackWrapper->replayMedia( data.toString() );
+
+ // if replay fails, then activate collection view instead
+ if ( error != KErrNone )
+ {
+ loadPluginAndCreateView( MpxHbVideoCommon::CollectionView );
+ activateView( MpxHbVideoCommon::CollectionView );
+ }
}
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 +203,8 @@
case MpxHbVideoCommon::ActivatePlaybackView:
{
if ( mCurrentViewPlugin != mPlaybackViewPlugin )
- {
- activateView( MpxHbVideoCommon::PlaybackView );
+ {
+ activateView( MpxHbVideoCommon::PlaybackView );
}
break;
}
@@ -198,7 +212,7 @@
{
if ( mCurrentViewPlugin != mFileDetailsViewPlugin )
{
- activateView( MpxHbVideoCommon::VideoDetailsView );
+ activateView( MpxHbVideoCommon::VideoDetailsView );
}
break;
}
@@ -210,24 +224,38 @@
}
break;
}
-
+
default:
{
break;
}
- }
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// viewReadySlot()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlayerEngine::viewReadySlot()
+{
+ MPX_ENTER_EXIT(_L("VideoPlayerEngine::viewReady()"));
+ emit applicationReady();
+ // since we need to emit applicationReady only once at startup,
+ // disconnect the viewReady -signal from this object
+ disconnect(hbInstance->allMainWindows().value(0), SIGNAL(viewReady()),
+ this, SLOT(viewReadySlot()));
}
// -------------------------------------------------------------------------------------------------
// doDelayedLoad()
// -------------------------------------------------------------------------------------------------
//
-void QVideoPlayerEngine::doDelayedLoad()
+void VideoPlayerEngine::doDelayedLoad()
{
- MPX_ENTER_EXIT(_L("QVideoPlayerEngine::doDelayedLoad()"));
-
+ MPX_ENTER_EXIT(_L("VideoPlayerEngine::doDelayedLoad()"));
+
createMissingViews();
-
+
mDelayedLoadDone = true;
}
@@ -235,12 +263,10 @@
// createPlaybackView()
// -------------------------------------------------------------------------------------------------
//
-void QVideoPlayerEngine::createPlaybackView()
+void VideoPlayerEngine::createPlaybackView()
{
- MPX_ENTER_EXIT(_L("QVideoPlayerEngine::createPlaybackView()"));
-
mPlaybackWrapper->lateInit();
-
+
if ( ! mPlaybackViewPlugin )
{
loadPluginAndCreateView( MpxHbVideoCommon::PlaybackView );
@@ -251,21 +277,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 +304,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 +324,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 +344,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 +391,7 @@
if ( viewTypeUid )
{
- //
+ //
// load corresponding plug-in
//
XQPluginLoader pluginLoader( viewTypeUid );
@@ -374,7 +401,7 @@
{
MpxViewPlugin *currentViewPlugin = NULL;
- if ( viewType == MpxHbVideoCommon::CollectionView )
+ if ( viewType == MpxHbVideoCommon::CollectionView )
{
mCollectionViewPlugin = qobject_cast<MpxViewPlugin*>( instance )->viewPlugin();
currentViewPlugin = mCollectionViewPlugin;
@@ -391,32 +418,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 +453,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 +468,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 +485,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,33 +539,60 @@
// 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() );
+
+ int result = mPlaybackWrapper->playMedia( filePath );
+
+ if ( result != KErrNone )
+ {
+ handlePlaybackFailure(result);
+ }
+}
- mPlaybackWrapper->playMedia( filePath );
+// -------------------------------------------------------------------------------------------------
+// playURI()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlayerEngine::playURI( QString uri )
+{
+ MPX_ENTER_EXIT(_L("VideoPlayerEngine::playURI()"),
+ _L("uri = %s"), uri.data() );
+
+ int result = mPlaybackWrapper->playURI( uri );
+
+ if ( result != KErrNone )
+ {
+ handlePlaybackFailure(result);
+ }
}
// -------------------------------------------------------------------------------------------------
// 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 )"));
+
+ int result = mPlaybackWrapper->playMedia( file );
+
+ if ( result != KErrNone )
+ {
+ handlePlaybackFailure(result);
+ }
}
// -------------------------------------------------------------------------------------------------
// setEmbedded()
// -------------------------------------------------------------------------------------------------
//
-void QVideoPlayerEngine::setEmbedded()
+void VideoPlayerEngine::setEmbedded()
{
- MPX_ENTER_EXIT(_L("QVideoPlayerEngine::setEmbedded()"));
-
+ MPX_ENTER_EXIT(_L("VideoPlayerEngine::setEmbedded()"));
+
mEmbedded = true;
}
@@ -544,16 +600,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 +617,7 @@
//
connectView();
- //
+ //
// activate view
//
mCurrentViewPlugin->activateView();
@@ -572,24 +628,27 @@
// 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") )
+ intface.contains("IFileView") ||
+ intface.contains("IUriView"))
{
result = true;
mIsPlayService = true;
}
}
-
+
+ MPX_DEBUG(_L("VideoPlayerEngine::isPlayServiceInvoked() return %d"), result);
return result;
}
@@ -597,17 +656,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,24 +675,74 @@
// 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;
}
+
+// -------------------------------------------------------------------------------------------------
+// handlePlaybackFailure()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlayerEngine::handlePlaybackFailure(int errorCode)
+{
+ MPX_DEBUG(_L("VideoPlayerEngine::handlePlaybackFailure()"));
+
+ if ( mIsPlayService )
+ {
+ HbDeviceNotificationDialog* dlg = new HbDeviceNotificationDialog();
+
+ switch ( errorCode )
+ {
+ case KErrNotSupported:
+ case KErrUnknown:
+ case KErrCorrupt:
+ case KErrTooBig:
+ {
+ dlg->setTitle( hbTrId( "txt_videos_info_invalid_clip_operation_canceled" ) );
+ break;
+ }
+ case KErrArgument:
+ case KErrBadName:
+ {
+ dlg->setTitle( hbTrId( "txt_videos_info_unable_to_connect_invalid_url" ) );
+ break;
+ }
+ case KErrNotFound:
+ {
+ dlg->setTitle( hbTrId( "txt_videos_info_file_not_found" ) );
+ break;
+ }
+ default:
+ {
+ const QString textToShow = mPlaybackWrapper->resloveErrorString(errorCode);
+ dlg->setTitle(textToShow);
+ break;
+ }
+ }
+
+ dlg->show();
+
+
+ qApp->quit();
+ XQServiceUtil::toBackground( false );
+ }
+}
// End of file
--- a/videoplayerapp/videoplayerengine/src/videoserviceplay.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayerapp/videoplayerengine/src/videoserviceplay.cpp Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayerapp/videoplayerengine/src/videoservices.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#8 %
+// Version : %version: da1mmcf#10 %
#include "videoplayerengine.h"
#include "videoservices.h"
@@ -23,17 +23,18 @@
#include "videoserviceplay.h"
#include "videoserviceview.h"
#include "videoservicebrowse.h"
+#include "videoserviceuri.h"
#include "mpxvideo_debug.h"
#include <xqaiwdecl.h>
#include <xqserviceutil.h>
VideoServices *VideoServices::mInstance = 0;
-// -----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// VideoServices::instance()
-// -----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
-VideoServices* VideoServices::instance(QVideoPlayerEngine* engine)
+VideoServices* VideoServices::instance( VideoPlayerEngine* engine )
{
MPX_ENTER_EXIT(_L("VideoServices::instance()"));
@@ -50,9 +51,9 @@
return mInstance;
}
-// -----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// VideoServices::decreaseReferenceCount()
-// -----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
void VideoServices::decreaseReferenceCount()
{
@@ -60,7 +61,7 @@
if ( mInstance )
{
- if( --mInstance->mReferenceCount == 0 )
+ if ( --mInstance->mReferenceCount == 0 )
{
delete mInstance;
mInstance = NULL;
@@ -68,11 +69,11 @@
}
}
-// ----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// setEngine()
-// ----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
-void VideoServices::setEngine(QVideoPlayerEngine* engine)
+void VideoServices::setEngine( VideoPlayerEngine* engine )
{
MPX_ENTER_EXIT(_L("VideoServices::setEngine()"));
@@ -87,25 +88,31 @@
mEngine = engine;
mServiceView->setEngine(engine);
}
+
+ if ( mServiceUriView )
+ {
+ mEngine = engine;
+ mServiceUriView->setEngine(engine);
+ }
}
-// ----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// 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 +120,63 @@
{
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") );
+
+ // new service, new interface
+ mServiceUriView = new VideoServiceUri( this, engine, QLatin1String("videoplayer.com.nokia.symbian.IUriView"));
+
+
}
-// ----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// ~VideoServices()
-// ----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
VideoServices::~VideoServices()
{
@@ -151,11 +194,12 @@
delete mServiceUriFetchDeprecatedNewService;
delete mServiceBrowseDeprecatedOldService;
delete mServiceUriFetchDeprecatedOldService;
+ delete mServiceUriView;
}
-// ----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// currentService()
-// ----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
VideoServices::TVideoService VideoServices::currentService()
{
@@ -164,9 +208,9 @@
return mCurrentService;
}
-// ----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// getBrowseCategory()
-// ----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
int VideoServices::getBrowseCategory() const
{
@@ -174,28 +218,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 +250,9 @@
mCurrentService = service;
}
-// ----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// contextTitle()
-// ----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
QString VideoServices::contextTitle() const
{
@@ -214,49 +260,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 +315,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 +351,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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/src/videoserviceuri.cpp Wed Aug 18 09:50:14 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: Implementation of VideoServiceUri
+*
+*/
+
+// Version : %version: 1 %
+
+#include "videoservices.h"
+#include "videoserviceuri.h"
+#include "videoplayerengine.h"
+#include "mpxvideo_debug.h"
+
+// -------------------------------------------------------------------------------------------------
+// VideoServiceUri()
+// -------------------------------------------------------------------------------------------------
+//
+VideoServiceUri::VideoServiceUri( VideoServices* parent,
+ VideoPlayerEngine* engine,
+ QLatin1String service )
+ : XQServiceProvider( service, parent )
+ , mEngine( engine )
+ , mServiceApp( parent )
+{
+ MPX_ENTER_EXIT(_L("VideoServiceUri::VideoServiceUri()"));
+ publishAll();
+}
+
+// -------------------------------------------------------------------------------------------------
+// ~VideoServiceUri()
+// -------------------------------------------------------------------------------------------------
+//
+VideoServiceUri::~VideoServiceUri()
+{
+ MPX_ENTER_EXIT(_L("VideoServiceUri::~VideoServiceUri()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// setEngine()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoServiceUri::setEngine( VideoPlayerEngine* engine )
+{
+ MPX_ENTER_EXIT(_L("VideoServiceUri::setEngine()"));
+ mEngine = engine;
+}
+
+// -------------------------------------------------------------------------------------------------
+// view( QString )
+// -------------------------------------------------------------------------------------------------
+//
+bool VideoServiceUri::view( QString uri )
+{
+ MPX_ENTER_EXIT(_L("VideoServiceUri::view( QString ) "),
+ _L("uri = %s"), uri.data() );
+
+ if(mEngine)
+ {
+ mServiceApp->setCurrentService(VideoServices::EUriView);
+ mEngine->playURI( uri );
+ }
+
+ return true;
+}
--- a/videoplayerapp/videoplayerengine/src/videoserviceview.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayerapp/videoplayerengine/src/videoserviceview.cpp Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoappuiengine/inc/testvideoappuiengine.h Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoappuiengine/src/testvideoappuiengine.cpp Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 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 Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoappuiengine/stub/src/hbinstance.cpp Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 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 Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoappuiengine/testvideoappuiengine.pro Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/inc/testvideoplayerengine.h Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/src/testvideoplayerengine.cpp Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/inc/hbinstance.h Wed Aug 18 09:50:14 2010 +0300
@@ -15,6 +15,8 @@
*
*/
+// Version : %version: %
+
#ifndef _HBINSTANCE_H
#define _HBINSTANCE_H
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/inc/mpxvideoplaybackwrapper.h Tue Jul 06 14:17:50 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/inc/videoactivitystate.h Wed Aug 18 09:50:14 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 Wed Aug 18 09:50:14 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: Stub implementation of VideoPlaybackWrapper
+*
+*/
+
+// Version : %version: da1mmcf#9 %
+
+
+
+#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 );
+ int replayMedia( QString aFileName );
+ int playURI( QString aUri );
+
+ public:
+ void openPlaybackView() ;
+ static int GetInstanceCount();
+ void lateInit();
+ const QString resloveErrorString( int errorCode );
+
+ signals:
+ void handlePlaybackView( int viewId );
+
+ private:
+ static void Increment();
+ static void Decrement();
+};
+
+#endif /* VIDEOPLAYBACKWRAPPER_H_ */
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/inc/videoserviceplay.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/inc/videoserviceplay.h Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/inc/videoservices.h Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/inc/videoserviceview.h Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/hbinstance.cpp Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 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 Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,117 @@
+/*
+* 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#10 %
+
+
+#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::replayMedia( QString aFileName )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackWrapper::replayMedia"));
+
+ 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()"));
+}
+
+const QString VideoPlaybackWrapper::resloveErrorString( int errorCode )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackWrapper::resloveErrorString()"));
+
+ Q_UNUSED( errorCode );
+
+ const QString string("No Supported");
+
+ return string;
+
+}
+
+int VideoPlaybackWrapper::playURI( QString aUri )
+{
+ MPX_ENTER_EXIT(_L("QMpxVideoPlaybackWrapper::playURI"));
+
+ Q_UNUSED( aUri );
+
+ return 0;
+}
+
+// End of File
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/videoserviceplay.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/videoserviceplay.cpp Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/videoservices.cpp Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/videoserviceview.cpp Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/xqpluginloader.cpp Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/testvideoplayerengine.pro Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoservices/inc/testvideoservices.h Wed Aug 18 09:50:14 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 Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoservices/src/testvideoservices.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: %
+// Version : %version: da1mmcf#5 %
// INCLUDES
#include <QtTest/QtTest>
@@ -31,6 +31,7 @@
#include "videoservices.h"
#include "videoserviceurifetch.h"
#include "videoserviceplay.h"
+#include "videoserviceuri.h"
#undef private
// ---------------------------------------------------------------------------
@@ -54,7 +55,7 @@
TestVideoServices::TestVideoServices()
: mTestObject( 0 )
- , mEngine( 0 )
+ , mEngine( 0 )
{
MPX_DEBUG(_L("TestVideoServices::TestVideoServices()"));
}
@@ -80,41 +81,45 @@
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->mServiceUriView );
+ 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->mServiceUriView );
+ QVERIFY( mTestObject->mEngine == mEngine );
+ QVERIFY( mTestObject->mCurrentService == VideoServices::ENoService );
}
@@ -122,41 +127,45 @@
{
MPX_DEBUG(_L("TestVideoServices::testCurrentService()"));
- mTestObject = VideoServices::instance();
-
- QVERIFY(mTestObject);
- QVERIFY(mTestObject->mServicePlay);
- QVERIFY(mTestObject->mServiceUriFetch);
- QVERIFY(mTestObject->mServiceView);
- QVERIFY(mTestObject->mEngine == 0);
- QVERIFY(mTestObject->mCurrentService == VideoServices::ENoService);
+ mTestObject = VideoServices::instance();
- mTestObject->mServicePlay->playMedia(QString());
- QVERIFY(mTestObject->mCurrentService == VideoServices::ENoService);
+ QVERIFY( mTestObject );
+ QVERIFY( mTestObject->mServicePlay );
+ QVERIFY( mTestObject->mServiceUriFetch );
+ QVERIFY( mTestObject->mServiceView );
+ QVERIFY( mTestObject->mServiceUriView );
+ QVERIFY( mTestObject->mEngine == 0 );
+ QVERIFY( mTestObject->mCurrentService == VideoServices::ENoService );
- mTestObject->mServiceUriFetch->fetch(QString());
- QVERIFY(mTestObject->mCurrentService == VideoServices::EUriFetcher);
+ mTestObject->mServicePlay->playMedia( QString() );
+ QVERIFY( mTestObject->mCurrentService == VideoServices::ENoService );
+
+ 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 );
+
+ mTestObject->mServiceUriView->view( QString() );
+ QVERIFY( mTestObject->mCurrentService == VideoServices::EUriView );
}
void TestVideoServices::cleanupTestCase()
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoservices/stub/inc/videoplayerengine.h Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoservices/stub/inc/videoplayerengine.h Wed Aug 18 09:50:14 2010 +0300
@@ -11,11 +11,11 @@
*
* Contributors:
*
-* Description: Implementation of QVideoPlayerEngine
+* Description: Implementation of VideoPlayerEngine
*
*/
-// Version : %version: da1mmcf#2 %
+// Version : %version: da1mmcf#4 %
#ifndef VIDEOPLAYERENGINE_H
#define VIDEOPLAYERENGINE_H
@@ -26,29 +26,30 @@
//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 );
void setEmbedded();
+ void playURI( QString uri );
public slots:
void handleCommand( int commandCode );
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoservices/stub/src/videoplayerengine.cpp Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoservices/stub/src/videoplayerengine.cpp Wed Aug 18 09:50:14 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#3 %
+// Version : %version: da1mmcf#5 %
#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,10 +104,16 @@
// 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 );
}
+void VideoPlayerEngine::playURI( QString uri )
+{
+ MPX_DEBUG(_L("VideoPlayerEngine::playURI( uri )"));
+ Q_UNUSED( uri );
+}
+
// End of file
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoservices/testvideoservices.pro Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoservices/testvideoservices.pro Wed Aug 18 09:50:14 2010 +0300
@@ -42,7 +42,8 @@
../../inc/videoserviceurifetch.h \
../../inc/videoserviceplay.h \
../../inc/videoserviceview.h \
- ../../inc/videoservicebrowse.h
+ ../../inc/videoservicebrowse.h \
+ ../../inc/videoserviceuri.h
SOURCES += stub/src/videoplayerengine.cpp \
#stub/src/xqserviceprovider.cpp \
@@ -51,5 +52,6 @@
../../src/videoserviceurifetch.cpp \
../../src/videoserviceplay.cpp \
../../src/videoserviceview.cpp \
- ../../src/videoservicebrowse.cpp
+ ../../src/videoservicebrowse.cpp \
+ ../../src/videoserviceuri.cpp
--- a/videoplayerapp/videoplayerengine/videoplayerengine.pro Tue Jul 06 14:17:50 2010 +0300
+++ b/videoplayerapp/videoplayerengine/videoplayerengine.pro Wed Aug 18 09:50:14 2010 +0300
@@ -14,12 +14,12 @@
# Description: Project file for building Videoplayer components
#
#
-# Version : %version: 27 %
+# Version : %version: da1mmcf#31 %
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 \
@@ -55,28 +55,31 @@
-lxqservice.dll \
-lxqserviceutil.dll \
-lflogger.dll \
- -lefsrv
+ -lefsrv \
+ -lcommonengine.dll
DEPENDPATH += ../../inc ../inc inc
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 \
+ videoserviceuri.h
SOURCES += videoplayerengine.cpp \
- mpxvideoplaybackwrapper.cpp \
+ videoplaybackwrapper.cpp \
mpxvideoplayerappuiengine.cpp \
videoservices.cpp \
videoserviceplay.cpp \
videoserviceurifetch.cpp \
videoserviceview.cpp \
videoservicebrowse.cpp \
- videoactivitystate.cpp
+ videoactivitystate.cpp \
+ videoserviceuri.cpp