diff -r 2a9601315dfc -r 98ccebc37403 javauis/mmapi_qt/baseline/src/cmmamidipitchcontrol.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/mmapi_qt/baseline/src/cmmamidipitchcontrol.cpp Fri May 14 15:47:24 2010 +0300 @@ -0,0 +1,82 @@ +/* +* Copyright (c) 2002 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: This class is a PitchControl. +* +*/ + + +// INCLUDE FILES +#include + +#include "cmmamidipitchcontrol.h" +#include "cmmamidiplayer.h" + +CMMAMIDIPitchControl* CMMAMIDIPitchControl::NewL(CMMAMIDIPlayer* aPlayer) +{ + CMMAMIDIPitchControl* self = new(ELeave) CMMAMIDIPitchControl(aPlayer); + return self; +} + +CMMAMIDIPitchControl::CMMAMIDIPitchControl(CMMAMIDIPlayer* aPlayer) +{ + iPlayer = aPlayer; + LOG( EJavaMMAPI, EInfo, "MMA:CMMAMIDIPitchControl::CMMAMIDIPitchControl"); +} + +CMMAMIDIPitchControl::~CMMAMIDIPitchControl() +{ + LOG( EJavaMMAPI, EInfo, "MMA:CMMAMIDIPitchControl::~CMMAMIDIPitchControl"); +} + +const TDesC& CMMAMIDIPitchControl::ClassName() const +{ + LOG( EJavaMMAPI, EInfo, "MMA:CMMAMIDIPitchControl::ClassName"); + return KMIDIPitchControlName; +} + + +TInt CMMAMIDIPitchControl::PitchL() +{ + return iPlayer->MidiClient()->PitchTranspositionCentsL(); +} + +TInt CMMAMIDIPitchControl::SetPitchL(TInt aPitch) +{ + TInt pitch = aPitch; + if (aPitch > KMIDIPitchControlMaxPitch) + { + pitch = KMIDIPitchControlMaxPitch; + } + else if (aPitch < KMIDIPitchControlMinPitch) + { + pitch = KMIDIPitchControlMinPitch; + } + iPlayer->MidiClient()->SetPitchTranspositionL(pitch); + + return PitchL(); // return the actual Pitch +} + +// this method is intentionally left leaving to allow leaving implementation in the future +TInt CMMAMIDIPitchControl::MaxPitchL() +{ + return KMIDIPitchControlMaxPitch; +} + +// this method is intentionally left leaving to allow leaving implementation in the future +TInt CMMAMIDIPitchControl::MinPitchL() +{ + return KMIDIPitchControlMinPitch; +} + +// END OF FILE