diff -r 7d93ee07fb27 -r c48470be1ba7 videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxplaybackutility.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxplaybackutility.cpp Thu May 27 12:53:14 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxplaybackutility.cpp Fri Jun 11 13:39:54 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,50 +15,198 @@ * */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include"mpxplaybackutilityimpl.h" +#include"mpxplaybackutility.h" -// ============================== MEMBER FUNCTIONS ============================ +// ============================== MEMBER FUNCTIONS ================================================= + +// ------------------------------------------------------------------------------------------------- +// Creates the playback utility object if not already created +// ------------------------------------------------------------------------------------------------- +// +MMPXPlaybackUtility* MMPXPlaybackUtility::UtilityL( const TMPXCategory /*aCategory*/, + const TUid& /*aModeId*/ ) +{ + return CMPXPlaybackUtility::NewL(); +} -// ---------------------------------------------------------------------------- -// Create the playback utility object -// ---------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- +// Two phases constructor +// ------------------------------------------------------------------------------------------------- +// +CMPXPlaybackUtility* CMPXPlaybackUtility::NewL() +{ + CMPXPlaybackUtility* p = new(ELeave)CMPXPlaybackUtility(); + CleanupStack::PushL(p); + p->ConstructL(); + CleanupStack::Pop(p); + return p; +} + +// ------------------------------------------------------------------------------------------------- +// Destructor +// ------------------------------------------------------------------------------------------------- +// +CMPXPlaybackUtility::~CMPXPlaybackUtility() +{ +} + +// ------------------------------------------------------------------------------------------------- +// C++ constructor +// Create a unique name out of thread ID and this pointer: no other instance of +// this object will have the same name; used to identify this object for +// recieving messages +// ------------------------------------------------------------------------------------------------- +// +CMPXPlaybackUtility::CMPXPlaybackUtility() +{ +} + +// ------------------------------------------------------------------------------------------------- +// 2nd construtor +// ------------------------------------------------------------------------------------------------- // -EXPORT_C MMPXPlaybackUtility* MMPXPlaybackUtility::NewL(const TUid& aModeId, - MMPXPlaybackObserver* aObs) - { - return CMPXPlaybackUtility::NewL(aModeId,aObs, EMPXCategoryMusic); - } +void CMPXPlaybackUtility::ConstructL() +{ + iState = EPbStateInitialised; +} + +// ------------------------------------------------------------------------------------------------- +// Add a observer +// ------------------------------------------------------------------------------------------------- +// +void CMPXPlaybackUtility::AddObserverL( MMPXPlaybackObserver& /*aObs*/ ) +{ +} + +// ------------------------------------------------------------------------------------------------- +// Remove a observer +// ------------------------------------------------------------------------------------------------- +// +void CMPXPlaybackUtility::RemoveObserverL( MMPXPlaybackObserver& /* aObs */ ) +{ +} -// ---------------------------------------------------------------------------- -// Create the playback utility object -// ---------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- +// Delete this +// ------------------------------------------------------------------------------------------------- +// +void CMPXPlaybackUtility::Close() +{ + delete this; +} + +// ------------------------------------------------------------------------------------------------- +// Issue player commands +// ------------------------------------------------------------------------------------------------- // +void CMPXPlaybackUtility::CommandL( TMPXPlaybackCommand aCmd ) +{ + iCommand = aCmd; +} -EXPORT_C MMPXPlaybackUtility* MMPXPlaybackUtility::NewL(const TMPXCategory aCategory, - const TUid& aModeId, - MMPXPlaybackObserver* aObs) +// ------------------------------------------------------------------------------------------------- +// Issue player commands +// ------------------------------------------------------------------------------------------------- +// +void CMPXPlaybackUtility::CommandL( CMPXCommand& aCmd, MMPXPlaybackCallback* /* aCallback */ ) +{ + TInt cmdType = aCmd.ValueTObjectL( KMPXCommandGeneralId ); + + if ( cmdType == KMPXCommandIdPlaybackGeneral ) { - return CMPXPlaybackUtility::NewL(aModeId,aObs,aCategory); + iCommand = aCmd.ValueTObjectL( KMPXCommandPlaybackGeneralType ); } - -// ---------------------------------------------------------------------------- -// Creates the playback utility object if not already created -// ---------------------------------------------------------------------------- -// -EXPORT_C MMPXPlaybackUtility* MMPXPlaybackUtility::UtilityL( const TUid& aModeId ) + else { - return CMPXPlaybackUtility::UtilityL( aModeId, EMPXCategoryMusic ); + iCommand = aCmd.ValueTObjectL( KMPXMediaVideoPlaybackCommand ); } - -// ---------------------------------------------------------------------------- -// Creates the playback utility object if not already created -// ---------------------------------------------------------------------------- +} + +// ------------------------------------------------------------------------------------------------- +// Current state of player +// ------------------------------------------------------------------------------------------------- // +TMPXPlaybackState CMPXPlaybackUtility::StateL() const +{ + return iState; +} + +// ------------------------------------------------------------------------------------------------- +// Determine whether there is a song by the state of the engine: if there is, +// its OK to return MMPXMedia, else NULL is returned +// ------------------------------------------------------------------------------------------------- +// +MMPXSource* CMPXPlaybackUtility::Source() +{ + return NULL; +} + +// ------------------------------------------------------------------------------------------------- +// Set playback property, EPropertyChanged event when complete +// ------------------------------------------------------------------------------------------------- +// +void CMPXPlaybackUtility::SetL( TMPXPlaybackProperty aProperty, TInt aValue ) +{ + iProperty = aProperty; + iPropertyValue = aValue; +} -EXPORT_C MMPXPlaybackUtility* MMPXPlaybackUtility::UtilityL(const TMPXCategory aCategory, - const TUid& aModeId ) - { - return CMPXPlaybackUtility::UtilityL( aModeId, aCategory ); - } +// ------------------------------------------------------------------------------------------------- +// Send property request +// Result will be called back in HandleProperty +// ------------------------------------------------------------------------------------------------- +// +void CMPXPlaybackUtility::PropertyL( + MMPXPlaybackCallback& /* aCallback */, + TMPXPlaybackProperty /* aProperty */) +{ +} + +// ------------------------------------------------------------------------------------------------- +// Path to the collection +// ------------------------------------------------------------------------------------------------- +// +CMPXCollectionPlaylist* CMPXPlaybackUtility::PlaylistL() +{ + CMPXCollectionPlaylist *p = NULL; + + return p; +} + +// ------------------------------------------------------------------------------------------------- +// Request for media properties. +// ------------------------------------------------------------------------------------------------- +// +void CMPXPlaybackUtility::MediaL( + const TArray& /* aAttrs */, + MMPXPlaybackCallback& /* aCallback */, + CMPXAttributeSpecs* /* aSpecs */) +{ +} + +// ------------------------------------------------------------------------------------------------- +// set primary client +// ------------------------------------------------------------------------------------------------- +// +void CMPXPlaybackUtility::SetPrimaryClientL() +{ +} + +// End of file +