diff -r cf5481c2bc0b -r 69946d1824c4 videoplayerapp/videoplayerengine/src/mpxvideoembeddedpdlhandler.cpp --- a/videoplayerapp/videoplayerengine/src/mpxvideoembeddedpdlhandler.cpp Fri Apr 16 14:59:52 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,185 +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: Handles PDL commands passed in by other appilcations - * -*/ - -// Version : %version: 2 % - - - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "mpxvideoembeddedpdlhandler.h" -#include "mpxvideoplayerappuiengine.h" -#include "mpxvideoplayerconstants.h" -#include "mpxvideo_debug.h" - -CMpxVideoEmbeddedPdlHandler* -CMpxVideoEmbeddedPdlHandler::NewL( CMpxVideoPlayerAppUiEngine* aAppUiEngine ) -{ - MPX_ENTER_EXIT(_L("CMpxVideoEmbeddedPdlHandler::NewL()")); - - CMpxVideoEmbeddedPdlHandler* self = new ( ELeave ) CMpxVideoEmbeddedPdlHandler( aAppUiEngine ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; -} - -// ------------------------------------------------------------------------------------------------- -// C++ constructor can NOT contain any code that might leave. -// ------------------------------------------------------------------------------------------------- -// -CMpxVideoEmbeddedPdlHandler::CMpxVideoEmbeddedPdlHandler( CMpxVideoPlayerAppUiEngine* aAppUiEngine ) - : iAppUiEngine( aAppUiEngine ) -{ -} - -// ------------------------------------------------------------------------------------------------- -// Destructor. -// ------------------------------------------------------------------------------------------------- -// -CMpxVideoEmbeddedPdlHandler::~CMpxVideoEmbeddedPdlHandler() -{ - MPX_ENTER_EXIT(_L("CMpxVideoEmbeddedPdlHandler::~CMpxVideoEmbeddedPdlHandler()")); - - if ( iDownloadFileName ) - { - delete iDownloadFileName; - iDownloadFileName = NULL; - } -} - -// ------------------------------------------------------------------------------------------------- -// Symbian 2nd phase constructor can leave. -// ------------------------------------------------------------------------------------------------- -// -void CMpxVideoEmbeddedPdlHandler::ConstructL() -{ -} - -// ------------------------------------------------------------------------------------------------- -// CMpxVideoEmbeddedPdlHandler::ConnectToEmbeddedDownloadL() -// ------------------------------------------------------------------------------------------------- -// -void CMpxVideoEmbeddedPdlHandler::ConnectToEmbeddedDownloadL( TInt aDlId, TDesC& aFileName ) -{ - MPX_ENTER_EXIT(_L("CMpxVideoEmbeddedPdlHandler::ConnectToEmbeddedDownloadL()"), - _L("aDlId = %d, aFileName = %S"), aDlId, &aFileName ); - - if ( iDownloadFileName ) - { - // - // Check if this is the same download that is loaded - // If it is, issue a play command to resume playback - - if ( ( aDlId == iDownloadId ) && ( ! aFileName.Compare( *iDownloadFileName ) ) ) - { - iAppUiEngine->PlaybackUtility()->CommandL( EPbCmdPlay ); - } - else - { - // - // New download received, close old playback plugin - // - iAppUiEngine->PlaybackUtility()->CommandL( EPbCmdClose ); - - StartNewDownloadL( aDlId, aFileName ); - } - } - else - { - StartNewDownloadL( aDlId, aFileName ); - } -} - -// ------------------------------------------------------------------------------------------------- -// CMpxVideoEmbeddedPdlHandler::ConnectToCollectionDownloadL() -// ------------------------------------------------------------------------------------------------- -// -void CMpxVideoEmbeddedPdlHandler::ConnectToCollectionDownloadL( TInt aDlId, TDesC& aFileName ) -{ - MPX_ENTER_EXIT(_L("CMpxVideoEmbeddedPdlHandler::ConnectToCollectionDownloadL()"), - _L("aDlId = %d, aFileName = %S"), aDlId, &aFileName ); - - // - // The playback plugin will not be loaded for collection downloads - // - StartNewDownloadL( aDlId, aFileName ); -} - -// ------------------------------------------------------------------------------------------------- -// CMpxVideoEmbeddedPdlHandler::StartNewDownloadL() -// ------------------------------------------------------------------------------------------------- -// -void CMpxVideoEmbeddedPdlHandler::StartNewDownloadL( TInt aDlId, TDesC& aFileName ) -{ - MPX_ENTER_EXIT(_L("CMpxVideoEmbeddedPdlHandler::StartNewDownloadL()"), - _L("aDlId = %d, aFileName = %S"), aDlId, &aFileName ); - - // - // Save the download parameters - // - iDownloadId = aDlId; - delete iDownloadFileName; - iDownloadFileName = NULL; - iDownloadFileName = aFileName.AllocL(); - - // - // Create the Playback Utility - // - iAppUiEngine->CreateEmbeddedPdlPlaybackUtilityMemberVariablesL(); - - SendPdlCustomCommandL( EPbCmdStartPd, iDownloadId ); - - iAppUiEngine->PlaybackUtility()->InitL( *iDownloadFileName ); -} - -// ------------------------------------------------------------------------------------------------- -// CMpxVideoEmbeddedPdlHandler::SendPdlCustomCommandL() -// ------------------------------------------------------------------------------------------------- -// -void CMpxVideoEmbeddedPdlHandler::SendPdlCustomCommandL( TMPXPlaybackPdCommand aCustomCmd, - TInt aData ) -{ - MPX_ENTER_EXIT(_L("CMpxVideoEmbeddedPdlHandler::SendPdlCustomCommandL"), - _L("aCustomCmd = %d, aData = %d"), aCustomCmd, aData ); - - CMPXCommand* cmd = CMPXCommand::NewL(); - CleanupStack::PushL( cmd ); - - cmd->SetTObjectValueL( KMPXCommandGeneralDoSync, ETrue ); - cmd->SetTObjectValueL( KMPXCommandGeneralId, KMPXCommandIdPlaybackPD ); - cmd->SetTObjectValueL( KMPXCommandPlaybackGeneralType, aCustomCmd ); - cmd->SetTObjectValueL( KMPXCommandPlaybackPDTransactionID, aData ); - cmd->SetTextValueL( KMPXMediaVideoPlaybackFileName, *iDownloadFileName ); - cmd->SetTObjectValueL( KMPXMediaVideoMovePdlFile, ETrue ); - - iAppUiEngine->PlaybackUtility()->CommandL( *cmd ); - - CleanupStack::PopAndDestroy( cmd ); -} - -// EOF