/*! Time-stamp: <@(#)ATBoardTunDVBT2.h   07/02/2011 - 08:00:00   P.Hoogervorst>
*********************************************************************
*  @file   : ATBoardTunDVBT2.h
*
*          : Device supported: AT78, AT788
*
*  Author  : P.Hoogervorst                              Date: 07/05/2007
*
*  Purpose : Implementation of methods for class 
*
*********************************************************************
* Version History:
*
* V 0.10  07/02/2011  BN : First Revision
*
*********************************************************************
*/

#ifndef __ATBOARD_TUN_DVBT2_H__
#define __ATBOARD_TUN_DVBT2_H__

/**********************************************************************************************************/
// includes
#include "ATBoardPlayRec.h"

class CATBoardTunDVBT2 : public CATBoardPlayRec
{
public:
	CATBoardTunDVBT2(void);
public:
	virtual ~CATBoardTunDVBT2(void);

public:

    /*!
     * Do the one time initialize and reset of the tuner. Is done once at startup.
     *
	 * @return BOOL  : TRUE on success, else FALSE
     */
	BOOL Init();


    /*!
     * Set the tuner.
     *
	 * Valid settings:
	 *	nFreq:					50~857MHz in 100kHz steps
	 *	BandWidth:				BANDWIDTH_8_7_MHZ, BANDWIDTH_7_6_MHZ, BANDWIDTH_6_MHZ and BANDWIDTH_5_MHZ (8,7,6, 5MHz)
	 *
     * @param nFreq : Tuning frequency (in Hz)
     * @param BandWidth : Requested modulation bandwidth
     * @param nPLPId : Set PLP ID number
     *
	 * @return BOOL  : TRUE on success, else FALSE
     */
	BOOL Set(u32 nFreq, src_bandwidth_t BandWidth, u8 nPLPId);

    /*!
     * Get status from the tuner.
	 * If bInSync and bLock are high: then the tuner has properly locked to the input signal.
     *
     * @param bInSync : TRUE: Tuner is in sync, FALSE: Tuner is not in sync
     * @param bLock : TRUE: Tuner has detected a lock, FALSE: Tuner has not detected a lock
	 * @param Inversion : spectral inversion selection
	 * @param nSnr : Get the tuner signal to noise ratio. 
	 * @param nBer : Get the tuner bit error rate
     *
	 * @return BOOL  : TRUE on success, else FALSE
     */
	BOOL GetStatus
			(	BOOL &bInSync,
				BOOL &bLock,
				src_spectral_inversion_t &Inversion,
				s32 &nSnr,
				u32 &nBer
			); 

	/*!
	* Get L1PRE status from the tuner.
	*
	* @param L1Pre : L1Pre status
	*
	* @return BOOL  : TRUE on success, else FALSE
	*/
	BOOL GetL1PreStatus (sony_dvb_dvbt2_l1pre_t &L1Pre); 

	/*!
	* Get L1POST status from the tuner.
	*
	* @param L1Post : L1Post status
	*
	* @return BOOL  : TRUE on success, else FALSE
	*/
	BOOL GetL1PostStatus (sony_dvb_dvbt2_l1post_t &L1Post); 

	/*!
	* Get Tune info from the tuner.
	*
	* @param PresetInfo : Tune info
	*
	* @return BOOL  : TRUE on success, else FALSE
	*/
	BOOL GetTuneInfo (sony_dvb_demod_t2_preset_t &PresetInfo); 

	/*!
	* Get PLP info from the tuner.
	*
	* @param PLPInfo : PLP info
	*
	* @return BOOL  : TRUE on success, else FALSE
	*/
	BOOL GetPLPInfo (sony_dvb_dvbt2_plp_info_t &PLPInfo); 
};

#endif //__ATBOARD_TUN_DVBT_H__
