diff -r 000000000000 -r 1bce908db942 multimediacommsengine/tsrc/MMCTestDriver/MCETester/src/TCmdGetSinkStatus.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/multimediacommsengine/tsrc/MMCTestDriver/MCETester/src/TCmdGetSinkStatus.cpp Tue Feb 02 01:04:58 2010 +0200 @@ -0,0 +1,100 @@ +/* +* 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: Implementation +* +*/ + + + +#include "MCEConstants.h" +#include "TCmdGetSinkStatus.h" +#include "CTcMCEContext.h" +#include +#include +#include +#include +#include +#include + +void TCmdGetSinkStatus::ExecuteL() + { + // ---------- Setup -------------------------------------------------------- + + // Get stream + CMceMediaStream* mediaStream = reinterpret_cast + (GetObjectForIdL(KStreamId, ETrue)); + + CMceMediaStream* stream = NULL; + + if ( mediaStream->Type() == KMceAudio ) + { + stream = dynamic_cast(mediaStream); + } + else if( mediaStream->Type() == KMceVideo ) + { + stream = dynamic_cast(mediaStream); + } + else + { + User::Leave( KErrNotSupported ); + } + + + // ---------- Execution ---------------------------------------------------- + AddIdResponseL( KStreamId, *mediaStream ); + + const RPointerArray& mediaSinks = + stream->Sinks(); + + for( TInt i = mediaSinks.Count()-1; i >= 0; i-- ) + { + const CMceMediaSink *sink = mediaSinks[i]; + if( sink->Type() == KMceDisplaySink) + { + TBool sinkState = sink->IsEnabled(); + _LIT8( KValueDisplaySink, "Display" ); + AddBooleanResponseL( KValueDisplaySink, sinkState); + } + else if( sink->Type() == KMceRTPSink) + { + TBool sinkState = sink->IsEnabled(); + AddBooleanResponseL( KValueSinkRTP, sinkState); + } + else if( sink->Type() == KMceSpeakerSink) + { + TBool sinkState = sink->IsEnabled(); + AddBooleanResponseL( KValueSinkSpeaker,sinkState); + } + else + { + // Keep pc-lint happy + } + } + + // ---------- Response creation -------------------------------------------- + + AddIdResponseL( KStreamId, *stream ); + // Sink added to response during execution + + } + +TBool TCmdGetSinkStatus::Match( const TTcIdentifier& aId ) + { + return TTcMceCommandBase::Match( aId, _L8("GetSinkStatus") ); + } + +TTcCommandBase* TCmdGetSinkStatus::CreateL( MTcTestContext& aContext ) + { + return new( ELeave ) TCmdGetSinkStatus( aContext ); + }