javauis/amms_akn/src_tuner/native/inc/ammstunerfactory.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 13 Oct 2010 14:23:59 +0300
branchRCL_3
changeset 83 26b2b12093af
parent 19 04becd199f91
permissions -rw-r--r--
Revision: v2.2.17 Kit: 201041

/*
* 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:  This class is used to create tuner player and control
*
*/



#ifndef AMMSTUNERFACTORY_H
#define AMMSTUNERFACTORY_H

//  INCLUDES
#include <e32base.h>

#include "CAMMSTunerControl.h"

// FORWARD DECLARATIONS
class CAMMSTunerPlayer;
class CAMMSTunerControl;

// CLASS DECLARATION
/**
*  This class is used to create tuner player and control.
*  It parses locator parameters and set them to control.
*/

NONSHARABLE_CLASS(AMMSTunerFactory)
{
public:  // Constructors and destructor

    /**
    * Destructor.
    */
    virtual ~AMMSTunerFactory();

public: // New functions

    /**
    * ?member_description.
    * @param aTunerPlayer
    * @param aLocatorParams
    */
    static void CreatePlayerL(CAMMSTunerPlayer** aTunerPlayer,
                              const TDesC* aLocatorParams);

protected:  // New functions

    /**
    * Parse all locator parameters.
    * @param aLocatorParams
    * @param aFrequency
    * @param aStereoMode
    * @param aPreset
    */
    static void ParseParamsL(const TDesC* aLocatorParams,
                             TInt& aFrequency,
                             TInt& aStereoMode,
                             TInt& aPreset);

    /**
    * Parses frequency parameter
    * @param aFrequency - locator's frequency parameter
    * @return frequency in TInt
    */
    static TInt ParseFreqL(const TPtrC aFrequency);

    /**
    * Converts TPtrC to TReal using TLex.
    * @param aHertz - hertzs in TPtrC
    * @return hertzs in TReal
    */
    static TReal TDesCToTRealL(const TPtrC aHertz);

private:

    /**
    * C++ default constructor.
    */
    AMMSTunerFactory();
};

#endif // AMMSTUNERFACTORY_H

// End of File