--- a/inc/mpxvideo_debug.h Tue Jun 15 13:09:36 2010 +0100
+++ b/inc/mpxvideo_debug.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*/
-// Version : %version: ou1cpsw#3 %
+// Version : %version: ou1cpsw#5 %
@@ -40,29 +40,20 @@
#else
#ifdef _MPX_FILE_LOGGING_
#define FU_DEBUG MPXDebug::FileLog
- #else
- #define FU_DEBUG MPXDebug::NullLog
+ #else
+ #define FU_DEBUG
#endif
-#endif
+#endif
class MPXDebug
{
public:
- inline static void NullLog( TRefByValue<const TDesC16> /*aFmt*/, ... )
- {
- }
-
- inline static void NullLog( TRefByValue<const TDesC> /*aFunctionName*/,
- TRefByValue<const TDesC16> /*aFmt*/, ... )
- {
- }
-
inline static void FileLog( TRefByValue<const TDesC16> aFmt, ... )
{
VA_LIST list;
VA_START(list,aFmt);
- RFileLogger::WriteFormat( _L("Fusion"),
+ RFileLogger::WriteFormat( _L("Fusion"),
_L("fusion.log"),
EFileLoggingModeAppend,
aFmt,
@@ -77,24 +68,24 @@
#define MPX_DEBUG TFusionLog::FusionLog
#define MPX_ENTER_EXIT TEnterExitLog _s
#else
- #define MPX_DEBUG MPXDebug::NullLog
- #define MPX_ENTER_EXIT MPXDebug::NullLog
+ #define MPX_DEBUG
+ #define MPX_ENTER_EXIT
#endif
class TFusionLog : public TDes16Overflow
{
public:
-
+
inline static void FusionLog( TRefByValue<const TDesC16> aFmt, ... )
{
- TBuf< 512 > buffer;
-
+ TBuf< 496 > buffer;
+
VA_LIST list;
VA_START( list, aFmt );
buffer.AppendFormatList( aFmt, list );
VA_END(list);
-
+
FU_DEBUG(_L("#Fu# %S"), &buffer );
}
};
@@ -102,7 +93,7 @@
class TEnterExitLog : public TDes16Overflow
{
public:
-
+
void Overflow(TDes16& /*aDes*/)
{
FU_DEBUG(_L("%S Logging Overflow"), &iFunctionName);
@@ -112,40 +103,40 @@
TRefByValue<const TDesC> aFmt, ... )
{
iFunctionName = HBufC::New( TDesC(aFunctionName).Length() );
-
+
if ( iFunctionName )
{
iFunctionName->Des().Copy(aFunctionName);
}
-
- TBuf< 512 > buffer;
-
+
+ TBuf< 496 > buffer;
+
VA_LIST list;
VA_START( list, aFmt );
buffer.AppendFormatList( aFmt, list, this );
VA_END(list);
-
+
FU_DEBUG(_L("#Fu# --> %S %S"), iFunctionName, &buffer );
}
-
+
TEnterExitLog( TRefByValue<const TDesC> aFunctionName )
{
iFunctionName = HBufC::New( TDesC(aFunctionName).Length() );
-
+
if ( iFunctionName )
{
iFunctionName->Des().Copy(aFunctionName);
}
-
+
FU_DEBUG(_L("#Fu# --> %S"), iFunctionName );
}
-
+
~TEnterExitLog()
{
FU_DEBUG(_L("#Fu# <-- %S"), iFunctionName );
delete iFunctionName;
}
-
+
private:
HBufC* iFunctionName;
};
@@ -160,8 +151,13 @@
FU_DEBUG(_KMPXErrorInfo, aErr, MPX_S(__FILE__), __LINE__);\
}
-#define MPX_TRAP(_r, _s) TRAP(_r,_s);MPX_ERROR_LOG(_r);
-#define MPX_TRAPD(_r, _s) TRAPD(_r,_s);MPX_ERROR_LOG(_r);
+#ifdef _DEBUG
+ #define MPX_TRAP(_r, _s) TRAP(_r,_s);MPX_ERROR_LOG(_r);
+ #define MPX_TRAPD(_r, _s) TRAPD(_r,_s);MPX_ERROR_LOG(_r);
+#else // _DEBUG
+ #define MPX_TRAP(_r, _s) TRAP(_r,_s);(_r=_r);
+ #define MPX_TRAPD(_r, _s) TRAPD(_r,_s);(_r=_r);
+#endif // _DEBUG
#endif // __MPXVIDEO_DEBUG_H__
--- a/inc/mpxvideoplayercustomviewmsgconsts.h Tue Jun 15 13:09:36 2010 +0100
+++ b/inc/mpxvideoplayercustomviewmsgconsts.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,8 @@
*/
-// Version : %version: da1mmcf#3 %
+// Version : %version: da1mmcf#4 %
+
#ifndef __MPXVIDEOPLAYERCUSTOMVIEWMSGCONSTS_H__
#define __MPXVIDEOPLAYERCUSTOMVIEWMSGCONSTS_H__
@@ -31,5 +32,6 @@
const TInt KMpxVideoPlaybackPdlReloading = 0x20024339;
+const TInt KMpxVideoPlaybackPdlReloadComplete = 0x2002433A;
#endif // __MPXVIDEOPLAYERCUSTOMVIEWMSGCONSTS_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/videoactivitystate.h Thu Jul 22 16:34:17 2010 +0100
@@ -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: VideoActivityState class definition
+*
+*/
+
+// Version : %version: da1mmcf#3 %
+
+#ifndef __VIDEOACTIVITYSTATE_H__
+#define __VIDEOACTIVITYSTATE_H__
+
+#include <qhash.h>
+#include <qvariant.h>
+#include "videoplayerappexport.h"
+
+// videoplayer activity id
+static const QString ACTIVITY_VIDEOPLAYER_MAINVIEW = "VideosMainView";
+
+// last position of the last played media clip (int)
+static const QString KEY_LAST_PLAY_POSITION_ID = "_VideoActivity_last_play_position_id_";
+
+// name of the media clip last played (QString)
+static const QString KEY_LAST_PLAYED_CLIP = "_VideoActivity_last_played_clip_";
+
+// Key for plugin type in activity manager
+static const QString KEY_VIEWPLUGIN_TYPE = "_VideoActivity_viewplugin_type_";
+
+// was the last played media clip a local clip (not streaming or prog. download)
+static const QString KEY_LAST_LOCAL_PLAYBACK = "_VideoActivity_last_local_playback_";
+
+
+/**
+ * Class is used as a static activity data container for videoplayer application
+ * for other videoplayer components to use.
+ *
+ * Data is excepted to be saved as QHash<QString, QVariant>. Keys defined above
+ * should be used to access data
+ *
+ */
+class VIDEOPLAYERAPP_DLL_EXPORT 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__
--- a/inc/videoservices.h Tue Jun 15 13:09:36 2010 +0100
+++ b/inc/videoservices.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: ou1cpsw#3 %
+// Version : %version: 5 %
#ifndef __VIDEOSERVICES_H__
#define __VIDEOSERVICES_H__
@@ -164,21 +164,61 @@
VideoServiceUriFetch* mServiceUriFetch;
/**
+ * Deprecated VideoServiceUriFetch service instance.
+ */
+ VideoServiceUriFetch* mServiceUriFetchDeprecatedNewService;
+
+ /**
+ * Deprecated VideoServiceUriFetch service instance.
+ */
+ VideoServiceUriFetch* mServiceUriFetchDeprecatedOldService;
+
+ /**
* VideoServicePlay service instance.
*/
VideoServicePlay* mServicePlay;
/**
+ * VideoServicePlay service instance.
+ */
+ VideoServicePlay* mServicePlayDeprecatedNewService;
+
+ /**
+ * VideoServicePlay service instance.
+ */
+ VideoServicePlay* mServicePlayDeprecatedOldService;
+
+ /**
* VideoServiceView service instance.
*/
VideoServiceView* mServiceView;
/**
+ * VideoServiceView service instance.
+ */
+ VideoServiceView* mServiceViewDeprecatedNewService;
+
+ /**
+ * VideoServiceView service instance.
+ */
+ VideoServiceView* mServiceViewDeprecatedOldService;
+
+ /**
* VideoServiceBrowse service instance.
*/
VideoServiceBrowse *mServiceBrowse;
/**
+ * Deprecated VideoServiceBrowse service instance.
+ */
+ VideoServiceBrowse *mServiceBrowseDeprecatedNewService;
+
+ /**
+ * Deprecated VideoServiceBrowse service instance.
+ */
+ VideoServiceBrowse *mServiceBrowseDeprecatedOldService;
+
+ /**
* Pointer of QVideoPlayerEngine.
*/
QVideoPlayerEngine* mEngine;
--- a/layers.sysdef.xml Tue Jun 15 13:09:36 2010 +0100
+++ b/layers.sysdef.xml Thu Jul 22 16:34:17 2010 +0100
@@ -14,7 +14,7 @@
</layer>
<layer name="qt_unit_test_layer">
- <module name="vado.videocollection.tsrc">
+ <module name="vado.101_videocollection_qt.tsrc">
<unit unitID="vado.testcollectionview" mrp="" bldFile="&layer_real_source_path;/videocollection/videocollectionview/tsrc/testcollectionview" proFile="testcollectionview.pro" name="unittest.testcollectionview"/>
<unit unitID="vado.testhintwidget" mrp="" bldFile="&layer_real_source_path;/videocollection/videocollectionview/tsrc/testhintwidget" proFile="testhintwidget.pro" name="unittest.testhintwidget"/>
<unit unitID="vado.testlistview" mrp="" bldFile="&layer_real_source_path;/videocollection/videocollectionview/tsrc/testlistview" proFile="testlistview.pro" name="unittest.testlistview"/>
@@ -40,6 +40,12 @@
</layer>
<layer name="unit_test_layer">
+ <module name="vado.101_videoplayback_tsrc">
+ <unit unitID="vado.videohelix_test" name="videohelix_tsrc" bldFile="&layer_real_source_path;/videoplayback/videohelix/tsrc/ut_videohelixtest/group" mrp=""/>
+ </module>
+ <module name="vado.101_mpxmyvideoscollection_tsrc">
+ <unit unitID="vado.mpxmyvideoscollection_test" name="mpxmyvideoscollection_tsrc" bldFile="&layer_real_source_path;/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/group" mrp=""/>
+ </module>
</layer>
</systemModel>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/mediasettings.pro Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,25 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies 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
+#
+#
+
+TEMPLATE = subdirs
+CONFIG += ordered
+symbian: {
+BLD_INF_RULES.prj_mmpfiles += $$LITERAL_HASH"include \"group/bld.inf\""
+
+SUBDIRS += videosettingsplugin
+}
+
\ No newline at end of file
--- a/mediasettings/mediasettingsengine/group/MPSettROPModel.mmp Tue Jun 15 13:09:36 2010 +0100
+++ b/mediasettings/mediasettingsengine/group/MPSettROPModel.mmp Thu Jul 22 16:34:17 2010 +0100
@@ -16,10 +16,11 @@
-// Version : %version: 5 %
+// Version : %version: 6 %
+#include <data_caging_paths.hrh>
#include <platform_paths.hrh>
TARGET mpsettropmodel.dll
CAPABILITY CAP_ECOM_PLUGIN
@@ -41,7 +42,7 @@
START RESOURCE MPSettingsROPModel.rss
HEADER
TARGET mpsettingsropmodel.rsc
-TARGETPATH resource
+TARGETPATH RESOURCE_FILES_DIR
END
USERINCLUDE .
--- a/mediasettings/mediasettingsengine/rom/mpsettropmodel.iby Tue Jun 15 13:09:36 2010 +0100
+++ b/mediasettings/mediasettingsengine/rom/mpsettropmodel.iby Thu Jul 22 16:34:17 2010 +0100
@@ -21,8 +21,6 @@
#include <data_caging_paths_for_iby.hrh>
-ECOM_PLUGIN( mpsettropmodel.dll, 101f857b.rsc )
-
-data=DATAZ_\resource\MPSettingsROPModel.rsc resource\MPSettingsROPModel.rsc
+ECOM_PLUGIN( mpsettropmodel.dll, mpsettropmodel.rsc )
#endif // MPSETTROPMODEL_IBY
\ No newline at end of file
--- a/mediasettings/mediasettingsengine/rom/mpsettropmodelrsc.iby Tue Jun 15 13:09:36 2010 +0100
+++ b/mediasettings/mediasettingsengine/rom/mpsettropmodelrsc.iby Thu Jul 22 16:34:17 2010 +0100
@@ -22,7 +22,7 @@
#include <data_caging_paths_for_iby.hrh>
-data=DATAZ_\APP_RESOURCE_DIR\MPSettingsROPModel.rsc APP_RESOURCE_DIR\MPSettingsROPModel.rsc
+data=DATAZ_\RESOURCE_FILES_DIR\mpsettingsropmodel.rsc RESOURCE_FILES_DIR\mpsettingsropmodel.rsc
#endif // MPSETTROPMODELRSC_IBY
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/inc/videosettingsaccesspointentry.h Thu Jul 22 16:34:17 2010 +0100
@@ -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:
+ *
+ */
+#ifndef VIDEOSETTINGSACCESSPOINTENTRY_H
+#define VIDEOSETTINGSACCESSPOINTENTRY_H
+
+#include <cpsettingformentryitemdata.h>
+#include <cmapplsettingsui.h>
+
+class VideoSettingsGroup;
+class CmConnectionMethodShim;
+class CmManagerShim;
+
+class VideoSettingsAccessPointEntry : public CpSettingFormEntryItemData
+{
+ Q_OBJECT
+public:
+
+ /**
+ * Constructor
+ */
+ VideoSettingsAccessPointEntry(CpItemDataHelper &itemDataHelper,
+ const QString& text = QString(),
+ VideoSettingsGroup *parent = 0);
+
+ /**
+ * Destructor
+ */
+ ~VideoSettingsAccessPointEntry();
+
+ /**
+ * sets the iap id.
+ *
+ * @param apId The iap id.
+ */
+ void setIapId(const uint& apId);
+
+private:
+
+ /**
+ * From CpSettingFormEntryItemData.
+ *
+ * Creates a view for this, if needed. In our case always
+ * returns 0 as we don't want a new view.
+ */
+ virtual CpBaseSettingView *createSettingView() const;
+
+ /**
+ * Convinience method for fetching a connection method
+ * with a given id.
+ *
+ * @param id Connection method id.
+ * @return The connection method object.
+ */
+ CmConnectionMethodShim* getConnectionMethod(const uint& id);
+
+ /**
+ * Fetches the connection name from the given connection method
+ * and sets it as the description for this.
+ */
+ void setAccessPointName(CmConnectionMethodShim* connMethod);
+
+private slots:
+
+ /**
+ * Slot that is called when the button is pressed.
+ * Opens the access point selection dialog.
+ */
+ void openSelectionDialogSlot();
+
+ /**
+ * Slot that is called when the access point selection
+ * dialog closes.
+ *
+ * @param error Possible error code. One from enum
+ * CmApplSettingsUi::ApplSettingsError.
+ */
+ void accessPointDialogFinished(uint error);
+
+private:
+
+ /**
+ * The VideoSettingsGroup.
+ */
+ VideoSettingsGroup* mParent;
+
+ /**
+ * The access point selection dialog.
+ */
+ CmApplSettingsUi* mApplSettings;
+
+ /**
+ * The current access point selection.
+ */
+ CmApplSettingsUi::SettingSelection mSelection;
+
+ /**
+ * The manager that handles all destinations and connection methods.
+ * Used for getting the connection methods.
+ */
+ CmManagerShim* mCmManager;
+
+};
+
+#endif // VIDEOSETTINGSACCESSPOINTENTRY_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/inc/videosettingsgroup.h Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,150 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+#ifndef VIDEOSETTINGSGROUP_H
+#define VIDEOSETTINGSGROUP_H
+
+#include <cpsettingformitemdata.h>
+#include <qabstractitemmodel.h>
+#include <qtranslator.h>
+
+class CpItemDataHelper;
+class CMPSettingsModel;
+class VideoSettingsAccessPointEntry;
+
+class VideoSettingsGroup : public CpSettingFormItemData
+{
+ Q_OBJECT
+public:
+
+ /**
+ * Constructor
+ */
+ VideoSettingsGroup(CpItemDataHelper &itemDataHelper);
+
+ /**
+ * Destructor
+ */
+ ~VideoSettingsGroup();
+
+ /**
+ * Getter for the default access point id.
+ *
+ * @return Default access point id.
+ */
+ uint getAccessPointId();
+
+ /**
+ * Setter for the default access point id.
+ *
+ * @param defaultAp Access point id.
+ */
+ void setAccessPointId(const uint& defaultAp);
+
+private slots:
+
+ /**
+ * Slot for when mLowestUDPPortItem editing finishes.
+ */
+ void lowestUdpPortEditingFinished();
+
+ /**
+ * Slot for when mHighestUDPPortItem editing finishes.
+ */
+ void highestUdpPortEditingFinished();
+
+ /**
+ * Slot for when mUseProxyItem editing finishes.
+ */
+ void useProxyToggled(int state);
+
+ /**
+ * Slot for when mProxyServerItem editing finishes.
+ */
+ void proxyServerEditingFinished();
+
+ /**
+ * Slot for when mProxyPortItem editing finishes.
+ */
+ void proxyPortEditingFinished();
+
+ /**
+ * Called when item is shown. Connected to the form's
+ * itemShown signal.
+ */
+ void itemShown(const QModelIndex& index);
+
+private:
+
+ /**
+ * Initializes the mSettingsModel.
+ */
+ void InitSettingsModelL();
+
+ /**
+ * Loads all settings data from the mSettingsModel to items.
+ */
+ void loadSettings();
+
+private:
+
+ /**
+ * Item data helper given by the CP framework.
+ */
+ CpItemDataHelper& mItemDataHelper;
+
+ /**
+ * Holds videos translation file. It's needed to localize texts in this plugin.
+ */
+ QTranslator mTranslator;
+
+ /**
+ * The settings model where settings are loaded and saved.
+ */
+ CMPSettingsModel* mSettingsModel;
+
+ /**
+ * The access point multiselect item.
+ */
+ VideoSettingsAccessPointEntry *mAccessPointItem;
+
+ /**
+ * The lowest UDP port text item.
+ */
+ CpSettingFormItemData *mLowestUDPPortItem;
+
+ /**
+ * The highest UDP port text item.
+ */
+ CpSettingFormItemData *mHighestUDPPortItem;
+
+ /**
+ * The use proxy checkbox item.
+ */
+ CpSettingFormItemData *mUseProxyItem;
+
+ /**
+ * The proxy server text item.
+ */
+ CpSettingFormItemData *mProxyServerItem;
+
+ /**
+ * The proxy port text item.
+ */
+ CpSettingFormItemData *mProxyPortItem;
+};
+
+#endif // VIDEOSETTINGSGROUP_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/inc/videosettingsplugin.h Thu Jul 22 16:34:17 2010 +0100
@@ -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:
+ *
+ */
+#ifndef VIDEOSETTINGSPLUGIN_H
+#define VIDEOSETTINGSPLUGIN_H
+
+#include <qobject.h>
+#include <cpplugininterface.h>
+
+class VideoSettingsPlugin : public QObject, public CpPluginInterface
+{
+ Q_OBJECT
+ Q_INTERFACES(CpPluginInterface)
+
+public:
+
+ /**
+ * Constructor
+ */
+ VideoSettingsPlugin();
+
+ /**
+ * Destructor
+ */
+ virtual ~VideoSettingsPlugin();
+
+ /**
+ * Creates the CpSettingFormItemData for video settings to be shown in control panel.
+ */
+ virtual QList<CpSettingFormItemData*> createSettingFormItemData(CpItemDataHelper &itemDataHelper) const;
+};
+
+#endif // VIDEOSETTINGSPLUGIN_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/rom/videosettingsplugin.iby Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef __VIDEOSETTINGSPLUGIN_IBY__
+#define __VIDEOSETTINGSPLUGIN_IBY__
+
+#include <bldvariant.hrh>
+#include <data_caging_paths_for_iby.hrh>
+
+file=ABI_DIR/BUILD_DIR/videosettingsplugin.dll SHARED_LIB_DIR/videosettingsplugin.dll
+
+data=/epoc32/data/c/resource/qt/plugins/controlpanel/videosettingsplugin.qtplugin resource/qt/plugins/controlpanel/videosettingsplugin.qtplugin
+
+#endif // __VIDEOSETTINGSPLUGIN_IBY__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/src/videosettingsaccesspointentry.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,177 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies 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 "mpxvideo_debug.h"
+#include "videosettingsaccesspointentry.h"
+#include "videosettingsgroup.h"
+#include <cmmanager_shim.h>
+#include <cmconnectionmethod_shim.h>
+#include <cpitemdatahelper.h>
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+VideoSettingsAccessPointEntry::VideoSettingsAccessPointEntry(
+ CpItemDataHelper &itemDataHelper,
+ const QString& text,
+ VideoSettingsGroup *parent) :
+ CpSettingFormEntryItemData(CpSettingFormEntryItemData::ButtonEntryItem,
+ itemDataHelper, text, QString(), QString(), parent),
+ mParent(parent)
+{
+ MPX_ENTER_EXIT(_L("VideoSettingsAccessPointEntry::VideoSettingsAccessPointEntry()"));
+
+ itemDataHelper.addConnection(this,SIGNAL(clicked()),this,SLOT(openSelectionDialogSlot()));
+ mApplSettings = new CmApplSettingsUi(this);
+ connect(mApplSettings, SIGNAL(finished(uint)), this, SLOT(accessPointDialogFinished(uint)));
+ mSelection.result = CmApplSettingsUi::SelectionTypeConnectionMethod;
+ mSelection.id = 0;
+ mCmManager = new CmManagerShim();
+}
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+VideoSettingsAccessPointEntry::~VideoSettingsAccessPointEntry()
+{
+ MPX_ENTER_EXIT(_L("VideoSettingsAccessPointEntry::~VideoSettingsAccessPointEntry()"));
+
+ delete mCmManager;
+}
+
+// ---------------------------------------------------------------------------
+// accessPointNameFromIapId
+// ---------------------------------------------------------------------------
+//
+void VideoSettingsAccessPointEntry::setIapId(const uint& apId)
+{
+ MPX_ENTER_EXIT(_L("VideoSettingsAccessPointEntry::accessPointNameFromIapId()"),
+ _L("apId = %i"), apId);
+
+ QList<uint> cmArray;
+ mCmManager->connectionMethod(cmArray, false);
+
+ bool found = false;
+ foreach(uint id, cmArray)
+ {
+ CmConnectionMethodShim* connMethod = getConnectionMethod(id);
+ if(connMethod && connMethod->getIntAttribute(CMManagerShim::CmIapId) == apId)
+ {
+ mSelection.id = connMethod->getIntAttribute(CMManagerShim::CmId);
+ setAccessPointName(connMethod);
+ found = true;
+ break;
+ }
+ }
+
+ if(!found)
+ {
+ this->setDescription(hbTrId("txt_videos_dblist_none"));
+ }
+}
+
+// ---------------------------------------------------------------------------
+// createSettingView
+// ---------------------------------------------------------------------------
+//
+CpBaseSettingView* VideoSettingsAccessPointEntry::createSettingView() const
+{
+ MPX_ENTER_EXIT(_L("VideoSettingsAccessPointEntry::createSettingView()"));
+
+ // does not create a new view.
+ return 0;
+}
+
+// ---------------------------------------------------------------------------
+// getConnectionMethod
+// ---------------------------------------------------------------------------
+//
+CmConnectionMethodShim* VideoSettingsAccessPointEntry::getConnectionMethod(const uint& id)
+{
+ MPX_ENTER_EXIT(_L("VideoSettingsAccessPointEntry::getConnectionMethod()"));
+
+ CmConnectionMethodShim* connMethod = 0;
+ try {
+ connMethod = mCmManager->connectionMethod(id);
+ } catch (const std::exception& exc) {
+ MPX_DEBUG(_L("Caught exception while fetching connection method. Exception: %s"), exc.what());
+ return 0;
+ }
+
+ return connMethod;
+}
+
+// ---------------------------------------------------------------------------
+// setName
+// ---------------------------------------------------------------------------
+//
+void VideoSettingsAccessPointEntry::setAccessPointName(CmConnectionMethodShim* connMethod)
+{
+ MPX_ENTER_EXIT(_L("VideoSettingsAccessPointEntry::setAccessPointName()"));
+
+ QString name = connMethod->getStringAttribute(CMManagerShim::CmName);
+ this->setDescription(name);
+}
+
+// ---------------------------------------------------------------------------
+// openSelectionDialogSlot
+// ---------------------------------------------------------------------------
+//
+void VideoSettingsAccessPointEntry::openSelectionDialogSlot()
+{
+ MPX_ENTER_EXIT(_L("VideoSettingsAccessPointEntry::openSelectionDialogSlot()"));
+
+ QFlags<CmApplSettingsUi::SelectionDialogItems> listItems;
+ QSet<CmApplSettingsUi::BearerTypeFilter> filter;
+
+ listItems |= CmApplSettingsUi::ShowConnectionMethods;
+
+ mApplSettings->setOptions(listItems, filter);
+ mApplSettings->setSelection(mSelection);
+
+ mApplSettings->open();
+}
+
+// ---------------------------------------------------------------------------
+// accessPointDialogFinished
+// ---------------------------------------------------------------------------
+//
+void VideoSettingsAccessPointEntry::accessPointDialogFinished(uint error)
+{
+ MPX_ENTER_EXIT(_L("VideoSettingsAccessPointEntry::accessPointDialogFinished()"),
+ _L("error = %i"), error);
+
+ if(error == CmApplSettingsUi::ApplSettingsErrorNone)
+ {
+ CmApplSettingsUi::SettingSelection selection =
+ mApplSettings->selection();
+ MPX_DEBUG(_L("New access point connection method id = %i"), selection.id);
+ CmConnectionMethodShim* connMethod = getConnectionMethod(selection.id);
+ if(connMethod)
+ {
+ mSelection.id = selection.id;
+ mParent->setAccessPointId(connMethod->getIntAttribute(CMManagerShim::CmIapId));
+ setAccessPointName(connMethod);
+ }
+ else
+ {
+ MPX_DEBUG(_L("FATAL: Could not find connection method with id %i"), selection.id);
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/src/videosettingsgroup.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,369 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies 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 "mpxvideo_debug.h"
+#include "videosettingsgroup.h"
+#include "videosettingsaccesspointentry.h"
+#include <cpsettingformitemdata.h>
+#include <cpitemdatahelper.h>
+#include <hbdataformmodel.h>
+#include <hblineedit.h>
+#include <hbinputeditorinterface.h>
+#include <hbdataformviewitem.h>
+#include <hbinputstandardfilters.h>
+#include <hbvalidator.h>
+#include <hbpushbutton.h>
+#include <mpsettingsmodel.h>
+#include <MPSettEngPluginImplementationUIDs.hrh>
+#include <xqconversions.h>
+#include <qapplication.h>
+#include <hbapplication.h>
+
+const int PROXY_LOWEST_ACCEPTED_VALUE = 1;
+const int UDP_LOWEST_ACCEPTED_VALUE = 1024;
+const int PORT_HIGHEST_ACCEPTED_VALUE = 65535;
+
+void gValidatePortValues(int& value, int bottom, int top)
+{
+ if(value < bottom)
+ {
+ value = bottom;
+ }
+
+ if(value > top)
+ {
+ value = top;
+ }
+}
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+VideoSettingsGroup::VideoSettingsGroup(CpItemDataHelper &itemDataHelper) :
+ CpSettingFormItemData(HbDataFormModelItem::GroupItem, QString()),
+ mItemDataHelper(itemDataHelper),
+ mSettingsModel(0),
+ mAccessPointItem(0),
+ mLowestUDPPortItem(0),
+ mHighestUDPPortItem(0),
+ mUseProxyItem(0),
+ mProxyServerItem(0),
+ mProxyPortItem(0)
+{
+ MPX_ENTER_EXIT(_L("VideoSettingsGroup::VideoSettingsGroup()"));
+
+ // Load the translation file.
+ QString lang = QLocale::system().name();
+ bool loaded(false);
+
+ loaded = mTranslator.load( "videos_" + lang, QString("c:/resource/qt/translations") );
+
+ if (!loaded)
+ {
+ mTranslator.load("videos_" + lang, QString("z:/resource/qt/translations") );
+ }
+
+ // Install the translator
+ HbApplication* app = qobject_cast<HbApplication*>(qApp);
+ if(app)
+ {
+ app->installTranslator(&mTranslator);
+ }
+
+ this->setLabel(hbTrId("txt_videos_subhead_video_streaming_settings"));
+
+ TRAPD(err, InitSettingsModelL());
+ if(err != KErrNone)
+ {
+ delete mSettingsModel;
+ mSettingsModel = 0;
+ return;
+ }
+
+ itemDataHelper.connectToForm(SIGNAL(itemShown(const QModelIndex)), this, SLOT(itemShown(const QModelIndex)));
+
+ // 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"));
+ 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"));
+ 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->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"));
+ 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"));
+ mProxyPortItem->setContentWidgetData(QString("maxRows"), 1);
+ mItemDataHelper.addConnection(mProxyPortItem, SIGNAL(editingFinished()),
+ this, SLOT(proxyPortEditingFinished()));
+ this->appendChild(mProxyPortItem);
+
+ loadSettings();
+}
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+VideoSettingsGroup::~VideoSettingsGroup()
+{
+ MPX_ENTER_EXIT(_L("VideoSettingsGroup::~VideoSettingsGroup()"));
+
+ TRAP_IGNORE( mSettingsModel->StoreSettingsL() );
+
+ delete mSettingsModel;
+}
+
+// ---------------------------------------------------------------------------
+// getAccessPointId
+// ---------------------------------------------------------------------------
+//
+uint VideoSettingsGroup::getAccessPointId()
+{
+ MPX_ENTER_EXIT(_L("VideoSettingsGroup::getAccessPointId()"));
+
+ TUint32 defaultAp(0);
+ mSettingsModel->GetDefaultAp(defaultAp);
+
+ MPX_DEBUG(_L("Returned access point id = %i"), defaultAp);
+
+ return defaultAp;
+}
+
+// ---------------------------------------------------------------------------
+// setAccessPointId
+// ---------------------------------------------------------------------------
+//
+void VideoSettingsGroup::setAccessPointId(const uint& defaultAp)
+{
+ MPX_ENTER_EXIT(_L("VideoSettingsGroup::setAccessPointId()"),
+ _L("defaultAp = %i"), defaultAp);
+
+ uint oldAp = getAccessPointId();
+
+ if(oldAp != defaultAp)
+ {
+ mSettingsModel->SetDefaultAp(defaultAp);
+ mUseProxyItem->setContentWidgetData(QString("checked"), false);
+ }
+}
+
+// ---------------------------------------------------------------------------
+// lowestUdpPortValueChanged
+// ---------------------------------------------------------------------------
+//
+void VideoSettingsGroup::lowestUdpPortEditingFinished()
+{
+ MPX_ENTER_EXIT(_L("VideoSettingsGroup::lowestUdpPortValueChanged()"));
+
+ int minPort = mLowestUDPPortItem->contentWidgetData(QString("text")).toString().toInt();
+ int maxPort = mHighestUDPPortItem->contentWidgetData(QString("text")).toString().toInt();
+
+ MPX_DEBUG(_L("minudp = %i, maxudp = %i"), minPort, maxPort);
+
+ if(minPort > maxPort)
+ {
+ minPort = maxPort;
+ }
+
+ gValidatePortValues(minPort, UDP_LOWEST_ACCEPTED_VALUE, PORT_HIGHEST_ACCEPTED_VALUE);
+
+ mLowestUDPPortItem->setContentWidgetData(QString("text"), QString::number(minPort));
+
+ mSettingsModel->SetMinUDPPort(minPort);
+}
+
+// ---------------------------------------------------------------------------
+// highestUdpPortValueChanged
+// ---------------------------------------------------------------------------
+//
+void VideoSettingsGroup::highestUdpPortEditingFinished()
+{
+ MPX_ENTER_EXIT(_L("VideoSettingsGroup::highestUdpPortValueChanged()"));
+
+ int maxPort = mHighestUDPPortItem->contentWidgetData(QString("text")).toString().toInt();
+ int minPort = mLowestUDPPortItem->contentWidgetData(QString("text")).toString().toInt();
+
+ MPX_DEBUG(_L("minudp = %i, maxudp = %i"), minPort, maxPort);
+
+ if(maxPort < minPort)
+ {
+ maxPort = minPort;
+ }
+
+ gValidatePortValues(maxPort, UDP_LOWEST_ACCEPTED_VALUE, PORT_HIGHEST_ACCEPTED_VALUE);
+
+ mHighestUDPPortItem->setContentWidgetData(QString("text"), QString::number(maxPort));
+
+ mSettingsModel->SetMaxUDPPort(maxPort);
+}
+
+// ---------------------------------------------------------------------------
+// useProxyToggled
+// ---------------------------------------------------------------------------
+//
+void VideoSettingsGroup::useProxyToggled(int state)
+{
+ MPX_ENTER_EXIT(_L("VideoSettingsGroup::useProxyToggled()"),
+ _L("state = %i"), state);
+
+ mProxyServerItem->setEnabled(state == Qt::Checked);
+ mProxyPortItem->setEnabled(state == Qt::Checked);
+
+ mSettingsModel->SetProxyMode(state == Qt::Checked ? 1 : 0);
+}
+
+// ---------------------------------------------------------------------------
+// proxyServerValueChanged
+// ---------------------------------------------------------------------------
+//
+void VideoSettingsGroup::proxyServerEditingFinished()
+{
+ MPX_ENTER_EXIT(_L("VideoSettingsGroup::proxyServerValueChanged()"));
+
+ QString text = mProxyServerItem->contentWidgetData(QString("text")).toString();
+
+ MPX_DEBUG(_L("new proxy server = '%s'"), text.data());
+
+ HBufC* proxyServer = XQConversions::qStringToS60Desc(text);
+ TRAP_IGNORE( mSettingsModel->SetProxyHostNameL(*proxyServer) );
+ delete proxyServer;
+}
+
+// ---------------------------------------------------------------------------
+// proxyPortValueChanged
+// ---------------------------------------------------------------------------
+//
+void VideoSettingsGroup::proxyPortEditingFinished()
+{
+ MPX_ENTER_EXIT(_L("VideoSettingsGroup::proxyPortValueChanged()"));
+
+ int proxyPort = mProxyPortItem->contentWidgetData(QString("text")).toString().toInt();
+
+ MPX_DEBUG(_L("new proxy port = %i"), proxyPort);
+
+ gValidatePortValues(proxyPort, PROXY_LOWEST_ACCEPTED_VALUE, PORT_HIGHEST_ACCEPTED_VALUE);
+
+ mProxyPortItem->setContentWidgetData(QString("text"), QString::number(proxyPort));
+
+ mSettingsModel->SetProxyPort(proxyPort);
+}
+
+// ---------------------------------------------------------------------------
+// itemShown
+// ---------------------------------------------------------------------------
+//
+void VideoSettingsGroup::itemShown(const QModelIndex& index)
+{
+ MPX_ENTER_EXIT(_L("VideoSettingsGroup::itemShown()"),
+ _L("index row = %i"), index.row());
+
+ HbDataFormModelItem* modelItem = mItemDataHelper.modelItemFromModelIndex(index);
+
+ if(modelItem == mLowestUDPPortItem ||
+ modelItem == mHighestUDPPortItem ||
+ modelItem == mProxyPortItem )
+ {
+ HbLineEdit *editor = static_cast<HbLineEdit *>(mItemDataHelper.widgetFromModelIndex(index));
+
+ editor->setMaxLength(5);
+
+ HbEditorInterface editorIf(editor);
+ editorIf.setFilter(HbDigitsOnlyFilter::instance());
+ }
+
+ if(modelItem == mProxyServerItem)
+ {
+ mItemDataHelper.addConnection(mUseProxyItem, SIGNAL(stateChanged(int)), this, SLOT(useProxyToggled(int)));
+ HbEditorInterface editor(mItemDataHelper.widgetFromModelIndex(index));
+ editor.setFilter(HbUrlFilter::instance());
+ }
+}
+
+// ---------------------------------------------------------------------------
+// InitSettingsModelL
+// ---------------------------------------------------------------------------
+//
+void VideoSettingsGroup::InitSettingsModelL()
+{
+ MPX_ENTER_EXIT(_L("VideoSettingsGroup::InitSettingsModelL()"));
+
+ TUid settingsUid = {KMPSettEngImplUidROP};
+ mSettingsModel = CMPSettingsModel::NewL(settingsUid);
+ mSettingsModel->LoadSettingsL(EConfigUser);
+}
+
+// ---------------------------------------------------------------------------
+// loadSettings
+// ---------------------------------------------------------------------------
+//
+void VideoSettingsGroup::loadSettings()
+{
+ MPX_ENTER_EXIT(_L("VideoSettingsGroup::loadSettings()"));
+
+ int lowestUdpPort(0);
+ mSettingsModel->GetMinUDPPort(lowestUdpPort);
+ mLowestUDPPortItem->setContentWidgetData(QString("text"), QString::number(lowestUdpPort));
+
+ int highestUdpPort(0);
+ mSettingsModel->GetMaxUDPPort(highestUdpPort);
+ mHighestUDPPortItem->setContentWidgetData(QString("text"), QString::number(highestUdpPort));
+
+ int proxyMode(0);
+ mSettingsModel->GetProxyMode(proxyMode);
+ mUseProxyItem->setContentWidgetData(QString("checked"), proxyMode == 1);
+ useProxyToggled(proxyMode == 1 ? Qt::Checked : Qt::Unchecked);
+
+ TBuf<496> proxyServerBuf;
+ mSettingsModel->GetProxyHostName(proxyServerBuf);
+ QString proxyServer = XQConversions::s60DescToQString(proxyServerBuf);
+ mProxyServerItem->setContentWidgetData(QString("text"), proxyServer);
+
+ int proxyPort;
+ mSettingsModel->GetProxyPort(proxyPort);
+ mProxyPortItem->setContentWidgetData(QString("text"), QString::number(proxyPort));
+
+ mAccessPointItem->setIapId(getAccessPointId());
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/src/videosettingsplugin.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -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:
+ *
+ */
+
+#include "videosettingsplugin.h"
+#include "videosettingsgroup.h"
+#include <cpsettingformentryitemdataimpl.h>
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+VideoSettingsPlugin::VideoSettingsPlugin()
+{
+}
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+VideoSettingsPlugin::~VideoSettingsPlugin()
+{
+}
+
+// ---------------------------------------------------------------------------
+// createSettingFormItemData
+// ---------------------------------------------------------------------------
+//
+QList<CpSettingFormItemData*> VideoSettingsPlugin::createSettingFormItemData(CpItemDataHelper &itemDataHelper) const
+{
+ return QList<CpSettingFormItemData*>() << new VideoSettingsGroup(itemDataHelper);
+}
+
+Q_EXPORT_PLUGIN2(videosettingsplugin, VideoSettingsPlugin);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/tsrc/testaccesspointentry/inc/testvideosettingsaccesspointentry.h Thu Jul 22 16:34:17 2010 +0100
@@ -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: TestVideoSettingsAccessPointEntry class definition
+*
+*/
+
+#ifndef TESTVIDEOSETTINGSACCESSPOINTENTRY_H
+#define TESTVIDEOSETTINGSACCESSPOINTENTRY_H
+
+
+// INCLUDES
+#include <qobject.h>
+
+class CpItemDataHelper;
+class VideoSettingsAccessPointEntry;
+class VideoSettingsGroup;
+
+class TestVideoSettingsAccessPointEntry : public QObject
+ {
+
+ Q_OBJECT
+
+signals:
+
+ void testSignal();
+
+private slots:
+
+ /**
+ * called at the very beginning of the test
+ */
+ void initTestCase();
+
+ /**
+ * called at the very end of the test
+ */
+ void cleanupTestCase();
+
+ /**
+ * called at the start of every test.
+ */
+ void init();
+
+ /**
+ * called at the end of every test.
+ */
+ void cleanup();
+
+ /**
+ * tests constructor
+ */
+ void testConstructor();
+
+ /**
+ * tests destructor
+ */
+ void testDestructor();
+
+ /**
+ * tests setIapId
+ */
+ void testSetIapId();
+
+ /**
+ * tests createSettingsView
+ */
+ void testCreateSettingView();
+
+ /**
+ * tests openSelectionDialogSlot
+ */
+ void testOpenSelectionDialogSlot();
+
+ /**
+ * tests accessPointDialogFinished
+ */
+ void testAccessPointDialogFinished();
+
+private:
+
+ CpItemDataHelper* mItemHelper;
+
+ VideoSettingsGroup* mGroup;
+
+ VideoSettingsAccessPointEntry* mTestObject;
+
+ };
+
+#endif // TESTVIDEOSETTINGSACCESSPOINTENTRY_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/tsrc/testaccesspointentry/src/testvideosettingsaccesspointentry.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,243 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: TestVideoSettingsAccessPointEntry class implementation
+*
+*/
+
+// INCLUDE FILES
+#include <QtTest/QtTest>
+#include <qdebug.h>
+#include <hbapplication.h>
+#include <cpitemdatahelper.h>
+
+#include "testvideosettingsaccesspointentry.h"
+#include "videosettingsgroup.h"
+#include "cmmanager_shim.h"
+#include "cmconnectionmethod_shim.h"
+
+// trick to get access to protected/private members.
+#define private public
+#include "videosettingsaccesspointentry.h"
+#undef private
+
+// ---------------------------------------------------------------------------
+// initTestCase
+// ---------------------------------------------------------------------------
+//
+void TestVideoSettingsAccessPointEntry::initTestCase()
+{
+ mItemHelper = new CpItemDataHelper;
+ mGroup = new VideoSettingsGroup(*mItemHelper);
+}
+
+// ---------------------------------------------------------------------------
+// cleanupTestCase
+// ---------------------------------------------------------------------------
+//
+void TestVideoSettingsAccessPointEntry::cleanupTestCase()
+{
+ delete mGroup;
+ mGroup = 0;
+ delete mItemHelper;
+ mItemHelper = 0;
+}
+
+// ---------------------------------------------------------------------------
+// init
+// ---------------------------------------------------------------------------
+//
+void TestVideoSettingsAccessPointEntry::init()
+{
+ mTestObject = new VideoSettingsAccessPointEntry(*mItemHelper, QString("test"), mGroup);
+}
+
+// ---------------------------------------------------------------------------
+// cleanup
+// ---------------------------------------------------------------------------
+//
+void TestVideoSettingsAccessPointEntry::cleanup()
+{
+ delete mTestObject;
+ mTestObject = 0;
+}
+
+// ---------------------------------------------------------------------------
+// testConstructor
+// ---------------------------------------------------------------------------
+//
+void TestVideoSettingsAccessPointEntry::testConstructor()
+{
+ // verify clicked signal connection.
+ ConnectionHolder connection = mItemHelper->mConnections[mTestObject];
+ QCOMPARE( connection.signal, SIGNAL(clicked()) );
+ QVERIFY( connection.receiver == mTestObject );
+ QCOMPARE( connection.method, SLOT(openSelectionDialogSlot()) );
+
+ // verify mApplSettings construction
+ QVERIFY( mTestObject->mApplSettings );
+ QVERIFY( disconnect(mTestObject->mApplSettings, SIGNAL(finished(uint)), mTestObject, SLOT(accessPointDialogFinished(uint))) );
+ connect(mTestObject->mApplSettings, SIGNAL(finished(uint)), mTestObject, SLOT(accessPointDialogFinished(uint)));
+
+ // verify mSelection initial values
+ QVERIFY( mTestObject->mSelection.result == CmApplSettingsUi::SelectionTypeConnectionMethod );
+ QVERIFY( mTestObject->mSelection.id == 0 );
+
+ // verify CmManagerShim construction
+ QVERIFY( mTestObject->mCmManager );
+
+ // verify base class 'construction'
+ QCOMPARE( mTestObject->mText, QString("test") );
+ QVERIFY( mTestObject->mDescription.isNull() );
+}
+
+// ---------------------------------------------------------------------------
+// testConstructor
+// ---------------------------------------------------------------------------
+//
+void TestVideoSettingsAccessPointEntry::testDestructor()
+{
+ CmManagerShim::mDestructorCount = 0;
+ cleanup();
+ QCOMPARE( CmManagerShim::mDestructorCount, 1 );
+}
+
+// ---------------------------------------------------------------------------
+// testSetIapId
+// ---------------------------------------------------------------------------
+//
+void TestVideoSettingsAccessPointEntry::testSetIapId()
+{
+ // with empty cmArray
+ mTestObject->setIapId(5);
+ QCOMPARE( mTestObject->mDescription, hbTrId("txt_videos_dblist_none") );
+
+ // with non-empty cmArray, but id is not found.
+ mTestObject->mCmManager->mConnectionMethods[0] = new CmConnectionMethodShim(0, 4, QString("0"));
+ mTestObject->mCmManager->mConnectionMethods[2] = new CmConnectionMethodShim(2, 6, QString("2"));
+ mTestObject->setIapId(5);
+ QCOMPARE( mTestObject->mDescription, hbTrId("txt_videos_dblist_none") );
+
+ // with non-empty cmArray, and id is found, but CmManagerShim throws at that id.
+ mTestObject->mCmManager->mConnectionMethods[1] = new CmConnectionMethodShim(1, 5, QString("1"));
+ CmManagerShim::mConnectionMethodThrowsAtId = 1;
+ mTestObject->setIapId(5);
+ QCOMPARE( mTestObject->mDescription, hbTrId("txt_videos_dblist_none") );
+
+ // with non-empty cmArray, and id is found.
+ CmManagerShim::mConnectionMethodThrowsAtId = -1;
+ mTestObject->setIapId(5);
+ QCOMPARE( mTestObject->mDescription, QString("1") );
+
+ // with non-empty cmArray, and id is found, but CmManagerShim throws at id before.
+ CmManagerShim::mConnectionMethodThrowsAtId = 0;
+ mTestObject->mDescription = QString();
+ mTestObject->setIapId(5);
+ QCOMPARE( mTestObject->mDescription, QString("1") );
+
+ // with non-empty cmArray, and id is found, but CmManagerShim throws at id after.
+ CmManagerShim::mConnectionMethodThrowsAtId = 2;
+ mTestObject->mDescription = QString();
+ mTestObject->setIapId(5);
+ QCOMPARE( mTestObject->mDescription, QString("1") );
+}
+
+// ---------------------------------------------------------------------------
+// testCreateSettingView
+// ---------------------------------------------------------------------------
+//
+void TestVideoSettingsAccessPointEntry::testCreateSettingView()
+{
+ QVERIFY(mTestObject->callCreateSettingView() == 0 );
+}
+
+// ---------------------------------------------------------------------------
+// testOpenSelectionDialogSlot
+// ---------------------------------------------------------------------------
+//
+void TestVideoSettingsAccessPointEntry::testOpenSelectionDialogSlot()
+{
+ connect(this, SIGNAL(testSignal()), mTestObject, SLOT(openSelectionDialogSlot()));
+ QSet<CmApplSettingsUi::BearerTypeFilter> filter;
+ filter.insert(1);
+ mTestObject->mApplSettings->mListItems = QFlags<CmApplSettingsUi::SelectionDialogItems>();
+ mTestObject->mApplSettings->mBearerTypeFilter = filter;
+ mTestObject->mApplSettings->mOpenCallAmount = 0;
+
+ emit testSignal();
+
+ QVERIFY( mTestObject->mApplSettings->mListItems.testFlag(CmApplSettingsUi::ShowConnectionMethods) );
+ QVERIFY( mTestObject->mApplSettings->mListItems.testFlag(CmApplSettingsUi::ShowDestinations) == false);
+ QCOMPARE( mTestObject->mApplSettings->mBearerTypeFilter.count(), 0);
+ QVERIFY( mTestObject->mApplSettings->mSelection.result == CmApplSettingsUi::SelectionTypeConnectionMethod );
+ QCOMPARE( mTestObject->mApplSettings->mOpenCallAmount, 1 );
+}
+
+// ---------------------------------------------------------------------------
+// testAccessPointDialogFinished
+// ---------------------------------------------------------------------------
+//
+void TestVideoSettingsAccessPointEntry::testAccessPointDialogFinished()
+{
+ // error
+ mTestObject->mApplSettings->mSelection.id = 5;
+ mTestObject->mSelection.id = 0;
+ mTestObject->mDescription = QString();
+ mGroup->mApId = 0;
+
+ mTestObject->mApplSettings->emitFinished(CmApplSettingsUi::ApplSettingsErrorCancel);
+
+ QCOMPARE( mTestObject->mSelection.id, (uint)0 );
+
+ // no error
+ mTestObject->mDescription = QString();
+ mTestObject->mCmManager->mConnectionMethods[5] = new CmConnectionMethodShim(5, 4, QString("5"));
+
+ mTestObject->mApplSettings->emitFinished(CmApplSettingsUi::ApplSettingsErrorNone);
+
+ QCOMPARE( mTestObject->mSelection.id, mTestObject->mApplSettings->mSelection.id );
+ QCOMPARE( mGroup->mApId, (uint)4 );
+ QCOMPARE( mTestObject->mDescription, QString("5") );
+
+ // no error, but CmManagerShim throws at that id.
+ mTestObject->mSelection.id = 0;
+ mTestObject->mDescription = QString();
+ mGroup->mApId = 0;
+ CmManagerShim::mConnectionMethodThrowsAtId = 5;
+
+ mTestObject->mApplSettings->emitFinished(CmApplSettingsUi::ApplSettingsErrorNone);
+
+ QCOMPARE( mTestObject->mSelection.id, (uint)0 );
+ QCOMPARE( mGroup->mApId, (uint)0 );
+ QVERIFY( mTestObject->mDescription.isNull() );
+}
+
+// ---------------------------------------------------------------------------
+// main
+// ---------------------------------------------------------------------------
+//
+int main(int argc, char *argv[])
+{
+ HbApplication app(argc, argv);
+
+ TestVideoSettingsAccessPointEntry tc;
+
+ char *pass[3];
+ pass[0] = argv[0];
+ pass[1] = "-o";
+ pass[2] = "c:\\data\\testvideosettingsaccesspointentry.txt";
+
+ return QTest::qExec(&tc, 3, pass);
+}
+
+// end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/tsrc/testaccesspointentry/stub/inc/cmapplsettingsui.h Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0""
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: CmApplSettingsUi stub
+*
+*/
+
+#ifndef CMAPPLSETTINGSUI_H
+#define CMAPPLSETTINGSUI_H
+
+#include <QObject>
+#include <QFlags>
+#include <QSet>
+
+class CmApplSettingsUi : public QObject
+{
+ Q_OBJECT
+
+public:
+
+ enum SelectionType
+ {
+ //! The user selected a destination
+ SelectionTypeDestination,
+ //! The user selected a connection method
+ SelectionTypeConnectionMethod
+ };
+
+ enum SelectionDialogItems
+ {
+ //! Support destination selection
+ ShowDestinations = 0x01,
+ //! Support connection method selection
+ ShowConnectionMethods = 0x02
+ };
+
+ enum ApplSettingsError {
+ //! No error. Dialog succeeded.
+ ApplSettingsErrorNone = 0,
+ //! Selection was canceled.
+ ApplSettingsErrorCancel,
+ //! No items to show (e.g. too strict filters).
+ ApplSettingsErrorNoContent,
+ //! Settings reading failed.
+ ApplSettingsErrorSettingsRead
+ };
+
+ struct SettingSelection
+ {
+ SelectionType result;
+ uint id;
+ };
+
+ typedef uint BearerTypeFilter;
+
+ /*!
+ Constructor.
+
+ @param parent Parent object.
+ */
+ explicit CmApplSettingsUi(QObject *parent = 0);
+
+ /*!
+ Destructor.
+ */
+ virtual ~CmApplSettingsUi();
+
+ void setOptions(
+ const QFlags<SelectionDialogItems> &listItems,
+ const QSet<BearerTypeFilter> &bearerFilter);
+
+ void setSelection(const SettingSelection &selection);
+
+ SettingSelection selection() const;
+
+ void open();
+
+ void emitFinished(uint status);
+
+signals:
+
+ void finished(uint status);
+
+public: // data
+
+ SettingSelection mSelection;
+
+ QFlags<SelectionDialogItems> mListItems;
+
+ QSet<BearerTypeFilter> mBearerTypeFilter;
+
+ int mOpenCallAmount;
+};
+
+#endif // CMAPPLSETTINGSUI_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/tsrc/testaccesspointentry/stub/inc/cmconnectionmethod_shim.h Thu Jul 22 16:34:17 2010 +0100
@@ -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: CmConnectionMethodShim stub
+ *
+ */
+
+#ifndef CMCONNECTIONMETHOD_SHIM_H
+#define CMCONNECTIONMETHOD_SHIM_H
+
+#include <qstring.h>
+#include <qhash.h>
+#include "cmmanager_shim.h"
+
+class CmConnectionMethodShim
+{
+
+public:
+
+ /*!
+ * Constructor.
+ *
+ * @param[in] cm CM Manager connection method object.
+ */
+ CmConnectionMethodShim(uint id, uint iapId, QString name);
+
+ /*!
+ * Destructor.
+ */
+ ~CmConnectionMethodShim();
+
+ uint getIntAttribute(
+ CMManagerShim::ConnectionMethodAttribute attribute) const;
+
+ QString getStringAttribute(
+ CMManagerShim::ConnectionMethodAttribute attribute) const;
+
+public: // data
+
+ QHash<CMManagerShim::ConnectionMethodAttribute, QVariant> mAttributes;
+
+};
+
+#endif /* CMCONNECTIONMETHOD_SHIM_H */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/tsrc/testaccesspointentry/stub/inc/cmmanager_shim.h Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: CmManagerShim stub
+ */
+
+#ifndef CMMANAGER_SHIM_H
+#define CMMANAGER_SHIM_H
+
+#include <qstring.h>
+#include <qhash.h>
+
+class CmConnectionMethodShim;
+
+namespace CMManagerShim {
+ enum ConnectionMethodAttribute {
+ CmName,
+ CmIapId,
+ CmId,
+ };
+}
+
+
+class CmManagerShim
+{
+
+public:
+
+ /*!
+ * Constructor.
+ */
+ CmManagerShim();
+
+ /*!
+ * Destructor.
+ */
+ ~CmManagerShim();
+
+ /*!
+ * Returns the connection method queried by its ID.
+ *
+ * @param[in] connectionMethodId Id of the connection method.
+ * @return Found connection method instance.
+ */
+ CmConnectionMethodShim *connectionMethod(uint connectionMethodId) const;
+
+ /*!
+ * Returns the list of connection methods that do not belong to any
+ * destination.
+ *
+ * @param[out] cmArray On return it is the array of connection method ids.
+ * @param[in] legacyOnly When set to true only Legacy connection method
+ * ids (connection methods which do not belong to
+ * any destination) will be returned
+ */
+ void connectionMethod(
+ QList<uint> &cmArray,
+ bool legacyOnly = true) const;
+
+
+ void clear();
+
+public: // data
+
+ QHash<uint, CmConnectionMethodShim*> mConnectionMethods;
+
+ static int mConnectionMethodThrowsAtId;
+ static int mDestructorCount;
+};
+
+#endif /* CMMANAGER_SHIM_H */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/tsrc/testaccesspointentry/stub/inc/cpitemdatahelper.h Thu Jul 22 16:34:17 2010 +0100
@@ -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: CpItemDataHelper stub
+*
+*/
+
+#ifndef CP_ITEM_DATA_HELPER_H
+#define CP_ITEM_DATA_HELPER_H
+
+#include <QObject>
+#include <qmap.h>
+
+class HbWidget;
+class QModelIndex;
+class HbDataFormModelItem;
+
+struct ConnectionHolder
+{
+ ConnectionHolder() {}
+
+ ConnectionHolder(const char* signal, QObject* receiver, const char* method)
+ {
+ this->signal = signal;
+ this->receiver = receiver;
+ this->method = method;
+ }
+
+ const char* signal;
+ QObject* receiver;
+ const char* method;
+};
+
+class CpItemDataHelper : public QObject
+{
+ Q_OBJECT
+public:
+ CpItemDataHelper();
+ virtual ~CpItemDataHelper();
+
+ void addConnection(HbDataFormModelItem *item,
+ const char *signal,
+ QObject *receiver,
+ const char *method);
+
+ void connectToForm(const char *signal,
+ QObject *receiver,
+ const char *method);
+
+ HbWidget *widgetFromModelIndex(const QModelIndex &index);
+
+ HbDataFormModelItem *modelItemFromModelIndex(const QModelIndex &index);
+
+public:
+
+ HbWidget* mWidgetReturnValue;
+
+ HbDataFormModelItem* mModelItemReturnValue;
+
+ ConnectionHolder mFormConnection;
+
+ QMap<HbDataFormModelItem*, ConnectionHolder> mConnections;
+};
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/tsrc/testaccesspointentry/stub/inc/cpsettingformentryitemdata.h Thu Jul 22 16:34:17 2010 +0100
@@ -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:
+*
+*/
+
+#ifndef CPSETTINGFORMENTRYITEMDATA_H
+#define CPSETTINGFORMENTRYITEMDATA_H
+
+#include <QObject>
+#include <hbdataformmodelitem.h>
+
+class CpItemDataHelper;
+class CpBaseSettingView;
+
+class CpSettingFormEntryItemData : public QObject, public HbDataFormModelItem
+{
+ Q_OBJECT
+public:
+ enum EntryItemType {
+ ListEntryItem = HbDataFormModelItem::CustomItemBase + 1,
+ ButtonEntryItem = HbDataFormModelItem::CustomItemBase + 2
+ };
+
+ explicit CpSettingFormEntryItemData(
+ EntryItemType type,
+ CpItemDataHelper &itemDataHelper,
+ const QString &text = QString(),
+ const QString &description = QString(),
+ const QString &iconName = QString(),
+ const HbDataFormModelItem *parent = 0);
+
+ virtual ~CpSettingFormEntryItemData();
+
+ QString text() const;
+ void setText(const QString &text);
+
+ QString description() const;
+ void setDescription(const QString &description);
+
+ CpBaseSettingView* callCreateSettingView() const;
+
+private:
+ virtual CpBaseSettingView *createSettingView() const = 0;
+
+public:
+
+ QString mText;
+
+ QString mDescription;
+
+};
+
+#endif //CPSETTINGFORMENTRYITEMDATA_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/tsrc/testaccesspointentry/stub/inc/videosettingsgroup.h Thu Jul 22 16:34:17 2010 +0100
@@ -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:
+ *
+ */
+#ifndef VIDEOSETTINGSGROUP_H
+#define VIDEOSETTINGSGROUP_H
+
+#include <cpsettingformitemdata.h>
+#include <qabstractitemmodel.h>
+
+class CpItemDataHelper;
+
+class VideoSettingsGroup : public CpSettingFormItemData
+{
+ Q_OBJECT
+public:
+
+ /**
+ * Constructor
+ */
+ VideoSettingsGroup(CpItemDataHelper &itemDataHelper);
+
+ /**
+ * Destructor
+ */
+ ~VideoSettingsGroup();
+
+ /**
+ * Setter for the default access point id.
+ *
+ * @param defaultAp Access point id.
+ */
+ void setAccessPointId(const uint& defaultAp);
+
+public:
+ /**
+ * Item data helper given by the CP framework.
+ */
+ CpItemDataHelper& mItemDataHelper;
+
+ /**
+ * Access point id set by the setAccessPointId
+ */
+ uint mApId;
+};
+
+#endif // VIDEOSETTINGSGROUP_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/tsrc/testaccesspointentry/stub/src/cmapplsettingsui.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -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: CmApplSettingsUi stub
+*
+*/
+
+// INCLUDE FILES
+#include "cmapplsettingsui.h"
+
+// ---------------------------------------------------------------------------
+// CmApplSettingsUi
+// ---------------------------------------------------------------------------
+//
+CmApplSettingsUi::CmApplSettingsUi(QObject* parent)
+ : QObject(parent),
+ mOpenCallAmount(0)
+{
+}
+
+// ---------------------------------------------------------------------------
+// CmApplSettingsUi
+// ---------------------------------------------------------------------------
+//
+CmApplSettingsUi::~CmApplSettingsUi()
+{
+}
+
+// ---------------------------------------------------------------------------
+// setOptions
+// ---------------------------------------------------------------------------
+//
+void CmApplSettingsUi::setOptions(
+ const QFlags<SelectionDialogItems> &listItems,
+ const QSet<BearerTypeFilter> &bearerFilter)
+{
+ mListItems = listItems;
+ mBearerTypeFilter = bearerFilter;
+}
+
+// ---------------------------------------------------------------------------
+// setSelection
+// ---------------------------------------------------------------------------
+//
+void CmApplSettingsUi::setSelection(const SettingSelection &selection)
+{
+ mSelection = selection;
+}
+
+// ---------------------------------------------------------------------------
+// selection
+// ---------------------------------------------------------------------------
+//
+CmApplSettingsUi::SettingSelection CmApplSettingsUi::selection() const
+{
+ return mSelection;
+}
+
+// ---------------------------------------------------------------------------
+// open
+// ---------------------------------------------------------------------------
+//
+void CmApplSettingsUi::open()
+{
+ mOpenCallAmount++;
+}
+
+// ---------------------------------------------------------------------------
+// emitFinished
+// ---------------------------------------------------------------------------
+//
+void CmApplSettingsUi::emitFinished(uint status)
+{
+ emit finished(status);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/tsrc/testaccesspointentry/stub/src/cmconnectionmethod_shim.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: CmConnectionMethodShim stub
+*
+*/
+
+// INCLUDE FILES
+#include "cmconnectionmethod_shim.h"
+#include <qlist.h>
+#include <qvariant.h>
+
+// ---------------------------------------------------------------------------
+// CmConnectionMethodShim
+// ---------------------------------------------------------------------------
+//
+CmConnectionMethodShim::CmConnectionMethodShim(uint id, uint iapId, QString name)
+{
+ mAttributes[CMManagerShim::CmId] = id;
+ mAttributes[CMManagerShim::CmIapId] = iapId;
+ mAttributes[CMManagerShim::CmName] = name;
+}
+
+// ---------------------------------------------------------------------------
+// CmConnectionMethodShim
+// ---------------------------------------------------------------------------
+//
+CmConnectionMethodShim::~CmConnectionMethodShim()
+{
+}
+
+// ---------------------------------------------------------------------------
+// getIntAttribute
+// ---------------------------------------------------------------------------
+//
+uint CmConnectionMethodShim::getIntAttribute(
+ CMManagerShim::ConnectionMethodAttribute attribute) const
+{
+ return mAttributes[attribute].toUInt();
+}
+
+// ---------------------------------------------------------------------------
+// getStringAttribute
+// ---------------------------------------------------------------------------
+//
+QString CmConnectionMethodShim::getStringAttribute(
+ CMManagerShim::ConnectionMethodAttribute attribute) const
+{
+ return mAttributes[attribute].toString();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/tsrc/testaccesspointentry/stub/src/cmmanager_shim.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: CmManagerShim stub
+*
+*/
+
+// INCLUDE FILES
+#include "cmmanager_shim.h"
+#include "cmconnectionmethod_shim.h"
+#include <qlist.h>
+
+int CmManagerShim::mDestructorCount = 0;
+int CmManagerShim::mConnectionMethodThrowsAtId = -1;
+
+// ---------------------------------------------------------------------------
+// CmManagerShim
+// ---------------------------------------------------------------------------
+//
+CmManagerShim::CmManagerShim()
+{
+}
+
+// ---------------------------------------------------------------------------
+// CmManagerShim
+// ---------------------------------------------------------------------------
+//
+CmManagerShim::~CmManagerShim()
+{
+ mDestructorCount++;
+ clear();
+}
+
+// ---------------------------------------------------------------------------
+// connectionMethod
+// ---------------------------------------------------------------------------
+//
+CmConnectionMethodShim* CmManagerShim::connectionMethod(uint connectionMethodId) const
+{
+ if(mConnectionMethodThrowsAtId == connectionMethodId)
+ {
+ throw std::exception();
+ }
+
+ return mConnectionMethods.value(connectionMethodId, 0);
+}
+
+// ---------------------------------------------------------------------------
+// connectionMethod
+// ---------------------------------------------------------------------------
+//
+void CmManagerShim::connectionMethod(
+ QList<uint> &cmArray,
+ bool legacyOnly) const
+{
+ Q_UNUSED(legacyOnly);
+ cmArray.append(mConnectionMethods.keys());
+}
+
+// ---------------------------------------------------------------------------
+// clear
+// ---------------------------------------------------------------------------
+//
+void CmManagerShim::clear()
+{
+ foreach(uint key, mConnectionMethods.keys())
+ {
+ delete mConnectionMethods[key];
+ mConnectionMethods[key] = 0;
+ }
+
+ mConnectionMethods.clear();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/tsrc/testaccesspointentry/stub/src/cpitemdatahelper.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: CpItemDataHelper stub
+*
+*/
+
+// INCLUDE FILES
+#include "cpitemdatahelper.h"
+
+// ---------------------------------------------------------------------------
+// CpItemDataHelper
+// ---------------------------------------------------------------------------
+//
+CpItemDataHelper::CpItemDataHelper()
+{
+}
+
+// ---------------------------------------------------------------------------
+// CpItemDataHelper
+// ---------------------------------------------------------------------------
+//
+CpItemDataHelper::~CpItemDataHelper()
+{
+}
+
+// ---------------------------------------------------------------------------
+// addConnection
+// ---------------------------------------------------------------------------
+//
+void CpItemDataHelper::addConnection(HbDataFormModelItem *item,
+ const char *signal,
+ QObject *receiver,
+ const char *method)
+{
+ mConnections[item] = ConnectionHolder(signal, receiver, method);
+}
+
+// ---------------------------------------------------------------------------
+// connectToForm
+// ---------------------------------------------------------------------------
+//
+void CpItemDataHelper::connectToForm(const char *signal,
+ QObject *receiver,
+ const char *method)
+{
+ mFormConnection = ConnectionHolder(signal, receiver, method);
+}
+
+// ---------------------------------------------------------------------------
+// widgetFromModelIndex
+// ---------------------------------------------------------------------------
+//
+HbWidget* CpItemDataHelper::widgetFromModelIndex(const QModelIndex &index)
+{
+ Q_UNUSED(index);
+ return mWidgetReturnValue;
+}
+
+HbDataFormModelItem* CpItemDataHelper::modelItemFromModelIndex(const QModelIndex &index)
+{
+ Q_UNUSED(index);
+ return mModelItemReturnValue;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/tsrc/testaccesspointentry/stub/src/cpsettingformentryitemdata.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,92 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: CpSettingFormEntryItemData stub
+*
+*/
+
+// INCLUDE FILES
+#include "cpsettingformentryitemdata.h"
+
+// ---------------------------------------------------------------------------
+// CpSettingFormEntryItemData
+// ---------------------------------------------------------------------------
+//
+CpSettingFormEntryItemData::CpSettingFormEntryItemData(
+ EntryItemType type,
+ CpItemDataHelper &itemDataHelper,
+ const QString &text,
+ const QString &description,
+ const QString &iconName,
+ const HbDataFormModelItem *parent) :
+ mText(text),
+ mDescription(description)
+{
+ Q_UNUSED(type);
+ Q_UNUSED(itemDataHelper);
+ Q_UNUSED(iconName);
+ Q_UNUSED(parent);
+}
+
+// ---------------------------------------------------------------------------
+// CpSettingFormEntryItemData
+// ---------------------------------------------------------------------------
+//
+CpSettingFormEntryItemData::~CpSettingFormEntryItemData()
+{
+}
+
+// ---------------------------------------------------------------------------
+// text
+// ---------------------------------------------------------------------------
+//
+QString CpSettingFormEntryItemData::text() const
+{
+ return mText;
+}
+
+// ---------------------------------------------------------------------------
+// setText
+// ---------------------------------------------------------------------------
+//
+void CpSettingFormEntryItemData::setText(const QString &text)
+{
+ mText = text;
+}
+
+// ---------------------------------------------------------------------------
+// description
+// ---------------------------------------------------------------------------
+//
+QString CpSettingFormEntryItemData::description() const
+{
+ return mDescription;
+}
+
+// ---------------------------------------------------------------------------
+// setDescription
+// ---------------------------------------------------------------------------
+//
+void CpSettingFormEntryItemData::setDescription(const QString &description)
+{
+ mDescription = description;
+}
+
+// ---------------------------------------------------------------------------
+// callCreateSettingView
+// ---------------------------------------------------------------------------
+//
+CpBaseSettingView* CpSettingFormEntryItemData::callCreateSettingView() const
+{
+ return createSettingView();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/tsrc/testaccesspointentry/stub/src/videosettingsgroup.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -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:
+ *
+ */
+
+#include "videosettingsgroup.h"
+#include <cpitemdatahelper.h>
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+VideoSettingsGroup::VideoSettingsGroup(CpItemDataHelper &itemDataHelper) :
+ CpSettingFormItemData(HbDataFormModelItem::GroupItem,QString("VideoSettings")),
+ mItemDataHelper(itemDataHelper),
+ mApId(0)
+{
+}
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+VideoSettingsGroup::~VideoSettingsGroup()
+{
+}
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+void VideoSettingsGroup::setAccessPointId(const uint& defaultAp)
+{
+ mApId = defaultAp;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/tsrc/testaccesspointentry/testvideosettingsaccesspointentry.pro Thu Jul 22 16:34:17 2010 +0100
@@ -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:
+#
+
+TARGET = testvideosettingsaccesspointentry
+TEMPLATE = app
+
+DEPENDPATH += . \
+ inc \
+ src
+
+INCLUDEPATH += inc \
+ stub/inc \
+ ../../inc \
+ ../../../../inc \
+
+CONFIG += qtestlib \
+ Hb \
+ symbian_test
+
+LIBS += -lcpframework \
+ -lxqutils.dll
+
+# Input
+HEADERS += inc/testvideosettingsaccesspointentry.h \
+ ../../inc/videosettingsaccesspointentry.h \
+ stub/inc/videosettingsgroup.h \
+ stub/inc/cpitemdatahelper.h \
+ stub/inc/cpsettingformentryitemdata.h \
+ stub/inc/cmapplsettingsui.h \
+ stub/inc/cmmanager_shim.h \
+ stub/inc/cmconnectionmethod_shim.h \
+
+SOURCES += src/testvideosettingsaccesspointentry.cpp \
+ ../../src/videosettingsaccesspointentry.cpp \
+ stub/src/videosettingsgroup.cpp \
+ stub/src/cpitemdatahelper.cpp \
+ stub/src/cpsettingformentryitemdata.cpp \
+ stub/src/cmapplsettingsui.cpp \
+ stub/src/cmmanager_shim.cpp \
+ stub/src/cmconnectionmethod_shim.cpp \
+
+TARGET.CAPABILITY = All -Tcb
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/tsrc/testgroup/inc/testvideosettingsgroup.h Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,152 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: TestVideoSettingsGroup class definition
+*
+*/
+
+#ifndef TESTVIDEOSETTINGSGROUP_H
+#define TESTVIDEOSETTINGSGROUP_H
+
+
+// INCLUDES
+#include <qobject.h>
+#include <qabstractitemmodel.h>
+
+class CpItemDataHelper;
+class VideoSettingsGroup;
+
+class TestVideoSettingsGroup : public QObject
+ {
+
+ Q_OBJECT
+
+signals:
+
+ void testTextSignal();
+ void testIntSignal(int);
+ void testShownSignal(const QModelIndex&);
+
+private slots:
+
+ /**
+ * called at the very beginning of the test
+ */
+ void initTestCase();
+
+ /**
+ * called at the very end of the test
+ */
+ void cleanupTestCase();
+
+ /**
+ * called at the start of every test.
+ */
+ void init();
+
+ /**
+ * called at the end of every test.
+ */
+ void cleanup();
+
+ /**
+ * tests mSettingsModel construction.
+ */
+ void testSettingsConstruction();
+
+ /**
+ * tests mAccessPointItem construction.
+ */
+ void testAccessPointConstruction();
+
+ /**
+ * tests mLowestUDPPortItem construction.
+ */
+ void testLowestUdpPortConstruction();
+
+ /**
+ * tests mHighestUDPPortItem construction.
+ */
+ void testHighestUdpPortConstruction();
+
+ /**
+ * tests mUseProxyItem construction.
+ */
+ void testUseProxyConstruction();
+
+ /**
+ * tests mProxyServerItem construction.
+ */
+ void testProxyServerConstruction();
+
+ /**
+ * tests mProxyPortItem construction.
+ */
+ void testProxyPortConstruction();
+
+ /**
+ * tests destructor
+ */
+ void testDestructor();
+
+ /**
+ * tests getAccessPointId
+ */
+ void testGetAccessPointId();
+
+ /**
+ * tests setAccessPointId
+ */
+ void testSetAccessPointId();
+
+ /**
+ * tests lowestUdpPortEditingFinished
+ */
+ void testLowestUdpPortEditingFinished();
+
+ /**
+ * tests highestUdpPortEditingFinished
+ */
+ void testHighestUdpPortEditingFinished();
+
+ /**
+ * tests useProxyToggled
+ */
+ void testUseProxyToggled();
+
+ /**
+ * tests proxyServerEditingFinished
+ */
+ void testProxyServerEditingFinished();
+
+ /**
+ * tests proxyPortEditingFinished
+ */
+ void testProxyPortEditingFinished();
+
+ /**
+ * tests itemShown
+ */
+ void testItemShown();
+
+private:
+
+ CpItemDataHelper* mItemHelper;
+
+ VideoSettingsGroup* mTestObject;
+
+ };
+
+#endif // TESTVIDEOSETTINGSGROUP_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/tsrc/testgroup/src/testvideosettingsgroup.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,543 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: TestVideoSettingsGroup class implementation
+*
+*/
+
+// INCLUDE FILES
+#include <QtTest/QtTest>
+#include <qdebug.h>
+#include <hbapplication.h>
+#include <hblineedit.h>
+#include <hbinputeditorinterface.h>
+#include <hbinputstandardfilters.h>
+#include <MPSettEngPluginImplementationUIDs.hrh>
+
+#include "testvideosettingsgroup.h"
+#include "videosettingsaccesspointentry.h"
+#include "mpsettingsmodel.h"
+#include "hbdataformmodel.h"
+#include "cpitemdatahelper.h"
+#include "hbvalidator.h"
+
+// trick to get access to protected/private members.
+#define private public
+#include "videosettingsgroup.h"
+#undef private
+
+// ---------------------------------------------------------------------------
+// main
+// ---------------------------------------------------------------------------
+//
+int main(int argc, char *argv[])
+{
+ HbApplication app(argc, argv);
+
+ TestVideoSettingsGroup tc;
+
+ char *pass[3];
+ pass[0] = argv[0];
+ pass[1] = "-o";
+ pass[2] = "c:\\data\\testvideosettingsgroup.txt";
+
+ return QTest::qExec(&tc, 3, pass);
+}
+
+// ---------------------------------------------------------------------------
+// initTestCase
+// ---------------------------------------------------------------------------
+//
+void TestVideoSettingsGroup::initTestCase()
+{
+ mItemHelper = new CpItemDataHelper;
+}
+
+// ---------------------------------------------------------------------------
+// cleanupTestCase
+// ---------------------------------------------------------------------------
+//
+void TestVideoSettingsGroup::cleanupTestCase()
+{
+ delete mItemHelper;
+ mItemHelper = 0;
+}
+
+// ---------------------------------------------------------------------------
+// init
+// ---------------------------------------------------------------------------
+//
+void TestVideoSettingsGroup::init()
+{
+ CMPSettingsModel::mImplUid = TUid::Null();
+ CMPSettingsModel::mConfigMode = -1;
+ CMPSettingsModel::mProxyMode = 0;
+ CMPSettingsModel::mHostName = QString("testhostname");
+ CMPSettingsModel::mProxyPort = 4096;
+ CMPSettingsModel::mMinUdpPort = 2048;
+ CMPSettingsModel::mMaxUdpPort = 8080;
+ CMPSettingsModel::mStoreSettingsCount = 0;
+ CMPSettingsModel::mDestructorCount = 0;
+ CMPSettingsModel::mApId = 5;
+ HbEditorInterface::mFilter = 0;
+
+ mTestObject = new VideoSettingsGroup(*mItemHelper);
+}
+
+// ---------------------------------------------------------------------------
+// cleanup
+// ---------------------------------------------------------------------------
+//
+void TestVideoSettingsGroup::cleanup()
+{
+ disconnect();
+ delete mTestObject;
+ mTestObject = 0;
+}
+
+// ---------------------------------------------------------------------------
+// testSettingsConstruction
+// ---------------------------------------------------------------------------
+//
+void TestVideoSettingsGroup::testSettingsConstruction()
+{
+ QVERIFY( mTestObject->mSettingsModel != 0 );
+ QCOMPARE( mTestObject->mSettingsModel->mConfigMode, (int)EConfigUser);
+ QVERIFY( CMPSettingsModel::mImplUid == TUid::Uid(KMPSettEngImplUidROP) );
+
+ // verify also the itemShown connection to form here.
+ QCOMPARE( mItemHelper->mFormConnection.signal, SIGNAL(itemShown(const QModelIndex)) );
+ QVERIFY( mItemHelper->mFormConnection.receiver == mTestObject );
+ QCOMPARE( mItemHelper->mFormConnection.method, SLOT(itemShown(const QModelIndex)) );
+
+ // and that group has correct label
+ QCOMPARE( mTestObject->label(), hbTrId("txt_videos_subhead_video_streaming_settings") );
+}
+
+// ---------------------------------------------------------------------------
+// testAccessPointConstruction
+// ---------------------------------------------------------------------------
+//
+void TestVideoSettingsGroup::testAccessPointConstruction()
+{
+ QVERIFY( mTestObject->mAccessPointItem != 0 );
+ QVERIFY( mTestObject->indexOf(static_cast<HbDataFormModelItem*>(mTestObject->mAccessPointItem)) >= 0 );
+ QCOMPARE( mTestObject->mAccessPointItem->mText, hbTrId("txt_videos_dblist_access_point") );
+ QCOMPARE( mTestObject->mAccessPointItem->mApId, (uint)CMPSettingsModel::mApId );
+}
+
+// ---------------------------------------------------------------------------
+// testLowestUdpPortConstruction
+// ---------------------------------------------------------------------------
+//
+void TestVideoSettingsGroup::testLowestUdpPortConstruction()
+{
+ QVERIFY( mTestObject->mLowestUDPPortItem != 0 );
+ QVERIFY( mTestObject->indexOf(mTestObject->mLowestUDPPortItem) >= 0 );
+ QCOMPARE( mTestObject->mLowestUDPPortItem->contentWidgetData(QString("maxRows")).toInt(), 1);
+ QCOMPARE( mTestObject->mLowestUDPPortItem->contentWidgetData(QString("text")).toString(),
+ QString::number(CMPSettingsModel::mMinUdpPort) );
+
+ ConnectionHolder connection = mItemHelper->mConnections[mTestObject->mLowestUDPPortItem];
+ QCOMPARE( connection.signal, SIGNAL(editingFinished()) );
+ QVERIFY( connection.receiver == mTestObject );
+ QCOMPARE( connection.method, SLOT(lowestUdpPortEditingFinished()) );
+}
+
+// ---------------------------------------------------------------------------
+// testHighestUdpPortConstruction
+// ---------------------------------------------------------------------------
+//
+void TestVideoSettingsGroup::testHighestUdpPortConstruction()
+{
+ QVERIFY( mTestObject->mHighestUDPPortItem != 0 );
+ QVERIFY( mTestObject->indexOf(mTestObject->mHighestUDPPortItem) >= 0 );
+ QCOMPARE( mTestObject->mHighestUDPPortItem->contentWidgetData(QString("maxRows")).toInt(), 1);
+ QCOMPARE( mTestObject->mHighestUDPPortItem->contentWidgetData(QString("text")).toString(),
+ QString::number(CMPSettingsModel::mMaxUdpPort) );
+
+ ConnectionHolder connection = mItemHelper->mConnections[mTestObject->mHighestUDPPortItem];
+ QCOMPARE( connection.signal, SIGNAL(editingFinished()) );
+ QVERIFY( connection.receiver == mTestObject );
+ QCOMPARE( connection.method, SLOT(highestUdpPortEditingFinished()) );
+}
+
+// ---------------------------------------------------------------------------
+// testUseProxyConstruction
+// ---------------------------------------------------------------------------
+//
+void TestVideoSettingsGroup::testUseProxyConstruction()
+{
+ QVERIFY( mTestObject->mUseProxyItem != 0 );
+ QVERIFY( mTestObject->indexOf(mTestObject->mUseProxyItem) >= 0 );
+ QCOMPARE( mTestObject->mUseProxyItem->contentWidgetData(QString("checked")).toBool(),
+ CMPSettingsModel::mProxyMode == 1 );
+
+ // connection checking in the testItemShown.
+}
+
+// ---------------------------------------------------------------------------
+// testProxyServerConstruction
+// ---------------------------------------------------------------------------
+//
+void TestVideoSettingsGroup::testProxyServerConstruction()
+{
+ QVERIFY( mTestObject->mProxyServerItem != 0 );
+ QVERIFY( mTestObject->indexOf(mTestObject->mProxyServerItem) >= 0 );
+ QCOMPARE( mTestObject->mProxyServerItem->contentWidgetData(QString("maxRows")).toInt(), 1);
+ QCOMPARE( mTestObject->mProxyServerItem->contentWidgetData(QString("text")).toString(),
+ CMPSettingsModel::mHostName );
+ QCOMPARE( mTestObject->mProxyServerItem->contentWidgetData(QString("placeholderText")).toString(),
+ hbTrId("txt_videos_dblist_none") );
+
+ ConnectionHolder connection = mItemHelper->mConnections[mTestObject->mProxyServerItem];
+ QCOMPARE( connection.signal, SIGNAL(editingFinished()) );
+ QVERIFY( connection.receiver == mTestObject );
+ QCOMPARE( connection.method, SLOT(proxyServerEditingFinished()) );
+}
+
+// ---------------------------------------------------------------------------
+// testProxyPortConstruction
+// ---------------------------------------------------------------------------
+//
+void TestVideoSettingsGroup::testProxyPortConstruction()
+{
+ QVERIFY( mTestObject->mProxyPortItem != 0 );
+ QVERIFY( mTestObject->indexOf(mTestObject->mProxyPortItem) >= 0 );
+ QCOMPARE( mTestObject->mProxyPortItem->contentWidgetData(QString("maxRows")).toInt(), 1);
+ QCOMPARE( mTestObject->mProxyPortItem->contentWidgetData(QString("text")).toString(),
+ QString::number(CMPSettingsModel::mProxyPort) );
+
+ ConnectionHolder connection = mItemHelper->mConnections[mTestObject->mProxyPortItem];
+ QCOMPARE( connection.signal, SIGNAL(editingFinished()) );
+ QVERIFY( connection.receiver == mTestObject );
+ QCOMPARE( connection.method, SLOT(proxyPortEditingFinished()) );
+}
+
+// ---------------------------------------------------------------------------
+// testDestructor
+// ---------------------------------------------------------------------------
+//
+void TestVideoSettingsGroup::testDestructor()
+{
+ delete mTestObject;
+ mTestObject = 0;
+ QCOMPARE( CMPSettingsModel::mStoreSettingsCount, 1 );
+ QCOMPARE( CMPSettingsModel::mDestructorCount, 1 );
+}
+
+// ---------------------------------------------------------------------------
+// testDestructor
+// ---------------------------------------------------------------------------
+//
+void TestVideoSettingsGroup::testGetAccessPointId()
+{
+ CMPSettingsModel::mApId = 4;
+
+ QCOMPARE( mTestObject->getAccessPointId(), (uint)CMPSettingsModel::mApId );
+}
+
+// ---------------------------------------------------------------------------
+// testDestructor
+// ---------------------------------------------------------------------------
+//
+void TestVideoSettingsGroup::testSetAccessPointId()
+{
+ QString string("test");
+ CMPSettingsModel::mApId = -1;
+ mTestObject->mUseProxyItem->setContentWidgetData(QString("checked"), true);
+ mTestObject->mProxyServerItem->setContentWidgetData(QString("text"), string);
+ CMPSettingsModel::mHostName = string;
+
+ // given ap id is different from the one that is saved in settingsmodel.
+ uint ap = 3;
+ mTestObject->setAccessPointId(ap);
+ QCOMPARE( CMPSettingsModel::mApId, (int)ap );
+ QVERIFY( mTestObject->mUseProxyItem->contentWidgetData(QString("checked")).toBool() == false );
+ QCOMPARE( mTestObject->mProxyServerItem->contentWidgetData(QString("text")).toString(), string );
+ QCOMPARE( CMPSettingsModel::mHostName, string );
+
+ mTestObject->mUseProxyItem->setContentWidgetData(QString("checked"), true);
+ mTestObject->mProxyServerItem->setContentWidgetData(QString("text"), string);
+ CMPSettingsModel::mHostName = string;
+
+ // given ap id is the same than the one that is saved in settingsmodel.
+ mTestObject->setAccessPointId(ap);
+ QCOMPARE( CMPSettingsModel::mApId, (int)ap );
+ QVERIFY( mTestObject->mUseProxyItem->contentWidgetData(QString("checked")).toBool() );
+ QCOMPARE( mTestObject->mProxyServerItem->contentWidgetData(QString("text")).toString(), string );
+ QCOMPARE( CMPSettingsModel::mHostName, string );
+}
+
+// ---------------------------------------------------------------------------
+// testLowestUdpPortEditingFinished
+// ---------------------------------------------------------------------------
+//
+void TestVideoSettingsGroup::testLowestUdpPortEditingFinished()
+{
+ connect(this, SIGNAL(testTextSignal()),
+ mTestObject, SLOT(lowestUdpPortEditingFinished()));
+
+ // normal case where min port is less than max port and both are in acceptable range.
+ QString highText("10000");
+ mTestObject->mHighestUDPPortItem->setContentWidgetData(QString("text"), highText);
+
+ QString testString("1024");
+ mTestObject->mLowestUDPPortItem->setContentWidgetData(QString("text"), testString);
+
+ emit testTextSignal();
+
+ QCOMPARE( CMPSettingsModel::mMinUdpPort, testString.toInt() );
+
+ // min port greater than max port, both are in acceptable range.
+ CMPSettingsModel::mMinUdpPort = 0;
+ mTestObject->mLowestUDPPortItem->setContentWidgetData(QString("text"), QString("10001"));
+
+ emit testTextSignal();
+
+ QCOMPARE( CMPSettingsModel::mMinUdpPort, highText.toInt() );
+
+ // min port same as max port and in acceptable range.
+ CMPSettingsModel::mMinUdpPort = 0;
+ testString = "10000";
+ mTestObject->mLowestUDPPortItem->setContentWidgetData(QString("text"), testString);
+
+ emit testTextSignal();
+
+ QCOMPARE( CMPSettingsModel::mMinUdpPort, testString.toInt() );
+
+ // min port less than 1024
+ CMPSettingsModel::mMinUdpPort = 0;
+ mTestObject->mLowestUDPPortItem->setContentWidgetData(QString("text"), QString("1023"));
+
+ emit testTextSignal();
+
+ QCOMPARE( CMPSettingsModel::mMinUdpPort, 1024 );
+ QCOMPARE( mTestObject->mLowestUDPPortItem->contentWidgetData(QString("text")).toString(), QString("1024") );
+
+ // min port greater than 65535
+ CMPSettingsModel::mMinUdpPort = 0;
+ mTestObject->mHighestUDPPortItem->setContentWidgetData(QString("text"), QString("65536"));
+ mTestObject->mLowestUDPPortItem->setContentWidgetData(QString("text"), QString("65536"));
+
+ emit testTextSignal();
+
+ QCOMPARE( CMPSettingsModel::mMinUdpPort, 65535 );
+ QCOMPARE( mTestObject->mLowestUDPPortItem->contentWidgetData(QString("text")).toString(), QString("65535") );
+
+ // min port field empty
+ CMPSettingsModel::mMinUdpPort = 0;
+ mTestObject->mLowestUDPPortItem->setContentWidgetData(QString("text"), QString(""));
+
+ emit testTextSignal();
+
+ QCOMPARE( CMPSettingsModel::mMinUdpPort, 1024 );
+ QCOMPARE( mTestObject->mLowestUDPPortItem->contentWidgetData(QString("text")).toString(), QString("1024") );
+}
+
+// ---------------------------------------------------------------------------
+// testHighestUdpPortEditingFinished
+// ---------------------------------------------------------------------------
+//
+void TestVideoSettingsGroup::testHighestUdpPortEditingFinished()
+{
+ connect(this, SIGNAL(testTextSignal()),
+ mTestObject, SLOT(highestUdpPortEditingFinished()));
+
+ // normal case where min port is less than max port and both are in acceptable range.
+ QString lowText("2000");
+ mTestObject->mLowestUDPPortItem->setContentWidgetData(QString("text"), lowText);
+
+ QString testString("65535");
+ mTestObject->mHighestUDPPortItem->setContentWidgetData(QString("text"), testString);
+
+ emit testTextSignal();
+
+ QCOMPARE( CMPSettingsModel::mMaxUdpPort, testString.toInt() );
+
+ // max port less than min port, both in acceptable range.
+ CMPSettingsModel::mMaxUdpPort = 0;
+ mTestObject->mHighestUDPPortItem->setContentWidgetData(QString("text"), QString("1999"));
+
+ emit testTextSignal();
+
+ QCOMPARE( CMPSettingsModel::mMaxUdpPort, lowText.toInt() );
+
+ // max port same as min port and in acceptable range.
+ CMPSettingsModel::mMaxUdpPort = 0;
+ testString = "2000";
+ mTestObject->mHighestUDPPortItem->setContentWidgetData(QString("text"), testString);
+
+ emit testTextSignal();
+
+ QCOMPARE( CMPSettingsModel::mMaxUdpPort, testString.toInt() );
+
+ // max port less than 1024
+ CMPSettingsModel::mMaxUdpPort = 0;
+ mTestObject->mHighestUDPPortItem->setContentWidgetData(QString("text"), QString("1023"));
+ mTestObject->mLowestUDPPortItem->setContentWidgetData(QString("text"), QString("1023"));
+
+ emit testTextSignal();
+
+ QCOMPARE( CMPSettingsModel::mMaxUdpPort, 1024 );
+ QCOMPARE( mTestObject->mHighestUDPPortItem->contentWidgetData(QString("text")).toString(), QString("1024") );
+
+ // max port greater than 65535
+ CMPSettingsModel::mMaxUdpPort = 0;
+ mTestObject->mHighestUDPPortItem->setContentWidgetData(QString("text"), QString("65536"));
+
+ emit testTextSignal();
+
+ QCOMPARE( CMPSettingsModel::mMaxUdpPort, 65535 );
+ QCOMPARE( mTestObject->mHighestUDPPortItem->contentWidgetData(QString("text")).toString(), QString("65535") );
+
+ // max port field empty
+ CMPSettingsModel::mMaxUdpPort = 0;
+ mTestObject->mHighestUDPPortItem->setContentWidgetData(QString("text"), QString(""));
+
+ emit testTextSignal();
+
+ QCOMPARE( CMPSettingsModel::mMaxUdpPort, 1024 );
+ QCOMPARE( mTestObject->mHighestUDPPortItem->contentWidgetData(QString("text")).toString(), QString("1024") );
+}
+
+// ---------------------------------------------------------------------------
+// testUseProxyToggled
+// ---------------------------------------------------------------------------
+//
+void TestVideoSettingsGroup::testUseProxyToggled()
+{
+ connect(this, SIGNAL(testIntSignal(int)),
+ mTestObject, SLOT(useProxyToggled(int)));
+
+ emit testIntSignal(Qt::Unchecked);
+
+ QVERIFY( mTestObject->mProxyServerItem->isEnabled() == false );
+ QVERIFY( mTestObject->mProxyPortItem->isEnabled() == false );
+ QCOMPARE( CMPSettingsModel::mProxyMode, 0);
+
+ emit testIntSignal(Qt::Checked);
+
+ QVERIFY( mTestObject->mProxyServerItem->isEnabled() );
+ QVERIFY( mTestObject->mProxyPortItem->isEnabled() );
+ QCOMPARE( CMPSettingsModel::mProxyMode, 1);
+}
+
+// ---------------------------------------------------------------------------
+// testProxyServerEditingFinished
+// ---------------------------------------------------------------------------
+//
+void TestVideoSettingsGroup::testProxyServerEditingFinished()
+{
+ connect(this, SIGNAL(testTextSignal()),
+ mTestObject, SLOT(proxyServerEditingFinished()));
+
+ QString testString("testtesttest");
+ mTestObject->mProxyServerItem->setContentWidgetData(QString("text"), testString);
+
+ emit testTextSignal();
+ QCOMPARE( CMPSettingsModel::mHostName, testString );
+}
+
+// ---------------------------------------------------------------------------
+// testProxyPortEditingFinished
+// ---------------------------------------------------------------------------
+//
+void TestVideoSettingsGroup::testProxyPortEditingFinished()
+{
+ connect(this, SIGNAL(testTextSignal()),
+ mTestObject, SLOT(proxyPortEditingFinished()));
+
+ // proxy port at lowest accepted range.
+ QString testString("1");
+ mTestObject->mProxyPortItem->setContentWidgetData(QString("text"), testString);
+
+ emit testTextSignal();
+ QCOMPARE( CMPSettingsModel::mProxyPort, testString.toInt() );
+
+ // proxy port at highest accepted range.
+ testString = "65535";
+ mTestObject->mProxyPortItem->setContentWidgetData(QString("text"), testString);
+
+ emit testTextSignal();
+ QCOMPARE( CMPSettingsModel::mProxyPort, testString.toInt() );
+
+ // proxy port 0
+ mTestObject->mProxyPortItem->setContentWidgetData(QString("text"), QString("0"));
+
+ emit testTextSignal();
+ QCOMPARE( CMPSettingsModel::mProxyPort, 1 );
+ QCOMPARE( mTestObject->mProxyPortItem->contentWidgetData(QString("text")).toString(), QString("1") );
+
+ // proxy port higher than accepted.
+ mTestObject->mProxyPortItem->setContentWidgetData(QString("text"), QString("65536"));
+
+ emit testTextSignal();
+ QCOMPARE( CMPSettingsModel::mProxyPort, 65535 );
+ QCOMPARE( mTestObject->mProxyPortItem->contentWidgetData(QString("text")).toString(), QString("65535") );
+
+ // proxy port empty
+ mTestObject->mProxyPortItem->setContentWidgetData(QString("text"), QString(""));
+
+ emit testTextSignal();
+ QCOMPARE( CMPSettingsModel::mProxyPort, 1 );
+ QCOMPARE( mTestObject->mProxyPortItem->contentWidgetData(QString("text")).toString(), QString("1") );
+}
+
+// ---------------------------------------------------------------------------
+// testItemShown
+// ---------------------------------------------------------------------------
+//
+void TestVideoSettingsGroup::testItemShown()
+{
+ connect(this, SIGNAL(testShownSignal(const QModelIndex&)),
+ mTestObject, SLOT(itemShown(const QModelIndex&)));
+
+ QModelIndex index;
+
+ HbLineEdit* editor = new HbLineEdit();
+ mItemHelper->mWidgetReturnValue = editor;
+
+ mItemHelper->mModelItemReturnValue = mTestObject->mLowestUDPPortItem;
+ HbEditorInterface::mFilter = 0;
+ emit testShownSignal(index);
+ QVERIFY( HbEditorInterface::mFilter == HbDigitsOnlyFilter::instance() );
+ QCOMPARE( editor->mMaxLength, 5 );
+
+ mItemHelper->mModelItemReturnValue = mTestObject->mProxyPortItem;
+ HbEditorInterface::mFilter = 0;
+ emit testShownSignal(index);
+ QVERIFY( HbEditorInterface::mFilter == HbDigitsOnlyFilter::instance() );
+ QCOMPARE( editor->mMaxLength, 5 );
+
+ mItemHelper->mModelItemReturnValue = mTestObject->mHighestUDPPortItem;
+ HbEditorInterface::mFilter = 0;
+ emit testShownSignal(index);
+ QVERIFY( HbEditorInterface::mFilter == HbDigitsOnlyFilter::instance() );
+ QCOMPARE( editor->mMaxLength, 5 );
+
+ mItemHelper->mModelItemReturnValue = mTestObject->mProxyServerItem;
+ HbEditorInterface::mFilter = 0;
+ emit testShownSignal(index);
+ QVERIFY( HbEditorInterface::mFilter == HbUrlFilter::instance() );
+
+ // verify the use proxy connection:
+ ConnectionHolder connection = mItemHelper->mConnections[mTestObject->mUseProxyItem];
+ QCOMPARE( connection.signal, SIGNAL(stateChanged(int)) );
+ QVERIFY( connection.receiver == mTestObject );
+ QCOMPARE( connection.method, SLOT(useProxyToggled(int)) );
+
+ delete editor;
+}
+
+// end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/tsrc/testgroup/stub/inc/cpitemdatahelper.h Thu Jul 22 16:34:17 2010 +0100
@@ -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: CpItemDataHelper stub
+*
+*/
+
+#ifndef CP_ITEM_DATA_HELPER_H
+#define CP_ITEM_DATA_HELPER_H
+
+#include <QObject>
+#include <qmap.h>
+
+class HbWidget;
+class QModelIndex;
+class HbDataFormModelItem;
+
+struct ConnectionHolder
+{
+ ConnectionHolder() {}
+
+ ConnectionHolder(const char* signal, QObject* receiver, const char* method)
+ {
+ this->signal = signal;
+ this->receiver = receiver;
+ this->method = method;
+ }
+
+ const char* signal;
+ QObject* receiver;
+ const char* method;
+};
+
+class CpItemDataHelper : public QObject
+{
+ Q_OBJECT
+public:
+ CpItemDataHelper();
+ virtual ~CpItemDataHelper();
+
+ void addConnection(HbDataFormModelItem *item,
+ const char *signal,
+ QObject *receiver,
+ const char *method);
+
+ void connectToForm(const char *signal,
+ QObject *receiver,
+ const char *method);
+
+ HbWidget *widgetFromModelIndex(const QModelIndex &index);
+
+ HbDataFormModelItem *modelItemFromModelIndex(const QModelIndex &index);
+
+public:
+
+ HbWidget* mWidgetReturnValue;
+
+ HbDataFormModelItem* mModelItemReturnValue;
+
+ ConnectionHolder mFormConnection;
+
+ QMap<HbDataFormModelItem*, ConnectionHolder> mConnections;
+};
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/tsrc/testgroup/stub/inc/hbdataformmodel.h Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: HbDataFormModel stub
+*
+*/
+
+#ifndef HBDATAFORMMODEL_H
+#define HBDATAFORMMODEL_H
+
+#include <QAbstractItemModel>
+
+#include <hbglobal.h>
+#include <hbdataformmodelitem.h>
+
+class HbDataFormModel : public QAbstractItemModel
+{
+ Q_OBJECT
+
+public:
+
+ HbDataFormModel(QObject *parent = 0);
+ virtual ~HbDataFormModel();
+
+ HbDataFormModelItem* itemFromIndex(const QModelIndex &index) const;
+
+ virtual QModelIndex index(int row, int column,
+ const QModelIndex &parent = QModelIndex()) const;
+ virtual QModelIndex parent(const QModelIndex &child) const;
+ virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
+ virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
+ virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
+
+public:
+
+ HbDataFormModelItem* mItemReturnValue;
+
+};
+
+#endif //HBDATAFORMMODEL_H
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/tsrc/testgroup/stub/inc/hbinputeditorinterface.h Thu Jul 22 16:34:17 2010 +0100
@@ -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: HbLineEdit stub
+*
+*/
+#ifndef HB_EDITOR_INTERFACE_H
+#define HB_EDITOR_INTERFACE_H
+
+#include <QObject>
+
+#include <hbinputfilter.h>
+
+class HbEditorInterface : public QObject
+{
+ Q_OBJECT
+
+public:
+ HbEditorInterface(QObject* editor);
+ ~HbEditorInterface();
+
+ void setFilter(HbInputFilter *filter);
+
+public:
+
+ static HbInputFilter* mFilter;
+};
+
+#endif // HB_EDITOR_INTERFACE_H
+
+// End of file
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/tsrc/testgroup/stub/inc/hblineedit.h Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0""
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: HbLineEdit stub
+*
+*/
+
+#ifndef HBLINEEDIT_H
+#define HBLINEEDIT_H
+
+#include <qgraphicsitem.h>
+#include <hbwidget.h>
+#include <qstring.h>
+#include <hbvalidator.h>
+
+class HbLineEdit : public HbWidget
+{
+ Q_OBJECT
+
+public:
+
+ HbLineEdit(QGraphicsItem *parent = 0);
+ HbLineEdit(const QString &text, QGraphicsItem *parent = 0);
+ virtual ~HbLineEdit();
+
+ void setValidator(HbValidator *validator);
+
+ void setMaxLength(int max);
+
+public:
+
+ HbValidator* mValidator;
+
+ int mMaxLength;
+
+};
+
+#endif // HBLINEEDIT_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/tsrc/testgroup/stub/inc/hbvalidator.h Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0""
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: HbValidator stub
+*
+*/
+
+#ifndef HBVALIDATOR_H
+#define HBVALIDATOR_H
+
+#include <hbglobal.h>
+#include <QObject>
+
+#include <QValidator>
+
+class HbValidator : public QObject
+{
+public:
+ HbValidator(QObject *parent=0);
+ virtual ~HbValidator();
+
+ void addField(QValidator *validator, const QString &defaultValue);
+
+public:
+
+ QList<QValidator*> mValidators;
+ QList<QString> mDefaultValues;
+
+};
+
+#endif // HBVALIDATOR_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/tsrc/testgroup/stub/inc/mpsettingsmodel.h Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,210 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: CMPSettingsModel stub
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+
+#ifndef MMPSETTINGSMODEL_H
+#define MMPSETTINGSMODEL_H
+
+// INCLUDES
+#include <e32std.h>
+#include <qstring.h>
+
+// DATA TYPES
+// Config file version
+enum TConfigVersion
+ {
+ EConfigDefault,
+ EConfigUser
+ };
+
+// Bearer type
+enum TDataBearer
+ {
+ EBearerGPRS,
+ EBearerEGPRS,
+ EBearerWCDMA,
+ EBearerCDMA,
+ EBearerCDMA2000,
+ EBearerWLAN,
+ EBearerHSDPA
+ };
+
+// CLASS DECLARATION
+
+/**
+* CMPSettingsModel
+* Common API for MMF specific settings models.
+*
+* @lib MPSettEngine.dll
+* @since 2.0
+*/
+class CMPSettingsModel
+ {
+ public:
+
+ /**
+ * Constructor. Uses ECom to construct an instance of this class.
+ * @param aUid Implementation uid of the object that is to be constructed.
+ */
+ static CMPSettingsModel* NewL(TUid aUid);
+
+ /**
+ * Constructor
+ */
+ CMPSettingsModel();
+
+ /**
+ * Destructor.
+ */
+ virtual ~CMPSettingsModel();
+
+ public: // New functions
+
+ /**
+ * Reads settings from MMF controller.
+ * @since 2.0
+ * @param aSettingsType Settings value type:
+ * EConfigDefault: Load default values
+ * EConfigUser: Load user values
+ */
+ void LoadSettingsL(TInt aConfigVersion);
+
+ /**
+ * Writes settings to MMF controller.
+ * @since 2.0
+ */
+ void StoreSettingsL();
+
+ /**
+ * Sets proxy mode..
+ * @since 2.0
+ * @param aMode Proxy mode.
+ * @return Error value.
+ */
+ TInt SetProxyMode(TInt aMode);
+
+ /**
+ * Returns proxy mode.
+ * @since 2.0
+ * @param aMode Proxy mode:
+ * 0: Disabled
+ * 1: Enabled
+ * @return Error value.
+ */
+ TInt GetProxyMode(TInt& aMode);
+
+ /**
+ * Sets Proxy host name.
+ * @since 2.0
+ * @param aHostName Proxy host name.
+ * @return Error value.
+ */
+ TInt SetProxyHostNameL(const TDesC& aHostName);
+
+ /**
+ * Returns proxy host name.
+ * @since 2.0
+ * @param aHostName Proxy host name.
+ * @return Error value.
+ */
+ TInt GetProxyHostName(TDes& aHostName);
+
+ /**
+ * Sets proxy port number.
+ * @since 2.0
+ * @param aPort Proxy port number.
+ * @return Error value.
+ */
+ TInt SetProxyPort(TInt aPort);
+
+ /**
+ * Returns proxy port number..
+ * @since 2.0
+ * @return Integer: Proxy port number.
+ * @return Error value.
+ */
+ TInt GetProxyPort(TInt& aPort);
+
+ /**
+ * Sets default access point.
+ * @since 2.0
+ * @param aApId Access point ID.
+ * @return Error value.
+ */
+ TInt SetDefaultAp(TUint32 aApId);
+
+ /**
+ * Returns default access point ID.
+ * @since 2.0
+ * @param aApId Access point ID.
+ * @return Error value.
+ */
+ TInt GetDefaultAp(TUint32& aApId);
+
+ /**
+ * Sets minimum UDP port number.
+ * @since 2.0
+ * @param aPort minimum port number.
+ * @return Error value.
+ */
+ TInt SetMinUDPPort(TInt aPort);
+
+ /**
+ * Returns minimum UDP port number.
+ * @since 2.0
+ * @param aPort minimum UDP port number in minutes.
+ * @return Error value.
+ */
+ TInt GetMinUDPPort(TInt& aPort);
+
+ /**
+ * Sets maximum UDP port number.
+ * @since 2.0
+ * @param aPort maximum port number.
+ * @return Error value.
+ */
+ TInt SetMaxUDPPort(TInt aPort);
+
+ /**
+ * Returns maximum UDP port number.
+ * @since 2.0
+ * @param aPort maximum UDP port number in minutes.
+ * @return Error value.
+ */
+ TInt GetMaxUDPPort(TInt& aPort);
+
+public:
+ static TUid mImplUid;
+ static TInt mConfigMode;
+ static TInt mProxyMode;
+ static QString mHostName;
+ static TInt mProxyPort;
+ static TInt mMinUdpPort;
+ static TInt mMaxUdpPort;
+ static int mStoreSettingsCount;
+ static int mDestructorCount;
+ static int mApId;
+
+ };
+
+#endif // MMPSETTINGSMODEL_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/tsrc/testgroup/stub/inc/videosettingsaccesspointentry.h Thu Jul 22 16:34:17 2010 +0100
@@ -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: VideoSettingsAccessPointEntry stub
+ *
+ */
+#ifndef VIDEOSETTINGSACCESSPOINTENTRY_H
+#define VIDEOSETTINGSACCESSPOINTENTRY_H
+
+#include <cpsettingformitemdata.h>
+
+class VideoSettingsGroup;
+
+class VideoSettingsAccessPointEntry : public CpSettingFormItemData
+{
+ Q_OBJECT
+public:
+
+ /**
+ * Constructor
+ */
+ VideoSettingsAccessPointEntry(CpItemDataHelper &itemDataHelper,
+ const QString& text = QString(),
+ VideoSettingsGroup *parent = 0);
+
+ /**
+ * Destructor
+ */
+ ~VideoSettingsAccessPointEntry();
+
+ /**
+ * sets the iap id.
+ *
+ * @param apId The iap id.
+ */
+ void setIapId(const uint& apId);
+
+public:
+
+ QString mText;
+
+ VideoSettingsGroup* mParent;
+
+ uint mApId;
+
+};
+
+#endif // VIDEOSETTINGSACCESSPOINTENTRY_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/tsrc/testgroup/stub/src/cpitemdatahelper.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: CpItemDataHelper stub
+*
+*/
+
+// INCLUDE FILES
+#include "cpitemdatahelper.h"
+
+// ---------------------------------------------------------------------------
+// CpItemDataHelper
+// ---------------------------------------------------------------------------
+//
+CpItemDataHelper::CpItemDataHelper()
+{
+}
+
+// ---------------------------------------------------------------------------
+// CpItemDataHelper
+// ---------------------------------------------------------------------------
+//
+CpItemDataHelper::~CpItemDataHelper()
+{
+}
+
+// ---------------------------------------------------------------------------
+// addConnection
+// ---------------------------------------------------------------------------
+//
+void CpItemDataHelper::addConnection(HbDataFormModelItem *item,
+ const char *signal,
+ QObject *receiver,
+ const char *method)
+{
+ mConnections[item] = ConnectionHolder(signal, receiver, method);
+}
+
+// ---------------------------------------------------------------------------
+// connectToForm
+// ---------------------------------------------------------------------------
+//
+void CpItemDataHelper::connectToForm(const char *signal,
+ QObject *receiver,
+ const char *method)
+{
+ mFormConnection = ConnectionHolder(signal, receiver, method);
+}
+
+// ---------------------------------------------------------------------------
+// widgetFromModelIndex
+// ---------------------------------------------------------------------------
+//
+HbWidget* CpItemDataHelper::widgetFromModelIndex(const QModelIndex &index)
+{
+ Q_UNUSED(index);
+ return mWidgetReturnValue;
+}
+
+HbDataFormModelItem* CpItemDataHelper::modelItemFromModelIndex(const QModelIndex &index)
+{
+ Q_UNUSED(index);
+ return mModelItemReturnValue;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/tsrc/testgroup/stub/src/hbdataformmodel.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -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: HbDataFormModel stub
+*
+*/
+
+// INCLUDE FILES
+#include "hbdataformmodel.h"
+
+// ---------------------------------------------------------------------------
+// HbDataFormModel
+// ---------------------------------------------------------------------------
+//
+HbDataFormModel::HbDataFormModel(QObject *parent) : QAbstractItemModel(parent)
+{
+}
+
+// ---------------------------------------------------------------------------
+// ~HbDataFormModel
+// ---------------------------------------------------------------------------
+//
+HbDataFormModel::~HbDataFormModel()
+{
+}
+
+// ---------------------------------------------------------------------------
+// itemFromIndex
+// ---------------------------------------------------------------------------
+//
+HbDataFormModelItem* HbDataFormModel::itemFromIndex(const QModelIndex &index) const
+{
+ Q_UNUSED(index);
+ return mItemReturnValue;
+}
+
+// ---------------------------------------------------------------------------
+// index
+// ---------------------------------------------------------------------------
+//
+QModelIndex HbDataFormModel::index(int row, int column, const QModelIndex &parent) const
+{
+ Q_UNUSED(parent);
+ return createIndex(row, column);
+}
+
+// ---------------------------------------------------------------------------
+// parent
+// ---------------------------------------------------------------------------
+//
+QModelIndex HbDataFormModel::parent(const QModelIndex &child) const
+{
+ Q_UNUSED(child);
+ return QModelIndex();
+}
+
+// ---------------------------------------------------------------------------
+// rowCount
+// ---------------------------------------------------------------------------
+//
+int HbDataFormModel::rowCount(const QModelIndex &parent) const
+{
+ Q_UNUSED(parent);
+ return 0;
+}
+
+// ---------------------------------------------------------------------------
+// columnCount
+// ---------------------------------------------------------------------------
+//
+int HbDataFormModel::columnCount(const QModelIndex &parent) const
+{
+ Q_UNUSED(parent);
+ return 0;
+}
+
+// ---------------------------------------------------------------------------
+// data
+// ---------------------------------------------------------------------------
+//
+QVariant HbDataFormModel::data(const QModelIndex &index, int role) const
+{
+ Q_UNUSED(index);
+ Q_UNUSED(role);
+ return QVariant();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/tsrc/testgroup/stub/src/hbinputeditorinterface.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -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: HbEditorInterface stub
+*
+*/
+
+// INCLUDE FILES
+#include "hbinputeditorinterface.h"
+
+HbInputFilter* HbEditorInterface::mFilter(0);
+
+// ---------------------------------------------------------------------------
+// HbLineEdit
+// ---------------------------------------------------------------------------
+//
+HbEditorInterface::HbEditorInterface(QObject *parent) : QObject(parent)
+{
+}
+
+// ---------------------------------------------------------------------------
+// ~HbLineEdit
+// ---------------------------------------------------------------------------
+//
+HbEditorInterface::~HbEditorInterface()
+{
+}
+
+// ---------------------------------------------------------------------------
+// setFilter
+// ---------------------------------------------------------------------------
+//
+void HbEditorInterface::setFilter(HbInputFilter *filter)
+{
+ mFilter = filter;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/tsrc/testgroup/stub/src/hblineedit.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: HbLineEdit stub
+*
+*/
+
+// INCLUDE FILES
+#include "hblineedit.h"
+
+// ---------------------------------------------------------------------------
+// HbLineEdit
+// ---------------------------------------------------------------------------
+//
+HbLineEdit::HbLineEdit(QGraphicsItem *parent) : HbWidget(parent)
+{
+}
+
+// ---------------------------------------------------------------------------
+// HbLineEdit
+// ---------------------------------------------------------------------------
+//
+HbLineEdit::HbLineEdit(const QString &text, QGraphicsItem *parent) : HbWidget(parent)
+{
+ Q_UNUSED(text);
+}
+
+// ---------------------------------------------------------------------------
+// ~HbLineEdit
+// ---------------------------------------------------------------------------
+//
+HbLineEdit::~HbLineEdit()
+{
+}
+
+// ---------------------------------------------------------------------------
+// setValidator
+// ---------------------------------------------------------------------------
+//
+void HbLineEdit::setValidator(HbValidator *validator)
+{
+ mValidator = validator;
+}
+
+// ---------------------------------------------------------------------------
+// setValidator
+// ---------------------------------------------------------------------------
+//
+void HbLineEdit::setMaxLength(int max)
+{
+ mMaxLength = max;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/tsrc/testgroup/stub/src/hbvalidator.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -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: HbValidator stub
+*
+*/
+
+// INCLUDE FILES
+#include "hbvalidator.h"
+
+// ---------------------------------------------------------------------------
+// HbValidator
+// ---------------------------------------------------------------------------
+//
+HbValidator::HbValidator(QObject *parent) : QObject(parent)
+{
+}
+
+// ---------------------------------------------------------------------------
+// ~HbValidator
+// ---------------------------------------------------------------------------
+//
+HbValidator::~HbValidator()
+{
+}
+
+// ---------------------------------------------------------------------------
+// addField
+// ---------------------------------------------------------------------------
+//
+void HbValidator::addField(QValidator *validator, const QString &defaultValue)
+{
+ mValidators.append(validator);
+ mDefaultValues.append(defaultValue);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/tsrc/testgroup/stub/src/mpsettingsmodel.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,199 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: MPSettingsModel stub
+*
+*/
+
+// INCLUDE FILES
+#include "mpsettingsmodel.h"
+#include <qglobal.h>
+#include <xqconversions.h>
+
+TUid CMPSettingsModel::mImplUid(TUid::Null());
+TInt CMPSettingsModel::mConfigMode(-1);
+TInt CMPSettingsModel::mProxyMode(-1);
+QString CMPSettingsModel::mHostName = QString();
+TInt CMPSettingsModel::mProxyPort(-1);
+TInt CMPSettingsModel::mMinUdpPort(-1);
+TInt CMPSettingsModel::mMaxUdpPort(-1);
+int CMPSettingsModel::mStoreSettingsCount(0);
+int CMPSettingsModel::mDestructorCount(0);
+int CMPSettingsModel::mApId(0);
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CMPSettingsModel* CMPSettingsModel::NewL(TUid aUid)
+{
+ mImplUid = aUid;
+ return new CMPSettingsModel;
+}
+
+// ---------------------------------------------------------------------------
+// CMPSettingsModel
+// ---------------------------------------------------------------------------
+//
+CMPSettingsModel::CMPSettingsModel()
+{
+}
+
+// ---------------------------------------------------------------------------
+// ~CMPSettingsModel
+// ---------------------------------------------------------------------------
+//
+CMPSettingsModel::~CMPSettingsModel()
+{
+ mDestructorCount++;
+}
+
+// ---------------------------------------------------------------------------
+// LoadSettingsL
+// ---------------------------------------------------------------------------
+//
+void CMPSettingsModel::LoadSettingsL(TInt aConfigVersion)
+{
+ mConfigMode = aConfigVersion;
+}
+
+// ---------------------------------------------------------------------------
+// StoreSettingsL
+// ---------------------------------------------------------------------------
+//
+void CMPSettingsModel::StoreSettingsL()
+{
+ mStoreSettingsCount++;
+}
+
+// ---------------------------------------------------------------------------
+// SetProxyMode
+// ---------------------------------------------------------------------------
+//
+TInt CMPSettingsModel::SetProxyMode(TInt aMode)
+{
+ mProxyMode = aMode;
+ return 0;
+}
+
+// ---------------------------------------------------------------------------
+// GetProxyMode
+// ---------------------------------------------------------------------------
+//
+TInt CMPSettingsModel::GetProxyMode(TInt& aMode)
+{
+ aMode = mProxyMode;
+ return 0;
+}
+
+// ---------------------------------------------------------------------------
+// SetProxyHostNameL
+// ---------------------------------------------------------------------------
+//
+TInt CMPSettingsModel::SetProxyHostNameL(const TDesC& aHostName)
+{
+ mHostName = XQConversions::s60DescToQString(aHostName);
+ return 0;
+}
+
+// ---------------------------------------------------------------------------
+// GetProxyHostName
+// ---------------------------------------------------------------------------
+//
+TInt CMPSettingsModel::GetProxyHostName(TDes& aHostName)
+{
+ HBufC* name = XQConversions::qStringToS60Desc(mHostName);
+ aHostName.Append(*name);
+ delete name;
+ return 0;
+}
+
+// ---------------------------------------------------------------------------
+// SetProxyPort
+// ---------------------------------------------------------------------------
+//
+TInt CMPSettingsModel::SetProxyPort(TInt aPort)
+{
+ mProxyPort = aPort;
+ return 0;
+}
+
+// ---------------------------------------------------------------------------
+// GetProxyPort
+// ---------------------------------------------------------------------------
+//
+TInt CMPSettingsModel::GetProxyPort(TInt& aPort)
+{
+ aPort = mProxyPort;
+ return 0;
+}
+
+// ---------------------------------------------------------------------------
+// SetDefaultAp
+// ---------------------------------------------------------------------------
+//
+TInt CMPSettingsModel::SetDefaultAp(TUint32 aApId)
+{
+ mApId = aApId;
+ return 0;
+}
+
+// ---------------------------------------------------------------------------
+// GetDefaultAp
+// ---------------------------------------------------------------------------
+//
+TInt CMPSettingsModel::GetDefaultAp(TUint32& aApId)
+{
+ aApId = mApId;
+ return 0;
+}
+
+// ---------------------------------------------------------------------------
+// SetMinUDPPort
+// ---------------------------------------------------------------------------
+//
+TInt CMPSettingsModel::SetMinUDPPort(TInt aPort)
+{
+ mMinUdpPort = aPort;
+ return 0;
+}
+
+// ---------------------------------------------------------------------------
+// GetMinUDPPort
+// ---------------------------------------------------------------------------
+//
+TInt CMPSettingsModel::GetMinUDPPort(TInt& aPort)
+{
+ aPort = mMinUdpPort;
+ return 0;
+}
+
+// ---------------------------------------------------------------------------
+// SetMaxUDPPort
+// ---------------------------------------------------------------------------
+//
+TInt CMPSettingsModel::SetMaxUDPPort(TInt aPort)
+{
+ mMaxUdpPort = aPort;
+ return 0;
+}
+
+// ---------------------------------------------------------------------------
+// GetMaxUDPPort
+// ---------------------------------------------------------------------------
+//
+TInt CMPSettingsModel::GetMaxUDPPort(TInt& aPort)
+{
+ aPort = mMaxUdpPort;
+ return 0;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/tsrc/testgroup/stub/src/videosettingsaccesspointentry.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies 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 "videosettingsaccesspointentry.h"
+#include <cpitemdatahelper.h>
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+VideoSettingsAccessPointEntry::VideoSettingsAccessPointEntry(
+ CpItemDataHelper &itemDataHelper,
+ const QString& text,
+ VideoSettingsGroup *parent) :
+ CpSettingFormItemData(HbDataFormModelItem::CustomItemBase, text),
+ mText(text),
+ mParent(parent)
+{
+ Q_UNUSED(itemDataHelper);
+}
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+VideoSettingsAccessPointEntry::~VideoSettingsAccessPointEntry()
+{
+}
+
+// ---------------------------------------------------------------------------
+// accessPointNameFromIapId
+// ---------------------------------------------------------------------------
+//
+void VideoSettingsAccessPointEntry::setIapId(const uint& apId)
+{
+ mApId = apId;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/tsrc/testgroup/testvideosettingsgroup.pro Thu Jul 22 16:34:17 2010 +0100
@@ -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:
+#
+
+TARGET = testvideosettingsgroup
+TEMPLATE = app
+
+DEPENDPATH += . \
+ inc \
+ src
+
+INCLUDEPATH += inc \
+ stub/inc \
+ ../../inc \
+ ../../../mediasettingsengine/inc \
+ ../../../../inc \
+
+CONFIG += qtestlib \
+ Hb \
+ symbian_test
+
+LIBS += -lcpframework \
+ -lxqutils.dll
+
+# Input
+HEADERS += inc/testvideosettingsgroup.h \
+ ../../inc/videosettingsgroup.h \
+ stub/inc/mpsettingsmodel.h \
+ stub/inc/hbdataformmodel.h \
+ stub/inc/cpitemdatahelper.h \
+ stub/inc/hbvalidator.h \
+ stub/inc/hblineedit.h \
+ stub/inc/hbinputeditorinterface.h \
+ stub/inc/videosettingsaccesspointentry.h \
+
+SOURCES += src/testvideosettingsgroup.cpp \
+ ../../src/videosettingsgroup.cpp \
+ stub/src/mpsettingsmodel.cpp \
+ stub/src/hbdataformmodel.cpp \
+ stub/src/cpitemdatahelper.cpp \
+ stub/src/hbvalidator.cpp \
+ stub/src/hblineedit.cpp \
+ stub/src/hbinputeditorinterface.cpp \
+ stub/src/videosettingsaccesspointentry.cpp \
+
+TARGET.CAPABILITY = All -Tcb
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/tsrc/testplugin/inc/testvideosettingsplugin.h Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: TestVideoSettingsPlugin class definition
+*
+*/
+
+#ifndef TESTVIDEOSETTINGSPLUGIN_H
+#define TESTVIDEOSETTINGSPLUGIN_H
+
+
+// INCLUDES
+#include <qobject.h>
+
+class CpItemDataHelper;
+class VideoSettingsPlugin;
+
+class TestVideoSettingsPlugin : public QObject
+ {
+
+ Q_OBJECT
+
+private slots:
+
+ /**
+ * called at the very beginning of the test
+ */
+ void initTestCase();
+
+ /**
+ * called at the very end of the test
+ */
+ void cleanupTestCase();
+
+ /**
+ * called at the start of every test.
+ */
+ void init();
+
+ /**
+ * called at the end of every test.
+ */
+ void cleanup();
+
+ /**
+ * test createSettingFormItemData
+ */
+ void testCreateSettingFormItemData();
+
+private:
+
+ CpItemDataHelper* mItemHelper;
+
+ VideoSettingsPlugin* mPlugin;
+
+ };
+
+#endif // TESTVIDEOSETTINGSPLUGIN_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/tsrc/testplugin/src/testvideosettingsplugin.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,104 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: TestVideoSettingsPlugin class implementation
+*
+*/
+
+// INCLUDE FILES
+#include <QtTest/QtTest>
+#include <qdebug.h>
+#include <hbapplication.h>
+#include <cpitemdatahelper.h>
+
+#include "videosettingsgroup.h"
+#include "testvideosettingsplugin.h"
+
+// trick to get access to protected/private members.
+#define private public
+#include "videosettingsplugin.h"
+#undef private
+
+// ---------------------------------------------------------------------------
+// initTestCase
+// ---------------------------------------------------------------------------
+//
+void TestVideoSettingsPlugin::initTestCase()
+{
+ mItemHelper = new CpItemDataHelper;
+}
+
+// ---------------------------------------------------------------------------
+// cleanupTestCase
+// ---------------------------------------------------------------------------
+//
+void TestVideoSettingsPlugin::cleanupTestCase()
+{
+ delete mItemHelper;
+ mItemHelper = 0;
+}
+
+// ---------------------------------------------------------------------------
+// init
+// ---------------------------------------------------------------------------
+//
+void TestVideoSettingsPlugin::init()
+{
+ mPlugin = new VideoSettingsPlugin();
+}
+
+// ---------------------------------------------------------------------------
+// cleanup
+// ---------------------------------------------------------------------------
+//
+void TestVideoSettingsPlugin::cleanup()
+{
+ delete mPlugin;
+ mPlugin = 0;
+}
+
+// ---------------------------------------------------------------------------
+// testCreateSettingFormItemData
+// ---------------------------------------------------------------------------
+//
+void TestVideoSettingsPlugin::testCreateSettingFormItemData()
+{
+ QList<CpSettingFormItemData*> list = mPlugin->createSettingFormItemData(*mItemHelper);
+ QCOMPARE( list.count(), 1 );
+ VideoSettingsGroup* group = static_cast<VideoSettingsGroup*>(list.at(0));
+ QVERIFY( group );
+ QVERIFY( &(group->mItemDataHelper) == mItemHelper );
+}
+
+// ---------------------------------------------------------------------------
+// main
+// ---------------------------------------------------------------------------
+//
+int main(int argc, char *argv[])
+{
+ HbApplication app(argc, argv);
+/* HbApplication::setKeypadNavigationEnabled(false);
+ HbMainWindow mainWindow;
+ mainWindow.show();*/
+
+ TestVideoSettingsPlugin tc;
+
+ char *pass[3];
+ pass[0] = argv[0];
+ pass[1] = "-o";
+ pass[2] = "c:\\data\\testvideosettingsplugin.txt";
+
+ return QTest::qExec(&tc, 3, pass);
+}
+
+// end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/tsrc/testplugin/stub/inc/videosettingsgroup.h Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+#ifndef VIDEOSETTINGSGROUP_H
+#define VIDEOSETTINGSGROUP_H
+
+#include <cpsettingformitemdata.h>
+#include <qabstractitemmodel.h>
+
+class CpItemDataHelper;
+
+class VideoSettingsGroup : public CpSettingFormItemData
+{
+ Q_OBJECT
+public:
+
+ /**
+ * Constructor
+ */
+ VideoSettingsGroup(CpItemDataHelper &itemDataHelper);
+
+ /**
+ * Destructor
+ */
+ ~VideoSettingsGroup();
+
+public:
+ /**
+ * Item data helper given by the CP framework.
+ */
+ CpItemDataHelper& mItemDataHelper;
+
+};
+
+#endif // VIDEOSETTINGSGROUP_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/tsrc/testplugin/stub/src/videosettingsgroup.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -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 "videosettingsgroup.h"
+#include <cpitemdatahelper.h>
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+VideoSettingsGroup::VideoSettingsGroup(CpItemDataHelper &itemDataHelper) :
+ CpSettingFormItemData(HbDataFormModelItem::GroupItem,QString("VideoSettings")),
+ mItemDataHelper(itemDataHelper)
+{
+}
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+VideoSettingsGroup::~VideoSettingsGroup()
+{
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/tsrc/testplugin/testvideosettingsplugin.pro Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,44 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+TARGET = testvideosettingsplugin
+TEMPLATE = app
+
+DEPENDPATH += . \
+ inc \
+ src
+
+INCLUDEPATH += inc \
+ stub/inc \
+ ../../inc
+
+CONFIG += qtestlib \
+ Hb \
+ symbian_test
+
+LIBS += -lcpframework \
+ -lxqutils.dll
+
+# Input
+HEADERS += inc/testvideosettingsplugin.h \
+ ../../inc/videosettingsplugin.h \
+ stub/inc/videosettingsgroup.h \
+
+SOURCES += src/testvideosettingsplugin.cpp \
+ ../../src/videosettingsplugin.cpp \
+ stub/src/videosettingsgroup.cpp \
+
+TARGET.CAPABILITY = All -Tcb
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mediasettings/videosettingsplugin/videosettingsplugin.pro Thu Jul 22 16:34:17 2010 +0100
@@ -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:
+#
+
+TEMPLATE = lib
+TARGET = videosettingsplugin
+
+CONFIG += hb \
+ plugin
+
+LIBS += -lcpframework \
+ -lMPSettEngine.dll \
+ -lxqutils.dll \
+ -lcmapplsettingsui \
+ -lconnection_settings_shim
+
+INCLUDEPATH += ../mediasettingsengine/inc \
+ ../../inc
+
+HEADERS += inc/videosettingsplugin.h \
+ inc/videosettingsgroup.h \
+ inc/videosettingsaccesspointentry.h
+
+SOURCES += src/videosettingsplugin.cpp \
+ 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
+
+for(qtplugin, qtplugins.sources):BLD_INF_RULES.prj_exports += "./$$qtplugin $$deploy.path$$qtplugins.path/$$basename(qtplugin)"
+
+plugin.sources += videosettingsplugin.dll
+plugin.path = /resource/qt/plugins/controlpanel
+DEPLOYMENT += plugin
--- a/videocollection/inc/videocollectiontrace.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/inc/videocollectiontrace.h Thu Jul 22 16:34:17 2010 +0100
@@ -29,11 +29,11 @@
#define DISABLE_TRACE 0
/**
- * 0 = Tracing into RDebug in all builds.
- * 1 = Tracing into RDebug in winscw, file in ARM. (Default)
+ * 0 = Tracing into RDebug in all builds. (Default)
+ * 1 = Tracing into RDebug in winscw, file in ARM.
* 2 = Tracing into file in all builds.
*/
-#define TRACE_OUTPUT 1
+#define TRACE_OUTPUT 0
//-----------------------------------------------------------------------------
// Trace configuration
@@ -90,9 +90,9 @@
/**
* Trace prefixes for macros with component name.
*/
-#define _PREFIX_TRACE( a ) TPtrC( (const TText*) L"#FuC# " L##a )
-#define _PREFIX_TRACE_2( a, b ) TPtrC( (const TText*) L"#FuC# " L##a L##b )
-#define _PREFIX_TRACE8( a ) (const char*)( "#FuC# " a )
+#define _PREFIX_TRACE( a ) TPtrC( (const TText*) L"#Fu#Co# " L##a )
+#define _PREFIX_TRACE_2( a, b ) TPtrC( (const TText*) L"#Fu#Co# " L##a L##b )
+#define _PREFIX_TRACE8( a ) (const char*)( "#Fu#Co# " a )
/**
* Prefix error trace
--- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideosalbum.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosalbum.h Thu Jul 22 16:34:17 2010 +0100
@@ -177,11 +177,9 @@
* Calculates KVcxMediaMyVideosCategoryItemCount, KVcxMediaMyVideosCategoryNewItemCount,
* KVcxMediaMyVideosCategoryNewItemName and KMPXMediaGeneralDate attributes to iMedia.
*
- * @param aStartIndex Start position of the calculations in iVideoList.
- * Can be used to update values when items are appended
- * to old list, without calculating everything from scratch.
+ * @return Returns ETrue if album attributes were modified, EFalse otherwise.
*/
- void CalculateAttributesL( TInt aStartIndex = 0 );
+ TBool CalculateAttributesL();
private:
--- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideosalbums.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosalbums.h Thu Jul 22 16:34:17 2010 +0100
@@ -160,8 +160,13 @@
/**
* Calculates and updates album media attributes.
+ * Adds events to iCollection.iMessageList if albums
+ * are modified. Does not send them.
+ *
+ * @return Returns ETrue if events were added to iCollection.iMessageList,
+ * EFalse otherwise.
*/
- void CalculateAttributesL();
+ TBool CalculateAttributesL();
/**
* Called when video's New Video flag changes. Calculates
@@ -180,6 +185,18 @@
* @param aMdsId MDS ID of the changed video.
*/
void VideoTitleChangedL( TUint32 aMdsId );
+
+ /**
+ * Called when video is added or removed from cache. Adds changed
+ * album indexes to iChangedAlbums.
+ */
+ void VideoAddedOrRemovedFromCacheL( CMPXMedia& video );
+
+ /**
+ * Goes through iChangedAlbums and updates album attributes and adds
+ * changed events.
+ */
+ void UpdateChangedAlbumsL();
protected:
@@ -340,6 +357,13 @@
*/
RArray<TUint32> iMdsOpResultsUint32;
+ /**
+ * When videos are removed or added from cache, the indexes of the
+ * changed albums are stored here. Reason is to calculate new attributes
+ * only once per changed album.
+ */
+ RArray<TInt> iChangedAlbums;
+
};
#endif // VCXMYVIDEOSALBUMS_H
--- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideoscollectionplugin.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideoscollectionplugin.h Thu Jul 22 16:34:17 2010 +0100
@@ -199,13 +199,13 @@
* From MVcxMyVideosMdsDbObserver.
*/
void HandleMyVideosDbEvent( TMPXChangeEventType aEvent,
- RArray<TUint32>& aId );
+ RArray<TUint32>& aId, TInt aEventsLeft );
/**
* Leaving version of HandleMyVideosDbEvent.
*/
void DoHandleMyVideosDbEventL( TMPXChangeEventType aEvent,
- RArray<TUint32>& aId );
+ RArray<TUint32>& aId, TInt aEventsLeft );
/**
* From MVcxMyVideosMdsDbObserver.
--- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideoscollectionutil.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideoscollectionutil.h Thu Jul 22 16:34:17 2010 +0100
@@ -252,6 +252,30 @@
static TUint32 Uint32ValueL( CMPXMedia& aMedia );
/**
+ * Gets KVcxMediaMyVideosCategoryItemCount attribute from aVideo.
+ *
+ * @param aMedia Media where from the attribute is fetched.
+ * @return Returns 0, if attribute is not supported.
+ */
+ static TUint32 CategoryItemCountL( CMPXMedia& aVideo );
+
+ /**
+ * Gets KVcxMediaMyVideosCategoryNewItemCount attribute from aVideo.
+ *
+ * @param aMedia Media where from the attribute is fetched.
+ * @return Returns 0, if attribute is not supported.
+ */
+ static TUint32 CategoryNewItemCountL( CMPXMedia& aVideo );
+
+ /**
+ * Gets KVcxMediaMyVideosCategoryNewItemName attribute from aVideo.
+ *
+ * @param aMedia Media where from the attribute is fetched.
+ * @return Category new video name.
+ */
+ static const TDesC& CategoryNewVideoName( const CMPXMedia& aVideo );
+
+ /**
* Gets KMPXMediaGeneralId attributes from aMediaArray and
* puts them to aIdArray. aIdArray is reset before adding.
*
--- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideosmdsalbums.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosmdsalbums.h Thu Jul 22 16:34:17 2010 +0100
@@ -359,8 +359,13 @@
* Called from RunL when albums remove completes.
*/
void HandleRemoveAlbumsCompletedL();
+
+ /**
+ * Registers observing to MDS session.
+ */
+ void SetObservingL();
- public:
+ protected:
/**
* From MMdEQueryObserver.
@@ -396,14 +401,12 @@
TObserverNotificationType aType,
const RArray<TMdERelation>& aRelationArray);
-#if 0 //not used
/**
* From MMdERelationObserver
*/
void HandleRelationNotification(CMdESession& aSession,
TObserverNotificationType aType,
const RArray<TItemId>& aRelationIdArray);
-#endif
private:
--- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideosmdsdb.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosmdsdb.h Thu Jul 22 16:34:17 2010 +0100
@@ -61,10 +61,11 @@
/**
* Handler function for database events.
*
- * @param aEvent Event type.
- * @param aId Array of IDs in database.
+ * @param aEvent Event type.
+ * @param aId Array of IDs in database.
+ * @param aEventsLeft How many events are still coming.
*/
- virtual void HandleMyVideosDbEvent( TMPXChangeEventType aEvent, RArray<TUint32>& aId ) = 0;
+ virtual void HandleMyVideosDbEvent( TMPXChangeEventType aEvent, RArray<TUint32>& aId, TInt aEventsLeft ) = 0;
/**
* Handler function for video list fetching events. This callback is called as a response
@@ -275,19 +276,27 @@
ERemoveAlbums
};
+ class TEvent
+ {
+ public:
+
+ TUint32 iMdsId;
+ TInt iEventType;
+ };
+
/**
* Two-phased constructor.
* @param aObserver The db change observer.
*/
static CVcxMyVideosMdsDb* NewL( MVcxMyVideosMdsDbObserver* aObserver,
- MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver, RFs& aFs );
+ RFs& aFs, MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver = NULL );
/**
* Two-phased constructor.
* @param aObserver The db change observer.
*/
static CVcxMyVideosMdsDb* NewLC( MVcxMyVideosMdsDbObserver* aObserver,
- MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver, RFs& aFs );
+ RFs& aFs, MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver = NULL );
/**
@@ -356,6 +365,11 @@
*/
CMPXMedia* CreateVideoL( TUint32 aId, TBool aFullDetails = ETrue );
+ /**
+ * Called by iEventProcessor.
+ */
+ static TInt ProcessEvents( TAny* aPtr );
+
protected:
// from MMdESessionObserver
@@ -434,7 +448,7 @@
* @param aFs Session to file server.
*/
CVcxMyVideosMdsDb( MVcxMyVideosMdsDbObserver* aObserver,
- MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver, RFs& aFs );
+ RFs& aFs, MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver = NULL );
void ConstructL();
@@ -548,6 +562,11 @@
*/
CMdESession& MdsSessionL();
+ /**
+ * Called by ProcessEvents.
+ */
+ TInt DoProcessEvents();
+
public:
/**
@@ -767,6 +786,15 @@
*/
CVcxMdsShutdownMonitor* iMdsShutdownMonitor;
+ /**
+ * Used for handling events on background.
+ */
+ CIdle* iEventProcessor;
+
+ /**
+ * Incoming events are stored here and "slowly" fed to observer.
+ */
+ RArray<TEvent> iEvents;
};
#endif // VCXMYVIDEOSMDSDB_H
--- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideosopenhandler.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosopenhandler.h Thu Jul 22 16:34:17 2010 +0100
@@ -24,15 +24,6 @@
class CVcxMyVideosMdsDb;
#include "vcxmyvideosmdsdb.h"
-
-enum TVcxItemType
- {
- EVcxItemTypeNone,
- EVcxItemTypeVideo,
- EVcxItemTypeCategory,
- EVcxItemTypeAlbum
- };
-
/**
*/
NONSHARABLE_CLASS( CVcxMyVideosOpenHandler ) : public CBase, public MVcxMyVideosMdsAlbumsObserver
--- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideosvideocache.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosvideocache.h Thu Jul 22 16:34:17 2010 +0100
@@ -25,6 +25,7 @@
// FORWARD DECLARATIONS
class CVcxMyVideosCollectionPlugin;
class CMPXMedia;
+class CRepository;
// CONSTANTS
@@ -294,10 +295,12 @@
*
* @param aVideo Video to add.
* @param aSortingOrder Sorting order.
+ * @param aUpdateCategores If ETrue, then category and album attributes are updated.
* @return KErrNone if added, KErrAlreadyExists if already exists and
* was not added.
*/
- TInt AddL( CMPXMedia* aVideo, TVcxMyVideosSortingOrder aSortingOrder );
+ TInt AddL( CMPXMedia* aVideo, TVcxMyVideosSortingOrder aSortingOrder,
+ TBool aUpdateCategories = ETrue );
/**
* Adds video to iPartialVideoList. Ownership moves.
@@ -412,9 +415,10 @@
* @param aNonVideoIds If argument given then Ids which were detected to not be
* videos are written here. Caller owns the array, ownership
* does not move.
+ * @param aUpdateCategories If ETrue, then category/album attributes are updated.
*/
void AddVideosFromMdsL( RArray<TUint32>& aMdsIds, TBool& aListFetchingWasCanceled,
- RArray<TUint32>* aNonVideoIds = NULL );
+ RArray<TUint32>* aNonVideoIds = NULL, TBool aUpdateCategories = ETrue );
/**
* Deletes old and creates new iVideoList. After the function call iVideoList exists,
@@ -490,7 +494,7 @@
/**
* Set to ETrue when doing videolist fetching.
*/
- TBool IsFetchingVideoList;
+ TBool iIsFetchingVideoList;
private:
/**
@@ -508,6 +512,12 @@
* order for fast access.
*/
CVcxMyVideosVideoListIndex* iVideoListIndex;
+
+ /**
+ * Provides access to the sorting order key in cenrep. Own.
+ */
+ CRepository* iCenRep;
+
};
#endif // VCXMYVIDEOSVIDEOCACHE_H
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosalbum.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosalbum.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -292,10 +292,10 @@
// CVcxMyVideosAlbum::CalculateAttributesL
// ---------------------------------------------------------------------------
//
-void CVcxMyVideosAlbum::CalculateAttributesL( TInt aStartIndex )
+TBool CVcxMyVideosAlbum::CalculateAttributesL()
{
+ TInt videoCount = 0;
TUint32 count = iVideoList.Count();
- iMedia->SetTObjectValueL<TUint32>( KVcxMediaMyVideosCategoryItemCount, count );
TInt newCount = 0;
CMPXMedia* video;
CMPXMedia* latestNewVideo = NULL;
@@ -303,11 +303,12 @@
TUint32 flags;
TInt64 currentItemsCreationDate = 0;
TInt64 latestCreationDate = TVcxMyVideosCollectionUtil::CreationDateL( *iMedia );
- for ( TInt i = aStartIndex; i < count; i++ )
+ for ( TInt i = 0; i < count; i++ )
{
video = iCollection.iCache->FindVideoByMdsIdL( iVideoList[i].iMdsId, pos );
if ( video )
{
+ videoCount++;
flags = TVcxMyVideosCollectionUtil::FlagsL( *video );
if ( flags & EVcxMyVideosVideoNew )
{
@@ -321,13 +322,36 @@
}
}
}
- iMedia->SetTObjectValueL<TUint32>( KVcxMediaMyVideosCategoryItemCount, count );
- iMedia->SetTObjectValueL<TUint32>( KVcxMediaMyVideosCategoryNewItemCount, newCount );
+
+ TBool modified = EFalse;
+
+ TUint32 prevValue = TVcxMyVideosCollectionUtil::CategoryItemCountL( *iMedia );
+ if ( prevValue != videoCount )
+ {
+ iMedia->SetTObjectValueL<TUint32>( KVcxMediaMyVideosCategoryItemCount, videoCount );
+ modified = ETrue;
+ }
+
+ prevValue = TVcxMyVideosCollectionUtil::CategoryNewItemCountL( *iMedia );
+ if ( prevValue != newCount )
+ {
+ iMedia->SetTObjectValueL<TUint32>( KVcxMediaMyVideosCategoryNewItemCount, newCount );
+ modified = ETrue;
+ }
+
if ( latestNewVideo )
{
- iMedia->SetTextValueL( KVcxMediaMyVideosCategoryNewItemName,
- TVcxMyVideosCollectionUtil::Title( *latestNewVideo ) );
+ TPtrC prevNewVideoName( TVcxMyVideosCollectionUtil::CategoryNewVideoName( *iMedia ) );
+ TPtrC latestNewVideoName( TVcxMyVideosCollectionUtil::Title( *latestNewVideo ) );
+ if ( prevNewVideoName != latestNewVideoName )
+ {
+ iMedia->SetTextValueL( KVcxMediaMyVideosCategoryNewItemName,
+ TVcxMyVideosCollectionUtil::Title( *latestNewVideo ) );
+ iMedia->SetTObjectValueL<TInt64>( KMPXMediaGeneralDate, latestCreationDate );
+ modified = ETrue;
+ }
}
- iMedia->SetTObjectValueL<TInt64>( KMPXMediaGeneralDate, latestCreationDate );
+
+ return modified;
}
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosalbums.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosalbums.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -49,6 +49,7 @@
void CVcxMyVideosAlbums::ConstructL()
{
iAlbums.Reset();
+ iChangedAlbums.Reset();
}
// ---------------------------------------------------------------------------
@@ -81,6 +82,7 @@
iMdsOpResults.Close();
iMdsOpResultsUint32.Close();
iRemoveFromAlbumVideos.Close();
+ iChangedAlbums.Close();
}
// ----------------------------------------------------------------------------
@@ -262,7 +264,7 @@
//
void CVcxMyVideosAlbums::AddAlbumL( CMPXMedia& aCmd )
{
- if ( TVcxMyVideosCollectionUtil::Title( aCmd ).Length() > 255 )
+ if ( TVcxMyVideosCollectionUtil::Title( aCmd ).Length() > KVcxMvcMaxTitleLength )
{
User::Leave( KErrArgument );
}
@@ -349,13 +351,23 @@
// CVcxMyVideosAlbums::CalculateAttributesL
// ----------------------------------------------------------------------------
//
-void CVcxMyVideosAlbums::CalculateAttributesL()
+TBool CVcxMyVideosAlbums::CalculateAttributesL()
{
+ TBool eventsAdded = EFalse;
+ TBool modified = EFalse;
TInt count = iAlbums.Count();
for ( TInt i = 0; i < count; i++ )
{
- iAlbums[i]->CalculateAttributesL();
+ modified = iAlbums[i]->CalculateAttributesL();
+ if ( modified )
+ {
+ iCollection.iMessageList->AddEventL(
+ TMPXItemId( iAlbums[i]->iMdsId, KVcxMvcMediaTypeAlbum ),
+ EMPXItemModified, 0 );
+ eventsAdded = ETrue;
+ }
}
+ return eventsAdded;
}
// ----------------------------------------------------------------------------
@@ -766,4 +778,39 @@
NewVideoFlagChangedL( aMdsId ); // same calculation works for this
}
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::VideoAddedOrRemovedFromCacheL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::VideoAddedOrRemovedFromCacheL( CMPXMedia& aVideo )
+ {
+ TInt count = iAlbums.Count();
+ TUint32 mdsId = TVcxMyVideosCollectionUtil::IdL( aVideo ).iId1;
+ for ( TInt i = 0; i < count; i++ )
+ {
+ if ( iAlbums[i]->BelongsToAlbum( mdsId ) )
+ {
+ if ( iChangedAlbums.Find( i ) == KErrNotFound )
+ {
+ iChangedAlbums.AppendL( i );
+ }
+ }
+ }
+ }
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::UpdateChangedAlbumsL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::UpdateChangedAlbumsL()
+ {
+ TInt count = iChangedAlbums.Count();
+ for ( TInt i = 0; i < count; i++ )
+ {
+ iCollection.iMessageList->AddEventL(
+ TMPXItemId( iAlbums[iChangedAlbums[i]]->iMdsId, KVcxMvcMediaTypeAlbum ),
+ EMPXItemModified, EVcxMyVideosVideoListOrderChanged );
+ iAlbums[iChangedAlbums[i]]->CalculateAttributesL();
+ }
+ iChangedAlbums.Reset();
+ }
// END OF FILE
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosasyncfileoperations.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosasyncfileoperations.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -49,8 +49,6 @@
CVcxMyVideosAsyncFileOperations* CVcxMyVideosAsyncFileOperations::NewL(
CVcxMyVideosCollectionPlugin& aCollection )
{
- MPX_FUNC("CVcxMyVideosAsyncFileOperations::NewL");
-
CVcxMyVideosAsyncFileOperations* self = new (ELeave) CVcxMyVideosAsyncFileOperations(
aCollection );
CleanupStack::PushL(self);
@@ -65,8 +63,6 @@
//
CVcxMyVideosAsyncFileOperations::~CVcxMyVideosAsyncFileOperations()
{
- MPX_FUNC("CVcxMyVideosAsyncFileOperations::~CVcxMyVideosAsyncFileOperations");
-
iOperationIdArray.Close();
iOperationResult.Close();
delete iFileCopier;
@@ -78,11 +74,9 @@
// Constructor.
// ----------------------------------------------------------------------------
//
-CVcxMyVideosAsyncFileOperations::CVcxMyVideosAsyncFileOperations(
- CVcxMyVideosCollectionPlugin& aCollection )
+CVcxMyVideosAsyncFileOperations::CVcxMyVideosAsyncFileOperations( CVcxMyVideosCollectionPlugin& aCollection )
: iCollection( aCollection )
{
- MPX_FUNC("CVcxMyVideosAsyncFileOperations::CVcxMyVideosAsyncFileOperations");
}
// ----------------------------------------------------------------------------
@@ -579,17 +573,11 @@
MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: Copy succeeded");
if ( iIsMoveOperation )
{
- MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: move case");
+ MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: move op: deleting source file");
aErr = BaflUtils::DeleteFile( iCollection.iFs, iSourcePath );
if ( aErr != KErrNone )
{
MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: delete for source file failed: %d", aErr );
- MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: deleting target file");
- TInt delErr = BaflUtils::DeleteFile( iCollection.iFs, iTargetPath );
- if ( delErr != KErrNone )
- {
- MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: delete for target file failed: %d", delErr );
- }
}
}
}
@@ -598,15 +586,21 @@
MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: CopyFile failed: %d", aErr);
}
- // roll mds and cache back if file operations failed
+ // roll everything back if file operations failed
if ( aErr != KErrNone )
{
if ( iIsMoveOperation )
{
- MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: move failed %d", aErr );
- MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: setting media path back and leaving." );
+ MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: move operation failed %d", aErr );
+ MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: setting media path back in MDS" );
iMediaForMoveOp->SetTextValueL( KMPXMediaGeneralUri, iSourcePath );
iCollection.SetVideoL( *iMediaForMoveOp );
+ MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: deleting target file");
+ TInt delErr = BaflUtils::DeleteFile( iCollection.iFs, iTargetPath );
+ if ( delErr != KErrNone )
+ {
+ MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: delete for target file failed: %d", delErr );
+ }
}
else
{
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideoscategories.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideoscategories.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -202,11 +202,8 @@
media = videoListArray->AtL( i );
- if ( media->IsSupported( KVcxMediaMyVideosOrigin ) )
- {
- origin = media->ValueTObjectL<TUint8>( KVcxMediaMyVideosOrigin );
- }
-
+ origin = TVcxMyVideosCollectionUtil::OriginL( *media );
+
TBool newVideo = EFalse;
TUint32 flags = 0;
@@ -549,16 +546,15 @@
{
case -1:
return KVcxMyVideosAllVideosCategoryIndex;
-
- case EVcxMyVideosOriginDownloaded:
- return KVcxMyVideosDownloadsCategoryIndex;
-
+
case EVcxMyVideosOriginCapturedWithCamera:
return KVcxMyVideosCapturedCategoryIndex;
+ case EVcxMyVideosOriginDownloaded:
+#ifdef VCX_DOWNLOADS_CATEGORY
+ return KVcxMyVideosDownloadsCategoryIndex;
+#endif
case EVcxMyVideosOriginTvRecording:
- return KVcxMyVideosTvRecordingsCategoryIndex;
-
case EVcxMyVideosOriginSideLoaded:
case EVcxMyVideosOriginOther:
default:
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionplugin.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionplugin.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -100,8 +100,11 @@
MPX_FUNC("CVcxMyVideosCollectionPlugin::ConstructL");
User::LeaveIfError( iFs.Connect() );
-
- iMyVideosMdsDb = CVcxMyVideosMdsDb::NewL( this, &AlbumsL(), iFs );
+#ifndef VCX_ALBUMS
+ iMyVideosMdsDb = CVcxMyVideosMdsDb::NewL( this, iFs );
+#else
+ iMyVideosMdsDb = CVcxMyVideosMdsDb::NewL( this, iFs, &AlbumsL() );
+#endif
iActiveTask = CVcxMyVideosActiveTask::NewL( *this );
iCache = CVcxMyVideosVideoCache::NewL( *this );
iMessageList = CVcxMyVideosMessageList::NewL( *this );
@@ -400,9 +403,10 @@
//
void CVcxMyVideosCollectionPlugin::HandleMyVideosDbEvent(
TMPXChangeEventType aEvent,
- RArray<TUint32>& aId )
+ RArray<TUint32>& aId,
+ TInt aEventsLeft )
{
- TRAPD( err, DoHandleMyVideosDbEventL( aEvent, aId ));
+ TRAPD( err, DoHandleMyVideosDbEventL( aEvent, aId, aEventsLeft ));
if ( err != KErrNone )
{
MPX_DEBUG2("CVcxMyVideosCollectionPlugin::DoHandleMyVideosDbEventL() leaved with error code: %d", err);
@@ -415,7 +419,8 @@
//
void CVcxMyVideosCollectionPlugin::DoHandleMyVideosDbEventL(
TMPXChangeEventType aEvent,
- RArray<TUint32>& aId )
+ RArray<TUint32>& aId,
+ TInt /*aEventsLeft*/ )
{
MPX_FUNC("CVcxMyVideosCollectionPlugin::DoHandleMyVideosDbEventL");
@@ -430,9 +435,16 @@
MPX_DEBUG1("CVcxMyVideosCollectionPlugin::DoHandleMyVideosDbEventL() --------------------------------------------.");
MPX_DEBUG1("CVcxMyVideosCollectionPlugin::DoHandleMyVideosDbEventL() Items from MDS deleted, deleting from cache |" );
MPX_DEBUG1("CVcxMyVideosCollectionPlugin::DoHandleMyVideosDbEventL() --------------------------------------------'");
-
- iCache->RemoveL( aId );
+
+ iCache->RemoveL( aId, EFalse );
+
+ CategoriesL().ResetVideoCountersL();
+ CategoriesL().UpdateCategoriesL( *iCache->iVideoList, 0 );
+ CategoriesL().UpdateCategoriesNewVideoNamesL();
+
+#ifdef VCX_ALBUMS
AlbumsL().RemoveAlbumsL( aId );
+#endif
}
break;
@@ -455,14 +467,21 @@
// We receive add events for all object types. When fetching the item from MDS we use
// video condition and only video objects are added to cache. Items which were detected
// to not be videos are added to nonVideoIds.
- iCache->AddVideosFromMdsL( aId, videoListFetchingWasCancelled, &nonVideoIds );
+ iCache->AddVideosFromMdsL( aId, videoListFetchingWasCancelled,
+ &nonVideoIds, EFalse /* dont update categories*/ );
+ CategoriesL().ResetVideoCountersL();
+ CategoriesL().UpdateCategoriesL( *iCache->iVideoList, 0 );
+ CategoriesL().UpdateCategoriesNewVideoNamesL();
+
+#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
//After the call nonVideoIds will contain only items which were actually added
//to albums.
AlbumsL().AddAlbumsFromMdsL( nonVideoIds );
#endif
+#endif
if ( videoListFetchingWasCancelled )
{
@@ -478,7 +497,9 @@
MPX_DEBUG1("CVcxMyVideosCollectionPlugin::DoHandleMyVideosDbEventL() Items modified in MDS, updating cache |");
MPX_DEBUG1("CVcxMyVideosCollectionPlugin::DoHandleMyVideosDbEventL() --------------------------------------'");
CMPXMedia* video;
+#ifdef VCX_ALBUMS
CMPXMedia* album;
+#endif
TInt count = aId.Count();
for ( TInt i = count - 1; i >= 0; i-- )
{
@@ -492,6 +513,10 @@
}
else
{
+#ifndef VCX_ALBUMS
+ MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: couldn't find the modified item from MDS");
+ aId.Remove( i );
+#else
MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: item was not found from videos, checking albums");
album = iMyVideosMdsDb->iAlbums->GetAlbumL( aId[i] );
@@ -506,6 +531,7 @@
MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: couldn't find the modified item from MDS");
}
aId.Remove( i );
+#endif
}
}
@@ -531,6 +557,7 @@
}
}
+#ifdef VCX_ALBUMS
//nonVideoIds are albums
count = nonVideoIds.Count();
for ( TInt i = 0; i < count; i++ )
@@ -539,9 +566,11 @@
TMPXItemId( nonVideoIds[i], KVcxMvcMediaTypeAlbum ), aEvent ) );
}
+ iAlbums->UpdateChangedAlbumsL();
+#endif
+
CleanupStack::PopAndDestroy( &nonVideoIds );
-
- iMessageList->SendL();
+ iMessageList->SendL();
}
// ----------------------------------------------------------------------------
@@ -692,6 +721,7 @@
SetTransactionIdL( cmd, *message );
iMessageList->AddL( message );
+ CleanupStack::Pop( message ); // <-3
iMessageList->SendL();
if ( videoListFetchingWasCancelled )
@@ -700,7 +730,6 @@
RestartVideoListFetchingL();
}
- CleanupStack::Pop( message ); // <-3
CleanupStack::PopAndDestroy( &mdsIds2 ); // <-2
CleanupStack::PopAndDestroy( &mdsIds ); // <-1
@@ -904,35 +933,6 @@
}
}
-#if 0
-// ----------------------------------------------------------------------------
-// CVcxMyVideosCollectionPlugin::NotifyDownloadCompletedL
-// ----------------------------------------------------------------------------
-//
-void CVcxMyVideosCollectionPlugin::NotifyDownloadCompletedL( CMPXMedia& aVideo )
- {
- const TInt KMediaExtSize( 8 );
-
- HBufC8* buffer = HBufC8::NewL( KMediaExtSize );
- CleanupStack::PushL( buffer );
- TPtr8 des = buffer->Des();
-
- RDesWriteStream stream;
- CleanupClosePushL( stream );
- stream.Open( des );
-
- aVideo.ExternalizeL( stream );
-
- stream.CommitL();
-
- CleanupStack::PopAndDestroy( &stream );
-
- DownloadUtilL().NotifyDownloadCompleted( *buffer );
-
- CleanupStack::PopAndDestroy( buffer );
- }
-#endif
-
// ----------------------------------------------------------------------------
// CVcxMyVideosCollectionPlugin::NotifyNewVideosCountDecreasedL
// ----------------------------------------------------------------------------
@@ -976,7 +976,7 @@
ids.Reset();
CleanupClosePushL( ids ); // 1->
ids.AppendL( mpxId.iId1 );
- HandleMyVideosDbEvent( EMPXItemInserted, ids ); //this will fetch from mds to cache
+ HandleMyVideosDbEvent( EMPXItemInserted, ids, 0 ); //this will fetch from mds to cache
CleanupStack::PopAndDestroy( &ids ); // <-1
}
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionutil.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionutil.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -254,10 +254,19 @@
if ( aVideo.IsSupported( KVcxMediaMyVideosOrigin ) )
{
origin = aVideo.ValueTObjectL<TUint8>( KVcxMediaMyVideosOrigin );
- if ( origin == EVcxMyVideosOriginSideLoaded )
+#ifndef VCX_DOWNLOADS_CATEGORY
+ if ( origin != EVcxMyVideosOriginCapturedWithCamera )
{
origin = EVcxMyVideosOriginOther;
}
+#else
+ if ( origin != EVcxMyVideosOriginCapturedWithCamera &&
+ origin != EVcxMyVideosOriginDownloaded
+ )
+ {
+ origin = EVcxMyVideosOriginOther;
+ }
+#endif
}
return origin;
}
@@ -533,6 +542,52 @@
}
// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::CategoryItemCountL
+// ----------------------------------------------------------------------------
+//
+TUint32 TVcxMyVideosCollectionUtil::CategoryItemCountL( CMPXMedia& aVideo )
+ {
+ TUint32 categoryItemCount = 0;
+
+ if ( aVideo.IsSupported( KVcxMediaMyVideosCategoryItemCount ) )
+ {
+ categoryItemCount = aVideo.ValueTObjectL<TUint32>( KVcxMediaMyVideosCategoryItemCount );
+ }
+ return categoryItemCount;
+ }
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::CategoryNewItemCountL
+// ----------------------------------------------------------------------------
+//
+TUint32 TVcxMyVideosCollectionUtil::CategoryNewItemCountL( CMPXMedia& aVideo )
+ {
+ TUint32 categoryNewItemCount = 0;
+
+ if ( aVideo.IsSupported( KVcxMediaMyVideosCategoryNewItemCount ) )
+ {
+ categoryNewItemCount = aVideo.ValueTObjectL<TUint32>( KVcxMediaMyVideosCategoryNewItemCount );
+ }
+ return categoryNewItemCount;
+ }
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::CategoryNewVideoName
+// ----------------------------------------------------------------------------
+//
+const TDesC& TVcxMyVideosCollectionUtil::CategoryNewVideoName( const CMPXMedia& aVideo )
+ {
+ if ( aVideo.IsSupported( KVcxMediaMyVideosCategoryNewItemName ) )
+ {
+ return aVideo.ValueText( KVcxMediaMyVideosCategoryNewItemName );
+ }
+ else
+ {
+ return KNullDesC;
+ }
+ }
+
+// ----------------------------------------------------------------------------
// TVcxMyVideosCollectionUtil::GetIdsFromMediaArrayL
// ----------------------------------------------------------------------------
//
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosmdsalbums.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosmdsalbums.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -50,27 +50,8 @@
void CVcxMyVideosMdsAlbums::ConstructL()
{
GetSchemaDefinitionsL();
- CActiveScheduler::Add( this );
-
- if ( iObserver )
- {
- //ENotifyAdd and ENotifyModify are not supported
- iMdsDb.MdsSessionL().AddRelationItemObserverL( *this, NULL,
- ENotifyRemove, iMdsDb.iNamespaceDef );
-
-#if 0
- // We receive only IDs from here. We need to make query to get
- // relation objects-> slow to use. We use the response from
- // the add operation instead. This way we don't receive
- // add events if someone else adds videos to our albums
- // but the performance is the best possible.
- iMdsDb.MdsSessionL().AddRelationObserverL( *this, NULL,
- ENotifyAdd | ENotifyModify | ENotifyRemove );
-#endif
- }
-
- //TODO: do we need this?
- //iMdsDb.MdsSessionL().AddRelationPresentObserverL();
+ SetObservingL();
+ CActiveScheduler::Add( this );
}
// ---------------------------------------------------------------------------
@@ -160,6 +141,30 @@
}
// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::SetObservingL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::SetObservingL()
+ {
+ if ( iObserver )
+ {
+ //ENotifyAdd and ENotifyModify are not supported
+ iMdsDb.MdsSessionL().AddRelationItemObserverL( *this, NULL,
+ ENotifyRemove, iMdsDb.iNamespaceDef );
+
+#if 0
+ // We receive only IDs from here. We need to make query to get
+ // relation objects-> slow to use. We use the response from
+ // the add operation instead. This way we don't receive
+ // add events if someone else adds videos to our albums
+ // but the performance is the best possible.
+ iMdsDb.MdsSessionL().AddRelationObserverL( *this, NULL,
+ ENotifyAdd | ENotifyModify | ENotifyRemove );
+#endif
+ }
+ }
+
+// ---------------------------------------------------------------------------
// CVcxMyVideosMdsAlbums::GetAlbumsL
// ---------------------------------------------------------------------------
//
@@ -441,6 +446,11 @@
// TITLE (NAME)
if ( aAlbum.IsSupported( KMPXMediaGeneralTitle ) )
{
+ if ( TVcxMyVideosCollectionUtil::Title( aAlbum ).Length() > KVcxMvcMaxTitleLength )
+ {
+ User::Leave( KErrArgument );
+ }
+
if ( aObject.Property( *iMdsDb.iTitlePropertyDef, property, 0 ) != KErrNotFound )
{
static_cast<CMdETextProperty*>(property)->SetValueL(
@@ -1037,7 +1047,10 @@
TObserverNotificationType aType,
const RArray<TMdERelation>& aRelationArray)
{
- iObserver->HandleRelationEvent( aType, aRelationArray );
+ if ( iObserver )
+ {
+ iObserver->HandleRelationEvent( aType, aRelationArray );
+ }
}
#if 0
@@ -1054,7 +1067,10 @@
{
case ENotifyAdd:
MPX_DEBUG1("CVcxMyVideosMdsAlbums:: relation ENotifyAdd");
- iObserver->HandleRelationIdEvent( aType, aRelationIdArray );
+ if ( iObserver )
+ {
+ iObserver->HandleRelationIdEvent( aType, aRelationIdArray );
+ }
break;
case ENotifyModify:
MPX_DEBUG1("CVcxMyVideosMdsAlbums:: ENotifyModify");
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosmdsdb.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosmdsdb.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -2,7 +2,7 @@
* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
+* under the terms of the License "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
@@ -159,15 +159,17 @@
}
// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsDb::CVcxMyVideosMdsDb
// ---------------------------------------------------------------------------
//
CVcxMyVideosMdsDb::CVcxMyVideosMdsDb( MVcxMyVideosMdsDbObserver* aObserver,
- MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver, RFs& aFs )
+ RFs& aFs, MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver )
: iFs( aFs ), iMdsDbObserver(aObserver), iAlbumsObserver(aAlbumsObserver)
{
}
// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsDb::ConstructL
// ---------------------------------------------------------------------------
//
void CVcxMyVideosMdsDb::ConstructL()
@@ -189,6 +191,8 @@
iMdsShutdownMonitor = CVcxMdsShutdownMonitor::NewL(
*this, KHarvesterPSShutdown, KMdSShutdown, EFalse );
+
+ iEvents.Reset();
MPX_DEBUG1( "CVcxMyVideosMdsDb::ConstructL exit" );
}
@@ -233,6 +237,7 @@
if ( iAlbums )
{
iAlbums->GetSchemaDefinitionsL();
+ iAlbums->SetObservingL();
}
}
else
@@ -253,7 +258,7 @@
TBool aPresent, const RArray<TItemId>& aObjectIdArray)
{
MPX_DEBUG1( "CVcxMyVideosMdsDb::--------------------------------------------------------------." );
- MPX_DEBUG3( "CVcxMyVideosMdsDb::HandleObjectPresentNotification( aPresent = %1d, count = %3d) |", aPresent, aObjectIdArray.Count() );
+ MPX_DEBUG3( "CVcxMyVideosMdsDb::HandleObjectPresentNotification( aPresent = %1d, count = %4d) |", aPresent, aObjectIdArray.Count() );
MPX_DEBUG1( "CVcxMyVideosMdsDb::--------------------------------------------------------------'" );
TObserverNotificationType type;
@@ -273,10 +278,10 @@
// ---------------------------------------------------------------------------
//
CVcxMyVideosMdsDb* CVcxMyVideosMdsDb::NewL( MVcxMyVideosMdsDbObserver* aObserver,
- MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver, RFs& aFs )
+ RFs& aFs, MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver )
{
CVcxMyVideosMdsDb* self =
- CVcxMyVideosMdsDb::NewLC( aObserver, aAlbumsObserver, aFs );
+ CVcxMyVideosMdsDb::NewLC( aObserver, aFs, aAlbumsObserver );
CleanupStack::Pop( self );
return self;
}
@@ -286,9 +291,9 @@
// ---------------------------------------------------------------------------
//
CVcxMyVideosMdsDb* CVcxMyVideosMdsDb::NewLC( MVcxMyVideosMdsDbObserver* aObserver,
- MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver, RFs& aFs )
+ RFs& aFs, MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver )
{
- CVcxMyVideosMdsDb* self = new( ELeave ) CVcxMyVideosMdsDb( aObserver, aAlbumsObserver, aFs );
+ CVcxMyVideosMdsDb* self = new( ELeave ) CVcxMyVideosMdsDb( aObserver, aFs, aAlbumsObserver );
CleanupStack::PushL( self );
self->ConstructL();
return self;
@@ -302,6 +307,9 @@
{
MPX_DEBUG1( "CVcxMyVideosMdsDb::~CVcxMyVideosMdsDb() start" );
+ delete iEventProcessor;
+ iEvents.Close();
+
Cancel( EGetVideoList );
delete iAlbums;
@@ -1022,8 +1030,22 @@
//16. ORIGIN, KVcxMediaMyVideosOrigin
if ( aObject.Property( *iOriginPropertyDef, property, 0 ) != KErrNotFound )
{
- aVideo.SetTObjectValueL<TUint8>( KVcxMediaMyVideosOrigin,
- static_cast<CMdEUint8Property*>(property)->Value() );
+ TUint8 origin = static_cast<CMdEUint8Property*>(property)->Value();
+#ifndef VCX_DOWNLOADS_CATEGORY
+ if( origin != EVcxMyVideosOriginCapturedWithCamera )
+ {
+ origin = EVcxMyVideosOriginOther;
+ }
+#else
+ if ( origin != EVcxMyVideosOriginCapturedWithCamera &&
+ origin != EVcxMyVideosOriginDownloaded
+ )
+ {
+ origin = EVcxMyVideosOriginOther;
+ }
+
+#endif
+ aVideo.SetTObjectValueL<TUint8>( KVcxMediaMyVideosOrigin, origin );
}
//17. DURATION, (KMPXMediaGeneralDuration can't be used since it is TInt
@@ -1572,11 +1594,6 @@
iAudioLanguagePropertyDef = &(iVideoObjectDef->GetPropertyDefL(
KVcxAudioLanguagePropertyName )); //14
-
-#if 0
- iDownloadIdPropertyDef = &(iVideoObjectDef->GetPropertyDefL(
- KVcxDownloadIdPropertyName )); //18
-#endif
}
@@ -1592,30 +1609,116 @@
if ( iMdsDbObserver )
{
- RArray<TUint32> idArray;
- CleanupClosePushL( idArray ); // 1->
-
- for ( TInt i = 0; i < aObjectIdArray.Count(); i++ )
+ // Let delete events bypass buffer only if it empty.
+ // This assures that event arriving order stays the same.
+ if ( aType & ENotifyRemove && iEvents.Count() == 0 )
{
- idArray.Append( aObjectIdArray[i] );
+ // Delete handling is so fast that we dont buffer them at all.
+ // Modify and add require fetch from mds -> they are slow.
+ RArray<TUint32> idArray;
+ CleanupClosePushL( idArray ); // 1->
+
+ for ( TInt i = 0; i < aObjectIdArray.Count(); i++ )
+ {
+ idArray.Append( aObjectIdArray[i] );
+ }
+
+ iMdsDbObserver->HandleMyVideosDbEvent( EMPXItemDeleted, idArray, iEvents.Count() );
+
+ CleanupStack::PopAndDestroy( &idArray ); // <-1
}
-
- if ( aType & ENotifyAdd )
+ else
{
- iMdsDbObserver->HandleMyVideosDbEvent( EMPXItemInserted, idArray );
- }
- else if ( aType & ENotifyModify )
- {
- iMdsDbObserver->HandleMyVideosDbEvent( EMPXItemModified, idArray );
- }
- else if ( aType & ENotifyRemove )
- {
- iMdsDbObserver->HandleMyVideosDbEvent( EMPXItemDeleted, idArray );
- }
+ // Buffer modify & add events, since their handling is slow.
+ // Process them on background.
+ TInt count = aObjectIdArray.Count();
+
+ if ( iEvents.Count() == 0 )
+ {
+ iEvents.ReserveL( count );
+ }
+
+ TEvent event;
+ for ( TInt i = 0; i < count; i++ )
+ {
+ event.iMdsId = aObjectIdArray[i];
+ event.iEventType = aType;
+ iEvents.AppendL( event );
+ }
+
+ if ( !iEventProcessor )
+ {
+ iEventProcessor = CIdle::NewL( CActive::EPriorityIdle );
+ }
+
+ if ( !iEventProcessor->IsActive() )
+ {
+ iEventProcessor->Start( TCallBack( ProcessEvents, this ));
+ }
+ }
+ }
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsDb::ProcessEvents
+// ---------------------------------------------------------------------------
+//
+TInt CVcxMyVideosMdsDb::ProcessEvents( TAny* aPtr )
+ {
+ return static_cast<CVcxMyVideosMdsDb*>(aPtr)->DoProcessEvents();
+ }
- CleanupStack::PopAndDestroy( &idArray ); // <-1
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsDb::DoProcessEvents
+// ---------------------------------------------------------------------------
+//
+TInt CVcxMyVideosMdsDb::DoProcessEvents()
+ {
+ TInt sent = 0;
+ TInt currentEventType = -1;
+ const TInt sendAtOnce = 10;
+
+ RArray<TUint32> idArray;
+ CleanupClosePushL( idArray ); // 1->
+
+ idArray.Reserve( sendAtOnce ); // may fail, it's ok
+
+ while ( sent < sendAtOnce )
+ {
+ if ( iEvents.Count() == 0 )
+ {
+ break;
+ }
+
+ if ( iEvents[0].iEventType != currentEventType &&
+ currentEventType != -1 )
+ {
+ break;
+ }
+ currentEventType = iEvents[0].iEventType;
+ idArray.Append( iEvents[0].iMdsId ); // this may fail, it is ok, we can't do anything for it
+ iEvents.Remove( 0 );
+ sent++;
}
-
+
+ iEvents.Compress();
+
+ if ( currentEventType & ENotifyAdd )
+ {
+ iMdsDbObserver->HandleMyVideosDbEvent( EMPXItemInserted, idArray, iEvents.Count() );
+ }
+ else if ( currentEventType & ENotifyModify )
+ {
+ iMdsDbObserver->HandleMyVideosDbEvent( EMPXItemModified, idArray, iEvents.Count() );
+ }
+ else if ( currentEventType & ENotifyRemove )
+ {
+ iMdsDbObserver->HandleMyVideosDbEvent( EMPXItemDeleted, idArray, iEvents.Count() );
+ }
+
+ CleanupStack::PopAndDestroy( &idArray ); // <-1
+
+ return iEvents.Count();
}
// ---------------------------------------------------------------------------
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosmessagelist.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosmessagelist.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -106,7 +106,7 @@
MPX_DEBUG1("CVcxMyVideosMessageList:: ----------------------------------------------'" );
#endif
- if ( AlreadyInMessageListL( aId, aChange, aExtraInfo ) )
+ if ( aChange == EMPXItemModified && AlreadyInMessageListL( aId, aChange, aExtraInfo ) )
{
MPX_DEBUG1("CVcxMyVideosMessageList:: already in message list, skipping add");
return;
@@ -139,6 +139,11 @@
iMessageCount++;
iMessageList->SetTObjectValueL<TInt>( KMPXMessageArrayCount, iMessageCount );
+
+ if ( iMessageArray->Count() > 100 )
+ {
+ SendL();
+ }
}
// ----------------------------------------------------------------------------------------------------------
@@ -277,10 +282,9 @@
#endif
CreateMessageListL(); //does nothing if already created
- iMessageArray->AppendL( aMessage ); // ownership moves
iMessageCount++;
iMessageList->SetTObjectValueL<TInt>( KMPXMessageArrayCount, iMessageCount );
-
+ iMessageArray->AppendL( aMessage ); // ownership moves
}
// ----------------------------------------------------------------------------------------------------------
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosopenhandler.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosopenhandler.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -125,8 +125,10 @@
case categoryLevel:
{
//we are at root level, return main level items (categories + albums)
-
+
+#ifdef VCX_ALBUMS
iCollection.AlbumsL().CreateAlbumListL(); //async
+#endif
// This is needed to update category counters.
// Goes to queue if CreateAlbumListL command goes to execution
@@ -139,8 +141,14 @@
CMPXMedia* itemList = TVcxMyVideosCollectionUtil::CreateEmptyMediaListL();
CleanupStack::PushL( itemList );
+
+ itemList->SetTObjectValueL<TBool>( KVcxMediaMyVideosVideoListIsPartial,
+ !iCache.IsComplete() );
+
TVcxMyVideosCollectionUtil::AppendToListL( *itemList, *iCollection.CategoriesL().iList );
+#ifdef VCX_ALBUMS
TVcxMyVideosCollectionUtil::AppendToListL( *itemList, *iCollection.AlbumsL().iAlbumList );
+#endif
itemList->SetCObjectValueL( KMPXMediaGeneralContainerPath, iPath );
iCollection.iObs->HandleOpen( itemList, KErrNone );
CleanupStack::PopAndDestroy( itemList );
@@ -152,7 +160,9 @@
{
//we are at second level, return video list from some category or album
+#ifdef VCX_ALBUMS
iCollection.AlbumsL().CreateAlbumListL(); //async
+#endif
TMPXItemId categoryId( aPath.Id() );
@@ -219,6 +229,8 @@
{
MPX_DEBUG1("CVcxMyVideosOpenHandler:: KVcxMvcCategoryIdAll: calling HandleOpen(iCache.iVideoList)");
iCache.iVideoList->SetCObjectValueL( KMPXMediaGeneralContainerPath, iPath );
+ iCache.iVideoList->SetTObjectValueL<TInt>( KVcxMediaMyVideosInt32Value,
+ EVcxMyVideosVideoListComplete );
iCollection.iObs->HandleOpen( iCache.iVideoList, KErrNone );
}
else
@@ -227,6 +239,8 @@
CMPXMedia* videoList = iCache.CreateVideoListByOriginL( origin );
MPX_DEBUG1("CVcxMyVideosOpenHandler:: calling HandleOpen(new list)");
videoList->SetCObjectValueL( KMPXMediaGeneralContainerPath, iPath );
+ videoList->SetTObjectValueL<TInt>( KVcxMediaMyVideosInt32Value,
+ EVcxMyVideosVideoListComplete );
iCollection.iObs->HandleOpen( videoList, KErrNone );
delete videoList;
}
@@ -262,8 +276,8 @@
iVideoListsBeingOpened.AppendL( videoList );
CleanupStack::Pop( videoList );
MPX_DEBUG1("CVcxMyVideosOpenHandler:: calling HandleOpen");
- iCache.iVideoList->SetCObjectValueL( KMPXMediaGeneralContainerPath, iPath );
- iCollection.iObs->HandleOpen( iCache.iVideoList, KErrNone );
+ videoList->SetCObjectValueL( KMPXMediaGeneralContainerPath, iPath );
+ iCollection.iObs->HandleOpen( videoList, KErrNone );
}
else
{
@@ -322,7 +336,7 @@
// End event arrived
iCache.SetComplete( ETrue );
- iCache.IsFetchingVideoList = EFalse;
+ iCache.iIsFetchingVideoList = EFalse;
// Create modify event for All category.
@@ -376,7 +390,7 @@
iCollection.CategoriesL().UpdateCategoriesNewVideoNamesL();
- iCollection.AlbumsL().CalculateAttributesL();
+ iCollection.AlbumsL().CalculateAttributesL(); // adds events if attributes modified, does not send
iCollection.iMessageList->AddEventL( KVcxMessageMyVideosListComplete );
}
@@ -390,9 +404,6 @@
//
void CVcxMyVideosOpenHandler::HandleAlbumOpenL()
{
- //TODO: If iVideoList is partial and fetching is already going on -> use the implementation below.
- // If iVideoList is partial but fetching is not going on -> fetch only album items to iCache.
-
MPX_DEBUG1("CVcxMyVideosOpenHandler::HandleAlbumOpenL() start");
CVcxMyVideosAlbum* album = iCollection.AlbumsL().Album( iPendingAlbumOpenId );
@@ -402,15 +413,18 @@
{
//videolist complete
CMPXMedia* videoList = album->CreateVideoListL();
+ CleanupStack::PushL( videoList ); // 1->
videoList->SetCObjectValueL( KMPXMediaGeneralContainerPath, iPath );
+ videoList->SetTObjectValueL<TInt>( KVcxMediaMyVideosInt32Value,
+ EVcxMyVideosVideoListComplete );
iCollection.iObs->HandleOpen( videoList, KErrNone );
- delete videoList;
+ CleanupStack::PopAndDestroy( videoList ); // <-1
iCollection.iMessageList->AddEventL( KVcxMessageMyVideosListComplete );
iCollection.iMessageList->SendL();
}
else
{
- if ( iCollection.iCache->IsFetchingVideoList )
+ if ( iCollection.iCache->iIsFetchingVideoList )
{
MPX_DEBUG1("CVcxMyVideosOpenHandler:: videolist fetching already in progress -> use that to populate album");
@@ -437,9 +451,6 @@
}
else
{
- // videolist incomplete and fetching hasn't been started
- // TODO: Test how fast this is. If slow, then ditch the separate album fetching.
-
MPX_DEBUG1("CVcxMyVideosOpenHandler:: videolist partial and no fetching going on -> fetch the album videos separately");
delete iAlbumVideoList;
@@ -510,14 +521,16 @@
MPX_DEBUG3("CVcxMyVideosOpenHandler:: adding modify event for album %d, extra info = %d",
aAlbumId, EVcxMyVideosVideoListOrderChanged );
- iCollection.iMessageList->AddEventL( TMPXItemId( aAlbumId, 2 ), EMPXItemModified,
+ iCollection.iMessageList->AddEventL( TMPXItemId( aAlbumId, KVcxMvcMediaTypeAlbum ), EMPXItemModified,
EVcxMyVideosVideoListOrderChanged );
}
else
{
//TODO: should add album id
- iCollection.AlbumsL().CalculateAttributesL();
+ iCollection.AlbumsL().CalculateAttributesL(); // adds events if attributes modified, does not send
+ iAlbumVideoList->SetTObjectValueL<TInt>( KVcxMediaMyVideosInt32Value,
+ EVcxMyVideosVideoListComplete );
iCollection.iMessageList->AddEventL( KVcxMessageMyVideosListComplete );
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosvideocache.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosvideocache.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -14,7 +14,7 @@
* Description: Video list cache. Contains cached data from MDS.*
*/
-// Version : %version: TB101_57 %
+
// INCLUDE FILES
@@ -344,18 +344,8 @@
{
media = (*allVideosArray)[i];
- TUint8 mediaOrigin = EVcxMyVideosOriginOther;
-
- if ( media->IsSupported( KVcxMediaMyVideosOrigin ) )
- {
- mediaOrigin = *(media->Value<TUint8>( KVcxMediaMyVideosOrigin ));
-
- if ( mediaOrigin == EVcxMyVideosOriginSideLoaded )
- {
- mediaOrigin = EVcxMyVideosOriginOther;
- }
- }
-
+ TUint8 mediaOrigin = TVcxMyVideosCollectionUtil::OriginL( *media );
+
if ( mediaOrigin == aOrigin )
{
filteredVideosArray->AppendL( *media );
@@ -522,7 +512,7 @@
// ----------------------------------------------------------------------------
//
void CVcxMyVideosVideoCache::AddVideosFromMdsL( RArray<TUint32>& aMdsIds,
- TBool& aListFetchingWasCanceled, RArray<TUint32>* aNonVideoIds )
+ TBool& aListFetchingWasCanceled, RArray<TUint32>* aNonVideoIds, TBool aUpdateCategories )
{
MPX_FUNC("CVcxMyVideosVideoCache::AddVideosFromMdsL");
@@ -557,7 +547,7 @@
{
CleanupStack::PushL( videoToCache ); // 1->
- TInt err = AddL( videoToCache, sortingOrder );
+ TInt err = AddL( videoToCache, sortingOrder, aUpdateCategories );
if ( err == KErrNone )
{
@@ -594,7 +584,8 @@
// This is for single adds, video list fetching does not call this.
// ----------------------------------------------------------------------------
//
-TInt CVcxMyVideosVideoCache::AddL( CMPXMedia* aVideo, TVcxMyVideosSortingOrder aSortingOrder )
+TInt CVcxMyVideosVideoCache::AddL( CMPXMedia* aVideo, TVcxMyVideosSortingOrder aSortingOrder,
+ TBool aUpdateCategories )
{
MPX_FUNC("CVcxMyVideosVideoCache::AddL");
@@ -606,7 +597,7 @@
else
{
MPX_DEBUG1("CVcxMyVideosVideoCache:: iVideoList is complete, adding to iVideoList");
- return AddToCorrectPlaceL( *aVideo, aSortingOrder );
+ return AddToCorrectPlaceL( *aVideo, aSortingOrder, aUpdateCategories );
}
}
@@ -749,7 +740,7 @@
TVcxMyVideosSortingOrder sortingOrder = SortingOrderL();
- if ( IsFetchingVideoList
+ if ( iIsFetchingVideoList
&& sortingOrder == iLastSortingOrder && !aForce )
{
MPX_DEBUG1("CVcxMyVideosVideoCache:: iVideoList creation is already ongoing, skipping");
@@ -760,11 +751,11 @@
{
MPX_DEBUG1("CVcxMyVideosVideoCache:: iVideoList was partial or in wrong order or aForce was ETrue, recreating");
- if ( IsFetchingVideoList )
+ if ( iIsFetchingVideoList )
{
MPX_DEBUG1("CVcxMyVideosVideoCache:: video list fetching is ongoing, canceling it");
iCollection.iMyVideosMdsDb->Cancel( CVcxMyVideosMdsDb::EGetVideoList );
- IsFetchingVideoList = EFalse;
+ iIsFetchingVideoList = EFalse;
}
ResetVideoListL();
@@ -790,7 +781,7 @@
EFalse /* brief list */,
iVideoList /* use existing */ );
- IsFetchingVideoList = ETrue;
+ iIsFetchingVideoList = ETrue;
iLastSortingOrder = sortingOrder;
SetComplete( EFalse );
}
@@ -947,14 +938,18 @@
TBool modified = EFalse;
iCollection.CategoriesL().UpdateCategoryNewVideoNameAndDateL(
*videoInCache, modified );
-
+
+ TUint8 origin = TVcxMyVideosCollectionUtil::OriginL( *videoInCache );
+
iCollection.CategoriesL().NewVideoFlagChangedL(
oldFlags, newFlags,
- videoInCache->ValueTObjectL<TUint8>( KVcxMediaMyVideosOrigin ),
+ origin,
modified );
+#ifdef VCX_ALBUMS
iCollection.AlbumsL().NewVideoFlagChangedL(
TVcxMyVideosCollectionUtil::IdL( *videoInCache ).iId1 );
+#endif
}
changed = ETrue;
}
@@ -1146,7 +1141,7 @@
}
}
- // 22
+ // 23
if ( aVideo.IsSupported( KMPXMediaVideoHeight ) )
{
TUint16 height = aVideo.ValueTObjectL<TUint16>( KMPXMediaVideoHeight );
@@ -1196,8 +1191,10 @@
iCollection.CategoriesL().UpdateCategoryNewVideoNameAndDateL(
*aVideoInCache, modified );
+#ifdef VCX_ALBUMS
iCollection.AlbumsL().VideoTitleChangedL(
TVcxMyVideosCollectionUtil::IdL( *aVideoInCache ).iId1 );
+#endif
TVcxMyVideosSortingOrder sortingOrder = SortingOrderL();
if ( sortingOrder == EVcxMyVideosSortingName )
@@ -1443,17 +1440,18 @@
//
TVcxMyVideosSortingOrder CVcxMyVideosVideoCache::SortingOrderL()
{
- TUid uid;
- uid.iUid = KVcxMyVideosCollectionCenrepUid;
- CRepository* cenRep = CRepository::NewL( uid );
- CleanupStack::PushL( cenRep ); // 1->
+
+ if( !iCenRep )
+ {
+ TUid uid;
+ uid.iUid = KVcxMyVideosCollectionCenrepUid;
+ iCenRep = CRepository::NewL( uid );
+ }
TInt sortingOrderInCenrep;
- TInt cenRepError = cenRep->Get( KVcxMyVideosCollectionCenrepKeySortingOrder,
+ TInt cenRepError = iCenRep->Get( KVcxMyVideosCollectionCenrepKeySortingOrder,
sortingOrderInCenrep );
-
- CleanupStack::PopAndDestroy( cenRep ); // <-1
TVcxMyVideosSortingOrder sortingOrder;
@@ -1504,6 +1502,9 @@
if ( aUpdateCategories )
{
iCollection.CategoriesL().VideoAddedL( aVideo );
+#ifdef VCX_ALBUMS
+ iCollection.AlbumsL().VideoAddedOrRemovedFromCacheL( aVideo );
+#endif
}
return KErrNone;
@@ -1556,13 +1557,14 @@
MPX_DEBUG1("CVcxMyVideosVideoCache:: RemoveL failed since the item wasn't on cache");
return KErrNotFound;
}
-
- TUint32 flags = TVcxMyVideosCollectionUtil::FlagsL( *video );
if ( aUpdateCategories &&
pos != KErrNotFound /* no need to update if item is on iPartialVideoList*/ )
{
iCollection.CategoriesL().VideoRemovedL( *video );
+#ifdef VCX_ALBUMS
+ iCollection.AlbumsL().VideoAddedOrRemovedFromCacheL( *video );
+#endif
}
if ( pos != KErrNotFound )
@@ -1609,8 +1611,7 @@
{
MPX_FUNC("CVcxMyVideosVideoCache::ResetVideoListL");
- //TODO: when should we cancel...
- //iCollection.iMyVideosMdsDb->Cancel();
+ iCollection.iMyVideosMdsDb->Cancel( CVcxMyVideosMdsDb::EGetVideoList );
CMPXMediaArray* mediaArray =
iVideoList->ValueCObjectL<CMPXMediaArray>( KMPXMediaArrayContents );
--- a/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXMyVideosCollectionPluginTest.cfg Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXMyVideosCollectionPluginTest.cfg Thu Jul 22 16:34:17 2010 +0100
@@ -369,12 +369,10 @@
VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened KVCXMYVideosTestMessageListComplete
waittestclass VCXMV
-VCXMV CreateVideoFileNoWait VcxTestVideoMpeg4 DRIVE_1 "video1_DRIVE1.mp4" ANY_SIZE 3
-VCXMV CreateVideoFileNoWait VcxTestVideoMpeg4 DRIVE_2 "video2_DRIVE2.mp4" ANY_SIZE 3
-VCXMV CreateVideoFileNoWait VcxTestVideoMpeg4 DRIVE_1 "video3_DRIVE1.mp4" ANY_SIZE 3
-VCXMV CreateVideoFileNoWait VcxTestVideoMpeg4 DRIVE_2 "video4_DRIVE2.mp4" ANY_SIZE 3
-
-pause PAUSE_SIDELOAD_MINUTE
+VCXMV CreateVideoFile VcxTestVideoMpeg4 DRIVE_1 "video1_DRIVE1.mp4" ANY_SIZE 3
+VCXMV CreateVideoFile VcxTestVideoMpeg4 DRIVE_2 "video2_DRIVE2.mp4" ANY_SIZE 3
+VCXMV CreateVideoFile VcxTestVideoMpeg4 DRIVE_1 "video3_DRIVE1.mp4" ANY_SIZE 3
+VCXMV CreateVideoFile VcxTestVideoMpeg4 DRIVE_2 "video4_DRIVE2.mp4" ANY_SIZE 3
VCXMV CheckMediaCount ANY_DRIVE 12
VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralFlags EVcxMyVideosVideoNew
--- a/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXMyVideosCollectionPluginTestAlbums.cfg Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXMyVideosCollectionPluginTestAlbums.cfg Thu Jul 22 16:34:17 2010 +0100
@@ -56,7 +56,6 @@
VCXMV RemoveAllMedia
delete VCXMV
-
create VCXMyVideosCollectionPluginTest VCXMV
VCXMV Create
@@ -174,6 +173,9 @@
VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
waittestclass VCXMV
+VCXMV RefreshContents
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+
VCXMV CheckAlbumCount 1
print OK!
@@ -502,8 +504,13 @@
VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMpxAlbumInserted KVCXMYVideosTestMessageCollectionOpened
waittestclass VCXMV
-VCXMV CloseLevel
-VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+delete VCXMV
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened KVCXMYVideosTestMessageListComplete
waittestclass VCXMV
VCXMV CheckAlbumCount 5
@@ -938,6 +945,79 @@
delete VCXMV
[Endtest]
+#------------------------------------------------------------------------------------
+#
+# Add videos to album from collection root level
+#
+#------------------------------------------------------------------------------------
+[Test]
+title Add videos to album from collection root level
+
+callsub Cleanup
+
+// TESTCASE START
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV CreateAlbum Album1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMpxAlbumInserted KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateAlbum Album2
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMpxAlbumInserted KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV CreateVideoFile VcxTestVideoMpeg4 DRIVE_1 "video.mp4" ANY_SIZE 3
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV CoolDown
+
+VCXMV SetUseCopiedMedias 1
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV AddMediasToAlbum Album2 ANY_DRIVE 0 3
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMpxAlbumModified KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CoolDown
+
+VCXMV CheckMediaDetail ANY_DRIVE Album2 EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 3
+
+// Check that videos have been added.
+
+VCXMV SetUseCopiedMedias 0
+
+VCXMV OpenLevel Album2
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel Album1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV CheckMediaCount ANY_DRIVE 0
+
+print OK!
+delete VCXMV
+[Endtest]
#------------------------------------------------------------------------------------
#
@@ -977,6 +1057,7 @@
VCXMV AddMediasToAlbum Album1 ANY_DRIVE 0 1
VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMpxAlbumModified KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCollectionOpened
+allownextresult KERRARGUMENT
waittestclass VCXMV
// Check that videos have been added.
@@ -2429,7 +2510,7 @@
waittestclass VCXMV
VCXMV RenameAlbum Album1 Album2
-VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMpxAlbumModified KVCXMYVideosTestMessageCollectionOpened
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMpxAlbumModified
waittestclass VCXMV
VCXMV CheckAlbumExists Album2
@@ -2471,7 +2552,7 @@
waittestclass VCXMV
VCXMV RenameAlbum Album1 "EmptyString"
-VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMpxAlbumModified KVCXMYVideosTestMessageCollectionOpened
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMpxAlbumModified
waittestclass VCXMV
allownextresult KERRNOTFOUND
@@ -2482,39 +2563,6 @@
delete VCXMV
[Endtest]
-#------------------------------------------------------------------------------------
-#
-# Rename album with long name
-#
-#------------------------------------------------------------------------------------
-[Test]
-title Rename album with long name
-
-callsub Cleanup
-
-// TESTCASE START
-
-create VCXMyVideosCollectionPluginTest VCXMV
-VCXMV Create
-
-VCXMV OpenCollection VCXCollectionMyVideos
-VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened KVCXMYVideosTestMessageListComplete
-waittestclass VCXMV
-
-VCXMV CreateAlbum Album1
-VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMpxAlbumInserted KVCXMYVideosTestMessageCollectionOpened
-waittestclass VCXMV
-
-VCXMV RenameAlbum Album1 "2KString"
-VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMpxAlbumModified KVCXMYVideosTestMessageCollectionOpened
-waittestclass VCXMV
-
-VCXMV CheckAlbumExists Album1
-VCXMV CheckAlbumCount 1
-
-print OK!
-delete VCXMV
-[Endtest]
#------------------------------------------------------------------------------------
#
--- a/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXMyVideosCollectionPluginTestCategories.cfg Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXMyVideosCollectionPluginTestCategories.cfg Thu Jul 22 16:34:17 2010 +0100
@@ -53,8 +53,6 @@
VCXMV RemoveAllMedia
delete VCXMV
-print wait 30sec
-pause 30000
print cleanup end
[EndSub]
@@ -206,34 +204,6 @@
#------------------------------------------------------------------------------------
#
-# Tests opening 'TV Recordings' category when it's empty.
-#
-#------------------------------------------------------------------------------------
-[Test]
-title TV recordings - empty
-create VCXMyVideosCollectionPluginTest VCXMV
-VCXMV Create
-
-VCXMV OpenCollection VCXCollectionMyVideos
-VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
-waittestclass VCXMV
-
-VCXMV OpenLevel EVcxMyVideosTvRecordings
-VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened KVCXMYVideosTestMessageListComplete
-waittestclass VCXMV
-
-VCXMV CheckMediaCount ANY_DRIVE 0
-
-VCXMV CloseLevel
-VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
-waittestclass VCXMV
-
-print OK!
-delete VCXMV
-[Endtest]
-
-#------------------------------------------------------------------------------------
-#
# Tests opening 'Captured videos' category when it's empty.
#
#------------------------------------------------------------------------------------
@@ -433,36 +403,6 @@
#------------------------------------------------------------------------------------
#
-# Tests opening 'TV recordings' category when device has videos with different origins.
-#
-#------------------------------------------------------------------------------------
-[Test]
-title TV recordings - all origins
-create VCXMyVideosCollectionPluginTest VCXMV
-VCXMV Create
-VCXMV SetFileCheck 0
-
-VCXMV OpenCollection VCXCollectionMyVideos
-VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
-waittestclass VCXMV
-
-VCXMV OpenLevel EVcxMyVideosTvRecordings
-VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened KVCXMYVideosTestMessageListComplete
-waittestclass VCXMV
-
-VCXMV CheckMediaCount ANY_DRIVE 1
-VCXMV CheckMediaDetail ANY_DRIVE 0 EVcxTestMapping_KMPXMediaGeneralTitle "OriginRecording"
-
-VCXMV CloseLevel
-VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
-waittestclass VCXMV
-
-print OK!
-delete VCXMV
-[Endtest]
-
-#------------------------------------------------------------------------------------
-#
# Tests opening 'Captured videos' category when device has videos with different origins.
#
#------------------------------------------------------------------------------------
@@ -735,32 +675,6 @@
#------------------------------------------------------------------------------------
#
-# Tests that category 'TV recorgins' has correct details when there's videos with different origins.
-#
-#------------------------------------------------------------------------------------
-[Test]
-title TV recordings - category details
-create VCXMyVideosCollectionPluginTest VCXMV
-VCXMV Create
-
-VCXMV OpenCollection VCXCollectionMyVideos
-VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
-waittestclass VCXMV
-
-VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageListComplete
-waittestclass VCXMV
-
-VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosTvRecordings EVcxTestMapping_KMPXMediaGeneralTitle "TV recordings"
-VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosTvRecordings EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 2
-VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosTvRecordings EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 1
-VCXMV CheckMediaDetail ANY_DRIVE EVcxMyVideosTvRecordings EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemName "OriginRecording"
-
-print OK!
-delete VCXMV
-[Endtest]
-
-#------------------------------------------------------------------------------------
-#
# Tests that category 'Captured videos' has correct details when there's videos with different origins.
#
#------------------------------------------------------------------------------------
--- a/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/group/VCXMyVideosCollectionPluginTest.pkg Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/group/VCXMyVideosCollectionPluginTest.pkg Thu Jul 22 16:34:17 2010 +0100
@@ -17,13 +17,17 @@
&EN
; Provide value for uid
-#{"VCXMyVideosCollectionPluginTest"},(0x00000000),1,0,0,TYPE=SA, RU
+#{"VCXMyVideosCollectionPluginTest"},(0x101FB3E3),1,0,0,TYPE=SA, RU
; Localised Vendor name
%{"Nokia"}
; Unique Vendor name
:"Nokia"
+[0x101F7961],0,0,0,{"S60ProductID"}
+[0x102032BE],0,0,0,{"S60ProductID"}
+[0x102752AE],0,0,0,{"S60ProductID"}
+[0x1028315F],0,0,0,{"S60ProductID"}
; Logo
; None
@@ -53,9 +57,9 @@
; The testframework.ini files won't install with sis, only for ATS test runs.
"../init/TestFramework.ini" - "C:/TestFramework/TestFramework.ini"
-"../Data/MMC/video_3gp.3gp" - "e:/testing/data/video_3gp.xxx"
-"../Data/MMC/video_wmv.dat" - "e:/testing/data/video_wmv.xxx"
-"../Data/MMC/video_mpeg4.mp4" - "e:/testing/data/video_mpeg4.xxx"
+"../Data/MMC/video_3gp.3gp" - "c:/testing/data/video_3gp.xxx"
+"../Data/MMC/video_wmv.dat" - "c:/testing/data/video_wmv.xxx"
+"../Data/MMC/video_mpeg4.mp4" - "c:/testing/data/video_mpeg4.xxx"
; Embedded SIS
; None
--- a/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/group/bld.inf Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/group/bld.inf Thu Jul 22 16:34:17 2010 +0100
@@ -15,14 +15,16 @@
*
*/
+#include <platform_paths.hrh>
+
PRJ_PLATFORMS
DEFAULT
PRJ_TESTEXPORTS
-../data/mmc/video_3gp.3gp /epoc32/winscw/c/testing/data/video_3gp.xxx
-../data/mmc/video_mpeg4.mp4 /epoc32/winscw/c/testing/data/video_mpeg4.xxx
-../data/mmc/video_wmv.dat /epoc32/winscw/c/testing/data/video_wmv.xxx
+../data/mmc/video_3gp.3gp /epoc32/winscw/c/testing/data/video_3gp.xxx
+../data/mmc/video_mpeg4.mp4 /epoc32/winscw/c/testing/data/video_mpeg4.xxx
+../data/mmc/video_wmv.dat /epoc32/winscw/c/testing/data/video_wmv.xxx
../conf/VCXDrives.inc /epoc32/winscw/c/testframework/VCXDrives.inc
../conf/VCXErrors.inc /epoc32/winscw/c/testframework/VCXErrors.inc
../conf/vcxmvcollectionplugintest.inc /epoc32/winscw/c/testframework/vcxmvcollectionplugintest.inc
@@ -30,6 +32,16 @@
../conf/VCXMyVideosCollectionPluginTestCategories.cfg /epoc32/winscw/c/testframework/VCXMyVideosCollectionPluginTestCategories.cfg
../conf/VCXMyVideosCollectionPluginTestAlbums.cfg /epoc32/winscw/c/testframework/VCXMyVideosCollectionPluginTestAlbums.cfg
+../data/mmc/video_3gp.3gp /epoc32/data/z/system/testdata/video_3gp.xxx
+../data/mmc/video_mpeg4.mp4 /epoc32/data/z/system/testdata/video_mpeg4.xxx
+../data/mmc/video_wmv.dat /epoc32/data/z/system/testdata/video_wmv.xxx
+../conf/VCXDrives.inc /epoc32/data/z/system/testdata/VCXDrives.inc
+../conf/VCXErrors.inc /epoc32/data/z/system/testdata/VCXErrors.inc
+../conf/vcxmvcollectionplugintest.inc /epoc32/data/z/system/testdata/vcxmvcollectionplugintest.inc
+../conf/VCXMyVideosCollectionPluginTest.cfg /epoc32/data/z/system/testdata/VCXMyVideosCollectionPluginTest.cfg
+../conf/VCXMyVideosCollectionPluginTestCategories.cfg /epoc32/data/z/system/testdata/VCXMyVideosCollectionPluginTestCategories.cfg
+../conf/VCXMyVideosCollectionPluginTestAlbums.cfg /epoc32/data/z/system/testdata/VCXMyVideosCollectionPluginTestAlbums.cfg
+
PRJ_EXPORTS
PRJ_TESTMMPFILES
--- a/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/inc/VCXMyVideosTestUtils.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/inc/VCXMyVideosTestUtils.h Thu Jul 22 16:34:17 2010 +0100
@@ -83,7 +83,7 @@
/*
* Creates a video file to the system.
*/
- void CreateVideoFileL( TVcxTestVideoType aVideoType, TDesC& aFileName, TInt aSize );
+ void CreateVideoFileL( TVcxTestVideoType aVideoType, TDesC& aFileName, TInt aSize, TBool aUniqueName = false );
/*
* Creates video files to the system.
--- a/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/inc/VCXTestMdsDbModifier.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/inc/VCXTestMdsDbModifier.h Thu Jul 22 16:34:17 2010 +0100
@@ -2,7 +2,7 @@
* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
+* under the terms of the License "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
--- a/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/src/VCXMyVideosCollectionPluginTestBlocks.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/src/VCXMyVideosCollectionPluginTestBlocks.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -2970,7 +2970,48 @@
TInt err( KErrNone );
iLastReceivedMessage = -1;
-
+
+ if(aDoSync)
+ {
+ // Disable automatic refresh.
+ iTester->SetAutomaticRefresh( EFalse );
+ }
+
+ RArray<TInt> messages;
+
+ for(int i = 0; i < aVideoCount; i++)
+ {
+ // Create the video.
+ TRAP( err, iTestUtils->CreateVideoFileL( aType, *path, aSize, ETrue ) );
+ if(err != KErrNone)
+ {
+ VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: CreateVideoFileL returned error: %d:", err);
+ }
+
+ if( aDoSync && iTester->GetCurrentLevel() == 3 )
+ {
+ // Wait for insertion event.
+ messages.Append( KVCXMYVideosTestMessageMpxVideoInserted );
+ WaitForMessagesL( ETrue, messages, 60, ETrue );
+ messages.Reset();
+ }
+ }
+
+ if( aDoSync )
+ {
+ // Refresh.
+ messages.Reset();
+ iTester->RefreshContentsL();
+ messages.Append( KVCXMYVideosTestMessageCollectionOpened );
+ CleanupClosePushL( messages );
+ WaitForMessagesL( ETrue, messages, 30, ETrue );
+ CleanupStack::PopAndDestroy( &messages );
+ iTester->SetAutomaticRefresh( ETrue );
+ }
+
+ CleanupStack::PopAndDestroy( path );
+
+#if 0
if( aVideoCount == 1 )
{
// Save the path for later use.
@@ -3035,6 +3076,7 @@
}
}
}
+#endif
}
// -----------------------------------------------------------------------------
--- a/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/src/VCXMyVideosCollectionPluginTester.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/src/VCXMyVideosCollectionPluginTester.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -1644,6 +1644,7 @@
delete iCollectionEntries;
iCollectionEntries = NULL;
iCollectionEntries = CMPXMedia::NewL( *aMessage );
+ iCollectionMediaArray = iCollectionEntries->Value<CMPXMediaArray>( KMPXMediaArrayContents );
UpdateOwnedMediaArrayL();
@@ -2822,7 +2823,7 @@
for( TInt i = 0; i < iAlbumIds.Count(); i++ )
{
- // TODO: removing photos albums causes fails in opening albums.
+ // don't remove photos albums
if( iAlbumIds[i].iId1 > 2 )
{
album = CMPXMedia::NewL();
@@ -3027,7 +3028,7 @@
break;
}
indexOfMediaWithDrive++;
- }
+ }
}
}
}
--- a/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/src/VCXMyVideosTestUtils.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/src/VCXMyVideosTestUtils.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -97,115 +97,138 @@
// -----------------------------------------------------------------------------
-// CVCXMyVideosTestUtils::CreateVideoFilesL
+// CVCXMyVideosTestUtils::CreateVideoFileL
// -----------------------------------------------------------------------------
//
-void CVCXMyVideosTestUtils::CreateVideoFileL( TVcxTestVideoType aVideoType, TDesC& aFileName, TInt aSize )
+void CVCXMyVideosTestUtils::CreateVideoFileL( TVcxTestVideoType aVideoType, TDesC& aFileName, TInt aSize, TBool aUniqueName )
{
VCXLOGLO1(">>>CVcxTestVideoCreator::CreateVideoL");
- // Resolve source filename
- TBuf<256> srcFileName;
+ // Resolve source filename
+ TBuf<256> srcFileName;
- GetVideoFile( srcFileName, aVideoType, _L("C") );
+ GetVideoFile( srcFileName, aVideoType, _L("C") );
+ if( !BaflUtils::FileExists(iFs, srcFileName) )
+ {
+ VCXLOGLO2("CVcxTestVideoCreator:: %S does not exist.", &srcFileName);
+ GetVideoFile( srcFileName, aVideoType, _L("E") );
if( !BaflUtils::FileExists(iFs, srcFileName) )
{
VCXLOGLO2("CVcxTestVideoCreator:: %S does not exist.", &srcFileName);
- GetVideoFile( srcFileName, aVideoType, _L("E") );
- if( !BaflUtils::FileExists(iFs, srcFileName) )
- {
- VCXLOGLO2("CVcxTestVideoCreator:: %S does not exist.", &srcFileName);
- VCXLOGLO2("CVcxTestVideoCreator:: test video file %S missing! PANIC.", &srcFileName);
- User::Panic(_L("Video files missing!"), KErrNotFound);
- }
+ VCXLOGLO2("CVcxTestVideoCreator:: test video file %S missing! PANIC.", &srcFileName);
+ User::Panic(_L("Video files missing!"), KErrNotFound);
}
-
- BaflUtils::EnsurePathExistsL( iFs, aFileName.Left( aFileName.LocateReverse('\\') ) );
+ }
+
+ BaflUtils::EnsurePathExistsL( iFs, aFileName.Left( aFileName.LocateReverse('\\') ) );
+ HBufC* newFileName = HBufC::NewL( 256 );
+ CleanupStack::PushL( newFileName );
+
+ if(!aUniqueName)
+ {
+ newFileName->Des().Copy( aFileName );
BaflUtils::DeleteFile( iFs, aFileName );
-
- VCXLOGLO2("CVcxTestVideoCreator:: aSize = %d", aSize);
-
- TInt64 wantedSize( 0 );
-
- // Check the size
- if( aSize == KVcxTestLargeFile3GB ) {
- wantedSize = 1024*1024*1024 * 3;
+ }
+ else
+ {
+ newFileName->Des().Copy( aFileName );
+ TInt dotPos = aFileName.LocateReverse('.');
+ int count = 0;
+ while( BaflUtils::FileExists( iFs, *newFileName ) )
+ {
+ newFileName->Des().Copy( aFileName.Left( aFileName.LocateReverse('\\') ) );
+ newFileName->Des().Copy( aFileName.Left( dotPos ) );
+ newFileName->Des().Append( _L("_") );
+ newFileName->Des().AppendNum( count++ );
+ newFileName->Des().Append( aFileName.Right( aFileName.Length() - dotPos ) );
}
- else {
- wantedSize = aSize;
- }
-
- //wantedSize = wantedSize == 0 ? wantedSize -1 : wantedSize;
-
- VCXLOGLO2("CVcxTestVideoCreator:: Wanted file size: %Ld", wantedSize);
+ }
+
+ VCXLOGLO2("CVcxTestVideoCreator:: aSize = %d", aSize);
+
+ TInt64 wantedSize( 0 );
+
+ // Check the size
+ if( aSize == KVcxTestLargeFile3GB ) {
+ wantedSize = 1024*1024*1024 * 3;
+ }
+ else {
+ wantedSize = aSize;
+ }
+
+ //wantedSize = wantedSize == 0 ? wantedSize -1 : wantedSize;
+
+ VCXLOGLO2("CVcxTestVideoCreator:: Wanted file size: %Ld", wantedSize);
- // Read source file into memory, won't work on huge files.
- RFile64 srcFile;
- VCXLOGLO2("CVcxTestVideoCreator:: Opening %S", &srcFileName);
- User::LeaveIfError( srcFile.Open( iFs, srcFileName, EFileRead ) );
- CleanupClosePushL( srcFile );
+ // Read source file into memory, won't work on huge files.
+ RFile64 srcFile;
+ VCXLOGLO2("CVcxTestVideoCreator:: Opening %S", &srcFileName);
+ User::LeaveIfError( srcFile.Open( iFs, srcFileName, EFileRead ) );
+ CleanupClosePushL( srcFile );
+
+ TInt64 srcSize(0);
+ VCXLOGLO2("CVcxTestVideoCreator:: Getting size of %S", &srcFileName);
+ User::LeaveIfError( srcFile.Size( srcSize ) );
- TInt64 srcSize(0);
- VCXLOGLO2("CVcxTestVideoCreator:: Getting size of %S", &srcFileName);
- User::LeaveIfError( srcFile.Size( srcSize ) );
+ HBufC8* data = HBufC8::NewL( srcSize );
+ TPtr8 ptr( data->Des() );
+ srcFile.Read( ptr, srcSize );
+ CleanupStack::PopAndDestroy( &srcFile );
- HBufC8* data = HBufC8::NewL( srcSize );
- TPtr8 ptr( data->Des() );
- srcFile.Read( ptr, srcSize );
- CleanupStack::PopAndDestroy( &srcFile );
+ CleanupStack::PushL( data );
+
+ // Write new file.
+ RFile64 dstFile;
+ VCXLOGLO1("CVcxTestVideoCreator:: Replace");
+ User::LeaveIfError( dstFile.Replace( iFs, *newFileName, EFileWrite ) );
+ CleanupClosePushL(dstFile);
- CleanupStack::PushL( data );
+ if( wantedSize <= srcSize )
+ {
+ if( wantedSize == -1 )
+ {
+ VCXLOGLO2("CVcxTestVideoCreator:: Writing %Ld", srcSize);
+ User::LeaveIfError( dstFile.Write( *data, srcSize ) );
+ }
+ else
+ {
+ VCXLOGLO2("CVcxTestVideoCreator:: Writing %Ld", wantedSize);
+ User::LeaveIfError( dstFile.Write( *data, wantedSize ) );
+ }
+ }
+ else
+ {
+ VCXLOGLO2("CVcxTestVideoCreator:: Writing %Ld", srcSize);
+ User::LeaveIfError( dstFile.Write( *data, srcSize ) );
- // Write new file.
- RFile64 dstFile;
- VCXLOGLO1("CVcxTestVideoCreator:: Replace");
- User::LeaveIfError( dstFile.Replace( iFs, aFileName, EFileWrite ) );
- CleanupClosePushL(dstFile);
-
- if( wantedSize <= srcSize )
+ const TInt KVcxTest200Kilos = 1024*200;
+ HBufC8* buff = HBufC8::NewL( KVcxTest200Kilos );
+ buff->Des().SetLength( KVcxTest200Kilos );
+ CleanupStack::PushL( buff );
+ TInt64 bytesToWrite = wantedSize - srcSize;
+ while( bytesToWrite > 0 )
{
- if( wantedSize == -1 )
+ if( bytesToWrite >= KVcxTest200Kilos )
{
- VCXLOGLO2("CVcxTestVideoCreator:: Writing %Ld", srcSize);
- User::LeaveIfError( dstFile.Write( *data, srcSize ) );
+ bytesToWrite -= KVcxTest200Kilos;
+ User::LeaveIfError( dstFile.Write( *buff ) );
}
else
{
- VCXLOGLO2("CVcxTestVideoCreator:: Writing %Ld", wantedSize);
- User::LeaveIfError( dstFile.Write( *data, wantedSize ) );
+ User::LeaveIfError( dstFile.Write( *buff, bytesToWrite ) );
+ bytesToWrite = 0;
}
}
- else
- {
- VCXLOGLO2("CVcxTestVideoCreator:: Writing %Ld", srcSize);
- User::LeaveIfError( dstFile.Write( *data, srcSize ) );
+ CleanupStack::PopAndDestroy( buff );
+ }
- const TInt KVcxTest200Kilos = 1024*200;
- HBufC8* buff = HBufC8::NewL( KVcxTest200Kilos );
- buff->Des().SetLength( KVcxTest200Kilos );
- CleanupStack::PushL( buff );
- TInt64 bytesToWrite = wantedSize - srcSize;
- while( bytesToWrite > 0 )
- {
- if( bytesToWrite >= KVcxTest200Kilos )
- {
- bytesToWrite -= KVcxTest200Kilos;
- User::LeaveIfError( dstFile.Write( *buff ) );
- }
- else
- {
- User::LeaveIfError( dstFile.Write( *buff, bytesToWrite ) );
- bytesToWrite = 0;
- }
- }
- CleanupStack::PopAndDestroy( buff );
- }
+ CleanupStack::PopAndDestroy( &dstFile );
+ CleanupStack::PopAndDestroy( data );
+
+ CleanupStack::PopAndDestroy( newFileName );
- CleanupStack::PopAndDestroy( &dstFile );
- CleanupStack::PopAndDestroy( data );
-
- VCXLOGLO1("<<<CVcxTestVideoCreator::CreateVideoL");
+ VCXLOGLO1("<<<CVcxTestVideoCreator::CreateVideoL");
}
--- a/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/src/VCXTestMdsDbModifier.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/src/VCXTestMdsDbModifier.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -2,7 +2,7 @@
* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
+* under the terms of the License "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
--- a/videocollection/tsrc/stubs/inc/hbaction.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/tsrc/stubs/inc/hbaction.h Thu Jul 22 16:34:17 2010 +0100
@@ -26,13 +26,8 @@
#include "hbicon.h"
#include "hbmenu.h"
-class XQServiceUtil
-{
-public:
- static void toBackground(bool value);
- static bool isEmbedded();
- static bool isService();
-};
+#include "xqserviceutilstub.h"
+#include "xqserviceproviderstub.h"
class HbAction : public QAction
{
--- a/videocollection/tsrc/stubs/inc/hbdialog.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/tsrc/stubs/inc/hbdialog.h Thu Jul 22 16:34:17 2010 +0100
@@ -174,6 +174,12 @@
* if true, secondaryAction() -method returns null
*/
static bool secondaryReturnNull;
+
+ /**
+ * the amount how many times the open has been called.
+ */
+ static int openAmount;
+
};
#endif
--- a/videocollection/tsrc/stubs/inc/hbinputdialog.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/tsrc/stubs/inc/hbinputdialog.h Thu Jul 22 16:34:17 2010 +0100
@@ -20,6 +20,8 @@
#define HBINPUT_DIALOG_H
#include "hbwidget.h"
+#include "hbaction.h"
+#include <qvariant.h>
#include <qgraphicsitem.h>
class HbInputDialog : public HbWidget
@@ -27,20 +29,58 @@
Q_OBJECT
public:
- HbInputDialog(QGraphicsItem *parent= 0) : HbWidget(parent) {}
- ~HbInputDialog() {}
+ HbInputDialog(QGraphicsItem *parent= 0);
+ ~HbInputDialog();
/**
- * Returns string in parameter text if mGetTextReturnValue is null QString.
+ * Create new HbMessageBox and call emitDialogFinished after this one to finish the sequence.
+ */
+ void open( QObject* receiver = 0, const char* member = 0 );
+
+ /**
+ * Create new HbInputDialog after call to this and call emitDialogFinished to finish the sequence.
*/
- static QString getText(const QString &label,const QString &text = QString(),
- bool *ok = 0, QGraphicsScene *scene = 0, QGraphicsItem *parent = 0);
+ void getText(const QString &heading
+ ,QObject *receiver
+ ,const char *member
+ ,const QString &text=QString()
+ ,QGraphicsScene *scene=0
+ ,QGraphicsItem *parent=0);
+
+ void emitDialogFinished( QObject* receiver, const char* member, int actionNum );
+
+ void setAttribute(int attribute);
+
+ void setPromptText(const QString &text, int row = 0);
+
+ void setValue(const QVariant &value, int row = 0);
- static bool mGetTextFails;
+ QList<HbAction*> actions() const
+ {
+ return mActions;
+ }
+
+ QVariant value(int row = 0) { Q_UNUSED(row); mValueCallCount++; return mValueReturnValue; }
+
+signals:
+
+ void finished(HbAction *action);
- static QString mGetTextReturnValue;
+public:
+
+ QList<HbAction*> mActions;
+
+ QList<QString> mSetPromptTexts;
+ QList<QVariant> mSetValues;
+ static QString mLastHeading;
+ static QString mLastText;
static int mGetTextCallCount;
+ static int mAttribute;
+ static int mOpenCallCount;
+
+ static QVariant mValueReturnValue;
+ static int mValueCallCount;
};
#endif //HBINPUT_DIALOG_H
--- a/videocollection/tsrc/stubs/inc/hblistview.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/tsrc/stubs/inc/hblistview.h Thu Jul 22 16:34:17 2010 +0100
@@ -275,6 +275,12 @@
Q_UNUSED(position);
return mItem;
}
+
+ void setObjectName(const QString name)
+ {
+ Q_UNUSED(name);
+ }
+
public:
/**
--- a/videocollection/tsrc/stubs/inc/hbmessagebox.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/tsrc/stubs/inc/hbmessagebox.h Thu Jul 22 16:34:17 2010 +0100
@@ -19,22 +19,49 @@
#ifndef HBMESSAGEBOX_H
#define HBMESSAGEBOX_H
+#include <qobject.h>
#include <qstring.h>
+#include "hbaction.h"
class QGraphicsWidget;
class QGraphicsScene;
class QGraphicsItem;
-class HbMessageBox
+class HbMessageBox : public QObject
{
+ Q_OBJECT
+
public:
+ enum MessageBoxType {
+ MessageTypeInformation,
+ MessageTypeQuestion,
+ MessageTypeWarning
+ };
+
+ HbMessageBox(MessageBoxType type = MessageTypeInformation, QGraphicsItem *parent = 0);
+ HbMessageBox(const QString &text, MessageBoxType type = MessageTypeInformation, QGraphicsItem *parent = 0);
+ ~HbMessageBox();
+
+ /**
+ * Create new HbMessageBox and call emitDialogFinished after this one to finish the sequence.
+ */
+ void open( QObject* receiver = 0, const char* member = 0 );
+
+ void emitDialogFinished( QObject* receiver, const char* member, int actionNum );
+
+ void show();
+
+ void setAttribute(int attribute);
+
/** stubbed from HbMessgeBox */
- static bool question(const QString &questionText,
- const QString &primaryButtonText = QString(),
- const QString &secondaryButtonText = QString(),
- QGraphicsWidget *headWidget = 0,
- QGraphicsScene *scene = 0,
- QGraphicsItem *parent = 0);
+/* static void question(const QString &questionText,
+ QObject *receiver,
+ const char *member,
+ const QString &primaryButtonText = tr("Yes"),
+ const QString &secondaryButtonText = tr("No"),
+ QGraphicsWidget *headWidget = 0,
+ QGraphicsScene *scene = 0,
+ QGraphicsItem *parent = 0 );*/
/** stubbed from HbMessgeBox */
static void information(const QString &informationText,
@@ -47,8 +74,20 @@
QGraphicsWidget *headWidget = 0,
QGraphicsScene *scene = 0,
QGraphicsItem *parent = 0 );
+
+ QList<HbAction*> actions() const
+ {
+ return mActions;
+ }
+
+signals:
+
+ void finished(HbAction *action);
+
+public:
+
+ QList<HbAction*> mActions;
+
};
-
-
#endif // HBMESSAGEBOX_H
--- a/videocollection/tsrc/stubs/inc/hbmessageboxdata.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/tsrc/stubs/inc/hbmessageboxdata.h Thu Jul 22 16:34:17 2010 +0100
@@ -28,6 +28,10 @@
mLatestTxt = "";
mWarningCallCount = 0;
mInformationCallCount = 0;
+ mType = -1;
+ mAttribute = -1;
+ mOpenCallCount = 0;
+ mShowCallCount = 0;
}
public: // data
@@ -35,8 +39,10 @@
static QString mLatestTxt;
static int mWarningCallCount;
static int mInformationCallCount;
+ static int mType;
+ static int mAttribute;
+ static int mOpenCallCount;
+ static int mShowCallCount;
};
-
-
#endif // HBMESSAGEBOXDATA_H_
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/stubs/inc/testobjectstore.h Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef TESTOBJECTSTORE_H
+#define TESTOBJECTSTORE_H
+
+#include <qobject.h>
+#include <qpointer.h>
+#include <qlist.h>
+
+class TestObjectStore : public QObject
+{
+ Q_OBJECT
+
+public:
+
+ static TestObjectStore &instance();
+
+ void addObject(QObject *object);
+
+private slots:
+
+ void objectDestroyed(QObject *obj);
+
+private:
+
+ TestObjectStore();
+
+ ~TestObjectStore();
+
+ QList<QObject *> mObjects;
+
+};
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/stubs/inc/videoactivitystate.h Thu Jul 22 16:34:17 2010 +0100
@@ -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: stub VideoActivityState class definition for collection view unite tests
+*
+*/
+
+// Version : %version: 1 %
+
+#ifndef __VIDEOACTIVITYSTATE_H__
+#define __VIDEOACTIVITYSTATE_H__
+
+#include <qhash.h>
+#include <qvariant.h>
+
+
+
+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__
--- a/videocollection/tsrc/stubs/inc/videocollectionviewutilsdata.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/tsrc/stubs/inc/videocollectionviewutilsdata.h Thu Jul 22 16:34:17 2010 +0100
@@ -20,6 +20,7 @@
#include <qnamespace.h>
#include <qvariant.h>
+#include "videocollectioncommon.h"
class VideoCollectionViewUtilsData
{
@@ -36,6 +37,9 @@
mIconString = "";
mPressedString = "";
mLastStatusAdditional = QVariant();
+ mWidgetLevel = VideoCollectionCommon::ELevelVideos;
+ mActivityCollectionId = TMPXItemId::InvalidId();
+ mActivityCollectionName = "";
}
public: // data
@@ -49,6 +53,9 @@
static QString mIconString;
static QString mPressedString;
static QVariant mLastStatusAdditional;
+ static VideoCollectionCommon::TCollectionLevels mWidgetLevel;
+ static TMPXItemId mActivityCollectionId;
+ static QString mActivityCollectionName;
};
#endif /* VIDEOCOLLECTIONVIEWUTILSDATA_H */
--- a/videocollection/tsrc/stubs/inc/videolistwidgetdata.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/tsrc/stubs/inc/videolistwidgetdata.h Thu Jul 22 16:34:17 2010 +0100
@@ -29,6 +29,7 @@
mActivateReturnValue = 0;
mActive = false;
mDeactivateCount = 0;
+ mEmitActivatedIndex = QModelIndex();
}
public: // data
@@ -38,6 +39,7 @@
static int mActivateReturnValue;
static bool mActive;
static int mDeactivateCount;
+ static QModelIndex mEmitActivatedIndex;
};
#endif /* VIDEOLISTWIDGETDATA_H */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/stubs/inc/videoservicebrowse.h Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,121 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: VideoServiceBrowse stub definition
+*
+*/
+
+// Version : %version: 1 %
+
+#ifndef VIDEOSERVICEBROWSE_H
+#define VIDEOSERVICEBROWSE_H
+
+//INCLUDES
+#include <qobject.h>
+#include "xqserviceproviderstub.h"
+
+// FORWARD DECLARATIONS
+class VideoServices;
+class QLatin1String;
+
+class VideoServiceBrowse : public XQServiceProvider
+{
+ Q_OBJECT
+
+public:
+ VideoServiceBrowse( VideoServices *parent, QLatin1String service );
+ ~VideoServiceBrowse();
+
+public:
+
+ /**
+ * Complete pending service request
+ *
+ * @param None
+ * @return None
+ */
+ void complete();
+
+ /**
+ * Get current browsing category
+ *
+ * @param None
+ * @return VideoServices::TVideoCategory
+ */
+ int getBrowseCategory() const;
+
+ /**
+ * Return context title of videos application
+ *
+ * @param None
+ * @return QString
+ */
+ QString contextTitle() const;
+
+ /**
+ * Return sort role.
+ *
+ * @param None.
+ * @return int.
+ */
+ int sortRole() const;
+
+ /**
+ * Returns service active status
+ *
+ * @return bool true if active, false if not active
+ *
+ */
+ bool isActive();
+
+public slots:
+
+ /**
+ * Browse video
+ *
+ * @param title, Title of the embedded Videos application
+ * @param category, Category which type of videos are browsed
+ * @param sort, Sort type.
+ * @return None
+ */
+ void browseVideos(const QString &title, int category, int sortRole);
+
+ /**
+ * Browse video
+ *
+ * @param category, Category which type of videos are browsed
+ * @param sort, Sort type.
+ * @return None
+ */
+ void browseVideos(int category, int sortRole);
+
+private:
+
+ /** request index of the service */
+ int mRequestIndex;
+
+ /** reference to VideoServices instance */
+ VideoServices *mServiceApp;
+
+ /** current browsing category */
+ int mCategory;
+
+ /** title of the service client, if not set "Videos" is used */
+ QString mTitle;
+
+ /** sorting role */
+ int mSortRole;
+
+};
+
+#endif//VIDEOSERVICEBROWSE_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/stubs/inc/videoserviceurifetch.h Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,111 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: VideoServiceUriFetch stub definition
+*
+*/
+
+#ifndef __VIDEOSERVICESURIFETCH_H__
+#define __VIDEOSERVICESURIFETCH_H__
+
+//INCLUDES
+#include "xqserviceproviderstub.h"
+#include <QStringList>
+
+// FORWARD DECLARATIONS
+class VideoServices;
+class QLatin1String;
+
+class VideoServiceUriFetch : public XQServiceProvider
+{
+
+ /**
+ * define to be able to use signals and slots
+ */
+ Q_OBJECT
+
+public:
+
+ /**
+ * contructor
+ */
+ VideoServiceUriFetch( VideoServices *parent, QLatin1String service );
+
+ /**
+ * destructor
+ */
+ ~VideoServiceUriFetch();
+
+ /**
+ * Returns service active status
+ *
+ * @return bool true if active, false if not active
+ *
+ */
+ bool isActive();
+
+ /**
+ * Completes the service
+ *
+ * @param fileList list of file URIs
+ *
+ */
+ void complete(QStringList filesList);
+
+ /**
+ * Returns the context title set by service requestee
+ *
+ * @return QString the title
+ *
+ */
+ QString contextTitle() const;
+
+public slots: // for QTHighway to notify provider about request
+ /*
+ * Client can use this method launch video URI fetching
+ *
+ */
+ void fetch();
+
+ /*
+ * Client can use this method launch video URI fetching
+ *
+ * @param title title to be set
+ *
+ */
+ void fetch(const QString& title);
+
+public slots: // for provider to notify client
+ void fetchFailed( int errorCode );
+
+private:
+ void doComplete( QStringList filesList);
+
+private:
+ /*
+ * The request index
+ */
+ int mRequestIndex;
+
+ /*
+ * Pointer to owning VideoServices
+ */
+ VideoServices* mServiceApp;
+
+ /*
+ * The title requested by the service user
+ */
+ QString mTitle;
+};
+
+#endif //__VIDEOSERVICESURIFETCH_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/stubs/inc/xqserviceproviderstub.h Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: stub
+*
+*/
+
+#ifndef XQSERVICEABSTRACTSERVICESTUB_H
+#define XQSERVICEABSTRACTSERVICESTUB_H
+
+#define XQ_EXPORT_PLUGIN2(x,y)
+
+#include <qobject.h>
+#include <qstring.h>
+#include <QVariant>
+
+class XQServiceProvider : public QObject
+{
+ Q_OBJECT
+
+public:
+ XQServiceProvider( const QString& service, QObject *parent = 0 );
+ ~XQServiceProvider();
+
+ // void SetPlugin(QObject* impl_plugin);
+
+//Q_SIGNALS:
+ //void returnValueDelivered() ;
+ //void clientDisconnected() ;
+
+private:
+};
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/stubs/inc/xqserviceutilstub.h Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: stub
+*
+*/
+
+#ifndef XQSERVICEUTILSTUB_H
+#define XQSERVICEUTILSTUB_H
+
+#include <QObject>
+#include <QString>
+
+class XQServiceUtil
+{
+public:
+ static void toBackground(bool value);
+ static bool isEmbedded();
+ static bool isService();
+
+ static QString interfaceName();
+ static QString operationName();
+};
+
+#endif
--- a/videocollection/tsrc/stubs/src/hbdialog.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/tsrc/stubs/src/hbdialog.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -24,6 +24,7 @@
bool HbDialog::execReturnPrimary = true;
bool HbDialog::primaryReturnNull = false;
bool HbDialog::secondaryReturnNull = false;
+int HbDialog::openAmount = 0;
HbDialog::HbDialog(QGraphicsItem *parent) :
HbWidget(parent),
@@ -50,6 +51,7 @@
void HbDialog::open( QObject* receiver, const char* member)
{
+ openAmount++;
if(receiver && member)
{
connect(this, SIGNAL(finished(HbAction*)), receiver, SLOT(member));
--- a/videocollection/tsrc/stubs/src/hbdocumentloader.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/tsrc/stubs/src/hbdocumentloader.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -309,5 +309,9 @@
{
obj = new HbStackedWidget();
}
+ else if(name == DOCML_NAME_LBL_MARKALL)
+ {
+ obj = new HbLabel();
+ }
return obj;
}
--- a/videocollection/tsrc/stubs/src/hbinputdialog.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/tsrc/stubs/src/hbinputdialog.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -16,37 +16,88 @@
*/
#include "hbinputdialog.h"
+#include "testobjectstore.h"
-bool HbInputDialog::mGetTextFails = false;
-QString HbInputDialog::mGetTextReturnValue = QString();
int HbInputDialog::mGetTextCallCount = 0;
-
+int HbInputDialog::mAttribute = -1;
+QString HbInputDialog::mLastHeading = "";
+QString HbInputDialog::mLastText = "";
+QVariant HbInputDialog::mValueReturnValue = QVariant();
+int HbInputDialog::mValueCallCount = 0;
+int HbInputDialog::mOpenCallCount = 0;
-QString HbInputDialog::getText(const QString &label,const QString &text,
- bool *ok, QGraphicsScene *scene, QGraphicsItem *parent)
+HbInputDialog::HbInputDialog(QGraphicsItem *parent) : HbWidget(parent)
{
- Q_UNUSED(label);
- Q_UNUSED(scene);
- Q_UNUSED(parent);
- mGetTextCallCount++;
- QString textReturn;
- if(HbInputDialog::mGetTextReturnValue.isNull())
- {
- textReturn = text;
- }
- else
- {
- textReturn = mGetTextReturnValue;
- }
- if(mGetTextFails)
- {
- *ok = false;
- textReturn = "";
- }
- else
- {
- *ok = true;
- }
- return textReturn;
+ HbAction *action = new HbAction();
+ mActions.append(action);
+ action = new HbAction();
+ mActions.append(action);
+
+ TestObjectStore::instance().addObject(this);
+}
+
+HbInputDialog::~HbInputDialog()
+{
+ while(!mActions.isEmpty())
+ {
+ delete mActions.takeFirst();
+ }
+}
+
+void HbInputDialog::open( QObject* receiver, const char* member )
+{
+ Q_UNUSED(receiver);
+ Q_UNUSED(member);
+
+ mOpenCallCount++;
}
+void HbInputDialog::getText(const QString &heading
+ ,QObject *receiver
+ ,const char *member
+ ,const QString &text
+ ,QGraphicsScene *scene
+ ,QGraphicsItem *parent)
+{
+ Q_UNUSED(receiver);
+ Q_UNUSED(member);
+ Q_UNUSED(scene);
+ Q_UNUSED(parent);
+
+ mLastHeading = heading;
+ mLastText = text;
+ mGetTextCallCount++;
+}
+
+void HbInputDialog::emitDialogFinished( QObject* receiver, const char* member, int actionNum )
+{
+ if(connect(this, SIGNAL(finished(HbAction *)), receiver, member))
+ {
+ emit finished(mActions.value(actionNum));
+ disconnect(this, SIGNAL(finished(HbAction *)), receiver, member);
+ }
+}
+
+void HbInputDialog::setAttribute(int attribute)
+{
+ HbInputDialog::mAttribute = attribute;
+}
+
+void HbInputDialog::setPromptText(const QString &text, int row)
+{
+ while(mSetPromptTexts.count() < row+1)
+ {
+ mSetPromptTexts.append("");
+ }
+ mSetPromptTexts[row] = text;
+}
+
+void HbInputDialog::setValue(const QVariant &value, int row)
+{
+ while(mSetValues.count() < row+1)
+ {
+ mSetValues.append("");
+ }
+ mSetValues[row] = value;
+}
+
--- a/videocollection/tsrc/stubs/src/hbmessagebox.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/tsrc/stubs/src/hbmessagebox.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -19,27 +19,71 @@
#include "hbmessagebox.h"
#include "hbmessageboxdata.h"
+#include "testobjectstore.h"
bool HbMessageBoxData::mQuestionReturnValue = false;
QString HbMessageBoxData::mLatestTxt = "";
int HbMessageBoxData::mWarningCallCount = 0;
int HbMessageBoxData::mInformationCallCount = 0;
+int HbMessageBoxData::mType = -1;
+int HbMessageBoxData::mAttribute = -1;
+int HbMessageBoxData::mOpenCallCount = 0;
+int HbMessageBoxData::mShowCallCount = 0;
-bool HbMessageBox::question(const QString &questionText,
- const QString &primaryButtonText,
- const QString &secondaryButtonText,
- QGraphicsWidget *headWidget,
- QGraphicsScene *scene,
- QGraphicsItem *parent)
+HbMessageBox::HbMessageBox(MessageBoxType type, QGraphicsItem *parent)
+{
+ Q_UNUSED(parent);
+ HbMessageBoxData::mType = type;
+
+ HbAction *action = new HbAction();
+ mActions.append(action);
+ action = new HbAction();
+ mActions.append(action);
+
+ TestObjectStore::instance().addObject(this);
+}
+
+HbMessageBox::HbMessageBox(const QString &text, MessageBoxType type, QGraphicsItem *parent)
{
- Q_UNUSED(primaryButtonText);
- Q_UNUSED(secondaryButtonText);
- Q_UNUSED(headWidget);
- Q_UNUSED(scene);
Q_UNUSED(parent);
+ HbMessageBoxData::mLatestTxt = text;
+ HbMessageBoxData::mType = type;
- HbMessageBoxData::mLatestTxt = questionText;
- return HbMessageBoxData::mQuestionReturnValue;
+ HbAction *action = new HbAction();
+ mActions.append(action);
+ action = new HbAction();
+ mActions.append(action);
+
+ TestObjectStore::instance().addObject(this);
+}
+
+HbMessageBox::~HbMessageBox()
+{
+ while(!mActions.isEmpty())
+ {
+ delete mActions.takeFirst();
+ }
+}
+
+void HbMessageBox::show()
+{
+ HbMessageBoxData::mShowCallCount++;
+}
+
+void HbMessageBox::open( QObject* receiver, const char* member )
+{
+ Q_UNUSED(receiver);
+ Q_UNUSED(member);
+ HbMessageBoxData::mOpenCallCount++;
+}
+
+void HbMessageBox::emitDialogFinished( QObject* receiver, const char* member, int actionNum )
+{
+ if(connect(this, SIGNAL(finished(HbAction *)), receiver, member))
+ {
+ emit finished(mActions.value(actionNum));
+ disconnect(this, SIGNAL(finished(HbAction *)), receiver, member);
+ }
}
void HbMessageBox::information(const QString &informationText,
@@ -68,4 +112,9 @@
HbMessageBoxData::mWarningCallCount++;
}
+void HbMessageBox::setAttribute(int attribute)
+{
+ HbMessageBoxData::mAttribute = attribute;
+}
+
// end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/stubs/src/testobjectstore.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "testobjectstore.h"
+
+TestObjectStore::TestObjectStore()
+{
+
+}
+
+TestObjectStore::~TestObjectStore()
+{
+ while(!mObjects.isEmpty())
+ {
+ QObject *obj = mObjects.takeFirst();
+ delete obj;
+ }
+}
+
+TestObjectStore &TestObjectStore::instance()
+{
+ static TestObjectStore _store;
+ return _store;
+}
+
+void TestObjectStore::addObject(QObject *object)
+{
+ if(connect(object, SIGNAL(destroyed(QObject *)), this, SLOT(objectDestroyed(QObject *))))
+ {
+ mObjects.append(object);
+ }
+}
+
+void TestObjectStore::objectDestroyed(QObject *obj)
+{
+ if(obj)
+ {
+ disconnect(obj, SIGNAL(destroyed(QObject *)), this, SLOT(objectDestroyed(QObject *)));
+ mObjects.removeOne(obj);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/stubs/src/videoactivitystate.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -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
--- a/videocollection/tsrc/stubs/src/videocollectionuiloader.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/tsrc/stubs/src/videocollectionuiloader.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -97,8 +97,9 @@
storeOrphans(list);
}
-QGraphicsWidget* VideoCollectionUiLoader::doFindWidget(const QString &name)
+QGraphicsWidget* VideoCollectionUiLoader::doFindWidget(const QString &name, bool loadIfNotFound)
{
+ Q_UNUSED(loadIfNotFound);
QGraphicsWidget *widget = 0;
if(VideoCollectionUiLoaderData::mFindFailure)
{
@@ -111,8 +112,9 @@
return widget;
}
-QObject* VideoCollectionUiLoader::doFindObject(const QString &name)
+QObject* VideoCollectionUiLoader::doFindObject(const QString &name, bool loadIfNotFound)
{
+ Q_UNUSED(loadIfNotFound);
QObject *object = 0;
if(VideoCollectionUiLoaderData::mFindFailure)
{
@@ -142,7 +144,17 @@
}
VideoListWidget *videoList = qobject_cast<VideoListWidget*>(object);
VideoSortFilterProxyModel *model = wrapper.getModel(type);
- videoList->initialize(*model, 0);
+
+ VideoCollectionCommon::TCollectionLevels level = VideoCollectionCommon::ELevelInvalid;
+ if(name == DOCML_NAME_VC_VIDEOLISTWIDGET )
+ {
+ level = VideoCollectionCommon::ELevelVideos;
+ }
+ else if(name == DOCML_NAME_VC_COLLECTIONWIDGET)
+ {
+ level = VideoCollectionCommon::ELevelCategory;
+ }
+ videoList->initialize(*model, 0, level);
}
else if (name == DOCML_NAME_DIALOG)
{
@@ -199,7 +211,7 @@
QObject* VideoCollectionUiLoader::createObject(const QString& type,
const QString &name)
{
- QObject* object = doFindObject(name);
+ QObject* object = doFindObject(name, true);
if (!object)
{
if (name == DOCML_NAME_VIEW)
--- a/videocollection/tsrc/stubs/src/videocollectionviewutils.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/tsrc/stubs/src/videocollectionviewutils.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -28,6 +28,9 @@
QString VideoCollectionViewUtilsData::mIconString = "";
QString VideoCollectionViewUtilsData::mPressedString = "";
QVariant VideoCollectionViewUtilsData::mLastStatusAdditional = QVariant();
+VideoCollectionCommon::TCollectionLevels VideoCollectionViewUtilsData::mWidgetLevel = VideoCollectionCommon::ELevelVideos;
+TMPXItemId VideoCollectionViewUtilsData::mActivityCollectionId = TMPXItemId::InvalidId();
+QString VideoCollectionViewUtilsData::mActivityCollectionName = "";
VideoCollectionViewUtils& VideoCollectionViewUtils::instance()
{
@@ -124,6 +127,29 @@
// not stubbed
}
+void VideoCollectionViewUtils::setWidgetActivityLevel(const VideoCollectionCommon::TCollectionLevels &level)
+{
+ VideoCollectionViewUtilsData::mWidgetLevel = level;
+}
+
+void VideoCollectionViewUtils::getActivityWidgetLevel(VideoCollectionCommon::TCollectionLevels &level)
+{
+ level = VideoCollectionViewUtilsData::mWidgetLevel;
+}
+
+void VideoCollectionViewUtils::setCollectionActivityData(const TMPXItemId &id, const QString &name)
+{
+ VideoCollectionViewUtilsData::mActivityCollectionId = id;
+ VideoCollectionViewUtilsData::mActivityCollectionName = name;
+}
+
+void VideoCollectionViewUtils::getCollectionActivityData(TMPXItemId &id, QString &name)
+{
+ id = VideoCollectionViewUtilsData::mActivityCollectionId;
+ name = VideoCollectionViewUtilsData::mActivityCollectionName;
+}
+
+
void VideoCollectionViewUtils::sortModel(VideoSortFilterProxyModel *model,
bool async, VideoCollectionCommon::TCollectionLevels target)
{
--- a/videocollection/tsrc/stubs/src/videolistselectiondialog.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/tsrc/stubs/src/videolistselectiondialog.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -144,4 +144,16 @@
// not stubbed
}
+void VideoListSelectionDialog::newAlbumNameDialogFinished(HbAction *action)
+{
+ Q_UNUSED(action);
+ // not stubbed
+}
+
+void VideoListSelectionDialog::finalize(QString albumName)
+{
+ Q_UNUSED(albumName);
+ // not stubbed
+}
+
// end of file
--- a/videocollection/tsrc/stubs/src/videolistview.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/tsrc/stubs/src/videolistview.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -32,7 +32,6 @@
mUiUtils(VideoCollectionViewUtils::instance()),
mWrapper(VideoCollectionWrapper::instance()),
mUiLoader(uiLoader),
-mIsService(false),
mModelReady(false),
mVideoServices(0),
mCurrentList(0),
@@ -61,7 +60,7 @@
// not stubbed
}
-int VideoListView::activateView(const TMPXItemId &itemId)
+int VideoListView::activateView(TMPXItemId &itemId)
{
Q_UNUSED(itemId);
@@ -146,16 +145,6 @@
// not stubbed
}
-void VideoListView::openNewAlbumSlot(const QModelIndex &parent,
- int start,
- int end)
-{
- Q_UNUSED(parent);
- Q_UNUSED(start);
- Q_UNUSED(end);
- // not stubbed
-}
-
void VideoListView::openServicesViewSlot()
{
// not stubbed
@@ -216,11 +205,11 @@
void VideoListView::collectionOpenedSlot(bool collectionOpened,
const QString& collection,
- const QModelIndex &index)
+ const TMPXItemId &id)
{
Q_UNUSED(collectionOpened);
Q_UNUSED(collection);
- Q_UNUSED(index);
+ Q_UNUSED(id);
// not stubbed
}
--- a/videocollection/tsrc/stubs/src/videolistwidget.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/tsrc/stubs/src/videolistwidget.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -25,6 +25,7 @@
int VideoListWidgetData::mActivateReturnValue = 0;
bool VideoListWidgetData::mActive = false;
int VideoListWidgetData::mDeactivateCount = 0;
+QModelIndex VideoListWidgetData::mEmitActivatedIndex = QModelIndex();
VideoListWidget::VideoListWidget(VideoCollectionUiLoader* uiLoader, HbView *parent):
HbListView(parent),
@@ -32,7 +33,6 @@
mVideoServices(0),
mCurrentLevel(VideoCollectionCommon::ELevelInvalid),
mSignalsConnected(false),
- mIsService(false),
mNavKeyAction(0),
mContextMenu(0),
mSelectionMode(HbAbstractItemView::NoSelection),
@@ -48,13 +48,13 @@
}
int VideoListWidget::initialize(VideoSortFilterProxyModel &model,
- VideoServices *videoServices)
+ bool isService, VideoCollectionCommon::TCollectionLevels level)
{
- Q_UNUSED(videoServices);
+ Q_UNUSED(isService);
VideoListWidgetData::mInitializeCount++;
mModel = &model;
-
+ mCurrentLevel = level;
return VideoListWidgetData::mInitializeReturnValue;
}
@@ -109,15 +109,14 @@
return mCurrentLevel;
}
-VideoSortFilterProxyModel& VideoListWidget::getModel()
+VideoSortFilterProxyModel* VideoListWidget::getModel()
{
- return *mModel;
+ return mModel;
}
void VideoListWidget::emitActivated (const QModelIndex &modelIndex)
{
- Q_UNUSED(modelIndex);
- // not stubbed
+ VideoListWidgetData::mEmitActivatedIndex = modelIndex;
}
void VideoListWidget::setSelectionMode(int mode)
@@ -133,12 +132,6 @@
// not stubbed
}
-void VideoListWidget::panGesture (const QPointF &point)
-{
- Q_UNUSED(point);
- // not stubbed
-}
-
void VideoListWidget::openItemSlot()
{
// not stubbed
@@ -184,6 +177,11 @@
// not stubbed
}
+void VideoListWidget::endVideoFecthingSlot()
+{
+ // not stubbed
+}
+
void VideoListWidget::scrollingStartedSlot()
{
// not stubbed
@@ -215,4 +213,22 @@
// not stubbed
}
+void VideoListWidget::renameDialogFinished(HbAction *action)
+{
+ Q_UNUSED(action);
+ // not stubbed
+}
+
+void VideoListWidget::deleteItemDialogFinished(HbAction *action)
+{
+ Q_UNUSED(action);
+ // not stubbed
+}
+
+void VideoListWidget::removeCollectionDialogFinished(HbAction *action)
+{
+ Q_UNUSED(action);
+ // not stubbed
+}
+
// end of file
--- a/videocollection/tsrc/stubs/src/videoservicebrowse.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/tsrc/stubs/src/videoservicebrowse.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,10 +15,11 @@
*
*/
-// Version : %version: 3 %
+// Version : %version: 6 %
#include <hbapplication.h>
+#include "xqserviceproviderstub.h"
#include "videoservices.h"
#include "videoservicebrowse.h"
#include "mpxhbvideocommondefs.h"
@@ -30,8 +31,8 @@
Constructor.
\param parent, Pointer to the video services.
*/
-VideoServiceBrowse::VideoServiceBrowse(VideoServices* parent)
- : XQServiceProvider( "TestListView" )
+VideoServiceBrowse::VideoServiceBrowse(VideoServices* parent, QLatin1String service)
+ : XQServiceProvider( service, parent )
, mRequestIndex( 0 )
, mServiceApp( parent )
{
@@ -94,4 +95,18 @@
// not stubbed
}
+/*!
+ Browse videos.
+ \param category, Category which type of videos are browsed.
+ \return None.
+*/
+void VideoServiceBrowse::browseVideos(int category,
+ int sortRole)
+{
+ Q_UNUSED(category);
+ Q_UNUSED(sortRole);
+
+ // not stubbed
+}
+
// End of file
--- a/videocollection/tsrc/stubs/src/videoservices.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/tsrc/stubs/src/videoservices.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -70,8 +70,8 @@
mCurrentService(VideoServices::ENoService),
mSortRole(0)
{
- mServiceUriFetch = new VideoServiceUriFetch(this);
- mServiceBrowse = new VideoServiceBrowse(this);
+ mServiceUriFetch = new VideoServiceUriFetch(this, QLatin1String("TestListView"));
+ mServiceBrowse = new VideoServiceBrowse(this, QLatin1String("TestListView"));
}
VideoServices::~VideoServices()
--- a/videocollection/tsrc/stubs/src/videoserviceurifetch.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/tsrc/stubs/src/videoserviceurifetch.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,11 +15,12 @@
*
*/
+#include "xqserviceproviderstub.h"
#include "videoserviceurifetch.h"
#include "videoservices.h"
-VideoServiceUriFetch::VideoServiceUriFetch(VideoServices* parent):
- XQServiceProvider("TestListView"),
+VideoServiceUriFetch::VideoServiceUriFetch(VideoServices* parent, QLatin1String service):
+ XQServiceProvider( service, parent ),
mRequestIndex(0),
mServiceApp(parent)
{
@@ -61,6 +62,11 @@
return QString();
}
+void VideoServiceUriFetch::fetch()
+{
+ mServiceApp->setCurrentService(VideoServices::EUriFetcher);
+}
+
void VideoServiceUriFetch::fetch(const QString& title)
{
Q_UNUSED(title);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/stubs/src/xqserviceprovider.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: Stub for xqserviceprovider
+ *
+ */
+
+#include "xqserviceproviderstub.h"
+
+XQServiceProvider::XQServiceProvider( const QString& service, QObject *parent )
+{
+ Q_UNUSED(service);
+ Q_UNUSED(parent);
+}
+
+XQServiceProvider::~XQServiceProvider()
+{
+
+}
+
--- a/videocollection/tsrc/stubs/src/xqserviceutil.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/tsrc/stubs/src/xqserviceutil.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,8 +15,9 @@
*
*/
-#include "hbaction.h"
+#include "xqserviceutilstub.h"
#include "xqserviceutilxtra.h"
+#include "videoservices.h"
void XQServiceUtil::toBackground(bool value)
{
@@ -37,4 +38,25 @@
return service;
}
+QString XQServiceUtil::interfaceName()
+{
+ VideoServices *videoServices = VideoServices::instance();
+ QString interfaceName;
+ if(videoServices->currentService() == VideoServices::EUriFetcher)
+ {
+ interfaceName = "IVideoFetch";
+ }
+ else if(videoServices->currentService() == VideoServices::EBrowse)
+ {
+ interfaceName = "IVideoBrowse";
+ }
+ videoServices->decreaseReferenceCount();
+ return interfaceName;
+}
+
+QString XQServiceUtil::operationName()
+{
+ return QString();
+}
+
// End of file
--- a/videocollection/tsrc/stubs/stubs.pro Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/tsrc/stubs/stubs.pro Thu Jul 22 16:34:17 2010 +0100
@@ -14,6 +14,8 @@
# Description:
#
+DEFINES += XQPLUGIN_H
+DEFINES += XQSERVICEABSTRACTSERVICE_H
DEFINES += XQSERVICEUTIL_H
CONFIG += qtestlib \
@@ -23,11 +25,16 @@
LIBS += -lestor.dll \
-lfbscli.dll \
-lbitgdi.dll \
+ -lmpxviewframeworkqt.dll \
-lxqplugins.dll \
- -lmpxviewframeworkqt.dll \
-lxqservice.dll
HEADERS_TEMP = \
+ inc/videoserviceurifetch.h \
+ inc/videoservicebrowse.h \
+ inc/xqserviceutilstub.h \
+ inc/xqserviceproviderstub.h \
+ inc/testobjectstore.h \
inc/hbabstractitemview.h \
inc/hbdocumentloader.h \
inc/hbaction.h \
@@ -69,6 +76,7 @@
inc/videoplayerappexport.h \
inc/videosortfilterproxymodeldata.h \
inc/videothumbnailtestdata.h \
+ inc/videoactivitystate.h \
inc/xqserviceutilxtra.h \
# We need stub for this because it has static data and HW compilation of moc file fails because of that.
inc/videoservices.h \
@@ -81,11 +89,11 @@
../../videocollectionwrapper/inc/videolistdatamodel.h \
../../videocollectionwrapper/inc/videocollectionwrapper.h \
../../videocollectionwrapper/inc/videosortfilterproxymodel.h \
- ../../videocollectionwrapper/inc/videothumbnaildata.h \
- ../../../videoplayerapp/videoplayerengine/inc/videoserviceurifetch.h \
- ../../../videoplayerapp/videoplayerengine/inc/videoservicebrowse.h
+ ../../videocollectionwrapper/inc/videothumbnaildata.h
SOURCES_TEMP = \
+ src/xqserviceprovider.cpp \
+ src/testobjectstore.cpp \
src/hbdocumentloader.cpp \
src/hbaction.cpp \
src/hbcheckbox.cpp \
@@ -119,7 +127,8 @@
src/videothumbnaildata.cpp \
src/videoservices.cpp \
src/videoserviceurifetch.cpp \
- src/videoservicebrowse.cpp
+ src/videoservicebrowse.cpp \
+ src/videoactivitystate.cpp
HEADERS += $$find(HEADERS_TEMP, ^(?!.*$$TESTEDCLASS).*$)
SOURCES += $$find(SOURCES_TEMP, ^(?!.*$$TESTEDCLASS).*$)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/videoservicestestapp/inc/videoservicestestappview.h Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef VIDEOSERVICESTESTAPPVIEW_H_
+#define VIDEOSERVICESTESTAPPVIEW_H_
+
+#include <hbview.h>
+#include <xqappmgr.h>
+
+class XQApplicationManager;
+class XQAiwRequest;
+class HbLineEdit;
+
+class VideoServicesTestAppView : public HbView
+{
+ Q_OBJECT
+
+public:
+ VideoServicesTestAppView(QGraphicsItem *parent=0);
+ virtual ~VideoServicesTestAppView();
+
+private slots:
+ void handleOk(const QVariant &result);
+ void handleError(int errorCode, const QString& errorMessage);
+
+ void fetchVideo();
+ void fetchVideoDeprecatedOldService();
+ void fetchVideoDeprecatedNewService();
+ void browseCapturedVideos();
+ void browseCapturedVideosDeprecatedOldService();
+ void browseCapturedVideosDeprecatedNewService();
+
+public slots:
+
+ void browseCapturedVideosFinished(HbAction *action);
+ void browseCapturedVideosDeprecatedOldServiceFinished(HbAction *action);
+ void browseCapturedVideosDeprecatedNewServiceFinished(HbAction *action);
+
+private:
+ void createLayout();
+
+private:
+ XQApplicationManager mAppMgr;
+ XQAiwRequest* mReq;
+ HbLineEdit* mResultEdit;
+ HbLineEdit* mErrorCodeEdit;
+ HbLineEdit* mErrorEdit;
+};
+
+#endif /* VIDEOSERVICESTESTAPPVIEW_H_ */
--- a/videocollection/tsrc/videoservicestestapp/rom/videoservicestestapp.iby Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/tsrc/videoservicestestapp/rom/videoservicestestapp.iby Thu Jul 22 16:34:17 2010 +0100
@@ -11,13 +11,13 @@
*
* Contributors:
*
-* Description: hbvideoplayer.iby
+* Description: videoservicetestapp.iby
*
*/
-#ifndef __HBVIDEOSERVICESTESTAPP_IBY__
-#define __HBVIDEOSERVICESTESTAPP_IBY__
+#ifndef __VIDEOSERVICESTESTAPP_IBY__
+#define __VIDEOSERVICESTESTAPP_IBY__
#include <bldvariant.hrh>
#include <data_caging_paths_for_iby.hrh>
@@ -27,4 +27,4 @@
data=DATAZ_/APP_RESOURCE_DIR/videoservicestestapp.rsc APP_RESOURCE_DIR/videoservicestestapp.rsc
-#endif // __HBVIDEOSERVICESTESTAPP_IBY__
+#endif // __VIDEOSERVICESTESTAPP_IBY__
Binary file videocollection/tsrc/videoservicestestapp/sis/Nokia_RnDCert_02.der has changed
--- a/videocollection/tsrc/videoservicestestapp/sis/Nokia_RnDCert_02.key Tue Jun 15 13:09:36 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIICXQIBAAKBgQC/TDP7KKIaf5+uW4OD2iVZuUMC2a+SeQTjf6srlKcOm+CpPNXn
-uLNm/8fdEnyOIuRXPRKmqhs1n0JkxEGHynELWMTuKXbQx9SRAGUXzyneGn+IJNnO
-vOKHWgKCouX2hfI8rtkdqJpqmO460gGsMgw+lsbeyWyW9lnfLxq+ZC7sqQIDAQAB
-AoGBALmUWZE8GBaQ3P4u9WUCSd3DJkkrmXIFSULSZeH/chlwCwDjbbhArHothVzo
-REE3hEFFlERvHbplZ+mNouzy7boduvgUzbksGrbGMLJ2qO1GzWWVwV+GzOWKd3ss
-/98Gwoy5R8pjnkqUE2wP1iJFw0FjvUTKcYv/z6t3LLJ0CsoBAkEA+c7ixvsviQ3J
-s0INytCKU2bf8fqFQJi1VI82ukxNsujGTQ9upVSjuvqPvWyDvvTdrUBHqO+3qPut
-sEh01Q8aiQJBAMQKDJPVRu4ud3mwUfEavzL5EjqwG1k9VCNGYsT4FwtrHcxu1oP/
-pk6M3rIZukqomoEEnHWPMwhrK3fhBqi0OSECQQDr40VXege4FnH5OI2Hj4afHMyp
-VdQQXGMWFyopnzXblFz0lXb43cTCIiorR9XcMqNFHybLypkWE5o+lRzlt55pAkBQ
-P/zeF5Sts//cpL0mgdh7OVKpC6ZmZaCnwAx2rUhhuDu+kDDoYCLoTOps5fNI1LRK
-1GRoC3LMo3Jr5IYhUYWBAkBpCpN6k4JU/mszq98EojHerQNxk8sPqvQKUzTutohT
-1gLX9yepGayB/TtT2EEJDkWOlnTy/dvN6W3vzbJYz97x
------END RSA PRIVATE KEY-----
Binary file videocollection/tsrc/videoservicestestapp/sis/videoservicestestapp.sisx has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/videoservicestestapp/src/main.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <hbapplication.h>
+#include <hbmainwindow.h>
+#include "videoservicestestappview.h"
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication::setOrganizationName("Nokia");
+ QCoreApplication::setApplicationName("VideoServicesTestApp");
+
+ HbApplication app(argc, argv);
+ HbMainWindow mainWindow( 0, Hb::WindowFlagTransparent );
+ mainWindow.setAttribute( Qt::WA_OpaquePaintEvent );
+ VideoServicesTestAppView *mainView = new VideoServicesTestAppView;
+ mainWindow.addView(mainView);
+ mainWindow.show();
+ return app.exec();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/videoservicestestapp/src/videoservicestestappview.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,521 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <xqaiwrequest.h>
+#include <QGraphicsLinearLayout>
+#include <hbpushbutton.h>
+#include <hblineedit.h>
+#include <hblabel.h>
+#include <hbaction.h>
+#include <hbinputdialog.h>
+#include <qdebug>
+#include <vcxmyvideosdefs.h>
+#include <xqaiwdecl.h>
+#include "videoservicestestappview.h"
+
+VideoServicesTestAppView::VideoServicesTestAppView(QGraphicsItem *parent) :
+ HbView(parent),
+ mReq(0),
+ mResultEdit(0),
+ mErrorCodeEdit(0),
+ mErrorEdit(0)
+{
+ qDebug() << "VideoServicesTestAppView::VideoServicesTestAppView";
+ createLayout();
+}
+
+
+VideoServicesTestAppView::~VideoServicesTestAppView()
+{
+ qDebug() << "VideoServicesTestAppView::~VideoServicesTestAppView";
+ delete mReq;
+}
+
+
+void VideoServicesTestAppView::handleOk(const QVariant &result)
+{
+ qDebug() << "VideoServicesTestAppView::handleOk";
+
+ if (!result.canConvert<QStringList>())
+ {
+ mErrorEdit->setText("Corrupt result");
+ }
+ else
+ {
+ QString text = result.value<QString>();
+ if (text.isEmpty())
+ {
+ text = "No result available in this service";
+ }
+ mResultEdit->setText(text);
+ qDebug() << "VideoServicesTestAppView::handleOk" << ": result=" << text;
+ }
+
+}
+
+
+void VideoServicesTestAppView::handleError(int errorCode, const QString& errorMessage)
+{
+ qDebug() << "VideoServicesTestAppView::handleError" << ": errorCode=" << errorCode << ", msg:" << errorMessage;
+ mErrorEdit->setText(errorMessage);
+ mErrorCodeEdit->setText(QString::number(errorCode));
+}
+
+
+void VideoServicesTestAppView::createLayout()
+{
+ qDebug() << "VideoServicesTestAppView::createLayout";
+
+ QGraphicsLinearLayout* layout = new QGraphicsLinearLayout(Qt::Vertical);
+
+ if (layout)
+ {
+ QGraphicsLinearLayout *topLayout = new QGraphicsLinearLayout(Qt::Vertical);
+
+ if (topLayout)
+ {
+ //topLayout->addStretch(5);
+
+ mResultEdit = new HbLineEdit;
+ HbLabel* label = new HbLabel("Result:");
+ if (mResultEdit && label)
+ {
+ topLayout->addItem(label);
+ mResultEdit->setMaxRows(5);
+ topLayout->addItem(mResultEdit);
+ }
+
+ mErrorCodeEdit = new HbLineEdit;
+ label = new HbLabel("Error code:");
+ if (mErrorCodeEdit && label)
+ {
+ topLayout->addItem(label);
+ topLayout->addItem(mErrorCodeEdit);
+ }
+
+ mErrorEdit = new HbLineEdit;
+ label = new HbLabel("Error description:");
+ if (mErrorEdit && label)
+ {
+ topLayout->addItem(label);
+ mErrorEdit->setMaxRows(5);
+ topLayout->addItem(mErrorEdit);
+ }
+
+ layout->addItem(topLayout);
+ //layout->setStretchFactor(topLayout, 5);
+ }
+
+ QGraphicsLinearLayout *bottomLayout = new QGraphicsLinearLayout(Qt::Vertical);
+
+ if (bottomLayout)
+ {
+ //bottomLayout->addStretch();
+/*
+ HbPushButton* button = new HbPushButton("Fetch video OLD IF OLD S");
+ if (button)
+ {
+ connect(button, SIGNAL(clicked()), this, SLOT(fetchVideoDeprecatedOldService()));
+ bottomLayout->addItem(button);
+ }
+*/
+ HbPushButton* button = new HbPushButton("Fetch video OLD IF NEW S");
+ if (button)
+ {
+ connect(button, SIGNAL(clicked()), this, SLOT(fetchVideoDeprecatedNewService()));
+ bottomLayout->addItem(button);
+ }
+
+ button = new HbPushButton("Fetch video NEW IF NEW S");
+ if (button)
+ {
+ connect(button, SIGNAL(clicked()), this, SLOT(fetchVideo()));
+ bottomLayout->addItem(button);
+ }
+
+/*
+ button = new HbPushButton("Browse \"Captured\" videos OLD IF OLD S");
+ if (button)
+ {
+ connect(button, SIGNAL(clicked()), this, SLOT(browseCapturedVideosDeprecatedOldService()));
+ bottomLayout->addItem(button);
+ }
+*/
+ button = new HbPushButton("Browse \"Captured\" videos OLD IF NEW S");
+ if (button)
+ {
+ connect(button, SIGNAL(clicked()), this, SLOT(browseCapturedVideosDeprecatedNewService()));
+ bottomLayout->addItem(button);
+ }
+
+
+ button = new HbPushButton("Browse \"Captured\" videos NEW IF");
+ if (button)
+ {
+ connect(button, SIGNAL(clicked()), this, SLOT(browseCapturedVideos()));
+ bottomLayout->addItem(button);
+ }
+
+ layout->addItem(bottomLayout);
+ }
+
+ setLayout(layout); // Takes ownership of layout
+ }
+}
+
+
+void VideoServicesTestAppView::fetchVideo()
+{
+ qDebug() << "VideoServicesTestAppView::fetchVideo START";
+
+ mResultEdit->setText("");
+ mErrorEdit->setText("");
+ mErrorCodeEdit->setText("");
+
+ delete mReq;
+ mReq = 0;
+ mReq = mAppMgr.create(XQI_VIDEO_FETCH, "fetch()", true);
+
+ qDebug() << "VideoServicesTestAppView::fetchVideo: mReq=" << mReq;
+
+ if (!mReq)
+ {
+ mErrorEdit->setText("Failed to create REQ");
+ return;
+ }
+ else
+ {
+ connect(mReq, SIGNAL(requestOk(const QVariant&)), SLOT(handleOk(const QVariant&)));
+ connect(mReq, SIGNAL(requestError(int,const QString&)), SLOT(handleError(int,const QString&)));
+ }
+
+ // Set arguments for request (application title)
+ XQRequestInfo info;
+ info.setInfo("WindowTitle", "<NEW IF app_name>");
+ mReq->setInfo(info);
+
+ // Make the request
+ if (!mReq->send())
+ {
+ mErrorEdit->setText("Failed to send REQ");
+ qDebug() << "VideoServicesTestAppView::fetchVideo: XQAiwRequest::send returned false";
+ }
+ // req no longer needed, remove it
+ delete mReq;
+ mReq = 0;
+
+ qDebug() << "VideoServicesTestAppView::fetchVideo END";
+}
+
+
+void VideoServicesTestAppView::browseCapturedVideos()
+{
+ qDebug() << "VideoServicesTestAppView::browseCapturedVideos START";
+
+ mResultEdit->setText("");
+ mErrorEdit->setText("");
+ mErrorCodeEdit->setText("");
+
+ delete mReq;
+ mReq = 0;
+
+ mReq = mAppMgr.create("com.nokia.symbian.IVideoBrowse", "browseVideos(int,int)", true);
+
+ qDebug() << "VideoServicesTestAppView::browseCapturedVideos: mReq=" << mReq;
+
+ if (!mReq)
+ {
+ mErrorEdit->setText("Failed to create REQ");
+ return;
+ }
+ else
+ {
+ connect(mReq, SIGNAL(requestOk(QVariant)), SLOT(handleOk(QVariant)));
+ connect(mReq, SIGNAL(requestError(int,QString)), SLOT(handleError(int,QString)));
+ }
+
+ // - title
+ XQRequestInfo info;
+ info.setInfo("WindowTitle", "<NEW IF app name>");
+ mReq->setInfo(info);
+
+ HbInputDialog *dialog = new HbInputDialog();
+ dialog->setAttribute(Qt::WA_DeleteOnClose);
+ dialog->setAdditionalRowVisible(true);
+ dialog->setInputMode(HbInputDialog::IntInput, 0);
+ dialog->setInputMode(HbInputDialog::IntInput, 1);
+ dialog->setPromptText("Enter category", 0);
+ dialog->setPromptText("Enter sort role", 1);
+ dialog->setValue(3, 0);
+ dialog->setValue(0, 1);
+ dialog->open(this, SLOT(browseCapturedVideosFinished(HbAction *)));
+
+ qDebug() << "VideoServicesTestAppView::browseCapturedVideos END";
+}
+
+void VideoServicesTestAppView::browseCapturedVideosFinished(HbAction *action)
+{
+ HbInputDialog *dialog = static_cast<HbInputDialog*>(sender());
+
+ int category = dialog->value(0).toInt();
+ int sortRole = dialog->value(1).toInt();
+
+ if(dialog->actions().first() == action)
+ {
+ // set arguments
+ QList<QVariant> args;
+ args.append(QVariant(category));
+ args.append(QVariant(sortRole));
+ mReq->setArguments(args);
+
+ // Make the request
+ if (!mReq->send())
+ {
+ mErrorEdit->setText("Failed to send REQ");
+ qDebug() << "VideoServicesTestAppView::browseCapturedVideosFinished: XQAiwRequest::send returned false";
+ }
+ // req no longer needed, remove it
+ delete mReq;
+ mReq = 0;
+ }
+}
+
+void VideoServicesTestAppView::fetchVideoDeprecatedOldService()
+{
+ qDebug() << "VideoServicesTestAppView::fetchVideo START";
+
+ mResultEdit->setText("");
+ mErrorEdit->setText("");
+ mErrorCodeEdit->setText("");
+
+ delete mReq;
+ mReq = 0;
+ mReq = mAppMgr.create("com.nokia.Videos", "IVideoFetch", "fetch(QString)", true);
+
+ qDebug() << "VideoServicesTestAppView::fetchVideo: mReq=" << mReq;
+
+ if (!mReq)
+ {
+ mErrorEdit->setText("Failed to create REQ");
+ return;
+ }
+ else
+ {
+ connect(mReq, SIGNAL(requestOk(const QVariant&)), SLOT(handleOk(const QVariant&)));
+ connect(mReq, SIGNAL(requestError(int,const QString&)), SLOT(handleError(int,const QString&)));
+ }
+
+ // Set arguments for request (application title)
+ QList<QVariant> args;
+ args << QVariant(QString("<OLD-IF-OLD-S app_name>"));
+ mReq->setArguments(args);
+
+ // Make the request
+ if (!mReq->send())
+ {
+ mErrorEdit->setText("Failed to send REQ");
+ qDebug() << "VideoServicesTestAppView::fetchVideo: XQAiwRequest::send returned false";
+ }
+ // req no longer needed, remove it
+ delete mReq;
+ mReq = 0;
+
+ qDebug() << "VideoServicesTestAppView::fetchVideo END";
+}
+
+void VideoServicesTestAppView::fetchVideoDeprecatedNewService()
+{
+ qDebug() << "VideoServicesTestAppView::fetchVideo START";
+
+ mResultEdit->setText("");
+ mErrorEdit->setText("");
+ mErrorCodeEdit->setText("");
+
+ delete mReq;
+ mReq = 0;
+ mReq = mAppMgr.create("videoplayer", "IVideoFetch", "fetch(QString)", true);
+
+ qDebug() << "VideoServicesTestAppView::fetchVideo: mReq=" << mReq;
+
+ if (!mReq)
+ {
+ mErrorEdit->setText("Failed to create REQ");
+ return;
+ }
+ else
+ {
+ connect(mReq, SIGNAL(requestOk(const QVariant&)), SLOT(handleOk(const QVariant&)));
+ connect(mReq, SIGNAL(requestError(int,const QString&)), SLOT(handleError(int,const QString&)));
+ }
+
+ // Set arguments for request (application title)
+ QList<QVariant> args;
+ args << QVariant(QString("<OLD-IF-NEW-S app_name>"));
+ mReq->setArguments(args);
+
+ // Make the request
+ if (!mReq->send())
+ {
+ mErrorEdit->setText("Failed to send REQ");
+ qDebug() << "VideoServicesTestAppView::fetchVideo: XQAiwRequest::send returned false";
+ }
+ // req no longer needed, remove it
+ delete mReq;
+ mReq = 0;
+ qDebug() << "VideoServicesTestAppView::fetchVideo END";
+}
+
+
+void VideoServicesTestAppView::browseCapturedVideosDeprecatedOldService()
+{
+ qDebug() << "VideoServicesTestAppView::browseCapturedVideos START";
+
+ mResultEdit->setText("");
+ mErrorEdit->setText("");
+ mErrorCodeEdit->setText("");
+
+ delete mReq;
+ mReq = 0;
+ mReq = mAppMgr.create("com.nokia.Videos", "IVideoBrowse", "browseVideos(QString,int,int)", true);
+
+ qDebug() << "VideoServicesTestAppView::browseCapturedVideos: mReq=" << mReq;
+
+ if (!mReq)
+ {
+ mErrorEdit->setText("Failed to create REQ");
+ return;
+ }
+ else
+ {
+ connect(mReq, SIGNAL(requestOk(QVariant)), SLOT(handleOk(QVariant)));
+ connect(mReq, SIGNAL(requestError(int,QString)), SLOT(handleError(int,QString)));
+ }
+
+ HbInputDialog *dialog = new HbInputDialog();
+ dialog->setAttribute(Qt::WA_DeleteOnClose);
+ dialog->setAdditionalRowVisible(true);
+ dialog->setInputMode(HbInputDialog::IntInput, 0);
+ dialog->setInputMode(HbInputDialog::IntInput, 1);
+ dialog->setPromptText("Enter category", 0);
+ dialog->setPromptText("Enter sort role", 1);
+ dialog->setValue(3, 0);
+ dialog->setValue(0, 1);
+ dialog->open(this, SLOT(browseCapturedVideosDeprecatedOldServiceFinished(HbAction *)));
+
+ qDebug() << "VideoServicesTestAppView::browseCapturedVideos END";
+}
+
+void VideoServicesTestAppView::browseCapturedVideosDeprecatedOldServiceFinished(HbAction *action)
+{
+ HbInputDialog *dialog = static_cast<HbInputDialog*>(sender());
+
+ const QString title = "<OLD-IF-OLD-S app name>";
+
+ int category = dialog->value(0).toInt();
+ int sortRole = dialog->value(1).toInt();
+
+ if(dialog->actions().first() == action)
+ {
+ // set arguments
+ QList<QVariant> args;
+ args.append(title);
+ args.append(QVariant(category));
+ args.append(QVariant(sortRole));
+ mReq->setArguments(args);
+
+ // Make the request
+ if (!mReq->send())
+ {
+ mErrorEdit->setText("Failed to send REQ");
+ qDebug() << "VideoServicesTestAppView::browseCapturedVideosFinished: XQAiwRequest::send returned false";
+ }
+ // req no longer needed, remove it
+ delete mReq;
+ mReq = 0;
+ }
+}
+
+void VideoServicesTestAppView::browseCapturedVideosDeprecatedNewService()
+{
+ qDebug() << "VideoServicesTestAppView::browseCapturedVideos START";
+
+ mResultEdit->setText("");
+ mErrorEdit->setText("");
+ mErrorCodeEdit->setText("");
+
+ delete mReq;
+ mReq = 0;
+ mReq = mAppMgr.create("videoplayer", "IVideoBrowse", "browseVideos(QString,int,int)", true);
+
+ qDebug() << "VideoServicesTestAppView::browseCapturedVideos: mReq=" << mReq;
+
+ if (!mReq)
+ {
+ mErrorEdit->setText("Failed to create REQ");
+ return;
+ }
+ else
+ {
+ connect(mReq, SIGNAL(requestOk(QVariant)), SLOT(handleOk(QVariant)));
+ connect(mReq, SIGNAL(requestError(int,QString)), SLOT(handleError(int,QString)));
+ }
+
+ HbInputDialog *dialog = new HbInputDialog();
+ dialog->setAttribute(Qt::WA_DeleteOnClose);
+ dialog->setAdditionalRowVisible(true);
+ dialog->setInputMode(HbInputDialog::IntInput, 0);
+ dialog->setInputMode(HbInputDialog::IntInput, 1);
+ dialog->setPromptText("Enter category", 0);
+ dialog->setPromptText("Enter sort role", 1);
+ dialog->setValue(3, 0);
+ dialog->setValue(0, 1);
+ dialog->open(this, SLOT(browseCapturedVideosDeprecatedNewServiceFinished(HbAction *)));
+
+ qDebug() << "VideoServicesTestAppView::browseCapturedVideos END";
+}
+
+void VideoServicesTestAppView::browseCapturedVideosDeprecatedNewServiceFinished(HbAction *action)
+{
+ HbInputDialog *dialog = static_cast<HbInputDialog*>(sender());
+
+ const QString title = "<OLD-IF-NEW-S app name>";
+
+ int category = dialog->value(0).toInt();
+ int sortRole = dialog->value(1).toInt();
+
+ if(dialog->actions().first() == action)
+ {
+ // set arguments
+ QList<QVariant> args;
+ args.append(title);
+ args.append(QVariant(category));
+ args.append(QVariant(sortRole));
+ mReq->setArguments(args);
+
+ // Make the request
+ if (!mReq->send())
+ {
+ mErrorEdit->setText("Failed to send REQ");
+ qDebug() << "VideoServicesTestAppView::browseCapturedVideosFinished: XQAiwRequest::send returned false";
+ }
+ // req no longer needed, remove it
+ delete mReq;
+ mReq = 0;
+ }
+}
+
+// end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/videoservicestestapp/videoservicestestapp.pro Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,34 @@
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+TEMPLATE = app
+TARGET = videoservicestestapp
+
+CONFIG += hb
+LIBS += -lxqservice -lxqserviceutil
+
+HEADERS += inc/videoservicestestappview.h
+
+SOURCES += src/videoservicestestappview.cpp \
+ src/main.cpp
+
+
+symbian {
+ TARGET.UID2 = 0x100039CE
+ TARGET.UID3 = 0x2002C341
+ TARGET.CAPABILITY = ALL -TCB
+ INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+
+ BLD_INF_RULES.prj_exports += "rom/videoservicestestapp.iby CORE_APP_LAYER_IBY_EXPORT_PATH(videoservicestestapp.iby)"
+}
Binary file videocollection/videocollectionview/conf/CI_videoplayerservicelist.confml has changed
Binary file videocollection/videocollectionview/conf/videolistview.confml has changed
Binary file videocollection/videocollectionview/conf/videolistview_2002BC63.crml has changed
Binary file videocollection/videocollectionview/conf/videoplayerservicelist.confml has changed
--- a/videocollection/videocollectionview/data/images/qtg_mono_video_all.svg Tue Jun 15 13:09:36 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
- <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
- xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
- x="0px" y="0px" width="40px" height="40px" viewBox="0 0 40 40" enable-background="new 0 0 40 40" xml:space="preserve">
-<defs>
-</defs>
-<rect opacity="0.5" fill="none" width="40" height="40"/>
-<path d="M33,4v3h-3V4h-3v5H13V4h-3v3H7V4H4v32h3v-3h3v3h3v-5h14v5h3v-3h3v3h3V4H33z M33,9v4h-3V9H33z M30,21h3v4h-3V21z M30,19v-4h3
- v4H30z M10,9v4H7V9H10z M7,21h3v4H7V21z M7,19v-4h3v4H7z M7,31v-4h3v4H7z M13,28V12h14v16H13z M30,31v-4h3v4H30z"/>
-</svg>
--- a/videocollection/videocollectionview/data/videocollectionview.qrc Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionview/data/videocollectionview.qrc Thu Jul 22 16:34:17 2010 +0100
@@ -3,9 +3,6 @@
<file alias="collectionview.docml">collectionview.docml</file>
<file alias="videolistselectiondialog.docml">videolistselectiondialog.docml</file>
</qresource>
- <qresource prefix="/" >
- <file>images/qtg_mono_video_all.svg</file>
- </qresource>
<qresource prefix="/style" >
<file>hbdialog.css</file>
</qresource>
--- a/videocollection/videocollectionview/data/videolistselectiondialog.docml Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionview/data/videolistselectiondialog.docml Thu Jul 22 16:34:17 2010 +0100
@@ -57,7 +57,7 @@
</widget>
<widget name="mListContainer" role="HbDialog:contentWidget" type="HbStackedWidget"/>
<sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Expanding" verticalStretch="0"/>
- <sizehint height="95.22388un" type="PREFERRED" width="53.58209un"/>
+ <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">
<uistate name="Common ui state" sections="#common"/>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/videocollectionview/inc/videocollectioncenrepdefs.h Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef _VIDEOCOLLETIONCENREP_H_
+#define _VIDEOCOLLETIONCENREP_H_
+
+// Cenrep constants.
+const int KVideoCollectionViewCenrepUid(0x2002BC63);
+const int KVideoCollectionViewCenrepVideoSortingRoleKey(0x1);
+const int KVideoCollectionViewCenrepVideoSortingOrderKey(0x2);
+const int KVideoCollectionViewCenrepCollectionsSortingRoleKey(0x3);
+const int KVideoCollectionViewCenrepCollectionsSortingOrderKey(0x4);
+
+const int KVideoCollectionViewCenrepServiceItem1Title(0x20);
+const int KVideoCollectionViewCenrepServiceItem1Text(0x21);
+const int KVideoCollectionViewCenrepServiceItem1IconPath(0x22);
+const int KVideoCollectionViewCenrepServiceItem1PressedIconPath(0x23);
+const int KVideoCollectionViewCenrepServiceItem1ToolbarIconPath(0x24);
+const int KVideoCollectionViewCenrepServiceItem1Url(0x25);
+const int KVideoCollectionViewCenrepServiceItem1Uid(0x26);
+
+const int KVideoCollectionViewCenrepServiceItem2Title(0x27);
+const int KVideoCollectionViewCenrepServiceItem2Text(0x28);
+const int KVideoCollectionViewCenrepServiceItem2ToolbarIconPath(0x29);
+const int KVideoCollectionViewCenrepServiceItem2Url(0x2A);
+const int KVideoCollectionViewCenrepServiceItem2Uid(0x2B);
+
+const int KVideoCollectionViewCenrepServiceItem3Title(0x2C);
+const int KVideoCollectionViewCenrepServiceItem3Text(0x2D);
+const int KVideoCollectionViewCenrepServiceItem3ToolbarIconPath(0x2E);
+const int KVideoCollectionViewCenrepServiceItem3Url(0x2F);
+const int KVideoCollectionViewCenrepServiceItem3Uid(0x30);
+
+const int KVideoCollectionViewCenrepServiceItem4Title(0x31);
+const int KVideoCollectionViewCenrepServiceItem4Text(0x32);
+const int KVideoCollectionViewCenrepServiceItem4ToolbarIconPath(0x33);
+const int KVideoCollectionViewCenrepServiceItem4Url(0x34);
+const int KVideoCollectionViewCenrepServiceItem4Uid(0x35);
+
+const int KVideoCollectionViewCenrepServiceItem5Title(0x36);
+const int KVideoCollectionViewCenrepServiceItem5Text(0x37);
+const int KVideoCollectionViewCenrepServiceItem5ToolbarIconPath(0x38);
+const int KVideoCollectionViewCenrepServiceItem5Url(0x39);
+const int KVideoCollectionViewCenrepServiceItem5Uid(0x3A);
+
+const int KVideoCollectionViewCenrepServiceItem6Title(0x3B);
+const int KVideoCollectionViewCenrepServiceItem6Text(0x3C);
+const int KVideoCollectionViewCenrepServiceItem6ToolbarIconPath(0x3D);
+const int KVideoCollectionViewCenrepServiceItem6Url(0x3E);
+const int KVideoCollectionViewCenrepServiceItem6Uid(0x3F);
+
+#endif // _VIDEOCOLLETIONCENREP_H_
--- a/videocollection/videocollectionview/inc/videocollectionuiloader.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionview/inc/videocollectionuiloader.h Thu Jul 22 16:34:17 2010 +0100
@@ -78,24 +78,26 @@
* Returns the requested widget casted to correct type
*
* @param name Name of the widget
+ * @param loadIfNotFound Should the widget be loaded if not found in cache.
* @return Pointer to the widget
*/
template<class T>
- T* findWidget(const QString &name)
+ T* findWidget(const QString &name, bool loadIfNotFound = true)
{
- return qobject_cast<T*>(doFindWidget(name));
+ return qobject_cast<T*>(doFindWidget(name, loadIfNotFound));
}
/**
* Returns the requested object casted to correct type
*
* @param name Name of the object
+ * @param loadIfNotFound Should the widget be loaded if not found in cache.
* @return Pointer to the object
*/
template<class T>
- T* findObject(const QString &name)
+ T* findObject(const QString &name, bool loadIfNotFound = true)
{
- return qobject_cast<T*>(doFindObject(name));
+ return qobject_cast<T*>(doFindObject(name, loadIfNotFound));
}
/**
@@ -141,9 +143,10 @@
* Loads widget from document.
*
* @param name, Widget name.
+ * @param loadIfNotFound Should the widget be loaded if not found in cache.
* @return QGraphicsWidget*.
*/
- QGraphicsWidget* doFindWidget(const QString &name);
+ QGraphicsWidget* doFindWidget(const QString &name, bool loadIfNotFound);
/**
* Loads object from document.
@@ -151,7 +154,7 @@
* @param name, Object name.
* @return QObject*.
*/
- QObject* doFindObject(const QString &name);
+ QObject* doFindObject(const QString &name, bool loadIfNotFound);
/**
* Adds a ui section to async loading queue.
--- a/videocollection/videocollectionview/inc/videocollectionviewplugin.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionview/inc/videocollectionviewplugin.h Thu Jul 22 16:34:17 2010 +0100
@@ -22,6 +22,7 @@
class VideoCollectionUiLoader;
class VideoListView;
+class VideoServices;
class VideoCollectionViewPlugin: public MpxViewPlugin
{
@@ -142,10 +143,10 @@
bool mActivated;
/*
- * Service mode flag. True if started as a service, otherwise false.
+ * Video service object.
*
*/
- bool mIsService;
+ VideoServices *mVideoServices;
};
#endif // VIDEOVIEWPLUGIN_H
--- a/videocollection/videocollectionview/inc/videocollectionviewutils.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionview/inc/videocollectionviewutils.h Thu Jul 22 16:34:17 2010 +0100
@@ -83,6 +83,41 @@
* Initilizes model sort values.
*/
static void sortModel(VideoSortFilterProxyModel *model, bool async, VideoCollectionCommon::TCollectionLevels target);
+
+ /**
+ * Method saves the latest videolist widget level into local activity manager
+ * data container.
+ *
+ * Note that collection id will be cleared in activity data in case level is
+ * all videos or collection list.
+ *
+ * @param level collection level
+ */
+ static void setWidgetActivityLevel(const VideoCollectionCommon::TCollectionLevels &level);
+
+ /**
+ * Method gets the latest videolist widget level from local activity manager
+ * data container.
+ *
+ * @param level, reference to level variable where value is saved
+ */
+ static void getActivityWidgetLevel(VideoCollectionCommon::TCollectionLevels &level);
+
+ /**
+ * method saves provided id and string into local activity
+ * manager data container.
+ *
+ * @param id. Id to save
+ */
+ static void setCollectionActivityData(const TMPXItemId &id, const QString &name);
+
+ /**
+ * method reads id and string from from local activity manager data
+ * container and prepares MPX item id.
+ *
+ * @param id. Id to return
+ */
+ static void getCollectionActivityData(TMPXItemId &id, QString &name);
public slots:
--- a/videocollection/videocollectionview/inc/videohintwidget.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionview/inc/videohintwidget.h Thu Jul 22 16:34:17 2010 +0100
@@ -123,12 +123,7 @@
* Service icon.
*/
HbIcon *mServiceIcon;
-
- /**
- * Add videos icon.
- */
- HbIcon *mAddVideosIcon;
-
+
/**
* Current hint level.
*/
--- a/videocollection/videocollectionview/inc/videolistselectiondialog.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionview/inc/videolistselectiondialog.h Thu Jul 22 16:34:17 2010 +0100
@@ -54,6 +54,7 @@
EDeleteVideos,
EAddToCollection,
ERemoveFromCollection,
+ ECreateCollection,
ESelectCollection
};
@@ -220,6 +221,11 @@
TMPXItemId mSelectedAlbumId;
/**
+ * Text for a new album.
+ */
+ QString mNewAlbumText;
+
+ /**
* header label
*/
HbLabel *mHeading;
--- a/videocollection/videocollectionview/inc/videolistview.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionview/inc/videolistview.h Thu Jul 22 16:34:17 2010 +0100
@@ -81,7 +81,7 @@
* @param itemId, Id of the widget which is to be activated
* @return 0 activation ok, < 0 if activation fails
*/
- int activateView(const TMPXItemId &itemId);
+ int activateView(TMPXItemId &itemId);
/**
* Deactivates current widget, disables menu and disconnects
@@ -119,13 +119,6 @@
*/
void viewReady();
-public slots:
-
- /**
- * Signaled by HbInputDialog when it's closed.
- */
- void createCollectionDialogFinished(HbAction *action);
-
private slots:
/**
@@ -170,12 +163,6 @@
void openCollectionViewSlot();
/**
- * Slot is connected to model's about to insert rows signal.
- * Opens the new album which was created.
- */
- void openNewAlbumSlot(const QModelIndex &parent, int start, int end);
-
- /**
* Slot is connected into toolbar's Service tab's
* triggered signal.
*
@@ -263,12 +250,12 @@
/**
* Slot is connected to videolistwidgets collectionOpened -signal
*
- * @param collectionOpened
+ * @param openingCollection
* @param collection contains the name of the collection opened
*/
- void collectionOpenedSlot(bool collectionOpened,
+ void collectionOpenedSlot(bool openingCollection,
const QString& collection,
- const QModelIndex &index);
+ const TMPXItemId &collectionId);
/**
* Slot which is called when an object has been loaded.
@@ -333,12 +320,19 @@
void showAction(bool show, const QString &name);
/**
- * Activate to all videos view.
+ * Activates all videos or collections -list.
+ *
+ * @return int 0 ok
*/
- int activateVideosView();
+ int activateMainView();
/**
- * Activate to collection content view.
+ * Activate to collection content view when servicing.
+ * Only default collections are supported. If some other
+ * id is provided, all videos -list will be activated
+ *
+ * @param itemId. Id of collection to activate
+ * @return int
*/
int activateCollectionContentView(const TMPXItemId &itemId);
@@ -372,14 +366,14 @@
VideoCollectionUiLoader* mUiLoader;
/**
- * Boolean for knowing when the app was started as a service.
- */
- bool mIsService;
-
- /**
* Boolean for knowing when the model is ready.
*/
bool mModelReady;
+
+ /**
+ * Boolean for knowing when the view is ready.
+ */
+ bool mViewReady;
/**
* Hint level for the hint widget.
@@ -388,6 +382,7 @@
/**
* pointer to videoservices instance
+ * if exists, app has started as service
*/
VideoServices* mVideoServices;
--- a/videocollection/videocollectionview/inc/videolistwidget.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionview/inc/videolistwidget.h Thu Jul 22 16:34:17 2010 +0100
@@ -22,7 +22,9 @@
#include <hbview.h>
#include <hblistview.h>
#include <qmap.h>
+#include <qpointer.h>
#include <mpxitemid.h>
+#include "videoservices.h"
#include "videocollectioncommon.h"
class VideoSortFilterProxyModel;
@@ -67,9 +69,13 @@
* layout and activates correct view based on the current orientation
*
* @param model Model for this list view.
+ * @param isService, flag indicating app service status
+ * @param level presetted level for the widget
* @return int 0 initialization ok, < 0 if fails.
*/
- int initialize(VideoSortFilterProxyModel &model, VideoServices* videoServices = 0);
+ int initialize(VideoSortFilterProxyModel &model,
+ bool isService = false,
+ VideoCollectionCommon::TCollectionLevels level = VideoCollectionCommon::ELevelInvalid);
/**
* Method enables and displays current active view
@@ -103,7 +109,7 @@
*
* @return VideoSortFilterProxyModel*
*/
- VideoSortFilterProxyModel& getModel();
+ VideoSortFilterProxyModel* getModel();
public:
@@ -142,7 +148,7 @@
* @param true if opened, false if closed.
* @param optional name string
*/
- void collectionOpened(bool, const QString&, const QModelIndex&);
+ void collectionOpened(bool, const QString&, const TMPXItemId&);
/**
* signal is connected to service's itemSelected -slot
@@ -165,6 +171,12 @@
* Signaled by HbMessageBox when it's closed.
*/
void removeCollectionDialogFinished(HbAction *action);
+
+ /**
+ * called or signaled when delayed initialization is reauired for the widget
+ *
+ */
+ void doDelayedsSlot();
protected slots:
@@ -174,12 +186,6 @@
* Saves current selected item's index to mCurrentIndex
*/
void longPressedSlot(HbAbstractViewItem *item, const QPointF &point);
-
- /**
- * Re-implemented in case context menu is visible, the below list shoud not
- * be panned.
- */
- void panGesture(const QPointF &point);
private slots:
@@ -233,16 +239,16 @@
void playItemSlot();
/**
- * slot is connected to view's doDelayeds -signal
- *
- */
- void doDelayedsSlot();
-
- /**
* Signaled when stepping back from collection in collection view
*
*/
void back();
+
+ /**
+ * connected to navi -quit action triggered signal.
+ * Signals fileUri with empty path for servicing to be completed
+ */
+ void endVideoFecthingSlot();
/**
* Signaled when view scrolling starts, pauses thumbnail creation.
@@ -278,7 +284,7 @@
*
*/
void fetchThumbnailsForVisibleItems();
-
+
private:
enum TContextActionIds
@@ -307,9 +313,9 @@
void setContextMenu();
/**
- * Method sets correct popup menu during browsing service.
+ * Method sets correct popup menu for service.
*/
- void setBrowsingServiceContextMenu();
+ void setServiceContextMenu();
/**
* Method connects signals needed by the widget
@@ -325,11 +331,6 @@
void disConnectSignals();
/**
- * Return if this is a browsing service.
- */
- bool isBrowsingService() const;
-
- /**
* Set navigation action.
*/
void setNavigationAction();
@@ -356,10 +357,11 @@
* Provided model
* Not own.
*/
- VideoSortFilterProxyModel *mModel;
+ QPointer<VideoSortFilterProxyModel> mModel;
/**
- * pointer to videoservices instance
+ * pointer to videoservices instance. If exists,
+ * app has started as service.
*/
VideoServices* mVideoServices;
@@ -379,11 +381,6 @@
*/
bool mSignalsConnected;
- /**
- * Boolean for knowing when the app was started as a service.
- */
- bool mIsService;
-
/**
* Navigation softkey action.
*/
@@ -409,6 +406,11 @@
* ui loade object, not owned
*/
VideoCollectionUiLoader *mUiLoader;
+
+ /**
+ * Service being provided
+ */
+ VideoServices::TVideoService mService;
};
#endif // VIDEOLISTWIDGET_H
--- a/videocollection/videocollectionview/sis/hbmyvideos_armv5_udeb.pkg Tue Jun 15 13:09:36 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-; hbmyvideos_armv5_udeb.pkg generated by qmake at Mon 4. May 16:02:32 2009
-; This file is generated by qmake and should not be modified by the user
-;
-
-; Language
-&EN
-
-; SIS header: name, uid, version
-#{"hbmyvideos"},(0xE6c98bd2),1,0,0
-
-; Localised Vendor name
-%{"Nokia, Qt Software"}
-
-; Unique Vendor name
-:"Nokia, Qt Software"
-
-; Dependencies
-[0x101F7961],0,0,0,{"S60ProductID"}
-[0x102032BE],0,0,0,{"S60ProductID"}
-[0x102752AE],0,0,0,{"S60ProductID"}
-[0x1028315F],0,0,0,{"S60ProductID"}
-(0x2001E61C), 4, 5, 0, {"QtLibs pre-release"}
-
-; Executable and default resource files
-"\epoc32\release\armv5\udeb\hbmyvideos.exe" - "!:\sys\bin\hbmyvideos.exe"
-"\epoc32\data\z\resource\apps\hbmyvideos.rsc" - "!:\resource\apps\hbmyvideos.rsc"
-"\epoc32\data\z\private\10003a3f\import\apps\hbmyvideos_reg.rsc" - "!:\private\10003a3f\import\apps\hbmyvideos_reg.rsc"
--- a/videocollection/videocollectionview/sis/hbmyvideos_armv5_udeb_withhb_wk11.pkg Tue Jun 15 13:09:36 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-; hbmyvideos_armv5_udeb.pkg generated by qmake at Wed 15. Apr 12:53:10 2009
-; This file is generated by qmake and should not be modified by the user
-;
-
-; Language
-&EN
-
-; SIS header: name, uid, version
-#{"hbmyvideos"},(0xE47efc9b),1,0,0
-
-; Localised Vendor name
-%{"Nokia, Qt Software"}
-
-; Unique Vendor name
-:"Nokia, Qt Software"
-
-; Dependencies
-[0x101F7961],0,0,0,{"S60ProductID"}
-[0x102032BE],0,0,0,{"S60ProductID"}
-[0x102752AE],0,0,0,{"S60ProductID"}
-[0x1028315F],0,0,0,{"S60ProductID"}
-(0x2001E61C), 4, 5, 0, {"QtLibs pre-release"}
-
-; Executable and default resource files
-"\epoc32\release\armv5\udeb\hbmyvideos.exe" - "!:\sys\bin\hbmyvideos.exe"
-"\epoc32\data\z\resource\apps\hbmyvideos.rsc" - "!:\resource\apps\hbmyvideos.rsc"
-"\epoc32\data\z\private\10003a3f\import\apps\hbmyvideos_reg.rsc" - "!:\private\10003a3f\import\apps\hbmyvideos_reg.rsc"
-"\epoc32\release\armv5\udeb\qtnmwrapper.dll" - "!:\sys\bin\qtnmwrapper.dll"
-
-
-;"r:\epoc32\release\armv5\udeb\HbPureNumeric.dll" - "!:\sys\bin\HbPureNumeric.dll"
-;"r:\orbit\hbinputs\qmakepluginstubs\HbPureNumeric.qtplugin" - "!:\hbinputs\inputmethods\HbPureNumeric.qtplugin"
-;"r:\epoc32\release\armv5\udeb\HbLatinMultitap.dll" - "!:\sys\bin\HbLatinMultitap.dll"
-;"r:\orbit\hbinputs\qmakepluginstubs\HbLatinMultitap.qtplugin" - "!:\hbinputs\inputmethods\HbLatinMultitap.qtplugin"
-;"r:\epoc32\release\armv5\udeb\touchinput.dll" - "!:\sys\bin\touchinput.dll"
-"r:\orbit\hbinputs\qmakepluginstubs\touchinput.qtplugin" - "!:\hbinputs\inputmethods\touchinput.qtplugin"
-"r:\orbit\hbinputs\resources\accent.png" - "!:\hbinputs\resources\accent.png"
-"r:\orbit\hbinputs\resources\background.png" - "!:\hbinputs\resources\background.png"
-"r:\orbit\hbinputs\resources\bullet.png" - "!:\hbinputs\resources\bullet.png"
-"r:\orbit\hbinputs\resources\close_handle.png" - "!:\hbinputs\resources\close_handle.png"
-"r:\orbit\hbinputs\resources\close_handle_background.png" - "!:\hbinputs\resources\close_handle_background.png"
-"r:\orbit\hbinputs\resources\keypad_landscape.png" - "!:\hbinputs\resources\keypad_landscape.png"
-"r:\orbit\hbinputs\resources\keypad_portrait.png" - "!:\hbinputs\resources\keypad_portrait.png"
-"r:\orbit\hbinputs\resources\red_button.png" - "!:\hbinputs\resources\red_button.png"
-"r:\orbit\hbinputs\resources\red_button_mask.png" - "!:\hbinputs\resources\red_button_mask.png"
-"r:\orbit\hbinputs\resources\sym.png" - "!:\hbinputs\resources\sym.png"
-"r:\orbit\hbinputs\resources\test_multimode_lower.png" - "!:\hbinputs\resources\test_multimode_lower.png"
-"r:\orbit\hbinputs\resources\test_multimode_text.png" - "!:\hbinputs\resources\test_multimode_text.png"
-"r:\orbit\hbinputs\resources\test_multimode_upper.png" - "!:\hbinputs\resources\test_multimode_upper.png"
-"r:\orbit\hbinputs\resources\test_numbermode.png" - "!:\hbinputs\resources\test_numbermode.png"
-"r:\orbit\hbinputs\resources\test_pinyin.png" - "!:\hbinputs\resources\test_pinyin.png"
-"r:\orbit\hbinputs\resources\test_predictivemode_lower.png" - "!:\hbinputs\resources\test_predictivemode_lower.png"
-"r:\orbit\hbinputs\resources\test_predictivemode_text.png" - "!:\hbinputs\resources\test_predictivemode_text.png"
-"r:\orbit\hbinputs\resources\test_predictivemode_upper.png" - "!:\hbinputs\resources\test_predictivemode_upper.png"
-"r:\orbit\hbinputs\resources\test_stroke.png" - "!:\hbinputs\resources\test_stroke.png"
-"r:\orbit\hbinputs\resources\test_virtual_return.png" - "!:\hbinputs\resources\test_virtual_return.png"
-"r:\orbit\hbinputs\resources\test_virtual_return_mask.png" - "!:\hbinputs\resources\test_virtual_return_mask.png"
-"r:\orbit\hbinputs\resources\test_virtual_shift.png" - "!:\hbinputs\resources\test_virtual_shift.png"
-"r:\orbit\hbinputs\resources\test_virtual_shift_mask.png" - "!:\hbinputs\resources\test_virtual_shift_mask.png"
-"r:\orbit\hbinputs\resources\vkb_top.png" - "!:\hbinputs\resources\vkb_top.png"
-"r:\orbit\hbinputs\resources\rocker_normal.svg" - "!:\hbinputs\resources\rocker_normal.svg"
-"r:\orbit\hbinputs\resources\rocker_selection.svg" - "!:\hbinputs\resources\rocker_selection.svg"
-"r:\epoc32\release\armv5\udeb\hb.dll" - "!:\sys\bin\hb.dll"
-"r:\epoc32\release\armv5\udeb\hbinput.dll" - "!:\sys\bin\hbinput.dll"
-;"r:\epoc32\release\armv5\udeb\hbviw.dll" - "!:\sys\bin\hbviw.dll"
-;"r:\epoc32\release\armv5\udeb\hbhiw.dll" - "!:\sys\bin\hbhiw.dll"
Binary file videocollection/videocollectionview/sis/hbmyvideos_armv5_udeb_withhb_wk11.sisx has changed
--- a/videocollection/videocollectionview/sis/hbmyvideos_armv5_urel.pkg Tue Jun 15 13:09:36 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-; hbmyvideos_armv5_urel.pkg generated by qmake at Mon 4. May 16:02:32 2009
-; This file is generated by qmake and should not be modified by the user
-;
-
-; Language
-&EN
-
-; SIS header: name, uid, version
-#{"hbmyvideos"},(0xE6c98bd2),1,0,0
-
-; Localised Vendor name
-%{"Nokia, Qt Software"}
-
-; Unique Vendor name
-:"Nokia, Qt Software"
-
-; Dependencies
-[0x101F7961],0,0,0,{"S60ProductID"}
-[0x102032BE],0,0,0,{"S60ProductID"}
-[0x102752AE],0,0,0,{"S60ProductID"}
-[0x1028315F],0,0,0,{"S60ProductID"}
-(0x2001E61C), 4, 5, 0, {"QtLibs pre-release"}
-
-; Executable and default resource files
-"\epoc32\release\armv5\urel\hbmyvideos.exe" - "!:\sys\bin\hbmyvideos.exe"
-"\epoc32\data\z\resource\apps\hbmyvideos.rsc" - "!:\resource\apps\hbmyvideos.rsc"
-"\epoc32\data\z\private\10003a3f\import\apps\hbmyvideos_reg.rsc" - "!:\private\10003a3f\import\apps\hbmyvideos_reg.rsc"
Binary file videocollection/videocollectionview/sis/hbmyvideos_armv5_urel.sisx has changed
--- a/videocollection/videocollectionview/sis/hbmyvideos_gcce_udeb.pkg Tue Jun 15 13:09:36 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-; hbmyvideos_gcce_udeb.pkg generated by qmake at Mon 4. May 16:02:32 2009
-; This file is generated by qmake and should not be modified by the user
-;
-
-; Language
-&EN
-
-; SIS header: name, uid, version
-#{"hbmyvideos"},(0xE6c98bd2),1,0,0
-
-; Localised Vendor name
-%{"Nokia, Qt Software"}
-
-; Unique Vendor name
-:"Nokia, Qt Software"
-
-; Dependencies
-[0x101F7961],0,0,0,{"S60ProductID"}
-[0x102032BE],0,0,0,{"S60ProductID"}
-[0x102752AE],0,0,0,{"S60ProductID"}
-[0x1028315F],0,0,0,{"S60ProductID"}
-(0x2001E61C), 4, 5, 0, {"QtLibs pre-release"}
-
-; Executable and default resource files
-"\epoc32\release\gcce\udeb\hbmyvideos.exe" - "!:\sys\bin\hbmyvideos.exe"
-"\epoc32\data\z\resource\apps\hbmyvideos.rsc" - "!:\resource\apps\hbmyvideos.rsc"
-"\epoc32\data\z\private\10003a3f\import\apps\hbmyvideos_reg.rsc" - "!:\private\10003a3f\import\apps\hbmyvideos_reg.rsc"
--- a/videocollection/videocollectionview/sis/hbmyvideos_gcce_urel.pkg Tue Jun 15 13:09:36 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-; hbmyvideos_gcce_urel.pkg generated by qmake at Mon 4. May 16:02:32 2009
-; This file is generated by qmake and should not be modified by the user
-;
-
-; Language
-&EN
-
-; SIS header: name, uid, version
-#{"hbmyvideos"},(0xE6c98bd2),1,0,0
-
-; Localised Vendor name
-%{"Nokia, Qt Software"}
-
-; Unique Vendor name
-:"Nokia, Qt Software"
-
-; Dependencies
-[0x101F7961],0,0,0,{"S60ProductID"}
-[0x102032BE],0,0,0,{"S60ProductID"}
-[0x102752AE],0,0,0,{"S60ProductID"}
-[0x1028315F],0,0,0,{"S60ProductID"}
-(0x2001E61C), 4, 5, 0, {"QtLibs pre-release"}
-
-; Executable and default resource files
-"\epoc32\release\gcce\urel\hbmyvideos.exe" - "!:\sys\bin\hbmyvideos.exe"
-"\epoc32\data\z\resource\apps\hbmyvideos.rsc" - "!:\resource\apps\hbmyvideos.rsc"
-"\epoc32\data\z\private\10003a3f\import\apps\hbmyvideos_reg.rsc" - "!:\private\10003a3f\import\apps\hbmyvideos_reg.rsc"
--- a/videocollection/videocollectionview/src/videocollectionuiloader.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionview/src/videocollectionuiloader.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 21 %
+// Version : %version: 24 %
// INCLUDE FILES
#include <qgraphicswidget.h>
@@ -34,7 +34,6 @@
#include "videocollectionwrapper.h"
#include "videosortfilterproxymodel.h"
#include "videocollectionviewutils.h"
-#include "videoservices.h"
#include "videocollectiontrace.h"
// ---------------------------------------------------------------------------
@@ -199,7 +198,7 @@
// doFindWidget
// ---------------------------------------------------------------------------
//
-QGraphicsWidget* VideoCollectionUiLoader::doFindWidget(const QString &name)
+QGraphicsWidget* VideoCollectionUiLoader::doFindWidget(const QString &name, bool loadIfNotFound)
{
FUNC_LOG;
QGraphicsWidget *widget = 0;
@@ -211,7 +210,7 @@
}
// 2. load from document and initialize
- else
+ else if (loadIfNotFound)
{
// find object from queue
int index = indexInQueue(name);
@@ -238,7 +237,7 @@
// doFindObject
// ---------------------------------------------------------------------------
//
-QObject* VideoCollectionUiLoader::doFindObject(const QString &name)
+QObject* VideoCollectionUiLoader::doFindObject(const QString &name, bool loadIfNotFound)
{
FUNC_LOG;
QObject *object = 0;
@@ -250,7 +249,7 @@
}
// 2. load from document and initialize
- else
+ else if (loadIfNotFound)
{
// find object from queue
int index = indexInQueue(name);
@@ -373,17 +372,10 @@
wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
if(model)
{
- // open and sort model
- model->open(VideoCollectionCommon::ELevelVideos);
- VideoCollectionViewUtils::sortModel(model, true, VideoCollectionCommon::ELevelVideos);
-
+ VideoCollectionViewUtils::sortModel(model, true, VideoCollectionCommon::ELevelVideos);
+
// init widget
- VideoServices *videoServices = 0;
- if (mIsService)
- {
- videoServices = VideoServices::instance();
- }
- videoList->initialize(*model, videoServices);
+ videoList->initialize(*model, mIsService, VideoCollectionCommon::ELevelVideos);
}
}
}
@@ -393,21 +385,15 @@
VideoCollectionCommon::EModelTypeCollections);
if (model)
{
- model->open(VideoCollectionCommon::ELevelCategory);
VideoCollectionViewUtils::sortModel(model, true, VideoCollectionCommon::ELevelCategory);
-
+
// initialize video collection widget
VideoListWidget *videoList =
qobject_cast<VideoListWidget*>(object);
if (videoList)
{
// init widget
- VideoServices *videoServices = 0;
- if (mIsService)
- {
- videoServices = VideoServices::instance();
- }
- videoList->initialize(*model, videoServices);
+ videoList->initialize(*model, mIsService, VideoCollectionCommon::ELevelCategory);
}
}
}
@@ -417,16 +403,16 @@
VideoCollectionCommon::EModelTypeCollectionContent);
if (model)
{
+ // collection content contains always a list of videos so we use
+ // ELevelVideos as target for sorting
+ VideoCollectionViewUtils::sortModel(model, false, VideoCollectionCommon::ELevelVideos);
+
VideoListWidget *videoList = qobject_cast<VideoListWidget*>(object);
if (videoList)
{
// init widget
- VideoServices *videoServices = 0;
- if (mIsService)
- {
- videoServices = VideoServices::instance();
- }
- videoList->initialize(*model, videoServices);
+ // cannot set level at this point yet: it can be either default or user defined collection
+ videoList->initialize(*model, mIsService);
}
}
}
--- a/videocollection/videocollectionview/src/videocollectionviewplugin.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionview/src/videocollectionviewplugin.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 23 %
+// Version : %version: 24 %
// INCLUDE FILES
#include <xqplugin.h>
@@ -41,7 +41,7 @@
: mUiLoader( 0 )
, mView( 0 )
, mActivated( false )
- , mIsService( false )
+ , mVideoServices( 0 )
{
FUNC_LOG;
}
@@ -72,14 +72,8 @@
}
mUiLoader->reset();
-
- if (XQServiceUtil::isService())
- {
- INFO("VideoCollectionViewPlugin::createView() service flag set to true.");
- mIsService = true;
- }
- mUiLoader->setIsService(mIsService);
+ mUiLoader->setIsService(XQServiceUtil::isService());
bool ok(false);
@@ -145,6 +139,12 @@
mView = 0;
delete mUiLoader;
mUiLoader = 0;
+
+ if(mVideoServices)
+ {
+ mVideoServices->decreaseReferenceCount();
+ mVideoServices = 0;
+ }
}
// ---------------------------------------------------------------------------
@@ -163,17 +163,18 @@
bool isService = XQServiceUtil::isService();
if (isService)
{
- VideoServices *videoServices = VideoServices::instance();
- if (videoServices)
+ if(!mVideoServices)
{
- VideoServices::TVideoService serviceType =
- videoServices->currentService();
- if (serviceType == VideoServices::EBrowse)
- {
- // activate browsing service
- itemId.iId1 = videoServices->getBrowseCategory();
- itemId.iId2 = KVcxMvcMediaTypeCategory;
- }
+ mVideoServices = VideoServices::instance();
+ }
+
+ VideoServices::TVideoService serviceType =
+ mVideoServices->currentService();
+ if (serviceType == VideoServices::EBrowse)
+ {
+ // activate browsing service
+ itemId.iId1 = mVideoServices->getBrowseCategory();
+ itemId.iId2 = KVcxMvcMediaTypeCategory;
}
}
int err = mView->activateView(itemId);
--- a/videocollection/videocollectionview/src/videocollectionviewutils.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionview/src/videocollectionviewutils.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 37 %
+// Version : %version: 43 %
// INCLUDE FILES
#include <hbglobal.h>
@@ -26,19 +26,33 @@
#include <hbmessagebox.h>
#include <hbnotificationdialog.h>
#include <centralrepository.h>
+#include <vcxmyvideosdefs.h>
#include "videocollectioncommon.h"
#include "videocollectionviewutils.h"
#include "videosortfilterproxymodel.h"
+#include "videoactivitystate.h"
+#include "videocollectioncenrepdefs.h"
#include "videocollectiontrace.h"
-const int KVideoCollectionViewCenrepUid(0x2002BC63);
-const int KVideoCollectionViewCenrepServiceIconKey(0x2);
-const int KVideoCollectionViewCenrepServiceIconPressedKey(0x3);
-const int KVideoCollectionViewCenrepVideoSortingRoleKey(0x5);
-const int KVideoCollectionViewCenrepVideoSortingOrderKey(0x6);
-const int KVideoCollectionViewCenrepCollectionsSortingRoleKey(0x7);
-const int KVideoCollectionViewCenrepCollectionsSortingOrderKey(0x8);
+// Object names.
+const char* const VIEW_UTILS_OBJECT_NAME_STATUS_MSG = "vc:ViewUtilsStatusMessage";
+const char* const VIEW_UTILS_OBJECT_NAME_MESSAGE_BOX_WARNING = "vc:ViewUtilsMessageBoxWarning";
+
+const int KAddToCollectionDataCount(2);
+const int KAddToCollectionCountIndex(0);
+const int KAddToCollectionNameIndex(1);
+
+// 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_COLLECTION_ID = "_VideoActivity_collection_id_";
+
+// name of the collection whose videolist is to be shown (QString)
+static const QString KEY_COLLECTION_NAME = "_VideoActivity_collection_name_";
+
// ---------------------------------------------------------------------------
// instance
@@ -46,9 +60,9 @@
//
VideoCollectionViewUtils& VideoCollectionViewUtils::instance()
{
- FUNC_LOG;
- static VideoCollectionViewUtils _popupInstance;
- return _popupInstance;
+ FUNC_LOG;
+ static VideoCollectionViewUtils _popupInstance;
+ return _popupInstance;
}
// ---------------------------------------------------------------------------
@@ -62,7 +76,6 @@
mCollectionsSortOrder(Qt::AscendingOrder)
{
FUNC_LOG;
-
}
// ---------------------------------------------------------------------------
@@ -72,7 +85,6 @@
VideoCollectionViewUtils::~VideoCollectionViewUtils()
{
FUNC_LOG;
-
}
// ---------------------------------------------------------------------------
@@ -198,10 +210,10 @@
{
TBuf<255> iconValue;
TBuf<255> pressedValue;
- status = cenRep->Get(KVideoCollectionViewCenrepServiceIconKey, iconValue);
+ status = cenRep->Get(KVideoCollectionViewCenrepServiceItem1IconPath, iconValue);
if(status == KErrNone)
{
- status = cenRep->Get(KVideoCollectionViewCenrepServiceIconPressedKey, pressedValue);
+ status = cenRep->Get(KVideoCollectionViewCenrepServiceItem1PressedIconPath, pressedValue);
if(status == KErrNone)
{
QString iconTemp((QChar*)iconValue.Ptr(),iconValue.Length());
@@ -229,7 +241,7 @@
if(cenRep)
{
TBuf<255> uriValue;
- if(cenRep->Get(KVideoCollectionViewCenrepServiceIconKey, uriValue) == KErrNone)
+ if(cenRep->Get(KVideoCollectionViewCenrepServiceItem1Url, uriValue) == KErrNone)
{
QString uriTemp((QChar*)uriValue.Ptr(),uriValue.Length());
uri = uriTemp;
@@ -304,6 +316,96 @@
}
// ---------------------------------------------------------------------------
+// setWidgetActivityLevel
+// ---------------------------------------------------------------------------
+//
+void VideoCollectionViewUtils::setWidgetActivityLevel(
+ const VideoCollectionCommon::TCollectionLevels &level)
+{
+ FUNC_LOG;
+ QVariant data = int(level);
+ VideoActivityState::instance().setActivityData(data, KEY_WIDGET_LEVEL);
+
+ if(level != VideoCollectionCommon::ELevelDefaultColl &&
+ level != VideoCollectionCommon::ELevelAlbum)
+ {
+ // no need to save collection related data, clear them
+ data.clear();
+ VideoActivityState::instance().setActivityData(data, KEY_COLLECTION_ID);
+ VideoActivityState::instance().setActivityData(data, KEY_COLLECTION_NAME);
+ }
+}
+
+// ---------------------------------------------------------------------------
+// getActivityWidgetLevel
+// ---------------------------------------------------------------------------
+//
+void VideoCollectionViewUtils::getActivityWidgetLevel(VideoCollectionCommon::TCollectionLevels &level)
+{
+ FUNC_LOG;
+ // default value is all videos list level
+ level = VideoCollectionCommon::ELevelVideos;
+ QVariant data = VideoActivityState::instance().getActivityData(KEY_WIDGET_LEVEL);
+
+ int value = data.toInt();
+ if(value == VideoCollectionCommon::ELevelCategory)
+ {
+ level = VideoCollectionCommon::ELevelCategory;
+ }
+ else if(value == VideoCollectionCommon::ELevelDefaultColl)
+ {
+ level = VideoCollectionCommon::ELevelDefaultColl;
+ }
+ else if(value == VideoCollectionCommon::ELevelAlbum)
+ {
+ level = VideoCollectionCommon::ELevelAlbum;
+ }
+}
+
+// ---------------------------------------------------------------------------
+// setCollectionActivityData
+// ---------------------------------------------------------------------------
+//
+void VideoCollectionViewUtils::setCollectionActivityData(const TMPXItemId &id, const QString &name)
+{
+ FUNC_LOG;
+ QVariant data = int(id.iId1);
+ VideoActivityState::instance().setActivityData(data, KEY_COLLECTION_ID);
+ data.clear();
+ data = name;
+ VideoActivityState::instance().setActivityData(data, KEY_COLLECTION_NAME);
+}
+
+// ---------------------------------------------------------------------------
+// getCollectionActivityData
+// ---------------------------------------------------------------------------
+//
+void VideoCollectionViewUtils::getCollectionActivityData(TMPXItemId &id, QString &name)
+{
+ FUNC_LOG;
+ id = TMPXItemId::InvalidId();
+ name = "";
+ VideoCollectionCommon::TCollectionLevels level = VideoCollectionCommon::ELevelVideos;
+ getActivityWidgetLevel(level);
+
+ if(level == VideoCollectionCommon::ELevelDefaultColl)
+ {
+ id.iId2 = KVcxMvcMediaTypeCategory;
+ }
+ else if(level == VideoCollectionCommon::ELevelAlbum)
+ {
+ id.iId2 = KVcxMvcMediaTypeAlbum;
+ }
+ if(id.iId2 != KMaxTUint32)
+ {
+ QVariant data = VideoActivityState::instance().getActivityData(KEY_COLLECTION_ID);
+ id.iId1 = data.toInt();
+ data = VideoActivityState::instance().getActivityData(KEY_COLLECTION_NAME);
+ name = data.toString();
+ }
+}
+
+// ---------------------------------------------------------------------------
// showStatusMsgSlot
// ---------------------------------------------------------------------------
//
@@ -335,11 +437,16 @@
case VideoCollectionCommon::statusMultiRemoveFail:
msg = hbTrId("txt_videos_info_unable_to_remove_some_collections");
break;
- case VideoCollectionCommon::statusVideosAddedToCollection:
- format = hbTrId("txt_videos_dpopinfo_videos_added_to_1");
- if(additional.isValid())
+ case VideoCollectionCommon::statusVideosAddedToCollection:
+ // videos added to collection - status should containg both count and collection name
+ if(additional.isValid() && additional.toList().count() == KAddToCollectionDataCount)
{
- msg = format.arg(additional.toString());
+ int count = additional.toList().at(KAddToCollectionCountIndex).toInt();
+ QString name = additional.toList().at(KAddToCollectionNameIndex).toString();
+ if(count && name.length())
+ {
+ msg = hbTrId("txt_videos_dpopinfo_ln_videos_added_to_1", count).arg(name);
+ }
}
error = false;
break;
@@ -347,10 +454,9 @@
msg = hbTrId("txt_videos_info_all_videos_already_added_to_this_c");
break;
case VideoCollectionCommon::statusDeleteInProgress:
- format = hbTrId("txt_videos_dpopinfo_ln_videos_are_being_deleted");
if(additional.isValid())
{
- msg = format.arg(additional.toString());
+ msg = hbTrId("txt_videos_dpopinfo_ln_videos_are_being_deleted", additional.toInt());
}
error = false;
break;
@@ -362,7 +468,10 @@
{
if(error)
{
- HbMessageBox::warning(msg);
+ HbMessageBox *messageBox = new HbMessageBox(msg, HbMessageBox::MessageTypeWarning);
+ messageBox->setAttribute(Qt::WA_DeleteOnClose);
+ messageBox->setObjectName(VIEW_UTILS_OBJECT_NAME_MESSAGE_BOX_WARNING);
+ messageBox->show();
}
else
{
@@ -371,8 +480,10 @@
// only title can be two rows for HbNotificationDialog
infoNote->setTitleTextWrapping(Hb::TextWordWrap);
infoNote->setTitle(msg);
+ infoNote->setObjectName(VIEW_UTILS_OBJECT_NAME_STATUS_MSG);
infoNote->show();
}
}
}
+// End of file
--- a/videocollection/videocollectionview/src/videohintwidget.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionview/src/videohintwidget.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 13 %
+// Version : %version: 14 %
// INCLUDE FILES
#include <hbpushbutton.h>
@@ -36,12 +36,11 @@
: HbWidget( parent )
, mUiLoader( uiLoader )
, mServiceIcon( 0 )
- , mAddVideosIcon( 0 )
, mCurrentLevel( AllVideos )
, mButtonShown( false )
, mActivated( false )
{
- FUNC_LOG;
+ FUNC_LOG;
// NOP
}
@@ -51,9 +50,8 @@
//
VideoHintWidget::~VideoHintWidget()
{
- FUNC_LOG;
+ FUNC_LOG;
delete mServiceIcon;
- delete mAddVideosIcon;
}
// ---------------------------------------------------------------------------
@@ -62,7 +60,7 @@
//
int VideoHintWidget::initialize()
{
- FUNC_LOG;
+ FUNC_LOG;
VideoCollectionViewUtils& utils = VideoCollectionViewUtils::instance();
return utils.getServiceIconStrings(mServiceIconString, mServiceIconPressedString);
}
@@ -73,8 +71,8 @@
//
void VideoHintWidget::setLevel(HintLevel level)
{
- FUNC_LOG;
- INFO_1("VideoHintWidget::setLevel() level: %d", level);
+ FUNC_LOG;
+ INFO_1("VideoHintWidget::setLevel() level: %d", level);
mCurrentLevel = level;
if(mActivated) {
updateUiComponents();
@@ -87,9 +85,9 @@
//
void VideoHintWidget::setButtonShown(bool shown)
{
- FUNC_LOG;
- INFO_1("VideoHintWidget::setButtonShown() shown: %d", shown);
- mButtonShown = shown;
+ FUNC_LOG;
+ INFO_1("VideoHintWidget::setButtonShown() shown: %d", shown);
+ mButtonShown = shown;
if(mActivated) {
updateUiComponents();
}
@@ -101,7 +99,7 @@
//
void VideoHintWidget::orientationChangedSlot(Qt::Orientation targetOrientation)
{
- FUNC_LOG;
+ FUNC_LOG;
Q_UNUSED(targetOrientation);
updateUiComponents();
}
@@ -112,24 +110,22 @@
//
void VideoHintWidget::activate()
{
- FUNC_LOG;
+ FUNC_LOG;
if (!mActivated)
{
- if(mServiceIconString.isEmpty() ||
- mServiceIconPressedString.isEmpty())
- {
- return;
- }
-
HbMainWindow *mainWnd = hbInstance->allMainWindows().value(0);
connect(
mainWnd, SIGNAL(orientationChanged(Qt::Orientation)),
this, SLOT(orientationChangedSlot(Qt::Orientation)));
- mServiceIcon = new HbIcon(mServiceIconString);
- mServiceIcon->setIconName(mServiceIconPressedString, QIcon::Normal, QIcon::On);
-
- mAddVideosIcon = new HbIcon("qtg_mono_add_to_video_collection");
+ if(!mServiceIconString.isEmpty())
+ {
+ mServiceIcon = new HbIcon(mServiceIconString);
+ }
+ if(mServiceIcon && !mServiceIconPressedString.isEmpty())
+ {
+ mServiceIcon->setIconName(mServiceIconPressedString, QIcon::Normal, QIcon::On);
+ }
updateUiComponents();
@@ -145,7 +141,7 @@
//
void VideoHintWidget::deactivate()
{
- FUNC_LOG;
+ FUNC_LOG;
if (mActivated)
{
mActivated = false;
@@ -164,15 +160,9 @@
{
serviceButton->setIcon(HbIcon());
}
- if(mServiceIcon) {
- delete mServiceIcon;
- mServiceIcon = 0;
- }
-
- if(mAddVideosIcon) {
- delete mAddVideosIcon;
- mAddVideosIcon = 0;
- }
+
+ delete mServiceIcon;
+ mServiceIcon = 0;
}
}
@@ -182,7 +172,7 @@
//
void VideoHintWidget::updateUiComponents()
{
- FUNC_LOG;
+ FUNC_LOG;
HbMainWindow *mainWnd = hbInstance->allMainWindows().value(0);
if (mainWnd)
{
@@ -197,17 +187,17 @@
DOCML_NAME_NO_VIDEOS_LABEL);
if (serviceButton && hintLabel && noVideosLabel)
{
- serviceButton->setVisible(mainWnd->orientation() == Qt::Horizontal && mButtonShown);
noVideosLabel->setVisible(true);
- if (mCurrentLevel == Collection)
+ if (mServiceIcon && mCurrentLevel == AllVideos)
+ {
+ hintLabel->setVisible(true);
+ serviceButton->setIcon(*mServiceIcon);
+ serviceButton->setVisible(mButtonShown);
+ }
+ else
{
hintLabel->setVisible(false);
- serviceButton->setIcon(*mAddVideosIcon);
- }
- else
- {
- hintLabel->setVisible(true);
- serviceButton->setIcon(*mServiceIcon);
+ serviceButton->setVisible(false);
}
}
}
--- a/videocollection/videocollectionview/src/videolistselectiondialog.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionview/src/videolistselectiondialog.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 25 %
+// Version : %version: 30 %
// INCLUDE FILES
#include <qgraphicsitem.h>
@@ -37,6 +37,13 @@
#include "videocollectionclient.h"
#include "videocollectiontrace.h"
+// Object names.
+const char* const SELECTION_DIALOG_OBJECT_NAME_LIST_WIDGET = "vc:SelectionDialogListWidget";
+const char* const SELECTION_DIALOG_OBJECT_NAME_NEW_COLLECTION = "vc:SelectionDialogNewCollection";
+const char* const LIST_VIEW_OBJECT_NAME_CREATE_COLLECTION = "vc::ListViewInputDialogCreateCollection";
+const char* const SELECTION_DIALOG_OBJECT_NAME_BUTTON_OK = "vc:SelectionDialogButtonOk";
+const char* const SELECTION_DIALOG_OBJECT_NAME_BUTTON_CANCEL = "vc:SelectionDialogButtonCancel";
+
/**
* global qHash function required fo creating hash values for TMPXItemId -keys
*/
@@ -47,6 +54,21 @@
return qHash(keyPair);
}
+/**
+ * Helper function for creating a new album name query dialog
+ */
+HbInputDialog* gCreateNewAlbumNameDialog(const char* objectName)
+{
+ QString label(hbTrId("txt_videos_title_enter_name"));
+ QString text(hbTrId("txt_videos_dialog_entry_new_collection"));
+ HbInputDialog *dialog = new HbInputDialog();
+ dialog->setAttribute(Qt::WA_DeleteOnClose);
+ dialog->setObjectName(objectName);
+ dialog->setPromptText(label);
+ dialog->setValue(text);
+ return dialog;
+}
+
// ---------------------------------------------------------------------------
// VideoListSelectionDialog
// ---------------------------------------------------------------------------
@@ -91,6 +113,7 @@
}
// disable list related animations to make dialog faster
mListWidget->setEnabledAnimations(HbAbstractItemView::None);
+ mListWidget->setObjectName(SELECTION_DIALOG_OBJECT_NAME_LIST_WIDGET);
}
}
@@ -128,6 +151,7 @@
mSelection.clear();
mSelectedVideos.clear();
mSelectedAlbumId = TMPXItemId::InvalidId();
+ mNewAlbumText = QString();
// if provided "owner" is album or category
if(activeItem != TMPXItemId::InvalidId())
@@ -144,7 +168,9 @@
}
// set (or reset) generic id filter
bool filterValue = true;
- if(mTypeOfSelection == EAddToCollection || mTypeOfSelection == ESelectCollection)
+ if(mTypeOfSelection == EAddToCollection ||
+ mTypeOfSelection == ESelectCollection ||
+ mTypeOfSelection == ECreateCollection)
{
filterValue = false;
}
@@ -175,6 +201,7 @@
if(!mListWidget)
{
mListWidget = new VideoListWidget(mUiLoader);
+ mListWidget->setObjectName(SELECTION_DIALOG_OBJECT_NAME_LIST_WIDGET);
if(mListWidget->initialize(*mModel) < 0)
{
ERROR(-1, "VideoListSelectionDialog::initDialog() failed to setup VideoListWidget.");
@@ -217,11 +244,13 @@
if(!mPrimaryAction)
{
mPrimaryAction = new HbAction(hbTrId("txt_common_button_ok"));
+ mPrimaryAction->setObjectName(SELECTION_DIALOG_OBJECT_NAME_BUTTON_OK);
addAction(mPrimaryAction);
}
if(!mSecondaryAction)
{
mSecondaryAction = new HbAction(hbTrId("txt_common_button_cancel"));
+ mSecondaryAction->setObjectName(SELECTION_DIALOG_OBJECT_NAME_BUTTON_CANCEL);
addAction(mSecondaryAction);
}
@@ -240,10 +269,11 @@
void VideoListSelectionDialog::activateSelection()
{
FUNC_LOG;
- // "add to collection" and "remove from collection -selections needs
- // additional functionality for primary key
+ // "add to collection", "remove from collection" and "create collection" -selections
+ // needs additional functionality for primary key
if(mTypeOfSelection == EAddToCollection ||
- mTypeOfSelection == ERemoveFromCollection)
+ mTypeOfSelection == ERemoveFromCollection ||
+ mTypeOfSelection == ECreateCollection)
{
mPrimaryAction->disconnect(SIGNAL(triggered()));
connect(mPrimaryAction, SIGNAL(triggered()), this, SLOT(primaryActionTriggeredSlot()));
@@ -259,6 +289,9 @@
case EAddToCollection:
primaryTxt = hbTrId("txt_common_button_add");
break;
+ case ECreateCollection:
+ primaryTxt = hbTrId("txt_common_button_ok");
+ break;
case ERemoveFromCollection:
primaryTxt = hbTrId("txt_common_button_remove");
break;
@@ -277,10 +310,8 @@
mCheckboxContainer->setVisible(false);
mListWidget->setSelectionMode(-1);
mListWidget->activate(VideoCollectionCommon::ELevelCategory);
- // need to set primaryaction disabled here in order for it
- // get correctly updated at modelReady(), where it will be enabled
- // if state would be same, no update will happen
- mPrimaryAction->setDisabled(true);
+ // New collection button is always enabled for collection selection.
+ mPrimaryAction->setDisabled(false);
}
else
{
@@ -290,10 +321,9 @@
mCheckboxContainer->setVisible(true);
mItemCount->setPlainText(tr("0/%1").arg(mModel->rowCount()));
mCheckBox->setChecked(false);
- // need to set primaryaction enabled here in order for it
- // get correctly updated at modelReady(), where it will be disabled
- // if state would be same, no update will happen
- mPrimaryAction->setDisabled(false);
+
+ // Add button will be enabled when videos are selected from the list.
+ mPrimaryAction->setDisabled(mTypeOfSelection != ECreateCollection);
}
mHeading->setPlainText(headingTxt);
// sort to make sure dialog has correctly filtered content
@@ -315,13 +345,22 @@
// scroll list back to top
mListWidget->scrollTo(mModel->index(0, 0));
-
+
if(mModel->rowCount())
{
connectSignals();
- // show dialog
- HbDialog::open();
+ if(mTypeOfSelection == ECreateCollection)
+ {
+ // note this does not leak memory as the dialog will destroy itself upon close.
+ HbInputDialog *dialog = gCreateNewAlbumNameDialog(LIST_VIEW_OBJECT_NAME_CREATE_COLLECTION);
+ dialog->open(this, SLOT(newAlbumNameDialogFinished(HbAction *)));
+ }
+ else
+ {
+ // show dialog
+ HbDialog::open();
+ }
}
else
{
@@ -344,17 +383,15 @@
INFO("VideoListSelectionDialog::exec(): secondary action triggered.")
return;
}
- QString albumName("");
- if( mTypeOfSelection == ESelectCollection )
+
+ if(mTypeOfSelection == ESelectCollection)
{
mTypeOfSelection = EAddToCollection;
- if( mSelectedAlbumId == TMPXItemId::InvalidId())
+ if(mSelectedAlbumId == TMPXItemId::InvalidId())
{
- QString label(hbTrId("txt_videos_title_enter_name"));
- HbInputDialog *dialog = new HbInputDialog();
- dialog->setAttribute(Qt::WA_DeleteOnClose);
- dialog->getText(label, this, SLOT(newAlbumNameDialogFinished(HbAction *)),
- hbTrId("txt_videos_dialog_entry_new_collection"));
+ // 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 *)));
}
else
{
@@ -385,8 +422,17 @@
QString text = mModel->resolveAlbumName(variant.toString());
if(text.length())
{
- mSelectedAlbumId = mModel->addNewAlbum(text);
- finalize(text);
+ if(mSelectedVideos.count() == 0)
+ {
+ mNewAlbumText = text;
+ // show video selection dialog
+ HbDialog::open();
+ }
+ else
+ {
+ mSelectedAlbumId = mModel->addNewAlbum(text);
+ finalize(text);
+ }
}
}
}
@@ -398,8 +444,15 @@
void VideoListSelectionDialog::finalize(QString albumName)
{
// Must be checked again if type was ESelectCollection
- if(mTypeOfSelection == EAddToCollection)
- {
+ if(mTypeOfSelection == EAddToCollection ||
+ mTypeOfSelection == ECreateCollection)
+ {
+ if(mTypeOfSelection == ECreateCollection)
+ {
+ mSelectedAlbumId = mModel->addNewAlbum(mNewAlbumText);
+ albumName = mNewAlbumText;
+ }
+
if(mSelectedAlbumId != TMPXItemId::InvalidId() && mSelectedVideos.count())
{
if(mModel->addItemsInAlbum(mSelectedAlbumId, mSelectedVideos.toList()) == 0)
@@ -408,7 +461,10 @@
{
albumName = getSelectedName();
}
- QVariant data = albumName;
+ QList<QVariant> dataList;
+ dataList.append(QVariant(mSelectedVideos.count()));
+ dataList.append(QVariant(albumName));
+ QVariant data = dataList;
VideoCollectionViewUtils::instance().showStatusMsgSlot(
VideoCollectionCommon::statusVideosAddedToCollection,
data);
@@ -487,10 +543,20 @@
if(mSelection.indexes().count() > 0)
{
mPrimaryAction->setDisabled(false);
+
+ if(mTypeOfSelection == ECreateCollection)
+ {
+ mPrimaryAction->setText(hbTrId("txt_common_button_add"));
+ }
}
else
{
- mPrimaryAction->setDisabled(true);
+ mPrimaryAction->setDisabled(mTypeOfSelection != ECreateCollection);
+
+ if(mTypeOfSelection == ECreateCollection)
+ {
+ mPrimaryAction->setText(hbTrId("txt_common_button_ok"));
+ }
}
updateCounterSlot();
@@ -522,7 +588,6 @@
FUNC_LOG;
if(mTypeOfSelection == ESelectCollection)
{
- mPrimaryAction->setDisabled(false);
if(!mModel->rowCount())
{
// in case there are no user defined albums,
@@ -532,10 +597,6 @@
return;
}
}
- if(mTypeOfSelection != ESelectCollection)
- {
- mPrimaryAction->setDisabled(true);
- }
updateCounterSlot();
}
@@ -589,7 +650,8 @@
}
}
- if(mSelectedAlbumId != TMPXItemId::InvalidId())
+ if(mSelectedAlbumId != TMPXItemId::InvalidId() ||
+ mTypeOfSelection == ECreateCollection)
{
INFO("VideoListSelectionDialog::primaryActionTriggeredSlot(): closing dialog.")
mPrimaryAction->trigger();
@@ -676,7 +738,7 @@
name = model->data(index, VideoCollectionCommon::KeyTitle).toString();
}
}
-
return name;
}
+// End of file
--- a/videocollection/videocollectionview/src/videolistview.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionview/src/videolistview.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 101 %
+// Version : %version: 113 %
// INCLUDE FILES
#include <xqserviceutil.h>
@@ -47,6 +47,9 @@
#include "mpxhbvideocommondefs.h"
#include "videocollectiontrace.h"
+// Object names.
+const char* const LIST_VIEW_OBJECT_NAME_OPTIONS_MENU = "vc::ListViewOptionsMenu";
+
// ---------------------------------------------------------------------------
// Constructor
// ---------------------------------------------------------------------------
@@ -56,8 +59,8 @@
, mUiUtils( VideoCollectionViewUtils::instance() )
, mWrapper( VideoCollectionWrapper::instance() )
, mUiLoader( uiLoader )
- , mIsService( false )
, mModelReady( false )
+ , mViewReady( false )
, mHintLevel( VideoHintWidget::AllVideos )
, mVideoServices( 0 )
, mCurrentList( 0 )
@@ -99,33 +102,68 @@
cleanup();
return -1;
}
-
- if (XQServiceUtil::isService() && !mVideoServices)
+ int videoListPhase = VideoCollectionUiLoaderParam::LoadPhasePrimary;
+ int collectionListPhase = VideoCollectionUiLoaderParam::LoadPhaseSecondary;
+ int collectionContentListPhase = VideoCollectionUiLoaderParam::LoadPhaseSecondary;
+ VideoCollectionCommon::TCollectionLevels level = VideoCollectionCommon::ELevelVideos;
+ if (XQServiceUtil::isService())
{
- INFO("VideoListView::initializeView() service flag set to true.");
- mIsService = true;
-
- mVideoServices = VideoServices::instance();
-
+ INFO("VideoListView::initializeView() initializing service.");
if (!mVideoServices)
{
- ERROR(-1, "VideoListView::initializeView() getting services instance failed.");
- cleanup();
- return -1;
+ mVideoServices = VideoServices::instance();
+ connect(mVideoServices, SIGNAL(titleReady(const QString&)),
+ this, SLOT(titleReadySlot(const QString&)));
}
- else
+
+ }
+ else
+ {
+ if(mVideoServices)
{
- connect(mVideoServices, SIGNAL(titleReady(const QString&)), this, SLOT(titleReadySlot(const QString&)));
+ disconnect(mVideoServices, SIGNAL(titleReady(const QString&)),
+ this, SLOT(titleReadySlot(const QString&)));
+ mVideoServices->decreaseReferenceCount();
+ mVideoServices = 0;
}
- }
-
+ VideoCollectionViewUtils::getActivityWidgetLevel(level);
+ if(level == VideoCollectionCommon::ELevelCategory)
+ {
+ videoListPhase = VideoCollectionUiLoaderParam::LoadPhaseSecondary;
+ collectionListPhase = VideoCollectionUiLoaderParam::LoadPhasePrimary;
+ collectionContentListPhase = VideoCollectionUiLoaderParam::LoadPhaseSecondary;
+ }
+ else if(level == VideoCollectionCommon::ELevelDefaultColl ||
+ level == VideoCollectionCommon::ELevelAlbum)
+ {
+ videoListPhase = VideoCollectionUiLoaderParam::LoadPhaseSecondary;
+ collectionListPhase = VideoCollectionUiLoaderParam::LoadPhasePrimary;
+ collectionContentListPhase = VideoCollectionUiLoaderParam::LoadPhasePrimary;
+ }
+ }
// start loading objects and widgets
QList<VideoCollectionUiLoaderParam> params;
+
params.append(VideoCollectionUiLoaderParam(
DOCML_NAME_VC_VIDEOLISTWIDGET,
DOCML_VIDEOCOLLECTIONVIEW_FILE,
true,
- VideoCollectionUiLoaderParam::LoadPhasePrimary));
+ videoListPhase));
+
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_VC_COLLECTIONWIDGET,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ DOCML_VIDEOCOLLECTIONVIEW_SECTION_LIST,
+ true,
+ collectionListPhase));
+
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_VC_COLLECTIONCONTENTWIDGET,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ DOCML_VIDEOCOLLECTIONVIEW_SECTION_LIST,
+ true,
+ collectionContentListPhase));
+
params.append(VideoCollectionUiLoaderParam(
DOCML_NAME_OPTIONS_MENU,
DOCML_VIDEOCOLLECTIONVIEW_FILE,
@@ -175,19 +213,7 @@
DOCML_NAME_SORT_BY_SIZE,
DOCML_VIDEOCOLLECTIONVIEW_FILE,
false,
- VideoCollectionUiLoaderParam::LoadPhaseSecondary));
- params.append(VideoCollectionUiLoaderParam(
- DOCML_NAME_VC_COLLECTIONWIDGET,
- DOCML_VIDEOCOLLECTIONVIEW_FILE,
- DOCML_VIDEOCOLLECTIONVIEW_SECTION_LIST,
- true,
- VideoCollectionUiLoaderParam::LoadPhaseSecondary));
- params.append(VideoCollectionUiLoaderParam(
- DOCML_NAME_VC_COLLECTIONCONTENTWIDGET,
- DOCML_VIDEOCOLLECTIONVIEW_FILE,
- DOCML_VIDEOCOLLECTIONVIEW_SECTION_LIST,
- true,
- VideoCollectionUiLoaderParam::LoadPhaseSecondary)); // widget
+ VideoCollectionUiLoaderParam::LoadPhaseSecondary));
params.append(VideoCollectionUiLoaderParam(
DOCML_NAME_DIALOG,
DOCML_VIDEOSELECTIONDIALOG_FILE,
@@ -217,6 +243,22 @@
mUiLoader->loadPhase(VideoCollectionUiLoaderParam::LoadPhasePrimary);
params.clear();
+ // fetch current list right away for main views
+ // for default and user defined collections, currentList
+ // will be setted during activation
+ if(videoListPhase == VideoCollectionUiLoaderParam::LoadPhasePrimary)
+ {
+ mCurrentList = mUiLoader->findWidget<VideoListWidget>(
+ DOCML_NAME_VC_VIDEOLISTWIDGET );
+ }
+ else
+ {
+ mCurrentList = mUiLoader->findWidget<VideoListWidget>(
+ DOCML_NAME_VC_COLLECTIONWIDGET );
+ }
+
+
+
return 0;
}
@@ -234,24 +276,47 @@
// activateView()
// ---------------------------------------------------------------------------
//
-int VideoListView::activateView(const TMPXItemId &itemId)
+int VideoListView::activateView( TMPXItemId &itemId)
{
FUNC_LOG;
- int err = 0;
-
+ int err = -1;
+
// activate collection to correct view
if (itemId == TMPXItemId::InvalidId())
- {
- err = activateVideosView();
+ {
+
+ VideoCollectionCommon::TCollectionLevels level = VideoCollectionCommon::ELevelVideos;
+ if(!mVideoServices)
+ {
+ VideoCollectionViewUtils::getActivityWidgetLevel(level);
+ }
+ if(level == VideoCollectionCommon::ELevelCategory ||
+ level == VideoCollectionCommon::ELevelVideos)
+ {
+ err = activateMainView();
+ }
+ else if(level == VideoCollectionCommon::ELevelDefaultColl ||
+ level == VideoCollectionCommon::ELevelAlbum)
+ {
+ // level is default or user defined collection
+ // see if we have item id
+ VideoCollectionViewUtils::getCollectionActivityData(itemId, mCollectionName);
+ }
}
- else
+ if(itemId != TMPXItemId::InvalidId())
{
err = activateCollectionContentView(itemId);
}
+ if(!err)
+ {
+
+ err = createToolbar();
+ }
+
// connect signals if everything went ok
- if (err == 0)
+ if (!err)
{
HbMainWindow *mainWnd = hbInstance->allMainWindows().value(0);
mainWnd->setOrientation(Qt::Vertical, false);
@@ -265,10 +330,10 @@
&mWrapper, SIGNAL(asyncStatus(int, QVariant&)),
this, SLOT(handleAsyncStatusSlot(int, QVariant&))) ||
!connect(
- mCurrentList->getModel().sourceModel(), SIGNAL(modelChanged()),
+ mCurrentList->getModel()->sourceModel(), SIGNAL(modelChanged()),
this, SLOT(layoutChangedSlot())) ||
!connect(
- mCurrentList->getModel().sourceModel(), SIGNAL(modelReady()),
+ mCurrentList->getModel()->sourceModel(), SIGNAL(modelReady()),
this, SLOT(modelReadySlot())))
{
ERROR(-1, "VideoListView::activateView() failed to connect signals.");
@@ -277,6 +342,10 @@
err = -1;
}
}
+ else
+ {
+ deactivateView();
+ }
return err;
}
@@ -289,7 +358,10 @@
{
FUNC_LOG;
mUiLoader->loadPhase(VideoCollectionUiLoaderParam::LoadPhaseSecondary);
- emit doDelayeds();
+ if(mCurrentList)
+ {
+ mCurrentList->doDelayedsSlot();
+ }
}
// ---------------------------------------------------------------------------
@@ -302,8 +374,9 @@
// if mModelReady is false, then it means that this is the first time modelReady
// signal fires. Signaling that view is ready.
- if(!mModelReady)
+ if(!mViewReady)
{
+ mViewReady = true;
emit viewReady();
}
@@ -322,12 +395,10 @@
void VideoListView::layoutChangedSlot()
{
FUNC_LOG;
+ // Note that showHint should be executed before updateSubLabel as it
+ // can modify the mModelReady flag.
+ showHint();
updateSubLabel();
-
- if(mModelReady)
- {
- showHint();
- }
}
// ---------------------------------------------------------------------------
@@ -351,25 +422,27 @@
this, SLOT(handleAsyncStatusSlot(int, QVariant&)));
HbMenu *menu = mUiLoader->findWidget<HbMenu>(DOCML_NAME_OPTIONS_MENU);
- if (menu)
+ if(menu)
{
+ menu->setObjectName(LIST_VIEW_OBJECT_NAME_OPTIONS_MENU);
menu->hide();
}
-
- if(mCurrentList && &(mCurrentList->getModel()) && mCurrentList->getModel().sourceModel())
+
+ if(mCurrentList && mCurrentList->getModel() && mCurrentList->getModel()->sourceModel())
{
- disconnect(mCurrentList->getModel().sourceModel(),
+ disconnect(mCurrentList->getModel()->sourceModel(),
SIGNAL(modelChanged()),
this, SLOT(layoutChangedSlot()));
- disconnect(mCurrentList->getModel().sourceModel(),
+ disconnect(mCurrentList->getModel()->sourceModel(),
SIGNAL(modelReady()),
this, SLOT(modelReadySlot()));
showHint(false);
- }
-
- if(mCurrentList)
- {
+ if(!mVideoServices)
+ {
+ VideoCollectionCommon::TCollectionLevels level = mCurrentList->getLevel();
+ VideoCollectionViewUtils::setWidgetActivityLevel(level);
+ }
mCurrentList->deactivate();
}
}
@@ -407,9 +480,9 @@
int VideoListView::createToolbar()
{
FUNC_LOG;
- // Create actiongroup and add all actions to it. This ensures that only one is
+
+ // Create actiongroup and add all actions to it. This ensures that only one is
// active at certain moment.
-
if(!mToolbarViewsActionGroup && !mToolbarCollectionActionGroup)
{
mToolbarViewsActionGroup = new QActionGroup(this);
@@ -418,14 +491,14 @@
// create toolbar item actions
// All Videos tab
- mToolbarActions[ETBActionAllVideos] = createAction(":/images/qtg_mono_video_all.svg",
+ mToolbarActions[ETBActionAllVideos] = createAction("qtg_mono_video",
mToolbarViewsActionGroup, SLOT(openAllVideosViewSlot()));
// Collections tab
mToolbarActions[ETBActionCollections] = createAction("qtg_mono_video_collection",
mToolbarViewsActionGroup, SLOT(openCollectionViewSlot()));
- if (!mIsService)
+ if (!mVideoServices)
{
// Services tab
mToolbarActions[ETBActionServices] = createAction("qtg_mono_ovistore",
@@ -446,7 +519,7 @@
if( !bar
|| !mToolbarActions[ETBActionAllVideos]
|| !mToolbarActions[ETBActionCollections]
- || ( !mIsService && (!mToolbarActions[ETBActionServices]
+ || ( !mVideoServices && (!mToolbarActions[ETBActionServices]
|| !mToolbarActions[ETBActionAddVideos]
|| !mToolbarActions[ETBActionRemoveVideos])))
{
@@ -463,15 +536,30 @@
mToolbarActions[ETBActionAllVideos]->setCheckable(true);
mToolbarActions[ETBActionCollections]->setCheckable(true);
- if (!mIsService)
+ if (!mVideoServices)
{
mToolbarActions[ETBActionServices]->setCheckable(false);
}
-
- // Allvideos is checked at creation phase
- mToolbarActions[ETBActionAllVideos]->setChecked(true);
-
- bar->addActions(mToolbarViewsActionGroup->actions());
+ VideoCollectionCommon::TCollectionLevels level = VideoCollectionCommon::ELevelVideos;
+ if(mCurrentList)
+ {
+ level = mCurrentList->getLevel();
+ }
+ if(level == VideoCollectionCommon::ELevelCategory)
+ {
+ mToolbarActions[ETBActionCollections]->setChecked(true);
+ bar->addActions(mToolbarViewsActionGroup->actions());
+ }
+ else if(level == VideoCollectionCommon::ELevelVideos )
+ {
+ mToolbarActions[ETBActionAllVideos]->setChecked(true);
+ bar->addActions(mToolbarViewsActionGroup->actions());
+ }
+ else if(level == VideoCollectionCommon::ELevelAlbum)
+ {
+ bar->addActions(mToolbarCollectionActionGroup->actions());
+ }
+
}
return 0;
@@ -512,37 +600,41 @@
return;
}
- VideoSortFilterProxyModel &model = mCurrentList->getModel();
+ VideoSortFilterProxyModel *model = mCurrentList->getModel();
+
+ if(!model || (!mModelReady && model->rowCount() == 0))
+ {
+ return;
+ }
- // prepare hint widget
+ mModelReady = true;
+
+ // decide if the hintwidget needs to be shown or not.
+ show = show && model->rowCount() == 0;
+
+ // If show is false, then hint widget is fetched only if it exists. If
+ // show is true then hint widget is also created and prepared if it does not exists.
VideoHintWidget *hintWidget =
mUiLoader->findWidget<VideoHintWidget>(
- DOCML_NAME_VC_VIDEOHINTWIDGET);
+ DOCML_NAME_VC_VIDEOHINTWIDGET, show);
+
if (hintWidget)
{
hintWidget->setLevel(mHintLevel);
- if (mModelReady &&
- model.rowCount() == 0)
+ if (show)
{
- show ? hintWidget->activate() : hintWidget->deactivate();
- }
- else
- {
- show = false;
- hintWidget->deactivate();
- }
- if(show)
- {
+ hintWidget->activate();
bool showHintBtns = (mCurrentList->getLevel() != VideoCollectionCommon::ELevelDefaultColl);
hintWidget->setButtonShown(showHintBtns);
}
else
{
+ hintWidget->deactivate();
hintWidget->setButtonShown(true);
}
}
- if (mToolbarViewsActionGroup && mToolbarCollectionActionGroup && !mIsService)
+ if (mToolbarViewsActionGroup && mToolbarCollectionActionGroup && !mVideoServices)
{
if (show)
{
@@ -592,10 +684,10 @@
VideoSortFilterProxyModel *model = 0;
if(mCurrentList)
{
- model = &mCurrentList->getModel();
+ model = mCurrentList->getModel();
}
- if (model)
+ if (model && mModelReady)
{
int itemCount = model->rowCount();
@@ -652,48 +744,25 @@
}
// ---------------------------------------------------------------------------
-// activateVideosView()
+// activateMainView()
// ---------------------------------------------------------------------------
//
-int VideoListView::activateVideosView()
+int VideoListView::activateMainView()
{
FUNC_LOG;
- VideoListWidget *videoList =
- mUiLoader->findWidget<VideoListWidget>(
- DOCML_NAME_VC_VIDEOLISTWIDGET);
- if (videoList)
- {
- VideoCollectionCommon::TCollectionLevels level = VideoCollectionCommon::ELevelVideos;
- if (mCurrentList)
- {
- level = mCurrentList->getLevel();
- }
- else
- {
- mCurrentList = videoList;
- }
-
- int result = mCurrentList->activate(level);
- if(result < 0)
- {
- ERROR(result, "VideoListView::activateVideosView() failed to activate.");
- // activate failed, deactivate view so we get rid of dangling connections.
- deactivateView();
- return -1;
- }
-
- if (createToolbar() != 0)
- {
- ERROR(result, "VideoListView::activateVideosView() failed to create toolbar.");
- deactivateView();
- return -1;
- }
- }
- else
+
+ if(!mCurrentList)
{
return -1;
}
-
+
+ int result = mCurrentList->activate();
+ if(result < 0)
+ {
+ ERROR(result, "VideoListView::activateVideosView() failed to activate.");
+ return -1;
+ }
+
return 0;
}
@@ -704,101 +773,76 @@
int VideoListView::activateCollectionContentView(const TMPXItemId &itemId)
{
FUNC_LOG;
- int err = 0;
-
- if (itemId.iId2 == KVcxMvcMediaTypeCategory ||
- itemId.iId2 == KVcxMvcMediaTypeAlbum)
+
+ // resolve collection name if possible
+ if(itemId.iId2 == KVcxMvcMediaTypeCategory && mCollectionName.isEmpty())
{
- // currently only captured and downloaded categories are supported
- switch (itemId.iId1)
+ if (itemId.iId1 == KVcxMvcCategoryIdDownloads)
+ {
+ mCollectionName = hbTrId("txt_videos_dblist_downloaded");
+ }
+ else if(itemId.iId1 == KVcxMvcCategoryIdCaptured)
+ {
+ mCollectionName = hbTrId("txt_videos_dblist_captured");
+ }
+ else
{
- case KVcxMvcCategoryIdDownloads:
- case KVcxMvcCategoryIdCaptured:
- {
- VideoListWidget *collectionContentWidget =
- mUiLoader->findWidget<VideoListWidget>(
- DOCML_NAME_VC_COLLECTIONCONTENTWIDGET);
- if (collectionContentWidget)
- {
- // no need to deactivate since there cannot be previous widget
- mCurrentList = collectionContentWidget;
-
- // resolve collection name
- if (itemId.iId1 == KVcxMvcCategoryIdDownloads)
- {
- mCollectionName = hbTrId("txt_videos_dblist_downloaded");
- }
- else if (itemId.iId1 == KVcxMvcCategoryIdCaptured)
- {
- mCollectionName = hbTrId("txt_videos_dblist_captured");
- }
-
- // activate collection content widget
- mCurrentList->activate(VideoCollectionCommon::ELevelDefaultColl);
-
- // open the model
- VideoSortFilterProxyModel &model = mCurrentList->getModel();
- model.openItem(itemId);
-
- // sort model
- int sortRole = VideoCollectionCommon::KeyDateTime;
- if (mIsService &&
- mVideoServices)
- {
- // TODO: sorting roles needs to be defined somewhere
- sortRole = mVideoServices->sortRole();
- switch (sortRole)
- {
- // sort by name
- case 2:
- {
- sortRole = VideoCollectionCommon::KeyTitle;
- break;
- }
- // sort by size
- case 3:
- {
- sortRole = VideoCollectionCommon::KeySizeValue;
- break;
- }
- // date & time
- case 1:
- // fall through
- default:
- {
- sortRole = VideoCollectionCommon::KeyDateTime;
- break;
- }
- }
- }
- model.doSorting(sortRole, Qt::AscendingOrder);
-
- // set hint level to collections
- setHintLevel(VideoHintWidget::Collection);
- }
- else
- {
- ERROR(-1, "VideoListView::activateVideosView() failed to get collection content widget.");
- err = -1;
- }
- break;
- }
- default:
- {
- // by default open videos view
- err = activateVideosView();
- break;
- }
+ // only downloads and captured are supported in default collections
+ ERROR(-1, "VideoListView::activateVideosView() invalid defauld collection.");
+ return -1;
}
-
+ }
+ // at this point activation will fail if there's no collection name available
+ if(mCollectionName.isEmpty())
+ {
+ ERROR(-1, "VideoListView::activateVideosView() no collection name, cannot proceed.");
+ return -1;
}
- else
+
+ // if current list at this point is already collection content,
+ // no need to init again, just activate
+ if(mCurrentList &&
+ (mCurrentList->getLevel() == VideoCollectionCommon::ELevelDefaultColl ||
+ mCurrentList->getLevel() == VideoCollectionCommon::ELevelAlbum))
{
- // open videos view
- err = activateVideosView();
+
+ return mCurrentList->activate();
+ }
+ // no currentlist, or currentlist differs, create and initialize all over
+ collectionOpenedSlot(true, mCollectionName, itemId);
+
+ if((!mCurrentList || !mCurrentList->getModel()) ||
+ (mCurrentList->getLevel() != VideoCollectionCommon::ELevelDefaultColl &&
+ mCurrentList->getLevel() != VideoCollectionCommon::ELevelAlbum ))
+ {
+ ERROR(-1, "VideoListView::activateVideosView() failed to init and activate collection.");
+ return -1;
}
- return err;
+ // if we're servicing, need to fetch sorting role from client
+ // in normal use, sorting has set already at uiloader
+
+ if (mVideoServices)
+ {
+ // TODO: service sorting roles needs to be defined somewhere
+ int sortRole = mVideoServices->sortRole();
+ if(sortRole == 2)
+ {
+ sortRole = VideoCollectionCommon::KeyTitle;
+ }
+ else if(sortRole == 3)
+ {
+ sortRole = VideoCollectionCommon::KeySizeValue;
+ }
+ else
+ {
+ // default
+ sortRole = VideoCollectionCommon::KeyDateTime;
+ }
+ mCurrentList->getModel()->doSorting(sortRole, Qt::AscendingOrder);
+ }
+
+ return 0;
}
// ---------------------------------------------------------------------------
@@ -823,11 +867,10 @@
mCurrentList = videoListWidget;
mCurrentList->activate(VideoCollectionCommon::ELevelVideos);
- // since collection is not to be opened at this point,
- // we do not receive lauoutChanged for updating the hind -widget
- // if needed, need to show it here is needed
setHintLevel(VideoHintWidget::AllVideos);
- showHint();
+
+ // update the sublabel, as in most cases the data is already up to date.
+ updateSubLabel();
}
}
@@ -850,44 +893,13 @@
// activate video collection widget
mCurrentList = collectionWidget;
- mCurrentList->activate(VideoCollectionCommon::ELevelCategory);
-
- VideoSortFilterProxyModel &model = mCurrentList->getModel();
-
- VideoCollectionViewUtils::sortModel(&model, false, mCurrentList->getLevel());
-
- // the collection view is not empty, so we can hide the hint in advance.
- showHint(false);
- }
-}
+ mCurrentList->activate(VideoCollectionCommon::ELevelCategory);
-// ---------------------------------------------------------------------------
-// openNewAlbumSlot()
-// ---------------------------------------------------------------------------
-//
-void VideoListView::openNewAlbumSlot(const QModelIndex &parent,
- int start,
- int end)
-{
- FUNC_LOG;
- Q_UNUSED(end);
- if(!mCurrentList)
- {
- return;
- }
- // invalidate model
- VideoSortFilterProxyModel &model = mCurrentList->getModel();
- model.invalidate();
+ // the collection view is not empty, so we should hide the hint in advance.
+ showHint(false);
- // activate new index
- QModelIndex index = model.index(start, 0, parent);
- if (index.isValid())
- {
- // disconnect rowsInserted signal to prevent obsolete slot calls
- disconnect( &model, SIGNAL(rowsInserted(const QModelIndex&, int, int)),
- this, SLOT(openNewAlbumSlot(const QModelIndex&, int, int)));
-
- mCurrentList->emitActivated(index);
+ // also update the sublabel immediatelly, as the data is up to date almost always.
+ updateSubLabel();
}
}
@@ -934,22 +946,40 @@
void VideoListView::doSorting(int role)
{
FUNC_LOG;
+ if(!mCurrentList || !mCurrentList->getModel())
+ {
+ // no list or model, cannot sort
+ return;
+ }
// sort model
Qt::SortOrder order(Qt::AscendingOrder);
- VideoSortFilterProxyModel &model = mCurrentList->getModel();
- if(model.sortRole() == role && model.sortOrder() == Qt::AscendingOrder)
+ VideoSortFilterProxyModel *model = mCurrentList->getModel();
+ if(model->sortRole() == role && model->sortOrder() == Qt::AscendingOrder)
{
order = Qt::DescendingOrder;
}
- model.doSorting(role, order);
-
- if (mCurrentList == mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_COLLECTIONCONTENTWIDGET))
+ model->doSorting(role, order);
+
+ // for video related sorting, all videos list and collection content
+ // list, sorting orders are same all the time
+ VideoListWidget *anotherVideosList = 0;
+ VideoCollectionCommon::TCollectionLevels level = mCurrentList->getLevel();
+ if (level == VideoCollectionCommon::ELevelDefaultColl ||
+ level == VideoCollectionCommon::ELevelAlbum)
{
- mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_VIDEOLISTWIDGET)->getModel().doSorting(role, order);
+ anotherVideosList = mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_VIDEOLISTWIDGET);
}
+ else if(level == VideoCollectionCommon::ELevelVideos)
+ {
+ anotherVideosList = mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_COLLECTIONCONTENTWIDGET);
+ }
+ if(anotherVideosList && anotherVideosList->getModel())
+ {
+ anotherVideosList->getModel()->doSorting(role, order);
+ }
// save sorting values only if the application is not started as a service
- if (!mIsService)
+ if (!mVideoServices)
{
// save sorting values
mUiUtils.saveSortingValues(role, order, mCurrentList->getLevel());
@@ -989,17 +1019,13 @@
void VideoListView::deleteItemsSlot()
{
FUNC_LOG;
- if(!mCurrentList)
- {
- return;
- }
VideoListSelectionDialog *dialog =
mUiLoader->findWidget<VideoListSelectionDialog>(
DOCML_NAME_DIALOG);
if (dialog)
{
- TMPXItemId collectionId = mCurrentList->getModel().getOpenItem();
+ TMPXItemId collectionId = mCurrentList->getModel()->getOpenItem();
dialog->setupContent(VideoListSelectionDialog::EDeleteVideos, collectionId);
dialog->exec();
}
@@ -1012,53 +1038,18 @@
void VideoListView::createCollectionSlot()
{
FUNC_LOG;
- if(!mCurrentList)
+
+ VideoListSelectionDialog *dialog =
+ mUiLoader->findWidget<VideoListSelectionDialog>(
+ DOCML_NAME_DIALOG);
+ if (!dialog)
{
+ // fatal: no selection dialog
return;
}
- // query a name for the collection
- QString label(hbTrId("txt_videos_title_enter_name"));
- QString text(hbTrId("txt_videos_dialog_entry_new_collection"));
-
- HbInputDialog *dialog = new HbInputDialog();
- dialog->setAttribute(Qt::WA_DeleteOnClose);
- dialog->getText(label, this, SLOT(createCollectionDialogFinished(HbAction *)), text);
-}
-
-// -------------------------------------------------------------------------------------------------
-// createCollectionDialogFinished
-// -------------------------------------------------------------------------------------------------
-//
-void VideoListView::createCollectionDialogFinished(HbAction *action)
-{
- FUNC_LOG;
- Q_UNUSED(action);
-
- HbInputDialog *dialog = static_cast<HbInputDialog*>(sender());
-
- QVariant variant = dialog->value();
-
- if(dialog->actions().first() == action && variant.isValid())
- {
- VideoSortFilterProxyModel &model = mCurrentList->getModel();
-
- // resolve collection true name and add new album
- QString text = model.resolveAlbumName(variant.toString());
-
- if(text.length())
- {
- // when collection reports about new collection, we open it right away,
- // for that, connect to rowsInserted so that the new album can be opened
- if(!connect(&model, SIGNAL(rowsInserted(const QModelIndex&, int, int)),
- this, SLOT(openNewAlbumSlot(const QModelIndex&, int, int))))
- {
- return;
- }
-
- model.addNewAlbum(text);
- }
- }
+ dialog->setupContent(VideoListSelectionDialog::ECreateCollection, TMPXItemId::InvalidId());
+ dialog->exec();
}
// -------------------------------------------------------------------------------------------------
@@ -1068,7 +1059,7 @@
void VideoListView::addVideosToCollectionSlot()
{
FUNC_LOG;
- if(!mCurrentList)
+ if(!mCurrentList || !mCurrentList->getModel())
{
return;
}
@@ -1087,10 +1078,10 @@
// of videos than all videos view.
VideoListWidget *allVideos = mUiLoader->findWidget<VideoListWidget>(
DOCML_NAME_VC_VIDEOLISTWIDGET);
- if(allVideos)
+ if(allVideos && allVideos->getModel())
{
- int count = allVideos->getModel().rowCount();
- if(count == mCurrentList->getModel().rowCount())
+ int count = allVideos->getModel()->rowCount();
+ if(count == mCurrentList->getModel()->rowCount())
{
if(count)
{
@@ -1103,7 +1094,7 @@
}
}
}
- TMPXItemId collectionId = mCurrentList->getModel().getOpenItem();
+ TMPXItemId collectionId = mCurrentList->getModel()->getOpenItem();
dialog->setupContent(VideoListSelectionDialog::EAddToCollection, collectionId);
dialog->exec();
}
@@ -1115,14 +1106,14 @@
void VideoListView::removeVideosFromCollectionSlot()
{
FUNC_LOG;
- if(!mCurrentList)
+ if(!mCurrentList || !mCurrentList->getModel())
{
return;
}
// not allowed if for some reason current widget
// is all videos or collection or there are no items
if(mCurrentList->getLevel() < VideoCollectionCommon::ELevelDefaultColl ||
- !mCurrentList->getModel().rowCount())
+ !mCurrentList->getModel()->rowCount())
{
return;
}
@@ -1135,7 +1126,7 @@
ERROR(-1, "VideoListView::removeVideosFromCollectionSlot() failed to load selection dialog.");
return;
}
- TMPXItemId collectionId = mCurrentList->getModel().getOpenItem();
+ TMPXItemId collectionId = mCurrentList->getModel()->getOpenItem();
if(collectionId != TMPXItemId::InvalidId() && collectionId.iId2 != KVcxMvcMediaTypeVideo)
{
dialog->setupContent(VideoListSelectionDialog::ERemoveFromCollection, collectionId);
@@ -1149,8 +1140,7 @@
//
void VideoListView::aboutToShowMainMenuSlot()
{
- if (mIsService &&
- mVideoServices &&
+ if (mVideoServices &&
mVideoServices->currentService() == VideoServices::EBrowse)
{
prepareBrowseServiceMenu();
@@ -1174,8 +1164,8 @@
showAction(false, DOCML_NAME_SORT_BY_SIZE);
showAction(false, DOCML_NAME_SORT_MENU);
- VideoSortFilterProxyModel &model = mCurrentList->getModel();
- if (!model.rowCount())
+ VideoSortFilterProxyModel *model = mCurrentList->getModel();
+ if (!model || !model->rowCount())
{
return;
}
@@ -1183,7 +1173,7 @@
// get current sorting values
int role;
Qt::SortOrder order;
- model.getSorting(role, order);
+ model->getSorting(role, order);
HbAction *firstAction = (HbAction*)(toolBar()->actions().first());
@@ -1202,7 +1192,7 @@
action->setChecked(true);
}
- if (!mIsService)
+ if (!mVideoServices)
{
showAction(true, DOCML_NAME_ADD_TO_COLLECTION);
showAction(true, DOCML_NAME_DELETE_MULTIPLE);
@@ -1211,7 +1201,7 @@
else if(mToolbarViewsActionGroup->checkedAction() == mToolbarActions[ETBActionCollections] &&
firstAction == mToolbarActions[ETBActionAllVideos] )
{
- if (!mIsService)
+ if (!mVideoServices)
{
showAction(true, DOCML_NAME_CREATE_COLLECTION);
}
@@ -1238,7 +1228,7 @@
action->setChecked(true);
}
- if (!mIsService)
+ if (!mVideoServices)
{
showAction(true, DOCML_NAME_DELETE_MULTIPLE);
}
@@ -1266,8 +1256,8 @@
showAction(false, DOCML_NAME_SORT_BY_SIZE);
showAction(false, DOCML_NAME_SORT_MENU);
- VideoSortFilterProxyModel &model = mCurrentList->getModel();
- if (!model.rowCount())
+ VideoSortFilterProxyModel *model = mCurrentList->getModel();
+ if (!model || !model->rowCount())
{
return;
}
@@ -1284,7 +1274,7 @@
// set current sort action selected
int role;
Qt::SortOrder order;
- model.getSorting(role, order);
+ model->getSorting(role, order);
HbAction* action = mSortingRoles.key(role);
if (action)
{
@@ -1307,9 +1297,9 @@
// collectionOpenedSlot
// -------------------------------------------------------------------------------------------------
//
-void VideoListView::collectionOpenedSlot(bool collectionOpened,
+void VideoListView::collectionOpenedSlot(bool openingCollection,
const QString& collection,
- const QModelIndex &index)
+ const TMPXItemId &collectionId)
{
FUNC_LOG;
@@ -1331,27 +1321,24 @@
HbAbstractItemView::ItemAnimations animationState = collectionContentWidget->enabledAnimations();
collectionContentWidget->setEnabledAnimations(HbAbstractItemView::None);
- if(collectionOpened)
+ if(openingCollection)
{
// open album view
- if (!index.isValid() || !mCurrentList || mCurrentList == collectionContentWidget)
+ if (collectionId == TMPXItemId::InvalidId() || mCurrentList == collectionContentWidget)
{
// no currentlist or currentlist is already collection content -list
collectionContentWidget->setEnabledAnimations(animationState);
return;
}
-
- // get item id before deactivating
- TMPXItemId itemId = mCurrentList->getModel().getMediaIdAtIndex(index);
-
+
// get level from the item to be opened only default
// or user defined collections can be activated here
VideoCollectionCommon::TCollectionLevels level = VideoCollectionCommon::ELevelInvalid;
- if(itemId.iId2 == KVcxMvcMediaTypeCategory)
+ if(collectionId.iId2 == KVcxMvcMediaTypeCategory)
{
level = VideoCollectionCommon::ELevelDefaultColl;
}
- else if(itemId.iId2 == KVcxMvcMediaTypeAlbum)
+ else if(collectionId.iId2 == KVcxMvcMediaTypeAlbum)
{
level = VideoCollectionCommon::ELevelAlbum;
}
@@ -1362,10 +1349,20 @@
}
// Start fetching content before changing.
- collectionContentWidget->getModel().openItem(itemId);
+ VideoSortFilterProxyModel *model = collectionContentWidget->getModel();
+ if(!model)
+ {
+ // no model for content widget, cannot activate
+ collectionContentWidget->setEnabledAnimations(animationState);
+ return;
+ }
+ model->openItem(collectionId);
// deactivat current widget.
- mCurrentList->deactivate();
+ if(mCurrentList)
+ {
+ mCurrentList->deactivate();
+ }
// activate video collection content widget and set it as current list.
mCurrentList = collectionContentWidget;
@@ -1373,14 +1370,11 @@
updateSubLabel();
- // setup correct sorting, collection content contains always a list of videos so we use
- // ELevelVideos as target for sorting
- VideoCollectionViewUtils::sortModel(&mCurrentList->getModel(), false, VideoCollectionCommon::ELevelVideos);
- mCurrentList->getModel().invalidate();
+ model->invalidate();
// update hint widget for correct content
+ mModelReady = model->rowCount() > 0;
setHintLevel(VideoHintWidget::Collection);
- showHint();
// update toolbar for albums, default categories don't have one.
if(level == VideoCollectionCommon::ELevelAlbum &&
@@ -1404,7 +1398,11 @@
}
// restore animations for collection content widget
collectionContentWidget->setEnabledAnimations(animationState);
-
+ if(!mVideoServices)
+ {
+ // save / clear collection related activity data
+ VideoCollectionViewUtils::setCollectionActivityData(collectionId, collection);
+ }
}
// -------------------------------------------------------------------------------------------------
@@ -1417,24 +1415,37 @@
if (name.compare(DOCML_NAME_VC_VIDEOLISTWIDGET) == 0)
{
connect(object, SIGNAL(command(int)), this, SIGNAL(command(int)));
- connect(this, SIGNAL(doDelayeds()), object, SLOT(doDelayedsSlot()));
+ if(mCurrentList != object)
+ {
+ // this widget not yet activated so it's has been created on the second phase
+ // safe to call doDelayed right away
+ qobject_cast<VideoListWidget*>(object)->doDelayedsSlot();
+ }
}
else if (name.compare(DOCML_NAME_VC_COLLECTIONWIDGET) == 0)
{
connect(
- object, SIGNAL(collectionOpened(bool, const QString&, const QModelIndex&)),
- this, SLOT(collectionOpenedSlot(bool, const QString&, const QModelIndex&)));
- connect(this, SIGNAL(doDelayeds()), object, SLOT(doDelayedsSlot()));
- emit(doDelayeds());
+ object, SIGNAL(collectionOpened(bool, const QString&, const TMPXItemId&)),
+ this, SLOT(collectionOpenedSlot(bool, const QString&, const TMPXItemId&)));
+ if(mCurrentList != object)
+ {
+ // this widget not yet activated so it's has been created on the second phase
+ // safe to call doDelayed right away
+ qobject_cast<VideoListWidget*>(object)->doDelayedsSlot();
+ }
}
else if (name.compare(DOCML_NAME_VC_COLLECTIONCONTENTWIDGET) == 0)
{
connect(object, SIGNAL(command(int)), this, SIGNAL(command(int)));
connect(
- object, SIGNAL(collectionOpened(bool, const QString&, const QModelIndex&)),
- this, SLOT(collectionOpenedSlot(bool, const QString&, const QModelIndex&)));
- connect(this, SIGNAL(doDelayeds()), object, SLOT(doDelayedsSlot()));
- emit(doDelayeds());
+ object, SIGNAL(collectionOpened(bool, const QString&, const TMPXItemId&)),
+ this, SLOT(collectionOpenedSlot(bool, const QString&, const TMPXItemId&)));
+ if(mCurrentList != object)
+ {
+ // this widget not yet activated so it's has been created on the second phase
+ // safe to call doDelayed right away
+ qobject_cast<VideoListWidget*>(object)->doDelayedsSlot();
+ }
}
else if (name.compare(DOCML_NAME_OPTIONS_MENU) == 0)
{
@@ -1514,5 +1525,4 @@
HbMessageBox::information(tr("Not implemented yet"));
}
-// end of file
-
+// End of file
--- a/videocollection/videocollectionview/src/videolistwidget.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionview/src/videolistwidget.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -18,6 +18,7 @@
#include "videocollectiontrace.h"
#include "videolistwidget.h"
+#include <xqserviceutil.h>
#include <qcoreapplication.h>
#include <qtimer.h>
#include <hbscrollbar.h>
@@ -34,12 +35,28 @@
#include "videocollectionviewutils.h"
#include "videocollectionuiloader.h"
#include "videolistselectiondialog.h"
-#include "videoservices.h"
#include "videothumbnaildata.h"
#include "videosortfilterproxymodel.h"
#include "videocollectioncommon.h"
#include "mpxhbvideocommondefs.h"
+// Object names.
+const char* const LIST_WIDGET_OBJECT_NAME_CONTEXT_MENU = "vc:ListWidgetContextMenu";
+const char* const LIST_WIDGET_OBJECT_NAME_DELETE_VIDEO = "vc:ListWidgetMessageBoxDeleteVideo";
+const char* const LIST_WIDGET_OBJECT_NAME_RENAME_VIDEO = "vc:ListWidgetInputDialogRenameVideo";
+const char* const LIST_WIDGET_OBJECT_NAME_REMOVE_COLLECTION = "vc:ListWidgetMessageBoxRemoveCollection";
+const char* const LIST_WIDGET_OBJECT_NAME_NAV_KEY_BACK = "vc:ListWidgetNavKeyBack";
+const char* const LIST_WIDGET_OBJECT_NAME_NAV_KEY_QUIT = "vc:ListWidgetNavKeyQuit";
+const char* const LIST_WIDGET_OBJECT_NAME_ACTION_ATTACH = "vc:ListWidgetActionAttach";
+const char* const LIST_WIDGET_OBJECT_NAME_ACTION_PLAY = "vc:ListWidgetActionPlay";
+const char* const LIST_WIDGET_OBJECT_NAME_ACTION_DETAILS = "vc:ListWidgetActionDetails";
+const char* const LIST_WIDGET_OBJECT_NAME_ACTION_DELETE = "vc:ListWidgetActionDelete";
+const char* const LIST_WIDGET_OBJECT_NAME_ACTION_OPEN = "vc:ListWidgetActionOpen";
+const char* const LIST_WIDGET_OBJECT_NAME_ACTION_ADD_TO = "vc:ListWidgetActionAddToCollection";
+const char* const LIST_WIDGET_OBJECT_NAME_ACTION_REMOVE_FROM = "vc:ListWidgetActionRemoveFromCollection";
+const char* const LIST_WIDGET_OBJECT_NAME_ACTION_RENAME = "vc:ListWidgetActionRename";
+const char* const LIST_WIDGET_OBJECT_NAME_ACTION_REMOVE_COLLECTION = "vc:ListWidgetActionRemoveCollection";
+
// Interval in ms to report the scroll position.
const int SCROLL_POSITION_TIMER_TIMEOUT = 100;
@@ -53,12 +70,12 @@
mVideoServices(0),
mCurrentLevel(VideoCollectionCommon::ELevelInvalid),
mSignalsConnected(false),
-mIsService(false),
mNavKeyAction(0),
mContextMenu(0),
mSelectionMode(HbAbstractItemView::NoSelection),
mScrollPositionTimer(0),
-mUiLoader(uiLoader)
+mUiLoader(uiLoader),
+mService(VideoServices::ENoService)
{
FUNC_LOG_ADDR(this);
}
@@ -78,23 +95,49 @@
mContextMenu = 0;
delete mNavKeyAction;
mNavKeyAction = 0;
+
+ if(mVideoServices)
+ {
+ mVideoServices->decreaseReferenceCount();
+ mVideoServices = 0;
+ }
}
// ---------------------------------------------------------------------------
// initialize
// ---------------------------------------------------------------------------
//
-int VideoListWidget::initialize(VideoSortFilterProxyModel &model, VideoServices* videoServices)
+int VideoListWidget::initialize(VideoSortFilterProxyModel &model,
+ bool isService,
+ VideoCollectionCommon::TCollectionLevels level)
{
FUNC_LOG_ADDR(this);
- mModel = &model;
-
- mVideoServices = videoServices;
+ mModel = &model;
+ mCurrentLevel = level;
- if(mVideoServices)
+ if(isService)
{
- mIsService = true;
+ if(!mVideoServices)
+ {
+ mVideoServices = VideoServices::instance();
+ }
+ if(XQServiceUtil::interfaceName().contains("IVideoFetch"))
+ {
+ mService = VideoServices::EUriFetcher;
+ }
+ else if (XQServiceUtil::interfaceName().contains("IVideoBrowse"))
+ {
+ mService = VideoServices::EBrowse;
+ }
}
+ else
+ {
+ if(mVideoServices)
+ {
+ mVideoServices->decreaseReferenceCount();
+ mVideoServices = 0;
+ }
+ }
// init list view
VideoCollectionViewUtils::initListView(this);
@@ -102,7 +145,7 @@
mScrollPositionTimer = new QTimer();
mScrollPositionTimer->setSingleShot(true);
- if (mIsService)
+ if (mVideoServices)
{
connect(this, SIGNAL(fileUri(const QString&)), mVideoServices, SLOT(itemSelected(const QString&)));
}
@@ -131,7 +174,7 @@
FUNC_LOG_ADDR(this);
INFO_2("VideoListWidget::activate() [0x%x]: level: %d", this, level);
- if(!mModel)
+ if(!mModel || level == VideoCollectionCommon::ELevelInvalid)
{
return -1;
}
@@ -201,42 +244,52 @@
{
FUNC_LOG_ADDR(this);
- int retval(0);
-
- if (!mSignalsConnected)
+ if (mSignalsConnected)
+ {
+ return 0;
+ }
+
+ if(!connect(this, SIGNAL(scrollingStarted()), this, SLOT(scrollingStartedSlot())) ||
+ !connect(this, SIGNAL(scrollingEnded()), this, SLOT(scrollingEndedSlot())) ||
+ !connect(this, SIGNAL(scrollPositionChanged(const QPointF &)),
+ this, SLOT(scrollPositionChangedSlot(const QPointF &))) ||
+ !connect(mScrollPositionTimer, SIGNAL(timeout()), this, SLOT(scrollPositionTimerSlot())) ||
+ !connect(this, SIGNAL(longPressed(HbAbstractViewItem *, const QPointF &)),
+ this, SLOT(longPressedSlot(HbAbstractViewItem *, const QPointF &))))
{
- if(!connect(this, SIGNAL(scrollingStarted()), this, SLOT(scrollingStartedSlot())) ||
- !connect(this, SIGNAL(scrollingEnded()), this, SLOT(scrollingEndedSlot())) ||
- !connect(this, SIGNAL(scrollPositionChanged(const QPointF &)),
- this, SLOT(scrollPositionChangedSlot(const QPointF &))) ||
- !connect(mScrollPositionTimer, SIGNAL(timeout()), this, SLOT(scrollPositionTimerSlot())) ||
- !connect(this, SIGNAL(longPressed(HbAbstractViewItem *, const QPointF &)),
- this, SLOT(longPressedSlot(HbAbstractViewItem *, const QPointF &))))
- {
- return -1;
- }
+ return -1;
+ }
- if (!isBrowsingService())
+ // handle navi key trigger -signal connection
+ const char *slot = SLOT(quit());
+ QObject *receiver = qApp;
+
+ if(mVideoServices && mService == VideoServices::EBrowse)
+ {
+ receiver = mVideoServices;
+ slot = SLOT(browsingEnded());
+ }
+ else
+ {
+ if(mCurrentLevel == VideoCollectionCommon::ELevelAlbum ||
+ mCurrentLevel == VideoCollectionCommon::ELevelDefaultColl)
{
- if(VideoCollectionCommon::EModelTypeCollectionContent == mModel->getType())
- {
- if (!connect(mNavKeyAction, SIGNAL(triggered()), this, SLOT(back())))
- {
- retval = -1;
- }
- }
- else
- {
- if (!connect(mNavKeyAction, SIGNAL(triggered()), qApp, SLOT(quit())))
- {
- retval = -1;
- }
- }
+ receiver = this;
+ slot = SLOT(back());
+ }
+ else if(mVideoServices && mService == VideoServices::EUriFetcher)
+ {
+ receiver = this;
+ slot = SLOT(endVideoFecthingSlot());
}
-
- mSignalsConnected = true;
}
- return retval;
+ if(!connect(mNavKeyAction, SIGNAL(triggered()), receiver, slot))
+ {
+ return -1;
+ }
+ mSignalsConnected = true;
+
+ return 0;
}
// ---------------------------------------------------------------------------
@@ -267,56 +320,15 @@
mScrollPositionTimer, SIGNAL(timeout()),
this, SLOT(scrollPositionTimerSlot()));
}
-
- // check that model and navigation action exists
- if (!isBrowsingService())
+ if(mNavKeyAction)
{
- if (mModel &&
- mModel->getType() == VideoCollectionCommon::EModelTypeCollectionContent)
- {
- if (mNavKeyAction)
- {
- disconnect(
- mNavKeyAction, SIGNAL(triggered()),
- this, SLOT(back()));
- }
- }
- else
- {
- if (mNavKeyAction)
- {
- disconnect(
- mNavKeyAction, SIGNAL(triggered()),
- qApp, SLOT(quit()));
- }
- }
+ mNavKeyAction->disconnect(SIGNAL(triggered()));
}
mSignalsConnected = false;
}
// ---------------------------------------------------------------------------
-// isBrowsingService
-// ---------------------------------------------------------------------------
-//
-bool VideoListWidget::isBrowsingService() const
-{
- FUNC_LOG_ADDR(this);
-
- bool isBrowsingService = false;
-
- if (mIsService &&
- mVideoServices &&
- mVideoServices->currentService() == VideoServices::EBrowse)
- {
- isBrowsingService = true;
- }
-
- return isBrowsingService;
-
-}
-
-// ---------------------------------------------------------------------------
// setNavigationAction
// ---------------------------------------------------------------------------
//
@@ -327,27 +339,16 @@
// Create navigation action if not already created
if (!mNavKeyAction)
{
- if (isBrowsingService())
+ Hb::NavigationAction navAction = Hb::QuitNaviAction;
+ QString objectName = LIST_WIDGET_OBJECT_NAME_NAV_KEY_QUIT;
+ if(mCurrentLevel == VideoCollectionCommon::ELevelAlbum ||
+ mCurrentLevel == VideoCollectionCommon::ELevelDefaultColl)
{
- mNavKeyAction = new HbAction(Hb::QuitNaviAction);
- if (mNavKeyAction)
- {
- connect(
- mNavKeyAction, SIGNAL(triggered()),
- mVideoServices, SLOT(browsingEnded()));
- }
+ navAction = Hb::BackNaviAction;
+ objectName = LIST_WIDGET_OBJECT_NAME_NAV_KEY_BACK;
}
- else if (mModel)
- {
- if (VideoCollectionCommon::EModelTypeCollectionContent == mModel->getType())
- {
- mNavKeyAction = new HbAction(Hb::BackNaviAction);
- }
- else
- {
- mNavKeyAction = new HbAction(Hb::QuitNaviAction);
- }
- }
+ mNavKeyAction = new HbAction(navAction);
+ mNavKeyAction->setObjectName(LIST_WIDGET_OBJECT_NAME_NAV_KEY_BACK);
}
// Set navigation action only when widget is not in selection mode
@@ -384,6 +385,7 @@
HbMessageBox *messageBox = new HbMessageBox(text, HbMessageBox::MessageTypeQuestion);
messageBox->setAttribute(Qt::WA_DeleteOnClose);
+ messageBox->setObjectName(LIST_WIDGET_OBJECT_NAME_DELETE_VIDEO);
messageBox->open(this, SLOT(deleteItemDialogFinished(HbAction *)));
}
}
@@ -420,54 +422,74 @@
}
mContextMenu = new HbMenu();
- if (mContextMenu)
+ mContextMenu->setDismissPolicy(HbPopup::TapAnywhere);
+ mContextMenu->setObjectName(LIST_WIDGET_OBJECT_NAME_CONTEXT_MENU);
+
+ if (mService == VideoServices::EUriFetcher)
{
- mContextMenu->setDismissPolicy(HbPopup::TapAnywhere);
+ mContextMenuActions[EActionAttach] =
+ mContextMenu->addAction(hbTrId("txt_videos_menu_attach"), this, SLOT(openItemSlot()));
+ mContextMenuActions[EActionAttach]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_ATTACH);
+
+ mContextMenuActions[EActionOpen] =
+ mContextMenu->addAction(hbTrId("txt_common_menu_open"), this, SLOT(openItemSlot()));
+ mContextMenuActions[EActionOpen]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_OPEN);
- VideoServices::TVideoService service = VideoServices::ENoService;
- if (mIsService &&
- mVideoServices)
- {
- service = mVideoServices->currentService();
- }
+ mContextMenuActions[EActionPlay] =
+ mContextMenu->addAction(hbTrId("txt_videos_menu_play"), this, SLOT(playItemSlot()));
+ mContextMenuActions[EActionPlay]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_PLAY);
+
+ mContextMenuActions[EActionDetails] =
+ mContextMenu->addAction(hbTrId("txt_common_menu_details"), this, SLOT(openDetailsSlot()));
+ mContextMenuActions[EActionDetails]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_DETAILS);
+ }
+ else if (mService == VideoServices::EBrowse)
+ {
+ mContextMenuActions[EActionPlay] =
+ mContextMenu->addAction(hbTrId("txt_videos_menu_play"), this, SLOT(playItemSlot()));
+ mContextMenuActions[EActionPlay]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_PLAY);
+
+ mContextMenuActions[EActionDelete] =
+ mContextMenu->addAction(hbTrId("txt_common_menu_delete"), this, SLOT(deleteItemSlot()));
+ mContextMenuActions[EActionDelete]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_DELETE);
- if (service == VideoServices::EUriFetcher)
- {
- mContextMenuActions[EActionAttach] =
- mContextMenu->addAction(hbTrId("txt_videos_menu_attach"), this, SLOT(openItemSlot()));
- mContextMenuActions[EActionPlay] =
- mContextMenu->addAction(hbTrId("txt_videos_menu_play"), this, SLOT(playItemSlot()));
- mContextMenuActions[EActionDetails] =
- mContextMenu->addAction(hbTrId("txt_common_menu_details"), this, SLOT(openDetailsSlot()));
- }
- else if (service == VideoServices::EBrowse)
- {
- mContextMenuActions[EActionPlay] =
- mContextMenu->addAction(hbTrId("txt_videos_menu_play"), this, SLOT(playItemSlot()));
- mContextMenuActions[EActionDelete] =
- mContextMenu->addAction(hbTrId("txt_common_menu_delete"), this, SLOT(deleteItemSlot()));
- mContextMenuActions[EActionDetails] =
- mContextMenu->addAction(hbTrId("txt_common_menu_details"), this, SLOT(openDetailsSlot()));
- }
- else
- {
- mContextMenuActions[EActionPlay] =
- mContextMenu->addAction(hbTrId("txt_videos_menu_play"), this, SLOT(playItemSlot()));
- mContextMenuActions[EActionOpen] =
- mContextMenu->addAction(hbTrId("txt_common_menu_open"), this, SLOT(openItemSlot()));
- mContextMenuActions[EActionAddToCollection] =
- mContextMenu->addAction(hbTrId("txt_videos_menu_add_to_collection"), this, SLOT(addToCollectionSlot()));
- mContextMenuActions[EActionRemove] =
- mContextMenu->addAction(hbTrId("txt_videos_menu_remove_from_collection"), this, SLOT(removeFromCollectionSlot()));
- mContextMenuActions[EActionRename] =
- mContextMenu->addAction(hbTrId("txt_common_menu_rename_item"), this, SLOT(renameSlot()));
- mContextMenuActions[EActionRemoveCollection] =
- mContextMenu->addAction(hbTrId("txt_videos_menu_remove_collection"), this, SLOT(removeCollectionSlot()));
- mContextMenuActions[EActionDelete] =
- mContextMenu->addAction(hbTrId("txt_common_menu_delete"), this, SLOT(deleteItemSlot()));
- mContextMenuActions[EActionDetails] =
- mContextMenu->addAction(hbTrId("txt_common_menu_details"), this, SLOT(openDetailsSlot()));
- }
+ mContextMenuActions[EActionDetails] =
+ mContextMenu->addAction(hbTrId("txt_common_menu_details"), this, SLOT(openDetailsSlot()));
+ mContextMenuActions[EActionDetails]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_DETAILS);
+ }
+ else
+ {
+ mContextMenuActions[EActionPlay] =
+ mContextMenu->addAction(hbTrId("txt_videos_menu_play"), this, SLOT(playItemSlot()));
+ mContextMenuActions[EActionPlay]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_PLAY);
+
+ mContextMenuActions[EActionOpen] =
+ mContextMenu->addAction(hbTrId("txt_common_menu_open"), this, SLOT(openItemSlot()));
+ mContextMenuActions[EActionOpen]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_OPEN);
+
+ mContextMenuActions[EActionAddToCollection] =
+ mContextMenu->addAction(hbTrId("txt_videos_menu_add_to_collection"), this, SLOT(addToCollectionSlot()));
+ mContextMenuActions[EActionAddToCollection]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_ADD_TO);
+
+ mContextMenuActions[EActionRemove] =
+ mContextMenu->addAction(hbTrId("txt_videos_menu_remove_from_collection"), this, SLOT(removeFromCollectionSlot()));
+ mContextMenuActions[EActionRemove]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_REMOVE_FROM);
+
+ mContextMenuActions[EActionRename] =
+ mContextMenu->addAction(hbTrId("txt_common_menu_rename_item"), this, SLOT(renameSlot()));
+ mContextMenuActions[EActionRename]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_RENAME);
+
+ mContextMenuActions[EActionRemoveCollection] =
+ mContextMenu->addAction(hbTrId("txt_videos_menu_remove_collection"), this, SLOT(removeCollectionSlot()));
+ mContextMenuActions[EActionRemoveCollection]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_REMOVE_COLLECTION);
+
+ mContextMenuActions[EActionDelete] =
+ mContextMenu->addAction(hbTrId("txt_common_menu_delete"), this, SLOT(deleteItemSlot()));
+ mContextMenuActions[EActionDelete]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_DELETE);
+
+ mContextMenuActions[EActionDetails] =
+ mContextMenu->addAction(hbTrId("txt_common_menu_details"), this, SLOT(openDetailsSlot()));
+ mContextMenuActions[EActionDetails]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_DETAILS);
}
}
@@ -508,23 +530,17 @@
return;
}
- if (isBrowsingService())
+ if (mVideoServices)
{
- setBrowsingServiceContextMenu();
+ setServiceContextMenu();
return;
}
-
if(mCurrentLevel == VideoCollectionCommon::ELevelVideos ||
mCurrentLevel == VideoCollectionCommon::ELevelDefaultColl)
{
- if (!mIsService)
- {
- mContextMenuActions[EActionAddToCollection]->setVisible(true);
- mContextMenuActions[EActionDelete]->setVisible(true);
- } else {
- mContextMenuActions[EActionAttach]->setVisible(true);
- }
+ mContextMenuActions[EActionAddToCollection]->setVisible(true);
+ mContextMenuActions[EActionDelete]->setVisible(true);
mContextMenuActions[EActionPlay]->setVisible(true);
mContextMenuActions[EActionDetails]->setVisible(true);
}
@@ -532,7 +548,7 @@
{
mContextMenuActions[EActionOpen]->setVisible(true);
TMPXItemId mpxId = mModel->getMediaIdAtIndex(currentIndex());
- if(!mIsService && mpxId.iId2 == KVcxMvcMediaTypeAlbum)
+ if(mpxId.iId2 == KVcxMvcMediaTypeAlbum)
{
mContextMenuActions[EActionRename]->setVisible(true);
mContextMenuActions[EActionRemoveCollection]->setVisible(true);
@@ -540,38 +556,48 @@
}
else if(mCurrentLevel == VideoCollectionCommon::ELevelAlbum)
{
- if (!mIsService)
- {
- mContextMenuActions[EActionRemove]->setVisible(true);
- mContextMenuActions[EActionDelete]->setVisible(true);
- } else {
- mContextMenuActions[EActionAttach]->setVisible(true);
- }
+ mContextMenuActions[EActionRemove]->setVisible(true);
+ mContextMenuActions[EActionDelete]->setVisible(true);
mContextMenuActions[EActionPlay]->setVisible(true);
mContextMenuActions[EActionDetails]->setVisible(true);
}
}
// ---------------------------------------------------------------------------
-// setBrowsingServiceContextMenu
+// setServiceContextMenu
// ---------------------------------------------------------------------------
//
-void VideoListWidget::setBrowsingServiceContextMenu()
+void VideoListWidget::setServiceContextMenu()
{
FUNC_LOG_ADDR(this);
- mContextMenuActions[EActionPlay]->setVisible(true);
- mContextMenuActions[EActionDelete]->setVisible(true);
- mContextMenuActions[EActionDetails]->setVisible(true);
+
+ if(mCurrentLevel == VideoCollectionCommon::ELevelCategory)
+ {
+ mContextMenuActions[EActionOpen]->setVisible(true);
+ }
+ else if(mCurrentLevel > VideoCollectionCommon::ELevelCategory)
+ {
+ mContextMenuActions[EActionDetails]->setVisible(true);
+ mContextMenuActions[EActionPlay]->setVisible(true);
+ if(mService == VideoServices::EBrowse)
+ {
+ mContextMenuActions[EActionDelete]->setVisible(true);
+ }
+ else if(mService == VideoServices::EUriFetcher)
+ {
+ mContextMenuActions[EActionAttach]->setVisible(true);
+ }
+ }
}
// ---------------------------------------------------------------------------
// getModel
// ---------------------------------------------------------------------------
//
-VideoSortFilterProxyModel& VideoListWidget::getModel()
+VideoSortFilterProxyModel* VideoListWidget::getModel()
{
FUNC_LOG_ADDR(this);
- return *mModel;
+ return mModel;
}
// ---------------------------------------------------------------------------
@@ -607,9 +633,8 @@
//
void VideoListWidget::doEmitActivated (const QModelIndex &index)
{
- if(mIsService &&
- mVideoServices &&
- mVideoServices->currentService() == VideoServices::EUriFetcher &&
+ if(mVideoServices &&
+ mService == VideoServices::EUriFetcher &&
mCurrentLevel != VideoCollectionCommon::ELevelCategory)
{
QVariant variant = mModel->data(index, VideoCollectionCommon::KeyFilePath);
@@ -645,7 +670,7 @@
// signal view that item has been activated
emit(collectionOpened(true,
variant.toString(),
- index));
+ mModel->getMediaIdAtIndex(index)));
}
return;
}
@@ -705,26 +730,6 @@
}
// ---------------------------------------------------------------------------
-// panGesture
-// ---------------------------------------------------------------------------
-//
-void VideoListWidget::panGesture(const QPointF &point)
-{
- FUNC_LOG_ADDR(this);
- if (mContextMenu)
- {
- if (!mContextMenu->isVisible())
- {
- HbListView::panGesture(point);
- }
- }
- else
- {
- HbListView::panGesture(point);
- }
-}
-
-// ---------------------------------------------------------------------------
// doDelayedsSlot
// ---------------------------------------------------------------------------
//
@@ -793,7 +798,10 @@
HbInputDialog *dialog = new HbInputDialog();
dialog->setAttribute(Qt::WA_DeleteOnClose);
- dialog->getText(label, this, SLOT(renameDialogFinished(HbAction *)), albumName);
+ dialog->setObjectName(LIST_WIDGET_OBJECT_NAME_RENAME_VIDEO);
+ dialog->setPromptText(label);
+ dialog->setValue(albumName);
+ dialog->open(this, SLOT(renameDialogFinished(HbAction *)));
}
}
@@ -893,6 +901,7 @@
variant.toString());
HbMessageBox *messageBox = new HbMessageBox(text, HbMessageBox::MessageTypeQuestion);
messageBox->setAttribute(Qt::WA_DeleteOnClose);
+ messageBox->setObjectName(LIST_WIDGET_OBJECT_NAME_REMOVE_COLLECTION);
messageBox->open(this, SLOT(removeCollectionDialogFinished(HbAction *)));
}
}
@@ -928,7 +937,20 @@
{
// Empty the proxy model causing the items to be removed from list widget.
mModel->setAlbumInUse(TMPXItemId::InvalidId());
- emit collectionOpened(false, QString(), QModelIndex());
+ emit collectionOpened(false, QString(), TMPXItemId::InvalidId());
+ }
+}
+
+// ---------------------------------------------------------------------------
+// endVideoFecthingSlot
+// ---------------------------------------------------------------------------
+//
+void VideoListWidget::endVideoFecthingSlot()
+{
+ if(mVideoServices && mService == VideoServices::EUriFetcher)
+ {
+ QString empty = "";
+ emit fileUri(empty);
}
}
--- a/videocollection/videocollectionview/tsrc/testcollectionview/src/testcollectionview.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionview/tsrc/testcollectionview/src/testcollectionview.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,6 +15,9 @@
*
*/
+#include "xqplugin.h"
+#include "xqserviceutilstub.h"
+#include "xqserviceproviderstub.h"
#include "xqserviceutilxtra.h"
#include <hbaction.h>
@@ -117,9 +120,9 @@
//
void TestCollectionView::cleanup()
{
- HbMainWindow *window = hbInstance->allMainWindows().value(0);
- if (window)
+ if(hbInstance->allMainWindows().count() > 0)
{
+ HbMainWindow *window = hbInstance->allMainWindows().at(0);
QList<HbView*> views = window->views();
int count = views.count();
for (int i = 0; i < count; i++)
--- a/videocollection/videocollectionview/tsrc/testhintwidget/inc/testhintwidget.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionview/tsrc/testhintwidget/inc/testhintwidget.h Thu Jul 22 16:34:17 2010 +0100
@@ -45,6 +45,7 @@
void testDeactivate();
void testUpdateUiComponents();
void testOrientationChangedSlot();
+ void testSetButtonShown();
signals:
--- a/videocollection/videocollectionview/tsrc/testhintwidget/src/testhintwidget.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionview/tsrc/testhintwidget/src/testhintwidget.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -203,19 +203,22 @@
mTestObject->mServiceIconString = QString();
mTestObject->activate();
QVERIFY(mTestObject->mServiceIcon == 0);
- QVERIFY(mTestObject->isVisible() == false);
- QVERIFY(mTestObject->mActivated == false);
+ 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() == false);
- QVERIFY(mTestObject->mActivated == false);
+ QVERIFY(mTestObject->isVisible() == true);
+ QVERIFY(mTestObject->mActivated == true);
// successful case.
- mTestObject->mServiceIconPressedString = "test2";
+ 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);
noVideosLabel->setVisible(false);
@@ -245,7 +248,6 @@
// when serviceButton does not exist
mTestObject->mServiceIcon = 0;
- mTestObject->mAddVideosIcon = 0;
HbDocumentLoader::mFindWidgetFails = true;
mTestObject->deactivate();
QVERIFY(mTestObject->mActivated == false);
@@ -266,17 +268,14 @@
// when icons are non-null, but widget is not activated.
mTestObject->setVisible(true);
mTestObject->mServiceIcon = new HbIcon;
- mTestObject->mAddVideosIcon = new HbIcon;
mTestObject->deactivate();
QVERIFY(mTestObject->mServiceIcon != 0);
- QVERIFY(mTestObject->mAddVideosIcon != 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->mAddVideosIcon == 0);
QVERIFY(mTestObject->isVisible() == false);
cleanup();
@@ -294,7 +293,6 @@
init(true);
mTestObject->mServiceIcon = new HbIcon(QIcon(QPixmap(QSize(100,100))));
- mTestObject->mAddVideosIcon = new HbIcon(QIcon(QPixmap(QSize(50,50))));
mTestObject->mActivated = true;
HbDocumentLoader::mFindWidgetFails = true;
@@ -318,9 +316,8 @@
mainWnd->setOrientation(Qt::Horizontal);
mTestObject->mButtonShown = true;
mTestObject->setLevel(VideoHintWidget::Collection);
- QVERIFY(serviceButton->isVisible());
+ QVERIFY(!serviceButton->isVisible());
QVERIFY(serviceButton->icon().isNull() == false);
- QVERIFY(serviceButton->icon().qicon().cacheKey() == mTestObject->mAddVideosIcon->qicon().cacheKey());
QVERIFY(hintLabel->isVisible() == false);
mTestObject->mButtonShown = false;
@@ -379,4 +376,28 @@
cleanup();
}
+// ---------------------------------------------------------------------------
+// testSetButtonShown
+// ---------------------------------------------------------------------------
+//
+void TestHintWidget::testSetButtonShown()
+{
+ HbMainWindow *mainWnd = hbInstance->allMainWindows()[0];
+
+ init(true);
+
+ HbLabel *noVideosLabel = mUiLoader->findWidget<HbLabel>(DOCML_NAME_NO_VIDEOS_LABEL);
+ QVERIFY(noVideosLabel);
+
+ mTestObject->mActivated = true;
+ noVideosLabel->setVisible(false);
+ mTestObject->setButtonShown(true);
+ QVERIFY(noVideosLabel->isVisible());
+
+ mTestObject->mActivated = false;
+ noVideosLabel->setVisible(false);
+ mTestObject->setButtonShown(false);
+ QVERIFY(noVideosLabel->isVisible() == false);
+}
+
// end of file
--- a/videocollection/videocollectionview/tsrc/testlistview/inc/testlistview.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionview/tsrc/testlistview/inc/testlistview.h Thu Jul 22 16:34:17 2010 +0100
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description: tester for methods in VideoSortFilterProxyModel
+* Description: tester for methods in VideoListView
*
*/
@@ -169,11 +169,6 @@
void testDoDelayedsSlot();
/**
- * Tests openNewAlbumSlot
- */
- void testOpenNewAlbumSlot();
-
- /**
* Tests aboutToChangeOrientationSlot
*/
void testAboutToChangeOrientationSlot();
--- a/videocollection/videocollectionview/tsrc/testlistview/src/testlistview.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionview/tsrc/testlistview/src/testlistview.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 38 %
+// Version : %version: 48 %
#define private public
#include "videoservices.h"
@@ -97,7 +97,7 @@
// init
// ---------------------------------------------------------------------------
//
-void TestListView::init(bool initTestView)
+void TestListView::init(bool initTestView )
{
XQServiceUtilXtra::service = false;
mUiLoader = new VideoCollectionUiLoader();
@@ -177,7 +177,8 @@
{
if (!mTestView->mCurrentList)
{
- mTestView->activateView(TMPXItemId::InvalidId());
+ TMPXItemId tmpId = TMPXItemId::InvalidId();
+ mTestView->activateView(tmpId);
}
model = mTestView->mCurrentList->mModel;
}
@@ -265,23 +266,21 @@
mTestView->mUiLoader = 0;
QVERIFY( mTestView->initializeView() < 0 );
QVERIFY( mTestView->mVideoServices == 0 );
- QVERIFY( mTestView->mIsService == false );
mTestView->mUiLoader = tmp;
// service flag is false and mVideoServices is != 0
- mTestView->mIsService = false;
XQServiceUtilXtra::service = false;
- mTestView->mVideoServices = VideoServices::instance();
+ VideoServices *tmpService = VideoServices::instance();
+ mTestView->mVideoServices = tmpService;
QVERIFY( mTestView->initializeView() == 0 );
- QVERIFY( mTestView->mVideoServices != 0 );
- QVERIFY( mTestView->mIsService == false );
-
- // servicve flag is true, mVideoServices is 0
+ QVERIFY( mTestView->mVideoServices == 0 );
+ tmpService->decreaseReferenceCount();
+
+ // service flag is true, mVideoServices is 0
mTestView->mVideoServices = 0;
XQServiceUtilXtra::service = true;
QVERIFY( mTestView->initializeView() == 0 );
QVERIFY( mTestView->mVideoServices != 0 );
- QVERIFY( mTestView->mIsService == true );
XQServiceUtilXtra::service = false;
cleanup();
@@ -294,7 +293,8 @@
void TestListView::testMenus()
{
init();
- mTestView->activateView(TMPXItemId::InvalidId());
+ TMPXItemId tmpId = TMPXItemId::InvalidId();
+ mTestView->activateView(tmpId);
HbAction* action = 0;
QList<QAction*> tbActions = mTestView->toolBar()->actions();
@@ -394,7 +394,8 @@
void TestListView::testCreateAction()
{
init();
- mTestView->activateView(TMPXItemId::InvalidId());
+ TMPXItemId tmpId = TMPXItemId::InvalidId();
+ mTestView->activateView(tmpId);
QVERIFY(mTestView->mToolbarViewsActionGroup != 0);
@@ -406,7 +407,7 @@
HbAction* allVideos = static_cast<HbAction*>(actions.at(0));
QVERIFY( allVideos->isCheckable() );
- QCOMPARE( allVideos->icon().iconName(), QString(":/images/qtg_mono_video_all.svg") );
+ QCOMPARE( allVideos->icon().iconName(), QString("qtg_mono_video") );
QVERIFY( allVideos->isChecked() );
HbAction* collections = static_cast<HbAction*>(actions.at(1));
@@ -435,39 +436,41 @@
void TestListView::testActivateView()
{
VideoListWidget* videoListWidget = 0;
-
+ TMPXItemId invalidId = TMPXItemId::InvalidId();
init();
HbMainWindow *mainWnd = hbInstance->allMainWindows().value(0);
mainWnd->unsetOrientation(false);
- mTestView->mCurrentList = 0;
+ VideoListWidget *backup = mTestView->mCurrentList;
+ mTestView->mCurrentList = 0;
HbDocumentLoader::mFindWidgetFails = true;
- QCOMPARE( mTestView->activateView(TMPXItemId::InvalidId()), -1 );
+ QCOMPARE( mTestView->activateView(invalidId), -1 );
QVERIFY( VideoListWidgetData::mActive == false );
QVERIFY( mTestView->mCurrentList == 0 );
QCOMPARE( VideoListWidgetData::mActivateCount, 0 );
QCOMPARE( VideoListWidgetData::mDeactivateCount, 0 );
QVERIFY( mainWnd->mOrientationSet == false );
+ mTestView->mCurrentList = backup;
HbDocumentLoader::mFindWidgetFails = false;
videoListWidget = mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_VIDEOLISTWIDGET);
QVERIFY(videoListWidget);
VideoListWidgetData::mActivateReturnValue = -1;
- QCOMPARE( mTestView->activateView(TMPXItemId::InvalidId()), -1 );
+ QCOMPARE( mTestView->activateView(invalidId), -1 );
QVERIFY( VideoListWidgetData::mActive == false );
QCOMPARE( VideoListWidgetData::mActivateCount, 1 );
QCOMPARE( VideoListWidgetData::mDeactivateCount, 1 );
QVERIFY( mainWnd->mOrientationSet == false );
VideoListWidgetData::mActivateReturnValue = 0;
- QCOMPARE( mTestView->activateView(TMPXItemId::InvalidId()), 0 );
+ QCOMPARE( mTestView->activateView(invalidId), 0 );
QVERIFY( VideoListWidgetData::mActive );
QCOMPARE( VideoListWidgetData::mActivateCount, 2 );
QCOMPARE( VideoListWidgetData::mDeactivateCount, 1 );
QVERIFY( mainWnd->mOrientationSet );
QCOMPARE( mainWnd->mOrientation, Qt::Vertical );
- QCOMPARE( mTestView->activateView(TMPXItemId::InvalidId()), 0 );
+ QCOMPARE( mTestView->activateView(invalidId), 0 );
QVERIFY( VideoListWidgetData::mActive );
QCOMPARE( VideoListWidgetData::mActivateCount, 3 );
QCOMPARE( VideoListWidgetData::mDeactivateCount, 1 );
@@ -476,8 +479,7 @@
cleanup();
- // activate view:
- // -browse service
+ // activate collection content view:
// -captured category
TMPXItemId itemId = TMPXItemId::InvalidId();
init();
@@ -491,12 +493,9 @@
QCOMPARE(mTestView->mCollectionName, hbTrId("txt_videos_dblist_captured"));
QCOMPARE(mTestView->mCurrentList->getLevel(), VideoCollectionCommon::ELevelDefaultColl);
QCOMPARE(VideoSortFilterProxyModelData::mLastItemId, itemId);
- QCOMPARE(VideoSortFilterProxyModelData::mSortRole, (int)VideoCollectionCommon::KeyDateTime);
- QCOMPARE(VideoSortFilterProxyModelData::mSortOrder, Qt::AscendingOrder);
cleanup();
- // activate view:
- // -browse service
+ // activate collection content view::
// -downloaded category
init();
VideoListWidgetData::reset();
@@ -509,38 +508,37 @@
QCOMPARE(mTestView->mCollectionName, hbTrId("txt_videos_dblist_downloaded"));
QCOMPARE(mTestView->mCurrentList->getLevel(), VideoCollectionCommon::ELevelDefaultColl);
QCOMPARE(VideoSortFilterProxyModelData::mLastItemId, itemId);
- QCOMPARE(VideoSortFilterProxyModelData::mSortRole, (int)VideoCollectionCommon::KeyDateTime);
- QCOMPARE(VideoSortFilterProxyModelData::mSortOrder, Qt::AscendingOrder);
cleanup();
- // activate view:
- // -browse service
+ // activate collection content view:
// -other category
init();
+ videoListWidget = mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_VIDEOLISTWIDGET);
VideoListWidgetData::reset();
VideoSortFilterProxyModelData::reset();
itemId.iId1 = KVcxMvcCategoryIdOther;
itemId.iId2 = KVcxMvcMediaTypeCategory;
- QCOMPARE(mTestView->activateView(itemId), 0);
- QVERIFY(VideoListWidgetData::mActive);
- QCOMPARE(VideoListWidgetData::mActivateCount, 1);
+ QCOMPARE(mTestView->activateView(itemId), -1);
+ QVERIFY(VideoListWidgetData::mActive == false);
+ QCOMPARE(VideoListWidgetData::mActivateCount, 0);
QCOMPARE(mTestView->mCollectionName.length(), 0);
+ // for not activated widget, defaultlevel is ELevelVideos
QCOMPARE(mTestView->mCurrentList->getLevel(), VideoCollectionCommon::ELevelVideos);
QCOMPARE(VideoSortFilterProxyModelData::mLastItemId, TMPXItemId::InvalidId());
cleanup();
- // activate view:
- // -browse service
+ // activate collection content view:
// -invalid category but item id is ok
init();
VideoListWidgetData::reset();
VideoSortFilterProxyModelData::reset();
itemId.iId1 = 0;
itemId.iId2 = KVcxMvcMediaTypeVideo;
- QCOMPARE(mTestView->activateView(itemId), 0);
- QVERIFY(VideoListWidgetData::mActive);
- QCOMPARE(VideoListWidgetData::mActivateCount, 1);
+ QCOMPARE(mTestView->activateView(itemId), -1);
+ QVERIFY(VideoListWidgetData::mActive == false);
+ QCOMPARE(VideoListWidgetData::mActivateCount, 0);
QCOMPARE(mTestView->mCollectionName.length(), 0);
+ // for not activated widget, defaultlevel is ELevelVideos
QCOMPARE(mTestView->mCurrentList->getLevel(), VideoCollectionCommon::ELevelVideos);
QCOMPARE(VideoSortFilterProxyModelData::mLastItemId, TMPXItemId::InvalidId());
cleanup();
@@ -661,7 +659,7 @@
void TestListView::testDeactivateView()
{
VideoListWidget* videoListWidget = 0;
-
+ TMPXItemId invalidId = TMPXItemId::InvalidId();
init();
HbMainWindow *mainWnd = hbInstance->allMainWindows().value(0);
@@ -686,7 +684,7 @@
VideoListWidgetData::mActivateReturnValue = 0;
mainWnd->mOrientationSet = true;
- mTestView->activateView(TMPXItemId::InvalidId());
+ mTestView->activateView(invalidId);
mTestView->deactivateView();
QVERIFY( mUiLoader->findWidget<HbMenu>(DOCML_NAME_OPTIONS_MENU)->isVisible() == false );
QCOMPARE( VideoListWidgetData::mActivateCount, 1 );
@@ -717,9 +715,9 @@
{
VideoListWidget *videoListWidget = 0;
HbGroupBox *subLabel = 0;
-
+ TMPXItemId invalidId = TMPXItemId::InvalidId();
init();
- mTestView->activateView(TMPXItemId::InvalidId());
+ mTestView->activateView(invalidId);
videoListWidget = mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_VIDEOLISTWIDGET);
QVERIFY( videoListWidget );
@@ -757,9 +755,9 @@
{
VideoListWidget *collectionWidget = 0;
HbGroupBox *subLabel = 0;
-
+ TMPXItemId invalidId = TMPXItemId::InvalidId();
init();
- mTestView->activateView(TMPXItemId::InvalidId());
+ mTestView->activateView(invalidId);
QList<QAction*> actions = mTestView->mToolbarViewsActionGroup->actions();
HbAction* action = static_cast<HbAction*>(actions.at(1));
@@ -824,9 +822,10 @@
QCOMPARE(VideoSortFilterProxyModelData::mSortRole, -1);
cleanup();
+ TMPXItemId invalidId = TMPXItemId::InvalidId();
// Active action is not sort by.
init();
- mTestView->activateView(TMPXItemId::InvalidId());
+ mTestView->activateView(invalidId);
action = mUiLoader->findObject<HbAction>(DOCML_NAME_DELETE_MULTIPLE);
QVERIFY(action != 0);
mUiLoader->findWidget<HbMenu>(DOCML_NAME_OPTIONS_MENU)->setActiveAction(action);
@@ -841,17 +840,17 @@
// Good cases.
init();
- mTestView->activateView(TMPXItemId::InvalidId());
+ mTestView->activateView(invalidId);
sortMenu = mUiLoader->findWidget<HbMenu>(DOCML_NAME_SORT_MENU);
sortMenuAction->setMenu(sortMenu);
HbMenuData::mMenuAction = sortMenuAction;
- VideoSortFilterProxyModel& model = mTestView->mCurrentList->getModel();
+ VideoSortFilterProxyModel* model = mTestView->mCurrentList->getModel();
QVERIFY(action != 0);
mUiLoader->findWidget<HbMenu>(DOCML_NAME_OPTIONS_MENU)->setActiveAction(sortMenuAction);
HbAction* sortAction = mUiLoader->findObject<HbAction>(DOCML_NAME_SORT_BY_NAME);
QVERIFY(sortAction != 0);
sortMenu->setActiveAction(sortAction);
- model.setSortRole(1);
+ model->setSortRole(1);
connect(this, SIGNAL(testObjectReadySignal(QObject*, const QString)), mTestView, SLOT(objectReadySlot(QObject*, const QString)));
emit testObjectReadySignal(mUiLoader->findObject<QObject>(DOCML_NAME_SORT_BY_DATE), DOCML_NAME_SORT_BY_DATE);
emit testObjectReadySignal(mUiLoader->findObject<QObject>(DOCML_NAME_SORT_BY_NAME), DOCML_NAME_SORT_BY_NAME);
@@ -861,34 +860,40 @@
connect(this, SIGNAL(testSignal(int)), mTestView, SLOT(startSorting()));
emit testSignal(0);
- QCOMPARE(VideoSortFilterProxyModelData::mDoSortingCallCount, 1);
+ // since current list is videolist, sorting count is 2 because both all videos and collection content are sorted
+ QCOMPARE(VideoSortFilterProxyModelData::mDoSortingCallCount, 2);
QCOMPARE(VideoSortFilterProxyModelData::mSortRole, (int)VideoCollectionCommon::KeyTitle);
QCOMPARE(VideoSortFilterProxyModelData::mSortOrder, Qt::AscendingOrder);
QVERIFY(VideoSortFilterProxyModelData::mSortAsync);
+ VideoSortFilterProxyModelData::mDoSortingCallCount = 0;
// emit test signal again, with same parameters. Sorting should be switched to
// descending order.
emit testSignal(0);
+ // since current list is videolist, sorting count is 2 because both all videos and collection content are sorted
QCOMPARE(VideoSortFilterProxyModelData::mDoSortingCallCount, 2);
QCOMPARE(VideoSortFilterProxyModelData::mSortRole, (int)VideoCollectionCommon::KeyTitle);
QCOMPARE(VideoSortFilterProxyModelData::mSortOrder, Qt::DescendingOrder);
QVERIFY(VideoSortFilterProxyModelData::mSortAsync);
+ VideoSortFilterProxyModelData::mDoSortingCallCount = 0;
// on third emit, sorting should be switched back to ascending
emit testSignal(0);
- QCOMPARE(VideoSortFilterProxyModelData::mDoSortingCallCount, 3);
+ // since current list is videolist, sorting count is 2 because both all videos and collection content are sorted
+ QCOMPARE(VideoSortFilterProxyModelData::mDoSortingCallCount, 2);
QCOMPARE(VideoSortFilterProxyModelData::mSortRole, (int)VideoCollectionCommon::KeyTitle);
QCOMPARE(VideoSortFilterProxyModelData::mSortOrder, Qt::AscendingOrder);
QVERIFY(VideoSortFilterProxyModelData::mSortAsync);
// test that after changing the sort role, the order is also switched to ascending.
- model.doSorting(model.sortRole(), Qt::DescendingOrder);
+ model->doSorting(model->sortRole(), Qt::DescendingOrder);
sortAction = mUiLoader->findObject<HbAction>(DOCML_NAME_SORT_BY_DATE);
QVERIFY(sortAction != 0);
sortMenu->setActiveAction(sortAction);
-
+ VideoSortFilterProxyModelData::mDoSortingCallCount = 0;
emit testSignal(0);
- QCOMPARE(VideoSortFilterProxyModelData::mDoSortingCallCount, 5);
+ // since current list is videolist, sorting count is 2 because both all videos and collection content are sorted
+ QCOMPARE(VideoSortFilterProxyModelData::mDoSortingCallCount, 2);
QCOMPARE(VideoSortFilterProxyModelData::mSortRole, (int)VideoCollectionCommon::KeyDateTime);
QCOMPARE(VideoSortFilterProxyModelData::mSortOrder, Qt::AscendingOrder);
QVERIFY(VideoSortFilterProxyModelData::mSortAsync);
@@ -908,7 +913,7 @@
XQServiceUtilXtra *serviceUtilXtra = XQServiceUtilXtra::instance();
serviceUtilXtra->setCurrentService(true);
QCOMPARE(mTestView->initializeView(), 0);
- QCOMPARE(mTestView->activateView(TMPXItemId::InvalidId()), 0);
+ QCOMPARE(mTestView->activateView(invalidId), 0);
int sortRole = VideoCollectionViewUtilsData::mVideoSortRole;
emit testSignal(0);
QCOMPARE(sortRole, VideoCollectionViewUtilsData::mVideoSortRole);
@@ -940,9 +945,18 @@
{
init();
mTestView->mModelReady = false;
+ mTestView->mViewReady = false;
connect( this, SIGNAL(testSignal()), mTestView, SLOT(modelReadySlot()) );
+ QSignalSpy spy(mTestView, SIGNAL(viewReady()));
emit testSignal();
QVERIFY(mTestView->mModelReady);
+ QVERIFY(mTestView->mViewReady);
+ QCOMPARE(spy.count(), 1);
+ spy.clear();
+
+ emit testSignal();
+ QCOMPARE(spy.count(), 0);
+
cleanup();
}
@@ -954,13 +968,6 @@
{
init();
connect( this, SIGNAL(testSignal()), mTestView, SLOT(deleteItemsSlot()) );
- ////////////
- // no current list
- ////////////
- emit testSignal();
- QCOMPARE(VideoListSelectionDialogData::mMultiSelectionLaunchCount, 0);
-
- mTestView->activateView(TMPXItemId::InvalidId());
////////////
// dialog loading fails
@@ -1007,11 +1014,11 @@
cleanup();
HbAction *action(0);
-
+ TMPXItemId invalidId = TMPXItemId::InvalidId();
// Collections is triggered from toolbar.
init();
connect(this, SIGNAL(testSignal()), mTestView, SLOT(aboutToShowMainMenuSlot()));
- mTestView->activateView(TMPXItemId::InvalidId());
+ mTestView->activateView(invalidId);
setRowCount(1);
action = mTestView->mToolbarActions[VideoListView::ETBActionCollections];
QVERIFY(action != 0);
@@ -1025,7 +1032,7 @@
// All videos is triggered from toolbar.
init();
connect(this, SIGNAL(testSignal()), mTestView, SLOT(aboutToShowMainMenuSlot()));
- mTestView->activateView(TMPXItemId::InvalidId());
+ mTestView->activateView(invalidId);
setRowCount(1);
action = mTestView->mToolbarActions[VideoListView::ETBActionAllVideos];
QVERIFY(action != 0);
@@ -1039,7 +1046,7 @@
// Add videos action is visible.
init();
connect(this, SIGNAL(testSignal()), mTestView, SLOT(aboutToShowMainMenuSlot()));
- mTestView->activateView(TMPXItemId::InvalidId());
+ mTestView->activateView(invalidId);
mTestView->toolBar()->clearActions();
mTestView->toolBar()->addActions( mTestView->mToolbarCollectionActionGroup->actions() );
setRowCount(1);
@@ -1052,7 +1059,7 @@
// Model has no items.
init();
connect(this, SIGNAL(testSignal()), mTestView, SLOT(aboutToShowMainMenuSlot()));
- mTestView->activateView(TMPXItemId::InvalidId());
+ mTestView->activateView(invalidId);
setRowCount(0);
emit testSignal();
visible = visibleMenuActions();
@@ -1062,7 +1069,7 @@
// Toolbar action group is null
init();
connect(this, SIGNAL(testSignal()), mTestView, SLOT(aboutToShowMainMenuSlot()));
- mTestView->activateView(TMPXItemId::InvalidId());
+ mTestView->activateView(invalidId);
setRowCount(1);
QActionGroup* actionGroup = mTestView->mToolbarViewsActionGroup;
mTestView->mToolbarViewsActionGroup = NULL;
@@ -1091,7 +1098,7 @@
videoServices->mCurrentService = VideoServices::EBrowse;
init(true);
connect(this, SIGNAL(testSignal()), mTestView, SLOT(aboutToShowMainMenuSlot()));
- mTestView->activateView(TMPXItemId::InvalidId());
+ mTestView->activateView(invalidId);
emit testSignal();
visible = visibleMenuActions();
QCOMPARE(visible, 0);
@@ -1104,8 +1111,8 @@
videoServices->mCurrentService = VideoServices::EBrowse;
init(true);
connect(this, SIGNAL(testSignal()), mTestView, SLOT(aboutToShowMainMenuSlot()));
- mTestView->activateView(TMPXItemId::InvalidId());
- setRowCount(3, &mTestView->mCurrentList->getModel());
+ mTestView->activateView(invalidId);
+ setRowCount(3, mTestView->mCurrentList->getModel());
emit testSignal();
QVERIFY(isActionVisible(DOCML_NAME_DELETE_MULTIPLE));
QVERIFY(isActionVisible(DOCML_NAME_SORT_BY_DATE));
@@ -1246,6 +1253,7 @@
{
init(true);
setRowCount(1);
+ mTestView->mModelReady = true;
connect(this, SIGNAL(testLayoutChangedSignal()), mTestView, SLOT(layoutChangedSlot()));
connect(this, SIGNAL(testCollectionOpenedSignal(bool, const QString&, const QModelIndex&)),
mTestView, SLOT(collectionOpenedSlot(bool, const QString&, const QModelIndex&)));
@@ -1283,35 +1291,50 @@
//
void TestListView::testShowHint()
{
- init(true);
+ TMPXItemId invalidId = TMPXItemId::InvalidId();
+ init(false);
connect(this, SIGNAL(testLayoutChangedSignal()), mTestView, SLOT(layoutChangedSlot()));
mTestView->mModelReady = true;
// current list is null. (cannot be verified, run for coverity
emit testLayoutChangedSignal();
- mTestView->activateView(TMPXItemId::InvalidId());
-
+ mTestView->activateView(invalidId);
+ disconnect(this, SIGNAL(testLayoutChangedSignal()), mTestView, SLOT(layoutChangedSlot()));
+
+ cleanup();
+ init(true);
+ mTestView->mModelReady = true;
+ connect(this, SIGNAL(testLayoutChangedSignal()), mTestView, SLOT(layoutChangedSlot()));
+
// hint widget cannot be loaded. (cannot be tested, run for coverity)
VideoCollectionUiLoaderData::mFindFailureNameList.append(DOCML_NAME_VC_VIDEOHINTWIDGET);
emit testLayoutChangedSignal();
VideoCollectionUiLoaderData::mFindFailureNameList.clear();
VideoHintWidget *hintWidget = mUiLoader->findWidget<VideoHintWidget>(DOCML_NAME_VC_VIDEOHINTWIDGET);
+ hintWidget->deactivate();
/////
// hint widget showing
- // model not ready (need to use another slot for this)
+ // model not ready, row count zero.
mTestView->mModelReady = false;
+ setRowCount(0);
+ VideoListWidget *backup = mTestView->mCurrentList;
mTestView->mCurrentList = mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_COLLECTIONWIDGET);
- connect(this, SIGNAL(testSignal()), mTestView, SLOT(openAllVideosViewSlot()));
- emit testSignal();
+ emit testLayoutChangedSignal();
+ QVERIFY(hintWidget->isVisible() == false);
+ QVERIFY(VideoHintWidgetData::mSettedButtonShowLevel);
+ mTestView->mCurrentList = backup;
+
+ // model not ready, row count not zero.
+ setRowCount(1);
+ emit testLayoutChangedSignal();
QVERIFY(hintWidget->isVisible() == false );
QVERIFY(VideoHintWidgetData::mSettedButtonShowLevel);
- disconnect(this, SIGNAL(testSignal()), mTestView, SLOT(openAllVideosViewSlot()));
+ QVERIFY(mTestView->mModelReady);
// model ready, row count not zero
mTestView->mModelReady = true;
- setRowCount(1);
emit testLayoutChangedSignal();
QVERIFY(hintWidget->isVisible() == false );
QVERIFY(VideoHintWidgetData::mSettedButtonShowLevel);
@@ -1322,7 +1345,7 @@
QVERIFY(hintWidget->isVisible() == true );
QVERIFY(VideoHintWidgetData::mSettedButtonShowLevel);
- // model ready, row count is zero show to be false
+ // model ready, row count is zero, show to be false
connect(this, SIGNAL(testSignal()), mTestView, SLOT(openCollectionViewSlot()));
emit testSignal();
QVERIFY(hintWidget->isVisible() == false );
@@ -1333,6 +1356,7 @@
////////
// toolbar setup
+ mTestView->activateView(invalidId);
mTestView->mToolbarActions[VideoListView::ETBActionRemoveVideos]->setVisible(true);
// mToolbarViewsActionGroup is null
@@ -1349,11 +1373,13 @@
QVERIFY(mTestView->mToolbarActions[VideoListView::ETBActionRemoveVideos]->isVisible());
mTestView->mToolbarCollectionActionGroup = tmp;
- // mIsService is true
- mTestView->mIsService = true;
+ // mVideoServices exists
+ VideoServices *tmpService = VideoServices::instance();
+ mTestView->mVideoServices = tmpService;
emit testLayoutChangedSignal();
QVERIFY(mTestView->mToolbarActions[VideoListView::ETBActionRemoveVideos]->isVisible());
- mTestView->mIsService = false;
+ mTestView->mVideoServices = 0;
+ tmpService->decreaseReferenceCount();
// show -flag is true, currentlist level != VideoCollectionCommon::ELevelDefaultColl
mTestView->mCurrentList->activate(VideoCollectionCommon::ELevelAlbum);
@@ -1440,37 +1466,6 @@
}
// ---------------------------------------------------------------------------
-// testOpenNewAlbumSlot
-// ---------------------------------------------------------------------------
-//
-void TestListView::testOpenNewAlbumSlot()
-{
- init(false);
-
- QVERIFY(connect(this, SIGNAL(testSignal(const QModelIndex &, int, int)), mTestView, SLOT(openNewAlbumSlot(const QModelIndex &, int, int))));
-
- QModelIndex index;
-
- // Not initialized, no mCurrentList
- emit testSignal(index, 0, 0);
- // TODO verify
-
- // Good case
- QVERIFY(mTestView->initializeView() == 0);
- mTestView->activateView(TMPXItemId::InvalidId());
- setRowCount(1);
- emit testSignal(index, 0, 0);
- // TODO verify
-
- // Invalid index
- emit testSignal(index, -1, 0);
- // TODO verify
-
- disconnect(this, SIGNAL(testSignal()), mTestView, SLOT(doDelayedsSlot()));
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
// testAboutToChangeOrientationSlot
// ---------------------------------------------------------------------------
//
@@ -1518,40 +1513,19 @@
{
init(false);
QVERIFY(connect(this, SIGNAL(testSignal()), mTestView, SLOT(createCollectionSlot())));
-
- // not initialized, no mCurrentList
- emit testSignal();
- QCOMPARE(HbInputDialog::mGetTextCallCount, 0);
- QVERIFY(VideoSortFilterProxyModelData::mLastAddedAlbumName == "");
-
- QVERIFY(mTestView->initializeView() == 0);
- mTestView->activateView(TMPXItemId::InvalidId());
-
- // dialog canceled
- HbInputDialog::mGetTextFails = true;
+
+ // dialog finding fails
+ VideoCollectionUiLoaderData::mFailDialogLoad = true;
emit testSignal();
- QCOMPARE(HbInputDialog::mGetTextCallCount, 1);
- QVERIFY(VideoSortFilterProxyModelData::mLastAddedAlbumName == "");
-
- // empty name
- HbInputDialog::mGetTextFails = false;
- HbInputDialog::mGetTextCallCount = 0;
- HbInputDialog::mGetTextReturnValue = "";
- emit testSignal();
- QCOMPARE(HbInputDialog::mGetTextCallCount, 1);
- QVERIFY(VideoSortFilterProxyModelData::mLastAddedAlbumName == "");
-
- // Good case.
- HbInputDialog::mGetTextReturnValue = "testAlbum";
- HbInputDialog::mGetTextCallCount = 0;
- emit testSignal();
- QCOMPARE(HbInputDialog::mGetTextCallCount, 1);
- QVERIFY(VideoSortFilterProxyModelData::mLastAddedAlbumName == "testAlbum");
-
- HbInputDialog::mGetTextCallCount = 0;
- HbInputDialog::mGetTextReturnValue = QString();
- VideoSortFilterProxyModelData::mLastAddedAlbumName = "";
-
+ QCOMPARE(VideoListSelectionDialogData::mMultiSelectionLaunchCount, 0);
+ QCOMPARE(VideoListSelectionDialogData::mSelectionType, -1);
+ // dialog finding succeeds
+ VideoCollectionUiLoaderData::mFailDialogLoad = false;
+ emit testSignal();
+ QVERIFY(VideoListSelectionDialogData::mSettedMpxId == TMPXItemId::InvalidId());
+ QCOMPARE(VideoListSelectionDialogData::mSelectionType, (int)VideoListSelectionDialog::ECreateCollection);
+ QCOMPARE(VideoListSelectionDialogData::mMultiSelectionLaunchCount, 1);
+
disconnect(this, SIGNAL(testSignal()), mTestView, SLOT(createCollectionSlot()));
cleanup();
}
@@ -1565,6 +1539,7 @@
init(false);
QVERIFY(connect(this, SIGNAL(testSignal()), mTestView, SLOT(addVideosToCollectionSlot())));
+ TMPXItemId invalidId = TMPXItemId::InvalidId();
VideoSortFilterProxyModelData::mOpenedItemId = TMPXItemId(0, 2);
// Not initalized, no mCurrentList
@@ -1574,7 +1549,7 @@
QCOMPARE(VideoCollectionViewUtilsData::mLastError, 0);
QVERIFY(mTestView->initializeView() == 0);
- mTestView->activateView(TMPXItemId::InvalidId());
+ mTestView->activateView(invalidId);
// Selection dialog widget loading fails.
VideoCollectionUiLoaderData::mFindFailure = true;
@@ -1637,12 +1612,12 @@
QVERIFY(allVideos);
setRowCount(3, allVideos->mModel);
// Must have different model than selection dialog has. Otherwise Qt optimizes rowCount calls
- // to source model and VideoListDataModelData::mRowCountDecrement hack doesn't work.
+ // to source model and VideoListDataModelData::mRowCountDecrement doesn't work.
+ QVERIFY(mTestView->initializeView() == 0);
QVERIFY(connect(this, SIGNAL(testSignal2()), mTestView, SLOT(openCollectionViewSlot())));
emit testSignal2();
disconnect(this, SIGNAL(testSignal2()), mTestView, SLOT(openCollectionViewSlot()));
- QVERIFY(mTestView->initializeView() == 0);
- mTestView->activateView(TMPXItemId::InvalidId());
+ mTestView->activateView(invalidId);
VideoListDataModelData::mRowCountDecrement = 1;
mTestView->mCurrentList->mCurrentLevel = VideoCollectionCommon::ELevelAlbum;
setRowCount(1);
@@ -1674,8 +1649,10 @@
// Not initialized, no current list
emit testSignal();
+ TMPXItemId invalidId = TMPXItemId::InvalidId();
+
QVERIFY(mTestView->initializeView() == 0);
- mTestView->activateView(TMPXItemId::InvalidId());
+ mTestView->activateView(invalidId);
setRowCount(1);
// Wrong level.
--- a/videocollection/videocollectionview/tsrc/testlistwidget/inc/testlistwidget.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionview/tsrc/testlistwidget/inc/testlistwidget.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 25 %
+// Version : %version: 26 %
#ifndef __TESTLISTWIDGET_H__
#define __TESTLISTWIDGET_H__
@@ -106,11 +106,6 @@
void testLongPressedSlot();
/**
- * verifies panGesture
- */
- void testPanGesture();
-
- /**
* verifies setContextMenu
*/
void testSetContextMenu();
--- a/videocollection/videocollectionview/tsrc/testlistwidget/src/testlistwidget.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionview/tsrc/testlistwidget/src/testlistwidget.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 47 %
+// Version : %version: 56 %
#include <qmap.h>
#include <vcxmyvideosdefs.h>
@@ -86,14 +86,6 @@
{
VideoListWidget::longPressedSlot(item, point);
}
-
- /**
- * calls pangesture
- */
- void callPanGesture(const QPointF &point)
- {
- VideoListWidget::panGesture(point);
- }
};
// ---------------------------------------------------------------------------
@@ -155,6 +147,7 @@
void TestListWidget::initTestCase()
{
qRegisterMetaType<QModelIndex>("QModelIndex");
+ qRegisterMetaType<TMPXItemId>("TMPXItemId");
}
// ---------------------------------------------------------------------------
@@ -196,7 +189,7 @@
}
// ---------------------------------------------------------------------------
-// testInitialize
+// testInitialized
// ---------------------------------------------------------------------------
//
void TestListWidget::testInitialize()
@@ -208,14 +201,12 @@
QVERIFY(mTestWidget->initialize(*model) == 0);
QVERIFY(mTestWidget->mModel == model);
QVERIFY(mTestWidget->mVideoServices == 0);
- QVERIFY(mTestWidget->mIsService == false);
// service initialization
VideoServices *service = VideoServices::instance();
- QVERIFY(mTestWidget->initialize(*model, service) == 0);
+ QVERIFY(mTestWidget->initialize(*model, true) == 0);
QVERIFY(mTestWidget->mModel == model);
QVERIFY(mTestWidget->mVideoServices == service);
- QVERIFY(mTestWidget->mIsService == true);
service->decreaseReferenceCount();
service = 0;
@@ -236,20 +227,25 @@
QCOMPARE(HbListView::mLatestVisibility, false);
QCOMPARE(VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled, 0);
- // model exist, no current view default level: succeeds
+ // model exist, no current view default level: fails
QVERIFY(mTestWidget->initialize(*model) == 0);
- QVERIFY(mTestWidget->activate() == 0);
+ QVERIFY(mTestWidget->activate() == -1);
QCOMPARE(HbMenuData::mEnabledSetted, false);
- QCOMPARE(HbListView::mLatestVisibility, true);
- QCOMPARE(VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled, 1);
+ QCOMPARE(HbListView::mLatestVisibility, false);
+ QCOMPARE(VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled, 0);
HbMenuData::mEnabledSetted = true;
HbListView::mLatestVisibility = false;
HbListView::mLatestEnableValue = false;
VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled = 0;
-
+ HbView *tmpView = new HbView();
// model exists, current view exists, level neither ELevelAlbum nor ELevelDefaultColl
- HbView *tmpView = new HbView();
+ delete mTestWidget;
+ mTestWidget = 0;
+ mTestWidget = new ListWidgetTester(mTestUiLoader, mTempView);
+ model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
+
+ QVERIFY(mTestWidget->initialize(*model, 0, VideoCollectionCommon::ELevelVideos) == 0);
hbInstance->allMainWindows().value(0)->addView(tmpView);
QVERIFY(mTestWidget->activate() == 0);
QCOMPARE(HbMenuData::mEnabledSetted, true);
@@ -285,16 +281,42 @@
// activate:
// -is service
// -current service is browse
- VideoServices *videoServices = VideoServices::instance();
+ VideoServices *videoServices = VideoServices::instance();
+ delete mTestWidget;
+ mTestWidget = 0;
+ mTestWidget = new ListWidgetTester(mTestUiLoader, mTempView);
videoServices->mCurrentService = VideoServices::EBrowse;
+ QVERIFY(mTestWidget->initialize(*model, true) == 0);
+ QVERIFY(mTestWidget->activate(VideoCollectionCommon::ELevelDefaultColl) == 0);
+ QVERIFY(mTestWidget->mNavKeyAction);
+ QVERIFY(HbAction::mNavAction == Hb::BackAction);
+
+ // activate:
+ // -is service
+ // -current service is fetch
+ // -activating all videos
delete mTestWidget;
mTestWidget = 0;
mTestWidget = new ListWidgetTester(mTestUiLoader, mTempView);
- QVERIFY(mTestWidget->initialize(*model, videoServices) == 0);
- QVERIFY(mTestWidget->activate(VideoCollectionCommon::ELevelDefaultColl) == 0);
+ videoServices->mCurrentService = VideoServices::EUriFetcher;
+ QVERIFY(mTestWidget->initialize(*model, true) == 0);
+ QVERIFY(mTestWidget->activate(VideoCollectionCommon::ELevelVideos) == 0);
QVERIFY(mTestWidget->mNavKeyAction);
QVERIFY(HbAction::mNavAction == Hb::QuitAction);
+ // activate:
+ // -is service
+ // -current service is fetch
+ // -activating album
+ delete mTestWidget;
+ mTestWidget = 0;
+ mTestWidget = new ListWidgetTester(mTestUiLoader, mTempView);
+ videoServices->mCurrentService = VideoServices::EUriFetcher;
+ QVERIFY(mTestWidget->initialize(*model, true) == 0);
+ QVERIFY(mTestWidget->activate(VideoCollectionCommon::ELevelAlbum) == 0);
+ QVERIFY(mTestWidget->mNavKeyAction);
+ QVERIFY(HbAction::mNavAction == Hb::BackAction);
+
hbInstance->allMainWindows().value(0)->removeView(tmpView);
delete tmpView;
@@ -376,13 +398,13 @@
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
- QVERIFY(&(mTestWidget->getModel()) == 0);
+ QVERIFY(mTestWidget->getModel() == 0);
HbListView::mVScrollBarIsNull = false;
HbListView::mReturnNullPrototype = false;
mTestWidget->initialize(*model);
- QVERIFY(&(mTestWidget->getModel()) == model);
+ QVERIFY(mTestWidget->getModel() == model);
}
// ---------------------------------------------------------------------------
@@ -395,7 +417,7 @@
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
- QSignalSpy spysignal(mTestWidget, SIGNAL(collectionOpened(bool, const QString&, const QModelIndex&)));
+ QSignalSpy spysignal(mTestWidget, SIGNAL(collectionOpened(bool, const QString&, const TMPXItemId&)));
QSignalSpy spysignalFileUri(mTestWidget, SIGNAL(fileUri(const QString&)));
QSignalSpy spysignalActivated(mTestWidget, SIGNAL(activated(const QModelIndex&)));
@@ -459,13 +481,12 @@
spysignalActivated.clear();
// current level is not ELevelCategory
- // mIsService is true, variant gotten is invalid
- videoServices->mCurrentService = VideoServices::EUriFetcher;
+ // mVideoServices exist, variant gotten is invalid
+ mTestWidget->mService = VideoServices::EUriFetcher;
VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, QVariant());
mTestWidget->mCurrentLevel = VideoCollectionCommon::ELevelVideos;
- mTestWidget->mIsService = true;
mTestWidget->mVideoServices = videoServices;
- fetchIndex = model->index(0, 0, QModelIndex());
+ fetchIndex = model->index(5, 0, QModelIndex());
mTestWidget->callEmiteActivated(fetchIndex);
QVERIFY(spysignal.count() == 0);
QVERIFY(spysignalFileUri.count() == 0);
@@ -473,8 +494,8 @@
QVERIFY(VideoSortFilterProxyModelData::mLastItemId == TMPXItemId::InvalidId());
// current level is not ELevelCategory
- // mIsService is true, variant gotten is valid
- videoServices->mCurrentService = VideoServices::EUriFetcher;
+ // mVideoServices, variant gotten is valid
+ mTestWidget->mService = VideoServices::EUriFetcher;
VideoListDataModelData::setData(VideoCollectionCommon::KeyFilePath, data);
fetchIndex = model->index(0, 0, QModelIndex());
mTestWidget->callEmiteActivated(fetchIndex);
@@ -488,8 +509,8 @@
spysignalActivated.clear();
// current level is not ELevelCategory
- // mIsService is false
- mTestWidget->mIsService = false;
+ // mVideoServices does not exists
+ mTestWidget->mVideoServices = 0;
fetchIndex = model->index(0, 0, QModelIndex());
mTestWidget->callEmiteActivated(fetchIndex);
QVERIFY(spysignal.count() == 0);
@@ -571,24 +592,26 @@
QVERIFY(HbMenuData::mExecPoint != point);
mTestWidget->mModel = tmp;
- // gotten id != KVcxMvcMediaTypeVideo, service is true and id != KVcxMvcMediaTypeAlbum
+ VideoServices *videoServices = VideoServices::instance();
+
+ // gotten id != KVcxMvcMediaTypeVideo, service exists true and id != KVcxMvcMediaTypeAlbum
VideoSortFilterProxyModelData::mItemIds.clear();
VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(1,1));
- mTestWidget->mIsService = true;
+ mTestWidget->mVideoServices = videoServices;
mTestWidget->callLongPressedSlot(item, point);
QVERIFY(HbMenuData::mExecPoint == point);
- // gotten id != KVcxMvcMediaTypeVideo, service is false and id != KVcxMvcMediaTypeAlbum
+ // gotten id != KVcxMvcMediaTypeVideo, service does not exists and id != KVcxMvcMediaTypeAlbum
VideoSortFilterProxyModelData::mItemIds.clear();
VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(1,1));
- mTestWidget->mIsService = false;
+ mTestWidget->mVideoServices = 0;
mTestWidget->callLongPressedSlot(item, point);
QVERIFY(HbMenuData::mExecPoint == point);
- // gotten id != KVcxMvcMediaTypeVideo, service is false and id == KVcxMvcMediaTypeAlbum
+ // gotten id != KVcxMvcMediaTypeVideo, service service does not exists and id == KVcxMvcMediaTypeAlbum
VideoSortFilterProxyModelData::mItemIds.clear();
VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(1,2));
- mTestWidget->mIsService = false;
+ mTestWidget->mVideoServices = 0;
mTestWidget->callLongPressedSlot(item, point);
QVERIFY(HbMenuData::mExecPoint == point);
HbMenuData::mExecPoint = QPointF();
@@ -596,7 +619,7 @@
// gotten id == KVcxMvcMediaTypeVideo
VideoSortFilterProxyModelData::mItemIds.clear();
VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(1,02));
- mTestWidget->mIsService = false;
+ mTestWidget->mVideoServices = 0;
mTestWidget->callLongPressedSlot(item, point);
QVERIFY(HbMenuData::mExecPoint == point);
HbMenuData::mExecPoint = QPointF();
@@ -615,12 +638,11 @@
// -is service
// -current service is browse
HbMenuData::mExecPoint = QPointF();
- VideoServices *videoServices = VideoServices::instance();
videoServices->mCurrentService = VideoServices::EBrowse;
delete mTestWidget;
mTestWidget = 0;
mTestWidget = new ListWidgetTester(mTestUiLoader, mTempView);
- QVERIFY(mTestWidget->initialize(*model, videoServices) == 0);
+ QVERIFY(mTestWidget->initialize(*model, true) == 0);
QVERIFY(mTestWidget->activate(VideoCollectionCommon::ELevelDefaultColl) == 0);
mTestWidget->mItem->mModelIndex = model->index(0, 0, QModelIndex());
mTestWidget->callLongPressedSlot(item, point);
@@ -630,19 +652,61 @@
QVERIFY(mTestWidget->mContextMenuActions[VideoListWidget::EActionDetails]->isVisible());
// long press gesture:
- // -is service
- // -current service is EUriFetcher
+ // - is service
+ // - current service is EUriFetcher
+ // - category view activated
HbMenuData::mExecPoint = QPointF();
videoServices = VideoServices::instance();
videoServices->mCurrentService = VideoServices::EUriFetcher;
delete mTestWidget;
mTestWidget = 0;
mTestWidget = new ListWidgetTester(mTestUiLoader, mTempView);
- QVERIFY(mTestWidget->initialize(*model, videoServices) == 0);
+ QVERIFY(mTestWidget->initialize(*model, true) == 0);
+ QVERIFY(mTestWidget->activate(VideoCollectionCommon::ELevelCategory) == 0);
+ mTestWidget->mItem->mModelIndex = model->index(0, 0, QModelIndex());
+ mTestWidget->callLongPressedSlot(item, point);
+ QCOMPARE(mTestWidget->mContextMenuActions.count(), 4);
+ QVERIFY(mTestWidget->mContextMenuActions[VideoListWidget::EActionOpen]->isVisible());
+ QVERIFY(!mTestWidget->mContextMenuActions[VideoListWidget::EActionAttach]->isVisible());
+ QVERIFY(!mTestWidget->mContextMenuActions[VideoListWidget::EActionPlay]->isVisible());
+ QVERIFY(!mTestWidget->mContextMenuActions[VideoListWidget::EActionDetails]->isVisible());
+
+ // long press gesture:
+ // - is service
+ // - current service is EUriFetcher
+ // - user defined collection activated
+ HbMenuData::mExecPoint = QPointF();
+ videoServices = VideoServices::instance();
+ videoServices->mCurrentService = VideoServices::EUriFetcher;
+ delete mTestWidget;
+ mTestWidget = 0;
+ mTestWidget = new ListWidgetTester(mTestUiLoader, mTempView);
+ QVERIFY(mTestWidget->initialize(*model, true) == 0);
+ QVERIFY(mTestWidget->activate(VideoCollectionCommon::ELevelAlbum) == 0);
+ mTestWidget->mItem->mModelIndex = model->index(0, 0, QModelIndex());
+ mTestWidget->callLongPressedSlot(item, point);
+ QCOMPARE(mTestWidget->mContextMenuActions.count(), 4);
+ QVERIFY(!mTestWidget->mContextMenuActions[VideoListWidget::EActionOpen]->isVisible());
+ QVERIFY(mTestWidget->mContextMenuActions[VideoListWidget::EActionAttach]->isVisible());
+ QVERIFY(mTestWidget->mContextMenuActions[VideoListWidget::EActionPlay]->isVisible());
+ QVERIFY(mTestWidget->mContextMenuActions[VideoListWidget::EActionDetails]->isVisible());
+
+ // long press gesture:
+ // - is service
+ // - current service is EUriFetcher
+ // - default collection activated
+ HbMenuData::mExecPoint = QPointF();
+ videoServices = VideoServices::instance();
+ videoServices->mCurrentService = VideoServices::EUriFetcher;
+ delete mTestWidget;
+ mTestWidget = 0;
+ mTestWidget = new ListWidgetTester(mTestUiLoader, mTempView);
+ QVERIFY(mTestWidget->initialize(*model, true) == 0);
QVERIFY(mTestWidget->activate(VideoCollectionCommon::ELevelDefaultColl) == 0);
mTestWidget->mItem->mModelIndex = model->index(0, 0, QModelIndex());
mTestWidget->callLongPressedSlot(item, point);
- QCOMPARE(mTestWidget->mContextMenuActions.count(), 3);
+ QCOMPARE(mTestWidget->mContextMenuActions.count(), 4);
+ QVERIFY(!mTestWidget->mContextMenuActions[VideoListWidget::EActionOpen]->isVisible());
QVERIFY(mTestWidget->mContextMenuActions[VideoListWidget::EActionAttach]->isVisible());
QVERIFY(mTestWidget->mContextMenuActions[VideoListWidget::EActionPlay]->isVisible());
QVERIFY(mTestWidget->mContextMenuActions[VideoListWidget::EActionDetails]->isVisible());
@@ -653,38 +717,6 @@
}
// ---------------------------------------------------------------------------
-// testPanGesture
-// ---------------------------------------------------------------------------
-//
-void TestListWidget::testPanGesture()
-{
- QPointF point(1,1);
- // no context menu
- mTestWidget->callPanGesture(point);
- QVERIFY(HbListView::mPanGesturePoint == point);
-
- // create context menu
- VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
- VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
- mTestWidget->initialize(*model);
- connect(this, SIGNAL(testSignal()), mTestWidget, SLOT(doDelayedsSlot()));
- emit testSignal();
- disconnect(this, SIGNAL(testSignal()), mTestWidget, SLOT(doDelayedsSlot()));
-
- HbListView::mPanGesturePoint = QPointF();
-
- // context menu visible
- mTestWidget->mContextMenu->setVisible(true);
- mTestWidget->callPanGesture(point);
- QVERIFY(HbListView::mPanGesturePoint != point);
-
- // context menu not visible
- mTestWidget->mContextMenu->setVisible(false);
- mTestWidget->callPanGesture(point);
- QVERIFY(HbListView::mPanGesturePoint == point);
-}
-
-// ---------------------------------------------------------------------------
// testSetContextMenu
// ---------------------------------------------------------------------------
//
@@ -699,7 +731,7 @@
setRowCount(1);
HbListView::mCurrentIndex = model->index(0, 0, QModelIndex());
mTestWidget->mItem->mModelIndex = HbListView::mCurrentIndex ;
-
+
TMPXItemId itemId;
QPointF point(1,1);
itemId.iId2 = 0;
@@ -741,8 +773,8 @@
// mCurrentLevel == ELevelCategory
mTestWidget->mCurrentLevel = VideoCollectionCommon::ELevelCategory;
- // mIsService is false
- mTestWidget->mIsService = false;
+ // service does not exist
+ mTestWidget->mVideoServices = 0;
mTestWidget->callLongPressedSlot(item, point);
iter = mTestWidget->mContextMenuActions.begin();
QVERIFY(iter != mTestWidget->mContextMenuActions.end());
@@ -757,8 +789,9 @@
}
QVERIFY(visibleCount == 1);
- // mIsService is true, mpxId.iId2 != KVcxMvcMediaTypeAlbum
- mTestWidget->mIsService = true;
+ VideoServices *videoServices = VideoServices::instance();
+ // service exists, mpxId.iId2 != KVcxMvcMediaTypeAlbum
+ mTestWidget->mVideoServices = videoServices;
mTestWidget->callLongPressedSlot(item, point);
iter = mTestWidget->mContextMenuActions.begin();
QVERIFY(iter != mTestWidget->mContextMenuActions.end());
@@ -773,12 +806,11 @@
}
QVERIFY(visibleCount == 1);
- // mIsService is false, mpxId.iId2 == KVcxMvcMediaTypeAlbum
- //VideoSortFilterProxyModelData::mItemIds.clear();
+ // service does not exists , mpxId.iId2 == KVcxMvcMediaTypeAlbum
VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(1,KVcxMvcMediaTypeAlbum));
HbListView::mCurrentIndex = model->index(1, 0, QModelIndex());
item->mModelIndex = model->index(1, 0, QModelIndex());
- mTestWidget->mIsService = false;
+ mTestWidget->mVideoServices = 0;
mTestWidget->callLongPressedSlot(item, point);
iter = mTestWidget->mContextMenuActions.begin();
QVERIFY(iter != mTestWidget->mContextMenuActions.end());
@@ -796,8 +828,8 @@
// mCurrentLevel == ELevelAlbum
mTestWidget->mCurrentLevel = VideoCollectionCommon::ELevelAlbum;
- // mIsService is false
- mTestWidget->mIsService = false;
+ // service does not exists
+ mTestWidget->mVideoServices = 0;
mTestWidget->callLongPressedSlot(item, point);
iter = mTestWidget->mContextMenuActions.begin();
QVERIFY(iter != mTestWidget->mContextMenuActions.end());
@@ -812,22 +844,21 @@
}
QVERIFY(visibleCount == 4);
- // mIsService is true
+ // service does exists
// object needs to be resetted for the service use
cleanup();
init();
setRowCount(1);
model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
- mTestWidget->initialize(*model);
+ mTestWidget->mVideoServices = videoServices;
+ videoServices->mCurrentService = VideoServices::EUriFetcher;
+ mTestWidget->initialize(*model, videoServices);
HbListView::mCurrentIndex = model->index(0, 0, QModelIndex());
mTestWidget->mItem->mModelIndex = HbListView::mCurrentIndex ;
- VideoServices *videoServices = VideoServices::instance();
mTestWidget->mCurrentLevel = VideoCollectionCommon::ELevelAlbum;
VideoSortFilterProxyModelData::mItemIds.append(itemId);
- mTestWidget->mIsService = true;
- mTestWidget->mVideoServices = videoServices;
- videoServices->mCurrentService = VideoServices::EUriFetcher;
+
mTestWidget->callLongPressedSlot(item, point);
iter = mTestWidget->mContextMenuActions.begin();
QVERIFY(iter != mTestWidget->mContextMenuActions.end());
@@ -857,6 +888,7 @@
++iter;
}
QVERIFY(visibleCount == 0);
+ videoServices->decreaseReferenceCount();
}
void TestListWidget::testDoDelayedsSlot()
@@ -901,7 +933,10 @@
mTestWidget->initialize(*model);
connect(this, SIGNAL(testSignal()), mTestWidget, SLOT(deleteItemSlot()));
+ HbMessageBox *box = new HbMessageBox();
+
// no model
+ VideoListDataModelData::mDataAccessCount = 0;
VideoSortFilterProxyModel *tmp = mTestWidget->mModel;
mTestWidget->mModel = 0;
emit testSignal();
@@ -912,6 +947,7 @@
mTestWidget->mModel = tmp;
// data fetched from item is invalid
+ VideoListDataModelData::mDataAccessCount = 0;
setRowCount(1);
mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex());
emit testSignal();
@@ -921,6 +957,7 @@
setRowCount(0);
// data is valid
+ VideoListDataModelData::mDataAccessCount = 0;
setRowCount(1);
QVariant data = QString("test");
VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data);
@@ -929,7 +966,8 @@
// messagebox question returns false
HbMessageBoxData::mQuestionReturnValue = false;
emit testSignal();
- QVERIFY(VideoListDataModelData::dataAccessCount() == 2);
+ box->emitDialogFinished(mTestWidget, SLOT(deleteItemDialogFinished(HbAction *)), 1);
+ QVERIFY(VideoListDataModelData::dataAccessCount() == 1);
QVERIFY(!HbMessageBoxData::mLatestTxt.isEmpty());
QVERIFY(!VideoSortFilterProxyModelData::mLastIndex.isValid());
HbMessageBoxData::mLatestTxt = "";
@@ -938,10 +976,12 @@
VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data);
// messagebox question returns true
+ VideoListDataModelData::mDataAccessCount = 0;
VideoSortFilterProxyModelData::mDeleteItemsFails = false;
HbMessageBoxData::mQuestionReturnValue = true;
emit testSignal();
- QVERIFY(VideoListDataModelData::dataAccessCount() == 3);
+ box->emitDialogFinished(mTestWidget, SLOT(deleteItemDialogFinished(HbAction *)), 0);
+ QVERIFY(VideoListDataModelData::dataAccessCount() == 1);
QVERIFY(!HbMessageBoxData::mLatestTxt.isEmpty());
QVERIFY(VideoSortFilterProxyModelData::mLastIndex.row() == 0);
@@ -957,6 +997,8 @@
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
+ HbInputDialog *dialog = new HbInputDialog();
+
connect(this, SIGNAL(testSignal()), mTestWidget, SLOT(renameSlot()));
VideoSortFilterProxyModelData::reset();
@@ -965,70 +1007,82 @@
// Good case
VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
- HbInputDialog::mGetTextReturnValue = "renamedVideo";
- HbInputDialog::mGetTextCallCount = 0;
+ HbInputDialog::mValueReturnValue = "renamedVideo";
+ HbInputDialog::mValueCallCount = 0;
+ HbInputDialog::mOpenCallCount = 0;
setRowCount(1);
VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(0, KVcxMvcMediaTypeAlbum));
QVariant data = QString("albumName");
VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data);
mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex());
emit testSignal();
+ dialog->emitDialogFinished(mTestWidget, SLOT(renameDialogFinished(HbAction *)), 0);
QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "renamedVideo");
- QCOMPARE(HbInputDialog::mGetTextCallCount, 1);
-
+ QCOMPARE(HbInputDialog::mOpenCallCount, 1);
+ QVERIFY(HbInputDialog::mValueCallCount == 1);
+
// New name is same as previous
- HbInputDialog::mGetTextReturnValue = QString();
- HbInputDialog::mGetTextCallCount = 0;
+ HbInputDialog::mValueReturnValue = "";
+ HbInputDialog::mValueCallCount = 0;
+ HbInputDialog::mOpenCallCount = 0;
VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
data = QString("albumName");
VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data);
mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex());
emit testSignal();
+ dialog->emitDialogFinished(mTestWidget, SLOT(renameDialogFinished(HbAction *)), 0);
QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "");
- QCOMPARE(HbInputDialog::mGetTextCallCount, 1);
+ QCOMPARE(HbInputDialog::mOpenCallCount, 1);
+ QVERIFY(HbInputDialog::mValueCallCount == 1);
+
+ // Dialog canceled
+ HbInputDialog::mValueReturnValue = "";
+ HbInputDialog::mValueCallCount = 0;
+ HbInputDialog::mOpenCallCount = 0;
+ VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
+ data = QString("albumName");
+ VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data);
+ mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex());
+ emit testSignal();
+ dialog->emitDialogFinished(mTestWidget, SLOT(renameDialogFinished(HbAction *)), 1);
+ QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "");
+ QCOMPARE(HbInputDialog::mOpenCallCount, 1);
+ QVERIFY(HbInputDialog::mValueCallCount == 1);
- // Getting name from input dialog fails
- HbInputDialog::mGetTextFails = true;
+ // New name is empty.
VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
- HbInputDialog::mGetTextReturnValue = QString();
- HbInputDialog::mGetTextCallCount = 0;
+ HbInputDialog::mValueReturnValue = "";
+ HbInputDialog::mValueCallCount = 0;
+ HbInputDialog::mOpenCallCount = 0;
+ data = QString("albumName");
+ VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data);
+ mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex());
+ emit testSignal();
+ dialog->emitDialogFinished(mTestWidget, SLOT(renameDialogFinished(HbAction *)), 0);
+ QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "");
+ QCOMPARE(HbInputDialog::mOpenCallCount, 1);
+ QVERIFY(HbInputDialog::mValueCallCount == 1);
+
+ // Item is video
+ VideoSortFilterProxyModelData::mItemIds.clear();
+ VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(0, KVcxMvcMediaTypeVideo));
+ VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
+ HbInputDialog::mValueReturnValue = "";
+ HbInputDialog::mValueCallCount = 0;
+ HbInputDialog::mOpenCallCount = 0;
data = QString("albumName");
VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data);
mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex());
emit testSignal();
QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "");
- QCOMPARE(HbInputDialog::mGetTextCallCount, 1);
-
- // New name is empty.
- HbInputDialog::mGetTextFails = false;
- VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
- HbInputDialog::mGetTextReturnValue = "";
- HbInputDialog::mGetTextCallCount = 0;
- data = QString("albumName");
- VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data);
- mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex());
- emit testSignal();
- QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "");
- QCOMPARE(HbInputDialog::mGetTextCallCount, 1);
-
- // Item is video
- VideoSortFilterProxyModelData::mItemIds.clear();
- VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(0, KVcxMvcMediaTypeVideo));
- HbInputDialog::mGetTextFails = false;
- VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
- HbInputDialog::mGetTextReturnValue = "";
- HbInputDialog::mGetTextCallCount = 0;
- data = QString("albumName");
- VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data);
- mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex());
- emit testSignal();
- QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "");
- QCOMPARE(HbInputDialog::mGetTextCallCount, 0);
+ QCOMPARE(HbInputDialog::mOpenCallCount, 0);
+ QVERIFY(HbInputDialog::mValueCallCount == 0);
// No model
VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
- HbInputDialog::mGetTextReturnValue = "renamedVideo";
- HbInputDialog::mGetTextCallCount = 0;
+ HbInputDialog::mValueReturnValue = "renamedVideo";
+ HbInputDialog::mValueCallCount = 0;
+ HbInputDialog::mOpenCallCount = 0;
VideoSortFilterProxyModelData::mItemIds.clear();
VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(0, KVcxMvcMediaTypeAlbum));
data = QString("albumName");
@@ -1039,12 +1093,13 @@
emit testSignal();
mTestWidget->mModel = tmp;
QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "");
- QCOMPARE(HbInputDialog::mGetTextCallCount, 0);
+ QCOMPARE(HbInputDialog::mOpenCallCount, 0);
// Variant data is invalid
VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
- HbInputDialog::mGetTextReturnValue = "renamedVideo";
- HbInputDialog::mGetTextCallCount = 0;
+ HbInputDialog::mValueReturnValue = "renamedVideo";
+ HbInputDialog::mValueCallCount = 0;
+ HbInputDialog::mOpenCallCount = 0;
VideoSortFilterProxyModelData::mItemIds.clear();
VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(0, KVcxMvcMediaTypeAlbum));
data = QVariant();
@@ -1052,7 +1107,7 @@
mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex());
emit testSignal();
QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "");
- QCOMPARE(HbInputDialog::mGetTextCallCount, 0);
+ QCOMPARE(HbInputDialog::mOpenCallCount, 0);
disconnect(this, SIGNAL(testSignal()), mTestWidget, SLOT(renameSlot()));
}
@@ -1233,6 +1288,7 @@
HbListView::mCurrentIndex = model->index(0, 0, QModelIndex());
connect(this, SIGNAL(testSignal()), mTestWidget, SLOT(removeCollectionSlot()));
+ HbMessageBox *box = new HbMessageBox();
setRowCount(2);
TMPXItemId savedId = TMPXItemId(1,1);
@@ -1258,6 +1314,7 @@
// valid data
VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, "test");
emit testSignal();
+ box->emitDialogFinished(mTestWidget, SLOT(removeCollectionDialogFinished(HbAction *)), 0);
QVERIFY(VideoSortFilterProxyModelData::mLastIndex.isValid());
QVERIFY(VideoSortFilterProxyModelData::mLastIndex.row() == 1);
QVERIFY(!HbMessageBoxData::mLatestTxt.isEmpty());
@@ -1267,6 +1324,7 @@
HbMessageBoxData::mLatestTxt = "";
HbMessageBoxData::mQuestionReturnValue = false;
emit testSignal();
+ box->emitDialogFinished(mTestWidget, SLOT(removeCollectionDialogFinished(HbAction *)), 1);
QVERIFY(!VideoSortFilterProxyModelData::mLastIndex.isValid());
QVERIFY(!HbMessageBoxData::mLatestTxt.isEmpty());
@@ -1329,7 +1387,7 @@
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
- QSignalSpy spysignal(mTestWidget, SIGNAL(collectionOpened(bool, const QString&, const QModelIndex&)));
+ QSignalSpy spysignal(mTestWidget, SIGNAL(collectionOpened(bool, const QString&, const TMPXItemId&)));
connect(this, SIGNAL(testSignal()), mTestWidget, SLOT(back()));
// no model
emit testSignal();
--- a/videocollection/videocollectionview/tsrc/testvideocollectionuiloader/src/testvideocollectionuiloader.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionview/tsrc/testvideocollectionuiloader/src/testvideocollectionuiloader.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -211,6 +211,15 @@
mTestObject->addData(params,
this,
SLOT(handleObjectReady(QObject*, const QString&)));
+
+ // first test the findWidget with loadIfNotFound == false.
+ bannerWidget =
+ mTestObject->findWidget<HbGroupBox>(
+ DOCML_NAME_VC_HEADINGBANNER, false);
+ QVERIFY(!bannerWidget);
+ QVERIFY(!mObjects.contains(DOCML_NAME_VC_HEADINGBANNER));
+
+ // then with default value.
bannerWidget =
mTestObject->findWidget<HbGroupBox>(
DOCML_NAME_VC_HEADINGBANNER);
@@ -295,6 +304,13 @@
// -object added in loading queue
params.append(addToCollectionParam);
mTestObject->addData(params, this, SLOT(handleObjectReady(QObject*, const QString&)));
+
+ // first test with loadIfNotFound == false
+ addToCollection = mTestObject->findObject<HbAction>(DOCML_NAME_ADD_TO_COLLECTION, false);
+ QVERIFY(!addToCollection);
+ QVERIFY(!mObjects.contains(DOCML_NAME_ADD_TO_COLLECTION));
+
+ // then with default value.
addToCollection = mTestObject->findObject<HbAction>(DOCML_NAME_ADD_TO_COLLECTION);
QVERIFY(addToCollection);
QVERIFY(mObjects.contains(DOCML_NAME_ADD_TO_COLLECTION));
@@ -849,9 +865,9 @@
{
if (name == DOCML_NAME_VIEW)
{
- HbMainWindow *window = hbInstance->allMainWindows().at(0);
- if (window)
+ if(hbInstance->allMainWindows().count())
{
+ HbMainWindow *window = hbInstance->allMainWindows().at(0);
HbView *view = qobject_cast<HbView*>(object);
if (view)
{
--- a/videocollection/videocollectionview/tsrc/testvideocollectionviewutils/inc/testvideocollectionviewutils.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionview/tsrc/testvideocollectionviewutils/inc/testvideocollectionviewutils.h Thu Jul 22 16:34:17 2010 +0100
@@ -79,7 +79,16 @@
* verifies sortModel
*/
void testSortModel();
-
+
+ /**
+ * verifies setWidgetLevel & getWidgetLevel
+ */
+ void testSetAndGetWidgetLevel();
+
+ /**
+ * verifies setCollectionActivityData & getCollectionActivityData
+ */
+ void testSetAndGetCollectionActivityData();
};
--- a/videocollection/videocollectionview/tsrc/testvideocollectionviewutils/src/testvideocollectionviewutils.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionview/tsrc/testvideocollectionviewutils/src/testvideocollectionviewutils.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -16,27 +16,38 @@
*/
#include <qapplication.h>
+#include <vcxmyvideosdefs.h>
#include "centralrepository.h"
#include "testvideocollectionviewutils.h"
#include "hblabel.h"
#include "hbaction.h"
#include "videocollectionwrapper.h"
#include "videosortfilterproxymodeldata.h"
+#include "videoactivitystate.h"
#include "videocollectioncommon.h"
#include "centralrepository.h"
#include "hbmessageboxdata.h"
#include "hbnotificationdialog.h"
#include "hblistview.h"
+#include <hbactivitymanager.h>
+#include <hbapplication.h>
#define private public
#include "videocollectionviewutils.h"
#undef private
// following consts are copied from videocollectionviewutils.cpp
-const int KVideoSortingRoleKey(0x5);
-const int KVideoSortingOrderKey(0x6);
-const int KCollectionsSortingRoleKey(0x7);
-const int KCollectionsSortingOrderKey(0x8);
+const int KVideoSortingRoleKey(0x1);
+const int KVideoSortingOrderKey(0x2);
+const int KCollectionsSortingRoleKey(0x3);
+const int KCollectionsSortingOrderKey(0x4);
+static const QString KEY_WIDGET_LEVEL = "_VideoActivity_widget_level_";
+
+// id of the collection whose videolist is to be shown (int).
+static const QString KEY_COLLECTION_ID = "_VideoActivity_collection_id_";
+
+// name of the collection whose videolist is to be shown (QString)
+static const QString KEY_COLLECTION_NAME = "_VideoActivity_collection_name_";
// ---------------------------------------------------------------------------
// main
@@ -44,7 +55,9 @@
//
int main(int argc, char *argv[])
{
- QApplication app(argc, argv);
+ HbApplication app(argc, argv);
+ //HbMainWindow window;
+ //QApplication app(argc, argv);
TestVideoVideoCollectionViewUtils tv;
@@ -91,96 +104,148 @@
{
VideoCollectionViewUtils &testObject(VideoCollectionViewUtils::instance());
QVariant additional;
+ QList<QVariant> dataList;
QString txt = "__test__";
- HbMessageBoxData::mWarningCallCount = 0;
HbNotificationDialog::mNotifDialogTitle = "";
HbNotificationDialog::mTitleTextWRapping = Hb::TextNoWrap;
HbNotificationDialog::mAttribute = Qt::WA_Disabled;
-
+ HbMessageBoxData::mType = -1;
+ HbMessageBoxData::mShowCallCount = 0;
// status: VideoCollectionCommon::statusSingleDeleteFail
additional = txt;
testObject.showStatusMsgSlot(VideoCollectionCommon::statusSingleDeleteFail, additional);
- QVERIFY(HbMessageBoxData::mWarningCallCount == 1);
+ QVERIFY(HbMessageBoxData::mType == HbMessageBox::MessageTypeWarning);
+ QVERIFY(HbMessageBoxData::mShowCallCount == 1);
QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
- HbMessageBoxData::mWarningCallCount = 0;
+ QVERIFY(HbMessageBoxData::mType == HbMessageBox::MessageTypeWarning);
+ HbMessageBoxData::mType = -1;
+ HbMessageBoxData::mShowCallCount = 0;
HbMessageBoxData::mInformationCallCount = 0;
-
// - invalid additional
additional = QVariant();
testObject.showStatusMsgSlot(VideoCollectionCommon::statusSingleDeleteFail, additional);
- QVERIFY(HbMessageBoxData::mWarningCallCount == 0);
+ QVERIFY(HbMessageBoxData::mType == -1);
+ QVERIFY(HbMessageBoxData::mShowCallCount == 0);
QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
+ HbMessageBoxData::mType = -1;
+ HbMessageBoxData::mShowCallCount = 0;
// status: VideoCollectionCommon::statusMultipleDeleteFail
additional = txt;
testObject.showStatusMsgSlot(VideoCollectionCommon::statusMultipleDeleteFail, additional);
- QVERIFY(HbMessageBoxData::mWarningCallCount == 1);
+ QVERIFY(HbMessageBoxData::mShowCallCount == 1);
+ QVERIFY(HbMessageBoxData::mType == HbMessageBox::MessageTypeWarning);
QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
- HbMessageBoxData::mWarningCallCount = 0;
+ HbMessageBoxData::mType = -1;
+ HbMessageBoxData::mShowCallCount = 0;
// - invalid additional (no change, since additional not excepted)
additional = QVariant();
testObject.showStatusMsgSlot(VideoCollectionCommon::statusMultipleDeleteFail, additional);
- QVERIFY(HbMessageBoxData::mWarningCallCount == 1);
+ QVERIFY(HbMessageBoxData::mType == HbMessageBox::MessageTypeWarning);
+ QVERIFY(HbMessageBoxData::mShowCallCount == 1);
QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
- HbMessageBoxData::mWarningCallCount = 0;
+ HbMessageBoxData::mType = -1;
+ HbMessageBoxData::mShowCallCount = 0;
// status: VideoCollectionCommon::statusMultipleRemoveFail (additional not needed)
additional = QVariant();
testObject.showStatusMsgSlot(VideoCollectionCommon::statusMultiRemoveFail, additional);
- QVERIFY(HbMessageBoxData::mWarningCallCount == 1);
+ QVERIFY(HbMessageBoxData::mShowCallCount == 1);
+ QVERIFY(HbMessageBoxData::mType == HbMessageBox::MessageTypeWarning);
QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
- HbMessageBoxData::mWarningCallCount = 0;
+ HbMessageBoxData::mType = -1;
+ HbMessageBoxData::mShowCallCount = 0;
// status: VideoCollectionCommon::statusVideosAddedToCollection
// notification dialog shown
- additional = txt;
+ dataList.clear();
+ dataList.append(QVariant(1)); // count
+ dataList.append(QVariant(txt)); // name
+ additional = dataList;
testObject.showStatusMsgSlot(VideoCollectionCommon::statusVideosAddedToCollection, additional);
- QVERIFY(HbMessageBoxData::mWarningCallCount == 0);
+ QVERIFY(HbMessageBoxData::mShowCallCount == 0);
+ QVERIFY(HbMessageBoxData::mType == -1);
QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() > 0);
QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextWordWrap);
QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_DeleteOnClose);
- HbMessageBoxData::mWarningCallCount = 0;
HbNotificationDialog::mNotifDialogTitle = "";
HbNotificationDialog::mTitleTextWRapping = Hb::TextNoWrap;
HbNotificationDialog::mAttribute = Qt::WA_Disabled;
+
+ // - too few additional
+ dataList.clear();
+ dataList.append(QVariant(txt)); // name
+ additional = dataList;
+ testObject.showStatusMsgSlot(VideoCollectionCommon::statusVideosAddedToCollection, additional);
+ QVERIFY(HbMessageBoxData::mShowCallCount == 0);
+ QVERIFY(HbMessageBoxData::mType == -1);
+ QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
+ QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
+ QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
+ // - empty message
+ dataList.clear();
+ dataList.append(QVariant(1)); // count
+ dataList.append(QVariant("")); // name
+ additional = dataList;
+ testObject.showStatusMsgSlot(VideoCollectionCommon::statusVideosAddedToCollection, additional);
+ QVERIFY(HbMessageBoxData::mShowCallCount == 0);
+ QVERIFY(HbMessageBoxData::mType == -1);
+ QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
+ QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
+ QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
+
+ // - with zero video count
+ dataList.clear();
+ dataList.append(QVariant(0)); // count
+ dataList.append(QVariant(txt)); // name
+ additional = dataList;
+ testObject.showStatusMsgSlot(VideoCollectionCommon::statusVideosAddedToCollection, additional);
+ QVERIFY(HbMessageBoxData::mShowCallCount == 0);
+ QVERIFY(HbMessageBoxData::mType == -1);
+ QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
+ QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
+ QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
+
// - invalid additional
additional = QVariant();
testObject.showStatusMsgSlot(VideoCollectionCommon::statusVideosAddedToCollection, additional);
- QVERIFY(HbMessageBoxData::mWarningCallCount == 0);
+ QVERIFY(HbMessageBoxData::mShowCallCount == 0);
QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
// status: VideoCollectionCommon::statusAllVideosAlreadyInCollection
testObject.showStatusMsgSlot(VideoCollectionCommon::statusAllVideosAlreadyInCollection, additional);
- QVERIFY(HbMessageBoxData::mWarningCallCount == 1);
+ QVERIFY(HbMessageBoxData::mShowCallCount == 1);
+ QVERIFY(HbMessageBoxData::mType == HbMessageBox::MessageTypeWarning);
QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
- HbMessageBoxData::mWarningCallCount = 0;
+ HbMessageBoxData::mShowCallCount = 0;
+ HbMessageBoxData::mType = -1;
// status: VideoCollectionCommon::statusDeleteInProgress
additional = txt;
testObject.showStatusMsgSlot(VideoCollectionCommon::statusDeleteInProgress, additional);
- QVERIFY(HbMessageBoxData::mWarningCallCount == 0);
+ QVERIFY(HbMessageBoxData::mShowCallCount == 0);
+ QVERIFY(HbMessageBoxData::mType == -1);
QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() > 0);
QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextWordWrap);
QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_DeleteOnClose);
- HbMessageBoxData::mWarningCallCount = 0;
HbNotificationDialog::mNotifDialogTitle = "";
HbNotificationDialog::mTitleTextWRapping = Hb::TextNoWrap;
HbNotificationDialog::mAttribute = Qt::WA_Disabled;
@@ -188,7 +253,8 @@
// - invalid additional
additional = QVariant();
testObject.showStatusMsgSlot(VideoCollectionCommon::statusDeleteInProgress, additional);
- QVERIFY(HbMessageBoxData::mWarningCallCount == 0);
+ QVERIFY(HbMessageBoxData::mShowCallCount == 0);
+ QVERIFY(HbMessageBoxData::mType == -1);
QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
@@ -196,16 +262,19 @@
// status: VideoCollectionCommon::statusSingleRemoveFail
additional = txt;
testObject.showStatusMsgSlot(VideoCollectionCommon::statusSingleRemoveFail, additional);
- QVERIFY(HbMessageBoxData::mWarningCallCount == 1);
+ QVERIFY(HbMessageBoxData::mShowCallCount == 1);
+ QVERIFY(HbMessageBoxData::mType == HbMessageBox::MessageTypeWarning);
QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
- HbMessageBoxData::mWarningCallCount = 0;
+ HbMessageBoxData::mShowCallCount = 0;
+ HbMessageBoxData::mType = -1;
// - invalid additional
additional = QVariant();
testObject.showStatusMsgSlot(VideoCollectionCommon::statusSingleRemoveFail, additional);
- QVERIFY(HbMessageBoxData::mWarningCallCount == 0);
+ QVERIFY(HbMessageBoxData::mShowCallCount == 0);
+ QVERIFY(HbMessageBoxData::mType == -1);
QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
@@ -213,33 +282,34 @@
// status: statusMultiRemoveFail
additional = txt;
testObject.showStatusMsgSlot(VideoCollectionCommon::statusMultiRemoveFail, additional);
- QVERIFY(HbMessageBoxData::mWarningCallCount == 1);
+ QVERIFY(HbMessageBoxData::mShowCallCount == 1);
+ QVERIFY(HbMessageBoxData::mType == HbMessageBox::MessageTypeWarning);
QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
- HbMessageBoxData::mWarningCallCount = 0;
+ HbMessageBoxData::mShowCallCount = 0;
+ HbMessageBoxData::mType = -1;
// invalid additional (no change, since additional not excepted)
additional = QVariant();
testObject.showStatusMsgSlot(VideoCollectionCommon::statusMultiRemoveFail, additional);
- QVERIFY(HbMessageBoxData::mWarningCallCount == 1);
+ QVERIFY(HbMessageBoxData::mShowCallCount == 1);
+ QVERIFY(HbMessageBoxData::mType == HbMessageBox::MessageTypeWarning);
QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
- HbMessageBoxData::mWarningCallCount = 0;
-
+ HbMessageBoxData::mShowCallCount = 0;
+ HbMessageBoxData::mType = -1;
// invalid state
additional = txt;
testObject.showStatusMsgSlot(0, additional);
- QVERIFY(HbMessageBoxData::mWarningCallCount == 0);
+ QVERIFY(HbMessageBoxData::mShowCallCount == 0);
+ QVERIFY(HbMessageBoxData::mType == -1);
QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
- HbMessageBoxData::mWarningCallCount = 0;
-
}
-
// -----------------------------------------------------------------------------
// testSaveSortingValues
@@ -565,6 +635,10 @@
}
+// -----------------------------------------------------------------------------
+// testSortModel
+// -----------------------------------------------------------------------------
+//
void TestVideoVideoCollectionViewUtils::testSortModel()
{
VideoCollectionViewUtils &testObject(VideoCollectionViewUtils::instance());
@@ -636,6 +710,92 @@
QVERIFY(testObject.mCollectionsSortOrder == Qt::DescendingOrder);
}
+// -----------------------------------------------------------------------------
+// testSetAndGetWidgetLevel
+// -----------------------------------------------------------------------------
+//
+void TestVideoVideoCollectionViewUtils::testSetAndGetWidgetLevel()
+{
+ static const char* ACTIVITY_VIDEOS_MAINVIEW = "VideosMainView";
+
+ VideoCollectionCommon::TCollectionLevels level;
+
+ // Invalid level
+ level = VideoCollectionCommon::ELevelInvalid;
+ VideoCollectionViewUtils::setWidgetActivityLevel(level);
+ VideoCollectionViewUtils::getActivityWidgetLevel( level);
+ QVERIFY(level == VideoCollectionCommon::ELevelVideos);
+
+ // Category level.
+ level = VideoCollectionCommon::ELevelCategory;
+ VideoCollectionViewUtils::setWidgetActivityLevel(level);
+ VideoCollectionViewUtils::getActivityWidgetLevel( level);
+ QVERIFY(level == VideoCollectionCommon::ELevelCategory);
+
+ // make sure unneeded data is cleared
+ TMPXItemId id = TMPXItemId(1,1);
+ QString name = "name";
+ VideoCollectionViewUtils::setCollectionActivityData(id, name);
+ level = VideoCollectionCommon::ELevelVideos;
+ VideoCollectionViewUtils::setWidgetActivityLevel(level);
+
+ QVERIFY(level == VideoCollectionCommon::ELevelVideos);
+ QVariant data = VideoActivityState::instance().getActivityData(KEY_COLLECTION_ID);
+ QVERIFY(data.toInt() == 0);
+ data = VideoActivityState::instance().getActivityData(KEY_COLLECTION_NAME);
+ QVERIFY(data.toString().isEmpty());
+
+ id = TMPXItemId(1,1);
+ name = "name";
+ VideoCollectionViewUtils::setCollectionActivityData(id, name);
+ level = VideoCollectionCommon::ELevelAlbum;
+ VideoCollectionViewUtils::setWidgetActivityLevel(level);
+
+ QVERIFY(level == VideoCollectionCommon::ELevelAlbum);
+ data = VideoActivityState::instance().getActivityData(KEY_COLLECTION_ID);
+ QVERIFY(data.toInt() == 1);
+ data = VideoActivityState::instance().getActivityData(KEY_COLLECTION_NAME);
+ QVERIFY(data.toString() == "name");
+
+}
+
+void TestVideoVideoCollectionViewUtils::testSetAndGetCollectionActivityData()
+{
+ TMPXItemId id = TMPXItemId(1,1);
+ QString name = "name";
+
+ // no default collection nor user defined collection
+ VideoCollectionCommon::TCollectionLevels level = VideoCollectionCommon::ELevelVideos;
+ VideoCollectionViewUtils::setWidgetActivityLevel(level);
+ VideoCollectionViewUtils::setCollectionActivityData(id, name);
+ VideoCollectionViewUtils::getCollectionActivityData(id, name);
+ QVERIFY(id == TMPXItemId::InvalidId());
+ QVERIFY(name.isEmpty());
+
+ // default collection
+ level = VideoCollectionCommon::ELevelDefaultColl;
+ id = TMPXItemId(1,1);
+ name = "name";
+ VideoCollectionViewUtils::setWidgetActivityLevel(level);
+ VideoCollectionViewUtils::setCollectionActivityData(id, name);
+ VideoCollectionViewUtils::getCollectionActivityData(id, name);
+
+ QVERIFY(id == TMPXItemId(1, KVcxMvcMediaTypeCategory));
+ QVERIFY(name == "name");
+
+ // user defined collection
+ level = VideoCollectionCommon::ELevelAlbum;
+ id = TMPXItemId(1,1);
+ name = "name";
+ VideoCollectionViewUtils::setWidgetActivityLevel(level);
+ VideoCollectionViewUtils::setCollectionActivityData(id, name);
+ VideoCollectionViewUtils::getCollectionActivityData(id, name);
+
+ QVERIFY(id == TMPXItemId(1, KVcxMvcMediaTypeAlbum));
+ QVERIFY(name == "name");
+
+}
+
// End of file
--- a/videocollection/videocollectionview/tsrc/testvideocollectionviewutils/testvideocollectionviewutils.pro Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionview/tsrc/testvideocollectionviewutils/testvideocollectionviewutils.pro Thu Jul 22 16:34:17 2010 +0100
@@ -53,7 +53,7 @@
\ # sources needed in test
../../src/videocollectionviewutils.cpp
-TESTEDCLASS = videocollectionviewutils.cpp
+TESTEDCLASS = videocollectionviewutils
include(../../../tsrc/stubs/stubs.pro)
--- a/videocollection/videocollectionview/tsrc/testvideolistselectiondialog/inc/videolistselectiondialogtester.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionview/tsrc/testvideolistselectiondialog/inc/videolistselectiondialogtester.h Thu Jul 22 16:34:17 2010 +0100
@@ -91,16 +91,19 @@
void disconnectSignals()
{
- disconnect(this, SIGNAL(markAllSignal(int)), mTestable, SLOT(markAllStateChangedSlot(int)));
- disconnect(this, SIGNAL(selectionChangedSignal(const QItemSelection&, const QItemSelection&)),
- mTestable, SLOT(selectionChangedSlot(const QItemSelection&, const QItemSelection&)));
- disconnect(this, SIGNAL(singleItemSelectedSignal(const QModelIndex&)),
- mTestable, SLOT(singleItemSelectedSlot(const QModelIndex&)));
- disconnect(this, SIGNAL(modelReadySignal()), mTestable, SLOT(modelReadySlot()));
- disconnect(this, SIGNAL(updateCounterSignal()), mTestable, SLOT(updateCounterSlot()));
- disconnect(this, SIGNAL(primaryActionTriggeredSignal()),
- mTestable, SLOT(primaryActionTriggeredSlot()));
- disconnect(this, SIGNAL(finishedSignal(HbAction*)), mTestable, SLOT(finishedSlot(HbAction*)));
+ if(mTestable)
+ {
+ disconnect(this, SIGNAL(markAllSignal(int)), mTestable, SLOT(markAllStateChangedSlot(int)));
+ disconnect(this, SIGNAL(selectionChangedSignal(const QItemSelection&, const QItemSelection&)),
+ mTestable, SLOT(selectionChangedSlot(const QItemSelection&, const QItemSelection&)));
+ disconnect(this, SIGNAL(singleItemSelectedSignal(const QModelIndex&)),
+ mTestable, SLOT(singleItemSelectedSlot(const QModelIndex&)));
+ disconnect(this, SIGNAL(modelReadySignal()), mTestable, SLOT(modelReadySlot()));
+ disconnect(this, SIGNAL(updateCounterSignal()), mTestable, SLOT(updateCounterSlot()));
+ disconnect(this, SIGNAL(primaryActionTriggeredSignal()),
+ mTestable, SLOT(primaryActionTriggeredSlot()));
+ disconnect(this, SIGNAL(finishedSignal(HbAction*)), mTestable, SLOT(finishedSlot(HbAction*)));
+ }
}
void emitMarkAllStateChanged(int state)
--- a/videocollection/videocollectionview/tsrc/testvideolistselectiondialog/src/testvideolistselectiondialog.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionview/tsrc/testvideolistselectiondialog/src/testvideolistselectiondialog.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -22,10 +22,11 @@
#include "hbdocumentloader.h"
#include "hbstackedwidget.h"
#include "hbcheckbox.h"
+#include "hbinputdialog.h"
#include "hbdialog.h"
#include "hbwidget.h"
#include "hblistview.h"
-#include "hbinputdialog.h"
+#include "hbmessagebox.h"
#include "testvideolistselectiondialog.h"
@@ -177,6 +178,8 @@
void TestVideoListSelectionDialog::testConstructDestruct()
{
QVERIFY(mInitOk == true);
+ mTestHelper->disconnectSignals();
+ mTestHelper->mTestable = 0;
QVERIFY(mTestObject != 0);
QVERIFY(mTestObject->mModel != 0);
@@ -210,6 +213,8 @@
{
VideoCollectionWrapperData::reset();
VideoListWidgetData::reset();
+ cleanup();
+ init();
QVERIFY(mInitOk == true);
QVERIFY(mModel != 0);
@@ -231,6 +236,7 @@
QCOMPARE(mTestObject->mSelection.count(), 0);
QCOMPARE(mTestObject->mSelectedVideos.count(), 1);
QVERIFY(mTestObject->mSelectedAlbumId == TMPXItemId::InvalidId());
+ QVERIFY(mTestObject->mNewAlbumText.isNull());
QVERIFY(mTestObject->mModel != 0);
QVERIFY(mTestObject->mListWidget != 0);
QVERIFY(mTestObject->mListContainer != 0);
@@ -253,6 +259,7 @@
QCOMPARE(mTestObject->mSelection.count(), 0);
QCOMPARE(mTestObject->mSelectedVideos.count(), 1);
QVERIFY(mTestObject->mSelectedAlbumId == TMPXItemId::InvalidId());
+ QVERIFY(mTestObject->mNewAlbumText.isNull());
QVERIFY(mTestObject->mModel != 0);
QVERIFY(mTestObject->mListWidget != 0);
QVERIFY(mTestObject->mListContainer != 0);
@@ -279,6 +286,7 @@
QCOMPARE(mTestObject->mSelection.count(), 0);
QCOMPARE(mTestObject->mSelectedVideos.count(), 1);
QVERIFY(mTestObject->mSelectedAlbumId == TMPXItemId::InvalidId());
+ QVERIFY(mTestObject->mNewAlbumText.isNull());
QVERIFY(mTestObject->mModel != 0);
QVERIFY(mTestObject->mListWidget != 0);
QVERIFY(mTestObject->mListContainer != 0);
@@ -305,6 +313,7 @@
QCOMPARE(mTestObject->mSelection.count(), 0);
QCOMPARE(mTestObject->mSelectedVideos.count(), 1);
QVERIFY(mTestObject->mSelectedAlbumId == TMPXItemId::InvalidId());
+ QVERIFY(mTestObject->mNewAlbumText.isNull());
QVERIFY(mTestObject->mModel != 0);
QVERIFY(mTestObject->mListWidget != 0);
QVERIFY(mTestObject->mListContainer != 0);
@@ -319,6 +328,29 @@
QVERIFY(VideoSortFilterProxyModelData::mGenericFilterId == mpxId);
QVERIFY(!VideoSortFilterProxyModelData::mGenericFilterValue);
+ // No data. type ECreateCollection:. Default mpx item
+ setRowCount(0);
+ mpxId = TMPXItemId();
+ mTestObject->setupContent(VideoListSelectionDialog::ECreateCollection, mpxId);
+ QVERIFY(mTestObject->mTypeOfSelection == VideoListSelectionDialog::ECreateCollection);
+ QCOMPARE(mTestObject->mSelection.count(), 0);
+ QCOMPARE(mTestObject->mSelectedVideos.count(), 1);
+ QVERIFY(mTestObject->mSelectedAlbumId == TMPXItemId::InvalidId());
+ QVERIFY(mTestObject->mNewAlbumText.isNull());
+ QVERIFY(mTestObject->mModel != 0);
+ QVERIFY(mTestObject->mListWidget != 0);
+ QVERIFY(mTestObject->mListContainer != 0);
+ QVERIFY(mTestObject->mListContainer->mCurrentWidget == mTestObject->mListWidget);
+ QVERIFY(mTestObject->mHeading != 0);
+ QVERIFY(mTestObject->mCheckboxContainer != 0);
+ QVERIFY(mTestObject->mCheckboxContainer->isVisible() == true);
+ QVERIFY(mTestObject->mItemCount != 0);
+ QVERIFY(mTestObject->mCheckBox != 0);
+ QVERIFY(mTestObject->mPrimaryAction != 0);
+ QVERIFY(mTestObject->mSecondaryAction != 0);
+ QVERIFY(VideoSortFilterProxyModelData::mGenericFilterId == mpxId);
+ QVERIFY(!VideoSortFilterProxyModelData::mGenericFilterValue);
+
delete mTestObject;
mTestObject = new VideoListSelectionDialog(mTestUiLoader);
VideoSortFilterProxyModelData::reset();
@@ -331,6 +363,7 @@
QCOMPARE(mTestObject->mSelection.count(), 0);
QCOMPARE(mTestObject->mSelectedVideos.count(), 1);
QVERIFY(mTestObject->mSelectedAlbumId == TMPXItemId::InvalidId());
+ QVERIFY(mTestObject->mNewAlbumText.isNull());
QVERIFY(mTestObject->mModel != 0);
QVERIFY(mTestObject->mListWidget != 0);
QVERIFY(mTestObject->mListContainer != 0);
@@ -357,6 +390,7 @@
QCOMPARE(mTestObject->mSelection.count(), 0);
QCOMPARE(mTestObject->mSelectedVideos.count(), 0);
QVERIFY(mTestObject->mSelectedAlbumId == mpxId);
+ QVERIFY(mTestObject->mNewAlbumText.isNull());
QVERIFY(mTestObject->mModel != 0);
QVERIFY(mTestObject->mListWidget != 0);
QVERIFY(mTestObject->mListContainer != 0);
@@ -382,6 +416,7 @@
QCOMPARE(mTestObject->mSelection.count(), 0);
QCOMPARE(mTestObject->mSelectedVideos.count(), 0);
QVERIFY(mTestObject->mSelectedAlbumId == TMPXItemId::InvalidId());
+ QVERIFY(mTestObject->mNewAlbumText.isNull());
QVERIFY(mTestObject->mModel != 0);
QVERIFY(mTestObject->mListWidget != 0);
QVERIFY(mTestObject->mListContainer != 0);
@@ -407,6 +442,7 @@
QCOMPARE(mTestObject->mSelection.count(), 0);
QCOMPARE(mTestObject->mSelectedVideos.count(), 0);
QVERIFY(mTestObject->mSelectedAlbumId == TMPXItemId::InvalidId());
+ QVERIFY(mTestObject->mNewAlbumText.isNull());
QVERIFY(mTestObject->mModel != 0);
QVERIFY(mTestObject->mListWidget != 0);
QVERIFY(mTestObject->mListContainer != 0);
@@ -432,6 +468,7 @@
QCOMPARE(mTestObject->mSelection.count(), 0);
QCOMPARE(mTestObject->mSelectedVideos.count(), 0);
QVERIFY(mTestObject->mSelectedAlbumId == TMPXItemId::InvalidId());
+ QVERIFY(mTestObject->mNewAlbumText.isNull());
QVERIFY(mTestObject->mModel != 0);
QVERIFY(mTestObject->mListWidget != 0);
QVERIFY(mTestObject->mListContainer != 0);
@@ -519,8 +556,6 @@
//
void TestVideoListSelectionDialog::testExec()
{
- // there's not much to test in exec -method, basically these
- // are for coberity only
// we're using EDeleteVideos type and make sure correct
// status exists in view utils after exec
TMPXItemId mpxId = TMPXItemId(0, KVcxMvcMediaTypeVideo);
@@ -530,22 +565,39 @@
VideoCollectionViewUtilsData::mLastError = -1;
+ HbDialog::openAmount = 0;
+
// empty model row count
setRowCount(0);
mTestObject->exec();
QVERIFY(VideoCollectionViewUtilsData::mLastError == VideoCollectionCommon::statusDeleteInProgress);
+ QCOMPARE(HbDialog::openAmount, 0);
+ QCOMPARE(HbInputDialog::mOpenCallCount, 0);
VideoCollectionViewUtilsData::mLastError = -1;
// model contains data
setRowCount(10);
mTestObject->exec();
QVERIFY(VideoCollectionViewUtilsData::mLastError == VideoCollectionCommon::statusDeleteInProgress);
+ QCOMPARE(HbDialog::openAmount, 1);
+ QCOMPARE(HbInputDialog::mOpenCallCount, 0);
// just to make sure finishedSlot is called with correct params
+ HbDialog::openAmount = 0;
VideoCollectionViewUtilsData::mLastError = -1;
HbDialog::execReturnPrimary = false;
mTestObject->exec();
QVERIFY(VideoCollectionViewUtilsData::mLastError == -1);
+ QCOMPARE(HbDialog::openAmount, 1);
+ QCOMPARE(HbInputDialog::mOpenCallCount, 0);
+
+ // test with type ECreateCollection
+ HbDialog::openAmount = 0;
+ mTestObject->setupContent(VideoListSelectionDialog::ECreateCollection, TMPXItemId::InvalidId());
+ HbDialog::execReturnPrimary = true;
+ mTestObject->exec();
+ QCOMPARE(HbDialog::openAmount, 0);
+ QCOMPARE(HbInputDialog::mOpenCallCount, 1);
}
// ---------------------------------------------------------------------------
@@ -590,33 +642,35 @@
QVERIFY(VideoSortFilterProxyModelData::mItemIds.at(0) == TMPXItemId(1,0));
QVERIFY(VideoSortFilterProxyModelData::mItemIds.at(1) == TMPXItemId(2,0));
+ HbInputDialog *dialog = new HbInputDialog();
VideoCollectionViewUtilsData::mLastError = -1;
// mSelectedAlbumId == TMPXItemId::InvalidId())
mpxId = TMPXItemId::InvalidId();
- // queryNewAlbumSelected does not set selected
- HbInputDialog::mGetTextFails = true;
+ // query for new album name does not set selected
mTestObject->setupContent(VideoListSelectionDialog::ESelectCollection, mpxId);
mTestObject->mSelectedVideos.insert(TMPXItemId(1,0));
mTestObject->mSelectedVideos.insert(TMPXItemId(2,0));
VideoSortFilterProxyModelData::reset();
VideoSortFilterProxyModelData::mNewAlbumId = TMPXItemId::InvalidId();
- mTestObject->exec();
+ mTestObject->exec();
+ dialog->emitDialogFinished(mTestObject, SLOT(newAlbumNameDialogFinished(HbAction *)), 1); // No selected.
// type of selection does not change
- QVERIFY(mTestObject->mTypeOfSelection == VideoListSelectionDialog::ESelectCollection);
+ QVERIFY(mTestObject->mTypeOfSelection == VideoListSelectionDialog::EAddToCollection);
// since there's no selected videos, status code does not change
QVERIFY(VideoCollectionViewUtilsData::mLastError == -1);
QVERIFY(VideoSortFilterProxyModelData::mLastItemId == TMPXItemId::InvalidId());
QVERIFY(!VideoSortFilterProxyModelData::mItemIds.count());
- // queryNewAlbumSelected sets selected
- HbInputDialog::mGetTextFails = false;
+ // query for new album name sets selected
mTestObject->setupContent(VideoListSelectionDialog::ESelectCollection, mpxId);
mTestObject->mSelectedVideos.insert(TMPXItemId(1,0));
mTestObject->mSelectedVideos.insert(TMPXItemId(2,0));
VideoSortFilterProxyModelData::reset();
VideoSortFilterProxyModelData::mNewAlbumId = TMPXItemId(1,2);
+ HbInputDialog::mValueReturnValue = QVariant(QString("testname"));
mTestObject->exec();
+ dialog->emitDialogFinished(mTestObject, SLOT(newAlbumNameDialogFinished(HbAction *)), 0); // Yes selected.
// type of selection has changed
QVERIFY(mTestObject->mTypeOfSelection == VideoListSelectionDialog::EAddToCollection);
// videos added into collection
@@ -679,13 +733,13 @@
VideoCollectionViewUtilsData::mLastError = -1;
// selected album exist, selected videos exists, name for selected album exist
// (using ESelectCollection type to fetch albumname)
- HbInputDialog::mGetTextFails = false;
mTestObject->setupContent(VideoListSelectionDialog::ESelectCollection, mpxId);
mTestObject->mSelectedVideos.insert(TMPXItemId(1,0));
mTestObject->mSelectedVideos.insert(TMPXItemId(2,0));
VideoSortFilterProxyModelData::reset();
VideoSortFilterProxyModelData::mNewAlbumId = TMPXItemId(1,2);
- mTestObject->exec();
+ mTestObject->exec();
+ dialog->emitDialogFinished(mTestObject, SLOT(newAlbumNameDialogFinished(HbAction *)), 0); // Yes selected.
// type of selection has changed
QVERIFY(mTestObject->mTypeOfSelection == VideoListSelectionDialog::EAddToCollection);
// videos added into collection
@@ -836,8 +890,27 @@
QVERIFY(mTestObject->mSelection.count() == 0);
QVERIFY(mTestObject->mPrimaryAction->isEnabled() == false);
+ mTestObject->setupContent(VideoListSelectionDialog::ECreateCollection, TMPXItemId::InvalidId());
+ QVERIFY(mTestObject->mPrimaryAction->isEnabled() == true);
+ QCOMPARE(mTestObject->mPrimaryAction->text(), hbTrId("txt_common_button_ok"));
+
+ // select item, type ECreateCollection
+ deselected.clear();
+ selected.append(range);
+ mTestHelper->emitSelectionChangedSlot(selected, deselected);
+ QVERIFY(mTestObject->mSelection.count() == 1);
+ QVERIFY(mTestObject->mPrimaryAction->isEnabled() == true);
+ QCOMPARE(mTestObject->mPrimaryAction->text(), hbTrId("txt_common_button_add"));
+
+ // desect item, type ECreateCollection
+ selected.clear();
+ deselected.append(range);
+ mTestHelper->emitSelectionChangedSlot(selected, deselected);
+ QVERIFY(mTestObject->mSelection.count() == 0);
+ QVERIFY(mTestObject->mPrimaryAction->isEnabled() == true);
+ QCOMPARE(mTestObject->mPrimaryAction->text(), hbTrId("txt_common_button_ok"));
+
mTestHelper->disconnectSignals();
-
}
void TestVideoListSelectionDialog::testSingleItemSelectedSlot()
@@ -983,6 +1056,16 @@
QCOMPARE(mTestObject->mSecondaryAction->mTriggeredCount, 0);
QCOMPARE(mTestObject->mSelectedVideos.count(), 0);
+ // nothing selected, album id invalid, type ECreateCollection
+ mTestObject->mSelectedAlbumId = TMPXItemId::InvalidId();
+ mTestObject->mPrimaryAction->mTriggeredCount = 0;
+ mTestObject->mSecondaryAction->mTriggeredCount = 0;
+ mTestObject->mTypeOfSelection = VideoListSelectionDialog::ECreateCollection;
+ mTestHelper->emitPrimaryActionTriggeredSlot();
+ QCOMPARE(mTestObject->mPrimaryAction->mTriggeredCount, 1);
+ QCOMPARE(mTestObject->mSecondaryAction->mTriggeredCount, 0);
+ QCOMPARE(mTestObject->mSelectedVideos.count(), 0);
+
// nothing selected, album id ok
mTestObject->mSelectedAlbumId = TMPXItemId(0, KVcxMvcMediaTypeAlbum);
mTestObject->mPrimaryAction->mTriggeredCount = 0;
@@ -992,7 +1075,7 @@
QCOMPARE(mTestObject->mPrimaryAction->mTriggeredCount, 1);
QCOMPARE(mTestObject->mSecondaryAction->mTriggeredCount, 0);
QCOMPARE(mTestObject->mSelectedVideos.count(), 0);
-
+
setRowCount(10);
VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(0,0));
VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(1,2));
--- a/videocollection/videocollectionview/videocollectionview.pro Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionview/videocollectionview.pro Thu Jul 22 16:34:17 2010 +0100
@@ -26,6 +26,8 @@
BLD_INF_RULES.prj_exports += \
"rom/videocollectionview.iby CORE_APP_LAYER_IBY_EXPORT_PATH(videocollectionview.iby)" \
"conf/videolistview.confml APP_LAYER_CONFML(videolistview.confml)" \
+ "conf/CI_videoplayerservicelist.confml APP_LAYER_CONFML(CI_videoplayerservicelist.confml)" \
+ "conf/videoplayerservicelist.confml APP_LAYER_CONFML(videoplayerservicelist.confml)" \
"conf/videolistview_2002BC63.crml APP_LAYER_CRML(videolistview_2002BC63.crml)"
TARGET.CAPABILITY = ALL -TCB -DRM
@@ -59,7 +61,8 @@
inc/videohintwidget.h \
inc/videocollectionviewutils.h \
inc/videocollectionuiloader.h \
- inc/videolistselectiondialog.h
+ inc/videolistselectiondialog.h \
+ inc/videocollectioncenrepdefs.h
SOURCES += src/videocollectionviewplugin.cpp \
src/videolistview.cpp \
--- a/videocollection/videocollectionwrapper/data/icons/pri_large_video.svg Tue Jun 15 13:09:36 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
- <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
- xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
- x="0px" y="0px" width="98px" height="98px" viewBox="0 0 98 98" enable-background="new 0 0 98 98" xml:space="preserve">
-<defs>
-</defs>
-<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="48.9995" y1="19" x2="48.9995" y2="79.0015">
- <stop offset="0" style="stop-color:#757575"/>
- <stop offset="0.2424" style="stop-color:#000000"/>
- <stop offset="0.8606" style="stop-color:#000000"/>
- <stop offset="1" style="stop-color:#363636"/>
-</linearGradient>
-<path fill="url(#SVGID_1_)" d="M84.5,19h-71c-1.105,0-2,0.896-2,2v56.001c0,1.105,0.895,2,2,2h71c1.104,0,2-0.895,2-2V21
- C86.5,19.896,85.603,19,84.5,19z M20.5,75.001c0,0.551-0.451,1-1,1h-4c-0.551,0-1-0.449-1-1v-2c0-0.549,0.449-1,1-1h4
- c0.549,0,1,0.451,1,1V75.001z M20.5,25c0,0.551-0.451,1-1,1h-4c-0.551,0-1-0.449-1-1v-2c0-0.549,0.449-1,1-1h4c0.549,0,1,0.451,1,1
- V25z M29.5,75.001c0,0.551-0.451,1-1,1h-4c-0.551,0-1-0.449-1-1v-2c0-0.549,0.449-1,1-1h4c0.549,0,1,0.451,1,1V75.001z M29.5,25
- c0,0.551-0.451,1-1,1h-4c-0.551,0-1-0.449-1-1v-2c0-0.549,0.449-1,1-1h4c0.549,0,1,0.451,1,1V25z M38.5,75.001c0,0.551-0.451,1-1,1
- h-4c-0.55,0-1-0.449-1-1v-2c0-0.549,0.449-1,1-1h4c0.549,0,1,0.451,1,1V75.001z M38.5,25c0,0.551-0.451,1-1,1h-4
- c-0.55,0-1-0.449-1-1v-2c0-0.549,0.449-1,1-1h4c0.549,0,1,0.451,1,1V25z M47.5,75.001c0,0.551-0.451,1-1,1h-4c-0.551,0-1-0.449-1-1
- v-2c0-0.549,0.449-1,1-1h4c0.549,0,1,0.451,1,1V75.001z M47.5,25c0,0.551-0.451,1-1,1h-4c-0.551,0-1-0.449-1-1v-2
- c0-0.549,0.449-1,1-1h4c0.549,0,1,0.451,1,1V25z M56.5,75.001c0,0.551-0.451,1-1,1h-4c-0.551,0-1-0.449-1-1v-2c0-0.549,0.449-1,1-1
- h4c0.549,0,1,0.451,1,1V75.001z M56.5,25c0,0.551-0.451,1-1,1h-4c-0.551,0-1-0.449-1-1v-2c0-0.549,0.449-1,1-1h4
- c0.549,0,1,0.451,1,1V25z M65.5,75.001c0,0.551-0.451,1-1,1h-4c-0.551,0-1-0.449-1-1v-2c0-0.549,0.449-1,1-1h4c0.549,0,1,0.451,1,1
- V75.001z M65.5,25c0,0.551-0.451,1-1,1h-4c-0.551,0-1-0.449-1-1v-2c0-0.549,0.449-1,1-1h4c0.549,0,1,0.451,1,1V25z M74.5,75.001
- c0,0.551-0.451,1-1,1h-4c-0.551,0-1-0.449-1-1v-2c0-0.549,0.449-1,1-1h4c0.549,0,1,0.451,1,1V75.001z M74.5,25c0,0.551-0.451,1-1,1
- h-4c-0.551,0-1-0.449-1-1v-2c0-0.549,0.449-1,1-1h4c0.549,0,1,0.451,1,1V25z M83.5,75.001c0,0.551-0.451,1-1,1h-4
- c-0.551,0-1-0.449-1-1v-2c0-0.549,0.449-1,1-1h4c0.549,0,1,0.451,1,1V75.001z M83.5,25c0,0.551-0.451,1-1,1h-4c-0.551,0-1-0.449-1-1
- v-2c0-0.549,0.449-1,1-1h4c0.549,0,1,0.451,1,1V25z"/>
-<path opacity="0.55" fill="#FFFFFF" d="M84.5,19h-71c-1.105,0-2,0.896-2,2v1c0-1.104,0.895-2,2-2h71c1.104,0,2,0.896,2,2v-1
- C86.5,19.896,85.603,19,84.5,19z"/>
-<path opacity="0.1" fill="#FFFFFF" d="M13.5,79.001h71c1.104,0,2-0.895,2-2v-1c0,1.105-0.896,2-2,2h-71c-1.105,0-2-0.895-2-2v1
- C11.5,78.106,12.395,79.001,13.5,79.001z"/>
-<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="48.9995" y1="29.1592" x2="48.9995" y2="69.1606">
- <stop offset="0" style="stop-color:#000000"/>
- <stop offset="0.5" style="stop-color:#666666"/>
- <stop offset="1" style="stop-color:#000000"/>
-</linearGradient>
-<rect x="11.5" y="29" fill="url(#SVGID_2_)" width="75" height="40.001"/>
-<linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="49" y1="69.001" x2="49" y2="29.0005">
- <stop offset="0" style="stop-color:#36B5FF"/>
- <stop offset="1" style="stop-color:#1B66D8"/>
-</linearGradient>
-<path fill="url(#SVGID_3_)" d="M83.5,67.001c0,1.1-0.9,2-2,2h-65c-1.1,0-2-0.9-2-2V31c0-1.1,0.9-2,2-2h65c1.1,0,2,0.9,2,2V67.001z"
- />
-<path opacity="0.5" fill="#FFFFFF" d="M81.5,67.001h-65c-1.1,0-2,0.1-2-1l0,0c0,1.1,0.9,2,2,2h65c1.1,0,2-0.9,2-2l0,0
- C83.5,67.101,82.599,67.001,81.5,67.001z"/>
-<linearGradient id="SVGID_4_" gradientUnits="userSpaceOnUse" x1="48.9995" y1="29" x2="48.9995" y2="69.1607">
- <stop offset="0" style="stop-color:#000000"/>
- <stop offset="1" style="stop-color:#404040"/>
-</linearGradient>
-<path fill="url(#SVGID_4_)" d="M81.5,30c0.551,0,1,0.449,1,1v36.001c0,0.553-0.449,1-1,1h-65c-0.551,0-1-0.447-1-1V31
- c0-0.551,0.449-1,1-1H81.5 M81.5,29h-65c-1.1,0-2,0.9-2,2v36.001c0,1.1,0.9,2,2,2h65c1.1,0,2-0.9,2-2V31
- C83.5,29.9,82.599,29,81.5,29L81.5,29z"/>
-<path opacity="0.2" fill="#FFFFFF" d="M81.5,41.001V33c0-1.104-0.896-2-2-2h-61c-1.105,0-2,0.896-2,2v13.001L81.5,41.001z"/>
-<rect fill="none" width="98" height="98.001"/>
-</svg>
--- a/videocollection/videocollectionwrapper/data/videocollectionwrapper.qrc Tue Jun 15 13:09:36 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-<RCC>
- <qresource prefix="/icons" >
- <file alias="default_thumbnail_video.svg" >icons/pri_large_video.svg</file>
- </qresource>
-</RCC>
--- a/videocollection/videocollectionwrapper/inc/videocollectionwrapper.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionwrapper/inc/videocollectionwrapper.h Thu Jul 22 16:34:17 2010 +0100
@@ -80,11 +80,12 @@
static VideoCollectionWrapper &instance();
/**
- * Returns pointer to model
+ * Returns pointer to model. Null if creation fails or if
+ * application is closing.
*
* @param type of the model
*
- * @return address to model or NULL if fails.
+ * @return address to model or NULL if fails or if application is closing.
*/
VideoSortFilterProxyModel* getModel(VideoCollectionCommon::TModelType type);
--- a/videocollection/videocollectionwrapper/inc/videocollectionwrapper_p.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionwrapper/inc/videocollectionwrapper_p.h Thu Jul 22 16:34:17 2010 +0100
@@ -55,8 +55,12 @@
/**
* Returns the pointer into model. Creates the model if it doesn't exists yet.
*
+ * Noter that if application has signaled aboutToQuit -signal indicating closing, all
+ * previously created models have been removed and new ones will not be created
+ * anymore
+ *
* @param type type of model
- * @return address of model, NULL if creation did not succeed.
+ * @return address of model, NULL if creation did not succeed or if application is closing.
*/
VideoSortFilterProxyModel* getModel(VideoCollectionCommon::TModelType &type);
@@ -65,7 +69,7 @@
/**
* Signaled when UI environment is about to be destroyed.
- * Source model needs to be cleaned up before of that
+ * All models needs to be cleaned up before of that.
*
*/
void aboutToQuitSlot();
@@ -96,6 +100,12 @@
* source model
*/
QPointer<VideoListDataModel> mSourceModel;
+
+ /**
+ * flag to indicate, that object is to be deallocated, so no
+ * models are to be returned anymore
+ */
+ bool mAboutToClose;
};
#endif // __VIDEOCOLLECTIONWRAPPERPRIVATE_H__
--- a/videocollection/videocollectionwrapper/inc/videodatasignalreceiver.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionwrapper/inc/videodatasignalreceiver.h Thu Jul 22 16:34:17 2010 +0100
@@ -112,6 +112,11 @@
* @param itemId, item that has been modified.
*/
virtual void itemModifiedSlot(const TMPXItemId &itemId) = 0;
+
+ /**
+ * Signalled when list is complete.
+ */
+ virtual void listCompleteSlot() = 0;
};
#endif // __VIDEOMODELOBSERVER_H
--- a/videocollection/videocollectionwrapper/inc/videolistdatamodel_p.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionwrapper/inc/videolistdatamodel_p.h Thu Jul 22 16:34:17 2010 +0100
@@ -183,6 +183,11 @@
* @param itemId, item that has been modified.
*/
void itemModifiedSlot(const TMPXItemId &itemId);
+
+ /**
+ * Signalled when list is complete.
+ */
+ void listCompleteSlot();
public: // services
--- a/videocollection/videocollectionwrapper/inc/videothumbnaildata_p.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionwrapper/inc/videothumbnaildata_p.h Thu Jul 22 16:34:17 2010 +0100
@@ -179,6 +179,17 @@
*
*/
const QIcon* defaultThumbnail(TMPXItemId mediaId);
+
+ /**
+ * Loads icon from file or resource, the icon is scaled to size of the
+ * video list view thumbnail.
+ *
+ * @param iconName name of the file or resource.
+ *
+ * @return HbIcon the icon load from resource or file.
+ *
+ */
+ HbIcon loadIcon(QString iconName);
/**
* Starts timer that continues the background thumbnail fetching at timeout.
@@ -258,11 +269,6 @@
* - data is the actual thumbnail data.
*/
QHash<TMPXItemId, HbIcon> mDefaultThumbnails;
-
- /**
- * Default thumbnail for a category.
- */
- QIcon *mDefaultTnCategory;
/**
* Current model, set at call to startBackgroundFetching.
--- a/videocollection/videocollectionwrapper/src/videocollectionlistener.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionwrapper/src/videocollectionlistener.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 32 %
+// Version : %version: 33 %
// INCLUDE FILES
#include <mpxmediageneraldefs.h>
@@ -120,19 +120,25 @@
if(categoryOrAlbumVideoList)
{
+ // checks if there are new videos in the list that are not yet in our data model.
+ mSignalReceiver.newVideoListSlot(array);
+
mSignalReceiver.albumListAvailableSlot(pathId, array);
-
- // Update also all video list in case this is a default category.
- if(pathId.iId2 == KVcxMvcMediaTypeCategory)
- {
- mSignalReceiver.newVideoListSlot(array);
- }
}
else
{
mSignalReceiver.newVideoListSlot(array);
}
- }
+
+ int listCompleted(-1);
+ if(mVideoUtils.mediaValue<int>(&aEntries, KVcxMediaMyVideosInt32Value, listCompleted))
+ {
+ if(listCompleted == EVcxMyVideosVideoListComplete)
+ {
+ mSignalReceiver.listCompleteSlot();
+ }
+ }
+}
// -----------------------------------------------------------------------------
// HandleOpenL
--- a/videocollection/videocollectionwrapper/src/videocollectionwrapper.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionwrapper/src/videocollectionwrapper.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: %
+// Version : %version: 31 %
// INCLUDE FILES
#include <qabstractitemmodel.h>
@@ -55,7 +55,7 @@
VideoCollectionWrapper::~VideoCollectionWrapper()
{
FUNC_LOG;
- // NOP
+ delete d;
}
// -----------------------------------------------------------------------------
--- a/videocollection/videocollectionwrapper/src/videocollectionwrapper_p.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionwrapper/src/videocollectionwrapper_p.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: %
+// Version : %version: 27 %
// INCLUDE FILES
#include <qapplication.h>
@@ -40,8 +40,10 @@
VideoCollectionWrapperPrivate::VideoCollectionWrapperPrivate()
: mAllVideosModel( 0 )
, mCollectionsModel( 0 )
+ , mCollectionContentModel( 0 )
, mGenericModel( 0 )
, mSourceModel( 0 )
+ , mAboutToClose( false )
{
FUNC_LOG;
// NOP
@@ -54,7 +56,6 @@
VideoCollectionWrapperPrivate::~VideoCollectionWrapperPrivate()
{
FUNC_LOG;
- // NOP here
}
@@ -67,6 +68,11 @@
FUNC_LOG;
INFO_1("VideoCollectionWrapperPrivate::getModel() type: %d", type);
+ if(mAboutToClose)
+ {
+ return 0;
+ }
+
VideoSortFilterProxyModel *model = 0;
if(!mSourceModel)
{
@@ -143,6 +149,11 @@
if(!mSourceModel.isNull())
{
delete mSourceModel;
+ delete mAllVideosModel;
+ delete mCollectionsModel;
+ delete mCollectionContentModel;
+ delete mGenericModel;
+ mAboutToClose = true;
}
}
--- a/videocollection/videocollectionwrapper/src/videodatacontainer.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionwrapper/src/videodatacontainer.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -14,7 +14,7 @@
* Description: VideoDataContainer class declaration*
*/
-// Version : %version: %
+// Version : %version: 14 %
// INCLUDE FILES
#include <mpxmediageneraldefs.h>
@@ -119,6 +119,7 @@
// if item exist, do not add into container
if(iter != mMediaData.end())
{
+ delete media;
return;
}
mMediaIds.append(mediaId);
--- a/videocollection/videocollectionwrapper/src/videolistdatamodel_p.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionwrapper/src/videolistdatamodel_p.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 37 %
+// Version : %version: 38.1.1 %
// INCLUDE FILES
#include <hbglobal.h>
@@ -361,18 +361,20 @@
unsigned int startIndex)
{
FUNC_LOG;
- INFO_2("VideoListDataModelPrivate::appendDataToContainerL() array count: %d, start index: %d", videoArray->Count(), startIndex);
- int count = videoArray->Count();
if (!videoArray ||
- startIndex >= count)
+ startIndex >= videoArray->Count())
{
return;
}
+ INFO_2("VideoListDataModelPrivate::appendDataToContainerL() array count: %d, start index: %d", videoArray->Count(), startIndex);
+
CMPXMedia *newMedia = 0;
CMPXMedia *mediaFromArray = 0;
TMPXItemId itemId = TMPXItemId::InvalidId();
+ int count = videoArray->Count();
+
for(int i = startIndex; i < count; ++i)
{
mediaFromArray = videoArray->AtL(i);
@@ -451,8 +453,8 @@
// signal that album has been updated
emit q_ptr->albumChanged();
- // signal that model is ready
- emit q_ptr->modelReady();
+ // signal that model has changed.
+ emit q_ptr->modelChanged();
}
@@ -497,9 +499,8 @@
{
q_ptr->beginInsertRows(QModelIndex(), startIndex, endIndex);
q_ptr->endInsertRows();
+ emit q_ptr->modelChanged();
}
-
- emit q_ptr->modelReady();
}
// -----------------------------------------------------------------------------
@@ -890,4 +891,13 @@
}
}
+// -----------------------------------------------------------------------------
+// listCompleteSlot
+// -----------------------------------------------------------------------------
+//
+void VideoListDataModelPrivate::listCompleteSlot()
+{
+ emit q_ptr->modelReady();
+}
+
// End of file
--- a/videocollection/videocollectionwrapper/src/videosortfilterproxymodel.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionwrapper/src/videosortfilterproxymodel.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 65 %
+// Version : %version: 66 %
// INCLUDE FILES
#include <qstringlist.h>
@@ -525,11 +525,14 @@
//
TMPXItemId VideoSortFilterProxyModel::getMediaIdAtIndex(const QModelIndex &index) const
{
- QModelIndex sourceIndex = mapToSource(index);
TMPXItemId mpxId = TMPXItemId::InvalidId();
- if(mModel && sourceIndex.isValid())
+ if(index.isValid())
{
- mpxId = mModel->mediaIdAtIndex(sourceIndex.row());
+ QModelIndex sourceIndex = mapToSource(index);
+ if(mModel && sourceIndex.isValid())
+ {
+ mpxId = mModel->mediaIdAtIndex(sourceIndex.row());
+ }
}
return mpxId;
}
--- a/videocollection/videocollectionwrapper/src/videothumbnaildata_p.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionwrapper/src/videothumbnaildata_p.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,12 +15,13 @@
*
*/
-// Version : %version: 21 %
+// Version : %version: 24 %
// INCLUDE FILES
#include <qapplication.h>
#include <qpixmap.h>
#include <qtimer.h>
+#include <qpainter.h>
#include <mpxmediageneraldefs.h>
#include <hbicon.h>
@@ -45,12 +46,16 @@
// Priority for background thumbnail fetches.
const int BACKGROUND_FETCH_PRIORITY = 3000;
+// Size for default thumbnail, these match with large thumbnail in lists.
+const int DEFAULT_THUMBNAIL_WIDTH = 114;
+const int DEFAULT_THUMBNAIL_HEIGHT = 64;
+
/**
* global qHash function required fo creating hash values for TMPXItemId -keys
*/
inline uint qHash(TMPXItemId key)
-{
- QPair<uint, uint> keyPair(key.iId1, key.iId2);
+{
+ QPair<uint, uint> keyPair(key.iId1, key.iId2);
return qHash(keyPair);
}
@@ -430,7 +435,7 @@
{
if(!mDefaultThumbnails.contains(defaultIdVideo))
{
- mDefaultThumbnails[defaultIdVideo] = HbIcon(":/icons/default_thumbnail_video.svg");
+ mDefaultThumbnails[defaultIdVideo] = loadIcon("qtg_large_video");
}
return &mDefaultThumbnails[defaultIdVideo].qicon();
}
@@ -441,7 +446,7 @@
{
if(!mDefaultThumbnails.contains(defaultIdAlbum))
{
- mDefaultThumbnails[defaultIdAlbum] = HbIcon("qtg_large_video_collection");
+ mDefaultThumbnails[defaultIdAlbum] = loadIcon("qtg_large_video_collection");
}
return &mDefaultThumbnails[defaultIdAlbum].qicon();
}
@@ -453,7 +458,7 @@
{
if(!mDefaultThumbnails.contains(defaultIdDownloads))
{
- mDefaultThumbnails[defaultIdDownloads] = HbIcon("qtg_large_video_download");
+ mDefaultThumbnails[defaultIdDownloads] = loadIcon("qtg_large_video_download");
}
return &mDefaultThumbnails[defaultIdDownloads].qicon();
}
@@ -462,7 +467,7 @@
{
if(!mDefaultThumbnails.contains(defaultIdCaptured))
{
- mDefaultThumbnails[defaultIdCaptured] = HbIcon("qtg_large_video_capture");
+ mDefaultThumbnails[defaultIdCaptured] = loadIcon("qtg_large_video_capture");
}
return &mDefaultThumbnails[defaultIdCaptured].qicon();
}
@@ -471,7 +476,7 @@
{
if(!mDefaultThumbnails.contains(defaultIdAlbum))
{
- mDefaultThumbnails[defaultIdAlbum] = HbIcon("qtg_large_video_collection");
+ mDefaultThumbnails[defaultIdAlbum] = loadIcon("qtg_large_video_collection");
}
return &mDefaultThumbnails[defaultIdAlbum].qicon();
}
@@ -480,6 +485,56 @@
}
// -----------------------------------------------------------------------------
+// VideoThumbnailDataPrivate::loadIcon()
+// -----------------------------------------------------------------------------
+//
+HbIcon VideoThumbnailDataPrivate::loadIcon(QString iconName)
+{
+ HbIcon icon(iconName);
+
+ if(!icon.isNull())
+ {
+ QPixmap dest = QPixmap(DEFAULT_THUMBNAIL_WIDTH, DEFAULT_THUMBNAIL_HEIGHT);
+
+ // Scale the icon into the thumbnail area.
+ QPixmap source = icon.pixmap();
+ // Smooth scaling is very expensive (size^2). Therefore we reduce the size
+ // to 2x of the destination size and using fast transformation before doing final smooth scaling.
+ if(source.size().width() > (6*dest.width()) || source.size().height() > (6*dest.height()))
+ {
+ QSize intermediate_size = QSize( dest.width() * 2, dest.height() * 2 );
+ source = source.scaled(intermediate_size, Qt::KeepAspectRatio, Qt::FastTransformation );
+ }
+ QPixmap scaled = source.scaled(dest.size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
+
+ // Center the icon.
+ int xDiff = 0;
+ int yDiff = 0;
+ if(dest.width() > scaled.width())
+ {
+ xDiff = (dest.width() - scaled.width()) / 2;
+ }
+ if(dest.height() > scaled.height())
+ {
+ yDiff = (dest.height() - scaled.height()) / 2;
+ }
+
+ // Paint it.
+ QPainter painter(&dest);
+ painter.setCompositionMode(QPainter::CompositionMode_Source);
+ painter.fillRect(dest.rect(), Qt::transparent);
+ painter.drawPixmap(xDiff, yDiff, scaled.width(), scaled.height(), scaled);
+ painter.end();
+
+ return HbIcon(dest);
+ }
+ else
+ {
+ return HbIcon();
+ }
+}
+
+// -----------------------------------------------------------------------------
// VideoThumbnailDataPrivate::removeThumbnail()
// -----------------------------------------------------------------------------
//
--- a/videocollection/videocollectionwrapper/src/videothumbnailfetcher.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionwrapper/src/videothumbnailfetcher.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 4 %
+// Version : %version: 6 %
// INCLUDE FILES
#include <qpixmap.h>
@@ -302,13 +302,15 @@
void VideoThumbnailFetcher::thumbnailReadySlot(QPixmap tnData, void *internal, int requestId, int error)
{
INFO_2("VideoThumbnailFetcher::thumbnailReadySlot() requestId: %d, error: %d", requestId, error);
+ Q_UNUSED(requestId);
TMPXItemId mediaId = TMPXItemId::InvalidId();
if(internal)
{
- mediaId = *(static_cast<TMPXItemId*>(internal));
+ TMPXItemId *idPointer = static_cast<TMPXItemId*>(internal);
+ mediaId = *idPointer;
+ delete idPointer;
}
- delete internal;
// Thumbnail has not been generated yet, put it into creation list.
if(error == -1)
--- a/videocollection/videocollectionwrapper/tsrc/testvideocollectionclient/stub/inc/stubcollectionsignalreceiver.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionwrapper/tsrc/testvideocollectionclient/stub/inc/stubcollectionsignalreceiver.h Thu Jul 22 16:34:17 2010 +0100
@@ -123,10 +123,18 @@
/**
* No implementation needed for these tests
*/
- virtual void itemModifiedSlot(const TMPXItemId &itemId)
+ void itemModifiedSlot(const TMPXItemId &itemId)
{
Q_UNUSED(itemId);
}
+
+ /**
+ * No implementation needed for these tests
+ */
+ void listCompleteSlot()
+ {
+
+ }
};
--- a/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/inc/mediaobjectfactory.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/inc/mediaobjectfactory.h Thu Jul 22 16:34:17 2010 +0100
@@ -52,7 +52,7 @@
*
* @return CMPXMedia
*/
- CMPXMedia* newMedia(int id = -1, int id2 = 0 );
+ CMPXMedia* newMedia(int id = -1, int id2 = 0);
/**
* appends media object to mediaarray
--- a/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/src/mediaobjectfactory.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/src/mediaobjectfactory.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -58,7 +58,7 @@
// newMedia
// -----------------------------------------------------------------------------
//
-CMPXMedia* MediaObjectFactory::newMedia(int id1, int id2 )
+CMPXMedia* MediaObjectFactory::newMedia(int id1, int id2)
{
CMPXMedia *media = NULL;
TRAP_IGNORE(media = CMPXMedia::NewL());
--- a/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/src/testvideocollectionlistener.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/src/testvideocollectionlistener.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -187,7 +187,8 @@
CMPXCollectionPath* collectionPath = 0;
TRAP_IGNORE(
collectionPath = CMPXCollectionPath::NewL();
- collectionPath->AppendL( KVcxUidMyVideosMpxCollection ););
+ collectionPath->AppendL( KVcxUidMyVideosMpxCollection );
+ );
// empty array, path exists level incorrect (new video list, not category neither album level)
mMediaFactory->putValuePtr<CMPXCollectionPath>(media, KMPXMediaGeneralContainerPath, collectionPath);
@@ -204,7 +205,8 @@
collectionPath->AppendL( KVcxUidMyVideosMpxCollection );
collectionPath->AppendL( KVcxMvcCategoryIdAll););
- // array of items from different levels, everything is reported
+ // array of items from different levels, everything is reported
+ // first call does not contain the KVcxMediaMyVideosInt32Value.
mStubCollectionClient->setCollectionLevel(VideoCollectionCommon::ELevelCategory);
mMediaFactory->putArrayContent(array, mMediaFactory->newMedia(1, 2));
mMediaFactory->putValuePtr<CMPXCollectionPath>(media, KMPXMediaGeneralContainerPath, collectionPath);
@@ -213,15 +215,19 @@
arrayToTest = static_cast<CMPXMediaArray*>(mSignalReceiver->getLatestPointerAddr());
QVERIFY(arrayToTest != 0);
QVERIFY(arrayToTest->Count() == array->Count());
+ QVERIFY(mSignalReceiver->getListComplete() == false);
-
mStubCollectionClient->setCollectionLevel(VideoCollectionCommon::ELevelVideos);
delete array;
- array = mMediaFactory->newMediaArray();
+ array = mMediaFactory->newMediaArray();
mMediaFactory->putArrayContent(array, mMediaFactory->newMedia(1));
mMediaFactory->putArrayContent(array, mMediaFactory->newMedia(2));
mMediaFactory->putArrayContent(array, mMediaFactory->newMedia(3));
+ // second call contains the KVcxMediaMyVideosInt32Value, but it's not equal to EVcxMyVideosVideoListComplete
+ int invalid(-100);
+ mMediaFactory->putTValue<int>(media, KVcxMediaMyVideosInt32Value, invalid);
+
mMediaFactory->putValuePtr<CMPXMediaArray>(media, KMPXMediaArrayContents, array);
mMediaFactory->putValuePtr<CMPXCollectionPath>(media, KMPXMediaGeneralContainerPath, collectionPath);
mStubCollection->callHandleOpenLFunc(*media, 0, true, 0 );
@@ -229,6 +235,7 @@
arrayToTest = static_cast<CMPXMediaArray*>(mSignalReceiver->getLatestPointerAddr());
QVERIFY(arrayToTest != 0);
QVERIFY(arrayToTest->Count() == array->Count());
+ QVERIFY(mSignalReceiver->getListComplete() == false);
delete collectionPath;
collectionPath = 0;
@@ -238,12 +245,16 @@
collectionPath->AppendL( KVcxMvcMediaTypeCategory););
mMediaFactory->putValuePtr<CMPXCollectionPath>(media, KMPXMediaGeneralContainerPath, collectionPath);
+ // third call contains KVcxMediaMyVideosInt32Value with value EVcxMyVideosVideoListComplete.
+ int listComplete(EVcxMyVideosVideoListComplete);
+ mMediaFactory->putTValue<int>(media, KVcxMediaMyVideosInt32Value, listComplete);
+
mStubCollection->callHandleOpenLFunc(*media, 0, true, 0 );
arrayToTest = static_cast<CMPXMediaArray*>(mSignalReceiver->getLatestPointerAddr());
QVERIFY(arrayToTest != 0);
QVERIFY(arrayToTest->Count() == array->Count());
-
+ QVERIFY(mSignalReceiver->getListComplete());
CMPXMediaArray *gottenArray = static_cast<CMPXMediaArray*>(mSignalReceiver->getLatestPointerAddr());
QVERIFY(gottenArray->Count() == 3);
--- a/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/stub/inc/stubsignalreceiver.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/stub/inc/stubsignalreceiver.h Thu Jul 22 16:34:17 2010 +0100
@@ -74,6 +74,11 @@
*/
int getLatestIntegerData();
+ /**
+ * return mListComplete
+ */
+ bool getListComplete();
+
public slots:
/**
@@ -133,6 +138,11 @@
*/
virtual void itemModifiedSlot(const TMPXItemId &itemId);
+ /**
+ * Sets boolean mListComplete to true;
+ */
+ void listCompleteSlot();
+
private:
/**
* Contains address of latest pointer passed to object
@@ -158,6 +168,11 @@
* contains contents of list received from signal
*/
QList<TMPXItemId> mLatesListData;
+
+ /**
+ * True if listCompleteSlot has been called.
+ */
+ bool mListComplete;
};
#endif
--- a/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/stub/src/stubsignalreceiver.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/stub/src/stubsignalreceiver.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -25,7 +25,8 @@
mLatestPtr(0),
mLatestItemId(TMPXItemId::InvalidId()),
mLatestModifiedItemId(TMPXItemId::InvalidId()),
-mLatestInteger(-1)
+mLatestInteger(-1),
+mListComplete(false)
{
}
@@ -50,6 +51,7 @@
mLatestModifiedItemId = TMPXItemId::InvalidId();
mLatesListData.clear();
mLatestInteger = -1;
+ mListComplete = false;
}
// -----------------------------------------------------------------------------
@@ -99,6 +101,15 @@
}
// -----------------------------------------------------------------------------
+// getListComplete
+// -----------------------------------------------------------------------------
+//
+bool StubSignalReceiver::getListComplete()
+{
+ return mListComplete;
+}
+
+// -----------------------------------------------------------------------------
// newVideoListSlot
// -----------------------------------------------------------------------------
//
@@ -204,6 +215,15 @@
}
// -----------------------------------------------------------------------------
+// listCompleteSlot
+// -----------------------------------------------------------------------------
+//
+void StubSignalReceiver::listCompleteSlot()
+{
+ mListComplete = true;
+}
+
+// -----------------------------------------------------------------------------
// albumRemoveFailureSlot
// -----------------------------------------------------------------------------
//
--- a/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/testvideocollectionlistener.pro Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/testvideocollectionlistener.pro Thu Jul 22 16:34:17 2010 +0100
@@ -35,8 +35,7 @@
inc/mediaobjectfactory.h \
stub/inc/stubcollection.h \
stub/inc/videocollectionclient.h \
- stub/inc/stubsignalreceiver.h \
- stub/inc/stubsignalreceiver.h \
+ stub/inc/stubsignalreceiver.h \
../../inc/videocollectionutils.h \
../../inc/videodatasignalreceiver.h \
../../inc/videocollectionlistener.h
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/inc/videolistdatamodel_p.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/inc/videolistdatamodel_p.h Thu Jul 22 16:34:17 2010 +0100
@@ -315,7 +315,12 @@
* not used in stub
*/
void itemDeletedSlot(TMPXItemId id);
-
+
+ /**
+ * not used in stub
+ */
+ void listCompleteSlot();
+
public:
/**
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/src/videolistdatamodel_p.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/src/videolistdatamodel_p.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -515,4 +515,12 @@
Q_UNUSED(id);
}
+// -----------------------------------------------------------------------------
+// listCompleteSlot
+// -----------------------------------------------------------------------------
+//
+void VideoListDataModelPrivate::listCompleteSlot()
+{
+}
+
// End of file
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/inc/testvideomodel_p.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/inc/testvideomodel_p.h Thu Jul 22 16:34:17 2010 +0100
@@ -88,6 +88,11 @@
*/
void signalVideoDetailsCompleted(CMPXMedia*);
+ /**
+ * emitted to get listCompleteSlot to be called.
+ */
+ void signalListCompleteSlot();
+
// test functions for the test framework
private slots:
/**
@@ -248,6 +253,11 @@
* verifies getMediaIdFromIndex when fetching collections
*/
void testGetCollectionIdFromIndex();
+
+ /**
+ * verifies listCompleteSlot
+ */
+ void testListCompleteSlot();
private:
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/src/mediaobjectfactory.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/src/mediaobjectfactory.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -397,7 +397,7 @@
TDateTime dateTime;
- dateTime.Set(date.date().year(), TMonth(date.date().month() - 1), date.date().day(),
+ dateTime.Set(date.date().year(), TMonth(date.date().month() - 1), date.date().day() - 1,
date.time().hour(), date.time().minute(),
date.time().second(), date.time().msec());
TTime ttimeDate(dateTime);
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/src/testvideomodel_p.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/src/testvideomodel_p.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -717,7 +717,7 @@
VideoListDataModel::mFirstRemoved = -1;
VideoListDataModel::mLastRemoved = -1;
- QSignalSpy spyModelReady(mStubModel, SIGNAL(modelReady()));
+ QSignalSpy spyModelChanged(mStubModel, SIGNAL(modelChanged()));
mMediaFactory->removeArray();
mMediaFactory->createMediaItems(MEDIA_COUNT);
@@ -728,8 +728,8 @@
QVERIFY(VideoListDataModel::mLastInserted == MEDIA_COUNT - 1);
QVERIFY(VideoListDataModel::mFirstRemoved == -1);
QVERIFY(VideoListDataModel::mLastRemoved == -1);
- QCOMPARE(spyModelReady.count(), 1);
- spyModelReady.clear();
+ QCOMPARE(spyModelChanged.count(), 1);
+ spyModelChanged.clear();
VideoListDataModel::mFirstInserted = -1;
VideoListDataModel::mLastInserted = -1;
VideoListDataModel::mFirstRemoved = -1;
@@ -743,7 +743,7 @@
QVERIFY(VideoListDataModel::mLastInserted == -1);
QVERIFY(VideoListDataModel::mFirstRemoved == -1);
QVERIFY(VideoListDataModel::mLastRemoved == -1);
- QCOMPARE(spyModelReady.count(), 0);
+ QCOMPARE(spyModelChanged.count(), 0);
VideoListDataModel::mFirstInserted = -1;
VideoListDataModel::mLastInserted = -1;
VideoListDataModel::mFirstRemoved = -1;
@@ -758,8 +758,8 @@
QVERIFY(VideoListDataModel::mLastInserted == -1);
QVERIFY(VideoListDataModel::mFirstRemoved == -1);
QVERIFY(VideoListDataModel::mLastRemoved == -1);
- QCOMPARE(spyModelReady.count(), 1);
- spyModelReady.clear();
+ QCOMPARE(spyModelChanged.count(), 0);
+ spyModelChanged.clear();
VideoListDataModel::mFirstInserted = -1;
VideoListDataModel::mLastInserted = -1;
VideoListDataModel::mFirstRemoved = -1;
@@ -773,8 +773,8 @@
QVERIFY(VideoListDataModel::mLastInserted == -1);
QVERIFY(VideoListDataModel::mFirstRemoved == -1);
QVERIFY(VideoListDataModel::mLastRemoved == -1);
- QCOMPARE(spyModelReady.count(), 1);
- spyModelReady.clear();
+ QCOMPARE(spyModelChanged.count(), 0);
+ spyModelChanged.clear();
VideoListDataModel::mFirstInserted = -1;
VideoListDataModel::mLastInserted = -1;
VideoListDataModel::mFirstRemoved = -1;
@@ -818,6 +818,7 @@
// send 10 videos
mMediaFactory->createMediaItems(10);
emit signalNewVideoList(mMediaFactory->copyOfMediaArray());
+ spyModelChanged.clear();
VideoListDataModel::mFirstInserted = -1;
VideoListDataModel::mLastInserted = -1;
@@ -1413,6 +1414,18 @@
disconnect(this, SIGNAL(signalNewVideoList(CMPXMediaArray*)), mTestObject, SLOT(newVideoListSlot(CMPXMediaArray*)));
}
+// -----------------------------------------------------------------------------
+// testListCompleteSlot
+// -----------------------------------------------------------------------------
+//
+void TestVideoModel_p::testListCompleteSlot()
+{
+ QVERIFY(connect(this, SIGNAL(signalListCompleteSlot()), mTestObject, SLOT(listCompleteSlot())));
+ QSignalSpy spy(mStubModel, SIGNAL(modelReady()));
+ emit signalListCompleteSlot();
+ QCOMPARE(spy.count(), 1);
+}
+
// End of file
--- a/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/src/testvideosortfilterproxymodel.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/src/testvideosortfilterproxymodel.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -1365,6 +1365,7 @@
// no albums in model
QVERIFY(mTestObject->removeAlbums(indexList) == -1);
+ indexList.clear();
mStubModel->removeAll();
delete mTestObject;
mTestObject = new FilterProxyTester(VideoCollectionCommon::EModelTypeCollections);
@@ -1374,9 +1375,9 @@
mStubModel->appendData(TMPXItemId(1,2));
mStubModel->appendData(TMPXItemId(2,2));
mStubModel->appendData(TMPXItemId(3,2));
- indexList.append(mTestObject->index(0,2));
- indexList.append(mTestObject->index(1,2));
- indexList.append(mTestObject->index(2,2));
+ indexList.append(mTestObject->index(0,0));
+ indexList.append(mTestObject->index(1,0));
+ indexList.append(mTestObject->index(2,0));
// succeed
QVERIFY(mTestObject->removeAlbums(indexList) == 0);
--- a/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata_p/src/testvideothumbnaildata_p.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata_p/src/testvideothumbnaildata_p.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -162,12 +162,21 @@
//
void TestVideoThumbnailData_p::testDestructor()
{
- mWrapper = 0;
+ init();
- mTestObject = new VideoThumbnailDataTester();
- delete mTestObject; mTestObject = 0;
+ mTestObject->getThumbnail(TMPXItemId(1, 0));
+ mTestObject->getThumbnail(TMPXItemId(0, 1));
+
+ QPointer<VideoThumbnailFetcher> thumbFetcher = mTestObject->mThumbnailFetcher;
+ QPointer<QTimer> reportTimer = mTestObject->mTbnReportTimer;
+ QPointer<QTimer> fetchTimer = mTestObject->mBgFetchTimer;
- //TODO
+ cleanup();
+
+ QCOMPARE(VideoThumbnailFetcher::mRequests.count(), 0);
+ QVERIFY(thumbFetcher == 0);
+ QVERIFY(reportTimer == 0);
+ QVERIFY(fetchTimer == 0);
}
// ---------------------------------------------------------------------------
--- a/videocollection/videocollectionwrapper/videocollectionwrapper.pro Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videocollectionwrapper/videocollectionwrapper.pro Thu Jul 22 16:34:17 2010 +0100
@@ -20,9 +20,15 @@
TARGET.UID2 = 0x1000008D
TARGET.UID3 = 0x200211FD
BLD_INF_RULES.prj_exports += "rom/videocollectionwrapper.iby CORE_APP_LAYER_IBY_EXPORT_PATH(videocollectionwrapper.iby)"
- MMP_RULES += "DEFFILE videocollectionwrapper.def"
TARGET.CAPABILITY = CAP_GENERAL_DLL
TARGET.EPOCALLOWDLLDATA = 1
+ defBlock = \
+ "$${LITERAL_HASH}if defined(EABI)" \
+ "DEFFILE ../eabi/videocollectionwrapper.def" \
+ "$${LITERAL_HASH}else" \
+ "DEFFILE ../bwins/videocollectionwrapper.def" \
+ "$${LITERAL_HASH}endif"
+ MMP_RULES += defBlock
}
CONFIG += hb qt dll
DEFINES += BUILD_VIDEOCOLLECTION_DLL
@@ -75,5 +81,3 @@
-lestor.dll \
-lcentralrepository.dll \
-lflogger.dll
-
-RESOURCES += data/videocollectionwrapper.qrc
--- a/videocollection/videofiledetailsview/data/pri_large_video.svg Tue Jun 15 13:09:36 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
- <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
- xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
- x="0px" y="0px" width="98px" height="98px" viewBox="0 0 98 98" enable-background="new 0 0 98 98" xml:space="preserve">
-<defs>
-</defs>
-<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="48.9995" y1="19" x2="48.9995" y2="79.0015">
- <stop offset="0" style="stop-color:#757575"/>
- <stop offset="0.2424" style="stop-color:#000000"/>
- <stop offset="0.8606" style="stop-color:#000000"/>
- <stop offset="1" style="stop-color:#363636"/>
-</linearGradient>
-<path fill="url(#SVGID_1_)" d="M84.5,19h-71c-1.105,0-2,0.896-2,2v56.001c0,1.105,0.895,2,2,2h71c1.104,0,2-0.895,2-2V21
- C86.5,19.896,85.603,19,84.5,19z M20.5,75.001c0,0.551-0.451,1-1,1h-4c-0.551,0-1-0.449-1-1v-2c0-0.549,0.449-1,1-1h4
- c0.549,0,1,0.451,1,1V75.001z M20.5,25c0,0.551-0.451,1-1,1h-4c-0.551,0-1-0.449-1-1v-2c0-0.549,0.449-1,1-1h4c0.549,0,1,0.451,1,1
- V25z M29.5,75.001c0,0.551-0.451,1-1,1h-4c-0.551,0-1-0.449-1-1v-2c0-0.549,0.449-1,1-1h4c0.549,0,1,0.451,1,1V75.001z M29.5,25
- c0,0.551-0.451,1-1,1h-4c-0.551,0-1-0.449-1-1v-2c0-0.549,0.449-1,1-1h4c0.549,0,1,0.451,1,1V25z M38.5,75.001c0,0.551-0.451,1-1,1
- h-4c-0.55,0-1-0.449-1-1v-2c0-0.549,0.449-1,1-1h4c0.549,0,1,0.451,1,1V75.001z M38.5,25c0,0.551-0.451,1-1,1h-4
- c-0.55,0-1-0.449-1-1v-2c0-0.549,0.449-1,1-1h4c0.549,0,1,0.451,1,1V25z M47.5,75.001c0,0.551-0.451,1-1,1h-4c-0.551,0-1-0.449-1-1
- v-2c0-0.549,0.449-1,1-1h4c0.549,0,1,0.451,1,1V75.001z M47.5,25c0,0.551-0.451,1-1,1h-4c-0.551,0-1-0.449-1-1v-2
- c0-0.549,0.449-1,1-1h4c0.549,0,1,0.451,1,1V25z M56.5,75.001c0,0.551-0.451,1-1,1h-4c-0.551,0-1-0.449-1-1v-2c0-0.549,0.449-1,1-1
- h4c0.549,0,1,0.451,1,1V75.001z M56.5,25c0,0.551-0.451,1-1,1h-4c-0.551,0-1-0.449-1-1v-2c0-0.549,0.449-1,1-1h4
- c0.549,0,1,0.451,1,1V25z M65.5,75.001c0,0.551-0.451,1-1,1h-4c-0.551,0-1-0.449-1-1v-2c0-0.549,0.449-1,1-1h4c0.549,0,1,0.451,1,1
- V75.001z M65.5,25c0,0.551-0.451,1-1,1h-4c-0.551,0-1-0.449-1-1v-2c0-0.549,0.449-1,1-1h4c0.549,0,1,0.451,1,1V25z M74.5,75.001
- c0,0.551-0.451,1-1,1h-4c-0.551,0-1-0.449-1-1v-2c0-0.549,0.449-1,1-1h4c0.549,0,1,0.451,1,1V75.001z M74.5,25c0,0.551-0.451,1-1,1
- h-4c-0.551,0-1-0.449-1-1v-2c0-0.549,0.449-1,1-1h4c0.549,0,1,0.451,1,1V25z M83.5,75.001c0,0.551-0.451,1-1,1h-4
- c-0.551,0-1-0.449-1-1v-2c0-0.549,0.449-1,1-1h4c0.549,0,1,0.451,1,1V75.001z M83.5,25c0,0.551-0.451,1-1,1h-4c-0.551,0-1-0.449-1-1
- v-2c0-0.549,0.449-1,1-1h4c0.549,0,1,0.451,1,1V25z"/>
-<path opacity="0.55" fill="#FFFFFF" d="M84.5,19h-71c-1.105,0-2,0.896-2,2v1c0-1.104,0.895-2,2-2h71c1.104,0,2,0.896,2,2v-1
- C86.5,19.896,85.603,19,84.5,19z"/>
-<path opacity="0.1" fill="#FFFFFF" d="M13.5,79.001h71c1.104,0,2-0.895,2-2v-1c0,1.105-0.896,2-2,2h-71c-1.105,0-2-0.895-2-2v1
- C11.5,78.106,12.395,79.001,13.5,79.001z"/>
-<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="48.9995" y1="29.1592" x2="48.9995" y2="69.1606">
- <stop offset="0" style="stop-color:#000000"/>
- <stop offset="0.5" style="stop-color:#666666"/>
- <stop offset="1" style="stop-color:#000000"/>
-</linearGradient>
-<rect x="11.5" y="29" fill="url(#SVGID_2_)" width="75" height="40.001"/>
-<linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="49" y1="69.001" x2="49" y2="29.0005">
- <stop offset="0" style="stop-color:#36B5FF"/>
- <stop offset="1" style="stop-color:#1B66D8"/>
-</linearGradient>
-<path fill="url(#SVGID_3_)" d="M83.5,67.001c0,1.1-0.9,2-2,2h-65c-1.1,0-2-0.9-2-2V31c0-1.1,0.9-2,2-2h65c1.1,0,2,0.9,2,2V67.001z"
- />
-<path opacity="0.5" fill="#FFFFFF" d="M81.5,67.001h-65c-1.1,0-2,0.1-2-1l0,0c0,1.1,0.9,2,2,2h65c1.1,0,2-0.9,2-2l0,0
- C83.5,67.101,82.599,67.001,81.5,67.001z"/>
-<linearGradient id="SVGID_4_" gradientUnits="userSpaceOnUse" x1="48.9995" y1="29" x2="48.9995" y2="69.1607">
- <stop offset="0" style="stop-color:#000000"/>
- <stop offset="1" style="stop-color:#404040"/>
-</linearGradient>
-<path fill="url(#SVGID_4_)" d="M81.5,30c0.551,0,1,0.449,1,1v36.001c0,0.553-0.449,1-1,1h-65c-0.551,0-1-0.447-1-1V31
- c0-0.551,0.449-1,1-1H81.5 M81.5,29h-65c-1.1,0-2,0.9-2,2v36.001c0,1.1,0.9,2,2,2h65c1.1,0,2-0.9,2-2V31
- C83.5,29.9,82.599,29,81.5,29L81.5,29z"/>
-<path opacity="0.2" fill="#FFFFFF" d="M81.5,41.001V33c0-1.104-0.896-2-2-2h-61c-1.105,0-2,0.896-2,2v13.001L81.5,41.001z"/>
-<rect fill="none" width="98" height="98.001"/>
-</svg>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/videofiledetailsview/data/videofiledetails.docml Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,161 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="1.1">
+ <object name="mOptionsDelete" type="HbAction">
+ <string locid="txt_common_opt_delete" name="text" value="Delete"/>
+ </object>
+ <widget name="videofiledetailsview" type="HbView">
+ <widget name="mOptionsMenu" role="HbView:menu" type="HbMenu">
+ <ref object="mOptionsDelete" role="HbWidget:addAction"/>
+ </widget>
+ <widget name="mContent" role="HbView:widget" type="HbWidget">
+ <widget name="mLblTitle" type="HbStackedWidget">
+ <real name="z" value="0.0079"/>
+ <sizehint height="4.47761un" type="PREFERRED" width="47.7612un"/>
+ </widget>
+ <widget name="mDetailsContainer" type="HbWidget">
+ <widget name="mDetailsList" type="HbListWidget"/>
+ <real name="z" value="2"/>
+ <sizehint height="23.8806un" type="PREFERRED" width="11.9403un"/>
+ <layout orientation="Vertical" type="linear">
+ <linearitem itemname="mDetailsList"/>
+ </layout>
+ </widget>
+ <widget name="mThumbContainer" type="HbWidget">
+ <widget name="mDetailsLabel" type="HbStackedWidget">
+ <real name="z" value="2"/>
+ <sizehint height="34.47761un" type="PREFERRED" width="47.91045un"/>
+ <bool name="visible" value="TRUE"/>
+ <string name="state" value="normal"/>
+ </widget>
+ <real name="z" value="1"/>
+ <sizehint height="37.31343un" type="PREFERRED" width="47.7612un"/>
+ <layout type="anchor">
+ <anchoritem dst="mDetailsLabel" dstEdge="LEFT" spacing="1.34328un" src="" srcEdge="LEFT"/>
+ <anchoritem dst="mDetailsLabel" dstEdge="TOP" spacing="1.34328un" src="" srcEdge="TOP"/>
+ </layout>
+ </widget>
+ <widget name="mButton" type="HbPushButton">
+ <real name="z" value="3"/>
+ </widget>
+ </widget>
+ </widget>
+ <section name="portrait">
+ <widget name="mContent" role="HbView:widget" type="HbWidget">
+ <widget name="mButton" type="HbPushButton">
+ <real name="z" value="5"/>
+ <sizehint height="7.17164un" type="PREFERRED" width="50.74626un"/>
+ </widget>
+ <widget name="mDetailsContainer" type="HbWidget">
+ <widget name="mDetailsList" type="HbListWidget">
+ <real name="z" value="0"/>
+ <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Expanding" verticalStretch="0"/>
+ <sizehint height="38.50746un" type="PREFERRED" width="48.0597un"/>
+ <bool name="visible" value="TRUE"/>
+ </widget>
+ <real name="z" value="2"/>
+ <sizehint height="42.68657un" type="PREFERRED" width="50.89551un"/>
+ <layout type="anchor">
+ <anchoritem dst="mDetailsList" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+ <anchoritem dst="mDetailsList" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
+ <anchoritem dst="mDetailsList" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+ <anchoritem dst="mDetailsList" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
+ </layout>
+ </widget>
+ <widget name="mThumbContainer" type="HbWidget">
+ <widget name="mDetailsLabel" type="HbStackedWidget">
+ <real name="z" value="2"/>
+ <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+ <sizehint height="28.54478un" type="FIXED" width="50.74627un"/>
+ <string name="state"/>
+ </widget>
+ <real name="z" value="1"/>
+ <sizehint height="28.69403un" type="PREFERRED" width="50.74626un"/>
+ <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
+ <layout orientation="Horizontal" spacing="0un" type="linear">
+ <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+ <linearitem itemname="mDetailsLabel"/>
+ </layout>
+ </widget>
+ <layout orientation="Vertical" type="linear">
+ <linearitem itemname="mLblTitle"/>
+ <linearitem itemname="mThumbContainer"/>
+ <linearitem itemname="mDetailsContainer"/>
+ <linearitem itemname="mButton"/>
+ </layout>
+ </widget>
+ </section>
+ <section name="landscape">
+ <widget name="mContent" role="HbView:widget" type="HbWidget">
+ <widget name="mDetailsContent" type="HbWidget">
+ <widget name="mRightContent" type="HbWidget">
+ <widget name="mDetailsContainer" type="HbWidget">
+ <widget name="mDetailsList" type="HbListWidget">
+ <real name="z" value="0"/>
+ <sizehint height="35.37314un" type="PREFERRED" width="48.0597un"/>
+ <bool name="visible" value="TRUE"/>
+ </widget>
+ <real name="z" value="2"/>
+ <sizehint height="35.97015un" type="PREFERRED" width="42.98507un"/>
+ <layout type="anchor">
+ <anchoritem dst="mDetailsList" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+ <anchoritem dst="mDetailsList" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
+ <anchoritem dst="mDetailsList" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+ <anchoritem dst="mDetailsList" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
+ </layout>
+ </widget>
+ <sizehint height="29.52029un" type="PREFERRED" width="29.52029un"/>
+ <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Expanding" verticalStretch="0"/>
+ <layout orientation="Vertical" type="linear">
+ <linearitem itemname="mDetailsContainer"/>
+ </layout>
+ </widget>
+ <widget name="mLeftContent" type="HbWidget">
+ <widget name="mThumbContainer" type="HbWidget">
+ <widget name="mDetailsLabel" type="HbStackedWidget">
+ <real name="z" value="5"/>
+ <sizehint height="29.49253un" type="FIXED" width="48.35821un"/>
+ <bool name="visible" value="TRUE"/>
+ <string name="state"/>
+ <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+ </widget>
+ <real name="z" value="1"/>
+ <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
+ <sizehint height="30.29851un" type="PREFERRED" width="49.04478un"/>
+ <layout type="anchor">
+ <anchoritem dst="mDetailsLabel" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+ <anchoritem dst="mDetailsLabel" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
+ <anchoritem dst="mDetailsLabel" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+ <anchoritem dst="mDetailsLabel" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
+ </layout>
+ </widget>
+ <widget name="mButton" type="HbPushButton">
+ <real name="z" value="6"/>
+ <sizehint height="7.5un" type="PREFERRED" width="43.88059un"/>
+ </widget>
+ <sizehint height="23.8806un" type="PREFERRED" width="23.8806un"/>
+ <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Expanding" verticalStretch="0"/>
+ <layout orientation="Vertical" type="linear">
+ <linearitem itemname="mThumbContainer"/>
+ <linearitem itemname="mButton"/>
+ </layout>
+ </widget>
+ <sizehint height="29.52029un" type="PREFERRED" width="29.52029un"/>
+ <layout orientation="Horizontal" spacing="0un" type="linear">
+ <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+ <linearitem itemname="mLeftContent"/>
+ <linearitem itemname="mRightContent"/>
+ </layout>
+ </widget>
+ <layout orientation="Vertical" spacing="0un" type="linear">
+ <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+ <linearitem itemname="mLblTitle"/>
+ <linearitem itemname="mDetailsContent"/>
+ </layout>
+ </widget>
+ </section>
+ <metadata activeUIState="landscape" display="NHD-4.0-inch_landscape" unit="un">
+ <uistate name="Common ui state" sections="#common"/>
+ <uistate name="portrait" sections="#common portrait"/>
+ <uistate name="landscape" sections="#common landscape"/>
+ </metadata>
+</hbdocument>
--- a/videocollection/videofiledetailsview/data/videofiledetails.qrc Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videofiledetailsview/data/videofiledetails.qrc Thu Jul 22 16:34:17 2010 +0100
@@ -1,8 +1,5 @@
<RCC>
<qresource prefix="/xml" >
- <file alias="videofiledetails.docml">videofiledetails.xml</file>
- </qresource>
- <qresource prefix="/gfx" >
- <file alias="pri_large_video.svg">pri_large_video.svg</file>
+ <file alias="videofiledetails.docml">videofiledetails.docml</file>
</qresource>
</RCC>
--- a/videocollection/videofiledetailsview/data/videofiledetails.xml Tue Jun 15 13:09:36 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,142 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<hbdocument version="0.9">
- <object name="mOptionsDelete" type="HbAction">
- <string locid="txt_common_opt_delete" name="text" value="Delete"/>
- </object>
- <widget name="videofiledetailsview" type="HbView">
- <widget name="mOptionsMenu" role="HbView:menu" type="HbMenu">
- <ref object="mOptionsDelete" role="HbMenu:addAction"/>
- </widget>
- <widget name="mContent" role="HbView:widget" type="HbWidget">
- <widget name="mLblTitle" type="HbStackedWidget">
- <real name="z" value="0.0079"/>
- <sizehint height="4.47761un" type="PREFERRED" width="47.7612un"/>
- </widget>
- <widget name="mDetailsContainer" type="HbWidget">
- <widget name="mDetailsList" type="HbListWidget"/>
- <real name="z" value="2"/>
- <sizehint height="23.8806un" type="PREFERRED" width="11.9403un"/>
- <layout orientation="Vertical" type="linear">
- <linearitem itemname="mDetailsList"/>
- </layout>
- </widget>
- <widget name="mThumbRating" type="HbWidget">
- <widget name="mDetailsLabel" type="HbStackedWidget">
- <real name="z" value="2"/>
- <sizehint height="34.47761un" type="PREFERRED" width="47.91045un"/>
- <bool name="visible" value="TRUE"/>
- <string name="state" value="normal"/>
- </widget>
- <real name="z" value="1"/>
- <sizehint height="37.31343un" type="PREFERRED" width="47.7612un"/>
- <layout type="anchor">
- <anchoritem dst="mDetailsLabel" dstEdge="LEFT" spacing="1.34328un" src="" srcEdge="LEFT"/>
- <anchoritem dst="mDetailsLabel" dstEdge="TOP" spacing="1.34328un" src="" srcEdge="TOP"/>
- </layout>
- </widget>
- </widget>
- </widget>
- <section name="portrait">
- <widget name="mDetailsContainer" type="HbWidget">
- <widget name="mButton" type="HbPushButton">
- <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
- <sizehint height="7.46269un" type="PREFERRED" width="14.92537un"/>
- <sizehint height="7.46269un" type="MINIMUM" width="7.46269un"/>
- <sizehint height="7.46269un" type="MAXIMUM" width="74.62687un"/>
- <string name="state" value="normal"/>
- </widget>
- <sizehint height="49.55224un" type="PREFERRED" width="50.74626un"/>
- <layout orientation="Vertical" type="linear">
- <linearitem itemname="mDetailsList"/>
- <linearitem itemname="mButton"/>
- </layout>
- </widget>
- <widget name="mContent" role="HbView:widget" type="HbWidget">
- <widget name="mThumbRating" type="HbWidget">
- <widget name="mDetailsLabel" type="HbStackedWidget">
- <real name="z" value="2"/>
- <sizehint height="28.54477688un" type="FIXED" width="50.74627un"/>
- <string name="state" value=""/>
- </widget>
- <real name="z" value="1"/>
- <sizehint height="28.69402688un" type="PREFERRED" width="50.74626un"/>
- <layout type="anchor">
- <anchoritem dst="mDetailsLabel" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
- <anchoritem dst="mDetailsLabel" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
- <anchoritem dst="mDetailsLabel" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
- <anchoritem dst="mDetailsLabel" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
- </layout>
- </widget>
- <layout type="anchor">
- <anchoritem dst="mLblTitle" dstEdge="TOP" spacing="1.04478un" src="" srcEdge="TOP"/>
- <anchoritem dst="mLblTitle" dstEdge="LEFT" spacing="1.49254un" src="" srcEdge="LEFT"/>
- <anchoritem dst="mLblTitle" dstEdge="RIGHT" spacing="-1.49254un" src="" srcEdge="RIGHT"/>
- <anchoritem dst="mDetailsContainer" dstEdge="LEFT" spacing="1.49254un" src="" srcEdge="LEFT"/>
- <anchoritem dst="mDetailsContainer" dstEdge="RIGHT" spacing="-1.49254un" src="" srcEdge="RIGHT"/>
- <anchoritem dst="mDetailsContainer" dstEdge="BOTTOM" spacing="-1.49254un" src="" srcEdge="BOTTOM"/>
- <anchoritem dst="mThumbRating" dstEdge="TOP" spacing="6.71642un" src="" srcEdge="TOP"/>
- <anchoritem dst="mThumbRating" dstEdge="LEFT" spacing="1.49254un" src="" srcEdge="LEFT"/>
- <anchoritem dst="mThumbRating" dstEdge="RIGHT" spacing="-1.49254un" src="" srcEdge="RIGHT"/>
- </layout>
- </widget>
- </section>
- <section name="landscape">
- <widget name="mContent" role="HbView:widget" type="HbWidget">
- <widget name="mDetailsContainer" type="HbWidget">
- <widget name="mDetailsList" type="HbListWidget">
- <sizehint height="26.71642un" type="PREFERRED" width="42.83582un"/>
- </widget>
- <real name="z" value="2"/>
- <sizehint height="37.01493un" type="PREFERRED" width="45.52239un"/>
- <layout type="anchor">
- <anchoritem dst="mDetailsList" dstEdge="LEFT" spacing="1.34328un" src="" srcEdge="LEFT"/>
- <anchoritem dst="mDetailsList" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
- <anchoritem dst="mDetailsList" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
- </layout>
- </widget>
- <widget name="mThumbRating" type="HbWidget">
- <widget name="mDetailsLabel" type="HbStackedWidget">
- <real name="z" value="2"/>
- <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
- <sizehint height="26.865675un" type="FIXED" width="47.7612un"/>
- <string name="state" value=""/>
- </widget>
- <widget name="mButton" type="HbPushButton">
- <real name="z" value="3"/>
- <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
- <sizehint height="7.46269un" type="PREFERRED" width="45.07463un"/>
- <sizehint height="7.46269un" type="MINIMUM" width="7.46269un"/>
- <sizehint height="7.46269un" type="MAXIMUM" width="74.62687un"/>
- <string name="state" value=""/>
- </widget>
- <real name="z" value="1"/>
- <sizehint height="37.31343un" type="PREFERRED" width="47.7612un"/>
- <layout type="anchor">
- <anchoritem dst="mButton" dstEdge="LEFT" spacing="1.34328un" src="" srcEdge="LEFT"/>
- <anchoritem dst="mButton" dstEdge="TOP" spacing="28.50746un" src="" srcEdge="TOP"/>
- <anchoritem dst="mDetailsLabel" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
- <anchoritem dst="mDetailsLabel" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
- <anchoritem dst="mDetailsLabel" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
- </layout>
- </widget>
- <layout type="anchor">
- <anchoritem dst="mLblTitle" dstEdge="LEFT" spacing="1.49254un" src="" srcEdge="LEFT"/>
- <anchoritem dst="mLblTitle" dstEdge="TOP" spacing="1.04478un" src="" srcEdge="TOP"/>
- <anchoritem dst="mLblTitle" dstEdge="RIGHT" spacing="1.49254un" src="" srcEdge="RIGHT"/>
- <anchoritem dst="mDetailsContainer" dstEdge="TOP" spacing="6.71642un" src="" srcEdge="TOP"/>
- <anchoritem dst="mDetailsContainer" dstEdge="LEFT" spacing="49.40299un" src="" srcEdge="LEFT"/>
- <anchoritem dst="mThumbRating" dstEdge="LEFT" spacing="1.49254un" src="" srcEdge="LEFT"/>
- <anchoritem dst="mThumbRating" dstEdge="TOP" spacing="6.71642un" src="" srcEdge="TOP"/>
- <anchoritem dst="mDetailsContainer" dstEdge="LEFT" spacing="0.14925un" src="mThumbRating" srcEdge="RIGHT"/>
- </layout>
- </widget>
- <widget name="mLayoutVideoInfo" role="HbScrollArea:contents" type="HbWidget">
- <layout orientation="Vertical" type="linear"/>
- </widget>
- </section>
- <metadata activeUIState="portrait" display="NHD portrait" unit="un">
- <uistate name="Common ui state" sections="#common"/>
- <uistate name="portrait" sections="#common portrait"/>
- <uistate name="landscape" sections="#common landscape"/>
- </metadata>
-</hbdocument>
--- a/videocollection/videofiledetailsview/src/videofiledetailsviewplugin.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videofiledetailsview/src/videofiledetailsviewplugin.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 73 %
+// Version : %version: 76.1.1 %
// INCLUDE FILES
#include <qcoreapplication.h>
@@ -46,10 +46,18 @@
#include "videodetailslabel.h"
#include "videocollectiontrace.h"
+// Object names.
+const char* const VIDEO_DETAILS_OBJECT_NAME_THUMBLABEL = "vc:FileDetailsThumbnailLabel";
+const char* const VIDEO_DETAILS_OBJECT_NAME_DELETE_VIDEO = "vc:FileDetailsMessageBoxDeleteVideo";
+const char* const VIDEO_DETAILS_OBJECT_NAME_MESSAGE_BOX_WARNING = "vc:FileDetailsMessageBoxWarning";
+const char* const VIDEO_DETAILS_OBJECT_NAME_DELETE_ACTION = "vc:FileDetailsDelete";
+const char* const VIDEO_DETAILS_OBJECT_NAME_NAVKEY_BACK = "vc:FileDetailsNavKeyBack";
+const char* const VIDEO_DETAILS_OBJECT_NAME_TITLE_ANIM = "vc:FileDetailsTitleAnim";
+
+// Docml constants.
const char* const VIDEO_DETAILS_DOCML = ":/xml/videofiledetails.docml";
const char* const VIDEO_DETAILS_PORTRAIT = "portrait";
const char* const VIDEO_DETAILS_LANDSCAPE = "landscape";
-const char* const VIDEO_DETAILS_GFX_DEFAULT = ":/gfx/pri_large_video.svg";
const char* const VIDEO_DETAILS_VIEW = "videofiledetailsview";
const char* const VIDEO_DETAILS_TITLE = "mLblTitle";
const char* const VIDEO_DETAILS_THUMBNAIL = "mDetailsLabel";
@@ -57,6 +65,11 @@
const char* const VIDEO_DETAILS_MENUACTION_DELETE = "mOptionsDelete";
const char* const VIDEO_DETAILS_LISTWIDGET = "mDetailsList";
+// Default thumbnail.
+const char* const VIDEO_DETAILS_GFX_DEFAULT = "qtg_large_video";
+
+const int VIDEO_DETAILS_SECONDARY_TEXT_ROW_COUNT = 255;
+
// ---------------------------------------------------------------------------
// Constructor
// ---------------------------------------------------------------------------
@@ -136,6 +149,7 @@
spec.setRole( HbFontSpec::Primary );
mTitleAnim->setFontSpec( spec );
mTitleAnim->setLoopCount(-1);
+ mTitleAnim->setObjectName(VIDEO_DETAILS_OBJECT_NAME_TITLE_ANIM);
connect(mModel->sourceModel(),
SIGNAL(shortDetailsReady(TMPXItemId)),
@@ -160,9 +174,9 @@
// no deallocation needed for this since
// stackedwidget takes ownership
mThumbLabel = new VideoDetailsLabel;
-
mThumbLabel->setAlignment(Qt::AlignCenter);
-
+ mThumbLabel->setObjectName(VIDEO_DETAILS_OBJECT_NAME_THUMBLABEL);
+
connect(mThumbLabel, SIGNAL(clicked(bool)), this, SLOT(startPlaybackSlot()));
thumbWidget->addWidget(mThumbLabel);
@@ -183,6 +197,7 @@
ERROR(-1, "VideoFileDetailsViewPlugin::createView() failed to delete action.");
return;
}
+ deleteAction->setObjectName(VIDEO_DETAILS_OBJECT_NAME_DELETE_ACTION);
if (mIsService)
{
@@ -195,7 +210,8 @@
// Create navigation keys.
mNavKeyBackAction = new HbAction(Hb::BackNaviAction);
-
+ mNavKeyBackAction->setObjectName(VIDEO_DETAILS_OBJECT_NAME_NAVKEY_BACK);
+
if (!mThumbnailManager)
{
mThumbnailManager = new ThumbnailManager();
@@ -212,7 +228,6 @@
}
list->setEnabledAnimations(HbAbstractItemView::None);
-
}
// ---------------------------------------------------------------------------
@@ -311,6 +326,14 @@
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"));
@@ -484,19 +507,17 @@
list->clear();
}
- //TODO: define maximum line count once >3 supported
HbListViewItem *prototype = list->listItemPrototype();
- prototype->setSecondaryTextRowCount(1, 3);
+ prototype->setSecondaryTextRowCount(1, VIDEO_DETAILS_SECONDARY_TEXT_ROW_COUNT);
for(int i = 0; i< detailCount; i++) {
if (metadata.contains(VideoDetailLabelKeys[i]))
{
HbListWidgetItem* listWidgetItem = new HbListWidgetItem();
listWidgetItem->setEnabled(false);
-
- listWidgetItem->setText( hbTrId(VideoDetailLabels[i]) );
- listWidgetItem->setSecondaryText( metadata[VideoDetailLabelKeys[i]].toString() );
- list->addItem( listWidgetItem );
+ listWidgetItem->setText( hbTrId(VideoDetailLabels[i]));
+ listWidgetItem->setSecondaryText(metadata[VideoDetailLabelKeys[i]].toString());
+ list->addItem(listWidgetItem);
}
}
@@ -578,8 +599,8 @@
HbMessageBox *messageBox = new HbMessageBox(text, HbMessageBox::MessageTypeQuestion);
messageBox->setAttribute(Qt::WA_DeleteOnClose);
+ messageBox->setObjectName(VIDEO_DETAILS_OBJECT_NAME_DELETE_VIDEO);
messageBox->open(this, SLOT(deleteVideoDialogFinished(HbAction *)));
-
}
}
}
@@ -613,7 +634,6 @@
mModel->deleteItems(list);
}
-
// ---------------------------------------------------------------------------
// Slot: rowsRemovedSlot
// ---------------------------------------------------------------------------
@@ -643,7 +663,7 @@
QString msg("");
if(errorCode == VideoCollectionCommon::statusSingleDeleteFail)
{
- QString format = hbTrId("txt_videos_info_unable_to_delete_1_it_is_current");
+ QString format = hbTrId("txt_videos_info_unable_to_delete_1_it_is_current");
if(additional.isValid())
{
msg = format.arg(additional.toString());
@@ -652,7 +672,10 @@
if(msg.count() > 0)
{
// show msg box if there's something to show
- HbMessageBox::warning(msg);
+ HbMessageBox *messageBox = new HbMessageBox(msg, HbMessageBox::MessageTypeWarning);
+ messageBox->setAttribute(Qt::WA_DeleteOnClose);
+ messageBox->setObjectName(VIDEO_DETAILS_OBJECT_NAME_MESSAGE_BOX_WARNING);
+ messageBox->show();
}
}
@@ -854,4 +877,4 @@
XQ_EXPORT_PLUGIN2( videofiledetailsview, VideoFileDetailsViewPlugin );
-// end of file
+// End of file
--- a/videocollection/videofiledetailsview/tsrc/testplugin/src/testvideofiledetails.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videofiledetailsview/tsrc/testplugin/src/testvideofiledetails.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -47,7 +47,7 @@
#include "videofiledetailsviewplugin.h"
#undef private
-const char *TEST_VIDEO_DETAILS_GFX_DEFAULT = ":/gfx/pri_large_video.svg";
+const char *TEST_VIDEO_DETAILS_GFX_DEFAULT = "qtg_large_video";
const char *TEST_VIDEO_DETAILS_VIEW = "videofiledetailsview";
const char *TEST_VIDEO_DETAILS_WIDGET = "mContent";
const char *TEST_VIDEO_DETAILS_TITLE = "mLblTitle";
@@ -595,7 +595,7 @@
QVERIFY( deleteAction != 0 );
deleteAction->trigger();
- QCOMPARE( mDummyModel->dataAccessCount(), 0 );
+ QCOMPARE( mDummyModel->dataAccessCount(), 0 );
mPlugin->mVideoId = (0,0);
mDummyModel->setDataReturnInvalid(true);
@@ -612,6 +612,8 @@
QCOMPARE( mDummyModel->dataAccessCount(), 2 );
QVERIFY( mDummyModel->lastIndex() == expected );
QCOMPARE( mDummyModel->deleteFileIndex(), -1 ); // verify that no file was deleted.
+
+ HbMessageBox *msgBox = new HbMessageBox();
QStringList display;
display.append("first row");
@@ -620,16 +622,15 @@
QString expectedText = hbTrId("txt_videos_info_do_you_want_to_delete_1").arg(
display.first());
-
- HbMessageBox::mQuestionReturnValue = true;
deleteAction->trigger();
+ msgBox->emitDialogFinished(mPlugin, SLOT(deleteVideoDialogFinished(HbAction *)), 0); // Yes selected
QCOMPARE( mDummyModel->dataAccessCount(), 3 );
QVERIFY( mDummyModel->lastIndex() == expected );
QCOMPARE( mDummyModel->deleteFileIndex(), expected.row() );
QCOMPARE( HbMessageBox::mLatestTxt, expectedText );
- HbMessageBox::mQuestionReturnValue = false;
deleteAction->trigger();
+ msgBox->emitDialogFinished(mPlugin, SLOT(deleteVideoDialogFinished(HbAction *)), 1); // No selected
QCOMPARE( mDummyModel->dataAccessCount(), 4 );
QVERIFY( mDummyModel->lastIndex() == expected );
QCOMPARE( mDummyModel->deleteFileIndex(), expected.row() );
@@ -637,13 +638,14 @@
mDummyModel->reset();
- HbMessageBox::mQuestionReturnValue = false;
deleteAction->trigger();
+ msgBox->emitDialogFinished(mPlugin, SLOT(deleteVideoDialogFinished(HbAction *)), 1); // No selected
QCOMPARE( mDummyModel->dataAccessCount(), 1 );
QVERIFY( mDummyModel->lastIndex() == expected );
QCOMPARE( mDummyModel->deleteFileIndex(), -1 ); // verify that no file was deleted.
QCOMPARE( HbMessageBox::mLatestTxt, expectedText );
+ delete msgBox;
cleanup();
}
--- a/videocollection/videofiledetailsview/tsrc/testplugin/stub/inc/hbmessagebox.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videofiledetailsview/tsrc/testplugin/stub/inc/hbmessagebox.h Thu Jul 22 16:34:17 2010 +0100
@@ -19,23 +19,37 @@
#ifndef HBMESSAGEBOX_H
#define HBMESSAGEBOX_H
+#include <QObject>
#include <QString>
+#include <QGraphicsItem>
+#include <hbaction.h>
+
+class HbMessageBox : public QObject
+{
+ Q_OBJECT
+public:
-class HbMessageBox
-{
-
-public:
+ enum MessageBoxType {
+ MessageTypeInformation,
+ MessageTypeQuestion,
+ MessageTypeWarning
+ };
+
+ HbMessageBox(MessageBoxType type = MessageTypeInformation, QGraphicsItem *parent = 0);
+ HbMessageBox(const QString &text, MessageBoxType type = MessageTypeInformation, QGraphicsItem *parent = 0);
+ ~HbMessageBox();
+
+ void show();
/**
- * saves provided text to mLatestTxt
- * returns mQuestionReturnValue
+ * Create new HbMessageBox and call emitDialogFinished after this one to finish the sequence.
*/
- static bool question(QString text)
- {
- mLatestTxt = text;
- return mQuestionReturnValue;
- }
+ void open( QObject* receiver = 0, const char* member = 0 );
+
+ void emitDialogFinished( QObject* receiver, const char* member, int actionNum );
+
+ void setAttribute(int attribute);
/**
* saves provided text to mLatestTxt
@@ -53,18 +67,26 @@
mLatestTxt = text;
}
- /**
- * returned from question
- */
- static bool mQuestionReturnValue;
+ QList<HbAction*> actions() const
+ {
+ return mActions;
+ }
/**
* saved text
*/
static QString mLatestTxt;
+ static int mType;
+ static int mAttribute;
+ static int mOpenCallCount;
+ static int mShowCallCount;
+
+ QList<HbAction*> mActions;
+
+signals:
+
+ void finished(HbAction *action);
};
-
-
#endif // HBMESSAGEBOX_H
--- a/videocollection/videofiledetailsview/tsrc/testplugin/stub/src/hbmessagebox.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videocollection/videofiledetailsview/tsrc/testplugin/stub/src/hbmessagebox.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -17,10 +17,65 @@
#include "hbmessagebox.h"
-bool HbMessageBox::mQuestionReturnValue = false;
+QString HbMessageBox::mLatestTxt = "";
+int HbMessageBox::mType = -1;
+int HbMessageBox::mAttribute = -1;
+int HbMessageBox::mOpenCallCount = 0;
+int HbMessageBox::mShowCallCount = 0;
-QString HbMessageBox::mLatestTxt = "";
+HbMessageBox::HbMessageBox(MessageBoxType type, QGraphicsItem *parent)
+{
+ Q_UNUSED(parent);
+ HbMessageBox::mType = type;
+
+ HbAction *action = new HbAction();
+ mActions.append(action);
+ action = new HbAction();
+ mActions.append(action);
+}
+
+HbMessageBox::HbMessageBox(const QString &text, MessageBoxType type, QGraphicsItem *parent)
+{
+ Q_UNUSED(parent);
+ HbMessageBox::mLatestTxt = text;
+ HbMessageBox::mType = type;
+
+ HbAction *action = new HbAction();
+ mActions.append(action);
+ action = new HbAction();
+ mActions.append(action);
+}
+HbMessageBox::~HbMessageBox()
+{
+ while(!mActions.isEmpty())
+ {
+ delete mActions.takeFirst();
+ }
+}
+void HbMessageBox::show()
+{
+ HbMessageBox::mShowCallCount++;
+}
+void HbMessageBox::open( QObject* receiver, const char* member )
+{
+ Q_UNUSED(receiver);
+ Q_UNUSED(member);
+ HbMessageBox::mOpenCallCount++;
+}
+void HbMessageBox::emitDialogFinished( QObject* receiver, const char* member, int actionNum )
+{
+ if(connect(this, SIGNAL(finished(HbAction *)), receiver, member))
+ {
+ emit finished(mActions.value(actionNum));
+ disconnect(this, SIGNAL(finished(HbAction *)), receiver, member);
+ }
+}
+
+void HbMessageBox::setAttribute(int attribute)
+{
+ HbMessageBox::mAttribute = attribute;
+}
--- a/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackcontrol.hrh Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackcontrol.hrh Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 6 %
+// Version : %version: 7 %
#ifndef MPXVIDEOPLAYBACKCONTROL_HRH_
@@ -57,7 +57,6 @@
//
// Bitmaps
//
- EMPXBlackBitmap,
EMPXIndicatorBitmap,
EMPXRealLogoBitmap,
@@ -89,7 +88,8 @@
EMPXControlCmdSoftKeyPressed,
EMPXControlCmdFullScreenViewOpened,
EMPXControlCmdDetailsViewOpened,
- EMPXControlCmdAudionOnlyViewOpened
+ EMPXControlCmdAudionOnlyViewOpened,
+ EMPXControlCmdRemoveRNLogo
};
enum TMPXVideoSeekingType
--- a/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackcontrolbar.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackcontrolbar.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 2 %
+// Version : %version: 3 %
@@ -23,8 +23,6 @@
#define MPXVIDEOPLAYBACKCONTROLBAR_H_
-
-#include <hbeffect.h>
#include <hbwidget.h>
#include <mpxplaybackframeworkdefs.h>
@@ -48,10 +46,6 @@
void durationChanged( int duration );
void positionChanged( int position );
- private slots:
- void appeared( const HbEffect::EffectStatus &status );
- void disappeared( const HbEffect::EffectStatus &status );
-
private:
QMPXVideoPlaybackControlsController *mController;
QMPXVideoPlaybackToolBar *mToolBar;
--- a/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackdetailsplaybackwindow.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackdetailsplaybackwindow.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 6 %
+// Version : %version: 7 %
@@ -37,8 +37,6 @@
virtual ~QMPXVideoPlaybackDetailsPlaybackWindow();
void initialize();
void updateState( TMPXPlaybackState state );
- void mousePressEvent( QGraphicsSceneMouseEvent *event );
- void mouseReleaseEvent( QGraphicsSceneMouseEvent *event );
private slots:
void playPause();
--- a/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackfiledetailswidget.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackfiledetailswidget.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 10 %
+// Version : %version: 11 %
@@ -37,7 +37,6 @@
public:
QMPXVideoPlaybackFileDetailsWidget( QMPXVideoPlaybackControlsController* controller );
virtual ~QMPXVideoPlaybackFileDetailsWidget();
- void initialize();
public:
void updateWithFileDetails( QMPXVideoPlaybackViewFileDetails* details );
--- a/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackprogressbar.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackprogressbar.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,23 +15,22 @@
*
*/
-// Version : %version: da1mmcf#11 %
+// Version : %version: da1mmcf#13 %
#ifndef MPXVIDEOPLAYBACKPROGRESSBAR_H_
#define MPXVIDEOPLAYBACKPROGRESSBAR_H_
-#include <hbwidget.h>
+#include <QObject>
#include <mpxplaybackframeworkdefs.h>
class QTimer;
-class HbFrameItem;
class HbProgressSlider;
class QMPXVideoPlaybackViewFileDetails;
class QMPXVideoPlaybackControlsController;
-class QMPXVideoPlaybackProgressBar : public HbWidget
+class QMPXVideoPlaybackProgressBar : public QObject
{
Q_OBJECT
@@ -59,7 +58,6 @@
private:
QMPXVideoPlaybackControlsController *mController;
HbProgressSlider *mProgressSlider;
- HbFrameItem *mFrameItem;
int mDuration;
int mDraggingPosition;
--- a/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackstatuspanecontrol.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackstatuspanecontrol.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 9 %
+// Version : %version: 10 %
@@ -28,7 +28,8 @@
class HbLabel;
class HbAction;
-class HbFrameItem;
+class HbGroupBox;
+class QGraphicsWidget;
class QMPXVideoPlaybackViewFileDetails;
class QMPXVideoPlaybackControlsController;
@@ -73,7 +74,8 @@
bool mVisible;
HbAction *mActionBack;
HbLabel *mTitleLabel;
- HbFrameItem *mFrameItem;
+ HbGroupBox *mTitleGroupBox;
+ QGraphicsWidget *mTitleLayout;
};
#endif /*MPXVIDEOPLAYBACKSTATUSPANECONTROL_H_*/
--- a/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybacktoolbar.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybacktoolbar.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 2 %
+// Version : %version: 3 %
@@ -114,7 +114,6 @@
TMPXSeekingState mSeekingState;
bool mInitialized;
- bool mNeverVisibled;
int mPosition;
int mDuration;
int mAspectRatio;
--- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolbar.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolbar.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 6 %
+// Version : %version: 7 %
@@ -24,7 +24,6 @@
#include "mpxvideoplaybackcontrolbar.h"
#include "mpxvideoplaybackprogressbar.h"
#include "mpxcommonvideoplaybackview.hrh"
-#include "mpxvideoplaybackdocumentloader.h"
#include "mpxvideoplaybackcontrolscontroller.h"
@@ -32,17 +31,21 @@
// QMPXVideoPlaybackControlBar::QMPXVideoPlaybackControlBar()
// -------------------------------------------------------------------------------------------------
//
-QMPXVideoPlaybackControlBar::QMPXVideoPlaybackControlBar(
+QMPXVideoPlaybackControlBar::QMPXVideoPlaybackControlBar(
QMPXVideoPlaybackControlsController* controller )
: mController( controller )
- , mProgressBar( NULL )
{
MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlBar::QMPXVideoPlaybackControlBar"));
//
- // button bar
+ // create toolbar handler
//
mToolBar = new QMPXVideoPlaybackToolBar( mController );
+
+ //
+ // create progressbar handler
+ //
+ mProgressBar = new QMPXVideoPlaybackProgressBar( mController );
}
// -------------------------------------------------------------------------------------------------
@@ -53,6 +56,12 @@
{
MPX_DEBUG(_L("QMPXVideoPlaybackControlBar::~QMPXVideoPlaybackControlBar()"));
+ if ( mProgressBar )
+ {
+ delete mProgressBar;
+ mProgressBar = NULL;
+ }
+
if ( mToolBar )
{
delete mToolBar;
@@ -68,23 +77,9 @@
{
MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlBar::initialize()"));
- QMPXVideoPlaybackDocumentLoader *loader = mController->layoutLoader();
-
- //
- // Don't need to initialize buttons once it gets initialized
- //
- if ( mProgressBar == NULL )
+ if ( mProgressBar )
{
- //
- // progress bar
- //
- QGraphicsWidget *widget = loader->findWidget( QString( "progressBarLayout" ) );
- mProgressBar = qobject_cast<QMPXVideoPlaybackProgressBar*>( widget );
-
- if ( mProgressBar )
- {
- mProgressBar->initialize();
- }
+ mProgressBar->initialize();
}
}
@@ -157,43 +152,6 @@
}
}
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlBar::appeared()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlBar::appeared( const HbEffect::EffectStatus &status )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlBar::appeared()"));
-
- if ( status.reason == Hb::EffectFinished )
- {
- MPX_DEBUG(_L("QMPXVideoPlaybackControlBar::appeared() successful"));
- }
- else
- {
- MPX_DEBUG(_L("QMPXVideoPlaybackControlBar::appeared() NOT successful"));
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlBar::disappeared()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlBar::disappeared( const HbEffect::EffectStatus &status )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlBar::disappeared()"));
-
- if ( status.reason == Hb::EffectFinished )
- {
- setVisible( false );
-
- MPX_DEBUG(_L("QMPXVideoPlaybackControlBar::disappeared() successful"));
- }
- else
- {
- MPX_DEBUG(_L("QMPXVideoPlaybackControlBar::disappeared() NOT successful"));
- }
-}
// -------------------------------------------------------------------------------------------------
// QMPXVideoPlaybackControlBar::durationChanged()
@@ -226,7 +184,7 @@
{
mProgressBar->positionChanged( position );
}
-
+
if ( mToolBar )
{
mToolBar->positionChanged( position );
--- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolconfiguration.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolconfiguration.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#19 %
+// Version : %version: da1mmcf#20 %
@@ -64,6 +64,8 @@
QMPXVideoPlaybackViewFileDetails* fileDetails = mControlsController->fileDetails();
+ addControlToList( EMPXStatusPane );
+
if ( fileDetails->mPlaybackMode == EMPXVideoStreaming ||
fileDetails->mPlaybackMode == EMPXVideoLiveStreaming )
{
@@ -72,8 +74,10 @@
//
addControlToList( EMPXBufferingAnimation );
}
-
- addControlToList( EMPXStatusPane );
+ else if ( fileDetails->mRNFormat )
+ {
+ addControlToList( EMPXRealLogoBitmap );
+ }
emit controlListUpdated();
}
@@ -143,12 +147,12 @@
break;
}
- case EMPXControlCmdTvOutDisconnected:
+ case EMPXControlCmdRemoveRNLogo:
{
- break;
- }
- default:
- {
+ MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::updateControlList() RN Logo removed"));
+
+ deleteControlFromList( EMPXRealLogoBitmap );
+
break;
}
}
--- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolpolicy.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolpolicy.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#13 %
+// Version : %version: da1mmcf#14 %
@@ -127,6 +127,7 @@
}
case EMPXFileDetailsWidget:
case EMPXIndicatorBitmap:
+ case EMPXRealLogoBitmap:
case EMPXDetailsViewPlaybackWindow:
{
//
--- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolscontroller.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolscontroller.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#37 %
+// Version : %version: da1mmcf#41 %
@@ -26,18 +26,17 @@
#include <f32file.h>
#include <QTimer>
-#include <QFileInfo>
#include <thumbnailmanager_qt.h>
#include <xqserviceutil.h>
#include <hblabel.h>
-#include <hbiconitem.h>
-#include <hbratingslider.h>
-#include <hbiconanimator.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"
@@ -70,6 +69,7 @@
, mControlsPolicy( NULL )
, mControlsConfig( NULL )
, mControlsTimer( NULL )
+ , mRNLogoTimer( NULL )
, mLoader( NULL )
, mVolumeControl( NULL )
, mThumbnailManager( NULL )
@@ -93,12 +93,22 @@
{
MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::initializeController()"));
+ mOrientation = hbInstance->allMainWindows()[0]->orientation();
+ bool ok = connect( hbInstance->allMainWindows()[0], SIGNAL( orientationChanged( Qt::Orientation ) ),
+ this, SLOT( handleOrientationChanged( Qt::Orientation ) ) );
+
+ MPX_DEBUG(
+ _L("QMPXVideoPlaybackControlsController::initializeController() orientation = %d, ok =%d"),
+ mOrientation, ok );
+
setParent( mView );
+ mView->hideItems( Hb::AllItems );
+
//
// Create layout loader
//
- bool ok = false;
+ ok = false;
mLoader = new QMPXVideoPlaybackDocumentLoader( this );
mLoader->load( KMPXPLAYBACKVIEW_XML, &ok );
@@ -119,19 +129,25 @@
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() ) );
- connect( mView, SIGNAL( tappedOnScreen() ), this, SLOT( handleTappedOnScreen() ) );
-
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 );
@@ -139,14 +155,30 @@
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
+ // obtain VideoServices instance
//
- mVideoServices = VideoServices::instance();
+ mVideoServices = VideoServices::instance();
//
// allow 'attach' operation only for non-streaming media clips
@@ -157,18 +189,17 @@
// 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& ) ) );
+ connect( this, SIGNAL( attachVideoPath( const QString& ) ),
+ mVideoServices, SLOT( itemSelected( const QString& ) ) );
}
}
}
-
}
// -------------------------------------------------------------------------------------------------
@@ -179,10 +210,21 @@
{
MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController()"));
- disconnect( mControlsConfig, SIGNAL( controlListUpdated() ), this, SLOT( controlsListUpdated() ) );
+ mView->ungrabGesture( Qt::TapGesture );
+ disconnect( mView, SIGNAL( tappedOnScreen() ), this, SLOT( handleTappedOnScreen() ) );
+
+ if ( mFileDetails->mMultiItemPlaylist )
+ {
+ mView->ungrabGesture( Qt::PanGesture );
- disconnect( mView, SIGNAL( tappedOnScreen() ), this, SLOT( handleTappedOnScreen() ) );
+ 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 );
@@ -194,6 +236,14 @@
mControlsTimer = NULL;
}
+ if ( mRNLogoTimer )
+ {
+ disconnect( mRNLogoTimer, SIGNAL( timeout() ), this, SLOT( handleRNLogoTimeout() ) );
+
+ delete mRNLogoTimer;
+ mRNLogoTimer = NULL;
+ }
+
if ( mControlsPolicy )
{
delete mControlsPolicy;
@@ -215,7 +265,7 @@
if ( mThumbnailManager )
{
delete mThumbnailManager;
- mThumbnailManager = NULL;
+ mThumbnailManager = NULL;
}
if ( mVolumeControl )
@@ -223,25 +273,24 @@
delete mVolumeControl;
mVolumeControl = NULL;
}
-
+
if ( mIsAttachOperation )
{
//
// disable connection for 'attach' operation
//
- disconnect( this, SIGNAL( attachVideoPath( const QString& ) ),
- mVideoServices, SLOT( itemSelected( const QString& ) ) );
+ disconnect( this, SIGNAL( attachVideoPath( const QString& ) ),
+ mVideoServices, SLOT( itemSelected( const QString& ) ) );
}
-
+
if ( mVideoServices )
- {
+ {
//
// decrease videoservices instance count
//
mVideoServices->decreaseReferenceCount();
mVideoServices = 0;
}
-
}
// -------------------------------------------------------------------------------------------------
@@ -280,21 +329,6 @@
mVolumeControl->setValue( 0 );
mVolumeControl->setEnabled( false );
}
-
- //
- // If title is not available, show clip name
- //
- QString title = mFileDetails->mTitle;
-
- if ( title.count() == 0 )
- {
- QFileInfo fileInfo( mFileDetails->mClipName );
- title = fileInfo.baseName ();
- }
-
- QGraphicsWidget *widget = mLoader->findWidget( QString( "title" ) );
- HbLabel *titleLabel = qobject_cast<HbLabel*>( widget );
- titleLabel->setPlainText( title );
}
// -------------------------------------------------------------------------------------------------
@@ -435,7 +469,7 @@
}
default:
{
- break;
+ break;
}
}
}
@@ -479,7 +513,7 @@
// Update the policy property based on file details and view mode to the controls
//
TUint properties = 0;
- mControlsPolicy->setControlProperties(
+ mControlsPolicy->setControlProperties(
mControls[i]->controlIndex(), properties, mFileDetails, mViewMode );
mControls[i]->updateControlProperties( properties );
@@ -487,7 +521,7 @@
// Control exists in new list.
//
myList.removeAt( index );
- i++;
+ i++;
}
}
@@ -526,11 +560,27 @@
case EMPXBufferingAnimation:
{
//
+ // Load animation icons
+ //
+ QString animationName = ":/hbvideoplaybackview/animations/";
+
+ if ( mFileDetails->mRNFormat )
+ {
+ animationName.append( "rn_preroll_anim.axml" );
+ }
+ else
+ {
+ animationName.append( "generic_preroll_anim.axml" );
+ }
+
+ HbIconAnimationManager* manager = HbIconAnimationManager::global();
+ bool ok = manager->addDefinitionFile( animationName );
+
+ MPX_DEBUG(_L(" EMPXBufferingAnimation add animation definition ok = %d"), ok);
+
+ //
// Buffering animation icon
//
- HbIconAnimationManager* manager = HbIconAnimationManager::global();
- manager->addDefinitionFile(":/hbvideoplaybackview/animation.axml");
-
QGraphicsWidget *widget = mLoader->findWidget( QString( "bufferingIcon" ) );
HbLabel *bufferingAnim = qobject_cast<HbLabel*>( widget );
@@ -548,7 +598,7 @@
// Status key (signal + title + back key)
//
control = new QMPXVideoPlaybackStatusPaneControl( this,
- controlIndex,
+ controlIndex,
NULL,
properties );
mControls.append( control );
@@ -561,7 +611,7 @@
// Button bar
//
QGraphicsWidget *widget = mLoader->findWidget( QString( "controlBarLayout" ) );
- QMPXVideoPlaybackControlBar *controlBar =
+ QMPXVideoPlaybackControlBar *controlBar =
qobject_cast<QMPXVideoPlaybackControlBar*>( widget );
controlBar->initialize();
@@ -576,9 +626,8 @@
case EMPXFileDetailsWidget:
{
QGraphicsWidget *widget = mLoader->findWidget( QString( "fileDetailsLayout" ) );
- QMPXVideoPlaybackFileDetailsWidget *fileDetails =
+ QMPXVideoPlaybackFileDetailsWidget *fileDetails =
qobject_cast<QMPXVideoPlaybackFileDetailsWidget*>( widget );
- fileDetails->initialize();
control = new QMPXVideoPlaybackFullScreenControl( this,
controlIndex,
@@ -602,10 +651,26 @@
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 =
+ QMPXVideoPlaybackDetailsPlaybackWindow *detailsPlaybackWindow =
qobject_cast<QMPXVideoPlaybackDetailsPlaybackWindow*>( widget );
detailsPlaybackWindow->initialize();
@@ -630,33 +695,41 @@
MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::handleTappedOnScreen()"));
//
- // Toggle visibility only if the followings are true
- // - TV-Out is not connected
- // - Video is available
- // - We are in playing or paused state
+ // 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
//
- if ( ! isTvOutConnected() &&
- mFileDetails->mVideoEnabled &&
- ( mState == EPbStatePlaying || mState == EPbStatePaused ) )
+ switch( mViewMode )
{
- if ( mViewMode == EFullScreenView )
+ case EFullScreenView:
{
- if ( isVisible() )
+ if ( mState == EPbStatePlaying || mState == EPbStatePaused )
{
- //
- // If the volume control is visible, hide it
- //
- if ( mVolumeControl->isVisible() )
+ if ( isVisible() )
{
- mVolumeControl->setVisible( false );
+ //
+ // If the volume control is visible, hide it
+ //
+ if ( mVolumeControl->isVisible() )
+ {
+ mVolumeControl->setVisible( false );
+ }
+
+ hideAllControls();
}
-
- hideAllControls();
+ else
+ {
+ showControls();
+ }
}
- else
- {
- showControls();
- }
+
+ break;
+ }
+ case EDetailsView:
+ {
+ handleCommand( EMPXPbvCmdPlayPause );
+
+ break;
}
}
}
@@ -713,13 +786,13 @@
resetDisappearingTimers( EMPXTimerReset );
- if ( ! mViewTransitionIsGoingOn )
+ if ( ! mViewTransitionIsGoingOn && mOrientation == Qt::Horizontal )
{
for ( int i = 0 ; i < mControls.count() ; i++ )
{
mControls[i]->setVisibility( mState );
}
- }
+ }
}
// -------------------------------------------------------------------------------------------------
@@ -728,7 +801,7 @@
//
bool QMPXVideoPlaybackControlsController::isVisible()
{
- bool visible = EFalse;
+ bool visible = false;
for ( int i = 0 ; i < mControls.count() ; i++ )
{
@@ -736,7 +809,7 @@
{
if ( mControls[i]->isVisible() )
{
- visible = ETrue;
+ visible = true;
}
break;
@@ -752,7 +825,7 @@
// QMPXVideoPlaybackControlsController::handleCommand()
// -------------------------------------------------------------------------------------------------
//
-void QMPXVideoPlaybackControlsController::handleCommand(
+void QMPXVideoPlaybackControlsController::handleCommand(
TMPXVideoPlaybackViewCommandIds command, int value )
{
MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::handleCommand(%d)"), command);
@@ -761,14 +834,14 @@
{
case EMPXPbvCmdSetPosition:
{
- TRAP_IGNORE( mViewWrapper->SetPropertyL( EPbPropertyPosition,
+ TRAP_IGNORE( mViewWrapper->SetPropertyL( EPbPropertyPosition,
value * KPbMilliMultiplier ) );
break;
}
case EMPXPbvCmdSetVolume:
{
TRAP_IGNORE( mViewWrapper->SetPropertyL( EPbPropertyVolume, value ) );
- break;
+ break;
}
default:
{
@@ -877,7 +950,7 @@
//
bool QMPXVideoPlaybackControlsController::realFormat( QString filename )
{
- bool realFormat = EFalse;
+ bool realFormat = false;
if ( !filename.isNull() && !filename.isEmpty() )
{
@@ -904,7 +977,7 @@
//
bool QMPXVideoPlaybackControlsController::realFormatForStreaming( const TDesC& des )
{
- bool realFormat = EFalse;
+ bool realFormat = false;
TParse filePath;
_LIT(KMPXRMEXT, ".R" );
@@ -936,7 +1009,7 @@
fileName->Des()[j]='/';
}
}
- err = filePath.Set( fileName->Des(), NULL, NULL );
+ err = filePath.Set( fileName->Des(), NULL, NULL );
}
if ( fileName )
@@ -967,7 +1040,7 @@
// RealMedia Branding
if ( ! buf.Compare( KMPXRMEXT ) )
{
- realFormat = ETrue;
+ realFormat = true;
}
}
@@ -983,16 +1056,16 @@
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;
@@ -1046,9 +1119,9 @@
// QMPXVideoPlaybackControlsController::isSoftKeyVisible()
// -------------------------------------------------------------------------------------------------
//
-bool QMPXVideoPlaybackControlsController::isSoftKeyVisible( int /*value*/ )
+bool QMPXVideoPlaybackControlsController::isSoftKeyVisible()
{
- bool visible = EFalse;
+ bool visible = false;
for ( int i = 0 ; i < mControls.count() ; i++ )
{
@@ -1056,7 +1129,7 @@
{
if ( mControls[i]->isVisible() )
{
- visible = ETrue;
+ visible = true;
}
break;
@@ -1089,7 +1162,7 @@
}
//
- // Change the view.
+ // Change the view.
// If Tv-out is connected, go to AudioOnlyView.
// If not, go back to default view.
//
@@ -1107,7 +1180,7 @@
// QMPXVideoPlaybackControlsController::changeViewMode
// -------------------------------------------------------------------------------------------------
//
-void QMPXVideoPlaybackControlsController::changeViewMode(
+void QMPXVideoPlaybackControlsController::changeViewMode(
TPlaybackViewMode viewMode, bool transitionEffect )
{
MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::changeViewMode( %d, %d )"),
@@ -1181,7 +1254,10 @@
{
MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::skipToPreviousVideoItem()"));
- handleCommand( EMPXPbvCmdPreviousListItem );
+ if ( mViewMode == EFullScreenView )
+ {
+ handleCommand( EMPXPbvCmdPreviousListItem );
+ }
}
// -------------------------------------------------------------------------------------------------
@@ -1192,7 +1268,10 @@
{
MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::skipToNextVideoItem()"));
- handleCommand( EMPXPbvCmdNextListItem );
+ if ( mViewMode == EFullScreenView )
+ {
+ handleCommand( EMPXPbvCmdNextListItem );
+ }
}
// -------------------------------------------------------------------------------------------------
@@ -1212,7 +1291,7 @@
MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::updateVideoRect() : mViewMode = %d )"),
mViewMode );
-
+
if ( mViewMode == EDetailsView )
{
QGraphicsWidget *parent = mLoader->findWidget( QString( "detailsPlaybackWindow" ) );
@@ -1226,7 +1305,7 @@
rect = widget->geometry();
}
- mViewWrapper->UpdateVideoRect(
+ mViewWrapper->UpdateVideoRect(
rect.x(), rect.y(), rect.width(), rect.height(), transitionEffect );
}
}
@@ -1261,7 +1340,7 @@
{
tvOutBitmap->setVisible( true );
}
- else if ( mFileDetails->mRNFormat )
+ else if ( mFileDetails->mRNFormat )
{
realAudioOnlyBitmap->setVisible( true );
}
@@ -1273,7 +1352,7 @@
{
audioOnlyBitmap->setVisible( true );
}
- }
+ }
}
// -------------------------------------------------------------------------------------------------
@@ -1291,12 +1370,12 @@
{
if ( mThumbNailState == EThumbNailEmpty )
{
- mThumbnailManager = new ThumbnailManager(); ;
+ mThumbnailManager = new ThumbnailManager(); ;
mThumbnailManager->setThumbnailSize( ThumbnailManager::ThumbnailLarge );
mThumbnailManager->setQualityPreference( ThumbnailManager::OptimizeForPerformance );
-
- if ( connect( mThumbnailManager, SIGNAL( thumbnailReady( QPixmap , void * , int , int ) ),
+
+ if ( connect( mThumbnailManager, SIGNAL( thumbnailReady( QPixmap , void * , int , int ) ),
this, SLOT( handleThumbnailReady( QPixmap , void * , int , int ) ) ) )
{
mThumbnailManager->getThumbnail( mFileDetails->mClipName );
@@ -1314,7 +1393,7 @@
// QMPXVideoPlaybackControlsController::handleThumbnailReady()
// -------------------------------------------------------------------------------------------------
//
-void QMPXVideoPlaybackControlsController::handleThumbnailReady(
+void QMPXVideoPlaybackControlsController::handleThumbnailReady(
QPixmap tnData, void *internal , int id, int error )
{
Q_UNUSED( internal );
@@ -1340,23 +1419,11 @@
setDefaultBitmap();
- disconnect( mThumbnailManager, SIGNAL( thumbnailReady( QPixmap , void * , int , int ) ),
+ disconnect( mThumbnailManager, SIGNAL( thumbnailReady( QPixmap , void * , int , int ) ),
this, SLOT( handleThumbnailReady( QPixmap , void * , int , int ) ) );
}
// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::isAttachOperation
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackControlsController::isAttachOperation()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::isAttachOperation() ret %d"),
- mIsAttachOperation );
-
- return mIsAttachOperation;
-}
-
-// -------------------------------------------------------------------------------------------------
// QMPXVideoPlaybackControlsController::attachVideo()
// -------------------------------------------------------------------------------------------------
//
@@ -1364,17 +1431,17 @@
{
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 ) );
-
+
}
// -------------------------------------------------------------------------------------------------
@@ -1385,19 +1452,110 @@
{
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 );
+ 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 Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackdetailsplaybackwindow.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 16 %
+// Version : %version: 18 %
@@ -34,7 +34,7 @@
// QMPXVideoPlaybackDetailsPlaybackWindow::QMPXVideoPlaybackDetailsPlaybackWindow
// -------------------------------------------------------------------------------------------------
//
-QMPXVideoPlaybackDetailsPlaybackWindow::QMPXVideoPlaybackDetailsPlaybackWindow(
+QMPXVideoPlaybackDetailsPlaybackWindow::QMPXVideoPlaybackDetailsPlaybackWindow(
QMPXVideoPlaybackControlsController* controller )
: mController( controller )
, mInitialized( false )
@@ -107,7 +107,7 @@
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
@@ -116,17 +116,17 @@
{
attachButton->setVisible( true );
shareButton->setVisible( false );
- }
+ }
else
- {
+ {
//
// dim "share" button for streaming
//
- if ( mController->fileDetails()->mPlaybackMode == EMPXVideoStreaming ||
- mController->fileDetails()->mPlaybackMode == EMPXVideoLiveStreaming )
+ if ( details->mPlaybackMode == EMPXVideoStreaming ||
+ details->mPlaybackMode == EMPXVideoLiveStreaming )
{
- shareButton->setEnabled( false );
- }
+ shareButton->setEnabled( false );
+ }
}
}
@@ -167,28 +167,4 @@
mController->handleCommand( EMPXPbvCmdPlayPause );
}
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDetailsPlaybackWindow::mousePressEvent
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackDetailsPlaybackWindow::mousePressEvent( QGraphicsSceneMouseEvent *event )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackDetailsPlaybackWindow::mousePressEvent"));
-
- event->accept();
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDetailsPlaybackWindow::mouseReleaseEvent
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackDetailsPlaybackWindow::mouseReleaseEvent( QGraphicsSceneMouseEvent *event )
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackDetailsPlaybackWindow::mouseReleaseEvent"));
-
- playPause();
-
- event->accept();
-}
-
//End of file
--- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackdocumentloader.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackdocumentloader.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,13 +15,12 @@
*
*/
-// Version : %version: 13 %
+// Version : %version: 14 %
#include "mpxvideo_debug.h"
#include "mpxvideoplaybackcontrolbar.h"
-#include "mpxvideoplaybackprogressbar.h"
#include "mpxvideoplaybackdocumentloader.h"
#include "mpxvideoplaybackfiledetailswidget.h"
#include "mpxvideoplaybackcontrolscontroller.h"
@@ -66,11 +65,6 @@
object = new QMPXVideoPlaybackControlBar( mController );
object->setObjectName( name );
}
- else if ( name == "progressBarLayout" )
- {
- object = new QMPXVideoPlaybackProgressBar( mController );
- object->setObjectName( name );
- }
else if ( name == "fileDetailsLayout" )
{
object = new QMPXVideoPlaybackFileDetailsWidget( mController );
--- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackfiledetailswidget.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackfiledetailswidget.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 23 %
+// Version : %version: 26 %
#include <QDir>
@@ -28,6 +28,7 @@
#include <hblistwidget.h>
#include <hblistviewitem.h>
#include <hbextendedlocale.h>
+#include <hbanchorlayout.h>
#include "mpxvideo_debug.h"
#include "mpxvideoplaybackdocumentloader.h"
@@ -41,7 +42,7 @@
// QMPXVideoPlaybackFileDetailsWidget::QMPXVideoPlaybackFileDetailsWidget
// -------------------------------------------------------------------------------------------------
//
-QMPXVideoPlaybackFileDetailsWidget::QMPXVideoPlaybackFileDetailsWidget(
+QMPXVideoPlaybackFileDetailsWidget::QMPXVideoPlaybackFileDetailsWidget(
QMPXVideoPlaybackControlsController* controller )
: mController( controller )
, mListWidget( 0 )
@@ -57,22 +58,6 @@
QMPXVideoPlaybackFileDetailsWidget::~QMPXVideoPlaybackFileDetailsWidget()
{
MPX_ENTER_EXIT(_L("QMPXVideoPlaybackFileDetailsWidget::~QMPXVideoPlaybackFileDetailsWidget()"));
-
- if ( mListWidget )
- {
- delete mListWidget;
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFileDetailsWidget::initialize
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackFileDetailsWidget::initialize()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackFileDetailsWidget::initialize"));
-
- updateWithFileDetails( mController->fileDetails() );
}
// -------------------------------------------------------------------------------------------------
@@ -90,7 +75,7 @@
// load fileDetails widget
//
QGraphicsWidget *widget = loader->findWidget( QString( "fileDetails" ) );
-
+
//
// cast fileDetails widget to HbListWidget
//
@@ -101,25 +86,24 @@
//
HbListViewItem *prototype = mListWidget->listItemPrototype();
prototype->setSecondaryTextRowCount( 1, 30 );
-
+
+ //
+ // Title
+ //
+ makeTitleItem( details );
+
if ( ! mFileDetailsUpdated )
{
HbExtendedLocale locale = HbExtendedLocale::system();
mFileDetailsUpdated = true;
-
- //
- // Title
- //
- makeTitleItem( details );
-
+
//
// Description
//
- addItemToListWidget(
- hbTrId( "txt_videos_list_description" ), details->mDescription );
+ addItemToListWidget(
+ hbTrId( "txt_videos_list_description" ), details->mDescription );
-
//
// Duration
//
@@ -132,11 +116,11 @@
value = value % 60;
QString sec = locale.toString( value );
- addItemToListWidget(
+ addItemToListWidget(
hbTrId( "txt_videos_list_duration" ),
- hbTrId( "txt_videos_list_l1_l2_l3" ).arg( hour ).arg( min ).arg( sec ) );
- }
-
+ hbTrId( "txt_videos_list_l1l2l3" ).arg( hour ).arg( min ).arg( sec ) );
+ }
+
//
// Date/Time
//
@@ -145,28 +129,28 @@
//
// Location
//
- addItemToListWidget( hbTrId( "txt_videos_list_location" ), details->mLocation );
-
+ addItemToListWidget( hbTrId( "txt_videos_list_location" ), details->mLocation );
+
//
// Author
//
- addItemToListWidget( hbTrId( "txt_videos_list_author" ), details->mArtist );
-
+ addItemToListWidget( hbTrId( "txt_videos_list_author" ), details->mArtist );
+
//
// Copyright
//
- addItemToListWidget( hbTrId( "txt_videos_list_copyright" ), details->mCopyright );
-
+ addItemToListWidget( hbTrId( "txt_videos_list_copyright" ), details->mCopyright );
+
//
// Language
//
- addItemToListWidget( hbTrId( "txt_videos_list_language" ), details->mLanguage );
-
+ addItemToListWidget( hbTrId( "txt_videos_list_language" ), details->mLanguage );
+
//
// Keywords
//
- addItemToListWidget( hbTrId( "txt_videos_list_keywords" ), details->mKeywords );
-
+ addItemToListWidget( hbTrId( "txt_videos_list_keywords" ), details->mKeywords );
+
//
// Size
//
@@ -179,53 +163,68 @@
{
QString resolution = hbTrId( "txt_videos_list_l1l2" )
.arg( locale.toString( details->mVideoWidth ) )
- .arg( locale.toString( details->mVideoHeight ) );
- addItemToListWidget( hbTrId( "txt_videos_list_resolution" ), resolution );
+ .arg( locale.toString( details->mVideoHeight ) );
+ addItemToListWidget( hbTrId( "txt_videos_list_resolution" ), resolution );
}
-
+
//
// Format
//
- addItemToListWidget( hbTrId( "txt_videos_list_format" ), details->mMimeType );
-
+ addItemToListWidget( hbTrId( "txt_videos_list_format" ), details->mMimeType );
+
//
// Bitrate
//
makeBitRateItem( details );
-
+
//
// Folder
//
if ( details->mPlaybackMode == EMPXVideoLocal ||
details->mPlaybackMode == EMPXVideoProgressiveDownload)
{
- QFileInfo fileInfo( details->mClipName );
+ 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
//
- QString sectionName;
+ QGraphicsWidget *content = loader->findWidget( QString( "content" ) );
+ HbAnchorLayout *layout = static_cast<HbAnchorLayout*>( content->layout() );
- if ( mController->viewMode() == EDetailsView )
- {
- sectionName = "detailsView";
- }
- else if ( mController->viewMode() == EAudioOnlyView )
+ if ( layout )
{
- sectionName = "audioOnlyView";
- }
+ QGraphicsWidget *titleLayout = loader->findWidget( QString( "titleLayout" ) );
+ QRectF titleRect = titleLayout->geometry();
+
+ switch ( mController->viewMode() )
+ {
+ case EDetailsView:
+ {
+ layout->setAnchor( titleLayout, Hb::BottomEdge, this, Hb::TopEdge, 0 );
+ layout->setAnchor( layout, Hb::BottomEdge, this, Hb::BottomEdge, 0 );
- bool ok = false;
- loader->load( KMPXPLAYBACKVIEW_XML, sectionName, &ok );
+ break;
+ }
+ case EAudioOnlyView:
+ {
+ QGraphicsWidget *controlLayout = loader->findWidget( QString( "controlBarLayout" ) );
+ QRectF controlRect = controlLayout->geometry();
- if ( ! ok )
- {
- MPX_DEBUG(_L("QMPXVideoPlaybackFileDetailsWidget failed to load section"));
+ layout->setAnchor(
+ this, Hb::TopEdge, titleLayout,
+ Hb::BottomEdge, titleRect.bottom() - titleRect.top() );
+
+ layout->setAnchor(
+ this, Hb::BottomEdge,
+ layout, Hb::BottomEdge, layout->geometry().height() - controlRect.top() );
+
+ break;
+ }
+ }
}
}
}
@@ -235,16 +234,16 @@
// -------------------------------------------------------------------------------------------------
//
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
+ // show the title for audio-only view
//
if ( mListWidget->count() == 0 || ! mListWidget->item( 0 )->text().contains( "Title", Qt::CaseInsensitive ) )
{
@@ -254,9 +253,9 @@
{
//
// If title is not available, show clip name
- //
+ //
QFileInfo fileInfo( details->mClipName );
- title = fileInfo.baseName ();
+ title = fileInfo.completeBaseName();
}
//
@@ -271,7 +270,7 @@
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
//
@@ -284,17 +283,17 @@
// -------------------------------------------------------------------------------------------------
//
void QMPXVideoPlaybackFileDetailsWidget::makeSizeItem( QMPXVideoPlaybackViewFileDetails* details )
-{
+{
if ( details->mPlaybackMode == EMPXVideoLocal ||
details->mPlaybackMode == EMPXVideoProgressiveDownload )
{
- QFileInfo fileInfo( details->mClipName );
-
+ 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
//
@@ -330,9 +329,9 @@
int temp = size * 10;
size = (float)temp / 10;
- addItemToListWidget(
+ addItemToListWidget(
hbTrId( "txt_videos_list_file_size" ), scale.arg( locale.toString( size ) ) );
- }
+ }
}
}
@@ -341,7 +340,7 @@
// -------------------------------------------------------------------------------------------------
//
void QMPXVideoPlaybackFileDetailsWidget::makeBitRateItem( QMPXVideoPlaybackViewFileDetails* details )
-{
+{
if ( details->mBitRate > 0 )
{
HbExtendedLocale locale = HbExtendedLocale::system();
@@ -354,17 +353,17 @@
{
bitrate /= KILOBYTE;
}
-
+
if ( bitrate > KILOBYTE )
{
bitrate /= KILOBYTE;
scale = hbTrId( "txt_videos_list_l1_mbps" );
}
-
+
int temp = bitrate * 10;
bitrate = (float)temp / 10;
- addItemToListWidget(
+ addItemToListWidget(
hbTrId( "txt_videos_list_bitrate" ), scale.arg( locale.toString( bitrate ) ) );
}
}
@@ -374,18 +373,18 @@
// -------------------------------------------------------------------------------------------------
//
void QMPXVideoPlaybackFileDetailsWidget::addItemToListWidget( QString item, QString text )
-{
+{
MPX_ENTER_EXIT(_L("QMPXVideoPlaybackFileDetailsWidget::addItemToListWidget"));
-
+
if ( text.count() > 0 )
{
- MPX_DEBUG(_L("QMPXVideoPlaybackFileDetailsWidget::addItemToListWidget( %s %s )"),
+ MPX_DEBUG(_L("QMPXVideoPlaybackFileDetailsWidget::addItemToListWidget( %s %s )"),
item.data(), text.data() );
-
+
HbListWidgetItem* listWidgetItem = new HbListWidgetItem();
listWidgetItem->setText( item );
listWidgetItem->setSecondaryText( text );
-
+
mListWidget->addItem( listWidgetItem );
}
}
@@ -395,21 +394,21 @@
// -------------------------------------------------------------------------------------------------
//
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 );
+ QFileInfo fileInfo( details->mClipName );
HbExtendedLocale locale = HbExtendedLocale::system();
-
+
//
// Date created
//
@@ -421,15 +420,15 @@
{
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 );
-
+ addItemToListWidget( hbTrId( "txt_videos_list_date" ), date + " " + time );
+
//
// Date modified
//
@@ -441,15 +440,15 @@
{
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 );
- }
+ addItemToListWidget( hbTrId( "txt_videos_list_modified" ), date + " " + time );
+ }
}
//End of file
--- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackprogressbar.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackprogressbar.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#21 %
+// Version : %version: da1mmcf#24 %
@@ -41,11 +41,9 @@
// QMPXVideoPlaybackProgressBar::QMPXVideoPlaybackProgressBar
// -------------------------------------------------------------------------------------------------
//
-QMPXVideoPlaybackProgressBar::QMPXVideoPlaybackProgressBar(
+QMPXVideoPlaybackProgressBar::QMPXVideoPlaybackProgressBar(
QMPXVideoPlaybackControlsController* controller )
: mController( controller )
- , mFrameItem( NULL )
- , mDuration( -1 )
, mDraggingPosition( 0 )
, mSetPosition( -1 )
, mNeedToResumeAfterSetPosition( false )
@@ -69,7 +67,7 @@
if ( mSeekingTimer )
{
disconnect( mSeekingTimer, SIGNAL( timeout() ), this, SLOT( handleSeekingTimeout() ) );
-
+
if ( mSeekingTimer->isActive() )
{
mSeekingTimer->stop();
@@ -96,11 +94,11 @@
if ( loader && ! mInitialized )
{
mInitialized = true;
- mLiveStreaming =
+ mLiveStreaming =
( mController->fileDetails()->mPlaybackMode == EMPXVideoLiveStreaming )? true:false;
//
- // Create a timer for seeking.
+ // Create a timer for seeking.
// We will issue SetPosition every KSeekingTimeOut msec to show the current frame to user
//
mSeekingTimer = new QTimer();
@@ -120,7 +118,7 @@
//
// If we init the progress bar after pp sends the duration informatin
- // we need to set the duration manually
+ // we need to set the duration manually
//
durationChanged( (qreal)mController->fileDetails()->mDuration / (qreal)KPbMilliMultiplier );
@@ -129,16 +127,14 @@
//
positionChanged( 0 );
-
//
// Set framedrawer for semi transparent background
//
- mFrameItem = new HbFrameItem ( parentItem() );
- mFrameItem->setGeometry( boundingRect() );
- mFrameItem->frameDrawer().setFrameGraphicsName( "qtg_fr_multimedia_trans" );
- mFrameItem->frameDrawer().setFrameType( HbFrameDrawer::NinePieces );
- mFrameItem->frameDrawer().setFillWholeRect( true );
- mFrameItem->setVisible( false );
+ HbFrameItem *frameItem = new HbFrameItem();
+ frameItem->frameDrawer().setFrameGraphicsName( "qtg_fr_multimedia_trans" );
+ frameItem->frameDrawer().setFrameType( HbFrameDrawer::NinePieces );
+ frameItem->frameDrawer().setFillWholeRect( true );
+ mProgressSlider->setBackgroundItem( frameItem );
}
}
@@ -152,6 +148,7 @@
if ( mLiveStreaming )
{
+ mDuration = 0;
mProgressSlider->setMaxText( "Live" );
}
else
@@ -254,7 +251,7 @@
// QMPXVideoPlaybackProgressBar::handleSliderPressed
// -------------------------------------------------------------------------------------------------
//
-void QMPXVideoPlaybackProgressBar::handleSliderPressed()
+void QMPXVideoPlaybackProgressBar::handleSliderPressed()
{
MPX_ENTER_EXIT(_L("QMPXVideoPlaybackProgressBar::handleSliderPressed()"));
@@ -268,7 +265,7 @@
if( mController->state() == EPbStatePlaying )
{
mNeedToResumeAfterSetPosition = true;
- mController->handleCommand( EMPXPbvCmdCustomPause );
+ mController->handleCommand( EMPXPbvCmdCustomPause );
}
}
@@ -276,7 +273,7 @@
// QMPXVideoPlaybackProgressBar::handleSliderMoved
// -------------------------------------------------------------------------------------------------
//
-void QMPXVideoPlaybackProgressBar::handleSliderMoved( int value )
+void QMPXVideoPlaybackProgressBar::handleSliderMoved( int value )
{
MPX_DEBUG(_L("QMPXVideoPlaybackProgressBar::handleSliderMoved() position = %d"), value);
@@ -327,7 +324,7 @@
{
mSeekingTimer->stop();
}
-
+
mController->resetDisappearingTimers( EMPXTimerReset );
int value = mProgressSlider->sliderValue();
@@ -366,7 +363,7 @@
{
MPX_DEBUG(_L("QMPXVideoPlaybackProgressBar::updateControlsWithFileDetails()"));
- if ( details->mPlaybackMode == EMPXVideoLiveStreaming )
+ if ( ! details->mPausableStream || ! details->mSeekable )
{
mProgressSlider->setEnabled( false );
}
@@ -375,7 +372,8 @@
mProgressSlider->setEnabled( true );
}
- mFrameItem->setVisible( ( mController->viewMode() == EFullScreenView )? ETrue:EFalse );
+ mProgressSlider->backgroundItem()->setVisible(
+ ( mController->viewMode() == EFullScreenView )? ETrue:EFalse );
}
// -------------------------------------------------------------------------------------------------
@@ -391,18 +389,18 @@
case EPbStatePlaying:
case EPbStatePaused:
{
- if ( ! isEnabled() )
+ if ( ! mProgressSlider->isEnabled() )
{
- setEnabled( true );
+ mProgressSlider->setEnabled( true );
}
break;
}
default:
{
- if ( isEnabled() )
+ if ( mProgressSlider->isEnabled() )
{
- setEnabled( false );
+ mProgressSlider->setEnabled( false );
}
break;
}
--- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackstatuspanecontrol.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackstatuspanecontrol.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,12 +15,16 @@
*
*/
-// Version : %version: 15 %
+// 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>
@@ -38,17 +42,21 @@
// QMPXVideoPlaybackStatusPaneControl::QMPXVideoPlaybackStatusPaneControl()
// -------------------------------------------------------------------------------------------------
//
-QMPXVideoPlaybackStatusPaneControl::QMPXVideoPlaybackStatusPaneControl(
- QMPXVideoPlaybackControlsController* controller,
- TMPXVideoPlaybackControls index,
- HbWidget* widget,
+QMPXVideoPlaybackStatusPaneControl::QMPXVideoPlaybackStatusPaneControl(
+ QMPXVideoPlaybackControlsController* controller,
+ TMPXVideoPlaybackControls index,
+ HbWidget* widget,
TUint controlproperties )
: QMPXVideoPlaybackFullScreenControl( controller, index, widget, controlproperties )
, mActionBack( NULL )
- , mFrameItem( NULL )
+ , mTitleLabel( NULL )
+ , mTitleGroupBox( NULL )
+ , mTitleLayout( NULL )
{
MPX_ENTER_EXIT(_L("QMPXVideoPlaybackStatusPaneControl::QMPXVideoPlaybackStatusPaneControl()"));
+ Q_UNUSED( widget );
+
mActionBack = new HbAction( Hb::BackNaviAction );
//
@@ -59,9 +67,6 @@
connect( mController->view()->menu(), SIGNAL( aboutToShow() ), this, SLOT( handleAboutToShow() ) );
connect( mController->view()->menu(), SIGNAL( aboutToHide() ), this, SLOT( handleAboutToHide() ) );
-
- QGraphicsWidget *widget1 = mController->layoutLoader()->findWidget( QString( "title" ) );
- mTitleLabel = qobject_cast<HbLabel*>( widget1 );
}
// -------------------------------------------------------------------------------------------------
@@ -94,6 +99,8 @@
//
void QMPXVideoPlaybackStatusPaneControl::setVisible( bool visible )
{
+ MPX_DEBUG(_L("QMPXVideoPlaybackStatusPaneControl::setVisible visible = %d"), visible);
+
mVisible = visible;
if ( mVisible )
@@ -104,7 +111,7 @@
if ( mController->viewMode() == EFullScreenView ||
mController->viewMode() == EDetailsView )
{
- mTitleLabel->setVisible( true );
+ mTitleLayout->setVisible( true );
}
}
else
@@ -113,7 +120,7 @@
mController->view()->setTitleBarVisible( false );
mController->view()->setStatusBarVisible( false );
- mTitleLabel->setVisible( false );
+ mTitleLayout->setVisible( false );
}
}
@@ -164,37 +171,78 @@
{
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(
- HbView::HbViewFlags( HbView::ViewTitleBarTransparent | HbView::ViewStatusBarTransparent ) );
+ 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() ) );
@@ -204,20 +252,6 @@
}
setMenu( details );
-
- //
- // Set framedrawer for semi transparent background
- //
- if ( ! mFrameItem )
- {
- mFrameItem = new HbFrameItem ( mTitleLabel );
- mFrameItem->frameDrawer().setFrameGraphicsName( "qtg_fr_multimedia_trans" );
- mFrameItem->frameDrawer().setFrameType( HbFrameDrawer::NinePieces );
- mFrameItem->frameDrawer().setFillWholeRect( true );
- }
-
- mFrameItem->setGeometry( mTitleLabel->boundingRect() );
- mFrameItem->setVisible( ( mController->viewMode() == EFullScreenView )? ETrue:EFalse );
}
// -------------------------------------------------------------------------------------------------
--- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybacktoolbar.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybacktoolbar.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,14 +15,13 @@
*
*/
-// Version : %version: 3 %
+// Version : %version: 7 %
#include <QTimer>
#include <QGraphicsLayout>
-#include <hbeffect.h>
#include <hbaction.h>
#include <hbtoolbar.h>
#include <hbinstance.h>
@@ -44,14 +43,13 @@
// QMPXVideoPlaybackToolBar::QMPXVideoPlaybackToolBar()
// -------------------------------------------------------------------------------------------------
//
-QMPXVideoPlaybackToolBar::QMPXVideoPlaybackToolBar(
+QMPXVideoPlaybackToolBar::QMPXVideoPlaybackToolBar(
QMPXVideoPlaybackControlsController* controller )
: mController( controller )
, mSeekStartTimer( NULL )
, mRetrieveButtonTimer( NULL )
, mSeekingState( EMPXNotSeeking )
, mInitialized( false )
- , mNeverVisibled( true )
, mPosition( 0 )
, mDuration( 0 )
, mAspectRatio( EMPXPbvCmdNaturalAspectRatio )
@@ -60,8 +58,7 @@
mToolBar = mController->view()->toolBar();
mToolBar->setOrientation( Qt::Horizontal );
- HbEffect::disable( mToolBar );
-
+
mController->view()->hideItems( Hb::ToolBarItem );
initialize();
@@ -75,7 +72,6 @@
{
MPX_DEBUG(_L("QMPXVideoPlaybackToolBar::~QMPXVideoPlaybackToolBar()"));
- HbEffect::enable( mToolBar );
mToolBar->clearActions();
for ( int i = 0 ; i < mButtonIcons.count() ; i++ )
@@ -171,7 +167,7 @@
mButtonActions[EMPX1stButton]->setIcon( *mButtonIcons[EMPXNaturalIcon] );
//
- // Attach/Share button
+ // Attach/Share button
//
mButtonIcons[EMPXAttachIcon]->setIconName( "qtg_mono_attach" );
mButtonIcons[EMPXShareIcon]->setIconName( "qtg_mono_share" );
@@ -185,28 +181,27 @@
mDuration = (qreal)mController->fileDetails()->mDuration / (qreal)KPbMilliMultiplier;
//
- // Create a timer for seeking.
+ // 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();
+ 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();
+ TReal32 height = (TReal32) displayRect.Height();
mDisplayAspectRatio = (width > height)? (width / height) : (height / width);
-
}
}
@@ -235,7 +230,7 @@
{
mSeekingState = EMPXFastForwarding;
- mController->handleCommand( EMPXPbvCmdSeekForward );
+ mController->handleCommand( EMPXPbvCmdSeekForward );
}
}
@@ -274,7 +269,7 @@
if ( mSeekingState == EMPXFastForwarding )
{
- mController->handleCommand( EMPXPbvCmdEndSeek );
+ mController->handleCommand( EMPXPbvCmdEndSeek );
}
else
{
@@ -312,7 +307,7 @@
if ( mSeekingState == EMPXRewinding )
{
- mController->handleCommand( EMPXPbvCmdEndSeek );
+ mController->handleCommand( EMPXPbvCmdEndSeek );
}
else
{
@@ -343,7 +338,7 @@
MPX_DEBUG(_L("QMPXVideoPlaybackToolBar::changeAspectRatio()"));
mController->resetDisappearingTimers( EMPXTimerReset );
-
+
TMPXVideoPlaybackViewCommandIds cmd = EMPXPbvCmdStretchAspectRatio;
switch( mAspectRatio )
@@ -408,7 +403,13 @@
mAspectRatio = aspectRatio;
- if ( ! mController->isAttachOperation() )
+ //
+ // If we are in attach service or audio only view, then don't update the icon.
+ // Aspect ratio icon slots are shared with attach and share icon.
+ // Just update the mAspectRatio
+ // and once we go back to full screen, we will show the correct aspect ratio icon
+ //
+ if ( ! mController->isAttachOperation() && mController->viewMode() == EFullScreenView )
{
switch( mAspectRatio )
{
@@ -427,7 +428,7 @@
mButtonActions[EMPX1stButton]->setIcon( *mButtonIcons[EMPXNaturalIcon] );
break;
}
- }
+ }
}
}
@@ -500,7 +501,7 @@
if ( mButtons.count() )
{
- disconnect( mButtons[EMPX1stButton], SIGNAL( released() ) );
+ disconnect( mButtons[EMPX1stButton], SIGNAL( released() ), 0, 0 );
connect( mButtons[EMPX1stButton], SIGNAL( released() ),
mController, SLOT( attachVideo() ) );
}
@@ -527,11 +528,11 @@
else
{
//
- // check if video clip has same aspect ratio as display window
+ // check if video clip has same aspect ratio as display window
//
- TReal32 videoAspectRatio = (TReal32) details->mVideoWidth / (TReal32) details->mVideoHeight;
+ TReal32 videoAspectRatio = (TReal32) details->mVideoWidth / (TReal32) details->mVideoHeight;
bool enabled = ( mDisplayAspectRatio == videoAspectRatio )? false : true;
-
+
//
// enable or dim 'aspect ratio' buttons accordingly
//
@@ -539,12 +540,12 @@
if ( mButtons.count() )
{
- disconnect( mButtons[EMPX1stButton], SIGNAL( released() ) );
+ disconnect( mButtons[EMPX1stButton], SIGNAL( released() ), 0, 0 );
connect( mButtons[EMPX1stButton], SIGNAL( released() ),
this, SLOT( changeAspectRatio() ) );
}
}
- }
+ }
else if ( mController->viewMode() == EAudioOnlyView )
{
//
@@ -569,8 +570,8 @@
if ( mButtons.count() )
{
- disconnect( mButtons[EMPX1stButton], SIGNAL( released() ) );
- connect( mButtons[EMPX1stButton], SIGNAL( released() ),
+ disconnect( mButtons[EMPX1stButton], SIGNAL( released() ), 0, 0 );
+ connect( mButtons[EMPX1stButton], SIGNAL( released() ),
mController, SLOT( sendVideo() ) );
}
}
@@ -590,25 +591,42 @@
mButtonActions[EMPX5thButton]->setEnabled( true );
}
- if ( ! details->mSeekable )
- {
- mButtonActions[EMPX2ndButton]->setEnabled( false );
- mButtonActions[EMPX4thButton]->setEnabled( false );
- }
- else
+ if ( details->mSeekable && details->mPausableStream )
{
mButtonActions[EMPX2ndButton]->setEnabled( true );
mButtonActions[EMPX4thButton]->setEnabled( true );
}
+ else
+ {
+ mButtonActions[EMPX2ndButton]->setEnabled( false );
+ mButtonActions[EMPX4thButton]->setEnabled( false );
+ }
- if ( ! details->mPausableStream )
+ if ( details->mPausableStream )
+ {
+ mButtonActions[EMPX3rdButton]->setEnabled( true );
+ }
+ else
{
mButtonActions[EMPX3rdButton]->setEnabled( false );
}
- else
+
+ //
+ // toolbar creates button once it gets visible, so we don't know exact timing when toolbar
+ // creates button, so start timer to get layout information once the toolbar gets visible.
+ // This is needed since we don't use toolbar in proper way.
+ //
+ if ( ! mRetrieveButtonTimer && ! mButtons.count() )
{
- mButtonActions[EMPX3rdButton]->setEnabled( true );
- }
+ mRetrieveButtonTimer = new QTimer();
+ mRetrieveButtonTimer->setSingleShot( false );
+ mRetrieveButtonTimer->setInterval( KRetrieveButtonTimeOut );
+ connect( mRetrieveButtonTimer, SIGNAL( timeout() ), this, SLOT( retrieveButtons() ) );
+
+ mRetrieveButtonTimer->start();
+ }
+
+ durationChanged( (qreal)mController->fileDetails()->mDuration / (qreal)KPbMilliMultiplier );
}
// -------------------------------------------------------------------------------------------------
@@ -636,7 +654,6 @@
MPX_DEBUG(_L("QMPXVideoPlaybackToolBar::positionChanged position = %d"), position );
mPosition = position;
- retrieveButtons();
}
// -------------------------------------------------------------------------------------------------
@@ -661,24 +678,6 @@
if ( visible )
{
mController->view()->showItems( Hb::ToolBarItem );
-
- if ( mNeverVisibled )
- {
- mNeverVisibled = false;
-
-
- //
- // toolbar creates button once it gets visible, so we don't know exact timing when toolbar
- // creates button, so start timer to get layout information once the toolbar gets visible.
- // This is needed since we don't use toolbar in proper way.
- //
- mRetrieveButtonTimer = new QTimer();
- mRetrieveButtonTimer->setSingleShot( false );
- mRetrieveButtonTimer->setInterval( KRetrieveButtonTimeOut );
- connect( mRetrieveButtonTimer, SIGNAL( timeout() ), this, SLOT( retrieveButtons() ) );
-
- mRetrieveButtonTimer->start();
- }
}
else
{
@@ -700,10 +699,13 @@
if ( layout )
{
- disconnect( mRetrieveButtonTimer, SIGNAL( timeout() ), this, SLOT( retrieveButtons() ) );
- if ( mRetrieveButtonTimer->isActive() )
+ if ( mRetrieveButtonTimer )
{
- mRetrieveButtonTimer->stop();
+ disconnect( mRetrieveButtonTimer, SIGNAL( timeout() ), this, SLOT( retrieveButtons() ) );
+ if ( mRetrieveButtonTimer->isActive() )
+ {
+ mRetrieveButtonTimer->stop();
+ }
}
for ( int i = 0 ; i < layout->count() ; i++ )
@@ -739,10 +741,10 @@
{
connect( mButtons[EMPX1stButton], SIGNAL( released() ),
this, SLOT( changeAspectRatio() ) );
- }
+ }
else if ( mController->viewMode() == EAudioOnlyView )
{
- connect( mButtons[EMPX1stButton], SIGNAL( released() ),
+ connect( mButtons[EMPX1stButton], SIGNAL( released() ),
mController, SLOT( sendVideo() ) );
}
}
--- a/videoplayback/hbvideoplaybackview/hbvideoplaybackview.pro Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/hbvideoplaybackview.pro Thu Jul 22 16:34:17 2010 +0100
@@ -14,7 +14,7 @@
# Description: Project file for building Videoplayer components
#
#
-# Version : %version: da1mmcf#23 %
+# Version : %version: 25 %
TEMPLATE = lib
@@ -30,10 +30,16 @@
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 \
- /epoc32/include/platform/mw/alf
+INCLUDEPATH += ../../inc
LIBS += -lmpxplaybackutility.dll \
-lmpxcommon.dll \
@@ -47,7 +53,6 @@
-lcentralrepository.dll \
-lthumbnailmanagerqt.dll \
-lmediaclientvideodisplay.dll \
- -lalfdecoderserverclient.dll \
-lxqserviceutil.dll \
-lvideoplayerengine.dll \
-lcone.dll \
--- a/videoplayback/hbvideoplaybackview/inc/mpxvideoplaybackcontrolscontroller.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/inc/mpxvideoplaybackcontrolscontroller.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#17 %
+// Version : %version: da1mmcf#19 %
@@ -73,6 +73,7 @@
};
const int KMPXControlsTimeOut = 4000;
+const int KMPXRNLogoTimeOut = 600;
const QString KMPXPLAYBACKVIEW_XML = ":/hbvideoplaybackview/hbvideoplaybackview.docml";
@@ -146,7 +147,9 @@
void changeViewMode( TPlaybackViewMode viewMode, bool transitionEffect = true );
- bool isAttachOperation();
+ inline bool isAttachOperation();
+
+ bool isRNLogoBitmapInControlList();
private:
/**
@@ -230,9 +233,9 @@
void handleErrors();
/**
- * Return ETrue if control is visible
+ * Return true if control is visible
*/
- bool isSoftKeyVisible( int value );
+ bool isSoftKeyVisible();
/**
* Handle tvout connected/disconnected event
@@ -266,6 +269,9 @@
void controlsListUpdated();
void attachVideo();
void sendVideo();
+ void handleRNLogoVisibleChanged();
+ void handleRNLogoTimeout();
+ void handleOrientationChanged( Qt::Orientation orientation );
private:
HbVideoBasePlaybackView *mView;
@@ -278,6 +284,7 @@
QMPXVideoPlaybackControlConfiguration *mControlsConfig;
QTimer *mControlsTimer;
+ QTimer *mRNLogoTimer;
QMPXVideoPlaybackDocumentLoader *mLoader;
HbVolumeSliderPopup *mVolumeControl;
@@ -292,6 +299,7 @@
TMPXPlaybackState mState;
TPlaybackViewMode mViewMode;
+ Qt::Orientation mOrientation;
};
// INLINE METHODS
@@ -358,6 +366,19 @@
return mViewMode;
}
+// -------------------------------------------------------------------------------------------------
+// QMPXVideoPlaybackControlsController::isAttachOperation
+// -------------------------------------------------------------------------------------------------
+//
+inline
+bool QMPXVideoPlaybackControlsController::isAttachOperation()
+{
+ MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::isAttachOperation() ret %d"),
+ mIsAttachOperation );
+
+ return mIsAttachOperation;
+}
+
#endif /*MPXVIDEOPLAYBACKCONTROLSCONTROLLER_P_H_*/
// End of File
--- a/videoplayback/hbvideoplaybackview/resources/animation.axml Tue Jun 15 13:09:36 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<animations>
-<icon name="frame_anim_looping" 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/hbvideoplaybackview/resources/animations/generic_preroll_anim.axml Thu Jul 22 16:34:17 2010 +0100
@@ -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/hbvideoplaybackview/resources/animations/rn_preroll_anim.axml Thu Jul 22 16:34:17 2010 +0100
@@ -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
--- a/videoplayback/hbvideoplaybackview/resources/hbvideoplaybackview.docml Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/resources/hbvideoplaybackview.docml Thu Jul 22 16:34:17 2010 +0100
@@ -1,21 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hbdocument version="1.0">
+<hbdocument version="1.1">
<widget name="content" type="HbWidget">
<widget name="bufferingIcon" type="HbLabel">
<enums name="alignment" value="AlignVCenter|AlignHCenter"/>
- <icon iconName="frame_anim_looping" name="icon"/>
- <real name="z" value="5"/>
- <sizehint height="70" type="PREFERRED" width="70"/>
+ <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="2"/>
- <sizehint height="193" type="PREFERRED" width="320"/>
+ <real name="z" value="3"/>
<bool name="visible" value="FALSE"/>
<layout orientation="Vertical" type="linear">
- <contentsmargins bottom="9px" left="9px" right="9px" top="9px"/>
- <linearitem itemname="fileDetails"/>
+ <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+ <linearitem itemname="fileDetails" spacing="0px"/>
</layout>
</widget>
<widget name="bitmapLayout" type="HbWidget">
@@ -39,11 +85,11 @@
<icon iconName="qtg_large_tv_out" name="icon"/>
<bool name="visible" value="FALSE"/>
</widget>
- <real name="z" value="1"/>
+ <real name="z" value="5"/>
<sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
- <sizehint height="193" type="PREFERRED" width="320"/>
- <sizehint height="18" type="MINIMUM" width="18"/>
- <sizehint height="16777215" type="MAXIMUM" width="16777215"/>
+ <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"/>
@@ -57,147 +103,88 @@
<widget name="detailsViewPlayButton" type="HbPushButton">
<icon iconName="qtg_mono_play" name="icon"/>
<real name="z" value="2"/>
- <sizehint height="60" type="PREFERRED" width="60"/>
- <contentsmargins bottom="0" left="0" right="0" top="0"/>
+ <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="229" type="PREFERRED"/>
+ <sizehint height="32.83582un" type="PREFERRED" width="53.73134un"/>
<layout type="anchor">
- <anchoritem dst="detailsViewPlayButton" dstEdge="CENTERH" spacing="0" src="" srcEdge="CENTERH"/>
- <anchoritem dst="detailsViewPlayButton" dstEdge="CENTERV" spacing="0" src="" srcEdge="CENTERV"/>
+ <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="40" type="PREFERRED" width="320"/>
+ <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="40" type="PREFERRED" width="320"/>
+ <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="40" type="PREFERRED" width="320"/>
+ <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"/>
- <sizehint height="160" type="PREFERRED" width="80"/>
<bool name="visible" value="FALSE"/>
- <layout orientation="Vertical" type="linear">
- <contentsmargins bottom="0px" left="0px" right="0px" top="0px"/>
+ <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="title" type="HbLabel">
- <enums name="alignment" value="AlignLeft|AlignVCenter|AlignLeading"/>
- <real name="z" value="6"/>
- <sizehint height="33" type="PREFERRED" width="640"/>
+ <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>
- <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="progressBarLayout" type="HbWidget">
- <widget name="progressSlider" type="HbProgressSlider">
- <integer name="progressValue" value="70"/>
- <bool name="minMaxTextVisible" value="TRUE"/>
- <bool name="textVisible" value="FALSE"/>
- <enums name="minMaxTextAlignment" value="AlignVCenter|AlignHCenter"/>
- <string name="minText" value=""/>
- <enums name="orientation" value="Horizontal"/>
- <integer name="sliderValue" value="30"/>
- <enums name="textAlignment" value="AlignBottom"/>
- <string name="maxText" value=""/>
- </widget>
- <real name="z" value="3"/>
- <bool name="visible" value="TRUE"/>
- <layout type="anchor">
- <anchoritem dst="progressSlider" dstEdge="LEFT" spacing="0" src="" srcEdge="LEFT"/>
- <anchoritem dst="progressSlider" dstEdge="CENTERV" spacing="0" src="" srcEdge="CENTERV"/>
- <anchoritem dst="progressSlider" dstEdge="RIGHT" spacing="0" src="" srcEdge="RIGHT"/>
- </layout>
- </widget>
- <real name="z" value="1"/>
- <sizehint height="160" type="PREFERRED" width="80"/>
- <bool name="visible" value="FALSE"/>
- <layout orientation="Vertical" spacing="0px" type="linear">
- <contentsmargins bottom="0px" left="0px" right="0px" top="0px"/>
- <linearitem itemname="progressBarLayout"/>
- </layout>
- </widget>
- <size height="360" name="size" width="640"/>
+ <size height="var(hb-param-screen-short-edge)" name="size" width="var(hb-param-screen-long-edge)"/>
<real name="z" value="1"/>
- <rect height="360" name="geometry" width="640" x="0" y="0"/>
- <sizehint height="524287" type="MAXIMUM" width="524287"/>
+ <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="0" src="" srcEdge="CENTERH"/>
- <anchoritem dst="bufferingIcon" dstEdge="CENTERV" spacing="0" src="" srcEdge="CENTERV"/>
- <anchoritem dst="title" dstEdge="LEFT" spacing="0" src="" srcEdge="LEFT"/>
- <anchoritem dst="title" dstEdge="RIGHT" spacing="0" src="" srcEdge="RIGHT"/>
- <anchoritem dst="title" dstEdge="TOP" spacing="62" src="" srcEdge="TOP"/>
- <anchoritem dst="title" dstEdge="BOTTOM" spacing="100" src="" srcEdge="TOP"/>
- <anchoritem dst="fileDetailsLayout" dstEdge="LEFT" spacing="0" src="" srcEdge="CENTERH"/>
- <anchoritem dst="fileDetailsLayout" dstEdge="RIGHT" spacing="0" src="" srcEdge="RIGHT"/>
- <anchoritem dst="fileDetailsLayout" dstEdge="TOP" spacing="62" src="" srcEdge="TOP"/>
- <anchoritem dst="fileDetailsLayout" dstEdge="BOTTOM" spacing="-110" src="" srcEdge="BOTTOM"/>
- <anchoritem dst="bitmapLayout" dstEdge="LEFT" spacing="0" src="" srcEdge="LEFT"/>
- <anchoritem dst="bitmapLayout" dstEdge="RIGHT" spacing="0" src="" srcEdge="CENTERH"/>
- <anchoritem dst="bitmapLayout" dstEdge="TOP" spacing="62" src="" srcEdge="TOP"/>
- <anchoritem dst="bitmapLayout" dstEdge="BOTTOM" spacing="-110" src="" srcEdge="BOTTOM"/>
- <anchoritem dst="detailsPlaybackWindow" dstEdge="TOP" spacing="0" src="title" srcEdge="BOTTOM"/>
- <anchoritem dst="detailsPlaybackWindow" dstEdge="LEFT" spacing="0" src="" srcEdge="LEFT"/>
- <anchoritem dst="detailsPlaybackWindow" dstEdge="RIGHT" spacing="0" src="" srcEdge="CENTERH"/>
- <anchoritem dst="detailsPlaybackWindow" dstEdge="BOTTOM" spacing="0" src="" srcEdge="BOTTOM"/>
- <anchoritem dst="transparentWindow" dstEdge="LEFT" spacing="0" src="" srcEdge="LEFT"/>
- <anchoritem dst="transparentWindow" dstEdge="TOP" spacing="0" src="" srcEdge="TOP"/>
- <anchoritem dst="transparentWindow" dstEdge="RIGHT" spacing="0" src="" srcEdge="RIGHT"/>
- <anchoritem dst="transparentWindow" dstEdge="BOTTOM" spacing="0" src="" srcEdge="BOTTOM"/>
- <anchoritem dst="controlBarLayout" dstEdge="LEFT" spacing="0" src="" srcEdge="LEFT"/>
- <anchoritem dst="controlBarLayout" dstEdge="TOP" spacing="-110" src="" srcEdge="BOTTOM"/>
- <anchoritem dst="controlBarLayout" dstEdge="RIGHT" spacing="0" src="" srcEdge="RIGHT"/>
- <anchoritem dst="controlBarLayout" dstEdge="BOTTOM" spacing="-60" src="" srcEdge="BOTTOM"/>
+ <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>
- <section name="detailsView">
- <widget name="content" type="HbWidget">
- <layout type="anchor">
- <anchoritem dst="fileDetailsLayout" dstEdge="TOP" spacing="0" src="title" srcEdge="BOTTOM"/>
- <anchoritem dst="fileDetailsLayout" dstEdge="LEFT" spacing="0" src="" srcEdge="CENTERH"/>
- <anchoritem dst="fileDetailsLayout" dstEdge="RIGHT" spacing="0" src="" srcEdge="RIGHT"/>
- <anchoritem dst="fileDetailsLayout" dstEdge="BOTTOM" spacing="0" src="" srcEdge="BOTTOM"/>
- </layout>
- </widget>
- <widget name="fileDetailsLayout" type="HbWidget">
- <sizehint height="264" type="PREFERRED" width="320"/>
- </widget>
- </section>
- <section name="audioOnlyView">
- <widget name="content" type="HbWidget">
- <layout type="anchor">
- <anchoritem dst="fileDetailsLayout" dstEdge="TOP" spacing="62" src="" srcEdge="TOP"/>
- <anchoritem dst="fileDetailsLayout" dstEdge="LEFT" spacing="0" src="" srcEdge="CENTERH"/>
- <anchoritem dst="fileDetailsLayout" dstEdge="RIGHT" spacing="0" src="" srcEdge="RIGHT"/>
- <anchoritem dst="fileDetailsLayout" dstEdge="BOTTOM" spacing="-110" src="" srcEdge="BOTTOM"/>
- </layout>
- </widget>
- <widget name="fileDetailsLayout" type="HbWidget">
- <sizehint height="198" type="PREFERRED" width="320"/>
- </widget>
- </section>
- <metadata activeUIState="Common ui state" display="NHD landscape" unit="px">
+ <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>
--- a/videoplayback/hbvideoplaybackview/resources/hbvideoplaybackview.qrc Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/resources/hbvideoplaybackview.qrc Thu Jul 22 16:34:17 2010 +0100
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<RCC>
<qresource prefix="hbvideoplaybackview">
- <file>animation.axml</file>
+ <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>
--- a/videoplayback/hbvideoplaybackview/tsrc/testcontrolconfiguration/src/testcontrolconfiguration.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testcontrolconfiguration/src/testcontrolconfiguration.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: %
+// Version : %version: 4 %
#include <hbapplication.h>
#include <hbinstance.h>
@@ -82,7 +82,6 @@
mControlsController = new QMPXVideoPlaybackControlsController( mFileDetails );
mControlConfig = new QMPXVideoPlaybackControlConfiguration( mControlsController );
- mControlConfig->createControlList();
}
// ---------------------------------------------------------------------------
@@ -121,11 +120,54 @@
MPX_ENTER_EXIT(_L("TestControlConfiguration::testControlList()"));
setup();
-
+
+ //
+ // Streaming case
+ //
+ mFileDetails->mPlaybackMode = EMPXVideoStreaming;
+
+ mControlConfig->createControlList();
QList<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();
}
// ---------------------------------------------------------------------------
@@ -137,8 +179,11 @@
MPX_ENTER_EXIT(_L("TestControlConfiguration::testUpdateControlsWithFileDetails()"));
setup();
-
+ mControlConfig->createControlList();
+
+ //
// 1. test with mVideoEnabled = false
+ //
mControlsController->mFileDetails->mVideoEnabled = false;
mControlConfig->updateControlsWithFileDetails();
@@ -146,8 +191,10 @@
QList<TMPXVideoPlaybackControls> controlsList = mControlConfig->controlList();
QVERIFY( controlsList.contains( EMPXControlBar ) );
-
+
+ //
// 2. test with mVideoEnabled = true
+ //
mControlsController->mFileDetails->mVideoEnabled = false;
mControlConfig->updateControlsWithFileDetails();
@@ -158,6 +205,8 @@
mControlsController->layoutLoader()->findWidget( QString( "transparentWindow" ) );
QVERIFY( widget->isVisible() );
+
+ cleanup();
}
// ---------------------------------------------------------------------------
@@ -169,30 +218,48 @@
MPX_ENTER_EXIT(_L("TestControlConfiguration::testUpdateControlList()"));
setup();
-
+ mControlConfig->createControlList();
+
+ //
// 1. Test for Details View
+ //
mControlConfig->updateControlList( EMPXControlCmdDetailsViewOpened );
-
QList<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( 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/mpxvideoplaybackviewfiledetails.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testcontrolconfiguration/stub/inc/mpxvideoplaybackviewfiledetails.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -70,7 +70,6 @@
bool mPartialPlayback;
bool mRNFormat;
bool mTvOutConnected;
- bool mTvOutPlayAllowed;
bool mDrmProtected;
bool mMultiItemPlaylist;
--- a/videoplayback/hbvideoplaybackview/tsrc/testcontrolconfiguration/stub/src/mpxvideoplaybackviewfiledetails.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testcontrolconfiguration/stub/src/mpxvideoplaybackviewfiledetails.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -67,7 +67,6 @@
mDuration = 0;
mTvOutConnected = false;
- mTvOutPlayAllowed = true;
mDrmProtected = false;
mVideoHeight = 0;
--- a/videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/inc/testdetailsplaybackwindow.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/inc/testdetailsplaybackwindow.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 4 %
+// Version : %version: 5 %
#ifndef __TESTDETAILSPLAYBACKWINDOW_H__
@@ -54,8 +54,6 @@
// changing this order will affect the test results
void testUpdateState();
void testPlayPause();
- void testMousePressEvent();
- void testMouseReleaseEvent();
void testAttach();
void testSend();
--- a/videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/src/testdetailsplaybackwindow.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/src/testdetailsplaybackwindow.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 6 %
+// Version : %version: 7 %
#include <qdebug>
@@ -115,51 +115,6 @@
}
// ---------------------------------------------------------------------------
-// testMousePressEvent
-// ---------------------------------------------------------------------------
-//
-void TestDetailsPlaybackWindow::testMousePressEvent()
-{
- MPX_ENTER_EXIT(
- _L("TestDetailsPlaybackWindow::testMousePressEvent()"));
-
- init();
-
- QGraphicsSceneMouseEvent* event =
- new QGraphicsSceneMouseEvent( QEvent::GraphicsSceneMousePress );
- event->setAccepted( false );
-
- mWindow->mousePressEvent( event );
-
- QVERIFY( event->isAccepted() );
-
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
-// testMouseReleaseEvent
-// ---------------------------------------------------------------------------
-//
-void TestDetailsPlaybackWindow::testMouseReleaseEvent()
-{
- MPX_ENTER_EXIT(
- _L("TestDetailsPlaybackWindow::testMouseReleaseEvent()"));
-
- init();
-
- QGraphicsSceneMouseEvent* event =
- new QGraphicsSceneMouseEvent( QEvent::GraphicsSceneMouseRelease );
-
- mWindow->mouseReleaseEvent( event );
- QVERIFY( mController->mCommand == EMPXPbvCmdPlayPause );
-
- delete event;
- event = NULL;
-
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
// testPlayPause
// ---------------------------------------------------------------------------
//
--- a/videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/stub/inc/mpxvideoplaybackviewfiledetails.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/stub/inc/mpxvideoplaybackviewfiledetails.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -70,7 +70,6 @@
bool mPartialPlayback;
bool mRNFormat;
bool mTvOutConnected;
- bool mTvOutPlayAllowed;
bool mDrmProtected;
bool mMultiItemPlaylist;
--- a/videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/stub/src/mpxvideoplaybackviewfiledetails.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/stub/src/mpxvideoplaybackviewfiledetails.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -67,7 +67,6 @@
mDuration = 0;
mTvOutConnected = false;
- mTvOutPlayAllowed = true;
mDrmProtected = false;
mVideoHeight = 0;
--- a/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/stub/inc/mpxvideoplaybackviewfiledetails.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/stub/inc/mpxvideoplaybackviewfiledetails.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -70,7 +70,6 @@
bool mPartialPlayback;
bool mRNFormat;
bool mTvOutConnected;
- bool mTvOutPlayAllowed;
bool mDrmProtected;
bool mMultiItemPlaylist;
--- a/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/stub/src/mpxvideoplaybackfiledetailswidget.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/stub/src/mpxvideoplaybackfiledetailswidget.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -65,7 +65,7 @@
void QMPXVideoPlaybackFileDetailsWidget::updateWithFileDetails(
QMPXVideoPlaybackViewFileDetails* details )
{
-
+ Q_UNUSED( details );
}
--- a/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/stub/src/mpxvideoplaybackviewfiledetails.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/stub/src/mpxvideoplaybackviewfiledetails.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -67,7 +67,6 @@
mDuration = 0;
mTvOutConnected = false;
- mTvOutPlayAllowed = true;
mDrmProtected = false;
mVideoHeight = 0;
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/inc/hbeffect.h Tue Jun 15 13:09:36 2010 +0100
+++ /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 HbEffect
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-#ifndef HBEFFECT_H
-#define HBEFFECT_H
-
-#include <hbwidget.h>
-
-
-class HbEffect : public HbWidget
-{
- Q_OBJECT
-
- public:
- struct EffectStatus
- {
- Hb::EffectEvent reason;
- };
-
- public:
- static bool add( QGraphicsItem *item, const QString &filePath, const QString &effectEvent );
- static bool remove( QGraphicsItem *item, const QString &filePath, const QString &effectEvent );
-
- static bool start( QGraphicsItem *item,
- const QString &effectEvent,
- QObject *receiver = 0,
- const char *member = 0 );
-
- static bool cancel( QGraphicsItem *item );
-
- static bool effectRunning( QGraphicsItem *item, const QString &effectEvent = QString() );
-
- private:
- void started();
-};
-
-#endif /*HBEFFECT_H*/
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/inc/mpxvideoplaybackcontrolscontroller.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/inc/mpxvideoplaybackcontrolscontroller.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -31,7 +31,6 @@
#include "mpxvideoplaybackviewfiledetails.h"
// FORWARD DECLARATIONS
-class QMPXVideoPlaybackDocumentLoader;
class QMPXVideoPlaybackControlsController ;
// DATA TYPES
@@ -90,15 +89,12 @@
*/
inline QMPXVideoPlaybackViewFileDetails* fileDetails();
- inline QMPXVideoPlaybackDocumentLoader* layoutLoader();
-
TPlaybackViewMode viewMode();
void changeViewMode( TPlaybackViewMode viewMode, bool transitionEffect = true );
public:
QMPXVideoPlaybackViewFileDetails *mFileDetails;
- QMPXVideoPlaybackDocumentLoader *mLoader;
TMPXPlaybackState mState;
TPlaybackViewMode mViewMode;
@@ -129,16 +125,6 @@
}
// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::layoutLoader
-// -------------------------------------------------------------------------------------------------
-//
-inline
-QMPXVideoPlaybackDocumentLoader* QMPXVideoPlaybackControlsController::layoutLoader()
-{
- return mLoader;
-}
-
-// -------------------------------------------------------------------------------------------------
// QMPXVideoPlaybackControlsController::viewMode
// -------------------------------------------------------------------------------------------------
//
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/inc/mpxvideoplaybackdocumentloader.h Tue Jun 15 13:09:36 2010 +0100
+++ /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( QMPXVideoPlaybackControlsController *controller );
-
- virtual ~QMPXVideoPlaybackDocumentLoader();
-
- public:
- QGraphicsWidget* findWidget( const QString &name );
-
- private:
- QGraphicsWidget* createWidget( const QString &name );
- int exist( const QString &name );
-
- private:
- QList<QGraphicsWidget*> mWidgets;
- QMPXVideoPlaybackControlsController *mController;
-};
-
-#endif /*MPXVIDEOPLAYBACKDOCUMENTHANDLER_H_*/
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/inc/mpxvideoplaybackviewfiledetails.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/inc/mpxvideoplaybackviewfiledetails.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -70,7 +70,6 @@
bool mPartialPlayback;
bool mRNFormat;
bool mTvOutConnected;
- bool mTvOutPlayAllowed;
bool mDrmProtected;
bool mMultiItemPlaylist;
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/src/hbeffect.cpp Tue Jun 15 13:09:36 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of HbEffect
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-#include "mpxvideo_debug.h"
-#include "hbeffect.h"
-
-
-// -------------------------------------------------------------------------------------------------
-// HbEffect::add
-// -------------------------------------------------------------------------------------------------
-//
-bool HbEffect::add( QGraphicsItem *item, const QString &filePath, const QString &effectEvent )
-{
- MPX_DEBUG(_L("HbEffect::add") );
-
- Q_UNUSED( item );
- Q_UNUSED( filePath );
- Q_UNUSED( effectEvent );
-
- return true;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbEffect::remove
-// -------------------------------------------------------------------------------------------------
-//
-bool HbEffect::remove( QGraphicsItem *item, const QString &filePath, const QString &effectEvent )
-{
- MPX_DEBUG(_L("HbEffect::remove") );
-
- Q_UNUSED( item );
- Q_UNUSED( filePath );
- Q_UNUSED( effectEvent );
-
- return true;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbEffect::start
-// -------------------------------------------------------------------------------------------------
-//
-bool HbEffect::start(
- QGraphicsItem *item, const QString &effectEvent, QObject *receiver, const char *member )
-{
- MPX_DEBUG(_L("HbEffect::start") );
-
- Q_UNUSED( item );
- Q_UNUSED( effectEvent );
-
- HbEffect::EffectStatus status;
- status.reason = Hb::EffectFinished;
-
- QMetaObject::invokeMethod(
- receiver,
- member,
- Qt::AutoConnection,
- QGenericReturnArgument(),
- Q_ARG( HbEffect::EffectStatus, status ) );
-
- return true;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbEffect::cancel
-// -------------------------------------------------------------------------------------------------
-//
-bool HbEffect::cancel( QGraphicsItem *item )
-{
- MPX_DEBUG(_L("HbEffect::cancel"));
-
- Q_UNUSED( item );
-
- return true;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbEffect::effectRunning
-// -------------------------------------------------------------------------------------------------
-//
-bool HbEffect::effectRunning( QGraphicsItem *item, const QString &effectEvent )
-{
- MPX_DEBUG(_L("HbEffect::effectRunning"));
-
- Q_UNUSED( item );
-
- return false;
-}
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/src/mpxvideoplaybackcontrolscontroller.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/src/mpxvideoplaybackcontrolscontroller.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,14 +15,13 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
// INCLUDE FILES
-#include "mpxvideoplaybackdocumentloader.h"
#include "mpxvideoplaybackcontrolscontroller.h"
// ================= MEMBER FUNCTIONS ==============================================================
@@ -36,7 +35,6 @@
{
MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController()"));
- mLoader = new QMPXVideoPlaybackDocumentLoader( this );
mFileDetails = new QMPXVideoPlaybackViewFileDetails();
}
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/src/mpxvideoplaybackdocumentloader.cpp Tue Jun 15 13:09:36 2010 +0100
+++ /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 QMPXVideoPlaybackDocumentLoader
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackprogressbar.h"
-#include "mpxvideoplaybackdocumentloader.h"
-#include "mpxvideoplaybackcontrolscontroller.h"
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::QMPXVideoPlaybackDocumentLoader
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackDocumentLoader::QMPXVideoPlaybackDocumentLoader(
- QMPXVideoPlaybackControlsController *controller )
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackDocumentLoader::QMPXVideoPlaybackDocumentLoader()"));
-
- mController = controller;
-}
-
-// -------------------------------------------------------------------------------------------------
-// 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 == "progressBarLayout" )
- {
- object = new QMPXVideoPlaybackProgressBar( mController );
- 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/testmpxvideoplaybackcontrolbar/stub/src/mpxvideoplaybackviewfiledetails.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/src/mpxvideoplaybackviewfiledetails.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -67,7 +67,6 @@
mDuration = 0;
mTvOutConnected = false;
- mTvOutPlayAllowed = true;
mDrmProtected = false;
mVideoHeight = 0;
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/testmpxvideoplaybackcontrolbar.pro Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/testmpxvideoplaybackcontrolbar.pro Thu Jul 22 16:34:17 2010 +0100
@@ -14,7 +14,7 @@
# Description: Project file for building testmpxvideoplaybackcontrolbar
#
#
-# Version : %version: 3 %
+# Version : %version: 4 %
TEMPLATE = app
TARGET = testmpxvideoplaybackcontrolbar
@@ -30,18 +30,14 @@
# Input
HEADERS += testmpxvideoplaybackcontrolbar.h \
mpxvideoplaybackcontrolscontroller.h \
- mpxvideoplaybackdocumentloader.h \
mpxvideoplaybackviewfiledetails.h \
mpxvideoplaybackprogressbar.h \
mpxvideoplaybacktoolbar.h \
- hbeffect.h \
../../controlinc/mpxvideoplaybackcontrolbar.h
SOURCES += testmpxvideoplaybackcontrolbar.cpp \
mpxvideoplaybackcontrolscontroller.cpp \
- mpxvideoplaybackdocumentloader.cpp \
mpxvideoplaybackviewfiledetails.cpp \
mpxvideoplaybackprogressbar.cpp \
mpxvideoplaybacktoolbar.cpp \
- hbeffect.cpp \
../../controlsrc/mpxvideoplaybackcontrolbar.cpp
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolpolicy/stub/inc/mpxvideoplaybackviewfiledetails.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolpolicy/stub/inc/mpxvideoplaybackviewfiledetails.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -70,7 +70,6 @@
bool mPartialPlayback;
bool mRNFormat;
bool mTvOutConnected;
- bool mTvOutPlayAllowed;
bool mDrmProtected;
bool mMultiItemPlaylist;
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolpolicy/stub/src/mpxvideoplaybackviewfiledetails.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolpolicy/stub/src/mpxvideoplaybackviewfiledetails.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -67,7 +67,6 @@
mDuration = 0;
mTvOutConnected = false;
- mTvOutPlayAllowed = true;
mDrmProtected = false;
mVideoHeight = 0;
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdocumentloader/src/testmpxvideoplaybackdocumentloader.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdocumentloader/src/testmpxvideoplaybackdocumentloader.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -1,5 +1,5 @@
/**
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -12,10 +12,10 @@
* Contributors:
*
* Description: tester for methods in TestMPXVideoPlaybackDocumentLoader
-*
+*
*/
-// Version : %version: 5 %
+// Version : %version: 6 %
#include <qdebug>
@@ -49,9 +49,9 @@
pass[0] = argv[0];
pass[1] = "-o";
pass[2] = "c:\\data\\testmpxvideoplaybackdocumentloader.txt";
-
+
int res = QTest::qExec(&tv, 3, pass);
-
+
return res;
}
@@ -102,9 +102,6 @@
QObject *object = mLoader->createObject( "", "controlBarLayout" );
QVERIFY( object->objectName() == "controlBarLayout" );
- object = mLoader->createObject( "", "progressBarLayout" );
- QVERIFY( object->objectName() == "progressBarLayout" );
-
object = mLoader->createObject( "", "fileDetailsLayout" );
QVERIFY( object->objectName() == "fileDetailsLayout" );
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdocumentloader/stub/inc/mpxvideoplaybackprogressbar.h Tue Jun 15 13:09:36 2010 +0100
+++ /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 QMPXVideoPlaybackProgressBar
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKPROGRESSBAR_H_
-#define MPXVIDEOPLAYBACKPROGRESSBAR_H_
-
-#include <qobject>
-
-class QMPXVideoPlaybackControlsController;
-
-class QMPXVideoPlaybackProgressBar : public QObject
-{
- Q_OBJECT
-
- public:
- QMPXVideoPlaybackProgressBar( QMPXVideoPlaybackControlsController* controller );
- virtual ~QMPXVideoPlaybackProgressBar();
-
- public:
- QMPXVideoPlaybackControlsController *mController;
-};
-
-#endif /*MPXVIDEOPLAYBACKPROGRESSBAR_H_*/
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdocumentloader/stub/src/mpxvideoplaybackcontrolscontroller.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdocumentloader/stub/src/mpxvideoplaybackcontrolscontroller.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -67,6 +67,7 @@
{
MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::changeViewMode()"));
+ Q_UNUSED( transitionEffect );
mViewMode = viewMode;
}
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdocumentloader/stub/src/mpxvideoplaybackprogressbar.cpp Tue Jun 15 13:09:36 2010 +0100
+++ /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 "mpxvideoplaybackprogressbar.h"
-#include "mpxvideoplaybackcontrolscontroller.h"
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackProgressBar::QMPXVideoPlaybackProgressBar
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackProgressBar::QMPXVideoPlaybackProgressBar(
- QMPXVideoPlaybackControlsController* controller )
- : mController( controller )
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackProgressBar::QMPXVideoPlaybackProgressBar()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackProgressBar::~QMPXVideoPlaybackProgressBar
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackProgressBar::~QMPXVideoPlaybackProgressBar()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackProgressBar::~QMPXVideoPlaybackProgressBar()"));
-}
-
-//End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdocumentloader/testmpxvideoplaybackdocumentloader.pro Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdocumentloader/testmpxvideoplaybackdocumentloader.pro Thu Jul 22 16:34:17 2010 +0100
@@ -14,7 +14,7 @@
# Description: Project file for building testmpxvideoplaybackdocumentloader
#
#
-# Version : %version: 5 %
+# Version : %version: 6 %
TEMPLATE = app
TARGET = testmpxvideoplaybackdocumentloader
@@ -32,7 +32,6 @@
mpxvideoplaybackcontrolscontroller.h \
mpxvideoplaybackfiledetailswidget.h \
mpxvideoplaybackdetailsplaybackwindow.h \
- mpxvideoplaybackprogressbar.h \
mpxvideoplaybackcontrolbar.h \
../../controlinc/mpxvideoplaybackdocumentloader.h
@@ -40,6 +39,5 @@
mpxvideoplaybackcontrolscontroller.cpp \
mpxvideoplaybackfiledetailswidget.cpp \
mpxvideoplaybackdetailsplaybackwindow.cpp \
- mpxvideoplaybackprogressbar.cpp \
mpxvideoplaybackcontrolbar.cpp \
../../controlsrc/mpxvideoplaybackdocumentloader.cpp
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/inc/mpxvideoplaybackviewfiledetails.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/inc/mpxvideoplaybackviewfiledetails.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 2 %
+// Version : %version: 3 %
@@ -70,7 +70,6 @@
bool mPartialPlayback;
bool mRNFormat;
bool mTvOutConnected;
- bool mTvOutPlayAllowed;
bool mDrmProtected;
bool mMultiItemPlaylist;
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/src/hbglobal.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/src/hbglobal.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 2 %
+// Version : %version: 3 %
@@ -89,7 +89,7 @@
{
loc = "Bitrate";
}
- else if ( string == "txt_videos_list_l1_l2_l3" )
+ else if ( string == "txt_videos_list_l1l2l3" )
{
loc = "%L1 hr %L2 min %L3 sec";
}
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/src/mpxvideoplaybackdocumentloader.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/src/mpxvideoplaybackdocumentloader.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -88,6 +88,12 @@
object->setObjectName( name );
mWidgets.append( object );
}
+ else if ( name == "content" )
+ {
+ object = new QGraphicsWidget();
+ object->setObjectName( name );
+ mWidgets.append( object );
+ }
return object;
}
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/src/mpxvideoplaybackviewfiledetails.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/src/mpxvideoplaybackviewfiledetails.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 2 %
+// Version : %version: 3 %
@@ -67,7 +67,6 @@
mDuration = 0;
mTvOutConnected = false;
- mTvOutPlayAllowed = true;
mDrmProtected = false;
mVideoHeight = 0;
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybacktoolbar/src/testmpxvideoplaybacktoolbar.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybacktoolbar/src/testmpxvideoplaybacktoolbar.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 2 %
+// Version : %version: 4 %
#include <qdebug>
@@ -33,9 +33,9 @@
#include "mpxvideoplaybacktoolbar.h"
#undef private
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// main
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
int main(int argc, char *argv[])
{
@@ -49,17 +49,16 @@
char *pass[3];
pass[0] = argv[0];
pass[1] = "-o";
- pass[2] = "c:\\data\\TestMPXVideoPlaybackToolBar.txt";
+ pass[2] = "c:\\data\\testmpxvideoplaybacktoolbar.txt";
int res = QTest::qExec(&tv, 3, pass);
return res;
}
-
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// init
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
void TestMPXVideoPlaybackToolBar::init( bool attachOperation )
{
@@ -69,14 +68,15 @@
mVideoToolBar = new QMPXVideoPlaybackToolBar( mController );
mVideoToolBar->setVisible( true );
+
connect( this, SIGNAL( commandSignal() ), mVideoToolBar, SLOT( retrieveButtons() ) );
emit commandSignal();
disconnect( this, SIGNAL( commandSignal() ), mVideoToolBar, SLOT( retrieveButtons() ) );
}
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// cleanup
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
void TestMPXVideoPlaybackToolBar::cleanup()
{
@@ -95,9 +95,9 @@
}
}
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// testPlay
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
void TestMPXVideoPlaybackToolBar::testPlay()
{
@@ -113,9 +113,9 @@
cleanup();
}
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// testLongTapOnFF
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
void TestMPXVideoPlaybackToolBar::testLongTapOnFF()
{
@@ -148,9 +148,9 @@
cleanup();
}
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// testLongTapOnRW
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
void TestMPXVideoPlaybackToolBar::testLongTapOnRW()
{
@@ -183,9 +183,9 @@
cleanup();
}
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// testShortTapOnFF
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
void TestMPXVideoPlaybackToolBar::testShortTapOnFF()
{
@@ -217,9 +217,9 @@
cleanup();
}
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// testShortTapOnRW
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
void TestMPXVideoPlaybackToolBar::testShortTapOnRW()
{
@@ -250,9 +250,9 @@
cleanup();
}
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// testPause
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
void TestMPXVideoPlaybackToolBar::testPause()
{
@@ -268,9 +268,9 @@
cleanup();
}
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// testChangeAspectRatio
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
void TestMPXVideoPlaybackToolBar::testChangeAspectRatio()
{
@@ -308,9 +308,9 @@
cleanup();
}
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// testUpdateState
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
void TestMPXVideoPlaybackToolBar::testUpdateState()
{
@@ -345,9 +345,9 @@
cleanup();
}
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// testAspectRatioChanged
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
void TestMPXVideoPlaybackToolBar::testAspectRatioChanged()
{
@@ -379,9 +379,9 @@
cleanup();
}
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// testHandleButtonPressed
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
void TestMPXVideoPlaybackToolBar::testHandleButtonPressed()
{
@@ -396,9 +396,9 @@
cleanup();
}
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// testUpdateWithFileDetails
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
void TestMPXVideoPlaybackToolBar::testUpdateWithFileDetails()
{
@@ -418,7 +418,6 @@
details->mVideoHeight = 1;
details->mVideoWidth = 1;
details->mTvOutConnected = false;
- details->mTvOutPlayAllowed = true;
details->mSeekable = true;
details->mPausableStream = true;
mController->mViewMode = EFullScreenView;
@@ -455,15 +454,14 @@
details->mVideoHeight = 0;
details->mVideoWidth = 1;
details->mTvOutConnected = true;
- details->mTvOutPlayAllowed = true;
details->mSeekable = false;
- details->mPausableStream = false;
+ details->mPausableStream = true;
mVideoToolBar->updateWithFileDetails( details );
QVERIFY( mVideoToolBar->mButtons[EMPX1stButton]->isEnabled() == false );
QVERIFY( mVideoToolBar->mButtons[EMPX2ndButton]->isEnabled() == false );
- QVERIFY( mVideoToolBar->mButtons[EMPX3rdButton]->isEnabled() == false );
+ QVERIFY( mVideoToolBar->mButtons[EMPX3rdButton]->isEnabled() == true );
QVERIFY( mVideoToolBar->mButtons[EMPX4thButton]->isEnabled() == false );
QVERIFY( mVideoToolBar->mButtons[EMPX5thButton]->isEnabled() == false );
@@ -474,8 +472,7 @@
details->mVideoHeight = 0;
details->mVideoWidth = 1;
details->mTvOutConnected = true;
- details->mTvOutPlayAllowed = true;
- details->mSeekable = false;
+ details->mSeekable = true;
details->mPausableStream = false;
mController->mViewMode = EAudioOnlyView;
@@ -493,6 +490,8 @@
details->mVideoEnabled = false;
details->mPlaybackMode = EMPXVideoStreaming;
mController->mViewMode = EAudioOnlyView;
+ details->mSeekable = false;
+ details->mPausableStream = false;
mVideoToolBar->updateWithFileDetails( details );
@@ -516,7 +515,6 @@
details->mVideoHeight = 1;
details->mVideoWidth = 1;
details->mTvOutConnected = false;
- details->mTvOutPlayAllowed = true;
details->mSeekable = true;
details->mPausableStream = true;
@@ -531,9 +529,9 @@
cleanup();
}
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// testOpenDetailsView
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
void TestMPXVideoPlaybackToolBar::testOpenDetailsView()
{
@@ -558,9 +556,9 @@
cleanup();
}
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// testAttach
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
void TestMPXVideoPlaybackToolBar::testAttach()
{
@@ -608,9 +606,9 @@
}
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// testSend
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
void TestMPXVideoPlaybackToolBar::testSend()
{
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybacktoolbar/stub/inc/mpxvideoplaybackviewfiledetails.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybacktoolbar/stub/inc/mpxvideoplaybackviewfiledetails.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -70,7 +70,6 @@
bool mPartialPlayback;
bool mRNFormat;
bool mTvOutConnected;
- bool mTvOutPlayAllowed;
bool mDrmProtected;
bool mMultiItemPlaylist;
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybacktoolbar/stub/src/mpxvideoplaybackviewfiledetails.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybacktoolbar/stub/src/mpxvideoplaybackviewfiledetails.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -67,7 +67,6 @@
mDuration = 0;
mTvOutConnected = false;
- mTvOutPlayAllowed = true;
mDrmProtected = false;
mVideoHeight = 0;
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/inc/testmpxvideoviewwrapper.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/inc/testmpxvideoviewwrapper.h Thu Jul 22 16:34:17 2010 +0100
@@ -29,28 +29,23 @@
{
Q_OBJECT
-public:
+ public:
- /**
- * will be called before each testfunction is executed.
- *
- */
- void init();
+ /**
+ * will be called before each testfunction is executed.
+ *
+ */
+ void init();
- /**
- * will be called after every testfunction.
- *
- */
- void cleanup();
+ /**
+ * will be called after every testfunction.
+ *
+ */
+ void cleanup();
- // test functions for the test framework
-
-
-private slots:
-
+ private slots:
// the order in which these testXX methods are declared is important
// changing this order will affect the test results
-
void testRequestMedia();
void testIsLive();
void testIsPlaylist();
@@ -62,7 +57,6 @@
void testRetrieveFileNameAndMode();
void testActivateClosePlayerActiveObject();
void testDoClosePlayer();
- void testIssuePlayCommand();
void testSetAspectRatio();
void testIsAppInFront();
void testClosePlaybackView();
@@ -75,26 +69,17 @@
void testUpdateVideoRectDone();
void testHandleBufferingState();
void testHandleVideoPlaybackMessage();
- void testCreateGeneralPlaybackCommand();
void testHandlePlaybackCommandComplete();
void testHandleMedia();
-
-
-signals:
-
- void commandSignal(int);
+ signals:
+ void commandSignal(int);
-private:
- CMPXVideoViewWrapper* mVideoViewWrapper;
- HbVideoBasePlaybackView* mBaseVideoView;
-
+ private:
+ CMPXVideoViewWrapper *mVideoViewWrapper;
+ HbVideoBasePlaybackView *mBaseVideoView;
};
-
#endif // __TESTMPXVIDEOVIEWWRAPPER_H__
// End of file
-
-
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/src/testmpxvideoviewwrapper.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/src/testmpxvideoviewwrapper.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -1,5 +1,5 @@
/**
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -12,9 +12,11 @@
* Contributors:
*
* Description: tester for methods in VideoSortFilterProxyModel
-*
+*
*/
+// Version : %version: 9 %
+
#include <e32err.h>
#include <w32std.h>
@@ -34,12 +36,10 @@
#include "../stub/inc/hbvideobaseplaybackview.h"
#include "../stub/inc/mpxvideoplaybackviewfiledetails.h"
-#include "../stub/inc/mpxplaybackutilityimpl.h"
#include "../stub/inc/mpxvideoplaybackdisplayhandler.h"
#include "../stub/inc/mpxvideoplaybackcontrolscontroller.h"
-
#define protected public
#include "mpxvideoviewwrapper.h"
#undef protected
@@ -53,29 +53,28 @@
{
HbApplication app(argc, argv);
HbMainWindow window;
-
+
TestMPXVideoViewWrapper tv;
char *pass[3];
pass[0] = argv[0];
pass[1] = "-o";
- pass[2] = "c:\\data\\TestMPXVideoViewWrapper.txt";
-
+ pass[2] = "c:\\data\\testmpxvideoviewwrapper.txt";
+
int res = QTest::qExec(&tv, 3, pass);
-
+
return res;
}
-
// ---------------------------------------------------------------------------
// init
// ---------------------------------------------------------------------------
//
void TestMPXVideoViewWrapper::init()
-{
- mBaseVideoView = new HbVideoBasePlaybackView();
- TRAPD( err, mVideoViewWrapper = CMPXVideoViewWrapper::NewL( mBaseVideoView ) );
- QVERIFY( err == KErrNone );
+{
+ mBaseVideoView = new HbVideoBasePlaybackView();
+ TRAPD( err, mVideoViewWrapper = CMPXVideoViewWrapper::NewL( mBaseVideoView ) );
+ QVERIFY( err == KErrNone );
}
// ---------------------------------------------------------------------------
@@ -84,25 +83,29 @@
//
void TestMPXVideoViewWrapper::cleanup()
{
- delete mVideoViewWrapper;
- mVideoViewWrapper = NULL;
-
- delete mBaseVideoView;
- mBaseVideoView = NULL;
+ if ( mVideoViewWrapper )
+ {
+ delete mVideoViewWrapper;
+ mVideoViewWrapper = NULL;
+ }
+
+ if ( mBaseVideoView )
+ {
+ delete mBaseVideoView;
+ mBaseVideoView = NULL;
+ }
}
-
void TestMPXVideoViewWrapper::testRequestMedia()
{
init();
TRAPD(err, mVideoViewWrapper->RequestMediaL());
QVERIFY( err == KErrNone );
-
- QVERIFY( mVideoViewWrapper->iMediaRequested == true );
-
+
+ QVERIFY( mVideoViewWrapper->iMediaRequestStatus == MediaRequested );
+
cleanup();
-
}
void TestMPXVideoViewWrapper::testIsLive()
@@ -111,68 +114,223 @@
TRAPD(err, mVideoViewWrapper->RequestMediaL());
QVERIFY( err == KErrNone );
-
- mVideoViewWrapper->IsLive();
-
- mVideoViewWrapper->iFileDetails->clearFileDetails();
-
+
+ mVideoViewWrapper->iFileDetails->mPlaybackMode = EMPXVideoLiveStreaming;
+ QVERIFY( mVideoViewWrapper->IsLive() );
+
+ mVideoViewWrapper->iFileDetails->mPlaybackMode = EMPXVideoLocal;
QVERIFY( ! mVideoViewWrapper->IsLive() );
-
+
cleanup();
}
-
void TestMPXVideoViewWrapper::testIsPlaylist()
{
init();
- mVideoViewWrapper->IsPlaylist();
-
+ mVideoViewWrapper->iPlaylistView = true;
+ QVERIFY( mVideoViewWrapper->IsPlaylist() == true );
+
+ mVideoViewWrapper->iPlaylistView = false;
QVERIFY( mVideoViewWrapper->IsPlaylist() == false );
-
+
cleanup();
-
}
-
void TestMPXVideoViewWrapper::testHandleCommand()
{
init();
-
- TRAPD(errReqMedia, mVideoViewWrapper->RequestMediaL());
+
+ TRAPD( errReqMedia, mVideoViewWrapper->RequestMediaL() );
QVERIFY( errReqMedia == KErrNone );
-
- TRAPD(errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdPlay ));
+
+ //
+ // 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 );
- int state;
- TRAPD(errState, state = mVideoViewWrapper->iPlaybackUtility->StateL());
- QVERIFY( errState == KErrNone );
-
- QVERIFY( state == EPbStatePlaying );
-
+ //
+ // 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();
@@ -181,424 +339,495 @@
// Test Video Msg
//***************************
CMPXMessage* message = NULL;
- TRAP_IGNORE(
- message = CMPXMessage::NewL();
+ TRAP_IGNORE(
+ message = CMPXMessage::NewL();
message->SetTObjectValueL<TMPXMessageId>( KMPXMessageGeneralId, KMPXMediaIdVideoPlayback );
message->SetTObjectValueL<TMPXVideoPlaybackCommand>
( KMPXMediaVideoPlaybackCommand, EPbCmdTvOutEvent );
message->SetTObjectValueL<TInt>( KMPXMediaVideoTvOutConnected, ETrue );
- message->SetTObjectValueL<TInt>( KMPXMediaVideoTvOutPlayAllowed, EFalse );
);
mVideoViewWrapper->HandlePlaybackMessage( message, KErrNone );
- QVERIFY( mVideoViewWrapper->iFileDetails->mTvOutConnected );
+ QVERIFY( mVideoViewWrapper->iFileDetails->mTvOutConnected );
if ( message )
{
delete message;
message = NULL;
- }
+ }
-
-
//***************************
// Test General Msg
//***************************
- TRAP_IGNORE(
+ TRAP_IGNORE(
message = CMPXMessage::NewL();
message->SetTObjectValueL<TMPXMessageId>( KMPXMessageGeneralId, KMPXMessageGeneral );
- message->SetTObjectValueL<TInt>( KMPXMessageGeneralEvent, 28 ); // EReachedEndOfPlaylist = 28
+ message->SetTObjectValueL<TInt>( KMPXMessageGeneralEvent, 28 ); // EReachedEndOfPlaylist = 28
message->SetTObjectValueL<TInt>( KMPXMessageGeneralType, 0 );
- message->SetTObjectValueL<TInt>( KMPXMessageGeneralData, 0 );
+ message->SetTObjectValueL<TInt>( KMPXMessageGeneralData, 0 );
);
- mVideoViewWrapper->HandlePlaybackMessage( message, KErrNone );
- QVERIFY( ! mVideoViewWrapper->iView->mViewActive );
+ 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 );
+ QVERIFY( mVideoViewWrapper->iView->mCurrentError == KErrNotFound );
if ( message )
{
delete message;
message = NULL;
- }
-
+ }
+
cleanup();
}
+void TestMPXVideoViewWrapper::testSetProperty()
+{
+ init();
-void TestMPXVideoViewWrapper::testSetProperty()
+ TRAPD( errReqMedia, mVideoViewWrapper->RequestMediaL()) ;
+ QVERIFY( errReqMedia == KErrNone );
+
+ TMPXPlaybackProperty property = EPbPropertyMute;
+ TInt propertyValue = 1;
+
+ TRAPD( errSetProp, mVideoViewWrapper->SetPropertyL( property, propertyValue ) );
+ QVERIFY( errSetProp == KErrNone );
+
+ QVERIFY( mVideoViewWrapper->iPlaybackUtility->iProperty == property );
+ QVERIFY( mVideoViewWrapper->iPlaybackUtility->iPropertyValue == propertyValue );
+
+ cleanup();
+}
+
+void TestMPXVideoViewWrapper::testHandleProperty()
{
init();
TRAPD(errReqMedia, mVideoViewWrapper->RequestMediaL());
QVERIFY( errReqMedia == KErrNone );
-
- TRAPD(errSetProp, mVideoViewWrapper->SetPropertyL( EPbPropertyMute, 1 ) ); // 0=>noraml 1=>muted
- QVERIFY( errSetProp == KErrNone );
-
- QVERIFY( ! mVideoViewWrapper->iFileDetails->mAudioEnabled );
-
+
+ //
+ // Duration
+ //
+ int value = 5000;
+ TRAPD(errHdlProp, mVideoViewWrapper->HandlePropertyL( EPbPropertyDuration, value, KErrNone ) );
+ QVERIFY( errHdlProp == KErrNone );
+
+ QVERIFY( mVideoViewWrapper->iControlsController->mReceivedEvent == EMPXControlCmdSetDuration );
+ QVERIFY( mVideoViewWrapper->iControlsController->mValue == value );
+
+ //
+ // Position
+ //
+ value = 500;
+
+ TRAP(errHdlProp, mVideoViewWrapper->HandlePropertyL( EPbPropertyPosition, value, KErrNone ) );
+ QVERIFY( errHdlProp == KErrNone );
+
+ QVERIFY( mVideoViewWrapper->iControlsController->mReceivedEvent == EMPXControlCmdSetPosition );
+ QVERIFY( mVideoViewWrapper->iControlsController->mValue == value );
+
+ //
+ // Volume
+ //
+ value = 10;
+
+ TRAP(errHdlProp, mVideoViewWrapper->HandlePropertyL( EPbPropertyVolume, value, KErrNone ) );
+ QVERIFY( errHdlProp == KErrNone );
+
+ QVERIFY( mVideoViewWrapper->iControlsController->mReceivedEvent == EMPXControlCmdSetVolume );
+ QVERIFY( mVideoViewWrapper->iControlsController->mValue == value );
+
+ //
+ // Mute
+ //
+ value = 1;
+
+ TRAP(errHdlProp, mVideoViewWrapper->HandlePropertyL( EPbPropertyMute, value, KErrNone ) );
+ QVERIFY( errHdlProp == KErrNone );
+
+ QVERIFY( mVideoViewWrapper->iControlsController->mReceivedEvent == EMPXControlCmdSetVolume );
+ QVERIFY( mVideoViewWrapper->iControlsController->mValue == 0 );
+
cleanup();
}
-
-void TestMPXVideoViewWrapper::testHandleProperty()
-{
- init();
-
- TRAPD(errReqMedia, mVideoViewWrapper->RequestMediaL());
- QVERIFY( errReqMedia == KErrNone );
-
- TRAPD(errHdlProp, mVideoViewWrapper->HandlePropertyL( EPbPropertyDuration, 5000, KErrNone ));
- QVERIFY( errHdlProp == KErrNone );
-
- QVERIFY( mVideoViewWrapper->iFileDetails->mDuration == 5000 );
-
- cleanup();
-}
-
-
void TestMPXVideoViewWrapper::testRetrieveFileNameAndMode()
{
init();
-
- mVideoViewWrapper->iFileDetails->clearFileDetails();
-
+
+ mVideoViewWrapper->iFileDetails->clearFileDetails();
+
CMPXCommand* cmd = NULL;
-
+
TRAP_IGNORE( cmd = CMPXCommand::NewL() );
- TRAPD(errRetFileName, mVideoViewWrapper->RetrieveFileNameAndModeL( cmd ) );
- QVERIFY( errRetFileName == KErrNone );
-
- int state;
- TRAPD(errState, state = mVideoViewWrapper->iPlaybackUtility->StateL());
- QVERIFY( errState == KErrNone );
-
- QVERIFY( state == EPbStateInitialised );
-
- QCOMPARE( mVideoViewWrapper->iFileDetails->mClipName, QString("testClip.3gp"));
-
- delete cmd;
- cmd = NULL;
-
+ if ( cmd )
+ {
+ TRAPD(errRetFileName, mVideoViewWrapper->RetrieveFileNameAndModeL( cmd ) );
+ QVERIFY( errRetFileName == KErrNone );
+
+ QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdInitView );
+
+ QCOMPARE( mVideoViewWrapper->iFileDetails->mClipName, QString("testClip.3gp"));
+
+ delete cmd;
+ cmd = NULL;
+ }
+
cleanup();
}
-
void TestMPXVideoViewWrapper::testActivateClosePlayerActiveObject()
{
init();
-
+
mVideoViewWrapper->ActivateClosePlayerActiveObject();
-
+
QVERIFY( mVideoViewWrapper->iCloseAO->IsActive() );
-
+
cleanup();
}
-
void TestMPXVideoViewWrapper::testDoClosePlayer()
{
init();
-
- TRAPD(err, mVideoViewWrapper->DoClosePlayerL());
- QVERIFY( err == KErrNone );
-
+
+ TRAPD(err, mVideoViewWrapper->DoClosePlayer());
+ QVERIFY( err == KErrNone );
+
QVERIFY( ! mVideoViewWrapper->iView->mViewActive );
-
+
cleanup();
}
-
-void TestMPXVideoViewWrapper::testIssuePlayCommand()
-{
- init();
- TRAPD(errReqMedia, mVideoViewWrapper->RequestMediaL());
- QVERIFY( errReqMedia == KErrNone );
-
- TRAPD(errIssuePlay, mVideoViewWrapper->IssuePlayCommandL());
- QVERIFY( errIssuePlay == KErrNone );
-
-
- int state;
- TRAPD(errState, state = mVideoViewWrapper->iPlaybackUtility->StateL());
- QVERIFY( errState == KErrNone );
-
- QVERIFY( state == EPbStatePlaying );
-
- cleanup();
-}
-
-
void TestMPXVideoViewWrapper::testSetAspectRatio()
{
init();
- TRAPD(errReqMedia, mVideoViewWrapper->RequestMediaL());
+ TRAPD( errReqMedia, mVideoViewWrapper->RequestMediaL() );
QVERIFY( errReqMedia == KErrNone );
-
- TRAPD(errHdlCmd, mVideoViewWrapper->HandleCommandL(EMPXPbvCmdStretchAspectRatio));
+
+ TRAPD( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdStretchAspectRatio ) );
QVERIFY( errHdlCmd == KErrNone );
-
- QVERIFY( mVideoViewWrapper->iDisplayHandler->iCurrentIndexForAspectRatio == 1 );
-
+
+ QVERIFY( mVideoViewWrapper->iDisplayHandler->iAspectRatio == EMMFStretch );
+
cleanup();
}
-
void TestMPXVideoViewWrapper::testIsAppInFront()
{
init();
-
+
TRAPD(errReqMedia, mVideoViewWrapper->RequestMediaL());
QVERIFY( errReqMedia == KErrNone );
-
+
bool front = false;
- TRAPD(errIsAppInFrnt, front = mVideoViewWrapper->IsAppInFrontL());
-
+ TRAPD( errIsAppInFrnt, front = mVideoViewWrapper->IsAppInFrontL() );
+
QVERIFY( errIsAppInFrnt == KErrNone );
-
+
cleanup();
}
-
void TestMPXVideoViewWrapper::testClosePlaybackView()
{
init();
-
+
TRAPD(err, mVideoViewWrapper->ClosePlaybackViewL());
QVERIFY( err == KErrNone );
-
+
QVERIFY( ! mVideoViewWrapper->iView->mViewActive );
-
+
cleanup();
}
-
void TestMPXVideoViewWrapper::testHandleVolumeCmd()
{
init();
-
- TRAPD(errReqMedia, mVideoViewWrapper->RequestMediaL());
+
+ TRAPD( errReqMedia, mVideoViewWrapper->RequestMediaL() );
QVERIFY( errReqMedia == KErrNone );
-
- TRAPD(errIssuePlay, mVideoViewWrapper->IssuePlayCommandL());
+
+ TRAPD( errIssuePlay, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdPlay ) );
+ QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdPlay );
QVERIFY( errIssuePlay == KErrNone );
-
- TRAPD(errHdlCmd, mVideoViewWrapper->HandleCommandL(EMPXPbvCmdDecreaseVolume));
- QVERIFY( errHdlCmd == 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());
+
+ TRAPD( errReqMedia, mVideoViewWrapper->RequestMediaL() );
QVERIFY( errReqMedia == KErrNone );
-
- TRAPD(errIssuePlay, mVideoViewWrapper->IssuePlayCommandL());
+
+ TRAPD( errIssuePlay, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdPlay ) );
+ QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdPlay );
QVERIFY( errIssuePlay == KErrNone );
-
- TRAPD(errHdlCmd, mVideoViewWrapper->HandleCommandL(EMPXPbvCmdShortPressBackward));
- QVERIFY( errHdlCmd == 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());
+
+ TRAPD( errReqMedia, mVideoViewWrapper->RequestMediaL() );
QVERIFY( errReqMedia == KErrNone );
-
- TRAPD(errIssuePlay, mVideoViewWrapper->IssuePlayCommandL());
+
+ TRAPD( errIssuePlay, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdPlay ) );
+ QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdPlay );
+
QVERIFY( errIssuePlay == KErrNone );
-
- TRAPD(errIssueVidAppFGCmd, mVideoViewWrapper->IssueVideoAppForegroundCmdL( ETrue ));
+
+ //
+ // test foreground
+ //
+ TRAPD( errIssueVidAppFGCmd, mVideoViewWrapper->IssueVideoAppForegroundCmdL( ETrue ) );
+ QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdHandleForeground );
QVERIFY( errIssueVidAppFGCmd == KErrNone );
-
+
+ //
+ // test background
+ //
+ TRAP( errIssueVidAppFGCmd, mVideoViewWrapper->IssueVideoAppForegroundCmdL( EFalse ) );
+ QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdHandleBackground );
+ QVERIFY( errIssueVidAppFGCmd == KErrNone );
+
cleanup();
}
-
void TestMPXVideoViewWrapper::testCreateControls()
{
init();
-
+
TRAPD(err, mVideoViewWrapper->CreateControlsL());
QVERIFY( err == KErrNone );
-
+
QVERIFY( mVideoViewWrapper->iControlsController );
-
+
cleanup();
}
-
void TestMPXVideoViewWrapper::testIsMultiItemPlaylist()
{
init();
-
+
TRAPD(errReqMedia, mVideoViewWrapper->RequestMediaL());
QVERIFY( errReqMedia == KErrNone );
-
+
QVERIFY( ! mVideoViewWrapper->IsMultiItemPlaylist() );
-
+
cleanup();
}
-
void TestMPXVideoViewWrapper::testUpdateVideoRect()
{
init();
-
+
TRAPD(errReqMedia, mVideoViewWrapper->RequestMediaL());
QVERIFY( errReqMedia == KErrNone );
-
- mVideoViewWrapper->UpdateVideoRect(0,0,50,50,false);
-
- float brY = 50;
-
- QCOMPARE(mVideoViewWrapper->iDisplayHandler->iBrYDiff, brY);
-
+
+ TRect rect( 0, 0, 50, 50 );
+
+ mVideoViewWrapper->UpdateVideoRect(
+ rect.iTl.iX, rect.iTl.iY, rect.iBr.iX, rect.iBr.iY, false );
+
+ QVERIFY( rect == mVideoViewWrapper->iDisplayHandler->iRect );
+
cleanup();
}
void TestMPXVideoViewWrapper::testUpdateVideoRectDone()
{
init();
-
+
TRAPD(errReqMedia, mVideoViewWrapper->RequestMediaL());
QVERIFY( errReqMedia == KErrNone );
-
+
mVideoViewWrapper->UpdateVideoRectDone();
-
+
cleanup();
}
-
-
void TestMPXVideoViewWrapper::testHandleBufferingState()
{
init();
-
+
TRAPD(err, mVideoViewWrapper->HandleBufferingStateL());
QVERIFY( err == KErrNone );
-
+
cleanup();
}
-
void TestMPXVideoViewWrapper::testHandleVideoPlaybackMessage()
{
init();
CMPXMessage* message = NULL;
TRAP_IGNORE(
- message = CMPXMessage::NewL();
+ 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 );
+
+ mVideoViewWrapper->HandleVideoPlaybackMessage( message );
+
+ QCOMPARE( mVideoViewWrapper->iView->mCurrentError, KErrNotSupported );
if ( message )
{
delete message;
- message = NULL;
+ message = NULL;
}
-
+
cleanup();
}
-
-
-
-void TestMPXVideoViewWrapper::testCreateGeneralPlaybackCommand()
-{
- init();
-
- TRAPD(err, mVideoViewWrapper->CreateGeneralPlaybackCommandL( EPbCmdDecreaseVolume ));
- QVERIFY( err == KErrNone );
-
- QVERIFY( ! mVideoViewWrapper->iFileDetails->mAudioEnabled );
-
- cleanup();
-}
-
-
void TestMPXVideoViewWrapper::testHandlePlaybackCommandComplete()
{
init();
- CMPXCommand* cmd = NULL;
-
+ CMPXCommand* cmd = NULL;
+
TRAP_IGNORE( cmd = CMPXCommand::NewL() );
-
- mVideoViewWrapper->HandlePlaybackCommandComplete( cmd, KErrNone );
-
+
+ mVideoViewWrapper->HandlePlaybackCommandComplete( cmd, KErrNone );
+
QVERIFY( mVideoViewWrapper );
-
+
delete cmd;
- cmd = NULL;
-
+ cmd = NULL;
+
cleanup();
}
-
void TestMPXVideoViewWrapper::testHandleMedia()
{
init();
-
+
CMPXMedia* media = NULL;
-
+
+ //
+ // Error case
+ //
TRAP_IGNORE(
RArray<TInt> suppIds;
- CleanupClosePushL( 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 );
-
- media->SetTObjectValueL<TInt>( TMPXAttribute( KMPXMediaVideoError ),
- KErrCancel );
);
-
- TRAPD(err, mVideoViewWrapper->HandleMediaL( *media, KErrNone ) );
+
+ 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, KErrCancel );
+ 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;
+ 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 Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/hbvideobaseplaybackview.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 3 %
+// Version : %version: 5 %
@@ -76,6 +76,8 @@
virtual void doClosePlayer();
+ void handleStoppedState();
+
signals:
void tappedOnScreen();
@@ -85,6 +87,7 @@
public:
int mCurrentError; // default = KErrNone
bool mViewActive;
+ bool mSyncClose;
public:
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxplaybackutility.h Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,111 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of interface for playbackutility
+*
+*/
+
+// Version : %version: 2 %
+
+#ifndef CMPXPLAYBACKUTILITY_H
+#define CMPXPLAYBACKUTILITY_H
+
+#include <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/mpxplaybackutilityimpl.h Tue Jun 15 13:09:36 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,655 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of interface for playbackutility
-*
-*/
-
-
-
-#ifndef CMPXPLAYBACKUTILITY_H
-#define CMPXPLAYBACKUTILITY_H
-
-#include <e32base.h>
-#include <f32file.h>
-#include <mpxplaybackobserver.h>
-#include <mpxplaybackmessage.h>
-#include <mpxsession.h>
-#include <mpxmessageobserver.h>
-#include "mpxplaybackutility.h"
-
-class CMPXMessageMonitor;
-class CMPXTaskQueue;
-
-NONSHARABLE_STRUCT( TMPXPlaybackUtilityStruct )
- {
- // Default mode playback utility
- MMPXPlaybackUtility* iDefaultPlaybackUtility;
- };
-
-/**
-* Implementation of playback utility interface
-* this interface:
-*/
-NONSHARABLE_CLASS(CMPXPlaybackUtility) : public MMPXPlaybackUtility,
- public MMPXSource
- {
-public:
- /**
- * Two-phased constructor
- *
- * @param aModeId playback mode id
- * @param aObs observer
- * @param aCategory category of client / engine
- * @return object of constructed
- */
- static CMPXPlaybackUtility* NewL(const TUid& aModeId,
- MMPXPlaybackObserver* aObs,
- const TMPXCategory aCategory);
-
- /**
- * Gets the interface for the client, or creates a new one.
- * This interface could be a singleton
- */
- static MMPXPlaybackUtility* UtilityL( const TUid& aModeId,
- const TMPXCategory aCategory);
-
-private:
- /**
- * Destructor
- */
- ~CMPXPlaybackUtility();
-
- /**
- * C++ constructor
- */
- CMPXPlaybackUtility();
-
- /**
- * Second phase constructor
- *
- * @param aModeId playback mode id
- * @param aObs observer
- * @param aCategory category of client / engine
- */
- void ConstructL(const TUid& aModeId, MMPXPlaybackObserver* aObs, const TMPXCategory aCategory);
- /**
- * Second phase constructor
- *
- * @param aObs observer
- */
- void ConstructL(MMPXPlaybackObserver* aObs);
-
- /**
- * From MMPXPlaybackUtility
- * Add a Observer. Clients only receive events from the engine corresponding
- * to the specific mode the interface was created in
- *
- * @param aObs, observer to be added
- */
- void AddObserverL(MMPXPlaybackObserver& aObs);
-
- /**
- * From MMPXPlaybackUtility
- * Remove a observer.
- *
- * @param aObs, observer to be removed
- */
- void RemoveObserverL(MMPXPlaybackObserver& aObs);
-
- /**
- * From MMPXPlaybackUtility
- * Returns PIds of clients that are using the engine in the mode this
- * interface was created in. For example, if a client was interested in all
- * the clients' pids with an active engine, they would:
- *
- * MMPXPlaybackUtility* m=MMPXPlaybackUtility::NewL(EActivePlayer);
- * RArray<TProcessId> pids;
- * m->GetClients(pids);
- * .........
- * pids->Close();
- * m->Close();
- *
- * @param aClients Array of Pids returned.
- */
- void GetClientsL(RArray<TProcessId>& aClients);
-
- /**
- * From MMPXPlaybackUtility
- * Initializes a track given by aCollectionPath
- *
- * @param aCollectionPath collection path
- * @param aPlay Whether to initialize for playback, or
- * else just to setup the engine first
- */
- virtual void InitL(const CMPXCollectionPlaylist& aPlaylist,
- TBool aPlay=ETrue);
-
- /**
- * From MMPXPlaybackUtility
- * Inititialises with a single item, may not be part of any collection
- *
- * @param aUri URI of the item
- * @param aType the mime type of the item
- */
- void InitL(const TDesC& aUri,const TDesC8* aType=NULL);
-
- /**
- * From MMPXPlaybackUtility
- * Inititialises with a single item, may not be part of any collection
- * Before this function can be called, the file server session which owns
- * this file handle must first be marked as shareable by calling
- * RFs::ShareProtected().
- *
- * @param aFile file handle
- */
- void InitL(RFile& aShareableFile);
-
- /**
- * From MMPXPlaybackUtility
- * Frees up client side resources only; a player is freed when there are no
- * clients using it, and all resources are freed when the last client closed
- */
- void Close();
-
- /**
- * From MMPXPlaybackUtility
- * Stops any async operations that are currently under way
- */
- void CancelRequest();
-
- /**
- * From MMPXPlaybackUtility
- * Issue player commands, with optional data. ECommandReceived and
- * ECommandComplete events should follow
- *
- * @param aCmd the command
- * @param aData optional data
- */
- void CommandL(TMPXPlaybackCommand aCmd,TInt aData=0);
-
- /**
- * From MMPXPlaybackUtility
- * Send a command to the playback server
- *
- * @param aCmd, reference to command object
- * @param aCallback, call back when command exection completed.
- * Asynchronously command only
- */
- void CommandL(CMPXCommand& aCmd, MMPXPlaybackCallback* aCallback=NULL);
-
- /**
- * From MMPXPlaybackUtility
- * Current state of player
- * @return current state
- */
- TMPXPlaybackState StateL() const;
-
- /**
- * From MMPXPlaybackUtility
- * Current source being played, NULL if none was supplied
- *
- * @return source object
- */
- MMPXSource* Source();
-
- /**
- * From MMPXPlaybackUtility
- * Player manager
- *
- * @return reference to player manager
- */
- MMPXPlayerManager& PlayerManager();
-
- /**
- * From MMPXPlaybackUtility
- * Set playback property, EPropertyChanged event when complete
- *
- * @param aProperty the property to be set
- * @param aValue the the value of the property
- */
- void SetL(TMPXPlaybackProperty aProperty,TInt aValue);
-
- /**
- * From MMPXPlaybackUtility
- * Get value of a playback property, Asyc
- *
- * @param aCallback playback callback
- * @param aProperty the property
- */
- void ValueL(MMPXPlaybackCallback& aCallback,TMPXPlaybackProperty aProperty);
-
- /**
- * Get value of a playback property, Asyc
- * Result will be called back in HandleProperty
- *
- * @param aCallback playback callback
- * @param aProperty the property
- */
- void PropertyL(MMPXPlaybackCallback& aCallback,
- TMPXPlaybackProperty aProperty);
-
- /**
- * From MMPXPlaybackUtility
- * Return a list of mime types supported by playback framework
- *
- * @return an array of mime types
- */
- virtual CDesCArray* SupportedMimeTypes();
-
- /**
- * From MMPXPlaybackUtility
- * Return a list of file extensions supported by playback framework
- *
- * @return an array of extensions
- */
- virtual CDesCArray* SupportedExtensions();
-
- /**
- * From MMPXPlaybackUtility
- * Return a list of schemas supported by playback framework
- *
- * @return an array of schemas
- */
- virtual CDesCArray* SupportedSchemas();
-
- /**
- * Sets the priority of the playback utility
- *
- * @param aPriority Priority to set
- */
- virtual void SetPriority( TInt aPriority );
-
- /**
- * Adds a message subscription for this client.
- * @param aSubscription subscription to be added
- */
- void AddSubscriptionL(const CMPXSubscription& aSubscription);
-
- /**
- * Removes a message subscription for this client.
- * @param aSubscription subscription to be removed.
- */
- void RemoveSubscriptionL(const CMPXSubscription& aSubscription);
-
- /**
- * Removes all message subscriptions for this client.
- */
- void ClearSubscriptionsL();
-
- /**
- * From MMPXPlayerManager
- * Typically, a client will obtain the list of all the (non-duplicated)
- * player 'types' in the system from GetPlayerTypesL and present localized
- * type names (e.g. "Local","Home network", if possible, else if
- * non-standard type,should use PlayerTypeDisplayNameL to get text from
- * player).
- *
- * User should be given opportunity to choose IF there is more than one
- * type available, or if there is one type but more than one sub players,
- * the user could be presented with the sub player list.
- *
- * @param aTypes the list of player types
- */
- void GetPlayerTypesL(RArray<TMPXPlaybackPlayerType>& aTypes);
-
- /**
- * From MMPXPlayerManager
- * Returns display name for custom types; standard types should be
- * recognized by client and localized - calling this method would then not
- * be required
- *
- * @param aType playback type
- */
- HBufC* PlayerTypeDisplayNameL(TMPXPlaybackPlayerType aType);
-
- /**
- * From MMPXPlayerManager
- * Get the list of UIDs of all players
- *
- * @param aPlayers All the players' uids in the system
- */
- void GetPlayerListL(RArray<TUid>& aPlayers);
-
- /**
- * From MMPXPlayerManager
- * Get the list of UIDs of players with the specific type
- *
- * @param aPlayers All the players' uids with the same type
- * @param aType the type of players
- */
- void GetPlayerListL(RArray<TUid>& aPlayers,TMPXPlaybackPlayerType aType);
-
- /**
- * From MMPXPlayerManager
- * Get the list of sub player names, Async
- *
- * @param aCallback sub players returned in call back interface
- * @param aPlayer UID of the player
- */
- void SubPlayerNamesL(MMPXPlaybackCallback& aCallback,TUid aPlayer);
-
- /**
- * From MMPXPlayerManager
- * Client selects all players with the type aType, the specific player used
- * then being resolved on the basis of the content.
- *
- * @param aType the type of player
- */
- void SelectPlayersL(TMPXPlaybackPlayerType aType);
-
- /**
- * From MMPXPlayerManager
- * Client selects specific player aPlayer and sub player aSubPlayerIndex
- * from array returned by SubPlayerNamesL
- *
- * @param aPlayer the UID of player
- * @param aSubPlayerIndex the index of the sub player
- */
- void SelectSubPlayerL(TUid aPlayer,TInt aSubPlayerIndex);
-
- /**
- * From MMPXPlayerManager
- * Client selects a specific player
- *
- * @param aPlayer the UID of the player
- */
- void SelectPlayerL(TUid aPlayer);
-
- /**
- * From MMPXPlayerManager
- * Clears all selection criteria. Essentially the same as
- * SelectPlayersL(EPbLocal).
- */
- void ClearSelectPlayersL();
-
- /**
- * From MMPXPlayerManager
- * Retreives the current selection: KNullUid and KErrNotFound are possible
- * return values for aPlayer and aSubPlayerIndex respectively if none are
- * explicitly selected
- *
- * @param aType player type
- * @param aPlayer the UID of player
- * @param aSubPlayerIndex index of the subplayer
- * @param aSubPlayerName friendly name of the subplayer
- * Notes: Client owns the returned aSubPlayerName object.
- */
- void GetSelectionL(TMPXPlaybackPlayerType& aType,
- TUid& aPlayer,
- TInt& aSubPlayerIndex,
- HBufC*& aSubPlayerName);
-
- /**
- * From MMPXPlayerManager
- * The current player, may change with each item, NULL if none found
- *
- * @return object of current player
- */
- MMPXPlayer* CurrentPlayer();
-
- /**
- * From MMPXPlayer
- * The 'type' of the player. Built-in types are EPbLocal and EPbRemote, but
- * the plug-ins could extend this if they desire to be a different type
- * which can be selected by the user
- *
- * @return player type
- */
- TMPXPlaybackPlayerType TypeL();
-
- /**
- * From MMPXPlayer
- * If TypeL returns a value that is not known to the UI (and therefore
- * can't localize it),then TypeNameL can be used for unlocalized display
- * purposes.
- *
- * @return player name.
- */
- HBufC* TypeNameL();
-
- /**
- * From MMPXPlayer
- * If the player supports other 'players', else array count == 0.
- *
- * @param aCallback sub players returned in the callback
- */
- void SubPlayerNamesL(MMPXPlaybackCallback& aCallback);
-
- /**
- * From MMPXPlayer
- * Selected sub player index, corresponding to sub player names array.
- *
- * @return sub player index. KErrNotFound if none
- */
- TInt SubPlayerL() const;
-
- /**
- * From MMPXPlayer
- * The UID identifying this player
- *
- * @return UID of the player
- */
- TUid UidL() const;
-
- /**
- * From MMPXSource
- * Path to the collection, or NULL if not in any collection
- * Ownership transferred
- *
- * @return collection path
- */
- CMPXCollectionPlaylist* PlaylistL();
-
- /**
- * From MMPXSource
- * File passed in, or NULL if none passed in
- *
- * @return pointer to file handle
- */
- RFile* FileL();
-
- /**
- * From MMPXSource
- * URI of current item
- *
- * @return URI of the item
- */
- HBufC* UriL();
-
- /**
- * From MMPXSource
- *
- * DEPRECATED
- *
- * Media request
- * HandleMediaL of the callback
- *
- * @param aAttrs attributes requested
- * @param aCallback playback callback
- */
- void MediaL(const TArray<TMPXAttribute>& aAttrs,
- MMPXPlaybackCallback& aCallback);
-
- /**
- * From MMPXSource
- * Media request
- * HandleMediaL of the callback
- *
- * @param aAttrs attributes requested
- * @param aCallback playback callback
- * @param aSpecs, specifications for attributes
- */
- void MediaL(const TArray<TMPXAttribute>& aAttrs,
- MMPXPlaybackCallback& aCallback,
- CMPXAttributeSpecs* aSpecs);
-
-#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
- /**
- * From MMPXSource
- * File passed in, or NULL if none passed in
- *
- * @return pointer to file handle
- */
- RFile64* File64L();
-#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
-
- /**
- * From CActive
- * Handles an active object's request completion event
- */
- void RunL();
-
- /**
- * From CActive
- * Implements cancellation of an outstanding request.
- */
- void DoCancel();
-
- /**
- * From CActive
- * Handles a leave occurring in the request completion event handler RunL()
- *
- * @param aError error code
- */
- TInt RunError(TInt aError);
-
- /**
- * From MMPXMessageObserver
- * Message received
- * @param aMsgData message data
- * @param aError error code
- */
- void MessageReceived(TInt aMsgData, TInt aError);
-
- /**
- * Inititialises for streaming with URI and Access Point
- *
- * @since S60 9.2
- * @param aUri URI of the item
- * @param aType the mime type of the item
- * @param aAccessPoint the access point of the item
- */
- virtual void InitStreamingL(const TDesC& aUri, const TDesC8* aType, const TInt aAccessPoint);
-
- /**
- * Inititialises for streaming with URI and Access Point, the file may not be part of any collection
- * Before this function can be called, the file server session which owns
- * this file handle must first be marked as shareable by calling
- * RFs::ShareProtected().
- *
- * @since S60 9.2
- * @param aShareableFile shareable file handle
- * @param aAccessPoint the access point of the item
- */
- virtual void InitStreamingL(RFile& aShareableFile, const TInt aAccessPoint);
-
-#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
- /**
- * Inititialises with a single item, may not be part of any collection
- * Before this function can be called, the file server session which owns
- * this file handle must first be marked as shareable by calling
- * RFs::ShareProtected().
- *
- * @since S60 9.2
- * @param aShareableFile shareable RFile64 file handle
- */
- virtual void Init64L(RFile64& aShareableFile);
-
- /**
- * Inititialises for streaming with URI and Access Point, the file may not be part of any collection
- * Before this function can be called, the file server session which owns
- * this file handle must first be marked as shareable by calling
- * RFs::ShareProtected().
- *
- * @since S60 9.2
- * @param aShareableFile shareable RFile64 file handle
- * @param aAccessPoint the access point of the item
- */
- virtual void InitStreaming64L(RFile64& aShareableFile, const TInt aAccessPoint);
-#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
-
-private:
-
-
- /**
- * Helper to return a descriptor buffer
- *
- * @param aSize size of the buffer
- */
- HBufC* DesL(TInt aSize);
-
- /**
- * Add a request
- *
- * @param aFunction function code
- * @param aCallback callback
- * @param aParamData data
- * @param aBuf buffer data, ownership transferred
- * @param aPtr, pointer to a object
- * @param aAlivePtr1, object to keep alive for a task
- * ownership transferred
- * @leave leave with system error code when failed
- */
- void AddRequestL(TMPXPlaybackServerOp aFunction,
- MMPXPlaybackCallback* aCallback=NULL,
- TInt aParamData=0,
- CBufBase* aBuf=NULL,
- TAny* aPtr=NULL,
- CBase* aAlivePtr=NULL);
-
- /**
- * Send next request to server
- */
- void ExecuteNextRequest();
-
- /**
- * Handle message from message queue
- * @param aMsgData message data
- * @param aError error code
- */
- void HandleMessageL(TInt aMsgData, TInt aError);
-
- /**
- * Handles error in RunL
- *
- * @param aError error code
- */
- void HandleRunErrorL(TInt aError);
-
-
-public:
-
- TMPXPlaybackState iState;
-
- RArray<MMPXPlaybackObserver*> iObservers;
- CMPXMessageMonitor* iMsgMonitor;
- CMPXTaskQueue* iTaskQueue;
- RMPXSession iPbs;
- CBufBase* iBuffer;
- TPckgBuf<TInt> iPropertyValuePckg;
- TPckgBuf<TBool> iCompletePckg;
- TPckgBuf<TInt> iResultSizePckg;
- RFile iFile;
- TBool iCallbackOngoing; // whether client is processing callback or not
-#ifdef _ENABLE_GUARD_TIMER
- CPeriodic* iGuardTimer; // guard timer for async request
-#endif
- CMPXMedia* iMediaOnError; // media object while handling error
- TInt iRefCount;
-#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
- RFile64 iFile64;
-#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
- };
-
-#endif // CMPXPLAYBACKUTILITY_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackcontrol.hrh Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,117 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: header file of CMPXVideoPlaybackControl
+*
+*/
+
+// Version : %version: 1 %
+
+
+#ifndef MPXVIDEOPLAYBACKCONTROL_HRH_
+#define MPXVIDEOPLAYBACKCONTROL_HRH_
+
+// DATA TYPES
+const TInt KMPXVideoPlaybackVolumeMax = 10;
+
+enum TMPFXVideoPlaybackControlProperties
+{
+ EMPXShownWhenInitializing = 0x1,
+ EMPXShownWhenBuffering = 0x2,
+ EMPXShownWhenPlaying = 0x4,
+ EMPXShownWhenPaused = 0x8,
+ EMPXShownWhenSeeking = 0x10,
+ EMPXAllProperties = 0xffffffff
+};
+
+enum TMPXVideoPlaybackControls
+{
+ EMPXStatusPane,
+ EMPXControlBar,
+
+ // Only for streaming case
+ // Can handle from NotInitilized state
+ //
+ EMPXBufferingAnimation,
+
+ //
+ // For details view and audio only view
+ //
+ EMPXFileDetailsWidget,
+
+ //
+ // For details view
+ //
+ EMPXDetailsViewPlaybackWindow,
+
+ //
+ // Bitmaps
+ //
+ EMPXIndicatorBitmap,
+ EMPXRealLogoBitmap,
+
+ EMPXDownloadPausedIcon,
+
+ EMPXControlsCount // has to be last
+};
+
+/** Command ID's. */
+enum TMPXVideoPlaybackControlCommandIds
+{
+ EMPXControlCmdPluginInitialized,
+ EMPXControlCmdTvOutConnected,
+ EMPXControlCmdTvOutDisconnected,
+ EMPXControlCmdSetAspectRatio,
+ EMPXControlCmdSetVolume,
+ EMPXControlCmdSetDuration,
+ EMPXControlCmdSetPosition,
+ EMPXControlCmdStateChanged,
+ EMPXControlCmdDownloadUpdated,
+ EMPXControlCmdSetDownloadSize,
+ EMPXControlCmdDownloadComplete,
+ EMPXControlCmdSetDownloadPaused,
+ EMPXControlCmdClearDownloadPaused,
+ EMPXControlCmdHandleBackgroundEvent,
+ EMPXControlCmdHandleForegroundEvent,
+ EMPXControlCmdHandleErrors,
+ EMPXControlCmdShowVolumeControls,
+ EMPXControlCmdSoftKeyPressed,
+ EMPXControlCmdFullScreenViewOpened,
+ EMPXControlCmdDetailsViewOpened,
+ EMPXControlCmdAudionOnlyViewOpened,
+ EMPXControlCmdRemoveRNLogo
+};
+
+enum TMPXVideoSeekingType
+{
+ EMpxVideoSeekingForward,
+ EMpxVideoSeekingBackward,
+ EMpxVideoSeekingStop
+};
+
+enum TMPXVideoControlType
+{
+ EMpxVideoPlaybackContainer,
+ EMpxVideoPlaybackControl
+};
+
+enum TMPXVideoUserInputType
+{
+ EMpxVideoKeyboard,
+ EMpxVideoTouch,
+ EMpxVideoMediaKeys,
+ EMpxVideoSpecialHWKeys,
+ EMpxVideoNone
+};
+
+#endif /*MPXVIDEOPLAYBACKCONTROL_HRH_*/
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackcontrolscontroller.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackcontrolscontroller.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 6 %
+// Version : %version: 7 %
@@ -72,30 +72,17 @@
//
void updateVideoRectDone();
- public:
-
- /**
- * Initialize controller
- */
- void initializeController();
-
- /**
- * Handle tvout connected/disconnected event
- */
- void handleTvOutEvent( bool connected,
- TMPXVideoPlaybackControlCommandIds event,
- int value );
-
- private slots:
-
- void handleTappedOnScreen();
+ bool isRNLogoBitmapInControlList();
public:
HbVideoBasePlaybackView *mView;
CMPXVideoViewWrapper *mViewWrapper;
QMPXVideoPlaybackViewFileDetails *mFileDetails;
+ TMPXVideoPlaybackControlCommandIds mReceivedEvent;
- bool mViewTransitionIsGoingOn;
+ int mValue;
+ bool mRNLogoVisible;
+ bool mFileDetailsAdded;
};
#endif /*MPXVIDEOPLAYBACKCONTROLSCONTROLLER_P_H_*/
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackdisplayhandler.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackdisplayhandler.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 4 %
+// Version : %version: 6 %
#ifndef __CMPXVIDEOPLAYBACKDISPLAYHANDLER_H__
@@ -26,11 +26,7 @@
#include <mpxmessage2.h>
#include <mmfscalingcustomcommandconstants.h>
#include <mpxvideoplaybackdefs.h>
-#ifdef SYMBIAN_BUILD_GCE
#include <mediaclientvideodisplay.h>
-#else
-#include <w32std.h>
-#endif
//
@@ -45,20 +41,7 @@
*
*/
class CMPXVideoPlaybackDisplayHandler : public CBase
-#ifndef SYMBIAN_BUILD_GCE
- , public MDirectScreenAccess
-#endif
{
- //
- // To save user's preference for scaling type in video ratio + screen ratio
- //
- typedef struct
- {
- TReal32 videoRatio;
- TReal32 screenRatio;
- TMMFScalingType scalingType;
- } TMPXAspectRatio ;
-
public:
~CMPXVideoPlaybackDisplayHandler();
@@ -80,7 +63,7 @@
TInt SetDefaultAspectRatioL( QMPXVideoPlaybackViewFileDetails* aFileDetails,
TReal32 aDisplayAspectRatio );
- void UpdateVideoRectL( TRect aRect, TBool transitionEffect );
+ void UpdateVideoRectL( TRect aRect, TBool transitionEffect );
private:
@@ -88,86 +71,15 @@
CMPXVideoViewWrapper* aViewWrapper );
void ConstructL();
-
- void LoadAspectRatioL();
-
- void SaveAspectRatioL();
-
- void SetVideoRectL( TRect aClipRect );
-
- void CalculateVideoRectL();
-
- static TInt UpdateVideoRectTimeOutL( TAny* aPtr );
-
-#ifdef SYMBIAN_BUILD_GCE
-
- private:
- void AddDisplayWindowL( CWsScreenDevice& aScreenDevice,
- RWindowBase& aWindowBase,
- RWindow* aWin );
-
- void SurfaceCreatedL( CMPXMessage* aMessage );
- void SurfaceChangedL( CMPXMessage* aMessage );
- void SurfaceRemoved();
- TInt SetNgaAspectRatioL( TMPXVideoPlaybackCommand aCmd );
-
-#else
-
- private:
- //
- // MDirectScreenAccess Implementation
- //
- void AbortNow( RDirectScreenAccess::TTerminationReasons aReason );
- void Restart( RDirectScreenAccess::TTerminationReasons aReason );
-
- TInt CreateAspectRatioCommandL( TMPXVideoPlaybackCommand aCmd );
-
- void SetDisplayWindowL( RWsSession& aWs,
- CWsScreenDevice& aScreenDevice,
- RWindowBase& aWin,
- TRect aClipRect );
- void RestartDsaL();
- void CreateAbortDsaCmdL();
-
-#endif
public:
MMPXPlaybackUtility* iPlaybackUtility;
-
- RArray<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
-
+ TRect iRect;
+ TInt iAspectRatio;
+ TInt iCommand;
};
#endif // __CMPXVIDEOPLAYBACKDISPLAYHANDLER_H__
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackviewfiledetails.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackviewfiledetails.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 4 %
+// Version : %version: 5 %
@@ -70,7 +70,6 @@
bool mPartialPlayback;
bool mRNFormat;
bool mTvOutConnected;
- bool mTvOutPlayAllowed;
bool mDrmProtected;
bool mMultiItemPlaylist;
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/hbvideobaseplaybackview.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/hbvideobaseplaybackview.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 5 %
+// Version : %version: 7 %
@@ -38,6 +38,7 @@
{
mCurrentError = KErrNone;
mViewActive = false;
+ mSyncClose = false;
}
// -------------------------------------------------------------------------------------------------
@@ -198,4 +199,13 @@
{
}
+// -------------------------------------------------------------------------------------------------
+// HbVideoBasePlaybackView::handleStoppedState()
+// -------------------------------------------------------------------------------------------------
+//
+void HbVideoBasePlaybackView::handleStoppedState()
+{
+
+}
+
// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxplaybackutility.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxplaybackutility.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -15,50 +15,198 @@
*
*/
+#include <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"mpxplaybackutilityimpl.h"
+#include"mpxplaybackutility.h"
-// ============================== MEMBER FUNCTIONS ============================
+// ============================== MEMBER FUNCTIONS =================================================
+
+// -------------------------------------------------------------------------------------------------
+// Creates the playback utility object if not already created
+// -------------------------------------------------------------------------------------------------
+//
+MMPXPlaybackUtility* MMPXPlaybackUtility::UtilityL( const TMPXCategory /*aCategory*/,
+ const TUid& /*aModeId*/ )
+{
+ return CMPXPlaybackUtility::NewL();
+}
-// ----------------------------------------------------------------------------
-// Create the playback utility object
-// ----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
+// Two phases constructor
+// -------------------------------------------------------------------------------------------------
+//
+CMPXPlaybackUtility* CMPXPlaybackUtility::NewL()
+{
+ CMPXPlaybackUtility* p = new(ELeave)CMPXPlaybackUtility();
+ CleanupStack::PushL(p);
+ p->ConstructL();
+ CleanupStack::Pop(p);
+ return p;
+}
+
+// -------------------------------------------------------------------------------------------------
+// Destructor
+// -------------------------------------------------------------------------------------------------
+//
+CMPXPlaybackUtility::~CMPXPlaybackUtility()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// C++ constructor
+// Create a unique name out of thread ID and this pointer: no other instance of
+// this object will have the same name; used to identify this object for
+// recieving messages
+// -------------------------------------------------------------------------------------------------
+//
+CMPXPlaybackUtility::CMPXPlaybackUtility()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// 2nd construtor
+// -------------------------------------------------------------------------------------------------
//
-EXPORT_C MMPXPlaybackUtility* MMPXPlaybackUtility::NewL(const TUid& aModeId,
- MMPXPlaybackObserver* aObs)
- {
- return CMPXPlaybackUtility::NewL(aModeId,aObs, EMPXCategoryMusic);
- }
+void CMPXPlaybackUtility::ConstructL()
+{
+ iState = EPbStateInitialised;
+}
+
+// -------------------------------------------------------------------------------------------------
+// Add a observer
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXPlaybackUtility::AddObserverL( MMPXPlaybackObserver& /*aObs*/ )
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// Remove a observer
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXPlaybackUtility::RemoveObserverL( MMPXPlaybackObserver& /* aObs */ )
+{
+}
-// ----------------------------------------------------------------------------
-// Create the playback utility object
-// ----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
+// Delete this
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXPlaybackUtility::Close()
+{
+ delete this;
+}
+
+// -------------------------------------------------------------------------------------------------
+// Issue player commands
+// -------------------------------------------------------------------------------------------------
//
+void CMPXPlaybackUtility::CommandL( TMPXPlaybackCommand aCmd )
+{
+ iCommand = aCmd;
+}
-EXPORT_C MMPXPlaybackUtility* MMPXPlaybackUtility::NewL(const TMPXCategory aCategory,
- const TUid& aModeId,
- MMPXPlaybackObserver* aObs)
+// -------------------------------------------------------------------------------------------------
+// Issue player commands
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXPlaybackUtility::CommandL( CMPXCommand& aCmd, MMPXPlaybackCallback* /* aCallback */ )
+{
+ TInt cmdType = aCmd.ValueTObjectL<TInt>( KMPXCommandGeneralId );
+
+ if ( cmdType == KMPXCommandIdPlaybackGeneral )
{
- return CMPXPlaybackUtility::NewL(aModeId,aObs,aCategory);
+ iCommand = aCmd.ValueTObjectL<TInt>( KMPXCommandPlaybackGeneralType );
}
-
-// ----------------------------------------------------------------------------
-// Creates the playback utility object if not already created
-// ----------------------------------------------------------------------------
-//
-EXPORT_C MMPXPlaybackUtility* MMPXPlaybackUtility::UtilityL( const TUid& aModeId )
+ else
{
- return CMPXPlaybackUtility::UtilityL( aModeId, EMPXCategoryMusic );
+ iCommand = aCmd.ValueTObjectL<TInt>( KMPXMediaVideoPlaybackCommand );
}
-
-// ----------------------------------------------------------------------------
-// Creates the playback utility object if not already created
-// ----------------------------------------------------------------------------
+}
+
+// -------------------------------------------------------------------------------------------------
+// Current state of player
+// -------------------------------------------------------------------------------------------------
//
+TMPXPlaybackState CMPXPlaybackUtility::StateL() const
+{
+ return iState;
+}
+
+// -------------------------------------------------------------------------------------------------
+// Determine whether there is a song by the state of the engine: if there is,
+// its OK to return MMPXMedia, else NULL is returned
+// -------------------------------------------------------------------------------------------------
+//
+MMPXSource* CMPXPlaybackUtility::Source()
+{
+ return NULL;
+}
+
+// -------------------------------------------------------------------------------------------------
+// Set playback property, EPropertyChanged event when complete
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXPlaybackUtility::SetL( TMPXPlaybackProperty aProperty, TInt aValue )
+{
+ iProperty = aProperty;
+ iPropertyValue = aValue;
+}
-EXPORT_C MMPXPlaybackUtility* MMPXPlaybackUtility::UtilityL(const TMPXCategory aCategory,
- const TUid& aModeId )
- {
- return CMPXPlaybackUtility::UtilityL( aModeId, aCategory );
- }
+// -------------------------------------------------------------------------------------------------
+// Send property request
+// Result will be called back in HandleProperty
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXPlaybackUtility::PropertyL(
+ MMPXPlaybackCallback& /* aCallback */,
+ TMPXPlaybackProperty /* aProperty */)
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// Path to the collection
+// -------------------------------------------------------------------------------------------------
+//
+CMPXCollectionPlaylist* CMPXPlaybackUtility::PlaylistL()
+{
+ CMPXCollectionPlaylist *p = NULL;
+
+ return p;
+}
+
+// -------------------------------------------------------------------------------------------------
+// Request for media properties.
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXPlaybackUtility::MediaL(
+ const TArray<TMPXAttribute>& /* aAttrs */,
+ MMPXPlaybackCallback& /* aCallback */,
+ CMPXAttributeSpecs* /* aSpecs */)
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// set primary client
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXPlaybackUtility::SetPrimaryClientL()
+{
+}
+
+// End of file
+
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxplaybackutilityimpl.cpp Tue Jun 15 13:09:36 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,721 +0,0 @@
-/*
-* Copyright (c) 2006 - 2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Playback Utility implementation
-*
-*/
-
-// Version : %version: %
-
-#include <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 <mpxplaybackcommanddefs.h>
-#include <mpxsubscription.h>
-#include <mpxlog.h>
-
-#include "mpxplaybackutilityimpl.h"
-
-// ============================== MEMBER FUNCTIONS ============================
-
-// ---------------------------------------------------------------------------
-// Retrieves playback utility from TLS. Creates if it's not there.
-// ---------------------------------------------------------------------------
-//
-MMPXPlaybackUtility* CMPXPlaybackUtility::UtilityL(
- const TUid& aModeId,
- const TMPXCategory aCategory)
- {
- MMPXPlaybackUtility* utility( NULL );
-
- utility = CMPXPlaybackUtility::NewL( aModeId, NULL, aCategory );
-
- return utility;
- }
-
-// ----------------------------------------------------------------------------
-// Two phases constructor
-// ----------------------------------------------------------------------------
-//
-CMPXPlaybackUtility* CMPXPlaybackUtility::NewL(const TUid& aModeId,
- MMPXPlaybackObserver* aObs,
- const TMPXCategory aCategory)
- {
- CMPXPlaybackUtility* p=new(ELeave)CMPXPlaybackUtility();
- CleanupStack::PushL(p);
- p->ConstructL(aModeId,aObs,aCategory);
- CleanupStack::Pop(p);
- return p;
- }
-
-// ----------------------------------------------------------------------------
-// Destructor
-// ----------------------------------------------------------------------------
-//
-CMPXPlaybackUtility::~CMPXPlaybackUtility()
- {
- iObservers.Close();
- }
-
-// ----------------------------------------------------------------------------
-// C++ constructor
-// Create a unique name out of thread ID and this pointer: no other instance of
-// this object will have the same name; used to identify this object for
-// recieving messages
-// ----------------------------------------------------------------------------
-//
-CMPXPlaybackUtility::CMPXPlaybackUtility()
- : iCallbackOngoing(EFalse)
- {
- }
-
-// ----------------------------------------------------------------------------
-// 2nd construtor
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::ConstructL(const TUid& /* aModeId */,
- MMPXPlaybackObserver* /* aObs */,
- const TMPXCategory /* aCategory */)
- {
- iState = EPbStateInitialised;
- }
-
-// ----------------------------------------------------------------------------
-// Add a observer
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::AddObserverL(MMPXPlaybackObserver& aObs)
- {
- iObservers.AppendL(&aObs);
- }
-
-// ----------------------------------------------------------------------------
-// Remove a observer
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::RemoveObserverL(MMPXPlaybackObserver& /* aObs */)
- {
-
- }
-
-// ----------------------------------------------------------------------------
-// Returns PIds of clients that are using the engine in the mode
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::GetClientsL(RArray<TProcessId>& /* aClients */)
- {
-
- }
-
-// ----------------------------------------------------------------------------
-// Initializes a track given by aIndex in path aCollectionPath
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::InitL(
- const CMPXCollectionPlaylist& /* aPlaylist */,
- TBool /*aPlay */ )
- {
-
- }
-
-// ----------------------------------------------------------------------------
-// Inititialises with a single song, may not be part of any collection
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::InitL(const TDesC& /* aUri */, const TDesC8* /* aType */ )
- {
-
- }
-
-// ----------------------------------------------------------------------------
-// Inititialises with a single song, may not be part of any collection
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::InitL(RFile& /* aShareableFile */)
- {
-
- }
-
-// ----------------------------------------------------------------------------
-// Inititialises with a URI
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::InitStreamingL(const TDesC& /* aUri */, const TDesC8* /* aType */, const TInt /* aAccessPoint */)
-{
-
-}
-
-
-// ----------------------------------------------------------------------------
-// Inititialises with a file, may not be part of any collection
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::InitStreamingL(RFile& /* aShareableFile */, const TInt /* aAccessPoint */)
-{
-
-}
-
-// ----------------------------------------------------------------------------
-// Frees up client side resources only; a player is freed when there are no
-// clients using it, and all resources are freed when the last client closed
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::Close()
- {
-
- }
-
-// ----------------------------------------------------------------------------
-// Stops any async operations that are currently under way
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::CancelRequest()
- {
-
- }
-
-// ----------------------------------------------------------------------------
-// Issue player commands, with optional data.
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::CommandL(TMPXPlaybackCommand /* aCmd */, TInt /* aData */)
- {
-
- }
-
-// ----------------------------------------------------------------------------
-// Issue player commands
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::CommandL(
- CMPXCommand& aCmd,
- MMPXPlaybackCallback* /* aCallback */)
- {
- TMPXPlaybackCommand cmdType = static_cast<TMPXPlaybackCommand>(
- aCmd.ValueTObjectL<TInt>(KMPXCommandPlaybackGeneralType));
-
- switch ( cmdType )
- {
- case EPbCmdPlay:
- {
- iState = EPbStatePlaying;
- break;
- }
- case EPbCmdDecreaseVolume:
- {
- CMPXMessage* message = CMPXMessage::NewL();
- message->SetTObjectValueL<TMPXMessageId>( KMPXMessageGeneralId, KMPXMessageGeneral );
- message->SetTObjectValueL<TInt>( KMPXMessageGeneralEvent, TMPXPlaybackMessage::EPropertyChanged );
- message->SetTObjectValueL<TInt>( KMPXMessageGeneralType, EPbPropertyVolume );
- message->SetTObjectValueL<TInt>( KMPXMessageGeneralData, 0 );
- iObservers[0]->HandlePlaybackMessage( message, KErrNone );
- }
- }
- }
-
-// ----------------------------------------------------------------------------
-// Current state of player
-// ----------------------------------------------------------------------------
-//
-TMPXPlaybackState CMPXPlaybackUtility::StateL() const
- {
- return iState;
- }
-
-// ----------------------------------------------------------------------------
-// Determine whether there is a song by the state of the engine: if there is,
-// its OK to return MMPXMedia, else NULL is returned
-// ----------------------------------------------------------------------------
-//
-MMPXSource* CMPXPlaybackUtility::Source()
- {
- return this;
- }
-
-// ----------------------------------------------------------------------------
-// Get player manager
-// ----------------------------------------------------------------------------
-//
-MMPXPlayerManager& CMPXPlaybackUtility::PlayerManager()
- {
- }
-
-// ----------------------------------------------------------------------------
-// Set playback property, EPropertyChanged event when complete
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::SetL(TMPXPlaybackProperty aProperty,TInt /* aValue */ )
- {
- if ( aProperty == EPbPropertyMute )
- {
- CMPXMessage* message = CMPXMessage::NewL();
- message->SetTObjectValueL<TMPXMessageId>( KMPXMessageGeneralId, KMPXMessageGeneral );
- message->SetTObjectValueL<TInt>( KMPXMessageGeneralEvent, TMPXPlaybackMessage::EPropertyChanged );
- message->SetTObjectValueL<TInt>( KMPXMessageGeneralType, 0 );
- message->SetTObjectValueL<TInt>( KMPXMessageGeneralData, 0 );
- iObservers[0]->HandlePlaybackMessage( message, KErrNone );
- }
- else if ( aProperty == EPbPropertyPosition )
- {
- CMPXMessage* message = CMPXMessage::NewL();
- message->SetTObjectValueL<TMPXMessageId>( KMPXMessageGeneralId, KMPXMessageGeneral );
- message->SetTObjectValueL<TInt>( KMPXMessageGeneralEvent, TMPXPlaybackMessage::EPropertyChanged );
- message->SetTObjectValueL<TInt>( KMPXMessageGeneralType, EPbPropertyPosition );
- message->SetTObjectValueL<TInt>( KMPXMessageGeneralData, 50 );
- iObservers[0]->HandlePlaybackMessage( message, KErrNone );
- }
- }
-
-// ----------------------------------------------------------------------------
-// Send property request
-// Result will be called back in HandleProperty
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::ValueL(MMPXPlaybackCallback& /* aCallback */,
- TMPXPlaybackProperty /* aProperty */)
- {
-
- }
-
-// ----------------------------------------------------------------------------
-// Send property request
-// Result will be called back in HandleProperty
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::PropertyL(
- MMPXPlaybackCallback& /* aCallback */,
- TMPXPlaybackProperty /* aProperty */)
- {
-
- }
-
-// ----------------------------------------------------------------------------
-// Return a list of mime types supported by playback framework
-// ----------------------------------------------------------------------------
-//
-CDesCArray* CMPXPlaybackUtility::SupportedMimeTypes()
- {
- CDesCArray* desArray = NULL;
-
- return desArray;
- }
-
-// ----------------------------------------------------------------------------
-// Return a list of mime types supported by playback framework
-// ----------------------------------------------------------------------------
-//
-CDesCArray* CMPXPlaybackUtility::SupportedExtensions()
- {
- CDesCArray* desArray = NULL;
-
- return desArray;
- }
-
-// ----------------------------------------------------------------------------
-// Return a list of mime types supported by playback framework
-// ----------------------------------------------------------------------------
-//
-CDesCArray* CMPXPlaybackUtility::SupportedSchemas()
- {
- CDesCArray* desArray = NULL;
-
- return desArray;
- }
-
-// ----------------------------------------------------------------------------
-// Sets the priority of the playback utility
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::SetPriority( TInt /* aPriority */ )
- {
-
- }
-
-
-// ----------------------------------------------------------------------------
-// CMPXPlaybackUtility::AddSubscriptionL
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::AddSubscriptionL(
- const CMPXSubscription& /* aSubscription */)
- {
-
- }
-
-// ----------------------------------------------------------------------------
-// CMPXPlaybackUtility::RemoveSubscriptionL
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::RemoveSubscriptionL(
- const CMPXSubscription& /* aSubscription */ )
- {
-
- }
-
-// ----------------------------------------------------------------------------
-// CMPXPlaybackUtility::ClearSubscriptionsL
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::ClearSubscriptionsL()
- {
-
- }
-// ----------------------------------------------------------------------------
-// Get a list of player types
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::GetPlayerTypesL(
- RArray<TMPXPlaybackPlayerType>& /* aTypes */ )
- {
-
- }
-
-// ----------------------------------------------------------------------------
-// Returns display name for custom types
-// ----------------------------------------------------------------------------
-//
-HBufC* CMPXPlaybackUtility::PlayerTypeDisplayNameL(TMPXPlaybackPlayerType /* aType */ )
- {
- HBufC* buf=NULL;
- return buf;
- }
-
-// ----------------------------------------------------------------------------
-// Get the list of UIDs of all players
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::GetPlayerListL(RArray<TUid>& /* aPlayers */)
- {
-
- }
-
-// ----------------------------------------------------------------------------
-// Get the list of UIDs of players with the specific type
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::GetPlayerListL(RArray<TUid>& /* aPlayers */,
- TMPXPlaybackPlayerType /* aType */)
- {
-
- }
-
-// ----------------------------------------------------------------------------
-// Asynchronous method: when server completes message, RunL() will be called
-// and then the observer is notified of the results. Data required for the
-// results that is not supplied by the server is stored; data supplied by the
-// server is written back into packaged descriptors in this address space
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::SubPlayerNamesL(MMPXPlaybackCallback& /* aCallback */,
- TUid /* aPlayer */)
- {
-
- }
-
-// ----------------------------------------------------------------------------
-// Selects all players with the type
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::SelectPlayersL(TMPXPlaybackPlayerType /* aType */)
- {
-
- }
-
-// ----------------------------------------------------------------------------
-// Selects a specific player
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::SelectPlayerL(TUid /* aPlayer */ )
- {
-
- }
-
-// ----------------------------------------------------------------------------
-// Selects a specific player and sub player
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::SelectSubPlayerL(TUid /* aPlayer */, TInt /* aSubPlayerIndex */)
- {
-
- }
-
-// ----------------------------------------------------------------------------
-// Clears all selection criteria.
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::ClearSelectPlayersL()
- {
-
- }
-
-// ----------------------------------------------------------------------------
-// Retreives the current selection
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::GetSelectionL(TMPXPlaybackPlayerType& /* aType */,
- TUid& /* aPlayer */,
- TInt& /* aSubPlayerIndex */,
- HBufC*& /* aSubPlayerName */)
- {
-
- }
-
-// ----------------------------------------------------------------------------
-// The current player
-// ----------------------------------------------------------------------------
-//
-MMPXPlayer* CMPXPlaybackUtility::CurrentPlayer()
- {
- return NULL;
- }
-
-// ----------------------------------------------------------------------------
-// The 'type' of the player
-// ----------------------------------------------------------------------------
-//
-TMPXPlaybackPlayerType CMPXPlaybackUtility::TypeL()
- {
- MPX_FUNC_EX("CMPXPlaybackUtility::TypeL()");
- return EPbLocal;
- }
-
-// ----------------------------------------------------------------------------
-// The name of player type
-// ----------------------------------------------------------------------------
-//
-HBufC* CMPXPlaybackUtility::TypeNameL()
- {
- HBufC* buf=NULL;
- return buf;
- }
-
-// ----------------------------------------------------------------------------
-// Get sub players
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::SubPlayerNamesL(MMPXPlaybackCallback& aCallback)
- {
- MPX_FUNC_EX("CMPXPlaybackUtility::SubPlayerNamesL()");
- SubPlayerNamesL(aCallback,UidL());
- }
-
-// ----------------------------------------------------------------------------
-// Selected sub player index
-// ----------------------------------------------------------------------------
-//
-TInt CMPXPlaybackUtility::SubPlayerL() const
- {
- return 0;
- }
-
-// ----------------------------------------------------------------------------
-// The UID identifying this player
-// ----------------------------------------------------------------------------
-//
-TUid CMPXPlaybackUtility::UidL() const
- {
- }
-
-// ----------------------------------------------------------------------------
-// Path to the collection
-// ----------------------------------------------------------------------------
-//
-CMPXCollectionPlaylist* CMPXPlaybackUtility::PlaylistL()
- {
- MPX_FUNC_EX("CMPXPlaybackUtility::PlaylistL()");
- CMPXCollectionPlaylist *p = NULL;
-
- return p;
- }
-
-// ----------------------------------------------------------------------------
-// Return file handle
-// ----------------------------------------------------------------------------
-//
-RFile* CMPXPlaybackUtility::FileL()
- {
- RFile* file(NULL);
- return file;
- }
-
-// ----------------------------------------------------------------------------
-// URI of current song
-// ----------------------------------------------------------------------------
-//
-HBufC* CMPXPlaybackUtility::UriL()
- {
- HBufC* buf=NULL;
- return buf;
- }
-
-// ----------------------------------------------------------------------------
-// Request for media properties.
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::MediaL(
- const TArray<TMPXAttribute>& aAttrs,
- MMPXPlaybackCallback& aCallback)
- {
- MediaL( aAttrs, aCallback, NULL );
- }
-
-// ----------------------------------------------------------------------------
-// Request for media properties.
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::MediaL(
- const TArray<TMPXAttribute>& /* aAttrs */,
- MMPXPlaybackCallback& /* aCallback */,
- CMPXAttributeSpecs* /* aSpecs */)
- {
-
- }
-
-// ----------------------------------------------------------------------------
-// Server has completed the message, and if there's no error, the results are
-// available. The server completes with the function id (or error) so the correct
-// callback is made
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::RunL()
- {
-
- }
-
-// ----------------------------------------------------------------------------
-// Canceling by the server
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::DoCancel()
- {
-
- }
-
-// ----------------------------------------------------------------------------
-// Sends error message to all observers - maybe it should only be to the
-// client that calls the async method
-// ----------------------------------------------------------------------------
-//
-TInt CMPXPlaybackUtility::RunError(TInt /* aError */)
- {
- return KErrNone;
- }
-
-// ----------------------------------------------------------------------------
-// Distributes messages to all observers
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::MessageReceived(TInt /* aMsgData */, TInt /* aError */)
- {
-
- }
-
-// ----------------------------------------------------------------------------
-// Distributes messages to all observers
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::HandleMessageL(TInt /* aMsgData */, TInt /* aError */)
- {
-
- }
-
-// ----------------------------------------------------------------------------
-// Handle error in RunL
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::HandleRunErrorL(TInt /* aError */)
- {
-
- }
-
-
-// ----------------------------------------------------------------------------
-// Read a buffer from server
-// ----------------------------------------------------------------------------
-//
-HBufC* CMPXPlaybackUtility::DesL(TInt /* aSize */)
- {
- HBufC* des=NULL;
-
- return des;
- }
-
-// ----------------------------------------------------------------------------
-// Adds a sync request to the queue: if there is no outstanding request,
-// it will be executed immediately
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::AddRequestL(TMPXPlaybackServerOp /*aFunction */,
- MMPXPlaybackCallback* /* aCallback */,
- TInt /* aParamData */,
- CBufBase* /* aBuf */,
- TAny* /* aPtr */,
- CBase* /* aAlivePtr */)
- {
-
- }
-
-// ----------------------------------------------------------------------------
-// Executes the next request in the queue.
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::ExecuteNextRequest()
- {
-
- }
-
-
-
-#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
-// ----------------------------------------------------------------------------
-// Inititialises with a single song, may not be part of any collection
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::Init64L(RFile64& /* aShareableFile */)
- {
-
- }
-
-// ----------------------------------------------------------------------------
-// Inititialises with a file, may not be part of any collection
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::InitStreaming64L(RFile64& /* aShareableFile */, const TInt /* aAccessPoint */)
- {
-
- }
-
-// ----------------------------------------------------------------------------
-// Return file handle
-// ----------------------------------------------------------------------------
-//
-RFile64* CMPXPlaybackUtility::File64L()
- {
- RFile64* file(NULL);
-
- return file;
- }
-
-#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxvideoplaybackcontrolscontroller.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxvideoplaybackcontrolscontroller.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 7 %
+// Version : %version: 8 %
@@ -39,18 +39,9 @@
QMPXVideoPlaybackViewFileDetails *details )
: mView( view )
, mViewWrapper( viewWrapper )
- , mFileDetails( details )
+ , mFileDetails( details )
+ , mFileDetailsAdded( false )
{
- initializeController();
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::initializeController()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::initializeController()
-{
- connect( mView, SIGNAL( tappedOnScreen() ), this, SLOT( handleTappedOnScreen() ) );
}
// -------------------------------------------------------------------------------------------------
@@ -61,6 +52,8 @@
QMPXVideoPlaybackViewFileDetails* details )
{
Q_UNUSED( details );
+
+ mFileDetailsAdded = true;
}
// -------------------------------------------------------------------------------------------------
@@ -70,9 +63,6 @@
QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController()
{
MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController"));
-
- disconnect( mView, SIGNAL( tappedOnScreen() ), this, SLOT( handleTappedOnScreen() ) );
-
}
// -------------------------------------------------------------------------------------------------
@@ -82,51 +72,8 @@
void QMPXVideoPlaybackControlsController::handleEvent(
TMPXVideoPlaybackControlCommandIds event, int value )
{
- switch ( event )
- {
- case EMPXControlCmdTvOutConnected:
- {
- handleTvOutEvent( true, event, value );
- break;
- }
- case EMPXControlCmdTvOutDisconnected:
- {
- handleTvOutEvent( false, event, value );
- break;
- }
- case EMPXControlCmdSetVolume:
- {
- mFileDetails->mAudioEnabled = false;
- break;
- }
- case EMPXControlCmdSetDuration:
- {
- mFileDetails->mDuration = value;
- break;
- }
- case EMPXControlCmdShowVolumeControls:
- {
- mFileDetails->mAudioEnabled = true;
- break;
- }
- case EMPXControlCmdSetPosition:
- {
- mFileDetails->mSeekable = true;
- break;
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::handleTvOutEvent
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::handleTvOutEvent(
- bool connected, TMPXVideoPlaybackControlCommandIds event, int value )
-{
- Q_UNUSED( event );
- Q_UNUSED( value );
- mFileDetails->mTvOutConnected = connected;
+ mReceivedEvent = event;
+ mValue = value;
}
// -------------------------------------------------------------------------------------------------
@@ -135,16 +82,15 @@
//
void QMPXVideoPlaybackControlsController::updateVideoRectDone()
{
- mViewTransitionIsGoingOn = false;
}
// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::handleTappedOnScreen()
+// QMPXVideoPlaybackControlsController::isRNLogoBitmapVisible()
// -------------------------------------------------------------------------------------------------
//
-void QMPXVideoPlaybackControlsController::handleTappedOnScreen()
-
+bool QMPXVideoPlaybackControlsController::isRNLogoBitmapInControlList()
{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::handleTappedOnScreen"));
+ return mRNLogoVisible;
}
+
// End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxvideoplaybackdisplayhandler.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxvideoplaybackdisplayhandler.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 5 %
+// Version : %version: 7 %
#include <sysutil.h>
#include <s32file.h>
@@ -29,11 +29,6 @@
#include "mpxvideoregion.h"
#include "mpxvideoplaybackviewfiledetails.h"
-const TInt KVIDEORESIZINGREPEATRATE = 50000;
-const TReal32 KTRANSITIONEFFECTCNT = 8;
-
-_LIT( KAspectRatioFile, "c:\\private\\200159b2\\mpxvideoplayer_aspect_ratio.dat" );
-
CMPXVideoPlaybackDisplayHandler::CMPXVideoPlaybackDisplayHandler( MMPXPlaybackUtility* aPlayUtil,
CMPXVideoViewWrapper* aViewWrapper )
@@ -67,7 +62,6 @@
//
void CMPXVideoPlaybackDisplayHandler::ConstructL()
{
- LoadAspectRatioL();
}
// -------------------------------------------------------------------------------------------------
@@ -92,69 +86,51 @@
//
void CMPXVideoPlaybackDisplayHandler::RemoveDisplayWindow()
{
-#ifdef SYMBIAN_BUILD_GCE
if ( iVideoDisplay )
{
delete iVideoDisplay;
iVideoDisplay = NULL;
}
-#else
- if ( iDirectScreenAccess )
- {
- delete iDirectScreenAccess;
- iDirectScreenAccess = NULL;
- }
-#endif
}
// -------------------------------------------------------------------------------------------------
// CMPXVideoPlaybackDisplayHandler::HandleVideoDisplayMessageL()
// -------------------------------------------------------------------------------------------------
//
-void CMPXVideoPlaybackDisplayHandler::HandleVideoDisplayMessageL( CMPXMessage* aMessage )
+void CMPXVideoPlaybackDisplayHandler::HandleVideoDisplayMessageL( CMPXMessage* /*aMessage*/ )
{
-
- TMPXVideoDisplayCommand message =
- ( *(aMessage->Value<TMPXVideoDisplayCommand>(KMPXMediaVideoDisplayCommand)) );
-
- switch ( message )
- {
-#ifdef SYMBIAN_BUILD_GCE
- case EPbMsgVideoSurfaceCreated:
- {
- SurfaceCreatedL( aMessage );
- break;
- }
- case EPbMsgVideoSurfaceChanged:
- {
- SurfaceChangedL( aMessage );
- break;
- }
- case EPbMsgVideoSurfaceRemoved:
- {
- SurfaceRemoved();
- break;
- }
-#endif
- }
}
-
// -------------------------------------------------------------------------------------------------
// CMPXVideoPlaybackDisplayHandler::SetAspectRatioL()
// -------------------------------------------------------------------------------------------------
//
TInt CMPXVideoPlaybackDisplayHandler::SetAspectRatioL( TMPXVideoPlaybackCommand aCmd )
{
- Q_UNUSED( aCmd );
- TInt aspectRatio = 0;
+ iCommand = aCmd;
+
+ switch ( aCmd )
+ {
+ case EPbCmdNaturalAspectRatio:
+ {
+ iAspectRatio = EMMFNatural;
+ break;
+ }
+ case EPbCmdZoomAspectRatio:
+ {
+ iAspectRatio = EMMFZoom;
+ break;
+ }
+ case EPbCmdStretchAspectRatio:
+ {
+ iAspectRatio = EMMFStretch;
+ break;
+ }
+ }
- iCurrentIndexForAspectRatio = 1;
-
- return aspectRatio;
+ return iAspectRatio;
}
-
// -------------------------------------------------------------------------------------------------
// CMPXVideoPlaybackDisplayHandler::SetDefaultAspectRatioL
// -------------------------------------------------------------------------------------------------
@@ -165,187 +141,21 @@
{
Q_UNUSED( aFileDetails );
Q_UNUSED( aDisplayAspectRatio );
- TInt newAspectRatio = EMMFNatural;
- return newAspectRatio;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackDisplayHandler::SaveAspectRatioL
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::SaveAspectRatioL()
-{
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackDisplayHandler::LoadAspectRatioL
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::LoadAspectRatioL()
-{
+ return iAspectRatio;
}
// -------------------------------------------------------------------------------------------------
// CMPXVideoPlaybackDisplayHandler::UpdateVideoRectL()
// -------------------------------------------------------------------------------------------------
//
-void CMPXVideoPlaybackDisplayHandler::UpdateVideoRectL( TRect aClipRect, TBool transitionEffect )
+void CMPXVideoPlaybackDisplayHandler::UpdateVideoRectL( TRect aClipRect, TBool transitionEffect )
{
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::UpdateVideoRectL()"));
- Q_UNUSED( transitionEffect );
-
- iTlXDiff = (TReal32)( aClipRect.iTl.iX );
- iTlYDiff = (TReal32)( aClipRect.iTl.iY );
- iBrXDiff = (TReal32)( aClipRect.iBr.iX );
- iBrYDiff = (TReal32)( aClipRect.iBr.iY );
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackDisplayHandler::UpdateVideoRectTimeOutL()
-// -------------------------------------------------------------------------------------------------
-//
-TInt CMPXVideoPlaybackDisplayHandler::UpdateVideoRectTimeOutL( TAny* aPtr )
-{
- Q_UNUSED( aPtr );
- return KErrNone;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackDisplayHandler::CalculateVideoRectL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::CalculateVideoRectL()
-{
-
-}
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackDisplayHandler::SetVideoRectL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::SetVideoRectL( TRect aRect )
-{
- Q_UNUSED( aRect );
-}
-
-#ifdef SYMBIAN_BUILD_GCE
+ Q_UNUSED( transitionEffect );
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackDisplayHandler::AddDisplayWindowL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::AddDisplayWindowL( CWsScreenDevice& aScreenDevice,
- RWindowBase& aWindowBase,
- RWindow* aWin )
-{
- Q_UNUSED( aScreenDevice );
- Q_UNUSED( aWindowBase );
- Q_UNUSED( aWin );
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackDisplayHandler::SurfaceCreatedL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::SurfaceCreatedL( CMPXMessage* aMessage )
-{
- Q_UNUSED( aMessage );
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackDisplayHandler::SurfaceChangedL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::SurfaceChangedL( CMPXMessage* aMessage )
-{
- Q_UNUSED( aMessage );
+ iRect = aClipRect;
}
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackDisplayHandler::SurfaceRemoved()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::SurfaceRemoved()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackDisplayHandler::SetNgaAspectRatioL()
-// -------------------------------------------------------------------------------------------------
-//
-TInt CMPXVideoPlaybackDisplayHandler::SetNgaAspectRatioL( TMPXVideoPlaybackCommand aCmd )
-{
- Q_UNUSED( aCmd );
- return KErrNone;
-}
-
-
-#else
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackDisplayHandler::SetDisplayWindowL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::SetDisplayWindowL( RWsSession& aWs,
- CWsScreenDevice& aScreenDevice,
- RWindowBase& aWin,
- TRect aClipRect )
-{
- Q_UNUSED( aWs );
- Q_UNUSED( aScreenDevice );
- Q_UNUSED( aWin );
- Q_UNUSED( aClipRect );
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackDisplayHandler::Restart()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::Restart( RDirectScreenAccess::TTerminationReasons aReason )
-{
- Q_UNUSED( aReason );
-}
-
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackDisplayHandler::RestartDsaL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::RestartDsaL()
-{
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackDisplayHandler::AbortNow()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::AbortNow( RDirectScreenAccess::TTerminationReasons aReason )
-{
- Q_UNUSED( aReason );
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackDisplayHandler::CreateAbortDsaCmdL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::CreateAbortDsaCmdL()
-{
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackDisplayHandler::CreateAspectRatioCommandL()
-// -------------------------------------------------------------------------------------------------
-//
-TInt CMPXVideoPlaybackDisplayHandler::CreateAspectRatioCommandL( TMPXVideoPlaybackCommand aCmd )
-{
- Q_UNUSED( aCmd );
-}
-
-#endif
-
// End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxvideoplaybackviewfiledetails.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxvideoplaybackviewfiledetails.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 4 %
+// Version : %version: 5 %
@@ -64,7 +64,6 @@
mDuration = 0;
mTvOutConnected = false;
- mTvOutPlayAllowed = true;
mDrmProtected = false;
mMultiItemPlaylist = false;
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/testmpxvideoviewwrapper.pro Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/testmpxvideoviewwrapper.pro Thu Jul 22 16:34:17 2010 +0100
@@ -14,7 +14,7 @@
# Description: Project file for building testmpxvideoviewwrapper
#
#
-# Version : %version: 5 %
+# Version : %version: 6 %
TEMPLATE = app
@@ -23,12 +23,11 @@
DEPENDPATH += inc src stub/src stub/inc
-INCLUDEPATH += ../inc \
- ../../inc \
- ../../../inc \
- ../../../../inc \
- ../../controlinc \
- ../../viewinc \
+INCLUDEPATH += stub/inc \
+ ../inc \
+ ../../inc \
+ ../../../inc \
+ ../../../../inc \
$$MW_LAYER_SYSTEMINCLUDE
LIBS += -lmpxcommon.dll \
@@ -43,7 +42,7 @@
mpxvideoplaybackuserinputhandler.h \
mpxvideoplaybackcontrolscontroller.h \
mpxvideoplaybackviewfiledetails.h \
- mpxplaybackutilityimpl.h \
+ mpxplaybackutility.h \
../../viewinc/mpxvideoviewwrapper.h
SOURCES += testmpxvideoviewwrapper.cpp \
@@ -52,6 +51,5 @@
mpxvideoplaybackviewfiledetails.cpp \
mpxvideoplaybackcontrolscontroller.cpp \
mpxplaybackutility.cpp \
- mpxplaybackutilityimpl.cpp \
mpxvideoplaybackuserinputhandler.cpp \
../../viewsrc/mpxvideoviewwrapper.cpp
--- a/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/src/testprogressbar.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/src/testprogressbar.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -1,5 +1,5 @@
/**
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -12,10 +12,10 @@
* Contributors:
*
* Description: tester for methods in TestMPXVideoPlaybackButtonBar
-*
+*
*/
-// Version : %version: 3 %
+// Version : %version: 6 %
#include <qdebug>
@@ -50,9 +50,9 @@
pass[0] = argv[0];
pass[1] = "-o";
pass[2] = "c:\\data\\testprogressbar.txt";
-
+
int res = QTest::qExec(&tv, 3, pass);
-
+
return res;
}
@@ -74,7 +74,7 @@
{
MPX_ENTER_EXIT(_L("TestProgressBar::setup()"));
- mController = new QMPXVideoPlaybackControlsController();
+ mController = new QMPXVideoPlaybackControlsController();
mProgBar = new QMPXVideoPlaybackProgressBar( mController );
mProgBar->initialize();
@@ -114,7 +114,7 @@
//
// If it is playing state
//
- mController->mState = EPbStatePlaying;
+ mController->mState = EPbStatePlaying;
emit mProgBar->mProgressSlider->press();
@@ -126,8 +126,8 @@
//
// If it is pause state
//
- mController->mState = EPbStatePaused;
- mController->mCommand = EMPXPbvCmdStop;
+ mController->mState = EPbStatePaused;
+ mController->mCommand = EMPXPbvCmdStop;
emit mProgBar->mProgressSlider->press();
@@ -155,7 +155,7 @@
mProgBar->mDuration = 120;
mProgBar->mProgressSlider->mSliderValue = 130;
mController->mTimerAction = EMPXTimerCancel;
- mController->mCommand = EMPXPbvCmdStop;
+ mController->mCommand = EMPXPbvCmdStop;
emit mProgBar->mProgressSlider->release();
QVERIFY( mController->mTimerAction == EMPXTimerReset );
@@ -167,21 +167,21 @@
//
mProgBar->mProgressSlider->mSliderValue = -1;
mController->mTimerAction = EMPXTimerCancel;
- mController->mCommand = EMPXPbvCmdStop;
- mController->mValue = 100;
+ 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;
+ mController->mCommand = EMPXPbvCmdStop;
emit mProgBar->mProgressSlider->release();
QVERIFY( mController->mTimerAction == EMPXTimerReset );
@@ -252,21 +252,35 @@
setup();
- // test for tv-out
- mController->mFileDetails->mPlaybackMode = EMPXVideoLocal;
- mController->mFileDetails->mTvOutConnected = true;
- mController->mFileDetails->mTvOutPlayAllowed = false;
+ //
+ // pausable + non seekable
+ //
+ mController->mFileDetails->mPausableStream = true;
+ mController->mFileDetails->mSeekable = false;
mProgBar->updateWithFileDetails( mController->mFileDetails );
QVERIFY( ! mProgBar->mProgressSlider->isEnabled() );
- // live streaming
- mController->mFileDetails->mPlaybackMode = EMPXVideoLiveStreaming;
+ //
+ // non pausable + seekable
+ //
+ mController->mFileDetails->mPausableStream = false;
+ mController->mFileDetails->mSeekable = true;
mProgBar->updateWithFileDetails( mController->mFileDetails );
QVERIFY( ! mProgBar->mProgressSlider->isEnabled() );
+ //
+ // non pausable + non seekable
+ //
+ mController->mFileDetails->mPausableStream = false;
+ mController->mFileDetails->mSeekable = false;
+ mProgBar->updateWithFileDetails( mController->mFileDetails );
+ QVERIFY( ! mProgBar->mProgressSlider->isEnabled() );
+
+ //
// other cases
- mController->mFileDetails->mPlaybackMode = EMPXVideoLocal;
- mController->mFileDetails->mTvOutConnected = false;
+ //
+ mController->mFileDetails->mPausableStream = true;
+ mController->mFileDetails->mSeekable = true;
mProgBar->updateWithFileDetails( mController->mFileDetails );
QVERIFY( mProgBar->mProgressSlider->isEnabled() );
@@ -285,11 +299,11 @@
// test for 1st block of cases
mProgBar->updateState( EPbStatePlaying );
- QVERIFY( mProgBar->isEnabled() );
+ QVERIFY( mProgBar->mProgressSlider->isEnabled() );
// test for 2nd block of cases
mProgBar->updateState( EPbStateBuffering );
- QVERIFY( ! mProgBar->isEnabled() );
+ QVERIFY( ! mProgBar->mProgressSlider->isEnabled() );
cleanup();
}
@@ -385,7 +399,7 @@
setup();
- mProgBar->mDraggingPosition = 10;
+ mProgBar->mDraggingPosition = 10;
mProgBar->mDuration = 30;
mProgBar->mSetPosition = 0;
--- a/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/stub/inc/mpxvideoplaybackviewfiledetails.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/stub/inc/mpxvideoplaybackviewfiledetails.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -70,7 +70,6 @@
bool mPartialPlayback;
bool mRNFormat;
bool mTvOutConnected;
- bool mTvOutPlayAllowed;
bool mDrmProtected;
bool mMultiItemPlaylist;
--- a/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/stub/src/mpxvideoplaybackviewfiledetails.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/stub/src/mpxvideoplaybackviewfiledetails.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -67,7 +67,6 @@
mDuration = 100;
mTvOutConnected = false;
- mTvOutPlayAllowed = true;
mDrmProtected = false;
mVideoHeight = 0;
--- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/src/teststatuspanecontrol.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/src/teststatuspanecontrol.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 5 %
+// Version : %version: 6 %
#include <hbapplication.h>
@@ -34,6 +34,7 @@
#include "hbvideobaseplaybackview.h"
#include "mpxvideoplaybackdocumentloader.h"
#include "hblabel.h"
+#include "hbgroupbox.h"
#define private public
#define protected public
@@ -88,12 +89,11 @@
mControlsController = new QMPXVideoPlaybackControlsController( mBaseVideoView,
mFileDetails );
-
+
mStatusPane = new QMPXVideoPlaybackStatusPaneControl( mControlsController,
EMPXStatusPane,
NULL,
- 0 );
-
+ 0 );
}
// ---------------------------------------------------------------------------
@@ -104,6 +104,12 @@
{
MPX_ENTER_EXIT(_L("TestStatusPaneControl::cleanup()"));
+ if ( mStatusPane )
+ {
+ delete mStatusPane;
+ mStatusPane = NULL;
+ }
+
if ( mBaseVideoView )
{
delete mBaseVideoView;
@@ -121,12 +127,6 @@
delete mControlsController;
mControlsController = NULL;
}
-
- if ( mStatusPane )
- {
- delete mStatusPane;
- mStatusPane = NULL;
- }
}
// ---------------------------------------------------------------------------
@@ -145,6 +145,8 @@
mStatusPane->setMenu( mFileDetails );
QVERIFY( mControlsController->view()->menu()->isEmpty() );
+
+ cleanup();
}
// ---------------------------------------------------------------------------
@@ -156,17 +158,22 @@
MPX_ENTER_EXIT(_L("TestStatusPaneControl::testSetVisible()"));
setup();
-
+ mStatusPane->updateControlsWithFileDetails( mFileDetails );
+
// 1. Set visible
mStatusPane->setVisible( true );
- QVERIFY( mStatusPane->isVisible() );
- QVERIFY( mStatusPane->mTitleLabel->isVisible() );
-
+ QVERIFY( mControlsController->view()->mStatusBarVisible );
+ QVERIFY( mControlsController->view()->mTitleBarVisible );
+ QVERIFY( mStatusPane->mTitleLayout->isVisible() );
+
// 2. Set invisible
- mStatusPane->setVisible( false );
- QVERIFY( ! mStatusPane->isVisible() );
- QVERIFY( ! mStatusPane->mTitleLabel->isVisible() );
-
+ mStatusPane->setVisible( false );
+ QVERIFY( mControlsController->view()->menu()->isEmpty() );
+ QVERIFY( ! mControlsController->view()->mStatusBarVisible );
+ QVERIFY( ! mControlsController->view()->mTitleBarVisible );
+ QVERIFY( ! mStatusPane->mTitleLayout->isVisible() );
+
+ cleanup();
}
// ---------------------------------------------------------------------------
@@ -178,34 +185,36 @@
MPX_ENTER_EXIT(_L("TestStatusPaneControl::testUpdateControlsWithFileDetails()"));
setup();
-
+
+ QString title = "Title";
+
// 1. test for full creen mode
mControlsController->mViewMode = EFullScreenView;
-
- mFileDetails->mTvOutConnected = true;
-
+ mControlsController->mFileDetails->mTitle = title;
mStatusPane->updateControlsWithFileDetails( mFileDetails );
-
+
+ QVERIFY( mStatusPane->mTitleLabel->mString == title );
+ QVERIFY( mStatusPane->mTitleGroupBox->mString == title );
+ QVERIFY( mStatusPane->mTitleLabel->isVisible() );
+ QVERIFY( ! mStatusPane->mTitleGroupBox->isVisible() );
QVERIFY( mControlsController->view()->viewFlags() ==
HbView::HbViewFlags( HbView::ViewTitleBarTransparent | HbView::ViewStatusBarTransparent ));
-
+
// 2. test for detial view mode
- mControlsController->mViewMode = EDetailsView;
-
- mFileDetails->mTvOutConnected = true;
-
+ mControlsController->mViewMode = EDetailsView;
+ mStatusPane->updateControlsWithFileDetails( mFileDetails );
+
+ QVERIFY( mControlsController->view()->viewFlags() == HbView::ViewFlagNone );
+ QVERIFY( ! mStatusPane->mTitleLabel->isVisible() );
+ QVERIFY( mStatusPane->mTitleGroupBox->isVisible() );
+
+ // 3. test for audio only mode
+ mControlsController->mViewMode = EAudioOnlyView;
mStatusPane->updateControlsWithFileDetails( mFileDetails );
QVERIFY( mControlsController->view()->viewFlags() == HbView::ViewFlagNone );
- // 3. test for audio only mode
- mControlsController->mViewMode = EAudioOnlyView;
-
- mFileDetails->mTvOutConnected = true;
-
- mStatusPane->updateControlsWithFileDetails( mFileDetails );
-
- QVERIFY( mControlsController->view()->viewFlags() == HbView::ViewFlagNone );
+ cleanup();
}
// ---------------------------------------------------------------------------
@@ -225,6 +234,8 @@
// 2. test for second block of cases:
mStatusPane->setVisibility( EPbStateInitialising );
QVERIFY( mControlsController->view()->menu()->isEmpty() );
+
+ cleanup();
}
// ---------------------------------------------------------------------------
@@ -240,6 +251,8 @@
mStatusPane->controlListUpdated( mFileDetails );
QVERIFY( mControlsController->view()->menu()->isEmpty() );
+
+ cleanup();
}
// ---------------------------------------------------------------------------
@@ -259,6 +272,8 @@
QVERIFY( mControlsController->mTimerAction == EMPXTimerCancel );
disconnect( this, SIGNAL( commandSignal() ), mStatusPane, SLOT( handleAboutToShow() ) );
+
+ cleanup();
}
// ---------------------------------------------------------------------------
@@ -277,7 +292,9 @@
QVERIFY( mControlsController->mTimerAction == EMPXTimerReset );
- disconnect( this, SIGNAL( commandSignal() ), mStatusPane, SLOT( handleAboutToHide() ) );
+ disconnect( this, SIGNAL( commandSignal() ), mStatusPane, SLOT( handleAboutToHide() ) );
+
+ cleanup();
}
// ---------------------------------------------------------------------------
@@ -297,6 +314,8 @@
QVERIFY( mControlsController->mViewMode == EFullScreenView );
disconnect( this, SIGNAL( commandSignal() ), mStatusPane, SLOT( openFullScreenView() ) );
+
+ cleanup();
}
// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/inc/hbgroupbox.h Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Stub Implementation of HbGroupBox
+*
+*/
+
+// Version : %version: 1 %
+
+
+
+#ifndef HBGROUPBOX_H_
+#define HBGROUPBOX_H_
+
+#include <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 Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/inc/hblabel.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -34,13 +34,14 @@
virtual ~HbLabel();
public:
- void setVisible( bool visible );
-
+ void setVisible( bool visible );
bool isVisible();
+ void setPlainText( QString string );
public:
bool mVisible;
+ QString mString;
};
-#endif /*HBPUSHBUTTON_H*/
+#endif /*HBLABEL_H_*/
--- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/inc/hbvideobaseplaybackview.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/inc/hbvideobaseplaybackview.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 5 %
+// Version : %version: 6 %
@@ -25,16 +25,18 @@
#define __HBVIDEOBASEPLAYBACKVIEW_H__
// Include Files
+#include <hbwidget.h>
#include <hbview.h>
-
// Constants
// Forward Declarations
// Class Definitions
+class HbAction;
+class HbMenu;
-class HbVideoBasePlaybackView : public HbView
+class HbVideoBasePlaybackView : public HbWidget
{
Q_OBJECT
@@ -55,14 +57,21 @@
void setViewFlags( HbView::HbViewFlags flags );
HbView::HbViewFlags viewFlags();
- protected slots:
+ void setTitleBarVisible( bool visible );
+ void setStatusBarVisible( bool visible );
+ void setNavigationAction(HbAction *action);
+ HbMenu *menu();
+ public slots:
virtual void closePlaybackView();
public:
bool mViewActive;
+ bool mTitleBarVisible;
+ bool mStatusBarVisible;
+
+ HbMenu *mMenu;
HbView::HbViewFlags mFlag;
-
};
#endif // __HBVIDEOBASEPLAYBACKVIEW_H__
--- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/inc/mpxvideoplaybackviewfiledetails.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/inc/mpxvideoplaybackviewfiledetails.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -70,7 +70,6 @@
bool mPartialPlayback;
bool mRNFormat;
bool mTvOutConnected;
- bool mTvOutPlayAllowed;
bool mDrmProtected;
bool mMultiItemPlaylist;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/hbgroupbox.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of HbGroupBox
+*
+*/
+
+// Version : %version: 1 %
+
+
+#include "hbgroupbox.h"
+
+// -------------------------------------------------------------------------------------------------
+// HbGroupBox::HbGroupBox
+// -------------------------------------------------------------------------------------------------
+//
+HbGroupBox::HbGroupBox()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbGroupBox::~HbGroupBox
+// -------------------------------------------------------------------------------------------------
+//
+HbGroupBox::~HbGroupBox()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbGroupBox::setVisible
+// -------------------------------------------------------------------------------------------------
+//
+void HbGroupBox::setVisible( bool visible )
+{
+ mVisible = visible;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbGroupBox::isVisible
+// -------------------------------------------------------------------------------------------------
+//
+bool HbGroupBox::isVisible()
+{
+ return mVisible;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbGroupBox::setHeading
+// -------------------------------------------------------------------------------------------------
+//
+void HbGroupBox::setHeading( QString string )
+{
+ mString = string;
+}
+
+// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/hblabel.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/hblabel.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,13 +15,13 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
#include "hblabel.h"
// -------------------------------------------------------------------------------------------------
-// HbPushButton::HbPushButton
+// HbLabel::HbLabel
// -------------------------------------------------------------------------------------------------
//
HbLabel::HbLabel()
@@ -54,5 +54,13 @@
return mVisible;
}
+// -------------------------------------------------------------------------------------------------
+// HbLabel::setPlainText
+// -------------------------------------------------------------------------------------------------
+//
+void HbLabel::setPlainText( QString string )
+{
+ mString = string;
+}
// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/hbvideobaseplaybackview.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/hbvideobaseplaybackview.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,12 +15,14 @@
*
*/
-// Version : %version: 4 %
+// Version : %version: 5 %
// Include Files
#include <hbinstance.h>
+#include <HbAction.h>
+#include <HbMenu.h>
#include "../inc/hbvideobaseplaybackview.h"
@@ -33,6 +35,7 @@
//
HbVideoBasePlaybackView::HbVideoBasePlaybackView()
{
+ mMenu = new HbMenu();
mViewActive = false;
}
@@ -42,6 +45,11 @@
//
HbVideoBasePlaybackView::~HbVideoBasePlaybackView()
{
+ if ( mMenu )
+ {
+ delete mMenu;
+ mMenu = NULL;
+ }
}
// -------------------------------------------------------------------------------------------------
@@ -116,4 +124,39 @@
return mFlag;
}
+// -------------------------------------------------------------------------------------------------
+// HbVideoBasePlaybackView::setTitleBarVisible()
+// -------------------------------------------------------------------------------------------------
+//
+void HbVideoBasePlaybackView::setTitleBarVisible( bool visible )
+{
+ mTitleBarVisible = visible;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbVideoBasePlaybackView::setStatusBarVisible()
+// -------------------------------------------------------------------------------------------------
+//
+void HbVideoBasePlaybackView::setStatusBarVisible( bool visible )
+{
+ mStatusBarVisible = visible;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbVideoBasePlaybackView::setNavigationAction()
+// -------------------------------------------------------------------------------------------------
+//
+void HbVideoBasePlaybackView::setNavigationAction( HbAction *action )
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbVideoBasePlaybackView::menu()
+// -------------------------------------------------------------------------------------------------
+//
+HbMenu* HbVideoBasePlaybackView::menu()
+{
+ return mMenu;
+}
+
// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/mpxvideoplaybackdocumentloader.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/mpxvideoplaybackdocumentloader.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,12 +15,13 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
-#include <hbwidget.h>
-#include <hbtransparentwindow.h>
-#include <hblabel.h>
+#include <QGraphicsWidget>
+
+#include "hblabel.h"
+#include "hbgroupbox.h"
#include "mpxvideo_debug.h"
#include "mpxvideoplaybackdocumentloader.h"
@@ -83,14 +84,11 @@
QGraphicsWidget *object = NULL;
- if ( name == "transparentWindow" )
- {
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::creating transparentWindow") );
-
- object = new HbTransparentWindow();
+ if ( name == "titleLayout" )
+ {
+ object = new QGraphicsWidget();
object->setObjectName( name );
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::appending to object list") );
mWidgets.append( object );
}
else if ( name == "title" )
@@ -99,6 +97,12 @@
object->setObjectName( name );
mWidgets.append( object );
}
+ else if ( name == "titleGroupBox" )
+ {
+ object = new HbGroupBox();
+ object->setObjectName( name );
+ mWidgets.append( object );
+ }
return object;
}
--- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/mpxvideoplaybackviewfiledetails.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/mpxvideoplaybackviewfiledetails.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -67,7 +67,6 @@
mDuration = 0;
mTvOutConnected = false;
- mTvOutPlayAllowed = true;
mDrmProtected = false;
mVideoHeight = 0;
--- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/teststatuspanecontrol.pro Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/teststatuspanecontrol.pro Thu Jul 22 16:34:17 2010 +0100
@@ -14,7 +14,7 @@
# Description: Project file for building teststatuspanecontrol
#
#
-# Version : %version: 2 %
+# Version : %version: 3 %
TEMPLATE = app
@@ -41,7 +41,8 @@
hbvideobaseplaybackview.h \
mpxvideoplaybackdocumentloader.h \
mpxvideoplaybackfullscreencontrol.h \
- hblabel.h
+ hblabel.h \
+ hbgroupbox.h
SOURCES += ../../../controlsrc/mpxvideoplaybackstatuspanecontrol.cpp \
src/teststatuspanecontrol.cpp \
@@ -50,5 +51,6 @@
hbvideobaseplaybackview.cpp \
mpxvideoplaybackdocumentloader.cpp \
mpxvideoplaybackfullscreencontrol.cpp \
- hblabel.cpp
+ hblabel.cpp \
+ hbgroupbox.cpp
\ No newline at end of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/inc/mpxvideoplaybackviewfiledetails.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/inc/mpxvideoplaybackviewfiledetails.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -65,7 +65,6 @@
bool mPartialPlayback;
bool mRNFormat;
bool mTvOutConnected;
- bool mTvOutPlayAllowed;
bool mDrmProtected;
bool mMultiItemPlaylist;
--- a/videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/src/centralrepository.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/src/centralrepository.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -25,7 +25,7 @@
#include "centralrepository.h"
-CRepository* CRepository::NewLC( TUid aRepositoryUid )
+CRepository* CRepository::NewLC( TUid /* aRepositoryUid */ )
{
CRepository* self = new (ELeave) CRepository();
@@ -35,9 +35,9 @@
}
-TInt CRepository::Get(TUint32 aKey, TInt& aValue)
+TInt CRepository::Get( TUint32 /* aKey */, TInt& aValue )
{
- aValue = 10;
+ aValue = 10;
return KErrNone;
}
--- a/videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/src/mpxvideoplaybackviewfiledetails.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/src/mpxvideoplaybackviewfiledetails.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -58,7 +58,6 @@
mDuration = 0;
mTvOutConnected = false;
- mTvOutPlayAllowed = true;
mDrmProtected = false;
mMultiItemPlaylist = false;
--- a/videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/src/mpxvideoviewwrapper.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/src/mpxvideoviewwrapper.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 2 %
+// Version : %version: 3 %
@@ -202,7 +202,6 @@
iFileDetails->mRNFormat = false;
iFileDetails->mDuration = 100;
iFileDetails->mTvOutConnected = false;
- iFileDetails->mTvOutPlayAllowed = true;
iFileDetails->mDrmProtected = false;
iFileDetails->mMultiItemPlaylist = false;
iFileDetails->mVideoHeight = 320;
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/src/testvideodisplayhandler.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/src/testvideodisplayhandler.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -212,24 +212,44 @@
{
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;
-
- 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 );
-
- TReal displayAspectRatio = (TReal32)displayRect.Width() / (TReal32)displayRect.Height();
-
int aspectRatio = mDispHdlr->SetDefaultAspectRatioL( mFileDetails, displayAspectRatio );
QVERIFY( aspectRatio == EMMFZoom );
- mDispHdlr->RemoveDisplayWindow();
+ //
+ // aspect ratio stretch
+ //
+ mFileDetails->mVideoHeight = 144;
+ mFileDetails->mVideoWidth = 220;
+
+ aspectRatio = mDispHdlr->SetDefaultAspectRatioL( mFileDetails, displayAspectRatio );
+
+ QVERIFY( aspectRatio == EMMFStretch );
+
+ mDispHdlr->RemoveDisplayWindow();
+
cleanup();
}
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/stub/inc/mpxvideoplaybackviewfiledetails.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/stub/inc/mpxvideoplaybackviewfiledetails.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 2 %
+// Version : %version: 3 %
@@ -70,7 +70,6 @@
bool mPartialPlayback;
bool mRNFormat;
bool mTvOutConnected;
- bool mTvOutPlayAllowed;
bool mDrmProtected;
bool mMultiItemPlaylist;
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/stub/src/mpxvideoplaybackviewfiledetails.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/stub/src/mpxvideoplaybackviewfiledetails.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 2 %
+// Version : %version: 3 %
@@ -64,7 +64,6 @@
mDuration = 0;
mTvOutConnected = false;
- mTvOutPlayAllowed = true;
mDrmProtected = false;
mMultiItemPlaylist = false;
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/stub/src/mpxvideoviewwrapper.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/stub/src/mpxvideoviewwrapper.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 3 %
+// Version : %version: 4 %
@@ -228,7 +228,6 @@
iFileDetails->mRNFormat = false;
iFileDetails->mDuration = 100;
iFileDetails->mTvOutConnected = false;
- iFileDetails->mTvOutPlayAllowed = true;
iFileDetails->mDrmProtected = false;
iFileDetails->mMultiItemPlaylist = false;
iFileDetails->mVideoHeight = 320;
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/inc/testmpxvideoplaybackcontrolscontroller.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/inc/testmpxvideoplaybackcontrolscontroller.h Thu Jul 22 16:34:17 2010 +0100
@@ -1,5 +1,5 @@
/**
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -12,10 +12,10 @@
* Contributors:
*
* Description: tester for methods in Video Playback Controls Controller
-*
+*
*/
-// Version : %version: 3 %
+// Version : %version: 6 %
#ifndef __TESTMPXVIDEOPLAYBACKCONTROLSCONTROLLER_H__
#define __TESTMPXVIDEOPLAYBACKCONTROLSCONTROLLER_H__
@@ -41,29 +41,22 @@
* will be called before each testfunction is executed.
*
*/
- void init();
-
+ void init();
+
/**
* will be called after every testfunction.
*
*/
void cleanup();
-
+
private:
void verifyHandleEventStateChangedResult( int value );
void verifyHandleEventTvOutResult( bool tvOutConnected, bool value );
-
+
private slots:
-
- //
- // test addFileDetails()
- //
+
void testAddFileDetails();
-
- //
- // test handleEvent()
- //
void testHandleEventSetPosition();
void testHandleEventSetDuration();
void testHandleEventStateChanged();
@@ -78,17 +71,17 @@
void testHandleEventTvOutDisconnected();
void testHandleEventHandleErrors();
void testHandleEventShowVolumeControls();
-
+
//
// test handleCommand()
//
void testHandleCommand();
-
+
//
// test handleTappedOnScreen()
//
void testHandleTappedOnScreen();
-
+
//
// test updateVideoRectDone()
//
@@ -112,30 +105,37 @@
//
// test private slot attachVideo()
//
- void testslot_attachVideo();
+ void testslot_attachVideo();
//
// test private slot attachVideo()
//
- void testslot_sendVideo();
-
+ void testslot_sendVideo();
+
+ //
+ // test private slot handleOrientationChanged()
+ //
+ void testslot_handleOrientationChanged();
+
+ void testslot_handleRNLogoVisibleChanged();
+ void testslot_handleRNLogoTimeout();
+ void testIsRNLogoBitmapVisible();
+
signals:
+ void commandSignal();
+ void commandSignal( Qt::Orientation );
- void commandSignal();
-
private:
HbVideoBasePlaybackView* mBaseVideoView;
CMPXVideoViewWrapper* mViewWrapper;
QMPXVideoPlaybackControlsController* mController;
QMPXVideoPlaybackViewFileDetails* mFileDetails;
-
+
};
#endif // __TESTMPXVIDEOPLAYBACKCONTROLSCONTROLLER_H__
// End of file
-
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/src/testmpxvideoplaybackcontrolscontroller.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/src/testmpxvideoplaybackcontrolscontroller.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -1,5 +1,5 @@
/**
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -12,10 +12,10 @@
* Contributors:
*
* Description: tester for methods in Video Playback Controls Controller
-*
+*
*/
-// Version : %version: 6 %
+// Version : %version: 10 %
#include <e32err.h>
#include <w32std.h>
@@ -55,34 +55,36 @@
{
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();
- mFileDetails = new QMPXVideoPlaybackViewFileDetails();
- mViewWrapper = CMPXVideoViewWrapper::NewL( mBaseVideoView );
+
+ if ( ! mFileDetails )
+ {
+ mFileDetails = new QMPXVideoPlaybackViewFileDetails();
+ }
+ mViewWrapper = CMPXVideoViewWrapper::NewL( mBaseVideoView );
mController = new QMPXVideoPlaybackControlsController( mBaseVideoView,
mViewWrapper,
- mFileDetails );
+ mFileDetails );
}
// ---------------------------------------------------------------------------
@@ -92,7 +94,7 @@
void TestMPXVideoPlaybackControlsController::cleanup()
{
MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackControlsController::cleanup()"));
-
+
delete mController;
mController = NULL;
@@ -101,7 +103,7 @@
delete mViewWrapper;
mViewWrapper = NULL;
-
+
delete mBaseVideoView;
mBaseVideoView = NULL;
}
@@ -113,37 +115,45 @@
void TestMPXVideoPlaybackControlsController::testAddFileDetails()
{
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testAddFileDetails()") );
-
- init();
-
+
//
// local real media with no video
//
- mFileDetails->mClipName = QString("testClip.rm");
- mFileDetails->mMimeType = QString("video/x-pn-realvideo");
-
- mController->addFileDetails( mFileDetails );
-
+ mFileDetails = new QMPXVideoPlaybackViewFileDetails();
+ mFileDetails->mClipName = QString( "testClip.rm" );
+ mFileDetails->mMimeType = QString( "video/x-pn-realvideo" );
+
+ init();
+
+ mController->addFileDetails( mFileDetails );
+
QVERIFY( mController->mFileDetails->mRNFormat == true );
QVERIFY( mController->mViewMode == EAudioOnlyView );
QVERIFY( mController->mControlsConfig->mUpdateControlsWithFileDetails == true );
QVERIFY( mController->mControlsConfig->mState == EMPXControlCmdTvOutConnected );
-
+
+ cleanup();
+
//
// local 3GPP media with video-only
- //
+ //
+ mFileDetails = new QMPXVideoPlaybackViewFileDetails();
+
mFileDetails->mClipName = QString("testClip.3gp");
mFileDetails->mMimeType = QString("video/3gpp");
mFileDetails->mVideoEnabled = true;
+ mFileDetails->mTvOutConnected = true;
+
+ init();
+
mController->mViewMode = EFullScreenView;
- mFileDetails->mTvOutConnected = true;
QFileInfo videoOnlyFile( mFileDetails->mClipName );
-
- mController->addFileDetails( mFileDetails );
-
+
+ mController->addFileDetails( mFileDetails );
+
QVERIFY( mController->mFileDetails->mRNFormat == false );
- QVERIFY( mController->mControlsConfig->mUpdateControlsWithFileDetails == true );
-
+ QVERIFY( mController->mControlsConfig->mUpdateControlsWithFileDetails == true );
+
//
// validate 'TvOutConnected'
//
@@ -152,50 +162,55 @@
//
// video-only, validate volume control is dimmed
//
- QVERIFY( mController->mVolumeControl->mValue == 0 );
- QVERIFY( mController->mVolumeControl->isEnabled() == false );
-
+ 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() );
+ {
+ 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");
-
- mController->addFileDetails( mFileDetails );
-
+
+ init();
+
+ mController->addFileDetails( mFileDetails );
+
QVERIFY( mController->mFileDetails->mRNFormat == true );
- QVERIFY( mController->mControlsConfig->mUpdateControlsWithFileDetails == 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 );
+ {
+ HbLabel *titleLabel = qobject_cast<HbLabel*>( mController->mLoader->mWidgets[i] );
+ QVERIFY( titleLabel->plainText() == mFileDetails->mTitle );
break;
}
- }
-
- cleanup();
+ }
+
+ cleanup();
}
// -------------------------------------------------------------------------------------------------
@@ -204,19 +219,16 @@
//
void TestMPXVideoPlaybackControlsController::testHandleEventSetPosition()
{
- MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventSetPosition()"));
-
- init();
- int value = 20000;
-
- mController->handleEvent( EMPXControlCmdSetPosition, value );
-
- for ( int i = 0 ; i < mController->mControls.count() ; i++ )
- {
- QVERIFY( mController->mControls[i]->mPosition == ( value / KPbMilliMultiplier ) );
- }
-
- cleanup();
+ MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventSetPosition()"));
+
+ init();
+ int value = 20000;
+
+ mController->handleEvent( EMPXControlCmdSetPosition, value );
+
+ QVERIFY( mController->mControls[0]->mPosition == ( value / KPbMilliMultiplier ) );
+
+ cleanup();
}
// -------------------------------------------------------------------------------------------------
@@ -225,19 +237,16 @@
//
void TestMPXVideoPlaybackControlsController::testHandleEventSetDuration()
{
- MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventSetDuration()"));
-
- init();
- int value = 30000;
-
- mController->handleEvent( EMPXControlCmdSetDuration, value );
-
- for ( int i = 0 ; i < mController->mControls.count() ; i++ )
- {
- QVERIFY( mController->mControls[i]->mDuration == ( value / KPbMilliMultiplier ) );
- }
-
- cleanup();
+ MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventSetDuration()"));
+
+ init();
+ int value = 30000;
+
+ mController->handleEvent( EMPXControlCmdSetDuration, value );
+
+ QVERIFY( mController->mControls[0]->mDuration == ( value / KPbMilliMultiplier ) );
+
+ cleanup();
}
// -------------------------------------------------------------------------------------------------
@@ -246,89 +255,90 @@
//
void TestMPXVideoPlaybackControlsController::testHandleEventStateChanged()
{
- MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventStateChanged()"));
-
- init();
+ MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventStateChanged()"));
+
+ init();
TMPXVideoPlaybackControlCommandIds event = EMPXControlCmdStateChanged;
-
+ mController->mOrientation = Qt::Horizontal;
+
//
// state change (EPbStateInitialising)
//
- int value = EPbStateInitialising;
- mController->handleEvent( event, value );
+ int value = EPbStateInitialising;
+ mController->handleEvent( event, value );
verifyHandleEventStateChangedResult( value );
-
+
//
// state change (EPbStateBuffering)
//
- value = EPbStateBuffering;
- mController->handleEvent( event, value );
+ value = EPbStateBuffering;
+ mController->handleEvent( event, value );
verifyHandleEventStateChangedResult( value );
-
+
//
// state change (EPbStatePlaying)
//
- value = EPbStatePlaying;
- mController->handleEvent( event, value );
+ value = EPbStatePlaying;
+ mController->handleEvent( event, value );
verifyHandleEventStateChangedResult( value );
-
+
//
// state change (EPbStatePaused)
//
- value = EPbStatePaused;
- mController->handleEvent( event, value );
+ value = EPbStatePaused;
+ mController->handleEvent( event, value );
verifyHandleEventStateChangedResult( value );
//
// state change (EPbStateNotInitialised)
//
- value = EPbStateNotInitialised;
- mController->handleEvent( event, value );
+ value = EPbStateNotInitialised;
+ mController->handleEvent( event, value );
verifyHandleEventStateChangedResult( value );
//
// state change (EPbStateStopped)
//
- value = EPbStateStopped;
- mController->handleEvent( event, value );
+ value = EPbStateStopped;
+ mController->handleEvent( event, value );
verifyHandleEventStateChangedResult( value );
//
// state change (EPbStateSeekingForward)
//
- value = EPbStateSeekingForward;
- mController->handleEvent( event, value );
+ value = EPbStateSeekingForward;
+ mController->handleEvent( event, value );
verifyHandleEventStateChangedResult( value );
-
+
//
// state change (EPbStateSeekingBackward)
//
- value = EPbStateSeekingBackward;
- mController->handleEvent( event, value );
+ value = EPbStateSeekingBackward;
+ mController->handleEvent( event, value );
verifyHandleEventStateChangedResult( value );
-
+
//
// state change (EPbStateShuttingDown)
//
- value = EPbStateShuttingDown;
- mController->handleEvent( event, value );
+ value = EPbStateShuttingDown;
+ mController->handleEvent( event, value );
verifyHandleEventStateChangedResult( value );
-
+
//
// state change (EPbStateDownloading)
//
- value = EPbStateDownloading;
- mController->handleEvent( event, value );
+ value = EPbStateDownloading;
+ mController->handleEvent( event, value );
verifyHandleEventStateChangedResult( value );
-
+
//
// state change (EPbStatePluginSeeking)
//
- value = EPbStatePluginSeeking;
- mController->handleEvent( event, value );
+ value = EPbStatePluginSeeking;
+ mController->handleEvent( event, value );
verifyHandleEventStateChangedResult( value );
-
- cleanup();
+
+ cleanup();
}
// -------------------------------------------------------------------------------------------------
@@ -337,27 +347,29 @@
//
void TestMPXVideoPlaybackControlsController::verifyHandleEventStateChangedResult( int value )
{
- MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::verifyHandleEventStateChangedResult()"));
+ MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::verifyHandleEventStateChangedResult()"));
- if ( value == EPbStateInitialised &&
+ mController->mOrientation = Qt::Horizontal;
+
+ if ( value == EPbStateInitialised &&
( mController->mFileDetails->mPlaybackMode == EMPXVideoStreaming ||
mController->mFileDetails->mPlaybackMode == EMPXVideoLiveStreaming ) )
{
- QVERIFY( mController->mControlsConfig->mState == EMPXControlCmdPluginInitialized );
+ QVERIFY( mController->mControlsConfig->mState == EMPXControlCmdPluginInitialized );
}
- else if ( value == EPbStatePlaying || value == EPbStateInitialising ||
- value == EPbStateBuffering || value == EPbStatePaused ||
+ 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 );
+ QVERIFY( mController->mControls[i]->mState == value );
+ QVERIFY( mController->mControls[i]->mVisibilityState == value );
}
}
else
{
- QVERIFY( mController->mState == value );
+ QVERIFY( mController->mState == value );
}
}
@@ -367,15 +379,15 @@
//
void TestMPXVideoPlaybackControlsController::testHandleEventSetVolume()
{
- MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventSetVolume()"));
-
- init();
- int value = 40;
-
- mController->handleEvent( EMPXControlCmdSetVolume, value );
- QVERIFY( mController->mVolumeControl->mValue == value );
-
- cleanup();
+ MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventSetVolume()"));
+
+ init();
+ int value = 40;
+
+ mController->handleEvent( EMPXControlCmdSetVolume, value );
+ QVERIFY( mController->mVolumeControl->mValue == value );
+
+ cleanup();
}
// -------------------------------------------------------------------------------------------------
@@ -384,22 +396,19 @@
//
void TestMPXVideoPlaybackControlsController::testHandleEventSetAspectRatio()
{
- MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventSetAspectRatio()"));
-
- init();
+ MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventSetAspectRatio()"));
+
+ init();
int numScalingType = 5;
-
+
for ( int i = 0; i < numScalingType; i++ )
- {
- mController->handleEvent( EMPXControlCmdSetAspectRatio, i );
-
- for ( int j = 0 ; j < mController->mControls.count() ; j++ )
- {
- QVERIFY( mController->mControls[j]->mAspectRatio == i );
- }
+ {
+ mController->handleEvent( EMPXControlCmdSetAspectRatio, i );
+
+ QVERIFY( mController->mControls[0]->mAspectRatio == i );
}
-
- cleanup();
+
+ cleanup();
}
// -------------------------------------------------------------------------------------------------
@@ -409,18 +418,15 @@
void TestMPXVideoPlaybackControlsController::testHandleEventSetDownloadSize()
{
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventSetDownloadSize()") );
-
- init();
- int value = 50;
-
- mController->handleEvent( EMPXControlCmdSetDownloadSize, value );
-
- for ( int i = 0 ; i < mController->mControls.count() ; i++ )
- {
- QVERIFY( mController->mControls[i]->mDownloadSize == value );
- }
-
- cleanup();
+
+ init();
+ int value = 50;
+
+ mController->handleEvent( EMPXControlCmdSetDownloadSize, value );
+
+ QVERIFY( mController->mControls[0]->mDownloadSize == value );
+
+ cleanup();
}
// -------------------------------------------------------------------------------------------------
@@ -430,18 +436,15 @@
void TestMPXVideoPlaybackControlsController::testHandleEventDownloadUpdated()
{
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventDownloadUpdated()") );
-
- init();
+
+ init();
int value = 55;
-
- mController->handleEvent( EMPXControlCmdDownloadUpdated, value );
-
- for ( int i = 0 ; i < mController->mControls.count() ; i++ )
- {
- QVERIFY( mController->mControls[i]->mDownloadPosition == value );
- }
-
- cleanup();
+
+ mController->handleEvent( EMPXControlCmdDownloadUpdated, value );
+
+ QVERIFY( mController->mControls[0]->mDownloadPosition == value );
+
+ cleanup();
}
// -------------------------------------------------------------------------------------------------
@@ -451,18 +454,15 @@
void TestMPXVideoPlaybackControlsController::testHandleEventDownloadComplete()
{
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventDownloadComplete()") );
-
- init();
+
+ init();
int value = 60;
-
- mController->handleEvent( EMPXControlCmdDownloadComplete, value );
-
- for ( int i = 0 ; i < mController->mControls.count() ; i++ )
- {
- QVERIFY( mController->mControls[i]->mDownloadPosition == value );
- }
-
- cleanup();
+
+ mController->handleEvent( EMPXControlCmdDownloadComplete, value );
+
+ QVERIFY( mController->mControls[0]->mDownloadPosition == value );
+
+ cleanup();
}
// -------------------------------------------------------------------------------------------------
@@ -472,15 +472,15 @@
void TestMPXVideoPlaybackControlsController::testHandleEventSetDownloadPaused()
{
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventSetDownloadPaused()") );
-
- init();
+
+ init();
int value = 0;
-
- mController->handleEvent( EMPXControlCmdSetDownloadPaused, value );
-
- QVERIFY( mController->mControlsConfig->mState == KControlListsUpdated );
-
- cleanup();
+
+ mController->handleEvent( EMPXControlCmdSetDownloadPaused, value );
+
+ QVERIFY( mController->mControlsConfig->mState == KControlListsUpdated );
+
+ cleanup();
}
// -------------------------------------------------------------------------------------------------
@@ -490,15 +490,15 @@
void TestMPXVideoPlaybackControlsController::testHandleEventClearDownloadPaused()
{
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventClearDownloadPaused()") );
-
- init();
+
+ init();
int value = 0;
-
- mController->handleEvent( EMPXControlCmdClearDownloadPaused, value );
-
- QVERIFY( mController->mControlsConfig->mState == KControlListsUpdated );
-
- cleanup();
+
+ mController->handleEvent( EMPXControlCmdClearDownloadPaused, value );
+
+ QVERIFY( mController->mControlsConfig->mState == KControlListsUpdated );
+
+ cleanup();
}
// -------------------------------------------------------------------------------------------------
@@ -508,29 +508,29 @@
void TestMPXVideoPlaybackControlsController::testHandleEventTvOutConnected()
{
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventTvOutConnected()") );
-
- init();
-
+
+ init();
+
//
// TV-Out Connected, value = true, EMPXVideoLocal
//
- mController->handleEvent( EMPXControlCmdTvOutConnected, true );
+ mController->handleEvent( EMPXControlCmdTvOutConnected, true );
verifyHandleEventTvOutResult( true, true );
-
+
//
// TV-Out Connected, value = false, EMPXVideoLocal
//
- mController->handleEvent( EMPXControlCmdTvOutConnected, false );
+ mController->handleEvent( EMPXControlCmdTvOutConnected, false );
verifyHandleEventTvOutResult( true, false );
-
+
//
// TV-Out Connected, value = false, non-EMPXVideoLocal
//
mController->mFileDetails->mPlaybackMode = EMPXVideoStreaming;
- mController->handleEvent( EMPXControlCmdTvOutConnected, false );
+ mController->handleEvent( EMPXControlCmdTvOutConnected, false );
verifyHandleEventTvOutResult( true, false );
-
- cleanup();
+
+ cleanup();
}
// -------------------------------------------------------------------------------------------------
@@ -541,61 +541,58 @@
bool value )
{
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::verifyHandleEventTvOutResult(%d,%d)"),
- tvOutConnected, value );
-
- QVERIFY( mController->mFileDetails->mTvOutConnected == tvOutConnected );
-
+ 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 );
+ QVERIFY( tvOutConnected? val == true : val == false );
}
else if( mController->mLoader->mWidgets[i]->objectName() == QString( "realAudioOnlyBitmap" ) )
{
- QVERIFY( mFileDetails->mRNFormat? val == true : val == false );
+ QVERIFY( mFileDetails->mRNFormat? val == true : val == false );
}
else if( mController->mLoader->mWidgets[i]->objectName() == QString( "partialAudioOnlyBitmap" ) )
{
- QVERIFY( mFileDetails->mPartialPlayback? val == true : val == false );
+ QVERIFY( mFileDetails->mPartialPlayback? val == true : val == false );
}
else if( mController->mLoader->mWidgets[i]->objectName() == QString( "audioOnlyBitmap" ) )
{
- QVERIFY( tvOutConnected? val == false : val == true );
+ QVERIFY( tvOutConnected? val == false : val == true );
}
}
-
+
//
// validate generateThumbNail()
//
if ( tvOutConnected )
{
- QVERIFY( ( mController->mFileDetails->mPlaybackMode == EMPXVideoLocal )?
- mController->mThumbNailState == EThumbNailRequsted :
- mController->mThumbNailState == EThumbNailNotAvailable );
- QVERIFY( mController->mFileDetails->mTvOutPlayAllowed == value );
- QVERIFY( mController->mViewMode == EAudioOnlyView );
- QVERIFY( mController->mControlsConfig->mState == EMPXControlCmdTvOutConnected );
- QVERIFY( mController->mThumbnailManager->mThumbSize == ThumbnailManager::ThumbnailLarge );
- QVERIFY( mController->mThumbnailManager->mQuality == ThumbnailManager::OptimizeForPerformance );
- QVERIFY( mController->mViewTransitionIsGoingOn == false );
+ 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->mFileDetails->mTvOutPlayAllowed == true );
- QVERIFY( mController->mViewMode == EFullScreenView );
+ QVERIFY( mController->mViewTransitionIsGoingOn == true );
+ QVERIFY( mController->mViewMode == EFullScreenView );
}
else if ( ! mController->mFileDetails->mVideoEnabled )
{
- QVERIFY( mController->mViewTransitionIsGoingOn == false );
- QVERIFY( mController->mFileDetails->mTvOutPlayAllowed == true );
- QVERIFY( mController->mViewMode == EAudioOnlyView );
+ QVERIFY( mController->mViewTransitionIsGoingOn == false );
+ QVERIFY( mController->mViewMode == EAudioOnlyView );
}
}
@@ -607,22 +604,22 @@
void TestMPXVideoPlaybackControlsController::testHandleEventTvOutDisconnected()
{
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventTvOutDisconnected()") );
-
- init();
-
+
+ init();
+
//
// TV-Out Disconnected, value = true
//
- mController->handleEvent( EMPXControlCmdTvOutDisconnected, true );
+ mController->handleEvent( EMPXControlCmdTvOutDisconnected, true );
verifyHandleEventTvOutResult( false, true );
-
+
//
// TV-Out Disconnected, value = false
//
- mController->handleEvent( EMPXControlCmdTvOutDisconnected, false );
+ mController->handleEvent( EMPXControlCmdTvOutDisconnected, false );
verifyHandleEventTvOutResult( false, false );
-
- cleanup();
+
+ cleanup();
}
// -------------------------------------------------------------------------------------------------
@@ -632,19 +629,19 @@
void TestMPXVideoPlaybackControlsController::testHandleEventHandleErrors()
{
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventHandleErrors()") );
-
- init();
-
+
+ init();
+
//
// handle error
//
- mController->handleEvent( EMPXControlCmdHandleErrors, 0 );
-
- QVERIFY( mController->mThumbNailState == EThumbNailEmpty );
- QVERIFY( mController->mState == EPbStateNotInitialised );
- QVERIFY( mController->mViewMode == EFullScreenView );
-
- cleanup();
+ mController->handleEvent( EMPXControlCmdHandleErrors, 0 );
+
+ QVERIFY( mController->mThumbNailState == EThumbNailEmpty );
+ QVERIFY( mController->mState == EPbStateNotInitialised );
+ QVERIFY( mController->mViewMode == EFullScreenView );
+
+ cleanup();
}
// -------------------------------------------------------------------------------------------------
@@ -654,14 +651,14 @@
void TestMPXVideoPlaybackControlsController::testHandleEventShowVolumeControls()
{
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventShowVolumeControls()") );
-
- init();
-
- mController->handleEvent( EMPXControlCmdShowVolumeControls, 0 );
-
- QVERIFY( mController->mVolumeControl->mVisible == true );
-
- cleanup();
+
+ init();
+
+ mController->handleEvent( EMPXControlCmdShowVolumeControls, 0 );
+
+ QVERIFY( mController->mVolumeControl->mVisible == true );
+
+ cleanup();
}
// -------------------------------------------------------------------------------------------------
@@ -671,106 +668,106 @@
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();
+
+ 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();
}
// -------------------------------------------------------------------------------------------------
@@ -780,38 +777,51 @@
void TestMPXVideoPlaybackControlsController::testHandleTappedOnScreen()
{
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleTappedOnScreen()") );
-
- init();
-
+
+ init();
+ mController->mOrientation = Qt::Horizontal;
+ connect( this, SIGNAL( commandSignal() ), mController, SLOT( handleTappedOnScreen() ) );
+
//
- // preset variables
+ // 1. Test full screen view
//
- mFileDetails->mVideoEnabled = true;
mController->mViewMode = EFullScreenView;
-
+
//
// playing state
//
- mController->mState = EPbStatePlaying;
- mBaseVideoView->mouseReleaseEvent(0);
+ mController->mState = EPbStatePlaying;
+ emit commandSignal();
+
QVERIFY( mController->mControlsTimer->isActive() == true );
for ( int i = 0 ; i < mController->mControls.count() ; i++ )
{
- QVERIFY( mController->mControls[i]->mVisibilityState == EPbStatePlaying );
+ QVERIFY( mController->mControls[i]->mVisibilityState == mController->mState );
}
-
+
//
// pause state
//
mController->mState = EPbStatePaused;
- mBaseVideoView->mouseReleaseEvent(0);
+ emit commandSignal();
+
QVERIFY( mController->mControlsTimer->isActive() == false );
for ( int i = 0 ; i < mController->mControls.count() ; i++ )
{
- QVERIFY( mController->mControls[i]->mVisibilityState == EPbStatePaused );
+ QVERIFY( mController->mControls[i]->mVisibilityState == mController->mState );
}
-
- cleanup();
+
+
+ //
+ // 2. Test details screen view
+ //
+ mController->mViewMode = EDetailsView;
+
+ emit commandSignal();
+ QVERIFY( mController->mViewWrapper->mCommandId == EMPXPbvCmdPlayPause );
+
+ disconnect( this, SIGNAL( commandSignal() ), mController, SLOT( handleTappedOnScreen() ) );
+ cleanup();
}
// -------------------------------------------------------------------------------------------------
@@ -821,26 +831,26 @@
void TestMPXVideoPlaybackControlsController::testUpdateVideoRectDone()
{
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testUpdateVideoRectDone()") );
-
- init();
-
- mController->updateVideoRectDone();
-
+
+ init();
+
+ mController->updateVideoRectDone();
+
//
// default is full-screen
//
- QVERIFY( mController->mControlsConfig->mState == EMPXControlCmdFullScreenViewOpened );
-
+ QVERIFY( mController->mControlsConfig->mState == EMPXControlCmdFullScreenViewOpened );
+
//
// validate Details view
//
mController->mViewMode = EDetailsView;
-
- mController->updateVideoRectDone();
-
- QVERIFY( mController->mControlsConfig->mState == EMPXControlCmdDetailsViewOpened );
-
- cleanup();
+
+ mController->updateVideoRectDone();
+
+ QVERIFY( mController->mControlsConfig->mState == EMPXControlCmdDetailsViewOpened );
+
+ cleanup();
}
// -------------------------------------------------------------------------------------------------
@@ -850,9 +860,9 @@
void TestMPXVideoPlaybackControlsController::testIsAttachOperation()
{
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testIsAttachOperation()") );
-
+
//
- // get access to XQServiceUtilXtra stub
+ // get access to XQServiceUtilXtra stub
//
XQServiceUtilXtra* extraUtil = XQServiceUtilXtra::instance();
@@ -860,47 +870,46 @@
// set service enable
//
extraUtil->setCurrentService( true );
-
+
//
// initialize controlscontroller
//
- init();
-
+ init();
+
//
// verify 'mIsAttachOperation' flag is enabled
//
- QVERIFY( mController->mIsAttachOperation == true );
-
+ QVERIFY( mController->mIsAttachOperation == true );
+
//
// clean up
//
- cleanup();
-
+ cleanup();
+
//
// set service disable
//
extraUtil->setCurrentService( false );
-
+
//
// initialize controlscontroller
//
- init();
-
+ init();
+
//
// verify 'mIsAttachOperation' flag is disabled
//
- QVERIFY( mController->mIsAttachOperation == false );
-
+ QVERIFY( mController->mIsAttachOperation == false );
+
//
// clean up
//
- cleanup();
-
+ cleanup();
+
//
// dereference extraUtil count
//
extraUtil->decreaseReferenceCount();
-
}
// -------------------------------------------------------------------------------------------------
@@ -911,17 +920,32 @@
{
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testslot_skipToNextVideoItem()") );
- init();
-
+ init();
+
connect( this, SIGNAL( commandSignal() ), mController, SLOT( skipToNextVideoItem() ) );
-
- emit commandSignal();
-
- QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdNextListItem );
-
+
+ //
+ // 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();
+
+ cleanup();
}
// -------------------------------------------------------------------------------------------------
@@ -932,17 +956,32 @@
{
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testslot_skipToPreviousVideoItem()") );
- init();
-
+ init();
+
connect( this, SIGNAL( commandSignal() ), mController, SLOT( skipToPreviousVideoItem() ) );
-
- emit commandSignal();
-
- QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdPreviousListItem );
-
+
+ //
+ // 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();
+
+ cleanup();
}
// -------------------------------------------------------------------------------------------------
@@ -954,7 +993,7 @@
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testslot_attachVideo()") );
//
- // get access to XQServiceUtilXtra stub to enable XQServiceUtil::isService() method
+ // get access to XQServiceUtilXtra stub to enable XQServiceUtil::isService() method
//
XQServiceUtilXtra* extraUtil = XQServiceUtilXtra::instance();
@@ -962,52 +1001,52 @@
// set service enable
//
extraUtil->setCurrentService( true );
-
+
//
// initialize controlscontroller
//
- init();
-
+ init();
+
//
// verify view closePlaybackView() slot is not yet called
//
- QVERIFY( mController->mView->mViewClosed == false );
+ 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();
-
+ emit commandSignal();
+
//
// verify view closePlaybackView() slot is called
//
- QVERIFY( mController->mView->mViewClosed == true );
+ QVERIFY( mController->mView->mViewClosed == true );
//
// verify videoservices itemSelected() slot is called
//
- QVERIFY( mController->mVideoServices->mItemSelected == true );
-
+ QVERIFY( mController->mVideoServices->mItemSelected == true );
+
//
// disconnect signal
//
disconnect( this, SIGNAL( commandSignal() ), mController, SLOT( attachVideo() ) );
-
+
//
// clean up
//
- cleanup();
-
+ cleanup();
+
//
// dereference extraUtil count
//
extraUtil->decreaseReferenceCount();
-
+
}
// -------------------------------------------------------------------------------------------------
@@ -1017,40 +1056,194 @@
void TestMPXVideoPlaybackControlsController::testslot_sendVideo()
{
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testslot_sendVideo()") );
-
+
//
// initialize controlscontroller
//
- init();
-
+ 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();
-
+ emit commandSignal();
+
//
// verify command EMPXPbvCmdClose has been issued
//
- QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdPause );
-
+ 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();
+ 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 Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/hbvideobaseplaybackview.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 2 %
+// Version : %version: 3 %
@@ -43,8 +43,6 @@
public:
HbVideoBasePlaybackView();
virtual ~HbVideoBasePlaybackView();
-
- void mouseReleaseEvent( QGraphicsSceneMouseEvent *event );
signals:
void tappedOnScreen();
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/mpxvideoplaybackcontrol.hrh Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/mpxvideoplaybackcontrol.hrh Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: %
+// Version : %version: 2 %
#ifndef MPXVIDEOPLAYBACKCONTROL_HRH_
@@ -57,7 +57,6 @@
//
// Bitmaps
//
- EMPXBlackBitmap,
EMPXIndicatorBitmap,
EMPXRealLogoBitmap,
@@ -89,7 +88,8 @@
EMPXControlCmdSoftKeyPressed,
EMPXControlCmdFullScreenViewOpened,
EMPXControlCmdDetailsViewOpened,
- EMPXControlCmdAudionOnlyViewOpened
+ EMPXControlCmdAudionOnlyViewOpened,
+ EMPXControlCmdRemoveRNLogo
};
enum TMPXVideoSeekingType
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/mpxvideoplaybackfullscreencontrol.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/mpxvideoplaybackfullscreencontrol.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -114,7 +114,6 @@
TMPXPlaybackState mState;
TMPXPlaybackState mVisibilityState;
- protected:
QMPXVideoPlaybackControlsController* mController;
HbWidget *mControl;
TMPXVideoPlaybackControls mControlIndex;
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/mpxvideoplaybackviewfiledetails.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/mpxvideoplaybackviewfiledetails.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -70,7 +70,6 @@
bool mPartialPlayback;
bool mRNFormat;
bool mTvOutConnected;
- bool mTvOutPlayAllowed;
bool mDrmProtected;
bool mMultiItemPlaylist;
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/hbvideobaseplaybackview.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/hbvideobaseplaybackview.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 2 %
+// Version : %version: 3 %
@@ -51,17 +51,6 @@
}
// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::mouseReleaseEvent
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::mouseReleaseEvent( QGraphicsSceneMouseEvent *event )
-{
- MPX_DEBUG(_L("HbVideoBasePlaybackView::mouseReleaseEvent()"));
- Q_UNUSED( event );
- emit tappedOnScreen();
-}
-
-// -------------------------------------------------------------------------------------------------
// HbVideoBasePlaybackView::closePlaybackView()
// -------------------------------------------------------------------------------------------------
//
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackcontrolconfiguration.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackcontrolconfiguration.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -41,7 +41,6 @@
QMPXVideoPlaybackControlsController* controller)
: mControlsController( controller )
{
- createControlList();
}
// -------------------------------------------------------------------------------------------------
@@ -64,17 +63,11 @@
{
MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::createControlList()"));
- QMPXVideoPlaybackViewFileDetails* fileDetails = mControlsController->fileDetails();
+ addControlToList( EMPXBufferingAnimation );
+ addControlToList( EMPXStatusPane );
+ addControlToList( EMPXRealLogoBitmap );
- if ( fileDetails->mPlaybackMode != EMPXVideoLocal )
- {
- //
- // if it's not local mode, add branding animation control to show while initializing
- //
- addControlToList( EMPXBufferingAnimation );
- }
-
- addControlToList( EMPXStatusPane );
+ emit controlListUpdated();
}
// -------------------------------------------------------------------------------------------------
@@ -112,8 +105,8 @@
{
mState = KControlListUpdated;
}
-
-
+
+ emit controlListUpdated();
}
// -------------------------------------------------------------------------------------------------
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackdocumentloader.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackdocumentloader.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 3 %
+// Version : %version: 4 %
@@ -178,6 +178,16 @@
MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::appending[HbRatingSlider] to object list") );
mWidgets.append( object );
}
+ else if ( name == "rnLogoBitmap" )
+ {
+ MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::creating rnLogoBitmap") );
+
+ object = new HbWidget();
+ object->setObjectName( name );
+
+ MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::appending[rnLogoBitmap] to object list") );
+ mWidgets.append( object );
+ }
return object;
}
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackfullscreencontrol.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackfullscreencontrol.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 2 %
+// Version : %version: 3 %
@@ -62,7 +62,6 @@
//
void QMPXVideoPlaybackFullScreenControl::setVisible( bool visible )
{
- //mControl->setVisible( visible );
mVisible = visible;
}
@@ -72,7 +71,6 @@
//
bool QMPXVideoPlaybackFullScreenControl::isVisible()
{
- //return mControl->isVisible();
return mVisible;
}
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackviewfiledetails.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackviewfiledetails.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -67,7 +67,6 @@
mDuration = 0;
mTvOutConnected = false;
- mTvOutPlayAllowed = true;
mDrmProtected = false;
mVideoHeight = 0;
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/inc/testvideoplaybackview.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/inc/testvideoplaybackview.h Thu Jul 22 16:34:17 2010 +0100
@@ -1,5 +1,5 @@
/**
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -12,10 +12,10 @@
* Contributors:
*
* Description: tester for methods in Video Playback View Plugin
-*
+*
*/
-// Version : %version: %
+// Version : %version: 7 %
#ifndef __TESTVIDEOPLAYBACKVIEW_H__
#define __TESTVIDEOPLAYBACKVIEW_H__
@@ -37,21 +37,21 @@
* will be called before each testfunction is executed.
*
*/
- void init();
-
+ 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
+
+ // test functions for the test framework
private slots:
// the order in which these testXX methods are declared is important
@@ -60,10 +60,8 @@
void testShowDialog();
void testGetWindow();
void testIssuePlayCommand();
- void testEvent();
+ void testEventFilter();
void testClosePlaybackView();
- void testMousePressEvent();
- void testMouseReleaseEvent();
void testHandlePdlStateChange();
void testHandlePluginError();
void testHandleStoppedStatePrevView();
@@ -73,6 +71,7 @@
void testHandleSoftkeyback();
void testHandleDeactivateView();
void testDoClosePlayer();
+ void testGestureEvent();
signals:
void commandSignal();
@@ -82,10 +81,7 @@
};
-
#endif // __TESTVIDEOPLAYBACKVIEW_H__
// End of file
-
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/src/testvideoplaybackview.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/src/testvideoplaybackview.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -1,5 +1,5 @@
/**
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -12,10 +12,10 @@
* Contributors:
*
* Description: tester for methods in VideoSortFilterProxyModel
-*
+*
*/
-// Version : %version: %
+// Version : %version: 10 %
#include <e32err.h>
#include <w32std.h>
@@ -31,9 +31,12 @@
#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
@@ -43,8 +46,6 @@
#undef private
-
-
// ---------------------------------------------------------------------------
// main
// ---------------------------------------------------------------------------
@@ -53,27 +54,26 @@
{
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();
+{
+ mVideoView = new HbVideoPlaybackView();
}
// ---------------------------------------------------------------------------
@@ -96,21 +96,28 @@
mVideoView->handleActivateView();
}
-
+// -------------------------------------------------------------------------------------------------
+// TestVideoPlaybackView::testHandleActivateView()
+// -------------------------------------------------------------------------------------------------
+//
void TestVideoPlaybackView::testHandleActivateView()
{
- init();
- mVideoView->handleActivateView();
-
+ init();
+ mVideoView->handleActivateView();
+
QVERIFY( mVideoView->mVideoMpxWrapper->iMediaRequested == true );
QCOMPARE( mVideoView->mVideoMpxWrapper->iFileDetails->mBitRate, 16000 );
QCOMPARE( mVideoView->mVideoMpxWrapper->iFileDetails->mTitle, QString("Test Video Title") );
-
- cleanup();
+
+ cleanup();
}
+// -------------------------------------------------------------------------------------------------
+// TestVideoPlaybackView::testHandlePluginError()
+// -------------------------------------------------------------------------------------------------
+//
void TestVideoPlaybackView::testHandlePluginError()
-{
+{
//
// playback view is closed after displaying these error notes
//
@@ -122,55 +129,57 @@
verifyHandlePluginError( KErrMMInvalidProtocol );
verifyHandlePluginError( KErrMMInvalidURL );
verifyHandlePluginError( KErrArgument );
- verifyHandlePluginError( KErrSessionClosed );
+ verifyHandlePluginError( KErrSessionClosed );
verifyHandlePluginError( KErrTimedOut );
verifyHandlePluginError( KErrNotFound );
- verifyHandlePluginError( KErrMMNotEnoughBandwidth );
+ verifyHandlePluginError( KErrMMNotEnoughBandwidth );
verifyHandlePluginError( KErrDisconnected );
- verifyHandlePluginError( KErrMMProxyServer );
+ verifyHandlePluginError( KErrMMProxyServer );
verifyHandlePluginError( KErrCouldNotConnect );
verifyHandlePluginError( KErrAbort );
- verifyHandlePluginError( KErrCancel );
+ verifyHandlePluginError( KErrCancel );
verifyHandlePluginError( KErrMMDRMNotAuthorized );
verifyHandlePluginError( KErrCANoRights );
verifyHandlePluginError( KErrCANoPermission );
- verifyHandlePluginError( KMPXVideoTvOutPlaybackNotAllowedClose );
-
+
//
// playback view remains open after displaying these error notes
//
verifyHandlePluginError( KMPXVideoCallOngoingError, false );
- verifyHandlePluginError( KMPXVideoTvOutPlaybackNotAllowed, false );
verifyHandlePluginError( KMPXVideoPlayOver2GDuringVoiceCallError, false );
-
+
//
// default error case, playback view is closed after displaying error note
//
- verifyHandlePluginError( KErrGeneral );
+ 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();
+ emit commandSignal();
//
// verify that playback view is properly closed
@@ -181,40 +190,50 @@
// disconnect signal for handleClosePopupDialog() slot
//
disconnect( this, SIGNAL( commandSignal() ), mVideoView, SLOT( handleClosePopupDialog() ) );
-
+
//
// destruct playback view
//
- cleanup();
+ cleanup();
}
-
+// -------------------------------------------------------------------------------------------------
+// TestVideoPlaybackView::testGetWindow()
+// -------------------------------------------------------------------------------------------------
+//
void TestVideoPlaybackView::testGetWindow()
-{
+{
setup();
-
- QVERIFY( mVideoView->getWindow() != NULL );
-
+
+ QVERIFY( mVideoView->getWindow() != NULL );
+
cleanup();
}
-
+// -------------------------------------------------------------------------------------------------
+// TestVideoPlaybackView::testIssuePlayCommand()
+// -------------------------------------------------------------------------------------------------
+//
void TestVideoPlaybackView::testIssuePlayCommand()
-{
+{
setup();
-
- mVideoView->issuePlayCommand();
-
+
+ mVideoView->issuePlayCommand();
+
//JAM remove
QVERIFY( mVideoView->isEnabled() );
-
+
cleanup();
}
-void TestVideoPlaybackView::testEvent()
+// -------------------------------------------------------------------------------------------------
+// TestVideoPlaybackView::testEventFilter()
+// -------------------------------------------------------------------------------------------------
+//
+void TestVideoPlaybackView::testEventFilter()
{
setup();
-
+
//
// ensure default foreground is false
//
@@ -223,242 +242,216 @@
//
// declare foreground/background event
//
- QEvent* windowActivate = new QEvent( QEvent::WindowActivate );
- QEvent* windowDeactivate = new QEvent( QEvent::WindowDeactivate );
-
+ QEvent* appActivate = new QEvent( QEvent::ApplicationActivate );
+ QEvent* appDeactivate = new QEvent( QEvent::ApplicationDeactivate );
+
//
- // verify the returned value (consumed) of HbVideoBasePlaybackView::event()
- // for QEvent::WindowActivate is false
+ // verify the returned value (consumed) of HbVideoBasePlaybackView::event()
+ // for QEvent::ApplicationActivate is false
//
- QVERIFY( ! mVideoView->event( windowActivate ) );
-
+ 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::WindowDeactivate is false
+ // verify the returned value (consumed) of HbVideoBasePlaybackView::event()
+ // for QEvent::ApplicationDeactivate is false
//
- QVERIFY( ! mVideoView->event( windowDeactivate ) );
-
+ QVERIFY( ! mVideoView->eventFilter( NULL, appDeactivate ) );
+
//
// verify view is in background
//
QCOMPARE( mVideoView->mVideoMpxWrapper->iForeground, 0 );
-
+
//
// clean up
//
- delete windowActivate;
- windowActivate = NULL;
- delete windowDeactivate;
- windowDeactivate = NULL;
+ 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();
}
-void TestVideoPlaybackView::testMousePressEvent()
-{
- setup();
-
- //
- // declare QEvent::GraphicsSceneMousePress
- //
- QGraphicsSceneMouseEvent* event = new QGraphicsSceneMouseEvent( QEvent::GraphicsSceneMousePress );
-
- //
- // set m_accept value to false
- //
- event->setAccepted( false );
-
- //
- // simulate QEvent::GraphicsSceneMousePress event
- //
- mVideoView->mousePressEvent( event );
-
- //
- // verify event has been accepted
- //
- QVERIFY( event->isAccepted() );
-
- //
- // clean up
- //
- delete event;
- event = NULL;
- cleanup();
-}
-
-void TestVideoPlaybackView::testMouseReleaseEvent()
-{
- setup();
-
- //
- // declare QEvent::GraphicsSceneMouseRelease
- //
- QGraphicsSceneMouseEvent* event = new QGraphicsSceneMouseEvent( QEvent::GraphicsSceneMouseRelease );
-
- //
- // connect to tappedOnScreen() signal and record its emission
- //
- QSignalSpy spy( mVideoView, SIGNAL(tappedOnScreen()) );
-
- //
- // ensure signal has not been emitted yet
- //
- QCOMPARE(spy.count(), 0);
-
- //
- // simulate QEvent::GraphicsSceneMousePress event
- //
- mVideoView->mouseReleaseEvent( event );
-
- //
- // ensure signal has been emitted and its emission count is incremented
- //
- QCOMPARE(spy.count(), 1);
-
- //
- // clean up
- //
- delete event;
- event = NULL;
- spy.clear();
- 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();
}
-void TestVideoPlaybackView::testHandleStoppedStateNoPrevView()
-{
+// -------------------------------------------------------------------------------------------------
+// TestVideoPlaybackView::testHandleStoppedStatePrevView()
+// -------------------------------------------------------------------------------------------------
+//
+void TestVideoPlaybackView::testHandleStoppedStatePrevView()
+{
setup();
- QVERIFY( ! mVideoView->mTimerForClosingView->isActive() );
mVideoView->handleStoppedState();
- QVERIFY( mVideoView->mTimerForClosingView->isActive() );
+ QVERIFY( mVideoView->mTimerForClosingView->isActive() );
- cleanup();
+ cleanup();
+
}
-
-void TestVideoPlaybackView::testHandleStoppedStatePrevView()
-{
+// -------------------------------------------------------------------------------------------------
+// TestVideoPlaybackView::testHandleBackNoPrevView()
+// -------------------------------------------------------------------------------------------------
+//
+void TestVideoPlaybackView::testHandleBackNoPrevView()
+{
setup();
-
- mVideoView->handleStoppedState();
-
- QVERIFY( mVideoView->mTimerForClosingView->isActive() );
-
- cleanup();
-
-}
-void TestVideoPlaybackView::testHandleBackNoPrevView()
-{
- setup();
-
QVERIFY( ! mVideoView->mTimerForClosingView->isActive() );
mVideoView->handleBack();
- QVERIFY( mVideoView->mTimerForClosingView->isActive() );
-
+ QVERIFY( mVideoView->mTimerForClosingView->isActive() );
+
cleanup();
-
+
}
+// -------------------------------------------------------------------------------------------------
+// TestVideoPlaybackView::testHandleBackPrevView()
+// -------------------------------------------------------------------------------------------------
+//
void TestVideoPlaybackView::testHandleBackPrevView()
-{
+{
setup();
-
+
mVideoView->handleBack();
-
- QVERIFY( mVideoView->mTimerForClosingView->isActive() );
-
+
+ QVERIFY( mVideoView->mTimerForClosingView->isActive() );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestVideoPlaybackView::testHandleSoftkeyback()
+// -------------------------------------------------------------------------------------------------
+//
+void TestVideoPlaybackView::testHandleSoftkeyback()
+{
+ setup();
+
+ mVideoView->handleSoftkeyBack();
+
+ QVERIFY( mVideoView->mTimerForClosingView->isActive() );
+
cleanup();
}
-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
+{
+ // 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();
+
+ 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 );
-
+ mVideoView->handlePluginError( error );
+
//
// close playback view after error note has been launched
//
@@ -468,33 +461,182 @@
// connect and emit signal for handleClosePopupDialog() slot
//
connect( this, SIGNAL( commandSignal() ), mVideoView, SLOT( handleClosePopupDialog() ) );
- emit commandSignal();
+ 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
-
-
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/stub/inc/hbpangesture.h Thu Jul 22 16:34:17 2010 +0100
@@ -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/hbvideoplaybackview/tsrc/testvideoplaybackview/stub/inc/hbtapgesture.h Thu Jul 22 16:34:17 2010 +0100
@@ -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_*/
+
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/stub/inc/mpxvideoviewwrapper.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/stub/inc/mpxvideoviewwrapper.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 3 %
+// Version : %version: 4 %
@@ -48,26 +48,26 @@
virtual ~CMPXVideoViewWrapper();
private:
- CMPXVideoViewWrapper( HbVideoBasePlaybackView* aView );
+ CMPXVideoViewWrapper( HbVideoBasePlaybackView* aView );
void ConstructL();
-
+
void SetFileDetails(TBool aDefault);
public:
void HandleCommandL( TInt aCommand );
-
+
TBool IsLive();
-
+
TBool IsPlaylist();
-
+
TBool IsMultiItemPlaylist();
-
- void RequestMediaL();
-
+
+ void RequestMediaL();
+
void CreateGeneralPlaybackCommandL( int aCmd );
-
+
void ActivateClosePlayerActiveObject();
-
+
void IssueVideoAppForegroundCmdL( TBool aForeground );
@@ -78,7 +78,7 @@
QMPXVideoPlaybackViewFileDetails* iFileDetails;
TBool iClosePlayerAO;
TBool iForeground;
-
+ TInt iCommand;
};
#endif // __MPXVIDEOVIEWWRAPPER_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/stub/src/hbpangesture.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -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/hbvideoplaybackview/tsrc/testvideoplaybackview/stub/src/hbtapgesture.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -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
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/stub/src/mpxvideoviewwrapper.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/stub/src/mpxvideoviewwrapper.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 5 %
+// Version : %version: 7 %
@@ -33,7 +33,7 @@
// -------------------------------------------------------------------------------------------------
//
CMPXVideoViewWrapper::CMPXVideoViewWrapper( HbVideoBasePlaybackView* aView )
- : iView( aView )
+ : iView( aView )
{
}
@@ -58,7 +58,7 @@
//
void CMPXVideoViewWrapper::ConstructL()
{
- iMediaRequested = EFalse;
+ iMediaRequested = EFalse;
}
// -------------------------------------------------------------------------------------------------
@@ -84,7 +84,7 @@
//
TBool CMPXVideoViewWrapper::IsPlaylist()
{
- return EFalse;
+ return EFalse;
}
// -------------------------------------------------------------------------------------------------
@@ -102,21 +102,7 @@
//
void CMPXVideoViewWrapper::HandleCommandL( TInt aCommand )
{
- switch ( aCommand )
- {
- case EMPXPbvCmdNextListItem:
- {
- SetFileDetails( EFalse );
- break;
- }
-
- case EMPXPbvCmdPreviousListItem:
- {
- SetFileDetails( ETrue );
- break;
- }
- }
-
+ iCommand = aCommand;
}
// -------------------------------------------------------------------------------------------------
@@ -126,12 +112,11 @@
void CMPXVideoViewWrapper::RequestMediaL()
{
iMediaRequested = ETrue;
-
+
SetFileDetails( ETrue );
-
+
}
-
// -------------------------------------------------------------------------------------------------
// CMPXVideoViewWrapper::ActivateClosePlayerActiveObject
// -------------------------------------------------------------------------------------------------
@@ -161,64 +146,54 @@
delete iFileDetails;
iFileDetails = NULL;
}
-
- iFileDetails = new QMPXVideoPlaybackViewFileDetails();
-
-
- _LIT(KTestMimeType, "video/3gp");
+
+ iFileDetails = new QMPXVideoPlaybackViewFileDetails();
+
+ _LIT(KTestMimeType, "video/3gp");
const QString qMimeType( (QChar*)KTestMimeType().Ptr(), KTestMimeType().Length() );
- iFileDetails->mMimeType = qMimeType;
-
-
+ iFileDetails->mMimeType = qMimeType;
+
_LIT(KTestTitle, "Test Video Title");
const QString qTitle( (QChar*)KTestTitle().Ptr(), KTestTitle().Length() );
- iFileDetails->mTitle = qTitle;
-
-
+ 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;
+ iFileDetails->mClipName = qClipname;
}
else
{
_LIT(KTestClipName, "nextClip.3gp");
const QString qClipname( (QChar*)KTestClipName().Ptr(), KTestClipName().Length() );
- iFileDetails->mClipName = qClipname;
+ iFileDetails->mClipName = qClipname;
}
-
-
+
iFileDetails->mPlaybackMode = EMPXVideoLocal;
iFileDetails->mSeekable = true;
iFileDetails->mPausableStream = true;
@@ -228,12 +203,11 @@
iFileDetails->mRNFormat = false;
iFileDetails->mDuration = 100;
iFileDetails->mTvOutConnected = false;
- iFileDetails->mTvOutPlayAllowed = true;
iFileDetails->mDrmProtected = false;
iFileDetails->mMultiItemPlaylist = false;
iFileDetails->mVideoHeight = 320;
iFileDetails->mVideoWidth = 240;
- iFileDetails->mBitRate = 16000;
+ iFileDetails->mBitRate = 16000;
}
// -------------------------------------------------------------------------------------------------
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/testvideoplaybackview.pro Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/testvideoplaybackview.pro Thu Jul 22 16:34:17 2010 +0100
@@ -14,36 +14,37 @@
# Description: Project file for building Videoplayer components
#
#
-# Version : %version: 7 %
+# Version : %version: 8 %
TEMPLATE = app
TARGET = testvideoplaybackview
CONFIG += qtestlib hb qt
DEFINES += BUILD_VIDEOPLAYBACK_DLL
-DEPENDPATH += . \
- inc \
- src
+DEPENDPATH += . inc src stub/src stub/inc
-INCLUDEPATH += ../../inc \
- ../../../inc \
+INCLUDEPATH += stub/inc \
+ ../../inc \
../../../../inc \
../../controlinc \
- $$MW_LAYER_SYSTEMINCLUDE
LIBS += -lcone.dll \
-lcommonengine.dll \
-lflogger.dll
# Input
-HEADERS += stub/inc/mpxvideoviewwrapper.h \
- inc/testvideoplaybackview.h \
+HEADERS += mpxvideoviewwrapper.h \
+ testvideoplaybackview.h \
../../../inc/hbvideobaseplaybackview.h \
../../../inc/hbvideoplaybackview.h \
- ../../inc/mpxvideoplaybackviewfiledetails.h
+ mpxvideoplaybackviewfiledetails.h \
+ hbtapgesture.h \
+ hbpangesture.h
-SOURCES += stub/src/mpxvideoviewwrapper.cpp \
- src/testvideoplaybackview.cpp \
- ../../viewsrc/hbvideobaseplaybackview.cpp \
- ../../viewsrc/hbvideoplaybackview.cpp \
- ../../viewsrc/mpxvideoplaybackviewfiledetails.cpp
+SOURCES += mpxvideoviewwrapper.cpp \
+ testvideoplaybackview.cpp \
+ ../../viewsrc/hbvideobaseplaybackview.cpp \
+ ../../viewsrc/hbvideoplaybackview.cpp \
+ ../../viewsrc/mpxvideoplaybackviewfiledetails.cpp \
+ hbtapgesture.cpp \
+ hbpangesture.cpp
--- a/videoplayback/hbvideoplaybackview/viewinc/mpxvideocontainer.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/viewinc/mpxvideocontainer.h Thu Jul 22 16:34:17 2010 +0100
@@ -11,11 +11,11 @@
*
* Contributors:
*
-* Description:
+* Description: CCoeControl to provide RWindow for videoplayback
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
#ifndef CMPXVIDEOCONTAINER_H
@@ -32,9 +32,6 @@
virtual ~CMPXVideoContainer();
void ConstructL();
-
- protected:
- void Draw(const TRect& aRect) const;
};
#endif // CMPXVIDEOCONTAINER_H
--- a/videoplayback/hbvideoplaybackview/viewinc/mpxvideoviewwrapper.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/viewinc/mpxvideoviewwrapper.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#12 %
+// Version : %version: da1mmcf#16 %
@@ -35,7 +35,12 @@
#include "mpxvideoplaybackcontrol.hrh"
-// Constants
+enum TMPXMediaRequestStatus
+{
+ MediaNotRequested,
+ MediaRequested,
+ MediaDelivered
+};
// Forward Declarations
class MMPXPlaybackUtility;
@@ -59,14 +64,14 @@
virtual ~CMPXVideoViewWrapper();
private:
- CMPXVideoViewWrapper( HbVideoBasePlaybackView* aView );
+ CMPXVideoViewWrapper( HbVideoBasePlaybackView* aView );
void ConstructL();
public:
virtual void HandleCommandL( TInt aCommand );
void RetrieveFileNameAndModeL( CMPXCommand* aCmd );
-
+
/*
* From MMPXViewActivationObserver
* Handle view activation.
@@ -75,7 +80,7 @@
* @param aPreviousViewType Previous view type Uid.
*/
inline void HandleViewActivation( const TUid& /*aCurrentViewType*/,
- const TUid& /*aPreviousViewType*/ ) {}
+ const TUid& /*aPreviousViewType*/ ) {}
/**
* From MMPXPlaybackObserver
@@ -158,19 +163,19 @@
*/
void SetPropertyL( TMPXPlaybackProperty aProperty, TInt aValue );
virtual void RetrievePdlInformationL();
-
+
TBool IsLive();
-
+
TBool IsPlaylist();
-
- void IssueVideoAppForegroundCmdL(TBool aForeground);
-
- void RequestMediaL();
-
- void CreateGeneralPlaybackCommandL( TMPXPlaybackCommand aCmd );
-
+
+ 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
@@ -191,9 +196,6 @@
void HandleBufferingStateL();
- void IssuePlayCommandL();
-
-
/*
* Provides the static function for the callback to close the player
* Called by CIdle iIdle
@@ -201,14 +203,14 @@
* @param aPtr Pointer to callback class
* @return KErrNone
*/
- static TInt ClosePlayerL( TAny* aPtr );
+ static TInt ClosePlayer( TAny* aPtr );
/*
* Called to stop and exit the player
* @since 3.2
* @return void
*/
- void DoClosePlayerL();
+ void DoClosePlayer();
void HandleVideoPlaybackMessage( CMPXMessage* aMessage );
@@ -246,12 +248,14 @@
void HandleGeneralPlaybackMessageL( CMPXMessage* aMessage );
- void SetAspectRatioL( TMPXVideoPlaybackCommand aCmd );
+ void SetAspectRatioL( TMPXVideoPlaybackCommand aCmd );
void HandleVolumeCmdL( TMPXPlaybackCommand aCmd );
void HandleShortPressBackwardL();
+ void IssuePlayCommandL();
+
protected: // data
MMPXPlaybackUtility* iPlaybackUtility;
MMPXCollectionUtility* iCollectionUtility;
@@ -264,9 +268,13 @@
CMPXVideoPlaybackDisplayHandler* iDisplayHandler;
CMPXVideoPlaybackUserInputHandler* iUserInputHandler;
QMPXVideoPlaybackControlsController* iControlsController;
+
+ TMPXMediaRequestStatus iMediaRequestStatus;
+ TBool iPlaylistView;
+ int iPlayPosition;
- TBool iMediaRequested;
- TBool iPlaylistView;
+ public:
+ friend class HbVideoBasePlaybackView;
};
#endif // __MPXVIDEOVIEWWRAPPER_H__
--- a/videoplayback/hbvideoplaybackview/viewsrc/hbvideobaseplaybackview.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/viewsrc/hbvideobaseplaybackview.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#38 %
+// Version : %version: da1mmcf#43 %
@@ -31,6 +31,8 @@
#include <hbinstance.h>
#include <hbnotificationdialog.h>
#include <hblabel.h>
+#include <hbtapgesture.h>
+#include <hbpangesture.h>
#include <textresolver.h>
#include <mmf/common/mmferrors.h>
@@ -38,11 +40,14 @@
#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"
@@ -56,6 +61,7 @@
: mVideoMpxWrapper( NULL )
, mTimerForClosingView( NULL )
, mActivated( false )
+ , mStayPaused ( false )
{
MPX_ENTER_EXIT(_L("HbVideoBasePlaybackView::HbVideoBasePlaybackView()"));
}
@@ -66,8 +72,8 @@
//
void HbVideoBasePlaybackView::initializeVideoPlaybackView()
{
- MPX_ENTER_EXIT(_L("HbVideoBasePlaybackView::initializeVideoPlaybackView()"));
-
+ MPX_ENTER_EXIT(_L("HbVideoBasePlaybackView::initializeVideoPlaybackView()"));
+
//
// Need to set to control full screen including status pane area
//
@@ -77,6 +83,23 @@
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;
+ }
}
// -------------------------------------------------------------------------------------------------
@@ -88,9 +111,9 @@
MPX_DEBUG(_L("HbVideoBasePlaybackView::~HbVideoBasePlaybackView()"));
if ( mTimerForClosingView )
- {
+ {
disconnect( mTimerForClosingView, SIGNAL( timeout() ), this, SIGNAL( activatePreviousView() ) );
-
+
if ( mTimerForClosingView->isActive() )
{
mTimerForClosingView->stop();
@@ -116,23 +139,26 @@
void HbVideoBasePlaybackView::handleActivateView()
{
MPX_ENTER_EXIT(_L("HbVideoBasePlaybackView::handleActivateView()"));
-
- TRAP_IGNORE( mVideoMpxWrapper = CMPXVideoViewWrapper::NewL( this ) );
-
+
+ MPX_TRAPD( err, mVideoMpxWrapper = CMPXVideoViewWrapper::NewL( this ) );
+
+ QCoreApplication::instance()->installEventFilter( this );
+
//
// Request the needed Media from the Playback Plugin
//
- TRAP_IGNORE( mVideoMpxWrapper->RequestMediaL() );
-
+ MPX_TRAP( err, mVideoMpxWrapper->RequestMediaL() );
+
menu()->close();
//
// Landscape orientation
- //
- hbInstance->allMainWindows()[0]->setOrientation( Qt::Horizontal );
+ // Workaround: Disable orientation transition effect
+ // since orbit couldn't emit the orientationChanged signal with transition effect
+ //
+ hbInstance->allMainWindows()[0]->setOrientation( Qt::Horizontal, false );
- mActivated = true;
-
+ mActivated = true;
}
// -------------------------------------------------------------------------------------------------
@@ -143,9 +169,13 @@
{
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 ) );
@@ -163,6 +193,25 @@
}
// -------------------------------------------------------------------------------------------------
+// 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()
// -------------------------------------------------------------------------------------------------
//
@@ -211,24 +260,24 @@
}
default:
{
- TRAP_IGNORE(
+ 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
//
@@ -238,7 +287,6 @@
// display error and close playback view
//
showDialog( qString );
-
);
}
}
@@ -251,39 +299,39 @@
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,
+ // 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();
+ HbNotificationDialog* dlg = new HbNotificationDialog();
dlg->setAttribute( Qt::WA_DeleteOnClose );
- dlg->setMinimumSize( QSizeF(200, 100) );
- dlg->setPreferredPos( QPointF( screenRect.height()/2, screenRect.width()/2 ),
+ 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() ) );
+ 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();
+ dlg->show();
}
// -------------------------------------------------------------------------------------------------
@@ -306,7 +354,11 @@
void HbVideoBasePlaybackView::issuePlayCommand()
{
MPX_ENTER_EXIT(_L("HbVideoBasePlaybackView::issuePlayCommand()"));
- TRAPD(err, mVideoMpxWrapper->CreateGeneralPlaybackCommandL( EPbCmdPlay ));
+
+ int err = KErrNone;
+
+ TRAP( err, mVideoMpxWrapper->CreateGeneralPlaybackCommandL( EPbCmdPlay ));
+
MPX_DEBUG(_L("HbVideoBasePlaybackView::issuePlayCommand() error = %d"), err);
}
@@ -326,7 +378,6 @@
void HbVideoBasePlaybackView::handleBufferingState()
{
MPX_DEBUG(_L("HbVideoBasePlaybackView::handleBufferingState()"));
-
}
// -------------------------------------------------------------------------------------------------
@@ -337,31 +388,40 @@
{
MPX_ENTER_EXIT(_L("HbVideoBasePlaybackView::closePlaybackView()"));
- mTimerForClosingView->start( 0 );
+ mTimerForClosingView->start( 0 );
}
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::event()
-// -------------------------------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// HbVideoBasePlaybackView::eventFilter
+// ---------------------------------------------------------------------------
//
-bool HbVideoBasePlaybackView::event( QEvent *event )
+bool HbVideoBasePlaybackView::eventFilter( QObject *object, QEvent *event )
{
- bool consumed = false;
+ Q_UNUSED( object );
- if ( event->type() == QEvent::WindowActivate && mActivated )
+ switch ( event->type() )
{
- TRAP_IGNORE( mVideoMpxWrapper->IssueVideoAppForegroundCmdL( true ) );
- }
- else if ( event->type() == QEvent::WindowDeactivate && mActivated )
- {
- TRAP_IGNORE( mVideoMpxWrapper->IssueVideoAppForegroundCmdL( false ) );
- }
- else
- {
- consumed = QGraphicsWidget::event( event );
+ case QEvent::ApplicationActivate:
+ {
+ if ( mActivated )
+ {
+ MPX_DEBUG(_L("HbVideoBasePlaybackView::eventFilter foreground()") );
+ TRAP_IGNORE( mVideoMpxWrapper->IssueVideoAppForegroundCmdL( true ) );
+ }
+ break;
+ }
+ case QEvent::ApplicationDeactivate:
+ {
+ if ( mActivated )
+ {
+ MPX_DEBUG(_L("HbVideoBasePlaybackView::eventFilter background()") );
+ TRAP_IGNORE( mVideoMpxWrapper->IssueVideoAppForegroundCmdL( false ) );
+ }
+ break;
+ }
}
- return consumed;
+ return QObject::eventFilter( object, event );
}
// -------------------------------------------------------------------------------------------------
@@ -374,31 +434,6 @@
}
// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::mousePress
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::mousePressEvent( QGraphicsSceneMouseEvent *event )
-{
- //
- // Needed for gesture framework
- //
- event->accept();
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbVideoBasePlaybackView::mouseReleaseEvent
-// -------------------------------------------------------------------------------------------------
-//
-void HbVideoBasePlaybackView::mouseReleaseEvent( QGraphicsSceneMouseEvent *event )
-{
- MPX_ENTER_EXIT(_L("HbVideoBasePlaybackView::mouseReleaseEvent"));
-
- Q_UNUSED( event );
-
- emit tappedOnScreen();
-}
-
-// -------------------------------------------------------------------------------------------------
// HbVideoBasePlaybackView::handleClosePopupDialog()
// -------------------------------------------------------------------------------------------------
//
@@ -409,5 +444,41 @@
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 Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/viewsrc/hbvideoplaybackview.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#10 %
+// Version : %version: da1mmcf#11 %
@@ -44,6 +44,7 @@
MPX_ENTER_EXIT(_L("HbVideoPlaybackView::HbVideoPlaybackView()"));
initializeVideoPlaybackView();
+ mSyncClose = false;
}
// -------------------------------------------------------------------------------------------------
--- a/videoplayback/hbvideoplaybackview/viewsrc/mpxvideocontainer.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/viewsrc/mpxvideocontainer.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -11,40 +11,35 @@
*
* Contributors:
*
-* Description:
+* Description: CCoeControl to provide RWindow for videoplayback
*
*/
-// Version : %version: 1 %
+// 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();
}
-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/viewsrc/mpxvideoplaybackdisplayhandler.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/viewsrc/mpxvideoplaybackdisplayhandler.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 20 %
+// Version : %version: ou1cpsw#26 %
#include <sysutil.h>
#include <s32file.h>
@@ -23,7 +23,6 @@
#include <mpxcommandgeneraldefs.h>
#include <mpxplaybackutility.h>
#include <mpxvideoplaybackdefs.h>
-#include <alfcompositionutility.h>
#include "mpxvideocontainer.h"
#include "mpxvideoviewwrapper.h"
@@ -69,7 +68,7 @@
if ( iVideoDisplay )
{
SurfaceRemoved();
-
+
delete iVideoDisplay;
iVideoDisplay = NULL;
}
@@ -102,7 +101,7 @@
//
void CMPXVideoPlaybackDisplayHandler::ConstructL()
{
- iResizingTimer = CPeriodic::NewL( CActive::EPriorityStandard );
+ iResizingTimer = CPeriodic::NewL( CActive::EPriorityStandard );
LoadAspectRatioL();
}
@@ -118,12 +117,14 @@
{
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::CreateDisplayWindowL()"));
- //
- // Workaround start for PREQ-2669
- //
- iVideoContainer = new ( ELeave ) CMPXVideoContainer();
- iVideoContainer->ConstructL();
- iVideoContainer->SetRect( aDisplayRect );
+ if ( ! iVideoContainer )
+ {
+ iVideoContainer = new ( ELeave ) CMPXVideoContainer();
+ iVideoContainer->ConstructL();
+ iVideoContainer->SetRect( aDisplayRect );
+ }
+
+ aWin.SetSurfaceTransparency( ETrue );
RWindowBase *videoWindow = iVideoContainer->DrawableWindow();
videoWindow->SetOrdinalPosition( -1 );
@@ -132,23 +133,6 @@
MPX_DEBUG(_L("VideoWindow ordinal position is: %d"), videoWindow->OrdinalPosition());
MPX_DEBUG(_L("UiWindow ordinal position is: %d"), (&aWin)->OrdinalPosition());
- TRAPD
- ( status,
- {
- CAlfCompositionSource* me = CAlfCompositionSource::NewL( aWin );
- me->EnableAlpha();
- delete me;
- me = NULL;
- }
- );
-
- MPX_DEBUG(
- _L("CMPXVideoPlaybackDisplayHandler::CreateDisplayWindowL() status : %d"), status);
-
- //
- // Workaround end
- //
-
AddDisplayWindowL( aScreenDevice, *videoWindow, (RWindow*)videoWindow );
}
@@ -166,7 +150,7 @@
delete iVideoDisplay;
iVideoDisplay = NULL;
}
-
+
if ( iVideoContainer )
{
delete iVideoContainer;
@@ -241,8 +225,7 @@
// -------------------------------------------------------------------------------------------------
//
TInt CMPXVideoPlaybackDisplayHandler::SetDefaultAspectRatioL(
- QMPXVideoPlaybackViewFileDetails* aFileDetails,
- TReal32 aDisplayAspectRatio )
+ QMPXVideoPlaybackViewFileDetails* aFileDetails, TReal32 aDisplayAspectRatio )
{
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::SetDefaultAspectRatioL()"));
@@ -274,17 +257,21 @@
//
// if can't find out match aspect ratio in dat file,
// choose the scaling type through the rule
- // videoAspectRatio - aDisplayAspectRatio > 0.1 ==> zoom
- // videoAspectRatio - aDisplayAspectRatio < 0.1 ==> stretch
- // videoAspectRatio = aDisplayAspectRatio ==> natural
+ // 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 )
+ else if ( ( videoAspectRatio != aDisplayAspectRatio ) &&
+ ( videoAspectRatio - aDisplayAspectRatio > (- 0.3) ) )
{
scalingType = EMMFStretch;
}
@@ -428,10 +415,10 @@
iResizingTimer->Cancel();
}
- iResizingTimer->Start(
+ iResizingTimer->Start(
0,
KVIDEORESIZINGREPEATRATE,
- TCallBack( CMPXVideoPlaybackDisplayHandler::UpdateVideoRectTimeOutL, this ) );
+ TCallBack( CMPXVideoPlaybackDisplayHandler::UpdateVideoRectTimeOutL, this ) );
}
else
{
@@ -464,8 +451,8 @@
{
iTransitionEffectCnt++;
- TRect windowRect( (TInt)( (TReal32)iWindowRect.iTl.iX - iTlXDiff * (TReal32)iTransitionEffectCnt ),
- (TInt)( (TReal32)iWindowRect.iTl.iY - iTlYDiff * (TReal32)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 ) );
@@ -500,7 +487,7 @@
if ( iVideoDisplay )
{
- iVideoDisplay->SetVideoExtentL( *iWindowBase, aRect, TRect( iWindowBase->Size() ) );
+ iVideoDisplay->SetVideoExtentL( *iWindowBase, aRect, TRect( iWindowBase->Size() ) );
}
}
@@ -535,9 +522,9 @@
{
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);
@@ -576,7 +563,7 @@
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::SurfaceCreatedL()"));
TSurfaceId oldSurfaceId = iSurfaceId;
-
+
//
// Extract the surface parameters from the message
//
--- a/videoplayback/hbvideoplaybackview/viewsrc/mpxvideoviewwrapper.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/hbvideoplaybackview/viewsrc/mpxvideoviewwrapper.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#30 %
+// Version : %version: da1mmcf#37 %
@@ -60,7 +60,7 @@
CMPXVideoViewWrapper::CMPXVideoViewWrapper( HbVideoBasePlaybackView* aView )
: iView( aView )
, iControlsController( NULL )
- , iMediaRequested( false )
+ , iMediaRequestStatus( MediaNotRequested )
, iPlaylistView( false )
{
}
@@ -90,7 +90,7 @@
{
MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::ConstructL()"));
- iPlaybackUtility =
+ iPlaybackUtility =
MMPXPlaybackUtility::UtilityL( EMPXCategoryVideo, KPbModeDefault );
iPlaybackUtility->AddObserverL( *this );
iPlaybackUtility->SetPrimaryClientL();
@@ -98,8 +98,8 @@
//
// Create Active Object for closing player
//
- iCloseAO = CIdle::NewL( CActive::EPriorityStandard );
-
+ iCloseAO = CIdle::NewL( CActive::EPriorityStandard );
+
//
// Create Video Playback Display Handler
//
@@ -176,7 +176,7 @@
//
TBool CMPXVideoViewWrapper::IsLive()
{
- return (iFileDetails->mPlaybackMode == EMPXVideoLiveStreaming);
+ return ( iFileDetails->mPlaybackMode == EMPXVideoLiveStreaming );
}
// -------------------------------------------------------------------------------------------------
@@ -192,19 +192,20 @@
// CMPXVideoViewWrapper::CreateGeneralPlaybackCommandL()
// -------------------------------------------------------------------------------------------------
//
-void CMPXVideoViewWrapper::CreateGeneralPlaybackCommandL( TMPXPlaybackCommand aCmd )
+void CMPXVideoViewWrapper::CreateGeneralPlaybackCommandL( TMPXPlaybackCommand aCmd, TBool aDoSync )
{
- MPX_DEBUG(_L("CMPXVideoViewWrapper::CreateGeneralPlaybackCommandL(%d)"), aCmd );
+ MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::CreateGeneralPlaybackCommandL()"),
+ _L("aCmd = %d, aDoSync, = %d"), aCmd, aDoSync );
CMPXCommand* cmd = CMPXCommand::NewL();
CleanupStack::PushL( cmd );
- cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
+ cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, aDoSync );
cmd->SetTObjectValueL<TBool>( KMPXCommandPlaybackGeneralNoBuffer, ETrue );
cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId, KMPXCommandIdPlaybackGeneral );
cmd->SetTObjectValueL<TInt>( KMPXCommandPlaybackGeneralType, aCmd );
- iPlaybackUtility->CommandL( *cmd );
+ iPlaybackUtility->CommandL( *cmd, this );
CleanupStack::PopAndDestroy( cmd );
}
@@ -223,7 +224,8 @@
{
case EMPXPbvCmdPlay:
{
- IssuePlayCommandL();
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EPbCmdPlay"));
+ CreateGeneralPlaybackCommandL( EPbCmdPlay );
break;
}
case EMPXPbvCmdPause:
@@ -235,8 +237,13 @@
case EMPXPbvCmdClose:
{
MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdClose"));
-
- CreateGeneralPlaybackCommandL( EPbCmdClose );
+
+ //
+ // closing playback view occurs:
+ // - synchronously (mSyncClose=true) for PDL case (when PDL is supported)
+ // - asynchronously (mSyncClose=false) for all other cases
+ //
+ CreateGeneralPlaybackCommandL( EPbCmdClose, iView->mSyncClose );
break;
}
case EMPXPbvCmdSeekForward:
@@ -259,8 +266,17 @@
}
case EMPXPbvCmdPlayPause:
{
- MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdPause"));
- iPlaybackUtility->CommandL( EPbCmdPlayPause );
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdPlayPause"));
+
+ if ( iPlaybackState == EPbStatePlaying )
+ {
+ CreateGeneralPlaybackCommandL( EPbCmdPause );
+ }
+ else if ( iPlaybackState == EPbStatePaused )
+ {
+ CreateGeneralPlaybackCommandL( EPbCmdPlay );
+ }
+
break;
}
case EMPXPbvCmdStop:
@@ -323,30 +339,44 @@
}
case EMPXPbvCmdResetControls:
{
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdResetControls"));
+
CreateControlsL();
iView->retrievePdlInformation();
break;
}
case EMPXPbvCmdNextListItem:
{
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdNextListItem"));
+
if ( iPlaylistView && iFileDetails->mMultiItemPlaylist )
{
- iPlaybackUtility->CommandL( EPbCmdNext );
+ CreateGeneralPlaybackCommandL( EPbCmdNext );
}
+ else
+ {
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() ignore EMPXPbvCmdNextListItem"));
+ }
+
break;
}
- case EMPXPbvCmdPreviousListItem:
+ case EMPXPbvCmdPreviousListItem:
{
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdPreviousListItem"));
+
if ( iPlaylistView && iFileDetails->mMultiItemPlaylist )
{
- //
- // the command is being sent twice on purpose
- // one EMPXPbvCmdPreviousListItem command only sets the position to 0
- // the second cmd actually goes to the previous item in the list
+ //
+ // Need to send sync message to go back to a previous clip
+ // regardless of current positoin
//
- iPlaybackUtility->CommandL( EPbCmdPrevious );
- iPlaybackUtility->CommandL( EPbCmdPrevious );
+ CreateGeneralPlaybackCommandL( EPbCmdPrevious );
}
+ else
+ {
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() ignore EMPXPbvCmdNextListItem"));
+ }
+
break;
}
case EMPXPbvCmdEndOfClip:
@@ -364,6 +394,12 @@
CreateVideoSpecificCmdL( EPbCmdCustomPlay );
break;
}
+ case EMPXPbvCmdRealOneBitmapTimeout:
+ {
+ IssuePlayCommandL();
+
+ break;
+ }
}
}
@@ -395,9 +431,10 @@
{
MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::RequestMediaL()"));
- if ( ! iMediaRequested && iPlaybackUtility->StateL() == EPbStateInitialised )
+ if ( iMediaRequestStatus == MediaNotRequested &&
+ iPlaybackUtility->StateL() == EPbStateInitialised )
{
- iMediaRequested = ETrue;
+ iMediaRequestStatus = MediaRequested;
//
// Request the volume for the controls
@@ -433,7 +470,7 @@
specs->SetTObjectValueL<TBool>(KMPXMediaGeneralExtMediaRedirect, ETrue);
- s->MediaL( attrs.Array(), *this, specs);
+ s->MediaL( attrs.Array(), *this, specs );
CleanupStack::PopAndDestroy( specs );
CleanupStack::PopAndDestroy( &attrs );
@@ -563,7 +600,7 @@
if ( iUserInputHandler )
{
- TRAP_IGNORE(iUserInputHandler->HandleTVOutEventL( tvOutConnected ));
+ TRAP_IGNORE(iUserInputHandler->HandleTVOutEventL( tvOutConnected ));
}
if ( iControlsController )
@@ -612,11 +649,11 @@
//
if ( iPlaybackState != EPbStateNotInitialised )
{
- iMediaRequested = EFalse;
+ iMediaRequestStatus = MediaNotRequested;
HandleCommandL( EMPXPbvCmdResetControls );
if ( iFileDetails )
- {
+ {
iFileDetails->clearFileDetails();
}
}
@@ -642,7 +679,7 @@
}
else
{
- iView->closePlaybackView();
+ iView->closePlaybackView();
}
break;
@@ -845,7 +882,7 @@
{
iFileDetails->mDrmProtected = aMedia.ValueTObjectL<TInt>( KMPXMediaVideoDrmProtected );
}
-
+
//
// Description
//
@@ -855,7 +892,7 @@
const QString qDescription( (QChar*)description.Ptr(), description.Length() );
iFileDetails->mDescription = qDescription;
}
-
+
//
// Location
//
@@ -865,7 +902,7 @@
const QString qLocation( (QChar*)location.Ptr(), location.Length() );
iFileDetails->mLocation = qLocation;
}
-
+
//
// Copyright
//
@@ -875,7 +912,7 @@
const QString qCopyright( (QChar*)copyright.Ptr(), copyright.Length() );
iFileDetails->mCopyright = qCopyright;
}
-
+
//
// Language
//
@@ -885,7 +922,7 @@
const QString qLanguage( (QChar*)language.Ptr(), language.Length() );
iFileDetails->mLanguage = qLanguage;
}
-
+
//
// Keywords
//
@@ -895,7 +932,7 @@
const QString qKeywords( (QChar*)keywords.Ptr(), keywords.Length() );
iFileDetails->mKeywords = qKeywords;
}
-
+
//
// Creation date/time
//
@@ -903,7 +940,7 @@
{
iFileDetails->mCreationTime = aMedia.ValueTObjectL<TInt>( KMPXMediaVideoCreated );
}
-
+
//
// Last Modified date/time
//
@@ -911,7 +948,7 @@
{
iFileDetails->mModificationTime = aMedia.ValueTObjectL<TInt>( KMPXMediaVideoLastModified );
}
-
+
}
// -------------------------------------------------------------------------------------------------
@@ -926,65 +963,30 @@
if ( aError == KErrNone )
{
- if ( iFileDetails )
- {
- iFileDetails->clearFileDetails();
- }
- else
+ iMediaRequestStatus = MediaDelivered;
+
+ if ( ! iFileDetails )
{
iFileDetails = new QMPXVideoPlaybackViewFileDetails();
- }
-
+ }
+
//
// Read in the media data
//
ParseMetaDataL( aMedia );
//
- // Create controls since file details are available
+ // If RN logo is still visible, wait for timeout of rn logo timer
+ // If RN logo is not visible, issue play
//
- if ( iControlsController )
- {
- iControlsController->addFileDetails( iFileDetails );
- }
-
- if ( iFileDetails->mVideoEnabled )
+ if ( ! iControlsController->isRNLogoBitmapInControlList() )
{
- //
- // get window size
- //
- RWindow *window = iView->getWindow();
- TRect displayRect = TRect( TPoint( window->Position() ), TSize( window->Size() ) );
-
- //
- // get window aspect ratio
- // if device is in landscape mode, width > height
- // if device is in portrait mode, width < height
- //
- TReal32 width = (TReal32) displayRect.Width();
- TReal32 height = (TReal32) displayRect.Height();
- TReal32 displayAspectRatio = (width > height)? (width / height) : (height / width);
-
- //
- // get new aspect ratio
- TInt newAspectRatio =
- iDisplayHandler->SetDefaultAspectRatioL( iFileDetails, displayAspectRatio );
-
- //
- // Setup the display window and issue play command
- //
- iDisplayHandler->CreateDisplayWindowL( CCoeEnv::Static()->WsSession(),
- *(CCoeEnv::Static()->ScreenDevice()),
- *window,
- displayRect );
-
- if ( iControlsController )
- {
- iControlsController->handleEvent( EMPXControlCmdSetAspectRatio, newAspectRatio );
- }
+ IssuePlayCommandL();
}
-
- CreateGeneralPlaybackCommandL( EPbCmdPlay );
+ }
+ else
+ {
+ iMediaRequestStatus = MediaNotRequested;
}
}
@@ -997,13 +999,14 @@
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
- iMediaRequested = EFalse;
+ iMediaRequestStatus = MediaNotRequested;
// Reset the playback state to stopped
iPlaybackState = EPbStateStopped;
// Handle the plugin error
@@ -1031,9 +1034,8 @@
// CMPXVideoViewWrapper::HandlePropertyL()
// -------------------------------------------------------------------------------------------------
//
-void CMPXVideoViewWrapper::HandlePropertyL( TMPXPlaybackProperty aProperty,
- TInt aValue,
- TInt aError )
+void
+CMPXVideoViewWrapper::HandlePropertyL( TMPXPlaybackProperty aProperty, TInt aValue, TInt aError )
{
MPX_DEBUG(_L("CMPXVideoViewWrapper::HandlePropertyL - Error(%d)"), aError );
@@ -1049,7 +1051,9 @@
{
iControlsController->handleEvent( EMPXControlCmdSetPosition, aValue );
}
-
+
+ iPlayPosition = aValue;
+
break;
}
case EPbPropertyDuration:
@@ -1101,6 +1105,8 @@
//
void CMPXVideoViewWrapper::RetrieveFileNameAndModeL( CMPXCommand* aCmd )
{
+ MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::RetrieveFileNameAndModeL()"));
+
//
// set attributes on the command
//
@@ -1124,44 +1130,34 @@
if ( ! iCloseAO->IsActive() )
{
- iCloseAO->Start( TCallBack( CMPXVideoViewWrapper::ClosePlayerL, this ) );
+ iCloseAO->Start( TCallBack( CMPXVideoViewWrapper::ClosePlayer, this ) );
}
}
// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::ClosePlayerL
+// CMPXVideoViewWrapper::ClosePlayer
// -------------------------------------------------------------------------------------------------
//
-TInt CMPXVideoViewWrapper::ClosePlayerL( TAny* aPtr )
+TInt CMPXVideoViewWrapper::ClosePlayer( TAny* aPtr )
{
- MPX_DEBUG(_L("CMPXVideoViewWrapper::ClosePlayerL()"));
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::ClosePlayer()"));
- static_cast<CMPXVideoViewWrapper*>(aPtr)->DoClosePlayerL();
+ static_cast<CMPXVideoViewWrapper*>(aPtr)->DoClosePlayer();
return KErrNone;
}
// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::DoClosePlayerL
+// CMPXVideoViewWrapper::DoClosePlayer
// -------------------------------------------------------------------------------------------------
//
-void CMPXVideoViewWrapper::DoClosePlayerL()
+void CMPXVideoViewWrapper::DoClosePlayer()
{
- MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::DoClosePlayerL()"));
+ MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::DoClosePlayer()"));
iView->doClosePlayer();
}
// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::IssuePlayCommandL
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::IssuePlayCommandL()
-{
- MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::IssuePlayCommandL()"));
- CreateGeneralPlaybackCommandL( EPbCmdPlay );
-}
-
-// -------------------------------------------------------------------------------------------------
// CMPXVideoViewWrapper::RetrievePdlInformationL
// -------------------------------------------------------------------------------------------------
//
@@ -1229,7 +1225,7 @@
// check if our window is front or not
if ( wsSession.WindowGroupList( 0, wgList ) == KErrNone )
{
- ret = ( CEikonEnv::Static()->RootWin().Identifier() == wgList->At(0) );
+ ret = ( CEikonEnv::Static()->RootWin().Identifier() == wgList->At(0) );
}
else
{
@@ -1253,7 +1249,7 @@
void CMPXVideoViewWrapper::ClosePlaybackViewL()
{
MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::closePlaybackView()"));
-
+
iView->closePlaybackView();
}
@@ -1368,7 +1364,7 @@
iFileDetails = new QMPXVideoPlaybackViewFileDetails();
- TPtrC fileName( cmd->ValueText( KMPXMediaVideoPlaybackFileName ) );
+ TPtrC fileName( cmd->ValueText( KMPXMediaVideoPlaybackFileName ) );
const QString qFilename( (QChar*)fileName.Ptr(), fileName.Length() );
iFileDetails->mClipName = qFilename;
@@ -1376,14 +1372,14 @@
iFileDetails->mTvOutConnected = cmd->ValueTObjectL<TInt>( KMPXMediaVideoTvOutConnected );
- TPtrC mimeType( cmd->ValueText( KMPXMediaVideoRecognizedMimeType ) );
+ 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;
+ TInt numItems = 1;
MMPXSource* s = iPlaybackUtility->Source();
if ( s )
@@ -1391,7 +1387,7 @@
CMPXCollectionPlaylist* playlist = NULL;
MPX_TRAPD( err, playlist = s->PlaylistL() );
-
+
if ( err == KErrNone && playlist )
{
iPlaylistView = ETrue;
@@ -1401,7 +1397,7 @@
}
iFileDetails->mMultiItemPlaylist = ( numItems > 1 );
-
+
CleanupStack::PopAndDestroy( cmd );
if ( iControlsController )
@@ -1419,16 +1415,16 @@
//
TBool CMPXVideoViewWrapper::IsMultiItemPlaylist()
{
-
+
bool multiLinks( false );
-
+
if ( iFileDetails )
{
multiLinks = iFileDetails->mMultiItemPlaylist;
}
-
+
MPX_DEBUG(_L("CMPXVideoViewWrapper::IsMultiItemPlaylist() ret %d"), multiLinks );
-
+
return multiLinks;
}
@@ -1436,7 +1432,7 @@
// CMPXVideoViewWrapper::UpdateVideoRect()
// -------------------------------------------------------------------------------------------------
//
-void CMPXVideoViewWrapper::UpdateVideoRect(
+void CMPXVideoViewWrapper::UpdateVideoRect(
TInt aX, TInt aY, TInt aWidth, TInt aHeight, TBool transitionEffect )
{
MPX_DEBUG(_L("CMPXVideoViewWrapper::UpdateVideoRect()"));
@@ -1456,4 +1452,77 @@
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/inc/hbvideobaseplaybackview.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/inc/hbvideobaseplaybackview.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#14 %
+// Version : %version: da1mmcf#18 %
@@ -42,12 +42,14 @@
Q_OBJECT
public:
- HbVideoBasePlaybackView();
+ HbVideoBasePlaybackView();
virtual ~HbVideoBasePlaybackView();
signals:
void activatePreviousView();
void tappedOnScreen();
+ void pannedToRight();
+ void pannedToLeft();
public slots:
virtual void closePlaybackView();
@@ -58,18 +60,18 @@
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 handleStoppedState() = 0;
+
virtual void doClosePlayer();
//
@@ -81,33 +83,37 @@
* Handle Download State Change
* @param aState new state of the download
*/
- virtual void handlePdlStateChange( int aState ) = 0;
+ 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();
-
- bool event( QEvent *event );
RWindow *getWindow();
- protected:
+ bool eventFilter( QObject *object, QEvent *event );
+
+ void gestureEvent( QGestureEvent* event );
- void mousePressEvent( QGraphicsSceneMouseEvent *event );
- void mouseReleaseEvent( QGraphicsSceneMouseEvent *event );
+ private:
+
+ void saveActivityData();
protected: // data
- CMPXVideoViewWrapper *mVideoMpxWrapper;
+ CMPXVideoViewWrapper *mVideoMpxWrapper;
QTimer *mTimerForClosingView;
bool mActivated;
+ bool mSyncClose;
+ int mLastPlayPosition;
+ bool mStayPaused;
public:
friend class CMPXVideoViewWrapper;
Binary file videoplayback/videohelix/conf/mpxvideopbplugins.confml has changed
--- a/videoplayback/videohelix/group/mpxvideohelixplayback.mmp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/videohelix/group/mpxvideohelixplayback.mmp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: ou1cpsw#14 %
+// Version : %version: 17 %
@@ -39,10 +39,10 @@
SOURCE mpxvideoplaybackmode.cpp
SOURCE mpxvideofiledetails.cpp
SOURCE mpxvideoseeker.cpp
-SOURCE mpxvideodlmgrif.cpp
SOURCE mpxvideoaccessoryobserver.cpp
SOURCE mpxvideoplayerutility.cpp
SOURCE mpxvideodrmhelper.cpp
+SOURCE mpxvideoposterframesetter.cpp
START RESOURCE ../data/10282550.rss
TARGET mpxvideohelixplayback.rsc
@@ -66,7 +66,6 @@
LIBRARY estor.lib
LIBRARY flogger.lib
LIBRARY playbackhelper.lib
-LIBRARY downloadmgr.lib
LIBRARY platformenv.lib
LIBRARY etel.lib
LIBRARY etelmm.lib
@@ -76,6 +75,8 @@
LIBRARY mmcommon.lib
LIBRARY hwrmlightclient.lib // Lights control
LIBRARY centralrepository.lib // For display backlight timeout value
+LIBRARY fbscli.lib
+LIBRARY thumbnailmanager.lib
#ifdef __ACCESSORY_FW
LIBRARY accclient.lib
--- a/videoplayback/videohelix/inc/mpxvideodlmgrif.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/videohelix/inc/mpxvideodlmgrif.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,13 +15,15 @@
*
*/
-// Version : %version: 10 %
+// Version : %version: 12 %
+
+#ifdef USE_S60_DOWNLOAD_MANAGER
#ifndef __MPXVIDEODLMGRIF_H__
#define __MPXVIDEODLMGRIF_H__
-#include <DownloadMgrClientApiExt.h>
+#include <downloadmgrclientapiext.h>
#include <mpxplaybackcommanddefs.h>
//
@@ -135,6 +137,15 @@
*/
TBool IsDownloadPaused();
+ /*
+ * UpdateDownloadSizeL
+ *
+ * For DRM protected clips, the download size will be updated using the file handle
+ *
+ * @since S60 9.2
+ */
+ void UpdateDownloadSizeL();
+
private:
/*
* CMPDownloadMgrInterface
@@ -220,8 +231,6 @@
void ConvertDMgrStatetoMpxState( TInt32 dmgrState );
- void UpdateDownloadSizeL();
-
//
// Private Members
// Not Owned Data
@@ -251,4 +260,6 @@
#endif __MPXVIDEODLMGRIF_H__
+#endif // USE_S60_DOWNLOAD_MANAGER
+
// End of file
--- a/videoplayback/videohelix/inc/mpxvideoplaybackcontroller.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/videohelix/inc/mpxvideoplaybackcontroller.h Thu Jul 22 16:34:17 2010 +0100
@@ -16,7 +16,7 @@
*/
-// Version : %version: 25 %
+// Version : %version: 29 %
#ifndef _CMPXVIDEOPLAYBACKCONTROLLER_H_
@@ -126,6 +126,8 @@
TBool IsVideoCall();
TBool IsVoiceCall();
+ TBool IsViewActivated();
+
void HandleTvOutEventL( TBool aConnected );
void HandleError(TInt error);
@@ -133,6 +135,8 @@
void HandleVolumeL( TBool aIncrease );
void SendHideControlsEventL();
+
+ void HandleFrameReady(TInt aError);
#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
@@ -220,7 +224,6 @@
TBool iAppInForeground;
CMediaRecognizer::TMediaType iMediaType;
TInt iAccessPointId;
- TBool iForegroundPause;
TBool iAllowAutoPlay;
TBool iHelixLoadingStarted;
TInt iPBPluginError;
@@ -264,6 +267,7 @@
CHWRMLight* iLight;
TInt iLightStatus;
TInt iSavedPosition;
+ TBool iViewActivated;
public: // Friend classes
@@ -286,9 +290,12 @@
friend class CMPXProgressiveDLPlaybackMode;
friend class CMPXVideoSeeker;
+#ifdef USE_S60_DOWNLOAD_MANAGER
friend class CMPXVideoDlMgrIf;
+#endif // USE_S60_DOWNLOAD_MANAGER
friend class CMPXVideoAccessoryObserver;
friend class CMpxVideoPlayerUtility;
+ friend class CMPXVideoPosterFrameSetter;
};
// INLINE METHODS
--- a/videoplayback/videohelix/inc/mpxvideoplaybackmode.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/videohelix/inc/mpxvideoplaybackmode.h Thu Jul 22 16:34:17 2010 +0100
@@ -16,7 +16,7 @@
*/
-// Version : %version: 15 %
+// Version : %version: 20 %
#ifndef _CMPXVIDEOPLAYBACKMODE_H_
@@ -29,7 +29,9 @@
#include <e32base.h>
#include "mpxhelixplaybackplugindefs.h"
+#ifdef USE_S60_DOWNLOAD_MANAGER
#include "mpxvideodlmgrif.h"
+#endif
#include "mpxvideo_debug.h"
//
@@ -37,6 +39,7 @@
//
class CMPXVideoPlaybackController;
class CMPXVideoDlMgrIf;
+class CMPXVideoPosterFrameSetter;
//
@@ -71,12 +74,15 @@
virtual TBool CanPlayNow();
virtual void OpenFileL( const TDesC& aMediaFile );
virtual void OpenFileL( const RFile& aMediaFile );
+ virtual void HandleSetPosterFrame();
+ virtual void HandleFrameReady(TInt aError);
+ virtual TBool SendErrorToView( TInt aError );
+ virtual void HandlePauseToPlayTransitionL();
#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
virtual void OpenFile64L( const RFile64& aMediaFile );
#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
-
protected:
/*
* C++ default constructor
@@ -89,13 +95,12 @@
*/
virtual void ConstructL( CMPXVideoPlaybackController* aVideoPlaybackCtlr );
-
protected:
//
// Data
//
CMPXVideoPlaybackController* iVideoPlaybackCtlr; // not owned
-
+ CMPXVideoPosterFrameSetter* iPosterFrameSetter;
};
/*******************************************************/
@@ -113,6 +118,8 @@
// Methods where video plabkack behavior varies for local media
inline virtual TInt GetMode();
+ virtual void HandleSetPosterFrame();
+ virtual void HandleFrameReady(TInt aError);
};
@@ -147,7 +154,8 @@
// Methods where video plabkack behavior varies for live streaming media
inline virtual TInt GetMode();
virtual void HandlePause();
- virtual void HandleBackground();
+ virtual TBool SendErrorToView( TInt aError );
+ virtual void HandlePauseToPlayTransitionL();
};
////////////////////////////////////////////////////////////////////////////////
@@ -163,21 +171,49 @@
static CMPXVideoPlaybackMode* NewL( CMPXVideoPlaybackController* aVideoPlaybackCtlr );
virtual ~CMPXProgressiveDLPlaybackMode();
+#ifdef USE_S60_DOWNLOAD_MANAGER
+
inline virtual TInt GetMode();
void ConnectToDownloadL( CMPXCommand& aCmd );
void HandleOpenComplete();
void GetPdlStatusL( CMPXCommand& aCmd );
void UpdateSeekPosition( TInt64& aPosition );
inline TBool IsDownloadPaused();
+ void OpenFileL( const RFile& aMediaFile );
+
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+ void OpenFile64L( const RFile64& aMediaFile );
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+#endif // USE_S60_DOWNLOAD_MANAGER
private:
-
void ConstructL( CMPXVideoPlaybackController* aVideoPlaybackCtlr );
+#ifdef USE_S60_DOWNLOAD_MANAGER
private:
CMPXVideoDlMgrIf* iDlMgrIf; // owned
+#endif // USE_S60_DOWNLOAD_MANAGER
+
};
+#ifdef USE_S60_DOWNLOAD_MANAGER
+
+inline
+TInt CMPXProgressiveDLPlaybackMode::GetMode()
+{
+ MPX_DEBUG(_L("CMPXProgressiveDLPlaybackMode::GetMode()"));
+ return EMPXVideoProgressiveDownload;
+}
+
+inline
+TBool CMPXProgressiveDLPlaybackMode::IsDownloadPaused()
+{
+ return iDlMgrIf->IsDownloadPaused();
+}
+
+#endif // USE_S60_DOWNLOAD_MANAGER
+
// INLINE METHODS
inline
@@ -210,22 +246,10 @@
}
inline
-TInt CMPXProgressiveDLPlaybackMode::GetMode()
-{
- MPX_DEBUG(_L("CMPXProgressiveDLPlaybackMode::GetMode()"));
- return EMPXVideoProgressiveDownload;
-}
-
-inline
TBool CMPXVideoPlaybackMode::IsDownloadPaused()
{
return EFalse;
}
-inline
-TBool CMPXProgressiveDLPlaybackMode::IsDownloadPaused()
-{
- return iDlMgrIf->IsDownloadPaused();
-}
#endif //_CMPXVIDEOPLAYBACKMODE_H_
--- a/videoplayback/videohelix/inc/mpxvideoplaybackstate.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/videohelix/inc/mpxvideoplaybackstate.h Thu Jul 22 16:34:17 2010 +0100
@@ -16,7 +16,7 @@
*/
-// Version : %version: 18 %
+// Version : %version: 21 %
#ifndef _CMPXVIDEOPLAYBACKSTATE_H_
@@ -72,6 +72,7 @@
virtual void HandleStartSeekL( TBool aForward );
virtual void HandleStopSeekL();
virtual void HandleClose();
+ virtual void HandleSetPosterFrame();
virtual void HandleForeground();
virtual void HandleBackground();
@@ -119,6 +120,10 @@
virtual void OpenFile64L( const RFile64& aMediaFile );
#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+ void IssuePlayCommand( TMPXVideoPlaybackState aState,
+ MMPXPlaybackPluginObserver::TEvent aEvent,
+ TBool aSendEvent = ETrue );
+
protected:
/*
* C++ default constructor
@@ -131,10 +136,6 @@
*/
void ConstructL(CMPXVideoPlaybackController* aVideoPlaybackCtlr);
- void IssuePlayCommand( TMPXVideoPlaybackState aState,
- MMPXPlaybackPluginObserver::TEvent aEvent,
- TBool aSendEvent = ETrue );
-
protected:
//
// Data
@@ -224,6 +225,7 @@
virtual void HandleStop();
virtual void HandleForeground();
virtual void HandleBackground();
+ virtual void HandlePause();
// general method
virtual void HandleSetPositionL(TInt aPosition);
@@ -246,6 +248,7 @@
virtual void HandlePause();
virtual void HandleStop();
virtual void HandleStartSeekL( TBool aForward );
+ virtual void HandleSetPosterFrame();
virtual void HandlePlayPause();
virtual void HandleBackground();
@@ -310,9 +313,11 @@
virtual void HandlePlay();
virtual void HandleStop();
virtual void HandleStartSeekL( TBool aForward );
- virtual void HandlePlayPause();
+ virtual void HandlePlayPause();
+ virtual void HandleSetPosterFrame();
virtual void HandleForeground();
virtual void HandleCustomPlay();
+ virtual void HandleUnexpectedError( TInt aError );
// general method
virtual void HandleSetPositionL( TInt aPosition );
@@ -362,6 +367,7 @@
// general method
virtual void HandleSetPositionL(TInt aPosition);
virtual void ResolveTimeoutError( TInt aError );
+ virtual void HandleUnexpectedError( TInt aError );
inline virtual TMPXVideoPlaybackState GetState();
};
--- a/videoplayback/videohelix/inc/mpxvideoplayerutility.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/videohelix/inc/mpxvideoplayerutility.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 11 %
+// Version : %version: 13 %
#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>
@@ -42,12 +43,13 @@
// FORWARD DECLARATIONS
//
class CMPXVideoPlaybackController;
+class CFbsBitmap;
//
// CLASS DECLARATION
//
-NONSHARABLE_CLASS( CMpxVideoPlayerUtility ) : public CBase,
+NONSHARABLE_CLASS( CMpxVideoPlayerUtility ) : public CActive,
public MMMFControllerEventMonitorObserver
{
public:
@@ -101,11 +103,18 @@
void SetPlayVelocityL( TInt aVelocity );
void GetVideoLoadingProgressL( TInt& aPercentageProgress );
+
+ void GetFrameL();
//
// MMMFControllerEventMonitorObserver Implementation
//
void HandleEvent( const TMMFEvent& aEvent );
+
+ CFbsBitmap& GetBitmap();
+
+ void RunL();
+ void DoCancel();
#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
void OpenFile64L( const RFile64& aFile );
@@ -124,6 +133,8 @@
const TRect& aCropRect,
TVideoAspectRatio aAspectRatio );
+ void SendSurfaceCreatedCommand();
+
#endif
private:
@@ -150,11 +161,15 @@
RMMFVideoPlaySurfaceSupportCustomCommands iVideoPlaySurfaceSupportCustomCommands;
TSurfaceId iSurfaceId;
+ TRect iCropRect;
+ TVideoAspectRatio iAspectRatio;
#endif
CMMFControllerEventMonitor* iControllerEventMonitor;
TBool iDirectScreenAccessAbort;
+
+ CFbsBitmap* iPosterFrameBitmap;
};
#endif /* __MPXVIDEOPLAYERUTILITY__ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/inc/mpxvideoposterframesetter.h Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,89 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Poster Frame Setter
+ *
+*/
+
+// Version : %version: ou1cpsw#2 %
+
+
+
+#ifndef _MPXVIDEOPOSTERFRAMESETTER_H
+#define _MPXVIDEOPOSTERFRAMESETTER_H
+
+// INCLUDES
+#include <e32base.h>
+#include <thumbnailmanager.h>
+#include <thumbnailobjectsource.h>
+#include <thumbnailmanagerobserver.h>
+
+
+// FORWARD DECLARATIONS
+class CMPXVideoPlaybackController;
+class CThumbnailManager;
+
+// CLASS DECLARATION
+NONSHARABLE_CLASS(CMPXVideoPosterFrameSetter) : public CBase,
+ public MThumbnailManagerObserver
+{
+ public: // Constructors and destructor
+
+ /**
+ * Two-phased constructor.
+ */
+ static CMPXVideoPosterFrameSetter* NewL( CMPXVideoPlaybackController* aVideoPlaybackCtlr );
+
+ /**
+ * Destructor.
+ */
+ virtual ~CMPXVideoPosterFrameSetter();
+
+ public:
+
+ void RequestPosterFrame();
+
+ void HandlePosterFrameReady(TInt aError);
+
+ // from MThumbnailManagerObserver
+ void ThumbnailPreviewReady( MThumbnailData& aThumbnail,
+ TThumbnailRequestId aId );
+
+ // from MThumbnailManagerObserver
+ void ThumbnailReady( TInt aError,
+ MThumbnailData& aThumbnail,
+ TThumbnailRequestId aId );
+
+
+ private:
+
+ /**
+ * C++ default constructor.
+ */
+ CMPXVideoPosterFrameSetter( CMPXVideoPlaybackController* aVideoPlaybackCtlr );
+
+ /**
+ * By default Symbian 2nd phase constructor is private.
+ */
+ void ConstructL();
+
+ private: // Data
+
+ CMPXVideoPlaybackController* iVideoPlaybackCtlr;
+ TThumbnailRequestId iRequestId;
+ CThumbnailManager* iTNManager;
+};
+
+#endif // _MPXVIDEOPOSTERFRAMESETTER_H
+
+// End of File
--- a/videoplayback/videohelix/src/mpxvideodlmgrif.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/videohelix/src/mpxvideodlmgrif.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -16,7 +16,7 @@
*/
-// Version : %version: 23 %
+// Version : %version: 25 %
#include <MMFROPCustomCommandConstants.h>
@@ -95,7 +95,6 @@
}
}
-
void CMPXVideoDlMgrIf::ConnectToDownloadL( CMPXCommand& aCmd )
{
MPX_ENTER_EXIT(_L("CMPXVideoDlMgrIf::ConnectToDownloadL()"));
@@ -120,13 +119,14 @@
//
// A new download id has been sent. Reset member variables
//
- iMoveNeeded = EFalse;
- iCurrentDl = NULL;
- iDlId = downloadId;
- iPlayerOpened = EFalse;
- iDlTotalSize = 0;
+ iMoveNeeded = EFalse;
+ iCurrentDl = NULL;
+ iDownloadState = EPbDlStateDownloadCompleted;
+ iDlId = downloadId;
+ iPlayerOpened = EFalse;
+ iDlTotalSize = 0;
iDownloadProgress = 0;
- iCodDownload = EFalse;
+ iCodDownload = EFalse;
if ( iDlMgrConnected )
{
@@ -414,11 +414,6 @@
//
error = HandleCustomCommand( EMMFROPControllerSetDownloadSize, iDownloadProgress );
}
-
- //
- // Update download size for DRM protected clips
- //
- MPX_TRAPD( updateError, UpdateDownloadSizeL() );
}
}
}
@@ -658,9 +653,19 @@
//
TReal CMPXVideoDlMgrIf::GetDownloadRatio()
{
- TReal downloadRatio = (TReal)iDownloadProgress / (TReal)iDlTotalSize;
+ TReal downloadRatio = 0.0;
+
+ if ( iDownloadState == EPbDlStateDownloadCompleted )
+ {
+ downloadRatio = 100.0;
+ }
+ else
+ {
+ downloadRatio = (TReal)iDownloadProgress / (TReal)iDlTotalSize;
+ }
+
MPX_DEBUG(_L("CMPXVideoDlMgrIf::GetDownloadRatio(%f)"), downloadRatio);
-
+
return downloadRatio;
}
@@ -671,9 +676,7 @@
TBool CMPXVideoDlMgrIf::IsDownloadPaused()
{
TBool paused = ( iDownloadState == EPbDlStateDownloadPaused );
-
- MPX_DEBUG(_L("CMPXVideoDlMgrIf::GetDownloadRatio(%d)"), paused);
-
+ MPX_DEBUG(_L("CMPXVideoDlMgrIf::IsDownloadPaused(%d)"), paused);
return paused;
}
--- a/videoplayback/videohelix/src/mpxvideoplaybackcontroller.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/videohelix/src/mpxvideoplaybackcontroller.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -16,7 +16,7 @@
*/
-// Version : %version: 58 %
+// Version : %version: 62 %
//
@@ -168,6 +168,7 @@
iDrmHelper = CMpxVideoDrmHelper::NewL();
iSavedPosition = 0;
+ iViewActivated = EFalse;
}
// ----------------------------------------------------------------------------
@@ -264,7 +265,6 @@
//
CMPXVideoPlaybackController::CMPXVideoPlaybackController()
: iAppInForeground(ETrue)
- , iForegroundPause(EFalse)
, iAllowAutoPlay(ETrue)
, iHelixLoadingStarted(EFalse)
, iLightStatus(CHWRMLight::ELightStatusUnknown)
@@ -371,6 +371,7 @@
#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+ iViewActivated = EFalse;
}
// ----------------------------------------------------------------------------
@@ -540,6 +541,11 @@
break;
}
+ case EPbCmdSetPosterFrame:
+ {
+ iState->HandleSetPosterFrame();
+ break;
+ }
}
}
}
@@ -879,26 +885,19 @@
volume = aVolume;
}
+ //
+ // Volume needs to have n number of steps.
+ // For example, if we get 26, we need to save it as 25 in 20 volume steps
+ // For example, if we get 77, we need to save it as 70 in 10 volume steps
+ //
+ volume -= volume % iVolumeNormalizer;
+
MPX_DEBUG(
_L("CMPXVideoPlaybackController::SetVolumeCenRepL(): Setting volume = %d"), volume );
- if ( volume > 0 )
- {
- //
- // Media player's CenRep volume range : 0 - number of volume steps
- // MPX framework volume range : 0-100
- //
- iVolumeWatcher->SetValueL( volume / iVolumeNormalizer );
- SetMuteCenRepL( EFalse );
- }
- else
- {
- //
- // save both mute and current volume values in CenRep
- //
- iVolumeWatcher->SetValueL( 0 );
- SetMuteCenRepL( ETrue );
- }
+ iVolumeWatcher->SetValueL( volume );
+
+ SetMuteCenRepL( volume > 0? EFalse: ETrue );
}
else
{
@@ -939,7 +938,8 @@
TInt volume = iVolumeWatcher->CurrentValueL();
TBool mute = iMuteWatcher->CurrentValueL();
- MPX_DEBUG(_L("CMPXVideoPlaybackController::SetVolumeMMFL() volume = %d, mute = %d")
+ MPX_DEBUG(
+ _L("CMPXVideoPlaybackController::SetVolumeMMFL() volume = %d, mute = %d")
, volume, mute );
TInt newVolume = 0;
@@ -947,15 +947,14 @@
if ( ! mute )
{
//
- // If it was muted and previous volume level was 0, set the volume to 1
+ // If it was muted and previous volume level was KPbPlaybackVolumeLevelMin, set the volume to next level
//
- if ( volume == 0 )
+ if ( volume == KPbPlaybackVolumeLevelMin )
{
- volume++;
+ volume = KPbPlaybackVolumeLevelMin + iVolumeNormalizer;
}
- newVolume =
- volume * iVolumeNormalizer * iFileDetails->iMaxVolume / KPbPlaybackVolumeLevelMax;
+ newVolume = volume * iFileDetails->iMaxVolume / KPbPlaybackVolumeLevelMax;
}
MPX_DEBUG(_L("CMPXVideoPlaybackController::SetVolumeMMFL() new volume = %d"), newVolume );
@@ -1101,7 +1100,7 @@
if ( ! iMuteWatcher->CurrentValueL() )
{
- volume = iVolumeWatcher->CurrentValueL() * iVolumeNormalizer;
+ volume = iVolumeWatcher->CurrentValueL();
}
value = volume;
@@ -1154,6 +1153,10 @@
TInt retError = KErrNone;
+ iViewActivated = ETrue;
+
+ iPlayer->SendSurfaceCreatedCommand();
+
RArray<TInt> suppIds;
CleanupClosePushL( suppIds );
@@ -2307,10 +2310,6 @@
//
// MPX framework volume range : 0-100
- // Media player volume range : 0-10
- // MPX video player volume range : 0 - volume steps (defined in PlaybackHelper)
- // For IAD, need to manipulate volume to save in cenrep
- // MPX Framework volume / iVolumeNormalizer => CenRep
//
CDevSoundIf* devSoundIf = CDevSoundIf::NewL();
TInt volumeSteps = devSoundIf->GetNumberOfVolumeSteps();
@@ -2401,6 +2400,8 @@
iHelixLoadingStarted = EFalse;
iSavedPosition = 0;
+
+ iViewActivated = EFalse;
}
// ------------------------------------------------------------------------------------------------
@@ -2412,31 +2413,20 @@
MPX_ENTER_EXIT( _L("CMPXVideoPlaybackController::HandleVolumeL()"),
_L("aIncrease = %d"), aIncrease );
- //
- // Media player's CenRep volume range : 0 - number of volume steps
- // MPX framework volume range : 0-100
- //
TInt volume = iVolumeWatcher->CurrentValueL();
+ TInt diff = iVolumeNormalizer;
- if ( aIncrease )
+ if ( ! aIncrease )
{
- //
- // increase the current volume
- //
- volume++;
+ diff *= -1;
}
- else if ( volume > 0 )
- {
- //
- // decrease the current volume
- //
- volume--;
- }
+
+ volume += diff;
//
// save the current volume level in CenRep
//
- SetVolumeCenRepL( volume * iVolumeNormalizer );
+ SetVolumeCenRepL( volume );
}
// ------------------------------------------------------------------------------------------------
@@ -2532,4 +2522,24 @@
#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+// ------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackController::IsViewActivated()
+// ------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoPlaybackController::IsViewActivated()
+{
+ MPX_DEBUG(_L("CMPXVideoPlaybackController::IsViewActivated"));
+ return iViewActivated;
+}
+
+// ------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackController::HandleFrameReady()
+// ------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::HandleFrameReady(TInt aError)
+{
+ MPX_DEBUG(_L("CMPXVideoPlaybackController::HandleFrameReady"));
+
+ iPlaybackMode->HandleFrameReady(aError);
+}
// End of file
--- a/videoplayback/videohelix/src/mpxvideoplaybackmode.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/videohelix/src/mpxvideoplaybackmode.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -12,11 +12,11 @@
* Contributors:
*
* Description: This class plays local video file
- *
+*
*/
-// Version : %version: 25 %
+// Version : %version: 33 %
//
@@ -25,6 +25,8 @@
#include <mmf/server/mmffile.h>
#include <MMFROPCustomCommandConstants.h>
#include <mpxplaybackpluginobserver.h>
+#include <mpxmessagegeneraldefs.h>
+#include <mpxplaybackmessage.h>
#include <etel.h> // 3G
#include <etelmm.h>
@@ -35,6 +37,7 @@
#include "mpxvideofiledetails.h"
#include <mpxvideoplaybackdefs.h>
#include "mpxvideodrmhelper.h"
+#include "mpxvideoposterframesetter.h"
// Constants
const TUid KUidInterfaceMMFHelixController = {0x101F855D};
@@ -69,6 +72,12 @@
CMPXVideoPlaybackMode::~CMPXVideoPlaybackMode()
{
MPX_DEBUG(_L("CMPXVideoPlaybackMode::~CMPXVideoPlaybackMode()"));
+
+ if ( iPosterFrameSetter )
+ {
+ delete iPosterFrameSetter;
+ iPosterFrameSetter = NULL;
+ }
}
// ----------------------------------------------------------------------------
@@ -177,31 +186,26 @@
{
MPX_DEBUG(_L("CMPXVideoPlaybackMode::HandleBackground()"));
- //
- // Pause in all cases to remove the different behavior based on the decoder
- //
- iVideoPlaybackCtlr->iState->HandlePause();
-
if ( iVideoPlaybackCtlr->iAppInForeground )
{
if ( iVideoPlaybackCtlr->IsAlarm() )
{
- iVideoPlaybackCtlr->iForegroundPause = ETrue;
+ iVideoPlaybackCtlr->iState->HandlePause();
}
else if ( iVideoPlaybackCtlr->IsKeyLocked() &&
iVideoPlaybackCtlr->iFileDetails->iVideoEnabled )
{
- iVideoPlaybackCtlr->iForegroundPause = ETrue;
- iVideoPlaybackCtlr->SendHideControlsEventL();
+ iVideoPlaybackCtlr->iState->HandlePause();
+ TRAP_IGNORE( iVideoPlaybackCtlr->SendHideControlsEventL() );
}
else if ( iVideoPlaybackCtlr->IsPhoneCall() || iVideoPlaybackCtlr->IsVideoCall() )
{
- iVideoPlaybackCtlr->iForegroundPause = EFalse;
+ iVideoPlaybackCtlr->iState->HandlePause();
}
}
else
{
- iVideoPlaybackCtlr->iForegroundPause = EFalse;
+ iVideoPlaybackCtlr->iState->HandlePause();
}
}
@@ -224,13 +228,15 @@
else if ( iVideoPlaybackCtlr->IsKeyLocked() &&
iVideoPlaybackCtlr->iFileDetails->iVideoEnabled )
{
- iVideoPlaybackCtlr->iForegroundPause = ETrue;
+ // playback not allowed for the clip having video if keylock is true
+ // Let playAllowed remain false
}
else
{
playAllowed = ETrue;
}
}
+
return playAllowed;
}
@@ -276,6 +282,43 @@
return networkMode2g;
}
+// ------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackMode::HandleSetPosterFrame()
+// ------------------------------------------------------------------------------------------------
+void CMPXVideoPlaybackMode::HandleSetPosterFrame()
+{
+ MPX_DEBUG(_L("CMPXVideoPlaybackMode::HandleSetPosterFrame()"));
+}
+
+// ------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackMode::HandleSetPosterFrame()
+// ------------------------------------------------------------------------------------------------
+void CMPXVideoPlaybackMode::HandleFrameReady( TInt /*aError*/ )
+{
+ MPX_DEBUG(_L("CMPXVideoPlaybackMode::HandleFrameReady()"));
+}
+
+// ------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackMode::SendErrorToView()
+// ------------------------------------------------------------------------------------------------
+TBool CMPXVideoPlaybackMode::SendErrorToView( TInt aError )
+{
+ MPX_DEBUG(_L("CMPXLocalPlaybackMode::SendErrorToView(%d)"), ETrue);
+
+ return ETrue;
+}
+
+// ------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackMode::HandlePauseToPlayTransitionL()
+// ------------------------------------------------------------------------------------------------
+void CMPXVideoPlaybackMode::HandlePauseToPlayTransitionL()
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoPlaybackMode::HandlePauseToPlayTransitionL()"));
+
+ iVideoPlaybackCtlr->iState->IssuePlayCommand( EMPXVideoPlaying,
+ MMPXPlaybackPluginObserver::EPPlaying );
+}
+
//************************************************************************************************//
// CMPXLocalPlaybackMode
//************************************************************************************************//
@@ -295,6 +338,30 @@
MPX_DEBUG(_L("CMPXLocalPlaybackMode::~CMPXLocalPlaybackMode()"));
}
+void CMPXLocalPlaybackMode::HandleSetPosterFrame()
+{
+ MPX_DEBUG(_L("CMPXLocalPlaybackMode::HandleSetPosterFrame()"));
+
+ // create poster frame setter if it does not already exist
+ if ( ! iPosterFrameSetter )
+ {
+ TRAP_IGNORE(iPosterFrameSetter = CMPXVideoPosterFrameSetter::NewL( iVideoPlaybackCtlr ));
+ }
+
+ if ( iPosterFrameSetter )
+ {
+ iPosterFrameSetter->RequestPosterFrame();
+ }
+}
+
+void CMPXLocalPlaybackMode::HandleFrameReady(TInt aError)
+{
+ MPX_DEBUG(_L("CMPXLocalPlaybackMode::HandleFrameReady()"));
+
+ iPosterFrameSetter->HandlePosterFrameReady(aError);
+}
+
+
//************************************************************************************************//
// CMPXStreamingPlaybackMode
//************************************************************************************************//
@@ -386,9 +453,11 @@
MPX_TRAPD(err,
iVideoPlaybackCtlr->iState->SendErrorToViewL( KMPXVideoCallOngoingError ));
}
- else if ( iVideoPlaybackCtlr->IsKeyLocked() && iVideoPlaybackCtlr->iFileDetails->iVideoEnabled )
+ else if ( iVideoPlaybackCtlr->IsKeyLocked() &&
+ iVideoPlaybackCtlr->iFileDetails->iVideoEnabled )
{
- //exit for live streaming
+ // playback not allowed for the clip having video if keylock is true
+ // Let playAllowed remain false
}
else
{
@@ -445,9 +514,11 @@
}
}
+
//************************************************************************************************//
// CMPXLiveStreamingPlaybackMode
//************************************************************************************************//
+
CMPXVideoPlaybackMode*
CMPXLiveStreamingPlaybackMode::NewL( CMPXVideoPlaybackController* aVideoPlaybackCtlr )
{
@@ -473,28 +544,84 @@
{
MPX_ENTER_EXIT(_L("CMPXLiveStreamingPlaybackMode::HandlePause()"));
+ //
+ // Send a stop command to the player, but change state to pause
+ // The view will not close and the play button will be the only active button
+ //
iVideoPlaybackCtlr->iPlayer->Stop();
- iVideoPlaybackCtlr->ChangeState( EMPXVideoStopped );
+ iVideoPlaybackCtlr->ChangeState( EMPXVideoPaused );
- iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPStopped,
+ iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPPaused,
0,
KErrNone );
}
// ------------------------------------------------------------------------------------------------
-// CMPXLiveStreamingPlaybackMode::HandleBackground()
+// CMPXLiveStreamingPlaybackMode::SendErrorToView()
// ------------------------------------------------------------------------------------------------
-void CMPXLiveStreamingPlaybackMode::HandleBackground()
+TBool CMPXLiveStreamingPlaybackMode::SendErrorToView( TInt aError )
{
- MPX_DEBUG(_L("CMPXLiveStreamingPlaybackMode::HandleBackground()"));
+ TBool retval = ETrue;
+
+ if ( aError == KErrSessionClosed )
+ {
+ retval = EFalse;
+ }
+
+ MPX_DEBUG(_L("CMPXLiveStreamingPlaybackMode::SendErrorToView(%d)"), retval);
+
+ return retval;
+}
+
+// ------------------------------------------------------------------------------------------------
+// CMPXLiveStreamingPlaybackMode::HandlePauseToPlayTransitionL()
+// ------------------------------------------------------------------------------------------------
+void CMPXLiveStreamingPlaybackMode::HandlePauseToPlayTransitionL()
+{
+ MPX_ENTER_EXIT(_L("CMPXLiveStreamingPlaybackMode::HandlePauseToPlayTransitionL()"));
//
- // Pause in all cases to remove the different behavior based on the decoder
+ // For live streaming, the controller must be reinitialized
+ // Send a state change to Initializing to the view
+ //
+ CMPXMessage* msg = CMPXMessage::NewL();
+ CleanupStack::PushL( msg );
+
+ msg->SetTObjectValueL<TMPXMessageId>( KMPXMessageGeneralId, KMPXMessageGeneral );
+ msg->SetTObjectValueL<TInt>( KMPXMessageGeneralEvent, TMPXPlaybackMessage::EStateChanged );
+ msg->SetTObjectValueL<TInt>( KMPXMessageGeneralType, EPbStateInitialising );
+ msg->SetTObjectValueL<TInt>( KMPXMessageGeneralData, 0 );
+
+ iVideoPlaybackCtlr->iMPXPluginObs->HandlePlaybackMessage( msg, KErrNone );
+
+ CleanupStack::PopAndDestroy( msg );
+
+ iVideoPlaybackCtlr->ChangeState( EMPXVideoInitializing );
+
+ iVideoPlaybackCtlr->iPlayer->Reset();
+
//
- iVideoPlaybackCtlr->iState->HandlePause();
+ // Reinitialize the player with the file handle or url
+ //
+ if ( iVideoPlaybackCtlr->iFileHandle.SubSessionHandle() )
+ {
+ iVideoPlaybackCtlr->iPlayer->OpenFileL( iVideoPlaybackCtlr->iFileHandle );
+ }
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+ else if ( iVideoPlaybackCtlr->iFileHandle64.SubSessionHandle() )
+ {
+ iVideoPlaybackCtlr->iPlayer->OpenFile64L( iVideoPlaybackCtlr->iFileHandle64 );
+ }
+#endif
+ else
+ {
+ iVideoPlaybackCtlr->iPlayer->OpenUrlL( iVideoPlaybackCtlr->iClipName->Des(),
+ iVideoPlaybackCtlr->iAccessPointId );
+ }
}
+
//************************************************************************************************//
// CMPXProgressiveDLPlaybackMode
//************************************************************************************************//
@@ -514,23 +641,31 @@
{
iVideoPlaybackCtlr = aVideoPlaybackCtlr;
+#ifdef USE_S60_DOWNLOAD_MANAGER
//
// Create the Download Mgr Interface
//
iDlMgrIf = CMPXVideoDlMgrIf::NewL( iVideoPlaybackCtlr );
+#endif // USE_S60_DOWNLOAD_MANAGER
+
}
CMPXProgressiveDLPlaybackMode::~CMPXProgressiveDLPlaybackMode()
{
MPX_DEBUG(_L("CMPXProgressiveDLPlaybackMode::~CMPXProgressiveDLPlaybackMode()"));
+#ifdef USE_S60_DOWNLOAD_MANAGER
if ( iDlMgrIf )
{
delete iDlMgrIf;
iDlMgrIf = NULL;
}
+#endif // USE_S60_DOWNLOAD_MANAGER
+
}
+#ifdef USE_S60_DOWNLOAD_MANAGER
+
// ------------------------------------------------------------------------------------------------
// CMPXProgressiveDLPlaybackMode::ConnectToDownloadL()
// ------------------------------------------------------------------------------------------------
@@ -594,4 +729,30 @@
KErrNone );
}
+// ------------------------------------------------------------------------------------------------
+// CMPXProgressiveDLPlaybackMode::OpenFileL()
+// ------------------------------------------------------------------------------------------------
+void CMPXProgressiveDLPlaybackMode::OpenFileL( const RFile& aMediaFile )
+{
+ MPX_ENTER_EXIT(_L("CMPXProgressiveDLPlaybackMode::OpenFileL()"));
+
+ iDlMgrIf->UpdateDownloadSizeL();
+ CMPXVideoPlaybackMode::OpenFileL( aMediaFile );
+}
+
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+// ------------------------------------------------------------------------------------------------
+// CMPXProgressiveDLPlaybackMode::OpenFile64L()
+// ------------------------------------------------------------------------------------------------
+void CMPXProgressiveDLPlaybackMode::OpenFile64L( const RFile64& aMediaFile )
+{
+ MPX_ENTER_EXIT(_L("CMPXProgressiveDLPlaybackMode::OpenFile64L( RFile64 )"));
+
+ iDlMgrIf->UpdateDownloadSizeL();
+ CMPXVideoPlaybackMode::OpenFile64L( aMediaFile );
+}
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+#endif // USE_S60_DOWNLOAD_MANAGER
+
// End of file
--- a/videoplayback/videohelix/src/mpxvideoplaybackstate.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/videohelix/src/mpxvideoplaybackstate.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -16,7 +16,7 @@
*/
-// Version : %version: 41 %
+// Version : %version: 47 %
//
@@ -173,6 +173,14 @@
}
// ------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackState::HandleSetPosterFrame()
+// ------------------------------------------------------------------------------------------------
+void CMPXVideoPlaybackState::HandleSetPosterFrame()
+{
+ MPX_DEBUG(_L("CMPXVideoPlaybackState::HandleSetPosterFrame()"));
+}
+
+// ------------------------------------------------------------------------------------------------
// CMPXVideoPlaybackState::HandleForeground()
// ------------------------------------------------------------------------------------------------
void CMPXVideoPlaybackState::HandleForeground()
@@ -1195,8 +1203,6 @@
if ( iVideoPlaybackCtlr->iPlaybackMode->CanPlayNow() )
{
- iVideoPlaybackCtlr->iForegroundPause = EFalse;
-
IssuePlayCommand( EMPXVideoBuffering, MMPXPlaybackPluginObserver::EPBufferingStarted );
}
else
@@ -1269,6 +1275,16 @@
CommandHandleForeground();
}
+// ------------------------------------------------------------------------------------------------
+// CMPXInitialisedState::HandlePause()
+// ------------------------------------------------------------------------------------------------
+void CMPXInitialisedState::HandlePause()
+{
+ MPX_ENTER_EXIT(_L("CMPXInitialisedState::HandlePause()"));
+
+ iVideoPlaybackCtlr->iPlaybackMode->HandlePause();
+}
+
// *************************************************************************************************
//
// CMPXPlayingState
@@ -1366,6 +1382,17 @@
}
// ------------------------------------------------------------------------------------------------
+// CMPXPlayingState::HandleSetPosterFrame()
+// ------------------------------------------------------------------------------------------------
+void CMPXPlayingState::HandleSetPosterFrame()
+{
+ MPX_DEBUG(_L("CMPXPlayingState::HandleSetPosterFrame()"));
+
+ iVideoPlaybackCtlr->iPlaybackMode->HandleSetPosterFrame();
+}
+
+
+// ------------------------------------------------------------------------------------------------
// CMPXPlayingState::HandleStartSeekL()
// ------------------------------------------------------------------------------------------------
void CMPXPlayingState::HandleStartSeekL( TBool aForward )
@@ -1507,9 +1534,7 @@
if ( iVideoPlaybackCtlr->iPlaybackMode->CanPlayNow() )
{
- iVideoPlaybackCtlr->iForegroundPause = EFalse;
-
- IssuePlayCommand( EMPXVideoPlaying, MMPXPlaybackPluginObserver::EPPlaying );
+ MPX_TRAPD( error, iVideoPlaybackCtlr->iPlaybackMode->HandlePauseToPlayTransitionL() );
}
}
@@ -1523,6 +1548,16 @@
}
// ------------------------------------------------------------------------------------------------
+// CMPXPausedState::HandleSetPosterFrame()
+// ------------------------------------------------------------------------------------------------
+void CMPXPausedState::HandleSetPosterFrame()
+{
+ MPX_DEBUG(_L("CMPXPausedState::HandleSetPosterFrame()"));
+
+ iVideoPlaybackCtlr->iPlaybackMode->HandleSetPosterFrame();
+}
+
+// ------------------------------------------------------------------------------------------------
// CMPXPausedState::HandleSetPositionL()
// ------------------------------------------------------------------------------------------------
void CMPXPausedState::HandleSetPositionL( TInt aPosition )
@@ -1595,17 +1630,9 @@
// ------------------------------------------------------------------------------------------------
void CMPXPausedState::HandleForeground()
{
- MPX_ENTER_EXIT(_L("CMPXPausedState::HandleForeground()"),
- _L("foreground pause = %d"), iVideoPlaybackCtlr->iForegroundPause );
+ MPX_ENTER_EXIT(_L("CMPXPausedState::HandleForeground()"));
- if ( iVideoPlaybackCtlr->iForegroundPause )
- {
- iVideoPlaybackCtlr->iState->HandlePlay();
- }
- else
- {
- MPX_TRAPD( err, iVideoPlaybackCtlr->iPlayer->RefreshFrameL() );
- }
+ MPX_TRAPD( err, iVideoPlaybackCtlr->iPlayer->RefreshFrameL() );
}
// ------------------------------------------------------------------------------------------------
@@ -1619,9 +1646,30 @@
if ( iVideoPlaybackCtlr->iPlaybackMode->CanPlayNow() )
{
- iVideoPlaybackCtlr->iForegroundPause = EFalse;
+ IssuePlayCommand( EMPXVideoPlaying, MMPXPlaybackPluginObserver::EPPlaying, EFalse );
+ }
+ 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.
+ iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPPaused,
+ 0,
+ KErrNone );
+ }
+}
- IssuePlayCommand( EMPXVideoPlaying, MMPXPlaybackPluginObserver::EPPlaying, EFalse );
+// -------------------------------------------------------------------------------------------------
+// CMPXPausedState::HandleUnexpectedError
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXPausedState::HandleUnexpectedError( TInt aError )
+{
+ MPX_ENTER_EXIT(_L("CMPXPausedState::HandleUnexpectedError()"),
+ _L("aError = %d"), aError );
+
+ if ( iVideoPlaybackCtlr->iPlaybackMode->SendErrorToView( aError ) )
+ {
+ MPX_TRAPD( err, SendErrorToViewL( aError ) );
}
}
@@ -1712,6 +1760,21 @@
// Don't handle the error. Already in the stopped state
}
+// -------------------------------------------------------------------------------------------------
+// CMPXStoppedState::HandleUnexpectedError
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXStoppedState::HandleUnexpectedError( TInt aError )
+{
+ MPX_ENTER_EXIT(_L("CMPXStoppedState::HandleUnexpectedError()"),
+ _L("aError = %d"), aError );
+
+ if ( iVideoPlaybackCtlr->iPlaybackMode->SendErrorToView( aError ) )
+ {
+ MPX_TRAPD( err, SendErrorToViewL( aError ) );
+ }
+}
+
// *************************************************************************************************
//
// CMPXBufferingState
@@ -1779,7 +1842,7 @@
if ( aError == KErrNone )
{
- if ( iVideoPlaybackCtlr->iAppInForeground && !iVideoPlaybackCtlr->iForegroundPause )
+ if ( iVideoPlaybackCtlr->iPlaybackMode->CanPlayNow() )
{
iVideoPlaybackCtlr->ChangeState( EMPXVideoPlaying );
--- a/videoplayback/videohelix/src/mpxvideoplayerutility.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/videohelix/src/mpxvideoplayerutility.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -16,13 +16,14 @@
*/
-// Version : %version: 20 %
+// Version : %version: 22 %
#include <AudioPreference.h>
#include <mmf/server/mmffile.h>
#include <caf/caftypes.h>
#include <mpxmessagegeneraldefs.h>
+#include <fbs.h>
#include "mpxvideoplayerutility.h"
#include "mpxvideoplaybackcontroller.h"
@@ -45,7 +46,8 @@
}
CMpxVideoPlayerUtility::CMpxVideoPlayerUtility( CMPXVideoPlaybackController* aVideoPlaybackCtrl )
- : iVideoPlaybackController( aVideoPlaybackCtrl )
+ : CActive( EPriorityStandard )
+ , iVideoPlaybackController( aVideoPlaybackCtrl )
, iVideoControllerCustomCommands( iController )
, iVideoPlayControllerCustomCommands( iController )
, iAudioPlayDeviceCustomCommands( iController )
@@ -60,6 +62,8 @@
void CMpxVideoPlayerUtility::ConstructL()
{
OpenControllerL();
+
+ CActiveScheduler::Add( this );
}
CMpxVideoPlayerUtility::~CMpxVideoPlayerUtility()
@@ -84,6 +88,17 @@
iController.Close();
iDirectScreenAccessAbort = EFalse;
+
+ if ( IsActive() )
+ {
+ Cancel();
+
+ if ( iPosterFrameBitmap )
+ {
+ delete iPosterFrameBitmap;
+ iPosterFrameBitmap = NULL;
+ }
+ }
}
void CMpxVideoPlayerUtility::Reset()
@@ -308,6 +323,55 @@
MPX_DEBUG(_L("CMpxVideoPlayerUtility::GetVideoLoadingProgressL(%d)"), aPercentageProgress );
}
+void CMpxVideoPlayerUtility::GetFrameL()
+{
+ MPX_DEBUG(_L("CMpxVideoPlayerUtility::GetFrameL"));
+
+ // dont get another frame if a request is already pending
+ //
+ if ( ! IsActive() )
+ {
+ iPosterFrameBitmap = new (ELeave) CFbsBitmap;
+ User::LeaveIfError(iPosterFrameBitmap->Create(TSize(0,0), EColor16MU));
+
+ iVideoPlayControllerCustomCommands.GetFrame( *iPosterFrameBitmap, iStatus );
+ SetActive();
+ }
+
+}
+
+void CMpxVideoPlayerUtility::RunL()
+{
+ MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::RunL()"));
+
+ if ( iStatus.Int() == KErrNone )
+ {
+ iVideoPlaybackController->HandleFrameReady( iStatus.Int() );
+ }
+ else
+ {
+ // Bitmap ownership will NOT be transferred to thumbnail manager so delete it
+ delete iPosterFrameBitmap;
+ iPosterFrameBitmap = NULL;
+ }
+}
+
+void CMpxVideoPlayerUtility::DoCancel()
+{
+ MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::DoCancel()"));
+
+ // Bitmap ownership will NOT be transferred to thumbnail manager so delete it
+ delete iPosterFrameBitmap;
+ iPosterFrameBitmap = NULL;
+}
+
+CFbsBitmap& CMpxVideoPlayerUtility::GetBitmap()
+{
+ MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::GetBitmap()"));
+
+ return *iPosterFrameBitmap;
+}
+
void CMpxVideoPlayerUtility::PlayL()
{
MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::PlayL()"));
@@ -485,22 +549,23 @@
if ( iSurfaceId.IsNull() )
{
TSurfaceId surfaceId;
- TRect cropRect;
- TVideoAspectRatio aspectRatio;
error = iVideoPlaySurfaceSupportCustomCommands.GetSurfaceParameters( surfaceId,
- cropRect,
- aspectRatio );
+ iCropRect,
+ iAspectRatio );
if ( error == KErrNone )
{
- //
- // Send data to the display handler to remove old surface and add new surface
- //
- MPX_TRAPD( err, SendSurfaceCommandL( EPbMsgVideoSurfaceCreated,
- surfaceId,
- cropRect,
- aspectRatio ) );
+ if ( iVideoPlaybackController->IsViewActivated() )
+ {
+ //
+ // Send data to the display handler to remove old surface and add new surface
+ //
+ MPX_TRAPD( err, SendSurfaceCommandL( EPbMsgVideoSurfaceCreated,
+ surfaceId,
+ iCropRect,
+ iAspectRatio ) );
+ }
iSurfaceId = surfaceId;
}
@@ -634,6 +699,23 @@
}
}
+// -------------------------------------------------------------------------------------------------
+// CMpxVideoPlayerUtility::SendSurfaceCreatedCommand()
+// -------------------------------------------------------------------------------------------------
+//
+void CMpxVideoPlayerUtility::SendSurfaceCreatedCommand()
+{
+ MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::SendSurfaceCreatedCommand()"));
+
+ if ( ! iSurfaceId.IsNull() )
+ {
+ MPX_TRAPD( err, SendSurfaceCommandL( EPbMsgVideoSurfaceCreated,
+ iSurfaceId,
+ iCropRect,
+ iAspectRatio ) );
+ }
+}
+
#endif
#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/src/mpxvideoposterframesetter.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,164 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: poster frame setter
+ *
+*/
+
+// Version : %version: ou1cpsw#2 %
+
+
+// INCLUDE FILES
+#include <fbs.h>
+#include <mpxvideoplaybackdefs.h>
+
+#include "mpxvideoposterframesetter.h"
+#include "mpxvideoplaybackcontroller.h"
+#include "mpxvideo_debug.h"
+
+// ============================ MEMBER FUNCTIONS ===================================================
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPosterFrameSetter::CMPXVideoPosterFrameSetter
+// C++ default constructor can NOT contain any code, that might leave.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPosterFrameSetter::CMPXVideoPosterFrameSetter( CMPXVideoPlaybackController* aVideoPlaybackCtlr )
+ : iVideoPlaybackCtlr( aVideoPlaybackCtlr )
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoPosterFrameSetter::CMPXVideoPosterFrameSetter()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPosterFrameSetter::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPosterFrameSetter::ConstructL()
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoPosterFrameSetter::ConstructL()"));
+
+ iTNManager = CThumbnailManager::NewL( *this );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPosterFrameSetter::NewL
+// Two-phased constructor.
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPosterFrameSetter* CMPXVideoPosterFrameSetter::NewL( CMPXVideoPlaybackController* aVideoPlaybackCtlr )
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoPosterFrameSetter::NewL()"));
+
+ CMPXVideoPosterFrameSetter* self = new( ELeave ) CMPXVideoPosterFrameSetter( aVideoPlaybackCtlr );
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ CleanupStack::Pop();
+ return self;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPosterFrameSetter::~CMPXVideoPosterFrameSetter
+// Destructor
+// -------------------------------------------------------------------------------------------------
+//
+CMPXVideoPosterFrameSetter::~CMPXVideoPosterFrameSetter()
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoPosterFrameSetter::~CMPXVideoPosterFrameSetter()"));
+
+ if ( iTNManager )
+ {
+ delete iTNManager;
+ iTNManager = NULL;
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPosterFrameSetter::RequestPosterFrameL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPosterFrameSetter::RequestPosterFrame()
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoPosterFrameSetter::RequestPosterFrame()"));
+
+ if ( ! iVideoPlaybackCtlr->iFileDetails->iDrmProtected )
+ {
+ TRAP_IGNORE( iVideoPlaybackCtlr->iPlayer->GetFrameL() );
+ }
+ else
+ {
+ MPX_TRAPD(err,
+ iVideoPlaybackCtlr->iState->SendErrorToViewL(KMPXVideoSetPosterFrameNotSupported));
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPosterFrameSetter::HandlePosterFrameReady
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPosterFrameSetter::HandlePosterFrameReady(TInt aError)
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoPosterFrameSetter::HandlePosterFrameReady()"));
+
+ if ( aError == KErrNone )
+ {
+ CThumbnailObjectSource* tnSource( 0 );
+ TRAP_IGNORE
+ (
+ tnSource = CThumbnailObjectSource::NewL( &iVideoPlaybackCtlr->iPlayer->GetBitmap(),
+ iVideoPlaybackCtlr->iClipName->Des() );
+
+ CleanupStack::PushL( tnSource );
+ iRequestId = iTNManager->SetThumbnailL( *tnSource );
+ CleanupStack::PopAndDestroy( tnSource );
+ );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPosterFrameSetter::ThumbnailPreviewReady
+//
+// callback method from MThumbnailManagerObserver
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPosterFrameSetter::ThumbnailPreviewReady( MThumbnailData& /*aThumbnail*/,
+ TThumbnailRequestId /*aId*/ )
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoPosterFrameSetter::ThumbnailPreviewReady()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPosterFrameSetter::ThumbnailReady
+//
+// callback method from MThumbnailManagerObserver
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPosterFrameSetter::ThumbnailReady( TInt aError,
+ MThumbnailData& /*aThumbnail*/,
+ TThumbnailRequestId /*aId*/ )
+{
+ MPX_DEBUG(_L("CMPXVideoPosterFrameSetter::ThumbnailReady() aError = %d"), aError );
+
+ if ( aError == KErrNone )
+ {
+ MPX_TRAPD( err,
+ iVideoPlaybackCtlr->iState->SendErrorToViewL( KMPXVideoSetPosterFrameSuccess ) );
+ }
+ else
+ {
+ MPX_TRAPD( err,
+ iVideoPlaybackCtlr->iState->SendErrorToViewL( KMPXVideoSetPosterFrameFailure ) );
+ }
+}
+
+// End of File
--- a/videoplayback/videohelix/src/mpxvideoseeker.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/videohelix/src/mpxvideoseeker.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 9 %
+// Version : %version: 10 %
// INCLUDE FILES
@@ -37,6 +37,7 @@
const TInt KDurationB(180000000); // 180 sec
const TInt64 KSpeedAIncrements(2000000); // 2 sec
const TInt64 KSpeedBIncrements(4000000); // 4 sec
+const TInt64 KSpeedOffset(3000000); // 3 sec
#endif
// ============================ MEMBER FUNCTIONS ===================================================
@@ -311,7 +312,7 @@
}
else
{
- iIncrements = (TInt)( iDuration / 200 ) + 3;
+ iIncrements = (TInt)( iDuration / 200 ) + KSpeedOffset;
}
}
--- a/videoplayback/videohelix/tsrc/ut_videohelixtest/conf/videohelixtest.cfg Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/conf/videohelixtest.cfg Thu Jul 22 16:34:17 2010 +0100
@@ -25,6 +25,7 @@
EPbCmdStretchAspectRatio 11
EPbCmdHandleIncreaseVolume 17
EPbCmdHandleDecreaseVolume 18
+EPbCmdSetPosterFrame 24
EMMFNatural 2
EMMFZoom 3
@@ -53,6 +54,7 @@
ERFile 1
ERFile64 0
+EMPXVideoLocal 0
[Enddefine]
@@ -526,20 +528,7 @@
[Endtest]
[Test]
-title 33. Alarm: Auto resume
-create videohelixtest test
-test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
-waittestclass test
-test IssueGeneralCommand EPbCmdPlay KErrNone ECallbackBuffering
-waittestclass test
-test AlarmAutoResume EPbCmdHandleBackground EPbCmdHandleForeground
-waittestclass test
-delete test
-pause 1000
-[Endtest]
-
-[Test]
-title 34. Incoming Phone Call: Rejected
+title 33. Incoming Phone Call: Rejected
create videohelixtest test
test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
waittestclass test
@@ -552,7 +541,7 @@
[Endtest]
[Test]
-title 35. Incoming Voice Call: Accepted
+title 34. Incoming Voice Call: Accepted
create videohelixtest test
test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
waittestclass test
@@ -566,7 +555,7 @@
[Endtest]
[Test]
-title 36. Incoming Video Call: Accepted
+title 35. Incoming Video Call: Accepted
create videohelixtest test
test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
waittestclass test
@@ -580,7 +569,7 @@
[Endtest]
[Test]
-title 37. Play During Video Call
+title 36. Play During Video Call
create videohelixtest test
test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
waittestclass test
@@ -594,7 +583,7 @@
[Endtest]
[Test]
-title 38. Play During voice Call
+title 37. Play During voice Call
create videohelixtest test
test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
waittestclass test
@@ -608,7 +597,7 @@
[Endtest]
[Test]
-title 39. Initialise with SDP file via 32-bit file handle
+title 38. Initialise with SDP file via 32-bit file handle
create videohelixtest test
test InitializeHandle ERFile 60000 10 sdp_test.sdp KErrNone KErrNone KErrNone
waittestclass test
@@ -617,7 +606,7 @@
[Endtest]
[Test]
-title 40. Tv-Out before Initialization - Playback Allowed
+title 39. Tv-Out before Initialization - Playback Allowed
create videohelixtest test
test SetTvOutConnected ETvOutPlaybackAllowed
test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
@@ -630,7 +619,7 @@
[Endtest]
[Test]
-title 41. Tv-Out after Initialization - Playback Allowed
+title 40. Tv-Out after Initialization - Playback Allowed
create videohelixtest test
test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
waittestclass test
@@ -644,7 +633,7 @@
[Endtest]
[Test]
-title 42. Tv-Out before Initialization - DRM Playback Allowed
+title 41. Tv-Out before Initialization - DRM Playback Allowed
create videohelixtest test
test SetTvOutConnected ETvOutPlaybackAllowed
test Initialize 0 10 dcf.odf KErrNone KErrNone KErrNone
@@ -657,7 +646,7 @@
[Endtest]
[Test]
-title 43. Tv-Out after Initialization - DRM Playback Allowed
+title 42. Tv-Out after Initialization - DRM Playback Allowed
create videohelixtest test
test Initialize 0 10 dcf.odf KErrNone KErrNone KErrNone
waittestclass test
@@ -670,7 +659,7 @@
[Endtest]
[Test]
-title 44. DRM Protected file with Rights
+title 43. DRM Protected file with Rights
create videohelixtest test
test SetDrmProtected 0
test Initialize 0 10 dcf.odf KErrNone KErrNone KErrNone
@@ -682,7 +671,7 @@
[Endtest]
[Test]
-title 45. DRM Protected file without rights
+title 44. DRM Protected file without rights
create videohelixtest test
test SetDrmProtected -17452
test Initialize 0 10 vhpp_test.3gp KErrNone KErrNone -17452
@@ -695,7 +684,7 @@
[Endtest]
[Test]
-title 46. EndOfClip Custom Commands
+title 45. EndOfClip Custom Commands
create videohelixtest test
test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
waittestclass test
@@ -705,7 +694,7 @@
[Endtest]
[Test]
-title 47. PDL - Not enough Data
+title 46. PDL - Not enough Data
create videohelixtest test
test ConnectToDownload 2 vhpp_test.3gp
waittestclass test
@@ -719,7 +708,7 @@
[Endtest]
[Test]
-title 48. Handle volume increase (10-steps)
+title 47. Handle volume increase (10-steps)
create videohelixtest test
test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
waittestclass test
@@ -739,7 +728,7 @@
[Endtest]
[Test]
-title 49. Handle volume decrease (10-steps)
+title 48. Handle volume decrease (10-steps)
create videohelixtest test
test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
waittestclass test
@@ -759,7 +748,7 @@
[Endtest]
[Test]
-title 50. Handle volume increase (20-steps)
+title 49. Handle volume increase (20-steps)
create videohelixtest test
test Initialize 60000 20 vhpp_test.3gp KErrNone KErrNone KErrNone
waittestclass test
@@ -779,7 +768,7 @@
[Endtest]
[Test]
-title 51. Handle volume decrease (20-steps)
+title 50. Handle volume decrease (20-steps)
create videohelixtest test
test Initialize 60000 20 vhpp_test.3gp KErrNone KErrNone KErrNone
waittestclass test
@@ -799,7 +788,7 @@
[Endtest]
[Test]
-title 52. InitialiseL with 64-bit file handle
+title 51. InitialiseL with 64-bit file handle
create videohelixtest test
test InitializeHandle ERFile64 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
waittestclass test
@@ -808,7 +797,7 @@
[Endtest]
[Test]
-title 53. Initialise with SDP file via 64-bit file handle
+title 52. Initialise with SDP file via 64-bit file handle
create videohelixtest test
test InitializeHandle ERFile64 60000 10 sdp_test.sdp KErrNone KErrNone KErrNone
waittestclass test
@@ -817,7 +806,7 @@
[Endtest]
[Test]
-title 54. InitialiseWithPositionL with file missing
+title 53. InitialiseWithPositionL with file missing
create videohelixtest test
test InitializeWithPositionL 0 10 6575 vhpp_nofile.3gp KErrNotFound KErrNone KErrNone
waittestclass test
@@ -828,7 +817,7 @@
[Endtest]
[Test]
-title 55. InitialiseL with 32-bit file handle
+title 54. InitialiseL with 32-bit file handle
create videohelixtest test
test InitializeHandleWithPositionL ERFile 60000 10 6575 vhpp_test.3gp KErrNone KErrNone KErrNone
waittestclass test
@@ -837,7 +826,7 @@
[Endtest]
[Test]
-title 56. Initialise with rtsp link & AP
+title 55. Initialise with rtsp link & AP
create videohelixtest test
test InitializeLinkWithPositionL 0 10 6575 rtsp:\/\/link.3gp KErrNone KErrNone KErrNone
waittestclass test
@@ -846,7 +835,7 @@
[Endtest]
[Test]
-title 57. Play rtsp link (forces buffering state)
+title 56. Play rtsp link (forces buffering state)
create videohelixtest test
test InitializeLinkWithPositionL 0 10 6575 rtsp:\/\/link.3gp KErrNone KErrNone KErrNone
waittestclass test
@@ -857,7 +846,7 @@
[Endtest]
[Test]
-title 58. Initialise with SDP file via 32-bit file handle
+title 57. Initialise with SDP file via 32-bit file handle
create videohelixtest test
test InitializeHandleWithPositionL ERFile 60000 10 6575 sdp_test.sdp KErrNone KErrNone KErrNone
waittestclass test
@@ -866,7 +855,7 @@
[Endtest]
[Test]
-title 59. InitialiseL with 64-bit file handle
+title 58. InitialiseL with 64-bit file handle
create videohelixtest test
test InitializeHandleWithPositionL ERFile64 60000 10 6575 vhpp_test.3gp KErrNone KErrNone KErrNone
waittestclass test
@@ -875,7 +864,7 @@
[Endtest]
[Test]
-title 60. Initialise with SDP file via 64-bit file handle
+title 59. Initialise with SDP file via 64-bit file handle
create videohelixtest test
test InitializeHandleWithPositionL ERFile64 60000 10 6575 sdp_test.sdp KErrNone KErrNone KErrNone
waittestclass test
@@ -883,3 +872,44 @@
pause 1000
[Endtest]
+[Test]
+title 60. Set Poster Frame
+create videohelixtest test
+test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
+waittestclass test
+pause 100
+test IssueGeneralCommand EPbCmdPlay KErrNone ECallbackBuffering
+waittestclass test
+test IssueVideoCommand EPbCmdSetPosterFrame
+delete test
+pause 1000
+[Endtest]
+
+[Test]
+title 61. InitialiseL link via 32-bit file handle
+create videohelixtest test
+test InitializeStreamingWithSdpFileHandleL ERFile 60000 10 sdp_test.sdp KErrNone KErrNone KErrNone
+waittestclass test
+delete test
+pause 1000
+[Endtest]
+
+[Test]
+title 62. InitialiseL link via 64-bit file handle
+create videohelixtest test
+test InitializeStreamingWithSdpFileHandleL ERFile64 60000 10 sdp_test.sdp KErrNone KErrNone KErrNone
+waittestclass test
+delete test
+pause 1000
+[Endtest]
+
+[Test]
+title 63. Retrieve FileName and playback mode -- Custom Commands EPbCmdInitView
+create videohelixtest test
+test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
+waittestclass test
+test RetrieveFileNameAndModeL vhpp_test.3gp EMPXVideoLocal
+pause 1000
+delete test
+pause 1000
+[Endtest]
--- a/videoplayback/videohelix/tsrc/ut_videohelixtest/group/videohelixtest.mmp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/group/videohelixtest.mmp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: ou1cpsw#8 %
+// Version : %version: 11 %
@@ -45,21 +45,21 @@
SOURCE videohelixtestbody.cpp
SOURCE timeoutcontroller.cpp
SOURCE mpxvideoplayerutility_stub.cpp
-SOURCE dlmgr_stub.cpp
SOURCE mpxvideoregion.cpp
SOURCE stifutilities.cpp
SOURCE mediarecognizer_stub.cpp
SOURCE mpxvideoaccessoryobserver_stub.cpp
SOURCE mpxvideodrmhelper_stub.cpp
+SOURCE tnmgr_stub.cpp
SOURCEPATH ../../../src
-SOURCE mpxvideodlmgrif.cpp
SOURCE mpxvideofiledetails.cpp
SOURCE mpxvideohelixplayback.cpp
SOURCE mpxvideoplaybackcontroller.cpp
SOURCE mpxvideoplaybackmode.cpp
SOURCE mpxvideoplaybackstate.cpp
SOURCE mpxvideoseeker.cpp
+SOURCE mpxvideoposterframesetter.cpp
LIBRARY euser.lib
@@ -89,5 +89,6 @@
LIBRARY flogger.lib
LIBRARY playbackhelper.lib
LIBRARY hwrmlightclient.lib // Lights control
+LIBRARY fbscli.lib
// End of File
--- a/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/dlmgr_stub.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/dlmgr_stub.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,8 +15,9 @@
*
*/
-// Version : %version: 4 %
+// Version : %version: 5 %
+#ifdef USE_S60_DOWNLOAD_MANAGER
#ifndef __RHTTPDOWNLOADMGRAPIEXT_H__
#define __RHTTPDOWNLOADMGRAPIEXT_H__
@@ -188,3 +189,4 @@
#endif // __RHTTPDOWNLOADMGRAPIEXT_H__
+#endif // USE_S60_DOWNLOAD_MANAGER
--- a/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/mpxvideoplayerutility_stub.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/mpxvideoplayerutility_stub.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 12 %
+// Version : %version: 14 %
#ifndef __MPXVIDEOPLAYERUTILITY__
@@ -42,6 +42,7 @@
// FORWARD DECLARATIONS
//
class CMPXVideoPlaybackController;
+class CFbsBitmap;
//
// CLASS DECLARATION
@@ -112,6 +113,9 @@
void SetVolumeSteps( TInt aVolumeSteps );
void SurfaceRemovedFromView();
+
+ void GetFrameL();
+ CFbsBitmap& GetBitmap();
#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
void OpenFile64L( const RFile64& aFile );
@@ -122,6 +126,7 @@
TInt VideoSurfaceCreated();
TInt SurfaceParametersChanged();
TInt RemoveSurface();
+ void SendSurfaceCreatedCommand();
#endif
@@ -179,6 +184,8 @@
TTimeIntervalMicroSeconds iPosition;
TTimeIntervalMicroSeconds iDuration;
+
+ CFbsBitmap* iPosterFrameBitmap;
};
#endif /* __MPXVIDEOPLAYERUTILITY__ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/tnmgr_stub.h Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Thumbnail Manager Stub
+ *
+*/
+
+// Version : %version: 1 %
+
+#ifndef TNMGR_STUB_H_
+#define TNMGR_STUB_H_
+
+class CFbsBitmap;
+class MThumbnailData;
+//class MThumbnailManagerObserver;
+
+typedef TInt TThumbnailRequestId;
+
+class MThumbnailManagerObserver
+ {
+public:
+
+ virtual void ThumbnailPreviewReady( MThumbnailData& aThumbnail,
+ TThumbnailRequestId aId ) = 0;
+
+ virtual void ThumbnailReady( TInt aError, MThumbnailData& aThumbnail,
+ TThumbnailRequestId aId ) = 0;
+};
+
+
+class CThumbnailObjectSource : public CBase
+ {
+public:
+
+ CThumbnailObjectSource( CFbsBitmap* aBitmap, const TDesC& aUri );
+ virtual ~CThumbnailObjectSource();
+ static CThumbnailObjectSource* NewL( CFbsBitmap* aBitmap, const TDesC& aUri );
+};
+
+
+
+class CThumbnailManager : public CBase
+{
+
+public:
+
+ CThumbnailManager( MThumbnailManagerObserver& aObserver );
+ virtual ~CThumbnailManager();
+ static CThumbnailManager* NewL( MThumbnailManagerObserver& aObserver );
+
+ TThumbnailRequestId SetThumbnailL( CThumbnailObjectSource& source );
+
+public:
+ MThumbnailManagerObserver& iObserver;
+};
+
+
+#endif /* TNMGR_STUB_H_ */
--- a/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/videohelixtest.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/videohelixtest.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 13 %
+// Version : %version: 16 %
#ifndef __VHPPTESTCASE_H__
@@ -35,10 +35,10 @@
#include <ctsydomainpskeys.h>
#include <mmf/common/mmferrors.h>
-#include <accessoryserver.h>
-#include <accessorycontrol.h>
-#include <accpolgidheader.h>
-#include <accpolgenericid.h>
+#include <AccessoryServer.h>
+#include <AccessoryControl.h>
+#include <AccPolGIDHeader.h>
+#include <AccPolGenericID.h>
#include <mpxvideoplaybackdefs.h>
#include "timeoutController.h"
@@ -155,7 +155,6 @@
virtual TInt ChangeAspectRatioL( CStifItemParser& aItem );
virtual TInt AlarmOn( CStifItemParser& aItem );
- virtual TInt AlarmAutoResume( CStifItemParser& aItem );
virtual TInt PhoneCallRejected( CStifItemParser& aItem );
virtual TInt VoiceCallAccepted( CStifItemParser& aItem );
@@ -173,6 +172,8 @@
virtual TInt InitializeWithPositionL( CStifItemParser& aItem );
virtual TInt InitializeLinkWithPositionL( CStifItemParser& aItem );
virtual TInt InitializeHandleWithPositionL( CStifItemParser& aItem );
+ virtual TInt InitializeStreamingWithSdpFileHandleL( CStifItemParser& aItem );
+ virtual TInt RetrieveFileNameAndModeL( CStifItemParser& aItem );
// ---------------------------------------------------------------------
// Helper Functions
--- a/videoplayback/videohelix/tsrc/ut_videohelixtest/src/mpxvideoplayerutility_stub.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/src/mpxvideoplayerutility_stub.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 15 %
+// Version : %version: 17 %
#include <audiopreference.h>
#include <mmf/server/mmffile.h>
@@ -425,6 +425,29 @@
TInt openError = ReadOpenError();
}
+void CMpxVideoPlayerUtility::GetFrameL()
+{
+ MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::GetFrameL()"));
+
+ if ( iStifObserver )
+ {
+ TCallbackEvent* event = new TCallbackEvent;
+ event->iEvent = EPbCmdSetPosterFrame;
+ event->iData = 0;
+ event->iError = KErrNone;
+ iStifObserver->HandleUtilityEvent( event );
+ }
+
+ iVideoPlaybackController->HandleFrameReady( KErrGeneral );
+}
+
+CFbsBitmap& CMpxVideoPlayerUtility::GetBitmap()
+{
+ MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::GetBitmap()"));
+
+ iPosterFrameBitmap = new (ELeave) CFbsBitmap;
+ return *iPosterFrameBitmap;
+}
TInt CMpxVideoPlayerUtility::ReadOpenError()
{
@@ -753,6 +776,11 @@
return KErrNone;
}
+void CMpxVideoPlayerUtility::SendSurfaceCreatedCommand()
+{
+ MPX_DEBUG(_L("CMpxVideoPlayerUtility::SendSurfaceCreatedCommand()"));
+}
+
#endif
#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/src/tnmgr_stub.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Thumbnail Manager stub impl
+*
+*/
+
+// Version : %version: 2 %
+
+#include <fbs.h>
+#include "tnmgr_stub.h"
+#include "mpxvideo_debug.h"
+
+
+/****************************************************
+ * CThumbnailManager stub implementation
+ ****************************************************/
+CThumbnailManager::~CThumbnailManager()
+{
+}
+
+CThumbnailManager* CThumbnailManager::NewL( MThumbnailManagerObserver& aObserver )
+{
+ MPX_ENTER_EXIT(_L("CThumbnailManager::NewL() - stub impl"));
+ CThumbnailManager* self = new( ELeave )CThumbnailManager( aObserver );
+ return self;
+}
+
+CThumbnailManager::CThumbnailManager( MThumbnailManagerObserver& aObserver )
+: iObserver( aObserver )
+{
+ MPX_ENTER_EXIT(_L("CThumbnailManager::CThumbnailManager() - stub impl"));
+}
+
+TThumbnailRequestId CThumbnailManager::SetThumbnailL( CThumbnailObjectSource& /* aObjectSource */ )
+{
+ MPX_ENTER_EXIT(_L("CThumbnailManager::SetThumbnailL() - stub impl"));
+ return 0;
+}
+
+
+/****************************************************
+ * CThumbnailObjectSource stub implementation
+ ****************************************************/
+CThumbnailObjectSource::~CThumbnailObjectSource()
+{
+}
+
+CThumbnailObjectSource* CThumbnailObjectSource::NewL( CFbsBitmap* aBitmap, const TDesC& aUri )
+{
+ MPX_ENTER_EXIT(_L("CThumbnailObjectSource::NewL() - stub impl"));
+ CThumbnailObjectSource* self = new( ELeave )CThumbnailObjectSource( aBitmap, aUri );
+ return self;
+}
+
+CThumbnailObjectSource::CThumbnailObjectSource( CFbsBitmap* /* aBitmap */ , const TDesC& /* aUri */ )
+{
+}
+
+
--- a/videoplayback/videohelix/tsrc/ut_videohelixtest/src/videohelixtest.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/src/videohelixtest.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 6 %
+// Version : %version: 7 %
// INCLUDE FILES
@@ -129,10 +129,10 @@
//
// CenRep volume range is 0 - number of steps (either 10 or 20).
- // Set default CenRep values as volume(4), mute(0)
+ // Set default CenRep values as volume(40), mute(0)
//
CRepository* volCenRep = CRepository::NewL( KCRUidMPXVideoSettings );
- volCenRep->Set( KMPXVideoPlaybackVolume, 4 );
+ volCenRep->Set( KMPXVideoPlaybackVolume, 40 );
volCenRep->Set( KMPXVideoPlaybackMute, 0 );
delete volCenRep;
--- a/videoplayback/videohelix/tsrc/ut_videohelixtest/src/videohelixtestbody.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/src/videohelixtestbody.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 21 %
+// Version : %version: e003sa33#24.1.1 %
// [INCLUDE FILES] - do not remove
@@ -42,6 +42,7 @@
#include "mpxmediavideodefs.h"
#include "mpxvideo_debug.h"
#include "mpxvideoplayerutility_stub.h"
+#include "mpxhelixplaybackplugindefs.h"
#ifdef __WINSCW__
_LIT( KVideoTestPath, "c:\\data\\Videos\\" );
@@ -99,7 +100,6 @@
ENTRY( "ChangeAspectRatioL", CVHPPTestClass::ChangeAspectRatioL),
ENTRY( "AlarmOn", CVHPPTestClass::AlarmOn),
- ENTRY( "AlarmAutoResume", CVHPPTestClass::AlarmAutoResume),
ENTRY( "PhoneCallRejected", CVHPPTestClass::PhoneCallRejected),
ENTRY( "VoiceCallAccepted", CVHPPTestClass::VoiceCallAccepted),
ENTRY( "VideoCallAccepted", CVHPPTestClass::VideoCallAccepted),
@@ -119,7 +119,10 @@
ENTRY ("InitializeWithPositionL", CVHPPTestClass::InitializeWithPositionL),
ENTRY ("InitializeLinkWithPositionL", CVHPPTestClass::InitializeLinkWithPositionL),
- ENTRY ("InitializeHandleWithPositionL", CVHPPTestClass::InitializeHandleWithPositionL)
+ ENTRY ("InitializeHandleWithPositionL", CVHPPTestClass::InitializeHandleWithPositionL),
+ ENTRY ( "InitializeStreamingWithSdpFileHandleL",
+ CVHPPTestClass::InitializeStreamingWithSdpFileHandleL ),
+ ENTRY ( "RetrieveFileNameAndModeL", CVHPPTestClass::RetrieveFileNameAndModeL )
//
// ADD NEW ENTRIES HERE
@@ -1143,6 +1146,10 @@
MPX_ENTER_EXIT(_L("CVHPPTestClass::ConnectToDownloadL()"));
iLog->Log(_L("CVHPPTestClass::ConnectToDownloadL()"));
+ TInt err = KErrNone;
+
+#ifdef USE_S60_DOWNLOAD_MANAGER
+
iDlMgrTester = CDlMgrTestClass::NewL();
iDlMgrTester->AddStifObserver( this );
@@ -1153,7 +1160,7 @@
//
// Read in the download id and filename
//
- TInt err = aItem.GetNextInt( dlId );
+ err = aItem.GetNextInt( dlId );
if ( err == KErrNone )
{
@@ -1189,7 +1196,17 @@
CleanupStack::PopAndDestroy( cmd );
}
}
-
+
+#else // USE_S60_DOWNLOAD_MANAGER
+
+ // suppress build warning
+ MPX_DEBUG(_L("CVHPPTestClass::ConnectToDownloadL() : parsing type = %d"), aItem.ParsingType());
+
+ // Signal TestScripter to continue from waittestclass
+ Signal();
+
+#endif // USE_S60_DOWNLOAD_MANAGER
+
return err;
}
@@ -1203,6 +1220,8 @@
MPX_ENTER_EXIT(_L("CVHPPTestClass::SendPdlCustomCommandL"),
_L("aCustomCmd = %d"), aCustomCmd );
+#ifdef USE_S60_DOWNLOAD_MANAGER
+
CMPXCommand* cmd = CMPXCommand::NewL();
CleanupStack::PushL( cmd );
@@ -1213,6 +1232,14 @@
iPlaybackPlugin->CommandL( *cmd );
CleanupStack::PopAndDestroy( cmd );
+
+#else // USE_S60_DOWNLOAD_MANAGER
+
+ // Signal TestScripter to continue from waittestclass
+ Signal();
+
+#endif // USE_S60_DOWNLOAD_MANAGER
+
}
// -----------------------------------------------------------------------------
@@ -1225,6 +1252,8 @@
MPX_ENTER_EXIT(_L("CVHPPTestClass::PauseDownloadL()"));
iLog->Log(_L("CVHPPTestClass::PauseDownloadL()"));
+#ifdef USE_S60_DOWNLOAD_MANAGER
+
TCallbackEvent* event = new TCallbackEvent;
event->iEvent = EPDownloadStateChanged;
@@ -1234,7 +1263,14 @@
AddExpectedEvent( event );
iDlMgrTester->PauseDownload();
-
+
+#else // USE_S60_DOWNLOAD_MANAGER
+
+ // Signal TestScripter to continue from waittestclass
+ Signal();
+
+#endif // USE_S60_DOWNLOAD_MANAGER
+
return KErrNone;
}
@@ -1248,9 +1284,13 @@
MPX_ENTER_EXIT(_L("CVHPPTestClass::ResumeDownloadL()"));
iLog->Log(_L("CVHPPTestClass::ResumeDownloadL()"));
+ TInt err = KErrNone;
+
+#ifdef USE_S60_DOWNLOAD_MANAGER
+
TInt dlSize;
- TInt err = aItem.GetNextInt( dlSize );
+ err = aItem.GetNextInt( dlSize );
if ( err == KErrNone )
{
@@ -1274,7 +1314,17 @@
iDlMgrTester->ResumeDownload();
}
-
+
+#else // USE_S60_DOWNLOAD_MANAGER
+
+ // suppress build warning
+ MPX_DEBUG(_L("CVHPPTestClass::ResumeDownloadL() : parsing type = %d"), aItem.ParsingType());
+
+ // Signal TestScripter to continue from waittestclass
+ Signal();
+
+#endif // USE_S60_DOWNLOAD_MANAGER
+
return err;
}
@@ -1288,6 +1338,8 @@
MPX_ENTER_EXIT(_L("CVHPPTestClass::CancelDownloadL()"));
iLog->Log(_L("CVHPPTestClass::CancelDownloadL()"));
+#ifdef USE_S60_DOWNLOAD_MANAGER
+
TCallbackEvent* event = new TCallbackEvent;
event->iEvent = EPDownloadStateChanged;
@@ -1298,6 +1350,13 @@
iDlMgrTester->CancelDownload();
+#else // USE_S60_DOWNLOAD_MANAGER
+
+ // Signal TestScripter to continue from waittestclass
+ Signal();
+
+#endif // USE_S60_DOWNLOAD_MANAGER
+
return KErrNone;
}
@@ -1311,6 +1370,10 @@
MPX_ENTER_EXIT(_L("CVHPPTestClass::RetrievePdlStatusL()"));
iLog->Log(_L("CVHPPTestClass::RetrievePdlStatusL()"));
+ TInt err = KErrNone;
+
+#ifdef USE_S60_DOWNLOAD_MANAGER
+
TInt pdlState;
TInt expectedPdlState;
TInt downloadedBytes;
@@ -1321,7 +1384,7 @@
//
// Read in the expected download data
//
- TInt err = aItem.GetNextInt( expectedPdlState );
+ err = aItem.GetNextInt( expectedPdlState );
if ( err == KErrNone )
{
@@ -1369,6 +1432,16 @@
CleanupStack::PopAndDestroy( cmd );
}
+#else // USE_S60_DOWNLOAD_MANAGER
+
+ // suppress build warning
+ MPX_DEBUG(_L("CVHPPTestClass::RetrievePdlStatusL() : parsing type = %d"), aItem.ParsingType());
+
+ // Signal TestScripter to continue from waittestclass
+ Signal();
+
+#endif // USE_S60_DOWNLOAD_MANAGER
+
return err;
}
@@ -1549,6 +1622,8 @@
void
CVHPPTestClass::ProcessEvent( TCallbackEvent* aCallback )
{
+ MPX_ENTER_EXIT(_L("CVHPPTestClass::ProcessEvent"));
+
if ( iExpectedCallbackArray->Count() > 0 )
{
TCallbackEvent* expectedCallback = (*iExpectedCallbackArray)[0];
@@ -1724,51 +1799,6 @@
}
// -----------------------------------------------------------------------------
-// CVHPPTestClass::AlarmOnAndOff
-// -----------------------------------------------------------------------------
-//
-TInt
-CVHPPTestClass::AlarmAutoResume( CStifItemParser& aItem )
-{
- MPX_ENTER_EXIT(_L("CVHPPTestClass::AlarmOnAndOff()"));
- iLog->Log(_L("CVHPPTestClass::AlarmOnAndOff()"));
-
- TInt backgroundCmd = 0;
- TInt err = 0;//aItem.GetNextInt( backgroundCmd );
-
- err = AlarmOn(aItem);
-
- if ( err == KErrNone )
- {
- err = aItem.GetNextInt( backgroundCmd );
-
- //reset alarm
- RProperty::Set( KPSUidCoreApplicationUIs, KLightsAlarmLightActive, ELightsNotBlinking );
-
- if ( err == KErrNone )
- {
- TCallbackEvent* event = new TCallbackEvent;
- event->iError = 0;
- event->iData = 0;
- event->iEvent = EPPlaying;
- AddExpectedEvent( event );
-
- //auto resume if alarm off
- CMPXCommand* cmdPlay = CMPXCommand::NewL();
- CleanupStack::PushL( cmdPlay );
- cmdPlay->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
- cmdPlay->SetTObjectValueL<TInt>( KMPXCommandGeneralId, KMPXMediaIdVideoPlayback );
- cmdPlay->SetTObjectValueL<TInt>( KMPXMediaVideoPlaybackCommand, backgroundCmd );
- cmdPlay->SetTObjectValueL<TBool>( KMPXMediaVideoAppForeground, ETrue );
- iPlaybackPlugin->CommandL( *cmdPlay );
- CleanupStack::PopAndDestroy( cmdPlay );
- }
- }
-
- return err;
-}
-
-// -----------------------------------------------------------------------------
// CVHPPTestClass::PhoneCallRejected
// -----------------------------------------------------------------------------
//
@@ -2398,4 +2428,164 @@
return err;
}
+TInt
+CVHPPTestClass::InitializeStreamingWithSdpFileHandleL( CStifItemParser& aItem )
+{
+ MPX_ENTER_EXIT(_L("CVHPPTestClass::InitializeStreamingWithSdpFileHandleL()"));
+ iLog->Log(_L("CVHPPTestClass::InitializeStreamingWithSdpFileHandleL()"));
+
+ TInt duration;
+ TInt volumeSteps;
+ TInt fileHandle32;
+
+ TInt err = aItem.GetNextInt( fileHandle32 );
+
+ if ( err == KErrNone )
+ {
+
+#ifndef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+ //
+ // set RFile as default if the 64-bit flag is not defined
+ //
+ fileHandle32 = ETrue;
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+ err = aItem.GetNextInt( duration );
+
+ if ( err == KErrNone )
+ {
+ //
+ // We will always get an Init Complete message out
+ //
+ TCallbackEvent* event = new TCallbackEvent;
+
+ event->iEvent = EPInitialised;
+ event->iData = duration;
+ event->iError = KErrNone;
+
+ AddExpectedEvent( event );
+
+ //
+ // read number of volume steps
+ //
+ err = aItem.GetNextInt( volumeSteps );
+
+ if ( err == KErrNone )
+ {
+ //
+ // set volume steps
+ //
+ SetVolumeSteps( volumeSteps );
+
+ TBuf<120> fullPath;
+ err = ReadFileInitializationParameters( aItem, fullPath );
+
+ if ( err == KErrNone )
+ {
+ PreparePluginL();
+
+ MPX_DEBUG( _L("Initialize the Plugin: link = %S"), &fullPath );
+ iLog->Log( _L("Initialize the Plugin: link = %S"), &fullPath );
+
+ //
+ // Extract the streaming link from the ram file and
+ // Initalize the Plugin with the file handle and an access point
+ //
+ RFs fs;
+ TInt error = fs.Connect();
+
+ if ( fileHandle32 )
+ {
+ RFile file;
+ error = file.Open( fs, fullPath, EFileRead | EFileShareAny );
+
+ MPX_DEBUG( _L("Initialize the Plugin: file open error = %d"),
+ error );
+
+ User::LeaveIfError( error );
+
+ iPlaybackPlugin->InitStreamingL( file, 11 );
+ file.Close();
+ }
+ #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+ else
+ {
+ RFile64 file64;
+ error = file64.Open( fs, fullPath, EFileRead | EFileShareAny );
+
+ MPX_DEBUG( _L("Initialize the Plugin: file open error = %d"),
+ error );
+
+ User::LeaveIfError( error );
+
+ iPlaybackPlugin->InitStreaming64L( file64, 11 );
+ file64.Close();
+ }
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+ fs.Close();
+ }
+ }
+ }
+ }
+ return err;
+}
+
+TInt
+CVHPPTestClass::RetrieveFileNameAndModeL( CStifItemParser& aItem )
+{
+ MPX_ENTER_EXIT( _L("CVHPPTestClass::RetrieveFileNameAndModeL()") );
+ iLog->Log( _L("CVHPPTestClass::RetrieveFileNameAndModeL()") );
+
+ TBuf<120> fullPath;
+ TPtrC fileName;
+ TInt err;
+
+ err = aItem.GetNextString( fileName );
+
+ if ( err == KErrNone )
+ {
+ //
+ // Build the full path to the file
+ //
+ fullPath.Append( KVideoTestPath );
+ fullPath.Append( fileName );
+
+ TInt mode;
+ err = aItem.GetNextInt( mode);
+
+ if ( err == KErrNone )
+ {
+ CMPXCommand* cmd = CMPXCommand::NewL();
+ CleanupStack::PushL( cmd );
+
+ cmd->SetTObjectValueL<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 );
+ }
+ }
+
+ return err;
+}
+
// EOF
--- a/videoplayer.pro Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayer.pro Thu Jul 22 16:34:17 2010 +0100
@@ -18,10 +18,11 @@
TEMPLATE = subdirs
CONFIG += ordered
symbian: {
-BLD_INF_RULES.prj_mmpfiles += $$LITERAL_HASH"include \"videoplayer_plat/group/bld.inf\"" \
- $$LITERAL_HASH"include \"mediasettings/group/bld.inf\""
+BLD_INF_RULES.prj_mmpfiles += $$LITERAL_HASH"include \"videoplayer_plat/group/bld.inf\""
+
SUBDIRS += videoplayback
SUBDIRS += videoplayerapp
SUBDIRS += videocollection
+SUBDIRS += mediasettings
}
\ No newline at end of file
--- a/videoplayerapp/bwins/videoplayerengineu.def Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayerapp/bwins/videoplayerengineu.def Thu Jul 22 16:34:17 2010 +0100
@@ -1,53 +1,63 @@
EXPORTS
?qt_metacall@QVideoPlayerEngine@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1 NONAME ; int QVideoPlayerEngine::qt_metacall(enum QMetaObject::Call, int, void * *)
?metaObject@QVideoPlayerEngine@@UBEPBUQMetaObject@@XZ @ 2 NONAME ; struct QMetaObject const * QVideoPlayerEngine::metaObject(void) const
- ?tr@QVideoPlayerEngine@@SA?AVQString@@PBD0H@Z @ 3 NONAME ; class QString QVideoPlayerEngine::tr(char const *, char const *, int)
- ?qt_metacast@VideoServices@@UAEPAXPBD@Z @ 4 NONAME ; void * VideoServices::qt_metacast(char const *)
- ?trUtf8@VideoServices@@SA?AVQString@@PBD0@Z @ 5 NONAME ; class QString VideoServices::trUtf8(char const *, char const *)
- ?itemSelected@VideoServices@@QAEXABVQString@@@Z @ 6 NONAME ; void VideoServices::itemSelected(class QString const &)
- ?handleCommand@QVideoPlayerEngine@@QAEXH@Z @ 7 NONAME ; void QVideoPlayerEngine::handleCommand(int)
- ??1VideoServices@@EAE@XZ @ 8 NONAME ; VideoServices::~VideoServices(void)
- ?titleReady@VideoServices@@IAEXABVQString@@@Z @ 9 NONAME ; void VideoServices::titleReady(class QString const &)
- ?staticMetaObject@QVideoPlayerEngine@@2UQMetaObject@@B @ 10 NONAME ; struct QMetaObject const QVideoPlayerEngine::staticMetaObject
- ?activated@VideoServices@@IAEXH@Z @ 11 NONAME ; void VideoServices::activated(int)
- ?metaObject@VideoServices@@UBEPBUQMetaObject@@XZ @ 12 NONAME ; struct QMetaObject const * VideoServices::metaObject(void) const
- ?disconnectView@QVideoPlayerEngine@@AAEXXZ @ 13 NONAME ; void QVideoPlayerEngine::disconnectView(void)
- ??_EVideoServices@@UAE@I@Z @ 14 NONAME ; VideoServices::~VideoServices(unsigned int)
- ?setEngine@VideoServices@@AAEXPAVQVideoPlayerEngine@@@Z @ 15 NONAME ; void VideoServices::setEngine(class QVideoPlayerEngine *)
- ?decreaseReferenceCount@VideoServices@@QAEXXZ @ 16 NONAME ; void VideoServices::decreaseReferenceCount(void)
- ?getStaticMetaObject@VideoServices@@SAABUQMetaObject@@XZ @ 17 NONAME ; struct QMetaObject const & VideoServices::getStaticMetaObject(void)
- ?setEmbedded@QVideoPlayerEngine@@QAEXXZ @ 18 NONAME ; void QVideoPlayerEngine::setEmbedded(void)
- ?setCurrentService@VideoServices@@AAEXW4TVideoService@1@@Z @ 19 NONAME ; void VideoServices::setCurrentService(enum VideoServices::TVideoService)
- ?trUtf8@QVideoPlayerEngine@@SA?AVQString@@PBD0H@Z @ 20 NONAME ; class QString QVideoPlayerEngine::trUtf8(char const *, char const *, int)
- ??0VideoServices@@AAE@PAVQVideoPlayerEngine@@@Z @ 21 NONAME ; VideoServices::VideoServices(class QVideoPlayerEngine *)
- ?tr@QVideoPlayerEngine@@SA?AVQString@@PBD0@Z @ 22 NONAME ; class QString QVideoPlayerEngine::tr(char const *, char const *)
- ?getStaticMetaObject@QVideoPlayerEngine@@SAABUQMetaObject@@XZ @ 23 NONAME ; struct QMetaObject const & QVideoPlayerEngine::getStaticMetaObject(void)
- ?trUtf8@VideoServices@@SA?AVQString@@PBD0H@Z @ 24 NONAME ; class QString VideoServices::trUtf8(char const *, char const *, int)
- ?handleQuit@QVideoPlayerEngine@@AAEXXZ @ 25 NONAME ; void QVideoPlayerEngine::handleQuit(void)
- ?staticMetaObject@VideoServices@@2UQMetaObject@@B @ 26 NONAME ; struct QMetaObject const VideoServices::staticMetaObject
- ??1QVideoPlayerEngine@@UAE@XZ @ 27 NONAME ; QVideoPlayerEngine::~QVideoPlayerEngine(void)
- ?tr@VideoServices@@SA?AVQString@@PBD0H@Z @ 28 NONAME ; class QString VideoServices::tr(char const *, char const *, int)
- ?qt_metacast@QVideoPlayerEngine@@UAEPAXPBD@Z @ 29 NONAME ; void * QVideoPlayerEngine::qt_metacast(char const *)
- ?activateView@QVideoPlayerEngine@@AAEXW4MpxHbVideoViewType@MpxHbVideoCommon@@@Z @ 30 NONAME ; void QVideoPlayerEngine::activateView(enum MpxHbVideoCommon::MpxHbVideoViewType)
- ?playMedia@QVideoPlayerEngine@@QAEXVQString@@@Z @ 31 NONAME ; void QVideoPlayerEngine::playMedia(class QString)
- ??0QVideoPlayerEngine@@QAE@_N@Z @ 32 NONAME ; QVideoPlayerEngine::QVideoPlayerEngine(bool)
- ?contextTitle@VideoServices@@QBE?AVQString@@XZ @ 33 NONAME ; class QString VideoServices::contextTitle(void) const
- ?initialize@QVideoPlayerEngine@@QAEXXZ @ 34 NONAME ; void QVideoPlayerEngine::initialize(void)
- ?trUtf8@QVideoPlayerEngine@@SA?AVQString@@PBD0@Z @ 35 NONAME ; class QString QVideoPlayerEngine::trUtf8(char const *, char const *)
- ?loadPluginAndCreateView@QVideoPlayerEngine@@AAEXW4MpxHbVideoViewType@MpxHbVideoCommon@@@Z @ 36 NONAME ; void QVideoPlayerEngine::loadPluginAndCreateView(enum MpxHbVideoCommon::MpxHbVideoViewType)
- ?currentService@VideoServices@@QAE?AW4TVideoService@1@XZ @ 37 NONAME ; enum VideoServices::TVideoService VideoServices::currentService(void)
- ?qt_metacall@VideoServices@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 38 NONAME ; int VideoServices::qt_metacall(enum QMetaObject::Call, int, void * *)
- ?mInstance@VideoServices@@0PAV1@A @ 39 NONAME ; class VideoServices * VideoServices::mInstance
- ?tr@VideoServices@@SA?AVQString@@PBD0@Z @ 40 NONAME ; class QString VideoServices::tr(char const *, char const *)
- ?engine@VideoServices@@AAEPAVQVideoPlayerEngine@@XZ @ 41 NONAME ; class QVideoPlayerEngine * VideoServices::engine(void)
- ?connectView@QVideoPlayerEngine@@AAEXXZ @ 42 NONAME ; void QVideoPlayerEngine::connectView(void)
- ?instance@VideoServices@@SAPAV1@PAVQVideoPlayerEngine@@@Z @ 43 NONAME ; class VideoServices * VideoServices::instance(class QVideoPlayerEngine *)
- ??_EQVideoPlayerEngine@@UAE@I@Z @ 44 NONAME ; QVideoPlayerEngine::~QVideoPlayerEngine(unsigned int)
- ?doDelayedLoad@QVideoPlayerEngine@@AAEXXZ @ 45 NONAME ; void QVideoPlayerEngine::doDelayedLoad(void)
- ?playMedia@QVideoPlayerEngine@@QAEXVRFile@@@Z @ 46 NONAME ; void QVideoPlayerEngine::playMedia(class RFile)
- ?getBrowseCategory@VideoServices@@QBEHXZ @ 47 NONAME ; int VideoServices::getBrowseCategory(void) const
- ?browsingEnded@VideoServices@@QAEXXZ @ 48 NONAME ; void VideoServices::browsingEnded(void)
- ?createPlayAndDetailsViews@QVideoPlayerEngine@@AAEXXZ @ 49 NONAME ; void QVideoPlayerEngine::createPlayAndDetailsViews(void)
- ?setCurrentView@QVideoPlayerEngine@@AAEXXZ @ 50 NONAME ; void QVideoPlayerEngine::setCurrentView(void)
- ?sortRole@VideoServices@@QBEHXZ @ 51 NONAME ; int VideoServices::sortRole(void) const
+ ?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)
+ ?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)
+ ?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)
+ ?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)
+ ??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
+ ?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)
+ ??_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 *)
+ ?browsingEnded@VideoServices@@QAEXXZ @ 24 NONAME ; void VideoServices::browsingEnded(void)
+ ?playMedia@QVideoPlayerEngine@@QAEXVRFile@@@Z @ 25 NONAME ; void QVideoPlayerEngine::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)
+ ?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@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)
+ ?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)
+ ?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)
+ ?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 *)
+ ?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)
--- a/videoplayerapp/eabi/videoplayerengineu.def Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayerapp/eabi/videoplayerengineu.def Thu Jul 22 16:34:17 2010 +0100
@@ -3,51 +3,65 @@
_ZN13VideoServices11qt_metacallEN11QMetaObject4CallEiPPv @ 2 NONAME
_ZN13VideoServices11qt_metacastEPKc @ 3 NONAME
_ZN13VideoServices12itemSelectedERK7QString @ 4 NONAME
- _ZN13VideoServices14currentServiceEv @ 5 NONAME
- _ZN13VideoServices16staticMetaObjectE @ 6 NONAME DATA 16
- _ZN13VideoServices17setCurrentServiceENS_13TVideoServiceE @ 7 NONAME
- _ZN13VideoServices19getStaticMetaObjectEv @ 8 NONAME
- _ZN13VideoServices22decreaseReferenceCountEv @ 9 NONAME
- _ZN13VideoServices6engineEv @ 10 NONAME
- _ZN13VideoServices8instanceEP18QVideoPlayerEngine @ 11 NONAME
- _ZN13VideoServices9activatedEi @ 12 NONAME
- _ZN13VideoServices9mInstanceE @ 13 NONAME DATA 4
- _ZN13VideoServices9setEngineEP18QVideoPlayerEngine @ 14 NONAME
- _ZN13VideoServicesC1EP18QVideoPlayerEngine @ 15 NONAME
- _ZN13VideoServicesC2EP18QVideoPlayerEngine @ 16 NONAME
- _ZN13VideoServicesD0Ev @ 17 NONAME
- _ZN13VideoServicesD1Ev @ 18 NONAME
- _ZN13VideoServicesD2Ev @ 19 NONAME
- _ZN18QVideoPlayerEngine10handleQuitEv @ 20 NONAME
- _ZN18QVideoPlayerEngine10initializeEv @ 21 NONAME
- _ZN18QVideoPlayerEngine23loadPluginAndCreateViewEN16MpxHbVideoCommon18MpxHbVideoViewTypeE @ 22 NONAME
- _ZN18QVideoPlayerEngine11connectViewEv @ 23 NONAME
- _ZN18QVideoPlayerEngine11qt_metacallEN11QMetaObject4CallEiPPv @ 24 NONAME
- _ZN18QVideoPlayerEngine11qt_metacastEPKc @ 25 NONAME
- _ZN18QVideoPlayerEngine11setEmbeddedEv @ 26 NONAME
- _ZN18QVideoPlayerEngine12activateViewEN16MpxHbVideoCommon18MpxHbVideoViewTypeE @ 27 NONAME
- _ZN18QVideoPlayerEngine13handleCommandEi @ 28 NONAME
- _ZN18QVideoPlayerEngine14disconnectViewEv @ 29 NONAME
- _ZN18QVideoPlayerEngine16staticMetaObjectE @ 30 NONAME DATA 16
- _ZN18QVideoPlayerEngine19getStaticMetaObjectEv @ 31 NONAME
- _ZN18QVideoPlayerEngine9playMediaE7QString @ 32 NONAME
- _ZN18QVideoPlayerEngineC1Eb @ 33 NONAME
- _ZN18QVideoPlayerEngineC2Eb @ 34 NONAME
- _ZN18QVideoPlayerEngineD0Ev @ 35 NONAME
- _ZN18QVideoPlayerEngineD1Ev @ 36 NONAME
- _ZN18QVideoPlayerEngineD2Ev @ 37 NONAME
- _ZNK13VideoServices10metaObjectEv @ 38 NONAME
- _ZNK13VideoServices12contextTitleEv @ 39 NONAME
- _ZNK18QVideoPlayerEngine10metaObjectEv @ 40 NONAME
- _ZTI13VideoServices @ 41 NONAME
- _ZTI18QVideoPlayerEngine @ 42 NONAME
- _ZTV13VideoServices @ 43 NONAME
- _ZTV18QVideoPlayerEngine @ 44 NONAME
- _ZN18QVideoPlayerEngine13doDelayedLoadEv @ 45 NONAME
- _ZN18QVideoPlayerEngine9playMediaE5RFile @ 46 NONAME
- _ZN13VideoServices13browsingEndedEv @ 47 NONAME
- _ZNK13VideoServices17getBrowseCategoryEv @ 48 NONAME
- _ZN18QVideoPlayerEngine25createPlayAndDetailsViewsEv @ 49 NONAME
- _ZN18QVideoPlayerEngine14setCurrentViewEv @ 50 NONAME
- _ZNK13VideoServices8sortRoleEv @ 51 NONAME
+ _ZN13VideoServices13browsingEndedEv @ 5 NONAME
+ _ZN13VideoServices14currentServiceEv @ 6 NONAME
+ _ZN13VideoServices16staticMetaObjectE @ 7 NONAME DATA 16
+ _ZN13VideoServices17setCurrentServiceENS_13TVideoServiceE @ 8 NONAME
+ _ZN13VideoServices19getStaticMetaObjectEv @ 9 NONAME
+ _ZN13VideoServices22decreaseReferenceCountEv @ 10 NONAME
+ _ZN13VideoServices6engineEv @ 11 NONAME
+ _ZN13VideoServices8instanceEP18QVideoPlayerEngine @ 12 NONAME
+ _ZN13VideoServices9activatedEi @ 13 NONAME
+ _ZN13VideoServices9mInstanceE @ 14 NONAME DATA 4
+ _ZN13VideoServices9setEngineEP18QVideoPlayerEngine @ 15 NONAME
+ _ZN13VideoServicesC1EP18QVideoPlayerEngine @ 16 NONAME
+ _ZN13VideoServicesC2EP18QVideoPlayerEngine @ 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
+ _ZN18VideoActivityState15getActivityDataERK7QString @ 47 NONAME
+ _ZN18VideoActivityState15setActivityDataERK8QVariantRK7QString @ 48 NONAME
+ _ZN18VideoActivityState8instanceEv @ 49 NONAME
+ _ZN18VideoActivityStateC1Ev @ 50 NONAME
+ _ZN18VideoActivityStateC2Ev @ 51 NONAME
+ _ZN18VideoActivityStateD0Ev @ 52 NONAME
+ _ZN18VideoActivityStateD1Ev @ 53 NONAME
+ _ZN18VideoActivityStateD2Ev @ 54 NONAME
+ _ZNK13VideoServices10metaObjectEv @ 55 NONAME
+ _ZNK13VideoServices12contextTitleEv @ 56 NONAME
+ _ZNK13VideoServices17getBrowseCategoryEv @ 57 NONAME
+ _ZNK13VideoServices8sortRoleEv @ 58 NONAME
+ _ZNK18QVideoPlayerEngine10metaObjectEv @ 59 NONAME
+ _ZTI13VideoServices @ 60 NONAME
+ _ZTI18QVideoPlayerEngine @ 61 NONAME
+ _ZTI18VideoActivityState @ 62 NONAME
+ _ZTV13VideoServices @ 63 NONAME
+ _ZTV18QVideoPlayerEngine @ 64 NONAME
+ _ZTV18VideoActivityState @ 65 NONAME
--- a/videoplayerapp/hbvideoplayer/hbvideoplayer.pro Tue Jun 15 13:09:36 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-#
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description: Project file for building Videoplayer components
-#
-#
-# Version : %version: da1mmcf#16 %
-
-
-TARGET = videoplayer
-CONFIG += hb service
-TEMPLATE = app
-TRANSLATIONS += videos.ts
-
-symbian:
-{
- TARGET.CAPABILITY = ALL -DRM -TCB
- TARGET.EPOCHEAPSIZE = 0x20000 0x1600000
- TARGET.UID3 = 0x200211FE
-
- BLD_INF_RULES.prj_exports += "rom/hbvideoplayer.iby CORE_APP_LAYER_IBY_EXPORT_PATH(hbvideoplayer.iby)" \
- "rom/hbvideoplayerresources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(hbvideoplayerresources.iby)" \
- "sis/videoplayer_stub.sis /epoc32/data/z/system/install/videoplayer_stub.sis"
-}
-
-# Service provider specific configuration.
-SERVICE.FILE = resources/service_conf.xml
-SERVICE.OPTIONS = embeddable
-# Service provider specific configuration ends
-
-INCLUDEPATH += .
-INCLUDEPATH += ../inc \
- ../../inc \
- /epoc32/include/mw/hb/hbtools
-
-LIBS += -lvideoplayerengine.dll \
- -lxqservice.dll \
- -lxqserviceutil.dll
-
-VPATH += src
-
-SOURCES += main.cpp
-
-RSS_RULES += \
-" datatype_list = " \
-" { " \
-" DATATYPE { priority=EDataTypePrioritySystem; type=\"video/avi\"; }, " \
-" DATATYPE { priority=EDataTypePrioritySystem; type=\"video/msvideo\"; }, " \
-" DATATYPE { priority=EDataTypePrioritySystem; type=\"application/x-msvideo\"; }, " \
-" DATATYPE { priority=EDataTypePrioritySystem; type=\"video/x-pn-realvideo\"; }, " \
-" DATATYPE { priority=EDataTypePrioritySystem; type=\"audio/x-pn-realaudio\"; }, " \
-" DATATYPE { priority=EDataTypePrioritySystem; type=\"video/vnd.rn-realvideo\"; }, " \
-" DATATYPE { priority=EDataTypePrioritySystem; type=\"application/vnd.rn-realmedia\"; }, " \
-" DATATYPE { priority=EDataTypePrioritySystem; type=\"application/x-pn-realmedia\"; }, " \
-" DATATYPE { priority=EDataTypePrioritySystem; type=\"audio/x-pn-realaudio-plugin\"; }, " \
-" DATATYPE { priority=EDataTypePrioritySystem; type=\"video/x-matroska\"; }, " \
-" DATATYPE { priority=EDataTypePrioritySystem; type=\"audio/x-matroska\"; }, " \
-" DATATYPE { priority=EDataTypePriorityHigh; type=\"video/x-ms-wmv\"; }, " \
-" DATATYPE { priority=EDataTypePriorityHigh; type=\"video/x-ms-asf\"; }, " \
-" DATATYPE { priority=EDataTypePriorityHigh; type=\"video/3gp\"; }, " \
-" DATATYPE { priority=EDataTypePriorityHigh; type=\"video/3gpp2\"; }, " \
-" DATATYPE { priority=EDataTypePriorityHigh; type=\"video/3gpp\"; }, " \
-" DATATYPE { priority=EDataTypePriorityHigh; type=\"video/mp4\"; }, " \
-" DATATYPE { priority=EDataTypePriorityHigh; type=\"video/x-m4v\"; }, " \
-" DATATYPE { priority=EDataTypePriorityHigh; type=\"video/mpeg4\"; }, " \
-" DATATYPE { priority=EDataTypePriorityHigh; type=\"application/ram\"; }, " \
-" DATATYPE { priority=EDataTypePriorityHigh; type=\"application/sdp\"; } " \
-" }; " \
--- a/videoplayerapp/hbvideoplayer/resources/service_conf.xml Tue Jun 15 13:09:36 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<service>
- <name>com.nokia.Videos</name>
- <filepath>No path</filepath>
- <description>Video services</description>
- <interface>
- <name>IVideoFetch</name>
- <version>1.0</version>
- <description>Interface to fetch video URI</description>
- </interface>
- <interface>
- <name>IVideoView</name>
- <version>1.0</version>
- <description>Interface to play a video</description>
- </interface>
- <interface>
- <name>com.nokia.symbian.IFileView</name>
- <version>1.0</version>
- <description>Interface for playing video given a QFile</description>
- </interface>
- <interface>
- <name>IVideoBrowse</name>
- <version>1.0</version>
- <description>Interface to browse categorized video content</description>
- </interface>
-</service>
--- a/videoplayerapp/hbvideoplayer/rom/hbvideoplayer.iby Tue Jun 15 13:09:36 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
-* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: hbvideoplayer.iby
-*
-*/
-
-
-#ifndef __HBVIDEOPLAYER_IBY__
-#define __HBVIDEOPLAYER_IBY__
-
-#include <bldvariant.hrh>
-#include <data_caging_paths_for_iby.hrh>
-
-S60_APP_EXE(videoplayer)
-data=DATAZ_/PRIVATE/10003A3F/import/APPS/videoplayer_reg.rsc private/10003a3f/import/apps/videoplayer_reg.rsc
-data=DATAZ_\install\videoplayer_stub.sis system\install\videoplayer_stub.sis
-
-#endif // __HBVIDEOPLAYER_IBY__
--- a/videoplayerapp/hbvideoplayer/rom/hbvideoplayerresources.iby Tue Jun 15 13:09:36 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
-* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: hbvideoplayerresources.iby
-*
-*/
-
-
-#ifndef __HBVIDEOPLAYERRESOURCES_IBY__
-#define __HBVIDEOPLAYERRESOURCES_IBY__
-
-#include <bldvariant.hrh>
-#include <data_caging_paths_for_iby.hrh>
-
-S60_APP_RESOURCE(videoplayer)
-
-data=DATAZ_\QT_TRANSLATIONS_DIR\videos.qm QT_TRANSLATIONS_DIR\videos.qm
-
-#endif // __HBVIDEOPLAYERRESOURCES_IBY__
--- a/videoplayerapp/hbvideoplayer/sis/create_videoplayer_udeb_sisx.bat Tue Jun 15 13:09:36 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-rem
-rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-rem All rights reserved.
-rem This component and the accompanying materials are made available
-rem under the terms of "Eclipse Public License v1.0"
-rem which accompanies this distribution, and is available
-rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
-rem
-rem Initial Contributors:
-rem Nokia Corporation - initial contribution.
-rem
-rem Contributors:
-rem
-rem Description:
-rem
-
-REM Make qt videoplayer udeb sisx file (contains hb -libraries)
-
-call makesis videoplayer_udeb.pkg videoplayer_udeb.sis
-call signsis videoplayer_udeb.sis videoplayer_udeb.sisx Nokia_RnDCert_02.der Nokia_RnDCert_02.key
-call del videoplayer_udeb.sis
--- a/videoplayerapp/hbvideoplayer/sis/create_videoplayer_urel_sisx.bat Tue Jun 15 13:09:36 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-rem
-rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-rem All rights reserved.
-rem This component and the accompanying materials are made available
-rem under the terms of "Eclipse Public License v1.0"
-rem which accompanies this distribution, and is available
-rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
-rem
-rem Initial Contributors:
-rem Nokia Corporation - initial contribution.
-rem
-rem Contributors:
-rem
-rem Description:
-rem
-
-REM Make qt videoplayer urel sisx file (contains hb -libraries)
-
-call makesis videoplayer_urel.pkg videoplayer_urel.sis
-call signsis videoplayer_urel.sis videoplayer_urel.sisx Nokia_RnDCert_02.der Nokia_RnDCert_02.key
-call del videoplayer_urel.sis
--- a/videoplayerapp/hbvideoplayer/sis/videoplayer_stub.pkg Tue Jun 15 13:09:36 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-;
-; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-; All rights reserved.
-; This component and the accompanying materials are made available
-; under the terms of "Eclipse Public License v1.0"
-; which accompanies this distribution, and is available
-; at the URL "http://www.eclipse.org/legal/epl-v10.html".
-;
-; Initial Contributors:
-; Nokia Corporation - initial contribution.
-;
-; Contributors:
-;
-; Description:
-;
-
-; Language
-&EN
-
-; SIS header: name, uid, version
-# {"videoplayer"}, (0x200211FE), 1, 0, 0, TYPE=SA
-
-; Localised Vendor name
-%{"Nokia, Qt Software"}
-
-; Unique Vendor name
-:"Nokia, Qt Software"
-
-;
-; Collection Plugin
-;
-"" - "z:\sys\bin\vcxmyvideoscollectionplugin.dll"
-"" - "z:\resource\plugins\vcxmyvideoscollectionplugin.r*"
-
-;
-; Playback Plugin
-;
-"" - "z:\sys\bin\mpxvideohelixplayback.dll"
-"" - "z:\resource\plugins\mpxvideohelixplayback.r*"
-
-;
-; Video playback view
-;
-"" - "z:\sys\bin\hbvideoplaybackview.dll"
-"" - "z:\sys\bin\hbvideoplaybackviewplugin.dll"
-"" - "z:\resource\plugins\hbvideoplaybackviewplugin.r*"
-
-;
-; Collection view and wrapper
-;
-"" - "z:\sys\bin\videocollectionview.dll"
-"" - "z:\resource\plugins\videocollectionview.r*"
-"" - "z:\sys\bin\videocollectionwrapper.dll"
-"" - "z:\sys\bin\videofiledetailsview.dll"
-"" - "z:\resource\plugins\videofiledetailsview.r*"
-
-;
-; Executable and default resource files
-;
-"" - "z:\sys\bin\videoplayerengine.dll"
-"" - "z:\sys\bin\videoplayer.exe"
-"" - "z:\resource\apps\videoplayer.r*"
-"" - "z:\private\10003a3f\import\apps\videoplayer_reg.r*"
-"" - "z:\resource\qt\translations\videos.qm"
-
-
Binary file videoplayerapp/hbvideoplayer/sis/videoplayer_stub.sis has changed
--- a/videoplayerapp/hbvideoplayer/sis/videoplayer_udeb.pkg Tue Jun 15 13:09:36 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-;
-; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-; All rights reserved.
-; This component and the accompanying materials are made available
-; under the terms of "Eclipse Public License v1.0"
-; which accompanies this distribution, and is available
-; at the URL "http://www.eclipse.org/legal/epl-v10.html".
-;
-; Initial Contributors:
-; Nokia Corporation - initial contribution.
-;
-; Contributors:
-;
-; Description:
-;
-
-; Language
-&EN
-
-; SIS header: name, uid, version
-#{"videoplayer"},(0x200211FE),1,0,0,TYPE=SA, RU
-
-; Localised Vendor name
-%{"Nokia, Qt Software"}
-
-; Unique Vendor name
-:"Nokia, Qt Software"
-
-; Dependencies
-[0x101F7961],0,0,0,{"S60ProductID"}
-[0x102032BE],0,0,0,{"S60ProductID"}
-[0x102752AE],0,0,0,{"S60ProductID"}
-[0x1028315F],0,0,0,{"S60ProductID"}
-(0x2001E61C),4,6,0,{"QtLibs pre-release"}
-
-;
-; Collection Plugin
-;
-"/epoc32/release/armv5/udeb/vcxmyvideoscollectionplugin.dll" - "!:/sys/bin/vcxmyvideoscollectionplugin.dll"
-"/epoc32/data/z/resource/plugins/vcxmyvideoscollectionplugin.rsc" - "!:/resource/plugins/vcxmyvideoscollectionplugin.rsc"
-
-;
-; Playback Plugin
-;
-"/epoc32/release/armv5/udeb/mpxvideohelixplayback.dll" - "!:/sys/bin/mpxvideohelixplayback.dll"
-"/epoc32/data/z/resource/plugins/mpxvideohelixplayback.rsc" - "!:/resource/plugins/mpxvideohelixplayback.rsc"
-
-; Collection view and wrapper
-"/epoc32/release/armv5/udeb/videocollectionview.dll" - "!:/sys/bin/videocollectionview.dll"
-"/epoc32/data/z/resource/plugins/videocollectionview.rsc" - "!:/resource/plugins/videocollectionview.rsc"
-"/epoc32/release/armv5/udeb/videocollectionwrapper.dll" - "!:/sys/bin/videocollectionwrapper.dll"
-"/epoc32/data/z/resource/plugins/videofiledetailsview.rsc" - "!:/resource/plugins/videofiledetailsview.rsc"
-"/epoc32/release/armv5/udeb/videofiledetailsview.dll" - "!:/sys/bin/videofiledetailsview.dll"
-
-; Executable and default resource files
-"/epoc32/release/armv5/udeb/videoplayerengine.dll" - "!:/sys/bin/videoplayerengine.dll"
-"/epoc32/release/armv5/udeb/videoplayer.exe" - "!:/sys/bin/videoplayer.exe"
-"/epoc32/data/z/resource/apps/videoplayer.rsc" - "!:/resource/apps/videoplayer.rsc"
-"/epoc32/data/z/private/10003a3f/import/apps/videoplayer_reg.rsc" - "!:/private/10003a3f/import/apps/videoplayer_reg.rsc"
-"/epoc32/data/z/resource/qt/translations/videos_en.qm" - "!:/resource/qt/translations/videos.qm"
-
-"/epoc32/data/z/resource/plugins/hbvideoplaybackviewplugin.rsc" - "!:/resource/plugins/hbvideoplaybackviewplugin.rsc"
-"/epoc32/release/armv5/udeb/hbvideoplaybackview.dll" - "!:/sys/bin/hbvideoplaybackview.dll"
-"/epoc32/release/armv5/udeb/hbvideoplaybackviewplugin.dll" - "!:/sys/bin/hbvideoplaybackviewplugin.dll"
--- a/videoplayerapp/hbvideoplayer/sis/videoplayer_urel.pkg Tue Jun 15 13:09:36 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-;
-; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-; All rights reserved.
-; This component and the accompanying materials are made available
-; under the terms of "Eclipse Public License v1.0"
-; which accompanies this distribution, and is available
-; at the URL "http://www.eclipse.org/legal/epl-v10.html".
-;
-; Initial Contributors:
-; Nokia Corporation - initial contribution.
-;
-; Contributors:
-;
-; Description:
-;
-
-; Language
-&EN
-
-; SIS header: name, uid, version
-#{"videoplayer"},(0x200211FE),1,0,0,TYPE=SA, RU
-
-; Localised Vendor name
-%{"Nokia, Qt Software"}
-
-; Unique Vendor name
-:"Nokia, Qt Software"
-
-; Dependencies
-[0x101F7961],0,0,0,{"S60ProductID"}
-[0x102032BE],0,0,0,{"S60ProductID"}
-[0x102752AE],0,0,0,{"S60ProductID"}
-[0x1028315F],0,0,0,{"S60ProductID"}
-(0x2001E61C),4,6,0,{"QtLibs pre-release"}
-
-;
-; Collection Plugin
-;
-"/epoc32/release/armv5/urel/vcxmyvideoscollectionplugin.dll" - "!:/sys/bin/vcxmyvideoscollectionplugin.dll"
-"/epoc32/data/z/resource/plugins/vcxmyvideoscollectionplugin.rsc" - "!:/resource/plugins/vcxmyvideoscollectionplugin.rsc"
-
-;
-; Playback Plugin
-;
-"/epoc32/release/armv5/urel/mpxvideohelixplayback.dll" - "!:/sys/bin/mpxvideohelixplayback.dll"
-"/epoc32/data/z/resource/plugins/mpxvideohelixplayback.rsc" - "!:/resource/plugins/mpxvideohelixplayback.rsc"
-
-; Collection view and wrapper
-"/epoc32/release/armv5/urel/videocollectionview.dll" - "!:/sys/bin/videocollectionview.dll"
-"/epoc32/data/z/resource/plugins/videocollectionview.rsc" - "!:/resource/plugins/videocollectionview.rsc"
-"/epoc32/release/armv5/urel/videocollectionwrapper.dll" - "!:/sys/bin/videocollectionwrapper.dll"
-"/epoc32/data/z/resource/plugins/videofiledetailsview.rsc" - "!:/resource/plugins/videofiledetailsview.rsc"
-"/epoc32/release/armv5/urel/videofiledetailsview.dll" - "!:/sys/bin/videofiledetailsview.dll"
-
-; Executable and default resource files
-"/epoc32/release/armv5/urel/videoplayerengine.dll" - "!:/sys/bin/videoplayerengine.dll"
-"/epoc32/release/armv5/urel/videoplayer.exe" - "!:/sys/bin/videoplayer.exe"
-"/epoc32/data/z/resource/apps/videoplayer.rsc" - "!:/resource/apps/videoplayer.rsc"
-"/epoc32/data/z/private/10003a3f/import/apps/videoplayer_reg.rsc" - "!:/private/10003a3f/import/apps/videoplayer_reg.rsc"
-"/epoc32/data/z/resource/qt/translations/videos_en.qm" - "!:/resource/qt/translations/videos.qm"
-
-"/epoc32/data/z/resource/plugins/hbvideoplaybackviewplugin.rsc" - "!:/resource/plugins/hbvideoplaybackviewplugin.rsc"
-"/epoc32/release/armv5/urel/hbvideoplaybackview.dll" - "!:/sys/bin/hbvideoplaybackview.dll"
-"/epoc32/release/armv5/urel/hbvideoplaybackviewplugin.dll" - "!:/sys/bin/hbvideoplaybackviewplugin.dll"
--- a/videoplayerapp/hbvideoplayer/src/main.cpp Tue Jun 15 13:09:36 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of main.cpp
-*
-*/
-
-// Version : %version: 9 %
-
-
-#include <QObject>
-#include <QTranslator>
-#include <QLocale>
-#include <hbapplication.h>
-#include <hbmainwindow.h>
-#include <xqserviceutil.h>
-
-#include "videoplayerengine.h"
-
-int main(int argc, char *argv[])
-{
- HbApplication app(argc, argv);
-
- // Load the translation file.
- QString lang = QLocale::system().name();
-
- QTranslator translator;
-
- bool loaded(false);
-
- loaded = translator.load( "videos_" + lang, QString("c:/resource/qt/translations") );
-
- if (!loaded)
- {
- translator.load("videos_" + lang, QString("z:/resource/qt/translations") );
- }
-
- // Install the translator
- app.installTranslator(&translator);
-
- // has the application been launched via XQ Service Framework
- bool isService = XQServiceUtil::isService();
-
- if (!isService)
- {
- app.setApplicationName(hbTrId("txt_videos_title_videos"));
- }
-
- HbMainWindow mainWindow( 0, Hb::WindowFlagTransparent );
- mainWindow.setAttribute( Qt::WA_OpaquePaintEvent );
-
- QVideoPlayerEngine *engine = new QVideoPlayerEngine(isService);
- engine->initialize();
- mainWindow.show();
- return app.exec();
-}
--- a/videoplayerapp/inc/videoplayerengine.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayerapp/inc/videoplayerengine.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 12 %
+// Version : %version: ou1cpsw#15 %
#ifndef VIDEOPLAYERENGINE_H
#define VIDEOPLAYERENGINE_H
@@ -77,14 +77,23 @@
void doDelayedLoad();
- void createPlayAndDetailsViews();
+ void createMissingViews();
+
+ void createPlaybackView();
void setCurrentView();
+
+ bool isPlayServiceInvoked();
+
+ bool shouldExit();
+
+ bool shouldActivateCollectionView();
private:
bool mIsService;
bool mEmbedded;
bool mDelayedLoadDone;
+ bool mIsPlayService;
MpxViewPlugin* mCurrentViewPlugin;
MpxViewPlugin* mPlaybackViewPlugin;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayer/resources/service_conf.xml Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<service>
+ <name>videoplayer</name>
+ <filepath>No path</filepath>
+ <description>Video services</description>
+ <interface>
+ <name>IVideoFetch</name>
+ <version>1.0</version>
+ <description>Interface to fetch video URI</description>
+ <customproperty key="deprecatedsn">Video Fetcher</customproperty>
+ </interface>
+ <interface>
+ <name>com.nokia.symbian.IVideoFetch</name>
+ <version>1.0</version>
+ <description>Interface to fetch video URI</description>
+ </interface>
+ <interface>
+ <name>IVideoBrowse</name>
+ <version>1.0</version>
+ <description>Interface to browse categorized video content</description>
+ <customproperty key="deprecatedsn">Video Browse</customproperty>
+ </interface>
+ <interface>
+ <name>com.nokia.symbian.IVideoBrowse</name>
+ <version>1.0</version>
+ <description>Interface to browse categorized video content</description>
+ </interface>
+ <interface>
+ <name>IVideoView</name>
+ <version>1.0</version>
+ <description>Interface to play a video</description>
+ <customproperty key="deprecatedsn">Video View</customproperty>
+ </interface>
+ <interface>
+ <name>com.nokia.symbian.IVideoView</name>
+ <version>1.0</version>
+ <description>Interface to play a video</description>
+ </interface>
+ <interface>
+ <name>com.nokia.symbian.IFileView</name>
+ <version>1.0</version>
+ <description>Interface for playing video given a QFile</description>
+ </interface>
+</service>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayer/resources/videos.docml Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="0.9">
+ <widget name="splashView" type="HbView">
+ <string name="title" locid="txt_videos_title_videos" />
+ </widget>
+</hbdocument>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayer/resources/videos.splashml Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbsplash version="1">
+ <docml>videos.docml</docml>
+ <widget>splashView</widget>
+ <appuid>0x200211FE</appuid>
+ <tsappname>videos</tsappname>
+ <fixed-orientation>portrait</fixed-orientation>
+</hbsplash>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayer/rom/videoplayer.iby Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: videoplayer.iby
+*
+*/
+
+
+#ifndef __VIDEOPLAYER_IBY__
+#define __VIDEOPLAYER_IBY__
+
+#include <bldvariant.hrh>
+#include <data_caging_paths_for_iby.hrh>
+
+S60_APP_EXE(videoplayer)
+data=ZPRIVATE\10003A3F\import\APPS\videoplayer_reg.rsc private\10003a3f\import\apps\videoplayer_reg.rsc
+data=ZSYSTEM\install\videoplayer_stub.sis system\install\videoplayer_stub.sis
+data=ZRESOURCE\hb\splashml\videos.splashml RESOURCE_FILES_DIR\hb\splashml\videos.splashml
+data=ZRESOURCE\hb\splashml\videos.docml RESOURCE_FILES_DIR\hb\splashml\videos.docml
+
+#endif // __VIDEOPLAYER_IBY__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayer/rom/videoplayerresources.iby Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: videoplayerresources.iby
+*
+*/
+
+
+#ifndef __VIDEOPLAYERRESOURCES_IBY__
+#define __VIDEOPLAYERRESOURCES_IBY__
+
+#include <bldvariant.hrh>
+#include <data_caging_paths_for_iby.hrh>
+
+S60_APP_RESOURCE(videoplayer)
+
+data=DATAZ_\QT_TRANSLATIONS_DIR\videos.qm QT_TRANSLATIONS_DIR\videos.qm
+
+#endif // __VIDEOPLAYERRESOURCES_IBY__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayer/sis/create_videoplayer_udeb_sisx.bat Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,21 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+REM Make qt videoplayer udeb sisx file (contains hb -libraries)
+
+call makesis videoplayer_udeb.pkg videoplayer_udeb.sis
+call signsis videoplayer_udeb.sis videoplayer_udeb.sisx Nokia_RnDCert_02.der Nokia_RnDCert_02.key
+call del videoplayer_udeb.sis
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayer/sis/create_videoplayer_urel_sisx.bat Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,21 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+REM Make qt videoplayer urel sisx file (contains hb -libraries)
+
+call makesis videoplayer_urel.pkg videoplayer_urel.sis
+call signsis videoplayer_urel.sis videoplayer_urel.sisx Nokia_RnDCert_02.der Nokia_RnDCert_02.key
+call del videoplayer_urel.sis
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayer/sis/videoplayer_stub.pkg Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,66 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:
+;
+
+; Language
+&EN
+
+; SIS header: name, uid, version
+# {"videoplayer"}, (0x200211FE), 1, 0, 0, TYPE=SA
+
+; Localised Vendor name
+%{"Nokia, Qt Software"}
+
+; Unique Vendor name
+:"Nokia, Qt Software"
+
+;
+; Collection Plugin
+;
+"" - "z:\sys\bin\vcxmyvideoscollectionplugin.dll"
+"" - "z:\resource\plugins\vcxmyvideoscollectionplugin.r*"
+
+;
+; Playback Plugin
+;
+"" - "z:\sys\bin\mpxvideohelixplayback.dll"
+"" - "z:\resource\plugins\mpxvideohelixplayback.r*"
+
+;
+; Video playback view
+;
+"" - "z:\sys\bin\hbvideoplaybackview.dll"
+"" - "z:\sys\bin\hbvideoplaybackviewplugin.dll"
+"" - "z:\resource\plugins\hbvideoplaybackviewplugin.r*"
+
+;
+; Collection view and wrapper
+;
+"" - "z:\sys\bin\videocollectionview.dll"
+"" - "z:\resource\plugins\videocollectionview.r*"
+"" - "z:\sys\bin\videocollectionwrapper.dll"
+"" - "z:\sys\bin\videofiledetailsview.dll"
+"" - "z:\resource\plugins\videofiledetailsview.r*"
+
+;
+; Executable and default resource files
+;
+"" - "z:\sys\bin\videoplayerengine.dll"
+"" - "z:\sys\bin\videoplayer.exe"
+"" - "z:\resource\apps\videoplayer.r*"
+"" - "z:\private\10003a3f\import\apps\videoplayer_reg.rsc"
+"" - "z:\resource\qt\translations\videos.qm"
+
+
Binary file videoplayerapp/videoplayer/sis/videoplayer_stub.sis has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayer/sis/videoplayer_udeb.pkg Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,64 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:
+;
+
+; Language
+&EN
+
+; SIS header: name, uid, version
+#{"videoplayer"},(0x200211FE),1,0,0,TYPE=SA, RU
+
+; Localised Vendor name
+%{"Nokia, Qt Software"}
+
+; Unique Vendor name
+:"Nokia, Qt Software"
+
+; Dependencies
+[0x101F7961],0,0,0,{"S60ProductID"}
+[0x102032BE],0,0,0,{"S60ProductID"}
+[0x102752AE],0,0,0,{"S60ProductID"}
+[0x1028315F],0,0,0,{"S60ProductID"}
+(0x2001E61C),4,6,0,{"QtLibs pre-release"}
+
+;
+; Collection Plugin
+;
+"/epoc32/release/armv5/udeb/vcxmyvideoscollectionplugin.dll" - "!:/sys/bin/vcxmyvideoscollectionplugin.dll"
+"/epoc32/data/z/resource/plugins/vcxmyvideoscollectionplugin.rsc" - "!:/resource/plugins/vcxmyvideoscollectionplugin.rsc"
+
+;
+; Playback Plugin
+;
+"/epoc32/release/armv5/udeb/mpxvideohelixplayback.dll" - "!:/sys/bin/mpxvideohelixplayback.dll"
+"/epoc32/data/z/resource/plugins/mpxvideohelixplayback.rsc" - "!:/resource/plugins/mpxvideohelixplayback.rsc"
+
+; Collection view and wrapper
+"/epoc32/release/armv5/udeb/videocollectionview.dll" - "!:/sys/bin/videocollectionview.dll"
+"/epoc32/data/z/resource/plugins/videocollectionview.rsc" - "!:/resource/plugins/videocollectionview.rsc"
+"/epoc32/release/armv5/udeb/videocollectionwrapper.dll" - "!:/sys/bin/videocollectionwrapper.dll"
+"/epoc32/data/z/resource/plugins/videofiledetailsview.rsc" - "!:/resource/plugins/videofiledetailsview.rsc"
+"/epoc32/release/armv5/udeb/videofiledetailsview.dll" - "!:/sys/bin/videofiledetailsview.dll"
+
+; Executable and default resource files
+"/epoc32/release/armv5/udeb/videoplayerengine.dll" - "!:/sys/bin/videoplayerengine.dll"
+"/epoc32/release/armv5/udeb/videoplayer.exe" - "!:/sys/bin/videoplayer.exe"
+"/epoc32/data/z/resource/apps/videoplayer.rsc" - "!:/resource/apps/videoplayer.rsc"
+"/epoc32/data/z/private/10003a3f/import/apps/videoplayer_reg.rsc" - "!:/private/10003a3f/import/apps/videoplayer_reg.rsc"
+"/epoc32/data/z/resource/qt/translations/videos_en.qm" - "!:/resource/qt/translations/videos.qm"
+
+"/epoc32/data/z/resource/plugins/hbvideoplaybackviewplugin.rsc" - "!:/resource/plugins/hbvideoplaybackviewplugin.rsc"
+"/epoc32/release/armv5/udeb/hbvideoplaybackview.dll" - "!:/sys/bin/hbvideoplaybackview.dll"
+"/epoc32/release/armv5/udeb/hbvideoplaybackviewplugin.dll" - "!:/sys/bin/hbvideoplaybackviewplugin.dll"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayer/sis/videoplayer_urel.pkg Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,64 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:
+;
+
+; Language
+&EN
+
+; SIS header: name, uid, version
+#{"videoplayer"},(0x200211FE),1,0,0,TYPE=SA, RU
+
+; Localised Vendor name
+%{"Nokia, Qt Software"}
+
+; Unique Vendor name
+:"Nokia, Qt Software"
+
+; Dependencies
+[0x101F7961],0,0,0,{"S60ProductID"}
+[0x102032BE],0,0,0,{"S60ProductID"}
+[0x102752AE],0,0,0,{"S60ProductID"}
+[0x1028315F],0,0,0,{"S60ProductID"}
+(0x2001E61C),4,6,0,{"QtLibs pre-release"}
+
+;
+; Collection Plugin
+;
+"/epoc32/release/armv5/urel/vcxmyvideoscollectionplugin.dll" - "!:/sys/bin/vcxmyvideoscollectionplugin.dll"
+"/epoc32/data/z/resource/plugins/vcxmyvideoscollectionplugin.rsc" - "!:/resource/plugins/vcxmyvideoscollectionplugin.rsc"
+
+;
+; Playback Plugin
+;
+"/epoc32/release/armv5/urel/mpxvideohelixplayback.dll" - "!:/sys/bin/mpxvideohelixplayback.dll"
+"/epoc32/data/z/resource/plugins/mpxvideohelixplayback.rsc" - "!:/resource/plugins/mpxvideohelixplayback.rsc"
+
+; Collection view and wrapper
+"/epoc32/release/armv5/urel/videocollectionview.dll" - "!:/sys/bin/videocollectionview.dll"
+"/epoc32/data/z/resource/plugins/videocollectionview.rsc" - "!:/resource/plugins/videocollectionview.rsc"
+"/epoc32/release/armv5/urel/videocollectionwrapper.dll" - "!:/sys/bin/videocollectionwrapper.dll"
+"/epoc32/data/z/resource/plugins/videofiledetailsview.rsc" - "!:/resource/plugins/videofiledetailsview.rsc"
+"/epoc32/release/armv5/urel/videofiledetailsview.dll" - "!:/sys/bin/videofiledetailsview.dll"
+
+; Executable and default resource files
+"/epoc32/release/armv5/urel/videoplayerengine.dll" - "!:/sys/bin/videoplayerengine.dll"
+"/epoc32/release/armv5/urel/videoplayer.exe" - "!:/sys/bin/videoplayer.exe"
+"/epoc32/data/z/resource/apps/videoplayer.rsc" - "!:/resource/apps/videoplayer.rsc"
+"/epoc32/data/z/private/10003a3f/import/apps/videoplayer_reg.rsc" - "!:/private/10003a3f/import/apps/videoplayer_reg.rsc"
+"/epoc32/data/z/resource/qt/translations/videos_en.qm" - "!:/resource/qt/translations/videos.qm"
+
+"/epoc32/data/z/resource/plugins/hbvideoplaybackviewplugin.rsc" - "!:/resource/plugins/hbvideoplaybackviewplugin.rsc"
+"/epoc32/release/armv5/urel/hbvideoplaybackview.dll" - "!:/sys/bin/hbvideoplaybackview.dll"
+"/epoc32/release/armv5/urel/hbvideoplaybackviewplugin.dll" - "!:/sys/bin/hbvideoplaybackviewplugin.dll"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayer/src/main.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of main.cpp
+*
+*/
+
+// Version : %version: 3.2 %
+
+
+#include <QObject>
+#include <QTranslator>
+#include <QLocale>
+#include <hbapplication.h>
+#include <hbmainwindow.h>
+#include <xqserviceutil.h>
+#include <hbactivitymanager.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);
+
+ QTranslator translatorCommon;
+
+ loaded = false;
+
+ loaded = translatorCommon.load( "common_" + lang, QString("c:/resource/qt/translations") );
+
+ if (!loaded)
+ {
+ translatorCommon.load("common_" + lang, QString("z:/resource/qt/translations") );
+ }
+
+ // Install the common translator
+ app.installTranslator(&translatorCommon);
+
+ // has the application been launched via XQ Service Framework
+ bool isService = XQServiceUtil::isService();
+
+ if (!isService)
+ {
+ app.setApplicationName(hbTrId("txt_videos_title_videos"));
+
+ HbActivityManager *actManager = app.activityManager();
+ // save activity data locally
+ VideoActivityState::instance().setActivityData(actManager->activityData(ACTIVITY_VIDEOPLAYER_MAINVIEW));
+ // remove from activitymanager
+ actManager->removeActivity(ACTIVITY_VIDEOPLAYER_MAINVIEW);
+ }
+
+ HbMainWindow mainWindow( 0, Hb::WindowFlagTransparent );
+
+ QVideoPlayerEngine *engine = new QVideoPlayerEngine(isService);
+ engine->initialize();
+ mainWindow.show();
+ return app.exec();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayer/videoplayer.pro Thu Jul 22 16:34:17 2010 +0100
@@ -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: Project file for building Videoplayer components
+#
+#
+# Version : %version: 2 %
+
+
+TARGET = videoplayer
+CONFIG += hb service
+TEMPLATE = app
+TRANSLATIONS += videos.ts
+
+symbian:
+{
+ TARGET.CAPABILITY = ALL -DRM -TCB
+ TARGET.EPOCHEAPSIZE = 0x20000 0x1600000
+ TARGET.UID3 = 0x200211FE
+ SKINICON = qtg_large_video_tv
+
+ BLD_INF_RULES.prj_exports += "rom/videoplayer.iby CORE_APP_LAYER_IBY_EXPORT_PATH(videoplayer.iby)" \
+ "rom/videoplayerresources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(videoplayerresources.iby)" \
+ "sis/videoplayer_stub.sis /epoc32/data/z/system/install/videoplayer_stub.sis" \
+ "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" \
+}
+
+# Service provider specific configuration.
+SERVICE.FILE = resources/service_conf.xml
+SERVICE.OPTIONS = embeddable
+# Service provider specific configuration ends
+
+INCLUDEPATH += .
+INCLUDEPATH += ../inc \
+ ../../inc \
+ /epoc32/include/mw/hb/hbtools
+
+LIBS += -lvideoplayerengine.dll \
+ -lxqservice.dll \
+ -lxqserviceutil.dll
+
+VPATH += src
+
+SOURCES += main.cpp
+
+RSS_RULES += \
+" datatype_list = " \
+" { " \
+" DATATYPE { priority=EDataTypePrioritySystem; type=\"video/avi\"; }, " \
+" DATATYPE { priority=EDataTypePrioritySystem; type=\"video/msvideo\"; }, " \
+" DATATYPE { priority=EDataTypePrioritySystem; type=\"application/x-msvideo\"; }, " \
+" DATATYPE { priority=EDataTypePrioritySystem; type=\"video/x-pn-realvideo\"; }, " \
+" DATATYPE { priority=EDataTypePrioritySystem; type=\"audio/x-pn-realaudio\"; }, " \
+" DATATYPE { priority=EDataTypePrioritySystem; type=\"video/vnd.rn-realvideo\"; }, " \
+" DATATYPE { priority=EDataTypePrioritySystem; type=\"application/vnd.rn-realmedia\"; }, " \
+" DATATYPE { priority=EDataTypePrioritySystem; type=\"application/x-pn-realmedia\"; }, " \
+" DATATYPE { priority=EDataTypePrioritySystem; type=\"audio/x-pn-realaudio-plugin\"; }, " \
+" DATATYPE { priority=EDataTypePrioritySystem; type=\"video/x-matroska\"; }, " \
+" DATATYPE { priority=EDataTypePriorityHigh; type=\"video/x-ms-wmv\"; }, " \
+" DATATYPE { priority=EDataTypePriorityHigh; type=\"video/x-ms-asf\"; }, " \
+" DATATYPE { priority=EDataTypePriorityHigh; type=\"video/3gp\"; }, " \
+" DATATYPE { priority=EDataTypePriorityHigh; type=\"video/3gpp2\"; }, " \
+" DATATYPE { priority=EDataTypePriorityHigh; type=\"video/3gpp\"; }, " \
+" DATATYPE { priority=EDataTypePriorityHigh; type=\"video/mp4\"; }, " \
+" DATATYPE { priority=EDataTypePriorityHigh; type=\"video/x-m4v\"; }, " \
+" DATATYPE { priority=EDataTypePriorityHigh; type=\"video/mpeg4\"; }, " \
+" DATATYPE { priority=EDataTypePriorityHigh; type=\"application/ram\"; }, " \
+" DATATYPE { priority=EDataTypePriorityHigh; type=\"application/sdp\"; } " \
+" }; " \
--- a/videoplayerapp/videoplayerapp.pro Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayerapp/videoplayerapp.pro Thu Jul 22 16:34:17 2010 +0100
@@ -14,10 +14,10 @@
# Description: Project file for building Videoplayer components
#
#
-# Version : %version: 4 %
+# Version : %version: 5 %
TEMPLATE = subdirs
CONFIG += ordered
SUBDIRS += videoplayerengine \
- hbvideoplayer
+ videoplayer
--- a/videoplayerapp/videoplayerengine/inc/videoservicebrowse.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayerapp/videoplayerengine/inc/videoservicebrowse.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 3 %
+// Version : %version: 4 %
#ifndef VIDEOSERVICEBROWSE_H
#define VIDEOSERVICEBROWSE_H
@@ -25,13 +25,14 @@
// FORWARD DECLARATIONS
class VideoServices;
+class QLatin1String;
class VideoServiceBrowse : public XQServiceProvider
{
Q_OBJECT
public:
- VideoServiceBrowse( VideoServices *parent = 0 );
+ VideoServiceBrowse( VideoServices *parent, QLatin1String service );
~VideoServiceBrowse();
public:
@@ -68,6 +69,14 @@
*/
int sortRole() const;
+ /**
+ * Returns service active status
+ *
+ * @return bool true if active, false if not active
+ *
+ */
+ bool isActive();
+
public slots:
/**
@@ -80,6 +89,15 @@
*/
void browseVideos(const QString &title, int category, int sortRole);
+ /**
+ * Browse video
+ *
+ * @param category, Category which type of videos are browsed
+ * @param sort, Sort type.
+ * @return None
+ */
+ void browseVideos(int category, int sortRole);
+
private:
/** request index of the service */
int mRequestIndex;
--- a/videoplayerapp/videoplayerengine/inc/videoserviceplay.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayerapp/videoplayerengine/inc/videoserviceplay.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: da1mmcf#2 %
#ifndef __VIDEOSERVICEPLAY_H__
#define __VIDEOSERVICEPLAY_H__
@@ -26,6 +26,7 @@
// FORWARD DECLARATIONS
class VideoServices;
class QVideoPlayerEngine;
+class QLatin1String;
class VideoServicePlay : public XQServiceProvider
{
@@ -33,7 +34,7 @@
Q_OBJECT
public:
- VideoServicePlay( VideoServices* parent, QVideoPlayerEngine* engine );
+ VideoServicePlay( VideoServices *parent, QVideoPlayerEngine* engine, QLatin1String service );
virtual ~VideoServicePlay();
void setEngine( QVideoPlayerEngine* engine );
--- a/videoplayerapp/videoplayerengine/inc/videoserviceurifetch.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayerapp/videoplayerengine/inc/videoserviceurifetch.h Thu Jul 22 16:34:17 2010 +0100
@@ -24,6 +24,7 @@
// FORWARD DECLARATIONS
class VideoServices;
+class QLatin1String;
class VideoServiceUriFetch : public XQServiceProvider
{
@@ -38,7 +39,7 @@
/**
* contructor
*/
- VideoServiceUriFetch( VideoServices *parent = 0 );
+ VideoServiceUriFetch( VideoServices *parent, QLatin1String service );
/**
* destructor
@@ -73,6 +74,12 @@
/*
* Client can use this method launch video URI fetching
*
+ */
+ void fetch();
+
+ /*
+ * Client can use this method launch video URI fetching
+ *
* @param title title to be set
*
*/
--- a/videoplayerapp/videoplayerengine/inc/videoserviceview.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayerapp/videoplayerengine/inc/videoserviceview.h Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
#ifndef __VIDEOSERVICEVIEW_H__
#define __VIDEOSERVICEVIEW_H__
@@ -28,6 +28,7 @@
class VideoServices;
class QVideoPlayerEngine;
class QFile;
+class QLatin1String;
class VideoServiceView : public XQServiceProvider
{
@@ -35,7 +36,7 @@
Q_OBJECT
public:
- VideoServiceView( VideoServices* parent, QVideoPlayerEngine* engine );
+ VideoServiceView( VideoServices *parent, QVideoPlayerEngine* engine, QLatin1String service );
virtual ~VideoServiceView();
void setEngine( QVideoPlayerEngine* engine );
--- a/videoplayerapp/videoplayerengine/src/mpxvideoplaybackwrapper.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayerapp/videoplayerengine/src/mpxvideoplaybackwrapper.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 4 %
+// Version : %version: ou1cpsw#5 %
#include "mpxvideo_debug.h"
@@ -59,6 +59,7 @@
TRAPD( err, mUiEngine = CMpxVideoPlayerAppUiEngine::NewL( this ) );
MPX_DEBUG(_L("QMpxVideoPlaybackWrapper::initializePlugins err = %d"), err);
+ Q_UNUSED(err);
}
// -------------------------------------------------------------------------------------------------
--- a/videoplayerapp/videoplayerengine/src/mpxvideoplayerappuiengine.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayerapp/videoplayerengine/src/mpxvideoplayerappuiengine.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: ou1cpsw#8 %
+// Version : %version: 9 %
@@ -567,16 +567,7 @@
if ( aLocalFile )
{
- CMediaRecognizer::TMediaType mediaType = iRecognizer->IdentifyMediaTypeL( link );
-
- if ( mediaType == CMediaRecognizer::EUnidentified )
- {
- User::Leave( KErrNotSupported );
- }
- else
- {
- iPlaybackUtility->InitL( link );
- }
+ iPlaybackUtility->InitL( link );
}
else
{
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/src/videoactivitystate.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -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: 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
--- a/videoplayerapp/videoplayerengine/src/videoplayerengine.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayerapp/videoplayerengine/src/videoplayerengine.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 27 %
+// Version : %version: da1mmcf#37 %
#include <QApplication>
@@ -25,8 +25,11 @@
#include <xqplugininfo.h>
#include <xqserviceutil.h>
#include <hbview.h>
+#include <hbapplication.h>
+#include <hbactivitymanager.h>
#include "videoplayerengine.h"
+#include "videoactivitystate.h"
#include "mpxvideoplaybackwrapper.h"
#include "videoservices.h"
#include "mpxvideo_debug.h"
@@ -39,6 +42,7 @@
: mIsService( isService )
, mEmbedded( false )
, mDelayedLoadDone( false )
+ , mIsPlayService( false )
, mCurrentViewPlugin( 0 )
, mPlaybackViewPlugin( 0 )
, mCollectionViewPlugin( 0 )
@@ -56,31 +60,37 @@
QVideoPlayerEngine::~QVideoPlayerEngine()
{
MPX_ENTER_EXIT(_L("QVideoPlayerEngine::~QVideoPlayerEngine()"));
-
+
if ( mVideoServices )
{
mVideoServices->decreaseReferenceCount();
mVideoServices = 0;
}
- if ( mCollectionViewPlugin )
+ if ( mCollectionViewPlugin )
{
mCollectionViewPlugin->destroyView();
+ delete mCollectionViewPlugin;
+ mCollectionViewPlugin = 0;
}
- if ( mPlaybackViewPlugin )
+ if ( mPlaybackViewPlugin )
{
mPlaybackViewPlugin->destroyView();
+ delete mPlaybackViewPlugin;
+ mPlaybackViewPlugin = 0;
}
- if ( mFileDetailsViewPlugin )
+ if ( mFileDetailsViewPlugin )
{
mFileDetailsViewPlugin->destroyView();
+ delete mFileDetailsViewPlugin;
+ mFileDetailsViewPlugin = 0;
}
delete mPlaybackWrapper;
- // disconnect all signals
+ // disconnect all signals
disconnect();
}
@@ -90,8 +100,8 @@
//
void QVideoPlayerEngine::initialize()
{
- MPX_ENTER_EXIT(_L("QVideoPlayerEngine::initialize()"));
-
+ MPX_ENTER_EXIT(_L("QVideoPlayerEngine::initialize()"));
+
//
// Clean up QVideoPlayerEngine when qApp try to quit
//
@@ -109,36 +119,52 @@
SLOT( handleCommand( int ) ) );
}
- //
- // Get VideoServices instance
- //
- if ( mIsService && ! mVideoServices )
- {
- mVideoServices = VideoServices::instance(this);
- connect( mVideoServices, SIGNAL(activated(int)), this, SLOT(handleCommand(int)));
- }
-
QList<XQPluginInfo> impls;
XQPluginLoader::listImplementations("org.nokia.mmdt.MpxViewPlugin/1.0", impls);
- //
- // Pre-load collection plugin and create collection view
- //
- loadPluginAndCreateView( MpxHbVideoCommon::CollectionView );
-
- //
- // if app is opened via serviceFW create remaining views
- // otherwise activate default view i.e. the collection view.
- //
if ( mIsService )
{
- createPlayAndDetailsViews();
+ if(!mVideoServices)
+ {
+ mVideoServices = VideoServices::instance(this);
+ connect( mVideoServices, SIGNAL(activated(int)), this, SLOT(handleCommand(int)));
+ }
+ if ( isPlayServiceInvoked() )
+ {
+ createPlaybackView();
+ }
+ else
+ {
+ 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")))
+ {
+ activateView( MpxHbVideoCommon::CollectionView );
+ }
+ }
}
else
- {
- activateView( MpxHbVideoCommon::CollectionView );
+ {
+ // 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 )
+ {
+ createPlaybackView();
+ viewType = MpxHbVideoCommon::MpxHbVideoViewType(typeGotten);
+ QVariant data = VideoActivityState::instance().getActivityData(KEY_LAST_PLAYED_CLIP);
+ playMedia( data.toString() );
+ }
+ else
+ {
+ loadPluginAndCreateView( viewType );
+ activateView( viewType );
+ }
}
-
}
// -------------------------------------------------------------------------------------------------
@@ -149,13 +175,13 @@
{
MPX_ENTER_EXIT(_L("QVideoPlayerEngine::handleCommand()"),
_L("commandCode = %d"), commandCode );
-
+
switch ( commandCode )
{
case MpxHbVideoCommon::ActivateCollectionView:
{
if ( mCurrentViewPlugin != mCollectionViewPlugin )
- {
+ {
activateView( MpxHbVideoCommon::CollectionView );
}
break;
@@ -163,8 +189,8 @@
case MpxHbVideoCommon::ActivatePlaybackView:
{
if ( mCurrentViewPlugin != mPlaybackViewPlugin )
- {
- activateView( MpxHbVideoCommon::PlaybackView );
+ {
+ activateView( MpxHbVideoCommon::PlaybackView );
}
break;
}
@@ -172,7 +198,7 @@
{
if ( mCurrentViewPlugin != mFileDetailsViewPlugin )
{
- activateView( MpxHbVideoCommon::VideoDetailsView );
+ activateView( MpxHbVideoCommon::VideoDetailsView );
}
break;
}
@@ -184,12 +210,12 @@
}
break;
}
-
+
default:
{
break;
}
- }
+ }
}
// -------------------------------------------------------------------------------------------------
@@ -199,35 +225,50 @@
void QVideoPlayerEngine::doDelayedLoad()
{
MPX_ENTER_EXIT(_L("QVideoPlayerEngine::doDelayedLoad()"));
-
- createPlayAndDetailsViews();
-
+
+ createMissingViews();
+
mDelayedLoadDone = true;
}
// -------------------------------------------------------------------------------------------------
-// createPlayAndDetailsViews()
+// createPlaybackView()
// -------------------------------------------------------------------------------------------------
//
-void QVideoPlayerEngine::createPlayAndDetailsViews()
+void QVideoPlayerEngine::createPlaybackView()
{
- MPX_ENTER_EXIT(_L("QVideoPlayerEngine::createPlayAndDetailsViews()"));
-
+ MPX_ENTER_EXIT(_L("QVideoPlayerEngine::createPlaybackView()"));
+
+ mPlaybackWrapper->lateInit();
+
+ if ( ! mPlaybackViewPlugin )
+ {
+ loadPluginAndCreateView( MpxHbVideoCommon::PlaybackView );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// createMissingViews()
+// -------------------------------------------------------------------------------------------------
+//
+void QVideoPlayerEngine::createMissingViews()
+{
+ MPX_ENTER_EXIT(_L("QVideoPlayerEngine::createMissingViews()"));
+
//
// delayed initialization of some uiengine member variables
// to help application startup time & improve playback start time
//
- mPlaybackWrapper->lateInit();
-
- if ( ! mPlaybackViewPlugin )
- {
- loadPluginAndCreateView( MpxHbVideoCommon::PlaybackView );
- }
+ createPlaybackView();
- if ( ! mFileDetailsViewPlugin )
+ if(!mFileDetailsViewPlugin)
{
loadPluginAndCreateView( MpxHbVideoCommon::VideoDetailsView );
}
+ if(!mCollectionViewPlugin)
+ {
+ loadPluginAndCreateView( MpxHbVideoCommon::CollectionView );
+ }
}
@@ -240,65 +281,60 @@
{
MPX_ENTER_EXIT(_L("QVideoPlayerEngine::activateView() "),
_L("viewType = %d"), viewType );
-
+
disconnectView();
-
+
if ( mCurrentViewPlugin )
{
mCurrentViewPlugin->deactivateView();
mCurrentViewPlugin = NULL;
}
- if ( viewType == MpxHbVideoCommon::CollectionView && mCollectionViewPlugin )
+ switch ( viewType )
{
- if ( mIsService &&
- ( mVideoServices->currentService() == VideoServices::EPlayback ||
- mVideoServices->currentService() == VideoServices::EView ||
- mVideoServices->currentService() == VideoServices::EUriFetcher ) )
+ case MpxHbVideoCommon::CollectionView:
{
- if ( mVideoServices->currentService() == VideoServices::EUriFetcher )
- {
- if ( ! mVideoServices->mFetchSelected )
- {
- //
- // view is in 'fetch' service but 'attach' operation has not been selected,
- // therefore, go back to collection view
- //
- mCurrentViewPlugin = mCollectionViewPlugin;
- setCurrentView();
- }
- }
- else
+ if ( shouldExit() )
{
qApp->quit();
XQServiceUtil::toBackground( false );
}
- }
- else
- {
- mCurrentViewPlugin = mCollectionViewPlugin;
- setCurrentView();
- }
- }
- else if ( viewType == MpxHbVideoCommon::PlaybackView )
- {
- if ( ! mPlaybackViewPlugin )
- {
- loadPluginAndCreateView( MpxHbVideoCommon::PlaybackView );
+ else if ( shouldActivateCollectionView() )
+ {
+ if ( ! mCollectionViewPlugin )
+ {
+ loadPluginAndCreateView( MpxHbVideoCommon::CollectionView );
+ }
+ mCurrentViewPlugin = mCollectionViewPlugin;
+ setCurrentView();
+ }
+
+ break;
}
-
- mCurrentViewPlugin = mPlaybackViewPlugin;
- setCurrentView();
- }
- else if ( viewType == MpxHbVideoCommon::VideoDetailsView )
- {
- if ( ! mFileDetailsViewPlugin )
- {
- loadPluginAndCreateView( MpxHbVideoCommon::VideoDetailsView );
- }
-
- mCurrentViewPlugin = mFileDetailsViewPlugin;
- setCurrentView();
+ case MpxHbVideoCommon::PlaybackView:
+ {
+ if ( ! mPlaybackViewPlugin )
+ {
+ loadPluginAndCreateView( MpxHbVideoCommon::PlaybackView );
+ }
+
+ mCurrentViewPlugin = mPlaybackViewPlugin;
+ setCurrentView();
+
+ break;
+ }
+ case MpxHbVideoCommon::VideoDetailsView:
+ {
+ if ( ! mFileDetailsViewPlugin )
+ {
+ loadPluginAndCreateView( MpxHbVideoCommon::VideoDetailsView );
+ }
+
+ mCurrentViewPlugin = mFileDetailsViewPlugin;
+ setCurrentView();
+
+ break;
+ }
}
}
@@ -308,16 +344,16 @@
//
void QVideoPlayerEngine::loadPluginAndCreateView( MpxHbVideoCommon::MpxHbVideoViewType viewType )
{
- MPX_ENTER_EXIT(_L("QVideoPlayerEngine::loadPluginAndCreateView() "),
+ MPX_ENTER_EXIT(_L("QVideoPlayerEngine::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;
}
@@ -328,7 +364,7 @@
if ( viewTypeUid )
{
- //
+ //
// load corresponding plug-in
//
XQPluginLoader pluginLoader( viewTypeUid );
@@ -338,7 +374,7 @@
{
MpxViewPlugin *currentViewPlugin = NULL;
- if ( viewType == MpxHbVideoCommon::CollectionView )
+ if ( viewType == MpxHbVideoCommon::CollectionView )
{
mCollectionViewPlugin = qobject_cast<MpxViewPlugin*>( instance )->viewPlugin();
currentViewPlugin = mCollectionViewPlugin;
@@ -355,32 +391,32 @@
}
else
{
- MPX_DEBUG(_L("QVideoPlayerEngine::loadPluginAndCreateView() : plugin not FOUND ! "));
+ MPX_DEBUG(_L("QVideoPlayerEngine::loadPluginAndCreateView() : plugin not FOUND ! "));
}
-
+
//
// create corresponding view
//
- if ( currentViewPlugin )
+ if ( currentViewPlugin )
{
QGraphicsWidget *view = currentViewPlugin->getView();
-
+
if ( ! view )
{
MPX_DEBUG(_L("QVideoPlayerEngine::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("QVideoPlayerEngine::loadPluginAndCreateView() : view has already been created! "));
}
}
else
{
- MPX_DEBUG(_L("QVideoPlayerEngine::loadPluginAndCreateView() : currentViewPlugin is NULL ! "));
- }
+ MPX_DEBUG(_L("QVideoPlayerEngine::loadPluginAndCreateView() : currentViewPlugin is NULL ! "));
+ }
}
}
}
@@ -393,7 +429,7 @@
void QVideoPlayerEngine::connectView()
{
MPX_ENTER_EXIT(_L("QVideoPlayerEngine::connectView()"));
-
+
connect( mCurrentViewPlugin,
SIGNAL( command( int ) ),
this,
@@ -408,13 +444,13 @@
void QVideoPlayerEngine::disconnectView()
{
MPX_ENTER_EXIT(_L("QVideoPlayerEngine::disconnectView()"));
-
+
if ( mCurrentViewPlugin )
{
disconnect( mCurrentViewPlugin,
SIGNAL( command( int ) ),
this,
- SLOT( handleCommand( int ) ) );
+ SLOT( handleCommand( int ) ) );
}
}
@@ -425,7 +461,47 @@
void QVideoPlayerEngine::handleQuit()
{
MPX_ENTER_EXIT(_L("QVideoPlayerEngine::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
+ // VideoActivityState before they are saved to to activity manager
+ //
+ 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)
+ {
+ // 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);
+ if ( playdata.toBool() )
+ {
+ viewType = MpxHbVideoCommon::PlaybackView;
+ }
+ }
+
+ data = viewType;
+ localActivity.setActivityData(data, KEY_VIEWPLUGIN_TYPE);
+
+ // save data to activity manager
+ actManager->addActivity(ACTIVITY_VIDEOPLAYER_MAINVIEW,
+ localActivity.getActivityData(),
+ QVariantHash());
+ }
+
delete this;
}
@@ -437,8 +513,8 @@
void QVideoPlayerEngine::playMedia( QString filePath )
{
MPX_ENTER_EXIT(_L("QVideoPlayerEngine::playMedia()"),
- _L("filePath = %s"), filePath.data() );
-
+ _L("filePath = %s"), filePath.data() );
+
mPlaybackWrapper->playMedia( filePath );
}
@@ -448,9 +524,9 @@
//
void QVideoPlayerEngine::playMedia( RFile file )
{
- MPX_ENTER_EXIT(_L("QVideoPlayerEngine::playMedia( RFile )"));
-
- mPlaybackWrapper->playMedia( file );
+ MPX_ENTER_EXIT(_L("QVideoPlayerEngine::playMedia( RFile )"));
+
+ mPlaybackWrapper->playMedia( file );
}
// -------------------------------------------------------------------------------------------------
@@ -459,8 +535,8 @@
//
void QVideoPlayerEngine::setEmbedded()
{
- MPX_ENTER_EXIT(_L("QVideoPlayerEngine::setEmbedded()"));
-
+ MPX_ENTER_EXIT(_L("QVideoPlayerEngine::setEmbedded()"));
+
mEmbedded = true;
}
@@ -470,14 +546,14 @@
//
void QVideoPlayerEngine::setCurrentView()
{
- MPX_ENTER_EXIT(_L("QVideoPlayerEngine::setCurrentView()"));
-
+ MPX_ENTER_EXIT(_L("QVideoPlayerEngine::setCurrentView()"));
+
if ( mCurrentViewPlugin )
{
//
// set current view
//
- hbInstance->allMainWindows().value(0)->setCurrentView(
+ hbInstance->allMainWindows().value(0)->setCurrentView(
qobject_cast<HbView*>( mCurrentViewPlugin->getView() ), false );
//
@@ -485,12 +561,79 @@
//
connectView();
- //
+ //
// activate view
//
mCurrentViewPlugin->activateView();
}
}
+// -------------------------------------------------------------------------------------------------
+// isPlayServiceInvoked()
+// -------------------------------------------------------------------------------------------------
+//
+bool QVideoPlayerEngine::isPlayServiceInvoked()
+{
+ MPX_ENTER_EXIT(_L("QVideoPlayerEngine::isPlayServiceInvoked()"));
+
+ bool result = false;
+
+ if ( mIsService )
+ {
+ QString intface = XQServiceUtil::interfaceName();
+
+ if ( intface.contains("IVideoView") ||
+ intface.contains("IFileView") )
+ {
+ result = true;
+ mIsPlayService = true;
+ }
+ }
+
+ return result;
+}
+
+// -------------------------------------------------------------------------------------------------
+// shouldExit()
+// -------------------------------------------------------------------------------------------------
+//
+bool QVideoPlayerEngine::shouldExit()
+{
+ bool result = false;
+
+ if ( mIsPlayService ) // play or view service
+ {
+ result = true;
+ }
+
+ MPX_DEBUG(_L("QVideoPlayerEngine::shouldExit() return %d"), result);
+
+ return result;
+}
+
+
+// -------------------------------------------------------------------------------------------------
+// shouldActivateCollectionView()
+// -------------------------------------------------------------------------------------------------
+//
+bool QVideoPlayerEngine::shouldActivateCollectionView()
+{
+ bool result = true;
+
+ // the only case where collection view should NOT be activated is ...
+ // if we are in service and that service is fetch and if fetch is selected
+ // in all other cases collection view should be activated
+
+ if ( mIsService &&
+ mVideoServices->currentService() == VideoServices::EUriFetcher &&
+ mVideoServices->mFetchSelected )
+ {
+ result = false;
+ }
+
+ MPX_DEBUG(_L("QVideoPlayerEngine::shouldActivateCollectionView() return %d"), result);
+
+ return result;
+}
// End of file
--- a/videoplayerapp/videoplayerengine/src/videoservicebrowse.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayerapp/videoplayerengine/src/videoservicebrowse.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 3 %
+// Version : %version: 4 %
#include <hbapplication.h>
@@ -23,13 +23,14 @@
#include "videoservicebrowse.h"
#include "mpxhbvideocommondefs.h"
#include "mpxvideo_debug.h"
+#include <xqaiwdecl.h>
// -------------------------------------------------------------------------------------------------
// VideoServiceBrowse()
// -------------------------------------------------------------------------------------------------
//
-VideoServiceBrowse::VideoServiceBrowse( VideoServices* parent )
- : XQServiceProvider( QLatin1String("com.nokia.Videos.IVideoBrowse"), parent )
+VideoServiceBrowse::VideoServiceBrowse(VideoServices* parent, QLatin1String service)
+ : XQServiceProvider( service, parent )
, mRequestIndex( 0 )
, mServiceApp( parent )
, mCategory( 0 )
@@ -128,14 +129,67 @@
mCategory = category;
mSortRole = sortRole;
+ // store async request id
+ mRequestIndex = setCurrentRequestAsync();
+
// start service
mServiceApp->setCurrentService(VideoServices::EBrowse);
emit mServiceApp->titleReady(appTitle);
emit mServiceApp->activated(MpxHbVideoCommon::ActivateCollectionView);
- // store async request id
- mRequestIndex = setCurrentRequestAsync();
MPX_DEBUG(_L("VideoServiceBrowse::browseVideos() : mRequestIndex = %d"), mRequestIndex );
}
+// ----------------------------------------------------------------------------
+// isActive()
+// ----------------------------------------------------------------------------
+//
+bool VideoServiceBrowse::isActive()
+{
+ MPX_DEBUG(_L("VideoServiceBrowse::isActive() ret %d"), mRequestIndex );
+
+ return (mRequestIndex > 0);
+}
+
+// -------------------------------------------------------------------------------------------------
+// browseVideos()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoServiceBrowse::browseVideos(int category, int sortRole)
+{
+ MPX_ENTER_EXIT(_L("VideoServiceBrowse::browseVideos()"));
+
+ // set application title
+ XQRequestInfo info = requestInfo();
+
+ QVariant variant = info.info("WindowTitle");
+
+ QString appTitle;
+
+ if(variant.isValid())
+ {
+ appTitle = variant.toString();
+ }
+
+ if (appTitle.isEmpty())
+ {
+ appTitle = hbTrId("txt_videos_title_videos");
+ }
+
+ mTitle = appTitle;
+ mCategory = category;
+ mSortRole = sortRole;
+
+ // store async request id
+ mRequestIndex = setCurrentRequestAsync();
+
+ // start service
+ mServiceApp->setCurrentService(VideoServices::EBrowse);
+ emit mServiceApp->titleReady(appTitle);
+ emit mServiceApp->activated(MpxHbVideoCommon::ActivateCollectionView);
+
+ MPX_DEBUG(_L("VideoServiceBrowse::browseVideos() : mRequestIndex = %d"), mRequestIndex );
+}
+
+
// End of file
--- a/videoplayerapp/videoplayerengine/src/videoserviceplay.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayerapp/videoplayerengine/src/videoserviceplay.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: %
+// Version : %version: da1mmcf#5 %
#include "videoservices.h"
#include "videoserviceplay.h"
@@ -27,8 +27,10 @@
// VideoServicePlay()
// -------------------------------------------------------------------------------------------------
//
-VideoServicePlay::VideoServicePlay( VideoServices* parent, QVideoPlayerEngine* engine )
- : XQServiceProvider( QLatin1String("com.nokia.Videos.IVideoView"), parent )
+VideoServicePlay::VideoServicePlay( VideoServices* parent,
+ QVideoPlayerEngine* engine,
+ QLatin1String service )
+ : XQServiceProvider( service, parent )
, mEngine( engine )
, mServiceApp( parent )
{
--- a/videoplayerapp/videoplayerengine/src/videoservices.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayerapp/videoplayerengine/src/videoservices.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 6 %
+// Version : %version: da1mmcf#8 %
#include "videoplayerengine.h"
#include "videoservices.h"
@@ -24,6 +24,8 @@
#include "videoserviceview.h"
#include "videoservicebrowse.h"
#include "mpxvideo_debug.h"
+#include <xqaiwdecl.h>
+#include <xqserviceutil.h>
VideoServices *VideoServices::mInstance = 0;
@@ -110,11 +112,23 @@
, mFetchSelected( false )
{
MPX_ENTER_EXIT(_L("VideoServices::VideoServices()"));
+
+ mServicePlay = new VideoServicePlay(this, engine, QLatin1String("videoplayer.com.nokia.symbian.IVideoView")); //New service, new interface
+ mServiceView = new VideoServiceView(this, engine, QLatin1String("videoplayer.com.nokia.symbian.IFileView")); //New service, new interface
+ mServiceUriFetch = new VideoServiceUriFetch(this, QLatin1String("videoplayer.com.nokia.symbian.IVideoFetch")); //New service, new interface
+ mServiceBrowse = new VideoServiceBrowse( this, QLatin1String("videoplayer.com.nokia.symbian.IVideoBrowse")); //New service, new interface
+
+ mServicePlayDeprecatedNewService = new VideoServicePlay(this, engine, QLatin1String("videoplayer.IVideoView")); //New service, old interface
+ mServicePlayDeprecatedOldService = new VideoServicePlay(this, engine, QLatin1String("com.nokia.Videos.IVideoView")); //Old service, old interface
- mServiceUriFetch = new VideoServiceUriFetch(this);
- mServicePlay = new VideoServicePlay(this, engine);
- mServiceView = new VideoServiceView(this, engine);
- mServiceBrowse = new VideoServiceBrowse(this);
+ mServiceViewDeprecatedNewService = new VideoServiceView(this, engine, QLatin1String("videoplayer.IFileView")); //New service, old interface
+ mServiceViewDeprecatedOldService = new VideoServiceView(this, engine, QLatin1String("com.nokia.Videos.IFileView")); //Old service, old interface
+
+ mServiceUriFetchDeprecatedNewService = new VideoServiceUriFetch(this, QLatin1String("videoplayer.IVideoFetch")); //New service, old interface
+ mServiceUriFetchDeprecatedOldService = new VideoServiceUriFetch(this, QLatin1String("com.nokia.Videos.IVideoFetch")); //Old service, old interface
+
+ mServiceBrowseDeprecatedNewService = new VideoServiceBrowse(this, QLatin1String("videoplayer.IVideoBrowse")); //New service, old interface
+ mServiceBrowseDeprecatedOldService = new VideoServiceBrowse(this, QLatin1String("com.nokia.Videos.IVideoBrowse")); //Old service, old interface
}
// ----------------------------------------------------------------------------
@@ -129,6 +143,14 @@
delete mServicePlay;
delete mServiceView;
delete mServiceBrowse;
+ delete mServicePlayDeprecatedNewService;
+ delete mServicePlayDeprecatedOldService;
+ delete mServiceViewDeprecatedNewService;
+ delete mServiceViewDeprecatedOldService;
+ delete mServiceBrowseDeprecatedNewService;
+ delete mServiceUriFetchDeprecatedNewService;
+ delete mServiceBrowseDeprecatedOldService;
+ delete mServiceUriFetchDeprecatedOldService;
}
// ----------------------------------------------------------------------------
@@ -151,12 +173,23 @@
MPX_DEBUG(_L("VideoServices::getBrowseCategory()"));
int category = 0;
-
- if ( mServiceBrowse )
+
+ if ( mServiceBrowse && (XQServiceUtil::interfaceName().contains("symbian")))
{
category = mServiceBrowse->getBrowseCategory();
}
-
+ else if ( mServiceBrowseDeprecatedNewService && mServiceBrowseDeprecatedOldService && !(XQServiceUtil::interfaceName().contains("symbian")))
+ {
+ if (mServiceBrowseDeprecatedNewService->isActive())
+ {
+ category = mServiceBrowseDeprecatedNewService->getBrowseCategory();
+ }
+ else
+ {
+ category = mServiceBrowseDeprecatedOldService->getBrowseCategory();
+ }
+ }
+
return category;
}
@@ -180,14 +213,42 @@
MPX_DEBUG(_L("VideoServices::contextTitle()") );
QString title;
-
- if (mCurrentService == VideoServices::EUriFetcher && mServiceUriFetch)
+
+ if (mCurrentService == VideoServices::EUriFetcher)
{
- title = mServiceUriFetch->contextTitle();
+ if(mServiceUriFetch && (XQServiceUtil::interfaceName().contains("symbian")))
+ {
+ title = mServiceUriFetch->contextTitle();
+ }
+ else if (mServiceUriFetchDeprecatedNewService && mServiceUriFetchDeprecatedOldService && !(XQServiceUtil::interfaceName().contains("symbian")))
+ {
+ if(mServiceUriFetchDeprecatedNewService->isActive())
+ {
+ title = mServiceUriFetchDeprecatedNewService->contextTitle();
+ }
+ else
+ {
+ title = mServiceUriFetchDeprecatedOldService->contextTitle();
+ }
+ }
}
- else if (mCurrentService == VideoServices::EBrowse && mServiceBrowse)
+ else if (mCurrentService == VideoServices::EBrowse)
{
- title = mServiceBrowse->contextTitle();
+ if ( mServiceBrowse && (XQServiceUtil::interfaceName().contains("symbian")))
+ {
+ title = mServiceBrowse->contextTitle();
+ }
+ else if ( mServiceBrowseDeprecatedNewService && mServiceBrowseDeprecatedOldService && !(XQServiceUtil::interfaceName().contains("symbian")))
+ {
+ if (mServiceBrowseDeprecatedNewService->isActive())
+ {
+ title = mServiceBrowseDeprecatedNewService->contextTitle();
+ }
+ else
+ {
+ title = mServiceBrowseDeprecatedOldService->contextTitle();
+ }
+ }
}
return title;
@@ -202,10 +263,24 @@
MPX_ENTER_EXIT(_L("VideoServices::sortType()"));
int sortRole = 0;
-
- if (mCurrentService == EBrowse && mServiceBrowse)
+
+ if (mCurrentService == EBrowse)
{
- sortRole = mServiceBrowse->sortRole();
+ if ( mServiceBrowse && (XQServiceUtil::interfaceName().contains("symbian")))
+ {
+ sortRole = mServiceBrowse->sortRole();
+ }
+ else if ( mServiceBrowseDeprecatedNewService && mServiceBrowseDeprecatedOldService && !(XQServiceUtil::interfaceName().contains("symbian")))
+ {
+ if (mServiceBrowseDeprecatedNewService->isActive())
+ {
+ sortRole = mServiceBrowseDeprecatedNewService->sortRole();
+ }
+ else
+ {
+ sortRole = mServiceBrowseDeprecatedOldService->sortRole();
+ }
+ }
}
return sortRole;
@@ -222,7 +297,22 @@
QStringList list;
list.append( item );
- mServiceUriFetch->complete( list );
+
+ if(mServiceUriFetch && (XQServiceUtil::interfaceName().contains("symbian")))
+ {
+ mServiceUriFetch->complete( list );
+ }
+ else if (mServiceUriFetchDeprecatedNewService && mServiceUriFetchDeprecatedOldService)
+ {
+ if (mServiceUriFetchDeprecatedNewService->isActive())
+ {
+ mServiceUriFetchDeprecatedNewService->complete( list );
+ }
+ else
+ {
+ mServiceUriFetchDeprecatedOldService->complete( list );
+ }
+ }
mFetchSelected = true;
}
@@ -233,11 +323,22 @@
void VideoServices::browsingEnded()
{
MPX_ENTER_EXIT(_L("VideoServices::browsingEnded()"));
-
- if ( mServiceBrowse )
- {
- mServiceBrowse->complete();
- }
+
+ if ( mServiceBrowse && (XQServiceUtil::interfaceName().contains("symbian")))
+ {
+ mServiceBrowse->complete();
+ }
+ else if ( mServiceBrowseDeprecatedNewService && mServiceBrowseDeprecatedOldService && !(XQServiceUtil::interfaceName().contains("symbian")))
+ {
+ if (mServiceBrowseDeprecatedNewService->isActive())
+ {
+ mServiceBrowseDeprecatedNewService->complete();
+ }
+ else
+ {
+ mServiceBrowseDeprecatedOldService->complete();
+ }
+ }
}
// End of file
--- a/videoplayerapp/videoplayerengine/src/videoserviceurifetch.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayerapp/videoplayerengine/src/videoserviceurifetch.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: %
+// Version : %version: 5 %
#include <hbapplication.h>
@@ -23,14 +23,15 @@
#include "videoserviceurifetch.h"
#include "mpxhbvideocommondefs.h"
#include "mpxvideo_debug.h"
+#include <xqaiwdecl.h>
// ----------------------------------------------------------------------------
// VideoServiceUriFetch()
// ----------------------------------------------------------------------------
//
-VideoServiceUriFetch::VideoServiceUriFetch(VideoServices* parent)
- : XQServiceProvider( QLatin1String("com.nokia.Videos.IVideoFetch"), parent )
+VideoServiceUriFetch::VideoServiceUriFetch(VideoServices* parent, QLatin1String service)
+ : XQServiceProvider( service, parent )
, mRequestIndex( 0 )
, mServiceApp( parent )
{
@@ -125,14 +126,52 @@
// fetch()
// ----------------------------------------------------------------------------
//
+void VideoServiceUriFetch::fetch()
+{
+ MPX_ENTER_EXIT(_L("VideoServiceUriFetch::fetch()"));
+
+ emit mServiceApp->activated(MpxHbVideoCommon::ActivateCollectionView);
+
+ XQRequestInfo info = requestInfo();
+
+ QVariant variant = info.info("WindowTitle");
+
+ if(variant.isValid())
+ {
+ mTitle = variant.toString();
+ }
+
+ if (mTitle.isEmpty())
+ {
+ mTitle = hbTrId("txt_videos_title_videos");
+ }
+
+ emit mServiceApp->titleReady(mTitle);
+ mServiceApp->setCurrentService(VideoServices::EUriFetcher);
+
+ mRequestIndex = setCurrentRequestAsync();
+ MPX_DEBUG(_L("VideoServiceUriFetch::fetch() : mRequestIndex(%d)"), mRequestIndex );
+}
+
+// ----------------------------------------------------------------------------
+// fetch()
+// ----------------------------------------------------------------------------
+//
void VideoServiceUriFetch::fetch(const QString& title)
{
- MPX_ENTER_EXIT(_L("VideoServiceUriFetch::fetch()"),
+ MPX_ENTER_EXIT(_L("VideoServiceUriFetch::fetch()"),
_L("title = %s"), title.data() );
+ emit mServiceApp->activated(MpxHbVideoCommon::ActivateCollectionView);
+
mTitle = title;
- emit mServiceApp->activated(MpxHbVideoCommon::ActivateCollectionView);
- emit mServiceApp->titleReady(title);
+
+ if (mTitle.isEmpty())
+ {
+ mTitle = hbTrId("txt_videos_title_videos");
+ }
+
+ emit mServiceApp->titleReady(mTitle);
mServiceApp->setCurrentService(VideoServices::EUriFetcher);
--- a/videoplayerapp/videoplayerengine/src/videoserviceview.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayerapp/videoplayerengine/src/videoserviceview.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 3 %
+// Version : %version: 4 %
#include "videoservices.h"
#include "videoserviceview.h"
@@ -26,8 +26,10 @@
// VideoServiceView()
// -------------------------------------------------------------------------------------------------
//
-VideoServiceView::VideoServiceView( VideoServices* parent, QVideoPlayerEngine* engine )
- : XQServiceProvider( QLatin1String("com.nokia.Videos.com.nokia.symbian.IFileView"), parent )
+VideoServiceView::VideoServiceView( VideoServices* parent,
+ QVideoPlayerEngine* engine,
+ QLatin1String service )
+ : XQServiceProvider( service, parent )
, mEngine( engine )
, mServiceApp( parent )
{
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/inc/testvideoplayerengine.h Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/inc/testvideoplayerengine.h Thu Jul 22 16:34:17 2010 +0100
@@ -23,7 +23,7 @@
// - how to setup construction to fail for testing purposes
-// Version : %version: %
+// Version : %version: 8 %
#ifndef __TESTVIDEOPLAYERENGINE_H__
#define __TESTVIDEOPLAYERENGINE_H__
@@ -31,6 +31,7 @@
// INCLUDES
#include <QtTest/QtTest>
+#include <qpointer.h>
class MpxViewPlugin;
class QMpxVideoPlaybackWrapper;
@@ -80,6 +81,9 @@
void testPlayMedia();
void testSetEmbedded();
+
+ void testInitWithActivityData();
+ void testHandleQuitWihtActivityData();
// called after last test case executed
void cleanupTestCase();
@@ -91,7 +95,7 @@
private:
- QVideoPlayerEngine* mTestObject;
+ QPointer<QVideoPlayerEngine> mTestObject;
MpxViewPlugin* mCurrentViewPlugin;
MpxViewPlugin* mPlaybackViewPlugin;
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/src/testvideoplayerengine.cpp Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/src/testvideoplayerengine.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: %
+// Version : %version: 14 %
// INCLUDES
#include <QtTest/QtTest>
@@ -36,6 +36,7 @@
#include "stub/inc/mpxviewpluginqt.h"
#include "stub/inc/videoservices.h"
#include "stub/inc/xqpluginloader.h"
+#include "stub/inc/videoactivitystate.h"
#include "../stub/inc/mpxvideoplaybackwrapper.h"
#include "mpxvideo_debug.h"
@@ -79,8 +80,10 @@
XQPluginLoader::cleanup();
- delete mTestObject;
- mTestObject = 0;
+ if(!mTestObject.isNull())
+ {
+ delete mTestObject;
+ }
}
@@ -97,6 +100,13 @@
mVideoServices = 0;
mTestObject = new QVideoPlayerEngine(isService);
+
+ if ( isService )
+ {
+ mTestObject->mIsPlayService = true;
+ }
+
+
}
void TestVideoPlayerEngine::cleanup()
@@ -109,8 +119,10 @@
mFileDetailsViewPlugin = 0;
mVideoServices = 0;
- delete mTestObject;
- mTestObject = 0;
+ if(!mTestObject.isNull())
+ {
+ delete mTestObject;
+ }
}
@@ -121,7 +133,7 @@
//Test object creation and deletion
init();
- QVERIFY(mTestObject);
+ QVERIFY(!mTestObject.isNull());
QVERIFY(mTestObject->mCurrentViewPlugin == 0);
QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
@@ -145,7 +157,7 @@
//Test object creation and deletion
init(true);
- QVERIFY(mTestObject);
+ QVERIFY(!mTestObject.isNull());
QVERIFY(mTestObject->mCurrentViewPlugin == 0);
QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
@@ -167,7 +179,7 @@
init();
- QVERIFY(mTestObject);
+ QVERIFY(!mTestObject.isNull());
QVERIFY(mTestObject->mCurrentViewPlugin == 0);
QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
QVERIFY(mTestObject->mCollectionViewPlugin == 0);
@@ -202,7 +214,7 @@
init(true);
- QVERIFY(mTestObject);
+ QVERIFY(!mTestObject.isNull());
QVERIFY(mTestObject->mCurrentViewPlugin == 0);
QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
QVERIFY(mTestObject->mCollectionViewPlugin == 0);
@@ -216,15 +228,14 @@
QVERIFY(mTestObject->mCurrentViewPlugin == 0);
QVERIFY(mTestObject->mPlaybackViewPlugin != 0);
- QVERIFY(mTestObject->mCollectionViewPlugin != 0);
- QVERIFY(mTestObject->mFileDetailsViewPlugin != 0);
+ QVERIFY(mTestObject->mCollectionViewPlugin == 0);
+ QVERIFY(mTestObject->mFileDetailsViewPlugin == 0);
QVERIFY(mTestObject->mPlaybackWrapper != 0);
QVERIFY(mTestObject->mVideoServices != 0);
QVERIFY(mTestObject->mIsService == true);
QVERIFY(VideoServices::mReferenceCount == 1);
QVERIFY(mTestObject->mCollectionViewPlugin != mTestObject->mPlaybackViewPlugin);
- QVERIFY(mTestObject->mCollectionViewPlugin != mTestObject->mFileDetailsViewPlugin);
cleanup();
@@ -237,7 +248,7 @@
init();
- QVERIFY(mTestObject);
+ QVERIFY(!mTestObject.isNull());
QVERIFY(mTestObject->mCurrentViewPlugin == 0);
QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
QVERIFY(mTestObject->mCollectionViewPlugin == 0);
@@ -280,7 +291,7 @@
init(true);
- QVERIFY(mTestObject);
+ QVERIFY(!mTestObject.isNull());
QVERIFY(mTestObject->mCurrentViewPlugin == 0);
QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
QVERIFY(mTestObject->mCollectionViewPlugin == 0);
@@ -293,8 +304,8 @@
QVERIFY(mTestObject->mCurrentViewPlugin == 0);
QVERIFY(mTestObject->mPlaybackViewPlugin != 0);
- QVERIFY(mTestObject->mCollectionViewPlugin != 0);
- QVERIFY(mTestObject->mFileDetailsViewPlugin != 0);
+ QVERIFY(mTestObject->mCollectionViewPlugin == 0);
+ QVERIFY(mTestObject->mFileDetailsViewPlugin == 0);
QVERIFY(mTestObject->mVideoServices != 0);
QVERIFY(mTestObject->mIsService == true);
QVERIFY(VideoServices::mReferenceCount == 1);
@@ -326,7 +337,7 @@
init();
- QVERIFY(mTestObject);
+ QVERIFY(!mTestObject.isNull());
QVERIFY(mTestObject->mCurrentViewPlugin == 0);
QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
@@ -357,7 +368,7 @@
init();
- QVERIFY(mTestObject);
+ QVERIFY(!mTestObject.isNull());
QVERIFY(mTestObject->mCurrentViewPlugin == 0);
QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
@@ -439,7 +450,7 @@
init();
- QVERIFY(mTestObject);
+ QVERIFY(!mTestObject.isNull());
QVERIFY(mTestObject->mCurrentViewPlugin == 0);
QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
@@ -531,7 +542,7 @@
init();
- QVERIFY(mTestObject);
+ QVERIFY(!mTestObject.isNull());
QVERIFY(mTestObject->mCurrentViewPlugin == 0);
QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
@@ -622,7 +633,7 @@
init();
- QVERIFY(mTestObject);
+ QVERIFY(!mTestObject.isNull());
QVERIFY(mTestObject->mCurrentViewPlugin == 0);
QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
@@ -720,7 +731,7 @@
init();
- QVERIFY(mTestObject);
+ QVERIFY(!mTestObject.isNull());
QVERIFY(mTestObject->mCurrentViewPlugin == 0);
QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
@@ -813,12 +824,16 @@
// 1. test with a string
init();
+ QVERIFY(!mTestObject.isNull());
+
mTestObject->playMedia( QString("c:\\data\\videos\\test.3gp"));
QVERIFY(mTestObject);
cleanup();
// 2. test with a file handle
init();
+ QVERIFY(!mTestObject.isNull());
+
XQSharableFile sf;
if ( sf.open("C:\\data\\videos\\test.3gp") )
{
@@ -837,6 +852,8 @@
// 3. test with a filename
init();
+ QVERIFY(!mTestObject.isNull());
+
QFile qfile("C:\\data\\videos\\test.3gp");
mTestObject->playMedia( qfile.fileName() );
QVERIFY(mTestObject);
@@ -849,12 +866,131 @@
MPX_DEBUG(_L("TestVideoServices::testSetEmbedded()"));
init();
- QVERIFY(mTestObject);
+ QVERIFY(!mTestObject.isNull());
mTestObject->setEmbedded();
QVERIFY( mTestObject->mEmbedded == true );
cleanup();
}
+void TestVideoPlayerEngine::testInitWithActivityData()
+{
+ MPX_DEBUG(_L("TestVideoServices::testInitialize()"));
+
+ init();
+ 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());
+
+ cleanup();
+ init();
+ QVERIFY(!mTestObject.isNull());
+
+ QVariant data = int(MpxHbVideoCommon::PlaybackView);
+ // playback plugin
+ VideoActivityState::instance().setActivityData(data, VideoActivityData::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());
+
+ cleanup();
+ init();
+ 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);
+ 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());
+
+ cleanup();
+
+}
+
+void 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()));
+
+ mTestObject->initialize();
+ VideoActivityState::mAllDataGetCount = 0;
+
+ 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);
+
+ cleanup();
+ init();
+ QVERIFY(!mTestObject.isNull());
+ connect(this, SIGNAL(aboutToQuit()), mTestObject, SLOT(handleQuit()));
+
+ data = int(MpxHbVideoCommon::PlaybackView);
+ VideoActivityState::instance().setActivityData(data, VideoActivityData::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);
+
+ cleanup();
+ init();
+ QVERIFY(!mTestObject.isNull());
+ connect(this, SIGNAL(aboutToQuit()), mTestObject, SLOT(handleQuit()));
+
+ data = int(MpxHbVideoCommon::VideoDetailsView);
+ VideoActivityState::instance().setActivityData(data, VideoActivityData::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);
+
+ cleanup();
+}
+
+
void TestVideoPlayerEngine::cleanupTestCase()
{
MPX_DEBUG(_L("TestVideoServices::cleanupTestCase()"));
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/inc/videoactivitystate.h Thu Jul 22 16:34:17 2010 +0100
@@ -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: VideoActivityState stub class definition
+*
+*/
+
+// Version : %version: 1 %
+
+#ifndef __VIDEOACTIVITYSTATE_H__
+#define __VIDEOACTIVITYSTATE_H__
+
+#include <qhash.h>
+#include <qvariant.h>
+#include "videoplayerappexport.h"
+
+// videoplayer activity id
+static const QString ACTIVITY_VIDEOPLAYER_MAINVIEW = "VideosMainView";
+
+
+namespace VideoActivityData
+{
+ // consts to be used as key values
+ // plugin type (int): collectionplugin or videoplaybackplugin
+ static const QString KEY_VIEWPLUGIN_TYPE = "_VideoActivity_viewplugin_type_";
+
+}
+
+/**
+ * Class is used as a stub for testing activity saving from videoplayerengine
+ *
+ */
+class VIDEOPLAYERAPP_DLL_EXPORT VideoActivityState
+{
+
+public:
+
+ /**
+ * method returns a static instance of this class
+ */
+ static VideoActivityState &instance();
+
+ /**
+ * Method clears all activity data.
+ */
+ void clearActivityData();
+
+ /**
+ * 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(""));
+
+ static int mAllDataGetCount;
+
+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/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/inc/xqserviceutil.h Thu Jul 22 16:34:17 2010 +0100
@@ -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>
+#include <QString>
+
+namespace XQServiceUtil
+{
+ static void toBackground( bool value );
+ static QString interfaceName();
+}
+
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/videoactivitystate.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,106 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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"
+
+int VideoActivityState::mAllDataGetCount = 0;
+
+// -------------------------------------------------------------------------------------------------
+// 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();
+
+}
+
+// -------------------------------------------------------------------------------------------------
+// clearActivityData()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoActivityState::clearActivityData()
+{
+ MPX_ENTER_EXIT(_L("VideoActivityState::clearActivityData()"));
+ 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
+ {
+ mAllDataGetCount++;
+ return QVariant::fromValue(mActivityData);
+ }
+}
+
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/xqserviceutil.cpp Thu Jul 22 16:34:17 2010 +0100
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 impl
+*
+*/
+
+#include "xqserviceutil.h"
+#include "mpxvideo_debug.h"
+
+
+// ----------------------------------------------------------------------------
+// XQServiceUtil::toBackground()
+// ----------------------------------------------------------------------------
+//
+void XQServiceUtil::toBackground( bool value )
+{
+ MPX_DEBUG(_L("XQServiceUtil::toBackground( %d )"), value );
+}
+
+// ----------------------------------------------------------------------------
+// XQServiceUtil::isEmbedded()
+// ----------------------------------------------------------------------------
+//
+QString XQServiceUtil::interfaceName()
+{
+ MPX_DEBUG(_L("XQServiceUtil::interfaceName()"));
+
+ return "IVideoView";
+}
+
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/testvideoplayerengine.pro Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/testvideoplayerengine.pro Thu Jul 22 16:34:17 2010 +0100
@@ -14,7 +14,7 @@
# Description: Project file for building Videoplayer components
#
#
-# Version : %version: da1mmcf#11 %
+# Version : %version: da1mmcf#13 %
TEMPLATE = app
@@ -24,7 +24,6 @@
DEPENDPATH += inc src stub/src stub/inc
INCLUDEPATH +=stub/inc \
- $$MW_LAYER_SYSTEMINCLUDE \
../../../../inc
CONFIG += qtestlib hb qt
@@ -34,6 +33,7 @@
# Input
HEADERS += mpxvideoplaybackwrapper.h \
+ xqserviceutil.h \
mpxviewpluginqt.h \
testviewplugin.h \
xqpluginloader.h \
@@ -45,9 +45,11 @@
videoserviceplay.h \
videoserviceview.h \
hbview.h \
+ videoactivitystate.h \
../../../../inc/videoplayerengine.h
SOURCES += mpxvideoplaybackwrapper.cpp \
+ xqserviceutil.cpp \
testviewplugin.cpp \
xqpluginloader.cpp \
hbinstance.cpp \
@@ -56,4 +58,5 @@
videoserviceurifetch.cpp \
videoserviceplay.cpp \
videoserviceview.cpp \
+ videoactivitystate.cpp \
../../src/videoplayerengine.cpp
--- a/videoplayerapp/videoplayerengine/videoplayerengine.pro Tue Jun 15 13:09:36 2010 +0100
+++ b/videoplayerapp/videoplayerengine/videoplayerengine.pro Thu Jul 22 16:34:17 2010 +0100
@@ -14,7 +14,7 @@
# Description: Project file for building Videoplayer components
#
#
-# Version : %version: da1mmcf#24 %
+# Version : %version: 27 %
TEMPLATE = lib
@@ -31,6 +31,13 @@
INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE \
$$APP_LAYER_SYSTEMINCLUDE SYSTEMINCLUDE
BLD_INF_RULES.prj_exports += "rom/videoplayerengine.iby CORE_APP_LAYER_IBY_EXPORT_PATH(videoplayerengine.iby)"
+ defBlock = \
+ "$${LITERAL_HASH}if defined(EABI)" \
+ "DEFFILE ../eabi/videoplayerengine.def" \
+ "$${LITERAL_HASH}else" \
+ "DEFFILE ../bwins/videoplayerengine.def" \
+ "$${LITERAL_HASH}endif"
+ MMP_RULES += defBlock
}
INCLUDEPATH += ../../inc \
@@ -48,7 +55,7 @@
-lxqservice.dll \
-lxqserviceutil.dll \
-lflogger.dll \
- -lefsrv.dll
+ -lefsrv
DEPENDPATH += ../../inc ../inc inc
VPATH += src
@@ -60,7 +67,8 @@
videoserviceplay.h \
videoserviceurifetch.h \
videoserviceview.h \
- videoservicebrowse.h
+ videoservicebrowse.h \
+ videoactivitystate.h
SOURCES += videoplayerengine.cpp \
mpxvideoplaybackwrapper.cpp \
@@ -69,5 +77,6 @@
videoserviceplay.cpp \
videoserviceurifetch.cpp \
videoserviceview.cpp \
- videoservicebrowse.cpp
+ videoservicebrowse.cpp \
+ videoactivitystate.cpp