diff -r 000000000000 -r 1bce908db942 multimediacommsengine/tsrc/MCETestUI/src/createSpeakerSinkDialog.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/multimediacommsengine/tsrc/MCETestUI/src/createSpeakerSinkDialog.cpp Tue Feb 02 01:04:58 2010 +0200 @@ -0,0 +1,112 @@ +/* +* Copyright (c) 2004 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: +* +*/ + + + + +// INCLUDES +#include "createSpeakerSinkDialog.h" +#include "CMCETestUIEngineAudioStream.h" +#include "CMCETestUIEngineSink.h" +#include +#include +#include +// CONSTANTS + +const TInt KBufLength = 100; + +// ============================ MEMBER FUNCTIONS ============================== + +// ---------------------------------------------------------------------------- +// CCreateSpeakerSinkDialog::CCreateSpeakerSinkDialog( ) +// . +// ---------------------------------------------------------------------------- +// +CCreateSpeakerSinkDialog::CCreateSpeakerSinkDialog( + CMCETestUIEngineAudioStream& aStream, TInt aIndex ) : + iStream(aStream),iSinkIndex( aIndex ) + { + + // No implementation required + } + +// ---------------------------------------------------------------------------- +// CCreateSpeakerSinkDialog::PreLayoutDynInitL() +// . +// ---------------------------------------------------------------------------- +// +void CCreateSpeakerSinkDialog::PreLayoutDynInitL() + { + CAknForm::PreLayoutDynInitL(); + + const RPointerArray& sinks = + iStream.SinksL(); + CMceMediaSink& mediaSink = static_cast(sinks[iSinkIndex]->Sink()); + CMceSpeakerSink& speakerSink = static_cast(mediaSink); + + CEikNumberEditor* volume = static_cast( + Control( ESpeakerSinkVolumeSetting ) ); + volume->SetNumber(speakerSink.VolumeL()); + // volume->SetNumber(50); + + CEikNumberEditor* routing = static_cast( + Control( ESpeakerSinkRoutingSetting ) ); + routing->SetNumber(speakerSink.RoutingL()); + + + } + +// ---------------------------------------------------------------------------- +// CCreateSpeakerSinkDialog::OkToExitL( TInt ) +// . +// ---------------------------------------------------------------------------- +// + +TBool CCreateSpeakerSinkDialog::OkToExitL( TInt aKey ) + { + if ( aKey == EEikCmdCanceled ) + { + // Cancel pressed. Just exit. + return ETrue; + } + const RPointerArray& sinks = + iStream.SinksL(); + + CMceMediaSink& mediaSink = static_cast(sinks[iSinkIndex]->Sink()); + CMceSpeakerSink& speakerSink = static_cast(mediaSink); + + CEikNumberEditor* volume = static_cast( + Control( ESpeakerSinkVolumeSetting ) ); + speakerSink.SetVolumeL( volume->Number() ); + + CEikNumberEditor* routing = static_cast( + Control( ESpeakerSinkRoutingSetting ) ); + speakerSink.SetRoutingL( routing->Number() ); + return ETrue; + } + +// ---------------------------------------------------------------------------- +// CCreateSpeakerSinkDialog::~CCreateRtpSinkDialog() +// . +// ---------------------------------------------------------------------------- +// +CCreateSpeakerSinkDialog::~CCreateSpeakerSinkDialog() + { + return; + } + +// End of File