# HG changeset patch # User hgs # Date 1283561881 18000 # Node ID f3930dda33428b33f7b53046762962c6fceb68de # Parent 560ce2306a17e0d6b8c1ce7d8652d2d428e47365 201035 diff -r 560ce2306a17 -r f3930dda3342 app/app.pro --- a/app/app.pro Tue Aug 24 03:36:14 2010 -0500 +++ b/app/app.pro Fri Sep 03 19:58:01 2010 -0500 @@ -58,7 +58,8 @@ -lmusicservices \ -lmpsettingsmanager \ -lmpengine \ - -lmpmediacontroller + -lmpmediacontroller \ + -lafservice # Input HEADERS += inc/mpmainwindow.h \ diff -r 560ce2306a17 -r f3930dda3342 app/inc/mpmainwindow.h --- a/app/inc/mpmainwindow.h Tue Aug 24 03:36:14 2010 -0500 +++ b/app/inc/mpmainwindow.h Fri Sep 03 19:58:01 2010 -0500 @@ -22,6 +22,7 @@ // System includes #include #include +#include #include "mpcommondefs.h" @@ -31,6 +32,8 @@ class MpGlobalPopupHandler; class HbActivityManager; class MpMediaController; +class AfActivityStorage; +class AfActivation; // Class declaration class MpMainWindow: public MpxViewFramework @@ -56,7 +59,7 @@ MpMainWindow(); ~MpMainWindow(); - void initialize( ActivityMode mode ); + void initialize(); signals: // For automation testability @@ -67,8 +70,8 @@ void handleLibraryUpdated(); void switchView( Qt::Orientation orientation ); - void initializeServiceView( TUid hostUid ); - void handleActivity(); + void initializeServiceView( quint32 clientSecureId ); + void loadActivityData( Af::ActivationReason reason, const QString &name, QVariantHash parameter ); void saveActivity(); void handleRestorePathFailed(); @@ -92,10 +95,10 @@ ViewType mPreviousVerticalViewType; MusicServices *mMusicServices; // Own MpGlobalPopupHandler *mPopupHandler; // Own - bool mUserExit; - HbActivityManager *mActivityManager; // Not Own + bool mUserExit; MpMediaController *mMpMediaController; // Own - + AfActivityStorage *mActivityStorage; // Own }; #endif // MPMAINVIEW_H + diff -r 560ce2306a17 -r f3930dda3342 app/rom/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/rom/bld.inf Fri Sep 03 19:58:01 2010 -0500 @@ -0,0 +1,24 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file +* +*/ + +#include + +PRJ_EXPORTS + +musicplayer.iby CORE_APP_LAYER_IBY_EXPORT_PATH(musicplayer.iby) +musicplayer_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(musicplayer_resources.iby) + diff -r 560ce2306a17 -r f3930dda3342 app/src/main.cpp --- a/app/src/main.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/app/src/main.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -54,21 +54,10 @@ TX_STATIC_ENTRY // Initialization - HbApplication app(argc, argv, Hb::NoSplash); - if ( !XQServiceUtil::isService() ) { - HbSplashScreen::start( ); - } - QVariantHash params = app.activateParams(); + HbApplication app( argc, argv, XQServiceUtil::isService(argc, argv) ? Hb::NoSplash : Hb::DefaultApplicationFlags ); + HbTranslator translator; translator.loadCommon(); - MpMainWindow::ActivityMode mode; - - if ( !params.value( "activityname" ).toString().compare( "MusicNowPlayingView" ) ) { - mode = MpMainWindow::MusicNowPlayingView; - } - else { - mode = MpMainWindow::MusicMainView; - } // Main window widget. // Includes decorators such as signal strength and battery life indicator. @@ -77,7 +66,7 @@ mainWindow.viewport()->grabGesture(Qt::PanGesture); mainWindow.viewport()->grabGesture(Qt::TapGesture); mainWindow.viewport()->grabGesture(Qt::TapAndHoldGesture); - mainWindow.initialize( mode ); + mainWindow.initialize(); mainWindow.show(); // Enter event loop diff -r 560ce2306a17 -r f3930dda3342 app/src/mpmainwindow.cpp --- a/app/src/mpmainwindow.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/app/src/mpmainwindow.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -17,13 +17,14 @@ #include -#include #include #include #include #include #include #include +#include +#include #include "mpmainwindow.h" #include "mpviewbase.h" @@ -62,8 +63,8 @@ mMusicServices(0), mPopupHandler(0), mUserExit( false ), - mActivityManager(0), - mMpMediaController(0) + mMpMediaController(0), + mActivityStorage(0) { TX_LOG } @@ -100,6 +101,7 @@ } delete mMpMediaController; + delete mActivityStorage; MpEngineFactory::close(); @@ -111,7 +113,7 @@ /*! Initialize and activate the collection view */ -void MpMainWindow::initialize( ActivityMode mode ) +void MpMainWindow::initialize() { TX_ENTRY @@ -128,21 +130,25 @@ // Music Service mode // Set the Collection View and Playback View to fetcher mode mMusicServices = new MusicServices(); - int err = connect(mMusicServices, SIGNAL(serviceActive( TUid )), this, SLOT(initializeServiceView( TUid ))); + int err = connect(mMusicServices, SIGNAL(serviceActive( quint32 )), this, SLOT(initializeServiceView( quint32 ))); TX_LOG_ARGS("connection error: " << err); XQServiceUtil::toBackground( false ); } + AfActivation *activation = new AfActivation( this ); + + mActivityStorage = new AfActivityStorage; if ( !mMusicServices ) { - HbApplication* app = qobject_cast(qApp); - QVariantHash params = app->activateParams(); + QVariantHash params = activation->parameters(); + ActivityMode mode = !params.value( "activityname" ).toString().compare( MUSIC_NOW_PLAYING_VIEW ) ? MpMainWindow::MusicNowPlayingView : MpMainWindow::MusicMainView; + MpEngineFactory::createSharedEngine(); mPopupHandler = new MpGlobalPopupHandler( this ); - if( app->activateReason() == Hb::ActivationReasonActivity ) { + if( activation->reason() == Af::ActivationReasonActivity ) { // Restoring an activity, not a fresh startup or a service // Activities from Task switcher only have one parameter if( params.count() == 1 ) { - loadActivity( app->activateData() ); + loadActivity( mActivityStorage->activityData( activation->name() ) ); } } if ( orientation() == Qt::Vertical ) { @@ -183,12 +189,12 @@ connect( MpEngineFactory::sharedEngine(), SIGNAL( libraryUpdated() ), SLOT( handleLibraryUpdated() ) ); MpEngineFactory::sharedEngine()->checkForSystemEvents(); //Register to application manager to wait for activities and clear previous activities on the task switcher - mActivityManager = qobject_cast(qApp)->activityManager(); - mActivityManager->waitActivity(); - mActivityManager->removeActivity( MUSIC_MAIN_VIEW ); - mActivityManager->removeActivity( MUSIC_NOW_PLAYING_VIEW ); - connect( app, SIGNAL( activate() ), this , SLOT( handleActivity() ) ); - connect( app, SIGNAL( aboutToQuit() ), this, SLOT( saveActivity() ) ); + qRegisterMetaType( "Af::ActivationReason" ); + connect( activation, SIGNAL( activated( Af::ActivationReason, QString, QVariantHash ) ), this, SLOT( loadActivityData( Af::ActivationReason, QString, QVariantHash ) ) ); + connect( MpEngineFactory::sharedEngine(), SIGNAL( restorePathFailed() ), this, SLOT( handleRestorePathFailed() ) ); + mActivityStorage->removeActivity( MUSIC_MAIN_VIEW ); + mActivityStorage->removeActivity( MUSIC_NOW_PLAYING_VIEW ); + connect( qApp, SIGNAL( aboutToQuit() ), this, SLOT( saveActivity() ) ); mMpMediaController = new MpMediaController(); emit applicationReady(); @@ -358,6 +364,8 @@ void MpMainWindow::keyPressEvent(QKeyEvent *event) { switch(event->key()) { + //RND feature to rotate on emulator. +#ifdef __WINS__ case 16842753: case Qt::Key_Call: if (orientation () == Qt::Vertical) { @@ -367,6 +375,7 @@ setOrientation(Qt::Vertical, false); } break; +#endif // __WINS__ default: HbMainWindow::keyPressEvent (event); break; @@ -376,13 +385,13 @@ /*! Slot to initialize the view that corresponds to the requested service */ -void MpMainWindow::initializeServiceView( TUid hostUid ) +void MpMainWindow::initializeServiceView( quint32 clientSecureId ) { switch (mMusicServices->currentService()) { case MusicServices::EUriFetcher: { - MpEngineFactory::createSharedEngine( hostUid , MpEngine::Fetch ); + MpEngineFactory::createSharedEngine( clientSecureId , MpEngine::Fetch ); mPopupHandler = new MpGlobalPopupHandler( this ); loadView( CollectionView, MpCommon::FetchView ); MpViewBase* collectionView = reinterpret_cast(mCollectionViewPlugin->getView()); @@ -397,8 +406,8 @@ } case MusicServices::EPlayback: { - MpEngineFactory::createSharedEngine( hostUid , MpEngine::Embedded ); - loadView(PlaybackView, MpCommon::EmbeddedView ); + MpEngineFactory::createSharedEngine( clientSecureId , MpEngine::Embedded ); + loadView(PlaybackView, MpCommon::EmbeddedView ); MpViewBase* playbackView = reinterpret_cast(mPlaybackViewPlugin->getView()); connect(mMusicServices, SIGNAL(playReady(QString)), MpEngineFactory::sharedEngine(), SLOT(playEmbedded(QString))); connect(mMusicServices, SIGNAL(playReady(const XQSharableFile&)), MpEngineFactory::sharedEngine(), SLOT(playEmbedded(const XQSharableFile&))); @@ -419,21 +428,26 @@ in the activity manager to wait for activities. Only running activity supported at the moment is "MusicNowPlayingView" */ -void MpMainWindow::handleActivity() + +void MpMainWindow::loadActivityData( Af::ActivationReason reason, const QString &name, QVariantHash parameter ) { TX_ENTRY - HbApplication* app = qobject_cast(qApp); - QString activityId = app->activateId(); - - if( !activityId.compare( MUSIC_NOW_PLAYING_VIEW ) ) { - if ( orientation() == Qt::Vertical ) { - if( mVerticalViewType != PlaybackView ) { - activateView( PlaybackView ); + if( reason == Af::ActivationReasonActivity ) { + QString activityId = name; + QVariantHash params = parameter; + if( !activityId.compare( MUSIC_NOW_PLAYING_VIEW ) ) { + if( params.contains( "shuffle" ) ) { + if( !params.value( "shuffle" ).toString().compare( "yes" ) ) { + MpEngineFactory::sharedEngine()->shuffleAll(); + } + } + if ( orientation() == Qt::Vertical ) { + if( mVerticalViewType != PlaybackView ) { + activateView( PlaybackView ); + } } } } - - mActivityManager->waitActivity(); TX_EXIT } @@ -460,7 +474,7 @@ activityData.insert( "restorePath", serializedRestorePath ); - bool ok = mActivityManager->addActivity( activity , activityData, activityParameters ); + bool ok = mActivityStorage->saveActivity( activity , activityData, activityParameters ); if ( !ok ){ TX_LOG_ARGS( "Error: Add Failed; should never get here." ); } @@ -541,7 +555,6 @@ TX_ENTRY QVariantHash activityData = data.toHash(); QByteArray serializedRestorePath = activityData.value( "restorePath" ).toByteArray(); - connect( MpEngineFactory::sharedEngine(), SIGNAL( restorePathFailed() ), this, SLOT( handleRestorePathFailed() ) ); MpEngineFactory::sharedEngine()->loadActivityData( serializedRestorePath ); TX_EXIT } diff -r 560ce2306a17 -r f3930dda3342 app/tsrc/tsrc.pro --- a/app/tsrc/tsrc.pro Tue Aug 24 03:36:14 2010 -0500 +++ b/app/tsrc/tsrc.pro Fri Sep 03 19:58:01 2010 -0500 @@ -16,8 +16,8 @@ TEMPLATE = subdirs -# SUBDIRS += unittest_mpmtpinfolink -# SUBDIRS += unittest_mpglobalpopuphandler +#SUBDIRS += unittest_mpmtpinfolink \ +SUBDIRS += unittest_mpglobalpopuphandler CONFIG += ordered diff -r 560ce2306a17 -r f3930dda3342 app/tsrc/unittest_mpglobalpopuphandler/stub/inc/mpengine.h --- a/app/tsrc/unittest_mpglobalpopuphandler/stub/inc/mpengine.h Tue Aug 24 03:36:14 2010 -0500 +++ b/app/tsrc/unittest_mpglobalpopuphandler/stub/inc/mpengine.h Fri Sep 03 19:58:01 2010 -0500 @@ -40,7 +40,7 @@ private: explicit MpEngine(); - void initialize( TUid hostUid, EngineMode mode); + void initialize( quint32 clientSecureId, EngineMode mode); signals: void libraryAboutToUpdate(); diff -r 560ce2306a17 -r f3930dda3342 app/tsrc/unittest_mpglobalpopuphandler/stub/inc/mpenginefactory.h --- a/app/tsrc/unittest_mpglobalpopuphandler/stub/inc/mpenginefactory.h Tue Aug 24 03:36:14 2010 -0500 +++ b/app/tsrc/unittest_mpglobalpopuphandler/stub/inc/mpenginefactory.h Fri Sep 03 19:58:01 2010 -0500 @@ -30,14 +30,17 @@ public: virtual ~MpEngineFactory(); - static MpEngineFactory * instance(); + static MpEngineFactory * instance(); + + static MpEngine *createSharedEngine( quint32 clientSecureId=MpCommon::KMusicPlayerUid, MpEngine::EngineMode mode=MpEngine::StandAlone ); + static MpEngine *createIsolatedEngine( MpEngine::EngineMode mode ); static MpEngine *sharedEngine(); - static MpEngine *createIsolatedEngine( MpEngine::EngineMode mode ); static void close(); - static MpEngine *createSharedEngine( TUid uid = TUid::Uid( MpCommon::KMusicPlayerUid ), MpEngine::EngineMode mode = MpEngine::StandAlone ); - + +private: -private: + Q_DISABLE_COPY( MpEngineFactory ) + MpEngine *mSharedEngine; QList mEngines; }; diff -r 560ce2306a17 -r f3930dda3342 app/tsrc/unittest_mpglobalpopuphandler/stub/src/mpengine.cpp --- a/app/tsrc/unittest_mpglobalpopuphandler/stub/src/mpengine.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/app/tsrc/unittest_mpglobalpopuphandler/stub/src/mpengine.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -34,9 +34,9 @@ /*! Initialize engine */ -void MpEngine::initialize( TUid hostUid, EngineMode mode ) +void MpEngine::initialize( quint32 clientSecureId, EngineMode mode ) { - Q_UNUSED( hostUid ); + Q_UNUSED( clientSecureId ); Q_UNUSED( mode ); } diff -r 560ce2306a17 -r f3930dda3342 app/tsrc/unittest_mpglobalpopuphandler/stub/src/mpenginefactory.cpp --- a/app/tsrc/unittest_mpglobalpopuphandler/stub/src/mpenginefactory.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/app/tsrc/unittest_mpglobalpopuphandler/stub/src/mpenginefactory.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -60,7 +60,7 @@ MpEngine *MpEngineFactory::createIsolatedEngine( MpEngine::EngineMode mode ) { instance()->mEngines.append( new MpEngine() ); - instance()->mEngines.last()->initialize( TUid::Uid( MpCommon::KMusicPlayerUid + instance()->mEngines.count() ), mode ); + instance()->mEngines.last()->initialize( (MpCommon::KMusicPlayerUid + instance()->mEngines.count()), mode ); return instance()->mEngines.last(); } @@ -82,14 +82,14 @@ } /*! - Returns an instance to an engine with \a hostUid, and \a mode, if the shared engine is + Returns an instance to an engine with \a clientSecureId, and \a mode, if the shared engine is already created parameters are ignored. */ -MpEngine *MpEngineFactory::createSharedEngine( TUid hostUid , MpEngine::EngineMode mode ) +MpEngine *MpEngineFactory::createSharedEngine( quint32 clientSecureId , MpEngine::EngineMode mode ) { if ( !instance()->mSharedEngine ) { instance()->mSharedEngine = new MpEngine(); - instance()->mSharedEngine->initialize( hostUid, mode ); + instance()->mSharedEngine->initialize( clientSecureId, mode ); } return instance()->mSharedEngine; } diff -r 560ce2306a17 -r f3930dda3342 inc/mpapplicationmonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/inc/mpapplicationmonitor.h Fri Sep 03 19:58: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: Music Player application monitor utility. +* +*/ + +#ifndef MPAPPLICATIONMONITOR_H +#define MPAPPLICATIONMONITOR_H + +#include +#include "mpcommondefs.h" + +#ifdef BUILD_MPAPPLICATIONMONITOR +#define MPMPAPPLICATIONMONITOR_EXPORT Q_DECL_EXPORT +#else +#define MPMPAPPLICATIONMONITOR_EXPORT Q_DECL_IMPORT +#endif + +class MpApplicationMonitorPrivate; + +class MPMPAPPLICATIONMONITOR_EXPORT MpApplicationMonitor : public QObject +{ + Q_OBJECT + + friend class MpApplicationMonitorPrivate; + +public: + + explicit MpApplicationMonitor( quint32 clientSecureId=MpCommon::KMusicPlayerUid, QObject *parent=0 ); + virtual ~MpApplicationMonitor(); + + bool isApplicationRunning(); + +signals: + + void applicationStatusChanged( bool isRunning ); + +private: + + Q_DISABLE_COPY( MpApplicationMonitor ) + MpApplicationMonitorPrivate *d_ptr; + +}; + +#endif // MPAPPLICATIONMONITOR_H diff -r 560ce2306a17 -r f3930dda3342 inc/mpcommondefs.h --- a/inc/mpcommondefs.h Tue Aug 24 03:36:14 2010 -0500 +++ b/inc/mpcommondefs.h Fri Sep 03 19:58:01 2010 -0500 @@ -25,12 +25,12 @@ namespace MpCommon { // UID definition - const long int KMusicPlayerUid = {0x10207C62}; - const long int KCollectionViewUid = {0x10207C63}; - const long int KPlaybackViewUid = {0x10207C64}; - const long int KSettingsViewUid = {0x10207C66}; - const long int KDetailsViewUid = {0x2002D0AA}; - const long int KMediaWallViewUid = {0x10207C94}; + const quint32 KMusicPlayerUid = {0x10207C62}; + const quint32 KCollectionViewUid = {0x10207C63}; + const quint32 KPlaybackViewUid = {0x10207C64}; + const quint32 KSettingsViewUid = {0x10207C66}; + const quint32 KDetailsViewUid = {0x2002D0AA}; + const quint32 KMediaWallViewUid = {0x10207C94}; /*! Command code sent from the views to the application main window diff -r 560ce2306a17 -r f3930dda3342 inc/mpengine.h --- a/inc/mpengine.h Tue Aug 24 03:36:14 2010 -0500 +++ b/inc/mpengine.h Fri Sep 03 19:58:01 2010 -0500 @@ -36,6 +36,7 @@ class MpEngineFactory; class MpAudioEffectsFrameworkWrapper; class MpEqualizerFrameworkWrapper; +class MpApplicationMonitor; #if defined(BUILD_MPENGINE_LIB) #define MPENGINE_EXPORT Q_DECL_EXPORT @@ -56,7 +57,8 @@ StandAlone, Fetch, Embedded, - MediaBrowsing + MediaBrowsing, + HomeScreen }; private: @@ -128,6 +130,7 @@ // Harvester related void libraryAboutToUpdate(); + void libraryUpdateStarted(); void libraryUpdated(); void usbBlocked( bool blocked ); void unableToCotinueDueUSB(); @@ -191,6 +194,7 @@ void getMuteState(); void mute(); void unmute(); + void handleCorruptedStop( bool lastSong ); // Audio Effects related void setBalance( int balance ); @@ -200,8 +204,8 @@ void handleEqualizerReady(); private: - - void initialize( TUid hostUid, EngineMode mode); + + void initialize( quint32 clientSecureId, EngineMode mode); // Harvester related void handleUsbMassStorageStartEvent(); @@ -210,35 +214,38 @@ void handleUsbMtpEndEvent(); void handleUsbMtpNotActive(); void changeUsbBlockingState( UsbBlockingState state ); + void autoRefreshLibrary( bool automaticRequest=false ); private: Q_DISABLE_COPY( MpEngine ) + EngineMode mEngineMode; + // Harvesting related - MpMpxHarvesterFrameworkWrapper *mMpxHarvesterWrapper; // Own - MpSongScanner *mSongScanner; // Own + MpMpxHarvesterFrameworkWrapper *mMpxHarvesterWrapper; // Own + MpSongScanner *mSongScanner; // Own // Collection related - MpMpxCollectionFrameworkWrapper *mMpxCollectionWrapper; //Own + MpMpxCollectionFrameworkWrapper *mMpxCollectionWrapper; // Own // Playback related - MpMpxPlaybackFrameworkWrapper *mMpxPlaybackWrapper; //Own + MpMpxPlaybackFrameworkWrapper *mMpxPlaybackWrapper; // Own // Audio Effects related - MpAudioEffectsFrameworkWrapper *mAudioEffectsWrapper; // Own + MpAudioEffectsFrameworkWrapper *mAudioEffectsWrapper; // Own // Equalizer related - MpEqualizerFrameworkWrapper *mEqualizerWrapper; // Own - int mCurrentPresetIndex; - - MpSongData *mSongData; // Owned + MpEqualizerFrameworkWrapper *mEqualizerWrapper; // Own + int mCurrentPresetIndex; - // General - UsbBlockingState mUsbBlockingState; - UsbBlockingState mPreviousUsbState; - bool mHandleMediaCommands; - TUid mHostUid; + MpSongData *mSongData; // Own + MpApplicationMonitor *mApplicationMonitor; // Own + + UsbBlockingState mUsbBlockingState; + UsbBlockingState mPreviousUsbState; + bool mHandleMediaCommands; + }; #endif // MPENGINE_H diff -r 560ce2306a17 -r f3930dda3342 inc/mpenginefactory.h --- a/inc/mpenginefactory.h Tue Aug 24 03:36:14 2010 -0500 +++ b/inc/mpenginefactory.h Fri Sep 03 19:58:01 2010 -0500 @@ -41,8 +41,8 @@ public: virtual ~MpEngineFactory(); static MpEngineFactory * instance(); - - static MpEngine *createSharedEngine( TUid uid = TUid::Uid( MpCommon::KMusicPlayerUid ), MpEngine::EngineMode mode = MpEngine::StandAlone ); + + static MpEngine *createSharedEngine( quint32 clientSecureId=MpCommon::KMusicPlayerUid, MpEngine::EngineMode mode=MpEngine::StandAlone ); static MpEngine *createIsolatedEngine( MpEngine::EngineMode mode ); static MpEngine *sharedEngine(); static void close(); diff -r 560ce2306a17 -r f3930dda3342 inc/mpsongscanner.h --- a/inc/mpsongscanner.h Tue Aug 24 03:36:14 2010 -0500 +++ b/inc/mpsongscanner.h Fri Sep 03 19:58:01 2010 -0500 @@ -50,12 +50,15 @@ bool isAutomaticScan(); signals: + void scanStarted(); void scanCountChanged( int count ); void scanFinished( int error, int itemsAdded ); public slots: + void cancelScan(); + void handleScanStarted(); void handleScanEnded( int numItemsAdded, int error ); void handleDiskEvent( MpxDiskEvents event ); diff -r 560ce2306a17 -r f3930dda3342 mpdata/rom/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpdata/rom/bld.inf Fri Sep 03 19:58:01 2010 -0500 @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file +* +*/ + +#include + +PRJ_EXPORTS + +mpdata.iby CORE_APP_LAYER_IBY_EXPORT_PATH(mpdata.iby) + diff -r 560ce2306a17 -r f3930dda3342 mpdata/src/mpcollectiontbonelistdatamodel.cpp --- a/mpdata/src/mpcollectiontbonelistdatamodel.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpdata/src/mpcollectiontbonelistdatamodel.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -85,8 +85,8 @@ this, SIGNAL(albumDataChanged()) ); if ( mPlaybackData ) { - connect( mPlaybackData, SIGNAL(fileCorrupted( int )), - this, SLOT(fileCorrupted( int ))); + connect( mPlaybackData, SIGNAL(fileCorrupted( int )), + this, SLOT(fileCorrupted( int ))); } TX_EXIT @@ -154,8 +154,12 @@ && mPlaybackData->id() == mCollectionData->albumSongId( row ) ) { QList iconList; iconList << QVariant(); //primary icon is not used. - - iconList << HbIcon("qtg_small_speaker"); + if ( mPlaybackData->playbackState() == MpPlaybackData::Playing ) { + iconList << HbIcon("qtg_mono_play"); + } + else { + iconList << HbIcon("qtg_mono_pause"); + } returnValue = iconList; } } @@ -240,13 +244,8 @@ */ 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(); - } + updateSong(); } /*! diff -r 560ce2306a17 -r f3930dda3342 mpdata/tsrc/tsrc.pro --- a/mpdata/tsrc/tsrc.pro Tue Aug 24 03:36:14 2010 -0500 +++ b/mpdata/tsrc/tsrc.pro Fri Sep 03 19:58:01 2010 -0500 @@ -16,10 +16,10 @@ TEMPLATE = subdirs -#SUBDIRS += unittest_mpcollectionalbumartmanager \ -# unittest_mpcollectiondatamodel \ -# unittest_mpcollectiontbonelistdatamodel \ -SUBDIRS += unittest_mpmpxcollectiondata +SUBDIRS += unittest_mpmpxcollectiondata \ + unittest_mpcollectiondatamodel \ + unittest_mpcollectiontbonelistdatamodel +# unittest_mpcollectionalbumartmanager \ # unittest_mpplaybackdata \ # unittest_mpsongdata diff -r 560ce2306a17 -r f3930dda3342 mpdata/tsrc/unittest_mpcollectiondatamodel/inc/unittest_mpcollectiondatamodel.h --- a/mpdata/tsrc/unittest_mpcollectiondatamodel/inc/unittest_mpcollectiondatamodel.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpdata/tsrc/unittest_mpcollectiondatamodel/inc/unittest_mpcollectiondatamodel.h Fri Sep 03 19:58:01 2010 -0500 @@ -78,6 +78,7 @@ void testDropMimeData(); void testSetContext(); void testFileCorrupted(); + void testSetLayout(); private: diff -r 560ce2306a17 -r f3930dda3342 mpdata/tsrc/unittest_mpcollectiondatamodel/src/unittest_mpcollectiondatamodel.cpp --- a/mpdata/tsrc/unittest_mpcollectiondatamodel/src/unittest_mpcollectiondatamodel.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpdata/tsrc/unittest_mpcollectiondatamodel/src/unittest_mpcollectiondatamodel.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -45,14 +45,17 @@ HbApplication app(argc, argv); TestMpCollectionDataModel tv; - char *pass[3]; - pass[0] = argv[0]; - pass[1] = "-o"; - pass[2] = "c:\\data\\unittest_mpcollectiondatamodel.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_mpcollectiondatamodel.txt"; - int res = QTest::qExec(&tv, 3, pass); - - return res; + return QTest::qExec(&tv, 3, pass); + } } TestMpCollectionDataModel::TestMpCollectionDataModel() @@ -89,7 +92,7 @@ } mStubData = new MpMpxCollectionData(); - mStubPlaybackData = new MpPlaybackData(this); + mStubPlaybackData = new MpPlaybackData(); mHelper = new TestHelper(); } @@ -232,9 +235,8 @@ QVariant data = mTest->data(modelIndex, Qt::DisplayRole); QCOMPARE(data.canConvert(QVariant::StringList), true); QStringList dataList = data.toStringList(); - QCOMPARE(dataList.count(), 2); - QCOMPARE(dataList.at(0), hbTrId("txt_mus_other_unknown4")); - QCOMPARE(dataList.at(1), hbTrId("txt_mus_other_unknown3")); + QCOMPARE(dataList.count(), 1); + QCOMPARE(dataList.at(0), hbTrId("txt_mus_dblist_val_unknown")); // Qt::DecorationRole data = mTest->data(modelIndex, Qt::DecorationRole); @@ -320,8 +322,8 @@ QCOMPARE(dataList.at(0), QString("Title1")); // Qt::DecorationRole - data = mTest->data(modelIndex, Qt::DecorationRole); - QCOMPARE(data.userType(), QMetaType::type("QIcon")); + QVariant iconData = mTest->data(modelIndex, Qt::DecorationRole); + QVERIFY(iconData.isValid()); // Hb::IndexFeedbackRole data = mTest->data(modelIndex, Hb::IndexFeedbackRole); @@ -349,8 +351,8 @@ // Qt::DecorationRole - data = mTest->data(modelIndex, Qt::DecorationRole); - QCOMPARE(data.userType(), QMetaType::type("QIcon")); + QVariant iconData = mTest->data(modelIndex, Qt::DecorationRole); + QVERIFY(iconData.isValid()); // Hb::IndexFeedbackRole data = mTest->data(modelIndex, Hb::IndexFeedbackRole); @@ -377,8 +379,8 @@ QCOMPARE(dataList.at(1), QString("CollectionTitle")); // Qt::DecorationRole - data = mTest->data(modelIndex, Qt::DecorationRole); - QCOMPARE(data.userType(), QMetaType::type("QIcon")); + QVariant iconData = mTest->data(modelIndex, Qt::DecorationRole); + QVERIFY(iconData.isValid()); } /*! @@ -399,12 +401,12 @@ QCOMPARE(data.canConvert(QVariant::StringList), true); QStringList dataList = data.toStringList(); QCOMPARE(dataList.count(), 2); - QCOMPARE(dataList.at(0), hbTrId("txt_mus_other_unknown4")); - QCOMPARE(dataList.at(1), hbTrId("txt_mus_other_unknown3")); + QCOMPARE(dataList.at(0), hbTrId("txt_mus_other_unknown8")); + QCOMPARE(dataList.at(1), hbTrId("txt_mus_other_unknown5")); // Qt::DecorationRole - data = mTest->data(modelIndex, Qt::DecorationRole); - QCOMPARE(data.userType(), QMetaType::type("QIcon")); + QVariant iconData = mTest->data(modelIndex, Qt::DecorationRole); + QVERIFY(iconData.isValid()); } /*! @@ -451,9 +453,8 @@ QVariant data = mTest->data(modelIndex, Qt::DisplayRole); QCOMPARE(data.canConvert(QVariant::StringList), true); QStringList dataList = data.toStringList(); - QCOMPARE(dataList.count(), 2); - QCOMPARE(dataList.at(0), hbTrId("txt_mus_other_unknown4")); - QCOMPARE(dataList.at(0), hbTrId("txt_mus_other_unknown3")); + QCOMPARE(dataList.count(), 1); + QCOMPARE(dataList.at(0), hbTrId("txt_mus_dblist_val_unknown3")); // Qt::DecorationRole @@ -485,8 +486,8 @@ QCOMPARE(dataList.at(1), QString("Artist1")); // Qt::DecorationRole - data = mTest->data(modelIndex, Qt::DecorationRole); - QCOMPARE(data.userType(), QMetaType::type("QIcon")); + QVariant iconData = mTest->data(modelIndex, Qt::DecorationRole); + QVERIFY(iconData.isValid()); // Hb::IndexFeedbackRole data = mTest->data(modelIndex, Hb::IndexFeedbackRole); @@ -510,12 +511,12 @@ QCOMPARE(data.canConvert(QVariant::StringList), true); QStringList dataList = data.toStringList(); QCOMPARE(dataList.count(), 2); - QCOMPARE(dataList.at(0), hbTrId("txt_mus_other_unknown4")); - QCOMPARE(dataList.at(1), hbTrId("txt_mus_other_unknown3")); + QCOMPARE(dataList.at(0), hbTrId("txt_mus_dblist_unknown")); + QCOMPARE(dataList.at(1), hbTrId("txt_mus_dblist_val_unknown2")); // Qt::DecorationRole - data = mTest->data(modelIndex, Qt::DecorationRole); - QCOMPARE(data.userType(), QMetaType::type("QIcon")); + QVariant iconData = mTest->data(modelIndex, Qt::DecorationRole); + QVERIFY(iconData.isValid()); // Hb::IndexFeedbackRole data = mTest->data(modelIndex, Hb::IndexFeedbackRole); @@ -542,8 +543,8 @@ QCOMPARE(dataList.at(1), QString("Artist1")); // Qt::DecorationRole - data = mTest->data(modelIndex, Qt::DecorationRole); - QCOMPARE(data.userType(), QMetaType::type("QIcon")); + QVariant iconData = mTest->data(modelIndex, Qt::DecorationRole); + QVERIFY(iconData.isValid()); // Hb::IndexFeedbackRole data = mTest->data(modelIndex, Hb::IndexFeedbackRole); @@ -567,12 +568,12 @@ QCOMPARE(data.canConvert(QVariant::StringList), true); QStringList dataList = data.toStringList(); QCOMPARE(dataList.count(), 2); - QCOMPARE(dataList.at(0), hbTrId("txt_mus_other_unknown4")); - QCOMPARE(dataList.at(1), hbTrId("txt_mus_other_unknown3")); + QCOMPARE(dataList.at(0), hbTrId("txt_mus_other_unknown8")); + QCOMPARE(dataList.at(1), hbTrId("txt_mus_other_unknown5")); // Qt::DecorationRole - data = mTest->data(modelIndex, Qt::DecorationRole); - QCOMPARE(data.userType(), QMetaType::type("QIcon")); + QVariant iconData = mTest->data(modelIndex, Qt::DecorationRole); + QVERIFY(iconData.isValid()); // Hb::IndexFeedbackRole data = mTest->data(modelIndex, Hb::IndexFeedbackRole); @@ -622,8 +623,7 @@ QVariant data = mTest->data(modelIndex, Qt::DisplayRole); QCOMPARE(data.canConvert(QVariant::StringList), true); QStringList dataList = data.toStringList(); - QCOMPARE(dataList.count(), 1); - QCOMPARE(dataList.at(0), hbTrId("txt_mus_other_unknown4")); + QCOMPARE(dataList.count(), 0); // Hb::IndexFeedbackRole data = mTest->data(modelIndex, Hb::IndexFeedbackRole); @@ -674,9 +674,8 @@ QVariant data = mTest->data(modelIndex, Qt::DisplayRole); QCOMPARE(data.canConvert(QVariant::StringList), true); QStringList dataList = data.toStringList(); - QCOMPARE(dataList.count(), 2); - QCOMPARE(dataList.at(0), hbTrId("txt_mus_other_unknown4")); - QCOMPARE(dataList.at(1), hbTrId("txt_mus_other_unknown3")); + QCOMPARE(dataList.count(), 1); + QCOMPARE(dataList.at(0), hbTrId("txt_mus_dblist_val_unknown")); // Qt::DecorationRole data = mTest->data(modelIndex, Qt::DecorationRole); @@ -977,8 +976,27 @@ */ void TestMpCollectionDataModel::testFileCorrupted() { - + QSignalSpy spy(mTest, SIGNAL(dataChanged( QModelIndex, QModelIndex ))); + mTest->mRowCount = 4; + mTest->fileCorrupted(1); + QCOMPARE(mStubData->mCorruptedIndex.value(0), 1); + QCOMPARE(mStubData->mCorruptedIndex.value(1), 3); + QCOMPARE(spy.count(), 2); } +/*! + Tests setLayout() + */ +void TestMpCollectionDataModel::testSetLayout() +{ + QCOMPARE(mTest->mCollectionLayout, ECollectionListView); + mTest->setLayout(ECollectionSelectionDialog); + QCOMPARE(mTest->mCollectionLayout, ECollectionSelectionDialog); + mTest->setLayout(ECollectionArrangeSongsDialog); + QCOMPARE(mTest->mCollectionLayout, ECollectionArrangeSongsDialog); + mTest->setLayout(ECollectionListView); + QCOMPARE(mTest->mCollectionLayout, ECollectionListView); +} + // End of file diff -r 560ce2306a17 -r f3930dda3342 mpdata/tsrc/unittest_mpcollectiondatamodel/stub/inc/mpmpxcollectiondata.h --- a/mpdata/tsrc/unittest_mpcollectiondatamodel/stub/inc/mpmpxcollectiondata.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpdata/tsrc/unittest_mpcollectiondatamodel/stub/inc/mpmpxcollectiondata.h Fri Sep 03 19:58:01 2010 -0500 @@ -75,11 +75,12 @@ void setContext( TCollectionContext context ); QList songIndex( int songUniqueId ); void setCorruptValue(QModelIndex index, bool tBone ); - void setReloadAlbumContent( bool reloadAlbum ); signals: void contextChanged( TCollectionContext context ); + void dataChanged(); + void dataChanged( int fromIndex, int toIndex ); public: @@ -87,6 +88,7 @@ int mCount; bool mItemDataReturn; bool mCollectionTitleReturn; + QList mCorruptedIndex; }; diff -r 560ce2306a17 -r f3930dda3342 mpdata/tsrc/unittest_mpcollectiondatamodel/stub/inc/mpplaybackdata.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpdata/tsrc/unittest_mpcollectiondatamodel/stub/inc/mpplaybackdata.h Fri Sep 03 19:58:01 2010 -0500 @@ -0,0 +1,67 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 mpmediawallview +* +*/ + +#ifndef MPPLAYBACKDATA_H +#define MPPLAYBACKDATA_H + +//includes +#include +#include + + +class MpPlaybackData : public QObject +{ + Q_OBJECT + +public: + + enum SimplifiedState { + NotPlaying, + Playing, + Paused, + Stopped + }; + + + + explicit MpPlaybackData(); + virtual ~MpPlaybackData(); + + // Stub functions + void emitPlaybackStateChanged(); + void setPlaybackState(MpPlaybackData::SimplifiedState state); + +signals: + void playbackStateChanged(); + void playbackInfoChanged(); + void fileCorrupted(int); + +public: + int albumId(); + const QString& title() const; + const QString& artist() const; + MpPlaybackData::SimplifiedState playbackState() const; + + +private: + QString mArtist; + QString mTitle; + SimplifiedState mPlaybackState; + +}; + +#endif // MPPLAYBACKDATA_H diff -r 560ce2306a17 -r f3930dda3342 mpdata/tsrc/unittest_mpcollectiondatamodel/stub/src/mpmpxcollectiondata.cpp --- a/mpdata/tsrc/unittest_mpcollectiondatamodel/stub/src/mpmpxcollectiondata.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpdata/tsrc/unittest_mpcollectiondatamodel/stub/src/mpmpxcollectiondata.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -109,6 +109,7 @@ mCount(0), mItemDataReturn(true), mCollectionTitleReturn(true) + { gInitCounter++; } @@ -197,7 +198,15 @@ */ bool MpMpxCollectionData::hasItemProperty( int index, MpMpxCollectionData:: DataProperty type ) const { - + TX_ENTRY + Q_UNUSED(type); + if (index == 2){ + return true; + } + else { + return false; + } + } /*! @@ -258,23 +267,22 @@ Stub function. */ QList MpMpxCollectionData::songIndex( int songUniqueId ) - { +{ + QHash iList; + iList.insertMulti(1,3); + iList.insertMulti(1,2); + iList.insertMulti(4,6); + iList.insertMulti(1,1); + return iList.values(songUniqueId); - } +} /*! Stub function. */ void MpMpxCollectionData::setCorruptValue(QModelIndex index, bool tBone ) - { - - } +{ + Q_UNUSED(tBone); + mCorruptedIndex.append(index.row()); +} -/*! - Stub function. - */ -void MpMpxCollectionData::setReloadAlbumContent( bool reloadAlbum ) - { - - } - diff -r 560ce2306a17 -r f3930dda3342 mpdata/tsrc/unittest_mpcollectiondatamodel/stub/src/mpplaybackdata.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpdata/tsrc/unittest_mpcollectiondatamodel/stub/src/mpplaybackdata.cpp Fri Sep 03 19:58: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: MpPlaybackData stub for testing mpnowplayingwidget +* +*/ + +#include "stub/inc/mpplaybackdata.h" + + +int gUpdateCounter = 0; + + +/*! + 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; +} + +/*! + Stub function. + */ +int MpPlaybackData::albumId() +{ + return 0; +} + +/*! + Stub function. + */ +void MpPlaybackData::emitPlaybackStateChanged() +{ + emit playbackStateChanged(); +} + + void MpPlaybackData::setPlaybackState(MpPlaybackData::SimplifiedState state) + { + mPlaybackState=state; + } diff -r 560ce2306a17 -r f3930dda3342 mpdata/tsrc/unittest_mpcollectiondatamodel/unittest_mpcollectiondatamodel.pro --- a/mpdata/tsrc/unittest_mpcollectiondatamodel/unittest_mpcollectiondatamodel.pro Tue Aug 24 03:36:14 2010 -0500 +++ b/mpdata/tsrc/unittest_mpcollectiondatamodel/unittest_mpcollectiondatamodel.pro Fri Sep 03 19:58:01 2010 -0500 @@ -16,7 +16,7 @@ TEMPLATE = app CONFIG += qtestlib hb symbian_test -TARGET = unittest_mpcollectiontbonelistdatamodel +TARGET = unittest_mpcollectiondatamodel TARGET.CAPABILITY = CAP_APPLICATION DEPENDPATH += . @@ -34,12 +34,14 @@ inc/unittest_helper.h \ stub/inc/mpcollectionalbumartmanager.h \ stub/inc/mpmpxcollectiondata.h \ - ../../../inc/mpcollectiondatamodel.h \ + stub/inc/mpplaybackdata.h \ + ../../../inc/mpcollectiondatamodel.h SOURCES += src/unittest_mpcollectiondatamodel.cpp \ src/unittest_helper.cpp \ stub/src/mpcollectionalbumartmanager.cpp \ stub/src/mpmpxcollectiondata.cpp \ + stub/src/mpplaybackdata.cpp \ ../../src/mpcollectiondatamodel.cpp DEFINES += BUILD_MPDATA_LIB diff -r 560ce2306a17 -r f3930dda3342 mpdata/tsrc/unittest_mpcollectiontbonelistdatamodel/inc/unittest_mpcollectiontbonelistdatamodel.h --- a/mpdata/tsrc/unittest_mpcollectiontbonelistdatamodel/inc/unittest_mpcollectiontbonelistdatamodel.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpdata/tsrc/unittest_mpcollectiontbonelistdatamodel/inc/unittest_mpcollectiontbonelistdatamodel.h Fri Sep 03 19:58:01 2010 -0500 @@ -23,6 +23,7 @@ class QTranslator; class MpCollectionTBoneListDataModel; class MpMpxCollectionData; +class MpPlaybackData; class TestHelper; class TestMpCollectionTBoneListDataModel : public QObject @@ -52,12 +53,15 @@ void testData(); void testDataNoData(); void testDataAnyOtherRole(); + void testFileCorrupted(); + void testEnablePlaybackIndicatorEnable(); private: MpCollectionTBoneListDataModel *mTest; TestHelper *mHelper; MpMpxCollectionData *mStubData; + MpPlaybackData *mStubPlaybackData; QTranslator *mMpTranslator; // Own }; diff -r 560ce2306a17 -r f3930dda3342 mpdata/tsrc/unittest_mpcollectiontbonelistdatamodel/src/unittest_mpcollectiontbonelistdatamodel.cpp --- a/mpdata/tsrc/unittest_mpcollectiontbonelistdatamodel/src/unittest_mpcollectiontbonelistdatamodel.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpdata/tsrc/unittest_mpcollectiontbonelistdatamodel/src/unittest_mpcollectiontbonelistdatamodel.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -27,6 +27,7 @@ #include "unittest_mpcollectiontbonelistdatamodel.h" #include "unittest_helper.h" #include "stub/inc/mpmpxcollectiondata.h" +#include "stub/inc/mpplaybackdata.h" // Do this so we can access all member variables. #define private public @@ -58,6 +59,7 @@ : mTest(0), mHelper(0), mStubData(0), + mStubPlaybackData(0), mMpTranslator(0) { } @@ -67,6 +69,7 @@ delete mTest; delete mHelper; delete mStubData; + delete mStubPlaybackData; delete mMpTranslator; } @@ -86,6 +89,7 @@ } mStubData = new MpMpxCollectionData(); + mStubPlaybackData = new MpPlaybackData(); mHelper = new TestHelper(); } @@ -96,6 +100,8 @@ { delete mStubData; mStubData = 0; + delete mStubPlaybackData; + mStubPlaybackData = 0; delete mHelper; mHelper = 0; } @@ -105,7 +111,7 @@ */ void TestMpCollectionTBoneListDataModel::init() { - mTest = new MpCollectionTBoneListDataModel(mStubData); + mTest = new MpCollectionTBoneListDataModel(mStubData, mStubPlaybackData); mTest->mCollectionData->mItemDataReturn = true; } @@ -188,3 +194,31 @@ QCOMPARE(data.isValid(), false); } +/*! + Tests fileCorrupted() + */ +void TestMpCollectionTBoneListDataModel::testFileCorrupted() +{ + QSignalSpy spy(mTest, SIGNAL(dataChanged( QModelIndex, QModelIndex ))); + mTest->mRowCount = 4; + mTest->fileCorrupted(2); + QCOMPARE(mStubData->mHasAlbumSongProperty, true); + mTest->fileCorrupted(0); + QCOMPARE(mStubData->mReloadAlbumContent, true); + mTest->fileCorrupted(1); + QCOMPARE(mStubData->mCorruptedIndex.value(0), 1); + QCOMPARE(spy.count(), 1); + +} + +void TestMpCollectionTBoneListDataModel::testEnablePlaybackIndicatorEnable() +{ + mStubPlaybackData->mPlaybackState = MpPlaybackData::Playing; + mTest->enablePlaybackIndicatorEnable(true); + QCOMPARE( mTest->mPlaybackActive, true); + QCOMPARE( mTest->mPlaybackIndicatorEnabled, true); + mTest->enablePlaybackIndicatorEnable(false); + QCOMPARE( mTest->mPlaybackActive, false); + QCOMPARE( mTest->mPlaybackIndicatorEnabled, false); + +} diff -r 560ce2306a17 -r f3930dda3342 mpdata/tsrc/unittest_mpcollectiontbonelistdatamodel/stub/inc/mpmpxcollectiondata.h --- a/mpdata/tsrc/unittest_mpcollectiontbonelistdatamodel/stub/inc/mpmpxcollectiondata.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpdata/tsrc/unittest_mpcollectiontbonelistdatamodel/stub/inc/mpmpxcollectiondata.h Fri Sep 03 19:58:01 2010 -0500 @@ -19,6 +19,7 @@ #define MPMPXCOLLECTIONDATA_H #include +#include #include "mpmpxcollectionviewdefs.h" @@ -40,6 +41,11 @@ Rating, AlbumArtUri }; + + enum DataProperty { + Corrupted, + DrmExpired + }; // Test utility functions static int getInitCounter(); @@ -52,17 +58,23 @@ int albumSongsCount() const; int albumSongId( int index ); QString albumSongData( int index, MpMpxCollectionData::DataType type ) const; + bool hasAlbumSongProperty( int index, MpMpxCollectionData:: DataProperty type ); int albumSongIndex( int songUniqueId ); - + void setCorruptValue(QModelIndex index, bool tBone ); + void setReloadAlbumContent( bool ); signals: void contextChanged( TCollectionContext context ); void refreshAlbumSongs(); + void dataChanged(); public: int mAlbumSongCount; bool mItemDataReturn; + bool mReloadAlbumContent; + bool mHasAlbumSongProperty; + QList mCorruptedIndex; }; diff -r 560ce2306a17 -r f3930dda3342 mpdata/tsrc/unittest_mpcollectiontbonelistdatamodel/stub/src/mpmpxcollectiondata.cpp --- a/mpdata/tsrc/unittest_mpcollectiontbonelistdatamodel/stub/src/mpmpxcollectiondata.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpdata/tsrc/unittest_mpcollectiontbonelistdatamodel/stub/src/mpmpxcollectiondata.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -99,8 +99,48 @@ /*! Stub function. */ +bool MpMpxCollectionData::hasAlbumSongProperty( int index, MpMpxCollectionData:: DataProperty type ) +{ + TX_ENTRY + Q_UNUSED(type); + if (index == 2){ + mHasAlbumSongProperty = true; + return true; + } + else { + mHasAlbumSongProperty = false; + return false; + } +} + +/*! + Stub function. + */ int MpMpxCollectionData::albumSongIndex( int songUniqueId ) { - Q_UNUSED(songUniqueId); - return 0; + if (songUniqueId == 0){ + return -1; + } + else { + return songUniqueId; + } + } + +/*! + Stub function. + */ +void MpMpxCollectionData::setCorruptValue(QModelIndex index, bool tBone ) +{ + Q_UNUSED(tBone); + mCorruptedIndex.append(index.row()); +} + +/*! + Stub function. + */ +void MpMpxCollectionData::setReloadAlbumContent( bool reload ) +{ + mReloadAlbumContent = reload; +} + diff -r 560ce2306a17 -r f3930dda3342 mpdata/tsrc/unittest_mpmpxcollectiondata/inc/unittest_helper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpdata/tsrc/unittest_mpmpxcollectiondata/inc/unittest_helper.h Fri Sep 03 19:58: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: Unit test helper for mpcollectiondatamodel +* +*/ + +#ifndef TESTHELPER_H +#define TESTHELPER_H + +#include + +class TestHelper : public QAbstractListModel +{ + Q_OBJECT + +public: + + TestHelper(QObject *parent=0); + virtual ~TestHelper(); + + // These are dummy; We have to inherit from QAbstractListModel so that + // we can invoke the protected member QAbstractItemModel::createIndex() + int rowCount(const QModelIndex &parent=QModelIndex()) const; + QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const; + + QModelIndex indexFor(int index); +}; + +#endif // TESTHELPER_H + + + + diff -r 560ce2306a17 -r f3930dda3342 mpdata/tsrc/unittest_mpmpxcollectiondata/inc/unittest_mpmpxcollectiondata.h --- a/mpdata/tsrc/unittest_mpmpxcollectiondata/inc/unittest_mpmpxcollectiondata.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpdata/tsrc/unittest_mpmpxcollectiondata/inc/unittest_mpmpxcollectiondata.h Fri Sep 03 19:58:01 2010 -0500 @@ -23,6 +23,7 @@ class MpMpxCollectionData; class MpMpxCollectionDataPrivate; +class TestHelper; class TestMpMpxCollectionData : public QObject { @@ -64,12 +65,15 @@ void testAlbumSongData(); void testHasItemProperty(); void testHasAlbumSongProperty(); + void testSetCorruptValue(); + void testSetReloadAlbumContent(); private: MpMpxCollectionData *mTest; MpMpxCollectionDataPrivate *mTestPrivate; + TestHelper *mHelper; }; diff -r 560ce2306a17 -r f3930dda3342 mpdata/tsrc/unittest_mpmpxcollectiondata/src/unittest_helper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpdata/tsrc/unittest_mpmpxcollectiondata/src/unittest_helper.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Unit test helper for TestHelper +* +*/ + +#include "unittest_helper.h" + + +TestHelper::TestHelper(QObject *parent) + : QAbstractListModel(parent) +{ +} + +TestHelper::~TestHelper() +{ +} + +/*! + Dummy function to satisfy QAbstractListModel inheritance. + */ +int TestHelper::rowCount( const QModelIndex &parent ) const +{ + Q_UNUSED(parent); + return 0; +} + +/*! + Dummy function to satisfy QAbstractListModel inheritance. + */ +QVariant TestHelper::data(const QModelIndex &index, int role) const +{ + Q_UNUSED(index); + Q_UNUSED(role); + return QVariant(); +} + +/*! + Slot to be called when album art for the \a index needs to be updated. + */ +QModelIndex TestHelper::indexFor(int index) +{ + return QAbstractItemModel::createIndex(index, 0); +} + +// End of file diff -r 560ce2306a17 -r f3930dda3342 mpdata/tsrc/unittest_mpmpxcollectiondata/src/unittest_mpmpxcollectiondata.cpp --- a/mpdata/tsrc/unittest_mpmpxcollectiondata/src/unittest_mpmpxcollectiondata.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpdata/tsrc/unittest_mpmpxcollectiondata/src/unittest_mpmpxcollectiondata.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -29,9 +29,9 @@ #include #include - #include "unittest_mpmpxcollectiondata.h" #include "mpcommondefs.h" +#include "unittest_helper.h" // Do this so we can access all member variables. @@ -88,13 +88,15 @@ } TestMpMpxCollectionData::TestMpMpxCollectionData() - : mTest(0) + : mTest(0), + mHelper(0) { } TestMpMpxCollectionData::~TestMpMpxCollectionData() { delete mTest; + delete mHelper; } /*! @@ -118,6 +120,7 @@ { mTest = new MpMpxCollectionData(); mTestPrivate = mTest->d_ptr; + mHelper = new TestHelper(); } /*! @@ -419,6 +422,7 @@ mTestPrivate->iContainerMedia = entries; mTestPrivate->SetCollectionContextL(); QCOMPARE(mTestPrivate->iContext, ECollectionContextAllSongs); + QCOMPARE(mTestPrivate->iSongIdIndexMapping.empty(), true); // All artists entries->SetTObjectValueL(KMPXMediaGeneralType, EMPXGroup); @@ -535,6 +539,7 @@ QCOMPARE(spy.count(), 1); TCollectionContext context = qvariant_cast(spy.at(0).at(0)); QCOMPARE(context, ECollectionContextAllSongs); + QCOMPARE(mTestPrivate->iReloadAlbumContent, false); CleanupStack::PopAndDestroy(entries); } @@ -566,7 +571,7 @@ array->AppendL(item); mTestPrivate->iMediaArray = array; - QCOMPARE( mTest->itemId(0), -1); + QCOMPARE( mTest->itemId(0), 0); item->SetTObjectValueL( KMPXMediaGeneralId, itemId ); QCOMPARE( mTest->itemId(0), itemId); @@ -752,6 +757,7 @@ void TestMpMpxCollectionData::testSetCurrentAlbum() { QSignalSpy spy(mTest, SIGNAL(refreshAlbumSongs())); + mTestPrivate->iReloadAlbumContent = false; // Create media array that doesn't have the album songs yet. CMPXMediaArray* array = CMPXMediaArray::NewL(); @@ -863,7 +869,7 @@ } /*! - Tests hasAlbumSongProperty(). + Tests hasItemProperty(). */ void TestMpMpxCollectionData::testHasItemProperty() { @@ -973,3 +979,33 @@ mTestPrivate->iMediaArray = NULL; CleanupStack::PopAndDestroy(array); } + +/*! + Tests setCorruptValue(). + */ +void TestMpMpxCollectionData::testSetCorruptValue() +{ + CMPXMediaArray* array = CMPXMediaArray::NewL(); + CleanupStack::PushL(array); + CMPXMedia* song = CMPXMedia::NewL(); + array->AppendL(*song); + mTestPrivate->iMediaArray = array; + QModelIndex modelIndex = mHelper->indexFor(0); + mTest->setCorruptValue(modelIndex,false); + QCOMPARE(mTest->hasItemProperty( 0, MpMpxCollectionData::Corrupted), true); + CleanupStack::PopAndDestroy(array); + mTestPrivate->iMediaArray = NULL; +} + +/*! + Tests setReloadAlbumContent(). + */ +void TestMpMpxCollectionData::testSetReloadAlbumContent() +{ + mTest->setReloadAlbumContent(false); + QCOMPARE(mTestPrivate->iReloadAlbumContent, false); + mTest->setReloadAlbumContent(true); + QCOMPARE(mTestPrivate->iReloadAlbumContent, true); + +} + diff -r 560ce2306a17 -r f3930dda3342 mpdata/tsrc/unittest_mpmpxcollectiondata/unittest_mpmpxcollectiondata.pro --- a/mpdata/tsrc/unittest_mpmpxcollectiondata/unittest_mpmpxcollectiondata.pro Tue Aug 24 03:36:14 2010 -0500 +++ b/mpdata/tsrc/unittest_mpmpxcollectiondata/unittest_mpmpxcollectiondata.pro Fri Sep 03 19:58:01 2010 -0500 @@ -29,10 +29,12 @@ -lmpxcommon.dll HEADERS += inc/unittest_mpmpxcollectiondata.h \ - ../../../inc/mpmpxcollectiondata.h + ../../../inc/mpmpxcollectiondata.h \ + inc/unittest_helper.h SOURCES += src/unittest_mpmpxcollectiondata.cpp \ - ../../src/mpmpxcollectiondata.cpp + ../../src/mpmpxcollectiondata.cpp \ + src/unittest_helper.cpp DEFINES += BUILD_MPDATA_LIB diff -r 560ce2306a17 -r f3930dda3342 mpdata/tsrc/unittest_mpplaybackdata/inc/unittest_mpplaybackdata.h --- a/mpdata/tsrc/unittest_mpplaybackdata/inc/unittest_mpplaybackdata.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpdata/tsrc/unittest_mpplaybackdata/inc/unittest_mpplaybackdata.h Fri Sep 03 19:58:01 2010 -0500 @@ -53,6 +53,7 @@ void testSeAlbumId(); void testSetPlaybackState(); void testCommitPlaybackInfo(); + void testSetCorrupted(); // void testDeactivateView(); // void testGetView(); diff -r 560ce2306a17 -r f3930dda3342 mpdata/tsrc/unittest_mpplaybackdata/src/unittest_mpplaybackdata.cpp --- a/mpdata/tsrc/unittest_mpplaybackdata/src/unittest_mpplaybackdata.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpdata/tsrc/unittest_mpplaybackdata/src/unittest_mpplaybackdata.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -42,14 +42,17 @@ HbMainWindow window; TestMpPlaybackData tv; - char *pass[3]; - pass[0] = argv[0]; - pass[1] = "-o"; - pass[2] = "c:\\data\\unittest_mpplaybackdata.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_mpplaybackdata.txt"; - int res = QTest::qExec(&tv, 3, pass); - - return res; + return QTest::qExec(&tv, 3, pass); + } } TestMpPlaybackData::TestMpPlaybackData() @@ -320,4 +323,14 @@ } } +/*! + test setCorrupted + */ +void TestMpPlaybackData::testSetCorrupted() +{ + QSignalSpy spy(mTest, SIGNAL(fileCorrupted(int))); + mTest->setCorrupted(123); + QCOMPARE(spy.count(),1); +} + // End of file diff -r 560ce2306a17 -r f3930dda3342 mpengine/bwins/mpengineu.def --- a/mpengine/bwins/mpengineu.def Tue Aug 24 03:36:14 2010 -0500 +++ b/mpengine/bwins/mpengineu.def Fri Sep 03 19:58:01 2010 -0500 @@ -35,108 +35,112 @@ ?releaseIsolatedCollection@MpEngine@@QAEXXZ @ 34 NONAME ; void MpEngine::releaseIsolatedCollection(void) ?deleteStarted@MpEngine@@IAEXW4TCollectionContext@@H@Z @ 35 NONAME ; void MpEngine::deleteStarted(enum TCollectionContext, int) ?stopSeeking@MpEngine@@QAEXXZ @ 36 NONAME ; void MpEngine::stopSeeking(void) - ?initialize@MpEngine@@AAEXVTUid@@W4EngineMode@1@@Z @ 37 NONAME ; void MpEngine::initialize(class TUid, enum MpEngine::EngineMode) - ?tr@MpEngine@@SA?AVQString@@PBD0@Z @ 38 NONAME ; class QString MpEngine::tr(char const *, char const *) - ?disableEqualizer@MpEngine@@QAEXXZ @ 39 NONAME ; void MpEngine::disableEqualizer(void) - ?getStaticMetaObject@MpEngine@@SAABUQMetaObject@@XZ @ 40 NONAME ; struct QMetaObject const & MpEngine::getStaticMetaObject(void) - ?qt_metacast@MpEngineFactory@@UAEPAXPBD@Z @ 41 NONAME ; void * MpEngineFactory::qt_metacast(char const *) - ?libraryUpdated@MpEngine@@IAEXXZ @ 42 NONAME ; void MpEngine::libraryUpdated(void) - ?unmute@MpEngine@@QAEXXZ @ 43 NONAME ; void MpEngine::unmute(void) - ??0MpSongScanner@@QAE@PAVMpMpxHarvesterFrameworkWrapper@@PAVQObject@@@Z @ 44 NONAME ; MpSongScanner::MpSongScanner(class MpMpxHarvesterFrameworkWrapper *, class QObject *) - ?checkForSystemEvents@MpEngine@@QAEXXZ @ 45 NONAME ; void MpEngine::checkForSystemEvents(void) - ?applyPreset@MpEngine@@QAEXH@Z @ 46 NONAME ; void MpEngine::applyPreset(int) - ?volumePropertyChanged@MpEngine@@IAEXW4MpVolumeProperty@MpCommon@@H@Z @ 47 NONAME ; void MpEngine::volumePropertyChanged(enum MpCommon::MpVolumeProperty, int) - ?trUtf8@MpEngineFactory@@SA?AVQString@@PBD0H@Z @ 48 NONAME ; class QString MpEngineFactory::trUtf8(char const *, char const *, int) - ?staticMetaObject@MpEngine@@2UQMetaObject@@B @ 49 NONAME ; struct QMetaObject const MpEngine::staticMetaObject - ?scanStarted@MpSongScanner@@IAEXXZ @ 50 NONAME ; void MpSongScanner::scanStarted(void) - ?unableToCotinueDueUSB@MpEngine@@IAEXXZ @ 51 NONAME ; void MpEngine::unableToCotinueDueUSB(void) - ?openCollectionItem@MpEngine@@QAEXH@Z @ 52 NONAME ; void MpEngine::openCollectionItem(int) - ?handleScanStarted@MpEngine@@QAEXXZ @ 53 NONAME ; void MpEngine::handleScanStarted(void) - ?back@MpEngine@@QAEXXZ @ 54 NONAME ; void MpEngine::back(void) - ?tr@MpSongScanner@@SA?AVQString@@PBD0H@Z @ 55 NONAME ; class QString MpSongScanner::tr(char const *, char const *, int) - ?songScanner@MpEngine@@QAEPAVMpSongScanner@@XZ @ 56 NONAME ; class MpSongScanner * MpEngine::songScanner(void) - ?handleUsbMassStorageStartEvent@MpEngine@@AAEXXZ @ 57 NONAME ; void MpEngine::handleUsbMassStorageStartEvent(void) - ?saveActivityData@MpEngine@@QAEXAAVQByteArray@@@Z @ 58 NONAME ; void MpEngine::saveActivityData(class QByteArray &) - ?getMaxVolume@MpEngine@@QAEXXZ @ 59 NONAME ; void MpEngine::getMaxVolume(void) - ?handleDeleteEnded@MpEngine@@QAEX_N@Z @ 60 NONAME ; void MpEngine::handleDeleteEnded(bool) - ?handleDiskEvent@MpEngine@@QAEXW4MpxDiskEvents@@@Z @ 61 NONAME ; void MpEngine::handleDiskEvent(enum MpxDiskEvents) - ?verifyUsbBlocking@MpEngine@@QAE_N_N@Z @ 62 NONAME ; bool MpEngine::verifyUsbBlocking(bool) - ?usbSynchronizationStarted@MpEngine@@IAEXXZ @ 63 NONAME ; void MpEngine::usbSynchronizationStarted(void) - ?handleUsbMassStorageEndEvent@MpEngine@@AAEXXZ @ 64 NONAME ; void MpEngine::handleUsbMassStorageEndEvent(void) - ??0MpEngine@@AAE@XZ @ 65 NONAME ; MpEngine::MpEngine(void) - ?getStaticMetaObject@MpEngineFactory@@SAABUQMetaObject@@XZ @ 66 NONAME ; struct QMetaObject const & MpEngineFactory::getStaticMetaObject(void) - ?getStaticMetaObject@MpSongScanner@@SAABUQMetaObject@@XZ @ 67 NONAME ; struct QMetaObject const & MpSongScanner::getStaticMetaObject(void) - ?isolatedCollectionOpened@MpEngine@@IAEXPAVMpMpxCollectionData@@@Z @ 68 NONAME ; void MpEngine::isolatedCollectionOpened(class MpMpxCollectionData *) - ?aboutToAddSongs@MpEngine@@IAEXH@Z @ 69 NONAME ; void MpEngine::aboutToAddSongs(int) - ??1MpEngine@@UAE@XZ @ 70 NONAME ; MpEngine::~MpEngine(void) - ?changeUsbBlockingState@MpEngine@@AAEXW4UsbBlockingState@1@@Z @ 71 NONAME ; void MpEngine::changeUsbBlockingState(enum MpEngine::UsbBlockingState) - ?setVolume@MpEngine@@QAEXH@Z @ 72 NONAME ; void MpEngine::setVolume(int) - ?metaObject@MpEngine@@UBEPBUQMetaObject@@XZ @ 73 NONAME ; struct QMetaObject const * MpEngine::metaObject(void) const - ??_EMpSongScanner@@UAE@I@Z @ 74 NONAME ; MpSongScanner::~MpSongScanner(unsigned int) - ?createIsolatedEngine@MpEngineFactory@@SAPAVMpEngine@@W4EngineMode@2@@Z @ 75 NONAME ; class MpEngine * MpEngineFactory::createIsolatedEngine(enum MpEngine::EngineMode) - ?equalizerReady@MpEngine@@IAEXXZ @ 76 NONAME ; void MpEngine::equalizerReady(void) - ?findAlbumSongs@MpEngine@@QAEXH@Z @ 77 NONAME ; void MpEngine::findAlbumSongs(int) - ?setPosition@MpEngine@@QAEXH@Z @ 78 NONAME ; void MpEngine::setPosition(int) - ?metaObject@MpEngineFactory@@UBEPBUQMetaObject@@XZ @ 79 NONAME ; struct QMetaObject const * MpEngineFactory::metaObject(void) const - ?handleEqualizerReady@MpEngine@@QAEXXZ @ 80 NONAME ; void MpEngine::handleEqualizerReady(void) - ?tr@MpSongScanner@@SA?AVQString@@PBD0@Z @ 81 NONAME ; class QString MpSongScanner::tr(char const *, char const *) - ??_EMpEngineFactory@@UAE@I@Z @ 82 NONAME ; MpEngineFactory::~MpEngineFactory(unsigned int) - ?skipForward@MpEngine@@QAEXXZ @ 83 NONAME ; void MpEngine::skipForward(void) - ?songData@MpEngine@@QAEPAVMpSongData@@XZ @ 84 NONAME ; class MpSongData * MpEngine::songData(void) - ?trUtf8@MpSongScanner@@SA?AVQString@@PBD0H@Z @ 85 NONAME ; class QString MpSongScanner::trUtf8(char const *, char const *, int) - ?close@MpEngineFactory@@SAXXZ @ 86 NONAME ; void MpEngineFactory::close(void) - ?libraryAboutToUpdate@MpEngine@@IAEXXZ @ 87 NONAME ; void MpEngine::libraryAboutToUpdate(void) + ?tr@MpEngine@@SA?AVQString@@PBD0@Z @ 37 NONAME ; class QString MpEngine::tr(char const *, char const *) + ?disableEqualizer@MpEngine@@QAEXXZ @ 38 NONAME ; void MpEngine::disableEqualizer(void) + ?getStaticMetaObject@MpEngine@@SAABUQMetaObject@@XZ @ 39 NONAME ; struct QMetaObject const & MpEngine::getStaticMetaObject(void) + ?qt_metacast@MpEngineFactory@@UAEPAXPBD@Z @ 40 NONAME ; void * MpEngineFactory::qt_metacast(char const *) + ?libraryUpdated@MpEngine@@IAEXXZ @ 41 NONAME ; void MpEngine::libraryUpdated(void) + ?unmute@MpEngine@@QAEXXZ @ 42 NONAME ; void MpEngine::unmute(void) + ??0MpSongScanner@@QAE@PAVMpMpxHarvesterFrameworkWrapper@@PAVQObject@@@Z @ 43 NONAME ; MpSongScanner::MpSongScanner(class MpMpxHarvesterFrameworkWrapper *, class QObject *) + ?checkForSystemEvents@MpEngine@@QAEXXZ @ 44 NONAME ; void MpEngine::checkForSystemEvents(void) + ?applyPreset@MpEngine@@QAEXH@Z @ 45 NONAME ; void MpEngine::applyPreset(int) + ?volumePropertyChanged@MpEngine@@IAEXW4MpVolumeProperty@MpCommon@@H@Z @ 46 NONAME ; void MpEngine::volumePropertyChanged(enum MpCommon::MpVolumeProperty, int) + ?trUtf8@MpEngineFactory@@SA?AVQString@@PBD0H@Z @ 47 NONAME ; class QString MpEngineFactory::trUtf8(char const *, char const *, int) + ?staticMetaObject@MpEngine@@2UQMetaObject@@B @ 48 NONAME ; struct QMetaObject const MpEngine::staticMetaObject + ?scanStarted@MpSongScanner@@IAEXXZ @ 49 NONAME ; void MpSongScanner::scanStarted(void) + ?unableToCotinueDueUSB@MpEngine@@IAEXXZ @ 50 NONAME ; void MpEngine::unableToCotinueDueUSB(void) + ?openCollectionItem@MpEngine@@QAEXH@Z @ 51 NONAME ; void MpEngine::openCollectionItem(int) + ?handleScanStarted@MpEngine@@QAEXXZ @ 52 NONAME ; void MpEngine::handleScanStarted(void) + ?back@MpEngine@@QAEXXZ @ 53 NONAME ; void MpEngine::back(void) + ?tr@MpSongScanner@@SA?AVQString@@PBD0H@Z @ 54 NONAME ; class QString MpSongScanner::tr(char const *, char const *, int) + ?songScanner@MpEngine@@QAEPAVMpSongScanner@@XZ @ 55 NONAME ; class MpSongScanner * MpEngine::songScanner(void) + ?handleUsbMassStorageStartEvent@MpEngine@@AAEXXZ @ 56 NONAME ; void MpEngine::handleUsbMassStorageStartEvent(void) + ?saveActivityData@MpEngine@@QAEXAAVQByteArray@@@Z @ 57 NONAME ; void MpEngine::saveActivityData(class QByteArray &) + ?getMaxVolume@MpEngine@@QAEXXZ @ 58 NONAME ; void MpEngine::getMaxVolume(void) + ?handleDeleteEnded@MpEngine@@QAEX_N@Z @ 59 NONAME ; void MpEngine::handleDeleteEnded(bool) + ?handleDiskEvent@MpEngine@@QAEXW4MpxDiskEvents@@@Z @ 60 NONAME ; void MpEngine::handleDiskEvent(enum MpxDiskEvents) + ?verifyUsbBlocking@MpEngine@@QAE_N_N@Z @ 61 NONAME ; bool MpEngine::verifyUsbBlocking(bool) + ?usbSynchronizationStarted@MpEngine@@IAEXXZ @ 62 NONAME ; void MpEngine::usbSynchronizationStarted(void) + ?handleUsbMassStorageEndEvent@MpEngine@@AAEXXZ @ 63 NONAME ; void MpEngine::handleUsbMassStorageEndEvent(void) + ??0MpEngine@@AAE@XZ @ 64 NONAME ; MpEngine::MpEngine(void) + ?getStaticMetaObject@MpEngineFactory@@SAABUQMetaObject@@XZ @ 65 NONAME ; struct QMetaObject const & MpEngineFactory::getStaticMetaObject(void) + ?getStaticMetaObject@MpSongScanner@@SAABUQMetaObject@@XZ @ 66 NONAME ; struct QMetaObject const & MpSongScanner::getStaticMetaObject(void) + ?isolatedCollectionOpened@MpEngine@@IAEXPAVMpMpxCollectionData@@@Z @ 67 NONAME ; void MpEngine::isolatedCollectionOpened(class MpMpxCollectionData *) + ?aboutToAddSongs@MpEngine@@IAEXH@Z @ 68 NONAME ; void MpEngine::aboutToAddSongs(int) + ??1MpEngine@@UAE@XZ @ 69 NONAME ; MpEngine::~MpEngine(void) + ?changeUsbBlockingState@MpEngine@@AAEXW4UsbBlockingState@1@@Z @ 70 NONAME ; void MpEngine::changeUsbBlockingState(enum MpEngine::UsbBlockingState) + ?setVolume@MpEngine@@QAEXH@Z @ 71 NONAME ; void MpEngine::setVolume(int) + ?metaObject@MpEngine@@UBEPBUQMetaObject@@XZ @ 72 NONAME ; struct QMetaObject const * MpEngine::metaObject(void) const + ??_EMpSongScanner@@UAE@I@Z @ 73 NONAME ; MpSongScanner::~MpSongScanner(unsigned int) + ?createIsolatedEngine@MpEngineFactory@@SAPAVMpEngine@@W4EngineMode@2@@Z @ 74 NONAME ; class MpEngine * MpEngineFactory::createIsolatedEngine(enum MpEngine::EngineMode) + ?equalizerReady@MpEngine@@IAEXXZ @ 75 NONAME ; void MpEngine::equalizerReady(void) + ?findAlbumSongs@MpEngine@@QAEXH@Z @ 76 NONAME ; void MpEngine::findAlbumSongs(int) + ?setPosition@MpEngine@@QAEXH@Z @ 77 NONAME ; void MpEngine::setPosition(int) + ?metaObject@MpEngineFactory@@UBEPBUQMetaObject@@XZ @ 78 NONAME ; struct QMetaObject const * MpEngineFactory::metaObject(void) const + ?handleEqualizerReady@MpEngine@@QAEXXZ @ 79 NONAME ; void MpEngine::handleEqualizerReady(void) + ?tr@MpSongScanner@@SA?AVQString@@PBD0@Z @ 80 NONAME ; class QString MpSongScanner::tr(char const *, char const *) + ??_EMpEngineFactory@@UAE@I@Z @ 81 NONAME ; MpEngineFactory::~MpEngineFactory(unsigned int) + ?skipForward@MpEngine@@QAEXXZ @ 82 NONAME ; void MpEngine::skipForward(void) + ?songData@MpEngine@@QAEPAVMpSongData@@XZ @ 83 NONAME ; class MpSongData * MpEngine::songData(void) + ?trUtf8@MpSongScanner@@SA?AVQString@@PBD0H@Z @ 84 NONAME ; class QString MpSongScanner::trUtf8(char const *, char const *, int) + ?close@MpEngineFactory@@SAXXZ @ 85 NONAME ; void MpEngineFactory::close(void) + ?libraryAboutToUpdate@MpEngine@@IAEXXZ @ 86 NONAME ; void MpEngine::libraryAboutToUpdate(void) + ?trUtf8@MpEngine@@SA?AVQString@@PBD0H@Z @ 87 NONAME ; class QString MpEngine::trUtf8(char const *, char const *, int) ?reopenCollection@MpEngine@@QAEXXZ @ 88 NONAME ; void MpEngine::reopenCollection(void) - ?trUtf8@MpEngine@@SA?AVQString@@PBD0H@Z @ 89 NONAME ; class QString MpEngine::trUtf8(char const *, char const *, int) - ?songsDeleted@MpEngine@@IAEX_N@Z @ 90 NONAME ; void MpEngine::songsDeleted(bool) - ?refreshLibrary@MpEngine@@QAEX_N@Z @ 91 NONAME ; void MpEngine::refreshLibrary(bool) - ?qt_metacast@MpEngine@@UAEPAXPBD@Z @ 92 NONAME ; void * MpEngine::qt_metacast(char const *) - ?startSeekForward@MpEngine@@QAEXXZ @ 93 NONAME ; void MpEngine::startSeekForward(void) - ?saveToPlaylist@MpEngine@@QAEXHAAV?$QList@H@@@Z @ 94 NONAME ; void MpEngine::saveToPlaylist(int, class QList &) - ?qt_metacall@MpEngineFactory@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 95 NONAME ; int MpEngineFactory::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacall@MpSongScanner@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 96 NONAME ; int MpSongScanner::qt_metacall(enum QMetaObject::Call, int, void * *) - ?tr@MpEngineFactory@@SA?AVQString@@PBD0H@Z @ 97 NONAME ; class QString MpEngineFactory::tr(char const *, char const *, int) + ?songsDeleted@MpEngine@@IAEX_N@Z @ 89 NONAME ; void MpEngine::songsDeleted(bool) + ?refreshLibrary@MpEngine@@QAEX_N@Z @ 90 NONAME ; void MpEngine::refreshLibrary(bool) + ?qt_metacast@MpEngine@@UAEPAXPBD@Z @ 91 NONAME ; void * MpEngine::qt_metacast(char const *) + ?startSeekForward@MpEngine@@QAEXXZ @ 92 NONAME ; void MpEngine::startSeekForward(void) + ?saveToPlaylist@MpEngine@@QAEXHAAV?$QList@H@@@Z @ 93 NONAME ; void MpEngine::saveToPlaylist(int, class QList &) + ?qt_metacall@MpEngineFactory@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 94 NONAME ; int MpEngineFactory::qt_metacall(enum QMetaObject::Call, int, void * *) + ?qt_metacall@MpSongScanner@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 95 NONAME ; int MpSongScanner::qt_metacall(enum QMetaObject::Call, int, void * *) + ?tr@MpEngineFactory@@SA?AVQString@@PBD0H@Z @ 96 NONAME ; class QString MpEngineFactory::tr(char const *, char const *, int) + ?createSharedEngine@MpEngineFactory@@SAPAVMpEngine@@IW4EngineMode@2@@Z @ 97 NONAME ; class MpEngine * MpEngineFactory::createSharedEngine(unsigned int, enum MpEngine::EngineMode) ?findPlaylists@MpEngine@@QAEXAAVQStringList@@@Z @ 98 NONAME ; void MpEngine::findPlaylists(class QStringList &) ?isAutomaticScan@MpSongScanner@@QAE_NXZ @ 99 NONAME ; bool MpSongScanner::isAutomaticScan(void) ??1MpEngineFactory@@UAE@XZ @ 100 NONAME ; MpEngineFactory::~MpEngineFactory(void) - ?staticMetaObject@MpEngineFactory@@2UQMetaObject@@B @ 101 NONAME ; struct QMetaObject const MpEngineFactory::staticMetaObject - ?pause@MpEngine@@QAEXXZ @ 102 NONAME ; void MpEngine::pause(void) - ?playEmbedded@MpEngine@@QAEXVQString@@@Z @ 103 NONAME ; void MpEngine::playEmbedded(class QString) - ?shuffleAll@MpEngine@@QAEXXZ @ 104 NONAME ; void MpEngine::shuffleAll(void) - ?metaObject@MpSongScanner@@UBEPBUQMetaObject@@XZ @ 105 NONAME ; struct QMetaObject const * MpSongScanner::metaObject(void) const - ?renamePlaylist@MpEngine@@QAEXAAVQString@@@Z @ 106 NONAME ; void MpEngine::renamePlaylist(class QString &) - ?setRepeat@MpEngine@@QAEX_N@Z @ 107 NONAME ; void MpEngine::setRepeat(bool) - ?cancelCollectionRequest@MpEngine@@QAEXXZ @ 108 NONAME ; void MpEngine::cancelCollectionRequest(void) - ?trUtf8@MpEngineFactory@@SA?AVQString@@PBD0@Z @ 109 NONAME ; class QString MpEngineFactory::trUtf8(char const *, char const *) - ?increaseVolume@MpEngine@@QAEXXZ @ 110 NONAME ; void MpEngine::increaseVolume(void) - ?containerContentsChanged@MpEngine@@IAEXXZ @ 111 NONAME ; void MpEngine::containerContentsChanged(void) - ?playPause@MpEngine@@QAEXXZ @ 112 NONAME ; void MpEngine::playPause(void) - ?playlistsRenamed@MpEngine@@IAEX_N@Z @ 113 NONAME ; void MpEngine::playlistsRenamed(bool) - ?startSeekBackward@MpEngine@@QAEXXZ @ 114 NONAME ; void MpEngine::startSeekBackward(void) - ?tr@MpEngineFactory@@SA?AVQString@@PBD0@Z @ 115 NONAME ; class QString MpEngineFactory::tr(char const *, char const *) - ?playEmbedded@MpEngine@@QAEXABVXQSharableFile@@@Z @ 116 NONAME ; void MpEngine::playEmbedded(class XQSharableFile const &) - ?retrieveSongDetails@MpEngine@@QAEXH@Z @ 117 NONAME ; void MpEngine::retrieveSongDetails(int) - ?handleUsbMtpStartEvent@MpEngine@@AAEXXZ @ 118 NONAME ; void MpEngine::handleUsbMtpStartEvent(void) - ?cancelScan@MpSongScanner@@QAEXXZ @ 119 NONAME ; void MpSongScanner::cancelScan(void) - ?trUtf8@MpSongScanner@@SA?AVQString@@PBD0@Z @ 120 NONAME ; class QString MpSongScanner::trUtf8(char const *, char const *) - ?activePreset@MpEngine@@QAEHXZ @ 121 NONAME ; int MpEngine::activePreset(void) - ?handleUsbEvent@MpEngine@@QAEXW4MpxUsbEvents@@@Z @ 122 NONAME ; void MpEngine::handleUsbEvent(enum MpxUsbEvents) - ?loadActivityData@MpEngine@@QAEXABVQByteArray@@@Z @ 123 NONAME ; void MpEngine::loadActivityData(class QByteArray const &) - ?sharedEngine@MpEngineFactory@@SAPAVMpEngine@@XZ @ 124 NONAME ; class MpEngine * MpEngineFactory::sharedEngine(void) - ?balance@MpEngine@@QAEHXZ @ 125 NONAME ; int MpEngine::balance(void) - ?createSharedEngine@MpEngineFactory@@SAPAVMpEngine@@VTUid@@W4EngineMode@2@@Z @ 126 NONAME ; class MpEngine * MpEngineFactory::createSharedEngine(class TUid, enum MpEngine::EngineMode) - ?usbBlocked@MpEngine@@IAEX_N@Z @ 127 NONAME ; void MpEngine::usbBlocked(bool) - ?handleUsbMtpNotActive@MpEngine@@AAEXXZ @ 128 NONAME ; void MpEngine::handleUsbMtpNotActive(void) - ?restorePathFailed@MpEngine@@IAEXXZ @ 129 NONAME ; void MpEngine::restorePathFailed(void) - ?handleScanEnded@MpSongScanner@@QAEXHH@Z @ 130 NONAME ; void MpSongScanner::handleScanEnded(int, int) - ?staticMetaObject@MpSongScanner@@2UQMetaObject@@B @ 131 NONAME ; struct QMetaObject const MpSongScanner::staticMetaObject - ?handleScanEnded@MpEngine@@QAEXHH@Z @ 132 NONAME ; void MpEngine::handleScanEnded(int, int) - ??_EMpEngine@@UAE@I@Z @ 133 NONAME ; MpEngine::~MpEngine(unsigned int) - ?play@MpEngine@@QAEXXZ @ 134 NONAME ; void MpEngine::play(void) - ?skipBackward@MpEngine@@QAEXXZ @ 135 NONAME ; void MpEngine::skipBackward(void) - ?qt_metacast@MpSongScanner@@UAEPAXPBD@Z @ 136 NONAME ; void * MpSongScanner::qt_metacast(char const *) - ?reorderPlaylist@MpEngine@@QAEXHHHH@Z @ 137 NONAME ; void MpEngine::reorderPlaylist(int, int, int, int) - ?scanFinished@MpSongScanner@@IAEXHH@Z @ 138 NONAME ; void MpSongScanner::scanFinished(int, int) - ?setLoudness@MpEngine@@QAEX_N@Z @ 139 NONAME ; void MpEngine::setLoudness(bool) - ?corruptedStop@MpEngine@@IAEXXZ @ 140 NONAME ; void MpEngine::corruptedStop(void) + ?handleCorruptedStop@MpEngine@@QAEX_N@Z @ 101 NONAME ; void MpEngine::handleCorruptedStop(bool) + ?libraryUpdateStarted@MpEngine@@IAEXXZ @ 102 NONAME ; void MpEngine::libraryUpdateStarted(void) + ?staticMetaObject@MpEngineFactory@@2UQMetaObject@@B @ 103 NONAME ; struct QMetaObject const MpEngineFactory::staticMetaObject + ?autoRefreshLibrary@MpEngine@@AAEX_N@Z @ 104 NONAME ; void MpEngine::autoRefreshLibrary(bool) + ?pause@MpEngine@@QAEXXZ @ 105 NONAME ; void MpEngine::pause(void) + ?playEmbedded@MpEngine@@QAEXVQString@@@Z @ 106 NONAME ; void MpEngine::playEmbedded(class QString) + ?shuffleAll@MpEngine@@QAEXXZ @ 107 NONAME ; void MpEngine::shuffleAll(void) + ?metaObject@MpSongScanner@@UBEPBUQMetaObject@@XZ @ 108 NONAME ; struct QMetaObject const * MpSongScanner::metaObject(void) const + ?renamePlaylist@MpEngine@@QAEXAAVQString@@@Z @ 109 NONAME ; void MpEngine::renamePlaylist(class QString &) + ?setRepeat@MpEngine@@QAEX_N@Z @ 110 NONAME ; void MpEngine::setRepeat(bool) + ?trUtf8@MpEngineFactory@@SA?AVQString@@PBD0@Z @ 111 NONAME ; class QString MpEngineFactory::trUtf8(char const *, char const *) + ?cancelCollectionRequest@MpEngine@@QAEXXZ @ 112 NONAME ; void MpEngine::cancelCollectionRequest(void) + ?increaseVolume@MpEngine@@QAEXXZ @ 113 NONAME ; void MpEngine::increaseVolume(void) + ?corruptedStop@MpEngine@@IAEXXZ @ 114 NONAME ; void MpEngine::corruptedStop(void) + ?containerContentsChanged@MpEngine@@IAEXXZ @ 115 NONAME ; void MpEngine::containerContentsChanged(void) + ?initialize@MpEngine@@AAEXIW4EngineMode@1@@Z @ 116 NONAME ; void MpEngine::initialize(unsigned int, enum MpEngine::EngineMode) + ?playPause@MpEngine@@QAEXXZ @ 117 NONAME ; void MpEngine::playPause(void) + ?playlistsRenamed@MpEngine@@IAEX_N@Z @ 118 NONAME ; void MpEngine::playlistsRenamed(bool) + ?startSeekBackward@MpEngine@@QAEXXZ @ 119 NONAME ; void MpEngine::startSeekBackward(void) + ?tr@MpEngineFactory@@SA?AVQString@@PBD0@Z @ 120 NONAME ; class QString MpEngineFactory::tr(char const *, char const *) + ?playEmbedded@MpEngine@@QAEXABVXQSharableFile@@@Z @ 121 NONAME ; void MpEngine::playEmbedded(class XQSharableFile const &) + ?retrieveSongDetails@MpEngine@@QAEXH@Z @ 122 NONAME ; void MpEngine::retrieveSongDetails(int) + ?handleUsbMtpStartEvent@MpEngine@@AAEXXZ @ 123 NONAME ; void MpEngine::handleUsbMtpStartEvent(void) + ?cancelScan@MpSongScanner@@QAEXXZ @ 124 NONAME ; void MpSongScanner::cancelScan(void) + ?trUtf8@MpSongScanner@@SA?AVQString@@PBD0@Z @ 125 NONAME ; class QString MpSongScanner::trUtf8(char const *, char const *) + ?activePreset@MpEngine@@QAEHXZ @ 126 NONAME ; int MpEngine::activePreset(void) + ?handleUsbEvent@MpEngine@@QAEXW4MpxUsbEvents@@@Z @ 127 NONAME ; void MpEngine::handleUsbEvent(enum MpxUsbEvents) + ?loadActivityData@MpEngine@@QAEXABVQByteArray@@@Z @ 128 NONAME ; void MpEngine::loadActivityData(class QByteArray const &) + ?sharedEngine@MpEngineFactory@@SAPAVMpEngine@@XZ @ 129 NONAME ; class MpEngine * MpEngineFactory::sharedEngine(void) + ?balance@MpEngine@@QAEHXZ @ 130 NONAME ; int MpEngine::balance(void) + ?usbBlocked@MpEngine@@IAEX_N@Z @ 131 NONAME ; void MpEngine::usbBlocked(bool) + ?handleUsbMtpNotActive@MpEngine@@AAEXXZ @ 132 NONAME ; void MpEngine::handleUsbMtpNotActive(void) + ?restorePathFailed@MpEngine@@IAEXXZ @ 133 NONAME ; void MpEngine::restorePathFailed(void) + ?handleScanEnded@MpSongScanner@@QAEXHH@Z @ 134 NONAME ; void MpSongScanner::handleScanEnded(int, int) + ?staticMetaObject@MpSongScanner@@2UQMetaObject@@B @ 135 NONAME ; struct QMetaObject const MpSongScanner::staticMetaObject + ?handleScanEnded@MpEngine@@QAEXHH@Z @ 136 NONAME ; void MpEngine::handleScanEnded(int, int) + ??_EMpEngine@@UAE@I@Z @ 137 NONAME ; MpEngine::~MpEngine(unsigned int) + ?play@MpEngine@@QAEXXZ @ 138 NONAME ; void MpEngine::play(void) + ?skipBackward@MpEngine@@QAEXXZ @ 139 NONAME ; void MpEngine::skipBackward(void) + ?qt_metacast@MpSongScanner@@UAEPAXPBD@Z @ 140 NONAME ; void * MpSongScanner::qt_metacast(char const *) + ?reorderPlaylist@MpEngine@@QAEXHHHH@Z @ 141 NONAME ; void MpEngine::reorderPlaylist(int, int, int, int) + ?scanFinished@MpSongScanner@@IAEXHH@Z @ 142 NONAME ; void MpSongScanner::scanFinished(int, int) + ?setLoudness@MpEngine@@QAEX_N@Z @ 143 NONAME ; void MpEngine::setLoudness(bool) + ?handleScanStarted@MpSongScanner@@QAEXXZ @ 144 NONAME ; void MpSongScanner::handleScanStarted(void) diff -r 560ce2306a17 -r f3930dda3342 mpengine/eabi/mpengineu.def --- a/mpengine/eabi/mpengineu.def Tue Aug 24 03:36:14 2010 -0500 +++ b/mpengine/eabi/mpengineu.def Fri Sep 03 19:58:01 2010 -0500 @@ -20,7 +20,7 @@ _ZN15MpEngineFactory11qt_metacastEPKc @ 19 NONAME _ZN15MpEngineFactory12sharedEngineEv @ 20 NONAME _ZN15MpEngineFactory16staticMetaObjectE @ 21 NONAME DATA 16 - _ZN15MpEngineFactory18createSharedEngineE4TUidN8MpEngine10EngineModeE @ 22 NONAME + _ZN15MpEngineFactory18createSharedEngineEjN8MpEngine10EngineModeE @ 22 NONAME _ZN15MpEngineFactory19getStaticMetaObjectEv @ 23 NONAME _ZN15MpEngineFactory20createIsolatedEngineEN8MpEngine10EngineModeE @ 24 NONAME _ZN15MpEngineFactory5closeEv @ 25 NONAME @@ -30,7 +30,7 @@ _ZN15MpEngineFactoryD0Ev @ 29 NONAME _ZN15MpEngineFactoryD1Ev @ 30 NONAME _ZN15MpEngineFactoryD2Ev @ 31 NONAME - _ZN8MpEngine10initializeE4TUidNS_10EngineModeE @ 32 NONAME + _ZN8MpEngine10initializeEjNS_10EngineModeE @ 32 NONAME _ZN8MpEngine10setBalanceEi @ 33 NONAME _ZN8MpEngine10setShuffleEb @ 34 NONAME _ZN8MpEngine10shuffleAllEv @ 35 NONAME @@ -54,89 +54,93 @@ _ZN8MpEngine12playbackDataEv @ 53 NONAME _ZN8MpEngine12skipBackwardEv @ 54 NONAME _ZN8MpEngine12songsDeletedEb @ 55 NONAME - _ZN8MpEngine13deleteStartedE18TCollectionContexti @ 56 NONAME - _ZN8MpEngine13findPlaylistsER11QStringList @ 57 NONAME - _ZN8MpEngine13playlistSavedEb @ 58 NONAME - _ZN8MpEngine14collectionDataEv @ 59 NONAME - _ZN8MpEngine14createPlaylistER7QStringR5QListIiEP19MpMpxCollectionData @ 60 NONAME - _ZN8MpEngine14decreaseVolumeEv @ 61 NONAME - _ZN8MpEngine14equalizerReadyEv @ 62 NONAME - _ZN8MpEngine14findAlbumSongsEi @ 63 NONAME - _ZN8MpEngine14handleUsbEventE12MpxUsbEvents @ 64 NONAME - _ZN8MpEngine14increaseVolumeEv @ 65 NONAME - _ZN8MpEngine14libraryUpdatedEv @ 66 NONAME - _ZN8MpEngine14openCollectionE18TCollectionContext @ 67 NONAME - _ZN8MpEngine14playAlbumSongsEiiP19MpMpxCollectionData @ 68 NONAME - _ZN8MpEngine14refreshLibraryEb @ 69 NONAME - _ZN8MpEngine14renamePlaylistER7QString @ 70 NONAME - _ZN8MpEngine14renamePlaylistER7QStringi @ 71 NONAME - _ZN8MpEngine14saveToPlaylistEiR5QListIiE @ 72 NONAME - _ZN8MpEngine15aboutToAddSongsEi @ 73 NONAME - _ZN8MpEngine15handleDiskEventE13MpxDiskEvents @ 74 NONAME - _ZN8MpEngine15handleScanEndedEii @ 75 NONAME - _ZN8MpEngine15reorderPlaylistEiiii @ 76 NONAME - _ZN8MpEngine16disableEqualizerEv @ 77 NONAME - _ZN8MpEngine16loadActivityDataERK10QByteArray @ 78 NONAME - _ZN8MpEngine16playlistsRenamedEb @ 79 NONAME - _ZN8MpEngine16reopenCollectionEv @ 80 NONAME - _ZN8MpEngine16saveActivityDataER10QByteArray @ 81 NONAME - _ZN8MpEngine16startSeekForwardEv @ 82 NONAME - _ZN8MpEngine16staticMetaObjectE @ 83 NONAME DATA 16 - _ZN8MpEngine17handleDeleteEndedEb @ 84 NONAME - _ZN8MpEngine17handleScanStartedEv @ 85 NONAME - _ZN8MpEngine17restorePathFailedEv @ 86 NONAME - _ZN8MpEngine17startSeekBackwardEv @ 87 NONAME - _ZN8MpEngine17verifyUsbBlockingEb @ 88 NONAME - _ZN8MpEngine18openCollectionItemEi @ 89 NONAME - _ZN8MpEngine19getStaticMetaObjectEv @ 90 NONAME - _ZN8MpEngine19handleDeleteStartedE18TCollectionContexti @ 91 NONAME - _ZN8MpEngine19retrieveSongDetailsEi @ 92 NONAME - _ZN8MpEngine20checkForSystemEventsEv @ 93 NONAME - _ZN8MpEngine20handleEqualizerReadyEv @ 94 NONAME - _ZN8MpEngine20handleUsbMtpEndEventEv @ 95 NONAME - _ZN8MpEngine20libraryAboutToUpdateEv @ 96 NONAME - _ZN8MpEngine21handleUsbMtpNotActiveEv @ 97 NONAME - _ZN8MpEngine21saveToCurrentPlaylistER5QListIiEP19MpMpxCollectionData @ 98 NONAME - _ZN8MpEngine21unableToCotinueDueUSBEv @ 99 NONAME - _ZN8MpEngine21volumePropertyChangedEN8MpCommon16MpVolumePropertyEi @ 100 NONAME - _ZN8MpEngine22changeUsbBlockingStateENS_16UsbBlockingStateE @ 101 NONAME - _ZN8MpEngine22handleUsbMtpStartEventEv @ 102 NONAME - _ZN8MpEngine22openIsolatedCollectionE18TCollectionContext @ 103 NONAME - _ZN8MpEngine23cancelCollectionRequestEv @ 104 NONAME - _ZN8MpEngine24collectionPlaylistOpenedEv @ 105 NONAME - _ZN8MpEngine24containerContentsChangedEv @ 106 NONAME - _ZN8MpEngine24isolatedCollectionOpenedEP19MpMpxCollectionData @ 107 NONAME - _ZN8MpEngine25releaseIsolatedCollectionEv @ 108 NONAME - _ZN8MpEngine25usbSynchronizationStartedEv @ 109 NONAME - _ZN8MpEngine26usbSynchronizationFinishedEv @ 110 NONAME - _ZN8MpEngine28handleUsbMassStorageEndEventEv @ 111 NONAME - _ZN8MpEngine30handleUsbMassStorageStartEventEv @ 112 NONAME - _ZN8MpEngine4backEv @ 113 NONAME - _ZN8MpEngine4muteEv @ 114 NONAME - _ZN8MpEngine4playEv @ 115 NONAME - _ZN8MpEngine4stopEv @ 116 NONAME - _ZN8MpEngine5pauseEv @ 117 NONAME - _ZN8MpEngine6unmuteEv @ 118 NONAME - _ZN8MpEngine7balanceEv @ 119 NONAME - _ZN8MpEngine8loudnessEv @ 120 NONAME - _ZN8MpEngine8songDataEv @ 121 NONAME - _ZN8MpEngine9getVolumeEv @ 122 NONAME - _ZN8MpEngine9playPauseEv @ 123 NONAME - _ZN8MpEngine9setRepeatEb @ 124 NONAME - _ZN8MpEngine9setVolumeEi @ 125 NONAME - _ZN8MpEngineC1Ev @ 126 NONAME - _ZN8MpEngineC2Ev @ 127 NONAME - _ZN8MpEngineD0Ev @ 128 NONAME - _ZN8MpEngineD1Ev @ 129 NONAME - _ZN8MpEngineD2Ev @ 130 NONAME - _ZNK13MpSongScanner10metaObjectEv @ 131 NONAME - _ZNK15MpEngineFactory10metaObjectEv @ 132 NONAME - _ZNK8MpEngine10metaObjectEv @ 133 NONAME - _ZTI13MpSongScanner @ 134 NONAME - _ZTI15MpEngineFactory @ 135 NONAME - _ZTI8MpEngine @ 136 NONAME - _ZTV13MpSongScanner @ 137 NONAME - _ZTV15MpEngineFactory @ 138 NONAME - _ZTV8MpEngine @ 139 NONAME - _ZN8MpEngine13corruptedStopEv @ 140 NONAME + _ZN8MpEngine13corruptedStopEv @ 56 NONAME + _ZN8MpEngine13deleteStartedE18TCollectionContexti @ 57 NONAME + _ZN8MpEngine13findPlaylistsER11QStringList @ 58 NONAME + _ZN8MpEngine13playlistSavedEb @ 59 NONAME + _ZN8MpEngine14collectionDataEv @ 60 NONAME + _ZN8MpEngine14createPlaylistER7QStringR5QListIiEP19MpMpxCollectionData @ 61 NONAME + _ZN8MpEngine14decreaseVolumeEv @ 62 NONAME + _ZN8MpEngine14equalizerReadyEv @ 63 NONAME + _ZN8MpEngine14findAlbumSongsEi @ 64 NONAME + _ZN8MpEngine14handleUsbEventE12MpxUsbEvents @ 65 NONAME + _ZN8MpEngine14increaseVolumeEv @ 66 NONAME + _ZN8MpEngine14libraryUpdatedEv @ 67 NONAME + _ZN8MpEngine14openCollectionE18TCollectionContext @ 68 NONAME + _ZN8MpEngine14playAlbumSongsEiiP19MpMpxCollectionData @ 69 NONAME + _ZN8MpEngine14refreshLibraryEb @ 70 NONAME + _ZN8MpEngine14renamePlaylistER7QString @ 71 NONAME + _ZN8MpEngine14renamePlaylistER7QStringi @ 72 NONAME + _ZN8MpEngine14saveToPlaylistEiR5QListIiE @ 73 NONAME + _ZN8MpEngine15aboutToAddSongsEi @ 74 NONAME + _ZN8MpEngine15handleDiskEventE13MpxDiskEvents @ 75 NONAME + _ZN8MpEngine15handleScanEndedEii @ 76 NONAME + _ZN8MpEngine15reorderPlaylistEiiii @ 77 NONAME + _ZN8MpEngine16disableEqualizerEv @ 78 NONAME + _ZN8MpEngine16loadActivityDataERK10QByteArray @ 79 NONAME + _ZN8MpEngine16playlistsRenamedEb @ 80 NONAME + _ZN8MpEngine16reopenCollectionEv @ 81 NONAME + _ZN8MpEngine16saveActivityDataER10QByteArray @ 82 NONAME + _ZN8MpEngine16startSeekForwardEv @ 83 NONAME + _ZN8MpEngine16staticMetaObjectE @ 84 NONAME DATA 16 + _ZN8MpEngine17handleDeleteEndedEb @ 85 NONAME + _ZN8MpEngine17handleScanStartedEv @ 86 NONAME + _ZN8MpEngine17restorePathFailedEv @ 87 NONAME + _ZN8MpEngine17startSeekBackwardEv @ 88 NONAME + _ZN8MpEngine17verifyUsbBlockingEb @ 89 NONAME + _ZN8MpEngine18autoRefreshLibraryEb @ 90 NONAME + _ZN8MpEngine18openCollectionItemEi @ 91 NONAME + _ZN8MpEngine19getStaticMetaObjectEv @ 92 NONAME + _ZN8MpEngine19handleCorruptedStopEb @ 93 NONAME + _ZN8MpEngine19handleDeleteStartedE18TCollectionContexti @ 94 NONAME + _ZN8MpEngine19retrieveSongDetailsEi @ 95 NONAME + _ZN8MpEngine20checkForSystemEventsEv @ 96 NONAME + _ZN8MpEngine20handleEqualizerReadyEv @ 97 NONAME + _ZN8MpEngine20handleUsbMtpEndEventEv @ 98 NONAME + _ZN8MpEngine20libraryAboutToUpdateEv @ 99 NONAME + _ZN8MpEngine20libraryUpdateStartedEv @ 100 NONAME + _ZN8MpEngine21handleUsbMtpNotActiveEv @ 101 NONAME + _ZN8MpEngine21saveToCurrentPlaylistER5QListIiEP19MpMpxCollectionData @ 102 NONAME + _ZN8MpEngine21unableToCotinueDueUSBEv @ 103 NONAME + _ZN8MpEngine21volumePropertyChangedEN8MpCommon16MpVolumePropertyEi @ 104 NONAME + _ZN8MpEngine22changeUsbBlockingStateENS_16UsbBlockingStateE @ 105 NONAME + _ZN8MpEngine22handleUsbMtpStartEventEv @ 106 NONAME + _ZN8MpEngine22openIsolatedCollectionE18TCollectionContext @ 107 NONAME + _ZN8MpEngine23cancelCollectionRequestEv @ 108 NONAME + _ZN8MpEngine24collectionPlaylistOpenedEv @ 109 NONAME + _ZN8MpEngine24containerContentsChangedEv @ 110 NONAME + _ZN8MpEngine24isolatedCollectionOpenedEP19MpMpxCollectionData @ 111 NONAME + _ZN8MpEngine25releaseIsolatedCollectionEv @ 112 NONAME + _ZN8MpEngine25usbSynchronizationStartedEv @ 113 NONAME + _ZN8MpEngine26usbSynchronizationFinishedEv @ 114 NONAME + _ZN8MpEngine28handleUsbMassStorageEndEventEv @ 115 NONAME + _ZN8MpEngine30handleUsbMassStorageStartEventEv @ 116 NONAME + _ZN8MpEngine4backEv @ 117 NONAME + _ZN8MpEngine4muteEv @ 118 NONAME + _ZN8MpEngine4playEv @ 119 NONAME + _ZN8MpEngine4stopEv @ 120 NONAME + _ZN8MpEngine5pauseEv @ 121 NONAME + _ZN8MpEngine6unmuteEv @ 122 NONAME + _ZN8MpEngine7balanceEv @ 123 NONAME + _ZN8MpEngine8loudnessEv @ 124 NONAME + _ZN8MpEngine8songDataEv @ 125 NONAME + _ZN8MpEngine9getVolumeEv @ 126 NONAME + _ZN8MpEngine9playPauseEv @ 127 NONAME + _ZN8MpEngine9setRepeatEb @ 128 NONAME + _ZN8MpEngine9setVolumeEi @ 129 NONAME + _ZN8MpEngineC1Ev @ 130 NONAME + _ZN8MpEngineC2Ev @ 131 NONAME + _ZN8MpEngineD0Ev @ 132 NONAME + _ZN8MpEngineD1Ev @ 133 NONAME + _ZN8MpEngineD2Ev @ 134 NONAME + _ZNK13MpSongScanner10metaObjectEv @ 135 NONAME + _ZNK15MpEngineFactory10metaObjectEv @ 136 NONAME + _ZNK8MpEngine10metaObjectEv @ 137 NONAME + _ZTI13MpSongScanner @ 138 NONAME + _ZTI15MpEngineFactory @ 139 NONAME + _ZTI8MpEngine @ 140 NONAME + _ZTV13MpSongScanner @ 141 NONAME + _ZTV15MpEngineFactory @ 142 NONAME + _ZTV8MpEngine @ 143 NONAME + _ZN13MpSongScanner17handleScanStartedEv @ 144 NONAME diff -r 560ce2306a17 -r f3930dda3342 mpengine/inc/mpmpxcollectionframeworkwrapper.h --- a/mpengine/inc/mpmpxcollectionframeworkwrapper.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpengine/inc/mpmpxcollectionframeworkwrapper.h Fri Sep 03 19:58:01 2010 -0500 @@ -37,7 +37,7 @@ public: - explicit MpMpxCollectionFrameworkWrapper( TUid hostUid=TUid::Uid(MpCommon::KMusicPlayerUid), + explicit MpMpxCollectionFrameworkWrapper( quint32 clientSecureId=MpCommon::KMusicPlayerUid, MpSongData *songData=0, QObject *parent=0 ); virtual ~MpMpxCollectionFrameworkWrapper(); diff -r 560ce2306a17 -r f3930dda3342 mpengine/inc/mpmpxcollectionframeworkwrapper_p.h --- a/mpengine/inc/mpmpxcollectionframeworkwrapper_p.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpengine/inc/mpmpxcollectionframeworkwrapper_p.h Fri Sep 03 19:58:01 2010 -0500 @@ -59,7 +59,7 @@ explicit MpMpxCollectionFrameworkWrapperPrivate( MpMpxCollectionFrameworkWrapper *wrapper ); virtual ~MpMpxCollectionFrameworkWrapperPrivate(); - void init( TUid hostUid, MpSongData *songData ); + void init( quint32 clientSecureId, MpSongData *songData ); void openCollection( TCollectionContext context ); void openCollectionItem( int index ); void reopenCollection(); diff -r 560ce2306a17 -r f3930dda3342 mpengine/inc/mpmpxharvesterframeworkwrapper.h --- a/mpengine/inc/mpmpxharvesterframeworkwrapper.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpengine/inc/mpmpxharvesterframeworkwrapper.h Fri Sep 03 19:58:01 2010 -0500 @@ -32,7 +32,7 @@ public: - explicit MpMpxHarvesterFrameworkWrapper( TUid hostUid = TUid::Uid( MpCommon::KMusicPlayerUid ), QObject *parent=0 ); + explicit MpMpxHarvesterFrameworkWrapper( quint32 clientSecureId=MpCommon::KMusicPlayerUid, QObject *parent=0 ); virtual ~MpMpxHarvesterFrameworkWrapper(); void scan(); diff -r 560ce2306a17 -r f3930dda3342 mpengine/inc/mpmpxharvesterframeworkwrapper_p.h --- a/mpengine/inc/mpmpxharvesterframeworkwrapper_p.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpengine/inc/mpmpxharvesterframeworkwrapper_p.h Fri Sep 03 19:58:01 2010 -0500 @@ -35,7 +35,7 @@ explicit MpMpxHarvesterFrameworkWrapperPrivate( MpMpxHarvesterFrameworkWrapper *wrapper ); virtual ~MpMpxHarvesterFrameworkWrapperPrivate(); - void init( TUid hostUid ); + void init( quint32 clientSecureId ); void scan(); void cancelScan(); void checkForSystemEvents(); @@ -64,7 +64,7 @@ TInt iNumItemsAdded; TBool iScanning; TInt iPreviousBroadCastMsg; - TUid mHostUid; + TUid iHostUid; }; diff -r 560ce2306a17 -r f3930dda3342 mpengine/inc/mpmpxplaybackframeworkwrapper.h --- a/mpengine/inc/mpmpxplaybackframeworkwrapper.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpengine/inc/mpmpxplaybackframeworkwrapper.h Fri Sep 03 19:58:01 2010 -0500 @@ -37,7 +37,7 @@ public: - explicit MpMpxPlaybackFrameworkWrapper( TUid hostUid=TUid::Uid(MpCommon::KMusicPlayerUid), + explicit MpMpxPlaybackFrameworkWrapper( quint32 clientSecureId=MpCommon::KMusicPlayerUid, MpSongData *songData=0, QObject *parent=0 ); virtual ~MpMpxPlaybackFrameworkWrapper(); @@ -51,8 +51,8 @@ signals: void volumePropertyChanged( MpCommon::MpVolumeProperty property, int value ); - void corruptedStop(); - void fileCorrupted(int fileId); + void corruptedStop( bool lastSong ); + void fileCorrupted( int fileId ); public slots: diff -r 560ce2306a17 -r f3930dda3342 mpengine/inc/mpmpxplaybackframeworkwrapper_p.h --- a/mpengine/inc/mpmpxplaybackframeworkwrapper_p.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpengine/inc/mpmpxplaybackframeworkwrapper_p.h Fri Sep 03 19:58:01 2010 -0500 @@ -39,7 +39,7 @@ explicit MpMpxPlaybackFrameworkWrapperPrivate( MpMpxPlaybackFrameworkWrapper *wrapper ); virtual ~MpMpxPlaybackFrameworkWrapperPrivate(); - void init( TUid hostUid, MpSongData *songData ); + void init( quint32 clientSecureId, MpSongData *songData ); void play( QString aFilename ); void play( const XQSharableFile& file ); diff -r 560ce2306a17 -r f3930dda3342 mpengine/mpengine.pro --- a/mpengine/mpengine.pro Tue Aug 24 03:36:14 2010 -0500 +++ b/mpengine/mpengine.pro Fri Sep 03 19:58:01 2010 -0500 @@ -45,7 +45,8 @@ -lxqserviceutil \ -laudioequalizerutility \ -lmediaclientaudio \ - -lefsrv + -lefsrv \ + -lmpapplicationmonitor # Input HEADERS += ../inc/mpenginefactory.h \ diff -r 560ce2306a17 -r f3930dda3342 mpengine/rom/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpengine/rom/bld.inf Fri Sep 03 19:58:01 2010 -0500 @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file +* +*/ + +#include + +PRJ_EXPORTS + +mpengine.iby CORE_APP_LAYER_IBY_EXPORT_PATH(mpengine.iby) + diff -r 560ce2306a17 -r f3930dda3342 mpengine/src/mpengine.cpp --- a/mpengine/src/mpengine.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpengine/src/mpengine.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -28,6 +28,7 @@ #include "mpsettingsmanager.h" #include "mpsongscanner.h" #include "mpsongdata.h" +#include "mpapplicationmonitor.h" /*! \class MpEngine @@ -207,6 +208,7 @@ mEqualizerWrapper(0), mCurrentPresetIndex(0), mSongData(0), + mApplicationMonitor(0), mUsbBlockingState(USB_NotConnected), mPreviousUsbState(USB_NotConnected), mHandleMediaCommands(true) @@ -227,22 +229,23 @@ delete mEqualizerWrapper; delete mSongScanner; delete mSongData; + delete mApplicationMonitor; TX_EXIT } /*! Initialize engine */ -void MpEngine::initialize( TUid hostUid, EngineMode mode ) +void MpEngine::initialize( quint32 clientSecureId, EngineMode mode ) { - TX_ENTRY_ARGS("hostUid=" << hostUid.iUid << ", mode=" << mode); - mHostUid = hostUid; + TX_ENTRY_ARGS("clientSecureId=" << clientSecureId << ", mode=" << mode); + mEngineMode = mode; if ( StandAlone == mode ) { mSongData = new MpSongData(); // Harvesting Wrapper - mMpxHarvesterWrapper = new MpMpxHarvesterFrameworkWrapper( mHostUid ); + mMpxHarvesterWrapper = new MpMpxHarvesterFrameworkWrapper( clientSecureId ); connect( mMpxHarvesterWrapper, SIGNAL( scanStarted() ), this, SLOT( handleScanStarted() ), Qt::QueuedConnection ); @@ -259,7 +262,7 @@ Qt::QueuedConnection ); // Collection Wrapper - mMpxCollectionWrapper = new MpMpxCollectionFrameworkWrapper( mHostUid, mSongData ); + mMpxCollectionWrapper = new MpMpxCollectionFrameworkWrapper( clientSecureId, mSongData ); connect( mMpxCollectionWrapper, SIGNAL( collectionPlaylistOpened() ), this, SIGNAL( collectionPlaylistOpened() ), Qt::QueuedConnection ); @@ -292,11 +295,11 @@ Qt::QueuedConnection ); // Playback Wrapper - mMpxPlaybackWrapper = new MpMpxPlaybackFrameworkWrapper( mHostUid, mSongData ); + mMpxPlaybackWrapper = new MpMpxPlaybackFrameworkWrapper( clientSecureId, mSongData ); connect( this, SIGNAL( libraryUpdated() ), mMpxPlaybackWrapper, SLOT( closeCurrentPlayback() ) ); - connect( mMpxPlaybackWrapper, SIGNAL ( corruptedStop() ), - this, SIGNAL( corruptedStop() )); + connect( mMpxPlaybackWrapper, SIGNAL ( corruptedStop(bool) ), + this, SLOT( handleCorruptedStop(bool) )); connect( mMpxPlaybackWrapper, SIGNAL( volumePropertyChanged( MpCommon::MpVolumeProperty, int ) ), this, SIGNAL( volumePropertyChanged( MpCommon::MpVolumeProperty, int ) ) ); @@ -305,7 +308,7 @@ } else if ( Fetch == mode ) { // Harvesting Wrapper - mMpxHarvesterWrapper = new MpMpxHarvesterFrameworkWrapper( mHostUid ); + mMpxHarvesterWrapper = new MpMpxHarvesterFrameworkWrapper( clientSecureId ); connect( mMpxHarvesterWrapper, SIGNAL( scanStarted() ), this, SLOT( handleScanStarted() ), Qt::QueuedConnection ); @@ -322,7 +325,7 @@ Qt::QueuedConnection ); // Collection Wrapper - mMpxCollectionWrapper = new MpMpxCollectionFrameworkWrapper( mHostUid, 0 ); + mMpxCollectionWrapper = new MpMpxCollectionFrameworkWrapper( clientSecureId, 0 ); connect( mMpxCollectionWrapper, SIGNAL( collectionPlaylistOpened() ), this, SIGNAL( collectionPlaylistOpened() ), Qt::QueuedConnection ); @@ -331,18 +334,18 @@ mMpxCollectionWrapper->setShuffleFeatureEnabled( false ); // Playback Wrapper - mMpxPlaybackWrapper = new MpMpxPlaybackFrameworkWrapper( mHostUid, 0 ); + mMpxPlaybackWrapper = new MpMpxPlaybackFrameworkWrapper( clientSecureId, 0 ); connect( this, SIGNAL( libraryUpdated() ), mMpxPlaybackWrapper, SLOT( closeCurrentPlayback() ) ); - connect( mMpxPlaybackWrapper, SIGNAL ( corruptedStop() ), - this, SIGNAL( corruptedStop() )); + connect( mMpxPlaybackWrapper, SIGNAL ( corruptedStop(bool) ), + this, SLOT( handleCorruptedStop(bool) )); connect( mMpxPlaybackWrapper, SIGNAL( volumePropertyChanged( MpCommon::MpVolumeProperty, int ) ), this, SIGNAL( volumePropertyChanged( MpCommon::MpVolumeProperty, int ) ) ); } else if ( MediaBrowsing == mode ) { // Collection Wrapper - mMpxCollectionWrapper = new MpMpxCollectionFrameworkWrapper( mHostUid, 0 ); + mMpxCollectionWrapper = new MpMpxCollectionFrameworkWrapper( clientSecureId, 0 ); connect( mMpxCollectionWrapper, SIGNAL( collectionPlaylistOpened() ), this, SIGNAL( collectionPlaylistOpened() ), Qt::QueuedConnection ); @@ -353,10 +356,32 @@ else if ( Embedded == mode ) { mSongData = new MpSongData(); // Playback Wrapper - mMpxPlaybackWrapper = new MpMpxPlaybackFrameworkWrapper( mHostUid, mSongData ); + mMpxPlaybackWrapper = new MpMpxPlaybackFrameworkWrapper( clientSecureId, mSongData ); connect( mMpxPlaybackWrapper, SIGNAL( volumePropertyChanged( MpCommon::MpVolumeProperty, int ) ), this, SIGNAL( volumePropertyChanged( MpCommon::MpVolumeProperty, int ) ) ); + connect( mMpxPlaybackWrapper, SIGNAL ( corruptedStop(bool) ), + this, SLOT( handleCorruptedStop(bool) )); + } + else if ( HomeScreen == mode ) { + // Harvesting Wrapper + mMpxHarvesterWrapper = new MpMpxHarvesterFrameworkWrapper( clientSecureId ); + connect( mMpxHarvesterWrapper, SIGNAL( scanStarted() ), + this, SLOT( handleScanStarted() ), + Qt::QueuedConnection ); + connect( mMpxHarvesterWrapper, SIGNAL( scanEnded(int, int) ), + this, SLOT( handleScanEnded(int, int) ), + Qt::QueuedConnection ); + qRegisterMetaType("MpxDiskEvents"); + connect( mMpxHarvesterWrapper, SIGNAL( diskEvent(MpxDiskEvents) ), + this, SLOT( handleDiskEvent(MpxDiskEvents) ), + Qt::QueuedConnection ); + qRegisterMetaType("MpxUsbEvents"); + connect( mMpxHarvesterWrapper, SIGNAL( usbEvent(MpxUsbEvents) ), + this, SLOT( handleUsbEvent(MpxUsbEvents) ), + Qt::QueuedConnection ); + // Playback Wrapper + mMpxPlaybackWrapper = new MpMpxPlaybackFrameworkWrapper( clientSecureId, mSongData ); } TX_EXIT } @@ -428,6 +453,7 @@ void MpEngine::handleScanStarted() { TX_ENTRY mHandleMediaCommands = false; + emit libraryUpdateStarted(); TX_EXIT } @@ -463,7 +489,7 @@ break; case DiskInserted: if ( mUsbBlockingState == USB_NotConnected ) { - refreshLibrary( true ); + autoRefreshLibrary(true); } else if ( mUsbBlockingState == USB_Connected ) { emit libraryUpdated(); @@ -528,7 +554,7 @@ changeUsbBlockingState( USB_NotConnected ); emit usbBlocked(false); emit usbSynchronizationFinished(); - refreshLibrary(); + autoRefreshLibrary(); TX_EXIT } @@ -594,6 +620,29 @@ } /*! + Internal + */ +void MpEngine::autoRefreshLibrary( bool automaticRequest ) +{ + TX_ENTRY_ARGS( "mEngineMode=" << mEngineMode ); + if ( mEngineMode == StandAlone ) { + refreshLibrary(automaticRequest); + } + else if ( mEngineMode == Fetch ) { + if ( !mApplicationMonitor ) { + mApplicationMonitor = new MpApplicationMonitor(); + } + if ( !mApplicationMonitor->isApplicationRunning() ) { + // In Fetcher mode, only perform library update when main Music + // Player application is not running. Otherwise, let the main + // application take care. + refreshLibrary(automaticRequest); + } + } + TX_EXIT +} + +/*! ------------------------------------------------------------------------------- Collection related ------------------------------------------------------------------------------- @@ -1030,6 +1079,22 @@ } /*! + Slot to be called when playback encounters a corrupted song. \a lastSong + indicates whether this is the last song of the playlist. + */ +void MpEngine::handleCorruptedStop( bool lastSong ) +{ + if ( lastSong ) { + emit corruptedStop(); + } + else { + if ( mEngineMode == StandAlone ) { + skipForward(); + } + } +} + +/*! Returns pointer to MpSongData, which is the song data for Details View. */ MpSongData *MpEngine::songData() diff -r 560ce2306a17 -r f3930dda3342 mpengine/src/mpenginefactory.cpp --- a/mpengine/src/mpenginefactory.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpengine/src/mpenginefactory.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -52,14 +52,14 @@ } /*! - Returns an instance to an engine with \a hostUid, and \a mode, if the shared engine is + Returns an instance to an engine with \a clientSecureId, and \a mode, if the shared engine is already created parameters are ignored. */ -MpEngine *MpEngineFactory::createSharedEngine( TUid hostUid , MpEngine::EngineMode mode ) +MpEngine *MpEngineFactory::createSharedEngine( quint32 clientSecureId, MpEngine::EngineMode mode ) { if ( !instance()->mSharedEngine ) { instance()->mSharedEngine = new MpEngine(); - instance()->mSharedEngine->initialize( hostUid, mode ); + instance()->mSharedEngine->initialize( clientSecureId, mode ); } return instance()->mSharedEngine; } @@ -70,7 +70,7 @@ MpEngine *MpEngineFactory::createIsolatedEngine( MpEngine::EngineMode mode ) { instance()->mEngines.append( new MpEngine() ); - instance()->mEngines.last()->initialize( TUid::Uid( MpCommon::KMusicPlayerUid + instance()->mEngines.count() ), mode ); + instance()->mEngines.last()->initialize( (MpCommon::KMusicPlayerUid + instance()->mEngines.count()), mode ); return instance()->mEngines.last(); } diff -r 560ce2306a17 -r f3930dda3342 mpengine/src/mpmpxcollectionframeworkwrapper.cpp --- a/mpengine/src/mpmpxcollectionframeworkwrapper.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpengine/src/mpmpxcollectionframeworkwrapper.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -91,11 +91,11 @@ /*! Constructs the utility wrapper. */ -MpMpxCollectionFrameworkWrapper::MpMpxCollectionFrameworkWrapper( TUid hostUid, MpSongData *songData, QObject *parent ) +MpMpxCollectionFrameworkWrapper::MpMpxCollectionFrameworkWrapper( quint32 clientSecureId, MpSongData *songData, QObject *parent ) : QObject( parent ) { d_ptr = new MpMpxCollectionFrameworkWrapperPrivate( this ); - d_ptr->init( hostUid, songData ); + d_ptr->init( clientSecureId, songData ); } /*! diff -r 560ce2306a17 -r f3930dda3342 mpengine/src/mpmpxcollectionframeworkwrapper_p.cpp --- a/mpengine/src/mpmpxcollectionframeworkwrapper_p.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpengine/src/mpmpxcollectionframeworkwrapper_p.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -129,10 +129,10 @@ /*! \internal */ -void MpMpxCollectionFrameworkWrapperPrivate::init( TUid hostUid, MpSongData *songData ) +void MpMpxCollectionFrameworkWrapperPrivate::init( quint32 clientSecureId, MpSongData *songData ) { TX_ENTRY - iHostUid = hostUid; + iHostUid = TUid::Uid( clientSecureId ); iSongData = songData; TRAPD( err, DoInitL() ); if ( err != KErrNone ) { @@ -1423,13 +1423,19 @@ 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 ); + if ( cpath->Count() > 0 ) { + CMPXCollectionPlaylist* playList = CMPXCollectionPlaylist::NewL( *cpath ); + CleanupStack::PushL( playList ); + playList->SetShuffleL( true, false ); + MpSettingsManager::setShuffle( true ); + createPlaybackUtilityL(); + iPlaybackUtility->InitL( *playList, ETrue ); + CleanupStack::PopAndDestroy( playList ); + } + else { + //There were no songs to be played so switch back to collection view + emit q_ptr->restorePathFailed(); + } CleanupStack::PopAndDestroy( cpath ); TX_EXIT } diff -r 560ce2306a17 -r f3930dda3342 mpengine/src/mpmpxharvesterframeworkwrapper.cpp --- a/mpengine/src/mpmpxharvesterframeworkwrapper.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpengine/src/mpmpxharvesterframeworkwrapper.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -65,11 +65,11 @@ /*! Constructs the utility wrapper. */ -MpMpxHarvesterFrameworkWrapper::MpMpxHarvesterFrameworkWrapper( TUid hostUid, QObject *parent ) +MpMpxHarvesterFrameworkWrapper::MpMpxHarvesterFrameworkWrapper( quint32 clientSecureId, QObject *parent ) : QObject( parent ) { d_ptr = new MpMpxHarvesterFrameworkWrapperPrivate( this ); - d_ptr->init( hostUid ); + d_ptr->init( clientSecureId ); } /*! diff -r 560ce2306a17 -r f3930dda3342 mpengine/src/mpmpxharvesterframeworkwrapper_p.cpp --- a/mpengine/src/mpmpxharvesterframeworkwrapper_p.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpengine/src/mpmpxharvesterframeworkwrapper_p.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -77,9 +77,9 @@ /*! \internal */ -void MpMpxHarvesterFrameworkWrapperPrivate::init( TUid hostUid ) +void MpMpxHarvesterFrameworkWrapperPrivate::init( quint32 clientSecureId ) { - mHostUid = hostUid; + iHostUid = TUid::Uid( clientSecureId ); TRAPD( err, DoInitL() ); if ( err != KErrNone ) { TX_LOG_ARGS( "Error: " << err << "; should never get here." ); @@ -176,7 +176,7 @@ void MpMpxHarvesterFrameworkWrapperPrivate::DoInitL() { TX_ENTRY - iCollectionUtility = MMPXCollectionUtility::NewL( this, mHostUid ); + iCollectionUtility = MMPXCollectionUtility::NewL( this, iHostUid ); iHarvesterUtility = CMPXHarvesterFactory::NewL(); iHarvesterUtility->CheckForSystemEventsL(); TX_EXIT diff -r 560ce2306a17 -r f3930dda3342 mpengine/src/mpmpxisolatedcollectionhelper.cpp --- a/mpengine/src/mpmpxisolatedcollectionhelper.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpengine/src/mpmpxisolatedcollectionhelper.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -21,12 +21,15 @@ #include #include "mpmpxisolatedcollectionhelper.h" -#include "mptrace.h" +#include "mpxlog.h" + + const TInt KIncrementalDelay = 0; const TInt KIncrementalFetchBlockSize = 1000; + /*! \class CMpMpxIsolatedCollectionHelper \brief Helper class to open an isolated collection. @@ -38,45 +41,44 @@ \internal Two-phased constructor. */ -CMpMpxIsolatedCollectionHelper* CMpMpxIsolatedCollectionHelper::NewL( +CMpMpxIsolatedCollectionHelper* CMpMpxIsolatedCollectionHelper::NewL( MMpMpxIsolatedCollectionHelperObserver* aObserver ) -{ + { CMpMpxIsolatedCollectionHelper* self = NewLC( aObserver ); CleanupStack::Pop( self ); return self; -} + } /*! \internal Two-phased constructor. */ -CMpMpxIsolatedCollectionHelper* CMpMpxIsolatedCollectionHelper::NewLC( +CMpMpxIsolatedCollectionHelper* CMpMpxIsolatedCollectionHelper::NewLC( MMpMpxIsolatedCollectionHelperObserver* aObserver ) -{ + { CMpMpxIsolatedCollectionHelper* self = new ( ELeave ) CMpMpxIsolatedCollectionHelper( aObserver ); CleanupStack::PushL( self ); self->ConstructL(); return self; -} + } /*! \internal Destructor */ CMpMpxIsolatedCollectionHelper::~CMpMpxIsolatedCollectionHelper() -{ + { delete iIncrementalOpenUtil; -} - + } + /*! \internal Opens an isolated collection with the /a path. */ void CMpMpxIsolatedCollectionHelper::OpenCollectionL( CMPXCollectionPath& aPath, TInt aIndex, MpOpenMode aMode ) -{ - TX_ENTRY + { //Using incremental open to open the collection. iOpenMode = aMode; // Cancel any reads @@ -91,8 +93,7 @@ iIncrementalOpenUtil->StartL( aPath, ary, KIncrementalFetchBlockSize, aIndex, CMPXCollectionOpenUtility::EFetchDown ); CleanupStack::PopAndDestroy( &attrs ); - TX_EXIT -} + } /*! \internal @@ -102,84 +103,79 @@ : iObserver( aObserver ), iIncrementalOpenUtil( 0 ), iFirstIncrementalOpen( EFalse ) -{ -} + { + } /*! \internal Leaving constructor */ void CMpMpxIsolatedCollectionHelper::ConstructL() -{ + { iIncrementalOpenUtil = CMPXCollectionOpenUtility::NewL( this, KMcModeIsolated ); -} + + } /*! \internal reimp */ -void CMpMpxIsolatedCollectionHelper::HandleOpenL( +void CMpMpxIsolatedCollectionHelper::HandleOpenL( const CMPXMedia& aEntries, - TInt aIndex, - TBool aComplete, + TInt /*aIndex*/, + TBool /*aComplete*/, TInt aError ) -{ - Q_UNUSED( aIndex ); - Q_UNUSED( aComplete ); - TX_ENTRY_ARGS( "aError=" << aError << "aComplete=" << aComplete ); - if ( iFirstIncrementalOpen ) { + { + if ( iFirstIncrementalOpen ) + { CMPXCollectionPath* cPath = NULL; iFirstIncrementalOpen = EFalse; switch( iOpenMode ) { - case RestorePathMode: - cPath = iIncrementalOpenUtil->PathL(); - CleanupStack::PushL( cPath ); - iObserver->HandleIsolatedOpenRestorePathL( *cPath, aError ); - CleanupStack::PopAndDestroy( cPath ); - break; - case DefaultMode: - default: - iObserver->HandleIsolatedOpenL( aEntries, aError ); - break; - } + case RestorePathMode: + cPath = iIncrementalOpenUtil->PathL(); + CleanupStack::PushL( cPath ); + iObserver->HandleIsolatedOpenRestorePathL( *cPath, aError ); + CleanupStack::PopAndDestroy( cPath ); + + break; + case DefaultMode: + default: + iObserver->HandleIsolatedOpenL( aEntries, aError ); + break; + } + + } } - TX_EXIT -} /*! \internal reimp */ -void CMpMpxIsolatedCollectionHelper::HandleOpenL( - const CMPXCollectionPlaylist& aPlaylist, - TInt aError ) -{ - Q_UNUSED( aPlaylist ); - Q_UNUSED( aError ); -} +void CMpMpxIsolatedCollectionHelper::HandleOpenL( + const CMPXCollectionPlaylist& /*aPlaylist*/, + TInt /*aError*/ ) + { + } /*! \internal reimp */ -void CMpMpxIsolatedCollectionHelper::HandleCollectionMessage( - CMPXMessage* aMsg, - TInt aErr ) -{ - Q_UNUSED( aMsg ); - Q_UNUSED( aErr ); -} +void CMpMpxIsolatedCollectionHelper::HandleCollectionMessage( + CMPXMessage* /*aMsg*/, + TInt /*aErr*/ ) + { + } /*! \internal reimp */ -void CMpMpxIsolatedCollectionHelper::HandleCollectionMediaL( - const CMPXMedia& aMedia, - TInt aError ) -{ - Q_UNUSED( aMedia ); - Q_UNUSED( aError ); -} - +void CMpMpxIsolatedCollectionHelper::HandleCollectionMediaL( + const CMPXMedia& /*aMedia*/, + TInt /*aError*/ ) + { + } + +//EOF diff -r 560ce2306a17 -r f3930dda3342 mpengine/src/mpmpxplaybackframeworkwrapper.cpp --- a/mpengine/src/mpmpxplaybackframeworkwrapper.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpengine/src/mpmpxplaybackframeworkwrapper.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -36,11 +36,11 @@ */ /*! - \fn void corruptedStop(); + \fn void corruptedStop( bool lastSong ); - This signal is emitted when a courrpted song is discovered and is the last song of - the playlist - */ + This signal is emitted when playback encounters a corrupted song. \a lastSong + indicates whether this is the last song of the playlist. +*/ /*! \fn void fileCorrupted(int fileId); @@ -51,11 +51,11 @@ /*! Constructs the utility wrapper. */ -MpMpxPlaybackFrameworkWrapper::MpMpxPlaybackFrameworkWrapper( TUid hostUid, MpSongData *songData, QObject *parent ) +MpMpxPlaybackFrameworkWrapper::MpMpxPlaybackFrameworkWrapper( quint32 clientSecureId, MpSongData *songData, QObject *parent ) : QObject(parent) { d_ptr = new MpMpxPlaybackFrameworkWrapperPrivate(this ); - d_ptr->init( hostUid, songData ); + d_ptr->init( clientSecureId, songData ); } /*! diff -r 560ce2306a17 -r f3930dda3342 mpengine/src/mpmpxplaybackframeworkwrapper_p.cpp --- a/mpengine/src/mpmpxplaybackframeworkwrapper_p.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpengine/src/mpmpxplaybackframeworkwrapper_p.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -79,10 +79,10 @@ /*! \internal */ -void MpMpxPlaybackFrameworkWrapperPrivate::init( TUid hostUid, MpSongData *songData ) +void MpMpxPlaybackFrameworkWrapperPrivate::init( quint32 clientSecureId, MpSongData *songData ) { TX_ENTRY - iHostUid = hostUid; + iHostUid = TUid::Uid( clientSecureId ); iSongData = songData; TRAPD(err, DoInitL()); if ( err != KErrNone ) { @@ -735,29 +735,34 @@ { TX_ENTRY switch ( aError ) { - case KErrCorrupt:{ - MMPXSource* source( iPlaybackUtility->Source() ); - if ( source ){ - CMPXCollectionPlaylist* playlist( source->PlaylistL() ); - if ( playlist ){ - MpPlaybackData* pData = playbackData(); - pData->setCorrupted( playlist->Path().IdOfIndex( playlist->Index() ).iId2 ); - - if ( playlist->Index() == ( playlist->Count()-1 ) ){ - //reach the end of list, pop up corrupt notification - emit q_ptr->corruptedStop(); - } - else{ - //corrupted song, skip to next song - skipForward(); - } - } + case KErrNotSupported: + case KErrCorrupt:{ + MMPXSource* source( iPlaybackUtility->Source() ); + if ( source ){ + CMPXCollectionPlaylist* playlist( source->PlaylistL() ); + if ( playlist ){ + MpPlaybackData* pData = playbackData(); + pData->setCorrupted( playlist->Path().IdOfIndex( playlist->Index() ).iId2 ); + + if ( playlist->Index() == ( playlist->Count()-1 ) ){ + //reach the end of list, pop up corrupt notification + emit q_ptr->corruptedStop(true); } - break; + else{ + //corrupted song; there is more song in the playlist + emit q_ptr->corruptedStop(false); + } } - default: - break; + else{ + // No playlist;single file playback. + emit q_ptr->corruptedStop(true); + } } + break; + } + default: + break; + } TX_EXIT } diff -r 560ce2306a17 -r f3930dda3342 mpengine/src/mpsongscanner.cpp --- a/mpengine/src/mpsongscanner.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpengine/src/mpsongscanner.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -59,7 +59,7 @@ { TX_ENTRY connect( mMpxHarvesterWrapper, SIGNAL( scanStarted() ), - this, SIGNAL( scanStarted() ), Qt::QueuedConnection ); + this, SLOT( handleScanStarted() ), Qt::QueuedConnection ); connect( mMpxHarvesterWrapper, SIGNAL( scanEnded( int, int ) ), this, SLOT( handleScanEnded( int, int ) ), Qt::QueuedConnection ); connect( mMpxHarvesterWrapper, SIGNAL( scanCountChanged( int ) ), @@ -116,12 +116,24 @@ } /*! + Slot called upon notification from MPX Harvesting FW indicating start of + scanning process. + */ +void MpSongScanner::handleScanStarted() +{ + TX_ENTRY + mScanning = true; + emit scanStarted(); + TX_EXIT +} + +/*! Slot called upon notification from MPX Harvesting FW indicating end of scanning process. */ void MpSongScanner::handleScanEnded( int numItemsAdded, int error ) { - TX_ENTRY + TX_ENTRY_ARGS("error=" << error << ", numItemsAdded=" << numItemsAdded); if (error == KErrDiskFull) { emit scanFinished( ScanErrorDiskFull, 0 ); mScanning = false; diff -r 560ce2306a17 -r f3930dda3342 mpengine/tsrc/unittest_mpengine/inc/unittest_mpengine.h --- a/mpengine/tsrc/unittest_mpengine/inc/unittest_mpengine.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpengine/tsrc/unittest_mpengine/inc/unittest_mpengine.h Fri Sep 03 19:58:01 2010 -0500 @@ -97,7 +97,7 @@ } static MpEngine *createIsolatedEngine( MpEngine::EngineMode mode ) { instance()->mEngines.append( new MpEngine() ); - instance()->mEngines.last()->initialize( TUid::Uid( MpCommon::KMusicPlayerUid + instance()->mEngines.count() ), mode ); + instance()->mEngines.last()->initialize( (MpCommon::KMusicPlayerUid + instance()->mEngines.count()), mode ); return instance()->mEngines.last(); } static void close() { diff -r 560ce2306a17 -r f3930dda3342 mpengine/tsrc/unittest_mpengine/stub/inc/mpmpxcollectionframeworkwrapper.h --- a/mpengine/tsrc/unittest_mpengine/stub/inc/mpmpxcollectionframeworkwrapper.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpengine/tsrc/unittest_mpengine/stub/inc/mpmpxcollectionframeworkwrapper.h Fri Sep 03 19:58:01 2010 -0500 @@ -33,7 +33,7 @@ public: - explicit MpMpxCollectionFrameworkWrapper( TUid hostUid=TUid::Uid(MpCommon::KMusicPlayerUid), + explicit MpMpxCollectionFrameworkWrapper( quint32 clientSecureId=MpCommon::KMusicPlayerUid, MpSongData *songData=0, QObject *parent=0 ); virtual ~MpMpxCollectionFrameworkWrapper(); diff -r 560ce2306a17 -r f3930dda3342 mpengine/tsrc/unittest_mpengine/stub/inc/mpmpxharvesterframeworkwrapper.h --- a/mpengine/tsrc/unittest_mpengine/stub/inc/mpmpxharvesterframeworkwrapper.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpengine/tsrc/unittest_mpengine/stub/inc/mpmpxharvesterframeworkwrapper.h Fri Sep 03 19:58:01 2010 -0500 @@ -28,7 +28,7 @@ Q_OBJECT public: - explicit MpMpxHarvesterFrameworkWrapper( TUid hostUid = TUid::Uid( MpCommon::KMusicPlayerUid ), QObject *parent=0 ); + explicit MpMpxHarvesterFrameworkWrapper( quint32 clientSecureId=MpCommon::KMusicPlayerUid, QObject *parent=0 ); virtual ~MpMpxHarvesterFrameworkWrapper(); // mock functions diff -r 560ce2306a17 -r f3930dda3342 mpengine/tsrc/unittest_mpengine/stub/inc/mpmpxplaybackframeworkwrapper.h --- a/mpengine/tsrc/unittest_mpengine/stub/inc/mpmpxplaybackframeworkwrapper.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpengine/tsrc/unittest_mpengine/stub/inc/mpmpxplaybackframeworkwrapper.h Fri Sep 03 19:58:01 2010 -0500 @@ -36,7 +36,7 @@ public: - explicit MpMpxPlaybackFrameworkWrapper( TUid hostUid=TUid::Uid(MpCommon::KMusicPlayerUid), + explicit MpMpxPlaybackFrameworkWrapper( quint32 clientSecureId=MpCommon::KMusicPlayerUid, MpSongData *songData=0, QObject *parent=0 ); virtual ~MpMpxPlaybackFrameworkWrapper(); diff -r 560ce2306a17 -r f3930dda3342 mpengine/tsrc/unittest_mpengine/stub/src/mpmpxcollectionframeworkwrapper.cpp --- a/mpengine/tsrc/unittest_mpengine/stub/src/mpmpxcollectionframeworkwrapper.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpengine/tsrc/unittest_mpengine/stub/src/mpmpxcollectionframeworkwrapper.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -21,10 +21,10 @@ /*! Constructs the utility wrapper. */ -MpMpxCollectionFrameworkWrapper::MpMpxCollectionFrameworkWrapper( TUid hostUid, MpSongData *songData, QObject *parent ) +MpMpxCollectionFrameworkWrapper::MpMpxCollectionFrameworkWrapper( quint32 clientSecureId, MpSongData *songData, QObject *parent ) : QObject( parent ) { - Q_UNUSED(hostUid); + Q_UNUSED(clientSecureId); Q_UNUSED(songData); } diff -r 560ce2306a17 -r f3930dda3342 mpengine/tsrc/unittest_mpengine/stub/src/mpmpxharvesterframeworkwrapper.cpp --- a/mpengine/tsrc/unittest_mpengine/stub/src/mpmpxharvesterframeworkwrapper.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpengine/tsrc/unittest_mpengine/stub/src/mpmpxharvesterframeworkwrapper.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -20,14 +20,14 @@ /*! Stub function. */ -MpMpxHarvesterFrameworkWrapper::MpMpxHarvesterFrameworkWrapper( TUid hostUid, QObject *parent ) +MpMpxHarvesterFrameworkWrapper::MpMpxHarvesterFrameworkWrapper( quint32 clientSecureId, QObject *parent ) : QObject( parent ), mScanRequested( false ), mScanning( false ), mScanCount( -1 ), mCheckSystemEventsRequested( false ) { - Q_UNUSED( hostUid ); + Q_UNUSED( clientSecureId ); } diff -r 560ce2306a17 -r f3930dda3342 mpengine/tsrc/unittest_mpengine/stub/src/mpmpxplaybackframeworkwrapper.cpp --- a/mpengine/tsrc/unittest_mpengine/stub/src/mpmpxplaybackframeworkwrapper.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpengine/tsrc/unittest_mpengine/stub/src/mpmpxplaybackframeworkwrapper.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -30,10 +30,10 @@ /*! Constructs the utility wrapper. */ -MpMpxPlaybackFrameworkWrapper::MpMpxPlaybackFrameworkWrapper( TUid hostUid, MpSongData *songData, QObject *parent ) +MpMpxPlaybackFrameworkWrapper::MpMpxPlaybackFrameworkWrapper( quint32 clientSecureId, MpSongData *songData, QObject *parent ) : QObject(parent) { - Q_UNUSED(hostUid); + Q_UNUSED(clientSecureId); Q_UNUSED(songData); } diff -r 560ce2306a17 -r f3930dda3342 mpengine/tsrc/unittest_mpenginefactory/stub/inc/mpengine.h --- a/mpengine/tsrc/unittest_mpenginefactory/stub/inc/mpengine.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpengine/tsrc/unittest_mpenginefactory/stub/inc/mpengine.h Fri Sep 03 19:58:01 2010 -0500 @@ -35,7 +35,7 @@ private: explicit MpEngine(); - void initialize( TUid hostUid, EngineMode mode); + void initialize( quint32 clientSecureId, EngineMode mode); public: virtual ~MpEngine(); diff -r 560ce2306a17 -r f3930dda3342 mpengine/tsrc/unittest_mpenginefactory/stub/src/mpengine.cpp --- a/mpengine/tsrc/unittest_mpenginefactory/stub/src/mpengine.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpengine/tsrc/unittest_mpenginefactory/stub/src/mpengine.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -33,8 +33,8 @@ /*! Initialize engine */ -void MpEngine::initialize( TUid hostUid, EngineMode mode ) +void MpEngine::initialize( quint32 clientSecureId, EngineMode mode ) { - Q_UNUSED( hostUid ); + Q_UNUSED( clientSecureId ); Q_UNUSED( mode ); } diff -r 560ce2306a17 -r f3930dda3342 mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/src/unittest_mpmpxcollectionframeworkwrapper.cpp --- a/mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/src/unittest_mpmpxcollectionframeworkwrapper.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/src/unittest_mpmpxcollectionframeworkwrapper.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -119,7 +119,7 @@ */ void TestMpMpxCollectionFrameworkWrapper::init() { - mTest = new MpMpxCollectionFrameworkWrapper(TUid::Uid(MpCommon::KMusicPlayerUid), mSongData); + mTest = new MpMpxCollectionFrameworkWrapper(MpCommon::KMusicPlayerUid, mSongData); mTestPrivate = mTest->d_ptr; } @@ -803,6 +803,7 @@ testMessage->SetTObjectValueL(KMPXMessageGeneralEvent,TMPXCollectionMessage::EPathChanged); testMessage->SetTObjectValueL(KMPXMessageGeneralType,EMcPathChangedByOpen); testMessage->SetTObjectValueL(KMPXMessageGeneralData,EMcItemOpened); + testMessage->SetTObjectValueL(KMPXMessageChangeEventType,EMPXItemDeleted); mTestPrivate->DoHandleCollectionMessageL(*testMessage); QCOMPARE(spy.count(), 1); diff -r 560ce2306a17 -r f3930dda3342 mpengine/tsrc/unittest_mpmpxisolatedcollectionhelper/src/unittest_mpmpxisolatedcollectionhelper.cpp --- a/mpengine/tsrc/unittest_mpmpxisolatedcollectionhelper/src/unittest_mpmpxisolatedcollectionhelper.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpengine/tsrc/unittest_mpmpxisolatedcollectionhelper/src/unittest_mpmpxisolatedcollectionhelper.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -112,7 +112,7 @@ QCOMPARE(mTest->iIncrementalOpenUtil->iStop,TBool(ETrue)); QCOMPARE(mTest->iIncrementalOpenUtil->iStart,TBool(ETrue)); QCOMPARE(mTest->iFirstIncrementalOpen,TBool(ETrue)); - QCOMPARE(mTest->iIncrementalOpenUtil->iDirection,CMPXCollectionOpenUtility::EFetchNormal); + QCOMPARE(mTest->iIncrementalOpenUtil->iDirection,CMPXCollectionOpenUtility::EFetchDown); QCOMPARE(mTest->iIncrementalOpenUtil->iChunkSize, KIncrementalFetchBlockSize); QCOMPARE((int)mTest->iIncrementalOpenUtil->iPath, (int)path); QCOMPARE(mTest->iOpenMode, CMpMpxIsolatedCollectionHelper::DefaultMode ); @@ -122,7 +122,7 @@ QCOMPARE(mTest->iIncrementalOpenUtil->iStop,TBool(ETrue)); QCOMPARE(mTest->iIncrementalOpenUtil->iStart,TBool(ETrue)); QCOMPARE(mTest->iFirstIncrementalOpen,TBool(ETrue)); - QCOMPARE(mTest->iIncrementalOpenUtil->iDirection,CMPXCollectionOpenUtility::EFetchNormal); + QCOMPARE(mTest->iIncrementalOpenUtil->iDirection,CMPXCollectionOpenUtility::EFetchDown); QCOMPARE(mTest->iIncrementalOpenUtil->iChunkSize, KIncrementalFetchBlockSize); QCOMPARE((int)mTest->iIncrementalOpenUtil->iPath, (int)path); QCOMPARE(mTest->iOpenMode, CMpMpxIsolatedCollectionHelper::RestorePathMode ); diff -r 560ce2306a17 -r f3930dda3342 mpengine/tsrc/unittest_mpmpxplaybackframeworkwrapper/inc/unittest_mpmpxplaybackframeworkwrapper.h --- a/mpengine/tsrc/unittest_mpmpxplaybackframeworkwrapper/inc/unittest_mpmpxplaybackframeworkwrapper.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpengine/tsrc/unittest_mpmpxplaybackframeworkwrapper/inc/unittest_mpmpxplaybackframeworkwrapper.h Fri Sep 03 19:58:01 2010 -0500 @@ -56,6 +56,7 @@ void testSetShuffle(); void testSetRepeat(); void testHandlePlaybackMessage(); + void testHandlePlaybackError(); void testHandleProperty(); void testHandleMedia(); void testHandleMediaDetails(); diff -r 560ce2306a17 -r f3930dda3342 mpengine/tsrc/unittest_mpmpxplaybackframeworkwrapper/src/unittest_mpmpxplaybackframeworkwrapper.cpp --- a/mpengine/tsrc/unittest_mpmpxplaybackframeworkwrapper/src/unittest_mpmpxplaybackframeworkwrapper.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpengine/tsrc/unittest_mpmpxplaybackframeworkwrapper/src/unittest_mpmpxplaybackframeworkwrapper.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -107,7 +107,7 @@ */ void TestMpMpxPlaybackFrameworkWrapper::init() { - mTest = new MpMpxPlaybackFrameworkWrapper(TUid::Uid(MpCommon::KMusicPlayerUid), mSongData); + mTest = new MpMpxPlaybackFrameworkWrapper(MpCommon::KMusicPlayerUid, mSongData); mTestPrivate = mTest->d_ptr; } @@ -271,6 +271,23 @@ } /*! + Tests handlePlaybackError + */ +void TestMpMpxPlaybackFrameworkWrapper::testHandlePlaybackError() +{ + mTestPrivate->iPlaybackUtility->iReturnSource = true; + mTestPrivate->DoHandlePlaybackErrorL(-20); + QCOMPARE(mTestPrivate->iPlaybackUtility->iCmd, EPbCmdNext); + QCOMPARE(mTestPrivate->iPlaybackData->mCorrupted, true); + QSignalSpy spy(mTest, SIGNAL(corruptedStop())); + mTestPrivate->iPlaybackData->mCorrupted = false; + mTestPrivate->iPlaybackUtility->iSetPlaylistEnd = true; + mTestPrivate->DoHandlePlaybackErrorL(-20); + QCOMPARE(mTestPrivate->iPlaybackData->mCorrupted, true); + QCOMPARE(spy.count(), 1); +} + +/*! Tests handleProperty */ void TestMpMpxPlaybackFrameworkWrapper::testHandleProperty() diff -r 560ce2306a17 -r f3930dda3342 mpengine/tsrc/unittest_mpmpxplaybackframeworkwrapper/stub/inc/mpplaybackdata.h --- a/mpengine/tsrc/unittest_mpmpxplaybackframeworkwrapper/stub/inc/mpplaybackdata.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpengine/tsrc/unittest_mpmpxplaybackframeworkwrapper/stub/inc/mpplaybackdata.h Fri Sep 03 19:58:01 2010 -0500 @@ -72,6 +72,7 @@ QString currentUri; TBool mMediaReady; bool mRealAudio; + bool mCorrupted; int mAlbumId; int mId; diff -r 560ce2306a17 -r f3930dda3342 mpengine/tsrc/unittest_mpmpxplaybackframeworkwrapper/stub/inc/mpxplaybackutility.h --- a/mpengine/tsrc/unittest_mpmpxplaybackframeworkwrapper/stub/inc/mpxplaybackutility.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpengine/tsrc/unittest_mpmpxplaybackframeworkwrapper/stub/inc/mpxplaybackutility.h Fri Sep 03 19:58:01 2010 -0500 @@ -76,8 +76,10 @@ CMPXCommand* iCMPXCmd; TMPXPlaybackState iState; RArray* iAttrs; + CMPXCollectionPlaylist* iCurrentPlaylist; bool iInitialized; bool iReturnSource; + bool iSetPlaylistEnd; }; #endif // MMPXPLAYBACKUTILITY_H diff -r 560ce2306a17 -r f3930dda3342 mpengine/tsrc/unittest_mpmpxplaybackframeworkwrapper/stub/src/mpplaybackdata.cpp --- a/mpengine/tsrc/unittest_mpmpxplaybackframeworkwrapper/stub/src/mpplaybackdata.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpengine/tsrc/unittest_mpmpxplaybackframeworkwrapper/stub/src/mpplaybackdata.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -34,6 +34,7 @@ mPlaybackState(MpPlaybackData::Stopped), mMediaReady(EFalse), mRealAudio( false ), + mCorrupted( false ), mAlbumId( 0 ), mId( 0 ) { @@ -278,6 +279,7 @@ mAlbumId = 0; mId = 0; mRealAudio = false; + mCorrupted = false; } /*! @@ -285,7 +287,8 @@ */ void MpPlaybackData::setCorrupted( int id ) { - + Q_UNUSED(id); + mCorrupted = true; } //end of file diff -r 560ce2306a17 -r f3930dda3342 mpengine/tsrc/unittest_mpmpxplaybackframeworkwrapper/stub/src/mpxplaybackutility.cpp --- a/mpengine/tsrc/unittest_mpmpxplaybackframeworkwrapper/stub/src/mpxplaybackutility.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpengine/tsrc/unittest_mpmpxplaybackframeworkwrapper/stub/src/mpxplaybackutility.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -17,6 +17,7 @@ #include #include +#include #include #include "stub/inc/mpxplaybackutility.h" @@ -32,7 +33,9 @@ iState(EPbStateNotInitialised), iAttrs(0), iInitialized(false), - iReturnSource(true) + iReturnSource(true), + iSetPlaylistEnd(false), + iCurrentPlaylist(0) { } @@ -144,8 +147,21 @@ */ CMPXCollectionPlaylist* MMPXPlaybackUtility::PlaylistL() { - CMPXCollectionPlaylist* temp = CMPXCollectionPlaylist::NewL(); - return temp; + CMPXCollectionPath *testPath = CMPXCollectionPath::NewL(); + RArray pathItems; + CleanupStack::PushL(testPath); + testPath->AppendL(5); + for (int i = 0; i < 5; i++ ) { + pathItems.AppendL( TMPXItemId( 300 + i ) ); + } + testPath->AppendL( pathItems.Array() ); + //Create testPlaylist + iCurrentPlaylist = CMPXCollectionPlaylist::NewL( *testPath ); + if (iSetPlaylistEnd){ + iCurrentPlaylist->SetToLast(); + } + CleanupStack::PopAndDestroy( testPath ); + return iCurrentPlaylist; } /*! diff -r 560ce2306a17 -r f3930dda3342 mpserviceplugins/audioeffects/group/bld.inf --- a/mpserviceplugins/audioeffects/group/bld.inf Tue Aug 24 03:36:14 2010 -0500 +++ b/mpserviceplugins/audioeffects/group/bld.inf Fri Sep 03 19:58:01 2010 -0500 @@ -21,6 +21,7 @@ DEFAULT PRJ_EXPORTS +../rom/mpxaudioeffects.iby CORE_APP_LAYER_IBY_EXPORT_PATH(mpxaudioeffects.iby) PRJ_MMPFILES mpxaudioeffectengine.mmp diff -r 560ce2306a17 -r f3930dda3342 mpserviceplugins/localaudio/group/bld.inf --- a/mpserviceplugins/localaudio/group/bld.inf Tue Aug 24 03:36:14 2010 -0500 +++ b/mpserviceplugins/localaudio/group/bld.inf Fri Sep 03 19:58:01 2010 -0500 @@ -21,6 +21,8 @@ DEFAULT PRJ_EXPORTS +../rom/mpxlocalaudioplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(mpxlocalaudioplugin.iby) + PRJ_MMPFILES mpxlocalaudioplayback.mmp diff -r 560ce2306a17 -r f3930dda3342 mpserviceplugins/m3uplaylistplugin/group/bld.inf --- a/mpserviceplugins/m3uplaylistplugin/group/bld.inf Tue Aug 24 03:36:14 2010 -0500 +++ b/mpserviceplugins/m3uplaylistplugin/group/bld.inf Fri Sep 03 19:58:01 2010 -0500 @@ -21,6 +21,8 @@ DEFAULT PRJ_EXPORTS +../rom/mpxm3uplaylistplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(mpxm3uplaylistplugin.iby) + PRJ_MMPFILES mpxm3uplaylistparsers.mmp diff -r 560ce2306a17 -r f3930dda3342 mpserviceplugins/mpxinmemoryplugin/group/bld.inf --- a/mpserviceplugins/mpxinmemoryplugin/group/bld.inf Tue Aug 24 03:36:14 2010 -0500 +++ b/mpserviceplugins/mpxinmemoryplugin/group/bld.inf Fri Sep 03 19:58:01 2010 -0500 @@ -21,6 +21,8 @@ DEFAULT PRJ_EXPORTS +../rom/mpxinmemplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(mpxinmemplugin.iby) + PRJ_MMPFILES mpxinmemoryplugin.mmp \ No newline at end of file diff -r 560ce2306a17 -r f3930dda3342 mpserviceplugins/mpxsqlitedbcommon/group/bld.inf --- a/mpserviceplugins/mpxsqlitedbcommon/group/bld.inf Tue Aug 24 03:36:14 2010 -0500 +++ b/mpserviceplugins/mpxsqlitedbcommon/group/bld.inf Fri Sep 03 19:58:01 2010 -0500 @@ -21,6 +21,8 @@ DEFAULT PRJ_EXPORTS +../rom/mpxsqlitedbcommon.iby CORE_APP_LAYER_IBY_EXPORT_PATH(mpxsqlitedbcommon.iby) + PRJ_MMPFILES mpxsqlitedbcommon.mmp diff -r 560ce2306a17 -r f3930dda3342 mpserviceplugins/mpxsqlitedbhgplugin/group/bld.inf --- a/mpserviceplugins/mpxsqlitedbhgplugin/group/bld.inf Tue Aug 24 03:36:14 2010 -0500 +++ b/mpserviceplugins/mpxsqlitedbhgplugin/group/bld.inf Fri Sep 03 19:58:01 2010 -0500 @@ -23,6 +23,10 @@ PRJ_EXPORTS +../rom/mpxsqlitedbhgplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(mpxsqlitedbhgplugin.iby) +../rom/mpxsqlitedbhgpluginrsc.iby CORE_APP_LAYER_IBY_EXPORT_PATH(mpxsqlitedbhgpluginrsc.iby) + + PRJ_EXTENSIONS START EXTENSION s60/mifconv OPTION TARGETFILE mpxdbhgplugin.mif diff -r 560ce2306a17 -r f3930dda3342 mpserviceplugins/mpxsqlitedbhgplugin/src/mpxdbalbum.cpp --- a/mpserviceplugins/mpxsqlitedbhgplugin/src/mpxdbalbum.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpserviceplugins/mpxsqlitedbhgplugin/src/mpxdbalbum.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -1063,14 +1063,11 @@ // ---------------------------------------------------------------------------- // TBool CMPXDbAlbum::NeedToUpdateArt(const TDesC& aDeletedSongArt, const TDesC& aCurrentAlbumArt) - { - if (aDeletedSongArt.Length() == 0) - { - // Deleted song's art has default album art - return EFalse; - } + { + TBool needToUpdateArt = EFalse; + #ifdef ABSTRACTAUDIOALBUM_INCLUDED - else + TBool isNonEmbedded = EFalse; if (aDeletedSongArt.Length() > 0) { TParsePtrC parse(aDeletedSongArt); @@ -1080,20 +1077,21 @@ if (ext.CompareF(KAbstractAlbumExt) == 0) { // Deleted song's art is Non-embedded album art - return EFalse; + isNonEmbedded = ETrue; } } - else -#endif - if (aDeletedSongArt.Length() > 0 && aCurrentAlbumArt.Length() > 0 && aDeletedSongArt.CompareF(aCurrentAlbumArt) == 0) + if (!isNonEmbedded) { - // Deleted song's art is Embedded album art and it is the same as Album's current art - return ETrue; +#endif // ABSTRACTAUDIOALBUM_INCLUDED + if (aDeletedSongArt.Length() > 0 && aCurrentAlbumArt.Length() > 0 && aDeletedSongArt.CompareF(aCurrentAlbumArt) == 0) + { + // Deleted song's art is Embedded album art and it is the same as Album's current art + needToUpdateArt = ETrue; + } +#ifdef ABSTRACTAUDIOALBUM_INCLUDED } - else - { - return EFalse; - } +#endif // ABSTRACTAUDIOALBUM_INCLUDED + return needToUpdateArt; } // ---------------------------------------------------------------------------- diff -r 560ce2306a17 -r f3930dda3342 mpserviceplugins/mpxsqlitepodcastdbplugin/group/bld.inf --- a/mpserviceplugins/mpxsqlitepodcastdbplugin/group/bld.inf Tue Aug 24 03:36:14 2010 -0500 +++ b/mpserviceplugins/mpxsqlitepodcastdbplugin/group/bld.inf Fri Sep 03 19:58:01 2010 -0500 @@ -23,6 +23,10 @@ PRJ_EXPORTS +../rom/mpxsqlitepodcastdbplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(mpxsqlitepodcastdbplugin.iby) +../rom/mpxsqlitepodcastdbpluginrsc.iby CORE_APP_LAYER_IBY_EXPORT_PATH(mpxsqlitepodcastdbpluginrsc.iby) + + PRJ_EXTENSIONS START EXTENSION s60/mifconv OPTION TARGETFILE mpxpodcastdbplugin.mif diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpcollectionviewplugin/inc/mpcollectioncontainer.h --- a/mpviewplugins/mpcollectionviewplugin/inc/mpcollectioncontainer.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpcollectionviewplugin/inc/mpcollectioncontainer.h Fri Sep 03 19:58:01 2010 -0500 @@ -47,7 +47,7 @@ signals: void itemActivated( int index ); - void itemLongPressed( int index, const QPointF &coords ); + void itemLongPressed( const QModelIndex &index, const QPointF &coords ); void findAlbumSongs( int index ); void playAlbumSongs( int albumIndex, int songIndex ); void shuffleEnabled( bool enabled ); diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpcollectionviewplugin/inc/mpcollectionpopuphandler.h --- a/mpviewplugins/mpcollectionviewplugin/inc/mpcollectionpopuphandler.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpcollectionviewplugin/inc/mpcollectionpopuphandler.h Fri Sep 03 19:58:01 2010 -0500 @@ -19,6 +19,7 @@ #define MPCOLLECTIONPOPUPHANDLER_H #include +#include #include "mpmpxcollectionviewdefs.h" class MpCollectionView; @@ -38,15 +39,16 @@ MpCollectionPopupHandler( MpCollectionView *parent ); virtual ~MpCollectionPopupHandler(); - void openDefaultViewContextMenu( int index, const QPointF &coords ); - void openFetchViewContextMenu( int index, const QPointF &coords ); + void openDefaultViewContextMenu( const QModelIndex &index, const QPointF &coords ); + void openFetchViewContextMenu( const QModelIndex &index, const QPointF &coords ); void openRenamePlaylistContainerDialog( const QString ¤tName ); void openRenamePlaylistItemDialog( const QString ¤tName ); void openAddSongsToPlaylist( QAbstractItemModel* model ); void openAddSongsToPlaylistFromTBone(); void openDeleteSongs( QAbstractItemModel* model ); void openAddToCurrentPlaylist( MpMpxCollectionData* collectionData ); - void openCreateNewPlaylist( MpMpxCollectionData* collectionData ); + void openCreateNewPlaylist( MpMpxCollectionData* collectionData, bool isolated ); + void openCreateNewPlaylistFromTBone(); void openArrangeSongs(); void cancelOngoingPopup( bool onlyContextMenu ); @@ -74,16 +76,17 @@ void handleOperationEnded( bool success ); void outstandingPopupClosing(); + void inputDialogChanged( QString text ); + void requestDelete(); private: void setOutstandingPopup( HbPopup *popup ); void clearOutstandingPopup( HbPopup *popup ); void launchAddToPlaylistDialog( QList &selection ); void queryNewPlaylistName(const QStringList &playlists, const char *handler ); - void getText(const QString &label, const QString &text, const char *handler ); - void getModelIndexes( const QString &label, QAbstractItemModel* model, const char *handler ); + void getText(const QString &label, const QString &text, const QString &confirmationActionLabel, const char *handler ); + void getModelIndexes( const QString &label, const QString &confirmationActionLabel, QAbstractItemModel* model, const char *handler ); void launchArrangeSongsDialog(); - void requestDelete( QList &selection ); void launchProgressDialog( const char *id ); void connectExternalEvents(); diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpcollectionviewplugin/inc/mpcollectionview.h --- a/mpviewplugins/mpcollectionviewplugin/inc/mpcollectionview.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpcollectionviewplugin/inc/mpcollectionview.h Fri Sep 03 19:58:01 2010 -0500 @@ -53,7 +53,7 @@ void activateView(); void deactivateView(); bool isActivated(); - void openItem( int index ); + void openItem( const QModelIndex &index ); void showItemDetails( int index ); signals: @@ -84,6 +84,7 @@ void shufflePlayAll(); void addToPlaylist(); + void createNewPlaylist(); void deleteSongs(); void renameCurrentPlaylistContainer(); @@ -94,7 +95,7 @@ void prepareToAddToPlaylist(); void handleIsolatedCollectionOpened( MpMpxCollectionData* collectionData ); void arrangeSongs(); - void openContextMenu( int index, const QPointF &coords ); + void openContextMenu( const QModelIndex &index, const QPointF &coords ); void handleUsbBlocked( bool blocked ); void handleLibraryAboutToUpdate(); diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpcollectionviewplugin/resources/tbonemediawall.css --- a/mpviewplugins/mpcollectionviewplugin/resources/tbonemediawall.css Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpcollectionviewplugin/resources/tbonemediawall.css Fri Sep 03 19:58:01 2010 -0500 @@ -15,18 +15,6 @@ zvalue: 0; } -HgMediawall#albumWall::centeritem -{ - size-policy: fixed fixed; - fixed-height: 24.5un; - fixed-width: 24.5un; - left:0un; - right:0un; - top:-var(hb-param-margin-gene-screen); - bottom:0un; - zvalue: 2; -} - HgMediawall#albumWall::title { text-height: var(hb-param-text-height-primary); @@ -37,8 +25,8 @@ text-wrap-mode:no-wrap; left:-var(hb-param-margin-gene-screen); right:var(hb-param-margin-gene-screen); - top:0un; - bottom:var(hb-param-margin-middle-vertical); + top:-var(hb-param-margin-gene-screen); + bottom:var(hb-param-margin-gene-middle-vertical); zvalue: 2; } @@ -52,12 +40,23 @@ text-wrap-mode:no-wrap; left:-var(hb-param-margin-gene-screen); right:var(hb-param-margin-gene-screen); - top:0un; + top:-var(hb-param-margin-gene-middle-vertical); + bottom:var(hb-param-margin-gene-middle-vertical); + zvalue: 2; +} + +HgMediawall#albumWall::centeritem +{ + size-policy: fixed fixed; + fixed-height: 24.5un; + fixed-width: 24.5un; + left:0un; + right:0un; + top:-var(hb-param-margin-gene-middle-vertical); bottom:1.5un; zvalue: 2; } - /*Artist Albums TBone*/ HgMediawall#artistAlbumWall { @@ -75,18 +74,6 @@ zvalue: 0; } -HgMediawall#artistAlbumWall::centeritem -{ - size-policy: fixed fixed; - fixed-height: 24.5un; - fixed-width: 24.5un; - left:0un; - right:0un; - top:-var(hb-param-margin-gene-screen); - bottom:0un; - zvalue: 2; -} - HgMediawall#artistAlbumWall::title { text-height: var(hb-param-text-height-primary); @@ -97,8 +84,8 @@ text-wrap-mode:no-wrap; left:-var(hb-param-margin-gene-screen); right:var(hb-param-margin-gene-screen); - top:0un; - bottom:var(hb-param-margin-middle-vertical); + top:-var(hb-param-margin-gene-screen); + bottom:var(hb-param-margin-gene-middle-vertical); zvalue: 2; } @@ -112,8 +99,18 @@ text-wrap-mode:no-wrap; left:-var(hb-param-margin-gene-screen); right:var(hb-param-margin-gene-screen); - top:0un; + top:-var(hb-param-margin-gene-middle-vertical); + bottom:var(hb-param-margin-gene-middle-vertical); + zvalue: 2; +} +HgMediawall#artistAlbumWall::centeritem +{ + size-policy: fixed fixed; + fixed-height: 24.5un; + fixed-width: 24.5un; + left:0un; + right:0un; + top:-var(hb-param-margin-gene-middle-vertical); bottom:1.5un; zvalue: 2; } - diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpcollectionviewplugin/resources/tbonemediawall.hgmediawall.widgetml --- a/mpviewplugins/mpcollectionviewplugin/resources/tbonemediawall.hgmediawall.widgetml Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpcollectionviewplugin/resources/tbonemediawall.hgmediawall.widgetml Fri Sep 03 19:58:01 2010 -0500 @@ -5,14 +5,14 @@ TOP content ^ | - centeritem - title + ^ | - v description + ^ | - v + centeritem + BOTTOM content @@ -24,17 +24,18 @@ - - - - - + + - + + + + + diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpcollectionviewplugin/resources/tbonemediawall_color.css --- a/mpviewplugins/mpcollectionviewplugin/resources/tbonemediawall_color.css Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpcollectionviewplugin/resources/tbonemediawall_color.css Fri Sep 03 19:58:01 2010 -0500 @@ -1,21 +1,21 @@ /*Albums TBone*/ HgMediawall#albumWall::title { - color: #FFFFFF; /* media wall reflection is 50% darker than original image, white will work best even for white images.*/ + color: var(qtc_view_normal) } HgMediawall#albumWall::description { - color: #FFFFFF; /* media wall reflection is 50% darker than original image, white will work best even for white images.*/ + color: var(qtc_view_normal_secondary) } /*Artist Albums TBone*/ HgMediawall#artistAlbumWall::title { - color: #FFFFFF; /* media wall reflection is 50% darker than original image, white will work best even for white images.*/ + color: var(qtc_view_normal) } HgMediawall#artistAlbumWall::description { - color: #FFFFFF; /* media wall reflection is 50% darker than original image, white will work best even for white images.*/ + color: var(qtc_view_normal_secondary) } diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainer.cpp --- a/mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainer.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainer.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -42,7 +42,7 @@ */ /*! - \fn void itemLongPressed( int index, const QPointF &coords ); + \fn void itemLongPressed( const QModelIndex &index, const QPointF &coords ); This signal is emitted when an item of the container with \a index is long pressed. */ diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontaineralbums.cpp --- a/mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontaineralbums.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontaineralbums.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -192,6 +192,9 @@ emit findAlbumSongs(mCurrentAlbumIndex); } } + else if( mCollectionContext == ECollectionContextAlbums ) { + mInfoBar->setHeading(hbTrId("txt_mus_subhead_albums_1l").arg(mCollectionData->count())); + } else { MpCollectionListContainer::dataReloaded(); } @@ -298,7 +301,7 @@ defaultIcon.setSize(mTBone->itemSize()); mTBone->setDefaultImage( defaultIcon.pixmap().toImage() ); mTBone->setScrollBarPolicy( HgWidget::ScrollBarAlwaysOff ); - mTBone->enableReflections(true); + mTBone->enableReflections( false ); connect( mTBone, SIGNAL(scrollingStarted()), this, SLOT(scrollingStarted()) ); connect( mTBone, SIGNAL(animationAboutToEnd(QModelIndex)), this, SLOT(albumCentered(QModelIndex)) ); } diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainerartists.cpp --- a/mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainerartists.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainerartists.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -259,6 +259,9 @@ emit findAlbumSongs(mCurrentAlbumIndex); } } + else if( mCollectionContext == ECollectionContextArtists ){ + mInfoBar->setHeading(hbTrId("txt_mus_subhead_artist_1l").arg(mCollectionData->count())); + } else { MpCollectionListContainer::dataReloaded(); } @@ -385,7 +388,7 @@ defaultIcon.setSize(mTBone->itemSize()); mTBone->setDefaultImage( defaultIcon.pixmap().toImage() ); mTBone->setScrollBarPolicy( HgWidget::ScrollBarAlwaysOff ); - mTBone->enableReflections(true); + mTBone->enableReflections( false ); connect( mTBone, SIGNAL(scrollingStarted()), this, SLOT(scrollingStarted()) ); connect( mTBone, SIGNAL(animationAboutToEnd(QModelIndex)), this, SLOT(albumCentered(QModelIndex)) ); } @@ -402,7 +405,7 @@ artist = hbTrId("txt_mus_subtitle_unknown_all"); } else { - artist = HbParameterLengthLimiter(hbTrId("txt_mus_subtitle_1_all")).arg(artist); + artist = HbParameterLengthLimiter("txt_mus_subtitle_1_all").arg(artist); } mInfoBar->setHeading(artist); } diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainerfactory.cpp --- a/mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainerfactory.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainerfactory.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -73,7 +73,7 @@ mCurrentContainer = new MpCollectionContainerAllSongs(mDocumentLoader); 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(itemLongPressed(QModelIndex, QPointF)), mView, SLOT(openContextMenu(QModelIndex, QPointF)) ); connect( mCurrentContainer, SIGNAL(shuffleEnabled(bool)), mView, SLOT(setShuffleAction(bool)) ); break; case ECollectionContextArtists: @@ -85,7 +85,7 @@ mCurrentContainer = new MpCollectionContainerArtists(mDocumentLoader); 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(itemLongPressed(QModelIndex, QPointF)), mView, SLOT(openContextMenu(QModelIndex, 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)) ); @@ -97,7 +97,7 @@ mCurrentContainer = new MpCollectionContainerAlbums(mDocumentLoader); 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(itemLongPressed(QModelIndex, QPointF)), mView, SLOT(openContextMenu(QModelIndex, 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)) ); @@ -109,7 +109,7 @@ mCurrentContainer = new MpCollectionContainerPlaylists(mDocumentLoader); 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(itemLongPressed(QModelIndex, QPointF)), mView, SLOT(openContextMenu(QModelIndex, QPointF)) ); connect( mCurrentContainer, SIGNAL(shuffleEnabled(bool)), mView, SLOT(setShuffleAction(bool)) ); } break; diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainerplaylists.cpp --- a/mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainerplaylists.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainerplaylists.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -21,6 +21,7 @@ #include #include #include +#include #include "mpcollectioncontainerplaylists.h" #include "mpcollectiondatamodel.h" @@ -108,7 +109,7 @@ MpCollectionListContainer::dataReloaded(); if ( mCollectionContext == ECollectionContextPlaylistSongs ) { // Playlist could have been renamed. - QString details = mCollectionData->collectionTitle(); + QString details = HbParameterLengthLimiter("txt_mus_subhead_1_2l").arg(mCollectionData->collectionTitle()).arg(mCollectionData->count()); mInfoBar->setHeading(details); if ( mCollectionData->count() > 1 ) { emit shuffleEnabled(true); @@ -117,6 +118,10 @@ emit shuffleEnabled(false); } } + else if ( mCollectionContext == ECollectionContextPlaylists ) { + mInfoBar->setHeading(hbTrId("txt_mus_subhead_playlists_1l").arg(mCollectionData->count())); + } + TX_EXIT } @@ -160,7 +165,7 @@ details = hbTrId("txt_mus_subtitle_select_song"); } else { - details = hbTrId("txt_mus_subhead_1_2l").arg(mCollectionData->collectionTitle()).arg(mCollectionData->count()); + details = HbParameterLengthLimiter("txt_mus_subhead_1_2l").arg(mCollectionData->collectionTitle()).arg(mCollectionData->count()); } mInfoBar->setHeading(details); } @@ -171,7 +176,7 @@ } else { - mInfoBar->setHeading(hbTrId("txt_mus_subhead_1_2l").arg(mCollectionData->collectionTitle()).arg(0)); + mInfoBar->setHeading(HbParameterLengthLimiter("txt_mus_subhead_1_2l").arg(mCollectionData->collectionTitle()).arg(0)); // Call empty list from base class setupEmptyListContainer(); diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpcollectionviewplugin/src/mpcollectionlistcontainer.cpp --- a/mpviewplugins/mpcollectionviewplugin/src/mpcollectionlistcontainer.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpcollectionviewplugin/src/mpcollectionlistcontainer.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -112,7 +112,7 @@ TX_ENTRY if ( mLongPressEnabled ) { mLongPressedIndex = listViewItem->modelIndex().row(); - emit MpCollectionContainer::itemLongPressed(mLongPressedIndex, coords); + emit MpCollectionContainer::itemLongPressed(listViewItem->modelIndex(), coords); } TX_EXIT } diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpcollectionviewplugin/src/mpcollectionpopuphandler.cpp --- a/mpviewplugins/mpcollectionviewplugin/src/mpcollectionpopuphandler.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpcollectionviewplugin/src/mpcollectionpopuphandler.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -34,7 +34,6 @@ #include "mpcollectionpopuphandler.h" #include "mptrace.h" -const int KNullIndex = -1; const int KSongsToDisplayProgressDlg = 100; // Popups launched by this class @@ -74,11 +73,12 @@ virtual ~MpPopupHandlerPermanentData(); void clear(); public: - MpMpxCollectionData *mIsolatedCollectionData; // Not own - QAbstractItemModel *mAbstractItemModel; // Own + MpMpxCollectionData *mCollectionData; // ownership depends on mIsolatedOperation + QAbstractItemModel *mAbstractItemModel; // ownership depends on use case, parented. QList mSelectedItems; QString mOriginalName; - int mContextMenuIndex; + QModelIndex mContextMenuModelIndex; + bool mIsolatedOperation; }; /*! @@ -86,9 +86,10 @@ */ MpPopupHandlerPermanentData::MpPopupHandlerPermanentData( QObject *parent ) : QObject( parent ), - mIsolatedCollectionData( 0 ), + mCollectionData( 0 ), mAbstractItemModel( 0 ), - mContextMenuIndex( KNullIndex ) + mContextMenuModelIndex(), + mIsolatedOperation( false ) { TX_ENTRY mSelectedItems.clear(); @@ -115,15 +116,18 @@ TX_ENTRY mSelectedItems.clear(); mOriginalName.clear(); - mContextMenuIndex = KNullIndex; - if ( mIsolatedCollectionData ) { - MpEngineFactory::sharedEngine()->releaseIsolatedCollection(); - mIsolatedCollectionData = 0; + mContextMenuModelIndex = QModelIndex(); + if ( mIsolatedOperation ) { + mIsolatedOperation = false; + if ( mCollectionData ) { + MpEngineFactory::sharedEngine()->releaseIsolatedCollection(); + mCollectionData = 0; + } } - if ( mAbstractItemModel ) { - delete mAbstractItemModel; - mAbstractItemModel = 0; - } + + //deleted by parenting if owned + mAbstractItemModel = 0; + //clearing any child Objects. foreach (QObject* child, children()) { child->deleteLater(); @@ -174,7 +178,7 @@ /*! Default view context menu. */ -void MpCollectionPopupHandler::openDefaultViewContextMenu( int index, const QPointF &coords ) +void MpCollectionPopupHandler::openDefaultViewContextMenu( const QModelIndex &index, const QPointF &coords ) { TX_ENTRY @@ -218,7 +222,7 @@ contextMenu = new HbMenu(); action = contextMenu->addAction( hbTrId( "txt_common_menu_open" ) ); action->setObjectName( KOpen ); - if ( !mMpEngine->collectionData()->isAutoPlaylist( index ) ) { + if ( !mMpEngine->collectionData()->isAutoPlaylist( index.row() ) ) { action = contextMenu->addAction( hbTrId( "txt_common_menu_delete" ) ); action->setObjectName(KDelete); action->setEnabled( !usbBlocked ); @@ -244,7 +248,7 @@ } if ( contextMenu ) { - mPermanentData->mContextMenuIndex = index; + mPermanentData->mContextMenuModelIndex = index; contextMenu->setPreferredPos( coords ); contextMenu->setObjectName( KContextMenu ); contextMenu->setAttribute( Qt::WA_DeleteOnClose ); @@ -259,9 +263,9 @@ /*! Fetch view context menu */ -void MpCollectionPopupHandler::openFetchViewContextMenu( int index, const QPointF &coords ) +void MpCollectionPopupHandler::openFetchViewContextMenu( const QModelIndex &index, const QPointF &coords ) { - TX_ENTRY_ARGS( "index=" << index ); + TX_ENTRY_ARGS( "index=" << index.row() ); if ( mView->isActivated() ) { @@ -283,7 +287,7 @@ } if ( contextMenu ) { - mPermanentData->mContextMenuIndex = index; + mPermanentData->mContextMenuModelIndex = index; contextMenu->setPreferredPos( coords ); contextMenu->setAttribute( Qt::WA_DeleteOnClose ); contextMenu->setObjectName( KContextMenu ); @@ -302,7 +306,9 @@ { TX_ENTRY_ARGS( "Current name=" << currentName ); mPermanentData->mOriginalName = currentName; - getText( hbTrId( "txt_mus_dialog_enter_name" ), currentName, + getText( hbTrId( "txt_mus_dialog_enter_name" ), + currentName, + hbTrId( "txt_common_button_ok" ), //TODO:replace for "rename" when string is available SLOT( handleRenamePlaylistContainer( HbAction* ) ) ); TX_EXIT } @@ -314,7 +320,9 @@ { TX_ENTRY_ARGS( "Current name=" << currentName ); mPermanentData->mOriginalName = currentName; - getText( hbTrId( "txt_mus_dialog_enter_name" ), currentName, + getText( hbTrId( "txt_mus_dialog_enter_name" ), + currentName, + hbTrId( "txt_common_button_ok" ),//TODO:replace for "rename" when string is available SLOT( handleRenamePlaylistItem( HbAction* ) ) ); TX_EXIT } @@ -325,7 +333,9 @@ void MpCollectionPopupHandler::openAddSongsToPlaylist( QAbstractItemModel* model ) { TX_ENTRY - getModelIndexes( hbTrId( "txt_mus_title_select_songs" ), model, + getModelIndexes( hbTrId( "txt_mus_title_select_songs" ),//TODO:replace for "add songs" when string is available + hbTrId( "txt_common_button_add_dialog" ), + model, SLOT( handleAddSongsToPlayList( HbAction* ) ) ); TX_EXIT } @@ -341,7 +351,9 @@ //this item will be deleted when clearing permanent data. model->setParent(mPermanentData); model->refreshModel(); - getModelIndexes( hbTrId( "txt_mus_title_select_songs" ), model, + getModelIndexes( hbTrId( "txt_mus_title_select_songs" ),//TODO:replace for "add songs" when string is available + hbTrId( "txt_common_button_add_dialog" ), + model, SLOT( handleAddSongsToPlayList( HbAction* ) ) ); TX_EXIT } @@ -352,7 +364,10 @@ void MpCollectionPopupHandler::openDeleteSongs( QAbstractItemModel* model ) { TX_ENTRY - getModelIndexes( hbTrId( "txt_mus_title_select_songs" ), model, + //currently we can only get here from playlistsongs, no need to check for that. + getModelIndexes( hbTrId( "txt_mus_title_remove_songs" ), + hbTrId( "txt_common_button_remove_dialog" ), + model, SLOT( handleDeleteSongs( HbAction* ) ) ); TX_EXIT } @@ -363,13 +378,18 @@ void MpCollectionPopupHandler::openAddToCurrentPlaylist( MpMpxCollectionData* collectionData ) { TX_ENTRY - mPermanentData->mIsolatedCollectionData = collectionData; + mPermanentData->mIsolatedOperation = true; + mPermanentData->mCollectionData = collectionData; MpCollectionDataModel *collectionDataModel; collectionDataModel = new MpCollectionDataModel( collectionData ); + //this item will be deleted when clearing permanent data. + collectionDataModel->setParent( mPermanentData ); collectionDataModel->refreshModel(); mPermanentData->mAbstractItemModel = collectionDataModel; - getModelIndexes( hbTrId( "txt_mus_title_select_songs" ), collectionDataModel, + getModelIndexes( hbTrId( "txt_mus_title_select_songs" ),//TODO:replace for "add songs" when string is available + hbTrId( "txt_common_button_add_dialog" ), + collectionDataModel, SLOT( handleAddToCurrentPlaylist( HbAction* ) ) ); TX_EXIT } @@ -377,16 +397,36 @@ /*! Request to create a new play list and then add songs to it. */ -void MpCollectionPopupHandler::openCreateNewPlaylist( MpMpxCollectionData* collectionData ) +void MpCollectionPopupHandler::openCreateNewPlaylist( MpMpxCollectionData* collectionData, bool isolated ) { TX_ENTRY - mPermanentData->mIsolatedCollectionData = collectionData; - + mPermanentData->mIsolatedOperation = isolated; + mPermanentData->mCollectionData = collectionData; MpCollectionDataModel *collectionDataModel; + //this item will be deleted when clearing permanent data. collectionDataModel = new MpCollectionDataModel( collectionData ); + collectionDataModel->setParent( mPermanentData ); collectionDataModel->refreshModel(); mPermanentData->mAbstractItemModel = collectionDataModel; + QStringList playlists; + mMpEngine->findPlaylists( playlists ); + queryNewPlaylistName( playlists, SLOT( handleCreateNewPlaylistGetTextFinished( HbAction* ) ) ); + TX_EXIT +} +/*! + Request to create a new playlist from TBone + */ +void MpCollectionPopupHandler::openCreateNewPlaylistFromTBone( ) +{ + TX_ENTRY + mPermanentData->mIsolatedOperation = false; + MpCollectionTBoneListDataModel *model; + model = new MpCollectionTBoneListDataModel( mMpEngine->collectionData() ); + //this item will be deleted when clearing permanent data. + model->setParent(mPermanentData); + model->refreshModel(); + mPermanentData->mAbstractItemModel = model; QStringList playlists; mMpEngine->findPlaylists( playlists ); queryNewPlaylistName( playlists, SLOT( handleCreateNewPlaylistGetTextFinished( HbAction* ) ) ); @@ -418,7 +458,7 @@ } else { mOutstandingPopup->close(); - //Delete/Clear permanent data until current popup gets deleted + //Delete/Clear permanent data when current popup is deleted mPermanentData->setParent( mOutstandingPopup ); //Generate new permanent data for future popups mPermanentData = new MpPopupHandlerPermanentData( this ); @@ -439,24 +479,25 @@ if ( selectedAction ) { QString objectName = selectedAction->objectName(); QList selection; - selection.append( mPermanentData->mContextMenuIndex ); + selection.append( mPermanentData->mContextMenuModelIndex.row() ); if ( objectName == KOpen ) { - mView->openItem( mPermanentData->mContextMenuIndex ); + mView->openItem( mPermanentData->mContextMenuModelIndex ); } if ( objectName == KAdd ) { launchAddToPlaylistDialog( selection ); } else if ( objectName == KDelete ) { - requestDelete( selection ); + mPermanentData->mSelectedItems = selection; + requestDelete(); } else if ( objectName == KRenamePlayList ) { QString currentName; currentName = mMpEngine->collectionData()->itemData( - mPermanentData->mContextMenuIndex, MpMpxCollectionData::Title ); + mPermanentData->mContextMenuModelIndex.row(), MpMpxCollectionData::Title ); openRenamePlaylistItemDialog( currentName ); } else if ( objectName == KDetails ) { - mView->showItemDetails( mPermanentData->mContextMenuIndex ); + mView->showItemDetails( mPermanentData->mContextMenuModelIndex.row() ); } } TX_EXIT @@ -470,7 +511,7 @@ TX_ENTRY if ( selectedAction ) { // Start the playback process. View will switch to playbackview. - mMpEngine->previewItem( mPermanentData->mContextMenuIndex ); + mMpEngine->previewItem( mPermanentData->mContextMenuModelIndex.row() ); } TX_EXIT } @@ -519,16 +560,8 @@ QString objectName = selectedAction->objectName(); if ( objectName == KOk ) { QString newPlaylistName = dialog->value().toString(); - if ( newPlaylistName.length() ) { - //Create new playlist with given name - mMpEngine->createPlaylist( newPlaylistName, mPermanentData->mSelectedItems ); - } - else { - //No valid name, prompt for one again. - getText( hbTrId( "txt_mus_dialog_enter_name" ), newPlaylistName, - SLOT( handleAddToPlaylistGetTextFinished( HbAction* ) ) ); - operationCompleted = false; - } + //Create new playlist with given name + mMpEngine->createPlaylist( newPlaylistName, mPermanentData->mSelectedItems ); } else { // user decided to not provide a new name, go back to playlist list selection @@ -556,29 +589,17 @@ TX_ENTRY HbInputDialog *dialog = qobject_cast( sender() ); clearOutstandingPopup( dialog ); - bool operationCompleted( true ); if ( selectedAction ) { QString objectName = selectedAction->objectName(); if ( objectName == KOk ) { QString newPlaylistName = dialog->value().toString(); - if ( newPlaylistName.length() ) { - if ( newPlaylistName != mPermanentData->mOriginalName ) { - mMpEngine->renamePlaylist( newPlaylistName ); - } - } - else { - //No valid name, prompt for one again. - getText( hbTrId( "txt_mus_dialog_enter_name" ), newPlaylistName, - SLOT( handleRenamePlaylistContainer( HbAction* ) ) ); - operationCompleted = false; + if ( newPlaylistName != mPermanentData->mOriginalName ) { + mMpEngine->renamePlaylist( newPlaylistName ); } } } - - if ( operationCompleted ) { - mPermanentData->clear(); - } + mPermanentData->clear(); TX_EXIT } @@ -590,29 +611,17 @@ TX_ENTRY HbInputDialog *dialog = qobject_cast( sender() ); clearOutstandingPopup( dialog ); - bool operationCompleted( true ); if ( selectedAction ) { QString objectName = selectedAction->objectName(); if ( objectName == KOk ) { QString newPlaylistName = dialog->value().toString(); - if ( newPlaylistName.length() ) { - if ( newPlaylistName != mPermanentData->mOriginalName ) { - mMpEngine->renamePlaylist( newPlaylistName, mPermanentData->mContextMenuIndex ); + if ( newPlaylistName != mPermanentData->mOriginalName ) { + mMpEngine->renamePlaylist( newPlaylistName, mPermanentData->mContextMenuModelIndex.row() ); } - } - else { - //No valid name, prompt for one again. - getText( hbTrId( "txt_mus_dialog_enter_name" ), newPlaylistName, - SLOT( handleRenamePlaylistItem( HbAction* ) ) ); - operationCompleted = false; - } } } - - if ( operationCompleted ) { - mPermanentData->clear(); - } + mPermanentData->clear(); TX_EXIT } @@ -639,7 +648,10 @@ } } else { - mPermanentData->clear(); + //Delete/Clear permanent data when current dialog is deleted + mPermanentData->setParent( dialog ); + //Generate new permanent data for future popups + mPermanentData = new MpPopupHandlerPermanentData( this ); } } @@ -663,21 +675,22 @@ HbSelectionDialog *dialog = qobject_cast( sender() ); clearOutstandingPopup( dialog ); - if ( selectedAction ) { - QString objectName = selectedAction->objectName(); - if ( objectName == KOk ) { - QModelIndexList selectedModelIndexes; - selectedModelIndexes = dialog->selectedModelIndexes(); - if ( selectedModelIndexes.count() ) { - QList selection; - for ( int i = 0; i < selectedModelIndexes.size(); ++i ) { - selection.append( selectedModelIndexes.at( i ).row() ); - } - requestDelete( selection ); + if ( selectedAction && selectedAction->objectName() == KOk ) { + QModelIndexList selectedModelIndexes; + selectedModelIndexes = dialog->selectedModelIndexes(); + if ( selectedModelIndexes.count() ) { + QList selection; + for ( int i = 0; i < selectedModelIndexes.size(); ++i ) { + selection.append( selectedModelIndexes.at( i ).row() ); } + mPermanentData->mSelectedItems = selection; } + //we have to delay the delete, so the list on the dialog does not get the update (flicker!) + connect( dialog, SIGNAL( destroyed() ), this, SLOT( requestDelete() ) ); } - + else { + mPermanentData->clear(); + } //Dialog won't use CollectionView main model any more, return it to its original layout. MpCollectionDataModel *mpModel = qobject_cast( dialog->model() ); if ( mpModel ) { @@ -709,14 +722,18 @@ selection.append( selectedModelIndexes.at( i ).row() ); } mMpEngine->saveToCurrentPlaylist( selection, - mPermanentData->mIsolatedCollectionData ); + mPermanentData->mCollectionData ); } } } //Dialog is using an isolated model which will be deleted, no need to change its layout. - mPermanentData->clear(); - + + //Delete/Clear permanent data when current dialog is deleted + mPermanentData->setParent( dialog ); + //Generate new permanent data for future popups + mPermanentData = new MpPopupHandlerPermanentData( this ); + TX_EXIT } @@ -728,29 +745,17 @@ TX_ENTRY HbInputDialog *dialog = qobject_cast( sender() ); clearOutstandingPopup( dialog ); - bool operationCompleted( true ); - if ( selectedAction ) { - QString objectName = selectedAction->objectName(); - if ( objectName == KOk ) { - QString newPlaylistName = dialog->value().toString(); - if ( newPlaylistName.length() ) { - //Store the new playlist name and query for the items to be added - mPermanentData->mOriginalName = newPlaylistName; - getModelIndexes( hbTrId( "txt_mus_title_select_songs" ), - mPermanentData->mAbstractItemModel, - SLOT( handleCreateNewPlaylistGetModelIndexesFinished( HbAction* ) ) ); - } - else { - //No valid name, prompt for one again. - getText( hbTrId( "txt_mus_dialog_enter_name" ), newPlaylistName, - SLOT( handleCreateNewPlaylistGetTextFinished( HbAction* ) ) ); - } - operationCompleted = false; - } + if ( selectedAction && selectedAction->objectName() == KOk) { + QString newPlaylistName = dialog->value().toString(); + //Store the new playlist name and query for the items to be added + mPermanentData->mOriginalName = newPlaylistName; + getModelIndexes( hbTrId( "txt_mus_title_select_songs" ),//TODO:replace for "add songs" when string is available + hbTrId( "txt_common_button_add_dialog" ), + mPermanentData->mAbstractItemModel, + SLOT( handleCreateNewPlaylistGetModelIndexesFinished( HbAction* ) ) ); } - - if ( operationCompleted ) { + else { mPermanentData->clear(); } TX_EXIT @@ -775,16 +780,27 @@ for ( int i = 0; i < selectedModelIndexes.size(); ++i ) { selection.append( selectedModelIndexes.at( i ).row() ); } + mMpEngine->createPlaylist( mPermanentData->mOriginalName, selection, + mPermanentData->mCollectionData ); } - //Creating Playlist even when there is no selection. - mMpEngine->createPlaylist( mPermanentData->mOriginalName, selection, - mPermanentData->mIsolatedCollectionData ); } } - //Dialog is using an isolated model which will be deleted, no need to change its layout. - mPermanentData->clear(); + + //Delete/Clear permanent data when current dialog is deleted + mPermanentData->setParent( dialog ); + //Generate new permanent data for future popups + mPermanentData = new MpPopupHandlerPermanentData( this ); + + //Dialog won't use model any more, return it to its original layout. + MpCollectionDataModel *mpModel = qobject_cast( dialog->model() ); + if ( mpModel ) { + //setLayout() only applies for MpCollectionDataModel where we need to + //decide which layout to use for the secondary text. + //MpCollectionTBoneListDataModel doesn't have secondary text. + mpModel->setLayout( ECollectionListView ); + } TX_EXIT } @@ -896,6 +912,90 @@ } /*! + Slot to be called when the text on an input dialog changes. + */ +void MpCollectionPopupHandler::inputDialogChanged( QString text ) +{ + if ( !mOutstandingPopup ) { + return; + } + //Attempt to cast the outstanding dialog as the input dialog that owns the + //line edit that changed. If cast fails it means that the dialog is out of + //scope and the operation is not needed anymore. + HbInputDialog *dialog = qobject_cast( mOutstandingPopup ); + HbLineEdit *dialogLineEdit = qobject_cast( sender() ); + if ( dialog && dialogLineEdit && dialog->lineEdit() == dialogLineEdit ) { + if ( dialog->actions().count() ) { + dialog->actions()[0]->setEnabled( !text.isEmpty() ); + } + } +} + +/*! + \internal + Slot to be called to request a delete operation upon user confirmation. + */ +void MpCollectionPopupHandler::requestDelete() +{ + TX_ENTRY + QString message; + bool needsConfirmation = true; + connectExternalEvents(); + + switch ( mMpEngine->collectionData()->context() ) { + case ECollectionContextAllSongs: + case ECollectionContextArtistAlbumsTBone: + case ECollectionContextArtistAllSongs: + case ECollectionContextAlbumsTBone: + message = hbTrId( "txt_mus_delete_song" ); + break; + case ECollectionContextArtists: + message = hbTrId( "txt_mus_delete_artist" ); + break; + case ECollectionContextAlbums: + case ECollectionContextArtistAlbums: + message = hbTrId( "txt_mus_delete_album" ); + break; + case ECollectionContextPlaylists: + message = hbTrId( "txt_mus_delete_playlist" ); + break; + case ECollectionContextPlaylistSongs: + needsConfirmation = false; + mMpEngine->deleteSongs( mPermanentData->mSelectedItems ); + mPermanentData->clear(); + break; + case ECollectionContextUnknown: + default: + // We shouldn't be here + needsConfirmation = false; + mPermanentData->clear(); + TX_LOG_ARGS( "Invalid Collection Context" ); + break; + } + + if ( needsConfirmation ) { + HbAction *action; + HbMessageBox *dialog = new HbMessageBox( HbMessageBox::MessageTypeQuestion ); + + dialog->setText( message ); + dialog->setTimeout( HbPopup::NoTimeout ); + dialog->clearActions(); + action = new HbAction( hbTrId( "txt_common_button_yes" ) ); + action->setObjectName( KOk ); + dialog->addAction( action ); + action = new HbAction( hbTrId( "txt_common_button_no" ) ); + action->setObjectName( KCancel ); + dialog->addAction( action ); + dialog->setObjectName( KRequestDeleteMessageBox ); + dialog->setAttribute( Qt::WA_DeleteOnClose ); + setOutstandingPopup( dialog ); + dialog->open( this, SLOT( handleRequestDelete( HbAction* ) ) ); + } + + TX_EXIT +} + +/*! \internal sets \a popup as the current outstanding popup and cancels any other previous popup. */ @@ -941,6 +1041,7 @@ HbSelectionDialog *dialog = new HbSelectionDialog(); dialog->setStringItems( playlists ); dialog->setSelectionMode( HbAbstractItemView::SingleSelection ); + dialog->setSelectedItems( QList< QVariant >()); dialog->setHeadingWidget(new HbLabel( hbTrId( "txt_mus_title_select_playlist" ) ) ); dialog->clearActions(); action = new HbAction( hbTrId( "txt_mus_button_new" ) ); @@ -976,7 +1077,10 @@ playlists.contains( hbTrId( "txt_mus_dialog_enter_name_entry_playlist_l1" ).arg( i ) ) ; i++ ) {}; QString suggestedPlaylistName = hbTrId( "txt_mus_dialog_enter_name_entry_playlist_l1" ).arg( i ); - getText( hbTrId( "txt_mus_dialog_enter_name" ), suggestedPlaylistName, handler ); + getText( hbTrId( "txt_mus_dialog_enter_name" ), + suggestedPlaylistName, + hbTrId( "txt_mus_button_create_new" ), + handler ); TX_EXIT } @@ -985,9 +1089,12 @@ Launches an input text dialog. \a label Dialog title. \a text Suggested text. + \a confirmationActionLabel label for the first action on the dialog. \a handler Slot to be called when input dialog finishes. */ -void MpCollectionPopupHandler::getText( const QString &label, const QString &text, +void MpCollectionPopupHandler::getText( const QString &label, + const QString &text, + const QString &confirmationActionLabel, const char *handler ) { TX_ENTRY @@ -997,9 +1104,16 @@ dialog->setInputMode( HbInputDialog::TextInput ); dialog->setValue( text ); dialog->clearActions(); - action = new HbAction( hbTrId( "txt_common_button_ok" ) ); + action = new HbAction( confirmationActionLabel ); action->setObjectName( KOk ); dialog->addAction( action ); + + //we want to prevent the user from slecting an empty string. + HbLineEdit * lineEdit; + lineEdit = dialog->lineEdit(); + connect (lineEdit , SIGNAL(textChanged(QString)), SLOT(inputDialogChanged(QString)) ); + action->setEnabled( !lineEdit->text().isEmpty() ); + action = new HbAction( hbTrId( "txt_common_button_cancel" ) ); action->setObjectName( KCancel ); dialog->addAction( action ); @@ -1014,10 +1128,13 @@ \internal Launches a list dialog to select items. \a label Dialog title. + \a confirmationActionLabel label for the first action on the dialog. \a model List model. \a handler Slot to be called when list dialog finishes. */ -void MpCollectionPopupHandler::getModelIndexes( const QString &label, QAbstractItemModel* model, +void MpCollectionPopupHandler::getModelIndexes( const QString &label, + const QString &confirmationActionLabel, + QAbstractItemModel* model, const char *handler) { TX_ENTRY @@ -1037,7 +1154,7 @@ } dialog->setModel( model ); dialog->clearActions(); - action = new HbAction( hbTrId( "txt_common_button_ok" ) ); + action = new HbAction( confirmationActionLabel ); action->setObjectName( KOk ); dialog->addAction( action ); action = new HbAction( hbTrId( "txt_common_button_cancel" ) ); @@ -1105,72 +1222,6 @@ /*! \internal - Request a delete operation always it has been confirmed. - \a selection Items selected to be deleted. - */ -void MpCollectionPopupHandler::requestDelete( QList &selection ) -{ - TX_ENTRY - QString message; - mPermanentData->mSelectedItems = selection; - bool needsConfirmation = true; - connectExternalEvents(); - - switch ( mMpEngine->collectionData()->context() ) { - case ECollectionContextAllSongs: - case ECollectionContextArtistAlbumsTBone: - case ECollectionContextArtistAllSongs: - case ECollectionContextAlbumsTBone: - message = hbTrId( "txt_mus_delete_song" ); - break; - case ECollectionContextArtists: - message = hbTrId( "txt_mus_delete_artist" ); - break; - case ECollectionContextAlbums: - case ECollectionContextArtistAlbums: - message = hbTrId( "txt_mus_delete_album" ); - break; - case ECollectionContextPlaylists: - message = hbTrId( "txt_mus_delete_playlist" ); - break; - case ECollectionContextPlaylistSongs: - needsConfirmation = false; - mMpEngine->deleteSongs( mPermanentData->mSelectedItems ); - mPermanentData->clear(); - break; - case ECollectionContextUnknown: - default: - // We shouldn't be here - needsConfirmation = false; - mPermanentData->clear(); - TX_LOG_ARGS( "Invalid Collection Context" ); - break; - } - - if ( needsConfirmation ) { - HbAction *action; - HbMessageBox *dialog = new HbMessageBox( HbMessageBox::MessageTypeQuestion ); - - dialog->setText( message ); - dialog->setTimeout( HbPopup::NoTimeout ); - dialog->clearActions(); - action = new HbAction( hbTrId( "txt_common_button_yes" ) ); - action->setObjectName( KOk ); - dialog->addAction( action ); - action = new HbAction( hbTrId( "txt_common_button_no" ) ); - action->setObjectName( KCancel ); - dialog->addAction( action ); - dialog->setObjectName( KRequestDeleteMessageBox ); - dialog->setAttribute( Qt::WA_DeleteOnClose ); - setOutstandingPopup( dialog ); - dialog->open( this, SLOT( handleRequestDelete( HbAction* ) ) ); - } - - TX_EXIT -} - -/*! - \internal Launches a waiting progress note. \a content String id to display in the dialog. */ diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpcollectionviewplugin/src/mpcollectionview.cpp --- a/mpviewplugins/mpcollectionviewplugin/src/mpcollectionview.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpcollectionviewplugin/src/mpcollectionview.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -304,12 +304,10 @@ /*! Opens or plays an item through collection container in order to keep track of the Artist / Album data used by infobar. */ -void MpCollectionView::openItem( int index ) +void MpCollectionView::openItem( const QModelIndex &index ) { - TX_ENTRY_ARGS( "index = " << index ); - QModelIndex modelIndex; - modelIndex = mCollectionDataModel->index( index ); - qobject_cast(mCollectionContainer)->itemActivated( modelIndex ); + TX_ENTRY_ARGS( "index = " << index.row() ); + qobject_cast(mCollectionContainer)->itemActivated( index ); TX_EXIT } @@ -668,6 +666,25 @@ } /*! + Slot to be called when 'New Playlist' is clicked by the user from the menu. + */ +void MpCollectionView::createNewPlaylist() +{ + + switch ( mCollectionContext ) { + case ECollectionContextArtistAlbumsTBone: + case ECollectionContextAlbumsTBone: + mMpPopupHandler->openCreateNewPlaylistFromTBone(); + break; + default: + //second parameter, means it is an not an isolated collection, + //ownership is not transferred. + mMpPopupHandler->openCreateNewPlaylist( mCollectionData, false ); + break; + } +} + +/*! Slot to be called when 'Delete' is clicked by the user from the menu. */ void MpCollectionView::deleteSongs() @@ -740,7 +757,8 @@ mMpPopupHandler->openAddToCurrentPlaylist( collectionData ); } else if (ECollectionContextPlaylists == mCollectionContext) { - mMpPopupHandler->openCreateNewPlaylist( collectionData ); + //second parameter, means it is an isolated collection, ownership is transferred. + mMpPopupHandler->openCreateNewPlaylist( collectionData, true ); } } TX_EXIT @@ -757,9 +775,9 @@ /*! Slot to be called when an item is long pressed by the user. */ -void MpCollectionView::openContextMenu( int index, const QPointF &coords ) +void MpCollectionView::openContextMenu( const QModelIndex &index, const QPointF &coords ) { - TX_ENTRY_ARGS( "index=" << index ); + TX_ENTRY_ARGS( "index=" << index.row() ); switch ( mViewMode ) { case MpCommon::DefaultView: mMpPopupHandler->openDefaultViewContextMenu( index, coords ); @@ -1013,11 +1031,16 @@ if ( count <= 1 ) { mShuffleAction->setDisabled( true ); } - menuAction = myMenu->addAction( hbTrId( "txt_mus_opt_add_to_playlist" ) ); if ( count && !mUsbBlocked ) { + menuAction = myMenu->addAction( hbTrId( "txt_mus_opt_add_to_playlist" ) ); connect( menuAction, SIGNAL( triggered() ), this, SLOT( addToPlaylist() ) ); + menuAction = myMenu->addAction( hbTrId( "txt_mus_opt_new_playlist" ) ); + connect( menuAction, SIGNAL( triggered() ), this, SLOT( createNewPlaylist() ) ); } else { + menuAction = myMenu->addAction( hbTrId( "txt_mus_opt_add_to_playlist" ) ); + menuAction->setDisabled( true ); + menuAction = myMenu->addAction( hbTrId( "txt_mus_opt_new_playlist" ) ); menuAction->setDisabled( true ); } addDefaultMenuOptions( myMenu, true, true ); @@ -1034,11 +1057,16 @@ if ( !mShuffleEnabled ) { mShuffleAction->setDisabled( true ); } - menuAction = myMenu->addAction( hbTrId( "txt_mus_opt_add_to_playlist" ) ); if ( !mUsbBlocked ) { + menuAction = myMenu->addAction( hbTrId( "txt_mus_opt_add_to_playlist" ) ); connect( menuAction, SIGNAL( triggered() ), this, SLOT( addToPlaylist() ) ); + menuAction = myMenu->addAction( hbTrId( "txt_mus_opt_new_playlist" ) ); + connect( menuAction, SIGNAL( triggered() ), this, SLOT( createNewPlaylist() ) ); } else { + menuAction = myMenu->addAction( hbTrId( "txt_mus_opt_add_to_playlist" ) ); + menuAction->setDisabled( true ); + menuAction = myMenu->addAction( hbTrId( "txt_mus_opt_new_playlist" ) ); menuAction->setDisabled( true ); } addDefaultMenuOptions( myMenu, true, true ); @@ -1049,11 +1077,16 @@ if ( count <= 1 ) { mShuffleAction->setDisabled( true ); } - menuAction = myMenu->addAction( hbTrId( "txt_mus_opt_add_to_playlist" ) ); if ( !mUsbBlocked ) { + menuAction = myMenu->addAction( hbTrId( "txt_mus_opt_add_to_playlist" ) ); connect( menuAction, SIGNAL( triggered() ), this, SLOT( addToPlaylist() ) ); + menuAction = myMenu->addAction( hbTrId( "txt_mus_opt_new_playlist" ) ); + connect( menuAction, SIGNAL( triggered() ), this, SLOT( createNewPlaylist() ) ); } else { + menuAction = myMenu->addAction( hbTrId( "txt_mus_opt_add_to_playlist" ) ); + menuAction->setDisabled( true ); + menuAction = myMenu->addAction( hbTrId( "txt_mus_opt_new_playlist" ) ); menuAction->setDisabled( true ); } addDefaultMenuOptions( myMenu, true, true ); @@ -1086,6 +1119,8 @@ addDefaultMenuOptions( myMenu, true, true ); break; default: + //if we accidentally fall in an unknown context + addDefaultMenuOptions( myMenu, false, true ); break; } } @@ -1097,6 +1132,8 @@ addDefaultMenuOptions( myMenu, true, false ); break; default: + //if we accidentally fall in an unknown context + addDefaultMenuOptions( myMenu, false, true ); break; } } diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpcollectionviewplugin/tsrc/tsrc.pro --- a/mpviewplugins/mpcollectionviewplugin/tsrc/tsrc.pro Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpcollectionviewplugin/tsrc/tsrc.pro Fri Sep 03 19:58:01 2010 -0500 @@ -16,8 +16,8 @@ TEMPLATE = subdirs -#SUBDIRS += unittest_mpcollectioncontainers \ -SUBDIRS += unittest_mpcollectiondocumentloader \ +SUBDIRS += unittest_mpcollectioncontainers \ + unittest_mpcollectiondocumentloader \ unittest_mpsnapshotwidget CONFIG += ordered diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/src/unittest_mpcollectioncontainers.cpp --- a/mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/src/unittest_mpcollectioncontainers.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/src/unittest_mpcollectioncontainers.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -23,12 +23,15 @@ #include #include #include +#include #include "mpcommondefs.h" #include "mpcollectiondocumentloader.h" #include "stub/inc/mpcollectionview.h" #include "stub/inc/mpmpxcollectiondata.h" #include "stub/inc/mpcollectiondatamodel.h" +#include "stub/inc/mpengine.h" +#include "stub/inc/mpenginefactory.h" #include "unittest_mpcollectioncontainers.h" @@ -135,7 +138,7 @@ QCOMPARE(mView->mContainerFactory->mCurrentContext, ECollectionContextAllSongs); MpCollectionContainerAllSongs *allSongs = static_cast(mTest); QVERIFY(allSongs->mList == 0); - QVERIFY(allSongs->mInfoBar == 0); + QVERIFY(allSongs->mInfoBar != 0); QVERIFY(allSongs->mNoMusic == 0); QVERIFY(allSongs->mIndexFeedback != 0); QVERIFY(allSongs->mIndexFeedback->indexFeedbackPolicy() == HbIndexFeedback::IndexFeedbackSingleCharacter); @@ -152,7 +155,7 @@ QCOMPARE(mView->mContainerFactory->mCurrentContext, ECollectionContextArtists); MpCollectionContainerArtists *artists = static_cast(mTest); QVERIFY(artists->mList == 0); - QVERIFY(artists->mInfoBar == 0); + QVERIFY(artists->mInfoBar != 0); QVERIFY(artists->mNoMusic == 0); QVERIFY(artists->mIndexFeedback != 0); QVERIFY(artists->mIndexFeedback->indexFeedbackPolicy() == HbIndexFeedback::IndexFeedbackSingleCharacter); @@ -186,7 +189,7 @@ QCOMPARE(mView->mContainerFactory->mCurrentContext, ECollectionContextAlbums); MpCollectionContainerAlbums *albums = static_cast(mTest); QVERIFY(albums->mList == 0); - QVERIFY(albums->mInfoBar == 0); + QVERIFY(albums->mInfoBar != 0); QVERIFY(albums->mNoMusic == 0); QVERIFY(albums->mIndexFeedback != 0); QVERIFY(albums->mIndexFeedback->indexFeedbackPolicy() == HbIndexFeedback::IndexFeedbackSingleCharacter); @@ -210,7 +213,7 @@ MpCollectionContainerPlaylists *playlists = static_cast(mTest); QVERIFY(playlists->mList == 0); - QVERIFY(playlists->mInfoBar == 0); + QVERIFY(playlists->mInfoBar != 0); QVERIFY(playlists->mNoMusic == 0); QVERIFY(playlists->mIndexFeedback != 0); QVERIFY(playlists->mIndexFeedback->indexFeedbackPolicy() == HbIndexFeedback::IndexFeedbackSingleCharacter); @@ -236,16 +239,13 @@ QVERIFY(allSongs->mInfoBar != 0); QVERIFY(allSongs->mNoMusic == 0); QCOMPARE(allSongs->mList->itemRecycling(), true); - QCOMPARE(allSongs->mList->scrollingStyle(), HbListView::PanOrFlick); - QCOMPARE(allSongs->mList->clampingStyle(), HbListView::BounceBackClamping); - QCOMPARE(allSongs->mList->frictionEnabled(), true); QCOMPARE(allSongs->mList->longPressEnabled(), true); QCOMPARE(allSongs->mList->verticalScrollBarPolicy(), HbScrollArea::ScrollBarAsNeeded); QCOMPARE(allSongs->mList->listItemPrototype()->graphicsSize(), HbListViewItem::Thumbnail); QVERIFY(allSongs->mIndexFeedback->itemView() == allSongs->mList); // Normal mode. Should see count. - QCOMPARE(allSongs->mInfoBar->heading(), hbTrId("txt_mus_subhead_songs_l1").arg( 5 ) ); + QCOMPARE(allSongs->mInfoBar->heading(), hbTrId("txt_mus_subhead_songs_l1").arg(5) ); } /*! @@ -274,7 +274,7 @@ MpCollectionContainerAllSongs *allSongs = static_cast(mTest); QVERIFY(allSongs->mList == 0); - QVERIFY(allSongs->mInfoBar == 0); + QCOMPARE(allSongs->mInfoBar->heading(), hbTrId("txt_mus_subhead_songs_l1").arg(0) ); QVERIFY(allSongs->mNoMusic != 0); } @@ -292,18 +292,16 @@ MpCollectionContainerArtists *artists = static_cast(mTest); QCOMPARE(artists->mCollectionContext, ECollectionContextArtists); QVERIFY(artists->mList != 0); - QVERIFY(artists->mInfoBar == 0); + QVERIFY(artists->mInfoBar != 0); QVERIFY(artists->mTBone == 0); QVERIFY(artists->mNoMusic == 0); QCOMPARE(artists->mList->itemRecycling(), true); - QCOMPARE(artists->mList->scrollingStyle(), HbListView::PanOrFlick); - QCOMPARE(artists->mList->clampingStyle(), HbListView::BounceBackClamping); - QCOMPARE(artists->mList->frictionEnabled(), true); QCOMPARE(artists->mList->longPressEnabled(), true); QCOMPARE(artists->mList->verticalScrollBarPolicy(), HbScrollArea::ScrollBarAsNeeded); QCOMPARE(artists->mList->listItemPrototype()->graphicsSize(), HbListViewItem::Thumbnail); QVERIFY(artists->mIndexFeedback->itemView() == artists->mList); QVERIFY(artists->mCurrentAlbumIndex == 0); + QCOMPARE(artists->mInfoBar->heading(), hbTrId("txt_mus_subhead_artist_1l").arg(5)); // User selects an artist - case where artist has more than 1 album mCollectionData->mContext = ECollectionContextArtistAlbums; @@ -320,7 +318,7 @@ mTest->setDataModel(mCollectionDataModel); QCOMPARE(artists->mCollectionContext, ECollectionContextArtistAlbumsTBone); QVERIFY(artists->mList != 0); - QVERIFY(artists->mInfoBar == 0); + QVERIFY(artists->mInfoBar != 0); QVERIFY(artists->mTBone != 0); QVERIFY(artists->mTBoneListModel != 0); QVERIFY(artists->mAlbumIndexOffset == 1); @@ -343,7 +341,7 @@ QCOMPARE(artists->mCollectionContext, ECollectionContextArtistAllSongs); QVERIFY(artists->mList != 0); QVERIFY(artists->mInfoBar != 0); - QCOMPARE(artists->mInfoBar->heading(), hbTrId("txt_mus_subtitle_1_all").arg("Title")); + QCOMPARE(artists->mInfoBar->heading(), QString(HbParameterLengthLimiter("txt_mus_subtitle_1_all").arg(QString("Title")))); // User selects back - navigate back to artist albums mCollectionData->mContext = ECollectionContextArtistAlbums; @@ -354,7 +352,7 @@ mCollectionData->mContext = ECollectionContextArtists; mTest->setDataModel(mCollectionDataModel); QCOMPARE(artists->mCollectionContext, ECollectionContextArtists); - QVERIFY(artists->mInfoBar == 0); + QVERIFY(artists->mInfoBar != 0); QVERIFY(artists->mCurrentAlbumIndex == 0); // User selects an artist - case where artist has 1 album @@ -365,7 +363,7 @@ mTest->setDataModel(mCollectionDataModel); QCOMPARE(artists->mCollectionContext, ECollectionContextArtistAlbumsTBone); QVERIFY(artists->mList != 0); - QVERIFY(artists->mInfoBar == 0); + QVERIFY(artists->mInfoBar != 0); QVERIFY(artists->mTBone != 0); QVERIFY(artists->mTBoneListModel != 0); QVERIFY(artists->mAlbumIndexOffset == 0); @@ -376,9 +374,10 @@ mCollectionData->mContext = ECollectionContextArtists; mTest->setDataModel(mCollectionDataModel); QCOMPARE(artists->mCollectionContext, ECollectionContextArtists); - QVERIFY(artists->mInfoBar == 0); + QVERIFY(artists->mInfoBar != 0); QVERIFY(artists->mTBone == 0); QVERIFY(artists->mCurrentAlbumIndex == 0); + QCOMPARE(artists->mInfoBar->heading(), hbTrId("txt_mus_subhead_artist_1l").arg(1)); } /*! @@ -415,9 +414,10 @@ mCollectionData->mContext = ECollectionContextArtists; mTest->setDataModel(mCollectionDataModel); QCOMPARE(artists->mCollectionContext, ECollectionContextArtists); - QVERIFY(artists->mInfoBar == 0); + QVERIFY(artists->mInfoBar != 0); QVERIFY(artists->mTBone == 0); QVERIFY(artists->mCurrentAlbumIndex == 0); + QCOMPARE(artists->mInfoBar->heading(), hbTrId("txt_mus_subhead_artist_1l").arg(1)); // User selects an artist - case where artist has more than 1 album mCollectionData->mCount = 5; @@ -448,7 +448,7 @@ MpCollectionContainerArtists *artists = static_cast(mTest); QVERIFY(artists->mList == 0); - QVERIFY(artists->mInfoBar == 0); + QCOMPARE(artists->mInfoBar->heading(), hbTrId("txt_mus_subhead_artist_1l").arg(0)); QVERIFY(artists->mTBone == 0); QVERIFY(artists->mNoMusic != 0); } @@ -467,17 +467,15 @@ MpCollectionContainerAlbums *albums = static_cast(mTest); QCOMPARE(albums->mCollectionContext, ECollectionContextAlbums); QVERIFY(albums->mList != 0); - QVERIFY(albums->mInfoBar == 0); + QVERIFY(albums->mInfoBar != 0); QVERIFY(albums->mTBone == 0); QVERIFY(albums->mNoMusic == 0); QCOMPARE(albums->mList->itemRecycling(), true); - QCOMPARE(albums->mList->scrollingStyle(), HbListView::PanOrFlick); - QCOMPARE(albums->mList->clampingStyle(), HbListView::BounceBackClamping); - QCOMPARE(albums->mList->frictionEnabled(), true); QCOMPARE(albums->mList->longPressEnabled(), true); QCOMPARE(albums->mList->verticalScrollBarPolicy(), HbScrollArea::ScrollBarAsNeeded); QCOMPARE(albums->mList->listItemPrototype()->graphicsSize(), HbListViewItem::Thumbnail); QVERIFY(albums->mIndexFeedback->itemView() == albums->mList); + QCOMPARE(albums->mInfoBar->heading(),hbTrId("txt_mus_subhead_albums_1l").arg(5)); // User selects an album QSignalSpy spy(mTest, SIGNAL(findAlbumSongs(int))); @@ -486,7 +484,7 @@ mTest->setDataModel(mCollectionDataModel); QCOMPARE(albums->mCollectionContext, ECollectionContextAlbumsTBone); QVERIFY(albums->mList != 0); - QVERIFY(albums->mInfoBar == 0); + QVERIFY(albums->mInfoBar != 0); QVERIFY(albums->mTBone != 0); QVERIFY(albums->mTBoneListModel != 0); QCOMPARE(albums->mTBone->reflectionsEnabled(), false); @@ -497,8 +495,9 @@ mTest->setDataModel(mCollectionDataModel); QCOMPARE(albums->mCollectionContext, ECollectionContextAlbums); QVERIFY(albums->mList != 0); - QVERIFY(albums->mInfoBar == 0); + QVERIFY(albums->mInfoBar != 0); QVERIFY(albums->mTBone == 0); + QCOMPARE(albums->mInfoBar->heading(),hbTrId("txt_mus_subhead_albums_1l").arg(5)); } /*! @@ -524,6 +523,7 @@ QCOMPARE(albums->mCollectionContext, ECollectionContextAlbumsTBone); QVERIFY(albums->mList != 0); QVERIFY(albums->mInfoBar != 0); + QCOMPARE(albums->mInfoBar->heading(), hbTrId("txt_mus_subtitle_select_song")); QVERIFY(albums->mTBone != 0); QVERIFY(albums->mTBoneListModel != 0); QCOMPARE(albums->mTBone->reflectionsEnabled(), false); @@ -536,8 +536,9 @@ mTest->setDataModel(mCollectionDataModel); QCOMPARE(albums->mCollectionContext, ECollectionContextAlbums); QVERIFY(albums->mList != 0); - QVERIFY(albums->mInfoBar == 0); + QVERIFY(albums->mInfoBar != 0); QVERIFY(albums->mTBone == 0); + QCOMPARE(albums->mInfoBar->heading(),hbTrId("txt_mus_subhead_albums_1l").arg(5)); } /*! @@ -551,7 +552,7 @@ MpCollectionContainerAlbums *albums = static_cast(mTest); QVERIFY(albums->mList == 0); - QVERIFY(albums->mInfoBar == 0); + QCOMPARE(albums->mInfoBar->heading(),hbTrId("txt_mus_subhead_albums_1l").arg(0)); QVERIFY(albums->mTBone == 0); QVERIFY(albums->mNoMusic != 0); } @@ -570,16 +571,14 @@ MpCollectionContainerPlaylists *playlists = static_cast(mTest); QCOMPARE(playlists->mCollectionContext, ECollectionContextPlaylists); QVERIFY(playlists->mList != 0); - QVERIFY(playlists->mInfoBar == 0); + QVERIFY(playlists->mInfoBar != 0); QVERIFY(playlists->mNoMusic == 0); QCOMPARE(playlists->mList->itemRecycling(), true); - QCOMPARE(playlists->mList->scrollingStyle(), HbListView::PanOrFlick); - QCOMPARE(playlists->mList->clampingStyle(), HbListView::BounceBackClamping); - QCOMPARE(playlists->mList->frictionEnabled(), true); QCOMPARE(playlists->mList->longPressEnabled(), true); QCOMPARE(playlists->mList->verticalScrollBarPolicy(), HbScrollArea::ScrollBarAsNeeded); QCOMPARE(playlists->mList->listItemPrototype()->graphicsSize(), HbListViewItem::Thumbnail); QVERIFY(playlists->mIndexFeedback->itemView() == 0 ); + QCOMPARE(playlists->mInfoBar->heading(),hbTrId("txt_mus_subhead_playlists_1l").arg(5)); // User selects a playlist mCollectionData->mContext = ECollectionContextPlaylistSongs; @@ -588,14 +587,15 @@ QVERIFY(playlists->mList != 0); QVERIFY(playlists->mInfoBar != 0); QVERIFY(playlists->mNoMusic == 0); - QCOMPARE(playlists->mInfoBar->heading(), QString("Title")); - + QCOMPARE(playlists->mInfoBar->heading(), QString(HbParameterLengthLimiter("txt_mus_subhead_1_2l").arg(QString("Title")).arg(5))); + // User selects back - navigate back to playlists mCollectionData->mContext = ECollectionContextPlaylists; mTest->setDataModel(mCollectionDataModel); QCOMPARE(playlists->mCollectionContext, ECollectionContextPlaylists); QVERIFY(playlists->mList != 0); - QVERIFY(playlists->mInfoBar == 0); + QVERIFY(playlists->mInfoBar != 0); + QCOMPARE(playlists->mInfoBar->heading(),hbTrId("txt_mus_subhead_playlists_1l").arg(5)); } /*! @@ -627,7 +627,8 @@ mTest->setDataModel(mCollectionDataModel); QCOMPARE(playlists->mCollectionContext, ECollectionContextPlaylists); QVERIFY(playlists->mList != 0); - QVERIFY(playlists->mInfoBar == 0); + QVERIFY(playlists->mInfoBar != 0); + QCOMPARE(playlists->mInfoBar->heading(),hbTrId("txt_mus_subhead_playlists_1l").arg(5)); } /*! @@ -641,7 +642,7 @@ MpCollectionContainerPlaylists *playlists = static_cast(mTest); QVERIFY(playlists->mList == 0); - QVERIFY(playlists->mInfoBar == 0); + QCOMPARE(playlists->mInfoBar->heading(), QString(HbParameterLengthLimiter("txt_mus_subhead_1_2l").arg(QString("Title")).arg(0))); QVERIFY(playlists->mNoMusic != 0); } @@ -758,34 +759,36 @@ */ void TestMpCollectionContainers::testOnLongPressed() { + qRegisterMetaType("QModelIndex"); + mTest = mView->mContainerFactory->createContainer(ECollectionContextAllSongs); - QSignalSpy spy(mTest, SIGNAL(itemLongPressed( int, QPointF ))); + QSignalSpy spy(mTest, SIGNAL(itemLongPressed( QModelIndex, QPointF ))); HbListView *viewItem = new HbListView(); static_cast(mTest)->onLongPressed(viewItem->listItemPrototype(), QPointF()); QCOMPARE(spy.count(), 1); - QCOMPARE(qvariant_cast(spy.at(0).at(0)), -1); + QCOMPARE(qvariant_cast(spy.at(0).at(0)), 0); mTest = 0; mTest = mView->mContainerFactory->createContainer(ECollectionContextArtists); - QSignalSpy spy2(mTest, SIGNAL(itemLongPressed( int, QPointF ))); + QSignalSpy spy2(mTest, SIGNAL(itemLongPressed( QModelIndex, QPointF ))); static_cast(mTest)->onLongPressed(viewItem->listItemPrototype(), QPointF()); QCOMPARE(spy2.count(), 1); - QCOMPARE(qvariant_cast(spy2.at(0).at(0)), -1); + QCOMPARE(qvariant_cast(spy2.at(0).at(0)), 0); mTest = 0; mTest = mView->mContainerFactory->createContainer(ECollectionContextAlbums); - QSignalSpy spy3(mTest, SIGNAL(itemLongPressed( int, QPointF ))); + QSignalSpy spy3(mTest, SIGNAL(itemLongPressed( QModelIndex, QPointF ))); static_cast(mTest)->onLongPressed(viewItem->listItemPrototype(), QPointF()); QCOMPARE(spy3.count(), 1); - QCOMPARE(qvariant_cast(spy3.at(0).at(0)), -1); + QCOMPARE(qvariant_cast(spy3.at(0).at(0)), 0); mTest = 0; mTest = mView->mContainerFactory->createContainer(ECollectionContextPlaylists); - QSignalSpy spy4(mTest, SIGNAL(itemLongPressed( int, QPointF ))); + QSignalSpy spy4(mTest, SIGNAL(itemLongPressed( QModelIndex, QPointF ))); static_cast(mTest)->onLongPressed(viewItem->listItemPrototype(), QPointF()); QCOMPARE(spy4.count(), 1); - QCOMPARE(qvariant_cast(spy4.at(0).at(0)), -1); + QCOMPARE(qvariant_cast(spy4.at(0).at(0)), 0); } diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/stub/inc/mpcollectiondatamodel.h --- a/mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/stub/inc/mpcollectiondatamodel.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/stub/inc/mpcollectiondatamodel.h Fri Sep 03 19:58:01 2010 -0500 @@ -23,6 +23,7 @@ class MpMpxCollectionData; class MpCollectionAlbumArtManager; +class MpPlaybackData; class MpCollectionDataModel : public QAbstractListModel @@ -31,7 +32,8 @@ public: - explicit MpCollectionDataModel( MpMpxCollectionData *data, QObject *parent=0 ); + explicit MpCollectionDataModel( MpMpxCollectionData *data, MpPlaybackData *playbackData = 0, + QObject *parent=0 ); virtual ~MpCollectionDataModel(); int rowCount(const QModelIndex &parent=QModelIndex()) const; diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/stub/inc/mpcollectiontbonelistdatamodel.h --- a/mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/stub/inc/mpcollectiontbonelistdatamodel.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/stub/inc/mpcollectiontbonelistdatamodel.h Fri Sep 03 19:58:01 2010 -0500 @@ -22,6 +22,7 @@ #include class MpMpxCollectionData; +class MpPlaybackData; class MpCollectionTBoneListDataModel : public QAbstractListModel { @@ -29,7 +30,8 @@ public: - explicit MpCollectionTBoneListDataModel( MpMpxCollectionData *data, QObject *parent=0 ); + explicit MpCollectionTBoneListDataModel( MpMpxCollectionData *data, MpPlaybackData *playbackData = 0, + QObject *parent=0 ); virtual ~MpCollectionTBoneListDataModel(); int rowCount(const QModelIndex &parent=QModelIndex()) const; diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/stub/inc/mpcollectionview.h --- a/mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/stub/inc/mpcollectionview.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/stub/inc/mpcollectionview.h Fri Sep 03 19:58:01 2010 -0500 @@ -57,7 +57,7 @@ public slots: void openIndex( int index ); - void openContextMenu( int index, const QPointF &coords ); + void openContextMenu( const QModelIndex &index, const QPointF &coords ); void findAlbumSongs( int index ); void playAlbumSongs( int albumIndex, int songIndex ); diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/stub/inc/mpengine.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/stub/inc/mpengine.h Fri Sep 03 19:58:01 2010 -0500 @@ -0,0 +1,93 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Music Player engine stub for mpplaybackview. +* +*/ + +#ifndef MPENGINE_H +#define MPENGINE_H + +#include +#include + + +class MpPlaybackData; + +class MpEngine : public QObject +{ + Q_OBJECT + + friend class MpEngineFactory; + +public: + enum EngineMode{ + StandAlone, + Fetch, + Embedded, + MediaBrowsing + }; + +private: + explicit MpEngine(); + +public: + + virtual ~MpEngine(); + + MpPlaybackData *playbackData(); + void retrieveSongDetails(); + + // Equalizer related + void applyPreset( int preset ); + void disableEqualizer(); + int activePreset(); + QStringList presetNames(); + +public slots: + // Playback related + void stop(); + void setShuffle(bool mode); + void setRepeat( bool mode); + void startSeekBackward(); + void startSeekForward(); + void stopSeeking(); + void skipBackward(); + void skipForward(); + void playPause(); + void setPosition( int position ); + +signals: + + // Equalizer related + void libraryUpdated(); + void corruptedStop(); + +private: + Q_DISABLE_COPY( MpEngine ) + +public: + int mActivePreset; + int mApplyPresetCount; + int mDisableEquqlizerCount; + int retrieveSongDetailsCount; + int stopCount; + int startSeekBackwardCount; + int startSeekForwardCount; + int stopSeekingCount; + int skipBackwardCount; + int skipForwardCount; + +}; + +#endif // MPENGINE_H diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/stub/inc/mpenginefactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/stub/inc/mpenginefactory.h Fri Sep 03 19:58:01 2010 -0500 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MpEngineFactory stub for testing mpplaybackview +* +*/ + +#ifndef MPENGINEFACTORY_H +#define MPENGINEFACTORY_H + +#include +#include "mpengine.h" + +class MpPlaybackData; + +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 diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/stub/inc/mpnowplayingwidget.h --- a/mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/stub/inc/mpnowplayingwidget.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/stub/inc/mpnowplayingwidget.h Fri Sep 03 19:58:01 2010 -0500 @@ -19,9 +19,9 @@ #define MPNOWPLAYINGWIDGET_H //includes -#include +#include -class MpNowPlayingWidget : public QObject +class MpNowPlayingWidget : public HbWidget { Q_OBJECT diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/stub/inc/mpplaybackdata.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/stub/inc/mpplaybackdata.h Fri Sep 03 19:58:01 2010 -0500 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: mpplaybackdata stub for testing mpmediawallview +* +*/ + +#ifndef MPPLAYBACKDATA_H +#define MPPLAYBACKDATA_H + +//includes +#include +#include +#include + +class MpPlaybackData : public QObject +{ + Q_OBJECT + +public: + + enum SimplifiedState { + NotPlaying, + Playing, + Paused, + Stopped + }; + + + explicit MpPlaybackData(); + virtual ~MpPlaybackData(); + +signals: + void playbackStateChanged(); + void playbackInfoChanged(); + +public: + + int id(); + void setPlaybackState( const SimplifiedState state ); + MpPlaybackData::SimplifiedState playbackState() const; + +public: + + MpPlaybackData::SimplifiedState mPlaybackState; +}; + +#endif // MPPLAYBACKDATA_H diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/stub/src/mpcollectiondatamodel.cpp --- a/mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/stub/src/mpcollectiondatamodel.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/stub/src/mpcollectiondatamodel.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -19,16 +19,18 @@ #include "stub/inc/mpcollectiondatamodel.h" #include "stub/inc/mpmpxcollectiondata.h" +#include "stub/inc/mpplaybackdata.h" #include "mptrace.h" /*! Stub function */ -MpCollectionDataModel::MpCollectionDataModel( MpMpxCollectionData *data, QObject *parent ) +MpCollectionDataModel::MpCollectionDataModel( MpMpxCollectionData *data, MpPlaybackData *playbackData, QObject *parent ) : QAbstractListModel(parent), mCollectionData(data) { + Q_UNUSED(playbackData); TX_LOG } diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/stub/src/mpcollectiontbonelistdatamodel.cpp --- a/mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/stub/src/mpcollectiontbonelistdatamodel.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/stub/src/mpcollectiontbonelistdatamodel.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -18,16 +18,19 @@ #include "stub/inc/mpcollectiontbonelistdatamodel.h" #include "stub/inc/mpmpxcollectiondata.h" +#include "stub/inc/mpplaybackdata.h" #include "mptrace.h" /*! Stub function */ -MpCollectionTBoneListDataModel::MpCollectionTBoneListDataModel( MpMpxCollectionData *data, QObject *parent ) +MpCollectionTBoneListDataModel::MpCollectionTBoneListDataModel( MpMpxCollectionData *data, + MpPlaybackData *playbackData, QObject *parent ) : QAbstractListModel(parent), mCollectionData(data), mRowCount(0) { + Q_UNUSED(playbackData); TX_LOG } diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/stub/src/mpcollectionview.cpp --- a/mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/stub/src/mpcollectionview.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/stub/src/mpcollectionview.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -78,7 +78,7 @@ /*! Stub function */ -void MpCollectionView::openContextMenu( int index, const QPointF &coords ) +void MpCollectionView::openContextMenu( const QModelIndex &index, const QPointF &coords ) { Q_UNUSED(index); Q_UNUSED(coords); diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/stub/src/mpengine.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/stub/src/mpengine.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -0,0 +1,170 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Stub for MpEngine +* +*/ + +#include "mpengine.h" +#include "stub\inc\mpplaybackdata.h" +#include "mptrace.h" + + +/*! + Stub + */ +MpEngine::MpEngine() +{ + TX_LOG_ARGS("Stub") +} + +/*! + Stub + */ +MpEngine::~MpEngine() +{ + TX_ENTRY_ARGS("Stub") +} + + +/*! + Stub + */ +void MpEngine::applyPreset( int preset ) +{ + mApplyPresetCount++; + mActivePreset = preset; +} + +/*! + Stub + */ +void MpEngine::disableEqualizer() +{ + mDisableEquqlizerCount++; + mActivePreset = -1; +} + +/*! + Stub + */ +int MpEngine::activePreset() +{ + return mActivePreset; +} + +/*! + Stub + */ +QStringList MpEngine::presetNames() +{ + QStringList presets; + presets << "Bass Booster" << "Classic" << "Jazz" << "Pop" << "Rock" << "New Preset"; + return presets; +} + + +/*! + Stub + */ +MpPlaybackData *MpEngine::playbackData() +{ + return new MpPlaybackData(); +} + +/*! + Stub + */ +void MpEngine::stop() +{ + stopCount++; +} + +/*! + Stub + */ +void MpEngine::retrieveSongDetails() +{ + retrieveSongDetailsCount++; +} + +/*! + Stub + */ +void MpEngine::setShuffle( bool mode ) +{ + Q_UNUSED(mode) +} +/*! + Stub + */ +void MpEngine::setRepeat( bool mode ) +{ + Q_UNUSED(mode) +} + +/*! + Stub + */ +void MpEngine::startSeekBackward() +{ + startSeekBackwardCount++; +} + +/*! + Stub + */ +void MpEngine::startSeekForward() +{ + startSeekForwardCount++; +} + +/*! + Stub + */ +void MpEngine::stopSeeking() +{ + stopSeekingCount++; +} + +/*! + Stub + */ +void MpEngine::skipBackward() +{ + skipBackwardCount++; +} + +/*! + Stub + */ +void MpEngine::skipForward() +{ + skipForwardCount++; +} + +/*! + Stub + */ +void MpEngine::playPause() +{ + +} + +/*! + Stub + */ +void MpEngine::setPosition(int position) +{ + Q_UNUSED(position) +} diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/stub/src/mpenginefactory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/stub/src/mpenginefactory.cpp Fri Sep 03 19:58: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 mpplaybackview +* +*/ + + +#include "stub/inc/mpenginefactory.h" +#include "stub/inc/mpplaybackdata.h" +#include "stub/inc/mpengine.h" + + + +/*! + * Stub function + */ + +/*! + * 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; +} diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/stub/src/mpplaybackdata.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/stub/src/mpplaybackdata.cpp Fri Sep 03 19:58: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: MpPlaybackData stub for testing mpnowplayingwidget +* +*/ + +#include "stub/inc/mpplaybackdata.h" + + +int gUpdateCounter = 0; + + +/*! + Stub function. + */ +MpPlaybackData::MpPlaybackData() + : mPlaybackState(NotPlaying) +{ + gUpdateCounter++; +} + +/*! + Stub function. + */ +MpPlaybackData::~MpPlaybackData() +{ +} + +/*! + Stub function. + */ +int MpPlaybackData::id() +{ + return 0; +} + +/*! + Stub function. + */ +void MpPlaybackData::setPlaybackState(MpPlaybackData::SimplifiedState state) +{ + mPlaybackState=state; +} + +/*! + Stub function. + */ +MpPlaybackData::SimplifiedState MpPlaybackData::playbackState() const +{ + return mPlaybackState; +} diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/unittest_mpcollectioncontainers.pro --- a/mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/unittest_mpcollectioncontainers.pro Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/unittest_mpcollectioncontainers.pro Fri Sep 03 19:58:01 2010 -0500 @@ -44,8 +44,11 @@ stub/inc/mpmpxcollectiondata.h \ stub/inc/mpcollectionview.h \ stub/inc/hgmediawall.h \ - stub/inc/mpnowplayingwidget.h - + stub/inc/mpnowplayingwidget.h\ + stub/inc/mpplaybackdata.h \ + stub/inc/mpengine.h \ + stub/inc/mpenginefactory.h + SOURCES += src/unittest_mpcollectioncontainers.cpp \ ../../src/mpcollectioncontainerfactory.cpp \ ../../src/mpcollectioncontainer.cpp \ @@ -60,7 +63,11 @@ stub/src/mpmpxcollectiondata.cpp \ stub/src/mpcollectionview.cpp \ stub/src/hgmediawall.cpp \ - stub/src/mpnowplayingwidget.cpp + stub/src/mpnowplayingwidget.cpp \ + stub/src/mpplaybackdata.cpp \ + stub/src/mpengine.cpp \ + stub/src/mpenginefactory.cpp + RESOURCES += ../../resources/mpcollectionviewresources.qrc diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpdetailsviewplugin/tsrc/UT_ALL_mpdetailsviewplugin.pkg --- a/mpviewplugins/mpdetailsviewplugin/tsrc/UT_ALL_mpdetailsviewplugin.pkg Tue Aug 24 03:36:14 2010 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +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 -#{"UT_ALL_mpdetailsviewplugin"},(0xEab0059a),1,0,0 - -; Localised Vendor name -%{"Vendor"} - -; Unique Vendor name -:"Vendor" - -; Executable and default resource files - -"/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" - -"/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" diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpdetailsviewplugin/tsrc/sis/UT_ALL_mpdetailsviewplugin.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpviewplugins/mpdetailsviewplugin/tsrc/sis/UT_ALL_mpdetailsviewplugin.pkg Fri Sep 03 19:58: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: +; +; Language +&EN + +; SIS header: name, uid, version +#{"UT_ALL_mpdetailsviewplugin"},(0xEab0059a),1,0,0 + +; Localised Vendor name +%{"Vendor"} + +; Unique Vendor name +:"Vendor" + +; Executable and default resource files + +"/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" + +"/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" diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailsview/stub/inc/mpenginefactory.h --- a/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailsview/stub/inc/mpenginefactory.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailsview/stub/inc/mpenginefactory.h Fri Sep 03 19:58:01 2010 -0500 @@ -32,8 +32,8 @@ public: virtual ~MpEngineFactory(); static MpEngineFactory * instance(); - - static MpEngine *createSharedEngine( TUid uid = TUid::Uid( MpCommon::KMusicPlayerUid ), MpEngine::EngineMode mode = MpEngine::StandAlone ); + + static MpEngine *createSharedEngine( quint32 clientSecureId=MpCommon::KMusicPlayerUid, MpEngine::EngineMode mode = MpEngine::StandAlone ); static MpEngine *sharedEngine(); static void close(); diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailsview/stub/src/mpenginefactory.cpp --- a/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailsview/stub/src/mpenginefactory.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailsview/stub/src/mpenginefactory.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -54,10 +54,10 @@ } /*! - Returns an instance to an engine with \a hostUid, and \a mode, if the shared engine is + Returns an instance to an engine with \a clientSecureId, and \a mode, if the shared engine is already created parameters are ignored. */ -MpEngine *MpEngineFactory::createSharedEngine( TUid /*hostUid*/ , MpEngine::EngineMode /*mode*/ ) +MpEngine *MpEngineFactory::createSharedEngine( quint32 /*clientSecureId*/ , MpEngine::EngineMode /*mode*/ ) { TX_LOG_ARGS("MpEngineFactory::createSharedEngine() Stub") if ( !instance()->mSharedEngine ) { diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpquerymanager/src/unittest_mpquerymanager.cpp --- a/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpquerymanager/src/unittest_mpquerymanager.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpquerymanager/src/unittest_mpquerymanager.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -61,14 +61,17 @@ TestMpQueryManager tv; - char *pass[3]; - pass[0] = argv[0]; - pass[1] = "-o"; - pass[2] = "c:\\data\\unittest_testmpquerymanager.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_testmpquerymanager.txt"; - int res = QTest::qExec(&tv, 3, pass); - - return res; + return QTest::qExec(&tv, 3, pass); + } } //Constructor diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpmediawallviewplugin/inc/mpmediawallview.h --- a/mpviewplugins/mpmediawallviewplugin/inc/mpmediawallview.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpmediawallviewplugin/inc/mpmediawallview.h Fri Sep 03 19:58:01 2010 -0500 @@ -29,7 +29,6 @@ class HbLabel; class MpMediaWallDocumentLoader; class HbAction; -class HbIcon; class MpPlaybackData; class QParallelAnimationGroup; class QPropertyAnimation; @@ -58,8 +57,6 @@ void containerContentsChanged(); void libraryAboutToUpdate(); void libraryUpdated(); - void sendToBackground(); - void updatePlayPauseAction(); void hideTracksList(); void showTrackList(); void dismissListClosingAnimation(); @@ -80,14 +77,8 @@ HgMediawall *mMediaWallWidget; // own - parented HbLabel *mNoMusic; // own - parented MpMediaWallDocumentLoader *mDocumentLoader; // own - QGraphicsWidget *mPlayPauseContainer; // own - parented - HbIcon *mPlayIcon; // own - HbIcon *mPauseIcon; // own - HbAction *mPlayPauseAction; // own - parented bool mLibraryUpdating; MpPlaybackData *mPlaybackData; // not own - bool mActivated; - bool mIconUpdateNedded; QParallelAnimationGroup *mListShowAnimationGroup; // own - parented QPropertyAnimation *mListShowListAnimation; // own - parented QPropertyAnimation *mCoverShowListAnimation; // own - parented diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpmediawallviewplugin/inc/mpreflectioneffect.h --- a/mpviewplugins/mpmediawallviewplugin/inc/mpreflectioneffect.h Tue Aug 24 03:36:14 2010 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -/* -* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: reflection effect for Music Player Media Wall. -* -*/ -#ifndef MPREFLECTIONEFFECT_H -#define MPREFLECTIONEFFECT_H - -#include - -class MpReflectionEffect: public QGraphicsEffect -{ - Q_OBJECT - -public: - MpReflectionEffect(QObject *parent = 0); - ~MpReflectionEffect(); - - QRectF boundingRectFor(const QRectF &rect) const; - -protected: - void draw(QPainter *painter); - -private: - Q_DISABLE_COPY(MpReflectionEffect) -}; - -#endif // MPREFLECTIONEFFECT_H - -// EOF diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpmediawallviewplugin/inc/mptracklistwidget.h --- a/mpviewplugins/mpmediawallviewplugin/inc/mptracklistwidget.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpmediawallviewplugin/inc/mptracklistwidget.h Fri Sep 03 19:58:01 2010 -0500 @@ -35,6 +35,7 @@ HbListView *list(); + signals: void closed(); @@ -44,6 +45,8 @@ void mousePressEvent( QGraphicsSceneMouseEvent *event ); void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); void gestureEvent(QGestureEvent *event); + void paint( QPainter *painter, const QStyleOptionGraphicsItem *option, + QWidget *widget = 0 ); QSwipeGesture::SwipeDirection swipeAngleToDirection( int angle ); private: diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpmediawallviewplugin/mpmediawallviewplugin.pro --- a/mpviewplugins/mpmediawallviewplugin/mpmediawallviewplugin.pro Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpmediawallviewplugin/mpmediawallviewplugin.pro Fri Sep 03 19:58:01 2010 -0500 @@ -47,13 +47,11 @@ inc/mpmediawallviewplugin.h \ inc/mpmediawallview.h \ inc/mpmediawalldocumentloader.h \ - inc/mptracklistwidget.h \ - inc/mpreflectioneffect.h + inc/mptracklistwidget.h SOURCES += src/mpmediawallviewplugin.cpp \ src/mpmediawallview.cpp \ src/mpmediawalldocumentloader.cpp \ - src/mptracklistwidget.cpp \ - src/mpreflectioneffect.cpp + src/mptracklistwidget.cpp RESOURCES += resources/mpmediawallviewresources.qrc DOCML += resources/mediawall.docml diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpmediawallviewplugin/resources/mediawall.docml --- a/mpviewplugins/mpmediawallviewplugin/resources/mediawall.docml Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpmediawallviewplugin/resources/mediawall.docml Fri Sep 03 19:58:01 2010 -0500 @@ -4,25 +4,8 @@ - - - - - - - - - - - - - - + - - - - diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpmediawallviewplugin/resources/mpcustomlistitem.hblistviewitem.widgetml --- a/mpviewplugins/mpmediawallviewplugin/resources/mpcustomlistitem.hblistviewitem.widgetml Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpmediawallviewplugin/resources/mpcustomlistitem.hblistviewitem.widgetml Fri Sep 03 19:58:01 2010 -0500 @@ -14,12 +14,12 @@ --> - - + + - + - + @@ -41,10 +41,10 @@ text-1: connected from TOP to item TOP and BOTTOM to item BOTTOM --> - - - - + + + + diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpmediawallviewplugin/resources/mpcustommediawall.css --- a/mpviewplugins/mpmediawallviewplugin/resources/mpcustommediawall.css Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpmediawallviewplugin/resources/mpcustommediawall.css Fri Sep 03 19:58:01 2010 -0500 @@ -22,9 +22,9 @@ text-line-count-min:1; text-line-count-max:1; text-wrap-mode:no-wrap; - left:-expr(var(hb-param-touch-area-gene-primary-medium)+var(hb-param-margin-gene-left)); - right:expr(var(hb-param-touch-area-gene-primary-medium)+var(hb-param-margin-gene-right)); - top:0un; + left:-var(hb-param-margin-gene-screen); + right:var(hb-param-margin-gene-screen); + top:-var(hb-param-margin-gene-middle-vertical); bottom:0un; zvalue: 2; } @@ -37,9 +37,9 @@ text-line-count-min:1; text-line-count-max:1; text-wrap-mode:no-wrap; - left:-expr(var(hb-param-touch-area-gene-primary-medium)+var(hb-param-margin-gene-left)); - right:expr(var(hb-param-touch-area-gene-primary-medium)+var(hb-param-margin-gene-right)); - top:0un; + left:-var(hb-param-margin-gene-screen); + right:var(hb-param-margin-gene-screen); + top:-var(hb-param-margin-gene-middle-vertical); bottom:0un; zvalue: 2; } @@ -47,11 +47,11 @@ HgMediawall#MPmediaWallWidget::centeritem { size-policy: fixed fixed; - fixed-height: 41un; - fixed-width: 41un; + fixed-height: expr(var(hb-param-screen-short-edge)-var(hb-param-text-height-primary)-var(hb-param-text-height-secondary)-4*var(hb-param-margin-gene-middle-vertical)-var(hb-param-widget-scroll-bar-indicative-width)); + fixed-width: expr(var(hb-param-screen-short-edge)-var(hb-param-text-height-primary)-var(hb-param-text-height-secondary)-4*var(hb-param-margin-gene-middle-vertical)-var(hb-param-widget-scroll-bar-indicative-width)); left:0un; right:0un; - top:0un; + top:-var(hb-param-margin-gene-middle-vertical); bottom:0un; zvalue: 2; } diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpmediawallviewplugin/resources/mpcustommediawall_color.css --- a/mpviewplugins/mpmediawallviewplugin/resources/mpcustommediawall_color.css Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpmediawallviewplugin/resources/mpcustommediawall_color.css Fri Sep 03 19:58:01 2010 -0500 @@ -1,9 +1,9 @@ HgMediawall#MPmediaWallWidget::title { - color: var(qtg_view_normal); + color: var(qtc_view_normal); } HgMediawall#MPmediaWallWidget::description { - color: var(qtg_view_normal_secondary); + color: var(qtc_view_normal_secondary); } diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpmediawallviewplugin/src/mpmediawalldocumentloader.cpp --- a/mpviewplugins/mpmediawallviewplugin/src/mpmediawalldocumentloader.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpmediawallviewplugin/src/mpmediawalldocumentloader.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -16,7 +16,6 @@ */ #include -#include #include "mpmediawalldocumentloader.h" #include "mptrace.h" @@ -45,12 +44,6 @@ TX_EXIT return object; } - else if ( type == HbToolButton::staticMetaObject.className() ) { - QObject *object = new HbToolButton(); - object->setObjectName(name); - TX_EXIT - return object; - } TX_EXIT return HbDocumentLoader::createObject(type, name); diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpmediawallviewplugin/src/mpmediawallview.cpp --- a/mpviewplugins/mpmediawallviewplugin/src/mpmediawallview.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpmediawallviewplugin/src/mpmediawallview.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -23,12 +23,10 @@ #include #include #include -#include #include #include #include - #include #include "mpmediawallview.h" @@ -42,7 +40,6 @@ #include "mptracklistwidget.h" #include "mpcollectiontbonelistdatamodel.h" #include "mptrace.h" -#include "mpreflectioneffect.h" const char*MUSIC_MEDIAWALL_DOCML = ":/mediawallviewdocml/mediawall.docml"; @@ -71,14 +68,8 @@ mMediaWallWidget( 0 ), mNoMusic( 0 ), mDocumentLoader( 0 ), - mPlayPauseContainer( 0 ), - mPlayIcon( 0 ), - mPauseIcon( 0 ), - mPlayPauseAction( 0 ), mLibraryUpdating( false ), mPlaybackData( 0 ), - mActivated( false ), - mIconUpdateNedded( false ), mListShowAnimationGroup( 0 ), mListShowListAnimation( 0 ), mCoverShowListAnimation( 0 ), @@ -101,8 +92,6 @@ TX_ENTRY //delete not parented objects delete mDocumentLoader; - delete mPlayIcon; - delete mPauseIcon; TX_EXIT } @@ -121,36 +110,16 @@ if ( ok ) { QGraphicsWidget *widget; - //Setup fake softkey to hide the app - widget = mDocumentLoader->findWidget( QString( "navigationButton" ) ); - HbAction *action; - action = new HbAction( Hb::BackNaviAction, this ); - connect( action, SIGNAL( triggered( bool ) ), this, SLOT( sendToBackground() ) ); - qobject_cast( widget )->setAction( action ); - //Setup the play/pause command button - widget = mDocumentLoader->findWidget( QString( "playPauseButton" ) ); - mPauseIcon = new HbIcon( "qtg_mono_pause" ); - mPlayIcon = new HbIcon( "qtg_mono_play" ); - mPlayPauseAction = new HbAction( HbIcon() , QString(), this ); mPlaybackData = MpEngineFactory::sharedEngine()->playbackData(); - qobject_cast( widget )->setAction( mPlayPauseAction ); - //we need this widget to hide the play pause button, for some reason it does not want to hide. - mPlayPauseContainer = mDocumentLoader->findWidget( QString( "playPauseButtonContainer" ) ); - updatePlayPauseAction(); - connect( mPlaybackData, SIGNAL( playbackStateChanged() ), - this, SLOT( updatePlayPauseAction() ) ); - connect( mPlayPauseAction, SIGNAL( triggered( bool ) ), - MpEngineFactory::sharedEngine(), SLOT( playPause() ) ); - - + //Get the main container and set as widget. widget = mDocumentLoader->findWidget( QString( "container" ) ); setWidget( widget ); mEngine = MpEngineFactory::createIsolatedEngine( MpEngine::MediaBrowsing ); mCollectionData = mEngine->collectionData(); - mModel = new MpCollectionDataModel( mCollectionData, mPlaybackData, this ); + mModel = new MpCollectionDataModel( mCollectionData, 0, this ); connect( mCollectionData, SIGNAL( contextChanged( TCollectionContext ) ), this, SLOT( contextOpened( TCollectionContext ) ) ); @@ -164,19 +133,17 @@ TX_LOG_ARGS( "Error: invalid xml file." ); Q_ASSERT_X( ok, "MpCollectionView::initializeView", "invalid xml file" ); } - - mAlbumCover = new MpAlbumCoverWidget( this ); - mAlbumCover->setGraphicsEffect( new MpReflectionEffect(mAlbumCover) ); - mAlbumCover->setDefaultIcon( HbIcon( "qtg_large_album_art" ) ); - mAlbumCover->hide(); - + mTrackList = new MpTrackListWidget( this ); - mTrackList->setGraphicsEffect( new MpReflectionEffect(mTrackList) ); MpCollectionTBoneListDataModel *model = new MpCollectionTBoneListDataModel(mCollectionData, mPlaybackData, mTrackList ); model->enablePlaybackIndicatorEnable(true); mTrackList->list()->setModel( model ); mTrackList->hide(); + mAlbumCover = new MpAlbumCoverWidget( this ); + mAlbumCover->setDefaultIcon( HbIcon( "qtg_large_album_art" ) ); + mAlbumCover->hide(); + connect(mAlbumCover,SIGNAL(clicked()),this, SLOT(hideTracksList())); connect(mTrackList->list(), SIGNAL(activated(QModelIndex)), this, SLOT(listItemActivated(QModelIndex))); connect(mTrackList,SIGNAL(closed()),this, SLOT(hideTracksList())); @@ -194,11 +161,6 @@ void MpMediaWallView::activateView() { TX_ENTRY - mActivated = true; - if ( mIconUpdateNedded ) { - updatePlayPauseAction(); - mIconUpdateNedded = false; - } scrollToNowPlaying(); TX_EXIT } @@ -209,7 +171,6 @@ void MpMediaWallView::deactivateView() { TX_ENTRY - mActivated = false; dismissListClosingAnimation(); TX_EXIT } @@ -241,8 +202,6 @@ widget = mDocumentLoader->findWidget(QString("MPmediaWallWidget")); mMediaWallWidget = qobject_cast(widget); //set these items as children of the media wall so they show behind the scrollbar. - mTrackList->setParentItem(mMediaWallWidget); - mAlbumCover->setParentItem(mMediaWallWidget); mModel->refreshModel(); setUpMediaWallWidget(); } @@ -256,8 +215,6 @@ else { if ( mMediaWallWidget ) { //Take ownership of these items to prevent delete from media wall widget. - mTrackList->setParentItem( this ); - mAlbumCover->setParentItem( this ); delete mMediaWallWidget; mMediaWallWidget = 0; @@ -310,47 +267,6 @@ } /*! - Slot to be called to send to background. - */ -void MpMediaWallView::sendToBackground() -{ - TX_ENTRY - emit command( MpCommon::SendToBackground ); - TX_EXIT -} - -/*! - Slot to update teh play pause action icon. - */ -void MpMediaWallView::updatePlayPauseAction() -{ - if ( !mActivated ) { - mIconUpdateNedded = true; - return; - } - TX_ENTRY - switch ( mPlaybackData->playbackState() ) { - case MpPlaybackData::Playing: - TX_LOG_ARGS( "MpPlaybackData::Playing" ) - mPlayPauseAction->setIcon( *mPauseIcon ); - mPlayPauseContainer->show(); - break; - case MpPlaybackData::Paused: - case MpPlaybackData::Stopped: - TX_LOG_ARGS( "MpPlaybackData::Paused" ) - mPlayPauseAction->setIcon( *mPlayIcon ); - mPlayPauseContainer->show(); - break; - case MpPlaybackData::NotPlaying: - mPlayPauseContainer->hide(); - break; - default: - break; - } - TX_EXIT -} - -/*! Slot called to start the album and list opening animation. */ void MpMediaWallView::showTrackList() @@ -396,19 +312,23 @@ */ void MpMediaWallView::listItemActivated( const QModelIndex &index ) { - if (!mCollectionData->hasAlbumSongProperty(index.row(), MpMpxCollectionData::Corrupted)) { - int albumIndex = mMediaWallWidget->currentIndex().row(); - //We are playing on the shared engine, but we pass the collection data that - //points to albums on media wall, this is used to construct the playlist. - MpEngineFactory::sharedEngine()->playAlbumSongs( albumIndex, index.row(), mCollectionData ); - } - else{ + if (mCollectionData->hasAlbumSongProperty(index.row(), MpMpxCollectionData::Corrupted)) { //pop up corrupted note HbMessageBox *messageBox = new HbMessageBox( hbTrId( "txt_mus_info_file_is_corrupt" ), HbMessageBox::MessageTypeInformation ); messageBox->setAttribute( Qt::WA_DeleteOnClose ); messageBox->setIcon( HbIcon( QString("qtg_small_fail") ) ); messageBox->show(); } + else if ( (mPlaybackData->playbackState() != MpPlaybackData::NotPlaying ) + && ( mPlaybackData->id() == mCollectionData->albumSongId( index.row() ) ) ) { + MpEngineFactory::sharedEngine()->playPause(); + } + else { + int albumIndex = mMediaWallWidget->currentIndex().row(); + //We are playing on the shared engine, but we pass the collection data that + //points to albums on media wall, this is used to construct the playlist. + MpEngineFactory::sharedEngine()->playAlbumSongs( albumIndex, index.row(), mCollectionData ); + } } /*! @@ -429,7 +349,7 @@ HbIcon defaultIcon( "qtg_large_album_art" ); defaultIcon.setSize(mMediaWallWidget->itemSize()); mMediaWallWidget->setDefaultImage( defaultIcon.pixmap().toImage() ); - mMediaWallWidget->enableReflections( true ); + mMediaWallWidget->enableReflections( false ); mMediaWallWidget->setModel( mModel ); scrollToDefault(); mMediaWallWidget->setTitleFontSpec( HbFontSpec( HbFontSpec::Primary ) ); diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpmediawallviewplugin/src/mpreflectioneffect.cpp --- a/mpviewplugins/mpmediawallviewplugin/src/mpreflectioneffect.cpp Tue Aug 24 03:36:14 2010 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,98 +0,0 @@ -/* -* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Reflection effect for Music Player Media Wall. -* -*/ - -#include -#include -#include - -#include "mpreflectioneffect.h" - - -/*! - \class MpReflectionEffect - \brief The MpReflectionEffect class provides a reflection effect. - - Renders the source with a reflection. -*/ - -/*! - Constructs a new MpReflectionEffect instance. - The \a parent parameter is passed to QGraphicsEffect's constructor. -*/ -MpReflectionEffect::MpReflectionEffect(QObject *parent) - : QGraphicsEffect( parent ) -{ -} - -/*! - Destroys the effect. -*/ -MpReflectionEffect::~MpReflectionEffect() -{ -} - -/*! - \reimp -*/ -QRectF MpReflectionEffect::boundingRectFor(const QRectF &rect) const -{ - QRectF retRect = rect; - //this bounding rect is in device cordinates, correcting based on current transform. - if ( hbInstance->allMainWindows()[0]->orientation() == Qt::Horizontal ) { -#ifdef __WINS__ - retRect.adjust(0,0,retRect.width(),0); //wincw with forced rotation is to the right. -#else - retRect.adjust(-retRect.width(),0,0,0);//currently hardware rotations is to the left. -#endif - } else { - retRect.adjust(0,0,0,retRect.height()); - } - - return retRect; -} - -/*! - \reimp -*/ -void MpReflectionEffect::draw(QPainter *painter) -{ - //currently sourceBoundingRect returns somehing like boundingRectFor and - //wrong rect for widgets with scroll area. As a workaround we can get the - //original bounding rect assuming that the widget using the effect is the - //effect parent. - QGraphicsItem * sourceItem; - sourceItem = qobject_cast( parent() ); - QPixmap pixmap; - QPoint offset; - pixmap = sourcePixmap( Qt::LogicalCoordinates,&offset, QGraphicsEffect::NoPad ); - painter->drawPixmap( offset, pixmap ); - if ( sourceItem ) { - painter->save(); - painter->scale( 1, -1 ); - //for some reson tranlation does not work, translating cordinates by hand. - QPointF reflectionOffset( 0.0, - 2.0 * sourceItem->boundingRect().height() ); - painter->drawPixmap( offset + reflectionOffset, pixmap ); - QRectF reflectionRect; - reflectionRect.setTopLeft( reflectionOffset ); - reflectionRect.setHeight ( sourceItem->boundingRect().height() ); - reflectionRect.setWidth( pixmap.width() ); - painter->fillRect( reflectionRect, QColor::fromRgbF( 0, 0, 0, 0.5f ) ); - painter->restore(); - } -} - -// EOF diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpmediawallviewplugin/src/mptracklistwidget.cpp --- a/mpviewplugins/mpmediawallviewplugin/src/mptracklistwidget.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpmediawallviewplugin/src/mptracklistwidget.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -28,12 +28,15 @@ #include #include #include +#include +#include #include "mptracklistwidget.h" const int swipeAngleTolerance = 30; // angle is from 0 to 360 +const int tracklistOutlineSize = 1; // /*! \class MpTrackListWidget @@ -56,20 +59,25 @@ */ MpTrackListWidget::MpTrackListWidget( QGraphicsItem *parent ) : HbWidget( parent ) { + setFlag( QGraphicsItem::ItemHasNoContents, false ); // Register the custorm css path for the list items. - HbStyleLoader::registerFilePath(":/css/mpcustomlistitem.css"); - HbStyleLoader::registerFilePath(":/css/mpcustomlistitem.hblistviewitem.widgetml"); + HbStyleLoader::registerFilePath( ":/css/mpcustomlistitem.css" ); + HbStyleLoader::registerFilePath( ":/css/mpcustomlistitem.hblistviewitem.widgetml" ); mList = new HbListView( this ); // set layout name that matches the custom list item layout. - mList->setLayoutName("mpmwtracklist"); + mList->setLayoutName( "mpmwtracklist" ); + HbScrollBar *scrollbar = mList->verticalScrollBar(); + scrollbar->show(); + scrollbar->setInteractive( true ); + mList->setVerticalScrollBarPolicy( HbScrollArea::ScrollBarAlwaysOn ); //grab the gesture for close. grabGesture(Qt::SwipeGesture); mFrameItem = new HbFrameItem( this ); - mFrameItem->frameDrawer().setFrameType( HbFrameDrawer::NinePieces ); - mFrameItem->frameDrawer().setFrameGraphicsName( "qtg_fr_multimedia_trans" ); - mFrameItem->setZValue(-1); + mFrameItem->frameDrawer().setFrameType( HbFrameDrawer::OnePiece ); + mFrameItem->frameDrawer().setFrameGraphicsName( "qtg_fr_popup_c" ); //replace for qtg_graf_mediawall_list_bg when available. + mFrameItem->setFlag(QGraphicsItem::ItemStacksBehindParent); } /*! @@ -93,8 +101,7 @@ void MpTrackListWidget::resizeEvent(QGraphicsSceneResizeEvent *event) { mFrameItem->setGeometry( rect() ); - qreal margin = 0.0; - style()->parameter(QString("var(hb-param-margin-gene-middle-vertical)"), margin); + qreal margin = tracklistOutlineSize; mList->setGeometry( rect().adjusted( margin, margin, -margin, -margin ) ); HbWidget::resizeEvent( event ); } @@ -143,6 +150,20 @@ } /*! + \reimp + */ +void MpTrackListWidget::paint( QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget ) +{ + Q_UNUSED( widget ) + Q_UNUSED( option ) + painter->save(); + qreal outlineWidth(tracklistOutlineSize); + painter->setPen(QPen(HbColorScheme::color("qtc_view_normal_secondary"), outlineWidth,Qt::SolidLine,Qt::FlatCap,Qt::MiterJoin)); + painter->drawRect( rect().adjusted(outlineWidth/2,outlineWidth/2,-outlineWidth/2,-outlineWidth/2) ); + painter->restore(); +} + +/*! Maps swipe \a angle to QSwipeGesture::SwipeDirection based on a tolerance parameter and orientation. This funtions helps to identify a swipe even if it is not sharp movement from 180 to 0 degrees on the righ swipe diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpmediawallviewplugin/tsrc/tsrc.pro --- a/mpviewplugins/mpmediawallviewplugin/tsrc/tsrc.pro Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpmediawallviewplugin/tsrc/tsrc.pro Fri Sep 03 19:58:01 2010 -0500 @@ -16,9 +16,10 @@ TEMPLATE = subdirs -SUBDIRS += unittest_mpmediawalldocumentloader -SUBDIRS += unittest_mpmediawallview -SUBDIRS += unittest_mpmediawallviewplugin +SUBDIRS += unittest_mpmediawalldocumentloader \ + unittest_mpmediawallview \ + unittest_mpmediawallviewplugin \ + unittest_mptracklistwidget CONFIG += ordered diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawalldocumentloader/inc/unittest_mpmediawalldocumentloader.h --- a/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawalldocumentloader/inc/unittest_mpmediawalldocumentloader.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawalldocumentloader/inc/unittest_mpmediawalldocumentloader.h Fri Sep 03 19:58:01 2010 -0500 @@ -42,7 +42,6 @@ private slots: void testCreateHgMediawall(); - void testCreateHbToolButton(); void testCreateQObject(); private: diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawalldocumentloader/src/unittest_mpmediawalldocumentloader.cpp --- a/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawalldocumentloader/src/unittest_mpmediawalldocumentloader.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawalldocumentloader/src/unittest_mpmediawalldocumentloader.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -16,7 +16,6 @@ */ #include -#include #include "stub/inc/hgmediawall.h" #include "unittest_mpmediawalldocumentloader.h" @@ -107,22 +106,6 @@ } /*! - Tests the correct creation of HbToolButton. - */ -void TestMpMediaWallDocumentLoader::testCreateHbToolButton() -{ - cleanup(); - init(); - QObject *theObject; - theObject = mTest->createObject(QString("HbToolButton"),QString("myHbToolButton")); - QCOMPARE(theObject->metaObject()->className(),"HbToolButton"); - QCOMPARE(theObject->objectName(),QString("myHbToolButton")); - QVERIFY(qobject_cast(theObject)); - delete theObject; - -} - -/*! Tests the correct creation of QObject, this should be pased to the base class and base class should return a named object. */ diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/inc/unittest_mpmediawallview.h --- a/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/inc/unittest_mpmediawallview.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/inc/unittest_mpmediawallview.h Fri Sep 03 19:58:01 2010 -0500 @@ -43,13 +43,11 @@ private slots: void testInitializeView(); - void testActivateView(); - void testDeactivateView(); - void testSendToBackground(); + void testDeactivateView(); void testContextOpened(); void testContainerContentsChanged(); void testLibraryUpdated(); - void testUpdatePlayPauseAction(); + void testListItemActivated(); private: MpMediaWallView *mTest; diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/src/unittest_mpmediawallview.cpp --- a/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/src/unittest_mpmediawallview.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/src/unittest_mpmediawallview.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -22,6 +22,10 @@ #include "unittest_mpmediawallview.h" #include "stub/inc/mpplaybackdata.h" +#include "stub/inc/mpengine.h" +#include "stub/inc/mpenginefactory.h" +#include "stub/inc/hbmessagebox.h" + // Do this so we can access all member variables. #define private public @@ -31,6 +35,7 @@ // Do this so we can access all memeber functions #include "../../src/mpmediawallview.cpp" + /*! Make our test case a stand-alone executable that runs all the test functions. */ @@ -112,9 +117,6 @@ QVERIFY(!mTest->mAlbumCover); QVERIFY(!mTest->mTrackList); QVERIFY(!mTest->mPlaybackData); - QVERIFY(!mTest->mPauseIcon); - QVERIFY(!mTest->mPlayIcon); - QVERIFY(!mTest->mPlayPauseContainer); //test member variables are initialized mTest->initializeView(); @@ -124,58 +126,23 @@ QVERIFY(mTest->mAlbumCover); QVERIFY(mTest->mTrackList); QVERIFY(mTest->mPlaybackData); - QVERIFY(mTest->mPauseIcon); - QVERIFY(mTest->mPlayIcon); - QVERIFY(mTest->mPlayPauseContainer); } /*! - Test ActivateView - */ -void TestMpMediaWallView::testActivateView() -{ - - //Create playbackdata and set to playing state - mTest->mPlaybackData = new MpPlaybackData(); - mTest->mPlaybackData->setPlaybackState(MpPlaybackData::Playing); - - mTest->mIconUpdateNedded=false; - mTest->mActivated=false; - - mTest->activateView(); - QCOMPARE(mTest->mActivated, true ); -} - -/*! Test DeActivateView */ void TestMpMediaWallView::testDeactivateView() { mTest->initializeView(); - mTest->mActivated = true; mTest->mShowingSongsList = true; mTest->setUpListAnimation(); mTest->deactivateView(); - QCOMPARE(mTest->mActivated, false); QCOMPARE(mTest->mShowingSongsList, false); } /*! - Test SendToBackground - */ -void TestMpMediaWallView::testSendToBackground() -{ - //test that signal gets emitted - QSignalSpy spy( mTest, SIGNAL(command(int)) ); - mTest->sendToBackground(); - QCOMPARE(spy.count(), 1); - QCOMPARE(spy.at(0).at(0), QVariant(MpCommon::SendToBackground)); - -} - -/*! Test ContextOpened */ /* test case fails because potential problem in docml @@ -239,24 +206,52 @@ } /*! - Test UpdatePlayPauseAction + Test listItemActivated */ -void TestMpMediaWallView::testUpdatePlayPauseAction() +void TestMpMediaWallView::testListItemActivated() { - //test icon gets updated correctly - mTest->initializeView(); - mTest->mActivated = true; - mTest->mPlaybackData->setPlaybackState( MpPlaybackData::Paused ); - mTest->updatePlayPauseAction(); - HbIcon temp = mTest->mPlayPauseAction->icon(); - QVERIFY( mTest->mPlayPauseAction->icon() == HbIcon( "qtg_mono_play" )); + if ( MpEngineFactory::instance()->mSharedEngine ) { + delete MpEngineFactory::instance()->mSharedEngine; + } + MpEngineFactory::instance()->mSharedEngine = new MpEngine(); + mTest->initializeView(); + + //Test with corrupted song + mTest->mCollectionData->mAlbumSongProperty = true; + MpEngineFactory::sharedEngine()->mPlayPauseCount = 0; + MpEngineFactory::sharedEngine()->mPlayAlbumSongsCount = 0; + mTest->listItemActivated(QModelIndex()); + QVERIFY(MpEngineFactory::sharedEngine()->mPlayPauseCount == 0); + QVERIFY(MpEngineFactory::sharedEngine()->mPlayAlbumSongsCount == 0); - mTest->mPlaybackData->setPlaybackState( MpPlaybackData::Playing ); - mTest->updatePlayPauseAction(); - QVERIFY( mTest->mPlayPauseAction->icon() == HbIcon( "qtg_mono_pause" )); + //Test select nowplaying item that is playing. + mTest->mCollectionData->mAlbumSongProperty = false; + mTest->mPlaybackData->mPlaybackState = MpPlaybackData::Playing; + mTest->mPlaybackData->mSongId = 1234; + mTest->mCollectionData->mArbitraryAlbumSongId = 1234; + MpEngineFactory::sharedEngine()->mPlayPauseCount = 0; + MpEngineFactory::sharedEngine()->mPlayAlbumSongsCount = 0; + mTest->listItemActivated(QModelIndex()); + QVERIFY(MpEngineFactory::sharedEngine()->mPlayPauseCount == 1); + QVERIFY(MpEngineFactory::sharedEngine()->mPlayAlbumSongsCount == 0); - mTest->mPlaybackData->setPlaybackState( MpPlaybackData::Stopped ); - mTest->updatePlayPauseAction(); - QVERIFY( mTest->mPlayPauseAction->icon() == HbIcon( "qtg_mono_play" )); + //Test select nowplaying item that is not initialized. + mTest->mCollectionData->mAlbumSongProperty = false; + mTest->mPlaybackData->mPlaybackState = MpPlaybackData::NotPlaying; + MpEngineFactory::sharedEngine()->mPlayPauseCount = 0; + MpEngineFactory::sharedEngine()->mPlayAlbumSongsCount = 0; + mTest->listItemActivated(QModelIndex()); + QVERIFY(MpEngineFactory::sharedEngine()->mPlayPauseCount == 0); + QVERIFY(MpEngineFactory::sharedEngine()->mPlayAlbumSongsCount == 1); + + //Test select an item that is not playing. + mTest->mCollectionData->mAlbumSongProperty = false; + mTest->mCollectionData->mArbitraryAlbumSongId = 4321; + MpEngineFactory::sharedEngine()->mPlayPauseCount = 0; + MpEngineFactory::sharedEngine()->mPlayAlbumSongsCount = 0; + mTest->listItemActivated(QModelIndex()); + QVERIFY(MpEngineFactory::sharedEngine()->mPlayPauseCount == 0); + QVERIFY(MpEngineFactory::sharedEngine()->mPlayAlbumSongsCount == 1); } + diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/inc/hbmessagebox.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/inc/hbmessagebox.h Fri Sep 03 19:58:01 2010 -0500 @@ -0,0 +1,81 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: hbmessagebox stub for testing mpmediawallview +* +*/ + +#ifndef HBMESSAGEBOX_H +#define HBMESSAGEBOX_H + +#include +#include +#include +#include + +// FORWARD DECLARATIONS +class QGraphicsItem; +class HbIcon; + +/*! + Stub HbMessageBox class. + */ +class HbMessageBox : public QObject +{ + Q_OBJECT + +public: // Data types + + enum MessageBoxType { + MessageTypeNone, + MessageTypeInformation, + MessageTypeQuestion, + MessageTypeWarning + }; + +public: + + HbMessageBox(const QString &text, MessageBoxType type = MessageTypeNone, QGraphicsItem *parent = 0) + { + Q_UNUSED(text); + Q_UNUSED(type); + Q_UNUSED(parent); + mMessageDisplayed = false; + } + + ~HbMessageBox() + { + } + + void setAttribute(Qt::WidgetAttribute att, bool on = true) + { + Q_UNUSED(att); + Q_UNUSED(on); + } + + void setIcon(const HbIcon &icon) + { + Q_UNUSED(icon); + } + + void show() + { + mMessageDisplayed = true; + } + +public: + bool mMessageDisplayed; +}; + +#endif // HBMESSAGEBOX_H + diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/inc/mpcollectiondatamodel.h --- a/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/inc/mpcollectiondatamodel.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/inc/mpcollectiondatamodel.h Fri Sep 03 19:58:01 2010 -0500 @@ -32,7 +32,8 @@ public: - explicit MpCollectionDataModel( MpMpxCollectionData *data, MpPlaybackData *playbackData = 0, QObject *parent=0 ); + explicit MpCollectionDataModel( MpMpxCollectionData *data, MpPlaybackData *playbackData = 0, + QObject *parent=0 ); virtual ~MpCollectionDataModel(); int rowCount(const QModelIndex &parent=QModelIndex()) const; diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/inc/mpengine.h --- a/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/inc/mpengine.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/inc/mpengine.h Fri Sep 03 19:58:01 2010 -0500 @@ -41,7 +41,6 @@ MediaBrowsing }; -private: enum UsbBlockingState { USB_NotConnected, // Not connected @@ -49,7 +48,6 @@ USB_Synchronizing // Connected in MassStorage mode or MTP mode and synchronizing }; -private: explicit MpEngine(); public: @@ -111,8 +109,9 @@ public: //for stubs int mOpenCollectionCalled; + int mPlayPauseCount; + int mPlayAlbumSongsCount; -private: Q_DISABLE_COPY( MpEngine ) diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/inc/mpenginefactory.h --- a/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/inc/mpenginefactory.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/inc/mpenginefactory.h Fri Sep 03 19:58:01 2010 -0500 @@ -26,19 +26,19 @@ class MpEngineFactory { -private: +public: explicit MpEngineFactory(); -public: + virtual ~MpEngineFactory(); static MpEngineFactory * instance(); - - static MpEngine *createSharedEngine( TUid uid = TUid::Uid( MpCommon::KMusicPlayerUid ), MpEngine::EngineMode mode = MpEngine::StandAlone ); + + static MpEngine *createSharedEngine( quint32 clientSecureId=MpCommon::KMusicPlayerUid, MpEngine::EngineMode mode = MpEngine::StandAlone ); static MpEngine *sharedEngine(); static MpEngine *createIsolatedEngine( MpEngine::EngineMode mode ); static void close(); -private: + MpEngine *mSharedEngine; QList mEngines; }; diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/inc/mpmpxcollectiondata.h --- a/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/inc/mpmpxcollectiondata.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/inc/mpmpxcollectiondata.h Fri Sep 03 19:58:01 2010 -0500 @@ -58,8 +58,8 @@ void setContext( TCollectionContext context ); int itemIndex( int itemUniqueId ); bool setCurrentAlbum( int index ); + int albumSongId(int index); bool hasAlbumSongProperty( int index, MpMpxCollectionData:: DataProperty type ) const; - const CMPXMedia& containerMedia(); public: @@ -71,6 +71,8 @@ int mCurrentAlbumIndex; bool mCurrentAlbumAvailable; bool mReturnCollectionTitle; + int mArbitraryAlbumSongId; + bool mAlbumSongProperty; }; diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/inc/mpplaybackdata.h --- a/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/inc/mpplaybackdata.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/inc/mpplaybackdata.h Fri Sep 03 19:58:01 2010 -0500 @@ -44,6 +44,7 @@ // Stub functions void emitPlaybackStateChanged(); void setPlaybackState(MpPlaybackData::SimplifiedState state); + int id(); signals: void playbackStateChanged(); @@ -56,10 +57,10 @@ MpPlaybackData::SimplifiedState playbackState() const; -private: QString mArtist; QString mTitle; SimplifiedState mPlaybackState; + int mSongId; }; diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/inc/mpreflectioneffect.h --- a/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/inc/mpreflectioneffect.h Tue Aug 24 03:36:14 2010 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -/* -* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: stub for mpreflectioneffect -* -*/ -#ifndef MPREFLECTIONEFFECT_H -#define MPREFLECTIONEFFECT_H - -#include - -class MpReflectionEffect: public QGraphicsEffect -{ - Q_OBJECT - -public: - MpReflectionEffect(QObject *parent = 0); - ~MpReflectionEffect(); - - QRectF boundingRectFor(const QRectF &rect) const; - -protected: - void draw(QPainter *painter); - -private: - Q_DISABLE_COPY(MpReflectionEffect) -}; - -#endif // MPREFLECTIONEFFECT_H - -// EOF diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/src/mpengine.cpp --- a/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/src/mpengine.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/src/mpengine.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -21,7 +21,9 @@ #include "mpmpxcollectiondata.h" -MpEngine::MpEngine() : mOpenCollectionCalled(0) +MpEngine::MpEngine() : mOpenCollectionCalled(0), + mPlayAlbumSongsCount(0), + mPlayPauseCount(0) { TX_LOG_ARGS("Stub") } @@ -146,6 +148,7 @@ Q_UNUSED(albumIndex) Q_UNUSED(songIndex) Q_UNUSED(collectionData) + mPlayAlbumSongsCount++; TX_ENTRY_ARGS("Stub") } @@ -191,6 +194,7 @@ void MpEngine::playPause() { TX_ENTRY_ARGS("Stub") + mPlayPauseCount++; } void MpEngine::stop() diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/src/mpenginefactory.cpp --- a/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/src/mpenginefactory.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/src/mpenginefactory.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -54,10 +54,10 @@ } /*! - Returns an instance to an engine with \a hostUid, and \a mode, if the shared engine is + Returns an instance to an engine with \a clientSecureId, and \a mode, if the shared engine is already created parameters are ignored. */ -MpEngine *MpEngineFactory::createSharedEngine( TUid /*hostUid*/ , MpEngine::EngineMode /*mode*/ ) +MpEngine *MpEngineFactory::createSharedEngine( quint32 /*clientSecureId*/ , MpEngine::EngineMode /*mode*/ ) { TX_LOG_ARGS("MpEngineFactory::createSharedEngine() Stub") if ( !instance()->mSharedEngine ) { diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/src/mpmpxcollectiondata.cpp --- a/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/src/mpmpxcollectiondata.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/src/mpmpxcollectiondata.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -31,7 +31,9 @@ mCount(0), mCurrentAlbumIndex(-1), mCurrentAlbumAvailable(false), - mReturnCollectionTitle(true) + mReturnCollectionTitle(true), + mArbitraryAlbumSongId(0), + mAlbumSongProperty(false) { } @@ -97,9 +99,16 @@ /*! Stub function. */ +int MpMpxCollectionData::albumSongId(int index) +{ + Q_UNUSED(index); + return mArbitraryAlbumSongId; +} bool MpMpxCollectionData::hasAlbumSongProperty( int index, MpMpxCollectionData:: DataProperty type ) const { - + Q_UNUSED(index); + Q_UNUSED(type); + return mAlbumSongProperty; } /*! diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/src/mpplaybackdata.cpp --- a/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/src/mpplaybackdata.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/src/mpplaybackdata.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -25,7 +25,8 @@ Stub function. */ MpPlaybackData::MpPlaybackData() - : mPlaybackState(NotPlaying) + : mPlaybackState(NotPlaying), + mSongId(0) { gUpdateCounter++; } @@ -77,7 +78,19 @@ emit playbackStateChanged(); } - void MpPlaybackData::setPlaybackState(MpPlaybackData::SimplifiedState state) - { +/*! + Stub function. + */ +void MpPlaybackData::setPlaybackState(MpPlaybackData::SimplifiedState state) +{ mPlaybackState=state; - } +} + +/*! + Stub function. + */ +int MpPlaybackData::id() +{ + return mSongId; +} + diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/src/mpreflectioneffect.cpp --- a/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/src/mpreflectioneffect.cpp Tue Aug 24 03:36:14 2010 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -/* -* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: stub for mpreflectioneffects -* -*/ - -#include "mpreflectioneffect.h" - -/*! - Stub -*/ -MpReflectionEffect::MpReflectionEffect(QObject *parent) - : QGraphicsEffect( parent ) -{ -} - -/*! - Stub -*/ -MpReflectionEffect::~MpReflectionEffect() -{ -} - -/*! - Stub -*/ -QRectF MpReflectionEffect::boundingRectFor(const QRectF &rect) const -{ - Q_UNUSED(rect) - return QRectF(); -} - -/*! - Stub -*/ -void MpReflectionEffect::draw(QPainter *painter) -{ - Q_UNUSED(painter) -} - -// EOF diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/src/mptracklistwidget.cpp --- a/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/src/mptracklistwidget.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/src/mptracklistwidget.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -26,7 +26,7 @@ #include "mptracklistwidget.h" -#include "mpreflectioneffect.h" + /*! Stub. diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/unittest_mpmediawallview.pro --- a/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/unittest_mpmediawallview.pro Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/unittest_mpmediawallview.pro Fri Sep 03 19:58:01 2010 -0500 @@ -34,32 +34,31 @@ # Input HEADERS += inc/unittest_mpmediawallview.h \ - ../../inc/mpmediawallview.h \ + ../../inc/mpmediawallview.h \ ../../../../inc/mpviewbase.h \ stub/inc/hgmediawall.h \ - stub/inc/mpengine.h \ - stub/inc/mpenginefactory.h \ - stub/inc/mpmpxcollectiondata.h \ - stub/inc/mpcollectiondatamodel.h \ - stub/inc/mpplaybackdata.h \ - stub/inc/mpalbumcoverwidget.h \ - stub/inc/mpmediawalldocumentloader.h \ - stub/inc/mptracklistwidget.h \ - stub/inc/mpcollectiontbonelistdatamodel.h \ - stub/inc/mpreflectioneffect.h + stub/inc/mpengine.h \ + stub/inc/mpenginefactory.h \ + stub/inc/mpmpxcollectiondata.h \ + stub/inc/mpcollectiondatamodel.h \ + stub/inc/mpplaybackdata.h \ + stub/inc/mpalbumcoverwidget.h \ + stub/inc/mpmediawalldocumentloader.h \ + stub/inc/mptracklistwidget.h \ + stub/inc/mpcollectiontbonelistdatamodel.h \ + stub/inc/hbmessagebox.h -SOURCES += src/unittest_mpmediawallview.cpp \ - stub/src/hgmediawall.cpp \ - stub/src/mpengine.cpp \ - stub/src/mpenginefactory.cpp \ - stub/src/mpmpxcollectiondata.cpp \ - stub/src/mpcollectiondatamodel.cpp \ - stub/src/mpplaybackdata.cpp \ - stub/src/mpalbumcoverwidget.cpp \ - stub/src/mpmediawalldocumentloader.cpp \ - stub/src/mptracklistwidget.cpp \ - stub/src/mpcollectiontbonelistdatamodel.cpp \ - stub/src/mpreflectioneffect.cpp +SOURCES += src/unittest_mpmediawallview.cpp \ + stub/src/hgmediawall.cpp \ + stub/src/mpengine.cpp \ + stub/src/mpenginefactory.cpp \ + stub/src/mpmpxcollectiondata.cpp \ + stub/src/mpcollectiondatamodel.cpp \ + stub/src/mpplaybackdata.cpp \ + stub/src/mpalbumcoverwidget.cpp \ + stub/src/mpmediawalldocumentloader.cpp \ + stub/src/mptracklistwidget.cpp \ + stub/src/mpcollectiontbonelistdatamodel.cpp RESOURCES += ../../resources/mpmediawallviewresources.qrc diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpreflectioneffect/inc/unittest_mpreflectioneffect.h --- a/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpreflectioneffect/inc/unittest_mpreflectioneffect.h Tue Aug 24 03:36:14 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: Unit test for MpReflectionEffect -* -*/ - -#ifndef TESTMPREFLECTIONEFFECT_H -#define TESTMPREFLECTIONEFFECT_H - -#include - -class MpReflectionEffect; - -class TestMpReflectionEffect : public QObject -{ - Q_OBJECT - -public: - - TestMpReflectionEffect(); - virtual ~TestMpReflectionEffect(); - -public slots: - void initTestCase(); - void cleanupTestCase(); - void init(); - void cleanup(); - -private: - MpReflectionEffect *mTest; -}; - -#endif // TESTMPREFLECTIONEFFECT_H diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpreflectioneffect/src/unittest_mpreflectioneffect.cpp --- a/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpreflectioneffect/src/unittest_mpreflectioneffect.cpp Tue Aug 24 03:36:14 2010 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,96 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Unit test for MpReflectionEffect -* -*/ - -#include -#include "unittest_mpreflectioneffect.h" - -/*! - * Nothing valuable to test for following functions - * boundingRectFor() - * draw() - * - */ - -// Do this so we can access all member variables. -#define private public -#include "mpreflectioneffect.h" -#undef private - -/*! - Make our test case a stand-alone executable that runs all the test functions. - */ -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - TestMpReflectionEffect 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_mpreflectioneffect.txt"; - - return QTest::qExec(&tv, 3, pass); - } -} - -TestMpReflectionEffect::TestMpReflectionEffect() - : mTest(0) -{ -} - -TestMpReflectionEffect::~TestMpReflectionEffect() -{ - delete mTest; -} - -/*! - Called before the first testfunction is executed. - */ -void TestMpReflectionEffect::initTestCase() -{ -} - -/*! - Called after the last testfunction was executed. - */ -void TestMpReflectionEffect::cleanupTestCase() -{ -} - -/*! - Called before each testfunction is executed. - */ -void TestMpReflectionEffect::init() -{ - mTest = new MpReflectionEffect( new QObject() ); -} - -/*! - Called after every testfunction. - */ -void TestMpReflectionEffect::cleanup() -{ - delete mTest; - mTest = 0; -} - - -// End of file diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpreflectioneffect/unittest_mpreflectioneffect.pro --- a/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpreflectioneffect/unittest_mpreflectioneffect.pro Tue Aug 24 03:36:14 2010 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +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: mpreflectioneffect unit test project file. -# - -TEMPLATE = app -CONFIG += qtestlib hb symbian_test -TARGET = unittest_mpreflectioneffect -TARGET.CAPABILITY = CAP_APPLICATION - -DEPENDPATH += . -INCLUDEPATH += . \ - ../../inc \ - ../../../../inc -INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE - -HEADERS += inc/unittest_mpreflectioneffect.h \ - ../../inc/mpreflectioneffect.h \ - - -SOURCES += src/unittest_mpreflectioneffect.cpp \ - ../../src/mpreflectioneffect.cpp \ - diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mptracklistwidget/inc/unittest_mptracklistwidget.h --- a/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mptracklistwidget/inc/unittest_mptracklistwidget.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mptracklistwidget/inc/unittest_mptracklistwidget.h Fri Sep 03 19:58:01 2010 -0500 @@ -15,8 +15,8 @@ * */ -#ifndef TESTMPREFLECTIONEFFECT_H -#define TESTMPREFLECTIONEFFECT_H +#ifndef TESTMPTRACKLISTWIDGET_H +#define TESTMPTRACKLISTWIDGET_H #include @@ -45,4 +45,4 @@ MpTrackListWidget *mTest; }; -#endif // TESTMPREFLECTIONEFFECT_H +#endif // TESTMPTRACKLISTWIDGET_H diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpplaybackviewplugin/inc/mpplaybackview.h --- a/mpviewplugins/mpplaybackviewplugin/inc/mpplaybackview.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpplaybackviewplugin/inc/mpplaybackview.h Fri Sep 03 19:58:01 2010 -0500 @@ -101,8 +101,6 @@ HbIcon *mPlayIcon; // Own HbIcon *mPauseIcon; // Own - HbIcon *mShuffleOnIcon; // Own - HbIcon *mShuffleOffIcon; // Own HbAction *mPlayPauseAction; // Not own HbAction *mRepeatAction; // Not own diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpplaybackviewplugin/src/mpplaybackview.cpp --- a/mpviewplugins/mpplaybackviewplugin/src/mpplaybackview.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpplaybackviewplugin/src/mpplaybackview.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -65,8 +65,6 @@ mActivated( false ), mPlayIcon( 0 ), mPauseIcon( 0 ), - mShuffleOnIcon( 0 ), - mShuffleOffIcon( 0 ), mTimer(0), mSeeking(false) @@ -83,8 +81,6 @@ delete mSoftKeyBack; delete mPlayIcon; delete mPauseIcon; - delete mShuffleOnIcon; - delete mShuffleOffIcon; delete mEqualizerWidget; TX_EXIT } @@ -288,7 +284,7 @@ void MpPlaybackView::shuffleChanged( bool shuffle ) { mShuffle = shuffle; - mShuffleAction->setIcon( mShuffle ? *mShuffleOnIcon : *mShuffleOffIcon ); + mShuffleAction->setChecked( mShuffle ); } /*! @@ -352,12 +348,11 @@ QActionGroup *actionsGroup = new QActionGroup( myToolBar ); if ( mViewMode == MpCommon::DefaultView || mViewMode == MpCommon::EmbeddedView ) { - mShuffleOnIcon = new HbIcon( "qtg_mono_shuffle" ); - mShuffleOffIcon = new HbIcon( "qtg_mono_shuffle_off" ); mShuffleAction = new HbAction( actionsGroup ); mShuffle = MpSettingsManager::shuffle(); - mShuffleAction->setIcon( mShuffle ? *mShuffleOnIcon : *mShuffleOffIcon ); - mShuffleAction->setCheckable( false ); + mShuffleAction->setIcon( HbIcon( "qtg_mono_shuffle" ) ); + mShuffleAction->setCheckable( true ); + mShuffleAction->setChecked( mShuffle ); if ( mViewMode == MpCommon::DefaultView ) { connect( mShuffleAction, SIGNAL( triggered( bool ) ), @@ -587,8 +582,8 @@ mEqualizerWidget = new MpEqualizerWidget(); mEqualizerWidget->prepareDialog(); } - - mEqualizerWidget->show(); + + mEqualizerWidget->show(); TX_EXIT } diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpplaybackviewplugin/tsrc/tsrc.pro --- a/mpviewplugins/mpplaybackviewplugin/tsrc/tsrc.pro Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpplaybackviewplugin/tsrc/tsrc.pro Fri Sep 03 19:58:01 2010 -0500 @@ -20,6 +20,7 @@ unittest_mpplaybackdocumentloader \ unittest_mpplaybackviewplugin \ unittest_mpplaybackview +# unittest_mpplaybackwidget CONFIG += ordered diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpequalizerwidget/stub/inc/mpenginefactory.h --- a/mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpequalizerwidget/stub/inc/mpenginefactory.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpequalizerwidget/stub/inc/mpenginefactory.h Fri Sep 03 19:58:01 2010 -0500 @@ -32,8 +32,8 @@ public: virtual ~MpEngineFactory(); static MpEngineFactory * instance(); - - static MpEngine *createSharedEngine( TUid uid = TUid::Uid( MpCommon::KMusicPlayerUid ), MpEngine::EngineMode mode = MpEngine::StandAlone ); + + static MpEngine *createSharedEngine( quint32 clientSecureId=MpCommon::KMusicPlayerUid, MpEngine::EngineMode mode = MpEngine::StandAlone ); static MpEngine *sharedEngine(); static void close(); diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpequalizerwidget/stub/src/mpenginefactory.cpp --- a/mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpequalizerwidget/stub/src/mpenginefactory.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpequalizerwidget/stub/src/mpenginefactory.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -52,12 +52,12 @@ } /*! - Returns an instance to an engine with \a hostUid, and \a mode, if the shared engine is + Returns an instance to an engine with \a clientSecureId, and \a mode, if the shared engine is already created parameters are ignored. */ -MpEngine *MpEngineFactory::createSharedEngine( TUid hostUid , MpEngine::EngineMode mode ) +MpEngine *MpEngineFactory::createSharedEngine( quint32 clientSecureId , MpEngine::EngineMode mode ) { - Q_UNUSED( hostUid ); + Q_UNUSED( clientSecureId ); Q_UNUSED( mode ); if ( !instance()->mSharedEngine ) { instance()->mSharedEngine = new MpEngine(); diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpplaybackview/inc/unittest_mpplaybackview.h --- a/mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpplaybackview/inc/unittest_mpplaybackview.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpplaybackview/inc/unittest_mpplaybackview.h Fri Sep 03 19:58:01 2010 -0500 @@ -45,6 +45,7 @@ private slots: //Test Cases + void testInitializeView(); void testActivateView(); void testDeactivateView(); void testShuffleEnabled(); @@ -63,6 +64,7 @@ void testHandleSongSelected(); void testShowEqualizerDialog(); void testCloseEqualizerDialog(); + void testShowCorruptedNote(); void testSeekForward(); void testSeekRewind(); diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpplaybackview/src/unittest_mpplaybackview.cpp --- a/mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpplaybackview/src/unittest_mpplaybackview.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpplaybackview/src/unittest_mpplaybackview.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -21,10 +21,14 @@ #include #include +#include "stub/inc/mpengine.h" +#include "stub/inc/mpenginefactory.h" #include "stub/inc/mpequalizerwidget.h" +#include "stub/inc/mpplaybackdata.h" +#include "stub/inc/mpplaybackwidget.h" +#include "stub/inc/mpsettingsmanager.h" +#include "stub/inc/mpviewbase.h" #include "mpcommondefs.h" -#include "stub/inc/mpviewbase.h" -#include "stub/inc/mpsettingsmanager.h" #include "unittest_mpplaybackview.h" // Do this so we can access all member variables. @@ -75,14 +79,14 @@ void TestMpPlaybackView::initTestCase() { -} +} /*! Called after the last testfunction was executed. */ void TestMpPlaybackView::cleanupTestCase() { -QCoreApplication::processEvents(); + QCoreApplication::processEvents(); } /*! @@ -99,19 +103,21 @@ */ void TestMpPlaybackView::cleanup() { - mTest->mMpEngine->retrieveSongDetailsCount = 0; - mTest->mMpEngine->stopCount = 0; - mTest->mEqualizerWidget->showEqualizerWidgetCount = 0; - mTest->mEqualizerWidget->closeEqualizerWidgetCount = 0; - mTest->mMpEngine->startSeekBackwardCount = 0; - mTest->mMpEngine->startSeekForwardCount = 0; - mTest->mMpEngine->stopSeekingCount = 0; - mTest->mMpEngine->skipBackwardCount = 0; - mTest->mMpEngine->skipForwardCount = 0; delete mTest; mTest = 0; + MpEngineFactory::close(); } +/*! +Test initializeView + */ +void TestMpPlaybackView::testInitializeView() +{ + QVERIFY( mTest->mSoftKeyBack ); + QVERIFY( mTest->mMpEngine ); + QVERIFY( mTest->mPlaybackData ); + QVERIFY( mTest->mPlaybackWidget ); +} /*! Test ActivateView @@ -119,10 +125,9 @@ void TestMpPlaybackView::testActivateView() { QCOMPARE( mTest->mActivated, false ); - mTest->activateView(); + mTest->activateView(); QCOMPARE( mTest->mActivated, true ); QVERIFY( mTest->navigationAction() == mTest->mSoftKeyBack ); - } /*! @@ -193,23 +198,23 @@ void TestMpPlaybackView::testBack() { //test Stop() gets called in MpEngine - mTest->mMpEngine->stopCount=0; + mTest->mMpEngine->mStopCount=0; mTest->mViewMode = MpCommon::EmbeddedView; mTest->back(); - QCOMPARE(mTest->mMpEngine->stopCount,1); + QCOMPARE(mTest->mMpEngine->mStopCount,1); mTest->mViewMode = MpCommon::FetchView; mTest->back(); - QCOMPARE(mTest->mMpEngine->stopCount,2); + QCOMPARE(mTest->mMpEngine->mStopCount,2); QSignalSpy spy(mTest, SIGNAL(command(int))); - mTest->mMpEngine->stopCount = 0; + mTest->mMpEngine->mStopCount = 0; mTest->mViewMode = MpCommon::DefaultView; mTest->back(); QCOMPARE(spy.count(), 1); QCOMPARE(spy.at(0).at(0), QVariant(MpCommon::ActivateCollectionView)); - QCOMPARE(mTest->mMpEngine->stopCount,0); + QCOMPARE(mTest->mMpEngine->mStopCount,0); } /*! @@ -229,12 +234,12 @@ void TestMpPlaybackView::testPlaybackStateChanged() { //test signal slot connection - mTest->mMpEngine->stopCount=0; + mTest->mMpEngine->mStopCount=0; mTest->mViewMode = MpCommon::FetchView; mTest->mPlaybackData->setPlaybackState(MpPlaybackData::Stopped); mTest->mPlaybackData->triggerStateUpdate(MpPlaybackData::Stopped); - QCOMPARE(mTest->mMpEngine->stopCount,1); + QCOMPARE(mTest->mMpEngine->mStopCount,1); } /*! @@ -246,7 +251,7 @@ mTest->flip(); QCOMPARE(spy.count(), 1); QCOMPARE(spy.at(0).at(0), QVariant(MpCommon::ActivateDetailsView)); - QCOMPARE(mTest->mMpEngine->retrieveSongDetailsCount,1); + QCOMPARE(mTest->mMpEngine->mRetrieveSongDetailsCount, 1); } /*! @@ -260,12 +265,12 @@ mTest->toggleShuffle(); mTest->shuffleChanged(true); //simulate signal QCOMPARE(mTest->shuffleEnabled(), true); - QVERIFY(mTest->mShuffleAction->icon() == *mTest->mShuffleOnIcon); + QVERIFY(mTest->mShuffleAction->isChecked()); mTest->toggleShuffle(); mTest->shuffleChanged(false); QCOMPARE(mTest->shuffleEnabled(), false); - QVERIFY(mTest->mShuffleAction->icon() == *mTest->mShuffleOffIcon); + QVERIFY(!mTest->mShuffleAction->isChecked()); } /*! @@ -292,14 +297,14 @@ */ void TestMpPlaybackView::testHandleSongSelected() { - mTest->mMpEngine->stopCount=0; + mTest->mMpEngine->mStopCount=0; mTest->mPlaybackData->setUri("testUri"); QSignalSpy spy(mTest, SIGNAL(songSelected(QString))); mTest->handleSongSelected(); QCOMPARE(spy.count(), 1); QCOMPARE(spy.at(0).at(0), QVariant("testUri")); - QCOMPARE(mTest->mMpEngine->stopCount,1); + QCOMPARE(mTest->mMpEngine->mStopCount,1); } /*! @@ -307,7 +312,6 @@ */ void TestMpPlaybackView::testShowEqualizerDialog() { - mTest->mEqualizerWidget->showEqualizerWidgetCount = 0; mTest->showEqualizerDialog(); QCOMPARE(mTest->mEqualizerWidget->showEqualizerWidgetCount,1); } @@ -317,24 +321,37 @@ */ void TestMpPlaybackView::testCloseEqualizerDialog() { - mTest->mEqualizerWidget->closeEqualizerWidgetCount = 0; + // Equalizer no displayed before, closeEqualizerDialog should do nothing. + mTest->closeEqualizerDialog(); + QVERIFY(!mTest->mEqualizerWidget); + + // Equalizer previously displyaed + mTest->showEqualizerDialog(); mTest->closeEqualizerDialog(); QCOMPARE(mTest->mEqualizerWidget->closeEqualizerWidgetCount,1); } +/*! + Test showCorruptedNote + */ +void TestMpPlaybackView::testShowCorruptedNote() +{ + mTest->showCorruptedNote(); + QCOMPARE(mTest->mMpEngine->mStopCount, 1); +} /*! Test StartRewindTimer and startSeekRewind */ void TestMpPlaybackView::testSeekRewind() { - mTest->mMpEngine->startSeekBackwardCount = 0; + mTest->mMpEngine->mStartSeekBackwardCount = 0; mTest->mSeeking = false; mTest->startRewindTimer(); QTest::qWait(2000); // wait for timer to fire and call startSeekRewind() - QCOMPARE(mTest->mMpEngine->startSeekBackwardCount,1); + QCOMPARE(mTest->mMpEngine->mStartSeekBackwardCount,1); QCOMPARE(mTest->mSeeking,true); } @@ -343,13 +360,13 @@ */ void TestMpPlaybackView::testSeekForward() { - mTest->mMpEngine->startSeekForwardCount = 0; + mTest->mMpEngine->mStartSeekForwardCount = 0; mTest->mSeeking = false; mTest->startForwardTimer(); QTest::qWait(2000); // wait for timer to fire and call startSeekForward() - QCOMPARE(mTest->mMpEngine->startSeekForwardCount,1); + QCOMPARE(mTest->mMpEngine->mStartSeekForwardCount,1); QCOMPARE(mTest->mSeeking,true); } @@ -360,11 +377,11 @@ { mTest->mSeeking = true; mTest->endRewind(); - QCOMPARE(mTest->mMpEngine->stopSeekingCount,1); + QCOMPARE(mTest->mMpEngine->mStopSeekingCount,1); QCOMPARE(mTest->mSeeking,false); mTest->endRewind(); - QCOMPARE(mTest->mMpEngine->skipBackwardCount,1); + QCOMPARE(mTest->mMpEngine->mSkipBackwardCount,1); QCOMPARE(mTest->mSeeking,false); } @@ -375,11 +392,11 @@ { mTest->mSeeking = true; mTest->endForward(); - QCOMPARE(mTest->mMpEngine->stopSeekingCount,1); + QCOMPARE(mTest->mMpEngine->mStopSeekingCount,1); QCOMPARE(mTest->mSeeking,false); mTest->endForward(); - QCOMPARE(mTest->mMpEngine->skipForwardCount,1); + QCOMPARE(mTest->mMpEngine->mSkipForwardCount,1); QCOMPARE(mTest->mSeeking,false); } diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpplaybackview/stub/inc/mpengine.h --- a/mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpplaybackview/stub/inc/mpengine.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpplaybackview/stub/inc/mpengine.h Fri Sep 03 19:58:01 2010 -0500 @@ -46,7 +46,7 @@ virtual ~MpEngine(); MpPlaybackData *playbackData(); - void retrieveSongDetails(); + void retrieveSongDetails( int index = -1 ); // Equalizer related void applyPreset( int preset ); @@ -71,6 +71,7 @@ // Equalizer related void libraryUpdated(); + void corruptedStop(); private: Q_DISABLE_COPY( MpEngine ) @@ -79,13 +80,13 @@ int mActivePreset; int mApplyPresetCount; int mDisableEquqlizerCount; - int retrieveSongDetailsCount; - int stopCount; - int startSeekBackwardCount; - int startSeekForwardCount; - int stopSeekingCount; - int skipBackwardCount; - int skipForwardCount; + int mRetrieveSongDetailsCount; + int mStopCount; + int mStartSeekBackwardCount; + int mStartSeekForwardCount; + int mStopSeekingCount; + int mSkipBackwardCount; + int mSkipForwardCount; }; diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpplaybackview/stub/inc/mpenginefactory.h --- a/mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpplaybackview/stub/inc/mpenginefactory.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpplaybackview/stub/inc/mpenginefactory.h Fri Sep 03 19:58:01 2010 -0500 @@ -36,7 +36,8 @@ virtual ~MpEngineFactory(); static MpEngineFactory * instance(); static MpEngine * sharedEngine(); - + static void close(); + private: Q_DISABLE_COPY( MpEngineFactory ) diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpplaybackview/stub/src/mpengine.cpp --- a/mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpplaybackview/stub/src/mpengine.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpplaybackview/stub/src/mpengine.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -23,7 +23,17 @@ /*! Stub */ -MpEngine::MpEngine() +MpEngine::MpEngine() : + mActivePreset(-1), + mApplyPresetCount(0), + mDisableEquqlizerCount(0), + mRetrieveSongDetailsCount(0), + mStopCount(0), + mStartSeekBackwardCount(0), + mStartSeekForwardCount(0), + mStopSeekingCount(0), + mSkipBackwardCount(0), + mSkipForwardCount(0) { TX_LOG_ARGS("Stub") } @@ -87,15 +97,18 @@ */ void MpEngine::stop() { - stopCount++; + mStopCount++; } /*! Stub */ -void MpEngine::retrieveSongDetails() +void MpEngine::retrieveSongDetails( int index ) { - retrieveSongDetailsCount++; + if ( index == -1 ) { + // Retrieve song details of currently playing song + mRetrieveSongDetailsCount++; + } } /*! @@ -118,7 +131,7 @@ */ void MpEngine::startSeekBackward() { - startSeekBackwardCount++; + mStartSeekBackwardCount++; } /*! @@ -126,7 +139,7 @@ */ void MpEngine::startSeekForward() { - startSeekForwardCount++; + mStartSeekForwardCount++; } /*! @@ -134,7 +147,7 @@ */ void MpEngine::stopSeeking() { - stopSeekingCount++; + mStopSeekingCount++; } /*! @@ -142,7 +155,7 @@ */ void MpEngine::skipBackward() { - skipBackwardCount++; + mSkipBackwardCount++; } /*! @@ -150,7 +163,7 @@ */ void MpEngine::skipForward() { - skipForwardCount++; + mSkipForwardCount++; } /*! diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpplaybackview/stub/src/mpenginefactory.cpp --- a/mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpplaybackview/stub/src/mpenginefactory.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpplaybackview/stub/src/mpenginefactory.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -60,3 +60,14 @@ } return instance()->mSharedEngine; } + +/*! + Closes all engines created on this process. + */ +void MpEngineFactory::close() +{ + if ( instance()->mSharedEngine ) { + delete instance()->mSharedEngine; + instance()->mSharedEngine = 0; + } +} diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpplaybackview/stub/src/mpequalizerwidget.cpp --- a/mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpplaybackview/stub/src/mpequalizerwidget.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpplaybackview/stub/src/mpequalizerwidget.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -30,6 +30,8 @@ Constructs the Equalizer widget. */ MpEqualizerWidget::MpEqualizerWidget() : + showEqualizerWidgetCount( 0 ), + closeEqualizerWidgetCount( 0 ), mMpEngine(0) { TX_ENTRY diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpplaybackview/unittest_mpplaybackview.pro --- a/mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpplaybackview/unittest_mpplaybackview.pro Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpplaybackview/unittest_mpplaybackview.pro Fri Sep 03 19:58:01 2010 -0500 @@ -34,7 +34,7 @@ HEADERS += inc/unittest_mpplaybackview.h \ ../../inc/mpplaybackview.h \ - ../../../../inc/mpviewbase.h \ + stub\inc\mpviewbase.h \ stub\inc\mpengine.h \ stub\inc\mpenginefactory.h \ stub\inc\mpplaybackwidget.h \ diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpsettingsviewplugin/tsrc/tsrc.pro --- a/mpviewplugins/mpsettingsviewplugin/tsrc/tsrc.pro Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpsettingsviewplugin/tsrc/tsrc.pro Fri Sep 03 19:58:01 2010 -0500 @@ -18,7 +18,7 @@ SUBDIRS += unittest_mpsettingsviewplugin \ unittest_mpsettingsaudioeffectswidget \ - unittest_mpsettingsview - + unittest_mpsettingsview + CONFIG += ordered diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpsettingsviewplugin/tsrc/unittest_mpsettingsaudioeffectswidget/stub/inc/mpenginefactory.h --- a/mpviewplugins/mpsettingsviewplugin/tsrc/unittest_mpsettingsaudioeffectswidget/stub/inc/mpenginefactory.h Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpsettingsviewplugin/tsrc/unittest_mpsettingsaudioeffectswidget/stub/inc/mpenginefactory.h Fri Sep 03 19:58:01 2010 -0500 @@ -32,8 +32,8 @@ public: virtual ~MpEngineFactory(); static MpEngineFactory * instance(); - - static MpEngine *createSharedEngine( TUid uid = TUid::Uid( MpCommon::KMusicPlayerUid ), MpEngine::EngineMode mode = MpEngine::StandAlone ); + + static MpEngine *createSharedEngine( quint32 clientSecureId=MpCommon::KMusicPlayerUid, MpEngine::EngineMode mode = MpEngine::StandAlone ); static MpEngine *sharedEngine(); static void close(); diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/mpsettingsviewplugin/tsrc/unittest_mpsettingsaudioeffectswidget/stub/src/mpenginefactory.cpp --- a/mpviewplugins/mpsettingsviewplugin/tsrc/unittest_mpsettingsaudioeffectswidget/stub/src/mpenginefactory.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/mpviewplugins/mpsettingsviewplugin/tsrc/unittest_mpsettingsaudioeffectswidget/stub/src/mpenginefactory.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -49,12 +49,12 @@ } /*! - Returns an instance to an engine with \a hostUid, and \a mode, if the shared engine is + Returns an instance to an engine with \a clientSecureId, and \a mode, if the shared engine is already created parameters are ignored. */ -MpEngine *MpEngineFactory::createSharedEngine( TUid hostUid , MpEngine::EngineMode mode ) +MpEngine *MpEngineFactory::createSharedEngine( quint32 clientSecureId, MpEngine::EngineMode mode ) { - Q_UNUSED( hostUid ); + Q_UNUSED( clientSecureId ); Q_UNUSED( mode ); if ( !instance()->mSharedEngine ) { instance()->mSharedEngine = new MpEngine(); diff -r 560ce2306a17 -r f3930dda3342 mpviewplugins/rom/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpviewplugins/rom/bld.inf Fri Sep 03 19:58:01 2010 -0500 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file +* +*/ + +#include + +PRJ_EXPORTS + +../mpcollectionviewplugin/rom/mpcollectionviewplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(mpcollectionviewplugin.iby) +../mpplaybackviewplugin/rom/mpplaybackviewplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(mpplaybackviewplugin.iby) +../mpsettingsviewplugin/rom/mpsettingsviewplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(mpsettingsviewplugin.iby) +../mpdetailsviewplugin/rom/mpdetailsviewplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(mpdetailsviewplugin.iby) +../mpmediawallviewplugin/rom/mpmediawallviewplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(mpmediawallviewplugin.iby) diff -r 560ce2306a17 -r f3930dda3342 musicservices/bwins/musicservicesu.def --- a/musicservices/bwins/musicservicesu.def Tue Aug 24 03:36:14 2010 -0500 +++ b/musicservices/bwins/musicservicesu.def Fri Sep 03 19:58:01 2010 -0500 @@ -7,12 +7,12 @@ ?contextTitle@MusicServices@@QBE?AVQString@@XZ @ 6 NONAME ; class QString MusicServices::contextTitle(void) const ??0MusicServices@@QAE@XZ @ 7 NONAME ; MusicServices::MusicServices(void) ??_EMusicServices@@UAE@I@Z @ 8 NONAME ; MusicServices::~MusicServices(unsigned int) - ?itemSelected@MusicServices@@QAEXVQString@@@Z @ 9 NONAME ; void MusicServices::itemSelected(class QString) - ?playReady@MusicServices@@IAEXABVXQSharableFile@@@Z @ 10 NONAME ; void MusicServices::playReady(class XQSharableFile const &) - ?tr@MusicServices@@SA?AVQString@@PBD0H@Z @ 11 NONAME ; class QString MusicServices::tr(char const *, char const *, int) - ?tr@MusicServices@@SA?AVQString@@PBD0@Z @ 12 NONAME ; class QString MusicServices::tr(char const *, char const *) - ?getStaticMetaObject@MusicServices@@SAABUQMetaObject@@XZ @ 13 NONAME ; struct QMetaObject const & MusicServices::getStaticMetaObject(void) - ?serviceActive@MusicServices@@IAEXVTUid@@@Z @ 14 NONAME ; void MusicServices::serviceActive(class TUid) + ?serviceActive@MusicServices@@IAEXI@Z @ 9 NONAME ; void MusicServices::serviceActive(unsigned int) + ?itemSelected@MusicServices@@QAEXVQString@@@Z @ 10 NONAME ; void MusicServices::itemSelected(class QString) + ?playReady@MusicServices@@IAEXABVXQSharableFile@@@Z @ 11 NONAME ; void MusicServices::playReady(class XQSharableFile const &) + ?tr@MusicServices@@SA?AVQString@@PBD0H@Z @ 12 NONAME ; class QString MusicServices::tr(char const *, char const *, int) + ?tr@MusicServices@@SA?AVQString@@PBD0@Z @ 13 NONAME ; class QString MusicServices::tr(char const *, char const *) + ?getStaticMetaObject@MusicServices@@SAABUQMetaObject@@XZ @ 14 NONAME ; struct QMetaObject const & MusicServices::getStaticMetaObject(void) ?metaObject@MusicServices@@UBEPBUQMetaObject@@XZ @ 15 NONAME ; struct QMetaObject const * MusicServices::metaObject(void) const ?setCurrentService@MusicServices@@QAEXW4MusicService@1@@Z @ 16 NONAME ; void MusicServices::setCurrentService(enum MusicServices::MusicService) ?staticMetaObject@MusicServices@@2UQMetaObject@@B @ 17 NONAME ; struct QMetaObject const MusicServices::staticMetaObject diff -r 560ce2306a17 -r f3930dda3342 musicservices/eabi/musicservicesu.def --- a/musicservices/eabi/musicservicesu.def Tue Aug 24 03:36:14 2010 -0500 +++ b/musicservices/eabi/musicservicesu.def Fri Sep 03 19:58:01 2010 -0500 @@ -2,7 +2,7 @@ _ZN13MusicServices11qt_metacallEN11QMetaObject4CallEiPPv @ 1 NONAME _ZN13MusicServices11qt_metacastEPKc @ 2 NONAME _ZN13MusicServices12itemSelectedE7QString @ 3 NONAME - _ZN13MusicServices13serviceActiveE4TUid @ 4 NONAME + _ZN13MusicServices13serviceActiveEj @ 4 NONAME _ZN13MusicServices14currentServiceEv @ 5 NONAME _ZN13MusicServices16staticMetaObjectE @ 6 NONAME DATA 16 _ZN13MusicServices17setCurrentServiceENS_12MusicServiceE @ 7 NONAME diff -r 560ce2306a17 -r f3930dda3342 musicservices/inc/musicservices.h --- a/musicservices/inc/musicservices.h Tue Aug 24 03:36:14 2010 -0500 +++ b/musicservices/inc/musicservices.h Fri Sep 03 19:58:01 2010 -0500 @@ -62,9 +62,9 @@ signals: - void playReady( const QString& aFileName ); + void playReady( const QString& uri ); void playReady( const XQSharableFile& file ); - void serviceActive( TUid hostUid ); + void serviceActive( quint32 clientSecureId ); private: diff -r 560ce2306a17 -r f3930dda3342 musicservices/rom/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/musicservices/rom/bld.inf Fri Sep 03 19:58:01 2010 -0500 @@ -0,0 +1,22 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file +* +*/ + +#include + +PRJ_EXPORTS + +musicservices.iby CORE_APP_LAYER_IBY_EXPORT_PATH(musicservices.iby) diff -r 560ce2306a17 -r f3930dda3342 musicservices/src/getmusicservice.cpp --- a/musicservices/src/getmusicservice.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/musicservices/src/getmusicservice.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -23,8 +23,6 @@ #include "mptrace.h" - - /*! Constructs music fetcher service */ @@ -114,8 +112,7 @@ //TODO: change to string constant when available mTitle = requestInfo().info("WindowTitle").toString(); mServiceApp->setCurrentService( MusicServices::EUriFetcher ); - TUid uid = TUid::Uid( requestInfo().clientSecureId() ); - emit mServiceApp->serviceActive( uid ); + emit mServiceApp->serviceActive( requestInfo().clientSecureId() ); connect(this, SIGNAL( clientDisconnected() ), qApp, SLOT( quit() ) ); mRequestIndex = setCurrentRequestAsync(); diff -r 560ce2306a17 -r f3930dda3342 musicservices/src/musicservices.cpp --- a/musicservices/src/musicservices.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/musicservices/src/musicservices.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -31,9 +31,9 @@ */ /*! - \fn void playReady( const QString& aFileName ) + \fn void playReady( const QString& uri ) - This signal is emitted when the play service has been loaded and playback of aFilenName should start + This signal is emitted when the play service has been loaded and playback of \a uri should start. */ @@ -45,9 +45,9 @@ */ /*! - \fn void serviceActive() + \fn void serviceActive( quint32 clientSecureId ) - This signal is emitted when the requested service has been detected and view initialization should continue + This signal is emitted when the requested service has been detected and view initialization should continue. */ @@ -95,7 +95,6 @@ */ QString MusicServices::contextTitle() const { - if( mCurrentService == MusicServices::EUriFetcher ) { return mFetchService->contextTitle(); } @@ -106,8 +105,6 @@ Q_ASSERT_X(false, "MusicServices::contexTitle", "undefined service"); return QString(); } - - } /*! @@ -124,6 +121,5 @@ else if ( mCurrentService == MusicServices::EPlayback ) { mPlayService->complete( list ); } - } diff -r 560ce2306a17 -r f3930dda3342 musicservices/src/playmusicservice.cpp --- a/musicservices/src/playmusicservice.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/musicservices/src/playmusicservice.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -122,8 +122,7 @@ uri.replace(QString("/"),QString("\\")); mTitle = requestInfo().info("WindowTitle").toString(); mServiceApp->setCurrentService( MusicServices::EPlayback ); - TUid uid = TUid::Uid(requestInfo().clientSecureId()); - emit mServiceApp->serviceActive( uid ); + emit mServiceApp->serviceActive( requestInfo().clientSecureId() ); emit mServiceApp->playReady( uri ); connect(this, SIGNAL( clientDisconnected() ), qApp, SLOT( quit() ) ); mRequestIndex = setCurrentRequestAsync(); @@ -186,8 +185,7 @@ TX_ENTRY mTitle = requestInfo().info("WindowTitle").toString(); mServiceApp->setCurrentService( MusicServices::EPlayback ); - TUid uid = TUid::Uid(requestInfo().clientSecureId()); - emit mServiceApp->serviceActive( uid ); + emit mServiceApp->serviceActive( requestInfo().clientSecureId() ); emit mServiceApp->playReady( file ); connect(this, SIGNAL( clientDisconnected() ), qApp, SLOT( quit() ) ); mRequestIndex = setCurrentRequestAsync(); diff -r 560ce2306a17 -r f3930dda3342 musicservices/tsrc/unittest_musicservices/src/unittest_musicservices.cpp --- a/musicservices/tsrc/unittest_musicservices/src/unittest_musicservices.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/musicservices/tsrc/unittest_musicservices/src/unittest_musicservices.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -15,8 +15,7 @@ * */ -#include -#include +#include #include "unittest_musicservices.h" @@ -34,19 +33,20 @@ */ int main(int argc, char *argv[]) { - HbApplication app(argc, argv); - HbMainWindow window; - + QApplication app(argc, argv); TestMusicServices tv; - char *pass[3]; - pass[0] = argv[0]; - pass[1] = "-o"; - pass[2] = "c:\\data\\unittest_musicservices.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_musicservices.txt"; - int res = QTest::qExec(&tv, 3, pass); - - return res; + return QTest::qExec(&tv, 3, pass); + } } TestMusicServices::TestMusicServices() diff -r 560ce2306a17 -r f3930dda3342 musicwidgetplugin/inc/musicwidget.h --- a/musicwidgetplugin/inc/musicwidget.h Tue Aug 24 03:36:14 2010 -0500 +++ b/musicwidgetplugin/inc/musicwidget.h Fri Sep 03 19:58:01 2010 -0500 @@ -109,8 +109,8 @@ /** * MpEngine slots - */ - void libraryAboutToUpdate(); + */ + void libraryUpdateStarted(); void libraryUpdated(); void usbBlocked( bool blocked ); diff -r 560ce2306a17 -r f3930dda3342 musicwidgetplugin/rom/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/musicwidgetplugin/rom/bld.inf Fri Sep 03 19:58:01 2010 -0500 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file +* +*/ + +#include + +PRJ_EXPORTS + +musicwidgetplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(musicwidgetplugin.iby) +// musicwidgetplugin_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(musicwidgetplugin_resources.iby) + +// #ifdef MARM +// START EXTENSION app-services/buildstubsis +// OPTION SRCDIR rom +// OPTION SISNAME musicwidgetplugin_stub +// END +// #endif + + diff -r 560ce2306a17 -r f3930dda3342 musicwidgetplugin/src/musicwidget.cpp --- a/musicwidgetplugin/src/musicwidget.cpp Tue Aug 24 03:36:14 2010 -0500 +++ b/musicwidgetplugin/src/musicwidget.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -132,7 +132,7 @@ setupUi(); // Connect to MP engine and playback data - mMpEngine = MpEngineFactory::createSharedEngine(); + mMpEngine = MpEngineFactory::createSharedEngine(MpCommon::KMusicPlayerUid, MpEngine::HomeScreen ); Q_ASSERT_X(mMpEngine, "music_widget", "no music player engine"); TX_LOG_ARGS("got mp engine") @@ -176,7 +176,7 @@ QObject::connect(mNextPushButton, SIGNAL(clicked()), this, SLOT(nextSong())); // MpEngine - QObject::connect(mMpEngine, SIGNAL(libraryAboutToUpdate()), this, SLOT(libraryAboutToUpdate())); + QObject::connect(mMpEngine, SIGNAL(libraryUpdateStarted()), this, SLOT(libraryUpdateStarted())); QObject::connect(mMpEngine, SIGNAL(libraryUpdated()), this, SLOT(libraryUpdated())); QObject::connect(mMpEngine, SIGNAL(usbBlocked(bool)), this, SLOT(usbBlocked(bool))); @@ -615,7 +615,7 @@ /*! MpEngine related */ -void MusicWidget::libraryAboutToUpdate() +void MusicWidget::libraryUpdateStarted() { TX_LOG //Refresh Library start diff -r 560ce2306a17 -r f3930dda3342 package_definition.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/package_definition.xml Fri Sep 03 19:58:01 2010 -0500 @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 560ce2306a17 -r f3930dda3342 package_map.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/package_map.xml Fri Sep 03 19:58:01 2010 -0500 @@ -0,0 +1,1 @@ + diff -r 560ce2306a17 -r f3930dda3342 qtmusicplayer.pro --- a/qtmusicplayer.pro Tue Aug 24 03:36:14 2010 -0500 +++ b/qtmusicplayer.pro Fri Sep 03 19:58:01 2010 -0500 @@ -25,6 +25,7 @@ include(utilities/mpnowplayingbanner/rom/rom.pri) include(utilities/mpalbumcoverwidget/rom/rom.pri) include(utilities/mpmediacontroller/rom/rom.pri) + include(utilities/mpapplicationmonitor/rom/rom.pri) include(mpviewplugins/mpcollectionviewplugin/rom/rom.pri) include(mpviewplugins/mpplaybackviewplugin/rom/rom.pri) include(mpviewplugins/mpsettingsviewplugin/rom/rom.pri) diff -r 560ce2306a17 -r f3930dda3342 sis/musicplayer_stub.pkg --- a/sis/musicplayer_stub.pkg Tue Aug 24 03:36:14 2010 -0500 +++ b/sis/musicplayer_stub.pkg Fri Sep 03 19:58:01 2010 -0500 @@ -37,6 +37,7 @@ ""-"z:\sys\bin\mpsettingsmanager.dll" ""-"z:\sys\bin\mpalbumcoverwidget.dll" ""-"z:\sys\bin\mpmediacontroller.dll" +""-"z:\sys\bin\mpapplicationmonitor.dll" ""-"z:\sys\bin\mpdata.dll" ""-"z:\sys\bin\mpengine.dll" ""-"z:\sys\bin\musicservices.dll" diff -r 560ce2306a17 -r f3930dda3342 sis/musicplayer_udeb.pkg --- a/sis/musicplayer_udeb.pkg Tue Aug 24 03:36:14 2010 -0500 +++ b/sis/musicplayer_udeb.pkg Fri Sep 03 19:58:01 2010 -0500 @@ -247,6 +247,7 @@ "\epoc32\release\armv5\udeb\mpsettingsmanager.dll" - "!:\sys\bin\mpsettingsmanager.dll" "\epoc32\release\armv5\udeb\mpalbumcoverwidget.dll" - "!:\sys\bin\mpalbumcoverwidget.dll" "\epoc32\release\armv5\udeb\mpmediacontroller.dll" - "!:\sys\bin\mpmediacontroller.dll" +"\epoc32\release\armv5\udeb\mpapplicationmonitor.dll" - "!:\sys\bin\mpapplicationmonitor.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" diff -r 560ce2306a17 -r f3930dda3342 sis/musicplayer_urel.pkg --- a/sis/musicplayer_urel.pkg Tue Aug 24 03:36:14 2010 -0500 +++ b/sis/musicplayer_urel.pkg Fri Sep 03 19:58:01 2010 -0500 @@ -247,6 +247,7 @@ "\epoc32\release\armv5\urel\mpsettingsmanager.dll" - "!:\sys\bin\mpsettingsmanager.dll" "\epoc32\release\armv5\urel\mpalbumcoverwidget.dll" - "!:\sys\bin\mpalbumcoverwidget.dll" "\epoc32\release\armv5\urel\mpmediacontroller.dll" - "!:\sys\bin\mpmediacontroller.dll" +"\epoc32\release\armv5\urel\mpapplicationmonitor.dll" - "!:\sys\bin\mpapplicationmonitor.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" diff -r 560ce2306a17 -r f3930dda3342 utilities/mpapplicationmonitor/bwins/mpapplicationmonitoru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/utilities/mpapplicationmonitor/bwins/mpapplicationmonitoru.def Fri Sep 03 19:58:01 2010 -0500 @@ -0,0 +1,16 @@ +EXPORTS + ?applicationStatusChanged@MpApplicationMonitor@@IAEX_N@Z @ 1 NONAME ; void MpApplicationMonitor::applicationStatusChanged(bool) + ?staticMetaObject@MpApplicationMonitor@@2UQMetaObject@@B @ 2 NONAME ; struct QMetaObject const MpApplicationMonitor::staticMetaObject + ??1MpApplicationMonitor@@UAE@XZ @ 3 NONAME ; MpApplicationMonitor::~MpApplicationMonitor(void) + ?trUtf8@MpApplicationMonitor@@SA?AVQString@@PBD0H@Z @ 4 NONAME ; class QString MpApplicationMonitor::trUtf8(char const *, char const *, int) + ?qt_metacall@MpApplicationMonitor@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 5 NONAME ; int MpApplicationMonitor::qt_metacall(enum QMetaObject::Call, int, void * *) + ?isApplicationRunning@MpApplicationMonitor@@QAE_NXZ @ 6 NONAME ; bool MpApplicationMonitor::isApplicationRunning(void) + ?qt_metacast@MpApplicationMonitor@@UAEPAXPBD@Z @ 7 NONAME ; void * MpApplicationMonitor::qt_metacast(char const *) + ?metaObject@MpApplicationMonitor@@UBEPBUQMetaObject@@XZ @ 8 NONAME ; struct QMetaObject const * MpApplicationMonitor::metaObject(void) const + ?trUtf8@MpApplicationMonitor@@SA?AVQString@@PBD0@Z @ 9 NONAME ; class QString MpApplicationMonitor::trUtf8(char const *, char const *) + ?tr@MpApplicationMonitor@@SA?AVQString@@PBD0H@Z @ 10 NONAME ; class QString MpApplicationMonitor::tr(char const *, char const *, int) + ?tr@MpApplicationMonitor@@SA?AVQString@@PBD0@Z @ 11 NONAME ; class QString MpApplicationMonitor::tr(char const *, char const *) + ??_EMpApplicationMonitor@@UAE@I@Z @ 12 NONAME ; MpApplicationMonitor::~MpApplicationMonitor(unsigned int) + ??0MpApplicationMonitor@@QAE@IPAVQObject@@@Z @ 13 NONAME ; MpApplicationMonitor::MpApplicationMonitor(unsigned int, class QObject *) + ?getStaticMetaObject@MpApplicationMonitor@@SAABUQMetaObject@@XZ @ 14 NONAME ; struct QMetaObject const & MpApplicationMonitor::getStaticMetaObject(void) + diff -r 560ce2306a17 -r f3930dda3342 utilities/mpapplicationmonitor/eabi/mpapplicationmonitoru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/utilities/mpapplicationmonitor/eabi/mpapplicationmonitoru.def Fri Sep 03 19:58:01 2010 -0500 @@ -0,0 +1,16 @@ +EXPORTS + _ZN20MpApplicationMonitor11qt_metacallEN11QMetaObject4CallEiPPv @ 1 NONAME + _ZN20MpApplicationMonitor11qt_metacastEPKc @ 2 NONAME + _ZN20MpApplicationMonitor16staticMetaObjectE @ 3 NONAME DATA 16 + _ZN20MpApplicationMonitor19getStaticMetaObjectEv @ 4 NONAME + _ZN20MpApplicationMonitor20isApplicationRunningEv @ 5 NONAME + _ZN20MpApplicationMonitor24applicationStatusChangedEb @ 6 NONAME + _ZN20MpApplicationMonitorC1EjP7QObject @ 7 NONAME + _ZN20MpApplicationMonitorC2EjP7QObject @ 8 NONAME + _ZN20MpApplicationMonitorD0Ev @ 9 NONAME + _ZN20MpApplicationMonitorD1Ev @ 10 NONAME + _ZN20MpApplicationMonitorD2Ev @ 11 NONAME + _ZNK20MpApplicationMonitor10metaObjectEv @ 12 NONAME + _ZTI20MpApplicationMonitor @ 13 NONAME + _ZTV20MpApplicationMonitor @ 14 NONAME + diff -r 560ce2306a17 -r f3930dda3342 utilities/mpapplicationmonitor/inc/mpapplicationmonitor_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/utilities/mpapplicationmonitor/inc/mpapplicationmonitor_p.h Fri Sep 03 19:58:01 2010 -0500 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Music Player application monitor utility - private implementation. +* +*/ + +#ifndef MPAPPLICATIONMONITORPRIVATE_H +#define MPAPPLICATIONMONITORPRIVATE_H + +#include +#include + +class MpApplicationMonitor; + +class MpApplicationMonitorPrivate : public CActive +{ +public: + + explicit MpApplicationMonitorPrivate( MpApplicationMonitor *qq ); + virtual ~MpApplicationMonitorPrivate(); + + void init( quint32 clientSecureId ); + bool isApplicationRunning(); + +protected: + + void RunL(); + void DoCancel(); + +private: + + void DoInitL(); + bool DoIsApplicationRunningL(); + void CreateWindowGroupL(); + void StartMonitor(); + +private: + + MpApplicationMonitor *q_ptr; + + TUid iHostUid; + RWindowGroup iWindowGroup; + RWsSession iWsSession; + +}; + +#endif // MPAPPLICATIONMONITORPRIVATE_H diff -r 560ce2306a17 -r f3930dda3342 utilities/mpapplicationmonitor/mpapplicationmonitor.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/utilities/mpapplicationmonitor/mpapplicationmonitor.pro Fri Sep 03 19:58: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: Project file for application monitor utility. +# + +TEMPLATE = lib +CONFIG += hb qt +TARGET = mpapplicationmonitor +symbian: { + TARGET.UID3 = 0x10207C98 + MMP_RULES += "DEFFILE mpapplicationmonitor.def" + defFilePath = . + TARGET.CAPABILITY = CAP_GENERAL_DLL + TARGET.EPOCALLOWDLLDATA = 1 +} +DEFINES += BUILD_MPAPPLICATIONMONITOR + +INCLUDEPATH += . \ + inc \ + ../../inc +INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE + +LIBS += -lws32 \ + -lapgrfx \ + -lavkon + +# Input +HEADERS += ../../inc/mpapplicationmonitor.h \ + inc/mpapplicationmonitor_p.h + +SOURCES += src/mpapplicationmonitor.cpp \ + src/mpapplicationmonitor_p.cpp + diff -r 560ce2306a17 -r f3930dda3342 utilities/mpapplicationmonitor/rom/mpapplicationmonitor.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/utilities/mpapplicationmonitor/rom/mpapplicationmonitor.iby Fri Sep 03 19:58: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: +* +*/ + +#ifndef MPAPPLICATIONMONITOR_IBY +#define MPAPPLICATIONMONITOR_IBY + +#include + +file=ABI_DIR\BUILD_DIR\mpapplicationmonitor.dll SHARED_LIB_DIR\mpapplicationmonitor.dll + +#endif // MPAPPLICATIONMONITOR_IBY diff -r 560ce2306a17 -r f3930dda3342 utilities/mpapplicationmonitor/rom/rom.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/utilities/mpapplicationmonitor/rom/rom.pri Fri Sep 03 19:58: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: +# + +symbian { +MP_IBY_DIR = $$section(PWD,":",1) + +BLD_INF_RULES.prj_exports += "$$MP_IBY_DIR/mpapplicationmonitor.iby CORE_APP_LAYER_IBY_EXPORT_PATH(mpapplicationmonitor.iby)" +} \ No newline at end of file diff -r 560ce2306a17 -r f3930dda3342 utilities/mpapplicationmonitor/src/mpapplicationmonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/utilities/mpapplicationmonitor/src/mpapplicationmonitor.cpp Fri Sep 03 19:58: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: Music Player now playing widget - private implementation. +* +*/ + +#include "mpapplicationmonitor.h" +#include "mpapplicationmonitor_p.h" +#include "mptrace.h" + +/*! + \class MpApplicationMonitor + \brief Application monitor. + + This utility monitors an application status, i.e. whether the application + is running or not. +*/ + +/*! + \fn applicationStatusChanged( bool isRunning ) + + This signal is emitted when the application status changes. Application + status is indicated with \a isRunning. +*/ + +/*! + Constructs the utility. Default monitored application is Music Player. + */ +MpApplicationMonitor::MpApplicationMonitor( quint32 clientSecureId, QObject *parent ) + : QObject(parent) +{ + d_ptr = new MpApplicationMonitorPrivate(this); + d_ptr->init( clientSecureId ); +} + +/*! + Destructs the utility. + */ +MpApplicationMonitor::~MpApplicationMonitor() +{ + delete d_ptr; +} + +/*! + Returns whether the monitoring application is running. + */ +bool MpApplicationMonitor::isApplicationRunning() +{ + return d_ptr->isApplicationRunning(); +} + diff -r 560ce2306a17 -r f3930dda3342 utilities/mpapplicationmonitor/src/mpapplicationmonitor_p.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/utilities/mpapplicationmonitor/src/mpapplicationmonitor_p.cpp Fri Sep 03 19:58:01 2010 -0500 @@ -0,0 +1,195 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 application monitor utility - private implementation. +* +*/ + +#include +#include + +#include "mpapplicationmonitor_p.h" +#include "mpapplicationmonitor.h" +#include "mptrace.h" + +// -1 means the window will never be visible. +const TInt KWindowGroupPriority = -1; + +/*! + \class MpApplicationMonitorPrivate + \brief Music Player application monitor utility - private implementation. + + +*/ + +/*! + Constructor + */ +MpApplicationMonitorPrivate::MpApplicationMonitorPrivate( MpApplicationMonitor *qq ) + : CActive( CActive::EPriorityStandard ), + q_ptr( qq ) +{ + TX_ENTRY_ARGS( "Q pointer=" << ( void * )qq ) + CActiveScheduler::Add( this ); + TX_EXIT +} + +/*! + Destructor + */ +MpApplicationMonitorPrivate::~MpApplicationMonitorPrivate() +{ + TX_LOG + // Cancel any outstanding request + Cancel(); + + iWindowGroup.Close(); + iWsSession.Close(); + TX_EXIT +} + +/*! + \internal + */ +void MpApplicationMonitorPrivate::init( quint32 clientSecureId ) +{ + TX_ENTRY + iHostUid = TUid::Uid( clientSecureId ); + TRAPD( err, DoInitL() ); + if ( err != KErrNone ) { + TX_LOG_ARGS( "Error: " << err << "; should never get here." ); + } + TX_EXIT +} + +/*! + Request if music player application is running. + */ +bool MpApplicationMonitorPrivate::isApplicationRunning() +{ + TX_ENTRY + bool running = false; + TRAPD( err, running = DoIsApplicationRunningL() ); + if ( err != KErrNone ) { + TX_LOG_ARGS( "Error: " << err << "; should never get here." ); + } + TX_EXIT + return running; +} + +/*! + \internal + Checks if the chosen app is launched + */ +void MpApplicationMonitorPrivate::RunL() + { + // Get the status of this object. + const TInt errCode( iStatus.Int() ); + TX_ENTRY_ARGS("Status=" << errCode); + + if ( KErrNone == errCode ) { + TWsEvent event; + iWsSession.GetEvent( event ); + if ( event.Type() == EEventWindowGroupsChanged ) { + emit q_ptr->applicationStatusChanged( isApplicationRunning() ); + } + TX_LOG_ARGS("OK, renewing request"); + StartMonitor(); + } + else if ( KErrCancel != errCode ) { + TX_LOG_ARGS("Renewing request after error: " << errCode); + StartMonitor(); + } + else { + TX_LOG_ARGS("cancelled"); + } + TX_EXIT +} + +/*! + \internal + Cancel the outstanding request. + */ +void MpApplicationMonitorPrivate::DoCancel() +{ + TX_ENTRY + iWsSession.EventReadyCancel(); + TX_EXIT +} + +/*! + \internal + */ +void MpApplicationMonitorPrivate::DoInitL() +{ + TX_ENTRY + CreateWindowGroupL(); + StartMonitor(); + TX_EXIT +} + +/*! + \internal + */ +bool MpApplicationMonitorPrivate::DoIsApplicationRunningL() +{ + TX_ENTRY + bool taskExists = false; + CAknTaskList* taskList = CAknTaskList::NewL( iWsSession ); + TApaTask task = taskList->FindRootApp( iHostUid ); + delete taskList; + taskExists = task.Exists(); + TX_LOG_ARGS("taskExists=" << taskExists); + return taskExists; +} + +/*! + \internal + Creates a window group and hides it from the UI. + */ +void MpApplicationMonitorPrivate::CreateWindowGroupL() +{ + TX_ENTRY + User::LeaveIfError( iWsSession.Connect() ); + RWindowGroup wg( iWsSession ); + // Make a handle from the address of window group object + User::LeaveIfError( wg.Construct( reinterpret_cast( &wg ) ) ); + User::LeaveIfError( wg.EnableGroupChangeEvents() ); + + // Get the ordinal position of this window group + const TInt ordPos( wg.OrdinalPosition() ); + // Set priority so it's hidden in the UI + wg.SetOrdinalPosition( ordPos, KWindowGroupPriority ); + + // Needs to be a member variable. Must be closed in destructor. + // Otherwise can't monitor what has been opened. + iWindowGroup = wg; + + iWsSession.Flush(); + TX_EXIT +} + +/*! + \internal + Starts event monitoring. + */ +void MpApplicationMonitorPrivate::StartMonitor() +{ + TX_ENTRY + Cancel(); + + iWsSession.EventReady( &iStatus ); + SetActive(); + TX_EXIT +} + diff -r 560ce2306a17 -r f3930dda3342 utilities/mpapplicationmonitor/tsrc/tsrc.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/utilities/mpapplicationmonitor/tsrc/tsrc.pro Fri Sep 03 19:58: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: Music Player mpapplicationmonitor unit test project file. +# + +TEMPLATE = subdirs + +#SUBDIRS += unittest_? + +CONFIG += ordered + diff -r 560ce2306a17 -r f3930dda3342 utilities/mpsettingsmanager/conf/musicplayer.confml Binary file utilities/mpsettingsmanager/conf/musicplayer.confml has changed diff -r 560ce2306a17 -r f3930dda3342 utilities/rom/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/utilities/rom/bld.inf Fri Sep 03 19:58:01 2010 -0500 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file +* +*/ + +#include + +PRJ_EXPORTS + + +../mpsettingsmanager/rom/mpsettingsmanager.iby CORE_APP_LAYER_IBY_EXPORT_PATH(mpsettingsmanager.iby) +../mpnowplayingbanner/rom/mpnowplayingbanner.iby CORE_APP_LAYER_IBY_EXPORT_PATH(mpnowplayingbanner.iby) +../mpalbumcoverwidget/rom/mpalbumcoverwidget.iby CORE_APP_LAYER_IBY_EXPORT_PATH(mpalbumcoverwidget.iby) +../mpmediacontroller/rom/mpmediacontroller.iby CORE_APP_LAYER_IBY_EXPORT_PATH(mpmediacontroller.iby) +../mpapplicationmonitor/rom/mpapplicationmonitor.iby CORE_APP_LAYER_IBY_EXPORT_PATH(mpapplicationmonitor.iby) + diff -r 560ce2306a17 -r f3930dda3342 utilities/tsrc/tsrc.pro --- a/utilities/tsrc/tsrc.pro Tue Aug 24 03:36:14 2010 -0500 +++ b/utilities/tsrc/tsrc.pro Fri Sep 03 19:58:01 2010 -0500 @@ -18,7 +18,9 @@ SUBDIRS += ../mpnowplayingbanner/tsrc \ ../mpsettingsmanager/tsrc \ - ../mpmediacontroller/tsrc + ../mpmediacontroller/tsrc \ + ../mpalbumcoverwidget/tsrc \ + ../mpapplicationmonitor/tsrc CONFIG += ordered diff -r 560ce2306a17 -r f3930dda3342 utilities/utilities.pro --- a/utilities/utilities.pro Tue Aug 24 03:36:14 2010 -0500 +++ b/utilities/utilities.pro Fri Sep 03 19:58:01 2010 -0500 @@ -18,6 +18,7 @@ SUBDIRS = mpnowplayingbanner \ mpsettingsmanager \ mpalbumcoverwidget \ - mpmediacontroller + mpmediacontroller \ + mpapplicationmonitor CONFIG += ordered