--- a/app/app.pro Fri May 14 18:54:37 2010 -0500
+++ b/app/app.pro Fri May 28 19:46:01 2010 -0500
@@ -19,9 +19,9 @@
ICON = resources/qtg_large_music_player.svg
DEPENDPATH += .
INCLUDEPATH += . \
- inc \
- ../inc \
- ../musicservices/inc
+ inc \
+ ../inc \
+ ../musicservices/inc
INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
CONFIG += hb
@@ -32,7 +32,10 @@
TARGET.EPOCSTACKSIZE = 0x14000
TARGET.EPOCHEAPSIZE = 0x020000 0x1F00000
TARGET.CAPABILITY = CAP_APPLICATION NetworkControl DRM
- }
+
+ BLD_INF_RULES.prj_exports += \
+ "../sis/musicplayer_stub.sis /epoc32/data/z/system/install/musicplayer_stub.sis"
+}
# Service provider specific configuration.
# If in-process plugin specific implementation
@@ -52,12 +55,13 @@
-lxqservice \
-lxqserviceutil \
-lmusicservices \
+ -lmpsettingsmanager \
-lmpengine
-
-
+
+
SOURCES += src/main.cpp \
src/mpmainwindow.cpp
-
+
HEADERS = inc/mpmainwindow.h
MMP_RULES+=EXPORTUNFROZEN
@@ -67,7 +71,7 @@
resources/*.xml
DEPLOYMENT += addImages
}
-
+
RESOURCES += resources/musiplayerapp.qrc
TRANSLATIONS = musicplayer.ts
--- a/app/inc/mpmainwindow.h Fri May 14 18:54:37 2010 -0500
+++ b/app/inc/mpmainwindow.h Fri May 28 19:46:01 2010 -0500
@@ -42,11 +42,17 @@
SettingsView,
DetailsView,
MediaWallView};
+
+ enum ActivityMode{
+ MusicMainView,
+ MusicNowPlayingView,
+ MusicNowPlayingViewShuffleAll
+ };
MpMainWindow();
~MpMainWindow();
- void initialize();
+ void initialize( ActivityMode mode );
public slots:
void handleCommand( int commandCode );
@@ -54,6 +60,7 @@
void switchView( Qt::Orientation orientation );
void initializeServiceView( TUid hostUid );
+ void handleActivity();
private:
void activateView(ViewType);
--- a/app/rom/musicplayer.iby Fri May 14 18:54:37 2010 -0500
+++ b/app/rom/musicplayer.iby Fri May 28 19:46:01 2010 -0500
@@ -24,4 +24,6 @@
data = ZRESOURCE\apps\musicplayer.mif APP_RESOURCE_DIR\musicplayer.mif
data = ZPRIVATE\10003A3F\import\APPS\musicplayer_reg.rsc PRIVATE\10003a3f\import\apps\musicplayer_reg.rsc
+data = ZSYSTEM\install\musicplayer_stub.sis system\install\musicplayer_stub.sis
+
#endif // MUSICPLAYER_IBY
\ No newline at end of file
--- a/app/rom/musicplayer_resources.iby Fri May 14 18:54:37 2010 -0500
+++ b/app/rom/musicplayer_resources.iby Fri May 28 19:46:01 2010 -0500
@@ -20,7 +20,7 @@
#include <data_caging_paths_for_iby.hrh>
-data = DATAZ_\APP_RESOURCE_DIR\musicplayer.rsc APP_RESOURCE_DIR\musicplayer.rsc
+S60_APP_RESOURCE(musicplayer)
data = DATAZ_\QT_TRANSLATIONS_DIR\musicplayer.qm QT_TRANSLATIONS_DIR\musicplayer.qm
#endif // MUSICPLAYER_RESOURCES_IBY
\ No newline at end of file
--- a/app/src/main.cpp Fri May 14 18:54:37 2010 -0500
+++ b/app/src/main.cpp Fri May 28 19:46:01 2010 -0500
@@ -25,6 +25,25 @@
\brief The Music Player main function.
This function is where Music Player starts execution.
+
+ This function can be called by starting an activity. Currently supported:
+ -MusicMainView
+ -MusicNowPlayingView
+
+ A way to start start an activity is by using the XQApplicationManager:
+
+ QUrl url;
+ url.setUrl("appto://10207C62?activityname=MusicMainView&launchtype=standalone");
+ mReq = mAppMgr.create(url);
+ if (mReq == NULL) {
+ // No handlers for the URI
+ return;
+ }
+ bool res = mReq->send(); //Fire and Forget
+ if (!res) {
+ // Request failed. Handle error
+ int error = mReq->lastError();
+ }
*/
int main(int argc, char *argv[])
@@ -33,6 +52,20 @@
// Initialization
HbApplication app(argc, argv);
+ QVariantHash params = app.activateParams();
+ MpMainWindow::ActivityMode mode;
+
+ if ( !params.value( "activityname" ).toString().compare( "MusicNowPlayingView" ) ) {
+ if( params.contains( "shuffle" ) ) {
+ mode = !params.value( "shuffle" ).toString().compare( "yes" ) ? MpMainWindow::MusicNowPlayingViewShuffleAll : MpMainWindow::MusicNowPlayingView;
+ }
+ else {
+ mode = MpMainWindow::MusicNowPlayingView;
+ }
+ }
+ else {
+ mode = MpMainWindow::MusicMainView;
+ }
// Main window widget.
// Includes decorators such as signal strength and battery life indicator.
@@ -42,7 +75,7 @@
mainWindow.viewport()->grabGesture(Qt::TapGesture);
mainWindow.viewport()->grabGesture(Qt::TapAndHoldGesture);
mainWindow.setOptimizationFlag(QGraphicsView::DontSavePainterState);
- mainWindow.initialize();
+ mainWindow.initialize( mode );
mainWindow.show();
// Enter event loop
--- a/app/src/mpmainwindow.cpp Fri May 14 18:54:37 2010 -0500
+++ b/app/src/mpmainwindow.cpp Fri May 28 19:46:01 2010 -0500
@@ -17,6 +17,7 @@
#include <hbapplication.h>
+#include <hbactivitymanager.h>
#include <hbview.h>
#include <mpxviewpluginqt.h>
#include <xqpluginloader.h>
@@ -30,6 +31,7 @@
#include "mpviewbase.h"
#include "musicservices.h"
#include "mpenginefactory.h"
+#include "mpsettingsmanager.h"
#include "mptrace.h"
/*!
@@ -98,7 +100,7 @@
/*!
Initialize and activate the collection view
*/
-void MpMainWindow::initialize()
+void MpMainWindow::initialize( ActivityMode mode )
{
TX_ENTRY
@@ -135,19 +137,39 @@
if ( !mMusicServices ) {
MpEngineFactory::createSharedEngine();
if ( orientation() == Qt::Vertical ) {
- loadView(CollectionView);
- activateView(CollectionView);
- loadView(MediaWallView);
+ // If first startup ignore shuffleAll and send to collection view to refresh library
+ if ( mode == MusicMainView || MpSettingsManager::firstStartup() ) {
+ loadView(CollectionView);
+ activateView(CollectionView);
+ loadView(MediaWallView);
+ loadView( PlaybackView );
+ } else if (mode == MusicNowPlayingViewShuffleAll ) {
+ MpEngineFactory::sharedEngine()->shuffleAll();
+ loadView( PlaybackView );
+ activateView(PlaybackView);
+ loadView(CollectionView);
+ loadView(MediaWallView);
+ }
}
else {
+ // If first startup ignore shuffleAll and send to refresh library
+ if( mode == MusicNowPlayingViewShuffleAll && !MpSettingsManager::firstStartup() ) {
+ MpEngineFactory::sharedEngine()->shuffleAll();
+ mVerticalViewType = PlaybackView;
+ }
loadView(MediaWallView);
activateView(MediaWallView);
loadView(CollectionView);
+ loadView( PlaybackView );
}
connect(this, SIGNAL( orientationChanged( Qt::Orientation ) ), SLOT( switchView( Qt::Orientation ) ) );
connect( MpEngineFactory::sharedEngine(), SIGNAL( libraryUpdated() ), SLOT( handleLibraryUpdated() ) );
MpEngineFactory::sharedEngine()->checkForSystemEvents();
- loadView( PlaybackView );
+ //Register to application manager to wait for activities
+ HbApplication* app = qobject_cast<HbApplication*>(qApp);
+ app->activityManager()->waitActivity();
+ connect( app, SIGNAL( activate() ), this , SLOT( handleActivity() ) );
+
}
else {
setOrientation(Qt::Vertical, true);//This sould prevent media wall activation.
@@ -296,8 +318,8 @@
void MpMainWindow::keyPressEvent(QKeyEvent *event)
{
switch(event->key()) {
- case 16842754:
- case Qt::Key_Hangup:
+ case 16842753:
+ case Qt::Key_Call:
if (orientation () == Qt::Vertical) {
setOrientation(Qt::Horizontal, false);
}
@@ -305,10 +327,6 @@
setOrientation(Qt::Vertical, false);
}
break;
- case 16842753:
- case Qt::Key_Call:
- unsetOrientation(false);
- break;
default:
HbMainWindow::keyPressEvent (event);
break;
@@ -401,3 +419,24 @@
return plugin ? *plugin : 0;
}
+/*!
+ Slot to handle activity switching once the stand alone instance is running and registered
+ in the activity manager to wait for activities.
+ Only running activity supported at the moment is "MusicNowPlayingView"
+ */
+void MpMainWindow::handleActivity()
+{
+ HbApplication* app = qobject_cast<HbApplication*>(qApp);
+ QString activityId = app->activateId();
+
+ if( !activityId.compare( "MusicNowPlayingView&launchtype=standalone" ) ) {
+ if ( orientation() == Qt::Vertical ) {
+ if( mVerticalViewType != PlaybackView ) {
+ activateView( PlaybackView );
+ }
+ }
+ }
+ HbActivityManager* activityManager = qobject_cast<HbApplication*>(qApp)->activityManager();
+ activityManager->waitActivity();
+}
+
--- a/inc/mpcollectiontbonelistdatamodel.h Fri May 14 18:54:37 2010 -0500
+++ b/inc/mpcollectiontbonelistdatamodel.h Fri May 28 19:46:01 2010 -0500
@@ -23,6 +23,7 @@
#include <QAbstractListModel>
class MpMpxCollectionData;
+class MpPlaybackData;
#if defined(BUILD_MPDATA_LIB)
#define MPDATA_EXPORT Q_DECL_EXPORT
@@ -36,7 +37,8 @@
public:
- explicit MpCollectionTBoneListDataModel( MpMpxCollectionData *data, QObject *parent=0 );
+ explicit MpCollectionTBoneListDataModel( MpMpxCollectionData *collectionData,
+ MpPlaybackData *playbackData = 0, QObject *parent = 0 );
virtual ~MpCollectionTBoneListDataModel();
int rowCount(const QModelIndex &parent=QModelIndex()) const;
@@ -45,15 +47,21 @@
signals:
void albumDataChanged();
+ void albumDataAvailable();
public slots:
void refreshModel();
+ void updateSong();
+ void updatePlaybackState();
private:
- MpMpxCollectionData *mCollectionData; // Not own
+ MpMpxCollectionData *mCollectionData; // Not own
+ MpPlaybackData *mPlaybackData; // Not own
int mRowCount;
+ int mCurrentSongId;
+ bool mPlaybackActive;
};
--- a/inc/mpengine.h Fri May 14 18:54:37 2010 -0500
+++ b/inc/mpengine.h Fri May 28 19:46:01 2010 -0500
@@ -107,6 +107,9 @@
MpPlaybackData *playbackData();
+ void shuffleAll();
+
+
// Details related
MpSongData *songData();
void retrieveSong();
--- a/inc/mpmpxcollectiondata.h Fri May 14 18:54:37 2010 -0500
+++ b/inc/mpmpxcollectiondata.h Fri May 28 19:46:01 2010 -0500
@@ -65,6 +65,7 @@
int itemCount( int index );
int containerId();
int itemId(int index);
+ int albumSongId( int index );
void removeItem(int index);
bool testCachedItem( int itemId );
void insertCachedItem(int index);
@@ -79,6 +80,7 @@
void setContext( TCollectionContext context );
void setAlbumContent( const CMPXMedia& albumContent );
int itemIndex( int itemUniqueId );
+ int albumSongIndex( int songUniqueId );
signals:
--- a/inc/mpnowplayingwidget.h Fri May 14 18:54:37 2010 -0500
+++ b/inc/mpnowplayingwidget.h Fri May 28 19:46:01 2010 -0500
@@ -40,10 +40,11 @@
friend class MpNowPlayingWidgetPrivate;
public:
- explicit MpNowPlayingWidget(long int playerId, QGraphicsItem *parent=0 );
+ explicit MpNowPlayingWidget( QGraphicsItem *parent=0 );
virtual ~MpNowPlayingWidget();
void setEnabled( bool enabled );
void resizeEvent(QGraphicsSceneResizeEvent *event);
+ bool isBannerAttached();
signals:
void clicked();
--- a/inc/mpplaybackdata.h Fri May 14 18:54:37 2010 -0500
+++ b/inc/mpplaybackdata.h Fri May 28 19:46:01 2010 -0500
@@ -75,6 +75,7 @@
MpPlaybackData::SimplifiedState playbackState() const;
void commitPlaybackInfo();
+ void resetData();
public slots:
--- a/inc/mpsongdata.h Fri May 14 18:54:37 2010 -0500
+++ b/inc/mpsongdata.h Fri May 28 19:46:01 2010 -0500
@@ -66,6 +66,7 @@
void commitPlaybackInfo();
// inform details view when details information is ready
void commitSongDetailInfo();
+ void removeAlbumArtFile() const; //TODO: Remove when base64 starts to work
public slots:
void thumbnailReady( const QPixmap& pixmap, void *data, int id, int error );
@@ -125,6 +126,7 @@
QString mModified;
QString mCopyright;
QString mMusicURL;
+ QString mTempAlbumArt; //TODO: Remove when base64 starts to work
bool mDrmProtected;
Q_DISABLE_COPY(MpSongData)
--- a/mpdata/bwins/mpdatau.def Fri May 14 18:54:37 2010 -0500
+++ b/mpdata/bwins/mpdatau.def Fri May 28 19:46:01 2010 -0500
@@ -11,172 +11,179 @@
??_EMpMpxCollectionData@@UAE@I@Z @ 10 NONAME ; MpMpxCollectionData::~MpMpxCollectionData(unsigned int)
?qt_metacast@MpCollectionDataModel@@UAEPAXPBD@Z @ 11 NONAME ; void * MpCollectionDataModel::qt_metacast(char const *)
?updateAlbumArt@MpCollectionDataModel@@QAEXH@Z @ 12 NONAME ; void MpCollectionDataModel::updateAlbumArt(int)
- ??_EMpPlaybackData@@UAE@I@Z @ 13 NONAME ; MpPlaybackData::~MpPlaybackData(unsigned int)
- ?setLink@MpSongData@@QAEXABVQString@@@Z @ 14 NONAME ; void MpSongData::setLink(class QString const &)
- ?metaObject@MpPlaybackData@@UBEPBUQMetaObject@@XZ @ 15 NONAME ; struct QMetaObject const * MpPlaybackData::metaObject(void) const
- ?setCopyright@MpSongData@@QAE_NABVQString@@@Z @ 16 NONAME ; bool MpSongData::setCopyright(class QString const &)
- ?refreshModel@MpCollectionTBoneListDataModel@@QAEXXZ @ 17 NONAME ; void MpCollectionTBoneListDataModel::refreshModel(void)
- ?title@MpSongData@@QBE?AVQString@@XZ @ 18 NONAME ; class QString MpSongData::title(void) const
- ?data@MpCollectionDataModel@@UBE?AVQVariant@@ABVQModelIndex@@H@Z @ 19 NONAME ; class QVariant MpCollectionDataModel::data(class QModelIndex const &, int) const
- ?setAlbumId@MpPlaybackData@@QAE_NH@Z @ 20 NONAME ; bool MpPlaybackData::setAlbumId(int)
- ?setDrmProtected@MpSongData@@QAE_N_N@Z @ 21 NONAME ; bool MpSongData::setDrmProtected(bool)
- ?mimeType@MpSongData@@QBE?AVQString@@XZ @ 22 NONAME ; class QString MpSongData::mimeType(void) const
- ?removeItem@MpMpxCollectionData@@QAEXH@Z @ 23 NONAME ; void MpMpxCollectionData::removeItem(int)
- ?getStaticMetaObject@MpMpxCollectionData@@SAABUQMetaObject@@XZ @ 24 NONAME ; struct QMetaObject const & MpMpxCollectionData::getStaticMetaObject(void)
- ?itemCount@MpMpxCollectionData@@QAEHH@Z @ 25 NONAME ; int MpMpxCollectionData::itemCount(int)
- ?isAutoPlaylist@MpMpxCollectionData@@QAE_NH@Z @ 26 NONAME ; bool MpMpxCollectionData::isAutoPlaylist(int)
- ?position@MpPlaybackData@@QBEHXZ @ 27 NONAME ; int MpPlaybackData::position(void) const
- ?setAlbumArtUri@MpPlaybackData@@QAEXABVQString@@@Z @ 28 NONAME ; void MpPlaybackData::setAlbumArtUri(class QString const &)
- ??_EMpCollectionDataModel@@UAE@I@Z @ 29 NONAME ; MpCollectionDataModel::~MpCollectionDataModel(unsigned int)
- ?qt_metacast@MpSongData@@UAEPAXPBD@Z @ 30 NONAME ; void * MpSongData::qt_metacast(char const *)
- ?setBitRate@MpSongData@@QAE_NH@Z @ 31 NONAME ; bool MpSongData::setBitRate(int)
- ?positionChanged@MpPlaybackData@@IAEXXZ @ 32 NONAME ; void MpPlaybackData::positionChanged(void)
- ?tr@MpCollectionTBoneListDataModel@@SA?AVQString@@PBD0H@Z @ 33 NONAME ; class QString MpCollectionTBoneListDataModel::tr(char const *, char const *, int)
- ?itemIndex@MpMpxCollectionData@@QAEHH@Z @ 34 NONAME ; int MpMpxCollectionData::itemIndex(int)
- ?title@MpPlaybackData@@QBEABVQString@@XZ @ 35 NONAME ; class QString const & MpPlaybackData::title(void) const
- ?qt_metacall@MpCollectionDataModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 36 NONAME ; int MpCollectionDataModel::qt_metacall(enum QMetaObject::Call, int, void * *)
- ?artist@MpSongData@@QBE?AVQString@@XZ @ 37 NONAME ; class QString MpSongData::artist(void) const
- ?setMpxMedia@MpMpxCollectionData@@QAEXABVCMPXMedia@@_N@Z @ 38 NONAME ; void MpMpxCollectionData::setMpxMedia(class CMPXMedia const &, bool)
- ?staticMetaObject@MpSongData@@2UQMetaObject@@B @ 39 NONAME ; struct QMetaObject const MpSongData::staticMetaObject
- ?playbackState@MpPlaybackData@@QBE?AW4SimplifiedState@1@XZ @ 40 NONAME ; enum MpPlaybackData::SimplifiedState MpPlaybackData::playbackState(void) const
- ?tr@MpSongData@@SA?AVQString@@PBD0H@Z @ 41 NONAME ; class QString MpSongData::tr(char const *, char const *, int)
- ?context@MpMpxCollectionData@@QBE?AW4TCollectionContext@@XZ @ 42 NONAME ; enum TCollectionContext MpMpxCollectionData::context(void) const
- ?supportedDropActions@MpCollectionDataModel@@UBE?AV?$QFlags@W4DropAction@Qt@@@@XZ @ 43 NONAME ; class QFlags<enum Qt::DropAction> MpCollectionDataModel::supportedDropActions(void) const
- ?setContext@MpMpxCollectionData@@QAEXW4TCollectionContext@@@Z @ 44 NONAME ; void MpMpxCollectionData::setContext(enum TCollectionContext)
- ?durationChanged@MpPlaybackData@@IAEXXZ @ 45 NONAME ; void MpPlaybackData::durationChanged(void)
- ?staticMetaObject@MpPlaybackData@@2UQMetaObject@@B @ 46 NONAME ; struct QMetaObject const MpPlaybackData::staticMetaObject
- ?staticMetaObject@MpCollectionTBoneListDataModel@@2UQMetaObject@@B @ 47 NONAME ; struct QMetaObject const MpCollectionTBoneListDataModel::staticMetaObject
- ?orderChanged@MpCollectionDataModel@@IAEXHHHH@Z @ 48 NONAME ; void MpCollectionDataModel::orderChanged(int, int, int, int)
- ?metaObject@MpCollectionTBoneListDataModel@@UBEPBUQMetaObject@@XZ @ 49 NONAME ; struct QMetaObject const * MpCollectionTBoneListDataModel::metaObject(void) const
- ?tr@MpCollectionTBoneListDataModel@@SA?AVQString@@PBD0@Z @ 50 NONAME ; class QString MpCollectionTBoneListDataModel::tr(char const *, char const *)
- ?bitRate@MpSongData@@QBE?AVQString@@XZ @ 51 NONAME ; class QString MpSongData::bitRate(void) const
- ?setModified@MpSongData@@QAE_NABVQString@@@Z @ 52 NONAME ; bool MpSongData::setModified(class QString const &)
- ?setUri@MpPlaybackData@@QAE_NABVQString@@@Z @ 53 NONAME ; bool MpPlaybackData::setUri(class QString const &)
- ?qt_metacast@MpCollectionTBoneListDataModel@@UAEPAXPBD@Z @ 54 NONAME ; void * MpCollectionTBoneListDataModel::qt_metacast(char const *)
- ?duration@MpSongData@@QBE?AVQString@@XZ @ 55 NONAME ; class QString MpSongData::duration(void) const
- ?qt_metacall@MpCollectionTBoneListDataModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 56 NONAME ; int MpCollectionTBoneListDataModel::qt_metacall(enum QMetaObject::Call, int, void * *)
- ??0MpCollectionDataModel@@QAE@PAVMpMpxCollectionData@@PAVQObject@@@Z @ 57 NONAME ; MpCollectionDataModel::MpCollectionDataModel(class MpMpxCollectionData *, class QObject *)
- ?isAutoPlaylist@MpMpxCollectionData@@QAE_NXZ @ 58 NONAME ; bool MpMpxCollectionData::isAutoPlaylist(void)
- ?setAlbum@MpPlaybackData@@QAE_NABVQString@@@Z @ 59 NONAME ; bool MpPlaybackData::setAlbum(class QString const &)
- ?setGenre@MpSongData@@QAE_NABVQString@@@Z @ 60 NONAME ; bool MpSongData::setGenre(class QString const &)
- ?setCurrentAlbum@MpMpxCollectionData@@QAE_NH@Z @ 61 NONAME ; bool MpMpxCollectionData::setCurrentAlbum(int)
- ?itemId@MpMpxCollectionData@@QAEHH@Z @ 62 NONAME ; int MpMpxCollectionData::itemId(int)
- ?trUtf8@MpSongData@@SA?AVQString@@PBD0H@Z @ 63 NONAME ; class QString MpSongData::trUtf8(char const *, char const *, int)
- ?artist@MpPlaybackData@@QBEABVQString@@XZ @ 64 NONAME ; class QString const & MpPlaybackData::artist(void) const
- ?setFileName@MpSongData@@QAE_NABVQString@@@Z @ 65 NONAME ; bool MpSongData::setFileName(class QString const &)
- ??0MpCollectionTBoneListDataModel@@QAE@PAVMpMpxCollectionData@@PAVQObject@@@Z @ 66 NONAME ; MpCollectionTBoneListDataModel::MpCollectionTBoneListDataModel(class MpMpxCollectionData *, class QObject *)
- ?setContext@MpCollectionDataModel@@QAEXW4TCollectionContext@@@Z @ 67 NONAME ; void MpCollectionDataModel::setContext(enum TCollectionContext)
- ?commitPlaybackInfo@MpSongData@@QAEXXZ @ 68 NONAME ; void MpSongData::commitPlaybackInfo(void)
- ?sampleRate@MpSongData@@QBE?AVQString@@XZ @ 69 NONAME ; class QString MpSongData::sampleRate(void) const
- ?playbackStateChanged@MpPlaybackData@@IAEXXZ @ 70 NONAME ; void MpPlaybackData::playbackStateChanged(void)
- ?copyright@MpSongData@@QBE?AVQString@@XZ @ 71 NONAME ; class QString MpSongData::copyright(void) const
- ?duration@MpPlaybackData@@QBEHXZ @ 72 NONAME ; int MpPlaybackData::duration(void) const
- ?genre@MpSongData@@QBE?AVQString@@XZ @ 73 NONAME ; class QString MpSongData::genre(void) const
- ?setMimeType@MpSongData@@QAE_NABVQString@@@Z @ 74 NONAME ; bool MpSongData::setMimeType(class QString const &)
- ?getStaticMetaObject@MpCollectionDataModel@@SAABUQMetaObject@@XZ @ 75 NONAME ; struct QMetaObject const & MpCollectionDataModel::getStaticMetaObject(void)
- ?setSampleRate@MpSongData@@QAE_NH@Z @ 76 NONAME ; bool MpSongData::setSampleRate(int)
- ?setDuration@MpPlaybackData@@QAEXH@Z @ 77 NONAME ; void MpPlaybackData::setDuration(int)
- ?albumDataChanged@MpMpxCollectionData@@IAEXXZ @ 78 NONAME ; void MpMpxCollectionData::albumDataChanged(void)
- ?setMusicURL@MpSongData@@QAE_NABVQString@@@Z @ 79 NONAME ; bool MpSongData::setMusicURL(class QString const &)
- ??0MpSongData@@QAE@PAVQObject@@@Z @ 80 NONAME ; MpSongData::MpSongData(class QObject *)
- ?setComment@MpSongData@@QAE_NABVQString@@@Z @ 81 NONAME ; bool MpSongData::setComment(class QString const &)
- ?uri@MpPlaybackData@@QBEABVQString@@XZ @ 82 NONAME ; class QString const & MpPlaybackData::uri(void) const
- ?albumArtReady@MpSongData@@IAEXXZ @ 83 NONAME ; void MpSongData::albumArtReady(void)
- ?rowCount@MpCollectionDataModel@@UBEHABVQModelIndex@@@Z @ 84 NONAME ; int MpCollectionDataModel::rowCount(class QModelIndex const &) const
- ?trUtf8@MpPlaybackData@@SA?AVQString@@PBD0H@Z @ 85 NONAME ; class QString MpPlaybackData::trUtf8(char const *, char const *, int)
- ?thumbnailReady@MpPlaybackData@@QAEXABVQPixmap@@PAXHH@Z @ 86 NONAME ; void MpPlaybackData::thumbnailReady(class QPixmap const &, void *, int, int)
- ?staticMetaObject@MpMpxCollectionData@@2UQMetaObject@@B @ 87 NONAME ; struct QMetaObject const MpMpxCollectionData::staticMetaObject
- ?tr@MpPlaybackData@@SA?AVQString@@PBD0H@Z @ 88 NONAME ; class QString MpPlaybackData::tr(char const *, char const *, int)
- ?modified@MpSongData@@QBE?AVQString@@XZ @ 89 NONAME ; class QString MpSongData::modified(void) const
- ?setRealAudio@MpPlaybackData@@QAE_N_N@Z @ 90 NONAME ; bool MpPlaybackData::setRealAudio(bool)
- ?qt_metacall@MpMpxCollectionData@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 91 NONAME ; int MpMpxCollectionData::qt_metacall(enum QMetaObject::Call, int, void * *)
- ?albumArtReady@MpPlaybackData@@IAEXXZ @ 92 NONAME ; void MpPlaybackData::albumArtReady(void)
- ?setAlbumTrack@MpSongData@@QAE_NABVQString@@@Z @ 93 NONAME ; bool MpSongData::setAlbumTrack(class QString const &)
- ?album@MpPlaybackData@@QBEABVQString@@XZ @ 94 NONAME ; class QString const & MpPlaybackData::album(void) const
- ?albumSongsCount@MpMpxCollectionData@@QBEHXZ @ 95 NONAME ; int MpMpxCollectionData::albumSongsCount(void) const
- ?count@MpMpxCollectionData@@QBEHXZ @ 96 NONAME ; int MpMpxCollectionData::count(void) const
- ?setAlbumArtUri@MpSongData@@QAEXABVQString@@@Z @ 97 NONAME ; void MpSongData::setAlbumArtUri(class QString const &)
- ??1MpSongData@@UAE@XZ @ 98 NONAME ; MpSongData::~MpSongData(void)
- ?dataReloaded@MpCollectionDataModel@@IAEXXZ @ 99 NONAME ; void MpCollectionDataModel::dataReloaded(void)
- ?testCachedItem@MpMpxCollectionData@@QAE_NH@Z @ 100 NONAME ; bool MpMpxCollectionData::testCachedItem(int)
- ?tr@MpCollectionDataModel@@SA?AVQString@@PBD0@Z @ 101 NONAME ; class QString MpCollectionDataModel::tr(char const *, char const *)
- ?setTitle@MpPlaybackData@@QAE_NABVQString@@@Z @ 102 NONAME ; bool MpPlaybackData::setTitle(class QString const &)
- ?getStaticMetaObject@MpCollectionTBoneListDataModel@@SAABUQMetaObject@@XZ @ 103 NONAME ; struct QMetaObject const & MpCollectionTBoneListDataModel::getStaticMetaObject(void)
- ?trUtf8@MpCollectionDataModel@@SA?AVQString@@PBD0@Z @ 104 NONAME ; class QString MpCollectionDataModel::trUtf8(char const *, char const *)
- ?setTitle@MpSongData@@QAE_NABVQString@@@Z @ 105 NONAME ; bool MpSongData::setTitle(class QString const &)
- ?musicURL@MpSongData@@QBE?AVQString@@XZ @ 106 NONAME ; class QString MpSongData::musicURL(void) const
- ?realAudio@MpPlaybackData@@QAE_NXZ @ 107 NONAME ; bool MpPlaybackData::realAudio(void)
- ?staticMetaObject@MpCollectionDataModel@@2UQMetaObject@@B @ 108 NONAME ; struct QMetaObject const MpCollectionDataModel::staticMetaObject
- ?rowCount@MpCollectionTBoneListDataModel@@UBEHABVQModelIndex@@@Z @ 109 NONAME ; int MpCollectionTBoneListDataModel::rowCount(class QModelIndex const &) const
- ?dataChanged@MpMpxCollectionData@@IAEXXZ @ 110 NONAME ; void MpMpxCollectionData::dataChanged(void)
- ?trUtf8@MpCollectionTBoneListDataModel@@SA?AVQString@@PBD0H@Z @ 111 NONAME ; class QString MpCollectionTBoneListDataModel::trUtf8(char const *, char const *, int)
- ?getStaticMetaObject@MpSongData@@SAABUQMetaObject@@XZ @ 112 NONAME ; struct QMetaObject const & MpSongData::getStaticMetaObject(void)
- ?songDetailInfoChanged@MpSongData@@IAEXXZ @ 113 NONAME ; void MpSongData::songDetailInfoChanged(void)
- ?mimeTypes@MpCollectionDataModel@@UBE?AVQStringList@@XZ @ 114 NONAME ; class QStringList MpCollectionDataModel::mimeTypes(void) const
- ?albumArt@MpSongData@@QBEXAAVHbIcon@@@Z @ 115 NONAME ; void MpSongData::albumArt(class HbIcon &) const
- ?isDrmProtected@MpSongData@@QBE_NXZ @ 116 NONAME ; bool MpSongData::isDrmProtected(void) const
- ?collectionTitle@MpMpxCollectionData@@QBE?AVQString@@XZ @ 117 NONAME ; class QString MpMpxCollectionData::collectionTitle(void) const
- ?albumTrack@MpSongData@@QBE?AVQString@@XZ @ 118 NONAME ; class QString MpSongData::albumTrack(void) const
- ?setArtist@MpSongData@@QAE_NABVQString@@@Z @ 119 NONAME ; bool MpSongData::setArtist(class QString const &)
- ?tr@MpPlaybackData@@SA?AVQString@@PBD0@Z @ 120 NONAME ; class QString MpPlaybackData::tr(char const *, char const *)
- ?setYear@MpSongData@@QAE_NH@Z @ 121 NONAME ; bool MpSongData::setYear(int)
- ?qt_metacall@MpPlaybackData@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 122 NONAME ; int MpPlaybackData::qt_metacall(enum QMetaObject::Call, int, void * *)
- ?albumSongData@MpMpxCollectionData@@QBE?AVQString@@HW4DataType@1@@Z @ 123 NONAME ; class QString MpMpxCollectionData::albumSongData(int, enum MpMpxCollectionData::DataType) const
- ?playbackInfoChanged@MpSongData@@IAEXXZ @ 124 NONAME ; void MpSongData::playbackInfoChanged(void)
- ?insertCachedItem@MpMpxCollectionData@@QAEXH@Z @ 125 NONAME ; void MpMpxCollectionData::insertCachedItem(int)
- ?setComposer@MpSongData@@QAE_NABVQString@@@Z @ 126 NONAME ; bool MpSongData::setComposer(class QString const &)
- ?setAlbumContent@MpMpxCollectionData@@QAEXABVCMPXMedia@@@Z @ 127 NONAME ; void MpMpxCollectionData::setAlbumContent(class CMPXMedia const &)
- ??0MpMpxCollectionData@@QAE@PAVQObject@@@Z @ 128 NONAME ; MpMpxCollectionData::MpMpxCollectionData(class QObject *)
- ?setArtist@MpPlaybackData@@QAE_NABVQString@@@Z @ 129 NONAME ; bool MpPlaybackData::setArtist(class QString const &)
- ?trUtf8@MpSongData@@SA?AVQString@@PBD0@Z @ 130 NONAME ; class QString MpSongData::trUtf8(char const *, char const *)
- ?albumId@MpPlaybackData@@QAEHXZ @ 131 NONAME ; int MpPlaybackData::albumId(void)
- ??1MpMpxCollectionData@@UAE@XZ @ 132 NONAME ; MpMpxCollectionData::~MpMpxCollectionData(void)
- ??0MpPlaybackData@@QAE@PAVQObject@@@Z @ 133 NONAME ; MpPlaybackData::MpPlaybackData(class QObject *)
- ?trUtf8@MpCollectionDataModel@@SA?AVQString@@PBD0H@Z @ 134 NONAME ; class QString MpCollectionDataModel::trUtf8(char const *, char const *, int)
- ?metaObject@MpMpxCollectionData@@UBEPBUQMetaObject@@XZ @ 135 NONAME ; struct QMetaObject const * MpMpxCollectionData::metaObject(void) const
- ?qt_metacast@MpMpxCollectionData@@UAEPAXPBD@Z @ 136 NONAME ; void * MpMpxCollectionData::qt_metacast(char const *)
- ?qt_metacast@MpPlaybackData@@UAEPAXPBD@Z @ 137 NONAME ; void * MpPlaybackData::qt_metacast(char const *)
- ?size@MpSongData@@QBE?AVQString@@XZ @ 138 NONAME ; class QString MpSongData::size(void) const
- ??_EMpSongData@@UAE@I@Z @ 139 NONAME ; MpSongData::~MpSongData(unsigned int)
- ?containerId@MpMpxCollectionData@@QAEHXZ @ 140 NONAME ; int MpMpxCollectionData::containerId(void)
- ?containerMedia@MpMpxCollectionData@@QAEABVCMPXMedia@@XZ @ 141 NONAME ; class CMPXMedia const & MpMpxCollectionData::containerMedia(void)
- ?setDuration@MpSongData@@QAE_NH@Z @ 142 NONAME ; bool MpSongData::setDuration(int)
- ??_EMpCollectionTBoneListDataModel@@UAE@I@Z @ 143 NONAME ; MpCollectionTBoneListDataModel::~MpCollectionTBoneListDataModel(unsigned int)
- ??1MpCollectionDataModel@@UAE@XZ @ 144 NONAME ; MpCollectionDataModel::~MpCollectionDataModel(void)
- ?setSize@MpSongData@@QAE_NH@Z @ 145 NONAME ; bool MpSongData::setSize(int)
- ?thumbnailReady@MpSongData@@QAEXABVQPixmap@@PAXHH@Z @ 146 NONAME ; void MpSongData::thumbnailReady(class QPixmap const &, void *, int, int)
- ?tr@MpCollectionDataModel@@SA?AVQString@@PBD0H@Z @ 147 NONAME ; class QString MpCollectionDataModel::tr(char const *, char const *, int)
- ?reloadData@MpCollectionDataModel@@QAEXXZ @ 148 NONAME ; void MpCollectionDataModel::reloadData(void)
- ?commitSongDetailInfo@MpSongData@@QAEXXZ @ 149 NONAME ; void MpSongData::commitSongDetailInfo(void)
- ??1MpCollectionTBoneListDataModel@@UAE@XZ @ 150 NONAME ; MpCollectionTBoneListDataModel::~MpCollectionTBoneListDataModel(void)
- ?qt_metacall@MpSongData@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 151 NONAME ; int MpSongData::qt_metacall(enum QMetaObject::Call, int, void * *)
- ?reservedLength@MpSongData@@QBEHXZ @ 152 NONAME ; int MpSongData::reservedLength(void) const
- ?collectionData@MpCollectionDataModel@@QAEPAVMpMpxCollectionData@@XZ @ 153 NONAME ; class MpMpxCollectionData * MpCollectionDataModel::collectionData(void)
- ?trUtf8@MpMpxCollectionData@@SA?AVQString@@PBD0@Z @ 154 NONAME ; class QString MpMpxCollectionData::trUtf8(char const *, char const *)
- ?setPosition@MpPlaybackData@@QAEXH@Z @ 155 NONAME ; void MpPlaybackData::setPosition(int)
- ??1MpPlaybackData@@UAE@XZ @ 156 NONAME ; MpPlaybackData::~MpPlaybackData(void)
- ?tr@MpSongData@@SA?AVQString@@PBD0@Z @ 157 NONAME ; class QString MpSongData::tr(char const *, char const *)
- ?setPlaybackState@MpPlaybackData@@QAEXW4SimplifiedState@1@@Z @ 158 NONAME ; void MpPlaybackData::setPlaybackState(enum MpPlaybackData::SimplifiedState)
- ?refreshAlbumSongs@MpMpxCollectionData@@IAEXXZ @ 159 NONAME ; void MpMpxCollectionData::refreshAlbumSongs(void)
- ?trUtf8@MpPlaybackData@@SA?AVQString@@PBD0@Z @ 160 NONAME ; class QString MpPlaybackData::trUtf8(char const *, char const *)
- ?albumDataChanged@MpCollectionTBoneListDataModel@@IAEXXZ @ 161 NONAME ; void MpCollectionTBoneListDataModel::albumDataChanged(void)
- ?comment@MpSongData@@QBE?AVQString@@XZ @ 162 NONAME ; class QString MpSongData::comment(void) const
- ?year@MpSongData@@QBE?AVQString@@XZ @ 163 NONAME ; class QString MpSongData::year(void) const
- ?data@MpCollectionTBoneListDataModel@@UBE?AVQVariant@@ABVQModelIndex@@H@Z @ 164 NONAME ; class QVariant MpCollectionTBoneListDataModel::data(class QModelIndex const &, int) const
- ?setAlbum@MpSongData@@QAE_NABVQString@@@Z @ 165 NONAME ; bool MpSongData::setAlbum(class QString const &)
- ?getStaticMetaObject@MpPlaybackData@@SAABUQMetaObject@@XZ @ 166 NONAME ; struct QMetaObject const & MpPlaybackData::getStaticMetaObject(void)
- ?composer@MpSongData@@QBE?AVQString@@XZ @ 167 NONAME ; class QString MpSongData::composer(void) const
- ?albumArt@MpPlaybackData@@QBEXAAVHbIcon@@@Z @ 168 NONAME ; void MpPlaybackData::albumArt(class HbIcon &) const
- ?commitPlaybackInfo@MpPlaybackData@@QAEXXZ @ 169 NONAME ; void MpPlaybackData::commitPlaybackInfo(void)
- ?removeRows@MpCollectionDataModel@@UAE_NHHABVQModelIndex@@@Z @ 170 NONAME ; bool MpCollectionDataModel::removeRows(int, int, class QModelIndex const &)
- ?id@MpPlaybackData@@QAEHXZ @ 171 NONAME ; int MpPlaybackData::id(void)
- ?album@MpSongData@@QBE?AVQString@@XZ @ 172 NONAME ; class QString MpSongData::album(void) const
- ?albumArtBase64@MpSongData@@QBE?AVQString@@XZ @ 173 NONAME ; class QString MpSongData::albumArtBase64(void) const
- ?playbackInfoChanged@MpPlaybackData@@IAEXXZ @ 174 NONAME ; void MpPlaybackData::playbackInfoChanged(void)
- ?itemData@MpMpxCollectionData@@QBE?AVQString@@HW4DataType@1@@Z @ 175 NONAME ; class QString MpMpxCollectionData::itemData(int, enum MpMpxCollectionData::DataType) const
- ?link@MpSongData@@QBE?AVQString@@XZ @ 176 NONAME ; class QString MpSongData::link(void) const
- ?trUtf8@MpCollectionTBoneListDataModel@@SA?AVQString@@PBD0@Z @ 177 NONAME ; class QString MpCollectionTBoneListDataModel::trUtf8(char const *, char const *)
- ?setId@MpPlaybackData@@QAE_NH@Z @ 178 NONAME ; bool MpPlaybackData::setId(int)
- ?metaObject@MpCollectionDataModel@@UBEPBUQMetaObject@@XZ @ 179 NONAME ; struct QMetaObject const * MpCollectionDataModel::metaObject(void) const
- ?metaObject@MpSongData@@UBEPBUQMetaObject@@XZ @ 180 NONAME ; struct QMetaObject const * MpSongData::metaObject(void) const
+ ?resetData@MpPlaybackData@@QAEXXZ @ 13 NONAME ; void MpPlaybackData::resetData(void)
+ ??_EMpPlaybackData@@UAE@I@Z @ 14 NONAME ; MpPlaybackData::~MpPlaybackData(unsigned int)
+ ?setLink@MpSongData@@QAEXABVQString@@@Z @ 15 NONAME ; void MpSongData::setLink(class QString const &)
+ ?metaObject@MpPlaybackData@@UBEPBUQMetaObject@@XZ @ 16 NONAME ; struct QMetaObject const * MpPlaybackData::metaObject(void) const
+ ?setCopyright@MpSongData@@QAE_NABVQString@@@Z @ 17 NONAME ; bool MpSongData::setCopyright(class QString const &)
+ ?refreshModel@MpCollectionTBoneListDataModel@@QAEXXZ @ 18 NONAME ; void MpCollectionTBoneListDataModel::refreshModel(void)
+ ?title@MpSongData@@QBE?AVQString@@XZ @ 19 NONAME ; class QString MpSongData::title(void) const
+ ?data@MpCollectionDataModel@@UBE?AVQVariant@@ABVQModelIndex@@H@Z @ 20 NONAME ; class QVariant MpCollectionDataModel::data(class QModelIndex const &, int) const
+ ?setAlbumId@MpPlaybackData@@QAE_NH@Z @ 21 NONAME ; bool MpPlaybackData::setAlbumId(int)
+ ?setDrmProtected@MpSongData@@QAE_N_N@Z @ 22 NONAME ; bool MpSongData::setDrmProtected(bool)
+ ?mimeType@MpSongData@@QBE?AVQString@@XZ @ 23 NONAME ; class QString MpSongData::mimeType(void) const
+ ?removeItem@MpMpxCollectionData@@QAEXH@Z @ 24 NONAME ; void MpMpxCollectionData::removeItem(int)
+ ?getStaticMetaObject@MpMpxCollectionData@@SAABUQMetaObject@@XZ @ 25 NONAME ; struct QMetaObject const & MpMpxCollectionData::getStaticMetaObject(void)
+ ?itemCount@MpMpxCollectionData@@QAEHH@Z @ 26 NONAME ; int MpMpxCollectionData::itemCount(int)
+ ?isAutoPlaylist@MpMpxCollectionData@@QAE_NH@Z @ 27 NONAME ; bool MpMpxCollectionData::isAutoPlaylist(int)
+ ?position@MpPlaybackData@@QBEHXZ @ 28 NONAME ; int MpPlaybackData::position(void) const
+ ?setAlbumArtUri@MpPlaybackData@@QAEXABVQString@@@Z @ 29 NONAME ; void MpPlaybackData::setAlbumArtUri(class QString const &)
+ ??_EMpCollectionDataModel@@UAE@I@Z @ 30 NONAME ; MpCollectionDataModel::~MpCollectionDataModel(unsigned int)
+ ?qt_metacast@MpSongData@@UAEPAXPBD@Z @ 31 NONAME ; void * MpSongData::qt_metacast(char const *)
+ ?setBitRate@MpSongData@@QAE_NH@Z @ 32 NONAME ; bool MpSongData::setBitRate(int)
+ ?positionChanged@MpPlaybackData@@IAEXXZ @ 33 NONAME ; void MpPlaybackData::positionChanged(void)
+ ?tr@MpCollectionTBoneListDataModel@@SA?AVQString@@PBD0H@Z @ 34 NONAME ; class QString MpCollectionTBoneListDataModel::tr(char const *, char const *, int)
+ ?itemIndex@MpMpxCollectionData@@QAEHH@Z @ 35 NONAME ; int MpMpxCollectionData::itemIndex(int)
+ ?title@MpPlaybackData@@QBEABVQString@@XZ @ 36 NONAME ; class QString const & MpPlaybackData::title(void) const
+ ?qt_metacall@MpCollectionDataModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 37 NONAME ; int MpCollectionDataModel::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ?artist@MpSongData@@QBE?AVQString@@XZ @ 38 NONAME ; class QString MpSongData::artist(void) const
+ ?setMpxMedia@MpMpxCollectionData@@QAEXABVCMPXMedia@@_N@Z @ 39 NONAME ; void MpMpxCollectionData::setMpxMedia(class CMPXMedia const &, bool)
+ ?staticMetaObject@MpSongData@@2UQMetaObject@@B @ 40 NONAME ; struct QMetaObject const MpSongData::staticMetaObject
+ ?playbackState@MpPlaybackData@@QBE?AW4SimplifiedState@1@XZ @ 41 NONAME ; enum MpPlaybackData::SimplifiedState MpPlaybackData::playbackState(void) const
+ ?tr@MpSongData@@SA?AVQString@@PBD0H@Z @ 42 NONAME ; class QString MpSongData::tr(char const *, char const *, int)
+ ?context@MpMpxCollectionData@@QBE?AW4TCollectionContext@@XZ @ 43 NONAME ; enum TCollectionContext MpMpxCollectionData::context(void) const
+ ?supportedDropActions@MpCollectionDataModel@@UBE?AV?$QFlags@W4DropAction@Qt@@@@XZ @ 44 NONAME ; class QFlags<enum Qt::DropAction> MpCollectionDataModel::supportedDropActions(void) const
+ ?setContext@MpMpxCollectionData@@QAEXW4TCollectionContext@@@Z @ 45 NONAME ; void MpMpxCollectionData::setContext(enum TCollectionContext)
+ ?durationChanged@MpPlaybackData@@IAEXXZ @ 46 NONAME ; void MpPlaybackData::durationChanged(void)
+ ?staticMetaObject@MpPlaybackData@@2UQMetaObject@@B @ 47 NONAME ; struct QMetaObject const MpPlaybackData::staticMetaObject
+ ?staticMetaObject@MpCollectionTBoneListDataModel@@2UQMetaObject@@B @ 48 NONAME ; struct QMetaObject const MpCollectionTBoneListDataModel::staticMetaObject
+ ?orderChanged@MpCollectionDataModel@@IAEXHHHH@Z @ 49 NONAME ; void MpCollectionDataModel::orderChanged(int, int, int, int)
+ ?metaObject@MpCollectionTBoneListDataModel@@UBEPBUQMetaObject@@XZ @ 50 NONAME ; struct QMetaObject const * MpCollectionTBoneListDataModel::metaObject(void) const
+ ?tr@MpCollectionTBoneListDataModel@@SA?AVQString@@PBD0@Z @ 51 NONAME ; class QString MpCollectionTBoneListDataModel::tr(char const *, char const *)
+ ?bitRate@MpSongData@@QBE?AVQString@@XZ @ 52 NONAME ; class QString MpSongData::bitRate(void) const
+ ?albumDataAvailable@MpCollectionTBoneListDataModel@@IAEXXZ @ 53 NONAME ; void MpCollectionTBoneListDataModel::albumDataAvailable(void)
+ ?setModified@MpSongData@@QAE_NABVQString@@@Z @ 54 NONAME ; bool MpSongData::setModified(class QString const &)
+ ?setUri@MpPlaybackData@@QAE_NABVQString@@@Z @ 55 NONAME ; bool MpPlaybackData::setUri(class QString const &)
+ ?qt_metacast@MpCollectionTBoneListDataModel@@UAEPAXPBD@Z @ 56 NONAME ; void * MpCollectionTBoneListDataModel::qt_metacast(char const *)
+ ?removeAlbumArtFile@MpSongData@@QBEXXZ @ 57 NONAME ; void MpSongData::removeAlbumArtFile(void) const
+ ?duration@MpSongData@@QBE?AVQString@@XZ @ 58 NONAME ; class QString MpSongData::duration(void) const
+ ?qt_metacall@MpCollectionTBoneListDataModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 59 NONAME ; int MpCollectionTBoneListDataModel::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ??0MpCollectionDataModel@@QAE@PAVMpMpxCollectionData@@PAVQObject@@@Z @ 60 NONAME ; MpCollectionDataModel::MpCollectionDataModel(class MpMpxCollectionData *, class QObject *)
+ ?isAutoPlaylist@MpMpxCollectionData@@QAE_NXZ @ 61 NONAME ; bool MpMpxCollectionData::isAutoPlaylist(void)
+ ?updatePlaybackState@MpCollectionTBoneListDataModel@@QAEXXZ @ 62 NONAME ; void MpCollectionTBoneListDataModel::updatePlaybackState(void)
+ ?setAlbum@MpPlaybackData@@QAE_NABVQString@@@Z @ 63 NONAME ; bool MpPlaybackData::setAlbum(class QString const &)
+ ?setGenre@MpSongData@@QAE_NABVQString@@@Z @ 64 NONAME ; bool MpSongData::setGenre(class QString const &)
+ ?setCurrentAlbum@MpMpxCollectionData@@QAE_NH@Z @ 65 NONAME ; bool MpMpxCollectionData::setCurrentAlbum(int)
+ ?itemId@MpMpxCollectionData@@QAEHH@Z @ 66 NONAME ; int MpMpxCollectionData::itemId(int)
+ ?trUtf8@MpSongData@@SA?AVQString@@PBD0H@Z @ 67 NONAME ; class QString MpSongData::trUtf8(char const *, char const *, int)
+ ?artist@MpPlaybackData@@QBEABVQString@@XZ @ 68 NONAME ; class QString const & MpPlaybackData::artist(void) const
+ ?setFileName@MpSongData@@QAE_NABVQString@@@Z @ 69 NONAME ; bool MpSongData::setFileName(class QString const &)
+ ?setContext@MpCollectionDataModel@@QAEXW4TCollectionContext@@@Z @ 70 NONAME ; void MpCollectionDataModel::setContext(enum TCollectionContext)
+ ?commitPlaybackInfo@MpSongData@@QAEXXZ @ 71 NONAME ; void MpSongData::commitPlaybackInfo(void)
+ ?sampleRate@MpSongData@@QBE?AVQString@@XZ @ 72 NONAME ; class QString MpSongData::sampleRate(void) const
+ ?playbackStateChanged@MpPlaybackData@@IAEXXZ @ 73 NONAME ; void MpPlaybackData::playbackStateChanged(void)
+ ?copyright@MpSongData@@QBE?AVQString@@XZ @ 74 NONAME ; class QString MpSongData::copyright(void) const
+ ?duration@MpPlaybackData@@QBEHXZ @ 75 NONAME ; int MpPlaybackData::duration(void) const
+ ?genre@MpSongData@@QBE?AVQString@@XZ @ 76 NONAME ; class QString MpSongData::genre(void) const
+ ?setMimeType@MpSongData@@QAE_NABVQString@@@Z @ 77 NONAME ; bool MpSongData::setMimeType(class QString const &)
+ ??0MpCollectionTBoneListDataModel@@QAE@PAVMpMpxCollectionData@@PAVMpPlaybackData@@PAVQObject@@@Z @ 78 NONAME ; MpCollectionTBoneListDataModel::MpCollectionTBoneListDataModel(class MpMpxCollectionData *, class MpPlaybackData *, class QObject *)
+ ?getStaticMetaObject@MpCollectionDataModel@@SAABUQMetaObject@@XZ @ 79 NONAME ; struct QMetaObject const & MpCollectionDataModel::getStaticMetaObject(void)
+ ?setSampleRate@MpSongData@@QAE_NH@Z @ 80 NONAME ; bool MpSongData::setSampleRate(int)
+ ?setDuration@MpPlaybackData@@QAEXH@Z @ 81 NONAME ; void MpPlaybackData::setDuration(int)
+ ?albumDataChanged@MpMpxCollectionData@@IAEXXZ @ 82 NONAME ; void MpMpxCollectionData::albumDataChanged(void)
+ ?setMusicURL@MpSongData@@QAE_NABVQString@@@Z @ 83 NONAME ; bool MpSongData::setMusicURL(class QString const &)
+ ??0MpSongData@@QAE@PAVQObject@@@Z @ 84 NONAME ; MpSongData::MpSongData(class QObject *)
+ ?setComment@MpSongData@@QAE_NABVQString@@@Z @ 85 NONAME ; bool MpSongData::setComment(class QString const &)
+ ?uri@MpPlaybackData@@QBEABVQString@@XZ @ 86 NONAME ; class QString const & MpPlaybackData::uri(void) const
+ ?albumArtReady@MpSongData@@IAEXXZ @ 87 NONAME ; void MpSongData::albumArtReady(void)
+ ?rowCount@MpCollectionDataModel@@UBEHABVQModelIndex@@@Z @ 88 NONAME ; int MpCollectionDataModel::rowCount(class QModelIndex const &) const
+ ?trUtf8@MpPlaybackData@@SA?AVQString@@PBD0H@Z @ 89 NONAME ; class QString MpPlaybackData::trUtf8(char const *, char const *, int)
+ ?thumbnailReady@MpPlaybackData@@QAEXABVQPixmap@@PAXHH@Z @ 90 NONAME ; void MpPlaybackData::thumbnailReady(class QPixmap const &, void *, int, int)
+ ?staticMetaObject@MpMpxCollectionData@@2UQMetaObject@@B @ 91 NONAME ; struct QMetaObject const MpMpxCollectionData::staticMetaObject
+ ?tr@MpPlaybackData@@SA?AVQString@@PBD0H@Z @ 92 NONAME ; class QString MpPlaybackData::tr(char const *, char const *, int)
+ ?modified@MpSongData@@QBE?AVQString@@XZ @ 93 NONAME ; class QString MpSongData::modified(void) const
+ ?setRealAudio@MpPlaybackData@@QAE_N_N@Z @ 94 NONAME ; bool MpPlaybackData::setRealAudio(bool)
+ ?qt_metacall@MpMpxCollectionData@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 95 NONAME ; int MpMpxCollectionData::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ?albumArtReady@MpPlaybackData@@IAEXXZ @ 96 NONAME ; void MpPlaybackData::albumArtReady(void)
+ ?setAlbumTrack@MpSongData@@QAE_NABVQString@@@Z @ 97 NONAME ; bool MpSongData::setAlbumTrack(class QString const &)
+ ?album@MpPlaybackData@@QBEABVQString@@XZ @ 98 NONAME ; class QString const & MpPlaybackData::album(void) const
+ ?albumSongsCount@MpMpxCollectionData@@QBEHXZ @ 99 NONAME ; int MpMpxCollectionData::albumSongsCount(void) const
+ ?count@MpMpxCollectionData@@QBEHXZ @ 100 NONAME ; int MpMpxCollectionData::count(void) const
+ ?setAlbumArtUri@MpSongData@@QAEXABVQString@@@Z @ 101 NONAME ; void MpSongData::setAlbumArtUri(class QString const &)
+ ??1MpSongData@@UAE@XZ @ 102 NONAME ; MpSongData::~MpSongData(void)
+ ?dataReloaded@MpCollectionDataModel@@IAEXXZ @ 103 NONAME ; void MpCollectionDataModel::dataReloaded(void)
+ ?testCachedItem@MpMpxCollectionData@@QAE_NH@Z @ 104 NONAME ; bool MpMpxCollectionData::testCachedItem(int)
+ ?tr@MpCollectionDataModel@@SA?AVQString@@PBD0@Z @ 105 NONAME ; class QString MpCollectionDataModel::tr(char const *, char const *)
+ ?setTitle@MpPlaybackData@@QAE_NABVQString@@@Z @ 106 NONAME ; bool MpPlaybackData::setTitle(class QString const &)
+ ?getStaticMetaObject@MpCollectionTBoneListDataModel@@SAABUQMetaObject@@XZ @ 107 NONAME ; struct QMetaObject const & MpCollectionTBoneListDataModel::getStaticMetaObject(void)
+ ?trUtf8@MpCollectionDataModel@@SA?AVQString@@PBD0@Z @ 108 NONAME ; class QString MpCollectionDataModel::trUtf8(char const *, char const *)
+ ?setTitle@MpSongData@@QAE_NABVQString@@@Z @ 109 NONAME ; bool MpSongData::setTitle(class QString const &)
+ ?musicURL@MpSongData@@QBE?AVQString@@XZ @ 110 NONAME ; class QString MpSongData::musicURL(void) const
+ ?realAudio@MpPlaybackData@@QAE_NXZ @ 111 NONAME ; bool MpPlaybackData::realAudio(void)
+ ?staticMetaObject@MpCollectionDataModel@@2UQMetaObject@@B @ 112 NONAME ; struct QMetaObject const MpCollectionDataModel::staticMetaObject
+ ?rowCount@MpCollectionTBoneListDataModel@@UBEHABVQModelIndex@@@Z @ 113 NONAME ; int MpCollectionTBoneListDataModel::rowCount(class QModelIndex const &) const
+ ?dataChanged@MpMpxCollectionData@@IAEXXZ @ 114 NONAME ; void MpMpxCollectionData::dataChanged(void)
+ ?trUtf8@MpCollectionTBoneListDataModel@@SA?AVQString@@PBD0H@Z @ 115 NONAME ; class QString MpCollectionTBoneListDataModel::trUtf8(char const *, char const *, int)
+ ?getStaticMetaObject@MpSongData@@SAABUQMetaObject@@XZ @ 116 NONAME ; struct QMetaObject const & MpSongData::getStaticMetaObject(void)
+ ?songDetailInfoChanged@MpSongData@@IAEXXZ @ 117 NONAME ; void MpSongData::songDetailInfoChanged(void)
+ ?mimeTypes@MpCollectionDataModel@@UBE?AVQStringList@@XZ @ 118 NONAME ; class QStringList MpCollectionDataModel::mimeTypes(void) const
+ ?albumArt@MpSongData@@QBEXAAVHbIcon@@@Z @ 119 NONAME ; void MpSongData::albumArt(class HbIcon &) const
+ ?isDrmProtected@MpSongData@@QBE_NXZ @ 120 NONAME ; bool MpSongData::isDrmProtected(void) const
+ ?collectionTitle@MpMpxCollectionData@@QBE?AVQString@@XZ @ 121 NONAME ; class QString MpMpxCollectionData::collectionTitle(void) const
+ ?albumTrack@MpSongData@@QBE?AVQString@@XZ @ 122 NONAME ; class QString MpSongData::albumTrack(void) const
+ ?setArtist@MpSongData@@QAE_NABVQString@@@Z @ 123 NONAME ; bool MpSongData::setArtist(class QString const &)
+ ?tr@MpPlaybackData@@SA?AVQString@@PBD0@Z @ 124 NONAME ; class QString MpPlaybackData::tr(char const *, char const *)
+ ?setYear@MpSongData@@QAE_NH@Z @ 125 NONAME ; bool MpSongData::setYear(int)
+ ?qt_metacall@MpPlaybackData@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 126 NONAME ; int MpPlaybackData::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ?albumSongData@MpMpxCollectionData@@QBE?AVQString@@HW4DataType@1@@Z @ 127 NONAME ; class QString MpMpxCollectionData::albumSongData(int, enum MpMpxCollectionData::DataType) const
+ ?playbackInfoChanged@MpSongData@@IAEXXZ @ 128 NONAME ; void MpSongData::playbackInfoChanged(void)
+ ?insertCachedItem@MpMpxCollectionData@@QAEXH@Z @ 129 NONAME ; void MpMpxCollectionData::insertCachedItem(int)
+ ?setComposer@MpSongData@@QAE_NABVQString@@@Z @ 130 NONAME ; bool MpSongData::setComposer(class QString const &)
+ ?setAlbumContent@MpMpxCollectionData@@QAEXABVCMPXMedia@@@Z @ 131 NONAME ; void MpMpxCollectionData::setAlbumContent(class CMPXMedia const &)
+ ??0MpMpxCollectionData@@QAE@PAVQObject@@@Z @ 132 NONAME ; MpMpxCollectionData::MpMpxCollectionData(class QObject *)
+ ?setArtist@MpPlaybackData@@QAE_NABVQString@@@Z @ 133 NONAME ; bool MpPlaybackData::setArtist(class QString const &)
+ ?trUtf8@MpSongData@@SA?AVQString@@PBD0@Z @ 134 NONAME ; class QString MpSongData::trUtf8(char const *, char const *)
+ ?albumId@MpPlaybackData@@QAEHXZ @ 135 NONAME ; int MpPlaybackData::albumId(void)
+ ??1MpMpxCollectionData@@UAE@XZ @ 136 NONAME ; MpMpxCollectionData::~MpMpxCollectionData(void)
+ ??0MpPlaybackData@@QAE@PAVQObject@@@Z @ 137 NONAME ; MpPlaybackData::MpPlaybackData(class QObject *)
+ ?trUtf8@MpCollectionDataModel@@SA?AVQString@@PBD0H@Z @ 138 NONAME ; class QString MpCollectionDataModel::trUtf8(char const *, char const *, int)
+ ?metaObject@MpMpxCollectionData@@UBEPBUQMetaObject@@XZ @ 139 NONAME ; struct QMetaObject const * MpMpxCollectionData::metaObject(void) const
+ ?qt_metacast@MpMpxCollectionData@@UAEPAXPBD@Z @ 140 NONAME ; void * MpMpxCollectionData::qt_metacast(char const *)
+ ?qt_metacast@MpPlaybackData@@UAEPAXPBD@Z @ 141 NONAME ; void * MpPlaybackData::qt_metacast(char const *)
+ ?size@MpSongData@@QBE?AVQString@@XZ @ 142 NONAME ; class QString MpSongData::size(void) const
+ ??_EMpSongData@@UAE@I@Z @ 143 NONAME ; MpSongData::~MpSongData(unsigned int)
+ ?containerId@MpMpxCollectionData@@QAEHXZ @ 144 NONAME ; int MpMpxCollectionData::containerId(void)
+ ?containerMedia@MpMpxCollectionData@@QAEABVCMPXMedia@@XZ @ 145 NONAME ; class CMPXMedia const & MpMpxCollectionData::containerMedia(void)
+ ?setDuration@MpSongData@@QAE_NH@Z @ 146 NONAME ; bool MpSongData::setDuration(int)
+ ??_EMpCollectionTBoneListDataModel@@UAE@I@Z @ 147 NONAME ; MpCollectionTBoneListDataModel::~MpCollectionTBoneListDataModel(unsigned int)
+ ??1MpCollectionDataModel@@UAE@XZ @ 148 NONAME ; MpCollectionDataModel::~MpCollectionDataModel(void)
+ ?setSize@MpSongData@@QAE_NH@Z @ 149 NONAME ; bool MpSongData::setSize(int)
+ ?thumbnailReady@MpSongData@@QAEXABVQPixmap@@PAXHH@Z @ 150 NONAME ; void MpSongData::thumbnailReady(class QPixmap const &, void *, int, int)
+ ?tr@MpCollectionDataModel@@SA?AVQString@@PBD0H@Z @ 151 NONAME ; class QString MpCollectionDataModel::tr(char const *, char const *, int)
+ ?reloadData@MpCollectionDataModel@@QAEXXZ @ 152 NONAME ; void MpCollectionDataModel::reloadData(void)
+ ?commitSongDetailInfo@MpSongData@@QAEXXZ @ 153 NONAME ; void MpSongData::commitSongDetailInfo(void)
+ ??1MpCollectionTBoneListDataModel@@UAE@XZ @ 154 NONAME ; MpCollectionTBoneListDataModel::~MpCollectionTBoneListDataModel(void)
+ ?qt_metacall@MpSongData@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 155 NONAME ; int MpSongData::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ?reservedLength@MpSongData@@QBEHXZ @ 156 NONAME ; int MpSongData::reservedLength(void) const
+ ?collectionData@MpCollectionDataModel@@QAEPAVMpMpxCollectionData@@XZ @ 157 NONAME ; class MpMpxCollectionData * MpCollectionDataModel::collectionData(void)
+ ?trUtf8@MpMpxCollectionData@@SA?AVQString@@PBD0@Z @ 158 NONAME ; class QString MpMpxCollectionData::trUtf8(char const *, char const *)
+ ?setPosition@MpPlaybackData@@QAEXH@Z @ 159 NONAME ; void MpPlaybackData::setPosition(int)
+ ??1MpPlaybackData@@UAE@XZ @ 160 NONAME ; MpPlaybackData::~MpPlaybackData(void)
+ ?tr@MpSongData@@SA?AVQString@@PBD0@Z @ 161 NONAME ; class QString MpSongData::tr(char const *, char const *)
+ ?setPlaybackState@MpPlaybackData@@QAEXW4SimplifiedState@1@@Z @ 162 NONAME ; void MpPlaybackData::setPlaybackState(enum MpPlaybackData::SimplifiedState)
+ ?refreshAlbumSongs@MpMpxCollectionData@@IAEXXZ @ 163 NONAME ; void MpMpxCollectionData::refreshAlbumSongs(void)
+ ?trUtf8@MpPlaybackData@@SA?AVQString@@PBD0@Z @ 164 NONAME ; class QString MpPlaybackData::trUtf8(char const *, char const *)
+ ?albumDataChanged@MpCollectionTBoneListDataModel@@IAEXXZ @ 165 NONAME ; void MpCollectionTBoneListDataModel::albumDataChanged(void)
+ ?comment@MpSongData@@QBE?AVQString@@XZ @ 166 NONAME ; class QString MpSongData::comment(void) const
+ ?year@MpSongData@@QBE?AVQString@@XZ @ 167 NONAME ; class QString MpSongData::year(void) const
+ ?data@MpCollectionTBoneListDataModel@@UBE?AVQVariant@@ABVQModelIndex@@H@Z @ 168 NONAME ; class QVariant MpCollectionTBoneListDataModel::data(class QModelIndex const &, int) const
+ ?setAlbum@MpSongData@@QAE_NABVQString@@@Z @ 169 NONAME ; bool MpSongData::setAlbum(class QString const &)
+ ?albumSongIndex@MpMpxCollectionData@@QAEHH@Z @ 170 NONAME ; int MpMpxCollectionData::albumSongIndex(int)
+ ?getStaticMetaObject@MpPlaybackData@@SAABUQMetaObject@@XZ @ 171 NONAME ; struct QMetaObject const & MpPlaybackData::getStaticMetaObject(void)
+ ?composer@MpSongData@@QBE?AVQString@@XZ @ 172 NONAME ; class QString MpSongData::composer(void) const
+ ?albumArt@MpPlaybackData@@QBEXAAVHbIcon@@@Z @ 173 NONAME ; void MpPlaybackData::albumArt(class HbIcon &) const
+ ?commitPlaybackInfo@MpPlaybackData@@QAEXXZ @ 174 NONAME ; void MpPlaybackData::commitPlaybackInfo(void)
+ ?removeRows@MpCollectionDataModel@@UAE_NHHABVQModelIndex@@@Z @ 175 NONAME ; bool MpCollectionDataModel::removeRows(int, int, class QModelIndex const &)
+ ?albumSongId@MpMpxCollectionData@@QAEHH@Z @ 176 NONAME ; int MpMpxCollectionData::albumSongId(int)
+ ?id@MpPlaybackData@@QAEHXZ @ 177 NONAME ; int MpPlaybackData::id(void)
+ ?album@MpSongData@@QBE?AVQString@@XZ @ 178 NONAME ; class QString MpSongData::album(void) const
+ ?albumArtBase64@MpSongData@@QBE?AVQString@@XZ @ 179 NONAME ; class QString MpSongData::albumArtBase64(void) const
+ ?playbackInfoChanged@MpPlaybackData@@IAEXXZ @ 180 NONAME ; void MpPlaybackData::playbackInfoChanged(void)
+ ?itemData@MpMpxCollectionData@@QBE?AVQString@@HW4DataType@1@@Z @ 181 NONAME ; class QString MpMpxCollectionData::itemData(int, enum MpMpxCollectionData::DataType) const
+ ?link@MpSongData@@QBE?AVQString@@XZ @ 182 NONAME ; class QString MpSongData::link(void) const
+ ?trUtf8@MpCollectionTBoneListDataModel@@SA?AVQString@@PBD0@Z @ 183 NONAME ; class QString MpCollectionTBoneListDataModel::trUtf8(char const *, char const *)
+ ?updateSong@MpCollectionTBoneListDataModel@@QAEXXZ @ 184 NONAME ; void MpCollectionTBoneListDataModel::updateSong(void)
+ ?setId@MpPlaybackData@@QAE_NH@Z @ 185 NONAME ; bool MpPlaybackData::setId(int)
+ ?metaObject@MpCollectionDataModel@@UBEPBUQMetaObject@@XZ @ 186 NONAME ; struct QMetaObject const * MpCollectionDataModel::metaObject(void) const
+ ?metaObject@MpSongData@@UBEPBUQMetaObject@@XZ @ 187 NONAME ; struct QMetaObject const * MpSongData::metaObject(void) const
--- a/mpdata/eabi/mpdatau.def Fri May 14 18:54:37 2010 -0500
+++ b/mpdata/eabi/mpdatau.def Fri May 28 19:46:01 2010 -0500
@@ -58,124 +58,131 @@
_ZN14MpPlaybackData8setAlbumERK7QString @ 57 NONAME
_ZN14MpPlaybackData8setTitleERK7QString @ 58 NONAME
_ZN14MpPlaybackData9realAudioEv @ 59 NONAME
- _ZN14MpPlaybackData9setArtistERK7QString @ 60 NONAME
- _ZN14MpPlaybackDataC1EP7QObject @ 61 NONAME
- _ZN14MpPlaybackDataC2EP7QObject @ 62 NONAME
- _ZN14MpPlaybackDataD0Ev @ 63 NONAME
- _ZN14MpPlaybackDataD1Ev @ 64 NONAME
- _ZN14MpPlaybackDataD2Ev @ 65 NONAME
- _ZN19MpMpxCollectionData10removeItemEi @ 66 NONAME
- _ZN19MpMpxCollectionData10setContextE18TCollectionContext @ 67 NONAME
- _ZN19MpMpxCollectionData11containerIdEv @ 68 NONAME
- _ZN19MpMpxCollectionData11dataChangedEv @ 69 NONAME
- _ZN19MpMpxCollectionData11qt_metacallEN11QMetaObject4CallEiPPv @ 70 NONAME
- _ZN19MpMpxCollectionData11qt_metacastEPKc @ 71 NONAME
- _ZN19MpMpxCollectionData11setMpxMediaERK9CMPXMediab @ 72 NONAME
- _ZN19MpMpxCollectionData14containerMediaEv @ 73 NONAME
- _ZN19MpMpxCollectionData14contextChangedE18TCollectionContext @ 74 NONAME
- _ZN19MpMpxCollectionData14isAutoPlaylistEi @ 75 NONAME
- _ZN19MpMpxCollectionData14isAutoPlaylistEv @ 76 NONAME
- _ZN19MpMpxCollectionData14testCachedItemEi @ 77 NONAME
- _ZN19MpMpxCollectionData15setAlbumContentERK9CMPXMedia @ 78 NONAME
- _ZN19MpMpxCollectionData15setCurrentAlbumEi @ 79 NONAME
- _ZN19MpMpxCollectionData16albumDataChangedEv @ 80 NONAME
- _ZN19MpMpxCollectionData16insertCachedItemEi @ 81 NONAME
- _ZN19MpMpxCollectionData16staticMetaObjectE @ 82 NONAME DATA 16
- _ZN19MpMpxCollectionData17refreshAlbumSongsEv @ 83 NONAME
- _ZN19MpMpxCollectionData19getStaticMetaObjectEv @ 84 NONAME
- _ZN19MpMpxCollectionData6itemIdEi @ 85 NONAME
- _ZN19MpMpxCollectionData9itemCountEi @ 86 NONAME
- _ZN19MpMpxCollectionData9itemIndexEi @ 87 NONAME
- _ZN19MpMpxCollectionDataC1EP7QObject @ 88 NONAME
- _ZN19MpMpxCollectionDataC2EP7QObject @ 89 NONAME
- _ZN19MpMpxCollectionDataD0Ev @ 90 NONAME
- _ZN19MpMpxCollectionDataD1Ev @ 91 NONAME
- _ZN19MpMpxCollectionDataD2Ev @ 92 NONAME
- _ZN21MpCollectionDataModel10reloadDataEv @ 93 NONAME
- _ZN21MpCollectionDataModel10removeRowsEiiRK11QModelIndex @ 94 NONAME
- _ZN21MpCollectionDataModel10setContextE18TCollectionContext @ 95 NONAME
- _ZN21MpCollectionDataModel11qt_metacallEN11QMetaObject4CallEiPPv @ 96 NONAME
- _ZN21MpCollectionDataModel11qt_metacastEPKc @ 97 NONAME
- _ZN21MpCollectionDataModel12dataReloadedEv @ 98 NONAME
- _ZN21MpCollectionDataModel12dropMimeDataEPK9QMimeDataN2Qt10DropActionEiiRK11QModelIndex @ 99 NONAME
- _ZN21MpCollectionDataModel12orderChangedEiiii @ 100 NONAME
- _ZN21MpCollectionDataModel12refreshModelEv @ 101 NONAME
- _ZN21MpCollectionDataModel14collectionDataEv @ 102 NONAME
- _ZN21MpCollectionDataModel14updateAlbumArtEi @ 103 NONAME
- _ZN21MpCollectionDataModel16staticMetaObjectE @ 104 NONAME DATA 16
- _ZN21MpCollectionDataModel19getStaticMetaObjectEv @ 105 NONAME
- _ZN21MpCollectionDataModelC1EP19MpMpxCollectionDataP7QObject @ 106 NONAME
- _ZN21MpCollectionDataModelC2EP19MpMpxCollectionDataP7QObject @ 107 NONAME
- _ZN21MpCollectionDataModelD0Ev @ 108 NONAME
- _ZN21MpCollectionDataModelD1Ev @ 109 NONAME
- _ZN21MpCollectionDataModelD2Ev @ 110 NONAME
- _ZN30MpCollectionTBoneListDataModel11qt_metacallEN11QMetaObject4CallEiPPv @ 111 NONAME
- _ZN30MpCollectionTBoneListDataModel11qt_metacastEPKc @ 112 NONAME
- _ZN30MpCollectionTBoneListDataModel12refreshModelEv @ 113 NONAME
- _ZN30MpCollectionTBoneListDataModel16albumDataChangedEv @ 114 NONAME
- _ZN30MpCollectionTBoneListDataModel16staticMetaObjectE @ 115 NONAME DATA 16
- _ZN30MpCollectionTBoneListDataModel19getStaticMetaObjectEv @ 116 NONAME
- _ZN30MpCollectionTBoneListDataModelC1EP19MpMpxCollectionDataP7QObject @ 117 NONAME
- _ZN30MpCollectionTBoneListDataModelC2EP19MpMpxCollectionDataP7QObject @ 118 NONAME
- _ZN30MpCollectionTBoneListDataModelD0Ev @ 119 NONAME
- _ZN30MpCollectionTBoneListDataModelD1Ev @ 120 NONAME
- _ZN30MpCollectionTBoneListDataModelD2Ev @ 121 NONAME
- _ZNK10MpSongData10albumTrackEv @ 122 NONAME
- _ZNK10MpSongData10metaObjectEv @ 123 NONAME
- _ZNK10MpSongData10sampleRateEv @ 124 NONAME
- _ZNK10MpSongData14albumArtBase64Ev @ 125 NONAME
- _ZNK10MpSongData14isDrmProtectedEv @ 126 NONAME
- _ZNK10MpSongData4linkEv @ 127 NONAME
- _ZNK10MpSongData4sizeEv @ 128 NONAME
- _ZNK10MpSongData4yearEv @ 129 NONAME
- _ZNK10MpSongData5albumEv @ 130 NONAME
- _ZNK10MpSongData5genreEv @ 131 NONAME
- _ZNK10MpSongData5titleEv @ 132 NONAME
- _ZNK10MpSongData6artistEv @ 133 NONAME
- _ZNK10MpSongData7bitRateEv @ 134 NONAME
- _ZNK10MpSongData7commentEv @ 135 NONAME
- _ZNK10MpSongData8albumArtER6HbIcon @ 136 NONAME
- _ZNK10MpSongData8composerEv @ 137 NONAME
- _ZNK10MpSongData8durationEv @ 138 NONAME
- _ZNK10MpSongData8fileNameEv @ 139 NONAME
- _ZNK10MpSongData8mimeTypeEv @ 140 NONAME
- _ZNK10MpSongData8modifiedEv @ 141 NONAME
- _ZNK10MpSongData8musicURLEv @ 142 NONAME
- _ZNK10MpSongData9copyrightEv @ 143 NONAME
- _ZNK14MpPlaybackData10metaObjectEv @ 144 NONAME
- _ZNK14MpPlaybackData13playbackStateEv @ 145 NONAME
- _ZNK14MpPlaybackData3uriEv @ 146 NONAME
- _ZNK14MpPlaybackData5albumEv @ 147 NONAME
- _ZNK14MpPlaybackData5titleEv @ 148 NONAME
- _ZNK14MpPlaybackData6artistEv @ 149 NONAME
- _ZNK14MpPlaybackData8albumArtER6HbIcon @ 150 NONAME
- _ZNK14MpPlaybackData8durationEv @ 151 NONAME
- _ZNK14MpPlaybackData8positionEv @ 152 NONAME
- _ZNK19MpMpxCollectionData10metaObjectEv @ 153 NONAME
- _ZNK19MpMpxCollectionData13albumSongDataEiNS_8DataTypeE @ 154 NONAME
- _ZNK19MpMpxCollectionData15albumSongsCountEv @ 155 NONAME
- _ZNK19MpMpxCollectionData15collectionTitleEv @ 156 NONAME
- _ZNK19MpMpxCollectionData17currentAlbumIndexEv @ 157 NONAME
- _ZNK19MpMpxCollectionData5countEv @ 158 NONAME
- _ZNK19MpMpxCollectionData7contextEv @ 159 NONAME
- _ZNK19MpMpxCollectionData8itemDataEiNS_8DataTypeE @ 160 NONAME
- _ZNK21MpCollectionDataModel10metaObjectEv @ 161 NONAME
- _ZNK21MpCollectionDataModel20supportedDropActionsEv @ 162 NONAME
- _ZNK21MpCollectionDataModel4dataERK11QModelIndexi @ 163 NONAME
- _ZNK21MpCollectionDataModel8mimeDataERK5QListI11QModelIndexE @ 164 NONAME
- _ZNK21MpCollectionDataModel8rowCountERK11QModelIndex @ 165 NONAME
- _ZNK21MpCollectionDataModel9mimeTypesEv @ 166 NONAME
- _ZNK30MpCollectionTBoneListDataModel10metaObjectEv @ 167 NONAME
- _ZNK30MpCollectionTBoneListDataModel4dataERK11QModelIndexi @ 168 NONAME
- _ZNK30MpCollectionTBoneListDataModel8rowCountERK11QModelIndex @ 169 NONAME
- _ZTI10MpSongData @ 170 NONAME
- _ZTI14MpPlaybackData @ 171 NONAME
- _ZTI19MpMpxCollectionData @ 172 NONAME
- _ZTI21MpCollectionDataModel @ 173 NONAME
- _ZTI30MpCollectionTBoneListDataModel @ 174 NONAME
- _ZTV10MpSongData @ 175 NONAME
- _ZTV14MpPlaybackData @ 176 NONAME
- _ZTV19MpMpxCollectionData @ 177 NONAME
- _ZTV21MpCollectionDataModel @ 178 NONAME
- _ZTV30MpCollectionTBoneListDataModel @ 179 NONAME
+ _ZN14MpPlaybackData9resetDataEv @ 60 NONAME
+ _ZN14MpPlaybackData9setArtistERK7QString @ 61 NONAME
+ _ZN14MpPlaybackDataC1EP7QObject @ 62 NONAME
+ _ZN14MpPlaybackDataC2EP7QObject @ 63 NONAME
+ _ZN14MpPlaybackDataD0Ev @ 64 NONAME
+ _ZN14MpPlaybackDataD1Ev @ 65 NONAME
+ _ZN14MpPlaybackDataD2Ev @ 66 NONAME
+ _ZN19MpMpxCollectionData10removeItemEi @ 67 NONAME
+ _ZN19MpMpxCollectionData10setContextE18TCollectionContext @ 68 NONAME
+ _ZN19MpMpxCollectionData11albumSongIdEi @ 69 NONAME
+ _ZN19MpMpxCollectionData11containerIdEv @ 70 NONAME
+ _ZN19MpMpxCollectionData11dataChangedEv @ 71 NONAME
+ _ZN19MpMpxCollectionData11qt_metacallEN11QMetaObject4CallEiPPv @ 72 NONAME
+ _ZN19MpMpxCollectionData11qt_metacastEPKc @ 73 NONAME
+ _ZN19MpMpxCollectionData11setMpxMediaERK9CMPXMediab @ 74 NONAME
+ _ZN19MpMpxCollectionData14albumSongIndexEi @ 75 NONAME
+ _ZN19MpMpxCollectionData14containerMediaEv @ 76 NONAME
+ _ZN19MpMpxCollectionData14contextChangedE18TCollectionContext @ 77 NONAME
+ _ZN19MpMpxCollectionData14isAutoPlaylistEi @ 78 NONAME
+ _ZN19MpMpxCollectionData14isAutoPlaylistEv @ 79 NONAME
+ _ZN19MpMpxCollectionData14testCachedItemEi @ 80 NONAME
+ _ZN19MpMpxCollectionData15setAlbumContentERK9CMPXMedia @ 81 NONAME
+ _ZN19MpMpxCollectionData15setCurrentAlbumEi @ 82 NONAME
+ _ZN19MpMpxCollectionData16albumDataChangedEv @ 83 NONAME
+ _ZN19MpMpxCollectionData16insertCachedItemEi @ 84 NONAME
+ _ZN19MpMpxCollectionData16staticMetaObjectE @ 85 NONAME DATA 16
+ _ZN19MpMpxCollectionData17refreshAlbumSongsEv @ 86 NONAME
+ _ZN19MpMpxCollectionData19getStaticMetaObjectEv @ 87 NONAME
+ _ZN19MpMpxCollectionData6itemIdEi @ 88 NONAME
+ _ZN19MpMpxCollectionData9itemCountEi @ 89 NONAME
+ _ZN19MpMpxCollectionData9itemIndexEi @ 90 NONAME
+ _ZN19MpMpxCollectionDataC1EP7QObject @ 91 NONAME
+ _ZN19MpMpxCollectionDataC2EP7QObject @ 92 NONAME
+ _ZN19MpMpxCollectionDataD0Ev @ 93 NONAME
+ _ZN19MpMpxCollectionDataD1Ev @ 94 NONAME
+ _ZN19MpMpxCollectionDataD2Ev @ 95 NONAME
+ _ZN21MpCollectionDataModel10reloadDataEv @ 96 NONAME
+ _ZN21MpCollectionDataModel10removeRowsEiiRK11QModelIndex @ 97 NONAME
+ _ZN21MpCollectionDataModel10setContextE18TCollectionContext @ 98 NONAME
+ _ZN21MpCollectionDataModel11qt_metacallEN11QMetaObject4CallEiPPv @ 99 NONAME
+ _ZN21MpCollectionDataModel11qt_metacastEPKc @ 100 NONAME
+ _ZN21MpCollectionDataModel12dataReloadedEv @ 101 NONAME
+ _ZN21MpCollectionDataModel12dropMimeDataEPK9QMimeDataN2Qt10DropActionEiiRK11QModelIndex @ 102 NONAME
+ _ZN21MpCollectionDataModel12orderChangedEiiii @ 103 NONAME
+ _ZN21MpCollectionDataModel12refreshModelEv @ 104 NONAME
+ _ZN21MpCollectionDataModel14collectionDataEv @ 105 NONAME
+ _ZN21MpCollectionDataModel14updateAlbumArtEi @ 106 NONAME
+ _ZN21MpCollectionDataModel16staticMetaObjectE @ 107 NONAME DATA 16
+ _ZN21MpCollectionDataModel19getStaticMetaObjectEv @ 108 NONAME
+ _ZN21MpCollectionDataModelC1EP19MpMpxCollectionDataP7QObject @ 109 NONAME
+ _ZN21MpCollectionDataModelC2EP19MpMpxCollectionDataP7QObject @ 110 NONAME
+ _ZN21MpCollectionDataModelD0Ev @ 111 NONAME
+ _ZN21MpCollectionDataModelD1Ev @ 112 NONAME
+ _ZN21MpCollectionDataModelD2Ev @ 113 NONAME
+ _ZN30MpCollectionTBoneListDataModel10updateSongEv @ 114 NONAME
+ _ZN30MpCollectionTBoneListDataModel11qt_metacallEN11QMetaObject4CallEiPPv @ 115 NONAME
+ _ZN30MpCollectionTBoneListDataModel11qt_metacastEPKc @ 116 NONAME
+ _ZN30MpCollectionTBoneListDataModel12refreshModelEv @ 117 NONAME
+ _ZN30MpCollectionTBoneListDataModel16albumDataChangedEv @ 118 NONAME
+ _ZN30MpCollectionTBoneListDataModel16staticMetaObjectE @ 119 NONAME DATA 16
+ _ZN30MpCollectionTBoneListDataModel18albumDataAvailableEv @ 120 NONAME
+ _ZN30MpCollectionTBoneListDataModel19getStaticMetaObjectEv @ 121 NONAME
+ _ZN30MpCollectionTBoneListDataModel19updatePlaybackStateEv @ 122 NONAME
+ _ZN30MpCollectionTBoneListDataModelC1EP19MpMpxCollectionDataP14MpPlaybackDataP7QObject @ 123 NONAME
+ _ZN30MpCollectionTBoneListDataModelC2EP19MpMpxCollectionDataP14MpPlaybackDataP7QObject @ 124 NONAME
+ _ZN30MpCollectionTBoneListDataModelD0Ev @ 125 NONAME
+ _ZN30MpCollectionTBoneListDataModelD1Ev @ 126 NONAME
+ _ZN30MpCollectionTBoneListDataModelD2Ev @ 127 NONAME
+ _ZNK10MpSongData10albumTrackEv @ 128 NONAME
+ _ZNK10MpSongData10metaObjectEv @ 129 NONAME
+ _ZNK10MpSongData10sampleRateEv @ 130 NONAME
+ _ZNK10MpSongData14albumArtBase64Ev @ 131 NONAME
+ _ZNK10MpSongData14isDrmProtectedEv @ 132 NONAME
+ _ZNK10MpSongData18removeAlbumArtFileEv @ 133 NONAME
+ _ZNK10MpSongData4linkEv @ 134 NONAME
+ _ZNK10MpSongData4sizeEv @ 135 NONAME
+ _ZNK10MpSongData4yearEv @ 136 NONAME
+ _ZNK10MpSongData5albumEv @ 137 NONAME
+ _ZNK10MpSongData5genreEv @ 138 NONAME
+ _ZNK10MpSongData5titleEv @ 139 NONAME
+ _ZNK10MpSongData6artistEv @ 140 NONAME
+ _ZNK10MpSongData7bitRateEv @ 141 NONAME
+ _ZNK10MpSongData7commentEv @ 142 NONAME
+ _ZNK10MpSongData8albumArtER6HbIcon @ 143 NONAME
+ _ZNK10MpSongData8composerEv @ 144 NONAME
+ _ZNK10MpSongData8durationEv @ 145 NONAME
+ _ZNK10MpSongData8fileNameEv @ 146 NONAME
+ _ZNK10MpSongData8mimeTypeEv @ 147 NONAME
+ _ZNK10MpSongData8modifiedEv @ 148 NONAME
+ _ZNK10MpSongData8musicURLEv @ 149 NONAME
+ _ZNK10MpSongData9copyrightEv @ 150 NONAME
+ _ZNK14MpPlaybackData10metaObjectEv @ 151 NONAME
+ _ZNK14MpPlaybackData13playbackStateEv @ 152 NONAME
+ _ZNK14MpPlaybackData3uriEv @ 153 NONAME
+ _ZNK14MpPlaybackData5albumEv @ 154 NONAME
+ _ZNK14MpPlaybackData5titleEv @ 155 NONAME
+ _ZNK14MpPlaybackData6artistEv @ 156 NONAME
+ _ZNK14MpPlaybackData8albumArtER6HbIcon @ 157 NONAME
+ _ZNK14MpPlaybackData8durationEv @ 158 NONAME
+ _ZNK14MpPlaybackData8positionEv @ 159 NONAME
+ _ZNK19MpMpxCollectionData10metaObjectEv @ 160 NONAME
+ _ZNK19MpMpxCollectionData13albumSongDataEiNS_8DataTypeE @ 161 NONAME
+ _ZNK19MpMpxCollectionData15albumSongsCountEv @ 162 NONAME
+ _ZNK19MpMpxCollectionData15collectionTitleEv @ 163 NONAME
+ _ZNK19MpMpxCollectionData17currentAlbumIndexEv @ 164 NONAME
+ _ZNK19MpMpxCollectionData5countEv @ 165 NONAME
+ _ZNK19MpMpxCollectionData7contextEv @ 166 NONAME
+ _ZNK19MpMpxCollectionData8itemDataEiNS_8DataTypeE @ 167 NONAME
+ _ZNK21MpCollectionDataModel10metaObjectEv @ 168 NONAME
+ _ZNK21MpCollectionDataModel20supportedDropActionsEv @ 169 NONAME
+ _ZNK21MpCollectionDataModel4dataERK11QModelIndexi @ 170 NONAME
+ _ZNK21MpCollectionDataModel8mimeDataERK5QListI11QModelIndexE @ 171 NONAME
+ _ZNK21MpCollectionDataModel8rowCountERK11QModelIndex @ 172 NONAME
+ _ZNK21MpCollectionDataModel9mimeTypesEv @ 173 NONAME
+ _ZNK30MpCollectionTBoneListDataModel10metaObjectEv @ 174 NONAME
+ _ZNK30MpCollectionTBoneListDataModel4dataERK11QModelIndexi @ 175 NONAME
+ _ZNK30MpCollectionTBoneListDataModel8rowCountERK11QModelIndex @ 176 NONAME
+ _ZTI10MpSongData @ 177 NONAME
+ _ZTI14MpPlaybackData @ 178 NONAME
+ _ZTI19MpMpxCollectionData @ 179 NONAME
+ _ZTI21MpCollectionDataModel @ 180 NONAME
+ _ZTI30MpCollectionTBoneListDataModel @ 181 NONAME
+ _ZTV10MpSongData @ 182 NONAME
+ _ZTV14MpPlaybackData @ 183 NONAME
+ _ZTV19MpMpxCollectionData @ 184 NONAME
+ _ZTV21MpCollectionDataModel @ 185 NONAME
+ _ZTV30MpCollectionTBoneListDataModel @ 186 NONAME
--- a/mpdata/inc/mpmpxcollectiondata_p.h Fri May 14 18:54:37 2010 -0500
+++ b/mpdata/inc/mpmpxcollectiondata_p.h Fri May 28 19:46:01 2010 -0500
@@ -46,10 +46,11 @@
bool isAutoPlaylist( int index );
int itemCount( int index );
int containerId();
- int itemId(int index);
- void removeItem(int index);
+ int itemId( int index);
+ int albumSongId( int index);
+ void removeItem( int index);
bool testCachedItem( int itemId );
- void insertCachedItem(int index);
+ void insertCachedItem( int index);
bool setCurrentAlbum( int index );
int currentAlbumIndex() const;
@@ -61,15 +62,18 @@
void setContext( TCollectionContext context );
void setAlbumContent( const CMPXMedia& albumContent );
int itemIndex( int itemUniqueId );
+ int albumSongIndex( int songUniqueId );
private:
-
+ void loadAlbumsLookup();
+ void loadAlbumSongsLookup();
void DoGetDataL( int index, MpMpxCollectionData::DataType type, QString& data ) const;
bool DoIsAutoPlaylistL();
bool DoIsAutoPlaylistL( int index );
int DoGetItemCountL( int index );
int DoGetContainerIdL();
int DoGetItemIdL( int index );
+ int DoGetAlbumSongIdL( int index );
void DoRemoveItemL( int index );
bool DoTestCachedItemL( int itemId );
@@ -93,6 +97,7 @@
int iCurrentAlbumIndex;
int iAlbumSongCount;
QHash<int, int> albumIdIndexMapping;
+ QHash<int, int> albumSongIdIndexMapping;
};
--- a/mpdata/src/mpcollectiontbonelistdatamodel.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpdata/src/mpcollectiontbonelistdatamodel.cpp Fri May 28 19:46:01 2010 -0500
@@ -21,6 +21,7 @@
#include "mpcollectiontbonelistdatamodel.h"
#include "mpmpxcollectiondata.h"
+#include "mpplaybackdata.h"
#include "mptrace.h"
/*!
@@ -49,23 +50,47 @@
\fn void albumDataChanged()
This signal is specific to views with TBone. This signal is emitted when
- a new data set is available for the list section of the TBone. Currently,
- the only operation that can trigger this is the delete operation.
+ there's a change in album data. This is an indication that the container
+ should re-fetch the album content. Currently, the only operation that can
+ trigger this is the delete operation.
+ */
+
+/*!
+ \fn void albumDataAvailable()
+
+ This signal is specific to views with TBone. This signal is emitted when
+ a new data set is available for the list section of the TBone. This is
+ triggered as a result of container re-fetching the album content.
+
+ \sa albumDataChanged
*/
/*!
Constructs the collection data model.
*/
-MpCollectionTBoneListDataModel::MpCollectionTBoneListDataModel( MpMpxCollectionData *data, QObject *parent )
- : QAbstractListModel(parent),
- mCollectionData(data),
- mRowCount(0)
+MpCollectionTBoneListDataModel::MpCollectionTBoneListDataModel( MpMpxCollectionData *collectionData,
+ MpPlaybackData *playbackData, QObject *parent )
+ : QAbstractListModel( parent ),
+ mCollectionData( collectionData ),
+ mPlaybackData( playbackData ),
+ mRowCount(0),
+ mCurrentSongId(0)
{
TX_ENTRY
connect( mCollectionData, SIGNAL(refreshAlbumSongs()),
this, SLOT(refreshModel()) );
connect( mCollectionData, SIGNAL(albumDataChanged()),
this, SIGNAL(albumDataChanged()) );
+
+ if ( mPlaybackData ) {
+ connect( mPlaybackData, SIGNAL(playbackInfoChanged()),
+ this, SLOT(updateSong()));
+
+ connect( mPlaybackData, SIGNAL(playbackStateChanged()),
+ this, SLOT(updatePlaybackState()));
+ mPlaybackActive = mPlaybackData->playbackState() != MpPlaybackData::NotPlaying;
+ }
+
TX_EXIT
}
@@ -114,6 +139,17 @@
returnValue = hbTrId("txt_mus_other_unknown4");
}
}
+ else if ( role == Qt::DecorationRole ) {
+ if ( mPlaybackData
+ && mPlaybackActive
+ && mPlaybackData->id() == mCollectionData->albumSongId( index.row() ) ) {
+ QList<QVariant> iconList;
+ iconList << QVariant(); //primary icon is not used.
+ //TODO: Replace for qtg_small_speaker when available.
+ iconList << HbIcon("qtg_graf_hspage_highlight");
+ returnValue = iconList;
+ }
+ }
TX_EXIT
return returnValue;
}
@@ -127,6 +163,52 @@
TX_ENTRY
mRowCount = mCollectionData->albumSongsCount();
reset();
+ emit albumDataAvailable();
TX_EXIT
}
+/*!
+ Slot to be called when playing song status has changed.
+ */
+void MpCollectionTBoneListDataModel::updateSong()
+{
+ TX_ENTRY
+ int newSongId = mPlaybackData->id();
+
+ if ( mCurrentSongId && newSongId != mCurrentSongId) {
+ //Attempt to remove old song icon.
+ QModelIndex OldSongIndex;
+ OldSongIndex = index( mCollectionData->albumSongIndex( mCurrentSongId ) );
+ if ( OldSongIndex.isValid() ) {
+ emit dataChanged( OldSongIndex, OldSongIndex );
+ }
+ }
+
+ //Attempt to update current song data and state.
+ QModelIndex songIndex;
+ songIndex = index( mCollectionData->albumSongIndex( newSongId ) );
+ if ( songIndex.isValid() ) {
+ emit dataChanged( songIndex, songIndex );
+ }
+ mCurrentSongId = newSongId;
+ TX_EXIT
+}
+
+/*!
+ Slot to be called when playback state has changed.
+ */
+void MpCollectionTBoneListDataModel::updatePlaybackState()
+{
+ //This logic is to account for when song plays the very first time, we get
+ //media before playback is active.
+ bool playbackWasActive = mPlaybackActive;
+ mPlaybackActive = mPlaybackData->playbackState() != MpPlaybackData::NotPlaying;
+ if ( mPlaybackActive && !playbackWasActive ) {
+ updateSong();
+ }
+}
+
+
+//EOF
+
+
--- a/mpdata/src/mpmpxcollectiondata.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpdata/src/mpmpxcollectiondata.cpp Fri May 28 19:46:01 2010 -0500
@@ -158,20 +158,28 @@
/*!
Returns id of the item specified by \a index
*/
-int MpMpxCollectionData::itemId(int index)
+int MpMpxCollectionData::itemId( int index )
{
return d_ptr->itemId(index);
}
/*!
+ Returns id of the album song specified by \a index
+ */
+int MpMpxCollectionData::albumSongId( int index )
+{
+ return d_ptr->albumSongId( index );
+}
+
+/*!
Removes item specified by \a index, also internally caches the item for drag
and drop operations.
\sa testCachedItem() insertCachedItem()
*/
-void MpMpxCollectionData::removeItem(int index)
+void MpMpxCollectionData::removeItem( int index )
{
- d_ptr->removeItem(index);
+ d_ptr->removeItem( index );
}
/*!
@@ -277,7 +285,7 @@
}
/*!
- Returns the index of the iten with \a ItemUniqueId.
+ Returns the index of the item with \a ItemUniqueId.
Only supported for ECollectionContextAlbumsMediaWall.
\sa setContext()
@@ -287,3 +295,15 @@
return d_ptr->itemIndex( itemUniqueId );
}
+/*!
+ Returns the index within the album data for the song with \a songUniqueId.
+
+ */
+int MpMpxCollectionData::albumSongIndex( int songUniqueId )
+{
+ return d_ptr->albumSongIndex( songUniqueId );
+}
+
+//EOF
+
+
--- a/mpdata/src/mpmpxcollectiondata_p.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpdata/src/mpmpxcollectiondata_p.cpp Fri May 28 19:46:01 2010 -0500
@@ -195,16 +195,34 @@
/*!
\internal
*/
-int MpMpxCollectionDataPrivate::itemId(int index)
+int MpMpxCollectionDataPrivate::itemId( int index )
{
- TX_ENTRY_ARGS("index=" << index);
+ TX_ENTRY_ARGS( "index=" << index );
int id = -1;
- TRAPD(err, id = DoGetItemIdL(index));
+ TRAPD( err, id = DoGetItemIdL( index ) );
if ( err == KErrNone ) {
- TX_LOG_ARGS("id=" << id);
+ TX_LOG_ARGS( "id=" << id );
}
else {
- TX_LOG_ARGS("Error: " << err << "; should never get here.");
+ TX_LOG_ARGS( "Error: " << err << "; should never get here." );
+ }
+ TX_EXIT
+ return id;
+}
+
+/*!
+ \internal
+ */
+int MpMpxCollectionDataPrivate::albumSongId( int index )
+{
+ TX_ENTRY_ARGS( "index=" << index );
+ int id = -1;
+ TRAPD( err, id = DoGetAlbumSongIdL( index ) );
+ if ( err == KErrNone ) {
+ TX_LOG_ARGS( "id=" << id );
+ }
+ else {
+ TX_LOG_ARGS( "Error: " << err << "; should never get here." );
}
TX_EXIT
return id;
@@ -408,17 +426,7 @@
{
iContext = context;
TX_LOG_ARGS("Context changed: iContext=" << iContext);
-
- //Clearing all the album ids.
- albumIdIndexMapping.clear();
- if ( iContext == ECollectionContextAlbumsMediaWall) {
- //Adding album ids and indixes to the hash, for itemIndex lookup.
- //This is disabled for other containers to save resources.
- for ( int i = count() - 1 ; i >= 0 ; i-- ) {
- albumIdIndexMapping.insert( itemId( i ) , i );
- }
- }
-
+ loadAlbumsLookup();
emit q_ptr->contextChanged(iContext);
}
@@ -431,6 +439,7 @@
TRAPD(err, DoSetAlbumContentL(albumContent));
if ( err == KErrNone ) {
TX_LOG_ARGS("Album content is available.");
+ loadAlbumSongsLookup();
emit q_ptr->refreshAlbumSongs();
}
else {
@@ -446,7 +455,50 @@
*/
int MpMpxCollectionDataPrivate::itemIndex( int itemUniqueId )
{
- return albumIdIndexMapping.value( itemUniqueId );
+ return albumIdIndexMapping.value( itemUniqueId, -1 );
+}
+
+/*!
+ \internal
+ Currently only used to lookup playing song id to index of song in the
+ current album on media wall.
+ */
+int MpMpxCollectionDataPrivate::albumSongIndex( int songUniqueId )
+{
+ return albumSongIdIndexMapping.value( songUniqueId, -1 );
+}
+
+
+/*!
+ \internal
+ */
+void MpMpxCollectionDataPrivate::loadAlbumsLookup()
+{
+ //Clearing all the album ids.
+ albumIdIndexMapping.clear();
+ if ( iContext == ECollectionContextAlbumsMediaWall) {
+ //Adding album ids and indixes to the hash, for itemIndex lookup.
+ //This is disabled for other containers to save resources.
+ for ( int i = count() - 1 ; i >= 0 ; i-- ) {
+ albumIdIndexMapping.insert( itemId( i ) , i );
+ }
+ }
+}
+
+/*!
+ \internal
+ */
+void MpMpxCollectionDataPrivate::loadAlbumSongsLookup()
+{
+ //Clearing all the song ids.
+ albumSongIdIndexMapping.clear();
+ if ( iContext == ECollectionContextAlbumsMediaWall) {
+ //Adding album song ids and indixes to the hash, for albumSongIndex lookup.
+ //This is disabled for other containers to save resources.
+ for ( int i = albumSongsCount() - 1 ; i >= 0 ; i-- ) {
+ albumSongIdIndexMapping.insert( albumSongId( i ) , i );
+ }
+ }
}
/*!
@@ -588,6 +640,21 @@
/*!
\internal
*/
+int MpMpxCollectionDataPrivate::DoGetAlbumSongIdL( int index )
+{
+ CMPXMedia* album( iMediaArray->AtL( iCurrentAlbumIndex ) );
+ const CMPXMediaArray* songs = album->Value<CMPXMediaArray>(KMPXMediaArrayContents);
+ User::LeaveIfNull(const_cast<CMPXMediaArray*>(songs));
+ CMPXMedia* song = songs->AtL(index);
+ if ( !song->IsSupported( KMPXMediaGeneralId ) ) {
+ User::Leave(KErrNotFound);
+ }
+ return song->ValueTObjectL<TInt>( KMPXMediaGeneralId );
+}
+
+/*!
+ \internal
+ */
void MpMpxCollectionDataPrivate::DoRemoveItemL( int index )
{
delete iCachedRemovedItem;
@@ -624,6 +691,7 @@
iAlbumSongCount = songs->Count();
songsAvailable = true;
TX_LOG_ARGS("Songs available.");
+ loadAlbumSongsLookup();
emit q_ptr->refreshAlbumSongs();
}
TX_EXIT
--- a/mpdata/src/mpplaybackdata.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpdata/src/mpplaybackdata.cpp Fri May 28 19:46:01 2010 -0500
@@ -79,8 +79,6 @@
mReqId( KUndefined ),
mDuration(0),
mPosition(0),
- mAlbum( hbTrId ( "txt_mus_other_unknown4" ) ),
- mArtist( hbTrId ( "txt_mus_other_unknown3") ),
mAlbumId(0),
mId(0),
mAlbumArt( "qtg_large_music_album" ),
@@ -177,7 +175,9 @@
{
TX_ENTRY_ARGS( "artist = " << artist )
bool change = false;
- if ( artist != mArtist ) {
+ // data is different or mArtist was not set befor or it was reset.
+ // When artist is empty and mArtist is empty mArtist should be unknown text.
+ if ( artist != mArtist || mArtist.isNull()) {
change = true;
if ( artist.isEmpty() ){
mArtist = hbTrId( "txt_mus_other_unknown3" );
@@ -206,7 +206,9 @@
{
TX_ENTRY_ARGS( "album = " << album )
bool change = false;
- if ( album != mAlbum ) {
+ // data is different or mAlbum was not set befor or it was reset.
+ // when album is empty and mAlbum is empty mAlbum should be unknown text.
+ if ( album != mAlbum || mAlbum.isNull() ) {
change = true;
if ( album.isEmpty() ){
mAlbum = hbTrId( "txt_mus_other_unknown4" );
@@ -387,6 +389,27 @@
TX_EXIT
}
+/*!
+ Resets the data, currently called when source is removed.
+*/
+void MpPlaybackData::resetData()
+{
+ mDuration = 0;
+ mPosition = 0;
+ mTitle = QString();
+ mAlbum = QString();
+ mArtist = QString();
+ mUri = QString();
+ mAlbumId = 0;
+ mId = 0;
+ mAlbumArt = HbIcon();
+ mRealAudio = false;
+
+ emit durationChanged();
+ emit positionChanged();
+ emit albumArtReady();
+ emit playbackInfoChanged();
+}
/*!
Slot to handle the album art thumb.
--- a/mpdata/src/mpsongdata.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpdata/src/mpsongdata.cpp Fri May 28 19:46:01 2010 -0500
@@ -21,6 +21,7 @@
#include <QPainter>
#include <QBuffer>
#include <QPixmap>
+#include <QTime>
#include <hbicon.h>
#include <QIcon>
#include <QFile>
@@ -89,6 +90,7 @@
if( mThumbnailManager ) {
delete mThumbnailManager;
}
+ removeAlbumArtFile(); // TODO Remove when base64 is working
TX_EXIT
}
@@ -733,7 +735,17 @@
// TODO: this is temporary solution until base64 defect in QT is fixed.
TX_LOG
QByteArray array;
- QFile file( "e:\\album_art.png" );
+
+ // Remove old album art in case new one cannot be written.
+ removeAlbumArtFile();
+
+ QString sTimeStamp = QTime::currentTime().toString( "hhmmsszzz" );
+ QString sTempFileLocation = QString( "e:\\album_art_%1.png" ).arg( sTimeStamp );
+
+ ( ( MpSongData* ) this )->mTempAlbumArt = sTempFileLocation;
+ TX_LOG_ARGS( "Create album art file " << mTempAlbumArt );
+
+ QFile file( mTempAlbumArt );
file.open( QIODevice::WriteOnly );
if ( mAlbumArt && !mAlbumArt->isNull() && !mAlbumArt->qicon().isNull() )
{
@@ -742,6 +754,24 @@
//mAlbumArt->pixmap().save( &file, "PNG" ); // writes pixmap into bytes in PNG format
}
file.close();
- return "e:\\album_art.png";
+ return mTempAlbumArt;
}
+/*!
+ Delete temporary album art file.
+ */
+void MpSongData::removeAlbumArtFile() const
+{
+ TX_ENTRY
+ if ( !mTempAlbumArt.isEmpty() )
+ {
+ TX_LOG_ARGS( "Remove album art file " << mTempAlbumArt );
+ QFile::remove( mTempAlbumArt );
+ ( ( MpSongData* ) this )->mTempAlbumArt = "";
+ }
+ else
+ {
+ TX_LOG_ARGS( "Album art filename is empty" );
+ }
+ TX_EXIT
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mpdata/tsrc/tsrc.pro Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,22 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies 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 = subdirs
+
+SUBDIRS = unittest_mpcollectionalbumartmanager \
+ unittest_mpmpxcollectiondata \
+ unittest_mpcollectiontbonelistdatamodel
+
--- a/mpdata/tsrc/unittest_mpsongdata/UT_mpsongdata.pkg Fri May 14 18:54:37 2010 -0500
+++ b/mpdata/tsrc/unittest_mpsongdata/UT_mpsongdata.pkg Fri May 28 19:46:01 2010 -0500
@@ -1,4 +1,3 @@
-;
; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
; All rights reserved.
; This component and the accompanying materials are made available
@@ -12,7 +11,7 @@
; Contributors:
;
; Description:
-;
+
; Language
&EN
--- a/mpdata/tsrc/unittest_mpsongdata/src/unittest_mpsongdata.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpdata/tsrc/unittest_mpsongdata/src/unittest_mpsongdata.cpp Fri May 28 19:46:01 2010 -0500
@@ -77,7 +77,7 @@
*/
void TestMpSongData::cleanupTestCase()
{
-
+QCoreApplication::processEvents();
}
/*!
--- a/mpdata/tsrc/unittest_mpsongdata/unittest_mpsongdata.pro Fri May 14 18:54:37 2010 -0500
+++ b/mpdata/tsrc/unittest_mpsongdata/unittest_mpsongdata.pro Fri May 28 19:46:01 2010 -0500
@@ -11,7 +11,7 @@
#
# Contributors:
#
-# Description: Unit test for mpsongdata
+# Description:
#
TEMPLATE = app
--- a/mpengine/bwins/mpengineu.def Fri May 14 18:54:37 2010 -0500
+++ b/mpengine/bwins/mpengineu.def Fri May 28 19:46:01 2010 -0500
@@ -56,47 +56,48 @@
?tr@MpEngine@@SA?AVQString@@PBD0@Z @ 55 NONAME ; class QString MpEngine::tr(char const *, char const *)
?disableEqualizer@MpEngine@@QAEXXZ @ 56 NONAME ; void MpEngine::disableEqualizer(void)
?getStaticMetaObject@MpEngine@@SAABUQMetaObject@@XZ @ 57 NONAME ; struct QMetaObject const & MpEngine::getStaticMetaObject(void)
- ?qt_metacast@MpEngineFactory@@UAEPAXPBD@Z @ 58 NONAME ; void * MpEngineFactory::qt_metacast(char const *)
- ?renamePlaylist@MpEngine@@QAEXAAVQString@@@Z @ 59 NONAME ; void MpEngine::renamePlaylist(class QString &)
- ?libraryUpdated@MpEngine@@IAEXXZ @ 60 NONAME ; void MpEngine::libraryUpdated(void)
- ?setRepeat@MpEngine@@QAEX_N@Z @ 61 NONAME ; void MpEngine::setRepeat(bool)
- ?trUtf8@MpEngineFactory@@SA?AVQString@@PBD0@Z @ 62 NONAME ; class QString MpEngineFactory::trUtf8(char const *, char const *)
- ?containerContentsChanged@MpEngine@@IAEXXZ @ 63 NONAME ; void MpEngine::containerContentsChanged(void)
- ?startSeekBackward@MpEngine@@QAEXXZ @ 64 NONAME ; void MpEngine::startSeekBackward(void)
- ?checkForSystemEvents@MpEngine@@QAEXXZ @ 65 NONAME ; void MpEngine::checkForSystemEvents(void)
- ?playPause@MpEngine@@QAEXXZ @ 66 NONAME ; void MpEngine::playPause(void)
- ?playlistsRenamed@MpEngine@@IAEX_N@Z @ 67 NONAME ; void MpEngine::playlistsRenamed(bool)
- ?tr@MpEngineFactory@@SA?AVQString@@PBD0@Z @ 68 NONAME ; class QString MpEngineFactory::tr(char const *, char const *)
- ?applyPreset@MpEngine@@QAEXH@Z @ 69 NONAME ; void MpEngine::applyPreset(int)
- ?playEmbedded@MpEngine@@QAEXABVXQSharableFile@@@Z @ 70 NONAME ; void MpEngine::playEmbedded(class XQSharableFile const &)
- ?trUtf8@MpEngineFactory@@SA?AVQString@@PBD0H@Z @ 71 NONAME ; class QString MpEngineFactory::trUtf8(char const *, char const *, int)
- ?staticMetaObject@MpEngine@@2UQMetaObject@@B @ 72 NONAME ; struct QMetaObject const MpEngine::staticMetaObject
- ?handleUsbMtpStartEvent@MpEngine@@AAEXXZ @ 73 NONAME ; void MpEngine::handleUsbMtpStartEvent(void)
- ?openCollectionItem@MpEngine@@QAEXH@Z @ 74 NONAME ; void MpEngine::openCollectionItem(int)
- ?handleScanStarted@MpEngine@@QAEXXZ @ 75 NONAME ; void MpEngine::handleScanStarted(void)
- ?handleOutstandingNoteClosing@MpEngine@@QAEXXZ @ 76 NONAME ; void MpEngine::handleOutstandingNoteClosing(void)
- ?back@MpEngine@@QAEXXZ @ 77 NONAME ; void MpEngine::back(void)
- ?handleDeleteStarted@MpEngine@@QAEXXZ @ 78 NONAME ; void MpEngine::handleDeleteStarted(void)
- ?activePreset@MpEngine@@QAEHXZ @ 79 NONAME ; int MpEngine::activePreset(void)
- ?handleUsbEvent@MpEngine@@QAEXW4MpxUsbEvents@@@Z @ 80 NONAME ; void MpEngine::handleUsbEvent(enum MpxUsbEvents)
- ?sharedEngine@MpEngineFactory@@SAPAVMpEngine@@XZ @ 81 NONAME ; class MpEngine * MpEngineFactory::sharedEngine(void)
- ?handleUsbMassStorageStartEvent@MpEngine@@AAEXXZ @ 82 NONAME ; void MpEngine::handleUsbMassStorageStartEvent(void)
- ?balance@MpEngine@@QAEHXZ @ 83 NONAME ; int MpEngine::balance(void)
- ?handleDiskEvent@MpEngine@@QAEXW4MpxDiskEvents@@@Z @ 84 NONAME ; void MpEngine::handleDiskEvent(enum MpxDiskEvents)
- ?verifyUsbBlocking@MpEngine@@QAE_N_N@Z @ 85 NONAME ; bool MpEngine::verifyUsbBlocking(bool)
- ?handleUsbMassStorageEndEvent@MpEngine@@AAEXXZ @ 86 NONAME ; void MpEngine::handleUsbMassStorageEndEvent(void)
- ?handleDeleteEnded@MpEngine@@QAEXXZ @ 87 NONAME ; void MpEngine::handleDeleteEnded(void)
- ?createSharedEngine@MpEngineFactory@@SAPAVMpEngine@@VTUid@@W4EngineMode@2@@Z @ 88 NONAME ; class MpEngine * MpEngineFactory::createSharedEngine(class TUid, enum MpEngine::EngineMode)
- ?usbBlocked@MpEngine@@IAEX_N@Z @ 89 NONAME ; void MpEngine::usbBlocked(bool)
- ?getStaticMetaObject@MpEngineFactory@@SAABUQMetaObject@@XZ @ 90 NONAME ; struct QMetaObject const & MpEngineFactory::getStaticMetaObject(void)
- ??0MpEngine@@AAE@XZ @ 91 NONAME ; MpEngine::MpEngine(void)
- ?handleUsbMtpNotActive@MpEngine@@AAEXXZ @ 92 NONAME ; void MpEngine::handleUsbMtpNotActive(void)
- ?isolatedCollectionOpened@MpEngine@@IAEXPAVMpMpxCollectionData@@@Z @ 93 NONAME ; void MpEngine::isolatedCollectionOpened(class MpMpxCollectionData *)
- ?handleScanEnded@MpEngine@@QAEXHH@Z @ 94 NONAME ; void MpEngine::handleScanEnded(int, int)
- ?skipBackward@MpEngine@@QAEXXZ @ 95 NONAME ; void MpEngine::skipBackward(void)
- ??_EMpEngine@@UAE@I@Z @ 96 NONAME ; MpEngine::~MpEngine(unsigned int)
- ??1MpEngine@@UAE@XZ @ 97 NONAME ; MpEngine::~MpEngine(void)
- ?changeUsbBlockingState@MpEngine@@AAEXW4UsbBlockingState@1@@Z @ 98 NONAME ; void MpEngine::changeUsbBlockingState(enum MpEngine::UsbBlockingState)
- ?setLoudness@MpEngine@@QAEX_N@Z @ 99 NONAME ; void MpEngine::setLoudness(bool)
- ?reorderPlaylist@MpEngine@@QAEXHHHH@Z @ 100 NONAME ; void MpEngine::reorderPlaylist(int, int, int, int)
+ ?shuffleAll@MpEngine@@QAEXXZ @ 58 NONAME ; void MpEngine::shuffleAll(void)
+ ?qt_metacast@MpEngineFactory@@UAEPAXPBD@Z @ 59 NONAME ; void * MpEngineFactory::qt_metacast(char const *)
+ ?renamePlaylist@MpEngine@@QAEXAAVQString@@@Z @ 60 NONAME ; void MpEngine::renamePlaylist(class QString &)
+ ?libraryUpdated@MpEngine@@IAEXXZ @ 61 NONAME ; void MpEngine::libraryUpdated(void)
+ ?setRepeat@MpEngine@@QAEX_N@Z @ 62 NONAME ; void MpEngine::setRepeat(bool)
+ ?trUtf8@MpEngineFactory@@SA?AVQString@@PBD0@Z @ 63 NONAME ; class QString MpEngineFactory::trUtf8(char const *, char const *)
+ ?containerContentsChanged@MpEngine@@IAEXXZ @ 64 NONAME ; void MpEngine::containerContentsChanged(void)
+ ?startSeekBackward@MpEngine@@QAEXXZ @ 65 NONAME ; void MpEngine::startSeekBackward(void)
+ ?checkForSystemEvents@MpEngine@@QAEXXZ @ 66 NONAME ; void MpEngine::checkForSystemEvents(void)
+ ?playPause@MpEngine@@QAEXXZ @ 67 NONAME ; void MpEngine::playPause(void)
+ ?playlistsRenamed@MpEngine@@IAEX_N@Z @ 68 NONAME ; void MpEngine::playlistsRenamed(bool)
+ ?tr@MpEngineFactory@@SA?AVQString@@PBD0@Z @ 69 NONAME ; class QString MpEngineFactory::tr(char const *, char const *)
+ ?applyPreset@MpEngine@@QAEXH@Z @ 70 NONAME ; void MpEngine::applyPreset(int)
+ ?playEmbedded@MpEngine@@QAEXABVXQSharableFile@@@Z @ 71 NONAME ; void MpEngine::playEmbedded(class XQSharableFile const &)
+ ?trUtf8@MpEngineFactory@@SA?AVQString@@PBD0H@Z @ 72 NONAME ; class QString MpEngineFactory::trUtf8(char const *, char const *, int)
+ ?staticMetaObject@MpEngine@@2UQMetaObject@@B @ 73 NONAME ; struct QMetaObject const MpEngine::staticMetaObject
+ ?handleUsbMtpStartEvent@MpEngine@@AAEXXZ @ 74 NONAME ; void MpEngine::handleUsbMtpStartEvent(void)
+ ?openCollectionItem@MpEngine@@QAEXH@Z @ 75 NONAME ; void MpEngine::openCollectionItem(int)
+ ?handleScanStarted@MpEngine@@QAEXXZ @ 76 NONAME ; void MpEngine::handleScanStarted(void)
+ ?handleOutstandingNoteClosing@MpEngine@@QAEXXZ @ 77 NONAME ; void MpEngine::handleOutstandingNoteClosing(void)
+ ?back@MpEngine@@QAEXXZ @ 78 NONAME ; void MpEngine::back(void)
+ ?handleDeleteStarted@MpEngine@@QAEXXZ @ 79 NONAME ; void MpEngine::handleDeleteStarted(void)
+ ?activePreset@MpEngine@@QAEHXZ @ 80 NONAME ; int MpEngine::activePreset(void)
+ ?handleUsbEvent@MpEngine@@QAEXW4MpxUsbEvents@@@Z @ 81 NONAME ; void MpEngine::handleUsbEvent(enum MpxUsbEvents)
+ ?sharedEngine@MpEngineFactory@@SAPAVMpEngine@@XZ @ 82 NONAME ; class MpEngine * MpEngineFactory::sharedEngine(void)
+ ?handleUsbMassStorageStartEvent@MpEngine@@AAEXXZ @ 83 NONAME ; void MpEngine::handleUsbMassStorageStartEvent(void)
+ ?balance@MpEngine@@QAEHXZ @ 84 NONAME ; int MpEngine::balance(void)
+ ?handleDiskEvent@MpEngine@@QAEXW4MpxDiskEvents@@@Z @ 85 NONAME ; void MpEngine::handleDiskEvent(enum MpxDiskEvents)
+ ?verifyUsbBlocking@MpEngine@@QAE_N_N@Z @ 86 NONAME ; bool MpEngine::verifyUsbBlocking(bool)
+ ?handleUsbMassStorageEndEvent@MpEngine@@AAEXXZ @ 87 NONAME ; void MpEngine::handleUsbMassStorageEndEvent(void)
+ ?handleDeleteEnded@MpEngine@@QAEXXZ @ 88 NONAME ; void MpEngine::handleDeleteEnded(void)
+ ?createSharedEngine@MpEngineFactory@@SAPAVMpEngine@@VTUid@@W4EngineMode@2@@Z @ 89 NONAME ; class MpEngine * MpEngineFactory::createSharedEngine(class TUid, enum MpEngine::EngineMode)
+ ?usbBlocked@MpEngine@@IAEX_N@Z @ 90 NONAME ; void MpEngine::usbBlocked(bool)
+ ?getStaticMetaObject@MpEngineFactory@@SAABUQMetaObject@@XZ @ 91 NONAME ; struct QMetaObject const & MpEngineFactory::getStaticMetaObject(void)
+ ??0MpEngine@@AAE@XZ @ 92 NONAME ; MpEngine::MpEngine(void)
+ ?handleUsbMtpNotActive@MpEngine@@AAEXXZ @ 93 NONAME ; void MpEngine::handleUsbMtpNotActive(void)
+ ?isolatedCollectionOpened@MpEngine@@IAEXPAVMpMpxCollectionData@@@Z @ 94 NONAME ; void MpEngine::isolatedCollectionOpened(class MpMpxCollectionData *)
+ ?handleScanEnded@MpEngine@@QAEXHH@Z @ 95 NONAME ; void MpEngine::handleScanEnded(int, int)
+ ?skipBackward@MpEngine@@QAEXXZ @ 96 NONAME ; void MpEngine::skipBackward(void)
+ ??_EMpEngine@@UAE@I@Z @ 97 NONAME ; MpEngine::~MpEngine(unsigned int)
+ ??1MpEngine@@UAE@XZ @ 98 NONAME ; MpEngine::~MpEngine(void)
+ ?changeUsbBlockingState@MpEngine@@AAEXW4UsbBlockingState@1@@Z @ 99 NONAME ; void MpEngine::changeUsbBlockingState(enum MpEngine::UsbBlockingState)
+ ?setLoudness@MpEngine@@QAEX_N@Z @ 100 NONAME ; void MpEngine::setLoudness(bool)
+ ?reorderPlaylist@MpEngine@@QAEXHHHH@Z @ 101 NONAME ; void MpEngine::reorderPlaylist(int, int, int, int)
--- a/mpengine/eabi/mpengineu.def Fri May 14 18:54:37 2010 -0500
+++ b/mpengine/eabi/mpengineu.def Fri May 28 19:46:01 2010 -0500
@@ -16,87 +16,88 @@
_ZN8MpEngine10initializeE4TUidNS_10EngineModeE @ 15 NONAME
_ZN8MpEngine10setBalanceEi @ 16 NONAME
_ZN8MpEngine10setShuffleEb @ 17 NONAME
- _ZN8MpEngine10usbBlockedEb @ 18 NONAME
- _ZN8MpEngine11applyPresetEi @ 19 NONAME
- _ZN8MpEngine11deleteSongsER5QListIiE @ 20 NONAME
- _ZN8MpEngine11presetNamesEv @ 21 NONAME
- _ZN8MpEngine11previewItemEi @ 22 NONAME
- _ZN8MpEngine11qt_metacallEN11QMetaObject4CallEiPPv @ 23 NONAME
- _ZN8MpEngine11qt_metacastEPKc @ 24 NONAME
- _ZN8MpEngine11setLoudnessEb @ 25 NONAME
- _ZN8MpEngine11setPositionEi @ 26 NONAME
- _ZN8MpEngine11skipForwardEv @ 27 NONAME
- _ZN8MpEngine11stopSeekingEv @ 28 NONAME
- _ZN8MpEngine12activePresetEv @ 29 NONAME
- _ZN8MpEngine12playEmbeddedE7QString @ 30 NONAME
- _ZN8MpEngine12playEmbeddedERK14XQSharableFile @ 31 NONAME
- _ZN8MpEngine12playbackDataEv @ 32 NONAME
- _ZN8MpEngine12retrieveSongEv @ 33 NONAME
- _ZN8MpEngine12skipBackwardEv @ 34 NONAME
- _ZN8MpEngine12songsDeletedEb @ 35 NONAME
- _ZN8MpEngine13findPlaylistsER11QStringList @ 36 NONAME
- _ZN8MpEngine13playlistSavedEb @ 37 NONAME
- _ZN8MpEngine14collectionDataEv @ 38 NONAME
- _ZN8MpEngine14createPlaylistER7QStringR5QListIiEP19MpMpxCollectionData @ 39 NONAME
- _ZN8MpEngine14equalizerReadyEv @ 40 NONAME
- _ZN8MpEngine14findAlbumSongsEi @ 41 NONAME
- _ZN8MpEngine14handleUsbEventE12MpxUsbEvents @ 42 NONAME
- _ZN8MpEngine14libraryUpdatedEv @ 43 NONAME
- _ZN8MpEngine14openCollectionE18TCollectionContext @ 44 NONAME
- _ZN8MpEngine14playAlbumSongsEiiP19MpMpxCollectionData @ 45 NONAME
- _ZN8MpEngine14refreshLibraryEv @ 46 NONAME
- _ZN8MpEngine14renamePlaylistER7QString @ 47 NONAME
- _ZN8MpEngine14renamePlaylistER7QStringi @ 48 NONAME
- _ZN8MpEngine14saveToPlaylistEiR5QListIiE @ 49 NONAME
- _ZN8MpEngine15handleDiskEventE13MpxDiskEvents @ 50 NONAME
- _ZN8MpEngine15handleScanEndedEii @ 51 NONAME
- _ZN8MpEngine15reorderPlaylistEiiii @ 52 NONAME
- _ZN8MpEngine16disableEqualizerEv @ 53 NONAME
- _ZN8MpEngine16playlistsRenamedEb @ 54 NONAME
- _ZN8MpEngine16reopenCollectionEv @ 55 NONAME
- _ZN8MpEngine16startSeekForwardEv @ 56 NONAME
- _ZN8MpEngine16staticMetaObjectE @ 57 NONAME DATA 16
- _ZN8MpEngine17handleDeleteEndedEv @ 58 NONAME
- _ZN8MpEngine17handleScanStartedEv @ 59 NONAME
- _ZN8MpEngine17startSeekBackwardEv @ 60 NONAME
- _ZN8MpEngine17verifyUsbBlockingEb @ 61 NONAME
- _ZN8MpEngine18launchBlockingNoteEv @ 62 NONAME
- _ZN8MpEngine18openCollectionItemEi @ 63 NONAME
- _ZN8MpEngine19getStaticMetaObjectEv @ 64 NONAME
- _ZN8MpEngine19handleDeleteStartedEv @ 65 NONAME
- _ZN8MpEngine19setOutstandingPopupEP7HbPopup @ 66 NONAME
- _ZN8MpEngine20checkForSystemEventsEv @ 67 NONAME
- _ZN8MpEngine20handleEqualizerReadyEv @ 68 NONAME
- _ZN8MpEngine20handleUsbMtpEndEventEv @ 69 NONAME
- _ZN8MpEngine20libraryAboutToUpdateEv @ 70 NONAME
- _ZN8MpEngine21handleUsbMtpNotActiveEv @ 71 NONAME
- _ZN8MpEngine21saveToCurrentPlaylistER5QListIiEP19MpMpxCollectionData @ 72 NONAME
- _ZN8MpEngine22changeUsbBlockingStateENS_16UsbBlockingStateE @ 73 NONAME
- _ZN8MpEngine22handleUsbMtpStartEventEv @ 74 NONAME
- _ZN8MpEngine22openIsolatedCollectionE18TCollectionContext @ 75 NONAME
- _ZN8MpEngine24collectionPlaylistOpenedEv @ 76 NONAME
- _ZN8MpEngine24containerContentsChangedEv @ 77 NONAME
- _ZN8MpEngine24isolatedCollectionOpenedEP19MpMpxCollectionData @ 78 NONAME
- _ZN8MpEngine25releaseIsolatedCollectionEv @ 79 NONAME
- _ZN8MpEngine28handleOutstandingNoteClosingEv @ 80 NONAME
- _ZN8MpEngine28handleUsbMassStorageEndEventEv @ 81 NONAME
- _ZN8MpEngine30handleUsbMassStorageStartEventEv @ 82 NONAME
- _ZN8MpEngine4backEv @ 83 NONAME
- _ZN8MpEngine4stopEv @ 84 NONAME
- _ZN8MpEngine7balanceEv @ 85 NONAME
- _ZN8MpEngine8loudnessEv @ 86 NONAME
- _ZN8MpEngine8songDataEv @ 87 NONAME
- _ZN8MpEngine9playPauseEv @ 88 NONAME
- _ZN8MpEngine9setRepeatEb @ 89 NONAME
- _ZN8MpEngineC1Ev @ 90 NONAME
- _ZN8MpEngineC2Ev @ 91 NONAME
- _ZN8MpEngineD0Ev @ 92 NONAME
- _ZN8MpEngineD1Ev @ 93 NONAME
- _ZN8MpEngineD2Ev @ 94 NONAME
- _ZNK15MpEngineFactory10metaObjectEv @ 95 NONAME
- _ZNK8MpEngine10metaObjectEv @ 96 NONAME
- _ZTI15MpEngineFactory @ 97 NONAME
- _ZTI8MpEngine @ 98 NONAME
- _ZTV15MpEngineFactory @ 99 NONAME
- _ZTV8MpEngine @ 100 NONAME
+ _ZN8MpEngine10shuffleAllEv @ 18 NONAME
+ _ZN8MpEngine10usbBlockedEb @ 19 NONAME
+ _ZN8MpEngine11applyPresetEi @ 20 NONAME
+ _ZN8MpEngine11deleteSongsER5QListIiE @ 21 NONAME
+ _ZN8MpEngine11presetNamesEv @ 22 NONAME
+ _ZN8MpEngine11previewItemEi @ 23 NONAME
+ _ZN8MpEngine11qt_metacallEN11QMetaObject4CallEiPPv @ 24 NONAME
+ _ZN8MpEngine11qt_metacastEPKc @ 25 NONAME
+ _ZN8MpEngine11setLoudnessEb @ 26 NONAME
+ _ZN8MpEngine11setPositionEi @ 27 NONAME
+ _ZN8MpEngine11skipForwardEv @ 28 NONAME
+ _ZN8MpEngine11stopSeekingEv @ 29 NONAME
+ _ZN8MpEngine12activePresetEv @ 30 NONAME
+ _ZN8MpEngine12playEmbeddedE7QString @ 31 NONAME
+ _ZN8MpEngine12playEmbeddedERK14XQSharableFile @ 32 NONAME
+ _ZN8MpEngine12playbackDataEv @ 33 NONAME
+ _ZN8MpEngine12retrieveSongEv @ 34 NONAME
+ _ZN8MpEngine12skipBackwardEv @ 35 NONAME
+ _ZN8MpEngine12songsDeletedEb @ 36 NONAME
+ _ZN8MpEngine13findPlaylistsER11QStringList @ 37 NONAME
+ _ZN8MpEngine13playlistSavedEb @ 38 NONAME
+ _ZN8MpEngine14collectionDataEv @ 39 NONAME
+ _ZN8MpEngine14createPlaylistER7QStringR5QListIiEP19MpMpxCollectionData @ 40 NONAME
+ _ZN8MpEngine14equalizerReadyEv @ 41 NONAME
+ _ZN8MpEngine14findAlbumSongsEi @ 42 NONAME
+ _ZN8MpEngine14handleUsbEventE12MpxUsbEvents @ 43 NONAME
+ _ZN8MpEngine14libraryUpdatedEv @ 44 NONAME
+ _ZN8MpEngine14openCollectionE18TCollectionContext @ 45 NONAME
+ _ZN8MpEngine14playAlbumSongsEiiP19MpMpxCollectionData @ 46 NONAME
+ _ZN8MpEngine14refreshLibraryEv @ 47 NONAME
+ _ZN8MpEngine14renamePlaylistER7QString @ 48 NONAME
+ _ZN8MpEngine14renamePlaylistER7QStringi @ 49 NONAME
+ _ZN8MpEngine14saveToPlaylistEiR5QListIiE @ 50 NONAME
+ _ZN8MpEngine15handleDiskEventE13MpxDiskEvents @ 51 NONAME
+ _ZN8MpEngine15handleScanEndedEii @ 52 NONAME
+ _ZN8MpEngine15reorderPlaylistEiiii @ 53 NONAME
+ _ZN8MpEngine16disableEqualizerEv @ 54 NONAME
+ _ZN8MpEngine16playlistsRenamedEb @ 55 NONAME
+ _ZN8MpEngine16reopenCollectionEv @ 56 NONAME
+ _ZN8MpEngine16startSeekForwardEv @ 57 NONAME
+ _ZN8MpEngine16staticMetaObjectE @ 58 NONAME DATA 16
+ _ZN8MpEngine17handleDeleteEndedEv @ 59 NONAME
+ _ZN8MpEngine17handleScanStartedEv @ 60 NONAME
+ _ZN8MpEngine17startSeekBackwardEv @ 61 NONAME
+ _ZN8MpEngine17verifyUsbBlockingEb @ 62 NONAME
+ _ZN8MpEngine18launchBlockingNoteEv @ 63 NONAME
+ _ZN8MpEngine18openCollectionItemEi @ 64 NONAME
+ _ZN8MpEngine19getStaticMetaObjectEv @ 65 NONAME
+ _ZN8MpEngine19handleDeleteStartedEv @ 66 NONAME
+ _ZN8MpEngine19setOutstandingPopupEP7HbPopup @ 67 NONAME
+ _ZN8MpEngine20checkForSystemEventsEv @ 68 NONAME
+ _ZN8MpEngine20handleEqualizerReadyEv @ 69 NONAME
+ _ZN8MpEngine20handleUsbMtpEndEventEv @ 70 NONAME
+ _ZN8MpEngine20libraryAboutToUpdateEv @ 71 NONAME
+ _ZN8MpEngine21handleUsbMtpNotActiveEv @ 72 NONAME
+ _ZN8MpEngine21saveToCurrentPlaylistER5QListIiEP19MpMpxCollectionData @ 73 NONAME
+ _ZN8MpEngine22changeUsbBlockingStateENS_16UsbBlockingStateE @ 74 NONAME
+ _ZN8MpEngine22handleUsbMtpStartEventEv @ 75 NONAME
+ _ZN8MpEngine22openIsolatedCollectionE18TCollectionContext @ 76 NONAME
+ _ZN8MpEngine24collectionPlaylistOpenedEv @ 77 NONAME
+ _ZN8MpEngine24containerContentsChangedEv @ 78 NONAME
+ _ZN8MpEngine24isolatedCollectionOpenedEP19MpMpxCollectionData @ 79 NONAME
+ _ZN8MpEngine25releaseIsolatedCollectionEv @ 80 NONAME
+ _ZN8MpEngine28handleOutstandingNoteClosingEv @ 81 NONAME
+ _ZN8MpEngine28handleUsbMassStorageEndEventEv @ 82 NONAME
+ _ZN8MpEngine30handleUsbMassStorageStartEventEv @ 83 NONAME
+ _ZN8MpEngine4backEv @ 84 NONAME
+ _ZN8MpEngine4stopEv @ 85 NONAME
+ _ZN8MpEngine7balanceEv @ 86 NONAME
+ _ZN8MpEngine8loudnessEv @ 87 NONAME
+ _ZN8MpEngine8songDataEv @ 88 NONAME
+ _ZN8MpEngine9playPauseEv @ 89 NONAME
+ _ZN8MpEngine9setRepeatEb @ 90 NONAME
+ _ZN8MpEngineC1Ev @ 91 NONAME
+ _ZN8MpEngineC2Ev @ 92 NONAME
+ _ZN8MpEngineD0Ev @ 93 NONAME
+ _ZN8MpEngineD1Ev @ 94 NONAME
+ _ZN8MpEngineD2Ev @ 95 NONAME
+ _ZNK15MpEngineFactory10metaObjectEv @ 96 NONAME
+ _ZNK8MpEngine10metaObjectEv @ 97 NONAME
+ _ZTI15MpEngineFactory @ 98 NONAME
+ _ZTI8MpEngine @ 99 NONAME
+ _ZTV15MpEngineFactory @ 100 NONAME
+ _ZTV8MpEngine @ 101 NONAME
--- a/mpengine/inc/mpaudioeffectsframeworkwrapper.h Fri May 14 18:54:37 2010 -0500
+++ b/mpengine/inc/mpaudioeffectsframeworkwrapper.h Fri May 28 19:46:01 2010 -0500
@@ -1,4 +1,11 @@
/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
--- a/mpengine/inc/mpmpxcollectionframeworkwrapper.h Fri May 14 18:54:37 2010 -0500
+++ b/mpengine/inc/mpmpxcollectionframeworkwrapper.h Fri May 28 19:46:01 2010 -0500
@@ -65,6 +65,8 @@
void reorderPlaylist( int playlistId, int songId, int originalOrdinal, int newOrdinal );
void setRepeatFeatureEnabled( bool enable );
void setShuffleFeatureEnabled( bool enable );
+
+ void openShuffleAllSongsPath();
signals:
--- a/mpengine/inc/mpmpxcollectionframeworkwrapper_p.h Fri May 14 18:54:37 2010 -0500
+++ b/mpengine/inc/mpmpxcollectionframeworkwrapper_p.h Fri May 28 19:46:01 2010 -0500
@@ -81,9 +81,10 @@
void playAlbumSongs( int albumIndex, int songIndex, MpMpxCollectionData* collectionData );
void setRepeatFeatureEnabled( bool enable );
void setShuffleFeatureEnabled( bool enable );
- void cancel();
-
+ void cancel();
+
MpMpxCollectionData *collectionData();
+ void openShuffleAllSongsPath();
private:
@@ -127,6 +128,7 @@
void PreparePlaylistMediaL( CMPXMedia& aMedia, QList<int> &selection, MpMpxCollectionData *collectionData );
void createPlaybackUtilityL();
+ void DoPlayAllSongsPlaylistL();
private:
@@ -146,6 +148,7 @@
TBool iRepeatFeature;
TBool iShuffleFeature;
TBool iReopen;
+ TBool iShuffleAll;
};
--- a/mpengine/mpengine.pro Fri May 14 18:54:37 2010 -0500
+++ b/mpengine/mpengine.pro Fri May 28 19:46:01 2010 -0500
@@ -42,7 +42,14 @@
-lxqserviceutil \
-laudioequalizerutility.dll
-symbian:TARGET.EPOCALLOWDLLDATA = 1
+symbian:
+{
+ TARGET.EPOCALLOWDLLDATA = 1
+
+ BLD_INF_RULES.prj_exports += \
+ "resources/nullsound.mp3 /epoc32/release/winscw/udeb/Z/system/data/nullsound.mp3" \
+ "resources/nullsound.mp3 /epoc32/data/Z/system/data/nullsound.mp3"
+}
HEADERS += ../inc/mpenginefactory.h \
../inc/mpengine.h \
@@ -93,3 +100,4 @@
"DEFFILE eabi/mpengineu.def "\
"$${LITERAL_HASH}endif"
MMP_RULES += myDefInclude
+
Binary file mpengine/resources/nullsound.mp3 has changed
--- a/mpengine/rom/mpengine.iby Fri May 14 18:54:37 2010 -0500
+++ b/mpengine/rom/mpengine.iby Fri May 28 19:46:01 2010 -0500
@@ -22,4 +22,6 @@
file=ABI_DIR\BUILD_DIR\mpengine.dll SHARED_LIB_DIR\mpengine.dll
+data=ZSYSTEM\data\nullsound.mp3 system\data\nullsound.mp3
+
#endif
\ No newline at end of file
--- a/mpengine/src/mpengine.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpengine/src/mpengine.cpp Fri May 28 19:46:01 2010 -0500
@@ -802,6 +802,15 @@
{
return mMpxPlaybackWrapper->playbackData();
}
+
+/*!
+ Requests playback of all songs with shuffle enabled
+ */
+void MpEngine::shuffleAll()
+{
+ mMpxCollectionWrapper->openShuffleAllSongsPath();
+}
+
/*!
Slot to be called to request embedded playback of item with Uri aFilename
*/
@@ -1032,7 +1041,9 @@
// Get preset id from cenrep
TInt presetKey( MpSettingsManager::preset() );
+ //Set the current preset index. 1 is added to index because index 0 represent "Off" at UI level.
mCurrentPresetIndex = mEqualizerWrapper->getPresetIndex( presetKey );
+ mCurrentPresetIndex++;
emit equalizerReady();
TX_EXIT
--- a/mpengine/src/mpequalizerframeworkwrapper_p.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpengine/src/mpequalizerframeworkwrapper_p.cpp Fri May 28 19:46:01 2010 -0500
@@ -29,7 +29,7 @@
#include "mptrace.h"
// CONSTANTS
-_LIT( KMPXNullSoundPath, "\\nullsound.mp3" );
+_LIT( KMPXNullSoundPath, "\\system\\data\\nullsound.mp3" );
/*!
\class MpEqualizerFrameworkWrapperPrivate
--- a/mpengine/src/mpmpxcollectionframeworkwrapper.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpengine/src/mpmpxcollectionframeworkwrapper.cpp Fri May 28 19:46:01 2010 -0500
@@ -280,6 +280,13 @@
}
/*!
+ Called to open all songs path and trigger shuffle all songs play
+ */
+void MpMpxCollectionFrameworkWrapper::openShuffleAllSongsPath()
+{
+ d_ptr->openShuffleAllSongsPath();
+}
+/*!
Cancels CollectionUiHelper request.
*/
void MpMpxCollectionFrameworkWrapper::cancelRequest()
--- a/mpengine/src/mpmpxcollectionframeworkwrapper_p.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpengine/src/mpmpxcollectionframeworkwrapper_p.cpp Fri May 28 19:46:01 2010 -0500
@@ -81,7 +81,8 @@
iUserPlaylists( 0 ),
iRepeatFeature( ETrue ),
iShuffleFeature( ETrue ),
- iReopen( EFalse )
+ iReopen( EFalse ),
+ iShuffleAll( EFalse )
{
TX_LOG
}
@@ -365,6 +366,22 @@
/*!
\internal
+ */
+void MpMpxCollectionFrameworkWrapperPrivate::openShuffleAllSongsPath()
+{
+ TX_ENTRY
+ TRAPD( err, DoOpenCollectionL(ECollectionContextAllSongs) );
+ if ( err != KErrNone ) {
+ TX_LOG_ARGS( "Error: " << err << "; should never get here." );
+ }
+ else {
+ iShuffleAll = ETrue;
+ }
+ TX_EXIT
+}
+
+/*!
+ \internal
Result of open or re-open operation to the Collection Framework.
*/
void MpMpxCollectionFrameworkWrapperPrivate::HandleOpenL(
@@ -378,8 +395,14 @@
TX_ENTRY_ARGS( "aError=" << aError << "aComplete=" << aComplete );
if ( aError == KErrNone ) {
if ( iFirstIncrementalOpen ) {
+ iFirstIncrementalOpen = EFalse;
+ if( iShuffleAll ) {
+ iShuffleAll = EFalse;
+ TX_ENTRY_ARGS( "Path is ready" );
+ DoPlayAllSongsPlaylistL();
+
+ }
iCollectionData->setMpxMedia( aEntries, iReopen );
- iFirstIncrementalOpen = EFalse;
iReopen = EFalse;
}
}
@@ -1253,4 +1276,24 @@
}
}
+/*!
+ \internal
+ */
+void MpMpxCollectionFrameworkWrapperPrivate::DoPlayAllSongsPlaylistL()
+{
+ TX_ENTRY
+ CMPXCollectionPath* cpath = iCollectionUtility->Collection().PathL();
+ CleanupStack::PushL( cpath );
+ CMPXCollectionPlaylist* playList = CMPXCollectionPlaylist::NewL( *cpath );
+ CleanupStack::PushL( playList );
+ playList->SetShuffleL( true, false );
+ MpSettingsManager::setShuffle( true );
+ createPlaybackUtilityL();
+ iPlaybackUtility->InitL( *playList, ETrue );
+ CleanupStack::PopAndDestroy( playList );
+ CleanupStack::PopAndDestroy( cpath );
+ TX_EXIT
+}
+
+
//EOF
--- a/mpengine/src/mpmpxplaybackframeworkwrapper.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpengine/src/mpmpxplaybackframeworkwrapper.cpp Fri May 28 19:46:01 2010 -0500
@@ -55,7 +55,7 @@
}
/*!
- Slot to handle a play from Uri aFilename
+ Slot to handle play from Uri aFilename
*/
void MpMpxPlaybackFrameworkWrapper::play( QString aFilename )
{
@@ -63,7 +63,7 @@
}
/*!
- Slot to handle a play from file handle
+ Slot to handle play from file handle
*/
void MpMpxPlaybackFrameworkWrapper::play( const XQSharableFile& file)
{
--- a/mpengine/src/mpmpxplaybackframeworkwrapper_p.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpengine/src/mpmpxplaybackframeworkwrapper_p.cpp Fri May 28 19:46:01 2010 -0500
@@ -64,8 +64,8 @@
TX_ENTRY
if ( iPlaybackUtility ) {
- ForceStopL();
- iPlaybackUtility->RemoveObserverL(*this);
+ TRAP_IGNORE( ForceStopL() );
+ TRAP_IGNORE( iPlaybackUtility->RemoveObserverL(*this) );
iPlaybackUtility->Close();
}
@@ -379,7 +379,7 @@
aProperties.ValueText( KMPXMediaMusicArtist ).Length() ) );
}
else {
- changed |= iPlaybackData->setArtist(hbTrId("txt_mus_other_unknown3"));
+ changed |= iPlaybackData->setArtist(QString());
}
if ( aProperties.IsSupported( KMPXMediaMusicAlbum ) ) {
changed |= iPlaybackData->setAlbum(
@@ -388,7 +388,7 @@
aProperties.ValueText( KMPXMediaMusicAlbum ).Length() ) );
}
else {
- changed |= iPlaybackData->setAlbum(hbTrId("txt_mus_other_unknown4"));
+ changed |= iPlaybackData->setAlbum(QString());
}
if (aProperties.IsSupported(TMPXAttribute(KMPXMediaGeneralMimeType))) {
@@ -480,13 +480,12 @@
if ( ok ) {
iPlaybackUtility->InitL( xqfile );
}
- else {
- TX_LOG_ARGS("Error: " << ok << "; should never get here.");
- }
-
-
+ else {
+ TX_LOG_ARGS("Error: " << ok << "; should never get here.");
+ }
TX_EXIT
}
+
/*!
\internal
*/
@@ -565,8 +564,6 @@
cmd->SetTObjectValueL<TBool>( KMPXCommandPlaybackGeneralNoBuffer, ETrue );
iPlaybackUtility->CommandL( *cmd );
CleanupStack::PopAndDestroy( cmd );
-
- // iPlaybackUtility->RemoveObserverL(*this);
}
TX_EXIT
}
@@ -579,7 +576,11 @@
TX_ENTRY
if ( !iPlaybackUtility->Source() ) {
TX_LOG_ARGS("There is no source")
- iPlaybackData->setPlaybackState( MpPlaybackData::NotPlaying );
+ //this to prevent mutiple calls to state change.
+ if ( iPlaybackData->playbackState() != MpPlaybackData::NotPlaying ) {
+ iPlaybackData->setPlaybackState( MpPlaybackData::NotPlaying );
+ iPlaybackData->resetData();
+ }
}
else {
switch ( iPlaybackUtility->StateL() ) {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mpengine/tsrc/tsrc.pro Fri May 28 19:46:01 2010 -0500
@@ -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:
+#
+
+TEMPLATE = subdirs
+
+SUBDIRS = unittest_mpaudioeffectsframeworkwrapper \
+ unittest_mpequalizerframeworkwrapper \
+ unittest_mpmpxcollectionframeworkwrapper \
+ unittest_mpmpxharvesterframeworkwrapper \
+ unittest_mpmpxisolatedcollectionhelper \
+ unittest_mpmpxplaybackframeworkwrapper
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mpengine/tsrc/unittest_mpaudioeffectsframeworkwrapper/inc/unittest_mpaudioeffectsframeworkwrapper.h Fri May 28 19:46:01 2010 -0500
@@ -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: Unit test for mpaudioeffectsframeworkwrapper
+*
+*/
+
+#ifndef TESTMPAUDIOEFFECTSFRAMEWORKWRAPPER_H
+#define TESTMPAUDIOEFFECTSFRAMEWORKWRAPPER_H
+
+#include <QtTest/QtTest>
+
+class MpAudioEffectsFrameworkWrapper;
+class MpAudioEffectsFrameworkWrapperPrivate;
+
+class TestMpAudioEffectsFrameworkWrapper : public QObject
+{
+ Q_OBJECT
+
+public:
+ TestMpAudioEffectsFrameworkWrapper();
+ virtual ~TestMpAudioEffectsFrameworkWrapper();
+
+public slots:
+ void initTestCase();
+ void cleanupTestCase();
+ void init();
+ void cleanup();
+
+private slots:
+ void testConstructor();
+ void testInit();
+ void testBalance();
+ void testLoudness();
+ void testSetBalance();
+ void testSetLoudness();
+ void testSaveToFile();
+
+private:
+ MpAudioEffectsFrameworkWrapper *mTest;
+ MpAudioEffectsFrameworkWrapperPrivate *mTestPrivate;
+
+};
+
+#endif // TESTMPAUDIOEFFECTSFRAMEWORKWRAPPER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mpengine/tsrc/unittest_mpaudioeffectsframeworkwrapper/src/unittest_mpaudioeffectsframeworkwrapper.cpp Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,174 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Unit test for MpMpxAsFrameworkWrapper
+*
+*/
+
+#include <QSignalSpy>
+#include <qnamespace.h>
+
+#include "unittest_mpaudioeffectsframeworkwrapper.h"
+#include "stub/inc/mpxaudioeffectproperties.h"
+
+// Do this so we can access all member variables.
+#define private public
+#include "mpaudioeffectsframeworkwrapper.h"
+#include "mpaudioeffectsframeworkwrapper_p.h"
+#undef private
+
+//This so we can test private functions
+#include "mpaudioeffectsframeworkwrapper_p.cpp"
+
+/*!
+ Make our test case a stand-alone executable that runs all the test functions.
+ */
+int main(int argc, char *argv[])
+{
+ TestMpAudioEffectsFrameworkWrapper tv;
+
+ if ( argc > 1 ) {
+ return QTest::qExec( &tv, argc, argv);
+ }
+ else {
+ char *pass[3];
+ pass[0] = argv[0];
+ pass[1] = "-o";
+ pass[2] = "c:\\data\\unittest_mpaudioeffectsframeworkwrapper.txt";
+
+ return QTest::qExec(&tv, 3, pass);
+ }
+}
+
+TestMpAudioEffectsFrameworkWrapper::TestMpAudioEffectsFrameworkWrapper()
+ : mTest(0)
+{
+}
+
+TestMpAudioEffectsFrameworkWrapper::~TestMpAudioEffectsFrameworkWrapper()
+{
+ delete mTest;
+}
+
+/*!
+ Called before the first testfunction is executed.
+ */
+void TestMpAudioEffectsFrameworkWrapper::initTestCase()
+{
+}
+
+/*!
+ Called after the last testfunction was executed.
+ */
+void TestMpAudioEffectsFrameworkWrapper::cleanupTestCase()
+{
+}
+
+/*!
+ Called before each testfunction is executed.
+ */
+void TestMpAudioEffectsFrameworkWrapper::init()
+{
+ mTest = new MpAudioEffectsFrameworkWrapper();
+ mTestPrivate = mTest->d_ptr;
+}
+
+/*!
+ Called after every testfunction.
+ */
+void TestMpAudioEffectsFrameworkWrapper::cleanup()
+{
+ delete mTest;
+ mTest = 0;
+}
+
+/*!
+ test Constructor
+ */
+void TestMpAudioEffectsFrameworkWrapper::testConstructor()
+{
+ QVERIFY(mTestPrivate->mAudioEffectProperties != 0);
+ QCOMPARE(mTestPrivate->mAudioEffectProperties->iLoadFromFile, TBool(ETrue));
+}
+
+/*!
+ test init
+ */
+void TestMpAudioEffectsFrameworkWrapper::testInit()
+{
+ mTestPrivate->mAudioEffectProperties->iLeave = ETrue;
+ mTestPrivate->init();
+ QCOMPARE(mTestPrivate->mAudioEffectProperties->iLoadFromFile, TBool(EFalse));
+ mTestPrivate->mAudioEffectProperties->iLeave = EFalse;
+ mTestPrivate->init();
+ QCOMPARE(mTestPrivate->mAudioEffectProperties->iLoadFromFile, TBool(ETrue));
+}
+
+/*!
+ test balance
+ */
+void TestMpAudioEffectsFrameworkWrapper::testBalance()
+{
+ QCOMPARE( mTest->balance(), 0 );
+ mTest->setBalance( -100 );
+ QCOMPARE( mTest->balance(), -100 );
+ mTest->setBalance( 100 );
+ QCOMPARE( mTest->balance(), 100 );
+}
+
+/*!
+ test loudness
+ */
+void TestMpAudioEffectsFrameworkWrapper::testLoudness()
+{
+ QCOMPARE(mTest->loudness(), false);
+ mTest->setLoudness(true);
+ QCOMPARE(mTest->loudness(), true);
+}
+
+/*!
+ test setBalance
+ */
+void TestMpAudioEffectsFrameworkWrapper::testSetBalance()
+{
+ mTest->setBalance(-5);
+ QCOMPARE(mTestPrivate->mAudioEffectProperties->iBalance, -5);
+ QCOMPARE(mTestPrivate->mAudioEffectProperties->iSaveToFile, TBool(ETrue));
+}
+
+/*!
+ test setLoudness
+ */
+void TestMpAudioEffectsFrameworkWrapper::testSetLoudness()
+{
+ mTest->setLoudness(true);
+ QCOMPARE(mTestPrivate->mAudioEffectProperties->iLoudness, TBool(ETrue));
+ QCOMPARE(mTestPrivate->mAudioEffectProperties->iSaveToFile, TBool(ETrue));
+ mTest->setLoudness(false);
+ QCOMPARE(mTestPrivate->mAudioEffectProperties->iLoudness, TBool(EFalse));
+ QCOMPARE(mTestPrivate->mAudioEffectProperties->iSaveToFile, TBool(ETrue));
+}
+
+/*!
+ test saveToFile
+ */
+void TestMpAudioEffectsFrameworkWrapper::testSaveToFile()
+{
+ mTestPrivate->saveToFile();
+ QCOMPARE(mTestPrivate->mAudioEffectProperties->iSaveToFile, TBool(ETrue));
+ mTestPrivate->mAudioEffectProperties->iLeave = ETrue;
+ mTestPrivate->saveToFile();
+ QCOMPARE(mTestPrivate->mAudioEffectProperties->iSaveToFile, TBool(EFalse));
+}
+
+// end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mpengine/tsrc/unittest_mpaudioeffectsframeworkwrapper/stub/inc/mpxaudioeffectproperties.h Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,49 @@
+/*
+* 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: audio effect properties stub for testing mpmpxasframeworkwrapper
+*
+*/
+
+#ifndef CMPXAUDIOEFFECTPROPERTIES_H
+#define CMPXAUDIOEFFECTPROPERTIES_H
+
+#include <e32base.h>
+
+class CMPXAudioEffectProperties : public CBase
+ {
+public:
+ explicit CMPXAudioEffectProperties();
+ virtual ~CMPXAudioEffectProperties();
+
+public:
+
+ // Stub functions
+ TInt Balance();
+ TBool Loudness();
+ void SetBalance(TInt aBalance);
+ void SetLoudness(TBool aLoudness);
+ void Reset();
+ void SaveToFileL();
+ void LoadFromFileL();
+
+public:
+
+ TInt iBalance;
+ TBool iLoudness;
+ TBool iLoadFromFile;
+ TBool iSaveToFile;
+ TBool iLeave;
+};
+
+#endif // CMPXAUDIOEFFECTPROPERTIES_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mpengine/tsrc/unittest_mpaudioeffectsframeworkwrapper/stub/src/mpxaudioeffectproperties.cpp Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,116 @@
+/*
+* 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: audio effect properties stub for testing mpmpxasframeworkwrapper
+*
+*/
+
+#include "mptrace.h"
+#include "stub/inc/mpxaudioeffectproperties.h"
+
+/*!
+ Stub function.
+*/
+CMPXAudioEffectProperties::CMPXAudioEffectProperties():iBalance(0),
+ iLoudness(EFalse),
+ iLoadFromFile(EFalse),
+ iSaveToFile(EFalse),
+ iLeave(EFalse)
+{
+}
+
+/*!
+ Stub function.
+*/
+CMPXAudioEffectProperties::~CMPXAudioEffectProperties()
+{
+}
+
+/*!
+ Stub function.
+*/
+TInt CMPXAudioEffectProperties::Balance()
+{
+ return iBalance;
+}
+
+/*!
+ Stub function.
+*/
+TBool CMPXAudioEffectProperties::Loudness()
+{
+ return iLoudness;
+}
+
+/*!
+ Stub function.
+*/
+void CMPXAudioEffectProperties::SetBalance(TInt aBalance)
+{
+ iBalance = aBalance;
+}
+
+/*!
+ Stub function.
+*/
+void CMPXAudioEffectProperties::SetLoudness(TBool aLoudness)
+{
+ iLoudness = aLoudness;
+}
+
+/*!
+ Stub function.
+*/
+void CMPXAudioEffectProperties::Reset()
+{
+ TX_ENTRY
+ iBalance = 0;
+ iLoudness = EFalse;
+ iLeave = EFalse;
+ iLoadFromFile = EFalse;
+ TX_EXIT
+}
+
+/*!
+ Stub function.
+*/
+void CMPXAudioEffectProperties::SaveToFileL()
+{
+ TX_ENTRY
+ if (iLeave) {
+ iSaveToFile = EFalse;
+ User::Leave(KErrNotFound);
+ }
+ else {
+ iSaveToFile = ETrue;
+ }
+ TX_EXIT
+}
+
+/*!
+ Stub function.
+*/
+void CMPXAudioEffectProperties::LoadFromFileL()
+{
+ TX_ENTRY
+ if (iLeave) {
+ iLoadFromFile = EFalse;
+ User::Leave(KErrNotFound);
+ }
+ else {
+ iLoadFromFile = ETrue;
+ }
+ TX_EXIT
+}
+
+//end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mpengine/tsrc/unittest_mpaudioeffectsframeworkwrapper/unittest_mpaudioeffectsframeworkwrapper.pro Fri May 28 19:46:01 2010 -0500
@@ -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: Unit test for mpaudioeffectsframeworkwrapper
+#
+
+TEMPLATE = app
+CONFIG += qtestlib
+CONFIG += symbian_test
+TARGET = unittest_mpaudioeffectsframeworkwrapper
+TARGET.CAPABILITY = CAP_APPLICATION
+
+DEPENDPATH += .
+INCLUDEPATH += . \
+ ../../inc \
+ ../../../inc
+INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+
+HEADERS += inc/unittest_mpaudioeffectsframeworkwrapper.h \
+ ../../inc/mpaudioeffectsframeworkwrapper.h \
+ ../../inc/mpaudioeffectsframeworkwrapper_p.h \
+ stub/inc/mpxaudioeffectproperties.h
+
+SOURCES += src/unittest_mpaudioeffectsframeworkwrapper.cpp \
+ ../../src/mpaudioeffectsframeworkwrapper.cpp \
+ stub/src/mpxaudioeffectproperties.cpp
+
--- a/mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/inc/unittest_mpmpxcollectionframeworkwrapper.h Fri May 14 18:54:37 2010 -0500
+++ b/mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/inc/unittest_mpmpxcollectionframeworkwrapper.h Fri May 28 19:46:01 2010 -0500
@@ -35,7 +35,7 @@
//test utility functions
void loadTestData();
void loadPlaylists();
- bool waitForSignal(QSignalSpy* spy, int timeoutms);
+ void loadAlbumsTestData();
public slots:
@@ -50,17 +50,17 @@
void testReleaseIsolatedCollection();
void testCollectionData();
void testHandleOpenEntries();
- void testHandleOpenPlaylist();
+ void testHandleOpenPlaylist();
void testHandleOperationComplete();
void testHandleIsolatedOpen();
- void testOpenCollection();
+ void testOpenCollection();
void testDoIncrementalOpen();
void testReopenCollection();
- void testOpenCollectionItem();
+ void testOpenCollectionItem();
void testGoBack();
void testFindPlaylists();
void testCreatePlaylist();
- void testCreatePlaylistWithProvidedCollectionData();
+ void testCreatePlaylistWithProvidedCollectionData();
void testSaveToPlaylist();
void testSaveToCurrentPlaylist();
void testRenamePlaylist();
@@ -70,9 +70,16 @@
void testPreviewItem();
void testOpenIsolatedCollection();
void testHandleCollectionMessage();
+ void testHandleCollectionMediaL();
void testPreparePlaylistMediaSongsContext();
void testPreparePlaylistMediaArtistAlbumsContext();
void testReorderPlaylist();
+ void testFindAlbumSongs();
+ void testHandleFindAll();
+ void testPlayAlbumSongs();
+ void testSetRepeatFeatureEnabled();
+ void testSetShuffleFeatureEnabled();
+ void testCreatePlaybackUtilityL();
private:
@@ -80,6 +87,7 @@
MpMpxCollectionFrameworkWrapperPrivate *mTestPrivate;
CMPXMedia *iMediaTestData;
CMPXMedia *iPlaylistsTestData;
+ CMPXMedia *iAlbumsTestData;
};
--- a/mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/src/unittest_mpmpxcollectionframeworkwrapper.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/src/unittest_mpmpxcollectionframeworkwrapper.cpp Fri May 28 19:46:01 2010 -0500
@@ -16,8 +16,6 @@
*/
#include <QSignalSpy>
-#include <hbapplication.h>
-#include <hbmainwindow.h>
#include <mpxmedia.h>
#include <mpxcollectionplaylist.h>
@@ -29,7 +27,7 @@
#include "stub/inc/mpxcollectionutility.h"
#include "stub/inc/mpxplaybackutility.h"
#include "stub/inc/mpmpxisolatedcollectionhelper.h"
-#include "mpsettingsmanager.h"
+#include "stub/inc/mpsettingsmanager.h"
// Do this so we can access all member variables.
#define private public
@@ -68,25 +66,27 @@
*/
int main(int argc, char *argv[])
{
- HbApplication app(argc, argv);
- HbMainWindow window;
-
+ QApplication app(argc, argv);
TestMpMpxCollectionFrameworkWrapper tv;
- char *pass[3];
- pass[0] = argv[0];
- pass[1] = "-o";
- pass[2] = "c:\\data\\unittest_mpmpxcollectionframeworkwrapper.txt";
+ if ( argc > 1 ) {
+ return QTest::qExec( &tv, argc, argv);
+ }
+ else {
+ char *pass[3];
+ pass[0] = argv[0];
+ pass[1] = "-o";
+ pass[2] = "c:\\data\\unittest_mpmpxcollectionframeworkwrapper.txt";
- int res = QTest::qExec(&tv, 3, pass);
-
- return res;
+ return QTest::qExec(&tv, 3, pass);
+ }
}
TestMpMpxCollectionFrameworkWrapper::TestMpMpxCollectionFrameworkWrapper()
: mTest(0),
iMediaTestData(0),
- iPlaylistsTestData(0)
+ iPlaylistsTestData(0),
+ iAlbumsTestData(0)
{
}
@@ -201,51 +201,37 @@
mTestPrivate->HandleOpenL(*playlist, KErrNotFound);
QCOMPARE(spy.count(), 0);
QVERIFY(mTestPrivate->iPlaybackUtility == 0);
-
+
//Called without error
- QSignalSpy spy2( MpSettingsManager::instance(),SIGNAL(shuffleChanged(bool)));
MpSettingsManager::setRepeat(false);
MpSettingsManager::setShuffle(false);
- if(waitForSignal(&spy2, 1000)){
- bool shuffle = MpSettingsManager::shuffle();
- TX_LOG_ARGS("shuffle changed to "<< shuffle);
- bool repeat = MpSettingsManager::repeat();
- TX_LOG_ARGS("repeat changed to "<< repeat);
- }
+
mTestPrivate->HandleOpenL(*playlist, KErrNone);
QCOMPARE(spy.count(), 1);
QVERIFY(mTestPrivate->iPlaybackUtility != 0);
QCOMPARE(mTestPrivate->iPlaybackUtility->iPlay, TBool(ETrue));
QCOMPARE(mTestPrivate->iPlaybackUtility->iShuffle, 0);
QCOMPARE(mTestPrivate->iPlaybackUtility->iRepeat, TInt(EPbRepeatOff));
-
+
cleanup();
init();
- QSignalSpy spy3(mTest, SIGNAL(collectionPlaylistOpened()));
+ QSignalSpy spy2(mTest, SIGNAL(collectionPlaylistOpened()));
//Called without error
- spy2.clear();
MpSettingsManager::setRepeat(true);
MpSettingsManager::setShuffle(true);
- if(waitForSignal(&spy2, 1000)){
- bool shuffle = MpSettingsManager::shuffle();
- TX_LOG_ARGS("shuffle2 changed to "<< shuffle);
- bool repeat = MpSettingsManager::repeat();
- TX_LOG_ARGS("repeat2 changed to "<< repeat);
- }
-
mTestPrivate->HandleOpenL(*playlist, KErrNone);
- QCOMPARE(spy3.count(), 1);
+ QCOMPARE(spy2.count(), 1);
QVERIFY(mTestPrivate->iPlaybackUtility != 0);
QCOMPARE(mTestPrivate->iPlaybackUtility->iPlay, TBool(ETrue));
QCOMPARE(mTestPrivate->iPlaybackUtility->iRepeat, TInt(EPbRepeatAll));
QCOMPARE(mTestPrivate->iPlaybackUtility->iShuffle, 1);
//Called without error
- spy3.clear();
+ spy2.clear();
mTestPrivate->HandleOpenL(*playlist, KErrNone);
- QCOMPARE(spy3.count(), 1);
+ QCOMPARE(spy2.count(), 1);
QVERIFY(mTestPrivate->iPlaybackUtility != 0);
QCOMPARE(mTestPrivate->iPlaybackUtility->iPlay, TBool(ETrue));
}
@@ -366,7 +352,7 @@
void TestMpMpxCollectionFrameworkWrapper::testReopenCollection()
{
mTest->reopenCollection();
- QCOMPARE(mTestPrivate->iCollectionUtility->iOpen,TBool(ETrue));
+ QCOMPARE(mTestPrivate->iCollectionUtility->iOpen,TBool(ETrue));
}
/*!
@@ -403,7 +389,7 @@
QCOMPARE(count,testList.count());
for(TInt i=0; i < count; i++){
const TDesC& title = TPtrC(reinterpret_cast<const TUint16*>(KAllSongsTestData[i].GeneralTitle));
- QCOMPARE(testList.at(i),QString::fromUtf16( title.Ptr(), title.Length() ));
+ QCOMPARE(testList.at(i),QString::fromUtf16( title.Ptr(), title.Length() ));
}
}
@@ -419,7 +405,7 @@
QString playListName("playlistname");
loadTestData();
mTestPrivate->iCollectionData->setMpxMedia(*iMediaTestData);
- mTest->createPlaylist(playListName,selection);
+ mTest->createPlaylist(playListName, selection, NULL );
QCOMPARE(mTestPrivate->iCollectionUiHelper->iIncAdd, TBool(ETrue));
CMPXMedia* testTracks = mTestPrivate->iCollectionUiHelper->iMedia;
QCOMPARE(testTracks->ValueTObjectL<TMPXGeneralType>(KMPXMediaGeneralType),EMPXItem);
@@ -586,6 +572,7 @@
*/
void TestMpMpxCollectionFrameworkWrapper::testDeleteSongs()
{
+ //DoDeleteSongsL
QList<int> selection;
selection.append(1);
mTest->deleteSongs(selection);
@@ -595,6 +582,22 @@
selection.append(5);
mTest->deleteSongs(selection);
QCOMPARE(mTestPrivate->iCollectionUiHelper->iDelete, TBool(ETrue));
+
+
+ //DoDeleteAlbumSongsL
+ cleanup();
+ init();
+
+ loadAlbumsTestData();
+ mTestPrivate->iCollectionData->setMpxMedia(*iAlbumsTestData);
+ mTestPrivate->iCollectionData->mContext = ECollectionContextAlbumsTBone;
+ mTestPrivate->iCollectionData->mCurrentAlbumIndex = 1;
+
+ QList<int> AlbumSongSelection;
+ AlbumSongSelection.append(1);
+ mTest->deleteSongs(AlbumSongSelection);
+ QCOMPARE(mTestPrivate->iCollectionUiHelper->iDelete, TBool(ETrue));
+
}
/*!
@@ -626,24 +629,43 @@
*/
void TestMpMpxCollectionFrameworkWrapper::testCancel()
{
- mTest->cancel();
- QVERIFY(mTestPrivate->iCollectionUiHelper->iCancel == ETrue);
+ mTest->cancelRequest();
+ QVERIFY(mTestPrivate->iCollectionUiHelper->iCancel);
}
+
/*!
Tests PreviewItem
*/
void TestMpMpxCollectionFrameworkWrapper::testPreviewItem()
{
- loadTestData();
- mTestPrivate->iCollectionData->setMpxMedia(*iMediaTestData);
- QSignalSpy spy(mTest, SIGNAL(collectionPlaylistOpened()));
- mTest->previewItem(1);
-
- // Playback utility should be created.
- QVERIFY(mTestPrivate->iPlaybackUtility != 0);
- QCOMPARE(mTestPrivate->iPlaybackUtility->iPlay, TBool(ETrue));
- QCOMPARE(spy.count(), 1);
+ {// DoPreviewSongL
+ loadTestData();
+ mTestPrivate->iCollectionData->setMpxMedia(*iMediaTestData);
+
+ QSignalSpy spy(mTest, SIGNAL(collectionPlaylistOpened()));
+ mTest->previewItem(1);
+
+ QVERIFY(mTestPrivate->iPlaybackUtility != 0);
+ QCOMPARE(mTestPrivate->iPlaybackUtility->iPlay, TBool(ETrue));
+ QCOMPARE(spy.count(), 1);
+ }
+
+ {// DoPreviewAlbumSongL
+ cleanup();
+ init();
+ loadAlbumsTestData();
+ mTestPrivate->iCollectionData->setMpxMedia(*iAlbumsTestData);
+ mTestPrivate->iCollectionData->mContext = ECollectionContextAlbumsTBone;
+ mTestPrivate->iCollectionData->mCurrentAlbumIndex = 1;
+
+ QSignalSpy spy(mTest, SIGNAL(collectionPlaylistOpened()));
+ mTest->previewItem(1);
+
+ QVERIFY(mTestPrivate->iPlaybackUtility != 0);
+ QCOMPARE(mTestPrivate->iPlaybackUtility->iPlay, TBool(ETrue));
+ QCOMPARE(spy.count(), 1);
+ }
}
/*!
@@ -667,8 +689,6 @@
}
-
-
/*!
Tests handleCollectionMessage. Part of private implementation.
*/
@@ -687,6 +707,7 @@
testMessage->SetTObjectValueL<TInt>(KMPXMessageGeneralType,EMcPathChangedByOpen);
testMessage->SetTObjectValueL<TInt>(KMPXMessageGeneralData,EMcContainerOpened);
mTestPrivate->DoHandleCollectionMessageL(*testMessage);
+ //mTestPrivate->HandleCollectionMessage(*testMessage, KErrNone);
QCOMPARE(mTestPrivate->iCollectionUtility->iOpen,TBool(EFalse));
QCOMPARE(mTestPrivate->iIncrementalOpenUtil->iDelay, KIncrementalDelayHalfSecond);
@@ -711,8 +732,29 @@
QCOMPARE(mTestPrivate->iFirstIncrementalOpen,TBool(EFalse));
QCOMPARE(mTestPrivate->iIncrementalOpenUtil->iDirection,CMPXCollectionOpenUtility::EFetchDown);
QCOMPARE(mTestPrivate->iIncrementalOpenUtil->iChunkSize, 0);
-
- CleanupStack::PopAndDestroy(testMessage);
+
+ //Content changed
+ cleanup();
+ init();
+ QSignalSpy spy(mTest, SIGNAL(containerContentsChanged()));
+ testMessage->SetTObjectValueL<TMPXMessageId>(KMPXMessageGeneralId,KMPXMessageIdItemChanged);
+ testMessage->SetTObjectValueL<TInt>(KMPXMessageGeneralEvent,TMPXCollectionMessage::EPathChanged);
+ testMessage->SetTObjectValueL<TInt>(KMPXMessageGeneralType,EMcPathChangedByOpen);
+ testMessage->SetTObjectValueL<TInt>(KMPXMessageGeneralData,EMcItemOpened);
+ mTestPrivate->DoHandleCollectionMessageL(*testMessage);
+ QCOMPARE(spy.count(), 1);
+
+ CleanupStack::PopAndDestroy(testMessage);
+}
+
+/*!
+ Tests handleCollectionMessage. Part of private implementation.
+ */
+void TestMpMpxCollectionFrameworkWrapper::testHandleCollectionMediaL()
+{
+ //HandleCollectionMediaL does nothing, test added just to cover all member functions.
+ mTestPrivate->HandleCollectionMediaL( *iMediaTestData, KErrNone);
+ QVERIFY( iMediaTestData );
}
/*!
@@ -892,6 +934,133 @@
}
/*!
+ Used to test findAlbumSongs
+ */
+void TestMpMpxCollectionFrameworkWrapper::testFindAlbumSongs()
+{
+ int index(1);
+ loadAlbumsTestData();
+
+ CMPXMediaArray* albumsTestData = CMPXMediaArray::NewL(
+ *( iAlbumsTestData->Value<CMPXMediaArray>( KMPXMediaArrayContents ) ) );
+ mTestPrivate->iCollectionUtility->iAlbumSongs = albumsTestData;
+ mTestPrivate->iCollectionData->setMpxMedia(*iAlbumsTestData);
+
+ mTest->findAlbumSongs(index);
+ CMPXMedia* findResult = mTestPrivate->iCollectionUtility->iAsynchFindResult;
+ QVERIFY( findResult );
+ QCOMPARE( findResult->ValueTObjectL<TInt>( KMPXMediaGeneralId ),
+ albumsTestData->AtL(index)->ValueTObjectL<TInt>( KMPXMediaGeneralId ) );
+}
+
+/*!
+ Used to test findAlbumSongs
+ */
+void TestMpMpxCollectionFrameworkWrapper::testHandleFindAll()
+{
+ int index(1);
+ loadAlbumsTestData();
+
+ CMPXMediaArray* albumsTestData = CMPXMediaArray::NewL(
+ *( iAlbumsTestData->Value<CMPXMediaArray>( KMPXMediaArrayContents ) ) );
+ mTestPrivate->iCollectionUtility->iAlbumSongs = albumsTestData;
+ mTestPrivate->iCollectionData->setMpxMedia(*iAlbumsTestData);
+ mTestPrivate->iCollectionData->mCurrentAlbumIndex = index;
+ CMPXMedia* findResult = albumsTestData->AtL(index);
+ CMPXMediaArray* songArray =
+ findResult->Value<CMPXMediaArray>( KMPXMediaArrayContents );
+
+ mTestPrivate->HandleFindAllL(*findResult, ETrue, KErrNone);
+ QCOMPARE( mTestPrivate->iCollectionData->mAlbumSongCount, songArray->Count() );
+}
+
+/*!
+ Used to test findAlbumSongs
+ */
+void TestMpMpxCollectionFrameworkWrapper::testPlayAlbumSongs()
+{
+ int albumIndex(1);
+ int songIndex(3);
+ loadAlbumsTestData();
+
+ {// With ECollectionContextAlbumsMediaWall
+ QSignalSpy spy(mTest, SIGNAL(collectionPlaylistOpened()));
+ CMPXMediaArray* albumsTestData = CMPXMediaArray::NewL(
+ *( iAlbumsTestData->Value<CMPXMediaArray>( KMPXMediaArrayContents ) ) );
+
+ mTestPrivate->iCollectionUtility->iAlbumSongs = albumsTestData;
+ mTestPrivate->iCollectionData->setMpxMedia(*iAlbumsTestData);
+ mTestPrivate->iCollectionData->mCurrentAlbumIndex = albumIndex;
+ mTestPrivate->iCollectionData->mContext = ECollectionContextAlbumsMediaWall;
+
+ mTest->playAlbumSongs(albumIndex, songIndex, 0);
+ CMPXCollectionPath* cpath = mTestPrivate->iPlaybackUtility->iCurrentPath;
+ QCOMPARE(spy.count(), 1);
+ QVERIFY(cpath->Levels() == 4);
+ }
+
+ {// With other context
+ cleanup();
+ init();
+ QSignalSpy spy(mTest, SIGNAL(collectionPlaylistOpened()));
+ CMPXMediaArray* albumsTestData = CMPXMediaArray::NewL(
+ *( iAlbumsTestData->Value<CMPXMediaArray>( KMPXMediaArrayContents ) ) );
+
+ mTestPrivate->iCollectionUtility->iAlbumSongs = albumsTestData;
+ mTestPrivate->iCollectionData->setMpxMedia(*iAlbumsTestData);
+ mTestPrivate->iCollectionData->mCurrentAlbumIndex = albumIndex;
+
+ mTest->playAlbumSongs(albumIndex, songIndex, NULL);
+ CMPXCollectionPath* cpath = mTestPrivate->iPlaybackUtility->iCurrentPath;
+ QCOMPARE(spy.count(), 1);
+ QVERIFY(cpath->Levels() == 2);
+ }
+}
+
+/*!
+ Used to test setRepeatFeatureEnabled
+ */
+void TestMpMpxCollectionFrameworkWrapper::testSetRepeatFeatureEnabled()
+{
+ bool enabled( true );
+ mTest->setRepeatFeatureEnabled( enabled );
+ QVERIFY( mTestPrivate->iRepeatFeature );
+
+ enabled = false;
+ mTest->setRepeatFeatureEnabled( enabled );
+ QVERIFY( !mTestPrivate->iRepeatFeature );
+}
+
+/*!
+ Used to test setShuffleFeatureEnabled
+ */
+void TestMpMpxCollectionFrameworkWrapper::testSetShuffleFeatureEnabled()
+{
+ bool enabled( true );
+ mTest->setShuffleFeatureEnabled( enabled );
+ QVERIFY( mTestPrivate->iShuffleFeature );
+
+ enabled = false;
+ mTest->setShuffleFeatureEnabled( enabled );
+ QVERIFY( !mTestPrivate->iShuffleFeature );
+}
+
+/*!
+ Used to test createPlaybackUtilityL
+ */
+void TestMpMpxCollectionFrameworkWrapper::testCreatePlaybackUtilityL()
+{
+ bool repeat = true;
+ bool shuffle = true;
+ mTest->setRepeatFeatureEnabled( repeat );
+ mTest->setShuffleFeatureEnabled( shuffle );
+ mTestPrivate->createPlaybackUtilityL();
+ QVERIFY( mTestPrivate->iPlaybackUtility );
+ QVERIFY( mTestPrivate->iPlaybackUtility->iRepeat );
+ QVERIFY( mTestPrivate->iPlaybackUtility->iShuffle );
+}
+
+/*!
Used to load test data
*/
void TestMpMpxCollectionFrameworkWrapper::loadTestData()
@@ -917,6 +1086,7 @@
media->SetTextValueL(KMPXMediaMusicArtist, TPtrC(reinterpret_cast<const TUint16*>(KAllSongsTestData[i].MusicArtist)));
media->SetTObjectValueL<TInt>(KMPXMediaGeneralCount, KAllSongsTestData[i].GeneralCount);
media->SetTextValueL(KMPXMediaMusicAlbumArtFileName, TPtrC(reinterpret_cast<const TUint16*>(KAllSongsTestData[i].MusicAlbumArtFileName)));
+ media->SetTObjectValueL<TMPXItemId>( KMPXMediaGeneralId, 300 + i );
array->AppendL(*media);
CleanupStack::PopAndDestroy(media);
}
@@ -979,17 +1149,85 @@
}
/*!
- Used to wait on spy signal
+ Used to load test playlists
*/
-bool TestMpMpxCollectionFrameworkWrapper::waitForSignal(QSignalSpy* spy, int timeoutms)
-{
- QTime timer;
- timer.start();
- while (spy->isEmpty() && timer.elapsed() < timeoutms)
- {
- QCoreApplication::processEvents();
- }
- return !spy->isEmpty();
+void TestMpMpxCollectionFrameworkWrapper::loadAlbumsTestData()
+{
+ if(iAlbumsTestData){
+ delete iAlbumsTestData;
+ iAlbumsTestData=0;
+ }
+
+ //Loading Test Data.
+ RArray<TInt> supportedIds;
+ CleanupClosePushL( supportedIds );
+ supportedIds.AppendL( KMPXMediaIdMusic );
+ supportedIds.AppendL( KMPXMediaIdGeneral );
+ iAlbumsTestData = CMPXMedia::NewL(supportedIds.Array());
+ CMPXMedia* albumOneTracksTestData = CMPXMedia::NewL(supportedIds.Array());
+ CMPXMedia* albumTwoTracksTestData = CMPXMedia::NewL(supportedIds.Array());
+ CleanupStack::PopAndDestroy(&supportedIds);
+ CleanupStack::PushL(iAlbumsTestData);
+ CleanupStack::PushL(albumOneTracksTestData);
+ CleanupStack::PushL(albumTwoTracksTestData);
+
+ {//Loading pseudo data for album one
+ CMPXMediaArray* array = CMPXMediaArray::NewL();
+ CleanupStack::PushL(array);
+ TInt count = sizeof(KAllSongsTestData)/sizeof(TTestAttrs);
+ for (TInt i =0; i < count/2; i++) {
+ CMPXMedia* media = CMPXMedia::NewL();
+ CleanupStack::PushL(media);
+ media->SetTextValueL(KMPXMediaGeneralTitle, TPtrC(reinterpret_cast<const TUint16*>(KAllSongsTestData[i].GeneralTitle)));
+ media->SetTObjectValueL<TMPXItemId>(KMPXMediaGeneralId, TMPXItemId(i));
+ array->AppendL(*media);
+ CleanupStack::PopAndDestroy(media);
+ }
+ albumOneTracksTestData->SetTObjectValueL<TMPXGeneralType>(KMPXMediaGeneralType, EMPXItem);
+ albumOneTracksTestData->SetTObjectValueL<TMPXGeneralCategory>(KMPXMediaGeneralCategory, EMPXAlbum);
+ albumOneTracksTestData->SetCObjectValueL(KMPXMediaArrayContents, array);
+ albumOneTracksTestData->SetTObjectValueL<TInt>(KMPXMediaArrayCount, array->Count());
+ albumOneTracksTestData->SetTObjectValueL<TMPXItemId>(KMPXMediaGeneralId,TMPXItemId(1));
+ CleanupStack::PopAndDestroy(array);
+ }
+
+ {//Loading pseudo data for album two
+ CMPXMediaArray* array = CMPXMediaArray::NewL();
+ CleanupStack::PushL(array);
+ TInt count = sizeof(KAllSongsTestData)/sizeof(TTestAttrs);
+ for (TInt i = count/2; i < count; i++) {
+ CMPXMedia* media = CMPXMedia::NewL();
+ CleanupStack::PushL(media);
+ media->SetTextValueL(KMPXMediaGeneralTitle, TPtrC(reinterpret_cast<const TUint16*>(KAllSongsTestData[i].GeneralTitle)));
+ media->SetTObjectValueL<TMPXItemId>(KMPXMediaGeneralId, (i));
+ array->AppendL(*media);
+ CleanupStack::PopAndDestroy(media);
+ }
+ albumTwoTracksTestData->SetTObjectValueL<TMPXGeneralType>(KMPXMediaGeneralType, EMPXItem);
+ albumTwoTracksTestData->SetTObjectValueL<TMPXGeneralCategory>(KMPXMediaGeneralCategory, EMPXAlbum);
+ albumTwoTracksTestData->SetCObjectValueL(KMPXMediaArrayContents, array);
+ albumTwoTracksTestData->SetTObjectValueL<TInt>(KMPXMediaArrayCount, array->Count());
+ albumTwoTracksTestData->SetTObjectValueL<TMPXItemId>(KMPXMediaGeneralId,TMPXItemId(2));
+ CleanupStack::PopAndDestroy(array);
+ }
+
+ {//Loading pseudo data for albums container
+ CMPXMediaArray* array = CMPXMediaArray::NewL();
+ CleanupStack::PushL(array);
+ array->AppendL(CMPXMedia::NewL()); //empty, this album is not selected for the test case. Useful to get ItemID = Album index
+ array->AppendL(*albumOneTracksTestData);
+ array->AppendL(*albumTwoTracksTestData);
+ iAlbumsTestData->SetTObjectValueL<TMPXGeneralType>(KMPXMediaGeneralType, EMPXGroup);
+ iAlbumsTestData->SetTObjectValueL<TMPXGeneralCategory>(KMPXMediaGeneralCategory, EMPXAlbum);
+ iAlbumsTestData->SetCObjectValueL(KMPXMediaArrayContents, array);
+ iAlbumsTestData->SetTObjectValueL<TInt>(KMPXMediaArrayCount, array->Count());
+ iAlbumsTestData->SetTObjectValueL<TMPXItemId>(KMPXMediaGeneralId,TMPXItemId(88));//any number
+ CleanupStack::PopAndDestroy(array);
+ }
+
+ CleanupStack::PopAndDestroy(albumTwoTracksTestData);
+ CleanupStack::PopAndDestroy(albumOneTracksTestData);
+ CleanupStack::Pop(iAlbumsTestData);
}
//end of file
--- a/mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/stub/inc/mpmpxcollectiondata.h Fri May 14 18:54:37 2010 -0500
+++ b/mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/stub/inc/mpmpxcollectiondata.h Fri May 28 19:46:01 2010 -0500
@@ -21,6 +21,7 @@
#include "mpmpxcollectionviewdefs.h"
class CMPXMedia;
+class CMPXMediaArray;
class MpMpxCollectionData
@@ -45,15 +46,25 @@
~MpMpxCollectionData();
TCollectionContext context();
+ int count() const;
+ QString collectionTitle() const;
QString itemData( int index, MpMpxCollectionData::DataType type ) const;
- void setMpxMedia( const CMPXMedia& entries );
+ int itemId(int index);
+ int currentAlbumIndex() const;
+
+ void setMpxMedia( const CMPXMedia& entries, bool reopen=false );
const CMPXMedia& containerMedia();
+ void setAlbumContent( const CMPXMedia& albumContent );
+
public:
- CMPXMedia *mContainerMedia;
+ CMPXMedia *mContainerMedia; //Not owned
+ CMPXMediaArray *mMediaArray; //Not owned
TBool mMediaSet;
TCollectionContext mContext;
+ int mCurrentAlbumIndex;
+ int mAlbumSongCount;
};
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/stub/inc/mpsettingsmanager.h Fri May 28 19:46:01 2010 -0500
@@ -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: MpSettingsManager stub for testing MpMtpInfoLink.
+*
+*/
+
+#ifndef MPSETTINGSMANAGER_H
+#define MPSETTINGSMANAGER_H
+
+#include<QObject>
+#include <QtGlobal>
+
+class MpSettingsManager: public QObject
+{
+
+Q_OBJECT
+
+private:
+ explicit MpSettingsManager();
+
+public:
+ virtual ~MpSettingsManager();
+ static MpSettingsManager *instance();
+ static bool shuffle();
+ static bool repeat();
+ static void setShuffle(bool shuffle);
+ static void setRepeat(bool repeat);
+
+public:
+ bool mShuffle;
+ bool mRepeat;
+
+private:
+ Q_DISABLE_COPY(MpSettingsManager)
+};
+
+#endif // MPSETTINGSMANAGER_H
--- a/mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/stub/inc/mpxcollectionuihelper.h Fri May 14 18:54:37 2010 -0500
+++ b/mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/stub/inc/mpxcollectionuihelper.h Fri May 28 19:46:01 2010 -0500
@@ -37,7 +37,7 @@
MMPXCollectionUiHelper();
~MMPXCollectionUiHelper();
- void DeleteL( CMPXCollectionPath& aPath,
+ void DeleteL( CMPXCollectionPath& aPath,
MMPXCHelperObserver* aObserver );
CMPXCollectionPath* MusicMenuPathL();
CMPXCollectionPath* MusicAllSongsPathL();
@@ -53,11 +53,13 @@
TUint aOriginalOrdinal,
TUint aNewOrdinal,
MMPXCHelperObserver* aObserver);
+ void Cancel();
public:
TBool iIncAdd;
TBool iDelete;
+ TBool iCancel;
CMPXMedia *iMedia;
TBool iValidRename;
TBool iValidReorder;
--- a/mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/stub/inc/mpxcollectionutility.h Fri May 14 18:54:37 2010 -0500
+++ b/mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/stub/inc/mpxcollectionutility.h Fri May 28 19:46:01 2010 -0500
@@ -31,6 +31,7 @@
//Forward declarations
class CMPXCollectionPath;
+class MMPXCollectionFindObserver;
class MMPXCollection
{
@@ -46,6 +47,9 @@
virtual void CancelRequest() = 0;
virtual CMPXMedia* FindAllL(const CMPXSearchCriteria& aCriteria,
const TArray<TMPXAttribute>& aAttrs) = 0;
+ virtual void FindAllL(const CMPXSearchCriteria& aCriteria,
+ const TArray<TMPXAttribute>& aAttrs,
+ MMPXCollectionFindObserver& aObs) = 0;
};
@@ -73,7 +77,10 @@
void BackL();
void CancelRequest();
CMPXMedia* FindAllL(const CMPXSearchCriteria& aCriteria,
- const TArray<TMPXAttribute>& aAttrs);
+ const TArray<TMPXAttribute>& aAttrs);
+ void FindAllL(const CMPXSearchCriteria& aCriteria,
+ const TArray<TMPXAttribute>& aAttrs,
+ MMPXCollectionFindObserver& aObs);
public:
@@ -84,6 +91,7 @@
int iIndex;
CMPXMedia *iPlaylists; //Owned
CMPXMediaArray *iAlbumSongs; //Owned
+ CMPXMedia *iAsynchFindResult; //Owned
};
--- a/mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/stub/inc/mpxplaybackutility.h Fri May 14 18:54:37 2010 -0500
+++ b/mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/stub/inc/mpxplaybackutility.h Fri May 28 19:46:01 2010 -0500
@@ -27,6 +27,7 @@
//Forward declarations
class CMPXCollectionPlaylist;
+class CMPXCollectionPath;
class MMPXPlaybackUtility
{
@@ -47,6 +48,7 @@
TInt iRepeat;
TMPXPlaybackProperty iProperty;
TBool iPlay;
+ CMPXCollectionPath *iCurrentPath;
};
#endif // MMPXPLAYBACKUTILITY_H
--- a/mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/stub/src/mpmpxcollectiondata.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/stub/src/mpmpxcollectiondata.cpp Fri May 28 19:46:01 2010 -0500
@@ -18,6 +18,9 @@
#include "mptrace.h"
#include "stub/inc/mpmpxcollectiondata.h"
#include <mpxmedia.h>
+#include <mpxmediaarray.h>
+#include <mpxmediageneraldefs.h>
+#include <mpxmediacontainerdefs.h>
/*!
@@ -25,16 +28,19 @@
*/
MpMpxCollectionData::MpMpxCollectionData()
:mContainerMedia(0),
+ mMediaArray(0),
mMediaSet(EFalse),
- mContext (ECollectionContextUnknown)
-{
+ mContext (ECollectionContextUnknown),
+ mCurrentAlbumIndex(0),
+ mAlbumSongCount(0)
+{
}
/*!
Stub function.
*/
MpMpxCollectionData::~MpMpxCollectionData()
-{
+{
}
/*!
@@ -47,6 +53,28 @@
/*!
Stub function.
+ */
+int MpMpxCollectionData::count() const
+{
+ return 0;
+}
+
+/*!
+ Stub function.
+ */
+QString MpMpxCollectionData::collectionTitle() const
+{
+ QString title;
+ if ( mContainerMedia && mContainerMedia->IsSupported( KMPXMediaGeneralTitle ) ) {
+ const TDesC& titleText = mContainerMedia->ValueText( KMPXMediaGeneralTitle );
+ if ( titleText.Compare( KNullDesC ) != 0 ) {
+ title = QString::fromUtf16( titleText.Ptr(), titleText.Length() );
+ }
+ }
+ return title;
+}
+/*!
+ Stub function.
*/
QString MpMpxCollectionData::itemData( int index, MpMpxCollectionData::DataType type ) const
{
@@ -58,14 +86,35 @@
return QString();
}
}
+
+/*!
+ Stub function.
+ */
+int MpMpxCollectionData::itemId( int index )
+{
+ CMPXMedia* currentMedia( mMediaArray->AtL( index ) );
+ Q_ASSERT( currentMedia->IsSupported( KMPXMediaGeneralId ) );
+ return currentMedia->ValueTObjectL<TInt>( KMPXMediaGeneralId );
+}
+
+/*!
+ Stub function.
+ */
+int MpMpxCollectionData::currentAlbumIndex() const
+{
+ return mCurrentAlbumIndex;
+}
+
/*!
Stub function.
*/
-void MpMpxCollectionData::setMpxMedia( const CMPXMedia& entries )
+void MpMpxCollectionData::setMpxMedia( const CMPXMedia& entries, bool reopen)
{
+ Q_UNUSED(reopen);
delete mContainerMedia;
mContainerMedia = 0;
mContainerMedia = CMPXMedia::NewL(entries);
+ mMediaArray = const_cast<CMPXMediaArray*>(mContainerMedia->Value<CMPXMediaArray>( KMPXMediaArrayContents ) );
mMediaSet = ETrue;
}
@@ -77,4 +126,25 @@
return *mContainerMedia;
}
+/*!
+ Stub function.
+*/
+void MpMpxCollectionData::setAlbumContent( const CMPXMedia& albumContent )
+{
+ //CMPXMediaArray* songArray(const_cast<CMPXMediaArray*>( albumContent.Value<CMPXMediaArray>(
+ // KMPXMediaArrayContents ) ) );
+ CMPXMediaArray* songArray = albumContent.Value<CMPXMediaArray>( KMPXMediaArrayContents );
+ User::LeaveIfNull( songArray );
+
+ // Save the songs to the album so that we don't need to find them again
+ // if the same album is selected again.
+ mAlbumSongCount = songArray->Count();
+
+ if ( mAlbumSongCount ) {
+ CMPXMedia* albumMedia( mMediaArray->AtL( mCurrentAlbumIndex ) );
+ albumMedia->SetCObjectValueL(KMPXMediaArrayContents, songArray);
+ albumMedia->SetTObjectValueL<TInt>(KMPXMediaArrayCount, mAlbumSongCount);
+ }
+}
+
//end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/stub/src/mpsettingsmanager.cpp Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,77 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: MpSettingsManager stub for testing MpMtpInfoLink.
+*
+*/
+
+#include "stub/inc/mpsettingsmanager.h"
+
+
+/*!
+ Constructs the MP Settings Manager.
+ */
+MpSettingsManager::MpSettingsManager() :
+ mShuffle(true),
+ mRepeat(true)
+{
+}
+
+/*!
+ Destructs the settings manager.
+ */
+MpSettingsManager::~MpSettingsManager()
+{
+}
+
+/*!
+ Returns the singleton instance to the settings manager.
+ */
+MpSettingsManager * MpSettingsManager::instance()
+{
+ static MpSettingsManager instance;
+ return &instance;
+}
+
+/*!
+ Stub function.
+ */
+void MpSettingsManager::setShuffle( bool shuffle )
+{
+ instance()->mShuffle = shuffle;
+}
+
+/*!
+ Stub function.
+ */
+void MpSettingsManager::setRepeat( bool repeat )
+{
+ instance()->mRepeat = repeat;
+}
+
+/*!
+ Stub function.
+ */
+bool MpSettingsManager::shuffle()
+{
+ return instance()->mShuffle;
+}
+
+/*!
+ Stub function.
+ */
+bool MpSettingsManager::repeat()
+{
+ return instance()->mRepeat;
+}
+
--- a/mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/stub/src/mpxcollectionuihelper.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/stub/src/mpxcollectionuihelper.cpp Fri May 28 19:46:01 2010 -0500
@@ -32,6 +32,7 @@
*/
MMPXCollectionUiHelper::MMPXCollectionUiHelper():iIncAdd(EFalse),
iDelete(EFalse),
+ iCancel(EFalse),
iValidRename(EFalse),
iValidReorder(EFalse),
iMedia(0)
@@ -131,7 +132,7 @@
}
CleanupStack::Pop( path );
- return path;
+ return path;
}
/*!
@@ -149,7 +150,7 @@
}
CleanupStack::Pop( path );
- return path;
+ return path;
}
/*!
@@ -167,7 +168,15 @@
}
CleanupStack::Pop( path );
- return path;
+ return path;
+}
+
+/*!
+ Stub function.
+*/
+void MMPXCollectionUiHelper::Cancel()
+{
+ iCancel = ETrue;
}
//end of file
--- a/mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/stub/src/mpxcollectionutility.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/stub/src/mpxcollectionutility.cpp Fri May 28 19:46:01 2010 -0500
@@ -25,6 +25,7 @@
#include <mpxmediacollectiondetaildefs.h>
#include <mpxcollectionplugin.hrh>
#include <mpxcollectionpath.h>
+#include <mpxcollectionobserver.h>
#include "mptrace.h"
#include <e32debug.h>
@@ -41,7 +42,8 @@
iOpenCount(0),
iCountPath(0),
iPlaylists(0),
- iAlbumSongs(0)
+ iAlbumSongs(0),
+ iAsynchFindResult(0)
{
}
@@ -59,6 +61,10 @@
{
delete iPlaylists;
}
+ if (iAsynchFindResult)
+ {
+ delete iAsynchFindResult;
+ }
}
/*!
@@ -115,7 +121,16 @@
{
return NULL;
}
-
+}
+/*!
+ Stub function.
+*/
+void MMPXCollectionUtility::FindAllL(const CMPXSearchCriteria& aCriteria,
+ const TArray<TMPXAttribute>& aAttrs,
+ MMPXCollectionFindObserver& aObs)
+{
+ Q_UNUSED(aObs);
+ iAsynchFindResult = FindAllL(aCriteria, aAttrs);
}
/*!
--- a/mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/stub/src/mpxplaybackutility.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/stub/src/mpxplaybackutility.cpp Fri May 28 19:46:01 2010 -0500
@@ -17,6 +17,7 @@
#include <Qt>
#include <mpxcollectionplaylist.h>
+#include <mpxcollectionpath.h>
#include <mptrace.h>
#include "stub/inc/mpxplaybackutility.h"
@@ -27,7 +28,8 @@
MMPXPlaybackUtility::MMPXPlaybackUtility():iShuffle(-1),
iRepeat(-1),
iProperty(EPbPropertyVolume),
- iPlay(EFalse)
+ iPlay(EFalse),
+ iCurrentPath(0)
{
}
@@ -60,7 +62,7 @@
*/
void MMPXPlaybackUtility::InitL(const CMPXCollectionPlaylist& aPlaylist, TBool aPlay)
{
- Q_UNUSED(aPlaylist);
+ iCurrentPath = aPlaylist.Path().ContainerPathL();
iPlay = aPlay;
}
--- a/mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/unittest_mpmpxcollectionframeworkwrapper.pro Fri May 14 18:54:37 2010 -0500
+++ b/mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/unittest_mpmpxcollectionframeworkwrapper.pro Fri May 28 19:46:01 2010 -0500
@@ -1,32 +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: Unit test for mpmpxframeworkwrapper
+#
+
TEMPLATE = app
-CONFIG += qtestlib \
- hb
-TARGET =
-
+CONFIG += qtestlib
+CONFIG += symbian_test
+TARGET = unittest_mpmpxcollectionframeworkwrapper
TARGET.CAPABILITY = All -TCB
DEPENDPATH += .
INCLUDEPATH += . \
../../inc \
../../../inc
-
INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
LIBS += -lestor.dll \
-lfbscli.dll \
-lmpxcommon.dll \
- -lmpxcollectionutility.dll \
- -lmpsettingsmanager
+ -lmpxcollectionutility.dll
HEADERS += inc/unittest_mpmpxcollectionframeworkwrapper.h \
../../inc/mpmpxcollectionframeworkwrapper.h \
@@ -37,7 +40,8 @@
stub/inc/mpxcollectionutility.h \
stub/inc/mpxcollectionhelperfactory.h \
stub/inc/mpxplaybackutility.h \
- stub/inc/mpmpxisolatedcollectionhelper.h
+ stub/inc/mpmpxisolatedcollectionhelper.h \
+ stub/inc/mpsettingsmanager.h
SOURCES += src/unittest_mpmpxcollectionframeworkwrapper.cpp \
../../src/mpmpxcollectionframeworkwrapper.cpp \
@@ -47,6 +51,6 @@
stub/src/mpxcollectionutility.cpp \
stub/src/mpxcollectionhelperfactory.cpp \
stub/src/mpxplaybackutility.cpp \
- stub/src/mpmpxisolatedcollectionhelper.cpp
+ stub/src/mpmpxisolatedcollectionhelper.cpp \
+ stub/src/mpsettingsmanager.cpp
-# RESOURCES += ../../resources/mpcollectionviewresources.qrc
--- a/mpengine/tsrc/unittest_mpmpxdetailsframeworkwrapper/UT_mpmpxdetailsframeworkwrapper.pkg Fri May 14 18:54:37 2010 -0500
+++ b/mpengine/tsrc/unittest_mpmpxdetailsframeworkwrapper/UT_mpmpxdetailsframeworkwrapper.pkg Fri May 28 19:46:01 2010 -0500
@@ -1,4 +1,3 @@
-;
; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
; All rights reserved.
; This component and the accompanying materials are made available
@@ -12,7 +11,7 @@
; Contributors:
;
; Description:
-;
+
; Language
&EN
--- a/mpengine/tsrc/unittest_mpmpxdetailsframeworkwrapper/unittest_mpmpxdetailsframeworkwrapper.pro Fri May 14 18:54:37 2010 -0500
+++ b/mpengine/tsrc/unittest_mpmpxdetailsframeworkwrapper/unittest_mpmpxdetailsframeworkwrapper.pro Fri May 28 19:46:01 2010 -0500
@@ -1,13 +1,18 @@
+#
# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
# All rights reserved.
# This component and the accompanying materials are made available
# under the terms of "Eclipse Public License v1.0"
# which accompanies this distribution, and is available
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
# Initial Contributors:
# Nokia Corporation - initial contribution.
+#
# Contributors:
-# Description: Unit test for mpmpxdetailsframeworkwrapper
+#
+# Description:
+#
TEMPLATE = app
CONFIG += qtestlib \
symbian_test \
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mpengine/tsrc/unittest_mpmpxplaybackframeworkwrapper/inc/unittest_mpmpxplaybackframeworkwrapper.h Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Unit test for mpmpxplaybackframeworkwrapper
+*
+*/
+
+#ifndef TESTMPMPXPLAYBACKFRAMEWORKWRAPPER_H
+#define TESTMPMPXPLAYBACKFRAMEWORKWRAPPER_H
+
+#include <QtTest/QtTest>
+
+class MpMpxPlaybackFrameworkWrapper;
+class MpMpxPlaybackFrameworkWrapperPrivate;
+class CMPXMedia;
+class MpPlaybackData;
+
+class TestMpMpxPlaybackFrameworkWrapper : public QObject
+{
+ Q_OBJECT
+
+public:
+
+ TestMpMpxPlaybackFrameworkWrapper();
+ virtual ~TestMpMpxPlaybackFrameworkWrapper();
+ //test utility functions
+ void loadTestData(TInt aPos);
+
+public slots:
+
+ void initTestCase();
+ void cleanupTestCase();
+ void init();
+ void cleanup();
+
+private slots:
+
+ void testConstructor();
+ void testPlaybackData();
+ void testStop();
+ void testPlayPause();
+ void testSkipForward();
+ void testSkipBackward();
+ void testSetPosition();
+ void testSetShuffle();
+ void testSetRepeat();
+ void testHandlePlaybackMessage();
+ void testHandleProperty();
+ void testHandleMedia();
+ void testRetrieveSongDetails();
+ void testUpdateState();
+ void testForceStop();
+ void testSetBalance();
+ void testApplyAudioEffects();
+ void testApplyEqualizer();
+ void testPlay();
+ void testStartSeekForward();
+ void testStopSeeking();
+ void testStartSeekBackward();
+ void testHandleSubPlayerNamesL();
+
+private:
+
+ MpMpxPlaybackFrameworkWrapper *mTest;
+ MpMpxPlaybackFrameworkWrapperPrivate *mTestPrivate;
+ CMPXMedia *iMediaTestData;
+
+};
+
+#endif // TESTMPMPXPLAYBACKFRAMEWORKWRAPPER_H
+
+
+
+
Binary file mpengine/tsrc/unittest_mpmpxplaybackframeworkwrapper/resources/nullsound.mp3 has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mpengine/tsrc/unittest_mpmpxplaybackframeworkwrapper/src/unittest_mpmpxplaybackframeworkwrapper.cpp Fri May 28 19:46:01 2010 -0500
@@ -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: Unit test for mpmpxpbframeworkwrapper
+*
+*/
+
+#include <mpxmedia.h>
+#include <mpxcollectionplaylist.h>
+#include <xqsharablefile.h>
+
+#include "mpxaudioeffectengine.h"
+#include "unittest_mpmpxplaybackframeworkwrapper.h"
+#include "stub/inc/mpplaybackdata.h"
+#include "stub/inc/mpxplaybackutility.h"
+
+
+// Do this so we can access all member variables.
+#define private public
+#include "mpmpxplaybackframeworkwrapper.h"
+#include "mpmpxplaybackframeworkwrapper_p.h"
+#undef private
+
+//This so we can test private functions
+#include "mpmpxplaybackframeworkwrapper_p.cpp"
+//Test data
+struct TTestAttrs
+ {
+ const wchar_t* GeneralTitle;
+ const wchar_t* MusicArtist;
+ const TInt GeneralCount;
+ const wchar_t* MusicAlbumArtFileName;
+ const wchar_t* MusicAlbum;
+ const wchar_t* MusicUri;
+ const wchar_t* MimeType;
+ };
+
+const TTestAttrs KAllSongsTestData[] =
+ {
+ { L"Title 1", L"Artist 1", 1, L"e:\\data\\images\\art1.jpg", L"Album 1", L"Uri 1", L"audio/x-pn-realaudio"}
+ ,{ L"Title 2", L"Artist 2", 1, L"e:\\data\\images\\art2.jpg", L"Album 2", L"Uri 2", L"audio/x-realaudio"}
+ };
+
+/*!
+ Make our test case a stand-alone executable that runs all the test functions.
+ */
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+ TestMpMpxPlaybackFrameworkWrapper tv;
+
+ if ( argc > 1 ) {
+ return QTest::qExec( &tv, argc, argv);
+ }
+ else {
+ char *pass[3];
+ pass[0] = argv[0];
+ pass[1] = "-o";
+ pass[2] = "c:\\data\\unittest_mpmpxplaybackframeworkwrapper.txt";
+
+ return QTest::qExec(&tv, 3, pass);
+ }
+}
+
+TestMpMpxPlaybackFrameworkWrapper::TestMpMpxPlaybackFrameworkWrapper()
+ : mTest(0),
+ iMediaTestData(0)
+{
+}
+
+TestMpMpxPlaybackFrameworkWrapper::~TestMpMpxPlaybackFrameworkWrapper()
+{
+ delete mTest;
+ delete iMediaTestData;
+}
+
+/*!
+ Called before the first testfunction is executed.
+ */
+void TestMpMpxPlaybackFrameworkWrapper::initTestCase()
+{
+}
+
+/*!
+ Called after the last testfunction was executed.
+ */
+void TestMpMpxPlaybackFrameworkWrapper::cleanupTestCase()
+{
+}
+
+/*!
+ Called before each testfunction is executed.
+ */
+void TestMpMpxPlaybackFrameworkWrapper::init()
+{
+
+ mTest = new MpMpxPlaybackFrameworkWrapper();
+ mTestPrivate = mTest->d_ptr;
+}
+
+/*!
+ Called after every testfunction.
+ */
+void TestMpMpxPlaybackFrameworkWrapper::cleanup()
+{
+ delete mTest;
+ mTest = 0;
+}
+
+/*!
+ Tests constructor.
+ */
+void TestMpMpxPlaybackFrameworkWrapper::testConstructor()
+{
+ QVERIFY(mTestPrivate->iPlaybackUtility != 0);
+ QVERIFY(mTestPrivate->iPlaybackData != 0);
+}
+
+/*!
+ Tests playbackData
+ */
+void TestMpMpxPlaybackFrameworkWrapper::testPlaybackData()
+{
+ MpPlaybackData *playbackdata;
+ playbackdata = mTest->playbackData();
+ QCOMPARE(mTestPrivate->iPlaybackData, playbackdata);
+}
+
+/*!
+ Tests stop.
+ */
+void TestMpMpxPlaybackFrameworkWrapper::testStop()
+{
+ mTest->stop();
+ QCOMPARE(mTestPrivate->iPlaybackUtility->iCmd, EPbCmdStop);
+}
+
+/*!
+ Tests playPause.
+ */
+void TestMpMpxPlaybackFrameworkWrapper::testPlayPause()
+{
+ mTest->playPause();
+ QCOMPARE(mTestPrivate->iPlaybackUtility->iCmd, EPbCmdPlayPause);
+}
+
+/*!
+ Tests skipForward.
+ */
+void TestMpMpxPlaybackFrameworkWrapper::testSkipForward()
+{
+ mTest->skipForward();
+ QCOMPARE(mTestPrivate->iPlaybackUtility->iCmd, EPbCmdNext);
+}
+
+/*!
+ Tests skipBackward
+ */
+void TestMpMpxPlaybackFrameworkWrapper::testSkipBackward()
+{
+ mTest->skipBackward();
+ QCOMPARE(mTestPrivate->iPlaybackUtility->iCmd, EPbCmdPrevious);
+}
+
+/*!
+ Tests setPosition
+ */
+void TestMpMpxPlaybackFrameworkWrapper::testSetPosition()
+{
+ mTest->setPosition(100);
+ QCOMPARE(mTestPrivate->iPlaybackUtility->iValue, 100);
+ QCOMPARE(mTestPrivate->iPlaybackUtility->iProperty, EPbPropertyPosition);
+ mTest->setPosition(50);
+ QCOMPARE(mTestPrivate->iPlaybackUtility->iValue, 50);
+ QCOMPARE(mTestPrivate->iPlaybackUtility->iProperty, EPbPropertyPosition);
+ mTest->setPosition(700);
+ QCOMPARE(mTestPrivate->iPlaybackUtility->iValue, 700);
+ QCOMPARE(mTestPrivate->iPlaybackUtility->iProperty, EPbPropertyPosition);
+}
+
+/*!
+ Tests setShuffle
+ */
+void TestMpMpxPlaybackFrameworkWrapper::testSetShuffle()
+{
+ mTest->setShuffle(true);
+ QCOMPARE(mTestPrivate->iPlaybackUtility->iValue, TBool(ETrue));
+ QCOMPARE(mTestPrivate->iPlaybackUtility->iProperty, EPbPropertyRandomMode);
+ mTest->setShuffle(false);
+ QCOMPARE(mTestPrivate->iPlaybackUtility->iValue, TBool(EFalse));
+ QCOMPARE(mTestPrivate->iPlaybackUtility->iProperty, EPbPropertyRandomMode);
+}
+
+/*!
+ Tests setRepeat
+ */
+void TestMpMpxPlaybackFrameworkWrapper::testSetRepeat()
+{
+ mTest->setRepeat(true);
+ QCOMPARE(TMPXPlaybackRepeatMode(mTestPrivate->iPlaybackUtility->iValue), EPbRepeatAll);
+ QCOMPARE(mTestPrivate->iPlaybackUtility->iProperty, EPbPropertyRepeatMode);
+ mTest->setRepeat(false);
+ QCOMPARE(TMPXPlaybackRepeatMode(mTestPrivate->iPlaybackUtility->iValue), EPbRepeatOff);
+ QCOMPARE(mTestPrivate->iPlaybackUtility->iProperty, EPbPropertyRepeatMode);
+}
+
+/*!
+ Tests handleProperty
+ */
+void TestMpMpxPlaybackFrameworkWrapper::testHandlePlaybackMessage()
+{
+ RArray<TInt> supportedIds;
+ CleanupClosePushL( supportedIds );
+ supportedIds.AppendL( KMPXMessageContentIdGeneral );
+ CMPXMedia* testMessage = CMPXMedia::NewL(supportedIds.Array());
+ CleanupStack::PopAndDestroy(&supportedIds);
+ CleanupStack::PushL(testMessage);
+ testMessage->SetTObjectValueL<TMPXMessageId>( KMPXMessageGeneralId, KMPXMessageGeneral);
+
+ //Update State
+ testMessage->SetTObjectValueL<TInt>(KMPXMessageGeneralEvent,TMPXPlaybackMessage::EStateChanged);
+ testMessage->SetTObjectValueL<TInt>(KMPXMessageGeneralType,0);
+ testMessage->SetTObjectValueL<TInt>(KMPXMessageGeneralData,0);
+ mTestPrivate->iPlaybackUtility->iState = EPbStatePlaying;
+ mTestPrivate->HandlePlaybackMessage(testMessage, KErrNone);
+ QCOMPARE(mTestPrivate->iPlaybackData->mPlaybackState, MpPlaybackData::Playing);
+
+ //Initialize complete
+ testMessage->SetTObjectValueL<TInt>(KMPXMessageGeneralEvent,TMPXPlaybackMessage::EInitializeComplete);
+ testMessage->SetTObjectValueL<TInt>(KMPXMessageGeneralType,0);
+ testMessage->SetTObjectValueL<TInt>(KMPXMessageGeneralData,1);
+ mTestPrivate->HandlePlaybackMessage(testMessage, KErrNone);
+ QCOMPARE(mTestPrivate->iPlaybackUtility->iCMPXCmd->ValueTObjectL<TInt>(KMPXCommandGeneralId),KMPXCommandIdPlaybackGeneral);
+ QCOMPARE(mTestPrivate->iPlaybackUtility->iCMPXCmd->ValueTObjectL<TInt>(KMPXCommandPlaybackGeneralType),TInt(EPbCmdPlay));
+ QCOMPARE(mTestPrivate->iPlaybackUtility->iCMPXCmd->ValueTObjectL<TBool>(KMPXCommandGeneralDoSync),TBool(ETrue));
+ QCOMPARE(mTestPrivate->iPlaybackUtility->iCMPXCmd->ValueTObjectL<TBool>(KMPXCommandPlaybackGeneralNoBuffer),TBool(ETrue));
+
+ //Property change
+ testMessage->SetTObjectValueL<TInt>(KMPXMessageGeneralEvent,TMPXPlaybackMessage::EPropertyChanged);
+ testMessage->SetTObjectValueL<TInt>(KMPXMessageGeneralType,EPbPropertyPosition);
+ testMessage->SetTObjectValueL<TInt>(KMPXMessageGeneralData,50);
+ mTestPrivate->HandlePlaybackMessage(testMessage, KErrNone);
+ QCOMPARE(mTestPrivate->iPlaybackData->mPosition, 50);
+
+ testMessage->SetTObjectValueL<TInt>(KMPXMessageGeneralType,EPbPropertyDuration);
+ testMessage->SetTObjectValueL<TInt>(KMPXMessageGeneralData,100);
+ mTestPrivate->HandlePlaybackMessage(testMessage, KErrNone);
+ QCOMPARE(mTestPrivate->iPlaybackData->mDuration, 100);
+
+ //Media change
+ testMessage->SetTObjectValueL<TInt>(KMPXMessageGeneralEvent,TMPXPlaybackMessage::EMediaChanged);
+ testMessage->SetTObjectValueL<TInt>(KMPXMessageGeneralType,0);
+ testMessage->SetTObjectValueL<TInt>(KMPXMessageGeneralData,0);
+ mTestPrivate->HandlePlaybackMessage(testMessage, KErrNone);
+ QCOMPARE(mTestPrivate->iPlaybackUtility->iAttrs->Count(), 8);
+
+ CleanupStack::PopAndDestroy(testMessage);
+}
+
+/*!
+ Tests handleProperty
+ */
+void TestMpMpxPlaybackFrameworkWrapper::testHandleProperty()
+{
+ for(TInt i = 0; i < 10; i++){
+ mTestPrivate->HandlePropertyL(EPbPropertyPosition, i, KErrNone);
+ mTestPrivate->HandlePropertyL(EPbPropertyDuration, i+1, KErrNone);
+ QCOMPARE(mTestPrivate->iPlaybackData->mPosition, i);
+ QCOMPARE(mTestPrivate->iPlaybackData->mDuration, i+1);
+ }
+ mTestPrivate->iPlaybackData->mPosition = 100;
+ mTestPrivate->iPlaybackData->mDuration = 100;
+ mTestPrivate->HandlePropertyL(EPbPropertyPosition, 10, KErrNotFound);
+ mTestPrivate->HandlePropertyL(EPbPropertyDuration, 10, KErrNotFound);
+
+ QCOMPARE(mTestPrivate->iPlaybackData->mPosition, 100);
+ QCOMPARE(mTestPrivate->iPlaybackData->mDuration, 100);
+}
+
+/*!
+ Tests handleMedia
+ */
+void TestMpMpxPlaybackFrameworkWrapper::testHandleMedia()
+{
+ loadTestData(0);
+ mTestPrivate->HandleMediaL(*iMediaTestData, KErrNone);
+ QCOMPARE(mTestPrivate->iPlaybackData->mMediaReady, TBool(ETrue));
+ mTestPrivate->iPlaybackData->mMediaReady = EFalse;
+ mTestPrivate->HandleMediaL(*iMediaTestData, KErrNone);
+ QCOMPARE(mTestPrivate->iPlaybackData->mMediaReady, TBool(EFalse));
+
+ loadTestData(1);
+ mTestPrivate->iPlaybackData->mMediaReady = EFalse;
+ mTestPrivate->HandleMediaL(*iMediaTestData, KErrNone);
+ QCOMPARE(mTestPrivate->iPlaybackData->mMediaReady, TBool(ETrue));
+ const TDesC& title = TPtrC(reinterpret_cast<const TUint16*>(KAllSongsTestData[1].GeneralTitle));
+ QCOMPARE(mTestPrivate->iPlaybackData->title(), QString::fromUtf16( title.Ptr(), title.Length() ));
+ const TDesC& artist = TPtrC(reinterpret_cast<const TUint16*>(KAllSongsTestData[1].MusicArtist));
+ QCOMPARE(mTestPrivate->iPlaybackData->artist(), QString::fromUtf16( artist.Ptr(), artist.Length() ));
+ const TDesC& album = TPtrC(reinterpret_cast<const TUint16*>(KAllSongsTestData[1].MusicAlbum));
+ QCOMPARE(mTestPrivate->iPlaybackData->album(), QString::fromUtf16( album.Ptr(), album.Length() ));
+ const TDesC& albumArt = TPtrC(reinterpret_cast<const TUint16*>(KAllSongsTestData[1].MusicAlbumArtFileName));
+ QCOMPARE(mTestPrivate->iPlaybackData->currentAAUri, QString::fromUtf16( albumArt.Ptr(), albumArt.Length() ));
+ const TDesC& albumUri = TPtrC(reinterpret_cast<const TUint16*>(KAllSongsTestData[1].MusicUri));
+ QCOMPARE(mTestPrivate->iPlaybackData->currentUri, QString::fromUtf16( albumUri.Ptr(), albumUri.Length() ));
+ QVERIFY(mTestPrivate->iPlaybackData->mRealAudio);
+ QCOMPARE(mTestPrivate->iPlaybackData->mId, 1);
+ QCOMPARE(mTestPrivate->iPlaybackData->mAlbumId, 2);
+
+ //Empty data
+ cleanup();
+ init();
+ RArray<TInt> supportedIds;
+ CleanupClosePushL( supportedIds );
+ supportedIds.AppendL( KMPXMediaIdMusic );
+ supportedIds.AppendL( KMPXMediaIdGeneral );
+ CMPXMedia* entries = CMPXMedia::NewL(supportedIds.Array());
+ CleanupStack::PopAndDestroy(&supportedIds);
+ CleanupStack::PushL(entries);
+ entries->SetTObjectValueL<TInt>(KMPXMediaGeneralCount, KAllSongsTestData[1].GeneralCount);
+ entries->SetTextValueL(KMPXMediaGeneralUri, TPtrC(reinterpret_cast<const TUint16*>(KAllSongsTestData[1].MusicUri)));
+ CMPXMedia* emptyTestData = CMPXMedia::NewL(*entries);
+ CleanupStack::PopAndDestroy(entries);
+ CleanupStack::PushL(emptyTestData);
+
+ mTestPrivate->iPlaybackData->mMediaReady = EFalse;
+ mTestPrivate->HandleMediaL(*emptyTestData, KErrNone);
+ QCOMPARE(mTestPrivate->iPlaybackData->mMediaReady, TBool(ETrue));
+ const TDesC& musicUri = TPtrC(reinterpret_cast<const TUint16*>(KAllSongsTestData[1].MusicUri));
+ QCOMPARE(mTestPrivate->iPlaybackData->title(), QString::fromUtf16( musicUri.Ptr(), musicUri.Length() ));
+ QCOMPARE(mTestPrivate->iPlaybackData->artist(), QString());
+ QCOMPARE(mTestPrivate->iPlaybackData->album(), QString());
+ QCOMPARE(mTestPrivate->iPlaybackData->currentAAUri, QString::fromUtf16( musicUri.Ptr(), musicUri.Length() ));
+ QCOMPARE(mTestPrivate->iPlaybackData->currentUri, QString::fromUtf16( musicUri.Ptr(), musicUri.Length() ));
+ QVERIFY(!mTestPrivate->iPlaybackData->mRealAudio);
+
+ CleanupStack::PopAndDestroy(emptyTestData);
+}
+
+/*!
+ Tests retrieveSong
+ */
+void TestMpMpxPlaybackFrameworkWrapper::testRetrieveSongDetails()
+{
+ mTestPrivate->RetrieveSongDetailsL();
+ QCOMPARE(mTestPrivate->iPlaybackUtility->iAttrs->Count(), 8);
+}
+
+/*!
+ Tests updateState
+ */
+void TestMpMpxPlaybackFrameworkWrapper::testUpdateState()
+{
+ mTestPrivate->iPlaybackUtility->iReturnSource = false;
+ mTestPrivate->UpdateStateL();
+ QCOMPARE(mTestPrivate->iPlaybackData->mPlaybackState, MpPlaybackData::NotPlaying);
+ mTestPrivate->iPlaybackUtility->iReturnSource = true;
+
+ mTestPrivate->iPlaybackUtility->iState = EPbStatePlaying;
+ mTestPrivate->UpdateStateL();
+ QCOMPARE(mTestPrivate->iPlaybackData->mPlaybackState, MpPlaybackData::Playing);
+
+ mTestPrivate->iPlaybackUtility->iState = EPbStatePaused;
+ mTestPrivate->UpdateStateL();
+ QCOMPARE(mTestPrivate->iPlaybackData->mPlaybackState, MpPlaybackData::Paused);
+
+ mTestPrivate->iPlaybackUtility->iState = EPbStatePlaying;
+ mTestPrivate->UpdateStateL();
+ QCOMPARE(mTestPrivate->iPlaybackData->mPlaybackState, MpPlaybackData::Playing);
+
+ mTestPrivate->iPlaybackUtility->iState = EPbStateStopped;
+ mTestPrivate->UpdateStateL();
+ QCOMPARE(mTestPrivate->iPlaybackData->mPlaybackState, MpPlaybackData::Stopped);
+}
+
+/*!
+ Tests forceStop
+ */
+void TestMpMpxPlaybackFrameworkWrapper::testForceStop()
+{
+ mTestPrivate->ForceStopL();
+ QCOMPARE(mTestPrivate->iPlaybackUtility->iCMPXCmd->ValueTObjectL<TInt>(KMPXCommandGeneralId),KMPXCommandIdPlaybackGeneral);
+ QCOMPARE(mTestPrivate->iPlaybackUtility->iCMPXCmd->ValueTObjectL<TInt>(KMPXCommandPlaybackGeneralType),TInt(EPbCmdStop));
+ QCOMPARE(mTestPrivate->iPlaybackUtility->iCMPXCmd->ValueTObjectL<TBool>(KMPXCommandGeneralDoSync),TBool(ETrue));
+ QCOMPARE(mTestPrivate->iPlaybackUtility->iCMPXCmd->ValueTObjectL<TBool>(KMPXCommandPlaybackGeneralNoBuffer),TBool(ETrue));
+}
+
+/*!
+ Tests setBalance
+ */
+void TestMpMpxPlaybackFrameworkWrapper::testSetBalance()
+{
+ int balance = 25;
+ mTest->setBalance( balance );
+ QCOMPARE(mTestPrivate->iPlaybackUtility->iValue, balance);
+ QCOMPARE(mTestPrivate->iPlaybackUtility->iProperty, EPbPropertyBalance);
+
+ balance = 75;
+ mTest->setBalance( balance );
+ QCOMPARE(mTestPrivate->iPlaybackUtility->iValue, balance);
+ QCOMPARE(mTestPrivate->iPlaybackUtility->iProperty, EPbPropertyBalance);
+}
+
+/*!
+ Tests applyAudioEffects
+ */
+void TestMpMpxPlaybackFrameworkWrapper::testApplyAudioEffects()
+{
+ mTest->applyAudioEffects();
+ QCOMPARE(mTestPrivate->iPlaybackUtility->iComandData, TInt(KAudioEffectsID));
+ QCOMPARE(mTestPrivate->iPlaybackUtility->iCmd, EPbApplyEffect);
+}
+
+/*!
+ Tests applyEqualizer
+ */
+void TestMpMpxPlaybackFrameworkWrapper::testApplyEqualizer()
+{
+ mTest->applyEqualizer();
+ QCOMPARE(mTestPrivate->iPlaybackUtility->iComandData, TInt(KEqualizerID));
+ QCOMPARE(mTestPrivate->iPlaybackUtility->iCmd, EPbApplyEffect);
+}
+
+/*!
+ Tests applyEqualizer
+ */
+void TestMpMpxPlaybackFrameworkWrapper::testPlay()
+{
+ //Play from filename
+ QString fileName = QString("z:\\system\\data\\nullsound.mp3");
+ mTest->play( fileName );
+ QVERIFY( mTestPrivate->iPlaybackUtility->iInitialized );
+
+ //Play from Shareable file
+ mTestPrivate->iPlaybackUtility->iInitialized = false;
+ _LIT( KMPXNullSoundPath, "z:\\system\\data\\nullsound.mp3" );
+ RFs fileServerSession;
+ RFile file;
+ TInt err( KErrNone );
+ err = fileServerSession.Connect();
+ if( err == KErrNone ) {
+ err = file.Open( fileServerSession, KMPXNullSoundPath, EFileShareReadersOrWriters );
+ if( err == KErrNone ) {
+ XQSharableFile* sFile = new XQSharableFile(file);
+
+ mTest->play( *sFile );
+ QVERIFY( mTestPrivate->iPlaybackUtility->iInitialized );
+
+ sFile->close();
+ delete sFile;
+ sFile = 0;
+ fileServerSession.Close();
+ }
+ else {
+ QWARN("Not able to Open test file");
+ }
+ }
+ else {
+ QWARN("Not able to create RF Session");
+ }
+}
+
+/*!
+ Tests startSeekForward()
+ */
+void TestMpMpxPlaybackFrameworkWrapper::testStartSeekForward()
+{
+ mTest->startSeekForward();
+ QCOMPARE(mTestPrivate->iPlaybackUtility->iCmd, EPbCmdStartSeekForward);
+}
+
+/*!
+ Tests stopSeeking()
+ */
+void TestMpMpxPlaybackFrameworkWrapper::testStopSeeking()
+{
+ mTest->stopSeeking();
+ QCOMPARE(mTestPrivate->iPlaybackUtility->iCmd, EPbCmdStopSeeking);
+}
+
+/*!
+ Tests startSeekBackward()
+ */
+void TestMpMpxPlaybackFrameworkWrapper::testStartSeekBackward()
+{
+ mTest->startSeekBackward();
+ QCOMPARE(mTestPrivate->iPlaybackUtility->iCmd, EPbCmdStartSeekBackward);
+}
+
+/*!
+ Tests HandleSubPlayerNamesL()
+ */
+void TestMpMpxPlaybackFrameworkWrapper::testHandleSubPlayerNamesL()
+{
+ //HandleSubPlayerNamesL does nothing, included just to cover all declared functions.
+ TUid stubUid = {0x00000001};
+ MDesCArray* stubArray = NULL;
+ mTestPrivate->HandleSubPlayerNamesL(stubUid, stubArray, false, KErrNone);
+ QVERIFY(mTestPrivate);
+}
+
+/*!
+ Used to load test data
+ */
+void TestMpMpxPlaybackFrameworkWrapper::loadTestData(TInt aPos)
+{
+ if(iMediaTestData){
+ delete iMediaTestData;
+ iMediaTestData=0;
+ }
+ RArray<TInt> supportedIds;
+ CleanupClosePushL( supportedIds );
+ supportedIds.AppendL( KMPXMediaIdMusic );
+ supportedIds.AppendL( KMPXMediaIdGeneral );
+ CMPXMedia* entries = CMPXMedia::NewL(supportedIds.Array());
+ CleanupStack::PopAndDestroy(&supportedIds);
+ CleanupStack::PushL(entries);
+
+ entries->SetTObjectValueL<TInt>(KMPXMediaGeneralId, 1);
+ entries->SetTObjectValueL<TInt>(KMPXMediaMusicAlbumId, 2);
+ entries->SetTextValueL(KMPXMediaGeneralTitle, TPtrC(reinterpret_cast<const TUint16*>(KAllSongsTestData[aPos].GeneralTitle)));
+ entries->SetTextValueL(KMPXMediaMusicArtist, TPtrC(reinterpret_cast<const TUint16*>(KAllSongsTestData[aPos].MusicArtist)));
+ entries->SetTObjectValueL<TInt>(KMPXMediaGeneralCount, KAllSongsTestData[aPos].GeneralCount);
+ entries->SetTextValueL(KMPXMediaMusicAlbumArtFileName, TPtrC(reinterpret_cast<const TUint16*>(KAllSongsTestData[aPos].MusicAlbumArtFileName)));
+ entries->SetTextValueL(KMPXMediaMusicAlbum, TPtrC(reinterpret_cast<const TUint16*>(KAllSongsTestData[aPos].MusicAlbum)));
+ entries->SetTextValueL(KMPXMediaGeneralUri, TPtrC(reinterpret_cast<const TUint16*>(KAllSongsTestData[aPos].MusicUri)));
+ entries->SetTextValueL(TMPXAttribute(KMPXMediaGeneralMimeType), TPtrC(reinterpret_cast<const TUint16*>(KAllSongsTestData[aPos].MimeType)));
+
+ iMediaTestData = CMPXMedia::NewL(*entries);
+ CleanupStack::PopAndDestroy(entries);
+}
+
+//end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mpengine/tsrc/unittest_mpmpxplaybackframeworkwrapper/stub/inc/hbglobal.h Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: HbTrId stub
+*
+*/
+
+#ifndef HBGLOBAL_H
+#define HBGLOBAL_H
+
+#include <QtCore/qstring.h>
+
+typedef QString hbTrId;
+
+#endif // HBGLOBAL_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mpengine/tsrc/unittest_mpmpxplaybackframeworkwrapper/stub/inc/mpplaybackdata.h Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Playback Data stub for testing mpmpxpbframeworkwrapper
+*
+*/
+
+#ifndef MPPLAYBACKDATA_H
+#define MPPLAYBACKDATA_H
+
+#include <QObject>
+#include <QString>
+
+
+//class declaration
+class MpPlaybackData : public QObject
+{
+ Q_OBJECT
+
+public:
+ enum SimplifiedPlaybackState {
+ NotPlaying,
+ Playing,
+ Paused,
+ Stopped
+ };
+
+ explicit MpPlaybackData();
+ virtual ~MpPlaybackData();
+
+ void setDuration( int duration);
+ void setPosition( int position);
+ bool setTitle( const QString& title);
+ bool setAlbum( const QString& album);
+ bool setArtist( const QString& artist);
+ void setAlbumArtUri( const QString& albumArtUri);
+ void setUri( const QString& aUri);
+ void setPlaybackState(const SimplifiedPlaybackState state );
+ int duration() const;
+ int position() const;
+ const QString& title() const;
+ const QString& album() const;
+ const QString& artist() const;
+ MpPlaybackData::SimplifiedPlaybackState playbackState();
+ void commitPlaybackInfo();
+ void handleMediaReady();
+ bool setRealAudio( bool mode );
+ bool setAlbumId( int id );
+ bool setId( int id );
+ void resetData();
+
+
+public:
+ int mDuration;
+ int mPosition;
+ QString mTitle;
+ QString mAlbum;
+ QString mArtist;
+ SimplifiedPlaybackState mPlaybackState;
+ QString currentAAUri;
+ QString currentUri;
+ TBool mMediaReady;
+ bool mRealAudio;
+ int mAlbumId;
+ int mId;
+
+ Q_DISABLE_COPY(MpPlaybackData)
+};
+
+#endif // MPPLAYBACKDATA_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mpengine/tsrc/unittest_mpmpxplaybackframeworkwrapper/stub/inc/mpxplaybackutility.h Fri May 28 19:46:01 2010 -0500
@@ -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: mpxplaybackutility stub for testing mpmpxframeworkwrapper
+*
+*/
+
+
+#ifndef MMPXPLAYBACKUTILITY_H
+#define MMPXPLAYBACKUTILITY_H
+
+#include <mpxplaybackframeworkdefs.h>
+#include <mpxcommonframeworkdefs.h>
+#include <badesca.h>
+#include <mpxattribute.h>
+#include <mpxattributespecs.h>
+
+//Forward declarations
+class CMPXCollectionPlaylist;
+class MMPXPlaybackObserver;
+class MMPXPlaybackCallback;
+
+class MMPXSource
+{
+public:
+ //MMPXSource interface for playback utility stub
+ virtual CMPXCollectionPlaylist* PlaylistL()=0;
+ virtual void MediaL(const TArray<TMPXAttribute>& aAttrs,
+ MMPXPlaybackCallback& aCallback)=0;
+
+
+};
+
+class MMPXPlaybackUtility: public MMPXSource
+{
+public:
+
+ // Stub functions
+ MMPXPlaybackUtility();
+ ~MMPXPlaybackUtility();
+ static MMPXPlaybackUtility* UtilityL(const TUid& aModeId = KPbModeDefault);
+ void AddObserverL(MMPXPlaybackObserver& aObs);
+ void RemoveObserverL(MMPXPlaybackObserver& aObs);
+ void Close();
+ void CommandL(TMPXPlaybackCommand aCmd,TInt aData=0);
+ void CommandL(CMPXCommand& aCmd, MMPXPlaybackCallback* aCallback=NULL);
+ MMPXSource* Source();
+ void SetL(TMPXPlaybackProperty aProperty, TInt aValue);
+ TMPXPlaybackState StateL() const;
+ // Stub function from MMPXSource
+ CMPXCollectionPlaylist* PlaylistL();
+ void MediaL(const TArray<TMPXAttribute>& aAttrs,
+ MMPXPlaybackCallback& aCallback);
+ void InitL(RFile& aShareableFile);
+ void InitL(const TDesC& aUri,const TDesC8* aType=NULL);
+
+
+public:
+
+ TInt iValue;
+ TInt iComandData;
+ TMPXPlaybackProperty iProperty;
+ MMPXPlaybackObserver* iObs;
+ TMPXPlaybackCommand iCmd;
+ CMPXCommand* iCMPXCmd;
+ TMPXPlaybackState iState;
+ RArray<TMPXAttribute>* iAttrs;
+ bool iInitialized;
+ bool iReturnSource;
+};
+
+#endif // MMPXPLAYBACKUTILITY_H
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mpengine/tsrc/unittest_mpmpxplaybackframeworkwrapper/stub/src/mpplaybackdata.cpp Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,282 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 Data stub for testing mpmpxframeworkwrapper
+*
+*/
+
+
+#include <QString>
+
+#include "stub/inc/mpplaybackdata.h"
+#include "mptrace.h"
+
+
+/*!
+ Stub function.
+*/
+MpPlaybackData::MpPlaybackData()
+ : mDuration( 0 ),
+ mPosition( 0 ),
+ mTitle(""),
+ mAlbum(""),
+ mArtist("Unknown"),
+ mMediaReady(EFalse),
+ mPlaybackState(MpPlaybackData::Stopped),
+ mRealAudio( false ),
+ mAlbumId( 0 ),
+ mId( 0 )
+{
+}
+
+/*!
+ Stub function.
+*/
+MpPlaybackData::~MpPlaybackData()
+{
+}
+
+/*!
+ Stub function.
+*/
+int MpPlaybackData::duration() const
+{
+ TX_LOG
+ return mDuration;
+}
+
+/*!
+ Stub function.
+*/
+int MpPlaybackData::position() const
+{
+ TX_LOG
+ return mPosition;
+}
+
+/*!
+ Stub function.
+*/
+const QString& MpPlaybackData::title() const
+{
+ TX_LOG
+ return mTitle;
+}
+
+/*!
+ Stub function.
+*/
+const QString& MpPlaybackData::album() const
+{
+ TX_LOG
+ return mAlbum;
+}
+
+/*!
+ Stub function.
+*/
+const QString& MpPlaybackData::artist() const
+{
+ TX_LOG
+ return mArtist;
+}
+
+/*!
+ Stub function.
+*/
+MpPlaybackData::SimplifiedPlaybackState MpPlaybackData::playbackState()
+{
+ TX_LOG_ARGS("mPlaybackState=" << mPlaybackState)
+ return mPlaybackState;
+}
+
+/*!
+ Stub function.
+*/
+void MpPlaybackData::setDuration( int duration )
+{
+ TX_ENTRY_ARGS( "duration =" << duration )
+ mDuration = duration;
+ TX_EXIT
+}
+
+/*!
+ Stub function.
+*/
+void MpPlaybackData::setPosition( int position )
+{
+ TX_ENTRY_ARGS( "position =" << position )
+ mPosition = position;
+ TX_EXIT
+}
+
+/*!
+ Stub function.
+*/
+bool MpPlaybackData::setTitle( const QString& title )
+{
+ TX_ENTRY_ARGS( "title =" << title )
+ bool change = false;
+ if ( title != mTitle ) {
+ change = true;
+ mTitle = title;
+ }
+ TX_EXIT
+ return change;
+}
+
+/*!
+ Stub function.
+*/
+bool MpPlaybackData::setAlbum( const QString& album )
+{
+ TX_ENTRY_ARGS( "album =" << album )
+ bool change = false;
+ if ( album != mAlbum ) {
+ change = true;
+ mAlbum = album;
+ }
+ TX_EXIT
+ return change;
+}
+
+/*!
+ Stub function.
+*/
+bool MpPlaybackData::setArtist( const QString& artist )
+{
+ TX_ENTRY_ARGS( "artist =" << artist )
+ bool change = false;
+ if ( artist != mArtist ) {
+ change = true;
+ mArtist = artist;
+ }
+ TX_EXIT
+ return change;
+}
+
+
+/*!
+ Stub function.
+*/
+void MpPlaybackData::setAlbumArtUri( const QString& albumArtUri)
+{
+ TX_ENTRY_ARGS( "albumArtUri =" << albumArtUri )
+ if ( !albumArtUri.isEmpty() ) {
+ if ( albumArtUri != currentAAUri ) {
+ currentAAUri = albumArtUri;
+ }
+ }
+ TX_EXIT
+}
+
+/*!
+ Stub function.
+*/
+void MpPlaybackData::setUri( const QString& aUri)
+{
+ TX_ENTRY_ARGS( "aUri =" << aUri )
+ if ( !aUri.isEmpty() ) {
+ if ( aUri != currentUri ) {
+ currentUri = aUri;
+ }
+ }
+ TX_EXIT
+}
+
+/*!
+ Stub function.
+*/
+void MpPlaybackData::setPlaybackState(const SimplifiedPlaybackState state )
+{
+ TX_ENTRY_ARGS( "state =" << state )
+ mPlaybackState = state;
+ TX_EXIT
+}
+
+/*!
+ Stub function.
+*/
+void MpPlaybackData::commitPlaybackInfo()
+{
+ TX_ENTRY
+ mMediaReady = ETrue;
+ TX_EXIT
+}
+
+/*!
+ Stub function.
+*/
+void MpPlaybackData::handleMediaReady()
+{
+ mMediaReady = ETrue;
+}
+
+/*!
+Stub function.
+*/
+bool MpPlaybackData::setRealAudio( bool mode )
+{
+ if( mRealAudio != mode ) {
+ mRealAudio = mode;
+ return true;
+ }
+ else {
+ return false;
+ }
+}
+
+/*!
+Stub function.
+*/
+bool MpPlaybackData::setAlbumId( int id )
+{
+ if ( mAlbumId != id ) {
+ mAlbumId = id;
+ return true;
+ }
+ else {
+ return false;
+ }
+}
+
+/*!
+Stub function.
+*/
+bool MpPlaybackData::setId( int id )
+{
+ if( mId != id ) {
+ mId = id;
+ return true;
+ }
+ else {
+ return false;
+ }
+}
+
+/*!
+Stub function.
+*/
+void MpPlaybackData::resetData()
+{
+ mDuration = 0;
+ mPosition = 0;
+ mTitle = QString();
+ mAlbum = QString();
+ mArtist = QString();
+ currentUri = QString();
+ mAlbumId = 0;
+ mId = 0;
+ mRealAudio = false;
+}
+//end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mpengine/tsrc/unittest_mpmpxplaybackframeworkwrapper/stub/src/mpxplaybackutility.cpp Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,173 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: mpxplaybackutility stub for testing mpmpxframeworkwrapper
+*
+*/
+
+#include <Qt>
+#include <mpxcollectionplaylist.h>
+#include <mptrace.h>
+
+#include "stub/inc/mpxplaybackutility.h"
+
+/*!
+ Stub function.
+*/
+MMPXPlaybackUtility::MMPXPlaybackUtility():iProperty(EPbPropertyVolume),
+ iObs(0),
+ iValue(0),
+ iComandData(0),
+ iState(EPbStateNotInitialised),
+ iAttrs(0),
+ iCMPXCmd(0),
+ iInitialized(false),
+ iReturnSource(true)
+{
+}
+
+/*!
+ Stub function.
+*/
+MMPXPlaybackUtility::~MMPXPlaybackUtility()
+{
+}
+
+/*!
+ Stub function.
+ */
+MMPXPlaybackUtility* MMPXPlaybackUtility::UtilityL(const TUid& aModeId)
+{
+ Q_UNUSED(aModeId);
+ static MMPXPlaybackUtility playbackUtilility;
+ return &playbackUtilility;
+}
+
+/*!
+ Stub function.
+*/
+void MMPXPlaybackUtility::AddObserverL(MMPXPlaybackObserver& aObs)
+{
+ iObs = &aObs;
+}
+
+/*!
+ Stub function.
+*/
+void MMPXPlaybackUtility::RemoveObserverL(MMPXPlaybackObserver& aObs)
+{
+ if(iObs == &aObs){
+ iObs = 0;
+ }
+}
+
+/*!
+ Stub function.
+*/
+void MMPXPlaybackUtility::Close()
+{
+}
+
+/*!
+ Stub function.
+*/
+void MMPXPlaybackUtility::CommandL(TMPXPlaybackCommand aCmd,TInt aData)
+{
+ iComandData = aData;
+ iCmd = aCmd;
+}
+
+/*!
+ Stub function.
+*/
+void MMPXPlaybackUtility::CommandL(CMPXCommand& aCmd, MMPXPlaybackCallback* aCallback)
+{
+ Q_UNUSED(aCallback);
+ if(iCMPXCmd){
+ delete iCMPXCmd;
+ iCMPXCmd = 0;
+ }
+ iCMPXCmd = CMPXCommand::NewL(aCmd);
+}
+
+/*!
+ Stub function.
+*/
+MMPXSource* MMPXPlaybackUtility::Source()
+{
+ if (iReturnSource) {
+ return this;
+ }
+ else {
+ return NULL;
+ }
+}
+
+/*!
+ Stub function.
+*/
+void MMPXPlaybackUtility::SetL(TMPXPlaybackProperty aProperty, TInt aValue)
+{
+ iProperty = aProperty;
+ iValue = aValue;
+}
+
+/*!
+ Stub function.
+*/
+TMPXPlaybackState MMPXPlaybackUtility::StateL() const
+{
+ return iState;
+}
+
+/*!
+ Stub function.
+*/
+CMPXCollectionPlaylist* MMPXPlaybackUtility::PlaylistL()
+{
+ CMPXCollectionPlaylist* temp = CMPXCollectionPlaylist::NewL();
+ return temp;
+}
+
+/*!
+ Stub function.
+*/
+void MMPXPlaybackUtility::MediaL(const TArray<TMPXAttribute>& aAttrs,
+ MMPXPlaybackCallback& aCallback)
+{
+ Q_UNUSED(aCallback);
+ RArray<TMPXAttribute> attrs;
+ CleanupClosePushL(attrs);
+ for(TInt i = 0; i < aAttrs.Count(); i++){
+ attrs.AppendL(aAttrs[i]);
+ }
+ iAttrs = new RArray<TMPXAttribute>(attrs);
+ CleanupStack::PopAndDestroy(&attrs);
+
+}
+
+void MMPXPlaybackUtility::InitL(const TDesC& aUri,const TDesC8* aType)
+{
+ Q_UNUSED(aType);
+ if ( aUri.Length() )
+ {
+ iInitialized = true;
+ }
+}
+
+void MMPXPlaybackUtility::InitL(RFile& aShareableFile)
+{
+ Q_UNUSED(aShareableFile)
+ iInitialized = true;
+}
+//end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mpengine/tsrc/unittest_mpmpxplaybackframeworkwrapper/unittest_mpmpxplaybackframeworkwrapper.pro Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,56 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: Unit test for mpmpxplaybackframeworkwrapper
+#
+
+TEMPLATE = app
+CONFIG += qtestlib
+CONFIG += symbian_test
+TARGET = unittest_mpmpxplaybackframeworkwrapper
+TARGET.CAPABILITY = All -TCB
+
+DEPENDPATH += .
+INCLUDEPATH += . \
+ ../../inc \
+ ../../../inc
+INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+
+symbian:
+{
+ TARGET.EPOCALLOWDLLDATA = 1
+
+ BLD_INF_RULES.prj_exports += \
+ "resources/nullsound.mp3 /epoc32/release/winscw/udeb/Z/system/data/nullsound.mp3" \
+ "resources/nullsound.mp3 /epoc32/release/winscw/urel/Z/system/data/nullsound.mp3" \
+ "resources/nullsound.mp3 /epoc32/data/Z/system/data/nullsound.mp3"
+}
+
+LIBS += -lestor.dll \
+ -lfbscli.dll \
+ -lmpxcommon.dll \
+ -lmpxcollectionutility.dll \
+ -lxqserviceutil
+
+HEADERS += inc/unittest_mpmpxplaybackframeworkwrapper.h \
+ ../../inc/mpmpxplaybackframeworkwrapper.h \
+ ../../inc/mpmpxplaybackframeworkwrapper_p.h \
+ stub/inc/mpplaybackdata.h \
+ stub/inc/mpxplaybackutility.h \
+ stub/inc/hbglobal.h \
+ ../../../mpserviceplugins/inc/mpxaudioeffectengine.h
+
+SOURCES += src/unittest_mpmpxplaybackframeworkwrapper.cpp \
+ ../../src/mpmpxplaybackframeworkwrapper.cpp \
+ stub/src/mpplaybackdata.cpp \
+ stub/src/mpxplaybackutility.cpp
--- a/mpserviceplugins/audioeffects/src/mpxaudioeffectengine.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpserviceplugins/audioeffects/src/mpxaudioeffectengine.cpp Fri May 28 19:46:01 2010 -0500
@@ -109,9 +109,20 @@
iProp->LoadFromFileL();
if(iMdaPlayer)
{
- if(iMdaPlayer->SetBalance(iProp->Balance())!=KErrNone)
+ TInt currentBalance;
+ TInt err = iMdaPlayer->GetBalance(currentBalance);
+ if( err !=KErrNone )
+ {
+ User::Leave(KErrNotSupported);
+ }
+ // don't set non-changed values:
+ if( iProp->Balance() != currentBalance )
{
- User::Leave(KErrNotSupported);
+ err = iMdaPlayer->SetBalance(iProp->Balance());
+ if( err !=KErrNone )
+ {
+ User::Leave(KErrNotSupported);
+ }
}
}
}
@@ -219,14 +230,18 @@
}
}
- iStereoEffect->EnableL();
- TUint8 level = 30;
- iStereoEffect->SetStereoWideningLevelL( level );
- iStereoEffect->ApplyL();
+ if ( !iStereoEffect->IsEnabled() )
+ {
+ iStereoEffect->EnableL();
+ TUint8 level = 30;
+ iStereoEffect->SetStereoWideningLevelL( level );
+ iStereoEffect->ApplyL();
+ }
+
}
else
{
- if (iStereoEffect) // If audio effects was not on, then no need to disable
+ if (iStereoEffect && iStereoEffect->IsEnabled() ) // If audio effects was not on, then no need to disable
{
iStereoEffect->DisableL();
}
@@ -295,12 +310,15 @@
}
}
- iLoudnessEffect->EnableL();
+ if( !iLoudnessEffect->IsEnabled() )
+ {
+ iLoudnessEffect->EnableL();
+ }
}
else
- {
- if( iLoudnessEffect ) // Only disable if it was constructed
- {
+ {
+ if( iLoudnessEffect && iLoudnessEffect->IsEnabled() )
+ {
iLoudnessEffect->DisableL();
}
}
--- a/mpserviceplugins/inc/mpxdbcommondef.h Fri May 14 18:54:37 2010 -0500
+++ b/mpserviceplugins/inc/mpxdbcommondef.h Fri May 28 19:46:01 2010 -0500
@@ -34,6 +34,10 @@
_LIT(KMCAndKeyword," AND ");
_LIT(KMCOrKeyword, " OR ");
+// QT localization TS file
+_LIT(KMPXMusicPlayerTsFile, "musicplayer_");
+_LIT(KMPXMusicPlayerTsPath, "z:/resource/qt/translations/");
+
#endif // MPXDBCOMMONDEF_H
//End of File
--- a/mpserviceplugins/localaudio/src/mpxlocalaudioplayback.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpserviceplugins/localaudio/src/mpxlocalaudioplayback.cpp Fri May 28 19:46:01 2010 -0500
@@ -433,14 +433,19 @@
{
// Re-init audio effects
MPX_DEBUG1("CMPXLocalAudioPlayback::CommandL EPbApplyEffect");
- iAudioEffects->DestroyAudioEffect();
if( ( aData == KAudioEffectsID || aData == KEqualizerID ) &&
( EStateInitialised == iState ) )
{
+ // Here we rely on CreateAudioEffectsL() to be safe to be called
+ // in order to just set values again
TRAPD(err, iAudioEffects->CreateAudioEffectsL() );
if(err)
{
MPX_DEBUG2("EPbApplyEffect err = %d", err);
+ // Sometimes we get KErrAccessDenied, then destroying effects
+ // and setting them again should help. This is a work-around,
+ // and would be good to be fixed more properly.
+ iAudioEffects->DestroyAudioEffect();
TRAPD(err, iAudioEffects->CreateAudioEffectsL() );
if(err)
{
--- a/mpserviceplugins/mpxsqlitedbhgplugin/group/mpxsqlitedbhgplugin.mmp Fri May 14 18:54:37 2010 -0500
+++ b/mpserviceplugins/mpxsqlitedbhgplugin/group/mpxsqlitedbhgplugin.mmp Fri May 28 19:46:01 2010 -0500
@@ -82,6 +82,7 @@
APP_LAYER_SYSTEMINCLUDE
SYSTEMINCLUDE /epoc32/include/ecom
SYSTEMINCLUDE /epoc32/include/mmf/common
+SYSTEMINCLUDE /epoc32/include/mw/hb/hbcore
LIBRARY euser.lib
LIBRARY ecom.lib
@@ -91,6 +92,7 @@
LIBRARY bafl.lib
LIBRARY apmime.lib
LIBRARY sysutil.lib
+LIBRARY hbcore.lib
#ifdef __MTP_PROTOCOL_SUPPORT
LIBRARY centralrepository.lib
#endif
--- a/mpserviceplugins/mpxsqlitedbhgplugin/src/mpxdbautoplaylist.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpserviceplugins/mpxsqlitedbhgplugin/src/mpxdbautoplaylist.cpp Fri May 28 19:46:01 2010 -0500
@@ -20,6 +20,7 @@
#include <mpxlog.h>
#include <mpxcollectiondbhgres.rsg>
#include <sqldb.h>
+#include <hbtextresolversymbian.h>
#include "mpxresource.h"
#include "mpxdbcommonutil.h"
@@ -28,17 +29,13 @@
#include "mpxcollectiondbdef.h"
#include "mpxdbautoplaylist.h"
#include "mpxdbpluginqueries.h"
+#include "mpxdbcommondef.h"
const TInt KMPXTableDefaultIndex = 0;
const TInt32 KMPXRecentlyPlayedPlaylistId = 0x20000000;
const TInt32 KMPXMostPlayedPlaylistId = 0x20000001;
const TInt32 KMPXRecentlyAddedPlaylistId = 0x20000002;
-const TInt KPlaylistTitleSize = 32;
-_LIT( KMostPlayed, "Most played" );
-_LIT( KRecentlyPlayed, "Recently played" );
-_LIT( KRecentlyAdded, "Recently added" );
-
// ============================ MEMBER FUNCTIONS ==============================
@@ -107,12 +104,26 @@
CMPXResource& /*aResource*/)
{
MPX_FUNC("CMPXDbAutoPlaylist::ConstructL");
- iRecentlyPlayedPlaylist = HBufC::NewL(KPlaylistTitleSize);
- iRecentlyPlayedPlaylist->Des().Append(KMostPlayed);
- iMostPlayedPlaylist = HBufC::NewL(KPlaylistTitleSize);
- iMostPlayedPlaylist->Des().Append(KRecentlyPlayed);
- iRecentlyAddedPlaylist = HBufC::NewL(KPlaylistTitleSize);
- iRecentlyAddedPlaylist->Des().Append(KRecentlyAdded);
+
+ // Localization using QT
+ TBool result = HbTextResolverSymbian::Init(KMPXMusicPlayerTsFile, KMPXMusicPlayerTsPath);
+ if ( result )
+ {
+ iMostPlayedPlaylist = HbTextResolverSymbian::LoadL( _L("txt_mus_list_most_played") );
+ iRecentlyAddedPlaylist = HbTextResolverSymbian::LoadL( _L("txt_mus_list_recently_added") );
+ iRecentlyPlayedPlaylist = HbTextResolverSymbian::LoadL( _L("txt_mus_list_recently_played") );
+ }
+ else
+ {
+ // error initializing HbTextResolverSymbian, use logical string.
+ MPX_DEBUG1("CMPXDbAutoPlaylist::ConstructL - HbTextResolverSymbian::Init() Failed.");
+ TBufC<50> buf( _L("txt_mus_list_most_played") );
+ iMostPlayedPlaylist = buf.AllocL();
+ buf = _L("txt_mus_list_recently_added");
+ iRecentlyAddedPlaylist = buf.AllocL();
+ buf = _L("txt_mus_list_recently_played");
+ iRecentlyPlayedPlaylist = buf.AllocL();
+ }
iRecentlyPlayedPlaylistId = KMPXRecentlyPlayedPlaylistId;
iMostPlayedPlaylistId = KMPXMostPlayedPlaylistId;
--- a/mpserviceplugins/mpxsqlitedbhgplugin/src/mpxdbplugin.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpserviceplugins/mpxsqlitedbhgplugin/src/mpxdbplugin.cpp Fri May 28 19:46:01 2010 -0500
@@ -21,6 +21,7 @@
#include <StringLoader.h>
#include <bautils.h>
#include <data_caging_path_literals.hrh>
+#include <hbtextresolversymbian.h>
#include <mpxcmn.h>
#include <mpxuser.h>
@@ -145,7 +146,20 @@
iDbHandler = CMPXDbHandler::NewL(iFs, *iResource);
iMusicLibraryMenuTitles = iResource->ReadMenuArrayL(R_MC_MENU_ITEMS_ARRAY, iMusicLibraryMenuIds);
iMusicLibraryTitles = iResource->ReadMenuArrayL(R_MC_TITLE_ITEMS_ARRAY, iMusicLibraryMenuIds );
- iAllSongsForArtistTitle = iResource->ReadHBufCL(R_MC_ALL_SONGS_FOR_ARTIST);
+
+ // Localization using QT
+ TBool result = HbTextResolverSymbian::Init(KMPXMusicPlayerTsFile, KMPXMusicPlayerTsPath);
+ if ( result )
+ {
+ iAllSongsForArtistTitle = HbTextResolverSymbian::LoadL( _L("txt_mus_dblist_all_songs") );
+ }
+ else
+ {
+ // error initializing HbTextResolverSymbian, use logical string.
+ MPX_DEBUG1("CMPXDbPlugin::ConstructL - HbTextResolverSymbian::Init() Failed.");
+ TBufC<50> buf( _L("txt_mus_dblist_all_songs") );
+ iAllSongsForArtistTitle = buf.AllocL();
+ }
#ifdef __ENABLE_MUSIC_TEXT_ALIGNMENT
iMusicMenuTitle = iResource->ReadHBufCL(R_MPX_QTN_MP_TITLE_MY_MUSIC_MENU_NSERIES);
--- a/mpviewplugins/mpcollectionviewplugin/inc/mpcollectioncontainer.h Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpcollectionviewplugin/inc/mpcollectioncontainer.h Fri May 28 19:46:01 2010 -0500
@@ -49,6 +49,7 @@
void itemLongPressed( int index, const QPointF &coords );
void findAlbumSongs( int index );
void playAlbumSongs( int albumIndex, int songIndex );
+ void shuffleEnabled( bool enabled );
public slots:
--- a/mpviewplugins/mpcollectionviewplugin/inc/mpcollectioncontaineralbums.h Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpcollectionviewplugin/inc/mpcollectioncontaineralbums.h Fri May 28 19:46:01 2010 -0500
@@ -41,6 +41,8 @@
void albumCentered();
void dataReloaded();
void albumDataChanged();
+ void scrollingStarted();
+ void albumDataAvailable();
private:
--- a/mpviewplugins/mpcollectionviewplugin/inc/mpcollectioncontainerallsongs.h Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpcollectionviewplugin/inc/mpcollectioncontainerallsongs.h Fri May 28 19:46:01 2010 -0500
@@ -31,6 +31,10 @@
explicit MpCollectionContainerAllSongs( HbDocumentLoader *loader, QGraphicsItem *parent=0 );
virtual ~MpCollectionContainerAllSongs();
+public slots:
+
+ void dataReloaded();
+
private:
void setupContainer();
--- a/mpviewplugins/mpcollectionviewplugin/inc/mpcollectioncontainerartists.h Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpcollectionviewplugin/inc/mpcollectioncontainerartists.h Fri May 28 19:46:01 2010 -0500
@@ -41,6 +41,8 @@
void albumCentered();
void dataReloaded();
void albumDataChanged();
+ void scrollingStarted();
+ void albumDataAvailable();
private:
--- a/mpviewplugins/mpcollectionviewplugin/inc/mpcollectionlistcontainer.h Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpcollectionviewplugin/inc/mpcollectionlistcontainer.h Fri May 28 19:46:01 2010 -0500
@@ -60,6 +60,7 @@
HbLabel *mNoMusic;
HbIndexFeedback *mIndexFeedback;
int mLongPressedIndex;
+ bool mLongPressEnabled;
};
--- a/mpviewplugins/mpcollectionviewplugin/inc/mpcollectionview.h Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpcollectionviewplugin/inc/mpcollectionview.h Fri May 28 19:46:01 2010 -0500
@@ -102,6 +102,8 @@
void handleLibraryAboutToUpdate();
void handleLibraryUpdated();
+ void setShuffleAction( bool enabled );
+
private:
void setMainToolBar();
@@ -137,6 +139,8 @@
HbMainWindow *mWindow; // Not own
HbAction *mSoftKeyQuit; // Not own
HbAction *mSoftKeyBack; // Not own
+ HbAction *mShuffleAction; // Not own
+ bool mShuffleEnabled;
MpCollectionDocumentLoader *mDocumentLoader; // Own
HbWidget *mMainContainer; // Own
--- a/mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontaineralbums.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontaineralbums.cpp Fri May 28 19:46:01 2010 -0500
@@ -94,10 +94,20 @@
if ( mTBoneListModel == 0 ) {
mTBoneListModel = new MpCollectionTBoneListDataModel(mCollectionData);
connect( mTBoneListModel, SIGNAL(albumDataChanged()), this, SLOT(albumDataChanged()) );
+ connect( mTBoneListModel, SIGNAL(albumDataAvailable()), this, SLOT(albumDataAvailable()) );
}
mList->setModel(mTBoneListModel);
- if ( !mCollectionData->setCurrentAlbum(mCurrentAlbumIndex) ) {
+ if ( mCollectionData->setCurrentAlbum(mCurrentAlbumIndex) ) {
+ if ( mCollectionData->albumSongsCount() > 1 ) {
+ emit shuffleEnabled(true);
+ }
+ else {
+ emit shuffleEnabled(false);
+ }
+ }
+ else {
emit findAlbumSongs(mCurrentAlbumIndex);
+ emit shuffleEnabled(false);
}
}
}
@@ -139,10 +149,25 @@
// and the same album re-centers.
mCurrentAlbumIndex = index.row();
TX_LOG_ARGS("mCurrentAlbumIndex=" << mCurrentAlbumIndex);
- if ( !mCollectionData->setCurrentAlbum(mCurrentAlbumIndex) ) {
+ if ( mCollectionData->setCurrentAlbum(mCurrentAlbumIndex) ) {
+ if ( mCollectionData->albumSongsCount() > 1 ) {
+ emit shuffleEnabled(true);
+ }
+ // Enable context menu
+ mLongPressEnabled = true;
+ }
+ else {
emit findAlbumSongs(mCurrentAlbumIndex);
}
}
+ else {
+ // Landed on the same album. Just update menu.
+ if ( mCollectionData->albumSongsCount() > 1 ) {
+ emit shuffleEnabled(true);
+ }
+ // Enable context menu
+ mLongPressEnabled = true;
+ }
TX_EXIT
}
@@ -160,7 +185,12 @@
--mCurrentAlbumIndex;
}
mTBone->scrollTo( mDataModel->index(mCurrentAlbumIndex, 0) );
- if ( !mCollectionData->setCurrentAlbum(mCurrentAlbumIndex) ) {
+ if ( mCollectionData->setCurrentAlbum(mCurrentAlbumIndex) ) {
+ if ( mCollectionData->albumSongsCount() == 1 ) {
+ emit shuffleEnabled(false);
+ }
+ }
+ else {
emit findAlbumSongs(mCurrentAlbumIndex);
}
}
@@ -178,6 +208,35 @@
{
TX_ENTRY
emit findAlbumSongs(mCurrentAlbumIndex);
+ emit shuffleEnabled(false);
+ TX_EXIT
+}
+
+/*!
+ Slot to be called TBone starts scrolling.
+ */
+void MpCollectionContainerAlbums::scrollingStarted()
+{
+ TX_ENTRY
+ // Disable shuffle action from the menu
+ emit shuffleEnabled(false);
+ // Disable context menu
+ mLongPressEnabled = false;
+ TX_EXIT
+}
+
+/*!
+ Slot to be called album data is available. This is a result of findAlbumSongs signal.
+ */
+void MpCollectionContainerAlbums::albumDataAvailable()
+{
+ TX_ENTRY
+ int count = mCollectionData->albumSongsCount();
+ if ( count > 1 ) {
+ emit shuffleEnabled(true);
+ }
+ // Enable context menu
+ mLongPressEnabled = true;
TX_EXIT
}
@@ -240,6 +299,7 @@
mTBone->setDescriptionFontSpec( HbFontSpec(HbFontSpec::Secondary) );
mTBone->setScrollBarPolicy( HgWidget::ScrollBarAlwaysOff );
mTBone->enableReflections(true);
+ connect( mTBone, SIGNAL(scrollingStarted()), this, SLOT(scrollingStarted()) );
connect( mTBone, SIGNAL(scrollingEnded()), this, SLOT(albumCentered()) );
}
}
--- a/mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainerallsongs.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainerallsongs.cpp Fri May 28 19:46:01 2010 -0500
@@ -60,6 +60,30 @@
}
/*!
+ Slot to be called data model has new data.
+ Two cases:
+ 1) User deleted a song.
+ 2) New song found during 'Refresh' operation.
+ */
+void MpCollectionContainerAllSongs::dataReloaded()
+{
+ TX_ENTRY
+ MpCollectionListContainer::dataReloaded();
+ if ( mViewMode != MpCommon::FetchView ) {
+ int count = mCollectionData->count();
+ QString details = hbTrId("txt_mus_subhead_ln_songs", count);
+ mInfoBar->setHeading(details);
+ }
+ if ( mCollectionData->count() > 1 ) {
+ emit shuffleEnabled(true);
+ }
+ else {
+ emit shuffleEnabled(false);
+ }
+ TX_EXIT
+}
+
+/*!
Sets up the container by organizing widgets according to its layout.
\reimp
--- a/mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainerartists.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainerartists.cpp Fri May 28 19:46:01 2010 -0500
@@ -136,11 +136,20 @@
if ( mTBoneListModel == 0 ) {
mTBoneListModel = new MpCollectionTBoneListDataModel(mCollectionData);
connect( mTBoneListModel, SIGNAL(albumDataChanged()), this, SLOT(albumDataChanged()) );
+ connect( mTBoneListModel, SIGNAL(albumDataAvailable()), this, SLOT(albumDataAvailable()) );
}
mList->setModel(mTBoneListModel);
-
- if ( !mCollectionData->setCurrentAlbum(mCurrentAlbumIndex) ) {
+ if ( mCollectionData->setCurrentAlbum(mCurrentAlbumIndex) ) {
+ if ( mCollectionData->albumSongsCount() > 1 ) {
+ emit shuffleEnabled(true);
+ }
+ else {
+ emit shuffleEnabled(false);
+ }
+ }
+ else {
emit findAlbumSongs(mCurrentAlbumIndex);
+ emit shuffleEnabled(false);
}
}
break;
@@ -205,15 +214,30 @@
// and the same album re-centers.
mCurrentAlbumIndex = index;
TX_LOG_ARGS("mCurrentAlbumIndex=" << mCurrentAlbumIndex);
- if ( !mCollectionData->setCurrentAlbum(mCurrentAlbumIndex) ) {
+ if ( mCollectionData->setCurrentAlbum(mCurrentAlbumIndex) ) {
+ if ( mCollectionData->albumSongsCount() > 1 ) {
+ emit shuffleEnabled(true);
+ }
+ // Enable context menu
+ mLongPressEnabled = true;
+ }
+ else {
emit findAlbumSongs(mCurrentAlbumIndex);
}
}
+ else {
+ // Landed on the same album. Just update menu.
+ if ( mCollectionData->albumSongsCount() > 1 ) {
+ emit shuffleEnabled(true);
+ }
+ // Enable context menu
+ mLongPressEnabled = true;
+ }
TX_EXIT
}
/*!
- Slot to be called data model has new data. This occurs after a delete operation is complete.
+ Slot to be called when data model has new data. This occurs after a delete operation is complete.
Two cases:
1) User deleted an artist.
2) User deleted last song in an album.
@@ -226,7 +250,12 @@
--mCurrentAlbumIndex;
}
mTBone->scrollTo( mDataModel->index(mCurrentAlbumIndex - mAlbumIndexOffset, 0) );
- if ( !mCollectionData->setCurrentAlbum(mCurrentAlbumIndex) ) {
+ if ( mCollectionData->setCurrentAlbum(mCurrentAlbumIndex) ) {
+ if ( mCollectionData->albumSongsCount() == 1 ) {
+ emit shuffleEnabled(false);
+ }
+ }
+ else {
emit findAlbumSongs(mCurrentAlbumIndex);
}
}
@@ -237,13 +266,42 @@
}
/*!
- Slot to be called data model has new data.
+ Slot to be called when data model has new data.
User has deleted one of the songs from TBone list.
*/
void MpCollectionContainerArtists::albumDataChanged()
{
TX_ENTRY
emit findAlbumSongs(mCurrentAlbumIndex);
+ emit shuffleEnabled(false);
+ TX_EXIT
+}
+
+/*!
+ Slot to be called TBone starts scrolling.
+ */
+void MpCollectionContainerArtists::scrollingStarted()
+{
+ TX_ENTRY
+ // Disable shuffle action from the menu
+ emit shuffleEnabled(false);
+ // Disable context menu
+ mLongPressEnabled = false;
+ TX_EXIT
+}
+
+/*!
+ Slot to be called album data is available. This is a result of findAlbumSongs signal.
+ */
+void MpCollectionContainerArtists::albumDataAvailable()
+{
+ TX_ENTRY
+ int count = mCollectionData->albumSongsCount();
+ if ( count > 1 ) {
+ emit shuffleEnabled(true);
+ }
+ // Enable context menu
+ mLongPressEnabled = true;
TX_EXIT
}
@@ -332,6 +390,7 @@
mTBone->setDescriptionFontSpec( HbFontSpec(HbFontSpec::Secondary) );
mTBone->setScrollBarPolicy( HgWidget::ScrollBarAlwaysOff );
mTBone->enableReflections(true);
+ connect( mTBone, SIGNAL(scrollingStarted()), this, SLOT(scrollingStarted()) );
connect( mTBone, SIGNAL(scrollingEnded()), this, SLOT(albumCentered()) );
}
break;
--- a/mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainerfactory.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainerfactory.cpp Fri May 28 19:46:01 2010 -0500
@@ -74,6 +74,7 @@
mCurrentContainer->initialize();
connect( mCurrentContainer, SIGNAL(itemActivated(int)), mView, SLOT(openIndex(int)) );
connect( mCurrentContainer, SIGNAL(itemLongPressed(int, QPointF)), mView, SLOT(openContextMenu(int, QPointF)) );
+ connect( mCurrentContainer, SIGNAL(shuffleEnabled(bool)), mView, SLOT(setShuffleAction(bool)) );
break;
case ECollectionContextArtists:
if ( ( mCurrentContext != ECollectionContextArtistAlbums )
@@ -87,6 +88,7 @@
connect( mCurrentContainer, SIGNAL(itemLongPressed(int, QPointF)), mView, SLOT(openContextMenu(int, QPointF)) );
connect( mCurrentContainer, SIGNAL(findAlbumSongs(int)), mView, SLOT(findAlbumSongs(int)) );
connect( mCurrentContainer, SIGNAL(playAlbumSongs(int, int)), mView, SLOT(playAlbumSongs(int, int)) );
+ connect( mCurrentContainer, SIGNAL(shuffleEnabled(bool)), mView, SLOT(setShuffleAction(bool)) );
}
break;
case ECollectionContextAlbums:
@@ -98,6 +100,7 @@
connect( mCurrentContainer, SIGNAL(itemLongPressed(int, QPointF)), mView, SLOT(openContextMenu(int, QPointF)) );
connect( mCurrentContainer, SIGNAL(findAlbumSongs(int)), mView, SLOT(findAlbumSongs(int)) );
connect( mCurrentContainer, SIGNAL(playAlbumSongs(int, int)), mView, SLOT(playAlbumSongs(int, int)) );
+ connect( mCurrentContainer, SIGNAL(shuffleEnabled(bool)), mView, SLOT(setShuffleAction(bool)) );
}
break;
case ECollectionContextPlaylists:
@@ -107,6 +110,7 @@
mCurrentContainer->initialize();
connect( mCurrentContainer, SIGNAL(itemActivated(int)), mView, SLOT(openIndex(int)) );
connect( mCurrentContainer, SIGNAL(itemLongPressed(int, QPointF)), mView, SLOT(openContextMenu(int, QPointF)) );
+ connect( mCurrentContainer, SIGNAL(shuffleEnabled(bool)), mView, SLOT(setShuffleAction(bool)) );
}
break;
case ECollectionContextArtistAlbums:
--- a/mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainerplaylists.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainerplaylists.cpp Fri May 28 19:46:01 2010 -0500
@@ -100,6 +100,9 @@
/*!
Slot to be called data model has new data.
+ Use cases:
+ 1) User renames a playlist.
+ 2) Song added or removed from playlist.
*/
void MpCollectionContainerPlaylists::dataReloaded()
{
@@ -109,6 +112,12 @@
// Playlist could have been renamed.
QString details = mCollectionData->collectionTitle();
mInfoBar->setHeading(details);
+ if ( mCollectionData->count() > 1 ) {
+ emit shuffleEnabled(true);
+ }
+ else {
+ emit shuffleEnabled(false);
+ }
}
TX_EXIT
}
--- a/mpviewplugins/mpcollectionviewplugin/src/mpcollectiondocumentloader.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpcollectionviewplugin/src/mpcollectiondocumentloader.cpp Fri May 28 19:46:01 2010 -0500
@@ -41,7 +41,7 @@
TX_ENTRY_ARGS("type=" << type << ", name=" << name);
if ( type == MpNowPlayingWidget::staticMetaObject.className() ) {
- QObject *object = new MpNowPlayingWidget(MpCommon::KMusicPlayerUid);
+ QObject *object = new MpNowPlayingWidget();
object->setObjectName(name);
TX_EXIT
return object;
--- a/mpviewplugins/mpcollectionviewplugin/src/mpcollectionlistcontainer.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpcollectionviewplugin/src/mpcollectionlistcontainer.cpp Fri May 28 19:46:01 2010 -0500
@@ -50,7 +50,8 @@
mList(0),
mNoMusic(0),
mIndexFeedback(0),
- mLongPressedIndex(0)
+ mLongPressedIndex(0),
+ mLongPressEnabled(true)
{
TX_ENTRY
mIndexFeedback = new HbIndexFeedback();
@@ -109,8 +110,10 @@
void MpCollectionListContainer::onLongPressed( HbAbstractViewItem *listViewItem, const QPointF &coords )
{
TX_ENTRY
- mLongPressedIndex = listViewItem->modelIndex().row();
- emit MpCollectionContainer::itemLongPressed(mLongPressedIndex, coords);
+ if ( mLongPressEnabled ) {
+ mLongPressedIndex = listViewItem->modelIndex().row();
+ emit MpCollectionContainer::itemLongPressed(mLongPressedIndex, coords);
+ }
TX_EXIT
}
--- a/mpviewplugins/mpcollectionviewplugin/src/mpcollectionview.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpcollectionviewplugin/src/mpcollectionview.cpp Fri May 28 19:46:01 2010 -0500
@@ -92,6 +92,8 @@
mBannerAttached( false ),
mSoftKeyQuit( 0 ),
mSoftKeyBack( 0 ),
+ mShuffleAction( 0 ),
+ mShuffleEnabled( false ),
mDocumentLoader( 0 ),
mMainContainer( 0 ),
mMainToolBar( 0 ),
@@ -203,11 +205,13 @@
// Banner is not needed since playback is stopped when returning
// from playback preview. Disable the banner from updating.
mNowPlayingBanner->setEnabled( false );
+ attachNowPlayingBanner( false );
}
else {
connect( mNowPlayingBanner, SIGNAL( clicked() ), this, SLOT( startPlaybackView() ) );
connect( mNowPlayingBanner, SIGNAL( playbackAttachmentChanged( bool ) ),
this, SLOT( attachNowPlayingBanner( bool ) ) );
+ attachNowPlayingBanner( mNowPlayingBanner->isBannerAttached() );
}
widget = mDocumentLoader->findWidget( QString( "mainContainer" ) );
@@ -276,7 +280,12 @@
TX_ENTRY_ARGS( "mCollectionContext=" << mCollectionContext );
if ( mCollectionContext == ECollectionContextUnknown ) {
// Open 'All Songs' by default
- mMpEngine->openCollection( ECollectionContextAllSongs );
+ if ( mCollectionData->context() == ECollectionContextAllSongs ){
+ setContext( ECollectionContextAllSongs );
+ }
+ else {
+ mMpEngine->openCollection( ECollectionContextAllSongs );
+ }
}
else {
// This true when returning from other views, e.g. playback view
@@ -310,9 +319,7 @@
mMpEngine->openCollection( ECollectionContextAllSongs );
}
- if ( mBannerAttached ) {
- setBannerVisibility( false );
- }
+
TX_EXIT
}
@@ -347,18 +354,20 @@
if ( mActivated ) {
startContainerTransition( mCollectionContext, context );
}
+
mCollectionContext = context;
- mCollectionContainer = mContainerFactory->createContainer( context );
- mCollectionContainer->setViewMode( mViewMode );
- mCollectionDataModel->refreshModel();
- mCollectionContainer->setDataModel( mCollectionDataModel );
-
// Reset softkey and the menu
if ( mActivated ) {
setSoftkey();
}
updateToolBar();
updateMenu();
+
+ mCollectionContainer = mContainerFactory->createContainer( context );
+ mCollectionContainer->setViewMode( mViewMode );
+ mCollectionDataModel->refreshModel();
+ mCollectionContainer->setDataModel( mCollectionDataModel );
+
TX_EXIT
}
@@ -619,10 +628,17 @@
mMpEngine->setShuffle( true );
MpSettingsManager::setShuffle( true );
int index = generateShuffleIndex();
- openIndex( index );
+ switch ( mCollectionContext ) {
+ case ECollectionContextArtistAlbumsTBone:
+ case ECollectionContextAlbumsTBone:
+ playAlbumSongs( mCollectionData->currentAlbumIndex(), index );
+ break;
+ default:
+ openIndex( index );
+ break;
+ }
}
-
/*!
Slot to be called when 'Refresh Library' is clicked by the user from the menu.
*/
@@ -801,6 +817,21 @@
}
/*!
+ Slot to be called when shuffle action status changes. This is called by the
+ containers. Shuffle is only enabled when there is more than 1 song and the
+ it can change when songs are deleted or when new songs are found during refresh.
+ */
+void MpCollectionView::setShuffleAction( bool enabled )
+{
+ TX_ENTRY
+ mShuffleEnabled = enabled;
+ if ( mShuffleAction ) {
+ mShuffleAction->setEnabled(enabled);
+ }
+ TX_EXIT
+}
+
+/*!
\internal
Sets the main ( default ) toolbar for the view.
*/
@@ -949,46 +980,31 @@
HbMenu *myMenu = new HbMenu();
HbAction *menuAction;
if ( mViewMode == MpCommon::DefaultView ) {
- bool items = mCollectionData->count() != 0;
+ int count = mCollectionData->count();
switch ( mCollectionContext ) {
- case ECollectionContextAllSongs:
- menuAction = myMenu->addAction( hbTrId( "txt_mus_dblist_shuffle" ) );
- if ( items ){
- connect( menuAction, SIGNAL( triggered() ), this, SLOT( shufflePlayAll() ) );
+ case ECollectionContextAllSongs:
+ mShuffleAction = myMenu->addAction( hbTrId( "txt_mus_opt_shuffle" ) );
+ connect( mShuffleAction, SIGNAL( triggered() ), this, SLOT( shufflePlayAll() ) );
+ if ( count <= 1 ) {
+ mShuffleAction->setDisabled( true );
}
- else {
- menuAction->setDisabled( true );
- }
-
- menuAction = myMenu->addAction( hbTrId( "txt_mus_opt_add_to_playlist" ) );
- if ( items && !mUsbBlocked ) {
+ menuAction = myMenu->addAction( hbTrId( "txt_mus_opt_add_to_playlist" ) );
+ if ( count && !mUsbBlocked ) {
connect( menuAction, SIGNAL( triggered() ), this, SLOT( addToPlaylist() ) );
}
else {
menuAction->setDisabled( true );
}
-
- menuAction = myMenu->addAction( hbTrId( "txt_mus_opt_refresh_library" ) );
+ menuAction = myMenu->addAction( hbTrId( "txt_mus_opt_refresh_library" ) );
if ( !mUsbBlocked ) {
- connect( menuAction, SIGNAL( triggered() ), this, SLOT( refreshLibrary() ) );
- }
- else {
- menuAction->setDisabled( true );
- }
-
- connect( myMenu->addAction(hbTrId("txt_common_opt_exit")), SIGNAL(triggered()), this, SLOT(exit()) );
- break;
-
- case ECollectionContextArtists:
- menuAction = myMenu->addAction( hbTrId( "txt_mus_opt_refresh_library" ) );
- if ( !mUsbBlocked ) {
- connect( menuAction, SIGNAL( triggered() ), this, SLOT( refreshLibrary() ) );
+ connect( menuAction, SIGNAL( triggered() ), this, SLOT( refreshLibrary() ) );
}
else {
menuAction->setDisabled( true );
}
connect( myMenu->addAction(hbTrId("txt_common_opt_exit")), SIGNAL(triggered()), this, SLOT(exit()) );
break;
+ case ECollectionContextArtists:
case ECollectionContextAlbums:
menuAction = myMenu->addAction( hbTrId( "txt_mus_opt_refresh_library" ) );
if ( !mUsbBlocked ) {
@@ -1000,8 +1016,26 @@
connect( myMenu->addAction(hbTrId("txt_common_opt_exit")), SIGNAL(triggered()), this, SLOT(exit()) );
break;
case ECollectionContextArtistAlbumsTBone:
+ case ECollectionContextAlbumsTBone:
+ mShuffleAction = myMenu->addAction( hbTrId( "txt_mus_opt_shuffle" ) );
+ connect( mShuffleAction, SIGNAL( triggered() ), this, SLOT( shufflePlayAll() ) );
+ if ( !mShuffleEnabled ) {
+ mShuffleAction->setDisabled( true );
+ }
+ menuAction = myMenu->addAction( hbTrId( "txt_mus_opt_add_to_playlist" ) );
+ if ( !mUsbBlocked ) {
+ connect( menuAction, SIGNAL( triggered() ), this, SLOT( addToPlaylist() ) );
+ }
+ else {
+ menuAction->setDisabled( true );
+ }
+ break;
case ECollectionContextArtistAllSongs:
- case ECollectionContextAlbumsTBone:
+ mShuffleAction = myMenu->addAction( hbTrId( "txt_mus_opt_shuffle" ) );
+ connect( mShuffleAction, SIGNAL( triggered() ), this, SLOT( shufflePlayAll() ) );
+ if ( count <= 1 ) {
+ mShuffleAction->setDisabled( true );
+ }
menuAction = myMenu->addAction( hbTrId( "txt_mus_opt_add_to_playlist" ) );
if ( !mUsbBlocked ) {
connect( menuAction, SIGNAL( triggered() ), this, SLOT( addToPlaylist() ) );
@@ -1021,7 +1055,12 @@
connect( myMenu->addAction(hbTrId("txt_common_opt_exit")), SIGNAL(triggered()), this, SLOT(exit()) );
break;
case ECollectionContextPlaylistSongs:
- if ( !mCollectionData->isAutoPlaylist() ){
+ mShuffleAction = myMenu->addAction( hbTrId( "txt_mus_opt_shuffle" ) );
+ connect( mShuffleAction, SIGNAL( triggered() ), this, SLOT( shufflePlayAll() ) );
+ if ( count <= 1 ) {
+ mShuffleAction->setDisabled( true );
+ }
+ if ( !mCollectionData->isAutoPlaylist() ) {
menuAction = myMenu->addAction( hbTrId( "txt_common_menu_rename_item" ) );
if ( !mUsbBlocked ) {
connect( menuAction, SIGNAL( triggered() ), this, SLOT( renameCurrentPlaylistContainer() ) );
@@ -1146,7 +1185,16 @@
int MpCollectionView::generateShuffleIndex()
{
int low = 0;
- int high = mCollectionData->count();
+ int high = 0;
+ switch ( mCollectionContext ) {
+ case ECollectionContextArtistAlbumsTBone:
+ case ECollectionContextAlbumsTBone:
+ high = mCollectionData->albumSongsCount();
+ break;
+ default:
+ high = mCollectionData->count();
+ break;
+ }
time_t seconds;
time( &seconds );
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mpviewplugins/mpcollectionviewplugin/tsrc/tsrc.pro Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,22 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies 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 = subdirs
+
+SUBDIRS = unittest_mpcollectioncontainers \
+ unittest_mpcollectiondocumentloader \
+ unittest_mpsnapshotwidget
+
--- a/mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectiondocumentloader/stub/inc/mpnowplayingwidget.h Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectiondocumentloader/stub/inc/mpnowplayingwidget.h Fri May 28 19:46:01 2010 -0500
@@ -26,7 +26,7 @@
Q_OBJECT
public:
- explicit MpNowPlayingWidget(long int playerId);
+ explicit MpNowPlayingWidget();
virtual ~MpNowPlayingWidget();
};
--- a/mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectiondocumentloader/stub/src/mpnowplayingwidget.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectiondocumentloader/stub/src/mpnowplayingwidget.cpp Fri May 28 19:46:01 2010 -0500
@@ -21,9 +21,8 @@
/*!
Constructs the now playing widget stub
*/
-MpNowPlayingWidget::MpNowPlayingWidget(long int playerId )
+MpNowPlayingWidget::MpNowPlayingWidget( )
{
- Q_UNUSED(playerId);
}
/*!
--- a/mpviewplugins/mpdetailsviewplugin/inc/logger.h Fri May 14 18:54:37 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Tracing macros
-*
-*/
-
-#ifndef LOGGER_H
-#define LOGGER_H
-
-#ifndef _DEBUG
-
- #define TRACE( AA )
-
- #define TRACE2( AA, BB )
-
- #define TRACE3( AA, BB, CC )
-
- #define TRACE4( AA, BB, CC, DD )
-
- #define TRACE5( AA, BB, CC, DD, EE )
-
- #define DUMP8( AA )
-
- #define TRACE_DOWNLOADER_STATE( AA )
-
- #define TRACE_AND_PANIC( AA )
-
- #define PANIC_ON_ERROR(AA, BB)
-
-#else
-
- // INCLUDES
- #include <e32debug.h>
-
- #define TRACE_AND_PANIC( AA ) \
- { \
- RDebug::Printf( "ERROR: " AA ); \
- ASSERT(EFalse); \
- }
-
- #define PANIC_ON_ERROR(AA, BB) \
- { \
- if(AA) \
- { \
- RDebug::Printf( "ERROR: " BB, AA ); \
- ASSERT(EFalse); \
- } \
- }
-
- #define TRACE( AA ) do { RDebug::Printf( AA ); } while( 0 )
-
- #define TRACE2( AA, BB ) do { RDebug::Printf( AA, BB ); } while( 0 )
-
- #define TRACE3( AA, BB, CC ) do { RDebug::Printf( AA, BB, CC ); } while( 0 )
-
- #define TRACE4( AA, BB, CC, DD ) do { RDebug::Printf( AA, BB, CC, DD ); } while( 0 )
-
- #define TRACE5( AA, BB, CC, DD, EE ) do { RDebug::Printf( AA, BB, CC, DD, EE ); } while( 0 )
-
- #define DUMP8( AA ) \
- TRAP_IGNORE( \
- { \
- HBufC* conversion = HBufC::NewLC( AA.Length() ); \
- TPtr convPtr( conversion->Des() ); \
- convPtr.Copy( AA ); \
- const TInt KMaxLine = 60; \
- for ( TInt index = convPtr.Length(); index > 0; \
- index -= KMaxLine ) \
- { \
- if ( index <= KMaxLine ) \
- { \
- RDebug::Print( convPtr ); \
- break; \
- } \
- else \
- { \
- RDebug::Print( convPtr.Left( KMaxLine ) ); \
- convPtr.Copy( convPtr.Mid( KMaxLine ) ); \
- } \
- } \
- CleanupStack::PopAndDestroy( conversion ); \
- } );
-
-
-#endif // _LOGGER
-
-#endif // _LOGGER
-
-// End of File
--- a/mpviewplugins/mpdetailsviewplugin/inc/mpdetailssharedialog.h Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/inc/mpdetailssharedialog.h Fri May 28 19:46:01 2010 -0500
@@ -1,13 +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: Header file for share player.
+*
+*/
+
#ifdef SHARE_FUNC_ENABLED
#ifndef MPDETAILSSHAREDIALOG_H
#define MPDETAILSSHAREDIALOG_H
#include <HbDialog>
+#include <QList>
+#include <QSSLError>
#include "mpsharedata.h"
class QGraphicsWebView;
class QNetworkAccessManager;
+class QNetworkReply;
+class MpShareWebView;
class MpSongData;
+class HbProgressDialog;
/*!
Implements Share Player dialog for music player details view.
@@ -22,26 +44,35 @@
/*!
Initializes an instance of the class with given MpSongData.
+ Translation for "unknown" string is passed so that the share
+ dialog can display "unknown" if artist or title are not set.
MpSongData object ownership is not transferred,
Music Player Engine retains the ownership.
*/
- void initialize( MpSongData* aSongData );
+ void initialize( MpSongData* aSongData, const QString& aUnknownTr );
virtual ~MpDetailsShareDialog();
+ void cachePublishingPlayerFiles();
void logoutPlayer();
+ bool isInitialized() const;
public slots:
void addContext();
void updateSharedData();
void onIndexLoad( bool ok );
void debugJs( QString s );
- void errorHandler( QString error, QString message );
+ void errorHandler( QString aError, QString aMessage );
void clearCache();
+ void showWindow();
+ void showProgressDialog();
+ void handleRequestSSLErrors( QNetworkReply* aReply, const QList< QSslError >& aErrors );
+ void handleRequestFinished( QNetworkReply* aReply );
signals:
void closeShareDialog();
private:
- void initShareData( MpSongData* aSongData );
+ void initShareData( MpSongData* aSongData, const QString& aUnknownTr );
+ void initLanguage();
void initNetworkAccessManager();
void initWebView();
void initSignalSlots();
@@ -49,8 +80,10 @@
private:
MpShareData mShareData;
- QGraphicsWebView* mShareWebView; // Owned by HbDialog
+ MpShareWebView* mShareWebView; // Owned by HbDialog
QNetworkAccessManager* mShareNetAccMan; // Owned
+ HbProgressDialog* mProgressbar; // Owned
+ bool mIsInitialized;
};
#endif // MPDETAILSSHAREDIALOG_H
--- a/mpviewplugins/mpdetailsviewplugin/inc/mpdetailsview.h Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/inc/mpdetailsview.h Fri May 28 19:46:01 2010 -0500
@@ -18,7 +18,7 @@
#ifndef MPDETAILSVIEW_H
#define MPDETAILSVIEW_H
-#include <QPixmap>
+#include <QPointer>
#include <QNetworkReply>
#include <QDomDocument>
#include <QMap>
@@ -36,7 +36,7 @@
class HbPushButton;
class HbDocumentLoader;
class HbListWidget;
-class ThumbnailManager;
+
class QTranslator;
class QGraphicsLinearLayout;
class HbProgressBar;
@@ -46,6 +46,8 @@
class MpQueryManager;
#ifdef SHARE_FUNC_ENABLED
+#include <qnetworkconfigmanager.h>
+QTM_USE_NAMESPACE
class MpDetailsShareDialog;
#endif
@@ -80,7 +82,6 @@
public slots:
void back();
void albumArtChanged();
- void setAlbumArtUri( const QString &albumArtUri, const QString &albumArtName );
private slots:
void handlePlaybackInfoChanged();
@@ -88,10 +89,8 @@
void handleDetailsGroupBoxToggled( bool state );
void handleInspireMeGroupBoxToggled( bool state );
-
- void handleNetworkError();
-
- void thumbnailReady( const QPixmap& pixmap, void *data, int id, int error );
+ void RenderInspireMeGroupBox();
+ void handleNetworkError();
void updateSharedData(const QString& url);
#ifdef SHARE_FUNC_ENABLED
@@ -101,17 +100,13 @@
private:
bool canQueryRecommendations() const;
- bool canQuerySharePlayerLink() const;
-
+ bool canQuerySharePlayerLink() const;
void setupMenu();
-
- void clearInspireMe();
-
- void RenderInspireMeGroupBox();
- void recommendationAlbumArtReady();
+ void clearInspireMe();
#ifdef SHARE_FUNC_ENABLED
void createShareDialog();
+ void preloadShareDialog();
#endif
private:
@@ -120,10 +115,8 @@
MpSongData *mSongData;
bool mActivated;
- HbMainWindow *mWindow;
HbAction *mSoftKeyBack;
- HbWidget *mContainer;
HbLabel *mSongText; //owned
HbLabel *mAlbumText; //owned
HbLabel *mArtistText; //owned
@@ -135,17 +128,8 @@
HbListWidget *mDetailList; // owned by mSongDetailsGroupBox
HbListWidget *mInspireList; // owned by mInspireMeGroupBox
HbPushButton *mButton;
- HbProgressBar *mInspireMeProgressBar;
-
- int mDownloadedAlbumArts;
-
- ThumbnailManager *mThumbnailManager; //owned
- QPixmap mDefaultRecommendationAlbumArt;
-
-
- QList<QNetworkReply *> mReplys;
-
- QDomDocument mDomDocument;
+ HbProgressBar *mInspireMeProgressBar;
+
QTranslator *mMpTranslator; // Own
QTranslator *mCommonTranslator; // Own
--- a/mpviewplugins/mpdetailsviewplugin/inc/mpquerymanager.h Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/inc/mpquerymanager.h Fri May 28 19:46:01 2010 -0500
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
-* This component and the accompanying materials are made available
+* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
@@ -18,6 +18,7 @@
#define MPQUERYMANAGER_H_
#include <QPixmap>
+#include <QPointer>
#include <QNetworkReply>
#include <QDomDocument>
#include <QMap>
@@ -25,6 +26,7 @@
#include "mpviewbase.h"
class QNetworkAccessManager;
+class ThumbnailManager;
/*!
MpQueryManager class is responsible for performing music player
@@ -41,67 +43,68 @@
public:
MpQueryManager();
~MpQueryManager();
-
+
public:
void clearNetworkReplies();
void queryLocalMusicStore( QString mArtist,QString mAlbum,QString mTitle );
void queryInspireMeItems( QString mArtist,QString mAlbum,QString mTitle );
void clearRecommendations();
-
+
QStringList recommendationSongs();
QStringList recommendationArtists();
QStringList recommendationAlbumArtsLink();
- QMap<QString, QPixmap> recommendationAlbumArtsMap();
- int &albumArtsReadyCount();
-
- void insertMapItem( const QString &uri, const QPixmap &pixmap );
+ QMap<QString, QPixmap> recommendationAlbumArtsMap();
+ void insertMapItem( const QString &uri, const QPixmap &pixmap );
private slots:
void retrieveInformationFinished( QNetworkReply* reply );
void retrieveInformationNetworkError( QNetworkReply::NetworkError error );
void retrieveInformationSslErrors( const QList<QSslError> &error );
- void DownloadFinished( QNetworkReply* reply );
-
+ void DownloadFinished( QNetworkReply* reply );
+ void setAlbumArtUri( const QString &albumArtUri, const QString &albumArtName );
+ void thumbnailReady( const QPixmap& pixmap, void *data, int id, int error );
+
private:
- void constructRequest( QString &uri );
+ void constructRequest( QString &uri );
// retrieve URI from Ovi music server
void retrieveInformation( const QString &urlEncoded );
-
+
void composeAlbumCover( QPixmap albumart );
QString keyValues( QStringList keys, QStringList values ) const;
void handleParsedXML();
bool writeImageToFile( const QByteArray &aImageData, const QString &aImageFileName );
-
+
signals:
- void networkError();
- void setAlbumArt( const QString &albumArtUri, const QString &albumArtName );
+ void networkError();
void searchUrlRetrieved( const QString& url );
+ void recommendationAlbumArtsReady();
-private:
-
+private:
+
QNetworkAccessManager *mManager;
QNetworkAccessManager *mDownloadManager;
-
+
int mDownloadedAlbumArts;
-
+
QList<QNetworkReply *> mReplys;
-
+
QDomDocument mDomDocument;
-
-
+ ThumbnailManager *mThumbnailManager; //owned
+
QString mArtist;
QString mAlbum;
QString mTitle;
-
+
QStringList mRecommendationAlbumArtsName;
-
+
QStringList mRecommendationSongs;
QStringList mRecommendationArtists;
QStringList mRecommendationAlbumArtsLink;
QMap<QString, QPixmap> mRecommendationAlbumArtsMap;
int mAlbumArtsReadyCount;
-
-
+ QPixmap mDefaultRecommendationAlbumArt;
+
+
};
#endif /* MPQUERYMANAGER_H_ */
--- a/mpviewplugins/mpdetailsviewplugin/inc/mpsharedata.h Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/inc/mpsharedata.h Fri May 28 19:46:01 2010 -0500
@@ -1,3 +1,20 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: meta data used by publish player.
+*
+*/
+
#ifdef SHARE_FUNC_ENABLED
#ifndef MPSHAREDATA_H
@@ -27,6 +44,7 @@
void setSongData( MpSongData* aSongData );
void setErrorMessage( const QString& s );
void setLanguage( const QString& s );
+ void setUnknownTr( const QString& s );
public slots:
QObject* owner() const;
@@ -41,7 +59,6 @@
int objectReservedLength() const;
QString language() const;
QString title() const;
- QString album() const;
QString artist() const;
QString albumArtBase64() const;
@@ -52,6 +69,7 @@
QString mUsername;
QString mPassword;
QString mLanguage;
+ QString mUnknownTr;
};
#endif // MPSHAREDATA_H
--- a/mpviewplugins/mpdetailsviewplugin/mpdetailsviewplugin.pro Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/mpdetailsviewplugin.pro Fri May 28 19:46:01 2010 -0500
@@ -17,12 +17,12 @@
symbian:TARGET.UID3 = 0x2002D0AA
TEMPLATE = lib
-CONFIG += hb qt ecomplugin mobility
+CONFIG += hb qt ecomplugin mobility SHARE_FUNC_ENABLED
QT += webkit \
network \
xml
TARGET = mpdetailsviewplugin
-MOBILITY += bearer
+MOBILITY += bearer systeminfo
SERVICE.INTERFACE_NAME = org.nokia.mmdt.MpxViewPlugin/1.0
SERVICE.CONFIGURATION = ""
--- a/mpviewplugins/mpdetailsviewplugin/resources/index.html Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/resources/index.html Fri May 28 19:46:01 2010 -0500
@@ -8,23 +8,41 @@
<link type="text/css" rel="stylesheet" href="musiccontext.css" /> <!-- CSS for music context area -->
<!-- Player scripts -->
- <script type="text/javascript" src="http://hf.ci.wipsl.com/PleiXXPTsup/noheva-be/js/publishplayer.js"></script>
+ <script type="text/javascript" src="http://hf.ci.wipsl.com/PleiXXPTsup/noheva-be/js/publishplayer.js"></script>
<!-- Local stuff to be implemented by user application to provide the contextual information -->
<script type="text/javascript" src="musiccontext.js"></script>
+
+ <!-- Error recovery in case page player script loading fails -->
+ <script type="text/javascript">
+ var mybody = {
+ onLoad: function () {
+ if (window['music'] &&
+ window['ovi'] &&
+ ovi['player'] &&
+ ovi.player['publish'] ) {
+ music.initPlayer();
+ music.updateContextArea();
+ } else {
+ showErrorMessage();
+ }
+ },
+ onFocus: function () {
+ if (window['music']) {
+ music.updateContextArea();
+ }
+ }
+ }
+ function showErrorMessage() {
+ var errorUi = "<H1>" + window.context.errorMessage() + "</H1>";
+ errorUi += "<input type='button' value='Close' onClick='context.owner().closeShareDialog();'>";
+ document.getElementById("ovi.player.share.ui").innerHTML = errorUi;
+ }
+ </script>
+
</head>
<!-- onfocus refreshes only the song when publishplayer is set active / deactive -->
- <body onload="music.initPlayer(); music.updateContextArea();"
- onfocus="music.updateContextArea();">
- <div id="ovi.player.share.ui">
- <h1>Loading...</h1>
- <input type="button" value="Close" onClick="context.owner().closeShareDialog();">
- <input type="button" value="updateContextArea" onClick="music.updateContextArea();">
- <input type="button" value="Clear JS Cache" onClick="window.context.owner().clearCache();">
- </div>
- <!-- Now we should have publishplayer loaded, check and report error if failed -->
- <script type="text/javascript">
- music.playerLoaded();
- </script>
+ <body onload="mybody.onLoad();" onfocus="mybody.onFocus();">
+ <div id="ovi.player.share.ui"></div>
</body>
</html>
--- a/mpviewplugins/mpdetailsviewplugin/resources/mpdetailsview.docml Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/resources/mpdetailsview.docml Fri May 28 19:46:01 2010 -0500
@@ -1,135 +1,106 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<hbdocument version="0.7">
- <widget name="content" type="HbWidget">
+ <widget name="content" type="HbWidget">
+ <spaceritem name="spacer1">
+ <sizepolicy verticalPolicy="Expanding"/>
+ </spaceritem>
<widget name="albumArt" type="HbLabel">
<enums name="alignment" value="AlignVCenter|AlignHCenter"/>
- <sizehint height="expr(var(hb-param-text-height-primary) + 2*var(hb-param-text-height-secondary) + 2*var(hb-param-margin-gene-middle-vertical))" type="FIXED" width="expr(var(hb-param-text-height-primary) + 2*var(hb-param-text-height-secondary) + 2*var(hb-param-margin-gene-middle-vertical))" />
- <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
<icon iconName="Album Art" name="icon"/>
</widget>
<widget name="trackTitle" type="HbLabel">
- <real name="z" value="1"/>
<fontspec name="fontSpec" role="Primary"/>
<enums name="alignment" value="AlignLeft"/>
- <sizehint type="PREFERRED" height="var(hb-param-text-height-primary)"/>
- <sizehint type="PREFERRED" width="expr(var(hb-param-screen-width) - var(hb-param-margin-gene-left) - var(hb-param-text-height-primary) - 2*var(hb-param-text-height-secondary) - 2*var(hb-param-margin-gene-middle-vertical) - var(hb-param-margin-gene-middle-horizontal) - var(hb-param-margin-gene-right))"/>
</widget>
<widget name="artist" type="HbLabel">
- <real name="z" value="1"/>
<fontspec name="fontSpec" role="Secondary"/>
<enums name="alignment" value="AlignLeft"/>
- <sizehint type="PREFERRED" height="var(hb-param-text-height-secondary)"/>
- <sizehint type="PREFERRED" width="expr(var(hb-param-screen-width) - var(hb-param-margin-gene-left) - var(hb-param-text-height-primary) - 2*var(hb-param-text-height-secondary) - 2*var(hb-param-margin-gene-middle-vertical) - var(hb-param-margin-gene-middle-horizontal) - var(hb-param-margin-gene-right))"/>
</widget>
<widget name="albumName" type="HbLabel">
- <real name="z" value="1"/>
<fontspec name="fontSpec" role="Secondary"/>
<enums name="alignment" value="AlignLeft"/>
- <sizehint type="PREFERRED" height="var(hb-param-text-height-secondary)"/>
- <sizehint type="PREFERRED" width="expr(var(hb-param-screen-width) - var(hb-param-margin-gene-left) - var(hb-param-text-height-primary) - 2*var(hb-param-text-height-secondary) - 2*var(hb-param-margin-gene-middle-vertical) - var(hb-param-margin-gene-middle-horizontal) - var(hb-param-margin-gene-right))"/>
</widget>
<widget name="shareButton" type="HbPushButton">
<string name="text" value="Share"/>
- <real name="z" value="1"/>
- <enums name="alignment" value="AlignCenter"/>
- <sizehint type="PREFERRED" height="expr(var(hb-param-text-height-tiny) + 2*var(hb-param-margin-gene-center-align))"/>
- <sizehint type="PREFERRED" width="expr(var(hb-param-screen-width) - var(hb-param-margin-gene-left) -var(hb-param-margin-gene-right))"/>
+ <enums name="textAlignment" value="AlignCenter"/>
</widget>
<widget name="songDetails" type="HbGroupBox">
<widget name="songDetailsListWidget" role="HbGroupBox:contentWidget" type="HbListWidget">
<string name="verticalScrollBarPolicy" value="ScrollBarAlwaysOff"/>
- <sizehint type="PREFERRED" height="expr(var(hb-param-screen-height) - var(hb-param-widget-chrome-height) - 4* var(hb-param-margin-gene-top) - 3*var(hb-param-text-height-primary) - 3*var(hb-param-text-height-secondary) - 2*var(hb-param-margin-gene-middle-vertical) - 5*var(hb-param-margin-gene-bottom))"/>
-
- <sizehint type="PREFERRED" width="var(hb-param-screen-width)"/>
- <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
</widget>
<bool name="collapsable" value="TRUE"/>
<string name="heading" value="Song details"/>
- <real name="z" value="1"/>
</widget>
<widget name="inspireMeGroupBox" type="HbGroupBox">
- <widget name="inspireMeContentWidget" role="HbGroupBox:contentWidget" type="HbWidget">
- <widget name="inspireListWidget" type="HbListWidget">
- <string name="verticalScrollBarPolicy" value="ScrollBarAlwaysOff"/>
- </widget>
- <layout orientation="Vertical" type="linear" spacing="0">
- <contentsmargins bottom="0.0un" left="0.0un" right="0.0un" top="0.0un"/>
- <linearitem itemname="inspireListWidget"/>
- </layout>
- <sizehint type="PREFERRED" height="expr(2*var(hb-param-margin-gene-top) + 2*var(hb-param-text-height-primary) + 2*var(hb-param-margin-gene-middle-vertical) + 2*var(hb-param-text-height-secondary) + 2*var(hb-param-margin-gene-bottom))"/>
- <sizehint type="PREFERRED" width="var(hb-param-screen-width)"/>
- <real name="z" value="1"/>
- </widget>
+ <widget name="inspireListWidget" role="HbGroupBox:contentWidget" type="HbListWidget">
+ <string name="verticalScrollBarPolicy" value="ScrollBarAlwaysOff"/>
+ </widget>
+ <widget name="inspireMeProgressBar" type="HbProgressBar">
+ <integer name="minimum" value="0"/>
+ <integer name="maximum" value="0"/>
+ <enums name="orientation" value="Horizontal"/>
+ <bool name="visible" value="FALSE"/>
+ </widget>
<bool name="collapsable" value="TRUE"/>
<string name="heading" value="Inspire me"/>
- <real name="z" value="1"/>
</widget>
- <widget name="inspireMeProgressBar" type="HbProgressBar">
- <integer name="minimum" value="0"/>
- <integer name="maximum" value="0"/>
- <enums name="orientation" value="Horizontal"/>
- <real name="z" value="2"/>
- <bool name="visible" value="FALSE"/>
- </widget>
- <sizehint height="expr(var(hb-param-screen-height) - var(hb-param-widget-chrome-height))" type="FIXED" width="var(hb-param-screen-width)"/>
- <real name="z" value="1"/>
- <layout type="anchor">
- <anchoritem dst="artist" dstEdge="LEFT" spacing="var(hb-param-margin-gene-middle-horizontal)" src="albumArt" srcEdge="RIGHT"/>
- <anchoritem dst="albumArt" dstEdge="LEFT" spacing="var(hb-param-margin-gene-left)" src="" srcEdge="LEFT"/>
- <anchoritem dst="albumArt" dstEdge="TOP" spacing="var(hb-param-margin-gene-top)" src="" srcEdge="TOP"/>
- <anchoritem dst="trackTitle" dstEdge="TOP" spacing="var(hb-param-margin-gene-top)" src="" srcEdge="TOP"/>
- <anchoritem dst="trackTitle" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-right)" src="" srcEdge="RIGHT"/>
- <anchoritem dst="trackTitle" dstEdge="LEFT" spacing="var(hb-param-margin-gene-middle-horizontal)" src="albumArt" srcEdge="RIGHT"/>
- <anchoritem dst="artist" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-right)" src="" srcEdge="RIGHT"/>
- <anchoritem dst="artist" dstEdge="TOP" spacing="var(hb-param-margin-gene-middle-vertical)" src="trackTitle" srcEdge="BOTTOM"/>
- <anchoritem dst="albumName" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-right)" src="" srcEdge="RIGHT"/>
- <anchoritem dst="albumName" dstEdge="TOP" spacing="var(hb-param-margin-gene-middle-vertical)" src="artist" srcEdge="BOTTOM"/>
- <anchoritem dst="albumName" dstEdge="LEFT" spacing="var(hb-param-margin-gene-middle-horizontal)" src="albumArt" srcEdge="RIGHT"/>
- <anchoritem dst="shareButton" dstEdge="TOP" spacing="var(hb-param-margin-gene-bottom)" src="albumName" srcEdge="BOTTOM"/>
- <anchoritem dst="shareButton" dstEdge="LEFT" spacing="var(hb-param-margin-gene-left)" src="" srcEdge="LEFT"/>
- <anchoritem dst="shareButton" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-right)" src="" srcEdge="RIGHT"/>
- <anchoritem dst="songDetails" dstEdge="TOP" spacing="var(hb-param-margin-gene-bottom)" src="shareButton" srcEdge="BOTTOM"/>
- <anchoritem dst="songDetails" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
- <anchoritem dst="songDetails" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
- <anchoritem dst="inspireMeGroupBox" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
- <anchoritem dst="inspireMeGroupBox" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
- <anchoritem dst="inspireMeGroupBox" dstEdge="TOP" spacing="0un" src="songDetails" srcEdge="BOTTOM"/>
- <anchoritem dst="inspireMeProgressBar" dstEdge="LEFT" spacing="var(hb-param-margin-gene-left)" src="" srcEdge="LEFT"/>
- <anchoritem dst="inspireMeProgressBar" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-right)" src="" srcEdge="RIGHT"/>
- <anchoritem dst="inspireMeProgressBar" dstEdge="TOP" spacing="expr(var(hb-param-margin-gene-top) + var(hb-param-margin-gene-bottom) + var(hb-param-text-height-primary) + var(hb-param-margin-gene-top))" src="inspireMeGroupBox" srcEdge="TOP"/>
- </layout>
+ </widget>
+
+ <section name="ShowInspireMe">
+ <widget name="content" type="HbWidget">
+ <layout type="anchor">
+ <anchoritem dst="artist" dstEdge="LEFT" spacing="var(hb-param-margin-gene-middle-horizontal)" src="albumArt" srcEdge="RIGHT"/>
+ <anchoritem dst="albumArt" dstEdge="LEFT" spacing="var(hb-param-margin-gene-left)" src="" srcEdge="LEFT"/>
+ <anchoritem dst="albumArt" dstEdge="TOP" spacing="var(hb-param-margin-gene-top)" src="" srcEdge="TOP"/>
+ <anchoritem dst="trackTitle" dstEdge="TOP" spacing="var(hb-param-margin-gene-top)" src="" srcEdge="TOP"/>
+ <anchoritem dst="trackTitle" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-right)" src="" srcEdge="RIGHT"/>
+ <anchoritem dst="trackTitle" dstEdge="LEFT" spacing="var(hb-param-margin-gene-middle-horizontal)" src="albumArt" srcEdge="RIGHT"/>
+ <anchoritem dst="artist" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-right)" src="" srcEdge="RIGHT"/>
+ <anchoritem dst="artist" dstEdge="TOP" spacing="var(hb-param-margin-gene-middle-vertical)" src="trackTitle" srcEdge="BOTTOM"/>
+ <anchoritem dst="albumName" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-right)" src="" srcEdge="RIGHT"/>
+ <anchoritem dst="albumName" dstEdge="TOP" spacing="var(hb-param-margin-gene-middle-vertical)" src="artist" srcEdge="BOTTOM"/>
+ <anchoritem dst="albumName" dstEdge="LEFT" spacing="var(hb-param-margin-gene-middle-horizontal)" src="albumArt" srcEdge="RIGHT"/>
+ <anchoritem dst="shareButton" dstEdge="TOP" spacing="var(hb-param-margin-gene-bottom)" src="albumName" srcEdge="BOTTOM"/>
+ <anchoritem dst="shareButton" dstEdge="LEFT" spacing="var(hb-param-margin-gene-left)" src="" srcEdge="LEFT"/>
+ <anchoritem dst="shareButton" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-right)" src="" srcEdge="RIGHT"/>
+ <anchoritem dst="songDetails" dstEdge="TOP" spacing="var(hb-param-margin-gene-bottom)" src="shareButton" srcEdge="BOTTOM"/>
+ <anchoritem dst="songDetails" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+ <anchoritem dst="songDetails" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+ <anchoritem dst="inspireMeGroupBox" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+ <anchoritem dst="inspireMeGroupBox" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+ <anchoritem dst="inspireMeGroupBox" dstEdge="TOP" spacing="0un" src="songDetails" srcEdge="BOTTOM"/>
+ <anchoritem dst="inspireMeGroupBox" dstEdge="BOTTOM" spacer="spacer1" src="" srcEdge="BOTTOM"/>
+ </layout>
</widget>
- <section name="InspireMeEnabled">
- <widget name="songDetails" type="HbGroupBox">
- <widget name="songDetailsListWidget" role="HbGroupBox:contentWidget" type="HbListWidget">
- <string name="verticalScrollBarPolicy" value="ScrollBarAlwaysOff"/>
- <sizehint type="PREFERRED" height="expr(var(hb-param-screen-height) - var(hb-param-widget-chrome-height) - 4* var(hb-param-margin-gene-top) - 3*var(hb-param-text-height-primary) - 3*var(hb-param-text-height-secondary) - 2*var(hb-param-margin-gene-middle-vertical) - 5*var(hb-param-margin-gene-bottom))"/>
- <sizehint type="PREFERRED" width="var(hb-param-screen-width)"/>
- <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
- </widget>
- <bool name="collapsable" value="TRUE"/>
- <string name="titleText" value="Song details"/>
- <real name="z" value="1"/>
- </widget>
- <widget name="inspireMeGroupBox" type="HbGroupBox">
- <widget name="inspireMeContentWidget" role="HbGroupBox:contentWidget" type="HbWidget">
- <widget name="inspireListWidget" type="HbListWidget">
- <string name="verticalScrollBarPolicy" value="ScrollBarAlwaysOff"/>
- </widget>
- <layout orientation="Vertical" type="linear" spacing="0">
- <contentsmargins bottom="0.0un" left="0.0un" right="0.0un" top="0.0un"/>
- <linearitem itemname="inspireListWidget"/>
- </layout>
- <sizehint type="PREFERRED" height="expr(2*var(hb-param-margin-gene-top) + 2*var(hb-param-text-height-primary) + 2*var(hb-param-margin-gene-middle-vertical) + 2*var(hb-param-text-height-secondary) + 2*var(hb-param-margin-gene-bottom))"/>
- <sizehint type="PREFERRED" width="var(hb-param-screen-width)"/>
- <real name="z" value="1"/>
- </widget>
- <bool name="collapsable" value="TRUE"/>
- <string name="titleText" value="Inspire me"/>
- <real name="z" value="1"/>
- </widget>
- </section>
- <metadata activeUIState="Common ui state" display="QHD portrait" unit="un">
+ </section>
+
+ <section name="HideInspireMe">
+ <widget name="content" type="HbWidget">
+ <layout type="anchor">
+ <anchoritem dst="artist" dstEdge="LEFT" spacing="var(hb-param-margin-gene-middle-horizontal)" src="albumArt" srcEdge="RIGHT"/>
+ <anchoritem dst="albumArt" dstEdge="LEFT" spacing="var(hb-param-margin-gene-left)" src="" srcEdge="LEFT"/>
+ <anchoritem dst="albumArt" dstEdge="TOP" spacing="var(hb-param-margin-gene-top)" src="" srcEdge="TOP"/>
+ <anchoritem dst="trackTitle" dstEdge="TOP" spacing="var(hb-param-margin-gene-top)" src="" srcEdge="TOP"/>
+ <anchoritem dst="trackTitle" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-right)" src="" srcEdge="RIGHT"/>
+ <anchoritem dst="trackTitle" dstEdge="LEFT" spacing="var(hb-param-margin-gene-middle-horizontal)" src="albumArt" srcEdge="RIGHT"/>
+ <anchoritem dst="artist" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-right)" src="" srcEdge="RIGHT"/>
+ <anchoritem dst="artist" dstEdge="TOP" spacing="var(hb-param-margin-gene-middle-vertical)" src="trackTitle" srcEdge="BOTTOM"/>
+ <anchoritem dst="albumName" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-right)" src="" srcEdge="RIGHT"/>
+ <anchoritem dst="albumName" dstEdge="TOP" spacing="var(hb-param-margin-gene-middle-vertical)" src="artist" srcEdge="BOTTOM"/>
+ <anchoritem dst="albumName" dstEdge="LEFT" spacing="var(hb-param-margin-gene-middle-horizontal)" src="albumArt" srcEdge="RIGHT"/>
+ <anchoritem dst="shareButton" dstEdge="TOP" spacing="var(hb-param-margin-gene-bottom)" src="albumName" srcEdge="BOTTOM"/>
+ <anchoritem dst="shareButton" dstEdge="LEFT" spacing="var(hb-param-margin-gene-left)" src="" srcEdge="LEFT"/>
+ <anchoritem dst="shareButton" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-right)" src="" srcEdge="RIGHT"/>
+ <anchoritem dst="songDetails" dstEdge="TOP" spacing="var(hb-param-margin-gene-bottom)" src="shareButton" srcEdge="BOTTOM"/>
+ <anchoritem dst="songDetails" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+ <anchoritem dst="songDetails" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+ <anchoritem dst="songDetails" dstEdge="BOTTOM" spacer="spacer1" src="" srcEdge="BOTTOM"/>
+ </layout>
+ </widget>
+ </section>
+
+
+ <metadata activeUIState="Common ui state" display="QHD portrait" unit="un">
<uistate name="Common ui state" sections="#common"/>
</metadata>
</hbdocument>
--- a/mpviewplugins/mpdetailsviewplugin/resources/musiccontext.css Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/resources/musiccontext.css Fri May 28 19:46:01 2010 -0500
@@ -1,11 +1,9 @@
/* Info */
-ul.info-list {
- /*padding-top:5px;
- padding-bottom:5px;*/
+table.info-list {
+ padding-top:10px;
}
-ul.info-list li {
- line-height: 32px;
+table.info-list td {
padding: 2px 0;
}
@@ -18,19 +16,8 @@
}
-
.info-list .description {
display:inline-block;
padding-left:20px;
vertical-align:top;
- padding-top:10px;
}
-
-
-ul.info-list li.music .icon {
- display: inline-block;
- width: 32px;
- height: 32px;
- padding-left: 36px;
- background: transparent url(../images/CheckButton.png) left top no-repeat;
-}
--- a/mpviewplugins/mpdetailsviewplugin/resources/musiccontext.js Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/resources/musiccontext.js Fri May 28 19:46:01 2010 -0500
@@ -1,11 +1,9 @@
//Logging for QT
// Override the default alert function.
+// TODO remove this when alert in platform is working?
alert = function(str) {
console.log(str);
- if(window['context'] && context['owner']){
- context.owner().debugJs('alert: ' + str);
- }
window.context.owner().errorHandler("Alert", str);
}
@@ -38,34 +36,6 @@
{};
(function(){
- if (typeof window.context === 'undefined') {
- window['context'] = {
- token: "hipsu:hipsupass",
- song: "Queen - Bohemian Rhapsody",
- objectReservedLength: function(){return 70;},
- objectContent: function() { return "http://music.ovi.com/ru/ru/pc/Product/Queen/Bohemian-Rhapsody/8019069"; },
- objectType: function(){ return "URI"; },
- artist: function() { return "♫ Queen"; },
- title: function() { return "Bohemian Rhapsody"; },
- username: function() { return "hipsu"; },
- password: function() { return "hipsupass"; },
- albumArtBase64: function() { return "https://secure-profile.facebook.com/v227/1739/21/n100000756794479_1863.jpg"; },
- owner: function() {
- return {
- errorHandler: function(a,b) {},
- clearCache: function() {},
- debugJs: function(s) {}
- }
- }
- }
- }else{
- try {
- logme(context.objectType() + ' | ' + window.context.objectContent() + ' | ' + window.context.objectReservedLength());
- }catch (e) {
- logme(e);
- }
- }
-
var musicContext = null;
var publishingPlayer = null;
@@ -78,18 +48,6 @@
};
}
- // Hard code something for the browser..
-
- /**
- * Check if player is loaded and call error function if not.
- */
- music.playerLoaded = function() {
- traceme();
- if (!_playerReady()) {
- alert("Error loading player scripts");
- }
- }
-
/**
* Call this for player to show UI and initialize connection to SNC
*/
@@ -98,7 +56,7 @@
traceme();
// Initialize player
publishingPlayer = new ovi.player.publish.Player({
- locale : "en-US",
+ locale : window.context.language(),
credentials : {
type : "",
sso_base_url : "",
@@ -111,7 +69,7 @@
traceme();
if (status != publishingPlayer.status.updateservices_ok && status != publishingPlayer.status.show_ok) {
// Delegate errors to native side
- window.context.errorHandler(status, data.message);
+ window.context.owner().errorHandler(status, data.message);
}
});
@@ -124,7 +82,10 @@
// Update artist and title metadata.
traceme();
publishingPlayer.setContextObject(_getMusicContext());
- }
+ if(window['context'] && context['owner']){
+ context.owner().showWindow();
+ }
+}
/**
* Call this function to update metadata (called when music player has retrieved the link)
@@ -166,23 +127,25 @@
var sharePlayerArtBase64 = window.context.albumArtBase64();
if ( sharePlayerArtBase64.length > 0 ) {
// TODO: this is temporary solution until base64 defect in QT is fixed.
- sharePlayerArtImage = "<img class='cover' src='" + sharePlayerArtBase64 + "' width='74px' height='74px' />";
+ sharePlayerArtImage = "<td valign='top' width='74px'><img src='" + sharePlayerArtBase64 + "' width='74px' height='74px' /></td>";
// sharePlayerArtImage = "<img class='cover' src='data:image/png;base64," + sharePlayerArtBase64 + "' width='74px' height='74px' />";
}
// Create context object
musicContext.create({
view: "none",
data: {
- miniview: "<ul class='list info-list'>"
+ miniview: "<table width='100%' class='list info-list'><tr>"
/*
// TODO REMOVE, for testing only
- + "<p>username: " + window.context.username() + "/" + window.context.password() + "</p><BR>"
+ "<input type=\"button\" value=\"Clear JS Cache\" onClick=\"window.context.owner().clearCache();\">"
*/
+ sharePlayerArtImage
- + "<span class='description'><div class='title'>" + window.context.title() + "</div>"
- + "<div class='artist'>" + window.context.artist() + "</div></span>"
- + "</ul>",
+ + "<td align='left' valign='top'>"
+ + "<span class='description'>"
+ + "<div class='title'>" + window.context.title() + "</div>"
+ + "<div class='artist'>" + window.context.artist() + "</div>"
+ + "</span>"
+ + "</td></tr></table>",
object: attachment
}
});
--- a/mpviewplugins/mpdetailsviewplugin/src/mpdetailssharedialog.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/src/mpdetailssharedialog.cpp Fri May 28 19:46:01 2010 -0500
@@ -1,3 +1,20 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation for share player.
+*
+*/
+
#ifdef SHARE_FUNC_ENABLED
#include "mpdetailssharedialog.h"
@@ -11,12 +28,19 @@
#include <QWebFrame>
#include <QNetworkAccessManager>
#include <QNetworkDiskCache>
+#include <QNetworkReply>
#include <QDesktopServices>
#include <QNetworkProxyFactory>
+#include <QTimer>
#include <hbmessagebox.h>
#include <QFile>
#include <QTextStream>
+#include <qsysteminfo.h>
+#include <hbmainwindow.h>
+#include <hbstyleloader.h>
+#include <hbprogressdialog.h>
+QTM_USE_NAMESPACE
// SHARE_INDEX_FILE defines where the index.html file is loaded from.
#define SHARE_INDEX_URL "qrc:///shareview/index.html"
@@ -27,11 +51,9 @@
// For R&D testing, index.html may be loaded from E: drive.
// User must manually place index.html in the correct location.
// If the RND file does not exist, then SHARE_INDEX_URL will be used.
-#define RND_SHARE_INDEX_URL "file:///e:/index.html"
-#define RND_SHARE_INDEX_FILE "e:\\index.html"
-#define RND_OVI_LOGIN_FILE "e:\\ovicredentials.txt"
-#define RND_DEFAULT_USER "hipsu"
-#define RND_DEFAULT_PASS "hipsupass"
+#define RND_SHARE_INDEX_URL "file:///f:/index.html"
+#define RND_SHARE_INDEX_FILE "f:\\index.html"
+#define RND_OVI_LOGIN_FILE "f:\\ovicredentials.txt"
#endif
#else
// Assume Windows target.
@@ -41,27 +63,73 @@
#endif
-// For allowing local caching of javascript files loaded by popup
+// Default language in case QSystemInfo does not work.
+#define DEFAULT_LANGUAGE "en-US"
+
+// Default error message.
+#define ERROR_MESSAGE "An error occured. Sharing is not currently available"
+
+
+/*!
+ MpNetworkAccessManager allows local caching of publishing player files
+ in order to minimize network traffic.
+ The files will be cached to the private directory of the application,
+ i.e. in the music player's case, this is C:\Private\10207C62\Cache.
+ */
class MpNetworkAccessManager : public QNetworkAccessManager
{
public:
- MpNetworkAccessManager() { };
+ MpNetworkAccessManager( QObject* parent = 0 )
+ : QNetworkAccessManager( parent )
+ {
+ proxyFactory()->setUseSystemConfiguration( true );
+ QNetworkDiskCache* diskCache = new QNetworkDiskCache( this );
+ QString location = QDesktopServices::storageLocation( QDesktopServices::CacheLocation );
+ diskCache->setCacheDirectory( location );
+ setCache( diskCache );
+ }
private:
- QNetworkReply *createRequest( Operation op,
- const QNetworkRequest &request,
- QIODevice *outgoingData = 0 )
+ QNetworkReply* createRequest( Operation op,
+ const QNetworkRequest &request,
+ QIODevice* outgoingData = 0 )
{
TX_ENTRY
+ TX_LOG_ARGS( "share: createRequest URL=" << request.url().toString() )
+
QVariant val = request.attribute( QNetworkRequest::CacheLoadControlAttribute );
- qDebug() << "request cachecontrol - " << val.typeName() << val.toInt();
// Change the cache load control attrbute!
QNetworkRequest req = request;
req.setAttribute( QNetworkRequest::CacheLoadControlAttribute,
- QVariant( QNetworkRequest::PreferCache ) ); // was PreferNetwork
+ QVariant( QNetworkRequest::PreferCache ) );
+ QNetworkReply* result = QNetworkAccessManager::createRequest( op, req, outgoingData );
TX_EXIT
- return QNetworkAccessManager::createRequest( op, req, outgoingData );
+ return result;
+ }
+};
+
+/*!
+ MpShareWebView derives from QGraphicsWebView in order to override it's
+ contextMenuEvent method to prevent the background context menu from
+ being displayed when user makes long click in the web view.
+ */
+class MpShareWebView : public QGraphicsWebView
+{
+public:
+ MpShareWebView( QGraphicsItem * parent = 0 )
+ : QGraphicsWebView( parent )
+ {
+ settings()->setAttribute( QWebSettings::LocalContentCanAccessRemoteUrls, true );
+ settings()->setAttribute( QWebSettings::LocalStorageDatabaseEnabled, true );
+ settings()->enablePersistentStorage();
+ }
+
+protected:
+ void contextMenuEvent( QGraphicsSceneContextMenuEvent* /*ev*/ ) // Override QGraphicsWebView::contextMenuEvent
+ {
+ // Fix to prevent "Stop" and "Reload" buttons in page background.
+ // Do not respond to the contextMenuEvent.
}
};
@@ -71,11 +139,22 @@
*/
MpDetailsShareDialog::MpDetailsShareDialog()
: mShareWebView( 0 ),
- mShareNetAccMan( 0 )
+ mShareNetAccMan( 0 ),
+ mProgressbar ( 0 ),
+ mIsInitialized( false )
{
+ // DeleteOnClose attribute prevents crash when user presses Cancel
+ // before publishing player is fully loaded.
+ setAttribute( Qt::WA_DeleteOnClose, true );
}
-void MpDetailsShareDialog::initialize( MpSongData* aSongData )
+/*!
+ Initialize the share dialog.
+ When fully initialized we set our mIsInitialized flag to true.
+ Our isInitialized() method can be called to determine whether
+ initialization was successful.
+ */
+void MpDetailsShareDialog::initialize( MpSongData* aSongData, const QString& aUnknownTr )
{
TX_ENTRY
if ( !initUser() )
@@ -83,7 +162,8 @@
emit closeShareDialog();
return;
}
- initShareData( aSongData );
+ initShareData( aSongData, aUnknownTr );
+ initLanguage();
initNetworkAccessManager();
initWebView();
initSignalSlots();
@@ -109,68 +189,136 @@
TX_LOG_ARGS( "share: Use QRC index.html file " << SHARE_INDEX_URL )
mShareWebView->load( QUrl( SHARE_INDEX_URL ) );
}
+
+ // Flag that the dialog is now fully initialized.
+ mIsInitialized = true;
+
+ // Show progress dialog in .3 second if loading not finished.
+ QTimer::singleShot(300, this, SLOT(showProgressDialog()));
+
TX_EXIT
}
-
/*!
Destructor.
*/
MpDetailsShareDialog::~MpDetailsShareDialog()
{
TX_ENTRY
+ if ( mShareData.songData() )
+ {
+ // Ensure that we remove the temporary album art file when we close the dialog.
+ // TODO this should be removed when base64 issue is solved.
+ TX_LOG_ARGS( "share: remove album art file" )
+ mShareData.songData()->removeAlbumArtFile();
+ }
logoutPlayer();
- delete mShareNetAccMan;
+ // Probably mShareNetAccMan should not be deleted but qt documentation
+ // does not indicate whether QWebPage takes ownership of the object or not.
+ // See http://doc.qt.nokia.com/4.6/qwebpage.html
+ //delete mShareNetAccMan;
TX_EXIT
}
-void MpDetailsShareDialog::initShareData( MpSongData* aSongData )
+/*!
+ Initialize share data.
+ */
+void MpDetailsShareDialog::initShareData( MpSongData* aSongData, const QString& aUnknownTr )
{
TX_ENTRY
// Set information for the share data.
mShareData.setOwner( this );
mShareData.setSongData( aSongData );
- // TODO need localized error message.
- mShareData.setErrorMessage( "An error occured. Sharing is not currently available" );
- // TODO need language setting.
- mShareData.setLanguage( "en" );
+ mShareData.setErrorMessage( tr( ERROR_MESSAGE ) );
+ mShareData.setUnknownTr( aUnknownTr );
TX_EXIT
}
+/*!
+ Initialize language.
+ Language string is formatted like "en-US", where "en" is the ISO-639-1 language code,
+ and "US" is the ISO-3166-1 country code.
+ We use the QT Mobility API (systeminfo) to obtain the settings from the device.
+ In the event that we cannot construct the QSystemInfo variable then we will fallback
+ to some DEFAULT_LANGUAGE setting.
+ */
+void MpDetailsShareDialog::initLanguage()
+{
+ TX_ENTRY
+ // Set language string, example "en-US".
+ QString language;
+ QSystemInfo* sysInfo = new QSystemInfo( this );
+ if ( sysInfo )
+ {
+ language += sysInfo->currentLanguage(); // ISO-639-1 language code.
+ language += "-";
+ language += sysInfo->currentCountryCode(); // ISO-3166-1 country code.
+ delete sysInfo;
+ }
+ else
+ {
+ // Fallback to the default language.
+ language = DEFAULT_LANGUAGE;
+ }
+ TX_LOG_ARGS( "share: language '" << language << "'" )
+ mShareData.setLanguage( language );
+ TX_EXIT
+}
+
+/*!
+ Initialize network access manager.
+ */
void MpDetailsShareDialog::initNetworkAccessManager()
{
TX_ENTRY
- // Make our own network access manager to allow JS retrieval from local cache,
+ // Make our own network access manager to allow file retrieval from local cache,
// since configuration for the default network access manager seems to be
// to always redownload from network.
- mShareNetAccMan = new MpNetworkAccessManager();
- mShareNetAccMan->proxyFactory()->setUseSystemConfiguration( true );
- QNetworkDiskCache* diskCache = new QNetworkDiskCache( this );
- QString location = QDesktopServices::storageLocation( QDesktopServices::CacheLocation );
- diskCache->setCacheDirectory( location );
- mShareNetAccMan->setCache( diskCache );
+ if ( !mShareNetAccMan )
+ {
+ TX_LOG_ARGS( "share: construct network access manager" )
+ mShareNetAccMan = new MpNetworkAccessManager( this );
+ }
TX_EXIT
}
+/*!
+ Initialize the web view.
+ */
void MpDetailsShareDialog::initWebView()
{
TX_ENTRY
- mShareWebView = new QGraphicsWebView();
- mShareWebView->settings()->setAttribute( QWebSettings::LocalContentCanAccessRemoteUrls, true );
- mShareWebView->settings()->setAttribute( QWebSettings::LocalStorageDatabaseEnabled, true );
- mShareWebView->settings()->enablePersistentStorage();
- mShareWebView->page()->setNetworkAccessManager( mShareNetAccMan );
- setContentWidget( mShareWebView );
+ if ( !mShareWebView )
+ {
+ TX_LOG_ARGS( "share: construct share web view" )
+ mShareWebView = new MpShareWebView( this );
+ mShareWebView->page()->setNetworkAccessManager( mShareNetAccMan );
+ mShareWebView->page()->mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff);
+ mShareWebView->page()->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAsNeeded);
+ setContentWidget( mShareWebView );
+ addContext();
+ mProgressbar = new HbProgressDialog(HbProgressDialog::WaitDialog);
+ mProgressbar->setText(tr("Loading"));
+ }
TX_EXIT
}
+/*!
+ Initialize signals and slots.
+ */
void MpDetailsShareDialog::initSignalSlots()
{
TX_ENTRY
+ // Connect various signals to slots for networking.
+ connect( mShareNetAccMan, SIGNAL( sslErrors( QNetworkReply*, const QList< QSslError >& ) ),
+ this, SLOT( handleRequestSSLErrors( QNetworkReply*, const QList< QSslError >& ) ) );
+ connect( mShareNetAccMan, SIGNAL( finished( QNetworkReply* ) ), this, SLOT( handleRequestFinished( QNetworkReply* ) ) );
+
// Connect various signals to slots for interface to webview.
connect( mShareWebView, SIGNAL( loadFinished( bool ) ), SLOT( onIndexLoad( bool ) ) );
connect( mShareWebView->page()->mainFrame(), SIGNAL( javaScriptWindowObjectCleared() ), this, SLOT( addContext() ) );
connect( mShareWebView->page(), SIGNAL( windowCloseRequested() ), this, SIGNAL( closeShareDialog() ) );
+ connect( mProgressbar, SIGNAL(cancelled()), this, SIGNAL( closeShareDialog() ) );
TX_EXIT
}
@@ -186,10 +334,9 @@
QFile file( RND_OVI_LOGIN_FILE );
if ( !file.open( QFile::ReadOnly ) )
{
-// errorHandler( "share", QString( RND_OVI_LOGIN_FILE ) + " missing" );
- mShareData.setUsername( RND_DEFAULT_USER );
- mShareData.setPassword( RND_DEFAULT_PASS );
- result = true;
+ // There must be e:ovicredentials.txt in the filesystem but don't show error dialog
+ // otherwise it will appear as soon as detailsview is created.
+ result = false;
}
else
{
@@ -217,12 +364,46 @@
}
/*!
+ Returns true if the dialog has been fully initialized.
+ */
+bool MpDetailsShareDialog::isInitialized() const
+{
+ return mIsInitialized;
+}
+
+/*!
+ Attempt to cache the publishing player files from internet
+ to improve user experience for first-time use.
+ If the files are already in the cache and have not expired,
+ then this should not do anything.
+ */
+void MpDetailsShareDialog::cachePublishingPlayerFiles()
+{
+ TX_ENTRY
+ // We need the network access manager, so make sure it is initialized.
+ if ( !mShareNetAccMan )
+ {
+ initNetworkAccessManager();
+ }
+ // Attempt to get the required publishing player files from the net in advance.
+ // We don't listen to any signal that the download succeeded or failed
+ // since we will let it silently fail at this stage.
+ // These URLs are also included in index.html resource, and the two must
+ // be kept the same.
+ mShareNetAccMan->get( QNetworkRequest( QUrl(
+ "http://hf.ci.wipsl.com/PleiXXPTsup/noheva-be/css/ovi.player.share.ui.css" ) ) );
+ mShareNetAccMan->get( QNetworkRequest( QUrl(
+ "http://hf.ci.wipsl.com/PleiXXPTsup/noheva-be/js/publishplayer.js" ) ) );
+ TX_EXIT
+}
+
+/*!
Release resources from share player.
*/
void MpDetailsShareDialog::logoutPlayer()
{
TX_ENTRY
- if (mShareWebView)
+ if ( mShareWebView )
{
mShareWebView->page()->mainFrame()->evaluateJavaScript( "music.teardown();" );
}
@@ -235,7 +416,7 @@
void MpDetailsShareDialog::addContext()
{
TX_ENTRY
- if (mShareWebView)
+ if ( mShareWebView )
{
mShareWebView->page()->mainFrame()->addToJavaScriptWindowObject( "context", &mShareData );
}
@@ -248,9 +429,10 @@
void MpDetailsShareDialog::updateSharedData()
{
TX_ENTRY
- if (mShareWebView)
+ if ( mShareWebView )
{
- mShareWebView->page()->mainFrame()->evaluateJavaScript( "music.updateContextArea();" );
+ // We don't need to call updateContextArea when the track URL has been updated.
+ //mShareWebView->page()->mainFrame()->evaluateJavaScript( "music.updateContextArea();" );
mShareWebView->page()->mainFrame()->evaluateJavaScript( "music.updateMetadata();" );
}
TX_EXIT
@@ -287,12 +469,23 @@
/*!
Slot to call for displaying an error message to the user.
*/
-void MpDetailsShareDialog::errorHandler( QString error, QString message )
+void MpDetailsShareDialog::errorHandler( QString aError, QString aMessage )
{
TX_ENTRY
- TX_LOG_ARGS( "share: errorHandler: " << error << ": " << message )
- HbMessageBox::warning( error + ": " + message ); // For week16 hbwidgets
-// HbMessageBox::launchWarningMessageBox( error + ": " + message ); // For week12 hbwidgets
+ // If error argument ends with "_SUCCESS", then this should be an info message.
+ // If error argument ends with "_FAILED" or something else, then this should be a warning message.
+ TX_LOG_ARGS( "share: errorHandler: " << aError << ": " << aMessage )
+ if ( aError.endsWith( "_SUCCESS" ) )
+ {
+ // TODO this method seems to be deprecated?
+ HbMessageBox::information( tr( "%1" ).arg( aError ) + ": " + tr( "%1" ).arg( aMessage ) ); // For week16 hbwidgets
+ }
+ else
+ {
+ // TODO this method seems to be deprecated?
+ HbMessageBox::warning( tr( "%1" ).arg( aError ) + ": " + tr( "%1" ).arg( aMessage ) ); // For week16 hbwidgets
+ // HbMessageBox::launchWarningMessageBox( tr( "%1" ).arg( aError ) + ": " + tr( "%1" ).arg( message ) ); // For week12 hbwidgets
+ }
TX_EXIT
}
@@ -321,4 +514,55 @@
TX_EXIT
}
+/*!
+ Slot to show the publishing window after html elements are created in javascript.
+ */
+void MpDetailsShareDialog::showWindow()
+{
+ TX_ENTRY
+ if (mProgressbar)
+ mProgressbar->close();
+ show();
+ TX_EXIT
+}
+
+/*!
+ Slot to show progress dialog if the publishing window is not loaded in .3 sec.
+ */
+void MpDetailsShareDialog::showProgressDialog()
+{
+ TX_ENTRY
+ if (!isVisible())
+ mProgressbar->show();
+ TX_EXIT
+}
+
+/*!
+ Slot to SSL errors in network request. We will ignore any errors.
+ */
+void MpDetailsShareDialog::handleRequestSSLErrors( QNetworkReply* aReply, const QList< QSslError >& aErrors )
+{
+ TX_ENTRY
+ aReply->ignoreSslErrors();
+ for( int i = 0; i < aErrors.count(); i++ )
+ {
+ TX_LOG_ARGS( "SSL error " << aErrors.at( i ).errorString() );
+ }
+ TX_EXIT
+}
+
+/*!
+ Slot to handle network request completion.
+ */
+void MpDetailsShareDialog::handleRequestFinished( QNetworkReply* aReply )
+{
+ TX_ENTRY
+ if ( aReply->error() != QNetworkReply::NoError )
+ {
+ TX_LOG_ARGS( "Network request error " << aReply->error() << aReply->errorString() );
+ // TODO what to do now?
+ }
+ TX_EXIT
+}
+
#endif // SHARE_FUNC_ENABLED
--- a/mpviewplugins/mpdetailsviewplugin/src/mpdetailsview.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/src/mpdetailsview.cpp Fri May 28 19:46:01 2010 -0500
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
-* This component and the accompanying materials are made available
+* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
@@ -26,9 +26,7 @@
#include <QGraphicsLinearLayout>
#include <QSizeF>
-#include <thumbnailmanager_qt.h>
-#include <thumbnaildata.h>
-#include <thumbnailobjectsource.h>
+
#include <hbinstance.h>
#include <hbmainwindow.h>
@@ -57,7 +55,7 @@
#include "mpdetailssharedialog.h"
#endif
-const int KUndefined = -1;
+
const int KRecommendationCount = 2;
@@ -68,16 +66,20 @@
: mMpEngine( 0 ),
mSongData( 0 ),
mActivated( false ),
- mWindow( 0 ),
mSoftKeyBack( 0 ),
- mSongText( NULL ),
- mAlbumText( NULL ),
- mArtistText( NULL ),
- mAlbumArt( NULL ),
- mDocumentLoader( NULL ),
- mDownloadedAlbumArts( 0 ),
+ mSongText( 0 ),
+ mAlbumText( 0 ),
+ mArtistText( 0 ),
+ mAlbumArt( 0 ),
+ mSongDetailsGroupBox(0),
+ mInspireMeGroupBox(0),
+ mShareButton(0),
+ mDocumentLoader( 0 ),
+ mDetailList(0),
+ mInspireList(0),
+ mInspireMeProgressBar(0),
mMpTranslator( 0 ),
- mCommonTranslator( 0 ),
+ mCommonTranslator( 0 ),
mMpQueryManager( 0 ),
mInspireMeQueryOngoing( false ),
mInspireMeQueryRendered( false ),
@@ -91,28 +93,26 @@
bool widgetsOk = false;
HbMainWindow *mainWindow = hbInstance->allMainWindows()[0];
mDocumentLoader = new HbDocumentLoader();
-
+
TX_LOG_ARGS("Document loader created")
if(!mDocumentLoader) {
TX_LOG_ARGS( "MpDetailsView() Error: HbDocumentLoader not constructed" );
- return;
+ return;
}
TX_LOG_ARGS("Loading :/mpdetailsviewdocml/mpdetailsview.docml")
mDocumentLoader->load( QString(":/mpdetailsviewdocml/mpdetailsview.docml"), &widgetsOk );
if(!widgetsOk) {
TX_LOG_ARGS( "MpDetailsView() Error: invalid mpdetailsview.docml" );
- return;
+ return;
}
-
+
TX_LOG_ARGS("Loaded :/mpdetailsviewdocml/mpdetailsview.docml")
- QGraphicsWidget *widget = 0;
-
+ QGraphicsWidget *widget = 0;
+
widget = mDocumentLoader->findWidget( QString("content") );
TX_LOG_ARGS( "MpDetailsView() mDocumentLoader->findWidget for <content>: " << (int)(widget) );
- mContainer = qobject_cast<HbWidget *>(widget);
- TX_LOG_ARGS("MpDetailsView() <content> widget found mContainer: " << (int)(mContainer));
- setWidget( mContainer );
+ setWidget( qobject_cast<HbWidget *>(widget) );
widget = mDocumentLoader->findWidget( QString("shareButton") );
mShareButton = qobject_cast<HbPushButton *>(widget);
@@ -121,11 +121,11 @@
widget = mDocumentLoader->findWidget( QString("trackTitle") );
mSongText = qobject_cast<HbLabel *>(widget);
TX_LOG_ARGS("MpDetailsView() <trackTitle> widget found mSongText: " << (int)(mSongText) );
-
+
widget = mDocumentLoader->findWidget( QString("artist") );
mArtistText = qobject_cast<HbLabel *>(widget);
TX_LOG_ARGS("MpDetailsView() <artist> widget found mArtistText: " << (int)(mArtistText) );
-
+
widget = mDocumentLoader->findWidget( QString("albumName") );
mAlbumText = qobject_cast<HbLabel *>(widget);
TX_LOG_ARGS("MpDetailsView() <albumName> widget found mAlbumText: " << (int)(mAlbumText) );
@@ -133,15 +133,15 @@
widget = mDocumentLoader->findWidget( QString("albumArt") );
mAlbumArt = qobject_cast<HbLabel *>(widget);
TX_LOG_ARGS("MpDetailsView() <albumArt> widget found mAlbumArt: " << (int)(mAlbumArt) );
-
+
widget = mDocumentLoader->findWidget( QString("songDetails") );
mSongDetailsGroupBox = qobject_cast<HbGroupBox *>(widget);
TX_LOG_ARGS("MpDetailsView() <songDetails> widget found mSongDetailsGroupBox: " << (int)(mSongDetailsGroupBox) );
-
+
widget = mDocumentLoader->findWidget( QString("songDetailsListWidget") );
mDetailList = qobject_cast<HbListWidget *>(widget);
TX_LOG_ARGS("MpDetailsView() <songDetailsListWidget> widget found mDetailList: " << (int)(mDetailList) );
-
+
widget = mDocumentLoader->findWidget( QString("inspireMeGroupBox") );
mInspireMeGroupBox = qobject_cast<HbGroupBox *>(widget);
TX_LOG_ARGS("MpDetailsView() <inspireMeGroupBox> widget found mInspireMeGroupBox: " << (int)(mInspireMeGroupBox) );
@@ -149,11 +149,20 @@
widget = mDocumentLoader->findWidget( QString("inspireListWidget") );
mInspireList = qobject_cast<HbListWidget *>(widget);
TX_LOG_ARGS("MpDetailsView() <inspireListWidget> widget found mInspireList: " << (int)(mInspireList) );
-
+
widget = mDocumentLoader->findWidget( QString("inspireMeProgressBar") );
mInspireMeProgressBar = qobject_cast<HbProgressBar *>(widget);
TX_LOG_ARGS("MpDetailsView() <inspireMeProgressBar> widget found mInspireMeProgressBar: " << (int)(mInspireMeProgressBar) );
-
+
+ // load section HideInspireMe if no ovi store suport
+ bool loadingSectionOk = false;
+ mDocumentLoader->load( QString(":/mpdetailsviewdocml/mpdetailsview.docml"), QString( "ShowInspireMe" ), &loadingSectionOk );
+ if( loadingSectionOk ) {
+ TX_LOG_ARGS( "Loading ShowInspireMe section is successful." );
+ } else {
+ TX_LOG_ARGS( "Loading ShowInspireMe section fails." );
+ }
+
TX_EXIT
}
@@ -162,16 +171,9 @@
*/
MpDetailsView::~MpDetailsView()
{
- TX_ENTRY
- if ( mSoftKeyBack ) {
- delete mSoftKeyBack;
- }
- if ( mDocumentLoader ) {
- delete mDocumentLoader;
- }
- if( mThumbnailManager ) {
- delete mThumbnailManager;
- }
+ TX_ENTRY
+ delete mSoftKeyBack;
+ delete mDocumentLoader;
delete mMpTranslator;
delete mCommonTranslator;
delete mMpQueryManager;
@@ -188,8 +190,8 @@
*/
void MpDetailsView::initializeView()
{
- TX_ENTRY
-
+ TX_ENTRY
+
//Load musicplayer and common translators
QString lang = QLocale::system().name();
QString path = QString( "z:/resource/qt/translations/" );
@@ -208,47 +210,31 @@
if ( translatorLoaded ) {
qApp->installTranslator( mMpTranslator );
}
-
- // TODO: Hkn: Remove this once ELCE-844GBS is fixed
- mInspireMeProgressBar->hide();
-
- mWindow = mainWindow();
- mSoftKeyBack = new HbAction( Hb::BackNaviAction, this );
-
+
+ mSoftKeyBack = new HbAction( Hb::BackNaviAction, this );
+
mMpEngine = MpEngineFactory::sharedEngine();
mSongData = mMpEngine->songData();
-
- // TODO: Remove this once Orbit bug ELCE-843HFJ is fixed
- mInspireList->setVerticalScrollBarPolicy(HbScrollArea::ScrollBarAlwaysOff);
-
-
-
-
- mThumbnailManager = new ThumbnailManager( this );
- mThumbnailManager->setQualityPreference( ThumbnailManager::OptimizeForQuality );
- mThumbnailManager->setThumbnailSize( ThumbnailManager::ThumbnailSmall );
- QObject::connect( mThumbnailManager, SIGNAL( thumbnailReady( QPixmap , void * , int , int ) ),
- this, SLOT( thumbnailReady( QPixmap , void * , int , int ) ) );
- // TODO: Use the album art in provided by 10.1 wk16 platform. Current one is in the binary
- mDefaultRecommendationAlbumArt = QPixmap( ":/mpdetailsviewicons/qtg_large_music_album.svg" );
-
+
// TODO: might need later
setupMenu();
- mMpQueryManager = new MpQueryManager();
-
+ mMpQueryManager = new MpQueryManager();
+
connect( mSoftKeyBack, SIGNAL( triggered() ), this, SLOT( back() ) );
- connect( mSongData, SIGNAL( albumArtReady() ), this, SLOT( albumArtChanged() ) );
+ connect( mSongData, SIGNAL( albumArtReady() ), this, SLOT( albumArtChanged() ) );
connect( mSongData, SIGNAL( playbackInfoChanged() ), this, SLOT( handlePlaybackInfoChanged() ) );
- connect( mSongData, SIGNAL( songDetailInfoChanged() ), this, SLOT( songDetailInfoChanged() ) );
+ connect( mSongData, SIGNAL( songDetailInfoChanged() ), this, SLOT( songDetailInfoChanged() ) );
+ connect( mSongDetailsGroupBox, SIGNAL( toggled( bool ) ), this, SLOT( handleDetailsGroupBoxToggled( bool ) ) );
+ connect( mInspireMeGroupBox, SIGNAL( toggled( bool ) ), this, SLOT( handleInspireMeGroupBoxToggled( bool ) ) );
connect( mMpQueryManager, SIGNAL( networkError() ), this ,SLOT( handleNetworkError() ) );
- connect( mMpQueryManager, SIGNAL(setAlbumArt(const QString &, const QString &) ), this ,SLOT(setAlbumArtUri(const QString &, const QString & )));
connect( mMpQueryManager, SIGNAL(searchUrlRetrieved(const QString&)), this, SLOT(updateSharedData(const QString&)));
+ connect( mMpQueryManager, SIGNAL(recommendationAlbumArtsReady()), this, SLOT(RenderInspireMeGroupBox()));
-#ifdef SHARE_FUNC_ENABLED
+#ifdef SHARE_FUNC_ENABLED
connect( mShareButton, SIGNAL( clicked() ), this, SLOT( share() ) );
-
+
// Preload the share popup
- createShareDialog();
+ preloadShareDialog();
#endif
TX_EXIT
}
@@ -258,10 +244,10 @@
*/
void MpDetailsView::activateView()
{
- TX_ENTRY
+ TX_ENTRY
setNavigationAction( mSoftKeyBack );
mMpEngine->retrieveSong();
-
+
mActivated = true;
mInspireMeOpen = MpSettingsManager::inspireMe();
mSongDetailsGbOpen = MpSettingsManager::songDetailsGb();
@@ -269,10 +255,6 @@
TX_LOG_ARGS( "SongDetailsGbVal: " << mSongDetailsGbOpen );
mInspireMeGroupBox->setCollapsed(!mInspireMeOpen);
mSongDetailsGroupBox->setCollapsed(!mSongDetailsGbOpen);
-
- connect( mSongDetailsGroupBox, SIGNAL( toggled( bool ) ), this, SLOT( handleDetailsGroupBoxToggled( bool ) ) );
- connect( mInspireMeGroupBox, SIGNAL( toggled( bool ) ), this, SLOT( handleInspireMeGroupBoxToggled( bool ) ) );
-
TX_EXIT
}
@@ -281,25 +263,21 @@
*/
void MpDetailsView::deactivateView()
{
- TX_ENTRY
+ TX_ENTRY
if (mInspireMeGroupBox->isCollapsed() ) {
MpSettingsManager::setInspireMe(false);
} else {
MpSettingsManager::setInspireMe(true);
}
-
+
if (mSongDetailsGroupBox->isCollapsed() ) {
MpSettingsManager::setSongDetailsGb(false);
} else {
MpSettingsManager::setSongDetailsGb(true);
}
-
+
setNavigationAction( 0 );
- mActivated = false;
-
- disconnect( mSongDetailsGroupBox, SIGNAL( toggled( bool ) ), this, SLOT( handleDetailsGroupBoxToggled( bool ) ) );
- disconnect( mInspireMeGroupBox, SIGNAL( toggled( bool ) ), this, SLOT( handleInspireMeGroupBoxToggled( bool ) ) );
-
+ mActivated = false;
TX_EXIT
}
@@ -318,7 +296,7 @@
*/
void MpDetailsView::back()
{
- TX_ENTRY
+ TX_ENTRY
emit command( MpCommon::ActivatePlaybackView );
TX_EXIT
}
@@ -327,7 +305,7 @@
Slot to handle Album art changed.
*/
void MpDetailsView::albumArtChanged( )
-{
+{
TX_ENTRY
HbIcon icon;
mSongData->albumArt( icon );
@@ -343,38 +321,15 @@
TX_ENTRY
mInspireMeQueryOngoing = false;
mInspireMeQueryRendered = false;
- clearInspireMe();
+ clearInspireMe();
mInspireMeGroupBox->setCollapsed( true );
TX_EXIT
}
/*!
- Sets recommendation album art
-*/
-void MpDetailsView::setAlbumArtUri( const QString &albumArtUri, const QString &albumArtName )
-{
- TX_ENTRY_ARGS( "albumArtUri = " << albumArtUri )
- TX_LOG_ARGS( "albumArtName = " << albumArtName )
- if ( !albumArtUri.isEmpty() && !albumArtName.isEmpty() ) {
- int id = mThumbnailManager->getThumbnail( albumArtName, reinterpret_cast<void *>( const_cast<QString *>( &albumArtUri ) ) );
- if ( id == KUndefined ) {
- // Request failed. Set default album art.
- mMpQueryManager->insertMapItem( albumArtUri, mDefaultRecommendationAlbumArt );
- recommendationAlbumArtReady();
- }
- }
- else {
- // No album art uri. Set default album art.
- mMpQueryManager->insertMapItem( albumArtUri, mDefaultRecommendationAlbumArt );
- recommendationAlbumArtReady();
- }
- TX_EXIT
-}
-
-/*!
Render inspireme groupbox after album arts downloaded
*/
-void MpDetailsView::RenderInspireMeGroupBox()
+void MpDetailsView::RenderInspireMeGroupBox()
{
TX_ENTRY
mInspireMeQueryOngoing = false;
@@ -386,13 +341,13 @@
for ( int i = 0; i < KRecommendationCount; i++ ) {
// configure the layout properties
if(!mInspireList->count()) {
- // we havent configured the prototype before
+ // we havent configured the prototype before
HbListViewItem *prototype = mInspireList->listItemPrototype();
prototype->setGraphicsSize( HbListViewItem::LargeIcon );
}
// create the item
HbListWidgetItem *inspireMeItem = new HbListWidgetItem();
- HbIcon icon( QIcon( mMpQueryManager->recommendationAlbumArtsMap().value(mMpQueryManager->recommendationAlbumArtsLink().at( i ) ) ) );
+ HbIcon icon( QIcon( mMpQueryManager->recommendationAlbumArtsMap().value(mMpQueryManager->recommendationAlbumArtsLink().at( i ) ) ) );
inspireMeItem->setIcon( icon );
inspireMeItem->setText( mMpQueryManager->recommendationSongs().at( i ) );
inspireMeItem->setSecondaryText( mMpQueryManager->recommendationArtists().at( i ) );
@@ -402,37 +357,26 @@
else {
TX_LOG_ARGS( "There is NO recommendation." )
// we dont have recommendations
- // we havent configured the prototype before
+ // we havent configured the prototype before
HbListViewItem *prototype = mInspireList->listItemPrototype();
const int maxTextRowCount = 20;
const int minTextRowCount = 1;
prototype->setSecondaryTextRowCount(minTextRowCount,maxTextRowCount);
-
+
HbListWidgetItem *inspireMeItem = new HbListWidgetItem();
QString info(tr("There are no recommendations for this track, but you can always discover new music on Ovi"));
inspireMeItem->setText( QString( " " ) );
inspireMeItem->setSecondaryText( info );
mInspireList->addItem( inspireMeItem );
}
-
+
TX_EXIT
}
-void MpDetailsView::recommendationAlbumArtReady()
-{
- TX_ENTRY_ARGS( "mAlbumArtsReadyCount = " << mMpQueryManager->albumArtsReadyCount() )
- ( mMpQueryManager->albumArtsReadyCount() )++;
- if ( mMpQueryManager->albumArtsReadyCount() == KRecommendationCount ) {
- RenderInspireMeGroupBox();
- }
- TX_EXIT
-}
-
-
bool MpDetailsView::canQueryRecommendations() const
{
bool result = ( ( !mSongData->album().isEmpty() ) ||
- ( !mSongData->artist().isEmpty() ) ) &&
+ ( !mSongData->artist().isEmpty() ) ) &&
!( mInspireMeGroupBox->isCollapsed() );
TX_LOG_ARGS( "Can query recommendations:" << result );
return result;
@@ -455,33 +399,37 @@
mMpQueryManager->clearNetworkReplies();
clearInspireMe();
mInspireMeQueryRendered = false;
-
+
+ // Clear the song data link until new query has been made.
+ mSongData->setLink( "" );
+
if ( !mSongData->title().isEmpty () ) {
mSongText->setPlainText( mSongData->title() );
} else {
mSongText->setPlainText( mSongData->fileName() );
}
-
+
if ( !mSongData->album().isEmpty () ) {
mAlbumText->setPlainText( mSongData->album() );
} else {
- mAlbumText->setPlainText( tr( "Unknown ") );
+ mAlbumText->setPlainText( tr( "Unknown") );
}
-
+
if ( !mSongData->artist().isEmpty() ) {
mArtistText->setPlainText( mSongData->artist() );
} else {
- mArtistText->setPlainText( tr( "Unknown ") );
+ mArtistText->setPlainText( tr( "Unknown") );
}
-
+
+ if (canQuerySharePlayerLink() ) {
+ mMpQueryManager->queryLocalMusicStore(mSongData->artist(),mSongData->album(),mSongData->title());
+ }
+
if (canQueryRecommendations()) {
// start inspire me area progress bar
// TODO: currently, till we get to this callback from MPX the bar not shown
// TODO: check if inspireMe is ON, if not, dont show
mInspireMeProgressBar->show();
- if (canQuerySharePlayerLink() ) {
- mMpQueryManager->queryLocalMusicStore(mSongData->artist(),mSongData->album(),mSongData->title());
- }
mMpQueryManager->queryInspireMeItems(mSongData->artist(),mSongData->album(),mSongData->title());
mInspireMeQueryOngoing = true;
}
@@ -491,15 +439,15 @@
if (!mInspireMeGroupBox->isCollapsed())
RenderInspireMeGroupBox();
}
- TX_EXIT
+ TX_EXIT
}
void MpDetailsView::clearInspireMe()
{
- TX_ENTRY
+ TX_ENTRY
mInspireList->clear();
- mMpQueryManager->clearRecommendations();
- TX_EXIT
+ mMpQueryManager->clearRecommendations();
+ TX_EXIT
}
/*!
Slot to handle detail song information
@@ -508,15 +456,15 @@
{
TX_ENTRY
mDetailList->clear();
-
+
if ( !mSongData->albumTrack().isNull() ) {
- HbListWidgetItem *item = new HbListWidgetItem();
+ HbListWidgetItem *item = new HbListWidgetItem();
item->setText( tr( "Song number" ) );
item->setSecondaryText( mSongData->albumTrack() );
item->setEnabled( false );
mDetailList->addItem( item );
}
-
+
if ( !mSongData->year().isNull() ) {
HbListWidgetItem *item = new HbListWidgetItem();
item->setText( tr( "Year" ) );
@@ -524,7 +472,7 @@
item->setEnabled( false );
mDetailList->addItem( item );
}
-
+
if ( !mSongData->genre().isNull() ) {
HbListWidgetItem *item = new HbListWidgetItem();
item->setText( tr( "Genre" ) );
@@ -532,7 +480,7 @@
item->setEnabled( false );
mDetailList->addItem( item );
}
-
+
if ( !mSongData->composer().isNull() ) {
HbListWidgetItem *item = new HbListWidgetItem();
item->setText( tr( "Composer" ) );
@@ -548,7 +496,7 @@
item->setEnabled( false );
mDetailList->addItem( item );
}
-
+
if ( !mSongData->mimeType().isNull() ) {
HbListWidgetItem *item = new HbListWidgetItem();
item->setText( tr( "Format" ) );
@@ -564,7 +512,7 @@
item->setEnabled( false );
mDetailList->addItem( item );
}
-
+
if ( !mSongData->bitRate().isNull() ) {
HbListWidgetItem *item = new HbListWidgetItem();
item->setText( tr( "Bitrate" ) );
@@ -572,7 +520,7 @@
item->setEnabled( false );
mDetailList->addItem( item );
}
-
+
if ( !mSongData->sampleRate().isNull() ) {
HbListWidgetItem *item = new HbListWidgetItem();
item->setText( tr( "Sampling rate" ) );
@@ -580,7 +528,7 @@
item->setEnabled( false );
mDetailList->addItem( item );
}
-
+
if ( !mSongData->size().isNull() ) {
HbListWidgetItem *item = new HbListWidgetItem();
item->setText( tr( "Size" ) );
@@ -588,7 +536,7 @@
item->setEnabled( false );
mDetailList->addItem( item );
}
-
+
if ( !mSongData->modified().isNull() ) {
HbListWidgetItem *item = new HbListWidgetItem();
item->setText( tr( "Modified" ) );
@@ -604,7 +552,7 @@
item->setEnabled( false );
mDetailList->addItem( item );
}
-
+
if ( !mSongData->musicURL().isNull() ) {
HbListWidgetItem *item = new HbListWidgetItem();
item->setText( tr( "Web site" ) );
@@ -612,7 +560,7 @@
item->setEnabled( true );
mDetailList->addItem( item );
}
-
+
if ( mSongData->isDrmProtected() ) {
HbListWidgetItem *item = new HbListWidgetItem();
item->setText( tr( "Licences" ) );
@@ -624,9 +572,8 @@
TX_EXIT
}
-void MpDetailsView::handleDetailsGroupBoxToggled(bool state)
+void MpDetailsView::handleDetailsGroupBoxToggled(bool /*state*/)
{
- Q_UNUSED(state);
TX_ENTRY
if ( !mSongDetailsGroupBox->isCollapsed() ) {
mInspireMeGroupBox->setCollapsed( true );
@@ -639,7 +586,7 @@
TX_ENTRY
if ( !mInspireMeGroupBox->isCollapsed() ) {
TX_LOG_ARGS( "InspireMe is expanded." )
- mSongDetailsGroupBox->setCollapsed( true );
+ mSongDetailsGroupBox->setCollapsed( true );
if ( mInspireMeQueryOngoing ) {
TX_LOG_ARGS( "Query is ongoing " )
mInspireMeProgressBar->show();
@@ -658,7 +605,7 @@
TX_LOG_ARGS( "InspireMe is NOT rendered yet and CANNOT query for recommendations either. " )
RenderInspireMeGroupBox();
}
- }
+ }
}
} else {
TX_LOG_ARGS( "InspireMe is collapsed." )
@@ -667,30 +614,6 @@
TX_EXIT
}
-/*!
- Slot to handle the recommendation album art
-*/
-void MpDetailsView::thumbnailReady(
- const QPixmap& pixmap,
- void *data,
- int /*id*/,
- int error )
-{
- TX_ENTRY
- // TODO: Hkn: use qobject_cast
- QString uri = *( reinterpret_cast<QString *>( data ) );
- TX_LOG_ARGS( "Uri: " << uri );
-
- if ( error == 0 ) {
- TX_LOG_ARGS( "album art link: " << uri );
- mMpQueryManager->insertMapItem( uri, pixmap );
- } else {
- mMpQueryManager->insertMapItem( uri, mDefaultRecommendationAlbumArt );
- }
- recommendationAlbumArtReady();
- TX_EXIT
-}
-
#ifdef SHARE_FUNC_ENABLED
/*!
Slot to be called when share button is clicked
@@ -699,10 +622,6 @@
{
TX_ENTRY
createShareDialog();
- if ( mSharePopup )
- {
- mSharePopup->show();
- }
if (canQuerySharePlayerLink() )
{
mMpQueryManager->queryLocalMusicStore(mSongData->artist(),mSongData->album(),mSongData->title() );
@@ -712,6 +631,7 @@
/*!
Method to create the share dialog on demand.
+ This will cause the share web view to be created and start loading.
*/
void MpDetailsView::createShareDialog()
{
@@ -719,13 +639,31 @@
if ( !mSharePopup )
{
mSharePopup = new MpDetailsShareDialog();
- connect( mSharePopup, SIGNAL(closeShareDialog() ), this, SLOT( closeShareDialog() ) );
- mSharePopup->initialize( mSongData );
+ }
+ if ( !mSharePopup->isInitialized() )
+ {
+ connect( mSharePopup, SIGNAL( closeShareDialog() ), this, SLOT( closeShareDialog() ) );
+ mSharePopup->initialize( mSongData, tr( "Unknown" ) );
}
TX_EXIT
}
/*!
+ Method to create the share dialog on demand and preload publishing player files.
+ This will construct the share dialog but it will still be in "uninitialized" state.
+ */
+void MpDetailsView::preloadShareDialog()
+{
+ TX_ENTRY
+ if ( !mSharePopup )
+ {
+ mSharePopup = new MpDetailsShareDialog();
+ }
+ mSharePopup->cachePublishingPlayerFiles();
+ TX_EXIT
+}
+
+/*!
Slot to be called when ok/close button in share dialog is pressed.
*/
void MpDetailsView::closeShareDialog()
@@ -733,8 +671,8 @@
TX_ENTRY
if ( mSharePopup )
{
+ // Dialog uses WA_DeleteOnClose so no need to delete it explicitely here, just close it.
mSharePopup->close();
- delete mSharePopup;
mSharePopup = NULL;
}
TX_EXIT
--- a/mpviewplugins/mpdetailsviewplugin/src/mpquerymanager.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/src/mpquerymanager.cpp Fri May 28 19:46:01 2010 -0500
@@ -31,12 +31,20 @@
#include <QDir>
#include <QCoreApplication>
+#include <thumbnailmanager_qt.h>
+#include <thumbnaildata.h>
+#include <thumbnailobjectsource.h>
+
#include "mpdetailssharedialog.h"
#include "mptrace.h"
+const int KUndefined = -1;
const int KRecommendationCount = 2;
MpQueryManager::MpQueryManager()
+ : mManager(0),
+ mDownloadManager(0),
+ mThumbnailManager(0)
{
TX_ENTRY
@@ -60,6 +68,14 @@
mDownloadManager = new QNetworkAccessManager( this );
connect( mDownloadManager, SIGNAL( finished( QNetworkReply * ) ), this, SLOT( DownloadFinished( QNetworkReply * ) ) );
+
+ mThumbnailManager = new ThumbnailManager( this );
+ mThumbnailManager->setQualityPreference( ThumbnailManager::OptimizeForQuality );
+ mThumbnailManager->setThumbnailSize( ThumbnailManager::ThumbnailSmall );
+ QObject::connect( mThumbnailManager, SIGNAL( thumbnailReady( QPixmap , void * , int , int ) ),
+ this, SLOT( thumbnailReady( QPixmap , void * , int , int ) ) );
+ // TODO: Use the album art in provided by 10.1 wk16 platform. Current one is in the binary
+ mDefaultRecommendationAlbumArt = QPixmap( ":/mpdetailsviewicons/qtg_large_music_album.svg" );
TX_EXIT
}
@@ -73,6 +89,7 @@
if ( mDownloadManager ) {
mDownloadManager->deleteLater();
}
+ delete mThumbnailManager;
TX_EXIT
}
@@ -185,15 +202,6 @@
}
/*!
- Return the number of ready album arts
- */
-int &MpQueryManager::albumArtsReadyCount()
-{
- TX_LOG
- return mAlbumArtsReadyCount;
-}
-
-/*!
Insert one uri & pixmap item into map
*/
void MpQueryManager::insertMapItem( const QString &uri, const QPixmap &pixmap )
@@ -238,7 +246,7 @@
*/
void MpQueryManager::retrieveInformationNetworkError( QNetworkReply::NetworkError error )
{
- Q_UNUSED(error);
+ // TODO: agree on error handling
TX_ENTRY_ARGS( "Network error for retrieving Information" << error);
TX_EXIT
}
@@ -269,12 +277,12 @@
// If it failed, use empty filename (since file was removed in any case)
if ( ret )
{
- emit setAlbumArt( mRecommendationAlbumArtsLink.at( mDownloadedAlbumArts),
- mRecommendationAlbumArtsName.at( mDownloadedAlbumArts ) );
+ setAlbumArtUri( mRecommendationAlbumArtsLink.at( mDownloadedAlbumArts),
+ mRecommendationAlbumArtsName.at( mDownloadedAlbumArts ) );
}
else
{
- emit setAlbumArt( mRecommendationAlbumArtsLink.at( mDownloadedAlbumArts), "" );
+ setAlbumArtUri(mRecommendationAlbumArtsLink.at( mDownloadedAlbumArts), "");
}
}
else
@@ -472,3 +480,49 @@
return str.left( str.length() - 1 );
}
+/*!
+ Sets recommendation album art
+*/
+void MpQueryManager::setAlbumArtUri( const QString &albumArtUri, const QString &albumArtName )
+{
+ TX_ENTRY_ARGS( "albumArtUri = " << albumArtUri )
+ TX_LOG_ARGS( "albumArtName = " << albumArtName )
+ if ( !albumArtUri.isEmpty() && !albumArtName.isEmpty() ) {
+ int id = mThumbnailManager->getThumbnail( albumArtName, reinterpret_cast<void *>( const_cast<QString *>( &albumArtUri ) ) );
+ if ( id == KUndefined ) {
+ // Request failed. Set default album art.
+ insertMapItem( albumArtUri, mDefaultRecommendationAlbumArt );
+ }
+ }
+ else {
+ // No album art uri. Set default album art.
+ insertMapItem( albumArtUri, mDefaultRecommendationAlbumArt );
+ }
+ TX_EXIT
+}
+
+/*!
+ Slot to handle the recommendation album art
+*/
+void MpQueryManager::thumbnailReady(
+ const QPixmap& pixmap,
+ void *data,
+ int /*id*/,
+ int error )
+{
+ TX_ENTRY
+ // TODO: Hkn: use qobject_cast
+ QString uri = *( reinterpret_cast<QString *>( data ) );
+ TX_LOG_ARGS( "Uri: " << uri );
+
+ if ( error == 0 ) {
+ TX_LOG_ARGS( "album art link: " << uri );
+ insertMapItem( uri, pixmap );
+ } else {
+ insertMapItem( uri, mDefaultRecommendationAlbumArt );
+ }
+ if(++mAlbumArtsReadyCount == KRecommendationCount) {
+ emit recommendationAlbumArtsReady();
+ }
+ TX_EXIT
+}
--- a/mpviewplugins/mpdetailsviewplugin/src/mpsharedata.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/src/mpsharedata.cpp Fri May 28 19:46:01 2010 -0500
@@ -1,13 +1,32 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
#ifdef SHARE_FUNC_ENABLED
#include "mpsharedata.h"
#include "mpsongdata.h"
+
// TODO OVI_URL needs to come from cenrep
const QString OVI_URL = "http://music.ovi.com";
// The music note symbol that we post if we do not have music store URL.
-const QString MUSIC_NOTE_SYMBOL = "♫ ";
+const QString MUSIC_NOTE_SYMBOL = "♫";
+
MpShareData::MpShareData()
: mOwner( 0 ),
@@ -17,6 +36,7 @@
MpShareData::~MpShareData()
{
+ // Intentionally empty.
}
void MpShareData::setOwner( QObject* aOwner )
@@ -79,17 +99,19 @@
return mLanguage;
}
+void MpShareData::setUnknownTr( const QString& s )
+{
+ mUnknownTr = s;
+}
+
QString MpShareData::objectType() const
{
if ( !mSongData || mSongData->link().isEmpty() )
{
return "NOTE-APPEND";
}
- else
- {
- // No link, append artist-song
- return "URI";
- }
+ // No link, append artist-song
+ return "URI";
}
int MpShareData::objectReservedLength() const
@@ -99,52 +121,31 @@
QString MpShareData::objectContent() const
{
- QString result = "";
- if ( mSongData )
+ if ( mSongData && !mSongData->link().isEmpty() )
{
- if ( !mSongData->link().isEmpty() )
- {
- return mSongData->link();
- }
- else if ( !mSongData->artist().isEmpty() && !mSongData->title().isEmpty() )
- {
- // TODO: do we need to have right-to-left text direction here,
- // i.e. putting the title before the artist in such a case?
- result = MUSIC_NOTE_SYMBOL + mSongData->artist() + ": " + mSongData->title() + " " + OVI_URL;
- }
- else if ( !mSongData->artist().isEmpty() )
- {
- result = MUSIC_NOTE_SYMBOL + mSongData->artist() + " " + OVI_URL;
- }
- else if ( !mSongData->title().isEmpty() )
- {
- result = MUSIC_NOTE_SYMBOL + mSongData->title() + " " + OVI_URL;
- }
- else
- {
- result = MUSIC_NOTE_SYMBOL + OVI_URL;
- }
+ return mSongData->link();
}
- else
- {
- result = MUSIC_NOTE_SYMBOL + OVI_URL;
- }
- return result;
+ // TODO: do we need to have right-to-left text direction here,
+ // i.e. putting the title before the artist in such a case?
+ return MUSIC_NOTE_SYMBOL + " " + artist() + ": " + title() + " " + OVI_URL;
}
QString MpShareData::title() const
{
- return mSongData ? mSongData->title() : "";
-}
-
-QString MpShareData::album() const
-{
- return mSongData ? mSongData->album() : "";
+ if ( mSongData && !mSongData->title().isEmpty() )
+ {
+ return mSongData->title();
+ }
+ return mUnknownTr;
}
QString MpShareData::artist() const
{
- return mSongData ? mSongData->artist() : "";
+ if ( mSongData && !mSongData->artist().isEmpty() )
+ {
+ return mSongData->artist();
+ }
+ return mUnknownTr;
}
QString MpShareData::albumArtBase64() const
--- a/mpviewplugins/mpdetailsviewplugin/tsrc/UT_ALL_mpdetailsviewplugin.pkg Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/UT_ALL_mpdetailsviewplugin.pkg Fri May 28 19:46:01 2010 -0500
@@ -26,8 +26,8 @@
:"Vendor"
; Executable and default resource files
-"/epoc32/release/armv5/udeb/unittest_mpmpxpbframeworkwrapper.exe" - "!:\sys\bin\unittest_mpmpxpbframeworkwrapper.exe"
-"/epoc32/data/z/private/10003a3f/import/apps/unittest_mpmpxpbframeworkwrapper_reg.rsc" - "!:\private\10003a3f\import\apps\unittest_mpmpxpbframeworkwrapper_reg.rsc"
+"/epoc32/release/armv5/udeb/unittest_mpmpxdetailsframeworkwrapper.exe" - "!:\sys\bin\unittest_mpmpxdetailsframeworkwrapper.exe"
+"/epoc32/data/z/private/10003a3f/import/apps/unittest_mpmpxdetailsframeworkwrapper_reg.rsc" - "!:\private\10003a3f\import\apps\unittest_mpmpxdetailsframeworkwrapper_reg.rsc"
"/epoc32/release/armv5/udeb/unittest_mpdetailsview.exe" - "!:\sys\bin\unittest_mpdetailsview.exe"
"/epoc32/data/z/private/10003a3f/import/apps/unittest_mpdetailsview_reg.rsc" - "!:\private\10003a3f\import\apps\unittest_mpdetailsview_reg.rsc"
@@ -38,4 +38,6 @@
"/epoc32/release/armv5/udeb/unittest_mpdetailsviewplugin.exe" - "!:\sys\bin\unittest_mpdetailsviewplugin.exe"
"/epoc32/data/z/private/10003a3f/import/apps/unittest_mpdetailsviewplugin_reg.rsc" - "!:\private\10003a3f\import\apps\unittest_mpdetailsviewplugin_reg.rsc"
+"/epoc32/release/armv5/udeb/unittest_mpquerymanager.exe" - "!:\sys\bin\unittest_mpquerymanager.exe"
+"/epoc32/data/z/private/10003a3f/import/apps/unittest_mpquerymanager_reg.rsc" - "!:\private\10003a3f\import\apps\unittest_mpquerymanager_reg.rsc"
--- a/mpviewplugins/mpdetailsviewplugin/tsrc/UT_ALL_mpdetailsviewplugin.pro Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/UT_ALL_mpdetailsviewplugin.pro Fri May 28 19:46:01 2010 -0500
@@ -18,10 +18,11 @@
TEMPLATE = subdirs
## TODO: fix this pro file, unit tests in their own root compile, but not within this pro file
-##SUBDIRS += ./unittest_mpdetailsview
-##SUBDIRS += ./unittest_mpdetailsviewplugin
-##SUBDIRS += ./unittest_mpmpxdetailsframeworkwrapper
-##SUBDIRS += ./unittest_mpsongdata
+SUBDIRS += ./unittest_mpdetailssharedialog
+SUBDIRS += ./unittest_mpdetailsview
+SUBDIRS += ./unittest_mpdetailsviewplugin
+SUBDIRS += ./unittest_mpquerymanager
+SUBDIRS += ./unittest_mpsharedata
test.depends = first
test.CONFIG += recursive
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/megapak.pkg Fri May 28 19:46:01 2010 -0500
@@ -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: Metapackage for all unit tests
+;
+; Language
+&EN
+
+; SIS header: name, uid, version
+#{"megapak"},(0xEEEECAFE),1,0,0
+
+; Localised Vendor name
+%{"Vendor"}
+
+; Unique Vendor name
+:"Vendor"
+
+
+; Manual PKG pre-rules from PRO files
+; Default HW/platform dependencies
+;[0x101F7961],0,0,0,{"S60ProductID"}
+;[0x102032BE],0,0,0,{"S60ProductID"}
+;[0x102752AE],0,0,0,{"S60ProductID"}
+;[0x1028315F],0,0,0,{"S60ProductID"}
+
+; Default dependency to Qt libraries
+;(0x2001E61C), 4, 6, 3, {"Qt"}
+; Dependency to Qt Webkit
+;(0x200267C2), 4, 6, 3, {"QtWebKit"}
+
+; Embedded SIS files
+@"./unittest_mpdetailssharedialog/unittest_mpdetailssharedialog.sisx", (0xE3fe6204)
+@"./unittest_mpdetailsview/UT_detailsview.sisx", (0xE003e880)
+@"./unittest_mpdetailsviewplugin/UT_mpdetailsviewplugin.sisx", (0xE003e881)
+@"./unittest_mpquerymanager/UT_mpquerymanager.sisx", (0xE003e882)
+@"./unittest_mpsharedata/unittest_mpsharedata.sisx", (0xE5d27be8)
--- a/mpviewplugins/mpdetailsviewplugin/tsrc/sis.bat Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/sis.bat Fri May 28 19:46:01 2010 -0500
@@ -14,7 +14,8 @@
@rem Description:
@rem
+@echo off
del *.sisx
makesis UT_ALL_mpdetailsviewplugin.pkg
-signsis UT_ALL_mpdetailsviewplugin.sis UT_ALL_mpdetailsviewplugin.sisx RNDCERTS_PATH\Nokia_RnDCert_02.der RNDCERTS_PATH\Nokia_RnDCert_02.key
+signsis UT_ALL_mpdetailsviewplugin.sis UT_ALL_mpdetailsviewplugin.sisx %RNDCERTS_PATH%\Nokia_RnDCert_02.der %RNDCERTS_PATH%\Nokia_RnDCert_02.key
del UT_ALL_mpdetailsviewplugin.sis
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/sissify.py Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,69 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+import os
+import sys
+import re
+
+
+def scanUnitTestDirs( dir ):
+ unitTestDirectories = []
+ for root, dirs, files in os.walk(dir):
+ for dir in dirs:
+ m = re.match("unittest_.+", dir)
+ if m != None:
+ m = re.match("unittest_resources", dir)
+ if m == None:
+ fullpath = root + "\\" + dir
+ unitTestDirectories.append( fullpath )
+ return unitTestDirectories
+
+print "Creating all unit test SIS files"
+print " Compiling all unit test binaries..."
+os.system( "sbs -c armv5.test reallyclean > NULL" )
+os.system( "qmake" )
+os.system( "sbs -c armv5_udeb.test -j 4" )
+
+print " Generating individual SIS files..."
+dirs = scanUnitTestDirs( "." )
+for dir in dirs:
+ print " Processing unit test directory " + dir
+ os.chdir( dir )
+
+### Removed individual compiling for now, using main level
+### PRO template to handle all at once.
+# print " Cleaning up the project..."
+# os.system( "sbs -c armv5_udeb.test reallyclean > NULL" )
+# print " Compiling the project..."
+# os.system( "qmake" )
+# os.system( "sbs -c armv5_udeb.test -j 4" )
+
+ print " Creating the SISX..."
+ os.system( "sis.bat > NULL" )
+ print " Directory processed!\n"
+ os.chdir( ".." )
+
+print "Generating main SIS..."
+print " Remove previous files..."
+os.system( "del megapak.sisx > NULL" )
+print " Makesis..."
+os.system( "makesis megapak.pkg megapak.sis > NULL" )
+os.system( "signsis megapak.sis megapak.sisx %RNDCERTS_PATH%\Nokia_RnDCert_02.der %RNDCERTS_PATH%\Nokia_RnDCert_02.key" )
+print " Cleaning up..."
+os.system( "del megapak.sis > NULL" )
+
+print "\n\nJob's done!"
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailssharedialog/UT_mpdetailssharedialog.pkg Fri May 28 19:46:01 2010 -0500
@@ -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:
+;
+; Language
+&EN
+
+; SIS header: name, uid, version
+#{"unittest_mpdetailssharedialog"},(0xE3fe6204),1,0,0
+
+; Localised Vendor name
+%{"Vendor"}
+
+; Unique Vendor name
+:"Vendor"
+
+
+; Manual PKG pre-rules from PRO files
+; Default HW/platform dependencies
+;[0x101F7961],0,0,0,{"S60ProductID"}
+;[0x102032BE],0,0,0,{"S60ProductID"}
+;[0x102752AE],0,0,0,{"S60ProductID"}
+;[0x1028315F],0,0,0,{"S60ProductID"}
+
+; Default dependency to Qt libraries
+;(0x2001E61C), 4, 6, 3, {"Qt"}
+; Dependency to Qt Webkit
+;(0x200267C2), 4, 6, 3, {"QtWebKit"}
+
+; Executable and default resource files
+"/epoc32/release/armv5/udeb/unittest_mpdetailssharedialog.exe" - "!:\sys\bin\unittest_mpdetailssharedialog.exe"
+"/epoc32/data/z/resource/apps/unittest_mpdetailssharedialog.rsc" - "!:\resource\apps\unittest_mpdetailssharedialog.rsc"
+"/epoc32/data/z/private/10003a3f/import/apps/unittest_mpdetailssharedialog_reg.rsc" - "!:\private\10003a3f\import\apps\unittest_mpdetailssharedialog_reg.rsc"
+
+; Manual PKG post-rules from PRO files
--- a/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailssharedialog/sis.bat Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailssharedialog/sis.bat Fri May 28 19:46:01 2010 -0500
@@ -14,7 +14,8 @@
@rem Description:
@rem
+@echo off
del *.sisx
-makesis unittest_mpdetailssharedialog.pkg
-signsis unittest_mpdetailssharedialog.sis unittest_mpdetailssharedialog.sisx RNDCERTS_PATH\Nokia_RnDCert_02.der RNDCERTS_PATH\Nokia_RnDCert_02.key
-del unittest_mpdetailssharedialog.sis
\ No newline at end of file
+makesis UT_mpdetailssharedialog.pkg
+signsis UT_mpdetailssharedialog.sis UT_mpdetailssharedialog.sisx %RNDCERTS_PATH%\Nokia_RnDCert_02.der %RNDCERTS_PATH%\Nokia_RnDCert_02.key
+del UT_mpdetailssharedialog.sis
\ No newline at end of file
--- a/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailssharedialog/src/unittest_mpdetailssharedialog.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailssharedialog/src/unittest_mpdetailssharedialog.cpp Fri May 28 19:46:01 2010 -0500
@@ -21,6 +21,7 @@
#include <hbicon.h>
#endif
#include"unittest_mpdetailssharedialog.h"
+#include "hbmessagebox.h"
// Do this so we can access all member variables.
#define private public
@@ -41,14 +42,17 @@
TestMpDetailsShareDialog tv;
- char *pass[3];
- pass[0] = argv[0];
- pass[1] = "-o";
- pass[2] = "c:\\data\\unittest_testmpdetailssharedialog.txt";
+ if ( argc > 1 ) {
+ return QTest::qExec( &tv, argc, argv);
+ }
+ else {
+ char *pass[3];
+ pass[0] = argv[0];
+ pass[1] = "-o";
+ pass[2] = "c:\\data\\unittest_testmpdetailssharedialog.txt";
- int res = QTest::qExec(&tv, 3, pass);
-
- return res;
+ return QTest::qExec(&tv, 3, pass);
+ }
}
#endif
@@ -82,6 +86,7 @@
void TestMpDetailsShareDialog::cleanupTestCase()
{
qDebug() << "unit test for mpdetailssharedialog end.";
+ QCoreApplication::processEvents();
}
/*!
@@ -91,7 +96,7 @@
{
mSongData = new MpSongData();
mTest = new MpDetailsShareDialog();
- mTest->initialize(mSongData);
+ mTest->initialize(mSongData, "unknown");
}
/*!
@@ -108,6 +113,18 @@
void TestMpDetailsShareDialog::testConstruction()
{
mTest->updateSharedData();
+ mTest->debugJs("Test");
+ mTest->errorHandler("Test error", "Test message");
+ mTest->clearCache();
+ mTest->addContext();
+
+ mTest->mShareNetAccMan = NULL;
+ mTest->mShareWebView = NULL;
+ mTest->updateSharedData();
+ mTest->debugJs("Test");
+ mTest->errorHandler("Test error", "Test message");
+ mTest->clearCache();
+ mTest->addContext();
//nothing to verify
QCOMPARE(true, true);
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailssharedialog/stub/inc/hbmessagebox.h Fri May 28 19:46:01 2010 -0500
@@ -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 file for hbmessagebox class.
+*
+*/
+#ifndef HBMESSAGEBOX_H
+#define HBMESSAGEBOX_H
+
+#include <QObject>
+
+class HbMessageBox : public QObject
+{
+ Q_OBJECT
+public:
+ explicit HbMessageBox();
+ virtual ~HbMessageBox();
+
+public:
+ static void information(const QString &warningText);
+ static void warning(const QString &warningText);
+};
+
+#endif // HB_MESSAGEBOX_H
+
--- a/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailssharedialog/stub/inc/mpsongdata.h Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailssharedialog/stub/inc/mpsongdata.h Fri May 28 19:46:01 2010 -0500
@@ -50,6 +50,7 @@
void commitPlaybackInfo();
// inform details view when details information is ready
void commitSongDetailInfo();
+ void removeAlbumArtFile() const; //TODO: Remove when base64 starts to work
public slots:
void thumbnailReady( const QPixmap& pixmap, void *data, int id, int error );
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailssharedialog/stub/inc/qsysteminfo.h Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Stub of QSystemInfo
+*
+*/
+
+#ifndef QSYSTEMINFO_H
+#define QSYSTEMINFO_H
+
+#include <QObject>
+#include <QString>
+
+
+//class declaration
+class QSystemInfo : public QObject
+{
+ Q_OBJECT
+
+public:
+ QSystemInfo( QObject *parent = 0 );
+ ~QSystemInfo();
+
+ QString currentLanguage();
+ QString currentCountryCode();
+};
+
+#define QTM_USE_NAMESPACE ;
+
+#endif // QSYSTEMINFO_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailssharedialog/stub/src/hbmessagebox.cpp Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,38 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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
+*
+*/
+
+#include "hbmessagebox.h"
+
+HbMessageBox::HbMessageBox()
+{
+
+}
+
+HbMessageBox::~HbMessageBox()
+{
+
+}
+
+void HbMessageBox::information(const QString &warningText)
+{
+
+}
+
+void HbMessageBox::warning(const QString &warningText)
+{
+
+}
--- a/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailssharedialog/stub/src/mpsongdata.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailssharedialog/stub/src/mpsongdata.cpp Fri May 28 19:46:01 2010 -0500
@@ -31,7 +31,7 @@
Song data provide acces to current playing song metadata
*/
-
+
/*!
\fn void albumArtReady()
@@ -43,14 +43,14 @@
This signal is emitted when basic information is available
*/
-
+
/*!
\fn void songDetailInfoChanged()
This signal is emitted when detail information is available
*/
-
-
+
+
/*!
Constructs a new MpSongData.
@@ -175,7 +175,7 @@
*/
QString MpSongData::year() const
{
- //TX_LOG
+ //TX_LOG
return mYear;
}
@@ -375,3 +375,8 @@
// return base64.constData();
return QString("");
}
+
+void MpSongData::removeAlbumArtFile() const
+{
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailssharedialog/stub/src/qsysteminfo.cpp Fri May 28 19:46:01 2010 -0500
@@ -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 of QSystemInfo
+*
+*/
+
+
+#include "qsysteminfo.h"
+
+QSystemInfo::QSystemInfo( QObject *parent )
+ : QObject( parent )
+{
+ //TX_ENTRY
+ //TX_EXIT
+}
+
+QSystemInfo::~QSystemInfo()
+{
+ //TX_ENTRY
+ //TX_EXIT
+}
+
+QString QSystemInfo::currentLanguage() { return "fi"; };
+QString QSystemInfo::currentCountryCode() { return "Fi"; };
--- a/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailssharedialog/unittest_mpdetailssharedialog.pkg Fri May 14 18:54:37 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +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
-#{"unittest_mpdetailssharedialog"},(0xE3fe6204),1,0,0
-
-; Localised Vendor name
-%{"Vendor"}
-
-; Unique Vendor name
-:"Vendor"
-
-
-; Manual PKG pre-rules from PRO files
-; Default HW/platform dependencies
-;[0x101F7961],0,0,0,{"S60ProductID"}
-;[0x102032BE],0,0,0,{"S60ProductID"}
-;[0x102752AE],0,0,0,{"S60ProductID"}
-;[0x1028315F],0,0,0,{"S60ProductID"}
-
-; Default dependency to Qt libraries
-;(0x2001E61C), 4, 6, 3, {"Qt"}
-; Dependency to Qt Webkit
-;(0x200267C2), 4, 6, 3, {"QtWebKit"}
-
-; Executable and default resource files
-"/epoc32/release/armv5/udeb/unittest_mpdetailssharedialog.exe" - "!:\sys\bin\unittest_mpdetailssharedialog.exe"
-"/epoc32/data/z/resource/apps/unittest_mpdetailssharedialog.rsc" - "!:\resource\apps\unittest_mpdetailssharedialog.rsc"
-"/epoc32/data/z/private/10003a3f/import/apps/unittest_mpdetailssharedialog_reg.rsc" - "!:\private\10003a3f\import\apps\unittest_mpdetailssharedialog_reg.rsc"
-
-; Manual PKG post-rules from PRO files
--- a/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailssharedialog/unittest_mpdetailssharedialog.pro Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailssharedialog/unittest_mpdetailssharedialog.pro Fri May 28 19:46:01 2010 -0500
@@ -11,19 +11,24 @@
#
# Contributors:
#
-# Description: Unit test for mpdetailssharedialog
+# Description:
#
-
TEMPLATE = app
CONFIG += qtestlib \
symbian_test \
- hb
+ hb \
+ mobility
QT += webkit \
network \
xml
+MOBILITY += bearer systeminfo
+
TARGET = unittest_mpdetailssharedialog
+
+TARGET.CAPABILITY = All -TCB
+
DEPENDPATH += .
INCLUDEPATH += ./inc \
./stub/inc \
@@ -31,14 +36,23 @@
../../../../inc
INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
-DEFINES += SHARE_FUNC_ENABLED
+DEFINES += SHARE_FUNC_ENABLED SHARE_PLAYER_RND
# Input
HEADERS += inc/unittest_mpdetailssharedialog.h \
../../inc/mpdetailssharedialog.h \
../../inc/mpsharedata.h \
- stub/inc/mpsongdata.h
+ stub/inc/mpsongdata.h \
+ stub/inc/hbmessagebox.h
+win32:{
+HEADERS += stub/inc/qsysteminfo.h
+}
SOURCES += src/unittest_mpdetailssharedialog.cpp \
../../src/mpdetailssharedialog.cpp \
../../src/mpsharedata.cpp \
- stub/src/mpsongdata.cpp
+ stub/src/mpsongdata.cpp \
+ stub/src/hbmessagebox.cpp
+
+win32:{
+SOURCES += stub/src/qsysteminfo.cpp
+}
--- a/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailsview/inc/unittest_mpdetailsview.h Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailsview/inc/unittest_mpdetailsview.h Fri May 28 19:46:01 2010 -0500
@@ -40,24 +40,7 @@
signals:
void back ();
void albumArtChanged();
- void share();
- void webViewLoaded( bool ok );
- void playbackInfoChanged();
- void songDetailInfoChanged();
-
- void toggleDetailsGroupBox( bool state );
- void toggleInspireMeGroupBox( bool state );
-
- void retrieveInformationFinished( QNetworkReply* reply );
- void retrieveInformationNetworkError( QNetworkReply::NetworkError error );
- void retrieveInformationSslErrors( const QList<QSslError> &error );
-
- void DownloadFinished( QNetworkReply* reply );
-
- void addContext();
- void close();
- void thumbnailReady( const QPixmap& pixmap, void *data, int id, int error );
-
+
public slots:
void initTestCase();
void cleanupTestCase();
@@ -69,6 +52,14 @@
void testactivateView();
void testdeactivateView();
void testbackSlot();
+ void testAlbumArtChanged();
+ void testHandleNetworkError();
+ void testCanQueryRecommendations();
+ void testCanQuerySharePlayerLink();
+ void testHandlePlaybackInfoChanged();
+ void testClearInspireMe();
+ void testHandleDetailsGroupBoxToggled();
+ void testHandleInspireMeGroupBoxToggled();
private:
MpDetailsView *mTest;
--- a/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailsview/src/unittest_mpdetailsview.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailsview/src/unittest_mpdetailsview.cpp Fri May 28 19:46:01 2010 -0500
@@ -41,12 +41,14 @@
#include <hbdialog.h>
#include <hblistwidget.h>
#include <hblistwidgetitem.h>
-#include <HbApplication>
+#include <hbapplication.h>
+#include <hbprogressbar.h>
#include "unittest_mpdetailsview.h"
#include "stub/inc/mpsongdata.h"
#include "stub/inc/thumbnailmanager_qt.h"
#include "mpcommondefs.h"
+#include "mpsettingsmanager.h"
// Do this so we can access all member variables.
#define private public
@@ -65,14 +67,17 @@
TestMpDetailsView tv;
- char *pass[3];
- pass[0] = argv[0];
- pass[1] = "-o";
- pass[2] = "c:\\data\\unittest_testmpdetailsview.txt";
+if ( argc > 1 ) {
+ return QTest::qExec( &tv, argc, argv);
+ }
+ else {
+ char *pass[3];
+ pass[0] = argv[0];
+ pass[1] = "-o";
+ pass[2] = "c:\\data\\unittest_mpdetailsview.txt";
- int res = QTest::qExec(&tv, 3, pass);
-
- return res;
+ return QTest::qExec(&tv, 3, pass);
+ }
}
//Constructor
@@ -101,7 +106,7 @@
*/
void TestMpDetailsView::cleanupTestCase()
{
-
+QCoreApplication::processEvents();
}
/*!
@@ -123,25 +128,167 @@
}
void TestMpDetailsView::testactivateView()
- {
+{
mTest->activateView();
- QVERIFY(mTest->mActivated==true);
- }
+ QCOMPARE( mTest->mActivated, true );
+
+ QCOMPARE( mTest->mInspireMeOpen, MpSettingsManager::inspireMe() );
+ QCOMPARE( mTest->mSongDetailsGbOpen, MpSettingsManager::songDetailsGb() );
+}
void TestMpDetailsView::testdeactivateView()
- {
+{
mTest->deactivateView();
- QVERIFY(mTest->mActivated==false);
- }
+ QCOMPARE( mTest->mActivated, false );
+}
-void TestMpDetailsView::testbackSlot() {
- connect(this, SIGNAL(back()), mTest->mSoftKeyBack, SIGNAL(triggered()));
- QSignalSpy spy(mTest, SIGNAL(command(int)));
- QVERIFY(spy.isValid());
- QCOMPARE(spy.count(),0);
+void TestMpDetailsView::testbackSlot()
+{
+ connect( this, SIGNAL( back() ), mTest->mSoftKeyBack, SIGNAL( triggered() ) );
+ QSignalSpy spy( mTest, SIGNAL( command(int) ) );
+ QVERIFY( spy.isValid() );
+ QCOMPARE( spy.count(),0 );
emit back();
- QCOMPARE(spy.count(),1);
- }
+ QCOMPARE( spy.count(), 1 );
+}
+
+void TestMpDetailsView::testAlbumArtChanged()
+{
+ connect( this, SIGNAL( albumArtChanged() ), mTest->mSongData, SIGNAL( albumArtReady() ) );
+
+ emit albumArtChanged();
+ QVERIFY( mTest->mAlbumArt->icon().isNull() == false );
+}
+
+void TestMpDetailsView::testHandleNetworkError()
+{
+ mTest->handleNetworkError();
+ QVERIFY( mTest->mInspireMeQueryOngoing == false );
+ QVERIFY( mTest->mInspireMeQueryRendered == false );
+}
+
+void TestMpDetailsView::testCanQueryRecommendations()
+{
+ mTest->mSongData = new MpSongData();
+ mTest->mSongData->mAlbum = QString( "album" );
+ mTest->mSongData->mArtist = QString( "artist" );
+ mTest->mInspireMeGroupBox->setCollapsed( true );
+ QVERIFY( mTest->canQueryRecommendations() == false );
+
+ mTest->mSongData->mAlbum = QString( "album" );
+ mTest->mSongData->mArtist = QString();
+ mTest->mInspireMeGroupBox->setCollapsed( true );
+ QVERIFY( mTest->canQueryRecommendations() == false );
+
+ mTest->mSongData->mAlbum = QString();
+ mTest->mSongData->mArtist = QString( "artist" );
+ mTest->mInspireMeGroupBox->setCollapsed( true );
+ QVERIFY( mTest->canQueryRecommendations() == false );
+
+ mTest->mSongData->mAlbum = QString();
+ mTest->mSongData->mArtist = QString();
+ mTest->mInspireMeGroupBox->setCollapsed( true );
+ QVERIFY( mTest->canQueryRecommendations() == false );
+
+ mTest->mSongData->mAlbum = QString( "album" );
+ mTest->mSongData->mArtist = QString( "artist" );
+ mTest->mInspireMeGroupBox->setCollapsed( false );
+ QVERIFY( mTest->canQueryRecommendations() == true );
+
+ mTest->mSongData->mAlbum = QString( "album" );
+ mTest->mSongData->mArtist = QString();
+ mTest->mInspireMeGroupBox->setCollapsed( false );
+ QVERIFY( mTest->canQueryRecommendations() == true );
+
+ mTest->mSongData->mAlbum = QString();
+ mTest->mSongData->mArtist = QString( "artist" );
+ mTest->mInspireMeGroupBox->setCollapsed( false );
+ QVERIFY( mTest->canQueryRecommendations() == true );
+
+ mTest->mSongData->mAlbum = QString();
+ mTest->mSongData->mArtist = QString();
+ mTest->mInspireMeGroupBox->setCollapsed( false );
+ QVERIFY( mTest->canQueryRecommendations() == false );
+}
+
+void TestMpDetailsView::testCanQuerySharePlayerLink()
+{
+ mTest->mSongData = new MpSongData();
+ mTest->mSongData->mTitle = QString( "title" );
+ mTest->mSongData->mArtist = QString( "artist" );
+ QVERIFY( mTest->canQuerySharePlayerLink() == true );
+
+ mTest->mSongData->mTitle = QString();
+ mTest->mSongData->mArtist = QString( "artist" );
+ QVERIFY( mTest->canQuerySharePlayerLink() == false );
+
+ mTest->mSongData->mTitle = QString( "title" );
+ mTest->mSongData->mArtist = QString();
+ QVERIFY( mTest->canQuerySharePlayerLink() == false );
+
+ mTest->mSongData->mTitle = QString();
+ mTest->mSongData->mArtist = QString();
+ QVERIFY( mTest->canQuerySharePlayerLink() == false );
+}
+
+void TestMpDetailsView::testHandlePlaybackInfoChanged()
+{
+ mTest->mSongData = new MpSongData();
+ mTest->mInspireMeQueryRendered = true;
+ mTest->mSongData->mAlbum = QString( "album" );
+ mTest->mSongData->mArtist = QString( "artist" );
+ mTest->handlePlaybackInfoChanged();
+ QVERIFY( mTest->mInspireMeQueryRendered == false );
+ QVERIFY( mTest->mSongData->link().isEmpty() == true );
+ QCOMPARE( mTest->mAlbumText->plainText(), QString( "album" ) );
+ QCOMPARE( mTest->mArtistText->plainText(), QString( "artist" ) );
+
+ mTest->mInspireMeQueryRendered = true;
+ mTest->mSongData->mAlbum = QString("");
+ mTest->mSongData->mArtist = QString("");
+ mTest->handlePlaybackInfoChanged();
+ QVERIFY( mTest->mInspireMeQueryRendered == true );
+ QVERIFY( mTest->mSongData->link().isEmpty() == true );
+ QCOMPARE( mTest->mAlbumText->plainText(), QString( "Unknown" ) );
+ QCOMPARE( mTest->mArtistText->plainText(), QString( "Unknown" ) );
+}
+
+void TestMpDetailsView::testClearInspireMe()
+{
+ mTest->clearInspireMe();
+ QVERIFY( mTest->mInspireList->count() == 0 );
+}
+
+void TestMpDetailsView::testHandleDetailsGroupBoxToggled()
+{
+ mTest->handleDetailsGroupBoxToggled( false );
+ QVERIFY( mTest->mInspireMeGroupBox->isCollapsed() == true );
+}
+
+void TestMpDetailsView::testHandleInspireMeGroupBoxToggled()
+{
+ mTest->mSongData = new MpSongData();
+
+ mTest->mInspireMeQueryOngoing = true;
+ mTest->handleInspireMeGroupBoxToggled( false );
+ QVERIFY( mTest->mSongDetailsGroupBox->isCollapsed() == true );
+ QVERIFY ( mTest->mInspireMeProgressBar->isVisible() == true );
+
+ mTest->mInspireMeQueryOngoing = false;
+ mTest->mInspireMeQueryRendered = true;
+ mTest->handleInspireMeGroupBoxToggled( false );
+ QVERIFY( mTest->mSongDetailsGroupBox->isCollapsed() == true );
+
+ mTest->mInspireMeQueryOngoing = false;
+ mTest->mInspireMeQueryRendered = false;
+ mTest->mSongData->mAlbum = QString( "album" );
+ mTest->mSongData->mArtist = QString( "artist" );
+ mTest->handleInspireMeGroupBoxToggled( false );
+ QVERIFY( mTest->mSongDetailsGroupBox->isCollapsed() == true );
+ QVERIFY ( mTest->mInspireMeProgressBar->isVisible() == true );
+ QVERIFY ( mTest->mInspireMeQueryOngoing == true );
+}
+
--- a/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailsview/stub/inc/mpdetailssharedialog.h Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailsview/stub/inc/mpdetailssharedialog.h Fri May 28 19:46:01 2010 -0500
@@ -1,3 +1,20 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 MPDETAILSSHAREDIALOG_H
#define MPDETAILSSHAREDIALOG_H
--- a/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailsview/stub/inc/mpquerymanager.h Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailsview/stub/inc/mpquerymanager.h Fri May 28 19:46:01 2010 -0500
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
-* This component and the accompanying materials are made available
+* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
@@ -20,6 +20,7 @@
#include <qnetworkconfigmanager.h>
#include <qnetworksession.h>
#include <QPixmap>
+#include <QPointer>
#include "mpviewbase.h"
class MpSongData;
@@ -35,41 +36,41 @@
public:
MpQueryManager( QObject *parent=0 );
~MpQueryManager();
-
+
public:
void clearNetworkReplies();
void queryLocalMusicStore( QString mArtist,QString mAlbum,QString mTitle );
void queryInspireMeItems( QString mArtist,QString mAlbum,QString mTitle );
void clearRecommendations();
-
+
QStringList recommendationSongs();
QStringList recommendationArtists();
QStringList recommendationAlbumArtsLink();
QMap<QString, QPixmap> recommendationAlbumArtsMap();
int &albumArtsReadyCount();
-
- void insertMapItem( const QString &uri, const QPixmap &pixmap );
+
+ void insertMapItem( const QString &uri, const QPixmap &pixmap );
signals:
void onlineStatusChanged( bool state );
- void setAlbumArt( const QString &albumArtUri, const QString &albumArtName );
-
-private:
-
- int mDownloadedAlbumArts;
+ void setAlbumArt( const QString &albumArtUri, const QString &albumArtName );
+
+private:
+
+ int mDownloadedAlbumArts;
MpDetailsShareDialog* mSharePopup;
-
+
QString mArtist;
QString mAlbum;
QString mTitle;
-
+
QStringList mRecommendationAlbumArtsName;
-
+
QStringList mRecommendationSongs;
QStringList mRecommendationArtists;
QStringList mRecommendationAlbumArtsLink;
QMap<QString, QPixmap> mRecommendationAlbumArtsMap;
int mAlbumArtsReadyCount;
-
+
};
#endif /* MPQUERYMANAGER_H_ */
--- a/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailsview/stub/inc/mpsongdata.h Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailsview/stub/inc/mpsongdata.h Fri May 28 19:46:01 2010 -0500
@@ -95,7 +95,7 @@
void playbackInfoChanged();
void songDetailInfoChanged();
-private:
+public:
QString mTitle;
QString mAlbum;
QString mArtist;
--- a/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailsview/stub/src/mpdetailssharedialog.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailsview/stub/src/mpdetailssharedialog.cpp Fri May 28 19:46:01 2010 -0500
@@ -1,3 +1,20 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "mpdetailssharedialog.h"
#include "mptrace.h"
#include <QObject>
--- a/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailsview/stub/src/mpenginefactory.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailsview/stub/src/mpenginefactory.cpp Fri May 28 19:46:01 2010 -0500
@@ -18,7 +18,6 @@
#include "mpengine.h"
#include "mpenginefactory.h"
#include "mptrace.h"
-#include "logger.h"
/*!
\class MpEngineFactory
@@ -49,7 +48,7 @@
*/
MpEngineFactory * MpEngineFactory::instance()
{
- TRACE("MpEngineFactory::instance() Stub");
+ TX_LOG_ARGS("MpEngineFactory::instance() Stub")
static MpEngineFactory instance;
return &instance;
}
@@ -60,7 +59,7 @@
*/
MpEngine *MpEngineFactory::createSharedEngine( TUid hostUid , MpEngine::EngineMode mode )
{
- TRACE("MpEngineFactory::instance() createSharedEngine");
+ TX_LOG_ARGS("MpEngineFactory::createSharedEngine() Stub")
if ( !instance()->mSharedEngine ) {
instance()->mSharedEngine = new MpEngine();
}
--- a/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailsview/stub/src/mpquerymanager.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailsview/stub/src/mpquerymanager.cpp Fri May 28 19:46:01 2010 -0500
@@ -23,7 +23,6 @@
#include "mpdetailssharedialog.h"
#include "mptrace.h"
-#include "logger.h"
const int KRecommendationNum = 2;
--- a/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailsview/stub/src/mpsongdata.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailsview/stub/src/mpsongdata.cpp Fri May 28 19:46:01 2010 -0500
@@ -34,9 +34,9 @@
MpSongData::MpSongData( QObject *parent )
: QObject( parent ),
- mTitle( NULL ),
- mAlbum( NULL ),
- mArtist( NULL ),
+ mTitle( QString( "title" ) ),
+ mAlbum( QString( "album" ) ),
+ mArtist( QString( "artist" ) ),
mComposer( NULL),
mGenre( NULL ),
mYear( NULL ),
@@ -50,7 +50,7 @@
mThumbnailManager->setThumbnailSize( ThumbnailManager::ThumbnailMedium );
QObject::connect( mThumbnailManager, SIGNAL( thumbnailReady( QPixmap , void * , int , int ) ),
this, SLOT( thumbnailReady( QPixmap , void * , int , int ) ) );
-
+
TX_EXIT_ARGS("Stub")
}
@@ -122,67 +122,67 @@
QString MpSongData::year() const
{
- TX_ENTRY_ARGS("Stub")
+ TX_ENTRY_ARGS("Stub")
return mYear;
}
QString MpSongData::fileName() const
{
- TX_LOG
+ TX_LOG
return mFileName;
}
QString MpSongData::mimeType() const
{
- TX_LOG
- return mMimeType;
+ TX_LOG
+ return mMimeType;
}
QString MpSongData::duration() const
{
- TX_LOG
- return mDuration;
+ TX_LOG
+ return mDuration;
}
QString MpSongData::bitRate() const
{
- TX_LOG
- return mBitRate;
+ TX_LOG
+ return mBitRate;
}
QString MpSongData::sampleRate() const
{
- TX_LOG
- return mSampleRate;
+ TX_LOG
+ return mSampleRate;
}
QString MpSongData::size() const
{
- TX_LOG
- return mSize;
+ TX_LOG
+ return mSize;
}
QString MpSongData::modified() const
{
- TX_LOG
- return mModified;
+ TX_LOG
+ return mModified;
}
QString MpSongData::copyright() const
{
- TX_LOG
- return mCopyright;
+ TX_LOG
+ return mCopyright;
}
QString MpSongData::musicURL() const
{
- TX_LOG
- return mMusicURL;
+ TX_LOG
+ return mMusicURL;
}
bool MpSongData::isDrmProtected() const
{
- TX_LOG
+ TX_LOG
return mDrmProtected;
}
bool MpSongData::setTitle( const QString &title )
@@ -325,7 +325,7 @@
}
bool MpSongData::setMimeType( const QString &mimeType )
-{
+{
TX_ENTRY_ARGS( "Mime =" << mimeType )
bool change = false;
if ( mimeType != mMimeType ) {
@@ -333,11 +333,11 @@
mMimeType = mimeType;
}
TX_EXIT
- return change;
+ return change;
}
bool MpSongData::setDuration( int duration )
-{
+{
TX_ENTRY_ARGS( "Duration =" << duration )
bool change = false;
QString timeFormatOne("%1:%2:%3");
@@ -350,23 +350,23 @@
int hour = duration / 3600;
int min = duration % 3600 / 60;
int sec = duration % 3600 % 60;
-
+
hourStr = hour >= 10 ? QString::number( hour ) : QString::number( hour ).prepend( "0" );
minStr = min >= 10 ? QString::number( min ) : QString::number( min ).prepend( "0" );
- secStr = sec >= 10 ? QString::number( sec ) : QString::number( sec ).prepend( "0" );
+ secStr = sec >= 10 ? QString::number( sec ) : QString::number( sec ).prepend( "0" );
mDuration = timeFormatOne.arg( hourStr ).arg( minStr ).arg( secStr );
} else if ( duration >= 60 && duration < 3600 ) {
// more than one min && less than one hour
QString minStr, secStr;
int min = duration / 60;
int sec = duration % 60;
-
+
minStr = min >= 10 ? QString::number( min ) : QString::number( min ).prepend( "0" );
- secStr = sec >= 10 ? QString::number( sec ) : QString::number( sec ).prepend( "0" );
+ secStr = sec >= 10 ? QString::number( sec ) : QString::number( sec ).prepend( "0" );
mDuration = timeFormatTwo.arg( minStr ).arg( secStr );
} else if ( duration > 0 && duration < 60 ) {
QString secStr;
- secStr = duration >= 10 ? QString::number( duration ) : QString::number( duration ).prepend( "0" );
+ secStr = duration >= 10 ? QString::number( duration ) : QString::number( duration ).prepend( "0" );
mDuration = secStr;
} else {
mDuration = QString();
@@ -409,7 +409,7 @@
}
bool MpSongData::setSize( int size )
-{
+{
TX_ENTRY_ARGS( "Size =" << size )
bool change = false;
if ( QString::number( size ) != mSize ) {
--- a/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailsview/stub/src/thumbnailmanager_qt.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailsview/stub/src/thumbnailmanager_qt.cpp Fri May 28 19:46:01 2010 -0500
@@ -17,7 +17,6 @@
#include <QSize>
#include "stub/inc/thumbnailmanager_qt.h"
#include "mptrace.h"
-#include "logger.h"
int gInitCounter = 0;
@@ -27,7 +26,7 @@
*/
int ThumbnailManager::getInitCounter()
{
- TRACE("ThumbnailManager::getInitCounter() STUB");
+ TX_LOG_ARGS("ThumbnailManager::getInitCounter() STUB");
return gInitCounter;
}
@@ -36,7 +35,7 @@
*/
void ThumbnailManager::resetInitCounter()
{
- TRACE("ThumbnailManager::resetInitCounter() STUB");
+ TX_LOG_ARGS("ThumbnailManager::resetInitCounter() STUB");
gInitCounter = 0;
}
@@ -46,19 +45,19 @@
mThumbnailReqCounter(0),
mCancelCounter(0)
{
- TX_ENTRY_ARGS("Stub")
+ TX_ENTRY_ARGS("Stub")
gInitCounter++;
}
ThumbnailManager::~ThumbnailManager()
{
- TX_ENTRY_ARGS("Stub")
+ TX_ENTRY_ARGS("Stub")
gInitCounter--;
}
bool ThumbnailManager::setMode( ThumbnailMode mode )
{
- TX_ENTRY_ARGS("Stub")
+ TX_ENTRY_ARGS("Stub")
Q_UNUSED(mode);
return true;
}
@@ -66,14 +65,14 @@
bool ThumbnailManager::setQualityPreference( QualityPreference
qualityPreference )
{
- TX_ENTRY_ARGS("Stub")
+ TX_ENTRY_ARGS("Stub")
Q_UNUSED(qualityPreference);
return true;
}
bool ThumbnailManager::setThumbnailSize( ThumbnailSize thumbnailSize )
{
- TX_ENTRY_ARGS("Stub")
+ TX_ENTRY_ARGS("Stub")
Q_UNUSED(thumbnailSize);
return true;
}
@@ -81,7 +80,7 @@
int ThumbnailManager::getThumbnail( const QString& fileName, void *clientData,
int priority )
{
- TX_ENTRY_ARGS("Stub")
+ TX_ENTRY_ARGS("Stub")
Q_UNUSED(fileName);
Q_UNUSED(priority);
@@ -103,7 +102,7 @@
bool ThumbnailManager::cancelRequest( int id )
{
- TX_ENTRY_ARGS("Stub")
+ TX_ENTRY_ARGS("Stub")
Q_UNUSED(id);
mCancelCounter++;
return true;
--- a/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailsview/unittest_mpdetailsview.pro Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailsview/unittest_mpdetailsview.pro Fri May 28 19:46:01 2010 -0500
@@ -11,7 +11,7 @@
#
# Contributors:
#
-# Description: Unit test for mpdetailsview
+# Description:
#
TEMPLATE = app
--- a/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailsviewplugin/UT_mpdetailsviewplugin.pkg Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailsviewplugin/UT_mpdetailsviewplugin.pkg Fri May 28 19:46:01 2010 -0500
@@ -17,7 +17,7 @@
&EN
; SIS header: name, uid, version
-#{"unittest_mpdetailsviewplugin"},(0xE003e880),1,0,0
+#{"unittest_mpdetailsviewplugin"},(0xE003e881),1,0,0
; Localised Vendor name
%{"Vendor"}
--- a/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailsviewplugin/sis.bat Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailsviewplugin/sis.bat Fri May 28 19:46:01 2010 -0500
@@ -14,7 +14,8 @@
@rem Description:
@rem
+@echo off
del *.sisx
makesis UT_mpdetailsviewplugin.pkg
-signsis UT_mpdetailsviewplugin.sis UT_mpdetailsviewplugin.sisx RNDCERTS_PATH\Nokia_RnDCert_02.der RNDCERTS_PATH\Nokia_RnDCert_02.key
+signsis UT_mpdetailsviewplugin.sis UT_mpdetailsviewplugin.sisx %RNDCERTS_PATH%\Nokia_RnDCert_02.der %RNDCERTS_PATH%\Nokia_RnDCert_02.key
del UT_mpdetailsviewplugin.sis
\ No newline at end of file
--- a/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailsviewplugin/src/unittest_mpdetailsviewplugin.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailsviewplugin/src/unittest_mpdetailsviewplugin.cpp Fri May 28 19:46:01 2010 -0500
@@ -39,14 +39,18 @@
HbMainWindow window;
TestMpDetailsViewPlugin tv;
- char *pass[3];
- pass[0] = argv[0];
- pass[1] = "-o";
- pass[2] = "c:\\data\\unittest_mpdetailsviewplugin.txt";
- int res = QTest::qExec( &tv, 3, pass );
+if ( argc > 1 ) {
+ return QTest::qExec( &tv, argc, argv);
+ }
+ else {
+ char *pass[3];
+ pass[0] = argv[0];
+ pass[1] = "-o";
+ pass[2] = "c:\\data\\unittest_mpdetailsviewplugin.txt";
- return res;
+ return QTest::qExec(&tv, 3, pass);
+ }
}
TestMpDetailsViewPlugin::TestMpDetailsViewPlugin()
@@ -71,6 +75,7 @@
*/
void TestMpDetailsViewPlugin::cleanupTestCase()
{
+QCoreApplication::processEvents();
}
/*!
--- a/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailsviewplugin/unittest_mpdetailsviewplugin.pro Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailsviewplugin/unittest_mpdetailsviewplugin.pro Fri May 28 19:46:01 2010 -0500
@@ -11,7 +11,7 @@
#
# Contributors:
#
-# Description: Unit test for mpdetailsviewplugin
+# Description:
#
TEMPLATE = app
--- a/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpquerymanager/inc/unittest_mpquerymanager.h Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpquerymanager/inc/unittest_mpquerymanager.h Fri May 28 19:46:01 2010 -0500
@@ -52,9 +52,7 @@
void testrecommendationSongs();
void testrecommendationArtists();
void testrecommendationAlbumArtsLink();
- void testalbumArtsReadyCount();
-
-
+
private:
MpQueryManager *mTest;
--- a/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpquerymanager/sis.bat Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpquerymanager/sis.bat Fri May 28 19:46:01 2010 -0500
@@ -14,6 +14,7 @@
@rem Description:
@rem
+@echo off
del *.sisx
makesis UT_mpquerymanager.pkg
signsis UT_mpquerymanager.sis UT_mpquerymanager.sisx %RNDCERTS_PATH%\Nokia_RnDCert_02.der %RNDCERTS_PATH%\Nokia_RnDCert_02.key
--- a/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpquerymanager/src/unittest_mpquerymanager.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpquerymanager/src/unittest_mpquerymanager.cpp Fri May 28 19:46:01 2010 -0500
@@ -21,7 +21,7 @@
#include <QNetworkDiskCache>
#include <QNetworkProxyFactory>
#include <qmobilityglobal.h>
-#include <qnetworksession.h>
+#include <QNetworkSession>
#include <QDomElement>
#include <QList>
#include <QFile>
@@ -174,13 +174,3 @@
}
-void TestMpQueryManager::testalbumArtsReadyCount()
-{
- mTest->mAlbumArtsReadyCount = 2;
- TInt albumArtsReadyCount;
-
- albumArtsReadyCount=mTest->albumArtsReadyCount();
-
- QCOMPARE(albumArtsReadyCount,2);
-}
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpquerymanager/stub/inc/thumbnailmanager_qt.h Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,128 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: ThumbnailManager stub for testing MpSongData
+*
+*/
+
+#ifndef THUMBNAILMANAGER_QT_H_
+#define THUMBNAILMANAGER_QT_H_
+#include <QObject>
+#include <QPixmap>
+
+
+/** default priority value */
+const int tnmWrapperPriorityIdle = -100;
+
+class ThumbnailManager : public QObject
+ {
+ Q_OBJECT
+
+public:
+
+
+ /** Thumbnail size. */
+ enum ThumbnailSize
+ {
+ /**
+ * Small thumbnail
+ */
+ ThumbnailSmall = 0,
+ /**
+ * Medium thumbnail
+ */
+ ThumbnailMedium,
+ /**
+ * Large thumbnail
+ */
+ ThumbnailLarge
+ };
+
+ /** Mode of thumbnail creation. */
+ enum ThumbnailMode
+ {
+ /**
+ * Default mode. This means that:
+ * - Thumbnail must be as large as requested (unless the actual object is smaller).
+ * - Smaller thumbnails may be up scaled to desired resolution.
+ * - Aspect ratio is maintained and thumbnails are not cropped. The
+ * resulting thumbnail may smaller in either width or height if
+ * the aspect ratio of the object does not match the aspect ratio
+ * of the requested size.
+ */
+ Default = 0,
+
+ /**
+ * Allow thumbnails which are smaller than requested are. Thumbnail
+ * bitmaps are never up scaled if this flag is set.
+ */
+ AllowAnySize = 1,
+
+ /**
+ * New thumbnail images are not created if this flag is set. Only
+ * existing thumbnails may be returned. If a requested thumbnail does
+ * not exist null pixmap will be returned.
+ */
+ DoNotCreate = 2,
+
+ /**
+ * Thumbnail images are cropped to match requested aspect ratio. If
+ * this mode is set, the size of the resulting thumbnail always
+ * matches the requested size.
+ */
+ CropToAspectRatio = 4
+ };
+
+ /** Quality versus speed preference setting */
+ enum QualityPreference
+ {
+ /**
+ * Prefer thumbnails in the highest quality possible disregarding
+ * any negative impact on performance.
+ */
+ OptimizeForQuality,
+
+ /**
+ * Get thumbnails as fast as possible, even if
+ * it means lower quality.
+ */
+ OptimizeForPerformance
+ };
+
+ // Test utility functions
+ static int getInitCounter();
+ static void resetInitCounter();
+
+ // Stub functions
+ ThumbnailManager( QObject* parentPtr = NULL );
+ virtual ~ThumbnailManager();
+ bool setMode( ThumbnailMode mode );
+ bool setQualityPreference( QualityPreference qualityPreference );
+ bool setThumbnailSize( ThumbnailSize thumbnailSize );
+ int getThumbnail( const QString& fileName, void * clientData = NULL,
+ int priority = tnmWrapperPriorityIdle );
+ bool cancelRequest( int id );
+
+signals:
+
+ void thumbnailReady( QPixmap , void * , int , int );
+
+public:
+
+ bool mGetThumbFails;
+ int mThumbnailReqCounter;
+ int mCancelCounter;
+
+};
+
+#endif /* THUMBNAILMANAGER_QT_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpquerymanager/stub/src/thumbnailmanager_qt.cpp Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,109 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: ThumbnailManager stub for testing MpSongData
+*
+*/
+#include <QSize>
+#include "stub/inc/thumbnailmanager_qt.h"
+#include "mptrace.h"
+
+int gInitCounter = 0;
+
+/*!
+ Returns gInitCounter.
+ gInitCounter counts the number of constructor/destructor calls.
+ */
+int ThumbnailManager::getInitCounter()
+{
+ TX_LOG_ARGS("ThumbnailManager::getInitCounter() STUB");
+ return gInitCounter;
+}
+
+/*!
+ Resets gInitCounter to zero.
+ */
+void ThumbnailManager::resetInitCounter()
+{
+ TX_LOG_ARGS("ThumbnailManager::resetInitCounter() STUB");
+ gInitCounter = 0;
+}
+
+ThumbnailManager::ThumbnailManager( QObject* parentPtr ) :
+QObject( parentPtr ),
+mGetThumbFails(false),
+mThumbnailReqCounter(0),
+mCancelCounter(0)
+{
+ TX_ENTRY_ARGS("Stub")
+ gInitCounter++;
+}
+
+ThumbnailManager::~ThumbnailManager()
+{
+ TX_ENTRY_ARGS("Stub")
+ gInitCounter--;
+}
+
+bool ThumbnailManager::setMode( ThumbnailMode mode )
+{
+ TX_ENTRY_ARGS("Stub")
+ Q_UNUSED(mode);
+ return true;
+}
+
+bool ThumbnailManager::setQualityPreference( QualityPreference
+ qualityPreference )
+{
+ TX_ENTRY_ARGS("Stub")
+ Q_UNUSED(qualityPreference);
+ return true;
+}
+
+bool ThumbnailManager::setThumbnailSize( ThumbnailSize thumbnailSize )
+{
+ TX_ENTRY_ARGS("Stub")
+ Q_UNUSED(thumbnailSize);
+ return true;
+}
+
+int ThumbnailManager::getThumbnail( const QString& fileName, void *clientData,
+ int priority )
+{
+ TX_ENTRY_ARGS("Stub")
+ Q_UNUSED(fileName);
+ Q_UNUSED(priority);
+
+ if (clientData) {
+ // Delete this to prevent memory leak
+ int *data = (int *)clientData;
+ delete data;
+
+ data = 0;
+ }
+
+ if ( mGetThumbFails ) {
+ return -1;
+ }
+
+ mThumbnailReqCounter++;
+ return mThumbnailReqCounter;
+}
+
+bool ThumbnailManager::cancelRequest( int id )
+{
+ TX_ENTRY_ARGS("Stub")
+ Q_UNUSED(id);
+ mCancelCounter++;
+ return true;
+}
--- a/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpquerymanager/unittest_mpquerymanager.pro Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpquerymanager/unittest_mpquerymanager.pro Fri May 28 19:46:01 2010 -0500
@@ -11,7 +11,7 @@
#
# Contributors:
#
-# Description: Unit test for mpquerymanager
+# Description:
#
TEMPLATE = app
@@ -35,10 +35,12 @@
# Input
HEADERS += inc/unittest_mpquerymanager.h \
- ../../inc/mpquerymanager.h
+ ../../inc/mpquerymanager.h \
+ stub/inc/thumbnailmanager_qt.h
SOURCES += src/unittest_mpquerymanager.cpp \
- ../../src/mpquerymanager.cpp
+ ../../src/mpquerymanager.cpp \
+ stub/src/thumbnailmanager_qt.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpsharedata/UT_mpsharedata.pkg Fri May 28 19:46:01 2010 -0500
@@ -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:
+;
+; Language
+&EN
+
+; SIS header: name, uid, version
+#{"unittest_mpsharedata"},(0xE5d27be8),1,0,0
+
+; Localised Vendor name
+%{"Vendor"}
+
+; Unique Vendor name
+:"Vendor"
+
+
+; Manual PKG pre-rules from PRO files
+; Default HW/platform dependencies
+; [0x101F7961],0,0,0,{"S60ProductID"}
+; [0x102032BE],0,0,0,{"S60ProductID"}
+; [0x102752AE],0,0,0,{"S60ProductID"}
+; [0x1028315F],0,0,0,{"S60ProductID"}
+
+; Default dependency to Qt libraries
+; (0x2001E61C), 4, 6, 3, {"Qt"}
+
+; Executable and default resource files
+"/epoc32/release/armv5/udeb/unittest_mpsharedata.exe" - "!:\sys\bin\unittest_mpsharedata.exe"
+"/epoc32/data/z/resource/apps/unittest_mpsharedata.rsc" - "!:\resource\apps\unittest_mpsharedata.rsc"
+"/epoc32/data/z/private/10003a3f/import/apps/unittest_mpsharedata_reg.rsc" - "!:\private\10003a3f\import\apps\unittest_mpsharedata_reg.rsc"
+
+; Manual PKG post-rules from PRO files
--- a/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpsharedata/inc/unittest_mpsharedata.h Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpsharedata/inc/unittest_mpsharedata.h Fri May 28 19:46:01 2010 -0500
@@ -53,7 +53,7 @@
void testObjectContentWithArtistOnly();
void testObjectContentWithoutMetaInfo();
void testSongTitle();
- void testSongAlbum();
+// void testSongAlbum();
void testSongArtist();
void testAlbumArt();
void testLanguage();
--- a/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpsharedata/sis.bat Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpsharedata/sis.bat Fri May 28 19:46:01 2010 -0500
@@ -14,7 +14,8 @@
@rem Description:
@rem
+@echo off
del *.sisx
-makesis unittest_mpsharedata.pkg
-signsis unittest_mpsharedata.sis unittest_mpsharedata.sisx RNDCERTS_PATH\Nokia_RnDCert_02.der RNDCERTS_PATH\RndCerts\Nokia_RnDCert_02.key
-del unittest_mpsharedata.sis
\ No newline at end of file
+makesis UT_mpsharedata.pkg
+signsis UT_mpsharedata.sis UT_mpsharedata.sisx %RNDCERTS_PATH%\Nokia_RnDCert_02.der %RNDCERTS_PATH%\Nokia_RnDCert_02.key
+del UT_mpsharedata.sis
\ No newline at end of file
--- a/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpsharedata/src/unittest_mpsharedata.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpsharedata/src/unittest_mpsharedata.cpp Fri May 28 19:46:01 2010 -0500
@@ -40,14 +40,17 @@
TestMpShareData tv;
- char *pass[3];
- pass[0] = argv[0];
- pass[1] = "-o";
- pass[2] = "c:\\data\\unittest_testmpsharedata.txt";
+if ( argc > 1 ) {
+ return QTest::qExec( &tv, argc, argv);
+ }
+ else {
+ char *pass[3];
+ pass[0] = argv[0];
+ pass[1] = "-o";
+ pass[2] = "c:\\data\\unittest_mpsharedata.txt";
- int res = QTest::qExec(&tv, 3, pass);
-
- return res;
+ return QTest::qExec(&tv, 3, pass);
+ }
}
#endif
@@ -81,6 +84,7 @@
void TestMpShareData::cleanupTestCase()
{
qDebug() << "unit test for mpsharedata end.";
+ QCoreApplication::processEvents();
}
/*!
@@ -89,6 +93,7 @@
void TestMpShareData::init()
{
mTest = new MpShareData();
+ mTest->setUnknownTr("Unknown");
}
/*!
@@ -187,8 +192,8 @@
song->setAlbum("TestAlbum");
song->setAlbumArtUri("http://www.nokia.com/notexist.png");
mTest->setSongData(song);
- QCOMPARE(mTest->objectContent(), QString("TestTitle http://music.ovi.com"));
- QCOMPARE(mTest->objectReservedLength(), QString("TestTitle http://music.ovi.com").length());
+ QCOMPARE(mTest->objectContent(), QString("♫ Unknown: TestTitle http://music.ovi.com"));
+ QCOMPARE(mTest->objectReservedLength(), QString("♫ Unknown: TestTitle http://music.ovi.com").length());
delete song;
}
@@ -200,8 +205,8 @@
song->setAlbum("TestAlbum");
song->setAlbumArtUri("http://www.nokia.com/notexist.png");
mTest->setSongData(song);
- QCOMPARE(mTest->objectContent(), QString("TestArtist http://music.ovi.com"));
- QCOMPARE(mTest->objectReservedLength(), QString("TestArtist http://music.ovi.com").length());
+ QCOMPARE(mTest->objectContent(), QString("♫ TestArtist: Unknown http://music.ovi.com"));
+ QCOMPARE(mTest->objectReservedLength(), QString("♫ TestArtist: Unknown http://music.ovi.com").length());
delete song;
}
@@ -210,8 +215,8 @@
{
MpSongData *song = new MpSongData();
mTest->setSongData(song);
- QCOMPARE(mTest->objectContent(), QString("http://music.ovi.com"));
- QCOMPARE(mTest->objectReservedLength(), QString("http://music.ovi.com").length());
+ QCOMPARE(mTest->objectContent(), QString("♫ Unknown: Unknown http://music.ovi.com"));
+ QCOMPARE(mTest->objectReservedLength(), QString("♫ Unknown: Unknown http://music.ovi.com").length());
delete song;
}
@@ -224,14 +229,14 @@
delete song;
}
-void TestMpShareData::testSongAlbum()
-{
- MpSongData *song = new MpSongData();
- song->setAlbum("TestAlbum");
- mTest->setSongData(song);
- QCOMPARE(mTest->album(), QString("TestAlbum"));
- delete song;
-}
+//void TestMpShareData::testSongAlbum()
+//{
+// MpSongData *song = new MpSongData();
+// song->setAlbum("TestAlbum");
+// mTest->setSongData(song);
+// QCOMPARE(mTest->album(), QString("TestAlbum"));
+// delete song;
+//}
void TestMpShareData::testSongArtist()
{
@@ -327,11 +332,11 @@
void TestMpShareData::testSongNoInfo()
{
- QCOMPARE(mTest->title(), QString(""));
- QCOMPARE(mTest->album(), QString(""));
- QCOMPARE(mTest->artist(), QString(""));
+ QCOMPARE(mTest->title(), QString("Unknown"));
+// QCOMPARE(mTest->album(), QString(""));
+ QCOMPARE(mTest->artist(), QString("Unknown"));
QCOMPARE(mTest->albumArtBase64(), QString(""));
- QCOMPARE(mTest->objectContent(), QString("http://music.ovi.com"));
+ QCOMPARE(mTest->objectContent(), QString("♫ Unknown: Unknown http://music.ovi.com"));
// QCOMPARE(mTest->comment(), QString(""));
// QCOMPARE(mTest->year(), QString(""));
// QCOMPARE(mTest->genre(), QString(""));
--- a/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpsharedata/stub/src/mpsongdata.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpsharedata/stub/src/mpsongdata.cpp Fri May 28 19:46:01 2010 -0500
@@ -31,7 +31,7 @@
Song data provide acces to current playing song metadata
*/
-
+
/*!
\fn void albumArtReady()
@@ -43,14 +43,14 @@
This signal is emitted when basic information is available
*/
-
+
/*!
\fn void songDetailInfoChanged()
This signal is emitted when detail information is available
*/
-
-
+
+
/*!
Constructs a new MpSongData.
@@ -184,7 +184,7 @@
*/
QString MpSongData::year() const
{
- //TX_LOG
+ //TX_LOG
return mYear;
}
--- a/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpsharedata/unittest_mpsharedata.pkg Fri May 14 18:54:37 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-;
-; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-; All rights reserved.
-; This component and the accompanying materials are made available
-; under the terms of "Eclipse Public License v1.0"
-; which accompanies this distribution, and is available
-; at the URL "http://www.eclipse.org/legal/epl-v10.html".
-;
-; Initial Contributors:
-; Nokia Corporation - initial contribution.
-;
-; Contributors:
-;
-; Description:
-;
-; Language
-&EN
-
-; SIS header: name, uid, version
-#{"unittest_mpsharedata"},(0xE5d27be8),1,0,0
-
-; Localised Vendor name
-%{"Vendor"}
-
-; Unique Vendor name
-:"Vendor"
-
-
-; Manual PKG pre-rules from PRO files
-; Default HW/platform dependencies
-; [0x101F7961],0,0,0,{"S60ProductID"}
-; [0x102032BE],0,0,0,{"S60ProductID"}
-; [0x102752AE],0,0,0,{"S60ProductID"}
-; [0x1028315F],0,0,0,{"S60ProductID"}
-
-; Default dependency to Qt libraries
-; (0x2001E61C), 4, 6, 3, {"Qt"}
-
-; Executable and default resource files
-"/epoc32/release/armv5/udeb/unittest_mpsharedata.exe" - "!:\sys\bin\unittest_mpsharedata.exe"
-"/epoc32/data/z/resource/apps/unittest_mpsharedata.rsc" - "!:\resource\apps\unittest_mpsharedata.rsc"
-"/epoc32/data/z/private/10003a3f/import/apps/unittest_mpsharedata_reg.rsc" - "!:\private\10003a3f\import\apps\unittest_mpsharedata_reg.rsc"
-
-; Manual PKG post-rules from PRO files
--- a/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpsharedata/unittest_mpsharedata.pro Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpsharedata/unittest_mpsharedata.pro Fri May 28 19:46:01 2010 -0500
@@ -11,9 +11,8 @@
#
# Contributors:
#
-# Description: Unit test for mpsharedata
+# Description:
#
-
TEMPLATE = app
CONFIG += qtestlib \
symbian_test \
--- a/mpviewplugins/mpmediawallviewplugin/src/mpmediawallview.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpmediawallviewplugin/src/mpmediawallview.cpp Fri May 28 19:46:01 2010 -0500
@@ -166,7 +166,7 @@
mAlbumCover->hide();
mTrackList = new MpTrackListWidget( this );
- mTrackList->list()->setModel( new MpCollectionTBoneListDataModel(mCollectionData, mTrackList ) );
+ mTrackList->list()->setModel( new MpCollectionTBoneListDataModel(mCollectionData, mPlaybackData, mTrackList ) );
mTrackList->hide();
connect(mAlbumCover,SIGNAL(clicked()),this, SLOT(hideTracksList()));
--- a/mpviewplugins/mpplaybackviewplugin/inc/mpequalizerwidget.h Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpplaybackviewplugin/inc/mpequalizerwidget.h Fri May 28 19:46:01 2010 -0500
@@ -45,7 +45,7 @@
void okSelected(bool checked);
private: // functions
- QString getLogicalName( QString name );
+ QString getLocalizedString( QString name );
private:
--- a/mpviewplugins/mpplaybackviewplugin/mpplaybackviewplugin.pro Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpplaybackviewplugin/mpplaybackviewplugin.pro Fri May 28 19:46:01 2010 -0500
@@ -40,14 +40,7 @@
-lmpengine \
-lmpdata.dll
-symbian:
-{
-TARGET.EPOCALLOWDLLDATA = 1
-
-BLD_INF_RULES.prj_exports += \
- "resources/nullsound.mp3 /epoc32/release/winscw/udeb/Z/nullsound.mp3" \
- "resources/nullsound.mp3 /epoc32/data/Z/system/data/nullsound.mp3"
-}
+symbian:TARGET.EPOCALLOWDLLDATA = 1
HEADERS = ../../inc/mpviewbase.h \
inc/mpplaybackviewplugin.h \
Binary file mpviewplugins/mpplaybackviewplugin/resources/nullsound.mp3 has changed
--- a/mpviewplugins/mpplaybackviewplugin/rom/mpplaybackviewplugin.iby Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpplaybackviewplugin/rom/mpplaybackviewplugin.iby Fri May 28 19:46:01 2010 -0500
@@ -22,6 +22,4 @@
ECOM_PLUGIN( mpplaybackviewplugin.dll, mpplaybackviewplugin.rsc )
-data=ZSYSTEM\data\nullsound.mp3 nullsound.mp3
-
#endif //MPPLAYBACKVIEWPLUGIN_IBY
--- a/mpviewplugins/mpplaybackviewplugin/src/mpequalizerwidget.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpplaybackviewplugin/src/mpequalizerwidget.cpp Fri May 28 19:46:01 2010 -0500
@@ -86,10 +86,15 @@
QStringList listItems;
QStringList presetNames = mMpEngine->presetNames();
for ( int i=0; i<presetNames.count(); i++ ) {
- QString name = getLogicalName( presetNames.at(i) );
+ QString name = getLocalizedString( presetNames.at(i) );
if ( name.size() > 0 ) {
listItems.append( name );
}
+ else {
+ // Localized string not found, append original name.
+ TX_LOG_ARGS( "Localized string not found = " << name);
+ listItems.append( presetNames.at(i) );
+ }
}
listItems.prepend(hbTrId("txt_mus_list_off"));
TX_LOG_ARGS( "PresetNames=" << listItems);
@@ -181,31 +186,31 @@
}
/*!
- Return the logical name base on preset name. Used for localization.
+ Return the localized string base on preset name.
*/
-QString MpEqualizerWidget::getLogicalName( QString name )
+QString MpEqualizerWidget::getLocalizedString( QString name )
{
TX_ENTRY_ARGS( "Name = " << name );
- QString logicalName;
+ QString localizedString;
if ( name == "Bass Booster" ) {
- logicalName = hbTrId( "txt_mus_list_bass_booster" );
+ localizedString = hbTrId( "txt_mus_list_bass_booster" );
}
else if ( name == "Classic" ) {
- logicalName = hbTrId( "txt_mus_list_classical" );
+ localizedString = hbTrId( "txt_mus_list_classical" );
}
else if ( name == "Pop" ) {
- logicalName = hbTrId( "txt_mus_list_pop" );
+ localizedString = hbTrId( "txt_mus_list_pop" );
}
else if ( name == "Jazz" ) {
- logicalName = hbTrId( "txt_mus_list_jazz" );
+ localizedString = hbTrId( "txt_mus_list_jazz" );
}
else if ( name == "Rock" ) {
- logicalName = hbTrId( "txt_mus_list_rock" );
+ localizedString = hbTrId( "txt_mus_list_rock" );
}
- TX_EXIT_ARGS( "Logical String = " << logicalName );
- return logicalName;
+ TX_EXIT_ARGS( "Logical String = " << localizedString );
+ return localizedString;
}
//End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mpviewplugins/mpplaybackviewplugin/tsrc/tsrc.pro Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,21 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies 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 = subdirs
+
+SUBDIRS = unittest_mpequalizerwidget \
+ unittest_mpplaybackviewplugin
+
--- a/mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpequalizerwidget/inc/unittest_mpequalizerwidget.h Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpequalizerwidget/inc/unittest_mpequalizerwidget.h Fri May 28 19:46:01 2010 -0500
@@ -46,7 +46,7 @@
void testPresetSelected();
void testCancelSelected();
void testOkSelected();
- void testGetLogicalName();
+ void testGetLocalizedString();
private:
--- a/mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpequalizerwidget/src/unittest_mpequalizerwidget.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpequalizerwidget/src/unittest_mpequalizerwidget.cpp Fri May 28 19:46:01 2010 -0500
@@ -131,6 +131,13 @@
QVERIFY(mTest->mPresetsList != 0);
QCOMPARE(qobject_cast<HbRadioButtonList*>(mTest->contentWidget()), mTest->mPresetsList);
QVERIFY(mTest->mPresetsList->selected() == 0);
+ QCOMPARE(mTest->mPresetsList->items().at(0), hbTrId("txt_mus_list_off"));
+ QCOMPARE(mTest->mPresetsList->items().at(1), hbTrId("txt_mus_list_bass_booster"));
+ QCOMPARE(mTest->mPresetsList->items().at(2), hbTrId("txt_mus_list_classical"));
+ QCOMPARE(mTest->mPresetsList->items().at(3), hbTrId("txt_mus_list_jazz"));
+ QCOMPARE(mTest->mPresetsList->items().at(4), hbTrId("txt_mus_list_pop"));
+ QCOMPARE(mTest->mPresetsList->items().at(5), hbTrId("txt_mus_list_rock"));
+ QCOMPARE(mTest->mPresetsList->items().at(6), QString("New Preset"));
}
/*!
@@ -193,29 +200,33 @@
/*!
Tests getLogicalName.
*/
-void TestMpEqualizerWidget::testGetLogicalName()
+void TestMpEqualizerWidget::testGetLocalizedString()
{
- QString logicalName;
+ QString localizedString;
// test Bass Booster
- logicalName = mTest->getLogicalName( QString("Bass Booster") );
- QCOMPARE(logicalName, hbTrId("txt_mus_list_bass_booster"));
+ localizedString = mTest->getLocalizedString( QString("Bass Booster") );
+ QCOMPARE(localizedString, hbTrId("txt_mus_list_bass_booster"));
// test Classic
- logicalName = mTest->getLogicalName( QString("Classic") );
- QCOMPARE(logicalName, hbTrId("txt_mus_list_classical"));
+ localizedString = mTest->getLocalizedString( QString("Classic") );
+ QCOMPARE(localizedString, hbTrId("txt_mus_list_classical"));
+
+ // test Jazz
+ localizedString = mTest->getLocalizedString( QString("Jazz") );
+ QCOMPARE(localizedString, hbTrId("txt_mus_list_jazz"));
// test Pop
- logicalName = mTest->getLogicalName( QString("Pop") );
- QCOMPARE(logicalName, hbTrId("txt_mus_list_pop"));
-
- // test Jazz
- logicalName = mTest->getLogicalName( QString("Jazz") );
- QCOMPARE(logicalName, hbTrId("txt_mus_list_jazz"));
+ localizedString = mTest->getLocalizedString( QString("Pop") );
+ QCOMPARE(localizedString, hbTrId("txt_mus_list_pop"));
// test Rock
- logicalName = mTest->getLogicalName( QString("Rock") );
- QCOMPARE(logicalName, hbTrId("txt_mus_list_rock"));
+ localizedString = mTest->getLocalizedString( QString("Rock") );
+ QCOMPARE(localizedString, hbTrId("txt_mus_list_rock"));
+
+ // test new preset
+ localizedString = mTest->getLocalizedString( QString("New Preset") );
+ QVERIFY(localizedString.isEmpty());
}
// End of file
--- a/mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpequalizerwidget/stub/src/mpengine.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpequalizerwidget/stub/src/mpengine.cpp Fri May 28 19:46:01 2010 -0500
@@ -73,6 +73,6 @@
QStringList MpEngine::presetNames()
{
QStringList presets;
- presets << "Bass Booster" << "Classic" << "Jazz" << "Pop" << "Rock" ;
+ presets << "Bass Booster" << "Classic" << "Jazz" << "Pop" << "Rock" << "New Preset";
return presets;
}
--- a/mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpplaybackviewplugin/src/unittest_mpplaybackviewplugin.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpplaybackviewplugin/src/unittest_mpplaybackviewplugin.cpp Fri May 28 19:46:01 2010 -0500
@@ -18,8 +18,9 @@
#include <QSignalSpy>
#include <qnamespace.h>
+#include "stub/inc/mpplaybackview.h"
+#include "stub/inc/xqplugin.h"
#include "unittest_mpplaybackviewplugin.h"
-#include "stub/inc/mpplaybackview.h"
// Do this so we can access all member variables.
@@ -27,6 +28,9 @@
#include "mpplaybackviewplugin.h"
#undef private
+//This so mpplaybackviewplugin.cpp can load qt stub items
+#include "../../src/mpplaybackviewplugin.cpp"
+
/*!
Make our test case a stand-alone executable that runs all the test functions.
*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpplaybackviewplugin/stub/inc/xqplugin.h Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 testing MpSettingsViewPlugin
+*
+*/
+
+#ifndef XQPLUGIN_H
+#define XQPLUGIN_H
+
+// convenience macro
+#define XQ_EXPORT_PLUGIN(PLUGIN, PLUGINCLASS)
+
+#define XQ_EXPORT_PLUGIN2(PLUGIN, PLUGINCLASS)
+
+#endif // XQ_PLUGIN_H
--- a/mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpplaybackviewplugin/unittest_mpplaybackviewplugin.pro Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpplaybackviewplugin/unittest_mpplaybackviewplugin.pro Fri May 28 19:46:01 2010 -0500
@@ -15,7 +15,7 @@
#
TEMPLATE = app
-CONFIG += qtestlib hb
+CONFIG += qtestlib
CONFIG += symbian_test
TARGET = unittest_mpplaybackviewplugin
TARGET.CAPABILITY = CAP_APPLICATION
@@ -29,10 +29,10 @@
LIBS += -lmpxviewframeworkqt.dll
HEADERS += inc/unittest_mpplaybackviewplugin.h \
- ../../inc/mpplaybackviewplugin.h \
- stub/inc/mpplaybackview.h
+ stub/inc/mpplaybackview.h \
+ stub/inc/xqplugin.h \
+ ../../inc/mpplaybackviewplugin.h
SOURCES += src/unittest_mpplaybackviewplugin.cpp \
- ../../src/mpplaybackviewplugin.cpp \
stub/src/mpplaybackview.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mpviewplugins/mpsettingsviewplugin/tsrc/tsrc.pro Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,20 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies 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 = subdirs
+
+SUBDIRS = unittest_mpsettingsviewplugin
+
--- a/mpviewplugins/mpsettingsviewplugin/tsrc/unittest_mpsettingsviewplugin/src/unittest_mpsettingsviewplugin.cpp Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpsettingsviewplugin/tsrc/unittest_mpsettingsviewplugin/src/unittest_mpsettingsviewplugin.cpp Fri May 28 19:46:01 2010 -0500
@@ -18,8 +18,9 @@
#include <QSignalSpy>
#include <qnamespace.h>
+#include "stub/inc/mpsettingsview.h"
+#include "stub/inc/xqplugin.h"
#include "unittest_mpsettingsviewplugin.h"
-#include "stub/inc/mpsettingsview.h"
// Do this so we can access all member variables.
@@ -27,6 +28,9 @@
#include "mpsettingsviewplugin.h"
#undef private
+//This so we mpsettingsviewplugin.cpp can load qt stub items
+#include "../../src/mpsettingsviewplugin.cpp"
+
/*!
Make our test case a stand-alone executable that runs all the test functions.
*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mpviewplugins/mpsettingsviewplugin/tsrc/unittest_mpsettingsviewplugin/stub/inc/xqplugin.h Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 testing MpSettingsViewPlugin
+*
+*/
+
+#ifndef XQPLUGIN_H
+#define XQPLUGIN_H
+
+// convenience macro
+#define XQ_EXPORT_PLUGIN(PLUGIN, PLUGINCLASS)
+
+#define XQ_EXPORT_PLUGIN2(PLUGIN, PLUGINCLASS)
+
+#endif // XQ_PLUGIN_H
--- a/mpviewplugins/mpsettingsviewplugin/tsrc/unittest_mpsettingsviewplugin/unittest_mpsettingsviewplugin.pro Fri May 14 18:54:37 2010 -0500
+++ b/mpviewplugins/mpsettingsviewplugin/tsrc/unittest_mpsettingsviewplugin/unittest_mpsettingsviewplugin.pro Fri May 28 19:46:01 2010 -0500
@@ -30,10 +30,10 @@
LIBS += -lmpxviewframeworkqt.dll
HEADERS += inc/unittest_mpsettingsviewplugin.h \
- ../../inc/mpsettingsviewplugin.h \
- stub/inc/mpsettingsview.h
-
-SOURCES += stub/src/mpsettingsview.cpp \
- ../../src/mpsettingsviewplugin.cpp \
- src/unittest_mpsettingsviewplugin.cpp
+ stub/inc/mpsettingsview.h \
+ stub/inc/xqplugin.h \
+ ../../inc/mpsettingsviewplugin.h
+SOURCES += src/unittest_mpsettingsviewplugin.cpp \
+ stub/src/mpsettingsview.cpp
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/musicwidgetplugin/inc/musicwidget.h Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,199 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Music player home screen widget
+*
+*/
+
+#ifndef MUSICWIDGET_H
+#define MUSICWIDGET_H
+
+// System includes
+#include <QGraphicsLinearLayout>
+#include <QGraphicsGridLayout>
+#include <hbwidget.h>
+#include <xqappmgr.h>
+
+#include "mpplaybackdata.h"
+
+// Forward declarations
+class HbLabel;
+class HbPushButton;
+class HbIcon;
+class HbMarqueeItem;
+class MpEngine;
+//class MpPlaybackData;
+
+/**
+ * Media key identifier for push button events
+ */
+enum MediaKeyIdentifier{
+ EPrevious = 1,
+ EPlayPause,
+ ENext
+};
+
+/**
+ * Music Player launch source identifier
+ */
+enum LaunchIdentifier{
+ ELaunchFromPlay,
+ ELaunchFromShortcut
+};
+
+class MusicWidget: public HbWidget
+{
+ Q_OBJECT
+
+public:
+ MusicWidget(QGraphicsItem *parent = 0, Qt::WindowFlags flags = 0);
+ ~MusicWidget();
+
+private:
+
+ /**
+ * Setup graphics
+ */
+ void setupUi();
+
+ /**
+ * Get latest song data, player state and album art
+ */
+ void refreshData();
+
+ /**
+ * Launch Music Player to view
+ */
+ void launchMusicPlayer(int launchMode = ELaunchFromShortcut);
+
+ /**
+ * Similar to public slots mediaButtonPressed and mediaButtonReleased, but this oen is called internally
+ * Draws the spesified button to disabled state
+ */
+ void mediaButtonDisabled( int aMediaKeyId );
+
+ /**
+ * Similar to public slots mediaButtonPressed and mediaButtonReleased, but this oen is called internally
+ * Draws the spesified button to enabled state
+ */
+ void mediaButtonEnabled( int aMediaKeyId );
+
+ /**
+ * Disable/enable widget buttons according to Music Player state
+ */
+ void toggleButtons();
+
+public:
+ QRectF boundingRect() const;
+ QPainterPath shape() const;
+
+public slots:
+
+ /**
+ * Widget slots
+ */
+ void onInitialize();
+ void onShow();
+ void onHide();
+ void onUninitialize();
+
+ /**
+ * MpEngine slots
+ */
+ void libraryAboutToUpdate();
+ void libraryUpdated();
+ void usbBlocked( bool blocked );
+
+ /**
+ * MpPlaybackData slots
+ */
+ void albumArtReady();
+ void playbackStateChanged();
+ void playbackInfoChanged();
+
+ /**
+ * ?????
+ */
+ bool eventFilter(QObject *target, QEvent *event);
+
+ /**
+ * Button specific slots
+ */
+ void mediaButtonPressed( int aMediaKeyId );
+ void mediaButtonReleased( int aMediaKeyId );
+
+protected:
+
+ /**
+ * Called from mediaButtonPressed and from mediaButtonReleased slots.
+ * Calls defineMediaButton to redraw the media button
+ */
+ void mediaButtonEvent( MediaKeyIdentifier aMediaKeyId, QString aGraphicsId, QString aIconColor );
+
+ /**
+ * Creates the aTarget push button based on params aGraphicsId and aSuffix.
+ * Used to change the look and feel of the button based to the aState
+ * param: aTarget is the push button to be changed, must not be Null
+ * param: aGraphicsId defines the button background graphics
+ * param: aSuffix filename suffix, see KPrevButPrefix for example from musicwidget.cpp
+ */
+ void defineMediaButton( HbPushButton& aTarget, QString aGraphicsId, QStringList aSuffix, QString aIconColor );
+
+private slots:
+
+ /**
+ * Slots to be called after button press
+ */
+ void prevSong();
+ void playSong();
+ void nextSong();
+ void shortcutButton();
+
+private:
+ // mShortcutButtonLayout items
+ HbPushButton *mShortcutArea;
+
+ //mSongDataLayout items
+ HbWidget *mSongDataBG;
+ HbLabel *mInformationSongName;
+ HbMarqueeItem *mMarqueeText;
+
+ // mControlButtonsLayout items
+ HbPushButton *mPreviousPushButton;
+ HbPushButton *mPlayPushButton;
+ HbPushButton *mNextPushButton;
+
+ // MusicPlayer related state identifiers
+ bool mMusicPlayerNoSongData;
+ bool mMusicPlayerUpdating;
+ bool mMusicPlayerBlocked;
+
+ // Album art for background
+ HbLabel *mAlbumArtLabel;
+ qreal mAlbumArtWidth;
+ qreal mAlbumArtHeight;
+
+ // Artist and song title identifiers
+ QString mArtist;
+ QString mTitle;
+
+ // Used to launch MusicPlayer
+ XQApplicationManager mApplicationManager;
+
+ // MusicPlayer control and state updates
+ MpEngine* mMpEngine;
+ MpPlaybackData* mMpPlaybackData;
+
+};
+
+#endif // MUSICWIDGET_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/musicwidgetplugin/inc/musicwidgetplugin.h Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Music player home screen widget
+*
+*/
+
+#ifndef MUSICWIDGETPLUGIN_H
+#define MUSICWIDGETPLUGIN_H
+
+#include <QObject>
+#include <qserviceplugininterface.h>
+
+QTM_USE_NAMESPACE
+class MusicWidgetPlugin : public QObject, public QServicePluginInterface
+{
+ Q_OBJECT
+ Q_INTERFACES(QtMobility::QServicePluginInterface)
+
+public:
+ QObject *createInstance(const QServiceInterfaceDescriptor &descriptor,
+ QServiceContext *context,
+ QAbstractSecuritySession *session);
+};
+
+#endif // MUSICWIDGETPLUGIN_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/musicwidgetplugin/musicwidgetplugin.pro Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,60 @@
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Music Player home screen widget
+#
+
+TEMPLATE = lib
+CONFIG += plugin mobility hb
+MOBILITY = serviceframework
+
+LIBS += -lhswidgetmodel
+LIBS += -lxqservice
+LIBS += -lxqserviceutil
+LIBS += -lmpengine
+LIBS += -lmpdata
+
+INCLUDEPATH += ./inc
+INCLUDEPATH += ../inc
+
+HEADERS += ./inc/*.h
+SOURCES += ./src/*.cpp
+
+
+RESOURCES = resource/musicwidgetui.qrc
+
+UID = 200286FA
+
+symbian:include(./rom/rom.pri)
+
+symbian: {
+
+ DESTDIR = $${PRIVATE}/private/20022F35/import/widgetregistry/$${UID}
+ INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+
+ TARGET.UID3 = 0x$${UID}
+ TARGET.EPOCALLOWDLLDATA=1
+ TARGET.CAPABILITY = ALL -TCB
+ #TRANSLATIONS += musicwidgetplugin.ts
+
+ plugins.path = $${DESTDIR}
+ plugins.sources = $${TARGET}.dll
+
+ widgetResources.path = $${DESTDIR}
+ widgetResources.sources += resource/$${TARGET}.xml
+ widgetResources.sources += resource/$${TARGET}.manifest
+ widgetResources.sources += resource/musicwidgeticon.png
+
+ DEPLOYMENT += plugins \
+ widgetResources
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/musicwidgetplugin/resource/music_widget.docml Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="0.9">
+ <widget name="containerWidget" type="HbWidget">
+ <widget name="shortcut_icon_background" type="HbLabel">
+ <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+ <enums name="aspectRatioMode" value="IgnoreAspectRatio"/>
+ <real name="z" value="3"/>
+ <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+ <sizehint height="12un" type="FIXED" width="12un"/>
+ </widget>
+ <widget name="shortcut_icon" type="HbPushButton">
+ <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+ <!-- <icon iconName="qtg_large_music_player" name="icon" width="11un" height="11un"/> -->
+ <enums name="aspectRatioMode" value="IgnoreAspectRatio"/>
+ <real name="z" value="4"/>
+ <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+ <sizehint height="11un" type="FIXED" width="11un"/>
+ </widget>
+ <widget name="widget_background_icon" type="HbLabel">
+ <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+ <enums name="aspectRatioMode" value="IgnoreAspectRatio"/>
+ <real name="z" value="1"/>
+ <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+ <sizehint height="29un" type="FIXED" width="29un"/>
+ </widget>
+ <widget name="album_art_image" type="HbLabel">
+ <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+ <enums name="aspectRatioMode" value="IgnoreAspectRatio"/>
+ <real name="z" value="2"/>
+ <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+ <sizehint height="27.5un" type="FIXED" width="27.5un"/>
+ </widget>
+ <widget name="text_bg" type="HbLabel">
+ <real name="z" value="4"/>
+ <sizehint height="4.5un" type="PREFERRED" width="27.5un"/>
+ </widget>
+ <widget name="scrolling_text" type="HbLabel">
+ <real name="z" value="5"/>
+ <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+ <sizehint height="var(hb-param-text-height-tiny)" type="PREFERRED" width="26un"/>
+ <string name="textColor" value="var(qtg_fr_multimedia_trans)"/>
+ <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-secondary)"/>
+ </widget>
+ <widget name="button_group_container" type="HbWidget">
+ <widget name="btn_previous" type="HbPushButton">
+ <icon iconName="qtg_mono_previous" name="icon"/>
+ <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
+ <sizehint height="8un" type="PREFERRED" width="11un"/>
+ <string name="text"/>
+ </widget>
+ <widget name="btn_play" type="HbPushButton">
+ <icon iconName="qtg_mono_play" name="icon"/>
+ <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
+ <sizehint height="8un" type="PREFERRED" width="11un"/>
+ <string name="text"/>
+ </widget>
+ <widget name="btn_next" type="HbPushButton">
+ <icon iconName="qtg_mono_next" name="icon"/>
+ <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
+ <sizehint height="8un" type="PREFERRED" width="11un"/>
+ <string name="text"/>
+ </widget>
+ <real name="z" value="5"/>
+ <sizehint height="8un" type="PREFERRED" width="33un"/>
+ <layout orientation="Horizontal" spacing="0un" type="linear">
+ <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+ <linearitem itemname="btn_previous" spacing="0un"/>
+ <linearitem itemname="btn_play" spacing="0un"/>
+ <linearitem itemname="btn_next" spacing="0un"/>
+ </layout>
+ </widget>
+ <real name="z" value="1"/>
+ <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
+ <sizehint height="38.25un" type="PREFERRED" width="33un"/>
+ <layout type="anchor">
+ <anchoritem dst="shortcut_icon_background" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+ <anchoritem dst="shortcut_icon" dstEdge="RIGHT" spacing="-0.5un" src="" srcEdge="RIGHT"/>
+ <anchoritem dst="shortcut_icon" dstEdge="TOP" spacing="0.5un" src="" srcEdge="TOP"/>
+ <anchoritem dst="widget_background_icon" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-right)" src="" srcEdge="RIGHT"/>
+ <anchoritem dst="widget_background_icon" dstEdge="TOP" spacing="var(hb-param-margin-gene-top)" src="" srcEdge="TOP"/>
+ <anchoritem dst="album_art_image" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-middle-horizontal)" src="widget_background_icon" srcEdge="RIGHT"/>
+ <anchoritem dst="album_art_image" dstEdge="TOP" spacing="var(hb-param-margin-gene-middle-vertical)" src="widget_background_icon" srcEdge="TOP"/>
+ <anchoritem dst="text_bg" dstEdge="RIGHT" spacing="0un" src="album_art_image" srcEdge="RIGHT"/>
+ <anchoritem dst="text_bg" dstEdge="BOTTOM" spacing="0un" src="album_art_image" srcEdge="BOTTOM"/>
+ <anchoritem dst="scrolling_text" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-middle-horizontal)" src="text_bg" srcEdge="RIGHT"/>
+ <anchoritem dst="scrolling_text" dstEdge="BOTTOM" spacing="-var(hb-param-margin-gene-middle-vertical)" src="text_bg" srcEdge="BOTTOM"/>
+ <anchoritem dst="button_group_container" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+ <anchoritem dst="button_group_container" dstEdge="TOP" spacing="0un" src="album_art_image" srcEdge="BOTTOM"/>
+ </layout>
+ </widget>
+ <metadata activeUIState="Common ui state" display="NHD portrait" unit="un">
+ <uistate name="Common ui state" sections="#common"/>
+ </metadata>
+</hbdocument>
Binary file musicwidgetplugin/resource/musicwidgeticon.png has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/musicwidgetplugin/resource/musicwidgetplugin.manifest Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<widgetprovider>
+ <widget library="musicwidgetplugin"
+ uri="musicwidgetplugin"
+ title="Music Widget"
+ iconuri="musicwidgeticon.png"
+ description="Music Player Homescreen Widget"/>
+</widgetprovider>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/musicwidgetplugin/resource/musicwidgetplugin.xml Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<service>
+ <name>musicwidgetplugin</name>
+ <filepath>musicwidgetplugin</filepath>
+ <description>Music Player Homescreen Widget</description>
+ <interface>
+ <name>com.nokia.symbian.IHomeScreenWidget</name>
+ <version>1.0</version>
+ <description>Music Player Homescreen Widget</description>
+ <capabilities></capabilities>
+ <customproperty key="iconuri">musicwidgeticon.png</customproperty>
+ <customproperty key="title">Music Widget</customproperty>
+ </interface>
+</service>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/musicwidgetplugin/resource/musicwidgetui.qrc Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,6 @@
+<RCC>
+ <qresource prefix="/gfx">
+ <file>music_widget.docml</file>
+ <file>musicwidgeticon.png</file>
+ </qresource>
+</RCC>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/musicwidgetplugin/rom/musicwidgetplugin.iby Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 MUSICWIDGETPLUGIN_IBY
+#define MUSICWIDGETPLUGIN_IBY
+
+file=ABI_DIR\BUILD_DIR\musicwidgetplugin.dll SHARED_LIB_DIR\musicwidgetplugin.dll
+data=ZPRIVATE\20022f35\import\widgetregistry\200286FA\musicwidgetplugin.qtplugin private\20022f35\import\widgetregistry\200286FA\musicwidgetplugin.qtplugin
+data=ZPRIVATE\20022f35\import\widgetregistry\200286FA\musicwidgetplugin.manifest private\20022f35\import\widgetregistry\200286FA\musicwidgetplugin.manifest
+data=ZPRIVATE\20022f35\import\widgetregistry\200286FA\musicwidgetplugin.xml private\20022f35\import\widgetregistry\200286FA\musicwidgetplugin.xml
+
+#endif // MUSICWIDGETPLUGIN_IBY
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/musicwidgetplugin/rom/rom.pri Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,40 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+BLD_INF_RULES.prj_exports += \
+"$${LITERAL_HASH}include <platform_paths.hrh>"
+
+symbian {
+MP_IBY_DIR = $$section(PWD,":",1)
+
+#iby exports to core
+BLD_INF_RULES.prj_exports += "$$MP_IBY_DIR/musicwidgetplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(musicwidgetplugin.iby)"
+
+#iby exports to language
+#BLD_INF_RULES.prj_exports += "$$MP_IBY_DIR/musicwidgetplugin_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(musicwidgetplugin_resources.iby)"
+}
+
+
+BLD_INF_RULES.prj_extensions += \
+
+#$$LITERAL_HASH"ifdef MARM" \
+#" START EXTENSION app-services/buildstubsis" \
+#" OPTION SRCDIR rom" \
+#" OPTION SISNAME musicwidgetplugin_stub" \
+#" END" \
+#$$LITERAL_HASH"endif"
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/musicwidgetplugin/src/musicwidget.cpp Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,836 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Music player home screen widget
+*
+*/
+
+#include "musicwidget.h"
+
+#include <QtGui>
+#include <hbpushbutton.h>
+#include <hblabel.h>
+#include <hbicon.h>
+#include <hbmarqueeitem.h>
+#include <hbdocumentloader.h>
+#include <hbanchorlayout.h>
+#include <hbwidget.h>
+#include <hbframeitem.h>
+#include <hbframedrawer.h>
+#include <hbstyleloader.h>
+#include <hbcolorscheme.h>
+
+#include "mptrace.h"
+#include "mpenginefactory.h"
+
+// Constants
+/** Docml */
+const QString MUSIC_WIDGET_DOCML = ":/gfx/music_widget.docml";
+
+/** File name suffix lists for push buttons */
+const QStringList PREV_BUTTON_SUFFIXES = (QStringList() << "_l" << "_c" << "_cr");
+const QStringList PLAY_BUTTON_SUFFIXES = (QStringList() << "_cl" << "_c" << "_cr");
+const QStringList NEXT_BUTTON_SUFFIXES = (QStringList() << "_cl" << "_c" << "_r");
+
+/** Prefixes for 3 piece button background graphics */
+const QLatin1String PUSH_BUTTON_NORMAL("qtg_fr_hsbutton_normal");
+const QLatin1String PUSH_BUTTON_PRESSED ("qtg_fr_hsbutton_pressed");
+const QLatin1String PUSH_BUTTON_DISABLED ("qtg_fr_hsbutton_disabled");
+
+/** Push button icon colors for each of the states (Normal, Pressed and Disabled) */
+const QLatin1String ICON_COLOR_NORMAL ("qtc_button_normal");
+const QLatin1String ICON_COLOR_PRESSED ("qtc_button_pressed");
+const QLatin1String ICON_COLOR_DISABLED ("qtc_button_disabled");
+
+/** Play and Pause icons */
+const QLatin1String ICON_PLAY ("qtg_mono_play");
+const QLatin1String ICON_PAUSE ("qtg_mono_pause");
+/** Music Player shortcut icon */
+const QLatin1String ICON_LARGE_MUSIC_PLAYER ("qtg_large_music_player");
+/** Music Player shortcut icon */
+const QLatin1String ICON_FIRST_TIME_USE ("qtg_large_music_empty");
+
+/** HsWidget normal background */
+const QLatin1String WIDGET_BG_NORMAL ("qtg_fr_hswidget_normal");
+/** Text background */
+const QLatin1String TEXT_BG_NORMAL ("qtg_fr_multimedia_trans");
+/** Separator : character and space between artist and song name */
+const QLatin1String SEPARATOR_TEXT (": ");
+/** Temporary unknown artist */
+const QLatin1String TEMPORARY_UNKWNOWN_TEXT ("Unknown");
+/** Localized unknown artist */
+const QLatin1String UNKWNOWN_TEXT ("txt_mus_other_unknown_1");
+
+/** Marquee width */
+const int MARQUEE_WIDTH = 170;
+/** Infinite loop value for marquee */
+const int MARQUEE_LOOP_FOREVER = -1;
+
+/** Now playing view with random play */
+const QLatin1String SERVICEREQ_FIRST_TIME_USE ("appto://10207C62?activityname=MusicNowPlayingView&launchtype=standalone&shuffle=yes");
+/** Main view */
+const QLatin1String SERVICEREQ_MAIN_VIEW ("appto://10207C62?activityname=MusicMainView&launchtype=standalone");
+/** Now playing view */
+const QLatin1String SERVICEREQ_NOW_PLAYING_VIEW ("appto://10207C62?activityname=MusicNowPlayingView&launchtype=standalone");
+
+/** DOCML object name for main widget */
+const QLatin1String DOCML_CONTAINER_WIDGET ("containerWidget");
+/** DOCML object name for widget background */
+const QLatin1String DOCML_BG_ICON ("widget_background_icon");
+/** DOCML object name for album art image */
+const QLatin1String DOCML_ALBUM_ART ("album_art_image");
+/** DOCML object name for shortcut icon background */
+const QLatin1String DOCML_SHORTCUT_ICON_BG ("shortcut_icon_background");
+/** DOCML object name for shortcut icon */
+const QLatin1String DOCML_SHORTCUT_ICON ("shortcut_icon");
+/** DOCML object name for scrolling text background */
+const QLatin1String DOCML_TEXT_BG ("text_bg");
+/** DOCML object name for scrolling text */
+const QLatin1String DOCML_SCROLLING_TEXT ("scrolling_text");
+/** DOCML object name for button group container */
+const QLatin1String DOCML_BUTTON_GROUP_CONTAINER ("button_group_container");
+/** DOCML object name for prev button */
+const QLatin1String DOCML_PREV_BUTTON ("btn_previous");
+/** DOCML object name for play button */
+const QLatin1String DOCML_PLAY_BUTTON ("btn_play");
+/** DOCML object name for next button */
+const QLatin1String DOCML_NEXT_BUTTON ("btn_next");
+
+
+MusicWidget::MusicWidget(QGraphicsItem* parent, Qt::WindowFlags flags):
+ HbWidget(parent, flags),
+ mShortcutArea(0),
+ mSongDataBG(0),
+ mInformationSongName(0),
+ mMarqueeText(0),
+ mPreviousPushButton(0),
+ mPlayPushButton(0),
+ mNextPushButton(0),
+ mMusicPlayerNoSongData(1),
+ mMusicPlayerUpdating(0),
+ mMusicPlayerBlocked(0),
+ mAlbumArtLabel(0),
+ mAlbumArtWidth(0),
+ mAlbumArtHeight(0),
+ mArtist(0),
+ mTitle(0),
+ mMpEngine(0),
+ mMpPlaybackData(0)
+{
+ TX_ENTRY
+
+ // Setup UI
+ setupUi();
+
+ // Connect to MP engine and playback data
+ mMpEngine = MpEngineFactory::createSharedEngine();
+ Q_ASSERT_X(mMpEngine, "music_widget", "no music player engine");
+ TX_LOG_ARGS("got mp engine")
+
+ mMpPlaybackData = mMpEngine->playbackData();
+ Q_ASSERT_X(mMpPlaybackData, "music_widget", "no playback data");
+ TX_LOG_ARGS("got playback data")
+
+ // Connect outgoing signals and slots
+ QObject::connect(mShortcutArea, SIGNAL(clicked()), this, SLOT(shortcutButton()));
+
+ // use signal mapper to indicate button identifiers to button event slots
+ QSignalMapper* signalMapperPressed = new QSignalMapper( this );
+ signalMapperPressed->setMapping( mPreviousPushButton, EPrevious );
+ signalMapperPressed->setMapping( mPlayPushButton, EPlayPause);
+ signalMapperPressed->setMapping( mNextPushButton, ENext);
+
+ // need to use different signal mapper for pressed and released events,
+ // both have same mappings but they are mapped to different slots
+ QSignalMapper* signalMapperReleased = new QSignalMapper( this );
+ signalMapperReleased->setMapping( mPreviousPushButton, EPrevious );
+ signalMapperReleased->setMapping( mPlayPushButton, EPlayPause);
+ signalMapperReleased->setMapping( mNextPushButton, ENext);
+
+ // Connect button events to signal maps
+ QObject::connect(mPreviousPushButton, SIGNAL(pressed()), signalMapperPressed, SLOT (map()));
+ QObject::connect(mPreviousPushButton, SIGNAL(released()), signalMapperReleased, SLOT (map()));
+
+ QObject::connect(mPlayPushButton, SIGNAL(pressed()), signalMapperPressed, SLOT (map()));
+ QObject::connect(mPlayPushButton, SIGNAL(released()), signalMapperReleased, SLOT (map()));
+
+ QObject::connect(mNextPushButton, SIGNAL(pressed()), signalMapperPressed, SLOT (map()));
+ QObject::connect(mNextPushButton, SIGNAL(released()), signalMapperReleased, SLOT (map()));
+
+ // Connect mapper signals to self implemented slots
+ QObject::connect( signalMapperPressed, SIGNAL(mapped(int)), this, SLOT(mediaButtonPressed(int)));
+ QObject::connect( signalMapperReleased, SIGNAL(mapped(int)), this, SLOT(mediaButtonReleased(int)));
+
+ // Connect clicked events
+ QObject::connect(mPreviousPushButton, SIGNAL(clicked()), this, SLOT(prevSong()));
+ QObject::connect(mPlayPushButton, SIGNAL(clicked()), this, SLOT(playSong()));
+ QObject::connect(mNextPushButton, SIGNAL(clicked()), this, SLOT(nextSong()));
+
+ // MpEngine
+ QObject::connect(mMpEngine, SIGNAL(libraryAboutToUpdate()), this, SLOT(libraryAboutToUpdate()));
+ QObject::connect(mMpEngine, SIGNAL(libraryUpdated()), this, SLOT(libraryUpdated()));
+ QObject::connect(mMpEngine, SIGNAL(usbBlocked(bool)), this, SLOT(usbBlocked(bool)));
+
+ //MpPlaybackData
+ QObject::connect(mMpPlaybackData, SIGNAL(albumArtReady()), this, SLOT(albumArtReady()));
+ QObject::connect(mMpPlaybackData, SIGNAL(playbackStateChanged()), this, SLOT(playbackStateChanged()));
+ QObject::connect(mMpPlaybackData, SIGNAL(playbackInfoChanged()), this, SLOT(playbackInfoChanged()));
+
+ // Initial data from Music Player get by onShow method call
+ TX_EXIT
+}
+
+/*!
+ Destructor
+*/
+MusicWidget::~MusicWidget()
+{
+}
+
+/*!
+ Creates UI.
+ */
+void MusicWidget::setupUi()
+{
+ TX_ENTRY
+
+ // Use document loader to load the contents
+ HbDocumentLoader loader;
+ bool ok = false;
+ loader.load( MUSIC_WIDGET_DOCML, &ok);
+ Q_ASSERT_X(ok, "music_widget", "invalid title docml file");
+
+ TX_LOG_ARGS("loaded docml")
+
+ QGraphicsLinearLayout* mainLayout = new QGraphicsLinearLayout(Qt::Vertical, this);
+ QGraphicsWidget* container = loader.findWidget(DOCML_CONTAINER_WIDGET);
+ mainLayout->addItem(container);
+ //Sets parent
+ setLayout( mainLayout );
+
+ // Load and set widget background
+ HbWidget *bgWidget = qobject_cast<HbWidget*> (loader.findWidget(DOCML_BG_ICON));
+ HbFrameItem *frameItem;
+ if (bgWidget)
+ {
+ HbFrameDrawer *drawer = new HbFrameDrawer(WIDGET_BG_NORMAL,
+ HbFrameDrawer::NinePieces);
+ frameItem = new HbFrameItem(drawer, bgWidget);
+ frameItem->setPreferredSize(bgWidget->preferredSize());
+ bgWidget->setZValue(1);
+ }
+
+ // Setup album art area
+ QGraphicsWidget *tmpWidgetPtr;
+ tmpWidgetPtr = loader.findWidget(DOCML_ALBUM_ART);
+ mAlbumArtLabel = qobject_cast<HbLabel*>(tmpWidgetPtr);
+ HbWidget *albumArtLayout = mAlbumArtLabel;
+ albumArtLayout->setZValue(2);
+
+ // Store album art area size
+ mAlbumArtWidth = albumArtLayout->preferredWidth();
+ mAlbumArtHeight = albumArtLayout->preferredHeight();
+
+ // Load shortcut background
+ HbWidget *shortcutAreaLayout = qobject_cast<HbWidget*> (loader.findWidget(DOCML_SHORTCUT_ICON_BG));
+ HbFrameItem *shortcutFrameItem;
+ if (shortcutAreaLayout) {
+ HbFrameDrawer *drawer = new HbFrameDrawer(WIDGET_BG_NORMAL,
+ HbFrameDrawer::NinePieces);
+ shortcutFrameItem = new HbFrameItem(drawer, shortcutAreaLayout);
+ shortcutFrameItem->setPreferredSize(shortcutAreaLayout->preferredSize());
+ shortcutAreaLayout->setZValue(3);
+ }
+
+ // Load shortcut widget and set background
+ mShortcutArea = qobject_cast<HbPushButton*> (loader.findWidget(DOCML_SHORTCUT_ICON));
+ if ( mShortcutArea )
+ {
+ // icon needs to be put as a background so that it fills the whole button area
+ HbFrameDrawer* drawer = new HbFrameDrawer(ICON_LARGE_MUSIC_PLAYER, HbFrameDrawer::OnePiece);
+ mShortcutArea->setFrameBackground( drawer );
+ }
+
+ // Set song data background
+ mSongDataBG = qobject_cast<HbWidget*> (loader.findWidget(DOCML_TEXT_BG));
+ HbFrameItem *scrollTextItem;
+ if (mSongDataBG)
+ {
+ HbFrameDrawer *drawer = new HbFrameDrawer(TEXT_BG_NORMAL,
+ HbFrameDrawer::NinePieces);
+ scrollTextItem = new HbFrameItem(drawer, mSongDataBG);
+ scrollTextItem->setPreferredSize(mSongDataBG->preferredSize());
+ mSongDataBG->setZValue(4);
+ mSongDataBG->hide(); // Hide initially...
+ }
+
+ // Set scrolling song data
+ mInformationSongName = qobject_cast<HbLabel*> (loader.findWidget(DOCML_SCROLLING_TEXT));
+ if ( mInformationSongName )
+ {
+ // Setting primitive marquee item values from .css doesn't work well, set in code...
+ mMarqueeText = new HbMarqueeItem(mInformationSongName);
+ HbFontSpec fs(HbFontSpec::Secondary);
+ mMarqueeText->setFontSpec(fs);
+ mMarqueeText->setTextColor(mInformationSongName->textColor());
+ mMarqueeText->setMinimumWidth(MARQUEE_WIDTH);
+ mMarqueeText->setLoopCount(MARQUEE_LOOP_FOREVER);
+ }
+
+ HbWidget *buttonGroupContainer = qobject_cast<HbWidget*> (loader.findWidget(
+ DOCML_BUTTON_GROUP_CONTAINER));
+ if (buttonGroupContainer)
+ {
+ // Define push buttons in state at this point, check the player status later and update buttons if needed
+ mPreviousPushButton = qobject_cast<HbPushButton*> (loader.findWidget(DOCML_PREV_BUTTON));
+ defineMediaButton( *mPreviousPushButton, PUSH_BUTTON_NORMAL, PREV_BUTTON_SUFFIXES, ICON_COLOR_NORMAL );
+
+ mPlayPushButton = qobject_cast<HbPushButton*> (loader.findWidget(DOCML_PLAY_BUTTON));
+ defineMediaButton( *mPlayPushButton, PUSH_BUTTON_NORMAL, PLAY_BUTTON_SUFFIXES, ICON_COLOR_NORMAL );
+
+ mNextPushButton = qobject_cast<HbPushButton*> (loader.findWidget(DOCML_NEXT_BUTTON));
+ defineMediaButton( *mNextPushButton, PUSH_BUTTON_NORMAL, NEXT_BUTTON_SUFFIXES, ICON_COLOR_NORMAL );
+ }
+
+ TX_EXIT
+}
+
+/*!
+ Makes the push button based on information aGraphicsId and aSuffix
+ */
+void MusicWidget::defineMediaButton( HbPushButton& aTarget, QString aGraphicsId, QStringList aSuffix, QString aIconColor )
+ {
+ TX_ENTRY
+
+ TX_LOG_ARGS("graphics id: " << aGraphicsId)
+ TX_LOG_ARGS("icon color: " << aIconColor)
+
+ HbFrameDrawer* drawer;
+
+ // First check if the drawer is already created for this push button
+ if ( !aTarget.frameBackground()){
+ // Nope, create one now
+ drawer = new HbFrameDrawer(aGraphicsId, HbFrameDrawer::ThreePiecesHorizontal);
+ aTarget.setFrameBackground( drawer );
+ TX_LOG_ARGS("created drawer for button bg")
+ }
+ else {
+ // Frame drawer already created, only need to update frame graphics
+ drawer = aTarget.frameBackground();
+ drawer->setFrameGraphicsName( aGraphicsId );
+ TX_LOG_ARGS("using existing drawer for button bg")
+ }
+
+ // Set file name suffix list, so that drawer can load correct 3-piece graphic files
+ drawer->setFileNameSuffixList( aSuffix );
+
+ // Update also the icon color
+ QColor color = HbColorScheme::color(aIconColor);
+ aTarget.icon().setColor( color );
+
+ // Lastly, check if the buttton is disabled
+ if ( aIconColor == ICON_COLOR_DISABLED )
+ {
+ aTarget.setEnabled(false);
+ TX_LOG_ARGS("button disabled")
+ }
+ else
+ {
+ aTarget.setEnabled(true);
+ TX_LOG_ARGS("button enabled")
+ }
+
+ TX_EXIT
+ }
+
+/*!
+
+ */
+void MusicWidget::mediaButtonEvent( MediaKeyIdentifier aMediaKeyId, QString aGraphicsId, QString aIconColor )
+ {
+ TX_ENTRY
+
+ HbPushButton* target = NULL;
+ QStringList suffix;
+
+ switch ( aMediaKeyId )
+ {
+ case EPrevious: {
+ TX_LOG_ARGS("previous")
+ target = mPreviousPushButton;
+ suffix = PREV_BUTTON_SUFFIXES;
+ break;
+ }
+ case EPlayPause: {
+ TX_LOG_ARGS("play/pause")
+ target = mPlayPushButton;
+ suffix = PLAY_BUTTON_SUFFIXES;
+ break;
+ }
+ case ENext: {
+ TX_LOG_ARGS("next")
+ target = mNextPushButton;
+ suffix = NEXT_BUTTON_SUFFIXES;
+ break;
+ }
+ default: {
+ // Do proper error handling.. should not be possible to get here ever tough
+ TX_LOG_ARGS("unknown button")
+ return;
+ }
+ }
+
+ if ( target )
+ {
+ MusicWidget::defineMediaButton( *target, aGraphicsId, suffix, aIconColor );
+ }
+
+ TX_EXIT
+ }
+
+/*!
+ Emited from HbPushButton:pressed() signal, changes the button layout to 'Pressed'
+ */
+void MusicWidget::mediaButtonPressed( int aMediaKeyId )
+ {
+ TX_LOG_ARGS("media key: " << aMediaKeyId )
+ mediaButtonEvent( (MediaKeyIdentifier)aMediaKeyId, PUSH_BUTTON_PRESSED, ICON_COLOR_PRESSED );
+ }
+
+/*!
+ Emited from HbPushButton:released() signal, changes the button layout to 'Normal'
+ */
+void MusicWidget::mediaButtonReleased( int aMediaKeyId )
+ {
+ TX_LOG_ARGS("media key: " << aMediaKeyId )
+ mediaButtonEvent( (MediaKeyIdentifier)aMediaKeyId, PUSH_BUTTON_NORMAL, ICON_COLOR_NORMAL );
+ }
+
+/*!
+ Disables specified push button
+ */
+void MusicWidget::mediaButtonDisabled( int aMediaKeyId )
+ {
+ TX_LOG_ARGS("media key: " << aMediaKeyId )
+ mediaButtonEvent( (MediaKeyIdentifier)aMediaKeyId, PUSH_BUTTON_DISABLED, ICON_COLOR_DISABLED );
+ }
+
+/*!
+ Disables specified push button
+ */
+void MusicWidget::mediaButtonEnabled( int aMediaKeyId )
+ {
+ TX_LOG_ARGS("media key: " << aMediaKeyId )
+ mediaButtonEvent( (MediaKeyIdentifier)aMediaKeyId, PUSH_BUTTON_NORMAL, ICON_COLOR_NORMAL );
+ }
+
+/*!
+ Manually update music widget state.
+ */
+void MusicWidget::refreshData()
+{
+ TX_ENTRY
+ // Get current player state
+ playbackStateChanged();
+
+ // Get current song data, updates button states
+ playbackInfoChanged();
+
+ // Get current album art
+ albumArtReady();
+ TX_EXIT
+}
+
+/*!
+ Launch music player...
+ */
+void MusicWidget::launchMusicPlayer(int launchMode)
+{
+ TX_ENTRY
+ //TODO: Detect if MusicPlayer is running or not properly, handle case where player not available?!
+ //TODO: Get service status from XQSettingManager
+ //TODO: Service status from signal:
+ //TODO: void statusChanged(const XQAiwInterfaceDescriptor& implementation, ServiceStatus currentStatus);
+
+ QUrl url;
+ XQAiwRequest* req;
+
+ if ( launchMode == ELaunchFromPlay )
+ {
+ TX_LOG_ARGS("launch from play")
+ // Launch to now playing view, random play to be started!
+ url.setUrl(SERVICEREQ_FIRST_TIME_USE);
+ }
+ else if (mMusicPlayerNoSongData)
+ {
+ TX_LOG_ARGS("to main view")
+ // Launch to main view
+ url.setUrl(SERVICEREQ_MAIN_VIEW);
+ }
+ else
+ {
+ TX_LOG_ARGS("to now playing view")
+ // Launch to now playing view
+ url.setUrl(SERVICEREQ_NOW_PLAYING_VIEW);
+ }
+
+ req = mApplicationManager.create(url);
+ if (req == NULL)
+ {
+ // No handlers for the URI
+ TX_LOG_ARGS("no req created")
+ return;
+ }
+
+ req->setBackground(false);
+ req->setSynchronous(false);
+
+ // Set function parameters
+ QList<QVariant> args;
+ args << url.toString();
+ req->setArguments(args);
+
+ // Send the request
+ bool res = req->send();
+ if (!res)
+ {
+ // Request failed.
+ int error = req->lastError();
+ // Handle error
+ TX_LOG_ARGS("req send error: " << error)
+ }
+
+ delete req;
+
+ TX_EXIT
+}
+
+/*!
+ Return bounding rect
+*/
+QRectF MusicWidget::boundingRect() const
+{
+ return childrenBoundingRect();
+}
+
+/*!
+ Return shape
+*/
+QPainterPath MusicWidget::shape() const
+{
+ QPainterPath path;
+ path.addRect(boundingRect());
+ return path;
+}
+
+/*!
+ Initializes the widget.
+ */
+void MusicWidget::onInitialize()
+{
+ TX_LOG
+}
+
+/*!
+ Shows the widget.
+ */
+void MusicWidget::onShow()
+{
+ TX_LOG
+ refreshData();
+}
+
+/*!
+ Hides the widget.
+ */
+void MusicWidget::onHide()
+{
+ TX_LOG
+}
+
+/*!
+ Uninitializes the widget.
+ */
+void MusicWidget::onUninitialize()
+{
+ TX_LOG
+}
+
+/*!
+ Slot for shortcut button clicked.
+ */
+void MusicWidget::shortcutButton()
+{
+ TX_LOG
+ launchMusicPlayer(ELaunchFromShortcut);
+}
+
+/*!
+ Slot for previous button clicked.
+ */
+void MusicWidget::prevSong()
+{
+ TX_LOG
+ mMpEngine->skipBackward();
+}
+
+/*!
+ Slot for play button clicked. Handles both Play and Pause!
+ */
+void MusicWidget::playSong()
+{
+ TX_ENTRY
+ if (mMusicPlayerNoSongData && mMpPlaybackData->playbackState() != MpPlaybackData::Playing )
+ {
+ //Signal music player to start playing all songs with random
+ launchMusicPlayer(ELaunchFromPlay);
+ }
+
+ mMpEngine->playPause();
+ TX_EXIT
+}
+/*!
+ Slot for next button clicked.
+ */
+void MusicWidget::nextSong()
+{
+ TX_LOG
+ mMpEngine->skipForward();
+}
+
+/*!
+
+ */
+bool MusicWidget::eventFilter(QObject *target, QEvent *event)
+ {
+ // pass the event on to the parent class
+ return HbWidget::eventFilter(target, event);
+}
+
+/*!
+ MpEngine related
+ */
+void MusicWidget::libraryAboutToUpdate()
+{
+ TX_LOG
+ //Refresh Library start
+ mMusicPlayerUpdating = true;
+
+ // Update button enabled/disabled state
+ toggleButtons();
+}
+
+/*!
+ MpEngine related
+ */
+void MusicWidget::libraryUpdated()
+{
+ TX_LOG
+ //Refresh Library done
+ mMusicPlayerUpdating = false;
+
+ // Update button enabled/disabled state
+ toggleButtons();
+}
+
+/*!
+ MpEngine related
+ */
+void MusicWidget::usbBlocked( bool blocked )
+{
+ TX_LOG_ARGS("blocked: " << blocked)
+ //Blocked state
+ //Mass storage mode
+ //Media transfer mode
+ //Ovi Suite mode
+ //Insert memory card
+
+ mMusicPlayerBlocked = blocked;
+
+ // Update button enabled/disabled state
+ toggleButtons();
+}
+
+/*!
+ MpPlaybackData related
+ */
+void MusicWidget::albumArtReady()
+{
+ TX_ENTRY
+ HbIcon icon;
+
+ if ( mMusicPlayerNoSongData )
+ {
+ TX_LOG_ARGS("1st time album art")
+ icon = HbIcon(ICON_FIRST_TIME_USE);
+ }
+ else
+ {
+ TX_LOG_ARGS("playback data album art")
+ mMpPlaybackData->albumArt( icon );
+ }
+
+ // Resize here manually to avoid resizing when showing album art
+ icon.setHeight(mAlbumArtHeight);
+ icon.setWidth(mAlbumArtWidth);
+ mAlbumArtLabel->setIcon( icon );
+
+ TX_EXIT
+}
+
+void MusicWidget::playbackStateChanged()
+{
+ TX_ENTRY
+ // Set play/pause icon and start/stop marquee.
+ QString iconName;
+
+ int state = mMpPlaybackData->playbackState();
+
+ TX_LOG_ARGS("state: " << state)
+
+ switch (state)
+ {
+ case MpPlaybackData::Playing:
+ {
+ TX_LOG_ARGS("pause icon, start marquee")
+ iconName.append(ICON_PAUSE);
+ mMarqueeText->startAnimation();
+ break;
+ }
+ case MpPlaybackData::Paused:
+ case MpPlaybackData::Stopped:
+ case MpPlaybackData::NotPlaying:
+ {
+ TX_LOG_ARGS("play icon, stop marquee")
+ iconName.append(ICON_PLAY);
+ mMarqueeText->stopAnimation();
+ break;
+ }
+ }
+
+ HbIcon iconPlayPause(iconName);
+ mPlayPushButton->setIcon(iconPlayPause);
+
+ TX_EXIT
+}
+
+/*!
+ MpPlaybackData related
+ */
+void MusicWidget::playbackInfoChanged()
+{
+ TX_ENTRY
+ // Initialize maqruee with something (space), to ensure
+ // text updates to display as well.
+ QString songData;
+
+ mArtist = mMpPlaybackData->artist();
+ mTitle = mMpPlaybackData->title();
+
+ if ( !mTitle.length() )
+ {
+ mArtist.clear();
+ mTitle.clear();
+ songData = " ";
+
+ //1st time launch
+ mMusicPlayerNoSongData = true;
+
+ TX_LOG_ARGS("no song data")
+ }
+ else
+ {
+ if ( !mArtist.length() )
+ {
+ //Show localized "Unknown" if there is no artist name
+
+ //TODO: Widget needs own localization?!?!
+ //mArtist.append( hbTrId(UNKWNOWN_TEXT) );
+
+ //TODO: Remove temporary unknown string when localization resolved.
+ mArtist.append( TEMPORARY_UNKWNOWN_TEXT );
+ }
+
+ songData.append(mArtist);
+ songData.append(SEPARATOR_TEXT);
+ songData.append(mTitle);
+
+ mMusicPlayerNoSongData = false;
+
+ TX_LOG_ARGS("song data received")
+ }
+
+ mMarqueeText->setText(songData);
+ TX_LOG_ARGS("marquee text: " << songData)
+
+ // Show dark BG to songdata only if there is songdata...
+ if ( mMusicPlayerNoSongData && mSongDataBG->isVisible() )
+ {
+ TX_LOG_ARGS("hide marquee bg")
+ mSongDataBG->hide();
+ }
+ else if ( !mMusicPlayerNoSongData && !mSongDataBG->isVisible() )
+ {
+ TX_LOG_ARGS("show marquee bg")
+ mSongDataBG->show();
+ }
+
+ // Update button enabled/disabled state
+ toggleButtons();
+
+ TX_EXIT
+}
+
+/*!
+ Toggle buttons to disabled/enabled as required.
+ */
+void MusicWidget::toggleButtons()
+{
+ TX_ENTRY
+ // All buttons disabled if updating
+ if ( mMusicPlayerUpdating )
+ {
+ TX_LOG_ARGS("updating")
+ mediaButtonDisabled( EPlayPause );
+ mediaButtonDisabled( EPrevious );
+ mediaButtonDisabled( ENext );
+ }
+
+ // All buttons disabled if blocked
+ else if ( mMusicPlayerBlocked )
+ {
+ TX_LOG_ARGS("blocked")
+ mediaButtonDisabled( EPlayPause );
+ mediaButtonDisabled( EPrevious );
+ mediaButtonDisabled( ENext );
+ }
+
+ // Only play button enabled if there is no song data, 1st time use
+ else if ( mMusicPlayerNoSongData )
+ {
+ TX_LOG_ARGS("no song data")
+ mediaButtonEnabled( EPlayPause );
+ mediaButtonDisabled( EPrevious );
+ mediaButtonDisabled( ENext );
+ }
+
+ // Enable all buttons if there is song data
+ else
+ {
+ TX_LOG_ARGS("enable all buttons")
+ mediaButtonEnabled( EPlayPause );
+ mediaButtonEnabled( EPrevious );
+ mediaButtonEnabled( ENext );
+ }
+ TX_EXIT
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/musicwidgetplugin/src/musicwidgetplugin.cpp Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Music player home screen widget
+*
+*/
+
+#include <qserviceinterfacedescriptor.h>
+#include <qabstractsecuritysession.h>
+#include <qservicecontext.h>
+
+#include "musicwidgetplugin.h"
+#include "musicwidget.h"
+
+QObject *MusicWidgetPlugin::createInstance(const QServiceInterfaceDescriptor &descriptor,
+ QServiceContext *context,
+ QAbstractSecuritySession *session)
+{
+ Q_UNUSED(context);
+ Q_UNUSED(session);
+
+ if (descriptor.interfaceName() == QLatin1String("com.nokia.symbian.IHomeScreenWidget"))
+ {
+ return new MusicWidget();
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+Q_EXPORT_PLUGIN2(musicwidgetplugin, MusicWidgetPlugin)
--- a/qtmusicplayer.pro Fri May 14 18:54:37 2010 -0500
+++ b/qtmusicplayer.pro Fri May 28 19:46:01 2010 -0500
@@ -28,6 +28,7 @@
include(mpviewplugins/mpsettingsviewplugin/rom/rom.pri)
include(mpviewplugins/mpdetailsviewplugin/rom/rom.pri)
include(mpviewplugins/mpmediawallviewplugin/rom/rom.pri)
+ include(musicwidgetplugin/rom/rom.pri)
include(mpserviceplugins/audioeffects/rom/rom.pri)
include(mpserviceplugins/localaudio/rom/rom.pri)
include(mpserviceplugins/mpxsqlitedbcommon/rom/rom.pri)
@@ -42,7 +43,8 @@
app \
mpdata \
mpengine \
- mpviewplugins
+ mpviewplugins \
+ musicwidgetplugin
CONFIG += ordered
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sis/build-sisx-udeb.bat Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,37 @@
+@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
+
+@echo off
+
+IF NOT EXIST Nokia_RnDCert_02.der (
+ echo Please copy key files to ROOT before build sis file.
+ goto end
+) ELSE (
+ IF NOT EXIST Nokia_RnDCert_02.key (
+ echo Please copy key files to ROOT before build sis file.
+ goto end
+ )
+)
+
+del musicplayer_udeb.sis musicplayer_udeb.sisx
+@echo.
+makesis musicplayer_udeb.pkg
+@echo.
+signsis musicplayer_udeb.sis musicplayer_udeb.sisx Nokia_RnDCert_02.der Nokia_RnDCert_02.key
+
+:end
+@echo.
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sis/build-sisx-urel.bat Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,37 @@
+@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
+
+@echo off
+
+IF NOT EXIST Nokia_RnDCert_02.der (
+ echo Please copy key files to ROOT before build sis file.
+ goto end
+) ELSE (
+ IF NOT EXIST Nokia_RnDCert_02.key (
+ echo Please copy key files to ROOT before build sis file.
+ goto end
+ )
+)
+
+del musicplayer_urel.sis musicplayer_urel.sisx
+@echo.
+makesis musicplayer_urel.pkg
+@echo.
+signsis musicplayer_urel.sis musicplayer_urel.sisx Nokia_RnDCert_02.der Nokia_RnDCert_02.key
+
+:end
+@echo.
+
--- a/sis/build-sisx.bat Fri May 14 18:54:37 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +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
-
-Echo please copy key files to ROOT before build sis file
-del musicplayer.sis mpxservicesplugins.sis musicplayer.six mpxservicesplugins.six
-makesis mpxservicesplugins.pkg
-signsis mpxservicesplugins.sis mpxservicesplugins.six rd.cer rd-key.pem
-makesis musicplayer.pkg
-signsis musicplayer.sis musicplayer.six rd.cer rd-key.pem
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sis/build-stub-sis.bat Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,19 @@
+@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
+
+del musicplayer_stub.sis
+makesis -s musicplayer_stub.pkg
+@echo.
--- a/sis/mpxservicesplugins.pkg Fri May 14 18:54:37 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-;
-; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-; All rights reserved.
-; This component and the accompanying materials are made available
-; under the terms of "Eclipse Public License v1.0"
-; which accompanies this distribution, and is available
-; at the URL "http://www.eclipse.org/legal/epl-v10.html".
-;
-; Initial Contributors:
-; Nokia Corporation - initial contribution.
-;
-; Contributors:
-;
-; Description:
-;
-;Header
-#{"MPXMusicPlayer"}, (0x101FFC62), 18, 0, 0, TYPE=SA, RU
-; dlls version uses 13.2
-
-
-; Localised vendor names
-%{"Nokia"}
-
-; Unique, global vendor name
-:"Nokia"
-
-;Files to install
-"\epoc32\release\armv5\urel\mpxlocalaudioplayback.dll" -"!:\sys\bin\mpxlocalaudioplayback.dll"
-"\epoc32\release\armv5\urel\mpxsqlitedbcommon.dll" -"!:\sys\bin\mpxsqlitedbcommon.dll"
-"\epoc32\release\armv5\urel\mpxsqlitedbplugin.dll" -"!:\sys\bin\mpxsqlitedbplugin.dll"
-"\epoc32\release\armv5\urel\mpxsqlitepodcastdbplugin.dll" -"!:\sys\bin\mpxsqlitepodcastdbplugin.dll"
-"\epoc32\release\armv5\urel\mpxm3uplaylistparsers.dll" -"!:\sys\bin\mpxm3uplaylistparsers.dll"
-"\epoc32\release\armv5\urel\mpxm3uplaylistplugin.dll" -"!:\sys\bin\mpxm3uplaylistplugin.dll"
-
-"\epoc32\data\Z\resource\plugins\mpxlocalaudioplayback.rsc" -"!:\resource\plugins\mpxlocalaudioplayback.rsc"
-"\epoc32\data\Z\resource\plugins\mpxsqlitedbplugin.rsc" -"!:\resource\plugins\mpxsqlitedbplugin.rsc"
-"\epoc32\data\Z\resource\apps\mpxcollectiondbres.rsc" -"!:\resource\apps\mpxcollectiondbres.rsc"
-"\epoc32\data\Z\resource\plugins\mpxsqlitepodcastdbplugin.rsc" -"!:\resource\plugins\mpxsqlitepodcastdbplugin.rsc"
-"\epoc32\data\Z\resource\plugins\mpxm3uplaylistplugin.rsc" -"!:\resource\plugins\mpxm3uplaylistplugin.rsc"
--- a/sis/musicplayer.pkg Fri May 14 18:54:37 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-;
-; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-; All rights reserved.
-; This component and the accompanying materials are made available
-; under the terms of "Eclipse Public License v1.0"
-; which accompanies this distribution, and is available
-; at the URL "http://www.eclipse.org/legal/epl-v10.html".
-;
-; Initial Contributors:
-; Nokia Corporation - initial contribution.
-;
-; Contributors:
-;
-; Description:
-;
-; Language
-&EN
-
-; SIS header: name, uid, version
-#{"musicplayer"},(0x10207C62),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"}
-
-; Executable and default resource files
-"\epoc32\release\armv5\urel\musicplayer.exe" - "!:\sys\bin\musicplayer.exe"
-"\epoc32\data\z\resource\apps\musicplayer.rsc" - "!:\resource\apps\musicplayer.rsc"
-"\epoc32\data\z\private\10003a3f\import\apps\musicplayer_reg.rsc" - "!:\private\10003a3f\import\apps\musicplayer_reg.rsc"
-"\epoc32\data\z\resource\apps\musicplayer.mif" - "!:\resource\apps\musicplayer.mif"
-
-; DLLs
-"\epoc32\release\armv5\urel\mpnowplayingbanner.dll" - "!:\sys\bin\mpnowplayingbanner.dll"
-"\epoc32\release\armv5\urel\mpsettingsmanager.dll" - "!:\sys\bin\mpsettingsmanager.dll"
-
-;CenRep
-"\epoc32\data\Z\private\10202be9\10207C92.txt" - "!:\private\10202be9\10207C92.txt"
-
-; PLUGIN AND VIEW
-"\epoc32\release\armv5\urel\mpcollectionviewplugin.dll" - "!:\sys\bin\mpcollectionviewplugin.dll"
-"\epoc32\data\Z\resource\plugins\mpcollectionviewplugin.rsc" - "!:\resource\plugins\mpcollectionviewplugin.rsc"
-
-"\epoc32\release\armv5\urel\mpplaybackviewplugin.dll" - "!:\sys\bin\mpplaybackviewplugin.dll"
-"\epoc32\data\Z\resource\plugins\mpplaybackviewplugin.rsc" - "!:\resource\plugins\mpplaybackviewplugin.rsc"
-
-"\epoc32\release\armv5\urel\mpsettingsviewplugin.dll" - "!:\sys\bin\mpsettingsviewplugin.dll"
-"\epoc32\data\Z\resource\plugins\mpsettingsviewplugin.rsc" - "!:\resource\plugins\mpsettingsviewplugin.rsc"
-
-"\epoc32\release\armv5\urel\mpdetailsviewplugin.dll" - "!:\sys\bin\mpdetailsviewplugin.dll"
-"\epoc32\data\Z\resource\plugins\mpdetailsviewplugin.rsc" - "!:\resource\plugins\mpdetailsviewplugin.rsc"
-
-; data
-"\epoc32\data\Z\system\data\nullsound.mp3" -"!:\nullsound.mp3"
-
-@"mpxservicesplugins.sis",(0x101FFC62)
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sis/musicplayer_stub.pkg Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,80 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:
+;
+; Language
+&EN
+
+; SIS header: name, uid, version
+#{"musicplayer"}, (0x10207C62), 1,0,0, TYPE=SA
+
+; Localised Vendor name
+%{"Nokia, Qt Software"}
+
+; Unique Vendor name
+:"Nokia, Qt Software"
+
+; Executable and default resource files
+""-"z:\sys\bin\musicplayer.exe"
+""-"z:\resource\apps\musicplayer.r*"
+""-"z:\private\10003a3f\import\apps\musicplayer_reg.rsc"
+""-"z:\resource\apps\musicplayer.mif"
+""-"z:\resource\qt\translations\musicplayer*.qm"
+
+; DLLs
+""-"z:\sys\bin\mpnowplayingbanner.dll"
+""-"z:\sys\bin\mpsettingsmanager.dll"
+""-"z:\sys\bin\mpdata.dll"
+""-"z:\sys\bin\mpengine.dll"
+""-"z:\sys\bin\musicservices.dll"
+
+; CenRep
+""-"z:\private\10202be9\10207C92.txt"
+
+; PLUGIN AND VIEW
+""-"z:\sys\bin\mpcollectionviewplugin.dll"
+""-"z:\resource\plugins\mpcollectionviewplugin.r*"
+
+""-"z:\sys\bin\mpplaybackviewplugin.dll"
+""-"z:\resource\plugins\mpplaybackviewplugin.r*"
+
+""-"z:\sys\bin\mpsettingsviewplugin.dll"
+""-"z:\resource\plugins\mpsettingsviewplugin.r*"
+
+""-"z:\sys\bin\mpdetailsviewplugin.dll"
+""-"z:\resource\plugins\mpdetailsviewplugin.r*"
+
+""-"z:\sys\bin\mpmediawallviewplugin.dll"
+""-"z:\resource\plugins\mpmediawallviewplugin.r*"
+
+; DATA
+""-"z:\system\data\nullsound.mp3"
+
+;MP SERVICE PLUGINGS
+""-"z:\sys\bin\mpxaudioeffectengine.dll"
+""-"z:\sys\bin\mpxlocalaudioplayback.dll"
+""-"z:\sys\bin\mpxm3uplaylistparsers.dll"
+""-"z:\sys\bin\mpxm3uplaylistplugin.dll"
+""-"z:\sys\bin\mpxinmemoryplugin.dll"
+""-"z:\sys\bin\mpxsqlitedbcommon.dll"
+""-"z:\sys\bin\mpxsqlitedbhgplugin.dll"
+""-"z:\sys\bin\mpxsqlitepodcastdbplugin.dll"
+
+""-"z:\resource\plugins\mpxlocalaudioplayback.r*"
+""-"z:\resource\plugins\mpxm3uplaylistplugin.r*"
+""-"z:\resource\plugins\mpxinmemoryplugin.r*"
+""-"z:\resource\plugins\mpxsqlitedbhgplugin.r*"
+""-"z:\resource\apps\mpxcollectiondbhgres.r*"
+""-"z:\resource\plugins\mpxsqlitepodcastdbplugin.r*"
+""-"z:\resource\apps\pcres.r*"
Binary file sis/musicplayer_stub.sis has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sis/musicplayer_udeb.pkg Fri May 28 19:46:01 2010 -0500
@@ -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:
+;
+; Language
+&EN, FR, GE, SP, IT, SW, DA, NO, FI, AM, PO, TU, IC, RU, HU, DU, CS, SK, PL, SL, TC, HK, ZH, JA, TH, AR, TL, BG, CA,
+HR, ET, FA, CF, EL, HE, IN, KO, LV, LT, MS, BP, RO, SR, LS, UK, UR, VI, BA, GL, 129, 157, 158, 159, 160, 161, 326, 327
+
+; SIS header: name, uid, version
+#{"musicplayer", "musicplayer", "musicplayer", "musicplayer",
+ "musicplayer", "musicplayer", "musicplayer", "musicplayer",
+ "musicplayer", "musicplayer", "musicplayer", "musicplayer",
+ "musicplayer", "musicplayer", "musicplayer", "musicplayer",
+ "musicplayer", "musicplayer", "musicplayer", "musicplayer",
+ "musicplayer", "musicplayer", "musicplayer", "musicplayer",
+ "musicplayer", "musicplayer", "musicplayer", "musicplayer",
+ "musicplayer", "musicplayer", "musicplayer", "musicplayer",
+ "musicplayer", "musicplayer", "musicplayer", "musicplayer",
+ "musicplayer", "musicplayer", "musicplayer", "musicplayer",
+ "musicplayer", "musicplayer", "musicplayer", "musicplayer",
+ "musicplayer", "musicplayer", "musicplayer", "musicplayer",
+ "musicplayer", "musicplayer", "musicplayer", "musicplayer",
+ "musicplayer", "musicplayer", "musicplayer", "musicplayer",
+ "musicplayer"
+ }, (0x10207C62), 1,0,0, TYPE=SA, RU
+
+; Localised Vendor name
+%{"Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software",
+ "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software",
+ "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software",
+ "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software",
+ "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software",
+ "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software",
+ "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software",
+ "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software",
+ "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software",
+ "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software",
+ "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software",
+ "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software",
+ "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software",
+ "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software",
+ "Nokia, Qt Software"
+ }
+
+; Unique Vendor name
+:"Nokia, Qt Software"
+
+; Dependencies
+[0x101F7961],0,0,0,{
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID"
+ }
+[0x102032BE],0,0,0,{
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID"
+ }
+[0x102752AE],0,0,0,{
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID"
+ }
+[0x1028315F],0,0,0,{
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID"
+ }
+
+; Executable and default resource files
+"\epoc32\release\armv5\udeb\musicplayer.exe" - "!:\sys\bin\musicplayer.exe"
+"\epoc32\data\z\private\10003a3f\import\apps\musicplayer_reg.rsc" - "!:\private\10003a3f\import\apps\musicplayer_reg.rsc"
+"\epoc32\data\z\resource\apps\musicplayer.mif" - "!:\resource\apps\musicplayer.mif"
+
+; Localized files
+{
+"\epoc32\data\Z\resource\apps\musicplayer.r01"
+"\epoc32\data\Z\resource\apps\musicplayer.r02"
+"\epoc32\data\Z\resource\apps\musicplayer.r03"
+"\epoc32\data\Z\resource\apps\musicplayer.r04"
+"\epoc32\data\Z\resource\apps\musicplayer.r05"
+"\epoc32\data\Z\resource\apps\musicplayer.r06"
+"\epoc32\data\Z\resource\apps\musicplayer.r07"
+"\epoc32\data\Z\resource\apps\musicplayer.r08"
+"\epoc32\data\Z\resource\apps\musicplayer.r09"
+"\epoc32\data\Z\resource\apps\musicplayer.r10"
+"\epoc32\data\Z\resource\apps\musicplayer.r13"
+"\epoc32\data\Z\resource\apps\musicplayer.r14"
+"\epoc32\data\Z\resource\apps\musicplayer.r15"
+"\epoc32\data\Z\resource\apps\musicplayer.r16"
+"\epoc32\data\Z\resource\apps\musicplayer.r17"
+"\epoc32\data\Z\resource\apps\musicplayer.r18"
+"\epoc32\data\Z\resource\apps\musicplayer.r25"
+"\epoc32\data\Z\resource\apps\musicplayer.r26"
+"\epoc32\data\Z\resource\apps\musicplayer.r27"
+"\epoc32\data\Z\resource\apps\musicplayer.r28"
+"\epoc32\data\Z\resource\apps\musicplayer.r29"
+"\epoc32\data\Z\resource\apps\musicplayer.r30"
+"\epoc32\data\Z\resource\apps\musicplayer.r31"
+"\epoc32\data\Z\resource\apps\musicplayer.r32"
+"\epoc32\data\Z\resource\apps\musicplayer.r33"
+"\epoc32\data\Z\resource\apps\musicplayer.r37"
+"\epoc32\data\Z\resource\apps\musicplayer.r39"
+"\epoc32\data\Z\resource\apps\musicplayer.r42"
+"\epoc32\data\Z\resource\apps\musicplayer.r44"
+"\epoc32\data\Z\resource\apps\musicplayer.r45"
+"\epoc32\data\Z\resource\apps\musicplayer.r49"
+"\epoc32\data\Z\resource\apps\musicplayer.r50"
+"\epoc32\data\Z\resource\apps\musicplayer.r51"
+"\epoc32\data\Z\resource\apps\musicplayer.r54"
+"\epoc32\data\Z\resource\apps\musicplayer.r57"
+"\epoc32\data\Z\resource\apps\musicplayer.r59"
+"\epoc32\data\Z\resource\apps\musicplayer.r65"
+"\epoc32\data\Z\resource\apps\musicplayer.r67"
+"\epoc32\data\Z\resource\apps\musicplayer.r68"
+"\epoc32\data\Z\resource\apps\musicplayer.r70"
+"\epoc32\data\Z\resource\apps\musicplayer.r76"
+"\epoc32\data\Z\resource\apps\musicplayer.r78"
+"\epoc32\data\Z\resource\apps\musicplayer.r79"
+"\epoc32\data\Z\resource\apps\musicplayer.r83"
+"\epoc32\data\Z\resource\apps\musicplayer.r93"
+"\epoc32\data\Z\resource\apps\musicplayer.r94"
+"\epoc32\data\Z\resource\apps\musicplayer.r96"
+"\epoc32\data\Z\resource\apps\musicplayer.r102"
+"\epoc32\data\Z\resource\apps\musicplayer.r103"
+"\epoc32\data\Z\resource\apps\musicplayer.r129"
+"\epoc32\data\Z\resource\apps\musicplayer.r157"
+"\epoc32\data\Z\resource\apps\musicplayer.r158"
+"\epoc32\data\Z\resource\apps\musicplayer.r159"
+"\epoc32\data\Z\resource\apps\musicplayer.r160"
+"\epoc32\data\Z\resource\apps\musicplayer.r161"
+"\epoc32\data\Z\resource\apps\musicplayer.r326"
+"\epoc32\data\Z\resource\apps\musicplayer.r327"
+} - "!:\resource\apps\musicplayer.rsc"
+
+;If qm files needed add them here.
+;{} - "!:\resource\qt\translations\musicplayer.qm"
+
+; DLLs
+"\epoc32\release\armv5\udeb\mpnowplayingbanner.dll" - "!:\sys\bin\mpnowplayingbanner.dll"
+"\epoc32\release\armv5\udeb\mpsettingsmanager.dll" - "!:\sys\bin\mpsettingsmanager.dll"
+"\epoc32\release\armv5\udeb\mpdata.dll" - "!:\sys\bin\mpdata.dll"
+"\epoc32\release\armv5\udeb\mpengine.dll" - "!:\sys\bin\mpengine.dll"
+"\epoc32\release\armv5\udeb\musicservices.dll" - "!:\sys\bin\musicservices.dll"
+
+; CenRep
+"\epoc32\data\Z\private\10202be9\10207C92.txt" - "!:\private\10202be9\10207C92.txt"
+
+; PLUGIN AND VIEW
+"\epoc32\release\armv5\udeb\mpcollectionviewplugin.dll" - "!:\sys\bin\mpcollectionviewplugin.dll"
+"\epoc32\data\Z\resource\plugins\mpcollectionviewplugin.rsc" - "!:\resource\plugins\mpcollectionviewplugin.rsc"
+
+"\epoc32\release\armv5\udeb\mpplaybackviewplugin.dll" - "!:\sys\bin\mpplaybackviewplugin.dll"
+"\epoc32\data\Z\resource\plugins\mpplaybackviewplugin.rsc" - "!:\resource\plugins\mpplaybackviewplugin.rsc"
+
+"\epoc32\release\armv5\udeb\mpsettingsviewplugin.dll" - "!:\sys\bin\mpsettingsviewplugin.dll"
+"\epoc32\data\Z\resource\plugins\mpsettingsviewplugin.rsc" - "!:\resource\plugins\mpsettingsviewplugin.rsc"
+
+"\epoc32\release\armv5\udeb\mpdetailsviewplugin.dll" - "!:\sys\bin\mpdetailsviewplugin.dll"
+"\epoc32\data\Z\resource\plugins\mpdetailsviewplugin.rsc" - "!:\resource\plugins\mpdetailsviewplugin.rsc"
+
+"\epoc32\release\armv5\udeb\mpmediawallviewplugin.dll" - "!:\sys\bin\mpmediawallviewplugin.dll"
+"\epoc32\data\Z\resource\plugins\mpmediawallviewplugin.rsc" - "!:\resource\plugins\mpmediawallviewplugin.rsc"
+
+; DATA
+"\epoc32\data\Z\system\data\nullsound.mp3" - "!:\system\data\nullsound.mp3"
+
+;MP SERVICE PLUGINGS
+"\epoc32\release\armv5\udeb\mpxaudioeffectengine.dll" -"!:\sys\bin\mpxaudioeffectengine.dll"
+"\epoc32\release\armv5\udeb\mpxlocalaudioplayback.dll" -"!:\sys\bin\mpxlocalaudioplayback.dll"
+"\epoc32\release\armv5\udeb\mpxm3uplaylistparsers.dll" -"!:\sys\bin\mpxm3uplaylistparsers.dll"
+"\epoc32\release\armv5\udeb\mpxm3uplaylistplugin.dll" -"!:\sys\bin\mpxm3uplaylistplugin.dll"
+"\epoc32\release\armv5\udeb\mpxinmemoryplugin.dll" -"!:\sys\bin\mpxinmemoryplugin.dll"
+"\epoc32\release\armv5\udeb\mpxsqlitedbcommon.dll" -"!:\sys\bin\mpxsqlitedbcommon.dll"
+"\epoc32\release\armv5\udeb\mpxsqlitedbhgplugin.dll" -"!:\sys\bin\mpxsqlitedbhgplugin.dll"
+"\epoc32\release\armv5\udeb\mpxsqlitepodcastdbplugin.dll" -"!:\sys\bin\mpxsqlitepodcastdbplugin.dll"
+
+"\epoc32\data\Z\resource\plugins\mpxlocalaudioplayback.rsc" -"!:\resource\plugins\mpxlocalaudioplayback.rsc"
+"\epoc32\data\Z\resource\plugins\mpxm3uplaylistplugin.rsc" -"!:\resource\plugins\mpxm3uplaylistplugin.rsc"
+"\epoc32\data\Z\resource\plugins\mpxinmemoryplugin.rsc" -"!:\resource\plugins\mpxinmemoryplugin.rsc"
+"\epoc32\data\Z\resource\plugins\mpxsqlitedbhgplugin.rsc" -"!:\resource\plugins\mpxsqlitedbhgplugin.rsc"
+"\epoc32\data\Z\resource\apps\mpxcollectiondbhgres.rsc" -"!:\resource\apps\mpxcollectiondbhgres.rsc"
+"\epoc32\data\Z\resource\plugins\mpxsqlitepodcastdbplugin.rsc" -"!:\resource\plugins\mpxsqlitepodcastdbplugin.rsc"
+"\epoc32\data\Z\resource\apps\pcres.rsc" -"!:\resource\apps\pcres.rsc"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sis/musicplayer_urel.pkg Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,244 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies 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, FR, GE, SP, IT, SW, DA, NO, FI, AM, PO, TU, IC, RU, HU, DU, CS, SK, PL, SL, TC, HK, ZH, JA, TH, AR, TL, BG, CA,
+HR, ET, FA, CF, EL, HE, IN, KO, LV, LT, MS, BP, RO, SR, LS, UK, UR, VI, BA, GL, 129, 157, 158, 159, 160, 161, 326, 327
+
+; SIS header: name, uid, version
+#{"musicplayer", "musicplayer", "musicplayer", "musicplayer",
+ "musicplayer", "musicplayer", "musicplayer", "musicplayer",
+ "musicplayer", "musicplayer", "musicplayer", "musicplayer",
+ "musicplayer", "musicplayer", "musicplayer", "musicplayer",
+ "musicplayer", "musicplayer", "musicplayer", "musicplayer",
+ "musicplayer", "musicplayer", "musicplayer", "musicplayer",
+ "musicplayer", "musicplayer", "musicplayer", "musicplayer",
+ "musicplayer", "musicplayer", "musicplayer", "musicplayer",
+ "musicplayer", "musicplayer", "musicplayer", "musicplayer",
+ "musicplayer", "musicplayer", "musicplayer", "musicplayer",
+ "musicplayer", "musicplayer", "musicplayer", "musicplayer",
+ "musicplayer", "musicplayer", "musicplayer", "musicplayer",
+ "musicplayer", "musicplayer", "musicplayer", "musicplayer",
+ "musicplayer", "musicplayer", "musicplayer", "musicplayer",
+ "musicplayer"
+ }, (0x10207C62), 1,0,0, TYPE=SA, RU
+
+; Localised Vendor name
+%{"Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software",
+ "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software",
+ "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software",
+ "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software",
+ "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software",
+ "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software",
+ "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software",
+ "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software",
+ "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software",
+ "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software",
+ "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software",
+ "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software",
+ "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software",
+ "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software", "Nokia, Qt Software",
+ "Nokia, Qt Software"
+ }
+
+; Unique Vendor name
+:"Nokia, Qt Software"
+
+; Dependencies
+[0x101F7961],0,0,0,{
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID"
+ }
+[0x102032BE],0,0,0,{
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID"
+ }
+[0x102752AE],0,0,0,{
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID"
+ }
+[0x1028315F],0,0,0,{
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID", "S60ProductID", "S60ProductID", "S60ProductID",
+ "S60ProductID"
+ }
+
+; Executable and default resource files
+"\epoc32\release\armv5\urel\musicplayer.exe" - "!:\sys\bin\musicplayer.exe"
+"\epoc32\data\z\private\10003a3f\import\apps\musicplayer_reg.rsc" - "!:\private\10003a3f\import\apps\musicplayer_reg.rsc"
+"\epoc32\data\z\resource\apps\musicplayer.mif" - "!:\resource\apps\musicplayer.mif"
+
+; Localized files
+{
+"\epoc32\data\Z\resource\apps\musicplayer.r01"
+"\epoc32\data\Z\resource\apps\musicplayer.r02"
+"\epoc32\data\Z\resource\apps\musicplayer.r03"
+"\epoc32\data\Z\resource\apps\musicplayer.r04"
+"\epoc32\data\Z\resource\apps\musicplayer.r05"
+"\epoc32\data\Z\resource\apps\musicplayer.r06"
+"\epoc32\data\Z\resource\apps\musicplayer.r07"
+"\epoc32\data\Z\resource\apps\musicplayer.r08"
+"\epoc32\data\Z\resource\apps\musicplayer.r09"
+"\epoc32\data\Z\resource\apps\musicplayer.r10"
+"\epoc32\data\Z\resource\apps\musicplayer.r13"
+"\epoc32\data\Z\resource\apps\musicplayer.r14"
+"\epoc32\data\Z\resource\apps\musicplayer.r15"
+"\epoc32\data\Z\resource\apps\musicplayer.r16"
+"\epoc32\data\Z\resource\apps\musicplayer.r17"
+"\epoc32\data\Z\resource\apps\musicplayer.r18"
+"\epoc32\data\Z\resource\apps\musicplayer.r25"
+"\epoc32\data\Z\resource\apps\musicplayer.r26"
+"\epoc32\data\Z\resource\apps\musicplayer.r27"
+"\epoc32\data\Z\resource\apps\musicplayer.r28"
+"\epoc32\data\Z\resource\apps\musicplayer.r29"
+"\epoc32\data\Z\resource\apps\musicplayer.r30"
+"\epoc32\data\Z\resource\apps\musicplayer.r31"
+"\epoc32\data\Z\resource\apps\musicplayer.r32"
+"\epoc32\data\Z\resource\apps\musicplayer.r33"
+"\epoc32\data\Z\resource\apps\musicplayer.r37"
+"\epoc32\data\Z\resource\apps\musicplayer.r39"
+"\epoc32\data\Z\resource\apps\musicplayer.r42"
+"\epoc32\data\Z\resource\apps\musicplayer.r44"
+"\epoc32\data\Z\resource\apps\musicplayer.r45"
+"\epoc32\data\Z\resource\apps\musicplayer.r49"
+"\epoc32\data\Z\resource\apps\musicplayer.r50"
+"\epoc32\data\Z\resource\apps\musicplayer.r51"
+"\epoc32\data\Z\resource\apps\musicplayer.r54"
+"\epoc32\data\Z\resource\apps\musicplayer.r57"
+"\epoc32\data\Z\resource\apps\musicplayer.r59"
+"\epoc32\data\Z\resource\apps\musicplayer.r65"
+"\epoc32\data\Z\resource\apps\musicplayer.r67"
+"\epoc32\data\Z\resource\apps\musicplayer.r68"
+"\epoc32\data\Z\resource\apps\musicplayer.r70"
+"\epoc32\data\Z\resource\apps\musicplayer.r76"
+"\epoc32\data\Z\resource\apps\musicplayer.r78"
+"\epoc32\data\Z\resource\apps\musicplayer.r79"
+"\epoc32\data\Z\resource\apps\musicplayer.r83"
+"\epoc32\data\Z\resource\apps\musicplayer.r93"
+"\epoc32\data\Z\resource\apps\musicplayer.r94"
+"\epoc32\data\Z\resource\apps\musicplayer.r96"
+"\epoc32\data\Z\resource\apps\musicplayer.r102"
+"\epoc32\data\Z\resource\apps\musicplayer.r103"
+"\epoc32\data\Z\resource\apps\musicplayer.r129"
+"\epoc32\data\Z\resource\apps\musicplayer.r157"
+"\epoc32\data\Z\resource\apps\musicplayer.r158"
+"\epoc32\data\Z\resource\apps\musicplayer.r159"
+"\epoc32\data\Z\resource\apps\musicplayer.r160"
+"\epoc32\data\Z\resource\apps\musicplayer.r161"
+"\epoc32\data\Z\resource\apps\musicplayer.r326"
+"\epoc32\data\Z\resource\apps\musicplayer.r327"
+} - "!:\resource\apps\musicplayer.rsc"
+
+;If qm files needed add them here.
+;{} - "!:\resource\qt\translations\musicplayer.qm"
+
+; DLLs
+"\epoc32\release\armv5\urel\mpnowplayingbanner.dll" - "!:\sys\bin\mpnowplayingbanner.dll"
+"\epoc32\release\armv5\urel\mpsettingsmanager.dll" - "!:\sys\bin\mpsettingsmanager.dll"
+"\epoc32\release\armv5\urel\mpdata.dll" - "!:\sys\bin\mpdata.dll"
+"\epoc32\release\armv5\urel\mpengine.dll" - "!:\sys\bin\mpengine.dll"
+"\epoc32\release\armv5\urel\musicservices.dll" - "!:\sys\bin\musicservices.dll"
+
+; CenRep
+"\epoc32\data\Z\private\10202be9\10207C92.txt" - "!:\private\10202be9\10207C92.txt"
+
+; PLUGIN AND VIEW
+"\epoc32\release\armv5\urel\mpcollectionviewplugin.dll" - "!:\sys\bin\mpcollectionviewplugin.dll"
+"\epoc32\data\Z\resource\plugins\mpcollectionviewplugin.rsc" - "!:\resource\plugins\mpcollectionviewplugin.rsc"
+
+"\epoc32\release\armv5\urel\mpplaybackviewplugin.dll" - "!:\sys\bin\mpplaybackviewplugin.dll"
+"\epoc32\data\Z\resource\plugins\mpplaybackviewplugin.rsc" - "!:\resource\plugins\mpplaybackviewplugin.rsc"
+
+"\epoc32\release\armv5\urel\mpsettingsviewplugin.dll" - "!:\sys\bin\mpsettingsviewplugin.dll"
+"\epoc32\data\Z\resource\plugins\mpsettingsviewplugin.rsc" - "!:\resource\plugins\mpsettingsviewplugin.rsc"
+
+"\epoc32\release\armv5\urel\mpdetailsviewplugin.dll" - "!:\sys\bin\mpdetailsviewplugin.dll"
+"\epoc32\data\Z\resource\plugins\mpdetailsviewplugin.rsc" - "!:\resource\plugins\mpdetailsviewplugin.rsc"
+
+"\epoc32\release\armv5\urel\mpmediawallviewplugin.dll" - "!:\sys\bin\mpmediawallviewplugin.dll"
+"\epoc32\data\Z\resource\plugins\mpmediawallviewplugin.rsc" - "!:\resource\plugins\mpmediawallviewplugin.rsc"
+
+; DATA
+"\epoc32\data\Z\system\data\nullsound.mp3" - "!:\system\data\nullsound.mp3"
+
+;MP SERVICE PLUGINGS
+"\epoc32\release\armv5\urel\mpxaudioeffectengine.dll" -"!:\sys\bin\mpxaudioeffectengine.dll"
+"\epoc32\release\armv5\urel\mpxlocalaudioplayback.dll" -"!:\sys\bin\mpxlocalaudioplayback.dll"
+"\epoc32\release\armv5\urel\mpxm3uplaylistparsers.dll" -"!:\sys\bin\mpxm3uplaylistparsers.dll"
+"\epoc32\release\armv5\urel\mpxm3uplaylistplugin.dll" -"!:\sys\bin\mpxm3uplaylistplugin.dll"
+"\epoc32\release\armv5\urel\mpxinmemoryplugin.dll" -"!:\sys\bin\mpxinmemoryplugin.dll"
+"\epoc32\release\armv5\urel\mpxsqlitedbcommon.dll" -"!:\sys\bin\mpxsqlitedbcommon.dll"
+"\epoc32\release\armv5\urel\mpxsqlitedbhgplugin.dll" -"!:\sys\bin\mpxsqlitedbhgplugin.dll"
+"\epoc32\release\armv5\urel\mpxsqlitepodcastdbplugin.dll" -"!:\sys\bin\mpxsqlitepodcastdbplugin.dll"
+
+"\epoc32\data\Z\resource\plugins\mpxlocalaudioplayback.rsc" -"!:\resource\plugins\mpxlocalaudioplayback.rsc"
+"\epoc32\data\Z\resource\plugins\mpxm3uplaylistplugin.rsc" -"!:\resource\plugins\mpxm3uplaylistplugin.rsc"
+"\epoc32\data\Z\resource\plugins\mpxinmemoryplugin.rsc" -"!:\resource\plugins\mpxinmemoryplugin.rsc"
+"\epoc32\data\Z\resource\plugins\mpxsqlitedbhgplugin.rsc" -"!:\resource\plugins\mpxsqlitedbhgplugin.rsc"
+"\epoc32\data\Z\resource\apps\mpxcollectiondbhgres.rsc" -"!:\resource\apps\mpxcollectiondbhgres.rsc"
+"\epoc32\data\Z\resource\plugins\mpxsqlitepodcastdbplugin.rsc" -"!:\resource\plugins\mpxsqlitepodcastdbplugin.rsc"
+"\epoc32\data\Z\resource\apps\pcres.rsc" -"!:\resource\apps\pcres.rsc"
+
--- a/tsrc/mpfetchertestapp/inc/mpfetchertestappview.h Fri May 14 18:54:37 2010 -0500
+++ b/tsrc/mpfetchertestapp/inc/mpfetchertestappview.h Fri May 28 19:46:01 2010 -0500
@@ -40,6 +40,10 @@
void playSong();
void viewSong();
void viewSongCaged();
+ void launchHomeScreen();
+ void launchHomeScreenNowPlaying();
+ void launchHomeScreenNPShuffle();
+
private:
--- a/tsrc/mpfetchertestapp/src/mpfetchertestappview.cpp Fri May 14 18:54:37 2010 -0500
+++ b/tsrc/mpfetchertestapp/src/mpfetchertestappview.cpp Fri May 28 19:46:01 2010 -0500
@@ -132,6 +132,27 @@
connect(viewButton, SIGNAL(clicked()), SLOT(viewSongCaged()));
bottomLayout->addItem(viewButton);
}
+
+ HbPushButton* homeScreenButton = new HbPushButton("HS Widget MainView");
+ if (homeScreenButton)
+ {
+ connect(homeScreenButton, SIGNAL(clicked()), SLOT(launchHomeScreen()));
+ bottomLayout->addItem(homeScreenButton);
+ }
+
+ HbPushButton* homeScreenButtonNPV = new HbPushButton("HS Widget NowPlayingView");
+ if (homeScreenButtonNPV)
+ {
+ connect(homeScreenButtonNPV, SIGNAL(clicked()), SLOT(launchHomeScreenNowPlaying()));
+ bottomLayout->addItem(homeScreenButtonNPV);
+ }
+
+ HbPushButton* homeScreenButtonNPVS = new HbPushButton("HS Widget NPV Shuffle");
+ if (homeScreenButtonNPVS)
+ {
+ connect(homeScreenButtonNPVS, SIGNAL(clicked()), SLOT(launchHomeScreenNPShuffle()));
+ bottomLayout->addItem(homeScreenButtonNPVS);
+ }
layout->addItem(bottomLayout);
}
@@ -326,3 +347,93 @@
}
+
+void MpFetcherTestAppView::launchHomeScreen()
+{
+ QUrl url;
+
+ url.setUrl("appto://10207C62?activityname=MusicMainView&launchtype=standalone");
+ if(mReq){
+ delete mReq;
+ mReq = 0;
+ }
+ mReq = mAppMgr.create(url);
+ if (mReq == NULL)
+ {
+ // No handlers for the URI
+ return;
+ }
+
+ mReq->setBackground(false);
+
+ // Send the request
+ bool res = mReq->send();
+ if (!res)
+ {
+ // Request failed.
+ int error = mReq->lastError();
+
+ // Handle error
+ }
+
+}
+
+void MpFetcherTestAppView::launchHomeScreenNowPlaying()
+{
+ QUrl url;
+
+ url.setUrl("appto://10207C62?activityname=MusicNowPlayingView&launchtype=standalone");
+ if(mReq){
+ delete mReq;
+ mReq = 0;
+ }
+ mReq = mAppMgr.create(url);
+ if (mReq == NULL)
+ {
+ // No handlers for the URI
+ return;
+ }
+
+ mReq->setBackground(false);
+
+ // Send the request
+ bool res = mReq->send();
+ if (!res)
+ {
+ // Request failed.
+ int error = mReq->lastError();
+
+ // Handle error
+ }
+
+}
+
+void MpFetcherTestAppView::launchHomeScreenNPShuffle()
+{
+ QUrl url;
+
+ url.setUrl("appto://10207C62?activityname=MusicNowPlayingView&launchtype=standalone&shuffle=yes");
+ if(mReq){
+ delete mReq;
+ mReq = 0;
+ }
+ mReq = mAppMgr.create(url);
+ if (mReq == NULL)
+ {
+ // No handlers for the URI
+ return;
+ }
+
+ mReq->setBackground(false);
+
+ // Send the request
+ bool res = mReq->send();
+ if (!res)
+ {
+ // Request failed.
+ int error = mReq->lastError();
+
+ // Handle error
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/tsrc.pro Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,27 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies 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 = subdirs
+
+SUBDIRS += ..\mpdata\tsrc
+SUBDIRS += ..\mpengine\tsrc
+SUBDIRS += ..\mpviewplugins\mpcollectionviewplugin\tsrc
+SUBDIRS += ..\mpviewplugins\mpmediawallviewplugin\tsrc
+SUBDIRS += ..\mpviewplugins\mpplaybackviewplugin\tsrc
+SUBDIRS += ..\mpviewplugins\mpsettingsviewplugin\tsrc
+SUBDIRS += ..\utilities\mpnowplayingbanner\tsrc
+SUBDIRS += ..\utilities\mpsettingsmanager\tsrc
+
--- a/utilities/mpnowplayingbanner/bwins/mpnowplayingbanneru.def Fri May 14 18:54:37 2010 -0500
+++ b/utilities/mpnowplayingbanner/bwins/mpnowplayingbanneru.def Fri May 28 19:46:01 2010 -0500
@@ -1,21 +1,22 @@
EXPORTS
?qt_metacall@MpNowPlayingWidget@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1 NONAME ; int MpNowPlayingWidget::qt_metacall(enum QMetaObject::Call, int, void * *)
- ?resizeEvent@MpNowPlayingWidget@@UAEXPAVQGraphicsSceneResizeEvent@@@Z @ 2 NONAME ; void MpNowPlayingWidget::resizeEvent(class QGraphicsSceneResizeEvent *)
- ??0MpNowPlayingWidget@@QAE@JPAVQGraphicsItem@@@Z @ 3 NONAME ; MpNowPlayingWidget::MpNowPlayingWidget(long, class QGraphicsItem *)
- ?mousePressEvent@MpNowPlayingWidget@@EAEXPAVQGraphicsSceneMouseEvent@@@Z @ 4 NONAME ; void MpNowPlayingWidget::mousePressEvent(class QGraphicsSceneMouseEvent *)
- ?trUtf8@MpNowPlayingWidget@@SA?AVQString@@PBD0@Z @ 5 NONAME ; class QString MpNowPlayingWidget::trUtf8(char const *, char const *)
- ?playbackAttachmentChanged@MpNowPlayingWidget@@IAEX_N@Z @ 6 NONAME ; void MpNowPlayingWidget::playbackAttachmentChanged(bool)
- ?staticMetaObject@MpNowPlayingWidget@@2UQMetaObject@@B @ 7 NONAME ; struct QMetaObject const MpNowPlayingWidget::staticMetaObject
- ??_EMpNowPlayingWidget@@UAE@I@Z @ 8 NONAME ; MpNowPlayingWidget::~MpNowPlayingWidget(unsigned int)
- ?mouseMoveEvent@MpNowPlayingWidget@@EAEXPAVQGraphicsSceneMouseEvent@@@Z @ 9 NONAME ; void MpNowPlayingWidget::mouseMoveEvent(class QGraphicsSceneMouseEvent *)
- ?trUtf8@MpNowPlayingWidget@@SA?AVQString@@PBD0H@Z @ 10 NONAME ; class QString MpNowPlayingWidget::trUtf8(char const *, char const *, int)
- ?clicked@MpNowPlayingWidget@@IAEXXZ @ 11 NONAME ; void MpNowPlayingWidget::clicked(void)
- ?qt_metacast@MpNowPlayingWidget@@UAEPAXPBD@Z @ 12 NONAME ; void * MpNowPlayingWidget::qt_metacast(char const *)
- ?setEnabled@MpNowPlayingWidget@@QAEX_N@Z @ 13 NONAME ; void MpNowPlayingWidget::setEnabled(bool)
- ?metaObject@MpNowPlayingWidget@@UBEPBUQMetaObject@@XZ @ 14 NONAME ; struct QMetaObject const * MpNowPlayingWidget::metaObject(void) const
- ?getStaticMetaObject@MpNowPlayingWidget@@SAABUQMetaObject@@XZ @ 15 NONAME ; struct QMetaObject const & MpNowPlayingWidget::getStaticMetaObject(void)
- ?tr@MpNowPlayingWidget@@SA?AVQString@@PBD0@Z @ 16 NONAME ; class QString MpNowPlayingWidget::tr(char const *, char const *)
- ?tr@MpNowPlayingWidget@@SA?AVQString@@PBD0H@Z @ 17 NONAME ; class QString MpNowPlayingWidget::tr(char const *, char const *, int)
- ?mouseReleaseEvent@MpNowPlayingWidget@@EAEXPAVQGraphicsSceneMouseEvent@@@Z @ 18 NONAME ; void MpNowPlayingWidget::mouseReleaseEvent(class QGraphicsSceneMouseEvent *)
- ??1MpNowPlayingWidget@@UAE@XZ @ 19 NONAME ; MpNowPlayingWidget::~MpNowPlayingWidget(void)
+ ?trUtf8@MpNowPlayingWidget@@SA?AVQString@@PBD0H@Z @ 2 NONAME ; class QString MpNowPlayingWidget::trUtf8(char const *, char const *, int)
+ ??0MpNowPlayingWidget@@QAE@PAVQGraphicsItem@@@Z @ 3 NONAME ; MpNowPlayingWidget::MpNowPlayingWidget(class QGraphicsItem *)
+ ?resizeEvent@MpNowPlayingWidget@@UAEXPAVQGraphicsSceneResizeEvent@@@Z @ 4 NONAME ; void MpNowPlayingWidget::resizeEvent(class QGraphicsSceneResizeEvent *)
+ ?qt_metacast@MpNowPlayingWidget@@UAEPAXPBD@Z @ 5 NONAME ; void * MpNowPlayingWidget::qt_metacast(char const *)
+ ?clicked@MpNowPlayingWidget@@IAEXXZ @ 6 NONAME ; void MpNowPlayingWidget::clicked(void)
+ ?setEnabled@MpNowPlayingWidget@@QAEX_N@Z @ 7 NONAME ; void MpNowPlayingWidget::setEnabled(bool)
+ ?mousePressEvent@MpNowPlayingWidget@@EAEXPAVQGraphicsSceneMouseEvent@@@Z @ 8 NONAME ; void MpNowPlayingWidget::mousePressEvent(class QGraphicsSceneMouseEvent *)
+ ?metaObject@MpNowPlayingWidget@@UBEPBUQMetaObject@@XZ @ 9 NONAME ; struct QMetaObject const * MpNowPlayingWidget::metaObject(void) const
+ ?tr@MpNowPlayingWidget@@SA?AVQString@@PBD0H@Z @ 10 NONAME ; class QString MpNowPlayingWidget::tr(char const *, char const *, int)
+ ?tr@MpNowPlayingWidget@@SA?AVQString@@PBD0@Z @ 11 NONAME ; class QString MpNowPlayingWidget::tr(char const *, char const *)
+ ?getStaticMetaObject@MpNowPlayingWidget@@SAABUQMetaObject@@XZ @ 12 NONAME ; struct QMetaObject const & MpNowPlayingWidget::getStaticMetaObject(void)
+ ?trUtf8@MpNowPlayingWidget@@SA?AVQString@@PBD0@Z @ 13 NONAME ; class QString MpNowPlayingWidget::trUtf8(char const *, char const *)
+ ??1MpNowPlayingWidget@@UAE@XZ @ 14 NONAME ; MpNowPlayingWidget::~MpNowPlayingWidget(void)
+ ?mouseReleaseEvent@MpNowPlayingWidget@@EAEXPAVQGraphicsSceneMouseEvent@@@Z @ 15 NONAME ; void MpNowPlayingWidget::mouseReleaseEvent(class QGraphicsSceneMouseEvent *)
+ ?isBannerAttached@MpNowPlayingWidget@@QAE_NXZ @ 16 NONAME ; bool MpNowPlayingWidget::isBannerAttached(void)
+ ?playbackAttachmentChanged@MpNowPlayingWidget@@IAEX_N@Z @ 17 NONAME ; void MpNowPlayingWidget::playbackAttachmentChanged(bool)
+ ?staticMetaObject@MpNowPlayingWidget@@2UQMetaObject@@B @ 18 NONAME ; struct QMetaObject const MpNowPlayingWidget::staticMetaObject
+ ??_EMpNowPlayingWidget@@UAE@I@Z @ 19 NONAME ; MpNowPlayingWidget::~MpNowPlayingWidget(unsigned int)
+ ?mouseMoveEvent@MpNowPlayingWidget@@EAEXPAVQGraphicsSceneMouseEvent@@@Z @ 20 NONAME ; void MpNowPlayingWidget::mouseMoveEvent(class QGraphicsSceneMouseEvent *)
--- a/utilities/mpnowplayingbanner/eabi/mpnowplayingbanneru.def Fri May 14 18:54:37 2010 -0500
+++ b/utilities/mpnowplayingbanner/eabi/mpnowplayingbanneru.def Fri May 28 19:46:01 2010 -0500
@@ -5,24 +5,25 @@
_ZN18MpNowPlayingWidget11resizeEventEP25QGraphicsSceneResizeEvent @ 4 NONAME
_ZN18MpNowPlayingWidget14mouseMoveEventEP24QGraphicsSceneMouseEvent @ 5 NONAME
_ZN18MpNowPlayingWidget15mousePressEventEP24QGraphicsSceneMouseEvent @ 6 NONAME
- _ZN18MpNowPlayingWidget16staticMetaObjectE @ 7 NONAME DATA 16
- _ZN18MpNowPlayingWidget17mouseReleaseEventEP24QGraphicsSceneMouseEvent @ 8 NONAME
- _ZN18MpNowPlayingWidget19getStaticMetaObjectEv @ 9 NONAME
- _ZN18MpNowPlayingWidget25playbackAttachmentChangedEb @ 10 NONAME
- _ZN18MpNowPlayingWidget7clickedEv @ 11 NONAME
- _ZN18MpNowPlayingWidgetC1ElP13QGraphicsItem @ 12 NONAME
- _ZN18MpNowPlayingWidgetC2ElP13QGraphicsItem @ 13 NONAME
- _ZN18MpNowPlayingWidgetD0Ev @ 14 NONAME
- _ZN18MpNowPlayingWidgetD1Ev @ 15 NONAME
- _ZN18MpNowPlayingWidgetD2Ev @ 16 NONAME
- _ZNK18MpNowPlayingWidget10metaObjectEv @ 17 NONAME
- _ZTI18MpNowPlayingWidget @ 18 NONAME
- _ZTV18MpNowPlayingWidget @ 19 NONAME
- _ZThn16_N18MpNowPlayingWidgetD0Ev @ 20 NONAME
- _ZThn16_N18MpNowPlayingWidgetD1Ev @ 21 NONAME
- _ZThn8_N18MpNowPlayingWidget14mouseMoveEventEP24QGraphicsSceneMouseEvent @ 22 NONAME
- _ZThn8_N18MpNowPlayingWidget15mousePressEventEP24QGraphicsSceneMouseEvent @ 23 NONAME
- _ZThn8_N18MpNowPlayingWidget17mouseReleaseEventEP24QGraphicsSceneMouseEvent @ 24 NONAME
- _ZThn8_N18MpNowPlayingWidgetD0Ev @ 25 NONAME
- _ZThn8_N18MpNowPlayingWidgetD1Ev @ 26 NONAME
+ _ZN18MpNowPlayingWidget16isBannerAttachedEv @ 7 NONAME
+ _ZN18MpNowPlayingWidget16staticMetaObjectE @ 8 NONAME DATA 16
+ _ZN18MpNowPlayingWidget17mouseReleaseEventEP24QGraphicsSceneMouseEvent @ 9 NONAME
+ _ZN18MpNowPlayingWidget19getStaticMetaObjectEv @ 10 NONAME
+ _ZN18MpNowPlayingWidget25playbackAttachmentChangedEb @ 11 NONAME
+ _ZN18MpNowPlayingWidget7clickedEv @ 12 NONAME
+ _ZN18MpNowPlayingWidgetC1EP13QGraphicsItem @ 13 NONAME
+ _ZN18MpNowPlayingWidgetC2EP13QGraphicsItem @ 14 NONAME
+ _ZN18MpNowPlayingWidgetD0Ev @ 15 NONAME
+ _ZN18MpNowPlayingWidgetD1Ev @ 16 NONAME
+ _ZN18MpNowPlayingWidgetD2Ev @ 17 NONAME
+ _ZNK18MpNowPlayingWidget10metaObjectEv @ 18 NONAME
+ _ZTI18MpNowPlayingWidget @ 19 NONAME
+ _ZTV18MpNowPlayingWidget @ 20 NONAME
+ _ZThn16_N18MpNowPlayingWidgetD0Ev @ 21 NONAME
+ _ZThn16_N18MpNowPlayingWidgetD1Ev @ 22 NONAME
+ _ZThn8_N18MpNowPlayingWidget14mouseMoveEventEP24QGraphicsSceneMouseEvent @ 23 NONAME
+ _ZThn8_N18MpNowPlayingWidget15mousePressEventEP24QGraphicsSceneMouseEvent @ 24 NONAME
+ _ZThn8_N18MpNowPlayingWidget17mouseReleaseEventEP24QGraphicsSceneMouseEvent @ 25 NONAME
+ _ZThn8_N18MpNowPlayingWidgetD0Ev @ 26 NONAME
+ _ZThn8_N18MpNowPlayingWidgetD1Ev @ 27 NONAME
--- a/utilities/mpnowplayingbanner/inc/mpnowplayingbackend.h Fri May 14 18:54:37 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +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: Music Player now playing widget backend.
-*
-*/
-
-#ifndef MPNOWPLAYINGBACKEND_H
-#define MPNOWPLAYINGBACKEND_H
-
-//includes
-#include <QObject>
-#include <QMetaType>
-
-//forward declartions
-class MpNowPlayingBackEndPrivate;
-
-enum SimplifiedPlayerState {
- NotPlaying, //When there is no source
- Playing, //When it is playing
- Paused //When is not in Playing State
-};
-// Register so type can be used in signal and slot connection
-Q_DECLARE_METATYPE(SimplifiedPlayerState)
-
-//class declaration
-class MpNowPlayingBackEnd : public QObject
-{
- Q_OBJECT
- friend class MpNowPlayingBackEndPrivate;
-
-public:
- explicit MpNowPlayingBackEnd( long int playerId = 0 );
- virtual ~MpNowPlayingBackEnd();
-
-signals:
- void stateUpdate( SimplifiedPlayerState state );
- void titleChanged( const QString &text );
- void artistChanged( const QString &text );
-
-public slots:
- void update();
- void playPause();
-
-private:
- Q_DISABLE_COPY(MpNowPlayingBackEnd)
- MpNowPlayingBackEndPrivate * const d_ptr;
-
-};
-
-#endif // MPNOWPLAYINGBACKEND_H
--- a/utilities/mpnowplayingbanner/inc/mpnowplayingbackend_p.h Fri May 14 18:54:37 2010 -0500
+++ /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: Music Player now playing widget backend - Private.
-*
-*/
-
-#ifndef MPNOWPLAYINGBACKEND_P_H
-#define MPNOWPLAYINGBACKEND_P_H
-
-#include <mpxplaybackobserver.h>
-#include "mpnowplayingbackend.h"
-
-
-//forward declartions
-class MMPXPlaybackUtility;
-
-//class declaration
-class MpNowPlayingBackEndPrivate : public MMPXPlaybackObserver,
- public MMPXPlaybackCallback
-{
-
-public:
- explicit MpNowPlayingBackEndPrivate(long int playerId,
- MpNowPlayingBackEnd *qq);
- virtual ~MpNowPlayingBackEndPrivate();
-
- void update();
- void playPause();
-
-public: //from MMPXPlaybackObserver
- void HandlePlaybackMessage( CMPXMessage* aMessage, TInt aError );
-
-public: //from MMPXPlaybackCallback
- void HandlePropertyL( TMPXPlaybackProperty aProperty,
- TInt aValue,
- TInt aError);
- void HandleSubPlayerNamesL( TUid aPlayer,
- const MDesCArray* aSubPlayers,
- TBool aComplete,
- TInt aError );
- void HandleMediaL( const CMPXMedia& aProperties, TInt aError );
-
-private:
- void RequestMediaL();
- void UpdateStateL();
- void DoPlayPauseL();
- void DoHandlePlaybackMessageL( const CMPXMessage& message );
-
-private:
- MpNowPlayingBackEnd *q_ptr; // not owned
- SimplifiedPlayerState mPreviousState;
- MMPXPlaybackUtility *mPlaybackUtility; // owned
-};
-
-#endif // MPNOWPLAYINGBACKEND_P_H
--- a/utilities/mpnowplayingbanner/inc/mpnowplayingwidget_p.h Fri May 14 18:54:37 2010 -0500
+++ b/utilities/mpnowplayingbanner/inc/mpnowplayingwidget_p.h Fri May 28 19:46:01 2010 -0500
@@ -23,12 +23,12 @@
#include <hbwidget.h>
#include "mpnowplayingwidget.h"
-#include "mpnowplayingbackend.h"
+#include "mpplaybackdata.h"
//forward declartions
class HbIconItem;
class HbLabel;
-class MpNowPlayingBackEnd;
+class MpEngine;
class QGraphicsSceneMouseEvent;
class HbIcon;
class HbDocumentLoader;
@@ -46,35 +46,36 @@
};
public:
- explicit MpNowPlayingWidgetPrivate( long int playerId,
- MpNowPlayingWidget *qq );
+ explicit MpNowPlayingWidgetPrivate( MpNowPlayingWidget *qq );
virtual ~MpNowPlayingWidgetPrivate();
void setEnabled( bool enabled );
+ bool isBannerAttached();
bool handleClickEvent( QGraphicsSceneMouseEvent *event );
void handleMousePressEvent( QGraphicsSceneMouseEvent *event, bool pressed );
void handleMouseMoveEvent( QGraphicsSceneMouseEvent *event );
public slots:
- void setState( SimplifiedPlayerState state );
- void setTitle( const QString &title );
- void setArtist( const QString &artist );
+ void setState();
+ void updateBannerInfo();
+
private:
- MpNowPlayingWidget *q_ptr;
- HbLabel *mPrimaryText;
- HbLabel *mSecondaryText;
- SimplifiedPlayerState mState;
- MpNowPlayingBackEnd *mBackEnd;
+ MpNowPlayingWidget *q_ptr;
+ HbLabel *mPrimaryText;
+ HbLabel *mSecondaryText;
+ MpPlaybackData::SimplifiedState mState;
+ MpPlaybackData *mPlaybackData;
+ MpEngine *mMpEngine;
- HbIcon *mPlayIcon;
- HbIcon *mPauseIcon;
- HbLabel *mIcon;
+ HbIcon *mPlayIcon;
+ HbIcon *mPauseIcon;
+ HbLabel *mIcon;
- HbDocumentLoader *mDocumentLoader;
+ HbDocumentLoader *mDocumentLoader;
- BannerPressedState mCurrentPressedState;
+ BannerPressedState mCurrentPressedState;
};
--- a/utilities/mpnowplayingbanner/mpnowplayingbanner.pro Fri May 14 18:54:37 2010 -0500
+++ b/utilities/mpnowplayingbanner/mpnowplayingbanner.pro Fri May 28 19:46:01 2010 -0500
@@ -28,20 +28,18 @@
../../inc
INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
-LIBS += -lmpxplaybackutility.dll \
+LIBS += -lmpengine \
+ -lmpdata.dll \
-lmpxcommon.dll
symbian:TARGET.EPOCALLOWDLLDATA = 1
HEADERS = ../../inc/mpnowplayingwidget.h \
- inc/mpnowplayingbackend.h \
- inc/mpnowplayingwidget_p.h \
- inc/mpnowplayingbackend_p.h
+ inc/mpnowplayingwidget_p.h
SOURCES += src/mpnowplayingwidget.cpp \
src/mpnowplayingwidget_p.cpp \
- src/mpnowplayingbackend.cpp \
- src/mpnowplayingbackend_p.cpp
+
RESOURCES += resources/mpnowplayingbanner.qrc
--- a/utilities/mpnowplayingbanner/src/mpnowplayingbackend.cpp Fri May 14 18:54:37 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +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: Music Player now playing widget backend.
-*
-*/
-
-#include "mpnowplayingbackend.h"
-#include "mpnowplayingbackend_p.h"
-#include "mptrace.h"
-
-/*!
- \internal
- \class MpNowPlayingBackEnd
- \brief Wraps the playback utility and provides separation for QT and Symbian code.
-
- This class wraps the playback utility on the MPX Framework to provide a simple
- interface and separation of QT and Symbian code.
-*/
-
-/*!
- \internal
- \fn MpNowPlayingBackEnd::stateUpdate( SimplifiedPlayerState state )
-
- MpNowPlayingBackEndPrivate emits this signal when the simplified playback
- state changes.
-*/
-
-/*!
- \internal
- \fn MpNowPlayingBackEnd::titleChanged( const QString &text )
-
- MpNowPlayingBackEndPrivate emits this signal when there is a new song
- playing and the title becomes available.
-*/
-
-/*!
- \internal
- \fn MpNowPlayingBackEnd::artistChanged( const QString &text )
-
- MpNowPlayingBackEndPrivate emits this signal when there is a new song
- playing and the artist name becomes available.
-*/
-
-/*!
- \internal
- \enum SimplifiedPlayerState
-
- This enum defines a set of simplified playback states.
- */
-
-/*!
- \internal
- Constructs the now playing back end.
- */
-MpNowPlayingBackEnd::MpNowPlayingBackEnd( long int playerId )
- :d_ptr( new MpNowPlayingBackEndPrivate( playerId, this ) )
-{
- TX_ENTRY_ARGS( "Player ID =" << playerId )
- TX_EXIT
-}
-
-/*!
- \internal
- Destructs the now playing back end.
- */
-MpNowPlayingBackEnd::~MpNowPlayingBackEnd()
-{
- TX_ENTRY
- delete d_ptr;
- TX_EXIT
-}
-
-/*!
- \internal
- Updates the widget with the latest playback information.
- */
-void MpNowPlayingBackEnd::update()
-{
- TX_ENTRY
- d_ptr->update();
- TX_EXIT
-}
-
-
-/*!
- \internal
- Sends a play/pause command.
- */
-void MpNowPlayingBackEnd::playPause()
-{
- TX_ENTRY
- d_ptr->playPause();
- TX_EXIT
-}
--- a/utilities/mpnowplayingbanner/src/mpnowplayingbackend_p.cpp Fri May 14 18:54:37 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,294 +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: Music Player now playing widget backend - Private.
-*
-*/
-
-#include <mpxplaybackutility.h>
-#include <mpxplaybackframeworkdefs.h>
-#include <mpxmediageneraldefs.h>
-#include <mpxmediamusicdefs.h>
-#include <mpxcommandgeneraldefs.h>
-#include <mpxplaybackmessage.h>
-#include <mpxmessagegeneraldefs.h>
-#include <mpxplaybackmessagedefs.h>
-
-#include <QString>
-
-#include "mpnowplayingbackend_p.h"
-#include "mptrace.h"
-
-/*!
- \internal
- \class MpNowPlayingBackEndPrivate
- \brief Wraps the playback utility and provides separation for QT and Symbian code.
-
- This class wraps the playback utility on the MPX Framework to provide a simple
- interface and separation of QT and Symbian code.
-*/
-
-
-/*!
- \internal
- Constructs the now playing back end private.
- */
-MpNowPlayingBackEndPrivate::MpNowPlayingBackEndPrivate( long int playerId, MpNowPlayingBackEnd *qq )
- : q_ptr( qq ),
- mPreviousState( NotPlaying ),
- mPlaybackUtility(0)
-{
- TX_ENTRY_ARGS( "Player ID =" << playerId << " Q pointer=" << ( void * )qq )
- if ( !playerId ) {
- playerId = KPbModeDefault.iUid;
- }
- TRAPD( errCode,
- mPlaybackUtility = MMPXPlaybackUtility::UtilityL( TUid::Uid( playerId ) );
- mPlaybackUtility->AddObserverL( *this );
- );
-
- if( KErrNone != errCode && mPlaybackUtility ) {
- mPlaybackUtility->Close();
- mPlaybackUtility = 0;
- }
- TX_EXIT
-}
-
-/*!
- \internal
- Destructs the now playing back end private.
- */
-MpNowPlayingBackEndPrivate::~MpNowPlayingBackEndPrivate()
-{
- TX_ENTRY
- if ( mPlaybackUtility ) {
- TRAP_IGNORE( mPlaybackUtility->RemoveObserverL( *this ) );
- mPlaybackUtility->Close();
- }
- TX_EXIT
-}
-
-/*!
- \internal
- Updates the widget with the latest playback information.
- */
-void MpNowPlayingBackEndPrivate::update()
-{
- TX_ENTRY
- TRAPD( errCode, UpdateStateL() );
- if ( KErrNone == errCode ) {
- TRAP_IGNORE( RequestMediaL() );
- }
- TX_EXIT
-}
-
-/*!
- \internal
- Sends a play/pause command.
- */
-void MpNowPlayingBackEndPrivate::playPause()
-{
- TX_ENTRY
- TRAPD(err, DoPlayPauseL());
- if ( err != KErrNone ) {
- TX_LOG_ARGS("Error: " << err << "; should never get here.");
- }
- TX_EXIT
-}
-
-/*!
- \internal
- Callback function from MMPXPlaybackObserver.
- \sa DoHandlePlaybackMessageL()
- */
-void MpNowPlayingBackEndPrivate::HandlePlaybackMessage(
- CMPXMessage* aMessage,
- TInt aError )
-{
- TX_ENTRY
- if ( aError == KErrNone && aMessage ) {
- TRAP_IGNORE( DoHandlePlaybackMessageL( *aMessage ) );
- }
- TX_EXIT
-}
-
-/*!
- \internal
- Callback function from MMPXPlaybackObserver.
- */
-void MpNowPlayingBackEndPrivate::HandlePropertyL( TMPXPlaybackProperty aProperty,
- TInt aValue, TInt aError)
-{
- // Nothing to do.
- Q_UNUSED(aProperty);
- Q_UNUSED(aValue);
- Q_UNUSED(aError);
-}
-
-/*!
- \internal
- Callback function from MMPXPlaybackObserver.
- */
-void MpNowPlayingBackEndPrivate::HandleSubPlayerNamesL( TUid aPlayer,
- const MDesCArray* aSubPlayers, TBool aComplete, TInt aError )
-{
- // Nothing to do.
- Q_UNUSED(aPlayer);
- Q_UNUSED(aSubPlayers);
- Q_UNUSED(aComplete);
- Q_UNUSED(aError);
-}
-
-/*!
- \internal
- Callback function from MMPXPlaybackCallback.
- */
-void MpNowPlayingBackEndPrivate::HandleMediaL(
- const CMPXMedia& aMedia,
- TInt aError )
-{
- TX_ENTRY
- if( KErrNone != aError || mPreviousState == NotPlaying ) {
- TX_EXIT
- return;
- }
-
- if( aMedia.IsSupported( KMPXMediaGeneralTitle ) ) {
- emit q_ptr->titleChanged(
- QString::fromUtf16( aMedia.ValueText( KMPXMediaGeneralTitle ).Ptr(),
- aMedia.ValueText( KMPXMediaGeneralTitle ).Length() ) );
- }
- else if (aMedia.IsSupported( KMPXMediaGeneralUri )) {
- TParsePtrC filePath( aMedia.ValueText( KMPXMediaGeneralUri ) );
- emit q_ptr->titleChanged(
- QString::fromUtf16( filePath.Name().Ptr(),
- filePath.Name().Length() ) );
- }
- else {
- emit q_ptr->titleChanged( QString() );
- }
-
- if( aMedia.IsSupported( KMPXMediaMusicArtist ) ) {
- emit q_ptr->artistChanged(
- QString::fromUtf16( aMedia.ValueText( KMPXMediaMusicArtist ).Ptr(),
- aMedia.ValueText( KMPXMediaMusicArtist ).Length() ) );
- }
- else {
- emit q_ptr->artistChanged( QString() );
- }
- TX_EXIT
-}
-
-/*!
- \internal
- Leaving function to request Media.
- \sa HandleMediaL()
- */
-void MpNowPlayingBackEndPrivate::RequestMediaL()
-{
- TX_ENTRY
- MMPXSource* mediaSrc = mPlaybackUtility->Source();
- User::LeaveIfNull( mediaSrc );
- RArray<TMPXAttribute> requestedAttr;
- CleanupClosePushL( requestedAttr );
- requestedAttr.AppendL( TMPXAttribute( KMPXMediaGeneralTitle ) );
- requestedAttr.AppendL( TMPXAttribute( KMPXMediaMusicArtist ) );
- requestedAttr.AppendL( TMPXAttribute( KMPXMediaGeneralUri ) );
- mediaSrc->MediaL( requestedAttr.Array(), *this );
- CleanupStack::PopAndDestroy( &requestedAttr );
- TX_EXIT
-}
-
-/*!
- \internal
- Leaving function to update the playback state.
- */
-void MpNowPlayingBackEndPrivate::UpdateStateL()
-{
- TX_ENTRY
- if ( !mPlaybackUtility->Source() ) {
- TX_LOG_ARGS( "NotPlaying" )
- mPreviousState = NotPlaying;
- emit q_ptr->stateUpdate( NotPlaying );
-
- }
- else {
- TMPXPlaybackState state = mPlaybackUtility->StateL();
- switch ( state ) {
- case EPbStatePlaying:
- if ( mPreviousState != Playing ) {
- TX_LOG_ARGS( "Playing" )
- emit q_ptr->stateUpdate( Playing );
- }
- mPreviousState = Playing;
- break;
- case EPbStatePaused:
- case EPbStateStopped: //reinterpreting stop as a pause
- TX_LOG_ARGS("EPbStatePaused or PbStateStopped")
- if (mPreviousState != Paused){
- TX_LOG_ARGS( "Paused" )
- emit q_ptr->stateUpdate( Paused );
- }
- mPreviousState = Paused;
- break;
- default:
- //Ignore other states.
- break;
- }
- }
- TX_EXIT
-}
-
-/*!
- \internal
- Leaving function to send play/pause command.
- */
-void MpNowPlayingBackEndPrivate::DoPlayPauseL()
-{
- mPlaybackUtility->CommandL( EPbCmdPlayPause );
-}
-
-/*!
- \internal
- Leaving function to handle the playback /a message.
- \sa HandlePlaybackMessageL()
- */
-void MpNowPlayingBackEndPrivate::DoHandlePlaybackMessageL(
- const CMPXMessage& message )
-{
- TX_ENTRY
- TMPXMessageId id( message.ValueTObjectL<TMPXMessageId>( KMPXMessageGeneralId ) );
- if ( KMPXMessageGeneral == id ) {
- switch ( message.ValueTObjectL<TInt>( KMPXMessageGeneralEvent ) ) {
- case TMPXPlaybackMessage::EStateChanged:
- TX_LOG_ARGS( "EStateChanged" )
- UpdateStateL();
- break;
- case TMPXPlaybackMessage::EMediaChanged:
- TX_LOG_ARGS( "EMediaChanged or fall through from EPlaylistUpdated" )
- RequestMediaL();
- break;
- case TMPXPlaybackMessage::EPlaylistUpdated:
- TX_LOG_ARGS( "EPlaylistUpdated" )
- case TMPXPlaybackMessage::EActivePlayerChanged:
- TX_LOG_ARGS( "EActivePlayerChanged or fall through from EPlaylistUpdated" )
- UpdateStateL();
- RequestMediaL();
- break;
- default:
- TX_LOG_ARGS( "unhandled case:" << message.ValueTObjectL<TInt>( KMPXMessageGeneralEvent ) << "see TMPXPlaybackMessage" )
- break;
- }
- }
- TX_EXIT
-}
--- a/utilities/mpnowplayingbanner/src/mpnowplayingwidget.cpp Fri May 14 18:54:37 2010 -0500
+++ b/utilities/mpnowplayingbanner/src/mpnowplayingwidget.cpp Fri May 28 19:46:01 2010 -0500
@@ -56,12 +56,12 @@
/*!
Constructs the now playing widget.
*/
-MpNowPlayingWidget::MpNowPlayingWidget(long int playerId, QGraphicsItem *parent )
+MpNowPlayingWidget::MpNowPlayingWidget( QGraphicsItem *parent )
: HbWidget(parent),
- d_ptr ( new MpNowPlayingWidgetPrivate( playerId, this ) ),
+ d_ptr ( new MpNowPlayingWidgetPrivate( this ) ),
mFrameItem(0)
{
- TX_ENTRY_ARGS( "Player ID =" << playerId << " Parent=" << (void *)parent )
+ TX_ENTRY_ARGS( " Parent=" << (void *)parent )
TX_EXIT
mFrameItem = new HbFrameItem( this );
mFrameItem->frameDrawer().setFrameType( HbFrameDrawer::NinePieces );
@@ -102,6 +102,14 @@
}
/*!
+ Returns if banner is attached or not
+ */
+bool MpNowPlayingWidget::isBannerAttached()
+{
+ TX_ENTRY
+ return d_ptr->isBannerAttached();
+}
+/*!
\reimp
*/
void MpNowPlayingWidget::mousePressEvent( QGraphicsSceneMouseEvent *event )
--- a/utilities/mpnowplayingbanner/src/mpnowplayingwidget_p.cpp Fri May 14 18:54:37 2010 -0500
+++ b/utilities/mpnowplayingbanner/src/mpnowplayingwidget_p.cpp Fri May 28 19:46:01 2010 -0500
@@ -23,12 +23,11 @@
#include <hbiconitem.h>
#include <hbdocumentloader.h>
#include <hbinstance.h>
-#include <hbcolorscheme.h>
#include <hbstyleloader.h>
+#include "mpenginefactory.h"
#include "mpnowplayingwidget_p.h"
#include "mpnowplayingwidget.h"
-#include "mpnowplayingbackend.h"
#include "mptrace.h"
const char *NOW_PLAYING_XML = ":/xml/nowplaying.docml";
@@ -48,16 +47,18 @@
\internal
Constructs the now playing widget private.
*/
-MpNowPlayingWidgetPrivate::MpNowPlayingWidgetPrivate( long int playerId, MpNowPlayingWidget *qq )
+MpNowPlayingWidgetPrivate::MpNowPlayingWidgetPrivate( MpNowPlayingWidget *qq )
: q_ptr( qq ),
mPrimaryText(0),
mSecondaryText(0),
- mState( NotPlaying ),
+ mState( MpPlaybackData::NotPlaying ),
+ mPlaybackData(0),
+ mMpEngine(0),
mIcon(0),
mDocumentLoader(0),
mCurrentPressedState( BannerNone )
{
- TX_ENTRY_ARGS( "Player ID =" << playerId << " Q pointer=" << ( void * )qq )
+ TX_ENTRY_ARGS( " Q pointer=" << ( void * )qq )
QGraphicsWidget *widget;
bool widgetsOk = false;
@@ -106,7 +107,8 @@
Q_ASSERT_X(widgetsOk, "MpNowPlayingWidgetPrivate", "invalid xml file");
}
- mBackEnd = new MpNowPlayingBackEnd( playerId );
+ mMpEngine = MpEngineFactory::sharedEngine();
+ mPlaybackData = mMpEngine->playbackData();
setEnabled(true);
TX_EXIT
}
@@ -119,7 +121,6 @@
MpNowPlayingWidgetPrivate::~MpNowPlayingWidgetPrivate()
{
TX_ENTRY
- delete mBackEnd;
delete mPlayIcon;
delete mPauseIcon;
delete mDocumentLoader;
@@ -133,26 +134,30 @@
void MpNowPlayingWidgetPrivate::setEnabled( bool enabled )
{
if ( enabled ) {
- connect( mBackEnd, SIGNAL(stateUpdate(SimplifiedPlayerState)),
- this, SLOT(setState(SimplifiedPlayerState)) );
+ connect( mPlaybackData, SIGNAL( playbackStateChanged() ),
+ this, SLOT( setState() ) );
- connect( mBackEnd, SIGNAL(titleChanged(QString)),
- this, SLOT(setTitle(QString)) );
+ connect( mPlaybackData, SIGNAL( playbackInfoChanged() ),
+ this, SLOT( updateBannerInfo() ) );
- connect( mBackEnd, SIGNAL(artistChanged(QString)),
- this, SLOT(setArtist(QString)) );
- mBackEnd->update();
+ setState();
+ updateBannerInfo();
}
else {
- disconnect( mBackEnd, SIGNAL(stateUpdate(SimplifiedPlayerState)),
- this, SLOT(setState(SimplifiedPlayerState)) );
+ disconnect( mPlaybackData, SIGNAL( playbackStateChanged() ),
+ this, SLOT( setState() ) );
+
+ disconnect( mPlaybackData, SIGNAL( playbackInfoChanged() ),
+ this, SLOT( updateBannerInfo() ) );
+ }
+}
- disconnect( mBackEnd, SIGNAL(titleChanged(QString)),
- mPrimaryText, SLOT(setPlainText(QString)) );
-
- disconnect( mBackEnd, SIGNAL(artistChanged(QString)),
- mSecondaryText, SLOT(setPlainText(QString)) );
- }
+/*!
+ Return if banner is attached based on current playback state
+ */
+bool MpNowPlayingWidgetPrivate::isBannerAttached()
+{
+ return mState == MpPlaybackData::NotPlaying ? false : true;
}
/*!
@@ -172,7 +177,7 @@
if ( iconTouchRect.contains( event->pos() ) ) {
if ( mCurrentPressedState == BannerIcon ) {
// click on play/pause
- mBackEnd->playPause();
+ mMpEngine->playPause();
}
}
else if ( mCurrentPressedState == BannerLabels && geometry.contains( event->pos() )){
@@ -257,24 +262,27 @@
\internal
Sets the simplified playback \a state.
*/
-void MpNowPlayingWidgetPrivate::setState( SimplifiedPlayerState state )
+void MpNowPlayingWidgetPrivate::setState( )
{
+ MpPlaybackData::SimplifiedState state = mPlaybackData->playbackState();
TX_ENTRY_ARGS( "State = " << state )
+
switch ( state ) {
- case NotPlaying:
- if ( mState != NotPlaying )
+ case MpPlaybackData::NotPlaying:
+ if ( mState != MpPlaybackData::NotPlaying )
emit q_ptr->playbackAttachmentChanged( false );
break;
- case Playing:
+ case MpPlaybackData::Playing:
mIcon->setIcon( *mPauseIcon );
mIcon->setProperty( "state", mIcon->property("state").toString() );
- if ( mState == NotPlaying )
+ if ( mState == MpPlaybackData::NotPlaying )
emit q_ptr->playbackAttachmentChanged( true );
break;
- case Paused:
+ case MpPlaybackData::Paused:
+ case MpPlaybackData::Stopped:
mIcon->setIcon( *mPlayIcon );
mIcon->setProperty( "state", mIcon->property("state").toString() );
- if ( mState == NotPlaying )
+ if ( mState == MpPlaybackData::NotPlaying )
emit q_ptr->playbackAttachmentChanged( true );
break;
default:
@@ -288,20 +296,12 @@
\internal
Sets the \a title
*/
-void MpNowPlayingWidgetPrivate::setTitle( const QString &title )
+void MpNowPlayingWidgetPrivate::updateBannerInfo()
{
- mPrimaryText->setPlainText( title );
+ mPrimaryText->setPlainText( mPlaybackData->title() );
mPrimaryText->setProperty( "state", mPrimaryText->property("state").toString() );
-}
-
-/*!
- \internal
- Sets the \a artist
- */
-void MpNowPlayingWidgetPrivate::setArtist( const QString &artist )
-{
- mSecondaryText->setPlainText( artist );
+
+ mSecondaryText->setPlainText( mPlaybackData->artist() );
mSecondaryText->setProperty( "state", mSecondaryText->property("state").toString() );
}
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/utilities/mpnowplayingbanner/tsrc/tsrc.pro Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,20 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies 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 = subdirs
+
+SUBDIRS = unittest_mpnowplayingwidget
+
--- a/utilities/mpnowplayingbanner/tsrc/unittest_mpnowplayingwidget/inc/unittest_mpnowplayingwidget.h Fri May 14 18:54:37 2010 -0500
+++ b/utilities/mpnowplayingbanner/tsrc/unittest_mpnowplayingwidget/inc/unittest_mpnowplayingwidget.h Fri May 28 19:46:01 2010 -0500
@@ -20,7 +20,7 @@
#include <QtTest/QtTest>
-#include "stub/inc/mpnowplayingbackend.h"
+#include "stub/inc/mpplaybackdata.h"
class MpNowPlayingWidget;
class MpNowPlayingWidgetPrivate;
@@ -35,7 +35,7 @@
virtual ~TestMpNowPlayingWidget();
signals:
- void setState(SimplifiedPlayerState state);
+ void setState(MpPlaybackData::SimplifiedState state);
public slots:
void initTestCase();
@@ -46,9 +46,9 @@
private slots:
void testConstructor();
void testSetState();
- void testTitleChange();
- void testArtistChange();
+ void testBannerInfoChange();
void testSetEnabled();
+ void testIsBannerAttached();
private:
--- a/utilities/mpnowplayingbanner/tsrc/unittest_mpnowplayingwidget/src/unittest_mpnowplayingwidget.cpp Fri May 14 18:54:37 2010 -0500
+++ b/utilities/mpnowplayingbanner/tsrc/unittest_mpnowplayingwidget/src/unittest_mpnowplayingwidget.cpp Fri May 28 19:46:01 2010 -0500
@@ -22,8 +22,7 @@
#include <hbevent.h>
#include "unittest_mpnowplayingwidget.h"
-#include "stub/inc/mpnowplayingbackend.h"
-#include "stub/inc/hbcolorscheme.h"
+#include "stub/inc/mpplaybackdata.h"
#include "mpcommondefs.h"
// Do this so we can access all member variables.
@@ -83,7 +82,7 @@
*/
void TestMpNowPlayingWidget::init()
{
- mTest = new MpNowPlayingWidget(MpCommon::KMusicPlayerUid);
+ mTest = new MpNowPlayingWidget();
mTestPrivate = mTest->d_ptr;
}
@@ -102,17 +101,17 @@
void TestMpNowPlayingWidget::testConstructor()
{
cleanup();
- MpNowPlayingBackEnd::resetUpdateCounter();
+ MpPlaybackData::resetUpdateCounter();
init();
QVERIFY(mTestPrivate->mPrimaryText != 0);
QVERIFY(mTestPrivate->mSecondaryText != 0);
- QVERIFY(mTestPrivate->mBackEnd != 0);
+ QVERIFY(mTestPrivate->mPlaybackData != 0);
QVERIFY(mTestPrivate->mPlayIcon != 0);
QVERIFY(mTestPrivate->mPauseIcon != 0);
QVERIFY(mTestPrivate->mIcon != 0);
QVERIFY(mTestPrivate->mDocumentLoader != 0);
- QCOMPARE(mTestPrivate->mState, NotPlaying);
- QCOMPARE(MpNowPlayingBackEnd::getUpdateCounter(), 1);
+ QCOMPARE(mTestPrivate->mState, MpPlaybackData::NotPlaying);
+ QCOMPARE(MpPlaybackData::getUpdateCounter(), 1);
}
/*!
@@ -122,63 +121,63 @@
{
QSignalSpy spy(mTest, SIGNAL(playbackAttachmentChanged(bool)));
- mTestPrivate->mState = NotPlaying;
- mTestPrivate->mBackEnd->triggerStateUpdate(NotPlaying);
+ mTestPrivate->mState = MpPlaybackData::NotPlaying;
+ mTestPrivate->mPlaybackData->triggerStateUpdate(MpPlaybackData::NotPlaying);
QCOMPARE(spy.count(), 0);
- QCOMPARE(mTestPrivate->mState, NotPlaying);
+ QCOMPARE(mTestPrivate->mState, MpPlaybackData::NotPlaying);
- mTestPrivate->mState = Playing;
- mTestPrivate->mBackEnd->triggerStateUpdate(NotPlaying);
+ mTestPrivate->mState = MpPlaybackData::Playing;
+ mTestPrivate->mPlaybackData->triggerStateUpdate(MpPlaybackData::NotPlaying);
QCOMPARE(spy.count(), 1);
QCOMPARE(spy.at(0).at(0).toBool(), false);
- QCOMPARE(mTestPrivate->mState, NotPlaying);
+ QCOMPARE(mTestPrivate->mState, MpPlaybackData::NotPlaying);
spy.clear();
- mTestPrivate->mState = Paused;
- mTestPrivate->mBackEnd->triggerStateUpdate(NotPlaying);
+ mTestPrivate->mState = MpPlaybackData::Paused;
+ mTestPrivate->mPlaybackData->triggerStateUpdate(MpPlaybackData::NotPlaying);
QCOMPARE(spy.count(), 1);
QCOMPARE(spy.at(0).at(0).toBool(), false);
- QCOMPARE(mTestPrivate->mState, NotPlaying);
+ QCOMPARE(mTestPrivate->mState, MpPlaybackData::NotPlaying);
spy.clear();
- mTestPrivate->mState = NotPlaying;
- mTestPrivate->mBackEnd->triggerStateUpdate(Playing);
+ mTestPrivate->mState = MpPlaybackData::NotPlaying;
+ mTestPrivate->mPlaybackData->triggerStateUpdate(MpPlaybackData::Playing);
QCOMPARE(spy.count(), 1);
QCOMPARE(spy.at(0).at(0).toBool(), true);
- QCOMPARE(mTestPrivate->mState, Playing);
+ QCOMPARE(mTestPrivate->mState, MpPlaybackData::Playing);
spy.clear();
- mTestPrivate->mState = NotPlaying;
- mTestPrivate->mBackEnd->triggerStateUpdate(Paused);
+ mTestPrivate->mState = MpPlaybackData::NotPlaying;
+ mTestPrivate->mPlaybackData->triggerStateUpdate(MpPlaybackData::Paused);
QCOMPARE(spy.count(), 1);
QCOMPARE(spy.at(0).at(0).toBool(), true);
- QCOMPARE(mTestPrivate->mState, Paused);
+ QCOMPARE(mTestPrivate->mState, MpPlaybackData::Paused);
spy.clear();
- mTestPrivate->mState = Playing;
- mTestPrivate->mBackEnd->triggerStateUpdate(Paused);
- mTestPrivate->mState = Paused;
- mTestPrivate->mBackEnd->triggerStateUpdate(Playing);
+ mTestPrivate->mState = MpPlaybackData::NotPlaying;
+ mTestPrivate->mPlaybackData->triggerStateUpdate(MpPlaybackData::Stopped);
+ QCOMPARE(spy.count(), 1);
+ QCOMPARE(spy.at(0).at(0).toBool(), true);
+ QCOMPARE(mTestPrivate->mState, MpPlaybackData::Stopped);
+
+ spy.clear();
+ mTestPrivate->mState = MpPlaybackData::Playing;
+ mTestPrivate->mPlaybackData->triggerStateUpdate(MpPlaybackData::Paused);
+ mTestPrivate->mState = MpPlaybackData::Paused;
+ mTestPrivate->mPlaybackData->triggerStateUpdate(MpPlaybackData::Playing);
QCOMPARE(spy.count(), 0);
}
/*!
- Tests title change from the backend.
+ Tests title and artist change
*/
-void TestMpNowPlayingWidget::testTitleChange()
+void TestMpNowPlayingWidget::testBannerInfoChange()
{
- mTestPrivate->mBackEnd->triggerTitleChanged(QString("Title"));
+ mTestPrivate->mPlaybackData->triggerLabelsChanged(QString("Title"), QString("Artist"));
QCOMPARE(mTestPrivate->mPrimaryText->plainText(), QString("Title"));
+ QCOMPARE(mTestPrivate->mSecondaryText->plainText(), QString("Artist"));
}
-/*!
- Tests artist change from the backend.
- */
-void TestMpNowPlayingWidget::testArtistChange()
-{
- mTestPrivate->mBackEnd->triggerArtistChanged(QString("Artist"));
- QCOMPARE(mTestPrivate->mSecondaryText->plainText(), QString("Artist"));
-}
/*!
Tests disabling/enabling the widget.
@@ -189,35 +188,51 @@
QSignalSpy spy(mTest, SIGNAL(playbackAttachmentChanged(bool)));
mTestPrivate->mPrimaryText->setPlainText("Primary");
mTestPrivate->mSecondaryText->setPlainText("Secondary");
- mTestPrivate->mState = NotPlaying;
+ mTestPrivate->mState = MpPlaybackData::NotPlaying;
// Disable the widget; Nothing should update.
mTest->setEnabled(false);
- mTestPrivate->mBackEnd->triggerStateUpdate(Playing);
- QCOMPARE(mTestPrivate->mState, NotPlaying);
+ mTestPrivate->mPlaybackData->triggerStateUpdate(MpPlaybackData::Playing);
+ QCOMPARE(mTestPrivate->mState, MpPlaybackData::NotPlaying);
QCOMPARE(spy.count(), 0);
- mTestPrivate->mBackEnd->triggerTitleChanged(QString("Title"));
- QCOMPARE(mTestPrivate->mPrimaryText->plainText(), QString("Title"));
-
- mTestPrivate->mBackEnd->triggerArtistChanged(QString("Artist"));
- QCOMPARE(mTestPrivate->mSecondaryText->plainText(), QString("Artist"));
+ mTestPrivate->mPlaybackData->triggerLabelsChanged(QString("Title"), QString("Artist"));
+ QCOMPARE(mTestPrivate->mPrimaryText->plainText(), QString("Primary"));
+ QCOMPARE(mTestPrivate->mSecondaryText->plainText(), QString("Secondary"));
// Enable the widget. It should start updating again.
+ mTestPrivate->mPlaybackData->triggerStateUpdate(MpPlaybackData::NotPlaying);
mTest->setEnabled(true);
- mTestPrivate->mState = Playing;
- mTestPrivate->mBackEnd->triggerStateUpdate(NotPlaying);
+ mTestPrivate->mState = MpPlaybackData::Playing;
+ mTestPrivate->mPlaybackData->triggerStateUpdate(MpPlaybackData::NotPlaying);
QCOMPARE(spy.count(), 1);
QCOMPARE(spy.at(0).at(0).toBool(), false);
- QCOMPARE(mTestPrivate->mState, NotPlaying);
+ QCOMPARE(mTestPrivate->mState, MpPlaybackData::NotPlaying);
- mTestPrivate->mBackEnd->triggerTitleChanged(QString("Title"));
+ mTestPrivate->mPlaybackData->triggerLabelsChanged(QString("Title"), QString("Artist"));
QCOMPARE(mTestPrivate->mPrimaryText->plainText(), QString("Title"));
-
- mTestPrivate->mBackEnd->triggerArtistChanged(QString("Artist"));
QCOMPARE(mTestPrivate->mSecondaryText->plainText(), QString("Artist"));
}
+/*!
+ Tests the return value based on the current playbackState
+ */
+void TestMpNowPlayingWidget::testIsBannerAttached()
+{
+ mTestPrivate->mState = MpPlaybackData::NotPlaying;
+ QCOMPARE(mTestPrivate->isBannerAttached(), false);
+ mTestPrivate->mState = MpPlaybackData::Playing;
+ QCOMPARE(mTestPrivate->isBannerAttached(), true);
+ mTestPrivate->mState = MpPlaybackData::NotPlaying;
+ QCOMPARE(mTestPrivate->isBannerAttached(), false);
+ mTestPrivate->mState = MpPlaybackData::Paused;
+ QCOMPARE(mTestPrivate->isBannerAttached(), true);
+ mTestPrivate->mState = MpPlaybackData::NotPlaying;
+ QCOMPARE(mTestPrivate->isBannerAttached(), false);
+ mTestPrivate->mState = MpPlaybackData::Stopped;
+ QCOMPARE(mTestPrivate->isBannerAttached(), true);
+
+}
// End of file
--- a/utilities/mpnowplayingbanner/tsrc/unittest_mpnowplayingwidget/stub/inc/hbcolorscheme.h Fri May 14 18:54:37 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: HbColorScheme stub for testing MpNowPlayingWidget
-*
-*/
-
-#ifndef HBCOLORSCHEME_H
-#define HBCOLORSCHEME_H
-
-#include <hbglobal.h>
-#include <QColor>
-
-
-class QGraphicsWidget;
-class QString;
-
-
-class HbColorTheme
-{
-
-public:
- // Stub functions
- ~HbColorTheme();
-
- static HbColorTheme *global ();
-
- QColor color(const QString &colorRole);
- void setCurrentTheme(int theme);
-
-private:
- HbColorTheme ();
- int mTheme;
-
-};
-
-class HbColorScheme
-{
-public:
- // Stub functions
- static QColor color( const QString &colorRole );
-
-};
-
-#endif // HBCOLORSCHEME_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/utilities/mpnowplayingbanner/tsrc/unittest_mpnowplayingwidget/stub/inc/mpenginefactory.h Fri May 28 19:46:01 2010 -0500
@@ -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: MpEngineFactory stub for testing MpNowPlayingWidget
+*
+*/
+
+#ifndef MPENGINEFACTORY_H
+#define MPENGINEFACTORY_H
+
+#include <hbglobal.h>
+
+
+class MpPlaybackData;
+
+class MpEngine
+{
+public:
+ // Stub functions
+ MpEngine();
+ MpPlaybackData *playbackData();
+
+public:
+ void playPause();
+
+private:
+ MpPlaybackData *mPlaybackData;
+
+};
+
+class MpEngineFactory
+{
+
+public:
+ // Stub functions
+private:
+ explicit MpEngineFactory();
+
+public:
+ virtual ~MpEngineFactory();
+ static MpEngineFactory * instance();
+ static MpEngine *sharedEngine();
+
+private:
+ Q_DISABLE_COPY( MpEngineFactory )
+
+ MpEngine *mSharedEngine;
+
+};
+
+
+#endif // MPENGINEFACTORY_H
--- a/utilities/mpnowplayingbanner/tsrc/unittest_mpnowplayingwidget/stub/inc/mpnowplayingbackend.h Fri May 14 18:54:37 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: mpnowplayingbackend stub for testing MpNowPlayingWidget
-*
-*/
-
-#ifndef MPNOWPLAYINGBACKEND_H
-#define MPNOWPLAYINGBACKEND_H
-
-//includes
-#include <QObject>
-#include <QMetaType>
-
-enum SimplifiedPlayerState {
- NotPlaying, //When there is no source
- Playing, //When it is playing
- Paused //When is not in Playing State
-};
-
-// Register so type can be used in signal and slot connection
-Q_DECLARE_METATYPE(SimplifiedPlayerState)
-
-
-class MpNowPlayingBackEnd : public QObject
-{
- Q_OBJECT
-
-public:
-
- // Test utility functions
- static int getUpdateCounter();
- static void resetUpdateCounter();
- static int getPlayPauseCounter();
- static void resetPlayPauseCounter();
- void triggerStateUpdate(SimplifiedPlayerState state);
- void triggerTitleChanged(const QString &text);
- void triggerArtistChanged(const QString &text);
-
- // Stub functions
- explicit MpNowPlayingBackEnd(long int playerId=0);
- virtual ~MpNowPlayingBackEnd();
-
-signals:
- void stateUpdate(SimplifiedPlayerState state);
- void titleChanged(const QString &text);
- void artistChanged(const QString &text);
-
-public slots:
- void update();
- void playPause();
-
-};
-
-#endif // MPNOWPLAYINGBACKEND_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/utilities/mpnowplayingbanner/tsrc/unittest_mpnowplayingwidget/stub/inc/mpplaybackdata.h Fri May 28 19:46:01 2010 -0500
@@ -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: mpplaybackdata stub for testing MpNowPlayingWidget
+*
+*/
+
+#ifndef MPPLAYBACKDATA_H
+#define MPPLAYBACKDATA_H
+
+//includes
+#include <QObject>
+#include <QMetaType>
+
+
+class MpPlaybackData : public QObject
+{
+ Q_OBJECT
+
+public:
+
+ enum SimplifiedState {
+ NotPlaying,
+ Playing,
+ Paused,
+ Stopped
+ };
+ // Test utility functions
+ static int getUpdateCounter();
+ static void resetUpdateCounter();
+ void triggerStateUpdate(SimplifiedState state);
+ void triggerLabelsChanged(const QString &title, const QString &artist);
+
+ // Stub functions
+ explicit MpPlaybackData();
+ virtual ~MpPlaybackData();
+
+signals:
+ void playbackStateChanged();
+ void playbackInfoChanged();
+
+public:
+ const QString& title() const;
+ const QString& artist() const;
+ MpPlaybackData::SimplifiedState playbackState() const;
+
+private:
+ QString mArtist;
+ QString mTitle;
+ SimplifiedState mPlaybackState;
+
+};
+
+#endif // MPPLAYBACKDATA_H
--- a/utilities/mpnowplayingbanner/tsrc/unittest_mpnowplayingwidget/stub/src/hbcolorscheme.cpp Fri May 14 18:54:37 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: HbColorScheme stub for testing MpNowPlayingWidget
-*
-*/
-
-
-#include "stub/inc/hbcolorscheme.h"
-
-/*!
- * Stub function
- */
-HbColorTheme *HbColorTheme::global ()
-{
- static HbColorTheme instance;
- return &instance;
-}
-
-/*!
- * Stub function
- */
-QColor HbColorTheme::color( const QString &colorRole )
-{
- if ( mTheme == 1 ) {
- if ( colorRole == QString("foreground") ) {
- return QColor(255,0,255);
- }
- else{
- return QColor(0,255,0);
- }
- }
- else {
- if ( colorRole == QString("foreground") ) {
- return QColor(255,255,0);
- }
- else{
- return QColor(0,255,255);
- }
- }
-}
-
-/*!
- * Stub function
- */
-void HbColorTheme::setCurrentTheme ( int theme )
-{
- mTheme = theme;
-
-}
-
-/*!
- * Stub function
- */
-HbColorTheme::HbColorTheme (): mTheme(0)
-{
-
-}
-/*!
- * Stub function
- */
-HbColorTheme::~HbColorTheme ()
-{
-
-}
-
-/*!
- * Stub function
- */
-QColor HbColorScheme::color( const QString &colorRole )
-{
- QColor normalColor(255,255,255);
- return HbColorTheme::global()->color(colorRole);
-}
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/utilities/mpnowplayingbanner/tsrc/unittest_mpnowplayingwidget/stub/src/mpenginefactory.cpp Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,78 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: MpEngineFactory stub for testing MpNowPlayingWidget
+*
+*/
+
+
+#include "stub/inc/mpenginefactory.h"
+#include "stub/inc/mpplaybackdata.h"
+
+/*!
+ * Stub function
+ */
+MpEngine::MpEngine() : mPlaybackData(0)
+{
+}
+
+/*!
+ * Stub function
+ */
+MpPlaybackData *MpEngine::playbackData()
+{
+ mPlaybackData = new MpPlaybackData();
+ return mPlaybackData;
+}
+
+/*!
+ * Stub function
+ */
+void MpEngine::playPause()
+{
+}
+
+/*!
+ * Stub function
+ */
+MpEngineFactory::MpEngineFactory()
+ : mSharedEngine( 0 )
+{
+}
+
+/*!
+ * Stub function
+ */
+MpEngineFactory::~MpEngineFactory()
+{
+}
+
+/*!
+ * Stub function
+ */
+MpEngineFactory * MpEngineFactory::instance()
+{
+ static MpEngineFactory instance;
+ return &instance;
+}
+
+/*!
+ * Stub function
+ */
+MpEngine *MpEngineFactory::sharedEngine()
+{
+ if ( !instance()->mSharedEngine ) {
+ instance()->mSharedEngine = new MpEngine();
+ }
+ return instance()->mSharedEngine;
+}
--- a/utilities/mpnowplayingbanner/tsrc/unittest_mpnowplayingwidget/stub/src/mpnowplayingbackend.cpp Fri May 14 18:54:37 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +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: mpxplaybackutility stub for testing MpNowPlayingBackEnd
-*
-*/
-
-#include "stub/inc/mpnowplayingbackend.h"
-
-
-int gUpdateCounter = 0;
-int gPlayPauseCounter = 0;
-
-
-/*!
- Returns gUpdateCounter.
- gUpdateCounter counts the number of MpNowPlayingBackEnd::update calls.
- */
-int MpNowPlayingBackEnd::getUpdateCounter()
-{
- return gUpdateCounter;
-}
-
-/*!
- Resets gUpdateCounter to zero.
- */
-void MpNowPlayingBackEnd::resetUpdateCounter()
-{
- gUpdateCounter = 0;
-}
-
-/*!
- Returns gPlayPauseCounter.
- gPlayPauseCounter counts the number of MpNowPlayingBackEnd::playPause calls.
- */
-int MpNowPlayingBackEnd::getPlayPauseCounter()
-{
- return gPlayPauseCounter;
-}
-
-/*!
- Resets gPlayPauseCounter to zero.
- */
-void MpNowPlayingBackEnd::resetPlayPauseCounter()
-{
- gPlayPauseCounter = 0;
-}
-
-/*!
- Causes signal stateUpdate to be emitted.
- */
-void MpNowPlayingBackEnd::triggerStateUpdate(SimplifiedPlayerState state)
-{
- emit stateUpdate(state);
-}
-
-/*!
- Causes signal titleChanged to be emitted.
- */
-void MpNowPlayingBackEnd::triggerTitleChanged(const QString &text)
-{
- emit titleChanged(text);
-}
-
-/*!
- Causes signal artistChanged to be emitted.
- */
-void MpNowPlayingBackEnd::triggerArtistChanged(const QString &text)
-{
- emit artistChanged(text);
-}
-
-/*!
- Stub function.
- */
-MpNowPlayingBackEnd::MpNowPlayingBackEnd( long int playerId )
-{
- Q_UNUSED(playerId);
-}
-
-/*!
- Stub function.
- */
-MpNowPlayingBackEnd::~MpNowPlayingBackEnd()
-{
-}
-
-/*!
- Stub function.
- */
-void MpNowPlayingBackEnd::update()
-{
- gUpdateCounter++;
-}
-
-/*!
- Stub function.
- */
-void MpNowPlayingBackEnd::playPause()
-{
- gPlayPauseCounter++;
-}
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/utilities/mpnowplayingbanner/tsrc/unittest_mpnowplayingwidget/stub/src/mpplaybackdata.cpp Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,100 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: MpPlaybackData stub for testing mpnowplayingwidget
+*
+*/
+
+#include "stub/inc/mpplaybackdata.h"
+
+
+int gUpdateCounter = 0;
+
+
+/*!
+ Returns gUpdateCounter.
+ gUpdateCounter counts the number of MpNowPlayingBackEnd::update calls.
+ */
+int MpPlaybackData::getUpdateCounter()
+{
+ return gUpdateCounter;
+}
+
+/*!
+ Resets gUpdateCounter to zero.
+ */
+void MpPlaybackData::resetUpdateCounter()
+{
+ gUpdateCounter = 0;
+}
+
+/*!
+ Causes signal stateUpdate to be emitted.
+ */
+void MpPlaybackData::triggerStateUpdate(SimplifiedState state)
+{
+ mPlaybackState = state;
+ emit playbackStateChanged();
+
+}
+
+/*!
+ Causes signal titleChanged to be emitted.
+ */
+void MpPlaybackData::triggerLabelsChanged(const QString &title, const QString &artist )
+{
+ mArtist = artist;
+ mTitle = title;
+ emit playbackInfoChanged();;
+}
+
+/*!
+ Stub function.
+ */
+MpPlaybackData::MpPlaybackData()
+ : mPlaybackState(NotPlaying)
+{
+ gUpdateCounter++;
+}
+
+/*!
+ Stub function.
+ */
+MpPlaybackData::~MpPlaybackData()
+{
+}
+
+/*!
+ Stub function.
+ */
+const QString& MpPlaybackData::title() const
+{
+ return mTitle;
+}
+
+/*!
+ Stub function.
+ */
+const QString& MpPlaybackData::artist() const
+{
+ return mArtist;
+}
+
+/*!
+ Stub function.
+ */
+MpPlaybackData::SimplifiedState MpPlaybackData::playbackState() const
+{
+ return mPlaybackState;
+}
+
--- a/utilities/mpnowplayingbanner/tsrc/unittest_mpnowplayingwidget/unittest_mpnowplayingwidget.pro Fri May 14 18:54:37 2010 -0500
+++ b/utilities/mpnowplayingbanner/tsrc/unittest_mpnowplayingwidget/unittest_mpnowplayingwidget.pro Fri May 28 19:46:01 2010 -0500
@@ -33,12 +33,14 @@
# Input
HEADERS += inc/unittest_mpnowplayingwidget.h \
- stub/inc/mpnowplayingbackend.h \
+ stub/inc/mpplaybackdata.h \
+ stub/inc/mpenginefactory.h \
../../../../inc/mpnowplayingwidget.h \
../../inc/mpnowplayingwidget_p.h
SOURCES += src/unittest_mpnowplayingwidget.cpp \
- stub/src/mpnowplayingbackend.cpp \
+ stub/src/mpplaybackdata.cpp \
+ stub/src/mpenginefactory.cpp \
../../src/mpnowplayingwidget.cpp \
../../src/mpnowplayingwidget_p.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/utilities/mpsettingsmanager/tsrc/tsrc.pro Fri May 28 19:46:01 2010 -0500
@@ -0,0 +1,20 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies 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 = subdirs
+
+SUBDIRS = unittest_mpsettingsmanager
+