diff -r 000000000000 -r 1bce908db942 multimediacommsengine/tsrc/MCETestUI/MCETestUIEngine/src/CMCETestUIEngineCodec.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/multimediacommsengine/tsrc/MCETestUI/MCETestUIEngine/src/CMCETestUIEngineCodec.cpp Tue Feb 02 01:04:58 2010 +0200 @@ -0,0 +1,163 @@ +/* +* Copyright (c) 2005 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: +* +*/ + + + + +// MCE API + + +//#include +#include +#include +//#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "CMCETestUIEngine.h" +#include "MCETestUIEngineConstants.h" +#include "CMCETestUIEngineCodec.h" + +#include "TMCETestUIEngineCmdBase.h" +#include "TMCETestUIEngineCmdDeleteAudioCodec.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CMCETestUIEngineCodec::NewL() +// ----------------------------------------------------------------------------- +// +CMCETestUIEngineCodec* CMCETestUIEngineCodec::NewL( + CMCETestUIEngine& aEngine, + CMceAudioCodec& aCodec ) + { + + CMCETestUIEngineCodec* self = + new (ELeave) CMCETestUIEngineCodec( aEngine, + aCodec ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CMCETestUIEngineCodec::CMCETestUIEngineCodec +// ----------------------------------------------------------------------------- +// +CMCETestUIEngineCodec::CMCETestUIEngineCodec( + CMCETestUIEngine& aEngine, + CMceAudioCodec& aCodec ) + : iEngine( aEngine ), + iCodec( aCodec ) + { + } + +// ----------------------------------------------------------------------------- +// CMCETestUIEngineCodec::ConstructL() +// ----------------------------------------------------------------------------- +// +void CMCETestUIEngineCodec::ConstructL() + { + return; + } + +// ----------------------------------------------------------------------------- +// CMCETestUIEngineCodec::~CMCETestUIEngineCodec +// ----------------------------------------------------------------------------- +// +EXPORT_C CMCETestUIEngineCodec::~CMCETestUIEngineCodec() + { + iCommands.ResetAndDestroy(); + } + +// ----------------------------------------------------------------------------- +// CMCETestUIEngineCodec::GetCommands +// ----------------------------------------------------------------------------- +// +const RPointerArray& + CMCETestUIEngineCodec::GetCommandsL() + { + iCommands.ResetAndDestroy(); + if ( iCodec.State() == CMceCodec::EDisabled ) + { + iCommands.Append( new (ELeave) TMCETestUIEngineCmdEnableAudioCodec( + iEngine, *this ) ); + iCommands.Append( new (ELeave) TMCETestUIEngineCmdStandByAudioCodec( + iEngine, *this ) ); + } + else if(iCodec.State() == CMceCodec::EEnabled) + { + iCommands.Append( new (ELeave) TMCETestUIEngineCmdDisableAudioCodec( + iEngine, *this ) ); + iCommands.Append( new (ELeave) TMCETestUIEngineCmdStandByAudioCodec( + iEngine, *this ) ); + } + else if(iCodec.State() == CMceCodec::EStandby) + { + iCommands.Append( new (ELeave) TMCETestUIEngineCmdEnableAudioCodec( + iEngine, *this ) ); + iCommands.Append( new (ELeave) TMCETestUIEngineCmdDisableAudioCodec( + iEngine, *this ) ); + } + iCommands.Append( new (ELeave) TMCETestUIEngineCmdDeleteAudioCodec( + iEngine, *this ) ); + return iCommands; + } +// ----------------------------------------------------------------------------- +// CMCETestUIEngineCodec::Codec +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceAudioCodec& CMCETestUIEngineCodec::Codec() + { + return iCodec; + } +// ----------------------------------------------------------------------------- +// CMCETestUIEngineCodec::State +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC16& CMCETestUIEngineCodec::State() const + { + if(iCodec.State() == CMceCodec::EEnabled) + { + return KCodecStateEnabled; + } + else if(iCodec.State() == CMceCodec::EDisabled) + { + return KCodecStateDisabled; + } + return KCodecStateStandBy; + } + + + +// ----------------------------------------------------------------------------- +// CMCETestUIEngineCodec::Type +// ----------------------------------------------------------------------------- +// + +EXPORT_C TMceCodecType CMCETestUIEngineCodec::Type() +{ + return iCodec.Type(); +}